UNPKG

@adyen/kyc-components

Version:

This guide assumes that you have already an account with Adyen. A legalEntity needs to be created, and you need to have a `legalEntityId` to instatiate a Component.

1,284 lines 70.1 kB
try { let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack; n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "9592b543-6ac8-408a-993a-3d565bee7f89", e._sentryDebugIdIdentifier = "sentry-dbid-9592b543-6ac8-408a-993a-3d565bee7f89"); } catch (e) {} import { i as Typography, o as createLogger, r as useTranslation, t as Trans } from "./translation-BYvhW5zA.js"; import { j as useToggleContext, k as Header, x as Alert } from "./resolveEnvironment-DNmu53Rr.js"; import { n as IconButton, r as Loader, t as Button } from "./Button-i8I2dHP8.js"; import { n as httpGet, s as useApiContext } from "./http-8qgzqVqk.js"; import { r as useLegalEntity } from "./useLegalEntity-CtlUQv_J.js"; import { t as StackLayout } from "./StackLayout-IUdNMDgW.js"; import { n as Status } from "./TaskVerificationStatus-CKHPTEpH.js"; import { i as TaskStatuses } from "./taskStatus-BtekPA8E.js"; import { a as setNestedValue, i as resolveComponentProps, r as getNestedValue$4, t as TaskListItem } from "./TaskListItem-DYISbC7G.js"; import { t as useBusinessLines } from "./useBusinessLines-BFsRoAAj.js"; import { t as Card } from "./Card-BCGLpdw7.js"; import { r as KEYBOARD_KEYS, t as Modal } from "./Modal-BLP2aF-u.js"; import { c as CompanyTypesValues } from "./bafinUtils-BKq-s1Ka.js"; import { t as EndStateLayout } from "./EndStateLayout-CBRHUXyY.js"; import { n as translateTranslatable, r as LoaderWrapper } from "./utils-C1buyvRw.js"; import { t as Confirm } from "./Confirm-CA-gL38n.js"; import { n as Image } from "./unincorporated-partnership-nnTW3FnG.js"; import { t as useUpdateLegalEntity } from "./useUpdateLegalEntity-B0XYfxbB.js"; import { a as FormFlow_module_default } from "./useFormContext-CYHfY4k5.js"; import { t as List } from "./List-ywoRPg-q.js"; import { t as MaskedInput } from "./MaskedInput-_dYxgb7_.js"; import { t as ProgressBar } from "./ProgressBar-DWFxLMUA.js"; import { a as fromIndividualConflictSchema, d as useExtractDocumentInformation, f as IdentityNumber, i as mapExtractionResultToSchema, l as useDataConflicts, n as UploadedDocument, o as toIndividualConflictSchema, r as useIdVerificationToken, s as IdVerificationMethod_module_default, t as validateExtractionResult } from "./validateExtractionResult-BTnVuGgD.js"; import { A as taxInformationDefaultFieldMetadata, C as getTaxIdNumberOptions, S as getDefaultTaxIdNumberType, k as taxInformationDefaultFieldConfig, n as upsertTaxInfoForCountry, r as TaxIdNumberTypeSelector, t as removeTaxInfoForCountry, v as COUNTRIES_WITH_POSSIBLE_TRUSTEE_TAXID_ABSENT_V4 } from "./utils-C9vhUXDJ.js"; import { t as resolveFieldMetadata } from "./fieldConfigurations-CZCFghnK.js"; import { t as Field } from "./Field-DoXLi6EY.js"; import { t as LandingLayout } from "./LandingLayout-CUAkXrpL.js"; import { t as Select } from "./Select-DUo2rOfa.js"; import { t as Checkbox } from "./Checkbox-D7BRIoQL.js"; import { t as Link } from "./Link-JFzfaUOa.js"; import { t as InputText } from "./InputText-B0N7am-q.js"; import { t as DataConflictsModal } from "./DataConflictsModal-DXsYUQRX.js"; import { t as AcceptTermsOfServiceComponent } from "./AcceptTermsOfServiceComponent-BAP8iSCH.js"; import { t as Divider } from "./Divider-BENvVRnz.js"; import { t as ListItem } from "./ListItem-V4x0raZw.js"; import { i as getCompanyRegistrationNumberOptions, l as registrationNumberDefaultFieldConfig, n as getDefaultRegistrationNumberType, t as CompanyRegistrationNumberTypeSelector, u as registrationNumberDefaultFieldMetadata } from "./CompanyRegistrationNumberTypeSelector-CEyBgEhu.js"; import { n as useCreateBusinessLine, r as useIndustryCodes, t as useUpdateBusinessLine } from "./useUpdateBusinessLines-Cncate8L.js"; import { t as SourceOfFundsPage } from "./SourceOfFundsPage-DbQ6IQy3.js"; import { t as TaxReportingDropin } from "./TaxReportingDropin-CJmwUlt2.js"; import { lazy } from "preact/compat"; import { useCallback as useCallback$1, useContext as useContext$1, useEffect as useEffect$1, useMemo as useMemo$1, useRef as useRef$1, useState as useState$1 } from "preact/hooks"; import { Fragment as Fragment$1, jsx, jsxs } from "preact/jsx-runtime"; import { useComputed } from "@preact/signals"; import { skipToken, useQuery } from "@tanstack/preact-query"; import { createContext as createContext$1 } from "preact"; import { Onfido } from "onfido-sdk-ui"; import { createFormHook, createFormHookContexts, useStore } from "@tanstack/react-form"; //#region src/api/adaptive/useAdaptiveWorkflow.ts /** * Retrieves UI manifest used to render an adaptive UI * determined by the requirements engine based on the * requested products for a LE */ var getUiManifest = async (baseUrl, rootLegalEntityId) => { return await httpGet({ baseUrl, path: `legalEntities/${rootLegalEntityId}/configurations/workflow` }); }; var useAdaptiveWorkflow = (options) => { const { baseUrl, rootLegalEntityId } = useApiContext(); return useQuery({ queryKey: ["adaptive-workflow"], queryFn: () => getUiManifest(baseUrl.value, rootLegalEntityId.value), ...options }); }; //#endregion //#region src/context/WorkflowContext/WorkflowContext.tsx var WorkflowContext = createContext$1(void 0); //#endregion //#region src/context/WorkflowContext/useWorkflowContext.ts function useWorkflowContext() { return useContext$1(WorkflowContext); } var AdaptiveProgressBar_module_default = { "adaptive-progress-bar": "_adaptive-progress-bar_wl3oz_1", adaptiveProgressBar: "_adaptive-progress-bar_wl3oz_1", "adaptive-progress-bar-step": "_adaptive-progress-bar-step_wl3oz_7", adaptiveProgressBarStep: "_adaptive-progress-bar-step_wl3oz_7", "adaptive-progress-bar-label": "_adaptive-progress-bar-label_wl3oz_13", adaptiveProgressBarLabel: "_adaptive-progress-bar-label_wl3oz_13" }; //#endregion //#region src/components/ui/molecules/AdaptiveProgressBar/AdaptiveProgressBar.tsx var AdaptiveProgressBar = ({ steps, ariaLabel }) => { return /* @__PURE__ */ jsx("div", { className: AdaptiveProgressBar_module_default.adaptiveProgressBar, role: "group", "aria-label": ariaLabel, children: steps.map((step) => /* @__PURE__ */ jsxs("div", { className: AdaptiveProgressBar_module_default.adaptiveProgressBarStep, style: { flex: step.flex ?? 1 }, children: [/* @__PURE__ */ jsx(ProgressBar, { progress: step.progress, ariaLabel: step.name, rounded: true }), /* @__PURE__ */ jsx(Typography, { color: "tertiary", el: "span", variant: "caption", className: AdaptiveProgressBar_module_default.adaptiveProgressBarLabel, children: step.name })] }, step.name)) }); }; var AdaptiveWorkflow_module_default = { "adaptive-workflow-header": "_adaptive-workflow-header_1mua9_1", adaptiveWorkflowHeader: "_adaptive-workflow-header_1mua9_1", "adaptive-workflow-main": "_adaptive-workflow-main_1mua9_7", adaptiveWorkflowMain: "_adaptive-workflow-main_1mua9_7", "adaptive-workflow-heading": "_adaptive-workflow-heading_1mua9_14", adaptiveWorkflowHeading: "_adaptive-workflow-heading_1mua9_14", "adaptive-workflow-description": "_adaptive-workflow-description_1mua9_18", adaptiveWorkflowDescription: "_adaptive-workflow-description_1mua9_18", "adaptive-workflow-divider": "_adaptive-workflow-divider_1mua9_22", adaptiveWorkflowDivider: "_adaptive-workflow-divider_1mua9_22", "adaptive-workflow-actions": "_adaptive-workflow-actions_1mua9_26", adaptiveWorkflowActions: "_adaptive-workflow-actions_1mua9_26" }; //#endregion //#region src/adaptiveWorkflow/components/Fields/AcceptTermsOfServiceWorkflow/AcceptTermsOfServiceWorkflow.tsx var AcceptTermsOfServiceWorkflow = ({ onComplete, onClose }) => { const { entity } = useWorkflowContext(); if (!entity.value?.id) return /* @__PURE__ */ jsx(EndStateLayout, { variant: "error", title: "Something went wrong", description: "Please try again later" }); return /* @__PURE__ */ jsx(AcceptTermsOfServiceComponent, { legalEntityId: entity.value.id, onComplete, onClose }); }; //#endregion //#region src/adaptiveWorkflow/formHook.ts var { fieldContext, formContext } = createFormHookContexts(); /** * Shared form hook for the adaptive workflow. * * - `useAppForm` replaces `useForm` and provides context-aware form instances. * - `withForm` wraps compound components so they receive `form` via context, * eliminating the need to pass the form instance (and its complex generics) as a prop. * * @see https://tanstack.com/form/latest/docs/framework/react/guides/form-composition */ var { useAppForm, withForm } = createFormHook({ fieldContext, formContext, fieldComponents: {}, formComponents: {} }); //#endregion //#region src/adaptiveWorkflow/components/Fields/BusinessRegistrationNumber/ExemptedFromRegistrationNumberField.tsx function ExemptedFromRegistrationNumberField({ field, label, checked, readonly, onChange }) { return /* @__PURE__ */ jsx(Field, { name: field.name, children: (childProps) => /* @__PURE__ */ jsx(Checkbox, { ...childProps, "aria-required": false, "aria-invalid": false, name: field.name, label, value: "exemptedFromRegistrationNumber", checked, readonly, onChange }) }); } //#endregion //#region src/adaptiveWorkflow/components/Fields/BusinessRegistrationNumber/RegistrationNumberInputField.tsx function RegistrationNumberInputField({ field, fieldMetadata, currentValue, helperText, readonly, optional, shouldValidate, disabled, onInput, onBlur }) { const { t } = useTranslation("common"); const isTouched = field.state.meta.isTouched; const isValid = field.state.meta.isValid; const errorMessage = isTouched && !isValid ? field.state.meta.errors[0] : void 0; return /* @__PURE__ */ jsx(MaskedInput, { "aria-required": true, "aria-invalid": isTouched && !isValid, name: "registrationNumber", type: "text", value: currentValue, label: fieldMetadata.label ? t(($) => $[fieldMetadata.label]) ?? "" : "", formatGuidance: fieldMetadata.guidanceText ? translateTranslatable(t, fieldMetadata.guidanceText) : void 0, errorMessage, isValid: isTouched && isValid && !!currentValue, onInput, onBlur, disabled, optional, readonly, shouldValidate: !optional && shouldValidate, helper: helperText, ...fieldMetadata.mask ?? {} }); } //#endregion //#region src/adaptiveWorkflow/components/Fields/BusinessRegistrationNumber/RegistrationNumberTypeSelectorField.tsx function RegistrationNumberTypeSelectorField({ country, companyType, selected, onTypeChange, exemptedOptionLabel }) { return /* @__PURE__ */ jsx(CompanyRegistrationNumberTypeSelector, { country, companyType, selected, setSelected: onTypeChange, exemptedOptionLabel }); } //#endregion //#region src/adaptiveWorkflow/components/Fields/BusinessRegistrationNumber/BusinessRegistrationNumberFieldGroup.tsx function getNestedValue$3(obj, path) { return path.split(".").reduce((acc, key) => acc?.[key], obj); } var BusinessRegistrationNumberFieldGroup = withForm({ defaultValues: {}, props: {}, render: function BusinessRegistrationNumberFieldGroupRender({ form, basePath: registrationNumberPath, country, canExempt, companyType, state, helperText, labels, readonly, optional, shouldValidate }) { const registrationNumberTypePath = `organization.registrationNumberType`; const exemptedPath = `organization.exemptedFromRegistrationNumber`; const registrationNumber = useStore(form.store, (s) => getNestedValue$3(s.values, registrationNumberPath)); const registrationNumberType = useStore(form.store, (s) => getNestedValue$3(s.values, registrationNumberTypePath)); const exemptedFromRegistrationNumber = useStore(form.store, (s) => getNestedValue$3(s.values, exemptedPath)); const registrationNumberOptions = getCompanyRegistrationNumberOptions(country, companyType); const defaultType = getDefaultRegistrationNumberType(registrationNumber, country, companyType); const showExemptedOption = canExempt && !!registrationNumberOptions && registrationNumberOptions.length > 1; const effectiveRegistrationNumberType = exemptedFromRegistrationNumber ? "exempted" : registrationNumberType ?? defaultType; const fieldMetadata = resolveFieldMetadata(registrationNumberDefaultFieldConfig[country], { registrationNumberType: effectiveRegistrationNumberType === "exempted" ? void 0 : effectiveRegistrationNumberType, state }, registrationNumberDefaultFieldMetadata); if (effectiveRegistrationNumberType && effectiveRegistrationNumberType !== "exempted" && !registrationNumberOptions?.find((o) => o.id === effectiveRegistrationNumberType)) form.setFieldValue(registrationNumberTypePath, defaultType); const handleRegistrationNumberChange = useCallback$1((e) => { const value = typeof e === "string" ? e : e.currentTarget.value; form.setFieldValue(registrationNumberPath, value); form.setFieldValue(registrationNumberTypePath, effectiveRegistrationNumberType === "exempted" ? void 0 : effectiveRegistrationNumberType); }, [ form, registrationNumberPath, registrationNumberTypePath, effectiveRegistrationNumberType ]); const handleExemptedFromRegistrationNumber = useCallback$1((exempt) => { if (exempt) form.setFieldValue(registrationNumberPath, ""); form.setFieldValue(exemptedPath, exempt); }, [ exemptedPath, form, registrationNumberPath ]); const handleCompanyRegistrationNumberTypeChange = useCallback$1((regNumberType) => { if (regNumberType === "exempted") { if (!canExempt) throw new Error(`${country} does not allow registration number exemptions`); form.setFieldValue(registrationNumberPath, ""); form.setFieldValue(exemptedPath, true); form.setFieldValue(registrationNumberTypePath, void 0); return; } if (canExempt && exemptedFromRegistrationNumber) form.setFieldValue(exemptedPath, false); form.setFieldValue(registrationNumberPath, ""); form.setFieldValue(registrationNumberTypePath, regNumberType); }, [ canExempt, country, exemptedFromRegistrationNumber, exemptedPath, form, registrationNumberPath, registrationNumberTypePath ]); return /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx(form.Field, { name: registrationNumberTypePath, children: (field) => /* @__PURE__ */ jsx(RegistrationNumberTypeSelectorField, { field, country, companyType, selected: effectiveRegistrationNumberType, onTypeChange: handleCompanyRegistrationNumberTypeChange, exemptedOptionLabel: showExemptedOption ? labels.exemptedFromRegistrationNumber : void 0 }) }), /* @__PURE__ */ jsx(form.Field, { name: registrationNumberPath, children: (field) => /* @__PURE__ */ jsx(RegistrationNumberInputField, { field, fieldMetadata, currentValue: registrationNumber ?? "", helperText, readonly, optional, shouldValidate, disabled: Boolean(exemptedFromRegistrationNumber), onInput: (e) => handleRegistrationNumberChange(e), onBlur: (e) => handleRegistrationNumberChange(e) }) }), canExempt && !showExemptedOption && /* @__PURE__ */ jsx(form.Field, { name: exemptedPath, children: (field) => /* @__PURE__ */ jsx(ExemptedFromRegistrationNumberField, { field, label: labels.exemptedFromRegistrationNumber, checked: Boolean(exemptedFromRegistrationNumber), readonly, onChange: handleExemptedFromRegistrationNumber }) }) ] }); } }); //#endregion //#region src/adaptiveWorkflow/components/Fields/IdentityNumber/IdentityNumberFieldGroup.tsx function getNestedValue$2(obj, path) { return path.split(".").reduce((acc, key) => acc?.[key], obj); } function getEventValue(value) { if (value && typeof value === "object" && "currentTarget" in value) { const currentTarget = value.currentTarget; if (currentTarget?.type === "checkbox") return currentTarget.checked; return currentTarget?.value; } return value; } var IdentityNumberFieldGroup = withForm({ defaultValues: {}, props: {}, render: function IdentityNumberFieldGroupRender({ form, basePath, country, idNumberType, optionalFields, readOnlyFields, obscuredFields }) { const idNumberPath = `${basePath}.idNumber`; const idNumberExemptPath = `${basePath}.idNumberExempt`; return /* @__PURE__ */ jsx(IdentityNumber, { country, data: useStore(form.store, (s) => ({ idNumber: getNestedValue$2(s.values, idNumberPath), idNumberExempt: getNestedValue$2(s.values, idNumberExemptPath) })), errors: {}, fieldValidationErrors: {}, handleFieldChange: useCallback$1((fieldName, _mode) => (value) => { const fieldPath = fieldName === "idNumber" ? idNumberPath : idNumberExemptPath; form.setFieldValue(fieldPath, getEventValue(value)); }, [ form, idNumberPath, idNumberExemptPath ]), idNumberType, obscuredFields, optionalFields, readOnlyFields, requiredFields: ["idNumber"], valid: { idNumber: true, idNumberExempt: true } }); } }); //#endregion //#region src/adaptiveWorkflow/components/Fields/IdentityScreening/IdentityScreeningWorkflow.tsx var passportFrontGreenImage = lazy(() => import("./passport-front-green-BWuD3-Fs.js")); var containerId = "adyen-kyc-id-verification"; var logger = createLogger(); var hasMinimumApplicantDetails = (details) => Boolean(details.firstName && details.lastName && details.residencyCountry); var getOnfidoLocaleConfig = (locale, t) => { const language = locale.substring(0, 2); return language === "en" ? { locale: language, phrases: { "country_select.button_primary": t(($) => $["continue"]), "doc_submit.title_id_back": t(($) => $["identityCardBack"]), "doc_submit.title_id_front": t(($) => $["identityCardFront"]), "doc_submit.title_license_back": t(($) => $["drivinglicenseBack"]), "doc_submit.title_license_front": t(($) => $["drivinglicenseFront"]), "doc_submit.title_passport": t(($) => $["passportPhotoPage"]), "doc_submit.title_permit_back": t(($) => $["residencePermitBack"]), "doc_submit.title_permit_front": t(($) => $["residencePermitFront"]) } } : language; }; var initOnfido = async ({ containerEl, token, t, locale, onComplete, onError, showMotionCapture }) => { const steps = [{ type: "document", options: { documentTypes: { passport: true, driving_licence: true, national_identity_card: true, residence_permit: false } } }, showMotionCapture ? { type: "face", options: { requestedVariant: "motion" } } : void 0].filter(Boolean); return Onfido.init({ token, containerEl, disableAnalytics: false, onComplete, onError, steps, language: getOnfidoLocaleConfig(locale, t) }); }; function OnfidoCaptureModal({ closeModal, legalEntityId, minimumApplicantDetails, onComplete, onError, showMotionCapture }) { const containerRef = useRef$1(null); const onfidoSdk = useRef$1(); const { t, i18n } = useTranslation("individual"); const { data: tokenResponse, isLoading, isError } = useIdVerificationToken(minimumApplicantDetails, legalEntityId); useEffect$1(() => { (async () => { if (!tokenResponse) return; if (!containerRef.current) throw new Error("No container for Onfido found"); onfidoSdk.current = await initOnfido({ containerEl: containerRef.current, token: tokenResponse.sdkToken, t, locale: i18n.language, onComplete, onError, showMotionCapture }); })().catch(logger.error); return async () => { if (onfidoSdk.current) await onfidoSdk.current.tearDown(); }; }, [ i18n.language, legalEntityId, minimumApplicantDetails, onComplete, onError, showMotionCapture, t, tokenResponse ]); return /* @__PURE__ */ jsx(Modal, { size: "medium", onClose: closeModal, ariaLabel: t(($) => $["identityVerification"]), children: /* @__PURE__ */ jsx(LoaderWrapper, { status: tokenResponse ? "success" : isLoading ? "loading" : isError ? "error" : "pending", children: /* @__PURE__ */ jsx("div", { ref: containerRef, className: containerId }) }) }); } function IdentityScreeningWorkflow({ resourceId, legalEntityId, minimumApplicantDetails, providedData, extractionResult, onfidoResult, simulateOnfidoCompletion, existingDocument, requiresDocumentExtraction = true, showMotionCapture, onComplete, onClose }) { const resolvedLegalEntityId = resourceId ?? legalEntityId; const { data: legalEntity, isLoading: isLegalEntityLoading, isError: isLegalEntityError } = useLegalEntity(Boolean(resolvedLegalEntityId && (!minimumApplicantDetails || !providedData)) && resolvedLegalEntityId ? resolvedLegalEntityId : skipToken); const { t: commonT } = useTranslation("common"); const { t: individualT } = useTranslation("individual"); const extractDocumentInformation = useExtractDocumentInformation(); const [status, setStatus] = useState$1("ready"); const [document, setDocument] = useState$1(existingDocument); const [errorKey, setErrorKey] = useState$1(); const [extractedData, setExtractedData] = useState$1(); const resolvedMinimumApplicantDetails = minimumApplicantDetails ?? { firstName: legalEntity?.individual?.name?.firstName, lastName: legalEntity?.individual?.name?.lastName, residencyCountry: legalEntity?.individual?.residentialAddress?.country }; const resolvedProvidedData = providedData ?? { firstName: legalEntity?.individual?.name?.firstName, lastName: legalEntity?.individual?.name?.lastName, birthDate: legalEntity?.individual?.birthData?.dateOfBirth, idNumber: legalEntity?.individual?.identificationData?.number }; const conflictData = useDataConflicts(resolvedProvidedData, extractedData); const isApplicantDetailsReady = hasMinimumApplicantDetails(resolvedMinimumApplicantDetails); const getExtractionResult = async (result) => { if (extractionResult) return extractionResult; try { const documentIds = [result.document_front.id]; if (result.document_back) documentIds.push(result.document_back.id); return await extractDocumentInformation.mutateAsync({ documents: documentIds.map((documentId) => ({ documentId })) }); } catch { setErrorKey("weCouldNotExtractDocumentInformation"); setStatus("ready"); return; } }; const handleOnfidoComplete = async (result) => { setErrorKey(void 0); if (!requiresDocumentExtraction) { onComplete(); return; } setStatus("extractionLoading"); const resolvedExtractionResult = await getExtractionResult(result); if (!resolvedExtractionResult) { setDocument({ instantIdVerificationData: result, idDocumentType: result.document_front.type, modificationDate: (/* @__PURE__ */ new Date()).toISOString() }); setStatus("ready"); return; } const validationError = validateExtractionResult(resolvedExtractionResult); if (validationError) { setErrorKey(validationError.key); setStatus("ready"); return; } const mappedExtractionResult = mapExtractionResultToSchema(resolvedExtractionResult); setDocument({ instantIdVerificationData: result, idDocumentType: result.document_front.type, modificationDate: (/* @__PURE__ */ new Date()).toISOString(), documentCountry: resolvedExtractionResult.issuingCountry }); setExtractedData(toIndividualConflictSchema(mappedExtractionResult)); setStatus("ready"); }; const launchOnfido = () => { if (!isApplicantDetailsReady) { setErrorKey("thereWasAnErrorTryAgain"); return; } if (simulateOnfidoCompletion && onfidoResult) { handleOnfidoComplete(onfidoResult); return; } setStatus("onfidoModal"); }; const handleDataConflictsResolved = (resolved) => { fromIndividualConflictSchema(resolved); onComplete(); }; return /* @__PURE__ */ jsxs("div", { className: FormFlow_module_default.formFlow, children: [ /* @__PURE__ */ jsx("div", { className: FormFlow_module_default.formFlowContent, children: /* @__PURE__ */ jsx(LandingLayout, { media: /* @__PURE__ */ jsx(Image, { className: IdVerificationMethod_module_default.verificationHeaderImage, lazyLoadedImage: passportFrontGreenImage }), title: individualT(($) => $["verifyIdentity"]), description: individualT(($) => $["weNeedToVerifyTheDecisionMakersIdentity"]), helpAction: /* @__PURE__ */ jsx(Button, { onClick: onClose, variant: "tertiary", children: commonT(($) => $["back"]) }), error: errorKey || isLegalEntityError ? /* @__PURE__ */ jsx(Alert, { variant: "error", title: commonT(($) => $[errorKey ?? "thereWasAnErrorTryAgain"]) }) : void 0, actions: status === "extractionLoading" ? /* @__PURE__ */ jsx(Loader, { size: "large" }) : document ? /* @__PURE__ */ jsx(Button, { onClick: onComplete, fullWidth: true, children: commonT(($) => $["continue"]) }) : /* @__PURE__ */ jsx(Button, { fullWidth: true, onClick: launchOnfido, loading: isLegalEntityLoading, disabled: isLegalEntityError || !isApplicantDetailsReady, children: individualT(($) => $["getVerifiedInstantly"]) }), content: document && /* @__PURE__ */ jsx(UploadedDocument, { document, onDelete: () => setDocument(void 0), onUpdate: launchOnfido }), disclaimer: !document && /* @__PURE__ */ jsx(Typography, { children: /* @__PURE__ */ jsx(Trans, { t: individualT, ns: "individual", i18nKey: ($) => $["byContinuingWithInstantVerification"], components: { facialScanLink: /* @__PURE__ */ jsx(Link, { href: "https://onfido.com/facial-scan-policy-and-release/", external: true, inline: true }), privacyLink: /* @__PURE__ */ jsx(Link, { href: "https://onfido.com/privacy/", external: true, inline: true }), termsLink: /* @__PURE__ */ jsx(Link, { href: "https://onfido.com/terms-of-service/", external: true, inline: true }) } }) }) }) }), status === "onfidoModal" && isApplicantDetailsReady && /* @__PURE__ */ jsx(OnfidoCaptureModal, { closeModal: () => { setStatus("ready"); }, legalEntityId: resolvedLegalEntityId, minimumApplicantDetails: resolvedMinimumApplicantDetails, onComplete: handleOnfidoComplete, onError: () => { setErrorKey("weCouldNotReachOnfido"); setStatus("ready"); }, showMotionCapture }), conflictData.hasConflicts && extractedData && /* @__PURE__ */ jsx(DataConflictsModal, { providedData: conflictData.resolvedData ?? resolvedProvidedData, detectedData: extractedData, conflictingProperties: conflictData.conflictingProperties, formatters: {}, title: "confirmPersonalDetails", explanation: "theDetailsYouEnteredDontMatch", onContinue: handleDataConflictsResolved, onCancel: () => { setExtractedData(void 0); setStatus("ready"); } }) ] }); } //#endregion //#region src/adaptiveWorkflow/components/Fields/IndustryCode/IndustryCodeFieldGroup.tsx function mapSelectedCodes(selectedCodes) { return selectedCodes && selectedCodes.length > 0 ? selectedCodes.map((i) => ({ value: i, touched: !!i.id })) : [{ value: { id: "", name: "" }, touched: false }]; } function getNestedValue$1(obj, path) { return path.split(".").reduce((acc, key) => acc?.[key], obj); } var IndustryCodeFieldGroup = withForm({ defaultValues: {}, props: {}, render: function IndustryCodeFieldGroupRender({ form, basePath: industryCodesPath, businessLineTypes = ["banking"], single = true }) { const { t, i18n } = useTranslation(["common", "ui"]); const { isFeatureEnabled } = useToggleContext(); const { data: industryCodes, isLoading: industryCodesLoading } = useIndustryCodes(businessLineTypes, i18n.language); const { data: existingBusinessLines, isLoading: existingBusinessLinesLoading } = useBusinessLines(businessLineTypes); const selectedCodes = useStore(form.store, (s) => getNestedValue$1(s.values, industryCodesPath)); const [items, setItems] = useState$1(() => mapSelectedCodes(selectedCodes)); const containerRef = useRef$1(null); const singleIndustryCode = single || isFeatureEnabled("EnableLimitToSingleBusinessLine"); const allIndustryCodeSelectItems = useMemo$1(() => industryCodes?.map((entry) => ({ id: entry.code, name: `${entry.code} - ${entry.description}` })) ?? [], [industryCodes]); const selectableIndustryCodes = useMemo$1(() => { if (!businessLineTypes.includes("acquiring")) return allIndustryCodeSelectItems; const selectedIds = selectedCodes?.map((c) => c.id); const existingIds = (existingBusinessLines ?? []).map((b) => b.industryCode); return allIndustryCodeSelectItems.filter(({ id }) => { return !selectedIds?.includes(id) && !existingIds?.includes(id); }); }, [ allIndustryCodeSelectItems, businessLineTypes, selectedCodes, existingBusinessLines ]); const updateFormValues = (newItems) => { form.setFieldValue(industryCodesPath, newItems.map(({ value }) => value)); }; const handleSelectIndustryCode = (indexToUpdate, selectedItem) => { setItems((prevItems) => { const newItems = prevItems.map((item, i) => i === indexToUpdate ? { value: { id: selectedItem.id, name: selectedItem.name }, touched: true } : item); updateFormValues(newItems); return newItems; }); }; const addIndustryCodeField = (e) => { if (items[items.length - 1].value.id === "") { handleContainerBlur(e, items.length - 1); return; } const newItems = [...items, { value: { id: "", name: "" }, touched: false }]; setItems(newItems); updateFormValues(newItems); }; const removeField = (indexToRemove) => { const newItems = items.filter((_, i) => i !== indexToRemove); setItems(newItems); updateFormValues(newItems); }; const handleContainerBlur = (e, index) => { if (containerRef.current && !containerRef.current.contains(e.relatedTarget)) setItems((prevItems) => { if (prevItems[index].value.id || prevItems[index].touched) return prevItems; const newItems = [...prevItems]; newItems[index] = { ...newItems[index], touched: true }; return newItems; }); }; return /* @__PURE__ */ jsx(form.Field, { name: industryCodesPath, validators: { onBlur: ({ value }) => { const codes = value; return !codes?.length || codes.some((c) => !c.id) ? "fieldIsRequired" : void 0; } }, children: (field) => { if (industryCodesLoading || existingBusinessLinesLoading) return /* @__PURE__ */ jsx(Loader, { size: "large" }); const isTouched = field.state.meta.isTouched; const isValid = field.state.meta.isValid; const errorMessage = isTouched && !isValid ? field.state.meta.errors[0] : void 0; return /* @__PURE__ */ jsx(Field, { name: "industryCodes", label: t(($) => $["industry"], { ns: "ui" }), errorMessage, isValid: isTouched && isValid, showErrorIcon: false, children: (childProps) => { const content = /* @__PURE__ */ jsx("div", { ref: containerRef, "data-testid": "industryCode", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: items.map((code, index) => { const isInvalid = code.touched && code.value.id === ""; return /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [/* @__PURE__ */ jsx(Select, { ...childProps, id: `industryCodeSelection-${index}`, name: `industryCodeSelection-${index}`, selected: code.value, placeholder: t(($) => $["industryCode__placeholder"], { ns: "ui" }), items: allIndustryCodeSelectItems, excludedValues: allIndustryCodeSelectItems.filter((i) => !selectableIndustryCodes.includes(i)), readonly: !!industryCodes && selectableIndustryCodes.length === 0, onSelect: (selectedItem) => handleSelectIndustryCode(index, selectedItem), isInvalid, onBlur: (e) => { handleContainerBlur(e, index); field.handleBlur(); } }), !singleIndustryCode && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(IconButton, { ariaLabel: t(($) => $["removeIndustryCode"], { ns: "ui" }), variant: "tertiary", icon: "minusCircleFilled", circle: true, onClick: () => removeField(index), disabled: items.length === 1 }), /* @__PURE__ */ jsx(IconButton, { ariaLabel: t(($) => $["addIndustryCode"], { ns: "ui" }), variant: "tertiary", icon: "plusCircleFilled", circle: true, onClick: addIndustryCodeField, disabled: code.value.id === "" || code.value.id !== "" && index !== items.length - 1 || selectableIndustryCodes.length === 0 })] })] }, `${code.value.id}-${index}`); }) }); return singleIndustryCode ? content : /* @__PURE__ */ jsx(List, { dividers: false, variant: "grouped-primary", children: content }); } }); } }); } }); //#endregion //#region src/adaptiveWorkflow/components/Fields/LegalName.tsx function LegalName({ name, data, valid, errors, labels, helperText, readonly, handleChangeFor }) { const handleKeyDown = (e) => { if (e.key === KEYBOARD_KEYS.enter) e.preventDefault(); }; return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("p", { children: name }), /* @__PURE__ */ jsx(Field, { name, label: labels, helper: helperText, errorMessage: errors, isValid: valid, children: (_childProps) => /* @__PURE__ */ jsx(InputText, { "aria-required": true, "aria-invalid": !valid, name, value: data, readonly, onInput: handleChangeFor, onBlur: handleChangeFor, onKeyDown: handleKeyDown }) })] }); } //#endregion //#region src/adaptiveWorkflow/components/Fields/SourceOfFundsWorkflow/SourceOfFundsWorkflow.tsx var SourceOfFundsWorkflow = ({ onComplete, onClose, resourceId }) => { if (!resourceId) return /* @__PURE__ */ jsx(EndStateLayout, { variant: "error", title: "Something went wrong", description: "Please try again later" }); return /* @__PURE__ */ jsx(SourceOfFundsPage, { onSubmit: onComplete, handleHomeClick: onClose, asAwe: true }); }; //#endregion //#region src/adaptiveWorkflow/components/Fields/TaxInformation/ExemptedFromTaxField.tsx function ExemptedFromTaxField({ field, label, checked, onChange }) { return /* @__PURE__ */ jsx(Field, { name: field.name, children: (childProps) => /* @__PURE__ */ jsx(Checkbox, { ...childProps, "aria-required": false, "aria-invalid": false, name: field.name, label, value: "exemptedFromTax", checked, onChange }) }); } //#endregion //#region src/adaptiveWorkflow/components/Fields/TaxInformation/TaxIdNumberInputField.tsx function TaxIdNumberInputField({ field, fieldMetadata, currentValue, placeholder, readonly, optional, shouldValidate, disabled, onInput, onBlur }) { const { t } = useTranslation("common"); const isTouched = field.state.meta.isTouched; const isValid = field.state.meta.isValid; const errorMessage = isTouched && !isValid ? field.state.meta.errors[0] : void 0; return /* @__PURE__ */ jsx(MaskedInput, { type: "text", "aria-required": true, "aria-invalid": isTouched && !isValid, name: "taxInformation", label: fieldMetadata.label ? t(($) => $[fieldMetadata.label]) ?? "" : "", formatGuidance: fieldMetadata.guidanceText ? translateTranslatable(t, fieldMetadata.guidanceText) : void 0, value: currentValue, errorMessage, placeholder, isValid: isValid && !!currentValue, onInput, onBlur, disabled, readonly, optional, shouldValidate, ...fieldMetadata.mask ?? {} }); } //#endregion //#region src/adaptiveWorkflow/components/Fields/TaxInformation/TaxIdTypeSelectorField.tsx function TaxIdTypeSelectorField({ field, country, companyType, selected, onTypeChange, exemptedOptionLabel, isUsSoleProp }) { const errorMessage = field.state.meta.isTouched && !field.state.meta.isValid ? field.state.meta.errors[0] : void 0; return /* @__PURE__ */ jsx(TaxIdNumberTypeSelector, { country, companyType, selected, setSelected: onTypeChange, exemptedOptionLabel, isUsSoleProp, errorMessage: isUsSoleProp ? errorMessage : void 0 }); } //#endregion //#region src/adaptiveWorkflow/components/Fields/TaxInformation/TaxInformationFieldGroup.tsx function getNestedValue(obj, path) { return path.split(".").reduce((acc, key) => acc?.[key], obj); } var TaxInformationFieldGroup = withForm({ defaultValues: {}, props: {}, render: function TaxInformationFieldGroupRender({ form, basePath: taxInfoPath, country, canExempt, entityType, registrationNumber, defaultData, labels, placeholder, readonly, optional }) { const { isFeatureEnabled } = useToggleContext(); const { t } = useTranslation("common"); const taxNumberPath = `${taxInfoPath}.number`; const taxTypePath = `${taxInfoPath}.type`; const exemptedPath = `${taxInfoPath}.numberAbsent`; const isUenPath = `${taxInfoPath}.isUen`; const taxInformations = useStore(form.store, (s) => getNestedValue(s.values, taxInfoPath)); const exemptedFromTax = useStore(form.store, (s) => getNestedValue(s.values, exemptedPath)); const isUsSoleProp = country === "US" && entityType === CompanyTypesValues.SOLE_PROPRIETORSHIP; const currentTaxInformation = useMemo$1(() => taxInformations?.find((t) => t.country === country), [taxInformations, country]); const taxIdNumberType = useMemo$1(() => { if (currentTaxInformation?.numberAbsent) return "exempted"; if (currentTaxInformation?.type) return currentTaxInformation.type; if (isUsSoleProp) return void 0; return getDefaultTaxIdNumberType(taxInformations, country, entityType); }, [ currentTaxInformation?.type, currentTaxInformation?.numberAbsent, taxInformations, isUsSoleProp, country, entityType ]); const options = getTaxIdNumberOptions(country, entityType); const showTaxIdExemptedOptions = canExempt && (options?.length ?? 0) > 1 || isUsSoleProp; const canSaveAbsentState = isFeatureEnabled("EnableRegistrationAndTaxAbsentStatesV4") && COUNTRIES_WITH_POSSIBLE_TRUSTEE_TAXID_ABSENT_V4.includes(country); const fieldMetadata = resolveFieldMetadata(taxInformationDefaultFieldConfig[country], { taxIdNumberType: currentTaxInformation?.type, companyType: entityType }, taxInformationDefaultFieldMetadata); const exemptionLabel = isUsSoleProp ? t(($) => $["socialSecurityNumber"]) : labels?.exemptedFromTax; const updateTaxInfo = useCallback$1((mode, newEntry) => { const updated = upsertTaxInfoForCountry(defaultData, country, canSaveAbsentState ? { ...newEntry, numberAbsent: newEntry.numberAbsent ?? false } : newEntry); form.setFieldValue(taxInfoPath, updated); }, [ canSaveAbsentState, country, form, taxInfoPath, defaultData ]); const updateTaxType = useCallback$1((type, mode) => { updateTaxInfo(mode, { country, number: currentTaxInformation?.number, type }); }, [ country, currentTaxInformation?.number, updateTaxInfo ]); const removeCountryTaxInfo = useCallback$1(() => { form.setFieldValue(taxInfoPath, removeTaxInfoForCountry(taxInformations, country)); }, [ country, form, taxInfoPath, taxInformations ]); const addTaxAbsentStatus = useCallback$1((absent) => { form.setFieldValue(taxInfoPath, upsertTaxInfoForCountry(taxInformations, country, { country, numberAbsent: absent })); }, [ country, form, taxInfoPath, taxInformations ]); const setUenAsTaxId = useCallback$1((uen) => { updateTaxInfo("blur", { country, number: uen ?? "", type: "UEN" }); }, [country, updateTaxInfo]); const resetToDefaultData = useCallback$1(() => { if (defaultData !== void 0) form.setFieldValue(taxInfoPath, defaultData); }, [ defaultData, form, taxInfoPath ]); const handleTaxIdNumberTypeChange = useCallback$1((taxIdType) => { if (!canExempt && taxIdType === "exempted") throw new Error(`${country} does not allow tax exemptions`); if (taxIdType === "exempted") { form.setFieldValue(exemptedPath, true); updateTaxType(void 0, "input"); return canSaveAbsentState ? addTaxAbsentStatus(true) : removeCountryTaxInfo(); } form.setFieldValue(exemptedPath, false); if (country === "SG") if (taxIdType === "UEN") { form.setFieldValue(isUenPath, true); setUenAsTaxId(registrationNumber); } else { form.setFieldValue(isUenPath, false); removeCountryTaxInfo(); } updateTaxType(taxIdType, "input"); }, [ addTaxAbsentStatus, canExempt, canSaveAbsentState, country, exemptedPath, form, isUenPath, removeCountryTaxInfo, registrationNumber, setUenAsTaxId, updateTaxType ]); const handleTaxNumberChange = useCallback$1((e, mode) => { updateTaxInfo(mode, { country, number: e ? typeof e === "string" ? e : e.currentTarget.value : void 0, type: currentTaxInformation?.type ?? (taxIdNumberType !== "exempted" ? taxIdNumberType : void 0) }); }, [ country, currentTaxInformation?.type, taxIdNumberType, updateTaxInfo ]); const handleExemptedFromTaxChange = useCallback$1((exempted) => { form.setFieldValue(exemptedPath, exempted); if (canSaveAbsentState) addTaxAbsentStatus(exempted); else removeCountryTaxInfo(); }, [ addTaxAbsentStatus, canSaveAbsentState, exemptedPath, form, removeCountryTaxInfo ]); const prevCountryRef = useRef$1(country); useEffect$1(() => { if (!country || prevCountryRef.current === country) return; prevCountryRef.current = country; const hasSavedTaxId = defaultData?.find((t) => t.country === country); if (currentTaxInformation && !hasSavedTaxId) return; if (entityType === CompanyTypesValues.SOLE_PROPRIETORSHIP) return; resetToDefaultData(); }, [ country, currentTaxInformation, defaultData, entityType, resetToDefaultData ]); useEffect$1(() => { if (country === "SG" && registrationNumber && registrationNumber !== currentTaxInformation?.number) setUenAsTaxId(registrationNumber); }, [ registrationNumber, currentTaxInformation?.number, country, setUenAsTaxId ]); return /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx(form.Field, { name: taxTypePath, children: (field) => /* @__PURE__ */ jsx(TaxIdTypeSelectorField, { field, country, companyType: entityType, selected: taxIdNumberType, onTypeChange: handleTaxIdNumberTypeChange, exemptedOptionLabel: showTaxIdExemptedOptions ? exemptionLabel : void 0, isUsSoleProp }) }), /* @__PURE__ */ jsx(form.Field, { name: taxNumberPath, children: (field) => /* @__PURE__ */ jsx(TaxIdNumberInputField, { field, fieldMetadata, currentValue: currentTaxInformation?.number ?? "", placeholder, readonly, optional, shouldValidate: true, disabled: Boolean(exemptedFromTax), onInput: (e) => handleTaxNumberChange(e, "input"), onBlur: (e) => handleTaxNumberChange(e, "blur") }) }), canExempt && !showTaxIdExemptedOptions && /* @__PURE__ */ jsx(form.Field, { name: exemptedPath, children: (field) => /* @__PURE__ */ jsx(ExemptedFromTaxField, { field, label: labels?.exemptedFromTax, checked: Boolean(exemptedFromTax), onChange: handleExemptedFromTaxChange }) }) ] }); } }); //#endregion //#region src/adaptiveWorkflow/components/Fields/TaxReportingWorkflow/TaxReportingWorkflow.tsx var TaxReportingWorkflow = ({ onComplete, onClose, resourceId }) => { if (!resourceId) return /* @__PURE__ */ jsx(EndStateLayout, { variant: "error", title: "Something went wrong", description: "Please try again later" }); return /* @__PURE__ */ jsx(TaxReportingDropin, { onSubmit: onComplete, handleHomeClick: onClose, asAwe: true }); }; var UboTaskItem_module_default = { "ubo-task-item-actions": "_ubo-task-item-actions_1mthv_1", uboTaskItemActions: "_ubo-task-item-actions_1mthv_1" }; //#endregion //#region src/adaptiveWorkflow/components/TaskItems/UboTaskItem/UboTaskItem.tsx /** * Specialized component used for rendering of a task item for UBOs * Clicks on the task item will render the associated steps with this */ var UboTaskItem = ({ status, onClick, props: { name } }) => { const { t } = useTranslation("common"); const [isSendingInvite, setIsSendingInvite] = useState$1(false); const handleInviteClick = () => { try { setIsSendingInvite(true); } catch { console.log("error"); } finally { setIsSendingInvite(false); } }; const renderMainAccessory = () => { switch (status) { case "DETAILS_REQUIRED": return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(IconButton, { loading: isSendingInvite, circle: true, variant: "tertiary", onClick: handleInviteClick, icon: "upload", ariaLabel: "send invite" }), /* @__PURE__ */ jsx(Button, { onClick, disabled: isSendingInvite, children: t(($) => $["update"]) })] }); case "FINISHED": return /* @__PURE__ */ jsx(Status, { variant: "success", text: "Verified", icon: "checkmark" }); } }; return /* @__PURE__ */ jsx(Card, { padding: "medium", children: /* @__PURE__ */ jsx(ListItem, { accessory: /* @__PURE__ */ jsx("div", { className: UboTaskItem_module_default.uboTaskItemActions, children: renderMainAccessory() }), avatar: { iconName: "user", circle: true }, title: name || "Decision maker" }) }); }; //#endregion //#region src/adaptiveWorkflow/component-registry.ts /** * Registry for simple (single form.Field) components */ var simpleComponentMap = { LegalNameField: LegalName }; /** * Registry for compound components * Compound components receive form + basePath + dynamic server-driven props. * The map value must be ComponentType<any> because each compound component has its own unique * props interface — there's no single type that covers all of them in a dynamic registry. */ var compoundComponentMap = { TaxInformationFieldGroup, BusinessRegistrationNumberFieldGroup, IndustryCodeFieldGroup, IdentityNumberFieldGroup }; /** * Registry for specialized components * Specialized components are intended to be all encompassing, handling their own * field rendering, form steps (if applicable), data submission, etc. * * Naming convention: `${componentName}Workflow` */ var specializedComponentMap = { SourceOfFunds: SourceOfFundsWorkflow, TaxReporting: TaxReportingWorkflow, IdentityScreening: IdentityScreeningWorkflow, AcceptTermsOfService: AcceptTermsOfServiceWorkflow }; /** * Registry for specialized components used for rendering tasks in the UI which replace the default component used to represent tasks. */ var specializedTaskComponentMap = { UboTaskItem }; //#endregion //#region src/adaptiveWorkflow/components/SpecializedComponent/SpecializedComponent.tsx /** * A dynamic component resolver for the Adaptive Workflow Engine (AWE). * * Specialized components are self-contained units that handle their own field rendering, * multi-step forms (if applicable), and data submission. They are looked up from the * {@link specializedComponentMap} registry using the `component` provided by the AWE manifest. * * @param component - name used to resolve the component from the registry * @param onComplete - Forwarded to the resolved component; called when its flow finishes * @param onClose - Forwarded to the resolved component; called to dismiss the modal * @param properties - properties returned from AWE * @returns The matched specialized component, or an error end-state if the component * is not found in the registry or the `id` is missing */ var SpecializedComponent = ({ component, onComplete, onClose, properties }) => { const { globals } = useWorkflowContext(); const Component = specializedComponentMap[component]; const mappedProps = useComputed(() => { return resolveComponentProps(globals.value, properties); }); if (Component) return /* @__PURE__ */ jsx(Component, { onComplete, onClose, ...mappedProps.value }); return /* @__PURE__ */ jsx(EndStateLayout, { title: "Something went wrong", description: "Something went wrong on our end, please try again later", variant: "error" }); }; //#endregion //#region src/adaptiveWorkflow/components/DynamicForm/contextMap.ts var contextMap$3 = { businessDetails: { heading: "businessInformation", description: "placeholder" }, additionalBusinessDetails: { heading: "additionalBusinessDetails", description: "placeholder" }, identityNumber: { heading: "additionalPersonalDetails", description: "placeholder" }, identityVerification: { heading: "liveFaceDetection", description: "placeholder" } }; //#endregion //#region src/adaptiveWorkflow/components/DynamicForm/useCustomerData.ts function mapFormValuesToPayload({ steps, globals, formValues }) { const components = steps.flatMap((step) => step.componentGroups.flatMap((group) => group.components)); const domainPayloads = {}; for (const component of components) { const dotIndex = component.path.indexOf("."); const domain = dotIndex !== -1 ? component.path.slice(0, dotIndex) : component.path; const subPath = dotIndex !== -1 ? component.path.slice(dotIndex + 1) : ""; if (!domainPayloads[domain]) domainPayloads[domain] = { id: void 0, data: {} }; const apiValue = getNestedValue$4(formValues, component.path); const resolvedProps = resolveComponentProps(globals.value, component.properties); domainPayloads[domain].id = resolvedProps?.resourceId; if (subPath) setNestedValue(domainPayloads[domain].data, subPath, apiValue); else Object.assign(domainPayloads[domain].data, apiValue); } return do