@layerfi/components 0.1.132-alpha.2 → 0.1.132-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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.2",
281
+ version: "0.1.132-alpha.4",
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$6 = () => {
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$6
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$5 = () => null;
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$5
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$4 = () => {
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$4
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$3 = () => {
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$3
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 getVehicleDisplayName = (vehicle) => vehicle ? `${vehicle.year} ${vehicle.makeAndModel}` : "";
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, {
@@ -47311,6 +47287,108 @@ var useSolopreneurOnboardingBannerState = () => {
47311
47287
  });
47312
47288
  };
47313
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
+ ]
47361
+ });
47362
+ };
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
47314
47392
  //#region src/components/ui/Swatch/Swatch.tsx
47315
47393
  var Swatch = ({ color, opacity, pattern }) => {
47316
47394
  const patternId = (0, react.useId)();
@@ -47522,33 +47600,106 @@ var HorizontalBarChart = ({ data, stylingProps, formatValue, showLegend = true,
47522
47600
  });
47523
47601
  };
47524
47602
  //#endregion
47525
- //#region src/components/TaxEstimatesSummaryCard/constants.ts
47526
- var resolveCategoryColor = ({ key }) => {
47527
- var _federal$state$key;
47528
- return (_federal$state$key = {
47529
- federal: DEFAULT_CHART_COLORS[0],
47530
- state: DEFAULT_CHART_COLORS[1]
47531
- }[key]) !== null && _federal$state$key !== void 0 ? _federal$state$key : DEFAULT_CHART_COLORS[0];
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
+ });
47532
47623
  };
47533
47624
  //#endregion
47534
- //#region src/schemas/taxEstimates/summary.ts
47535
- var TaxSummarySectionTypeSchema = effect.Schema.Literal("federal", "state");
47536
- var TaxSummarySectionSchema = effect.Schema.Struct({
47537
- type: TaxSummarySectionTypeSchema,
47538
- key: effect.Schema.NullishOr(effect.Schema.String),
47539
- label: effect.Schema.String,
47540
- total: effect.Schema.Number,
47541
- taxesPaid: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.Number), effect.Schema.fromKey("taxes_paid")),
47542
- taxesOwed: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.Number), effect.Schema.fromKey("taxes_owed"))
47543
- });
47544
- var TaxSummarySchema = effect.Schema.Struct({
47545
- year: effect.Schema.Number,
47546
- projectedTaxesOwed: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.Number), effect.Schema.fromKey("projected_taxes_owed")),
47547
- taxesDueAt: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.Date), effect.Schema.fromKey("taxes_due_at")),
47548
- uncategorizedTaxPayments: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.Number), effect.Schema.fromKey("uncategorized_tax_payments")),
47549
- sections: effect.Schema.Array(TaxSummarySectionSchema)
47550
- });
47551
- var TaxSummaryResponseSchema = effect.Schema.Struct({ data: TaxSummarySchema });
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
+ };
47552
47703
  //#endregion
47553
47704
  //#region src/hooks/api/businesses/[business-id]/tax-estimates/summary/useTaxSummary.ts
47554
47705
  var TAX_SUMMARY_TAG_KEY = "#tax-summary";
@@ -47685,6 +47836,7 @@ var prepareTaxSummaryData = (taxSummaryData, shortenedDisplayName, isMobile) =>
47685
47836
  }));
47686
47837
  };
47687
47838
  var useTaxEstimatesSummaryCard = () => {
47839
+ var _taxSummaryData$state;
47688
47840
  const { year } = useTaxEstimatesYear();
47689
47841
  const { fullYearProjection } = useFullYearProjection();
47690
47842
  const { t } = (0, react_i18next.useTranslation)();
@@ -47714,167 +47866,16 @@ var useTaxEstimatesSummaryCard = () => {
47714
47866
  ]),
47715
47867
  isLoading,
47716
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,
47717
47870
  layout: isDesktop ? "taxOverview" : "summaryCard",
47718
47871
  title: t("taxEstimates:label.tax_summary", "Tax Summary")
47719
47872
  };
47720
47873
  };
47721
47874
  //#endregion
