@mx-cartographer/experiences 9.3.1-alpha.al0 → 9.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -7
- package/dist/cashflow/CashflowOnboarding.es.js +1 -1
- package/dist/core/api/SettingsApi.d.ts +0 -4
- package/dist/core/api/SettingsApi.es.js +4 -5
- package/dist/core/api/SettingsApi.es.js.map +1 -1
- package/dist/core/constants/ApiEndpoints.d.ts +0 -1
- package/dist/core/constants/ApiEndpoints.es.js +0 -1
- package/dist/core/constants/ApiEndpoints.es.js.map +1 -1
- package/dist/core/stores/CategoryStore.es.js +46 -46
- package/dist/core/stores/CategoryStore.es.js.map +1 -1
- package/dist/core/stores/FinstrongStore.es.js +1 -1
- package/dist/core/stores/SettingsStore.d.ts +0 -4
- package/dist/core/stores/SettingsStore.es.js +73 -80
- package/dist/core/stores/SettingsStore.es.js.map +1 -1
- package/dist/core/types/localization/SettingsCopy.d.ts +0 -6
- package/dist/core/utils/DateUtil.d.ts +1 -0
- package/dist/core/utils/DateUtil.es.js +48 -47
- package/dist/core/utils/DateUtil.es.js.map +1 -1
- package/dist/core/utils/DebtUtils.es.js +6 -6
- package/dist/core/utils/GoalsUtil.es.js +1 -1
- package/dist/core/utils/RecurringTransactionsUtil.es.js +5 -5
- package/dist/core/utils/TransactionUtils.es.js +1 -1
- package/dist/goals/components/actions/BirthdayAction.es.js +1 -1
- package/dist/recurringtransactions/components/RecurringTransactionList.es.js +4 -4
- package/dist/settings/components/profile/ProfileTab.d.ts +1 -1
- package/dist/settings/components/profile/ProfileTab.es.js +108 -115
- package/dist/settings/components/profile/ProfileTab.es.js.map +1 -1
- package/dist/settings/components/profile/actions/VerifyEmailAction.es.js +37 -20
- package/dist/settings/components/profile/actions/VerifyEmailAction.es.js.map +1 -1
- package/dist/settings/components/profile/actions/VerifyPhoneAction.es.js +17 -11
- package/dist/settings/components/profile/actions/VerifyPhoneAction.es.js.map +1 -1
- package/dist/settings/constants/Settings.d.ts +0 -8
- package/dist/settings/constants/Settings.es.js +3 -10
- package/dist/settings/constants/Settings.es.js.map +1 -1
- package/package.json +1 -1
- package/dist/settings/components/profile/actions/ResetPasswordAction.d.ts +0 -4
- package/dist/settings/components/profile/actions/ResetPasswordAction.es.js +0 -94
- package/dist/settings/components/profile/actions/ResetPasswordAction.es.js.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { SettingsApi as
|
|
2
|
-
import { TransactionApi as
|
|
1
|
+
import { SettingsApi as n } from "../api/SettingsApi.es.js";
|
|
2
|
+
import { TransactionApi as a } from "../api/TransactionApi.es.js";
|
|
3
3
|
import { AccountNotificationTypes as o, BudgetNotificationTypes as c, InsightNotificationTypes as l } from "../types/Notification.es.js";
|
|
4
4
|
import { augmentNotificationProfiles as u } from "../utils/SettingsUtil.es.js";
|
|
5
5
|
import { makeAutoObservable as p, runInAction as r } from "mobx";
|
|
6
6
|
var _ = class {
|
|
7
7
|
globalStore;
|
|
8
|
-
api = new
|
|
9
|
-
transactionApi = new
|
|
8
|
+
api = new n("/", "");
|
|
9
|
+
transactionApi = new a("/", "");
|
|
10
10
|
alert = {
|
|
11
11
|
message: "",
|
|
12
12
|
severity: void 0
|
|
@@ -15,19 +15,19 @@ var _ = class {
|
|
|
15
15
|
notificationProfiles = [];
|
|
16
16
|
selectedRule = void 0;
|
|
17
17
|
transactionRules = [];
|
|
18
|
-
constructor(
|
|
19
|
-
this.globalStore =
|
|
18
|
+
constructor(e) {
|
|
19
|
+
this.globalStore = e, this.api = new n(e.endpoint, e.sessionToken, e.onError), this.transactionApi = new a(e.endpoint, e.sessionToken, e.onError), p(this);
|
|
20
20
|
}
|
|
21
21
|
get accountProfiles() {
|
|
22
|
-
const
|
|
23
|
-
return this.detailedNotificationProfiles.filter((
|
|
22
|
+
const e = this.globalStore.appDataStore.clientCommunicationProfile;
|
|
23
|
+
return this.detailedNotificationProfiles.filter((t) => t.notification_type === o.DebtPaymentReminder && e.debt_payment_reminder_notifications_enabled || t.notification_type === o.AccountBalanceLow && e.low_balance_notifications_enabled || t.notification_type === o.AccountDepositLarge && e.large_deposit_notifications_enabled || t.notification_type === o.TransactionExpenseLarge && e.large_expense_notifications_enabled || t.notification_type === o.TransactionFeeCharge && e.transaction_fee_notifications_enabled || t.notification_type === o.InternationalTransaction && e.transaction_is_international_notifications_enabled || t.notification_type === o.AccountDepositLargePosted && e.large_deposit_posted_notifications_enabled);
|
|
24
24
|
}
|
|
25
25
|
get budgetProfiles() {
|
|
26
|
-
const
|
|
27
|
-
return this.detailedNotificationProfiles.filter((
|
|
26
|
+
const e = this.globalStore.appDataStore.clientCommunicationProfile;
|
|
27
|
+
return this.detailedNotificationProfiles.filter((t) => t.notification_type === c.BudgetExceeded && e.budget_exceeded_notifications_enabled || t.notification_type === c.BudgetOffTarget && e.budget_off_target_notifications_enabled);
|
|
28
28
|
}
|
|
29
29
|
get insightsProfiles() {
|
|
30
|
-
return this.detailedNotificationProfiles.filter((
|
|
30
|
+
return this.detailedNotificationProfiles.filter((e) => Object.values(l).includes(e.notification_type));
|
|
31
31
|
}
|
|
32
32
|
get clientCommunicationProfile() {
|
|
33
33
|
return this.globalStore.appDataStore.clientCommunicationProfile;
|
|
@@ -41,146 +41,139 @@ var _ = class {
|
|
|
41
41
|
get userCommunicationsProfile() {
|
|
42
42
|
return this.globalStore.appDataStore.userCommunicationProfile;
|
|
43
43
|
}
|
|
44
|
-
deleteDevice = async (
|
|
44
|
+
deleteDevice = async (e) => {
|
|
45
45
|
try {
|
|
46
|
-
await this.api.deleteDevice(
|
|
47
|
-
const
|
|
48
|
-
return
|
|
49
|
-
this.devices.splice(
|
|
46
|
+
await this.api.deleteDevice(e);
|
|
47
|
+
const t = this.devices.findIndex((i) => i.guid === e);
|
|
48
|
+
return t >= 0 && r(() => {
|
|
49
|
+
this.devices.splice(t, 1);
|
|
50
50
|
}), { success: !0 };
|
|
51
|
-
} catch (
|
|
52
|
-
return console.error("Error deleting device:",
|
|
51
|
+
} catch (t) {
|
|
52
|
+
return console.error("Error deleting device:", t), this.globalStore.captureException(t, { store: "SettingsStore" }), { success: !1 };
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
55
|
deleteTransactionRule = async () => {
|
|
56
56
|
if (this.selectedRule)
|
|
57
57
|
try {
|
|
58
58
|
await this.transactionApi.removeTransactionRule(this.selectedRule?.guid), this.setAlert(this.copy.delete_rule_success, "success"), await this.loadTransactionRules();
|
|
59
|
-
} catch (
|
|
60
|
-
console.error("Error deleting transaction rule:",
|
|
59
|
+
} catch (e) {
|
|
60
|
+
console.error("Error deleting transaction rule:", e), this.globalStore.captureException(e, { store: "SettingsStore" }), this.setAlert(this.copy.delete_rule_error, "error");
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
63
|
generateDeviceToken = async () => {
|
|
64
64
|
try {
|
|
65
65
|
return await this.api.generateDeviceToken();
|
|
66
|
-
} catch (
|
|
67
|
-
console.error("Error generating device token:",
|
|
66
|
+
} catch (e) {
|
|
67
|
+
console.error("Error generating device token:", e), this.globalStore.captureException(e, { store: "SettingsStore" });
|
|
68
68
|
}
|
|
69
69
|
};
|
|
70
70
|
loadDevices = async () => {
|
|
71
71
|
try {
|
|
72
|
-
const
|
|
72
|
+
const e = await this.api.getDevices();
|
|
73
73
|
r(() => {
|
|
74
|
-
this.devices =
|
|
74
|
+
this.devices = e;
|
|
75
75
|
});
|
|
76
|
-
} catch (
|
|
77
|
-
console.error("Error loading devices:",
|
|
76
|
+
} catch (e) {
|
|
77
|
+
console.error("Error loading devices:", e), this.globalStore.captureException(e, { store: "SettingsStore" });
|
|
78
78
|
}
|
|
79
79
|
};
|
|
80
80
|
loadNotificationProfiles = async () => {
|
|
81
81
|
try {
|
|
82
|
-
const
|
|
82
|
+
const e = await this.api.getNotificationProfiles();
|
|
83
83
|
r(() => {
|
|
84
|
-
this.notificationProfiles =
|
|
84
|
+
this.notificationProfiles = e;
|
|
85
85
|
});
|
|
86
|
-
} catch (
|
|
87
|
-
console.error("Error loading notification profiles:",
|
|
86
|
+
} catch (e) {
|
|
87
|
+
console.error("Error loading notification profiles:", e), this.globalStore.captureException(e, { store: "SettingsStore" });
|
|
88
88
|
}
|
|
89
89
|
};
|
|
90
90
|
loadTransactionRules = async () => {
|
|
91
91
|
try {
|
|
92
|
-
const
|
|
92
|
+
const e = await this.transactionApi.getTransactionRules();
|
|
93
93
|
r(() => {
|
|
94
|
-
this.transactionRules =
|
|
94
|
+
this.transactionRules = e;
|
|
95
95
|
});
|
|
96
|
-
} catch (
|
|
97
|
-
console.error("Error loading transaction rules:",
|
|
96
|
+
} catch (e) {
|
|
97
|
+
console.error("Error loading transaction rules:", e), this.globalStore.captureException(e, { store: "SettingsStore" });
|
|
98
98
|
}
|
|
99
99
|
};
|
|
100
100
|
sendEmailVerification = async () => {
|
|
101
101
|
try {
|
|
102
102
|
await this.api.sendEmailVerification(), this.setAlert(this.copy.verification_sent_success, "success");
|
|
103
|
-
} catch (
|
|
104
|
-
console.error("Error sending email verification:",
|
|
103
|
+
} catch (e) {
|
|
104
|
+
console.error("Error sending email verification:", e), this.globalStore.captureException(e, { store: "SettingsStore" }), this.setAlert(this.copy.verification_sent_error, "error");
|
|
105
105
|
}
|
|
106
106
|
};
|
|
107
107
|
sendPhoneVerification = async () => {
|
|
108
108
|
try {
|
|
109
109
|
await this.api.sendPhoneVerification(), this.setAlert(this.copy.verification_sent_success, "success");
|
|
110
|
-
} catch (
|
|
111
|
-
console.error("Error sending phone verification:",
|
|
110
|
+
} catch (e) {
|
|
111
|
+
console.error("Error sending phone verification:", e), this.globalStore.captureException(e, { store: "SettingsStore" }), this.setAlert(this.copy.verification_sent_error, "error");
|
|
112
112
|
}
|
|
113
113
|
};
|
|
114
|
-
setAlert = (
|
|
115
|
-
message:
|
|
116
|
-
severity:
|
|
117
|
-
};
|
|
118
|
-
setSelectedRule = (t) => {
|
|
119
|
-
this.selectedRule = t;
|
|
114
|
+
setAlert = (e, t = void 0) => this.alert = {
|
|
115
|
+
message: e,
|
|
116
|
+
severity: t
|
|
120
117
|
};
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
await this.api.updatePassword(t), this.setAlert(this.copy.password_updated_success, "success");
|
|
124
|
-
} catch (e) {
|
|
125
|
-
console.error("Error updating password:", e), this.globalStore.captureException(e, { store: "SettingsStore" }), this.setAlert(this.copy.password_updated_error, "error");
|
|
126
|
-
}
|
|
118
|
+
setSelectedRule = (e) => {
|
|
119
|
+
this.selectedRule = e;
|
|
127
120
|
};
|
|
128
|
-
updateDevice = async (
|
|
121
|
+
updateDevice = async (e) => {
|
|
129
122
|
try {
|
|
130
|
-
const
|
|
123
|
+
const t = await this.api.updateDevice(e), i = this.devices.findIndex((s) => s.guid === e.guid);
|
|
131
124
|
return i >= 0 && r(() => {
|
|
132
|
-
this.devices[i] =
|
|
125
|
+
this.devices[i] = t;
|
|
133
126
|
}), { success: !0 };
|
|
134
|
-
} catch (
|
|
135
|
-
return console.error("Error updating device:",
|
|
127
|
+
} catch (t) {
|
|
128
|
+
return console.error("Error updating device:", t), this.globalStore.captureException(t, { store: "SettingsStore" }), { success: !1 };
|
|
136
129
|
}
|
|
137
130
|
};
|
|
138
|
-
updateNotificationProfile = async (
|
|
131
|
+
updateNotificationProfile = async (e) => {
|
|
139
132
|
try {
|
|
140
|
-
const
|
|
133
|
+
const t = await this.api.updateNotificationProfile(e), i = this.notificationProfiles.findIndex((s) => s.guid === e.guid);
|
|
141
134
|
i >= 0 && r(() => {
|
|
142
|
-
this.notificationProfiles[i] =
|
|
135
|
+
this.notificationProfiles[i] = t;
|
|
143
136
|
});
|
|
144
|
-
} catch (
|
|
145
|
-
console.error("Error updating notification profile:",
|
|
137
|
+
} catch (t) {
|
|
138
|
+
console.error("Error updating notification profile:", t), this.globalStore.captureException(t, { store: "SettingsStore" });
|
|
146
139
|
}
|
|
147
140
|
};
|
|
148
|
-
updateRuleCategory = async (
|
|
141
|
+
updateRuleCategory = async (e) => {
|
|
149
142
|
try {
|
|
150
|
-
await this.transactionApi.updateTransactionRule(
|
|
151
|
-
} catch (
|
|
152
|
-
console.error("Error updating rule category:",
|
|
143
|
+
await this.transactionApi.updateTransactionRule(e), await this.loadTransactionRules();
|
|
144
|
+
} catch (t) {
|
|
145
|
+
console.error("Error updating rule category:", t), this.globalStore.captureException(t, { store: "SettingsStore" });
|
|
153
146
|
}
|
|
154
147
|
};
|
|
155
|
-
updateRulePayee = async (
|
|
148
|
+
updateRulePayee = async (e) => {
|
|
156
149
|
try {
|
|
157
|
-
await this.transactionApi.updateTransactionRule(
|
|
158
|
-
} catch (
|
|
159
|
-
console.error("Error updating rule payee:",
|
|
150
|
+
await this.transactionApi.updateTransactionRule(e), this.setAlert(this.copy.edit_payee_success, "success"), await this.loadTransactionRules();
|
|
151
|
+
} catch (t) {
|
|
152
|
+
console.error("Error updating rule payee:", t), this.globalStore.captureException(t, { store: "SettingsStore" }), this.setAlert(this.copy.edit_payee_error, "error");
|
|
160
153
|
}
|
|
161
154
|
};
|
|
162
|
-
updateUser = async (
|
|
155
|
+
updateUser = async (e) => {
|
|
163
156
|
try {
|
|
164
|
-
await this.globalStore.userStore.updateUser(
|
|
157
|
+
await this.globalStore.userStore.updateUser(e), this.setAlert(this.copy.information_updated_success, "success");
|
|
165
158
|
} catch {
|
|
166
159
|
this.setAlert(this.copy.information_updated_error, "error");
|
|
167
160
|
}
|
|
168
161
|
};
|
|
169
|
-
updateUserCommunicationProfile = async (
|
|
162
|
+
updateUserCommunicationProfile = async (e) => {
|
|
170
163
|
try {
|
|
171
|
-
const
|
|
172
|
-
this.globalStore.appDataStore.setUserCommunicationProfile(
|
|
173
|
-
} catch (
|
|
174
|
-
console.error("Error occurred while updating user communication profile:",
|
|
164
|
+
const t = await this.api.updateUserCommunicationProfile(e);
|
|
165
|
+
this.globalStore.appDataStore.setUserCommunicationProfile(t);
|
|
166
|
+
} catch (t) {
|
|
167
|
+
console.error("Error occurred while updating user communication profile:", t), this.globalStore.captureException(t, { store: "SettingsStore" });
|
|
175
168
|
}
|
|
176
169
|
};
|
|
177
|
-
verifyPhoneToken = async (
|
|
170
|
+
verifyPhoneToken = async (e) => {
|
|
178
171
|
try {
|
|
179
|
-
const { verified:
|
|
180
|
-
if (!
|
|
172
|
+
const { verified: t } = await this.api.verifyPhoneToken(e);
|
|
173
|
+
if (!t) throw new Error();
|
|
181
174
|
this.setAlert(this.copy.verified_phone_success, "success");
|
|
182
|
-
} catch (
|
|
183
|
-
console.error("Error verifying phone token:",
|
|
175
|
+
} catch (t) {
|
|
176
|
+
console.error("Error verifying phone token:", t), this.globalStore.captureException(t, { store: "SettingsStore" }), this.setAlert(this.copy.verified_phone_error, "error");
|
|
184
177
|
}
|
|
185
178
|
};
|
|
186
179
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsStore.es.js","names":[],"sources":["../../../src/core/stores/SettingsStore.ts"],"sourcesContent":["import { makeAutoObservable, runInAction } from 'mobx'\n\nimport { AlertProps } from '@mui/material'\n\nimport {\n AccountNotificationTypes,\n BudgetNotificationTypes,\n InsightNotificationTypes,\n} from '../types'\n\nimport type {\n DetailedNotificationProfile,\n Device,\n NotificationProfile,\n SettingsCopy,\n TransactionRule,\n User,\n UserCommunicationProfile,\n} from '../types'\n\nimport { SettingsApi, TransactionApi } from '../api'\nimport { augmentNotificationProfiles } from '../utils/SettingsUtil'\n\nimport { GlobalStore } from './GlobalStore'\n\ninterface SettingsAlertProps {\n message: string\n severity: AlertProps['severity']\n}\n\nexport class SettingsStore {\n globalStore: GlobalStore\n api: SettingsApi = new SettingsApi('/', '')\n transactionApi: TransactionApi = new TransactionApi('/', '')\n\n alert: SettingsAlertProps = { message: '', severity: undefined }\n devices: Device[] = []\n notificationProfiles: NotificationProfile[] = []\n selectedRule: TransactionRule | undefined = undefined\n transactionRules: TransactionRule[] = []\n\n constructor(globalStore: GlobalStore) {\n this.globalStore = globalStore\n this.api = new SettingsApi(globalStore.endpoint, globalStore.sessionToken, globalStore.onError)\n this.transactionApi = new TransactionApi(\n globalStore.endpoint,\n globalStore.sessionToken,\n globalStore.onError,\n )\n\n makeAutoObservable(this)\n }\n\n get accountProfiles() {\n const ccp = this.globalStore.appDataStore.clientCommunicationProfile\n\n // TODO: There has to be a better way to do this, but for now, it works\n return this.detailedNotificationProfiles.filter(\n (np) =>\n (np.notification_type === AccountNotificationTypes.DebtPaymentReminder &&\n ccp.debt_payment_reminder_notifications_enabled) ||\n (np.notification_type === AccountNotificationTypes.AccountBalanceLow &&\n ccp.low_balance_notifications_enabled) ||\n (np.notification_type === AccountNotificationTypes.AccountDepositLarge &&\n ccp.large_deposit_notifications_enabled) ||\n (np.notification_type === AccountNotificationTypes.TransactionExpenseLarge &&\n ccp.large_expense_notifications_enabled) ||\n (np.notification_type === AccountNotificationTypes.TransactionFeeCharge &&\n ccp.transaction_fee_notifications_enabled) ||\n (np.notification_type === AccountNotificationTypes.InternationalTransaction &&\n ccp.transaction_is_international_notifications_enabled) ||\n (np.notification_type === AccountNotificationTypes.AccountDepositLargePosted &&\n ccp.large_deposit_posted_notifications_enabled),\n )\n }\n\n get budgetProfiles() {\n const ccp = this.globalStore.appDataStore.clientCommunicationProfile\n\n // TODO: There has to be a better way to do this, but for now, it works\n return this.detailedNotificationProfiles.filter(\n (np) =>\n (np.notification_type === BudgetNotificationTypes.BudgetExceeded &&\n ccp.budget_exceeded_notifications_enabled) ||\n (np.notification_type === BudgetNotificationTypes.BudgetOffTarget &&\n ccp.budget_off_target_notifications_enabled),\n )\n }\n\n get insightsProfiles() {\n return this.detailedNotificationProfiles.filter((np) =>\n Object.values(InsightNotificationTypes).includes(np.notification_type),\n )\n }\n\n get clientCommunicationProfile() {\n return this.globalStore.appDataStore.clientCommunicationProfile\n }\n\n get copy(): SettingsCopy {\n return this.globalStore.copyStore.copy.settings\n }\n\n get detailedNotificationProfiles(): DetailedNotificationProfile[] {\n // Don't attempt to augment profile if global store is not initialized\n if (!this.globalStore.isInitialized) return []\n\n return augmentNotificationProfiles(\n this.globalStore.accountStore.accounts,\n this.clientCommunicationProfile,\n this.copy,\n this.notificationProfiles,\n this.userCommunicationsProfile,\n this.globalStore.userStore.user,\n )\n }\n\n get userCommunicationsProfile() {\n return this.globalStore.appDataStore.userCommunicationProfile\n }\n\n deleteDevice = async (guid: string) => {\n try {\n await this.api.deleteDevice(guid)\n\n const index = this.devices.findIndex((d) => d.guid === guid)\n if (index >= 0) {\n runInAction(() => {\n this.devices.splice(index, 1)\n })\n }\n\n return { success: true }\n } catch (error) {\n console.error('Error deleting device:', error)\n this.globalStore.captureException(error, { store: 'SettingsStore' })\n return { success: false }\n }\n }\n\n deleteTransactionRule = async () => {\n if (!this.selectedRule) {\n return\n }\n try {\n await this.transactionApi.removeTransactionRule(this.selectedRule?.guid)\n this.setAlert(this.copy.delete_rule_success, 'success')\n await this.loadTransactionRules()\n } catch (error) {\n console.error('Error deleting transaction rule:', error)\n this.globalStore.captureException(error, { store: 'SettingsStore' })\n this.setAlert(this.copy.delete_rule_error, 'error')\n }\n }\n\n generateDeviceToken = async () => {\n try {\n return await this.api.generateDeviceToken()\n } catch (error) {\n console.error('Error generating device token:', error)\n this.globalStore.captureException(error, { store: 'SettingsStore' })\n }\n return undefined\n }\n\n loadDevices = async () => {\n try {\n const devices = await this.api.getDevices()\n\n runInAction(() => {\n this.devices = devices\n })\n } catch (error) {\n console.error('Error loading devices:', error)\n this.globalStore.captureException(error, { store: 'SettingsStore' })\n }\n }\n\n loadNotificationProfiles = async () => {\n try {\n const profiles = await this.api.getNotificationProfiles()\n\n runInAction(() => {\n this.notificationProfiles = profiles\n })\n } catch (error) {\n console.error('Error loading notification profiles:', error)\n this.globalStore.captureException(error, { store: 'SettingsStore' })\n }\n }\n\n loadTransactionRules = async () => {\n try {\n const rules = await this.transactionApi.getTransactionRules()\n\n runInAction(() => {\n this.transactionRules = rules\n })\n } catch (error) {\n console.error('Error loading transaction rules:', error)\n this.globalStore.captureException(error, { store: 'SettingsStore' })\n }\n }\n\n sendEmailVerification = async () => {\n try {\n await this.api.sendEmailVerification()\n this.setAlert(this.copy.verification_sent_success, 'success')\n } catch (error) {\n console.error('Error sending email verification:', error)\n this.globalStore.captureException(error, { store: 'SettingsStore' })\n this.setAlert(this.copy.verification_sent_error, 'error')\n }\n }\n\n sendPhoneVerification = async () => {\n try {\n await this.api.sendPhoneVerification()\n this.setAlert(this.copy.verification_sent_success, 'success')\n } catch (error) {\n console.error('Error sending phone verification:', error)\n this.globalStore.captureException(error, { store: 'SettingsStore' })\n this.setAlert(this.copy.verification_sent_error, 'error')\n }\n }\n\n setAlert = (message: string, severity: SettingsAlertProps['severity'] = undefined) =>\n (this.alert = { message, severity })\n\n setSelectedRule = (rule?: TransactionRule) => {\n this.selectedRule = rule\n }\n\n updatePassword = async (params: { new_password: string; new_password_again: string }) => {\n try {\n await this.api.updatePassword(params)\n this.setAlert(this.copy.password_updated_success, 'success')\n } catch (error) {\n console.error('Error updating password:', error)\n this.globalStore.captureException(error, { store: 'SettingsStore' })\n this.setAlert(this.copy.password_updated_error, 'error')\n }\n }\n\n updateDevice = async (device: Device) => {\n try {\n const updatedDevice = await this.api.updateDevice(device)\n\n const index = this.devices.findIndex((d) => d.guid === device.guid)\n if (index >= 0) {\n runInAction(() => {\n this.devices[index] = updatedDevice\n })\n }\n return { success: true }\n } catch (error) {\n console.error('Error updating device:', error)\n this.globalStore.captureException(error, { store: 'SettingsStore' })\n return { success: false }\n }\n }\n\n updateNotificationProfile = async (profile: NotificationProfile) => {\n try {\n const updatedProfile = await this.api.updateNotificationProfile(profile)\n\n const index = this.notificationProfiles.findIndex((p) => p.guid === profile.guid)\n if (index >= 0) {\n runInAction(() => {\n this.notificationProfiles[index] = updatedProfile\n })\n }\n } catch (error) {\n console.error('Error updating notification profile:', error)\n this.globalStore.captureException(error, { store: 'SettingsStore' })\n }\n }\n\n updateRuleCategory = async (rule: TransactionRule) => {\n try {\n await this.transactionApi.updateTransactionRule(rule)\n await this.loadTransactionRules()\n } catch (error) {\n console.error('Error updating rule category:', error)\n this.globalStore.captureException(error, { store: 'SettingsStore' })\n }\n }\n\n updateRulePayee = async (rule: TransactionRule) => {\n try {\n await this.transactionApi.updateTransactionRule(rule)\n this.setAlert(this.copy.edit_payee_success, 'success')\n await this.loadTransactionRules()\n } catch (error) {\n console.error('Error updating rule payee:', error)\n this.globalStore.captureException(error, { store: 'SettingsStore' })\n this.setAlert(this.copy.edit_payee_error, 'error')\n }\n }\n\n updateUser = async (user: User) => {\n try {\n await this.globalStore.userStore.updateUser(user)\n this.setAlert(this.copy.information_updated_success, 'success')\n } catch {\n // Error is already logged and captured in UserStore.updateUser\n this.setAlert(this.copy.information_updated_error, 'error')\n }\n }\n\n updateUserCommunicationProfile = async (profile: UserCommunicationProfile) => {\n try {\n const updatedProfile = await this.api.updateUserCommunicationProfile(profile)\n\n this.globalStore.appDataStore.setUserCommunicationProfile(updatedProfile)\n } catch (error) {\n console.error('Error occurred while updating user communication profile:', error)\n this.globalStore.captureException(error, { store: 'SettingsStore' })\n }\n }\n\n verifyPhoneToken = async (sms_verification_token: string) => {\n try {\n const { verified } = await this.api.verifyPhoneToken(sms_verification_token)\n if (!verified) {\n throw new Error()\n }\n this.setAlert(this.copy.verified_phone_success, 'success')\n } catch (error) {\n console.error('Error verifying phone token:', error)\n this.globalStore.captureException(error, { store: 'SettingsStore' })\n this.setAlert(this.copy.verified_phone_error, 'error')\n }\n }\n}\n"],"mappings":";;;;;AA8BA,IAAa,IAAb,MAA2B;AAAA,EACzB;AAAA,EACA,MAAmB,IAAI,EAAY,KAAK,EAAE;AAAA,EAC1C,iBAAiC,IAAI,EAAe,KAAK,EAAE;AAAA,EAE3D,QAA4B;AAAA,IAAE,SAAS;AAAA,IAAI,UAAU;AAAA,EAAU;AAAA,EAC/D,UAAoB,CAAC;AAAA,EACrB,uBAA8C,CAAC;AAAA,EAC/C,eAA4C;AAAA,EAC5C,mBAAsC,CAAC;AAAA,EAEvC,YAAY,GAA0B;AACpC,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AA,EACF;AAAA,EAEA,mBAAmB,OAAO,MAAmC;AAC3D,QAAI;AACF,YAAM,EAAE,UAAA,EAAA,IAAa,MAAM,KAAK,IAAI,iBAAiB,CAAsB;AAC3E,UAAI,CAAC,EACH,OAAM,IAAI,MAAM;AAElB,WAAK,SAAS,KAAK,KAAK,wBAAwB,SAAS;AAAA,IAC3D,SAAS,GAAO;AACd,cAAQ,MAAM,gCAAgC,CAAK,GACnD,KAAK,YAAY,iBAAiB,GAAO,EAAE,OAAO,gBAAgB,CAAC,GACnE,KAAK,SAAS,KAAK,KAAK,sBAAsB,OAAO;AAAA,IACvD;AAAA,EACF;AACF"}
|
|
1
|
+
{"version":3,"file":"SettingsStore.es.js","names":[],"sources":["../../../src/core/stores/SettingsStore.ts"],"sourcesContent":["import { makeAutoObservable, runInAction } from 'mobx'\n\nimport { AlertProps } from '@mui/material'\n\nimport {\n AccountNotificationTypes,\n BudgetNotificationTypes,\n InsightNotificationTypes,\n} from '../types'\n\nimport type {\n DetailedNotificationProfile,\n Device,\n NotificationProfile,\n SettingsCopy,\n TransactionRule,\n User,\n UserCommunicationProfile,\n} from '../types'\n\nimport { SettingsApi, TransactionApi } from '../api'\nimport { augmentNotificationProfiles } from '../utils/SettingsUtil'\n\nimport { GlobalStore } from './GlobalStore'\n\ninterface SettingsAlertProps {\n message: string\n severity: AlertProps['severity']\n}\n\nexport class SettingsStore {\n globalStore: GlobalStore\n api: SettingsApi = new SettingsApi('/', '')\n transactionApi: TransactionApi = new TransactionApi('/', '')\n\n alert: SettingsAlertProps = { message: '', severity: undefined }\n devices: Device[] = []\n notificationProfiles: NotificationProfile[] = []\n selectedRule: TransactionRule | undefined = undefined\n transactionRules: TransactionRule[] = []\n\n constructor(globalStore: GlobalStore) {\n this.globalStore = globalStore\n this.api = new SettingsApi(globalStore.endpoint, globalStore.sessionToken, globalStore.onError)\n this.transactionApi = new TransactionApi(\n globalStore.endpoint,\n globalStore.sessionToken,\n globalStore.onError,\n )\n\n makeAutoObservable(this)\n }\n\n get accountProfiles() {\n const ccp = this.globalStore.appDataStore.clientCommunicationProfile\n\n // TODO: There has to be a better way to do this, but for now, it works\n return this.detailedNotificationProfiles.filter(\n (np) =>\n (np.notification_type === AccountNotificationTypes.DebtPaymentReminder &&\n ccp.debt_payment_reminder_notifications_enabled) ||\n (np.notification_type === AccountNotificationTypes.AccountBalanceLow &&\n ccp.low_balance_notifications_enabled) ||\n (np.notification_type === AccountNotificationTypes.AccountDepositLarge &&\n ccp.large_deposit_notifications_enabled) ||\n (np.notification_type === AccountNotificationTypes.TransactionExpenseLarge &&\n ccp.large_expense_notifications_enabled) ||\n (np.notification_type === AccountNotificationTypes.TransactionFeeCharge &&\n ccp.transaction_fee_notifications_enabled) ||\n (np.notification_type === AccountNotificationTypes.InternationalTransaction &&\n ccp.transaction_is_international_notifications_enabled) ||\n (np.notification_type === AccountNotificationTypes.AccountDepositLargePosted &&\n ccp.large_deposit_posted_notifications_enabled),\n )\n }\n\n get budgetProfiles() {\n const ccp = this.globalStore.appDataStore.clientCommunicationProfile\n\n // TODO: There has to be a better way to do this, but for now, it works\n return this.detailedNotificationProfiles.filter(\n (np) =>\n (np.notification_type === BudgetNotificationTypes.BudgetExceeded &&\n ccp.budget_exceeded_notifications_enabled) ||\n (np.notification_type === BudgetNotificationTypes.BudgetOffTarget &&\n ccp.budget_off_target_notifications_enabled),\n )\n }\n\n get insightsProfiles() {\n return this.detailedNotificationProfiles.filter((np) =>\n Object.values(InsightNotificationTypes).includes(np.notification_type),\n )\n }\n\n get clientCommunicationProfile() {\n return this.globalStore.appDataStore.clientCommunicationProfile\n }\n\n get copy(): SettingsCopy {\n return this.globalStore.copyStore.copy.settings\n }\n\n get detailedNotificationProfiles(): DetailedNotificationProfile[] {\n // Don't attempt to augment profile if global store is not initialized\n if (!this.globalStore.isInitialized) return []\n\n return augmentNotificationProfiles(\n this.globalStore.accountStore.accounts,\n this.clientCommunicationProfile,\n this.copy,\n this.notificationProfiles,\n this.userCommunicationsProfile,\n this.globalStore.userStore.user,\n )\n }\n\n get userCommunicationsProfile() {\n return this.globalStore.appDataStore.userCommunicationProfile\n }\n\n deleteDevice = async (guid: string) => {\n try {\n await this.api.deleteDevice(guid)\n\n const index = this.devices.findIndex((d) => d.guid === guid)\n if (index >= 0) {\n runInAction(() => {\n this.devices.splice(index, 1)\n })\n }\n\n return { success: true }\n } catch (error) {\n console.error('Error deleting device:', error)\n this.globalStore.captureException(error, { store: 'SettingsStore' })\n return { success: false }\n }\n }\n\n deleteTransactionRule = async () => {\n if (!this.selectedRule) {\n return\n }\n try {\n await this.transactionApi.removeTransactionRule(this.selectedRule?.guid)\n this.setAlert(this.copy.delete_rule_success, 'success')\n await this.loadTransactionRules()\n } catch (error) {\n console.error('Error deleting transaction rule:', error)\n this.globalStore.captureException(error, { store: 'SettingsStore' })\n this.setAlert(this.copy.delete_rule_error, 'error')\n }\n }\n\n generateDeviceToken = async () => {\n try {\n return await this.api.generateDeviceToken()\n } catch (error) {\n console.error('Error generating device token:', error)\n this.globalStore.captureException(error, { store: 'SettingsStore' })\n }\n return undefined\n }\n\n loadDevices = async () => {\n try {\n const devices = await this.api.getDevices()\n\n runInAction(() => {\n this.devices = devices\n })\n } catch (error) {\n console.error('Error loading devices:', error)\n this.globalStore.captureException(error, { store: 'SettingsStore' })\n }\n }\n\n loadNotificationProfiles = async () => {\n try {\n const profiles = await this.api.getNotificationProfiles()\n\n runInAction(() => {\n this.notificationProfiles = profiles\n })\n } catch (error) {\n console.error('Error loading notification profiles:', error)\n this.globalStore.captureException(error, { store: 'SettingsStore' })\n }\n }\n\n loadTransactionRules = async () => {\n try {\n const rules = await this.transactionApi.getTransactionRules()\n\n runInAction(() => {\n this.transactionRules = rules\n })\n } catch (error) {\n console.error('Error loading transaction rules:', error)\n this.globalStore.captureException(error, { store: 'SettingsStore' })\n }\n }\n\n sendEmailVerification = async () => {\n try {\n await this.api.sendEmailVerification()\n this.setAlert(this.copy.verification_sent_success, 'success')\n } catch (error) {\n console.error('Error sending email verification:', error)\n this.globalStore.captureException(error, { store: 'SettingsStore' })\n this.setAlert(this.copy.verification_sent_error, 'error')\n }\n }\n\n sendPhoneVerification = async () => {\n try {\n await this.api.sendPhoneVerification()\n this.setAlert(this.copy.verification_sent_success, 'success')\n } catch (error) {\n console.error('Error sending phone verification:', error)\n this.globalStore.captureException(error, { store: 'SettingsStore' })\n this.setAlert(this.copy.verification_sent_error, 'error')\n }\n }\n\n setAlert = (message: string, severity: SettingsAlertProps['severity'] = undefined) =>\n (this.alert = { message, severity })\n\n setSelectedRule = (rule?: TransactionRule) => {\n this.selectedRule = rule\n }\n\n updateDevice = async (device: Device) => {\n try {\n const updatedDevice = await this.api.updateDevice(device)\n\n const index = this.devices.findIndex((d) => d.guid === device.guid)\n if (index >= 0) {\n runInAction(() => {\n this.devices[index] = updatedDevice\n })\n }\n return { success: true }\n } catch (error) {\n console.error('Error updating device:', error)\n this.globalStore.captureException(error, { store: 'SettingsStore' })\n return { success: false }\n }\n }\n\n updateNotificationProfile = async (profile: NotificationProfile) => {\n try {\n const updatedProfile = await this.api.updateNotificationProfile(profile)\n\n const index = this.notificationProfiles.findIndex((p) => p.guid === profile.guid)\n if (index >= 0) {\n runInAction(() => {\n this.notificationProfiles[index] = updatedProfile\n })\n }\n } catch (error) {\n console.error('Error updating notification profile:', error)\n this.globalStore.captureException(error, { store: 'SettingsStore' })\n }\n }\n\n updateRuleCategory = async (rule: TransactionRule) => {\n try {\n await this.transactionApi.updateTransactionRule(rule)\n await this.loadTransactionRules()\n } catch (error) {\n console.error('Error updating rule category:', error)\n this.globalStore.captureException(error, { store: 'SettingsStore' })\n }\n }\n\n updateRulePayee = async (rule: TransactionRule) => {\n try {\n await this.transactionApi.updateTransactionRule(rule)\n this.setAlert(this.copy.edit_payee_success, 'success')\n await this.loadTransactionRules()\n } catch (error) {\n console.error('Error updating rule payee:', error)\n this.globalStore.captureException(error, { store: 'SettingsStore' })\n this.setAlert(this.copy.edit_payee_error, 'error')\n }\n }\n\n updateUser = async (user: User) => {\n try {\n await this.globalStore.userStore.updateUser(user)\n this.setAlert(this.copy.information_updated_success, 'success')\n } catch {\n // Error is already logged and captured in UserStore.updateUser\n this.setAlert(this.copy.information_updated_error, 'error')\n }\n }\n\n updateUserCommunicationProfile = async (profile: UserCommunicationProfile) => {\n try {\n const updatedProfile = await this.api.updateUserCommunicationProfile(profile)\n\n this.globalStore.appDataStore.setUserCommunicationProfile(updatedProfile)\n } catch (error) {\n console.error('Error occurred while updating user communication profile:', error)\n this.globalStore.captureException(error, { store: 'SettingsStore' })\n }\n }\n\n verifyPhoneToken = async (sms_verification_token: string) => {\n try {\n const { verified } = await this.api.verifyPhoneToken(sms_verification_token)\n if (!verified) {\n throw new Error()\n }\n this.setAlert(this.copy.verified_phone_success, 'success')\n } catch (error) {\n console.error('Error verifying phone token:', error)\n this.globalStore.captureException(error, { store: 'SettingsStore' })\n this.setAlert(this.copy.verified_phone_error, 'error')\n }\n }\n}\n"],"mappings":";;;;;AA8BA,IAAa,IAAb,MAA2B;AAAA,EACzB;AAAA,EACA,MAAmB,IAAI,EAAY,KAAK,EAAE;AAAA,EAC1C,iBAAiC,IAAI,EAAe,KAAK,EAAE;AAAA,EAE3D,QAA4B;AAAA,IAAE,SAAS;AAAA,IAAI,UAAU;AAAA,EAAU;AAAA,EAC/D,UAAoB,CAAC;AAAA,EACrB,uBAA8C,CAAC;AAAA,EAC/C,eAA4C;AAAA,EAC5C,mBAAsC,CAAC;AAAA,EAEvC,YAAY,GAA0B;AACpC,SAAK,cAAc,GACnB,KAAK,MAAM,IAAI,EAAY,EAAY,UAAU,EAAY,cAAc,EAAY,OAAO,GAC9F,KAAK,iBAAiB,IAAI,EACxB,EAAY,UACZ,EAAY,cACZ,EAAY,OACd,GAEA,EAAmB,IAAI;AAAA,EACzB;AAAA,EAEA,IAAI,kBAAkB;AACpB,UAAM,IAAM,KAAK,YAAY,aAAa;AAG1C,WAAO,KAAK,6BAA6B,OAAA,CACtC,MACE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cAAQ,MAAM,8BAA8B,CAAK,GACjD,KAAK,YAAY,iBAAiB,GAAO,EAAE,OAAO,gBAAgB,CAAC,GACnE,KAAK,SAAS,KAAK,KAAK,kBAAkB,OAAO;AAAA,IACnD;AAAA,EACF;AAAA,EAEA,aAAa,OAAO,MAAe;AACjC,QAAI;AACF,YAAM,KAAK,YAAY,UAAU,WAAW,CAAI,GAChD,KAAK,SAAS,KAAK,KAAK,6BAA6B,SAAS;AAAA,IAChE,QAAQ;AAEN,WAAK,SAAS,KAAK,KAAK,2BAA2B,OAAO;AAAA,IAC5D;AAAA,EACF;AAAA,EAEA,iCAAiC,OAAO,MAAsC;AAC5E,QAAI;AACF,YAAM,IAAiB,MAAM,KAAK,IAAI,+BAA+B,CAAO;AAE5E,WAAK,YAAY,aAAa,4BAA4B,CAAc;AAAA,IAC1E,SAAS,GAAO;AACd,cAAQ,MAAM,6DAA6D,CAAK,GAChF,KAAK,YAAY,iBAAiB,GAAO,EAAE,OAAO,gBAAgB,CAAC;AAAA,IACrE;AAAA,EACF;AAAA,EAEA,mBAAmB,OAAO,MAAmC;AAC3D,QAAI;AACF,YAAM,EAAE,UAAA,EAAA,IAAa,MAAM,KAAK,IAAI,iBAAiB,CAAsB;AAC3E,UAAI,CAAC,EACH,OAAM,IAAI,MAAM;AAElB,WAAK,SAAS,KAAK,KAAK,wBAAwB,SAAS;AAAA,IAC3D,SAAS,GAAO;AACd,cAAQ,MAAM,gCAAgC,CAAK,GACnD,KAAK,YAAY,iBAAiB,GAAO,EAAE,OAAO,gBAAgB,CAAC,GACnE,KAAK,SAAS,KAAK,KAAK,sBAAsB,OAAO;AAAA,IACvD;AAAA,EACF;AACF"}
|
|
@@ -6,7 +6,6 @@ export interface SettingsCopy {
|
|
|
6
6
|
budgets_subtitle: string;
|
|
7
7
|
budgets_title: string;
|
|
8
8
|
category: string;
|
|
9
|
-
confirm_new_password: string;
|
|
10
9
|
confirm_email: string;
|
|
11
10
|
confirm_phone: string;
|
|
12
11
|
confirm_your_email: string;
|
|
@@ -85,13 +84,9 @@ export interface SettingsCopy {
|
|
|
85
84
|
notification_transaction_fee: string;
|
|
86
85
|
notification_transaction_is_international: string;
|
|
87
86
|
notifications_label: string;
|
|
88
|
-
password_updated_error: string;
|
|
89
|
-
password_updated_success: string;
|
|
90
87
|
payee: string;
|
|
91
88
|
personal_details: string;
|
|
92
89
|
profile_label: string;
|
|
93
|
-
reset_password: string;
|
|
94
|
-
save_password: string;
|
|
95
90
|
select_category: string;
|
|
96
91
|
send_verification: string;
|
|
97
92
|
title: string;
|
|
@@ -108,7 +103,6 @@ export interface SettingsCopy {
|
|
|
108
103
|
verify_email: string;
|
|
109
104
|
verify_phone: string;
|
|
110
105
|
zip_code: string;
|
|
111
|
-
new_password: string;
|
|
112
106
|
notification_types_title: string;
|
|
113
107
|
large_transaction: string;
|
|
114
108
|
account_balance_low: string;
|
|
@@ -8,6 +8,7 @@ export declare const getNextQuarterlyDate: (date: Date) => Date;
|
|
|
8
8
|
export declare const getNextBiQuarterlyDate: (date: Date) => Date;
|
|
9
9
|
export declare const getNextYearlyDate: (date: Date) => Date;
|
|
10
10
|
export declare const fromUnixUTC: (utcTime: number) => Date;
|
|
11
|
+
export declare const toUnixUTC: (date: Date) => number;
|
|
11
12
|
export declare const fromUnixToDayOfWeekAndDate: (date: number) => string;
|
|
12
13
|
export declare const fromUnixUTCToDayOfWeekAndDate: (date: number) => string;
|
|
13
14
|
export declare const fromTimestampToMonthYear: (timestamp?: number) => string;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { DATE_FORMATS_INTL as
|
|
1
|
+
import { DATE_FORMATS_INTL as g, formatDate as x } from "../constants/DateFormats.es.js";
|
|
2
2
|
import { addMonths as i } from "date-fns/addMonths";
|
|
3
3
|
import { endOfMonth as h } from "date-fns/endOfMonth";
|
|
4
4
|
import { isBefore as n } from "date-fns/isBefore";
|
|
5
5
|
import { startOfToday as a } from "date-fns/startOfToday";
|
|
6
|
-
import { addYears as
|
|
6
|
+
import { addYears as M } from "date-fns/addYears";
|
|
7
|
+
import { addQuarters as s } from "date-fns/addQuarters";
|
|
8
|
+
import { addWeeks as y } from "date-fns/addWeeks";
|
|
9
|
+
import { getDay as d } from "date-fns/getDay";
|
|
10
|
+
import { nextDay as v } from "date-fns/nextDay";
|
|
11
|
+
import { setDate as u } from "date-fns/setDate";
|
|
7
12
|
import { fromUnixTime as T } from "date-fns/fromUnixTime";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import { getDay as v } from "date-fns/getDay";
|
|
13
|
-
var B = (e) => {
|
|
14
|
-
const t = v(e);
|
|
15
|
-
let r = p(e, t);
|
|
16
|
-
for (; n(r, a()); ) r = d(r, 1);
|
|
13
|
+
var B = (t) => {
|
|
14
|
+
const e = d(t);
|
|
15
|
+
let r = v(t, e);
|
|
16
|
+
for (; n(r, a()); ) r = y(r, 1);
|
|
17
17
|
return r;
|
|
18
|
-
}, H = (
|
|
19
|
-
let
|
|
20
|
-
for (; n(
|
|
21
|
-
return
|
|
22
|
-
},
|
|
23
|
-
const r = a(), [o, m] = [
|
|
18
|
+
}, H = (t) => {
|
|
19
|
+
let e = t;
|
|
20
|
+
for (; n(e, a()); ) e = y(e, 2);
|
|
21
|
+
return e;
|
|
22
|
+
}, p = (t, e) => {
|
|
23
|
+
const r = a(), [o, m] = [t, e].sort((f, l) => f - l), D = (f, l) => l >= 28 ? h(f) : u(f, l);
|
|
24
24
|
return [
|
|
25
25
|
D(r, o),
|
|
26
26
|
D(r, m),
|
|
@@ -29,43 +29,44 @@ var B = (e) => {
|
|
|
29
29
|
D(i(r, 2), o),
|
|
30
30
|
D(i(r, 2), m)
|
|
31
31
|
];
|
|
32
|
-
}, Q = (
|
|
33
|
-
const r = a(), o =
|
|
32
|
+
}, Q = (t, e) => {
|
|
33
|
+
const r = a(), o = p(t, e);
|
|
34
34
|
return o.find((m) => !n(m, r)) ?? o[o.length - 1];
|
|
35
|
-
}, K = (
|
|
36
|
-
let
|
|
37
|
-
for (; n(
|
|
38
|
-
return
|
|
39
|
-
}, R = (
|
|
40
|
-
let
|
|
41
|
-
for (; n(
|
|
42
|
-
return
|
|
43
|
-
},
|
|
44
|
-
let
|
|
45
|
-
for (; n(
|
|
46
|
-
return
|
|
47
|
-
},
|
|
48
|
-
let
|
|
49
|
-
for (; n(
|
|
50
|
-
return
|
|
51
|
-
},
|
|
52
|
-
const
|
|
53
|
-
return new Date(
|
|
54
|
-
}, b = (
|
|
35
|
+
}, K = (t) => {
|
|
36
|
+
let e = u(a(), t.getDate());
|
|
37
|
+
for (; n(e, a()); ) e = i(e, 1);
|
|
38
|
+
return e;
|
|
39
|
+
}, R = (t) => {
|
|
40
|
+
let e = t;
|
|
41
|
+
for (; n(e, a()); ) e = i(e, 2);
|
|
42
|
+
return e;
|
|
43
|
+
}, S = (t) => {
|
|
44
|
+
let e = s(t, 1);
|
|
45
|
+
for (; n(e, a()); ) e = s(e, 1);
|
|
46
|
+
return e;
|
|
47
|
+
}, I = (t) => {
|
|
48
|
+
let e = t;
|
|
49
|
+
for (; n(e, a()); ) e = s(e, 2);
|
|
50
|
+
return e;
|
|
51
|
+
}, L = (t) => M(t, 1), c = (t) => {
|
|
52
|
+
const e = T(t);
|
|
53
|
+
return new Date(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate());
|
|
54
|
+
}, b = (t) => Math.floor(Date.UTC(t.getFullYear(), t.getMonth(), t.getDate(), t.getHours(), t.getMinutes(), t.getSeconds()) / 1e3), j = (t) => x(T(t), g.DAY_OF_WEEK_MONTH_DAY), q = (t) => x(c(t), g.DAY_OF_WEEK_MONTH_DAY), z = (t) => t ? x(T(t), g.MONTH_YEAR) : "";
|
|
55
55
|
export {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
z as fromTimestampToMonthYear,
|
|
57
|
+
j as fromUnixToDayOfWeekAndDate,
|
|
58
|
+
c as fromUnixUTC,
|
|
59
|
+
q as fromUnixUTCToDayOfWeekAndDate,
|
|
60
60
|
R as getNextBiMonthlyDate,
|
|
61
|
-
|
|
61
|
+
I as getNextBiQuarterlyDate,
|
|
62
62
|
H as getNextBiWeeklyDate,
|
|
63
63
|
K as getNextMonthlyDate,
|
|
64
|
-
|
|
64
|
+
S as getNextQuarterlyDate,
|
|
65
65
|
Q as getNextTwiceMonthlyDate,
|
|
66
66
|
B as getNextWeeklyDate,
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
L as getNextYearlyDate,
|
|
68
|
+
p as getTwiceMonthlyDates,
|
|
69
|
+
b as toUnixUTC
|
|
69
70
|
};
|
|
70
71
|
|
|
71
72
|
//# sourceMappingURL=DateUtil.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateUtil.es.js","names":[],"sources":["../../../src/core/utils/DateUtil.ts"],"sourcesContent":["import { addMonths } from 'date-fns/addMonths'\nimport { addQuarters } from 'date-fns/addQuarters'\nimport { addWeeks } from 'date-fns/addWeeks'\nimport { addYears } from 'date-fns/addYears'\nimport { endOfMonth } from 'date-fns/endOfMonth'\nimport { getDay } from 'date-fns/getDay'\nimport { isBefore } from 'date-fns/isBefore'\nimport { nextDay } from 'date-fns/nextDay'\nimport { setDate } from 'date-fns/setDate'\nimport { startOfToday } from 'date-fns/startOfToday'\nimport { fromUnixTime } from 'date-fns/fromUnixTime'\nimport { type Day } from 'date-fns'\n\nimport { DATE_FORMATS_INTL, formatDate } from '../constants'\n\nexport const getNextWeeklyDate = (date: Date): Date => {\n const dayOfWeek = getDay(date)\n let nextDate = nextDay(date, dayOfWeek as Day)\n while (isBefore(nextDate, startOfToday())) {\n nextDate = addWeeks(nextDate, 1)\n }\n return nextDate\n}\n\nexport const getNextBiWeeklyDate = (date: Date): Date => {\n let nextDate = date\n while (isBefore(nextDate, startOfToday())) {\n nextDate = addWeeks(nextDate, 2)\n }\n return nextDate\n}\n\nexport const getTwiceMonthlyDates = (day1: number, day2: number): Date[] => {\n const today = startOfToday()\n const [firstDay, secondDay] = [day1, day2].sort((a, b) => a - b)\n const makeDateForDay = (month: Date, day: number) =>\n day >= 28 ? endOfMonth(month) : setDate(month, day)\n\n return [\n makeDateForDay(today, firstDay),\n makeDateForDay(today, secondDay),\n makeDateForDay(addMonths(today, 1), firstDay),\n makeDateForDay(addMonths(today, 1), secondDay),\n makeDateForDay(addMonths(today, 2), firstDay),\n makeDateForDay(addMonths(today, 2), secondDay),\n ]\n}\n\nexport const getNextTwiceMonthlyDate = (day1: number, day2: number): Date => {\n const today = startOfToday()\n const candidates = getTwiceMonthlyDates(day1, day2)\n return candidates.find((c) => !isBefore(c, today)) ?? candidates[candidates.length - 1]\n}\n\nexport const getNextMonthlyDate = (date: Date): Date => {\n let nextDate = setDate(startOfToday(), date.getDate())\n while (isBefore(nextDate, startOfToday())) {\n nextDate = addMonths(nextDate, 1)\n }\n return nextDate\n}\n\nexport const getNextBiMonthlyDate = (date: Date): Date => {\n let nextDate = date\n while (isBefore(nextDate, startOfToday())) {\n nextDate = addMonths(nextDate, 2)\n }\n return nextDate\n}\n\nexport const getNextQuarterlyDate = (date: Date): Date => {\n let nextDate = addQuarters(date, 1)\n while (isBefore(nextDate, startOfToday())) {\n nextDate = addQuarters(nextDate, 1)\n }\n return nextDate\n}\n\nexport const getNextBiQuarterlyDate = (date: Date): Date => {\n let nextDate = date\n while (isBefore(nextDate, startOfToday())) {\n nextDate = addQuarters(nextDate, 2)\n }\n return nextDate\n}\n\nexport const getNextYearlyDate = (date: Date): Date => {\n return addYears(date, 1)\n}\n\nexport const fromUnixUTC = (utcTime: number) => {\n const date = fromUnixTime(utcTime)\n return new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate())\n}\n\nexport const fromUnixToDayOfWeekAndDate = (date: number) =>\n formatDate(fromUnixTime(date), DATE_FORMATS_INTL.DAY_OF_WEEK_MONTH_DAY)\n\n// UTC variant for post dates, which are absolute calendar dates that must not\n// shift across the day boundary when localized.\nexport const fromUnixUTCToDayOfWeekAndDate = (date: number) =>\n formatDate(fromUnixUTC(date), DATE_FORMATS_INTL.DAY_OF_WEEK_MONTH_DAY)\n\nexport const fromTimestampToMonthYear = (timestamp?: number) =>\n timestamp ? formatDate(fromUnixTime(timestamp), DATE_FORMATS_INTL.MONTH_YEAR) : ''\n"],"mappings":";;;;;;;;;;;;AAeA,IAAa,IAAA,CAAqB,MAAqB;AACrD,QAAM,IAAY,EAAO,CAAI;AAC7B,MAAI,IAAW,EAAQ,GAAM,CAAgB;AAC7C,SAAO,EAAS,GAAU,EAAa,CAAC,IACtC,CAAA,IAAW,EAAS,GAAU,CAAC;AAEjC,SAAO;AACT,GAEa,IAAA,CAAuB,MAAqB;AACvD,MAAI,IAAW;AACf,SAAO,EAAS,GAAU,EAAa,CAAC,IACtC,CAAA,IAAW,EAAS,GAAU,CAAC;AAEjC,SAAO;AACT,GAEa,IAAA,CAAwB,GAAc,MAAyB;AAC1E,QAAM,IAAQ,EAAa,GACrB,CAAC,GAAU,CAAA,IAAa,CAAC,GAAM,CAAI,EAAE,KAAA,CAAM,GAAG,MAAM,IAAI,CAAC,GACzD,IAAA,CAAkB,GAAa,MACnC,KAAO,KAAK,EAAW,CAAK,IAAI,EAAQ,GAAO,CAAG;AAEpD,SAAO;AAAA,IACL,EAAe,GAAO,CAAQ;AAAA,IAC9B,EAAe,GAAO,CAAS;AAAA,IAC/B,EAAe,EAAU,GAAO,CAAC,GAAG,CAAQ;AAAA,IAC5C,EAAe,EAAU,GAAO,CAAC,GAAG,CAAS;AAAA,IAC7C,EAAe,EAAU,GAAO,CAAC,GAAG,CAAQ;AAAA,IAC5C,EAAe,EAAU,GAAO,CAAC,GAAG,CAAS;AAAA,EAC/C;AACF,GAEa,IAAA,CAA2B,GAAc,MAAuB;AAC3E,QAAM,IAAQ,EAAa,GACrB,IAAa,EAAqB,GAAM,CAAI;AAClD,SAAO,EAAW,KAAA,CAAM,MAAM,CAAC,EAAS,GAAG,CAAK,CAAC,KAAK,EAAW,EAAW,SAAS,CAAA;AACvF,GAEa,IAAA,CAAsB,MAAqB;AACtD,MAAI,IAAW,EAAQ,EAAa,GAAG,EAAK,QAAQ,CAAC;AACrD,SAAO,EAAS,GAAU,EAAa,CAAC,IACtC,CAAA,IAAW,EAAU,GAAU,CAAC;AAElC,SAAO;AACT,GAEa,IAAA,CAAwB,MAAqB;AACxD,MAAI,IAAW;AACf,SAAO,EAAS,GAAU,EAAa,CAAC,IACtC,CAAA,IAAW,EAAU,GAAU,CAAC;AAElC,SAAO;AACT,GAEa,IAAA,CAAwB,MAAqB;AACxD,MAAI,IAAW,EAAY,GAAM,CAAC;AAClC,SAAO,EAAS,GAAU,EAAa,CAAC,IACtC,CAAA,IAAW,EAAY,GAAU,CAAC;AAEpC,SAAO;AACT,GAEa,IAAA,CAA0B,MAAqB;AAC1D,MAAI,IAAW;AACf,SAAO,EAAS,GAAU,EAAa,CAAC,IACtC,CAAA,IAAW,EAAY,GAAU,CAAC;AAEpC,SAAO;AACT,GAEa,IAAA,CAAqB,MACzB,EAAS,GAAM,CAAC,GAGZ,IAAA,CAAe,MAAoB;AAC9C,QAAM,IAAO,EAAa,CAAO;AACjC,SAAO,IAAI,KAAK,EAAK,eAAe,GAAG,EAAK,YAAY,GAAG,EAAK,WAAW,CAAC;AAC9E,
|
|
1
|
+
{"version":3,"file":"DateUtil.es.js","names":[],"sources":["../../../src/core/utils/DateUtil.ts"],"sourcesContent":["import { addMonths } from 'date-fns/addMonths'\nimport { addQuarters } from 'date-fns/addQuarters'\nimport { addWeeks } from 'date-fns/addWeeks'\nimport { addYears } from 'date-fns/addYears'\nimport { endOfMonth } from 'date-fns/endOfMonth'\nimport { getDay } from 'date-fns/getDay'\nimport { isBefore } from 'date-fns/isBefore'\nimport { nextDay } from 'date-fns/nextDay'\nimport { setDate } from 'date-fns/setDate'\nimport { startOfToday } from 'date-fns/startOfToday'\nimport { fromUnixTime } from 'date-fns/fromUnixTime'\nimport { type Day } from 'date-fns'\n\nimport { DATE_FORMATS_INTL, formatDate } from '../constants'\n\nexport const getNextWeeklyDate = (date: Date): Date => {\n const dayOfWeek = getDay(date)\n let nextDate = nextDay(date, dayOfWeek as Day)\n while (isBefore(nextDate, startOfToday())) {\n nextDate = addWeeks(nextDate, 1)\n }\n return nextDate\n}\n\nexport const getNextBiWeeklyDate = (date: Date): Date => {\n let nextDate = date\n while (isBefore(nextDate, startOfToday())) {\n nextDate = addWeeks(nextDate, 2)\n }\n return nextDate\n}\n\nexport const getTwiceMonthlyDates = (day1: number, day2: number): Date[] => {\n const today = startOfToday()\n const [firstDay, secondDay] = [day1, day2].sort((a, b) => a - b)\n const makeDateForDay = (month: Date, day: number) =>\n day >= 28 ? endOfMonth(month) : setDate(month, day)\n\n return [\n makeDateForDay(today, firstDay),\n makeDateForDay(today, secondDay),\n makeDateForDay(addMonths(today, 1), firstDay),\n makeDateForDay(addMonths(today, 1), secondDay),\n makeDateForDay(addMonths(today, 2), firstDay),\n makeDateForDay(addMonths(today, 2), secondDay),\n ]\n}\n\nexport const getNextTwiceMonthlyDate = (day1: number, day2: number): Date => {\n const today = startOfToday()\n const candidates = getTwiceMonthlyDates(day1, day2)\n return candidates.find((c) => !isBefore(c, today)) ?? candidates[candidates.length - 1]\n}\n\nexport const getNextMonthlyDate = (date: Date): Date => {\n let nextDate = setDate(startOfToday(), date.getDate())\n while (isBefore(nextDate, startOfToday())) {\n nextDate = addMonths(nextDate, 1)\n }\n return nextDate\n}\n\nexport const getNextBiMonthlyDate = (date: Date): Date => {\n let nextDate = date\n while (isBefore(nextDate, startOfToday())) {\n nextDate = addMonths(nextDate, 2)\n }\n return nextDate\n}\n\nexport const getNextQuarterlyDate = (date: Date): Date => {\n let nextDate = addQuarters(date, 1)\n while (isBefore(nextDate, startOfToday())) {\n nextDate = addQuarters(nextDate, 1)\n }\n return nextDate\n}\n\nexport const getNextBiQuarterlyDate = (date: Date): Date => {\n let nextDate = date\n while (isBefore(nextDate, startOfToday())) {\n nextDate = addQuarters(nextDate, 2)\n }\n return nextDate\n}\n\nexport const getNextYearlyDate = (date: Date): Date => {\n return addYears(date, 1)\n}\n\nexport const fromUnixUTC = (utcTime: number) => {\n const date = fromUnixTime(utcTime)\n return new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate())\n}\n\n// Inverse of fromUnixUTC: emits unix seconds for the Date's wall-clock time read\n// at UTC, so a local-midnight boundary serializes to UTC midnight instead of\n// being shifted by the viewer's timezone offset.\nexport const toUnixUTC = (date: Date) =>\n Math.floor(\n Date.UTC(\n date.getFullYear(),\n date.getMonth(),\n date.getDate(),\n date.getHours(),\n date.getMinutes(),\n date.getSeconds(),\n ) / 1000,\n )\n\nexport const fromUnixToDayOfWeekAndDate = (date: number) =>\n formatDate(fromUnixTime(date), DATE_FORMATS_INTL.DAY_OF_WEEK_MONTH_DAY)\n\n// UTC variant for post dates, which are absolute calendar dates that must not\n// shift across the day boundary when localized.\nexport const fromUnixUTCToDayOfWeekAndDate = (date: number) =>\n formatDate(fromUnixUTC(date), DATE_FORMATS_INTL.DAY_OF_WEEK_MONTH_DAY)\n\nexport const fromTimestampToMonthYear = (timestamp?: number) =>\n timestamp ? formatDate(fromUnixTime(timestamp), DATE_FORMATS_INTL.MONTH_YEAR) : ''\n"],"mappings":";;;;;;;;;;;;AAeA,IAAa,IAAA,CAAqB,MAAqB;AACrD,QAAM,IAAY,EAAO,CAAI;AAC7B,MAAI,IAAW,EAAQ,GAAM,CAAgB;AAC7C,SAAO,EAAS,GAAU,EAAa,CAAC,IACtC,CAAA,IAAW,EAAS,GAAU,CAAC;AAEjC,SAAO;AACT,GAEa,IAAA,CAAuB,MAAqB;AACvD,MAAI,IAAW;AACf,SAAO,EAAS,GAAU,EAAa,CAAC,IACtC,CAAA,IAAW,EAAS,GAAU,CAAC;AAEjC,SAAO;AACT,GAEa,IAAA,CAAwB,GAAc,MAAyB;AAC1E,QAAM,IAAQ,EAAa,GACrB,CAAC,GAAU,CAAA,IAAa,CAAC,GAAM,C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AS,GAAM,CAAC,GAGZ,IAAA,CAAe,MAAoB;AAC9C,QAAM,IAAO,EAAa,CAAO;AACjC,SAAO,IAAI,KAAK,EAAK,eAAe,GAAG,EAAK,YAAY,GAAG,EAAK,WAAW,CAAC;AAC9E,GAKa,IAAA,CAAa,MACxB,KAAK,MACH,KAAK,IACH,EAAK,YAAY,GACjB,EAAK,SAAS,GACd,EAAK,QAAQ,GACb,EAAK,SAAS,GACd,EAAK,WAAW,GAChB,EAAK,WAAW,CAClB,IAAI,GACN,GAEW,IAAA,CAA8B,MACzC,EAAW,EAAa,CAAI,GAAG,EAAkB,qBAAqB,GAI3D,IAAA,CAAiC,MAC5C,EAAW,EAAY,CAAI,GAAG,EAAkB,qBAAqB,GAE1D,IAAA,CAA4B,MACvC,IAAY,EAAW,EAAa,CAAS,GAAG,EAAkB,UAAU,IAAI"}
|
|
@@ -2,9 +2,9 @@ import { AccountType as C } from "../types/Account.es.js";
|
|
|
2
2
|
import { DebtPriority as b } from "../constants/Debts.es.js";
|
|
3
3
|
import { addMonths as E } from "date-fns/addMonths";
|
|
4
4
|
import { startOfMonth as x } from "date-fns/startOfMonth";
|
|
5
|
-
import { getUnixTime as w } from "date-fns/getUnixTime";
|
|
6
|
-
import { getDate as T } from "date-fns/getDate";
|
|
7
5
|
import { fromUnixTime as d } from "date-fns/fromUnixTime";
|
|
6
|
+
import { getDate as w } from "date-fns/getDate";
|
|
7
|
+
import { getUnixTime as T } from "date-fns/getUnixTime";
|
|
8
8
|
var F = { unnamed_label: "Unnamed Debt" }, G = (a, n, t = 0) => {
|
|
9
9
|
const o = a.map((s) => ({ ...s }));
|
|
10
10
|
S(o, n);
|
|
@@ -63,10 +63,10 @@ function P(a, n) {
|
|
|
63
63
|
guid: a.guid
|
|
64
64
|
};
|
|
65
65
|
if (n) {
|
|
66
|
-
const o = n.payment_due_at ?
|
|
66
|
+
const o = n.payment_due_at ? w(d(n.payment_due_at)) : 1, i = x(/* @__PURE__ */ new Date()).setDate(o);
|
|
67
67
|
t.balance = Math.abs(n.amount - n.current_amount), t.interest_rate = n.interest_rate, t.is_paid_off = n.is_complete, t.monthly_payment = n.monthly_payment, t.name = n.name, t.original_balance = n.initial_amount, t.payment_due_date = i;
|
|
68
68
|
} else {
|
|
69
|
-
const o = a.payment_due_at ?
|
|
69
|
+
const o = a.payment_due_at ? w(d(a.payment_due_at)) : 1, i = x(/* @__PURE__ */ new Date()).setDate(o), e = a.balance ?? 0, r = a.minimum_payment ?? void 0, m = a.interest_rate ?? void 0;
|
|
70
70
|
t.balance = Math.max(e, 0), t.interest_rate = m, t.is_paid_off = e === 0, t.monthly_payment = r, t.name = a?.name ?? F.unnamed_label, t.original_balance = a.original_balance, t.payment_due_date = i;
|
|
71
71
|
}
|
|
72
72
|
return t.is_impossible = !1, t.priority = void 0, t.projected_payoff_date = void 0, t;
|
|
@@ -114,14 +114,14 @@ var I = (a) => (a[a.length - 1] || {}).timestamp, S = (a, n) => {
|
|
|
114
114
|
interest: t,
|
|
115
115
|
payment: p,
|
|
116
116
|
principal: p,
|
|
117
|
-
timestamp:
|
|
117
|
+
timestamp: T(E(d(i), m + 1))
|
|
118
118
|
});
|
|
119
119
|
}
|
|
120
120
|
return e;
|
|
121
121
|
}
|
|
122
122
|
const r = t / 1200;
|
|
123
123
|
for (let m = 0; m < a; m++) {
|
|
124
|
-
const s =
|
|
124
|
+
const s = T(E(d(i), m + 1)), c = Math.pow(1 + r, m), p = n * c - o * ((c - 1) / r), _ = Math.pow(1 + r, m + 1), l = n * _ - o * ((_ - 1) / r), y = o + Math.min(l, 0), u = p * r;
|
|
125
125
|
e.push({
|
|
126
126
|
balance: Math.max(0, l),
|
|
127
127
|
interest: u,
|
|
@@ -3,8 +3,8 @@ import { DATE_FORMATS_INTL as b, formatDate as E } from "../constants/DateFormat
|
|
|
3
3
|
import { MetaType as r, TrackType as o } from "../types/Goal.es.js";
|
|
4
4
|
import { formatPercentage as u } from "./NumberFormatting.es.js";
|
|
5
5
|
import { addYears as d } from "date-fns/addYears";
|
|
6
|
-
import { getUnixTime as R } from "date-fns/getUnixTime";
|
|
7
6
|
import { fromUnixTime as m } from "date-fns/fromUnixTime";
|
|
7
|
+
import { getUnixTime as R } from "date-fns/getUnixTime";
|
|
8
8
|
function O(e, t) {
|
|
9
9
|
const i = t.track_type === o.DEBT_TRACK ? t.initial_amount : t.amount;
|
|
10
10
|
let a = t.current_amount / i;
|
|
@@ -13,16 +13,16 @@ import { addYears as A } from "date-fns/addYears";
|
|
|
13
13
|
import { subDays as Y } from "date-fns/subDays";
|
|
14
14
|
import { subYears as J } from "date-fns/subYears";
|
|
15
15
|
import { differenceInDays as V } from "date-fns/differenceInDays";
|
|
16
|
-
import { getUnixTime as f } from "date-fns/getUnixTime";
|
|
17
|
-
import { fromUnixTime as X } from "date-fns/fromUnixTime";
|
|
18
|
-
import { isAfter as l } from "date-fns/isAfter";
|
|
19
16
|
import { addQuarters as G } from "date-fns/addQuarters";
|
|
20
17
|
import { addWeeks as k } from "date-fns/addWeeks";
|
|
18
|
+
import { nextDay as M } from "date-fns/nextDay";
|
|
19
|
+
import { setDate as E } from "date-fns/setDate";
|
|
20
|
+
import { fromUnixTime as X } from "date-fns/fromUnixTime";
|
|
21
|
+
import { getUnixTime as f } from "date-fns/getUnixTime";
|
|
22
|
+
import { isAfter as l } from "date-fns/isAfter";
|
|
21
23
|
import { formatISO as Z } from "date-fns/formatISO";
|
|
22
24
|
import { lastDayOfMonth as T } from "date-fns/lastDayOfMonth";
|
|
23
|
-
import { nextDay as M } from "date-fns/nextDay";
|
|
24
25
|
import { parseISO as S } from "date-fns/parseISO";
|
|
25
|
-
import { setDate as E } from "date-fns/setDate";
|
|
26
26
|
import { setDay as ee } from "date-fns/setDay";
|
|
27
27
|
import { setDayOfYear as B } from "date-fns/setDayOfYear";
|
|
28
28
|
import { subQuarters as I } from "date-fns/subQuarters";
|
|
@@ -8,8 +8,8 @@ import { format as O } from "date-fns/format";
|
|
|
8
8
|
import { startOfMonth as S } from "date-fns/startOfMonth";
|
|
9
9
|
import { startOfToday as D } from "date-fns/startOfToday";
|
|
10
10
|
import { endOfToday as M } from "date-fns/endOfToday";
|
|
11
|
-
import { getUnixTime as _ } from "date-fns/getUnixTime";
|
|
12
11
|
import { fromUnixTime as T } from "date-fns/fromUnixTime";
|
|
12
|
+
import { getUnixTime as _ } from "date-fns/getUnixTime";
|
|
13
13
|
var K = (r, t, n, a = []) => {
|
|
14
14
|
const s = t.reduce((o, e) => ({
|
|
15
15
|
...o,
|