@mx-cartographer/experiences 7.8.2-alpha.bb6 → 7.8.2-alpha.mm0

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.
@@ -1,62 +1,62 @@
1
- import { T as ba } from "../TransactionApi-CjBoLleL.mjs";
2
- import { u as R, C as Le, D as Me, M as Re, c as He, T as Pe, a as Be } from "../TransactionDetails-BDhz3DLT.mjs";
3
- import { B as Sa, d as xa, b as wa } from "../TransactionDetails-BDhz3DLT.mjs";
4
- import { T as E } from "../User-B0LnmiKO.mjs";
5
- import { O as Da } from "../User-B0LnmiKO.mjs";
6
- import { S as Z, D as $e } from "../TransactionStore-DcBF3oIZ.mjs";
7
- import { T as Na } from "../TransactionStore-DcBF3oIZ.mjs";
8
- import { e as Ve } from "../exportTransactionsToCSV-DtQ7ovAR.mjs";
9
- import { E as Oa } from "../ExportCsvAction-CDuzTva1.mjs";
10
- import { jsxs as _, jsx as e } from "react/jsx-runtime";
1
+ import { T as wa } from "../TransactionApi-CjBoLleL.mjs";
2
+ import { u as P, C as Be, D as Pe, M as $e, c as Ve, T as We, a as Ge } from "../TransactionDetails-B9NQYa6j.mjs";
3
+ import { B as va, d as Da, b as Na } from "../TransactionDetails-B9NQYa6j.mjs";
4
+ import { T as k } from "../User-B0LnmiKO.mjs";
5
+ import { O as Oa } from "../User-B0LnmiKO.mjs";
6
+ import { S as ae, D as Fe } from "../TransactionStore-BSp5bOKg.mjs";
7
+ import { T as La } from "../TransactionStore-BSp5bOKg.mjs";
8
+ import { e as Ue } from "../exportTransactionsToCSV-DtQ7ovAR.mjs";
9
+ import { E as Ra } from "../ExportCsvAction-CDuzTva1.mjs";
10
+ import { jsxs as p, jsx as e } from "react/jsx-runtime";
11
11
  import m from "react";
12
12
  import { observer as w } from "mobx-react-lite";