47722
47875
  //#region src/components/TaxEstimatesSummaryCard/TaxEstimatesSummaryCard.tsx
47723
- var LoadingState$1 = ({ mode }) => {
47724
- if (mode === TaxEstimatesSummaryCardMode.HorizontalBarChart) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(VStack, {
47725
- gap: "md",
47726
- className: "Layer__TaxEstimatesSummaryCard__Content",
47727
- pb: "md",
47728
- pi: "lg",
47729
- children: [
47730
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SkeletonLoader, {
47731
- height: "24px",
47732
- width: "40%"
47733
- }),
47734
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SkeletonLoader, {
47735
- height: "24px",
47736
- width: "100%"
47737
- }),
47738
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SkeletonLoader, {
47739
- height: "16px",
47740
- width: "100%"
47741
- })
47742
- ]
47743
- });
47744
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(VStack, {
47745
- gap: "md",
47746
- className: "Layer__TaxEstimatesSummaryCard__Content",
47747
- pb: "md",
47748
- pi: "lg",
47749
- align: "center",
47750
- children: [
47751
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CircleSkeletonLoader, {
47752
- height: "128px",
47753
- width: "128px"
47754
- }),
47755
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SkeletonLoader, {
47756
- height: "24px",
47757
- width: "80%"
47758
- }),
47759
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SkeletonLoader, {
47760
- height: "24px",
47761
- width: "80%"
47762
- }),
47763
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SkeletonLoader, {
47764
- height: "24px",
47765
- width: "80%"
47766
- })
47767
- ]
47768
- });
47769
- };
47770
- var ErrorState$2 = () => {
47771
- const { t } = (0, react_i18next.useTranslation)();
47772
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(VStack, {
47773
- gap: "md",
47774
- className: "Layer__TaxEstimatesSummaryCard__Content",
47775
- pb: "md",
47776
- pi: "lg",
47777
- align: "center",
47778
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Span, {
47779
- size: "lg",
47780
- children: t("taxEstimates:error.load_tax_estimates_summary", "We couldn't load your tax summary")
47781
- })
47782
- });
47783
- };
47784
- function allTaxSectionsAreEmpty(summary) {
47785
- return summary.data.every((section) => section.value === 0);
47786
- }
47787
- function TaxEstimatesSummaryCardEmpty() {
47788
- const { t } = (0, react_i18next.useTranslation)();
47789
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DataState, {
47790
- className: "Layer__TaxEstimatesSummaryCard--empty",
47791
- status: DataStateStatus.info,
47792
- title: t("taxEstimates:empty.no_tax_estimates_summary", "Get started with your tax estimates"),
47793
- description: t("taxEstimates:empty.no_tax_estimates_summary_description", "Start by importing and categorizing your bank transactions")
47794
- });
47795
- }
47796
- var TaxEstimatesSummaryCardMode = /* @__PURE__ */ function(TaxEstimatesSummaryCardMode) {
47797
- TaxEstimatesSummaryCardMode["PieChart"] = "PieChart";
47798
- TaxEstimatesSummaryCardMode["HorizontalBarChart"] = "HorizontalBarChart";
47799
- return TaxEstimatesSummaryCardMode;
47800
- }({});
47801
- var Content = ({ data, mode, commonProps, layout }) => {
47802
- if (mode === TaxEstimatesSummaryCardMode.HorizontalBarChart) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(HorizontalBarChartContent, {
47803
- data,
47804
- commonProps
47805
- });
47806
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PieChartContent, {
47807
- data,
47808
- commonProps,
47809
- layout
47810
- });
47811
- };
47812
- var HorizontalBarChartContent = ({ data, commonProps }) => {
47813
- const { t } = (0, react_i18next.useTranslation)();
47814
- const { formatCurrencyFromCents } = useIntlFormatter();
47815
- const { isDesktop } = useSizeClass();
47816
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(VStack, {
47817
- className: "Layer__TaxEstimatesSummaryCard__Content Layer__TaxEstimatesSummaryCard__Content--horizontal",
47818
- gap: "md",
47819
- pi: "lg",
47820
- pbe: "lg",
47821
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(HStack, {
47822
- className: "Layer__TaxEstimatesSummaryCard__TotalRow",
47823
- justify: "space-between",
47824
- align: "baseline",
47825
- gap: "md",
47826
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Span, {
47827
- size: "md",
47828
- variant: "subtle",
47829
- children: t("common:label.total", "Total")
47830
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Span, {
47831
- size: "xl",
47832
- weight: "bold",
47833
- numeric: "tabular-nums",
47834
- className: "Layer__TaxEstimatesSummaryCard__TotalValue",
47835
- children: formatCurrencyFromCents(data.total)
47836
- })]
47837
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(HorizontalBarChart, {
47838
- data,
47839
- stylingProps: commonProps.stylingProps,
47840
- formatValue: formatCurrencyFromCents,
47841
- labelMode: isDesktop ? LegendLayout.Aligned : LegendLayout.Table
47842
- })]
47843
- });
47844
- };
47845
- var PieChartContent = ({ data, commonProps, layout }) => {
47846
- const { isMobile } = useSizeClass();
47847
- return isMobile || layout === "summaryCard" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(VStack, {
47848
- className: "Layer__TaxEstimatesSummaryCard__Content Layer__TaxEstimatesSummaryCard__Content--mobile",
47849
- gap: "lg",
47850
- 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))]
47851
- }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(HStack, {
47852
- className: "Layer__TaxEstimatesSummaryCard__Content",
47853
- align: "center",
47854
- gap: "lg",
47855
- 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))]
47856
- });
47857
- };
47858
47876
  var TaxEstimatesSummaryCard = ({ mode = TaxEstimatesSummaryCardMode.PieChart, interactionProps, stringOverrides } = {}) => {
47859
- const { detailData, layout, title: defaultTitle, isLoading, isError } = useTaxEstimatesSummaryCard();
47877
+ const { title: defaultTitle, isLoading, isError, layout, detailData, state } = useTaxEstimatesSummaryCard();
47860
47878
  const isSummaryCardLayout = layout === "summaryCard";
47861
- const commonProps = (0, react.useMemo)(() => {
47862
- var _detailData$data;
47863
- const colorByKey = detailData === null || detailData === void 0 || (_detailData$data = detailData.data) === null || _detailData$data === void 0 ? void 0 : _detailData$data.reduce((acc, item) => {
47864
- acc[item.name] = resolveCategoryColor({ key: item.name });
47865
- return acc;
47866
- }, {});
47867
- return {
47868
- interactionProps: NO_OP_INTERACTION_PROPS,
47869
- stylingProps: { colorSelector: (item) => {
47870
- var _colorByKey$item$name;
47871
- return {
47872
- 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)",
47873
- opacity: 1
47874
- };
47875
- } }
47876
- };
47877
- }, [detailData === null || detailData === void 0 ? void 0 : detailData.data]);
47878
47879
  const slots = useSummaryCardSlots({
47879
47880
  defaultTitle,
47880
47881
  interactionProps,
@@ -47887,12 +47888,12 @@ var TaxEstimatesSummaryCard = ({ mode = TaxEstimatesSummaryCardMode.PieChart, in
47887
47888
  data: detailData,
47888
47889
  isLoading,
47889
47890
  isError,
47890
- Loading: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LoadingState$1, { mode }),
47891
- Error: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ErrorState$2, {}),
47892
- children: ({ data }) => allTaxSectionsAreEmpty(data) ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TaxEstimatesSummaryCardEmpty, {}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Content, {
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,
47893
47895
  data,
47894
47896
  mode,
47895
- commonProps,
47896
47897
  layout
47897
47898
  })
47898
47899
  })
