@layerfi/components 0.1.132-alpha.1 → 0.1.132-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +591 -534
- package/dist/esm/index.mjs +591 -534
- package/dist/index.css +59 -26
- package/dist/index.d.ts +30 -23
- package/package.json +1 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -278,7 +278,7 @@ var getIntlLocale = (locale) => {
|
|
|
278
278
|
};
|
|
279
279
|
var package_default = {
|
|
280
280
|
name: "@layerfi/components",
|
|
281
|
-
version: "0.1.132-alpha.
|
|
281
|
+
version: "0.1.132-alpha.3",
|
|
282
282
|
description: "Layer React Components",
|
|
283
283
|
main: "dist/cjs/index.cjs",
|
|
284
284
|
module: "dist/esm/index.mjs",
|
|
@@ -1599,43 +1599,24 @@ var invoices_default$1 = {
|
|
|
1599
1599
|
var landingPage_default$1 = {
|
|
1600
1600
|
action: {
|
|
1601
1601
|
"book_call": "Book a call",
|
|
1602
|
-
"get_started": "Get Started",
|
|
1603
1602
|
"learn_more": "Learn more"
|
|
1604
1603
|
},
|
|
1605
1604
|
label: {
|
|
1606
1605
|
"all_finances_in_one_place": "All your finances in one place",
|
|
1607
1606
|
"best_accounting_software_for_industry": "The best accounting software for {{industry}} businesses. Fast to set up and easy to use.",
|
|
1608
|
-
"books_organized_and_tax_ready": "Your books will be organized and tax-ready with accurate categorization and financial statements prepared by professionals.",
|
|
1609
1607
|
"built_for_industry": "Built for {{industry}}",
|
|
1610
|
-
"business_bank_accounts_icon": "Business bank accounts and credit cards connection icon",
|
|
1611
|
-
"business_overview_dashboard_charts": "Business overview dashboard with charts and financial metrics",
|
|
1612
|
-
"calendar_scheduling_icon_bookkeeper": "Calendar scheduling icon for bookkeeper consultation",
|
|
1613
|
-
"categorize_expenses": "Categorize expenses",
|
|
1614
1608
|
"complete_bookkeeping_service": "A complete bookkeeping service",
|
|
1615
1609
|
"complete_financial_reports": "Complete financial reports and end of year tax packet",
|
|
1616
|
-
"connect_business_accounts": "Connect your business accounts",
|
|
1617
|
-
"connect_business_bank_accounts": "Connect your business bank accounts and credit cards right within {{platformName}}.",
|
|
1618
1610
|
"direct_integration_with_platform_name": "Direct integration with {{platformName}}",
|
|
1619
1611
|
"directly_integrated_with_platform_name": "Directly integrated with your {{platformName}} data, so you can see your business performance and profit in real-time.",
|
|
1620
1612
|
"easy_to_understand_profitability_charts": "Easy to understand profitability charts and reports",
|
|
1621
1613
|
"easy_to_use_software": "Easy to use software",
|
|
1622
|
-
"expense_categorization_organization_icon": "Expense categorization and organization icon",
|
|
1623
1614
|
"full_service_bookkeeping": "Full-service Bookkeeping",
|
|
1624
|
-
"get_clear_picture_of_business": "Get a clear picture of your business",
|
|
1625
1615
|
"get_dedicated_bookkeeper": "Get a dedicated bookkeeper who will organize and manage your books for you.",
|
|
1626
|
-
"get_notified_on_bookkeeping_clarifications": "Get notified on bookkeeping clarifications",
|
|
1627
|
-
"get_personalized_guidance": "Get personalized guidance from your dedicated bookkeeper to review your finances and answer questions.",
|
|
1628
|
-
"get_ready_for_tax_season": "Get ready for tax season",
|
|
1629
1616
|
"monthly_books_done_for_you": "Monthly books done for you",
|
|
1630
|
-
"notification_bell_icon_bookkeeping": "Notification bell icon for bookkeeping task updates and clarifications",
|
|
1631
|
-
"organize_transaction_into_categories": "Organize transactions into categories built for {{industry}}.",
|
|
1632
1617
|
"personalized_setup_bookkeeper": "Personalized setup with your bookkeeper",
|
|
1633
1618
|
"platform_name_accounting": "{{platformName}} Accounting",
|
|
1634
1619
|
"platform_name_accounting_dashboard": "{{platformName}} Accounting dashboard interface showing financial data and business insights",
|
|
1635
|
-
"profit_loss_statement_chart": "Profit and loss statement chart for tax preparation and business analysis",
|
|
1636
|
-
"receive_clear_notifications": "Receive clear notifications when your bookkeeper needs additional information or clarification on transactions.",
|
|
1637
|
-
"schedule_call_with_bookkeeper": "Schedule a call with your Bookkeeper",
|
|
1638
|
-
"see_business_profitability": "See your business profitability and stay organized for tax time.",
|
|
1639
1620
|
"self_service_accounting_business_health": "Self-service accounting to understand your business health",
|
|
1640
1621
|
"starting_at": "Starting at",
|
|
1641
1622
|
"track_business_finances_within_platform": "Track your business finances, right within {{platformName}}.",
|
|
@@ -1871,6 +1852,7 @@ var taxEstimates_default$1 = {
|
|
|
1871
1852
|
"categorization_incomplete": "Categorization incomplete",
|
|
1872
1853
|
"deductions": "Deductions",
|
|
1873
1854
|
"due": "Due",
|
|
1855
|
+
"due_at": "Due on {{date}}",
|
|
1874
1856
|
"due_with_date": "Due: {{date}}",
|
|
1875
1857
|
"enter_amount": "Enter amount",
|
|
1876
1858
|
"enter_area": "Enter area",
|
|
@@ -1916,7 +1898,6 @@ var taxEstimates_default$1 = {
|
|
|
1916
1898
|
"taxable_income_estimate_to_date_for_year_projected": "Taxable income projection for year {{year}}",
|
|
1917
1899
|
"taxable_income_for_year": "Taxable income for {{year}}",
|
|
1918
1900
|
"taxable_income_for_year_projected": "Projected taxable income for {{year}}",
|
|
1919
|
-
"taxes_due_at": "Taxes due on {{date}}",
|
|
1920
1901
|
"taxes_owed": "Taxes Owed",
|
|
1921
1902
|
"taxes_owed_projected": "Projected Taxes Owed",
|
|
1922
1903
|
"taxes_paid": "Taxes Paid",
|
|
@@ -2227,6 +2208,7 @@ var vehicles_default$1 = {
|
|
|
2227
2208
|
"enter_vin": "Enter VIN",
|
|
2228
2209
|
"license_plate": "License plate",
|
|
2229
2210
|
"make_model": "Make and model",
|
|
2211
|
+
"unnamed_vehicle": "Unnamed Vehicle",
|
|
2230
2212
|
"vehicle": "Vehicle",
|
|
2231
2213
|
"vehicle_name_hidden_from_active_list": "{{vehicleName}} will be hidden from your active vehicles list. You can reactivate it at any time.",
|
|
2232
2214
|
"vehicle_name_restored_to_active_list": "{{vehicleName}} will be restored to your active vehicles list and available for tracking trips.",
|
|
@@ -2402,6 +2384,7 @@ var bookkeeping_default = {
|
|
|
2402
2384
|
"bookkeeping_tasks": "Tâches de tenue de livres",
|
|
2403
2385
|
"complete_bookkeeping_onboarding_call": "Une fois votre appel d’intégration à la tenue de livres terminé, vos tâches de tenue de livres s’afficheront ici.",
|
|
2404
2386
|
"completed_over_total_done_one": "<completed>{{displayCompletedTaskCount}}</completed>/{{displayTotalTaskCount}} terminée",
|
|
2387
|
+
"completed_over_total_done_many": "",
|
|
2405
2388
|
"completed_over_total_done_other": "<completed>{{displayCompletedTaskCount}}</completed>/{{displayTotalTaskCount}} terminées",
|
|
2406
2389
|
"count_open_tasks_one": "{{displayCount}} tâche ouverte en {{displayYear}}",
|
|
2407
2390
|
"count_open_tasks_other": "{{displayCount}} tâches ouvertes en {{displayYear}}",
|
|
@@ -3044,43 +3027,24 @@ var invoices_default = {
|
|
|
3044
3027
|
var landingPage_default = {
|
|
3045
3028
|
action: {
|
|
3046
3029
|
"book_call": "Réserver un appel",
|
|
3047
|
-
"get_started": "Commencer",
|
|
3048
3030
|
"learn_more": "En savoir plus"
|
|
3049
3031
|
},
|
|
3050
3032
|
label: {
|
|
3051
3033
|
"all_finances_in_one_place": "Toutes vos finances en un seul endroit",
|
|
3052
3034
|
"best_accounting_software_for_industry": "Le meilleur logiciel de comptabilité pour les entreprises du secteur {{industry}}. Rapide à configurer et facile à utiliser.",
|
|
3053
|
-
"books_organized_and_tax_ready": "Vos livres seront organisés et prêts pour les impôts grâce à une catégorisation précise et à des états financiers préparés par des professionnels.",
|
|
3054
3035
|
"built_for_industry": "Conçu pour le secteur {{industry}}",
|
|
3055
|
-
"business_bank_accounts_icon": "Icône de connexion des comptes bancaires professionnels et des cartes de crédit",
|
|
3056
|
-
"business_overview_dashboard_charts": "Tableau de bord de l’entreprise avec graphiques et indicateurs financiers",
|
|
3057
|
-
"calendar_scheduling_icon_bookkeeper": "Icône de calendrier pour planifier une consultation avec un teneur de livres",
|
|
3058
|
-
"categorize_expenses": "Catégoriser les dépenses",
|
|
3059
3036
|
"complete_bookkeeping_service": "Un service complet de tenue de livres",
|
|
3060
3037
|
"complete_financial_reports": "Rapports financiers complets et dossier fiscal de fin d’année",
|
|
3061
|
-
"connect_business_accounts": "Connectez vos comptes d’entreprise",
|
|
3062
|
-
"connect_business_bank_accounts": "Connectez vos comptes bancaires professionnels et vos cartes de crédit directement dans {{platformName}}.",
|
|
3063
3038
|
"direct_integration_with_platform_name": "Intégration directe avec {{platformName}}",
|
|
3064
3039
|
"directly_integrated_with_platform_name": "Intégré directement à vos données {{platformName}}, pour vous permettre de voir la performance et la rentabilité de votre entreprise en temps réel.",
|
|
3065
3040
|
"easy_to_understand_profitability_charts": "Graphiques et rapports de rentabilité faciles à comprendre",
|
|
3066
3041
|
"easy_to_use_software": "Logiciel facile à utiliser",
|
|
3067
|
-
"expense_categorization_organization_icon": "Icône de catégorisation et d’organisation des dépenses",
|
|
3068
3042
|
"full_service_bookkeeping": "Tenue de livres complète",
|
|
3069
|
-
"get_clear_picture_of_business": "Obtenez un portrait clair de votre entreprise",
|
|
3070
3043
|
"get_dedicated_bookkeeper": "Obtenez un teneur de livres attitré qui organisera et gérera vos livres pour vous.",
|
|
3071
|
-
"get_notified_on_bookkeeping_clarifications": "Recevez des notifications concernant les demandes de clarification en tenue de livres",
|
|
3072
|
-
"get_personalized_guidance": "Obtenez des conseils personnalisés de votre teneur de livres attitré pour passer en revue vos finances et répondre à vos questions.",
|
|
3073
|
-
"get_ready_for_tax_season": "Préparez-vous pour la saison des impôts",
|
|
3074
3044
|
"monthly_books_done_for_you": "Tenue de livres mensuelle faite pour vous",
|
|
3075
|
-
"notification_bell_icon_bookkeeping": "Icône de cloche de notification pour les mises à jour des tâches de tenue de livres et les demandes de clarification",
|
|
3076
|
-
"organize_transaction_into_categories": "Organisez les transactions dans des catégories conçues pour le secteur {{industry}}.",
|
|
3077
3045
|
"personalized_setup_bookkeeper": "Configuration personnalisée avec votre teneur de livres",
|
|
3078
3046
|
"platform_name_accounting": "{{platformName}} Accounting",
|
|
3079
3047
|
"platform_name_accounting_dashboard": "Interface du tableau de bord {{platformName}} Accounting affichant des données financières et des renseignements sur l’entreprise",
|
|
3080
|
-
"profit_loss_statement_chart": "Graphique de l’état des résultats pour la préparation fiscale et l’analyse de l’entreprise",
|
|
3081
|
-
"receive_clear_notifications": "Recevez des notifications claires lorsque votre teneur de livres a besoin de renseignements supplémentaires ou d’éclaircissements sur des opérations.",
|
|
3082
|
-
"schedule_call_with_bookkeeper": "Planifiez un appel avec votre teneur de livres",
|
|
3083
|
-
"see_business_profitability": "Visualisez la rentabilité de votre entreprise et restez organisé en vue de la période des impôts.",
|
|
3084
3048
|
"self_service_accounting_business_health": "Comptabilité en libre-service pour comprendre la santé de votre entreprise",
|
|
3085
3049
|
"starting_at": "À partir de",
|
|
3086
3050
|
"track_business_finances_within_platform": "Suivez les finances de votre entreprise, directement dans {{platformName}}.",
|
|
@@ -3316,6 +3280,7 @@ var taxEstimates_default = {
|
|
|
3316
3280
|
"categorization_incomplete": "Catégorisation incomplète",
|
|
3317
3281
|
"deductions": "Déductions",
|
|
3318
3282
|
"due": "Échéance",
|
|
3283
|
+
"due_at": "",
|
|
3319
3284
|
"due_with_date": "Échéance : {{date}}",
|
|
3320
3285
|
"enter_amount": "Saisissez un montant",
|
|
3321
3286
|
"enter_area": "Saisissez la superficie",
|
|
@@ -3361,7 +3326,6 @@ var taxEstimates_default = {
|
|
|
3361
3326
|
"taxable_income_estimate_to_date_for_year_projected": "Projection du revenu imposable pour l’année {{year}}",
|
|
3362
3327
|
"taxable_income_for_year": "Revenu imposable pour {{year}}",
|
|
3363
3328
|
"taxable_income_for_year_projected": "Revenu imposable projeté pour {{year}}",
|
|
3364
|
-
"taxes_due_at": "Taxes à payer le {{date}}",
|
|
3365
3329
|
"taxes_owed": "Impôts dus",
|
|
3366
3330
|
"taxes_owed_projected": "Impôts dus projetés",
|
|
3367
3331
|
"taxes_paid": "Impôts payés",
|
|
@@ -3672,6 +3636,7 @@ var vehicles_default = {
|
|
|
3672
3636
|
"enter_vin": "Saisissez le NIV",
|
|
3673
3637
|
"license_plate": "Plaque d’immatriculation",
|
|
3674
3638
|
"make_model": "Marque et modèle",
|
|
3639
|
+
"unnamed_vehicle": "",
|
|
3675
3640
|
"vehicle": "Véhicule",
|
|
3676
3641
|
"vehicle_name_hidden_from_active_list": "{{vehicleName}} sera masqué de votre liste de véhicules actifs. Vous pourrez le réactiver en tout temps.",
|
|
3677
3642
|
"vehicle_name_restored_to_active_list": "{{vehicleName}} sera restauré dans votre liste de véhicules actifs et pourra être utilisé pour faire le suivi de vos déplacements.",
|
|
@@ -14812,7 +14777,7 @@ var EmptyState$7 = () => {
|
|
|
14812
14777
|
children: t("common:empty.results", "No results found")
|
|
14813
14778
|
});
|
|
14814
14779
|
};
|
|
14815
|
-
var ErrorState$
|
|
14780
|
+
var ErrorState$5 = () => {
|
|
14816
14781
|
const { t } = (0, react_i18next.useTranslation)();
|
|
14817
14782
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Span, {
|
|
14818
14783
|
size: "sm",
|
|
@@ -14855,7 +14820,7 @@ var MobileSelectionDrawerList = (_ref) => {
|
|
|
14855
14820
|
data,
|
|
14856
14821
|
slots: {
|
|
14857
14822
|
EmptyState: EmptyState$7,
|
|
14858
|
-
ErrorState: ErrorState$
|
|
14823
|
+
ErrorState: ErrorState$5
|
|
14859
14824
|
},
|
|
14860
14825
|
renderItem,
|
|
14861
14826
|
onClickItem,
|
|
@@ -18053,7 +18018,7 @@ var VirtualizedDataTable = ({ columnConfig, data, isLoading, isError, componentN
|
|
|
18053
18018
|
var ROW_HEIGHT = 52;
|
|
18054
18019
|
var TABLE_HEIGHT = ROW_HEIGHT * 9 - 1;
|
|
18055
18020
|
var EmptyState$6 = () => null;
|
|
18056
|
-
var ErrorState$
|
|
18021
|
+
var ErrorState$4 = () => null;
|
|
18057
18022
|
function ValidateCsvTable({ data, headers, formatters, className }) {
|
|
18058
18023
|
const { t } = (0, react_i18next.useTranslation)();
|
|
18059
18024
|
const sortedData = (0, react.useMemo)(() => [...data].sort((a, b) => {
|
|
@@ -18109,7 +18074,7 @@ function ValidateCsvTable({ data, headers, formatters, className }) {
|
|
|
18109
18074
|
shrinkHeightToFitRows: true,
|
|
18110
18075
|
slots: {
|
|
18111
18076
|
EmptyState: EmptyState$6,
|
|
18112
|
-
ErrorState: ErrorState$
|
|
18077
|
+
ErrorState: ErrorState$4
|
|
18113
18078
|
}
|
|
18114
18079
|
})
|
|
18115
18080
|
});
|
|
@@ -24467,7 +24432,7 @@ var TransactionColumns = /* @__PURE__ */ function(TransactionColumns) {
|
|
|
24467
24432
|
TransactionColumns["Amount"] = "Amount";
|
|
24468
24433
|
return TransactionColumns;
|
|
24469
24434
|
}(TransactionColumns || {});
|
|
24470
|
-
var ErrorState$
|
|
24435
|
+
var ErrorState$3 = () => {
|
|
24471
24436
|
const { t } = (0, react_i18next.useTranslation)();
|
|
24472
24437
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DataState, {
|
|
24473
24438
|
spacing: true,
|
|
@@ -24531,7 +24496,7 @@ var AffectedTransactionsTable = ({ transactions, isLoading = false, isError = fa
|
|
|
24531
24496
|
shrinkHeightToFitRows: true,
|
|
24532
24497
|
slots: {
|
|
24533
24498
|
EmptyState: EmptyState$5,
|
|
24534
|
-
ErrorState: ErrorState$
|
|
24499
|
+
ErrorState: ErrorState$3
|
|
24535
24500
|
}
|
|
24536
24501
|
})
|
|
24537
24502
|
});
|
|
@@ -27943,6 +27908,9 @@ var DetailedChart = ({ data, isLoading, interactionProps, stylingProps, slots })
|
|
|
27943
27908
|
x: x + width / 2,
|
|
27944
27909
|
textAnchor: "middle",
|
|
27945
27910
|
verticalAnchor: "middle",
|
|
27911
|
+
breakAll: true,
|
|
27912
|
+
maxLines: 2,
|
|
27913
|
+
width: Math.max(width - 40, 0),
|
|
27946
27914
|
className: "Layer__DetailedChart__centerLabelTitle",
|
|
27947
27915
|
children: text
|
|
27948
27916
|
}),
|
|
@@ -29054,7 +29022,7 @@ var PnlDetailColumns = /* @__PURE__ */ function(PnlDetailColumns) {
|
|
|
29054
29022
|
PnlDetailColumns["Balance"] = "Balance";
|
|
29055
29023
|
return PnlDetailColumns;
|
|
29056
29024
|
}(PnlDetailColumns || {});
|
|
29057
|
-
var ErrorState$
|
|
29025
|
+
var ErrorState$2 = () => {
|
|
29058
29026
|
const { t } = (0, react_i18next.useTranslation)();
|
|
29059
29027
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DataState, {
|
|
29060
29028
|
spacing: true,
|
|
@@ -29237,7 +29205,7 @@ var ProfitAndLossDetailReport = ({ lineItemName, breadcrumbPath, onClose, onBrea
|
|
|
29237
29205
|
shrinkHeightToFitRows: true,
|
|
29238
29206
|
slots: {
|
|
29239
29207
|
EmptyState: EmptyState$4,
|
|
29240
|
-
ErrorState: ErrorState$
|
|
29208
|
+
ErrorState: ErrorState$2
|
|
29241
29209
|
}
|
|
29242
29210
|
}), rowsWithRunningBalance.lines.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(HStack, {
|
|
29243
29211
|
pb: "sm",
|
|
@@ -29540,7 +29508,7 @@ var ProfitAndLossDetailedCharts = ({ scope, hideClose = false, hideHeader = fals
|
|
|
29540
29508
|
}, [_oldSortByScope, activeScope]);
|
|
29541
29509
|
const handleClose = (0, react.useCallback)(() => setSidebarScope(void 0), [setSidebarScope]);
|
|
29542
29510
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
29543
|
-
className: "Layer__profit-and-loss-detailed-charts",
|
|
29511
|
+
className: "Layer__profit-and-loss-detailed-charts Layer__ProfitAndLossDetailedCharts",
|
|
29544
29512
|
children: [
|
|
29545
29513
|
!hideHeader && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProfitAndLossDetailedChartsHeader, {
|
|
29546
29514
|
mode: isDesktop ? "desktop" : "tablet",
|
|
@@ -37816,7 +37784,7 @@ var VehicleSchema = effect.Schema.Struct({
|
|
|
37816
37784
|
businessId: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.UUID), effect.Schema.fromKey("business_id")),
|
|
37817
37785
|
externalId: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(effect.Schema.String)), effect.Schema.fromKey("external_id")),
|
|
37818
37786
|
makeAndModel: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.String), effect.Schema.fromKey("make_and_model")),
|
|
37819
|
-
year: effect.Schema.Number,
|
|
37787
|
+
year: effect.Schema.NullishOr(effect.Schema.Number),
|
|
37820
37788
|
licensePlate: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(effect.Schema.String)), effect.Schema.fromKey("license_plate")),
|
|
37821
37789
|
vin: effect.Schema.NullishOr(effect.Schema.String),
|
|
37822
37790
|
description: effect.Schema.NullishOr(effect.Schema.String),
|
|
@@ -37829,7 +37797,7 @@ var VehicleSchema = effect.Schema.Struct({
|
|
|
37829
37797
|
});
|
|
37830
37798
|
effect.Schema.Struct({
|
|
37831
37799
|
makeAndModel: effect.Schema.String,
|
|
37832
|
-
year: effect.Schema.Number,
|
|
37800
|
+
year: effect.Schema.NullishOr(effect.Schema.Number),
|
|
37833
37801
|
licensePlate: effect.Schema.String,
|
|
37834
37802
|
vin: effect.Schema.String,
|
|
37835
37803
|
description: effect.Schema.String,
|
|
@@ -37837,7 +37805,7 @@ effect.Schema.Struct({
|
|
|
37837
37805
|
});
|
|
37838
37806
|
var UpsertVehicleSchema = effect.Schema.Struct({
|
|
37839
37807
|
makeAndModel: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.String), effect.Schema.fromKey("make_and_model")),
|
|
37840
|
-
year: effect.Schema.Number,
|
|
37808
|
+
year: effect.Schema.NullishOr(effect.Schema.Number),
|
|
37841
37809
|
licensePlate: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(effect.Schema.String)), effect.Schema.fromKey("license_plate")),
|
|
37842
37810
|
vin: effect.Schema.NullishOr(effect.Schema.String),
|
|
37843
37811
|
description: effect.Schema.NullishOr(effect.Schema.String),
|
|
@@ -38239,19 +38207,27 @@ var TripPurposeComboBox = ({ value, onValueChange, isReadOnly, className }) => {
|
|
|
38239
38207
|
};
|
|
38240
38208
|
//#endregion
|
|
38241
38209
|
//#region src/utils/vehicles.ts
|
|
38242
|
-
var
|
|
38210
|
+
var unnamedVehicle = translationKey("vehicles:label.unnamed_vehicle", "Unnamed vehicle");
|
|
38211
|
+
var getVehicleDisplayName = (vehicle, t) => {
|
|
38212
|
+
if (!vehicle) return "";
|
|
38213
|
+
const makeAndModel = vehicle.makeAndModel.trim();
|
|
38214
|
+
if (vehicle.year == null) return makeAndModel || t(unnamedVehicle.i18nKey, unnamedVehicle.defaultValue);
|
|
38215
|
+
return `${vehicle.year} ${makeAndModel}`.trim();
|
|
38216
|
+
};
|
|
38243
38217
|
//#endregion
|
|
38244
38218
|
//#region src/components/VehicleManagement/VehicleSelector/VehicleSelector.tsx
|
|
38245
38219
|
var VehicleAsOption = class {
|
|
38246
|
-
constructor(vehicle) {
|
|
38220
|
+
constructor(vehicle, t) {
|
|
38247
38221
|
_defineProperty(this, "internalVehicle", void 0);
|
|
38222
|
+
_defineProperty(this, "t", void 0);
|
|
38248
38223
|
this.internalVehicle = vehicle;
|
|
38224
|
+
this.t = t;
|
|
38249
38225
|
}
|
|
38250
38226
|
get original() {
|
|
38251
38227
|
return this.internalVehicle;
|
|
38252
38228
|
}
|
|
38253
38229
|
get label() {
|
|
38254
|
-
return getVehicleDisplayName(this.internalVehicle);
|
|
38230
|
+
return getVehicleDisplayName(this.internalVehicle, this.t);
|
|
38255
38231
|
}
|
|
38256
38232
|
get id() {
|
|
38257
38233
|
return this.internalVehicle.id;
|
|
@@ -38265,15 +38241,15 @@ function VehicleSelector({ selectedVehicle, onSelectedVehicleChange, placeholder
|
|
|
38265
38241
|
const combinedClassName = (0, classnames.default)("Layer__VehicleSelector", inline && "Layer__VehicleSelector--inline", containerClassName);
|
|
38266
38242
|
const { data, isLoading, isError } = useListVehicles();
|
|
38267
38243
|
const options = (0, react.useMemo)(() => {
|
|
38268
|
-
return (data === null || data === void 0 ? void 0 : data.map((vehicle) => new VehicleAsOption(vehicle))) || [];
|
|
38269
|
-
}, [data]);
|
|
38244
|
+
return (data === null || data === void 0 ? void 0 : data.map((vehicle) => new VehicleAsOption(vehicle, t))) || [];
|
|
38245
|
+
}, [data, t]);
|
|
38270
38246
|
const onSelectedValueChange = (0, react.useCallback)((option) => {
|
|
38271
38247
|
onSelectedVehicleChange((option === null || option === void 0 ? void 0 : option.original) || null);
|
|
38272
38248
|
}, [onSelectedVehicleChange]);
|
|
38273
38249
|
const selectedVehicleForComboBox = (0, react.useMemo)(() => {
|
|
38274
38250
|
if (selectedVehicle === null) return null;
|
|
38275
|
-
return new VehicleAsOption(selectedVehicle);
|
|
38276
|
-
}, [selectedVehicle]);
|
|
38251
|
+
return new VehicleAsOption(selectedVehicle, t);
|
|
38252
|
+
}, [selectedVehicle, t]);
|
|
38277
38253
|
const EmptyMessage = (0, react.useMemo)(() => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(P, {
|
|
38278
38254
|
variant: "subtle",
|
|
38279
38255
|
children: t("vehicles:empty.matching_vehicle", "No matching vehicle")
|
|
@@ -45579,7 +45555,7 @@ var getColumnConfig$2 = ({ onViewOrUpsertTrip, onDeleteTrip }, t) => [
|
|
|
45579
45555
|
cell: (row) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Span, {
|
|
45580
45556
|
ellipsis: true,
|
|
45581
45557
|
withTooltip: true,
|
|
45582
|
-
children: getVehicleDisplayName(row.original.vehicle)
|
|
45558
|
+
children: getVehicleDisplayName(row.original.vehicle, t)
|
|
45583
45559
|
}),
|
|
45584
45560
|
isRowHeader: true
|
|
45585
45561
|
},
|
|
@@ -45922,7 +45898,7 @@ var validateVehicleForm = ({ vehicle }) => {
|
|
|
45922
45898
|
reason: VehicleFormInvalidReason.YearRequired
|
|
45923
45899
|
});
|
|
45924
45900
|
const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
45925
|
-
if (!Number.isNaN(year) && (year < 1900 || year > currentYear + 1)) errors.push({
|
|
45901
|
+
if (year != null && !Number.isNaN(year) && (year < 1900 || year > currentYear + 1)) errors.push({
|
|
45926
45902
|
field: "year",
|
|
45927
45903
|
reason: VehicleFormInvalidReason.YearRange
|
|
45928
45904
|
});
|
|
@@ -46200,7 +46176,7 @@ function VehicleArchiveConfirmationModal({ isOpen, onOpenChange, vehicle, useDra
|
|
|
46200
46176
|
const onConfirm = (0, react.useCallback)(_asyncToGenerator(function* () {
|
|
46201
46177
|
yield archiveVehicle();
|
|
46202
46178
|
}), [archiveVehicle]);
|
|
46203
|
-
const vehicleName = getVehicleDisplayName(vehicle);
|
|
46179
|
+
const vehicleName = getVehicleDisplayName(vehicle, t);
|
|
46204
46180
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BaseConfirmationModal, {
|
|
46205
46181
|
isOpen,
|
|
46206
46182
|
onOpenChange,
|
|
@@ -46261,7 +46237,7 @@ function VehicleDeleteConfirmationModal({ isOpen, onOpenChange, vehicle, useDraw
|
|
|
46261
46237
|
const onConfirm = (0, react.useCallback)(_asyncToGenerator(function* () {
|
|
46262
46238
|
yield deleteVehicle();
|
|
46263
46239
|
}), [deleteVehicle]);
|
|
46264
|
-
const vehicleName = getVehicleDisplayName(vehicle);
|
|
46240
|
+
const vehicleName = getVehicleDisplayName(vehicle, t);
|
|
46265
46241
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BaseConfirmationModal, {
|
|
46266
46242
|
isOpen,
|
|
46267
46243
|
onOpenChange,
|
|
@@ -46323,7 +46299,7 @@ function VehicleReactivateConfirmationModal({ isOpen, onOpenChange, vehicle, use
|
|
|
46323
46299
|
const onConfirm = (0, react.useCallback)(_asyncToGenerator(function* () {
|
|
46324
46300
|
yield reactivateVehicle();
|
|
46325
46301
|
}), [reactivateVehicle]);
|
|
46326
|
-
const vehicleName = getVehicleDisplayName(vehicle);
|
|
46302
|
+
const vehicleName = getVehicleDisplayName(vehicle, t);
|
|
46327
46303
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BaseConfirmationModal, {
|
|
46328
46304
|
isOpen,
|
|
46329
46305
|
onOpenChange,
|
|
@@ -46354,7 +46330,7 @@ var VehicleCard = ({ vehicle, onEdit }) => {
|
|
|
46354
46330
|
label: t(opt.i18nKey, opt.defaultValue),
|
|
46355
46331
|
key: opt.fieldKey
|
|
46356
46332
|
})), [t]);
|
|
46357
|
-
const vehicleName = getVehicleDisplayName(vehicle);
|
|
46333
|
+
const vehicleName = getVehicleDisplayName(vehicle, t);
|
|
46358
46334
|
const isArchived = vehicle.archivedAt !== null && vehicle.archivedAt !== void 0;
|
|
46359
46335
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
46360
46336
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Card, {
|
|
@@ -46866,10 +46842,7 @@ var SummaryCard = ({ slots, children, className }) => {
|
|
|
46866
46842
|
children: [legend && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
46867
46843
|
className: "Layer__SummaryCard__HeaderLegend",
|
|
46868
46844
|
children: legend
|
|
46869
|
-
}), primaryAction
|
|
46870
|
-
className: "Layer__SummaryCard__HeaderPrimaryAction",
|
|
46871
|
-
children: primaryAction
|
|
46872
|
-
})]
|
|
46845
|
+
}), primaryAction]
|
|
46873
46846
|
})]
|
|
46874
46847
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
46875
46848
|
className: "Layer__SummaryCard__Content",
|
|
@@ -46952,88 +46925,89 @@ var ExpensesSummaryCard = ({ stylingProps, interactionProps, stringOverrides, cl
|
|
|
46952
46925
|
};
|
|
46953
46926
|
//#endregion
|
|
46954
46927
|
//#region src/components/MileageTrackingSummary/MileageTrackingSummary.tsx
|
|
46955
|
-
var
|
|
46928
|
+
var Content$1 = () => {
|
|
46956
46929
|
const { t } = (0, react_i18next.useTranslation)();
|
|
46957
46930
|
const { formatDate } = useIntlFormatter();
|
|
46958
46931
|
const { data, selectedYear, selectedYearData, chartData, isLoading, isError } = useMileageTrackingYearlySummary();
|
|
46959
46932
|
const { isDesktop, isMobile } = useSizeClass();
|
|
46960
46933
|
const inYearLabel = t("mileageTracking:label.in_year", "In {{year}}", { year: formatDate(new Date(selectedYear, 0, 1), DateFormat.Year) });
|
|
46961
|
-
const title = headerOverride !== null && headerOverride !== void 0 ? headerOverride : t("mileageTracking:label.mileage_tracking", "Mileage Tracking");
|
|
46962
46934
|
const statsProps = isDesktop ? { direction: "column" } : isMobile ? { direction: "column" } : { direction: "row" };
|
|
46963
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.
|
|
46964
|
-
|
|
46965
|
-
|
|
46966
|
-
|
|
46967
|
-
|
|
46968
|
-
|
|
46969
|
-
|
|
46970
|
-
|
|
46971
|
-
|
|
46972
|
-
|
|
46973
|
-
|
|
46974
|
-
|
|
46975
|
-
|
|
46976
|
-
|
|
46935
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ConditionalBlock, {
|
|
46936
|
+
data,
|
|
46937
|
+
isLoading,
|
|
46938
|
+
isError,
|
|
46939
|
+
Loading: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(HStack, {
|
|
46940
|
+
className: "Layer__MileageTrackingSummary__Content",
|
|
46941
|
+
gap: "lg",
|
|
46942
|
+
justify: "center",
|
|
46943
|
+
align: "center",
|
|
46944
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Loader, {})
|
|
46945
|
+
}),
|
|
46946
|
+
Error: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DataState, {
|
|
46947
|
+
status: DataStateStatus.failed,
|
|
46948
|
+
title: t("mileageTracking:error.load_mileage_summary_data", "Failed to load mileage summary data"),
|
|
46949
|
+
spacing: true
|
|
46950
|
+
}),
|
|
46951
|
+
children: () => {
|
|
46952
|
+
var _selectedYearData$est, _selectedYearData$mil, _selectedYearData$tri;
|
|
46953
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Stack, {
|
|
46977
46954
|
className: "Layer__MileageTrackingSummary__Content",
|
|
46955
|
+
direction: isDesktop ? "row" : "column",
|
|
46978
46956
|
gap: "lg",
|
|
46979
|
-
|
|
46980
|
-
|
|
46981
|
-
|
|
46982
|
-
|
|
46983
|
-
|
|
46984
|
-
|
|
46985
|
-
|
|
46986
|
-
|
|
46987
|
-
|
|
46988
|
-
|
|
46989
|
-
|
|
46990
|
-
|
|
46991
|
-
|
|
46992
|
-
|
|
46993
|
-
|
|
46994
|
-
|
|
46995
|
-
|
|
46996
|
-
|
|
46997
|
-
|
|
46998
|
-
|
|
46999
|
-
|
|
47000
|
-
|
|
47001
|
-
|
|
47002
|
-
|
|
47003
|
-
|
|
47004
|
-
|
|
47005
|
-
|
|
47006
|
-
}),
|
|
47007
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
47008
|
-
className: "Layer__MileageTrackingSummary__StatCardSlot",
|
|
47009
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MileageTrackingStatsCard, {
|
|
47010
|
-
title: t("mileageTracking:label.total_miles", "Total Miles"),
|
|
47011
|
-
amount: (_selectedYearData$mil = selectedYearData === null || selectedYearData === void 0 ? void 0 : selectedYearData.miles) !== null && _selectedYearData$mil !== void 0 ? _selectedYearData$mil : 0,
|
|
47012
|
-
description: inYearLabel
|
|
47013
|
-
})
|
|
47014
|
-
}),
|
|
47015
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
47016
|
-
className: "Layer__MileageTrackingSummary__StatCardSlot",
|
|
47017
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MileageTrackingStatsCard, {
|
|
47018
|
-
title: t("trips:label.trips", "Trips"),
|
|
47019
|
-
amount: (_selectedYearData$tri = selectedYearData === null || selectedYearData === void 0 ? void 0 : selectedYearData.trips) !== null && _selectedYearData$tri !== void 0 ? _selectedYearData$tri : 0,
|
|
47020
|
-
description: inYearLabel
|
|
47021
|
-
})
|
|
46957
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Stack, _objectSpread2(_objectSpread2({}, statsProps), {}, {
|
|
46958
|
+
className: "Layer__MileageTrackingSummary__Cards",
|
|
46959
|
+
gap: "md",
|
|
46960
|
+
children: [
|
|
46961
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
46962
|
+
className: "Layer__MileageTrackingSummary__StatCardSlot",
|
|
46963
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MileageTrackingStatsCard, {
|
|
46964
|
+
title: t("mileageTracking:label.total_deduction", "Total Deduction"),
|
|
46965
|
+
amount: (_selectedYearData$est = selectedYearData === null || selectedYearData === void 0 ? void 0 : selectedYearData.estimatedDeduction) !== null && _selectedYearData$est !== void 0 ? _selectedYearData$est : 0,
|
|
46966
|
+
formatAsMoney: true,
|
|
46967
|
+
description: inYearLabel
|
|
46968
|
+
})
|
|
46969
|
+
}),
|
|
46970
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
46971
|
+
className: "Layer__MileageTrackingSummary__StatCardSlot",
|
|
46972
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MileageTrackingStatsCard, {
|
|
46973
|
+
title: t("mileageTracking:label.total_miles", "Total Miles"),
|
|
46974
|
+
amount: (_selectedYearData$mil = selectedYearData === null || selectedYearData === void 0 ? void 0 : selectedYearData.miles) !== null && _selectedYearData$mil !== void 0 ? _selectedYearData$mil : 0,
|
|
46975
|
+
description: inYearLabel
|
|
46976
|
+
})
|
|
46977
|
+
}),
|
|
46978
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
46979
|
+
className: "Layer__MileageTrackingSummary__StatCardSlot",
|
|
46980
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MileageTrackingStatsCard, {
|
|
46981
|
+
title: t("trips:label.trips", "Trips"),
|
|
46982
|
+
amount: (_selectedYearData$tri = selectedYearData === null || selectedYearData === void 0 ? void 0 : selectedYearData.trips) !== null && _selectedYearData$tri !== void 0 ? _selectedYearData$tri : 0,
|
|
46983
|
+
description: inYearLabel
|
|
47022
46984
|
})
|
|
47023
|
-
]
|
|
47024
|
-
})), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(VStack, {
|
|
47025
|
-
className: "Layer__MileageTrackingSummary__Chart",
|
|
47026
|
-
fluid: true,
|
|
47027
|
-
justify: "end",
|
|
47028
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MileageDeductionChart, {
|
|
47029
|
-
data: chartData,
|
|
47030
|
-
selectedYear,
|
|
47031
|
-
chartHeight: isDesktop ? 250 : 200
|
|
47032
46985
|
})
|
|
47033
|
-
|
|
47034
|
-
})
|
|
47035
|
-
|
|
47036
|
-
|
|
46986
|
+
]
|
|
46987
|
+
})), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(VStack, {
|
|
46988
|
+
className: "Layer__MileageTrackingSummary__Chart",
|
|
46989
|
+
fluid: true,
|
|
46990
|
+
justify: "end",
|
|
46991
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MileageDeductionChart, {
|
|
46992
|
+
data: chartData,
|
|
46993
|
+
selectedYear,
|
|
46994
|
+
chartHeight: isDesktop ? 250 : 200
|
|
46995
|
+
})
|
|
46996
|
+
})]
|
|
46997
|
+
});
|
|
46998
|
+
}
|
|
46999
|
+
});
|
|
47000
|
+
};
|
|
47001
|
+
var MileageTrackingSummary = ({ stringOverrides, interactionProps } = {}) => {
|
|
47002
|
+
const { t } = (0, react_i18next.useTranslation)();
|
|
47003
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SummaryCard, {
|
|
47004
|
+
className: "Layer__MileageTrackingSummary",
|
|
47005
|
+
slots: useSummaryCardSlots({
|
|
47006
|
+
defaultTitle: t("mileageTracking:label.mileage_tracking", "Mileage Tracking"),
|
|
47007
|
+
interactionProps,
|
|
47008
|
+
stringOverrides
|
|
47009
|
+
}),
|
|
47010
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Content$1, {})
|
|
47037
47011
|
});
|
|
47038
47012
|
};
|
|
47039
47013
|
//#endregion
|
|
@@ -47092,19 +47066,329 @@ var ProfitAndLossSummaryCard = ({ interactionProps, stringOverrides, className }
|
|
|
47092
47066
|
interactionProps,
|
|
47093
47067
|
stringOverrides
|
|
47094
47068
|
});
|
|
47095
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.
|
|
47096
|
-
className: (0, classnames.default)("Layer__ProfitAndLossSummaryCard", className),
|
|
47069
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(SummaryCard, {
|
|
47070
|
+
className: (0, classnames.default)("Layer__ProfitAndLossSummaryCard", "Layer__UI__Chart--focusReset", className),
|
|
47097
47071
|
slots,
|
|
47098
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.
|
|
47099
|
-
|
|
47100
|
-
|
|
47101
|
-
|
|
47102
|
-
|
|
47103
|
-
|
|
47104
|
-
|
|
47072
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProfitAndLossChart, {
|
|
47073
|
+
tagFilter,
|
|
47074
|
+
hideLegend: true
|
|
47075
|
+
}), !isDesktop && legend]
|
|
47076
|
+
});
|
|
47077
|
+
};
|
|
47078
|
+
//#endregion
|
|
47079
|
+
//#region src/types/location.ts
|
|
47080
|
+
var US_STATES_CONFIG = [
|
|
47081
|
+
_objectSpread2({ value: "AL" }, translationKey("usStates:label.alabama", "Alabama")),
|
|
47082
|
+
_objectSpread2({ value: "AK" }, translationKey("usStates:label.alaska", "Alaska")),
|
|
47083
|
+
_objectSpread2({ value: "AZ" }, translationKey("usStates:label.arizona", "Arizona")),
|
|
47084
|
+
_objectSpread2({ value: "AR" }, translationKey("usStates:label.arkansas", "Arkansas")),
|
|
47085
|
+
_objectSpread2({ value: "CA" }, translationKey("usStates:label.california", "California")),
|
|
47086
|
+
_objectSpread2({ value: "CO" }, translationKey("usStates:label.colorado", "Colorado")),
|
|
47087
|
+
_objectSpread2({ value: "CT" }, translationKey("usStates:label.connecticut", "Connecticut")),
|
|
47088
|
+
_objectSpread2({ value: "DE" }, translationKey("usStates:label.delaware", "Delaware")),
|
|
47089
|
+
_objectSpread2({ value: "DC" }, translationKey("usStates:label.district_columbia", "District of Columbia")),
|
|
47090
|
+
_objectSpread2({ value: "FL" }, translationKey("usStates:label.florida", "Florida")),
|
|
47091
|
+
_objectSpread2({ value: "GA" }, translationKey("usStates:label.georgia", "Georgia")),
|
|
47092
|
+
_objectSpread2({ value: "HI" }, translationKey("usStates:label.hawaii", "Hawaii")),
|
|
47093
|
+
_objectSpread2({ value: "ID" }, translationKey("usStates:label.idaho", "Idaho")),
|
|
47094
|
+
_objectSpread2({ value: "IL" }, translationKey("usStates:label.illinois", "Illinois")),
|
|
47095
|
+
_objectSpread2({ value: "IN" }, translationKey("usStates:label.indiana", "Indiana")),
|
|
47096
|
+
_objectSpread2({ value: "IA" }, translationKey("usStates:label.iowa", "Iowa")),
|
|
47097
|
+
_objectSpread2({ value: "KS" }, translationKey("usStates:label.kansas", "Kansas")),
|
|
47098
|
+
_objectSpread2({ value: "KY" }, translationKey("usStates:label.kentucky", "Kentucky")),
|
|
47099
|
+
_objectSpread2({ value: "LA" }, translationKey("usStates:label.louisiana", "Louisiana")),
|
|
47100
|
+
_objectSpread2({ value: "ME" }, translationKey("usStates:label.maine", "Maine")),
|
|
47101
|
+
_objectSpread2({ value: "MD" }, translationKey("usStates:label.maryland", "Maryland")),
|
|
47102
|
+
_objectSpread2({ value: "MA" }, translationKey("usStates:label.massachusetts", "Massachusetts")),
|
|
47103
|
+
_objectSpread2({ value: "MI" }, translationKey("usStates:label.michigan", "Michigan")),
|
|
47104
|
+
_objectSpread2({ value: "MN" }, translationKey("usStates:label.minnesota", "Minnesota")),
|
|
47105
|
+
_objectSpread2({ value: "MS" }, translationKey("usStates:label.mississippi", "Mississippi")),
|
|
47106
|
+
_objectSpread2({ value: "MO" }, translationKey("usStates:label.missouri", "Missouri")),
|
|
47107
|
+
_objectSpread2({ value: "MT" }, translationKey("usStates:label.montana", "Montana")),
|
|
47108
|
+
_objectSpread2({ value: "NE" }, translationKey("usStates:label.nebraska", "Nebraska")),
|
|
47109
|
+
_objectSpread2({ value: "NV" }, translationKey("usStates:label.nevada", "Nevada")),
|
|
47110
|
+
_objectSpread2({ value: "NH" }, translationKey("usStates:label.new_hampshire", "New Hampshire")),
|
|
47111
|
+
_objectSpread2({ value: "NJ" }, translationKey("usStates:label.new_jersey", "New Jersey")),
|
|
47112
|
+
_objectSpread2({ value: "NM" }, translationKey("usStates:label.new_mexico", "New Mexico")),
|
|
47113
|
+
_objectSpread2({ value: "NY" }, translationKey("usStates:label.new_york", "New York")),
|
|
47114
|
+
_objectSpread2({ value: "NC" }, translationKey("usStates:label.north_carolina", "North Carolina")),
|
|
47115
|
+
_objectSpread2({ value: "ND" }, translationKey("usStates:label.north_dakota", "North Dakota")),
|
|
47116
|
+
_objectSpread2({ value: "OH" }, translationKey("usStates:label.ohio", "Ohio")),
|
|
47117
|
+
_objectSpread2({ value: "OK" }, translationKey("usStates:label.oklahoma", "Oklahoma")),
|
|
47118
|
+
_objectSpread2({ value: "OR" }, translationKey("usStates:label.oregon", "Oregon")),
|
|
47119
|
+
_objectSpread2({ value: "PA" }, translationKey("usStates:label.pennsylvania", "Pennsylvania")),
|
|
47120
|
+
_objectSpread2({ value: "RI" }, translationKey("usStates:label.rhode_island", "Rhode Island")),
|
|
47121
|
+
_objectSpread2({ value: "SC" }, translationKey("usStates:label.south_carolina", "South Carolina")),
|
|
47122
|
+
_objectSpread2({ value: "SD" }, translationKey("usStates:label.south_dakota", "South Dakota")),
|
|
47123
|
+
_objectSpread2({ value: "TN" }, translationKey("usStates:label.tennessee", "Tennessee")),
|
|
47124
|
+
_objectSpread2({ value: "TX" }, translationKey("usStates:label.texas", "Texas")),
|
|
47125
|
+
_objectSpread2({ value: "UT" }, translationKey("usStates:label.utah", "Utah")),
|
|
47126
|
+
_objectSpread2({ value: "VT" }, translationKey("usStates:label.vermont", "Vermont")),
|
|
47127
|
+
_objectSpread2({ value: "VA" }, translationKey("usStates:label.virginia", "Virginia")),
|
|
47128
|
+
_objectSpread2({ value: "WA" }, translationKey("usStates:label.washington", "Washington")),
|
|
47129
|
+
_objectSpread2({ value: "WV" }, translationKey("usStates:label.west_virginia", "West Virginia")),
|
|
47130
|
+
_objectSpread2({ value: "WI" }, translationKey("usStates:label.wisconsin", "Wisconsin")),
|
|
47131
|
+
_objectSpread2({ value: "WY" }, translationKey("usStates:label.wyoming", "Wyoming")),
|
|
47132
|
+
_objectSpread2({ value: "PR" }, translationKey("usStates:label.puerto_rico", "Puerto Rico"))
|
|
47133
|
+
];
|
|
47134
|
+
var US_STATE_VALUES = US_STATES_CONFIG.map((s) => s.value);
|
|
47135
|
+
//#endregion
|
|
47136
|
+
//#region src/schemas/taxEstimates/filingStatus.ts
|
|
47137
|
+
var FilingStatus = /* @__PURE__ */ function(FilingStatus) {
|
|
47138
|
+
FilingStatus["SINGLE"] = "SINGLE";
|
|
47139
|
+
FilingStatus["MARRIED"] = "MARRIED";
|
|
47140
|
+
FilingStatus["MARRIED_SEPARATELY"] = "MARRIED_SEPARATELY";
|
|
47141
|
+
FilingStatus["HEAD"] = "HEAD";
|
|
47142
|
+
FilingStatus["WIDOWER"] = "WIDOWER";
|
|
47143
|
+
return FilingStatus;
|
|
47144
|
+
}({});
|
|
47145
|
+
var FilingStatusSchema = effect.Schema.Enums(FilingStatus);
|
|
47146
|
+
//#endregion
|
|
47147
|
+
//#region src/schemas/taxEstimates/profile.ts
|
|
47148
|
+
var USStateCodeSchema = effect.Schema.Literal(...US_STATE_VALUES);
|
|
47149
|
+
var WithholdingSchema = effect.Schema.Struct({
|
|
47150
|
+
useCustomWithholding: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(effect.Schema.Boolean)), effect.Schema.fromKey("use_custom_withholding")),
|
|
47151
|
+
amount: effect.Schema.NullishOr(effect.Schema.Number)
|
|
47152
|
+
});
|
|
47153
|
+
var HomeOfficeDeductionSchema = effect.Schema.Struct({
|
|
47154
|
+
useHomeOfficeDeduction: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(effect.Schema.Boolean)), effect.Schema.fromKey("use_home_office_deduction")),
|
|
47155
|
+
homeOfficeArea: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(effect.Schema.Number)), effect.Schema.fromKey("home_office_area"))
|
|
47156
|
+
});
|
|
47157
|
+
var VehicleDeductionSchema = effect.Schema.Struct({ useMileageDeduction: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(effect.Schema.Boolean)), effect.Schema.fromKey("use_mileage_deduction")) });
|
|
47158
|
+
var DeductionsSchema = effect.Schema.Struct({
|
|
47159
|
+
homeOffice: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(HomeOfficeDeductionSchema)), effect.Schema.fromKey("home_office")),
|
|
47160
|
+
vehicle: effect.Schema.NullishOr(VehicleDeductionSchema)
|
|
47161
|
+
});
|
|
47162
|
+
var FederalConfigurationSchema = effect.Schema.Struct({
|
|
47163
|
+
filingStatus: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(FilingStatusSchema)), effect.Schema.fromKey("filing_status")),
|
|
47164
|
+
annualW2Income: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(effect.Schema.Number)), effect.Schema.fromKey("annual_w2_income")),
|
|
47165
|
+
tipIncome: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(effect.Schema.Number)), effect.Schema.fromKey("tip_income")),
|
|
47166
|
+
overtimeIncome: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(effect.Schema.Number)), effect.Schema.fromKey("overtime_income")),
|
|
47167
|
+
withholding: effect.Schema.NullishOr(WithholdingSchema)
|
|
47168
|
+
});
|
|
47169
|
+
var StateConfigurationSchema = effect.Schema.Struct({
|
|
47170
|
+
taxState: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(USStateCodeSchema)), effect.Schema.fromKey("tax_state")),
|
|
47171
|
+
filingStatus: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(FilingStatusSchema)), effect.Schema.fromKey("filing_status")),
|
|
47172
|
+
withholding: effect.Schema.NullishOr(WithholdingSchema)
|
|
47173
|
+
});
|
|
47174
|
+
var UsConfigurationSchema = effect.Schema.Struct({
|
|
47175
|
+
federal: effect.Schema.NullishOr(FederalConfigurationSchema),
|
|
47176
|
+
state: effect.Schema.NullishOr(StateConfigurationSchema),
|
|
47177
|
+
deductions: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(DeductionsSchema)), effect.Schema.fromKey("deductions"))
|
|
47178
|
+
});
|
|
47179
|
+
var TaxProfileSchema = effect.Schema.Struct({
|
|
47180
|
+
taxCountryCode: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(effect.Schema.String)), effect.Schema.fromKey("tax_country_code")),
|
|
47181
|
+
usConfiguration: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(UsConfigurationSchema)), effect.Schema.fromKey("us_configuration")),
|
|
47182
|
+
userHasSavedTaxProfile: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.Boolean), effect.Schema.fromKey("user_has_saved_tax_profile"))
|
|
47183
|
+
});
|
|
47184
|
+
var TaxProfileResponseSchema = effect.Schema.Struct({ data: TaxProfileSchema });
|
|
47185
|
+
var TaxProfileRequestSchema = effect.Schema.Struct({
|
|
47186
|
+
taxCountryCode: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(effect.Schema.String)), effect.Schema.fromKey("tax_country_code")),
|
|
47187
|
+
usConfiguration: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(UsConfigurationSchema)), effect.Schema.fromKey("us_configuration"))
|
|
47188
|
+
});
|
|
47189
|
+
//#endregion
|
|
47190
|
+
//#region src/hooks/api/businesses/[business-id]/tax-estimates/profile/useTaxProfile.ts
|
|
47191
|
+
var TAX_PROFILE_TAG_KEY = "#tax-profile";
|
|
47192
|
+
var getTaxProfile = get$1(({ businessId }) => {
|
|
47193
|
+
return `/v1/businesses/${businessId}/tax-estimates/profile`;
|
|
47194
|
+
});
|
|
47195
|
+
function buildKey$17({ access_token: accessToken, apiUrl, businessId }) {
|
|
47196
|
+
if (accessToken && apiUrl) return {
|
|
47197
|
+
accessToken,
|
|
47198
|
+
apiUrl,
|
|
47199
|
+
businessId,
|
|
47200
|
+
tags: [TAX_PROFILE_TAG_KEY]
|
|
47201
|
+
};
|
|
47202
|
+
}
|
|
47203
|
+
function useTaxProfile() {
|
|
47204
|
+
const withLocale = useLocalizedKey();
|
|
47205
|
+
const { data: auth } = useAuth();
|
|
47206
|
+
const { businessId } = useLayerContext();
|
|
47207
|
+
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$17(_objectSpread2(_objectSpread2({}, auth), {}, { businessId }))), function() {
|
|
47208
|
+
var _ref = _asyncToGenerator(function* ({ accessToken, apiUrl, businessId }) {
|
|
47209
|
+
return getTaxProfile(apiUrl, accessToken, { params: { businessId } })().then(effect.Schema.decodeUnknownPromise(TaxProfileResponseSchema)).then(({ data }) => data);
|
|
47210
|
+
});
|
|
47211
|
+
return function(_x) {
|
|
47212
|
+
return _ref.apply(this, arguments);
|
|
47213
|
+
};
|
|
47214
|
+
}()));
|
|
47215
|
+
}
|
|
47216
|
+
function useTaxProfileGlobalCacheActions() {
|
|
47217
|
+
const { patchCache } = useGlobalCacheActions();
|
|
47218
|
+
return { patchTaxProfile: (0, react.useCallback)((updatedProfile) => patchCache(({ tags }) => tags.includes(TAX_PROFILE_TAG_KEY), () => updatedProfile), [patchCache]) };
|
|
47219
|
+
}
|
|
47220
|
+
//#endregion
|
|
47221
|
+
//#region src/components/SolopreneurOnboardingBanner/SolopreneurOnboardingBanner.tsx
|
|
47222
|
+
var OnboardingBannerState = /* @__PURE__ */ function(OnboardingBannerState) {
|
|
47223
|
+
OnboardingBannerState["Loading"] = "Loading";
|
|
47224
|
+
OnboardingBannerState["NoBankAccountsLinked"] = "NoBankAccountsLinked";
|
|
47225
|
+
OnboardingBannerState["NoTaxProfile"] = "NoTaxProfile";
|
|
47226
|
+
OnboardingBannerState["Onboarded"] = "Onboarded";
|
|
47227
|
+
return OnboardingBannerState;
|
|
47228
|
+
}(OnboardingBannerState || {});
|
|
47229
|
+
var getOnboardingBannerState = ({ isLoading, hasLinkedAccounts, hasSavedTaxProfile }) => {
|
|
47230
|
+
if (isLoading) return OnboardingBannerState.Loading;
|
|
47231
|
+
if (!hasLinkedAccounts) return OnboardingBannerState.NoBankAccountsLinked;
|
|
47232
|
+
if (!hasSavedTaxProfile) return OnboardingBannerState.NoTaxProfile;
|
|
47233
|
+
return OnboardingBannerState.Onboarded;
|
|
47234
|
+
};
|
|
47235
|
+
var NoBankAccountsLinkedBanner = () => {
|
|
47236
|
+
const { addConnection } = (0, react.useContext)(LinkedAccountsContext);
|
|
47237
|
+
const { isMobile } = useSizeClass();
|
|
47238
|
+
const handleLinkBankAccounts = (0, react.useCallback)(() => {
|
|
47239
|
+
addConnection("PLAID");
|
|
47240
|
+
}, [addConnection]);
|
|
47241
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Banner, {
|
|
47242
|
+
title: "Link your bank accounts",
|
|
47243
|
+
description: "Linking your bank accounts allows us to load your bank transactions and automatically categorize them.",
|
|
47244
|
+
slots: {
|
|
47245
|
+
Icon: isMobile ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Info, { size: 16 }),
|
|
47246
|
+
Button: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button$1, {
|
|
47247
|
+
onPress: handleLinkBankAccounts,
|
|
47248
|
+
variant: "outlined-light",
|
|
47249
|
+
children: "Link your bank accounts"
|
|
47250
|
+
})
|
|
47251
|
+
}
|
|
47252
|
+
});
|
|
47253
|
+
};
|
|
47254
|
+
var NoTaxProfileBanner = ({ onSetupTaxProfile }) => {
|
|
47255
|
+
const { isMobile } = useSizeClass();
|
|
47256
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Banner, {
|
|
47257
|
+
title: "Set up your tax profile",
|
|
47258
|
+
description: "Configuring your tax profile allows us to provide you with tax estimates and avoid any surprises come tax time.",
|
|
47259
|
+
slots: {
|
|
47260
|
+
Icon: isMobile ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Info, { size: 16 }),
|
|
47261
|
+
Button: onSetupTaxProfile ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button$1, {
|
|
47262
|
+
onPress: onSetupTaxProfile,
|
|
47263
|
+
variant: "outlined-light",
|
|
47264
|
+
children: "Setup your tax profile"
|
|
47265
|
+
}) : null
|
|
47266
|
+
}
|
|
47267
|
+
});
|
|
47268
|
+
};
|
|
47269
|
+
function SolopreneurOnboardingBannerInternal({ onSetupTaxProfile }) {
|
|
47270
|
+
const state = useSolopreneurOnboardingBannerState();
|
|
47271
|
+
if (state === OnboardingBannerState.Loading || state === OnboardingBannerState.Onboarded) return null;
|
|
47272
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(HStack, {
|
|
47273
|
+
className: "Layer__SolopreneurLayout__OnboardingBanner",
|
|
47274
|
+
children: [state === OnboardingBannerState.NoBankAccountsLinked && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(NoBankAccountsLinkedBanner, {}), state === OnboardingBannerState.NoTaxProfile && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(NoTaxProfileBanner, { onSetupTaxProfile })]
|
|
47275
|
+
});
|
|
47276
|
+
}
|
|
47277
|
+
function SolopreneurOnboardingBanner({ onSetupTaxProfile }) {
|
|
47278
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LinkedAccountsProvider, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SolopreneurOnboardingBannerInternal, { onSetupTaxProfile }) });
|
|
47279
|
+
}
|
|
47280
|
+
var useSolopreneurOnboardingBannerState = () => {
|
|
47281
|
+
const { data: linkedAccounts, isLoading: isLinkedAccountsLoading, loadingStatus: linkedAccountsLoadingStatus } = (0, react.useContext)(LinkedAccountsContext);
|
|
47282
|
+
const { data: taxProfile, isLoading: isTaxProfileLoading } = useTaxProfile();
|
|
47283
|
+
return getOnboardingBannerState({
|
|
47284
|
+
isLoading: isLinkedAccountsLoading || isTaxProfileLoading || linkedAccountsLoadingStatus === "loading" || linkedAccountsLoadingStatus === "initial",
|
|
47285
|
+
hasLinkedAccounts: Array.isArray(linkedAccounts) && linkedAccounts.length > 0,
|
|
47286
|
+
hasSavedTaxProfile: (taxProfile === null || taxProfile === void 0 ? void 0 : taxProfile.userHasSavedTaxProfile) === true
|
|
47287
|
+
});
|
|
47288
|
+
};
|
|
47289
|
+
//#endregion
|
|
47290
|
+
//#region src/components/TaxEstimatesSummaryCard/constants.ts
|
|
47291
|
+
var resolveCategoryColor = ({ key }) => {
|
|
47292
|
+
var _federal$state$key;
|
|
47293
|
+
return (_federal$state$key = {
|
|
47294
|
+
federal: DEFAULT_CHART_COLORS[0],
|
|
47295
|
+
state: DEFAULT_CHART_COLORS[1]
|
|
47296
|
+
}[key]) !== null && _federal$state$key !== void 0 ? _federal$state$key : DEFAULT_CHART_COLORS[0];
|
|
47297
|
+
};
|
|
47298
|
+
var TaxEstimatesSummaryCardMode = /* @__PURE__ */ function(TaxEstimatesSummaryCardMode) {
|
|
47299
|
+
TaxEstimatesSummaryCardMode["PieChart"] = "PieChart";
|
|
47300
|
+
TaxEstimatesSummaryCardMode["HorizontalBarChart"] = "HorizontalBarChart";
|
|
47301
|
+
return TaxEstimatesSummaryCardMode;
|
|
47302
|
+
}({});
|
|
47303
|
+
//#endregion
|
|
47304
|
+
//#region src/components/TaxEstimatesSummaryCard/states/TaxEstimatesSummaryCardError.tsx
|
|
47305
|
+
var TaxEstimatesSummaryCardError = () => {
|
|
47306
|
+
const { t } = (0, react_i18next.useTranslation)();
|
|
47307
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DataState, {
|
|
47308
|
+
className: "Layer__TaxEstimatesSummaryCard__DataState Layer__data-state--reset",
|
|
47309
|
+
status: DataStateStatus.failed,
|
|
47310
|
+
title: t("taxEstimates:error.load_tax_estimates_summary", "We couldn't load your tax summary"),
|
|
47311
|
+
description: t("taxEstimates:error.while_loading_tax_estimates_summary", "An error occurred while loading your tax summary. Please check your connection and try again.")
|
|
47312
|
+
});
|
|
47313
|
+
};
|
|
47314
|
+
//#endregion
|
|
47315
|
+
//#region src/components/TaxEstimatesSummaryCard/states/TaxEstimatesSummaryCardLoading.tsx
|
|
47316
|
+
var TaxEstimatesSummaryCardLoading = ({ mode }) => {
|
|
47317
|
+
if (mode === TaxEstimatesSummaryCardMode.HorizontalBarChart) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(VStack, {
|
|
47318
|
+
gap: "md",
|
|
47319
|
+
className: "Layer__TaxEstimatesSummaryCard__Content",
|
|
47320
|
+
pb: "md",
|
|
47321
|
+
pi: "lg",
|
|
47322
|
+
children: [
|
|
47323
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SkeletonLoader, {
|
|
47324
|
+
height: "24px",
|
|
47325
|
+
width: "40%"
|
|
47326
|
+
}),
|
|
47327
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SkeletonLoader, {
|
|
47328
|
+
height: "24px",
|
|
47329
|
+
width: "100%"
|
|
47330
|
+
}),
|
|
47331
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SkeletonLoader, {
|
|
47332
|
+
height: "16px",
|
|
47333
|
+
width: "100%"
|
|
47334
|
+
})
|
|
47335
|
+
]
|
|
47336
|
+
});
|
|
47337
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(VStack, {
|
|
47338
|
+
gap: "md",
|
|
47339
|
+
className: "Layer__TaxEstimatesSummaryCard__Content",
|
|
47340
|
+
pb: "md",
|
|
47341
|
+
pi: "lg",
|
|
47342
|
+
align: "center",
|
|
47343
|
+
children: [
|
|
47344
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(CircleSkeletonLoader, {
|
|
47345
|
+
height: "128px",
|
|
47346
|
+
width: "128px"
|
|
47347
|
+
}),
|
|
47348
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SkeletonLoader, {
|
|
47349
|
+
height: "24px",
|
|
47350
|
+
width: "80%"
|
|
47351
|
+
}),
|
|
47352
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SkeletonLoader, {
|
|
47353
|
+
height: "24px",
|
|
47354
|
+
width: "80%"
|
|
47355
|
+
}),
|
|
47356
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SkeletonLoader, {
|
|
47357
|
+
height: "24px",
|
|
47358
|
+
width: "80%"
|
|
47359
|
+
})
|
|
47360
|
+
]
|
|
47105
47361
|
});
|
|
47106
47362
|
};
|
|
47107
47363
|
//#endregion
|
|
47364
|
+
//#region src/schemas/taxEstimates/summary.ts
|
|
47365
|
+
var TaxSummarySectionTypeSchema = effect.Schema.Literal("federal", "state");
|
|
47366
|
+
var TaxSummaryState = /* @__PURE__ */ function(TaxSummaryState) {
|
|
47367
|
+
TaxSummaryState["NO_TRANSACTIONS"] = "NO_TRANSACTIONS";
|
|
47368
|
+
TaxSummaryState["NO_TAXES_OWED"] = "NO_TAXES_OWED";
|
|
47369
|
+
TaxSummaryState["TAXES_OWED"] = "TAXES_OWED";
|
|
47370
|
+
TaxSummaryState["UNKNOWN"] = "UNKNOWN";
|
|
47371
|
+
return TaxSummaryState;
|
|
47372
|
+
}({});
|
|
47373
|
+
var TransformedTaxSummaryStateSchema = createTransformedEnumSchema(effect.Schema.Enums(TaxSummaryState), TaxSummaryState, TaxSummaryState.UNKNOWN);
|
|
47374
|
+
var TaxSummarySectionSchema = effect.Schema.Struct({
|
|
47375
|
+
type: TaxSummarySectionTypeSchema,
|
|
47376
|
+
key: effect.Schema.NullishOr(effect.Schema.String),
|
|
47377
|
+
label: effect.Schema.String,
|
|
47378
|
+
total: effect.Schema.Number,
|
|
47379
|
+
taxesPaid: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.Number), effect.Schema.fromKey("taxes_paid")),
|
|
47380
|
+
taxesOwed: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.Number), effect.Schema.fromKey("taxes_owed"))
|
|
47381
|
+
});
|
|
47382
|
+
var TaxSummarySchema = effect.Schema.Struct({
|
|
47383
|
+
year: effect.Schema.Number,
|
|
47384
|
+
state: TransformedTaxSummaryStateSchema,
|
|
47385
|
+
projectedTaxesOwed: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.Number), effect.Schema.fromKey("projected_taxes_owed")),
|
|
47386
|
+
taxesDueAt: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.Date), effect.Schema.fromKey("taxes_due_at")),
|
|
47387
|
+
uncategorizedTaxPayments: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.Number), effect.Schema.fromKey("uncategorized_tax_payments")),
|
|
47388
|
+
sections: effect.Schema.Array(TaxSummarySectionSchema)
|
|
47389
|
+
});
|
|
47390
|
+
var TaxSummaryResponseSchema = effect.Schema.Struct({ data: TaxSummarySchema });
|
|
47391
|
+
//#endregion
|
|
47108
47392
|
//#region src/components/ui/Swatch/Swatch.tsx
|
|
47109
47393
|
var Swatch = ({ color, opacity, pattern }) => {
|
|
47110
47394
|
const patternId = (0, react.useId)();
|
|
@@ -47234,11 +47518,18 @@ var CHART_MARGIN$1 = {
|
|
|
47234
47518
|
};
|
|
47235
47519
|
var CHART_BORDER_RADIUS$1 = 8;
|
|
47236
47520
|
var Y_AXIS_CATEGORY_KEY = "__layer_hbar_category";
|
|
47521
|
+
var SMALL_SEGMENT_THRESHOLD = .25;
|
|
47522
|
+
function determineLabelMode(requestedLabelMode, positiveItems, legendDenominator) {
|
|
47523
|
+
if (legendDenominator <= 0) return LegendLayout.Table;
|
|
47524
|
+
if (positiveItems.some((item) => item.value / legendDenominator < SMALL_SEGMENT_THRESHOLD)) return LegendLayout.Table;
|
|
47525
|
+
return requestedLabelMode;
|
|
47526
|
+
}
|
|
47237
47527
|
var HorizontalBarChart = ({ data, stylingProps, formatValue, showLegend = true, labelMode = LegendLayout.Table, slots }) => {
|
|
47238
47528
|
const { data: items, total } = data;
|
|
47239
47529
|
const positiveItems = (0, react.useMemo)(() => items.filter((item) => item.value > 0), [items]);
|
|
47240
47530
|
const positiveTotal = positiveItems.reduce((sum, item) => sum + item.value, 0);
|
|
47241
47531
|
const legendDenominator = positiveTotal > 0 ? positiveTotal : total;
|
|
47532
|
+
const effectiveLabelMode = determineLabelMode(labelMode, positiveItems, legendDenominator);
|
|
47242
47533
|
const chartData = (0, react.useMemo)(() => {
|
|
47243
47534
|
return [positiveItems.reduce((acc, item) => {
|
|
47244
47535
|
acc[item.name] = item.value;
|
|
@@ -47251,7 +47542,7 @@ var HorizontalBarChart = ({ data, stylingProps, formatValue, showLegend = true,
|
|
|
47251
47542
|
total: legendDenominator,
|
|
47252
47543
|
colorSelector: stylingProps.colorSelector,
|
|
47253
47544
|
formatValue,
|
|
47254
|
-
layout:
|
|
47545
|
+
layout: effectiveLabelMode
|
|
47255
47546
|
});
|
|
47256
47547
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(VStack, {
|
|
47257
47548
|
className: "Layer__HorizontalBarChart Layer__UI__Chart--focusReset",
|
|
@@ -47309,33 +47600,106 @@ var HorizontalBarChart = ({ data, stylingProps, formatValue, showLegend = true,
|
|
|
47309
47600
|
});
|
|
47310
47601
|
};
|
|
47311
47602
|
//#endregion
|
|
47312
|
-
//#region src/components/TaxEstimatesSummaryCard/
|
|
47313
|
-
|
|
47314
|
-
|
|
47315
|
-
return (
|
|
47316
|
-
|
|
47317
|
-
|
|
47318
|
-
|
|
47603
|
+
//#region src/components/TaxEstimatesSummaryCard/states/TaxEstimatesSummaryCardEmpty.tsx
|
|
47604
|
+
function TaxEstimatesSummaryCardEmpty() {
|
|
47605
|
+
const { t } = (0, react_i18next.useTranslation)();
|
|
47606
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DataState, {
|
|
47607
|
+
className: "Layer__TaxEstimatesSummaryCard__DataState Layer__data-state--reset",
|
|
47608
|
+
status: DataStateStatus.info,
|
|
47609
|
+
title: t("taxEstimates:empty.no_tax_estimates_summary", "Get started with your tax estimates"),
|
|
47610
|
+
description: t("taxEstimates:empty.no_tax_estimates_summary_description", "Start by importing and categorizing your bank transactions.")
|
|
47611
|
+
});
|
|
47612
|
+
}
|
|
47613
|
+
//#endregion
|
|
47614
|
+
//#region src/components/TaxEstimatesSummaryCard/states/TaxEstimatesSummaryCardNegativeOrZero.tsx
|
|
47615
|
+
var TaxEstimatesSummaryCardNegativeOrZero = () => {
|
|
47616
|
+
const { t } = (0, react_i18next.useTranslation)();
|
|
47617
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DataState, {
|
|
47618
|
+
className: "Layer__TaxEstimatesSummaryCard__DataState Layer__data-state--reset",
|
|
47619
|
+
status: DataStateStatus.info,
|
|
47620
|
+
title: t("taxEstimates:error.tax_due_is_negative_or_zero", "No taxes owed this year"),
|
|
47621
|
+
description: t("taxEstimates:error.tax_due_is_negative_or_zero_description", "Your deductible losses exceed your income for this period, bringing your tax liability to zero.")
|
|
47622
|
+
});
|
|
47319
47623
|
};
|
|
47320
47624
|
//#endregion
|
|
47321
|
-
//#region src/
|
|
47322
|
-
var
|
|
47323
|
-
|
|
47324
|
-
|
|
47325
|
-
|
|
47326
|
-
|
|
47327
|
-
|
|
47328
|
-
|
|
47329
|
-
|
|
47330
|
-
|
|
47331
|
-
|
|
47332
|
-
|
|
47333
|
-
|
|
47334
|
-
|
|
47335
|
-
|
|
47336
|
-
|
|
47337
|
-
}
|
|
47338
|
-
|
|
47625
|
+
//#region src/components/TaxEstimatesSummaryCard/TaxEstimatesSummaryCardContent.tsx
|
|
47626
|
+
var Content = ({ state, data, mode, layout }) => {
|
|
47627
|
+
const commonProps = (0, react.useMemo)(() => {
|
|
47628
|
+
var _data$data;
|
|
47629
|
+
const colorByKey = data === null || data === void 0 || (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data.reduce((acc, item) => {
|
|
47630
|
+
acc[item.name] = resolveCategoryColor({ key: item.name });
|
|
47631
|
+
return acc;
|
|
47632
|
+
}, {});
|
|
47633
|
+
return {
|
|
47634
|
+
interactionProps: NO_OP_INTERACTION_PROPS,
|
|
47635
|
+
stylingProps: { colorSelector: (item) => {
|
|
47636
|
+
var _colorByKey$item$name;
|
|
47637
|
+
return {
|
|
47638
|
+
color: (_colorByKey$item$name = colorByKey === null || colorByKey === void 0 ? void 0 : colorByKey[item.name]) !== null && _colorByKey$item$name !== void 0 ? _colorByKey$item$name : "var(--color-base-300)",
|
|
47639
|
+
opacity: 1
|
|
47640
|
+
};
|
|
47641
|
+
} }
|
|
47642
|
+
};
|
|
47643
|
+
}, [data]);
|
|
47644
|
+
switch (state) {
|
|
47645
|
+
case TaxSummaryState.NO_TRANSACTIONS: return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TaxEstimatesSummaryCardEmpty, {});
|
|
47646
|
+
case TaxSummaryState.NO_TAXES_OWED: return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TaxEstimatesSummaryCardNegativeOrZero, {});
|
|
47647
|
+
case TaxSummaryState.UNKNOWN:
|
|
47648
|
+
case TaxSummaryState.TAXES_OWED:
|
|
47649
|
+
if (mode === TaxEstimatesSummaryCardMode.HorizontalBarChart) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(HorizontalBarChartContent, {
|
|
47650
|
+
data,
|
|
47651
|
+
commonProps
|
|
47652
|
+
});
|
|
47653
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PieChartContent, {
|
|
47654
|
+
data,
|
|
47655
|
+
commonProps,
|
|
47656
|
+
layout
|
|
47657
|
+
});
|
|
47658
|
+
}
|
|
47659
|
+
};
|
|
47660
|
+
var HorizontalBarChartContent = ({ data, commonProps }) => {
|
|
47661
|
+
const { t } = (0, react_i18next.useTranslation)();
|
|
47662
|
+
const { formatCurrencyFromCents } = useIntlFormatter();
|
|
47663
|
+
const { isDesktop } = useSizeClass();
|
|
47664
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(VStack, {
|
|
47665
|
+
className: "Layer__TaxEstimatesSummaryCard__Content Layer__TaxEstimatesSummaryCard__Content--horizontal",
|
|
47666
|
+
gap: "md",
|
|
47667
|
+
pi: "lg",
|
|
47668
|
+
pbe: "lg",
|
|
47669
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(HStack, {
|
|
47670
|
+
className: "Layer__TaxEstimatesSummaryCard__TotalRow",
|
|
47671
|
+
justify: "space-between",
|
|
47672
|
+
align: "baseline",
|
|
47673
|
+
gap: "md",
|
|
47674
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Span, {
|
|
47675
|
+
size: "md",
|
|
47676
|
+
variant: "subtle",
|
|
47677
|
+
children: t("common:label.total", "Total")
|
|
47678
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Span, {
|
|
47679
|
+
size: "xl",
|
|
47680
|
+
weight: "bold",
|
|
47681
|
+
numeric: "tabular-nums",
|
|
47682
|
+
className: "Layer__TaxEstimatesSummaryCard__TotalValue",
|
|
47683
|
+
children: formatCurrencyFromCents(data.total)
|
|
47684
|
+
})]
|
|
47685
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(HorizontalBarChart, {
|
|
47686
|
+
data,
|
|
47687
|
+
stylingProps: commonProps.stylingProps,
|
|
47688
|
+
formatValue: formatCurrencyFromCents,
|
|
47689
|
+
labelMode: isDesktop ? LegendLayout.Aligned : LegendLayout.Table
|
|
47690
|
+
})]
|
|
47691
|
+
});
|
|
47692
|
+
};
|
|
47693
|
+
var PieChartContent = ({ data, commonProps, layout }) => {
|
|
47694
|
+
const { isMobile } = useSizeClass();
|
|
47695
|
+
const isVerticalLayout = isMobile || layout === "summaryCard";
|
|
47696
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Stack, _objectSpread2(_objectSpread2({}, {
|
|
47697
|
+
direction: isVerticalLayout ? "column" : "row",
|
|
47698
|
+
className: (0, classnames.default)("Layer__TaxEstimatesSummaryCard__Content", isVerticalLayout && "Layer__TaxEstimatesSummaryCard__Content--mobile"),
|
|
47699
|
+
gap: "lg",
|
|
47700
|
+
align: isVerticalLayout ? void 0 : "center"
|
|
47701
|
+
}), {}, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(DetailedChart, _objectSpread2({ data }, commonProps)), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DetailedTableWithData, _objectSpread2(_objectSpread2({ data }, commonProps), NO_SORT_PROPS))] }));
|
|
47702
|
+
};
|
|
47339
47703
|
//#endregion
|
|
47340
47704
|
//#region src/hooks/api/businesses/[business-id]/tax-estimates/summary/useTaxSummary.ts
|
|
47341
47705
|
var TAX_SUMMARY_TAG_KEY = "#tax-summary";
|
|
@@ -47346,7 +47710,7 @@ var getTaxSummary = get$1(({ businessId, year, reportingBasis, fullYearProjectio
|
|
|
47346
47710
|
full_year_projection: fullYearProjection
|
|
47347
47711
|
})}`;
|
|
47348
47712
|
});
|
|
47349
|
-
function buildKey$
|
|
47713
|
+
function buildKey$16({ access_token: accessToken, apiUrl, businessId, year, reportingBasis, fullYearProjection, enabled = true }) {
|
|
47350
47714
|
if (!enabled) return;
|
|
47351
47715
|
if (accessToken && apiUrl) return {
|
|
47352
47716
|
accessToken,
|
|
@@ -47362,7 +47726,7 @@ function useTaxSummary({ year, reportingBasis, fullYearProjection, enabled = tru
|
|
|
47362
47726
|
const withLocale = useLocalizedKey();
|
|
47363
47727
|
const { data: auth } = useAuth();
|
|
47364
47728
|
const { businessId } = useLayerContext();
|
|
47365
|
-
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$
|
|
47729
|
+
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$16(_objectSpread2(_objectSpread2({}, auth), {}, {
|
|
47366
47730
|
businessId,
|
|
47367
47731
|
year,
|
|
47368
47732
|
reportingBasis,
|
|
@@ -47472,6 +47836,7 @@ var prepareTaxSummaryData = (taxSummaryData, shortenedDisplayName, isMobile) =>
|
|
|
47472
47836
|
}));
|
|
47473
47837
|
};
|
|
47474
47838
|
var useTaxEstimatesSummaryCard = () => {
|
|
47839
|
+
var _taxSummaryData$state;
|
|
47475
47840
|
const { year } = useTaxEstimatesYear();
|
|
47476
47841
|
const { fullYearProjection } = useFullYearProjection();
|
|
47477
47842
|
const { t } = (0, react_i18next.useTranslation)();
|
|
@@ -47501,245 +47866,79 @@ var useTaxEstimatesSummaryCard = () => {
|
|
|
47501
47866
|
]),
|
|
47502
47867
|
isLoading,
|
|
47503
47868
|
isError,
|
|
47869
|
+
state: (_taxSummaryData$state = taxSummaryData === null || taxSummaryData === void 0 ? void 0 : taxSummaryData.state) !== null && _taxSummaryData$state !== void 0 ? _taxSummaryData$state : TaxSummaryState.TAXES_OWED,
|
|
47504
47870
|
layout: isDesktop ? "taxOverview" : "summaryCard",
|
|
47505
47871
|
title: t("taxEstimates:label.tax_summary", "Tax Summary")
|
|
47506
47872
|
};
|
|
47507
47873
|
};
|
|
47508
47874
|
//#endregion
|
|
47509
47875
|
//#region src/components/TaxEstimatesSummaryCard/TaxEstimatesSummaryCard.tsx
|
|
47510
|
-
var
|
|
47511
|
-
|
|
47512
|
-
gap: "md",
|
|
47513
|
-
className: "Layer__TaxEstimatesSummaryCard__Content",
|
|
47514
|
-
pb: "md",
|
|
47515
|
-
pi: "lg",
|
|
47516
|
-
children: [
|
|
47517
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SkeletonLoader, {
|
|
47518
|
-
height: "24px",
|
|
47519
|
-
width: "40%"
|
|
47520
|
-
}),
|
|
47521
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SkeletonLoader, {
|
|
47522
|
-
height: "24px",
|
|
47523
|
-
width: "100%"
|
|
47524
|
-
}),
|
|
47525
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SkeletonLoader, {
|
|
47526
|
-
height: "16px",
|
|
47527
|
-
width: "100%"
|
|
47528
|
-
})
|
|
47529
|
-
]
|
|
47530
|
-
});
|
|
47531
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(VStack, {
|
|
47532
|
-
gap: "md",
|
|
47533
|
-
className: "Layer__TaxEstimatesSummaryCard__Content",
|
|
47534
|
-
pb: "md",
|
|
47535
|
-
pi: "lg",
|
|
47536
|
-
align: "center",
|
|
47537
|
-
children: [
|
|
47538
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(CircleSkeletonLoader, {
|
|
47539
|
-
height: "128px",
|
|
47540
|
-
width: "128px"
|
|
47541
|
-
}),
|
|
47542
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SkeletonLoader, {
|
|
47543
|
-
height: "24px",
|
|
47544
|
-
width: "80%"
|
|
47545
|
-
}),
|
|
47546
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SkeletonLoader, {
|
|
47547
|
-
height: "24px",
|
|
47548
|
-
width: "80%"
|
|
47549
|
-
}),
|
|
47550
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SkeletonLoader, {
|
|
47551
|
-
height: "24px",
|
|
47552
|
-
width: "80%"
|
|
47553
|
-
})
|
|
47554
|
-
]
|
|
47555
|
-
});
|
|
47556
|
-
};
|
|
47557
|
-
var ErrorState$2 = () => {
|
|
47558
|
-
const { t } = (0, react_i18next.useTranslation)();
|
|
47559
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(VStack, {
|
|
47560
|
-
gap: "md",
|
|
47561
|
-
className: "Layer__TaxEstimatesSummaryCard__Content",
|
|
47562
|
-
pb: "md",
|
|
47563
|
-
pi: "lg",
|
|
47564
|
-
align: "center",
|
|
47565
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Span, {
|
|
47566
|
-
size: "lg",
|
|
47567
|
-
children: t("taxEstimates:error.load_tax_estimates_summary", "We couldn't load your tax summary")
|
|
47568
|
-
})
|
|
47569
|
-
});
|
|
47570
|
-
};
|
|
47571
|
-
function allTaxSectionsAreEmpty(summary) {
|
|
47572
|
-
return summary.data.every((section) => section.value === 0);
|
|
47573
|
-
}
|
|
47574
|
-
function TaxEstimatesSummaryCardEmpty() {
|
|
47575
|
-
const { t } = (0, react_i18next.useTranslation)();
|
|
47576
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DataState, {
|
|
47577
|
-
status: DataStateStatus.info,
|
|
47578
|
-
title: t("taxEstimates:empty.no_tax_estimates_summary", "Get started with your tax estimates"),
|
|
47579
|
-
description: t("taxEstimates:empty.no_tax_estimates_summary_description", "Start by importing and categorizing your bank transactions"),
|
|
47580
|
-
spacing: true
|
|
47581
|
-
});
|
|
47582
|
-
}
|
|
47583
|
-
var TaxEstimatesSummaryCardMode = /* @__PURE__ */ function(TaxEstimatesSummaryCardMode) {
|
|
47584
|
-
TaxEstimatesSummaryCardMode["PieChart"] = "PieChart";
|
|
47585
|
-
TaxEstimatesSummaryCardMode["HorizontalBarChart"] = "HorizontalBarChart";
|
|
47586
|
-
return TaxEstimatesSummaryCardMode;
|
|
47587
|
-
}({});
|
|
47588
|
-
var Content = ({ data, mode, commonProps, layout }) => {
|
|
47589
|
-
if (mode === TaxEstimatesSummaryCardMode.HorizontalBarChart) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(HorizontalBarChartContent, {
|
|
47590
|
-
data,
|
|
47591
|
-
commonProps
|
|
47592
|
-
});
|
|
47593
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PieChartContent, {
|
|
47594
|
-
data,
|
|
47595
|
-
commonProps,
|
|
47596
|
-
layout
|
|
47597
|
-
});
|
|
47598
|
-
};
|
|
47599
|
-
var HorizontalBarChartContent = ({ data, commonProps }) => {
|
|
47600
|
-
const { t } = (0, react_i18next.useTranslation)();
|
|
47601
|
-
const { formatCurrencyFromCents } = useIntlFormatter();
|
|
47602
|
-
const { isDesktop } = useSizeClass();
|
|
47603
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(VStack, {
|
|
47604
|
-
className: "Layer__TaxEstimatesSummaryCard__Content Layer__TaxEstimatesSummaryCard__Content--horizontal",
|
|
47605
|
-
gap: "md",
|
|
47606
|
-
pi: "lg",
|
|
47607
|
-
pbe: "lg",
|
|
47608
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(HStack, {
|
|
47609
|
-
className: "Layer__TaxEstimatesSummaryCard__TotalRow",
|
|
47610
|
-
justify: "space-between",
|
|
47611
|
-
align: "baseline",
|
|
47612
|
-
gap: "md",
|
|
47613
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Span, {
|
|
47614
|
-
size: "md",
|
|
47615
|
-
variant: "subtle",
|
|
47616
|
-
children: t("common:label.total", "Total")
|
|
47617
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Span, {
|
|
47618
|
-
size: "xl",
|
|
47619
|
-
weight: "bold",
|
|
47620
|
-
numeric: "tabular-nums",
|
|
47621
|
-
className: "Layer__TaxEstimatesSummaryCard__TotalValue",
|
|
47622
|
-
children: formatCurrencyFromCents(data.total)
|
|
47623
|
-
})]
|
|
47624
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(HorizontalBarChart, {
|
|
47625
|
-
data,
|
|
47626
|
-
stylingProps: commonProps.stylingProps,
|
|
47627
|
-
formatValue: formatCurrencyFromCents,
|
|
47628
|
-
labelMode: isDesktop ? LegendLayout.Aligned : LegendLayout.Table
|
|
47629
|
-
})]
|
|
47630
|
-
});
|
|
47631
|
-
};
|
|
47632
|
-
var PieChartContent = ({ data, commonProps, layout }) => {
|
|
47633
|
-
const { isMobile } = useSizeClass();
|
|
47634
|
-
return isMobile || layout === "summaryCard" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(VStack, {
|
|
47635
|
-
className: "Layer__TaxEstimatesSummaryCard__Content Layer__TaxEstimatesSummaryCard__Content--mobile",
|
|
47636
|
-
gap: "lg",
|
|
47637
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(DetailedChart, _objectSpread2({ data }, commonProps)), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DetailedTableWithData, _objectSpread2(_objectSpread2({ data }, commonProps), NO_SORT_PROPS))]
|
|
47638
|
-
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(HStack, {
|
|
47639
|
-
className: "Layer__TaxEstimatesSummaryCard__Content",
|
|
47640
|
-
align: "center",
|
|
47641
|
-
gap: "lg",
|
|
47642
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(DetailedChart, _objectSpread2({ data }, commonProps)), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DetailedTableWithData, _objectSpread2(_objectSpread2({ data }, commonProps), NO_SORT_PROPS))]
|
|
47643
|
-
});
|
|
47644
|
-
};
|
|
47645
|
-
var TaxEstimatesSummaryCard = ({ mode = TaxEstimatesSummaryCardMode.PieChart, title: titleOverride, withHeaderSeparator = false } = {}) => {
|
|
47646
|
-
const { detailData, layout, title: defaultTitle, isLoading, isError } = useTaxEstimatesSummaryCard();
|
|
47647
|
-
const { isDesktop } = useSizeClass();
|
|
47876
|
+
var TaxEstimatesSummaryCard = ({ mode = TaxEstimatesSummaryCardMode.PieChart, interactionProps, stringOverrides } = {}) => {
|
|
47877
|
+
const { title: defaultTitle, isLoading, isError, layout, detailData, state } = useTaxEstimatesSummaryCard();
|
|
47648
47878
|
const isSummaryCardLayout = layout === "summaryCard";
|
|
47649
|
-
const
|
|
47650
|
-
|
|
47651
|
-
|
|
47652
|
-
|
|
47653
|
-
|
|
47654
|
-
|
|
47655
|
-
|
|
47656
|
-
|
|
47657
|
-
|
|
47658
|
-
|
|
47659
|
-
|
|
47660
|
-
|
|
47661
|
-
|
|
47662
|
-
|
|
47663
|
-
|
|
47664
|
-
|
|
47665
|
-
|
|
47666
|
-
|
|
47667
|
-
|
|
47668
|
-
className: "Layer__TaxEstimatesSummaryCard__Container",
|
|
47669
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Card, {
|
|
47670
|
-
className: (0, classnames.default)("Layer__TaxEstimatesSummaryCard", isSummaryCardLayout && "Layer__TaxEstimatesSummaryCard--summaryCard"),
|
|
47671
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(VStack, {
|
|
47672
|
-
gap: "md",
|
|
47673
|
-
className: "Layer__TaxEstimatesSummaryCard__Body",
|
|
47674
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(HStack, {
|
|
47675
|
-
className: (0, classnames.default)("Layer__TaxEstimatesSummaryCard__Header", (isSummaryCardLayout || withHeaderSeparator) && "Layer__SummaryCard__ContainerHeader"),
|
|
47676
|
-
justify: "space-between",
|
|
47677
|
-
align: isSummaryCardLayout ? "center" : "start",
|
|
47678
|
-
gap: "md",
|
|
47679
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Heading$1, {
|
|
47680
|
-
size: !isDesktop ? "sm" : "md",
|
|
47681
|
-
children: title
|
|
47682
|
-
})
|
|
47683
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ConditionalBlock, {
|
|
47684
|
-
data: detailData,
|
|
47685
|
-
isLoading,
|
|
47686
|
-
isError,
|
|
47687
|
-
Loading: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LoadingState$1, { mode }),
|
|
47688
|
-
Error: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ErrorState$2, {}),
|
|
47689
|
-
children: ({ data }) => allTaxSectionsAreEmpty(data) ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TaxEstimatesSummaryCardEmpty, {}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Content, {
|
|
47690
|
-
data,
|
|
47691
|
-
mode,
|
|
47692
|
-
commonProps,
|
|
47693
|
-
layout
|
|
47694
|
-
})
|
|
47695
|
-
})]
|
|
47879
|
+
const slots = useSummaryCardSlots({
|
|
47880
|
+
defaultTitle,
|
|
47881
|
+
interactionProps,
|
|
47882
|
+
stringOverrides
|
|
47883
|
+
});
|
|
47884
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SummaryCard, {
|
|
47885
|
+
className: (0, classnames.default)("Layer__TaxEstimatesSummaryCard", isSummaryCardLayout && "Layer__TaxEstimatesSummaryCard--summaryCard"),
|
|
47886
|
+
slots,
|
|
47887
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ConditionalBlock, {
|
|
47888
|
+
data: detailData,
|
|
47889
|
+
isLoading,
|
|
47890
|
+
isError,
|
|
47891
|
+
Loading: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TaxEstimatesSummaryCardLoading, { mode }),
|
|
47892
|
+
Error: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TaxEstimatesSummaryCardError, {}),
|
|
47893
|
+
children: ({ data }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Content, {
|
|
47894
|
+
state,
|
|
47895
|
+
data,
|
|
47896
|
+
mode,
|
|
47897
|
+
layout
|
|
47696
47898
|
})
|
|
47697
47899
|
})
|
|
47698
47900
|
});
|
|
47699
47901
|
};
|
|
47700
47902
|
//#endregion
|
|
47701
47903
|
//#region src/views/SolopreneurOverview/SolopreneurOverview.tsx
|
|
47702
|
-
var SolopreneurOverview = ({
|
|
47703
|
-
var
|
|
47904
|
+
var SolopreneurOverview = ({ interactionProps, chartColorsList, stringOverrides }) => {
|
|
47905
|
+
var _interactionProps$ban, _interactionProps$pro, _stringOverrides$summ, _interactionProps$sum, _stringOverrides$summ2, _interactionProps$sum2, _stringOverrides$summ3, _interactionProps$sum3, _interactionProps$sum4, _stringOverrides$summ4;
|
|
47704
47906
|
const { t } = (0, react_i18next.useTranslation)();
|
|
47705
47907
|
const { value: sizeClass } = useSizeClass();
|
|
47706
|
-
const profitAndLossSummariesVariants = slotProps === null || slotProps === void 0 || (_slotProps$profitAndL = slotProps.profitAndLoss) === null || _slotProps$profitAndL === void 0 || (_slotProps$profitAndL = _slotProps$profitAndL.summaries) === null || _slotProps$profitAndL === void 0 ? void 0 : _slotProps$profitAndL.variants;
|
|
47707
47908
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProfitAndLoss, {
|
|
47708
47909
|
asContainer: false,
|
|
47709
|
-
tagFilter: tagFilter ? {
|
|
47710
|
-
key: tagFilter.tagKey,
|
|
47711
|
-
values: tagFilter.tagValues
|
|
47712
|
-
} : void 0,
|
|
47713
47910
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(View, {
|
|
47714
47911
|
title: (stringOverrides === null || stringOverrides === void 0 ? void 0 : stringOverrides.title) || t("common:label.overview", "Overview"),
|
|
47715
|
-
showHeader:
|
|
47912
|
+
showHeader: true,
|
|
47716
47913
|
header: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Header$1, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(HeaderRow, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(HeaderCol, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(GlobalMonthPicker, { truncateMonth: sizeClass === "mobile" }) }) }) }),
|
|
47717
47914
|
children: [
|
|
47718
|
-
|
|
47719
|
-
onTransactionsToReviewClick,
|
|
47720
|
-
onboardingStepOverride
|
|
47721
|
-
}),
|
|
47915
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SolopreneurOnboardingBanner, { onSetupTaxProfile: interactionProps === null || interactionProps === void 0 || (_interactionProps$ban = interactionProps.banner) === null || _interactionProps$ban === void 0 ? void 0 : _interactionProps$ban.onSetupTaxProfile }),
|
|
47722
47916
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProfitAndLossSummaries, {
|
|
47723
47917
|
stringOverrides: stringOverrides === null || stringOverrides === void 0 ? void 0 : stringOverrides.profitAndLossSummaries,
|
|
47724
47918
|
chartColorsList,
|
|
47725
|
-
onTransactionsToReviewClick
|
|
47726
|
-
variants: profitAndLossSummariesVariants
|
|
47919
|
+
onTransactionsToReviewClick: interactionProps === null || interactionProps === void 0 || (_interactionProps$pro = interactionProps.profitAndLossSummaries) === null || _interactionProps$pro === void 0 ? void 0 : _interactionProps$pro.onTransactionsToReviewClick
|
|
47727
47920
|
}),
|
|
47728
|
-
middleBanner,
|
|
47729
47921
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
47730
47922
|
className: "Layer__SolopreneurOverview__Grid",
|
|
47731
47923
|
children: [
|
|
47732
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProfitAndLossSummaryCard, {
|
|
47924
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProfitAndLossSummaryCard, {
|
|
47925
|
+
stringOverrides: stringOverrides === null || stringOverrides === void 0 || (_stringOverrides$summ = stringOverrides.summaryCards) === null || _stringOverrides$summ === void 0 ? void 0 : _stringOverrides$summ.profitAndLoss,
|
|
47926
|
+
interactionProps: interactionProps === null || interactionProps === void 0 || (_interactionProps$sum = interactionProps.summaryCards) === null || _interactionProps$sum === void 0 ? void 0 : _interactionProps$sum.profitAndLoss
|
|
47927
|
+
}),
|
|
47733
47928
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ExpensesSummaryCard, {
|
|
47734
47929
|
stylingProps: { chartColorsList },
|
|
47735
|
-
stringOverrides:
|
|
47930
|
+
stringOverrides: stringOverrides === null || stringOverrides === void 0 || (_stringOverrides$summ2 = stringOverrides.summaryCards) === null || _stringOverrides$summ2 === void 0 ? void 0 : _stringOverrides$summ2.expenses,
|
|
47931
|
+
interactionProps: interactionProps === null || interactionProps === void 0 || (_interactionProps$sum2 = interactionProps.summaryCards) === null || _interactionProps$sum2 === void 0 ? void 0 : _interactionProps$sum2.expenses
|
|
47736
47932
|
}),
|
|
47737
47933
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TaxEstimatesSummaryCard, {
|
|
47738
47934
|
mode: TaxEstimatesSummaryCardMode.HorizontalBarChart,
|
|
47739
|
-
|
|
47740
|
-
|
|
47935
|
+
stringOverrides: stringOverrides === null || stringOverrides === void 0 || (_stringOverrides$summ3 = stringOverrides.summaryCards) === null || _stringOverrides$summ3 === void 0 ? void 0 : _stringOverrides$summ3.taxEstimates,
|
|
47936
|
+
interactionProps: interactionProps === null || interactionProps === void 0 || (_interactionProps$sum3 = interactionProps.summaryCards) === null || _interactionProps$sum3 === void 0 ? void 0 : _interactionProps$sum3.taxEstimates
|
|
47741
47937
|
}),
|
|
47742
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(MileageTrackingSummary,
|
|
47938
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(MileageTrackingSummary, {
|
|
47939
|
+
interactionProps: interactionProps === null || interactionProps === void 0 || (_interactionProps$sum4 = interactionProps.summaryCards) === null || _interactionProps$sum4 === void 0 ? void 0 : _interactionProps$sum4.mileageTracking,
|
|
47940
|
+
stringOverrides: stringOverrides === null || stringOverrides === void 0 || (_stringOverrides$summ4 = stringOverrides.summaryCards) === null || _stringOverrides$summ4 === void 0 ? void 0 : _stringOverrides$summ4.mileageTracking
|
|
47941
|
+
})
|
|
47743
47942
|
]
|
|
47744
47943
|
})
|
|
47745
47944
|
]
|
|
@@ -47747,148 +47946,6 @@ var SolopreneurOverview = ({ showTitle = true, enableOnboarding = false, onboard
|
|
|
47747
47946
|
});
|
|
47748
47947
|
};
|
|
47749
47948
|
//#endregion
|
|
47750
|
-
//#region src/types/location.ts
|
|
47751
|
-
var US_STATES_CONFIG = [
|
|
47752
|
-
_objectSpread2({ value: "AL" }, translationKey("usStates:label.alabama", "Alabama")),
|
|
47753
|
-
_objectSpread2({ value: "AK" }, translationKey("usStates:label.alaska", "Alaska")),
|
|
47754
|
-
_objectSpread2({ value: "AZ" }, translationKey("usStates:label.arizona", "Arizona")),
|
|
47755
|
-
_objectSpread2({ value: "AR" }, translationKey("usStates:label.arkansas", "Arkansas")),
|
|
47756
|
-
_objectSpread2({ value: "CA" }, translationKey("usStates:label.california", "California")),
|
|
47757
|
-
_objectSpread2({ value: "CO" }, translationKey("usStates:label.colorado", "Colorado")),
|
|
47758
|
-
_objectSpread2({ value: "CT" }, translationKey("usStates:label.connecticut", "Connecticut")),
|
|
47759
|
-
_objectSpread2({ value: "DE" }, translationKey("usStates:label.delaware", "Delaware")),
|
|
47760
|
-
_objectSpread2({ value: "DC" }, translationKey("usStates:label.district_columbia", "District of Columbia")),
|
|
47761
|
-
_objectSpread2({ value: "FL" }, translationKey("usStates:label.florida", "Florida")),
|
|
47762
|
-
_objectSpread2({ value: "GA" }, translationKey("usStates:label.georgia", "Georgia")),
|
|
47763
|
-
_objectSpread2({ value: "HI" }, translationKey("usStates:label.hawaii", "Hawaii")),
|
|
47764
|
-
_objectSpread2({ value: "ID" }, translationKey("usStates:label.idaho", "Idaho")),
|
|
47765
|
-
_objectSpread2({ value: "IL" }, translationKey("usStates:label.illinois", "Illinois")),
|
|
47766
|
-
_objectSpread2({ value: "IN" }, translationKey("usStates:label.indiana", "Indiana")),
|
|
47767
|
-
_objectSpread2({ value: "IA" }, translationKey("usStates:label.iowa", "Iowa")),
|
|
47768
|
-
_objectSpread2({ value: "KS" }, translationKey("usStates:label.kansas", "Kansas")),
|
|
47769
|
-
_objectSpread2({ value: "KY" }, translationKey("usStates:label.kentucky", "Kentucky")),
|
|
47770
|
-
_objectSpread2({ value: "LA" }, translationKey("usStates:label.louisiana", "Louisiana")),
|
|
47771
|
-
_objectSpread2({ value: "ME" }, translationKey("usStates:label.maine", "Maine")),
|
|
47772
|
-
_objectSpread2({ value: "MD" }, translationKey("usStates:label.maryland", "Maryland")),
|
|
47773
|
-
_objectSpread2({ value: "MA" }, translationKey("usStates:label.massachusetts", "Massachusetts")),
|
|
47774
|
-
_objectSpread2({ value: "MI" }, translationKey("usStates:label.michigan", "Michigan")),
|
|
47775
|
-
_objectSpread2({ value: "MN" }, translationKey("usStates:label.minnesota", "Minnesota")),
|
|
47776
|
-
_objectSpread2({ value: "MS" }, translationKey("usStates:label.mississippi", "Mississippi")),
|
|
47777
|
-
_objectSpread2({ value: "MO" }, translationKey("usStates:label.missouri", "Missouri")),
|
|
47778
|
-
_objectSpread2({ value: "MT" }, translationKey("usStates:label.montana", "Montana")),
|
|
47779
|
-
_objectSpread2({ value: "NE" }, translationKey("usStates:label.nebraska", "Nebraska")),
|
|
47780
|
-
_objectSpread2({ value: "NV" }, translationKey("usStates:label.nevada", "Nevada")),
|
|
47781
|
-
_objectSpread2({ value: "NH" }, translationKey("usStates:label.new_hampshire", "New Hampshire")),
|
|
47782
|
-
_objectSpread2({ value: "NJ" }, translationKey("usStates:label.new_jersey", "New Jersey")),
|
|
47783
|
-
_objectSpread2({ value: "NM" }, translationKey("usStates:label.new_mexico", "New Mexico")),
|
|
47784
|
-
_objectSpread2({ value: "NY" }, translationKey("usStates:label.new_york", "New York")),
|
|
47785
|
-
_objectSpread2({ value: "NC" }, translationKey("usStates:label.north_carolina", "North Carolina")),
|
|
47786
|
-
_objectSpread2({ value: "ND" }, translationKey("usStates:label.north_dakota", "North Dakota")),
|
|
47787
|
-
_objectSpread2({ value: "OH" }, translationKey("usStates:label.ohio", "Ohio")),
|
|
47788
|
-
_objectSpread2({ value: "OK" }, translationKey("usStates:label.oklahoma", "Oklahoma")),
|
|
47789
|
-
_objectSpread2({ value: "OR" }, translationKey("usStates:label.oregon", "Oregon")),
|
|
47790
|
-
_objectSpread2({ value: "PA" }, translationKey("usStates:label.pennsylvania", "Pennsylvania")),
|
|
47791
|
-
_objectSpread2({ value: "RI" }, translationKey("usStates:label.rhode_island", "Rhode Island")),
|
|
47792
|
-
_objectSpread2({ value: "SC" }, translationKey("usStates:label.south_carolina", "South Carolina")),
|
|
47793
|
-
_objectSpread2({ value: "SD" }, translationKey("usStates:label.south_dakota", "South Dakota")),
|
|
47794
|
-
_objectSpread2({ value: "TN" }, translationKey("usStates:label.tennessee", "Tennessee")),
|
|
47795
|
-
_objectSpread2({ value: "TX" }, translationKey("usStates:label.texas", "Texas")),
|
|
47796
|
-
_objectSpread2({ value: "UT" }, translationKey("usStates:label.utah", "Utah")),
|
|
47797
|
-
_objectSpread2({ value: "VT" }, translationKey("usStates:label.vermont", "Vermont")),
|
|
47798
|
-
_objectSpread2({ value: "VA" }, translationKey("usStates:label.virginia", "Virginia")),
|
|
47799
|
-
_objectSpread2({ value: "WA" }, translationKey("usStates:label.washington", "Washington")),
|
|
47800
|
-
_objectSpread2({ value: "WV" }, translationKey("usStates:label.west_virginia", "West Virginia")),
|
|
47801
|
-
_objectSpread2({ value: "WI" }, translationKey("usStates:label.wisconsin", "Wisconsin")),
|
|
47802
|
-
_objectSpread2({ value: "WY" }, translationKey("usStates:label.wyoming", "Wyoming")),
|
|
47803
|
-
_objectSpread2({ value: "PR" }, translationKey("usStates:label.puerto_rico", "Puerto Rico"))
|
|
47804
|
-
];
|
|
47805
|
-
var US_STATE_VALUES = US_STATES_CONFIG.map((s) => s.value);
|
|
47806
|
-
//#endregion
|
|
47807
|
-
//#region src/schemas/taxEstimates/filingStatus.ts
|
|
47808
|
-
var FilingStatus = /* @__PURE__ */ function(FilingStatus) {
|
|
47809
|
-
FilingStatus["SINGLE"] = "SINGLE";
|
|
47810
|
-
FilingStatus["MARRIED"] = "MARRIED";
|
|
47811
|
-
FilingStatus["MARRIED_SEPARATELY"] = "MARRIED_SEPARATELY";
|
|
47812
|
-
FilingStatus["HEAD"] = "HEAD";
|
|
47813
|
-
FilingStatus["WIDOWER"] = "WIDOWER";
|
|
47814
|
-
return FilingStatus;
|
|
47815
|
-
}({});
|
|
47816
|
-
var FilingStatusSchema = effect.Schema.Enums(FilingStatus);
|
|
47817
|
-
//#endregion
|
|
47818
|
-
//#region src/schemas/taxEstimates/profile.ts
|
|
47819
|
-
var USStateCodeSchema = effect.Schema.Literal(...US_STATE_VALUES);
|
|
47820
|
-
var WithholdingSchema = effect.Schema.Struct({
|
|
47821
|
-
useCustomWithholding: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(effect.Schema.Boolean)), effect.Schema.fromKey("use_custom_withholding")),
|
|
47822
|
-
amount: effect.Schema.NullishOr(effect.Schema.Number)
|
|
47823
|
-
});
|
|
47824
|
-
var HomeOfficeDeductionSchema = effect.Schema.Struct({
|
|
47825
|
-
useHomeOfficeDeduction: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(effect.Schema.Boolean)), effect.Schema.fromKey("use_home_office_deduction")),
|
|
47826
|
-
homeOfficeArea: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(effect.Schema.Number)), effect.Schema.fromKey("home_office_area"))
|
|
47827
|
-
});
|
|
47828
|
-
var VehicleDeductionSchema = effect.Schema.Struct({ useMileageDeduction: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(effect.Schema.Boolean)), effect.Schema.fromKey("use_mileage_deduction")) });
|
|
47829
|
-
var DeductionsSchema = effect.Schema.Struct({
|
|
47830
|
-
homeOffice: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(HomeOfficeDeductionSchema)), effect.Schema.fromKey("home_office")),
|
|
47831
|
-
vehicle: effect.Schema.NullishOr(VehicleDeductionSchema)
|
|
47832
|
-
});
|
|
47833
|
-
var FederalConfigurationSchema = effect.Schema.Struct({
|
|
47834
|
-
filingStatus: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(FilingStatusSchema)), effect.Schema.fromKey("filing_status")),
|
|
47835
|
-
annualW2Income: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(effect.Schema.Number)), effect.Schema.fromKey("annual_w2_income")),
|
|
47836
|
-
tipIncome: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(effect.Schema.Number)), effect.Schema.fromKey("tip_income")),
|
|
47837
|
-
overtimeIncome: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(effect.Schema.Number)), effect.Schema.fromKey("overtime_income")),
|
|
47838
|
-
withholding: effect.Schema.NullishOr(WithholdingSchema)
|
|
47839
|
-
});
|
|
47840
|
-
var StateConfigurationSchema = effect.Schema.Struct({
|
|
47841
|
-
taxState: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(USStateCodeSchema)), effect.Schema.fromKey("tax_state")),
|
|
47842
|
-
filingStatus: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(FilingStatusSchema)), effect.Schema.fromKey("filing_status")),
|
|
47843
|
-
withholding: effect.Schema.NullishOr(WithholdingSchema)
|
|
47844
|
-
});
|
|
47845
|
-
var UsConfigurationSchema = effect.Schema.Struct({
|
|
47846
|
-
federal: effect.Schema.NullishOr(FederalConfigurationSchema),
|
|
47847
|
-
state: effect.Schema.NullishOr(StateConfigurationSchema),
|
|
47848
|
-
deductions: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(DeductionsSchema)), effect.Schema.fromKey("deductions"))
|
|
47849
|
-
});
|
|
47850
|
-
var TaxProfileSchema = effect.Schema.Struct({
|
|
47851
|
-
taxCountryCode: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(effect.Schema.String)), effect.Schema.fromKey("tax_country_code")),
|
|
47852
|
-
usConfiguration: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(UsConfigurationSchema)), effect.Schema.fromKey("us_configuration")),
|
|
47853
|
-
userHasSavedTaxProfile: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.Boolean), effect.Schema.fromKey("user_has_saved_tax_profile"))
|
|
47854
|
-
});
|
|
47855
|
-
var TaxProfileResponseSchema = effect.Schema.Struct({ data: TaxProfileSchema });
|
|
47856
|
-
var TaxProfileRequestSchema = effect.Schema.Struct({
|
|
47857
|
-
taxCountryCode: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(effect.Schema.String)), effect.Schema.fromKey("tax_country_code")),
|
|
47858
|
-
usConfiguration: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(UsConfigurationSchema)), effect.Schema.fromKey("us_configuration"))
|
|
47859
|
-
});
|
|
47860
|
-
//#endregion
|
|
47861
|
-
//#region src/hooks/api/businesses/[business-id]/tax-estimates/profile/useTaxProfile.ts
|
|
47862
|
-
var TAX_PROFILE_TAG_KEY = "#tax-profile";
|
|
47863
|
-
var getTaxProfile = get$1(({ businessId }) => {
|
|
47864
|
-
return `/v1/businesses/${businessId}/tax-estimates/profile`;
|
|
47865
|
-
});
|
|
47866
|
-
function buildKey$16({ access_token: accessToken, apiUrl, businessId }) {
|
|
47867
|
-
if (accessToken && apiUrl) return {
|
|
47868
|
-
accessToken,
|
|
47869
|
-
apiUrl,
|
|
47870
|
-
businessId,
|
|
47871
|
-
tags: [TAX_PROFILE_TAG_KEY]
|
|
47872
|
-
};
|
|
47873
|
-
}
|
|
47874
|
-
function useTaxProfile() {
|
|
47875
|
-
const withLocale = useLocalizedKey();
|
|
47876
|
-
const { data: auth } = useAuth();
|
|
47877
|
-
const { businessId } = useLayerContext();
|
|
47878
|
-
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$16(_objectSpread2(_objectSpread2({}, auth), {}, { businessId }))), function() {
|
|
47879
|
-
var _ref = _asyncToGenerator(function* ({ accessToken, apiUrl, businessId }) {
|
|
47880
|
-
return getTaxProfile(apiUrl, accessToken, { params: { businessId } })().then(effect.Schema.decodeUnknownPromise(TaxProfileResponseSchema)).then(({ data }) => data);
|
|
47881
|
-
});
|
|
47882
|
-
return function(_x) {
|
|
47883
|
-
return _ref.apply(this, arguments);
|
|
47884
|
-
};
|
|
47885
|
-
}()));
|
|
47886
|
-
}
|
|
47887
|
-
function useTaxProfileGlobalCacheActions() {
|
|
47888
|
-
const { patchCache } = useGlobalCacheActions();
|
|
47889
|
-
return { patchTaxProfile: (0, react.useCallback)((updatedProfile) => patchCache(({ tags }) => tags.includes(TAX_PROFILE_TAG_KEY), () => updatedProfile), [patchCache]) };
|
|
47890
|
-
}
|
|
47891
|
-
//#endregion
|
|
47892
47949
|
//#region src/hooks/features/taxEstimates/useTaxEstimatesOnboardingStatus.ts
|
|
47893
47950
|
var OnboardingStatus = /* @__PURE__ */ function(OnboardingStatus) {
|
|
47894
47951
|
OnboardingStatus["Loading"] = "Loading";
|
|
@@ -48298,6 +48355,7 @@ var TaxDetailsMetaSchema = effect.Schema.Struct({
|
|
|
48298
48355
|
});
|
|
48299
48356
|
var TaxDetailsSchema = effect.Schema.Struct({
|
|
48300
48357
|
type: effect.Schema.String,
|
|
48358
|
+
state: TransformedTaxSummaryStateSchema,
|
|
48301
48359
|
meta: TaxDetailsMetaSchema,
|
|
48302
48360
|
rows: effect.Schema.Array(TaxDetailsRowSchema)
|
|
48303
48361
|
});
|
|
@@ -48651,9 +48709,10 @@ var TaxProfile = () => {
|
|
|
48651
48709
|
const { t } = (0, react_i18next.useTranslation)();
|
|
48652
48710
|
const navigate = useTaxEstimatesNavigation();
|
|
48653
48711
|
const { data: taxProfile } = useTaxProfile();
|
|
48712
|
+
const hasSavedTaxProfile = (taxProfile === null || taxProfile === void 0 ? void 0 : taxProfile.userHasSavedTaxProfile) === true;
|
|
48654
48713
|
const handleGoBack = (0, react.useCallback)(() => {
|
|
48655
|
-
navigate.toEstimates();
|
|
48656
|
-
}, [navigate]);
|
|
48714
|
+
if (hasSavedTaxProfile) navigate.toEstimates();
|
|
48715
|
+
}, [navigate, hasSavedTaxProfile]);
|
|
48657
48716
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BaseDetailView, {
|
|
48658
48717
|
slots: {
|
|
48659
48718
|
Header: (0, react.useCallback)(() => {
|
|
@@ -48665,7 +48724,7 @@ var TaxProfile = () => {
|
|
|
48665
48724
|
BackIcon: BackArrow
|
|
48666
48725
|
},
|
|
48667
48726
|
name: "TaxProfile",
|
|
48668
|
-
onGoBack: handleGoBack,
|
|
48727
|
+
onGoBack: hasSavedTaxProfile ? handleGoBack : void 0,
|
|
48669
48728
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TaxProfileForm, { taxProfile })
|
|
48670
48729
|
});
|
|
48671
48730
|
};
|
|
@@ -48870,7 +48929,7 @@ var tConditional = (translate, key, _ref) => {
|
|
|
48870
48929
|
var AmountWithLabel = ({ slotProps }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(VStack, {
|
|
48871
48930
|
className: "Layer__TaxSummaryCard__AmountWithLabel",
|
|
48872
48931
|
gap: "2xs",
|
|
48873
|
-
align: "
|
|
48932
|
+
align: "center",
|
|
48874
48933
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(MoneySpan, _objectSpread2({}, slotProps.MoneySpan)), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Badge, _objectSpread2({
|
|
48875
48934
|
size: BadgeSize.SMALL,
|
|
48876
48935
|
variant: BadgeVariant.NEUTRAL
|
|
@@ -48890,7 +48949,6 @@ var EquationRow = ({ section, size = "md" }) => {
|
|
|
48890
48949
|
Badge: { children: t("common:label.total", "Total") }
|
|
48891
48950
|
} }),
|
|
48892
48951
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Span, {
|
|
48893
|
-
className: "Layer__TaxSummaryCard__Operator",
|
|
48894
48952
|
size,
|
|
48895
48953
|
variant: "subtle",
|
|
48896
48954
|
children: "-"
|
|
@@ -48903,7 +48961,6 @@ var EquationRow = ({ section, size = "md" }) => {
|
|
|
48903
48961
|
Badge: { children: t("taxEstimates:label.taxes_paid", "Taxes Paid") }
|
|
48904
48962
|
} }),
|
|
48905
48963
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Span, {
|
|
48906
|
-
className: "Layer__TaxSummaryCard__Operator",
|
|
48907
48964
|
size,
|
|
48908
48965
|
variant: "subtle",
|
|
48909
48966
|
children: "="
|
|
@@ -48976,7 +49033,7 @@ var TaxSummaryCardDesktop = ({ data }) => {
|
|
|
48976
49033
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Span, {
|
|
48977
49034
|
size: "sm",
|
|
48978
49035
|
variant: "subtle",
|
|
48979
|
-
children: t("taxEstimates:label.
|
|
49036
|
+
children: t("taxEstimates:label.due_at", "Due on {{date}}", { date: formatDate(data.taxesDueAt) })
|
|
48980
49037
|
})]
|
|
48981
49038
|
}),
|
|
48982
49039
|
data.sections.map((section) => {
|
|
@@ -49031,7 +49088,7 @@ var TaxSummaryCardMobile = ({ data }) => {
|
|
|
49031
49088
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Span, {
|
|
49032
49089
|
size: "sm",
|
|
49033
49090
|
variant: "subtle",
|
|
49034
|
-
children: t("taxEstimates:label.
|
|
49091
|
+
children: t("taxEstimates:label.due_at", "Due on {{date}}", { date: formatDate(data.taxesDueAt) })
|
|
49035
49092
|
})]
|
|
49036
49093
|
}),
|
|
49037
49094
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(HStack, {
|