@mx-cartographer/experiences 9.2.1 → 9.2.3

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.
@@ -7,7 +7,7 @@ import { A as n } from "./ApiEndpoints-DXwIYNUV.mjs";
7
7
  import Ct from "posthog-js";
8
8
  import { endOfMonth as b } from "date-fns/endOfMonth";
9
9
  import { startOfMonth as C } from "date-fns/startOfMonth";
10
- import { startOfToday as f } from "date-fns/startOfToday";
10
+ import { startOfToday as S } 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
13
  import { differenceInDays as xt } from "date-fns/differenceInDays";
@@ -27,7 +27,7 @@ import { isAfter as F } from "date-fns/isAfter";
27
27
  import { isSameDay as q } from "date-fns/isSameDay";
28
28
  import { isWithinInterval as pt } from "date-fns/isWithinInterval";
29
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";
30
+ import { f as U, h as te, b as L, a as y } from "./RecurringTransactionsUtil-CfWviBh1.mjs";
31
31
  import { I as u, A as _, B } from "./Notification-DTNYSd8P.mjs";
32
32
  import { endOfToday as Y } from "date-fns/endOfToday";
33
33
  import { formatISO as ee } from "date-fns/formatISO";
@@ -299,7 +299,7 @@ class O {
299
299
  let o = `${n.TRANSACTIONS}/by_top_level_category_guid/${t}/by_date/${e}/${s}`;
300
300
  if (a.length > 0) {
301
301
  const i = a.reduce(
302
- (l, g, y) => `${l}account_guids[]=${g}${y !== a.length - 1 ? "&" : ""}`,
302
+ (l, g, f) => `${l}account_guids[]=${g}${f !== a.length - 1 ? "&" : ""}`,
303
303
  ""
304
304
  );
305
305
  o += `?${i}`;
@@ -558,11 +558,11 @@ class ce {
558
558
  try {
559
559
  const e = [];
560
560
  for (const [i, l] of t.entries()) {
561
- const g = this.accounts.find((y) => y.guid === i);
561
+ const g = this.accounts.find((f) => f.guid === i);
562
562
  if (g && g.is_excluded_from_accounts === l) {
563
- const y = { ...g, is_excluded_from_accounts: !l };
563
+ const f = { ...g, is_excluded_from_accounts: !l };
564
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))
565
+ this.api.updateAccount(f).catch((R) => (console.error("Error occurred while updating account filter:", R), this.globalStore.captureException(R, { store: "AccountStore" }), null))
566
566
  );
567
567
  }
568
568
  }
@@ -776,7 +776,7 @@ class _e {
776
776
  api = new J("/", "");
777
777
  globalStore;
778
778
  alert = "";
779
- dateRange = { start: C(f()), end: b(f()) };
779
+ dateRange = { start: C(S()), end: b(S()) };
780
780
  budgets = [];
781
781
  selectedBudget;
782
782
  selectedSubBudget;
@@ -940,11 +940,11 @@ class _e {
940
940
  }
941
941
  };
942
942
  }