@@ -48350,6 +48351,7 @@ var taxDetailsRowFields = {
48350
48351
  var TaxDetailsRowSchema = effect.Schema.Struct(_objectSpread2(_objectSpread2({}, taxDetailsRowFields), {}, { breakdown: effect.Schema.optional(effect.Schema.Array(effect.Schema.suspend(() => TaxDetailsRowSchema))) }));
48351
48352
  var TaxDetailsMetaSchema = effect.Schema.Struct({
48352
48353
  year: effect.Schema.Number,
48354
+ state: TransformedTaxSummaryStateSchema,
48353
48355
  filingStatus: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.String), effect.Schema.fromKey("filing_status"))
48354
48356
  });
48355
48357
  var TaxDetailsSchema = effect.Schema.Struct({
@@ -48707,9 +48709,10 @@ var TaxProfile = () => {
48707
48709
  const { t } = (0, react_i18next.useTranslation)();
48708
48710
  const navigate = useTaxEstimatesNavigation();
48709
48711
  const { data: taxProfile } = useTaxProfile();
48712
+ const hasSavedTaxProfile = (taxProfile === null || taxProfile === void 0 ? void 0 : taxProfile.userHasSavedTaxProfile) === true;
48710
48713
  const handleGoBack = (0, react.useCallback)(() => {
48711
- navigate.toEstimates();
48712
- }, [navigate]);
48714
+ if (hasSavedTaxProfile) navigate.toEstimates();
48715
+ }, [navigate, hasSavedTaxProfile]);
48713
48716
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BaseDetailView, {
48714
48717
  slots: {
48715
48718
  Header: (0, react.useCallback)(() => {
@@ -48721,7 +48724,7 @@ var TaxProfile = () => {
48721
48724
  BackIcon: BackArrow
48722
48725
  },
48723
48726
  name: "TaxProfile",
48724
- onGoBack: handleGoBack,
48727
+ onGoBack: hasSavedTaxProfile ? handleGoBack : void 0,
48725
48728
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TaxProfileForm, { taxProfile })
48726
48729
  });
48727
48730
  };
@@ -48926,7 +48929,7 @@ var tConditional = (translate, key, _ref) => {
48926
48929
  var AmountWithLabel = ({ slotProps }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(VStack, {
48927
48930
  className: "Layer__TaxSummaryCard__AmountWithLabel",
48928
48931
  gap: "2xs",
48929
- align: "start",
48932
+ align: "center",
48930
48933
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(MoneySpan, _objectSpread2({}, slotProps.MoneySpan)), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Badge, _objectSpread2({
48931
48934
  size: BadgeSize.SMALL,
48932
48935
  variant: BadgeVariant.NEUTRAL
@@ -48946,7 +48949,6 @@ var EquationRow = ({ section, size = "md" }) => {
48946
48949
  Badge: { children: t("common:label.total", "Total") }
48947
48950
  } }),
48948
48951
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Span, {
48949
- className: "Layer__TaxSummaryCard__Operator",
48950
48952
  size,
48951
48953
  variant: "subtle",
48952
48954
  children: "-"
@@ -48959,7 +48961,6 @@ var EquationRow = ({ section, size = "md" }) => {
48959
48961
  Badge: { children: t("taxEstimates:label.taxes_paid", "Taxes Paid") }
48960
48962
  } }),
48961
48963
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Span, {
48962
- className: "Layer__TaxSummaryCard__Operator",
48963
48964
  size,
48964
48965
  variant: "subtle",
48965
48966
  children: "="
@@ -49032,7 +49033,7 @@ var TaxSummaryCardDesktop = ({ data }) => {
49032
49033
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Span, {
49033
49034
  size: "sm",
49034
49035
  variant: "subtle",
49035
- children: t("taxEstimates:label.taxes_due_at", "Taxes due on {{date}}", { date: formatDate(data.taxesDueAt) })
49036
+ children: t("taxEstimates:label.due_at", "Due on {{date}}", { date: formatDate(data.taxesDueAt) })
49036
49037
  })]
49037
49038
  }),
49038
49039
  data.sections.map((section) => {
@@ -49087,7 +49088,7 @@ var TaxSummaryCardMobile = ({ data }) => {
49087
49088
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Span, {
49088
49089
  size: "sm",
49089
49090
  variant: "subtle",
49090
- children: t("taxEstimates:label.taxes_due_at", "Taxes due on {{date}}", { date: formatDate(data.taxesDueAt) })
49091
+ children: t("taxEstimates:label.due_at", "Due on {{date}}", { date: formatDate(data.taxesDueAt) })
49091
49092
  })]
49092
49093
  }),
49093
49094
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(HStack, {