@mx-cartographer/experiences 3.1.0-alpha.sms5-await5 → 3.1.0-alpha.sms5-NOawait1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/accounts/stores/AccountStore.d.ts +2 -2
- package/dist/index.es.js +273 -249
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
@@ -34,7 +34,7 @@ import { format as UA } from "date-fns/format";
|
|
34
34
|
import { isBefore as sA } from "date-fns/isBefore";
|
35
35
|
import { isSameMonth as Ji } from "date-fns/isSameMonth";
|
36
36
|
import { startOfMonth as vA } from "date-fns/startOfMonth";
|
37
|
-
import { startOfToday as
|
37
|
+
import { startOfToday as F } from "date-fns/startOfToday";
|
38
38
|
import { subMonths as xe } from "date-fns/subMonths";
|
39
39
|
import re from "@mui/material/Paper";
|
40
40
|
import Zi from "@mui/icons-material/KeyboardArrowLeftRounded";
|
@@ -66,7 +66,7 @@ import wo from "@mui/material/Radio";
|
|
66
66
|
import ge from "@mui/material/Avatar";
|
67
67
|
import TA from "@mui/material/ListItemAvatar";
|
68
68
|
import te from "@mui/material/ListItemIcon";
|
69
|
-
import { makeAutoObservable as yA, runInAction as
|
69
|
+
import { makeAutoObservable as yA, runInAction as V, reaction as Lo, observable as bo } from "mobx";
|
70
70
|
import { differenceInDays as To } from "date-fns/differenceInDays";
|
71
71
|
import { getMonth as Re } from "date-fns/getMonth";
|
72
72
|
import { useVirtualizer as yr } from "@tanstack/react-virtual";
|
@@ -1499,7 +1499,7 @@ const Ss = (A, e) => {
|
|
1499
1499
|
gap: 4
|
1500
1500
|
}
|
1501
1501
|
}), _s = ({ beginDate: A, date: e, endDate: n, isInMonth: a, onClick: r }) => {
|
1502
|
-
const i = aA(), o = fA(), s = Ks(o, i), c = A && n && Ke(e, { start: A, end: n }) && !DA(e, A) && !DA(e, n), d = A && n && DA(A, e) && !DA(A, n), u = n && A && DA(n, e) && !DA(A, n), h = A && DA(A, e) || n && DA(n, e), g = DA(e,
|
1502
|
+
const i = aA(), o = fA(), s = Ks(o, i), c = A && n && Ke(e, { start: A, end: n }) && !DA(e, A) && !DA(e, n), d = A && n && DA(A, e) && !DA(A, n), u = n && A && DA(n, e) && !DA(A, n), h = A && DA(A, e) || n && DA(n, e), g = DA(e, F());
|
1503
1503
|
return /* @__PURE__ */ t(
|
1504
1504
|
"div",
|
1505
1505
|
{
|
@@ -1591,7 +1591,7 @@ const Gs = ({
|
|
1591
1591
|
selectionType: i = "Single"
|
1592
1592
|
/* Single */
|
1593
1593
|
}) => {
|
1594
|
-
const o = fA(), s = Qs(o), [c, d] = C.useState(
|
1594
|
+
const o = fA(), s = Qs(o), [c, d] = C.useState(F), [u, h] = C.useState(e), [g, v] = C.useState(n);
|
1595
1595
|
C.useEffect(() => {
|
1596
1596
|
h(e), v(n), e && d(e);
|
1597
1597
|
}, [e, n]);
|
@@ -1613,7 +1613,7 @@ const Gs = ({
|
|
1613
1613
|
!u || g ? (h(L), v(void 0)) : sA(L, u) ? (v(u), h(L), r?.(L, u)) : (v(L), r?.(u, L));
|
1614
1614
|
}
|
1615
1615
|
}, E = () => {
|
1616
|
-
const L =
|
1616
|
+
const L = F();
|
1617
1617
|
d(L), i !== "None" && (h(L), i === "Single" ? a?.(L) : (v(L), r?.(L, L)));
|
1618
1618
|
}, b = () => {
|
1619
1619
|
d(QA(c, 1));
|
@@ -2061,7 +2061,7 @@ const Gs = ({
|
|
2061
2061
|
calendarActions: A,
|
2062
2062
|
color: e = "primary",
|
2063
2063
|
copy: n,
|
2064
|
-
range: a = [vA(
|
2064
|
+
range: a = [vA(F()), PA(ke())],
|
2065
2065
|
shouldShrinkToIcon: r = !0,
|
2066
2066
|
toolTipContent: i = "",
|
2067
2067
|
variant: o = "outlined"
|
@@ -2370,7 +2370,7 @@ const Gs = ({
|
|
2370
2370
|
if (!e)
|
2371
2371
|
throw new Error(`${A}() must be used within the GlobalDataContext`);
|
2372
2372
|
return e;
|
2373
|
-
}, zA = () => _A("useAccountStore").globalStore.accountStore, Xt = () => _A("useBudgetsStore").globalStore.budgetsStore, Xn = () => _A("useCashflowStore").globalStore.cashflowStore, LA = () => _A("useCategoryStore").globalStore.categoryStore, Fn = () => _A("useGlobalStore").globalStore, mA = () => _A("useGlobalUiStore").globalStore.globalUiStore, X = () => _A("globalCopyStore").globalStore.copyStore.copy, ec = () => _A("useMerchantStore").globalStore.merchantStore, jr = () => _A("useNotificationStore").globalStore.notificationStore, xA = () => _A("useRecurringActivityStore").globalStore.recurringActivityStore, nA = () => _A("useTransactionStore").globalStore.transactionStore, Ft = () => _A("useUserStore").globalStore.userStore,
|
2373
|
+
}, zA = () => _A("useAccountStore").globalStore.accountStore, Xt = () => _A("useBudgetsStore").globalStore.budgetsStore, Xn = () => _A("useCashflowStore").globalStore.cashflowStore, LA = () => _A("useCategoryStore").globalStore.categoryStore, Fn = () => _A("useGlobalStore").globalStore, mA = () => _A("useGlobalUiStore").globalStore.globalUiStore, X = () => _A("globalCopyStore").globalStore.copyStore.copy, ec = () => _A("useMerchantStore").globalStore.merchantStore, jr = () => _A("useNotificationStore").globalStore.notificationStore, xA = () => _A("useRecurringActivityStore").globalStore.recurringActivityStore, nA = () => _A("useTransactionStore").globalStore.transactionStore, Ft = () => _A("useUserStore").globalStore.userStore, j = () => ({ onEvent: _A().onEvent }), f7 = () => ({ onPageView: _A().onPageView }), tc = (A = "useWidgetContainerContext") => {
|
2374
2374
|
const e = C.useContext(Xr);
|
2375
2375
|
if (!e)
|
2376
2376
|
throw new Error(`${A}() must be used within the WidgetContainerContext`);
|
@@ -2873,7 +2873,7 @@ const Te = ({
|
|
2873
2873
|
onClick: n,
|
2874
2874
|
sx: a = {}
|
2875
2875
|
}) => {
|
2876
|
-
const { onEvent: r } =
|
2876
|
+
const { onEvent: r } = j();
|
2877
2877
|
return n ? /* @__PURE__ */ t(eA, { sx: { bgcolor: "background.paper", ...a }, children: /* @__PURE__ */ t(
|
2878
2878
|
iA,
|
2879
2879
|
{
|
@@ -2901,14 +2901,14 @@ class cc {
|
|
2901
2901
|
yA(this);
|
2902
2902
|
}
|
2903
2903
|
initialize = async (e, n) => {
|
2904
|
-
this.api = new xt(e, n), await this.getCopy(this.featureNamespace),
|
2904
|
+
this.api = new xt(e, n), await this.getCopy(this.featureNamespace), V(() => {
|
2905
2905
|
this.isInitialized = !0;
|
2906
2906
|
});
|
2907
2907
|
};
|
2908
2908
|
getCopy = async (e, n = "") => {
|
2909
2909
|
try {
|
2910
2910
|
const a = await this.api.getGlobalCopy(e, n);
|
2911
|
-
|
2911
|
+
V(() => {
|
2912
2912
|
this.copy = a[e];
|
2913
2913
|
});
|
2914
2914
|
} catch (a) {
|
@@ -2927,7 +2927,7 @@ class lc {
|
|
2927
2927
|
};
|
2928
2928
|
loadBeats = async () => {
|
2929
2929
|
const e = await this.api.getBeats();
|
2930
|
-
|
2930
|
+
V(() => {
|
2931
2931
|
this.beats = e;
|
2932
2932
|
});
|
2933
2933
|
};
|
@@ -2954,7 +2954,7 @@ class dc {
|
|
2954
2954
|
loadBudgets = async () => {
|
2955
2955
|
try {
|
2956
2956
|
const e = await this.api.getBudgets();
|
2957
|
-
|
2957
|
+
V(() => {
|
2958
2958
|
this.budgets = e.filter(
|
2959
2959
|
(n) => n.category_guid !== f.INCOME && n.category_guid !== f.TRANSFER
|
2960
2960
|
);
|
@@ -3266,7 +3266,7 @@ const Cc = [
|
|
3266
3266
|
tags: u
|
3267
3267
|
};
|
3268
3268
|
});
|
3269
|
-
},
|
3269
|
+
}, U = {
|
3270
3270
|
ADD: "Add",
|
3271
3271
|
ADD_CATEGORY: "Add Category",
|
3272
3272
|
CHANGE_CATEGORY: "Change Category",
|
@@ -3280,11 +3280,11 @@ const Cc = [
|
|
3280
3280
|
SELECT: "Select",
|
3281
3281
|
UNHIDE: "Unhide",
|
3282
3282
|
UNSPLIT: "Unsplit"
|
3283
|
-
},
|
3283
|
+
}, W = {
|
3284
3284
|
TRANSACTION_DETAILS: "Transaction Details",
|
3285
3285
|
TRANSACTIONS_LIST: "Transactions List",
|
3286
3286
|
TRANSACTIONS_WIDGET: "Transactions Widget"
|
3287
|
-
},
|
3287
|
+
}, Y = {
|
3288
3288
|
ADD_TRANSACTION: "Manual Transaction",
|
3289
3289
|
CATEGORY: "Category",
|
3290
3290
|
DATE: "Date",
|
@@ -3306,216 +3306,216 @@ const Cc = [
|
|
3306
3306
|
}, Ma = {
|
3307
3307
|
// splits
|
3308
3308
|
[D.ON_TRANSACTION_SPLIT_CLICK]: {
|
3309
|
-
action:
|
3310
|
-
category:
|
3311
|
-
label:
|
3309
|
+
action: U.SELECT,
|
3310
|
+
category: W.TRANSACTION_DETAILS,
|
3311
|
+
label: Y.SPLITS
|
3312
3312
|
},
|
3313
3313
|
[D.ON_TRANSACTION_SPLIT_CATEGORY_CLICK]: {
|
3314
|
-
action:
|
3315
|
-
category:
|
3316
|
-
label:
|
3314
|
+
action: U.ADD_CATEGORY,
|
3315
|
+
category: W.TRANSACTION_DETAILS,
|
3316
|
+
label: Y.SPLITS
|
3317
3317
|
},
|
3318
3318
|
[D.ON_TRANSACTION_SPLIT_DELETE_CLICK]: {
|
3319
|
-
action:
|
3320
|
-
category:
|
3321
|
-
label:
|
3319
|
+
action: U.DELETE,
|
3320
|
+
category: W.TRANSACTION_DETAILS,
|
3321
|
+
label: Y.SPLITS
|
3322
3322
|
},
|
3323
3323
|
[D.ON_TRANSACTION_SPLIT_SAVE_CLICK]: {
|
3324
|
-
action:
|
3325
|
-
category:
|
3326
|
-
label:
|
3324
|
+
action: U.SPLIT,
|
3325
|
+
category: W.TRANSACTION_DETAILS,
|
3326
|
+
label: Y.SPLITS
|
3327
3327
|
},
|
3328
3328
|
[D.ON_TRANSACTION_UNSPLIT]: {
|
3329
|
-
action:
|
3330
|
-
category:
|
3331
|
-
label:
|
3329
|
+
action: U.UNSPLIT,
|
3330
|
+
category: W.TRANSACTION_DETAILS,
|
3331
|
+
label: Y.SPLITS
|
3332
3332
|
},
|
3333
3333
|
// category
|
3334
3334
|
[D.ON_TRANSACTION_CATEGORY_CLICK]: {
|
3335
|
-
action:
|
3336
|
-
category:
|
3337
|
-
label:
|
3335
|
+
action: U.SELECT,
|
3336
|
+
category: W.TRANSACTIONS_LIST,
|
3337
|
+
label: Y.CATEGORY
|
3338
3338
|
},
|
3339
3339
|
[D.ON_TRANSACTION_CATEGORY_CHANGED]: {
|
3340
|
-
action:
|
3341
|
-
category:
|
3342
|
-
label:
|
3340
|
+
action: U.CHANGE_CATEGORY,
|
3341
|
+
category: W.TRANSACTION_DETAILS,
|
3342
|
+
label: Y.CATEGORY
|
3343
3343
|
},
|
3344
3344
|
// date
|
3345
3345
|
[D.ON_TRANSACTION_DATE_CHANGED]: {
|
3346
|
-
action:
|
3347
|
-
category:
|
3348
|
-
label:
|
3346
|
+
action: U.SAVE,
|
3347
|
+
category: W.TRANSACTION_DETAILS,
|
3348
|
+
label: Y.DATE
|
3349
3349
|
},
|
3350
3350
|
[D.ON_TRANSACTION_DATE_CLICK]: {
|
3351
|
-
action:
|
3352
|
-
category:
|
3353
|
-
label:
|
3351
|
+
action: U.SELECT,
|
3352
|
+
category: W.TRANSACTION_DETAILS,
|
3353
|
+
label: Y.DATE
|
3354
3354
|
},
|
3355
3355
|
// merchant logo
|
3356
3356
|
[D.ON_TRANSACTION_DELETE_LOGO_CANCEL]: {
|
3357
|
-
action:
|
3358
|
-
category:
|
3359
|
-
label:
|
3357
|
+
action: U.CLOSE,
|
3358
|
+
category: W.TRANSACTION_DETAILS,
|
3359
|
+
label: Y.DELETE_MERCHANT_LOGO
|
3360
3360
|
},
|
3361
3361
|
[D.ON_TRANSACTION_DELETE_LOGO_CLICK]: {
|
3362
|
-
action:
|
3363
|
-
category:
|
3364
|
-
label:
|
3362
|
+
action: U.SELECT,
|
3363
|
+
category: W.TRANSACTION_DETAILS,
|
3364
|
+
label: Y.DELETE_MERCHANT_LOGO
|
3365
3365
|
},
|
3366
3366
|
[D.ON_TRANSACTION_DELETE_LOGO_DELETED]: {
|
3367
|
-
action:
|
3368
|
-
category:
|
3369
|
-
label:
|
3367
|
+
action: U.DELETE,
|
3368
|
+
category: W.TRANSACTION_DETAILS,
|
3369
|
+
label: Y.DELETE_MERCHANT_LOGO
|
3370
3370
|
},
|
3371
3371
|
// description
|
3372
3372
|
[D.ON_TRANSACTION_DESCRIPTION_EDIT_CLICK]: {
|
3373
|
-
action:
|
3374
|
-
category:
|
3375
|
-
label:
|
3373
|
+
action: U.EDIT,
|
3374
|
+
category: W.TRANSACTION_DETAILS,
|
3375
|
+
label: Y.DESCRIPTION
|
3376
3376
|
},
|
3377
3377
|
[D.ON_TRANSACTION_DESCRIPTION_SAVE_CLICK]: {
|
3378
|
-
action:
|
3379
|
-
category:
|
3380
|
-
label:
|
3378
|
+
action: U.SAVE,
|
3379
|
+
category: W.TRANSACTION_DETAILS,
|
3380
|
+
label: Y.DESCRIPTION
|
3381
3381
|
},
|
3382
3382
|
// hide transactions
|
3383
3383
|
[D.ON_TRANSACTION_HIDDEN]: {
|
3384
|
-
action:
|
3385
|
-
category:
|
3386
|
-
label:
|
3384
|
+
action: U.SAVE,
|
3385
|
+
category: W.TRANSACTION_DETAILS,
|
3386
|
+
label: Y.HIDE_TRANSACTION
|
3387
3387
|
},
|
3388
3388
|
[D.ON_TRANSACTION_HIDE_CLICK]: {
|
3389
|
-
action:
|
3390
|
-
category:
|
3391
|
-
label:
|
3389
|
+
action: U.SELECT,
|
3390
|
+
category: W.TRANSACTION_DETAILS,
|
3391
|
+
label: Y.HIDE_TRANSACTION
|
3392
3392
|
},
|
3393
3393
|
[D.ON_TRANSACTION_HIDE_CANCEL_CLICK]: {
|
3394
|
-
action:
|
3395
|
-
category:
|
3396
|
-
label:
|
3394
|
+
action: U.CLOSE,
|
3395
|
+
category: W.TRANSACTION_DETAILS,
|
3396
|
+
label: Y.HIDE_TRANSACTION
|
3397
3397
|
},
|
3398
3398
|
// transaction list
|
3399
3399
|
[D.ON_TRANSACTION_LIST_ITEM_CLICK]: {
|
3400
|
-
action:
|
3401
|
-
category:
|
3402
|
-
label:
|
3400
|
+
action: U.SELECT,
|
3401
|
+
category: W.TRANSACTIONS_LIST,
|
3402
|
+
label: Y.TRANSACTION
|
3403
3403
|
},
|
3404
3404
|
// memo
|
3405
3405
|
[D.ON_TRANSACTION_MEMO_CHANGED]: {
|
3406
|
-
action:
|
3407
|
-
category:
|
3408
|
-
label:
|
3406
|
+
action: U.SAVE,
|
3407
|
+
category: W.TRANSACTION_DETAILS,
|
3408
|
+
label: Y.MEMO
|
3409
3409
|
},
|
3410
3410
|
[D.ON_TRANSACTION_MEMO_CLICK]: {
|
3411
|
-
action:
|
3412
|
-
category:
|
3413
|
-
label:
|
3411
|
+
action: U.SELECT,
|
3412
|
+
category: W.TRANSACTION_DETAILS,
|
3413
|
+
label: Y.MEMO
|
3414
3414
|
},
|
3415
3415
|
// tags
|
3416
3416
|
[D.ON_TRANSACTION_TAGS_CHANGED]: {
|
3417
|
-
action:
|
3418
|
-
category:
|
3419
|
-
label:
|
3417
|
+
action: U.SAVE,
|
3418
|
+
category: W.TRANSACTION_DETAILS,
|
3419
|
+
label: Y.TAGS
|
3420
3420
|
},
|
3421
3421
|
[D.ON_TRANSACTION_TAGS_CLICK]: {
|
3422
|
-
action:
|
3423
|
-
category:
|
3424
|
-
label:
|
3422
|
+
action: U.SELECT,
|
3423
|
+
category: W.TRANSACTION_DETAILS,
|
3424
|
+
label: Y.TAGS
|
3425
3425
|
},
|
3426
3426
|
[D.ON_TRANSACTION_TAGS_TAG_ADD_CANCEL_CLICK]: {
|
3427
|
-
action:
|
3428
|
-
category:
|
3429
|
-
label:
|
3427
|
+
action: U.CLOSE,
|
3428
|
+
category: W.TRANSACTION_DETAILS,
|
3429
|
+
label: Y.TAGS
|
3430
3430
|
},
|
3431
3431
|
[D.ON_TRANSACTION_TAGS_TAG_ADD_CLICK]: {
|
3432
|
-
action:
|
3433
|
-
category:
|
3434
|
-
label:
|
3432
|
+
action: U.ADD,
|
3433
|
+
category: W.TRANSACTION_DETAILS,
|
3434
|
+
label: Y.TAG_ADD
|
3435
3435
|
},
|
3436
3436
|
[D.ON_TRANSACTION_TAGS_TAG_ADDED]: {
|
3437
|
-
action:
|
3438
|
-
category:
|
3439
|
-
label:
|
3437
|
+
action: U.SAVE,
|
3438
|
+
category: W.TRANSACTION_DETAILS,
|
3439
|
+
label: Y.TAG_ADD
|
3440
3440
|
},
|
3441
3441
|
[D.ON_TRANSACTION_TAGS_TAG_DELETE_CLICK]: {
|
3442
|
-
action:
|
3443
|
-
category:
|
3444
|
-
label:
|
3442
|
+
action: U.SELECT,
|
3443
|
+
category: W.TRANSACTION_DETAILS,
|
3444
|
+
label: Y.TAG_DELETE
|
3445
3445
|
},
|
3446
3446
|
[D.ON_TRANSACTION_TAGS_TAG_DELETE_CANCEL_CLICK]: {
|
3447
|
-
action:
|
3448
|
-
category:
|
3449
|
-
label:
|
3447
|
+
action: U.CLOSE,
|
3448
|
+
category: W.TRANSACTION_DETAILS,
|
3449
|
+
label: Y.TAG_DELETE
|
3450
3450
|
},
|
3451
3451
|
[D.ON_TRANSACTION_TAGS_TAG_DELETED]: {
|
3452
|
-
action:
|
3453
|
-
category:
|
3454
|
-
label:
|
3452
|
+
action: U.SAVE,
|
3453
|
+
category: W.TRANSACTION_DETAILS,
|
3454
|
+
label: Y.TAG_DELETE
|
3455
3455
|
},
|
3456
3456
|
[D.ON_TRANSACTION_TAGS_TAG_EDIT_CLICK]: {
|
3457
|
-
action:
|
3458
|
-
category:
|
3459
|
-
label:
|
3457
|
+
action: U.EDIT,
|
3458
|
+
category: W.TRANSACTION_DETAILS,
|
3459
|
+
label: Y.TAG_EDIT
|
3460
3460
|
},
|
3461
3461
|
[D.ON_TRANSACTION_TAGS_TAG_EDIT_SAVED]: {
|
3462
|
-
action:
|
3463
|
-
category:
|
3464
|
-
label:
|
3462
|
+
action: U.SAVE,
|
3463
|
+
category: W.TRANSACTION_DETAILS,
|
3464
|
+
label: Y.TAG_EDIT
|
3465
3465
|
},
|
3466
3466
|
// flag
|
3467
3467
|
[D.ON_TRANSACTION_TOGGLE_FLAG_CLICK]: {
|
3468
|
-
action:
|
3469
|
-
category:
|
3470
|
-
label:
|
3468
|
+
action: U.SELECT,
|
3469
|
+
category: W.TRANSACTION_DETAILS,
|
3470
|
+
label: Y.FLAG
|
3471
3471
|
},
|
3472
3472
|
// hide
|
3473
3473
|
[D.ON_TRANSACTION_UNHIDDEN]: {
|
3474
|
-
action:
|
3475
|
-
category:
|
3476
|
-
label:
|
3474
|
+
action: U.SAVE,
|
3475
|
+
category: W.TRANSACTION_DETAILS,
|
3476
|
+
label: Y.UNHIDE_TRANSACTION
|
3477
3477
|
},
|
3478
3478
|
[D.ON_TRANSACTION_UNHIDE_CLICK]: {
|
3479
|
-
action:
|
3480
|
-
category:
|
3481
|
-
label:
|
3479
|
+
action: U.SELECT,
|
3480
|
+
category: W.TRANSACTION_DETAILS,
|
3481
|
+
label: Y.UNHIDE_TRANSACTION
|
3482
3482
|
},
|
3483
3483
|
[D.ON_TRANSACTION_UNHIDE_CANCEL_CLICK]: {
|
3484
|
-
action:
|
3485
|
-
category:
|
3486
|
-
label:
|
3484
|
+
action: U.CLOSE,
|
3485
|
+
category: W.TRANSACTION_DETAILS,
|
3486
|
+
label: Y.UNHIDE_TRANSACTION
|
3487
3487
|
},
|
3488
3488
|
// export CSV
|
3489
3489
|
[D.ON_TRANSACTION_EXPORT_CSV_CLICK]: {
|
3490
|
-
action:
|
3491
|
-
category:
|
3492
|
-
label:
|
3490
|
+
action: U.SELECT,
|
3491
|
+
category: W.TRANSACTIONS_WIDGET,
|
3492
|
+
label: Y.EXPORT_CSV
|
3493
3493
|
},
|
3494
3494
|
// add transaction
|
3495
3495
|
[D.ON_TRANSACTION_MANUAL_ADD_CLICK]: {
|
3496
|
-
action:
|
3497
|
-
category:
|
3498
|
-
label:
|
3496
|
+
action: U.SELECT,
|
3497
|
+
category: W.TRANSACTIONS_WIDGET,
|
3498
|
+
label: Y.ADD_TRANSACTION
|
3499
3499
|
},
|
3500
3500
|
[D.ON_TRANSACTION_MANUAL_ADD_ADDED]: {
|
3501
|
-
action:
|
3502
|
-
category:
|
3503
|
-
label:
|
3501
|
+
action: U.ADD,
|
3502
|
+
category: W.TRANSACTIONS_WIDGET,
|
3503
|
+
label: Y.ADD_TRANSACTION
|
3504
3504
|
},
|
3505
3505
|
[D.ON_TRANSACTION_DELETE_CLICK]: {
|
3506
|
-
action:
|
3507
|
-
category:
|
3508
|
-
label:
|
3506
|
+
action: U.SELECT,
|
3507
|
+
category: W.TRANSACTIONS_WIDGET,
|
3508
|
+
label: Y.DELETE_TRANSACTION
|
3509
3509
|
},
|
3510
3510
|
[D.ON_TRANSACTION_DELETE_CANCEL]: {
|
3511
|
-
action:
|
3512
|
-
category:
|
3513
|
-
label:
|
3511
|
+
action: U.CLOSE,
|
3512
|
+
category: W.TRANSACTIONS_WIDGET,
|
3513
|
+
label: Y.DELETE_TRANSACTION
|
3514
3514
|
},
|
3515
3515
|
[D.ON_TRANSACTION_DELETE_DELETED]: {
|
3516
|
-
action:
|
3517
|
-
category:
|
3518
|
-
label:
|
3516
|
+
action: U.DELETE,
|
3517
|
+
category: W.TRANSACTIONS_WIDGET,
|
3518
|
+
label: Y.DELETE_TRANSACTION
|
3519
3519
|
}
|
3520
3520
|
}, pc = async (A, e) => !e || !Ma[A] ? null : await e.sendAnalyticEvent(Ma[A]), Tn = {
|
3521
3521
|
FLAG: "flag",
|
@@ -3533,7 +3533,7 @@ const Cc = [
|
|
3533
3533
|
}, Ec = (A, e, n) => {
|
3534
3534
|
const {
|
3535
3535
|
accounts: a = [],
|
3536
|
-
dateRange: r = { start: ee(
|
3536
|
+
dateRange: r = { start: ee(F(), 90), end: ke() },
|
3537
3537
|
custom: i = () => !0,
|
3538
3538
|
searchTerm: o = ""
|
3539
3539
|
} = A;
|
@@ -3634,7 +3634,7 @@ class Dc {
|
|
3634
3634
|
transactionRules = [];
|
3635
3635
|
transactions = [];
|
3636
3636
|
associatedBeats = [];
|
3637
|
-
cachedStartDate = ee(
|
3637
|
+
cachedStartDate = ee(F(), 90);
|
3638
3638
|
onAnalyticEvent = pc;
|
3639
3639
|
sortColumn = Tn.DATE;
|
3640
3640
|
sortDirection = Wr.DESC;
|
@@ -3643,7 +3643,14 @@ class Dc {
|
|
3643
3643
|
this.globalStore = e, this.uiStore = new Ic(), yA(this);
|
3644
3644
|
}
|
3645
3645
|
initialize = async (e, n) => {
|
3646
|
-
this.api = new Na(e, n), this.beatApi = new Ge(e, n),
|
3646
|
+
this.api = new Na(e, n), this.beatApi = new Ge(e, n), Promise.all([
|
3647
|
+
this.loadAssociatedBeats(vA(/* @__PURE__ */ new Date())),
|
3648
|
+
this.loadTags(),
|
3649
|
+
this.loadTaggings(),
|
3650
|
+
this.loadTransactionRules(),
|
3651
|
+
// By default loads 90 days of transactions
|
3652
|
+
this.loadTransactions()
|
3653
|
+
]).then(() => this.uiStore.setIsInitialized(!0));
|
3647
3654
|
};
|
3648
3655
|
get sortedTransactions() {
|
3649
3656
|
return yc(
|
@@ -3680,7 +3687,7 @@ class Dc {
|
|
3680
3687
|
};
|
3681
3688
|
addTransaction = async (e) => {
|
3682
3689
|
const n = await this.api.addTransaction(e);
|
3683
|
-
n &&
|
3690
|
+
n && V(
|
3684
3691
|
() => this.transactions = this.augmentTransactions([n, ...this.transactions])
|
3685
3692
|
);
|
3686
3693
|
};
|
@@ -3692,19 +3699,19 @@ class Dc {
|
|
3692
3699
|
);
|
3693
3700
|
loadAssociatedBeats = async (e) => {
|
3694
3701
|
const n = e ? zn(e, { representation: "date" }) : void 0, a = await this.beatApi.getBeatsWithAssociatedTransaction(n);
|
3695
|
-
|
3702
|
+
V(() => this.associatedBeats = a);
|
3696
3703
|
};
|
3697
3704
|
loadTags = async () => {
|
3698
3705
|
const e = await this.api.getTags();
|
3699
|
-
|
3706
|
+
V(() => this.tags = e);
|
3700
3707
|
};
|
3701
3708
|
loadTaggings = async () => {
|
3702
3709
|
const e = await this.api.getTaggings();
|
3703
|
-
|
3710
|
+
V(() => this.taggings = e);
|
3704
3711
|
};
|
3705
3712
|
loadTransactionRules = async () => {
|
3706
3713
|
const e = await this.api.getTransactionRules();
|
3707
|
-
|
3714
|
+
V(() => this.transactionRules = e);
|
3708
3715
|
};
|
3709
3716
|
loadTransactions = async (e = this.cachedStartDate, n = ke()) => {
|
3710
3717
|
this.setIsLoading(!0), this.transactions = [];
|
@@ -3713,7 +3720,7 @@ class Dc {
|
|
3713
3720
|
cA(e),
|
3714
3721
|
cA(n)
|
3715
3722
|
);
|
3716
|
-
|
3723
|
+
V(() => {
|
3717
3724
|
this.transactions = this.augmentTransactions(a);
|
3718
3725
|
});
|
3719
3726
|
} catch (a) {
|
@@ -3739,7 +3746,7 @@ class Dc {
|
|
3739
3746
|
const n = this.transactions.findIndex((a) => a.guid === e);
|
3740
3747
|
if (n >= 0) {
|
3741
3748
|
const a = [...this.transactions];
|
3742
|
-
a.splice(n, 1),
|
3749
|
+
a.splice(n, 1), V(() => this.transactions = a);
|
3743
3750
|
}
|
3744
3751
|
};
|
3745
3752
|
setFilter = (e) => {
|
@@ -3758,7 +3765,7 @@ class Dc {
|
|
3758
3765
|
r.push(s);
|
3759
3766
|
}
|
3760
3767
|
const i = this.transactions.findIndex((o) => o.guid === e.guid);
|
3761
|
-
i >= 0 &&
|
3768
|
+
i >= 0 && V(
|
3762
3769
|
() => this.transactions = this.augmentTransactions([
|
3763
3770
|
...this.transactions.slice(0, i),
|
3764
3771
|
a,
|
@@ -3776,7 +3783,7 @@ class Dc {
|
|
3776
3783
|
s >= 0 && a.splice(s, 1);
|
3777
3784
|
});
|
3778
3785
|
const r = a.findIndex((o) => o.guid === e), i = a[r];
|
3779
|
-
i.has_been_split = !1, r >= 0 &&
|
3786
|
+
i.has_been_split = !1, r >= 0 && V(
|
3780
3787
|
() => this.transactions = [
|
3781
3788
|
...a.slice(0, r),
|
3782
3789
|
i,
|
@@ -3800,7 +3807,7 @@ class Dc {
|
|
3800
3807
|
};
|
3801
3808
|
updateTransaction = async (e) => {
|
3802
3809
|
const n = await this.api.updateTransaction(e), a = this.transactions.findIndex((r) => r.guid === e.guid);
|
3803
|
-
a >= 0 &&
|
3810
|
+
a >= 0 && V(
|
3804
3811
|
() => this.transactions = this.augmentTransactions([
|
3805
3812
|
...this.transactions.slice(0, a),
|
3806
3813
|
n,
|
@@ -3875,15 +3882,15 @@ const KA = () => {
|
|
3875
3882
|
}, Vn = (A) => {
|
3876
3883
|
const e = at(A);
|
3877
3884
|
let n = En(A, e);
|
3878
|
-
for (; sA(n,
|
3885
|
+
for (; sA(n, F()); )
|
3879
3886
|
n = qe(n, 1);
|
3880
3887
|
return n;
|
3881
3888
|
}, Mc = (A) => {
|
3882
3889
|
const e = Vn(A);
|
3883
3890
|
return qe(e, 1);
|
3884
3891
|
}, Ha = (A) => {
|
3885
|
-
let e = wn(
|
3886
|
-
for (; sA(e,
|
3892
|
+
let e = wn(F(), A.getDate());
|
3893
|
+
for (; sA(e, F()); )
|
3887
3894
|
e = QA(e, 1);
|
3888
3895
|
return e;
|
3889
3896
|
}, zc = (A) => {
|
@@ -3891,7 +3898,7 @@ const KA = () => {
|
|
3891
3898
|
return QA(e, 1);
|
3892
3899
|
}, Vr = (A) => {
|
3893
3900
|
let e = Oe(A, 1);
|
3894
|
-
for (; sA(e,
|
3901
|
+
for (; sA(e, F()); )
|
3895
3902
|
e = Oe(e, 1);
|
3896
3903
|
return e;
|
3897
3904
|
}, Hc = (A) => {
|
@@ -3910,7 +3917,7 @@ const KA = () => {
|
|
3910
3917
|
width: o = "100%",
|
3911
3918
|
zeroState: s = /* @__PURE__ */ t(xc, {})
|
3912
3919
|
}) => {
|
3913
|
-
const { isLoading: c, sortedTransactions: d } = nA(), { setShowInsights: u, toggleSplit: h } = KA(), { onEvent: g } =
|
3920
|
+
const { isLoading: c, sortedTransactions: d } = nA(), { setShowInsights: u, toggleSplit: h } = KA(), { onEvent: g } = j(), v = (E) => {
|
3914
3921
|
const b = d.find((S) => S.guid === E);
|
3915
3922
|
if (b?.has_been_split) {
|
3916
3923
|
h(b.guid);
|
@@ -4203,7 +4210,7 @@ const jc = ({
|
|
4203
4210
|
}
|
4204
4211
|
);
|
4205
4212
|
}, Jn = O(jc), Uc = ({ parentCategory: A }) => {
|
4206
|
-
const [e, n] = C.useState(!1), { addCategory: a } = LA(), { categories: r } = X(), { onEvent: i } =
|
4213
|
+
const [e, n] = C.useState(!1), { addCategory: a } = LA(), { categories: r } = X(), { onEvent: i } = j(), { setShouldDisableDrawerScroll: o } = Me(), s = async (u) => {
|
4207
4214
|
await a(u.trim(), A.guid), i(JA.ON_SUBCATEGORY_ADDED), n(!1);
|
4208
4215
|
}, c = async () => {
|
4209
4216
|
i(JA.ON_SUBCATEGORY_ADD_CLICK), o(!0), n(!0);
|
@@ -4233,7 +4240,7 @@ const jc = ({
|
|
4233
4240
|
subCategory: e,
|
4234
4241
|
showRename: n
|
4235
4242
|
}) => {
|
4236
|
-
const { updateCategory: a } = LA(), { onEvent: r } =
|
4243
|
+
const { updateCategory: a } = LA(), { onEvent: r } = j(), i = async (s) => {
|
4237
4244
|
await a({ ...e, name: s }), r(JA.ON_SUBCATEGORY_SAVED), A(!1);
|
4238
4245
|
}, o = () => {
|
4239
4246
|
A(!1), r(JA.ON_SUBCATEGORY_EDIT_CANCEL_CLICK);
|
@@ -4254,7 +4261,7 @@ const jc = ({
|
|
4254
4261
|
setShowDelete: n,
|
4255
4262
|
subCategory: a
|
4256
4263
|
}) => {
|
4257
|
-
const { onEvent: r } =
|
4264
|
+
const { onEvent: r } = j(), { removeCategory: i } = LA(), o = () => {
|
4258
4265
|
n(!1), r(JA.ON_SUBCATEGORY_DELETE_CLICK);
|
4259
4266
|
}, s = async () => {
|
4260
4267
|
r(JA.ON_SUBCATEGORY_DELETED), await i(a.guid), n(!1);
|
@@ -4278,7 +4285,7 @@ const jc = ({
|
|
4278
4285
|
showSelected: o,
|
4279
4286
|
unselectable: s,
|
4280
4287
|
unselectableText: c
|
4281
|
-
} = Me(), { categories: d } = X(), { onEvent: u } =
|
4288
|
+
} = Me(), { categories: d } = X(), { onEvent: u } = j(), [h, g] = C.useState(!1), [v, m] = C.useState(!1), p = !!e.revision, E = e.guid === a, b = !s.some((L) => L === e.guid);
|
4282
4289
|
return /* @__PURE__ */ l(
|
4283
4290
|
eA,
|
4284
4291
|
{
|
@@ -4379,7 +4386,7 @@ const jc = ({
|
|
4379
4386
|
}
|
4380
4387
|
);
|
4381
4388
|
}, tl = O(el), nl = ({ category: A, subCategories: e }) => {
|
4382
|
-
const { expandedGuid: n, searchValue: a, setExpandedGuid: r } = Me(), { onEvent: i } =
|
4389
|
+
const { expandedGuid: n, searchValue: a, setExpandedGuid: r } = Me(), { onEvent: i } = j(), o = A.guid === n, s = () => {
|
4383
4390
|
const c = A.guid !== n ? A.guid : null;
|
4384
4391
|
r(c), i(c ? JA.ON_CATEGORY_EXPANDED : JA.ON_CATEGORY_COLLAPSED);
|
4385
4392
|
};
|
@@ -4583,7 +4590,7 @@ class hl {
|
|
4583
4590
|
loadCategories = async () => {
|
4584
4591
|
try {
|
4585
4592
|
const e = await this.api.getCategories(), { default_categories: n } = this.globalStore.copyStore.copy.categories;
|
4586
|
-
|
4593
|
+
V(() => {
|
4587
4594
|
this.categories = e.map((a) => ({
|
4588
4595
|
...a,
|
4589
4596
|
name: n[a.guid] ? n[a.guid].replace(/&/g, "&") : a.name
|
@@ -4601,7 +4608,7 @@ class hl {
|
|
4601
4608
|
cA(a),
|
4602
4609
|
e
|
4603
4610
|
);
|
4604
|
-
|
4611
|
+
V(() => {
|
4605
4612
|
this.dateRangeCategoryTotals = r, this.detailedCategories = this.augmentCategories(), this.setIsLoadingCategoryTotals(!1);
|
4606
4613
|
});
|
4607
4614
|
} catch (r) {
|
@@ -4612,7 +4619,7 @@ class hl {
|
|
4612
4619
|
const n = cA(vA(xe(/* @__PURE__ */ new Date(), 5))), a = cA(PA(/* @__PURE__ */ new Date()));
|
4613
4620
|
try {
|
4614
4621
|
const r = await this.api.getMonthlyCategoryTotals(n, a, e);
|
4615
|
-
|
4622
|
+
V(() => {
|
4616
4623
|
this.monthlyCategoryTotals = r, this.detailedCategories = this.augmentCategories();
|
4617
4624
|
});
|
4618
4625
|
} catch (r) {
|
@@ -4638,7 +4645,7 @@ class hl {
|
|
4638
4645
|
};
|
4639
4646
|
}
|
4640
4647
|
const Jr = ({ transaction: A }) => {
|
4641
|
-
const { addOrUpdateTransactionRule: e, updateTransaction: n } = nA(), { categories: a } = LA(), { onEvent: r } =
|
4648
|
+
const { addOrUpdateTransactionRule: e, updateTransaction: n } = nA(), { categories: a } = LA(), { onEvent: r } = j(), { setShouldDisableDrawerScroll: i, updateManualTransaction: o } = KA(), { transactions: s } = X(), [c, d] = C.useState(!1), [u, h] = C.useState(""), g = async (E) => {
|
4642
4649
|
await n({ ...A, category_guid: u }), E && await e(u, A), h(""), r(D.ON_TRANSACTION_CATEGORY_CHANGED), r("transaction_details_click_category", { transaction_guid: A.guid });
|
4643
4650
|
}, v = (E) => {
|
4644
4651
|
if (A.is_manual && !A.guid) {
|
@@ -4721,7 +4728,7 @@ const Jr = ({ transaction: A }) => {
|
|
4721
4728
|
)
|
4722
4729
|
] });
|
4723
4730
|
}, Zr = ({ transaction: A }) => {
|
4724
|
-
const e = fA(), { onEvent: n } =
|
4731
|
+
const e = fA(), { onEvent: n } = j(), { updateTransaction: a } = nA(), { updateManualTransaction: r } = KA(), { common: i, transactions: o } = X(), [s, c] = C.useState(!1), [d, u] = C.useState(A.date), h = (v) => {
|
4725
4732
|
u(cA(v));
|
4726
4733
|
}, g = async () => {
|
4727
4734
|
if (A.is_manual && !A.guid) {
|
@@ -4778,7 +4785,7 @@ const Jr = ({ transaction: A }) => {
|
|
4778
4785
|
)
|
4779
4786
|
] });
|
4780
4787
|
}, gl = ({ transaction: A }) => {
|
4781
|
-
const { onEvent: e } =
|
4788
|
+
const { onEvent: e } = j(), { removeTransaction: n } = nA(), { setShouldDisableDrawerScroll: a } = KA(), { common: r, transactions: i } = X(), [o, s] = C.useState(!1), c = async () => {
|
4782
4789
|
await n(A.guid), e(D.ON_TRANSACTION_DELETE_DELETED);
|
4783
4790
|
};
|
4784
4791
|
return /* @__PURE__ */ l(T, { className: "mx-txn-delete", children: [
|
@@ -4818,7 +4825,7 @@ const Jr = ({ transaction: A }) => {
|
|
4818
4825
|
)
|
4819
4826
|
] });
|
4820
4827
|
}, Cl = ({ transaction: A }) => {
|
4821
|
-
const { onEvent: e } =
|
4828
|
+
const { onEvent: e } = j(), { updateTransaction: n } = nA(), { setShouldDisableDrawerScroll: a } = KA(), { common: r, transactions: i } = X(), [o, s] = C.useState(!1), c = async () => {
|
4822
4829
|
await n({ ...A, merchant_guid: "" }), e(D.ON_TRANSACTION_DELETE_LOGO_DELETED), e("transaction_details_click_delete_merchant_logo", {
|
4823
4830
|
transaction_guid: A.guid
|
4824
4831
|
});
|
@@ -4858,7 +4865,7 @@ const Jr = ({ transaction: A }) => {
|
|
4858
4865
|
)
|
4859
4866
|
] });
|
4860
4867
|
}, fl = ({ transaction: A }) => {
|
4861
|
-
const { onEvent: e } =
|
4868
|
+
const { onEvent: e } = j(), { updateTransaction: n } = nA(), { setShouldDisableDrawerScroll: a } = KA(), { common: r, transactions: i } = X(), [o, s] = C.useState(!1), c = A.is_hidden, d = async () => {
|
4862
4869
|
await n({ ...A, is_hidden: !A.is_hidden }), e(
|
4863
4870
|
c ? D.ON_TRANSACTION_UNHIDDEN : D.ON_TRANSACTION_HIDDEN
|
4864
4871
|
);
|
@@ -4947,7 +4954,7 @@ const Jr = ({ transaction: A }) => {
|
|
4947
4954
|
] })
|
4948
4955
|
] });
|
4949
4956
|
}, Ai = ({ transaction: A }) => {
|
4950
|
-
const { onEvent: e } =
|
4957
|
+
const { onEvent: e } = j(), { updateTransaction: n } = nA(), { updateManualTransaction: a } = KA(), { common: r, transactions: i } = X(), [o, s] = C.useState(!1), [c, d] = C.useState("");
|
4951
4958
|
C.useEffect(() => {
|
4952
4959
|
o && d(A.memo ? A.memo : "");
|
4953
4960
|
}, [o]);
|
@@ -5014,7 +5021,7 @@ const Jr = ({ transaction: A }) => {
|
|
5014
5021
|
onUpdateAmount: a,
|
5015
5022
|
split: r
|
5016
5023
|
}) => {
|
5017
|
-
const i = fA(), { onEvent: o } =
|
5024
|
+
const i = fA(), { onEvent: o } = j(), { transactions: s } = X(), [c, d] = C.useState(`${r.amount}`), [u, h] = C.useState(!1), g = A === 0, v = (m) => {
|
5018
5025
|
isNaN(Number(m)) || (d(m), a(A, Number(m)));
|
5019
5026
|
};
|
5020
5027
|
return /* @__PURE__ */ l(
|
@@ -5116,7 +5123,7 @@ const Jr = ({ transaction: A }) => {
|
|
5116
5123
|
splits: r,
|
5117
5124
|
transaction: i
|
5118
5125
|
}) => {
|
5119
|
-
const o = fA(), { transactions: s } = X(), { onEvent: c } =
|
5126
|
+
const o = fA(), { transactions: s } = X(), { onEvent: c } = j(), [d, u] = C.useState("");
|
5120
5127
|
return C.useEffect(() => {
|
5121
5128
|
u(r.length <= 1 ? s.split_transaction_errors_min_splits : ""), u(
|
5122
5129
|
r[0].amount < 0 ? R(
|
@@ -5161,7 +5168,7 @@ const Jr = ({ transaction: A }) => {
|
|
5161
5168
|
) })
|
5162
5169
|
] });
|
5163
5170
|
}, ml = ({ transaction: A }) => {
|
5164
|
-
const { onEvent: e } =
|
5171
|
+
const { onEvent: e } = j(), { splitTransaction: n, unSplitTransaction: a } = nA(), { common: r, transactions: i } = X(), { setShouldDisableDrawerScroll: o } = KA(), { categories: s } = LA(), c = {
|
5165
5172
|
...A,
|
5166
5173
|
amount: A.amount - 1,
|
5167
5174
|
guid: "",
|
@@ -5277,7 +5284,7 @@ const Jr = ({ transaction: A }) => {
|
|
5277
5284
|
)
|
5278
5285
|
] });
|
5279
5286
|
}, yl = () => {
|
5280
|
-
const A = aA(), { onEvent: e } =
|
5287
|
+
const A = aA(), { onEvent: e } = j(), { addTag: n } = nA(), { transactions: a } = X(), [r, i] = C.useState(!1), [o, s] = C.useState(""), [c, d] = C.useState(""), u = C.useRef(null);
|
5281
5288
|
C.useEffect(() => {
|
5282
5289
|
r && u?.current?.focus();
|
5283
5290
|
}, [r]);
|
@@ -5364,7 +5371,7 @@ const Jr = ({ transaction: A }) => {
|
|
5364
5371
|
}
|
5365
5372
|
) });
|
5366
5373
|
}, wl = ({ onTagChecked: A, selectedTags: e, tag: n }) => {
|
5367
|
-
const { onEvent: a } =
|
5374
|
+
const { onEvent: a } = j(), { removeTag: r, updateTag: i } = nA(), { common: o, transactions: s } = X(), [c, d] = C.useState(!1), [u, h] = C.useState(!1), [g, v] = C.useState(""), [m, p] = C.useState(""), E = async () => {
|
5368
5375
|
a(D.ON_TRANSACTION_TAGS_TAG_EDIT_SAVED), n && await i({ ...n, name: g }), d(!1);
|
5369
5376
|
}, b = async () => {
|
5370
5377
|
a(D.ON_TRANSACTION_TAGS_TAG_DELETED), await r(n.guid), h(!1);
|
@@ -5476,7 +5483,7 @@ const Jr = ({ transaction: A }) => {
|
|
5476
5483
|
] }, o.guid)) }) })
|
5477
5484
|
] });
|
5478
5485
|
}, bl = O(Ll), Tl = ({ transaction: A }) => {
|
5479
|
-
const { onEvent: e } =
|
5486
|
+
const { onEvent: e } = j(), { tags: n, updateTaggings: a, updateTransaction: r } = nA(), { common: i, transactions: o } = X(), { updateManualTransaction: s } = KA(), [c, d] = C.useState(!1), [u, h] = C.useState(A.tags);
|
5480
5487
|
C.useEffect(() => {
|
5481
5488
|
h(A.tags);
|
5482
5489
|
}, [c, A]);
|
@@ -5531,7 +5538,7 @@ const Jr = ({ transaction: A }) => {
|
|
5531
5538
|
)
|
5532
5539
|
] });
|
5533
5540
|
}, ei = O(Tl), Sl = ({ transaction: A }) => {
|
5534
|
-
const { updateTransaction: e } = nA(), { common: n, transactions: a } = X(), { onEvent: r } =
|
5541
|
+
const { updateTransaction: e } = nA(), { common: n, transactions: a } = X(), { onEvent: r } = j(), [i, o] = C.useState(!1), [s, c] = C.useState(""), d = C.useRef(null);
|
5535
5542
|
C.useEffect(() => {
|
5536
5543
|
i && (c(A.description), d?.current?.focus());
|
5537
5544
|
}, [i]);
|
@@ -5580,7 +5587,7 @@ const Jr = ({ transaction: A }) => {
|
|
5580
5587
|
)
|
5581
5588
|
] }) });
|
5582
5589
|
}, Il = ({ transaction: A }) => {
|
5583
|
-
const { updateTransaction: e } = nA(), { transactions: n } = X(), { onEvent: a } =
|
5590
|
+
const { updateTransaction: e } = nA(), { transactions: n } = X(), { onEvent: a } = j(), r = aA(), i = async () => {
|
5584
5591
|
a(D.ON_TRANSACTION_TOGGLE_FLAG_CLICK), a("transaction_details_click_flag_transaction", { transaction_guid: A.guid }), await e({ ...A, is_flagged: !A.is_flagged });
|
5585
5592
|
};
|
5586
5593
|
return /* @__PURE__ */ t("div", { className: "mx-txn-transaction-flag", children: /* @__PURE__ */ t(
|
@@ -5616,7 +5623,7 @@ const Jr = ({ transaction: A }) => {
|
|
5616
5623
|
topActions: e = Cc,
|
5617
5624
|
transaction: n
|
5618
5625
|
}) => {
|
5619
|
-
const a = fA(), r = n?.number && n.number.length > 4, { onEvent: i } =
|
5626
|
+
const a = fA(), r = n?.number && n.number.length > 4, { onEvent: i } = j();
|
5620
5627
|
return C.useEffect(() => i("transaction-details", { transaction_guid: n.guid }), []), /* @__PURE__ */ t(T, { className: "mx-txn-transaction-details", width: "100%", children: n && /* @__PURE__ */ l(w, { children: [
|
5621
5628
|
/* @__PURE__ */ l(w, { gap: a.Spacing.Small, p: a.Spacing.Large, children: [
|
5622
5629
|
/* @__PURE__ */ t(re, { elevation: 2, sx: { borderRadius: a.BorderRadius.Small, width: 64 }, children: /* @__PURE__ */ t(
|
@@ -5840,7 +5847,7 @@ const Jr = ({ transaction: A }) => {
|
|
5840
5847
|
setSearchValue: s,
|
5841
5848
|
setShowInsights: c,
|
5842
5849
|
updateManualTransaction: d
|
5843
|
-
} = KA(), { addTransaction: u, filter: h, setFilter: g, tags: v, transactions: m, updateTransaction: p } = nA(), { common: E, transactions: b } = X(), { userProfile: S } = Ft(), { onEvent: L } =
|
5850
|
+
} = KA(), { addTransaction: u, filter: h, setFilter: g, tags: v, transactions: m, updateTransaction: p } = nA(), { common: E, transactions: b } = X(), { userProfile: S } = Ft(), { onEvent: L } = j(), {
|
5844
5851
|
displayedDateRange: N,
|
5845
5852
|
isInitialized: x,
|
5846
5853
|
selectedAccountGuids: I,
|
@@ -5848,7 +5855,7 @@ const Jr = ({ transaction: A }) => {
|
|
5848
5855
|
setDisplayedDate: k
|
5849
5856
|
} = mA(), [_, B] = C.useState(""), [H, oA] = C.useState(""), [kA, GA] = C.useState(!1);
|
5850
5857
|
C.useEffect(() => {
|
5851
|
-
const EA = vA(
|
5858
|
+
const EA = vA(F()), oa = PA(F());
|
5852
5859
|
k(EA, oa), g({
|
5853
5860
|
dateRange: { start: EA, end: oa },
|
5854
5861
|
accounts: q.map((zi) => zi.guid)
|
@@ -5874,7 +5881,7 @@ const Jr = ({ transaction: A }) => {
|
|
5874
5881
|
}, tn = () => {
|
5875
5882
|
d({
|
5876
5883
|
...Yr,
|
5877
|
-
date: cA(
|
5884
|
+
date: cA(F()),
|
5878
5885
|
user_guid: S?.user_guid || ""
|
5879
5886
|
}), B(
|
5880
5887
|
"addTransaction"
|
@@ -6040,7 +6047,7 @@ const Jr = ({ transaction: A }) => {
|
|
6040
6047
|
frequency_every_year: "Yearly",
|
6041
6048
|
frequency_title: "Select payment frequency"
|
6042
6049
|
}, Bl = ({ activity: A }) => {
|
6043
|
-
const { cashflowSequences: e, scheduledPayments: n, updateCashflowSequence: a, updateScheduledPayment: r } = xA(), { onEvent: i } =
|
6050
|
+
const { cashflowSequences: e, scheduledPayments: n, updateCashflowSequence: a, updateScheduledPayment: r } = xA(), { onEvent: i } = j(), [o, s] = C.useState(!1), c = A.activityType === uA.Income, d = [
|
6044
6051
|
{ id: z.EveryWeek, label: ae.frequency_every_week },
|
6045
6052
|
{ id: z.EveryOtherWeek, label: ae.frequency_every_other_week },
|
6046
6053
|
{ id: z.EveryMonth, label: ae.frequency_every_month },
|
@@ -6109,7 +6116,7 @@ const Jr = ({ transaction: A }) => {
|
|
6109
6116
|
activity_payment_date: "Next payment date",
|
6110
6117
|
close_drawer_aria: "Close"
|
6111
6118
|
}, Kl = ({ activity: A }) => {
|
6112
|
-
const { cashflowSequences: e, scheduledPayments: n, updateCashflowSequence: a, updateScheduledPayment: r } = xA(), { onEvent: i } =
|
6119
|
+
const { cashflowSequences: e, scheduledPayments: n, updateCashflowSequence: a, updateScheduledPayment: r } = xA(), { onEvent: i } = j(), [o, s] = C.useState(!1), [c, d] = C.useState(A.expectedDate), u = A.activityType === uA.Income, h = () => {
|
6113
6120
|
d(A.expectedDate), s(!0), i(
|
6114
6121
|
u ? "recurring_transactions_widget_income_details_click_next_payment_due" : "recurring_transactions_widget_expense_details_click_next_payment_due",
|
6115
6122
|
{
|
@@ -6148,7 +6155,7 @@ const Jr = ({ transaction: A }) => {
|
|
6148
6155
|
children: /* @__PURE__ */ t(qn, { dateAdapter: Qt, children: /* @__PURE__ */ t(
|
6149
6156
|
Rn,
|
6150
6157
|
{
|
6151
|
-
minDate:
|
6158
|
+
minDate: F(),
|
6152
6159
|
onChange: (v) => d(v),
|
6153
6160
|
value: c
|
6154
6161
|
}
|
@@ -6167,14 +6174,14 @@ const Jr = ({ transaction: A }) => {
|
|
6167
6174
|
close_drawer_aria: "Close",
|
6168
6175
|
transaction_details_drawer_title: "Transaction Details"
|
6169
6176
|
}, Gl = ({ activity: A, onDeleted: e }) => {
|
6170
|
-
const { categories: n } = LA(), { deleteCashflowSequence: a, deleteScheduledPayment: r, paidActivities: i } = xA(), { filter: o, setFilter: s, transactions: c } = nA(), { selectedAccountGuids: d } = mA(), { onEvent: u } =
|
6177
|
+
const { categories: n } = LA(), { deleteCashflowSequence: a, deleteScheduledPayment: r, paidActivities: i } = xA(), { filter: o, setFilter: s, transactions: c } = nA(), { selectedAccountGuids: d } = mA(), { onEvent: u } = j(), [h, g] = C.useState(!1), [v, m] = C.useState(""), p = n.find((x) => x.guid === A.categoryGuid), E = A.activityType === uA.Income, b = C.useMemo(
|
6171
6178
|
() => c.find((x) => x.guid === v),
|
6172
6179
|
[v]
|
6173
6180
|
);
|
6174
6181
|
C.useEffect(() => {
|
6175
6182
|
s({
|
6176
6183
|
accounts: d,
|
6177
|
-
dateRange: { start: ee(
|
6184
|
+
dateRange: { start: ee(F(), 90), end: PA(F()) }
|
6178
6185
|
});
|
6179
6186
|
}, []), C.useEffect(() => {
|
6180
6187
|
if (E && A.sequenceGuid) {
|
@@ -6747,7 +6754,7 @@ const Jr = ({ transaction: A }) => {
|
|
6747
6754
|
scheduledPaymentGuid: a.guid
|
6748
6755
|
};
|
6749
6756
|
}), Zl = () => {
|
6750
|
-
const { scheduledPayments: A } = xA(), { transactions: e } = nA(), { selectedAccounts: n } = mA(), { onEvent: a } =
|
6757
|
+
const { scheduledPayments: A } = xA(), { transactions: e } = nA(), { selectedAccounts: n } = mA(), { onEvent: a } = j(), r = Jl(n, A, e), i = (s) => {
|
6751
6758
|
a(" recurring_transactions_widget_manage_expenses_click_expense", {
|
6752
6759
|
transaction_guid: s.transactionGuid
|
6753
6760
|
});
|
@@ -6788,8 +6795,8 @@ const Jr = ({ transaction: A }) => {
|
|
6788
6795
|
};
|
6789
6796
|
}), s = a.filter(
|
6790
6797
|
(u) => Ke(wA(u.expected_date), {
|
6791
|
-
start: vA(
|
6792
|
-
end: ie(
|
6798
|
+
start: vA(F()),
|
6799
|
+
end: ie(F(), 30)
|
6793
6800
|
})
|
6794
6801
|
).filter((u) => r.find((g) => g.guid === u.cashflow_sequence_guid)?.end_date === null).map((u) => {
|
6795
6802
|
const h = r.find((p) => p.guid === u.cashflow_sequence_guid), g = e.find(
|
@@ -6833,7 +6840,7 @@ const Jr = ({ transaction: A }) => {
|
|
6833
6840
|
recurrenceDay: e.recurrence_day,
|
6834
6841
|
scheduledPaymentGuid: e.guid,
|
6835
6842
|
transactionGuid: ""
|
6836
|
-
}, c = e.recurrence_day, d =
|
6843
|
+
}, c = e.recurrence_day, d = F(), u = vA(F()), h = ie(F(), 30);
|
6837
6844
|
let g = u;
|
6838
6845
|
switch (e.recurrence_type) {
|
6839
6846
|
case z.EveryWeek:
|
@@ -6938,7 +6945,7 @@ const Jr = ({ transaction: A }) => {
|
|
6938
6945
|
sequenceGuid: i.guid
|
6939
6946
|
};
|
6940
6947
|
}), ad = () => {
|
6941
|
-
const { selectedAccounts: A } = mA(), { cashflowEvents: e, cashflowSequences: n, projectedEvents: a } = xA(), { transactions: r } = nA(), { onEvent: i } =
|
6948
|
+
const { selectedAccounts: A } = mA(), { cashflowEvents: e, cashflowSequences: n, projectedEvents: a } = xA(), { transactions: r } = nA(), { onEvent: i } = j(), o = nd(
|
6942
6949
|
A,
|
6943
6950
|
e,
|
6944
6951
|
a,
|
@@ -6959,7 +6966,7 @@ const Jr = ({ transaction: A }) => {
|
|
6959
6966
|
/* @__PURE__ */ t(ci, { isIncome: !0, label: td.manage_income_add, onAddActivity: c })
|
6960
6967
|
] });
|
6961
6968
|
}, li = O(ad), di = () => {
|
6962
|
-
const [A, e] = C.useState(0), { onEvent: n } =
|
6969
|
+
const [A, e] = C.useState(0), { onEvent: n } = j();
|
6963
6970
|
return /* @__PURE__ */ l(T, { bgcolor: "background.default", height: "100%", children: [
|
6964
6971
|
/* @__PURE__ */ l(
|
6965
6972
|
Fe,
|
@@ -6982,17 +6989,17 @@ const Jr = ({ transaction: A }) => {
|
|
6982
6989
|
A === 1 && /* @__PURE__ */ t(li, {})
|
6983
6990
|
] });
|
6984
6991
|
}, Ve = (A, e) => A + e.amount, cn = (A) => A.activityType === uA.Income && Ke(A.expectedDate, {
|
6985
|
-
start: vA(
|
6986
|
-
end: PA(
|
6992
|
+
start: vA(F()),
|
6993
|
+
end: PA(F())
|
6987
6994
|
}), mt = (A) => A.activityType === uA.Expense && Ke(A.expectedDate, {
|
6988
|
-
start: vA(
|
6989
|
-
end: PA(
|
6995
|
+
start: vA(F()),
|
6996
|
+
end: PA(F())
|
6990
6997
|
}), ln = (A) => A.occurredOnDate && Ke(A.occurredOnDate, {
|
6991
6998
|
start: vA(/* @__PURE__ */ new Date()),
|
6992
|
-
end: ie(
|
6999
|
+
end: ie(F(), 30)
|
6993
7000
|
}) || Ke(A.expectedDate, {
|
6994
7001
|
start: vA(/* @__PURE__ */ new Date()),
|
6995
|
-
end: ie(
|
7002
|
+
end: ie(F(), 30)
|
6996
7003
|
}), rd = ({ day: A, outsideCurrentMonth: e, ...n }) => {
|
6997
7004
|
const a = {
|
6998
7005
|
paid: "Paid",
|
@@ -7066,7 +7073,7 @@ const Jr = ({ transaction: A }) => {
|
|
7066
7073
|
]
|
7067
7074
|
}
|
7068
7075
|
), ka = 58, sd = () => {
|
7069
|
-
const A = aA(), { onEvent: e } =
|
7076
|
+
const A = aA(), { onEvent: e } = j(), { selectedDay: n } = xA(), [a, r] = C.useState(
|
7070
7077
|
va(/* @__PURE__ */ new Date()) * We + ka
|
7071
7078
|
), i = (s) => {
|
7072
7079
|
r(va(s) * We + ka), e("recurring_transactions_widget_click_calendar_right");
|
@@ -7205,7 +7212,7 @@ const Jr = ({ transaction: A }) => {
|
|
7205
7212
|
selectedDayActivities: i,
|
7206
7213
|
setSelectedDay: o,
|
7207
7214
|
upcomingActivities: s
|
7208
|
-
} = xA(), [c, d] = C.useState(0), { onEvent: u } =
|
7215
|
+
} = xA(), [c, d] = C.useState(0), { onEvent: u } = j(), h = e.filter(ln), g = a.filter(ln), v = n.filter(ln), m = h.filter(mt).reduce(Ve, 0), p = g.filter(mt).reduce(Ve, 0), E = v.filter(mt).reduce(Ve, 0), b = h.filter(mt).length, S = h.filter(cn).reduce(Ve, 0), L = g.filter(cn).reduce(Ve, 0), N = h.filter(cn).length, x = (k, _) => {
|
7209
7216
|
d(_);
|
7210
7217
|
}, I = (k) => {
|
7211
7218
|
u("recurring_transactions_widget_click_upcoming_transaction", {
|
@@ -7291,10 +7298,10 @@ const Jr = ({ transaction: A }) => {
|
|
7291
7298
|
recurring_activity_title: "Recurring Transactions",
|
7292
7299
|
recurring_activity_settings: "Settings"
|
7293
7300
|
}, dd = ({ sx: A = {} }) => {
|
7294
|
-
const { accounts: e } = zA(), { isInitialized: n, selectedAccountGuids: a } = mA(), { setFilter: r } = nA(), { isLoading: i } = xA(), { onEvent: o } =
|
7301
|
+
const { accounts: e } = zA(), { isInitialized: n, selectedAccountGuids: a } = mA(), { setFilter: r } = nA(), { isLoading: i } = xA(), { onEvent: o } = j();
|
7295
7302
|
C.useEffect(() => {
|
7296
7303
|
n && r({
|
7297
|
-
dateRange: { start: ee(
|
7304
|
+
dateRange: { start: ee(F(), 90), end: ke() },
|
7298
7305
|
accounts: a
|
7299
7306
|
});
|
7300
7307
|
}, [n, a]);
|
@@ -7364,7 +7371,7 @@ const Jr = ({ transaction: A }) => {
|
|
7364
7371
|
const { isInitialized: n, selectedAccountGuids: a } = mA(), { setFilter: r } = nA();
|
7365
7372
|
return C.useEffect(() => {
|
7366
7373
|
n && r({
|
7367
|
-
dateRange: { start: ee(
|
7374
|
+
dateRange: { start: ee(F(), 90), end: ke() },
|
7368
7375
|
accounts: a
|
7369
7376
|
});
|
7370
7377
|
}, [n, a]), /* @__PURE__ */ t(
|
@@ -7423,7 +7430,7 @@ class Cd {
|
|
7423
7430
|
return this.upcomingActivities.filter((e) => e.activityType === uA.Income);
|
7424
7431
|
}
|
7425
7432
|
get nextIncomeActivity() {
|
7426
|
-
return this.upcomingIncome.find((e) => rt(e.expectedDate,
|
7433
|
+
return this.upcomingIncome.find((e) => rt(e.expectedDate, F()));
|
7427
7434
|
}
|
7428
7435
|
get selectedDayActivities() {
|
7429
7436
|
return this.selectedDay && this.activities.filter(
|
@@ -7433,7 +7440,7 @@ class Cd {
|
|
7433
7440
|
addCashflowEvent = async (e) => {
|
7434
7441
|
try {
|
7435
7442
|
const n = await this.cashflowApi.addCashflowEvent(e);
|
7436
|
-
|
7443
|
+
V(() => {
|
7437
7444
|
this.cashflowEvents = [...this.cashflowEvents, n];
|
7438
7445
|
});
|
7439
7446
|
} catch (n) {
|
@@ -7454,7 +7461,7 @@ class Cd {
|
|
7454
7461
|
await this.globalStore.transactionStore.updateTransaction({
|
7455
7462
|
...n,
|
7456
7463
|
scheduled_payment_guid: a.guid
|
7457
|
-
}),
|
7464
|
+
}), V(() => {
|
7458
7465
|
this.scheduledPayments = [...this.scheduledPayments, a];
|
7459
7466
|
});
|
7460
7467
|
} catch (a) {
|
@@ -7470,7 +7477,7 @@ class Cd {
|
|
7470
7477
|
};
|
7471
7478
|
deleteScheduledPayment = async (e) => {
|
7472
7479
|
try {
|
7473
|
-
await this.api.deleteScheduledPayment(e),
|
7480
|
+
await this.api.deleteScheduledPayment(e), V(() => {
|
7474
7481
|
const n = this.scheduledPayments.findIndex((a) => a.guid === e);
|
7475
7482
|
n >= 0 && this.scheduledPayments.splice(n, 1);
|
7476
7483
|
});
|
@@ -7480,7 +7487,7 @@ class Cd {
|
|
7480
7487
|
};
|
7481
7488
|
loadActivity = () => {
|
7482
7489
|
this.isLoading = !0, Promise.all([this.loadExpenseActivity(), this.loadIncomeActivity()]).finally(
|
7483
|
-
() =>
|
7490
|
+
() => V(() => {
|
7484
7491
|
this.isLoading = !1;
|
7485
7492
|
})
|
7486
7493
|
);
|
@@ -7493,7 +7500,7 @@ class Cd {
|
|
7493
7500
|
};
|
7494
7501
|
loadCashflowSequences = async () => {
|
7495
7502
|
const e = await this.cashflowApi.getCashflowSequences();
|
7496
|
-
|
7503
|
+
V(() => {
|
7497
7504
|
this.cashflowSequences = e.filter(
|
7498
7505
|
(n) => n.transaction_type === qA.CREDIT
|
7499
7506
|
);
|
@@ -7502,10 +7509,10 @@ class Cd {
|
|
7502
7509
|
loadExpectedEvents = async () => {
|
7503
7510
|
try {
|
7504
7511
|
const e = await this.cashflowApi.getProjectedCashflowEvents(
|
7505
|
-
vA(
|
7506
|
-
ie(
|
7512
|
+
vA(F()),
|
7513
|
+
ie(F(), 30)
|
7507
7514
|
);
|
7508
|
-
|
7515
|
+
V(() => {
|
7509
7516
|
this.projectedEvents = e.filter(
|
7510
7517
|
(n) => n.transaction_type === qA.CREDIT
|
7511
7518
|
);
|
@@ -7517,10 +7524,10 @@ class Cd {
|
|
7517
7524
|
loadPaidEvents = async () => {
|
7518
7525
|
try {
|
7519
7526
|
const e = await this.cashflowApi.getCashflowEventsByDateRange(
|
7520
|
-
ee(
|
7521
|
-
PA(
|
7527
|
+
ee(F(), 90),
|
7528
|
+
PA(F())
|
7522
7529
|
);
|
7523
|
-
|
7530
|
+
V(() => {
|
7524
7531
|
this.cashflowEvents = e.filter(
|
7525
7532
|
(n) => n.transaction_type === qA.CREDIT
|
7526
7533
|
);
|
@@ -7532,7 +7539,7 @@ class Cd {
|
|
7532
7539
|
loadScheduledPayments = async () => {
|
7533
7540
|
try {
|
7534
7541
|
const e = await this.api.getScheduledPayments();
|
7535
|
-
|
7542
|
+
V(() => {
|
7536
7543
|
this.scheduledPayments = e;
|
7537
7544
|
});
|
7538
7545
|
} catch (e) {
|
@@ -7566,7 +7573,7 @@ class Cd {
|
|
7566
7573
|
try {
|
7567
7574
|
const n = await this.api.updateScheduledPayment(e), a = this.scheduledPayments.findIndex((r) => r.guid === e.guid);
|
7568
7575
|
if (a < 0) return;
|
7569
|
-
|
7576
|
+
V(() => {
|
7570
7577
|
this.scheduledPayments = [
|
7571
7578
|
...this.scheduledPayments.slice(0, a),
|
7572
7579
|
n,
|
@@ -8040,7 +8047,7 @@ const Id = ({ activity: A }) => {
|
|
8040
8047
|
}
|
8041
8048
|
);
|
8042
8049
|
}, Nd = O(xd), Md = () => {
|
8043
|
-
const { cashflow: A } = X(), { isDesktop: e } = ne(), { onEvent: n } =
|
8050
|
+
const { cashflow: A } = X(), { isDesktop: e } = ne(), { onEvent: n } = j(), [a, r] = C.useState(0), i = (o, s) => {
|
8044
8051
|
r(s);
|
8045
8052
|
};
|
8046
8053
|
return C.useEffect(() => {
|
@@ -8314,8 +8321,8 @@ const Id = ({ activity: A }) => {
|
|
8314
8321
|
), oA = !!n.length, kA = async () => {
|
8315
8322
|
I(2), c(
|
8316
8323
|
// Beginning of the month, 90 days before today
|
8317
|
-
vA(ee(
|
8318
|
-
|
8324
|
+
vA(ee(F(), 90)),
|
8325
|
+
F()
|
8319
8326
|
), u({ ...d, custom: ot }), I(3);
|
8320
8327
|
}, GA = async () => {
|
8321
8328
|
if (!(q.length < 1)) {
|
@@ -8481,7 +8488,7 @@ const Id = ({ activity: A }) => {
|
|
8481
8488
|
setSelectedAccounts: a,
|
8482
8489
|
shouldDisableNextDate: r,
|
8483
8490
|
shouldDisablePrevDate: i
|
8484
|
-
} = mA(), { onEvent: o } =
|
8491
|
+
} = mA(), { onEvent: o } = j(), { cashAccounts: s } = zA(), { setFilter: c } = nA(), { userProfile: d } = Ft(), { dateRange: u, setSelectedCashAccounts: h } = Ue(), { cashflow: g, common: v } = X(), [m, p] = C.useState(!1);
|
8485
8492
|
return C.useEffect(() => {
|
8486
8493
|
a(s);
|
8487
8494
|
}, []), C.useEffect(() => {
|
@@ -8561,7 +8568,7 @@ class Ya {
|
|
8561
8568
|
}
|
8562
8569
|
let Ud = class {
|
8563
8570
|
// Cashflow is hard-coded to display 30 days starting from today
|
8564
|
-
dateRange = { start:
|
8571
|
+
dateRange = { start: F(), end: ie(F(), 30) };
|
8565
8572
|
isDirty = !1;
|
8566
8573
|
nextIncome = void 0;
|
8567
8574
|
upcomingExpenses = [];
|
@@ -8571,7 +8578,7 @@ let Ud = class {
|
|
8571
8578
|
}
|
8572
8579
|
// Returns the number of days until the next income activity or 0 if there is no income activity
|
8573
8580
|
get daysUntilNextIncome() {
|
8574
|
-
return this.nextIncome ? Math.abs(To(
|
8581
|
+
return this.nextIncome ? Math.abs(To(F(), this.nextIncome.expectedDate)) : 0;
|
8575
8582
|
}
|
8576
8583
|
// Returns the expenses (Activities) until the next income activity or the end of the month
|
8577
8584
|
// if there is no income activity
|
@@ -8731,13 +8738,13 @@ class $d {
|
|
8731
8738
|
loadMerchants = async (e = "") => {
|
8732
8739
|
this.isLoading = !0;
|
8733
8740
|
const n = await this.api.getMerchants([e]);
|
8734
|
-
|
8741
|
+
V(() => {
|
8735
8742
|
this.merchants = n, this.isLoading = !1;
|
8736
8743
|
});
|
8737
8744
|
};
|
8738
8745
|
loadMerchantByGuid = async (e) => {
|
8739
8746
|
const n = await this.api.getMerchantByGuid(e);
|
8740
|
-
|
8747
|
+
V(() => this.merchant = n);
|
8741
8748
|
};
|
8742
8749
|
}
|
8743
8750
|
const I7 = (A) => {
|
@@ -8784,7 +8791,7 @@ class eu {
|
|
8784
8791
|
try {
|
8785
8792
|
this.isLoading = !0;
|
8786
8793
|
const e = await this.api.getNotifications();
|
8787
|
-
|
8794
|
+
V(() => {
|
8788
8795
|
this.notifications = e, this.recentNotifications = Au(e), this.isLoading = !1;
|
8789
8796
|
});
|
8790
8797
|
} catch (e) {
|
@@ -8881,7 +8888,7 @@ class su {
|
|
8881
8888
|
loadUserProfile = async () => {
|
8882
8889
|
try {
|
8883
8890
|
const e = await this.api.getUserProfile();
|
8884
|
-
|
8891
|
+
V(() => {
|
8885
8892
|
this.userProfile = e;
|
8886
8893
|
});
|
8887
8894
|
} catch (e) {
|
@@ -8891,7 +8898,7 @@ class su {
|
|
8891
8898
|
updateUserProfile = async (e) => {
|
8892
8899
|
try {
|
8893
8900
|
const n = await this.api.updateUserProfile(e);
|
8894
|
-
|
8901
|
+
V(() => {
|
8895
8902
|
this.userProfile = n;
|
8896
8903
|
});
|
8897
8904
|
} catch (n) {
|
@@ -8918,7 +8925,18 @@ class O7 {
|
|
8918
8925
|
}
|
8919
8926
|
initialize = async (e, n) => {
|
8920
8927
|
const a = Date.now();
|
8921
|
-
console.log("start awaits", a), await this.copyStore.initialize(e, n),
|
8928
|
+
console.log("start awaits", a), await this.copyStore.initialize(e, n), Promise.all([
|
8929
|
+
// this.copyStore.initialize(endpoint, token),
|
8930
|
+
this.accountStore.initialize(e, n),
|
8931
|
+
this.beatStore.initialize(e, n),
|
8932
|
+
this.merchantStore.initialize(e, n),
|
8933
|
+
this.userStore.initialize(e, n),
|
8934
|
+
this.categoryStore.initialize(e, n),
|
8935
|
+
this.transactionStore.initialize(e, n),
|
8936
|
+
this.recurringActivityStore.initialize(e, n),
|
8937
|
+
this.budgetsStore.initialize(e, n),
|
8938
|
+
this.notificationStore.initialize(e, n)
|
8939
|
+
]).then(() => {
|
8922
8940
|
const r = Date.now();
|
8923
8941
|
console.log("finish awaits", r), console.log(`Total time: ${r - a}`), this.isInitialized = !0, this.globalUiStore.setInitialized(!0), this.globalUiStore.setSelectedAccounts(this.accountStore.accounts);
|
8924
8942
|
});
|
@@ -8967,7 +8985,7 @@ const un = ({
|
|
8967
8985
|
this_will_set_the_balance_of_your_account: "This will set the balance of your _1{account_name} account to $0.00, and keep any past transaction history. This can be undone by marking the account as open.",
|
8968
8986
|
unhide_account: "Unhide Account"
|
8969
8987
|
}, lu = () => {
|
8970
|
-
const [A, e] = C.useState(!1), [n, a] = C.useState(!1), [r, i] = C.useState(!1), [o, s] = C.useState({}), { selectedAccount: c } = $A(), { mergeAccounts: d, updateAccount: u } = zA(), h = cu(), { onEvent: g } =
|
8988
|
+
const [A, e] = C.useState(!1), [n, a] = C.useState(!1), [r, i] = C.useState(!1), [o, s] = C.useState({}), { selectedAccount: c } = $A(), { mergeAccounts: d, updateAccount: u } = zA(), h = cu(), { onEvent: g } = j(), v = (p) => {
|
8971
8989
|
u({
|
8972
8990
|
...c,
|
8973
8991
|
...p
|
@@ -9468,7 +9486,7 @@ const un = ({
|
|
9468
9486
|
}
|
9469
9487
|
);
|
9470
9488
|
}, fu = O(Cu), vu = () => {
|
9471
|
-
const A = window.app?.config, { onEvent: e } =
|
9489
|
+
const A = window.app?.config, { onEvent: e } = j(), { selectedAccount: n } = $A(), a = Ld(n), r = n.member_is_managed_by_user || !n.member_is_managed_by_user && A.enable_renaming_home_accounts, [i, o] = C.useState(!1), [s, c] = C.useState(a[0]), d = a.filter(
|
9472
9490
|
(u) => r || n[u.name] || n[u.name] === 0
|
9473
9491
|
);
|
9474
9492
|
return /* @__PURE__ */ l(tA, { children: [
|
@@ -9510,7 +9528,7 @@ const un = ({
|
|
9510
9528
|
)
|
9511
9529
|
] });
|
9512
9530
|
}, pu = O(vu), mu = () => {
|
9513
|
-
const { onEvent: A } =
|
9531
|
+
const { onEvent: A } = j();
|
9514
9532
|
return C.useEffect(() => A("account_details"), []), /* @__PURE__ */ l(dA, { children: [
|
9515
9533
|
/* @__PURE__ */ t(pu, {}),
|
9516
9534
|
/* @__PURE__ */ t(gu, {}),
|
@@ -9575,7 +9593,7 @@ const un = ({
|
|
9575
9593
|
aria_close: "Close",
|
9576
9594
|
transaction_drawer_title: "Transaction Details"
|
9577
9595
|
}, bu = () => {
|
9578
|
-
const [A, e] = C.useState(""), { onEvent: n } =
|
9596
|
+
const [A, e] = C.useState(""), { onEvent: n } = j(), { selectedAccount: a } = $A(), { setFilter: r, sortedTransactions: i } = nA(), o = C.useMemo(() => i.find((s) => s.guid === A), [A]);
|
9579
9597
|
return C.useEffect(() => {
|
9580
9598
|
r({
|
9581
9599
|
dateRange: { start: Io(Do(), 90), end: Oo() },
|
@@ -9757,7 +9775,7 @@ const un = ({
|
|
9757
9775
|
}, Ku = (A) => ({
|
9758
9776
|
list_aria: `${A[0]} accounts`
|
9759
9777
|
}), ku = () => {
|
9760
|
-
const [A, e] = C.useState(""), { selectedAccounts: n } = mA(), { setSelectedAccount: a, setSelectedMember: r } = $A(), { members: i } = zA(), { onEvent: o } =
|
9778
|
+
const [A, e] = C.useState(""), { selectedAccounts: n } = mA(), { setSelectedAccount: a, setSelectedMember: r } = $A(), { members: i } = zA(), { onEvent: o } = j(), s = [...new Set(n.map((d) => d.account_type))], c = n.find((d) => A === d.guid);
|
9761
9779
|
return C.useEffect(() => {
|
9762
9780
|
if (c) {
|
9763
9781
|
a(c);
|
@@ -9878,7 +9896,7 @@ const un = ({
|
|
9878
9896
|
manage_connections: "Manage Connections",
|
9879
9897
|
sync_accounts: "Sync Accounts"
|
9880
9898
|
}, Fu = () => {
|
9881
|
-
const [A, e] = C.useState(!1), [n, a] = C.useState(!1), { accounts: r, refreshMembers: i } = zA(), { isDesktop: o } = ne(), { onEvent: s } =
|
9899
|
+
const [A, e] = C.useState(!1), [n, a] = C.useState(!1), { accounts: r, refreshMembers: i } = zA(), { isDesktop: o } = ne(), { onEvent: s } = j(), c = () => {
|
9882
9900
|
a(!0), i().finally(() => {
|
9883
9901
|
a(!1);
|
9884
9902
|
}), s("accounts_widget_click_sync");
|
@@ -10452,8 +10470,11 @@ class Yu {
|
|
10452
10470
|
constructor(e) {
|
10453
10471
|
this.globalStore = e, this.uiStore = new Wu(), yA(this);
|
10454
10472
|
}
|
10455
|
-
initialize =
|
10456
|
-
this.api = new ar(e, n), this.widgetApi = new Ta(e, n),
|
10473
|
+
initialize = (e, n) => {
|
10474
|
+
this.api = new ar(e, n), this.widgetApi = new Ta(e, n), Promise.all([
|
10475
|
+
this.loadAccounts(),
|
10476
|
+
this.loadInstitutions()
|
10477
|
+
]);
|
10457
10478
|
};
|
10458
10479
|
get cashAccounts() {
|
10459
10480
|
return this.accounts.filter(
|
@@ -10466,7 +10487,7 @@ class Yu {
|
|
10466
10487
|
addAccount = async (e) => {
|
10467
10488
|
try {
|
10468
10489
|
const n = await this.api.createAccount(e);
|
10469
|
-
|
10490
|
+
V(() => {
|
10470
10491
|
this.accounts = [...this.accounts, n];
|
10471
10492
|
});
|
10472
10493
|
} catch (n) {
|
@@ -10493,14 +10514,14 @@ class Yu {
|
|
10493
10514
|
loadAccounts = async () => {
|
10494
10515
|
await this.loadMembers();
|
10495
10516
|
const e = await this.api.getAccounts();
|
10496
|
-
|
10517
|
+
V(() => {
|
10497
10518
|
this.augmentAccounts(e);
|
10498
10519
|
});
|
10499
10520
|
};
|
10500
10521
|
loadInstitutions = async () => {
|
10501
10522
|
try {
|
10502
10523
|
const e = await this.api.getInstitutions();
|
10503
|
-
|
10524
|
+
V(() => {
|
10504
10525
|
this.institutions = e;
|
10505
10526
|
});
|
10506
10527
|
} catch (e) {
|
@@ -10510,7 +10531,7 @@ class Yu {
|
|
10510
10531
|
loadMembers = async () => {
|
10511
10532
|
try {
|
10512
10533
|
const e = await this.api.getMembers();
|
10513
|
-
|
10534
|
+
V(() => {
|
10514
10535
|
this.members = e;
|
10515
10536
|
});
|
10516
10537
|
} catch (e) {
|
@@ -10523,7 +10544,7 @@ class Yu {
|
|
10523
10544
|
mergeAccounts = async (e) => {
|
10524
10545
|
try {
|
10525
10546
|
const n = await this.api.mergeAccounts(e), a = n[Object.keys(n)[0]];
|
10526
|
-
|
10547
|
+
V(() => {
|
10527
10548
|
const r = this.accounts.findIndex((o) => o.guid === e[1]);
|
10528
10549
|
this.accounts.splice(r, 1);
|
10529
10550
|
const i = this.accounts.findIndex((o) => o.guid === e[0]);
|
@@ -10536,8 +10557,11 @@ class Yu {
|
|
10536
10557
|
sortAccounts = (e = this.accounts) => {
|
10537
10558
|
this.accounts = e.sort((n, a) => n.account_type > a.account_type ? 1 : n.account_type < a.account_type ? -1 : (n.name || "") > (a.name || "") ? 1 : (n.name || "") < (a.name || "") ? -1 : 0);
|
10538
10559
|
};
|
10539
|
-
refreshAccounts =
|
10540
|
-
this.uiStore.setIsLoading(!0),
|
10560
|
+
refreshAccounts = () => {
|
10561
|
+
this.uiStore.setIsLoading(!0), Promise.all([
|
10562
|
+
this.loadAccounts(),
|
10563
|
+
this.loadInstitutions()
|
10564
|
+
]), this.uiStore.setIsLoading(!1);
|
10541
10565
|
};
|
10542
10566
|
refreshMembers = async () => {
|
10543
10567
|
try {
|
@@ -10548,7 +10572,7 @@ class Yu {
|
|
10548
10572
|
};
|
10549
10573
|
removeAccount = async (e) => {
|
10550
10574
|
try {
|
10551
|
-
await this.api.deleteAccount(e),
|
10575
|
+
await this.api.deleteAccount(e), V(() => {
|
10552
10576
|
const n = this.accounts.findIndex((a) => a.guid === e);
|
10553
10577
|
this.accounts.splice(n, 1);
|
10554
10578
|
});
|
@@ -10559,7 +10583,7 @@ class Yu {
|
|
10559
10583
|
updateAccount = async (e) => {
|
10560
10584
|
try {
|
10561
10585
|
const n = await this.api.updateAccount(e);
|
10562
|
-
|
10586
|
+
V(() => {
|
10563
10587
|
const a = this.accounts.findIndex(
|
10564
10588
|
(r) => r.guid === n.guid
|
10565
10589
|
);
|
@@ -11436,7 +11460,7 @@ class O1 {
|
|
11436
11460
|
};
|
11437
11461
|
loadCopy = async () => {
|
11438
11462
|
const e = await this.copyApi.getGlobalCopy(this.namespace, this.translationKey);
|
11439
|
-
|
11463
|
+
V(() => {
|
11440
11464
|
this.copyObject = e[this.translationKey];
|
11441
11465
|
});
|
11442
11466
|
};
|
@@ -11617,7 +11641,7 @@ class R1 {
|
|
11617
11641
|
yA(this), this.copyStore = new O1(), this.insightsMicroWidgetStore = new H1();
|
11618
11642
|
}
|
11619
11643
|
initialize = async (e, n) => {
|
11620
|
-
await this.copyStore.initialize(e, n), await this.insightsMicroWidgetStore.initialize(e, n), this.session = await ss(e, n, "1.0.0", "Micro Insights Carousel"),
|
11644
|
+
await this.copyStore.initialize(e, n), await this.insightsMicroWidgetStore.initialize(e, n), this.session = await ss(e, n, "1.0.0", "Micro Insights Carousel"), V(() => {
|
11621
11645
|
this.isInitialized = !0;
|
11622
11646
|
});
|
11623
11647
|
};
|
@@ -13697,9 +13721,9 @@ const ut = C.createContext(null), q1 = ({
|
|
13697
13721
|
}, y3 = O(m3), E3 = {
|
13698
13722
|
title: "Spending"
|
13699
13723
|
}, w3 = ({ sx: A = {} }) => {
|
13700
|
-
const { accounts: e } = zA(), { isInitialized: n, setDisplayedDate: a } = mA(), { onEvent: r } =
|
13724
|
+
const { accounts: e } = zA(), { isInitialized: n, setDisplayedDate: a } = mA(), { onEvent: r } = j(), [i, o] = C.useState(!1);
|
13701
13725
|
C.useEffect(() => {
|
13702
|
-
a(vA(
|
13726
|
+
a(vA(F()), PA(F())), o(!0), r("spending");
|
13703
13727
|
}, []);
|
13704
13728
|
const s = (c) => {
|
13705
13729
|
a(c[0], c[1]);
|
@@ -13924,7 +13948,7 @@ export {
|
|
13924
13948
|
Me as useCategoryUiStore,
|
13925
13949
|
Ss as useCombineEvents,
|
13926
13950
|
Is as useCombinePageviews,
|
13927
|
-
|
13951
|
+
j as useEvent,
|
13928
13952
|
cu as useGetMergeableAccounts,
|
13929
13953
|
X as useGlobalCopyStore,
|
13930
13954
|
Fn as useGlobalStore,
|