943
- class Se {
943
+ class ye {
944
944
  globalStore;
945
945
  uiStore;
946
946
  constructor(t) {
947
- this.globalStore = t, this.uiStore = new fe(t), h(this);
947
+ this.globalStore = t, this.uiStore = new Se(t), h(this);
948
948
  }
949
949
  completeOnboarding = async () => {
950
950
  const t = {
@@ -954,13 +954,13 @@ class Se {
954
954
  await this.globalStore.userStore.updateUserProfile(t);
955
955
  };
956
956
  }
957
- let fe = class {
957
+ let Se = class {
958
958
  globalStore;
959
959
  // Cashflow is hard-coded to display 30 days starting from today. This is the
960
960
  // single source of truth for Cash Flow's window; it intentionally does NOT
961
961
  // mutate RecurringTransactionsStore.dateRange, so Cash Flow stays decoupled
962
962
  // from other widgets (e.g. Recurring Transactions) that drive that shared range.
963
- dateRange = { start: f(), end: Dt(f(), 30) };
963
+ dateRange = { start: S(), end: Dt(S(), 30) };
964
964
  isDirty = !1;
965
965
  constructor(t) {
966
966
  this.globalStore = t, h(this);
@@ -1000,7 +1000,7 @@ let fe = class {
1000
1000
  }
1001
1001
  // Returns the number of days until the next income activity or 0 if there is no income activity
1002
1002
  get daysUntilNextIncome() {
1003
- return this.nextIncome ? Math.abs(xt(f(), this.nextIncome.expectedDate)) : 0;
1003
+ return this.nextIncome ? Math.abs(xt(S(), this.nextIncome.expectedDate)) : 0;
1004
1004
  }
1005
1005
  // Returns the expenses (Activities) until the next income activity or the end of the month
1006
1006
  // if there is no income activity
@@ -1010,7 +1010,7 @@ let fe = class {
1010
1010
  );
1011
1011
  }
1012
1012
  };
1013
- class ye {
1013
+ class fe {
1014
1014
  globalStore;
1015
1015
  uiStore;
1016
1016
  api = new Z("/", "");
@@ -1499,7 +1499,7 @@ class Ns {
1499
1499
  // UI Stores
1500
1500
  globalUiStore;
1501
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(() => {
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 ye(this), this.categoryStore = new fe(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
1503
  const { transactions: i } = this.transactionStore;
1504
1504
  this.emitUpdate({
1505
1505
  transactions: i
@@ -1534,9 +1534,9 @@ class Ns {
1534
1534
  transactionRules: i,
1535
1535
  transactions: l,
1536
1536
  userFeatures: g,
1537
- merchantBudgets: y
1537
+ merchantBudgets: f
1538
1538
  } = {}) => {
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);
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), f && this.budgetsStore.setMerchantBudgets(f);
1540
1540
  };
1541
1541
  }
1542
1542
  class Ce {
@@ -2127,7 +2127,7 @@ class Oe {
2127
2127
  repeatingTransactions = [];
2128
2128
  isDataLoaded = !1;
2129
2129
  selectedDay;
2130
- dateRange = { start: C(f()), end: b(f()) };
2130
+ dateRange = { start: C(S()), end: b(S()) };
2131
2131
  selectedRepeatingTransactionGuid = null;
2132
2132
  selectedRecurrence = null;
2133
2133
  alert = { message: "", severity: void 0 };
@@ -2169,7 +2169,7 @@ class Oe {
2169
2169
  * Returns the upcoming expense recurrences scoped to the supplied date range.
2170
2170
  */
2171
2171
  upcomingExpensesForRange = (t) => this.recurrencesForRange(t).filter(
2172
- (e) => e.type === L.Expense && e.status === S.Upcoming
2172
+ (e) => e.type === L.Expense && e.status === y.Upcoming
2173
2173
  );
2174
2174
  /**
2175
2175
  * Returns the income recurrences scoped to the supplied date range.
@@ -2181,13 +2181,13 @@ class Oe {
2181
2181
  * Returns the upcoming income recurrences scoped to the supplied date range.
2182
2182
  */
2183
2183
  upcomingIncomeForRange = (t) => this.incomeForRange(t).filter(
2184
- (e) => e.status === S.Upcoming
2184
+ (e) => e.status === y.Upcoming
2185
2185
  );
2186
2186
  /**
2187
2187
  * Returns the next upcoming income recurrence scoped to the supplied range.
2188
2188
  */
2189
2189
  nextIncomeForRange = (t) => this.upcomingIncomeForRange(t).find(
2190
- (e) => F(e.expectedDate, f())
2190
+ (e) => F(e.expectedDate, S())
2191
2191
  );
2192
2192
  /**
2193
2193
  * Returns all recurrences built from repeating transactions and filtered by accounts.
@@ -2200,7 +2200,7 @@ class Oe {
2200
2200
  */
2201
2201
  get pastRecurrences() {
2202
2202
  return this.recurrences.filter(
2203
- (t) => t.status === S.Paid || t.status === S.Missed
2203
+ (t) => t.status === y.Paid || t.status === y.Missed
2204
2204
  );
2205
2205
  }
2206
2206
  /**
@@ -2209,7 +2209,7 @@ class Oe {
2209
2209
  */
2210
2210
  get upcomingRecurrences() {
2211
2211
  return this.recurrences.filter(
2212
- (t) => F(t.expectedDate, _t(f(), 3)) && W(t.expectedDate, this.dateRange.end) && t.status === S.Upcoming
2212
+ (t) => F(t.expectedDate, _t(S(), 3)) && W(t.expectedDate, this.dateRange.end) && t.status === y.Upcoming
2213
2213
  );
2214
2214
  }
2215
2215
  /**
@@ -2225,7 +2225,7 @@ class Oe {
2225
2225
  */
2226
2226
  get upcomingExpenses() {
2227
2227
  return this.expenses.filter(
2228
- (t) => t.status === S.Upcoming
2228
+ (t) => t.status === y.Upcoming
2229
2229
  );
2230
2230
  }
2231
2231
  /**
@@ -2241,11 +2241,11 @@ class Oe {
2241
2241
  */
2242
2242
  get upcomingIncome() {
2243
2243
  return this.income.filter(
2244
- (t) => t.status === S.Upcoming
2244
+ (t) => t.status === y.Upcoming
2245
2245
  );
2246
2246
  }
2247
2247
  get nextIncomeRecurrence() {
2248
- return this.upcomingIncome.find((t) => F(t.expectedDate, f()));
2248
+ return this.upcomingIncome.find((t) => F(t.expectedDate, S()));
2249
2249
  }
2250
2250
  /**
2251
2251
  * Returns the expense recurrences for the current month.
@@ -2273,19 +2273,19 @@ class Oe {
2273
2273
  * Calculates the total amount of all paid expenses for the current month.
2274
2274
  */
2275
2275
  get paidExpenseTotal() {
2276
- return this.currentMonthExpenses.filter((t) => t.status === S.Paid).reduce(A, 0);
2276
+ return this.currentMonthExpenses.filter((t) => t.status === y.Paid).reduce(A, 0);
2277
2277
  }
2278
2278
  /**
2279
2279
  * Calculates the total amount of all missed expenses for the current month.
2280
2280
  */
2281
2281
  get missedExpenseTotal() {
2282
- return this.currentMonthExpenses.filter((t) => t.status === S.Missed).reduce(A, 0);
2282
+ return this.currentMonthExpenses.filter((t) => t.status === y.Missed).reduce(A, 0);
2283
2283
  }
2284
2284
  /**
2285
2285
  * Calculates the total amount of all upcoming expenses for the current month.
2286
2286
  */
2287
2287
  get upcomingExpenseTotal() {
2288
- return this.currentMonthExpenses.filter((t) => t.status === S.Upcoming).reduce(A, 0);
2288
+ return this.currentMonthExpenses.filter((t) => t.status === y.Upcoming).reduce(A, 0);
2289
2289
  }
2290
2290
  /**
2291
2291
  * Calculates the total amount of all income for the current month.
@@ -2297,13 +2297,13 @@ class Oe {
2297
2297
  * Calculates the total amount of all paid income for the current month.
2298
2298
  */
2299
2299
  get paidIncomeTotal() {
2300
- return this.currentMonthIncome.filter((t) => t.status === S.Paid).reduce(A, 0);
2300
+ return this.currentMonthIncome.filter((t) => t.status === y.Paid).reduce(A, 0);
2301
2301
  }
2302
2302
  /**
2303
2303
  * Calculates the total amount of all upcoming income for the current month.
2304
2304
  */
2305
2305
  get upcomingIncomeTotal() {
2306
- return this.currentMonthIncome.filter((t) => t.status === S.Upcoming).reduce(A, 0);
2306
+ return this.currentMonthIncome.filter((t) => t.status === y.Upcoming).reduce(A, 0);
2307
2307
  }
2308
2308
  /**
2309
2309
  * Get the recurrences for the currently selected day.
@@ -2361,7 +2361,7 @@ class Oe {
2361
2361
  addRepeatingTransaction = async (t, e) => {
2362
2362
  try {
2363
2363
  const s = await this.api.addRepeatingTransaction(t);
2364
- await this.globalStore.transactionStore.updateTransaction({
2364
+ return await this.globalStore.transactionStore.updateTransaction({
2365
2365
  ...e,
2366
2366
  repeating_transaction_guid: s.guid
2367
2367
  }), c(() => {
@@ -2373,9 +2373,9 @@ class Oe {
2373
2373
  this.globalStore.transactionStore.transactions
2374
2374
  )
2375
2375
  ];
2376
- });
2376
+ }), this.setAlert(this.copy.add_repeating_transaction_success, "success"), !0;
2377
2377
  } catch (s) {
2378
- console.error("Error occurred while adding repeating transaction:", s), this.globalStore.captureException(s, { store: "RecurringTransactionsStore" });
2378
+ return console.error("Error occurred while adding repeating transaction:", s), this.globalStore.captureException(s, { store: "RecurringTransactionsStore" }), this.setAlert(this.copy.add_repeating_transaction_error, "error"), !1;
2379
2379
  }
2380
2380
  };
2381
2381
  /**
@@ -2384,13 +2384,13 @@ class Oe {
2384
2384
  */
2385
2385
  deleteRepeatingTransaction = async (t) => {
2386
2386
  try {
2387
- await this.api.deleteRepeatingTransaction(t), c(() => {
2387
+ return await this.api.deleteRepeatingTransaction(t), c(() => {
2388
2388
  this.repeatingTransactions = [
2389
2389
  ...this.repeatingTransactions.filter((e) => e.guid !== t)
2390
2390
  ];
2391
- });
2391
+ }), this.setAlert(this.copy.remove_repeating_transaction_success, "success"), !0;
2392
2392
  } catch (e) {
2393
- console.error("Error occurred while deleting repeating transaction:", e), this.globalStore.captureException(e, { store: "RecurringTransactionsStore" });
2393
+ return console.error("Error occurred while deleting repeating transaction:", e), this.globalStore.captureException(e, { store: "RecurringTransactionsStore" }), this.setAlert(this.copy.remove_repeating_transaction_error, "error"), !1;
2394
2394
  }
2395
2395
  };
2396
2396
  /**
@@ -2402,8 +2402,7 @@ class Oe {
2402
2402
  const e = await this.api.updateRepeatingTransaction(t), s = this.repeatingTransactions.findIndex(
2403
2403
  (a) => a.guid === e.guid
2404
2404
  );
2405
- if (s < 0) return;
2406
- c(() => {
2405
+ return s < 0 ? !1 : (c(() => {
2407
2406
  this.repeatingTransactions = [
2408
2407
  ...this.repeatingTransactions.slice(0, s),
2409
2408
  ...U(
@@ -2413,9 +2412,9 @@ class Oe {
2413
2412
  ),
2414
2413
  ...this.repeatingTransactions.slice(s + 1)
2415
2414
  ];
2416
- });
2415
+ }), this.setAlert(this.copy.update_repeating_transaction_success, "success"), !0);
2417
2416
  } catch (e) {
2418
- console.error("Error occurred while updating repeating transaction:", e), this.globalStore.captureException(e, { store: "RecurringTransactionsStore" });
2417
+ return console.error("Error occurred while updating repeating transaction:", e), this.globalStore.captureException(e, { store: "RecurringTransactionsStore" }), this.setAlert(this.copy.update_repeating_transaction_error, "error"), !1;
2419
2418
  }
2420
2419
  };
2421
2420
  /**
@@ -2486,19 +2485,19 @@ const ut = "PARENT-ENTITY", Pe = (r, t) => ({
2486
2485
  const i = [], {
2487
2486
  email_notifications_enabled: l,
2488
2487
  sms_notifications_enabled: g,
2489
- push_notifications_enabled: y
2488
+ push_notifications_enabled: f
2490
2489
  } = t, {
2491
2490
  opted_out_of_email_notifications: R,
2492
- opted_out_of_sms_notifications: St,
2493
- opted_out_of_push_notifications: ft
2491
+ opted_out_of_sms_notifications: yt,
2492
+ opted_out_of_push_notifications: St
2494
2493
  } = a;
2495
2494
  for (const E of s.filter((D) => D.entity_guid === ut)) {
2496
- const D = Pe(E.notification_type, e), yt = s.filter(
2495
+ const D = Pe(E.notification_type, e), ft = s.filter(
2497
2496
  (I) => I.entity_guid !== ut && I.notification_type === E.notification_type && r.some((P) => P.guid === I.entity_guid)
2498
2497
  ), 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({
2498
+ l && !R && E.email_channel && o.email && x.push(e.delivery_method_email_label), g && !yt && E.sms_channel && o.phone && x.push(e.delivery_method_sms_label), f && !St && E.push_channel && x.push(e.delivery_method_push_label), i.push({
2500
2499
  ...E,
2501
- children: yt.map((I) => ({
2500
+ children: ft.map((I) => ({
2502
2501
  ...I,
2503
2502
  account: r.find((P) => P.guid === I.entity_guid),
2504
2503
  label: D
@@ -2716,7 +2715,7 @@ class Ue {
2716
2715
  transactionRulesLoaded = !1;
2717
2716
  transactionRulesLoading = !1;
2718
2717
  transactionSplitting = !1;
2719
- cachedStartDate = _t(f(), 90);
2718
+ cachedStartDate = _t(S(), 90);
2720
2719
  filter = {};
2721
2720
  isLoading = !0;
2722
2721
  alert = "";
@@ -3169,7 +3168,7 @@ class We {
3169
3168
  export {
3170
3169
  M as A,
3171
3170
  X as B,
3172
- Se as C,
3171
+ ye as C,
3173
3172
  be as D,
3174
3173
  tt as F,
3175
3174
  Re as G,
@@ -3189,7 +3188,7 @@ export {
3189
3188
  J as f,
3190
3189
  _e as g,
3191
3190
  Z as h,
3192
- ye as i,
3191
+ fe as i,
3193
3192
  Te as j,
3194
3193
  Ie as k,
3195
3194
  Ns as l,
@@ -3208,4 +3207,4 @@ export {
3208
3207
  He as y,
3209
3208
  We as z
3210
3209
  };
3211
- //# sourceMappingURL=UserStore-BBceqFxh.mjs.map
3210
+ //# sourceMappingURL=UserStore-Cp-2Jtnw.mjs.map