@splpi/estore-shared-components 7.0.2 → 7.0.4
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 +138 -3
- package/dist/index.d.ts +138 -3
- package/dist/index.js +1455 -375
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1444 -350
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
package/dist/index.mjs
CHANGED
|
@@ -256,6 +256,20 @@ var markOcrApplied = (section) => {
|
|
|
256
256
|
}
|
|
257
257
|
return true;
|
|
258
258
|
};
|
|
259
|
+
var saveOcrResult = (value) => {
|
|
260
|
+
if (typeof window === "undefined") return;
|
|
261
|
+
try {
|
|
262
|
+
localStorage.setItem(OCR_STORAGE_KEY, JSON.stringify(value));
|
|
263
|
+
} catch {
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
var clearOcrResult = () => {
|
|
267
|
+
if (typeof window === "undefined") return;
|
|
268
|
+
try {
|
|
269
|
+
localStorage.removeItem(OCR_STORAGE_KEY);
|
|
270
|
+
} catch {
|
|
271
|
+
}
|
|
272
|
+
};
|
|
259
273
|
|
|
260
274
|
// src/NewSaleForm/LifePlanApplication1.tsx
|
|
261
275
|
import { useEffect, useState as useState2 } from "react";
|
|
@@ -2140,6 +2154,7 @@ var InfoCard = ({
|
|
|
2140
2154
|
}
|
|
2141
2155
|
);
|
|
2142
2156
|
};
|
|
2157
|
+
var info_card_default = InfoCard;
|
|
2143
2158
|
|
|
2144
2159
|
// src/NewSaleForm/ui/input-card-accordion.tsx
|
|
2145
2160
|
import { Box as Box8, Flex as Flex3, Text as Text5 } from "@chakra-ui/react";
|
|
@@ -3488,8 +3503,131 @@ var HorizontalStepper = ({
|
|
|
3488
3503
|
};
|
|
3489
3504
|
var horizontal_stepper_default = HorizontalStepper;
|
|
3490
3505
|
|
|
3506
|
+
// src/services/MainAPIClient.ts
|
|
3507
|
+
import axios from "axios";
|
|
3508
|
+
var APIError = class extends Error {
|
|
3509
|
+
status;
|
|
3510
|
+
constructor(message, status) {
|
|
3511
|
+
super(message);
|
|
3512
|
+
this.name = "APIError";
|
|
3513
|
+
this.status = status;
|
|
3514
|
+
}
|
|
3515
|
+
};
|
|
3516
|
+
var readEnvBaseUrl = () => {
|
|
3517
|
+
try {
|
|
3518
|
+
return process.env.NEXT_PUBLIC_API_URL;
|
|
3519
|
+
} catch {
|
|
3520
|
+
return void 0;
|
|
3521
|
+
}
|
|
3522
|
+
};
|
|
3523
|
+
var apiClient = axios.create({
|
|
3524
|
+
baseURL: readEnvBaseUrl() ?? "",
|
|
3525
|
+
timeout: 15e3,
|
|
3526
|
+
headers: {
|
|
3527
|
+
"Content-Type": "application/json"
|
|
3528
|
+
}
|
|
3529
|
+
});
|
|
3530
|
+
var configureApi = (options) => {
|
|
3531
|
+
apiClient.defaults.baseURL = options.baseUrl;
|
|
3532
|
+
};
|
|
3533
|
+
apiClient.interceptors.request.use((config) => {
|
|
3534
|
+
if (!config.baseURL) {
|
|
3535
|
+
throw new APIError(
|
|
3536
|
+
"API URL is not set. Add NEXT_PUBLIC_API_URL to .env.local or call configureApi({ baseUrl })."
|
|
3537
|
+
);
|
|
3538
|
+
}
|
|
3539
|
+
return config;
|
|
3540
|
+
});
|
|
3541
|
+
apiClient.interceptors.response.use(
|
|
3542
|
+
(response) => response,
|
|
3543
|
+
(error) => {
|
|
3544
|
+
if (error instanceof APIError) return Promise.reject(error);
|
|
3545
|
+
const status = error.response?.status;
|
|
3546
|
+
const message = error.response?.data?.message || error.message || "Something went wrong";
|
|
3547
|
+
console.error(`[API] ${error.config?.method?.toUpperCase()} ${error.config?.url} failed (${status ?? "no response"}):`, message);
|
|
3548
|
+
return Promise.reject(new APIError(message, status));
|
|
3549
|
+
}
|
|
3550
|
+
);
|
|
3551
|
+
var api = {
|
|
3552
|
+
get: (url, params, config) => apiClient.get(url, { ...config, params }).then((res) => res.data),
|
|
3553
|
+
post: (url, payload, config) => apiClient.post(url, payload, config).then((res) => res.data),
|
|
3554
|
+
put: (url, payload, config) => apiClient.put(url, payload, config).then((res) => res.data),
|
|
3555
|
+
delete: (url, config) => apiClient.delete(url, config).then((res) => res.data)
|
|
3556
|
+
};
|
|
3557
|
+
|
|
3558
|
+
// src/services/GeoApifyService.ts
|
|
3559
|
+
var ENDPOINTS = {
|
|
3560
|
+
parse: "/Address/Parse"
|
|
3561
|
+
};
|
|
3562
|
+
var GeoApifyService = {
|
|
3563
|
+
async parseAddress(text) {
|
|
3564
|
+
return api.get(ENDPOINTS.parse, {
|
|
3565
|
+
text: text.replace(/\s+/g, " ").trim()
|
|
3566
|
+
});
|
|
3567
|
+
}
|
|
3568
|
+
};
|
|
3569
|
+
|
|
3570
|
+
// src/services/PayMongoService.ts
|
|
3571
|
+
var ENDPOINTS2 = {
|
|
3572
|
+
checkout: "/PayMongoAPI/CreateCheckout",
|
|
3573
|
+
newSalesCheckout: "/PayMongoAPI/CreateNewSalesCheckout"
|
|
3574
|
+
};
|
|
3575
|
+
var toWholeNumber = (value) => {
|
|
3576
|
+
const n = Number(value);
|
|
3577
|
+
return value !== void 0 && value !== "" && Number.isFinite(n) ? Math.trunc(n) : void 0;
|
|
3578
|
+
};
|
|
3579
|
+
var toApiItem = (item) => ({
|
|
3580
|
+
planDesc: item.planDesc,
|
|
3581
|
+
ipInstAmt: Number(item.ipInstAmt),
|
|
3582
|
+
quantity: toWholeNumber(item.quantity) ?? 1,
|
|
3583
|
+
planTerm: toWholeNumber(item.planTerm),
|
|
3584
|
+
productCode: item.productCode,
|
|
3585
|
+
contractPrice: item.contractPrice
|
|
3586
|
+
});
|
|
3587
|
+
var PayMongoService = {
|
|
3588
|
+
async createCheckout(items) {
|
|
3589
|
+
const body = { items: items.map(toApiItem) };
|
|
3590
|
+
console.log("PayMongoService: body =", body);
|
|
3591
|
+
console.log("PayMongoService: ENDPOINTS.checkout =", ENDPOINTS2.checkout);
|
|
3592
|
+
const res = await api.post(ENDPOINTS2.checkout, body);
|
|
3593
|
+
return { checkoutUrl: res?.checkoutUrl };
|
|
3594
|
+
},
|
|
3595
|
+
async createNewSalesCheckout(request) {
|
|
3596
|
+
const body = {
|
|
3597
|
+
items: request.items.map((item) => ({
|
|
3598
|
+
planDesc: item.planDesc,
|
|
3599
|
+
mode: item.mode,
|
|
3600
|
+
ipInstAmt: Number(item.ipInstAmt),
|
|
3601
|
+
quantity: toWholeNumber(item.quantity) ?? 1,
|
|
3602
|
+
planTerm: toWholeNumber(item.planTerm)
|
|
3603
|
+
})),
|
|
3604
|
+
application: request.application,
|
|
3605
|
+
accountNo: request.accountNo ?? "",
|
|
3606
|
+
empCode: request.empCode ?? ""
|
|
3607
|
+
};
|
|
3608
|
+
const res = await api.post(
|
|
3609
|
+
ENDPOINTS2.newSalesCheckout,
|
|
3610
|
+
body,
|
|
3611
|
+
{ timeout: 6e4 }
|
|
3612
|
+
);
|
|
3613
|
+
return { checkoutUrl: res?.checkoutUrl, requestId: res?.requestId };
|
|
3614
|
+
}
|
|
3615
|
+
};
|
|
3616
|
+
|
|
3491
3617
|
// src/NewSaleForm/SharedLifePlanApplication.tsx
|
|
3492
3618
|
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
3619
|
+
var TEST_ACCOUNT_NO = "SPLPI-22-000021";
|
|
3620
|
+
var defaultCheckout = async ({
|
|
3621
|
+
items,
|
|
3622
|
+
application
|
|
3623
|
+
}) => {
|
|
3624
|
+
const { checkoutUrl } = await PayMongoService.createNewSalesCheckout({
|
|
3625
|
+
items,
|
|
3626
|
+
application,
|
|
3627
|
+
accountNo: TEST_ACCOUNT_NO
|
|
3628
|
+
});
|
|
3629
|
+
return checkoutUrl;
|
|
3630
|
+
};
|
|
3493
3631
|
var safeParse = (value) => {
|
|
3494
3632
|
if (!value) return null;
|
|
3495
3633
|
try {
|
|
@@ -3502,8 +3640,8 @@ var SharedLifePlanApplication = ({
|
|
|
3502
3640
|
title = "Life Plan Application",
|
|
3503
3641
|
description = "Please fill out the form below to apply for a life plan.",
|
|
3504
3642
|
onPaymentError,
|
|
3505
|
-
onCheckout,
|
|
3506
|
-
parseAddress
|
|
3643
|
+
onCheckout = defaultCheckout,
|
|
3644
|
+
parseAddress = GeoApifyService.parseAddress
|
|
3507
3645
|
}) => {
|
|
3508
3646
|
const [currentStep, setCurrentStep] = useState11(0);
|
|
3509
3647
|
const [loading, setLoading] = useState11(false);
|
|
@@ -3516,7 +3654,7 @@ var SharedLifePlanApplication = ({
|
|
|
3516
3654
|
...applicationSection ? { applicationSection } : {},
|
|
3517
3655
|
applicationSectionKey,
|
|
3518
3656
|
onApplicationValidChange: setApplicationValid,
|
|
3519
|
-
|
|
3657
|
+
parseAddress,
|
|
3520
3658
|
onEdit: (section) => {
|
|
3521
3659
|
setApplicationSection(section ?? "personal");
|
|
3522
3660
|
setApplicationSectionKey((key) => key + 1);
|
|
@@ -3528,9 +3666,6 @@ var SharedLifePlanApplication = ({
|
|
|
3528
3666
|
if (!allAgreementsAccepted) return;
|
|
3529
3667
|
setLoading(true);
|
|
3530
3668
|
try {
|
|
3531
|
-
if (!onCheckout) {
|
|
3532
|
-
throw new Error("onCheckout prop is not provided");
|
|
3533
|
-
}
|
|
3534
3669
|
const checkoutRaw = sessionStorage.getItem("CheckoutCart");
|
|
3535
3670
|
const cartRaw = sessionStorage.getItem("Cart");
|
|
3536
3671
|
const parsed = safeParse(checkoutRaw) ?? safeParse(cartRaw);
|
|
@@ -3581,22 +3716,969 @@ var LifePlanApplicationStepWrapper = (props) => {
|
|
|
3581
3716
|
};
|
|
3582
3717
|
var LifePlanApplicationStepWrapper_default = LifePlanApplicationStepWrapper;
|
|
3583
3718
|
|
|
3719
|
+
// src/hooks/useOcr.ts
|
|
3720
|
+
import { useCallback as useCallback2, useState as useState12 } from "react";
|
|
3721
|
+
function useOcr(scanIdFn) {
|
|
3722
|
+
const [data, setData] = useState12(null);
|
|
3723
|
+
const [loading, setLoading] = useState12(false);
|
|
3724
|
+
const [error, setError] = useState12(null);
|
|
3725
|
+
const scanId = useCallback2(
|
|
3726
|
+
async (file) => {
|
|
3727
|
+
setLoading(true);
|
|
3728
|
+
setError(null);
|
|
3729
|
+
try {
|
|
3730
|
+
clearOcrResult();
|
|
3731
|
+
const result = await scanIdFn(file);
|
|
3732
|
+
saveOcrResult(result);
|
|
3733
|
+
setData(result);
|
|
3734
|
+
return result;
|
|
3735
|
+
} catch (err) {
|
|
3736
|
+
setError(err instanceof Error ? err.message : "OCR failed");
|
|
3737
|
+
throw err;
|
|
3738
|
+
} finally {
|
|
3739
|
+
setLoading(false);
|
|
3740
|
+
}
|
|
3741
|
+
},
|
|
3742
|
+
[scanIdFn]
|
|
3743
|
+
);
|
|
3744
|
+
return { data, loading, error, scanId };
|
|
3745
|
+
}
|
|
3746
|
+
|
|
3747
|
+
// src/GetStarted/GetStarted.tsx
|
|
3748
|
+
import {
|
|
3749
|
+
BaseText,
|
|
3750
|
+
Body as Body5,
|
|
3751
|
+
CancelButton as CancelButton2,
|
|
3752
|
+
H3 as H32,
|
|
3753
|
+
NextButton,
|
|
3754
|
+
PrimaryMdButton as PrimaryMdButton3
|
|
3755
|
+
} from "st-peter-ui";
|
|
3756
|
+
import {
|
|
3757
|
+
Box as Box17,
|
|
3758
|
+
VStack as VStack7,
|
|
3759
|
+
Dialog as Dialog3,
|
|
3760
|
+
Button as Button3,
|
|
3761
|
+
Portal as Portal4,
|
|
3762
|
+
CloseButton as CloseButton3,
|
|
3763
|
+
Input as Input4
|
|
3764
|
+
} from "@chakra-ui/react";
|
|
3765
|
+
import { useState as useState14 } from "react";
|
|
3766
|
+
import { LuIdCard, LuSignature } from "react-icons/lu";
|
|
3767
|
+
|
|
3768
|
+
// src/GetStarted/Container.tsx
|
|
3769
|
+
import "react";
|
|
3770
|
+
import { Box as Box15 } from "@chakra-ui/react";
|
|
3771
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
3772
|
+
var Container = ({ children }) => {
|
|
3773
|
+
return /* @__PURE__ */ jsx18(
|
|
3774
|
+
Box15,
|
|
3775
|
+
{
|
|
3776
|
+
px: { base: 8, md: 8 },
|
|
3777
|
+
mt: { base: 16, md: 32 },
|
|
3778
|
+
mb: { base: 32, md: 16 },
|
|
3779
|
+
maxW: "7xl",
|
|
3780
|
+
mx: "auto",
|
|
3781
|
+
children
|
|
3782
|
+
}
|
|
3783
|
+
);
|
|
3784
|
+
};
|
|
3785
|
+
var Container_default = Container;
|
|
3786
|
+
|
|
3787
|
+
// src/GetStarted/DocumentUploadCard.tsx
|
|
3788
|
+
import { useEffect as useEffect7, useRef as useRef2, useState as useState13 } from "react";
|
|
3789
|
+
import { Box as Box16, Flex as Flex8, Spinner, Text as Text9, useBreakpointValue as useBreakpointValue2 } from "@chakra-ui/react";
|
|
3790
|
+
import {
|
|
3791
|
+
LuUpload,
|
|
3792
|
+
LuCamera,
|
|
3793
|
+
LuFolderOpen,
|
|
3794
|
+
LuFileText,
|
|
3795
|
+
LuCheck as LuCheck3,
|
|
3796
|
+
LuTriangleAlert,
|
|
3797
|
+
LuRefreshCw,
|
|
3798
|
+
LuTrash2,
|
|
3799
|
+
LuReplace,
|
|
3800
|
+
LuSparkles
|
|
3801
|
+
} from "react-icons/lu";
|
|
3802
|
+
import { Fragment as Fragment3, jsx as jsx19, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3803
|
+
var PRIMARY2 = "var(--chakra-colors-primary)";
|
|
3804
|
+
var PRIMARY_SOFT = "var(--chakra-colors-primary-disabled)";
|
|
3805
|
+
var defaultNotifyError = (message) => {
|
|
3806
|
+
console.error(message);
|
|
3807
|
+
};
|
|
3808
|
+
var formatBytes = (bytes) => {
|
|
3809
|
+
if (!bytes) return "";
|
|
3810
|
+
if (bytes < 1024) return `${bytes} B`;
|
|
3811
|
+
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(0)} KB`;
|
|
3812
|
+
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
3813
|
+
};
|
|
3814
|
+
var validate = (file, config) => {
|
|
3815
|
+
const accepted = config.accept.split(",").map((s) => s.trim());
|
|
3816
|
+
const okType = accepted.includes(file.type) || accepted.some(
|
|
3817
|
+
(a) => a.endsWith("/*") && file.type.startsWith(a.slice(0, -1))
|
|
3818
|
+
) || accepted.some(
|
|
3819
|
+
(a) => a.startsWith(".") && file.name.toLowerCase().endsWith(a)
|
|
3820
|
+
);
|
|
3821
|
+
if (!okType) return "Unsupported file type. Please upload a JPG, PNG or PDF.";
|
|
3822
|
+
if (file.size > config.maxSizeMB * 1024 * 1024)
|
|
3823
|
+
return `File is too large. Maximum size is ${config.maxSizeMB}MB.`;
|
|
3824
|
+
return null;
|
|
3825
|
+
};
|
|
3826
|
+
var useDocumentSlot = (config, onProcess, notifyError = defaultNotifyError) => {
|
|
3827
|
+
const [slot, setSlot] = useState13({ status: "idle" });
|
|
3828
|
+
const timers = useRef2([]);
|
|
3829
|
+
const runId = useRef2(0);
|
|
3830
|
+
const clearTimers = () => {
|
|
3831
|
+
timers.current.forEach(clearTimeout);
|
|
3832
|
+
timers.current = [];
|
|
3833
|
+
};
|
|
3834
|
+
const processFile = (file, currentRun, isSignature) => {
|
|
3835
|
+
if (!onProcess) return false;
|
|
3836
|
+
onProcess(file).then((result) => {
|
|
3837
|
+
if (runId.current !== currentRun) return;
|
|
3838
|
+
setSlot((prev) => ({
|
|
3839
|
+
...prev,
|
|
3840
|
+
status: "completed",
|
|
3841
|
+
cleanedImageUrl: isSignature ? prev.previewUrl : void 0,
|
|
3842
|
+
extraction: !isSignature && result && typeof result === "object" ? result : void 0
|
|
3843
|
+
}));
|
|
3844
|
+
}).catch((err) => {
|
|
3845
|
+
if (runId.current !== currentRun) return;
|
|
3846
|
+
const message = err instanceof Error && err.message ? err.message : "We couldn't process this document. Please try again.";
|
|
3847
|
+
setSlot((prev) => ({ ...prev, status: "failed", error: message }));
|
|
3848
|
+
notifyError(message);
|
|
3849
|
+
});
|
|
3850
|
+
return true;
|
|
3851
|
+
};
|
|
3852
|
+
const runLifecycle = (file) => {
|
|
3853
|
+
clearTimers();
|
|
3854
|
+
const currentRun = ++runId.current;
|
|
3855
|
+
const previewUrl = URL.createObjectURL(file);
|
|
3856
|
+
const isSignature = config.processor === "signature";
|
|
3857
|
+
setSlot({
|
|
3858
|
+
status: "uploading",
|
|
3859
|
+
file,
|
|
3860
|
+
fileName: file.name,
|
|
3861
|
+
fileType: file.type,
|
|
3862
|
+
fileSize: file.size,
|
|
3863
|
+
previewUrl,
|
|
3864
|
+
progress: 0
|
|
3865
|
+
});
|
|
3866
|
+
let progress = 0;
|
|
3867
|
+
const tick = () => {
|
|
3868
|
+
progress = Math.min(100, progress + 20);
|
|
3869
|
+
setSlot((prev) => ({ ...prev, progress }));
|
|
3870
|
+
if (progress < 100) {
|
|
3871
|
+
timers.current.push(setTimeout(tick, 180));
|
|
3872
|
+
} else {
|
|
3873
|
+
timers.current.push(
|
|
3874
|
+
setTimeout(() => {
|
|
3875
|
+
setSlot((prev) => ({ ...prev, status: "processing" }));
|
|
3876
|
+
if (processFile(file, currentRun, isSignature)) return;
|
|
3877
|
+
timers.current.push(
|
|
3878
|
+
setTimeout(() => {
|
|
3879
|
+
setSlot((prev) => ({
|
|
3880
|
+
...prev,
|
|
3881
|
+
status: "completed",
|
|
3882
|
+
cleanedImageUrl: isSignature ? prev.previewUrl : void 0,
|
|
3883
|
+
extraction: isSignature ? void 0 : { name: "Sample", date: "2026-07-16", id: "0001" }
|
|
3884
|
+
}));
|
|
3885
|
+
}, 1600)
|
|
3886
|
+
);
|
|
3887
|
+
}, 200)
|
|
3888
|
+
);
|
|
3889
|
+
}
|
|
3890
|
+
};
|
|
3891
|
+
timers.current.push(setTimeout(tick, 180));
|
|
3892
|
+
};
|
|
3893
|
+
const uploadDocument = (file) => runLifecycle(file);
|
|
3894
|
+
const retryDocument = () => {
|
|
3895
|
+
if (slot.file) runLifecycle(slot.file);
|
|
3896
|
+
};
|
|
3897
|
+
const removeDocument = () => {
|
|
3898
|
+
clearTimers();
|
|
3899
|
+
runId.current++;
|
|
3900
|
+
if (slot.previewUrl) URL.revokeObjectURL(slot.previewUrl);
|
|
3901
|
+
setSlot({ status: "idle" });
|
|
3902
|
+
};
|
|
3903
|
+
return { slot, uploadDocument, retryDocument, removeDocument };
|
|
3904
|
+
};
|
|
3905
|
+
var Card = ({
|
|
3906
|
+
activeIcon,
|
|
3907
|
+
title,
|
|
3908
|
+
subtitle,
|
|
3909
|
+
headerAction,
|
|
3910
|
+
children
|
|
3911
|
+
}) => /* @__PURE__ */ jsxs15(
|
|
3912
|
+
Box16,
|
|
3913
|
+
{
|
|
3914
|
+
w: "full",
|
|
3915
|
+
borderRadius: "2xl",
|
|
3916
|
+
bg: "white",
|
|
3917
|
+
borderWidth: "1px",
|
|
3918
|
+
borderColor: "gray.200",
|
|
3919
|
+
shadow: "sm",
|
|
3920
|
+
overflow: "hidden",
|
|
3921
|
+
children: [
|
|
3922
|
+
/* @__PURE__ */ jsxs15(Flex8, { align: "center", justify: "space-between", px: 4, py: 3, gap: 2, children: [
|
|
3923
|
+
/* @__PURE__ */ jsxs15(Flex8, { align: "center", gap: 2, minW: 0, children: [
|
|
3924
|
+
/* @__PURE__ */ jsx19(
|
|
3925
|
+
Box16,
|
|
3926
|
+
{
|
|
3927
|
+
p: 2,
|
|
3928
|
+
borderRadius: "full",
|
|
3929
|
+
bg: "gray.100",
|
|
3930
|
+
color: PRIMARY2,
|
|
3931
|
+
flexShrink: 0,
|
|
3932
|
+
children: activeIcon
|
|
3933
|
+
}
|
|
3934
|
+
),
|
|
3935
|
+
/* @__PURE__ */ jsxs15(Box16, { minW: 0, children: [
|
|
3936
|
+
/* @__PURE__ */ jsx19(Text9, { fontWeight: "bold", fontSize: "md", lineHeight: "1.2", truncate: true, children: title }),
|
|
3937
|
+
subtitle && /* @__PURE__ */ jsx19(Text9, { fontSize: "xs", color: "gray.500", truncate: true, children: subtitle })
|
|
3938
|
+
] })
|
|
3939
|
+
] }),
|
|
3940
|
+
headerAction
|
|
3941
|
+
] }),
|
|
3942
|
+
/* @__PURE__ */ jsx19(Box16, { px: 4, pb: 4, pt: 1, borderTopWidth: "1px", borderColor: "gray.100", children })
|
|
3943
|
+
]
|
|
3944
|
+
}
|
|
3945
|
+
);
|
|
3946
|
+
var StatusPill = ({ status }) => {
|
|
3947
|
+
const map = {
|
|
3948
|
+
idle: null,
|
|
3949
|
+
uploading: { label: "Uploading", fg: "#1D4ED8", bg: "#EFF6FF" },
|
|
3950
|
+
processing: { label: "Analyzing", fg: "#7C3AED", bg: "#F5F3FF" },
|
|
3951
|
+
completed: { label: "Completed", fg: "#15803D", bg: "#F0FDF4" },
|
|
3952
|
+
failed: { label: "Failed", fg: "#B91C1C", bg: "#FEF2F2" }
|
|
3953
|
+
};
|
|
3954
|
+
const meta = map[status];
|
|
3955
|
+
if (!meta) return null;
|
|
3956
|
+
return /* @__PURE__ */ jsxs15(
|
|
3957
|
+
Flex8,
|
|
3958
|
+
{
|
|
3959
|
+
align: "center",
|
|
3960
|
+
gap: 1.5,
|
|
3961
|
+
px: 2.5,
|
|
3962
|
+
py: 1,
|
|
3963
|
+
borderRadius: "full",
|
|
3964
|
+
fontSize: "xs",
|
|
3965
|
+
fontWeight: 600,
|
|
3966
|
+
style: { color: meta.fg, background: meta.bg },
|
|
3967
|
+
flexShrink: 0,
|
|
3968
|
+
children: [
|
|
3969
|
+
status === "processing" || status === "uploading" ? /* @__PURE__ */ jsx19(Spinner, { size: "xs", borderWidth: "2px" }) : status === "completed" ? /* @__PURE__ */ jsx19(LuCheck3, { size: 12 }) : /* @__PURE__ */ jsx19(LuTriangleAlert, { size: 12 }),
|
|
3970
|
+
meta.label
|
|
3971
|
+
]
|
|
3972
|
+
}
|
|
3973
|
+
);
|
|
3974
|
+
};
|
|
3975
|
+
var ProgressBar = ({ value, color }) => /* @__PURE__ */ jsx19(Box16, { w: "full", h: "6px", bg: "gray.100", borderRadius: "full", overflow: "hidden", children: /* @__PURE__ */ jsx19(
|
|
3976
|
+
Box16,
|
|
3977
|
+
{
|
|
3978
|
+
h: "full",
|
|
3979
|
+
borderRadius: "full",
|
|
3980
|
+
style: {
|
|
3981
|
+
width: `${value}%`,
|
|
3982
|
+
background: color,
|
|
3983
|
+
transition: "width 0.2s ease"
|
|
3984
|
+
}
|
|
3985
|
+
}
|
|
3986
|
+
) });
|
|
3987
|
+
var Thumb = ({
|
|
3988
|
+
url,
|
|
3989
|
+
isPdf,
|
|
3990
|
+
fileName,
|
|
3991
|
+
transparent
|
|
3992
|
+
}) => /* @__PURE__ */ jsx19(
|
|
3993
|
+
Flex8,
|
|
3994
|
+
{
|
|
3995
|
+
align: "center",
|
|
3996
|
+
justify: "center",
|
|
3997
|
+
boxSize: { base: "56px", md: "64px" },
|
|
3998
|
+
borderRadius: "lg",
|
|
3999
|
+
borderWidth: "1px",
|
|
4000
|
+
borderColor: "gray.200",
|
|
4001
|
+
overflow: "hidden",
|
|
4002
|
+
flexShrink: 0,
|
|
4003
|
+
bg: transparent ? "transparent" : "gray.50",
|
|
4004
|
+
style: transparent ? {
|
|
4005
|
+
backgroundImage: "linear-gradient(45deg,#eee 25%,transparent 25%),linear-gradient(-45deg,#eee 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#eee 75%),linear-gradient(-45deg,transparent 75%,#eee 75%)",
|
|
4006
|
+
backgroundSize: "10px 10px",
|
|
4007
|
+
backgroundPosition: "0 0,0 5px,5px -5px,-5px 0"
|
|
4008
|
+
} : void 0,
|
|
4009
|
+
children: isPdf || !url ? /* @__PURE__ */ jsxs15(Flex8, { direction: "column", align: "center", color: "gray.400", gap: 0.5, children: [
|
|
4010
|
+
/* @__PURE__ */ jsx19(LuFileText, { size: 22 }),
|
|
4011
|
+
/* @__PURE__ */ jsx19(Text9, { fontSize: "9px", fontWeight: 600, children: isPdf ? "PDF" : "FILE" })
|
|
4012
|
+
] }) : (
|
|
4013
|
+
// eslint-disable-next-line @next/next/no-img-element
|
|
4014
|
+
/* @__PURE__ */ jsx19(
|
|
4015
|
+
"img",
|
|
4016
|
+
{
|
|
4017
|
+
src: url,
|
|
4018
|
+
alt: fileName ?? "preview",
|
|
4019
|
+
style: { width: "100%", height: "100%", objectFit: "contain" }
|
|
4020
|
+
}
|
|
4021
|
+
)
|
|
4022
|
+
)
|
|
4023
|
+
}
|
|
4024
|
+
);
|
|
4025
|
+
var GhostBtn = ({
|
|
4026
|
+
icon,
|
|
4027
|
+
label,
|
|
4028
|
+
onClick,
|
|
4029
|
+
tone = "gray"
|
|
4030
|
+
}) => {
|
|
4031
|
+
const tones = {
|
|
4032
|
+
gray: { c: "gray.600", h: "gray.50", b: "gray.200" },
|
|
4033
|
+
danger: { c: "#B91C1C", h: "#FEF2F2", b: "#FECACA" },
|
|
4034
|
+
primary: { c: PRIMARY2, h: PRIMARY_SOFT, b: PRIMARY2 }
|
|
4035
|
+
};
|
|
4036
|
+
const t = tones[tone];
|
|
4037
|
+
return /* @__PURE__ */ jsxs15(
|
|
4038
|
+
Flex8,
|
|
4039
|
+
{
|
|
4040
|
+
as: "button",
|
|
4041
|
+
align: "center",
|
|
4042
|
+
gap: 1.5,
|
|
4043
|
+
px: 2.5,
|
|
4044
|
+
py: 1.5,
|
|
4045
|
+
borderRadius: "lg",
|
|
4046
|
+
borderWidth: "1px",
|
|
4047
|
+
borderColor: t.b,
|
|
4048
|
+
color: t.c,
|
|
4049
|
+
bg: "white",
|
|
4050
|
+
fontSize: "xs",
|
|
4051
|
+
fontWeight: 600,
|
|
4052
|
+
cursor: "pointer",
|
|
4053
|
+
_hover: { bg: t.h },
|
|
4054
|
+
transition: "all 0.15s",
|
|
4055
|
+
onClick,
|
|
4056
|
+
children: [
|
|
4057
|
+
icon,
|
|
4058
|
+
label
|
|
4059
|
+
]
|
|
4060
|
+
}
|
|
4061
|
+
);
|
|
4062
|
+
};
|
|
4063
|
+
function DocumentUploadCard({
|
|
4064
|
+
config,
|
|
4065
|
+
onStatusChange,
|
|
4066
|
+
onProcess,
|
|
4067
|
+
onError
|
|
4068
|
+
}) {
|
|
4069
|
+
const notifyError = onError ?? defaultNotifyError;
|
|
4070
|
+
const { slot, uploadDocument, retryDocument, removeDocument } = useDocumentSlot(config, onProcess, notifyError);
|
|
4071
|
+
const status = slot?.status ?? "idle";
|
|
4072
|
+
useEffect7(() => {
|
|
4073
|
+
onStatusChange?.(status);
|
|
4074
|
+
}, [status, onStatusChange]);
|
|
4075
|
+
const browseRef = useRef2(null);
|
|
4076
|
+
const cameraRef = useRef2(null);
|
|
4077
|
+
const [dragging, setDragging] = useState13(false);
|
|
4078
|
+
const Icon6 = config.icon;
|
|
4079
|
+
const isPdf = slot?.fileType === "application/pdf";
|
|
4080
|
+
const handleFiles = (files) => {
|
|
4081
|
+
const file = files?.[0];
|
|
4082
|
+
if (!file) return;
|
|
4083
|
+
const error = validate(file, config);
|
|
4084
|
+
if (error) {
|
|
4085
|
+
notifyError(error);
|
|
4086
|
+
return;
|
|
4087
|
+
}
|
|
4088
|
+
void uploadDocument(file);
|
|
4089
|
+
};
|
|
4090
|
+
const onDrop = (e) => {
|
|
4091
|
+
e.preventDefault();
|
|
4092
|
+
setDragging(false);
|
|
4093
|
+
handleFiles(e.dataTransfer.files);
|
|
4094
|
+
};
|
|
4095
|
+
const renderDropzone = () => /* @__PURE__ */ jsxs15(
|
|
4096
|
+
Flex8,
|
|
4097
|
+
{
|
|
4098
|
+
direction: "column",
|
|
4099
|
+
align: "center",
|
|
4100
|
+
justify: "center",
|
|
4101
|
+
gap: 2,
|
|
4102
|
+
py: { base: 6, md: 7 },
|
|
4103
|
+
px: 4,
|
|
4104
|
+
borderWidth: "2px",
|
|
4105
|
+
borderStyle: "dashed",
|
|
4106
|
+
borderColor: dragging ? PRIMARY2 : "gray.200",
|
|
4107
|
+
borderRadius: "xl",
|
|
4108
|
+
bg: dragging ? PRIMARY_SOFT : "gray.50",
|
|
4109
|
+
transition: "all 0.15s",
|
|
4110
|
+
textAlign: "center",
|
|
4111
|
+
onDragOver: (e) => {
|
|
4112
|
+
e.preventDefault();
|
|
4113
|
+
setDragging(true);
|
|
4114
|
+
},
|
|
4115
|
+
onDragLeave: () => setDragging(false),
|
|
4116
|
+
onDrop,
|
|
4117
|
+
role: "button",
|
|
4118
|
+
tabIndex: 0,
|
|
4119
|
+
onClick: () => browseRef.current?.click(),
|
|
4120
|
+
onKeyDown: (e) => {
|
|
4121
|
+
if (e.key === "Enter" || e.key === " ") browseRef.current?.click();
|
|
4122
|
+
},
|
|
4123
|
+
cursor: "pointer",
|
|
4124
|
+
_hover: { borderColor: PRIMARY2, bg: PRIMARY_SOFT },
|
|
4125
|
+
children: [
|
|
4126
|
+
/* @__PURE__ */ jsx19(
|
|
4127
|
+
Flex8,
|
|
4128
|
+
{
|
|
4129
|
+
align: "center",
|
|
4130
|
+
justify: "center",
|
|
4131
|
+
boxSize: 11,
|
|
4132
|
+
borderRadius: "full",
|
|
4133
|
+
bg: "white",
|
|
4134
|
+
borderWidth: "1px",
|
|
4135
|
+
borderColor: "gray.200",
|
|
4136
|
+
color: PRIMARY2,
|
|
4137
|
+
children: /* @__PURE__ */ jsx19(LuUpload, { size: 18 })
|
|
4138
|
+
}
|
|
4139
|
+
),
|
|
4140
|
+
/* @__PURE__ */ jsxs15(Box16, { children: [
|
|
4141
|
+
/* @__PURE__ */ jsx19(Text9, { fontSize: "sm", fontWeight: 600, color: "gray.800", children: "Drag & drop or tap to upload" }),
|
|
4142
|
+
/* @__PURE__ */ jsx19(Text9, { fontSize: "xs", color: "gray.500", mt: 0.5, children: config.hint ?? "JPG, PNG or PDF" })
|
|
4143
|
+
] }),
|
|
4144
|
+
/* @__PURE__ */ jsxs15(Flex8, { gap: 2, mt: 1, onClick: (e) => e.stopPropagation(), children: [
|
|
4145
|
+
/* @__PURE__ */ jsx19(
|
|
4146
|
+
GhostBtn,
|
|
4147
|
+
{
|
|
4148
|
+
icon: /* @__PURE__ */ jsx19(LuFolderOpen, { size: 13 }),
|
|
4149
|
+
label: "Browse",
|
|
4150
|
+
tone: "primary",
|
|
4151
|
+
onClick: () => browseRef.current?.click()
|
|
4152
|
+
}
|
|
4153
|
+
),
|
|
4154
|
+
/* @__PURE__ */ jsx19(
|
|
4155
|
+
GhostBtn,
|
|
4156
|
+
{
|
|
4157
|
+
icon: /* @__PURE__ */ jsx19(LuCamera, { size: 13 }),
|
|
4158
|
+
label: "Take photo",
|
|
4159
|
+
onClick: () => cameraRef.current?.click()
|
|
4160
|
+
}
|
|
4161
|
+
)
|
|
4162
|
+
] })
|
|
4163
|
+
]
|
|
4164
|
+
}
|
|
4165
|
+
);
|
|
4166
|
+
const renderBusy = () => /* @__PURE__ */ jsxs15(Flex8, { gap: 3, align: "center", children: [
|
|
4167
|
+
/* @__PURE__ */ jsx19(Thumb, { url: slot?.previewUrl, isPdf, fileName: slot?.fileName }),
|
|
4168
|
+
/* @__PURE__ */ jsxs15(Box16, { flex: "1", minW: 0, children: [
|
|
4169
|
+
/* @__PURE__ */ jsx19(Text9, { fontSize: "sm", fontWeight: 600, color: "gray.800", truncate: true, children: slot?.fileName }),
|
|
4170
|
+
status === "uploading" ? /* @__PURE__ */ jsxs15(Fragment3, { children: [
|
|
4171
|
+
/* @__PURE__ */ jsxs15(
|
|
4172
|
+
Flex8,
|
|
4173
|
+
{
|
|
4174
|
+
justify: "space-between",
|
|
4175
|
+
fontSize: "xs",
|
|
4176
|
+
color: "gray.500",
|
|
4177
|
+
mt: 1,
|
|
4178
|
+
mb: 1,
|
|
4179
|
+
children: [
|
|
4180
|
+
/* @__PURE__ */ jsx19(Text9, { children: "Uploading\u2026" }),
|
|
4181
|
+
/* @__PURE__ */ jsxs15(Text9, { fontWeight: 600, children: [
|
|
4182
|
+
slot?.progress ?? 0,
|
|
4183
|
+
"%"
|
|
4184
|
+
] })
|
|
4185
|
+
]
|
|
4186
|
+
}
|
|
4187
|
+
),
|
|
4188
|
+
/* @__PURE__ */ jsx19(ProgressBar, { value: slot?.progress ?? 0, color: "#2563EB" })
|
|
4189
|
+
] }) : /* @__PURE__ */ jsxs15(Flex8, { align: "center", gap: 2, mt: 1.5, children: [
|
|
4190
|
+
/* @__PURE__ */ jsxs15(
|
|
4191
|
+
Flex8,
|
|
4192
|
+
{
|
|
4193
|
+
align: "center",
|
|
4194
|
+
gap: 1.5,
|
|
4195
|
+
px: 2,
|
|
4196
|
+
py: 1,
|
|
4197
|
+
borderRadius: "md",
|
|
4198
|
+
bg: "#F5F3FF",
|
|
4199
|
+
color: "#7C3AED",
|
|
4200
|
+
fontSize: "xs",
|
|
4201
|
+
fontWeight: 600,
|
|
4202
|
+
children: [
|
|
4203
|
+
/* @__PURE__ */ jsx19(LuSparkles, { size: 12 }),
|
|
4204
|
+
config.processor === "signature" ? "Cleaning signature\u2026" : "Reading with AI\u2026"
|
|
4205
|
+
]
|
|
4206
|
+
}
|
|
4207
|
+
),
|
|
4208
|
+
/* @__PURE__ */ jsx19(Spinner, { size: "xs", color: "#7C3AED", borderWidth: "2px" })
|
|
4209
|
+
] }),
|
|
4210
|
+
status === "processing" && /* @__PURE__ */ jsx19(Text9, { fontSize: "11px", color: "gray.400", mt: 1.5, children: "This can take a few seconds. Your upload is already saved." })
|
|
4211
|
+
] })
|
|
4212
|
+
] });
|
|
4213
|
+
const renderFailed = () => /* @__PURE__ */ jsxs15(Box16, { children: [
|
|
4214
|
+
/* @__PURE__ */ jsxs15(Flex8, { gap: 3, align: "flex-start", children: [
|
|
4215
|
+
/* @__PURE__ */ jsx19(Thumb, { url: slot?.previewUrl, isPdf, fileName: slot?.fileName }),
|
|
4216
|
+
/* @__PURE__ */ jsxs15(Box16, { flex: "1", minW: 0, children: [
|
|
4217
|
+
/* @__PURE__ */ jsx19(Text9, { fontSize: "sm", fontWeight: 600, color: "gray.800", truncate: true, children: slot?.fileName ?? config.label }),
|
|
4218
|
+
/* @__PURE__ */ jsxs15(Flex8, { align: "flex-start", gap: 1.5, mt: 1, color: "#B91C1C", children: [
|
|
4219
|
+
/* @__PURE__ */ jsx19(Box16, { mt: "1px", children: /* @__PURE__ */ jsx19(LuTriangleAlert, { size: 13 }) }),
|
|
4220
|
+
/* @__PURE__ */ jsx19(Text9, { fontSize: "xs", lineHeight: "1.4", children: slot?.error ?? "We couldn't process this document." })
|
|
4221
|
+
] })
|
|
4222
|
+
] })
|
|
4223
|
+
] }),
|
|
4224
|
+
/* @__PURE__ */ jsxs15(Flex8, { gap: 2, mt: 3, wrap: "wrap", children: [
|
|
4225
|
+
slot?.file ? /* @__PURE__ */ jsx19(
|
|
4226
|
+
GhostBtn,
|
|
4227
|
+
{
|
|
4228
|
+
icon: /* @__PURE__ */ jsx19(LuRefreshCw, { size: 13 }),
|
|
4229
|
+
label: "Retry",
|
|
4230
|
+
tone: "primary",
|
|
4231
|
+
onClick: () => void retryDocument()
|
|
4232
|
+
}
|
|
4233
|
+
) : /* @__PURE__ */ jsx19(
|
|
4234
|
+
GhostBtn,
|
|
4235
|
+
{
|
|
4236
|
+
icon: /* @__PURE__ */ jsx19(LuUpload, { size: 13 }),
|
|
4237
|
+
label: "Re-upload",
|
|
4238
|
+
tone: "primary",
|
|
4239
|
+
onClick: () => browseRef.current?.click()
|
|
4240
|
+
}
|
|
4241
|
+
),
|
|
4242
|
+
/* @__PURE__ */ jsx19(
|
|
4243
|
+
GhostBtn,
|
|
4244
|
+
{
|
|
4245
|
+
icon: /* @__PURE__ */ jsx19(LuReplace, { size: 13 }),
|
|
4246
|
+
label: "Choose another",
|
|
4247
|
+
onClick: () => browseRef.current?.click()
|
|
4248
|
+
}
|
|
4249
|
+
),
|
|
4250
|
+
/* @__PURE__ */ jsx19(
|
|
4251
|
+
GhostBtn,
|
|
4252
|
+
{
|
|
4253
|
+
icon: /* @__PURE__ */ jsx19(LuTrash2, { size: 13 }),
|
|
4254
|
+
label: "Remove",
|
|
4255
|
+
tone: "danger",
|
|
4256
|
+
onClick: () => removeDocument()
|
|
4257
|
+
}
|
|
4258
|
+
)
|
|
4259
|
+
] })
|
|
4260
|
+
] });
|
|
4261
|
+
const renderCompleted = () => {
|
|
4262
|
+
const isSignature = config.processor === "signature";
|
|
4263
|
+
const fieldCount = slot?.extraction ? Object.values(slot.extraction).filter(Boolean).length : 0;
|
|
4264
|
+
const displayUrl = isSignature ? slot?.cleanedImageUrl ?? slot?.previewUrl : slot?.previewUrl;
|
|
4265
|
+
return /* @__PURE__ */ jsxs15(Box16, { children: [
|
|
4266
|
+
/* @__PURE__ */ jsxs15(Flex8, { gap: 3, align: "center", children: [
|
|
4267
|
+
/* @__PURE__ */ jsx19(
|
|
4268
|
+
Thumb,
|
|
4269
|
+
{
|
|
4270
|
+
url: displayUrl,
|
|
4271
|
+
isPdf: isPdf && !isSignature,
|
|
4272
|
+
fileName: slot?.fileName,
|
|
4273
|
+
transparent: isSignature && !!slot?.cleanedImageUrl
|
|
4274
|
+
}
|
|
4275
|
+
),
|
|
4276
|
+
/* @__PURE__ */ jsxs15(Box16, { flex: "1", minW: 0, children: [
|
|
4277
|
+
/* @__PURE__ */ jsx19(Text9, { fontSize: "sm", fontWeight: 600, color: "gray.800", truncate: true, children: slot?.fileName }),
|
|
4278
|
+
/* @__PURE__ */ jsx19(Text9, { fontSize: "xs", color: "gray.500", children: formatBytes(slot?.fileSize) }),
|
|
4279
|
+
/* @__PURE__ */ jsxs15(
|
|
4280
|
+
Flex8,
|
|
4281
|
+
{
|
|
4282
|
+
align: "center",
|
|
4283
|
+
gap: 1.5,
|
|
4284
|
+
mt: 1.5,
|
|
4285
|
+
color: PRIMARY2,
|
|
4286
|
+
fontSize: "xs",
|
|
4287
|
+
fontWeight: 600,
|
|
4288
|
+
children: [
|
|
4289
|
+
/* @__PURE__ */ jsx19(LuSparkles, { size: 12 }),
|
|
4290
|
+
isSignature ? "Signature detected & cleaned" : `${fieldCount} field${fieldCount === 1 ? "" : "s"} extracted`
|
|
4291
|
+
]
|
|
4292
|
+
}
|
|
4293
|
+
)
|
|
4294
|
+
] })
|
|
4295
|
+
] }),
|
|
4296
|
+
/* @__PURE__ */ jsxs15(Flex8, { gap: 2, mt: 3, wrap: "wrap", children: [
|
|
4297
|
+
/* @__PURE__ */ jsx19(
|
|
4298
|
+
GhostBtn,
|
|
4299
|
+
{
|
|
4300
|
+
icon: /* @__PURE__ */ jsx19(LuReplace, { size: 13 }),
|
|
4301
|
+
label: "Replace",
|
|
4302
|
+
onClick: () => browseRef.current?.click()
|
|
4303
|
+
}
|
|
4304
|
+
),
|
|
4305
|
+
/* @__PURE__ */ jsx19(
|
|
4306
|
+
GhostBtn,
|
|
4307
|
+
{
|
|
4308
|
+
icon: /* @__PURE__ */ jsx19(LuTrash2, { size: 13 }),
|
|
4309
|
+
label: "Remove",
|
|
4310
|
+
tone: "danger",
|
|
4311
|
+
onClick: () => removeDocument()
|
|
4312
|
+
}
|
|
4313
|
+
)
|
|
4314
|
+
] })
|
|
4315
|
+
] });
|
|
4316
|
+
};
|
|
4317
|
+
const requiredTag = /* @__PURE__ */ jsx19(
|
|
4318
|
+
Text9,
|
|
4319
|
+
{
|
|
4320
|
+
fontSize: "10px",
|
|
4321
|
+
fontWeight: 700,
|
|
4322
|
+
px: 1.5,
|
|
4323
|
+
py: 0.5,
|
|
4324
|
+
borderRadius: "full",
|
|
4325
|
+
color: config.required ? "#B45309" : "gray.500",
|
|
4326
|
+
bg: config.required ? "#FEF3C7" : "gray.100",
|
|
4327
|
+
flexShrink: 0,
|
|
4328
|
+
children: config.required ? "REQUIRED" : "OPTIONAL"
|
|
4329
|
+
}
|
|
4330
|
+
);
|
|
4331
|
+
const isMobile = useBreakpointValue2({ base: true, lg: false });
|
|
4332
|
+
return /* @__PURE__ */ jsxs15(
|
|
4333
|
+
Card,
|
|
4334
|
+
{
|
|
4335
|
+
activeIcon: /* @__PURE__ */ jsx19(Icon6, { size: 18 }),
|
|
4336
|
+
title: config.label,
|
|
4337
|
+
subtitle: config.description,
|
|
4338
|
+
headerAction: !isMobile ? /* @__PURE__ */ jsxs15(Flex8, { align: "center", gap: 2, flexShrink: 0, children: [
|
|
4339
|
+
requiredTag,
|
|
4340
|
+
/* @__PURE__ */ jsx19(StatusPill, { status })
|
|
4341
|
+
] }) : /* @__PURE__ */ jsx19(Fragment3, {}),
|
|
4342
|
+
children: [
|
|
4343
|
+
isMobile ? /* @__PURE__ */ jsxs15(
|
|
4344
|
+
Flex8,
|
|
4345
|
+
{
|
|
4346
|
+
align: "center",
|
|
4347
|
+
justifySelf: "flex-end",
|
|
4348
|
+
gap: 2,
|
|
4349
|
+
mb: 1,
|
|
4350
|
+
flexShrink: 0,
|
|
4351
|
+
children: [
|
|
4352
|
+
requiredTag,
|
|
4353
|
+
/* @__PURE__ */ jsx19(StatusPill, { status })
|
|
4354
|
+
]
|
|
4355
|
+
}
|
|
4356
|
+
) : /* @__PURE__ */ jsx19(Fragment3, {}),
|
|
4357
|
+
status === "idle" && renderDropzone(),
|
|
4358
|
+
(status === "uploading" || status === "processing") && renderBusy(),
|
|
4359
|
+
status === "failed" && renderFailed(),
|
|
4360
|
+
status === "completed" && renderCompleted(),
|
|
4361
|
+
/* @__PURE__ */ jsx19(
|
|
4362
|
+
"input",
|
|
4363
|
+
{
|
|
4364
|
+
ref: browseRef,
|
|
4365
|
+
type: "file",
|
|
4366
|
+
accept: config.accept,
|
|
4367
|
+
hidden: true,
|
|
4368
|
+
onChange: (e) => {
|
|
4369
|
+
handleFiles(e.target.files);
|
|
4370
|
+
e.target.value = "";
|
|
4371
|
+
}
|
|
4372
|
+
}
|
|
4373
|
+
),
|
|
4374
|
+
/* @__PURE__ */ jsx19(
|
|
4375
|
+
"input",
|
|
4376
|
+
{
|
|
4377
|
+
ref: cameraRef,
|
|
4378
|
+
type: "file",
|
|
4379
|
+
accept: "image/*",
|
|
4380
|
+
capture: "environment",
|
|
4381
|
+
hidden: true,
|
|
4382
|
+
onChange: (e) => {
|
|
4383
|
+
handleFiles(e.target.files);
|
|
4384
|
+
e.target.value = "";
|
|
4385
|
+
}
|
|
4386
|
+
}
|
|
4387
|
+
)
|
|
4388
|
+
]
|
|
4389
|
+
}
|
|
4390
|
+
);
|
|
4391
|
+
}
|
|
4392
|
+
|
|
4393
|
+
// src/services/OcrService.ts
|
|
4394
|
+
var ENDPOINTS3 = {
|
|
4395
|
+
scan: "/Ocr/Scan"
|
|
4396
|
+
};
|
|
4397
|
+
var isObject = (value) => !!value && typeof value === "object" && !Array.isArray(value);
|
|
4398
|
+
var readField = (source, keys) => {
|
|
4399
|
+
if (!source) return "";
|
|
4400
|
+
for (const key of keys) {
|
|
4401
|
+
const match = Object.keys(source).find(
|
|
4402
|
+
(k) => k.toLowerCase() === key.toLowerCase()
|
|
4403
|
+
);
|
|
4404
|
+
const value = match ? source[match] : void 0;
|
|
4405
|
+
if (typeof value === "string" && value.trim()) return value.trim();
|
|
4406
|
+
if (typeof value === "number") return String(value);
|
|
4407
|
+
}
|
|
4408
|
+
return "";
|
|
4409
|
+
};
|
|
4410
|
+
var pad = (value) => String(value).padStart(2, "0");
|
|
4411
|
+
var toIsoDate = (value) => {
|
|
4412
|
+
if (!value) return "";
|
|
4413
|
+
if (/^\d{4}-\d{2}-\d{2}/.test(value)) return value.slice(0, 10);
|
|
4414
|
+
const parts = value.split(/[/-]/).map((part) => part.trim());
|
|
4415
|
+
if (parts.length === 3 && parts.every(Boolean)) {
|
|
4416
|
+
const [first = "", second = "", third = ""] = parts;
|
|
4417
|
+
if (first.length === 4) return `${first}-${pad(second)}-${pad(third)}`;
|
|
4418
|
+
if (third.length === 4) return `${third}-${pad(first)}-${pad(second)}`;
|
|
4419
|
+
}
|
|
4420
|
+
const parsed = new Date(value);
|
|
4421
|
+
if (Number.isNaN(parsed.getTime())) return "";
|
|
4422
|
+
return `${parsed.getFullYear()}-${pad(parsed.getMonth() + 1)}-${pad(parsed.getDate())}`;
|
|
4423
|
+
};
|
|
4424
|
+
var toIdType = (value) => {
|
|
4425
|
+
const text = value.toLowerCase();
|
|
4426
|
+
if (!text) return "";
|
|
4427
|
+
if (text.includes("passport")) return "passport";
|
|
4428
|
+
if (text.includes("driver")) return "driver_license";
|
|
4429
|
+
if (text.includes("national") || text.includes("id")) return "national_id";
|
|
4430
|
+
return "";
|
|
4431
|
+
};
|
|
4432
|
+
var toOcrValue = (body) => {
|
|
4433
|
+
const root = isObject(body) ? body : void 0;
|
|
4434
|
+
const nested = root ? Object.entries(root).find(
|
|
4435
|
+
([key, value]) => key.toLowerCase() === "response" && isObject(value)
|
|
4436
|
+
)?.[1] : void 0;
|
|
4437
|
+
const source = isObject(nested) ? nested : root;
|
|
4438
|
+
return {
|
|
4439
|
+
firstName: readField(source, ["firstName"]),
|
|
4440
|
+
middleName: readField(source, ["middleName"]),
|
|
4441
|
+
lastName: readField(source, ["lastName"]),
|
|
4442
|
+
birthDate: toIsoDate(readField(source, ["birthDate", "dateOfBirth"])),
|
|
4443
|
+
idType: toIdType(readField(source, ["idType"])),
|
|
4444
|
+
idNumber: readField(source, ["idNumber", "idNo"]),
|
|
4445
|
+
addressLine: readField(source, ["addressLine", "address", "completeAddress"])
|
|
4446
|
+
};
|
|
4447
|
+
};
|
|
4448
|
+
var toFormData = (docType, source) => {
|
|
4449
|
+
const formData = new FormData();
|
|
4450
|
+
formData.append("DocType", docType);
|
|
4451
|
+
if (typeof source === "string") {
|
|
4452
|
+
formData.append("OCRType", "URL");
|
|
4453
|
+
formData.append("ImageUrl", source.trim());
|
|
4454
|
+
} else {
|
|
4455
|
+
formData.append("OCRType", "File");
|
|
4456
|
+
formData.append("File", source);
|
|
4457
|
+
}
|
|
4458
|
+
return formData;
|
|
4459
|
+
};
|
|
4460
|
+
var OcrService = {
|
|
4461
|
+
async scan(docType, source) {
|
|
4462
|
+
return api.post(ENDPOINTS3.scan, toFormData(docType, source), {
|
|
4463
|
+
headers: { "Content-Type": "multipart/form-data" },
|
|
4464
|
+
timeout: 9e4
|
|
4465
|
+
});
|
|
4466
|
+
},
|
|
4467
|
+
async scanId(source) {
|
|
4468
|
+
const body = await OcrService.scan("ID", source);
|
|
4469
|
+
const result = toOcrValue(body);
|
|
4470
|
+
if (!result.firstName && !result.lastName && !result.idNumber) {
|
|
4471
|
+
const description = isObject(body) ? readField(body, ["description", "message"]) : "";
|
|
4472
|
+
throw new APIError(
|
|
4473
|
+
description || "We couldn't read your ID. Please upload a clearer photo."
|
|
4474
|
+
);
|
|
4475
|
+
}
|
|
4476
|
+
return result;
|
|
4477
|
+
},
|
|
4478
|
+
async scanLpa(source) {
|
|
4479
|
+
return OcrService.scan("LPA", source);
|
|
4480
|
+
}
|
|
4481
|
+
};
|
|
4482
|
+
|
|
4483
|
+
// src/GetStarted/GetStarted.tsx
|
|
4484
|
+
import { jsx as jsx20, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
4485
|
+
var defaultNotify = (type, message) => {
|
|
4486
|
+
if (type === "error") console.error(message);
|
|
4487
|
+
else console.info(message);
|
|
4488
|
+
};
|
|
4489
|
+
var GOVERNMENT_ID_CONFIG = {
|
|
4490
|
+
id: "government-id",
|
|
4491
|
+
label: "Government-issued ID",
|
|
4492
|
+
description: "Current and valid ID",
|
|
4493
|
+
accept: "image/*",
|
|
4494
|
+
maxSizeMB: 5,
|
|
4495
|
+
required: true,
|
|
4496
|
+
hint: "Any image \xB7 up to 5MB",
|
|
4497
|
+
processor: "extraction",
|
|
4498
|
+
icon: LuIdCard
|
|
4499
|
+
};
|
|
4500
|
+
var SIGNATURE_CONFIG = {
|
|
4501
|
+
id: "specimen-signature",
|
|
4502
|
+
label: "Specimen Signature",
|
|
4503
|
+
description: "Signature on plain white paper",
|
|
4504
|
+
accept: "image/png,image/jpeg,application/pdf",
|
|
4505
|
+
maxSizeMB: 5,
|
|
4506
|
+
required: true,
|
|
4507
|
+
hint: "JPG, PNG or PDF \xB7 up to 5MB",
|
|
4508
|
+
processor: "signature",
|
|
4509
|
+
icon: LuSignature
|
|
4510
|
+
};
|
|
4511
|
+
var GetStarted = ({
|
|
4512
|
+
scanId: scanIdFn = OcrService.scanId,
|
|
4513
|
+
onContinue,
|
|
4514
|
+
notify = defaultNotify
|
|
4515
|
+
}) => {
|
|
4516
|
+
const [uploadDialogOpen, setUploadDialogOpen] = useState14(false);
|
|
4517
|
+
const [referralDialogOpen, setReferralDialogOpen] = useState14(false);
|
|
4518
|
+
const [governmentIdStatus, setGovernmentIdStatus] = useState14("idle");
|
|
4519
|
+
const { scanId } = useOcr(scanIdFn);
|
|
4520
|
+
return /* @__PURE__ */ jsx20(Container_default, { children: /* @__PURE__ */ jsxs16(
|
|
4521
|
+
Box17,
|
|
4522
|
+
{
|
|
4523
|
+
p: { base: 0, md: 8 },
|
|
4524
|
+
rounded: "lg",
|
|
4525
|
+
shadow: { base: "none", md: "md" },
|
|
4526
|
+
bg: "white",
|
|
4527
|
+
maxW: "3xl",
|
|
4528
|
+
display: "flex",
|
|
4529
|
+
flexDirection: "column",
|
|
4530
|
+
alignItems: "center",
|
|
4531
|
+
mx: "auto",
|
|
4532
|
+
children: [
|
|
4533
|
+
/* @__PURE__ */ jsxs16(VStack7, { gap: 4, align: "stretch", children: [
|
|
4534
|
+
/* @__PURE__ */ jsx20(Box17, { textAlign: "center", children: /* @__PURE__ */ jsx20(H32, { children: "Let's Get Started" }) }),
|
|
4535
|
+
/* @__PURE__ */ jsx20(BaseText, { textAlign: { base: "center", md: "start" }, children: "We'll be needing some documents and information to proceed with the purchase, please prepare the following in advance to smooth out the next steps" }),
|
|
4536
|
+
/* @__PURE__ */ jsx20(Box17, { bg: "gray.50", p: 8, rounded: "md", children: /* @__PURE__ */ jsx20(VStack7, { align: "start", gap: 2, children: /* @__PURE__ */ jsxs16(Box17, { mb: 4, display: "flex", flexDirection: "column", gap: 2, children: [
|
|
4537
|
+
/* @__PURE__ */ jsx20(BaseText, { fontWeight: "bold", children: "Required Information" }),
|
|
4538
|
+
/* @__PURE__ */ jsx20(BaseText, { children: "1. Full Name" }),
|
|
4539
|
+
/* @__PURE__ */ jsx20(BaseText, { children: "2. Nationality" }),
|
|
4540
|
+
/* @__PURE__ */ jsx20(BaseText, { children: "3. Mobile Number" }),
|
|
4541
|
+
/* @__PURE__ */ jsx20(BaseText, { children: "4. Email Address" }),
|
|
4542
|
+
/* @__PURE__ */ jsx20(BaseText, { children: "5. Date of Birth" }),
|
|
4543
|
+
/* @__PURE__ */ jsx20(BaseText, { children: "6. Complete Address" }),
|
|
4544
|
+
/* @__PURE__ */ jsx20(BaseText, { children: "7. Beneficiary/ies" }),
|
|
4545
|
+
/* @__PURE__ */ jsx20(BaseText, { fontWeight: "bold", children: "Required Documents" }),
|
|
4546
|
+
/* @__PURE__ */ jsx20(BaseText, { children: "1. Current and Valid Government-issued ID" }),
|
|
4547
|
+
/* @__PURE__ */ jsx20(BaseText, { children: "2. Specimen Signature" })
|
|
4548
|
+
] }) }) })
|
|
4549
|
+
] }),
|
|
4550
|
+
/* @__PURE__ */ jsxs16(Box17, { textAlign: "end", children: [
|
|
4551
|
+
/* @__PURE__ */ jsxs16(
|
|
4552
|
+
Dialog3.Root,
|
|
4553
|
+
{
|
|
4554
|
+
size: { mdDown: "full", md: "md" },
|
|
4555
|
+
open: uploadDialogOpen,
|
|
4556
|
+
onOpenChange: (details) => setUploadDialogOpen(details.open),
|
|
4557
|
+
children: [
|
|
4558
|
+
/* @__PURE__ */ jsx20(Dialog3.Trigger, { asChild: true, children: /* @__PURE__ */ jsx20(
|
|
4559
|
+
Button3,
|
|
4560
|
+
{
|
|
4561
|
+
w: { base: "sm", md: "2xl" },
|
|
4562
|
+
mt: { base: 4, md: 8 },
|
|
4563
|
+
onClick: () => setUploadDialogOpen(true),
|
|
4564
|
+
children: "CONTINUE"
|
|
4565
|
+
}
|
|
4566
|
+
) }),
|
|
4567
|
+
/* @__PURE__ */ jsxs16(Portal4, { children: [
|
|
4568
|
+
/* @__PURE__ */ jsx20(Dialog3.Backdrop, {}),
|
|
4569
|
+
/* @__PURE__ */ jsx20(Dialog3.Positioner, { children: /* @__PURE__ */ jsxs16(Dialog3.Content, { children: [
|
|
4570
|
+
/* @__PURE__ */ jsx20(Dialog3.Header, { children: /* @__PURE__ */ jsx20(Dialog3.Title, { children: "Upload Requirements" }) }),
|
|
4571
|
+
/* @__PURE__ */ jsx20(Dialog3.Body, { children: /* @__PURE__ */ jsxs16(VStack7, { gap: 6, align: "stretch", children: [
|
|
4572
|
+
/* @__PURE__ */ jsx20(info_card_default, { children: "To continue, please upload a valid ID. The system will use it to populate your information automatically." }),
|
|
4573
|
+
/* @__PURE__ */ jsx20(
|
|
4574
|
+
DocumentUploadCard,
|
|
4575
|
+
{
|
|
4576
|
+
config: GOVERNMENT_ID_CONFIG,
|
|
4577
|
+
onStatusChange: setGovernmentIdStatus,
|
|
4578
|
+
onProcess: scanId,
|
|
4579
|
+
onError: (message) => notify("error", message)
|
|
4580
|
+
}
|
|
4581
|
+
),
|
|
4582
|
+
/* @__PURE__ */ jsx20(
|
|
4583
|
+
DocumentUploadCard,
|
|
4584
|
+
{
|
|
4585
|
+
config: SIGNATURE_CONFIG,
|
|
4586
|
+
onError: (message) => notify("error", message)
|
|
4587
|
+
}
|
|
4588
|
+
)
|
|
4589
|
+
] }) }),
|
|
4590
|
+
/* @__PURE__ */ jsxs16(Dialog3.Footer, { display: "flex", justifyContent: "space-between", children: [
|
|
4591
|
+
/* @__PURE__ */ jsx20(Dialog3.ActionTrigger, { asChild: true, children: /* @__PURE__ */ jsx20(CancelButton2, {}) }),
|
|
4592
|
+
/* @__PURE__ */ jsx20(
|
|
4593
|
+
NextButton,
|
|
4594
|
+
{
|
|
4595
|
+
onClick: () => {
|
|
4596
|
+
if (governmentIdStatus === "uploading" || governmentIdStatus === "processing") {
|
|
4597
|
+
notify("info", "Please wait while we read your ID.");
|
|
4598
|
+
return;
|
|
4599
|
+
}
|
|
4600
|
+
if (governmentIdStatus !== "completed") {
|
|
4601
|
+
notify("error", "Please upload a government-issued ID.");
|
|
4602
|
+
return;
|
|
4603
|
+
}
|
|
4604
|
+
setUploadDialogOpen(false);
|
|
4605
|
+
setReferralDialogOpen(true);
|
|
4606
|
+
}
|
|
4607
|
+
}
|
|
4608
|
+
)
|
|
4609
|
+
] }),
|
|
4610
|
+
/* @__PURE__ */ jsx20(Dialog3.CloseTrigger, { asChild: true, children: /* @__PURE__ */ jsx20(CloseButton3, { size: "sm" }) })
|
|
4611
|
+
] }) })
|
|
4612
|
+
] })
|
|
4613
|
+
]
|
|
4614
|
+
}
|
|
4615
|
+
),
|
|
4616
|
+
/* @__PURE__ */ jsx20(
|
|
4617
|
+
Dialog3.Root,
|
|
4618
|
+
{
|
|
4619
|
+
placement: "center",
|
|
4620
|
+
open: referralDialogOpen,
|
|
4621
|
+
onOpenChange: (details) => setReferralDialogOpen(details.open),
|
|
4622
|
+
size: { mdDown: "full", md: "md" },
|
|
4623
|
+
children: /* @__PURE__ */ jsxs16(Portal4, { children: [
|
|
4624
|
+
/* @__PURE__ */ jsx20(Dialog3.Backdrop, {}),
|
|
4625
|
+
/* @__PURE__ */ jsx20(Dialog3.Positioner, { children: /* @__PURE__ */ jsxs16(Dialog3.Content, { children: [
|
|
4626
|
+
/* @__PURE__ */ jsx20(Dialog3.Header, { children: /* @__PURE__ */ jsx20(Dialog3.Title, { children: "Referral Agent" }) }),
|
|
4627
|
+
/* @__PURE__ */ jsx20(Dialog3.Body, { children: /* @__PURE__ */ jsxs16(VStack7, { align: "stretch", gap: 4, children: [
|
|
4628
|
+
/* @__PURE__ */ jsx20(Body5, { children: "Do you have an referral agent? (optional)" }),
|
|
4629
|
+
/* @__PURE__ */ jsx20(Input4, { placeholder: "Enter agent name" })
|
|
4630
|
+
] }) }),
|
|
4631
|
+
/* @__PURE__ */ jsxs16(Dialog3.Footer, { display: "flex", justifyContent: "space-between", children: [
|
|
4632
|
+
/* @__PURE__ */ jsx20(
|
|
4633
|
+
Button3,
|
|
4634
|
+
{
|
|
4635
|
+
variant: "outline",
|
|
4636
|
+
onClick: () => {
|
|
4637
|
+
setReferralDialogOpen(false);
|
|
4638
|
+
onContinue?.();
|
|
4639
|
+
},
|
|
4640
|
+
children: "Skip"
|
|
4641
|
+
}
|
|
4642
|
+
),
|
|
4643
|
+
/* @__PURE__ */ jsx20(
|
|
4644
|
+
PrimaryMdButton3,
|
|
4645
|
+
{
|
|
4646
|
+
onClick: () => {
|
|
4647
|
+
setReferralDialogOpen(false);
|
|
4648
|
+
onContinue?.();
|
|
4649
|
+
},
|
|
4650
|
+
children: "Continue"
|
|
4651
|
+
}
|
|
4652
|
+
)
|
|
4653
|
+
] }),
|
|
4654
|
+
/* @__PURE__ */ jsx20(Dialog3.CloseTrigger, { asChild: true, children: /* @__PURE__ */ jsx20(CloseButton3, { size: "sm" }) })
|
|
4655
|
+
] }) })
|
|
4656
|
+
] })
|
|
4657
|
+
}
|
|
4658
|
+
)
|
|
4659
|
+
] })
|
|
4660
|
+
]
|
|
4661
|
+
}
|
|
4662
|
+
) });
|
|
4663
|
+
};
|
|
4664
|
+
var GetStarted_default = GetStarted;
|
|
4665
|
+
|
|
3584
4666
|
// src/Generic/BottomQuickActions.tsx
|
|
3585
|
-
import
|
|
4667
|
+
import React7 from "react";
|
|
3586
4668
|
import {
|
|
3587
|
-
Box as
|
|
4669
|
+
Box as Box18,
|
|
3588
4670
|
Drawer,
|
|
3589
|
-
Portal as
|
|
4671
|
+
Portal as Portal5,
|
|
3590
4672
|
HStack as HStack4,
|
|
3591
|
-
VStack as
|
|
3592
|
-
Flex as
|
|
4673
|
+
VStack as VStack8,
|
|
4674
|
+
Flex as Flex9,
|
|
3593
4675
|
Icon as Icon4,
|
|
3594
|
-
CloseButton as
|
|
3595
|
-
Text as
|
|
4676
|
+
CloseButton as CloseButton4,
|
|
4677
|
+
Text as Text10
|
|
3596
4678
|
} from "@chakra-ui/react";
|
|
3597
4679
|
import { LuChevronRight as LuChevronRight2 } from "react-icons/lu";
|
|
3598
4680
|
import Link from "next/link";
|
|
3599
|
-
import { jsx as
|
|
4681
|
+
import { jsx as jsx21, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3600
4682
|
var SHEET_BG = BRAND_COLORS.white;
|
|
3601
4683
|
var DRAG_COLOR = BRAND_COLORS.neutralBorder;
|
|
3602
4684
|
var ITEM_BG = BRAND_COLORS.white;
|
|
@@ -3613,14 +4695,14 @@ var SUBTITLE_COLOR = BRAND_COLORS.grey;
|
|
|
3613
4695
|
var LABEL_COLOR = BRAND_COLORS.neutralText;
|
|
3614
4696
|
var DESC_COLOR = BRAND_COLORS.grey;
|
|
3615
4697
|
var CHEVRON_COLOR = BRAND_COLORS.ashWhite;
|
|
3616
|
-
var QuickActionsHeaderCard =
|
|
4698
|
+
var QuickActionsHeaderCard = React7.memo(
|
|
3617
4699
|
({
|
|
3618
4700
|
initials,
|
|
3619
4701
|
avatarBg = AVATAR_DEFAULT_BG,
|
|
3620
4702
|
label,
|
|
3621
4703
|
meta,
|
|
3622
4704
|
trailing
|
|
3623
|
-
}) => /* @__PURE__ */
|
|
4705
|
+
}) => /* @__PURE__ */ jsxs17(
|
|
3624
4706
|
HStack4,
|
|
3625
4707
|
{
|
|
3626
4708
|
gap: STANDARD_SPACING.sm,
|
|
@@ -3631,8 +4713,8 @@ var QuickActionsHeaderCard = React5.memo(
|
|
|
3631
4713
|
borderWidth: "1px",
|
|
3632
4714
|
borderColor: HEADER_CARD_BORDER,
|
|
3633
4715
|
children: [
|
|
3634
|
-
initials && /* @__PURE__ */
|
|
3635
|
-
|
|
4716
|
+
initials && /* @__PURE__ */ jsx21(
|
|
4717
|
+
Flex9,
|
|
3636
4718
|
{
|
|
3637
4719
|
w: "40px",
|
|
3638
4720
|
h: "40px",
|
|
@@ -3641,8 +4723,8 @@ var QuickActionsHeaderCard = React5.memo(
|
|
|
3641
4723
|
align: "center",
|
|
3642
4724
|
justify: "center",
|
|
3643
4725
|
flexShrink: 0,
|
|
3644
|
-
children: /* @__PURE__ */
|
|
3645
|
-
|
|
4726
|
+
children: /* @__PURE__ */ jsx21(
|
|
4727
|
+
Text10,
|
|
3646
4728
|
{
|
|
3647
4729
|
fontSize: "14px",
|
|
3648
4730
|
fontWeight: "700",
|
|
@@ -3653,9 +4735,9 @@ var QuickActionsHeaderCard = React5.memo(
|
|
|
3653
4735
|
)
|
|
3654
4736
|
}
|
|
3655
4737
|
),
|
|
3656
|
-
/* @__PURE__ */
|
|
3657
|
-
/* @__PURE__ */
|
|
3658
|
-
|
|
4738
|
+
/* @__PURE__ */ jsxs17(Box18, { flex: "1", minW: 0, children: [
|
|
4739
|
+
/* @__PURE__ */ jsx21(
|
|
4740
|
+
Text10,
|
|
3659
4741
|
{
|
|
3660
4742
|
fontSize: "15px",
|
|
3661
4743
|
fontWeight: "700",
|
|
@@ -3667,8 +4749,8 @@ var QuickActionsHeaderCard = React5.memo(
|
|
|
3667
4749
|
children: label
|
|
3668
4750
|
}
|
|
3669
4751
|
),
|
|
3670
|
-
meta && /* @__PURE__ */
|
|
3671
|
-
|
|
4752
|
+
meta && /* @__PURE__ */ jsx21(
|
|
4753
|
+
Text10,
|
|
3672
4754
|
{
|
|
3673
4755
|
fontSize: "12px",
|
|
3674
4756
|
color: SUBTITLE_COLOR,
|
|
@@ -3689,10 +4771,10 @@ var QuickActionsHeaderCard = React5.memo(
|
|
|
3689
4771
|
var ITEM_TRANSITION = {
|
|
3690
4772
|
transition: "background 0.15s ease, transform 0.1s ease"
|
|
3691
4773
|
};
|
|
3692
|
-
var ActionItem =
|
|
4774
|
+
var ActionItem = React7.memo(({ action }) => {
|
|
3693
4775
|
const iconBg = action.iconBg ?? DEFAULT_ICON_BG;
|
|
3694
4776
|
const iconColor = action.iconColor ?? DEFAULT_ICON_COLOR;
|
|
3695
|
-
const inner = /* @__PURE__ */
|
|
4777
|
+
const inner = /* @__PURE__ */ jsxs17(
|
|
3696
4778
|
HStack4,
|
|
3697
4779
|
{
|
|
3698
4780
|
gap: STANDARD_SPACING.sm,
|
|
@@ -3715,8 +4797,8 @@ var ActionItem = React5.memo(({ action }) => {
|
|
|
3715
4797
|
_active: { bg: ITEM_ACTIVE_BG, transform: "scale(0.99)" },
|
|
3716
4798
|
style: ITEM_TRANSITION,
|
|
3717
4799
|
children: [
|
|
3718
|
-
/* @__PURE__ */
|
|
3719
|
-
|
|
4800
|
+
/* @__PURE__ */ jsx21(
|
|
4801
|
+
Flex9,
|
|
3720
4802
|
{
|
|
3721
4803
|
w: "40px",
|
|
3722
4804
|
h: "40px",
|
|
@@ -3725,12 +4807,12 @@ var ActionItem = React5.memo(({ action }) => {
|
|
|
3725
4807
|
align: "center",
|
|
3726
4808
|
justify: "center",
|
|
3727
4809
|
flexShrink: 0,
|
|
3728
|
-
children: /* @__PURE__ */
|
|
4810
|
+
children: /* @__PURE__ */ jsx21(Icon4, { as: action.icon, boxSize: "20px", color: iconColor })
|
|
3729
4811
|
}
|
|
3730
4812
|
),
|
|
3731
|
-
/* @__PURE__ */
|
|
3732
|
-
/* @__PURE__ */
|
|
3733
|
-
|
|
4813
|
+
/* @__PURE__ */ jsxs17(Box18, { flex: "1", minW: 0, children: [
|
|
4814
|
+
/* @__PURE__ */ jsx21(
|
|
4815
|
+
Text10,
|
|
3734
4816
|
{
|
|
3735
4817
|
fontSize: "15px",
|
|
3736
4818
|
fontWeight: "600",
|
|
@@ -3739,8 +4821,8 @@ var ActionItem = React5.memo(({ action }) => {
|
|
|
3739
4821
|
children: action.label
|
|
3740
4822
|
}
|
|
3741
4823
|
),
|
|
3742
|
-
action.description && /* @__PURE__ */
|
|
3743
|
-
|
|
4824
|
+
action.description && /* @__PURE__ */ jsx21(
|
|
4825
|
+
Text10,
|
|
3744
4826
|
{
|
|
3745
4827
|
fontSize: "12px",
|
|
3746
4828
|
color: DESC_COLOR,
|
|
@@ -3753,7 +4835,7 @@ var ActionItem = React5.memo(({ action }) => {
|
|
|
3753
4835
|
}
|
|
3754
4836
|
)
|
|
3755
4837
|
] }),
|
|
3756
|
-
/* @__PURE__ */
|
|
4838
|
+
/* @__PURE__ */ jsx21(
|
|
3757
4839
|
Icon4,
|
|
3758
4840
|
{
|
|
3759
4841
|
as: LuChevronRight2,
|
|
@@ -3766,7 +4848,7 @@ var ActionItem = React5.memo(({ action }) => {
|
|
|
3766
4848
|
}
|
|
3767
4849
|
);
|
|
3768
4850
|
if (action.href) {
|
|
3769
|
-
return /* @__PURE__ */
|
|
4851
|
+
return /* @__PURE__ */ jsx21(
|
|
3770
4852
|
Link,
|
|
3771
4853
|
{
|
|
3772
4854
|
href: action.href,
|
|
@@ -3785,15 +4867,15 @@ var BottomQuickActions = ({
|
|
|
3785
4867
|
headerSlot,
|
|
3786
4868
|
actions
|
|
3787
4869
|
}) => {
|
|
3788
|
-
return /* @__PURE__ */
|
|
4870
|
+
return /* @__PURE__ */ jsx21(
|
|
3789
4871
|
Drawer.Root,
|
|
3790
4872
|
{
|
|
3791
4873
|
open,
|
|
3792
4874
|
onOpenChange: (e) => onOpenChange(e.open),
|
|
3793
4875
|
placement: "bottom",
|
|
3794
|
-
children: /* @__PURE__ */
|
|
3795
|
-
/* @__PURE__ */
|
|
3796
|
-
/* @__PURE__ */
|
|
4876
|
+
children: /* @__PURE__ */ jsxs17(Portal5, { children: [
|
|
4877
|
+
/* @__PURE__ */ jsx21(Drawer.Backdrop, {}),
|
|
4878
|
+
/* @__PURE__ */ jsx21(Drawer.Positioner, { children: /* @__PURE__ */ jsxs17(
|
|
3797
4879
|
Drawer.Content,
|
|
3798
4880
|
{
|
|
3799
4881
|
borderTopRadius: "l3",
|
|
@@ -3804,8 +4886,8 @@ var BottomQuickActions = ({
|
|
|
3804
4886
|
pb: `calc(${STANDARD_SPACING.sm} + env(safe-area-inset-bottom))`,
|
|
3805
4887
|
boxShadow: STANDARD_SHADOWS.level4,
|
|
3806
4888
|
children: [
|
|
3807
|
-
/* @__PURE__ */
|
|
3808
|
-
|
|
4889
|
+
/* @__PURE__ */ jsx21(Flex9, { justify: "center", pt: "10px", pb: "4px", children: /* @__PURE__ */ jsx21(
|
|
4890
|
+
Box18,
|
|
3809
4891
|
{
|
|
3810
4892
|
w: "36px",
|
|
3811
4893
|
h: "4px",
|
|
@@ -3813,16 +4895,16 @@ var BottomQuickActions = ({
|
|
|
3813
4895
|
bg: DRAG_COLOR
|
|
3814
4896
|
}
|
|
3815
4897
|
) }),
|
|
3816
|
-
/* @__PURE__ */
|
|
4898
|
+
/* @__PURE__ */ jsx21(
|
|
3817
4899
|
Drawer.Header,
|
|
3818
4900
|
{
|
|
3819
4901
|
px: STANDARD_SPACING.sm,
|
|
3820
4902
|
pt: "12px",
|
|
3821
4903
|
pb: "0",
|
|
3822
4904
|
borderBottomWidth: "0",
|
|
3823
|
-
children: /* @__PURE__ */
|
|
3824
|
-
/* @__PURE__ */
|
|
3825
|
-
/* @__PURE__ */
|
|
4905
|
+
children: /* @__PURE__ */ jsxs17(Flex9, { align: "flex-start", justify: "space-between", gap: "12px", children: [
|
|
4906
|
+
/* @__PURE__ */ jsxs17(Box18, { flex: "1", minW: 0, children: [
|
|
4907
|
+
/* @__PURE__ */ jsx21(
|
|
3826
4908
|
Drawer.Title,
|
|
3827
4909
|
{
|
|
3828
4910
|
fontSize: "18px",
|
|
@@ -3833,8 +4915,8 @@ var BottomQuickActions = ({
|
|
|
3833
4915
|
children: title
|
|
3834
4916
|
}
|
|
3835
4917
|
),
|
|
3836
|
-
subtitle && /* @__PURE__ */
|
|
3837
|
-
|
|
4918
|
+
subtitle && /* @__PURE__ */ jsx21(
|
|
4919
|
+
Text10,
|
|
3838
4920
|
{
|
|
3839
4921
|
fontSize: "13px",
|
|
3840
4922
|
color: SUBTITLE_COLOR,
|
|
@@ -3845,8 +4927,8 @@ var BottomQuickActions = ({
|
|
|
3845
4927
|
}
|
|
3846
4928
|
)
|
|
3847
4929
|
] }),
|
|
3848
|
-
/* @__PURE__ */
|
|
3849
|
-
|
|
4930
|
+
/* @__PURE__ */ jsx21(Drawer.CloseTrigger, { asChild: true, mt: "2px", flexShrink: 0, children: /* @__PURE__ */ jsx21(
|
|
4931
|
+
CloseButton4,
|
|
3850
4932
|
{
|
|
3851
4933
|
size: "sm",
|
|
3852
4934
|
color: BRAND_COLORS.neutralText,
|
|
@@ -3857,15 +4939,15 @@ var BottomQuickActions = ({
|
|
|
3857
4939
|
] })
|
|
3858
4940
|
}
|
|
3859
4941
|
),
|
|
3860
|
-
/* @__PURE__ */
|
|
4942
|
+
/* @__PURE__ */ jsxs17(
|
|
3861
4943
|
Drawer.Body,
|
|
3862
4944
|
{
|
|
3863
4945
|
px: STANDARD_SPACING.sm,
|
|
3864
4946
|
pt: STANDARD_SPACING.sm,
|
|
3865
4947
|
pb: "4px",
|
|
3866
4948
|
children: [
|
|
3867
|
-
headerSlot && /* @__PURE__ */
|
|
3868
|
-
/* @__PURE__ */
|
|
4949
|
+
headerSlot && /* @__PURE__ */ jsx21(Box18, { mb: STANDARD_SPACING.xs, children: headerSlot }),
|
|
4950
|
+
/* @__PURE__ */ jsx21(VStack8, { gap: STANDARD_SPACING.xs, align: "stretch", children: actions.map((action, i) => /* @__PURE__ */ jsx21(ActionItem, { action }, i)) })
|
|
3869
4951
|
]
|
|
3870
4952
|
}
|
|
3871
4953
|
)
|
|
@@ -3879,18 +4961,18 @@ var BottomQuickActions = ({
|
|
|
3879
4961
|
var BottomQuickActions_default = BottomQuickActions;
|
|
3880
4962
|
|
|
3881
4963
|
// src/Generic/NotifyInstall.tsx
|
|
3882
|
-
import { useEffect as
|
|
3883
|
-
import { Button as
|
|
4964
|
+
import { useEffect as useEffect9, useState as useState16 } from "react";
|
|
4965
|
+
import { Button as Button4, Flex as Flex10, HStack as HStack5, Icon as Icon5, Text as Text11, VStack as VStack9 } from "@chakra-ui/react";
|
|
3884
4966
|
import { AnimatePresence, motion } from "motion/react";
|
|
3885
4967
|
import { FiDownload, FiPlusSquare, FiShare, FiX } from "react-icons/fi";
|
|
3886
4968
|
|
|
3887
4969
|
// src/hooks/useNotifyInstall.ts
|
|
3888
|
-
import { useEffect as
|
|
4970
|
+
import { useEffect as useEffect8, useState as useState15 } from "react";
|
|
3889
4971
|
function useNotifyInstall() {
|
|
3890
|
-
const [isInstalled, setIsInstalled] =
|
|
3891
|
-
const [isMobile, setIsMobile] =
|
|
3892
|
-
const [installPrompt, setInstallPrompt] =
|
|
3893
|
-
|
|
4972
|
+
const [isInstalled, setIsInstalled] = useState15(false);
|
|
4973
|
+
const [isMobile, setIsMobile] = useState15(false);
|
|
4974
|
+
const [installPrompt, setInstallPrompt] = useState15(null);
|
|
4975
|
+
useEffect8(() => {
|
|
3894
4976
|
const mobile = /Android|iPhone|iPad|iPod/i.test(navigator.userAgent);
|
|
3895
4977
|
setIsMobile(mobile);
|
|
3896
4978
|
const installed = window.matchMedia("(display-mode: standalone)").matches || window.navigator.standalone === true;
|
|
@@ -3922,7 +5004,7 @@ function useNotifyInstall() {
|
|
|
3922
5004
|
}
|
|
3923
5005
|
|
|
3924
5006
|
// src/Generic/NotifyInstall.tsx
|
|
3925
|
-
import { Fragment as
|
|
5007
|
+
import { Fragment as Fragment4, jsx as jsx22, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3926
5008
|
var STEPS = [
|
|
3927
5009
|
{ icon: FiShare, label: "Tap the browser menu or Share button" },
|
|
3928
5010
|
{ icon: FiPlusSquare, label: 'Choose "Add to Home Screen"' }
|
|
@@ -3933,8 +5015,8 @@ function NotifyInstall({
|
|
|
3933
5015
|
appName
|
|
3934
5016
|
}) {
|
|
3935
5017
|
const { isInstalled, isMobile, canInstall, install } = useNotifyInstall();
|
|
3936
|
-
const [isDismissed, setIsDismissed] =
|
|
3937
|
-
|
|
5018
|
+
const [isDismissed, setIsDismissed] = useState16(true);
|
|
5019
|
+
useEffect9(() => {
|
|
3938
5020
|
if (localStorage.getItem(DISMISSED_KEY) !== "true") {
|
|
3939
5021
|
setIsDismissed(false);
|
|
3940
5022
|
}
|
|
@@ -3944,10 +5026,10 @@ function NotifyInstall({
|
|
|
3944
5026
|
setIsDismissed(true);
|
|
3945
5027
|
};
|
|
3946
5028
|
const showPrompt = isMobile && !isInstalled && !isDismissed;
|
|
3947
|
-
return /* @__PURE__ */
|
|
5029
|
+
return /* @__PURE__ */ jsxs18(Fragment4, { children: [
|
|
3948
5030
|
children,
|
|
3949
|
-
/* @__PURE__ */
|
|
3950
|
-
/* @__PURE__ */
|
|
5031
|
+
/* @__PURE__ */ jsx22(AnimatePresence, { children: showPrompt && /* @__PURE__ */ jsxs18(Fragment4, { children: [
|
|
5032
|
+
/* @__PURE__ */ jsx22(
|
|
3951
5033
|
motion.div,
|
|
3952
5034
|
{
|
|
3953
5035
|
initial: { opacity: 0 },
|
|
@@ -3966,7 +5048,7 @@ function NotifyInstall({
|
|
|
3966
5048
|
},
|
|
3967
5049
|
"install-backdrop"
|
|
3968
5050
|
),
|
|
3969
|
-
/* @__PURE__ */
|
|
5051
|
+
/* @__PURE__ */ jsxs18(
|
|
3970
5052
|
motion.div,
|
|
3971
5053
|
{
|
|
3972
5054
|
initial: { y: "100%" },
|
|
@@ -3985,7 +5067,7 @@ function NotifyInstall({
|
|
|
3985
5067
|
paddingBottom: "env(safe-area-inset-bottom)"
|
|
3986
5068
|
},
|
|
3987
5069
|
children: [
|
|
3988
|
-
/* @__PURE__ */
|
|
5070
|
+
/* @__PURE__ */ jsx22(
|
|
3989
5071
|
"button",
|
|
3990
5072
|
{
|
|
3991
5073
|
"aria-label": "Dismiss install prompt",
|
|
@@ -4004,12 +5086,12 @@ function NotifyInstall({
|
|
|
4004
5086
|
justifyContent: "center",
|
|
4005
5087
|
color: "#9ca3af"
|
|
4006
5088
|
},
|
|
4007
|
-
children: /* @__PURE__ */
|
|
5089
|
+
children: /* @__PURE__ */ jsx22(FiX, { size: 18 })
|
|
4008
5090
|
}
|
|
4009
5091
|
),
|
|
4010
|
-
/* @__PURE__ */
|
|
4011
|
-
/* @__PURE__ */
|
|
4012
|
-
|
|
5092
|
+
/* @__PURE__ */ jsxs18(VStack9, { gap: 6, textAlign: "center", px: 6, py: 8, children: [
|
|
5093
|
+
/* @__PURE__ */ jsx22(
|
|
5094
|
+
Flex10,
|
|
4013
5095
|
{
|
|
4014
5096
|
boxSize: 16,
|
|
4015
5097
|
align: "center",
|
|
@@ -4018,12 +5100,12 @@ function NotifyInstall({
|
|
|
4018
5100
|
bg: "green.50",
|
|
4019
5101
|
color: "green.600",
|
|
4020
5102
|
shadow: "sm",
|
|
4021
|
-
children: /* @__PURE__ */
|
|
5103
|
+
children: /* @__PURE__ */ jsx22(Icon5, { as: FiDownload, boxSize: 8 })
|
|
4022
5104
|
}
|
|
4023
5105
|
),
|
|
4024
|
-
/* @__PURE__ */
|
|
4025
|
-
/* @__PURE__ */
|
|
4026
|
-
|
|
5106
|
+
/* @__PURE__ */ jsxs18(VStack9, { gap: 2, children: [
|
|
5107
|
+
/* @__PURE__ */ jsxs18(
|
|
5108
|
+
Text11,
|
|
4027
5109
|
{
|
|
4028
5110
|
fontSize: "lg",
|
|
4029
5111
|
fontWeight: "bold",
|
|
@@ -4035,10 +5117,10 @@ function NotifyInstall({
|
|
|
4035
5117
|
]
|
|
4036
5118
|
}
|
|
4037
5119
|
),
|
|
4038
|
-
/* @__PURE__ */
|
|
5120
|
+
/* @__PURE__ */ jsx22(Text11, { fontSize: "sm", color: "gray.500", lineHeight: "tall", children: "Add the app to your home screen for a faster, app-like experience before continuing." })
|
|
4039
5121
|
] }),
|
|
4040
|
-
canInstall ? /* @__PURE__ */
|
|
4041
|
-
|
|
5122
|
+
canInstall ? /* @__PURE__ */ jsxs18(
|
|
5123
|
+
Button4,
|
|
4042
5124
|
{
|
|
4043
5125
|
onClick: install,
|
|
4044
5126
|
colorPalette: "green",
|
|
@@ -4046,12 +5128,12 @@ function NotifyInstall({
|
|
|
4046
5128
|
w: "full",
|
|
4047
5129
|
rounded: "xl",
|
|
4048
5130
|
children: [
|
|
4049
|
-
/* @__PURE__ */
|
|
5131
|
+
/* @__PURE__ */ jsx22(Icon5, { as: FiDownload }),
|
|
4050
5132
|
"Add to Home Screen"
|
|
4051
5133
|
]
|
|
4052
5134
|
}
|
|
4053
|
-
) : /* @__PURE__ */
|
|
4054
|
-
|
|
5135
|
+
) : /* @__PURE__ */ jsx22(
|
|
5136
|
+
VStack9,
|
|
4055
5137
|
{
|
|
4056
5138
|
w: "full",
|
|
4057
5139
|
bg: "gray.50",
|
|
@@ -4061,9 +5143,9 @@ function NotifyInstall({
|
|
|
4061
5143
|
p: 4,
|
|
4062
5144
|
gap: 4,
|
|
4063
5145
|
align: "stretch",
|
|
4064
|
-
children: STEPS.map((step, i) => /* @__PURE__ */
|
|
4065
|
-
/* @__PURE__ */
|
|
4066
|
-
|
|
5146
|
+
children: STEPS.map((step, i) => /* @__PURE__ */ jsxs18(HStack5, { gap: 3, align: "center", children: [
|
|
5147
|
+
/* @__PURE__ */ jsx22(
|
|
5148
|
+
Flex10,
|
|
4067
5149
|
{
|
|
4068
5150
|
boxSize: 9,
|
|
4069
5151
|
flexShrink: 0,
|
|
@@ -4074,10 +5156,10 @@ function NotifyInstall({
|
|
|
4074
5156
|
borderWidth: "1px",
|
|
4075
5157
|
borderColor: "gray.200",
|
|
4076
5158
|
color: "green.600",
|
|
4077
|
-
children: /* @__PURE__ */
|
|
5159
|
+
children: /* @__PURE__ */ jsx22(Icon5, { as: step.icon, boxSize: 4 })
|
|
4078
5160
|
}
|
|
4079
5161
|
),
|
|
4080
|
-
/* @__PURE__ */
|
|
5162
|
+
/* @__PURE__ */ jsx22(Text11, { fontSize: "sm", color: "gray.700", textAlign: "left", children: step.label })
|
|
4081
5163
|
] }, i))
|
|
4082
5164
|
}
|
|
4083
5165
|
)
|
|
@@ -4091,21 +5173,21 @@ function NotifyInstall({
|
|
|
4091
5173
|
}
|
|
4092
5174
|
|
|
4093
5175
|
// src/UserProfile/UserProfile.tsx
|
|
4094
|
-
import { useEffect as
|
|
5176
|
+
import { useEffect as useEffect10, useMemo, useState as useState17 } from "react";
|
|
4095
5177
|
import {
|
|
4096
5178
|
Avatar,
|
|
4097
5179
|
Badge as Badge2,
|
|
4098
|
-
Box as
|
|
4099
|
-
Button as
|
|
4100
|
-
Flex as
|
|
5180
|
+
Box as Box19,
|
|
5181
|
+
Button as Button5,
|
|
5182
|
+
Flex as Flex11,
|
|
4101
5183
|
HStack as HStack6,
|
|
4102
5184
|
IconButton as IconButton3,
|
|
4103
|
-
Input as
|
|
5185
|
+
Input as Input5,
|
|
4104
5186
|
InputGroup,
|
|
4105
5187
|
Separator as Separator3,
|
|
4106
|
-
Text as
|
|
4107
|
-
useBreakpointValue as
|
|
4108
|
-
VStack as
|
|
5188
|
+
Text as Text12,
|
|
5189
|
+
useBreakpointValue as useBreakpointValue3,
|
|
5190
|
+
VStack as VStack10
|
|
4109
5191
|
} from "@chakra-ui/react";
|
|
4110
5192
|
import {
|
|
4111
5193
|
RiDashboardFill,
|
|
@@ -4128,7 +5210,7 @@ import {
|
|
|
4128
5210
|
LuCreditCard,
|
|
4129
5211
|
LuEye,
|
|
4130
5212
|
LuEyeOff,
|
|
4131
|
-
LuFileText,
|
|
5213
|
+
LuFileText as LuFileText2,
|
|
4132
5214
|
LuHouse,
|
|
4133
5215
|
LuLock,
|
|
4134
5216
|
LuMoon,
|
|
@@ -4149,7 +5231,7 @@ import { LiaHandHoldingUsdSolid } from "react-icons/lia";
|
|
|
4149
5231
|
import { FaHandHoldingUsd } from "react-icons/fa";
|
|
4150
5232
|
import { MdManageAccounts, MdOutlineManageAccounts } from "react-icons/md";
|
|
4151
5233
|
import { IoLeaf, IoLeafOutline } from "react-icons/io5";
|
|
4152
|
-
import { Fragment as
|
|
5234
|
+
import { Fragment as Fragment5, jsx as jsx23, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
4153
5235
|
var NAVBAR_STORAGE_KEY = "profile-navbar-quick-items";
|
|
4154
5236
|
var FONT_SIZE_STORAGE_KEY = "profile-font-size-pref";
|
|
4155
5237
|
var DEFAULT_NAV_HREFS = ["/", "/plans", "/pay-my-plan", "/claims"];
|
|
@@ -4192,8 +5274,8 @@ var ALL_NAV_OPTIONS = [
|
|
|
4192
5274
|
key: "/claims",
|
|
4193
5275
|
title: "Claim",
|
|
4194
5276
|
href: "/claims",
|
|
4195
|
-
Icon:
|
|
4196
|
-
activeIcon:
|
|
5277
|
+
Icon: LuFileText2,
|
|
5278
|
+
activeIcon: LuFileText2,
|
|
4197
5279
|
match: (p) => p.startsWith("/claims"),
|
|
4198
5280
|
roles: ["branch", "bmstl", "sales-agent"]
|
|
4199
5281
|
},
|
|
@@ -4447,28 +5529,28 @@ function ReusableProfile({
|
|
|
4447
5529
|
onTwoFactorChange,
|
|
4448
5530
|
onToast = noopToast
|
|
4449
5531
|
}) {
|
|
4450
|
-
const [profileView, setProfileView] =
|
|
4451
|
-
const [fallbackColorMode, setFallbackColorMode] =
|
|
5532
|
+
const [profileView, setProfileView] = useState17("main");
|
|
5533
|
+
const [fallbackColorMode, setFallbackColorMode] = useState17("light");
|
|
4452
5534
|
const colorMode = controlledColorMode ?? fallbackColorMode;
|
|
4453
|
-
const [fontSize, setFontSizeLocal] =
|
|
4454
|
-
const [quickNavHrefs, setQuickNavHrefs] =
|
|
4455
|
-
const [replacingIdx, setReplacingIdx] =
|
|
4456
|
-
const [editName, setEditName] =
|
|
4457
|
-
const [editLoading, setEditLoading] =
|
|
4458
|
-
const [currentPw, setCurrentPw] =
|
|
4459
|
-
const [newPw, setNewPw] =
|
|
4460
|
-
const [confirmPw, setConfirmPw] =
|
|
4461
|
-
const [showCurrentPw, setShowCurrentPw] =
|
|
4462
|
-
const [showNewPw, setShowNewPw] =
|
|
4463
|
-
const [showConfirmPw, setShowConfirmPw] =
|
|
4464
|
-
const [pwLoading, setPwLoading] =
|
|
4465
|
-
const [twoFactorEnabled, setTwoFactorEnabled] =
|
|
5535
|
+
const [fontSize, setFontSizeLocal] = useState17("md");
|
|
5536
|
+
const [quickNavHrefs, setQuickNavHrefs] = useState17(initialQuickNavHrefs);
|
|
5537
|
+
const [replacingIdx, setReplacingIdx] = useState17(null);
|
|
5538
|
+
const [editName, setEditName] = useState17(user.displayName);
|
|
5539
|
+
const [editLoading, setEditLoading] = useState17(false);
|
|
5540
|
+
const [currentPw, setCurrentPw] = useState17("");
|
|
5541
|
+
const [newPw, setNewPw] = useState17("");
|
|
5542
|
+
const [confirmPw, setConfirmPw] = useState17("");
|
|
5543
|
+
const [showCurrentPw, setShowCurrentPw] = useState17(false);
|
|
5544
|
+
const [showNewPw, setShowNewPw] = useState17(false);
|
|
5545
|
+
const [showConfirmPw, setShowConfirmPw] = useState17(false);
|
|
5546
|
+
const [pwLoading, setPwLoading] = useState17(false);
|
|
5547
|
+
const [twoFactorEnabled, setTwoFactorEnabled] = useState17(
|
|
4466
5548
|
initialTwoFactorEnabled
|
|
4467
5549
|
);
|
|
4468
|
-
const [isMounted, setIsMounted] =
|
|
4469
|
-
const isDesktopRaw =
|
|
5550
|
+
const [isMounted, setIsMounted] = useState17(false);
|
|
5551
|
+
const isDesktopRaw = useBreakpointValue3({ base: false, md: true });
|
|
4470
5552
|
const isDesktop = isMounted ? isDesktopRaw ?? false : false;
|
|
4471
|
-
|
|
5553
|
+
useEffect10(() => {
|
|
4472
5554
|
setIsMounted(true);
|
|
4473
5555
|
if (!enableLocalStorage || typeof window === "undefined") return;
|
|
4474
5556
|
setFontSizeLocal(localStorage.getItem(FONT_SIZE_STORAGE_KEY) ?? "md");
|
|
@@ -4479,7 +5561,7 @@ function ReusableProfile({
|
|
|
4479
5561
|
setQuickNavHrefs(initialQuickNavHrefs);
|
|
4480
5562
|
}
|
|
4481
5563
|
}, [enableLocalStorage, initialQuickNavHrefs, storageKey]);
|
|
4482
|
-
|
|
5564
|
+
useEffect10(() => {
|
|
4483
5565
|
setEditName(user.displayName);
|
|
4484
5566
|
}, [user.displayName]);
|
|
4485
5567
|
const availableOptions = useMemo(
|
|
@@ -4610,9 +5692,9 @@ function ReusableProfile({
|
|
|
4610
5692
|
}
|
|
4611
5693
|
};
|
|
4612
5694
|
const roleLabel = user.role ? ROLE_LABELS[user.role] ?? user.role : "";
|
|
4613
|
-
const mainContent = /* @__PURE__ */
|
|
4614
|
-
/* @__PURE__ */
|
|
4615
|
-
|
|
5695
|
+
const mainContent = /* @__PURE__ */ jsxs19(Fragment5, { children: [
|
|
5696
|
+
/* @__PURE__ */ jsxs19(
|
|
5697
|
+
Box19,
|
|
4616
5698
|
{
|
|
4617
5699
|
bg: "var(--chakra-colors-primary)",
|
|
4618
5700
|
pt: 12,
|
|
@@ -4620,7 +5702,7 @@ function ReusableProfile({
|
|
|
4620
5702
|
px: 4,
|
|
4621
5703
|
textAlign: "center",
|
|
4622
5704
|
children: [
|
|
4623
|
-
/* @__PURE__ */
|
|
5705
|
+
/* @__PURE__ */ jsxs19(
|
|
4624
5706
|
Avatar.Root,
|
|
4625
5707
|
{
|
|
4626
5708
|
size: "2xl",
|
|
@@ -4628,13 +5710,13 @@ function ReusableProfile({
|
|
|
4628
5710
|
mb: 4,
|
|
4629
5711
|
colorPalette: pickPalette(user.displayName || "U"),
|
|
4630
5712
|
children: [
|
|
4631
|
-
user.avatarSrc && /* @__PURE__ */
|
|
4632
|
-
/* @__PURE__ */
|
|
5713
|
+
user.avatarSrc && /* @__PURE__ */ jsx23(Avatar.Image, { src: user.avatarSrc, alt: user.displayName }),
|
|
5714
|
+
/* @__PURE__ */ jsx23(Avatar.Fallback, { name: user.displayName })
|
|
4633
5715
|
]
|
|
4634
5716
|
}
|
|
4635
5717
|
),
|
|
4636
|
-
/* @__PURE__ */
|
|
4637
|
-
|
|
5718
|
+
/* @__PURE__ */ jsx23(
|
|
5719
|
+
Text12,
|
|
4638
5720
|
{
|
|
4639
5721
|
color: "white",
|
|
4640
5722
|
fontWeight: "bold",
|
|
@@ -4644,8 +5726,8 @@ function ReusableProfile({
|
|
|
4644
5726
|
children: user.displayName
|
|
4645
5727
|
}
|
|
4646
5728
|
),
|
|
4647
|
-
user.email && /* @__PURE__ */
|
|
4648
|
-
roleLabel && /* @__PURE__ */
|
|
5729
|
+
user.email && /* @__PURE__ */ jsx23(Text12, { color: "rgba(255,255,255,0.75)", fontSize: "sm", mb: 2, children: user.email }),
|
|
5730
|
+
roleLabel && /* @__PURE__ */ jsx23(Box19, { display: "inline-flex", children: /* @__PURE__ */ jsx23(
|
|
4649
5731
|
Badge2,
|
|
4650
5732
|
{
|
|
4651
5733
|
bg: "rgba(255,255,255,0.15)",
|
|
@@ -4662,9 +5744,9 @@ function ReusableProfile({
|
|
|
4662
5744
|
]
|
|
4663
5745
|
}
|
|
4664
5746
|
),
|
|
4665
|
-
/* @__PURE__ */
|
|
4666
|
-
/* @__PURE__ */
|
|
4667
|
-
|
|
5747
|
+
/* @__PURE__ */ jsxs19(Box19, { px: 4, pt: 5, pb: 1, children: [
|
|
5748
|
+
/* @__PURE__ */ jsx23(
|
|
5749
|
+
Text12,
|
|
4668
5750
|
{
|
|
4669
5751
|
fontSize: "xs",
|
|
4670
5752
|
fontWeight: "bold",
|
|
@@ -4675,8 +5757,8 @@ function ReusableProfile({
|
|
|
4675
5757
|
children: "Account"
|
|
4676
5758
|
}
|
|
4677
5759
|
),
|
|
4678
|
-
/* @__PURE__ */
|
|
4679
|
-
|
|
5760
|
+
/* @__PURE__ */ jsx23(
|
|
5761
|
+
Box19,
|
|
4680
5762
|
{
|
|
4681
5763
|
as: "button",
|
|
4682
5764
|
w: "full",
|
|
@@ -4684,8 +5766,8 @@ function ReusableProfile({
|
|
|
4684
5766
|
_hover: { opacity: 0.7 },
|
|
4685
5767
|
transition: "opacity 0.15s",
|
|
4686
5768
|
onClick: () => setProfileView("edit-account"),
|
|
4687
|
-
children: /* @__PURE__ */
|
|
4688
|
-
|
|
5769
|
+
children: /* @__PURE__ */ jsxs19(
|
|
5770
|
+
Flex11,
|
|
4689
5771
|
{
|
|
4690
5772
|
justify: "space-between",
|
|
4691
5773
|
align: "center",
|
|
@@ -4694,9 +5776,9 @@ function ReusableProfile({
|
|
|
4694
5776
|
borderRadius: "lg",
|
|
4695
5777
|
bg: isDesktop && profileView === "edit-account" ? "gray.100" : void 0,
|
|
4696
5778
|
children: [
|
|
4697
|
-
/* @__PURE__ */
|
|
4698
|
-
/* @__PURE__ */
|
|
4699
|
-
|
|
5779
|
+
/* @__PURE__ */ jsxs19(Flex11, { align: "center", gap: 3, children: [
|
|
5780
|
+
/* @__PURE__ */ jsx23(
|
|
5781
|
+
Box19,
|
|
4700
5782
|
{
|
|
4701
5783
|
w: "38px",
|
|
4702
5784
|
h: "38px",
|
|
@@ -4707,23 +5789,23 @@ function ReusableProfile({
|
|
|
4707
5789
|
justifyContent: "center",
|
|
4708
5790
|
color: "gray.600",
|
|
4709
5791
|
flexShrink: 0,
|
|
4710
|
-
children: /* @__PURE__ */
|
|
5792
|
+
children: /* @__PURE__ */ jsx23(LuUser, { size: 16 })
|
|
4711
5793
|
}
|
|
4712
5794
|
),
|
|
4713
|
-
/* @__PURE__ */
|
|
4714
|
-
/* @__PURE__ */
|
|
4715
|
-
/* @__PURE__ */
|
|
5795
|
+
/* @__PURE__ */ jsxs19(Box19, { children: [
|
|
5796
|
+
/* @__PURE__ */ jsx23(Text12, { fontSize: "sm", fontWeight: "semibold", children: "Edit Account" }),
|
|
5797
|
+
/* @__PURE__ */ jsx23(Text12, { fontSize: "xs", color: "gray.500", children: "Update your display name and contact details" })
|
|
4716
5798
|
] })
|
|
4717
5799
|
] }),
|
|
4718
|
-
/* @__PURE__ */
|
|
5800
|
+
/* @__PURE__ */ jsx23(LuChevronRight3, { size: 16, color: "var(--chakra-colors-gray-400)" })
|
|
4719
5801
|
]
|
|
4720
5802
|
}
|
|
4721
5803
|
)
|
|
4722
5804
|
}
|
|
4723
5805
|
),
|
|
4724
|
-
/* @__PURE__ */
|
|
4725
|
-
/* @__PURE__ */
|
|
4726
|
-
|
|
5806
|
+
/* @__PURE__ */ jsx23(Separator3, {}),
|
|
5807
|
+
/* @__PURE__ */ jsx23(
|
|
5808
|
+
Box19,
|
|
4727
5809
|
{
|
|
4728
5810
|
as: "button",
|
|
4729
5811
|
w: "full",
|
|
@@ -4734,8 +5816,8 @@ function ReusableProfile({
|
|
|
4734
5816
|
resetPasswordForm();
|
|
4735
5817
|
setProfileView("change-password");
|
|
4736
5818
|
},
|
|
4737
|
-
children: /* @__PURE__ */
|
|
4738
|
-
|
|
5819
|
+
children: /* @__PURE__ */ jsxs19(
|
|
5820
|
+
Flex11,
|
|
4739
5821
|
{
|
|
4740
5822
|
justify: "space-between",
|
|
4741
5823
|
align: "center",
|
|
@@ -4744,9 +5826,9 @@ function ReusableProfile({
|
|
|
4744
5826
|
borderRadius: "lg",
|
|
4745
5827
|
bg: isDesktop && profileView === "change-password" ? "gray.100" : void 0,
|
|
4746
5828
|
children: [
|
|
4747
|
-
/* @__PURE__ */
|
|
4748
|
-
/* @__PURE__ */
|
|
4749
|
-
|
|
5829
|
+
/* @__PURE__ */ jsxs19(Flex11, { align: "center", gap: 3, children: [
|
|
5830
|
+
/* @__PURE__ */ jsx23(
|
|
5831
|
+
Box19,
|
|
4750
5832
|
{
|
|
4751
5833
|
w: "38px",
|
|
4752
5834
|
h: "38px",
|
|
@@ -4757,25 +5839,25 @@ function ReusableProfile({
|
|
|
4757
5839
|
justifyContent: "center",
|
|
4758
5840
|
color: "gray.600",
|
|
4759
5841
|
flexShrink: 0,
|
|
4760
|
-
children: /* @__PURE__ */
|
|
5842
|
+
children: /* @__PURE__ */ jsx23(LuLock, { size: 16 })
|
|
4761
5843
|
}
|
|
4762
5844
|
),
|
|
4763
|
-
/* @__PURE__ */
|
|
4764
|
-
/* @__PURE__ */
|
|
4765
|
-
/* @__PURE__ */
|
|
5845
|
+
/* @__PURE__ */ jsxs19(Box19, { children: [
|
|
5846
|
+
/* @__PURE__ */ jsx23(Text12, { fontSize: "sm", fontWeight: "semibold", children: "Change Password" }),
|
|
5847
|
+
/* @__PURE__ */ jsx23(Text12, { fontSize: "xs", color: "gray.500", children: "Test locally through the callback prop" })
|
|
4766
5848
|
] })
|
|
4767
5849
|
] }),
|
|
4768
|
-
/* @__PURE__ */
|
|
5850
|
+
/* @__PURE__ */ jsx23(LuChevronRight3, { size: 16, color: "var(--chakra-colors-gray-400)" })
|
|
4769
5851
|
]
|
|
4770
5852
|
}
|
|
4771
5853
|
)
|
|
4772
5854
|
}
|
|
4773
5855
|
),
|
|
4774
|
-
/* @__PURE__ */
|
|
4775
|
-
/* @__PURE__ */
|
|
4776
|
-
/* @__PURE__ */
|
|
4777
|
-
/* @__PURE__ */
|
|
4778
|
-
|
|
5856
|
+
/* @__PURE__ */ jsx23(Separator3, {}),
|
|
5857
|
+
/* @__PURE__ */ jsxs19(Flex11, { justify: "space-between", align: "center", py: 3, children: [
|
|
5858
|
+
/* @__PURE__ */ jsxs19(Flex11, { align: "center", gap: 3, children: [
|
|
5859
|
+
/* @__PURE__ */ jsx23(
|
|
5860
|
+
Box19,
|
|
4779
5861
|
{
|
|
4780
5862
|
w: "38px",
|
|
4781
5863
|
h: "38px",
|
|
@@ -4786,16 +5868,16 @@ function ReusableProfile({
|
|
|
4786
5868
|
justifyContent: "center",
|
|
4787
5869
|
color: "gray.600",
|
|
4788
5870
|
flexShrink: 0,
|
|
4789
|
-
children: /* @__PURE__ */
|
|
5871
|
+
children: /* @__PURE__ */ jsx23(LuShield, { size: 16 })
|
|
4790
5872
|
}
|
|
4791
5873
|
),
|
|
4792
|
-
/* @__PURE__ */
|
|
4793
|
-
/* @__PURE__ */
|
|
4794
|
-
/* @__PURE__ */
|
|
5874
|
+
/* @__PURE__ */ jsxs19(Box19, { children: [
|
|
5875
|
+
/* @__PURE__ */ jsx23(Text12, { fontSize: "sm", fontWeight: "semibold", children: "Two Factor Authentication" }),
|
|
5876
|
+
/* @__PURE__ */ jsx23(Text12, { fontSize: "xs", color: "gray.500", children: twoFactorEnabled ? "Enabled" : "Disabled" })
|
|
4795
5877
|
] })
|
|
4796
5878
|
] }),
|
|
4797
|
-
/* @__PURE__ */
|
|
4798
|
-
|
|
5879
|
+
/* @__PURE__ */ jsx23(
|
|
5880
|
+
Box19,
|
|
4799
5881
|
{
|
|
4800
5882
|
role: "switch",
|
|
4801
5883
|
"aria-checked": twoFactorEnabled,
|
|
@@ -4817,8 +5899,8 @@ function ReusableProfile({
|
|
|
4817
5899
|
cursor: "pointer",
|
|
4818
5900
|
flexShrink: 0,
|
|
4819
5901
|
outline: "none",
|
|
4820
|
-
children: /* @__PURE__ */
|
|
4821
|
-
|
|
5902
|
+
children: /* @__PURE__ */ jsx23(
|
|
5903
|
+
Box19,
|
|
4822
5904
|
{
|
|
4823
5905
|
position: "absolute",
|
|
4824
5906
|
top: "3px",
|
|
@@ -4835,9 +5917,9 @@ function ReusableProfile({
|
|
|
4835
5917
|
)
|
|
4836
5918
|
] })
|
|
4837
5919
|
] }),
|
|
4838
|
-
/* @__PURE__ */
|
|
4839
|
-
/* @__PURE__ */
|
|
4840
|
-
|
|
5920
|
+
/* @__PURE__ */ jsxs19(Box19, { px: 4, pt: 4, pb: 2, children: [
|
|
5921
|
+
/* @__PURE__ */ jsx23(
|
|
5922
|
+
Text12,
|
|
4841
5923
|
{
|
|
4842
5924
|
fontSize: "xs",
|
|
4843
5925
|
fontWeight: "bold",
|
|
@@ -4848,10 +5930,10 @@ function ReusableProfile({
|
|
|
4848
5930
|
children: "Preferences"
|
|
4849
5931
|
}
|
|
4850
5932
|
),
|
|
4851
|
-
/* @__PURE__ */
|
|
4852
|
-
/* @__PURE__ */
|
|
4853
|
-
/* @__PURE__ */
|
|
4854
|
-
|
|
5933
|
+
/* @__PURE__ */ jsxs19(Flex11, { justify: "space-between", align: "center", py: 3, children: [
|
|
5934
|
+
/* @__PURE__ */ jsxs19(Flex11, { align: "center", gap: 3, children: [
|
|
5935
|
+
/* @__PURE__ */ jsx23(
|
|
5936
|
+
Box19,
|
|
4855
5937
|
{
|
|
4856
5938
|
w: "38px",
|
|
4857
5939
|
h: "38px",
|
|
@@ -4862,18 +5944,18 @@ function ReusableProfile({
|
|
|
4862
5944
|
justifyContent: "center",
|
|
4863
5945
|
color: "gray.600",
|
|
4864
5946
|
flexShrink: 0,
|
|
4865
|
-
children: colorMode === "dark" ? /* @__PURE__ */
|
|
5947
|
+
children: colorMode === "dark" ? /* @__PURE__ */ jsx23(LuMoon, { size: 16 }) : /* @__PURE__ */ jsx23(LuSun, { size: 16 })
|
|
4866
5948
|
}
|
|
4867
5949
|
),
|
|
4868
|
-
/* @__PURE__ */
|
|
4869
|
-
/* @__PURE__ */
|
|
4870
|
-
/* @__PURE__ */
|
|
5950
|
+
/* @__PURE__ */ jsxs19(Box19, { children: [
|
|
5951
|
+
/* @__PURE__ */ jsx23(Text12, { fontSize: "sm", fontWeight: "semibold", children: "Appearance" }),
|
|
5952
|
+
/* @__PURE__ */ jsx23(Text12, { fontSize: "xs", color: "gray.500", children: colorMode === "light" ? "Light mode" : "Dark mode" })
|
|
4871
5953
|
] })
|
|
4872
5954
|
] }),
|
|
4873
|
-
/* @__PURE__ */
|
|
5955
|
+
/* @__PURE__ */ jsx23(HStack6, { gap: 1.5, children: ["light", "dark"].map((mode) => {
|
|
4874
5956
|
const isActive = colorMode === mode;
|
|
4875
|
-
return /* @__PURE__ */
|
|
4876
|
-
|
|
5957
|
+
return /* @__PURE__ */ jsxs19(
|
|
5958
|
+
Button5,
|
|
4877
5959
|
{
|
|
4878
5960
|
size: "sm",
|
|
4879
5961
|
variant: "outline",
|
|
@@ -4888,9 +5970,9 @@ function ReusableProfile({
|
|
|
4888
5970
|
},
|
|
4889
5971
|
onClick: () => handleColorMode(mode),
|
|
4890
5972
|
children: [
|
|
4891
|
-
mode === "light" ? /* @__PURE__ */
|
|
4892
|
-
/* @__PURE__ */
|
|
4893
|
-
|
|
5973
|
+
mode === "light" ? /* @__PURE__ */ jsx23(LuSun, { size: 13 }) : /* @__PURE__ */ jsx23(LuMoon, { size: 13 }),
|
|
5974
|
+
/* @__PURE__ */ jsx23(
|
|
5975
|
+
Text12,
|
|
4894
5976
|
{
|
|
4895
5977
|
fontSize: "xs",
|
|
4896
5978
|
textTransform: "capitalize",
|
|
@@ -4904,11 +5986,11 @@ function ReusableProfile({
|
|
|
4904
5986
|
);
|
|
4905
5987
|
}) })
|
|
4906
5988
|
] }),
|
|
4907
|
-
/* @__PURE__ */
|
|
4908
|
-
/* @__PURE__ */
|
|
4909
|
-
/* @__PURE__ */
|
|
4910
|
-
/* @__PURE__ */
|
|
4911
|
-
|
|
5989
|
+
/* @__PURE__ */ jsx23(Separator3, {}),
|
|
5990
|
+
/* @__PURE__ */ jsxs19(Flex11, { justify: "space-between", align: "center", py: 3, children: [
|
|
5991
|
+
/* @__PURE__ */ jsxs19(Flex11, { align: "center", gap: 3, children: [
|
|
5992
|
+
/* @__PURE__ */ jsx23(
|
|
5993
|
+
Box19,
|
|
4912
5994
|
{
|
|
4913
5995
|
w: "38px",
|
|
4914
5996
|
h: "38px",
|
|
@@ -4924,15 +6006,15 @@ function ReusableProfile({
|
|
|
4924
6006
|
children: "A"
|
|
4925
6007
|
}
|
|
4926
6008
|
),
|
|
4927
|
-
/* @__PURE__ */
|
|
4928
|
-
/* @__PURE__ */
|
|
4929
|
-
/* @__PURE__ */
|
|
6009
|
+
/* @__PURE__ */ jsxs19(Box19, { children: [
|
|
6010
|
+
/* @__PURE__ */ jsx23(Text12, { fontSize: "sm", fontWeight: "semibold", children: "Text Size" }),
|
|
6011
|
+
/* @__PURE__ */ jsx23(Text12, { fontSize: "xs", color: "gray.500", children: fontSizeLabel })
|
|
4930
6012
|
] })
|
|
4931
6013
|
] }),
|
|
4932
|
-
/* @__PURE__ */
|
|
6014
|
+
/* @__PURE__ */ jsx23(HStack6, { gap: 1, children: FONT_SIZES.map((option) => {
|
|
4933
6015
|
const isActive = fontSize === option.value;
|
|
4934
|
-
return /* @__PURE__ */
|
|
4935
|
-
|
|
6016
|
+
return /* @__PURE__ */ jsx23(
|
|
6017
|
+
Button5,
|
|
4936
6018
|
{
|
|
4937
6019
|
size: "sm",
|
|
4938
6020
|
variant: "outline",
|
|
@@ -4947,8 +6029,8 @@ function ReusableProfile({
|
|
|
4947
6029
|
},
|
|
4948
6030
|
onClick: () => handleFontSize(option.value),
|
|
4949
6031
|
title: option.title,
|
|
4950
|
-
children: /* @__PURE__ */
|
|
4951
|
-
|
|
6032
|
+
children: /* @__PURE__ */ jsx23(
|
|
6033
|
+
Text12,
|
|
4952
6034
|
{
|
|
4953
6035
|
fontWeight: isActive ? "bold" : "normal",
|
|
4954
6036
|
style: { fontSize: `${option.scale * 13}px` },
|
|
@@ -4960,9 +6042,9 @@ function ReusableProfile({
|
|
|
4960
6042
|
);
|
|
4961
6043
|
}) })
|
|
4962
6044
|
] }),
|
|
4963
|
-
/* @__PURE__ */
|
|
4964
|
-
/* @__PURE__ */
|
|
4965
|
-
|
|
6045
|
+
/* @__PURE__ */ jsx23(Separator3, {}),
|
|
6046
|
+
/* @__PURE__ */ jsx23(
|
|
6047
|
+
Box19,
|
|
4966
6048
|
{
|
|
4967
6049
|
as: "button",
|
|
4968
6050
|
w: "full",
|
|
@@ -4970,10 +6052,10 @@ function ReusableProfile({
|
|
|
4970
6052
|
_hover: { opacity: 0.7 },
|
|
4971
6053
|
transition: "opacity 0.15s",
|
|
4972
6054
|
onClick: () => setProfileView("navbar-customize"),
|
|
4973
|
-
children: /* @__PURE__ */
|
|
4974
|
-
/* @__PURE__ */
|
|
4975
|
-
/* @__PURE__ */
|
|
4976
|
-
|
|
6055
|
+
children: /* @__PURE__ */ jsxs19(Flex11, { justify: "space-between", align: "center", py: 3, children: [
|
|
6056
|
+
/* @__PURE__ */ jsxs19(Flex11, { align: "center", gap: 3, children: [
|
|
6057
|
+
/* @__PURE__ */ jsx23(
|
|
6058
|
+
Box19,
|
|
4977
6059
|
{
|
|
4978
6060
|
w: "38px",
|
|
4979
6061
|
h: "38px",
|
|
@@ -4984,12 +6066,12 @@ function ReusableProfile({
|
|
|
4984
6066
|
justifyContent: "center",
|
|
4985
6067
|
color: "gray.600",
|
|
4986
6068
|
flexShrink: 0,
|
|
4987
|
-
children: /* @__PURE__ */
|
|
6069
|
+
children: /* @__PURE__ */ jsx23(LuArrowLeftRight, { size: 16 })
|
|
4988
6070
|
}
|
|
4989
6071
|
),
|
|
4990
|
-
/* @__PURE__ */
|
|
4991
|
-
/* @__PURE__ */
|
|
4992
|
-
/* @__PURE__ */
|
|
6072
|
+
/* @__PURE__ */ jsxs19(Box19, { children: [
|
|
6073
|
+
/* @__PURE__ */ jsx23(Text12, { fontSize: "sm", fontWeight: "semibold", children: "Quick Navigation" }),
|
|
6074
|
+
/* @__PURE__ */ jsxs19(Text12, { fontSize: "xs", color: "gray.500", children: [
|
|
4993
6075
|
quickNavHrefs.length,
|
|
4994
6076
|
" of ",
|
|
4995
6077
|
maxQuickNavItems,
|
|
@@ -4997,13 +6079,13 @@ function ReusableProfile({
|
|
|
4997
6079
|
] })
|
|
4998
6080
|
] })
|
|
4999
6081
|
] }),
|
|
5000
|
-
/* @__PURE__ */
|
|
6082
|
+
/* @__PURE__ */ jsx23(LuChevronRight3, { size: 16, color: "var(--chakra-colors-gray-400)" })
|
|
5001
6083
|
] })
|
|
5002
6084
|
}
|
|
5003
6085
|
)
|
|
5004
6086
|
] }),
|
|
5005
|
-
/* @__PURE__ */
|
|
5006
|
-
|
|
6087
|
+
/* @__PURE__ */ jsx23(Box19, { px: 4, pt: 4, pb: 10, children: /* @__PURE__ */ jsx23(VStack10, { gap: 2.5, children: /* @__PURE__ */ jsx23(
|
|
6088
|
+
Button5,
|
|
5007
6089
|
{
|
|
5008
6090
|
w: "full",
|
|
5009
6091
|
variant: "outline",
|
|
@@ -5015,9 +6097,9 @@ function ReusableProfile({
|
|
|
5015
6097
|
}
|
|
5016
6098
|
) }) })
|
|
5017
6099
|
] });
|
|
5018
|
-
const editAccountContent = /* @__PURE__ */
|
|
5019
|
-
/* @__PURE__ */
|
|
5020
|
-
/* @__PURE__ */
|
|
6100
|
+
const editAccountContent = /* @__PURE__ */ jsxs19(Fragment5, { children: [
|
|
6101
|
+
/* @__PURE__ */ jsx23(Box19, { px: 4, pt: 4, pb: 3, borderBottomWidth: "1px", borderColor: "gray.200", children: /* @__PURE__ */ jsxs19(Flex11, { align: "center", gap: 2, pr: 10, children: [
|
|
6102
|
+
/* @__PURE__ */ jsx23(
|
|
5021
6103
|
IconButton3,
|
|
5022
6104
|
{
|
|
5023
6105
|
size: "sm",
|
|
@@ -5025,20 +6107,20 @@ function ReusableProfile({
|
|
|
5025
6107
|
"aria-label": "Back",
|
|
5026
6108
|
color: "gray.600",
|
|
5027
6109
|
onClick: () => setProfileView("main"),
|
|
5028
|
-
children: /* @__PURE__ */
|
|
6110
|
+
children: /* @__PURE__ */ jsx23(LuChevronLeft2, {})
|
|
5029
6111
|
}
|
|
5030
6112
|
),
|
|
5031
|
-
/* @__PURE__ */
|
|
6113
|
+
/* @__PURE__ */ jsx23(Text12, { fontWeight: "bold", fontSize: "md", children: "Edit Account" })
|
|
5032
6114
|
] }) }),
|
|
5033
|
-
/* @__PURE__ */
|
|
5034
|
-
user.avatarSrc && /* @__PURE__ */
|
|
5035
|
-
/* @__PURE__ */
|
|
6115
|
+
/* @__PURE__ */ jsx23(Box19, { textAlign: "center", pt: 5, pb: 4, children: /* @__PURE__ */ jsxs19(Avatar.Root, { size: "xl", mx: "auto", mb: 1, children: [
|
|
6116
|
+
user.avatarSrc && /* @__PURE__ */ jsx23(Avatar.Image, { src: user.avatarSrc, alt: editName }),
|
|
6117
|
+
/* @__PURE__ */ jsx23(Avatar.Fallback, { name: editName })
|
|
5036
6118
|
] }) }),
|
|
5037
|
-
/* @__PURE__ */
|
|
5038
|
-
/* @__PURE__ */
|
|
5039
|
-
/* @__PURE__ */
|
|
5040
|
-
/* @__PURE__ */
|
|
5041
|
-
|
|
6119
|
+
/* @__PURE__ */ jsxs19(VStack10, { gap: 4, px: 4, pb: 10, align: "stretch", children: [
|
|
6120
|
+
/* @__PURE__ */ jsxs19(Box19, { w: "full", children: [
|
|
6121
|
+
/* @__PURE__ */ jsx23(Text12, { fontSize: "xs", fontWeight: "semibold", color: "gray.500", mb: 1.5, children: "Display Name" }),
|
|
6122
|
+
/* @__PURE__ */ jsx23(
|
|
6123
|
+
Input5,
|
|
5042
6124
|
{
|
|
5043
6125
|
value: editName,
|
|
5044
6126
|
onChange: (event) => setEditName(event.target.value),
|
|
@@ -5047,10 +6129,10 @@ function ReusableProfile({
|
|
|
5047
6129
|
}
|
|
5048
6130
|
)
|
|
5049
6131
|
] }),
|
|
5050
|
-
/* @__PURE__ */
|
|
5051
|
-
/* @__PURE__ */
|
|
5052
|
-
/* @__PURE__ */
|
|
5053
|
-
|
|
6132
|
+
/* @__PURE__ */ jsxs19(Box19, { w: "full", children: [
|
|
6133
|
+
/* @__PURE__ */ jsx23(Text12, { fontSize: "xs", fontWeight: "semibold", color: "gray.500", mb: 1.5, children: "Email" }),
|
|
6134
|
+
/* @__PURE__ */ jsx23(
|
|
6135
|
+
Input5,
|
|
5054
6136
|
{
|
|
5055
6137
|
value: user.email ?? "",
|
|
5056
6138
|
readOnly: true,
|
|
@@ -5060,10 +6142,10 @@ function ReusableProfile({
|
|
|
5060
6142
|
}
|
|
5061
6143
|
)
|
|
5062
6144
|
] }),
|
|
5063
|
-
/* @__PURE__ */
|
|
5064
|
-
/* @__PURE__ */
|
|
5065
|
-
/* @__PURE__ */
|
|
5066
|
-
|
|
6145
|
+
/* @__PURE__ */ jsxs19(Box19, { w: "full", children: [
|
|
6146
|
+
/* @__PURE__ */ jsx23(Text12, { fontSize: "xs", fontWeight: "semibold", color: "gray.500", mb: 1.5, children: "Mobile Number" }),
|
|
6147
|
+
/* @__PURE__ */ jsx23(
|
|
6148
|
+
Input5,
|
|
5067
6149
|
{
|
|
5068
6150
|
value: user.mobileNumber ?? "",
|
|
5069
6151
|
readOnly: true,
|
|
@@ -5073,8 +6155,8 @@ function ReusableProfile({
|
|
|
5073
6155
|
}
|
|
5074
6156
|
)
|
|
5075
6157
|
] }),
|
|
5076
|
-
/* @__PURE__ */
|
|
5077
|
-
|
|
6158
|
+
/* @__PURE__ */ jsx23(
|
|
6159
|
+
Button5,
|
|
5078
6160
|
{
|
|
5079
6161
|
w: "full",
|
|
5080
6162
|
mt: 2,
|
|
@@ -5088,9 +6170,9 @@ function ReusableProfile({
|
|
|
5088
6170
|
)
|
|
5089
6171
|
] })
|
|
5090
6172
|
] });
|
|
5091
|
-
const changePasswordContent = /* @__PURE__ */
|
|
5092
|
-
/* @__PURE__ */
|
|
5093
|
-
/* @__PURE__ */
|
|
6173
|
+
const changePasswordContent = /* @__PURE__ */ jsxs19(Fragment5, { children: [
|
|
6174
|
+
/* @__PURE__ */ jsx23(Box19, { px: 4, pt: 4, pb: 3, borderBottomWidth: "1px", borderColor: "gray.200", children: /* @__PURE__ */ jsxs19(Flex11, { align: "center", gap: 2, pr: 10, children: [
|
|
6175
|
+
/* @__PURE__ */ jsx23(
|
|
5094
6176
|
IconButton3,
|
|
5095
6177
|
{
|
|
5096
6178
|
size: "sm",
|
|
@@ -5098,18 +6180,18 @@ function ReusableProfile({
|
|
|
5098
6180
|
"aria-label": "Back",
|
|
5099
6181
|
color: "gray.600",
|
|
5100
6182
|
onClick: () => setProfileView("main"),
|
|
5101
|
-
children: /* @__PURE__ */
|
|
6183
|
+
children: /* @__PURE__ */ jsx23(LuChevronLeft2, {})
|
|
5102
6184
|
}
|
|
5103
6185
|
),
|
|
5104
|
-
/* @__PURE__ */
|
|
6186
|
+
/* @__PURE__ */ jsx23(Text12, { fontWeight: "bold", fontSize: "md", children: "Change Password" })
|
|
5105
6187
|
] }) }),
|
|
5106
|
-
/* @__PURE__ */
|
|
5107
|
-
/* @__PURE__ */
|
|
5108
|
-
/* @__PURE__ */
|
|
5109
|
-
/* @__PURE__ */
|
|
6188
|
+
/* @__PURE__ */ jsxs19(VStack10, { gap: 5, px: 4, pt: 6, pb: 10, children: [
|
|
6189
|
+
/* @__PURE__ */ jsxs19(Box19, { w: "full", children: [
|
|
6190
|
+
/* @__PURE__ */ jsx23(Text12, { fontSize: "xs", fontWeight: "semibold", color: "gray.500", mb: 1.5, children: "Current Password" }),
|
|
6191
|
+
/* @__PURE__ */ jsx23(
|
|
5110
6192
|
InputGroup,
|
|
5111
6193
|
{
|
|
5112
|
-
endElement: /* @__PURE__ */
|
|
6194
|
+
endElement: /* @__PURE__ */ jsx23(
|
|
5113
6195
|
IconButton3,
|
|
5114
6196
|
{
|
|
5115
6197
|
size: "xs",
|
|
@@ -5117,11 +6199,11 @@ function ReusableProfile({
|
|
|
5117
6199
|
color: "gray.500",
|
|
5118
6200
|
"aria-label": "Toggle current password visibility",
|
|
5119
6201
|
onClick: () => setShowCurrentPw(!showCurrentPw),
|
|
5120
|
-
children: showCurrentPw ? /* @__PURE__ */
|
|
6202
|
+
children: showCurrentPw ? /* @__PURE__ */ jsx23(LuEyeOff, { size: 15 }) : /* @__PURE__ */ jsx23(LuEye, { size: 15 })
|
|
5121
6203
|
}
|
|
5122
6204
|
),
|
|
5123
|
-
children: /* @__PURE__ */
|
|
5124
|
-
|
|
6205
|
+
children: /* @__PURE__ */ jsx23(
|
|
6206
|
+
Input5,
|
|
5125
6207
|
{
|
|
5126
6208
|
type: showCurrentPw ? "text" : "password",
|
|
5127
6209
|
value: currentPw,
|
|
@@ -5133,12 +6215,12 @@ function ReusableProfile({
|
|
|
5133
6215
|
}
|
|
5134
6216
|
)
|
|
5135
6217
|
] }),
|
|
5136
|
-
/* @__PURE__ */
|
|
5137
|
-
/* @__PURE__ */
|
|
5138
|
-
/* @__PURE__ */
|
|
6218
|
+
/* @__PURE__ */ jsxs19(Box19, { w: "full", children: [
|
|
6219
|
+
/* @__PURE__ */ jsx23(Text12, { fontSize: "xs", fontWeight: "semibold", color: "gray.500", mb: 1.5, children: "New Password" }),
|
|
6220
|
+
/* @__PURE__ */ jsx23(
|
|
5139
6221
|
InputGroup,
|
|
5140
6222
|
{
|
|
5141
|
-
endElement: /* @__PURE__ */
|
|
6223
|
+
endElement: /* @__PURE__ */ jsx23(
|
|
5142
6224
|
IconButton3,
|
|
5143
6225
|
{
|
|
5144
6226
|
size: "xs",
|
|
@@ -5146,11 +6228,11 @@ function ReusableProfile({
|
|
|
5146
6228
|
color: "gray.500",
|
|
5147
6229
|
"aria-label": "Toggle new password visibility",
|
|
5148
6230
|
onClick: () => setShowNewPw(!showNewPw),
|
|
5149
|
-
children: showNewPw ? /* @__PURE__ */
|
|
6231
|
+
children: showNewPw ? /* @__PURE__ */ jsx23(LuEyeOff, { size: 15 }) : /* @__PURE__ */ jsx23(LuEye, { size: 15 })
|
|
5150
6232
|
}
|
|
5151
6233
|
),
|
|
5152
|
-
children: /* @__PURE__ */
|
|
5153
|
-
|
|
6234
|
+
children: /* @__PURE__ */ jsx23(
|
|
6235
|
+
Input5,
|
|
5154
6236
|
{
|
|
5155
6237
|
type: showNewPw ? "text" : "password",
|
|
5156
6238
|
value: newPw,
|
|
@@ -5161,9 +6243,9 @@ function ReusableProfile({
|
|
|
5161
6243
|
)
|
|
5162
6244
|
}
|
|
5163
6245
|
),
|
|
5164
|
-
newPw && /* @__PURE__ */
|
|
5165
|
-
/* @__PURE__ */
|
|
5166
|
-
|
|
6246
|
+
newPw && /* @__PURE__ */ jsxs19(Box19, { mt: 2, children: [
|
|
6247
|
+
/* @__PURE__ */ jsx23(Flex11, { gap: 1, mb: 1, children: [1, 2, 3, 4, 5].map((i) => /* @__PURE__ */ jsx23(
|
|
6248
|
+
Box19,
|
|
5167
6249
|
{
|
|
5168
6250
|
flex: 1,
|
|
5169
6251
|
h: "3px",
|
|
@@ -5173,15 +6255,15 @@ function ReusableProfile({
|
|
|
5173
6255
|
},
|
|
5174
6256
|
i
|
|
5175
6257
|
)) }),
|
|
5176
|
-
/* @__PURE__ */
|
|
6258
|
+
/* @__PURE__ */ jsx23(Text12, { fontSize: "xs", color: pwMeta.color, fontWeight: "medium", children: pwMeta.label })
|
|
5177
6259
|
] })
|
|
5178
6260
|
] }),
|
|
5179
|
-
/* @__PURE__ */
|
|
5180
|
-
/* @__PURE__ */
|
|
5181
|
-
/* @__PURE__ */
|
|
6261
|
+
/* @__PURE__ */ jsxs19(Box19, { w: "full", children: [
|
|
6262
|
+
/* @__PURE__ */ jsx23(Text12, { fontSize: "xs", fontWeight: "semibold", color: "gray.500", mb: 1.5, children: "Confirm New Password" }),
|
|
6263
|
+
/* @__PURE__ */ jsx23(
|
|
5182
6264
|
InputGroup,
|
|
5183
6265
|
{
|
|
5184
|
-
endElement: /* @__PURE__ */
|
|
6266
|
+
endElement: /* @__PURE__ */ jsx23(
|
|
5185
6267
|
IconButton3,
|
|
5186
6268
|
{
|
|
5187
6269
|
size: "xs",
|
|
@@ -5189,11 +6271,11 @@ function ReusableProfile({
|
|
|
5189
6271
|
color: "gray.500",
|
|
5190
6272
|
"aria-label": "Toggle confirm password visibility",
|
|
5191
6273
|
onClick: () => setShowConfirmPw(!showConfirmPw),
|
|
5192
|
-
children: showConfirmPw ? /* @__PURE__ */
|
|
6274
|
+
children: showConfirmPw ? /* @__PURE__ */ jsx23(LuEyeOff, { size: 15 }) : /* @__PURE__ */ jsx23(LuEye, { size: 15 })
|
|
5193
6275
|
}
|
|
5194
6276
|
),
|
|
5195
|
-
children: /* @__PURE__ */
|
|
5196
|
-
|
|
6277
|
+
children: /* @__PURE__ */ jsx23(
|
|
6278
|
+
Input5,
|
|
5197
6279
|
{
|
|
5198
6280
|
type: showConfirmPw ? "text" : "password",
|
|
5199
6281
|
value: confirmPw,
|
|
@@ -5204,10 +6286,10 @@ function ReusableProfile({
|
|
|
5204
6286
|
)
|
|
5205
6287
|
}
|
|
5206
6288
|
),
|
|
5207
|
-
confirmPw && confirmPw !== newPw && /* @__PURE__ */
|
|
6289
|
+
confirmPw && confirmPw !== newPw && /* @__PURE__ */ jsx23(Text12, { fontSize: "xs", color: "red.500", mt: 1, children: "Passwords do not match" })
|
|
5208
6290
|
] }),
|
|
5209
|
-
/* @__PURE__ */
|
|
5210
|
-
|
|
6291
|
+
/* @__PURE__ */ jsx23(
|
|
6292
|
+
Button5,
|
|
5211
6293
|
{
|
|
5212
6294
|
w: "full",
|
|
5213
6295
|
mt: 1,
|
|
@@ -5222,9 +6304,9 @@ function ReusableProfile({
|
|
|
5222
6304
|
)
|
|
5223
6305
|
] })
|
|
5224
6306
|
] });
|
|
5225
|
-
const navbarCustomizeContent = /* @__PURE__ */
|
|
5226
|
-
/* @__PURE__ */
|
|
5227
|
-
|
|
6307
|
+
const navbarCustomizeContent = /* @__PURE__ */ jsxs19(Fragment5, { children: [
|
|
6308
|
+
/* @__PURE__ */ jsx23(
|
|
6309
|
+
Box19,
|
|
5228
6310
|
{
|
|
5229
6311
|
px: 4,
|
|
5230
6312
|
pt: 4,
|
|
@@ -5235,8 +6317,8 @@ function ReusableProfile({
|
|
|
5235
6317
|
top: 0,
|
|
5236
6318
|
bg: "bg",
|
|
5237
6319
|
zIndex: 1,
|
|
5238
|
-
children: /* @__PURE__ */
|
|
5239
|
-
/* @__PURE__ */
|
|
6320
|
+
children: /* @__PURE__ */ jsxs19(Flex11, { align: "center", gap: 2, pr: 10, children: [
|
|
6321
|
+
/* @__PURE__ */ jsx23(
|
|
5240
6322
|
IconButton3,
|
|
5241
6323
|
{
|
|
5242
6324
|
size: "sm",
|
|
@@ -5247,12 +6329,12 @@ function ReusableProfile({
|
|
|
5247
6329
|
setReplacingIdx(null);
|
|
5248
6330
|
setProfileView("main");
|
|
5249
6331
|
},
|
|
5250
|
-
children: /* @__PURE__ */
|
|
6332
|
+
children: /* @__PURE__ */ jsx23(LuChevronLeft2, {})
|
|
5251
6333
|
}
|
|
5252
6334
|
),
|
|
5253
|
-
/* @__PURE__ */
|
|
5254
|
-
/* @__PURE__ */
|
|
5255
|
-
/* @__PURE__ */
|
|
6335
|
+
/* @__PURE__ */ jsxs19(Box19, { children: [
|
|
6336
|
+
/* @__PURE__ */ jsx23(Text12, { fontWeight: "bold", fontSize: "md", children: "Quick Navigation" }),
|
|
6337
|
+
/* @__PURE__ */ jsxs19(Text12, { fontSize: "xs", color: "gray.500", children: [
|
|
5256
6338
|
"Choose up to ",
|
|
5257
6339
|
maxQuickNavItems,
|
|
5258
6340
|
" shortcuts for the bottom bar"
|
|
@@ -5261,10 +6343,10 @@ function ReusableProfile({
|
|
|
5261
6343
|
] })
|
|
5262
6344
|
}
|
|
5263
6345
|
),
|
|
5264
|
-
/* @__PURE__ */
|
|
5265
|
-
/* @__PURE__ */
|
|
5266
|
-
/* @__PURE__ */
|
|
5267
|
-
|
|
6346
|
+
/* @__PURE__ */ jsxs19(Box19, { px: 4, pt: 5, pb: 2, children: [
|
|
6347
|
+
/* @__PURE__ */ jsxs19(Flex11, { align: "center", justify: "space-between", mb: 3, children: [
|
|
6348
|
+
/* @__PURE__ */ jsx23(
|
|
6349
|
+
Text12,
|
|
5268
6350
|
{
|
|
5269
6351
|
fontSize: "xs",
|
|
5270
6352
|
fontWeight: "bold",
|
|
@@ -5274,8 +6356,8 @@ function ReusableProfile({
|
|
|
5274
6356
|
children: "Pinned"
|
|
5275
6357
|
}
|
|
5276
6358
|
),
|
|
5277
|
-
/* @__PURE__ */
|
|
5278
|
-
|
|
6359
|
+
/* @__PURE__ */ jsxs19(
|
|
6360
|
+
Text12,
|
|
5279
6361
|
{
|
|
5280
6362
|
fontSize: "xs",
|
|
5281
6363
|
color: quickNavHrefs.length >= maxQuickNavItems ? "orange.500" : "gray.400",
|
|
@@ -5288,8 +6370,8 @@ function ReusableProfile({
|
|
|
5288
6370
|
}
|
|
5289
6371
|
)
|
|
5290
6372
|
] }),
|
|
5291
|
-
quickNavHrefs.length === 0 ? /* @__PURE__ */
|
|
5292
|
-
|
|
6373
|
+
quickNavHrefs.length === 0 ? /* @__PURE__ */ jsx23(
|
|
6374
|
+
Flex11,
|
|
5293
6375
|
{
|
|
5294
6376
|
align: "center",
|
|
5295
6377
|
justify: "center",
|
|
@@ -5298,18 +6380,18 @@ function ReusableProfile({
|
|
|
5298
6380
|
borderWidth: "1px",
|
|
5299
6381
|
borderStyle: "dashed",
|
|
5300
6382
|
borderColor: "gray.200",
|
|
5301
|
-
children: /* @__PURE__ */
|
|
6383
|
+
children: /* @__PURE__ */ jsx23(Text12, { fontSize: "sm", color: "gray.400", children: "No items pinned \u2014 add from below" })
|
|
5302
6384
|
}
|
|
5303
|
-
) : /* @__PURE__ */
|
|
6385
|
+
) : /* @__PURE__ */ jsx23(VStack10, { gap: 0, children: quickNavHrefs.map((href, idx) => {
|
|
5304
6386
|
const option = availableOptions.find((item) => item.key === href);
|
|
5305
6387
|
if (!option) return null;
|
|
5306
6388
|
const ItemIcon = option.Icon;
|
|
5307
6389
|
const isFirst = idx === 0;
|
|
5308
6390
|
const isLast = idx === quickNavHrefs.length - 1;
|
|
5309
6391
|
const isReplacing = replacingIdx === idx;
|
|
5310
|
-
return /* @__PURE__ */
|
|
5311
|
-
/* @__PURE__ */
|
|
5312
|
-
|
|
6392
|
+
return /* @__PURE__ */ jsxs19(Box19, { w: "full", children: [
|
|
6393
|
+
/* @__PURE__ */ jsxs19(
|
|
6394
|
+
Flex11,
|
|
5313
6395
|
{
|
|
5314
6396
|
justify: "space-between",
|
|
5315
6397
|
align: "center",
|
|
@@ -5321,9 +6403,9 @@ function ReusableProfile({
|
|
|
5321
6403
|
borderColor: isReplacing ? "orange.200" : void 0,
|
|
5322
6404
|
transition: "all 0.15s",
|
|
5323
6405
|
children: [
|
|
5324
|
-
/* @__PURE__ */
|
|
5325
|
-
/* @__PURE__ */
|
|
5326
|
-
|
|
6406
|
+
/* @__PURE__ */ jsxs19(Flex11, { align: "center", gap: 3, children: [
|
|
6407
|
+
/* @__PURE__ */ jsx23(
|
|
6408
|
+
Box19,
|
|
5327
6409
|
{
|
|
5328
6410
|
w: "36px",
|
|
5329
6411
|
h: "36px",
|
|
@@ -5334,13 +6416,13 @@ function ReusableProfile({
|
|
|
5334
6416
|
justifyContent: "center",
|
|
5335
6417
|
color: "white",
|
|
5336
6418
|
flexShrink: 0,
|
|
5337
|
-
children: /* @__PURE__ */
|
|
6419
|
+
children: /* @__PURE__ */ jsx23(ItemIcon, { size: 15 })
|
|
5338
6420
|
}
|
|
5339
6421
|
),
|
|
5340
|
-
/* @__PURE__ */
|
|
5341
|
-
/* @__PURE__ */
|
|
5342
|
-
isReplacing && /* @__PURE__ */
|
|
5343
|
-
|
|
6422
|
+
/* @__PURE__ */ jsxs19(Box19, { children: [
|
|
6423
|
+
/* @__PURE__ */ jsx23(Text12, { fontSize: "sm", fontWeight: "medium", children: option.title }),
|
|
6424
|
+
isReplacing && /* @__PURE__ */ jsx23(
|
|
6425
|
+
Text12,
|
|
5344
6426
|
{
|
|
5345
6427
|
fontSize: "xs",
|
|
5346
6428
|
color: "orange.500",
|
|
@@ -5350,8 +6432,8 @@ function ReusableProfile({
|
|
|
5350
6432
|
)
|
|
5351
6433
|
] })
|
|
5352
6434
|
] }),
|
|
5353
|
-
/* @__PURE__ */
|
|
5354
|
-
/* @__PURE__ */
|
|
6435
|
+
/* @__PURE__ */ jsxs19(HStack6, { gap: 0.5, children: [
|
|
6436
|
+
/* @__PURE__ */ jsx23(
|
|
5355
6437
|
IconButton3,
|
|
5356
6438
|
{
|
|
5357
6439
|
size: "xs",
|
|
@@ -5360,10 +6442,10 @@ function ReusableProfile({
|
|
|
5360
6442
|
color: "gray.500",
|
|
5361
6443
|
disabled: isFirst || isReplacing,
|
|
5362
6444
|
onClick: () => moveNavItem(idx, -1),
|
|
5363
|
-
children: /* @__PURE__ */
|
|
6445
|
+
children: /* @__PURE__ */ jsx23(LuChevronUp3, { size: 14 })
|
|
5364
6446
|
}
|
|
5365
6447
|
),
|
|
5366
|
-
/* @__PURE__ */
|
|
6448
|
+
/* @__PURE__ */ jsx23(
|
|
5367
6449
|
IconButton3,
|
|
5368
6450
|
{
|
|
5369
6451
|
size: "xs",
|
|
@@ -5372,10 +6454,10 @@ function ReusableProfile({
|
|
|
5372
6454
|
color: "gray.500",
|
|
5373
6455
|
disabled: isLast || isReplacing,
|
|
5374
6456
|
onClick: () => moveNavItem(idx, 1),
|
|
5375
|
-
children: /* @__PURE__ */
|
|
6457
|
+
children: /* @__PURE__ */ jsx23(LuChevronDown3, { size: 14 })
|
|
5376
6458
|
}
|
|
5377
6459
|
),
|
|
5378
|
-
/* @__PURE__ */
|
|
6460
|
+
/* @__PURE__ */ jsx23(
|
|
5379
6461
|
IconButton3,
|
|
5380
6462
|
{
|
|
5381
6463
|
size: "xs",
|
|
@@ -5385,10 +6467,10 @@ function ReusableProfile({
|
|
|
5385
6467
|
color: isReplacing ? "white" : "gray.500",
|
|
5386
6468
|
_hover: { bg: isReplacing ? "orange.500" : "gray.100" },
|
|
5387
6469
|
onClick: () => setReplacingIdx(isReplacing ? null : idx),
|
|
5388
|
-
children: /* @__PURE__ */
|
|
6470
|
+
children: /* @__PURE__ */ jsx23(LuArrowLeftRight, { size: 13 })
|
|
5389
6471
|
}
|
|
5390
6472
|
),
|
|
5391
|
-
/* @__PURE__ */
|
|
6473
|
+
/* @__PURE__ */ jsx23(
|
|
5392
6474
|
IconButton3,
|
|
5393
6475
|
{
|
|
5394
6476
|
size: "xs",
|
|
@@ -5398,23 +6480,23 @@ function ReusableProfile({
|
|
|
5398
6480
|
_hover: { bg: "red.50" },
|
|
5399
6481
|
disabled: isReplacing,
|
|
5400
6482
|
onClick: () => removeNavItem(href),
|
|
5401
|
-
children: /* @__PURE__ */
|
|
6483
|
+
children: /* @__PURE__ */ jsx23(LuX, { size: 14 })
|
|
5402
6484
|
}
|
|
5403
6485
|
)
|
|
5404
6486
|
] })
|
|
5405
6487
|
]
|
|
5406
6488
|
}
|
|
5407
6489
|
),
|
|
5408
|
-
!isLast && /* @__PURE__ */
|
|
6490
|
+
!isLast && /* @__PURE__ */ jsx23(Separator3, {})
|
|
5409
6491
|
] }, href);
|
|
5410
6492
|
}) })
|
|
5411
6493
|
] }),
|
|
5412
|
-
/* @__PURE__ */
|
|
5413
|
-
/* @__PURE__ */
|
|
5414
|
-
/* @__PURE__ */
|
|
5415
|
-
replacingIdx !== null ? /* @__PURE__ */
|
|
5416
|
-
/* @__PURE__ */
|
|
5417
|
-
|
|
6494
|
+
/* @__PURE__ */ jsx23(Separator3, { mx: 4, my: 1 }),
|
|
6495
|
+
/* @__PURE__ */ jsxs19(Box19, { px: 4, pt: 4, pb: 10, children: [
|
|
6496
|
+
/* @__PURE__ */ jsxs19(Flex11, { align: "center", justify: "space-between", mb: 3, children: [
|
|
6497
|
+
replacingIdx !== null ? /* @__PURE__ */ jsxs19(Box19, { children: [
|
|
6498
|
+
/* @__PURE__ */ jsx23(
|
|
6499
|
+
Text12,
|
|
5418
6500
|
{
|
|
5419
6501
|
fontSize: "xs",
|
|
5420
6502
|
fontWeight: "bold",
|
|
@@ -5424,15 +6506,15 @@ function ReusableProfile({
|
|
|
5424
6506
|
children: "Select Replacement"
|
|
5425
6507
|
}
|
|
5426
6508
|
),
|
|
5427
|
-
/* @__PURE__ */
|
|
6509
|
+
/* @__PURE__ */ jsxs19(Text12, { fontSize: "xs", color: "gray.500", mt: 0.5, children: [
|
|
5428
6510
|
'for "',
|
|
5429
6511
|
availableOptions.find(
|
|
5430
6512
|
(item) => item.key === quickNavHrefs[replacingIdx]
|
|
5431
6513
|
)?.title,
|
|
5432
6514
|
'"'
|
|
5433
6515
|
] })
|
|
5434
|
-
] }) : /* @__PURE__ */
|
|
5435
|
-
|
|
6516
|
+
] }) : /* @__PURE__ */ jsx23(
|
|
6517
|
+
Text12,
|
|
5436
6518
|
{
|
|
5437
6519
|
fontSize: "xs",
|
|
5438
6520
|
fontWeight: "bold",
|
|
@@ -5442,8 +6524,8 @@ function ReusableProfile({
|
|
|
5442
6524
|
children: "Available"
|
|
5443
6525
|
}
|
|
5444
6526
|
),
|
|
5445
|
-
replacingIdx !== null && /* @__PURE__ */
|
|
5446
|
-
|
|
6527
|
+
replacingIdx !== null && /* @__PURE__ */ jsx23(
|
|
6528
|
+
Button5,
|
|
5447
6529
|
{
|
|
5448
6530
|
size: "xs",
|
|
5449
6531
|
variant: "ghost",
|
|
@@ -5453,17 +6535,17 @@ function ReusableProfile({
|
|
|
5453
6535
|
}
|
|
5454
6536
|
)
|
|
5455
6537
|
] }),
|
|
5456
|
-
unpinnedOptions.length === 0 ? /* @__PURE__ */
|
|
6538
|
+
unpinnedOptions.length === 0 ? /* @__PURE__ */ jsx23(Text12, { fontSize: "sm", color: "gray.400", py: 3, textAlign: "center", children: "All available items are pinned" }) : /* @__PURE__ */ jsx23(VStack10, { gap: 0, children: unpinnedOptions.map((option, idx) => {
|
|
5457
6539
|
const ItemIcon = option.Icon;
|
|
5458
6540
|
const isLast = idx === unpinnedOptions.length - 1;
|
|
5459
6541
|
const isReplacingMode = replacingIdx !== null;
|
|
5460
6542
|
const canAdd = quickNavHrefs.length < maxQuickNavItems;
|
|
5461
6543
|
const actionEnabled = isReplacingMode || canAdd;
|
|
5462
|
-
return /* @__PURE__ */
|
|
5463
|
-
/* @__PURE__ */
|
|
5464
|
-
/* @__PURE__ */
|
|
5465
|
-
/* @__PURE__ */
|
|
5466
|
-
|
|
6544
|
+
return /* @__PURE__ */ jsxs19(Box19, { w: "full", children: [
|
|
6545
|
+
/* @__PURE__ */ jsxs19(Flex11, { justify: "space-between", align: "center", py: 2.5, children: [
|
|
6546
|
+
/* @__PURE__ */ jsxs19(Flex11, { align: "center", gap: 3, children: [
|
|
6547
|
+
/* @__PURE__ */ jsx23(
|
|
6548
|
+
Box19,
|
|
5467
6549
|
{
|
|
5468
6550
|
w: "36px",
|
|
5469
6551
|
h: "36px",
|
|
@@ -5474,11 +6556,11 @@ function ReusableProfile({
|
|
|
5474
6556
|
justifyContent: "center",
|
|
5475
6557
|
color: isReplacingMode ? "orange.500" : "gray.500",
|
|
5476
6558
|
flexShrink: 0,
|
|
5477
|
-
children: /* @__PURE__ */
|
|
6559
|
+
children: /* @__PURE__ */ jsx23(ItemIcon, { size: 15 })
|
|
5478
6560
|
}
|
|
5479
6561
|
),
|
|
5480
|
-
/* @__PURE__ */
|
|
5481
|
-
|
|
6562
|
+
/* @__PURE__ */ jsx23(
|
|
6563
|
+
Text12,
|
|
5482
6564
|
{
|
|
5483
6565
|
fontSize: "sm",
|
|
5484
6566
|
fontWeight: "medium",
|
|
@@ -5487,7 +6569,7 @@ function ReusableProfile({
|
|
|
5487
6569
|
}
|
|
5488
6570
|
)
|
|
5489
6571
|
] }),
|
|
5490
|
-
isReplacingMode ? /* @__PURE__ */
|
|
6572
|
+
isReplacingMode ? /* @__PURE__ */ jsx23(
|
|
5491
6573
|
IconButton3,
|
|
5492
6574
|
{
|
|
5493
6575
|
size: "xs",
|
|
@@ -5497,9 +6579,9 @@ function ReusableProfile({
|
|
|
5497
6579
|
color: "orange.500",
|
|
5498
6580
|
_hover: { bg: "orange.50" },
|
|
5499
6581
|
onClick: () => replaceNavItem(replacingIdx, option.key),
|
|
5500
|
-
children: /* @__PURE__ */
|
|
6582
|
+
children: /* @__PURE__ */ jsx23(LuArrowLeftRight, { size: 13 })
|
|
5501
6583
|
}
|
|
5502
|
-
) : /* @__PURE__ */
|
|
6584
|
+
) : /* @__PURE__ */ jsx23(
|
|
5503
6585
|
IconButton3,
|
|
5504
6586
|
{
|
|
5505
6587
|
size: "xs",
|
|
@@ -5510,19 +6592,19 @@ function ReusableProfile({
|
|
|
5510
6592
|
color: canAdd ? "var(--chakra-colors-primary)" : "gray.300",
|
|
5511
6593
|
_hover: { bg: canAdd ? "blue.50" : "transparent" },
|
|
5512
6594
|
onClick: () => addNavItem(option.key),
|
|
5513
|
-
children: /* @__PURE__ */
|
|
6595
|
+
children: /* @__PURE__ */ jsx23(LuPlus, { size: 13 })
|
|
5514
6596
|
}
|
|
5515
6597
|
)
|
|
5516
6598
|
] }),
|
|
5517
|
-
!isLast && /* @__PURE__ */
|
|
6599
|
+
!isLast && /* @__PURE__ */ jsx23(Separator3, {})
|
|
5518
6600
|
] }, option.key);
|
|
5519
6601
|
}) })
|
|
5520
6602
|
] })
|
|
5521
6603
|
] });
|
|
5522
6604
|
const subViewContent = profileView === "edit-account" ? editAccountContent : profileView === "change-password" ? changePasswordContent : profileView === "navbar-customize" ? navbarCustomizeContent : null;
|
|
5523
6605
|
if (isDesktop) {
|
|
5524
|
-
return /* @__PURE__ */
|
|
5525
|
-
|
|
6606
|
+
return /* @__PURE__ */ jsxs19(
|
|
6607
|
+
Flex11,
|
|
5526
6608
|
{
|
|
5527
6609
|
maxW: "6xl",
|
|
5528
6610
|
mx: "auto",
|
|
@@ -5532,8 +6614,8 @@ function ReusableProfile({
|
|
|
5532
6614
|
p: { md: 6, lg: 8 },
|
|
5533
6615
|
align: "start",
|
|
5534
6616
|
children: [
|
|
5535
|
-
/* @__PURE__ */
|
|
5536
|
-
|
|
6617
|
+
/* @__PURE__ */ jsx23(
|
|
6618
|
+
Box19,
|
|
5537
6619
|
{
|
|
5538
6620
|
w: { md: "300px", lg: "340px" },
|
|
5539
6621
|
flexShrink: 0,
|
|
@@ -5547,8 +6629,8 @@ function ReusableProfile({
|
|
|
5547
6629
|
children: mainContent
|
|
5548
6630
|
}
|
|
5549
6631
|
),
|
|
5550
|
-
/* @__PURE__ */
|
|
5551
|
-
|
|
6632
|
+
/* @__PURE__ */ jsx23(
|
|
6633
|
+
Box19,
|
|
5552
6634
|
{
|
|
5553
6635
|
flex: "1",
|
|
5554
6636
|
minW: 0,
|
|
@@ -5558,8 +6640,8 @@ function ReusableProfile({
|
|
|
5558
6640
|
overflow: "hidden",
|
|
5559
6641
|
bg: "bg",
|
|
5560
6642
|
minH: "540px",
|
|
5561
|
-
children: subViewContent ?? /* @__PURE__ */
|
|
5562
|
-
|
|
6643
|
+
children: subViewContent ?? /* @__PURE__ */ jsxs19(
|
|
6644
|
+
Flex11,
|
|
5563
6645
|
{
|
|
5564
6646
|
direction: "column",
|
|
5565
6647
|
align: "center",
|
|
@@ -5569,8 +6651,8 @@ function ReusableProfile({
|
|
|
5569
6651
|
textAlign: "center",
|
|
5570
6652
|
color: "gray.400",
|
|
5571
6653
|
children: [
|
|
5572
|
-
/* @__PURE__ */
|
|
5573
|
-
|
|
6654
|
+
/* @__PURE__ */ jsx23(
|
|
6655
|
+
Box19,
|
|
5574
6656
|
{
|
|
5575
6657
|
w: "56px",
|
|
5576
6658
|
h: "56px",
|
|
@@ -5580,10 +6662,10 @@ function ReusableProfile({
|
|
|
5580
6662
|
alignItems: "center",
|
|
5581
6663
|
justifyContent: "center",
|
|
5582
6664
|
mb: 4,
|
|
5583
|
-
children: /* @__PURE__ */
|
|
6665
|
+
children: /* @__PURE__ */ jsx23(LuUser, { size: 24 })
|
|
5584
6666
|
}
|
|
5585
6667
|
),
|
|
5586
|
-
/* @__PURE__ */
|
|
6668
|
+
/* @__PURE__ */ jsx23(Text12, { fontSize: "sm", mt: 1, maxW: "280px", children: "Choose Edit Account, Change Password, or Quick Navigation from the menu to update your details here." })
|
|
5587
6669
|
]
|
|
5588
6670
|
}
|
|
5589
6671
|
)
|
|
@@ -5593,12 +6675,16 @@ function ReusableProfile({
|
|
|
5593
6675
|
}
|
|
5594
6676
|
);
|
|
5595
6677
|
}
|
|
5596
|
-
return /* @__PURE__ */
|
|
6678
|
+
return /* @__PURE__ */ jsx23(Box19, { maxW: "480px", mx: "auto", w: "full", minH: "100%", bg: "bg", children: profileView === "main" ? mainContent : subViewContent });
|
|
5597
6679
|
}
|
|
5598
6680
|
var UserProfile_default = ReusableProfile;
|
|
5599
6681
|
export {
|
|
6682
|
+
APIError,
|
|
5600
6683
|
beneficiary_default as Beneficiary,
|
|
5601
6684
|
BottomQuickActions_default as BottomQuickActions,
|
|
6685
|
+
DocumentUploadCard,
|
|
6686
|
+
GeoApifyService,
|
|
6687
|
+
GetStarted_default as GetStarted,
|
|
5602
6688
|
HealthDeclaration_default as HealthDeclaration,
|
|
5603
6689
|
LifePlanApplication1_default as LifePlanApplication1,
|
|
5604
6690
|
LifePlanApplication2_default as LifePlanApplication2,
|
|
@@ -5607,12 +6693,20 @@ export {
|
|
|
5607
6693
|
LifePlanApplicationStepWrapper_default as LifePlanApplicationStepWrapper,
|
|
5608
6694
|
NotifyInstall,
|
|
5609
6695
|
OCR_STORAGE_KEY,
|
|
6696
|
+
OcrService,
|
|
6697
|
+
PayMongoService,
|
|
5610
6698
|
SharedLifePlanApplication_default as SharedLifePlanApplication,
|
|
5611
6699
|
UserProfile_default as UserProfile,
|
|
6700
|
+
api,
|
|
6701
|
+
apiClient,
|
|
6702
|
+
clearOcrResult,
|
|
6703
|
+
configureApi,
|
|
5612
6704
|
createEmptyApplicationData,
|
|
5613
6705
|
loadApplicationDataFromLocalStorage,
|
|
5614
6706
|
markOcrApplied,
|
|
5615
6707
|
readOcrResult,
|
|
5616
|
-
saveApplicationDataToLocalStorage
|
|
6708
|
+
saveApplicationDataToLocalStorage,
|
|
6709
|
+
saveOcrResult,
|
|
6710
|
+
useOcr
|
|
5617
6711
|
};
|
|
5618
6712
|
//# sourceMappingURL=index.mjs.map
|