@mx-cartographer/experiences 9.1.6 → 9.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
import { makeAutoObservable as
|
|
2
|
-
import { d as
|
|
3
|
-
import { i as
|
|
4
|
-
import { c as
|
|
5
|
-
import { F as
|
|
6
|
-
import { A as
|
|
1
|
+
import { makeAutoObservable as h, runInAction as c, reaction as gt, autorun as mt, observable as Tt } from "mobx";
|
|
2
|
+
import { d as bt, g as At } from "./AccountUtils-Cbh8r9cP.mjs";
|
|
3
|
+
import { i as wt, f as Et, b as It, c as V } from "./BudgetUtil-Bg2AQJpQ.mjs";
|
|
4
|
+
import { c as d, d as $ } from "./Account-DR7Plrqy.mjs";
|
|
5
|
+
import { F as p, B as G, G as z } from "./GlobalCopyApi-CLhyon-B.mjs";
|
|
6
|
+
import { A as n } from "./ApiEndpoints-DXwIYNUV.mjs";
|
|
7
7
|
import Ct from "posthog-js";
|
|
8
|
-
import { endOfMonth as
|
|
8
|
+
import { endOfMonth as b } from "date-fns/endOfMonth";
|
|
9
9
|
import { startOfMonth as C } from "date-fns/startOfMonth";
|
|
10
|
-
import { startOfToday as
|
|
10
|
+
import { startOfToday as f } from "date-fns/startOfToday";
|
|
11
11
|
import { C as w, b as Rt } from "./Category-DEKZGLYe.mjs";
|
|
12
12
|
import { addDays as Dt } from "date-fns/addDays";
|
|
13
|
-
import { differenceInDays as
|
|
14
|
-
import { isBefore as
|
|
13
|
+
import { differenceInDays as xt } from "date-fns/differenceInDays";
|
|
14
|
+
import { isBefore as W } from "date-fns/isBefore";
|
|
15
15
|
import { getUnixTime as m } from "date-fns/getUnixTime";
|
|
16
|
-
import { subMonths as
|
|
17
|
-
import { c as
|
|
18
|
-
import { l as
|
|
16
|
+
import { subMonths as N } from "date-fns/subMonths";
|
|
17
|
+
import { c as Lt, d as vt, C as Gt, h as Nt, i as Bt, s as Mt, j as Ot, T as Pt, D as $t } from "./TransactionUtils-BphBJBbU.mjs";
|
|
18
|
+
import { l as Ft, D as Ut } from "./DebtUtils-i4pI2Uoe.mjs";
|
|
19
19
|
import { format as kt } from "date-fns/format";
|
|
20
20
|
import { fromUnixTime as Ht } from "date-fns/fromUnixTime";
|
|
21
|
-
import { f as
|
|
22
|
-
import { T
|
|
21
|
+
import { f as k, D as H } from "./DateFormats-HudZ3Bjs.mjs";
|
|
22
|
+
import { T, c as K } from "./GoalsUtil-C9EnLWvC.mjs";
|
|
23
23
|
import { A as Wt, m as Vt, a as zt, b as Kt } from "./InvestmentUtil-BItV7uEs.mjs";
|
|
24
|
-
import { f as Qt, b as qt, a as
|
|
24
|
+
import { f as Qt, b as qt, a as Q, c as Yt, d as jt, e as Xt, s as Jt } from "./NetWorthUtils-Dj7CgAg2.mjs";
|
|
25
25
|
import { f as Zt } from "./NotificationUtils-BRGFTePr.mjs";
|
|
26
|
-
import { isAfter as
|
|
27
|
-
import { isSameDay as
|
|
28
|
-
import { isWithinInterval as
|
|
29
|
-
import { subDays as
|
|
30
|
-
import { f as U, h as te, b as L, a as
|
|
31
|
-
import { I as u, A as _, B
|
|
32
|
-
import { endOfToday as
|
|
26
|
+
import { isAfter as F } from "date-fns/isAfter";
|
|
27
|
+
import { isSameDay as q } from "date-fns/isSameDay";
|
|
28
|
+
import { isWithinInterval as pt } from "date-fns/isWithinInterval";
|
|
29
|
+
import { subDays as _t } from "date-fns/subDays";
|
|
30
|
+
import { f as U, h as te, b as L, a as S } from "./RecurringTransactionsUtil-CfWviBh1.mjs";
|
|
31
|
+
import { I as u, A as _, B } from "./Notification-DTNYSd8P.mjs";
|
|
32
|
+
import { endOfToday as Y } from "date-fns/endOfToday";
|
|
33
33
|
import { formatISO as ee } from "date-fns/formatISO";
|
|
34
34
|
import { addSeconds as se } from "date-fns/addSeconds";
|
|
35
35
|
import { differenceInCalendarMonths as ae } from "date-fns/differenceInCalendarMonths";
|
|
36
|
-
import { f as
|
|
37
|
-
import { addMonths as
|
|
36
|
+
import { f as re, b as ne } from "./TrendsUtil-D9z3kIj_.mjs";
|
|
37
|
+
import { addMonths as ie } from "date-fns/addMonths";
|
|
38
38
|
import { getMonth as v } from "date-fns/getMonth";
|
|
39
39
|
import { a as oe } from "./Help-CkQTjORd.mjs";
|
|
40
|
-
class
|
|
40
|
+
class M {
|
|
41
41
|
fetchInstance;
|
|
42
42
|
constructor(t, e, s) {
|
|
43
|
-
this.fetchInstance = new
|
|
44
|
-
}
|
|
45
|
-
createAccount = async (t) => this.fetchInstance.post(
|
|
46
|
-
deleteAccount = async (t) => this.fetchInstance.delete(`${
|
|
47
|
-
getAccounts = async () => this.fetchInstance.get(
|
|
48
|
-
getInstitutions = async () => this.fetchInstance.get(
|
|
49
|
-
getMembers = async () => this.fetchInstance.get(
|
|
50
|
-
getMonthlyAccountBalances = async (t) => this.fetchInstance.get(`${
|
|
51
|
-
mergeAccounts = async (t) => this.fetchInstance.put(`${
|
|
52
|
-
refreshAllMembers = async () => this.fetchInstance.get(`${
|
|
53
|
-
updateAccount = async (t) => this.fetchInstance.put(`${
|
|
43
|
+
this.fetchInstance = new p(t, e, void 0, s);
|
|
44
|
+
}
|
|
45
|
+
createAccount = async (t) => this.fetchInstance.post(n.ACCOUNTS, t).then((e) => e.account);
|
|
46
|
+
deleteAccount = async (t) => this.fetchInstance.delete(`${n.ACCOUNTS}/${t}`);
|
|
47
|
+
getAccounts = async () => this.fetchInstance.get(n.ACCOUNTS).then((t) => t.accounts);
|
|
48
|
+
getInstitutions = async () => this.fetchInstance.get(n.INSTITUTIONS).then((t) => t);
|
|
49
|
+
getMembers = async () => this.fetchInstance.get(n.MEMBERS).then((t) => t.members);
|
|
50
|
+
getMonthlyAccountBalances = async (t) => this.fetchInstance.get(`${n.ACCOUNTS}/${t}/monthly_account_balances`).then((e) => e.monthly_account_balances);
|
|
51
|
+
mergeAccounts = async (t) => this.fetchInstance.put(`${n.ACCOUNTS}/merge`, { accounts: t }).then((e) => e);
|
|
52
|
+
refreshAllMembers = async () => this.fetchInstance.get(`${n.MEMBERS}/refresh_all`).then((t) => t);
|
|
53
|
+
updateAccount = async (t) => this.fetchInstance.put(`${n.ACCOUNTS}/${t.guid}`, t).then((e) => e.account);
|
|
54
54
|
}
|
|
55
|
-
class
|
|
55
|
+
class j {
|
|
56
56
|
fetchInstance;
|
|
57
57
|
constructor(t, e, s) {
|
|
58
|
-
this.fetchInstance = new
|
|
58
|
+
this.fetchInstance = new p(t, e, void 0, s);
|
|
59
59
|
}
|
|
60
|
-
getAppData = async () => this.fetchInstance.get(
|
|
60
|
+
getAppData = async () => this.fetchInstance.get(n.APP_DATA).then((t) => t);
|
|
61
61
|
}
|
|
62
|
-
class
|
|
62
|
+
class X {
|
|
63
63
|
fetchInstance;
|
|
64
64
|
constructor(t) {
|
|
65
|
-
this.fetchInstance = new
|
|
65
|
+
this.fetchInstance = new p(t, "", {
|
|
66
66
|
Accept: "application/json",
|
|
67
67
|
"Content-Type": "application/json"
|
|
68
68
|
});
|
|
@@ -76,54 +76,42 @@ class j {
|
|
|
76
76
|
}
|
|
77
77
|
};
|
|
78
78
|
}
|
|
79
|
-
class
|
|
79
|
+
class J {
|
|
80
80
|
fetchInstance;
|
|
81
81
|
constructor(t, e, s) {
|
|
82
|
-
this.fetchInstance = new
|
|
82
|
+
this.fetchInstance = new p(t, e, void 0, s);
|
|
83
83
|
}
|
|
84
|
-
addBudget = async (t, e, s = null) => this.fetchInstance.post(
|
|
84
|
+
addBudget = async (t, e, s = null) => this.fetchInstance.post(n.BUDGETS, {
|
|
85
85
|
amount: e,
|
|
86
86
|
category_guid: t.guid,
|
|
87
87
|
category_name: t.name,
|
|
88
88
|
parent_guid: s
|
|
89
|
-
}).then((a) => a.budget)
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
});
|
|
95
|
-
getBudgets = async () => this.fetchInstance.get(i.BUDGETS).then((t) => t.budgets).catch((t) => t);
|
|
96
|
-
updateBudget = async (t) => this.fetchInstance.put(`${i.BUDGETS}/${t.guid}`, t).then((e) => e.budget).catch((e) => {
|
|
97
|
-
throw e;
|
|
98
|
-
});
|
|
99
|
-
addMerchantBudget = async (t, e) => this.fetchInstance.post(i.MERCHANT_BUDGETS, {
|
|
89
|
+
}).then((a) => a.budget);
|
|
90
|
+
deleteBudget = async (t) => this.fetchInstance.delete(`${n.BUDGETS}/${t}`).then((e) => e);
|
|
91
|
+
getBudgets = async () => this.fetchInstance.get(n.BUDGETS).then((t) => t.budgets);
|
|
92
|
+
updateBudget = async (t) => this.fetchInstance.put(`${n.BUDGETS}/${t.guid}`, t).then((e) => e.budget);
|
|
93
|
+
addMerchantBudget = async (t, e) => this.fetchInstance.post(n.MERCHANT_BUDGETS, {
|
|
100
94
|
amount: e,
|
|
101
95
|
merchant_guid: t
|
|
102
|
-
}).then((s) => s.merchant_budget)
|
|
103
|
-
|
|
104
|
-
});
|
|
105
|
-
updateMerchantBudget = async (t, e) => this.fetchInstance.put(`${i.MERCHANT_BUDGETS}/${t}`, {
|
|
96
|
+
}).then((s) => s.merchant_budget);
|
|
97
|
+
updateMerchantBudget = async (t, e) => this.fetchInstance.put(`${n.MERCHANT_BUDGETS}/${t}`, {
|
|
106
98
|
amount: e
|
|
107
|
-
}).then((s) => s.merchant_budget)
|
|
108
|
-
|
|
109
|
-
});
|
|
110
|
-
deleteMerchantBudget = async (t) => this.fetchInstance.delete(`${i.MERCHANT_BUDGETS}/${t}`).then((e) => e).catch((e) => {
|
|
111
|
-
throw e;
|
|
112
|
-
});
|
|
99
|
+
}).then((s) => s.merchant_budget);
|
|
100
|
+
deleteMerchantBudget = async (t) => this.fetchInstance.delete(`${n.MERCHANT_BUDGETS}/${t}`).then((e) => e);
|
|
113
101
|
}
|
|
114
|
-
class
|
|
102
|
+
class Z {
|
|
115
103
|
fetchInstance;
|
|
116
104
|
constructor(t, e, s) {
|
|
117
|
-
this.fetchInstance = new
|
|
105
|
+
this.fetchInstance = new p(t, e, void 0, s);
|
|
118
106
|
}
|
|
119
|
-
addCategory = async (t) => this.fetchInstance.post(
|
|
120
|
-
getCategories = async () => this.fetchInstance.get(
|
|
121
|
-
getDateRangeCategoryTotals = async (t, e, s) => s.length === 0 ? [] : this.fetchInstance.post(`${
|
|
107
|
+
addCategory = async (t) => this.fetchInstance.post(n.CATEGORIES, t).then((e) => e.category);
|
|
108
|
+
getCategories = async () => this.fetchInstance.get(n.CATEGORIES).then((t) => t.categories);
|
|
109
|
+
getDateRangeCategoryTotals = async (t, e, s) => s.length === 0 ? [] : this.fetchInstance.post(`${n.DATE_RANGE_CATEGORY_TOTALS}/from/${t}/to/${e}`, {
|
|
122
110
|
account_guid: s.map((a) => a.guid)
|
|
123
111
|
}).then((a) => a.date_range_category_totals);
|
|
124
112
|
getMonthlyCategoryTotals = async (t, e, s) => {
|
|
125
113
|
try {
|
|
126
|
-
const a = `${
|
|
114
|
+
const a = `${n.MONTHLY_CATEGORY_TOTALS}/from/${t}/to/${e}`;
|
|
127
115
|
if (s) {
|
|
128
116
|
const o = s.length === 0 ? [""] : s.map((l) => l.guid);
|
|
129
117
|
return (await this.fetchInstance.post(a, { account_guid: o })).monthly_category_totals;
|
|
@@ -133,169 +121,169 @@ class J {
|
|
|
133
121
|
throw console.error("Error fetching monthly category totals:", a), a;
|
|
134
122
|
}
|
|
135
123
|
};
|
|
136
|
-
removeCategory = async (t) => this.fetchInstance.delete(`${
|
|
137
|
-
updateCategory = async (t) => this.fetchInstance.put(`${
|
|
138
|
-
}
|
|
139
|
-
class Z {
|
|
140
|
-
fetchInstance;
|
|
141
|
-
constructor(t, e, s) {
|
|
142
|
-
this.fetchInstance = new g(t, e, void 0, s);
|
|
143
|
-
}
|
|
144
|
-
calculateHealthScore = async () => this.fetchInstance.post(`${i.HEALTH_SCORES}/calculate`).then((t) => t.health_score);
|
|
145
|
-
getAverageHealthScores = async () => this.fetchInstance.get(`${i.HEALTH_SCORES}/monthly_averages`).then((t) => t);
|
|
146
|
-
getDebtSpend = async () => this.fetchInstance.get(`${i.HEALTH_SCORES}/transactions/debt_spend`).then((t) => t);
|
|
147
|
-
getIncome = async () => this.fetchInstance.get(`${i.HEALTH_SCORES}/transactions/income`).then((t) => t);
|
|
148
|
-
getMonthlySummaries = async () => this.fetchInstance.get(`${i.HEALTH_SCORES}/monthly_summaries`).then((t) => t);
|
|
149
|
-
getHealthScoreChangeReports = async (t, e) => this.fetchInstance.get(`${i.HEALTH_SCORES}/change_report/from/${t}/to/${e}`).then((s) => s);
|
|
150
|
-
getPeerScore = async (t) => this.fetchInstance.get(`${i.HEALTH_SCORES}/average/${t}`).then((e) => e);
|
|
151
|
-
getSpendingFeeTransactions = async () => this.fetchInstance.get(`${i.HEALTH_SCORES}/transactions/spending_fee`).then((t) => t);
|
|
152
|
-
getStandardSpend = async () => this.fetchInstance.get(`${i.HEALTH_SCORES}/transactions/standard_spend`).then((t) => t);
|
|
124
|
+
removeCategory = async (t) => this.fetchInstance.delete(`${n.CATEGORIES}/${t}`);
|
|
125
|
+
updateCategory = async (t) => this.fetchInstance.put(`${n.CATEGORIES}/${t.guid}`, t).then((e) => e.category);
|
|
153
126
|
}
|
|
154
127
|
class tt {
|
|
155
128
|
fetchInstance;
|
|
156
129
|
constructor(t, e, s) {
|
|
157
|
-
this.fetchInstance = new
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
removeRetirementGoal = async (t) => this.fetchInstance.delete(`${i.RETIREMENT_GOALS}/${t}`).then((e) => e);
|
|
169
|
-
removeRetirementGoalAccount = async (t) => this.fetchInstance.delete(`${i.RETIREMENT_GOAL_ACCOUNTS}/${t}`).then((e) => e);
|
|
170
|
-
reorderGoals = async (t) => this.fetchInstance.post(`${i.GOALS}/reposition`, { goals: t }).then((e) => e.goals);
|
|
171
|
-
updateGoal = async (t) => this.fetchInstance.put(`${i.GOALS}/${t.guid}`, t).then((e) => e.goal);
|
|
172
|
-
updateMonthlyCashFlowProfile = async (t) => this.fetchInstance.put(`${i.MONTHLY_CASH_FLOW_PROFILE}`, t).then((e) => e.monthly_cash_flow_profile);
|
|
173
|
-
updateRetirementGoal = async (t) => this.fetchInstance.put(`${i.RETIREMENT_GOALS}/${t.guid}`, t).then((e) => e.retirement_goal);
|
|
130
|
+
this.fetchInstance = new p(t, e, void 0, s);
|
|
131
|
+
}
|
|
132
|
+
calculateHealthScore = async () => this.fetchInstance.post(`${n.HEALTH_SCORES}/calculate`).then((t) => t.health_score);
|
|
133
|
+
getAverageHealthScores = async () => this.fetchInstance.get(`${n.HEALTH_SCORES}/monthly_averages`).then((t) => t);
|
|
134
|
+
getDebtSpend = async () => this.fetchInstance.get(`${n.HEALTH_SCORES}/transactions/debt_spend`).then((t) => t);
|
|
135
|
+
getIncome = async () => this.fetchInstance.get(`${n.HEALTH_SCORES}/transactions/income`).then((t) => t);
|
|
136
|
+
getMonthlySummaries = async () => this.fetchInstance.get(`${n.HEALTH_SCORES}/monthly_summaries`).then((t) => t);
|
|
137
|
+
getHealthScoreChangeReports = async (t, e) => this.fetchInstance.get(`${n.HEALTH_SCORES}/change_report/from/${t}/to/${e}`).then((s) => s);
|
|
138
|
+
getPeerScore = async (t) => this.fetchInstance.get(`${n.HEALTH_SCORES}/average/${t}`).then((e) => e);
|
|
139
|
+
getSpendingFeeTransactions = async () => this.fetchInstance.get(`${n.HEALTH_SCORES}/transactions/spending_fee`).then((t) => t);
|
|
140
|
+
getStandardSpend = async () => this.fetchInstance.get(`${n.HEALTH_SCORES}/transactions/standard_spend`).then((t) => t);
|
|
174
141
|
}
|
|
175
142
|
class et {
|
|
176
143
|
fetchInstance;
|
|
177
144
|
constructor(t, e, s) {
|
|
178
|
-
this.fetchInstance = new
|
|
179
|
-
}
|
|
180
|
-
|
|
145
|
+
this.fetchInstance = new p(t, e, void 0, s);
|
|
146
|
+
}
|
|
147
|
+
addGoal = async (t) => this.fetchInstance.post(n.GOALS, t).then((e) => e.goal);
|
|
148
|
+
addRetirementGoal = async (t) => this.fetchInstance.post(n.RETIREMENT_GOALS, t).then((e) => e.retirement_goal);
|
|
149
|
+
addRetirementGoalAccount = async (t) => this.fetchInstance.post(n.RETIREMENT_GOAL_ACCOUNTS, t).then((e) => e.retirement_goal_account);
|
|
150
|
+
getGoalByGuid = async (t) => this.fetchInstance.get(`${n.GOALS}/${t}`).then((e) => e.goal);
|
|
151
|
+
getGoals = async () => this.fetchInstance.get(n.GOALS).then((t) => t.goals);
|
|
152
|
+
getMonthlyCashFlowProfile = async () => this.fetchInstance.get(n.MONTHLY_CASH_FLOW_PROFILE).then((t) => t.monthly_cash_flow_profile);
|
|
153
|
+
getRetirementGoals = async () => this.fetchInstance.get(n.RETIREMENT_GOALS).then((t) => t.retirement_goals);
|
|
154
|
+
getRetirementGoalAccounts = async () => this.fetchInstance.get(n.RETIREMENT_GOAL_ACCOUNTS).then((t) => t.retirement_goal_accounts);
|
|
155
|
+
removeGoal = async (t) => this.fetchInstance.delete(`${n.GOALS}/${t}`).then((e) => e);
|
|
156
|
+
removeRetirementGoal = async (t) => this.fetchInstance.delete(`${n.RETIREMENT_GOALS}/${t}`).then((e) => e);
|
|
157
|
+
removeRetirementGoalAccount = async (t) => this.fetchInstance.delete(`${n.RETIREMENT_GOAL_ACCOUNTS}/${t}`).then((e) => e);
|
|
158
|
+
reorderGoals = async (t) => this.fetchInstance.post(`${n.GOALS}/reposition`, { goals: t }).then((e) => e.goals);
|
|
159
|
+
updateGoal = async (t) => this.fetchInstance.put(`${n.GOALS}/${t.guid}`, t).then((e) => e.goal);
|
|
160
|
+
updateMonthlyCashFlowProfile = async (t) => this.fetchInstance.put(`${n.MONTHLY_CASH_FLOW_PROFILE}`, t).then((e) => e.monthly_cash_flow_profile);
|
|
161
|
+
updateRetirementGoal = async (t) => this.fetchInstance.put(`${n.RETIREMENT_GOALS}/${t.guid}`, t).then((e) => e.retirement_goal);
|
|
181
162
|
}
|
|
182
163
|
class st {
|
|
183
164
|
fetchInstance;
|
|
184
165
|
constructor(t, e, s) {
|
|
185
|
-
this.fetchInstance = new
|
|
166
|
+
this.fetchInstance = new p(t, e, void 0, s);
|
|
186
167
|
}
|
|
187
|
-
|
|
188
|
-
updateHoldings = async (t) => this.fetchInstance.put(`${i.HOLDINGS}/${t.guid}`, t).then((e) => e.holding);
|
|
168
|
+
createSupportTicket = async (t) => this.fetchInstance.post(n.SUPPORT_TICKETS, t).then((e) => e);
|
|
189
169
|
}
|
|
190
170
|
class at {
|
|
191
171
|
fetchInstance;
|
|
192
172
|
constructor(t, e, s) {
|
|
193
|
-
this.fetchInstance = new
|
|
173
|
+
this.fetchInstance = new p(t, e, void 0, s);
|
|
174
|
+
}
|
|
175
|
+
getHoldings = async () => this.fetchInstance.get(n.HOLDINGS).then((t) => t.holdings);
|
|
176
|
+
updateHoldings = async (t) => this.fetchInstance.put(`${n.HOLDINGS}/${t.guid}`, t).then((e) => e.holding);
|
|
177
|
+
}
|
|
178
|
+
class rt {
|
|
179
|
+
fetchInstance;
|
|
180
|
+
constructor(t, e, s) {
|
|
181
|
+
this.fetchInstance = new p(t, e, void 0, s);
|
|
194
182
|
}
|
|
195
183
|
getMerchants = async (t = [], e = [], s = 1, a = 25) => {
|
|
196
|
-
let o =
|
|
197
|
-
return o += `?page=${s}&per_page=${a}`, t.length && t.forEach((
|
|
184
|
+
let o = n.MERCHANTS;
|
|
185
|
+
return o += `?page=${s}&per_page=${a}`, t.length && t.forEach((i) => o += `&fuzzy_name[]=${i}`), e.length && e.forEach((i) => o += `&guid[]=${i}`), this.fetchInstance.get(o).then((i) => i.merchants);
|
|
198
186
|
};
|
|
199
|
-
getMerchantByGuid = async (t) => this.fetchInstance.get(`${
|
|
187
|
+
getMerchantByGuid = async (t) => this.fetchInstance.get(`${n.MERCHANTS}/${t}`).then((e) => e.merchant);
|
|
200
188
|
}
|
|
201
189
|
class nt {
|
|
202
190
|
fetchInstance;
|
|
203
191
|
constructor(t, e, s) {
|
|
204
|
-
this.fetchInstance = new
|
|
192
|
+
this.fetchInstance = new p(t, e, void 0, s);
|
|
205
193
|
}
|
|
206
|
-
getNotifications = () => this.fetchInstance.get(
|
|
194
|
+
getNotifications = () => this.fetchInstance.get(n.NOTIFICATIONS).then(
|
|
207
195
|
(t) => t.notifications.map((e) => e.notification)
|
|
208
196
|
).finally();
|
|
209
|
-
updateNotification = (t) => this.fetchInstance.put(`${
|
|
197
|
+
updateNotification = (t) => this.fetchInstance.put(`${n.NOTIFICATIONS}/${t.guid}`, {
|
|
210
198
|
guid: t.guid,
|
|
211
199
|
has_been_viewed: t.has_been_viewed
|
|
212
200
|
}).then((e) => e.notification).finally();
|
|
213
201
|
// Note: The notifications/mark_all_as_viewed endpoint is broken, but still returns 202.
|
|
214
202
|
// A bug ticket has been filed to fix it, but should not require any changes here.
|
|
215
|
-
markAllAsViewed = (t) => this.fetchInstance.put(`${
|
|
203
|
+
markAllAsViewed = (t) => this.fetchInstance.put(`${n.NOTIFICATIONS}/mark_all_as_viewed`, { channel: t }).finally();
|
|
216
204
|
}
|
|
217
205
|
class it {
|
|
218
206
|
fetchInstance;
|
|
219
207
|
constructor(t, e, s) {
|
|
220
|
-
this.fetchInstance = new
|
|
208
|
+
this.fetchInstance = new p(t, e, void 0, s);
|
|
221
209
|
}
|
|
222
|
-
addRepeatingTransaction = async (t) => this.fetchInstance.post(
|
|
223
|
-
getRepeatingTransactions = async () => this.fetchInstance.get(
|
|
210
|
+
addRepeatingTransaction = async (t) => this.fetchInstance.post(n.REPEATING_TRANSACTIONS, t).then((e) => e.repeating_transaction);
|
|
211
|
+
getRepeatingTransactions = async () => this.fetchInstance.get(n.REPEATING_TRANSACTIONS).then((t) => t.repeating_transactions);
|
|
224
212
|
updateRepeatingTransaction = async (t) => this.fetchInstance.put(
|
|
225
|
-
`${
|
|
213
|
+
`${n.REPEATING_TRANSACTIONS}/${t.guid}`,
|
|
226
214
|
t
|
|
227
215
|
).then((e) => e.repeating_transaction);
|
|
228
|
-
deleteRepeatingTransaction = async (t) => this.fetchInstance.delete(`${
|
|
216
|
+
deleteRepeatingTransaction = async (t) => this.fetchInstance.delete(`${n.REPEATING_TRANSACTIONS}/${t}`).then((e) => e);
|
|
229
217
|
}
|
|
230
|
-
class
|
|
218
|
+
class ot {
|
|
231
219
|
fetchInstance;
|
|
232
220
|
constructor(t, e, s) {
|
|
233
|
-
this.fetchInstance = new
|
|
221
|
+
this.fetchInstance = new p(t, e, void 0, s);
|
|
234
222
|
}
|
|
235
|
-
deleteDevice = async (t) => this.fetchInstance.delete(`${
|
|
236
|
-
generateDeviceToken = async () => this.fetchInstance.get(`${
|
|
237
|
-
getDevices = async () => this.fetchInstance.get(
|
|
238
|
-
getNotificationProfiles = async () => this.fetchInstance.get(
|
|
223
|
+
deleteDevice = async (t) => this.fetchInstance.delete(`${n.DEVICES}/${t}`).then((e) => e);
|
|
224
|
+
generateDeviceToken = async () => this.fetchInstance.get(`${n.USER}/mobile_token`).then((t) => t.mobile_token);
|
|
225
|
+
getDevices = async () => this.fetchInstance.get(n.DEVICES).then((t) => t.map((e) => e.device));
|
|
226
|
+
getNotificationProfiles = async () => this.fetchInstance.get(n.NOTIFICATION_PROFILES).then((t) => t.notification_profiles);
|
|
239
227
|
// verifications endpoints respond with HTTP status codes; they error otherwise
|
|
240
|
-
sendEmailVerification = async () => this.fetchInstance.post(
|
|
241
|
-
sendPhoneVerification = async () => this.fetchInstance.post(
|
|
242
|
-
verifyPhoneToken = async (t) => this.fetchInstance.post(
|
|
243
|
-
updateDevice = async (t) => this.fetchInstance.put(`${
|
|
244
|
-
updateNotificationProfile = async (t) => this.fetchInstance.put(`${
|
|
245
|
-
updateUserCommunicationProfile = async (t) => this.fetchInstance.put(
|
|
246
|
-
getInsightsNotificationProfiles = async () => this.fetchInstance.get(`${
|
|
228
|
+
sendEmailVerification = async () => this.fetchInstance.post(n.EMAIL_VERIFICATIONS);
|
|
229
|
+
sendPhoneVerification = async () => this.fetchInstance.post(n.PHONE_VERIFICATIONS + "/deliver");
|
|
230
|
+
verifyPhoneToken = async (t) => this.fetchInstance.post(n.PHONE_VERIFICATIONS + "/verify", { sms_verification_token: t }).then((e) => ({ verified: e.verified }));
|
|
231
|
+
updateDevice = async (t) => this.fetchInstance.put(`${n.DEVICES}/${t.guid}`, t).then((e) => e.device);
|
|
232
|
+
updateNotificationProfile = async (t) => this.fetchInstance.put(`${n.NOTIFICATION_PROFILES}/${t.guid}`, t).then((e) => e.notification_profile);
|
|
233
|
+
updateUserCommunicationProfile = async (t) => this.fetchInstance.put(n.USER_COMMUNICATION_PROFILE, t).then((e) => e.user_communication_profile);
|
|
234
|
+
getInsightsNotificationProfiles = async () => this.fetchInstance.get(`${n.NOTIFICATION_PROFILES}/${n.INSIGHTS_NOTIFICATION_PROFILES}`).then((t) => t);
|
|
247
235
|
}
|
|
248
|
-
class
|
|
236
|
+
class O {
|
|
249
237
|
fetchInstance;
|
|
250
238
|
constructor(t, e, s) {
|
|
251
|
-
this.fetchInstance = new
|
|
252
|
-
}
|
|
253
|
-
addTag = async (t) => this.fetchInstance.post(
|
|
254
|
-
addTagging = async (t) => this.fetchInstance.post(
|
|
255
|
-
addTransaction = async (t) => this.fetchInstance.post(
|
|
256
|
-
addTransactionRule = async (t) => this.fetchInstance.post(
|
|
257
|
-
getTaggings = async () => this.fetchInstance.get(
|
|
258
|
-
getTags = async () => this.fetchInstance.get(
|
|
259
|
-
getTransactionRules = async () => this.fetchInstance.get(
|
|
260
|
-
getTransactionsByDateRange = async (t, e) => this.fetchInstance.get(`${
|
|
239
|
+
this.fetchInstance = new p(t, e, void 0, s);
|
|
240
|
+
}
|
|
241
|
+
addTag = async (t) => this.fetchInstance.post(n.TAGS, t).then((e) => e.tag);
|
|
242
|
+
addTagging = async (t) => this.fetchInstance.post(n.TAGGINGS, t).then((e) => e.tagging);
|
|
243
|
+
addTransaction = async (t) => this.fetchInstance.post(n.TRANSACTIONS, t).then((e) => e.transaction);
|
|
244
|
+
addTransactionRule = async (t) => this.fetchInstance.post(n.TRANSACTION_RULES, t).then((e) => e);
|
|
245
|
+
getTaggings = async () => this.fetchInstance.get(n.TAGGINGS).then((t) => t.map((e) => e.tagging));
|
|
246
|
+
getTags = async () => this.fetchInstance.get(n.TAGS).then((t) => t.map((e) => e.tag));
|
|
247
|
+
getTransactionRules = async () => this.fetchInstance.get(n.TRANSACTION_RULES).then((t) => t.transaction_rules);
|
|
248
|
+
getTransactionsByDateRange = async (t, e) => this.fetchInstance.get(`${n.TRANSACTIONS}/by_date/${t}/${e}`).then((s) => s.map((a) => a.transaction));
|
|
261
249
|
// DEPRECATED
|
|
262
250
|
getTransactionsByAccountsAndDateRange = async (t, e, s) => {
|
|
263
251
|
console.warn("DEPRECATED: getTransactionsByAccountsAndDateRange will be removed");
|
|
264
252
|
const a = t.reduce(
|
|
265
|
-
(o,
|
|
253
|
+
(o, i, l) => `${o}account_guids[]=${i}${l !== t.length - 1 ? "&" : ""}`,
|
|
266
254
|
""
|
|
267
255
|
);
|
|
268
|
-
return this.fetchInstance.get(`${
|
|
256
|
+
return this.fetchInstance.get(`${n.TRANSACTIONS}/by_date/${e}/${s}?${a}`).then((o) => o.map((i) => i.transaction));
|
|
269
257
|
};
|
|
270
258
|
// DEPRECATED
|
|
271
|
-
getTransactionsByGuids = async (t) => (console.warn("DEPRECATED: getTransactionsByGuids will be removed"), this.fetchInstance.post(`${
|
|
259
|
+
getTransactionsByGuids = async (t) => (console.warn("DEPRECATED: getTransactionsByGuids will be removed"), this.fetchInstance.post(`${n.TRANSACTIONS}/by_guids`, { guids: t.join("+") }).then((e) => e.map((s) => s.transaction)));
|
|
272
260
|
// DEPRECATED
|
|
273
261
|
getTransactionsByCategoryAndDate = async (t, e, s) => (console.warn("DEPRECATED: getTransactionsByCategoryAndDate will be removed"), this.fetchInstance.get(
|
|
274
|
-
`${
|
|
262
|
+
`${n.TRANSACTIONS}/by_category_guid/${t}/by_date/${e}/${s}`
|
|
275
263
|
).then((a) => a.map((o) => o.transaction)));
|
|
276
264
|
// DEPRECATED
|
|
277
265
|
getTransactionsByCategoryDateAndAccounts = async (t, e, s, a) => {
|
|
278
266
|
console.warn("DEPRECATED: getTransactionsByCategoryDateAndAccounts will be removed");
|
|
279
267
|
const o = a.reduce(
|
|
280
|
-
(
|
|
268
|
+
(i, l, g) => `${i}account_guids[]=${l}${g !== a.length - 1 ? "&" : ""}`,
|
|
281
269
|
""
|
|
282
270
|
);
|
|
283
271
|
return this.fetchInstance.get(
|
|
284
|
-
`${
|
|
285
|
-
).then((
|
|
272
|
+
`${n.TRANSACTIONS}/by_category_guid/${t}/by_date/${e}/${s}?${o}`
|
|
273
|
+
).then((i) => i.map((l) => l.transaction));
|
|
286
274
|
};
|
|
287
275
|
// DEPRECATED
|
|
288
276
|
getTransactionsByCategoriesDateAndAccounts = async (t, e, s, a) => {
|
|
289
277
|
console.warn("DEPRECATED: getTransactionsByCategoriesDateAndAccounts will be removed");
|
|
290
278
|
const o = a.reduce(
|
|
291
|
-
(
|
|
279
|
+
(i, l, g) => `${i}account_guids[]=${l}${g !== a.length - 1 ? "&" : ""}`,
|
|
292
280
|
""
|
|
293
281
|
);
|
|
294
282
|
return this.fetchInstance.get(
|
|
295
|
-
`${
|
|
283
|
+
`${n.TRANSACTIONS}/by_category_guids/${t.join(
|
|
296
284
|
"+"
|
|
297
285
|
)}/by_date/${e}/${s}?${o}`
|
|
298
|
-
).then((
|
|
286
|
+
).then((i) => i.map((l) => l.transaction));
|
|
299
287
|
};
|
|
300
288
|
/**
|
|
301
289
|
* DEPRECATED
|
|
@@ -308,44 +296,44 @@ class B {
|
|
|
308
296
|
*/
|
|
309
297
|
getTransactionsByTopLevelCategoryAndDate = async (t, e, s, a = []) => {
|
|
310
298
|
console.warn("DEPRECATED: getTransactionsByTopLevelCategoryAndDate will be removed");
|
|
311
|
-
let o = `${
|
|
299
|
+
let o = `${n.TRANSACTIONS}/by_top_level_category_guid/${t}/by_date/${e}/${s}`;
|
|
312
300
|
if (a.length > 0) {
|
|
313
|
-
const
|
|
314
|
-
(l,
|
|
301
|
+
const i = a.reduce(
|
|
302
|
+
(l, g, y) => `${l}account_guids[]=${g}${y !== a.length - 1 ? "&" : ""}`,
|
|
315
303
|
""
|
|
316
304
|
);
|
|
317
|
-
o += `?${
|
|
318
|
-
}
|
|
319
|
-
return this.fetchInstance.get(o).then((
|
|
320
|
-
};
|
|
321
|
-
removeTag = async (t) => this.fetchInstance.delete(`${
|
|
322
|
-
removeTagging = async (t) => this.fetchInstance.delete(`${
|
|
323
|
-
removeTransaction = async (t) => this.fetchInstance.delete(`${
|
|
324
|
-
removeTransactionRule = async (t) => this.fetchInstance.delete(`${
|
|
325
|
-
removeTransactionSplit = async (t) => this.fetchInstance.delete(`${
|
|
326
|
-
updateTransactionRule = async (t) => this.fetchInstance.put(`${
|
|
327
|
-
updateTag = async (t) => this.fetchInstance.put(`${
|
|
328
|
-
updateTransaction = async (t) => this.fetchInstance.put(`${
|
|
305
|
+
o += `?${i}`;
|
|
306
|
+
}
|
|
307
|
+
return this.fetchInstance.get(o).then((i) => i.map((l) => l.transaction));
|
|
308
|
+
};
|
|
309
|
+
removeTag = async (t) => this.fetchInstance.delete(`${n.TAGS}/${t}`).then((e) => e);
|
|
310
|
+
removeTagging = async (t) => this.fetchInstance.delete(`${n.TAGGINGS}/${t}`).then((e) => e);
|
|
311
|
+
removeTransaction = async (t) => this.fetchInstance.delete(`${n.TRANSACTIONS}/${t}`).then((e) => e);
|
|
312
|
+
removeTransactionRule = async (t) => this.fetchInstance.delete(`${n.TRANSACTION_RULES}/${t}`);
|
|
313
|
+
removeTransactionSplit = async (t) => this.fetchInstance.delete(`${n.TRANSACTIONS}/${t}/unsplit`).then((e) => e);
|
|
314
|
+
updateTransactionRule = async (t) => this.fetchInstance.put(`${n.TRANSACTION_RULES}/${t.guid}`, t).then((e) => e);
|
|
315
|
+
updateTag = async (t) => this.fetchInstance.put(`${n.TAGS}/${t.guid}`, t).then((e) => e.tag);
|
|
316
|
+
updateTransaction = async (t) => this.fetchInstance.put(`${n.TRANSACTIONS}/${t.guid}`, t).then((e) => e.transaction);
|
|
329
317
|
}
|
|
330
|
-
class
|
|
318
|
+
class ct {
|
|
331
319
|
fetchInstance;
|
|
332
320
|
constructor(t, e, s) {
|
|
333
|
-
this.fetchInstance = new
|
|
321
|
+
this.fetchInstance = new p(t, e, void 0, s);
|
|
334
322
|
}
|
|
335
|
-
getUserFeatures = async () => this.fetchInstance.get(
|
|
336
|
-
updateUser = async (t) => this.fetchInstance.put(
|
|
337
|
-
updateUserProfile = async (t) => this.fetchInstance.put(`${
|
|
323
|
+
getUserFeatures = async () => this.fetchInstance.get(n.USER_FEATURES).then((t) => t.user_features);
|
|
324
|
+
updateUser = async (t) => this.fetchInstance.put(n.USER, t).then((e) => e.user);
|
|
325
|
+
updateUserProfile = async (t) => this.fetchInstance.put(`${n.USER_PROFILES}/${t.guid}`, t).then((e) => e.user_profile);
|
|
338
326
|
}
|
|
339
|
-
class
|
|
327
|
+
class lt {
|
|
340
328
|
fetchInstance;
|
|
341
329
|
constructor(t, e) {
|
|
342
|
-
this.fetchInstance = new
|
|
330
|
+
this.fetchInstance = new p(t, e);
|
|
343
331
|
}
|
|
344
|
-
requestWidgetUrl = async (t) => this.fetchInstance.post(
|
|
332
|
+
requestWidgetUrl = async (t) => this.fetchInstance.post(n.WIDGET_URLS, t).then((e) => e.widget_url);
|
|
345
333
|
}
|
|
346
334
|
class ce {
|
|
347
335
|
globalStore;
|
|
348
|
-
api = new
|
|
336
|
+
api = new M("/", "");
|
|
349
337
|
accounts = [];
|
|
350
338
|
accountsLoaded = !1;
|
|
351
339
|
accountsLoading = !1;
|
|
@@ -357,7 +345,7 @@ class ce {
|
|
|
357
345
|
membersLoading = !1;
|
|
358
346
|
uiStore;
|
|
359
347
|
constructor(t) {
|
|
360
|
-
this.globalStore = t, this.uiStore = new le(), this.api = new
|
|
348
|
+
this.globalStore = t, this.uiStore = new le(), this.api = new M(t.endpoint, t.sessionToken, t.onError), h(this);
|
|
361
349
|
}
|
|
362
350
|
loadAccountData = async () => {
|
|
363
351
|
await Promise.all([this.loadAccounts(), this.loadMembers(), this.loadInstitutions()]);
|
|
@@ -366,8 +354,8 @@ class ce {
|
|
|
366
354
|
return this.accountsLoaded && this.membersLoaded && this.institutionsLoaded;
|
|
367
355
|
}
|
|
368
356
|
get detailedAccounts() {
|
|
369
|
-
const t = this.globalStore.userStore.userFeatures, e =
|
|
370
|
-
return
|
|
357
|
+
const t = this.globalStore.userStore.userFeatures, e = wt(t, "MD_EXCLUDE_EXTERNAL_ACCOUNTS"), s = this.globalStore.appConfig.config.display_only_external_accounts_in_accounts && this.globalStore.appConfig.options.subtype === "accounts";
|
|
358
|
+
return bt(
|
|
371
359
|
this.accounts,
|
|
372
360
|
this.institutions,
|
|
373
361
|
this.members,
|
|
@@ -384,43 +372,43 @@ class ce {
|
|
|
384
372
|
}
|
|
385
373
|
get cashAccounts() {
|
|
386
374
|
return this.detailedAccounts.filter(
|
|
387
|
-
(t) => t.account_type ===
|
|
375
|
+
(t) => t.account_type === d.CASH || t.account_type === d.CHECKING || t.account_type === d.PREPAID || t.account_type === d.SAVINGS || t.account_type === d.CHECKING_LINE_OF_CREDIT
|
|
388
376
|
);
|
|
389
377
|
}
|
|
390
378
|
get cashBalance() {
|
|
391
379
|
return this.cashAccounts.reduce((t, e) => t + (e?.balance || 0), 0);
|
|
392
380
|
}
|
|
393
381
|
get checkingAccounts() {
|
|
394
|
-
return this.detailedAccounts.filter((t) => t.account_type ===
|
|
382
|
+
return this.detailedAccounts.filter((t) => t.account_type === d.CHECKING);
|
|
395
383
|
}
|
|
396
384
|
get debtAccounts() {
|
|
397
385
|
return this.detailedAccounts.filter(
|
|
398
|
-
(t) => t.account_type ===
|
|
386
|
+
(t) => t.account_type === d.CREDIT_CARD || t.account_type === d.LOAN || t.account_type === d.MORTGAGE || t.account_type === d.LINE_OF_CREDIT || t.account_type === d.CHECKING_LINE_OF_CREDIT
|
|
399
387
|
);
|
|
400
388
|
}
|
|
401
389
|
get finstrongAccounts() {
|
|
402
390
|
const t = /* @__PURE__ */ new Set([
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
391
|
+
d.CHECKING,
|
|
392
|
+
d.SAVINGS,
|
|
393
|
+
d.CREDIT_CARD,
|
|
394
|
+
d.INVESTMENT
|
|
407
395
|
]);
|
|
408
396
|
return this.detailedAccounts.filter((e) => t.has(e.account_type));
|
|
409
397
|
}
|
|
410
398
|
get investmentAccounts() {
|
|
411
399
|
return this.detailedAccounts.filter(
|
|
412
|
-
(t) => t.account_type ===
|
|
400
|
+
(t) => t.account_type === d.INVESTMENT
|
|
413
401
|
);
|
|
414
402
|
}
|
|
415
403
|
get manualAccounts() {
|
|
416
404
|
return this.detailedAccounts.filter((t) => t.is_manual);
|
|
417
405
|
}
|
|
418
406
|
get savingsAccounts() {
|
|
419
|
-
return this.detailedAccounts.filter((t) => t.account_type ===
|
|
407
|
+
return this.detailedAccounts.filter((t) => t.account_type === d.SAVINGS);
|
|
420
408
|
}
|
|
421
409
|
get retirementAccounts() {
|
|
422
410
|
return this.detailedAccounts.filter(
|
|
423
|
-
(t) => t.account_type ===
|
|
411
|
+
(t) => t.account_type === d.INVESTMENT || t.account_type === d.SAVINGS || t.account_type === d.CHECKING || t.account_type === d.CASH || t.account_type === d.PROPERTY || t.account_type === d.INSURANCE && (t.account_subtype === $.WHOLE_LIFE || t.account_subtype === $.UNIVERSAL_LIFE || t.account_subtype === $.VARIABLE_UNIVERSAL_LIFE)
|
|
424
412
|
);
|
|
425
413
|
}
|
|
426
414
|
get visibleAccounts() {
|
|
@@ -460,7 +448,7 @@ class ce {
|
|
|
460
448
|
}
|
|
461
449
|
get savingsAndCheckingAccounts() {
|
|
462
450
|
return this.accounts.filter(
|
|
463
|
-
(e) => e.account_type ===
|
|
451
|
+
(e) => e.account_type === d.SAVINGS || e.account_type === d.CHECKING
|
|
464
452
|
);
|
|
465
453
|
}
|
|
466
454
|
setAccounts = (t) => {
|
|
@@ -479,7 +467,7 @@ class ce {
|
|
|
479
467
|
this.accounts = [...this.accounts, e];
|
|
480
468
|
});
|
|
481
469
|
} catch (e) {
|
|
482
|
-
console.error(
|
|
470
|
+
console.error("Error occurred while adding an account:", e), this.globalStore.captureException(e, { store: "AccountStore" });
|
|
483
471
|
}
|
|
484
472
|
};
|
|
485
473
|
loadAccounts = async () => {
|
|
@@ -489,7 +477,7 @@ class ce {
|
|
|
489
477
|
const t = await this.api.getAccounts();
|
|
490
478
|
this.setAccounts(t);
|
|
491
479
|
} catch (t) {
|
|
492
|
-
console.error(
|
|
480
|
+
console.error("Error occurred while loading accounts:", t), this.globalStore.captureException(t, { store: "AccountStore" }), this.setAccounts([]);
|
|
493
481
|
}
|
|
494
482
|
}
|
|
495
483
|
};
|
|
@@ -500,7 +488,7 @@ class ce {
|
|
|
500
488
|
const t = await this.api.getInstitutions();
|
|
501
489
|
this.setInstitutions(t);
|
|
502
490
|
} catch (t) {
|
|
503
|
-
console.error(
|
|
491
|
+
console.error("Error occurred while loading institutions:", t), this.globalStore.captureException(t, { store: "AccountStore" }), this.setInstitutions([]);
|
|
504
492
|
}
|
|
505
493
|
}
|
|
506
494
|
};
|
|
@@ -511,7 +499,7 @@ class ce {
|
|
|
511
499
|
const t = await this.api.getMembers();
|
|
512
500
|
this.setMembers(t);
|
|
513
501
|
} catch (t) {
|
|
514
|
-
console.error(
|
|
502
|
+
console.error("Error occurred while loading members:", t), this.globalStore.captureException(t, { store: "AccountStore" }), this.setMembers([]);
|
|
515
503
|
}
|
|
516
504
|
}
|
|
517
505
|
};
|
|
@@ -519,13 +507,13 @@ class ce {
|
|
|
519
507
|
try {
|
|
520
508
|
const e = await this.api.mergeAccounts(t), s = e[Object.keys(e)[0]];
|
|
521
509
|
c(() => {
|
|
522
|
-
const a = this.accounts.findIndex((
|
|
510
|
+
const a = this.accounts.findIndex((i) => i.guid === t[1]);
|
|
523
511
|
this.accounts.splice(a, 1);
|
|
524
|
-
const o = this.accounts.findIndex((
|
|
512
|
+
const o = this.accounts.findIndex((i) => i.guid === t[0]);
|
|
525
513
|
this.accounts.splice(o, 1, s);
|
|
526
514
|
});
|
|
527
515
|
} catch (e) {
|
|
528
|
-
console.error(
|
|
516
|
+
console.error("Error occurred while merging accounts:", e), this.globalStore.captureException(e, { store: "AccountStore" });
|
|
529
517
|
}
|
|
530
518
|
};
|
|
531
519
|
/**
|
|
@@ -538,7 +526,7 @@ class ce {
|
|
|
538
526
|
try {
|
|
539
527
|
await this.api.refreshAllMembers();
|
|
540
528
|
} catch (t) {
|
|
541
|
-
console.error(
|
|
529
|
+
console.error("Error occurred while refreshing members:", t), this.globalStore.captureException(t, { store: "AccountStore" });
|
|
542
530
|
}
|
|
543
531
|
};
|
|
544
532
|
removeAccount = async (t) => {
|
|
@@ -547,7 +535,7 @@ class ce {
|
|
|
547
535
|
const e = this.accounts.findIndex((s) => s.guid === t);
|
|
548
536
|
this.accounts.splice(e, 1);
|
|
549
537
|
} catch (e) {
|
|
550
|
-
console.error(
|
|
538
|
+
console.error("Error occurred while removing an account:", e), this.globalStore.captureException(e, { store: "AccountStore" });
|
|
551
539
|
}
|
|
552
540
|
};
|
|
553
541
|
updateAccount = async (t) => {
|
|
@@ -557,7 +545,7 @@ class ce {
|
|
|
557
545
|
);
|
|
558
546
|
this.accounts.splice(s, 1, e);
|
|
559
547
|
} catch (e) {
|
|
560
|
-
console.error(
|
|
548
|
+
console.error("Error occurred while updating account:", e), this.globalStore.captureException(e, { store: "AccountStore" });
|
|
561
549
|
}
|
|
562
550
|
};
|
|
563
551
|
updateAccountBalance = (t, e) => {
|
|
@@ -567,37 +555,46 @@ class ce {
|
|
|
567
555
|
});
|
|
568
556
|
};
|
|
569
557
|
updateAccountFilter = async (t) => {
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
const l
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
558
|
+
try {
|
|
559
|
+
const e = [];
|
|
560
|
+
for (const [i, l] of t.entries()) {
|
|
561
|
+
const g = this.accounts.find((y) => y.guid === i);
|
|
562
|
+
if (g && g.is_excluded_from_accounts === l) {
|
|
563
|
+
const y = { ...g, is_excluded_from_accounts: !l };
|
|
564
|
+
e.push(
|
|
565
|
+
this.api.updateAccount(y).catch((R) => (console.error("Error occurred while updating account filter:", R), this.globalStore.captureException(R, { store: "AccountStore" }), null))
|
|
566
|
+
);
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
const a = (await Promise.all(e)).filter((i) => i !== null), o = [...this.accounts];
|
|
570
|
+
for (const i of a) {
|
|
571
|
+
const l = o.findIndex((g) => g.guid === i.guid);
|
|
572
|
+
l !== -1 && o.splice(l, 1, i);
|
|
573
|
+
}
|
|
574
|
+
this.setAccounts(o);
|
|
575
|
+
} catch (e) {
|
|
576
|
+
console.error("Error occurred while updating account filter:", e), this.globalStore.captureException(e, { store: "AccountStore" });
|
|
579
577
|
}
|
|
580
|
-
this.setAccounts(a);
|
|
581
578
|
};
|
|
582
579
|
}
|
|
583
580
|
let le = class {
|
|
584
581
|
selectedAccount = {};
|
|
585
582
|
selectedMember = {};
|
|
586
583
|
constructor() {
|
|
587
|
-
|
|
584
|
+
h(this);
|
|
588
585
|
}
|
|
589
586
|
setSelectedAccount = (t) => this.selectedAccount = t;
|
|
590
587
|
setSelectedMember = (t) => this.selectedMember = t;
|
|
591
588
|
};
|
|
592
|
-
class
|
|
589
|
+
class he {
|
|
593
590
|
globalStore;
|
|
594
|
-
api = new
|
|
595
|
-
bannerApi = new
|
|
591
|
+
api = new j("/", "");
|
|
592
|
+
bannerApi = new X("/");
|
|
596
593
|
appData = {};
|
|
597
594
|
isAppDataLoaded = !1;
|
|
598
595
|
banner = {};
|
|
599
596
|
constructor(t) {
|
|
600
|
-
this.globalStore = t, this.api = new
|
|
597
|
+
this.globalStore = t, this.api = new j(t.endpoint, t.sessionToken, t.onError), h(this);
|
|
601
598
|
}
|
|
602
599
|
get appConfig() {
|
|
603
600
|
return this.globalStore.appConfig;
|
|
@@ -618,14 +615,14 @@ class de {
|
|
|
618
615
|
return this.appData.user_profile;
|
|
619
616
|
}
|
|
620
617
|
setAppData = (t) => {
|
|
621
|
-
this.appData = t, this.bannerApi = new
|
|
618
|
+
this.appData = t, this.bannerApi = new X(t.address?.bullseye || "/"), this.isAppDataLoaded = !0;
|
|
622
619
|
};
|
|
623
620
|
loadAppData = async () => {
|
|
624
621
|
try {
|
|
625
622
|
const t = await this.api.getAppData();
|
|
626
623
|
this.setAppData(t);
|
|
627
624
|
} catch (t) {
|
|
628
|
-
console.error(
|
|
625
|
+
console.error("Error loading app data:", t), this.globalStore.captureException(t, { store: "AppDataStore" });
|
|
629
626
|
}
|
|
630
627
|
};
|
|
631
628
|
loadBanner = async () => {
|
|
@@ -635,14 +632,14 @@ class de {
|
|
|
635
632
|
this.banner = e;
|
|
636
633
|
});
|
|
637
634
|
} catch (t) {
|
|
638
|
-
console.error(
|
|
635
|
+
console.error("Error loading banner:", t), this.globalStore.captureException(t, { store: "AppDataStore" });
|
|
639
636
|
}
|
|
640
637
|
};
|
|
641
638
|
setUser = (t) => this.appData.user = t;
|
|
642
639
|
setUserCommunicationProfile = (t) => this.appData.user_communication_profile = t;
|
|
643
640
|
setUserProfile = (t) => this.appData.user_profile = t;
|
|
644
641
|
}
|
|
645
|
-
class
|
|
642
|
+
class de {
|
|
646
643
|
globalStore;
|
|
647
644
|
survey = null;
|
|
648
645
|
currentQuestionIndex = 0;
|
|
@@ -650,7 +647,7 @@ class he {
|
|
|
650
647
|
response = null;
|
|
651
648
|
responses = {};
|
|
652
649
|
constructor(t) {
|
|
653
|
-
this.globalStore = t,
|
|
650
|
+
this.globalStore = t, h(this);
|
|
654
651
|
}
|
|
655
652
|
get isLastQuestion() {
|
|
656
653
|
return this.currentQuestionIndex === this.surveyQuestions.length - 1;
|
|
@@ -691,36 +688,36 @@ class he {
|
|
|
691
688
|
this.response = t, this.question && (this.responses[`$survey_response_${this.question.id}`] = t);
|
|
692
689
|
};
|
|
693
690
|
}
|
|
694
|
-
function ue(
|
|
691
|
+
function ue(r, t, e, s = "asc") {
|
|
695
692
|
const a = s === "desc" ? -1 : 1;
|
|
696
|
-
return [...
|
|
693
|
+
return [...r, ...t].sort((o, i) => o[e] < i[e] ? -1 * a : o[e] > i[e] ? 1 * a : 0);
|
|
697
694
|
}
|
|
698
|
-
const ge = (
|
|
699
|
-
...
|
|
695
|
+
const ge = (r) => ({
|
|
696
|
+
...r,
|
|
700
697
|
//fields that are offer specific, adding here for visibility
|
|
701
|
-
image_url:
|
|
702
|
-
guid:
|
|
703
|
-
created_at:
|
|
704
|
-
dismissed_at:
|
|
705
|
-
active_at:
|
|
706
|
-
displayed_at:
|
|
707
|
-
post_message_secondary:
|
|
698
|
+
image_url: r.image_url,
|
|
699
|
+
guid: r.guid,
|
|
700
|
+
created_at: r.created_at,
|
|
701
|
+
dismissed_at: r.dismissed_at,
|
|
702
|
+
active_at: r.campaign_activated_at,
|
|
703
|
+
displayed_at: r.has_been_viewed,
|
|
704
|
+
post_message_secondary: r.pulse_post_message_secondary,
|
|
708
705
|
//offer fields mapped to beat fields for functionality
|
|
709
|
-
title:
|
|
710
|
-
html_title:
|
|
711
|
-
short_title:
|
|
712
|
-
html_short_title:
|
|
713
|
-
micro_title:
|
|
714
|
-
html_micro_title:
|
|
715
|
-
supporting_action:
|
|
716
|
-
description:
|
|
717
|
-
html_description:
|
|
718
|
-
micro_description:
|
|
719
|
-
html_micro_description:
|
|
720
|
-
call_to_action:
|
|
721
|
-
html_micro_call_to_action:
|
|
722
|
-
micro_call_to_action:
|
|
723
|
-
is_dismissed:
|
|
706
|
+
title: r.pulse_title || r.campaign_name,
|
|
707
|
+
html_title: r.pulse_title || r.campaign_name,
|
|
708
|
+
short_title: r.pulse_title || r.campaign_name,
|
|
709
|
+
html_short_title: r.pulse_title || r.campaign_name,
|
|
710
|
+
micro_title: r.pulse_title || r.campaign_name,
|
|
711
|
+
html_micro_title: r.pulse_title || r.campaign_name,
|
|
712
|
+
supporting_action: r.pulse_call_to_action_text_secondary,
|
|
713
|
+
description: r.pulse_body,
|
|
714
|
+
html_description: r.pulse_body,
|
|
715
|
+
micro_description: r.pulse_body,
|
|
716
|
+
html_micro_description: r.pulse_body,
|
|
717
|
+
call_to_action: r.pulse_call_to_action_text,
|
|
718
|
+
html_micro_call_to_action: r.pulse_call_to_action_text,
|
|
719
|
+
micro_call_to_action: r.pulse_call_to_action_text,
|
|
720
|
+
is_dismissed: r.has_been_dismissed,
|
|
724
721
|
icon_type: 5,
|
|
725
722
|
template: "MarketingOffer",
|
|
726
723
|
//beat fields we null out
|
|
@@ -732,7 +729,7 @@ const ge = (n) => ({
|
|
|
732
729
|
is_sampled: !1,
|
|
733
730
|
merchant_guids: [],
|
|
734
731
|
payload: {},
|
|
735
|
-
pulse_campaign_name:
|
|
732
|
+
pulse_campaign_name: r.campaign_name,
|
|
736
733
|
scheduled_payment_guids: [],
|
|
737
734
|
transaction_guids: [],
|
|
738
735
|
user_guid: "",
|
|
@@ -740,18 +737,26 @@ const ge = (n) => ({
|
|
|
740
737
|
});
|
|
741
738
|
class pe {
|
|
742
739
|
globalStore;
|
|
743
|
-
api = new
|
|
740
|
+
api = new G("/", "");
|
|
744
741
|
beats = [];
|
|
745
742
|
isLoading = !1;
|
|
746
743
|
constructor(t) {
|
|
747
|
-
this.globalStore = t, this.api = new
|
|
744
|
+
this.globalStore = t, this.api = new G(t.endpoint, t.sessionToken, t.onError), h(this);
|
|
748
745
|
}
|
|
749
746
|
loadBeats = async () => {
|
|
750
747
|
this.isLoading = !0;
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
748
|
+
try {
|
|
749
|
+
const t = await this.api.getBeats(), s = (await this.api.getOffers()).map((a) => ge(a));
|
|
750
|
+
c(() => {
|
|
751
|
+
this.beats = ue(t, s, "active_at", "desc");
|
|
752
|
+
});
|
|
753
|
+
} catch (t) {
|
|
754
|
+
console.error("Error occurred while loading beats:", t), this.globalStore.captureException(t, { store: "BeatStore" });
|
|
755
|
+
} finally {
|
|
756
|
+
c(() => {
|
|
757
|
+
this.isLoading = !1;
|
|
758
|
+
});
|
|
759
|
+
}
|
|
755
760
|
};
|
|
756
761
|
getFilteredBeats(t) {
|
|
757
762
|
const { categoryGuids: e, templates: s } = t;
|
|
@@ -768,10 +773,10 @@ class pe {
|
|
|
768
773
|
}
|
|
769
774
|
}
|
|
770
775
|
class _e {
|
|
771
|
-
api = new
|
|
776
|
+
api = new J("/", "");
|
|
772
777
|
globalStore;
|
|
773
778
|
alert = "";
|
|
774
|
-
dateRange = { start: C(
|
|
779
|
+
dateRange = { start: C(f()), end: b(f()) };
|
|
775
780
|
budgets = [];
|
|
776
781
|
selectedBudget;
|
|
777
782
|
selectedSubBudget;
|
|
@@ -779,17 +784,17 @@ class _e {
|
|
|
779
784
|
theme = {};
|
|
780
785
|
merchantBudgets = [];
|
|
781
786
|
constructor(t) {
|
|
782
|
-
this.globalStore = t, this.api = new
|
|
787
|
+
this.globalStore = t, this.api = new J(t.endpoint, t.sessionToken, t.onError), h(this);
|
|
783
788
|
}
|
|
784
789
|
loadBudgetData = async () => {
|
|
785
|
-
this.globalStore.recurringTransactionsStore.isDataLoaded || await this.globalStore.recurringTransactionsStore.loadRepeatingTransactionData(), await this.loadBudgets(),
|
|
790
|
+
this.globalStore.recurringTransactionsStore.isDataLoaded || await this.globalStore.recurringTransactionsStore.loadRepeatingTransactionData(), await this.loadBudgets(), gt(
|
|
786
791
|
() => this.detailedBudgets,
|
|
787
792
|
(t) => {
|
|
788
793
|
if (t) {
|
|
789
794
|
const e = this.selectedBudget;
|
|
790
|
-
e && (this.selectedBudget =
|
|
795
|
+
e && (this.selectedBudget = Et(t, e.guid));
|
|
791
796
|
const s = this.selectedSubBudget;
|
|
792
|
-
s && s.parent_guid && (this.selectedSubBudget =
|
|
797
|
+
s && s.parent_guid && (this.selectedSubBudget = It(
|
|
793
798
|
t,
|
|
794
799
|
s.guid,
|
|
795
800
|
s.parent_guid
|
|
@@ -799,7 +804,7 @@ class _e {
|
|
|
799
804
|
);
|
|
800
805
|
};
|
|
801
806
|
get detailedBudgets() {
|
|
802
|
-
return
|
|
807
|
+
return V(
|
|
803
808
|
this.budgets.filter(
|
|
804
809
|
(t) => t.category_guid !== w.INCOME && t.category_guid !== w.TRANSFER && t.category_guid !== w.INVESTMENTS
|
|
805
810
|
),
|
|
@@ -810,7 +815,7 @@ class _e {
|
|
|
810
815
|
}
|
|
811
816
|
// TODO: Replace this with income from recurring transactions. Income budgets are deprecated.
|
|
812
817
|
get incomeBudget() {
|
|
813
|
-
return
|
|
818
|
+
return V(
|
|
814
819
|
this.budgets.filter((s) => !s.parent_guid),
|
|
815
820
|
this.globalStore.categoryStore.detailedCategories,
|
|
816
821
|
this.globalStore.copyStore.copy.budgets,
|
|
@@ -835,7 +840,7 @@ class _e {
|
|
|
835
840
|
this.budgets.push(a);
|
|
836
841
|
});
|
|
837
842
|
} catch (a) {
|
|
838
|
-
console.error(
|
|
843
|
+
console.error("Error adding budget:", a), this.globalStore.captureException(a, { store: "BudgetsStore" });
|
|
839
844
|
}
|
|
840
845
|
};
|
|
841
846
|
deleteBudget = async (t) => {
|
|
@@ -845,7 +850,7 @@ class _e {
|
|
|
845
850
|
e >= 0 && this.budgets.splice(e, 1);
|
|
846
851
|
});
|
|
847
852
|
} catch (e) {
|
|
848
|
-
console.error(
|
|
853
|
+
console.error("Error deleting budget:", e), this.globalStore.captureException(e, { store: "BudgetsStore" });
|
|
849
854
|
}
|
|
850
855
|
};
|
|
851
856
|
loadBudgets = async () => {
|
|
@@ -853,7 +858,7 @@ class _e {
|
|
|
853
858
|
const t = await this.api.getBudgets();
|
|
854
859
|
this.setBudgets(t);
|
|
855
860
|
} catch (t) {
|
|
856
|
-
throw console.error(
|
|
861
|
+
throw console.error("Error occurred while loading budgets:", t), this.globalStore.captureException(t, { store: "BudgetsStore" }), t;
|
|
857
862
|
}
|
|
858
863
|
};
|
|
859
864
|
setAlert = (t) => this.alert = t;
|
|
@@ -884,7 +889,7 @@ class _e {
|
|
|
884
889
|
await this.api.deleteBudget(s.guid);
|
|
885
890
|
return await this.loadBudgets(), { data: this.budgets, isSuccess: !0 };
|
|
886
891
|
} catch (e) {
|
|
887
|
-
return console.error("
|
|
892
|
+
return console.error("Error recalculating budgets:", e), this.globalStore.captureException(e, { store: "BudgetsStore" }), { data: [], isSuccess: !1 };
|
|
888
893
|
}
|
|
889
894
|
};
|
|
890
895
|
updateBudget = async (t) => {
|
|
@@ -895,7 +900,7 @@ class _e {
|
|
|
895
900
|
s >= 0 && (this.budgets[s] = e);
|
|
896
901
|
});
|
|
897
902
|
} catch (e) {
|
|
898
|
-
console.error(
|
|
903
|
+
console.error("Error updating budget:", e), this.globalStore.captureException(e, { store: "BudgetsStore" });
|
|
899
904
|
}
|
|
900
905
|
};
|
|
901
906
|
getMerchantBudgetByMerchantGuid = (t) => this.merchantBudgets.find(
|
|
@@ -911,18 +916,18 @@ class _e {
|
|
|
911
916
|
this.merchantBudgets.push(s);
|
|
912
917
|
}), { isSuccess: !0 };
|
|
913
918
|
} catch (s) {
|
|
914
|
-
return console.error(
|
|
919
|
+
return console.error("Error adding merchant budget:", s), this.globalStore.captureException(s, { store: "BudgetsStore" }), { isSuccess: !1 };
|
|
915
920
|
}
|
|
916
921
|
};
|
|
917
922
|
updateMerchantBudget = async (t) => {
|
|
918
923
|
try {
|
|
919
924
|
const { guid: e, amount: s } = t, a = await this.api.updateMerchantBudget(e, s);
|
|
920
925
|
return c(() => {
|
|
921
|
-
const o = this.merchantBudgets.findIndex((
|
|
926
|
+
const o = this.merchantBudgets.findIndex((i) => i.guid === t.guid);
|
|
922
927
|
o >= 0 && (this.merchantBudgets[o] = a);
|
|
923
928
|
}), { isSuccess: !0 };
|
|
924
929
|
} catch (e) {
|
|
925
|
-
return console.error(
|
|
930
|
+
return console.error("Error updating merchant budget:", e), this.globalStore.captureException(e, { store: "BudgetsStore" }), { isSuccess: !1 };
|
|
926
931
|
}
|
|
927
932
|
};
|
|
928
933
|
deleteMerchantBudget = async (t) => {
|
|
@@ -931,15 +936,15 @@ class _e {
|
|
|
931
936
|
this.merchantBudgets = this.merchantBudgets.filter((e) => e.guid !== t);
|
|
932
937
|
}), { isSuccess: !0 };
|
|
933
938
|
} catch (e) {
|
|
934
|
-
return console.error(
|
|
939
|
+
return console.error("Error deleting merchant budget:", e), this.globalStore.captureException(e, { store: "BudgetsStore" }), { isSuccess: !1 };
|
|
935
940
|
}
|
|
936
941
|
};
|
|
937
942
|
}
|
|
938
|
-
class
|
|
943
|
+
class Se {
|
|
939
944
|
globalStore;
|
|
940
945
|
uiStore;
|
|
941
946
|
constructor(t) {
|
|
942
|
-
this.globalStore = t, this.uiStore = new
|
|
947
|
+
this.globalStore = t, this.uiStore = new fe(t), h(this);
|
|
943
948
|
}
|
|
944
949
|
completeOnboarding = async () => {
|
|
945
950
|
const t = {
|
|
@@ -949,16 +954,16 @@ class fe {
|
|
|
949
954
|
await this.globalStore.userStore.updateUserProfile(t);
|
|
950
955
|
};
|
|
951
956
|
}
|
|
952
|
-
let
|
|
957
|
+
let fe = class {
|
|
953
958
|
globalStore;
|
|
954
959
|
// Cashflow is hard-coded to display 30 days starting from today. This is the
|
|
955
960
|
// single source of truth for Cash Flow's window; it intentionally does NOT
|
|
956
961
|
// mutate RecurringTransactionsStore.dateRange, so Cash Flow stays decoupled
|
|
957
962
|
// from other widgets (e.g. Recurring Transactions) that drive that shared range.
|
|
958
|
-
dateRange = { start:
|
|
963
|
+
dateRange = { start: f(), end: Dt(f(), 30) };
|
|
959
964
|
isDirty = !1;
|
|
960
965
|
constructor(t) {
|
|
961
|
-
this.globalStore = t,
|
|
966
|
+
this.globalStore = t, h(this);
|
|
962
967
|
}
|
|
963
968
|
// Recurrence data scoped to Cash Flow's own dateRange, sourced from the
|
|
964
969
|
// range-parameterized helpers on RecurringTransactionsStore. Computeds (not
|
|
@@ -989,26 +994,26 @@ let ye = class {
|
|
|
989
994
|
get selectedCashBalance() {
|
|
990
995
|
const t = this.globalStore.appConfig.config.display_available_balance_in_accounts;
|
|
991
996
|
return this.selectedCashAccounts.reduce(
|
|
992
|
-
(e, s) => e +
|
|
997
|
+
(e, s) => e + At(s, t),
|
|
993
998
|
0
|
|
994
999
|
);
|
|
995
1000
|
}
|
|
996
1001
|
// Returns the number of days until the next income activity or 0 if there is no income activity
|
|
997
1002
|
get daysUntilNextIncome() {
|
|
998
|
-
return this.nextIncome ? Math.abs(
|
|
1003
|
+
return this.nextIncome ? Math.abs(xt(f(), this.nextIncome.expectedDate)) : 0;
|
|
999
1004
|
}
|
|
1000
1005
|
// Returns the expenses (Activities) until the next income activity or the end of the month
|
|
1001
1006
|
// if there is no income activity
|
|
1002
1007
|
get expensesTilNextIncome() {
|
|
1003
1008
|
return this.upcomingExpenses.filter(
|
|
1004
|
-
(t) =>
|
|
1009
|
+
(t) => W(t.expectedDate, this.nextIncome?.expectedDate || b(/* @__PURE__ */ new Date()))
|
|
1005
1010
|
);
|
|
1006
1011
|
}
|
|
1007
1012
|
};
|
|
1008
|
-
class
|
|
1013
|
+
class ye {
|
|
1009
1014
|
globalStore;
|
|
1010
1015
|
uiStore;
|
|
1011
|
-
api = new
|
|
1016
|
+
api = new Z("/", "");
|
|
1012
1017
|
categories = [];
|
|
1013
1018
|
categoriesLoaded = !1;
|
|
1014
1019
|
categoriesLoading = !1;
|
|
@@ -1019,10 +1024,10 @@ class me {
|
|
|
1019
1024
|
monthlyTotalsLoaded = !1;
|
|
1020
1025
|
monthlyTotalsLoading = !1;
|
|
1021
1026
|
constructor(t) {
|
|
1022
|
-
this.globalStore = t, this.uiStore = new
|
|
1027
|
+
this.globalStore = t, this.uiStore = new me(), this.api = new Z(t.endpoint, t.sessionToken, t.onError), h(this);
|
|
1023
1028
|
}
|
|
1024
1029
|
get detailedCategories() {
|
|
1025
|
-
return this.globalStore.isInitialized ?
|
|
1030
|
+
return this.globalStore.isInitialized ? Lt(
|
|
1026
1031
|
this.categories,
|
|
1027
1032
|
this.globalStore.copyStore.copy.categories,
|
|
1028
1033
|
this.dateRangeCategoryTotals,
|
|
@@ -1030,7 +1035,7 @@ class me {
|
|
|
1030
1035
|
) : [];
|
|
1031
1036
|
}
|
|
1032
1037
|
get detailedCategoriesWithTransactions() {
|
|
1033
|
-
return
|
|
1038
|
+
return vt(
|
|
1034
1039
|
this.detailedCategories,
|
|
1035
1040
|
this.globalStore.transactionStore.sortedTransactions
|
|
1036
1041
|
);
|
|
@@ -1063,7 +1068,7 @@ class me {
|
|
|
1063
1068
|
try {
|
|
1064
1069
|
await this.api.addCategory(s), await this.loadCategories();
|
|
1065
1070
|
} catch (a) {
|
|
1066
|
-
console.error(
|
|
1071
|
+
console.error("Error occurred while adding category:", a), this.globalStore.captureException(a, { store: "CategoryStore" });
|
|
1067
1072
|
}
|
|
1068
1073
|
};
|
|
1069
1074
|
loadCategories = async () => {
|
|
@@ -1073,7 +1078,7 @@ class me {
|
|
|
1073
1078
|
const t = await this.api.getCategories();
|
|
1074
1079
|
this.setCategories(t);
|
|
1075
1080
|
} catch (t) {
|
|
1076
|
-
console.error(
|
|
1081
|
+
console.error("Error occurred while getting categories:", t), this.globalStore.captureException(t, { store: "CategoryStore" }), c(() => {
|
|
1077
1082
|
this.categoriesLoading = !1;
|
|
1078
1083
|
});
|
|
1079
1084
|
}
|
|
@@ -1090,50 +1095,50 @@ class me {
|
|
|
1090
1095
|
);
|
|
1091
1096
|
this.setDateRangeCategoryTotals(a);
|
|
1092
1097
|
} catch (a) {
|
|
1093
|
-
console.error(
|
|
1098
|
+
console.error("Error occurred while getting date range category totals:", a), this.globalStore.captureException(a, { store: "CategoryStore" }), this.setDateRangeCategoryTotals([]);
|
|
1094
1099
|
}
|
|
1095
1100
|
}
|
|
1096
1101
|
};
|
|
1097
1102
|
loadMonthlyCategoryTotals = async (t = this.globalStore.globalUiStore.selectedAccounts, e, s) => {
|
|
1098
1103
|
if (this.monthlyTotalsLoading) return;
|
|
1099
1104
|
this.monthlyTotalsLoading = !0;
|
|
1100
|
-
const a = m(C(e ??
|
|
1105
|
+
const a = m(C(e ?? N(/* @__PURE__ */ new Date(), 11))), o = m(b(s ?? /* @__PURE__ */ new Date()));
|
|
1101
1106
|
try {
|
|
1102
|
-
const
|
|
1103
|
-
this.setMonthlyCategoryTotals(
|
|
1104
|
-
} catch (
|
|
1105
|
-
console.error(
|
|
1107
|
+
const i = await this.api.getMonthlyCategoryTotals(a, o, t);
|
|
1108
|
+
this.setMonthlyCategoryTotals(i);
|
|
1109
|
+
} catch (i) {
|
|
1110
|
+
console.error("Error occurred while getting monthly category totals:", i), this.globalStore.captureException(i, { store: "CategoryStore" }), this.setMonthlyCategoryTotals([]);
|
|
1106
1111
|
}
|
|
1107
1112
|
};
|
|
1108
1113
|
reloadCategoryTotals = async (t, e, s) => {
|
|
1109
|
-
const a = e ??
|
|
1114
|
+
const a = e ?? N(/* @__PURE__ */ new Date(), 11), o = s ?? b(/* @__PURE__ */ new Date());
|
|
1110
1115
|
try {
|
|
1111
1116
|
await Promise.all([
|
|
1112
1117
|
this.loadMonthlyCategoryTotals(t, a, o),
|
|
1113
1118
|
this.loadDateRangeCategoryTotals(t, a, o)
|
|
1114
1119
|
]);
|
|
1115
|
-
} catch (
|
|
1116
|
-
console.error(
|
|
1120
|
+
} catch (i) {
|
|
1121
|
+
console.error("Error occurred while getting category totals:", i), this.globalStore.captureException(i, { store: "CategoryStore" });
|
|
1117
1122
|
}
|
|
1118
1123
|
};
|
|
1119
1124
|
removeCategory = async (t) => {
|
|
1120
1125
|
try {
|
|
1121
1126
|
await this.api.removeCategory(t), await this.loadCategories();
|
|
1122
1127
|
} catch (e) {
|
|
1123
|
-
console.error(
|
|
1128
|
+
console.error("Error occurred while removing category:", e), this.globalStore.captureException(e, { store: "CategoryStore" });
|
|
1124
1129
|
}
|
|
1125
1130
|
};
|
|
1126
1131
|
updateCategory = async (t) => {
|
|
1127
1132
|
try {
|
|
1128
1133
|
await this.api.updateCategory(t), await this.loadCategories();
|
|
1129
1134
|
} catch (e) {
|
|
1130
|
-
console.error(
|
|
1135
|
+
console.error("Error occurred while updating category:", e), this.globalStore.captureException(e, { store: "CategoryStore" });
|
|
1131
1136
|
}
|
|
1132
1137
|
};
|
|
1133
1138
|
// TODO: Remove this after refactoring Trends components to use detailedCategories
|
|
1134
1139
|
getCategoryName = (t) => this.categories.find((s) => s.guid === t)?.name ?? Rt[t];
|
|
1135
1140
|
}
|
|
1136
|
-
let
|
|
1141
|
+
let me = class {
|
|
1137
1142
|
expandedGuid = null;
|
|
1138
1143
|
selectedGuid = null;
|
|
1139
1144
|
searchValue = "";
|
|
@@ -1144,7 +1149,7 @@ let Se = class {
|
|
|
1144
1149
|
savedOnSelect;
|
|
1145
1150
|
// todo
|
|
1146
1151
|
constructor() {
|
|
1147
|
-
|
|
1152
|
+
h(this);
|
|
1148
1153
|
}
|
|
1149
1154
|
setExpandedGuid = (t) => this.expandedGuid = t;
|
|
1150
1155
|
setSelectedGuid = (t) => this.selectedGuid = t;
|
|
@@ -1158,34 +1163,34 @@ let Se = class {
|
|
|
1158
1163
|
};
|
|
1159
1164
|
class Te {
|
|
1160
1165
|
globalStore;
|
|
1161
|
-
widgetApi = new
|
|
1166
|
+
widgetApi = new lt("/", "");
|
|
1162
1167
|
constructor(t) {
|
|
1163
|
-
this.globalStore = t, this.widgetApi = new
|
|
1168
|
+
this.globalStore = t, this.widgetApi = new lt(t.endpoint, t.sessionToken), h(this);
|
|
1164
1169
|
}
|
|
1165
1170
|
loadWidget = async ({ widget: t = "connect_widget", mode: e = "light", ...s }) => await this.widgetApi.requestWidgetUrl({
|
|
1166
1171
|
widget_url: { widget_type: t, color_scheme: e, ...s }
|
|
1167
1172
|
});
|
|
1168
1173
|
}
|
|
1169
|
-
class
|
|
1174
|
+
class be {
|
|
1170
1175
|
globalStore;
|
|
1171
1176
|
uiStore;
|
|
1172
1177
|
constructor(t) {
|
|
1173
|
-
this.globalStore = t, this.uiStore = new
|
|
1178
|
+
this.globalStore = t, this.uiStore = new Ae(), h(this);
|
|
1174
1179
|
}
|
|
1175
1180
|
get debts() {
|
|
1176
1181
|
const { visibleDebtAccounts: t } = this.globalStore.accountStore, { selectedAccountGuids: e } = this.globalStore.globalUiStore, { debtGoals: s } = this.globalStore.goalStore, a = e.length ? t.filter((o) => e.includes(o.guid)) : t;
|
|
1177
|
-
return
|
|
1182
|
+
return Ft(a, s);
|
|
1178
1183
|
}
|
|
1179
1184
|
get totalMonthlyPayments() {
|
|
1180
1185
|
return this.debts.map((e) => Number(e.monthly_payment)).filter((e) => !isNaN(e)).reduce((e, s) => e + s, 0);
|
|
1181
1186
|
}
|
|
1182
1187
|
}
|
|
1183
|
-
let
|
|
1188
|
+
let Ae = class {
|
|
1184
1189
|
isLoading = !1;
|
|
1185
1190
|
selectedDebtChartData = {};
|
|
1186
|
-
selectedDebtPriority =
|
|
1191
|
+
selectedDebtPriority = Ut.LOWEST_BALANCE;
|
|
1187
1192
|
constructor() {
|
|
1188
|
-
|
|
1193
|
+
h(this);
|
|
1189
1194
|
}
|
|
1190
1195
|
get showError() {
|
|
1191
1196
|
const { interest_rate: t, monthly_payment: e } = this.selectedDebtChartData;
|
|
@@ -1198,17 +1203,17 @@ let we = class {
|
|
|
1198
1203
|
setSelectedDebtChartData = (t) => this.selectedDebtChartData = t;
|
|
1199
1204
|
setSelectedDebtPriority = (t) => this.selectedDebtPriority = t;
|
|
1200
1205
|
};
|
|
1201
|
-
const
|
|
1202
|
-
x:
|
|
1206
|
+
const we = (r) => r.sort((t, e) => t.monthly_health_score_average.year !== e.monthly_health_score_average.year ? t.monthly_health_score_average.year - e.monthly_health_score_average.year : t.monthly_health_score_average.month - e.monthly_health_score_average.month).map((t) => ({
|
|
1207
|
+
x: k(
|
|
1203
1208
|
new Date(0, t.monthly_health_score_average.month - 1, 1),
|
|
1204
|
-
|
|
1209
|
+
H.MONTH_SHORT
|
|
1205
1210
|
),
|
|
1206
1211
|
y: Math.round(t.monthly_health_score_average.average_health_score)
|
|
1207
|
-
})),
|
|
1212
|
+
})), Ee = (r) => r.map(({ transaction: e }) => ({
|
|
1208
1213
|
...e
|
|
1209
1214
|
})).sort((e, s) => s.date - e.date);
|
|
1210
|
-
class
|
|
1211
|
-
api = new
|
|
1215
|
+
class Ie {
|
|
1216
|
+
api = new tt("/", "");
|
|
1212
1217
|
augmentedChartData = [];
|
|
1213
1218
|
averageHealthScores = [];
|
|
1214
1219
|
monthlySummaries = [];
|
|
@@ -1224,7 +1229,7 @@ class Ee {
|
|
|
1224
1229
|
isSpendingInitialized = !1;
|
|
1225
1230
|
isIncomeInitialized = !1;
|
|
1226
1231
|
constructor(t) {
|
|
1227
|
-
this.globalStore = t, this.api = new
|
|
1232
|
+
this.globalStore = t, this.api = new tt(t.endpoint, t.sessionToken, t.onError), h(this);
|
|
1228
1233
|
}
|
|
1229
1234
|
setSpendingInitialized = (t) => {
|
|
1230
1235
|
this.isSpendingInitialized = t;
|
|
@@ -1242,7 +1247,7 @@ class Ee {
|
|
|
1242
1247
|
this.healthScore = e, this.healthScoreChange = s;
|
|
1243
1248
|
});
|
|
1244
1249
|
} catch (e) {
|
|
1245
|
-
console.error("Error calculating health score:", e);
|
|
1250
|
+
console.error("Error calculating health score:", e), this.globalStore.captureException(e, { store: "FinstrongStore" });
|
|
1246
1251
|
}
|
|
1247
1252
|
};
|
|
1248
1253
|
loadAverageHealthScores = async () => {
|
|
@@ -1252,7 +1257,7 @@ class Ee {
|
|
|
1252
1257
|
this.averageHealthScores = t;
|
|
1253
1258
|
});
|
|
1254
1259
|
} catch (t) {
|
|
1255
|
-
console.error("Error loading average health scores:", t);
|
|
1260
|
+
console.error("Error loading average health scores:", t), this.globalStore.captureException(t, { store: "FinstrongStore" });
|
|
1256
1261
|
}
|
|
1257
1262
|
};
|
|
1258
1263
|
loadMonthlySummaries = async () => {
|
|
@@ -1262,7 +1267,7 @@ class Ee {
|
|
|
1262
1267
|
this.monthlySummaries = t;
|
|
1263
1268
|
});
|
|
1264
1269
|
} catch (t) {
|
|
1265
|
-
console.error("Error loading monthly summaries:", t);
|
|
1270
|
+
console.error("Error loading monthly summaries:", t), this.globalStore.captureException(t, { store: "FinstrongStore" });
|
|
1266
1271
|
}
|
|
1267
1272
|
};
|
|
1268
1273
|
loadDebtSpend = async () => {
|
|
@@ -1272,7 +1277,7 @@ class Ee {
|
|
|
1272
1277
|
this.debtSpendTransactions = t;
|
|
1273
1278
|
});
|
|
1274
1279
|
} catch (t) {
|
|
1275
|
-
console.error("Error loading debt spend:", t);
|
|
1280
|
+
console.error("Error loading debt spend:", t), this.globalStore.captureException(t, { store: "FinstrongStore" });
|
|
1276
1281
|
}
|
|
1277
1282
|
};
|
|
1278
1283
|
loadIncome = async () => {
|
|
@@ -1283,11 +1288,11 @@ class Ee {
|
|
|
1283
1288
|
this.incomeTransactions = t, this.setIncomeInitialized(!0);
|
|
1284
1289
|
});
|
|
1285
1290
|
} catch (t) {
|
|
1286
|
-
console.error("Error loading income:", t);
|
|
1291
|
+
console.error("Error loading income:", t), this.globalStore.captureException(t, { store: "FinstrongStore" });
|
|
1287
1292
|
}
|
|
1288
1293
|
};
|
|
1289
1294
|
loadHealthScoreChangeReports = async () => {
|
|
1290
|
-
const t = m(
|
|
1295
|
+
const t = m(N(/* @__PURE__ */ new Date(), 2)), e = m(/* @__PURE__ */ new Date());
|
|
1291
1296
|
try {
|
|
1292
1297
|
const s = await this.api.getHealthScoreChangeReports(
|
|
1293
1298
|
t,
|
|
@@ -1297,7 +1302,7 @@ class Ee {
|
|
|
1297
1302
|
this.healthScoreChangeReports = s;
|
|
1298
1303
|
});
|
|
1299
1304
|
} catch (s) {
|
|
1300
|
-
console.error("Error loading health score change reports:", s);
|
|
1305
|
+
console.error("Error loading health score change reports:", s), this.globalStore.captureException(s, { store: "FinstrongStore" });
|
|
1301
1306
|
}
|
|
1302
1307
|
};
|
|
1303
1308
|
loadPeerScore = async () => {
|
|
@@ -1308,27 +1313,27 @@ class Ee {
|
|
|
1308
1313
|
this.peerScore = e;
|
|
1309
1314
|
});
|
|
1310
1315
|
} catch (e) {
|
|
1311
|
-
console.error("Error loading peer score:", e);
|
|
1316
|
+
console.error("Error loading peer score:", e), this.globalStore.captureException(e, { store: "FinstrongStore" });
|
|
1312
1317
|
}
|
|
1313
1318
|
};
|
|
1314
1319
|
loadAugmentedChartData = async () => {
|
|
1315
1320
|
try {
|
|
1316
1321
|
const t = await this.api.getAverageHealthScores();
|
|
1317
1322
|
c(() => {
|
|
1318
|
-
this.augmentedChartData =
|
|
1323
|
+
this.augmentedChartData = we(t);
|
|
1319
1324
|
});
|
|
1320
1325
|
} catch (t) {
|
|
1321
|
-
console.error(
|
|
1326
|
+
console.error("Error occurred while getting augmented chart data:", t), this.globalStore.captureException(t, { store: "FinstrongStore" });
|
|
1322
1327
|
}
|
|
1323
1328
|
};
|
|
1324
1329
|
getSpendingFeeTransactions = async () => {
|
|
1325
1330
|
try {
|
|
1326
|
-
const t = await this.api.getSpendingFeeTransactions(), e =
|
|
1331
|
+
const t = await this.api.getSpendingFeeTransactions(), e = Ee(t);
|
|
1327
1332
|
c(() => {
|
|
1328
1333
|
this.spendingFeeTransactions = e;
|
|
1329
1334
|
});
|
|
1330
1335
|
} catch (t) {
|
|
1331
|
-
console.error(
|
|
1336
|
+
console.error("Error occurred while getting spending fee transactions:", t), this.globalStore.captureException(t, { store: "FinstrongStore" });
|
|
1332
1337
|
}
|
|
1333
1338
|
};
|
|
1334
1339
|
loadSpendTransactions = async () => {
|
|
@@ -1339,7 +1344,7 @@ class Ee {
|
|
|
1339
1344
|
this.spendTransactions = [...t], this.setSpendingInitialized(!0);
|
|
1340
1345
|
});
|
|
1341
1346
|
} catch (t) {
|
|
1342
|
-
console.error("Error loading spend transactions:", t);
|
|
1347
|
+
console.error("Error loading spend transactions:", t), this.globalStore.captureException(t, { store: "FinstrongStore" });
|
|
1343
1348
|
}
|
|
1344
1349
|
};
|
|
1345
1350
|
get spendAndDebtTransactions() {
|
|
@@ -1356,7 +1361,7 @@ class Ee {
|
|
|
1356
1361
|
handleFinstrongWidgetPrimaryCtaClick = (t) => () => {
|
|
1357
1362
|
};
|
|
1358
1363
|
}
|
|
1359
|
-
const
|
|
1364
|
+
const ht = {
|
|
1360
1365
|
clientConfig: {},
|
|
1361
1366
|
clientStyleProfile: {},
|
|
1362
1367
|
config: {
|
|
@@ -1462,7 +1467,7 @@ const lt = {
|
|
|
1462
1467
|
};
|
|
1463
1468
|
class Ns {
|
|
1464
1469
|
// Global properties
|
|
1465
|
-
appConfig =
|
|
1470
|
+
appConfig = ht;
|
|
1466
1471
|
endpoint = "/";
|
|
1467
1472
|
sessionToken = "";
|
|
1468
1473
|
onCaptureException;
|
|
@@ -1493,11 +1498,11 @@ class Ns {
|
|
|
1493
1498
|
userStore;
|
|
1494
1499
|
// UI Stores
|
|
1495
1500
|
globalUiStore;
|
|
1496
|
-
constructor(t =
|
|
1497
|
-
this.appConfig = t, this.endpoint = e, this.sessionToken = t.options.session_token ?? "", this.onCaptureException = o, this.onError = s, this.onStoreUpdate = a, this.accountStore = new ce(this), this.appDataStore = new
|
|
1498
|
-
const { transactions:
|
|
1501
|
+
constructor(t = ht, e = "/", s, a, o) {
|
|
1502
|
+
this.appConfig = t, this.endpoint = e, this.sessionToken = t.options.session_token ?? "", this.onCaptureException = o, this.onError = s, this.onStoreUpdate = a, this.accountStore = new ce(this), this.appDataStore = new he(this), this.analyticsStore = new de(this), this.beatStore = new pe(this), this.budgetsStore = new _e(this), this.cashflowStore = new Se(this), this.categoryStore = new ye(this), this.connectStore = new Te(this), this.copyStore = new Re(this), this.debtsStore = new be(this), this.finstrongStore = new Ie(this), this.goalStore = new De(this), this.helpStore = new ve(this), this.holdingStore = new Ge(this), this.merchantStore = new Ne(this), this.netWorthStore = new Be(this), this.notificationStore = new Me(this), this.recurringTransactionsStore = new Oe(this), this.settingsStore = new Fe(this), this.transactionStore = new Ue(this), this.trendsStore = new He(this), this.userStore = new We(this), this.globalUiStore = new Ce(this), h(this), mt(() => {
|
|
1503
|
+
const { transactions: i } = this.transactionStore;
|
|
1499
1504
|
this.emitUpdate({
|
|
1500
|
-
transactions:
|
|
1505
|
+
transactions: i
|
|
1501
1506
|
});
|
|
1502
1507
|
});
|
|
1503
1508
|
}
|
|
@@ -1526,12 +1531,12 @@ class Ns {
|
|
|
1526
1531
|
associatedBeats: s,
|
|
1527
1532
|
categories: a,
|
|
1528
1533
|
institutions: o,
|
|
1529
|
-
transactionRules:
|
|
1534
|
+
transactionRules: i,
|
|
1530
1535
|
transactions: l,
|
|
1531
|
-
userFeatures:
|
|
1532
|
-
merchantBudgets:
|
|
1536
|
+
userFeatures: g,
|
|
1537
|
+
merchantBudgets: y
|
|
1533
1538
|
} = {}) => {
|
|
1534
|
-
(!e || !
|
|
1539
|
+
(!e || !g) && await this.loadConfigData(), e && this.appDataStore.setAppData(e), g && this.userStore.setUserFeatures(g), t && (await this.accountStore.loadMembers(), o && this.accountStore.setInstitutions(o), this.accountStore.setAccounts(t)), s && this.transactionStore.setAssociatedBeats(s), a && this.categoryStore.setCategories(a), l && this.transactionStore.setTransactions(l), i && this.transactionStore.setTransactionRules(i), y && this.budgetsStore.setMerchantBudgets(y);
|
|
1535
1540
|
};
|
|
1536
1541
|
}
|
|
1537
1542
|
class Ce {
|
|
@@ -1540,10 +1545,10 @@ class Ce {
|
|
|
1540
1545
|
displayedDate = /* @__PURE__ */ new Date();
|
|
1541
1546
|
displayedDateRange = {
|
|
1542
1547
|
start: C(this.displayedDate),
|
|
1543
|
-
end:
|
|
1548
|
+
end: b(this.displayedDate)
|
|
1544
1549
|
};
|
|
1545
1550
|
constructor(t) {
|
|
1546
|
-
|
|
1551
|
+
h(this), this.globalStore = t, gt(
|
|
1547
1552
|
() => this.globalStore.accountStore.visibleAccounts,
|
|
1548
1553
|
(e) => {
|
|
1549
1554
|
this.populateAccountFilterMap(e);
|
|
@@ -1593,7 +1598,7 @@ class Ce {
|
|
|
1593
1598
|
};
|
|
1594
1599
|
};
|
|
1595
1600
|
get shouldDisableNextDate() {
|
|
1596
|
-
const t = v(this.displayedDate), e = v(
|
|
1601
|
+
const t = v(this.displayedDate), e = v(ie(/* @__PURE__ */ new Date(), 1));
|
|
1597
1602
|
return t === e;
|
|
1598
1603
|
}
|
|
1599
1604
|
get shouldDisablePrevDate() {
|
|
@@ -1603,16 +1608,16 @@ class Ce {
|
|
|
1603
1608
|
}
|
|
1604
1609
|
class Re {
|
|
1605
1610
|
globalStore;
|
|
1606
|
-
api = new
|
|
1611
|
+
api = new z("/", "");
|
|
1607
1612
|
copy = {};
|
|
1608
1613
|
featureNamespace = "experiences";
|
|
1609
1614
|
isInitialized = !1;
|
|
1610
1615
|
constructor(t) {
|
|
1611
|
-
this.globalStore = t, this.api = new
|
|
1616
|
+
this.globalStore = t, this.api = new z(
|
|
1612
1617
|
t.endpoint,
|
|
1613
1618
|
t.sessionToken,
|
|
1614
1619
|
t.onError
|
|
1615
|
-
),
|
|
1620
|
+
), h(this);
|
|
1616
1621
|
}
|
|
1617
1622
|
loadCopy = async () => {
|
|
1618
1623
|
await this.getCopy(this.featureNamespace), c(() => {
|
|
@@ -1626,13 +1631,13 @@ class Re {
|
|
|
1626
1631
|
this.copy = s[t];
|
|
1627
1632
|
});
|
|
1628
1633
|
} catch (s) {
|
|
1629
|
-
console.error(
|
|
1634
|
+
console.error("Error occurred while fetching copy:", s), this.globalStore.captureException(s, { store: "GlobalCopyStore" });
|
|
1630
1635
|
}
|
|
1631
1636
|
};
|
|
1632
1637
|
}
|
|
1633
1638
|
class De {
|
|
1634
1639
|
globalStore;
|
|
1635
|
-
api = new
|
|
1640
|
+
api = new et("/", "");
|
|
1636
1641
|
goals = [];
|
|
1637
1642
|
goalsLoaded = !1;
|
|
1638
1643
|
retirementGoals = [];
|
|
@@ -1645,7 +1650,7 @@ class De {
|
|
|
1645
1650
|
alert = "";
|
|
1646
1651
|
selectedGoal = void 0;
|
|
1647
1652
|
constructor(t) {
|
|
1648
|
-
this.globalStore = t, this.api = new
|
|
1653
|
+
this.globalStore = t, this.api = new et(t.endpoint, t.sessionToken, t.onError), h(this);
|
|
1649
1654
|
}
|
|
1650
1655
|
get allGoals() {
|
|
1651
1656
|
if (!this.isAllGoalDataLoaded) return [];
|
|
@@ -1656,8 +1661,8 @@ class De {
|
|
|
1656
1661
|
...s,
|
|
1657
1662
|
amount: s.target_amount,
|
|
1658
1663
|
name: t.retirement,
|
|
1659
|
-
track_type:
|
|
1660
|
-
projected_to_complete_at: s.retirement_age && e ?
|
|
1664
|
+
track_type: T.RETIREMENT_TRACK,
|
|
1665
|
+
projected_to_complete_at: s.retirement_age && e ? K(s.retirement_age, e) : void 0
|
|
1661
1666
|
}))
|
|
1662
1667
|
];
|
|
1663
1668
|
}
|
|
@@ -1665,25 +1670,25 @@ class De {
|
|
|
1665
1670
|
return this.allGoals.slice().sort((t, e) => t.position - e.position);
|
|
1666
1671
|
}
|
|
1667
1672
|
get debtGoals() {
|
|
1668
|
-
return this.orderedGoals.filter((t) => t.track_type ===
|
|
1673
|
+
return this.orderedGoals.filter((t) => t.track_type === T.DEBT_TRACK);
|
|
1669
1674
|
}
|
|
1670
1675
|
get retirmentGoals() {
|
|
1671
|
-
return this.orderedGoals.filter((t) => t.track_type ===
|
|
1676
|
+
return this.orderedGoals.filter((t) => t.track_type === T.RETIREMENT_TRACK);
|
|
1672
1677
|
}
|
|
1673
1678
|
get savingGoals() {
|
|
1674
|
-
return this.orderedGoals.filter((t) => t.track_type ===
|
|
1679
|
+
return this.orderedGoals.filter((t) => t.track_type === T.SAVINGS_TRACK);
|
|
1675
1680
|
}
|
|
1676
1681
|
get ongoingGoalsForMicroWidget() {
|
|
1677
1682
|
const t = this.allGoals.filter(
|
|
1678
|
-
(s) => !s.is_complete && s.track_type !==
|
|
1683
|
+
(s) => !s.is_complete && s.track_type !== T.EMERGENCY_FUND_TRACK && s.track_type !== null
|
|
1679
1684
|
), e = [
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1685
|
+
T.SAVINGS_TRACK,
|
|
1686
|
+
T.DEBT_TRACK,
|
|
1687
|
+
T.RETIREMENT_TRACK
|
|
1683
1688
|
];
|
|
1684
1689
|
return t.sort((s, a) => {
|
|
1685
|
-
const o = s.track_type ? e.indexOf(s.track_type) : -1,
|
|
1686
|
-
return o -
|
|
1690
|
+
const o = s.track_type ? e.indexOf(s.track_type) : -1, i = a.track_type ? e.indexOf(a.track_type) : -1;
|
|
1691
|
+
return o - i;
|
|
1687
1692
|
}).slice(0, 3);
|
|
1688
1693
|
}
|
|
1689
1694
|
get isAllGoalDataLoaded() {
|
|
@@ -1714,7 +1719,7 @@ class De {
|
|
|
1714
1719
|
const t = await this.api.getGoals();
|
|
1715
1720
|
this.setGoals(t);
|
|
1716
1721
|
} catch (t) {
|
|
1717
|
-
console.error(
|
|
1722
|
+
console.error("Error occurred while getting goals:", t), this.globalStore.captureException(t, { store: "GoalStore" });
|
|
1718
1723
|
}
|
|
1719
1724
|
};
|
|
1720
1725
|
loadRetirementGoals = async () => {
|
|
@@ -1722,7 +1727,7 @@ class De {
|
|
|
1722
1727
|
const t = await this.api.getRetirementGoals();
|
|
1723
1728
|
this.setRetirementGoals(t);
|
|
1724
1729
|
} catch (t) {
|
|
1725
|
-
console.error(
|
|
1730
|
+
console.error("Error occurred while loading retirement goals:", t), this.globalStore.captureException(t, { store: "GoalStore" });
|
|
1726
1731
|
}
|
|
1727
1732
|
};
|
|
1728
1733
|
loadRetirementGoalAccounts = async () => {
|
|
@@ -1730,7 +1735,7 @@ class De {
|
|
|
1730
1735
|
const t = await this.api.getRetirementGoalAccounts();
|
|
1731
1736
|
this.setRetirementGoalAccounts(t);
|
|
1732
1737
|
} catch (t) {
|
|
1733
|
-
console.error(
|
|
1738
|
+
console.error("Error occurred while loading retirement goal accounts:", t), this.globalStore.captureException(t, { store: "GoalStore" });
|
|
1734
1739
|
}
|
|
1735
1740
|
};
|
|
1736
1741
|
loadMonthlyCashFlowProfile = async () => {
|
|
@@ -1738,7 +1743,7 @@ class De {
|
|
|
1738
1743
|
const t = await this.api.getMonthlyCashFlowProfile();
|
|
1739
1744
|
this.setMonthlyCashFlowProfile(t);
|
|
1740
1745
|
} catch (t) {
|
|
1741
|
-
console.error(
|
|
1746
|
+
console.error("Error occurred while loading monthly cash flow profile:", t), this.globalStore.captureException(t, { store: "GoalStore" });
|
|
1742
1747
|
}
|
|
1743
1748
|
};
|
|
1744
1749
|
addGoal = async (t) => {
|
|
@@ -1746,16 +1751,16 @@ class De {
|
|
|
1746
1751
|
const e = await this.api.addGoal(t);
|
|
1747
1752
|
this.setGoals([...this.goals, e]);
|
|
1748
1753
|
} catch (e) {
|
|
1749
|
-
console.error(
|
|
1754
|
+
console.error("Error occurred while adding goal:", e), this.globalStore.captureException(e, { store: "GoalStore" });
|
|
1750
1755
|
}
|
|
1751
1756
|
};
|
|
1752
1757
|
addRetirementGoal = async (t) => {
|
|
1753
1758
|
const e = this.globalStore.copyStore.copy.goals;
|
|
1754
1759
|
try {
|
|
1755
1760
|
const s = await this.api.addRetirementGoal(t), a = [], o = this.globalStore.userStore.user.birthday;
|
|
1756
|
-
for (const
|
|
1761
|
+
for (const i of this.newRetirementGoalAccounts) {
|
|
1757
1762
|
const l = await this.api.addRetirementGoalAccount({
|
|
1758
|
-
...
|
|
1763
|
+
...i,
|
|
1759
1764
|
retirement_goal_guid: s.guid
|
|
1760
1765
|
});
|
|
1761
1766
|
a.push(l);
|
|
@@ -1766,12 +1771,12 @@ class De {
|
|
|
1766
1771
|
...s,
|
|
1767
1772
|
amount: s.target_amount,
|
|
1768
1773
|
name: e.retirement,
|
|
1769
|
-
track_type:
|
|
1770
|
-
projected_to_complete_at: s.retirement_age && o ?
|
|
1774
|
+
track_type: T.RETIREMENT_TRACK,
|
|
1775
|
+
projected_to_complete_at: s.retirement_age && o ? K(s.retirement_age, o) : void 0
|
|
1771
1776
|
}
|
|
1772
1777
|
], this.setRetirementGoalAccounts([...this.retirementGoalAccounts, ...a]);
|
|
1773
1778
|
} catch (s) {
|
|
1774
|
-
console.error(
|
|
1779
|
+
console.error("Error occurred while adding retirement goal:", s), this.globalStore.captureException(s, { store: "GoalStore" });
|
|
1775
1780
|
}
|
|
1776
1781
|
};
|
|
1777
1782
|
addRetirementGoalAccount = async (t) => {
|
|
@@ -1781,7 +1786,7 @@ class De {
|
|
|
1781
1786
|
this.retirementGoalAccounts = [...this.retirementGoalAccounts, e];
|
|
1782
1787
|
});
|
|
1783
1788
|
} catch (e) {
|
|
1784
|
-
console.error(
|
|
1789
|
+
console.error("Error occurred while adding retirement goal account:", e), this.globalStore.captureException(e, { store: "GoalStore" });
|
|
1785
1790
|
}
|
|
1786
1791
|
};
|
|
1787
1792
|
deleteGoal = async (t) => {
|
|
@@ -1790,7 +1795,7 @@ class De {
|
|
|
1790
1795
|
const e = this.goals.findIndex((s) => s.guid === t);
|
|
1791
1796
|
e >= 0 && this.goals.splice(e, 1);
|
|
1792
1797
|
} catch (e) {
|
|
1793
|
-
console.error(
|
|
1798
|
+
console.error("Error occurred while deleting goal:", e), this.globalStore.captureException(e, { store: "GoalStore" });
|
|
1794
1799
|
}
|
|
1795
1800
|
};
|
|
1796
1801
|
deleteRetirementGoal = async (t) => {
|
|
@@ -1804,7 +1809,7 @@ class De {
|
|
|
1804
1809
|
const s = this.retirementGoals.findIndex((a) => a.guid === t.guid);
|
|
1805
1810
|
s >= 0 && this.retirementGoals.splice(s, 1);
|
|
1806
1811
|
} catch (e) {
|
|
1807
|
-
console.error(
|
|
1812
|
+
console.error("Error deleting retirement goal:", e), this.globalStore.captureException(e, { store: "GoalStore" });
|
|
1808
1813
|
}
|
|
1809
1814
|
};
|
|
1810
1815
|
deleteRetirementGoalAccount = async (t) => {
|
|
@@ -1813,7 +1818,7 @@ class De {
|
|
|
1813
1818
|
const e = this.retirementGoalAccounts.findIndex((s) => s.guid === t);
|
|
1814
1819
|
e >= 0 && this.retirementGoalAccounts.splice(e, 1);
|
|
1815
1820
|
} catch (e) {
|
|
1816
|
-
console.error(
|
|
1821
|
+
console.error("Error deleting retirement goal account:", e), this.globalStore.captureException(e, { store: "GoalStore" });
|
|
1817
1822
|
}
|
|
1818
1823
|
};
|
|
1819
1824
|
reorderGoals = async (t) => {
|
|
@@ -1826,7 +1831,7 @@ class De {
|
|
|
1826
1831
|
}
|
|
1827
1832
|
});
|
|
1828
1833
|
} catch (e) {
|
|
1829
|
-
console.error(
|
|
1834
|
+
console.error("Error reordering goals:", e), this.globalStore.captureException(e, { store: "GoalStore" });
|
|
1830
1835
|
}
|
|
1831
1836
|
};
|
|
1832
1837
|
setAlert = (t) => this.alert = t;
|
|
@@ -1842,7 +1847,7 @@ class De {
|
|
|
1842
1847
|
s >= 0 && (this.goals[s] = e), this.selectedGoal?.guid === t.guid && this.setSelectedGoal(e);
|
|
1843
1848
|
});
|
|
1844
1849
|
} catch (e) {
|
|
1845
|
-
console.error(
|
|
1850
|
+
console.error("Error occurred while updating goal:", e), this.globalStore.captureException(e, { store: "GoalStore" });
|
|
1846
1851
|
}
|
|
1847
1852
|
};
|
|
1848
1853
|
updateRetirementGoal = async (t) => {
|
|
@@ -1856,7 +1861,7 @@ class De {
|
|
|
1856
1861
|
s >= 0 && (this.retirementGoals[s] = e), this.selectedGoal?.guid === t.guid && this.setSelectedGoal(this.allGoals.find((a) => a.guid === t.guid));
|
|
1857
1862
|
});
|
|
1858
1863
|
} catch (e) {
|
|
1859
|
-
console.error(
|
|
1864
|
+
console.error("Error occurred while updating retirement goal:", e), this.globalStore.captureException(e, { store: "GoalStore" });
|
|
1860
1865
|
}
|
|
1861
1866
|
};
|
|
1862
1867
|
updateMonthlyCashFlowProfile = async (t) => {
|
|
@@ -1864,11 +1869,11 @@ class De {
|
|
|
1864
1869
|
const e = await this.api.updateMonthlyCashFlowProfile(t);
|
|
1865
1870
|
this.setMonthlyCashFlowProfile(e);
|
|
1866
1871
|
} catch (e) {
|
|
1867
|
-
console.error(
|
|
1872
|
+
console.error("Error occurred while updating monthly cash flow profile:", e), this.globalStore.captureException(e, { store: "GoalStore" });
|
|
1868
1873
|
}
|
|
1869
1874
|
};
|
|
1870
1875
|
}
|
|
1871
|
-
const
|
|
1876
|
+
const xe = (r, t) => r.guid === "general" || r.guid === "insights" ? !0 : r.flags ? r.flags.every((e) => t[e]) : !1, Le = (r, t) => {
|
|
1872
1877
|
const e = [];
|
|
1873
1878
|
for (const s of oe) {
|
|
1874
1879
|
const a = t[s.guid];
|
|
@@ -1876,29 +1881,29 @@ const Le = (n, t) => n.guid === "general" || n.guid === "insights" ? !0 : n.flag
|
|
|
1876
1881
|
const o = {
|
|
1877
1882
|
...s,
|
|
1878
1883
|
title: a.label,
|
|
1879
|
-
topics: s.topics.map(({ topicKey:
|
|
1880
|
-
topicKey:
|
|
1884
|
+
topics: s.topics.map(({ topicKey: i }, l) => ({
|
|
1885
|
+
topicKey: i,
|
|
1881
1886
|
label: a.topics[l]
|
|
1882
1887
|
}))
|
|
1883
1888
|
};
|
|
1884
|
-
|
|
1889
|
+
xe(o, r) && e.push(o);
|
|
1885
1890
|
}
|
|
1886
1891
|
return e;
|
|
1887
1892
|
};
|
|
1888
|
-
class
|
|
1893
|
+
class ve {
|
|
1889
1894
|
alert = { message: "", severity: void 0 };
|
|
1890
|
-
api = new
|
|
1895
|
+
api = new st("/", "");
|
|
1891
1896
|
appConfig;
|
|
1892
1897
|
globalStore;
|
|
1893
1898
|
isLoading = !1;
|
|
1894
1899
|
constructor(t) {
|
|
1895
|
-
this.globalStore = t, this.api = new
|
|
1900
|
+
this.globalStore = t, this.api = new st(t.endpoint, t.sessionToken, t.onError), h(this);
|
|
1896
1901
|
}
|
|
1897
1902
|
createSupportTicket = async (t) => {
|
|
1898
1903
|
try {
|
|
1899
1904
|
this.isLoading = !0, await this.api.createSupportTicket(t), this.setAlert(this.copy.request_support_submit_success_message, "success");
|
|
1900
1905
|
} catch (e) {
|
|
1901
|
-
|
|
1906
|
+
console.error("Error occurred while submitting support ticket:", e), this.globalStore.captureException(e, { store: "HelpStore" }), this.setAlert(this.copy.request_support_submit_failure_message, "error");
|
|
1902
1907
|
} finally {
|
|
1903
1908
|
this.isLoading = !1;
|
|
1904
1909
|
}
|
|
@@ -1911,7 +1916,7 @@ class $e {
|
|
|
1911
1916
|
const { client_communication_profile: t, client_profile: e } = this.globalStore.appDataStore.appData, {
|
|
1912
1917
|
help: { category_list: s }
|
|
1913
1918
|
} = this.globalStore.copyStore.copy;
|
|
1914
|
-
return
|
|
1919
|
+
return Le(
|
|
1915
1920
|
{
|
|
1916
1921
|
...t,
|
|
1917
1922
|
...e,
|
|
@@ -1923,13 +1928,13 @@ class $e {
|
|
|
1923
1928
|
}
|
|
1924
1929
|
class Ge {
|
|
1925
1930
|
analysisType = Wt.Stocks;
|
|
1926
|
-
api = new
|
|
1931
|
+
api = new at("/", "");
|
|
1927
1932
|
holdings = [];
|
|
1928
1933
|
holdingsLoaded = !1;
|
|
1929
1934
|
globalStore;
|
|
1930
1935
|
showConnectionsWidget = !1;
|
|
1931
1936
|
constructor(t) {
|
|
1932
|
-
this.globalStore = t, this.api = new
|
|
1937
|
+
this.globalStore = t, this.api = new at(t.endpoint, t.sessionToken, t.onError), h(this);
|
|
1933
1938
|
}
|
|
1934
1939
|
get analysisChartData() {
|
|
1935
1940
|
return Vt(zt(this.visibleHoldings), this.analysisType);
|
|
@@ -1953,7 +1958,7 @@ class Ge {
|
|
|
1953
1958
|
const t = await this.api.getHoldings();
|
|
1954
1959
|
this.setHoldings(t);
|
|
1955
1960
|
} catch (t) {
|
|
1956
|
-
console.error(
|
|
1961
|
+
console.error("Error occurred while getting holdings:", t), this.globalStore.captureException(t, { store: "HoldingStore" });
|
|
1957
1962
|
}
|
|
1958
1963
|
};
|
|
1959
1964
|
setAnalysisType = (t) => {
|
|
@@ -1970,18 +1975,18 @@ class Ge {
|
|
|
1970
1975
|
});
|
|
1971
1976
|
}
|
|
1972
1977
|
} catch (e) {
|
|
1973
|
-
console.error(
|
|
1978
|
+
console.error("Error occurred while updating holding:", e), this.globalStore.captureException(e, { store: "HoldingStore" });
|
|
1974
1979
|
}
|
|
1975
1980
|
};
|
|
1976
1981
|
}
|
|
1977
1982
|
class Ne {
|
|
1978
1983
|
globalStore;
|
|
1979
|
-
api = new
|
|
1984
|
+
api = new rt("/", "");
|
|
1980
1985
|
merchant = null;
|
|
1981
1986
|
merchants = [];
|
|
1982
1987
|
isLoading = !1;
|
|
1983
1988
|
constructor(t) {
|
|
1984
|
-
this.globalStore = t, this.api = new
|
|
1989
|
+
this.globalStore = t, this.api = new rt(t.endpoint, t.sessionToken, t.onError), h(this);
|
|
1985
1990
|
}
|
|
1986
1991
|
loadMerchants = async (t = "") => {
|
|
1987
1992
|
this.isLoading = !0;
|
|
@@ -1995,9 +2000,9 @@ class Ne {
|
|
|
1995
2000
|
c(() => this.merchant = e);
|
|
1996
2001
|
};
|
|
1997
2002
|
}
|
|
1998
|
-
class
|
|
2003
|
+
class Be {
|
|
1999
2004
|
globalStore;
|
|
2000
|
-
accountsApi = new
|
|
2005
|
+
accountsApi = new M("/", "");
|
|
2001
2006
|
monthlyAccountBalances = [];
|
|
2002
2007
|
monthlyAccountBalancesLoaded = !1;
|
|
2003
2008
|
hoveredIndex = -1;
|
|
@@ -2005,11 +2010,11 @@ class xe {
|
|
|
2005
2010
|
timeframe = 6;
|
|
2006
2011
|
// default timeframe is 6 months
|
|
2007
2012
|
constructor(t) {
|
|
2008
|
-
this.globalStore = t, this.accountsApi = new
|
|
2013
|
+
this.globalStore = t, this.accountsApi = new M(
|
|
2009
2014
|
t.endpoint,
|
|
2010
2015
|
t.sessionToken,
|
|
2011
2016
|
t.onError
|
|
2012
|
-
),
|
|
2017
|
+
), h(this);
|
|
2013
2018
|
}
|
|
2014
2019
|
get isNetWorthDataLoaded() {
|
|
2015
2020
|
return this.globalStore.accountStore.isAccountDataLoaded && this.monthlyAccountBalancesLoaded;
|
|
@@ -2031,7 +2036,7 @@ class xe {
|
|
|
2031
2036
|
}
|
|
2032
2037
|
get selectedData() {
|
|
2033
2038
|
if (!(!this.netWorthChartData || this.netWorthChartData.length === 0))
|
|
2034
|
-
return this.selectedIndex === -1 ?
|
|
2039
|
+
return this.selectedIndex === -1 ? Q(this.netWorthChartData) : this.netWorthChartData[this.selectedIndex];
|
|
2035
2040
|
}
|
|
2036
2041
|
get hoveredData() {
|
|
2037
2042
|
return this.hoveredIndex >= 0 ? this.netWorthChartData[this.hoveredIndex] : void 0;
|
|
@@ -2044,7 +2049,7 @@ class xe {
|
|
|
2044
2049
|
this.netWorthData.accounts
|
|
2045
2050
|
);
|
|
2046
2051
|
return {
|
|
2047
|
-
netWorth:
|
|
2052
|
+
netWorth: Q(this.netWorthChartData),
|
|
2048
2053
|
assets: t,
|
|
2049
2054
|
liabilities: e,
|
|
2050
2055
|
totalAssets: s,
|
|
@@ -2062,7 +2067,7 @@ class xe {
|
|
|
2062
2067
|
try {
|
|
2063
2068
|
return await this.accountsApi.getMonthlyAccountBalances(t);
|
|
2064
2069
|
} catch (e) {
|
|
2065
|
-
return console.error(
|
|
2070
|
+
return console.error("Error occurred while fetching monthly account balances:", e), this.globalStore.captureException(e, { store: "NetWorthStore" }), [];
|
|
2066
2071
|
}
|
|
2067
2072
|
};
|
|
2068
2073
|
setHoveredIndex = (t) => this.hoveredIndex = t;
|
|
@@ -2072,7 +2077,7 @@ class xe {
|
|
|
2072
2077
|
setSelectedIndex = (t) => this.selectedIndex = t;
|
|
2073
2078
|
setTimeframe = (t) => this.timeframe = t;
|
|
2074
2079
|
}
|
|
2075
|
-
class
|
|
2080
|
+
class Me {
|
|
2076
2081
|
globalStore;
|
|
2077
2082
|
api = new nt("/", "");
|
|
2078
2083
|
isLoading = !0;
|
|
@@ -2083,7 +2088,7 @@ class Be {
|
|
|
2083
2088
|
t.endpoint,
|
|
2084
2089
|
t.sessionToken,
|
|
2085
2090
|
t.onError
|
|
2086
|
-
),
|
|
2091
|
+
), h(this, { notifications: Tt });
|
|
2087
2092
|
}
|
|
2088
2093
|
// Used in Money Dashboard
|
|
2089
2094
|
get newNotifications() {
|
|
@@ -2101,7 +2106,7 @@ class Be {
|
|
|
2101
2106
|
const t = await this.api.getNotifications();
|
|
2102
2107
|
this.setNotifications(t);
|
|
2103
2108
|
} catch (t) {
|
|
2104
|
-
console.error(
|
|
2109
|
+
console.error("Error occurred while loading notifications:", t), this.globalStore.captureException(t, { store: "NotificationStore" });
|
|
2105
2110
|
} finally {
|
|
2106
2111
|
c(() => {
|
|
2107
2112
|
this.isLoading = !1;
|
|
@@ -2115,14 +2120,14 @@ class Be {
|
|
|
2115
2120
|
t.has_been_viewed = !0, await this.api.updateNotification(t);
|
|
2116
2121
|
};
|
|
2117
2122
|
}
|
|
2118
|
-
const dt = (
|
|
2119
|
-
class
|
|
2123
|
+
const dt = (r, t) => pt(t.expectedDate, r), A = (r, t) => r + t.amount;
|
|
2124
|
+
class Oe {
|
|
2120
2125
|
globalStore;
|
|
2121
2126
|
api = new it("/", "");
|
|
2122
2127
|
repeatingTransactions = [];
|
|
2123
2128
|
isDataLoaded = !1;
|
|
2124
2129
|
selectedDay;
|
|
2125
|
-
dateRange = { start: C(
|
|
2130
|
+
dateRange = { start: C(f()), end: b(f()) };
|
|
2126
2131
|
selectedRepeatingTransactionGuid = null;
|
|
2127
2132
|
selectedRecurrence = null;
|
|
2128
2133
|
alert = { message: "", severity: void 0 };
|
|
@@ -2131,7 +2136,7 @@ class Me {
|
|
|
2131
2136
|
t.endpoint,
|
|
2132
2137
|
t.sessionToken,
|
|
2133
2138
|
t.onError
|
|
2134
|
-
),
|
|
2139
|
+
), h(this, {
|
|
2135
2140
|
recurrencesForRange: !1,
|
|
2136
2141
|
upcomingExpensesForRange: !1,
|
|
2137
2142
|
upcomingIncomeForRange: !1,
|
|
@@ -2158,13 +2163,13 @@ class Me {
|
|
|
2158
2163
|
*/
|
|
2159
2164
|
recurrencesForRange = (t) => {
|
|
2160
2165
|
const e = this.globalStore.accountStore.visibleAccounts;
|
|
2161
|
-
return te(this.detailedRepeatingTransactions, t).filter((s) => e.some((a) => a.guid === s.accountGuid && !a.is_excluded_from_accounts)).filter((s) =>
|
|
2166
|
+
return te(this.detailedRepeatingTransactions, t).filter((s) => e.some((a) => a.guid === s.accountGuid && !a.is_excluded_from_accounts)).filter((s) => pt(s.expectedDate, t));
|
|
2162
2167
|
};
|
|
2163
2168
|
/**
|
|
2164
2169
|
* Returns the upcoming expense recurrences scoped to the supplied date range.
|
|
2165
2170
|
*/
|
|
2166
2171
|
upcomingExpensesForRange = (t) => this.recurrencesForRange(t).filter(
|
|
2167
|
-
(e) => e.type === L.Expense && e.status ===
|
|
2172
|
+
(e) => e.type === L.Expense && e.status === S.Upcoming
|
|
2168
2173
|
);
|
|
2169
2174
|
/**
|
|
2170
2175
|
* Returns the income recurrences scoped to the supplied date range.
|
|
@@ -2176,13 +2181,13 @@ class Me {
|
|
|
2176
2181
|
* Returns the upcoming income recurrences scoped to the supplied date range.
|
|
2177
2182
|
*/
|
|
2178
2183
|
upcomingIncomeForRange = (t) => this.incomeForRange(t).filter(
|
|
2179
|
-
(e) => e.status ===
|
|
2184
|
+
(e) => e.status === S.Upcoming
|
|
2180
2185
|
);
|
|
2181
2186
|
/**
|
|
2182
2187
|
* Returns the next upcoming income recurrence scoped to the supplied range.
|
|
2183
2188
|
*/
|
|
2184
2189
|
nextIncomeForRange = (t) => this.upcomingIncomeForRange(t).find(
|
|
2185
|
-
(e) =>
|
|
2190
|
+
(e) => F(e.expectedDate, f())
|
|
2186
2191
|
);
|
|
2187
2192
|
/**
|
|
2188
2193
|
* Returns all recurrences built from repeating transactions and filtered by accounts.
|
|
@@ -2195,7 +2200,7 @@ class Me {
|
|
|
2195
2200
|
*/
|
|
2196
2201
|
get pastRecurrences() {
|
|
2197
2202
|
return this.recurrences.filter(
|
|
2198
|
-
(t) => t.status ===
|
|
2203
|
+
(t) => t.status === S.Paid || t.status === S.Missed
|
|
2199
2204
|
);
|
|
2200
2205
|
}
|
|
2201
2206
|
/**
|
|
@@ -2204,7 +2209,7 @@ class Me {
|
|
|
2204
2209
|
*/
|
|
2205
2210
|
get upcomingRecurrences() {
|
|
2206
2211
|
return this.recurrences.filter(
|
|
2207
|
-
(t) =>
|
|
2212
|
+
(t) => F(t.expectedDate, _t(f(), 3)) && W(t.expectedDate, this.dateRange.end) && t.status === S.Upcoming
|
|
2208
2213
|
);
|
|
2209
2214
|
}
|
|
2210
2215
|
/**
|
|
@@ -2220,7 +2225,7 @@ class Me {
|
|
|
2220
2225
|
*/
|
|
2221
2226
|
get upcomingExpenses() {
|
|
2222
2227
|
return this.expenses.filter(
|
|
2223
|
-
(t) => t.status ===
|
|
2228
|
+
(t) => t.status === S.Upcoming
|
|
2224
2229
|
);
|
|
2225
2230
|
}
|
|
2226
2231
|
/**
|
|
@@ -2236,11 +2241,11 @@ class Me {
|
|
|
2236
2241
|
*/
|
|
2237
2242
|
get upcomingIncome() {
|
|
2238
2243
|
return this.income.filter(
|
|
2239
|
-
(t) => t.status ===
|
|
2244
|
+
(t) => t.status === S.Upcoming
|
|
2240
2245
|
);
|
|
2241
2246
|
}
|
|
2242
2247
|
get nextIncomeRecurrence() {
|
|
2243
|
-
return this.upcomingIncome.find((t) =>
|
|
2248
|
+
return this.upcomingIncome.find((t) => F(t.expectedDate, f()));
|
|
2244
2249
|
}
|
|
2245
2250
|
/**
|
|
2246
2251
|
* Returns the expense recurrences for the current month.
|
|
@@ -2268,19 +2273,19 @@ class Me {
|
|
|
2268
2273
|
* Calculates the total amount of all paid expenses for the current month.
|
|
2269
2274
|
*/
|
|
2270
2275
|
get paidExpenseTotal() {
|
|
2271
|
-
return this.currentMonthExpenses.filter((t) => t.status ===
|
|
2276
|
+
return this.currentMonthExpenses.filter((t) => t.status === S.Paid).reduce(A, 0);
|
|
2272
2277
|
}
|
|
2273
2278
|
/**
|
|
2274
2279
|
* Calculates the total amount of all missed expenses for the current month.
|
|
2275
2280
|
*/
|
|
2276
2281
|
get missedExpenseTotal() {
|
|
2277
|
-
return this.currentMonthExpenses.filter((t) => t.status ===
|
|
2282
|
+
return this.currentMonthExpenses.filter((t) => t.status === S.Missed).reduce(A, 0);
|
|
2278
2283
|
}
|
|
2279
2284
|
/**
|
|
2280
2285
|
* Calculates the total amount of all upcoming expenses for the current month.
|
|
2281
2286
|
*/
|
|
2282
2287
|
get upcomingExpenseTotal() {
|
|
2283
|
-
return this.currentMonthExpenses.filter((t) => t.status ===
|
|
2288
|
+
return this.currentMonthExpenses.filter((t) => t.status === S.Upcoming).reduce(A, 0);
|
|
2284
2289
|
}
|
|
2285
2290
|
/**
|
|
2286
2291
|
* Calculates the total amount of all income for the current month.
|
|
@@ -2292,20 +2297,20 @@ class Me {
|
|
|
2292
2297
|
* Calculates the total amount of all paid income for the current month.
|
|
2293
2298
|
*/
|
|
2294
2299
|
get paidIncomeTotal() {
|
|
2295
|
-
return this.currentMonthIncome.filter((t) => t.status ===
|
|
2300
|
+
return this.currentMonthIncome.filter((t) => t.status === S.Paid).reduce(A, 0);
|
|
2296
2301
|
}
|
|
2297
2302
|
/**
|
|
2298
2303
|
* Calculates the total amount of all upcoming income for the current month.
|
|
2299
2304
|
*/
|
|
2300
2305
|
get upcomingIncomeTotal() {
|
|
2301
|
-
return this.currentMonthIncome.filter((t) => t.status ===
|
|
2306
|
+
return this.currentMonthIncome.filter((t) => t.status === S.Upcoming).reduce(A, 0);
|
|
2302
2307
|
}
|
|
2303
2308
|
/**
|
|
2304
2309
|
* Get the recurrences for the currently selected day.
|
|
2305
2310
|
*/
|
|
2306
2311
|
get selectedDayRecurrences() {
|
|
2307
2312
|
return this.selectedDay && this.recurrences.filter(
|
|
2308
|
-
(t) => this.selectedDay &&
|
|
2313
|
+
(t) => this.selectedDay && q(t.occurredOnDate || t.expectedDate, this.selectedDay)
|
|
2309
2314
|
);
|
|
2310
2315
|
}
|
|
2311
2316
|
get selectedRepeatingTransaction() {
|
|
@@ -2328,7 +2333,7 @@ class Me {
|
|
|
2328
2333
|
* @param day - The day to select.
|
|
2329
2334
|
*/
|
|
2330
2335
|
setSelectedDay = (t) => {
|
|
2331
|
-
this.selectedDay = this.selectedDay &&
|
|
2336
|
+
this.selectedDay = this.selectedDay && q(t, this.selectedDay) ? void 0 : t;
|
|
2332
2337
|
};
|
|
2333
2338
|
loadRepeatingTransactionData = async () => {
|
|
2334
2339
|
await Promise.all([
|
|
@@ -2345,7 +2350,7 @@ class Me {
|
|
|
2345
2350
|
const t = await this.api.getRepeatingTransactions();
|
|
2346
2351
|
this.setRepeatingTransactions(t);
|
|
2347
2352
|
} catch (t) {
|
|
2348
|
-
console.error(
|
|
2353
|
+
console.error("Error occurred while getting repeating transactions:", t), this.globalStore.captureException(t, { store: "RecurringTransactionsStore" });
|
|
2349
2354
|
}
|
|
2350
2355
|
};
|
|
2351
2356
|
/**
|
|
@@ -2370,7 +2375,7 @@ class Me {
|
|
|
2370
2375
|
];
|
|
2371
2376
|
});
|
|
2372
2377
|
} catch (s) {
|
|
2373
|
-
console.error(
|
|
2378
|
+
console.error("Error occurred while adding repeating transaction:", s), this.globalStore.captureException(s, { store: "RecurringTransactionsStore" });
|
|
2374
2379
|
}
|
|
2375
2380
|
};
|
|
2376
2381
|
/**
|
|
@@ -2385,7 +2390,7 @@ class Me {
|
|
|
2385
2390
|
];
|
|
2386
2391
|
});
|
|
2387
2392
|
} catch (e) {
|
|
2388
|
-
console.error(
|
|
2393
|
+
console.error("Error occurred while deleting repeating transaction:", e), this.globalStore.captureException(e, { store: "RecurringTransactionsStore" });
|
|
2389
2394
|
}
|
|
2390
2395
|
};
|
|
2391
2396
|
/**
|
|
@@ -2410,7 +2415,7 @@ class Me {
|
|
|
2410
2415
|
];
|
|
2411
2416
|
});
|
|
2412
2417
|
} catch (e) {
|
|
2413
|
-
console.error(
|
|
2418
|
+
console.error("Error occurred while updating repeating transaction:", e), this.globalStore.captureException(e, { store: "RecurringTransactionsStore" });
|
|
2414
2419
|
}
|
|
2415
2420
|
};
|
|
2416
2421
|
/**
|
|
@@ -2425,7 +2430,7 @@ class Me {
|
|
|
2425
2430
|
repeating_transaction_guid: t
|
|
2426
2431
|
}), await this.loadRepeatingTransactions(), this.setSelectedRecurrence(null), this.setAlert(this.copy.link_transaction_success, "success");
|
|
2427
2432
|
} catch (s) {
|
|
2428
|
-
console.error(
|
|
2433
|
+
console.error("Error occurred while marking recurrence as paid:", s), this.globalStore.captureException(s, { store: "RecurringTransactionsStore" }), this.setAlert(this.copy.link_transaction_error, "error");
|
|
2429
2434
|
}
|
|
2430
2435
|
};
|
|
2431
2436
|
/**
|
|
@@ -2439,14 +2444,14 @@ class Me {
|
|
|
2439
2444
|
repeating_transaction_guid: null
|
|
2440
2445
|
}), await this.loadRepeatingTransactions(), this.setSelectedRecurrence(null), this.setAlert(this.copy.unlink_transaction_success, "success");
|
|
2441
2446
|
} catch (e) {
|
|
2442
|
-
console.error(
|
|
2447
|
+
console.error("Error occurred while marking recurrence as unpaid:", e), this.globalStore.captureException(e, { store: "RecurringTransactionsStore" }), this.setAlert(this.copy.unlink_transaction_error, "error");
|
|
2443
2448
|
}
|
|
2444
2449
|
};
|
|
2445
2450
|
setAlert = (t, e = void 0) => this.alert = { message: t, severity: e };
|
|
2446
2451
|
}
|
|
2447
|
-
const
|
|
2448
|
-
[
|
|
2449
|
-
[
|
|
2452
|
+
const ut = "PARENT-ENTITY", Pe = (r, t) => ({
|
|
2453
|
+
[B.BudgetExceeded]: t.notification_budget_exceeded,
|
|
2454
|
+
[B.BudgetOffTarget]: t.notification_budget_off_target,
|
|
2450
2455
|
[_.DebtPaymentReminder]: t.notification_debt_payment_reminder,
|
|
2451
2456
|
[_.AccountBalanceLow]: t.notification_low_balance,
|
|
2452
2457
|
[_.AccountDepositLargePosted]: t.notification_large_deposit,
|
|
@@ -2477,48 +2482,48 @@ const ht = "PARENT-ENTITY", Oe = (n, t) => ({
|
|
|
2477
2482
|
[u.TransactionExpenseLarge]: t.large_transaction,
|
|
2478
2483
|
[u.PromotionalCampaignMessages]: t.promotional_campaign_messages,
|
|
2479
2484
|
[u.TransparentOverdraft]: t.transparent_overdraft
|
|
2480
|
-
})[
|
|
2481
|
-
const
|
|
2485
|
+
})[r] || "", $e = (r, t, e, s, a, o) => {
|
|
2486
|
+
const i = [], {
|
|
2482
2487
|
email_notifications_enabled: l,
|
|
2483
|
-
sms_notifications_enabled:
|
|
2484
|
-
push_notifications_enabled:
|
|
2488
|
+
sms_notifications_enabled: g,
|
|
2489
|
+
push_notifications_enabled: y
|
|
2485
2490
|
} = t, {
|
|
2486
|
-
opted_out_of_email_notifications:
|
|
2487
|
-
opted_out_of_sms_notifications:
|
|
2488
|
-
opted_out_of_push_notifications:
|
|
2491
|
+
opted_out_of_email_notifications: R,
|
|
2492
|
+
opted_out_of_sms_notifications: St,
|
|
2493
|
+
opted_out_of_push_notifications: ft
|
|
2489
2494
|
} = a;
|
|
2490
|
-
for (const
|
|
2491
|
-
const
|
|
2492
|
-
(
|
|
2493
|
-
),
|
|
2494
|
-
l && !
|
|
2495
|
-
...
|
|
2496
|
-
children:
|
|
2497
|
-
...
|
|
2498
|
-
account:
|
|
2499
|
-
label:
|
|
2495
|
+
for (const E of s.filter((D) => D.entity_guid === ut)) {
|
|
2496
|
+
const D = Pe(E.notification_type, e), yt = s.filter(
|
|
2497
|
+
(I) => I.entity_guid !== ut && I.notification_type === E.notification_type && r.some((P) => P.guid === I.entity_guid)
|
|
2498
|
+
), x = [];
|
|
2499
|
+
l && !R && E.email_channel && o.email && x.push(e.delivery_method_email_label), g && !St && E.sms_channel && o.phone && x.push(e.delivery_method_sms_label), y && !ft && E.push_channel && x.push(e.delivery_method_push_label), i.push({
|
|
2500
|
+
...E,
|
|
2501
|
+
children: yt.map((I) => ({
|
|
2502
|
+
...I,
|
|
2503
|
+
account: r.find((P) => P.guid === I.entity_guid),
|
|
2504
|
+
label: D
|
|
2500
2505
|
})),
|
|
2501
|
-
deliveryMethodsLabel:
|
|
2502
|
-
label:
|
|
2506
|
+
deliveryMethodsLabel: x.join(", "),
|
|
2507
|
+
label: D
|
|
2503
2508
|
});
|
|
2504
2509
|
}
|
|
2505
|
-
return
|
|
2510
|
+
return i;
|
|
2506
2511
|
};
|
|
2507
|
-
class
|
|
2512
|
+
class Fe {
|
|
2508
2513
|
globalStore;
|
|
2509
|
-
api = new
|
|
2510
|
-
transactionApi = new
|
|
2514
|
+
api = new ot("/", "");
|
|
2515
|
+
transactionApi = new O("/", "");
|
|
2511
2516
|
alert = { message: "", severity: void 0 };
|
|
2512
2517
|
devices = [];
|
|
2513
2518
|
notificationProfiles = [];
|
|
2514
2519
|
selectedRule = void 0;
|
|
2515
2520
|
transactionRules = [];
|
|
2516
2521
|
constructor(t) {
|
|
2517
|
-
this.globalStore = t, this.api = new
|
|
2522
|
+
this.globalStore = t, this.api = new ot(t.endpoint, t.sessionToken, t.onError), this.transactionApi = new O(
|
|
2518
2523
|
t.endpoint,
|
|
2519
2524
|
t.sessionToken,
|
|
2520
2525
|
t.onError
|
|
2521
|
-
),
|
|
2526
|
+
), h(this);
|
|
2522
2527
|
}
|
|
2523
2528
|
get accountProfiles() {
|
|
2524
2529
|
const t = this.globalStore.appDataStore.clientCommunicationProfile;
|
|
@@ -2529,7 +2534,7 @@ class Ue {
|
|
|
2529
2534
|
get budgetProfiles() {
|
|
2530
2535
|
const t = this.globalStore.appDataStore.clientCommunicationProfile;
|
|
2531
2536
|
return this.detailedNotificationProfiles.filter(
|
|
2532
|
-
(e) => e.notification_type ===
|
|
2537
|
+
(e) => e.notification_type === B.BudgetExceeded && t.budget_exceeded_notifications_enabled || e.notification_type === B.BudgetOffTarget && t.budget_off_target_notifications_enabled
|
|
2533
2538
|
);
|
|
2534
2539
|
}
|
|
2535
2540
|
get insightsProfiles() {
|
|
@@ -2544,7 +2549,7 @@ class Ue {
|
|
|
2544
2549
|
return this.globalStore.copyStore.copy.settings;
|
|
2545
2550
|
}
|
|
2546
2551
|
get detailedNotificationProfiles() {
|
|
2547
|
-
return this.globalStore.isInitialized ?
|
|
2552
|
+
return this.globalStore.isInitialized ? $e(
|
|
2548
2553
|
this.globalStore.accountStore.accounts,
|
|
2549
2554
|
this.clientCommunicationProfile,
|
|
2550
2555
|
this.copy,
|
|
@@ -2563,22 +2568,23 @@ class Ue {
|
|
|
2563
2568
|
return e >= 0 && c(() => {
|
|
2564
2569
|
this.devices.splice(e, 1);
|
|
2565
2570
|
}), { success: !0 };
|
|
2566
|
-
} catch {
|
|
2567
|
-
return console.error(
|
|
2571
|
+
} catch (e) {
|
|
2572
|
+
return console.error("Error deleting device:", e), this.globalStore.captureException(e, { store: "SettingsStore" }), { success: !1 };
|
|
2568
2573
|
}
|
|
2569
2574
|
};
|
|
2570
2575
|
deleteTransactionRule = async () => {
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
+
if (this.selectedRule)
|
|
2577
|
+
try {
|
|
2578
|
+
await this.transactionApi.removeTransactionRule(this.selectedRule?.guid), this.setAlert(this.copy.delete_rule_success, "success"), await this.loadTransactionRules();
|
|
2579
|
+
} catch (t) {
|
|
2580
|
+
console.error("Error deleting transaction rule:", t), this.globalStore.captureException(t, { store: "SettingsStore" }), this.setAlert(this.copy.delete_rule_error, "error");
|
|
2581
|
+
}
|
|
2576
2582
|
};
|
|
2577
2583
|
generateDeviceToken = async () => {
|
|
2578
2584
|
try {
|
|
2579
2585
|
return await this.api.generateDeviceToken();
|
|
2580
2586
|
} catch (t) {
|
|
2581
|
-
console.error(
|
|
2587
|
+
console.error("Error generating device token:", t), this.globalStore.captureException(t, { store: "SettingsStore" });
|
|
2582
2588
|
}
|
|
2583
2589
|
};
|
|
2584
2590
|
loadDevices = async () => {
|
|
@@ -2588,7 +2594,7 @@ class Ue {
|
|
|
2588
2594
|
this.devices = t;
|
|
2589
2595
|
});
|
|
2590
2596
|
} catch (t) {
|
|
2591
|
-
console.error(
|
|
2597
|
+
console.error("Error loading devices:", t), this.globalStore.captureException(t, { store: "SettingsStore" });
|
|
2592
2598
|
}
|
|
2593
2599
|
};
|
|
2594
2600
|
loadNotificationProfiles = async () => {
|
|
@@ -2598,7 +2604,7 @@ class Ue {
|
|
|
2598
2604
|
this.notificationProfiles = t;
|
|
2599
2605
|
});
|
|
2600
2606
|
} catch (t) {
|
|
2601
|
-
console.error(
|
|
2607
|
+
console.error("Error loading notification profiles:", t), this.globalStore.captureException(t, { store: "SettingsStore" });
|
|
2602
2608
|
}
|
|
2603
2609
|
};
|
|
2604
2610
|
loadTransactionRules = async () => {
|
|
@@ -2608,21 +2614,21 @@ class Ue {
|
|
|
2608
2614
|
this.transactionRules = t;
|
|
2609
2615
|
});
|
|
2610
2616
|
} catch (t) {
|
|
2611
|
-
console.error(
|
|
2617
|
+
console.error("Error loading transaction rules:", t), this.globalStore.captureException(t, { store: "SettingsStore" });
|
|
2612
2618
|
}
|
|
2613
2619
|
};
|
|
2614
2620
|
sendEmailVerification = async () => {
|
|
2615
2621
|
try {
|
|
2616
2622
|
await this.api.sendEmailVerification(), this.setAlert(this.copy.verification_sent_success, "success");
|
|
2617
2623
|
} catch (t) {
|
|
2618
|
-
console.error(
|
|
2624
|
+
console.error("Error sending email verification:", t), this.globalStore.captureException(t, { store: "SettingsStore" }), this.setAlert(this.copy.verification_sent_error, "error");
|
|
2619
2625
|
}
|
|
2620
2626
|
};
|
|
2621
2627
|
sendPhoneVerification = async () => {
|
|
2622
2628
|
try {
|
|
2623
2629
|
await this.api.sendPhoneVerification(), this.setAlert(this.copy.verification_sent_success, "success");
|
|
2624
2630
|
} catch (t) {
|
|
2625
|
-
console.error(
|
|
2631
|
+
console.error("Error sending phone verification:", t), this.globalStore.captureException(t, { store: "SettingsStore" }), this.setAlert(this.copy.verification_sent_error, "error");
|
|
2626
2632
|
}
|
|
2627
2633
|
};
|
|
2628
2634
|
setAlert = (t, e = void 0) => this.alert = { message: t, severity: e };
|
|
@@ -2636,7 +2642,7 @@ class Ue {
|
|
|
2636
2642
|
this.devices[s] = e;
|
|
2637
2643
|
}), { success: !0 };
|
|
2638
2644
|
} catch (e) {
|
|
2639
|
-
return console.error(
|
|
2645
|
+
return console.error("Error updating device:", e), this.globalStore.captureException(e, { store: "SettingsStore" }), { success: !1 };
|
|
2640
2646
|
}
|
|
2641
2647
|
};
|
|
2642
2648
|
updateNotificationProfile = async (t) => {
|
|
@@ -2646,34 +2652,36 @@ class Ue {
|
|
|
2646
2652
|
this.notificationProfiles[s] = e;
|
|
2647
2653
|
});
|
|
2648
2654
|
} catch (e) {
|
|
2649
|
-
console.error(
|
|
2655
|
+
console.error("Error updating notification profile:", e), this.globalStore.captureException(e, { store: "SettingsStore" });
|
|
2650
2656
|
}
|
|
2651
2657
|
};
|
|
2652
2658
|
updateRuleCategory = async (t) => {
|
|
2653
|
-
|
|
2654
|
-
this.loadTransactionRules();
|
|
2655
|
-
})
|
|
2659
|
+
try {
|
|
2660
|
+
await this.transactionApi.updateTransactionRule(t), await this.loadTransactionRules();
|
|
2661
|
+
} catch (e) {
|
|
2662
|
+
console.error("Error updating rule category:", e), this.globalStore.captureException(e, { store: "SettingsStore" });
|
|
2663
|
+
}
|
|
2656
2664
|
};
|
|
2657
2665
|
updateRulePayee = async (t) => {
|
|
2658
|
-
|
|
2659
|
-
this.setAlert(this.copy.edit_payee_success, "success"), this.loadTransactionRules();
|
|
2660
|
-
}
|
|
2661
|
-
this.setAlert(this.copy.edit_payee_error, "error");
|
|
2662
|
-
}
|
|
2666
|
+
try {
|
|
2667
|
+
await this.transactionApi.updateTransactionRule(t), this.setAlert(this.copy.edit_payee_success, "success"), await this.loadTransactionRules();
|
|
2668
|
+
} catch (e) {
|
|
2669
|
+
console.error("Error updating rule payee:", e), this.globalStore.captureException(e, { store: "SettingsStore" }), this.setAlert(this.copy.edit_payee_error, "error");
|
|
2670
|
+
}
|
|
2663
2671
|
};
|
|
2664
2672
|
updateUser = async (t) => {
|
|
2665
|
-
|
|
2666
|
-
this.setAlert(this.copy.information_updated_success, "success");
|
|
2667
|
-
}
|
|
2673
|
+
try {
|
|
2674
|
+
await this.globalStore.userStore.updateUser(t), this.setAlert(this.copy.information_updated_success, "success");
|
|
2675
|
+
} catch {
|
|
2668
2676
|
this.setAlert(this.copy.information_updated_error, "error");
|
|
2669
|
-
}
|
|
2677
|
+
}
|
|
2670
2678
|
};
|
|
2671
2679
|
updateUserCommunicationProfile = async (t) => {
|
|
2672
2680
|
try {
|
|
2673
2681
|
const e = await this.api.updateUserCommunicationProfile(t);
|
|
2674
2682
|
this.globalStore.appDataStore.setUserCommunicationProfile(e);
|
|
2675
2683
|
} catch (e) {
|
|
2676
|
-
console.error(
|
|
2684
|
+
console.error("Error occurred while updating user communication profile:", e), this.globalStore.captureException(e, { store: "SettingsStore" });
|
|
2677
2685
|
}
|
|
2678
2686
|
};
|
|
2679
2687
|
verifyPhoneToken = async (t) => {
|
|
@@ -2683,15 +2691,15 @@ class Ue {
|
|
|
2683
2691
|
throw new Error();
|
|
2684
2692
|
this.setAlert(this.copy.verified_phone_success, "success");
|
|
2685
2693
|
} catch (e) {
|
|
2686
|
-
console.error(
|
|
2694
|
+
console.error("Error verifying phone token:", e), this.globalStore.captureException(e, { store: "SettingsStore" }), this.setAlert(this.copy.verified_phone_error, "error");
|
|
2687
2695
|
}
|
|
2688
2696
|
};
|
|
2689
2697
|
}
|
|
2690
|
-
class
|
|
2698
|
+
class Ue {
|
|
2691
2699
|
globalStore;
|
|
2692
2700
|
uiStore;
|
|
2693
|
-
api = new
|
|
2694
|
-
beatApi = new
|
|
2701
|
+
api = new O("/", "");
|
|
2702
|
+
beatApi = new G("/", "");
|
|
2695
2703
|
associatedBeats = [];
|
|
2696
2704
|
associatedBeatsLoaded = !1;
|
|
2697
2705
|
associatedBeatsLoading = !1;
|
|
@@ -2708,18 +2716,18 @@ class Fe {
|
|
|
2708
2716
|
transactionRulesLoaded = !1;
|
|
2709
2717
|
transactionRulesLoading = !1;
|
|
2710
2718
|
transactionSplitting = !1;
|
|
2711
|
-
cachedStartDate =
|
|
2719
|
+
cachedStartDate = _t(f(), 90);
|
|
2712
2720
|
filter = {};
|
|
2713
2721
|
isLoading = !0;
|
|
2714
2722
|
alert = "";
|
|
2715
2723
|
sortColumn = Gt.DATE;
|
|
2716
2724
|
sortDirection = Nt.DESC;
|
|
2717
2725
|
constructor(t) {
|
|
2718
|
-
this.globalStore = t, this.uiStore = new ke(), this.api = new
|
|
2726
|
+
this.globalStore = t, this.uiStore = new ke(), this.api = new O(
|
|
2719
2727
|
t.endpoint,
|
|
2720
2728
|
t.sessionToken,
|
|
2721
2729
|
t.onError
|
|
2722
|
-
), this.beatApi = new
|
|
2730
|
+
), this.beatApi = new G(t.endpoint, t.sessionToken, t.onError), h(this);
|
|
2723
2731
|
}
|
|
2724
2732
|
loadTransactionData = async () => {
|
|
2725
2733
|
this.globalStore.accountStore.isAccountDataLoaded || await this.globalStore.accountStore.loadAccountData(), this.globalStore.categoryStore.categoriesLoaded || await this.globalStore.categoryStore.loadCategories(), await Promise.all([
|
|
@@ -2735,7 +2743,7 @@ class Fe {
|
|
|
2735
2743
|
return this.associatedBeatsLoaded && this.tagsLoaded && this.taggingsLoaded && this.transactionRulesLoaded && this.transactionsLoaded;
|
|
2736
2744
|
}
|
|
2737
2745
|
get detailedTransactions() {
|
|
2738
|
-
return this.isTransactionDataLoaded ?
|
|
2746
|
+
return this.isTransactionDataLoaded ? Bt(
|
|
2739
2747
|
this.transactions,
|
|
2740
2748
|
this.globalStore.accountStore.visibleAccounts,
|
|
2741
2749
|
this.globalStore.categoryStore.categories,
|
|
@@ -2743,7 +2751,7 @@ class Fe {
|
|
|
2743
2751
|
) : [];
|
|
2744
2752
|
}
|
|
2745
2753
|
get sortedTransactions() {
|
|
2746
|
-
return
|
|
2754
|
+
return Mt(
|
|
2747
2755
|
this.filter,
|
|
2748
2756
|
this.uiStore.expandedSplits,
|
|
2749
2757
|
this.sortColumn,
|
|
@@ -2753,7 +2761,7 @@ class Fe {
|
|
|
2753
2761
|
);
|
|
2754
2762
|
}
|
|
2755
2763
|
get sortedTransactionsWithSplits() {
|
|
2756
|
-
return
|
|
2764
|
+
return Ot(this.sortedTransactions, this.detailedTransactions);
|
|
2757
2765
|
}
|
|
2758
2766
|
setAssociatedBeats = (t) => {
|
|
2759
2767
|
this.associatedBeats = t, this.associatedBeatsLoading = !1, this.associatedBeatsLoaded = !0;
|
|
@@ -2774,34 +2782,53 @@ class Fe {
|
|
|
2774
2782
|
this.alert = t;
|
|
2775
2783
|
};
|
|
2776
2784
|
addTag = async (t) => {
|
|
2777
|
-
|
|
2785
|
+
try {
|
|
2786
|
+
await this.api.addTag({ name: t }), await this.loadTags();
|
|
2787
|
+
} catch (e) {
|
|
2788
|
+
console.error("Error occurred while adding tag:", e), this.globalStore.captureException(e, { store: "TransactionStore" });
|
|
2789
|
+
}
|
|
2778
2790
|
};
|
|
2779
2791
|
addTagging = async (t, e) => {
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2792
|
+
try {
|
|
2793
|
+
await this.api.addTagging({
|
|
2794
|
+
tag_guid: t,
|
|
2795
|
+
transaction_guid: e
|
|
2796
|
+
});
|
|
2797
|
+
} catch (s) {
|
|
2798
|
+
console.error("Error occurred while adding tagging:", s), this.globalStore.captureException(s, { store: "TransactionStore" });
|
|
2799
|
+
}
|
|
2784
2800
|
};
|
|
2785
2801
|
addOrUpdateTransactionRule = async (t, e) => {
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2802
|
+
try {
|
|
2803
|
+
const s = this.transactionRules.find(
|
|
2804
|
+
(a) => a.guid === e.user_transaction_rule_guid
|
|
2805
|
+
);
|
|
2806
|
+
s ? await this.api.updateTransactionRule({
|
|
2807
|
+
...s,
|
|
2808
|
+
category_guid: t,
|
|
2809
|
+
description: e.description
|
|
2810
|
+
}) : await this.api.addTransactionRule({
|
|
2811
|
+
category_guid: t,
|
|
2812
|
+
description: e.description,
|
|
2813
|
+
match_description: e.description
|
|
2814
|
+
}), await this.loadTransactionRules();
|
|
2815
|
+
} catch (s) {
|
|
2816
|
+
console.error("Error occurred while adding/updating transaction rule:", s), this.globalStore.captureException(s, { store: "TransactionStore" });
|
|
2817
|
+
}
|
|
2798
2818
|
};
|
|
2799
2819
|
addTransaction = async (t) => {
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2820
|
+
try {
|
|
2821
|
+
const e = await this.api.addTransaction(t);
|
|
2822
|
+
if (e) {
|
|
2823
|
+
this.setTransactions([e, ...this.transactions]);
|
|
2824
|
+
const s = e.transaction_type === Pt.CREDIT ? e.amount : -e.amount;
|
|
2825
|
+
this.globalStore.accountStore.updateAccountBalance(
|
|
2826
|
+
e.account_guid,
|
|
2827
|
+
s
|
|
2828
|
+
);
|
|
2829
|
+
}
|
|
2830
|
+
} catch (e) {
|
|
2831
|
+
console.error("Error occurred while adding transaction:", e), this.globalStore.captureException(e, { store: "TransactionStore" });
|
|
2805
2832
|
}
|
|
2806
2833
|
};
|
|
2807
2834
|
loadAssociatedBeats = async (t) => {
|
|
@@ -2812,7 +2839,7 @@ class Fe {
|
|
|
2812
2839
|
const s = await this.beatApi.getBeatsWithAssociatedTransaction(e);
|
|
2813
2840
|
this.setAssociatedBeats(s);
|
|
2814
2841
|
} catch (s) {
|
|
2815
|
-
console.error(
|
|
2842
|
+
console.error("Error occurred while loading associated beats:", s), this.globalStore.captureException(s, { store: "TransactionStore" }), this.setAssociatedBeats([]);
|
|
2816
2843
|
} finally {
|
|
2817
2844
|
c(() => {
|
|
2818
2845
|
this.associatedBeatsLoading = !1;
|
|
@@ -2826,7 +2853,7 @@ class Fe {
|
|
|
2826
2853
|
const t = await this.api.getTags();
|
|
2827
2854
|
this.setTags(t);
|
|
2828
2855
|
} catch (t) {
|
|
2829
|
-
console.error(
|
|
2856
|
+
console.error("Error occurred while loading tags:", t), this.globalStore.captureException(t, { store: "TransactionStore" });
|
|
2830
2857
|
} finally {
|
|
2831
2858
|
c(() => {
|
|
2832
2859
|
this.tagsLoading = !1;
|
|
@@ -2841,7 +2868,7 @@ class Fe {
|
|
|
2841
2868
|
const t = await this.api.getTaggings();
|
|
2842
2869
|
this.setTaggings(t);
|
|
2843
2870
|
} catch (t) {
|
|
2844
|
-
console.error(
|
|
2871
|
+
console.error("Error occurred while loading taggings:", t), this.globalStore.captureException(t, { store: "TransactionStore" }), this.setTaggings([]);
|
|
2845
2872
|
} finally {
|
|
2846
2873
|
c(() => {
|
|
2847
2874
|
this.taggingsLoading = !1;
|
|
@@ -2856,7 +2883,7 @@ class Fe {
|
|
|
2856
2883
|
const t = await this.api.getTransactionRules();
|
|
2857
2884
|
this.setTransactionRules(t);
|
|
2858
2885
|
} catch (t) {
|
|
2859
|
-
console.error(
|
|
2886
|
+
console.error("Error occurred while loading transaction rules:", t), this.globalStore.captureException(t, { store: "TransactionStore" }), this.setTransactionRules([]);
|
|
2860
2887
|
} finally {
|
|
2861
2888
|
c(() => {
|
|
2862
2889
|
this.transactionRulesLoading = !1;
|
|
@@ -2870,13 +2897,13 @@ class Fe {
|
|
|
2870
2897
|
try {
|
|
2871
2898
|
const e = await this.api.getTransactionsByDateRange(
|
|
2872
2899
|
m(t),
|
|
2873
|
-
m(
|
|
2900
|
+
m(Y())
|
|
2874
2901
|
);
|
|
2875
2902
|
this.setTransactions(e), c(() => {
|
|
2876
2903
|
this.cachedStartDate = t;
|
|
2877
2904
|
});
|
|
2878
2905
|
} catch (e) {
|
|
2879
|
-
console.error(
|
|
2906
|
+
console.error("Error occurred while loading transactions:", e), this.globalStore.captureException(e, { store: "TransactionStore" });
|
|
2880
2907
|
} finally {
|
|
2881
2908
|
c(() => {
|
|
2882
2909
|
this.transactionsLoading = !1;
|
|
@@ -2890,21 +2917,33 @@ class Fe {
|
|
|
2890
2917
|
);
|
|
2891
2918
|
};
|
|
2892
2919
|
removeTag = async (t) => {
|
|
2893
|
-
|
|
2920
|
+
try {
|
|
2921
|
+
await this.api.removeTag(t), await this.loadTags();
|
|
2922
|
+
} catch (e) {
|
|
2923
|
+
console.error("Error occurred while removing tag:", e), this.globalStore.captureException(e, { store: "TransactionStore" });
|
|
2924
|
+
}
|
|
2894
2925
|
};
|
|
2895
2926
|
removeTagging = async (t) => {
|
|
2896
|
-
|
|
2927
|
+
try {
|
|
2928
|
+
await this.api.removeTagging(t);
|
|
2929
|
+
} catch (e) {
|
|
2930
|
+
console.error("Error occurred while removing tagging:", e), this.globalStore.captureException(e, { store: "TransactionStore" });
|
|
2931
|
+
}
|
|
2897
2932
|
};
|
|
2898
2933
|
removeTransaction = async (t) => {
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2934
|
+
try {
|
|
2935
|
+
await this.api.removeTransaction(t);
|
|
2936
|
+
const e = this.transactions.findIndex((s) => s.guid === t);
|
|
2937
|
+
if (e >= 0) {
|
|
2938
|
+
const s = [...this.transactions];
|
|
2939
|
+
s.splice(e, 1), this.setTransactions(s);
|
|
2940
|
+
}
|
|
2941
|
+
} catch (e) {
|
|
2942
|
+
console.error("Error occurred while removing transaction:", e), this.globalStore.captureException(e, { store: "TransactionStore" });
|
|
2904
2943
|
}
|
|
2905
2944
|
};
|
|
2906
2945
|
setFilter = (t) => {
|
|
2907
|
-
this.filter = t, t.dateRange &&
|
|
2946
|
+
this.filter = t, t.dateRange && W(t.dateRange.start, this.cachedStartDate) && this.loadTransactions(t.dateRange.start);
|
|
2908
2947
|
};
|
|
2909
2948
|
setIsLoading = (t) => this.isLoading = t;
|
|
2910
2949
|
splitTransaction = async (t, e) => {
|
|
@@ -2912,88 +2951,109 @@ class Fe {
|
|
|
2912
2951
|
this.transactionSplitting = !0;
|
|
2913
2952
|
try {
|
|
2914
2953
|
const s = await this.api.updateTransaction(t), a = [];
|
|
2915
|
-
for (let
|
|
2916
|
-
const l = await this.api.addTransaction(e[
|
|
2954
|
+
for (let i = 0; i < e.length; i++) {
|
|
2955
|
+
const l = await this.api.addTransaction(e[i]);
|
|
2917
2956
|
a.push(l);
|
|
2918
2957
|
}
|
|
2919
|
-
const o = this.transactions.findIndex((
|
|
2958
|
+
const o = this.transactions.findIndex((i) => i.guid === t.guid);
|
|
2920
2959
|
if (o >= 0) {
|
|
2921
|
-
const
|
|
2960
|
+
const i = this.transactions.filter(
|
|
2922
2961
|
(l) => l.guid !== t.guid && l.parent_guid !== t.guid
|
|
2923
2962
|
);
|
|
2924
2963
|
this.setTransactions([
|
|
2925
|
-
...
|
|
2964
|
+
...i.slice(0, o),
|
|
2926
2965
|
s,
|
|
2927
2966
|
...a,
|
|
2928
|
-
...
|
|
2967
|
+
...i.slice(o)
|
|
2929
2968
|
]);
|
|
2930
2969
|
}
|
|
2970
|
+
} catch (s) {
|
|
2971
|
+
throw console.error("Error occurred while splitting transaction:", s), this.globalStore.captureException(s, { store: "TransactionStore" }), s;
|
|
2931
2972
|
} finally {
|
|
2932
2973
|
this.transactionSplitting = !1;
|
|
2933
2974
|
}
|
|
2934
2975
|
}
|
|
2935
2976
|
};
|
|
2936
2977
|
unSplitTransaction = async (t) => {
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2978
|
+
try {
|
|
2979
|
+
const e = this.transactions.filter((o) => o.parent_guid === t);
|
|
2980
|
+
await this.api.removeTransactionSplit(t);
|
|
2981
|
+
const s = [...this.transactions];
|
|
2982
|
+
e.forEach((o) => {
|
|
2983
|
+
const i = s.findIndex((l) => l.guid === o.guid);
|
|
2984
|
+
i >= 0 && s.splice(i, 1);
|
|
2985
|
+
});
|
|
2986
|
+
const a = s.findIndex((o) => o.guid === t);
|
|
2987
|
+
c(() => {
|
|
2988
|
+
const o = s[a];
|
|
2989
|
+
o && (o.has_been_split = !1), a >= 0 && this.setTransactions([
|
|
2990
|
+
...s.slice(0, a),
|
|
2991
|
+
o,
|
|
2992
|
+
...s.slice(a + 1)
|
|
2993
|
+
]);
|
|
2994
|
+
});
|
|
2995
|
+
} catch (e) {
|
|
2996
|
+
console.error("Error occurred while unsplitting transaction:", e), this.globalStore.captureException(e, { store: "TransactionStore" });
|
|
2997
|
+
}
|
|
2950
2998
|
};
|
|
2951
2999
|
updateTaggings = async (t, e) => {
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
3000
|
+
try {
|
|
3001
|
+
const s = this.taggings.filter((i) => i.transaction_guid === e), a = new Set(s.map((i) => i.tag_guid)), o = new Set(t);
|
|
3002
|
+
for (const i of t)
|
|
3003
|
+
a.has(i) || await this.addTagging(i, e);
|
|
3004
|
+
for (const i of s)
|
|
3005
|
+
o.has(i.tag_guid) || await this.removeTagging(i.guid);
|
|
3006
|
+
await this.loadTaggings();
|
|
3007
|
+
} catch (s) {
|
|
3008
|
+
console.error("Error occurred while updating taggings:", s), this.globalStore.captureException(s, { store: "TransactionStore" });
|
|
3009
|
+
}
|
|
2958
3010
|
};
|
|
2959
3011
|
updateTag = async (t) => {
|
|
2960
|
-
|
|
3012
|
+
try {
|
|
3013
|
+
await this.api.updateTag(t), await this.loadTags();
|
|
3014
|
+
} catch (e) {
|
|
3015
|
+
console.error("Error occurred while updating tag:", e), this.globalStore.captureException(e, { store: "TransactionStore" });
|
|
3016
|
+
}
|
|
2961
3017
|
};
|
|
2962
3018
|
updateTransaction = async (t) => {
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
3019
|
+
try {
|
|
3020
|
+
const e = await this.api.updateTransaction(t), s = this.transactions.findIndex((a) => a.guid === t.guid);
|
|
3021
|
+
s >= 0 && this.setTransactions([
|
|
3022
|
+
...this.transactions.slice(0, s),
|
|
3023
|
+
e,
|
|
3024
|
+
...this.transactions.slice(s + 1)
|
|
3025
|
+
]);
|
|
3026
|
+
} catch (e) {
|
|
3027
|
+
console.error("Error occurred while updating transaction:", e), this.globalStore.captureException(e, { store: "TransactionStore" });
|
|
3028
|
+
}
|
|
2969
3029
|
};
|
|
2970
3030
|
// This is used for loading the transactions list on demand, on clicking the different transactions of the insightful beats.
|
|
2971
3031
|
loadEmbeddedInstanceTransactions = async (t) => {
|
|
2972
3032
|
try {
|
|
2973
3033
|
const e = await this.api.getTransactionsByDateRange(
|
|
2974
3034
|
m(t),
|
|
2975
|
-
m(
|
|
3035
|
+
m(Y())
|
|
2976
3036
|
);
|
|
2977
3037
|
this.cachedStartDate = t, this.transactions = e;
|
|
2978
3038
|
} catch (e) {
|
|
2979
|
-
console.error(
|
|
3039
|
+
console.error("Error occurred while loading embedded instance transactions:", e), this.globalStore.captureException(e, { store: "TransactionStore" });
|
|
2980
3040
|
}
|
|
2981
3041
|
};
|
|
2982
3042
|
}
|
|
2983
3043
|
class ke {
|
|
2984
3044
|
beginDate = C(/* @__PURE__ */ new Date());
|
|
2985
|
-
endDate =
|
|
3045
|
+
endDate = b(/* @__PURE__ */ new Date());
|
|
2986
3046
|
expandedSplits = [];
|
|
2987
3047
|
height = 550;
|
|
2988
3048
|
width = 1e3;
|
|
2989
3049
|
shouldDisableDrawerScroll = !1;
|
|
2990
3050
|
searchValue = "";
|
|
2991
3051
|
selectedAccountGuids = [];
|
|
2992
|
-
manualTransaction =
|
|
3052
|
+
manualTransaction = $t;
|
|
2993
3053
|
isAmountValid = !1;
|
|
2994
3054
|
showInsights = !1;
|
|
2995
3055
|
constructor() {
|
|
2996
|
-
|
|
3056
|
+
h(this);
|
|
2997
3057
|
}
|
|
2998
3058
|
setDateRange = (t, e) => {
|
|
2999
3059
|
this.beginDate = t, this.endDate = e;
|
|
@@ -3026,9 +3086,9 @@ class He {
|
|
|
3026
3086
|
visibleListLength = 5;
|
|
3027
3087
|
constructor(t) {
|
|
3028
3088
|
this.globalStore = t, this.selectedDateRange = {
|
|
3029
|
-
start: se(
|
|
3030
|
-
end:
|
|
3031
|
-
},
|
|
3089
|
+
start: se(b(N(/* @__PURE__ */ new Date(), 6)), 1),
|
|
3090
|
+
end: b(/* @__PURE__ */ new Date())
|
|
3091
|
+
}, h(this);
|
|
3032
3092
|
}
|
|
3033
3093
|
setSelectedCategoryData = (t) => {
|
|
3034
3094
|
this.selectedCategoryData = t;
|
|
@@ -3040,7 +3100,7 @@ class He {
|
|
|
3040
3100
|
this.visibleListLength = t;
|
|
3041
3101
|
};
|
|
3042
3102
|
get sortedDetailedCategoriesWithTransactions() {
|
|
3043
|
-
return
|
|
3103
|
+
return re(
|
|
3044
3104
|
this.globalStore.categoryStore.detailedCategoriesWithTransactions
|
|
3045
3105
|
);
|
|
3046
3106
|
}
|
|
@@ -3048,7 +3108,7 @@ class He {
|
|
|
3048
3108
|
return ae(this.selectedDateRange.end, this.selectedDateRange.start) + 1;
|
|
3049
3109
|
}
|
|
3050
3110
|
get selectedDateRangeMonthRange() {
|
|
3051
|
-
const t =
|
|
3111
|
+
const t = k(this.selectedDateRange.start, H.MONTH_LONG), e = k(this.selectedDateRange.end, H.MONTH_LONG);
|
|
3052
3112
|
return `${t} - ${e}`;
|
|
3053
3113
|
}
|
|
3054
3114
|
get visibleCategories() {
|
|
@@ -3058,7 +3118,7 @@ class He {
|
|
|
3058
3118
|
return this.sortedDetailedCategoriesWithTransactions.slice(this.visibleListLength);
|
|
3059
3119
|
}
|
|
3060
3120
|
get categoryDetailsChartData() {
|
|
3061
|
-
return
|
|
3121
|
+
return ne(
|
|
3062
3122
|
this.selectedCategoryData,
|
|
3063
3123
|
this.selectedDateRangeMonthCount
|
|
3064
3124
|
);
|
|
@@ -3066,11 +3126,11 @@ class He {
|
|
|
3066
3126
|
}
|
|
3067
3127
|
class We {
|
|
3068
3128
|
globalStore;
|
|
3069
|
-
api = new
|
|
3129
|
+
api = new ct("/", "");
|
|
3070
3130
|
userFeatures = [];
|
|
3071
3131
|
userFeaturesLoaded = !1;
|
|
3072
3132
|
constructor(t) {
|
|
3073
|
-
this.globalStore = t, this.api = new
|
|
3133
|
+
this.globalStore = t, this.api = new ct(t.endpoint, t.sessionToken, t.onError), h(this);
|
|
3074
3134
|
}
|
|
3075
3135
|
get userProfile() {
|
|
3076
3136
|
return this.globalStore.appDataStore.userProfile;
|
|
@@ -3094,7 +3154,7 @@ class We {
|
|
|
3094
3154
|
const e = await this.api.updateUser(t);
|
|
3095
3155
|
this.globalStore.appDataStore.setUser(e);
|
|
3096
3156
|
} catch (e) {
|
|
3097
|
-
console.error("Error updating User:", e), this.globalStore.captureException(e, { store: "UserStore" });
|
|
3157
|
+
throw console.error("Error updating User:", e), this.globalStore.captureException(e, { store: "UserStore" }), e;
|
|
3098
3158
|
}
|
|
3099
3159
|
};
|
|
3100
3160
|
updateUserProfile = async (t) => {
|
|
@@ -3107,45 +3167,45 @@ class We {
|
|
|
3107
3167
|
};
|
|
3108
3168
|
}
|
|
3109
3169
|
export {
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3170
|
+
M as A,
|
|
3171
|
+
X as B,
|
|
3172
|
+
Se as C,
|
|
3173
|
+
be as D,
|
|
3174
|
+
tt as F,
|
|
3115
3175
|
Re as G,
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3176
|
+
st as H,
|
|
3177
|
+
rt as M,
|
|
3178
|
+
Be as N,
|
|
3179
|
+
Oe as R,
|
|
3180
|
+
ot as S,
|
|
3181
|
+
O as T,
|
|
3182
|
+
ct as U,
|
|
3183
|
+
lt as W,
|
|
3124
3184
|
ce as a,
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3185
|
+
de as b,
|
|
3186
|
+
j as c,
|
|
3187
|
+
he as d,
|
|
3128
3188
|
pe as e,
|
|
3129
|
-
|
|
3189
|
+
J as f,
|
|
3130
3190
|
_e as g,
|
|
3131
|
-
|
|
3132
|
-
|
|
3191
|
+
Z as h,
|
|
3192
|
+
ye as i,
|
|
3133
3193
|
Te as j,
|
|
3134
|
-
|
|
3194
|
+
Ie as k,
|
|
3135
3195
|
Ns as l,
|
|
3136
3196
|
Ce as m,
|
|
3137
|
-
|
|
3197
|
+
et as n,
|
|
3138
3198
|
De as o,
|
|
3139
|
-
|
|
3140
|
-
|
|
3199
|
+
ve as p,
|
|
3200
|
+
at as q,
|
|
3141
3201
|
Ge as r,
|
|
3142
3202
|
Ne as s,
|
|
3143
3203
|
nt as t,
|
|
3144
|
-
|
|
3204
|
+
Me as u,
|
|
3145
3205
|
it as v,
|
|
3146
|
-
|
|
3147
|
-
|
|
3206
|
+
Fe as w,
|
|
3207
|
+
Ue as x,
|
|
3148
3208
|
He as y,
|
|
3149
3209
|
We as z
|
|
3150
3210
|
};
|
|
3151
|
-
//# sourceMappingURL=UserStore-
|
|
3211
|
+
//# sourceMappingURL=UserStore-BBceqFxh.mjs.map
|