@zextras/carbonio-shell-ui 7.0.1-devel.1719484849096 → 7.0.1-devel.1719821805398
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/lib/boot/app/app-direct-exports.d.ts +1 -1
- package/lib/boot/app/app-direct-exports.js +4 -2
- package/lib/boot/app/app-direct-exports.js.map +1 -1
- package/lib/lib.d.ts +2 -2
- package/lib/store/account/hooks.js +1 -1
- package/lib/store/account/hooks.js.map +1 -1
- package/lib/store/account/index.d.ts +1 -0
- package/lib/store/account/index.js +1 -0
- package/lib/store/account/index.js.map +1 -1
- package/lib/store/account/updaters.d.ts +15 -0
- package/lib/store/account/updaters.js +35 -0
- package/lib/store/account/updaters.js.map +1 -0
- package/lib/store/account/utils.d.ts +6 -0
- package/lib/store/account/utils.js +63 -0
- package/lib/store/account/utils.js.map +1 -0
- package/package.json +1 -1
|
@@ -8,7 +8,7 @@ export declare const registerFunctions: (...items: {
|
|
|
8
8
|
action: (target: unknown) => import("../../lib").Action;
|
|
9
9
|
type: string;
|
|
10
10
|
}[]) => void, removeActions: (...ids: string[]) => void, removeComponents: (...ids: string[]) => void;
|
|
11
|
-
export { getUserAccount, getUserAccounts, getUserSetting, getUserSettings, useUserAccount, useUserAccounts, useUserSetting, useUserSettings, useUserRight, useUserRights, getUserRight, getUserRights, useAuthenticated } from '../../store/account';
|
|
11
|
+
export { getUserAccount, getUserAccounts, getUserSetting, getUserSettings, useUserAccount, useUserAccounts, useUserSetting, useUserSettings, useUserRight, useUserRights, getUserRight, getUserRights, useAuthenticated, updateSettings, updateAccount } from '../../store/account';
|
|
12
12
|
export { getTags, useTags } from '../../store/tags';
|
|
13
13
|
export { changeTagColor, createTag, deleteTag, renameTag } from '../../network/tags';
|
|
14
14
|
export { useNotify, useRefresh } from '../../store/network';
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
var _a, _b;
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.
|
|
10
|
-
exports.Tracker = exports.upsertApp = exports.removeSecondaryAccessoryView = exports.removePrimaryAccessoryView = exports.removeUtilityView = exports.removeSearchView = exports.removeSettingsView = exports.removeBoardView = exports.removeRoute = exports.setRouteVisibility = exports.updateUtilityBadge = exports.updatePrimaryBadge = exports.useLocalStorage = exports.useIsMobile = exports.runSearch = exports.getNotificationManager = exports.pushHistory = exports.goBackHistory = exports.replaceHistory = exports.useCurrentRoute = exports.getCurrentRoute = exports.useReplaceHistoryCallback = exports.useGoBackHistoryCallback = exports.usePushHistoryCallback = exports.useBoardHooks = exports.setCurrentBoard = exports.reopenBoards = exports.minimizeBoards = exports.useBoard = exports.useBoardById = exports.useBoardContextById = exports.getBoardContextById = exports.getBoardById = exports.updateBoardContext = exports.updateBoard = exports.closeBoard = exports.getRootByUser = exports.useRootByUser = exports.useFoldersAccordionByView = exports.useFoldersByView = void 0;
|
|
9
|
+
exports.useSearchFolders = exports.useSearchFolder = exports.getRoots = exports.useRoots = exports.getRoot = exports.useRoot = exports.useFolders = exports.useFolder = exports.getFolders = exports.getFolder = exports.useRefresh = exports.useNotify = exports.renameTag = exports.deleteTag = exports.createTag = exports.changeTagColor = exports.useTags = exports.getTags = exports.updateAccount = exports.updateSettings = exports.useAuthenticated = exports.getUserRights = exports.getUserRight = exports.useUserRights = exports.useUserRight = exports.useUserSettings = exports.useUserSetting = exports.useUserAccounts = exports.useUserAccount = exports.getUserSettings = exports.getUserSetting = exports.getUserAccounts = exports.getUserAccount = exports.removeComponents = exports.removeActions = exports.registerActions = exports.removeFunctions = exports.registerFunctions = exports.getIntegratedFunction = exports.getIntegratedComponent = exports.getActionFactory = exports.getActionsFactory = exports.getActions = exports.getAction = exports.useIntegratedFunction = exports.useIntegratedComponent = exports.useActionFactory = exports.useActionsFactory = exports.useActions = exports.useAction = void 0;
|
|
10
|
+
exports.Tracker = exports.upsertApp = exports.removeSecondaryAccessoryView = exports.removePrimaryAccessoryView = exports.removeUtilityView = exports.removeSearchView = exports.removeSettingsView = exports.removeBoardView = exports.removeRoute = exports.setRouteVisibility = exports.updateUtilityBadge = exports.updatePrimaryBadge = exports.useLocalStorage = exports.useIsMobile = exports.runSearch = exports.getNotificationManager = exports.pushHistory = exports.goBackHistory = exports.replaceHistory = exports.useCurrentRoute = exports.getCurrentRoute = exports.useReplaceHistoryCallback = exports.useGoBackHistoryCallback = exports.usePushHistoryCallback = exports.useBoardHooks = exports.setCurrentBoard = exports.reopenBoards = exports.minimizeBoards = exports.useBoard = exports.useBoardById = exports.useBoardContextById = exports.getBoardContextById = exports.getBoardById = exports.updateBoardContext = exports.updateBoard = exports.closeBoard = exports.getRootByUser = exports.useRootByUser = exports.useFoldersAccordionByView = exports.useFoldersByView = exports.getSearchFolders = exports.getSearchFolder = void 0;
|
|
11
11
|
const app_1 = require("../../store/app");
|
|
12
12
|
const store_1 = require("../../store/integrations/store");
|
|
13
13
|
var hooks_1 = require("../../store/integrations/hooks");
|
|
@@ -39,6 +39,8 @@ Object.defineProperty(exports, "useUserRights", { enumerable: true, get: functio
|
|
|
39
39
|
Object.defineProperty(exports, "getUserRight", { enumerable: true, get: function () { return account_1.getUserRight; } });
|
|
40
40
|
Object.defineProperty(exports, "getUserRights", { enumerable: true, get: function () { return account_1.getUserRights; } });
|
|
41
41
|
Object.defineProperty(exports, "useAuthenticated", { enumerable: true, get: function () { return account_1.useAuthenticated; } });
|
|
42
|
+
Object.defineProperty(exports, "updateSettings", { enumerable: true, get: function () { return account_1.updateSettings; } });
|
|
43
|
+
Object.defineProperty(exports, "updateAccount", { enumerable: true, get: function () { return account_1.updateAccount; } });
|
|
42
44
|
var tags_1 = require("../../store/tags");
|
|
43
45
|
Object.defineProperty(exports, "getTags", { enumerable: true, get: function () { return tags_1.getTags; } });
|
|
44
46
|
Object.defineProperty(exports, "useTags", { enumerable: true, get: function () { return tags_1.useTags; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-direct-exports.js","sourceRoot":"","sources":["../../../src/boot/app/app-direct-exports.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;AAEH,yCAA8C;AAC9C,0DAAsE;AAEtE,wDAOwC;AANvC,kGAAA,SAAS,OAAA;AACT,mGAAA,UAAU,OAAA;AACV,0GAAA,iBAAiB,OAAA;AACjB,yGAAA,gBAAgB,OAAA;AAChB,+GAAA,sBAAsB,OAAA;AACtB,8GAAA,qBAAqB,OAAA;AAGtB,4DAO0C;AANzC,oGAAA,SAAS,OAAA;AACT,qGAAA,UAAU,OAAA;AACV,4GAAA,iBAAiB,OAAA;AACjB,2GAAA,gBAAgB,OAAA;AAChB,iHAAA,sBAAsB,OAAA;AACtB,gHAAA,qBAAqB,OAAA;AAGT,KAMT,4BAAoB,CAAC,QAAQ,EAAE,EALlC,yBAAiB,yBACjB,uBAAe,uBACf,uBAAe,uBACf,qBAAa,qBACb,wBAAgB,uBACmB;AAEpC,+
|
|
1
|
+
{"version":3,"file":"app-direct-exports.js","sourceRoot":"","sources":["../../../src/boot/app/app-direct-exports.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;AAEH,yCAA8C;AAC9C,0DAAsE;AAEtE,wDAOwC;AANvC,kGAAA,SAAS,OAAA;AACT,mGAAA,UAAU,OAAA;AACV,0GAAA,iBAAiB,OAAA;AACjB,yGAAA,gBAAgB,OAAA;AAChB,+GAAA,sBAAsB,OAAA;AACtB,8GAAA,qBAAqB,OAAA;AAGtB,4DAO0C;AANzC,oGAAA,SAAS,OAAA;AACT,qGAAA,UAAU,OAAA;AACV,4GAAA,iBAAiB,OAAA;AACjB,2GAAA,gBAAgB,OAAA;AAChB,iHAAA,sBAAsB,OAAA;AACtB,gHAAA,qBAAqB,OAAA;AAGT,KAMT,4BAAoB,CAAC,QAAQ,EAAE,EALlC,yBAAiB,yBACjB,uBAAe,uBACf,uBAAe,uBACf,qBAAa,qBACb,wBAAgB,uBACmB;AAEpC,+CAgB6B;AAf5B,yGAAA,cAAc,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QAAQ,OAAA;AACR,wGAAA,cAAc,OAAA;AACd,sGAAA,YAAY,OAAA;AACZ,yGAAA,eAAe,OAAA;AACf,uGAAA,aAAa,OAAA;AAGd,6CAS6B;AAR5B,+GAAA,sBAAsB,OAAA;AACtB,iHAAA,wBAAwB,OAAA;AACxB,kHAAA,yBAAyB,OAAA;AACzB,wGAAA,eAAe,OAAA;AACf,wGAAA,eAAe,OAAA;AACf,uGAAA,cAAc,OAAA;AACd,sGAAA,aAAa,OAAA;AACb,oGAAA,WAAW,OAAA;AAGZ,8EAAgF;AAAvE,6HAAA,sBAAsB,OAAA;AAE/B,sDAAoD;AAA3C,uGAAA,SAAS,OAAA;AAElB,6DAA4D;AAAnD,0GAAA,WAAW,OAAA;AAEpB,qEAAoE;AAA3D,kHAAA,eAAe,OAAA;AAEX,KAuBT,iBAAW,CAAC,QAAQ,EAAE,EAtBzB,0BAAkB,0BAClB,0BAAkB,0BAClB,0BAAkB,0BAClB,mBAAW,mBACX,uBAAe,uBACf,0BAAkB,0BAClB,wBAAgB,wBAChB,yBAAiB,yBACjB,kCAA0B,kCAC1B,oCAA4B;AAC5B;;;;;;;;;;GAUG;AACH,iBAAS,gBACiB;AAE3B,sCAAqC;AAA5B,kGAAA,OAAO,OAAA"}
|
package/lib/lib.d.ts
CHANGED
|
@@ -56,8 +56,8 @@ export type { INotificationManager, NotificationConfig, AudioNotificationConfig,
|
|
|
56
56
|
export type { QueryItem, QueryChip } from './types/search';
|
|
57
57
|
export type { Folder, Folders, LinkFolder } from './types/folder';
|
|
58
58
|
export type { Grant } from './types/misc';
|
|
59
|
-
export type { SuccessSoapResponse, ErrorSoapResponse, ErrorSoapBodyResponse, SoapResponse, SoapLink, SoapFolder, SoapNotify, SoapContext, SoapBody, SoapHeader } from './types/network/soap';
|
|
60
|
-
export type { BatchRequest } from './types/network';
|
|
59
|
+
export type { SuccessSoapResponse, ErrorSoapResponse, ErrorSoapBodyResponse, SoapResponse, SoapLink, SoapFolder, SoapNotify, SoapContext, SoapBody, SoapHeader, SoapFault } from './types/network/soap';
|
|
60
|
+
export type { BatchRequest, BatchResponse } from './types/network';
|
|
61
61
|
export type { Action } from './types/integrations';
|
|
62
62
|
export type { HistoryParams } from './types/misc';
|
|
63
63
|
export type { FolderMessage } from './types/workers';
|
|
@@ -25,7 +25,7 @@ const useUserRight = (right) => {
|
|
|
25
25
|
return (0, react_1.useMemo)(() => (0, lodash_1.find)(targets, ['right', right])?.target ?? [], [right, targets]);
|
|
26
26
|
};
|
|
27
27
|
exports.useUserRight = useUserRight;
|
|
28
|
-
const useUserSettings = () => (0, store_1.useAccountStore)((
|
|
28
|
+
const useUserSettings = () => (0, store_1.useAccountStore)((state) => state.settings);
|
|
29
29
|
exports.useUserSettings = useUserSettings;
|
|
30
30
|
const useUserSetting = (...path) => (0, store_1.useAccountStore)((s) => (0, lodash_1.get)(s.settings, (0, lodash_1.join)(path, '.')));
|
|
31
31
|
exports.useUserSetting = useUserSetting;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../src/store/account/hooks.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,iCAAgC;AAEhC,mCAAyC;AAEzC,mCAA0C;AASnC,MAAM,gBAAgB,GAAG,GAAY,EAAE,CAAC,IAAA,uBAAe,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC;AAA1E,QAAA,gBAAgB,oBAA0D;AAEhF,MAAM,cAAc,GAAG,GAAY,EAAE,CAAC,IAAA,uBAAe,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAkB,CAAC,CAAC;AAA7E,QAAA,cAAc,kBAA+D;
|
|
1
|
+
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../src/store/account/hooks.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,iCAAgC;AAEhC,mCAAyC;AAEzC,mCAA0C;AASnC,MAAM,gBAA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,aAAa,iBACqC;AAExD,MAAM,YAAY,GAAG,CAAC,KAAuB,EAA6B,EAAE,CAClF,IAAA,aAAI,EAAC,IAAA,qBAAa,GAAE,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,EAAE,MAAM,IAAK,EAAgC,CAAC;AADjF,QAAA,YAAY,gBACqE"}
|
|
@@ -21,4 +21,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
21
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
22
|
__exportStar(require("./hooks"), exports);
|
|
23
23
|
__exportStar(require("./store"), exports);
|
|
24
|
+
__exportStar(require("./updaters"), exports);
|
|
24
25
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/store/account/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;AAEH,0CAAwB;AACxB,0CAAwB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/store/account/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;AAEH,0CAAwB;AACxB,0CAAwB;AACxB,6CAA2B"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { AccountSettingsAttrs, AccountSettingsPrefs, Identity } from '../../types/account';
|
|
2
|
+
import type { IdentityMods } from '../../types/network';
|
|
3
|
+
type UpdateSettingsParams = {
|
|
4
|
+
attrs?: AccountSettingsAttrs;
|
|
5
|
+
prefs?: AccountSettingsPrefs;
|
|
6
|
+
props?: Record<string, {
|
|
7
|
+
app: string;
|
|
8
|
+
value: unknown;
|
|
9
|
+
}>;
|
|
10
|
+
};
|
|
11
|
+
export type UpdateSettings = (settingsMods: UpdateSettingsParams) => void;
|
|
12
|
+
export type UpdateAccount = (accountMods: IdentityMods, identities: Identity[]) => void;
|
|
13
|
+
export declare const updateSettings: UpdateSettings;
|
|
14
|
+
export declare const updateAccount: UpdateAccount;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateAccount = exports.updateSettings = void 0;
|
|
4
|
+
/*
|
|
5
|
+
* SPDX-FileCopyrightText: 2024 Zextras <https://www.zextras.com>
|
|
6
|
+
*
|
|
7
|
+
* SPDX-License-Identifier: AGPL-3.0-only
|
|
8
|
+
*/
|
|
9
|
+
const lodash_1 = require("lodash");
|
|
10
|
+
const store_1 = require("./store");
|
|
11
|
+
const utils_1 = require("./utils");
|
|
12
|
+
const updateSettings = (settingsMods) => store_1.useAccountStore.setState((state) => ({
|
|
13
|
+
...state,
|
|
14
|
+
settings: {
|
|
15
|
+
attrs: (0, utils_1.mergeAttrs)(settingsMods.attrs, state),
|
|
16
|
+
prefs: (0, utils_1.mergePrefs)(settingsMods.prefs, state),
|
|
17
|
+
props: (0, utils_1.mergeProps)(settingsMods.props, state)
|
|
18
|
+
}
|
|
19
|
+
}));
|
|
20
|
+
exports.updateSettings = updateSettings;
|
|
21
|
+
const updateAccount = (identityMods, newIdentities) => store_1.useAccountStore.setState((state) => state.account
|
|
22
|
+
? {
|
|
23
|
+
...state,
|
|
24
|
+
account: {
|
|
25
|
+
...state.account,
|
|
26
|
+
displayName: (0, lodash_1.find)(identityMods?.modifyList, (item) => item.id === state?.account?.id)?.prefs
|
|
27
|
+
.zimbraPrefIdentityName ?? state.account?.displayName,
|
|
28
|
+
identities: {
|
|
29
|
+
identity: (0, utils_1.updateIdentities)(state, identityMods, newIdentities) ?? []
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
: state);
|
|
34
|
+
exports.updateAccount = updateAccount;
|
|
35
|
+
//# sourceMappingURL=updaters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"updaters.js","sourceRoot":"","sources":["../../../src/store/account/updaters.ts"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/account';
|
|
2
|
+
import type { IdentityMods, PropsMods } from '../../types/network';
|
|
3
|
+
export declare function mergePrefs(mods: AccountSettingsPrefs | undefined, state: AccountState): AccountSettingsPrefs;
|
|
4
|
+
export declare function mergeProps(mods: PropsMods | undefined, state: AccountState): Array<ZimletProp>;
|
|
5
|
+
export declare function mergeAttrs(mods: AccountSettingsAttrs | undefined, state: AccountState): AccountSettingsAttrs;
|
|
6
|
+
export declare function updateIdentities(state: AccountState, identityMods: IdentityMods, identities: Identity[]): Identity[] | undefined;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateIdentities = exports.mergeAttrs = exports.mergeProps = exports.mergePrefs = void 0;
|
|
4
|
+
/*
|
|
5
|
+
* SPDX-FileCopyrightText: 2024 Zextras <https://www.zextras.com>
|
|
6
|
+
*
|
|
7
|
+
* SPDX-License-Identifier: AGPL-3.0-only
|
|
8
|
+
*/
|
|
9
|
+
const lodash_1 = require("lodash");
|
|
10
|
+
function mergePrefs(mods, state) {
|
|
11
|
+
return (0, lodash_1.reduce)(mods, (acc, pref, key) => ({
|
|
12
|
+
...acc,
|
|
13
|
+
[key]: pref
|
|
14
|
+
}), state.settings.prefs);
|
|
15
|
+
}
|
|
16
|
+
exports.mergePrefs = mergePrefs;
|
|
17
|
+
function mergeProps(mods, state) {
|
|
18
|
+
return (0, lodash_1.reduce)(mods, (acc, { app, value }, key) => {
|
|
19
|
+
const newPropValue = {
|
|
20
|
+
name: key,
|
|
21
|
+
zimlet: app,
|
|
22
|
+
_content: value
|
|
23
|
+
};
|
|
24
|
+
const propIndex = (0, lodash_1.findIndex)(acc, (p) => p.name === key && p.zimlet === app);
|
|
25
|
+
if (propIndex >= 0) {
|
|
26
|
+
return acc.map((prop, index) => (propIndex === index ? newPropValue : prop));
|
|
27
|
+
}
|
|
28
|
+
return [...acc, newPropValue];
|
|
29
|
+
}, state.settings.props);
|
|
30
|
+
}
|
|
31
|
+
exports.mergeProps = mergeProps;
|
|
32
|
+
function mergeAttrs(mods, state) {
|
|
33
|
+
return (0, lodash_1.reduce)(mods, (acc, attr, key) => ({
|
|
34
|
+
...acc,
|
|
35
|
+
[key]: attr
|
|
36
|
+
}), state.settings.attrs);
|
|
37
|
+
}
|
|
38
|
+
exports.mergeAttrs = mergeAttrs;
|
|
39
|
+
function updateIdentities(state, identityMods, identities) {
|
|
40
|
+
return typeof state.account !== 'undefined'
|
|
41
|
+
? (0, lodash_1.reduce)(identityMods?.modifyList, (acc, { id, prefs }) => {
|
|
42
|
+
const propIndex = (0, lodash_1.findIndex)(acc, (itemMods, indexAccount) => acc[indexAccount].id === id);
|
|
43
|
+
if (propIndex > -1) {
|
|
44
|
+
// eslint-disable-next-line no-param-reassign
|
|
45
|
+
acc[propIndex]._attrs = {
|
|
46
|
+
...acc[propIndex]._attrs,
|
|
47
|
+
...prefs
|
|
48
|
+
};
|
|
49
|
+
if (prefs.zimbraPrefIdentityName && acc[propIndex].name !== 'DEFAULT') {
|
|
50
|
+
// eslint-disable-next-line no-param-reassign
|
|
51
|
+
acc[propIndex].name = prefs.zimbraPrefIdentityName;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return acc;
|
|
55
|
+
}, [
|
|
56
|
+
...(0, lodash_1.filter)(state.account.identities.identity, (item) => !identityMods?.deleteList?.includes(item.id)).filter((i) => i.name !== 'DEFAULT'),
|
|
57
|
+
...identities,
|
|
58
|
+
...(0, lodash_1.filter)(state.account.identities.identity, (item) => !identityMods?.deleteList?.includes(item.id)).filter((i) => i.name === 'DEFAULT')
|
|
59
|
+
])
|
|
60
|
+
: undefined;
|
|
61
|
+
}
|
|
62
|
+
exports.updateIdentities = updateIdentities;
|
|
63
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/store/account/utils.ts"],"names":[],"mappings":";;;AA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