@wealthx/shadcn 1.0.2 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +235 -138
- package/CHANGELOG.md +12 -0
- package/README.md +82 -0
- package/dist/{chunk-6OJF6XRN.mjs → chunk-24FUO7TD.mjs} +4 -8
- package/dist/{chunk-4AJ5HWHD.mjs → chunk-2I5S2AMY.mjs} +3 -3
- package/dist/chunk-2SF672SZ.mjs +161 -0
- package/dist/{chunk-GPRJQ24C.mjs → chunk-34NWQURD.mjs} +2 -2
- package/dist/{chunk-MQ72DIBH.mjs → chunk-3GF7OVTP.mjs} +14 -5
- package/dist/chunk-3WMX6KWS.mjs +245 -0
- package/dist/{chunk-PMKODV6M.mjs → chunk-462HMNO4.mjs} +6 -10
- package/dist/chunk-4CX4SBRO.mjs +153 -0
- package/dist/chunk-4MN6UQHG.mjs +443 -0
- package/dist/chunk-5QQVZTVZ.mjs +233 -0
- package/dist/{chunk-BGP2N52Z.mjs → chunk-66MI7Q4B.mjs} +5 -5
- package/dist/chunk-6FCGKSZX.mjs +268 -0
- package/dist/{chunk-CGOKTPXU.mjs → chunk-6JQFUE5I.mjs} +20 -23
- package/dist/{chunk-Z3MK2KKZ.mjs → chunk-7DHU4VGG.mjs} +7 -3
- package/dist/{chunk-VZ2NR7L3.mjs → chunk-7PYJD5JI.mjs} +35 -27
- package/dist/{chunk-JU2RUWHF.mjs → chunk-7XJHLGUV.mjs} +1 -1
- package/dist/{chunk-BMFN37JH.mjs → chunk-7YAU5CY6.mjs} +1 -1
- package/dist/chunk-A56YQQHG.mjs +402 -0
- package/dist/chunk-AH52LG6N.mjs +315 -0
- package/dist/{chunk-SLWCCURD.mjs → chunk-CLIN5525.mjs} +8 -4
- package/dist/{chunk-3VQNJ235.mjs → chunk-CSDO6VBW.mjs} +7 -0
- package/dist/chunk-D4ILTPOG.mjs +293 -0
- package/dist/{chunk-HS7TFG7V.mjs → chunk-D6ID6M4V.mjs} +1 -1
- package/dist/chunk-DOH3EHX7.mjs +378 -0
- package/dist/{chunk-MJIEMGRD.mjs → chunk-EFRENWEJ.mjs} +9 -17
- package/dist/chunk-ERGGHC2V.mjs +185 -0
- package/dist/{chunk-OXQQNQZI.mjs → chunk-FEZKMUCF.mjs} +10 -1
- package/dist/{chunk-55CEW76V.mjs → chunk-FH6QVUVZ.mjs} +1 -1
- package/dist/chunk-FMAXJ2SI.mjs +71 -0
- package/dist/chunk-FZIXGLMV.mjs +173 -0
- package/dist/{chunk-DS2AMHN2.mjs → chunk-GYMYRIZP.mjs} +2 -2
- package/dist/{chunk-KQDD5MU3.mjs → chunk-H45TKD34.mjs} +5 -5
- package/dist/{chunk-BBJBJSXQ.mjs → chunk-J5UICVJS.mjs} +1 -1
- package/dist/{chunk-RL772EH7.mjs → chunk-JHJHG4GO.mjs} +4 -12
- package/dist/chunk-KMCGSZTX.mjs +177 -0
- package/dist/{chunk-FHNT55I5.mjs → chunk-KUDCQ4FI.mjs} +4 -4
- package/dist/chunk-LE6YFY6D.mjs +209 -0
- package/dist/{chunk-HUVTPUV2.mjs → chunk-LLVQKSU3.mjs} +23 -19
- package/dist/{chunk-KKHTJNMM.mjs → chunk-MARPPFOJ.mjs} +8 -4
- package/dist/{chunk-6AFMNC42.mjs → chunk-N2PT566P.mjs} +15 -11
- package/dist/chunk-NLCKVHWB.mjs +161 -0
- package/dist/{chunk-YN5SYTOO.mjs → chunk-NQPOYKAQ.mjs} +9 -5
- package/dist/{chunk-ZZV5JVNW.mjs → chunk-NSLMILBT.mjs} +3 -7
- package/dist/chunk-NXA3CZ7A.mjs +248 -0
- package/dist/chunk-OGOYQ7BG.mjs +150 -0
- package/dist/{chunk-3NQGYJEZ.mjs → chunk-P6AM5V7O.mjs} +10 -18
- package/dist/{chunk-CZ3BW5GL.mjs → chunk-P76HMUI6.mjs} +5 -11
- package/dist/chunk-PCPLO5HT.mjs +671 -0
- package/dist/chunk-PG6K5XEC.mjs +475 -0
- package/dist/chunk-PJHPSRYD.mjs +234 -0
- package/dist/{chunk-DDPA2XXS.mjs → chunk-PMB3A7V3.mjs} +2 -2
- package/dist/chunk-PR6V5XKM.mjs +209 -0
- package/dist/{chunk-46OFHMQA.mjs → chunk-Q76O3RIQ.mjs} +10 -6
- package/dist/chunk-QVKWW6KE.mjs +272 -0
- package/dist/chunk-RGU7HOEC.mjs +140 -0
- package/dist/{chunk-JF4PHPD5.mjs → chunk-RGVKLTLH.mjs} +4 -4
- package/dist/{chunk-VG6UF6UT.mjs → chunk-RP3SQYA3.mjs} +2 -2
- package/dist/chunk-RRBS6D63.mjs +163 -0
- package/dist/chunk-SMQ3DG25.mjs +285 -0
- package/dist/chunk-SPJ5KXW7.mjs +199 -0
- package/dist/chunk-SYOD63OZ.mjs +225 -0
- package/dist/chunk-UFYSFDER.mjs +42 -0
- package/dist/chunk-VACKZOMY.mjs +190 -0
- package/dist/chunk-VLQZANBF.mjs +42 -0
- package/dist/chunk-WA6O6EUR.mjs +1885 -0
- package/dist/{chunk-E3K6O4FZ.mjs → chunk-WAZD7NFU.mjs} +5 -2
- package/dist/chunk-WG6JGJXB.mjs +165 -0
- package/dist/{chunk-I64K754C.mjs → chunk-WNGWBVLV.mjs} +2 -2
- package/dist/{chunk-3U7SD3MS.mjs → chunk-WOEHFRGB.mjs} +3 -3
- package/dist/{chunk-DKZRJOMF.mjs → chunk-XIRTEFKH.mjs} +12 -12
- package/dist/chunk-Y6DWJSKZ.mjs +79 -0
- package/dist/chunk-YKPROFLB.mjs +161 -0
- package/dist/{chunk-K76E2TQU.mjs → chunk-ZRO5JO3H.mjs} +107 -67
- package/dist/{chunk-VYMHBV6D.mjs → chunk-ZU4NV6RG.mjs} +5 -3
- package/dist/components/ui/accordion.js +40 -4
- package/dist/components/ui/accordion.mjs +2 -2
- package/dist/components/ui/add-column-modal.js +789 -0
- package/dist/components/ui/add-column-modal.mjs +17 -0
- package/dist/components/ui/add-lead-modal.js +647 -0
- package/dist/components/ui/add-lead-modal.mjs +16 -0
- package/dist/components/ui/ai-assistant-drawer.js +686 -0
- package/dist/components/ui/ai-assistant-drawer.mjs +16 -0
- package/dist/components/ui/alert-dialog.js +37 -5
- package/dist/components/ui/alert-dialog.mjs +4 -4
- package/dist/components/ui/alert.js +37 -11
- package/dist/components/ui/alert.mjs +2 -2
- package/dist/components/ui/avatar.js +36 -8
- package/dist/components/ui/avatar.mjs +2 -2
- package/dist/components/ui/backoffice-alert-history-chart.js +624 -0
- package/dist/components/ui/backoffice-alert-history-chart.mjs +16 -0
- package/dist/components/ui/backoffice-contact-history-chart.js +687 -0
- package/dist/components/ui/backoffice-contact-history-chart.mjs +16 -0
- package/dist/components/ui/badge.js +37 -2
- package/dist/components/ui/badge.mjs +2 -2
- package/dist/components/ui/borrowing-capacity-line-chart.js +639 -0
- package/dist/components/ui/borrowing-capacity-line-chart.mjs +16 -0
- package/dist/components/ui/button.js +35 -3
- package/dist/components/ui/button.mjs +2 -2
- package/dist/components/ui/calendar.js +43 -19
- package/dist/components/ui/calendar.mjs +3 -3
- package/dist/components/ui/card.js +40 -4
- package/dist/components/ui/card.mjs +2 -2
- package/dist/components/ui/cash-balance-line-chart.js +627 -0
- package/dist/components/ui/cash-balance-line-chart.mjs +16 -0
- package/dist/components/ui/cashflow-bar-chart.js +650 -0
- package/dist/components/ui/cashflow-bar-chart.mjs +16 -0
- package/dist/components/ui/checkbox.js +36 -5
- package/dist/components/ui/checkbox.mjs +2 -3
- package/dist/components/ui/chip.js +37 -2
- package/dist/components/ui/chip.mjs +3 -3
- package/dist/components/ui/combobox.js +280 -0
- package/dist/components/ui/combobox.mjs +28 -0
- package/dist/components/ui/data-table.js +160 -88
- package/dist/components/ui/data-table.mjs +10 -11
- package/dist/components/ui/date-picker.js +44 -20
- package/dist/components/ui/date-picker.mjs +6 -7
- package/dist/components/ui/dialog.js +44 -12
- package/dist/components/ui/dialog.mjs +4 -4
- package/dist/components/ui/drawer.js +46 -10
- package/dist/components/ui/drawer.mjs +3 -3
- package/dist/components/ui/dropdown-menu.js +40 -16
- package/dist/components/ui/dropdown-menu.mjs +3 -3
- package/dist/components/ui/empty.js +41 -5
- package/dist/components/ui/empty.mjs +2 -2
- package/dist/components/ui/expense-bar-chart.js +642 -0
- package/dist/components/ui/expense-bar-chart.mjs +16 -0
- package/dist/components/ui/field.js +53 -21
- package/dist/components/ui/field.mjs +4 -4
- package/dist/components/ui/financial-cards.js +1002 -0
- package/dist/components/ui/financial-cards.mjs +24 -0
- package/dist/components/ui/financial-drawers.js +637 -0
- package/dist/components/ui/financial-drawers.mjs +17 -0
- package/dist/components/ui/financial-primitives.js +218 -0
- package/dist/components/ui/financial-primitives.mjs +22 -0
- package/dist/components/ui/financial-sections.js +1422 -0
- package/dist/components/ui/financial-sections.mjs +30 -0
- package/dist/components/ui/form-primitives.js +682 -0
- package/dist/components/ui/form-primitives.mjs +19 -0
- package/dist/components/ui/income-bar-chart.js +641 -0
- package/dist/components/ui/income-bar-chart.mjs +16 -0
- package/dist/components/ui/input-group.js +43 -7
- package/dist/components/ui/input-group.mjs +5 -5
- package/dist/components/ui/input-otp.js +39 -3
- package/dist/components/ui/input-otp.mjs +2 -2
- package/dist/components/ui/input.js +34 -2
- package/dist/components/ui/input.mjs +2 -2
- package/dist/components/ui/kanban-column.js +1143 -0
- package/dist/components/ui/kanban-column.mjs +20 -0
- package/dist/components/ui/label.js +35 -7
- package/dist/components/ui/label.mjs +2 -2
- package/dist/components/ui/opportunity-card.js +960 -0
- package/dist/components/ui/opportunity-card.mjs +20 -0
- package/dist/components/ui/opportunity-edit-modals.js +3360 -0
- package/dist/components/ui/opportunity-edit-modals.mjs +37 -0
- package/dist/components/ui/opportunity-summary-tab.js +4365 -0
- package/dist/components/ui/opportunity-summary-tab.mjs +34 -0
- package/dist/components/ui/pagination.js +35 -3
- package/dist/components/ui/pagination.mjs +3 -3
- package/dist/components/ui/pipeline-alerts.js +103 -0
- package/dist/components/ui/pipeline-alerts.mjs +8 -0
- package/dist/components/ui/pipeline-board.js +1408 -0
- package/dist/components/ui/pipeline-board.mjs +24 -0
- package/dist/components/ui/pipeline-chart.js +216 -0
- package/dist/components/ui/pipeline-chart.mjs +10 -0
- package/dist/components/ui/pipeline-dialogs.js +1183 -0
- package/dist/components/ui/pipeline-dialogs.mjs +23 -0
- package/dist/components/ui/pipeline-primitives.js +300 -0
- package/dist/components/ui/pipeline-primitives.mjs +11 -0
- package/dist/components/ui/popover.js +45 -4
- package/dist/components/ui/popover.mjs +3 -3
- package/dist/components/ui/progress.js +33 -1
- package/dist/components/ui/progress.mjs +2 -2
- package/dist/components/ui/property-cashflow-doughnut-chart.js +523 -0
- package/dist/components/ui/property-cashflow-doughnut-chart.mjs +16 -0
- package/dist/components/ui/property-debt-equity-doughnut-chart.js +521 -0
- package/dist/components/ui/property-debt-equity-doughnut-chart.mjs +16 -0
- package/dist/components/ui/property-mobile-estimate-line-chart.js +682 -0
- package/dist/components/ui/property-mobile-estimate-line-chart.mjs +16 -0
- package/dist/components/ui/radio-group.js +33 -1
- package/dist/components/ui/radio-group.mjs +2 -2
- package/dist/components/ui/select.js +66 -26
- package/dist/components/ui/select.mjs +3 -3
- package/dist/components/ui/separator.js +33 -1
- package/dist/components/ui/separator.mjs +2 -2
- package/dist/components/ui/sheet.js +37 -9
- package/dist/components/ui/sheet.mjs +3 -3
- package/dist/components/ui/skeleton.js +33 -1
- package/dist/components/ui/skeleton.mjs +2 -2
- package/dist/components/ui/slider.js +86 -102
- package/dist/components/ui/slider.mjs +2 -2
- package/dist/components/ui/spinner.js +33 -1
- package/dist/components/ui/spinner.mjs +2 -2
- package/dist/components/ui/stage-timeline.js +579 -0
- package/dist/components/ui/stage-timeline.mjs +15 -0
- package/dist/components/ui/switch.js +37 -4
- package/dist/components/ui/switch.mjs +2 -3
- package/dist/components/ui/table.js +37 -5
- package/dist/components/ui/table.mjs +2 -2
- package/dist/components/ui/tabs.js +36 -12
- package/dist/components/ui/tabs.mjs +2 -2
- package/dist/components/ui/textarea.js +34 -2
- package/dist/components/ui/textarea.mjs +2 -2
- package/dist/components/ui/toggle-group.js +35 -4
- package/dist/components/ui/toggle-group.mjs +3 -4
- package/dist/components/ui/toggle.js +35 -4
- package/dist/components/ui/toggle.mjs +2 -3
- package/dist/components/ui/tooltip.js +51 -22
- package/dist/components/ui/tooltip.mjs +3 -3
- package/dist/components/ui/transactions-expense-categories-doughnut-chart.js +528 -0
- package/dist/components/ui/transactions-expense-categories-doughnut-chart.mjs +16 -0
- package/dist/components/ui/transactions-income-expense-bar-chart.js +516 -0
- package/dist/components/ui/transactions-income-expense-bar-chart.mjs +16 -0
- package/dist/components/ui/transactions-liabilities-breakdown-doughnut-chart.js +528 -0
- package/dist/components/ui/transactions-liabilities-breakdown-doughnut-chart.mjs +16 -0
- package/dist/index.js +11613 -2868
- package/dist/index.mjs +377 -164
- package/dist/lib/theme-provider.js +10 -1
- package/dist/lib/theme-provider.mjs +1 -1
- package/dist/lib/typography.js +8 -0
- package/dist/lib/typography.mjs +3 -1
- package/dist/lib/utils.js +33 -1
- package/dist/lib/utils.mjs +1 -1
- package/dist/styles.css +1 -1
- package/package.json +169 -6
- package/src/components/index.tsx +323 -13
- package/src/components/ui/accordion.tsx +6 -3
- package/src/components/ui/add-column-modal.tsx +339 -0
- package/src/components/ui/add-lead-modal.tsx +290 -0
- package/src/components/ui/ai-assistant-drawer.tsx +408 -0
- package/src/components/ui/alert-dialog.tsx +80 -54
- package/src/components/ui/alert.tsx +28 -28
- package/src/components/ui/avatar.tsx +30 -29
- package/src/components/ui/backoffice-alert-history-chart.tsx +260 -0
- package/src/components/ui/backoffice-contact-history-chart.tsx +325 -0
- package/src/components/ui/badge.tsx +17 -15
- package/src/components/ui/borrowing-capacity-line-chart.tsx +357 -0
- package/src/components/ui/button.tsx +30 -27
- package/src/components/ui/calendar.tsx +53 -67
- package/src/components/ui/card.tsx +27 -24
- package/src/components/ui/cash-balance-line-chart.tsx +302 -0
- package/src/components/ui/cashflow-bar-chart.tsx +363 -0
- package/src/components/ui/chart-shared.tsx +261 -0
- package/src/components/ui/checkbox.tsx +30 -26
- package/src/components/ui/combobox.tsx +223 -0
- package/src/components/ui/data-table.tsx +160 -99
- package/src/components/ui/date-picker.tsx +0 -2
- package/src/components/ui/dialog.tsx +70 -60
- package/src/components/ui/drawer.tsx +57 -48
- package/src/components/ui/dropdown-menu.tsx +90 -82
- package/src/components/ui/empty.tsx +31 -27
- package/src/components/ui/expense-bar-chart.tsx +296 -0
- package/src/components/ui/field.tsx +70 -62
- package/src/components/ui/financial-cards.tsx +830 -0
- package/src/components/ui/financial-drawers.tsx +339 -0
- package/src/components/ui/financial-primitives.tsx +331 -0
- package/src/components/ui/financial-sections.tsx +672 -0
- package/src/components/ui/form-primitives.tsx +536 -0
- package/src/components/ui/income-bar-chart.tsx +297 -0
- package/src/components/ui/input-group.tsx +41 -34
- package/src/components/ui/input-otp.tsx +29 -24
- package/src/components/ui/input.tsx +8 -8
- package/src/components/ui/kanban-column.tsx +333 -0
- package/src/components/ui/label.tsx +9 -12
- package/src/components/ui/opportunity-card.tsx +616 -0
- package/src/components/ui/opportunity-edit-modals.tsx +2528 -0
- package/src/components/ui/opportunity-summary-tab.tsx +579 -0
- package/src/components/ui/pipeline-alerts.tsx +74 -0
- package/src/components/ui/pipeline-board.tsx +268 -0
- package/src/components/ui/pipeline-chart.tsx +173 -0
- package/src/components/ui/pipeline-dialogs.tsx +303 -0
- package/src/components/ui/pipeline-primitives.tsx +108 -0
- package/src/components/ui/popover.tsx +41 -36
- package/src/components/ui/property-cashflow-doughnut-chart.tsx +188 -0
- package/src/components/ui/property-debt-equity-doughnut-chart.tsx +185 -0
- package/src/components/ui/property-mobile-estimate-line-chart.tsx +393 -0
- package/src/components/ui/select.tsx +65 -52
- package/src/components/ui/sheet.tsx +55 -52
- package/src/components/ui/slider.tsx +54 -77
- package/src/components/ui/stage-timeline.tsx +205 -0
- package/src/components/ui/switch.tsx +42 -29
- package/src/components/ui/table.tsx +28 -28
- package/src/components/ui/tabs.tsx +22 -28
- package/src/components/ui/textarea.tsx +8 -8
- package/src/components/ui/toggle-group.tsx +0 -2
- package/src/components/ui/toggle.tsx +13 -15
- package/src/components/ui/tooltip.tsx +30 -28
- package/src/components/ui/transactions-expense-categories-doughnut-chart.tsx +191 -0
- package/src/components/ui/transactions-income-expense-bar-chart.tsx +205 -0
- package/src/components/ui/transactions-liabilities-breakdown-doughnut-chart.tsx +191 -0
- package/src/lib/theme-provider.tsx +10 -0
- package/src/lib/typography.ts +9 -0
- package/src/lib/utils.ts +41 -3
- package/src/styles/globals.css +371 -124
- package/src/styles/styles-css.ts +1 -1
- package/tsup.config.ts +32 -0
- package/dist/chunk-K74JRTJR.mjs +0 -105
- package/dist/chunk-V7CNWJT3.mjs +0 -10
|
@@ -0,0 +1,4365 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __defProps = Object.defineProperties;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
9
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
10
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
12
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13
|
+
var __spreadValues = (a, b) => {
|
|
14
|
+
for (var prop in b || (b = {}))
|
|
15
|
+
if (__hasOwnProp.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
if (__getOwnPropSymbols)
|
|
18
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
19
|
+
if (__propIsEnum.call(b, prop))
|
|
20
|
+
__defNormalProp(a, prop, b[prop]);
|
|
21
|
+
}
|
|
22
|
+
return a;
|
|
23
|
+
};
|
|
24
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
25
|
+
var __objRest = (source, exclude) => {
|
|
26
|
+
var target = {};
|
|
27
|
+
for (var prop in source)
|
|
28
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
29
|
+
target[prop] = source[prop];
|
|
30
|
+
if (source != null && __getOwnPropSymbols)
|
|
31
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
32
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
33
|
+
target[prop] = source[prop];
|
|
34
|
+
}
|
|
35
|
+
return target;
|
|
36
|
+
};
|
|
37
|
+
var __export = (target, all) => {
|
|
38
|
+
for (var name in all)
|
|
39
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
40
|
+
};
|
|
41
|
+
var __copyProps = (to, from, except, desc) => {
|
|
42
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
43
|
+
for (let key of __getOwnPropNames(from))
|
|
44
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
45
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
46
|
+
}
|
|
47
|
+
return to;
|
|
48
|
+
};
|
|
49
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
50
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
51
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
52
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
53
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
54
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
55
|
+
mod
|
|
56
|
+
));
|
|
57
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
58
|
+
|
|
59
|
+
// src/components/ui/opportunity-summary-tab.tsx
|
|
60
|
+
var opportunity_summary_tab_exports = {};
|
|
61
|
+
__export(opportunity_summary_tab_exports, {
|
|
62
|
+
OpportunitySummaryTab: () => OpportunitySummaryTab
|
|
63
|
+
});
|
|
64
|
+
module.exports = __toCommonJS(opportunity_summary_tab_exports);
|
|
65
|
+
var import_react5 = require("react");
|
|
66
|
+
var import_lucide_react12 = require("lucide-react");
|
|
67
|
+
|
|
68
|
+
// src/components/ui/tabs.tsx
|
|
69
|
+
var import_class_variance_authority = require("class-variance-authority");
|
|
70
|
+
var import_tabs = require("@base-ui/react/tabs");
|
|
71
|
+
|
|
72
|
+
// src/lib/utils.ts
|
|
73
|
+
var import_clsx = require("clsx");
|
|
74
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
75
|
+
var twMerge = (0, import_tailwind_merge.extendTailwindMerge)({
|
|
76
|
+
extend: {
|
|
77
|
+
classGroups: {
|
|
78
|
+
"font-size": [
|
|
79
|
+
{
|
|
80
|
+
text: [
|
|
81
|
+
"display-large",
|
|
82
|
+
"display-medium",
|
|
83
|
+
"display-small",
|
|
84
|
+
"h1",
|
|
85
|
+
"h2",
|
|
86
|
+
"h3",
|
|
87
|
+
"h4",
|
|
88
|
+
"h5",
|
|
89
|
+
"h6",
|
|
90
|
+
"body-large",
|
|
91
|
+
"body-medium",
|
|
92
|
+
"body-small",
|
|
93
|
+
"label-large",
|
|
94
|
+
"label-medium",
|
|
95
|
+
"label-small",
|
|
96
|
+
"button",
|
|
97
|
+
"button-xs",
|
|
98
|
+
"caption",
|
|
99
|
+
"overline",
|
|
100
|
+
"code"
|
|
101
|
+
]
|
|
102
|
+
}
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
function cn(...inputs) {
|
|
108
|
+
return twMerge((0, import_clsx.clsx)(inputs));
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// src/components/ui/tabs.tsx
|
|
112
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
113
|
+
function Tabs(_a) {
|
|
114
|
+
var _b = _a, {
|
|
115
|
+
className,
|
|
116
|
+
orientation = "horizontal"
|
|
117
|
+
} = _b, props = __objRest(_b, [
|
|
118
|
+
"className",
|
|
119
|
+
"orientation"
|
|
120
|
+
]);
|
|
121
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
122
|
+
import_tabs.Tabs.Root,
|
|
123
|
+
__spreadValues({
|
|
124
|
+
className: cn(
|
|
125
|
+
"group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",
|
|
126
|
+
className
|
|
127
|
+
),
|
|
128
|
+
"data-orientation": orientation,
|
|
129
|
+
"data-slot": "tabs"
|
|
130
|
+
}, props)
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
var tabsListVariants = (0, import_class_variance_authority.cva)(
|
|
134
|
+
"group/tabs-list inline-flex w-fit items-center justify-center gap-1 rounded-none p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",
|
|
135
|
+
{
|
|
136
|
+
variants: {
|
|
137
|
+
variant: {
|
|
138
|
+
default: "bg-muted",
|
|
139
|
+
line: "bg-transparent p-0"
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
defaultVariants: {
|
|
143
|
+
variant: "default"
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
);
|
|
147
|
+
function TabsList(_a) {
|
|
148
|
+
var _b = _a, {
|
|
149
|
+
className,
|
|
150
|
+
variant = "default"
|
|
151
|
+
} = _b, props = __objRest(_b, [
|
|
152
|
+
"className",
|
|
153
|
+
"variant"
|
|
154
|
+
]);
|
|
155
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
156
|
+
import_tabs.Tabs.List,
|
|
157
|
+
__spreadValues({
|
|
158
|
+
className: cn(tabsListVariants({ variant }), className),
|
|
159
|
+
"data-slot": "tabs-list",
|
|
160
|
+
"data-variant": variant
|
|
161
|
+
}, props)
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
function TabsTrigger(_a) {
|
|
165
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
166
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
167
|
+
import_tabs.Tabs.Tab,
|
|
168
|
+
__spreadValues({
|
|
169
|
+
className: cn(
|
|
170
|
+
// Base layout & typography
|
|
171
|
+
"relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 whitespace-nowrap",
|
|
172
|
+
"rounded-none border border-transparent px-1.5 py-1 text-label-medium",
|
|
173
|
+
"text-muted-foreground transition-all",
|
|
174
|
+
// Vertical orientation
|
|
175
|
+
"group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start",
|
|
176
|
+
// Hover & focus
|
|
177
|
+
"hover:text-foreground",
|
|
178
|
+
"focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring",
|
|
179
|
+
// Disabled
|
|
180
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
181
|
+
// Active state — Default variant: primary/10 bg + subtle shadow
|
|
182
|
+
// Base UI uses data-active attribute for the active/selected tab
|
|
183
|
+
"data-active:bg-primary/10 data-active:text-foreground",
|
|
184
|
+
"group-data-[variant=default]/tabs-list:data-active:shadow-sm",
|
|
185
|
+
// Active state — Line variant: suppress bg & shadow
|
|
186
|
+
"group-data-[variant=line]/tabs-list:data-active:bg-transparent",
|
|
187
|
+
"group-data-[variant=line]/tabs-list:data-active:shadow-none",
|
|
188
|
+
// Indicator pseudo-element (visible only for Line variant, active state)
|
|
189
|
+
"after:absolute after:bg-primary after:opacity-0 after:transition-opacity",
|
|
190
|
+
"group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5",
|
|
191
|
+
"group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5",
|
|
192
|
+
"group-data-[variant=line]/tabs-list:data-active:after:opacity-100",
|
|
193
|
+
// SVG icons
|
|
194
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
195
|
+
className
|
|
196
|
+
),
|
|
197
|
+
"data-slot": "tabs-trigger"
|
|
198
|
+
}, props)
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
function TabsContent(_a) {
|
|
202
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
203
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
204
|
+
import_tabs.Tabs.Panel,
|
|
205
|
+
__spreadValues({
|
|
206
|
+
className: cn("flex-1 outline-none", className),
|
|
207
|
+
"data-slot": "tabs-content"
|
|
208
|
+
}, props)
|
|
209
|
+
);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
// src/components/ui/accordion.tsx
|
|
213
|
+
var import_lucide_react = require("lucide-react");
|
|
214
|
+
var import_accordion = require("@base-ui/react/accordion");
|
|
215
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
216
|
+
function Accordion(props) {
|
|
217
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_accordion.Accordion.Root, __spreadValues({ "data-slot": "accordion" }, props));
|
|
218
|
+
}
|
|
219
|
+
function AccordionItem(_a) {
|
|
220
|
+
var _b = _a, {
|
|
221
|
+
className
|
|
222
|
+
} = _b, props = __objRest(_b, [
|
|
223
|
+
"className"
|
|
224
|
+
]);
|
|
225
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
226
|
+
import_accordion.Accordion.Item,
|
|
227
|
+
__spreadValues({
|
|
228
|
+
className: cn("border-b", className),
|
|
229
|
+
"data-slot": "accordion-item"
|
|
230
|
+
}, props)
|
|
231
|
+
);
|
|
232
|
+
}
|
|
233
|
+
function AccordionTrigger(_a) {
|
|
234
|
+
var _b = _a, {
|
|
235
|
+
className,
|
|
236
|
+
children
|
|
237
|
+
} = _b, props = __objRest(_b, [
|
|
238
|
+
"className",
|
|
239
|
+
"children"
|
|
240
|
+
]);
|
|
241
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_accordion.Accordion.Header, { className: "flex", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
242
|
+
import_accordion.Accordion.Trigger,
|
|
243
|
+
__spreadProps(__spreadValues({
|
|
244
|
+
className: cn(
|
|
245
|
+
// layout
|
|
246
|
+
"flex flex-1 items-center justify-between gap-4 py-4 text-left",
|
|
247
|
+
// typography
|
|
248
|
+
"text-label-medium",
|
|
249
|
+
// base
|
|
250
|
+
"rounded-none outline-none transition-[color,opacity]",
|
|
251
|
+
// interactive states
|
|
252
|
+
"hover:underline",
|
|
253
|
+
"focus-visible:ring-2 focus-visible:ring-foreground/30",
|
|
254
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
255
|
+
// chevron rotation when open
|
|
256
|
+
"[&[data-panel-open]>svg]:rotate-180",
|
|
257
|
+
className
|
|
258
|
+
),
|
|
259
|
+
"data-slot": "accordion-trigger"
|
|
260
|
+
}, props), {
|
|
261
|
+
children: [
|
|
262
|
+
children,
|
|
263
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_lucide_react.ChevronDownIcon, { className: "pointer-events-none size-4 shrink-0 text-muted-foreground transition-transform duration-200" })
|
|
264
|
+
]
|
|
265
|
+
})
|
|
266
|
+
) });
|
|
267
|
+
}
|
|
268
|
+
function AccordionContent(_a) {
|
|
269
|
+
var _b = _a, {
|
|
270
|
+
className,
|
|
271
|
+
children
|
|
272
|
+
} = _b, props = __objRest(_b, [
|
|
273
|
+
"className",
|
|
274
|
+
"children"
|
|
275
|
+
]);
|
|
276
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
277
|
+
import_accordion.Accordion.Panel,
|
|
278
|
+
__spreadProps(__spreadValues({
|
|
279
|
+
className: "overflow-hidden text-body-small h-(--accordion-panel-height) transition-[height] duration-200 ease-out data-starting-style:h-0 data-ending-style:h-0",
|
|
280
|
+
"data-slot": "accordion-content"
|
|
281
|
+
}, props), {
|
|
282
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: cn("pb-4 text-muted-foreground", className), children })
|
|
283
|
+
})
|
|
284
|
+
);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
// src/components/ui/financial-sections.tsx
|
|
288
|
+
var import_react2 = require("react");
|
|
289
|
+
|
|
290
|
+
// src/components/ui/button.tsx
|
|
291
|
+
var import_react = require("react");
|
|
292
|
+
var import_class_variance_authority2 = require("class-variance-authority");
|
|
293
|
+
var import_lucide_react2 = require("lucide-react");
|
|
294
|
+
|
|
295
|
+
// src/lib/slot.tsx
|
|
296
|
+
var React = __toESM(require("react"));
|
|
297
|
+
function mergeRefs(...refs) {
|
|
298
|
+
return (value) => {
|
|
299
|
+
for (const ref of refs) {
|
|
300
|
+
if (typeof ref === "function") ref(value);
|
|
301
|
+
else if (ref !== null)
|
|
302
|
+
ref.current = value;
|
|
303
|
+
}
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
var Slot = React.forwardRef(
|
|
307
|
+
(_a, forwardedRef) => {
|
|
308
|
+
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
309
|
+
const child = React.Children.only(children);
|
|
310
|
+
if (!React.isValidElement(child)) return null;
|
|
311
|
+
const childProps = child.props;
|
|
312
|
+
const merged = __spreadValues({}, props);
|
|
313
|
+
for (const key of Object.keys(childProps)) {
|
|
314
|
+
if (key === "className") {
|
|
315
|
+
merged.className = [props.className, childProps.className].filter(Boolean).join(" ");
|
|
316
|
+
} else if (key === "style") {
|
|
317
|
+
merged.style = __spreadValues(__spreadValues({}, props.style), childProps.style);
|
|
318
|
+
} else if (key.startsWith("on") && typeof childProps[key] === "function") {
|
|
319
|
+
const parentHandler = props[key];
|
|
320
|
+
if (typeof parentHandler === "function") {
|
|
321
|
+
merged[key] = (...args) => {
|
|
322
|
+
childProps[key](...args);
|
|
323
|
+
parentHandler(...args);
|
|
324
|
+
};
|
|
325
|
+
} else {
|
|
326
|
+
merged[key] = childProps[key];
|
|
327
|
+
}
|
|
328
|
+
} else {
|
|
329
|
+
merged[key] = childProps[key];
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
const childRef = child.ref;
|
|
333
|
+
merged.ref = forwardedRef ? mergeRefs(forwardedRef, childRef) : childRef;
|
|
334
|
+
return React.cloneElement(
|
|
335
|
+
child,
|
|
336
|
+
merged
|
|
337
|
+
);
|
|
338
|
+
}
|
|
339
|
+
);
|
|
340
|
+
Slot.displayName = "Slot";
|
|
341
|
+
|
|
342
|
+
// src/components/ui/button.tsx
|
|
343
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
344
|
+
var buttonVariants = (0, import_class_variance_authority2.cva)(
|
|
345
|
+
"inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 font-sans text-button whitespace-nowrap transition-all active:scale-[0.98] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
346
|
+
{
|
|
347
|
+
variants: {
|
|
348
|
+
variant: {
|
|
349
|
+
default: "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
|
|
350
|
+
secondary: "bg-brand-secondary text-brand-secondary-foreground shadow-xs hover:bg-brand-secondary/80 focus-visible:ring-brand-secondary/30",
|
|
351
|
+
destructive: "bg-destructive text-destructive-foreground shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",
|
|
352
|
+
outline: "border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
|
|
353
|
+
"outline-primary": "border border-primary text-foreground bg-transparent shadow-xs hover:bg-primary/5 focus-visible:ring-primary/50",
|
|
354
|
+
"outline-secondary": "border border-brand-secondary text-brand-secondary bg-transparent shadow-xs hover:bg-brand-secondary/10 focus-visible:ring-brand-secondary/30",
|
|
355
|
+
ghost: "hover:bg-accent hover:text-accent-foreground hover:shadow-xs dark:hover:bg-accent/50",
|
|
356
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
357
|
+
},
|
|
358
|
+
size: {
|
|
359
|
+
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
360
|
+
xs: "h-6 gap-1 px-2 text-button-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
361
|
+
sm: "h-8 gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
362
|
+
lg: "h-10 px-6 has-[>svg]:px-4",
|
|
363
|
+
icon: "size-9",
|
|
364
|
+
"icon-xs": "size-6 [&_svg:not([class*='size-'])]:size-3",
|
|
365
|
+
"icon-sm": "size-8",
|
|
366
|
+
"icon-lg": "size-10"
|
|
367
|
+
}
|
|
368
|
+
},
|
|
369
|
+
defaultVariants: {
|
|
370
|
+
variant: "default",
|
|
371
|
+
size: "default"
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
);
|
|
375
|
+
var Button = (0, import_react.forwardRef)(function Button2(_a, ref) {
|
|
376
|
+
var _b = _a, {
|
|
377
|
+
className,
|
|
378
|
+
variant,
|
|
379
|
+
size,
|
|
380
|
+
asChild = false,
|
|
381
|
+
loading = false,
|
|
382
|
+
disabled,
|
|
383
|
+
type = "button",
|
|
384
|
+
children
|
|
385
|
+
} = _b, props = __objRest(_b, [
|
|
386
|
+
"className",
|
|
387
|
+
"variant",
|
|
388
|
+
"size",
|
|
389
|
+
"asChild",
|
|
390
|
+
"loading",
|
|
391
|
+
"disabled",
|
|
392
|
+
"type",
|
|
393
|
+
"children"
|
|
394
|
+
]);
|
|
395
|
+
const Comp = asChild ? Slot : "button";
|
|
396
|
+
const isIconOnly = size === "icon" || size === "icon-xs" || size === "icon-sm" || size === "icon-lg";
|
|
397
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
398
|
+
Comp,
|
|
399
|
+
__spreadProps(__spreadValues({
|
|
400
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
401
|
+
"data-size": size,
|
|
402
|
+
"data-slot": "button",
|
|
403
|
+
"data-variant": variant,
|
|
404
|
+
disabled: loading || disabled,
|
|
405
|
+
ref,
|
|
406
|
+
type
|
|
407
|
+
}, props), {
|
|
408
|
+
children: loading ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
409
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react2.Loader2, { "aria-hidden": "true", className: "animate-spin" }),
|
|
410
|
+
!isIconOnly && children
|
|
411
|
+
] }) : children
|
|
412
|
+
})
|
|
413
|
+
);
|
|
414
|
+
});
|
|
415
|
+
|
|
416
|
+
// src/components/ui/separator.tsx
|
|
417
|
+
var import_separator = require("@base-ui/react/separator");
|
|
418
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
419
|
+
function Separator(_a) {
|
|
420
|
+
var _b = _a, {
|
|
421
|
+
className,
|
|
422
|
+
orientation = "horizontal"
|
|
423
|
+
} = _b, props = __objRest(_b, [
|
|
424
|
+
"className",
|
|
425
|
+
"orientation"
|
|
426
|
+
]);
|
|
427
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
428
|
+
import_separator.Separator,
|
|
429
|
+
__spreadValues({
|
|
430
|
+
className: cn(
|
|
431
|
+
"shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
|
|
432
|
+
className
|
|
433
|
+
),
|
|
434
|
+
"data-orientation": orientation,
|
|
435
|
+
"data-slot": "separator"
|
|
436
|
+
}, props)
|
|
437
|
+
);
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
// src/components/ui/financial-cards.tsx
|
|
441
|
+
var React2 = __toESM(require("react"));
|
|
442
|
+
var import_lucide_react4 = require("lucide-react");
|
|
443
|
+
|
|
444
|
+
// src/components/ui/badge.tsx
|
|
445
|
+
var import_class_variance_authority3 = require("class-variance-authority");
|
|
446
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
447
|
+
var badgeVariants = (0, import_class_variance_authority3.cva)(
|
|
448
|
+
"inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2.5 py-0.5 text-xs font-medium font-sans whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",
|
|
449
|
+
{
|
|
450
|
+
variants: {
|
|
451
|
+
variant: {
|
|
452
|
+
default: "bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
|
|
453
|
+
secondary: "bg-muted text-muted-foreground [a&]:hover:bg-muted/80",
|
|
454
|
+
destructive: "bg-destructive text-destructive-foreground focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90",
|
|
455
|
+
success: "bg-success text-success-foreground [a&]:hover:bg-success/90",
|
|
456
|
+
warning: "bg-warning text-warning-foreground [a&]:hover:bg-warning/90",
|
|
457
|
+
info: "bg-info text-info-foreground [a&]:hover:bg-info/90",
|
|
458
|
+
outline: "border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
|
|
459
|
+
ghost: "[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
|
|
460
|
+
link: "text-primary underline-offset-4 [a&]:hover:underline"
|
|
461
|
+
}
|
|
462
|
+
},
|
|
463
|
+
defaultVariants: {
|
|
464
|
+
variant: "default"
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
);
|
|
468
|
+
|
|
469
|
+
// src/components/ui/radio-group.tsx
|
|
470
|
+
var import_lucide_react3 = require("lucide-react");
|
|
471
|
+
var import_radio_group = require("@base-ui/react/radio-group");
|
|
472
|
+
var import_radio = require("@base-ui/react/radio");
|
|
473
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
474
|
+
var CIRCLE_BASE = "inline-flex items-center justify-center aspect-square size-4 shrink-0 rounded-full border border-primary bg-background";
|
|
475
|
+
var INDICATOR_DOT = "size-2 fill-background text-background";
|
|
476
|
+
function RadioGroup(_a) {
|
|
477
|
+
var _b = _a, {
|
|
478
|
+
className
|
|
479
|
+
} = _b, props = __objRest(_b, [
|
|
480
|
+
"className"
|
|
481
|
+
]);
|
|
482
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
483
|
+
import_radio_group.RadioGroup,
|
|
484
|
+
__spreadValues({
|
|
485
|
+
className: cn("grid gap-3", className),
|
|
486
|
+
"data-slot": "radio-group"
|
|
487
|
+
}, props)
|
|
488
|
+
);
|
|
489
|
+
}
|
|
490
|
+
function RadioGroupItem(_a) {
|
|
491
|
+
var _b = _a, {
|
|
492
|
+
className
|
|
493
|
+
} = _b, props = __objRest(_b, [
|
|
494
|
+
"className"
|
|
495
|
+
]);
|
|
496
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
497
|
+
import_radio.Radio.Root,
|
|
498
|
+
__spreadProps(__spreadValues({
|
|
499
|
+
className: cn(
|
|
500
|
+
CIRCLE_BASE,
|
|
501
|
+
"transition-all outline-none",
|
|
502
|
+
"focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50",
|
|
503
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
504
|
+
"data-checked:bg-primary",
|
|
505
|
+
"aria-invalid:border-destructive aria-invalid:ring-destructive/20",
|
|
506
|
+
"aria-invalid:data-checked:border-destructive aria-invalid:data-checked:bg-destructive",
|
|
507
|
+
"dark:bg-input/30 dark:aria-invalid:ring-destructive/40",
|
|
508
|
+
className
|
|
509
|
+
),
|
|
510
|
+
"data-slot": "radio-group-item"
|
|
511
|
+
}, props), {
|
|
512
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
513
|
+
import_radio.Radio.Indicator,
|
|
514
|
+
{
|
|
515
|
+
"data-slot": "radio-group-indicator",
|
|
516
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react3.CircleIcon, { className: INDICATOR_DOT })
|
|
517
|
+
}
|
|
518
|
+
)
|
|
519
|
+
})
|
|
520
|
+
);
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
// src/components/ui/financial-primitives.tsx
|
|
524
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
525
|
+
var NO_DATA = "\u2014";
|
|
526
|
+
function FinancialSectionLabel({
|
|
527
|
+
children
|
|
528
|
+
}) {
|
|
529
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-label-small uppercase text-muted-foreground", children });
|
|
530
|
+
}
|
|
531
|
+
function FinancialDetailField({
|
|
532
|
+
label,
|
|
533
|
+
value,
|
|
534
|
+
variant = "caption"
|
|
535
|
+
}) {
|
|
536
|
+
if (variant === "footer") {
|
|
537
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex flex-col justify-between min-w-0", children: [
|
|
538
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-overline text-muted-foreground", children: label }),
|
|
539
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-label-medium text-foreground mt-1 break-words", children: value != null ? value : NO_DATA })
|
|
540
|
+
] });
|
|
541
|
+
}
|
|
542
|
+
const labelClass = variant === "caption" ? "block min-h-[2rem] text-caption text-muted-foreground" : "min-h-[1.75rem] text-overline text-muted-foreground";
|
|
543
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
544
|
+
"div",
|
|
545
|
+
{
|
|
546
|
+
className: cn(
|
|
547
|
+
"min-w-0",
|
|
548
|
+
variant === "overline" && "flex flex-col gap-0.5"
|
|
549
|
+
),
|
|
550
|
+
children: [
|
|
551
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: labelClass, children: label }),
|
|
552
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-label-medium text-foreground break-words", children: value != null ? value : NO_DATA })
|
|
553
|
+
]
|
|
554
|
+
}
|
|
555
|
+
);
|
|
556
|
+
}
|
|
557
|
+
function FinancialLineItem({
|
|
558
|
+
label,
|
|
559
|
+
value,
|
|
560
|
+
destructive
|
|
561
|
+
}) {
|
|
562
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex items-center justify-between gap-4 py-0.5", children: [
|
|
563
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-body-small text-foreground", children: label }),
|
|
564
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
565
|
+
"span",
|
|
566
|
+
{
|
|
567
|
+
className: cn(
|
|
568
|
+
"text-label-medium whitespace-nowrap text-right",
|
|
569
|
+
destructive ? "text-destructive" : "text-foreground"
|
|
570
|
+
),
|
|
571
|
+
children: value || NO_DATA
|
|
572
|
+
}
|
|
573
|
+
)
|
|
574
|
+
] });
|
|
575
|
+
}
|
|
576
|
+
function FinancialSubtotalFrame({
|
|
577
|
+
children
|
|
578
|
+
}) {
|
|
579
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "mt-auto border-t border-primary/20 bg-primary/10 px-4 py-3", children });
|
|
580
|
+
}
|
|
581
|
+
function FinancialSubtotalBlock({
|
|
582
|
+
monthlyAverage,
|
|
583
|
+
totalLast12Months,
|
|
584
|
+
label
|
|
585
|
+
}) {
|
|
586
|
+
const isSingle = monthlyAverage && !totalLast12Months;
|
|
587
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
588
|
+
"div",
|
|
589
|
+
{
|
|
590
|
+
className: cn(
|
|
591
|
+
"flex flex-row items-center",
|
|
592
|
+
isSingle ? "justify-end" : "justify-between"
|
|
593
|
+
),
|
|
594
|
+
children: [
|
|
595
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
596
|
+
"div",
|
|
597
|
+
{
|
|
598
|
+
className: cn(
|
|
599
|
+
"flex flex-col gap-0.5",
|
|
600
|
+
isSingle ? "text-right" : "text-left"
|
|
601
|
+
),
|
|
602
|
+
children: [
|
|
603
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "min-h-[1.75rem] text-overline text-muted-foreground", children: label != null ? label : "Monthly Average" }),
|
|
604
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-label-medium text-foreground", children: monthlyAverage != null ? monthlyAverage : NO_DATA })
|
|
605
|
+
]
|
|
606
|
+
}
|
|
607
|
+
),
|
|
608
|
+
!isSingle && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex flex-col gap-0.5 text-right", children: [
|
|
609
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "min-h-[1.75rem] text-overline text-muted-foreground", children: "Total Last 12 Months" }),
|
|
610
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-label-medium text-foreground", children: totalLast12Months != null ? totalLast12Months : NO_DATA })
|
|
611
|
+
] })
|
|
612
|
+
]
|
|
613
|
+
}
|
|
614
|
+
);
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
// src/components/ui/financial-cards.tsx
|
|
618
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
619
|
+
function AboutCard({
|
|
620
|
+
title,
|
|
621
|
+
firstName,
|
|
622
|
+
lastName,
|
|
623
|
+
phone,
|
|
624
|
+
email,
|
|
625
|
+
gender,
|
|
626
|
+
maritalStatus,
|
|
627
|
+
citizenStatus,
|
|
628
|
+
propertyInTrust,
|
|
629
|
+
companyOwnership
|
|
630
|
+
}) {
|
|
631
|
+
const fullName = [title, firstName, lastName].filter(Boolean).join(" ") || "\u2014";
|
|
632
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "border border-border overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "grid grid-cols-2 gap-x-8 gap-y-4 px-5 py-4", children: [
|
|
633
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(FinancialDetailField, { label: "Full Name", value: fullName }),
|
|
634
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(FinancialDetailField, { label: "Gender", value: gender || "\u2014" }),
|
|
635
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(FinancialDetailField, { label: "Phone", value: phone || "\u2014" }),
|
|
636
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(FinancialDetailField, { label: "Email", value: email || "\u2014" }),
|
|
637
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
638
|
+
FinancialDetailField,
|
|
639
|
+
{
|
|
640
|
+
label: "Marital Status",
|
|
641
|
+
value: maritalStatus || "\u2014"
|
|
642
|
+
}
|
|
643
|
+
),
|
|
644
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
645
|
+
FinancialDetailField,
|
|
646
|
+
{
|
|
647
|
+
label: "Citizenship",
|
|
648
|
+
value: citizenStatus || "\u2014"
|
|
649
|
+
}
|
|
650
|
+
),
|
|
651
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
652
|
+
FinancialDetailField,
|
|
653
|
+
{
|
|
654
|
+
label: "Property in Trust",
|
|
655
|
+
value: propertyInTrust || "\u2014"
|
|
656
|
+
}
|
|
657
|
+
),
|
|
658
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
659
|
+
FinancialDetailField,
|
|
660
|
+
{
|
|
661
|
+
label: "Company Ownership",
|
|
662
|
+
value: companyOwnership || "\u2014"
|
|
663
|
+
}
|
|
664
|
+
)
|
|
665
|
+
] }) });
|
|
666
|
+
}
|
|
667
|
+
function IncomeCard({ items, totalMonthly }) {
|
|
668
|
+
if (items.length === 0) {
|
|
669
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "border border-border px-5 py-4", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "text-sm text-muted-foreground", children: "No income recorded." }) });
|
|
670
|
+
}
|
|
671
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "border border-border overflow-hidden flex flex-col", children: [
|
|
672
|
+
items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
673
|
+
"div",
|
|
674
|
+
{
|
|
675
|
+
className: cn(
|
|
676
|
+
"grid grid-cols-3 gap-x-6 px-5 py-[15px]",
|
|
677
|
+
i < items.length - 1 && "border-b border-border"
|
|
678
|
+
),
|
|
679
|
+
children: [
|
|
680
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(FinancialDetailField, { label: "Type", value: item.incomeType || "\u2014" }),
|
|
681
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
682
|
+
FinancialDetailField,
|
|
683
|
+
{
|
|
684
|
+
label: "Employer",
|
|
685
|
+
value: item.companyName || item.jobTitle || "\u2014"
|
|
686
|
+
}
|
|
687
|
+
),
|
|
688
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(FinancialDetailField, { label: "Amount", value: item.amountLabel })
|
|
689
|
+
]
|
|
690
|
+
},
|
|
691
|
+
i
|
|
692
|
+
)),
|
|
693
|
+
totalMonthly && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(FinancialSubtotalFrame, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
694
|
+
FinancialSubtotalBlock,
|
|
695
|
+
{
|
|
696
|
+
monthlyAverage: totalMonthly,
|
|
697
|
+
label: "Total Monthly Income"
|
|
698
|
+
}
|
|
699
|
+
) })
|
|
700
|
+
] });
|
|
701
|
+
}
|
|
702
|
+
var EXPENSE_ICON_MAP = {
|
|
703
|
+
groceries: import_lucide_react4.ShoppingCart,
|
|
704
|
+
"dining out": import_lucide_react4.UtensilsCrossed,
|
|
705
|
+
dining: import_lucide_react4.UtensilsCrossed,
|
|
706
|
+
restaurants: import_lucide_react4.UtensilsCrossed,
|
|
707
|
+
transport: import_lucide_react4.Car,
|
|
708
|
+
transportation: import_lucide_react4.Car,
|
|
709
|
+
vehicle: import_lucide_react4.Car,
|
|
710
|
+
utilities: import_lucide_react4.Zap,
|
|
711
|
+
electricity: import_lucide_react4.Zap,
|
|
712
|
+
insurance: import_lucide_react4.Shield,
|
|
713
|
+
"council rates": import_lucide_react4.Landmark,
|
|
714
|
+
council: import_lucide_react4.Landmark,
|
|
715
|
+
rates: import_lucide_react4.Landmark,
|
|
716
|
+
medical: import_lucide_react4.HeartPulse,
|
|
717
|
+
health: import_lucide_react4.HeartPulse,
|
|
718
|
+
subscriptions: import_lucide_react4.RefreshCw,
|
|
719
|
+
subscription: import_lucide_react4.RefreshCw,
|
|
720
|
+
"credit card": import_lucide_react4.CreditCard,
|
|
721
|
+
education: import_lucide_react4.GraduationCap,
|
|
722
|
+
childcare: import_lucide_react4.Baby,
|
|
723
|
+
entertainment: import_lucide_react4.Tv,
|
|
724
|
+
gym: import_lucide_react4.Dumbbell,
|
|
725
|
+
fitness: import_lucide_react4.Dumbbell,
|
|
726
|
+
clothing: import_lucide_react4.Shirt,
|
|
727
|
+
rent: import_lucide_react4.Building2
|
|
728
|
+
};
|
|
729
|
+
function getExpenseIcon(expenseType) {
|
|
730
|
+
var _a;
|
|
731
|
+
return (_a = EXPENSE_ICON_MAP[expenseType.toLowerCase()]) != null ? _a : import_lucide_react4.Receipt;
|
|
732
|
+
}
|
|
733
|
+
function ExpensesCard({ items, totalMonthly }) {
|
|
734
|
+
if (items.length === 0) {
|
|
735
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "border border-border px-5 py-4", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "text-sm text-muted-foreground", children: "No expenses recorded." }) });
|
|
736
|
+
}
|
|
737
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "border border-border overflow-hidden flex flex-col", children: [
|
|
738
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "flex flex-col", children: items.map((item, i) => {
|
|
739
|
+
const Icon = getExpenseIcon(item.expenseType);
|
|
740
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
741
|
+
"div",
|
|
742
|
+
{
|
|
743
|
+
className: cn(
|
|
744
|
+
"flex items-center justify-between gap-4 px-5 py-2.5",
|
|
745
|
+
i < items.length - 1 && "border-b border-border"
|
|
746
|
+
),
|
|
747
|
+
children: [
|
|
748
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex items-center gap-2.5", children: [
|
|
749
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Icon, { className: "size-3.5 shrink-0 text-muted-foreground" }),
|
|
750
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "text-body-small text-foreground", children: item.expenseType })
|
|
751
|
+
] }),
|
|
752
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "text-label-medium whitespace-nowrap text-destructive", children: item.amountLabel })
|
|
753
|
+
]
|
|
754
|
+
},
|
|
755
|
+
item.expenseType
|
|
756
|
+
);
|
|
757
|
+
}) }),
|
|
758
|
+
totalMonthly && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(FinancialSubtotalFrame, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
759
|
+
FinancialSubtotalBlock,
|
|
760
|
+
{
|
|
761
|
+
monthlyAverage: totalMonthly,
|
|
762
|
+
label: "Total Monthly Expenses"
|
|
763
|
+
}
|
|
764
|
+
) })
|
|
765
|
+
] });
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
// src/components/ui/financial-sections.tsx
|
|
769
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
770
|
+
function LoanScenarioSection({
|
|
771
|
+
title = "Loan Scenario (Loan Quiz)",
|
|
772
|
+
lendingType,
|
|
773
|
+
purposeOfLoan,
|
|
774
|
+
loanAmount,
|
|
775
|
+
propertyEstimate,
|
|
776
|
+
estLvr,
|
|
777
|
+
cashDeposit,
|
|
778
|
+
propertyAddress,
|
|
779
|
+
duration,
|
|
780
|
+
importantFeatures,
|
|
781
|
+
topThreePriorities
|
|
782
|
+
}) {
|
|
783
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "border border-border p-4", children: [
|
|
784
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(FinancialSectionLabel, { children: title }) }),
|
|
785
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "grid grid-cols-4 gap-x-6 gap-y-4", children: [
|
|
786
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(FinancialDetailField, { label: "Lending Type", value: lendingType }),
|
|
787
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(FinancialDetailField, { label: "Purpose of Loan", value: purposeOfLoan }),
|
|
788
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(FinancialDetailField, { label: "Loan Amount", value: loanAmount }),
|
|
789
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
790
|
+
FinancialDetailField,
|
|
791
|
+
{
|
|
792
|
+
label: "Property Estimate",
|
|
793
|
+
value: propertyEstimate
|
|
794
|
+
}
|
|
795
|
+
),
|
|
796
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(FinancialDetailField, { label: "EST LVR", value: estLvr }),
|
|
797
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(FinancialDetailField, { label: "Cash/Deposit", value: cashDeposit }),
|
|
798
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
799
|
+
FinancialDetailField,
|
|
800
|
+
{
|
|
801
|
+
label: "Property Address",
|
|
802
|
+
value: propertyAddress
|
|
803
|
+
}
|
|
804
|
+
),
|
|
805
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(FinancialDetailField, { label: "Duration", value: duration }),
|
|
806
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
807
|
+
FinancialDetailField,
|
|
808
|
+
{
|
|
809
|
+
label: "Important Features",
|
|
810
|
+
value: importantFeatures
|
|
811
|
+
}
|
|
812
|
+
),
|
|
813
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
814
|
+
FinancialDetailField,
|
|
815
|
+
{
|
|
816
|
+
label: "Top Three Priorities",
|
|
817
|
+
value: topThreePriorities
|
|
818
|
+
}
|
|
819
|
+
)
|
|
820
|
+
] })
|
|
821
|
+
] });
|
|
822
|
+
}
|
|
823
|
+
function FinancialBottomSummary({
|
|
824
|
+
cashflowItems = [],
|
|
825
|
+
netSurplus,
|
|
826
|
+
netSurplusDestructive = false,
|
|
827
|
+
assetItems = [],
|
|
828
|
+
totalAssets,
|
|
829
|
+
totalLiabilities,
|
|
830
|
+
netPosition,
|
|
831
|
+
netPositionDestructive = false
|
|
832
|
+
}) {
|
|
833
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "border border-border", children: [
|
|
834
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "p-4", children: [
|
|
835
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(FinancialSectionLabel, { children: "Incoming vs Outgoing Summary" }) }),
|
|
836
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "flex flex-col", children: cashflowItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
837
|
+
FinancialLineItem,
|
|
838
|
+
{
|
|
839
|
+
label: item.label,
|
|
840
|
+
value: item.value,
|
|
841
|
+
destructive: item.destructive
|
|
842
|
+
},
|
|
843
|
+
item.label
|
|
844
|
+
)) }),
|
|
845
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(FinancialSubtotalFrame, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
846
|
+
FinancialSubtotalBlock,
|
|
847
|
+
{
|
|
848
|
+
monthlyAverage: netSurplus,
|
|
849
|
+
label: netSurplusDestructive ? "Net Deficit" : "Net Surplus"
|
|
850
|
+
}
|
|
851
|
+
) })
|
|
852
|
+
] }),
|
|
853
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Separator, {}),
|
|
854
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "p-4", children: [
|
|
855
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(FinancialSectionLabel, { children: "Assets" }) }),
|
|
856
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "flex flex-col", children: assetItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
857
|
+
FinancialLineItem,
|
|
858
|
+
{
|
|
859
|
+
label: item.label,
|
|
860
|
+
value: item.value,
|
|
861
|
+
destructive: item.destructive
|
|
862
|
+
},
|
|
863
|
+
item.label
|
|
864
|
+
)) }),
|
|
865
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(FinancialSubtotalFrame, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
866
|
+
FinancialSubtotalBlock,
|
|
867
|
+
{
|
|
868
|
+
monthlyAverage: totalAssets,
|
|
869
|
+
label: "Total Assets"
|
|
870
|
+
}
|
|
871
|
+
) })
|
|
872
|
+
] }),
|
|
873
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Separator, {}),
|
|
874
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "p-4", children: [
|
|
875
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(FinancialSectionLabel, { children: "Net Position" }) }),
|
|
876
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-col", children: [
|
|
877
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
878
|
+
FinancialLineItem,
|
|
879
|
+
{
|
|
880
|
+
label: "Total Liabilities",
|
|
881
|
+
value: totalLiabilities,
|
|
882
|
+
destructive: true
|
|
883
|
+
}
|
|
884
|
+
),
|
|
885
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(FinancialLineItem, { label: "Total Assets", value: totalAssets })
|
|
886
|
+
] }),
|
|
887
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(FinancialSubtotalFrame, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
888
|
+
FinancialSubtotalBlock,
|
|
889
|
+
{
|
|
890
|
+
monthlyAverage: netPosition,
|
|
891
|
+
label: netPositionDestructive ? "Net Deficit" : "Net Position"
|
|
892
|
+
}
|
|
893
|
+
) })
|
|
894
|
+
] })
|
|
895
|
+
] });
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
// src/components/ui/opportunity-edit-modals.tsx
|
|
899
|
+
var React10 = __toESM(require("react"));
|
|
900
|
+
var import_lucide_react11 = require("lucide-react");
|
|
901
|
+
|
|
902
|
+
// src/components/ui/dialog.tsx
|
|
903
|
+
var import_lucide_react5 = require("lucide-react");
|
|
904
|
+
var import_dialog = require("@base-ui/react/dialog");
|
|
905
|
+
|
|
906
|
+
// src/lib/theme-provider.tsx
|
|
907
|
+
var import_react3 = require("react");
|
|
908
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
909
|
+
var ThemeVarsContext = (0, import_react3.createContext)({});
|
|
910
|
+
function useThemeVars() {
|
|
911
|
+
return (0, import_react3.useContext)(ThemeVarsContext);
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
// src/components/ui/dialog.tsx
|
|
915
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
916
|
+
function Dialog(_a) {
|
|
917
|
+
var props = __objRest(_a, []);
|
|
918
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_dialog.Dialog.Root, __spreadValues({ "data-slot": "dialog" }, props));
|
|
919
|
+
}
|
|
920
|
+
function DialogPortal(_a) {
|
|
921
|
+
var props = __objRest(_a, []);
|
|
922
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_dialog.Dialog.Portal, __spreadValues({ "data-slot": "dialog-portal" }, props));
|
|
923
|
+
}
|
|
924
|
+
function DialogOverlay(_a) {
|
|
925
|
+
var _b = _a, {
|
|
926
|
+
className
|
|
927
|
+
} = _b, props = __objRest(_b, [
|
|
928
|
+
"className"
|
|
929
|
+
]);
|
|
930
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
931
|
+
import_dialog.Dialog.Backdrop,
|
|
932
|
+
__spreadValues({
|
|
933
|
+
className: cn(
|
|
934
|
+
// WealthX: foreground/50 scrim (matches Figma — foreground token at 50% opacity)
|
|
935
|
+
"fixed inset-0 z-50 bg-foreground/50 data-ending-style:animate-out data-ending-style:fade-out-0 data-ending-style:fill-mode-forwards data-open:animate-in data-open:fade-in-0",
|
|
936
|
+
className
|
|
937
|
+
),
|
|
938
|
+
"data-slot": "dialog-overlay"
|
|
939
|
+
}, props)
|
|
940
|
+
);
|
|
941
|
+
}
|
|
942
|
+
function DialogContent(_a) {
|
|
943
|
+
var _b = _a, {
|
|
944
|
+
className,
|
|
945
|
+
children,
|
|
946
|
+
showCloseButton = true,
|
|
947
|
+
style
|
|
948
|
+
} = _b, props = __objRest(_b, [
|
|
949
|
+
"className",
|
|
950
|
+
"children",
|
|
951
|
+
"showCloseButton",
|
|
952
|
+
"style"
|
|
953
|
+
]);
|
|
954
|
+
const themeVars = useThemeVars();
|
|
955
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(DialogPortal, { children: [
|
|
956
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(DialogOverlay, { style: themeVars }),
|
|
957
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
958
|
+
import_dialog.Dialog.Popup,
|
|
959
|
+
__spreadProps(__spreadValues({
|
|
960
|
+
className: cn(
|
|
961
|
+
// WealthX: removed rounded-lg (sharp corners), shadow-lg (flat panels), foreground/50 scrim via DialogOverlay
|
|
962
|
+
"fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 duration-200 outline-none data-ending-style:animate-out data-ending-style:fade-out-0 data-ending-style:zoom-out-95 data-ending-style:fill-mode-forwards data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 sm:max-w-lg",
|
|
963
|
+
className
|
|
964
|
+
),
|
|
965
|
+
"data-slot": "dialog-content",
|
|
966
|
+
style: __spreadValues(__spreadValues({}, themeVars), style)
|
|
967
|
+
}, props), {
|
|
968
|
+
children: [
|
|
969
|
+
children,
|
|
970
|
+
showCloseButton ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
971
|
+
import_dialog.Dialog.Close,
|
|
972
|
+
{
|
|
973
|
+
className: "absolute top-4 right-4 transition-colors hover:bg-foreground/5 focus:outline-hidden focus:ring-2 focus:ring-border focus:ring-offset-0 disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
974
|
+
"data-slot": "dialog-close",
|
|
975
|
+
children: [
|
|
976
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react5.XIcon, {}),
|
|
977
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "sr-only", children: "Close" })
|
|
978
|
+
]
|
|
979
|
+
}
|
|
980
|
+
) : null
|
|
981
|
+
]
|
|
982
|
+
})
|
|
983
|
+
)
|
|
984
|
+
] });
|
|
985
|
+
}
|
|
986
|
+
function DialogHeader(_a) {
|
|
987
|
+
var _b = _a, {
|
|
988
|
+
className
|
|
989
|
+
} = _b, props = __objRest(_b, [
|
|
990
|
+
"className"
|
|
991
|
+
]);
|
|
992
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
993
|
+
"div",
|
|
994
|
+
__spreadValues({
|
|
995
|
+
className: cn("flex flex-col gap-1.5", className),
|
|
996
|
+
"data-slot": "dialog-header"
|
|
997
|
+
}, props)
|
|
998
|
+
);
|
|
999
|
+
}
|
|
1000
|
+
function DialogFooter(_a) {
|
|
1001
|
+
var _b = _a, {
|
|
1002
|
+
className,
|
|
1003
|
+
showCloseButton = false,
|
|
1004
|
+
children
|
|
1005
|
+
} = _b, props = __objRest(_b, [
|
|
1006
|
+
"className",
|
|
1007
|
+
"showCloseButton",
|
|
1008
|
+
"children"
|
|
1009
|
+
]);
|
|
1010
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1011
|
+
"div",
|
|
1012
|
+
__spreadProps(__spreadValues({
|
|
1013
|
+
className: cn(
|
|
1014
|
+
// WealthX: always row layout, right-aligned, separator above footer
|
|
1015
|
+
"flex flex-row justify-end gap-2 border-t border-border pt-4",
|
|
1016
|
+
className
|
|
1017
|
+
),
|
|
1018
|
+
"data-slot": "dialog-footer"
|
|
1019
|
+
}, props), {
|
|
1020
|
+
children: [
|
|
1021
|
+
children,
|
|
1022
|
+
showCloseButton ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1023
|
+
import_dialog.Dialog.Close,
|
|
1024
|
+
{
|
|
1025
|
+
className: cn(buttonVariants({ variant: "outline" })),
|
|
1026
|
+
children: "Close"
|
|
1027
|
+
}
|
|
1028
|
+
) : null
|
|
1029
|
+
]
|
|
1030
|
+
})
|
|
1031
|
+
);
|
|
1032
|
+
}
|
|
1033
|
+
function DialogTitle(_a) {
|
|
1034
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1035
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1036
|
+
import_dialog.Dialog.Title,
|
|
1037
|
+
__spreadValues({
|
|
1038
|
+
className: cn("text-h5 leading-none", className),
|
|
1039
|
+
"data-slot": "dialog-title"
|
|
1040
|
+
}, props)
|
|
1041
|
+
);
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
// src/components/ui/input.tsx
|
|
1045
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1046
|
+
function Input(_a) {
|
|
1047
|
+
var _b = _a, { className, type } = _b, props = __objRest(_b, ["className", "type"]);
|
|
1048
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1049
|
+
"input",
|
|
1050
|
+
__spreadValues({
|
|
1051
|
+
className: cn(
|
|
1052
|
+
"h-9 w-full min-w-0 border border-input bg-transparent px-3 py-1 text-body-medium font-sans shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-label-medium file:text-foreground placeholder:font-normal placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 dark:bg-input/30",
|
|
1053
|
+
"focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/20",
|
|
1054
|
+
"aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",
|
|
1055
|
+
className
|
|
1056
|
+
),
|
|
1057
|
+
"data-slot": "input",
|
|
1058
|
+
type
|
|
1059
|
+
}, props)
|
|
1060
|
+
);
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
// src/components/ui/label.tsx
|
|
1064
|
+
var import_jsx_runtime13 = (
|
|
1065
|
+
// eslint-disable-next-line jsx-a11y/label-has-associated-control -- htmlFor is passed by the consumer
|
|
1066
|
+
require("react/jsx-runtime")
|
|
1067
|
+
);
|
|
1068
|
+
function Label(_a) {
|
|
1069
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1070
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1071
|
+
"label",
|
|
1072
|
+
__spreadValues({
|
|
1073
|
+
className: cn(
|
|
1074
|
+
"flex items-center gap-2 text-label-medium leading-none select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
|
|
1075
|
+
className
|
|
1076
|
+
),
|
|
1077
|
+
"data-slot": "label"
|
|
1078
|
+
}, props)
|
|
1079
|
+
);
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
// src/components/ui/textarea.tsx
|
|
1083
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1084
|
+
function Textarea(_a) {
|
|
1085
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1086
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1087
|
+
"textarea",
|
|
1088
|
+
__spreadValues({
|
|
1089
|
+
className: cn(
|
|
1090
|
+
// WealthX: removed shadow-xs (flat panels), added font-sans
|
|
1091
|
+
"flex field-sizing-content min-h-16 w-full border border-input bg-transparent px-3 py-2 text-body-medium font-sans transition-[color,box-shadow] outline-none placeholder:font-normal placeholder:text-muted-foreground focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/20 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:ring-destructive/40",
|
|
1092
|
+
className
|
|
1093
|
+
),
|
|
1094
|
+
"data-slot": "textarea"
|
|
1095
|
+
}, props)
|
|
1096
|
+
);
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
// src/components/ui/select.tsx
|
|
1100
|
+
var import_lucide_react6 = require("lucide-react");
|
|
1101
|
+
var import_select = require("@base-ui/react/select");
|
|
1102
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1103
|
+
function Select(_a) {
|
|
1104
|
+
var props = __objRest(_a, []);
|
|
1105
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_select.Select.Root, __spreadValues({ "data-slot": "select" }, props));
|
|
1106
|
+
}
|
|
1107
|
+
function SelectValue(_a) {
|
|
1108
|
+
var props = __objRest(_a, []);
|
|
1109
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_select.Select.Value, __spreadValues({ "data-slot": "select-value" }, props));
|
|
1110
|
+
}
|
|
1111
|
+
function SelectTrigger(_a) {
|
|
1112
|
+
var _b = _a, {
|
|
1113
|
+
className,
|
|
1114
|
+
size = "default",
|
|
1115
|
+
children
|
|
1116
|
+
} = _b, props = __objRest(_b, [
|
|
1117
|
+
"className",
|
|
1118
|
+
"size",
|
|
1119
|
+
"children"
|
|
1120
|
+
]);
|
|
1121
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1122
|
+
import_select.Select.Trigger,
|
|
1123
|
+
__spreadProps(__spreadValues({
|
|
1124
|
+
className: cn(
|
|
1125
|
+
"flex w-fit items-center justify-between gap-2 border border-input bg-transparent px-3 py-2 text-body-medium whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/20 data-popup-open:border-primary data-popup-open:ring-[3px] data-popup-open:ring-primary/20 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-placeholder:font-normal data-placeholder:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",
|
|
1126
|
+
className
|
|
1127
|
+
),
|
|
1128
|
+
"data-size": size,
|
|
1129
|
+
"data-slot": "select-trigger"
|
|
1130
|
+
}, props), {
|
|
1131
|
+
children: [
|
|
1132
|
+
children,
|
|
1133
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_select.Select.Icon, { className: "transition-transform duration-200 data-popup-open:rotate-180", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react6.ChevronDownIcon, { className: "size-4 opacity-50" }) })
|
|
1134
|
+
]
|
|
1135
|
+
})
|
|
1136
|
+
);
|
|
1137
|
+
}
|
|
1138
|
+
function SelectContent(_a) {
|
|
1139
|
+
var _b = _a, {
|
|
1140
|
+
className,
|
|
1141
|
+
children,
|
|
1142
|
+
style
|
|
1143
|
+
} = _b, props = __objRest(_b, [
|
|
1144
|
+
"className",
|
|
1145
|
+
"children",
|
|
1146
|
+
"style"
|
|
1147
|
+
]);
|
|
1148
|
+
const themeVars = useThemeVars();
|
|
1149
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_select.Select.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1150
|
+
import_select.Select.Positioner,
|
|
1151
|
+
{
|
|
1152
|
+
className: "z-[200]",
|
|
1153
|
+
align: "start",
|
|
1154
|
+
alignItemWithTrigger: false,
|
|
1155
|
+
sideOffset: 4,
|
|
1156
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1157
|
+
import_select.Select.Popup,
|
|
1158
|
+
__spreadProps(__spreadValues({
|
|
1159
|
+
className: cn(
|
|
1160
|
+
"relative max-h-[var(--available-height)] min-w-[var(--anchor-width,8rem)] overflow-x-hidden overflow-y-auto border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-ending-style:animate-out data-ending-style:fade-out-0 data-ending-style:zoom-out-95 data-ending-style:fill-mode-forwards data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95",
|
|
1161
|
+
className
|
|
1162
|
+
),
|
|
1163
|
+
"data-slot": "select-content",
|
|
1164
|
+
style: __spreadValues(__spreadValues({}, themeVars), style)
|
|
1165
|
+
}, props), {
|
|
1166
|
+
children: [
|
|
1167
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SelectScrollUpButton, {}),
|
|
1168
|
+
children,
|
|
1169
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SelectScrollDownButton, {})
|
|
1170
|
+
]
|
|
1171
|
+
})
|
|
1172
|
+
)
|
|
1173
|
+
}
|
|
1174
|
+
) });
|
|
1175
|
+
}
|
|
1176
|
+
function SelectItem(_a) {
|
|
1177
|
+
var _b = _a, {
|
|
1178
|
+
className,
|
|
1179
|
+
children
|
|
1180
|
+
} = _b, props = __objRest(_b, [
|
|
1181
|
+
"className",
|
|
1182
|
+
"children"
|
|
1183
|
+
]);
|
|
1184
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1185
|
+
import_select.Select.Item,
|
|
1186
|
+
__spreadProps(__spreadValues({
|
|
1187
|
+
className: cn(
|
|
1188
|
+
"relative flex w-full cursor-default items-center gap-2 py-1.5 pr-8 pl-2 text-body-small outline-hidden select-none data-highlighted:bg-primary/5 data-highlighted:text-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
|
|
1189
|
+
className
|
|
1190
|
+
),
|
|
1191
|
+
"data-slot": "select-item"
|
|
1192
|
+
}, props), {
|
|
1193
|
+
children: [
|
|
1194
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1195
|
+
"span",
|
|
1196
|
+
{
|
|
1197
|
+
className: "absolute right-2 flex size-3.5 items-center justify-center",
|
|
1198
|
+
"data-slot": "select-item-indicator",
|
|
1199
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_select.Select.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react6.CheckIcon, { className: "size-4" }) })
|
|
1200
|
+
}
|
|
1201
|
+
),
|
|
1202
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_select.Select.ItemText, { children })
|
|
1203
|
+
]
|
|
1204
|
+
})
|
|
1205
|
+
);
|
|
1206
|
+
}
|
|
1207
|
+
function SelectScrollUpButton(_a) {
|
|
1208
|
+
var _b = _a, {
|
|
1209
|
+
className
|
|
1210
|
+
} = _b, props = __objRest(_b, [
|
|
1211
|
+
"className"
|
|
1212
|
+
]);
|
|
1213
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1214
|
+
import_select.Select.ScrollUpArrow,
|
|
1215
|
+
__spreadProps(__spreadValues({
|
|
1216
|
+
className: cn(
|
|
1217
|
+
"flex cursor-default items-center justify-center py-1",
|
|
1218
|
+
className
|
|
1219
|
+
),
|
|
1220
|
+
"data-slot": "select-scroll-up-button"
|
|
1221
|
+
}, props), {
|
|
1222
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react6.ChevronUpIcon, { className: "size-4" })
|
|
1223
|
+
})
|
|
1224
|
+
);
|
|
1225
|
+
}
|
|
1226
|
+
function SelectScrollDownButton(_a) {
|
|
1227
|
+
var _b = _a, {
|
|
1228
|
+
className
|
|
1229
|
+
} = _b, props = __objRest(_b, [
|
|
1230
|
+
"className"
|
|
1231
|
+
]);
|
|
1232
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1233
|
+
import_select.Select.ScrollDownArrow,
|
|
1234
|
+
__spreadProps(__spreadValues({
|
|
1235
|
+
className: cn(
|
|
1236
|
+
"flex cursor-default items-center justify-center py-1",
|
|
1237
|
+
className
|
|
1238
|
+
),
|
|
1239
|
+
"data-slot": "select-scroll-down-button"
|
|
1240
|
+
}, props), {
|
|
1241
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react6.ChevronDownIcon, { className: "size-4" })
|
|
1242
|
+
})
|
|
1243
|
+
);
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
// src/components/ui/checkbox.tsx
|
|
1247
|
+
var import_react4 = require("react");
|
|
1248
|
+
var import_lucide_react7 = require("lucide-react");
|
|
1249
|
+
var import_checkbox = require("@base-ui/react/checkbox");
|
|
1250
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1251
|
+
function Checkbox(_a) {
|
|
1252
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1253
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1254
|
+
import_checkbox.Checkbox.Root,
|
|
1255
|
+
__spreadProps(__spreadValues({
|
|
1256
|
+
className: cn(
|
|
1257
|
+
"peer group inline-flex size-4 shrink-0 border border-input shadow-xs transition-all outline-none",
|
|
1258
|
+
"focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50",
|
|
1259
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
1260
|
+
"aria-invalid:border-destructive aria-invalid:ring-destructive/20",
|
|
1261
|
+
"data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground",
|
|
1262
|
+
"data-indeterminate:border-primary data-indeterminate:bg-primary data-indeterminate:text-primary-foreground",
|
|
1263
|
+
// Dark mode (upstream shadcn)
|
|
1264
|
+
"dark:bg-input/30 dark:aria-invalid:ring-destructive/40 dark:data-checked:bg-primary",
|
|
1265
|
+
// Stacked (2 attr selectors) → wins over single-attr rules above
|
|
1266
|
+
"aria-invalid:data-checked:border-destructive aria-invalid:data-checked:bg-destructive aria-invalid:data-checked:text-destructive-foreground",
|
|
1267
|
+
"aria-invalid:data-indeterminate:border-destructive aria-invalid:data-indeterminate:bg-destructive aria-invalid:data-indeterminate:text-destructive-foreground",
|
|
1268
|
+
className
|
|
1269
|
+
),
|
|
1270
|
+
"data-slot": "checkbox"
|
|
1271
|
+
}, props), {
|
|
1272
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
1273
|
+
import_checkbox.Checkbox.Indicator,
|
|
1274
|
+
{
|
|
1275
|
+
className: "grid place-content-center text-current transition-none",
|
|
1276
|
+
"data-slot": "checkbox-indicator",
|
|
1277
|
+
children: [
|
|
1278
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react7.CheckIcon, { className: "size-3.5 group-data-indeterminate:hidden" }),
|
|
1279
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react7.MinusIcon, { className: "size-3.5 hidden group-data-indeterminate:block" })
|
|
1280
|
+
]
|
|
1281
|
+
}
|
|
1282
|
+
)
|
|
1283
|
+
})
|
|
1284
|
+
);
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1287
|
+
// src/components/ui/date-picker.tsx
|
|
1288
|
+
var React6 = __toESM(require("react"));
|
|
1289
|
+
var import_date_fns = require("date-fns");
|
|
1290
|
+
var import_lucide_react9 = require("lucide-react");
|
|
1291
|
+
|
|
1292
|
+
// src/components/ui/calendar.tsx
|
|
1293
|
+
var React5 = __toESM(require("react"));
|
|
1294
|
+
var import_lucide_react8 = require("lucide-react");
|
|
1295
|
+
var import_react_day_picker = require("react-day-picker");
|
|
1296
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1297
|
+
function CalendarRoot(_a) {
|
|
1298
|
+
var _b = _a, {
|
|
1299
|
+
className,
|
|
1300
|
+
rootRef
|
|
1301
|
+
} = _b, props = __objRest(_b, [
|
|
1302
|
+
"className",
|
|
1303
|
+
"rootRef"
|
|
1304
|
+
]);
|
|
1305
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1306
|
+
"div",
|
|
1307
|
+
__spreadValues({
|
|
1308
|
+
className: cn(className),
|
|
1309
|
+
"data-slot": "calendar",
|
|
1310
|
+
ref: rootRef
|
|
1311
|
+
}, props)
|
|
1312
|
+
);
|
|
1313
|
+
}
|
|
1314
|
+
function CalendarChevron(_a) {
|
|
1315
|
+
var _b = _a, {
|
|
1316
|
+
className,
|
|
1317
|
+
orientation
|
|
1318
|
+
} = _b, props = __objRest(_b, [
|
|
1319
|
+
"className",
|
|
1320
|
+
"orientation"
|
|
1321
|
+
]);
|
|
1322
|
+
if (orientation === "left") {
|
|
1323
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react8.ChevronLeftIcon, __spreadValues({ className: cn("size-4", className) }, props));
|
|
1324
|
+
}
|
|
1325
|
+
if (orientation === "right") {
|
|
1326
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react8.ChevronRightIcon, __spreadValues({ className: cn("size-4", className) }, props));
|
|
1327
|
+
}
|
|
1328
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react8.ChevronDownIcon, __spreadValues({ className: cn("size-4", className) }, props));
|
|
1329
|
+
}
|
|
1330
|
+
function CalendarWeekNumber(_a) {
|
|
1331
|
+
var _b = _a, {
|
|
1332
|
+
children
|
|
1333
|
+
} = _b, props = __objRest(_b, [
|
|
1334
|
+
"children"
|
|
1335
|
+
]);
|
|
1336
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("td", __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children }) }));
|
|
1337
|
+
}
|
|
1338
|
+
function Calendar(_a) {
|
|
1339
|
+
var _b = _a, {
|
|
1340
|
+
className,
|
|
1341
|
+
classNames,
|
|
1342
|
+
showOutsideDays = true,
|
|
1343
|
+
captionLayout = "dropdown",
|
|
1344
|
+
buttonVariant = "ghost",
|
|
1345
|
+
formatters,
|
|
1346
|
+
components
|
|
1347
|
+
} = _b, props = __objRest(_b, [
|
|
1348
|
+
"className",
|
|
1349
|
+
"classNames",
|
|
1350
|
+
"showOutsideDays",
|
|
1351
|
+
"captionLayout",
|
|
1352
|
+
"buttonVariant",
|
|
1353
|
+
"formatters",
|
|
1354
|
+
"components"
|
|
1355
|
+
]);
|
|
1356
|
+
const defaultClassNames = (0, import_react_day_picker.getDefaultClassNames)();
|
|
1357
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1358
|
+
import_react_day_picker.DayPicker,
|
|
1359
|
+
__spreadValues({
|
|
1360
|
+
captionLayout,
|
|
1361
|
+
className: cn(
|
|
1362
|
+
"group/calendar bg-background p-3 font-sans border border-border shadow-sm [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",
|
|
1363
|
+
String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
|
|
1364
|
+
String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
|
|
1365
|
+
className
|
|
1366
|
+
),
|
|
1367
|
+
classNames: __spreadValues({
|
|
1368
|
+
root: cn("w-fit", defaultClassNames.root),
|
|
1369
|
+
months: cn(
|
|
1370
|
+
"relative flex flex-col gap-4 md:flex-row",
|
|
1371
|
+
defaultClassNames.months
|
|
1372
|
+
),
|
|
1373
|
+
month: cn("flex w-full flex-col gap-4", defaultClassNames.month),
|
|
1374
|
+
nav: cn(
|
|
1375
|
+
"absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",
|
|
1376
|
+
defaultClassNames.nav
|
|
1377
|
+
),
|
|
1378
|
+
button_previous: cn(
|
|
1379
|
+
buttonVariants({ variant: buttonVariant }),
|
|
1380
|
+
"size-(--cell-size) p-0 select-none aria-disabled:opacity-50",
|
|
1381
|
+
defaultClassNames.button_previous
|
|
1382
|
+
),
|
|
1383
|
+
button_next: cn(
|
|
1384
|
+
buttonVariants({ variant: buttonVariant }),
|
|
1385
|
+
"size-(--cell-size) p-0 select-none aria-disabled:opacity-50",
|
|
1386
|
+
defaultClassNames.button_next
|
|
1387
|
+
),
|
|
1388
|
+
month_caption: cn(
|
|
1389
|
+
"flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)",
|
|
1390
|
+
defaultClassNames.month_caption
|
|
1391
|
+
),
|
|
1392
|
+
dropdowns: cn(
|
|
1393
|
+
"flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-label-small",
|
|
1394
|
+
defaultClassNames.dropdowns
|
|
1395
|
+
),
|
|
1396
|
+
dropdown_root: cn(
|
|
1397
|
+
"relative border border-input shadow-xs has-focus:border-ring has-focus:ring-[3px] has-focus:ring-ring/50",
|
|
1398
|
+
defaultClassNames.dropdown_root
|
|
1399
|
+
),
|
|
1400
|
+
dropdown: cn(
|
|
1401
|
+
"absolute inset-0 bg-popover opacity-0",
|
|
1402
|
+
defaultClassNames.dropdown
|
|
1403
|
+
),
|
|
1404
|
+
caption_label: cn(
|
|
1405
|
+
"select-none",
|
|
1406
|
+
captionLayout === "label" ? "text-label-small" : "flex h-8 items-center gap-1 pr-1 pl-2 text-label-small [&>svg]:size-3.5 [&>svg]:text-muted-foreground",
|
|
1407
|
+
defaultClassNames.caption_label
|
|
1408
|
+
),
|
|
1409
|
+
table: "w-full border-collapse",
|
|
1410
|
+
weekdays: cn("flex", defaultClassNames.weekdays),
|
|
1411
|
+
weekday: cn(
|
|
1412
|
+
"flex-1 text-caption font-normal text-muted-foreground select-none",
|
|
1413
|
+
defaultClassNames.weekday
|
|
1414
|
+
),
|
|
1415
|
+
week: cn("mt-2 flex w-full", defaultClassNames.week),
|
|
1416
|
+
week_number_header: cn(
|
|
1417
|
+
"w-(--cell-size) select-none",
|
|
1418
|
+
defaultClassNames.week_number_header
|
|
1419
|
+
),
|
|
1420
|
+
week_number: cn(
|
|
1421
|
+
"text-caption text-muted-foreground select-none",
|
|
1422
|
+
defaultClassNames.week_number
|
|
1423
|
+
),
|
|
1424
|
+
day: cn(
|
|
1425
|
+
"group/day relative aspect-square h-full w-full p-0 text-center select-none",
|
|
1426
|
+
defaultClassNames.day
|
|
1427
|
+
),
|
|
1428
|
+
range_start: cn("bg-accent", defaultClassNames.range_start),
|
|
1429
|
+
range_middle: cn("rounded-none", defaultClassNames.range_middle),
|
|
1430
|
+
range_end: cn("bg-accent", defaultClassNames.range_end),
|
|
1431
|
+
today: cn("bg-accent text-accent-foreground", defaultClassNames.today),
|
|
1432
|
+
outside: cn(
|
|
1433
|
+
"text-muted-foreground aria-selected:text-muted-foreground",
|
|
1434
|
+
defaultClassNames.outside
|
|
1435
|
+
),
|
|
1436
|
+
disabled: cn(
|
|
1437
|
+
"text-muted-foreground opacity-50",
|
|
1438
|
+
defaultClassNames.disabled
|
|
1439
|
+
),
|
|
1440
|
+
hidden: cn("invisible", defaultClassNames.hidden)
|
|
1441
|
+
}, classNames),
|
|
1442
|
+
components: __spreadValues({
|
|
1443
|
+
Root: CalendarRoot,
|
|
1444
|
+
Chevron: CalendarChevron,
|
|
1445
|
+
DayButton: CalendarDayButton,
|
|
1446
|
+
WeekNumber: CalendarWeekNumber
|
|
1447
|
+
}, components),
|
|
1448
|
+
formatters: __spreadValues({
|
|
1449
|
+
formatMonthDropdown: (date) => date.toLocaleString("default", { month: "short" })
|
|
1450
|
+
}, formatters),
|
|
1451
|
+
showOutsideDays
|
|
1452
|
+
}, props)
|
|
1453
|
+
);
|
|
1454
|
+
}
|
|
1455
|
+
function CalendarDayButton(_a) {
|
|
1456
|
+
var _b = _a, {
|
|
1457
|
+
className,
|
|
1458
|
+
day,
|
|
1459
|
+
modifiers
|
|
1460
|
+
} = _b, props = __objRest(_b, [
|
|
1461
|
+
"className",
|
|
1462
|
+
"day",
|
|
1463
|
+
"modifiers"
|
|
1464
|
+
]);
|
|
1465
|
+
const defaultClassNames = (0, import_react_day_picker.getDefaultClassNames)();
|
|
1466
|
+
const ref = React5.useRef(null);
|
|
1467
|
+
React5.useEffect(() => {
|
|
1468
|
+
var _a2;
|
|
1469
|
+
if (modifiers.focused) (_a2 = ref.current) == null ? void 0 : _a2.focus();
|
|
1470
|
+
}, [modifiers.focused]);
|
|
1471
|
+
const selectedSingle = modifiers.selected && !modifiers.range_start && !modifiers.range_end ? !modifiers.range_middle : null;
|
|
1472
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1473
|
+
Button,
|
|
1474
|
+
__spreadValues({
|
|
1475
|
+
className: cn(
|
|
1476
|
+
"flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 font-normal rounded-none group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-accent-foreground [&>span]:text-caption [&>span]:opacity-70",
|
|
1477
|
+
defaultClassNames.day,
|
|
1478
|
+
className
|
|
1479
|
+
),
|
|
1480
|
+
"data-day": day.date.toLocaleDateString(),
|
|
1481
|
+
"data-range-end": modifiers.range_end,
|
|
1482
|
+
"data-range-middle": modifiers.range_middle,
|
|
1483
|
+
"data-range-start": modifiers.range_start,
|
|
1484
|
+
"data-selected-single": selectedSingle,
|
|
1485
|
+
ref,
|
|
1486
|
+
size: "icon",
|
|
1487
|
+
variant: "ghost"
|
|
1488
|
+
}, props)
|
|
1489
|
+
);
|
|
1490
|
+
}
|
|
1491
|
+
|
|
1492
|
+
// src/components/ui/popover.tsx
|
|
1493
|
+
var import_popover = require("@base-ui/react/popover");
|
|
1494
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1495
|
+
function Popover(_a) {
|
|
1496
|
+
var props = __objRest(_a, []);
|
|
1497
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_popover.Popover.Root, __spreadValues({ "data-slot": "popover" }, props));
|
|
1498
|
+
}
|
|
1499
|
+
function PopoverTrigger(_a) {
|
|
1500
|
+
var props = __objRest(_a, []);
|
|
1501
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_popover.Popover.Trigger, __spreadValues({ "data-slot": "popover-trigger" }, props));
|
|
1502
|
+
}
|
|
1503
|
+
function PopoverContent(_a) {
|
|
1504
|
+
var _b = _a, {
|
|
1505
|
+
className,
|
|
1506
|
+
align = "center",
|
|
1507
|
+
sideOffset = 4,
|
|
1508
|
+
style
|
|
1509
|
+
} = _b, props = __objRest(_b, [
|
|
1510
|
+
"className",
|
|
1511
|
+
"align",
|
|
1512
|
+
"sideOffset",
|
|
1513
|
+
"style"
|
|
1514
|
+
]);
|
|
1515
|
+
const themeVars = useThemeVars();
|
|
1516
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_popover.Popover.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1517
|
+
import_popover.Popover.Positioner,
|
|
1518
|
+
{
|
|
1519
|
+
className: "z-[200]",
|
|
1520
|
+
align,
|
|
1521
|
+
sideOffset,
|
|
1522
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1523
|
+
import_popover.Popover.Popup,
|
|
1524
|
+
__spreadValues({
|
|
1525
|
+
className: cn(
|
|
1526
|
+
"z-50 w-72 border border-border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-ending-style:animate-out data-ending-style:fade-out-0 data-ending-style:zoom-out-95 data-ending-style:fill-mode-forwards data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95",
|
|
1527
|
+
className
|
|
1528
|
+
),
|
|
1529
|
+
"data-slot": "popover-content",
|
|
1530
|
+
style: __spreadValues(__spreadValues({}, themeVars), style)
|
|
1531
|
+
}, props)
|
|
1532
|
+
)
|
|
1533
|
+
}
|
|
1534
|
+
) });
|
|
1535
|
+
}
|
|
1536
|
+
|
|
1537
|
+
// src/components/ui/date-picker.tsx
|
|
1538
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1539
|
+
function DatePicker({
|
|
1540
|
+
value,
|
|
1541
|
+
onChange,
|
|
1542
|
+
placeholder = "Pick a date",
|
|
1543
|
+
showTimePicker = false,
|
|
1544
|
+
disabled = false,
|
|
1545
|
+
className,
|
|
1546
|
+
calendarProps
|
|
1547
|
+
}) {
|
|
1548
|
+
const [open, setOpen] = React6.useState(false);
|
|
1549
|
+
function handleDaySelect(day) {
|
|
1550
|
+
if (!day) {
|
|
1551
|
+
onChange == null ? void 0 : onChange(void 0);
|
|
1552
|
+
return;
|
|
1553
|
+
}
|
|
1554
|
+
if (showTimePicker && value) {
|
|
1555
|
+
day.setHours(value.getHours(), value.getMinutes());
|
|
1556
|
+
}
|
|
1557
|
+
onChange == null ? void 0 : onChange(day);
|
|
1558
|
+
if (!showTimePicker) setOpen(false);
|
|
1559
|
+
}
|
|
1560
|
+
function handleTimeChange(e) {
|
|
1561
|
+
const [hours, minutes] = e.target.value.split(":").map(Number);
|
|
1562
|
+
const next = value ? new Date(value) : /* @__PURE__ */ new Date();
|
|
1563
|
+
next.setHours(hours, minutes, 0, 0);
|
|
1564
|
+
onChange == null ? void 0 : onChange(next);
|
|
1565
|
+
}
|
|
1566
|
+
const timeValue = value ? `${String(value.getHours()).padStart(2, "0")}:${String(value.getMinutes()).padStart(2, "0")}` : "";
|
|
1567
|
+
let displayValue;
|
|
1568
|
+
if (value && showTimePicker) {
|
|
1569
|
+
displayValue = (0, import_date_fns.format)(value, "dd/MM/yyyy HH:mm");
|
|
1570
|
+
} else if (value) {
|
|
1571
|
+
displayValue = (0, import_date_fns.format)(value, "dd/MM/yyyy");
|
|
1572
|
+
}
|
|
1573
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Popover, { onOpenChange: disabled ? void 0 : setOpen, open, children: [
|
|
1574
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
1575
|
+
PopoverTrigger,
|
|
1576
|
+
{
|
|
1577
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1578
|
+
Button,
|
|
1579
|
+
{
|
|
1580
|
+
className: cn(
|
|
1581
|
+
"w-full justify-start rounded-none font-normal data-[empty=true]:text-muted-foreground",
|
|
1582
|
+
className
|
|
1583
|
+
),
|
|
1584
|
+
"data-empty": !value,
|
|
1585
|
+
"data-slot": "date-picker-trigger",
|
|
1586
|
+
disabled,
|
|
1587
|
+
variant: "outline"
|
|
1588
|
+
}
|
|
1589
|
+
),
|
|
1590
|
+
children: [
|
|
1591
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react9.CalendarIcon, {}),
|
|
1592
|
+
value ? displayValue : placeholder
|
|
1593
|
+
]
|
|
1594
|
+
}
|
|
1595
|
+
),
|
|
1596
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
1597
|
+
PopoverContent,
|
|
1598
|
+
{
|
|
1599
|
+
align: "start",
|
|
1600
|
+
className: "w-auto rounded-none p-0 shadow-sm",
|
|
1601
|
+
children: [
|
|
1602
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1603
|
+
Calendar,
|
|
1604
|
+
__spreadProps(__spreadValues({
|
|
1605
|
+
captionLayout: "dropdown",
|
|
1606
|
+
mode: "single",
|
|
1607
|
+
onSelect: handleDaySelect,
|
|
1608
|
+
selected: value
|
|
1609
|
+
}, calendarProps), {
|
|
1610
|
+
className: cn(
|
|
1611
|
+
"rounded-none border-0 shadow-none",
|
|
1612
|
+
calendarProps == null ? void 0 : calendarProps.className
|
|
1613
|
+
)
|
|
1614
|
+
})
|
|
1615
|
+
),
|
|
1616
|
+
showTimePicker ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "border-t border-border px-3 pb-3 pt-2", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("label", { className: "mb-1.5 block text-xs font-medium text-muted-foreground", children: [
|
|
1617
|
+
"Time",
|
|
1618
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1619
|
+
"input",
|
|
1620
|
+
{
|
|
1621
|
+
className: "mt-1.5 h-8 w-full rounded-none border border-input bg-transparent px-2 text-sm font-sans outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50",
|
|
1622
|
+
onChange: handleTimeChange,
|
|
1623
|
+
type: "time",
|
|
1624
|
+
value: timeValue
|
|
1625
|
+
}
|
|
1626
|
+
)
|
|
1627
|
+
] }) }) : null
|
|
1628
|
+
]
|
|
1629
|
+
}
|
|
1630
|
+
)
|
|
1631
|
+
] });
|
|
1632
|
+
}
|
|
1633
|
+
|
|
1634
|
+
// src/components/ui/slider.tsx
|
|
1635
|
+
var React7 = __toESM(require("react"));
|
|
1636
|
+
var import_slider = require("@base-ui/react/slider");
|
|
1637
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1638
|
+
var Slider = React7.forwardRef(
|
|
1639
|
+
({
|
|
1640
|
+
className,
|
|
1641
|
+
value,
|
|
1642
|
+
defaultValue = 0,
|
|
1643
|
+
min = 0,
|
|
1644
|
+
max = 100,
|
|
1645
|
+
step = 1,
|
|
1646
|
+
disabled = false,
|
|
1647
|
+
onValueChange
|
|
1648
|
+
}, ref) => {
|
|
1649
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1650
|
+
import_slider.Slider.Root,
|
|
1651
|
+
{
|
|
1652
|
+
ref,
|
|
1653
|
+
value,
|
|
1654
|
+
defaultValue,
|
|
1655
|
+
min,
|
|
1656
|
+
max,
|
|
1657
|
+
step,
|
|
1658
|
+
disabled,
|
|
1659
|
+
thumbAlignment: "edge",
|
|
1660
|
+
onValueChange: (val) => onValueChange == null ? void 0 : onValueChange(val),
|
|
1661
|
+
"data-slot": "slider",
|
|
1662
|
+
className: cn(
|
|
1663
|
+
"relative w-full touch-none select-none",
|
|
1664
|
+
disabled && "opacity-50",
|
|
1665
|
+
className
|
|
1666
|
+
),
|
|
1667
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
1668
|
+
import_slider.Slider.Control,
|
|
1669
|
+
{
|
|
1670
|
+
className: "relative flex h-5 w-full cursor-pointer items-center",
|
|
1671
|
+
"data-slot": "slider-control",
|
|
1672
|
+
children: [
|
|
1673
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1674
|
+
import_slider.Slider.Track,
|
|
1675
|
+
{
|
|
1676
|
+
className: "relative h-2 w-full overflow-hidden rounded-full bg-muted",
|
|
1677
|
+
"data-slot": "slider-track",
|
|
1678
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1679
|
+
import_slider.Slider.Indicator,
|
|
1680
|
+
{
|
|
1681
|
+
className: "absolute h-full rounded-full bg-primary",
|
|
1682
|
+
"data-slot": "slider-indicator"
|
|
1683
|
+
}
|
|
1684
|
+
)
|
|
1685
|
+
}
|
|
1686
|
+
),
|
|
1687
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1688
|
+
import_slider.Slider.Thumb,
|
|
1689
|
+
{
|
|
1690
|
+
className: cn(
|
|
1691
|
+
"block size-5 rounded-full border-2 border-primary bg-background shadow-sm",
|
|
1692
|
+
"outline-none"
|
|
1693
|
+
),
|
|
1694
|
+
"data-slot": "slider-thumb"
|
|
1695
|
+
}
|
|
1696
|
+
)
|
|
1697
|
+
]
|
|
1698
|
+
}
|
|
1699
|
+
)
|
|
1700
|
+
}
|
|
1701
|
+
);
|
|
1702
|
+
}
|
|
1703
|
+
);
|
|
1704
|
+
Slider.displayName = "Slider";
|
|
1705
|
+
|
|
1706
|
+
// src/components/ui/form-primitives.tsx
|
|
1707
|
+
var React9 = __toESM(require("react"));
|
|
1708
|
+
var import_lucide_react10 = require("lucide-react");
|
|
1709
|
+
|
|
1710
|
+
// src/components/ui/toggle-group.tsx
|
|
1711
|
+
var React8 = __toESM(require("react"));
|
|
1712
|
+
var import_toggle_group = require("@base-ui/react/toggle-group");
|
|
1713
|
+
var import_toggle2 = require("@base-ui/react/toggle");
|
|
1714
|
+
|
|
1715
|
+
// src/components/ui/toggle.tsx
|
|
1716
|
+
var import_class_variance_authority4 = require("class-variance-authority");
|
|
1717
|
+
var import_toggle = require("@base-ui/react/toggle");
|
|
1718
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1719
|
+
var toggleVariants = (0, import_class_variance_authority4.cva)(
|
|
1720
|
+
"inline-flex items-center justify-center gap-2 text-label-medium whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-pressed:bg-primary/10 data-pressed:inset-ring data-pressed:inset-ring-primary data-pressed:text-foreground data-pressed:hover:bg-primary/10 data-pressed:hover:text-foreground dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
1721
|
+
{
|
|
1722
|
+
variants: {
|
|
1723
|
+
variant: {
|
|
1724
|
+
default: "bg-transparent hover:bg-muted hover:text-muted-foreground",
|
|
1725
|
+
outline: "border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"
|
|
1726
|
+
},
|
|
1727
|
+
size: {
|
|
1728
|
+
default: "h-9 min-w-9 px-2",
|
|
1729
|
+
sm: "h-8 min-w-8 px-1.5 text-caption",
|
|
1730
|
+
lg: "h-10 min-w-10 px-2.5"
|
|
1731
|
+
}
|
|
1732
|
+
},
|
|
1733
|
+
defaultVariants: {
|
|
1734
|
+
variant: "default",
|
|
1735
|
+
size: "default"
|
|
1736
|
+
}
|
|
1737
|
+
}
|
|
1738
|
+
);
|
|
1739
|
+
|
|
1740
|
+
// src/components/ui/toggle-group.tsx
|
|
1741
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1742
|
+
var ToggleGroupContext = React8.createContext({
|
|
1743
|
+
size: "default",
|
|
1744
|
+
variant: "default",
|
|
1745
|
+
spacing: 0
|
|
1746
|
+
});
|
|
1747
|
+
function ToggleGroup(_a) {
|
|
1748
|
+
var _b = _a, {
|
|
1749
|
+
className,
|
|
1750
|
+
variant,
|
|
1751
|
+
size,
|
|
1752
|
+
spacing = 0,
|
|
1753
|
+
type,
|
|
1754
|
+
children
|
|
1755
|
+
} = _b, props = __objRest(_b, [
|
|
1756
|
+
"className",
|
|
1757
|
+
"variant",
|
|
1758
|
+
"size",
|
|
1759
|
+
"spacing",
|
|
1760
|
+
"type",
|
|
1761
|
+
"children"
|
|
1762
|
+
]);
|
|
1763
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1764
|
+
import_toggle_group.ToggleGroup,
|
|
1765
|
+
__spreadProps(__spreadValues({
|
|
1766
|
+
className: cn(
|
|
1767
|
+
// WealthX: removed rounded-md (sharp corners) and shadow-xs (flat panels)
|
|
1768
|
+
"group/toggle-group flex w-fit items-center gap-[--spacing(var(--gap))]",
|
|
1769
|
+
className
|
|
1770
|
+
),
|
|
1771
|
+
"data-size": size,
|
|
1772
|
+
"data-slot": "toggle-group",
|
|
1773
|
+
"data-spacing": spacing,
|
|
1774
|
+
"data-variant": variant,
|
|
1775
|
+
multiple: type === "multiple",
|
|
1776
|
+
style: { "--gap": spacing }
|
|
1777
|
+
}, props), {
|
|
1778
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ToggleGroupContext.Provider, { value: { variant, size, spacing }, children })
|
|
1779
|
+
})
|
|
1780
|
+
);
|
|
1781
|
+
}
|
|
1782
|
+
function ToggleGroupItem(_a) {
|
|
1783
|
+
var _b = _a, {
|
|
1784
|
+
className,
|
|
1785
|
+
children,
|
|
1786
|
+
variant,
|
|
1787
|
+
size
|
|
1788
|
+
} = _b, props = __objRest(_b, [
|
|
1789
|
+
"className",
|
|
1790
|
+
"children",
|
|
1791
|
+
"variant",
|
|
1792
|
+
"size"
|
|
1793
|
+
]);
|
|
1794
|
+
const context = React8.useContext(ToggleGroupContext);
|
|
1795
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1796
|
+
import_toggle2.Toggle,
|
|
1797
|
+
__spreadProps(__spreadValues({
|
|
1798
|
+
className: cn(
|
|
1799
|
+
toggleVariants({
|
|
1800
|
+
variant: context.variant || variant,
|
|
1801
|
+
size: context.size || size
|
|
1802
|
+
}),
|
|
1803
|
+
"w-auto min-w-0 shrink-0 focus:z-10 focus-visible:z-10",
|
|
1804
|
+
// WealthX: no rounded corners on grouped items
|
|
1805
|
+
"data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l",
|
|
1806
|
+
className
|
|
1807
|
+
),
|
|
1808
|
+
"data-size": context.size || size,
|
|
1809
|
+
"data-slot": "toggle-group-item",
|
|
1810
|
+
"data-spacing": context.spacing,
|
|
1811
|
+
"data-variant": context.variant || variant
|
|
1812
|
+
}, props), {
|
|
1813
|
+
children
|
|
1814
|
+
})
|
|
1815
|
+
);
|
|
1816
|
+
}
|
|
1817
|
+
|
|
1818
|
+
// src/components/ui/form-primitives.tsx
|
|
1819
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1820
|
+
function parseCurrencyToNumber(raw) {
|
|
1821
|
+
const cleaned = raw.replace(/[^0-9.]/g, "");
|
|
1822
|
+
const n = parseFloat(cleaned);
|
|
1823
|
+
return isNaN(n) ? 0 : n;
|
|
1824
|
+
}
|
|
1825
|
+
function formatNumberToCurrency(n) {
|
|
1826
|
+
return "$" + Math.round(n).toLocaleString("en-AU");
|
|
1827
|
+
}
|
|
1828
|
+
function CurrencyInputWithSlider({
|
|
1829
|
+
value: controlledValue,
|
|
1830
|
+
defaultValue = 0,
|
|
1831
|
+
min = 0,
|
|
1832
|
+
max = 5e6,
|
|
1833
|
+
step = 1e4,
|
|
1834
|
+
disabled = false,
|
|
1835
|
+
onValueChange,
|
|
1836
|
+
className
|
|
1837
|
+
}) {
|
|
1838
|
+
const [internalValue, setInternalValue] = React9.useState(defaultValue);
|
|
1839
|
+
const numericValue = controlledValue !== void 0 ? controlledValue : internalValue;
|
|
1840
|
+
const [inputText, setInputText] = React9.useState(
|
|
1841
|
+
formatNumberToCurrency(numericValue)
|
|
1842
|
+
);
|
|
1843
|
+
const [isFocused, setIsFocused] = React9.useState(false);
|
|
1844
|
+
React9.useEffect(() => {
|
|
1845
|
+
if (!isFocused) {
|
|
1846
|
+
setInputText(formatNumberToCurrency(numericValue));
|
|
1847
|
+
}
|
|
1848
|
+
}, [numericValue, isFocused]);
|
|
1849
|
+
const commitValue = (n) => {
|
|
1850
|
+
const clamped = Math.max(min, Math.min(max, n));
|
|
1851
|
+
if (controlledValue === void 0) setInternalValue(clamped);
|
|
1852
|
+
onValueChange == null ? void 0 : onValueChange(clamped);
|
|
1853
|
+
setInputText(formatNumberToCurrency(clamped));
|
|
1854
|
+
};
|
|
1855
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: cn("flex flex-col gap-3", className), children: [
|
|
1856
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1857
|
+
Input,
|
|
1858
|
+
{
|
|
1859
|
+
type: "text",
|
|
1860
|
+
value: isFocused ? inputText : formatNumberToCurrency(numericValue),
|
|
1861
|
+
disabled,
|
|
1862
|
+
onFocus: () => {
|
|
1863
|
+
setIsFocused(true);
|
|
1864
|
+
setInputText(formatNumberToCurrency(numericValue));
|
|
1865
|
+
},
|
|
1866
|
+
onChange: (e) => setInputText(e.target.value),
|
|
1867
|
+
onBlur: () => {
|
|
1868
|
+
setIsFocused(false);
|
|
1869
|
+
commitValue(parseCurrencyToNumber(inputText));
|
|
1870
|
+
},
|
|
1871
|
+
onKeyDown: (e) => {
|
|
1872
|
+
if (e.key === "Enter") {
|
|
1873
|
+
e.target.blur();
|
|
1874
|
+
}
|
|
1875
|
+
},
|
|
1876
|
+
className: "tabular-nums",
|
|
1877
|
+
"aria-label": "Currency amount"
|
|
1878
|
+
}
|
|
1879
|
+
),
|
|
1880
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1881
|
+
Slider,
|
|
1882
|
+
{
|
|
1883
|
+
value: numericValue,
|
|
1884
|
+
min,
|
|
1885
|
+
max,
|
|
1886
|
+
step,
|
|
1887
|
+
disabled,
|
|
1888
|
+
onValueChange: (n) => {
|
|
1889
|
+
if (controlledValue === void 0) setInternalValue(n);
|
|
1890
|
+
onValueChange == null ? void 0 : onValueChange(n);
|
|
1891
|
+
}
|
|
1892
|
+
}
|
|
1893
|
+
)
|
|
1894
|
+
] });
|
|
1895
|
+
}
|
|
1896
|
+
var DEFAULT_SUGGESTIONS = [
|
|
1897
|
+
{
|
|
1898
|
+
id: "1",
|
|
1899
|
+
label: "12 Harbour View Terrace, Mosman NSW 2088",
|
|
1900
|
+
suburb: "Mosman",
|
|
1901
|
+
state: "NSW",
|
|
1902
|
+
postcode: "2088"
|
|
1903
|
+
},
|
|
1904
|
+
{
|
|
1905
|
+
id: "2",
|
|
1906
|
+
label: "5 Coastal Road, Manly NSW 2095",
|
|
1907
|
+
suburb: "Manly",
|
|
1908
|
+
state: "NSW",
|
|
1909
|
+
postcode: "2095"
|
|
1910
|
+
},
|
|
1911
|
+
{
|
|
1912
|
+
id: "3",
|
|
1913
|
+
label: "24 Collins Street, Melbourne VIC 3000",
|
|
1914
|
+
suburb: "Melbourne",
|
|
1915
|
+
state: "VIC",
|
|
1916
|
+
postcode: "3000"
|
|
1917
|
+
},
|
|
1918
|
+
{
|
|
1919
|
+
id: "4",
|
|
1920
|
+
label: "88 Pacific Highway, St Leonards NSW 2065",
|
|
1921
|
+
suburb: "St Leonards",
|
|
1922
|
+
state: "NSW",
|
|
1923
|
+
postcode: "2065"
|
|
1924
|
+
},
|
|
1925
|
+
{
|
|
1926
|
+
id: "5",
|
|
1927
|
+
label: "1 Queen Street, Brisbane QLD 4000",
|
|
1928
|
+
suburb: "Brisbane",
|
|
1929
|
+
state: "QLD",
|
|
1930
|
+
postcode: "4000"
|
|
1931
|
+
}
|
|
1932
|
+
];
|
|
1933
|
+
function AddressAutocomplete({
|
|
1934
|
+
value: controlledValue,
|
|
1935
|
+
placeholder = "Start typing an address\u2026",
|
|
1936
|
+
suggestions = DEFAULT_SUGGESTIONS,
|
|
1937
|
+
disabled = false,
|
|
1938
|
+
onValueChange,
|
|
1939
|
+
onSelect,
|
|
1940
|
+
className
|
|
1941
|
+
}) {
|
|
1942
|
+
const [internalValue, setInternalValue] = React9.useState("");
|
|
1943
|
+
const inputValue = controlledValue !== void 0 ? controlledValue : internalValue;
|
|
1944
|
+
const [open, setOpen] = React9.useState(false);
|
|
1945
|
+
const [activeIndex, setActiveIndex] = React9.useState(-1);
|
|
1946
|
+
const containerRef = React9.useRef(null);
|
|
1947
|
+
const listRef = React9.useRef(null);
|
|
1948
|
+
const filtered = React9.useMemo(() => {
|
|
1949
|
+
if (!inputValue.trim()) return suggestions.slice(0, 5);
|
|
1950
|
+
const q = inputValue.toLowerCase();
|
|
1951
|
+
return suggestions.filter((s) => s.label.toLowerCase().includes(q)).slice(0, 5);
|
|
1952
|
+
}, [inputValue, suggestions]);
|
|
1953
|
+
const setValue = (v) => {
|
|
1954
|
+
if (controlledValue === void 0) setInternalValue(v);
|
|
1955
|
+
onValueChange == null ? void 0 : onValueChange(v);
|
|
1956
|
+
};
|
|
1957
|
+
const handleSelect = (opt) => {
|
|
1958
|
+
setValue(opt.label);
|
|
1959
|
+
onSelect == null ? void 0 : onSelect(opt);
|
|
1960
|
+
setOpen(false);
|
|
1961
|
+
setActiveIndex(-1);
|
|
1962
|
+
};
|
|
1963
|
+
const handleKeyDown = (e) => {
|
|
1964
|
+
if (!open) return;
|
|
1965
|
+
if (e.key === "ArrowDown") {
|
|
1966
|
+
e.preventDefault();
|
|
1967
|
+
setActiveIndex((i) => Math.min(i + 1, filtered.length - 1));
|
|
1968
|
+
} else if (e.key === "ArrowUp") {
|
|
1969
|
+
e.preventDefault();
|
|
1970
|
+
setActiveIndex((i) => Math.max(i - 1, -1));
|
|
1971
|
+
} else if (e.key === "Enter" && activeIndex >= 0) {
|
|
1972
|
+
e.preventDefault();
|
|
1973
|
+
handleSelect(filtered[activeIndex]);
|
|
1974
|
+
} else if (e.key === "Escape") {
|
|
1975
|
+
setOpen(false);
|
|
1976
|
+
}
|
|
1977
|
+
};
|
|
1978
|
+
React9.useEffect(() => {
|
|
1979
|
+
const handler = (e) => {
|
|
1980
|
+
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
1981
|
+
setOpen(false);
|
|
1982
|
+
}
|
|
1983
|
+
};
|
|
1984
|
+
document.addEventListener("mousedown", handler);
|
|
1985
|
+
return () => document.removeEventListener("mousedown", handler);
|
|
1986
|
+
}, []);
|
|
1987
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { ref: containerRef, className: cn("relative", className), children: [
|
|
1988
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "relative", children: [
|
|
1989
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Search, { className: "absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground pointer-events-none" }),
|
|
1990
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1991
|
+
Input,
|
|
1992
|
+
{
|
|
1993
|
+
type: "text",
|
|
1994
|
+
value: inputValue,
|
|
1995
|
+
placeholder,
|
|
1996
|
+
disabled,
|
|
1997
|
+
className: "pl-8",
|
|
1998
|
+
onChange: (e) => {
|
|
1999
|
+
setValue(e.target.value);
|
|
2000
|
+
setOpen(true);
|
|
2001
|
+
setActiveIndex(-1);
|
|
2002
|
+
},
|
|
2003
|
+
onFocus: () => setOpen(true),
|
|
2004
|
+
onKeyDown: handleKeyDown,
|
|
2005
|
+
"aria-autocomplete": "list",
|
|
2006
|
+
"aria-expanded": open
|
|
2007
|
+
}
|
|
2008
|
+
)
|
|
2009
|
+
] }),
|
|
2010
|
+
open && filtered.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2011
|
+
"ul",
|
|
2012
|
+
{
|
|
2013
|
+
ref: listRef,
|
|
2014
|
+
role: "listbox",
|
|
2015
|
+
className: cn(
|
|
2016
|
+
"absolute z-50 top-full left-0 right-0 mt-1",
|
|
2017
|
+
"border border-border bg-popover shadow-md",
|
|
2018
|
+
"max-h-48 overflow-y-auto py-1"
|
|
2019
|
+
),
|
|
2020
|
+
children: filtered.map((opt, idx) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
2021
|
+
"li",
|
|
2022
|
+
{
|
|
2023
|
+
role: "option",
|
|
2024
|
+
"aria-selected": idx === activeIndex,
|
|
2025
|
+
onMouseEnter: () => setActiveIndex(idx),
|
|
2026
|
+
onMouseDown: (e) => {
|
|
2027
|
+
e.preventDefault();
|
|
2028
|
+
handleSelect(opt);
|
|
2029
|
+
},
|
|
2030
|
+
className: cn(
|
|
2031
|
+
"flex items-center gap-2 px-3 py-2 text-sm cursor-pointer",
|
|
2032
|
+
idx === activeIndex ? "bg-accent text-accent-foreground" : "hover:bg-accent/50"
|
|
2033
|
+
),
|
|
2034
|
+
children: [
|
|
2035
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "flex-1 truncate", children: opt.label }),
|
|
2036
|
+
idx === activeIndex && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Check, { className: "h-3.5 w-3.5 shrink-0 text-primary" })
|
|
2037
|
+
]
|
|
2038
|
+
},
|
|
2039
|
+
opt.id
|
|
2040
|
+
))
|
|
2041
|
+
}
|
|
2042
|
+
)
|
|
2043
|
+
] });
|
|
2044
|
+
}
|
|
2045
|
+
var DEFAULT_OWNERS = [
|
|
2046
|
+
{ id: "main", name: "Main Applicant", share: 50 },
|
|
2047
|
+
{ id: "co", name: "Co-Applicant", share: 50 }
|
|
2048
|
+
];
|
|
2049
|
+
function OwnershipSplit({
|
|
2050
|
+
owners: controlledOwners,
|
|
2051
|
+
disabled = false,
|
|
2052
|
+
onOwnersChange,
|
|
2053
|
+
className
|
|
2054
|
+
}) {
|
|
2055
|
+
const [internalOwners, setInternalOwners] = React9.useState(DEFAULT_OWNERS);
|
|
2056
|
+
const owners = controlledOwners !== void 0 ? controlledOwners : internalOwners;
|
|
2057
|
+
const setOwners = (updated) => {
|
|
2058
|
+
if (controlledOwners === void 0) setInternalOwners(updated);
|
|
2059
|
+
onOwnersChange == null ? void 0 : onOwnersChange(updated);
|
|
2060
|
+
};
|
|
2061
|
+
const handleSliderChange = (id, newShare) => {
|
|
2062
|
+
if (owners.length !== 2) return;
|
|
2063
|
+
const clamped = Math.max(0, Math.min(100, Math.round(newShare)));
|
|
2064
|
+
const other = owners.find((o) => o.id !== id);
|
|
2065
|
+
if (!other) return;
|
|
2066
|
+
setOwners(
|
|
2067
|
+
owners.map(
|
|
2068
|
+
(o) => o.id === id ? __spreadProps(__spreadValues({}, o), { share: clamped }) : __spreadProps(__spreadValues({}, o), { share: 100 - clamped })
|
|
2069
|
+
)
|
|
2070
|
+
);
|
|
2071
|
+
};
|
|
2072
|
+
const handleInputChange = (id, raw) => {
|
|
2073
|
+
const n = parseInt(raw.replace(/[^0-9]/g, ""), 10);
|
|
2074
|
+
if (isNaN(n)) return;
|
|
2075
|
+
handleSliderChange(id, n);
|
|
2076
|
+
};
|
|
2077
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: cn("flex gap-4", className), children: owners.map((owner) => {
|
|
2078
|
+
const pct = Math.max(0, Math.min(100, owner.share));
|
|
2079
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex flex-col gap-2 flex-1", children: [
|
|
2080
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
2081
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Label, { className: "text-xs font-medium", children: owner.name }),
|
|
2082
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2083
|
+
Input,
|
|
2084
|
+
{
|
|
2085
|
+
type: "text",
|
|
2086
|
+
value: `${pct}%`,
|
|
2087
|
+
disabled,
|
|
2088
|
+
className: "w-14 h-7 text-xs text-right tabular-nums px-2",
|
|
2089
|
+
onChange: (e) => handleInputChange(owner.id, e.target.value),
|
|
2090
|
+
onBlur: (e) => handleInputChange(owner.id, e.target.value)
|
|
2091
|
+
}
|
|
2092
|
+
)
|
|
2093
|
+
] }),
|
|
2094
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2095
|
+
Slider,
|
|
2096
|
+
{
|
|
2097
|
+
value: pct,
|
|
2098
|
+
min: 0,
|
|
2099
|
+
max: 100,
|
|
2100
|
+
step: 1,
|
|
2101
|
+
disabled,
|
|
2102
|
+
onValueChange: (n) => handleSliderChange(owner.id, n)
|
|
2103
|
+
}
|
|
2104
|
+
)
|
|
2105
|
+
] }, owner.id);
|
|
2106
|
+
}) });
|
|
2107
|
+
}
|
|
2108
|
+
|
|
2109
|
+
// src/components/ui/opportunity-edit-modals.tsx
|
|
2110
|
+
var import_accordion4 = require("@base-ui/react/accordion");
|
|
2111
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2112
|
+
var LOAN_PURPOSES = [
|
|
2113
|
+
"Purchase a home",
|
|
2114
|
+
"Refinance my home loan",
|
|
2115
|
+
"Buy an investment property",
|
|
2116
|
+
"Refinance investment loan",
|
|
2117
|
+
"Renovate/build",
|
|
2118
|
+
"Equity release"
|
|
2119
|
+
];
|
|
2120
|
+
var ASSET_TYPES = [
|
|
2121
|
+
"Primary Residence",
|
|
2122
|
+
"Investment Property",
|
|
2123
|
+
"Holiday Home",
|
|
2124
|
+
"Commercial Property",
|
|
2125
|
+
"Rural Property",
|
|
2126
|
+
"Cash & Savings",
|
|
2127
|
+
"Term Deposit",
|
|
2128
|
+
"Shares / ETFs",
|
|
2129
|
+
"Managed Funds",
|
|
2130
|
+
"Superannuation",
|
|
2131
|
+
"Motor Vehicle",
|
|
2132
|
+
"Business Equity",
|
|
2133
|
+
"Cryptocurrency",
|
|
2134
|
+
"Personal Belongings",
|
|
2135
|
+
"Life Insurance",
|
|
2136
|
+
"Trust Assets",
|
|
2137
|
+
"SMSF",
|
|
2138
|
+
"Bonds / Fixed Income",
|
|
2139
|
+
"Other"
|
|
2140
|
+
];
|
|
2141
|
+
var PROPERTY_ASSET_TYPES = /* @__PURE__ */ new Set([
|
|
2142
|
+
"Primary Residence",
|
|
2143
|
+
"Investment Property",
|
|
2144
|
+
"Holiday Home",
|
|
2145
|
+
"Commercial Property",
|
|
2146
|
+
"Rural Property"
|
|
2147
|
+
]);
|
|
2148
|
+
var PROPERTY_SUBTYPES = [
|
|
2149
|
+
"House",
|
|
2150
|
+
"Unit / Apartment",
|
|
2151
|
+
"Townhouse",
|
|
2152
|
+
"Land",
|
|
2153
|
+
"Rural / Farm",
|
|
2154
|
+
"Commercial"
|
|
2155
|
+
];
|
|
2156
|
+
var PROPERTY_USED_AS = ["Owner Occupied", "Investment", "Vacant Land"];
|
|
2157
|
+
var FINANCIAL_ACCOUNT_ASSET_TYPES = /* @__PURE__ */ new Set([
|
|
2158
|
+
"Cash & Savings",
|
|
2159
|
+
"Term Deposit"
|
|
2160
|
+
]);
|
|
2161
|
+
var INVESTMENT_ASSET_TYPES = /* @__PURE__ */ new Set([
|
|
2162
|
+
"Shares / ETFs",
|
|
2163
|
+
"Managed Funds",
|
|
2164
|
+
"Bonds / Fixed Income",
|
|
2165
|
+
"Cryptocurrency"
|
|
2166
|
+
]);
|
|
2167
|
+
var SUPER_ASSET_TYPES = /* @__PURE__ */ new Set(["Superannuation", "SMSF"]);
|
|
2168
|
+
function assetFields(type) {
|
|
2169
|
+
return {
|
|
2170
|
+
isProperty: PROPERTY_ASSET_TYPES.has(type),
|
|
2171
|
+
isVehicle: type === "Motor Vehicle",
|
|
2172
|
+
isFinancialAccount: FINANCIAL_ACCOUNT_ASSET_TYPES.has(type),
|
|
2173
|
+
isInvestment: INVESTMENT_ASSET_TYPES.has(type),
|
|
2174
|
+
isSuper: SUPER_ASSET_TYPES.has(type),
|
|
2175
|
+
isBusiness: type === "Business Equity",
|
|
2176
|
+
isInsurance: type === "Life Insurance"
|
|
2177
|
+
};
|
|
2178
|
+
}
|
|
2179
|
+
var PROPERTY_LOAN_DEBT_TYPES = /* @__PURE__ */ new Set([
|
|
2180
|
+
"Home Loan (Owner Occupied)",
|
|
2181
|
+
"Home Loan (Investment)",
|
|
2182
|
+
"Construction Loan"
|
|
2183
|
+
]);
|
|
2184
|
+
var GENERAL_LOAN_DEBT_TYPES = /* @__PURE__ */ new Set([
|
|
2185
|
+
"Personal Loan",
|
|
2186
|
+
"Business Loan",
|
|
2187
|
+
"Overdraft",
|
|
2188
|
+
"Line of Credit",
|
|
2189
|
+
"Guarantor Liability"
|
|
2190
|
+
]);
|
|
2191
|
+
var CARD_DEBT_TYPES = /* @__PURE__ */ new Set([
|
|
2192
|
+
"Credit Card",
|
|
2193
|
+
"Store Card",
|
|
2194
|
+
"Buy Now Pay Later"
|
|
2195
|
+
]);
|
|
2196
|
+
var VEHICLE_DEBT_TYPES = /* @__PURE__ */ new Set(["Car Loan", "Vehicle Lease"]);
|
|
2197
|
+
function debtFields(type) {
|
|
2198
|
+
return {
|
|
2199
|
+
isPropertyLoan: PROPERTY_LOAN_DEBT_TYPES.has(type),
|
|
2200
|
+
isGeneralLoan: GENERAL_LOAN_DEBT_TYPES.has(type),
|
|
2201
|
+
isCard: CARD_DEBT_TYPES.has(type),
|
|
2202
|
+
isVehicle: VEHICLE_DEBT_TYPES.has(type),
|
|
2203
|
+
isHecs: type === "HECS / Student Debt",
|
|
2204
|
+
isTax: type === "Tax Debt",
|
|
2205
|
+
isGuarantor: type === "Guarantor Liability"
|
|
2206
|
+
};
|
|
2207
|
+
}
|
|
2208
|
+
var DEBT_TYPES = [
|
|
2209
|
+
"Home Loan (Owner Occupied)",
|
|
2210
|
+
"Home Loan (Investment)",
|
|
2211
|
+
"Construction Loan",
|
|
2212
|
+
"Personal Loan",
|
|
2213
|
+
"Car Loan",
|
|
2214
|
+
"Credit Card",
|
|
2215
|
+
"Store Card",
|
|
2216
|
+
"HECS / Student Debt",
|
|
2217
|
+
"Business Loan",
|
|
2218
|
+
"Overdraft",
|
|
2219
|
+
"Tax Debt",
|
|
2220
|
+
"Buy Now Pay Later",
|
|
2221
|
+
"Vehicle Lease",
|
|
2222
|
+
"Guarantor Liability",
|
|
2223
|
+
"Line of Credit",
|
|
2224
|
+
"Other"
|
|
2225
|
+
];
|
|
2226
|
+
var TITLE_OPTIONS = ["Mr", "Mrs", "Ms", "Dr", "Prof"];
|
|
2227
|
+
var GENDER_OPTIONS = ["Male", "Female", "Non-binary", "Prefer not to say"];
|
|
2228
|
+
var MARITAL_OPTIONS = [
|
|
2229
|
+
"Single",
|
|
2230
|
+
"Married",
|
|
2231
|
+
"De facto",
|
|
2232
|
+
"Divorced",
|
|
2233
|
+
"Widowed"
|
|
2234
|
+
];
|
|
2235
|
+
var CITIZEN_OPTIONS = [
|
|
2236
|
+
"Australian Citizen",
|
|
2237
|
+
"Permanent Resident",
|
|
2238
|
+
"Temporary Resident",
|
|
2239
|
+
"Foreign National"
|
|
2240
|
+
];
|
|
2241
|
+
var RESIDENTIAL_STATUS_OPTIONS = [
|
|
2242
|
+
"Own",
|
|
2243
|
+
"Renting",
|
|
2244
|
+
"Boarding",
|
|
2245
|
+
"With Parents",
|
|
2246
|
+
"Other"
|
|
2247
|
+
];
|
|
2248
|
+
var PROPERTY_IN_TRUST_OPTIONS = ["None", "Yes - Discretionary", "Yes - Unit"];
|
|
2249
|
+
var COMPANY_OWNERSHIP_OPTIONS = [
|
|
2250
|
+
"None",
|
|
2251
|
+
"Yes - Director",
|
|
2252
|
+
"Yes - Shareholder"
|
|
2253
|
+
];
|
|
2254
|
+
var INCOME_TYPES = [
|
|
2255
|
+
"PAYG",
|
|
2256
|
+
"Self-employed",
|
|
2257
|
+
"Contractor",
|
|
2258
|
+
"Casual",
|
|
2259
|
+
"Commission",
|
|
2260
|
+
"Government Benefits",
|
|
2261
|
+
"Rental",
|
|
2262
|
+
"Other"
|
|
2263
|
+
];
|
|
2264
|
+
var EXPENSE_TYPES = [
|
|
2265
|
+
"Groceries",
|
|
2266
|
+
"Dining Out",
|
|
2267
|
+
"Transport",
|
|
2268
|
+
"Fuel",
|
|
2269
|
+
"Utilities",
|
|
2270
|
+
"Phone Plan",
|
|
2271
|
+
"Internet",
|
|
2272
|
+
"Medical",
|
|
2273
|
+
"Entertainment",
|
|
2274
|
+
"Clothing",
|
|
2275
|
+
"Gym & Fitness",
|
|
2276
|
+
"Subscriptions",
|
|
2277
|
+
"Childcare",
|
|
2278
|
+
"Education",
|
|
2279
|
+
"Pet Care",
|
|
2280
|
+
"Insurance",
|
|
2281
|
+
"Council Rates",
|
|
2282
|
+
"Body Corp / Strata",
|
|
2283
|
+
"Home Maintenance",
|
|
2284
|
+
"Travel & Holidays",
|
|
2285
|
+
"Donations",
|
|
2286
|
+
"Other"
|
|
2287
|
+
];
|
|
2288
|
+
var PRIORITIES = [
|
|
2289
|
+
"Maximize Borrow Amount",
|
|
2290
|
+
"Cheapest Interest Rate",
|
|
2291
|
+
"The Best Features",
|
|
2292
|
+
"Major Lender",
|
|
2293
|
+
"Small Lender",
|
|
2294
|
+
"Regional Lender",
|
|
2295
|
+
"Non-Bank Lender",
|
|
2296
|
+
"Branch Network",
|
|
2297
|
+
"Good Customer Service",
|
|
2298
|
+
"Environmentally Friendly Lender"
|
|
2299
|
+
];
|
|
2300
|
+
function FormField({
|
|
2301
|
+
label,
|
|
2302
|
+
children,
|
|
2303
|
+
className
|
|
2304
|
+
}) {
|
|
2305
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: cn("flex flex-col gap-1.5", className), children: [
|
|
2306
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Label, { className: "text-sm font-medium text-muted-foreground", children: label }),
|
|
2307
|
+
children
|
|
2308
|
+
] });
|
|
2309
|
+
}
|
|
2310
|
+
function ModalScroll({ children }) {
|
|
2311
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "max-h-[65vh] overflow-y-auto flex flex-col gap-4 py-1 pr-1", children });
|
|
2312
|
+
}
|
|
2313
|
+
function FrequencyToggle({
|
|
2314
|
+
value,
|
|
2315
|
+
onValueChange
|
|
2316
|
+
}) {
|
|
2317
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
2318
|
+
ToggleGroup,
|
|
2319
|
+
{
|
|
2320
|
+
variant: "outline",
|
|
2321
|
+
value,
|
|
2322
|
+
onValueChange: (val) => {
|
|
2323
|
+
if (val === "Monthly" || val === "Weekly") {
|
|
2324
|
+
onValueChange(val);
|
|
2325
|
+
}
|
|
2326
|
+
},
|
|
2327
|
+
children: [
|
|
2328
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ToggleGroupItem, { value: "Monthly", size: "sm", children: "Monthly" }),
|
|
2329
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ToggleGroupItem, { value: "Weekly", size: "sm", children: "Weekly" })
|
|
2330
|
+
]
|
|
2331
|
+
}
|
|
2332
|
+
);
|
|
2333
|
+
}
|
|
2334
|
+
function AccordionItemHeader({
|
|
2335
|
+
label,
|
|
2336
|
+
onRemove,
|
|
2337
|
+
removeLabel = "Remove item"
|
|
2338
|
+
}) {
|
|
2339
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_accordion4.Accordion.Header, { className: "flex items-center", children: [
|
|
2340
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
2341
|
+
import_accordion4.Accordion.Trigger,
|
|
2342
|
+
{
|
|
2343
|
+
className: cn(
|
|
2344
|
+
"flex flex-1 items-center justify-between gap-4 py-4 text-left",
|
|
2345
|
+
"text-label-medium rounded-none outline-none transition-[color,opacity]",
|
|
2346
|
+
"hover:underline focus-visible:ring-2 focus-visible:ring-foreground/30",
|
|
2347
|
+
"[&[data-panel-open]>svg]:rotate-180"
|
|
2348
|
+
),
|
|
2349
|
+
children: [
|
|
2350
|
+
label,
|
|
2351
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react11.ChevronDownIcon, { className: "pointer-events-none size-4 shrink-0 text-muted-foreground transition-transform duration-200" })
|
|
2352
|
+
]
|
|
2353
|
+
}
|
|
2354
|
+
),
|
|
2355
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2356
|
+
"button",
|
|
2357
|
+
{
|
|
2358
|
+
type: "button",
|
|
2359
|
+
onClick: onRemove,
|
|
2360
|
+
className: "p-2 hover:bg-foreground/5 transition-colors",
|
|
2361
|
+
"aria-label": removeLabel,
|
|
2362
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react11.Trash2, { className: "h-3.5 w-3.5 text-destructive" })
|
|
2363
|
+
}
|
|
2364
|
+
)
|
|
2365
|
+
] });
|
|
2366
|
+
}
|
|
2367
|
+
var LOAN_SCENARIO_DEFAULTS = {
|
|
2368
|
+
loanPurpose: "",
|
|
2369
|
+
propertyEstimate: 0,
|
|
2370
|
+
cashEquity: 0,
|
|
2371
|
+
loanAmount: 0,
|
|
2372
|
+
loanDuration: 30,
|
|
2373
|
+
knowsFeatures: "",
|
|
2374
|
+
featureFixedRate: false,
|
|
2375
|
+
featureVariableRate: false,
|
|
2376
|
+
featureSplitLoan: false,
|
|
2377
|
+
featureInterestOnly: false,
|
|
2378
|
+
featureRedrawFacility: false,
|
|
2379
|
+
feature100Offset: false,
|
|
2380
|
+
priorities: [],
|
|
2381
|
+
borrowOtherThanProperty: "",
|
|
2382
|
+
concernedAboutRates: "",
|
|
2383
|
+
considerFixedRate: "",
|
|
2384
|
+
retirementAge: "",
|
|
2385
|
+
anticipatedChanges: ""
|
|
2386
|
+
};
|
|
2387
|
+
var ABOUT_APPLICANT_DEFAULTS = {
|
|
2388
|
+
title: "",
|
|
2389
|
+
firstName: "",
|
|
2390
|
+
lastName: "",
|
|
2391
|
+
phone: "",
|
|
2392
|
+
email: "",
|
|
2393
|
+
dob: "",
|
|
2394
|
+
gender: "",
|
|
2395
|
+
maritalStatus: "",
|
|
2396
|
+
numDependants: "",
|
|
2397
|
+
dependants: [],
|
|
2398
|
+
citizenStatus: "",
|
|
2399
|
+
residentialAddress: "",
|
|
2400
|
+
residentialStatus: "",
|
|
2401
|
+
timeAtAddressYears: "",
|
|
2402
|
+
timeAtAddressMonths: "",
|
|
2403
|
+
previousAddress: "",
|
|
2404
|
+
driversLicence: "",
|
|
2405
|
+
passport: "",
|
|
2406
|
+
propertyInTrust: "",
|
|
2407
|
+
companyOwnership: ""
|
|
2408
|
+
};
|
|
2409
|
+
function makeDefaultIncomeItem() {
|
|
2410
|
+
return {
|
|
2411
|
+
id: `income-${Date.now()}-${Math.random()}`,
|
|
2412
|
+
incomeType: "",
|
|
2413
|
+
jobTitle: "",
|
|
2414
|
+
startDate: "",
|
|
2415
|
+
stillInPosition: true,
|
|
2416
|
+
endDate: "",
|
|
2417
|
+
companyName: "",
|
|
2418
|
+
companyAddress: "",
|
|
2419
|
+
incomeAmount: 0,
|
|
2420
|
+
frequency: "Monthly",
|
|
2421
|
+
companyType: ""
|
|
2422
|
+
};
|
|
2423
|
+
}
|
|
2424
|
+
function makeDefaultAssetItem() {
|
|
2425
|
+
return {
|
|
2426
|
+
id: `asset-${Date.now()}-${Math.random()}`,
|
|
2427
|
+
assetType: "",
|
|
2428
|
+
value: 0,
|
|
2429
|
+
mainShare: 100,
|
|
2430
|
+
coShare: 0
|
|
2431
|
+
};
|
|
2432
|
+
}
|
|
2433
|
+
function makeDefaultDebtItem() {
|
|
2434
|
+
return {
|
|
2435
|
+
id: `debt-${Date.now()}-${Math.random()}`,
|
|
2436
|
+
debtType: "",
|
|
2437
|
+
amountOwing: 0,
|
|
2438
|
+
originalLoanAmount: 0,
|
|
2439
|
+
repaymentAmount: 0,
|
|
2440
|
+
repaymentFrequency: "Monthly",
|
|
2441
|
+
interestRate: "",
|
|
2442
|
+
details: "",
|
|
2443
|
+
mainShare: 100,
|
|
2444
|
+
coShare: 0
|
|
2445
|
+
};
|
|
2446
|
+
}
|
|
2447
|
+
function makeDefaultExpenseItem() {
|
|
2448
|
+
return {
|
|
2449
|
+
id: `expense-${Date.now()}-${Math.random()}`,
|
|
2450
|
+
expenseType: "",
|
|
2451
|
+
amount: 0,
|
|
2452
|
+
frequency: "Monthly",
|
|
2453
|
+
mainShare: 100,
|
|
2454
|
+
coShare: 0
|
|
2455
|
+
};
|
|
2456
|
+
}
|
|
2457
|
+
function EditLoanScenarioModal({
|
|
2458
|
+
open,
|
|
2459
|
+
onOpenChange,
|
|
2460
|
+
initialData,
|
|
2461
|
+
onSave,
|
|
2462
|
+
className
|
|
2463
|
+
}) {
|
|
2464
|
+
const [form, setForm] = React10.useState(__spreadValues(__spreadValues({}, LOAN_SCENARIO_DEFAULTS), initialData));
|
|
2465
|
+
React10.useEffect(() => {
|
|
2466
|
+
if (open) {
|
|
2467
|
+
setForm(__spreadValues(__spreadValues({}, LOAN_SCENARIO_DEFAULTS), initialData));
|
|
2468
|
+
}
|
|
2469
|
+
}, [open]);
|
|
2470
|
+
const set = (key, val) => setForm((prev) => __spreadProps(__spreadValues({}, prev), { [key]: val }));
|
|
2471
|
+
const togglePriority = (priority) => {
|
|
2472
|
+
setForm((prev) => {
|
|
2473
|
+
const exists = prev.priorities.includes(priority);
|
|
2474
|
+
if (exists) {
|
|
2475
|
+
return __spreadProps(__spreadValues({}, prev), {
|
|
2476
|
+
priorities: prev.priorities.filter((p) => p !== priority)
|
|
2477
|
+
});
|
|
2478
|
+
}
|
|
2479
|
+
if (prev.priorities.length >= 3) return prev;
|
|
2480
|
+
return __spreadProps(__spreadValues({}, prev), { priorities: [...prev.priorities, priority] });
|
|
2481
|
+
});
|
|
2482
|
+
};
|
|
2483
|
+
const prioritiesAtMax = form.priorities.length >= 3;
|
|
2484
|
+
const LOAN_FEATURES = [
|
|
2485
|
+
{ key: "featureFixedRate", label: "Fixed Rate" },
|
|
2486
|
+
{ key: "featureVariableRate", label: "Variable Rate" },
|
|
2487
|
+
{ key: "featureSplitLoan", label: "Split Loan" },
|
|
2488
|
+
{ key: "featureInterestOnly", label: "Interest Only" },
|
|
2489
|
+
{ key: "featureRedrawFacility", label: "Redraw Facility" },
|
|
2490
|
+
{ key: "feature100Offset", label: "100% Offset" }
|
|
2491
|
+
];
|
|
2492
|
+
const YES_NO_FIELDS = [
|
|
2493
|
+
{
|
|
2494
|
+
key: "borrowOtherThanProperty",
|
|
2495
|
+
label: "Do you intend to borrow money other than your property?"
|
|
2496
|
+
},
|
|
2497
|
+
{
|
|
2498
|
+
key: "concernedAboutRates",
|
|
2499
|
+
label: "Are you concerned about rising interest rates?"
|
|
2500
|
+
},
|
|
2501
|
+
{
|
|
2502
|
+
key: "considerFixedRate",
|
|
2503
|
+
label: "Would you consider taking a fixed rate?"
|
|
2504
|
+
},
|
|
2505
|
+
{
|
|
2506
|
+
key: "anticipatedChanges",
|
|
2507
|
+
label: "Anticipated changes impacting repayment?"
|
|
2508
|
+
}
|
|
2509
|
+
];
|
|
2510
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Dialog, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(DialogContent, { className: cn("max-w-lg", className), children: [
|
|
2511
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DialogHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DialogTitle, { children: "Edit Loan Scenario" }) }),
|
|
2512
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(ModalScroll, { children: [
|
|
2513
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "What would you like to do?", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
2514
|
+
Select,
|
|
2515
|
+
{
|
|
2516
|
+
value: form.loanPurpose,
|
|
2517
|
+
onValueChange: (val) => set("loanPurpose", val),
|
|
2518
|
+
children: [
|
|
2519
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectTrigger, { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectValue, { placeholder: "Select purpose" }) }),
|
|
2520
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectContent, { children: LOAN_PURPOSES.map((p) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectItem, { value: p, children: p }, p)) })
|
|
2521
|
+
]
|
|
2522
|
+
}
|
|
2523
|
+
) }),
|
|
2524
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
2525
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Property Estimate", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2526
|
+
CurrencyInputWithSlider,
|
|
2527
|
+
{
|
|
2528
|
+
value: form.propertyEstimate,
|
|
2529
|
+
min: 0,
|
|
2530
|
+
max: 1e7,
|
|
2531
|
+
step: 5e4,
|
|
2532
|
+
onValueChange: (val) => set("propertyEstimate", val)
|
|
2533
|
+
}
|
|
2534
|
+
) }),
|
|
2535
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Cash/equity towards property", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2536
|
+
CurrencyInputWithSlider,
|
|
2537
|
+
{
|
|
2538
|
+
value: form.cashEquity,
|
|
2539
|
+
min: 0,
|
|
2540
|
+
max: 2e6,
|
|
2541
|
+
step: 5e3,
|
|
2542
|
+
onValueChange: (val) => set("cashEquity", val)
|
|
2543
|
+
}
|
|
2544
|
+
) })
|
|
2545
|
+
] }),
|
|
2546
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
2547
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Loan Amount", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2548
|
+
CurrencyInputWithSlider,
|
|
2549
|
+
{
|
|
2550
|
+
value: form.loanAmount,
|
|
2551
|
+
min: 0,
|
|
2552
|
+
max: 5e6,
|
|
2553
|
+
step: 1e4,
|
|
2554
|
+
onValueChange: (val) => set("loanAmount", val)
|
|
2555
|
+
}
|
|
2556
|
+
) }),
|
|
2557
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Loan Duration", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
2558
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
2559
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2560
|
+
Input,
|
|
2561
|
+
{
|
|
2562
|
+
type: "number",
|
|
2563
|
+
min: 1,
|
|
2564
|
+
max: 40,
|
|
2565
|
+
value: form.loanDuration,
|
|
2566
|
+
onChange: (e) => {
|
|
2567
|
+
const parsed = parseInt(e.target.value, 10);
|
|
2568
|
+
if (!isNaN(parsed)) {
|
|
2569
|
+
set("loanDuration", Math.min(40, Math.max(1, parsed)));
|
|
2570
|
+
}
|
|
2571
|
+
},
|
|
2572
|
+
className: "flex-1"
|
|
2573
|
+
}
|
|
2574
|
+
),
|
|
2575
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "text-sm text-muted-foreground", children: "years" })
|
|
2576
|
+
] }),
|
|
2577
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2578
|
+
Slider,
|
|
2579
|
+
{
|
|
2580
|
+
min: 1,
|
|
2581
|
+
max: 40,
|
|
2582
|
+
step: 1,
|
|
2583
|
+
value: form.loanDuration,
|
|
2584
|
+
onValueChange: (val) => set("loanDuration", val)
|
|
2585
|
+
}
|
|
2586
|
+
)
|
|
2587
|
+
] }) })
|
|
2588
|
+
] }),
|
|
2589
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Do you know what loan features you want?", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
2590
|
+
Select,
|
|
2591
|
+
{
|
|
2592
|
+
value: form.knowsFeatures,
|
|
2593
|
+
onValueChange: (val) => set("knowsFeatures", val),
|
|
2594
|
+
children: [
|
|
2595
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectTrigger, { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectValue, { placeholder: "Select" }) }),
|
|
2596
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(SelectContent, { children: [
|
|
2597
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectItem, { value: "Yes", children: "Yes" }),
|
|
2598
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectItem, { value: "No", children: "No" })
|
|
2599
|
+
] })
|
|
2600
|
+
]
|
|
2601
|
+
}
|
|
2602
|
+
) }),
|
|
2603
|
+
form.knowsFeatures === "Yes" && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
2604
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Label, { className: "text-sm font-medium text-muted-foreground", children: "What features are important to you?" }),
|
|
2605
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "grid grid-cols-2 gap-2", children: LOAN_FEATURES.map(({ key, label }) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
2606
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2607
|
+
Checkbox,
|
|
2608
|
+
{
|
|
2609
|
+
id: `feature-${key}`,
|
|
2610
|
+
checked: form[key],
|
|
2611
|
+
onCheckedChange: (checked) => set(key, checked === true)
|
|
2612
|
+
}
|
|
2613
|
+
),
|
|
2614
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2615
|
+
"label",
|
|
2616
|
+
{
|
|
2617
|
+
htmlFor: `feature-${key}`,
|
|
2618
|
+
className: "text-sm cursor-pointer select-none",
|
|
2619
|
+
children: label
|
|
2620
|
+
}
|
|
2621
|
+
)
|
|
2622
|
+
] }, key)) })
|
|
2623
|
+
] }),
|
|
2624
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
2625
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Label, { className: "text-sm font-medium text-muted-foreground", children: "Top 3 Priorities (Select up to 3)" }),
|
|
2626
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "grid grid-cols-2 gap-2", children: PRIORITIES.map((priority) => {
|
|
2627
|
+
const checked = form.priorities.includes(priority);
|
|
2628
|
+
const disabled = prioritiesAtMax && !checked;
|
|
2629
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
2630
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2631
|
+
Checkbox,
|
|
2632
|
+
{
|
|
2633
|
+
id: `priority-${priority}`,
|
|
2634
|
+
checked,
|
|
2635
|
+
disabled,
|
|
2636
|
+
onCheckedChange: () => togglePriority(priority)
|
|
2637
|
+
}
|
|
2638
|
+
),
|
|
2639
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2640
|
+
"label",
|
|
2641
|
+
{
|
|
2642
|
+
htmlFor: `priority-${priority}`,
|
|
2643
|
+
className: cn(
|
|
2644
|
+
"text-sm cursor-pointer select-none",
|
|
2645
|
+
disabled && "opacity-40 cursor-not-allowed"
|
|
2646
|
+
),
|
|
2647
|
+
children: priority
|
|
2648
|
+
}
|
|
2649
|
+
)
|
|
2650
|
+
] }, priority);
|
|
2651
|
+
}) })
|
|
2652
|
+
] }),
|
|
2653
|
+
YES_NO_FIELDS.map(({ key, label }) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
2654
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Label, { className: "text-sm font-medium text-muted-foreground", children: label }),
|
|
2655
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2656
|
+
RadioGroup,
|
|
2657
|
+
{
|
|
2658
|
+
value: form[key],
|
|
2659
|
+
onValueChange: (val) => {
|
|
2660
|
+
if (val === "Yes" || val === "No") set(key, val);
|
|
2661
|
+
},
|
|
2662
|
+
className: "flex gap-4",
|
|
2663
|
+
children: ["Yes", "No"].map((opt) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
2664
|
+
"label",
|
|
2665
|
+
{
|
|
2666
|
+
className: "flex items-center gap-2 cursor-pointer select-none",
|
|
2667
|
+
children: [
|
|
2668
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(RadioGroupItem, { value: opt }),
|
|
2669
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "text-sm", children: opt })
|
|
2670
|
+
]
|
|
2671
|
+
},
|
|
2672
|
+
opt
|
|
2673
|
+
))
|
|
2674
|
+
}
|
|
2675
|
+
)
|
|
2676
|
+
] }, key)),
|
|
2677
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "What age are you planning to retire?", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2678
|
+
Input,
|
|
2679
|
+
{
|
|
2680
|
+
type: "number",
|
|
2681
|
+
min: 0,
|
|
2682
|
+
max: 100,
|
|
2683
|
+
value: form.retirementAge,
|
|
2684
|
+
onChange: (e) => set("retirementAge", e.target.value),
|
|
2685
|
+
placeholder: "e.g. 65"
|
|
2686
|
+
}
|
|
2687
|
+
) })
|
|
2688
|
+
] }),
|
|
2689
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(DialogFooter, { children: [
|
|
2690
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Button, { variant: "outline", onClick: () => onOpenChange(false), children: "Cancel" }),
|
|
2691
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2692
|
+
Button,
|
|
2693
|
+
{
|
|
2694
|
+
onClick: () => {
|
|
2695
|
+
onSave(form);
|
|
2696
|
+
onOpenChange(false);
|
|
2697
|
+
},
|
|
2698
|
+
children: "Save"
|
|
2699
|
+
}
|
|
2700
|
+
)
|
|
2701
|
+
] })
|
|
2702
|
+
] }) });
|
|
2703
|
+
}
|
|
2704
|
+
function EditAssetsModal({
|
|
2705
|
+
open,
|
|
2706
|
+
onOpenChange,
|
|
2707
|
+
initialItems = [],
|
|
2708
|
+
onSave,
|
|
2709
|
+
mainApplicantName = "Main Applicant",
|
|
2710
|
+
coApplicantName = "Co-Applicant",
|
|
2711
|
+
className
|
|
2712
|
+
}) {
|
|
2713
|
+
const [items, setItems] = React10.useState(
|
|
2714
|
+
initialItems.length > 0 ? initialItems : [makeDefaultAssetItem()]
|
|
2715
|
+
);
|
|
2716
|
+
React10.useEffect(() => {
|
|
2717
|
+
if (open) {
|
|
2718
|
+
setItems(
|
|
2719
|
+
initialItems.length > 0 ? initialItems : [makeDefaultAssetItem()]
|
|
2720
|
+
);
|
|
2721
|
+
}
|
|
2722
|
+
}, [open]);
|
|
2723
|
+
const updateItem = (id, key, val) => setItems(
|
|
2724
|
+
(prev) => prev.map((item) => item.id === id ? __spreadProps(__spreadValues({}, item), { [key]: val }) : item)
|
|
2725
|
+
);
|
|
2726
|
+
const removeItem = (id) => setItems((prev) => prev.filter((item) => item.id !== id));
|
|
2727
|
+
const addItem = () => setItems((prev) => [...prev, makeDefaultAssetItem()]);
|
|
2728
|
+
const defaultOpenItems = items.length > 0 ? [items[0].id] : [];
|
|
2729
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Dialog, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(DialogContent, { className: cn("max-w-lg", className), children: [
|
|
2730
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DialogHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DialogTitle, { children: "Edit Assets" }) }),
|
|
2731
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(ModalScroll, { children: [
|
|
2732
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2733
|
+
Accordion,
|
|
2734
|
+
{
|
|
2735
|
+
multiple: true,
|
|
2736
|
+
defaultValue: defaultOpenItems,
|
|
2737
|
+
className: "w-full",
|
|
2738
|
+
children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(AccordionItem, { value: item.id, children: [
|
|
2739
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2740
|
+
AccordionItemHeader,
|
|
2741
|
+
{
|
|
2742
|
+
label: `Asset ${index + 1} \u2014 ${item.assetType || "New Asset"}`,
|
|
2743
|
+
onRemove: () => removeItem(item.id),
|
|
2744
|
+
removeLabel: "Remove asset"
|
|
2745
|
+
}
|
|
2746
|
+
),
|
|
2747
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(AccordionContent, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-col gap-4 pt-1", children: [
|
|
2748
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Asset Type", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
2749
|
+
Select,
|
|
2750
|
+
{
|
|
2751
|
+
value: item.assetType,
|
|
2752
|
+
onValueChange: (val) => updateItem(item.id, "assetType", val),
|
|
2753
|
+
children: [
|
|
2754
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectTrigger, { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectValue, { placeholder: "Select type" }) }),
|
|
2755
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectContent, { children: ASSET_TYPES.map((t) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectItem, { value: t, children: t }, t)) })
|
|
2756
|
+
]
|
|
2757
|
+
}
|
|
2758
|
+
) }),
|
|
2759
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Value", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2760
|
+
CurrencyInputWithSlider,
|
|
2761
|
+
{
|
|
2762
|
+
value: item.value,
|
|
2763
|
+
min: 0,
|
|
2764
|
+
max: 1e7,
|
|
2765
|
+
step: 1e4,
|
|
2766
|
+
onValueChange: (val) => updateItem(item.id, "value", val)
|
|
2767
|
+
}
|
|
2768
|
+
) }),
|
|
2769
|
+
(() => {
|
|
2770
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
2771
|
+
const f = assetFields(item.assetType);
|
|
2772
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
2773
|
+
f.isProperty && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
2774
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Property Address", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2775
|
+
AddressAutocomplete,
|
|
2776
|
+
{
|
|
2777
|
+
value: (_a = item.address) != null ? _a : "",
|
|
2778
|
+
onValueChange: (val) => updateItem(item.id, "address", val),
|
|
2779
|
+
onSelect: (opt) => updateItem(item.id, "address", opt.label)
|
|
2780
|
+
}
|
|
2781
|
+
) }),
|
|
2782
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
2783
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Property Type", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
2784
|
+
Select,
|
|
2785
|
+
{
|
|
2786
|
+
value: (_b = item.propertySubtype) != null ? _b : "",
|
|
2787
|
+
onValueChange: (val) => updateItem(
|
|
2788
|
+
item.id,
|
|
2789
|
+
"propertySubtype",
|
|
2790
|
+
val
|
|
2791
|
+
),
|
|
2792
|
+
children: [
|
|
2793
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectTrigger, { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectValue, { placeholder: "Select" }) }),
|
|
2794
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectContent, { children: PROPERTY_SUBTYPES.map((t) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectItem, { value: t, children: t }, t)) })
|
|
2795
|
+
]
|
|
2796
|
+
}
|
|
2797
|
+
) }),
|
|
2798
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Used As", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
2799
|
+
Select,
|
|
2800
|
+
{
|
|
2801
|
+
value: (_c = item.usedAs) != null ? _c : "",
|
|
2802
|
+
onValueChange: (val) => updateItem(item.id, "usedAs", val),
|
|
2803
|
+
children: [
|
|
2804
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectTrigger, { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectValue, { placeholder: "Select" }) }),
|
|
2805
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectContent, { children: PROPERTY_USED_AS.map((t) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectItem, { value: t, children: t }, t)) })
|
|
2806
|
+
]
|
|
2807
|
+
}
|
|
2808
|
+
) })
|
|
2809
|
+
] })
|
|
2810
|
+
] }),
|
|
2811
|
+
f.isVehicle && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "grid grid-cols-3 gap-4", children: [
|
|
2812
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Make", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2813
|
+
Input,
|
|
2814
|
+
{
|
|
2815
|
+
value: (_d = item.make) != null ? _d : "",
|
|
2816
|
+
onChange: (e) => updateItem(item.id, "make", e.target.value),
|
|
2817
|
+
placeholder: "e.g. Toyota"
|
|
2818
|
+
}
|
|
2819
|
+
) }),
|
|
2820
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Model", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2821
|
+
Input,
|
|
2822
|
+
{
|
|
2823
|
+
value: (_e = item.model) != null ? _e : "",
|
|
2824
|
+
onChange: (e) => updateItem(item.id, "model", e.target.value),
|
|
2825
|
+
placeholder: "e.g. Camry"
|
|
2826
|
+
}
|
|
2827
|
+
) }),
|
|
2828
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Year", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2829
|
+
Input,
|
|
2830
|
+
{
|
|
2831
|
+
type: "number",
|
|
2832
|
+
min: 1900,
|
|
2833
|
+
max: (/* @__PURE__ */ new Date()).getFullYear() + 1,
|
|
2834
|
+
value: (_f = item.year) != null ? _f : "",
|
|
2835
|
+
onChange: (e) => updateItem(item.id, "year", e.target.value),
|
|
2836
|
+
placeholder: "e.g. 2022"
|
|
2837
|
+
}
|
|
2838
|
+
) })
|
|
2839
|
+
] }),
|
|
2840
|
+
(f.isFinancialAccount || f.isInvestment) && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Institution / Platform", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2841
|
+
Input,
|
|
2842
|
+
{
|
|
2843
|
+
value: (_g = item.institution) != null ? _g : "",
|
|
2844
|
+
onChange: (e) => updateItem(
|
|
2845
|
+
item.id,
|
|
2846
|
+
"institution",
|
|
2847
|
+
e.target.value
|
|
2848
|
+
),
|
|
2849
|
+
placeholder: "e.g. CommBank, Vanguard"
|
|
2850
|
+
}
|
|
2851
|
+
) }),
|
|
2852
|
+
f.isSuper && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
2853
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Fund Name", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2854
|
+
Input,
|
|
2855
|
+
{
|
|
2856
|
+
value: (_h = item.fundName) != null ? _h : "",
|
|
2857
|
+
onChange: (e) => updateItem(
|
|
2858
|
+
item.id,
|
|
2859
|
+
"fundName",
|
|
2860
|
+
e.target.value
|
|
2861
|
+
),
|
|
2862
|
+
placeholder: "e.g. Australian Super"
|
|
2863
|
+
}
|
|
2864
|
+
) }),
|
|
2865
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Member Number", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2866
|
+
Input,
|
|
2867
|
+
{
|
|
2868
|
+
value: (_i = item.memberNumber) != null ? _i : "",
|
|
2869
|
+
onChange: (e) => updateItem(
|
|
2870
|
+
item.id,
|
|
2871
|
+
"memberNumber",
|
|
2872
|
+
e.target.value
|
|
2873
|
+
),
|
|
2874
|
+
placeholder: "e.g. 1234567"
|
|
2875
|
+
}
|
|
2876
|
+
) })
|
|
2877
|
+
] }),
|
|
2878
|
+
f.isBusiness && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
2879
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Business Name", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2880
|
+
Input,
|
|
2881
|
+
{
|
|
2882
|
+
value: (_j = item.businessName) != null ? _j : "",
|
|
2883
|
+
onChange: (e) => updateItem(
|
|
2884
|
+
item.id,
|
|
2885
|
+
"businessName",
|
|
2886
|
+
e.target.value
|
|
2887
|
+
),
|
|
2888
|
+
placeholder: "e.g. Acme Pty Ltd"
|
|
2889
|
+
}
|
|
2890
|
+
) }),
|
|
2891
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "ABN", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2892
|
+
Input,
|
|
2893
|
+
{
|
|
2894
|
+
value: (_k = item.abn) != null ? _k : "",
|
|
2895
|
+
onChange: (e) => updateItem(item.id, "abn", e.target.value),
|
|
2896
|
+
placeholder: "e.g. 12 345 678 901"
|
|
2897
|
+
}
|
|
2898
|
+
) })
|
|
2899
|
+
] }),
|
|
2900
|
+
f.isInsurance && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
2901
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Insurer", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2902
|
+
Input,
|
|
2903
|
+
{
|
|
2904
|
+
value: (_l = item.insurer) != null ? _l : "",
|
|
2905
|
+
onChange: (e) => updateItem(
|
|
2906
|
+
item.id,
|
|
2907
|
+
"insurer",
|
|
2908
|
+
e.target.value
|
|
2909
|
+
),
|
|
2910
|
+
placeholder: "e.g. TAL, AIA"
|
|
2911
|
+
}
|
|
2912
|
+
) }),
|
|
2913
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Policy Number", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2914
|
+
Input,
|
|
2915
|
+
{
|
|
2916
|
+
value: (_m = item.policyNumber) != null ? _m : "",
|
|
2917
|
+
onChange: (e) => updateItem(
|
|
2918
|
+
item.id,
|
|
2919
|
+
"policyNumber",
|
|
2920
|
+
e.target.value
|
|
2921
|
+
),
|
|
2922
|
+
placeholder: "e.g. POL-123456"
|
|
2923
|
+
}
|
|
2924
|
+
) })
|
|
2925
|
+
] })
|
|
2926
|
+
] });
|
|
2927
|
+
})(),
|
|
2928
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Ownership (%)", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2929
|
+
OwnershipSplit,
|
|
2930
|
+
{
|
|
2931
|
+
owners: [
|
|
2932
|
+
{
|
|
2933
|
+
id: "main",
|
|
2934
|
+
name: mainApplicantName != null ? mainApplicantName : "Main Applicant",
|
|
2935
|
+
share: item.mainShare
|
|
2936
|
+
},
|
|
2937
|
+
{
|
|
2938
|
+
id: "co",
|
|
2939
|
+
name: coApplicantName != null ? coApplicantName : "Co-Applicant",
|
|
2940
|
+
share: item.coShare
|
|
2941
|
+
}
|
|
2942
|
+
],
|
|
2943
|
+
onOwnersChange: (owners) => {
|
|
2944
|
+
var _a, _b, _c, _d;
|
|
2945
|
+
updateItem(
|
|
2946
|
+
item.id,
|
|
2947
|
+
"mainShare",
|
|
2948
|
+
(_b = (_a = owners.find((o) => o.id === "main")) == null ? void 0 : _a.share) != null ? _b : 50
|
|
2949
|
+
);
|
|
2950
|
+
updateItem(
|
|
2951
|
+
item.id,
|
|
2952
|
+
"coShare",
|
|
2953
|
+
(_d = (_c = owners.find((o) => o.id === "co")) == null ? void 0 : _c.share) != null ? _d : 50
|
|
2954
|
+
);
|
|
2955
|
+
}
|
|
2956
|
+
}
|
|
2957
|
+
) })
|
|
2958
|
+
] }) })
|
|
2959
|
+
] }, item.id))
|
|
2960
|
+
}
|
|
2961
|
+
),
|
|
2962
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
2963
|
+
Button,
|
|
2964
|
+
{
|
|
2965
|
+
variant: "outline",
|
|
2966
|
+
onClick: addItem,
|
|
2967
|
+
className: "w-full gap-1.5",
|
|
2968
|
+
children: [
|
|
2969
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react11.Plus, { className: "h-4 w-4" }),
|
|
2970
|
+
"Add More"
|
|
2971
|
+
]
|
|
2972
|
+
}
|
|
2973
|
+
)
|
|
2974
|
+
] }),
|
|
2975
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(DialogFooter, { children: [
|
|
2976
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Button, { variant: "outline", onClick: () => onOpenChange(false), children: "Cancel" }),
|
|
2977
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2978
|
+
Button,
|
|
2979
|
+
{
|
|
2980
|
+
onClick: () => {
|
|
2981
|
+
onSave(items);
|
|
2982
|
+
onOpenChange(false);
|
|
2983
|
+
},
|
|
2984
|
+
children: "Save"
|
|
2985
|
+
}
|
|
2986
|
+
)
|
|
2987
|
+
] })
|
|
2988
|
+
] }) });
|
|
2989
|
+
}
|
|
2990
|
+
function EditDebtsModal({
|
|
2991
|
+
open,
|
|
2992
|
+
onOpenChange,
|
|
2993
|
+
initialItems = [],
|
|
2994
|
+
onSave,
|
|
2995
|
+
mainApplicantName = "Main Applicant",
|
|
2996
|
+
coApplicantName = "Co-Applicant",
|
|
2997
|
+
className
|
|
2998
|
+
}) {
|
|
2999
|
+
const [items, setItems] = React10.useState(
|
|
3000
|
+
initialItems.length > 0 ? initialItems : [makeDefaultDebtItem()]
|
|
3001
|
+
);
|
|
3002
|
+
React10.useEffect(() => {
|
|
3003
|
+
if (open) {
|
|
3004
|
+
setItems(
|
|
3005
|
+
initialItems.length > 0 ? initialItems : [makeDefaultDebtItem()]
|
|
3006
|
+
);
|
|
3007
|
+
}
|
|
3008
|
+
}, [open]);
|
|
3009
|
+
const updateItem = (id, key, val) => setItems(
|
|
3010
|
+
(prev) => prev.map((item) => item.id === id ? __spreadProps(__spreadValues({}, item), { [key]: val }) : item)
|
|
3011
|
+
);
|
|
3012
|
+
const removeItem = (id) => setItems((prev) => prev.filter((item) => item.id !== id));
|
|
3013
|
+
const addItem = () => setItems((prev) => [...prev, makeDefaultDebtItem()]);
|
|
3014
|
+
const defaultOpenItems = items.length > 0 ? [items[0].id] : [];
|
|
3015
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Dialog, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(DialogContent, { className: cn("max-w-xl", className), children: [
|
|
3016
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DialogHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DialogTitle, { children: "Edit Debts" }) }),
|
|
3017
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(ModalScroll, { children: [
|
|
3018
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3019
|
+
Accordion,
|
|
3020
|
+
{
|
|
3021
|
+
multiple: true,
|
|
3022
|
+
defaultValue: defaultOpenItems,
|
|
3023
|
+
className: "w-full",
|
|
3024
|
+
children: items.map((item) => {
|
|
3025
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
3026
|
+
const df = debtFields(item.debtType);
|
|
3027
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(AccordionItem, { value: item.id, children: [
|
|
3028
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3029
|
+
AccordionItemHeader,
|
|
3030
|
+
{
|
|
3031
|
+
label: item.debtType || "New Debt",
|
|
3032
|
+
onRemove: () => removeItem(item.id),
|
|
3033
|
+
removeLabel: "Remove debt"
|
|
3034
|
+
}
|
|
3035
|
+
),
|
|
3036
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(AccordionContent, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-col gap-4 pt-1", children: [
|
|
3037
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Debt Type", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
3038
|
+
Select,
|
|
3039
|
+
{
|
|
3040
|
+
value: item.debtType,
|
|
3041
|
+
onValueChange: (val) => updateItem(item.id, "debtType", val),
|
|
3042
|
+
children: [
|
|
3043
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectTrigger, { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectValue, { placeholder: "Select type" }) }),
|
|
3044
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectContent, { children: DEBT_TYPES.map((t) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectItem, { value: t, children: t }, t)) })
|
|
3045
|
+
]
|
|
3046
|
+
}
|
|
3047
|
+
) }),
|
|
3048
|
+
(df.isPropertyLoan || df.isGeneralLoan || df.isVehicle) && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
3049
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Lender", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3050
|
+
Input,
|
|
3051
|
+
{
|
|
3052
|
+
value: (_a = item.lender) != null ? _a : "",
|
|
3053
|
+
onChange: (e) => updateItem(item.id, "lender", e.target.value),
|
|
3054
|
+
placeholder: "e.g. CommBank"
|
|
3055
|
+
}
|
|
3056
|
+
) }),
|
|
3057
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Account Number", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3058
|
+
Input,
|
|
3059
|
+
{
|
|
3060
|
+
value: (_b = item.accountNumber) != null ? _b : "",
|
|
3061
|
+
onChange: (e) => updateItem(
|
|
3062
|
+
item.id,
|
|
3063
|
+
"accountNumber",
|
|
3064
|
+
e.target.value
|
|
3065
|
+
),
|
|
3066
|
+
placeholder: "e.g. 123-456"
|
|
3067
|
+
}
|
|
3068
|
+
) })
|
|
3069
|
+
] }),
|
|
3070
|
+
df.isPropertyLoan && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Property Address", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3071
|
+
AddressAutocomplete,
|
|
3072
|
+
{
|
|
3073
|
+
value: (_c = item.propertyAddress) != null ? _c : "",
|
|
3074
|
+
onValueChange: (val) => updateItem(item.id, "propertyAddress", val),
|
|
3075
|
+
onSelect: (opt) => updateItem(item.id, "propertyAddress", opt.label)
|
|
3076
|
+
}
|
|
3077
|
+
) }),
|
|
3078
|
+
df.isVehicle && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "grid grid-cols-3 gap-4", children: [
|
|
3079
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Make", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3080
|
+
Input,
|
|
3081
|
+
{
|
|
3082
|
+
value: (_d = item.vehicleMake) != null ? _d : "",
|
|
3083
|
+
onChange: (e) => updateItem(
|
|
3084
|
+
item.id,
|
|
3085
|
+
"vehicleMake",
|
|
3086
|
+
e.target.value
|
|
3087
|
+
),
|
|
3088
|
+
placeholder: "e.g. Toyota"
|
|
3089
|
+
}
|
|
3090
|
+
) }),
|
|
3091
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Model", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3092
|
+
Input,
|
|
3093
|
+
{
|
|
3094
|
+
value: (_e = item.vehicleModel) != null ? _e : "",
|
|
3095
|
+
onChange: (e) => updateItem(
|
|
3096
|
+
item.id,
|
|
3097
|
+
"vehicleModel",
|
|
3098
|
+
e.target.value
|
|
3099
|
+
),
|
|
3100
|
+
placeholder: "e.g. Camry"
|
|
3101
|
+
}
|
|
3102
|
+
) }),
|
|
3103
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Year", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3104
|
+
Input,
|
|
3105
|
+
{
|
|
3106
|
+
type: "number",
|
|
3107
|
+
min: 1900,
|
|
3108
|
+
max: (/* @__PURE__ */ new Date()).getFullYear() + 1,
|
|
3109
|
+
value: (_f = item.vehicleYear) != null ? _f : "",
|
|
3110
|
+
onChange: (e) => updateItem(
|
|
3111
|
+
item.id,
|
|
3112
|
+
"vehicleYear",
|
|
3113
|
+
e.target.value
|
|
3114
|
+
),
|
|
3115
|
+
placeholder: "e.g. 2022"
|
|
3116
|
+
}
|
|
3117
|
+
) })
|
|
3118
|
+
] }),
|
|
3119
|
+
df.isCard && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
3120
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Provider", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3121
|
+
Input,
|
|
3122
|
+
{
|
|
3123
|
+
value: (_g = item.lender) != null ? _g : "",
|
|
3124
|
+
onChange: (e) => updateItem(item.id, "lender", e.target.value),
|
|
3125
|
+
placeholder: "e.g. ANZ, Afterpay"
|
|
3126
|
+
}
|
|
3127
|
+
) }),
|
|
3128
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Credit Limit", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3129
|
+
CurrencyInputWithSlider,
|
|
3130
|
+
{
|
|
3131
|
+
value: (_h = item.creditLimit) != null ? _h : 0,
|
|
3132
|
+
min: 0,
|
|
3133
|
+
max: 1e5,
|
|
3134
|
+
step: 500,
|
|
3135
|
+
onValueChange: (val) => updateItem(item.id, "creditLimit", val)
|
|
3136
|
+
}
|
|
3137
|
+
) })
|
|
3138
|
+
] }),
|
|
3139
|
+
df.isHecs && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Institution", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3140
|
+
Input,
|
|
3141
|
+
{
|
|
3142
|
+
value: (_i = item.institution) != null ? _i : "",
|
|
3143
|
+
onChange: (e) => updateItem(item.id, "institution", e.target.value),
|
|
3144
|
+
placeholder: "e.g. University of Sydney"
|
|
3145
|
+
}
|
|
3146
|
+
) }),
|
|
3147
|
+
df.isTax && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
3148
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Tax Year", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3149
|
+
Input,
|
|
3150
|
+
{
|
|
3151
|
+
value: (_j = item.taxYear) != null ? _j : "",
|
|
3152
|
+
onChange: (e) => updateItem(item.id, "taxYear", e.target.value),
|
|
3153
|
+
placeholder: "e.g. 2023\u201324"
|
|
3154
|
+
}
|
|
3155
|
+
) }),
|
|
3156
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "ATO Reference", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3157
|
+
Input,
|
|
3158
|
+
{
|
|
3159
|
+
value: (_k = item.referenceNumber) != null ? _k : "",
|
|
3160
|
+
onChange: (e) => updateItem(
|
|
3161
|
+
item.id,
|
|
3162
|
+
"referenceNumber",
|
|
3163
|
+
e.target.value
|
|
3164
|
+
),
|
|
3165
|
+
placeholder: "e.g. 1234567890"
|
|
3166
|
+
}
|
|
3167
|
+
) })
|
|
3168
|
+
] }),
|
|
3169
|
+
df.isGuarantor && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Beneficiary (borrower's name)", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3170
|
+
Input,
|
|
3171
|
+
{
|
|
3172
|
+
value: (_l = item.beneficiary) != null ? _l : "",
|
|
3173
|
+
onChange: (e) => updateItem(item.id, "beneficiary", e.target.value),
|
|
3174
|
+
placeholder: "e.g. Jane Smith"
|
|
3175
|
+
}
|
|
3176
|
+
) }),
|
|
3177
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
3178
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Amount Owing", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3179
|
+
CurrencyInputWithSlider,
|
|
3180
|
+
{
|
|
3181
|
+
value: item.amountOwing,
|
|
3182
|
+
min: 0,
|
|
3183
|
+
max: 1e6,
|
|
3184
|
+
step: 1e3,
|
|
3185
|
+
onValueChange: (val) => updateItem(item.id, "amountOwing", val)
|
|
3186
|
+
}
|
|
3187
|
+
) }),
|
|
3188
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Original Loan Amount", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3189
|
+
CurrencyInputWithSlider,
|
|
3190
|
+
{
|
|
3191
|
+
value: item.originalLoanAmount,
|
|
3192
|
+
min: 0,
|
|
3193
|
+
max: 1e6,
|
|
3194
|
+
step: 1e3,
|
|
3195
|
+
onValueChange: (val) => updateItem(item.id, "originalLoanAmount", val)
|
|
3196
|
+
}
|
|
3197
|
+
) })
|
|
3198
|
+
] }),
|
|
3199
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-start gap-3", children: [
|
|
3200
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Repayments", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3201
|
+
CurrencyInputWithSlider,
|
|
3202
|
+
{
|
|
3203
|
+
value: item.repaymentAmount,
|
|
3204
|
+
min: 0,
|
|
3205
|
+
max: 1e6,
|
|
3206
|
+
step: 100,
|
|
3207
|
+
onValueChange: (val) => updateItem(item.id, "repaymentAmount", val)
|
|
3208
|
+
}
|
|
3209
|
+
) }) }),
|
|
3210
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "shrink-0 mt-[1.625rem]", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3211
|
+
FrequencyToggle,
|
|
3212
|
+
{
|
|
3213
|
+
value: item.repaymentFrequency,
|
|
3214
|
+
onValueChange: (val) => updateItem(item.id, "repaymentFrequency", val)
|
|
3215
|
+
}
|
|
3216
|
+
) })
|
|
3217
|
+
] }),
|
|
3218
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Interest Rate", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
3219
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3220
|
+
Input,
|
|
3221
|
+
{
|
|
3222
|
+
value: item.interestRate,
|
|
3223
|
+
onChange: (e) => updateItem(
|
|
3224
|
+
item.id,
|
|
3225
|
+
"interestRate",
|
|
3226
|
+
e.target.value
|
|
3227
|
+
),
|
|
3228
|
+
placeholder: "e.g. 6.5",
|
|
3229
|
+
className: "flex-1"
|
|
3230
|
+
}
|
|
3231
|
+
),
|
|
3232
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "text-sm text-muted-foreground shrink-0", children: "%" })
|
|
3233
|
+
] }) }),
|
|
3234
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Notes", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3235
|
+
Textarea,
|
|
3236
|
+
{
|
|
3237
|
+
value: item.details,
|
|
3238
|
+
onChange: (e) => updateItem(item.id, "details", e.target.value),
|
|
3239
|
+
placeholder: "Short comment",
|
|
3240
|
+
rows: 2
|
|
3241
|
+
}
|
|
3242
|
+
) }),
|
|
3243
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Ownership (%)", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3244
|
+
OwnershipSplit,
|
|
3245
|
+
{
|
|
3246
|
+
owners: [
|
|
3247
|
+
{
|
|
3248
|
+
id: "main",
|
|
3249
|
+
name: mainApplicantName != null ? mainApplicantName : "Main Applicant",
|
|
3250
|
+
share: item.mainShare
|
|
3251
|
+
},
|
|
3252
|
+
{
|
|
3253
|
+
id: "co",
|
|
3254
|
+
name: coApplicantName != null ? coApplicantName : "Co-Applicant",
|
|
3255
|
+
share: item.coShare
|
|
3256
|
+
}
|
|
3257
|
+
],
|
|
3258
|
+
onOwnersChange: (owners) => {
|
|
3259
|
+
var _a2, _b2, _c2, _d2;
|
|
3260
|
+
updateItem(
|
|
3261
|
+
item.id,
|
|
3262
|
+
"mainShare",
|
|
3263
|
+
(_b2 = (_a2 = owners.find((o) => o.id === "main")) == null ? void 0 : _a2.share) != null ? _b2 : 50
|
|
3264
|
+
);
|
|
3265
|
+
updateItem(
|
|
3266
|
+
item.id,
|
|
3267
|
+
"coShare",
|
|
3268
|
+
(_d2 = (_c2 = owners.find((o) => o.id === "co")) == null ? void 0 : _c2.share) != null ? _d2 : 50
|
|
3269
|
+
);
|
|
3270
|
+
}
|
|
3271
|
+
}
|
|
3272
|
+
) })
|
|
3273
|
+
] }) })
|
|
3274
|
+
] }, item.id);
|
|
3275
|
+
})
|
|
3276
|
+
}
|
|
3277
|
+
),
|
|
3278
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
3279
|
+
Button,
|
|
3280
|
+
{
|
|
3281
|
+
variant: "outline",
|
|
3282
|
+
onClick: addItem,
|
|
3283
|
+
className: "w-full gap-1.5",
|
|
3284
|
+
children: [
|
|
3285
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react11.Plus, { className: "h-4 w-4" }),
|
|
3286
|
+
"Add More"
|
|
3287
|
+
]
|
|
3288
|
+
}
|
|
3289
|
+
)
|
|
3290
|
+
] }),
|
|
3291
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(DialogFooter, { children: [
|
|
3292
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Button, { variant: "outline", onClick: () => onOpenChange(false), children: "Cancel" }),
|
|
3293
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3294
|
+
Button,
|
|
3295
|
+
{
|
|
3296
|
+
onClick: () => {
|
|
3297
|
+
onSave(items);
|
|
3298
|
+
onOpenChange(false);
|
|
3299
|
+
},
|
|
3300
|
+
children: "Save"
|
|
3301
|
+
}
|
|
3302
|
+
)
|
|
3303
|
+
] })
|
|
3304
|
+
] }) });
|
|
3305
|
+
}
|
|
3306
|
+
function EditAboutApplicantModal({
|
|
3307
|
+
open,
|
|
3308
|
+
onOpenChange,
|
|
3309
|
+
applicantLabel = "Applicant",
|
|
3310
|
+
initialData,
|
|
3311
|
+
onSave,
|
|
3312
|
+
className
|
|
3313
|
+
}) {
|
|
3314
|
+
const [form, setForm] = React10.useState(__spreadValues(__spreadValues({}, ABOUT_APPLICANT_DEFAULTS), initialData));
|
|
3315
|
+
React10.useEffect(() => {
|
|
3316
|
+
if (open) {
|
|
3317
|
+
setForm(__spreadValues(__spreadValues({}, ABOUT_APPLICANT_DEFAULTS), initialData));
|
|
3318
|
+
}
|
|
3319
|
+
}, [open]);
|
|
3320
|
+
const setStr = (key) => (val) => setForm((prev) => __spreadProps(__spreadValues({}, prev), { [key]: val }));
|
|
3321
|
+
const handleNumDependantsChange = (val) => {
|
|
3322
|
+
const n = Math.max(0, Math.min(20, parseInt(val, 10) || 0));
|
|
3323
|
+
setForm((prev) => {
|
|
3324
|
+
var _a;
|
|
3325
|
+
const current = (_a = prev.dependants) != null ? _a : [];
|
|
3326
|
+
const next = n > current.length ? [...current, ...Array(n - current.length).fill({ dob: "" })] : current.slice(0, n);
|
|
3327
|
+
return __spreadProps(__spreadValues({}, prev), { numDependants: val, dependants: next });
|
|
3328
|
+
});
|
|
3329
|
+
};
|
|
3330
|
+
const setDependantDob = (index, dob) => setForm((prev) => {
|
|
3331
|
+
const next = prev.dependants.map((d, i) => i === index ? { dob } : d);
|
|
3332
|
+
return __spreadProps(__spreadValues({}, prev), { dependants: next });
|
|
3333
|
+
});
|
|
3334
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Dialog, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(DialogContent, { className: cn("max-w-md", className), children: [
|
|
3335
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DialogHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(DialogTitle, { children: [
|
|
3336
|
+
"Edit About ",
|
|
3337
|
+
applicantLabel
|
|
3338
|
+
] }) }),
|
|
3339
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(ModalScroll, { children: [
|
|
3340
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex gap-3 items-start", children: [
|
|
3341
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "w-24 shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Title", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Select, { value: form.title, onValueChange: setStr("title"), children: [
|
|
3342
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectTrigger, { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectValue, { placeholder: "Title" }) }),
|
|
3343
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectContent, { children: TITLE_OPTIONS.map((t) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectItem, { value: t, children: t }, t)) })
|
|
3344
|
+
] }) }) }),
|
|
3345
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "First Name", className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3346
|
+
Input,
|
|
3347
|
+
{
|
|
3348
|
+
value: form.firstName,
|
|
3349
|
+
onChange: (e) => setStr("firstName")(e.target.value),
|
|
3350
|
+
placeholder: "First name"
|
|
3351
|
+
}
|
|
3352
|
+
) }),
|
|
3353
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Last Name", className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3354
|
+
Input,
|
|
3355
|
+
{
|
|
3356
|
+
value: form.lastName,
|
|
3357
|
+
onChange: (e) => setStr("lastName")(e.target.value),
|
|
3358
|
+
placeholder: "Last name"
|
|
3359
|
+
}
|
|
3360
|
+
) })
|
|
3361
|
+
] }),
|
|
3362
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
3363
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Phone Number", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3364
|
+
Input,
|
|
3365
|
+
{
|
|
3366
|
+
value: form.phone,
|
|
3367
|
+
onChange: (e) => setStr("phone")(e.target.value),
|
|
3368
|
+
placeholder: "+61 4xx xxx xxx",
|
|
3369
|
+
type: "tel"
|
|
3370
|
+
}
|
|
3371
|
+
) }),
|
|
3372
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Email", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3373
|
+
Input,
|
|
3374
|
+
{
|
|
3375
|
+
value: form.email,
|
|
3376
|
+
onChange: (e) => setStr("email")(e.target.value),
|
|
3377
|
+
placeholder: "email@example.com",
|
|
3378
|
+
type: "email"
|
|
3379
|
+
}
|
|
3380
|
+
) })
|
|
3381
|
+
] }),
|
|
3382
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
3383
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Date of Birth", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3384
|
+
DatePicker,
|
|
3385
|
+
{
|
|
3386
|
+
value: form.dob ? new Date(form.dob) : void 0,
|
|
3387
|
+
onChange: (d) => setStr("dob")(d ? d.toISOString().slice(0, 10) : ""),
|
|
3388
|
+
calendarProps: {
|
|
3389
|
+
fromYear: 1900,
|
|
3390
|
+
toYear: (/* @__PURE__ */ new Date()).getFullYear() - 16
|
|
3391
|
+
}
|
|
3392
|
+
}
|
|
3393
|
+
) }),
|
|
3394
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Gender", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Select, { value: form.gender, onValueChange: setStr("gender"), children: [
|
|
3395
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectTrigger, { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectValue, { placeholder: "Select" }) }),
|
|
3396
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectContent, { children: GENDER_OPTIONS.map((g) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectItem, { value: g, children: g }, g)) })
|
|
3397
|
+
] }) })
|
|
3398
|
+
] }),
|
|
3399
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
3400
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Marital Status", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
3401
|
+
Select,
|
|
3402
|
+
{
|
|
3403
|
+
value: form.maritalStatus,
|
|
3404
|
+
onValueChange: setStr("maritalStatus"),
|
|
3405
|
+
children: [
|
|
3406
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectTrigger, { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectValue, { placeholder: "Select" }) }),
|
|
3407
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectContent, { children: MARITAL_OPTIONS.map((m) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectItem, { value: m, children: m }, m)) })
|
|
3408
|
+
]
|
|
3409
|
+
}
|
|
3410
|
+
) }),
|
|
3411
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "No. of Dependants", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3412
|
+
Input,
|
|
3413
|
+
{
|
|
3414
|
+
type: "number",
|
|
3415
|
+
min: 0,
|
|
3416
|
+
max: 20,
|
|
3417
|
+
value: form.numDependants,
|
|
3418
|
+
onChange: (e) => handleNumDependantsChange(e.target.value),
|
|
3419
|
+
placeholder: "0"
|
|
3420
|
+
}
|
|
3421
|
+
) })
|
|
3422
|
+
] }),
|
|
3423
|
+
form.dependants.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-col gap-3", children: [
|
|
3424
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Label, { className: "text-sm font-medium", children: "Dependant Date of Birth" }),
|
|
3425
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "grid grid-cols-2 gap-3", children: form.dependants.map((dep, i) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: `Dependant ${i + 1}`, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3426
|
+
DatePicker,
|
|
3427
|
+
{
|
|
3428
|
+
value: dep.dob ? new Date(dep.dob) : void 0,
|
|
3429
|
+
onChange: (d) => setDependantDob(
|
|
3430
|
+
i,
|
|
3431
|
+
d ? d.toISOString().slice(0, 10) : ""
|
|
3432
|
+
),
|
|
3433
|
+
calendarProps: {
|
|
3434
|
+
fromYear: 1900,
|
|
3435
|
+
toYear: (/* @__PURE__ */ new Date()).getFullYear()
|
|
3436
|
+
}
|
|
3437
|
+
}
|
|
3438
|
+
) }, i)) })
|
|
3439
|
+
] }),
|
|
3440
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Citizen Status", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
3441
|
+
Select,
|
|
3442
|
+
{
|
|
3443
|
+
value: form.citizenStatus,
|
|
3444
|
+
onValueChange: setStr("citizenStatus"),
|
|
3445
|
+
children: [
|
|
3446
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectTrigger, { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectValue, { placeholder: "Select status" }) }),
|
|
3447
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectContent, { children: CITIZEN_OPTIONS.map((c) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectItem, { value: c, children: c }, c)) })
|
|
3448
|
+
]
|
|
3449
|
+
}
|
|
3450
|
+
) }),
|
|
3451
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Current Residential Address", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3452
|
+
AddressAutocomplete,
|
|
3453
|
+
{
|
|
3454
|
+
value: form.residentialAddress,
|
|
3455
|
+
onValueChange: setStr("residentialAddress"),
|
|
3456
|
+
onSelect: (opt) => setStr("residentialAddress")(opt.label)
|
|
3457
|
+
}
|
|
3458
|
+
) }),
|
|
3459
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
3460
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Residential Status", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
3461
|
+
Select,
|
|
3462
|
+
{
|
|
3463
|
+
value: form.residentialStatus,
|
|
3464
|
+
onValueChange: setStr("residentialStatus"),
|
|
3465
|
+
children: [
|
|
3466
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectTrigger, { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectValue, { placeholder: "Select" }) }),
|
|
3467
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectContent, { children: RESIDENTIAL_STATUS_OPTIONS.map((o) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectItem, { value: o, children: o }, o)) })
|
|
3468
|
+
]
|
|
3469
|
+
}
|
|
3470
|
+
) }),
|
|
3471
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Time at Address", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex gap-2", children: [
|
|
3472
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center gap-1 flex-1", children: [
|
|
3473
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3474
|
+
Input,
|
|
3475
|
+
{
|
|
3476
|
+
type: "number",
|
|
3477
|
+
min: 0,
|
|
3478
|
+
value: form.timeAtAddressYears,
|
|
3479
|
+
onChange: (e) => setStr("timeAtAddressYears")(e.target.value),
|
|
3480
|
+
placeholder: "0"
|
|
3481
|
+
}
|
|
3482
|
+
),
|
|
3483
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "text-sm text-muted-foreground shrink-0", children: "yr" })
|
|
3484
|
+
] }),
|
|
3485
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center gap-1 flex-1", children: [
|
|
3486
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3487
|
+
Input,
|
|
3488
|
+
{
|
|
3489
|
+
type: "number",
|
|
3490
|
+
min: 0,
|
|
3491
|
+
max: 11,
|
|
3492
|
+
value: form.timeAtAddressMonths,
|
|
3493
|
+
onChange: (e) => setStr("timeAtAddressMonths")(e.target.value),
|
|
3494
|
+
placeholder: "0"
|
|
3495
|
+
}
|
|
3496
|
+
),
|
|
3497
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "text-sm text-muted-foreground shrink-0", children: "mo" })
|
|
3498
|
+
] })
|
|
3499
|
+
] }) })
|
|
3500
|
+
] }),
|
|
3501
|
+
parseInt(form.timeAtAddressYears || "99") < 2 && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Previous Address", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3502
|
+
AddressAutocomplete,
|
|
3503
|
+
{
|
|
3504
|
+
value: form.previousAddress,
|
|
3505
|
+
onValueChange: setStr("previousAddress"),
|
|
3506
|
+
onSelect: (opt) => setStr("previousAddress")(opt.label)
|
|
3507
|
+
}
|
|
3508
|
+
) }),
|
|
3509
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
3510
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Driver's Licence", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3511
|
+
Input,
|
|
3512
|
+
{
|
|
3513
|
+
value: form.driversLicence,
|
|
3514
|
+
onChange: (e) => setStr("driversLicence")(e.target.value),
|
|
3515
|
+
placeholder: "e.g. 12345678"
|
|
3516
|
+
}
|
|
3517
|
+
) }),
|
|
3518
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Passport Number", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3519
|
+
Input,
|
|
3520
|
+
{
|
|
3521
|
+
value: form.passport,
|
|
3522
|
+
onChange: (e) => setStr("passport")(e.target.value),
|
|
3523
|
+
placeholder: "e.g. PA1234567"
|
|
3524
|
+
}
|
|
3525
|
+
) })
|
|
3526
|
+
] }),
|
|
3527
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
3528
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Property in Trust", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
3529
|
+
Select,
|
|
3530
|
+
{
|
|
3531
|
+
value: form.propertyInTrust,
|
|
3532
|
+
onValueChange: setStr("propertyInTrust"),
|
|
3533
|
+
children: [
|
|
3534
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectTrigger, { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectValue, { placeholder: "Select" }) }),
|
|
3535
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectContent, { children: PROPERTY_IN_TRUST_OPTIONS.map((o) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectItem, { value: o, children: o }, o)) })
|
|
3536
|
+
]
|
|
3537
|
+
}
|
|
3538
|
+
) }),
|
|
3539
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Company Ownership", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
3540
|
+
Select,
|
|
3541
|
+
{
|
|
3542
|
+
value: form.companyOwnership,
|
|
3543
|
+
onValueChange: setStr("companyOwnership"),
|
|
3544
|
+
children: [
|
|
3545
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectTrigger, { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectValue, { placeholder: "Select" }) }),
|
|
3546
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectContent, { children: COMPANY_OWNERSHIP_OPTIONS.map((o) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectItem, { value: o, children: o }, o)) })
|
|
3547
|
+
]
|
|
3548
|
+
}
|
|
3549
|
+
) })
|
|
3550
|
+
] })
|
|
3551
|
+
] }),
|
|
3552
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(DialogFooter, { children: [
|
|
3553
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Button, { variant: "outline", onClick: () => onOpenChange(false), children: "Cancel" }),
|
|
3554
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3555
|
+
Button,
|
|
3556
|
+
{
|
|
3557
|
+
onClick: () => {
|
|
3558
|
+
onSave(form);
|
|
3559
|
+
onOpenChange(false);
|
|
3560
|
+
},
|
|
3561
|
+
children: "Save"
|
|
3562
|
+
}
|
|
3563
|
+
)
|
|
3564
|
+
] })
|
|
3565
|
+
] }) });
|
|
3566
|
+
}
|
|
3567
|
+
function EditIncomeModal({
|
|
3568
|
+
open,
|
|
3569
|
+
onOpenChange,
|
|
3570
|
+
applicantLabel = "Applicant",
|
|
3571
|
+
initialData,
|
|
3572
|
+
onSave,
|
|
3573
|
+
className
|
|
3574
|
+
}) {
|
|
3575
|
+
const defaultItems = React10.useMemo(
|
|
3576
|
+
() => {
|
|
3577
|
+
var _a;
|
|
3578
|
+
return ((_a = initialData == null ? void 0 : initialData.items) == null ? void 0 : _a.length) ? initialData.items : [makeDefaultIncomeItem()];
|
|
3579
|
+
},
|
|
3580
|
+
[]
|
|
3581
|
+
// eslint-disable-line react-hooks/exhaustive-deps
|
|
3582
|
+
);
|
|
3583
|
+
const [items, setItems] = React10.useState(defaultItems);
|
|
3584
|
+
React10.useEffect(() => {
|
|
3585
|
+
var _a;
|
|
3586
|
+
if (open) {
|
|
3587
|
+
setItems(
|
|
3588
|
+
((_a = initialData == null ? void 0 : initialData.items) == null ? void 0 : _a.length) ? initialData.items : [makeDefaultIncomeItem()]
|
|
3589
|
+
);
|
|
3590
|
+
}
|
|
3591
|
+
}, [open]);
|
|
3592
|
+
const updateItem = (id, key, val) => setItems(
|
|
3593
|
+
(prev) => prev.map((item) => item.id === id ? __spreadProps(__spreadValues({}, item), { [key]: val }) : item)
|
|
3594
|
+
);
|
|
3595
|
+
const removeItem = (id) => setItems((prev) => prev.filter((item) => item.id !== id));
|
|
3596
|
+
const addItem = () => setItems((prev) => [...prev, makeDefaultIncomeItem()]);
|
|
3597
|
+
const defaultOpenItems = items.length > 0 ? [items[0].id] : [];
|
|
3598
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Dialog, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(DialogContent, { className: cn("max-w-lg", className), children: [
|
|
3599
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DialogHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(DialogTitle, { children: [
|
|
3600
|
+
"Edit Income ",
|
|
3601
|
+
applicantLabel
|
|
3602
|
+
] }) }),
|
|
3603
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(ModalScroll, { children: [
|
|
3604
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3605
|
+
Accordion,
|
|
3606
|
+
{
|
|
3607
|
+
multiple: true,
|
|
3608
|
+
defaultValue: defaultOpenItems,
|
|
3609
|
+
className: "w-full",
|
|
3610
|
+
children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(AccordionItem, { value: item.id, children: [
|
|
3611
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3612
|
+
AccordionItemHeader,
|
|
3613
|
+
{
|
|
3614
|
+
label: `Income ${index + 1} \u2014 ${item.incomeType || "New Income"}`,
|
|
3615
|
+
onRemove: () => removeItem(item.id),
|
|
3616
|
+
removeLabel: "Remove income item"
|
|
3617
|
+
}
|
|
3618
|
+
),
|
|
3619
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(AccordionContent, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-col gap-4 pt-1", children: [
|
|
3620
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Income Type", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
3621
|
+
Select,
|
|
3622
|
+
{
|
|
3623
|
+
value: item.incomeType,
|
|
3624
|
+
onValueChange: (val) => updateItem(item.id, "incomeType", val),
|
|
3625
|
+
children: [
|
|
3626
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectTrigger, { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectValue, { placeholder: "Select type" }) }),
|
|
3627
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectContent, { children: INCOME_TYPES.map((t) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectItem, { value: t, children: t }, t)) })
|
|
3628
|
+
]
|
|
3629
|
+
}
|
|
3630
|
+
) }),
|
|
3631
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Job Title", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3632
|
+
Input,
|
|
3633
|
+
{
|
|
3634
|
+
value: item.jobTitle,
|
|
3635
|
+
onChange: (e) => updateItem(item.id, "jobTitle", e.target.value),
|
|
3636
|
+
placeholder: "Job title"
|
|
3637
|
+
}
|
|
3638
|
+
) }),
|
|
3639
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
3640
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Start Date", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3641
|
+
DatePicker,
|
|
3642
|
+
{
|
|
3643
|
+
value: item.startDate ? new Date(item.startDate) : void 0,
|
|
3644
|
+
onChange: (d) => updateItem(
|
|
3645
|
+
item.id,
|
|
3646
|
+
"startDate",
|
|
3647
|
+
d ? d.toISOString().slice(0, 10) : ""
|
|
3648
|
+
),
|
|
3649
|
+
calendarProps: {
|
|
3650
|
+
fromYear: 1950,
|
|
3651
|
+
toYear: (/* @__PURE__ */ new Date()).getFullYear()
|
|
3652
|
+
}
|
|
3653
|
+
}
|
|
3654
|
+
) }),
|
|
3655
|
+
!item.stillInPosition && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "End Date", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3656
|
+
DatePicker,
|
|
3657
|
+
{
|
|
3658
|
+
value: item.endDate ? new Date(item.endDate) : void 0,
|
|
3659
|
+
onChange: (d) => updateItem(
|
|
3660
|
+
item.id,
|
|
3661
|
+
"endDate",
|
|
3662
|
+
d ? d.toISOString().slice(0, 10) : ""
|
|
3663
|
+
),
|
|
3664
|
+
calendarProps: {
|
|
3665
|
+
fromYear: 1950,
|
|
3666
|
+
toYear: (/* @__PURE__ */ new Date()).getFullYear()
|
|
3667
|
+
}
|
|
3668
|
+
}
|
|
3669
|
+
) })
|
|
3670
|
+
] }),
|
|
3671
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
3672
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3673
|
+
Checkbox,
|
|
3674
|
+
{
|
|
3675
|
+
id: `still-in-position-${item.id}`,
|
|
3676
|
+
checked: item.stillInPosition,
|
|
3677
|
+
onCheckedChange: (checked) => updateItem(
|
|
3678
|
+
item.id,
|
|
3679
|
+
"stillInPosition",
|
|
3680
|
+
checked === true
|
|
3681
|
+
)
|
|
3682
|
+
}
|
|
3683
|
+
),
|
|
3684
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3685
|
+
"label",
|
|
3686
|
+
{
|
|
3687
|
+
htmlFor: `still-in-position-${item.id}`,
|
|
3688
|
+
className: "text-sm cursor-pointer select-none",
|
|
3689
|
+
children: "Still in position"
|
|
3690
|
+
}
|
|
3691
|
+
)
|
|
3692
|
+
] }),
|
|
3693
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Company Name", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3694
|
+
Input,
|
|
3695
|
+
{
|
|
3696
|
+
value: item.companyName,
|
|
3697
|
+
onChange: (e) => updateItem(item.id, "companyName", e.target.value),
|
|
3698
|
+
placeholder: "Company name"
|
|
3699
|
+
}
|
|
3700
|
+
) }),
|
|
3701
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Company Address", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3702
|
+
AddressAutocomplete,
|
|
3703
|
+
{
|
|
3704
|
+
value: item.companyAddress,
|
|
3705
|
+
onValueChange: (val) => updateItem(item.id, "companyAddress", val),
|
|
3706
|
+
placeholder: "Search company address"
|
|
3707
|
+
}
|
|
3708
|
+
) }),
|
|
3709
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-start gap-3", children: [
|
|
3710
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Income Amount", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3711
|
+
CurrencyInputWithSlider,
|
|
3712
|
+
{
|
|
3713
|
+
value: item.incomeAmount,
|
|
3714
|
+
min: 0,
|
|
3715
|
+
max: 1e6,
|
|
3716
|
+
step: 1e3,
|
|
3717
|
+
onValueChange: (val) => updateItem(item.id, "incomeAmount", val)
|
|
3718
|
+
}
|
|
3719
|
+
) }) }),
|
|
3720
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "shrink-0 mt-[1.625rem]", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3721
|
+
FrequencyToggle,
|
|
3722
|
+
{
|
|
3723
|
+
value: item.frequency,
|
|
3724
|
+
onValueChange: (val) => updateItem(item.id, "frequency", val)
|
|
3725
|
+
}
|
|
3726
|
+
) })
|
|
3727
|
+
] }),
|
|
3728
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Type of Company", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3729
|
+
RadioGroup,
|
|
3730
|
+
{
|
|
3731
|
+
value: item.companyType,
|
|
3732
|
+
onValueChange: (val) => updateItem(
|
|
3733
|
+
item.id,
|
|
3734
|
+
"companyType",
|
|
3735
|
+
val
|
|
3736
|
+
),
|
|
3737
|
+
className: "flex gap-4",
|
|
3738
|
+
children: ["Public", "Private"].map((opt) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
3739
|
+
"label",
|
|
3740
|
+
{
|
|
3741
|
+
className: "flex items-center gap-2 cursor-pointer text-sm",
|
|
3742
|
+
children: [
|
|
3743
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(RadioGroupItem, { value: opt }),
|
|
3744
|
+
opt
|
|
3745
|
+
]
|
|
3746
|
+
},
|
|
3747
|
+
opt
|
|
3748
|
+
))
|
|
3749
|
+
}
|
|
3750
|
+
) })
|
|
3751
|
+
] }) })
|
|
3752
|
+
] }, item.id))
|
|
3753
|
+
}
|
|
3754
|
+
),
|
|
3755
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
3756
|
+
Button,
|
|
3757
|
+
{
|
|
3758
|
+
variant: "outline",
|
|
3759
|
+
onClick: addItem,
|
|
3760
|
+
className: "w-full gap-1.5",
|
|
3761
|
+
children: [
|
|
3762
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react11.Plus, { className: "h-4 w-4" }),
|
|
3763
|
+
"Add More"
|
|
3764
|
+
]
|
|
3765
|
+
}
|
|
3766
|
+
)
|
|
3767
|
+
] }),
|
|
3768
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(DialogFooter, { children: [
|
|
3769
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Button, { variant: "outline", onClick: () => onOpenChange(false), children: "Cancel" }),
|
|
3770
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3771
|
+
Button,
|
|
3772
|
+
{
|
|
3773
|
+
onClick: () => {
|
|
3774
|
+
onSave({ items });
|
|
3775
|
+
onOpenChange(false);
|
|
3776
|
+
},
|
|
3777
|
+
children: "Save"
|
|
3778
|
+
}
|
|
3779
|
+
)
|
|
3780
|
+
] })
|
|
3781
|
+
] }) });
|
|
3782
|
+
}
|
|
3783
|
+
function EditExpensesModal({
|
|
3784
|
+
open,
|
|
3785
|
+
onOpenChange,
|
|
3786
|
+
applicantLabel = "Applicant",
|
|
3787
|
+
initialData,
|
|
3788
|
+
onSave,
|
|
3789
|
+
className
|
|
3790
|
+
}) {
|
|
3791
|
+
const defaultItems = React10.useMemo(
|
|
3792
|
+
() => {
|
|
3793
|
+
var _a;
|
|
3794
|
+
return ((_a = initialData == null ? void 0 : initialData.items) == null ? void 0 : _a.length) ? initialData.items : [makeDefaultExpenseItem()];
|
|
3795
|
+
},
|
|
3796
|
+
[]
|
|
3797
|
+
// eslint-disable-line react-hooks/exhaustive-deps
|
|
3798
|
+
);
|
|
3799
|
+
const [items, setItems] = React10.useState(defaultItems);
|
|
3800
|
+
React10.useEffect(() => {
|
|
3801
|
+
var _a;
|
|
3802
|
+
if (open) {
|
|
3803
|
+
setItems(
|
|
3804
|
+
((_a = initialData == null ? void 0 : initialData.items) == null ? void 0 : _a.length) ? initialData.items : [makeDefaultExpenseItem()]
|
|
3805
|
+
);
|
|
3806
|
+
}
|
|
3807
|
+
}, [open]);
|
|
3808
|
+
const updateItem = (id, key, val) => setItems(
|
|
3809
|
+
(prev) => prev.map((item) => item.id === id ? __spreadProps(__spreadValues({}, item), { [key]: val }) : item)
|
|
3810
|
+
);
|
|
3811
|
+
const removeItem = (id) => setItems((prev) => prev.filter((item) => item.id !== id));
|
|
3812
|
+
const addItem = () => setItems((prev) => [...prev, makeDefaultExpenseItem()]);
|
|
3813
|
+
const defaultOpenItems = items.length > 0 ? [items[0].id] : [];
|
|
3814
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Dialog, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(DialogContent, { className: cn("max-w-lg", className), children: [
|
|
3815
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DialogHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(DialogTitle, { children: [
|
|
3816
|
+
"Edit Expenses ",
|
|
3817
|
+
applicantLabel
|
|
3818
|
+
] }) }),
|
|
3819
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(ModalScroll, { children: [
|
|
3820
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3821
|
+
Accordion,
|
|
3822
|
+
{
|
|
3823
|
+
multiple: true,
|
|
3824
|
+
defaultValue: defaultOpenItems,
|
|
3825
|
+
className: "w-full",
|
|
3826
|
+
children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(AccordionItem, { value: item.id, children: [
|
|
3827
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3828
|
+
AccordionItemHeader,
|
|
3829
|
+
{
|
|
3830
|
+
label: `Expense ${index + 1} \u2014 ${item.expenseType || "New Expense"}`,
|
|
3831
|
+
onRemove: () => removeItem(item.id),
|
|
3832
|
+
removeLabel: "Remove expense item"
|
|
3833
|
+
}
|
|
3834
|
+
),
|
|
3835
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(AccordionContent, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-col gap-4 pt-1", children: [
|
|
3836
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Expense Type", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
3837
|
+
Select,
|
|
3838
|
+
{
|
|
3839
|
+
value: item.expenseType,
|
|
3840
|
+
onValueChange: (val) => updateItem(item.id, "expenseType", val),
|
|
3841
|
+
children: [
|
|
3842
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectTrigger, { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectValue, { placeholder: "Select type" }) }),
|
|
3843
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectContent, { children: EXPENSE_TYPES.map((t) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectItem, { value: t, children: t }, t)) })
|
|
3844
|
+
]
|
|
3845
|
+
}
|
|
3846
|
+
) }),
|
|
3847
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-start gap-3", children: [
|
|
3848
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Amount", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3849
|
+
CurrencyInputWithSlider,
|
|
3850
|
+
{
|
|
3851
|
+
value: item.amount,
|
|
3852
|
+
min: 0,
|
|
3853
|
+
max: 1e5,
|
|
3854
|
+
step: 100,
|
|
3855
|
+
onValueChange: (val) => updateItem(item.id, "amount", val)
|
|
3856
|
+
}
|
|
3857
|
+
) }) }),
|
|
3858
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "shrink-0 mt-[1.625rem]", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3859
|
+
FrequencyToggle,
|
|
3860
|
+
{
|
|
3861
|
+
value: item.frequency,
|
|
3862
|
+
onValueChange: (val) => updateItem(item.id, "frequency", val)
|
|
3863
|
+
}
|
|
3864
|
+
) })
|
|
3865
|
+
] }),
|
|
3866
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormField, { label: "Ownership (%)", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3867
|
+
OwnershipSplit,
|
|
3868
|
+
{
|
|
3869
|
+
owners: [
|
|
3870
|
+
{
|
|
3871
|
+
id: "main",
|
|
3872
|
+
name: "Main Applicant",
|
|
3873
|
+
share: item.mainShare
|
|
3874
|
+
},
|
|
3875
|
+
{
|
|
3876
|
+
id: "co",
|
|
3877
|
+
name: "Co-Applicant",
|
|
3878
|
+
share: item.coShare
|
|
3879
|
+
}
|
|
3880
|
+
],
|
|
3881
|
+
onOwnersChange: (owners) => {
|
|
3882
|
+
var _a, _b, _c, _d;
|
|
3883
|
+
const main = (_b = (_a = owners.find((o) => o.id === "main")) == null ? void 0 : _a.share) != null ? _b : item.mainShare;
|
|
3884
|
+
const co = (_d = (_c = owners.find((o) => o.id === "co")) == null ? void 0 : _c.share) != null ? _d : item.coShare;
|
|
3885
|
+
updateItem(item.id, "mainShare", main);
|
|
3886
|
+
updateItem(item.id, "coShare", co);
|
|
3887
|
+
}
|
|
3888
|
+
}
|
|
3889
|
+
) })
|
|
3890
|
+
] }) })
|
|
3891
|
+
] }, item.id))
|
|
3892
|
+
}
|
|
3893
|
+
),
|
|
3894
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
3895
|
+
Button,
|
|
3896
|
+
{
|
|
3897
|
+
variant: "outline",
|
|
3898
|
+
onClick: addItem,
|
|
3899
|
+
className: "w-full gap-1.5",
|
|
3900
|
+
children: [
|
|
3901
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react11.Plus, { className: "h-4 w-4" }),
|
|
3902
|
+
"Add More"
|
|
3903
|
+
]
|
|
3904
|
+
}
|
|
3905
|
+
)
|
|
3906
|
+
] }),
|
|
3907
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(DialogFooter, { children: [
|
|
3908
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Button, { variant: "outline", onClick: () => onOpenChange(false), children: "Cancel" }),
|
|
3909
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3910
|
+
Button,
|
|
3911
|
+
{
|
|
3912
|
+
onClick: () => {
|
|
3913
|
+
onSave({ items });
|
|
3914
|
+
onOpenChange(false);
|
|
3915
|
+
},
|
|
3916
|
+
children: "Save"
|
|
3917
|
+
}
|
|
3918
|
+
)
|
|
3919
|
+
] })
|
|
3920
|
+
] }) });
|
|
3921
|
+
}
|
|
3922
|
+
|
|
3923
|
+
// src/components/ui/opportunity-summary-tab.tsx
|
|
3924
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
3925
|
+
function formatCurrency(n) {
|
|
3926
|
+
return "$" + n.toLocaleString("en-AU");
|
|
3927
|
+
}
|
|
3928
|
+
function toMonthly(amount, freq) {
|
|
3929
|
+
return freq === "Monthly" ? amount : amount * 52 / 12;
|
|
3930
|
+
}
|
|
3931
|
+
function TriggerEditButton({
|
|
3932
|
+
onClick,
|
|
3933
|
+
title = "Edit"
|
|
3934
|
+
}) {
|
|
3935
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3936
|
+
"button",
|
|
3937
|
+
{
|
|
3938
|
+
type: "button",
|
|
3939
|
+
className: "ml-auto mr-2 inline-flex size-6 shrink-0 items-center justify-center text-muted-foreground hover:text-foreground",
|
|
3940
|
+
onClick: (e) => {
|
|
3941
|
+
e.stopPropagation();
|
|
3942
|
+
onClick();
|
|
3943
|
+
},
|
|
3944
|
+
"aria-label": title,
|
|
3945
|
+
title,
|
|
3946
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.Pencil, { className: "size-3.5" })
|
|
3947
|
+
}
|
|
3948
|
+
);
|
|
3949
|
+
}
|
|
3950
|
+
function ApplicantAccordionTab({
|
|
3951
|
+
accordionPrefix,
|
|
3952
|
+
about,
|
|
3953
|
+
income,
|
|
3954
|
+
expenses,
|
|
3955
|
+
onEditAbout,
|
|
3956
|
+
onEditIncome,
|
|
3957
|
+
onEditExpenses
|
|
3958
|
+
}) {
|
|
3959
|
+
const totalMonthlyIncome = formatCurrency(
|
|
3960
|
+
income.items.reduce(
|
|
3961
|
+
(sum, i) => sum + toMonthly(i.incomeAmount, i.frequency),
|
|
3962
|
+
0
|
|
3963
|
+
)
|
|
3964
|
+
);
|
|
3965
|
+
const totalMonthlyExpenses = formatCurrency(
|
|
3966
|
+
expenses.items.reduce(
|
|
3967
|
+
(sum, e) => sum + toMonthly(e.amount, e.frequency),
|
|
3968
|
+
0
|
|
3969
|
+
)
|
|
3970
|
+
);
|
|
3971
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
3972
|
+
Accordion,
|
|
3973
|
+
{
|
|
3974
|
+
openMultiple: true,
|
|
3975
|
+
defaultValue: [
|
|
3976
|
+
`${accordionPrefix}-about`,
|
|
3977
|
+
`${accordionPrefix}-income`,
|
|
3978
|
+
`${accordionPrefix}-expenses`
|
|
3979
|
+
],
|
|
3980
|
+
children: [
|
|
3981
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(AccordionItem, { value: `${accordionPrefix}-about`, children: [
|
|
3982
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(AccordionTrigger, { children: [
|
|
3983
|
+
"About",
|
|
3984
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TriggerEditButton, { onClick: onEditAbout })
|
|
3985
|
+
] }),
|
|
3986
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(AccordionContent, { className: "text-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3987
|
+
AboutCard,
|
|
3988
|
+
{
|
|
3989
|
+
title: about.title,
|
|
3990
|
+
firstName: about.firstName,
|
|
3991
|
+
lastName: about.lastName,
|
|
3992
|
+
phone: about.phone,
|
|
3993
|
+
email: about.email,
|
|
3994
|
+
gender: about.gender,
|
|
3995
|
+
maritalStatus: about.maritalStatus,
|
|
3996
|
+
citizenStatus: about.citizenStatus,
|
|
3997
|
+
propertyInTrust: about.propertyInTrust,
|
|
3998
|
+
companyOwnership: about.companyOwnership
|
|
3999
|
+
}
|
|
4000
|
+
) })
|
|
4001
|
+
] }),
|
|
4002
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(AccordionItem, { value: `${accordionPrefix}-income`, children: [
|
|
4003
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(AccordionTrigger, { children: [
|
|
4004
|
+
"Income",
|
|
4005
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TriggerEditButton, { onClick: onEditIncome })
|
|
4006
|
+
] }),
|
|
4007
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(AccordionContent, { className: "text-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4008
|
+
IncomeCard,
|
|
4009
|
+
{
|
|
4010
|
+
items: income.items.map((i) => ({
|
|
4011
|
+
incomeType: i.incomeType,
|
|
4012
|
+
jobTitle: i.jobTitle,
|
|
4013
|
+
companyName: i.companyName,
|
|
4014
|
+
amountLabel: `${formatCurrency(i.incomeAmount)} / ${i.frequency}`
|
|
4015
|
+
})),
|
|
4016
|
+
totalMonthly: totalMonthlyIncome
|
|
4017
|
+
}
|
|
4018
|
+
) })
|
|
4019
|
+
] }),
|
|
4020
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(AccordionItem, { value: `${accordionPrefix}-expenses`, children: [
|
|
4021
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(AccordionTrigger, { children: [
|
|
4022
|
+
"Expenses",
|
|
4023
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TriggerEditButton, { onClick: onEditExpenses })
|
|
4024
|
+
] }),
|
|
4025
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(AccordionContent, { className: "text-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4026
|
+
ExpensesCard,
|
|
4027
|
+
{
|
|
4028
|
+
items: expenses.items.map((e) => ({
|
|
4029
|
+
expenseType: e.expenseType,
|
|
4030
|
+
amountLabel: `${formatCurrency(e.amount)} / ${e.frequency}`
|
|
4031
|
+
})),
|
|
4032
|
+
totalMonthly: totalMonthlyExpenses
|
|
4033
|
+
}
|
|
4034
|
+
) })
|
|
4035
|
+
] })
|
|
4036
|
+
]
|
|
4037
|
+
}
|
|
4038
|
+
);
|
|
4039
|
+
}
|
|
4040
|
+
function OpportunitySummaryTab({
|
|
4041
|
+
isJoint = false,
|
|
4042
|
+
loanScenario,
|
|
4043
|
+
onLoanScenarioChange,
|
|
4044
|
+
assets,
|
|
4045
|
+
onAssetsChange,
|
|
4046
|
+
debts,
|
|
4047
|
+
onDebtsChange,
|
|
4048
|
+
mainAbout,
|
|
4049
|
+
onMainAboutChange,
|
|
4050
|
+
mainIncome,
|
|
4051
|
+
onMainIncomeChange,
|
|
4052
|
+
mainExpenses,
|
|
4053
|
+
onMainExpensesChange,
|
|
4054
|
+
coAbout,
|
|
4055
|
+
onCoAboutChange,
|
|
4056
|
+
coIncome,
|
|
4057
|
+
onCoIncomeChange,
|
|
4058
|
+
coExpenses,
|
|
4059
|
+
onCoExpensesChange
|
|
4060
|
+
}) {
|
|
4061
|
+
var _a, _b;
|
|
4062
|
+
const [summarySubTab, setSummarySubTab] = (0, import_react5.useState)(
|
|
4063
|
+
"joint"
|
|
4064
|
+
);
|
|
4065
|
+
const [editLoanOpen, setEditLoanOpen] = (0, import_react5.useState)(false);
|
|
4066
|
+
const [editAssetsOpen, setEditAssetsOpen] = (0, import_react5.useState)(false);
|
|
4067
|
+
const [editDebtsOpen, setEditDebtsOpen] = (0, import_react5.useState)(false);
|
|
4068
|
+
const [editMainAboutOpen, setEditMainAboutOpen] = (0, import_react5.useState)(false);
|
|
4069
|
+
const [editCoAboutOpen, setEditCoAboutOpen] = (0, import_react5.useState)(false);
|
|
4070
|
+
const [editMainIncomeOpen, setEditMainIncomeOpen] = (0, import_react5.useState)(false);
|
|
4071
|
+
const [editCoIncomeOpen, setEditCoIncomeOpen] = (0, import_react5.useState)(false);
|
|
4072
|
+
const [editMainExpensesOpen, setEditMainExpensesOpen] = (0, import_react5.useState)(false);
|
|
4073
|
+
const [editCoExpensesOpen, setEditCoExpensesOpen] = (0, import_react5.useState)(false);
|
|
4074
|
+
const totalAssetsAmount = assets.reduce((sum, a) => sum + a.value, 0);
|
|
4075
|
+
const totalDebtsAmount = debts.reduce((sum, d) => sum + d.amountOwing, 0);
|
|
4076
|
+
const totalAssets = formatCurrency(totalAssetsAmount);
|
|
4077
|
+
const totalDebts = formatCurrency(totalDebtsAmount);
|
|
4078
|
+
const allIncomeItems = [...mainIncome.items, ...(_a = coIncome == null ? void 0 : coIncome.items) != null ? _a : []];
|
|
4079
|
+
const allExpenseItems = [...mainExpenses.items, ...(_b = coExpenses == null ? void 0 : coExpenses.items) != null ? _b : []];
|
|
4080
|
+
const combinedMonthlyIncome = allIncomeItems.reduce(
|
|
4081
|
+
(sum, i) => sum + toMonthly(i.incomeAmount, i.frequency),
|
|
4082
|
+
0
|
|
4083
|
+
);
|
|
4084
|
+
const combinedMonthlyExpenses = allExpenseItems.reduce(
|
|
4085
|
+
(sum, e) => sum + toMonthly(e.amount, e.frequency),
|
|
4086
|
+
0
|
|
4087
|
+
);
|
|
4088
|
+
const netSurplus = combinedMonthlyIncome - combinedMonthlyExpenses;
|
|
4089
|
+
const mainName = [mainAbout.firstName, mainAbout.lastName].filter(Boolean).join(" ");
|
|
4090
|
+
const coName = coAbout ? [coAbout.firstName, coAbout.lastName].filter(Boolean).join(" ") : "Co-Applicant";
|
|
4091
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
|
|
4092
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Accordion, { openMultiple: true, defaultValue: ["loan-app"], children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(AccordionItem, { value: "loan-app", children: [
|
|
4093
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(AccordionTrigger, { children: [
|
|
4094
|
+
"Loan Application",
|
|
4095
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TriggerEditButton, { onClick: () => setEditLoanOpen(true) })
|
|
4096
|
+
] }),
|
|
4097
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(AccordionContent, { className: "text-foreground", children: [
|
|
4098
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4099
|
+
LoanScenarioSection,
|
|
4100
|
+
{
|
|
4101
|
+
lendingType: "Home Loan",
|
|
4102
|
+
purposeOfLoan: loanScenario.loanPurpose,
|
|
4103
|
+
loanAmount: formatCurrency(loanScenario.loanAmount),
|
|
4104
|
+
propertyEstimate: formatCurrency(loanScenario.propertyEstimate),
|
|
4105
|
+
estLvr: "\u2014",
|
|
4106
|
+
cashDeposit: formatCurrency(loanScenario.cashEquity),
|
|
4107
|
+
propertyAddress: "\u2014",
|
|
4108
|
+
duration: `${loanScenario.loanDuration} years`,
|
|
4109
|
+
importantFeatures: [
|
|
4110
|
+
loanScenario.featureVariableRate && "Variable Rate",
|
|
4111
|
+
loanScenario.featureFixedRate && "Fixed Rate",
|
|
4112
|
+
loanScenario.featureRedrawFacility && "Redraw Facility",
|
|
4113
|
+
loanScenario.feature100Offset && "100% Offset",
|
|
4114
|
+
loanScenario.featureSplitLoan && "Split Loan",
|
|
4115
|
+
loanScenario.featureInterestOnly && "Interest Only"
|
|
4116
|
+
].filter(Boolean).join(", ") || "\u2014",
|
|
4117
|
+
topThreePriorities: loanScenario.priorities.join(", ") || "\u2014"
|
|
4118
|
+
}
|
|
4119
|
+
),
|
|
4120
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "mt-4 flex gap-4", children: [
|
|
4121
|
+
{ label: "Number of Applicants", value: isJoint ? "2" : "1" },
|
|
4122
|
+
{ label: "Dependants", value: "1" }
|
|
4123
|
+
].map(({ label, value }) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
4124
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "text-label-small uppercase text-muted-foreground", children: label }),
|
|
4125
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "border border-border px-4 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "text-label-medium text-foreground", children: value }) })
|
|
4126
|
+
] }, label)) })
|
|
4127
|
+
] })
|
|
4128
|
+
] }) }),
|
|
4129
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
4130
|
+
Tabs,
|
|
4131
|
+
{
|
|
4132
|
+
value: summarySubTab,
|
|
4133
|
+
onValueChange: (v) => setSummarySubTab(v),
|
|
4134
|
+
className: "pb-6",
|
|
4135
|
+
children: [
|
|
4136
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "sticky top-0 z-10 bg-background pb-1 pt-2", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(TabsList, { variant: "line", children: [
|
|
4137
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TabsTrigger, { value: "joint", children: "Joint" }),
|
|
4138
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TabsTrigger, { value: "main", children: mainName }),
|
|
4139
|
+
isJoint && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TabsTrigger, { value: "co", children: coName })
|
|
4140
|
+
] }) }),
|
|
4141
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TabsContent, { value: "joint", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
4142
|
+
Accordion,
|
|
4143
|
+
{
|
|
4144
|
+
openMultiple: true,
|
|
4145
|
+
defaultValue: ["joint-overview", "joint-documents"],
|
|
4146
|
+
children: [
|
|
4147
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(AccordionItem, { value: "joint-overview", children: [
|
|
4148
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(AccordionTrigger, { children: [
|
|
4149
|
+
"Financial Overview",
|
|
4150
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "ml-auto mr-2 flex items-center gap-0.5", children: [
|
|
4151
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4152
|
+
"button",
|
|
4153
|
+
{
|
|
4154
|
+
type: "button",
|
|
4155
|
+
className: "inline-flex size-6 shrink-0 items-center justify-center text-muted-foreground hover:text-foreground",
|
|
4156
|
+
onClick: (e) => {
|
|
4157
|
+
e.stopPropagation();
|
|
4158
|
+
setEditAssetsOpen(true);
|
|
4159
|
+
},
|
|
4160
|
+
"aria-label": "Edit Assets",
|
|
4161
|
+
title: "Edit Assets",
|
|
4162
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.Pencil, { className: "size-3.5" })
|
|
4163
|
+
}
|
|
4164
|
+
),
|
|
4165
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4166
|
+
"button",
|
|
4167
|
+
{
|
|
4168
|
+
type: "button",
|
|
4169
|
+
className: "inline-flex size-6 shrink-0 items-center justify-center text-muted-foreground hover:text-foreground",
|
|
4170
|
+
onClick: (e) => {
|
|
4171
|
+
e.stopPropagation();
|
|
4172
|
+
setEditDebtsOpen(true);
|
|
4173
|
+
},
|
|
4174
|
+
"aria-label": "Edit Debts",
|
|
4175
|
+
title: "Edit Debts",
|
|
4176
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.Pencil, { className: "size-3.5" })
|
|
4177
|
+
}
|
|
4178
|
+
)
|
|
4179
|
+
] })
|
|
4180
|
+
] }),
|
|
4181
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(AccordionContent, { className: "text-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4182
|
+
FinancialBottomSummary,
|
|
4183
|
+
{
|
|
4184
|
+
cashflowItems: [
|
|
4185
|
+
{
|
|
4186
|
+
label: "Monthly Combined Income",
|
|
4187
|
+
value: formatCurrency(Math.round(combinedMonthlyIncome))
|
|
4188
|
+
},
|
|
4189
|
+
{
|
|
4190
|
+
label: "Monthly Combined Expenses",
|
|
4191
|
+
value: formatCurrency(
|
|
4192
|
+
Math.round(combinedMonthlyExpenses)
|
|
4193
|
+
),
|
|
4194
|
+
destructive: true
|
|
4195
|
+
}
|
|
4196
|
+
],
|
|
4197
|
+
netSurplus: formatCurrency(Math.abs(Math.round(netSurplus))),
|
|
4198
|
+
netSurplusDestructive: netSurplus < 0,
|
|
4199
|
+
assetItems: assets.map((a) => ({
|
|
4200
|
+
label: a.assetType,
|
|
4201
|
+
value: formatCurrency(a.value)
|
|
4202
|
+
})),
|
|
4203
|
+
totalAssets,
|
|
4204
|
+
totalLiabilities: totalDebts,
|
|
4205
|
+
netPosition: formatCurrency(
|
|
4206
|
+
Math.abs(Math.round(totalAssetsAmount - totalDebtsAmount))
|
|
4207
|
+
),
|
|
4208
|
+
netPositionDestructive: totalAssetsAmount < totalDebtsAmount
|
|
4209
|
+
}
|
|
4210
|
+
) })
|
|
4211
|
+
] }),
|
|
4212
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(AccordionItem, { value: "joint-documents", children: [
|
|
4213
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(AccordionTrigger, { children: "Documents" }),
|
|
4214
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(AccordionContent, { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "text-sm text-muted-foreground", children: "No documents uploaded yet." }) })
|
|
4215
|
+
] })
|
|
4216
|
+
]
|
|
4217
|
+
}
|
|
4218
|
+
) }),
|
|
4219
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TabsContent, { value: "main", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4220
|
+
ApplicantAccordionTab,
|
|
4221
|
+
{
|
|
4222
|
+
accordionPrefix: "main",
|
|
4223
|
+
about: mainAbout,
|
|
4224
|
+
income: mainIncome,
|
|
4225
|
+
expenses: mainExpenses,
|
|
4226
|
+
onEditAbout: () => setEditMainAboutOpen(true),
|
|
4227
|
+
onEditIncome: () => setEditMainIncomeOpen(true),
|
|
4228
|
+
onEditExpenses: () => setEditMainExpensesOpen(true)
|
|
4229
|
+
}
|
|
4230
|
+
) }),
|
|
4231
|
+
isJoint && coAbout && coIncome && coExpenses && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TabsContent, { value: "co", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4232
|
+
ApplicantAccordionTab,
|
|
4233
|
+
{
|
|
4234
|
+
accordionPrefix: "co",
|
|
4235
|
+
about: coAbout,
|
|
4236
|
+
income: coIncome,
|
|
4237
|
+
expenses: coExpenses,
|
|
4238
|
+
onEditAbout: () => setEditCoAboutOpen(true),
|
|
4239
|
+
onEditIncome: () => setEditCoIncomeOpen(true),
|
|
4240
|
+
onEditExpenses: () => setEditCoExpensesOpen(true)
|
|
4241
|
+
}
|
|
4242
|
+
) })
|
|
4243
|
+
]
|
|
4244
|
+
}
|
|
4245
|
+
),
|
|
4246
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4247
|
+
EditLoanScenarioModal,
|
|
4248
|
+
{
|
|
4249
|
+
open: editLoanOpen,
|
|
4250
|
+
onOpenChange: setEditLoanOpen,
|
|
4251
|
+
initialData: loanScenario,
|
|
4252
|
+
onSave: (data) => {
|
|
4253
|
+
onLoanScenarioChange == null ? void 0 : onLoanScenarioChange(data);
|
|
4254
|
+
setEditLoanOpen(false);
|
|
4255
|
+
}
|
|
4256
|
+
}
|
|
4257
|
+
),
|
|
4258
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4259
|
+
EditAssetsModal,
|
|
4260
|
+
{
|
|
4261
|
+
open: editAssetsOpen,
|
|
4262
|
+
onOpenChange: setEditAssetsOpen,
|
|
4263
|
+
initialItems: assets,
|
|
4264
|
+
onSave: (items) => {
|
|
4265
|
+
onAssetsChange == null ? void 0 : onAssetsChange(items);
|
|
4266
|
+
setEditAssetsOpen(false);
|
|
4267
|
+
}
|
|
4268
|
+
}
|
|
4269
|
+
),
|
|
4270
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4271
|
+
EditDebtsModal,
|
|
4272
|
+
{
|
|
4273
|
+
open: editDebtsOpen,
|
|
4274
|
+
onOpenChange: setEditDebtsOpen,
|
|
4275
|
+
initialItems: debts,
|
|
4276
|
+
onSave: (items) => {
|
|
4277
|
+
onDebtsChange == null ? void 0 : onDebtsChange(items);
|
|
4278
|
+
setEditDebtsOpen(false);
|
|
4279
|
+
}
|
|
4280
|
+
}
|
|
4281
|
+
),
|
|
4282
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4283
|
+
EditAboutApplicantModal,
|
|
4284
|
+
{
|
|
4285
|
+
open: editMainAboutOpen,
|
|
4286
|
+
onOpenChange: setEditMainAboutOpen,
|
|
4287
|
+
applicantLabel: "Main Applicant",
|
|
4288
|
+
initialData: mainAbout,
|
|
4289
|
+
onSave: (data) => {
|
|
4290
|
+
onMainAboutChange == null ? void 0 : onMainAboutChange(data);
|
|
4291
|
+
setEditMainAboutOpen(false);
|
|
4292
|
+
}
|
|
4293
|
+
}
|
|
4294
|
+
),
|
|
4295
|
+
coAbout && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4296
|
+
EditAboutApplicantModal,
|
|
4297
|
+
{
|
|
4298
|
+
open: editCoAboutOpen,
|
|
4299
|
+
onOpenChange: setEditCoAboutOpen,
|
|
4300
|
+
applicantLabel: "Co-Applicant",
|
|
4301
|
+
initialData: coAbout,
|
|
4302
|
+
onSave: (data) => {
|
|
4303
|
+
onCoAboutChange == null ? void 0 : onCoAboutChange(data);
|
|
4304
|
+
setEditCoAboutOpen(false);
|
|
4305
|
+
}
|
|
4306
|
+
}
|
|
4307
|
+
),
|
|
4308
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4309
|
+
EditIncomeModal,
|
|
4310
|
+
{
|
|
4311
|
+
open: editMainIncomeOpen,
|
|
4312
|
+
onOpenChange: setEditMainIncomeOpen,
|
|
4313
|
+
applicantLabel: "Main Applicant",
|
|
4314
|
+
initialData: mainIncome,
|
|
4315
|
+
onSave: (data) => {
|
|
4316
|
+
onMainIncomeChange == null ? void 0 : onMainIncomeChange(data);
|
|
4317
|
+
setEditMainIncomeOpen(false);
|
|
4318
|
+
}
|
|
4319
|
+
}
|
|
4320
|
+
),
|
|
4321
|
+
coIncome && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4322
|
+
EditIncomeModal,
|
|
4323
|
+
{
|
|
4324
|
+
open: editCoIncomeOpen,
|
|
4325
|
+
onOpenChange: setEditCoIncomeOpen,
|
|
4326
|
+
applicantLabel: "Co-Applicant",
|
|
4327
|
+
initialData: coIncome,
|
|
4328
|
+
onSave: (data) => {
|
|
4329
|
+
onCoIncomeChange == null ? void 0 : onCoIncomeChange(data);
|
|
4330
|
+
setEditCoIncomeOpen(false);
|
|
4331
|
+
}
|
|
4332
|
+
}
|
|
4333
|
+
),
|
|
4334
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4335
|
+
EditExpensesModal,
|
|
4336
|
+
{
|
|
4337
|
+
open: editMainExpensesOpen,
|
|
4338
|
+
onOpenChange: setEditMainExpensesOpen,
|
|
4339
|
+
applicantLabel: "Main Applicant",
|
|
4340
|
+
initialData: mainExpenses,
|
|
4341
|
+
onSave: (data) => {
|
|
4342
|
+
onMainExpensesChange == null ? void 0 : onMainExpensesChange(data);
|
|
4343
|
+
setEditMainExpensesOpen(false);
|
|
4344
|
+
}
|
|
4345
|
+
}
|
|
4346
|
+
),
|
|
4347
|
+
coExpenses && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4348
|
+
EditExpensesModal,
|
|
4349
|
+
{
|
|
4350
|
+
open: editCoExpensesOpen,
|
|
4351
|
+
onOpenChange: setEditCoExpensesOpen,
|
|
4352
|
+
applicantLabel: "Co-Applicant",
|
|
4353
|
+
initialData: coExpenses,
|
|
4354
|
+
onSave: (data) => {
|
|
4355
|
+
onCoExpensesChange == null ? void 0 : onCoExpensesChange(data);
|
|
4356
|
+
setEditCoExpensesOpen(false);
|
|
4357
|
+
}
|
|
4358
|
+
}
|
|
4359
|
+
)
|
|
4360
|
+
] });
|
|
4361
|
+
}
|
|
4362
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
4363
|
+
0 && (module.exports = {
|
|
4364
|
+
OpportunitySummaryTab
|
|
4365
|
+
});
|