@mx-cartographer/experiences 7.0.4 → 7.0.6-alpha.al0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [7.0.5] - 09-17-2025
2
+
3
+ - **FIXED** - Fixed layout issue with income/expenses actions in standalone widgets
4
+
1
5
  ## [7.0.4] - 09-17-2025
2
6
 
3
7
  - **FIXED** - Cash Flow widget so that it uses all upcoming transactions for the next 30 days
@@ -1,56 +1,56 @@
1
- import { jsxs as c, jsx as e, Fragment as E } from "react/jsx-runtime";
1
+ import { jsxs as c, jsx as e, Fragment as L } from "react/jsx-runtime";
2
2
  import u from "react";
3
3
  import { observer as A } from "mobx-react-lite";
4
- import oe from "@mui/material/Box";
5
- import L from "@mui/material/Divider";
4
+ import P from "@mui/material/Box";
5
+ import T from "@mui/material/Divider";
6
6
  import K from "@mui/material/List";
7
- import y from "@mui/material/Stack";
7
+ import p from "@mui/material/Stack";
8
8
  import re from "@mui/material/ListItem";
9
9
  import ae from "@mui/material/ListItemAvatar";
10
10
  import ie from "@mui/material/ListItemButton";
11
11
  import se from "@mui/material/ListItemText";
12
- import { MerchantLogo as j, Text as x, H1 as ce, InstitutionLogo as de, P } from "@mxenabled/mxui";
13
- import { F as l, S as N, D as Y, g as Q, R, e as le } from "./RepeatingTransaction-BW4J-jeJ.mjs";
12
+ import { MerchantLogo as Q, Text as x, H1 as ce, InstitutionLogo as le, P as U } from "@mxenabled/mxui";
13
+ import { F as d, S as N, D as Y, g as $, R as E, e as de } from "./RepeatingTransaction-BW4J-jeJ.mjs";
14
14
  import { subDays as ue } from "date-fns/subDays";
15
- import { startOfToday as U } from "date-fns/startOfToday";
15
+ import { startOfToday as z } from "date-fns/startOfToday";
16
16
  import { endOfMonth as _e } from "date-fns/endOfMonth";
17
- import $ from "@mui/material/Button";
18
- import { Delete as me, Add as pe, ReceiptLong as ye } from "@mxenabled/mx-icons";
19
- import { T as H, a as he, u as fe, S as ge, b as Ce } from "./TransactionDetails-D4B9DSWo.mjs";
17
+ import H from "@mui/material/Button";
18
+ import { Delete as me, Add as ye, ReceiptLong as pe } from "@mxenabled/mx-icons";
19
+ import { T as X, a as he, u as ge, S as fe, b as Ce } from "./TransactionDetails-D4B9DSWo.mjs";
20
20
  import { getDayOfYear as be } from "date-fns/getDayOfYear";
21
21
  import { setDayOfYear as Se } from "date-fns/setDayOfYear";
22
22
  import { AdapterDateFns as ve } from "@mui/x-date-pickers/AdapterDateFnsV3";
23
23
  import { DatePicker as xe } from "@mui/x-date-pickers";
24
24
  import { LocalizationProvider as we } from "@mui/x-date-pickers/LocalizationProvider";
25
- import { u as w, h as M, e as F, a as Ae, f as X, o as De } from "./hooks-02T565vf.mjs";
26
- import { b as Ie, f as Z } from "./NumberFormatting-CtWHhyBX.mjs";
25
+ import { u as w, h as M, e as F, a as Ae, f as Z, o as De } from "./hooks-02T565vf.mjs";
26
+ import { b as Ie, f as J } from "./NumberFormatting-CtWHhyBX.mjs";
27
27
  import { D as O } from "./Drawer-kEE73B87.mjs";
28
- import { A as T } from "./WidgetContainer-BG-fdDOf.mjs";
28
+ import { A as R } from "./WidgetContainer-BG-fdDOf.mjs";
29
29
  import { f as Ee, D as Re, a as Te } from "./Dialog-CWW597AF.mjs";
30
30
  import { formatISO as Le } from "date-fns/formatISO";
31
31
  import { fromUnixTime as Oe } from "date-fns/fromUnixTime";
32
32
  import { S as ke } from "./SearchBox-B2_zLv8-.mjs";
33
33
  import { h as Ne } from "./DateUtil-BcuH7ErC.mjs";
