@retinalabsllc/zairusjs 0.5.0 → 0.5.2
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.
- package/dist/index.d.mts +30 -1
- package/dist/index.d.ts +30 -1
- package/dist/index.js +620 -6
- package/dist/index.mjs +620 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -70,6 +70,7 @@ __export(index_exports, {
|
|
|
70
70
|
UniversalOrganizationPage: () => UniversalOrganizationPage,
|
|
71
71
|
UniversalOverviewPage: () => UniversalOverviewPage,
|
|
72
72
|
UniversalProfileSettings: () => UniversalProfileSettings,
|
|
73
|
+
UniversalRegistrationFlow: () => UniversalRegistrationFlow,
|
|
73
74
|
UniversalSidebar: () => UniversalSidebar,
|
|
74
75
|
ZairusAuth: () => ZairusAuth
|
|
75
76
|
});
|
|
@@ -1588,7 +1589,7 @@ var UniversalSidebar = ({
|
|
|
1588
1589
|
className: "absolute inset-0 bg-black/30",
|
|
1589
1590
|
onClick: onCancelIntercept
|
|
1590
1591
|
}
|
|
1591
|
-
), /* @__PURE__ */ import_react37.default.createElement("div", { className: "relative w-72 bg-white rounded-2xl flex flex-col items-center overflow-hidden shadow-2xl animate-in zoom-in-95 duration-200" }, /* @__PURE__ */ import_react37.default.createElement("div", { className: "p-6 text-center w-full" }, /* @__PURE__ */ import_react37.default.createElement("h3", { className: " font-serif text-[
|
|
1592
|
+
), /* @__PURE__ */ import_react37.default.createElement("div", { className: "relative w-72 bg-white rounded-2xl flex flex-col items-center overflow-hidden shadow-2xl animate-in zoom-in-95 duration-200" }, /* @__PURE__ */ import_react37.default.createElement("div", { className: "p-6 text-center w-full" }, /* @__PURE__ */ import_react37.default.createElement("h3", { className: " font-serif text-[17px] text-black tracking-tight mb-1" }, interceptTitle), /* @__PURE__ */ import_react37.default.createElement("p", { className: "text-[12px] text-neutral-500 leading-snug mt-2" }, interceptMessage)), /* @__PURE__ */ import_react37.default.createElement("div", { className: "w-full flex" }, /* @__PURE__ */ import_react37.default.createElement(
|
|
1592
1593
|
"button",
|
|
1593
1594
|
{
|
|
1594
1595
|
onClick: onCancelIntercept,
|
|
@@ -1653,7 +1654,7 @@ var UniversalHeader = ({
|
|
|
1653
1654
|
className: "w-10 h-10 rounded-full border border-neutral-100 bg-white flex items-center justify-center text-neutral-500 hover:text-black hover:border-black hover:bg-neutral-50 transition-all group outline-none",
|
|
1654
1655
|
"aria-label": "Switch Workspace"
|
|
1655
1656
|
},
|
|
1656
|
-
/* @__PURE__ */ import_react39.default.createElement(import_react40.HugeiconsIcon, { icon: import_core_free_icons10.
|
|
1657
|
+
/* @__PURE__ */ import_react39.default.createElement(import_react40.HugeiconsIcon, { icon: import_core_free_icons10.UserSwitchIcon, size: 16, className: "transition-transform group-hover:-translate-x-0.5" })
|
|
1657
1658
|
), showLogoutAction && /* @__PURE__ */ import_react39.default.createElement(
|
|
1658
1659
|
"button",
|
|
1659
1660
|
{
|
|
@@ -1676,7 +1677,7 @@ var UniversalHeader = ({
|
|
|
1676
1677
|
className: "absolute inset-0 bg-black/30",
|
|
1677
1678
|
onClick: () => setShowSwitcherDialog(false)
|
|
1678
1679
|
}
|
|
1679
|
-
), /* @__PURE__ */ import_react39.default.createElement("div", { className: "relative w-full max-w-sm bg-white rounded-2xl flex flex-col overflow-hidden shadow-2xl animate-in zoom-in-95 duration-200" }, /* @__PURE__ */ import_react39.default.createElement("div", { className: "p-5 text-center w-full" }, /* @__PURE__ */ import_react39.default.createElement("h3", { className: " font-serif text-[
|
|
1680
|
+
), /* @__PURE__ */ import_react39.default.createElement("div", { className: "relative w-full max-w-sm bg-white rounded-2xl flex flex-col overflow-hidden shadow-2xl animate-in zoom-in-95 duration-200" }, /* @__PURE__ */ import_react39.default.createElement("div", { className: "p-5 text-center w-full" }, /* @__PURE__ */ import_react39.default.createElement("h3", { className: " font-serif text-[17px] text-black tracking-tight mb-1" }, "Switch Workspace"), /* @__PURE__ */ import_react39.default.createElement("p", { className: "text-[11px] text-neutral-500 leading-snug" }, "Select an organization to switch your current context.")), /* @__PURE__ */ import_react39.default.createElement("div", { className: "max-h-75 overflow-y-auto w-full custom-scrollbar" }, workspaces.map((org) => /* @__PURE__ */ import_react39.default.createElement(
|
|
1680
1681
|
"button",
|
|
1681
1682
|
{
|
|
1682
1683
|
key: org.id,
|
|
@@ -1701,7 +1702,7 @@ var UniversalHeader = ({
|
|
|
1701
1702
|
className: "absolute inset-0 bg-black/30",
|
|
1702
1703
|
onClick: () => !isLoggingOut && setShowLogoutDialog(false)
|
|
1703
1704
|
}
|
|
1704
|
-
), /* @__PURE__ */ import_react39.default.createElement("div", { className: "relative w-72 bg-white rounded-2xl flex flex-col items-center overflow-hidden shadow-2xl animate-in zoom-in-95 duration-200" }, /* @__PURE__ */ import_react39.default.createElement("div", { className: "p-6 text-center w-full" }, /* @__PURE__ */ import_react39.default.createElement("h3", { className: " font-serif text-[
|
|
1705
|
+
), /* @__PURE__ */ import_react39.default.createElement("div", { className: "relative w-72 bg-white rounded-2xl flex flex-col items-center overflow-hidden shadow-2xl animate-in zoom-in-95 duration-200" }, /* @__PURE__ */ import_react39.default.createElement("div", { className: "p-6 text-center w-full" }, /* @__PURE__ */ import_react39.default.createElement("h3", { className: " font-serif text-[17px] text-black tracking-tight mb-1" }, "Secure Logout"), /* @__PURE__ */ import_react39.default.createElement("p", { className: "text-[12px] text-neutral-500 leading-snug mt-2" }, "Are you sure you want to log out? You will need to authenticate to return.")), /* @__PURE__ */ import_react39.default.createElement("div", { className: "w-full flex" }, /* @__PURE__ */ import_react39.default.createElement(
|
|
1705
1706
|
"button",
|
|
1706
1707
|
{
|
|
1707
1708
|
onClick: () => setShowLogoutDialog(false),
|
|
@@ -1969,7 +1970,7 @@ var UniversalIdentityPage = ({
|
|
|
1969
1970
|
},
|
|
1970
1971
|
"Delete ",
|
|
1971
1972
|
headerTitle.split(" ")[0]
|
|
1972
|
-
)))), isDeleteModalOpen && !isReadOnly && allowDeletion && /* @__PURE__ */ import_react42.default.createElement("div", { className: "fixed inset-0 z-110 flex items-center justify-center p-4" }, /* @__PURE__ */ import_react42.default.createElement("div", { className: "absolute inset-0 bg-black/30 shadow-2xl", onClick: () => !isDeleting && setIsDeleteModalOpen(false) }), /* @__PURE__ */ import_react42.default.createElement("div", { className: "relative w-72 bg-white shadow-2xl rounded-2xl flex flex-col items-center overflow-hidden animate-in zoom-in-95 duration-200" }, /* @__PURE__ */ import_react42.default.createElement("div", { className: "p-6 text-center w-full" }, /* @__PURE__ */ import_react42.default.createElement("h3", { className: " font-serif text-[
|
|
1973
|
+
)))), isDeleteModalOpen && !isReadOnly && allowDeletion && /* @__PURE__ */ import_react42.default.createElement("div", { className: "fixed inset-0 z-110 flex items-center justify-center p-4" }, /* @__PURE__ */ import_react42.default.createElement("div", { className: "absolute inset-0 bg-black/30 shadow-2xl", onClick: () => !isDeleting && setIsDeleteModalOpen(false) }), /* @__PURE__ */ import_react42.default.createElement("div", { className: "relative w-72 bg-white shadow-2xl rounded-2xl flex flex-col items-center overflow-hidden animate-in zoom-in-95 duration-200" }, /* @__PURE__ */ import_react42.default.createElement("div", { className: "p-6 text-center w-full" }, /* @__PURE__ */ import_react42.default.createElement("h3", { className: " font-serif text-[17px] text-black tracking-tight mb-1" }, "Confirm Deletion"), /* @__PURE__ */ import_react42.default.createElement("p", { className: "text-[12px] text-neutral-500 leading-snug mt-2" }, deleteWarningText)), /* @__PURE__ */ import_react42.default.createElement("div", { className: "w-full flex" }, /* @__PURE__ */ import_react42.default.createElement(
|
|
1973
1974
|
"button",
|
|
1974
1975
|
{
|
|
1975
1976
|
type: "button",
|
|
@@ -2247,7 +2248,7 @@ var UniversalMembersPage = ({
|
|
|
2247
2248
|
className: "w-full py-2.5 text-[13px] text-neutral-600 hover:bg-neutral-50 transition-colors disabled:opacity-50 outline-none"
|
|
2248
2249
|
},
|
|
2249
2250
|
"Cancel"
|
|
2250
|
-
)))), memberToDelete && canManage && /* @__PURE__ */ import_react43.default.createElement("div", { className: "fixed inset-0 z-110 flex items-center justify-center p-4" }, /* @__PURE__ */ import_react43.default.createElement("div", { className: "absolute inset-0 bg-black/30", onClick: () => !isDeleting && setMemberToDelete(null) }), /* @__PURE__ */ import_react43.default.createElement("div", { className: "relative w-72 bg-white shadow-2xl rounded-2xl flex flex-col items-center overflow-hidden animate-in zoom-in-95 duration-200" }, /* @__PURE__ */ import_react43.default.createElement("div", { className: "p-6 text-center w-full" }, /* @__PURE__ */ import_react43.default.createElement("h3", { className: " font-serif text-[
|
|
2251
|
+
)))), memberToDelete && canManage && /* @__PURE__ */ import_react43.default.createElement("div", { className: "fixed inset-0 z-110 flex items-center justify-center p-4" }, /* @__PURE__ */ import_react43.default.createElement("div", { className: "absolute inset-0 bg-black/30", onClick: () => !isDeleting && setMemberToDelete(null) }), /* @__PURE__ */ import_react43.default.createElement("div", { className: "relative w-72 bg-white shadow-2xl rounded-2xl flex flex-col items-center overflow-hidden animate-in zoom-in-95 duration-200" }, /* @__PURE__ */ import_react43.default.createElement("div", { className: "p-6 text-center w-full" }, /* @__PURE__ */ import_react43.default.createElement("h3", { className: " font-serif text-[17px] text-black tracking-tight mb-1" }, "Remove Member"), /* @__PURE__ */ import_react43.default.createElement("p", { className: "text-[12px] text-neutral-500 leading-snug mt-2" }, "Are you sure you want to remove this member? They will lose access instantly.")), /* @__PURE__ */ import_react43.default.createElement("div", { className: "w-full flex" }, /* @__PURE__ */ import_react43.default.createElement("button", { onClick: () => setMemberToDelete(null), disabled: isDeleting, className: "flex-1 py-2 text-[13px] text-neutral-600 hover:bg-neutral-50 transition-colors disabled:opacity-50 outline-none" }, "Cancel"), /* @__PURE__ */ import_react43.default.createElement("button", { onClick: handleDelete, disabled: isDeleting, className: "flex-1 py-2 text-[13px] text-red-600 hover:bg-neutral-50 transition-colors disabled:opacity-50 flex justify-center outline-none" }, isDeleting ? /* @__PURE__ */ import_react43.default.createElement(ButtonSpinner3, null) : "Remove")))));
|
|
2251
2252
|
};
|
|
2252
2253
|
|
|
2253
2254
|
// src/components/UniversalProfileSettings.tsx
|
|
@@ -2958,6 +2959,618 @@ var Stagger = ({ steps, currentStep }) => {
|
|
|
2958
2959
|
return /* @__PURE__ */ import_react63.default.createElement("div", { key: step, className: `w-6 h-6 rounded-full flex items-center justify-center transition-colors duration-300 ${colorClass}` }, /* @__PURE__ */ import_react63.default.createElement(import_react64.HugeiconsIcon, { icon: getIconForStep(step), size: 11 }));
|
|
2959
2960
|
}));
|
|
2960
2961
|
};
|
|
2962
|
+
|
|
2963
|
+
// src/components/UniversalRegistrationFlow.tsx
|
|
2964
|
+
var import_react65 = __toESM(require("react"));
|
|
2965
|
+
var import_react_hot_toast7 = __toESM(require("react-hot-toast"));
|
|
2966
|
+
var import_react66 = require("@hugeicons/react");
|
|
2967
|
+
var import_core_free_icons21 = require("@hugeicons/core-free-icons");
|
|
2968
|
+
var MACRO_STEPS = ["Details", "Documents", "Review", "Submit"];
|
|
2969
|
+
var NIGERIAN_STATES = ["Abia", "Adamawa", "Akwa Ibom", "Anambra", "Bauchi", "Bayelsa", "Benue", "Borno", "Cross River", "Delta", "Ebonyi", "Edo", "Ekiti", "Enugu", "FCT - Abuja", "Gombe", "Imo", "Jigawa", "Kaduna", "Kano", "Katsina", "Kebbi", "Kogi", "Kwara", "Lagos", "Nasarawa", "Niger", "Ogun", "Ondo", "Osun", "Oyo", "Plateau", "Rivers", "Sokoto", "Taraba", "Yobe", "Zamfara"];
|
|
2970
|
+
var MEMBER_ROLES = ["Director Only", "Shareholder Only", "Both Director & Shareholder"];
|
|
2971
|
+
var NATIONALITIES = ["Nigerian"];
|
|
2972
|
+
var UniversalRegistrationFlow = ({
|
|
2973
|
+
applicationId,
|
|
2974
|
+
type,
|
|
2975
|
+
apiEndpoint,
|
|
2976
|
+
onCancelOrClose,
|
|
2977
|
+
onRedirectToBilling,
|
|
2978
|
+
onRedirectToApplication
|
|
2979
|
+
}) => {
|
|
2980
|
+
const [isBooting, setIsBooting] = (0, import_react65.useState)(true);
|
|
2981
|
+
const [macroStep, setMacroStep] = (0, import_react65.useState)(0);
|
|
2982
|
+
const [appStatus, setAppStatus] = (0, import_react65.useState)("");
|
|
2983
|
+
const [isAbortModalOpen, setIsAbortModalOpen] = (0, import_react65.useState)(false);
|
|
2984
|
+
const [isAborting, setIsAborting] = (0, import_react65.useState)(false);
|
|
2985
|
+
const [formState, setFormState] = (0, import_react65.useState)({
|
|
2986
|
+
natureApproved: false,
|
|
2987
|
+
nameApproved: false,
|
|
2988
|
+
addressApproved: false,
|
|
2989
|
+
membersDetailsApproved: false,
|
|
2990
|
+
membersDocsApproved: false,
|
|
2991
|
+
ownerApproved: false,
|
|
2992
|
+
idApproved: false,
|
|
2993
|
+
passportApproved: false,
|
|
2994
|
+
signatureApproved: false
|
|
2995
|
+
});
|
|
2996
|
+
const idRef = (0, import_react65.useRef)(null);
|
|
2997
|
+
const passportRef = (0, import_react65.useRef)(null);
|
|
2998
|
+
const signatureRef = (0, import_react65.useRef)(null);
|
|
2999
|
+
const other1Ref = (0, import_react65.useRef)(null);
|
|
3000
|
+
const other2Ref = (0, import_react65.useRef)(null);
|
|
3001
|
+
const other3Ref = (0, import_react65.useRef)(null);
|
|
3002
|
+
const [formData, setFormData] = (0, import_react65.useState)({
|
|
3003
|
+
businessDesc: "",
|
|
3004
|
+
natureOfBusiness: null,
|
|
3005
|
+
proposedName: "",
|
|
3006
|
+
proposedName2: "",
|
|
3007
|
+
approvedName: "",
|
|
3008
|
+
address: "",
|
|
3009
|
+
city: "",
|
|
3010
|
+
state: "",
|
|
3011
|
+
members: [{ id: Date.now().toString(), fullName: "", email: "", phone: "", role: "Both Director & Shareholder", sharePercentage: "100", nationality: "Nigerian", address: "", city: "", state: "", idFileUrl: "", idMetadata: null, idExtractedData: null, passportFileUrl: "", passportMetadata: null, signatureFileUrl: "", signatureMetadata: null }],
|
|
3012
|
+
ownerName: "",
|
|
3013
|
+
ownerPhone: "",
|
|
3014
|
+
ownerEmail: "",
|
|
3015
|
+
idExtractedData: null,
|
|
3016
|
+
idFileUrl: "",
|
|
3017
|
+
idMetadata: null,
|
|
3018
|
+
passportFileUrl: "",
|
|
3019
|
+
passportMetadata: null,
|
|
3020
|
+
signatureFileUrl: "",
|
|
3021
|
+
signatureMetadata: null,
|
|
3022
|
+
otherDoc1Url: "",
|
|
3023
|
+
otherDoc1Meta: null,
|
|
3024
|
+
otherDoc2Url: "",
|
|
3025
|
+
otherDoc2Meta: null,
|
|
3026
|
+
otherDoc3Url: "",
|
|
3027
|
+
otherDoc3Meta: null
|
|
3028
|
+
});
|
|
3029
|
+
const [activeModal, setActiveModal] = (0, import_react65.useState)({ isOpen: false, type: null, memberIndex: null });
|
|
3030
|
+
const [iAgree, setIAgree] = (0, import_react65.useState)(false);
|
|
3031
|
+
const [isAnalyzingNature, setIsAnalyzingNature] = (0, import_react65.useState)(false);
|
|
3032
|
+
const [suggestedNature, setSuggestedNature] = (0, import_react65.useState)(null);
|
|
3033
|
+
const [isCheckingQualifier, setIsCheckingQualifier] = (0, import_react65.useState)(false);
|
|
3034
|
+
const [qualifierCheckResult, setQualifierCheckResult] = (0, import_react65.useState)(null);
|
|
3035
|
+
const [isCheckingName, setIsCheckingName] = (0, import_react65.useState)(false);
|
|
3036
|
+
const [nameCheckResult, setNameCheckResult] = (0, import_react65.useState)(null);
|
|
3037
|
+
const [globalExtractingId, setGlobalExtractingId] = (0, import_react65.useState)(false);
|
|
3038
|
+
const [globalUploadingPassport, setGlobalUploadingPassport] = (0, import_react65.useState)(false);
|
|
3039
|
+
const [globalUploadingSignature, setGlobalUploadingSignature] = (0, import_react65.useState)(false);
|
|
3040
|
+
const [isUploadingOther1, setIsUploadingOther1] = (0, import_react65.useState)(false);
|
|
3041
|
+
const [isUploadingOther2, setIsUploadingOther2] = (0, import_react65.useState)(false);
|
|
3042
|
+
const [isUploadingOther3, setIsUploadingOther3] = (0, import_react65.useState)(false);
|
|
3043
|
+
const [aiTasks, setAiTasks] = (0, import_react65.useState)([]);
|
|
3044
|
+
const [isSubmitting, setIsSubmitting] = (0, import_react65.useState)(false);
|
|
3045
|
+
const isReadOnly = ["PENDING", "AWAITING_PAYMENT", "COMPLETED"].includes(appStatus);
|
|
3046
|
+
const isAnyUploading = globalExtractingId || globalUploadingPassport || globalUploadingSignature || isUploadingOther1 || isUploadingOther2 || isUploadingOther3;
|
|
3047
|
+
const baseApi = async (action, payload = {}) => {
|
|
3048
|
+
try {
|
|
3049
|
+
const res = await fetch(apiEndpoint, {
|
|
3050
|
+
method: "POST",
|
|
3051
|
+
headers: { "Content-Type": "application/json" },
|
|
3052
|
+
body: JSON.stringify({ applicationId, action, payload })
|
|
3053
|
+
});
|
|
3054
|
+
return await res.json();
|
|
3055
|
+
} catch (error) {
|
|
3056
|
+
return { success: false, error: "Network communication failed." };
|
|
3057
|
+
}
|
|
3058
|
+
};
|
|
3059
|
+
(0, import_react65.useEffect)(() => {
|
|
3060
|
+
baseApi("progress_load").then((data) => {
|
|
3061
|
+
if (data.success && data.data) {
|
|
3062
|
+
const meta = data.data;
|
|
3063
|
+
if (meta.formData && meta.formState) {
|
|
3064
|
+
setFormData((p) => ({ ...p, ...meta.formData }));
|
|
3065
|
+
setFormState((p) => ({ ...p, ...meta.formState }));
|
|
3066
|
+
if (meta.macroStep !== void 0) setMacroStep(meta.macroStep);
|
|
3067
|
+
} else if (meta.proposedNames || meta.natureOfBusiness) {
|
|
3068
|
+
if (type === "company" && (meta.companyAddress || meta.directorsAndShareholders)) {
|
|
3069
|
+
const mappedForm = {
|
|
3070
|
+
businessDesc: meta.natureOfBusiness?.specificLabel ? `Form loaded: ${meta.natureOfBusiness.specificLabel}` : "",
|
|
3071
|
+
natureOfBusiness: meta.natureOfBusiness || null,
|
|
3072
|
+
proposedName: meta.proposedNames?.[0] || "",
|
|
3073
|
+
proposedName2: meta.proposedNames?.[1] || "",
|
|
3074
|
+
approvedName: meta.proposedNames?.[0] || "",
|
|
3075
|
+
address: meta.companyAddress?.streetAddress || "",
|
|
3076
|
+
city: meta.companyAddress?.city || "",
|
|
3077
|
+
state: meta.companyAddress?.state || "",
|
|
3078
|
+
members: (meta.directorsAndShareholders || []).map((m, idx) => ({
|
|
3079
|
+
id: idx.toString(),
|
|
3080
|
+
fullName: m.fullName || "",
|
|
3081
|
+
email: m.emailAddress || "",
|
|
3082
|
+
phone: m.phoneNumber || "",
|
|
3083
|
+
role: m.role || "Both Director & Shareholder",
|
|
3084
|
+
sharePercentage: m.sharePercentage || "",
|
|
3085
|
+
nationality: m.nationality || "Nigerian",
|
|
3086
|
+
address: m.residentialAddress?.streetAddress || "",
|
|
3087
|
+
city: m.residentialAddress?.city || "",
|
|
3088
|
+
state: m.residentialAddress?.state || "",
|
|
3089
|
+
idFileUrl: m.passportPhotograph?.fileDataUrl || "",
|
|
3090
|
+
idMetadata: null,
|
|
3091
|
+
idExtractedData: m.identification ? { fullName: m.fullName, idNumber: m.identification.idNumber, dob: m.dateOfBirth, documentType: m.identification.type } : null,
|
|
3092
|
+
passportFileUrl: m.passportPhotograph?.fileDataUrl || "",
|
|
3093
|
+
passportMetadata: m.passportPhotograph || null,
|
|
3094
|
+
signatureFileUrl: m.signature?.fileDataUrl || "",
|
|
3095
|
+
signatureMetadata: m.signature || null
|
|
3096
|
+
})),
|
|
3097
|
+
otherDoc1Url: meta.additionalDocuments?.[0]?.fileDataUrl || "",
|
|
3098
|
+
otherDoc1Meta: meta.additionalDocuments?.[0] || null,
|
|
3099
|
+
otherDoc2Url: meta.additionalDocuments?.[1]?.fileDataUrl || "",
|
|
3100
|
+
otherDoc2Meta: meta.additionalDocuments?.[1] || null,
|
|
3101
|
+
otherDoc3Url: meta.additionalDocuments?.[2]?.fileDataUrl || "",
|
|
3102
|
+
otherDoc3Meta: meta.additionalDocuments?.[2] || null
|
|
3103
|
+
};
|
|
3104
|
+
setFormData((p) => ({ ...p, ...mappedForm }));
|
|
3105
|
+
setFormState((p) => ({
|
|
3106
|
+
...p,
|
|
3107
|
+
natureApproved: !!meta.natureOfBusiness,
|
|
3108
|
+
nameApproved: !!meta.proposedNames?.[0],
|
|
3109
|
+
addressApproved: !!meta.companyAddress?.streetAddress,
|
|
3110
|
+
membersDetailsApproved: (meta.directorsAndShareholders || []).length > 0,
|
|
3111
|
+
membersDocsApproved: (meta.directorsAndShareholders || []).every((m) => m.passportPhotograph && m.signature)
|
|
3112
|
+
}));
|
|
3113
|
+
if (meta.directorsAndShareholders?.length > 0) {
|
|
3114
|
+
const docsApproved = (meta.directorsAndShareholders || []).every((m) => m.passportPhotograph && m.signature);
|
|
3115
|
+
setMacroStep(docsApproved ? 2 : 1);
|
|
3116
|
+
}
|
|
3117
|
+
} else if (type === "business" && (meta.businessAddress || meta.proprietors)) {
|
|
3118
|
+
const proprietor = meta.proprietors?.[0] || {};
|
|
3119
|
+
const mappedForm = {
|
|
3120
|
+
businessDesc: meta.natureOfBusiness?.specificLabel ? `Form loaded: ${meta.natureOfBusiness.specificLabel}` : "",
|
|
3121
|
+
natureOfBusiness: meta.natureOfBusiness || null,
|
|
3122
|
+
proposedName: meta.proposedNames?.[0] || "",
|
|
3123
|
+
proposedName2: meta.proposedNames?.[1] || "",
|
|
3124
|
+
approvedName: meta.proposedNames?.[0] || "",
|
|
3125
|
+
address: meta.businessAddress?.streetAddress || "",
|
|
3126
|
+
city: meta.businessAddress?.city || "",
|
|
3127
|
+
state: meta.businessAddress?.state || "",
|
|
3128
|
+
ownerName: proprietor.fullName || "",
|
|
3129
|
+
ownerPhone: proprietor.phoneNumber || "",
|
|
3130
|
+
ownerEmail: proprietor.emailAddress || "",
|
|
3131
|
+
idExtractedData: proprietor.identification ? { fullName: proprietor.fullName, idNumber: proprietor.identification.idNumber, dob: proprietor.dateOfBirth, documentType: proprietor.identification.type } : null,
|
|
3132
|
+
idFileUrl: "",
|
|
3133
|
+
idMetadata: null,
|
|
3134
|
+
passportFileUrl: proprietor.passportPhotograph?.fileDataUrl || "",
|
|
3135
|
+
passportMetadata: proprietor.passportPhotograph || null,
|
|
3136
|
+
signatureFileUrl: proprietor.signature?.fileDataUrl || "",
|
|
3137
|
+
signatureMetadata: proprietor.signature || null,
|
|
3138
|
+
otherDoc1Url: meta.additionalDocuments?.[0]?.fileDataUrl || "",
|
|
3139
|
+
otherDoc1Meta: meta.additionalDocuments?.[0] || null,
|
|
3140
|
+
otherDoc2Url: meta.additionalDocuments?.[1]?.fileDataUrl || "",
|
|
3141
|
+
otherDoc2Meta: meta.additionalDocuments?.[1] || null,
|
|
3142
|
+
otherDoc3Url: meta.additionalDocuments?.[2]?.fileDataUrl || "",
|
|
3143
|
+
otherDoc3Meta: meta.additionalDocuments?.[2] || null
|
|
3144
|
+
};
|
|
3145
|
+
setFormData((p) => ({ ...p, ...mappedForm }));
|
|
3146
|
+
const calcFormState = {
|
|
3147
|
+
natureApproved: !!meta.natureOfBusiness,
|
|
3148
|
+
nameApproved: !!meta.proposedNames?.[0],
|
|
3149
|
+
addressApproved: !!meta.businessAddress?.streetAddress,
|
|
3150
|
+
ownerApproved: !!proprietor.fullName && !!proprietor.phoneNumber,
|
|
3151
|
+
idApproved: !!proprietor.identification,
|
|
3152
|
+
passportApproved: !!proprietor.passportPhotograph,
|
|
3153
|
+
signatureApproved: !!proprietor.signature
|
|
3154
|
+
};
|
|
3155
|
+
setFormState((p) => ({ ...p, ...calcFormState }));
|
|
3156
|
+
if (proprietor.fullName || calcFormState.nameApproved) {
|
|
3157
|
+
setMacroStep(calcFormState.idApproved && calcFormState.passportApproved && calcFormState.signatureApproved ? 2 : 1);
|
|
3158
|
+
}
|
|
3159
|
+
}
|
|
3160
|
+
}
|
|
3161
|
+
}
|
|
3162
|
+
if (data.appStatus) {
|
|
3163
|
+
setAppStatus(data.appStatus);
|
|
3164
|
+
if (data.appStatus === "QUEUED" || data.appStatus === "REJECTED") setMacroStep(0);
|
|
3165
|
+
}
|
|
3166
|
+
}).catch(() => {
|
|
3167
|
+
import_react_hot_toast7.default.error("Uh oh! Something went wrong while loading.");
|
|
3168
|
+
}).finally(() => setIsBooting(false));
|
|
3169
|
+
}, [applicationId, type, apiEndpoint]);
|
|
3170
|
+
const saveProgress = async (newFormData = formData, newFormState = formState, newMacro = macroStep) => {
|
|
3171
|
+
if (isReadOnly) return;
|
|
3172
|
+
baseApi("progress_save", { formData: newFormData, formState: newFormState, macroStep: newMacro }).catch(() => {
|
|
3173
|
+
});
|
|
3174
|
+
};
|
|
3175
|
+
const handleAbort = async () => {
|
|
3176
|
+
setIsAborting(true);
|
|
3177
|
+
const data = await baseApi("abort");
|
|
3178
|
+
if (data.success) {
|
|
3179
|
+
import_react_hot_toast7.default.success("Application aborted.");
|
|
3180
|
+
setAppStatus("DRAFT");
|
|
3181
|
+
setMacroStep(0);
|
|
3182
|
+
setIsAbortModalOpen(false);
|
|
3183
|
+
} else import_react_hot_toast7.default.error(data.error || "Uh oh! Something went wrong.");
|
|
3184
|
+
setIsAborting(false);
|
|
3185
|
+
};
|
|
3186
|
+
const handleBack = () => {
|
|
3187
|
+
if (macroStep === 0) {
|
|
3188
|
+
onCancelOrClose();
|
|
3189
|
+
} else {
|
|
3190
|
+
const prevStep = macroStep - 1;
|
|
3191
|
+
setMacroStep(prevStep);
|
|
3192
|
+
saveProgress(formData, formState, prevStep);
|
|
3193
|
+
}
|
|
3194
|
+
};
|
|
3195
|
+
const handleNext = () => {
|
|
3196
|
+
const nextStep = macroStep + 1;
|
|
3197
|
+
setMacroStep(nextStep);
|
|
3198
|
+
saveProgress(formData, formState, nextStep);
|
|
3199
|
+
};
|
|
3200
|
+
const editSection = (section) => {
|
|
3201
|
+
if (isReadOnly) return;
|
|
3202
|
+
const newState = { ...formState, [section]: false };
|
|
3203
|
+
setFormState(newState);
|
|
3204
|
+
saveProgress(formData, newState, macroStep);
|
|
3205
|
+
};
|
|
3206
|
+
const approveSection = (section, newFormData = formData) => {
|
|
3207
|
+
if (isReadOnly) return;
|
|
3208
|
+
const newState = { ...formState, [section]: true };
|
|
3209
|
+
setFormState(newState);
|
|
3210
|
+
saveProgress(newFormData, newState, macroStep);
|
|
3211
|
+
};
|
|
3212
|
+
const getBase64Safe = (file) => {
|
|
3213
|
+
return new Promise((resolve, reject) => {
|
|
3214
|
+
if (!["image/jpeg", "image/png", "image/webp", "application/pdf"].includes(file.type)) return reject(new Error("Unsupported file type. Allowed: JPG, PNG, WEBP, PDF."));
|
|
3215
|
+
if (file.size > 5 * 1024 * 1024) return reject(new Error("File too large. Maximum size is 5MB."));
|
|
3216
|
+
const reader = new FileReader();
|
|
3217
|
+
reader.readAsDataURL(file);
|
|
3218
|
+
reader.onloadend = () => resolve(reader.result);
|
|
3219
|
+
reader.onerror = () => reject(new Error("Failed to process file locally."));
|
|
3220
|
+
});
|
|
3221
|
+
};
|
|
3222
|
+
const handleAnalyzeNature = async () => {
|
|
3223
|
+
setIsAnalyzingNature(true);
|
|
3224
|
+
const data = await baseApi("analyze_nature", { description: formData.businessDesc });
|
|
3225
|
+
if (data.success) setSuggestedNature(data.data);
|
|
3226
|
+
else import_react_hot_toast7.default.error(data.error || "Uh oh! Something went wrong.");
|
|
3227
|
+
setIsAnalyzingNature(false);
|
|
3228
|
+
};
|
|
3229
|
+
const pollNameCheckJob = async (jobId) => {
|
|
3230
|
+
const poll = await baseApi("check_name_poll", { jobId });
|
|
3231
|
+
if (poll.success && poll.data.status === "completed") {
|
|
3232
|
+
setNameCheckResult(poll.data.result);
|
|
3233
|
+
setIsCheckingName(false);
|
|
3234
|
+
} else if (poll.success && poll.data.status === "error") {
|
|
3235
|
+
import_react_hot_toast7.default.error(poll.data.error || "Uh oh! Something went wrong.");
|
|
3236
|
+
setIsCheckingName(false);
|
|
3237
|
+
} else setTimeout(() => pollNameCheckJob(jobId), 3e3);
|
|
3238
|
+
};
|
|
3239
|
+
const handleCheckNames = async (nameToCheck) => {
|
|
3240
|
+
setIsCheckingQualifier(true);
|
|
3241
|
+
setNameCheckResult(null);
|
|
3242
|
+
const qualifierData = await baseApi("validate_name_qualifier", { name1: formData.proposedName, name2: formData.proposedName2, description: formData.businessDesc });
|
|
3243
|
+
setIsCheckingQualifier(false);
|
|
3244
|
+
if (qualifierData.success && !qualifierData.data.hasQualifier) {
|
|
3245
|
+
setQualifierCheckResult(qualifierData.data);
|
|
3246
|
+
return;
|
|
3247
|
+
}
|
|
3248
|
+
setQualifierCheckResult(null);
|
|
3249
|
+
setIsCheckingName(true);
|
|
3250
|
+
const data = await baseApi("check_name_start", { name: nameToCheck, lineOfBusiness: formData.natureOfBusiness?.specificLabel });
|
|
3251
|
+
if (data.success && data.data.jobId) pollNameCheckJob(data.data.jobId);
|
|
3252
|
+
else {
|
|
3253
|
+
import_react_hot_toast7.default.error(data.error || "Uh oh! Something went wrong.");
|
|
3254
|
+
setIsCheckingName(false);
|
|
3255
|
+
}
|
|
3256
|
+
};
|
|
3257
|
+
const handleOptionalUpload = async (e, optType) => {
|
|
3258
|
+
if (isReadOnly) return;
|
|
3259
|
+
const file = e.target.files?.[0];
|
|
3260
|
+
if (!file) return;
|
|
3261
|
+
try {
|
|
3262
|
+
if (optType === "other1") setIsUploadingOther1(true);
|
|
3263
|
+
else if (optType === "other2") setIsUploadingOther2(true);
|
|
3264
|
+
else if (optType === "other3") setIsUploadingOther3(true);
|
|
3265
|
+
const base64data = await getBase64Safe(file);
|
|
3266
|
+
const data = await baseApi("upload_document", { imageBase64: base64data, docType: optType });
|
|
3267
|
+
if (data.success) {
|
|
3268
|
+
const updatedForm = { ...formData };
|
|
3269
|
+
const docNum = optType.replace("other", "");
|
|
3270
|
+
updatedForm[`otherDoc${docNum}Url`] = data.data.fileUrl || base64data;
|
|
3271
|
+
updatedForm[`otherDoc${docNum}Meta`] = { fileName: file.name, contentType: file.type, fileSizeInBytes: file.size };
|
|
3272
|
+
setFormData(updatedForm);
|
|
3273
|
+
saveProgress(updatedForm);
|
|
3274
|
+
}
|
|
3275
|
+
} catch (error) {
|
|
3276
|
+
import_react_hot_toast7.default.error(error.message);
|
|
3277
|
+
} finally {
|
|
3278
|
+
if (optType === "other1") {
|
|
3279
|
+
setIsUploadingOther1(false);
|
|
3280
|
+
if (other1Ref.current) other1Ref.current.value = "";
|
|
3281
|
+
} else if (optType === "other2") {
|
|
3282
|
+
setIsUploadingOther2(false);
|
|
3283
|
+
if (other2Ref.current) other2Ref.current.value = "";
|
|
3284
|
+
} else if (optType === "other3") {
|
|
3285
|
+
setIsUploadingOther3(false);
|
|
3286
|
+
if (other3Ref.current) other3Ref.current.value = "";
|
|
3287
|
+
}
|
|
3288
|
+
}
|
|
3289
|
+
};
|
|
3290
|
+
const deleteOptionalDocument = (optType) => {
|
|
3291
|
+
if (isReadOnly || isAnyUploading) return;
|
|
3292
|
+
const updatedForm = { ...formData };
|
|
3293
|
+
const docNum = optType.replace("other", "");
|
|
3294
|
+
const fileUrl = formData[`otherDoc${docNum}Url`];
|
|
3295
|
+
updatedForm[`otherDoc${docNum}Url`] = "";
|
|
3296
|
+
updatedForm[`otherDoc${docNum}Meta`] = null;
|
|
3297
|
+
setFormData(updatedForm);
|
|
3298
|
+
saveProgress(updatedForm);
|
|
3299
|
+
if (fileUrl) baseApi("delete_document", { url: fileUrl }).catch(() => {
|
|
3300
|
+
});
|
|
3301
|
+
};
|
|
3302
|
+
const addCompanyMember = () => {
|
|
3303
|
+
if (isReadOnly) return;
|
|
3304
|
+
setFormData((p) => ({ ...p, members: [...p.members, { id: Date.now().toString(), fullName: "", email: "", phone: "", role: "Shareholder Only", sharePercentage: "", nationality: "Nigerian", address: "", city: "", state: "", idFileUrl: "", idMetadata: null, idExtractedData: null, passportFileUrl: "", passportMetadata: null, signatureFileUrl: "", signatureMetadata: null }] }));
|
|
3305
|
+
};
|
|
3306
|
+
const removeCompanyMember = (index) => {
|
|
3307
|
+
if (isReadOnly) return;
|
|
3308
|
+
const updated = [...formData.members];
|
|
3309
|
+
updated.splice(index, 1);
|
|
3310
|
+
setFormData({ ...formData, members: updated });
|
|
3311
|
+
};
|
|
3312
|
+
const updateCompanyMemberInfo = (index, key, value) => {
|
|
3313
|
+
if (isReadOnly) return;
|
|
3314
|
+
const updated = [...formData.members];
|
|
3315
|
+
if (key === "sharePercentage") {
|
|
3316
|
+
if (value === "") updated[index] = { ...updated[index], [key]: "" };
|
|
3317
|
+
else {
|
|
3318
|
+
let numValue = Number(value);
|
|
3319
|
+
if (!isNaN(numValue)) {
|
|
3320
|
+
const otherSharesSum = updated.reduce((acc, m, i) => {
|
|
3321
|
+
if (i === index || m.role === "Director Only") return acc;
|
|
3322
|
+
return acc + (Number(m.sharePercentage) || 0);
|
|
3323
|
+
}, 0);
|
|
3324
|
+
const maxAllowed = Math.max(0, 100 - otherSharesSum);
|
|
3325
|
+
if (numValue > maxAllowed) {
|
|
3326
|
+
numValue = maxAllowed;
|
|
3327
|
+
import_react_hot_toast7.default.error(`Total shares cannot exceed 100%. Remaining: ${maxAllowed}%`, { id: "share-limit" });
|
|
3328
|
+
} else if (numValue < 0) numValue = 0;
|
|
3329
|
+
updated[index] = { ...updated[index], [key]: numValue.toString() };
|
|
3330
|
+
}
|
|
3331
|
+
}
|
|
3332
|
+
} else updated[index] = { ...updated[index], [key]: value };
|
|
3333
|
+
setFormData({ ...formData, members: updated });
|
|
3334
|
+
};
|
|
3335
|
+
const getCompanyTotalShares = () => formData.members.reduce((acc, m) => acc + (m.role !== "Director Only" ? Number(m.sharePercentage) || 0 : 0), 0);
|
|
3336
|
+
const areCompanyMembersValid = () => {
|
|
3337
|
+
if (getCompanyTotalShares() !== 100) return false;
|
|
3338
|
+
return formData.members.every((m) => m.fullName && m.email && m.phone && m.address && m.city && m.state && m.nationality && (m.role === "Director Only" || m.sharePercentage !== ""));
|
|
3339
|
+
};
|
|
3340
|
+
const areCompanyMemberDocsValid = () => formData.members.every((m) => m.idExtractedData && m.passportFileUrl && m.signatureFileUrl);
|
|
3341
|
+
const handleCompanyMemberUpload = async (e, memberIndex, docType) => {
|
|
3342
|
+
const file = e.target.files?.[0];
|
|
3343
|
+
if (!file) return;
|
|
3344
|
+
try {
|
|
3345
|
+
const base64data = await getBase64Safe(file);
|
|
3346
|
+
if (docType === "id") {
|
|
3347
|
+
setGlobalExtractingId(true);
|
|
3348
|
+
setAiTasks([{ id: "1", label: "Document Scanned", status: "success" }, { id: "2", label: `Extracting ID for Member ${memberIndex + 1}...`, status: "loading" }]);
|
|
3349
|
+
const data = await baseApi("extract_id", { imageBase64: base64data });
|
|
3350
|
+
if (data.success) {
|
|
3351
|
+
const updatedMembers = [...formData.members];
|
|
3352
|
+
updatedMembers[memberIndex] = { ...updatedMembers[memberIndex], idExtractedData: data.data, idFileUrl: data.data.fileUrl || base64data, idMetadata: { fileName: file.name, contentType: file.type, fileSizeInBytes: file.size } };
|
|
3353
|
+
setFormData({ ...formData, members: updatedMembers });
|
|
3354
|
+
saveProgress({ ...formData, members: updatedMembers });
|
|
3355
|
+
} else import_react_hot_toast7.default.error(data.error || "Uh oh! Something went wrong.");
|
|
3356
|
+
} else {
|
|
3357
|
+
if (docType === "passport") setGlobalUploadingPassport(true);
|
|
3358
|
+
else setGlobalUploadingSignature(true);
|
|
3359
|
+
const data = await baseApi("upload_document", { imageBase64: base64data, docType: `member_${memberIndex}_${docType}` });
|
|
3360
|
+
if (data.success) {
|
|
3361
|
+
const updatedMembers = [...formData.members];
|
|
3362
|
+
if (docType === "passport") {
|
|
3363
|
+
updatedMembers[memberIndex].passportFileUrl = data.data.fileUrl || base64data;
|
|
3364
|
+
updatedMembers[memberIndex].passportMetadata = { fileName: file.name, contentType: file.type, fileSizeInBytes: file.size };
|
|
3365
|
+
} else {
|
|
3366
|
+
updatedMembers[memberIndex].signatureFileUrl = data.data.fileUrl || base64data;
|
|
3367
|
+
updatedMembers[memberIndex].signatureMetadata = { fileName: file.name, contentType: file.type, fileSizeInBytes: file.size };
|
|
3368
|
+
}
|
|
3369
|
+
setFormData({ ...formData, members: updatedMembers });
|
|
3370
|
+
saveProgress({ ...formData, members: updatedMembers });
|
|
3371
|
+
} else import_react_hot_toast7.default.error(`Failed to upload ${docType}.`);
|
|
3372
|
+
}
|
|
3373
|
+
} catch (error) {
|
|
3374
|
+
import_react_hot_toast7.default.error(error.message);
|
|
3375
|
+
} finally {
|
|
3376
|
+
if (docType === "id") setGlobalExtractingId(false);
|
|
3377
|
+
else if (docType === "passport") setGlobalUploadingPassport(false);
|
|
3378
|
+
else setGlobalUploadingSignature(false);
|
|
3379
|
+
e.target.value = "";
|
|
3380
|
+
}
|
|
3381
|
+
};
|
|
3382
|
+
const deleteCompanyMemberDocument = (memberIndex, docType) => {
|
|
3383
|
+
if (isReadOnly || isAnyUploading) return;
|
|
3384
|
+
const updatedMembers = [...formData.members];
|
|
3385
|
+
let fileUrl = "";
|
|
3386
|
+
if (docType === "id") {
|
|
3387
|
+
fileUrl = updatedMembers[memberIndex].idFileUrl;
|
|
3388
|
+
updatedMembers[memberIndex].idFileUrl = "";
|
|
3389
|
+
updatedMembers[memberIndex].idExtractedData = null;
|
|
3390
|
+
updatedMembers[memberIndex].idMetadata = null;
|
|
3391
|
+
} else if (docType === "passport") {
|
|
3392
|
+
fileUrl = updatedMembers[memberIndex].passportFileUrl;
|
|
3393
|
+
updatedMembers[memberIndex].passportFileUrl = "";
|
|
3394
|
+
updatedMembers[memberIndex].passportMetadata = null;
|
|
3395
|
+
} else if (docType === "signature") {
|
|
3396
|
+
fileUrl = updatedMembers[memberIndex].signatureFileUrl;
|
|
3397
|
+
updatedMembers[memberIndex].signatureFileUrl = "";
|
|
3398
|
+
updatedMembers[memberIndex].signatureMetadata = null;
|
|
3399
|
+
}
|
|
3400
|
+
setFormData({ ...formData, members: updatedMembers });
|
|
3401
|
+
saveProgress({ ...formData, members: updatedMembers });
|
|
3402
|
+
if (fileUrl) baseApi("delete_document", { docType, url: fileUrl }).catch(() => {
|
|
3403
|
+
});
|
|
3404
|
+
};
|
|
3405
|
+
const handleBusinessUpload = async (e, docType) => {
|
|
3406
|
+
const file = e.target.files?.[0];
|
|
3407
|
+
if (!file) return;
|
|
3408
|
+
try {
|
|
3409
|
+
const base64data = await getBase64Safe(file);
|
|
3410
|
+
if (docType === "id") {
|
|
3411
|
+
setGlobalExtractingId(true);
|
|
3412
|
+
setAiTasks([{ id: "1", label: "Document Scanned", status: "success" }, { id: "2", label: "Extracting Identity Data...", status: "loading" }]);
|
|
3413
|
+
const data = await baseApi("extract_id", { imageBase64: base64data });
|
|
3414
|
+
if (data.success) {
|
|
3415
|
+
setAiTasks([{ id: "1", label: "Document Scanned", status: "success" }, { id: "2", label: "Identity Data Extracted", status: "success" }]);
|
|
3416
|
+
const updatedForm = { ...formData, idExtractedData: data.data, idFileUrl: data.data.fileUrl || base64data, idMetadata: { fileName: file.name, contentType: file.type, fileSizeInBytes: file.size } };
|
|
3417
|
+
setFormData(updatedForm);
|
|
3418
|
+
saveProgress(updatedForm);
|
|
3419
|
+
} else {
|
|
3420
|
+
import_react_hot_toast7.default.error(data.error || "Uh oh! Something went wrong.");
|
|
3421
|
+
setAiTasks([{ id: "1", label: "Document Scanned", status: "success" }, { id: "2", label: "Extraction Failed", status: "error" }]);
|
|
3422
|
+
}
|
|
3423
|
+
} else {
|
|
3424
|
+
if (docType === "passport") setGlobalUploadingPassport(true);
|
|
3425
|
+
else setGlobalUploadingSignature(true);
|
|
3426
|
+
const data = await baseApi("upload_document", { imageBase64: base64data, docType });
|
|
3427
|
+
if (data.success) {
|
|
3428
|
+
const updatedForm = { ...formData };
|
|
3429
|
+
if (docType === "passport") {
|
|
3430
|
+
updatedForm.passportFileUrl = data.data.fileUrl || base64data;
|
|
3431
|
+
updatedForm.passportMetadata = { fileName: file.name, contentType: file.type, fileSizeInBytes: file.size };
|
|
3432
|
+
approveSection("passportApproved", updatedForm);
|
|
3433
|
+
} else {
|
|
3434
|
+
updatedForm.signatureFileUrl = data.data.fileUrl || base64data;
|
|
3435
|
+
updatedForm.signatureMetadata = { fileName: file.name, contentType: file.type, fileSizeInBytes: file.size };
|
|
3436
|
+
approveSection("signatureApproved", updatedForm);
|
|
3437
|
+
}
|
|
3438
|
+
setFormData(updatedForm);
|
|
3439
|
+
} else import_react_hot_toast7.default.error(data.error || `Failed to upload ${docType}.`);
|
|
3440
|
+
}
|
|
3441
|
+
} catch (error) {
|
|
3442
|
+
import_react_hot_toast7.default.error(error.message);
|
|
3443
|
+
} finally {
|
|
3444
|
+
if (docType === "id") {
|
|
3445
|
+
setGlobalExtractingId(false);
|
|
3446
|
+
if (idRef.current) idRef.current.value = "";
|
|
3447
|
+
} else if (docType === "passport") {
|
|
3448
|
+
setGlobalUploadingPassport(false);
|
|
3449
|
+
if (passportRef.current) passportRef.current.value = "";
|
|
3450
|
+
} else {
|
|
3451
|
+
setGlobalUploadingSignature(false);
|
|
3452
|
+
if (signatureRef.current) signatureRef.current.value = "";
|
|
3453
|
+
}
|
|
3454
|
+
}
|
|
3455
|
+
};
|
|
3456
|
+
const deleteBusinessDocument = (docType) => {
|
|
3457
|
+
if (isReadOnly || isAnyUploading) return;
|
|
3458
|
+
const updatedForm = { ...formData };
|
|
3459
|
+
let fileUrl = "";
|
|
3460
|
+
if (docType === "id") {
|
|
3461
|
+
fileUrl = formData.idFileUrl;
|
|
3462
|
+
updatedForm.idFileUrl = "";
|
|
3463
|
+
updatedForm.idExtractedData = null;
|
|
3464
|
+
updatedForm.idMetadata = null;
|
|
3465
|
+
editSection("idApproved");
|
|
3466
|
+
} else if (docType === "passport") {
|
|
3467
|
+
fileUrl = formData.passportFileUrl;
|
|
3468
|
+
updatedForm.passportFileUrl = "";
|
|
3469
|
+
updatedForm.passportMetadata = null;
|
|
3470
|
+
editSection("passportApproved");
|
|
3471
|
+
} else if (docType === "signature") {
|
|
3472
|
+
fileUrl = formData.signatureFileUrl;
|
|
3473
|
+
updatedForm.signatureFileUrl = "";
|
|
3474
|
+
updatedForm.signatureMetadata = null;
|
|
3475
|
+
editSection("signatureApproved");
|
|
3476
|
+
}
|
|
3477
|
+
setFormData(updatedForm);
|
|
3478
|
+
if (fileUrl) baseApi("delete_document", { docType, url: fileUrl }).catch(() => {
|
|
3479
|
+
});
|
|
3480
|
+
};
|
|
3481
|
+
const handleFinalSubmit = async () => {
|
|
3482
|
+
if (!iAgree || isReadOnly) return;
|
|
3483
|
+
setIsSubmitting(true);
|
|
3484
|
+
let finalJsonPayload = {
|
|
3485
|
+
iAgree: true,
|
|
3486
|
+
proposedNames: [formData.approvedName, formData.proposedName2],
|
|
3487
|
+
natureOfBusiness: formData.natureOfBusiness,
|
|
3488
|
+
additionalDocuments: [
|
|
3489
|
+
formData.otherDoc1Url ? { fileDataUrl: formData.otherDoc1Url, ...formData.otherDoc1Meta } : null,
|
|
3490
|
+
formData.otherDoc2Url ? { fileDataUrl: formData.otherDoc2Url, ...formData.otherDoc2Meta } : null,
|
|
3491
|
+
formData.otherDoc3Url ? { fileDataUrl: formData.otherDoc3Url, ...formData.otherDoc3Meta } : null
|
|
3492
|
+
].filter(Boolean)
|
|
3493
|
+
};
|
|
3494
|
+
if (type === "company") {
|
|
3495
|
+
finalJsonPayload.companyAddress = { streetAddress: formData.address, city: formData.city, state: formData.state, postalCode: "000000" };
|
|
3496
|
+
finalJsonPayload.directorsAndShareholders = formData.members.map((m) => ({
|
|
3497
|
+
role: m.role,
|
|
3498
|
+
sharePercentage: m.role !== "Director Only" ? m.sharePercentage : "0",
|
|
3499
|
+
fullName: m.idExtractedData?.fullName || m.fullName,
|
|
3500
|
+
dateOfBirth: m.idExtractedData?.dob || "",
|
|
3501
|
+
phoneNumber: m.phone,
|
|
3502
|
+
emailAddress: m.email,
|
|
3503
|
+
residentialAddress: { streetAddress: m.address, city: m.city, state: m.state, country: m.nationality === "Nigerian" ? "Nigeria" : "Foreign" },
|
|
3504
|
+
nationality: m.nationality,
|
|
3505
|
+
identification: { type: m.idExtractedData?.documentType || "ID", idNumber: m.idExtractedData?.idNumber || "UNKNOWN" },
|
|
3506
|
+
passportPhotograph: m.passportFileUrl ? { ...m.passportMetadata, fileDataUrl: m.passportFileUrl } : void 0,
|
|
3507
|
+
signature: m.signatureFileUrl ? { ...m.signatureMetadata, fileDataUrl: m.signatureFileUrl } : void 0
|
|
3508
|
+
}));
|
|
3509
|
+
} else {
|
|
3510
|
+
finalJsonPayload.businessAddress = { streetAddress: formData.address, city: formData.city, state: formData.state, postalCode: "000000" };
|
|
3511
|
+
finalJsonPayload.proprietors = [{
|
|
3512
|
+
fullName: formData.idExtractedData?.fullName || formData.ownerName,
|
|
3513
|
+
dateOfBirth: formData.idExtractedData?.dob || "",
|
|
3514
|
+
phoneNumber: formData.ownerPhone,
|
|
3515
|
+
emailAddress: formData.ownerEmail,
|
|
3516
|
+
residentialAddress: { streetAddress: formData.address, city: formData.city, state: formData.state, country: "Nigeria" },
|
|
3517
|
+
nationality: "Nigerian",
|
|
3518
|
+
identification: { type: formData.idExtractedData?.documentType || "ID", idNumber: formData.idExtractedData?.idNumber || "UNKNOWN" },
|
|
3519
|
+
passportPhotograph: formData.passportFileUrl ? { ...formData.passportMetadata, fileDataUrl: formData.passportFileUrl } : void 0,
|
|
3520
|
+
signature: formData.signatureFileUrl ? { ...formData.signatureMetadata, fileDataUrl: formData.signatureFileUrl } : void 0
|
|
3521
|
+
}];
|
|
3522
|
+
}
|
|
3523
|
+
const data = await baseApi("submit", finalJsonPayload);
|
|
3524
|
+
if (data.success) {
|
|
3525
|
+
import_react_hot_toast7.default.success("Application Submitted!");
|
|
3526
|
+
onRedirectToApplication(applicationId);
|
|
3527
|
+
} else {
|
|
3528
|
+
import_react_hot_toast7.default.error(data.error || "Uh oh! Something went wrong.");
|
|
3529
|
+
setIsSubmitting(false);
|
|
3530
|
+
}
|
|
3531
|
+
};
|
|
3532
|
+
const isStep0Valid = type === "company" ? formState.natureApproved && formState.nameApproved && formState.addressApproved && formState.membersDetailsApproved : formState.natureApproved && formState.nameApproved && formState.addressApproved && formState.ownerApproved;
|
|
3533
|
+
const isStep1Valid = type === "company" ? formState.membersDocsApproved : formState.idApproved && formState.passportApproved && formState.signatureApproved;
|
|
3534
|
+
const titleText = type === "company" ? "Company Incorporation (LLC)" : "Business Name Registration";
|
|
3535
|
+
if (isBooting) return /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex justify-center py-20" }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons21.Loading03Icon, size: 32, className: "animate-spin text-black" }));
|
|
3536
|
+
if (!["DRAFT", "QUEUED", "REJECTED"].includes(appStatus) && appStatus !== "") {
|
|
3537
|
+
return /* @__PURE__ */ import_react65.default.createElement("div", { className: "w-full max-w-3xl mx-auto bg-white rounded-4xl p-6 sm:p-10 flex flex-col items-center justify-center text-center gap-5 animate-in fade-in slide-in-from-bottom-2 duration-500 mb-20 py-24" }, appStatus === "COMPLETED" ? /* @__PURE__ */ import_react65.default.createElement(import_react65.default.Fragment, null, /* @__PURE__ */ import_react65.default.createElement("div", { className: "w-20 h-20 bg-neutral-50 text-neutral-500 rounded-full flex items-center justify-center mb-2" }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons21.CheckmarkBadge01Icon, size: 40 })), /* @__PURE__ */ import_react65.default.createElement("h2", { className: "text-xl font-serif text-black" }, "Registration Completed"), /* @__PURE__ */ import_react65.default.createElement("p", { className: "text-sm text-neutral-500 max-w-md" }, "Your application has been successfully verified and registered.")) : appStatus === "PENDING" ? /* @__PURE__ */ import_react65.default.createElement(import_react65.default.Fragment, null, /* @__PURE__ */ import_react65.default.createElement("div", { className: "w-20 h-20 bg-neutral-50 text-neutral-500 rounded-full flex items-center justify-center mb-2" }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons21.TimeQuarterPassIcon, size: 40, className: "animate-spin" })), /* @__PURE__ */ import_react65.default.createElement("h2", { className: "text-xl font-serif text-black" }, "Application is Pending"), /* @__PURE__ */ import_react65.default.createElement("p", { className: "text-sm text-neutral-500 max-w-md" }, "Your application is currently pending review.")) : appStatus === "AWAITING_PAYMENT" ? /* @__PURE__ */ import_react65.default.createElement(import_react65.default.Fragment, null, /* @__PURE__ */ import_react65.default.createElement("div", { className: "w-20 h-20 bg-amber-50 text-amber-500 rounded-full flex items-center justify-center mb-2" }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons21.TimeQuarterPassIcon, size: 40, className: "animate-pulse" })), /* @__PURE__ */ import_react65.default.createElement("h2", { className: "text-xl text-black" }, "Awaiting Payment"), /* @__PURE__ */ import_react65.default.createElement("p", { className: "text-sm text-neutral-500 max-w-md" }, "Your application is complete and awaiting government fee settlement. Please go to the Billing tab to authorize payment."), /* @__PURE__ */ import_react65.default.createElement("div", { className: "mt-6 flex flex-col items-center gap-3" }, /* @__PURE__ */ import_react65.default.createElement("button", { onClick: onRedirectToBilling, className: "px-8 py-3 bg-black text-white text-[11px] tracking-widest rounded-full hover:bg-neutral-800 outline-none" }, "Go to Billing & Invoices"), /* @__PURE__ */ import_react65.default.createElement("button", { onClick: () => setIsAbortModalOpen(true), className: "px-8 py-3 border border-neutral-200 text-neutral-600 text-[11px] tracking-widest rounded-full hover:bg-neutral-50 outline-none" }, "Abort & Edit Application"))) : /* @__PURE__ */ import_react65.default.createElement(import_react65.default.Fragment, null, /* @__PURE__ */ import_react65.default.createElement("div", { className: "w-20 h-20 bg-neutral-50 text-neutral-500 rounded-full flex items-center justify-center mb-2" }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons21.TimeQuarterPassIcon, size: 40 })), /* @__PURE__ */ import_react65.default.createElement("h2", { className: "text-xl font-serif text-black" }, "Application Submitted"), /* @__PURE__ */ import_react65.default.createElement("p", { className: "text-sm text-neutral-500 max-w-md" }, "Your application is currently ", appStatus.replace(/_/g, " ").toLowerCase(), "."), ["AWAITING_PAYMENT", "READY_FOR_SUBMISSION", "AWAITING_CONFIRMATION"].includes(appStatus) && /* @__PURE__ */ import_react65.default.createElement("div", { className: "mt-6 flex flex-col items-center gap-3" }, /* @__PURE__ */ import_react65.default.createElement("button", { onClick: () => setIsAbortModalOpen(true), className: "px-8 py-3 border border-neutral-200 text-neutral-600 text-[11px] tracking-widest rounded-full hover:bg-neutral-50 outline-none" }, "Abort Application"))), isAbortModalOpen && /* @__PURE__ */ import_react65.default.createElement("div", { className: "fixed inset-0 z-110 flex items-center justify-center p-4" }, /* @__PURE__ */ import_react65.default.createElement("div", { className: "absolute inset-0 bg-black/30", onClick: () => !isAborting && setIsAbortModalOpen(false) }), /* @__PURE__ */ import_react65.default.createElement("div", { className: "relative w-100 bg-white shadow-2xl rounded-3xl flex flex-col overflow-hidden animate-in zoom-in-95 duration-200 text-left" }, /* @__PURE__ */ import_react65.default.createElement("div", { className: "p-6 flex flex-col gap-4 text-center" }, /* @__PURE__ */ import_react65.default.createElement("h3", { className: "text-[17px] font-serif text-black tracking-tight" }, "Abort Application?"), /* @__PURE__ */ import_react65.default.createElement("p", { className: "text-[12px] text-neutral-500 leading-relaxed" }, "Are you sure you want to abort? If you have already made a payment, returning to draft may cause issues. Your invoice will be deleted.")), /* @__PURE__ */ import_react65.default.createElement("div", { className: "w-full flex " }, /* @__PURE__ */ import_react65.default.createElement("button", { onClick: () => setIsAbortModalOpen(false), disabled: isAborting, className: "flex-1 py-4 text-[13px] text-neutral-500 hover:bg-neutral-50 transition-colors outline-none disabled:opacity-50" }, "Cancel"), /* @__PURE__ */ import_react65.default.createElement("button", { onClick: handleAbort, disabled: isAborting, className: "flex-1 py-4 text-[13px] text-red-500 hover:bg-neutral-50 transition-colors outline-none disabled:opacity-50" }, isAborting ? "Aborting..." : "Yes, Abort")))));
|
|
3538
|
+
}
|
|
3539
|
+
return /* @__PURE__ */ import_react65.default.createElement("div", { className: "w-full max-w-3xl mx-auto bg-white rounded-4xl p-6 sm:p-10 flex flex-col gap-10 animate-in fade-in slide-in-from-bottom-2 duration-500 mb-20" }, /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex flex-col gap-8" }, /* @__PURE__ */ import_react65.default.createElement("div", null, /* @__PURE__ */ import_react65.default.createElement("h2", { className: "text-xl font-serif text-black tracking-tight mb-1" }, titleText), /* @__PURE__ */ import_react65.default.createElement("p", { className: "text-sm text-neutral-500" }, "Answer the questions below to build your official application.")), /* @__PURE__ */ import_react65.default.createElement("div", { className: "px-2" }, /* @__PURE__ */ import_react65.default.createElement(Stagger, { steps: MACRO_STEPS, currentStep: macroStep }))), /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex flex-col gap-8" }, macroStep === 0 && /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex flex-col gap-8 animate-in fade-in" }, /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex flex-col gap-4" }, /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex items-center gap-2 text-black" }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons21.Briefcase02Icon, size: 18 }), /* @__PURE__ */ import_react65.default.createElement("h3", { className: "text-sm " }, "What does your ", type === "company" ? "company" : "business", " do?")), !formState.natureApproved ? /* @__PURE__ */ import_react65.default.createElement(import_react65.default.Fragment, null, /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex flex-col gap-3 " }, /* @__PURE__ */ import_react65.default.createElement(TextInput, { label: type === "company" ? "Company Description" : "Business Description", placeholder: "e.g. We provide professional services to clients.", value: formData.businessDesc, onChange: (v) => setFormData({ ...formData, businessDesc: v }), disabled: isReadOnly || isSubmitting }), /* @__PURE__ */ import_react65.default.createElement(ThreeDActionButton, { onClick: handleAnalyzeNature, disabled: formData.businessDesc.length < 5 || isAnalyzingNature || isReadOnly, isLoading: isAnalyzingNature, className: "w-fit" }, "Analyze Nature")), isAnalyzingNature && /* @__PURE__ */ import_react65.default.createElement("div", { className: " mt-2" }, /* @__PURE__ */ import_react65.default.createElement(AiStageCheck, { tasks: [{ id: "1", label: "Matching with Official Categories...", status: "loading" }] })), suggestedNature && /* @__PURE__ */ import_react65.default.createElement("div", { className: " mt-2 animate-in fade-in" }, /* @__PURE__ */ import_react65.default.createElement(AiApproveDecline, { suggestionTitle: "Classification Found", suggestionValue: /* @__PURE__ */ import_react65.default.createElement("div", null, /* @__PURE__ */ import_react65.default.createElement("p", { className: " text-black" }, suggestedNature.specificLabel), /* @__PURE__ */ import_react65.default.createElement("p", { className: "text-xs text-neutral-500 mt-1" }, "Category: ", suggestedNature.categoryLabel)), onApprove: () => {
|
|
3540
|
+
const newForm = { ...formData, natureOfBusiness: suggestedNature };
|
|
3541
|
+
setFormData(newForm);
|
|
3542
|
+
approveSection("natureApproved", newForm);
|
|
3543
|
+
}, onDecline: () => setSuggestedNature(null) }))) : /* @__PURE__ */ import_react65.default.createElement("div", { className: " flex items-center justify-between border border-neutral-100 p-4 rounded-xl" }, /* @__PURE__ */ import_react65.default.createElement("div", { className: "pr-4" }, /* @__PURE__ */ import_react65.default.createElement("p", { className: "text-sm text-black" }, formData.natureOfBusiness?.specificLabel), /* @__PURE__ */ import_react65.default.createElement("p", { className: "text-xs text-neutral-500 mt-1" }, formData.businessDesc)), !isReadOnly && /* @__PURE__ */ import_react65.default.createElement("button", { onClick: () => editSection("natureApproved"), className: "p-2 text-neutral-400 hover:text-black transition-colors outline-none shrink-0" }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons21.PencilEdit01Icon, size: 16 })))), formState.natureApproved && /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex flex-col gap-4 pt-6 animate-in slide-in-from-top-4 duration-500" }, /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex items-center gap-2 text-black" }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons21.CheckmarkBadge01Icon, size: 18 }), /* @__PURE__ */ import_react65.default.createElement("h3", { className: "text-sm " }, "What name would you like to register?")), /* @__PURE__ */ import_react65.default.createElement("p", { className: "text-xs text-neutral-500 -mt-2" }, "Provide two options. We will verify availability against the official registry."), !formState.nameApproved ? /* @__PURE__ */ import_react65.default.createElement(import_react65.default.Fragment, null, /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex flex-col gap-4" }, /* @__PURE__ */ import_react65.default.createElement(TextInput, { label: "Proposed Name 1 (Preferred)", value: formData.proposedName, onChange: (v) => setFormData({ ...formData, proposedName: v }), disabled: isReadOnly || isSubmitting }), /* @__PURE__ */ import_react65.default.createElement(TextInput, { label: "Proposed Name 2 (Alternative)", value: formData.proposedName2, onChange: (v) => setFormData({ ...formData, proposedName2: v }), disabled: isReadOnly || isSubmitting }), /* @__PURE__ */ import_react65.default.createElement(ThreeDActionButton, { onClick: () => handleCheckNames(formData.proposedName), disabled: !formData.proposedName || !formData.proposedName2 || isCheckingName || isCheckingQualifier || isReadOnly, isLoading: isCheckingQualifier || isCheckingName, className: "w-fit" }, "Check Availability")), (isCheckingQualifier || isCheckingName) && /* @__PURE__ */ import_react65.default.createElement("div", { className: " mt-2" }, /* @__PURE__ */ import_react65.default.createElement(AiStageCheck, { tasks: [{ id: "1", label: "AI Qualifier Pre-check...", status: isCheckingQualifier ? "loading" : "success" }, { id: "2", label: "Checking Official Registry Database...", status: isCheckingName ? "loading" : "pending" }, { id: "3", label: "Fallback Checking Public Database...", status: isCheckingName ? "loading" : "pending" }, { id: "4", label: "Validation Status...", status: isCheckingName ? "loading" : "pending" }] })), qualifierCheckResult && /* @__PURE__ */ import_react65.default.createElement("div", { className: "mt-2 animate-in fade-in" }, /* @__PURE__ */ import_react65.default.createElement("div", { className: "border border-purple-100 bg-linear-to-bl from-purple-50/80 via-white to-white p-5 rounded-2xl flex flex-col gap-4 relative overflow-hidden" }, /* @__PURE__ */ import_react65.default.createElement("div", null, /* @__PURE__ */ import_react65.default.createElement("span", { className: "text-[10px] tracking-widest text-purple-600 block mb-1" }, "AI Suggestion: Structural Qualifier Missing"), /* @__PURE__ */ import_react65.default.createElement("p", { className: "text-sm text-black mb-3" }, "Nigerian registrations require a structural qualifier to be approved."), /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex flex-col gap-2" }, (qualifierCheckResult.suggestions || []).map((alt, i) => /* @__PURE__ */ import_react65.default.createElement("button", { key: i, onClick: () => setFormData({ ...formData, proposedName: alt }), className: "text-left px-4 py-2 border border-neutral-200 rounded-full hover:border-black text-sm transition-colors outline-none" }, alt)))), /* @__PURE__ */ import_react65.default.createElement("button", { onClick: () => setQualifierCheckResult(null), className: "w-fit text-[11px] tracking-widest text-neutral-500 hover:text-black transition-colors mt-2 outline-none" }, "Edit Name Manually"))), nameCheckResult && /* @__PURE__ */ import_react65.default.createElement("div", { className: " mt-2 animate-in fade-in" }, nameCheckResult.status === "APPROVED" || nameCheckResult.status === "APPROVED_WARNING" || nameCheckResult.status === "SKIPPED" ? /* @__PURE__ */ import_react65.default.createElement(AiApproveDecline, { suggestionTitle: nameCheckResult.status === "APPROVED" ? "Name Available!" : "Fallback Approval", suggestionValue: /* @__PURE__ */ import_react65.default.createElement("div", null, /* @__PURE__ */ import_react65.default.createElement("p", { className: `mb-1 ${nameCheckResult.status === "APPROVED" ? "text-emerald-600 " : "text-orange-500 "}` }, nameCheckResult.status === "APPROVED" ? "Excellent chance of approval." : "Validation Bypassed / Fallback."), /* @__PURE__ */ import_react65.default.createElement("p", { className: "text-xs text-neutral-600" }, nameCheckResult.message), /* @__PURE__ */ import_react65.default.createElement("p", { className: "text-xs text-neutral-600 mt-2 " }, "Proposed Option: ", nameCheckResult.approvedOption)), onApprove: () => {
|
|
3544
|
+
const newForm = { ...formData, approvedName: nameCheckResult.approvedOption };
|
|
3545
|
+
setFormData(newForm);
|
|
3546
|
+
approveSection("nameApproved", newForm);
|
|
3547
|
+
}, onDecline: () => setNameCheckResult(null) }) : /* @__PURE__ */ import_react65.default.createElement("div", { className: "border border-red-100 bg-linear-to-bl from-red-50/80 via-white to-white p-5 rounded-2xl flex flex-col gap-4 relative overflow-hidden" }, /* @__PURE__ */ import_react65.default.createElement("div", null, /* @__PURE__ */ import_react65.default.createElement("span", { className: "text-[10px] tracking-widest text-red-600 block mb-1" }, "Registry Conflict Detected"), /* @__PURE__ */ import_react65.default.createElement("p", { className: "text-sm text-black mb-3" }, nameCheckResult.message), /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex flex-col gap-2" }, (nameCheckResult.alternatives || []).map((alt, i) => /* @__PURE__ */ import_react65.default.createElement("button", { key: i, onClick: () => setFormData({ ...formData, proposedName: alt }), className: "text-left px-4 py-2 border border-neutral-200 rounded-full hover:border-black text-sm transition-colors outline-none" }, alt)))), /* @__PURE__ */ import_react65.default.createElement("button", { onClick: () => setNameCheckResult(null), className: "w-fit text-[11px] tracking-widest text-neutral-500 hover:text-black transition-colors mt-2 outline-none" }, "Try New Name")))) : /* @__PURE__ */ import_react65.default.createElement("div", { className: " flex items-center justify-between border border-neutral-100 p-4 rounded-xl" }, /* @__PURE__ */ import_react65.default.createElement("div", null, /* @__PURE__ */ import_react65.default.createElement("p", { className: "text-sm text-black" }, formData.approvedName), /* @__PURE__ */ import_react65.default.createElement("p", { className: "text-xs text-emerald-600 mt-1" }, "Verified against registry")), !isReadOnly && /* @__PURE__ */ import_react65.default.createElement("button", { onClick: () => editSection("nameApproved"), className: "p-2 text-neutral-400 hover:text-black transition-colors outline-none shrink-0" }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons21.PencilEdit01Icon, size: 16 })))), formState.nameApproved && /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex flex-col gap-4 pt-6 animate-in slide-in-from-top-4 duration-500" }, /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex items-center gap-2 text-black" }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons21.Location01Icon, size: 18 }), /* @__PURE__ */ import_react65.default.createElement("h3", { className: "text-sm " }, "Where is your head office located?")), !formState.addressApproved ? /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex flex-col gap-4 " }, /* @__PURE__ */ import_react65.default.createElement(TextInput, { label: "Street Address", value: formData.address, onChange: (v) => setFormData({ ...formData, address: v }), disabled: isReadOnly || isSubmitting }), /* @__PURE__ */ import_react65.default.createElement("div", { className: "grid grid-cols-2 gap-4" }, /* @__PURE__ */ import_react65.default.createElement(TextInput, { label: "City", value: formData.city, onChange: (v) => setFormData({ ...formData, city: v }), disabled: isReadOnly || isSubmitting }), /* @__PURE__ */ import_react65.default.createElement(TextInput, { label: "State", value: formData.state, readOnly: true, onClick: () => !isReadOnly && setActiveModal({ isOpen: true, type: "state", memberIndex: null, isGlobalState: true }), placeholder: "Select State", onChange: () => {
|
|
3548
|
+
}, disabled: isReadOnly || isSubmitting })), /* @__PURE__ */ import_react65.default.createElement(ThreeDActionButton, { onClick: () => approveSection("addressApproved"), disabled: !formData.address || !formData.city || !formData.state || isReadOnly, className: "w-fit mt-2" }, "Confirm Address")) : /* @__PURE__ */ import_react65.default.createElement("div", { className: " flex items-center justify-between border border-neutral-100 p-4 rounded-xl" }, /* @__PURE__ */ import_react65.default.createElement("p", { className: "text-sm text-neutral-500" }, formData.address, ", ", formData.city, ", ", formData.state), !isReadOnly && /* @__PURE__ */ import_react65.default.createElement("button", { onClick: () => editSection("addressApproved"), className: "p-2 text-neutral-400 hover:text-black transition-colors outline-none shrink-0" }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons21.PencilEdit01Icon, size: 16 })))), formState.addressApproved && type === "company" && /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex flex-col gap-4 pt-6 animate-in slide-in-from-top-4 duration-500" }, /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex items-center justify-between gap-2 text-black border-b border-neutral-100 pb-3" }, /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons21.UserIcon, size: 18 }), /* @__PURE__ */ import_react65.default.createElement("h3", { className: "text-sm " }, "Directors & Shareholders")), !formState.membersDetailsApproved && /* @__PURE__ */ import_react65.default.createElement("div", { className: `text-xs px-3 py-1 rounded-full ${getCompanyTotalShares() === 100 ? "bg-emerald-50 text-emerald-600" : "bg-red-50 text-red-500"}` }, "Total Shares: ", getCompanyTotalShares(), "%")), /* @__PURE__ */ import_react65.default.createElement("p", { className: "text-xs text-neutral-500 -mt-2" }, "Provide details for all individuals. Ensure total share percentage equals 100%."), !formState.membersDetailsApproved ? /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex flex-col gap-6 " }, formData.members.map((member, i) => /* @__PURE__ */ import_react65.default.createElement("div", { key: member.id, className: "flex flex-col gap-4 border border-neutral-100 p-5 rounded-2xl bg-neutral-50/30" }, /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex justify-between items-center mb-1" }, /* @__PURE__ */ import_react65.default.createElement("span", { className: "text-[10px] tracking-widest text-neutral-400" }, "Member ", i + 1), formData.members.length > 1 && !isReadOnly && /* @__PURE__ */ import_react65.default.createElement("button", { onClick: () => removeCompanyMember(i), className: "text-red-500 text-xs hover:text-red-600" }, "Remove")), /* @__PURE__ */ import_react65.default.createElement("div", { className: "grid grid-cols-2 gap-4" }, /* @__PURE__ */ import_react65.default.createElement(TextInput, { label: "Role", value: member.role, readOnly: true, onClick: () => !isReadOnly && setActiveModal({ isOpen: true, type: "role", memberIndex: i }), onChange: () => {
|
|
3549
|
+
}, disabled: isReadOnly || isSubmitting }), member.role !== "Director Only" && /* @__PURE__ */ import_react65.default.createElement(NumberInput, { label: "Share Percentage (%)", value: member.sharePercentage, onChange: (v) => updateCompanyMemberInfo(i, "sharePercentage", v), disabled: isReadOnly || isSubmitting })), /* @__PURE__ */ import_react65.default.createElement(TextInput, { label: "Full Name", value: member.fullName, onChange: (v) => updateCompanyMemberInfo(i, "fullName", v), disabled: isReadOnly || isSubmitting }), /* @__PURE__ */ import_react65.default.createElement("div", { className: "grid grid-cols-2 gap-4" }, /* @__PURE__ */ import_react65.default.createElement(NumberInput, { label: "Phone Number", value: member.phone, onChange: (v) => updateCompanyMemberInfo(i, "phone", v), disabled: isReadOnly || isSubmitting }), /* @__PURE__ */ import_react65.default.createElement(TextInput, { label: "Email Address", value: member.email, onChange: (v) => updateCompanyMemberInfo(i, "email", v), disabled: isReadOnly || isSubmitting })), /* @__PURE__ */ import_react65.default.createElement(TextInput, { label: "Nationality", value: member.nationality, readOnly: true, onClick: () => !isReadOnly && setActiveModal({ isOpen: true, type: "nationality", memberIndex: i }), onChange: () => {
|
|
3550
|
+
}, disabled: isReadOnly || isSubmitting }), /* @__PURE__ */ import_react65.default.createElement(TextInput, { label: "Residential Address", value: member.address, onChange: (v) => updateCompanyMemberInfo(i, "address", v), disabled: isReadOnly || isSubmitting }), /* @__PURE__ */ import_react65.default.createElement("div", { className: "grid grid-cols-2 gap-4" }, /* @__PURE__ */ import_react65.default.createElement(TextInput, { label: "City", value: member.city, onChange: (v) => updateCompanyMemberInfo(i, "city", v), disabled: isReadOnly || isSubmitting }), /* @__PURE__ */ import_react65.default.createElement(TextInput, { label: "State", value: member.state, readOnly: true, onClick: () => !isReadOnly && setActiveModal({ isOpen: true, type: "state", memberIndex: i }), onChange: () => {
|
|
3551
|
+
}, disabled: isReadOnly || isSubmitting })))), /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex items-center justify-between mt-2" }, !isReadOnly && /* @__PURE__ */ import_react65.default.createElement("button", { onClick: addCompanyMember, className: "px-6 py-2 bg-white border border-neutral-200 text-black text-[11px] tracking-widest rounded-full hover:bg-neutral-50 transition-colors outline-none" }, "+ Add Member"), /* @__PURE__ */ import_react65.default.createElement(ThreeDActionButton, { onClick: () => approveSection("membersDetailsApproved"), disabled: !areCompanyMembersValid() || isReadOnly, className: "w-fit" }, "Confirm Members"))) : /* @__PURE__ */ import_react65.default.createElement("div", { className: " flex items-center justify-between border border-neutral-100 p-4 rounded-xl" }, /* @__PURE__ */ import_react65.default.createElement("div", null, /* @__PURE__ */ import_react65.default.createElement("p", { className: "text-sm text-black" }, formData.members.length, " Member(s) Registered"), /* @__PURE__ */ import_react65.default.createElement("p", { className: "text-xs text-neutral-500 mt-1" }, "Total Shares: 100% Verified.")), !isReadOnly && /* @__PURE__ */ import_react65.default.createElement("button", { onClick: () => editSection("membersDetailsApproved"), className: "p-2 text-neutral-400 hover:text-black transition-colors outline-none shrink-0" }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons21.PencilEdit01Icon, size: 16 })))), formState.addressApproved && type === "business" && /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex flex-col gap-4 pt-6 animate-in slide-in-from-top-4 duration-500" }, /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex items-center gap-2 text-black" }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons21.UserIcon, size: 18 }), /* @__PURE__ */ import_react65.default.createElement("h3", { className: "text-sm " }, "Who owns the business?")), /* @__PURE__ */ import_react65.default.createElement("p", { className: "text-xs text-neutral-500 -mt-2" }, "Provide basic contact info. We will extract your DOB and ID number automatically in the next step."), !formState.ownerApproved ? /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex flex-col gap-4 " }, /* @__PURE__ */ import_react65.default.createElement(TextInput, { label: "Full Name", value: formData.ownerName, onChange: (v) => setFormData({ ...formData, ownerName: v }), disabled: isReadOnly || isSubmitting }), /* @__PURE__ */ import_react65.default.createElement("div", { className: "grid grid-cols-2 gap-4" }, /* @__PURE__ */ import_react65.default.createElement(NumberInput, { label: "Phone Number", value: formData.ownerPhone, onChange: (v) => setFormData({ ...formData, ownerPhone: v }), disabled: isReadOnly || isSubmitting }), /* @__PURE__ */ import_react65.default.createElement(TextInput, { label: "Email Address", value: formData.ownerEmail, onChange: (v) => setFormData({ ...formData, ownerEmail: v }), disabled: isReadOnly || isSubmitting })), /* @__PURE__ */ import_react65.default.createElement(ThreeDActionButton, { onClick: () => approveSection("ownerApproved"), disabled: !formData.ownerName || !formData.ownerPhone || !formData.ownerEmail || isReadOnly, className: "w-fit mt-2" }, "Confirm Owner Details")) : /* @__PURE__ */ import_react65.default.createElement("div", { className: " flex items-center justify-between border border-neutral-100 p-4 rounded-xl" }, /* @__PURE__ */ import_react65.default.createElement("div", null, /* @__PURE__ */ import_react65.default.createElement("p", { className: "text-sm text-black" }, formData.ownerName), /* @__PURE__ */ import_react65.default.createElement("p", { className: "text-xs text-neutral-500 mt-1" }, formData.ownerEmail, " \u2022 ", formData.ownerPhone)), !isReadOnly && /* @__PURE__ */ import_react65.default.createElement("button", { onClick: () => editSection("ownerApproved"), className: "p-2 text-neutral-400 hover:text-black transition-colors outline-none shrink-0" }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons21.PencilEdit01Icon, size: 16 })))), /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex items-center justify-between mt-8 pt-6 " }, /* @__PURE__ */ import_react65.default.createElement("button", { onClick: handleBack, className: "flex items-center gap-2 px-6 py-2 text-[11px] tracking-widest text-neutral-500 hover:text-black hover:bg-neutral-50 rounded-full transition-colors outline-none" }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons21.Cancel01Icon, size: 14 }), " Close"), /* @__PURE__ */ import_react65.default.createElement(ThreeDActionButton, { onClick: handleNext, disabled: !isStep0Valid, className: "w-fit shrink-0" }, "Next Step"))), macroStep === 1 && /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex flex-col gap-8 animate-in fade-in" }, type === "company" ? /* @__PURE__ */ import_react65.default.createElement(import_react65.default.Fragment, null, /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex flex-col gap-2" }, /* @__PURE__ */ import_react65.default.createElement("h3", { className: "text-sm text-black" }, "Member Identity Documents"), /* @__PURE__ */ import_react65.default.createElement("p", { className: "text-xs text-neutral-500 leading-relaxed" }, "Upload valid means of identification, passport photographs, and signatures for every director and shareholder.")), !formState.membersDocsApproved ? /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex flex-col gap-6" }, formData.members.map((member, i) => /* @__PURE__ */ import_react65.default.createElement("div", { key: member.id, className: "flex flex-col gap-4" }, /* @__PURE__ */ import_react65.default.createElement("span", { className: "text-[11px] tracking-widest text-black mb-1" }, member.fullName || `Member ${i + 1}`, " ", /* @__PURE__ */ import_react65.default.createElement("span", { className: "text-neutral-400 ml-2" }, "(", member.role, ")")), /* @__PURE__ */ import_react65.default.createElement("input", { id: `id-upload-${i}`, type: "file", accept: "image/jpeg, image/png, image/webp, application/pdf", className: "hidden", onChange: (e) => handleCompanyMemberUpload(e, i, "id"), disabled: isReadOnly || isAnyUploading }), /* @__PURE__ */ import_react65.default.createElement("input", { id: `pass-upload-${i}`, type: "file", accept: "image/jpeg, image/png, image/webp, application/pdf", className: "hidden", onChange: (e) => handleCompanyMemberUpload(e, i, "passport"), disabled: isReadOnly || isAnyUploading }), /* @__PURE__ */ import_react65.default.createElement("input", { id: `sig-upload-${i}`, type: "file", accept: "image/jpeg, image/png, image/webp, application/pdf", className: "hidden", onChange: (e) => handleCompanyMemberUpload(e, i, "signature"), disabled: isReadOnly || isAnyUploading }), !member.idExtractedData && !globalExtractingId ? /* @__PURE__ */ import_react65.default.createElement("button", { onClick: () => !isReadOnly && !isAnyUploading && document.getElementById(`id-upload-${i}`)?.click(), className: `flex items-center gap-3 p-4 border border-neutral-200 rounded-full transition-colors text-sm w-full outline-none ${isAnyUploading ? "opacity-50 cursor-not-allowed bg-neutral-50 text-neutral-400" : "text-black hover:bg-neutral-50"}`, disabled: isReadOnly || isAnyUploading }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons21.Upload01Icon, size: 18, className: "text-neutral-400" }), " Upload Valid ID (NIN, License, Voter's Card)") : globalExtractingId && !member.idExtractedData ? /* @__PURE__ */ import_react65.default.createElement("div", { className: " mt-2" }, /* @__PURE__ */ import_react65.default.createElement(AiStageCheck, { tasks: aiTasks })) : member.idExtractedData ? /* @__PURE__ */ import_react65.default.createElement("div", { className: " mt-2 animate-in fade-in border border-purple-100 bg-linear-to-bl from-purple-50/80 via-white to-white p-5 rounded-xl flex flex-col gap-4 relative overflow-hidden" }, /* @__PURE__ */ import_react65.default.createElement("div", null, /* @__PURE__ */ import_react65.default.createElement("span", { className: "text-[10px] tracking-widest text-purple-600 block mb-2" }, "Review Extracted ID"), /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex flex-col gap-4" }, /* @__PURE__ */ import_react65.default.createElement(TextInput, { label: "Full Name on ID", value: member.idExtractedData.fullName, onChange: (v) => updateCompanyMemberInfo(i, "idExtractedData", { ...member.idExtractedData, fullName: v }), disabled: isReadOnly || isAnyUploading }), /* @__PURE__ */ import_react65.default.createElement("div", { className: "grid grid-cols-2 gap-4" }, /* @__PURE__ */ import_react65.default.createElement(TextInput, { label: "ID Number", value: member.idExtractedData.idNumber, onChange: (v) => updateCompanyMemberInfo(i, "idExtractedData", { ...member.idExtractedData, idNumber: v }), disabled: isReadOnly || isAnyUploading }), /* @__PURE__ */ import_react65.default.createElement(TextInput, { label: "Date of Birth", value: member.idExtractedData.dob, onChange: (v) => updateCompanyMemberInfo(i, "idExtractedData", { ...member.idExtractedData, dob: v }), disabled: isReadOnly || isAnyUploading })))), /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex items-center gap-2 mt-2" }, !isReadOnly && /* @__PURE__ */ import_react65.default.createElement("button", { onClick: () => deleteCompanyMemberDocument(i, "id"), disabled: isAnyUploading, className: "px-6 py-2 bg-white border border-neutral-200 text-neutral-500 text-[11px] rounded-full tracking-widest hover:bg-neutral-50 transition-colors outline-none disabled:opacity-50 disabled:cursor-not-allowed" }, "Delete & Re-upload ID"))) : null, !member.passportFileUrl && !globalUploadingPassport ? /* @__PURE__ */ import_react65.default.createElement("button", { onClick: () => !isReadOnly && !isAnyUploading && document.getElementById(`pass-upload-${i}`)?.click(), className: `flex items-center gap-3 p-4 border border-neutral-200 rounded-full transition-colors text-sm w-full outline-none ${isAnyUploading ? "opacity-50 cursor-not-allowed bg-neutral-50 text-neutral-400" : "text-black hover:bg-neutral-50"}`, disabled: isReadOnly || isAnyUploading }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons21.Upload01Icon, size: 18, className: "text-neutral-400" }), " Upload Passport Photo") : globalUploadingPassport && !member.passportFileUrl ? /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex items-center gap-3 p-4 border border-neutral-200 rounded-full bg-neutral-50 text-neutral-500 text-sm w-full" }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons21.Loading03Icon, size: 18, className: "animate-spin text-black" }), " Uploading Passport...") : member.passportFileUrl ? /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex items-center justify-between p-4 bg-emerald-50 rounded-full text-emerald-800 text-sm w-full" }, /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex items-center gap-3" }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons21.IdentificationIcon, size: 18 }), " Passport Uploaded"), !isReadOnly && /* @__PURE__ */ import_react65.default.createElement("button", { onClick: () => deleteCompanyMemberDocument(i, "passport"), disabled: isAnyUploading, className: "text-emerald-700 hover:text-red-500 transition-colors p-1 outline-none shrink-0 disabled:opacity-50 disabled:cursor-not-allowed" }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons21.Delete02Icon, size: 16 }))) : null, !member.signatureFileUrl && !globalUploadingSignature ? /* @__PURE__ */ import_react65.default.createElement("button", { onClick: () => !isReadOnly && !isAnyUploading && document.getElementById(`sig-upload-${i}`)?.click(), className: `flex items-center gap-3 p-4 border border-neutral-200 rounded-full transition-colors text-sm w-full outline-none ${isAnyUploading ? "opacity-50 cursor-not-allowed bg-neutral-50 text-neutral-400" : "text-black hover:bg-neutral-50"}`, disabled: isReadOnly || isAnyUploading }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons21.Upload01Icon, size: 18, className: "text-neutral-400" }), " Upload Signature") : globalUploadingSignature && !member.signatureFileUrl ? /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex items-center gap-3 p-4 border border-neutral-200 rounded-full bg-neutral-50 text-neutral-500 text-sm w-full" }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons21.Loading03Icon, size: 18, className: "animate-spin text-black" }), " Uploading Signature...") : member.signatureFileUrl ? /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex items-center justify-between p-4 bg-emerald-50 rounded-full text-emerald-800 text-sm w-full" }, /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex items-center gap-3" }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons21.SignatureIcon, size: 18 }), " Signature Uploaded"), !isReadOnly && /* @__PURE__ */ import_react65.default.createElement("button", { onClick: () => deleteCompanyMemberDocument(i, "signature"), disabled: isAnyUploading, className: "text-emerald-700 hover:text-red-500 transition-colors p-1 outline-none shrink-0 disabled:opacity-50 disabled:cursor-not-allowed" }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons21.Delete02Icon, size: 16 }))) : null)), /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex justify-end" }, /* @__PURE__ */ import_react65.default.createElement(ThreeDActionButton, { onClick: () => approveSection("membersDocsApproved"), disabled: !areCompanyMemberDocsValid() || isReadOnly || isAnyUploading, className: "w-fit" }, "Confirm All Documents"))) : /* @__PURE__ */ import_react65.default.createElement("div", { className: " flex items-center justify-between bg-emerald-50 p-6 rounded-2xl" }, /* @__PURE__ */ import_react65.default.createElement("div", null, /* @__PURE__ */ import_react65.default.createElement("p", { className: "text-sm text-emerald-800" }, "All Member Documents Verified"), /* @__PURE__ */ import_react65.default.createElement("p", { className: "text-xs text-emerald-600 mt-1" }, "Data safely extracted and ready for submission.")), !isReadOnly && /* @__PURE__ */ import_react65.default.createElement("button", { onClick: () => editSection("membersDocsApproved"), className: "p-2 text-emerald-700 hover:text-black transition-colors outline-none shrink-0" }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons21.PencilEdit01Icon, size: 16 })))) : /* @__PURE__ */ import_react65.default.createElement(import_react65.default.Fragment, null, /* @__PURE__ */ import_react65.default.createElement("input", { type: "file", accept: "image/jpeg, image/png, image/webp, application/pdf", ref: idRef, onChange: (e) => handleBusinessUpload(e, "id"), disabled: isReadOnly || isAnyUploading, className: "hidden" }), /* @__PURE__ */ import_react65.default.createElement("input", { type: "file", accept: "image/jpeg, image/png, image/webp, application/pdf", ref: passportRef, onChange: (e) => handleBusinessUpload(e, "passport"), disabled: isReadOnly || isAnyUploading, className: "hidden" }), /* @__PURE__ */ import_react65.default.createElement("input", { type: "file", accept: "image/jpeg, image/png, image/webp, application/pdf", ref: signatureRef, onChange: (e) => handleBusinessUpload(e, "signature"), disabled: isReadOnly || isAnyUploading, className: "hidden" }), /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex flex-col gap-4" }, /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex items-center gap-2 text-black" }, /* @__PURE__ */ import_react65.default.createElement("h3", { className: "text-sm " }, "Upload Means of Identification")), /* @__PURE__ */ import_react65.default.createElement("p", { className: "text-xs text-neutral-500 -mt-2" }, "Upload your NIN, Driver's License, Voter's Card, or Int'l Passport (JPG/PNG/WEBP)."), !formState.idApproved ? /* @__PURE__ */ import_react65.default.createElement(import_react65.default.Fragment, null, /* @__PURE__ */ import_react65.default.createElement("button", { onClick: () => !isReadOnly && !isAnyUploading && idRef.current?.click(), disabled: isReadOnly || isAnyUploading, className: `w-full h-32 border border-neutral-200 rounded-2xl flex flex-col items-center justify-center gap-2 transition-colors outline-none ${isAnyUploading ? "opacity-50 cursor-not-allowed bg-neutral-50 text-neutral-400" : "hover:bg-neutral-50 text-black"}` }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons21.Upload01Icon, size: 24, className: "text-neutral-400" }), /* @__PURE__ */ import_react65.default.createElement("span", { className: "text-xs" }, "Select ID Image to Upload")), globalExtractingId && /* @__PURE__ */ import_react65.default.createElement("div", { className: " mt-2" }, /* @__PURE__ */ import_react65.default.createElement(AiStageCheck, { tasks: aiTasks })), formData.idExtractedData && /* @__PURE__ */ import_react65.default.createElement("div", { className: " mt-2 animate-in fade-in border border-purple-100 bg-linear-to-bl from-purple-50/80 via-white to-white p-5 rounded-2xl flex flex-col gap-4 relative overflow-hidden" }, /* @__PURE__ */ import_react65.default.createElement("div", null, /* @__PURE__ */ import_react65.default.createElement("span", { className: "text-[10px] tracking-widest text-purple-600 block mb-2" }, "Review AI Extracted Data"), /* @__PURE__ */ import_react65.default.createElement("p", { className: "text-xs text-neutral-500 mb-4" }, "Please verify the extracted information and correct any OCR mistakes before approving."), /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex flex-col gap-4" }, /* @__PURE__ */ import_react65.default.createElement(TextInput, { label: "Full Name on ID", value: formData.idExtractedData.fullName, onChange: (v) => setFormData((f) => ({ ...f, idExtractedData: { ...f.idExtractedData, fullName: v } })), disabled: isReadOnly || isAnyUploading }), /* @__PURE__ */ import_react65.default.createElement("div", { className: "grid grid-cols-2 gap-4" }, /* @__PURE__ */ import_react65.default.createElement(TextInput, { label: "ID Number", value: formData.idExtractedData.idNumber, onChange: (v) => setFormData((f) => ({ ...f, idExtractedData: { ...f.idExtractedData, idNumber: v } })), disabled: isReadOnly || isAnyUploading }), /* @__PURE__ */ import_react65.default.createElement(TextInput, { label: "Date of Birth (YYYY-MM-DD)", value: formData.idExtractedData.dob, onChange: (v) => setFormData((f) => ({ ...f, idExtractedData: { ...f.idExtractedData, dob: v } })), disabled: isReadOnly || isAnyUploading })))), /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex items-center gap-2 mt-2" }, /* @__PURE__ */ import_react65.default.createElement(ThreeDActionButton, { onClick: () => approveSection("idApproved"), disabled: isAnyUploading || isReadOnly, className: "w-fit shrink-0" }, "Approve Data"), !isReadOnly && /* @__PURE__ */ import_react65.default.createElement("button", { onClick: () => deleteBusinessDocument("id"), disabled: isAnyUploading, className: "px-6 py-2 bg-white border border-neutral-200 text-neutral-500 text-[11px] rounded-full tracking-widest hover:bg-neutral-50 transition-colors outline-none disabled:opacity-50 disabled:cursor-not-allowed" }, "Delete & Re-upload")))) : /* @__PURE__ */ import_react65.default.createElement("div", { className: " flex items-center justify-between bg-emerald-50 p-6 rounded-2xl" }, /* @__PURE__ */ import_react65.default.createElement("div", null, /* @__PURE__ */ import_react65.default.createElement("p", { className: "text-sm text-emerald-800" }, "ID Document Verified"), /* @__PURE__ */ import_react65.default.createElement("p", { className: "text-xs text-emerald-600 mt-1" }, "Data safely extracted and stored.")), !isReadOnly && /* @__PURE__ */ import_react65.default.createElement("button", { onClick: () => editSection("idApproved"), className: "p-2 text-emerald-700 hover:text-black transition-colors outline-none shrink-0" }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons21.PencilEdit01Icon, size: 16 })))), /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex flex-col gap-4 pt-6 animate-in slide-in-from-top-4 duration-500" }, /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex flex-col gap-3 " }, !formState.passportApproved && !globalUploadingPassport ? /* @__PURE__ */ import_react65.default.createElement("button", { onClick: () => !isReadOnly && !isAnyUploading && passportRef.current?.click(), disabled: isReadOnly || isAnyUploading, className: `flex items-center gap-3 p-4 border border-neutral-200 rounded-full transition-colors text-sm w-full outline-none ${isAnyUploading ? "opacity-50 cursor-not-allowed bg-neutral-50 text-neutral-400" : "text-black hover:bg-neutral-50"}` }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons21.Upload01Icon, size: 18, className: "text-neutral-400" }), " Upload Passport Photo") : globalUploadingPassport && !formData.passportFileUrl ? /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex items-center gap-3 p-4 border border-neutral-200 rounded-full bg-neutral-50 text-neutral-500 text-sm w-full" }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons21.Loading03Icon, size: 18, className: "animate-spin text-black" }), " Uploading Passport...") : /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex items-center justify-between p-4 bg-emerald-50 rounded-full text-emerald-800 text-sm w-full" }, /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex items-center gap-3" }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons21.IdentificationIcon, size: 18 }), " Passport Uploaded"), !isReadOnly && /* @__PURE__ */ import_react65.default.createElement("button", { onClick: () => deleteBusinessDocument("passport"), disabled: isAnyUploading, className: "text-emerald-700 hover:text-red-500 transition-colors p-1 outline-none shrink-0 disabled:opacity-50 disabled:cursor-not-allowed" }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons21.Delete02Icon, size: 16 }))), !formState.signatureApproved && !globalUploadingSignature ? /* @__PURE__ */ import_react65.default.createElement("button", { onClick: () => !isReadOnly && !isAnyUploading && signatureRef.current?.click(), disabled: isReadOnly || isAnyUploading, className: `flex items-center gap-3 p-4 border border-neutral-200 rounded-full transition-colors text-sm w-full outline-none ${isAnyUploading ? "opacity-50 cursor-not-allowed bg-neutral-50 text-neutral-400" : "text-black hover:bg-neutral-50"}` }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons21.Upload01Icon, size: 18, className: "text-neutral-400" }), " Upload Signature") : globalUploadingSignature && !formData.signatureFileUrl ? /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex items-center gap-3 p-4 border border-neutral-200 rounded-full bg-neutral-50 text-neutral-500 text-sm w-full" }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons21.Loading03Icon, size: 18, className: "animate-spin text-black" }), " Uploading Signature...") : /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex items-center justify-between p-4 bg-emerald-50 rounded-full text-emerald-800 text-sm w-full" }, /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex items-center gap-3" }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons21.SignatureIcon, size: 18 }), " Signature Uploaded"), !isReadOnly && /* @__PURE__ */ import_react65.default.createElement("button", { onClick: () => deleteBusinessDocument("signature"), disabled: isAnyUploading, className: "text-emerald-700 hover:text-red-500 transition-colors p-1 outline-none shrink-0 disabled:opacity-50 disabled:cursor-not-allowed" }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons21.Delete02Icon, size: 16 })))))), /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex flex-col gap-4 pt-6 border-t border-neutral-100 animate-in slide-in-from-top-4 duration-500" }, /* @__PURE__ */ import_react65.default.createElement("input", { type: "file", accept: "image/jpeg, image/png, image/webp, application/pdf", ref: other1Ref, onChange: (e) => handleOptionalUpload(e, "other1"), disabled: isAnyUploading || isReadOnly, className: "hidden" }), /* @__PURE__ */ import_react65.default.createElement("input", { type: "file", accept: "image/jpeg, image/png, image/webp, application/pdf", ref: other2Ref, onChange: (e) => handleOptionalUpload(e, "other2"), disabled: isAnyUploading || isReadOnly, className: "hidden" }), /* @__PURE__ */ import_react65.default.createElement("input", { type: "file", accept: "image/jpeg, image/png, image/webp, application/pdf", ref: other3Ref, onChange: (e) => handleOptionalUpload(e, "other3"), disabled: isAnyUploading || isReadOnly, className: "hidden" }), /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex flex-col gap-1 mb-2" }, /* @__PURE__ */ import_react65.default.createElement("h3", { className: "text-sm text-black" }, "Additional Documents (Optional)"), /* @__PURE__ */ import_react65.default.createElement("p", { className: "text-xs text-neutral-500 leading-relaxed" }, "If your ", type === "company" ? "company" : "business", " involves regulated professional services, please upload relevant licenses, certificates, or permits here (up to 3 documents).")), /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex flex-col gap-3" }, [1, 2, 3].map((num) => {
|
|
3552
|
+
const docType = `other${num}`;
|
|
3553
|
+
const ref = num === 1 ? other1Ref : num === 2 ? other2Ref : other3Ref;
|
|
3554
|
+
const isUploading = num === 1 ? isUploadingOther1 : num === 2 ? isUploadingOther2 : isUploadingOther3;
|
|
3555
|
+
const fileUrl = formData[`otherDoc${num}Url`];
|
|
3556
|
+
if (!fileUrl && !isUploading) {
|
|
3557
|
+
const prevUrl = num > 1 ? formData[`otherDoc${num - 1}Url`] : true;
|
|
3558
|
+
if (!prevUrl) return null;
|
|
3559
|
+
return /* @__PURE__ */ import_react65.default.createElement("button", { key: num, onClick: () => !isReadOnly && !isAnyUploading && ref.current?.click(), disabled: isReadOnly || isAnyUploading, className: `flex items-center gap-3 p-4 border border-neutral-200 rounded-full transition-colors text-sm w-full outline-none ${isAnyUploading ? "opacity-50 cursor-not-allowed bg-neutral-50 text-neutral-400" : "text-black hover:bg-neutral-50"}` }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons21.Upload01Icon, size: 18, className: "text-neutral-400" }), " Upload Optional Document ", num);
|
|
3560
|
+
}
|
|
3561
|
+
if (isUploading) {
|
|
3562
|
+
return /* @__PURE__ */ import_react65.default.createElement("div", { key: num, className: "flex items-center gap-3 p-4 border border-neutral-200 rounded-full bg-neutral-50 text-neutral-500 text-sm w-full" }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons21.Loading03Icon, size: 18, className: "animate-spin text-black" }), " Uploading Document ", num, "...");
|
|
3563
|
+
}
|
|
3564
|
+
return /* @__PURE__ */ import_react65.default.createElement("div", { key: num, className: "flex items-center justify-between p-4 bg-emerald-50 rounded-full text-emerald-800 text-sm w-full" }, /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex items-center gap-3" }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons21.CheckmarkBadge01Icon, size: 18 }), " Optional Document ", num, " Uploaded"), !isReadOnly && /* @__PURE__ */ import_react65.default.createElement("button", { onClick: () => deleteOptionalDocument(docType), disabled: isAnyUploading, className: "text-emerald-700 hover:text-red-500 transition-colors p-1 outline-none shrink-0 disabled:opacity-50 disabled:cursor-not-allowed" }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons21.Delete02Icon, size: 16 })));
|
|
3565
|
+
}))), /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex items-center justify-between mt-8 pt-6 " }, /* @__PURE__ */ import_react65.default.createElement("button", { onClick: handleBack, disabled: isAnyUploading, className: "flex items-center gap-2 px-6 py-2 text-[11px] tracking-widest text-neutral-500 hover:text-black hover:bg-neutral-50 rounded-full transition-colors outline-none disabled:opacity-50 disabled:cursor-not-allowed" }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons21.ArrowLeft01Icon, size: 14 }), " Back"), /* @__PURE__ */ import_react65.default.createElement(ThreeDActionButton, { onClick: handleNext, disabled: !isStep1Valid || isAnyUploading, className: "w-fit shrink-0" }, "Review Application"))), macroStep === 2 && /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex flex-col gap-6 animate-in fade-in" }, /* @__PURE__ */ import_react65.default.createElement("div", null, /* @__PURE__ */ import_react65.default.createElement("h3", { className: "text-sm mb-5 text-black" }, "Application Summary"), /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex flex-col gap-4 text-sm" }, /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex flex-col sm:flex-row sm:justify-between border-b border-neutral-100 pb-3 gap-1" }, /* @__PURE__ */ import_react65.default.createElement("span", { className: "text-neutral-500 truncate text-[13px] " }, type === "company" ? "Company Name" : "Business Name"), /* @__PURE__ */ import_react65.default.createElement("span", { className: " text-black text-[13px]" }, formData.approvedName)), /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex flex-col sm:flex-row sm:justify-between border-b border-neutral-100 pb-3 gap-1" }, /* @__PURE__ */ import_react65.default.createElement("span", { className: "text-neutral-500 text-[13px] " }, "Classification"), /* @__PURE__ */ import_react65.default.createElement("span", { className: " text-black truncate sm:text-right text-[13px] " }, formData.natureOfBusiness?.specificLabel || "Pending")), type === "company" ? /* @__PURE__ */ import_react65.default.createElement(import_react65.default.Fragment, null, /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex flex-col sm:flex-row sm:justify-between border-b border-neutral-100 pb-3 gap-1" }, /* @__PURE__ */ import_react65.default.createElement("span", { className: "text-neutral-500 text-[13px] " }, "Total Members"), /* @__PURE__ */ import_react65.default.createElement("span", { className: " text-black truncate text-[13px] " }, formData.members.length, " Directors/Shareholders")), /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex flex-col sm:flex-row sm:justify-between border-b border-neutral-100 pb-3 gap-1" }, /* @__PURE__ */ import_react65.default.createElement("span", { className: "text-neutral-500 text-[13px] " }, "Share Capital"), /* @__PURE__ */ import_react65.default.createElement("span", { className: " text-black truncate text-[13px] " }, "100% Allocated"))) : /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex flex-col sm:flex-row sm:justify-between border-b border-neutral-100 pb-3 gap-1" }, /* @__PURE__ */ import_react65.default.createElement("span", { className: "text-neutral-500 text-[13px] " }, "Proprietor"), /* @__PURE__ */ import_react65.default.createElement("span", { className: " text-black truncate text-[13px] " }, formData.ownerName)), /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex flex-col sm:flex-row sm:justify-between pb-2 gap-1" }, /* @__PURE__ */ import_react65.default.createElement("span", { className: "text-neutral-500 text-[13px] " }, "Documents Attached"), /* @__PURE__ */ import_react65.default.createElement("span", { className: " text-neutral-400 text-[13px] " }, "ID, Passport, Signature")), formData.otherDoc1Url && /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex flex-col sm:flex-row sm:justify-between pb-2 gap-1" }, /* @__PURE__ */ import_react65.default.createElement("span", { className: "text-neutral-500 text-[13px] " }, "Optional Documents"), /* @__PURE__ */ import_react65.default.createElement("span", { className: " text-neutral-400 text-[13px] " }, [formData.otherDoc1Url, formData.otherDoc2Url, formData.otherDoc3Url].filter(Boolean).length, " Attached")))), /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex items-center justify-between mt-4 pt-4 " }, /* @__PURE__ */ import_react65.default.createElement("button", { onClick: handleBack, className: "flex items-center gap-2 px-6 py-2 rounded-full text-[11px] tracking-widest text-neutral-500 hover:text-black hover:bg-neutral-50 transition-colors outline-none" }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons21.ArrowLeft01Icon, size: 14 }), " Back"), /* @__PURE__ */ import_react65.default.createElement(ThreeDActionButton, { onClick: handleNext, className: "w-fit shrink-0" }, "Confirm & Proceed"))), macroStep === 3 && /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex flex-col gap-6 py-6 animate-in zoom-in-95 duration-500" }, /* @__PURE__ */ import_react65.default.createElement("h2", { className: "text-lg font-serif text-black tracking-tight mb-2" }, "Terms and Conditions of Application"), /* @__PURE__ */ import_react65.default.createElement("div", { className: "text-xs text-neutral-500 mb-4" }, /* @__PURE__ */ import_react65.default.createElement("p", { className: " mb-3" }, "Declaration and Consent"), /* @__PURE__ */ import_react65.default.createElement("p", { className: "mb-3 leading-relaxed" }, "By proceeding with this application, you acknowledge and agree that all data, documents, and identification materials provided herein will be securely transmitted to the relevant official registries and authorized agents for the purpose of ", type === "company" ? "company" : "business", " incorporation and compliance verification."), /* @__PURE__ */ import_react65.default.createElement("p", { className: "mb-3 leading-relaxed" }, "You confirm that all information provided is accurate and authentic. Any falsification of identity or corporate data may result in immediate rejection, and you may be held liable under applicable laws and regulations."), /* @__PURE__ */ import_react65.default.createElement("p", { className: "mb-3 leading-relaxed" }, "This service operates strictly as a digital intermediary connecting you with official registries. The final approval of the ", type === "company" ? "company" : "business", " name and registration rests solely with the regulatory authorities. We are not liable for rejections arising from pre existing conflicts, non compliance, or regulatory policy changes not flagged during the AI pre check stages."), /* @__PURE__ */ import_react65.default.createElement("p", { className: "leading-relaxed" }, "Proceeding to generate the invoice confirms your acceptance of these terms and initiates the formal filing process.")), /* @__PURE__ */ import_react65.default.createElement("label", { className: "flex items-start gap-3 mt-2 cursor-pointer group" }, /* @__PURE__ */ import_react65.default.createElement("input", { type: "checkbox", checked: iAgree, onChange: (e) => setIAgree(e.target.checked), disabled: isReadOnly, className: "mt-0.5 w-4 h-4 accent-black rounded cursor-pointer" }), /* @__PURE__ */ import_react65.default.createElement("span", { className: "text-[13px] text-red-500 group-hover:text-red-600 transition-colors" }, "I have read, understood, and agree to the terms of data transfer and processing.")), /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex flex-col sm:flex-row items-center gap-4 mt-8 w-full justify-end pt-6" }, /* @__PURE__ */ import_react65.default.createElement("button", { onClick: onCancelOrClose, disabled: isSubmitting, className: "px-8 py-2 text-[11px] tracking-widest text-neutral-500 hover:text-black hover:bg-neutral-50 rounded-full transition-colors outline-none w-full sm:w-auto" }, "Cancel"), /* @__PURE__ */ import_react65.default.createElement("button", { onClick: () => setMacroStep(0), disabled: isSubmitting || isReadOnly, className: "px-8 py-2 text-[11px] tracking-widest text-neutral-500 hover:text-black hover:bg-neutral-50 rounded-full transition-colors outline-none w-full sm:w-auto" }, "Edit Application"), /* @__PURE__ */ import_react65.default.createElement(ThreeDActionButton, { onClick: handleFinalSubmit, disabled: isSubmitting || !iAgree || isReadOnly, isLoading: isSubmitting, className: "min-w-40 w-full sm:w-auto" }, "Submit")))), activeModal.isOpen && /* @__PURE__ */ import_react65.default.createElement("div", { className: "fixed inset-0 z-110 flex items-center justify-center p-4" }, /* @__PURE__ */ import_react65.default.createElement("div", { className: "absolute inset-0 bg-black/30", onClick: () => setActiveModal({ isOpen: false, type: null, memberIndex: null }) }), /* @__PURE__ */ import_react65.default.createElement("div", { className: "relative w-80 bg-white shadow-2xl rounded-3xl flex flex-col overflow-hidden animate-in zoom-in-95 duration-200 max-h-[80vh]" }, /* @__PURE__ */ import_react65.default.createElement("div", { className: "p-4 text-center w-full shrink-0" }, /* @__PURE__ */ import_react65.default.createElement("h3", { className: "text-[14px] text-black tracking-tight capitalize" }, "Select ", activeModal.type)), /* @__PURE__ */ import_react65.default.createElement("div", { className: "p-4 flex flex-col gap-2 overflow-y-auto custom-scrollbar" }, (activeModal.type === "state" ? NIGERIAN_STATES : activeModal.type === "role" ? MEMBER_ROLES : NATIONALITIES).map((opt) => {
|
|
3566
|
+
const isSelected = activeModal.isGlobalState ? formData.state === opt : formData.members[activeModal.memberIndex][activeModal.type] === opt;
|
|
3567
|
+
return /* @__PURE__ */ import_react65.default.createElement("button", { key: opt, onClick: () => {
|
|
3568
|
+
if (activeModal.isGlobalState) setFormData({ ...formData, state: opt });
|
|
3569
|
+
else updateCompanyMemberInfo(activeModal.memberIndex, activeModal.type, opt);
|
|
3570
|
+
setActiveModal({ isOpen: false, type: null, memberIndex: null });
|
|
3571
|
+
}, className: `text-left px-4 py-3 rounded-full text-[13px] transition-colors outline-none ${isSelected ? "bg-neutral-100 text-black" : "text-neutral-500 hover:bg-neutral-50 hover:text-black"}` }, opt);
|
|
3572
|
+
})), /* @__PURE__ */ import_react65.default.createElement("div", { className: "w-full flex mt-auto shrink-0 " }, /* @__PURE__ */ import_react65.default.createElement("button", { onClick: () => setActiveModal({ isOpen: false, type: null, memberIndex: null }), className: "w-full py-4 text-[13px] text-neutral-500 hover:bg-neutral-50 transition-colors outline-none" }, "Close")))));
|
|
3573
|
+
};
|
|
2961
3574
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2962
3575
|
0 && (module.exports = {
|
|
2963
3576
|
AITranscriptionFeature,
|
|
@@ -2999,6 +3612,7 @@ var Stagger = ({ steps, currentStep }) => {
|
|
|
2999
3612
|
UniversalOrganizationPage,
|
|
3000
3613
|
UniversalOverviewPage,
|
|
3001
3614
|
UniversalProfileSettings,
|
|
3615
|
+
UniversalRegistrationFlow,
|
|
3002
3616
|
UniversalSidebar,
|
|
3003
3617
|
ZairusAuth
|
|
3004
3618
|
});
|