@mx-cartographer/experiences 9.0.2 → 9.0.4-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.
Files changed (95) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/{Account-BaJmiJAG.mjs → Account-DR7Plrqy.mjs} +10 -10
  3. package/dist/AccountDetailsDrawer-C8oJP3J4.mjs +921 -0
  4. package/dist/AccountDetailsHeader-ByGNPZpO.mjs +228 -0
  5. package/dist/{AccountUtils-T5_Odvos.mjs → AccountUtils-B8ZzWI-d.mjs} +3 -3
  6. package/dist/{Analytics-CzGzz_sE.mjs → Analytics-WeZYytR0.mjs} +3 -0
  7. package/dist/BeatMaterialIcon-1KOfRZrA.mjs +26 -0
  8. package/dist/{CategorySelectorDrawer-8soGrhB8.mjs → CategorySelectorDrawer-BArJC27L.mjs} +1 -1
  9. package/dist/Connect-BH0Pt6zc.mjs +42 -0
  10. package/dist/{ConnectCard-CCep7Zqe.mjs → ConnectCard-Dwfgv24k.mjs} +1 -1
  11. package/dist/{ConnectDrawer-Cnjr3Ddg.mjs → ConnectDrawer-DytyIhaF.mjs} +8 -9
  12. package/dist/{ConnectionsDrawer-CtfPXk0M.mjs → ConnectionsDrawer-BHJPKXYF.mjs} +8 -9
  13. package/dist/{CurrencyInput-adTIRtL3.mjs → CurrencyInput-DaGEQaLW.mjs} +1 -1
  14. package/dist/DateUtil-CzBmbjmA.mjs +74 -0
  15. package/dist/{DebtUtils-DD3186U-.mjs → DebtUtils-i4pI2Uoe.mjs} +6 -6
  16. package/dist/{EmbeddedCard-DPwJjqMH.mjs → EmbeddedCard-CQpbZrmP.mjs} +4 -4
  17. package/dist/{Error-Dogaw2jO.mjs → Error-Dtw6yxkf.mjs} +1 -1
  18. package/dist/{ExportCsvAction-Bw02ZJEj.mjs → ExportCsvAction-bovG-NJr.mjs} +2 -2
  19. package/dist/{GlobalAccountFilter-7Cg2-9A5.mjs → GlobalAccountFilter-CYqzqmAd.mjs} +10 -10
  20. package/dist/{Help-DJ8PrVHX.mjs → Help-5klKVqkX.mjs} +2 -2
  21. package/dist/{LineChart-CejWS_rh.mjs → LineChart-CUfiH86G.mjs} +1 -1
  22. package/dist/{ListItemAction-CzZ8s39Z.mjs → ListItemAction-BqUCLj_w.mjs} +1 -1
  23. package/dist/{ListItemWrapper-B5r-YQQ_.mjs → ListItemWrapper-BHIbqx7E.mjs} +3 -3
  24. package/dist/ManageIncome-Cz6hvpdA.mjs +902 -0
  25. package/dist/{MicroWidgetContainer-CfKdQfhi.mjs → MicroWidgetContainer-B2NnKBgW.mjs} +1 -1
  26. package/dist/{MiniWidgetContainer-BdPiUU-u.mjs → MiniWidgetContainer-Bmv_WeUd.mjs} +1 -1
  27. package/dist/{NetWorthUtils-DilGN1nW.mjs → NetWorthUtils-DfSH3z70.mjs} +2 -2
  28. package/dist/{NotificationSettings-B4JA5IKE.mjs → NotificationSettings-Ci89BBRI.mjs} +4 -4
  29. package/dist/{OriginalBalanceAction-BybTXDtO.mjs → OriginalBalanceAction-YrvxBYAl.mjs} +3 -3
  30. package/dist/{RecurringSettings-D2xbNb67.mjs → RecurringSettings-ClYjsmPz.mjs} +4 -4
  31. package/dist/RecurringTransactionsUtil-zOxq5pzY.mjs +298 -0
  32. package/dist/Select-CSpkK5cR.mjs +61 -0
  33. package/dist/SpendingData-Fii_xATx.mjs +53 -0
  34. package/dist/{SpendingLegend-5Ct_FZ8o.mjs → SpendingLegend-Bn3DzGyK.mjs} +1 -1
  35. package/dist/TabContentContainer-B0eYJP5p.mjs +48 -0
  36. package/dist/{TransactionDetails-DctXr07p.mjs → TransactionDetails-DRN0GIaZ.mjs} +6 -6
  37. package/dist/{UserStore-CRpKQjpP.mjs → UserStore-DzWku3t0.mjs} +81 -40
  38. package/dist/{ViewMoreMicroCard-BD_MNc2z.mjs → ViewMoreMicroCard-Dxghxphh.mjs} +211 -231
  39. package/dist/{WidgetContainer-CmbU4CBH.mjs → WidgetContainer-D-LzIKFb.mjs} +3 -3
  40. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsDrawer.d.ts +6 -0
  41. package/dist/accounts/index.d.ts +1 -0
  42. package/dist/accounts/index.es.js +220 -1035
  43. package/dist/analytics/index.es.js +8 -8
  44. package/dist/budgets/index.es.js +11 -11
  45. package/dist/cashflow/index.es.js +41 -41
  46. package/dist/categories/index.es.js +1 -1
  47. package/dist/common/components/DataRow.d.ts +1 -0
  48. package/dist/common/constants/Analytics.d.ts +3 -0
  49. package/dist/common/index.es.js +82 -83
  50. package/dist/core/index.es.js +8 -8
  51. package/dist/core/stores/RecurringTransactionsStore.d.ts +27 -1
  52. package/dist/core/types/localization/RecurringCopy.d.ts +14 -1
  53. package/dist/core/utils/DateUtil.d.ts +2 -0
  54. package/dist/core/utils/RecurringTransactionsUtil.d.ts +2 -1
  55. package/dist/dashboard/index.es.js +4 -4
  56. package/dist/debts/index.es.js +73 -73
  57. package/dist/finstrong/index.es.js +17 -17
  58. package/dist/goals/index.es.js +22 -23
  59. package/dist/help/index.es.js +4 -4
  60. package/dist/{hooks-BaO_gOI6.mjs → hooks-97sNJ_lf.mjs} +9 -9
  61. package/dist/insights/index.es.js +4 -4
  62. package/dist/investments/index.es.js +6 -6
  63. package/dist/merchants/index.es.js +1 -1
  64. package/dist/microinsights/index.es.js +12 -11
  65. package/dist/networth/index.es.js +9 -9
  66. package/dist/notifications/index.es.js +9 -9
  67. package/dist/recurringtransactions/components/RecurringTransactionDetailsDrawer.d.ts +3 -0
  68. package/dist/recurringtransactions/components/RecurringTransactionList.d.ts +11 -0
  69. package/dist/recurringtransactions/components/UpcomingRecurrenceCard.d.ts +6 -0
  70. package/dist/recurringtransactions/components/actions/LinkTransactionDrawer.d.ts +10 -0
  71. package/dist/recurringtransactions/components/actions/MarkAsPaidDialog.d.ts +7 -0
  72. package/dist/recurringtransactions/components/actions/MarkAsUnpaidDialog.d.ts +7 -0
  73. package/dist/recurringtransactions/index.es.js +402 -376
  74. package/dist/settings/index.es.js +7 -7
  75. package/dist/spending/index.es.js +8 -8
  76. package/dist/transactions/index.es.js +12 -12
  77. package/dist/trends/index.es.js +14 -14
  78. package/dist/useAccountDisplayName-BsiXA0qf.mjs +23 -0
  79. package/dist/{useInsightsEnabled-DaNLPmUU.mjs → useInsightsEnabled-D5Sdm0TJ.mjs} +1 -1
  80. package/dist/{useWidgetLoadTimer-CJb-RELP.mjs → useWidgetLoadTimer-B0tB-yzL.mjs} +1 -1
  81. package/package.json +1 -1
  82. package/dist/Account-BxHMlV9R.mjs +0 -30
  83. package/dist/AccountDetailsHeader-DIysk_4w.mjs +0 -95
  84. package/dist/AccountDisplayName-CO7z3v99.mjs +0 -11
  85. package/dist/AccountFields-mwJ8NXsX.mjs +0 -141
  86. package/dist/AccountListItem-BDXHs4tV.mjs +0 -94
  87. package/dist/Accounts-CseLC3lL.mjs +0 -5
  88. package/dist/Connect-Dk6GZEsA.mjs +0 -39
  89. package/dist/DateUtil-Bhq59ZVg.mjs +0 -58
  90. package/dist/ManageIncome-D1yBODQi.mjs +0 -595
  91. package/dist/RecurringTransactionsUtil-B3rLEx_g.mjs +0 -253
  92. package/dist/Select-BFt-HD-L.mjs +0 -55
  93. package/dist/SpendingData-PKlh8caU.mjs +0 -53
  94. package/dist/TabContentContainer-CnMXkVqr.mjs +0 -21
  95. package/dist/useAccountDisplayName-CFa_MrS6.mjs +0 -15
