@paro.io/expert-shared-components 1.14.61 → 1.14.62
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.
|
@@ -273,7 +273,7 @@ const TaxAxisShell = ({ taxAxisApi, userContext = 'expert', initialSessionId, in
|
|
|
273
273
|
setGenerating(true);
|
|
274
274
|
try {
|
|
275
275
|
const input = buildProspectInput(nextProfile);
|
|
276
|
-
const result = yield taxAxisApi.generateProspectReport(input);
|
|
276
|
+
const result = yield taxAxisApi.generateProspectReport(Object.assign(Object.assign({}, input), { freelancerId: sessionDefaults === null || sessionDefaults === void 0 ? void 0 : sessionDefaults.freelancerId }));
|
|
277
277
|
if (result) {
|
|
278
278
|
setBackendResults(result);
|
|
279
279
|
}
|
|
@@ -284,7 +284,7 @@ const TaxAxisShell = ({ taxAxisApi, userContext = 'expert', initialSessionId, in
|
|
|
284
284
|
setGenerating(false);
|
|
285
285
|
}
|
|
286
286
|
setStep('PROSPECT_REPORT');
|
|
287
|
-
}), [taxAxisApi]);
|
|
287
|
+
}), [taxAxisApi, sessionDefaults === null || sessionDefaults === void 0 ? void 0 : sessionDefaults.freelancerId]);
|
|
288
288
|
const handleFullAnalysis = (0, react_1.useCallback)((nextProfile) => __awaiter(void 0, void 0, void 0, function* () {
|
|
289
289
|
setProfile(nextProfile);
|
|
290
290
|
setIsProspectFlow(false);
|
|
@@ -34,6 +34,38 @@ const RefineAnalysisSection_1 = require("./RefineAnalysisSection");
|
|
|
34
34
|
const CpaIntakeQuestionsSection_1 = require("./CpaIntakeQuestionsSection");
|
|
35
35
|
const StrategyRadar_1 = require("./StrategyRadar");
|
|
36
36
|
const IntakeCtaCards_1 = require("./IntakeCtaCards");
|
|
37
|
+
const DEMO_PROFILE = {
|
|
38
|
+
bizName: "Meridian Consulting Group, Inc.",
|
|
39
|
+
cpaName: "Sarah Chen, EA",
|
|
40
|
+
entity: "S-Corporation",
|
|
41
|
+
industry: "Professional Services",
|
|
42
|
+
period: "Full Year",
|
|
43
|
+
revenue: "2850000",
|
|
44
|
+
ownerComp: "185000",
|
|
45
|
+
employees: "14",
|
|
46
|
+
year: "2025",
|
|
47
|
+
states: ["IL"],
|
|
48
|
+
filingStatus: "MFJ",
|
|
49
|
+
age: "45",
|
|
50
|
+
sstb: "No",
|
|
51
|
+
ownsRealEstate: "Yes — Commercial",
|
|
52
|
+
itemizesDeductions: "Yes",
|
|
53
|
+
singleOwner: "Yes",
|
|
54
|
+
netIncome: "142000",
|
|
55
|
+
equipmentPurchased: "75000",
|
|
56
|
+
capitalGains: "50000",
|
|
57
|
+
federalRate: "24%",
|
|
58
|
+
stateRate: "4.95",
|
|
59
|
+
taxDataYears: "1 year",
|
|
60
|
+
riskTolerance: "3",
|
|
61
|
+
overtimePremium: "0",
|
|
62
|
+
tipIncomePct: "0",
|
|
63
|
+
retirementContributions: "22500",
|
|
64
|
+
hdhpEnrolled: "Yes",
|
|
65
|
+
hsaContributions: "0",
|
|
66
|
+
wotcHires: "Yes — Form 8850 submitted",
|
|
67
|
+
familyEmployed: "Yes",
|
|
68
|
+
};
|
|
37
69
|
/** Returns a list of human-readable labels for missing required fields. */
|
|
38
70
|
function getMissingFields(p) {
|
|
39
71
|
const missing = [];
|
|
@@ -43,12 +75,9 @@ function getMissingFields(p) {
|
|
|
43
75
|
missing.push("State");
|
|
44
76
|
if (!p.revenue || (0, compute_1.parseNum)(p.revenue) <= 0)
|
|
45
77
|
missing.push("Revenue");
|
|
46
|
-
const
|
|
47
|
-
if (!
|
|
78
|
+
const fedStr = String(p.federalRate || "0").replace("%", "");
|
|
79
|
+
if (!parseFloat(fedStr) || parseFloat(fedStr) <= 0)
|
|
48
80
|
missing.push("Federal Rate");
|
|
49
|
-
const statePct = parseFloat((p.stateRate || "0").replace("%", ""));
|
|
50
|
-
if (!statePct || statePct <= 0)
|
|
51
|
-
missing.push("State Rate");
|
|
52
81
|
return missing;
|
|
53
82
|
}
|
|
54
83
|
function TaxAxisIntake({ userContext = "expert", onProspect, onFullAnalysis, initialProfile, }) {
|
|
@@ -59,6 +88,37 @@ function TaxAxisIntake({ userContext = "expert", onProspect, onFullAnalysis, ini
|
|
|
59
88
|
});
|
|
60
89
|
const profile = methods.watch();
|
|
61
90
|
const missingFields = (0, react_1.useMemo)(() => getMissingFields(profile), [profile]);
|
|
91
|
+
const [showDemo, setShowDemo] = (0, react_1.useState)(false);
|
|
92
|
+
const konamiRef = (0, react_1.useRef)({ keys: '', timer: null });
|
|
93
|
+
(0, react_1.useEffect)(() => {
|
|
94
|
+
const handler = (e) => {
|
|
95
|
+
var _a;
|
|
96
|
+
const tag = (_a = e.target) === null || _a === void 0 ? void 0 : _a.tagName;
|
|
97
|
+
if (tag === 'INPUT' || tag === 'TEXTAREA' || tag === 'SELECT')
|
|
98
|
+
return;
|
|
99
|
+
const k = konamiRef.current;
|
|
100
|
+
k.keys += e.key.toLowerCase();
|
|
101
|
+
clearTimeout(k.timer);
|
|
102
|
+
k.timer = setTimeout(() => { k.keys = ''; }, 3000);
|
|
103
|
+
if (k.keys.includes('demo')) {
|
|
104
|
+
setShowDemo(true);
|
|
105
|
+
k.keys = '';
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
window.addEventListener('keydown', handler);
|
|
109
|
+
return () => window.removeEventListener('keydown', handler);
|
|
110
|
+
}, []);
|
|
111
|
+
const handleDemoToggle = () => {
|
|
112
|
+
const current = methods.getValues();
|
|
113
|
+
const isDemoFilled = current.bizName === DEMO_PROFILE.bizName;
|
|
114
|
+
if (isDemoFilled) {
|
|
115
|
+
methods.reset(Object.assign({}, intakeSchema_1.intakeDefaultValues));
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
methods.reset(Object.assign(Object.assign({}, intakeSchema_1.intakeDefaultValues), DEMO_PROFILE));
|
|
119
|
+
}
|
|
120
|
+
setTimeout(() => methods.trigger(), 0);
|
|
121
|
+
};
|
|
62
122
|
const handleProspect = () => {
|
|
63
123
|
methods.handleSubmit((valid) => onProspect(valid), () => { })();
|
|
64
124
|
};
|
|
@@ -67,7 +127,8 @@ function TaxAxisIntake({ userContext = "expert", onProspect, onFullAnalysis, ini
|
|
|
67
127
|
};
|
|
68
128
|
return (react_1.default.createElement(react_hook_form_1.FormProvider, Object.assign({}, methods),
|
|
69
129
|
react_1.default.createElement("div", { className: "grid grid-cols-[1fr_1fr] gap-5" },
|
|
70
|
-
react_1.default.createElement("div", { className: "flex flex-col gap-4" },
|
|
130
|
+
react_1.default.createElement("div", { className: "relative flex flex-col gap-4" },
|
|
131
|
+
showDemo && (react_1.default.createElement("button", { type: "button", onClick: handleDemoToggle, className: "absolute right-0 -top-1 text-[10px] text-tax-axis-text-4 opacity-40 hover:opacity-80 transition-opacity cursor-pointer bg-transparent border-none font-tax-axis-mono", style: { zIndex: 20 } }, "Demo")),
|
|
71
132
|
react_1.default.createElement(ClientParametersSection_1.ClientParametersSection, { userContext: userContext }),
|
|
72
133
|
react_1.default.createElement(RefineAnalysisSection_1.RefineAnalysisSection, { userContext: userContext }),
|
|
73
134
|
react_1.default.createElement(CpaIntakeQuestionsSection_1.CpaIntakeQuestionsSection, { userContext: userContext }),
|