13
- import We from "@mui/material/Paper";
14
- import { DataGridPro as Ue } from "@mui/x-data-grid-pro";
15
- import S from "@mui/material/Box";
16
- import { useTheme as Fe } from "@mui/material/styles";
17
- import { Text as y, Icon as M, MerchantLogo as Ge, TextField as ee, P as Ke } from "@mxenabled/mxui";
18
- import { h as H, u as I, b as K, d as ne, m as ze, a as qe, g as je, o as Xe } from "../hooks-ZMp65DFz.mjs";
19
- import { fromUnixTime as Ye } from "date-fns/fromUnixTime";
20
- import { f as Je, D as Qe, a as oe } from "../Dialog-B4PI-_bL.mjs";
21
- import x from "@mui/material/Stack";
22
- import { f as re } from "../NumberFormatting-DjTD0t3W.mjs";
23
- import { L as z } from "../Loader-DUaFpDGv.mjs";
24
- import { endOfMonth as Ze } from "date-fns/endOfMonth";
25
- import { getUnixTime as et } from "date-fns/getUnixTime";
26
- import { startOfMonth as tt } from "date-fns/startOfMonth";
27
- import { startOfToday as F } from "date-fns/startOfToday";
28
- import at from "@mui/material/styles/useTheme";
29
- import { b as nt } from "../GlobalAccountFilter-DQCPNc95.mjs";
30
- import ot from "@mui/material/Divider";
31
- import rt from "@mui/material/MenuItem";
32
- import it from "@mui/material/RadioGroup";
33
- import { ExpandMore as st } from "@mxenabled/mx-icons";
34
- import { C as ct } from "../CurrencyInput-itK0R3wV.mjs";
35
- import { a as lt, u as dt } from "../CategorySelectorDrawer-cQKX5dZb.mjs";
36
- import { b as G } from "../Localization-2MODESHW.mjs";
37
- import { u as ut } from "../useAriaLive-B3_pRUio.mjs";
38
- import { S as mt } from "../SkeletonLoader-BaNboJjD.mjs";
39
- import { A, W as _t } from "../WidgetContainer-BbPS3Yxz.mjs";
40
- import { u as pt } from "../useScreenSize-B6JyS_Lj.mjs";
41
- import { u as gt } from "../useWidgetLoadTimer-hIOioiKx.mjs";
42
- import { S as ht } from "../SearchBox-B2_zLv8-.mjs";
43
- import { D as te } from "../Drawer-DV4NTsFg.mjs";
44
- const ft = (t) => /* @__PURE__ */ _(y, { tabIndex: t.tabIndex, variant: "Small", children: [
13
+ import Ke from "@mui/material/Paper";
14
+ import { DataGridPro as ze } from "@mui/x-data-grid-pro";
15
+ import x from "@mui/material/Box";
16
+ import { useTheme as qe } from "@mui/material/styles";
17
+ import { Text as y, Icon as B, MerchantLogo as je, TextField as ne, P as Xe } from "@mxenabled/mxui";
18
+ import { h as $, u as I, b as j, d as se, m as Ye, a as Je, g as Qe, o as Ze } from "../hooks-ZMp65DFz.mjs";
19
+ import { fromUnixTime as et } from "date-fns/fromUnixTime";
20
+ import { f as tt, D as at, a as ie } from "../Dialog-B4PI-_bL.mjs";
21
+ import S from "@mui/material/Stack";
22
+ import { f as ce } from "../NumberFormatting-DjTD0t3W.mjs";
23
+ import { L as X } from "../Loader-DUaFpDGv.mjs";
24
+ import { endOfMonth as nt } from "date-fns/endOfMonth";
25
+ import { getUnixTime as ot } from "date-fns/getUnixTime";
26
+ import { startOfMonth as rt } from "date-fns/startOfMonth";
27
+ import { startOfToday as z } from "date-fns/startOfToday";
28
+ import st from "@mui/material/styles/useTheme";
29
+ import { b as it } from "../GlobalAccountFilter-DQCPNc95.mjs";
30
+ import ct from "@mui/material/Divider";
31
+ import lt from "@mui/material/MenuItem";
32
+ import dt from "@mui/material/RadioGroup";
33
+ import { ExpandMore as ut } from "@mxenabled/mx-icons";
34
+ import { C as mt } from "../CurrencyInput-itK0R3wV.mjs";
35
+ import { a as _t, u as pt } from "../CategorySelectorDrawer-cQKX5dZb.mjs";
36
+ import { b as q } from "../Localization-2MODESHW.mjs";
37
+ import { u as gt } from "../useAriaLive-B3_pRUio.mjs";
38
+ import { S as ht } from "../SkeletonLoader-BaNboJjD.mjs";
39
+ import { A, W as ft } from "../WidgetContainer-CYdQ0BSm.mjs";
40
+ import { u as Ct } from "../useScreenSize-B6JyS_Lj.mjs";
41
+ import { u as yt } from "../useWidgetLoadTimer-hIOioiKx.mjs";
42
+ import { S as Tt } from "../SearchBox-B2_zLv8-.mjs";
43
+ import { D as oe } from "../Drawer-DV4NTsFg.mjs";
44
+ const bt = (t) => /* @__PURE__ */ p(y, { tabIndex: t.tabIndex, variant: "Small", children: [
45
45
  `${t.row.account}`,
46
46
  t.row.number && ` | ${t.row.number}`
47
- ] }), Ct = (t) => {
48
- const { associatedBeats: r } = H(), { showInsights: o } = R(), { amount: a, transaction_type: l } = t.row, s = r.find((h) => h.associated_transaction_guid === t.row.guid), c = l === E.CREDIT;
49
- return /* @__PURE__ */ _(x, { alignItems: "flex-end", tabIndex: t.tabIndex, children: [
50
- /* @__PURE__ */ _(y, { color: c ? "success.main" : "text.primary", variant: "Small", children: [
51
- c ? "+" : "",
52
- re(a, "0,0.00")
47
+ ] }), At = (t) => {
48
+ const { associatedBeats: s } = $(), { showInsights: o } = P(), { amount: a, transaction_type: i } = t.row, c = s.find((g) => g.associated_transaction_guid === t.row.guid), l = i === k.CREDIT;
49
+ return /* @__PURE__ */ p(S, { alignItems: "flex-end", tabIndex: t.tabIndex, children: [
50
+ /* @__PURE__ */ p(y, { color: l ? "success.main" : "text.primary", variant: "Small", children: [
51
+ l ? "+" : "",
52
+ ce(a, "0,0.00")
53
53
  ] }),
54
- s && o && /* @__PURE__ */ e(y, { bold: !0, color: "primary.light", variant: "XSmall", children: s.short_title })
54
+ c && o && /* @__PURE__ */ e(y, { bold: !0, color: "primary.light", variant: "XSmall", children: c.short_title })
55
55
  ] });
56
- }, yt = (t) => {
57
- const { transactions: r } = I(), [o, a] = m.useState(!1);
58
- return /* @__PURE__ */ _(
59
- x,
56
+ }, xt = (t) => {
57
+ const { transactions: s } = I(), [o, a] = m.useState(!1);
58
+ return /* @__PURE__ */ p(
59
+ S,
60
60
  {
61
61
  alignItems: "center",
62
62
  direction: "row",
@@ -66,22 +66,22 @@ const ft = (t) => /* @__PURE__ */ _(y, { tabIndex: t.tabIndex, variant: "Small",
66
66
  onMouseLeave: () => a(!1),
67
67
  width: "100%",
68
68
  children: [
69
- t.row.has_been_split && /* @__PURE__ */ e(M, { name: "call_split", size: 16 }),
70
- /* @__PURE__ */ e(y, { tabIndex: t.tabIndex, variant: "Small", children: t.row.has_been_split ? r.split_transaction_category_label : t.row.category }),
71
- !t.row.has_been_split && o && /* @__PURE__ */ e(M, { name: "edit", sx: { color: "action.active" } })
69
+ t.row.has_been_split && /* @__PURE__ */ e(B, { name: "call_split", size: 16 }),
70
+ /* @__PURE__ */ e(y, { tabIndex: t.tabIndex, variant: "Small", children: t.row.has_been_split ? s.split_transaction_category_label : t.row.category }),
71
+ !t.row.has_been_split && o && /* @__PURE__ */ e(B, { name: "edit", sx: { color: "action.active" } })
72
72
  ]
73
73
  }
74
74
  );
75
- }, Tt = w(yt), bt = (t) => /* @__PURE__ */ e(y, { tabIndex: t.tabIndex, variant: "Small", children: Je(Ye(t.row.date), Qe.MONTH_DAY) }), At = (t) => {
76
- const r = Fe(), { transactions: o } = I(), { is_flagged: a, is_hidden: l, has_been_viewed: s, parent_guid: c } = t.row, f = !s && !!!c;
77
- return /* @__PURE__ */ _(
78
- S,
75
+ }, St = w(xt), wt = (t) => /* @__PURE__ */ e(y, { tabIndex: t.tabIndex, variant: "Small", children: tt(et(t.row.date), at.MONTH_DAY) }), It = (t) => {
76
+ const s = qe(), { transactions: o } = I(), { is_flagged: a, is_hidden: i, has_been_viewed: c, parent_guid: l } = t.row, f = !c && !!!l;
77
+ return /* @__PURE__ */ p(
78
+ x,
79
79
  {
80
- "aria-label": l ? o.is_hidden : o.is_flagged,
80
+ "aria-label": i ? o.is_hidden : o.is_flagged,
81
81
  tabIndex: t.tabIndex,
82
82
  children: [
83
- a && /* @__PURE__ */ e(M, { fill: !0, name: "flag", size: 16, sx: { color: "warning.dark" } }),
84
- !a && l && /* @__PURE__ */ e(M, { name: "visibility_off", size: 16 }),
83
+ a && /* @__PURE__ */ e(B, { fill: !0, name: "flag", size: 16, sx: { color: "warning.dark" } }),
84
+ !a && i && /* @__PURE__ */ e(B, { name: "visibility_off", size: 16 }),
85
85
  f && /* @__PURE__ */ e(
86
86
  "svg",
87
87
  {
@@ -89,7 +89,7 @@ const ft = (t) => /* @__PURE__ */ _(y, { tabIndex: t.tabIndex, variant: "Small",
89
89
  style: {
90
90
  display: "inline-block",
91
91
  height: 16,
92
- fill: r.palette.primary.light,
92
+ fill: s.palette.primary.light,
93
93
  verticalAlign: "middle",
94
94
  width: 16
95
95
  },
@@ -100,50 +100,50 @@ const ft = (t) => /* @__PURE__ */ _(y, { tabIndex: t.tabIndex, variant: "Small",
100
100
  ]
101
101
  }
102
102
  );
103
- }, St = w(At), N = (t) => /* @__PURE__ */ e(y, { fontWeight: 600, variant: "Small", children: t.colDef.headerName }), xt = (t) => /* @__PURE__ */ _(x, { alignItems: "center", direction: "row", gap: 8, children: [
103
+ }, vt = w(It), O = (t) => /* @__PURE__ */ e(y, { fontWeight: 600, variant: "Small", children: t.colDef.headerName }), Dt = (t) => /* @__PURE__ */ p(S, { alignItems: "center", direction: "row", gap: 8, children: [
104
104
  /* @__PURE__ */ e(
105
- Ge,
105
+ je,
106
106
  {
107
107
  categoryGuid: t.row.top_level_category_guid || "",
108
108
  merchantGuid: t.row.merchant_guid || ""
109
109
  }
110
110
  ),
111
111
  /* @__PURE__ */ e(y, { tabIndex: t.tabIndex, variant: "Small", children: t.row.payee })
112
- ] }), wt = ({
112
+ ] }), Nt = ({
113
113
  height: t = "100dvh",
114
- onCategoryClick: r,
114
+ onCategoryClick: s,
115
115
  onRowClick: o
116
116
  }) => {
117
- const { transactions: a } = I(), { isCopyLoaded: l } = K(), { isLoading: s, sortedTransactions: c } = H(), { clearExpandedSplits: h, toggleSplit: f } = R();
118
- m.useEffect(() => () => h(), []);
117
+ const { transactions: a } = I(), { isCopyLoaded: i } = j(), { isLoading: c, sortedTransactions: l } = $(), { clearExpandedSplits: g, toggleSplit: f } = P();
118
+ m.useEffect(() => () => g(), []);
119
119
  const C = m.useMemo(
120
- () => c.map((i) => ({
121
- id: i.guid,
120
+ () => l.map((r) => ({
121
+ id: r.guid,
122
122
  isHovering: !1,
123
- ...i
123
+ ...r
124
124
  })),
125
- [c]
126
- ), d = ({ row: { id: i, guid: g, has_been_split: v }, field: n }) => v ? f(i) : n === "category" ? r?.(g) : o?.(g), D = (i, g) => {
127
- g.key !== "Enter" && g.key !== " " || d(i);
125
+ [l]
126
+ ), u = ({ row: { id: r, guid: h, has_been_split: N }, field: n }) => N ? f(r) : n === "category" ? s?.(h) : o?.(h), v = (r, h) => {
127
+ h.key !== "Enter" && h.key !== " " || u(r);
128
128
  };
129
- if (!l)
130
- return /* @__PURE__ */ e(z, {});
131
- const p = [
129
+ if (!i)
130
+ return /* @__PURE__ */ e(X, {});
131
+ const _ = [
132
132
  {
133
133
  field: "flag",
134
134
  headerName: "",
135
135
  minWidth: 32,
136
136
  width: 32,
137
137
  sortable: !1,
138
- renderCell: (i) => /* @__PURE__ */ e(St, { ...i }),
138
+ renderCell: (r) => /* @__PURE__ */ e(vt, { ...r }),
139
139
  renderHeader: () => /* @__PURE__ */ e("span", { "aria-label": a.transaction_status, role: "presentation" })
140
140
  },
141
141
  {
142
142
  field: "date",
143
143
  headerName: a.date_title,
144
144
  width: 103,
145
- renderHeader: N,
146
- renderCell: (i) => i.row.parent_guid ? null : /* @__PURE__ */ e(bt, { ...i }),
145
+ renderHeader: O,
146
+ renderCell: (r) => r.row.parent_guid ? null : /* @__PURE__ */ e(wt, { ...r }),
147
147
  sortingOrder: ["desc", "asc"]
148
148
  },
149
149
  {
@@ -151,49 +151,49 @@ const ft = (t) => /* @__PURE__ */ _(y, { tabIndex: t.tabIndex, variant: "Small",
151
151
  field: "payee",
152
152
  headerName: a.payee_title,
153
153
  flex: 0.33,
154
- renderHeader: N,
155
- renderCell: xt,
154
+ renderHeader: O,
155
+ renderCell: Dt,
156
156
  sortingOrder: ["asc", "desc"]
157
157
  },
158
158
  {
159
159
  field: "category",
160
160
  headerName: a.category_title,
161
161
  flex: 0.25,
162
- renderHeader: N,
163
- renderCell: (i) => /* @__PURE__ */ e(Tt, { ...i }),
162
+ renderHeader: O,
163
+ renderCell: (r) => /* @__PURE__ */ e(St, { ...r }),
164
164
  sortingOrder: ["asc", "desc"]
165
165
  },
166
166
  {
167
167
  field: "account",
168
168
  headerName: a.account_title,
169
169
  flex: 0.33,
170
- renderHeader: N,
171
- renderCell: (i) => i.row.parent_guid ? null : /* @__PURE__ */ e(ft, { ...i }),
170
+ renderHeader: O,
171
+ renderCell: (r) => r.row.parent_guid ? null : /* @__PURE__ */ e(bt, { ...r }),
172
172
  sortingOrder: ["asc", "desc"]
173
173
  },
174
174
  {
175
175
  field: "amount",
176
176
  headerName: a.amount_title,
177
177
  flex: 0.25,
178
- renderHeader: N,
179
- renderCell: Ct,
178
+ renderHeader: O,
179
+ renderCell: At,
180
180
  align: "right",
181
181
  headerAlign: "right",
182
182
  sortingOrder: ["asc", "desc"]
183
183
  }
184
184
  ];
185
- return /* @__PURE__ */ e(We, { sx: { height: t, px: 24, width: "100%", boxShadow: "none" }, children: /* @__PURE__ */ e(
186
- Ue,
185
+ return /* @__PURE__ */ e(Ke, { sx: { height: t, px: 24, width: "100%", boxShadow: "none" }, children: /* @__PURE__ */ e(
186
+ ze,
187
187
  {
188
- columns: p,
188
+ columns: _,
189
189
  disableColumnFilter: !0,
190
190
  disableColumnMenu: !0,
191
- getCellClassName: (i) => i.row.parent_guid ? "split-row" : "",
191
+ getCellClassName: (r) => r.row.parent_guid ? "split-row" : "",
192
192
  hideFooter: !0,
193
193
  initialState: { sorting: { sortModel: [{ field: "date", sort: "desc" }] } },
194
- loading: s,
195
- onCellClick: d,
196
- onCellKeyDown: D,
194
+ loading: c,
195
+ onCellClick: u,
196
+ onCellKeyDown: v,
197
197
  rows: C,
198
198
  slotProps: { baseIconButton: { color: "secondary", sx: { ml: 8 } } },
199
199
  sx: {
@@ -203,89 +203,89 @@ const ft = (t) => /* @__PURE__ */ _(y, { tabIndex: t.tabIndex, variant: "Small",
203
203
  }
204
204
  }
205
205
  ) });
206
- }, It = w(wt), Dt = ({ copy: t, isOpen: r, onClose: o, onPrimaryAction: a }) => {
207
- const { common: l, transactions: s } = I(), { isCopyLoaded: c } = K();
208
- return c ? /* @__PURE__ */ _(
209
- oe,
206
+ }, Et = w(Nt), Ot = ({ copy: t, isOpen: s, onClose: o, onPrimaryAction: a }) => {
207
+ const { common: i, transactions: c } = I(), { isCopyLoaded: l } = j();
208
+ return l ? /* @__PURE__ */ p(
209
+ ie,
210
210
  {
211
211
  copy: {
212
212
  title: t.title
213
213
  },
214
- isOpen: r,
214
+ isOpen: s,
215
215
  onClose: o,
216
216
  onPrimaryAction: a,
217
- primaryText: s.add_manual_account,
218
- secondaryText: l.cancel_button,
217
+ primaryText: c.add_manual_account,
218
+ secondaryText: i.cancel_button,
219
219
  children: [
220
- /* @__PURE__ */ e(y, { component: "p", sx: { marginBottom: "20px" }, truncate: !1, children: s.add_account_modal_message }),
221
- /* @__PURE__ */ e(y, { component: "p", truncate: !1, children: s.add_account_modal_cta })
220
+ /* @__PURE__ */ e(y, { component: "p", sx: { marginBottom: "20px" }, truncate: !1, children: c.add_account_modal_message }),
221
+ /* @__PURE__ */ e(y, { component: "p", truncate: !1, children: c.add_account_modal_cta })
222
222
  ]
223
223
  }
224
- ) : /* @__PURE__ */ e(z, {});
225
- }, vt = w(Dt), Nt = () => {
226
- const { visibleAccounts: t } = ne(), { common: r, transactions: o } = I(), { manualTransaction: a, setIsAmountValid: l, updateManualTransaction: s } = R(), [c, h] = m.useState(""), [f, C] = m.useState(""), d = m.useMemo(
224
+ ) : /* @__PURE__ */ e(X, {});
225
+ }, kt = w(Ot), Lt = () => {
226
+ const { visibleAccounts: t } = se(), { common: s, transactions: o } = I(), { manualTransaction: a, setIsAmountValid: i, updateManualTransaction: c } = P(), [l, g] = m.useState(""), [f, C] = m.useState(""), u = m.useMemo(
227
227
  () => t.filter((n) => n.is_manual),
228
228
  [t]
229
229
  ).map((n) => ({
230
- label: `${n.name} | ${re(n.balance, "0,0.00")}`,
230
+ label: `${n.name} | ${ce(n.balance, "0,0.00")}`,
231
231
  value: n.guid
232
- })), D = {
233
- error_amount_is_invalid: r.currency_input.error_amount_is_invalid,
234
- error_amount_must_be_equal_to: r.currency_input.error_amount_must_be_equal_to,
235
- error_amount_must_be_less_than_or_equal_to: r.currency_input.error_amount_must_be_less_than_or_equal_to,
236
- enter_amount: r.currency_input.enter_amount
237
- }, p = (n) => {
238
- h(n), s({ ...a, amount: Number(n) });
239
- }, i = (n, P) => {
240
- s({ ...a, transaction_type: Number(P) });
241
- }, g = (n) => {
242
- C(n), s({ ...a, payee: n, description: n });
243
- }, v = (n) => {
244
- s({ ...a, account_guid: n });
232
+ })), v = {
233
+ error_amount_is_invalid: s.currency_input.error_amount_is_invalid,
234
+ error_amount_must_be_equal_to: s.currency_input.error_amount_must_be_equal_to,
235
+ error_amount_must_be_less_than_or_equal_to: s.currency_input.error_amount_must_be_less_than_or_equal_to,
236
+ enter_amount: s.currency_input.enter_amount
237
+ }, _ = (n) => {
238
+ g(n), c({ ...a, amount: Number(n) });
239
+ }, r = (n, L) => {
240
+ c({ ...a, transaction_type: Number(L) });
241
+ }, h = (n) => {
242
+ C(n), c({ ...a, payee: n, description: n });
243
+ }, N = (n) => {
244
+ c({ ...a, account_guid: n });
245
245
  };
246
- return /* @__PURE__ */ _(S, { className: "mx-txn-manual-transaction-details", children: [
247
- /* @__PURE__ */ _(x, { gap: 40, mx: 24, my: 32, children: [
248
- /* @__PURE__ */ _(
249
- x,
246
+ return /* @__PURE__ */ p(x, { className: "mx-txn-manual-transaction-details", children: [
247
+ /* @__PURE__ */ p(S, { gap: 40, mx: 24, my: 32, children: [
248
+ /* @__PURE__ */ p(
249
+ S,
250
250
  {
251
251
  direction: "row",
252
252
  sx: { flexDirection: { xs: "column", sm: "row" }, gap: { xs: 40, sm: 8 } },
253
253
  children: [
254
254
  /* @__PURE__ */ e(
255
- ct,
255
+ mt,
256
256
  {
257
257
  allowDecimals: !0,
258
- amount: c,
258
+ amount: l,
259
259
  ariaLabel: o.amount_title,
260
- copy: D,
260
+ copy: v,
261
261
  inputProps: {
262
262
  noValidate: !0
263
263
  },
264
264
  label: o.amount_title,
265
- setAmount: p,
266
- setHasValidInput: l,
265
+ setAmount: _,
266
+ setHasValidInput: i,
267
267
  sx: { bgcolor: "background.paper" },
268
268
  type: "number"
269
269
  }
270
270
  ),
271
- /* @__PURE__ */ e(it, { name: "TransactionType", onChange: i, row: !0, children: /* @__PURE__ */ _(x, { alignItems: "center", direction: "row", children: [
271
+ /* @__PURE__ */ e(dt, { name: "TransactionType", onChange: r, row: !0, children: /* @__PURE__ */ p(S, { alignItems: "center", direction: "row", children: [
272
272
  /* @__PURE__ */ e(
273
- Z,
273
+ ae,
274
274
  {
275
- checked: a.transaction_type === E.CREDIT,
275
+ checked: a.transaction_type === k.CREDIT,
276
276
  label: o.manual_transaction_credit_button_label,
277
277
  sx: { ml: { xs: 0, sm: 8 } },
278
278
  tooltip: o.manual_transaction_credit_button_tooltip,
279
- value: E.CREDIT
279
+ value: k.CREDIT
280
280
  }
281
281
  ),
282
282
  /* @__PURE__ */ e(
283
- Z,
283
+ ae,
284
284
  {
285
- checked: a.transaction_type === E.DEBIT,
285
+ checked: a.transaction_type === k.DEBIT,
286
286
  label: o.manual_transaction_debit_button_label,
287
287
  tooltip: o.manual_transaction_debit_button_tooltip,
288
- value: E.DEBIT
288
+ value: k.DEBIT
289
289
  }
290
290
  )
291
291
  ] }) })
@@ -293,231 +293,242 @@ const ft = (t) => /* @__PURE__ */ _(y, { tabIndex: t.tabIndex, variant: "Small",
293
293
  }
294
294
  ),
295
295
  /* @__PURE__ */ e(
296
- ee,
296
+ ne,
297
297
  {
298
298
  label: o.payee_title,
299
299
  name: "payee",
300
- onChange: (n) => g(n.target.value),
300
+ onChange: (n) => h(n.target.value),
301
301
  sx: { bgcolor: "background.paper" },
302
302
  value: f
303
303
  }
304
304
  ),
305
305
  /* @__PURE__ */ e(
306
- ee,
306
+ ne,
307
307
  {
308
308
  InputLabelProps: { shrink: !0 },
309
- SelectProps: { defaultValue: -1, IconComponent: st },
309
+ SelectProps: { defaultValue: -1, IconComponent: ut },
310
310
  label: o.manual_transaction_select_an_account,
311
- onChange: (n) => v(n.target.value),
311
+ onChange: (n) => N(n.target.value),
312
312
  placeholder: o.manual_transaction_select,
313
313
  select: !0,
314
314
  sx: { bgcolor: "background.paper" },
315
- children: d.map((n) => /* @__PURE__ */ e(rt, { value: n.value, children: n.label }, n.value))
315
+ children: u.map((n) => /* @__PURE__ */ e(lt, { value: n.value, children: n.label }, n.value))
316
316
  }
317
317
  )
318
318
  ] }),
319
- /* @__PURE__ */ e(ot, { light: !0 }),
320
- /* @__PURE__ */ _(S, { bgcolor: "background.paper", children: [
321
- /* @__PURE__ */ e(Le, { transaction: a }),
322
- /* @__PURE__ */ e(Me, { transaction: a }),
323
- /* @__PURE__ */ e(Re, { transaction: a }),
324
- /* @__PURE__ */ e(He, { transaction: a })
319
+ /* @__PURE__ */ e(ct, { light: !0 }),
320
+ /* @__PURE__ */ p(x, { bgcolor: "background.paper", children: [
321
+ /* @__PURE__ */ e(Be, { transaction: a }),
322
+ /* @__PURE__ */ e(Pe, { transaction: a }),
323
+ /* @__PURE__ */ e($e, { transaction: a }),
324
+ /* @__PURE__ */ e(Ve, { transaction: a })
325
325
  ] })
326
326
  ] });
327
- }, Et = w(Nt), Ot = ({ onClose: t, transaction: r }) => {
328
- const { addOrUpdateTransactionRule: o, updateTransaction: a } = H(), { transactions: l } = I(), { categories: s } = ze(), [c, h] = m.useState(""), f = m.useMemo(
329
- () => s.find((d) => d.guid === c),
330
- [c]
331
- ), C = async (d) => {
332
- await a({ ...r, category_guid: c }), d && await o(c, r), h(""), t();
327
+ }, Mt = w(Lt), Rt = ({ onClose: t, transaction: s }) => {
328
+ const { addOrUpdateTransactionRule: o, updateTransaction: a } = $(), { transactions: i } = I(), { categories: c } = Ye(), [l, g] = m.useState(""), f = m.useMemo(
329
+ () => c.find((u) => u.guid === l),
330
+ [l]
331
+ ), C = async (u) => {
332
+ await a({ ...s, category_guid: l }), u && await o(l, s), g(""), t();
333
333
  };
334
- return /* @__PURE__ */ _(S, { className: "mx-txn-edit-category-action", children: [
334
+ return /* @__PURE__ */ p(x, { className: "mx-txn-edit-category-action", children: [
335
335
  /* @__PURE__ */ e(
336
- lt,
336
+ _t,
337
337
  {
338
- initialSelected: r.category_guid,
338
+ initialSelected: s.category_guid,
339
339
  onClose: t,
340
- onSelect: (d) => h(d),
341
- showDrawer: !!r,
342
- title: l.actions_select_a_category
340
+ onSelect: (u) => g(u),
341
+ showDrawer: !!s,
342
+ title: i.actions_select_a_category
343
343
  }
344
344
  ),
345
345
  /* @__PURE__ */ e(
346
- oe,
346
+ ie,
347
347
  {
348
348
  copy: {
349
- title: G(
350
- l.actions_apply_to_all_transaction_types,
351
- r.description
349
+ title: q(
350
+ i.actions_apply_to_all_transaction_types,
351
+ s.description
352
352
  )
353
353
  },
354
- isOpen: !!c,
354
+ isOpen: !!l,
355
355
  onClose: () => C(!1),
356
356
  onPrimaryAction: () => C(!0),
357
357
  onSecondaryAction: () => C(!1),
358
- primaryText: l.actions_apply_to_all,
359
- secondaryText: l.actions_this_time_only,
360
- children: /* @__PURE__ */ e(Ke, { variant: "Paragraph", children: G(
361
- l.actions_all_past_and_future,
362
- r.description,
358
+ primaryText: i.actions_apply_to_all,
359
+ secondaryText: i.actions_this_time_only,
360
+ children: /* @__PURE__ */ e(Xe, { variant: "Paragraph", children: q(
361
+ i.actions_all_past_and_future,
362
+ s.description,
363
363
  f?.name
364
364
  ) })
365
365
  }
366
366
  )
367
367
  ] });
368
- }, kt = w(Ot), ae = 120, Lt = ({
368
+ }, Ht = w(Rt), re = 120, Bt = ({
369
369
  onBackClick: t,
370
- height: r = "100dvh",
370
+ height: s = "100dvh",
371
371
  showInsights: o = !1,
372
372
  sx: a = {}
373
373
  }) => {
374
- const { manualAccounts: l, refreshAccounts: s } = ne(), { is_mobile_webview: c, clientConfig: h, config: f } = qe(), { setSearchValue: C } = dt(), { onEvent: d } = je(), { common: D, transactions: p } = I(), {
375
- displayedDateRange: i,
376
- isInitialized: g,
377
- selectedAccountGuids: v,
378
- setDisplayedDate: n
379
- } = K(), { isDesktop: P, isTablet: ie } = pt(), O = at(), {
380
- addTransaction: se,
381
- filter: ce,
382
- isTransactionDataLoaded: B,
383
- loadTransactionData: le,
384
- setFilter: q,
385
- sortedTransactions: j,
386
- sortedTransactionsWithSplits: de,
387
- tags: ue,
388
- detailedTransactions: me,
389
- updateTransaction: _e
390
- } = H(), {
391
- clearExpandedSplits: pe,
392
- isAmountValid: ge,
393
- manualTransaction: k,
394
- searchValue: X,
395
- setSearchValue: he,
396
- setShowInsights: fe,
397
- updateManualTransaction: Ce
398
- } = R(), { userProfile: ye } = Xe(), [$, T] = m.useState(""), [Y, L] = m.useState(""), [Te, V] = m.useState(!1), [be, J] = m.useState(!1), { announce: Ae, ariaLive: Se } = ut(), W = h?.transactions?.selected_account_guid;
399
- fe(o), gt({
374
+ const { visibleAccounts: i, refreshAccounts: c } = se(), { is_mobile_webview: l, clientConfig: g, config: f } = Je(), { setSearchValue: C } = pt(), { onEvent: u } = Qe(), { common: v, transactions: _ } = I(), {
375
+ displayedDateRange: r,
376
+ isCopyLoaded: h,
377
+ isInitialized: N,
378
+ selectedAccountGuids: n,
379
+ setDisplayedDate: L
380
+ } = j(), { isDesktop: le, isTablet: de } = Ct(), M = st(), {
381
+ addTransaction: ue,
382
+ filter: Y,
383
+ isTransactionDataLoaded: V,
384
+ loadAssociatedBeats: me,
385
+ loadTransactionData: _e,
386
+ setFilter: W,
387
+ sortedTransactionsWithSplits: G,
388
+ tags: pe,
389
+ detailedTransactions: ge,
390
+ updateTransaction: he
391
+ } = $(), {
392
+ clearExpandedSplits: fe,
393
+ isAmountValid: Ce,
394
+ manualTransaction: R,
395
+ searchValue: ye,
396
+ setSearchValue: Te,
397
+ setShowInsights: be,
398
+ updateManualTransaction: Ae
399
+ } = P(), { userProfile: xe } = Ze(), [F, T] = m.useState(""), [J, H] = m.useState(""), [Se, U] = m.useState(!1), [we, Q] = m.useState(!1), { announce: Ie, ariaLive: ve } = gt(), E = g?.transactions?.selected_account_guid;
400
+ yt({
400
401
  widgetName: "TransactionWidget",
401
- isLoaded: B
402
+ isLoaded: V
402
403
  }), m.useEffect(() => {
403
- B || le().finally();
404
- const u = tt(F()), ke = Ze(F());
405
- n(u, ke), d(A.TRANSACTIONS_VIEW);
404
+ V || _e().finally();
406
405
  }, []), m.useEffect(() => {
407
- g && (console.warn("Transactions: Initialized UseEffect - Set Filter"), q({
408
- accounts: W ? [W] : v,
409
- dateRange: { start: i.start, end: i.end },
410
- searchTerm: X
411
- }));
412
- }, [g, i, v]), m.useEffect(() => {
413
- g && (console.warn("Transactions: Announce UseEffect"), Ae(
414
- G(
415
- p.showing_transactions_count,
416
- j.length
406
+ const d = E ? [{ guid: E }] : i.filter((D) => !D.is_hidden), ee = rt(z()), te = nt(z());
407
+ L(ee, te), W({
408
+ accounts: d.map((D) => D.guid),
409
+ custom: (D) => !D.accountIsClosed && !D.accountIsHidden,
410
+ dateRange: { start: ee, end: te }
411
+ }), u(A.TRANSACTIONS_VIEW);
412
+ }, [i]), m.useEffect(() => {
413
+ W({
414
+ ...Y,
415
+ accounts: E ? [E] : n,
416
+ dateRange: { start: r.start, end: r.end }
417
+ }), me(r.start).finally();
418
+ }, [r, n]), m.useEffect(() => {
419
+ be(o);
420
+ }, [o]), m.useEffect(() => {
421
+ h && _.showing_transactions_count && Ie(
422
+ q(
423
+ _.showing_transactions_count,
424
+ G.length
417
425
  )
418
- ));
419
- }, [g, j]);
420
- const b = Y ? me.find((u) => u.guid === Y) : void 0, Q = ge && !!k.payee && !!k.account_guid && !!k.category_guid, xe = (u) => {
421
- pe(), n(u[0], u[1]);
422
- }, we = (u) => {
423
- he(u), q({
424
- ...ce,
425
- searchTerm: u
426
- }), d(A.TRANSACTIONS_CLICK_SEARCH, { search_term: u });
427
- }, Ie = () => {
428
- Ve(de, ue), d(A.TRANSACTIONS_CLICK_EXPORT);
429
- }, De = () => {
430
- l.length > 0 ? (Ce({
431
- ...$e,
432
- date: et(F()),
433
- user_guid: ye?.user_guid || ""
426
+ );
427
+ }, [h, r, n, G, _]);
428
+ const De = m.useMemo(
429
+ () => i.filter((d) => d.is_manual),
430
+ [i]
431
+ ), b = J ? ge.find((d) => d.guid === J) : void 0, Z = Ce && !!R.payee && !!R.account_guid && !!R.category_guid, Ne = (d) => {
432
+ fe(), L(d[0], d[1]);
433
+ }, Ee = (d) => {
434
+ Te(d), W({
435
+ ...Y,
436
+ searchTerm: d
437
+ }), u(A.TRANSACTIONS_CLICK_SEARCH, { search_term: d });
438
+ }, Oe = () => {
439
+ Ue(G, pe), u(A.TRANSACTIONS_CLICK_EXPORT);
440
+ }, ke = () => {
441
+ De.length > 0 ? (Ae({
442
+ ...Fe,
443
+ date: ot(z()),
444
+ user_guid: xe?.user_guid || ""
434
445
  }), T(
435
446
  "addTransaction"
436
447
  /* AddTransaction */
437
- ), d(A.TRANSACTIONS_CLICK_ADD)) : (V(!0), d(A.TRANSACTIONS_ADD_MANUAL_ACCOUNT_MODAL));
438
- }, ve = async () => {
439
- Q && await se(k), T("");
440
- }, Ne = () => {
441
- V(!1), J(!0);
442
- }, Ee = async () => {
443
- J(!1), await s();
444
- }, Oe = async () => {
445
- b && !b.has_been_viewed && await _e({ ...b, has_been_viewed: !0 }), T("");
448
+ ), u(A.TRANSACTIONS_CLICK_ADD)) : (U(!0), u(A.TRANSACTIONS_ADD_MANUAL_ACCOUNT_MODAL));
449
+ }, Le = async () => {
450
+ Z && await ue(R), T("");
451
+ }, Me = () => {
452
+ U(!1), Q(!0);
453
+ }, Re = async () => {
454
+ Q(!1), await c();
455
+ }, He = async () => {
456
+ b && !b.has_been_viewed && await he({ ...b, has_been_viewed: !0 }), T("");
446
457
  };
447
- if (!g)
448
- return /* @__PURE__ */ e(z, {});
449
- const U = [];
450
- return !c && (P || ie) && U.push({
458
+ if (!N)
459
+ return /* @__PURE__ */ e(X, {});
460
+ const K = [];
461
+ return !l && (le || de) && K.push({
451
462
  iconName: "open_in_new",
452
- label: p.export_csv_btn,
453
- onClick: Ie
454
- }), f.show_connections_widget_in_master && U.push({
463
+ label: _.export_csv_btn,
464
+ onClick: Oe
465
+ }), f.show_connections_widget_in_master && K.push({
455
466
  iconName: "add",
456
- label: p.add_transaction_btn,
457
- onClick: De
458
- }), /* @__PURE__ */ _(
459
- _t,
467
+ label: _.add_transaction_btn,
468
+ onClick: ke
469
+ }), /* @__PURE__ */ p(
470
+ ft,
460
471
  {
461
- actions: U,
472
+ actions: K,
462
473
  calendarActions: {
463
- onRangeChanged: xe
474
+ onRangeChanged: Ne
464
475
  },
465
- onAccountsFilterClick: () => d(A.ACCOUNTS_CLICK_FILTER),
476
+ onAccountsFilterClick: () => u(A.ACCOUNTS_CLICK_FILTER),
466
477
  onBackClick: t,
467
- showAccountFilter: !W,
478
+ showAccountFilter: !E,
468
479
  sx: a,
469
- title: p.transactions_title,
480
+ title: _.transactions_title,
470
481
  children: [
471
- B ? /* @__PURE__ */ _(x, { children: [
472
- Se,
473
- /* @__PURE__ */ e(S, { mt: 16, children: /* @__PURE__ */ e(
474
- ht,
482
+ V ? /* @__PURE__ */ p(S, { children: [
483
+ ve,
484
+ /* @__PURE__ */ e(x, { mt: 16, children: /* @__PURE__ */ e(
485
+ Tt,
475
486
  {
476
- onChange: we,
477
- placeholder: p.action_bar_search_placeholder,
478
- searchValue: X
487
+ onChange: Ee,
488
+ placeholder: _.action_bar_search_placeholder,
489
+ searchValue: ye
479
490
  }
480
491
  ) }),
481
492
  /* @__PURE__ */ e(
482
- S,
493
+ x,
483
494
  {
484
495
  sx: {
485
- [O.breakpoints.down("md")]: { display: "none" },
486
- [O.breakpoints.up("md")]: { display: "block" }
496
+ [M.breakpoints.down("md")]: { display: "none" },
497
+ [M.breakpoints.up("md")]: { display: "block" }
487
498
  },
488
499
  children: /* @__PURE__ */ e(
489
- It,
500
+ Et,
490
501
  {
491
- height: `calc(${r} - ${ae}px)`,
492
- onCategoryClick: (u) => {
493
- L(u), T(
502
+ height: `calc(${s} - ${re}px)`,
503
+ onCategoryClick: (d) => {
504
+ H(d), T(
494
505
  "category"
495
506
  /* Category */
496
507
  );
497
508
  },
498
- onRowClick: (u) => {
499
- L(u), T(
509
+ onRowClick: (d) => {
510
+ H(d), T(
500
511
  "transaction"
501
512
  /* Transaction */
502
- ), d(A.TRANSACTIONS_CLICK_DETAILS, { transaction_guid: u });
513
+ ), u(A.TRANSACTIONS_CLICK_DETAILS, { transaction_guid: d });
503
514
  }
504
515
  }
505
516
  )
506
517
  }
507
518
  ),
508
519
  /* @__PURE__ */ e(
509
- S,
520
+ x,
510
521
  {
511
522
  sx: {
512
- [O.breakpoints.down("md")]: { display: "block" },
513
- [O.breakpoints.up("md")]: { display: "none" }
523
+ [M.breakpoints.down("md")]: { display: "block" },
524
+ [M.breakpoints.up("md")]: { display: "none" }
514
525
  },
515
526
  children: /* @__PURE__ */ e(
516
- Pe,
527
+ We,
517
528
  {
518
- height: `calc(${r} - ${ae}px)`,
519
- onClick: (u) => {
520
- L(u), T(
529
+ height: `calc(${s} - ${re}px)`,
530
+ onClick: (d) => {
531
+ H(d), T(
521
532
  "transaction"
522
533
  /* Transaction */
523
534
  );
@@ -528,74 +539,74 @@ const ft = (t) => /* @__PURE__ */ _(y, { tabIndex: t.tabIndex, variant: "Small",
528
539
  )
529
540
  }
530
541
  )
531
- ] }) : /* @__PURE__ */ e(mt, { sx: { m: 48 }, variant: "list" }),
542
+ ] }) : /* @__PURE__ */ e(ht, { sx: { m: 48 }, variant: "list" }),
532
543
  /* @__PURE__ */ e(
533
- te,
544
+ oe,
534
545
  {
535
- ariaLabelClose: D.close_aria,
536
- isOpen: $ === "transaction" && !!b,
537
- onClose: Oe,
538
- title: p.details_title,
539
- children: b && /* @__PURE__ */ e(Be, { transaction: b })
546
+ ariaLabelClose: v.close_aria,
547
+ isOpen: F === "transaction" && !!b,
548
+ onClose: He,
549
+ title: _.details_title,
550
+ children: b && /* @__PURE__ */ e(Ge, { transaction: b })
540
551
  }
541
552
  ),
542
- b && $ === "category" && /* @__PURE__ */ e(
543
- kt,
553
+ b && F === "category" && /* @__PURE__ */ e(
554
+ Ht,
544
555
  {
545
556
  onClose: () => {
546
- C(""), T(""), L("");
557
+ C(""), T(""), H("");
547
558
  },
548
559
  transaction: b
549
560
  }
550
561
  ),
551
562
  /* @__PURE__ */ e(
552
- te,
563
+ oe,
553
564
  {
554
- ariaLabelClose: D.close_aria,
555
- isOpen: $ === "addTransaction",
556
- isPrimaryDisabled: !Q,
565
+ ariaLabelClose: v.close_aria,
566
+ isOpen: F === "addTransaction",
567
+ isPrimaryDisabled: !Z,
557
568
  onClose: () => T(""),
558
- onPrimaryAction: ve,
559
- title: p.add_transaction_title,
560
- children: /* @__PURE__ */ e(Et, {})
569
+ onPrimaryAction: Le,
570
+ title: _.add_transaction_title,
571
+ children: /* @__PURE__ */ e(Mt, {})
561
572
  }
562
573
  ),
563
574
  /* @__PURE__ */ e(
564
- vt,
575
+ kt,
565
576
  {
566
- copy: { title: p.add_manual_account },
567
- isOpen: Te,
577
+ copy: { title: _.add_manual_account },
578
+ isOpen: Se,
568
579
  onClose: () => {
569
- V(!1);
580
+ U(!1);
570
581
  },
571
- onPrimaryAction: Ne
582
+ onPrimaryAction: Me
572
583
  }
573
584
  ),
574
585
  /* @__PURE__ */ e(
575
- nt,
586
+ it,
576
587
  {
577
- onClose: Ee,
578
- showConnectWidget: be,
579
- title: p.add_manual_account
588
+ onClose: Re,
589
+ showConnectWidget: we,
590
+ title: _.add_manual_account
580
591
  }
581
592
  )
582
593
  ]
583
594
  }
584
595
  );
585
- }, Ca = w(Lt);
596
+ }, Aa = w(Bt);
586
597
  export {
587
- vt as AddAccountModal,
588
- Sa as BottomActions,
589
- Oa as ExportCsvAction,
590
- Da as TRANSACTION_EVENTS,
591
- xa as TopActions,
592
- ba as TransactionApi,
593
- Be as TransactionDetails,
594
- Pe as TransactionList,
595
- wa as TransactionRow,
596
- Na as TransactionStore,
597
- It as TransactionTable,
598
- Ca as TransactionWidget,
599
- Ve as exportTransactionsToCSV,
600
- R as useTransactionsUiStore
598
+ kt as AddAccountModal,
599
+ va as BottomActions,
600
+ Ra as ExportCsvAction,
601
+ Oa as TRANSACTION_EVENTS,
602
+ Da as TopActions,
603
+ wa as TransactionApi,
604
+ Ge as TransactionDetails,
605
+ We as TransactionList,
606
+ Na as TransactionRow,
607
+ La as TransactionStore,
608
+ Et as TransactionTable,
609
+ Aa as TransactionWidget,
610
+ Ue as exportTransactionsToCSV,
611
+ P as useTransactionsUiStore
601
612
  };