@@ -1,58 +0,0 @@
1
- import { addMonths as m } from "date-fns/addMonths";
2
- import { addQuarters as n } from "date-fns/addQuarters";
3
- import { addWeeks as i } from "date-fns/addWeeks";
4
- import { addYears as l } from "date-fns/addYears";
5
- import { getDay as x } from "date-fns/getDay";
6
- import { isBefore as a } from "date-fns/isBefore";
7
- import { nextDay as T } from "date-fns/nextDay";
8
- import { setDate as c } from "date-fns/setDate";
9
- import { startOfToday as r } from "date-fns/startOfToday";
10
- import { fromUnixTime as s } from "date-fns/fromUnixTime";
11
- import { f as D, D as f } from "./DateFormats-HudZ3Bjs.mjs";
12
- const Y = (e) => {
13
- const t = x(e);
14
- let o = T(e, t);
15
- for (; a(o, r()); )
16
- o = i(o, 1);
17
- return o;
18
- }, _ = (e) => {
19
- let t = e;
20
- for (; a(t, r()); )
21
- t = i(t, 2);
22
- return t;
23
- }, A = (e) => {
24
- let t = c(r(), e.getDate());
25
- for (; a(t, r()); )
26
- t = m(t, 1);
27
- return t;
28
- }, W = (e) => {
29
- let t = e;
30
- for (; a(t, r()); )
31
- t = m(t, 2);
32
- return t;
33
- }, k = (e) => {
34
- let t = n(e, 1);
35
- for (; a(t, r()); )
36
- t = n(t, 1);
37
- return t;
38
- }, B = (e) => {
39
- let t = e;
40
- for (; a(t, r()); )
41
- t = n(t, 2);
42
- return t;
43
- }, C = (e) => l(e, 1), E = (e) => {
44
- const t = s(e);
45
- return new Date(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate());
46
- }, F = (e) => D(s(e), f.DAY_OF_WEEK_MONTH_DAY), Q = (e) => e ? D(s(e), f.MONTH_YEAR) : "";
47
- export {
48
- B as a,
49
- k as b,
50
- W as c,
51
- A as d,
52
- _ as e,
53
- E as f,
54
- C as g,
55
- Y as h,
56
- F as i,
57
- Q as j
58
- };
@@ -1,595 +0,0 @@
1
- import { jsxs as c, jsx as e, Fragment as k } from "react/jsx-runtime";
2
- import _ from "react";
3
- import { observer as I } from "mobx-react-lite";
4
- import F from "@mui/material/Box";
5
- import T from "@mui/material/Divider";
6
- import Q from "@mui/material/List";
7
- import p from "@mui/material/Stack";
8
- import { MerchantLogo as $, Text as S, P as G, InstitutionLogo as se } from "@mxenabled/mxui";
9
- import ce from "@mui/material/ListItem";
10
- import de from "@mui/material/ListItemAvatar";
11
- import le from "@mui/material/ListItemButton";
12
- import _e from "@mui/material/ListItemText";
13
- import { b as ue, f as H } from "./NumberFormatting--XMeeBfr.mjs";
14
- import { F as l, g as X, R as L, c as Z } from "./RecurringTransactionsUtil-B3rLEx_g.mjs";
15
- import { subDays as J } from "date-fns/subDays";
16
- import { startOfToday as E } from "date-fns/startOfToday";
17
- import { endOfMonth as me } from "date-fns/endOfMonth";
18
- import { parseISO as pe } from "date-fns/parseISO";
19
- import V from "@mui/material/Button";
20
- import { Delete as ye, Add as he, ReceiptLong as fe } from "@mxenabled/mx-icons";
21
- import { T as ee, u as ge, S as Ce, a as be } from "./EmbeddedCard-DPwJjqMH.mjs";
22
- import { T as xe } from "./TransactionDetails-DctXr07p.mjs";
23
- import { addYears as j } from "date-fns/addYears";
24
- import { getDayOfYear as Se } from "date-fns/getDayOfYear";
25
- import { setDayOfYear as ve } from "date-fns/setDayOfYear";
26
- import { AdapterDateFns as De } from "@mui/x-date-pickers/AdapterDateFnsV3";
27
- import { DatePicker as we } from "@mui/x-date-pickers";
28
- import { LocalizationProvider as Ae } from "@mui/x-date-pickers/LocalizationProvider";
29
- import { u as w, i as Y, g as P, b as Ie, h as te, C as Re } from "./hooks-BaO_gOI6.mjs";
30
- import { S as M, D as z } from "./Select-BFt-HD-L.mjs";
31
- import { D as N } from "./Drawer-BXqqBMxg.mjs";
32
- import { A as O } from "./Analytics-CzGzz_sE.mjs";
33
- import { f as Ee, D as Le } from "./DateFormats-HudZ3Bjs.mjs";
34
- import { D as Oe } from "./Dialog-Bvd2n8hz.mjs";
35
- import { formatISO as Te } from "date-fns/formatISO";
36
- import { fromUnixTime as ke } from "date-fns/fromUnixTime";
37
- import { S as Ne } from "./SearchBox-Cpgu_gdO.mjs";
38
- import { i as Me } from "./DateUtil-Bhq59ZVg.mjs";
39
- import { C as q } from "./Category-DEKZGLYe.mjs";
40
- import { T as ne } from "./TransactionUtils-BphBJBbU.mjs";
41
- const re = ({
42
- frequency: n,
43
- firstDay: t,
44
- secondDay: o,
45
- onFrequencyChange: i,
46
- onFirstDayChange: s,
47
- onSecondDayChange: d
48
- }) => {
49
- const { recurring: r } = w(), a = _.useMemo(
50
- () => [
51
- { id: l.EveryWeek, label: r.frequency_every_week },
52
- { id: l.EveryOtherWeek, label: r.frequency_every_other_week },
53
- { id: l.TwiceAMonth, label: r.frequency_twice_a_month },
54
- { id: l.EveryMonth, label: r.frequency_every_month },
55
- { id: l.EveryOtherMonth, label: r.frequency_every_other_month },
56
- { id: l.EveryQuarter, label: r.frequency_every_quarter },
57
- { id: l.EveryOtherQuarter, label: r.frequency_every_other_quarter },
58
- { id: l.EveryYear, label: r.frequency_every_year }
59
- ],
60
- [r]
61
- ), m = [
62
- { id: 0, label: r.weekday_sunday },
63
- { id: 1, label: r.weekday_monday },
64
- { id: 2, label: r.weekday_tuesday },
65
- { id: 3, label: r.weekday_wednesday },
66
- { id: 4, label: r.weekday_thursday },
67
- { id: 5, label: r.weekday_friday },
68
- { id: 6, label: r.weekday_saturday }
69
- ], h = [...Array(31).keys()].map((b) => ({
70
- id: b + 1,
71
- label: ue(b + 1)
72
- }));
73
- h[30].label += ` (${r.last_day_of_month})`;
74
- const g = h.slice(0, 15), v = h.slice(14), C = n === l.EveryWeek || n === l.EveryOtherWeek, f = n === l.TwiceAMonth || n === l.EveryMonth || n === l.EveryOtherMonth || n === l.EveryQuarter || n === l.EveryOtherQuarter, A = ve(E(), t), y = A < E() ? j(A, 1) : A, D = (b) => {
75
- b && s(Se(b));
76
- };
77
- return /* @__PURE__ */ c(p, { gap: 24, sx: { m: 24 }, children: [
78
- /* @__PURE__ */ e(
79
- M,
80
- {
81
- label: r.frequency,
82
- onChange: i,
83
- options: a,
84
- value: n
85
- }
86
- ),
87
- C && /* @__PURE__ */ e(
88
- M,
89
- {
90
- label: r.day_of_the_week,
91
- onChange: s,
92
- options: m,
93
- value: t
94
- }
95
- ),
96
- f && /* @__PURE__ */ e(
97
- M,
98
- {
99
- label: n === l.TwiceAMonth ? r.first_day_of_the_month : r.day_of_the_month,
100
- onChange: s,
101
- options: n === l.TwiceAMonth ? g : h,
102
- value: t
103
- }
104
- ),
105
- n === l.TwiceAMonth && /* @__PURE__ */ e(
106
- M,
107
- {
108
- label: r.second_day_of_the_month,
109
- onChange: d,
110
- options: v,
111
- value: o || 0
112
- }
113
- ),
114
- n === l.EveryYear && /* @__PURE__ */ e(Ae, { dateAdapter: De, children: /* @__PURE__ */ e(
115
- we,
116
- {
117
- disablePast: !0,
118
- label: r.next_payment_date,
119
- maxDate: J(j(E(), 1), 1),
120
- minDate: E(),
121
- onChange: D,
122
- value: y
123
- }
124
- ) })
125
- ] });
126
- }, Fe = I(({ repeatingTransaction: n }) => {
127
- const { recurring: t } = w(), { updateRepeatingTransaction: o } = Y(), { onEvent: i } = P(), [s, d] = _.useState(!1), [r, a] = _.useState(n.recurrence_type), [m, h] = _.useState(n.recurrence_day), [g, v] = _.useState(n.second_recurrence_day), C = async () => {
128
- await o({
129
- ...n,
130
- recurrence_type: r,
131
- recurrence_day: m,
132
- second_recurrence_day: g
133
- }), d(!1);
134
- }, f = () => {
135
- d(!0), i(O.RECURRING_TRANSACTIONS_DETAILS_CLICK_PAYMENT_SCHEDULE);
136
- };
137
- return /* @__PURE__ */ c(k, { children: [
138
- /* @__PURE__ */ e(
139
- z,
140
- {
141
- iconName: "sync",
142
- label: t.activity_schedule,
143
- onClick: f,
144
- value: `${X(t, n, !0)}`
145
- }
146
- ),
147
- /* @__PURE__ */ e(
148
- N,
149
- {
150
- ariaLabelClose: t.close_drawer_aria,
151
- isOpen: s,
152
- onClose: () => d(!1),
153
- onPrimaryAction: C,
154
- title: t.payment_schedule,
155
- children: /* @__PURE__ */ e(
156
- re,
157
- {
158
- firstDay: m,
159
- frequency: r,
160
- onFirstDayChange: h,
161
- onFrequencyChange: a,
162
- onSecondDayChange: v,
163
- secondDay: g
164
- }
165
- )
166
- }
167
- )
168
- ] });
169
- }), Ge = I(
170
- ({ onDeleted: n, recurringTransaction: t }) => {
171
- const { recurring: o } = w(), { selectedAccountGuids: i } = Ie(), { onEvent: s } = P(), { deleteRepeatingTransaction: d } = Y(), { setFilter: r, transactions: a } = te(), { amount: m, description: h, merchant_guid: g } = t, [v, C] = _.useState(!1), [f, A] = _.useState("");
172
- _.useEffect(() => {
173
- r({
174
- accounts: i,
175
- dateRange: { start: J(E(), 90), end: me(E()) },
176
- custom: (u) => u.repeating_transaction_guid === t.guid
177
- });
178
- }, [t]);
179
- const y = _.useMemo(
180
- () => a.find((u) => u.guid === f),
181
- [f, a]
182
- ), D = t.repeating_transaction_type === L.Income, b = async () => {
183
- await d(t.guid), n();
184
- }, U = () => {
185
- C(!0), s(O.RECURRING_TRANSACTIONS_DETAILS_CLICK_DELETE);
186
- };
187
- return /* @__PURE__ */ c(p, { bgcolor: "background.default", direction: "column", height: "100%", children: [
188
- /* @__PURE__ */ c(p, { direction: "column", m: 24, children: [
189
- /* @__PURE__ */ e(
190
- $,
191
- {
192
- categoryGuid: y?.category_guid || "",
193
- merchantGuid: g,
194
- size: 64,
195
- sx: { mb: 12 }
196
- }
197
- ),
198
- /* @__PURE__ */ e(S, { bold: !0, variant: "body1", children: h }),
199
- /* @__PURE__ */ c(G, { color: D ? "success.main" : "text.primary", sx: { my: 4 }, variant: "h1", children: [
200
- D ? "+" : "",
201
- H(m, "0,0.00")
202
- ] }),
203
- /* @__PURE__ */ e(S, { color: "text.secondary", variant: "body2", children: `${o.next_payment_date}: ${Ee(
204
- Z(
205
- t.recurrence_type,
206
- pe(t.predicted_occurs_on),
207
- t.recurrence_day
208
- ),
209
- Le.MONTH_DAY_YEAR
210
- )}` })
211
- ] }),
212
- /* @__PURE__ */ c(Q, { sx: { bgcolor: "background.paper" }, children: [
213
- t.account && /* @__PURE__ */ c(k, { children: [
214
- /* @__PURE__ */ e(
215
- z,
216
- {
217
- iconName: "checkbook",
218
- label: o.account,
219
- value: t.account.displayName || ""
220
- }
221
- ),
222
- /* @__PURE__ */ e(T, { variant: "inset" })
223
- ] }),
224
- y?.category && /* @__PURE__ */ c(k, { children: [
225
- /* @__PURE__ */ e(
226
- z,
227
- {
228
- iconName: "monetization_on",
229
- label: o.category,
230
- value: y.category
231
- }
232
- ),
233
- /* @__PURE__ */ e(T, { variant: "inset" })
234
- ] }),
235
- /* @__PURE__ */ e(Fe, { repeatingTransaction: t }),
236
- /* @__PURE__ */ e(T, {})
237
- ] }),
238
- /* @__PURE__ */ e(
239
- V,
240
- {
241
- color: "error",
242
- onClick: U,
243
- startIcon: /* @__PURE__ */ e(ye, {}),
244
- sx: { mx: 24, my: 16 },
245
- variant: "text",
246
- children: D ? o.delete_income_title : o.delete_expense_title
247
- }
248
- ),
249
- /* @__PURE__ */ e(S, { bold: !0, sx: { ml: 24, mt: 16 }, variant: "body1", children: o.paid_transactions }),
250
- /* @__PURE__ */ e(ee, { height: "30dvh", onClick: A }),
251
- /* @__PURE__ */ e(
252
- N,
253
- {
254
- ariaLabelClose: o.close_drawer_aria,
255
- isOpen: !!f && !!y,
256
- onClose: () => A(""),
257
- title: o.transaction_details_drawer_title,
258
- children: y && /* @__PURE__ */ e(xe, { transaction: y })
259
- }
260
- ),
261
- /* @__PURE__ */ e(
262
- Oe,
263
- {
264
- copy: {
265
- title: D ? o.delete_income_title : o.delete_expense_title,
266
- close_aria: o.close_drawer_aria
267
- },
268
- isOpen: v,
269
- onClose: () => C(!1),
270
- onPrimaryAction: b,
271
- children: /* @__PURE__ */ e(S, { children: D ? o.delete_income_description : o.delete_expense_description })
272
- }
273
- )
274
- ] });
275
- }
276
- ), Ye = I(
277
- ({ onClick: n = () => {
278
- }, repeatingTransaction: t }) => {
279
- const { recurring: o } = w(), [i, s] = _.useState(!1), d = _.useMemo(
280
- () => t.transactions.length === 0 ? "" : t.transactions[0].category_guid || "",
281
- [t]
282
- ), r = t.account?.displayName || "", a = t.repeating_transaction_type === L.Income, m = X(o, t, !0);
283
- return /* @__PURE__ */ c(ce, { disableGutters: !0, disablePadding: !0, children: [
284
- /* @__PURE__ */ c(le, { onClick: () => {
285
- n(t), s(!0);
286
- }, children: [
287
- /* @__PURE__ */ e(de, { children: /* @__PURE__ */ e(
288
- $,
289
- {
290
- categoryGuid: d,
291
- merchantGuid: t.merchant_guid
292
- }
293
- ) }),
294
- /* @__PURE__ */ e(_e, { children: /* @__PURE__ */ c(p, { direction: "row", gap: 4, sx: { justifyContent: "space-between" }, children: [
295
- /* @__PURE__ */ c(p, { direction: "column", sx: { width: "50%" }, children: [
296
- /* @__PURE__ */ e(S, { bold: !0, variant: "body1", children: t.description }),
297
- /* @__PURE__ */ c(p, { alignItems: "center", direction: "row", gap: 6, children: [
298
- t.account?.institution_guid && /* @__PURE__ */ e(
299
- se,
300
- {
301
- alt: r,
302
- institutionGuid: t.account?.institution_guid,
303
- size: 12
304
- }
305
- ),
306
- /* @__PURE__ */ e(S, { variant: "caption", children: r })
307
- ] })
308
- ] }),
309
- /* @__PURE__ */ c(p, { alignItems: "flex-end", sx: { width: "50%" }, children: [
310
- /* @__PURE__ */ c(
311
- S,
312
- {
313
- bold: !0,
314
- color: a ? "success.main" : "text.primary",
315
- variant: "body1",
316
- children: [
317
- a ? "+" : "",
318
- H(t.amount, "0,0.00")
319
- ]
320
- }
321
- ),
322
- /* @__PURE__ */ e(
323
- p,
324
- {
325
- direction: "row",
326
- sx: {
327
- alignItems: "center",
328
- gap: 6,
329
- justifyContent: "flex-end",
330
- textTransform: "uppercase",
331
- width: "100%"
332
- },
333
- children: /* @__PURE__ */ e(S, { bold: !0, color: "text.secondary", variant: "caption", children: m })
334
- }
335
- )
336
- ] })
337
- ] }) })
338
- ] }),
339
- /* @__PURE__ */ e(
340
- N,
341
- {
342
- ariaLabelClose: o.close_drawer_aria,
343
- isOpen: i,
344
- onClose: () => s(!1),
345
- title: t.repeating_transaction_type === L.Income ? o.income_details : o.expense_details,
346
- children: /* @__PURE__ */ e(
347
- Ge,
348
- {
349
- onDeleted: () => s(!1),
350
- recurringTransaction: t
351
- }
352
- )
353
- }
354
- )
355
- ] });
356
- }
357
- ), Pe = I(
358
- ({
359
- bgcolor: n = "background.default",
360
- description: t,
361
- onSearch: o,
362
- onSelected: i
363
- }) => {
364
- const { recurring: s } = w(), { searchValue: d, setSearchValue: r } = ge();
365
- return /* @__PURE__ */ c(p, { sx: { bgcolor: n, gap: 16, pt: 8 }, children: [
366
- t && /* @__PURE__ */ e(G, { sx: { mx: 24 }, children: t }),
367
- /* @__PURE__ */ e(
368
- Ne,
369
- {
370
- ariaLabel: s.select_transaction_search_aria,
371
- cancelAriaLabel: s.select_transaction_search_cancel_aria,
372
- onChange: (a) => {
373
- r(a), o(a);
374
- },
375
- placeholder: s.select_transaction_search_placeholder,
376
- searchValue: d
377
- }
378
- ),
379
- /* @__PURE__ */ e(
380
- ee,
381
- {
382
- bgcolor: n,
383
- filter: (a) => !!a.merchant_guid,
384
- height: "auto",
385
- onClick: i,
386
- showLoader: !1
387
- }
388
- )
389
- ] });
390
- }
391
- ), Ue = I(
392
- ({
393
- bgcolor: n = "background.default",
394
- firstDay: t,
395
- secondDay: o,
396
- frequency: i,
397
- onFrequencyChange: s,
398
- onFirstDayChange: d,
399
- onSecondDayChange: r,
400
- transaction: a
401
- }) => {
402
- const { recurring: m } = w();
403
- return /* @__PURE__ */ c(p, { bgcolor: n, gap: 24, height: "100%", children: [
404
- /* @__PURE__ */ c(p, { children: [
405
- /* @__PURE__ */ e(Ce, { bgcolor: n, children: Me(a.date) }),
406
- /* @__PURE__ */ e(be, { transaction: a })
407
- ] }),
408
- /* @__PURE__ */ c(F, { children: [
409
- /* @__PURE__ */ e(S, { bold: !0, sx: { mx: 24 }, variant: "body1", children: m.payment_schedule }),
410
- /* @__PURE__ */ e(
411
- re,
412
- {
413
- firstDay: t,
414
- frequency: i,
415
- onFirstDayChange: d,
416
- onFrequencyChange: s,
417
- onSecondDayChange: r,
418
- secondDay: o
419
- }
420
- )
421
- ] })
422
- ] });
423
- }
424
- ), B = (n) => n.top_level_category_guid !== q.INCOME && n.transaction_type === ne.DEBIT, ze = (n, t) => B(n) ? n.payee?.toLowerCase().includes(t.toLowerCase()) || n.description.toLowerCase().includes(t.toLowerCase()) || n.feed_description.toLowerCase().includes(t.toLowerCase()) : !1, W = (n) => n.top_level_category_guid === q.INCOME || n.top_level_category_guid === q.TRANSFER && n.transaction_type === ne.CREDIT, qe = (n, t) => W(n) ? n.payee?.toLowerCase().includes(t.toLowerCase()) || n.description?.toLowerCase().includes(t.toLowerCase()) || n.feed_description?.toLowerCase().includes(t.toLowerCase()) : !1, oe = I(
425
- ({
426
- isIncome: n = !1,
427
- label: t,
428
- onAddRecurringTransaction: o = () => null
429
- }) => {
430
- const { recurring: i } = w(), { filter: s, setFilter: d, transactions: r } = te(), { addRepeatingTransaction: a } = Y(), { user: m } = Re(), [h, g] = _.useState(!1), [v, C] = _.useState(""), [f, A] = _.useState(l.EveryMonth), [y, D] = _.useState(1), [b, U] = _.useState(15), u = _.useMemo(
431
- () => r.find((x) => x.guid === v),
432
- [v, r]
433
- ), ae = () => {
434
- g(!0), d(n ? { ...s, custom: W } : { ...s, custom: B });
435
- }, ie = async () => {
436
- if (!u) {
437
- K();
438
- return;
439
- }
440
- o();
441
- const x = Z(f, ke(u.date), y), R = {
442
- account_guid: u.account_guid,
443
- amount: u.amount,
444
- created_by: 0,
445
- // User
446
- merchant_guid: u.merchant_guid,
447
- description: u.payee || u.description || u.feed_description,
448
- predicted_occurs_on: Te(x, { representation: "date" }),
449
- recurrence_day: y,
450
- recurrence_type: f,
451
- repeating_transaction_type: n ? L.Income : L.Bill,
452
- second_recurrence_day: b,
453
- transaction_type: u.transaction_type,
454
- user_guid: m.guid
455
- };
456
- await a(R, u), K();
457
- }, K = () => {
458
- C(""), g(!1);
459
- };
460
- return /* @__PURE__ */ c(k, { children: [
461
- /* @__PURE__ */ e(V, { onClick: ae, startIcon: /* @__PURE__ */ e(he, { size: 24 }), variant: "contained", children: t }),
462
- /* @__PURE__ */ e(
463
- N,
464
- {
465
- ariaLabelClose: i.close_drawer_aria,
466
- isOpen: h,
467
- onClose: () => g(!1),
468
- title: t,
469
- children: /* @__PURE__ */ e(
470
- Pe,
471
- {
472
- description: n ? i.add_income_description : i.add_expense_description,
473
- onSearch: (x) => {
474
- d({
475
- ...s,
476
- custom: (R) => n ? x ? qe(R, x) : W(R) : x ? ze(R, x) : B(R)
477
- });
478
- },
479
- onSelected: (x) => C(x)
480
- }
481
- )
482
- }
483
- ),
484
- /* @__PURE__ */ e(
485
- N,
486
- {
487
- ariaLabelClose: i.close_drawer_aria,
488
- isOpen: !!v,
489
- onClose: () => C(""),
490
- onPrimaryAction: ie,
491
- title: n ? i.income_details : i.expense_details,
492
- children: u && /* @__PURE__ */ e(
493
- Ue,
494
- {
495
- firstDay: y,
496
- frequency: f,
497
- onFirstDayChange: D,
498
- onFrequencyChange: A,
499
- onSecondDayChange: U,
500
- secondDay: b,
501
- transaction: u
502
- }
503
- )
504
- }
505
- )
506
- ] });
507
- }
508
- ), Be = I(
509
- ({ zeroStateFor: n }) => {
510
- const { recurring: t } = w(), { onEvent: o } = P(), i = n === "income", s = i ? t.recurring_setting_zero_state_income_title : t.recurring_setting_zero_state_expenses_title, d = i ? t.recurring_setting_zero_state_income_description : t.recurring_setting_zero_state_expenses_description, r = i ? t.add_income : t.add_expense;
511
- return /* @__PURE__ */ c(p, { sx: { alignItems: "center", p: 24, pt: 48 }, children: [
512
- /* @__PURE__ */ e(fe, { size: 48 }),
513
- /* @__PURE__ */ e(G, { sx: { my: 8, fontWeight: 600 }, variant: "body1", children: s }),
514
- /* @__PURE__ */ e(G, { color: "text.secondary", sx: { mb: 32 }, variant: "subtitle2", children: d }),
515
- /* @__PURE__ */ e(
516
- oe,
517
- {
518
- isIncome: i,
519
- label: r,
520
- onAddRecurringTransaction: () => {
521
- o(
522
- i ? O.RECURRING_TRANSACTIONS_CLICK_ADD_INCOME : O.RECURRING_ACTIVITY_CLICK_ADD_EXPENSE
523
- );
524
- }
525
- }
526
- )
527
- ] });
528
- }
529
- ), Lt = I(({ forOverview: n = !1 }) => {
530
- const { recurring: t } = w(), { detailedRepeatingTransactions: o } = Y(), { onEvent: i } = P(), s = (a) => {
531
- i(O.RECURRING_TRANSACTIONS_CLICK_INCOME, {
532
- repeating_transaction_guid: a.guid
533
- });
534
- }, d = () => {
535
- i(O.RECURRING_TRANSACTIONS_CLICK_ADD_INCOME);
536
- }, r = o.filter(
537
- (a) => a.repeating_transaction_type === L.Income && (a.transactions.length > 0 || a.recurrence_type === l.EveryYear)
538
- );
539
- return /* @__PURE__ */ e(k, { children: r.length !== 0 ? /* @__PURE__ */ c(
540
- p,
541
- {
542
- sx: {
543
- height: n ? "calc(100vh - 62px)" : "calc(100vh - 109px)",
544
- maxHeight: n ? "calc(100vh - 62px)" : "calc(100vh - 109px)"
545
- },
546
- children: [
547
- n && /* @__PURE__ */ e(S, { bold: !0, sx: { mb: 4, mt: 12, mx: 24 }, variant: "body2", children: t.income }),
548
- /* @__PURE__ */ e(F, { sx: { flex: 1, overflow: "auto" }, children: /* @__PURE__ */ e(Q, { sx: { bgcolor: "background.paper" }, children: r.map((a, m) => /* @__PURE__ */ c(_.Fragment, { children: [
549
- /* @__PURE__ */ e(Ye, { onClick: s, repeatingTransaction: a }),
550
- /* @__PURE__ */ e(
551
- T,
552
- {
553
- variant: m < r.length - 1 ? "inset" : "fullWidth"
554
- }
555
- )
556
- ] }, a.guid)) }) }),
557
- /* @__PURE__ */ c(F, { children: [
558
- /* @__PURE__ */ e(T, {}),
559
- /* @__PURE__ */ e(
560
- F,
561
- {
562
- sx: {
563
- alignContent: "center",
564
- bgcolor: "background.paper",
565
- justifyContent: "flex-end",
566
- px: 24,
567
- py: 12,
568
- textAlign: "right"
569
- },
570
- children: /* @__PURE__ */ e(
571
- oe,
572
- {
573
- isIncome: !0,
574
- label: t.add_income,
575
- onAddRecurringTransaction: d
576
- }
577
- )
578
- }
579
- )
580
- ] })
581
- ]
582
- }
583
- ) : /* @__PURE__ */ e(Be, { zeroStateFor: "income" }) });
584
- });
585
- export {
586
- oe as A,
587
- Lt as M,
588
- Ye as R,
589
- Pe as S,
590
- Be as a,
591
- W as b,
592
- Ue as c,
593
- Ge as d,
594
- qe as i
595
- };