@layerfi/components 0.1.76 → 0.1.77

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/esm/index.js CHANGED
@@ -554,7 +554,7 @@ var Drawer = ({
554
554
  };
555
555
 
556
556
  // src/components/Toast/Toast.tsx
557
- import React2, { forwardRef } from "react";
557
+ import React2 from "react";
558
558
 
559
559
  // src/contexts/LayerContext/LayerContext.tsx
560
560
  import { createContext as createContext2, useContext as useContext2 } from "react";
@@ -582,7 +582,7 @@ var LayerContext = createContext2({
582
582
  setOnboardingStep: () => void 0,
583
583
  environment: "",
584
584
  toasts: [],
585
- addToast: (toast) => void 0,
585
+ addToast: (_toast) => void 0,
586
586
  removeToast: () => void 0,
587
587
  onError: () => void 0,
588
588
  touch: () => void 0,
@@ -613,10 +613,10 @@ var Toast = (props) => {
613
613
  /* @__PURE__ */ React2.createElement("p", null, content)
614
614
  );
615
615
  };
616
- var ToastsContainer = forwardRef((_props) => {
616
+ function ToastsContainer() {
617
617
  const { toasts } = useLayerContext();
618
618
  return /* @__PURE__ */ React2.createElement("div", { className: "Layer__toasts-container" }, toasts.map((toast, idx) => /* @__PURE__ */ React2.createElement(Toast, __spreadValues({ key: `layer-toast-${idx}` }, toast))));
619
- });
619
+ }
620
620
 
621
621
  // src/components/GlobalWidgets/GlobalWidgets.tsx
622
622
  var DrawerWidget = () => {
@@ -1270,6 +1270,7 @@ var useLinkedAccounts = () => {
1270
1270
  }
1271
1271
  });
1272
1272
  const unlinkAccount2 = (source, accountId) => __async(void 0, null, function* () {
1273
+ DEBUG && console.debug("unlinking account");
1273
1274
  if (source === "PLAID") {
1274
1275
  yield Layer.unlinkAccount(apiUrl, auth == null ? void 0 : auth.access_token, {
1275
1276
  params: { businessId, accountId }
@@ -1283,7 +1284,7 @@ var useLinkedAccounts = () => {
1283
1284
  }
1284
1285
  });
1285
1286
  const confirmAccount = (source, accountId) => __async(void 0, null, function* () {
1286
- DEBUG && console.log("confirming account");
1287
+ DEBUG && console.debug("confirming account");
1287
1288
  if (source === "PLAID") {
1288
1289
  yield Layer.confirmConnection(apiUrl, auth == null ? void 0 : auth.access_token, {
1289
1290
  params: {
@@ -1300,7 +1301,7 @@ var useLinkedAccounts = () => {
1300
1301
  }
1301
1302
  });
1302
1303
  const denyAccount = (source, accountId) => __async(void 0, null, function* () {
1303
- DEBUG && console.log("confirming account");
1304
+ DEBUG && console.debug("confirming account");
1304
1305
  if (source === "PLAID") {
1305
1306
  yield Layer.denyConnection(apiUrl, auth == null ? void 0 : auth.access_token, {
1306
1307
  params: {
@@ -1317,7 +1318,7 @@ var useLinkedAccounts = () => {
1317
1318
  }
1318
1319
  });
1319
1320
  const breakConnection = (source, connectionExternalId) => __async(void 0, null, function* () {
1320
- DEBUG && console.log("Breaking sandbox plaid item connection");
1321
+ DEBUG && console.debug("Breaking sandbox plaid item connection");
1321
1322
  if (source === "PLAID") {
1322
1323
  yield Layer.breakPlaidItemConnection(apiUrl, auth == null ? void 0 : auth.access_token, {
1323
1324
  params: {
@@ -1334,23 +1335,23 @@ var useLinkedAccounts = () => {
1334
1335
  }
1335
1336
  });
1336
1337
  const refetchAccounts = () => __async(void 0, null, function* () {
1337
- DEBUG && console.log("refetching accounts...");
1338
+ DEBUG && console.debug("refetching accounts...");
1338
1339
  yield mutate();
1339
1340
  });
1340
1341
  const syncAccounts = () => __async(void 0, null, function* () {
1341
- DEBUG && console.log("resyncing accounts...");
1342
+ DEBUG && console.debug("resyncing accounts...");
1342
1343
  yield Layer.syncConnection(apiUrl, auth == null ? void 0 : auth.access_token, {
1343
1344
  params: { businessId }
1344
1345
  });
1345
1346
  });
1346
1347
  const updateConnectionStatus2 = () => __async(void 0, null, function* () {
1347
- DEBUG && console.log("updating connection status...");
1348
+ DEBUG && console.debug("updating connection status...");
1348
1349
  yield Layer.updateConnectionStatus(apiUrl, auth == null ? void 0 : auth.access_token, {
1349
1350
  params: { businessId }
1350
1351
  });
1351
1352
  });
1352
1353
  const unlinkPlaidItem2 = (plaidItemPlaidId) => __async(void 0, null, function* () {
1353
- DEBUG && console.log("unlinking plaid item");
1354
+ DEBUG && console.debug("unlinking plaid item");
1354
1355
  yield Layer.unlinkPlaidItem(apiUrl, auth == null ? void 0 : auth.access_token, {
1355
1356
  params: { businessId, plaidItemPlaidId }
1356
1357
  });
@@ -2178,9 +2179,9 @@ var LinkedAccountsProvider = ({
2178
2179
  };
2179
2180
 
2180
2181
  // src/components/Container/Container.tsx
2181
- import React8, { forwardRef as forwardRef2 } from "react";
2182
+ import React8, { forwardRef } from "react";
2182
2183
  import classNames2 from "classnames";
2183
- var Container = forwardRef2(
2184
+ var Container = forwardRef(
2184
2185
  ({
2185
2186
  name,
2186
2187
  className,
@@ -2211,11 +2212,12 @@ var Container = forwardRef2(
2211
2212
  );
2212
2213
  }
2213
2214
  );
2215
+ Container.displayName = "Container";
2214
2216
 
2215
2217
  // src/components/Container/Header.tsx
2216
- import React9, { forwardRef as forwardRef3 } from "react";
2218
+ import React9, { forwardRef as forwardRef2 } from "react";
2217
2219
  import classNames3 from "classnames";
2218
- var Header = forwardRef3(
2220
+ var Header = forwardRef2(
2219
2221
  ({ className, children, style, layout }, ref) => {
2220
2222
  const baseClassName = classNames3(
2221
2223
  "Layer__component-header",
@@ -2225,6 +2227,7 @@ var Header = forwardRef3(
2225
2227
  return /* @__PURE__ */ React9.createElement("header", { ref, className: baseClassName, style }, children);
2226
2228
  }
2227
2229
  );
2230
+ Header.displayName = "Header";
2228
2231
 
2229
2232
  // src/components/Onboarding/ConnectAccount.tsx
2230
2233
  import React48, { useContext as useContext5, useMemo as useMemo3 } from "react";
@@ -2646,7 +2649,7 @@ var Loader_default = Loader;
2646
2649
 
2647
2650
  // src/components/Tooltip/Tooltip.tsx
2648
2651
  import React19, {
2649
- forwardRef as forwardRef4,
2652
+ forwardRef as forwardRef3,
2650
2653
  isValidElement,
2651
2654
  cloneElement
2652
2655
  } from "react";
@@ -2744,7 +2747,7 @@ var Tooltip = (_a) => {
2744
2747
  const tooltip = useTooltip(options);
2745
2748
  return /* @__PURE__ */ React19.createElement(TooltipContext.Provider, { value: tooltip }, children);
2746
2749
  };
2747
- var TooltipTrigger = forwardRef4(function TooltipTrigger2(_a, propRef) {
2750
+ var TooltipTrigger = forwardRef3(function TooltipTrigger2(_a, propRef) {
2748
2751
  var _b = _a, { children, asChild = false } = _b, props = __objRest(_b, ["children", "asChild"]);
2749
2752
  const context = useTooltipContext();
2750
2753
  const childrenRef = children.ref;
@@ -2769,8 +2772,8 @@ var TooltipTrigger = forwardRef4(function TooltipTrigger2(_a, propRef) {
2769
2772
  children
2770
2773
  );
2771
2774
  });
2772
- var TooltipContent = forwardRef4(function TooltipContent2(_a, propRef) {
2773
- var _b = _a, { style, className } = _b, props = __objRest(_b, ["style", "className"]);
2775
+ var TooltipContent = forwardRef3(function TooltipContent2(_a, propRef) {
2776
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
2774
2777
  const context = useTooltipContext();
2775
2778
  const ref = useMergeRefs([context.refs.setFloating, propRef]);
2776
2779
  if (!context.open || context.disabled)
@@ -2878,7 +2881,7 @@ import classNames5 from "classnames";
2878
2881
  var IconButton = (_a) => {
2879
2882
  var _b = _a, {
2880
2883
  className,
2881
- children,
2884
+ children: _children,
2882
2885
  icon,
2883
2886
  active,
2884
2887
  withBorder = false,
@@ -2978,7 +2981,7 @@ var RetryButton = (_a) => {
2978
2981
  className,
2979
2982
  processing,
2980
2983
  disabled,
2981
- error,
2984
+ error: _error,
2982
2985
  children
2983
2986
  } = _b, props = __objRest(_b, [
2984
2987
  "className",
@@ -3243,11 +3246,9 @@ import classNames9 from "classnames";
3243
3246
  var BackButton = (_a) => {
3244
3247
  var _b = _a, {
3245
3248
  className,
3246
- children,
3247
3249
  textOnly = false
3248
3250
  } = _b, props = __objRest(_b, [
3249
3251
  "className",
3250
- "children",
3251
3252
  "textOnly"
3252
3253
  ]);
3253
3254
  const baseClassName = classNames9("Layer__btn", "Layer__back-btn", className);
@@ -3298,11 +3299,9 @@ import classNames10 from "classnames";
3298
3299
  var CloseButton = (_a) => {
3299
3300
  var _b = _a, {
3300
3301
  className,
3301
- children,
3302
3302
  textOnly = false
3303
3303
  } = _b, props = __objRest(_b, [
3304
3304
  "className",
3305
- "children",
3306
3305
  "textOnly"
3307
3306
  ]);
3308
3307
  const baseClassName = classNames10("Layer__btn", "Layer__back-btn", className);
@@ -3315,11 +3314,9 @@ import classNames11 from "classnames";
3315
3314
  var ExpandButton = (_a) => {
3316
3315
  var _b = _a, {
3317
3316
  className,
3318
- children,
3319
3317
  collapsed
3320
3318
  } = _b, props = __objRest(_b, [
3321
3319
  "className",
3322
- "children",
3323
3320
  "collapsed"
3324
3321
  ]);
3325
3322
  const baseClassName = classNames11(
@@ -3648,9 +3645,9 @@ var TextWithTooltip = (_a) => {
3648
3645
  as: Component2 = "p",
3649
3646
  className,
3650
3647
  children,
3651
- size = "md" /* md */,
3652
- weight = "normal" /* normal */,
3653
- withTooltip = "whenTruncated" /* whenTruncated */,
3648
+ size: _size = "md" /* md */,
3649
+ weight: _weight = "normal" /* normal */,
3650
+ withTooltip: _withTooltip = "whenTruncated" /* whenTruncated */,
3654
3651
  tooltipOptions
3655
3652
  } = _b, props = __objRest(_b, [
3656
3653
  "as",
@@ -4790,7 +4787,7 @@ var LinkedAccountsComponent = ({
4790
4787
  };
4791
4788
 
4792
4789
  // src/components/BankTransactions/BankTransactions.tsx
4793
- import React124, { useEffect as useEffect22, useMemo as useMemo6, useState as useState28 } from "react";
4790
+ import React124, { useEffect as useEffect22, useMemo as useMemo8, useState as useState28 } from "react";
4794
4791
 
4795
4792
  // src/hooks/useElementSize/useElementSize.ts
4796
4793
  import { useLayoutEffect as useLayoutEffect2, useRef as useRef6 } from "react";
@@ -4940,7 +4937,7 @@ var File = (_a) => {
4940
4937
  var File_default = File;
4941
4938
 
4942
4939
  // src/components/BankTransactionRow/BankTransactionRow.tsx
4943
- import React96, { useEffect as useEffect13, useRef as useRef9, useState as useState16 } from "react";
4940
+ import React96, { useEffect as useEffect13, useMemo as useMemo4, useRef as useRef9, useState as useState16 } from "react";
4944
4941
 
4945
4942
  // src/icons/Scissors.tsx
4946
4943
  import * as React65 from "react";
@@ -5075,6 +5072,19 @@ var Scissors = (_a) => {
5075
5072
  };
5076
5073
  var Scissors_default = Scissors;
5077
5074
 
5075
+ // src/utils/styleUtils/toDataProperties.ts
5076
+ function toDataProperties(input) {
5077
+ const unsafeProperties = Object.fromEntries(
5078
+ Object.entries(input).map(([key, value]) => {
5079
+ if (typeof value !== "string" && typeof value !== "number" && value !== true) {
5080
+ return null;
5081
+ }
5082
+ return [`data-${key}`, value];
5083
+ }).filter((entry) => entry !== null)
5084
+ );
5085
+ return unsafeProperties;
5086
+ }
5087
+
5078
5088
  // src/components/CategorySelect/CategorySelect.tsx
5079
5089
  import React73 from "react";
5080
5090
  import Select, {
@@ -5395,7 +5405,7 @@ import classNames24 from "classnames";
5395
5405
  var CategorySelectDrawer = ({
5396
5406
  onSelect,
5397
5407
  selected,
5398
- showTooltips
5408
+ showTooltips: _showTooltips
5399
5409
  }) => {
5400
5410
  var _a, _b;
5401
5411
  const { setContent, close } = useContext10(DrawerContext);
@@ -5669,7 +5679,7 @@ var CategorySelect = ({
5669
5679
 
5670
5680
  // src/components/ExpandedBankTransactionRow/ExpandedBankTransactionRow.tsx
5671
5681
  import React93, {
5672
- forwardRef as forwardRef6,
5682
+ forwardRef as forwardRef5,
5673
5683
  useImperativeHandle as useImperativeHandle2,
5674
5684
  useState as useState15,
5675
5685
  useCallback,
@@ -5796,7 +5806,7 @@ var Trash = (_a) => {
5796
5806
  var Trash_default = Trash;
5797
5807
 
5798
5808
  // src/components/BankTransactionReceipts/BankTransactionReceipts.tsx
5799
- import React86, { forwardRef as forwardRef5, useImperativeHandle } from "react";
5809
+ import React86, { forwardRef as forwardRef4, useImperativeHandle } from "react";
5800
5810
 
5801
5811
  // src/contexts/ReceiptsContext/ReceiptsContext.ts
5802
5812
  import { createContext as createContext5, useContext as useContext11 } from "react";
@@ -5997,7 +6007,6 @@ var Eye_default = Eye;
5997
6007
  import classNames26 from "classnames";
5998
6008
  var FileThumb = ({
5999
6009
  url,
6000
- type,
6001
6010
  floatingActions = false,
6002
6011
  uploadPending,
6003
6012
  deletePending,
@@ -6388,11 +6397,12 @@ var openReceiptInNewTab = (url, index) => (e) => {
6388
6397
  `);
6389
6398
  }
6390
6399
  };
6391
- var BankTransactionReceiptsWithProvider = forwardRef5((_a, ref) => {
6400
+ var BankTransactionReceiptsWithProvider = forwardRef4((_a, ref) => {
6392
6401
  var _b = _a, { bankTransaction, isActive } = _b, props = __objRest(_b, ["bankTransaction", "isActive"]);
6393
6402
  return /* @__PURE__ */ React86.createElement(ReceiptsProvider, { bankTransaction, isActive }, /* @__PURE__ */ React86.createElement(BankTransactionReceipts, __spreadProps(__spreadValues({}, props), { ref })));
6394
6403
  });
6395
- var BankTransactionReceipts = forwardRef5(
6404
+ BankTransactionReceiptsWithProvider.displayName = "BankTransactionReceiptsWithProvider";
6405
+ var BankTransactionReceipts = forwardRef4(
6396
6406
  ({
6397
6407
  classNamePrefix = "Layer",
6398
6408
  floatingActions = false,
@@ -6433,6 +6443,7 @@ var BankTransactionReceipts = forwardRef5(
6433
6443
  ) : null);
6434
6444
  }
6435
6445
  );
6446
+ BankTransactionReceipts.displayName = "BankTransactionReceipts";
6436
6447
 
6437
6448
  // src/components/MatchForm/MatchForm.tsx
6438
6449
  import React88 from "react";
@@ -6726,7 +6737,7 @@ var ToggleOption = ({
6726
6737
  name,
6727
6738
  onChange,
6728
6739
  value,
6729
- size,
6740
+ size: _size,
6730
6741
  leftIcon,
6731
6742
  disabled,
6732
6743
  disabledMessage = "Disabled",
@@ -6908,7 +6919,7 @@ var validateSplit = (splitData) => {
6908
6919
  });
6909
6920
  return valid;
6910
6921
  };
6911
- var ExpandedBankTransactionRow = forwardRef6(
6922
+ var ExpandedBankTransactionRow = forwardRef5(
6912
6923
  ({
6913
6924
  bankTransaction,
6914
6925
  isOpen = false,
@@ -6925,8 +6936,7 @@ var ExpandedBankTransactionRow = forwardRef6(
6925
6936
  var _a, _b, _c, _d, _e, _f, _g;
6926
6937
  const {
6927
6938
  categorize: categorizeBankTransaction2,
6928
- match: matchBankTransaction2,
6929
- updateOneLocal: updateBankTransaction
6939
+ match: matchBankTransaction2
6930
6940
  } = useBankTransactionsContext();
6931
6941
  const [purpose, setPurpose] = useState15(
6932
6942
  bankTransaction.category ? "categorize" /* categorize */ : hasMatch(bankTransaction) ? "match" /* match */ : "categorize" /* categorize */
@@ -7039,19 +7049,15 @@ var ExpandedBankTransactionRow = forwardRef6(
7039
7049
  };
7040
7050
  const save = () => __async(void 0, null, function* () {
7041
7051
  if (showDescriptions && memoText != void 0) {
7042
- const result = yield Layer.updateBankTransactionMetadata(
7043
- apiUrl,
7044
- auth.access_token,
7045
- {
7046
- params: {
7047
- businessId,
7048
- bankTransactionId: bankTransaction.id
7049
- },
7050
- body: {
7051
- memo: memoText
7052
- }
7052
+ yield Layer.updateBankTransactionMetadata(apiUrl, auth.access_token, {
7053
+ params: {
7054
+ businessId,
7055
+ bankTransactionId: bankTransaction.id
7056
+ },
7057
+ body: {
7058
+ memo: memoText
7053
7059
  }
7054
- );
7060
+ });
7055
7061
  }
7056
7062
  if (purpose === "match" /* match */) {
7057
7063
  if (!selectedMatchId) {
@@ -7365,6 +7371,7 @@ var ExpandedBankTransactionRow = forwardRef6(
7365
7371
  );
7366
7372
  }
7367
7373
  );
7374
+ ExpandedBankTransactionRow.displayName = "ExpandedBankTransactionRow";
7368
7375
 
7369
7376
  // src/components/IconBox/IconBox.tsx
7370
7377
  import React94 from "react";
@@ -7417,6 +7424,7 @@ var BankTransactionRow = ({
7417
7424
  initialLoad,
7418
7425
  showDescriptions,
7419
7426
  showReceiptUploads,
7427
+ showReceiptUploadColumn,
7420
7428
  showTooltips,
7421
7429
  stringOverrides
7422
7430
  }) => {
@@ -7503,6 +7511,10 @@ var BankTransactionRow = ({
7503
7511
  initialLoad ? "initial-load" : "",
7504
7512
  showComponent ? "show" : ""
7505
7513
  );
7514
+ const showReceiptDataProperties = useMemo4(
7515
+ () => toDataProperties({ showReceiptUploadColumn }),
7516
+ [showReceiptUploadColumn]
7517
+ );
7506
7518
  return /* @__PURE__ */ React96.createElement(React96.Fragment, null, /* @__PURE__ */ React96.createElement("tr", { className: rowClassName }, /* @__PURE__ */ React96.createElement(
7507
7519
  "td",
7508
7520
  __spreadValues({
@@ -7542,11 +7554,17 @@ var BankTransactionRow = ({
7542
7554
  ))
7543
7555
  ), /* @__PURE__ */ React96.createElement(
7544
7556
  "td",
7545
- __spreadValues({
7557
+ __spreadValues(__spreadValues({
7546
7558
  className: `Layer__table-cell Layer__table-cell__amount-col Layer__bank-transactions__amount-col Layer__table-cell--amount ${className}__table-cell--amount-${isCredit(bankTransaction) ? "credit" : "debit"}`
7547
- }, openRow),
7559
+ }, openRow), showReceiptDataProperties),
7548
7560
  /* @__PURE__ */ React96.createElement("span", { className: "Layer__table-cell-content" }, isCredit(bankTransaction) ? "+$" : " $", centsToDollars(bankTransaction.amount))
7549
- ), /* @__PURE__ */ React96.createElement("td", { className: "Layer__table-cell Layer__bank-transactions__documents-col" }, ((_c = bankTransaction.document_ids) == null ? void 0 : _c.length) > 0 && /* @__PURE__ */ React96.createElement("span", { className: "Layer__table-cell-content" }, /* @__PURE__ */ React96.createElement(IconBox, null, /* @__PURE__ */ React96.createElement(File_default, { size: 12 })))), /* @__PURE__ */ React96.createElement(
7561
+ ), /* @__PURE__ */ React96.createElement(
7562
+ "td",
7563
+ __spreadValues({
7564
+ className: "Layer__table-cell Layer__bank-transactions__documents-col"
7565
+ }, showReceiptDataProperties),
7566
+ showReceiptUploads && ((_c = bankTransaction.document_ids) == null ? void 0 : _c.length) > 0 && /* @__PURE__ */ React96.createElement("span", { className: "Layer__table-cell-content" }, /* @__PURE__ */ React96.createElement(IconBox, null, /* @__PURE__ */ React96.createElement(File_default, { size: 12 })))
7567
+ ), /* @__PURE__ */ React96.createElement(
7550
7568
  "td",
7551
7569
  {
7552
7570
  className: classNames37(
@@ -7906,7 +7924,7 @@ import React108, { useContext as useContext14, useEffect as useEffect20, useRef
7906
7924
  import React107 from "react";
7907
7925
 
7908
7926
  // src/components/BankTransactionMobileList/BusinessForm.tsx
7909
- import React102, { useContext as useContext13, useEffect as useEffect16, useMemo as useMemo4, useRef as useRef11, useState as useState19 } from "react";
7927
+ import React102, { useContext as useContext13, useEffect as useEffect16, useMemo as useMemo5, useRef as useRef11, useState as useState19 } from "react";
7910
7928
 
7911
7929
  // src/icons/Paperclip.tsx
7912
7930
  import React100 from "react";
@@ -8032,7 +8050,7 @@ var BusinessForm = ({
8032
8050
  setShowRetry(true);
8033
8051
  }
8034
8052
  }, [bankTransaction.error]);
8035
- const options = useMemo4(() => {
8053
+ const options = useMemo5(() => {
8036
8054
  var _a2;
8037
8055
  const options2 = ((_a2 = bankTransaction == null ? void 0 : bankTransaction.categorization_flow) == null ? void 0 : _a2.type) === "ASK_FROM_SUGGESTIONS" /* ASK_FROM_SUGGESTIONS */ ? bankTransaction.categorization_flow.suggestions.map(
8038
8056
  (x) => mapCategoryToOption(x)
@@ -8205,7 +8223,6 @@ var isAlreadyAssigned = (bankTransaction) => {
8205
8223
  var PersonalForm = ({
8206
8224
  bankTransaction,
8207
8225
  showReceiptUploads,
8208
- isOpen,
8209
8226
  showDescriptions
8210
8227
  }) => {
8211
8228
  var _a;
@@ -8425,8 +8442,7 @@ var SplitForm = ({
8425
8442
  const receiptsRef = useRef14(null);
8426
8443
  const {
8427
8444
  categorize: categorizeBankTransaction2,
8428
- isLoading,
8429
- error
8445
+ isLoading
8430
8446
  } = useBankTransactionsContext();
8431
8447
  const { memoText, setMemoText, saveMemoText } = useMemoTextContext();
8432
8448
  const defaultCategory = bankTransaction.category || hasSuggestions(bankTransaction.categorization_flow) && ((_b = (_a = bankTransaction.categorization_flow) == null ? void 0 : _a.suggestions) == null ? void 0 : _b[0]);
@@ -8678,7 +8694,6 @@ var SplitAndMatchForm = ({
8678
8694
  bankTransaction,
8679
8695
  showTooltips,
8680
8696
  showReceiptUploads,
8681
- isOpen,
8682
8697
  showDescriptions
8683
8698
  }) => {
8684
8699
  const anyMatch = hasMatch(bankTransaction);
@@ -8730,7 +8745,6 @@ var BankTransactionMobileForms = ({
8730
8745
  {
8731
8746
  bankTransaction,
8732
8747
  showReceiptUploads,
8733
- isOpen,
8734
8748
  showDescriptions
8735
8749
  }
8736
8750
  );
@@ -8741,7 +8755,6 @@ var BankTransactionMobileForms = ({
8741
8755
  bankTransaction,
8742
8756
  showTooltips,
8743
8757
  showReceiptUploads,
8744
- isOpen,
8745
8758
  showDescriptions
8746
8759
  }
8747
8760
  );
@@ -8989,7 +9002,7 @@ var BankTransactionMobileList = ({
8989
9002
  };
8990
9003
 
8991
9004
  // src/components/BankTransactionsTable/BankTransactionsTable.tsx
8992
- import React114 from "react";
9005
+ import React114, { useMemo as useMemo6 } from "react";
8993
9006
 
8994
9007
  // src/components/BankTransactionsLoader/BankTransactionsLoader.tsx
8995
9008
  import React112 from "react";
@@ -9150,14 +9163,35 @@ var BankTransactionsTable = ({
9150
9163
  lastPage,
9151
9164
  onRefresh
9152
9165
  }) => {
9153
- var _a, _b, _c, _d, _e, _f;
9166
+ var _a, _b, _c, _d, _e, _f, _g;
9167
+ const showReceiptColumn = (_a = showReceiptUploads && (bankTransactions == null ? void 0 : bankTransactions.some(
9168
+ (transaction) => {
9169
+ var _a2;
9170
+ return ((_a2 = transaction.document_ids) == null ? void 0 : _a2.length) > 0;
9171
+ }
9172
+ ))) != null ? _a : false;
9173
+ const showReceiptDataProperties = useMemo6(
9174
+ () => toDataProperties({ showReceiptUploadColumn: showReceiptColumn }),
9175
+ [showReceiptColumn]
9176
+ );
9154
9177
  return /* @__PURE__ */ React114.createElement(
9155
9178
  "table",
9156
9179
  {
9157
9180
  width: "100%",
9158
9181
  className: "Layer__table Layer__bank-transactions__table with-cell-separators"
9159
9182
  },
9160
- /* @__PURE__ */ React114.createElement("thead", null, /* @__PURE__ */ React114.createElement("tr", null, /* @__PURE__ */ React114.createElement("th", { className: "Layer__table-header Layer__bank-transactions__date-col" }, ((_a = stringOverrides == null ? void 0 : stringOverrides.transactionsTable) == null ? void 0 : _a.dateColumnHeaderText) || "Date"), /* @__PURE__ */ React114.createElement("th", { className: "Layer__table-header Layer__bank-transactions__tx-col" }, ((_b = stringOverrides == null ? void 0 : stringOverrides.transactionsTable) == null ? void 0 : _b.transactionColumnHeaderText) || "Transaction"), /* @__PURE__ */ React114.createElement("th", { className: "Layer__table-header Layer__bank-transactions__account-col" }, ((_c = stringOverrides == null ? void 0 : stringOverrides.transactionsTable) == null ? void 0 : _c.accountColumnHeaderText) || "Account"), /* @__PURE__ */ React114.createElement("th", { className: "Layer__table-header Layer__table-cell--amount Layer__table-cell__amount-col" }, ((_d = stringOverrides == null ? void 0 : stringOverrides.transactionsTable) == null ? void 0 : _d.amountColumnHeaderText) || "Amount"), /* @__PURE__ */ React114.createElement("th", { className: "Layer__table-header Layer__bank-transactions__documents-col" }), categorizeView && editable ? /* @__PURE__ */ React114.createElement("th", { className: "Layer__table-header Layer__table-header--primary Layer__table-cell__category-col" }, ((_e = stringOverrides == null ? void 0 : stringOverrides.transactionsTable) == null ? void 0 : _e.categorizeColumnHeaderText) || "Categorize") : /* @__PURE__ */ React114.createElement("th", { className: "Layer__table-header Layer__table-cell__category-col" }, ((_f = stringOverrides == null ? void 0 : stringOverrides.transactionsTable) == null ? void 0 : _f.categoryColumnHeaderText) || "Category"))),
9183
+ /* @__PURE__ */ React114.createElement("thead", null, /* @__PURE__ */ React114.createElement("tr", null, /* @__PURE__ */ React114.createElement("th", { className: "Layer__table-header Layer__bank-transactions__date-col" }, ((_b = stringOverrides == null ? void 0 : stringOverrides.transactionsTable) == null ? void 0 : _b.dateColumnHeaderText) || "Date"), /* @__PURE__ */ React114.createElement("th", { className: "Layer__table-header Layer__bank-transactions__tx-col" }, ((_c = stringOverrides == null ? void 0 : stringOverrides.transactionsTable) == null ? void 0 : _c.transactionColumnHeaderText) || "Transaction"), /* @__PURE__ */ React114.createElement("th", { className: "Layer__table-header Layer__bank-transactions__account-col" }, ((_d = stringOverrides == null ? void 0 : stringOverrides.transactionsTable) == null ? void 0 : _d.accountColumnHeaderText) || "Account"), /* @__PURE__ */ React114.createElement(
9184
+ "th",
9185
+ __spreadValues({
9186
+ className: "Layer__table-header Layer__table-cell--amount Layer__table-cell__amount-col"
9187
+ }, showReceiptDataProperties),
9188
+ ((_e = stringOverrides == null ? void 0 : stringOverrides.transactionsTable) == null ? void 0 : _e.amountColumnHeaderText) || "Amount"
9189
+ ), /* @__PURE__ */ React114.createElement(
9190
+ "th",
9191
+ __spreadValues({
9192
+ className: "Layer__table-header Layer__bank-transactions__documents-col"
9193
+ }, showReceiptDataProperties)
9194
+ ), categorizeView && editable ? /* @__PURE__ */ React114.createElement("th", { className: "Layer__table-header Layer__table-header--primary Layer__table-cell__category-col" }, ((_f = stringOverrides == null ? void 0 : stringOverrides.transactionsTable) == null ? void 0 : _f.categorizeColumnHeaderText) || "Categorize") : /* @__PURE__ */ React114.createElement("th", { className: "Layer__table-header Layer__table-cell__category-col" }, ((_g = stringOverrides == null ? void 0 : stringOverrides.transactionsTable) == null ? void 0 : _g.categoryColumnHeaderText) || "Category"))),
9161
9195
  isLoading && page && page === 1 ? /* @__PURE__ */ React114.createElement(BankTransactionsLoader, { isLoading: true, showTooltips }) : null,
9162
9196
  /* @__PURE__ */ React114.createElement("tbody", null, !isLoading && (bankTransactions == null ? void 0 : bankTransactions.map(
9163
9197
  (bankTransaction, index) => /* @__PURE__ */ React114.createElement(
@@ -9174,6 +9208,7 @@ var BankTransactionsTable = ({
9174
9208
  containerWidth,
9175
9209
  showDescriptions,
9176
9210
  showReceiptUploads,
9211
+ showReceiptUploadColumn: showReceiptColumn,
9177
9212
  showTooltips,
9178
9213
  stringOverrides: stringOverrides == null ? void 0 : stringOverrides.bankTransactionCTAs
9179
9214
  }
@@ -9233,7 +9268,7 @@ var ErrorBoundary = class extends Component {
9233
9268
  import React118 from "react";
9234
9269
 
9235
9270
  // src/hooks/usePagination/usePagination.ts
9236
- import { useMemo as useMemo5 } from "react";
9271
+ import { useMemo as useMemo7 } from "react";
9237
9272
  var DOTS = "...";
9238
9273
  var usePagination = ({
9239
9274
  totalCount,
@@ -9241,7 +9276,7 @@ var usePagination = ({
9241
9276
  siblingCount = 1,
9242
9277
  currentPage
9243
9278
  }) => {
9244
- const paginationRange = useMemo5(() => {
9279
+ const paginationRange = useMemo7(() => {
9245
9280
  const totalPageCount = Math.ceil(totalCount / pageSize);
9246
9281
  const totalPageNumbers = siblingCount + 5;
9247
9282
  if (totalPageNumbers >= totalPageCount) {
@@ -9523,7 +9558,7 @@ var DatePicker = (_a) => {
9523
9558
  dateFormat = mode === "monthPicker" || mode === "monthRangePicker" ? "MMM, yyyy" : mode === "timePicker" ? "h:mm aa" : "MMM d, yyyy",
9524
9559
  timeIntervals = 15,
9525
9560
  timeCaption,
9526
- placeholderText,
9561
+ placeholderText: _placeholderText,
9527
9562
  customDateRanges,
9528
9563
  wrapperClassName,
9529
9564
  calendarClassName,
@@ -10050,7 +10085,7 @@ var BankTransactionsContent = ({
10050
10085
  removeAfterCategorize
10051
10086
  } = useBankTransactionsContext();
10052
10087
  const { data: linkedAccounts } = useLinkedAccounts();
10053
- const isSyncing = useMemo6(
10088
+ const isSyncing = useMemo8(
10054
10089
  () => Boolean(linkedAccounts == null ? void 0 : linkedAccounts.some((item) => item.is_syncing)),
10055
10090
  [linkedAccounts]
10056
10091
  );
@@ -10091,7 +10126,7 @@ var BankTransactionsContent = ({
10091
10126
  return () => clearTimeout(timeoutLoad);
10092
10127
  }
10093
10128
  }, [loadingStatus]);
10094
- const bankTransactions = TEST_EMPTY_STATE ? [] : useMemo6(() => {
10129
+ const bankTransactions = TEST_EMPTY_STATE ? [] : useMemo8(() => {
10095
10130
  if (monthlyView) {
10096
10131
  return data == null ? void 0 : data.filter(
10097
10132
  (x) => parseISO12(x.date) >= dateRange.startDate && parseISO12(x.date) <= dateRange.endDate
@@ -10266,7 +10301,7 @@ var useQuickbooks = () => {
10266
10301
  setQuickbooksIsLinked(isConnected);
10267
10302
  });
10268
10303
  const syncFromQuickbooks2 = () => {
10269
- DEBUG2 && console.log("Triggering sync from Quickbooks...");
10304
+ DEBUG2 && console.debug("Triggering sync from Quickbooks...");
10270
10305
  setIsSyncingFromQuickbooks(true);
10271
10306
  try {
10272
10307
  Layer.syncFromQuickbooks(apiUrl, auth.access_token, {
@@ -10277,7 +10312,7 @@ var useQuickbooks = () => {
10277
10312
  }
10278
10313
  };
10279
10314
  const fetchIsSyncingFromQuickbooks = () => __async(void 0, null, function* () {
10280
- DEBUG2 && console.log("Fetching status of sync from Quickbooks...");
10315
+ DEBUG2 && console.debug("Fetching status of sync from Quickbooks...");
10281
10316
  const isSyncing = (yield Layer.statusOfSyncFromQuickbooks(apiUrl, auth.access_token, {
10282
10317
  params: { businessId }
10283
10318
  })()).data.is_syncing;
@@ -10354,7 +10389,7 @@ var PNLComparisonContext = createContext8({
10354
10389
  });
10355
10390
 
10356
10391
  // src/hooks/useProfitAndLoss/useProfitAndLoss.tsx
10357
- import { useMemo as useMemo8, useState as useState31 } from "react";
10392
+ import { useMemo as useMemo10, useState as useState31 } from "react";
10358
10393
 
10359
10394
  // src/utils/profitAndLossUtils.ts
10360
10395
  var doesLineItemQualifies = (item) => {
@@ -10410,7 +10445,7 @@ var applyShare = (items, total) => {
10410
10445
  };
10411
10446
 
10412
10447
  // src/hooks/useProfitAndLoss/useProfitAndLossLTM.tsx
10413
- import { useEffect as useEffect24, useMemo as useMemo7, useState as useState30 } from "react";
10448
+ import { useEffect as useEffect24, useMemo as useMemo9, useState as useState30 } from "react";
10414
10449
  import { startOfMonth as startOfMonth5, sub } from "date-fns";
10415
10450
  import useSWR3 from "swr";
10416
10451
  var buildDates = ({ currentDate }) => {
@@ -10439,7 +10474,7 @@ var useProfitAndLossLTM = ({ currentDate, tagFilter, reportingBasis } = {
10439
10474
  const [date, setDate] = useState30(currentDate);
10440
10475
  const [loaded, setLoaded] = useState30("initial");
10441
10476
  const [data, setData] = useState30([]);
10442
- const { startYear, startMonth, endYear, endMonth } = useMemo7(() => {
10477
+ const { startYear, startMonth, endYear, endMonth } = useMemo9(() => {
10443
10478
  return buildDates({ currentDate: date });
10444
10479
  }, [date, businessId, tagFilter, reportingBasis]);
10445
10480
  const queryKey = businessId && Boolean(startYear) && Boolean(startMonth) && Boolean(endYear) && Boolean(endMonth) && (auth == null ? void 0 : auth.access_token) && `profit-and-loss-summaries-${businessId}-${startYear.toString()}-${startMonth.toString()}-${tagFilter == null ? void 0 : tagFilter.key}-${(_a = tagFilter == null ? void 0 : tagFilter.values) == null ? void 0 : _a.join(
@@ -10677,7 +10712,7 @@ var useProfitAndLoss = ({
10677
10712
  })
10678
10713
  }));
10679
10714
  };
10680
- const { filteredDataRevenue, filteredTotalRevenue } = useMemo8(() => {
10715
+ const { filteredDataRevenue, filteredTotalRevenue } = useMemo10(() => {
10681
10716
  var _a;
10682
10717
  if (!data) {
10683
10718
  return { filteredDataRevenue: [], filteredTotalRevenue: void 0 };
@@ -10729,7 +10764,7 @@ var useProfitAndLoss = ({
10729
10764
  const withShare = applyShare(sorted, total);
10730
10765
  return { filteredDataRevenue: withShare, filteredTotalRevenue: total };
10731
10766
  }, [data, startDate, filters, sidebarScope, summaryData]);
10732
- const { filteredDataExpenses, filteredTotalExpenses } = useMemo8(() => {
10767
+ const { filteredDataExpenses, filteredTotalExpenses } = useMemo10(() => {
10733
10768
  var _a;
10734
10769
  if (!data) {
10735
10770
  return { filteredDataExpenses: [], filteredTotalExpenses: void 0 };
@@ -10960,7 +10995,7 @@ var useProfitAndLossComparison = ({
10960
10995
  };
10961
10996
 
10962
10997
  // src/components/ProfitAndLossChart/ProfitAndLossChart.tsx
10963
- import React129, { useContext as useContext15, useEffect as useEffect28, useMemo as useMemo9, useState as useState34 } from "react";
10998
+ import React129, { useContext as useContext15, useEffect as useEffect28, useMemo as useMemo11, useState as useState34 } from "react";
10964
10999
 
10965
11000
  // src/components/ProfitAndLossChart/ChartStateCard.tsx
10966
11001
  import React127 from "react";
@@ -11192,7 +11227,7 @@ var ProfitAndLossChart = ({
11192
11227
  start: startOfMonth9(sub2(Date.now(), { months: 11 })),
11193
11228
  end: endOfMonth6(Date.now())
11194
11229
  });
11195
- const selectionMonth = useMemo9(
11230
+ const selectionMonth = useMemo11(
11196
11231
  () => ({
11197
11232
  year: localDateRange.startDate.getFullYear(),
11198
11233
  month: localDateRange.startDate.getMonth()
@@ -11208,7 +11243,7 @@ var ProfitAndLossChart = ({
11208
11243
  currentDate: startOfMonth9(Date.now()),
11209
11244
  tagFilter
11210
11245
  });
11211
- const anyData = useMemo9(() => {
11246
+ const anyData = useMemo11(() => {
11212
11247
  return Boolean(
11213
11248
  data == null ? void 0 : data.find(
11214
11249
  (x) => x.income !== 0 || x.costOfGoodsSold !== 0 || x.grossProfit !== 0 || x.operatingExpenses !== 0 || x.profitBeforeTaxes !== 0 || x.taxes !== 0 || x.totalExpenses !== 0
@@ -11216,11 +11251,11 @@ var ProfitAndLossChart = ({
11216
11251
  );
11217
11252
  }, [data]);
11218
11253
  const { data: linkedAccounts } = useLinkedAccounts();
11219
- const isSyncing = useMemo9(
11254
+ const isSyncing = useMemo11(
11220
11255
  () => Boolean(linkedAccounts == null ? void 0 : linkedAccounts.some((item) => item.is_syncing)),
11221
11256
  [linkedAccounts]
11222
11257
  );
11223
- const loadingValue = useMemo9(() => getLoadingValue(data), [data]);
11258
+ const loadingValue = useMemo11(() => getLoadingValue(data), [data]);
11224
11259
  useEffect28(() => {
11225
11260
  if (loaded === "complete" && data) {
11226
11261
  const foundCurrent = data.find(
@@ -11279,7 +11314,7 @@ var ProfitAndLossChart = ({
11279
11314
  loading: (pnl == null ? void 0 : pnl.isLoading) ? loadingValue : 0,
11280
11315
  loadingExpenses: (pnl == null ? void 0 : pnl.isLoading) ? -loadingValue : 0
11281
11316
  });
11282
- const theData = useMemo9(() => {
11317
+ const theData = useMemo11(() => {
11283
11318
  var _a2;
11284
11319
  if (loaded !== "complete" || loaded === "complete" && !anyData) {
11285
11320
  const loadingData = [];
@@ -12039,7 +12074,7 @@ var X = (_a) => {
12039
12074
  var X_default = X;
12040
12075
 
12041
12076
  // src/components/ProfitAndLossDetailedCharts/DetailedChart.tsx
12042
- import React136, { useMemo as useMemo10 } from "react";
12077
+ import React136, { useMemo as useMemo12 } from "react";
12043
12078
 
12044
12079
  // src/utils/format.ts
12045
12080
  var capitalizeFirstLetter = (text) => text.charAt(0).toUpperCase() + text.slice(1);
@@ -12341,7 +12376,7 @@ var DetailedChart = ({
12341
12376
  isLoading,
12342
12377
  showDatePicker = true
12343
12378
  }) => {
12344
- const chartData = useMemo10(() => {
12379
+ const chartData = useMemo12(() => {
12345
12380
  if (!filteredData) {
12346
12381
  return [];
12347
12382
  }
@@ -12797,7 +12832,7 @@ var ProfitAndLossDownloadButton = ({
12797
12832
  };
12798
12833
 
12799
12834
  // src/components/ProfitAndLossHeader/ProfitAndLossHeader.tsx
12800
- import React141, { useMemo as useMemo11 } from "react";
12835
+ import React141, { useMemo as useMemo13 } from "react";
12801
12836
 
12802
12837
  // src/components/SyncingBadge/SyncingBadge.tsx
12803
12838
  import React140 from "react";
@@ -12821,7 +12856,7 @@ var ProfitAndLossHeader = ({
12821
12856
  withDatePicker
12822
12857
  }) => {
12823
12858
  const { data: linkedAccounts } = useLinkedAccounts();
12824
- const isSyncing = useMemo11(
12859
+ const isSyncing = useMemo13(
12825
12860
  () => Boolean(linkedAccounts == null ? void 0 : linkedAccounts.some((item) => item.is_syncing)),
12826
12861
  [linkedAccounts]
12827
12862
  );
@@ -12833,10 +12868,10 @@ import React148, { useContext as useContext20 } from "react";
12833
12868
 
12834
12869
  // src/components/Header/Header.tsx
12835
12870
  import React142, {
12836
- forwardRef as forwardRef7
12871
+ forwardRef as forwardRef6
12837
12872
  } from "react";
12838
12873
  import classNames51 from "classnames";
12839
- var Header2 = forwardRef7(
12874
+ var Header2 = forwardRef6(
12840
12875
  ({ className, children, style, sticky, asHeader, rounded }, ref) => {
12841
12876
  const baseClassName = classNames51(
12842
12877
  "Layer__header",
@@ -12858,6 +12893,7 @@ var Header2 = forwardRef7(
12858
12893
  );
12859
12894
  }
12860
12895
  );
12896
+ Header2.displayName = "Header";
12861
12897
 
12862
12898
  // src/components/Header/HeaderRow.tsx
12863
12899
  import React143 from "react";
@@ -12917,7 +12953,7 @@ var Panel = ({
12917
12953
  };
12918
12954
 
12919
12955
  // src/components/View/View.tsx
12920
- import React147, { forwardRef as forwardRef8 } from "react";
12956
+ import React147, { forwardRef as forwardRef7 } from "react";
12921
12957
 
12922
12958
  // src/components/ViewHeader/ViewHeader.tsx
12923
12959
  import React146 from "react";
@@ -12928,7 +12964,7 @@ var ViewHeader = ({ title, className, children }) => {
12928
12964
 
12929
12965
  // src/components/View/View.tsx
12930
12966
  import classNames56 from "classnames";
12931
- var View = forwardRef8(
12967
+ var View = forwardRef7(
12932
12968
  ({
12933
12969
  title,
12934
12970
  showHeader = true,
@@ -12959,6 +12995,7 @@ var View = forwardRef8(
12959
12995
  ), withSidebar ? /* @__PURE__ */ React147.createElement(Panel, { sidebarIsOpen: true, sidebar, defaultSidebarHeight: true }, /* @__PURE__ */ React147.createElement("div", { className: "Layer__view-main" }, children)) : /* @__PURE__ */ React147.createElement("div", { className: "Layer__view-main" }, children));
12960
12996
  }
12961
12997
  );
12998
+ View.displayName = "View";
12962
12999
 
12963
13000
  // src/components/ProfitAndLossReport/ProfitAndLossReport.tsx
12964
13001
  var ProfitAndLossReport = ({
@@ -13033,32 +13070,17 @@ var ProfitAndLossReport = ({
13033
13070
  };
13034
13071
 
13035
13072
  // src/components/ProfitAndLossSummaries/ProfitAndLossSummaries.tsx
13036
- import React153, { useContext as useContext21, useMemo as useMemo15 } from "react";
13037
-
13038
- // src/components/ProfitAndLossSummaries/internal/ProfitAndLossSummariesList.tsx
13039
- import React149, { useMemo as useMemo12 } from "react";
13040
-
13041
- // src/utils/styleUtils/toDataProperties.ts
13042
- function toDataProperties(input) {
13043
- const unsafeProperties = Object.fromEntries(
13044
- Object.entries(input).map(([key, value]) => {
13045
- if (typeof value !== "string" && typeof value !== "number" && value !== true) {
13046
- return null;
13047
- }
13048
- return [`data-${key}`, value];
13049
- }).filter((entry) => entry !== null)
13050
- );
13051
- return unsafeProperties;
13052
- }
13073
+ import React153, { useContext as useContext21, useMemo as useMemo17 } from "react";
13053
13074
 
13054
13075
  // src/components/ProfitAndLossSummaries/internal/ProfitAndLossSummariesList.tsx
13076
+ import React149, { useMemo as useMemo14 } from "react";
13055
13077
  var LIST_ITEM_CLASS_NAME = "Layer__ProfitAndLossSummariesListItem";
13056
13078
  function ProfitAndLossSummariesListItem({
13057
13079
  children,
13058
13080
  isActive,
13059
13081
  onClick
13060
13082
  }) {
13061
- const dataProperties = useMemo12(
13083
+ const dataProperties = useMemo14(
13062
13084
  () => toDataProperties({ active: isActive, clickable: !!onClick }),
13063
13085
  [isActive]
13064
13086
  );
@@ -13069,7 +13091,7 @@ function ProfitAndLossSummariesList({
13069
13091
  children,
13070
13092
  itemCount
13071
13093
  }) {
13072
- const dataProperties = useMemo12(
13094
+ const dataProperties = useMemo14(
13073
13095
  () => toDataProperties({ ["column-count"]: itemCount }),
13074
13096
  [itemCount]
13075
13097
  );
@@ -13162,10 +13184,10 @@ function ProfitAndLossSummariesMiniChart({
13162
13184
  }
13163
13185
 
13164
13186
  // src/components/ProfitAndLossSummaries/internal/ProfitAndLossSummariesSummary.tsx
13165
- import React152, { useMemo as useMemo14 } from "react";
13187
+ import React152, { useMemo as useMemo16 } from "react";
13166
13188
 
13167
13189
  // src/components/ProfitAndLossSummaries/internal/ProfitAndLossSummariesHeading.tsx
13168
- import { useMemo as useMemo13 } from "react";
13190
+ import { useMemo as useMemo15 } from "react";
13169
13191
  import React151 from "react";
13170
13192
  var HEADING_CLASS_NAME = "Layer__ProfitAndLossSummariesSummaryHeading";
13171
13193
  function ProfitAndLossSummariesHeading({
@@ -13173,7 +13195,7 @@ function ProfitAndLossSummariesHeading({
13173
13195
  children
13174
13196
  }) {
13175
13197
  const { size = "sm" } = variants != null ? variants : {};
13176
- const labelDataProperties = useMemo13(() => toDataProperties({ size }), [size]);
13198
+ const labelDataProperties = useMemo15(() => toDataProperties({ size }), [size]);
13177
13199
  return /* @__PURE__ */ React151.createElement("h3", __spreadValues({ className: HEADING_CLASS_NAME }, labelDataProperties), children);
13178
13200
  }
13179
13201
 
@@ -13190,8 +13212,8 @@ function ProfitAndLossSummariesSummary({
13190
13212
  }) {
13191
13213
  const { Chart } = slots != null ? slots : {};
13192
13214
  const { size = "sm" } = variants != null ? variants : {};
13193
- const dataProperties = useMemo14(() => toDataProperties({ size }), [size]);
13194
- const amountDataProperties = useMemo14(
13215
+ const dataProperties = useMemo16(() => toDataProperties({ size }), [size]);
13216
+ const amountDataProperties = useMemo16(
13195
13217
  () => toDataProperties({
13196
13218
  positive: amount >= 0,
13197
13219
  negative: amount < 0,
@@ -13221,7 +13243,7 @@ function Internal_ProfitAndLossSummaries({
13221
13243
  sidebarScope
13222
13244
  } = useContext21(ProfitAndLoss.Context);
13223
13245
  const dataItem = Array.isArray(storedData) ? storedData[storedData.length - 1] : storedData;
13224
- const { revenueChartData, expensesChartData } = useMemo15(
13246
+ const { revenueChartData, expensesChartData } = useMemo17(
13225
13247
  () => ({
13226
13248
  revenueChartData: toMiniChartData({ scope: "revenue", data: dataItem }),
13227
13249
  expensesChartData: toMiniChartData({ scope: "expenses", data: dataItem })
@@ -13849,7 +13871,7 @@ var ProfitAndLossTableComponent = ({
13849
13871
  /* @__PURE__ */ React162.createElement(PieChart_default, null)
13850
13872
  )
13851
13873
  ),
13852
- /* @__PURE__ */ React162.createElement(TableCell, { isCurrency: true, primary: true }, Number.isNaN(lineItem.value) ? 0 : lineItem.value)
13874
+ /* @__PURE__ */ React162.createElement(TableCell, { isCurrency: true, primary: true, align: "right" /* RIGHT */ }, Number.isNaN(lineItem.value) ? 0 : lineItem.value)
13853
13875
  ), expanded && lineItem.line_items ? lineItem.line_items.map(
13854
13876
  (child, i) => renderLineItem(
13855
13877
  child,
@@ -15217,13 +15239,13 @@ var ChartOfAccountsDatePicker = () => {
15217
15239
  import React174 from "react";
15218
15240
 
15219
15241
  // src/components/ChartOfAccountsForm/ChartOfAccountsForm.tsx
15220
- import React173, { useContext as useContext27, useMemo as useMemo17 } from "react";
15242
+ import React173, { useContext as useContext27, useMemo as useMemo19 } from "react";
15221
15243
 
15222
15244
  // src/components/ChartOfAccountsForm/useParentOptions.ts
15223
- import { useMemo as useMemo16 } from "react";
15245
+ import { useMemo as useMemo18 } from "react";
15224
15246
  var useParentOptions = (data) => {
15225
15247
  var _a;
15226
- return useMemo16(
15248
+ return useMemo18(
15227
15249
  () => flattenAccounts((data == null ? void 0 : data.accounts) || []).sort((a, b) => (a == null ? void 0 : a.name) && (b == null ? void 0 : b.name) ? a.name.localeCompare(b.name) : 0).map((x) => {
15228
15250
  return {
15229
15251
  label: x.name,
@@ -15249,7 +15271,7 @@ var ChartOfAccountsForm = ({
15249
15271
  apiError
15250
15272
  } = useContext27(ChartOfAccountsContext);
15251
15273
  const parentOptions = useParentOptions(data);
15252
- const entry = useMemo17(() => {
15274
+ const entry = useMemo19(() => {
15253
15275
  if ((form == null ? void 0 : form.action) === "edit" && form.accountId) {
15254
15276
  return flattenAccounts((data == null ? void 0 : data.accounts) || []).find(
15255
15277
  (x) => x.id === form.accountId
@@ -15691,12 +15713,12 @@ var ChartOfAccountsTableWithPanel = ({
15691
15713
  import React184, {
15692
15714
  useContext as useContext32,
15693
15715
  useEffect as useEffect43,
15694
- useMemo as useMemo19,
15716
+ useMemo as useMemo21,
15695
15717
  useState as useState49
15696
15718
  } from "react";
15697
15719
 
15698
15720
  // src/components/LedgerAccountEntryDetails/LedgerAccountEntryDetails.tsx
15699
- import React182, { useContext as useContext30, useMemo as useMemo18 } from "react";
15721
+ import React182, { useContext as useContext30, useMemo as useMemo20 } from "react";
15700
15722
 
15701
15723
  // src/utils/journal.ts
15702
15724
  var getAccountIdentifierPayload = (journalLineItem) => {
@@ -15905,7 +15927,7 @@ var LedgerAccountEntryDetails = ({
15905
15927
  }) => {
15906
15928
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v;
15907
15929
  const { entryData, isLoadingEntry, closeSelectedEntry, errorEntry } = useContext30(LedgerAccountsContext);
15908
- const { totalDebit, totalCredit } = useMemo18(() => {
15930
+ const { totalDebit, totalCredit } = useMemo20(() => {
15909
15931
  var _a2;
15910
15932
  let totalDebit2 = 0;
15911
15933
  let totalCredit2 = 0;
@@ -16164,12 +16186,12 @@ var LedgerAccount = ({
16164
16186
  "Layer__ledger-account__index",
16165
16187
  accountId && "open"
16166
16188
  );
16167
- const account = useMemo19(() => {
16189
+ const account = useMemo21(() => {
16168
16190
  return flattenAccounts((accountData == null ? void 0 : accountData.accounts) || []).find(
16169
16191
  (x) => x.id === accountId
16170
16192
  );
16171
16193
  }, [accountId]);
16172
- const data = useMemo19(() => {
16194
+ const data = useMemo21(() => {
16173
16195
  var _a2;
16174
16196
  const firstPageIndex = (currentPage - 1) * pageSize;
16175
16197
  const lastPageIndex = firstPageIndex + pageSize;
@@ -16606,13 +16628,13 @@ var useJournal = () => {
16606
16628
  };
16607
16629
 
16608
16630
  // src/components/JournalTable/JournalTableWithPanel.tsx
16609
- import React191, { useContext as useContext39, useMemo as useMemo21, useState as useState53 } from "react";
16631
+ import React191, { useContext as useContext39, useMemo as useMemo23, useState as useState53 } from "react";
16610
16632
 
16611
16633
  // src/components/JournalSidebar/JournalSidebar.tsx
16612
16634
  import React189, { useContext as useContext37 } from "react";
16613
16635
 
16614
16636
  // src/components/JournalEntryDetails/JournalEntryDetails.tsx
16615
- import React186, { useContext as useContext34, useMemo as useMemo20, useState as useState52 } from "react";
16637
+ import React186, { useContext as useContext34, useMemo as useMemo22, useState as useState52 } from "react";
16616
16638
  var JournalEntryDetails = () => {
16617
16639
  var _a, _b, _c, _d;
16618
16640
  const {
@@ -16626,13 +16648,13 @@ var JournalEntryDetails = () => {
16626
16648
  } = useContext34(JournalContext);
16627
16649
  const [reverseEntryProcessing, setReverseEntryProcessing] = useState52(false);
16628
16650
  const [reverseEntryError, setReverseEntryError] = useState52();
16629
- const entry = useMemo20(() => {
16651
+ const entry = useMemo22(() => {
16630
16652
  if (selectedEntryId && data) {
16631
16653
  return data.find((x) => x.id === selectedEntryId);
16632
16654
  }
16633
16655
  return;
16634
16656
  }, [data, selectedEntryId]);
16635
- const sortedLineItems = useMemo20(
16657
+ const sortedLineItems = useMemo22(
16636
16658
  () => {
16637
16659
  var _a2;
16638
16660
  return (_a2 = entry == null ? void 0 : entry.line_items) == null ? void 0 : _a2.sort(
@@ -17164,7 +17186,7 @@ var JournalTableWithPanel = ({
17164
17186
  selectedEntryId,
17165
17187
  addEntry
17166
17188
  } = useContext39(JournalContext);
17167
- const data = useMemo21(() => {
17189
+ const data = useMemo23(() => {
17168
17190
  var _a;
17169
17191
  const firstPageIndex = (currentPage - 1) * pageSize;
17170
17192
  const lastPageIndex = firstPageIndex + pageSize;
@@ -17286,7 +17308,7 @@ import React199, {
17286
17308
  createContext as createContext17,
17287
17309
  useContext as useContext44,
17288
17310
  useEffect as useEffect48,
17289
- useMemo as useMemo23,
17311
+ useMemo as useMemo25,
17290
17312
  useState as useState58
17291
17313
  } from "react";
17292
17314
 
@@ -17553,7 +17575,7 @@ var TasksHeader = ({
17553
17575
  };
17554
17576
 
17555
17577
  // src/components/TasksList/TasksList.tsx
17556
- import React197, { useContext as useContext42, useMemo as useMemo22, useState as useState57 } from "react";
17578
+ import React197, { useContext as useContext42, useMemo as useMemo24, useState as useState57 } from "react";
17557
17579
 
17558
17580
  // src/icons/SmileIcon.tsx
17559
17581
  import * as React195 from "react";
@@ -17704,7 +17726,7 @@ var TasksList = ({ pageSize = 10 }) => {
17704
17726
  const [currentPage, setCurrentPage] = useState57(
17705
17727
  firstPageWithIincompleteTasks === -1 ? 1 : firstPageWithIincompleteTasks + 1
17706
17728
  );
17707
- const sortedTasks = useMemo22(() => {
17729
+ const sortedTasks = useMemo24(() => {
17708
17730
  const firstPageIndex = (currentPage - 1) * pageSize;
17709
17731
  const lastPageIndex = firstPageIndex + pageSize;
17710
17732
  return tasks == null ? void 0 : tasks.slice(firstPageIndex, lastPageIndex);
@@ -17835,7 +17857,7 @@ var TasksComponent = ({
17835
17857
  stringOverrides
17836
17858
  }) => {
17837
17859
  const { isLoading, loadedStatus, data } = useContext44(TasksContext);
17838
- const allComplete = useMemo23(() => {
17860
+ const allComplete = useMemo25(() => {
17839
17861
  if (!data) {
17840
17862
  return void 0;
17841
17863
  }
@@ -18147,10 +18169,10 @@ var BadgeLoader = ({ children }) => {
18147
18169
  };
18148
18170
 
18149
18171
  // src/components/ui/Stack.tsx
18150
- import React206, { useMemo as useMemo24 } from "react";
18172
+ import React206, { useMemo as useMemo26 } from "react";
18151
18173
  var CLASS_NAME3 = "Layer__VStack";
18152
18174
  function VStack({ align, children, gap }) {
18153
- const dataProperties = useMemo24(
18175
+ const dataProperties = useMemo26(
18154
18176
  () => toDataProperties({ align, gap }),
18155
18177
  [align, gap]
18156
18178
  );