@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.js
CHANGED
|
@@ -30,8 +30,12 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/index.ts
|
|
31
31
|
var index_exports = {};
|
|
32
32
|
__export(index_exports, {
|
|
33
|
+
APIError: () => APIError,
|
|
33
34
|
Beneficiary: () => beneficiary_default,
|
|
34
35
|
BottomQuickActions: () => BottomQuickActions_default,
|
|
36
|
+
DocumentUploadCard: () => DocumentUploadCard,
|
|
37
|
+
GeoApifyService: () => GeoApifyService,
|
|
38
|
+
GetStarted: () => GetStarted_default,
|
|
35
39
|
HealthDeclaration: () => HealthDeclaration_default,
|
|
36
40
|
LifePlanApplication1: () => LifePlanApplication1_default,
|
|
37
41
|
LifePlanApplication2: () => LifePlanApplication2_default,
|
|
@@ -40,13 +44,21 @@ __export(index_exports, {
|
|
|
40
44
|
LifePlanApplicationStepWrapper: () => LifePlanApplicationStepWrapper_default,
|
|
41
45
|
NotifyInstall: () => NotifyInstall,
|
|
42
46
|
OCR_STORAGE_KEY: () => OCR_STORAGE_KEY,
|
|
47
|
+
OcrService: () => OcrService,
|
|
48
|
+
PayMongoService: () => PayMongoService,
|
|
43
49
|
SharedLifePlanApplication: () => SharedLifePlanApplication_default,
|
|
44
50
|
UserProfile: () => UserProfile_default,
|
|
51
|
+
api: () => api,
|
|
52
|
+
apiClient: () => apiClient,
|
|
53
|
+
clearOcrResult: () => clearOcrResult,
|
|
54
|
+
configureApi: () => configureApi,
|
|
45
55
|
createEmptyApplicationData: () => createEmptyApplicationData,
|
|
46
56
|
loadApplicationDataFromLocalStorage: () => loadApplicationDataFromLocalStorage,
|
|
47
57
|
markOcrApplied: () => markOcrApplied,
|
|
48
58
|
readOcrResult: () => readOcrResult,
|
|
49
|
-
saveApplicationDataToLocalStorage: () => saveApplicationDataToLocalStorage
|
|
59
|
+
saveApplicationDataToLocalStorage: () => saveApplicationDataToLocalStorage,
|
|
60
|
+
saveOcrResult: () => saveOcrResult,
|
|
61
|
+
useOcr: () => useOcr
|
|
50
62
|
});
|
|
51
63
|
module.exports = __toCommonJS(index_exports);
|
|
52
64
|
|
|
@@ -302,6 +314,20 @@ var markOcrApplied = (section) => {
|
|
|
302
314
|
}
|
|
303
315
|
return true;
|
|
304
316
|
};
|
|
317
|
+
var saveOcrResult = (value) => {
|
|
318
|
+
if (typeof window === "undefined") return;
|
|
319
|
+
try {
|
|
320
|
+
localStorage.setItem(OCR_STORAGE_KEY, JSON.stringify(value));
|
|
321
|
+
} catch {
|
|
322
|
+
}
|
|
323
|
+
};
|
|
324
|
+
var clearOcrResult = () => {
|
|
325
|
+
if (typeof window === "undefined") return;
|
|
326
|
+
try {
|
|
327
|
+
localStorage.removeItem(OCR_STORAGE_KEY);
|
|
328
|
+
} catch {
|
|
329
|
+
}
|
|
330
|
+
};
|
|
305
331
|
|
|
306
332
|
// src/NewSaleForm/LifePlanApplication1.tsx
|
|
307
333
|
var import_react4 = require("react");
|
|
@@ -2142,6 +2168,7 @@ var InfoCard = ({
|
|
|
2142
2168
|
}
|
|
2143
2169
|
);
|
|
2144
2170
|
};
|
|
2171
|
+
var info_card_default = InfoCard;
|
|
2145
2172
|
|
|
2146
2173
|
// src/NewSaleForm/ui/input-card-accordion.tsx
|
|
2147
2174
|
var import_react15 = require("@chakra-ui/react");
|
|
@@ -3476,8 +3503,131 @@ var HorizontalStepper = ({
|
|
|
3476
3503
|
};
|
|
3477
3504
|
var horizontal_stepper_default = HorizontalStepper;
|
|
3478
3505
|
|
|
3506
|
+
// src/services/MainAPIClient.ts
|
|
3507
|
+
var import_axios = __toESM(require("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 = import_axios.default.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
|
+
|
|
3479
3617
|
// src/NewSaleForm/SharedLifePlanApplication.tsx
|
|
3480
3618
|
var import_jsx_runtime16 = require("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
|
+
};
|
|
3481
3631
|
var safeParse = (value) => {
|
|
3482
3632
|
if (!value) return null;
|
|
3483
3633
|
try {
|
|
@@ -3490,8 +3640,8 @@ var SharedLifePlanApplication = ({
|
|
|
3490
3640
|
title = "Life Plan Application",
|
|
3491
3641
|
description = "Please fill out the form below to apply for a life plan.",
|
|
3492
3642
|
onPaymentError,
|
|
3493
|
-
onCheckout,
|
|
3494
|
-
parseAddress
|
|
3643
|
+
onCheckout = defaultCheckout,
|
|
3644
|
+
parseAddress = GeoApifyService.parseAddress
|
|
3495
3645
|
}) => {
|
|
3496
3646
|
const [currentStep, setCurrentStep] = (0, import_react27.useState)(0);
|
|
3497
3647
|
const [loading, setLoading] = (0, import_react27.useState)(false);
|
|
@@ -3504,7 +3654,7 @@ var SharedLifePlanApplication = ({
|
|
|
3504
3654
|
...applicationSection ? { applicationSection } : {},
|
|
3505
3655
|
applicationSectionKey,
|
|
3506
3656
|
onApplicationValidChange: setApplicationValid,
|
|
3507
|
-
|
|
3657
|
+
parseAddress,
|
|
3508
3658
|
onEdit: (section) => {
|
|
3509
3659
|
setApplicationSection(section ?? "personal");
|
|
3510
3660
|
setApplicationSectionKey((key) => key + 1);
|
|
@@ -3516,9 +3666,6 @@ var SharedLifePlanApplication = ({
|
|
|
3516
3666
|
if (!allAgreementsAccepted) return;
|
|
3517
3667
|
setLoading(true);
|
|
3518
3668
|
try {
|
|
3519
|
-
if (!onCheckout) {
|
|
3520
|
-
throw new Error("onCheckout prop is not provided");
|
|
3521
|
-
}
|
|
3522
3669
|
const checkoutRaw = sessionStorage.getItem("CheckoutCart");
|
|
3523
3670
|
const cartRaw = sessionStorage.getItem("Cart");
|
|
3524
3671
|
const parsed = safeParse(checkoutRaw) ?? safeParse(cartRaw);
|
|
@@ -3569,12 +3716,933 @@ var LifePlanApplicationStepWrapper = (props) => {
|
|
|
3569
3716
|
};
|
|
3570
3717
|
var LifePlanApplicationStepWrapper_default = LifePlanApplicationStepWrapper;
|
|
3571
3718
|
|
|
3572
|
-
// src/
|
|
3573
|
-
var import_react28 =
|
|
3574
|
-
|
|
3719
|
+
// src/hooks/useOcr.ts
|
|
3720
|
+
var import_react28 = require("react");
|
|
3721
|
+
function useOcr(scanIdFn) {
|
|
3722
|
+
const [data, setData] = (0, import_react28.useState)(null);
|
|
3723
|
+
const [loading, setLoading] = (0, import_react28.useState)(false);
|
|
3724
|
+
const [error, setError] = (0, import_react28.useState)(null);
|
|
3725
|
+
const scanId = (0, import_react28.useCallback)(
|
|
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
|
+
var import_st_peter_ui8 = require("st-peter-ui");
|
|
3749
|
+
var import_react33 = require("@chakra-ui/react");
|
|
3750
|
+
var import_react34 = require("react");
|
|
3751
|
+
var import_lu7 = require("react-icons/lu");
|
|
3752
|
+
|
|
3753
|
+
// src/GetStarted/Container.tsx
|
|
3754
|
+
var import_react29 = require("react");
|
|
3755
|
+
var import_react30 = require("@chakra-ui/react");
|
|
3756
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
3757
|
+
var Container = ({ children }) => {
|
|
3758
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3759
|
+
import_react30.Box,
|
|
3760
|
+
{
|
|
3761
|
+
px: { base: 8, md: 8 },
|
|
3762
|
+
mt: { base: 16, md: 32 },
|
|
3763
|
+
mb: { base: 32, md: 16 },
|
|
3764
|
+
maxW: "7xl",
|
|
3765
|
+
mx: "auto",
|
|
3766
|
+
children
|
|
3767
|
+
}
|
|
3768
|
+
);
|
|
3769
|
+
};
|
|
3770
|
+
var Container_default = Container;
|
|
3771
|
+
|
|
3772
|
+
// src/GetStarted/DocumentUploadCard.tsx
|
|
3773
|
+
var import_react31 = require("react");
|
|
3774
|
+
var import_react32 = require("@chakra-ui/react");
|
|
3575
3775
|
var import_lu6 = require("react-icons/lu");
|
|
3776
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
3777
|
+
var PRIMARY2 = "var(--chakra-colors-primary)";
|
|
3778
|
+
var PRIMARY_SOFT = "var(--chakra-colors-primary-disabled)";
|
|
3779
|
+
var defaultNotifyError = (message) => {
|
|
3780
|
+
console.error(message);
|
|
3781
|
+
};
|
|
3782
|
+
var formatBytes = (bytes) => {
|
|
3783
|
+
if (!bytes) return "";
|
|
3784
|
+
if (bytes < 1024) return `${bytes} B`;
|
|
3785
|
+
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(0)} KB`;
|
|
3786
|
+
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
3787
|
+
};
|
|
3788
|
+
var validate = (file, config) => {
|
|
3789
|
+
const accepted = config.accept.split(",").map((s) => s.trim());
|
|
3790
|
+
const okType = accepted.includes(file.type) || accepted.some(
|
|
3791
|
+
(a) => a.endsWith("/*") && file.type.startsWith(a.slice(0, -1))
|
|
3792
|
+
) || accepted.some(
|
|
3793
|
+
(a) => a.startsWith(".") && file.name.toLowerCase().endsWith(a)
|
|
3794
|
+
);
|
|
3795
|
+
if (!okType) return "Unsupported file type. Please upload a JPG, PNG or PDF.";
|
|
3796
|
+
if (file.size > config.maxSizeMB * 1024 * 1024)
|
|
3797
|
+
return `File is too large. Maximum size is ${config.maxSizeMB}MB.`;
|
|
3798
|
+
return null;
|
|
3799
|
+
};
|
|
3800
|
+
var useDocumentSlot = (config, onProcess, notifyError = defaultNotifyError) => {
|
|
3801
|
+
const [slot, setSlot] = (0, import_react31.useState)({ status: "idle" });
|
|
3802
|
+
const timers = (0, import_react31.useRef)([]);
|
|
3803
|
+
const runId = (0, import_react31.useRef)(0);
|
|
3804
|
+
const clearTimers = () => {
|
|
3805
|
+
timers.current.forEach(clearTimeout);
|
|
3806
|
+
timers.current = [];
|
|
3807
|
+
};
|
|
3808
|
+
const processFile = (file, currentRun, isSignature) => {
|
|
3809
|
+
if (!onProcess) return false;
|
|
3810
|
+
onProcess(file).then((result) => {
|
|
3811
|
+
if (runId.current !== currentRun) return;
|
|
3812
|
+
setSlot((prev) => ({
|
|
3813
|
+
...prev,
|
|
3814
|
+
status: "completed",
|
|
3815
|
+
cleanedImageUrl: isSignature ? prev.previewUrl : void 0,
|
|
3816
|
+
extraction: !isSignature && result && typeof result === "object" ? result : void 0
|
|
3817
|
+
}));
|
|
3818
|
+
}).catch((err) => {
|
|
3819
|
+
if (runId.current !== currentRun) return;
|
|
3820
|
+
const message = err instanceof Error && err.message ? err.message : "We couldn't process this document. Please try again.";
|
|
3821
|
+
setSlot((prev) => ({ ...prev, status: "failed", error: message }));
|
|
3822
|
+
notifyError(message);
|
|
3823
|
+
});
|
|
3824
|
+
return true;
|
|
3825
|
+
};
|
|
3826
|
+
const runLifecycle = (file) => {
|
|
3827
|
+
clearTimers();
|
|
3828
|
+
const currentRun = ++runId.current;
|
|
3829
|
+
const previewUrl = URL.createObjectURL(file);
|
|
3830
|
+
const isSignature = config.processor === "signature";
|
|
3831
|
+
setSlot({
|
|
3832
|
+
status: "uploading",
|
|
3833
|
+
file,
|
|
3834
|
+
fileName: file.name,
|
|
3835
|
+
fileType: file.type,
|
|
3836
|
+
fileSize: file.size,
|
|
3837
|
+
previewUrl,
|
|
3838
|
+
progress: 0
|
|
3839
|
+
});
|
|
3840
|
+
let progress = 0;
|
|
3841
|
+
const tick = () => {
|
|
3842
|
+
progress = Math.min(100, progress + 20);
|
|
3843
|
+
setSlot((prev) => ({ ...prev, progress }));
|
|
3844
|
+
if (progress < 100) {
|
|
3845
|
+
timers.current.push(setTimeout(tick, 180));
|
|
3846
|
+
} else {
|
|
3847
|
+
timers.current.push(
|
|
3848
|
+
setTimeout(() => {
|
|
3849
|
+
setSlot((prev) => ({ ...prev, status: "processing" }));
|
|
3850
|
+
if (processFile(file, currentRun, isSignature)) return;
|
|
3851
|
+
timers.current.push(
|
|
3852
|
+
setTimeout(() => {
|
|
3853
|
+
setSlot((prev) => ({
|
|
3854
|
+
...prev,
|
|
3855
|
+
status: "completed",
|
|
3856
|
+
cleanedImageUrl: isSignature ? prev.previewUrl : void 0,
|
|
3857
|
+
extraction: isSignature ? void 0 : { name: "Sample", date: "2026-07-16", id: "0001" }
|
|
3858
|
+
}));
|
|
3859
|
+
}, 1600)
|
|
3860
|
+
);
|
|
3861
|
+
}, 200)
|
|
3862
|
+
);
|
|
3863
|
+
}
|
|
3864
|
+
};
|
|
3865
|
+
timers.current.push(setTimeout(tick, 180));
|
|
3866
|
+
};
|
|
3867
|
+
const uploadDocument = (file) => runLifecycle(file);
|
|
3868
|
+
const retryDocument = () => {
|
|
3869
|
+
if (slot.file) runLifecycle(slot.file);
|
|
3870
|
+
};
|
|
3871
|
+
const removeDocument = () => {
|
|
3872
|
+
clearTimers();
|
|
3873
|
+
runId.current++;
|
|
3874
|
+
if (slot.previewUrl) URL.revokeObjectURL(slot.previewUrl);
|
|
3875
|
+
setSlot({ status: "idle" });
|
|
3876
|
+
};
|
|
3877
|
+
return { slot, uploadDocument, retryDocument, removeDocument };
|
|
3878
|
+
};
|
|
3879
|
+
var Card = ({
|
|
3880
|
+
activeIcon,
|
|
3881
|
+
title,
|
|
3882
|
+
subtitle,
|
|
3883
|
+
headerAction,
|
|
3884
|
+
children
|
|
3885
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
3886
|
+
import_react32.Box,
|
|
3887
|
+
{
|
|
3888
|
+
w: "full",
|
|
3889
|
+
borderRadius: "2xl",
|
|
3890
|
+
bg: "white",
|
|
3891
|
+
borderWidth: "1px",
|
|
3892
|
+
borderColor: "gray.200",
|
|
3893
|
+
shadow: "sm",
|
|
3894
|
+
overflow: "hidden",
|
|
3895
|
+
children: [
|
|
3896
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react32.Flex, { align: "center", justify: "space-between", px: 4, py: 3, gap: 2, children: [
|
|
3897
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react32.Flex, { align: "center", gap: 2, minW: 0, children: [
|
|
3898
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3899
|
+
import_react32.Box,
|
|
3900
|
+
{
|
|
3901
|
+
p: 2,
|
|
3902
|
+
borderRadius: "full",
|
|
3903
|
+
bg: "gray.100",
|
|
3904
|
+
color: PRIMARY2,
|
|
3905
|
+
flexShrink: 0,
|
|
3906
|
+
children: activeIcon
|
|
3907
|
+
}
|
|
3908
|
+
),
|
|
3909
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react32.Box, { minW: 0, children: [
|
|
3910
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react32.Text, { fontWeight: "bold", fontSize: "md", lineHeight: "1.2", truncate: true, children: title }),
|
|
3911
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react32.Text, { fontSize: "xs", color: "gray.500", truncate: true, children: subtitle })
|
|
3912
|
+
] })
|
|
3913
|
+
] }),
|
|
3914
|
+
headerAction
|
|
3915
|
+
] }),
|
|
3916
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react32.Box, { px: 4, pb: 4, pt: 1, borderTopWidth: "1px", borderColor: "gray.100", children })
|
|
3917
|
+
]
|
|
3918
|
+
}
|
|
3919
|
+
);
|
|
3920
|
+
var StatusPill = ({ status }) => {
|
|
3921
|
+
const map = {
|
|
3922
|
+
idle: null,
|
|
3923
|
+
uploading: { label: "Uploading", fg: "#1D4ED8", bg: "#EFF6FF" },
|
|
3924
|
+
processing: { label: "Analyzing", fg: "#7C3AED", bg: "#F5F3FF" },
|
|
3925
|
+
completed: { label: "Completed", fg: "#15803D", bg: "#F0FDF4" },
|
|
3926
|
+
failed: { label: "Failed", fg: "#B91C1C", bg: "#FEF2F2" }
|
|
3927
|
+
};
|
|
3928
|
+
const meta = map[status];
|
|
3929
|
+
if (!meta) return null;
|
|
3930
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
3931
|
+
import_react32.Flex,
|
|
3932
|
+
{
|
|
3933
|
+
align: "center",
|
|
3934
|
+
gap: 1.5,
|
|
3935
|
+
px: 2.5,
|
|
3936
|
+
py: 1,
|
|
3937
|
+
borderRadius: "full",
|
|
3938
|
+
fontSize: "xs",
|
|
3939
|
+
fontWeight: 600,
|
|
3940
|
+
style: { color: meta.fg, background: meta.bg },
|
|
3941
|
+
flexShrink: 0,
|
|
3942
|
+
children: [
|
|
3943
|
+
status === "processing" || status === "uploading" ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react32.Spinner, { size: "xs", borderWidth: "2px" }) : status === "completed" ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lu6.LuCheck, { size: 12 }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lu6.LuTriangleAlert, { size: 12 }),
|
|
3944
|
+
meta.label
|
|
3945
|
+
]
|
|
3946
|
+
}
|
|
3947
|
+
);
|
|
3948
|
+
};
|
|
3949
|
+
var ProgressBar = ({ value, color }) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react32.Box, { w: "full", h: "6px", bg: "gray.100", borderRadius: "full", overflow: "hidden", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3950
|
+
import_react32.Box,
|
|
3951
|
+
{
|
|
3952
|
+
h: "full",
|
|
3953
|
+
borderRadius: "full",
|
|
3954
|
+
style: {
|
|
3955
|
+
width: `${value}%`,
|
|
3956
|
+
background: color,
|
|
3957
|
+
transition: "width 0.2s ease"
|
|
3958
|
+
}
|
|
3959
|
+
}
|
|
3960
|
+
) });
|
|
3961
|
+
var Thumb = ({
|
|
3962
|
+
url,
|
|
3963
|
+
isPdf,
|
|
3964
|
+
fileName,
|
|
3965
|
+
transparent
|
|
3966
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3967
|
+
import_react32.Flex,
|
|
3968
|
+
{
|
|
3969
|
+
align: "center",
|
|
3970
|
+
justify: "center",
|
|
3971
|
+
boxSize: { base: "56px", md: "64px" },
|
|
3972
|
+
borderRadius: "lg",
|
|
3973
|
+
borderWidth: "1px",
|
|
3974
|
+
borderColor: "gray.200",
|
|
3975
|
+
overflow: "hidden",
|
|
3976
|
+
flexShrink: 0,
|
|
3977
|
+
bg: transparent ? "transparent" : "gray.50",
|
|
3978
|
+
style: transparent ? {
|
|
3979
|
+
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%)",
|
|
3980
|
+
backgroundSize: "10px 10px",
|
|
3981
|
+
backgroundPosition: "0 0,0 5px,5px -5px,-5px 0"
|
|
3982
|
+
} : void 0,
|
|
3983
|
+
children: isPdf || !url ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react32.Flex, { direction: "column", align: "center", color: "gray.400", gap: 0.5, children: [
|
|
3984
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lu6.LuFileText, { size: 22 }),
|
|
3985
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react32.Text, { fontSize: "9px", fontWeight: 600, children: isPdf ? "PDF" : "FILE" })
|
|
3986
|
+
] }) : (
|
|
3987
|
+
// eslint-disable-next-line @next/next/no-img-element
|
|
3988
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3989
|
+
"img",
|
|
3990
|
+
{
|
|
3991
|
+
src: url,
|
|
3992
|
+
alt: fileName ?? "preview",
|
|
3993
|
+
style: { width: "100%", height: "100%", objectFit: "contain" }
|
|
3994
|
+
}
|
|
3995
|
+
)
|
|
3996
|
+
)
|
|
3997
|
+
}
|
|
3998
|
+
);
|
|
3999
|
+
var GhostBtn = ({
|
|
4000
|
+
icon,
|
|
4001
|
+
label,
|
|
4002
|
+
onClick,
|
|
4003
|
+
tone = "gray"
|
|
4004
|
+
}) => {
|
|
4005
|
+
const tones = {
|
|
4006
|
+
gray: { c: "gray.600", h: "gray.50", b: "gray.200" },
|
|
4007
|
+
danger: { c: "#B91C1C", h: "#FEF2F2", b: "#FECACA" },
|
|
4008
|
+
primary: { c: PRIMARY2, h: PRIMARY_SOFT, b: PRIMARY2 }
|
|
4009
|
+
};
|
|
4010
|
+
const t = tones[tone];
|
|
4011
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
4012
|
+
import_react32.Flex,
|
|
4013
|
+
{
|
|
4014
|
+
as: "button",
|
|
4015
|
+
align: "center",
|
|
4016
|
+
gap: 1.5,
|
|
4017
|
+
px: 2.5,
|
|
4018
|
+
py: 1.5,
|
|
4019
|
+
borderRadius: "lg",
|
|
4020
|
+
borderWidth: "1px",
|
|
4021
|
+
borderColor: t.b,
|
|
4022
|
+
color: t.c,
|
|
4023
|
+
bg: "white",
|
|
4024
|
+
fontSize: "xs",
|
|
4025
|
+
fontWeight: 600,
|
|
4026
|
+
cursor: "pointer",
|
|
4027
|
+
_hover: { bg: t.h },
|
|
4028
|
+
transition: "all 0.15s",
|
|
4029
|
+
onClick,
|
|
4030
|
+
children: [
|
|
4031
|
+
icon,
|
|
4032
|
+
label
|
|
4033
|
+
]
|
|
4034
|
+
}
|
|
4035
|
+
);
|
|
4036
|
+
};
|
|
4037
|
+
function DocumentUploadCard({
|
|
4038
|
+
config,
|
|
4039
|
+
onStatusChange,
|
|
4040
|
+
onProcess,
|
|
4041
|
+
onError
|
|
4042
|
+
}) {
|
|
4043
|
+
const notifyError = onError ?? defaultNotifyError;
|
|
4044
|
+
const { slot, uploadDocument, retryDocument, removeDocument } = useDocumentSlot(config, onProcess, notifyError);
|
|
4045
|
+
const status = slot?.status ?? "idle";
|
|
4046
|
+
(0, import_react31.useEffect)(() => {
|
|
4047
|
+
onStatusChange?.(status);
|
|
4048
|
+
}, [status, onStatusChange]);
|
|
4049
|
+
const browseRef = (0, import_react31.useRef)(null);
|
|
4050
|
+
const cameraRef = (0, import_react31.useRef)(null);
|
|
4051
|
+
const [dragging, setDragging] = (0, import_react31.useState)(false);
|
|
4052
|
+
const Icon6 = config.icon;
|
|
4053
|
+
const isPdf = slot?.fileType === "application/pdf";
|
|
4054
|
+
const handleFiles = (files) => {
|
|
4055
|
+
const file = files?.[0];
|
|
4056
|
+
if (!file) return;
|
|
4057
|
+
const error = validate(file, config);
|
|
4058
|
+
if (error) {
|
|
4059
|
+
notifyError(error);
|
|
4060
|
+
return;
|
|
4061
|
+
}
|
|
4062
|
+
void uploadDocument(file);
|
|
4063
|
+
};
|
|
4064
|
+
const onDrop = (e) => {
|
|
4065
|
+
e.preventDefault();
|
|
4066
|
+
setDragging(false);
|
|
4067
|
+
handleFiles(e.dataTransfer.files);
|
|
4068
|
+
};
|
|
4069
|
+
const renderDropzone = () => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
4070
|
+
import_react32.Flex,
|
|
4071
|
+
{
|
|
4072
|
+
direction: "column",
|
|
4073
|
+
align: "center",
|
|
4074
|
+
justify: "center",
|
|
4075
|
+
gap: 2,
|
|
4076
|
+
py: { base: 6, md: 7 },
|
|
4077
|
+
px: 4,
|
|
4078
|
+
borderWidth: "2px",
|
|
4079
|
+
borderStyle: "dashed",
|
|
4080
|
+
borderColor: dragging ? PRIMARY2 : "gray.200",
|
|
4081
|
+
borderRadius: "xl",
|
|
4082
|
+
bg: dragging ? PRIMARY_SOFT : "gray.50",
|
|
4083
|
+
transition: "all 0.15s",
|
|
4084
|
+
textAlign: "center",
|
|
4085
|
+
onDragOver: (e) => {
|
|
4086
|
+
e.preventDefault();
|
|
4087
|
+
setDragging(true);
|
|
4088
|
+
},
|
|
4089
|
+
onDragLeave: () => setDragging(false),
|
|
4090
|
+
onDrop,
|
|
4091
|
+
role: "button",
|
|
4092
|
+
tabIndex: 0,
|
|
4093
|
+
onClick: () => browseRef.current?.click(),
|
|
4094
|
+
onKeyDown: (e) => {
|
|
4095
|
+
if (e.key === "Enter" || e.key === " ") browseRef.current?.click();
|
|
4096
|
+
},
|
|
4097
|
+
cursor: "pointer",
|
|
4098
|
+
_hover: { borderColor: PRIMARY2, bg: PRIMARY_SOFT },
|
|
4099
|
+
children: [
|
|
4100
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
4101
|
+
import_react32.Flex,
|
|
4102
|
+
{
|
|
4103
|
+
align: "center",
|
|
4104
|
+
justify: "center",
|
|
4105
|
+
boxSize: 11,
|
|
4106
|
+
borderRadius: "full",
|
|
4107
|
+
bg: "white",
|
|
4108
|
+
borderWidth: "1px",
|
|
4109
|
+
borderColor: "gray.200",
|
|
4110
|
+
color: PRIMARY2,
|
|
4111
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lu6.LuUpload, { size: 18 })
|
|
4112
|
+
}
|
|
4113
|
+
),
|
|
4114
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react32.Box, { children: [
|
|
4115
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react32.Text, { fontSize: "sm", fontWeight: 600, color: "gray.800", children: "Drag & drop or tap to upload" }),
|
|
4116
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react32.Text, { fontSize: "xs", color: "gray.500", mt: 0.5, children: config.hint ?? "JPG, PNG or PDF" })
|
|
4117
|
+
] }),
|
|
4118
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react32.Flex, { gap: 2, mt: 1, onClick: (e) => e.stopPropagation(), children: [
|
|
4119
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
4120
|
+
GhostBtn,
|
|
4121
|
+
{
|
|
4122
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lu6.LuFolderOpen, { size: 13 }),
|
|
4123
|
+
label: "Browse",
|
|
4124
|
+
tone: "primary",
|
|
4125
|
+
onClick: () => browseRef.current?.click()
|
|
4126
|
+
}
|
|
4127
|
+
),
|
|
4128
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
4129
|
+
GhostBtn,
|
|
4130
|
+
{
|
|
4131
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lu6.LuCamera, { size: 13 }),
|
|
4132
|
+
label: "Take photo",
|
|
4133
|
+
onClick: () => cameraRef.current?.click()
|
|
4134
|
+
}
|
|
4135
|
+
)
|
|
4136
|
+
] })
|
|
4137
|
+
]
|
|
4138
|
+
}
|
|
4139
|
+
);
|
|
4140
|
+
const renderBusy = () => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react32.Flex, { gap: 3, align: "center", children: [
|
|
4141
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Thumb, { url: slot?.previewUrl, isPdf, fileName: slot?.fileName }),
|
|
4142
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react32.Box, { flex: "1", minW: 0, children: [
|
|
4143
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react32.Text, { fontSize: "sm", fontWeight: 600, color: "gray.800", truncate: true, children: slot?.fileName }),
|
|
4144
|
+
status === "uploading" ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
|
4145
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
4146
|
+
import_react32.Flex,
|
|
4147
|
+
{
|
|
4148
|
+
justify: "space-between",
|
|
4149
|
+
fontSize: "xs",
|
|
4150
|
+
color: "gray.500",
|
|
4151
|
+
mt: 1,
|
|
4152
|
+
mb: 1,
|
|
4153
|
+
children: [
|
|
4154
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react32.Text, { children: "Uploading\u2026" }),
|
|
4155
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react32.Text, { fontWeight: 600, children: [
|
|
4156
|
+
slot?.progress ?? 0,
|
|
4157
|
+
"%"
|
|
4158
|
+
] })
|
|
4159
|
+
]
|
|
4160
|
+
}
|
|
4161
|
+
),
|
|
4162
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ProgressBar, { value: slot?.progress ?? 0, color: "#2563EB" })
|
|
4163
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react32.Flex, { align: "center", gap: 2, mt: 1.5, children: [
|
|
4164
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
4165
|
+
import_react32.Flex,
|
|
4166
|
+
{
|
|
4167
|
+
align: "center",
|
|
4168
|
+
gap: 1.5,
|
|
4169
|
+
px: 2,
|
|
4170
|
+
py: 1,
|
|
4171
|
+
borderRadius: "md",
|
|
4172
|
+
bg: "#F5F3FF",
|
|
4173
|
+
color: "#7C3AED",
|
|
4174
|
+
fontSize: "xs",
|
|
4175
|
+
fontWeight: 600,
|
|
4176
|
+
children: [
|
|
4177
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lu6.LuSparkles, { size: 12 }),
|
|
4178
|
+
config.processor === "signature" ? "Cleaning signature\u2026" : "Reading with AI\u2026"
|
|
4179
|
+
]
|
|
4180
|
+
}
|
|
4181
|
+
),
|
|
4182
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react32.Spinner, { size: "xs", color: "#7C3AED", borderWidth: "2px" })
|
|
4183
|
+
] }),
|
|
4184
|
+
status === "processing" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react32.Text, { fontSize: "11px", color: "gray.400", mt: 1.5, children: "This can take a few seconds. Your upload is already saved." })
|
|
4185
|
+
] })
|
|
4186
|
+
] });
|
|
4187
|
+
const renderFailed = () => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react32.Box, { children: [
|
|
4188
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react32.Flex, { gap: 3, align: "flex-start", children: [
|
|
4189
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Thumb, { url: slot?.previewUrl, isPdf, fileName: slot?.fileName }),
|
|
4190
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react32.Box, { flex: "1", minW: 0, children: [
|
|
4191
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react32.Text, { fontSize: "sm", fontWeight: 600, color: "gray.800", truncate: true, children: slot?.fileName ?? config.label }),
|
|
4192
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react32.Flex, { align: "flex-start", gap: 1.5, mt: 1, color: "#B91C1C", children: [
|
|
4193
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react32.Box, { mt: "1px", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lu6.LuTriangleAlert, { size: 13 }) }),
|
|
4194
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react32.Text, { fontSize: "xs", lineHeight: "1.4", children: slot?.error ?? "We couldn't process this document." })
|
|
4195
|
+
] })
|
|
4196
|
+
] })
|
|
4197
|
+
] }),
|
|
4198
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react32.Flex, { gap: 2, mt: 3, wrap: "wrap", children: [
|
|
4199
|
+
slot?.file ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
4200
|
+
GhostBtn,
|
|
4201
|
+
{
|
|
4202
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lu6.LuRefreshCw, { size: 13 }),
|
|
4203
|
+
label: "Retry",
|
|
4204
|
+
tone: "primary",
|
|
4205
|
+
onClick: () => void retryDocument()
|
|
4206
|
+
}
|
|
4207
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
4208
|
+
GhostBtn,
|
|
4209
|
+
{
|
|
4210
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lu6.LuUpload, { size: 13 }),
|
|
4211
|
+
label: "Re-upload",
|
|
4212
|
+
tone: "primary",
|
|
4213
|
+
onClick: () => browseRef.current?.click()
|
|
4214
|
+
}
|
|
4215
|
+
),
|
|
4216
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
4217
|
+
GhostBtn,
|
|
4218
|
+
{
|
|
4219
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lu6.LuReplace, { size: 13 }),
|
|
4220
|
+
label: "Choose another",
|
|
4221
|
+
onClick: () => browseRef.current?.click()
|
|
4222
|
+
}
|
|
4223
|
+
),
|
|
4224
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
4225
|
+
GhostBtn,
|
|
4226
|
+
{
|
|
4227
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lu6.LuTrash2, { size: 13 }),
|
|
4228
|
+
label: "Remove",
|
|
4229
|
+
tone: "danger",
|
|
4230
|
+
onClick: () => removeDocument()
|
|
4231
|
+
}
|
|
4232
|
+
)
|
|
4233
|
+
] })
|
|
4234
|
+
] });
|
|
4235
|
+
const renderCompleted = () => {
|
|
4236
|
+
const isSignature = config.processor === "signature";
|
|
4237
|
+
const fieldCount = slot?.extraction ? Object.values(slot.extraction).filter(Boolean).length : 0;
|
|
4238
|
+
const displayUrl = isSignature ? slot?.cleanedImageUrl ?? slot?.previewUrl : slot?.previewUrl;
|
|
4239
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react32.Box, { children: [
|
|
4240
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react32.Flex, { gap: 3, align: "center", children: [
|
|
4241
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
4242
|
+
Thumb,
|
|
4243
|
+
{
|
|
4244
|
+
url: displayUrl,
|
|
4245
|
+
isPdf: isPdf && !isSignature,
|
|
4246
|
+
fileName: slot?.fileName,
|
|
4247
|
+
transparent: isSignature && !!slot?.cleanedImageUrl
|
|
4248
|
+
}
|
|
4249
|
+
),
|
|
4250
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react32.Box, { flex: "1", minW: 0, children: [
|
|
4251
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react32.Text, { fontSize: "sm", fontWeight: 600, color: "gray.800", truncate: true, children: slot?.fileName }),
|
|
4252
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react32.Text, { fontSize: "xs", color: "gray.500", children: formatBytes(slot?.fileSize) }),
|
|
4253
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
4254
|
+
import_react32.Flex,
|
|
4255
|
+
{
|
|
4256
|
+
align: "center",
|
|
4257
|
+
gap: 1.5,
|
|
4258
|
+
mt: 1.5,
|
|
4259
|
+
color: PRIMARY2,
|
|
4260
|
+
fontSize: "xs",
|
|
4261
|
+
fontWeight: 600,
|
|
4262
|
+
children: [
|
|
4263
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lu6.LuSparkles, { size: 12 }),
|
|
4264
|
+
isSignature ? "Signature detected & cleaned" : `${fieldCount} field${fieldCount === 1 ? "" : "s"} extracted`
|
|
4265
|
+
]
|
|
4266
|
+
}
|
|
4267
|
+
)
|
|
4268
|
+
] })
|
|
4269
|
+
] }),
|
|
4270
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react32.Flex, { gap: 2, mt: 3, wrap: "wrap", children: [
|
|
4271
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
4272
|
+
GhostBtn,
|
|
4273
|
+
{
|
|
4274
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lu6.LuReplace, { size: 13 }),
|
|
4275
|
+
label: "Replace",
|
|
4276
|
+
onClick: () => browseRef.current?.click()
|
|
4277
|
+
}
|
|
4278
|
+
),
|
|
4279
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
4280
|
+
GhostBtn,
|
|
4281
|
+
{
|
|
4282
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lu6.LuTrash2, { size: 13 }),
|
|
4283
|
+
label: "Remove",
|
|
4284
|
+
tone: "danger",
|
|
4285
|
+
onClick: () => removeDocument()
|
|
4286
|
+
}
|
|
4287
|
+
)
|
|
4288
|
+
] })
|
|
4289
|
+
] });
|
|
4290
|
+
};
|
|
4291
|
+
const requiredTag = /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
4292
|
+
import_react32.Text,
|
|
4293
|
+
{
|
|
4294
|
+
fontSize: "10px",
|
|
4295
|
+
fontWeight: 700,
|
|
4296
|
+
px: 1.5,
|
|
4297
|
+
py: 0.5,
|
|
4298
|
+
borderRadius: "full",
|
|
4299
|
+
color: config.required ? "#B45309" : "gray.500",
|
|
4300
|
+
bg: config.required ? "#FEF3C7" : "gray.100",
|
|
4301
|
+
flexShrink: 0,
|
|
4302
|
+
children: config.required ? "REQUIRED" : "OPTIONAL"
|
|
4303
|
+
}
|
|
4304
|
+
);
|
|
4305
|
+
const isMobile = (0, import_react32.useBreakpointValue)({ base: true, lg: false });
|
|
4306
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
4307
|
+
Card,
|
|
4308
|
+
{
|
|
4309
|
+
activeIcon: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Icon6, { size: 18 }),
|
|
4310
|
+
title: config.label,
|
|
4311
|
+
subtitle: config.description,
|
|
4312
|
+
headerAction: !isMobile ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react32.Flex, { align: "center", gap: 2, flexShrink: 0, children: [
|
|
4313
|
+
requiredTag,
|
|
4314
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(StatusPill, { status })
|
|
4315
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_jsx_runtime19.Fragment, {}),
|
|
4316
|
+
children: [
|
|
4317
|
+
isMobile ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
4318
|
+
import_react32.Flex,
|
|
4319
|
+
{
|
|
4320
|
+
align: "center",
|
|
4321
|
+
justifySelf: "flex-end",
|
|
4322
|
+
gap: 2,
|
|
4323
|
+
mb: 1,
|
|
4324
|
+
flexShrink: 0,
|
|
4325
|
+
children: [
|
|
4326
|
+
requiredTag,
|
|
4327
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(StatusPill, { status })
|
|
4328
|
+
]
|
|
4329
|
+
}
|
|
4330
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_jsx_runtime19.Fragment, {}),
|
|
4331
|
+
status === "idle" && renderDropzone(),
|
|
4332
|
+
(status === "uploading" || status === "processing") && renderBusy(),
|
|
4333
|
+
status === "failed" && renderFailed(),
|
|
4334
|
+
status === "completed" && renderCompleted(),
|
|
4335
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
4336
|
+
"input",
|
|
4337
|
+
{
|
|
4338
|
+
ref: browseRef,
|
|
4339
|
+
type: "file",
|
|
4340
|
+
accept: config.accept,
|
|
4341
|
+
hidden: true,
|
|
4342
|
+
onChange: (e) => {
|
|
4343
|
+
handleFiles(e.target.files);
|
|
4344
|
+
e.target.value = "";
|
|
4345
|
+
}
|
|
4346
|
+
}
|
|
4347
|
+
),
|
|
4348
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
4349
|
+
"input",
|
|
4350
|
+
{
|
|
4351
|
+
ref: cameraRef,
|
|
4352
|
+
type: "file",
|
|
4353
|
+
accept: "image/*",
|
|
4354
|
+
capture: "environment",
|
|
4355
|
+
hidden: true,
|
|
4356
|
+
onChange: (e) => {
|
|
4357
|
+
handleFiles(e.target.files);
|
|
4358
|
+
e.target.value = "";
|
|
4359
|
+
}
|
|
4360
|
+
}
|
|
4361
|
+
)
|
|
4362
|
+
]
|
|
4363
|
+
}
|
|
4364
|
+
);
|
|
4365
|
+
}
|
|
4366
|
+
|
|
4367
|
+
// src/services/OcrService.ts
|
|
4368
|
+
var ENDPOINTS3 = {
|
|
4369
|
+
scan: "/Ocr/Scan"
|
|
4370
|
+
};
|
|
4371
|
+
var isObject = (value) => !!value && typeof value === "object" && !Array.isArray(value);
|
|
4372
|
+
var readField = (source, keys) => {
|
|
4373
|
+
if (!source) return "";
|
|
4374
|
+
for (const key of keys) {
|
|
4375
|
+
const match = Object.keys(source).find(
|
|
4376
|
+
(k) => k.toLowerCase() === key.toLowerCase()
|
|
4377
|
+
);
|
|
4378
|
+
const value = match ? source[match] : void 0;
|
|
4379
|
+
if (typeof value === "string" && value.trim()) return value.trim();
|
|
4380
|
+
if (typeof value === "number") return String(value);
|
|
4381
|
+
}
|
|
4382
|
+
return "";
|
|
4383
|
+
};
|
|
4384
|
+
var pad = (value) => String(value).padStart(2, "0");
|
|
4385
|
+
var toIsoDate = (value) => {
|
|
4386
|
+
if (!value) return "";
|
|
4387
|
+
if (/^\d{4}-\d{2}-\d{2}/.test(value)) return value.slice(0, 10);
|
|
4388
|
+
const parts = value.split(/[/-]/).map((part) => part.trim());
|
|
4389
|
+
if (parts.length === 3 && parts.every(Boolean)) {
|
|
4390
|
+
const [first = "", second = "", third = ""] = parts;
|
|
4391
|
+
if (first.length === 4) return `${first}-${pad(second)}-${pad(third)}`;
|
|
4392
|
+
if (third.length === 4) return `${third}-${pad(first)}-${pad(second)}`;
|
|
4393
|
+
}
|
|
4394
|
+
const parsed = new Date(value);
|
|
4395
|
+
if (Number.isNaN(parsed.getTime())) return "";
|
|
4396
|
+
return `${parsed.getFullYear()}-${pad(parsed.getMonth() + 1)}-${pad(parsed.getDate())}`;
|
|
4397
|
+
};
|
|
4398
|
+
var toIdType = (value) => {
|
|
4399
|
+
const text = value.toLowerCase();
|
|
4400
|
+
if (!text) return "";
|
|
4401
|
+
if (text.includes("passport")) return "passport";
|
|
4402
|
+
if (text.includes("driver")) return "driver_license";
|
|
4403
|
+
if (text.includes("national") || text.includes("id")) return "national_id";
|
|
4404
|
+
return "";
|
|
4405
|
+
};
|
|
4406
|
+
var toOcrValue = (body) => {
|
|
4407
|
+
const root = isObject(body) ? body : void 0;
|
|
4408
|
+
const nested = root ? Object.entries(root).find(
|
|
4409
|
+
([key, value]) => key.toLowerCase() === "response" && isObject(value)
|
|
4410
|
+
)?.[1] : void 0;
|
|
4411
|
+
const source = isObject(nested) ? nested : root;
|
|
4412
|
+
return {
|
|
4413
|
+
firstName: readField(source, ["firstName"]),
|
|
4414
|
+
middleName: readField(source, ["middleName"]),
|
|
4415
|
+
lastName: readField(source, ["lastName"]),
|
|
4416
|
+
birthDate: toIsoDate(readField(source, ["birthDate", "dateOfBirth"])),
|
|
4417
|
+
idType: toIdType(readField(source, ["idType"])),
|
|
4418
|
+
idNumber: readField(source, ["idNumber", "idNo"]),
|
|
4419
|
+
addressLine: readField(source, ["addressLine", "address", "completeAddress"])
|
|
4420
|
+
};
|
|
4421
|
+
};
|
|
4422
|
+
var toFormData = (docType, source) => {
|
|
4423
|
+
const formData = new FormData();
|
|
4424
|
+
formData.append("DocType", docType);
|
|
4425
|
+
if (typeof source === "string") {
|
|
4426
|
+
formData.append("OCRType", "URL");
|
|
4427
|
+
formData.append("ImageUrl", source.trim());
|
|
4428
|
+
} else {
|
|
4429
|
+
formData.append("OCRType", "File");
|
|
4430
|
+
formData.append("File", source);
|
|
4431
|
+
}
|
|
4432
|
+
return formData;
|
|
4433
|
+
};
|
|
4434
|
+
var OcrService = {
|
|
4435
|
+
async scan(docType, source) {
|
|
4436
|
+
return api.post(ENDPOINTS3.scan, toFormData(docType, source), {
|
|
4437
|
+
headers: { "Content-Type": "multipart/form-data" },
|
|
4438
|
+
timeout: 9e4
|
|
4439
|
+
});
|
|
4440
|
+
},
|
|
4441
|
+
async scanId(source) {
|
|
4442
|
+
const body = await OcrService.scan("ID", source);
|
|
4443
|
+
const result = toOcrValue(body);
|
|
4444
|
+
if (!result.firstName && !result.lastName && !result.idNumber) {
|
|
4445
|
+
const description = isObject(body) ? readField(body, ["description", "message"]) : "";
|
|
4446
|
+
throw new APIError(
|
|
4447
|
+
description || "We couldn't read your ID. Please upload a clearer photo."
|
|
4448
|
+
);
|
|
4449
|
+
}
|
|
4450
|
+
return result;
|
|
4451
|
+
},
|
|
4452
|
+
async scanLpa(source) {
|
|
4453
|
+
return OcrService.scan("LPA", source);
|
|
4454
|
+
}
|
|
4455
|
+
};
|
|
4456
|
+
|
|
4457
|
+
// src/GetStarted/GetStarted.tsx
|
|
4458
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
4459
|
+
var defaultNotify = (type, message) => {
|
|
4460
|
+
if (type === "error") console.error(message);
|
|
4461
|
+
else console.info(message);
|
|
4462
|
+
};
|
|
4463
|
+
var GOVERNMENT_ID_CONFIG = {
|
|
4464
|
+
id: "government-id",
|
|
4465
|
+
label: "Government-issued ID",
|
|
4466
|
+
description: "Current and valid ID",
|
|
4467
|
+
accept: "image/*",
|
|
4468
|
+
maxSizeMB: 5,
|
|
4469
|
+
required: true,
|
|
4470
|
+
hint: "Any image \xB7 up to 5MB",
|
|
4471
|
+
processor: "extraction",
|
|
4472
|
+
icon: import_lu7.LuIdCard
|
|
4473
|
+
};
|
|
4474
|
+
var SIGNATURE_CONFIG = {
|
|
4475
|
+
id: "specimen-signature",
|
|
4476
|
+
label: "Specimen Signature",
|
|
4477
|
+
description: "Signature on plain white paper",
|
|
4478
|
+
accept: "image/png,image/jpeg,application/pdf",
|
|
4479
|
+
maxSizeMB: 5,
|
|
4480
|
+
required: true,
|
|
4481
|
+
hint: "JPG, PNG or PDF \xB7 up to 5MB",
|
|
4482
|
+
processor: "signature",
|
|
4483
|
+
icon: import_lu7.LuSignature
|
|
4484
|
+
};
|
|
4485
|
+
var GetStarted = ({
|
|
4486
|
+
scanId: scanIdFn = OcrService.scanId,
|
|
4487
|
+
onContinue,
|
|
4488
|
+
notify = defaultNotify
|
|
4489
|
+
}) => {
|
|
4490
|
+
const [uploadDialogOpen, setUploadDialogOpen] = (0, import_react34.useState)(false);
|
|
4491
|
+
const [referralDialogOpen, setReferralDialogOpen] = (0, import_react34.useState)(false);
|
|
4492
|
+
const [governmentIdStatus, setGovernmentIdStatus] = (0, import_react34.useState)("idle");
|
|
4493
|
+
const { scanId } = useOcr(scanIdFn);
|
|
4494
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Container_default, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
4495
|
+
import_react33.Box,
|
|
4496
|
+
{
|
|
4497
|
+
p: { base: 0, md: 8 },
|
|
4498
|
+
rounded: "lg",
|
|
4499
|
+
shadow: { base: "none", md: "md" },
|
|
4500
|
+
bg: "white",
|
|
4501
|
+
maxW: "3xl",
|
|
4502
|
+
display: "flex",
|
|
4503
|
+
flexDirection: "column",
|
|
4504
|
+
alignItems: "center",
|
|
4505
|
+
mx: "auto",
|
|
4506
|
+
children: [
|
|
4507
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react33.VStack, { gap: 4, align: "stretch", children: [
|
|
4508
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react33.Box, { textAlign: "center", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_st_peter_ui8.H3, { children: "Let's Get Started" }) }),
|
|
4509
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_st_peter_ui8.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" }),
|
|
4510
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react33.Box, { bg: "gray.50", p: 8, rounded: "md", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react33.VStack, { align: "start", gap: 2, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react33.Box, { mb: 4, display: "flex", flexDirection: "column", gap: 2, children: [
|
|
4511
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_st_peter_ui8.BaseText, { fontWeight: "bold", children: "Required Information" }),
|
|
4512
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_st_peter_ui8.BaseText, { children: "1. Full Name" }),
|
|
4513
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_st_peter_ui8.BaseText, { children: "2. Nationality" }),
|
|
4514
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_st_peter_ui8.BaseText, { children: "3. Mobile Number" }),
|
|
4515
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_st_peter_ui8.BaseText, { children: "4. Email Address" }),
|
|
4516
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_st_peter_ui8.BaseText, { children: "5. Date of Birth" }),
|
|
4517
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_st_peter_ui8.BaseText, { children: "6. Complete Address" }),
|
|
4518
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_st_peter_ui8.BaseText, { children: "7. Beneficiary/ies" }),
|
|
4519
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_st_peter_ui8.BaseText, { fontWeight: "bold", children: "Required Documents" }),
|
|
4520
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_st_peter_ui8.BaseText, { children: "1. Current and Valid Government-issued ID" }),
|
|
4521
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_st_peter_ui8.BaseText, { children: "2. Specimen Signature" })
|
|
4522
|
+
] }) }) })
|
|
4523
|
+
] }),
|
|
4524
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react33.Box, { textAlign: "end", children: [
|
|
4525
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
4526
|
+
import_react33.Dialog.Root,
|
|
4527
|
+
{
|
|
4528
|
+
size: { mdDown: "full", md: "md" },
|
|
4529
|
+
open: uploadDialogOpen,
|
|
4530
|
+
onOpenChange: (details) => setUploadDialogOpen(details.open),
|
|
4531
|
+
children: [
|
|
4532
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react33.Dialog.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4533
|
+
import_react33.Button,
|
|
4534
|
+
{
|
|
4535
|
+
w: { base: "sm", md: "2xl" },
|
|
4536
|
+
mt: { base: 4, md: 8 },
|
|
4537
|
+
onClick: () => setUploadDialogOpen(true),
|
|
4538
|
+
children: "CONTINUE"
|
|
4539
|
+
}
|
|
4540
|
+
) }),
|
|
4541
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react33.Portal, { children: [
|
|
4542
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react33.Dialog.Backdrop, {}),
|
|
4543
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react33.Dialog.Positioner, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react33.Dialog.Content, { children: [
|
|
4544
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react33.Dialog.Header, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react33.Dialog.Title, { children: "Upload Requirements" }) }),
|
|
4545
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react33.Dialog.Body, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react33.VStack, { gap: 6, align: "stretch", children: [
|
|
4546
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(info_card_default, { children: "To continue, please upload a valid ID. The system will use it to populate your information automatically." }),
|
|
4547
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4548
|
+
DocumentUploadCard,
|
|
4549
|
+
{
|
|
4550
|
+
config: GOVERNMENT_ID_CONFIG,
|
|
4551
|
+
onStatusChange: setGovernmentIdStatus,
|
|
4552
|
+
onProcess: scanId,
|
|
4553
|
+
onError: (message) => notify("error", message)
|
|
4554
|
+
}
|
|
4555
|
+
),
|
|
4556
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4557
|
+
DocumentUploadCard,
|
|
4558
|
+
{
|
|
4559
|
+
config: SIGNATURE_CONFIG,
|
|
4560
|
+
onError: (message) => notify("error", message)
|
|
4561
|
+
}
|
|
4562
|
+
)
|
|
4563
|
+
] }) }),
|
|
4564
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react33.Dialog.Footer, { display: "flex", justifyContent: "space-between", children: [
|
|
4565
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react33.Dialog.ActionTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_st_peter_ui8.CancelButton, {}) }),
|
|
4566
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4567
|
+
import_st_peter_ui8.NextButton,
|
|
4568
|
+
{
|
|
4569
|
+
onClick: () => {
|
|
4570
|
+
if (governmentIdStatus === "uploading" || governmentIdStatus === "processing") {
|
|
4571
|
+
notify("info", "Please wait while we read your ID.");
|
|
4572
|
+
return;
|
|
4573
|
+
}
|
|
4574
|
+
if (governmentIdStatus !== "completed") {
|
|
4575
|
+
notify("error", "Please upload a government-issued ID.");
|
|
4576
|
+
return;
|
|
4577
|
+
}
|
|
4578
|
+
setUploadDialogOpen(false);
|
|
4579
|
+
setReferralDialogOpen(true);
|
|
4580
|
+
}
|
|
4581
|
+
}
|
|
4582
|
+
)
|
|
4583
|
+
] }),
|
|
4584
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react33.Dialog.CloseTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react33.CloseButton, { size: "sm" }) })
|
|
4585
|
+
] }) })
|
|
4586
|
+
] })
|
|
4587
|
+
]
|
|
4588
|
+
}
|
|
4589
|
+
),
|
|
4590
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4591
|
+
import_react33.Dialog.Root,
|
|
4592
|
+
{
|
|
4593
|
+
placement: "center",
|
|
4594
|
+
open: referralDialogOpen,
|
|
4595
|
+
onOpenChange: (details) => setReferralDialogOpen(details.open),
|
|
4596
|
+
size: { mdDown: "full", md: "md" },
|
|
4597
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react33.Portal, { children: [
|
|
4598
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react33.Dialog.Backdrop, {}),
|
|
4599
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react33.Dialog.Positioner, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react33.Dialog.Content, { children: [
|
|
4600
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react33.Dialog.Header, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react33.Dialog.Title, { children: "Referral Agent" }) }),
|
|
4601
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react33.Dialog.Body, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react33.VStack, { align: "stretch", gap: 4, children: [
|
|
4602
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_st_peter_ui8.Body, { children: "Do you have an referral agent? (optional)" }),
|
|
4603
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react33.Input, { placeholder: "Enter agent name" })
|
|
4604
|
+
] }) }),
|
|
4605
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react33.Dialog.Footer, { display: "flex", justifyContent: "space-between", children: [
|
|
4606
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4607
|
+
import_react33.Button,
|
|
4608
|
+
{
|
|
4609
|
+
variant: "outline",
|
|
4610
|
+
onClick: () => {
|
|
4611
|
+
setReferralDialogOpen(false);
|
|
4612
|
+
onContinue?.();
|
|
4613
|
+
},
|
|
4614
|
+
children: "Skip"
|
|
4615
|
+
}
|
|
4616
|
+
),
|
|
4617
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4618
|
+
import_st_peter_ui8.PrimaryMdButton,
|
|
4619
|
+
{
|
|
4620
|
+
onClick: () => {
|
|
4621
|
+
setReferralDialogOpen(false);
|
|
4622
|
+
onContinue?.();
|
|
4623
|
+
},
|
|
4624
|
+
children: "Continue"
|
|
4625
|
+
}
|
|
4626
|
+
)
|
|
4627
|
+
] }),
|
|
4628
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react33.Dialog.CloseTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react33.CloseButton, { size: "sm" }) })
|
|
4629
|
+
] }) })
|
|
4630
|
+
] })
|
|
4631
|
+
}
|
|
4632
|
+
)
|
|
4633
|
+
] })
|
|
4634
|
+
]
|
|
4635
|
+
}
|
|
4636
|
+
) });
|
|
4637
|
+
};
|
|
4638
|
+
var GetStarted_default = GetStarted;
|
|
4639
|
+
|
|
4640
|
+
// src/Generic/BottomQuickActions.tsx
|
|
4641
|
+
var import_react35 = __toESM(require("react"));
|
|
4642
|
+
var import_react36 = require("@chakra-ui/react");
|
|
4643
|
+
var import_lu8 = require("react-icons/lu");
|
|
3576
4644
|
var import_link = __toESM(require("next/link"));
|
|
3577
|
-
var
|
|
4645
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
3578
4646
|
var SHEET_BG = BRAND_COLORS.white;
|
|
3579
4647
|
var DRAG_COLOR = BRAND_COLORS.neutralBorder;
|
|
3580
4648
|
var ITEM_BG = BRAND_COLORS.white;
|
|
@@ -3591,15 +4659,15 @@ var SUBTITLE_COLOR = BRAND_COLORS.grey;
|
|
|
3591
4659
|
var LABEL_COLOR = BRAND_COLORS.neutralText;
|
|
3592
4660
|
var DESC_COLOR = BRAND_COLORS.grey;
|
|
3593
4661
|
var CHEVRON_COLOR = BRAND_COLORS.ashWhite;
|
|
3594
|
-
var QuickActionsHeaderCard =
|
|
4662
|
+
var QuickActionsHeaderCard = import_react35.default.memo(
|
|
3595
4663
|
({
|
|
3596
4664
|
initials,
|
|
3597
4665
|
avatarBg = AVATAR_DEFAULT_BG,
|
|
3598
4666
|
label,
|
|
3599
4667
|
meta,
|
|
3600
4668
|
trailing
|
|
3601
|
-
}) => /* @__PURE__ */ (0,
|
|
3602
|
-
|
|
4669
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
4670
|
+
import_react36.HStack,
|
|
3603
4671
|
{
|
|
3604
4672
|
gap: STANDARD_SPACING.sm,
|
|
3605
4673
|
px: STANDARD_SPACING.sm,
|
|
@@ -3609,8 +4677,8 @@ var QuickActionsHeaderCard = import_react28.default.memo(
|
|
|
3609
4677
|
borderWidth: "1px",
|
|
3610
4678
|
borderColor: HEADER_CARD_BORDER,
|
|
3611
4679
|
children: [
|
|
3612
|
-
initials && /* @__PURE__ */ (0,
|
|
3613
|
-
|
|
4680
|
+
initials && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
4681
|
+
import_react36.Flex,
|
|
3614
4682
|
{
|
|
3615
4683
|
w: "40px",
|
|
3616
4684
|
h: "40px",
|
|
@@ -3619,8 +4687,8 @@ var QuickActionsHeaderCard = import_react28.default.memo(
|
|
|
3619
4687
|
align: "center",
|
|
3620
4688
|
justify: "center",
|
|
3621
4689
|
flexShrink: 0,
|
|
3622
|
-
children: /* @__PURE__ */ (0,
|
|
3623
|
-
|
|
4690
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
4691
|
+
import_react36.Text,
|
|
3624
4692
|
{
|
|
3625
4693
|
fontSize: "14px",
|
|
3626
4694
|
fontWeight: "700",
|
|
@@ -3631,9 +4699,9 @@ var QuickActionsHeaderCard = import_react28.default.memo(
|
|
|
3631
4699
|
)
|
|
3632
4700
|
}
|
|
3633
4701
|
),
|
|
3634
|
-
/* @__PURE__ */ (0,
|
|
3635
|
-
/* @__PURE__ */ (0,
|
|
3636
|
-
|
|
4702
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react36.Box, { flex: "1", minW: 0, children: [
|
|
4703
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
4704
|
+
import_react36.Text,
|
|
3637
4705
|
{
|
|
3638
4706
|
fontSize: "15px",
|
|
3639
4707
|
fontWeight: "700",
|
|
@@ -3645,8 +4713,8 @@ var QuickActionsHeaderCard = import_react28.default.memo(
|
|
|
3645
4713
|
children: label
|
|
3646
4714
|
}
|
|
3647
4715
|
),
|
|
3648
|
-
meta && /* @__PURE__ */ (0,
|
|
3649
|
-
|
|
4716
|
+
meta && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
4717
|
+
import_react36.Text,
|
|
3650
4718
|
{
|
|
3651
4719
|
fontSize: "12px",
|
|
3652
4720
|
color: SUBTITLE_COLOR,
|
|
@@ -3667,11 +4735,11 @@ var QuickActionsHeaderCard = import_react28.default.memo(
|
|
|
3667
4735
|
var ITEM_TRANSITION = {
|
|
3668
4736
|
transition: "background 0.15s ease, transform 0.1s ease"
|
|
3669
4737
|
};
|
|
3670
|
-
var ActionItem =
|
|
4738
|
+
var ActionItem = import_react35.default.memo(({ action }) => {
|
|
3671
4739
|
const iconBg = action.iconBg ?? DEFAULT_ICON_BG;
|
|
3672
4740
|
const iconColor = action.iconColor ?? DEFAULT_ICON_COLOR;
|
|
3673
|
-
const inner = /* @__PURE__ */ (0,
|
|
3674
|
-
|
|
4741
|
+
const inner = /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
4742
|
+
import_react36.HStack,
|
|
3675
4743
|
{
|
|
3676
4744
|
gap: STANDARD_SPACING.sm,
|
|
3677
4745
|
px: STANDARD_SPACING.sm,
|
|
@@ -3693,8 +4761,8 @@ var ActionItem = import_react28.default.memo(({ action }) => {
|
|
|
3693
4761
|
_active: { bg: ITEM_ACTIVE_BG, transform: "scale(0.99)" },
|
|
3694
4762
|
style: ITEM_TRANSITION,
|
|
3695
4763
|
children: [
|
|
3696
|
-
/* @__PURE__ */ (0,
|
|
3697
|
-
|
|
4764
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
4765
|
+
import_react36.Flex,
|
|
3698
4766
|
{
|
|
3699
4767
|
w: "40px",
|
|
3700
4768
|
h: "40px",
|
|
@@ -3703,12 +4771,12 @@ var ActionItem = import_react28.default.memo(({ action }) => {
|
|
|
3703
4771
|
align: "center",
|
|
3704
4772
|
justify: "center",
|
|
3705
4773
|
flexShrink: 0,
|
|
3706
|
-
children: /* @__PURE__ */ (0,
|
|
4774
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react36.Icon, { as: action.icon, boxSize: "20px", color: iconColor })
|
|
3707
4775
|
}
|
|
3708
4776
|
),
|
|
3709
|
-
/* @__PURE__ */ (0,
|
|
3710
|
-
/* @__PURE__ */ (0,
|
|
3711
|
-
|
|
4777
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react36.Box, { flex: "1", minW: 0, children: [
|
|
4778
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
4779
|
+
import_react36.Text,
|
|
3712
4780
|
{
|
|
3713
4781
|
fontSize: "15px",
|
|
3714
4782
|
fontWeight: "600",
|
|
@@ -3717,8 +4785,8 @@ var ActionItem = import_react28.default.memo(({ action }) => {
|
|
|
3717
4785
|
children: action.label
|
|
3718
4786
|
}
|
|
3719
4787
|
),
|
|
3720
|
-
action.description && /* @__PURE__ */ (0,
|
|
3721
|
-
|
|
4788
|
+
action.description && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
4789
|
+
import_react36.Text,
|
|
3722
4790
|
{
|
|
3723
4791
|
fontSize: "12px",
|
|
3724
4792
|
color: DESC_COLOR,
|
|
@@ -3731,10 +4799,10 @@ var ActionItem = import_react28.default.memo(({ action }) => {
|
|
|
3731
4799
|
}
|
|
3732
4800
|
)
|
|
3733
4801
|
] }),
|
|
3734
|
-
/* @__PURE__ */ (0,
|
|
3735
|
-
|
|
4802
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
4803
|
+
import_react36.Icon,
|
|
3736
4804
|
{
|
|
3737
|
-
as:
|
|
4805
|
+
as: import_lu8.LuChevronRight,
|
|
3738
4806
|
boxSize: "18px",
|
|
3739
4807
|
color: CHEVRON_COLOR,
|
|
3740
4808
|
flexShrink: 0
|
|
@@ -3744,7 +4812,7 @@ var ActionItem = import_react28.default.memo(({ action }) => {
|
|
|
3744
4812
|
}
|
|
3745
4813
|
);
|
|
3746
4814
|
if (action.href) {
|
|
3747
|
-
return /* @__PURE__ */ (0,
|
|
4815
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3748
4816
|
import_link.default,
|
|
3749
4817
|
{
|
|
3750
4818
|
href: action.href,
|
|
@@ -3763,16 +4831,16 @@ var BottomQuickActions = ({
|
|
|
3763
4831
|
headerSlot,
|
|
3764
4832
|
actions
|
|
3765
4833
|
}) => {
|
|
3766
|
-
return /* @__PURE__ */ (0,
|
|
3767
|
-
|
|
4834
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
4835
|
+
import_react36.Drawer.Root,
|
|
3768
4836
|
{
|
|
3769
4837
|
open,
|
|
3770
4838
|
onOpenChange: (e) => onOpenChange(e.open),
|
|
3771
4839
|
placement: "bottom",
|
|
3772
|
-
children: /* @__PURE__ */ (0,
|
|
3773
|
-
/* @__PURE__ */ (0,
|
|
3774
|
-
/* @__PURE__ */ (0,
|
|
3775
|
-
|
|
4840
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react36.Portal, { children: [
|
|
4841
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react36.Drawer.Backdrop, {}),
|
|
4842
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react36.Drawer.Positioner, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
4843
|
+
import_react36.Drawer.Content,
|
|
3776
4844
|
{
|
|
3777
4845
|
borderTopRadius: "l3",
|
|
3778
4846
|
borderBottomRadius: "0",
|
|
@@ -3782,8 +4850,8 @@ var BottomQuickActions = ({
|
|
|
3782
4850
|
pb: `calc(${STANDARD_SPACING.sm} + env(safe-area-inset-bottom))`,
|
|
3783
4851
|
boxShadow: STANDARD_SHADOWS.level4,
|
|
3784
4852
|
children: [
|
|
3785
|
-
/* @__PURE__ */ (0,
|
|
3786
|
-
|
|
4853
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react36.Flex, { justify: "center", pt: "10px", pb: "4px", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
4854
|
+
import_react36.Box,
|
|
3787
4855
|
{
|
|
3788
4856
|
w: "36px",
|
|
3789
4857
|
h: "4px",
|
|
@@ -3791,17 +4859,17 @@ var BottomQuickActions = ({
|
|
|
3791
4859
|
bg: DRAG_COLOR
|
|
3792
4860
|
}
|
|
3793
4861
|
) }),
|
|
3794
|
-
/* @__PURE__ */ (0,
|
|
3795
|
-
|
|
4862
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
4863
|
+
import_react36.Drawer.Header,
|
|
3796
4864
|
{
|
|
3797
4865
|
px: STANDARD_SPACING.sm,
|
|
3798
4866
|
pt: "12px",
|
|
3799
4867
|
pb: "0",
|
|
3800
4868
|
borderBottomWidth: "0",
|
|
3801
|
-
children: /* @__PURE__ */ (0,
|
|
3802
|
-
/* @__PURE__ */ (0,
|
|
3803
|
-
/* @__PURE__ */ (0,
|
|
3804
|
-
|
|
4869
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react36.Flex, { align: "flex-start", justify: "space-between", gap: "12px", children: [
|
|
4870
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react36.Box, { flex: "1", minW: 0, children: [
|
|
4871
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
4872
|
+
import_react36.Drawer.Title,
|
|
3805
4873
|
{
|
|
3806
4874
|
fontSize: "18px",
|
|
3807
4875
|
fontWeight: "700",
|
|
@@ -3811,8 +4879,8 @@ var BottomQuickActions = ({
|
|
|
3811
4879
|
children: title
|
|
3812
4880
|
}
|
|
3813
4881
|
),
|
|
3814
|
-
subtitle && /* @__PURE__ */ (0,
|
|
3815
|
-
|
|
4882
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
4883
|
+
import_react36.Text,
|
|
3816
4884
|
{
|
|
3817
4885
|
fontSize: "13px",
|
|
3818
4886
|
color: SUBTITLE_COLOR,
|
|
@@ -3823,8 +4891,8 @@ var BottomQuickActions = ({
|
|
|
3823
4891
|
}
|
|
3824
4892
|
)
|
|
3825
4893
|
] }),
|
|
3826
|
-
/* @__PURE__ */ (0,
|
|
3827
|
-
|
|
4894
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react36.Drawer.CloseTrigger, { asChild: true, mt: "2px", flexShrink: 0, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
4895
|
+
import_react36.CloseButton,
|
|
3828
4896
|
{
|
|
3829
4897
|
size: "sm",
|
|
3830
4898
|
color: BRAND_COLORS.neutralText,
|
|
@@ -3835,15 +4903,15 @@ var BottomQuickActions = ({
|
|
|
3835
4903
|
] })
|
|
3836
4904
|
}
|
|
3837
4905
|
),
|
|
3838
|
-
/* @__PURE__ */ (0,
|
|
3839
|
-
|
|
4906
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
4907
|
+
import_react36.Drawer.Body,
|
|
3840
4908
|
{
|
|
3841
4909
|
px: STANDARD_SPACING.sm,
|
|
3842
4910
|
pt: STANDARD_SPACING.sm,
|
|
3843
4911
|
pb: "4px",
|
|
3844
4912
|
children: [
|
|
3845
|
-
headerSlot && /* @__PURE__ */ (0,
|
|
3846
|
-
/* @__PURE__ */ (0,
|
|
4913
|
+
headerSlot && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react36.Box, { mb: STANDARD_SPACING.xs, children: headerSlot }),
|
|
4914
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react36.VStack, { gap: STANDARD_SPACING.xs, align: "stretch", children: actions.map((action, i) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ActionItem, { action }, i)) })
|
|
3847
4915
|
]
|
|
3848
4916
|
}
|
|
3849
4917
|
)
|
|
@@ -3857,18 +4925,18 @@ var BottomQuickActions = ({
|
|
|
3857
4925
|
var BottomQuickActions_default = BottomQuickActions;
|
|
3858
4926
|
|
|
3859
4927
|
// src/Generic/NotifyInstall.tsx
|
|
3860
|
-
var
|
|
3861
|
-
var
|
|
3862
|
-
var
|
|
4928
|
+
var import_react38 = require("react");
|
|
4929
|
+
var import_react39 = require("@chakra-ui/react");
|
|
4930
|
+
var import_react40 = require("motion/react");
|
|
3863
4931
|
var import_fi2 = require("react-icons/fi");
|
|
3864
4932
|
|
|
3865
4933
|
// src/hooks/useNotifyInstall.ts
|
|
3866
|
-
var
|
|
4934
|
+
var import_react37 = require("react");
|
|
3867
4935
|
function useNotifyInstall() {
|
|
3868
|
-
const [isInstalled, setIsInstalled] = (0,
|
|
3869
|
-
const [isMobile, setIsMobile] = (0,
|
|
3870
|
-
const [installPrompt, setInstallPrompt] = (0,
|
|
3871
|
-
(0,
|
|
4936
|
+
const [isInstalled, setIsInstalled] = (0, import_react37.useState)(false);
|
|
4937
|
+
const [isMobile, setIsMobile] = (0, import_react37.useState)(false);
|
|
4938
|
+
const [installPrompt, setInstallPrompt] = (0, import_react37.useState)(null);
|
|
4939
|
+
(0, import_react37.useEffect)(() => {
|
|
3872
4940
|
const mobile = /Android|iPhone|iPad|iPod/i.test(navigator.userAgent);
|
|
3873
4941
|
setIsMobile(mobile);
|
|
3874
4942
|
const installed = window.matchMedia("(display-mode: standalone)").matches || window.navigator.standalone === true;
|
|
@@ -3900,7 +4968,7 @@ function useNotifyInstall() {
|
|
|
3900
4968
|
}
|
|
3901
4969
|
|
|
3902
4970
|
// src/Generic/NotifyInstall.tsx
|
|
3903
|
-
var
|
|
4971
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
3904
4972
|
var STEPS = [
|
|
3905
4973
|
{ icon: import_fi2.FiShare, label: "Tap the browser menu or Share button" },
|
|
3906
4974
|
{ icon: import_fi2.FiPlusSquare, label: 'Choose "Add to Home Screen"' }
|
|
@@ -3911,8 +4979,8 @@ function NotifyInstall({
|
|
|
3911
4979
|
appName
|
|
3912
4980
|
}) {
|
|
3913
4981
|
const { isInstalled, isMobile, canInstall, install } = useNotifyInstall();
|
|
3914
|
-
const [isDismissed, setIsDismissed] = (0,
|
|
3915
|
-
(0,
|
|
4982
|
+
const [isDismissed, setIsDismissed] = (0, import_react38.useState)(true);
|
|
4983
|
+
(0, import_react38.useEffect)(() => {
|
|
3916
4984
|
if (localStorage.getItem(DISMISSED_KEY) !== "true") {
|
|
3917
4985
|
setIsDismissed(false);
|
|
3918
4986
|
}
|
|
@@ -3922,11 +4990,11 @@ function NotifyInstall({
|
|
|
3922
4990
|
setIsDismissed(true);
|
|
3923
4991
|
};
|
|
3924
4992
|
const showPrompt = isMobile && !isInstalled && !isDismissed;
|
|
3925
|
-
return /* @__PURE__ */ (0,
|
|
4993
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
|
|
3926
4994
|
children,
|
|
3927
|
-
/* @__PURE__ */ (0,
|
|
3928
|
-
/* @__PURE__ */ (0,
|
|
3929
|
-
|
|
4995
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react40.AnimatePresence, { children: showPrompt && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
|
|
4996
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4997
|
+
import_react40.motion.div,
|
|
3930
4998
|
{
|
|
3931
4999
|
initial: { opacity: 0 },
|
|
3932
5000
|
animate: { opacity: 1 },
|
|
@@ -3944,8 +5012,8 @@ function NotifyInstall({
|
|
|
3944
5012
|
},
|
|
3945
5013
|
"install-backdrop"
|
|
3946
5014
|
),
|
|
3947
|
-
/* @__PURE__ */ (0,
|
|
3948
|
-
|
|
5015
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
5016
|
+
import_react40.motion.div,
|
|
3949
5017
|
{
|
|
3950
5018
|
initial: { y: "100%" },
|
|
3951
5019
|
animate: { y: 0 },
|
|
@@ -3963,7 +5031,7 @@ function NotifyInstall({
|
|
|
3963
5031
|
paddingBottom: "env(safe-area-inset-bottom)"
|
|
3964
5032
|
},
|
|
3965
5033
|
children: [
|
|
3966
|
-
/* @__PURE__ */ (0,
|
|
5034
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3967
5035
|
"button",
|
|
3968
5036
|
{
|
|
3969
5037
|
"aria-label": "Dismiss install prompt",
|
|
@@ -3982,12 +5050,12 @@ function NotifyInstall({
|
|
|
3982
5050
|
justifyContent: "center",
|
|
3983
5051
|
color: "#9ca3af"
|
|
3984
5052
|
},
|
|
3985
|
-
children: /* @__PURE__ */ (0,
|
|
5053
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_fi2.FiX, { size: 18 })
|
|
3986
5054
|
}
|
|
3987
5055
|
),
|
|
3988
|
-
/* @__PURE__ */ (0,
|
|
3989
|
-
/* @__PURE__ */ (0,
|
|
3990
|
-
|
|
5056
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_react39.VStack, { gap: 6, textAlign: "center", px: 6, py: 8, children: [
|
|
5057
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
5058
|
+
import_react39.Flex,
|
|
3991
5059
|
{
|
|
3992
5060
|
boxSize: 16,
|
|
3993
5061
|
align: "center",
|
|
@@ -3996,12 +5064,12 @@ function NotifyInstall({
|
|
|
3996
5064
|
bg: "green.50",
|
|
3997
5065
|
color: "green.600",
|
|
3998
5066
|
shadow: "sm",
|
|
3999
|
-
children: /* @__PURE__ */ (0,
|
|
5067
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react39.Icon, { as: import_fi2.FiDownload, boxSize: 8 })
|
|
4000
5068
|
}
|
|
4001
5069
|
),
|
|
4002
|
-
/* @__PURE__ */ (0,
|
|
4003
|
-
/* @__PURE__ */ (0,
|
|
4004
|
-
|
|
5070
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_react39.VStack, { gap: 2, children: [
|
|
5071
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
5072
|
+
import_react39.Text,
|
|
4005
5073
|
{
|
|
4006
5074
|
fontSize: "lg",
|
|
4007
5075
|
fontWeight: "bold",
|
|
@@ -4013,10 +5081,10 @@ function NotifyInstall({
|
|
|
4013
5081
|
]
|
|
4014
5082
|
}
|
|
4015
5083
|
),
|
|
4016
|
-
/* @__PURE__ */ (0,
|
|
5084
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react39.Text, { fontSize: "sm", color: "gray.500", lineHeight: "tall", children: "Add the app to your home screen for a faster, app-like experience before continuing." })
|
|
4017
5085
|
] }),
|
|
4018
|
-
canInstall ? /* @__PURE__ */ (0,
|
|
4019
|
-
|
|
5086
|
+
canInstall ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
5087
|
+
import_react39.Button,
|
|
4020
5088
|
{
|
|
4021
5089
|
onClick: install,
|
|
4022
5090
|
colorPalette: "green",
|
|
@@ -4024,12 +5092,12 @@ function NotifyInstall({
|
|
|
4024
5092
|
w: "full",
|
|
4025
5093
|
rounded: "xl",
|
|
4026
5094
|
children: [
|
|
4027
|
-
/* @__PURE__ */ (0,
|
|
5095
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react39.Icon, { as: import_fi2.FiDownload }),
|
|
4028
5096
|
"Add to Home Screen"
|
|
4029
5097
|
]
|
|
4030
5098
|
}
|
|
4031
|
-
) : /* @__PURE__ */ (0,
|
|
4032
|
-
|
|
5099
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
5100
|
+
import_react39.VStack,
|
|
4033
5101
|
{
|
|
4034
5102
|
w: "full",
|
|
4035
5103
|
bg: "gray.50",
|
|
@@ -4039,9 +5107,9 @@ function NotifyInstall({
|
|
|
4039
5107
|
p: 4,
|
|
4040
5108
|
gap: 4,
|
|
4041
5109
|
align: "stretch",
|
|
4042
|
-
children: STEPS.map((step, i) => /* @__PURE__ */ (0,
|
|
4043
|
-
/* @__PURE__ */ (0,
|
|
4044
|
-
|
|
5110
|
+
children: STEPS.map((step, i) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_react39.HStack, { gap: 3, align: "center", children: [
|
|
5111
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
5112
|
+
import_react39.Flex,
|
|
4045
5113
|
{
|
|
4046
5114
|
boxSize: 9,
|
|
4047
5115
|
flexShrink: 0,
|
|
@@ -4052,10 +5120,10 @@ function NotifyInstall({
|
|
|
4052
5120
|
borderWidth: "1px",
|
|
4053
5121
|
borderColor: "gray.200",
|
|
4054
5122
|
color: "green.600",
|
|
4055
|
-
children: /* @__PURE__ */ (0,
|
|
5123
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react39.Icon, { as: step.icon, boxSize: 4 })
|
|
4056
5124
|
}
|
|
4057
5125
|
),
|
|
4058
|
-
/* @__PURE__ */ (0,
|
|
5126
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react39.Text, { fontSize: "sm", color: "gray.700", textAlign: "left", children: step.label })
|
|
4059
5127
|
] }, i))
|
|
4060
5128
|
}
|
|
4061
5129
|
)
|
|
@@ -4069,17 +5137,17 @@ function NotifyInstall({
|
|
|
4069
5137
|
}
|
|
4070
5138
|
|
|
4071
5139
|
// src/UserProfile/UserProfile.tsx
|
|
4072
|
-
var
|
|
4073
|
-
var
|
|
5140
|
+
var import_react41 = require("react");
|
|
5141
|
+
var import_react42 = require("@chakra-ui/react");
|
|
4074
5142
|
var import_ri = require("react-icons/ri");
|
|
4075
|
-
var
|
|
5143
|
+
var import_lu9 = require("react-icons/lu");
|
|
4076
5144
|
var import_hi2 = require("react-icons/hi2");
|
|
4077
5145
|
var import_bs = require("react-icons/bs");
|
|
4078
5146
|
var import_lia = require("react-icons/lia");
|
|
4079
5147
|
var import_fa5 = require("react-icons/fa");
|
|
4080
5148
|
var import_md = require("react-icons/md");
|
|
4081
5149
|
var import_io5 = require("react-icons/io5");
|
|
4082
|
-
var
|
|
5150
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
4083
5151
|
var NAVBAR_STORAGE_KEY = "profile-navbar-quick-items";
|
|
4084
5152
|
var FONT_SIZE_STORAGE_KEY = "profile-font-size-pref";
|
|
4085
5153
|
var DEFAULT_NAV_HREFS = ["/", "/plans", "/pay-my-plan", "/claims"];
|
|
@@ -4095,8 +5163,8 @@ var ALL_NAV_OPTIONS = [
|
|
|
4095
5163
|
key: "/",
|
|
4096
5164
|
title: "Home",
|
|
4097
5165
|
href: "/",
|
|
4098
|
-
Icon:
|
|
4099
|
-
activeIcon:
|
|
5166
|
+
Icon: import_lu9.LuHouse,
|
|
5167
|
+
activeIcon: import_lu9.LuHouse,
|
|
4100
5168
|
match: (p) => p === "/",
|
|
4101
5169
|
roles: ["branch", "bmstl", "sales-agent"]
|
|
4102
5170
|
},
|
|
@@ -4113,8 +5181,8 @@ var ALL_NAV_OPTIONS = [
|
|
|
4113
5181
|
key: "/pay-my-plan",
|
|
4114
5182
|
title: "Pay",
|
|
4115
5183
|
href: "/pay-my-plan",
|
|
4116
|
-
Icon:
|
|
4117
|
-
activeIcon:
|
|
5184
|
+
Icon: import_lu9.LuCreditCard,
|
|
5185
|
+
activeIcon: import_lu9.LuCreditCard,
|
|
4118
5186
|
match: (p) => p.startsWith("/pay-my-plan") || p.startsWith("/account/pay-my-plan") || p.startsWith("/order-summary"),
|
|
4119
5187
|
roles: ["branch", "bmstl", "sales-agent"]
|
|
4120
5188
|
},
|
|
@@ -4122,8 +5190,8 @@ var ALL_NAV_OPTIONS = [
|
|
|
4122
5190
|
key: "/claims",
|
|
4123
5191
|
title: "Claim",
|
|
4124
5192
|
href: "/claims",
|
|
4125
|
-
Icon:
|
|
4126
|
-
activeIcon:
|
|
5193
|
+
Icon: import_lu9.LuFileText,
|
|
5194
|
+
activeIcon: import_lu9.LuFileText,
|
|
4127
5195
|
match: (p) => p.startsWith("/claims"),
|
|
4128
5196
|
roles: ["branch", "bmstl", "sales-agent"]
|
|
4129
5197
|
},
|
|
@@ -4377,28 +5445,28 @@ function ReusableProfile({
|
|
|
4377
5445
|
onTwoFactorChange,
|
|
4378
5446
|
onToast = noopToast
|
|
4379
5447
|
}) {
|
|
4380
|
-
const [profileView, setProfileView] = (0,
|
|
4381
|
-
const [fallbackColorMode, setFallbackColorMode] = (0,
|
|
5448
|
+
const [profileView, setProfileView] = (0, import_react41.useState)("main");
|
|
5449
|
+
const [fallbackColorMode, setFallbackColorMode] = (0, import_react41.useState)("light");
|
|
4382
5450
|
const colorMode = controlledColorMode ?? fallbackColorMode;
|
|
4383
|
-
const [fontSize, setFontSizeLocal] = (0,
|
|
4384
|
-
const [quickNavHrefs, setQuickNavHrefs] = (0,
|
|
4385
|
-
const [replacingIdx, setReplacingIdx] = (0,
|
|
4386
|
-
const [editName, setEditName] = (0,
|
|
4387
|
-
const [editLoading, setEditLoading] = (0,
|
|
4388
|
-
const [currentPw, setCurrentPw] = (0,
|
|
4389
|
-
const [newPw, setNewPw] = (0,
|
|
4390
|
-
const [confirmPw, setConfirmPw] = (0,
|
|
4391
|
-
const [showCurrentPw, setShowCurrentPw] = (0,
|
|
4392
|
-
const [showNewPw, setShowNewPw] = (0,
|
|
4393
|
-
const [showConfirmPw, setShowConfirmPw] = (0,
|
|
4394
|
-
const [pwLoading, setPwLoading] = (0,
|
|
4395
|
-
const [twoFactorEnabled, setTwoFactorEnabled] = (0,
|
|
5451
|
+
const [fontSize, setFontSizeLocal] = (0, import_react41.useState)("md");
|
|
5452
|
+
const [quickNavHrefs, setQuickNavHrefs] = (0, import_react41.useState)(initialQuickNavHrefs);
|
|
5453
|
+
const [replacingIdx, setReplacingIdx] = (0, import_react41.useState)(null);
|
|
5454
|
+
const [editName, setEditName] = (0, import_react41.useState)(user.displayName);
|
|
5455
|
+
const [editLoading, setEditLoading] = (0, import_react41.useState)(false);
|
|
5456
|
+
const [currentPw, setCurrentPw] = (0, import_react41.useState)("");
|
|
5457
|
+
const [newPw, setNewPw] = (0, import_react41.useState)("");
|
|
5458
|
+
const [confirmPw, setConfirmPw] = (0, import_react41.useState)("");
|
|
5459
|
+
const [showCurrentPw, setShowCurrentPw] = (0, import_react41.useState)(false);
|
|
5460
|
+
const [showNewPw, setShowNewPw] = (0, import_react41.useState)(false);
|
|
5461
|
+
const [showConfirmPw, setShowConfirmPw] = (0, import_react41.useState)(false);
|
|
5462
|
+
const [pwLoading, setPwLoading] = (0, import_react41.useState)(false);
|
|
5463
|
+
const [twoFactorEnabled, setTwoFactorEnabled] = (0, import_react41.useState)(
|
|
4396
5464
|
initialTwoFactorEnabled
|
|
4397
5465
|
);
|
|
4398
|
-
const [isMounted, setIsMounted] = (0,
|
|
4399
|
-
const isDesktopRaw = (0,
|
|
5466
|
+
const [isMounted, setIsMounted] = (0, import_react41.useState)(false);
|
|
5467
|
+
const isDesktopRaw = (0, import_react42.useBreakpointValue)({ base: false, md: true });
|
|
4400
5468
|
const isDesktop = isMounted ? isDesktopRaw ?? false : false;
|
|
4401
|
-
(0,
|
|
5469
|
+
(0, import_react41.useEffect)(() => {
|
|
4402
5470
|
setIsMounted(true);
|
|
4403
5471
|
if (!enableLocalStorage || typeof window === "undefined") return;
|
|
4404
5472
|
setFontSizeLocal(localStorage.getItem(FONT_SIZE_STORAGE_KEY) ?? "md");
|
|
@@ -4409,10 +5477,10 @@ function ReusableProfile({
|
|
|
4409
5477
|
setQuickNavHrefs(initialQuickNavHrefs);
|
|
4410
5478
|
}
|
|
4411
5479
|
}, [enableLocalStorage, initialQuickNavHrefs, storageKey]);
|
|
4412
|
-
(0,
|
|
5480
|
+
(0, import_react41.useEffect)(() => {
|
|
4413
5481
|
setEditName(user.displayName);
|
|
4414
5482
|
}, [user.displayName]);
|
|
4415
|
-
const availableOptions = (0,
|
|
5483
|
+
const availableOptions = (0, import_react41.useMemo)(
|
|
4416
5484
|
() => availableNavOptions.filter(
|
|
4417
5485
|
(option) => !user.role || option.roles.includes(user.role)
|
|
4418
5486
|
),
|
|
@@ -4540,9 +5608,9 @@ function ReusableProfile({
|
|
|
4540
5608
|
}
|
|
4541
5609
|
};
|
|
4542
5610
|
const roleLabel = user.role ? ROLE_LABELS[user.role] ?? user.role : "";
|
|
4543
|
-
const mainContent = /* @__PURE__ */ (0,
|
|
4544
|
-
/* @__PURE__ */ (0,
|
|
4545
|
-
|
|
5611
|
+
const mainContent = /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
|
|
5612
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
5613
|
+
import_react42.Box,
|
|
4546
5614
|
{
|
|
4547
5615
|
bg: "var(--chakra-colors-primary)",
|
|
4548
5616
|
pt: 12,
|
|
@@ -4550,21 +5618,21 @@ function ReusableProfile({
|
|
|
4550
5618
|
px: 4,
|
|
4551
5619
|
textAlign: "center",
|
|
4552
5620
|
children: [
|
|
4553
|
-
/* @__PURE__ */ (0,
|
|
4554
|
-
|
|
5621
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
5622
|
+
import_react42.Avatar.Root,
|
|
4555
5623
|
{
|
|
4556
5624
|
size: "2xl",
|
|
4557
5625
|
mx: "auto",
|
|
4558
5626
|
mb: 4,
|
|
4559
5627
|
colorPalette: pickPalette(user.displayName || "U"),
|
|
4560
5628
|
children: [
|
|
4561
|
-
user.avatarSrc && /* @__PURE__ */ (0,
|
|
4562
|
-
/* @__PURE__ */ (0,
|
|
5629
|
+
user.avatarSrc && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.Avatar.Image, { src: user.avatarSrc, alt: user.displayName }),
|
|
5630
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.Avatar.Fallback, { name: user.displayName })
|
|
4563
5631
|
]
|
|
4564
5632
|
}
|
|
4565
5633
|
),
|
|
4566
|
-
/* @__PURE__ */ (0,
|
|
4567
|
-
|
|
5634
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
5635
|
+
import_react42.Text,
|
|
4568
5636
|
{
|
|
4569
5637
|
color: "white",
|
|
4570
5638
|
fontWeight: "bold",
|
|
@@ -4574,9 +5642,9 @@ function ReusableProfile({
|
|
|
4574
5642
|
children: user.displayName
|
|
4575
5643
|
}
|
|
4576
5644
|
),
|
|
4577
|
-
user.email && /* @__PURE__ */ (0,
|
|
4578
|
-
roleLabel && /* @__PURE__ */ (0,
|
|
4579
|
-
|
|
5645
|
+
user.email && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.Text, { color: "rgba(255,255,255,0.75)", fontSize: "sm", mb: 2, children: user.email }),
|
|
5646
|
+
roleLabel && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.Box, { display: "inline-flex", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
5647
|
+
import_react42.Badge,
|
|
4580
5648
|
{
|
|
4581
5649
|
bg: "rgba(255,255,255,0.15)",
|
|
4582
5650
|
color: "white",
|
|
@@ -4592,9 +5660,9 @@ function ReusableProfile({
|
|
|
4592
5660
|
]
|
|
4593
5661
|
}
|
|
4594
5662
|
),
|
|
4595
|
-
/* @__PURE__ */ (0,
|
|
4596
|
-
/* @__PURE__ */ (0,
|
|
4597
|
-
|
|
5663
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react42.Box, { px: 4, pt: 5, pb: 1, children: [
|
|
5664
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
5665
|
+
import_react42.Text,
|
|
4598
5666
|
{
|
|
4599
5667
|
fontSize: "xs",
|
|
4600
5668
|
fontWeight: "bold",
|
|
@@ -4605,8 +5673,8 @@ function ReusableProfile({
|
|
|
4605
5673
|
children: "Account"
|
|
4606
5674
|
}
|
|
4607
5675
|
),
|
|
4608
|
-
/* @__PURE__ */ (0,
|
|
4609
|
-
|
|
5676
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
5677
|
+
import_react42.Box,
|
|
4610
5678
|
{
|
|
4611
5679
|
as: "button",
|
|
4612
5680
|
w: "full",
|
|
@@ -4614,8 +5682,8 @@ function ReusableProfile({
|
|
|
4614
5682
|
_hover: { opacity: 0.7 },
|
|
4615
5683
|
transition: "opacity 0.15s",
|
|
4616
5684
|
onClick: () => setProfileView("edit-account"),
|
|
4617
|
-
children: /* @__PURE__ */ (0,
|
|
4618
|
-
|
|
5685
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
5686
|
+
import_react42.Flex,
|
|
4619
5687
|
{
|
|
4620
5688
|
justify: "space-between",
|
|
4621
5689
|
align: "center",
|
|
@@ -4624,9 +5692,9 @@ function ReusableProfile({
|
|
|
4624
5692
|
borderRadius: "lg",
|
|
4625
5693
|
bg: isDesktop && profileView === "edit-account" ? "gray.100" : void 0,
|
|
4626
5694
|
children: [
|
|
4627
|
-
/* @__PURE__ */ (0,
|
|
4628
|
-
/* @__PURE__ */ (0,
|
|
4629
|
-
|
|
5695
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react42.Flex, { align: "center", gap: 3, children: [
|
|
5696
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
5697
|
+
import_react42.Box,
|
|
4630
5698
|
{
|
|
4631
5699
|
w: "38px",
|
|
4632
5700
|
h: "38px",
|
|
@@ -4637,23 +5705,23 @@ function ReusableProfile({
|
|
|
4637
5705
|
justifyContent: "center",
|
|
4638
5706
|
color: "gray.600",
|
|
4639
5707
|
flexShrink: 0,
|
|
4640
|
-
children: /* @__PURE__ */ (0,
|
|
5708
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lu9.LuUser, { size: 16 })
|
|
4641
5709
|
}
|
|
4642
5710
|
),
|
|
4643
|
-
/* @__PURE__ */ (0,
|
|
4644
|
-
/* @__PURE__ */ (0,
|
|
4645
|
-
/* @__PURE__ */ (0,
|
|
5711
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react42.Box, { children: [
|
|
5712
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.Text, { fontSize: "sm", fontWeight: "semibold", children: "Edit Account" }),
|
|
5713
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.Text, { fontSize: "xs", color: "gray.500", children: "Update your display name and contact details" })
|
|
4646
5714
|
] })
|
|
4647
5715
|
] }),
|
|
4648
|
-
/* @__PURE__ */ (0,
|
|
5716
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lu9.LuChevronRight, { size: 16, color: "var(--chakra-colors-gray-400)" })
|
|
4649
5717
|
]
|
|
4650
5718
|
}
|
|
4651
5719
|
)
|
|
4652
5720
|
}
|
|
4653
5721
|
),
|
|
4654
|
-
/* @__PURE__ */ (0,
|
|
4655
|
-
/* @__PURE__ */ (0,
|
|
4656
|
-
|
|
5722
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.Separator, {}),
|
|
5723
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
5724
|
+
import_react42.Box,
|
|
4657
5725
|
{
|
|
4658
5726
|
as: "button",
|
|
4659
5727
|
w: "full",
|
|
@@ -4664,8 +5732,8 @@ function ReusableProfile({
|
|
|
4664
5732
|
resetPasswordForm();
|
|
4665
5733
|
setProfileView("change-password");
|
|
4666
5734
|
},
|
|
4667
|
-
children: /* @__PURE__ */ (0,
|
|
4668
|
-
|
|
5735
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
5736
|
+
import_react42.Flex,
|
|
4669
5737
|
{
|
|
4670
5738
|
justify: "space-between",
|
|
4671
5739
|
align: "center",
|
|
@@ -4674,9 +5742,9 @@ function ReusableProfile({
|
|
|
4674
5742
|
borderRadius: "lg",
|
|
4675
5743
|
bg: isDesktop && profileView === "change-password" ? "gray.100" : void 0,
|
|
4676
5744
|
children: [
|
|
4677
|
-
/* @__PURE__ */ (0,
|
|
4678
|
-
/* @__PURE__ */ (0,
|
|
4679
|
-
|
|
5745
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react42.Flex, { align: "center", gap: 3, children: [
|
|
5746
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
5747
|
+
import_react42.Box,
|
|
4680
5748
|
{
|
|
4681
5749
|
w: "38px",
|
|
4682
5750
|
h: "38px",
|
|
@@ -4687,25 +5755,25 @@ function ReusableProfile({
|
|
|
4687
5755
|
justifyContent: "center",
|
|
4688
5756
|
color: "gray.600",
|
|
4689
5757
|
flexShrink: 0,
|
|
4690
|
-
children: /* @__PURE__ */ (0,
|
|
5758
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lu9.LuLock, { size: 16 })
|
|
4691
5759
|
}
|
|
4692
5760
|
),
|
|
4693
|
-
/* @__PURE__ */ (0,
|
|
4694
|
-
/* @__PURE__ */ (0,
|
|
4695
|
-
/* @__PURE__ */ (0,
|
|
5761
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react42.Box, { children: [
|
|
5762
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.Text, { fontSize: "sm", fontWeight: "semibold", children: "Change Password" }),
|
|
5763
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.Text, { fontSize: "xs", color: "gray.500", children: "Test locally through the callback prop" })
|
|
4696
5764
|
] })
|
|
4697
5765
|
] }),
|
|
4698
|
-
/* @__PURE__ */ (0,
|
|
5766
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lu9.LuChevronRight, { size: 16, color: "var(--chakra-colors-gray-400)" })
|
|
4699
5767
|
]
|
|
4700
5768
|
}
|
|
4701
5769
|
)
|
|
4702
5770
|
}
|
|
4703
5771
|
),
|
|
4704
|
-
/* @__PURE__ */ (0,
|
|
4705
|
-
/* @__PURE__ */ (0,
|
|
4706
|
-
/* @__PURE__ */ (0,
|
|
4707
|
-
/* @__PURE__ */ (0,
|
|
4708
|
-
|
|
5772
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.Separator, {}),
|
|
5773
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react42.Flex, { justify: "space-between", align: "center", py: 3, children: [
|
|
5774
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react42.Flex, { align: "center", gap: 3, children: [
|
|
5775
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
5776
|
+
import_react42.Box,
|
|
4709
5777
|
{
|
|
4710
5778
|
w: "38px",
|
|
4711
5779
|
h: "38px",
|
|
@@ -4716,16 +5784,16 @@ function ReusableProfile({
|
|
|
4716
5784
|
justifyContent: "center",
|
|
4717
5785
|
color: "gray.600",
|
|
4718
5786
|
flexShrink: 0,
|
|
4719
|
-
children: /* @__PURE__ */ (0,
|
|
5787
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lu9.LuShield, { size: 16 })
|
|
4720
5788
|
}
|
|
4721
5789
|
),
|
|
4722
|
-
/* @__PURE__ */ (0,
|
|
4723
|
-
/* @__PURE__ */ (0,
|
|
4724
|
-
/* @__PURE__ */ (0,
|
|
5790
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react42.Box, { children: [
|
|
5791
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.Text, { fontSize: "sm", fontWeight: "semibold", children: "Two Factor Authentication" }),
|
|
5792
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.Text, { fontSize: "xs", color: "gray.500", children: twoFactorEnabled ? "Enabled" : "Disabled" })
|
|
4725
5793
|
] })
|
|
4726
5794
|
] }),
|
|
4727
|
-
/* @__PURE__ */ (0,
|
|
4728
|
-
|
|
5795
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
5796
|
+
import_react42.Box,
|
|
4729
5797
|
{
|
|
4730
5798
|
role: "switch",
|
|
4731
5799
|
"aria-checked": twoFactorEnabled,
|
|
@@ -4747,8 +5815,8 @@ function ReusableProfile({
|
|
|
4747
5815
|
cursor: "pointer",
|
|
4748
5816
|
flexShrink: 0,
|
|
4749
5817
|
outline: "none",
|
|
4750
|
-
children: /* @__PURE__ */ (0,
|
|
4751
|
-
|
|
5818
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
5819
|
+
import_react42.Box,
|
|
4752
5820
|
{
|
|
4753
5821
|
position: "absolute",
|
|
4754
5822
|
top: "3px",
|
|
@@ -4765,9 +5833,9 @@ function ReusableProfile({
|
|
|
4765
5833
|
)
|
|
4766
5834
|
] })
|
|
4767
5835
|
] }),
|
|
4768
|
-
/* @__PURE__ */ (0,
|
|
4769
|
-
/* @__PURE__ */ (0,
|
|
4770
|
-
|
|
5836
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react42.Box, { px: 4, pt: 4, pb: 2, children: [
|
|
5837
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
5838
|
+
import_react42.Text,
|
|
4771
5839
|
{
|
|
4772
5840
|
fontSize: "xs",
|
|
4773
5841
|
fontWeight: "bold",
|
|
@@ -4778,10 +5846,10 @@ function ReusableProfile({
|
|
|
4778
5846
|
children: "Preferences"
|
|
4779
5847
|
}
|
|
4780
5848
|
),
|
|
4781
|
-
/* @__PURE__ */ (0,
|
|
4782
|
-
/* @__PURE__ */ (0,
|
|
4783
|
-
/* @__PURE__ */ (0,
|
|
4784
|
-
|
|
5849
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react42.Flex, { justify: "space-between", align: "center", py: 3, children: [
|
|
5850
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react42.Flex, { align: "center", gap: 3, children: [
|
|
5851
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
5852
|
+
import_react42.Box,
|
|
4785
5853
|
{
|
|
4786
5854
|
w: "38px",
|
|
4787
5855
|
h: "38px",
|
|
@@ -4792,18 +5860,18 @@ function ReusableProfile({
|
|
|
4792
5860
|
justifyContent: "center",
|
|
4793
5861
|
color: "gray.600",
|
|
4794
5862
|
flexShrink: 0,
|
|
4795
|
-
children: colorMode === "dark" ? /* @__PURE__ */ (0,
|
|
5863
|
+
children: colorMode === "dark" ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lu9.LuMoon, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lu9.LuSun, { size: 16 })
|
|
4796
5864
|
}
|
|
4797
5865
|
),
|
|
4798
|
-
/* @__PURE__ */ (0,
|
|
4799
|
-
/* @__PURE__ */ (0,
|
|
4800
|
-
/* @__PURE__ */ (0,
|
|
5866
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react42.Box, { children: [
|
|
5867
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.Text, { fontSize: "sm", fontWeight: "semibold", children: "Appearance" }),
|
|
5868
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.Text, { fontSize: "xs", color: "gray.500", children: colorMode === "light" ? "Light mode" : "Dark mode" })
|
|
4801
5869
|
] })
|
|
4802
5870
|
] }),
|
|
4803
|
-
/* @__PURE__ */ (0,
|
|
5871
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.HStack, { gap: 1.5, children: ["light", "dark"].map((mode) => {
|
|
4804
5872
|
const isActive = colorMode === mode;
|
|
4805
|
-
return /* @__PURE__ */ (0,
|
|
4806
|
-
|
|
5873
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
5874
|
+
import_react42.Button,
|
|
4807
5875
|
{
|
|
4808
5876
|
size: "sm",
|
|
4809
5877
|
variant: "outline",
|
|
@@ -4818,9 +5886,9 @@ function ReusableProfile({
|
|
|
4818
5886
|
},
|
|
4819
5887
|
onClick: () => handleColorMode(mode),
|
|
4820
5888
|
children: [
|
|
4821
|
-
mode === "light" ? /* @__PURE__ */ (0,
|
|
4822
|
-
/* @__PURE__ */ (0,
|
|
4823
|
-
|
|
5889
|
+
mode === "light" ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lu9.LuSun, { size: 13 }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lu9.LuMoon, { size: 13 }),
|
|
5890
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
5891
|
+
import_react42.Text,
|
|
4824
5892
|
{
|
|
4825
5893
|
fontSize: "xs",
|
|
4826
5894
|
textTransform: "capitalize",
|
|
@@ -4834,11 +5902,11 @@ function ReusableProfile({
|
|
|
4834
5902
|
);
|
|
4835
5903
|
}) })
|
|
4836
5904
|
] }),
|
|
4837
|
-
/* @__PURE__ */ (0,
|
|
4838
|
-
/* @__PURE__ */ (0,
|
|
4839
|
-
/* @__PURE__ */ (0,
|
|
4840
|
-
/* @__PURE__ */ (0,
|
|
4841
|
-
|
|
5905
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.Separator, {}),
|
|
5906
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react42.Flex, { justify: "space-between", align: "center", py: 3, children: [
|
|
5907
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react42.Flex, { align: "center", gap: 3, children: [
|
|
5908
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
5909
|
+
import_react42.Box,
|
|
4842
5910
|
{
|
|
4843
5911
|
w: "38px",
|
|
4844
5912
|
h: "38px",
|
|
@@ -4854,15 +5922,15 @@ function ReusableProfile({
|
|
|
4854
5922
|
children: "A"
|
|
4855
5923
|
}
|
|
4856
5924
|
),
|
|
4857
|
-
/* @__PURE__ */ (0,
|
|
4858
|
-
/* @__PURE__ */ (0,
|
|
4859
|
-
/* @__PURE__ */ (0,
|
|
5925
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react42.Box, { children: [
|
|
5926
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.Text, { fontSize: "sm", fontWeight: "semibold", children: "Text Size" }),
|
|
5927
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.Text, { fontSize: "xs", color: "gray.500", children: fontSizeLabel })
|
|
4860
5928
|
] })
|
|
4861
5929
|
] }),
|
|
4862
|
-
/* @__PURE__ */ (0,
|
|
5930
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.HStack, { gap: 1, children: FONT_SIZES.map((option) => {
|
|
4863
5931
|
const isActive = fontSize === option.value;
|
|
4864
|
-
return /* @__PURE__ */ (0,
|
|
4865
|
-
|
|
5932
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
5933
|
+
import_react42.Button,
|
|
4866
5934
|
{
|
|
4867
5935
|
size: "sm",
|
|
4868
5936
|
variant: "outline",
|
|
@@ -4877,8 +5945,8 @@ function ReusableProfile({
|
|
|
4877
5945
|
},
|
|
4878
5946
|
onClick: () => handleFontSize(option.value),
|
|
4879
5947
|
title: option.title,
|
|
4880
|
-
children: /* @__PURE__ */ (0,
|
|
4881
|
-
|
|
5948
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
5949
|
+
import_react42.Text,
|
|
4882
5950
|
{
|
|
4883
5951
|
fontWeight: isActive ? "bold" : "normal",
|
|
4884
5952
|
style: { fontSize: `${option.scale * 13}px` },
|
|
@@ -4890,9 +5958,9 @@ function ReusableProfile({
|
|
|
4890
5958
|
);
|
|
4891
5959
|
}) })
|
|
4892
5960
|
] }),
|
|
4893
|
-
/* @__PURE__ */ (0,
|
|
4894
|
-
/* @__PURE__ */ (0,
|
|
4895
|
-
|
|
5961
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.Separator, {}),
|
|
5962
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
5963
|
+
import_react42.Box,
|
|
4896
5964
|
{
|
|
4897
5965
|
as: "button",
|
|
4898
5966
|
w: "full",
|
|
@@ -4900,10 +5968,10 @@ function ReusableProfile({
|
|
|
4900
5968
|
_hover: { opacity: 0.7 },
|
|
4901
5969
|
transition: "opacity 0.15s",
|
|
4902
5970
|
onClick: () => setProfileView("navbar-customize"),
|
|
4903
|
-
children: /* @__PURE__ */ (0,
|
|
4904
|
-
/* @__PURE__ */ (0,
|
|
4905
|
-
/* @__PURE__ */ (0,
|
|
4906
|
-
|
|
5971
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react42.Flex, { justify: "space-between", align: "center", py: 3, children: [
|
|
5972
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react42.Flex, { align: "center", gap: 3, children: [
|
|
5973
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
5974
|
+
import_react42.Box,
|
|
4907
5975
|
{
|
|
4908
5976
|
w: "38px",
|
|
4909
5977
|
h: "38px",
|
|
@@ -4914,12 +5982,12 @@ function ReusableProfile({
|
|
|
4914
5982
|
justifyContent: "center",
|
|
4915
5983
|
color: "gray.600",
|
|
4916
5984
|
flexShrink: 0,
|
|
4917
|
-
children: /* @__PURE__ */ (0,
|
|
5985
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lu9.LuArrowLeftRight, { size: 16 })
|
|
4918
5986
|
}
|
|
4919
5987
|
),
|
|
4920
|
-
/* @__PURE__ */ (0,
|
|
4921
|
-
/* @__PURE__ */ (0,
|
|
4922
|
-
/* @__PURE__ */ (0,
|
|
5988
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react42.Box, { children: [
|
|
5989
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.Text, { fontSize: "sm", fontWeight: "semibold", children: "Quick Navigation" }),
|
|
5990
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react42.Text, { fontSize: "xs", color: "gray.500", children: [
|
|
4923
5991
|
quickNavHrefs.length,
|
|
4924
5992
|
" of ",
|
|
4925
5993
|
maxQuickNavItems,
|
|
@@ -4927,13 +5995,13 @@ function ReusableProfile({
|
|
|
4927
5995
|
] })
|
|
4928
5996
|
] })
|
|
4929
5997
|
] }),
|
|
4930
|
-
/* @__PURE__ */ (0,
|
|
5998
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lu9.LuChevronRight, { size: 16, color: "var(--chakra-colors-gray-400)" })
|
|
4931
5999
|
] })
|
|
4932
6000
|
}
|
|
4933
6001
|
)
|
|
4934
6002
|
] }),
|
|
4935
|
-
/* @__PURE__ */ (0,
|
|
4936
|
-
|
|
6003
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.Box, { px: 4, pt: 4, pb: 10, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.VStack, { gap: 2.5, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
6004
|
+
import_react42.Button,
|
|
4937
6005
|
{
|
|
4938
6006
|
w: "full",
|
|
4939
6007
|
variant: "outline",
|
|
@@ -4945,30 +6013,30 @@ function ReusableProfile({
|
|
|
4945
6013
|
}
|
|
4946
6014
|
) }) })
|
|
4947
6015
|
] });
|
|
4948
|
-
const editAccountContent = /* @__PURE__ */ (0,
|
|
4949
|
-
/* @__PURE__ */ (0,
|
|
4950
|
-
/* @__PURE__ */ (0,
|
|
4951
|
-
|
|
6016
|
+
const editAccountContent = /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
|
|
6017
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.Box, { px: 4, pt: 4, pb: 3, borderBottomWidth: "1px", borderColor: "gray.200", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react42.Flex, { align: "center", gap: 2, pr: 10, children: [
|
|
6018
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
6019
|
+
import_react42.IconButton,
|
|
4952
6020
|
{
|
|
4953
6021
|
size: "sm",
|
|
4954
6022
|
variant: "ghost",
|
|
4955
6023
|
"aria-label": "Back",
|
|
4956
6024
|
color: "gray.600",
|
|
4957
6025
|
onClick: () => setProfileView("main"),
|
|
4958
|
-
children: /* @__PURE__ */ (0,
|
|
6026
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lu9.LuChevronLeft, {})
|
|
4959
6027
|
}
|
|
4960
6028
|
),
|
|
4961
|
-
/* @__PURE__ */ (0,
|
|
6029
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.Text, { fontWeight: "bold", fontSize: "md", children: "Edit Account" })
|
|
4962
6030
|
] }) }),
|
|
4963
|
-
/* @__PURE__ */ (0,
|
|
4964
|
-
user.avatarSrc && /* @__PURE__ */ (0,
|
|
4965
|
-
/* @__PURE__ */ (0,
|
|
6031
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.Box, { textAlign: "center", pt: 5, pb: 4, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react42.Avatar.Root, { size: "xl", mx: "auto", mb: 1, children: [
|
|
6032
|
+
user.avatarSrc && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.Avatar.Image, { src: user.avatarSrc, alt: editName }),
|
|
6033
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.Avatar.Fallback, { name: editName })
|
|
4966
6034
|
] }) }),
|
|
4967
|
-
/* @__PURE__ */ (0,
|
|
4968
|
-
/* @__PURE__ */ (0,
|
|
4969
|
-
/* @__PURE__ */ (0,
|
|
4970
|
-
/* @__PURE__ */ (0,
|
|
4971
|
-
|
|
6035
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react42.VStack, { gap: 4, px: 4, pb: 10, align: "stretch", children: [
|
|
6036
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react42.Box, { w: "full", children: [
|
|
6037
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.Text, { fontSize: "xs", fontWeight: "semibold", color: "gray.500", mb: 1.5, children: "Display Name" }),
|
|
6038
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
6039
|
+
import_react42.Input,
|
|
4972
6040
|
{
|
|
4973
6041
|
value: editName,
|
|
4974
6042
|
onChange: (event) => setEditName(event.target.value),
|
|
@@ -4977,10 +6045,10 @@ function ReusableProfile({
|
|
|
4977
6045
|
}
|
|
4978
6046
|
)
|
|
4979
6047
|
] }),
|
|
4980
|
-
/* @__PURE__ */ (0,
|
|
4981
|
-
/* @__PURE__ */ (0,
|
|
4982
|
-
/* @__PURE__ */ (0,
|
|
4983
|
-
|
|
6048
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react42.Box, { w: "full", children: [
|
|
6049
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.Text, { fontSize: "xs", fontWeight: "semibold", color: "gray.500", mb: 1.5, children: "Email" }),
|
|
6050
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
6051
|
+
import_react42.Input,
|
|
4984
6052
|
{
|
|
4985
6053
|
value: user.email ?? "",
|
|
4986
6054
|
readOnly: true,
|
|
@@ -4990,10 +6058,10 @@ function ReusableProfile({
|
|
|
4990
6058
|
}
|
|
4991
6059
|
)
|
|
4992
6060
|
] }),
|
|
4993
|
-
/* @__PURE__ */ (0,
|
|
4994
|
-
/* @__PURE__ */ (0,
|
|
4995
|
-
/* @__PURE__ */ (0,
|
|
4996
|
-
|
|
6061
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react42.Box, { w: "full", children: [
|
|
6062
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.Text, { fontSize: "xs", fontWeight: "semibold", color: "gray.500", mb: 1.5, children: "Mobile Number" }),
|
|
6063
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
6064
|
+
import_react42.Input,
|
|
4997
6065
|
{
|
|
4998
6066
|
value: user.mobileNumber ?? "",
|
|
4999
6067
|
readOnly: true,
|
|
@@ -5003,8 +6071,8 @@ function ReusableProfile({
|
|
|
5003
6071
|
}
|
|
5004
6072
|
)
|
|
5005
6073
|
] }),
|
|
5006
|
-
/* @__PURE__ */ (0,
|
|
5007
|
-
|
|
6074
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
6075
|
+
import_react42.Button,
|
|
5008
6076
|
{
|
|
5009
6077
|
w: "full",
|
|
5010
6078
|
mt: 2,
|
|
@@ -5018,40 +6086,40 @@ function ReusableProfile({
|
|
|
5018
6086
|
)
|
|
5019
6087
|
] })
|
|
5020
6088
|
] });
|
|
5021
|
-
const changePasswordContent = /* @__PURE__ */ (0,
|
|
5022
|
-
/* @__PURE__ */ (0,
|
|
5023
|
-
/* @__PURE__ */ (0,
|
|
5024
|
-
|
|
6089
|
+
const changePasswordContent = /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
|
|
6090
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.Box, { px: 4, pt: 4, pb: 3, borderBottomWidth: "1px", borderColor: "gray.200", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react42.Flex, { align: "center", gap: 2, pr: 10, children: [
|
|
6091
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
6092
|
+
import_react42.IconButton,
|
|
5025
6093
|
{
|
|
5026
6094
|
size: "sm",
|
|
5027
6095
|
variant: "ghost",
|
|
5028
6096
|
"aria-label": "Back",
|
|
5029
6097
|
color: "gray.600",
|
|
5030
6098
|
onClick: () => setProfileView("main"),
|
|
5031
|
-
children: /* @__PURE__ */ (0,
|
|
6099
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lu9.LuChevronLeft, {})
|
|
5032
6100
|
}
|
|
5033
6101
|
),
|
|
5034
|
-
/* @__PURE__ */ (0,
|
|
6102
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.Text, { fontWeight: "bold", fontSize: "md", children: "Change Password" })
|
|
5035
6103
|
] }) }),
|
|
5036
|
-
/* @__PURE__ */ (0,
|
|
5037
|
-
/* @__PURE__ */ (0,
|
|
5038
|
-
/* @__PURE__ */ (0,
|
|
5039
|
-
/* @__PURE__ */ (0,
|
|
5040
|
-
|
|
6104
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react42.VStack, { gap: 5, px: 4, pt: 6, pb: 10, children: [
|
|
6105
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react42.Box, { w: "full", children: [
|
|
6106
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.Text, { fontSize: "xs", fontWeight: "semibold", color: "gray.500", mb: 1.5, children: "Current Password" }),
|
|
6107
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
6108
|
+
import_react42.InputGroup,
|
|
5041
6109
|
{
|
|
5042
|
-
endElement: /* @__PURE__ */ (0,
|
|
5043
|
-
|
|
6110
|
+
endElement: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
6111
|
+
import_react42.IconButton,
|
|
5044
6112
|
{
|
|
5045
6113
|
size: "xs",
|
|
5046
6114
|
variant: "ghost",
|
|
5047
6115
|
color: "gray.500",
|
|
5048
6116
|
"aria-label": "Toggle current password visibility",
|
|
5049
6117
|
onClick: () => setShowCurrentPw(!showCurrentPw),
|
|
5050
|
-
children: showCurrentPw ? /* @__PURE__ */ (0,
|
|
6118
|
+
children: showCurrentPw ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lu9.LuEyeOff, { size: 15 }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lu9.LuEye, { size: 15 })
|
|
5051
6119
|
}
|
|
5052
6120
|
),
|
|
5053
|
-
children: /* @__PURE__ */ (0,
|
|
5054
|
-
|
|
6121
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
6122
|
+
import_react42.Input,
|
|
5055
6123
|
{
|
|
5056
6124
|
type: showCurrentPw ? "text" : "password",
|
|
5057
6125
|
value: currentPw,
|
|
@@ -5063,24 +6131,24 @@ function ReusableProfile({
|
|
|
5063
6131
|
}
|
|
5064
6132
|
)
|
|
5065
6133
|
] }),
|
|
5066
|
-
/* @__PURE__ */ (0,
|
|
5067
|
-
/* @__PURE__ */ (0,
|
|
5068
|
-
/* @__PURE__ */ (0,
|
|
5069
|
-
|
|
6134
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react42.Box, { w: "full", children: [
|
|
6135
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.Text, { fontSize: "xs", fontWeight: "semibold", color: "gray.500", mb: 1.5, children: "New Password" }),
|
|
6136
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
6137
|
+
import_react42.InputGroup,
|
|
5070
6138
|
{
|
|
5071
|
-
endElement: /* @__PURE__ */ (0,
|
|
5072
|
-
|
|
6139
|
+
endElement: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
6140
|
+
import_react42.IconButton,
|
|
5073
6141
|
{
|
|
5074
6142
|
size: "xs",
|
|
5075
6143
|
variant: "ghost",
|
|
5076
6144
|
color: "gray.500",
|
|
5077
6145
|
"aria-label": "Toggle new password visibility",
|
|
5078
6146
|
onClick: () => setShowNewPw(!showNewPw),
|
|
5079
|
-
children: showNewPw ? /* @__PURE__ */ (0,
|
|
6147
|
+
children: showNewPw ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lu9.LuEyeOff, { size: 15 }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lu9.LuEye, { size: 15 })
|
|
5080
6148
|
}
|
|
5081
6149
|
),
|
|
5082
|
-
children: /* @__PURE__ */ (0,
|
|
5083
|
-
|
|
6150
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
6151
|
+
import_react42.Input,
|
|
5084
6152
|
{
|
|
5085
6153
|
type: showNewPw ? "text" : "password",
|
|
5086
6154
|
value: newPw,
|
|
@@ -5091,9 +6159,9 @@ function ReusableProfile({
|
|
|
5091
6159
|
)
|
|
5092
6160
|
}
|
|
5093
6161
|
),
|
|
5094
|
-
newPw && /* @__PURE__ */ (0,
|
|
5095
|
-
/* @__PURE__ */ (0,
|
|
5096
|
-
|
|
6162
|
+
newPw && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react42.Box, { mt: 2, children: [
|
|
6163
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.Flex, { gap: 1, mb: 1, children: [1, 2, 3, 4, 5].map((i) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
6164
|
+
import_react42.Box,
|
|
5097
6165
|
{
|
|
5098
6166
|
flex: 1,
|
|
5099
6167
|
h: "3px",
|
|
@@ -5103,27 +6171,27 @@ function ReusableProfile({
|
|
|
5103
6171
|
},
|
|
5104
6172
|
i
|
|
5105
6173
|
)) }),
|
|
5106
|
-
/* @__PURE__ */ (0,
|
|
6174
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.Text, { fontSize: "xs", color: pwMeta.color, fontWeight: "medium", children: pwMeta.label })
|
|
5107
6175
|
] })
|
|
5108
6176
|
] }),
|
|
5109
|
-
/* @__PURE__ */ (0,
|
|
5110
|
-
/* @__PURE__ */ (0,
|
|
5111
|
-
/* @__PURE__ */ (0,
|
|
5112
|
-
|
|
6177
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react42.Box, { w: "full", children: [
|
|
6178
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.Text, { fontSize: "xs", fontWeight: "semibold", color: "gray.500", mb: 1.5, children: "Confirm New Password" }),
|
|
6179
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
6180
|
+
import_react42.InputGroup,
|
|
5113
6181
|
{
|
|
5114
|
-
endElement: /* @__PURE__ */ (0,
|
|
5115
|
-
|
|
6182
|
+
endElement: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
6183
|
+
import_react42.IconButton,
|
|
5116
6184
|
{
|
|
5117
6185
|
size: "xs",
|
|
5118
6186
|
variant: "ghost",
|
|
5119
6187
|
color: "gray.500",
|
|
5120
6188
|
"aria-label": "Toggle confirm password visibility",
|
|
5121
6189
|
onClick: () => setShowConfirmPw(!showConfirmPw),
|
|
5122
|
-
children: showConfirmPw ? /* @__PURE__ */ (0,
|
|
6190
|
+
children: showConfirmPw ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lu9.LuEyeOff, { size: 15 }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lu9.LuEye, { size: 15 })
|
|
5123
6191
|
}
|
|
5124
6192
|
),
|
|
5125
|
-
children: /* @__PURE__ */ (0,
|
|
5126
|
-
|
|
6193
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
6194
|
+
import_react42.Input,
|
|
5127
6195
|
{
|
|
5128
6196
|
type: showConfirmPw ? "text" : "password",
|
|
5129
6197
|
value: confirmPw,
|
|
@@ -5134,10 +6202,10 @@ function ReusableProfile({
|
|
|
5134
6202
|
)
|
|
5135
6203
|
}
|
|
5136
6204
|
),
|
|
5137
|
-
confirmPw && confirmPw !== newPw && /* @__PURE__ */ (0,
|
|
6205
|
+
confirmPw && confirmPw !== newPw && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.Text, { fontSize: "xs", color: "red.500", mt: 1, children: "Passwords do not match" })
|
|
5138
6206
|
] }),
|
|
5139
|
-
/* @__PURE__ */ (0,
|
|
5140
|
-
|
|
6207
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
6208
|
+
import_react42.Button,
|
|
5141
6209
|
{
|
|
5142
6210
|
w: "full",
|
|
5143
6211
|
mt: 1,
|
|
@@ -5152,9 +6220,9 @@ function ReusableProfile({
|
|
|
5152
6220
|
)
|
|
5153
6221
|
] })
|
|
5154
6222
|
] });
|
|
5155
|
-
const navbarCustomizeContent = /* @__PURE__ */ (0,
|
|
5156
|
-
/* @__PURE__ */ (0,
|
|
5157
|
-
|
|
6223
|
+
const navbarCustomizeContent = /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
|
|
6224
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
6225
|
+
import_react42.Box,
|
|
5158
6226
|
{
|
|
5159
6227
|
px: 4,
|
|
5160
6228
|
pt: 4,
|
|
@@ -5165,9 +6233,9 @@ function ReusableProfile({
|
|
|
5165
6233
|
top: 0,
|
|
5166
6234
|
bg: "bg",
|
|
5167
6235
|
zIndex: 1,
|
|
5168
|
-
children: /* @__PURE__ */ (0,
|
|
5169
|
-
/* @__PURE__ */ (0,
|
|
5170
|
-
|
|
6236
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react42.Flex, { align: "center", gap: 2, pr: 10, children: [
|
|
6237
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
6238
|
+
import_react42.IconButton,
|
|
5171
6239
|
{
|
|
5172
6240
|
size: "sm",
|
|
5173
6241
|
variant: "ghost",
|
|
@@ -5177,12 +6245,12 @@ function ReusableProfile({
|
|
|
5177
6245
|
setReplacingIdx(null);
|
|
5178
6246
|
setProfileView("main");
|
|
5179
6247
|
},
|
|
5180
|
-
children: /* @__PURE__ */ (0,
|
|
6248
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lu9.LuChevronLeft, {})
|
|
5181
6249
|
}
|
|
5182
6250
|
),
|
|
5183
|
-
/* @__PURE__ */ (0,
|
|
5184
|
-
/* @__PURE__ */ (0,
|
|
5185
|
-
/* @__PURE__ */ (0,
|
|
6251
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react42.Box, { children: [
|
|
6252
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.Text, { fontWeight: "bold", fontSize: "md", children: "Quick Navigation" }),
|
|
6253
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react42.Text, { fontSize: "xs", color: "gray.500", children: [
|
|
5186
6254
|
"Choose up to ",
|
|
5187
6255
|
maxQuickNavItems,
|
|
5188
6256
|
" shortcuts for the bottom bar"
|
|
@@ -5191,10 +6259,10 @@ function ReusableProfile({
|
|
|
5191
6259
|
] })
|
|
5192
6260
|
}
|
|
5193
6261
|
),
|
|
5194
|
-
/* @__PURE__ */ (0,
|
|
5195
|
-
/* @__PURE__ */ (0,
|
|
5196
|
-
/* @__PURE__ */ (0,
|
|
5197
|
-
|
|
6262
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react42.Box, { px: 4, pt: 5, pb: 2, children: [
|
|
6263
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react42.Flex, { align: "center", justify: "space-between", mb: 3, children: [
|
|
6264
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
6265
|
+
import_react42.Text,
|
|
5198
6266
|
{
|
|
5199
6267
|
fontSize: "xs",
|
|
5200
6268
|
fontWeight: "bold",
|
|
@@ -5204,8 +6272,8 @@ function ReusableProfile({
|
|
|
5204
6272
|
children: "Pinned"
|
|
5205
6273
|
}
|
|
5206
6274
|
),
|
|
5207
|
-
/* @__PURE__ */ (0,
|
|
5208
|
-
|
|
6275
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
6276
|
+
import_react42.Text,
|
|
5209
6277
|
{
|
|
5210
6278
|
fontSize: "xs",
|
|
5211
6279
|
color: quickNavHrefs.length >= maxQuickNavItems ? "orange.500" : "gray.400",
|
|
@@ -5218,8 +6286,8 @@ function ReusableProfile({
|
|
|
5218
6286
|
}
|
|
5219
6287
|
)
|
|
5220
6288
|
] }),
|
|
5221
|
-
quickNavHrefs.length === 0 ? /* @__PURE__ */ (0,
|
|
5222
|
-
|
|
6289
|
+
quickNavHrefs.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
6290
|
+
import_react42.Flex,
|
|
5223
6291
|
{
|
|
5224
6292
|
align: "center",
|
|
5225
6293
|
justify: "center",
|
|
@@ -5228,18 +6296,18 @@ function ReusableProfile({
|
|
|
5228
6296
|
borderWidth: "1px",
|
|
5229
6297
|
borderStyle: "dashed",
|
|
5230
6298
|
borderColor: "gray.200",
|
|
5231
|
-
children: /* @__PURE__ */ (0,
|
|
6299
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.Text, { fontSize: "sm", color: "gray.400", children: "No items pinned \u2014 add from below" })
|
|
5232
6300
|
}
|
|
5233
|
-
) : /* @__PURE__ */ (0,
|
|
6301
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.VStack, { gap: 0, children: quickNavHrefs.map((href, idx) => {
|
|
5234
6302
|
const option = availableOptions.find((item) => item.key === href);
|
|
5235
6303
|
if (!option) return null;
|
|
5236
6304
|
const ItemIcon = option.Icon;
|
|
5237
6305
|
const isFirst = idx === 0;
|
|
5238
6306
|
const isLast = idx === quickNavHrefs.length - 1;
|
|
5239
6307
|
const isReplacing = replacingIdx === idx;
|
|
5240
|
-
return /* @__PURE__ */ (0,
|
|
5241
|
-
/* @__PURE__ */ (0,
|
|
5242
|
-
|
|
6308
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react42.Box, { w: "full", children: [
|
|
6309
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
6310
|
+
import_react42.Flex,
|
|
5243
6311
|
{
|
|
5244
6312
|
justify: "space-between",
|
|
5245
6313
|
align: "center",
|
|
@@ -5251,9 +6319,9 @@ function ReusableProfile({
|
|
|
5251
6319
|
borderColor: isReplacing ? "orange.200" : void 0,
|
|
5252
6320
|
transition: "all 0.15s",
|
|
5253
6321
|
children: [
|
|
5254
|
-
/* @__PURE__ */ (0,
|
|
5255
|
-
/* @__PURE__ */ (0,
|
|
5256
|
-
|
|
6322
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react42.Flex, { align: "center", gap: 3, children: [
|
|
6323
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
6324
|
+
import_react42.Box,
|
|
5257
6325
|
{
|
|
5258
6326
|
w: "36px",
|
|
5259
6327
|
h: "36px",
|
|
@@ -5264,13 +6332,13 @@ function ReusableProfile({
|
|
|
5264
6332
|
justifyContent: "center",
|
|
5265
6333
|
color: "white",
|
|
5266
6334
|
flexShrink: 0,
|
|
5267
|
-
children: /* @__PURE__ */ (0,
|
|
6335
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ItemIcon, { size: 15 })
|
|
5268
6336
|
}
|
|
5269
6337
|
),
|
|
5270
|
-
/* @__PURE__ */ (0,
|
|
5271
|
-
/* @__PURE__ */ (0,
|
|
5272
|
-
isReplacing && /* @__PURE__ */ (0,
|
|
5273
|
-
|
|
6338
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react42.Box, { children: [
|
|
6339
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.Text, { fontSize: "sm", fontWeight: "medium", children: option.title }),
|
|
6340
|
+
isReplacing && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
6341
|
+
import_react42.Text,
|
|
5274
6342
|
{
|
|
5275
6343
|
fontSize: "xs",
|
|
5276
6344
|
color: "orange.500",
|
|
@@ -5280,9 +6348,9 @@ function ReusableProfile({
|
|
|
5280
6348
|
)
|
|
5281
6349
|
] })
|
|
5282
6350
|
] }),
|
|
5283
|
-
/* @__PURE__ */ (0,
|
|
5284
|
-
/* @__PURE__ */ (0,
|
|
5285
|
-
|
|
6351
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react42.HStack, { gap: 0.5, children: [
|
|
6352
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
6353
|
+
import_react42.IconButton,
|
|
5286
6354
|
{
|
|
5287
6355
|
size: "xs",
|
|
5288
6356
|
variant: "ghost",
|
|
@@ -5290,11 +6358,11 @@ function ReusableProfile({
|
|
|
5290
6358
|
color: "gray.500",
|
|
5291
6359
|
disabled: isFirst || isReplacing,
|
|
5292
6360
|
onClick: () => moveNavItem(idx, -1),
|
|
5293
|
-
children: /* @__PURE__ */ (0,
|
|
6361
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lu9.LuChevronUp, { size: 14 })
|
|
5294
6362
|
}
|
|
5295
6363
|
),
|
|
5296
|
-
/* @__PURE__ */ (0,
|
|
5297
|
-
|
|
6364
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
6365
|
+
import_react42.IconButton,
|
|
5298
6366
|
{
|
|
5299
6367
|
size: "xs",
|
|
5300
6368
|
variant: "ghost",
|
|
@@ -5302,11 +6370,11 @@ function ReusableProfile({
|
|
|
5302
6370
|
color: "gray.500",
|
|
5303
6371
|
disabled: isLast || isReplacing,
|
|
5304
6372
|
onClick: () => moveNavItem(idx, 1),
|
|
5305
|
-
children: /* @__PURE__ */ (0,
|
|
6373
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lu9.LuChevronDown, { size: 14 })
|
|
5306
6374
|
}
|
|
5307
6375
|
),
|
|
5308
|
-
/* @__PURE__ */ (0,
|
|
5309
|
-
|
|
6376
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
6377
|
+
import_react42.IconButton,
|
|
5310
6378
|
{
|
|
5311
6379
|
size: "xs",
|
|
5312
6380
|
variant: isReplacing ? "solid" : "ghost",
|
|
@@ -5315,11 +6383,11 @@ function ReusableProfile({
|
|
|
5315
6383
|
color: isReplacing ? "white" : "gray.500",
|
|
5316
6384
|
_hover: { bg: isReplacing ? "orange.500" : "gray.100" },
|
|
5317
6385
|
onClick: () => setReplacingIdx(isReplacing ? null : idx),
|
|
5318
|
-
children: /* @__PURE__ */ (0,
|
|
6386
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lu9.LuArrowLeftRight, { size: 13 })
|
|
5319
6387
|
}
|
|
5320
6388
|
),
|
|
5321
|
-
/* @__PURE__ */ (0,
|
|
5322
|
-
|
|
6389
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
6390
|
+
import_react42.IconButton,
|
|
5323
6391
|
{
|
|
5324
6392
|
size: "xs",
|
|
5325
6393
|
variant: "ghost",
|
|
@@ -5328,23 +6396,23 @@ function ReusableProfile({
|
|
|
5328
6396
|
_hover: { bg: "red.50" },
|
|
5329
6397
|
disabled: isReplacing,
|
|
5330
6398
|
onClick: () => removeNavItem(href),
|
|
5331
|
-
children: /* @__PURE__ */ (0,
|
|
6399
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lu9.LuX, { size: 14 })
|
|
5332
6400
|
}
|
|
5333
6401
|
)
|
|
5334
6402
|
] })
|
|
5335
6403
|
]
|
|
5336
6404
|
}
|
|
5337
6405
|
),
|
|
5338
|
-
!isLast && /* @__PURE__ */ (0,
|
|
6406
|
+
!isLast && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.Separator, {})
|
|
5339
6407
|
] }, href);
|
|
5340
6408
|
}) })
|
|
5341
6409
|
] }),
|
|
5342
|
-
/* @__PURE__ */ (0,
|
|
5343
|
-
/* @__PURE__ */ (0,
|
|
5344
|
-
/* @__PURE__ */ (0,
|
|
5345
|
-
replacingIdx !== null ? /* @__PURE__ */ (0,
|
|
5346
|
-
/* @__PURE__ */ (0,
|
|
5347
|
-
|
|
6410
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.Separator, { mx: 4, my: 1 }),
|
|
6411
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react42.Box, { px: 4, pt: 4, pb: 10, children: [
|
|
6412
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react42.Flex, { align: "center", justify: "space-between", mb: 3, children: [
|
|
6413
|
+
replacingIdx !== null ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react42.Box, { children: [
|
|
6414
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
6415
|
+
import_react42.Text,
|
|
5348
6416
|
{
|
|
5349
6417
|
fontSize: "xs",
|
|
5350
6418
|
fontWeight: "bold",
|
|
@@ -5354,15 +6422,15 @@ function ReusableProfile({
|
|
|
5354
6422
|
children: "Select Replacement"
|
|
5355
6423
|
}
|
|
5356
6424
|
),
|
|
5357
|
-
/* @__PURE__ */ (0,
|
|
6425
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react42.Text, { fontSize: "xs", color: "gray.500", mt: 0.5, children: [
|
|
5358
6426
|
'for "',
|
|
5359
6427
|
availableOptions.find(
|
|
5360
6428
|
(item) => item.key === quickNavHrefs[replacingIdx]
|
|
5361
6429
|
)?.title,
|
|
5362
6430
|
'"'
|
|
5363
6431
|
] })
|
|
5364
|
-
] }) : /* @__PURE__ */ (0,
|
|
5365
|
-
|
|
6432
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
6433
|
+
import_react42.Text,
|
|
5366
6434
|
{
|
|
5367
6435
|
fontSize: "xs",
|
|
5368
6436
|
fontWeight: "bold",
|
|
@@ -5372,8 +6440,8 @@ function ReusableProfile({
|
|
|
5372
6440
|
children: "Available"
|
|
5373
6441
|
}
|
|
5374
6442
|
),
|
|
5375
|
-
replacingIdx !== null && /* @__PURE__ */ (0,
|
|
5376
|
-
|
|
6443
|
+
replacingIdx !== null && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
6444
|
+
import_react42.Button,
|
|
5377
6445
|
{
|
|
5378
6446
|
size: "xs",
|
|
5379
6447
|
variant: "ghost",
|
|
@@ -5383,17 +6451,17 @@ function ReusableProfile({
|
|
|
5383
6451
|
}
|
|
5384
6452
|
)
|
|
5385
6453
|
] }),
|
|
5386
|
-
unpinnedOptions.length === 0 ? /* @__PURE__ */ (0,
|
|
6454
|
+
unpinnedOptions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.Text, { fontSize: "sm", color: "gray.400", py: 3, textAlign: "center", children: "All available items are pinned" }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.VStack, { gap: 0, children: unpinnedOptions.map((option, idx) => {
|
|
5387
6455
|
const ItemIcon = option.Icon;
|
|
5388
6456
|
const isLast = idx === unpinnedOptions.length - 1;
|
|
5389
6457
|
const isReplacingMode = replacingIdx !== null;
|
|
5390
6458
|
const canAdd = quickNavHrefs.length < maxQuickNavItems;
|
|
5391
6459
|
const actionEnabled = isReplacingMode || canAdd;
|
|
5392
|
-
return /* @__PURE__ */ (0,
|
|
5393
|
-
/* @__PURE__ */ (0,
|
|
5394
|
-
/* @__PURE__ */ (0,
|
|
5395
|
-
/* @__PURE__ */ (0,
|
|
5396
|
-
|
|
6460
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react42.Box, { w: "full", children: [
|
|
6461
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react42.Flex, { justify: "space-between", align: "center", py: 2.5, children: [
|
|
6462
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react42.Flex, { align: "center", gap: 3, children: [
|
|
6463
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
6464
|
+
import_react42.Box,
|
|
5397
6465
|
{
|
|
5398
6466
|
w: "36px",
|
|
5399
6467
|
h: "36px",
|
|
@@ -5404,11 +6472,11 @@ function ReusableProfile({
|
|
|
5404
6472
|
justifyContent: "center",
|
|
5405
6473
|
color: isReplacingMode ? "orange.500" : "gray.500",
|
|
5406
6474
|
flexShrink: 0,
|
|
5407
|
-
children: /* @__PURE__ */ (0,
|
|
6475
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ItemIcon, { size: 15 })
|
|
5408
6476
|
}
|
|
5409
6477
|
),
|
|
5410
|
-
/* @__PURE__ */ (0,
|
|
5411
|
-
|
|
6478
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
6479
|
+
import_react42.Text,
|
|
5412
6480
|
{
|
|
5413
6481
|
fontSize: "sm",
|
|
5414
6482
|
fontWeight: "medium",
|
|
@@ -5417,8 +6485,8 @@ function ReusableProfile({
|
|
|
5417
6485
|
}
|
|
5418
6486
|
)
|
|
5419
6487
|
] }),
|
|
5420
|
-
isReplacingMode ? /* @__PURE__ */ (0,
|
|
5421
|
-
|
|
6488
|
+
isReplacingMode ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
6489
|
+
import_react42.IconButton,
|
|
5422
6490
|
{
|
|
5423
6491
|
size: "xs",
|
|
5424
6492
|
variant: "outline",
|
|
@@ -5427,10 +6495,10 @@ function ReusableProfile({
|
|
|
5427
6495
|
color: "orange.500",
|
|
5428
6496
|
_hover: { bg: "orange.50" },
|
|
5429
6497
|
onClick: () => replaceNavItem(replacingIdx, option.key),
|
|
5430
|
-
children: /* @__PURE__ */ (0,
|
|
6498
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lu9.LuArrowLeftRight, { size: 13 })
|
|
5431
6499
|
}
|
|
5432
|
-
) : /* @__PURE__ */ (0,
|
|
5433
|
-
|
|
6500
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
6501
|
+
import_react42.IconButton,
|
|
5434
6502
|
{
|
|
5435
6503
|
size: "xs",
|
|
5436
6504
|
variant: "outline",
|
|
@@ -5440,19 +6508,19 @@ function ReusableProfile({
|
|
|
5440
6508
|
color: canAdd ? "var(--chakra-colors-primary)" : "gray.300",
|
|
5441
6509
|
_hover: { bg: canAdd ? "blue.50" : "transparent" },
|
|
5442
6510
|
onClick: () => addNavItem(option.key),
|
|
5443
|
-
children: /* @__PURE__ */ (0,
|
|
6511
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lu9.LuPlus, { size: 13 })
|
|
5444
6512
|
}
|
|
5445
6513
|
)
|
|
5446
6514
|
] }),
|
|
5447
|
-
!isLast && /* @__PURE__ */ (0,
|
|
6515
|
+
!isLast && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.Separator, {})
|
|
5448
6516
|
] }, option.key);
|
|
5449
6517
|
}) })
|
|
5450
6518
|
] })
|
|
5451
6519
|
] });
|
|
5452
6520
|
const subViewContent = profileView === "edit-account" ? editAccountContent : profileView === "change-password" ? changePasswordContent : profileView === "navbar-customize" ? navbarCustomizeContent : null;
|
|
5453
6521
|
if (isDesktop) {
|
|
5454
|
-
return /* @__PURE__ */ (0,
|
|
5455
|
-
|
|
6522
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
6523
|
+
import_react42.Flex,
|
|
5456
6524
|
{
|
|
5457
6525
|
maxW: "6xl",
|
|
5458
6526
|
mx: "auto",
|
|
@@ -5462,8 +6530,8 @@ function ReusableProfile({
|
|
|
5462
6530
|
p: { md: 6, lg: 8 },
|
|
5463
6531
|
align: "start",
|
|
5464
6532
|
children: [
|
|
5465
|
-
/* @__PURE__ */ (0,
|
|
5466
|
-
|
|
6533
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
6534
|
+
import_react42.Box,
|
|
5467
6535
|
{
|
|
5468
6536
|
w: { md: "300px", lg: "340px" },
|
|
5469
6537
|
flexShrink: 0,
|
|
@@ -5477,8 +6545,8 @@ function ReusableProfile({
|
|
|
5477
6545
|
children: mainContent
|
|
5478
6546
|
}
|
|
5479
6547
|
),
|
|
5480
|
-
/* @__PURE__ */ (0,
|
|
5481
|
-
|
|
6548
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
6549
|
+
import_react42.Box,
|
|
5482
6550
|
{
|
|
5483
6551
|
flex: "1",
|
|
5484
6552
|
minW: 0,
|
|
@@ -5488,8 +6556,8 @@ function ReusableProfile({
|
|
|
5488
6556
|
overflow: "hidden",
|
|
5489
6557
|
bg: "bg",
|
|
5490
6558
|
minH: "540px",
|
|
5491
|
-
children: subViewContent ?? /* @__PURE__ */ (0,
|
|
5492
|
-
|
|
6559
|
+
children: subViewContent ?? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
6560
|
+
import_react42.Flex,
|
|
5493
6561
|
{
|
|
5494
6562
|
direction: "column",
|
|
5495
6563
|
align: "center",
|
|
@@ -5499,8 +6567,8 @@ function ReusableProfile({
|
|
|
5499
6567
|
textAlign: "center",
|
|
5500
6568
|
color: "gray.400",
|
|
5501
6569
|
children: [
|
|
5502
|
-
/* @__PURE__ */ (0,
|
|
5503
|
-
|
|
6570
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
6571
|
+
import_react42.Box,
|
|
5504
6572
|
{
|
|
5505
6573
|
w: "56px",
|
|
5506
6574
|
h: "56px",
|
|
@@ -5510,10 +6578,10 @@ function ReusableProfile({
|
|
|
5510
6578
|
alignItems: "center",
|
|
5511
6579
|
justifyContent: "center",
|
|
5512
6580
|
mb: 4,
|
|
5513
|
-
children: /* @__PURE__ */ (0,
|
|
6581
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lu9.LuUser, { size: 24 })
|
|
5514
6582
|
}
|
|
5515
6583
|
),
|
|
5516
|
-
/* @__PURE__ */ (0,
|
|
6584
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.Text, { fontSize: "sm", mt: 1, maxW: "280px", children: "Choose Edit Account, Change Password, or Quick Navigation from the menu to update your details here." })
|
|
5517
6585
|
]
|
|
5518
6586
|
}
|
|
5519
6587
|
)
|
|
@@ -5523,13 +6591,17 @@ function ReusableProfile({
|
|
|
5523
6591
|
}
|
|
5524
6592
|
);
|
|
5525
6593
|
}
|
|
5526
|
-
return /* @__PURE__ */ (0,
|
|
6594
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react42.Box, { maxW: "480px", mx: "auto", w: "full", minH: "100%", bg: "bg", children: profileView === "main" ? mainContent : subViewContent });
|
|
5527
6595
|
}
|
|
5528
6596
|
var UserProfile_default = ReusableProfile;
|
|
5529
6597
|
// Annotate the CommonJS export names for ESM import in node:
|
|
5530
6598
|
0 && (module.exports = {
|
|
6599
|
+
APIError,
|
|
5531
6600
|
Beneficiary,
|
|
5532
6601
|
BottomQuickActions,
|
|
6602
|
+
DocumentUploadCard,
|
|
6603
|
+
GeoApifyService,
|
|
6604
|
+
GetStarted,
|
|
5533
6605
|
HealthDeclaration,
|
|
5534
6606
|
LifePlanApplication1,
|
|
5535
6607
|
LifePlanApplication2,
|
|
@@ -5538,12 +6610,20 @@ var UserProfile_default = ReusableProfile;
|
|
|
5538
6610
|
LifePlanApplicationStepWrapper,
|
|
5539
6611
|
NotifyInstall,
|
|
5540
6612
|
OCR_STORAGE_KEY,
|
|
6613
|
+
OcrService,
|
|
6614
|
+
PayMongoService,
|
|
5541
6615
|
SharedLifePlanApplication,
|
|
5542
6616
|
UserProfile,
|
|
6617
|
+
api,
|
|
6618
|
+
apiClient,
|
|
6619
|
+
clearOcrResult,
|
|
6620
|
+
configureApi,
|
|
5543
6621
|
createEmptyApplicationData,
|
|
5544
6622
|
loadApplicationDataFromLocalStorage,
|
|
5545
6623
|
markOcrApplied,
|
|
5546
6624
|
readOcrResult,
|
|
5547
|
-
saveApplicationDataToLocalStorage
|
|
6625
|
+
saveApplicationDataToLocalStorage,
|
|
6626
|
+
saveOcrResult,
|
|
6627
|
+
useOcr
|
|
5548
6628
|
});
|
|
5549
6629
|
//# sourceMappingURL=index.js.map
|