@mx-cartographer/experiences 8.0.0-alpha.bb4 → 8.0.0-alpha.mega1

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 (154) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/dist/{Account-B4CDD-zq.mjs → Account-CvR2-dSR.mjs} +1 -1
  3. package/dist/AccountDetailsContent-CitErkuS.mjs +686 -0
  4. package/dist/{AccountDetailsHeader-DRjFuyJT.mjs → AccountDetailsHeader-BkG3MNYo.mjs} +19 -19
  5. package/dist/{AccountFields-Cl4KHoSj.mjs → AccountFields-zCMqet85.mjs} +10 -12
  6. package/dist/AccountListItem-DHrz8Mml.mjs +90 -0
  7. package/dist/{AccountStore-HbVblv86.mjs → AccountStore-LgfBcYMe.mjs} +101 -75
  8. package/dist/Accounts-Bzy1_REQ.mjs +9 -0
  9. package/dist/{BudgetUtil-Jv8h9H9l.mjs → BudgetUtil-BmZXkL0C.mjs} +32 -32
  10. package/dist/{CashflowStore-CA190BPF.mjs → CashflowStore-D9Dpuz7X.mjs} +25 -18
  11. package/dist/{Category-Ccoew_sA.mjs → Category-CevNQ03n.mjs} +2 -2
  12. package/dist/{CategorySelectorDrawer-Dl006GKy.mjs → CategorySelectorDrawer-B-I3kajA.mjs} +27 -27
  13. package/dist/CategoryStore-CA3tS1BO.mjs +186 -0
  14. package/dist/CategoryUtil-DUM8NuGO.mjs +78 -0
  15. package/dist/{ConnectDrawer-DVp54lUH.mjs → ConnectDrawer-BkvlItWx.mjs} +55 -56
  16. package/dist/{ConnectionsDrawer-Dsc04-4Z.mjs → ConnectionsDrawer-VmuVFHbL.mjs} +5 -5
  17. package/dist/CurrencyInput-itK0R3wV.mjs +85 -0
  18. package/dist/{DateUtil-CDPZw_-m.mjs → DateUtil-CBdcsyuk.mjs} +1 -1
  19. package/dist/{DebtsStore-pL63fmdT.mjs → DebtsStore-Bq-aPy-5.mjs} +3 -3
  20. package/dist/{Dialog-CDV0kKxj.mjs → Dialog-BPTr3qHE.mjs} +24 -24
  21. package/dist/Drawer-By9V-B5L.mjs +178 -0
  22. package/dist/{ExportCsvAction-QhQK4_FU.mjs → ExportCsvAction-Cglo8Mca.mjs} +4 -4
  23. package/dist/{FinstrongStore-BGf36b0z.mjs → FinstrongStore-BIrX0Xg2.mjs} +56 -56
  24. package/dist/{GoalStore-C1-w3Y1E.mjs → GoalStore-1P19goZ7.mjs} +111 -151
  25. package/dist/HeaderCell-DjuifqHJ.mjs +6 -0
  26. package/dist/{Help-c-zHlDbv.mjs → Help-DhcC-C05.mjs} +8 -8
  27. package/dist/{Help-DBfsTkAi.mjs → Help-Ea3BlXQp.mjs} +146 -125
  28. package/dist/{IconBacking-DgT8DCeh.mjs → IconBacking-B9oC6uL2.mjs} +11 -11
  29. package/dist/LineChart-KpPw1phO.mjs +580 -0
  30. package/dist/{ListItemAction-BNCWQAN_.mjs → ListItemAction-BxTkF6Tz.mjs} +2 -2
  31. package/dist/Loader-DUaFpDGv.mjs +24 -0
  32. package/dist/{ManageIncome-8EsStyIQ.mjs → ManageIncome-CaoQl609.mjs} +142 -142
  33. package/dist/MicroWidgetContainer-r6mtxRer.mjs +52 -0
  34. package/dist/MiniWidgetContainer-Bg02sF1Y.mjs +71 -0
  35. package/dist/{NetWorthStore-Bti6u-d9.mjs → NetWorthStore-rC0q7P7t.mjs} +4 -4
  36. package/dist/NotificationSettings-uzM8tCoH.mjs +674 -0
  37. package/dist/{NotificationStore-Ck2KdNmT.mjs → NotificationStore-CDX_kqHa.mjs} +14 -22
  38. package/dist/{OriginalBalanceAction-2Y_3U_mg.mjs → OriginalBalanceAction-C6jdS4ws.mjs} +9 -9
  39. package/dist/{RecurringSettings-DAncu--R.mjs → RecurringSettings-B4ybrS0B.mjs} +17 -17
  40. package/dist/{RecurringTransactions-CxcSL1dY.mjs → RecurringTransactions-BqijW_8S.mjs} +79 -79
  41. package/dist/{RecurringTransactionsStore-CNFxyGB6.mjs → RecurringTransactionsStore-BhBUVm9a.mjs} +81 -91
  42. package/dist/{ResponsiveButton-Cn6-R7ue.mjs → ResponsiveButton-DZFp78fJ.mjs} +10 -10
  43. package/dist/SearchBox-B2_zLv8-.mjs +42 -0
  44. package/dist/{SettingsStore-BASMQSIp.mjs → SettingsStore-krIRNwHK.mjs} +1 -1
  45. package/dist/{SingleSegmentDonut-7Uy6VEld.mjs → SingleSegmentDonut-BgbLgwHi.mjs} +6 -6
  46. package/dist/SpendingData-DQ1b9uqq.mjs +53 -0
  47. package/dist/{SpendingLegend-6FqtMcBV.mjs → SpendingLegend-CDO060GT.mjs} +65 -65
  48. package/dist/{StatusBar-CPfSXe80.mjs → StatusBar-BK_uYHAB.mjs} +6 -6
  49. package/dist/{TabContentContainer-CnMXkVqr.mjs → TabContentContainer-j01JYR_7.mjs} +8 -8
  50. package/dist/TransactionDetails-m5PddMQn.mjs +1380 -0
  51. package/dist/TransactionStore-PRlwE-TF.mjs +677 -0
  52. package/dist/TrendsStore-yO7qYv97.mjs +186 -0
  53. package/dist/{User-BklmOUSd.mjs → User-Cnlegl1N.mjs} +107 -107
  54. package/dist/{ViewMoreMicroCard-DAkyNRlD.mjs → ViewMoreMicroCard-DwR0v_ll.mjs} +211 -205
  55. package/dist/{WidgetContainer-CDh9fjpR.mjs → WidgetContainer-CoFDmQRE.mjs} +36 -36
  56. package/dist/accounts/index.es.js +200 -197
  57. package/dist/accounts/stores/AccountStore.d.ts +22 -25
  58. package/dist/accounts/utils/Accounts.d.ts +1 -2
  59. package/dist/analytics/index.es.js +27 -27
  60. package/dist/budgets/components/AddBudgets.d.ts +2 -1
  61. package/dist/budgets/index.es.js +703 -669
  62. package/dist/budgets/store/BudgetsStore.d.ts +0 -1
  63. package/dist/cashflow/index.es.js +420 -404
  64. package/dist/categories/index.es.js +2 -2
  65. package/dist/categories/stores/CategoryStore.d.ts +3 -6
  66. package/dist/categories/util/CategoryUtil.d.ts +2 -3
  67. package/dist/common/components/ErrorBoundary.d.ts +1 -1
  68. package/dist/common/components/Loader.d.ts +2 -1
  69. package/dist/common/components/accountfilter/AccountFilterOptions.d.ts +1 -1
  70. package/dist/common/components/barchart/Bar.d.ts +25 -0
  71. package/dist/common/components/barchart/BarChart.d.ts +34 -0
  72. package/dist/common/components/barchart/BarColumn.d.ts +37 -0
  73. package/dist/common/components/barchart/Legend.d.ts +8 -0
  74. package/dist/common/components/barchart/Util.d.ts +42 -0
  75. package/dist/common/components/barchart/index.d.ts +1 -0
  76. package/dist/common/components/charts/linechart/CustomMark.d.ts +1 -1
  77. package/dist/common/components/charts/linechart/CustomTooltip.d.ts +6 -1
  78. package/dist/common/components/charts/stackedlinechart/CustomPointTooltip.d.ts +5 -2
  79. package/dist/common/components/index.d.ts +1 -0
  80. package/dist/common/hooks/index.d.ts +2 -0
  81. package/dist/common/hooks/useAriaLive.d.ts +1 -1
  82. package/dist/common/hooks/usePrevious.d.ts +2 -0
  83. package/dist/common/hooks/useWidgetLoadTimer.d.ts +6 -0
  84. package/dist/common/index.es.js +712 -436
  85. package/dist/common/stores/AppDataStore.d.ts +1 -3
  86. package/dist/common/stores/GlobalCopyStore.d.ts +1 -0
  87. package/dist/common/stores/GlobalStore.d.ts +3 -3
  88. package/dist/common/stores/GlobalUiStore.d.ts +2 -3
  89. package/dist/common/stores/UserStore.d.ts +2 -3
  90. package/dist/common/types/Account.d.ts +6 -9
  91. package/dist/common/types/localization/TransactionsCopy.d.ts +1 -0
  92. package/dist/common/utils/Theme.d.ts +3 -1
  93. package/dist/dashboard/index.es.js +93 -91
  94. package/dist/debts/components/DebtsChart.d.ts +2 -1
  95. package/dist/debts/index.es.js +529 -527
  96. package/dist/{exportTransactionsToCSV-BgV_wTLT.mjs → exportTransactionsToCSV-DuAaI5XA.mjs} +3 -3
  97. package/dist/finstrong/components/shared/CustomDoubleBarPlot.d.ts +4 -5
  98. package/dist/finstrong/index.es.js +876 -867
  99. package/dist/goals/index.es.js +526 -525
  100. package/dist/goals/stores/GoalStore.d.ts +4 -17
  101. package/dist/help/components/content/BottomImageContent.d.ts +1 -1
  102. package/dist/help/components/content/LeftImageContent.d.ts +1 -1
  103. package/dist/help/components/content/RightImageContent.d.ts +1 -1
  104. package/dist/help/components/content/TopImageContent.d.ts +1 -1
  105. package/dist/help/index.es.js +13 -9
  106. package/dist/{hooks-C41HAxM5.mjs → hooks-ZMp65DFz.mjs} +11 -11
  107. package/dist/investments/index.es.js +534 -531
  108. package/dist/investments/stores/HoldingStore.d.ts +0 -1
  109. package/dist/merchants/index.es.js +8 -8
  110. package/dist/microinsights/MicroCardTemplate.d.ts +16 -0
  111. package/dist/microinsights/index.d.ts +1 -0
  112. package/dist/microinsights/index.es.js +101 -14
  113. package/dist/networth/components/NetWorthChange.d.ts +1 -3
  114. package/dist/networth/index.es.js +284 -285
  115. package/dist/notifications/index.es.js +95 -94
  116. package/dist/notifications/stores/NotificationStore.d.ts +1 -3
  117. package/dist/recurringtransactions/index.es.js +582 -562
  118. package/dist/recurringtransactions/stores/RecurringTransactionsStore.d.ts +2 -4
  119. package/dist/settings/index.es.js +340 -337
  120. package/dist/spending/index.es.js +281 -268
  121. package/dist/transactions/components/shared/transactionlist/DateRow.d.ts +7 -0
  122. package/dist/transactions/index.es.js +253 -255
  123. package/dist/transactions/stores/TransactionStore.d.ts +77 -21
  124. package/dist/transactions/stores/UiStore.d.ts +2 -0
  125. package/dist/trends/components/TrendsTable.d.ts +0 -2
  126. package/dist/trends/index.es.js +838 -793
  127. package/dist/trends/utils/TrendsData.d.ts +1 -0
  128. package/dist/{useAccountDisplayName-CcIp09Xc.mjs → useAccountDisplayName-B7iXTNM8.mjs} +2 -2
  129. package/dist/{useCombineEvents-kNzLTWCp.mjs → useCombineEvents-CRwX-qWE.mjs} +2 -2
  130. package/dist/{useInsightsEnabled-CNjP5cfR.mjs → useInsightsEnabled-B7dxpDrX.mjs} +1 -1
  131. package/dist/{useScreenSize-B5afALev.mjs → useScreenSize-B6JyS_Lj.mjs} +1 -1
  132. package/dist/useWidgetLoadTimer-hIOioiKx.mjs +19 -0
  133. package/package.json +57 -52
  134. package/dist/AccountDetailsContent-adZTkM52.mjs +0 -683
  135. package/dist/AccountListItem-wgmlex-_.mjs +0 -90
  136. package/dist/Accounts-CRUehOiy.mjs +0 -27
  137. package/dist/CategoryStore-MUwRWH9e.mjs +0 -176
  138. package/dist/CategoryUtil-DfVKKkRf.mjs +0 -80
  139. package/dist/CurrencyInput-D1cjbdCI.mjs +0 -85
  140. package/dist/Drawer-BF40nbsH.mjs +0 -163
  141. package/dist/HeaderCell-P8w6CmfO.mjs +0 -6
  142. package/dist/LineChart-C1PxNf7P.mjs +0 -581
  143. package/dist/Loader-Ckqi9Rx6.mjs +0 -21
  144. package/dist/MicroWidgetContainer-BGpNl5ZS.mjs +0 -45
  145. package/dist/MiniWidgetContainer-CKzf_Ira.mjs +0 -56
  146. package/dist/NotificationSettings-B74rQVYC.mjs +0 -672
  147. package/dist/SearchBox-B7km148n.mjs +0 -39
  148. package/dist/SkeletonLoader-BaNboJjD.mjs +0 -38
  149. package/dist/SpendingData-DPQ96k3x.mjs +0 -55
  150. package/dist/TransactionDetails-Bn0qY5Hw.mjs +0 -1336
  151. package/dist/TransactionStore-DbwAutwC.mjs +0 -671
  152. package/dist/TrendsStore-_mRaFUdf.mjs +0 -182
  153. package/dist/common/components/SkeletonLoader.d.ts +0 -7
  154. package/dist/recurringtransactions/components/MicroWidgetContent.d.ts +0 -3