34
- import { b as z } from "./Category-CevNQ03n.mjs";
35
- import { T as J } from "./Transaction-CyqrHmAA.mjs";
36
- const V = ({
34
+ import { b as B } from "./Category-CevNQ03n.mjs";
35
+ import { T as V } from "./Transaction-CyqrHmAA.mjs";
36
+ const ee = ({
37
37
  frequency: n,
38
38
  firstDay: t,
39
39
  secondDay: r,
40
40
  onFrequencyChange: a,
41
41
  onFirstDayChange: s,
42
- onSecondDayChange: d
42
+ onSecondDayChange: l
43
43
  }) => {
44
44
  const { recurring: o } = w(), i = u.useMemo(
45
45
  () => [
46
- { id: l.EveryWeek, label: o.frequency_every_week },
47
- { id: l.EveryOtherWeek, label: o.frequency_every_other_week },
48
- { id: l.TwiceAMonth, label: o.frequency_twice_a_month },
49
- { id: l.EveryMonth, label: o.frequency_every_month },
50
- { id: l.EveryOtherMonth, label: o.frequency_every_other_month },
51
- { id: l.EveryQuarter, label: o.frequency_every_quarter },
52
- { id: l.EveryOtherQuarter, label: o.frequency_every_other_quarter },
53
- { id: l.EveryYear, label: o.frequency_every_year }
46
+ { id: d.EveryWeek, label: o.frequency_every_week },
47
+ { id: d.EveryOtherWeek, label: o.frequency_every_other_week },
48
+ { id: d.TwiceAMonth, label: o.frequency_twice_a_month },
49
+ { id: d.EveryMonth, label: o.frequency_every_month },
50
+ { id: d.EveryOtherMonth, label: o.frequency_every_other_month },
51
+ { id: d.EveryQuarter, label: o.frequency_every_quarter },
52
+ { id: d.EveryOtherQuarter, label: o.frequency_every_other_quarter },
53
+ { id: d.EveryYear, label: o.frequency_every_year }
54
54
  ],
55
55
  [o]
56
56
  ), m = [
@@ -61,15 +61,15 @@ const V = ({
61
61
  { id: 4, label: o.weekday_thursday },
62
62
  { id: 5, label: o.weekday_friday },
63
63
  { id: 6, label: o.weekday_saturday }
64
- ], h = [...Array(31).keys()].map((p) => ({
65
- id: p + 1,
66
- label: Ie(p + 1)
64
+ ], h = [...Array(31).keys()].map((y) => ({
65
+ id: y + 1,
66
+ label: Ie(y + 1)
67
67
  }));
68
68
  h[30].label += ` (${o.last_day_of_month})`;
69
- const C = h.slice(0, 15), v = h.slice(14), b = n === l.EveryWeek || n === l.EveryOtherWeek, f = n === l.TwiceAMonth || n === l.EveryMonth || n === l.EveryOtherMonth || n === l.EveryQuarter || n === l.EveryOtherQuarter, D = Se(U(), t), g = (p) => {
70
- p && s(be(p));
69
+ const C = h.slice(0, 15), v = h.slice(14), b = n === d.EveryWeek || n === d.EveryOtherWeek, g = n === d.TwiceAMonth || n === d.EveryMonth || n === d.EveryOtherMonth || n === d.EveryQuarter || n === d.EveryOtherQuarter, D = Se(z(), t), f = (y) => {
70
+ y && s(be(y));
71
71
  };
72
- return /* @__PURE__ */ c(y, { gap: 24, sx: { m: 24 }, children: [
72
+ return /* @__PURE__ */ c(p, { gap: 24, sx: { m: 24 }, children: [
73
73
  /* @__PURE__ */ e(
74
74
  N,
75
75
  {
@@ -88,53 +88,53 @@ const V = ({
88
88
  value: t
89
89
  }
90
90
  ),
91
- f && /* @__PURE__ */ e(
91
+ g && /* @__PURE__ */ e(
92
92
  N,
93
93
  {
94
- label: n === l.TwiceAMonth ? o.first_day_of_the_month : o.day_of_the_month,
94
+ label: n === d.TwiceAMonth ? o.first_day_of_the_month : o.day_of_the_month,
95
95
  onChange: s,
96
- options: n === l.TwiceAMonth ? C : h,
96
+ options: n === d.TwiceAMonth ? C : h,
97
97
  value: t
98
98
  }
99
99
  ),
100
- n === l.TwiceAMonth && /* @__PURE__ */ e(
100
+ n === d.TwiceAMonth && /* @__PURE__ */ e(
101
101
  N,
102
102
  {
103
103
  label: o.second_day_of_the_month,
104
- onChange: d,
104
+ onChange: l,
105
105
  options: v,
106
106
  value: r || 0
107
107
  }
108
108
  ),
109
- n === l.EveryYear && /* @__PURE__ */ e(we, { dateAdapter: ve, children: /* @__PURE__ */ e(
109
+ n === d.EveryYear && /* @__PURE__ */ e(we, { dateAdapter: ve, children: /* @__PURE__ */ e(
110
110
  xe,
111
111
  {
112
112
  disablePast: !0,
113
113
  label: o.next_payment_date,
114
- onChange: g,
114
+ onChange: f,
115
115
  value: D
116
116
  }
117
117
  ) })
118
118
  ] });
119
119
  }, Me = A(({ repeatingTransaction: n }) => {
120
- const { recurring: t } = w(), { updateRepeatingTransaction: r } = M(), { onEvent: a } = F(), [s, d] = u.useState(!1), [o, i] = u.useState(n.recurrence_type), [m, h] = u.useState(n.recurrence_day), [C, v] = u.useState(n.second_recurrence_day), b = async () => {
120
+ const { recurring: t } = w(), { updateRepeatingTransaction: r } = M(), { onEvent: a } = F(), [s, l] = u.useState(!1), [o, i] = u.useState(n.recurrence_type), [m, h] = u.useState(n.recurrence_day), [C, v] = u.useState(n.second_recurrence_day), b = async () => {
121
121
  await r({
122
122
  ...n,
123
123
  recurrence_type: o,
124
124
  recurrence_day: m,
125
125
  second_recurrence_day: C
126
- }), d(!1);
127
- }, f = () => {
128
- d(!0), a(T.RECURRING_TRANSACTIONS_DETAILS_CLICK_PAYMENT_SCHEDULE);
126
+ }), l(!1);
127
+ }, g = () => {
128
+ l(!0), a(R.RECURRING_TRANSACTIONS_DETAILS_CLICK_PAYMENT_SCHEDULE);
129
129
  };
130
- return /* @__PURE__ */ c(E, { children: [
130
+ return /* @__PURE__ */ c(L, { children: [
131
131
  /* @__PURE__ */ e(
132
132
  Y,
133
133
  {
134
134
  iconName: "sync",
135
135
  label: t.activity_schedule,
136
- onClick: f,
137
- value: `${Q(t, n, !0)}`
136
+ onClick: g,
137
+ value: `${$(t, n, !0)}`
138
138
  }
139
139
  ),
140
140
  /* @__PURE__ */ e(
@@ -142,11 +142,11 @@ const V = ({
142
142
  {
143
143
  ariaLabelClose: t.close_drawer_aria,
144
144
  isOpen: s,
145
- onClose: () => d(!1),
145
+ onClose: () => l(!1),
146
146
  onPrimaryAction: b,
147
147
  title: t.payment_schedule,
148
148
  children: /* @__PURE__ */ e(
149
- V,
149
+ ee,
150
150
  {
151
151
  firstDay: m,
152
152
  frequency: o,
@@ -161,37 +161,37 @@ const V = ({
161
161
  ] });
162
162
  }), Fe = A(
163
163
  ({ onDeleted: n, recurringTransaction: t }) => {
164
- const { recurring: r } = w(), { selectedAccountGuids: a } = Ae(), { onEvent: s } = F(), { deleteRepeatingTransaction: d } = M(), { setFilter: o, transactions: i } = X(), { amount: m, description: h, merchant_guid: C } = t, [v, b] = u.useState(!1), [f, D] = u.useState("");
164
+ const { recurring: r } = w(), { selectedAccountGuids: a } = Ae(), { onEvent: s } = F(), { deleteRepeatingTransaction: l } = M(), { setFilter: o, transactions: i } = Z(), { amount: m, description: h, merchant_guid: C } = t, [v, b] = u.useState(!1), [g, D] = u.useState("");
165
165
  u.useEffect(() => {
166
166
  o({
167
167
  accounts: a,
168
- dateRange: { start: ue(U(), 90), end: _e(U()) },
168
+ dateRange: { start: ue(z(), 90), end: _e(z()) },
169
169
  custom: (_) => _.repeating_transaction_guid === t.guid
170
170
  });
171
171
  }, [t]);
172
- const g = u.useMemo(
173
- () => i.find((_) => _.guid === f),
174
- [f, i]
175
- ), p = t.repeating_transaction_type === R.Income, k = async () => {
176
- await d(t.guid), n();
172
+ const f = u.useMemo(
173
+ () => i.find((_) => _.guid === g),
174
+ [g, i]
175
+ ), y = t.repeating_transaction_type === E.Income, k = async () => {
176
+ await l(t.guid), n();
177
177
  }, G = () => {
178
- b(!0), s(T.RECURRING_TRANSACTIONS_DETAILS_CLICK_DELETE);
178
+ b(!0), s(R.RECURRING_TRANSACTIONS_DETAILS_CLICK_DELETE);
179
179
  };
180
- return /* @__PURE__ */ c(y, { bgcolor: "background.default", direction: "column", height: "100%", children: [
181
- /* @__PURE__ */ c(y, { direction: "column", m: 24, children: [
180
+ return /* @__PURE__ */ c(p, { bgcolor: "background.default", direction: "column", height: "100%", children: [
181
+ /* @__PURE__ */ c(p, { direction: "column", m: 24, children: [
182
182
  /* @__PURE__ */ e(
183
- j,
183
+ Q,
184
184
  {
185
- categoryGuid: g?.category_guid || "",
185
+ categoryGuid: f?.category_guid || "",
186
186
  merchantGuid: C,
187
187
  size: 64,
188
188
  sx: { mb: 12 }
189
189
  }
190
190
  ),
191
191
  /* @__PURE__ */ e(x, { bold: !0, variant: "body1", children: h }),
192
- /* @__PURE__ */ c(ce, { color: p ? "success.main" : "text.primary", sx: { my: 4 }, children: [
193
- p ? "+" : "",
194
- Z(m, "0,0.00")
192
+ /* @__PURE__ */ c(ce, { color: y ? "success.main" : "text.primary", sx: { my: 4 }, children: [
193
+ y ? "+" : "",
194
+ J(m, "0,0.00")
195
195
  ] }),
196
196
  /* @__PURE__ */ e(x, { color: "text.secondary", variant: "body2", children: `${r.next_payment_date}: ${Ee(
197
197
  t.predicted_occurs_on,
@@ -199,7 +199,7 @@ const V = ({
199
199
  )}` })
200
200
  ] }),
201
201
  /* @__PURE__ */ c(K, { sx: { bgcolor: "background.paper" }, children: [
202
- t.account && /* @__PURE__ */ c(E, { children: [
202
+ t.account && /* @__PURE__ */ c(L, { children: [
203
203
  /* @__PURE__ */ e(
204
204
  Y,
205
205
  {
@@ -208,56 +208,56 @@ const V = ({
208
208
  value: t.account.institutionName || ""
209
209
  }
210
210
  ),
211
- /* @__PURE__ */ e(L, { variant: "inset" })
211
+ /* @__PURE__ */ e(T, { variant: "inset" })
212
212
  ] }),
213
- g?.category && /* @__PURE__ */ c(E, { children: [
213
+ f?.category && /* @__PURE__ */ c(L, { children: [
214
214
  /* @__PURE__ */ e(
215
215
  Y,
216
216
  {
217
217
  iconName: "monetization_on",
218
218
  label: r.category,
219
- value: g.category
219
+ value: f.category
220
220
  }
221
221
  ),
222
- /* @__PURE__ */ e(L, { variant: "inset" })
222
+ /* @__PURE__ */ e(T, { variant: "inset" })
223
223
  ] }),
224
224
  /* @__PURE__ */ e(Me, { repeatingTransaction: t }),
225
- /* @__PURE__ */ e(L, {})
225
+ /* @__PURE__ */ e(T, {})
226
226
  ] }),
227
227
  /* @__PURE__ */ e(
228
- $,
228
+ H,
229
229
  {
230
230
  color: "error",
231
231
  onClick: G,
232
232
  startIcon: /* @__PURE__ */ e(me, {}),
233
233
  sx: { mx: 24, my: 16 },
234
234
  variant: "text",
235
- children: p ? r.delete_income_title : r.delete_expense_title
235
+ children: y ? r.delete_income_title : r.delete_expense_title
236
236
  }
237
237
  ),
238
238
  /* @__PURE__ */ e(x, { bold: !0, sx: { ml: 24, mt: 16 }, variant: "Body", children: r.paid_transactions }),
239
- /* @__PURE__ */ e(H, { height: "30dvh", onClick: D }),
239
+ /* @__PURE__ */ e(X, { height: "30dvh", onClick: D }),
240
240
  /* @__PURE__ */ e(
241
241
  O,
242
242
  {
243
243
  ariaLabelClose: r.close_drawer_aria,
244
- isOpen: !!f && !!g,
244
+ isOpen: !!g && !!f,
245
245
  onClose: () => D(""),
246
246
  title: r.transaction_details_drawer_title,
247
- children: g && /* @__PURE__ */ e(he, { transaction: g })
247
+ children: f && /* @__PURE__ */ e(he, { transaction: f })
248
248
  }
249
249
  ),
250
250
  /* @__PURE__ */ e(
251
251
  Te,
252
252
  {
253
253
  copy: {
254
- title: p ? r.delete_income_title : r.delete_expense_title,
254
+ title: y ? r.delete_income_title : r.delete_expense_title,
255
255
  close_aria: r.close_drawer_aria
256
256
  },
257
257
  isOpen: v,
258
258
  onClose: () => b(!1),
259
259
  onPrimaryAction: k,
260
- children: /* @__PURE__ */ e(x, { children: p ? r.delete_income_description : r.delete_expense_description })
260
+ children: /* @__PURE__ */ e(x, { children: y ? r.delete_income_description : r.delete_expense_description })
261
261
  }
262
262
  )
263
263
  ] });
@@ -265,27 +265,27 @@ const V = ({
265
265
  ), Ge = A(
266
266
  ({ onClick: n = () => {
267
267
  }, repeatingTransaction: t }) => {
268
- const { recurring: r } = w(), [a, s] = u.useState(!1), d = u.useMemo(
268
+ const { recurring: r } = w(), [a, s] = u.useState(!1), l = u.useMemo(
269
269
  () => t.transactions.length === 0 ? "" : t.transactions[0].category_guid || "",
270
270
  [t]
271
- ), o = t.account?.institutionName || "", i = t.repeating_transaction_type === R.Income, m = Q(r, t, !0);
271
+ ), o = t.account?.institutionName || "", i = t.repeating_transaction_type === E.Income, m = $(r, t, !0);
272
272
  return /* @__PURE__ */ c(re, { disableGutters: !0, disablePadding: !0, children: [
273
273
  /* @__PURE__ */ c(ie, { onClick: () => {
274
274
  n(t), s(!0);
275
275
  }, children: [
276
276
  /* @__PURE__ */ e(ae, { children: /* @__PURE__ */ e(
277
- j,
277
+ Q,
278
278
  {
279
- categoryGuid: d,
279
+ categoryGuid: l,
280
280
  merchantGuid: t.merchant_guid
281
281
  }
282
282
  ) }),
283
- /* @__PURE__ */ e(se, { children: /* @__PURE__ */ c(y, { direction: "row", gap: 4, sx: { justifyContent: "space-between" }, children: [
284
- /* @__PURE__ */ c(y, { direction: "column", sx: { width: "50%" }, children: [
283
+ /* @__PURE__ */ e(se, { children: /* @__PURE__ */ c(p, { direction: "row", gap: 4, sx: { justifyContent: "space-between" }, children: [
284
+ /* @__PURE__ */ c(p, { direction: "column", sx: { width: "50%" }, children: [
285
285
  /* @__PURE__ */ e(x, { bold: !0, variant: "body1", children: t.description }),
286
- /* @__PURE__ */ c(y, { alignItems: "center", direction: "row", gap: 6, children: [
286
+ /* @__PURE__ */ c(p, { alignItems: "center", direction: "row", gap: 6, children: [
287
287
  t.account?.institution_guid && /* @__PURE__ */ e(
288
- de,
288
+ le,
289
289
  {
290
290
  alt: o,
291
291
  institutionGuid: t.account?.institution_guid,
@@ -295,7 +295,7 @@ const V = ({
295
295
  /* @__PURE__ */ e(x, { variant: "caption", children: o })
296
296
  ] })
297
297
  ] }),
298
- /* @__PURE__ */ c(y, { alignItems: "flex-end", sx: { width: "50%" }, children: [
298
+ /* @__PURE__ */ c(p, { alignItems: "flex-end", sx: { width: "50%" }, children: [
299
299
  /* @__PURE__ */ c(
300
300
  x,
301
301
  {
@@ -304,12 +304,12 @@ const V = ({
304
304
  variant: "body1",
305
305
  children: [
306
306
  i ? "+" : "",
307
- Z(t.amount, "0,0.00")
307
+ J(t.amount, "0,0.00")
308
308
  ]
309
309
  }
310
310
  ),
311
311
  /* @__PURE__ */ e(
312
- y,
312
+ p,
313
313
  {
314
314
  direction: "row",
315
315
  sx: {
@@ -331,7 +331,7 @@ const V = ({
331
331
  ariaLabelClose: r.close_drawer_aria,
332
332
  isOpen: a,
333
333
  onClose: () => s(!1),
334
- title: t.repeating_transaction_type === R.Income ? r.income_details : r.expense_details,
334
+ title: t.repeating_transaction_type === E.Income ? r.income_details : r.expense_details,
335
335
  children: /* @__PURE__ */ e(
336
336
  Fe,
337
337
  {
@@ -350,9 +350,9 @@ const V = ({
350
350
  onSearch: r,
351
351
  onSelected: a
352
352
  }) => {
353
- const { recurring: s } = w(), { searchValue: d, setSearchValue: o } = fe();
354
- return /* @__PURE__ */ c(y, { sx: { bgcolor: n, gap: 16, pt: 8 }, children: [
355
- t && /* @__PURE__ */ e(P, { sx: { mx: 24 }, children: t }),
353
+ const { recurring: s } = w(), { searchValue: l, setSearchValue: o } = ge();
354
+ return /* @__PURE__ */ c(p, { sx: { bgcolor: n, gap: 16, pt: 8 }, children: [
355
+ t && /* @__PURE__ */ e(U, { sx: { mx: 24 }, children: t }),
356
356
  /* @__PURE__ */ e(
357
357
  ke,
358
358
  {
@@ -362,36 +362,36 @@ const V = ({
362
362
  o(i), r(i);
363
363
  },
364
364
  placeholder: s.select_transaction_search_placeholder,
365
- searchValue: d
365
+ searchValue: l
366
366
  }
367
367
  ),
368
- /* @__PURE__ */ e(H, { bgcolor: n, height: "auto", onClick: a, showLoader: !1 })
368
+ /* @__PURE__ */ e(X, { bgcolor: n, height: "auto", onClick: a, showLoader: !1 })
369
369
  ] });
370
370
  }
371
- ), Ye = A(
371
+ ), Ue = A(
372
372
  ({
373
373
  bgcolor: n = "background.default",
374
374
  firstDay: t,
375
375
  secondDay: r,
376
376
  frequency: a,
377
377
  onFrequencyChange: s,
378
- onFirstDayChange: d,
378
+ onFirstDayChange: l,
379
379
  onSecondDayChange: o,
380
380
  transaction: i
381
381
  }) => {
382
382
  const { recurring: m } = w();
383
- return /* @__PURE__ */ c(y, { bgcolor: n, gap: 24, height: "100%", children: [
384
- /* @__PURE__ */ c(y, { children: [
385
- /* @__PURE__ */ e(ge, { bgcolor: n, children: Ne(i.date) }),
383
+ return /* @__PURE__ */ c(p, { bgcolor: n, gap: 24, height: "100%", children: [
384
+ /* @__PURE__ */ c(p, { children: [
385
+ /* @__PURE__ */ e(fe, { bgcolor: n, children: Ne(i.date) }),
386
386
  /* @__PURE__ */ e(Ce, { transaction: i })
387
387
  ] }),
388
388
  /* @__PURE__ */ e(x, { bold: !0, sx: { mx: 24 }, variant: "Body", children: m.payment_schedule }),
389
389
  /* @__PURE__ */ e(
390
- V,
390
+ ee,
391
391
  {
392
392
  firstDay: t,
393
393
  frequency: a,
394
- onFirstDayChange: d,
394
+ onFirstDayChange: l,
395
395
  onFrequencyChange: s,
396
396
  onSecondDayChange: o,
397
397
  secondDay: r
@@ -399,24 +399,24 @@ const V = ({
399
399
  )
400
400
  ] });
401
401
  }
402
- ), B = (n) => n.top_level_category_guid !== z.INCOME && n.transaction_type === J.DEBIT, Ue = (n, t) => B(n) ? n.payee?.toLowerCase().includes(t.toLowerCase()) || n.description.toLowerCase().includes(t.toLowerCase()) || n.feed_description.toLowerCase().includes(t.toLowerCase()) : !1, q = (n) => n.top_level_category_guid === z.INCOME || n.top_level_category_guid === z.TRANSFER && n.transaction_type === J.CREDIT, ze = (n, t) => q(n) ? n.payee?.toLowerCase().includes(t.toLowerCase()) || n.description?.toLowerCase().includes(t.toLowerCase()) || n.feed_description?.toLowerCase().includes(t.toLowerCase()) : !1, ee = A(
402
+ ), q = (n) => n.top_level_category_guid !== B.INCOME && n.transaction_type === V.DEBIT, Ye = (n, t) => q(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 === B.INCOME || n.top_level_category_guid === B.TRANSFER && n.transaction_type === V.CREDIT, ze = (n, t) => W(n) ? n.payee?.toLowerCase().includes(t.toLowerCase()) || n.description?.toLowerCase().includes(t.toLowerCase()) || n.feed_description?.toLowerCase().includes(t.toLowerCase()) : !1, te = A(
403
403
  ({
404
404
  isIncome: n = !1,
405
405
  label: t,
406
406
  onAddRecurringTransaction: r = () => null
407
407
  }) => {
408
- const { recurring: a } = w(), { filter: s, setFilter: d, transactions: o } = X(), { addRepeatingTransaction: i } = M(), { user: m } = De(), [h, C] = u.useState(!1), [v, b] = u.useState(""), [f, D] = u.useState(l.EveryMonth), [g, p] = u.useState(1), [k, G] = u.useState(15), _ = u.useMemo(
408
+ const { recurring: a } = w(), { filter: s, setFilter: l, transactions: o } = Z(), { addRepeatingTransaction: i } = M(), { user: m } = De(), [h, C] = u.useState(!1), [v, b] = u.useState(""), [g, D] = u.useState(d.EveryMonth), [f, y] = u.useState(1), [k, G] = u.useState(15), _ = u.useMemo(
409
409
  () => o.find((S) => S.guid === v),
410
410
  [v, o]
411
- ), te = () => {
412
- C(!0), d(n ? { ...s, custom: q } : { ...s, custom: B });
413
- }, ne = async () => {
411
+ ), ne = () => {
412
+ C(!0), l(n ? { ...s, custom: W } : { ...s, custom: q });
413
+ }, oe = async () => {
414
414
  if (!_) {
415
- W();
415
+ j();
416
416
  return;
417
417
  }
418
418
  r();
419
- const S = le(f, Oe(_.date)), I = {
419
+ const S = de(g, Oe(_.date)), I = {
420
420
  account_guid: _.account_guid,
421
421
  amount: _.amount,
422
422
  created_by: 0,
@@ -424,19 +424,19 @@ const V = ({
424
424
  merchant_guid: _.merchant_guid,
425
425
  description: _.payee || _.description || _.feed_description,
426
426
  predicted_occurs_on: Le(S, { representation: "date" }),
427
- recurrence_day: g,
428
- recurrence_type: f,
429
- repeating_transaction_type: n ? R.Income : R.Bill,
427
+ recurrence_day: f,
428
+ recurrence_type: g,
429
+ repeating_transaction_type: n ? E.Income : E.Bill,
430
430
  second_recurrence_day: k,
431
431
  transaction_type: _.transaction_type,
432
432
  user_guid: m.guid
433
433
  };
434
- await i(I, _), W();
435
- }, W = () => {
434
+ await i(I, _), j();
435
+ }, j = () => {
436
436
  b(""), C(!1);
437
437
  };
438
- return /* @__PURE__ */ c(E, { children: [
439
- /* @__PURE__ */ e($, { onClick: te, startIcon: /* @__PURE__ */ e(pe, { size: 24 }), variant: "contained", children: t }),
438
+ return /* @__PURE__ */ c(L, { children: [
439
+ /* @__PURE__ */ e(H, { onClick: ne, startIcon: /* @__PURE__ */ e(ye, { size: 24 }), variant: "contained", children: t }),
440
440
  /* @__PURE__ */ e(
441
441
  O,
442
442
  {
@@ -449,9 +449,9 @@ const V = ({
449
449
  {
450
450
  description: n ? a.add_income_description : a.add_expense_description,
451
451
  onSearch: (S) => {
452
- d({
452
+ l({
453
453
  ...s,
454
- custom: (I) => n ? S ? ze(I, S) : q(I) : S ? Ue(I, S) : B(I)
454
+ custom: (I) => n ? S ? ze(I, S) : W(I) : S ? Ye(I, S) : q(I)
455
455
  });
456
456
  },
457
457
  onSelected: (S) => b(S)
@@ -465,14 +465,14 @@ const V = ({
465
465
  ariaLabelClose: a.close_drawer_aria,
466
466
  isOpen: !!v,
467
467
  onClose: () => b(""),
468
- onPrimaryAction: ne,
468
+ onPrimaryAction: oe,
469
469
  title: n ? a.income_details : a.expense_details,
470
470
  children: _ && /* @__PURE__ */ e(
471
- Ye,
471
+ Ue,
472
472
  {
473
- firstDay: g,
474
- frequency: f,
475
- onFirstDayChange: p,
473
+ firstDay: f,
474
+ frequency: g,
475
+ onFirstDayChange: y,
476
476
  onFrequencyChange: D,
477
477
  onSecondDayChange: G,
478
478
  secondDay: k,
@@ -485,19 +485,19 @@ const V = ({
485
485
  }
486
486
  ), Be = A(
487
487
  ({ zeroStateFor: n }) => {
488
- const { recurring: t } = w(), { onEvent: r } = F(), a = n === "income", s = a ? t.recurring_setting_zero_state_income_title : t.recurring_setting_zero_state_expenses_title, d = a ? t.recurring_setting_zero_state_income_description : t.recurring_setting_zero_state_expenses_description, o = a ? t.add_income : t.add_expense;
489
- return /* @__PURE__ */ c(y, { sx: { alignItems: "center", p: 24, pt: 48 }, children: [
490
- /* @__PURE__ */ e(ye, { size: 48 }),
491
- /* @__PURE__ */ e(P, { sx: { my: 8, fontWeight: 600 }, variant: "body1", children: s }),
492
- /* @__PURE__ */ e(P, { color: "text.secondary", sx: { mb: 32 }, variant: "subtitle2", children: d }),
488
+ const { recurring: t } = w(), { onEvent: r } = F(), a = n === "income", s = a ? t.recurring_setting_zero_state_income_title : t.recurring_setting_zero_state_expenses_title, l = a ? t.recurring_setting_zero_state_income_description : t.recurring_setting_zero_state_expenses_description, o = a ? t.add_income : t.add_expense;
489
+ return /* @__PURE__ */ c(p, { sx: { alignItems: "center", p: 24, pt: 48 }, children: [
490
+ /* @__PURE__ */ e(pe, { size: 48 }),
491
+ /* @__PURE__ */ e(U, { sx: { my: 8, fontWeight: 600 }, variant: "body1", children: s }),
492
+ /* @__PURE__ */ e(U, { color: "text.secondary", sx: { mb: 32 }, variant: "subtitle2", children: l }),
493
493
  /* @__PURE__ */ e(
494
- ee,
494
+ te,
495
495
  {
496
496
  isIncome: a,
497
497
  label: o,
498
498
  onAddRecurringTransaction: () => {
499
499
  r(
500
- a ? T.RECURRING_TRANSACTIONS_CLICK_ADD_INCOME : T.RECURRING_ACTIVITY_CLICK_ADD_EXPENSE
500
+ a ? R.RECURRING_TRANSACTIONS_CLICK_ADD_INCOME : R.RECURRING_ACTIVITY_CLICK_ADD_EXPENSE
501
501
  );
502
502
  }
503
503
  }
@@ -506,69 +506,67 @@ const V = ({
506
506
  }
507
507
  ), wt = A(({ forOverview: n = !1 }) => {
508
508
  const { recurring: t } = w(), { repeatingTransactions: r } = M(), { onEvent: a } = F(), s = (i) => {
509
- a(T.RECURRING_TRANSACTIONS_CLICK_INCOME, {
509
+ a(R.RECURRING_TRANSACTIONS_CLICK_INCOME, {
510
510
  repeating_transaction_guid: i.guid
511
511
  });
512
- }, d = () => {
513
- a(T.RECURRING_TRANSACTIONS_CLICK_ADD_INCOME);
512
+ }, l = () => {
513
+ a(R.RECURRING_TRANSACTIONS_CLICK_ADD_INCOME);
514
514
  }, o = r.filter(
515
- (i) => i.repeating_transaction_type === R.Income && (i.transactions.length > 0 || i.recurrence_type === l.EveryYear)
515
+ (i) => i.repeating_transaction_type === E.Income && (i.transactions.length > 0 || i.recurrence_type === d.EveryYear)
516
516
  );
517
- return /* @__PURE__ */ e(E, { children: o.length !== 0 ? /* @__PURE__ */ c(E, { children: [
518
- /* @__PURE__ */ e(
519
- oe,
520
- {
521
- sx: {
522
- height: n ? "calc(100% - 106px)" : "calc(100% - 126px)",
523
- overflowY: "auto"
524
- },
525
- children: /* @__PURE__ */ e(K, { sx: { bgcolor: "background.paper" }, children: o.map((i, m) => /* @__PURE__ */ c(u.Fragment, { children: [
517
+ return /* @__PURE__ */ e(L, { children: o.length !== 0 ? /* @__PURE__ */ c(
518
+ p,
519
+ {
520
+ sx: {
521
+ justifyContent: "space-between",
522
+ height: n ? "calc(100% - 32px)" : "calc(100% - 57px)"
523
+ },
524
+ children: [
525
+ /* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(K, { sx: { bgcolor: "background.paper" }, children: o.map((i, m) => /* @__PURE__ */ c(u.Fragment, { children: [
526
526
  /* @__PURE__ */ e(Ge, { onClick: s, repeatingTransaction: i }),
527
527
  /* @__PURE__ */ e(
528
- L,
528
+ T,
529
529
  {
530
530
  variant: m < o.length - 1 ? "inset" : "fullWidth"
531
531
  }
532
532
  )
533
- ] }, i.guid)) })
534
- }
535
- ),
536
- /* @__PURE__ */ e(L, {}),
537
- /* @__PURE__ */ e(
538
- y,
539
- {
540
- direction: "row",
541
- sx: {
542
- alignContent: "center",
543
- bgcolor: "background.paper",
544
- bottom: 0,
545
- height: 68,
546
- justifyContent: "flex-end",
547
- position: "absolute",
548
- px: 24,
549
- py: 12,
550
- width: "100%"
551
- },
552
- children: /* @__PURE__ */ e(
553
- ee,
554
- {
555
- isIncome: !0,
556
- label: t.add_income,
557
- onAddRecurringTransaction: d
558
- }
559
- )
560
- }
561
- )
562
- ] }) : /* @__PURE__ */ e(Be, { zeroStateFor: "income" }) });
533
+ ] }, i.guid)) }) }),
534
+ /* @__PURE__ */ c(P, { children: [
535
+ /* @__PURE__ */ e(T, {}),
536
+ /* @__PURE__ */ e(
537
+ P,
538
+ {
539
+ sx: {
540
+ alignContent: "center",
541
+ bgcolor: "background.paper",
542
+ justifyContent: "flex-end",
543
+ px: 24,
544
+ py: 12,
545
+ textAlign: "right"
546
+ },
547
+ children: /* @__PURE__ */ e(
548
+ te,
549
+ {
550
+ isIncome: !0,
551
+ label: t.add_income,
552
+ onAddRecurringTransaction: l
553
+ }
554
+ )
555
+ }
556
+ )
557
+ ] })
558
+ ]
559
+ }
560
+ ) : /* @__PURE__ */ e(Be, { zeroStateFor: "income" }) });
563
561
  });
564
562
  export {
565
- ee as A,
563
+ te as A,
566
564
  wt as M,
567
565
  Ge as R,
568
566
  Pe as S,
569
567
  Be as a,
570
568
  Fe as b,
571
- Ye as c,
572
- q as d,
569
+ Ue as c,
570
+ W as d,
573
571
  ze as i
574
572
  };
@@ -0,0 +1,79 @@
1
+ import { jsx as e, Fragment as b, jsxs as t } from "react/jsx-runtime";
2
+ import m from "react";
3
+ import { observer as u } from "mobx-react-lite";
4
+ import c from "@mui/material/Box";
5
+ import p from "@mui/material/Tab";
6
+ import R from "@mui/material/Tabs";
7
+ import l from "@mui/material/Divider";
8
+ import T from "@mui/material/List";
9
+ import C from "@mui/material/Stack";
10
+ import { R as x, A as S, a as E, M as A } from "./ManageIncome-DT62iZim.mjs";
11
+ import { u as h, h as y, e as _ } from "./hooks-02T565vf.mjs";
12
+ import { R as v, F as N } from "./RepeatingTransaction-BW4J-jeJ.mjs";
13
+ import { A as d } from "./WidgetContainer-BG-fdDOf.mjs";
14
+ const I = u(() => {
15
+ const { recurring: r } = h(), { repeatingTransactions: s } = y(), { onEvent: o } = _(), a = (n) => {
16
+ o(d.RECURRING_TRANSACTIONS_CLICK_EXPENSE, {
17
+ repeating_transaction_guid: n.guid
18
+ });
19
+ }, g = () => {
20
+ o(d.RECURRING_TRANSACTIONS_CLICK_ADD_EXPENSE);
21
+ }, i = s.filter(
22
+ (n) => n.repeating_transaction_type !== v.Income && (n.transactions.length > 0 || n.recurrence_type === N.EveryYear)
23
+ );
24
+ return /* @__PURE__ */ e(b, { children: i.length !== 0 ? /* @__PURE__ */ t(C, { sx: { justifyContent: "space-between", height: "calc(100% - 57px)" }, children: [
25
+ /* @__PURE__ */ e(T, { sx: { bgcolor: "background.paper" }, children: i.map((n, f) => /* @__PURE__ */ t(m.Fragment, { children: [
26
+ /* @__PURE__ */ e(x, { onClick: a, repeatingTransaction: n }),
27
+ /* @__PURE__ */ e(
28
+ l,
29
+ {
30
+ variant: f < i.length - 1 ? "inset" : "fullWidth"
31
+ }
32
+ )
33
+ ] }, n.guid)) }),
34
+ /* @__PURE__ */ t(c, { children: [
35
+ /* @__PURE__ */ e(l, {}),
36
+ /* @__PURE__ */ e(
37
+ c,
38
+ {
39
+ sx: {
40
+ alignContent: "center",
41
+ bgcolor: "background.paper",
42
+ justifyContent: "flex-end",
43
+ px: 24,
44
+ py: 12,
45
+ textAlign: "right"
46
+ },
47
+ children: /* @__PURE__ */ e(S, { label: r.add_expense, onAddRecurringTransaction: g })
48
+ }
49
+ )
50
+ ] })
51
+ ] }) : /* @__PURE__ */ e(E, { zeroStateFor: "expenses" }) });
52
+ }), X = u(() => {
53
+ const [r, s] = m.useState(0), { onEvent: o } = _(), { recurring: a } = h();
54
+ return /* @__PURE__ */ t(c, { bgcolor: "background.default", height: "100%", children: [
55
+ /* @__PURE__ */ t(
56
+ R,
57
+ {
58
+ onChange: (i, n) => {
59
+ s(n), o(
60
+ n === 0 ? "recurring_transactions_widget_manage_expenses" : "recurring_transactions_widget_edit_income"
61
+ );
62
+ },
63
+ sx: { bgcolor: "background.paper" },
64
+ value: r,
65
+ variant: "fullWidth",
66
+ children: [
67
+ /* @__PURE__ */ e(p, { label: a.expenses }),
68
+ /* @__PURE__ */ e(p, { label: a.income })
69
+ ]
70
+ }
71
+ ),
72
+ r === 0 && /* @__PURE__ */ e(I, {}),
73
+ r === 1 && /* @__PURE__ */ e(A, {})
74
+ ] });
75
+ });
76
+ export {
77
+ I as M,
78
+ X as R
79
+ };
@@ -46,7 +46,7 @@ import { u as Qe, b as et } from "../CategorySelectorDrawer-Dyzb3UDU.mjs";
46
46
  import Te from "@mui/material/CardHeader";
47
47
  import { subDays as tt } from "date-fns/subDays";
48
48
  import nt from "@mui/material/IconButton";
49
- import { M as ot } from "../ManageIncome-DG7a42eZ.mjs";
49
+ import { M as ot } from "../ManageIncome-DT62iZim.mjs";
50
50
  const ye = 5, at = 100, rt = 25, st = (t) => {
51
51
  const o = (a) => {
52
52
  a.active || t.alphaTarget(0.3).restart(), a.subject.fx = a.subject.x, a.subject.fy = a.subject.y;
@@ -942,8 +942,8 @@ const ht = ({
942
942
  isOpen: f,
943
943
  onClose: () => _(!1),
944
944
  title: n.manage_income,
945
- children: /* @__PURE__ */ d(b, { gap: 4, sx: { height: "100%" }, children: [
946
- /* @__PURE__ */ e(p, { bold: !0, sx: { mt: 12, mx: 24 }, variant: "Small", children: s.income_title }),
945
+ children: /* @__PURE__ */ d(b, { sx: { height: "100%" }, children: [
946
+ /* @__PURE__ */ e(p, { bold: !0, sx: { mb: 4, mt: 12, mx: 24 }, variant: "Small", children: s.income_title }),
947
947
  /* @__PURE__ */ e(ot, { forOverview: !0 })
948
948
  ] })
949
949
  }
@@ -17,7 +17,7 @@ import { I as ue } from "../CashflowStore-D9Dpuz7X.mjs";
17
17
  import { C as Wn } from "../CashflowStore-D9Dpuz7X.mjs";
18
18
  import { b as q } from "../Localization-2MODESHW.mjs";
19
19
  import { M as Qe } from "../MiniWidgetContainer-DqKQNubH.mjs";
20
- import { R as Ve } from "../RecurringSettings-BkzYDzmO.mjs";
20
+ import { R as Ve } from "../RecurringSettings-D8XKxI2O.mjs";
21
21
  import Ke from "@mui/material/Tabs";
22
22
  import Ce from "@mui/material/Tab";
23
23
  import { getUnixTime as B } from "date-fns/getUnixTime";
@@ -34,7 +34,7 @@ import { addDays as _e } from "date-fns/addDays";
34
34
  import { alpha as et, keyframes as tt } from "@mui/material/styles";
35
35
  import { DataGridPro as nt } from "@mui/x-data-grid-pro";
36
36
  import { T as we } from "../TabContentContainer-j01JYR_7.mjs";
37
- import { M as ot, S as it, i as at, d as Se, c as rt } from "../ManageIncome-DG7a42eZ.mjs";
37
+ import { M as ot, S as it, i as at, d as Se, c as rt } from "../ManageIncome-DT62iZim.mjs";
38
38
  import { D as $e } from "../Drawer-kEE73B87.mjs";
39
39
  import { formatISO as st } from "date-fns/formatISO";
40
40
  import { fromUnixTime as ye } from "date-fns/fromUnixTime";
@@ -30,7 +30,7 @@ import Ue from "@mui/material/AccordionSummary";
30
30
  import Ve from "@mui/material/CardHeader";
31
31
  import { u as Ye } from "../useDimensions-27p2evRx.mjs";
32
32
  import { C as qe } from "../ConnectionsDrawer-Czp-E0-m.mjs";
33
- import { R as Je } from "../RecurringSettings-BkzYDzmO.mjs";
33
+ import { R as Je } from "../RecurringSettings-D8XKxI2O.mjs";
34
34
  import Qe from "@mui/material/TextField";
35
35
  import { u as xe } from "../useScreenSize-B6JyS_Lj.mjs";
36
36
  import { a as Ze } from "../Dialog-CWW597AF.mjs";
@@ -8,8 +8,8 @@ import { startOfToday as le } from "date-fns/startOfToday";
8
8
  import { subDays as de } from "date-fns/subDays";
9
9
  import re from "@mui/material/Skeleton";
10
10
  import c from "@mui/material/Stack";
11
- import { R as He } from "../RecurringSettings-BkzYDzmO.mjs";
12
- import { M as An } from "../RecurringSettings-BkzYDzmO.mjs";
11
+ import { R as He } from "../RecurringSettings-D8XKxI2O.mjs";
12
+ import { M as An } from "../RecurringSettings-D8XKxI2O.mjs";
13
13
  import { addMonths as ze } from "date-fns/addMonths";
14
14
  import { subMonths as Be } from "date-fns/subMonths";
15
15
  import { isBefore as Ue } from "date-fns/isBefore";
@@ -41,8 +41,8 @@ import ct from "@mui/material/ListSubheader";
41
41
  import lt from "@mui/material/ListItemAvatar";
42
42
  import dt from "@mui/material/ListItemButton";
43
43
  import ut from "@mui/material/ListItemText";
44
- import { b as mt } from "../ManageIncome-DG7a42eZ.mjs";
45
- import { c as On, M as kn, S as Wn } from "../ManageIncome-DG7a42eZ.mjs";
44
+ import { b as mt } from "../ManageIncome-DT62iZim.mjs";
45
+ import { c as On, M as kn, S as Wn } from "../ManageIncome-DT62iZim.mjs";
46
46
  import { f as L } from "../NumberFormatting-CtWHhyBX.mjs";
47
47
  import { D as Ae } from "../Drawer-kEE73B87.mjs";
48
48
  import { b as N } from "../Localization-2MODESHW.mjs";
@@ -161,7 +161,7 @@ const Ne = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
161
161
  top_level_category_guid: I
162
162
  });
163
163
  const v = Q(new Date(H, x - 1), z.MONTH_SHORT);
164
- return f[A][v] || (f[A][v] = 0), f[A][v] = f[A][v] + E, f;
164
+ return f[A][v] || (f[A][v] = 0), f[A][v] = f[A][v] + Math.abs(E), f;
165
165
  },
166
166
  {}
167
167
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mx-cartographer/experiences",
3
- "version": "7.0.4",
3
+ "version": "7.0.6-alpha.al0",
4
4
  "description": "Library containing experience widgets",
5
5
  "author": "MX",
6
6
  "license": "MIT",
@@ -1,81 +0,0 @@
1
- import { jsx as e, Fragment as g, jsxs as i } from "react/jsx-runtime";
2
- import m from "react";
3
- import { observer as u } from "mobx-react-lite";
4
- import h from "@mui/material/Box";
5
- import p from "@mui/material/Tab";
6
- import R from "@mui/material/Tabs";
7
- import l from "@mui/material/Divider";
8
- import T from "@mui/material/List";
9
- import C from "@mui/material/Stack";
10
- import { R as S, A as x, a as E, M as A } from "./ManageIncome-DG7a42eZ.mjs";
11
- import { u as _, h as v, e as b } from "./hooks-02T565vf.mjs";
12
- import { R as y, F as N } from "./RepeatingTransaction-BW4J-jeJ.mjs";
13
- import { A as d } from "./WidgetContainer-BG-fdDOf.mjs";
14
- const I = u(() => {
15
- const { recurring: n } = _(), { repeatingTransactions: s } = v(), { onEvent: t } = b(), o = (r) => {
16
- t(d.RECURRING_TRANSACTIONS_CLICK_EXPENSE, {
17
- repeating_transaction_guid: r.guid
18
- });
19
- }, c = () => {
20
- t(d.RECURRING_TRANSACTIONS_CLICK_ADD_EXPENSE);
21
- }, a = s.filter(
22
- (r) => r.repeating_transaction_type !== y.Income && (r.transactions.length > 0 || r.recurrence_type === N.EveryYear)
23
- );
24
- return /* @__PURE__ */ e(g, { children: a.length !== 0 ? /* @__PURE__ */ i(g, { children: [
25
- /* @__PURE__ */ e(h, { sx: { height: "calc(100% - 126px)", overflowY: "auto" }, children: /* @__PURE__ */ e(T, { sx: { bgcolor: "background.paper" }, children: a.map((r, f) => /* @__PURE__ */ i(m.Fragment, { children: [
26
- /* @__PURE__ */ e(S, { onClick: o, repeatingTransaction: r }),
27
- /* @__PURE__ */ e(
28
- l,
29
- {
30
- variant: f < a.length - 1 ? "inset" : "fullWidth"
31
- }
32
- )
33
- ] }, r.guid)) }) }),
34
- /* @__PURE__ */ e(l, {}),
35
- /* @__PURE__ */ e(
36
- C,
37
- {
38
- direction: "row",
39
- sx: {
40
- alignContent: "center",
41
- bgcolor: "background.paper",
42
- bottom: 0,
43
- height: 68,
44
- justifyContent: "flex-end",
45
- position: "absolute",
46
- px: 24,
47
- py: 12,
48
- width: "100%"
49
- },
50
- children: /* @__PURE__ */ e(x, { label: n.add_expense, onAddRecurringTransaction: c })
51
- }
52
- )
53
- ] }) : /* @__PURE__ */ e(E, { zeroStateFor: "expenses" }) });
54
- }), W = u(() => {
55
- const [n, s] = m.useState(0), { onEvent: t } = b(), { recurring: o } = _();
56
- return /* @__PURE__ */ i(h, { bgcolor: "background.default", height: "100%", children: [
57
- /* @__PURE__ */ i(
58
- R,
59
- {
60
- onChange: (a, r) => {
61
- s(r), t(
62
- r === 0 ? "recurring_transactions_widget_manage_expenses" : "recurring_transactions_widget_edit_income"
63
- );
64
- },
65
- sx: { bgcolor: "background.paper" },
66
- value: n,
67
- variant: "fullWidth",
68
- children: [
69
- /* @__PURE__ */ e(p, { label: o.expenses }),
70
- /* @__PURE__ */ e(p, { label: o.income })
71
- ]
72
- }
73
- ),
74
- n === 0 && /* @__PURE__ */ e(I, {}),
75
- n === 1 && /* @__PURE__ */ e(A, {})
76
- ] });
77
- });
78
- export {
79
- I as M,
80
- W as R
81
- };