@layerfi/components 0.1.107-alpha.2 → 0.1.107

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.
@@ -5603,7 +5603,7 @@ var import_react12 = require("react");
5603
5603
  var import_react10 = require("react");
5604
5604
 
5605
5605
  // package.json
5606
- var version = "0.1.107-alpha.2";
5606
+ var version = "0.1.107";
5607
5607
 
5608
5608
  // src/models/APIError.ts
5609
5609
  var APIError = class _APIError extends Error {
@@ -6511,10 +6511,10 @@ var import_jsx_runtime4 = require("react/jsx-runtime");
6511
6511
  var InAppLinkContext = (0, import_react5.createContext)({});
6512
6512
  var useInAppLinkContext = () => (0, import_react5.useContext)(InAppLinkContext);
6513
6513
  var InAppLinkProvider = ({
6514
- convertToInAppLink,
6514
+ renderInAppLink,
6515
6515
  children
6516
6516
  }) => {
6517
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(InAppLinkContext.Provider, { value: { convertToInAppLink }, children });
6517
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(InAppLinkContext.Provider, { value: { renderInAppLink }, children });
6518
6518
  };
6519
6519
 
6520
6520
  // src/schemas/customer.ts
@@ -6649,7 +6649,7 @@ var TransactionLedgerEntrySourceSchema = import_effect3.Schema.Struct({
6649
6649
  import_effect3.Schema.fromKey("transaction_id")
6650
6650
  ),
6651
6651
  externalId: (0, import_effect3.pipe)(
6652
- import_effect3.Schema.propertySignature(import_effect3.Schema.String),
6652
+ import_effect3.Schema.propertySignature(import_effect3.Schema.NullOr(import_effect3.Schema.String)),
6653
6653
  import_effect3.Schema.fromKey("external_id")
6654
6654
  ),
6655
6655
  accountName: (0, import_effect3.pipe)(
@@ -6659,7 +6659,7 @@ var TransactionLedgerEntrySourceSchema = import_effect3.Schema.Struct({
6659
6659
  date: import_effect3.Schema.String,
6660
6660
  amount: import_effect3.Schema.Number,
6661
6661
  direction: import_effect3.Schema.Enums(Direction),
6662
- counterparty: import_effect3.Schema.optional(import_effect3.Schema.String),
6662
+ counterparty: import_effect3.Schema.optional(import_effect3.Schema.NullOr(import_effect3.Schema.String)),
6663
6663
  description: import_effect3.Schema.optional(import_effect3.Schema.String),
6664
6664
  memo: import_effect3.Schema.optional(import_effect3.Schema.NullOr(import_effect3.Schema.String)),
6665
6665
  metadata: import_effect3.Schema.optional(import_effect3.Schema.NullOr(import_effect3.Schema.Unknown)),
@@ -6683,7 +6683,7 @@ var InvoiceLedgerEntrySourceSchema = import_effect3.Schema.Struct({
6683
6683
  import_effect3.Schema.fromKey("invoice_id")
6684
6684
  ),
6685
6685
  externalId: (0, import_effect3.pipe)(
6686
- import_effect3.Schema.propertySignature(import_effect3.Schema.String),
6686
+ import_effect3.Schema.propertySignature(import_effect3.Schema.NullOr(import_effect3.Schema.String)),
6687
6687
  import_effect3.Schema.fromKey("external_id")
6688
6688
  ),
6689
6689
  invoiceNumber: (0, import_effect3.pipe)(
@@ -6691,7 +6691,7 @@ var InvoiceLedgerEntrySourceSchema = import_effect3.Schema.Struct({
6691
6691
  import_effect3.Schema.fromKey("invoice_number")
6692
6692
  ),
6693
6693
  recipientName: (0, import_effect3.pipe)(
6694
- import_effect3.Schema.propertySignature(import_effect3.Schema.String),
6694
+ import_effect3.Schema.propertySignature(import_effect3.Schema.NullOr(import_effect3.Schema.String)),
6695
6695
  import_effect3.Schema.fromKey("recipient_name")
6696
6696
  ),
6697
6697
  customerDescription: (0, import_effect3.pipe)(
@@ -6747,7 +6747,7 @@ var InvoicePaymentLedgerEntrySourceSchema = import_effect3.Schema.Struct({
6747
6747
  ),
6748
6748
  type: import_effect3.Schema.Literal("Invoice_Payment_Ledger_Entry_Source"),
6749
6749
  externalId: (0, import_effect3.pipe)(
6750
- import_effect3.Schema.propertySignature(import_effect3.Schema.String),
6750
+ import_effect3.Schema.propertySignature(import_effect3.Schema.NullOr(import_effect3.Schema.String)),
6751
6751
  import_effect3.Schema.fromKey("external_id")
6752
6752
  ),
6753
6753
  invoiceId: (0, import_effect3.pipe)(
@@ -6897,7 +6897,7 @@ var PayoutLedgerEntrySourceSchema = import_effect3.Schema.Struct({
6897
6897
  import_effect3.Schema.fromKey("payout_id")
6898
6898
  ),
6899
6899
  externalId: (0, import_effect3.pipe)(
6900
- import_effect3.Schema.propertySignature(import_effect3.Schema.String),
6900
+ import_effect3.Schema.propertySignature(import_effect3.Schema.NullOr(import_effect3.Schema.String)),
6901
6901
  import_effect3.Schema.fromKey("external_id")
6902
6902
  ),
6903
6903
  paidOutAmount: (0, import_effect3.pipe)(
@@ -16035,7 +16035,7 @@ var flattenOptionGroups = (options3) => {
16035
16035
  return options3.flatMap(
16036
16036
  (opt) => {
16037
16037
  var _a;
16038
- return ((_a = opt.value) == null ? void 0 : _a.type) === "GROUP" && Array.isArray(opt.value.items) ? flattenOptionGroups(opt.value.items) : [opt];
16038
+ return ((_a = opt.value) == null ? void 0 : _a.type) === "GROUP" && Array.isArray(opt.value.items) ? [opt, ...flattenOptionGroups(opt.value.items)] : [opt];
16039
16039
  }
16040
16040
  );
16041
16041
  };
@@ -16146,18 +16146,21 @@ var BusinessCategories = ({
16146
16146
  const [optionsToShow, setOptionsToShow] = (0, import_react60.useState)(categoryOptions);
16147
16147
  const [selectedGroup, setSelectedGroup] = (0, import_react60.useState)();
16148
16148
  const filteredOptions = (0, import_react60.useMemo)(() => {
16149
- const sortedOptions = optionsToShow.sort((a, b) => a.label.localeCompare(b.label));
16150
- if (!query) return sortedOptions;
16151
- const lower = query.toLowerCase();
16152
- const flattenedOptions = flattenOptionGroups(sortedOptions);
16153
- return flattenedOptions.filter(
16154
- (opt) => opt.label.toLowerCase().includes(lower)
16155
- );
16149
+ let options3 = optionsToShow;
16150
+ if (query) {
16151
+ const lower = query.toLowerCase();
16152
+ const flattenedOptions = flattenOptionGroups(options3);
16153
+ options3 = flattenedOptions.filter(
16154
+ (opt) => opt.label.toLowerCase().includes(lower)
16155
+ );
16156
+ }
16157
+ return options3.sort((a, b) => a.label.localeCompare(b.label));
16156
16158
  }, [optionsToShow, query]);
16157
16159
  const onCategorySelect = (v) => {
16158
16160
  if (v.value.type === "GROUP" && v.value.items) {
16159
16161
  setOptionsToShow(v.value.items);
16160
16162
  setSelectedGroup(v.label);
16163
+ setQuery("");
16161
16164
  return;
16162
16165
  }
16163
16166
  select(v);
@@ -16165,13 +16168,14 @@ var BusinessCategories = ({
16165
16168
  const clearSelectedGroup = (0, import_react60.useCallback)(() => {
16166
16169
  setOptionsToShow(categoryOptions);
16167
16170
  setSelectedGroup(void 0);
16171
+ setQuery("");
16168
16172
  }, [categoryOptions]);
16169
16173
  return /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)(VStack, { className: "Layer__bank-transaction-mobile-list-item__categories_list-container", pbs: "lg", gap: "md", children: [
16170
16174
  /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)(VStack, { pis: "sm", pie: "sm", gap: "md", children: [
16171
16175
  /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(HStack, { pis: "xs", children: selectedGroup ? /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)(Button2, { variant: "text", onClick: clearSelectedGroup, children: [
16172
16176
  /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(import_lucide_react6.ChevronLeft, { size: 18 }),
16173
- /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(Span, { size: "lg", weight: "bold", align: "center", children: selectedGroup })
16174
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(Span, { size: "lg", weight: "bold", children: "Select category" }) }),
16177
+ /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(ModalHeading, { size: "sm", weight: "bold", align: "center", children: selectedGroup })
16178
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(ModalHeading, { size: "sm", weight: "bold", children: "Select category" }) }),
16175
16179
  /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(SearchField, { value: query, onChange: setQuery, label: "Search categories..." })
16176
16180
  ] }),
16177
16181
  /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
@@ -16493,7 +16497,7 @@ var Option2 = (props) => {
16493
16497
  return null;
16494
16498
  }
16495
16499
  if (props.data.type === "match") {
16496
- const inAppLink = props.convertToInAppLink && props.data.payload.details ? props.convertToInAppLink(convertMatchDetailsToLinkingMetadata(props.data.payload.details)) : null;
16500
+ const inAppLink = props.renderInAppLink && props.data.payload.details ? props.renderInAppLink(convertMatchDetailsToLinkingMetadata(props.data.payload.details)) : null;
16497
16501
  return /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(
16498
16502
  import_react_select3.components.Option,
16499
16503
  __spreadProps(__spreadValues({}, props), {
@@ -16582,7 +16586,7 @@ var CategorySelect = ({
16582
16586
  }) => {
16583
16587
  var _a, _b, _c, _d;
16584
16588
  const { data: categories } = useCategories();
16585
- const { convertToInAppLink } = useInAppLinkContext();
16589
+ const { renderInAppLink } = useInAppLinkContext();
16586
16590
  const [isDrawerOpen, setIsDrawerOpen] = (0, import_react61.useState)(false);
16587
16591
  const onSelect = (0, import_react61.useCallback)((option) => {
16588
16592
  if (option.value.payload) {
@@ -16693,7 +16697,7 @@ var CategorySelect = ({
16693
16697
  components: {
16694
16698
  DropdownIndicator,
16695
16699
  GroupHeading,
16696
- Option: (optionProps) => /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(Option2, __spreadProps(__spreadValues({}, optionProps), { showTooltips, convertToInAppLink }))
16700
+ Option: (optionProps) => /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(Option2, __spreadProps(__spreadValues({}, optionProps), { showTooltips, renderInAppLink }))
16697
16701
  },
16698
16702
  isDisabled: disabled,
16699
16703
  isOptionDisabled: (option) => {
@@ -17357,7 +17361,7 @@ var MatchForm = ({
17357
17361
  }) => {
17358
17362
  const bookkeepingStatus = useEffectiveBookkeepingStatus();
17359
17363
  const categorizationEnabled = isCategorizationEnabledForStatus(bookkeepingStatus);
17360
- const { convertToInAppLink } = useInAppLinkContext();
17364
+ const { renderInAppLink } = useInAppLinkContext();
17361
17365
  const {
17362
17366
  suggested_matches: suggestedMatches = [],
17363
17367
  match
@@ -17373,12 +17377,12 @@ var MatchForm = ({
17373
17377
  /* @__PURE__ */ (0, import_jsx_runtime114.jsx)("div", { className: `${classNamePrefix}__match-table__date`, children: "Date" }),
17374
17378
  /* @__PURE__ */ (0, import_jsx_runtime114.jsx)("div", { className: `${classNamePrefix}__match-table__desc`, children: "Description" }),
17375
17379
  /* @__PURE__ */ (0, import_jsx_runtime114.jsx)("div", { className: `${classNamePrefix}__match-table__amount`, children: "Amount" }),
17376
- convertToInAppLink && /* @__PURE__ */ (0, import_jsx_runtime114.jsx)("div", { className: `${classNamePrefix}__match-table__link`, children: "Link" }),
17380
+ renderInAppLink && /* @__PURE__ */ (0, import_jsx_runtime114.jsx)("div", { className: `${classNamePrefix}__match-table__link`, children: "Link" }),
17377
17381
  match && /* @__PURE__ */ (0, import_jsx_runtime114.jsx)("div", { className: `${classNamePrefix}__match-table__status` })
17378
17382
  ] }),
17379
17383
  effectiveSuggestedMatches.map((suggestedMatch) => {
17380
17384
  var _a;
17381
- const inAppLink = convertToInAppLink ? convertToInAppLink(convertMatchDetailsToLinkingMetadata(suggestedMatch.details)) : null;
17385
+ const inAppLink = renderInAppLink ? renderInAppLink(convertMatchDetailsToLinkingMetadata(suggestedMatch.details)) : null;
17382
17386
  return /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)(
17383
17387
  "div",
17384
17388
  {
@@ -17472,10 +17476,10 @@ var MatchFormMobile = ({
17472
17476
  readOnly
17473
17477
  }) => {
17474
17478
  var _a;
17475
- const { convertToInAppLink } = useInAppLinkContext();
17479
+ const { renderInAppLink } = useInAppLinkContext();
17476
17480
  return /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)("div", { className: `${classNamePrefix}__match-list`, children: [
17477
17481
  (_a = bankTransaction.suggested_matches) == null ? void 0 : _a.map((match, idx) => {
17478
- const inAppLink = convertToInAppLink ? convertToInAppLink(convertMatchDetailsToLinkingMetadata(match.details)) : null;
17482
+ const inAppLink = renderInAppLink ? renderInAppLink(convertMatchDetailsToLinkingMetadata(match.details)) : null;
17479
17483
  return /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(
17480
17484
  "div",
17481
17485
  {
@@ -21815,14 +21819,14 @@ var import_classnames48 = __toESM(require("classnames"));
21815
21819
  var import_date_fns20 = require("date-fns");
21816
21820
  var import_jsx_runtime148 = require("react/jsx-runtime");
21817
21821
  var DATE_FORMAT2 = "LLL d";
21818
- var getAssignedValue2 = (bankTransaction, convertToInAppLink) => {
21822
+ var getAssignedValue2 = (bankTransaction, renderInAppLink) => {
21819
21823
  var _a, _b, _c, _d;
21820
21824
  if (bankTransaction.categorization_status === "SPLIT" /* SPLIT */) {
21821
21825
  return extractDescriptionForSplit(bankTransaction.category);
21822
21826
  }
21823
21827
  if (bankTransaction.categorization_status === "MATCHED" /* MATCHED */) {
21824
- if (convertToInAppLink && ((_a = bankTransaction.match) == null ? void 0 : _a.details)) {
21825
- const inAppLink = convertToInAppLink(convertMatchDetailsToLinkingMetadata(bankTransaction.match.details));
21828
+ if (renderInAppLink && ((_a = bankTransaction.match) == null ? void 0 : _a.details)) {
21829
+ const inAppLink = renderInAppLink(convertMatchDetailsToLinkingMetadata(bankTransaction.match.details));
21826
21830
  if (inAppLink) return inAppLink;
21827
21831
  }
21828
21832
  return (_c = (_b = bankTransaction.match) == null ? void 0 : _b.details) == null ? void 0 : _c.description;
@@ -21847,7 +21851,7 @@ var BankTransactionMobileListItem = ({
21847
21851
  clearTransactionIdToOpen
21848
21852
  } = (0, import_react96.useContext)(TransactionToOpenContext);
21849
21853
  const { shouldHideAfterCategorize } = useBankTransactionsContext();
21850
- const { convertToInAppLink } = useInAppLinkContext();
21854
+ const { renderInAppLink } = useInAppLinkContext();
21851
21855
  const formRowRef = useElementSize(
21852
21856
  (_a2, _b, { height: height2 }) => setHeight(height2)
21853
21857
  );
@@ -21934,7 +21938,7 @@ var BankTransactionMobileListItem = ({
21934
21938
  /* @__PURE__ */ (0, import_jsx_runtime148.jsxs)("div", { className: `${className}__heading__main`, children: [
21935
21939
  /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(Text, { as: "span", className: `${className}__heading__tx-name`, children: (_a = bankTransaction.counterparty_name) != null ? _a : bankTransaction.description }),
21936
21940
  /* @__PURE__ */ (0, import_jsx_runtime148.jsxs)(Text, { as: "span", className: `${className}__heading__account-name`, children: [
21937
- categorized && bankTransaction.categorization_status ? getAssignedValue2(bankTransaction, convertToInAppLink) : null,
21941
+ categorized && bankTransaction.categorization_status ? getAssignedValue2(bankTransaction, renderInAppLink) : null,
21938
21942
  /* @__PURE__ */ (0, import_jsx_runtime148.jsx)("span", { children: !categorized && bankTransaction.account_name }),
21939
21943
  hasReceipts(bankTransaction) ? /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(File_default, { size: 12 }) : null
21940
21944
  ] }),
@@ -24730,7 +24734,7 @@ var BankTransactions = (_a) => {
24730
24734
  monthlyView = false,
24731
24735
  applyGlobalDateRange = false,
24732
24736
  mode,
24733
- convertToInAppLink
24737
+ renderInAppLink
24734
24738
  } = _b, props = __objRest(_b, [
24735
24739
  "onError",
24736
24740
  "showTags",
@@ -24738,13 +24742,13 @@ var BankTransactions = (_a) => {
24738
24742
  "monthlyView",
24739
24743
  "applyGlobalDateRange",
24740
24744
  "mode",
24741
- "convertToInAppLink"
24745
+ "renderInAppLink"
24742
24746
  ]);
24743
24747
  usePreloadTagDimensions({ isEnabled: showTags });
24744
24748
  usePreloadCustomers({ isEnabled: showCustomerVendor });
24745
24749
  usePreloadVendors({ isEnabled: showCustomerVendor });
24746
24750
  const contextData = useAugmentedBankTransactions({ monthlyView, applyGlobalDateRange });
24747
- return /* @__PURE__ */ (0, import_jsx_runtime189.jsx)(ErrorBoundary, { onError, children: /* @__PURE__ */ (0, import_jsx_runtime189.jsx)(BankTransactionsContext.Provider, { value: contextData, children: /* @__PURE__ */ (0, import_jsx_runtime189.jsx)(LegacyModeProvider, { overrideMode: mode, children: /* @__PURE__ */ (0, import_jsx_runtime189.jsx)(BankTransactionTagVisibilityProvider, { showTags, children: /* @__PURE__ */ (0, import_jsx_runtime189.jsx)(BankTransactionCustomerVendorVisibilityProvider, { showCustomerVendor, children: /* @__PURE__ */ (0, import_jsx_runtime189.jsx)(InAppLinkProvider, { convertToInAppLink, children: /* @__PURE__ */ (0, import_jsx_runtime189.jsx)(BankTransactionsContent, __spreadValues({}, props)) }) }) }) }) }) });
24751
+ return /* @__PURE__ */ (0, import_jsx_runtime189.jsx)(ErrorBoundary, { onError, children: /* @__PURE__ */ (0, import_jsx_runtime189.jsx)(BankTransactionsContext.Provider, { value: contextData, children: /* @__PURE__ */ (0, import_jsx_runtime189.jsx)(LegacyModeProvider, { overrideMode: mode, children: /* @__PURE__ */ (0, import_jsx_runtime189.jsx)(BankTransactionTagVisibilityProvider, { showTags, children: /* @__PURE__ */ (0, import_jsx_runtime189.jsx)(BankTransactionCustomerVendorVisibilityProvider, { showCustomerVendor, children: /* @__PURE__ */ (0, import_jsx_runtime189.jsx)(InAppLinkProvider, { renderInAppLink, children: /* @__PURE__ */ (0, import_jsx_runtime189.jsx)(BankTransactionsContent, __spreadValues({}, props)) }) }) }) }) }) });
24748
24752
  };
24749
24753
  var BankTransactionsContent = ({
24750
24754
  asWidget = false,
@@ -28659,7 +28663,7 @@ var LedgerAccountEntryDetails = ({
28659
28663
  }) => {
28660
28664
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t;
28661
28665
  const { entryData, isLoadingEntry, closeSelectedEntry, errorEntry } = (0, import_react153.useContext)(LedgerAccountsContext);
28662
- const { convertToInAppLink } = useInAppLinkContext();
28666
+ const { renderInAppLink } = useInAppLinkContext();
28663
28667
  const { totalDebit, totalCredit } = (0, import_react153.useMemo)(() => {
28664
28668
  var _a2;
28665
28669
  let totalDebit2 = 0;
@@ -28680,12 +28684,12 @@ var LedgerAccountEntryDetails = ({
28680
28684
  var _a2, _b2;
28681
28685
  const badgeContent = (_a2 = ledgerEntrySource == null ? void 0 : ledgerEntrySource.entityName) != null ? _a2 : entryData == null ? void 0 : entryData.entry_type;
28682
28686
  const defaultBadge = /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(Badge, { children: badgeContent });
28683
- if (!convertToInAppLink || !ledgerEntrySource) {
28687
+ if (!renderInAppLink || !ledgerEntrySource) {
28684
28688
  return defaultBadge;
28685
28689
  }
28686
28690
  const linkingMetadata = convertLedgerEntrySourceToLinkingMetadata(ledgerEntrySource);
28687
- return (_b2 = convertToInAppLink(linkingMetadata)) != null ? _b2 : defaultBadge;
28688
- }, [convertToInAppLink, entryData == null ? void 0 : entryData.entry_type, ledgerEntrySource]);
28691
+ return (_b2 = renderInAppLink(linkingMetadata)) != null ? _b2 : defaultBadge;
28692
+ }, [renderInAppLink, entryData == null ? void 0 : entryData.entry_type, ledgerEntrySource]);
28689
28693
  return /* @__PURE__ */ (0, import_jsx_runtime232.jsxs)("div", { className: "Layer__ledger-account__entry-details", children: [
28690
28694
  /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(Header5, { className: "Layer__ledger-account__entry-details__header", children: /* @__PURE__ */ (0, import_jsx_runtime232.jsxs)(HeaderRow, { children: [
28691
28695
  /* @__PURE__ */ (0, import_jsx_runtime232.jsxs)(HeaderCol, { className: "Layer__hidden-lg Layer__hidden-xl", children: [
@@ -29123,6 +29127,17 @@ var ProfitAndLossDetailReport = ({
29123
29127
  const { businessId } = useLayerContext();
29124
29128
  const { tagFilter, dateRange } = (0, import_react157.useContext)(ProfitAndLoss2.Context);
29125
29129
  const [selectedSource, setSelectedSource] = (0, import_react157.useState)(null);
29130
+ const { renderInAppLink } = useInAppLinkContext();
29131
+ const badgeOrInAppLink = (0, import_react157.useMemo)(() => {
29132
+ var _a;
29133
+ if (!selectedSource) return void 0;
29134
+ const defaultBadge = /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(Badge, { children: selectedSource.entityName });
29135
+ if (!renderInAppLink) {
29136
+ return defaultBadge;
29137
+ }
29138
+ const linkingMetadata = convertLedgerEntrySourceToLinkingMetadata(selectedSource);
29139
+ return (_a = renderInAppLink(linkingMetadata)) != null ? _a : defaultBadge;
29140
+ }, [renderInAppLink, selectedSource]);
29126
29141
  const dynamicBreadcrumbs = (0, import_react157.useMemo)(() => {
29127
29142
  return breadcrumbPath || [{ name: lineItemName, display_name: lineItemName }];
29128
29143
  }, [breadcrumbPath, lineItemName]);
@@ -29241,7 +29256,7 @@ var ProfitAndLossDetailReport = ({
29241
29256
  {
29242
29257
  title: (stringOverrides == null ? void 0 : stringOverrides.sourceDetailsTitle) || "Transaction source",
29243
29258
  children: [
29244
- /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(DetailsListItem, { label: "Source", children: /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(Badge, { children: selectedSource.entityName }) }),
29259
+ /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(DetailsListItem, { label: "Source", children: badgeOrInAppLink }),
29245
29260
  /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(SourceDetailView, { source: selectedSource })
29246
29261
  ]
29247
29262
  }
@@ -29280,7 +29295,8 @@ var ProfitAndLossReport = ({
29280
29295
  defaultDatePickerMode,
29281
29296
  customDateRanges,
29282
29297
  csvMoneyFormat,
29283
- view
29298
+ view,
29299
+ renderInAppLink
29284
29300
  }) => {
29285
29301
  var _a;
29286
29302
  const { comparisonConfig } = (0, import_react158.useContext)(ProfitAndLoss2.ComparisonContext);
@@ -29308,7 +29324,7 @@ var ProfitAndLossReport = ({
29308
29324
  const handleCloseDetailReport = (0, import_react158.useCallback)(() => {
29309
29325
  setSelectedLineItem(null);
29310
29326
  }, []);
29311
- return /* @__PURE__ */ (0, import_jsx_runtime239.jsx)(
29327
+ return /* @__PURE__ */ (0, import_jsx_runtime239.jsx)(InAppLinkProvider, { renderInAppLink, children: /* @__PURE__ */ (0, import_jsx_runtime239.jsx)(
29312
29328
  View,
29313
29329
  {
29314
29330
  type: "panel",
@@ -29361,7 +29377,7 @@ var ProfitAndLossReport = ({
29361
29377
  }
29362
29378
  )
29363
29379
  }
29364
- );
29380
+ ) });
29365
29381
  };
29366
29382
 
29367
29383
  // src/components/ProfitAndLossSummaries/ProfitAndLossSummaries.tsx
@@ -33220,7 +33236,7 @@ var ChartOfAccounts2 = (props) => {
33220
33236
  const ledgerAccountsContextData = useLedgerAccounts(
33221
33237
  (_a = props.showReversalEntries) != null ? _a : false
33222
33238
  );
33223
- return /* @__PURE__ */ (0, import_jsx_runtime270.jsx)(ChartOfAccountsContext.Provider, { value: chartOfAccountsContextData, children: /* @__PURE__ */ (0, import_jsx_runtime270.jsx)(LedgerAccountsContext.Provider, { value: ledgerAccountsContextData, children: /* @__PURE__ */ (0, import_jsx_runtime270.jsx)(InAppLinkProvider, { convertToInAppLink: props.getInAppLink, children: /* @__PURE__ */ (0, import_jsx_runtime270.jsx)(ChartOfAccountsContent, __spreadValues({}, props)) }) }) });
33239
+ return /* @__PURE__ */ (0, import_jsx_runtime270.jsx)(ChartOfAccountsContext.Provider, { value: chartOfAccountsContextData, children: /* @__PURE__ */ (0, import_jsx_runtime270.jsx)(LedgerAccountsContext.Provider, { value: ledgerAccountsContextData, children: /* @__PURE__ */ (0, import_jsx_runtime270.jsx)(InAppLinkProvider, { renderInAppLink: props.renderInAppLink, children: /* @__PURE__ */ (0, import_jsx_runtime270.jsx)(ChartOfAccountsContent, __spreadValues({}, props)) }) }) });
33224
33240
  };
33225
33241
  var ChartOfAccountsContent = ({
33226
33242
  asWidget,
@@ -33686,7 +33702,7 @@ var JournalEntryDetails = () => {
33686
33702
  reverseEntry,
33687
33703
  refetch
33688
33704
  } = (0, import_react188.useContext)(JournalContext);
33689
- const { convertToInAppLink } = useInAppLinkContext();
33705
+ const { renderInAppLink } = useInAppLinkContext();
33690
33706
  const [reverseEntryProcessing, setReverseEntryProcessing] = (0, import_react188.useState)(false);
33691
33707
  const [reverseEntryError, setReverseEntryError] = (0, import_react188.useState)();
33692
33708
  const entry = (0, import_react188.useMemo)(() => {
@@ -33702,12 +33718,12 @@ var JournalEntryDetails = () => {
33702
33718
  var _a2, _b2;
33703
33719
  const badgeContent = (_a2 = ledgerEntrySource == null ? void 0 : ledgerEntrySource.entityName) != null ? _a2 : entry == null ? void 0 : entry.entry_type;
33704
33720
  const defaultBadge = /* @__PURE__ */ (0, import_jsx_runtime271.jsx)(Badge, { children: badgeContent });
33705
- if (!convertToInAppLink || !ledgerEntrySource) {
33721
+ if (!renderInAppLink || !ledgerEntrySource) {
33706
33722
  return defaultBadge;
33707
33723
  }
33708
33724
  const linkingMetadata = convertLedgerEntrySourceToLinkingMetadata(ledgerEntrySource);
33709
- return (_b2 = convertToInAppLink(linkingMetadata)) != null ? _b2 : defaultBadge;
33710
- }, [convertToInAppLink, entry == null ? void 0 : entry.entry_type, ledgerEntrySource]);
33725
+ return (_b2 = renderInAppLink(linkingMetadata)) != null ? _b2 : defaultBadge;
33726
+ }, [renderInAppLink, entry == null ? void 0 : entry.entry_type, ledgerEntrySource]);
33711
33727
  const sortedLineItems = (0, import_react188.useMemo)(
33712
33728
  () => {
33713
33729
  var _a2;
@@ -34626,7 +34642,7 @@ var JOURNAL_CONFIG = {
34626
34642
  var Journal = (props) => {
34627
34643
  const JournalContextData = useJournal();
34628
34644
  const AccountsContextData = useChartOfAccounts();
34629
- return /* @__PURE__ */ (0, import_jsx_runtime278.jsx)(ChartOfAccountsContext.Provider, { value: AccountsContextData, children: /* @__PURE__ */ (0, import_jsx_runtime278.jsx)(JournalContext.Provider, { value: JournalContextData, children: /* @__PURE__ */ (0, import_jsx_runtime278.jsx)(InAppLinkProvider, { convertToInAppLink: props.convertToInAppLink, children: /* @__PURE__ */ (0, import_jsx_runtime278.jsx)(JournalContent, __spreadValues({}, props)) }) }) });
34645
+ return /* @__PURE__ */ (0, import_jsx_runtime278.jsx)(ChartOfAccountsContext.Provider, { value: AccountsContextData, children: /* @__PURE__ */ (0, import_jsx_runtime278.jsx)(JournalContext.Provider, { value: JournalContextData, children: /* @__PURE__ */ (0, import_jsx_runtime278.jsx)(InAppLinkProvider, { renderInAppLink: props.renderInAppLink, children: /* @__PURE__ */ (0, import_jsx_runtime278.jsx)(JournalContent, __spreadValues({}, props)) }) }) });
34630
34646
  };
34631
34647
  var JournalContent = ({
34632
34648
  asWidget,
@@ -37819,7 +37835,7 @@ var BankTransactionsWithLinkedAccounts = ({
37819
37835
  showUploadOptions = false,
37820
37836
  mobileComponent,
37821
37837
  stringOverrides,
37822
- convertToInAppLink
37838
+ renderInAppLink
37823
37839
  }) => {
37824
37840
  return /* @__PURE__ */ (0, import_jsx_runtime319.jsxs)(
37825
37841
  View,
@@ -37850,7 +37866,7 @@ var BankTransactionsWithLinkedAccounts = ({
37850
37866
  mobileComponent,
37851
37867
  mode,
37852
37868
  stringOverrides: stringOverrides == null ? void 0 : stringOverrides.bankTransactions,
37853
- convertToInAppLink
37869
+ renderInAppLink
37854
37870
  }
37855
37871
  )
37856
37872
  ]
@@ -37867,7 +37883,7 @@ var GeneralLedgerView = ({
37867
37883
  showTitle = true,
37868
37884
  stringOverrides,
37869
37885
  chartOfAccountsOptions,
37870
- convertToInAppLink
37886
+ renderInAppLink
37871
37887
  }) => {
37872
37888
  const [activeTab, setActiveTab] = (0, import_react218.useState)("chartOfAccounts");
37873
37889
  return /* @__PURE__ */ (0, import_jsx_runtime320.jsx)(ProfitAndLoss2, { asContainer: false, children: /* @__PURE__ */ (0, import_jsx_runtime320.jsxs)(
@@ -37903,13 +37919,13 @@ var GeneralLedgerView = ({
37903
37919
  stringOverrides: stringOverrides == null ? void 0 : stringOverrides.chartOfAccounts,
37904
37920
  templateAccountsEditable: chartOfAccountsOptions == null ? void 0 : chartOfAccountsOptions.templateAccountsEditable,
37905
37921
  showReversalEntries: chartOfAccountsOptions == null ? void 0 : chartOfAccountsOptions.showReversalEntries,
37906
- getInAppLink: convertToInAppLink
37922
+ renderInAppLink
37907
37923
  }
37908
37924
  ) : /* @__PURE__ */ (0, import_jsx_runtime320.jsx)(
37909
37925
  Journal,
37910
37926
  {
37911
37927
  stringOverrides: stringOverrides == null ? void 0 : stringOverrides.journal,
37912
- convertToInAppLink
37928
+ renderInAppLink
37913
37929
  }
37914
37930
  )
37915
37931
  ]
@@ -40167,7 +40183,8 @@ var Reports = ({
40167
40183
  enabledReports = ["profitAndLoss", "balanceSheet", "statementOfCashFlow"],
40168
40184
  comparisonConfig,
40169
40185
  profitAndLossConfig,
40170
- statementOfCashFlowConfig
40186
+ statementOfCashFlowConfig,
40187
+ renderInAppLink
40171
40188
  }) => {
40172
40189
  var _a;
40173
40190
  const [activeTab, setActiveTab] = (0, import_react231.useState)(enabledReports[0]);
@@ -40203,7 +40220,8 @@ var Reports = ({
40203
40220
  stringOverrides,
40204
40221
  profitAndLossConfig,
40205
40222
  statementOfCashFlowConfig,
40206
- view
40223
+ view,
40224
+ renderInAppLink
40207
40225
  }
40208
40226
  ) }) }) })
40209
40227
  ]
@@ -40215,14 +40233,16 @@ var ReportsPanel = ({
40215
40233
  stringOverrides,
40216
40234
  profitAndLossConfig,
40217
40235
  statementOfCashFlowConfig,
40218
- view
40236
+ view,
40237
+ renderInAppLink
40219
40238
  }) => {
40220
40239
  return /* @__PURE__ */ (0, import_jsx_runtime341.jsxs)(import_jsx_runtime341.Fragment, { children: [
40221
40240
  openReport === "profitAndLoss" && /* @__PURE__ */ (0, import_jsx_runtime341.jsx)(
40222
40241
  ProfitAndLossReport,
40223
40242
  __spreadValues({
40224
40243
  stringOverrides,
40225
- view
40244
+ view,
40245
+ renderInAppLink
40226
40246
  }, profitAndLossConfig)
40227
40247
  ),
40228
40248
  openReport === "balanceSheet" && /* @__PURE__ */ (0, import_jsx_runtime341.jsx)(BalanceSheet, { stringOverrides: stringOverrides == null ? void 0 : stringOverrides.balanceSheet }),