@@ -1,671 +0,0 @@
1
- import { jsx as g } from "react/jsx-runtime";
2
- import x from "@mui/material/Box";
3
- import P from "@mui/material/FormControlLabel";
4
- import H from "@mui/material/Radio";
5
- import { useTheme as K } from "@mui/material/styles";
6
- import U from "@mui/material/Tooltip";
7
- import { makeAutoObservable as p } from "mobx";
8
- import { endOfToday as f } from "date-fns/endOfToday";
9
- import { formatISO as V } from "date-fns/formatISO";
10
- import { getUnixTime as O } from "date-fns/getUnixTime";
11
- import { isBefore as v } from "date-fns/isBefore";
12
- import { startOfMonth as h } from "date-fns/startOfMonth";
13
- import { startOfToday as m } from "date-fns/startOfToday";
14
- import { subDays as B } from "date-fns/subDays";
15
- import { O as o, a as y, T as b } from "./User-BklmOUSd.mjs";
16
- import { T as u } from "./TransactionApi-CjBoLleL.mjs";
17
- import { b as Y } from "./Category-Ccoew_sA.mjs";
18
- import { f as F } from "./exportTransactionsToCSV-BgV_wTLT.mjs";
19
- import { format as W } from "date-fns/format";
20
- import { fromUnixTime as $ } from "date-fns/fromUnixTime";
21
- import { f as I, a as C, O as k } from "./Dialog-CDV0kKxj.mjs";
22
- import { endOfMonth as z } from "date-fns/endOfMonth";
23
- import { B as L } from "./BeatApi-De2IaqH2.mjs";
24
- const Rt = ({
25
- checked: l = !1,
26
- label: t,
27
- sx: a = {},
28
- tooltip: e = "",
29
- value: A
30
- }) => {
31
- const d = K(), s = d.palette.mode === "light" ? d.palette.grey[400] : d.palette.grey[700], c = l ? d.palette.action.active : s;
32
- return /* @__PURE__ */ g(
33
- x,
34
- {
35
- bgcolor: "background.paper",
36
- border: `${l ? 3 : 1}px solid`,
37
- borderColor: c,
38
- borderRadius: 2,
39
- mt: -2,
40
- mx: 8,
41
- pr: 8,
42
- py: 4,
43
- sx: { "&:hover": { borderColor: d.palette.action.active }, ...a },
44
- children: /* @__PURE__ */ g(U, { title: e, children: /* @__PURE__ */ g(
45
- P,
46
- {
47
- control: /* @__PURE__ */ g(
48
- H,
49
- {
50
- disableRipple: !0,
51
- sx: { "&.Mui-checked": { color: d.palette.action.active } }
52
- }
53
- ),
54
- label: t,
55
- labelPlacement: "start",
56
- sx: { ml: 0, pl: 8 },
57
- value: A
58
- }
59
- ) })
60
- }
61
- );
62
- }, G = {
63
- ASC: "ASC",
64
- DESC: "DESC"
65
- }, n = {
66
- ADD: "Add",
67
- ADD_CATEGORY: "Add Category",
68
- CHANGE_CATEGORY: "Change Category",
69
- CLOSE: "Close",
70
- DELETE: "Delete",
71
- EDIT: "Edit",
72
- SAVE: "Save",
73
- SPLIT: "Split",
74
- SELECT: "Select",
75
- UNSPLIT: "Unsplit"
76
- }, T = {
77
- TRANSACTION_DETAILS: "Transaction Details",
78
- TRANSACTIONS_LIST: "Transactions List",
79
- TRANSACTIONS_WIDGET: "Transactions Widget"
80
- }, r = {
81
- ADD_TRANSACTION: "Manual Transaction",
82
- CATEGORY: "Category",
83
- DATE: "Date",
84
- DELETE_MERCHANT_LOGO: "Merchant Logo",
85
- DELETE_TRANSACTION: "Delete Transaction",
86
- DESCRIPTION: "Description",
87
- EXPORT_CSV: "Export CSV",
88
- FLAG: "Flag",
89
- HIDE_TRANSACTION: "Hide Transaction",
90
- MEMO: "Memo",
91
- SPLITS: "Split Transactions",
92
- TAGS: "Tags",
93
- TAG_ADD: "Add Tag",
94
- TAG_DELETE: "Delete Tag",
95
- TAG_EDIT: "Edit Tag",
96
- TRANSACTION: "Transaction",
97
- UNHIDE_TRANSACTION: "Unhide Transaction"
98
- }, R = {
99
- // splits
100
- [o.ON_TRANSACTION_SPLIT_CLICK]: {
101
- action: n.SELECT,
102
- category: T.TRANSACTION_DETAILS,
103
- label: r.SPLITS
104
- },
105
- [o.ON_TRANSACTION_SPLIT_CATEGORY_CLICK]: {
106
- action: n.ADD_CATEGORY,
107
- category: T.TRANSACTION_DETAILS,
108
- label: r.SPLITS
109
- },
110
- [o.ON_TRANSACTION_SPLIT_DELETE_CLICK]: {
111
- action: n.DELETE,
112
- category: T.TRANSACTION_DETAILS,
113
- label: r.SPLITS
114
- },
115
- [o.ON_TRANSACTION_SPLIT_SAVE_CLICK]: {
116
- action: n.SPLIT,
117
- category: T.TRANSACTION_DETAILS,
118
- label: r.SPLITS
119
- },
120
- [o.ON_TRANSACTION_UNSPLIT]: {
121
- action: n.UNSPLIT,
122
- category: T.TRANSACTION_DETAILS,
123
- label: r.SPLITS
124
- },
125
- // category
126
- [o.ON_TRANSACTION_CATEGORY_CLICK]: {
127
- action: n.SELECT,
128
- category: T.TRANSACTIONS_LIST,
129
- label: r.CATEGORY
130
- },
131
- [o.ON_TRANSACTION_CATEGORY_CHANGED]: {
132
- action: n.CHANGE_CATEGORY,
133
- category: T.TRANSACTION_DETAILS,
134
- label: r.CATEGORY
135
- },
136
- // date
137
- [o.ON_TRANSACTION_DATE_CHANGED]: {
138
- action: n.SAVE,
139
- category: T.TRANSACTION_DETAILS,
140
- label: r.DATE
141
- },
142
- [o.ON_TRANSACTION_DATE_CLICK]: {
143
- action: n.SELECT,
144
- category: T.TRANSACTION_DETAILS,
145
- label: r.DATE
146
- },
147
- // merchant logo
148
- [o.ON_TRANSACTION_DELETE_LOGO_CANCEL]: {
149
- action: n.CLOSE,
150
- category: T.TRANSACTION_DETAILS,
151
- label: r.DELETE_MERCHANT_LOGO
152
- },
153
- [o.ON_TRANSACTION_DELETE_LOGO_CLICK]: {
154
- action: n.SELECT,
155
- category: T.TRANSACTION_DETAILS,
156
- label: r.DELETE_MERCHANT_LOGO
157
- },
158
- [o.ON_TRANSACTION_DELETE_LOGO_DELETED]: {
159
- action: n.DELETE,
160
- category: T.TRANSACTION_DETAILS,
161
- label: r.DELETE_MERCHANT_LOGO
162
- },
163
- // description
164
- [o.ON_TRANSACTION_DESCRIPTION_EDIT_CLICK]: {
165
- action: n.EDIT,
166
- category: T.TRANSACTION_DETAILS,
167
- label: r.DESCRIPTION
168
- },
169
- [o.ON_TRANSACTION_DESCRIPTION_SAVE_CLICK]: {
170
- action: n.SAVE,
171
- category: T.TRANSACTION_DETAILS,
172
- label: r.DESCRIPTION
173
- },
174
- // hide transactions
175
- [o.ON_TRANSACTION_HIDDEN]: {
176
- action: n.SAVE,
177
- category: T.TRANSACTION_DETAILS,
178
- label: r.HIDE_TRANSACTION
179
- },
180
- [o.ON_TRANSACTION_HIDE_CLICK]: {
181
- action: n.SELECT,
182
- category: T.TRANSACTION_DETAILS,
183
- label: r.HIDE_TRANSACTION
184
- },
185
- [o.ON_TRANSACTION_HIDE_CANCEL_CLICK]: {
186
- action: n.CLOSE,
187
- category: T.TRANSACTION_DETAILS,
188
- label: r.HIDE_TRANSACTION
189
- },
190
- // transaction list
191
- [o.ON_TRANSACTION_LIST_ITEM_CLICK]: {
192
- action: n.SELECT,
193
- category: T.TRANSACTIONS_LIST,
194
- label: r.TRANSACTION
195
- },
196
- // memo
197
- [o.ON_TRANSACTION_MEMO_CHANGED]: {
198
- action: n.SAVE,
199
- category: T.TRANSACTION_DETAILS,
200
- label: r.MEMO
201
- },
202
- [o.ON_TRANSACTION_MEMO_CLICK]: {
203
- action: n.SELECT,
204
- category: T.TRANSACTION_DETAILS,
205
- label: r.MEMO
206
- },
207
- // tags
208
- [o.ON_TRANSACTION_TAGS_CHANGED]: {
209
- action: n.SAVE,
210
- category: T.TRANSACTION_DETAILS,
211
- label: r.TAGS
212
- },
213
- [o.ON_TRANSACTION_TAGS_CLICK]: {
214
- action: n.SELECT,
215
- category: T.TRANSACTION_DETAILS,
216
- label: r.TAGS
217
- },
218
- [o.ON_TRANSACTION_TAGS_TAG_ADD_CANCEL_CLICK]: {
219
- action: n.CLOSE,
220
- category: T.TRANSACTION_DETAILS,
221
- label: r.TAGS
222
- },
223
- [o.ON_TRANSACTION_TAGS_TAG_ADD_CLICK]: {
224
- action: n.ADD,
225
- category: T.TRANSACTION_DETAILS,
226
- label: r.TAG_ADD
227
- },
228
- [o.ON_TRANSACTION_TAGS_TAG_ADDED]: {
229
- action: n.SAVE,
230
- category: T.TRANSACTION_DETAILS,
231
- label: r.TAG_ADD
232
- },
233
- [o.ON_TRANSACTION_TAGS_TAG_DELETE_CLICK]: {
234
- action: n.SELECT,
235
- category: T.TRANSACTION_DETAILS,
236
- label: r.TAG_DELETE
237
- },
238
- [o.ON_TRANSACTION_TAGS_TAG_DELETE_CANCEL_CLICK]: {
239
- action: n.CLOSE,
240
- category: T.TRANSACTION_DETAILS,
241
- label: r.TAG_DELETE
242
- },
243
- [o.ON_TRANSACTION_TAGS_TAG_DELETED]: {
244
- action: n.SAVE,
245
- category: T.TRANSACTION_DETAILS,
246
- label: r.TAG_DELETE
247
- },
248
- [o.ON_TRANSACTION_TAGS_TAG_EDIT_CLICK]: {
249
- action: n.EDIT,
250
- category: T.TRANSACTION_DETAILS,
251
- label: r.TAG_EDIT
252
- },
253
- [o.ON_TRANSACTION_TAGS_TAG_EDIT_SAVED]: {
254
- action: n.SAVE,
255
- category: T.TRANSACTION_DETAILS,
256
- label: r.TAG_EDIT
257
- },
258
- // flag
259
- [o.ON_TRANSACTION_TOGGLE_FLAG_CLICK]: {
260
- action: n.SELECT,
261
- category: T.TRANSACTION_DETAILS,
262
- label: r.FLAG
263
- },
264
- // hide
265
- [o.ON_TRANSACTION_UNHIDDEN]: {
266
- action: n.SAVE,
267
- category: T.TRANSACTION_DETAILS,
268
- label: r.UNHIDE_TRANSACTION
269
- },
270
- [o.ON_TRANSACTION_UNHIDE_CLICK]: {
271
- action: n.SELECT,
272
- category: T.TRANSACTION_DETAILS,
273
- label: r.UNHIDE_TRANSACTION
274
- },
275
- [o.ON_TRANSACTION_UNHIDE_CANCEL_CLICK]: {
276
- action: n.CLOSE,
277
- category: T.TRANSACTION_DETAILS,
278
- label: r.UNHIDE_TRANSACTION
279
- },
280
- // export CSV
281
- [o.ON_TRANSACTION_EXPORT_CSV_CLICK]: {
282
- action: n.SELECT,
283
- category: T.TRANSACTIONS_WIDGET,
284
- label: r.EXPORT_CSV
285
- },
286
- // add transaction
287
- [o.ON_TRANSACTION_MANUAL_ADD_CLICK]: {
288
- action: n.SELECT,
289
- category: T.TRANSACTIONS_WIDGET,
290
- label: r.ADD_TRANSACTION
291
- },
292
- [o.ON_TRANSACTION_MANUAL_ADD_ADDED]: {
293
- action: n.ADD,
294
- category: T.TRANSACTIONS_WIDGET,
295
- label: r.ADD_TRANSACTION
296
- },
297
- [o.ON_TRANSACTION_DELETE_CLICK]: {
298
- action: n.SELECT,
299
- category: T.TRANSACTIONS_WIDGET,
300
- label: r.DELETE_TRANSACTION
301
- },
302
- [o.ON_TRANSACTION_DELETE_CANCEL]: {
303
- action: n.CLOSE,
304
- category: T.TRANSACTIONS_WIDGET,
305
- label: r.DELETE_TRANSACTION
306
- },
307
- [o.ON_TRANSACTION_DELETE_DELETED]: {
308
- action: n.DELETE,
309
- category: T.TRANSACTIONS_WIDGET,
310
- label: r.DELETE_TRANSACTION
311
- }
312
- }, X = async (l, t) => !t || !R[l] ? null : t.sendAnalyticEvent(R[l]), D = {
313
- DATE: "date",
314
- AMOUNT: "amount"
315
- }, j = (l, t, a, e = []) => {
316
- const A = t.reduce((c, i) => ({ ...c, [i.guid]: i }), {}), d = a.reduce((c, i) => ({ ...c, [i.guid]: i }), {}), s = e.reduce((c, i) => {
317
- const { transaction_guid: S, tag_guid: E } = i;
318
- if (!c[S])
319
- return {
320
- ...c,
321
- [S]: [E]
322
- };
323
- const N = [...c[S], E];
324
- return {
325
- ...c,
326
- [S]: N
327
- };
328
- }, {});
329
- return l.map((c) => {
330
- const i = A[c.account_guid], S = c.category_guid ? d[c.category_guid] : null, E = s[c.guid] ?? [];
331
- return {
332
- ...c,
333
- account: i?.user_name || "Unknown",
334
- accountIsClosed: i?.is_closed,
335
- accountIsHidden: i?.is_hidden,
336
- category: S?.name || "Uncategorized",
337
- isIncome: c.top_level_category_guid === Y.INCOME,
338
- isPending: c.feed_status === y.PENDING,
339
- number: i?.account_number || "",
340
- payee: c.description,
341
- tags: E
342
- };
343
- });
344
- }, Z = "uncategorized", q = (l, t, a, e, A, d) => {
345
- const s = J(l, A, d), c = Q(s, a, e);
346
- return t.forEach((i) => {
347
- const S = c.findIndex((N) => N.guid === i), E = d.filter((N) => N.parent_guid === i);
348
- c.splice(S + 1, 0, ...E);
349
- }), c;
350
- }, J = (l, t, a) => {
351
- const {
352
- accounts: e = [],
353
- dateRange: A = { start: h(m()), end: f() },
354
- custom: d = () => !0,
355
- searchTerm: s = "",
356
- showSplits: c = !1
357
- } = l;
358
- return a.filter((i) => c ? !i.has_been_split : !i.parent_guid).filter((i) => !!e.find((S) => S === i.account_guid)).filter((i) => i.date >= O(A.start) && i.date <= O(A.end)).filter(d).filter((i) => {
359
- if (s === Z && i.has_been_split)
360
- return !1;
361
- if (/^spl/i.test(s) && (i.has_been_split || i.parent_guid))
362
- return !0;
363
- const E = i.tags.some(
364
- (w) => _(s, t.find((M) => M.guid === w)?.name)
365
- ), N = $(i.date);
366
- return _(s, i.payee) || _(s, i.feed_description) || _(s, i.category) || _(s, I(N, C.MONTH)) || _(s, I(N, C.DAY)) || _(s, I(N, C.FULL_MONTH_DAY)) || _(s, I(N, C.MONTH_DAY_YEAR)) || _(s, W(N, k)) || _(s, i.account) || _(s, `${i.amount}`) || _(s, i.memo) || E;
367
- });
368
- }, Q = (l, t, a) => [...l].sort((e, A) => {
369
- const d = t, s = (e[d] || "") > (A[d] || "");
370
- let c = s ? -1 : 1, i = s ? 1 : -1;
371
- return (t === D.DATE || t === D.AMOUNT) && (c = s ? 1 : -1, i = s ? -1 : 1), a === G.ASC ? c : i;
372
- }), _ = (l, t) => {
373
- const a = l.toLowerCase().split(" "), e = t?.toString().toLowerCase() ?? "";
374
- return a.every((A) => e.indexOf(A) > -1);
375
- }, tt = {
376
- account_guid: "",
377
- amount: 0,
378
- currency_code: "",
379
- date: 0,
380
- description: "",
381
- duplicate: !1,
382
- feed_description: "",
383
- feed_status: y.POSTED,
384
- feed_transaction_date: 0,
385
- has_been_split: !1,
386
- has_been_viewed: !1,
387
- is_cleared: !1,
388
- is_flagged: !1,
389
- is_hidden: !1,
390
- is_manual: !0,
391
- is_personal: !0,
392
- is_reimbursable: !1,
393
- is_subscription: !1,
394
- is_void: !1,
395
- revision: 1,
396
- transaction_type: b.DEBIT,
397
- user_guid: "",
398
- is_duplicate: !1,
399
- feed_transacted_at: 0,
400
- guid: "",
401
- memo: void 0,
402
- tags: []
403
- };
404
- class at {
405
- beginDate = h(/* @__PURE__ */ new Date());
406
- endDate = z(/* @__PURE__ */ new Date());
407
- expandedSplits = [];
408
- height = 550;
409
- width = 1e3;
410
- shouldDisableDrawerScroll = !1;
411
- searchValue = "";
412
- selectedAccountGuids = [];
413
- manualTransaction = tt;
414
- isAmountValid = !1;
415
- showInsights = !1;
416
- constructor() {
417
- p(this);
418
- }
419
- setDateRange = (t, a) => {
420
- this.beginDate = t, this.endDate = a;
421
- };
422
- setIsAmountValid = (t) => this.isAmountValid = t;
423
- setSearchValue = (t) => this.searchValue = t;
424
- setSelectedAccountGuids = (t) => this.selectedAccountGuids = t;
425
- setShouldDisableDrawerScroll = (t) => this.shouldDisableDrawerScroll = t;
426
- setShowInsights = (t) => {
427
- this.showInsights = t;
428
- };
429
- setSize = (t, a) => {
430
- this.height = t, this.width = a;
431
- };
432
- toggleSplit = (t) => {
433
- const a = [...this.expandedSplits], e = this.expandedSplits.findIndex((A) => A === t);
434
- e >= 0 ? a.splice(e, 1) : a.push(t), this.expandedSplits = a;
435
- };
436
- clearExpandedSplits = () => {
437
- this.expandedSplits.length !== 0 && (this.expandedSplits = []);
438
- };
439
- updateManualTransaction = (t) => {
440
- this.manualTransaction = t;
441
- };
442
- }
443
- class pt {
444
- globalStore;
445
- uiStore;
446
- api = new u("/", "");
447
- beatApi = new L("/", "");
448
- associatedBeats = [];
449
- associatedBeatsLoaded = !1;
450
- transactions = [];
451
- transactionsLoaded = !1;
452
- taggings = [];
453
- taggingsLoaded = !1;
454
- tags = [];
455
- tagsLoaded = !1;
456
- transactionRules = [];
457
- transactionRulesLoaded = !1;
458
- cachedStartDate = B(m(), 90);
459
- filter = {};
460
- isLoading = !0;
461
- sortColumn = D.DATE;
462
- sortDirection = G.DESC;
463
- onAnalyticEvent = X;
464
- constructor(t) {
465
- this.globalStore = t, this.uiStore = new at(), this.api = new u(
466
- t.endpoint,
467
- t.sessionToken,
468
- t.onError
469
- ), this.beatApi = new L(t.endpoint, t.sessionToken, t.onError), p(this);
470
- }
471
- loadTransactionData = async () => {
472
- this.globalStore.accountStore.isAccountDataLoaded || await this.globalStore.accountStore.loadAccountData(), this.globalStore.categoryStore.categoriesLoaded || await this.globalStore.categoryStore.loadCategories(), await Promise.all([
473
- this.loadAssociatedBeats(h(/* @__PURE__ */ new Date())),
474
- this.loadTags(),
475
- this.loadTaggings(),
476
- this.loadTransactionRules(),
477
- // By default loads 90 days of transactions
478
- this.loadTransactions(this.cachedStartDate)
479
- ]);
480
- };
481
- get isTransactionDataLoaded() {
482
- return this.associatedBeatsLoaded && this.tagsLoaded && this.taggingsLoaded && this.transactionRulesLoaded && this.transactionsLoaded;
483
- }
484
- get detailedTransactions() {
485
- return this.isTransactionDataLoaded ? j(
486
- this.transactions,
487
- this.globalStore.accountStore.visibleAccounts,
488
- this.globalStore.categoryStore.categories,
489
- this.taggings
490
- ) : [];
491
- }
492
- get sortedTransactions() {
493
- return q(
494
- this.filter,
495
- this.uiStore.expandedSplits,
496
- this.sortColumn,
497
- this.sortDirection,
498
- this.tags,
499
- this.detailedTransactions
500
- );
501
- }
502
- get sortedTransactionsWithSplits() {
503
- return F(this.sortedTransactions, this.transactions);
504
- }
505
- setAssociatedBeats = (t) => {
506
- this.associatedBeats = t, this.associatedBeatsLoaded = !0;
507
- };
508
- setTaggings = (t) => {
509
- this.taggings = t, this.taggingsLoaded = !0;
510
- };
511
- setTags = (t) => {
512
- this.tags = t, this.tagsLoaded = !0;
513
- };
514
- setTransactionRules = (t) => {
515
- this.transactionRules = t, this.transactionRulesLoaded = !0;
516
- };
517
- setTransactions = (t) => {
518
- this.transactions = t, this.transactionsLoaded = !0;
519
- };
520
- addTag = async (t) => {
521
- await this.api.addTag({ name: t }), await this.loadTags();
522
- };
523
- addTagging = async (t, a) => {
524
- await this.api.addTagging({
525
- tag_guid: t,
526
- transaction_guid: a
527
- });
528
- };
529
- addOrUpdateTransactionRule = async (t, a) => {
530
- const e = this.transactionRules.find(
531
- (A) => A.guid === a.user_transaction_rule_guid
532
- );
533
- e ? await this.api.updateTransactionRule({
534
- ...e,
535
- category_guid: t,
536
- description: a.description
537
- }) : await this.api.addTransactionRule({
538
- category_guid: t,
539
- description: a.description,
540
- match_description: a.description
541
- }), await this.loadTransactionRules();
542
- };
543
- addTransaction = async (t) => {
544
- const a = await this.api.addTransaction(t);
545
- if (a) {
546
- this.setTransactions([a, ...this.transactions]);
547
- const e = a.transaction_type === b.CREDIT ? a.amount : -a.amount;
548
- this.globalStore.accountStore.updateAccountBalance(a.account_guid, e);
549
- }
550
- };
551
- loadAssociatedBeats = async (t) => {
552
- const a = t ? V(t, { representation: "date" }) : void 0;
553
- try {
554
- const e = await this.beatApi.getBeatsWithAssociatedTransaction(a);
555
- this.setAssociatedBeats(e);
556
- } catch (e) {
557
- console.error(`Error occurred while loading associated beats: ${e}`);
558
- }
559
- };
560
- loadTags = async () => {
561
- try {
562
- const t = await this.api.getTags();
563
- this.setTags(t);
564
- } catch (t) {
565
- console.error(`Error occurred while loading tags: ${t}`);
566
- }
567
- };
568
- loadTaggings = async () => {
569
- try {
570
- const t = await this.api.getTaggings();
571
- this.setTaggings(t);
572
- } catch (t) {
573
- console.error(`Error occurred while loading taggings: ${t}`);
574
- }
575
- };
576
- loadTransactionRules = async () => {
577
- const t = await this.api.getTransactionRules();
578
- this.setTransactionRules(t);
579
- };
580
- loadTransactions = async (t = this.cachedStartDate) => {
581
- this.setIsLoading(!0), this.transactions = [];
582
- try {
583
- const a = await this.api.getTransactionsByDateRange(
584
- O(t),
585
- O(f())
586
- );
587
- this.setTransactions(a);
588
- } catch (a) {
589
- console.error(`Error occurred while loading transactions: ${a}`);
590
- }
591
- this.setIsLoading(!1);
592
- };
593
- modifyTransactionByAccountGuid = (t, a) => {
594
- this.transactions = this.transactions.map(
595
- (e) => e.account_guid === t ? { ...e, ...a } : e
596
- );
597
- };
598
- removeTag = async (t) => {
599
- await this.api.removeTag(t), await this.loadTags();
600
- };
601
- removeTagging = async (t) => {
602
- await this.api.removeTagging(t);
603
- };
604
- removeTransaction = async (t) => {
605
- await this.api.removeTransaction(t);
606
- const a = this.transactions.findIndex((e) => e.guid === t);
607
- if (a >= 0) {
608
- const e = [...this.transactions];
609
- e.splice(a, 1), this.setTransactions(e);
610
- }
611
- };
612
- setFilter = (t) => {
613
- this.filter = t, t.dateRange && v(t.dateRange.start, this.cachedStartDate) && this.loadTransactions(t.dateRange.start).then(() => {
614
- t.dateRange && (this.cachedStartDate = t.dateRange.start);
615
- });
616
- };
617
- setIsLoading = (t) => this.isLoading = t;
618
- splitTransaction = async (t, a) => {
619
- const e = await this.api.updateTransaction(t), A = [];
620
- for (let s = 0; s < a.length; s++) {
621
- const c = await this.api.addTransaction(a[s]);
622
- A.push(c);
623
- }
624
- const d = this.transactions.findIndex((s) => s.guid === t.guid);
625
- d >= 0 && this.setTransactions([
626
- ...this.transactions.slice(0, d),
627
- e,
628
- ...this.transactions.slice(d + 1),
629
- ...A
630
- ]);
631
- };
632
- unSplitTransaction = async (t) => {
633
- const a = this.transactions.filter((s) => s.parent_guid === t);
634
- await this.api.removeTransactionSplit(t);
635
- const e = [...this.transactions];
636
- a.forEach((s) => {
637
- const c = e.findIndex((i) => i.guid === s.guid);
638
- c >= 0 && e.splice(c, 1);
639
- });
640
- const A = e.findIndex((s) => s.guid === t), d = e[A];
641
- d.has_been_split = !1, A >= 0 && this.setTransactions([
642
- ...e.slice(0, A),
643
- d,
644
- ...e.slice(A + 1)
645
- ]);
646
- };
647
- updateTaggings = async (t, a) => {
648
- const e = this.taggings.filter((s) => s.transaction_guid === a), A = new Set(e.map((s) => s.tag_guid)), d = new Set(t);
649
- for (const s of t)
650
- A.has(s) || await this.addTagging(s, a);
651
- for (const s of e)
652
- d.has(s.tag_guid) || await this.removeTagging(s.guid);
653
- await this.loadTaggings();
654
- };
655
- updateTag = async (t) => {
656
- await this.api.updateTag(t), await this.loadTags();
657
- };
658
- updateTransaction = async (t) => {
659
- const a = await this.api.updateTransaction(t), e = this.transactions.findIndex((A) => A.guid === t.guid);
660
- e >= 0 && this.setTransactions([
661
- ...this.transactions.slice(0, e),
662
- a,
663
- ...this.transactions.slice(e + 1)
664
- ]);
665
- };
666
- }
667
- export {
668
- tt as D,
669
- Rt as S,
670
- pt as T
671
- };