@beinformed/ui 1.65.29 → 1.67.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/esm/hooks/useErrorHandler.js +26 -0
- package/esm/hooks/useErrorHandler.js.flow +31 -0
- package/esm/hooks/useErrorHandler.js.map +1 -0
- package/esm/hooks/useI18n.js +16 -2
- package/esm/hooks/useI18n.js.flow +21 -2
- package/esm/hooks/useI18n.js.map +1 -1
- package/esm/hooks/useModelSelectors.js +13 -2
- package/esm/hooks/useModelSelectors.js.flow +15 -1
- package/esm/hooks/useModelSelectors.js.map +1 -1
- package/esm/models/concepts/BusinessScenarioModel.js +1 -0
- package/esm/models/concepts/BusinessScenarioModel.js.flow +1 -0
- package/esm/models/concepts/BusinessScenarioModel.js.map +1 -1
- package/esm/redux/_i18n/types.js.flow +14 -0
- package/esm/redux/_i18n/types.js.map +1 -1
- package/esm/redux/_modularui/ModularUISelectors.js +8 -2
- package/esm/redux/_modularui/ModularUISelectors.js.flow +12 -7
- package/esm/redux/_modularui/ModularUISelectors.js.map +1 -1
- package/esm/redux/_modularui/types.js.flow +63 -0
- package/esm/redux/_modularui/types.js.map +1 -1
- package/esm/redux/_router/types.js.flow +45 -0
- package/esm/redux/_router/types.js.map +1 -1
- package/esm/redux/types.js.flow +144 -12
- package/esm/redux/types.js.map +1 -1
- package/lib/hooks/useErrorHandler.js +33 -0
- package/lib/hooks/useErrorHandler.js.map +1 -0
- package/lib/hooks/useI18n.js +16 -1
- package/lib/hooks/useI18n.js.map +1 -1
- package/lib/hooks/useModelSelectors.js +14 -1
- package/lib/hooks/useModelSelectors.js.map +1 -1
- package/lib/models/concepts/BusinessScenarioModel.js +1 -0
- package/lib/models/concepts/BusinessScenarioModel.js.map +1 -1
- package/lib/redux/_i18n/types.js.map +1 -1
- package/lib/redux/_modularui/ModularUISelectors.js +8 -2
- package/lib/redux/_modularui/ModularUISelectors.js.map +1 -1
- package/lib/redux/_modularui/types.js.map +1 -1
- package/lib/redux/_router/types.js.map +1 -1
- package/lib/redux/types.js.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [1.67.0](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.65.29...v1.67.0) (2026-02-14)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **hooks:** add hooks for update locale and retrieval of application ([25cbb98](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/25cbb98c17eea37d91b6cee9623e263b61068d51))
|
|
11
|
+
* **hooks:** add useErrorHandler hook to dispatch error handle actions ([be2a7a1](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/be2a7a193038c91fbbdf948fd9c55cbf6b0c20e6))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* **redux:** deprecated too much ([4d6b99b](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/4d6b99b4a4bb7ea23615f765ae72a3a2e8caafb3))
|
|
17
|
+
* **selector:** retrieve models for active local ([c91b49f](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/c91b49f58973f1d69169f17e964dd107259cf4b7))
|
|
18
|
+
|
|
19
|
+
## [1.66.0](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.65.29...v1.66.0) (2026-02-14)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
* **hooks:** add hooks for update locale and retrieval of application ([25cbb98](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/25cbb98c17eea37d91b6cee9623e263b61068d51))
|
|
25
|
+
* **hooks:** add useErrorHandler hook to dispatch error handle actions ([be2a7a1](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/be2a7a193038c91fbbdf948fd9c55cbf6b0c20e6))
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Bug Fixes
|
|
29
|
+
|
|
30
|
+
* **selector:** retrieve models for active local ([c91b49f](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/c91b49f58973f1d69169f17e964dd107259cf4b7))
|
|
31
|
+
|
|
5
32
|
## [1.65.29](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.65.28...v1.65.29) (2026-02-06)
|
|
6
33
|
|
|
7
34
|
## [1.65.28](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.65.27...v1.65.28) (2026-02-02)
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { useDispatch } from "react-redux";
|
|
2
|
+
import { useCallback } from "react";
|
|
3
|
+
import { handleError } from "../redux/actions/Error";
|
|
4
|
+
import FetchException from "../exceptions/FetchException";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A hook that returns a memoized function to handle application-wide errors.
|
|
8
|
+
*
|
|
9
|
+
* By default, this handler orchestrates:
|
|
10
|
+
* - Redirects for unauthorized, blocked, or concurrent users.
|
|
11
|
+
* - Handles forced password change triggers.
|
|
12
|
+
* - Saves the error in the Redux store (server-side).
|
|
13
|
+
* - Triggers global XHR error notifications.
|
|
14
|
+
*/
|
|
15
|
+
export const useErrorHandler = () => {
|
|
16
|
+
const dispatch = useDispatch();
|
|
17
|
+
return useCallback(
|
|
18
|
+
/**
|
|
19
|
+
* @param {string | Error | FetchException} error - The error object or message to process.
|
|
20
|
+
*/
|
|
21
|
+
error => {
|
|
22
|
+
const err = typeof error === "string" ? new Error(error) : error;
|
|
23
|
+
dispatch(handleError(err));
|
|
24
|
+
}, [dispatch]);
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=useErrorHandler.js.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// @flow
|
|
2
|
+
import { useDispatch } from "react-redux";
|
|
3
|
+
import { useCallback } from "react";
|
|
4
|
+
import { handleError } from "../redux/actions/Error";
|
|
5
|
+
import FetchException from "../exceptions/FetchException";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* A hook that returns a memoized function to handle application-wide errors.
|
|
9
|
+
*
|
|
10
|
+
* By default, this handler orchestrates:
|
|
11
|
+
* - Redirects for unauthorized, blocked, or concurrent users.
|
|
12
|
+
* - Handles forced password change triggers.
|
|
13
|
+
* - Saves the error in the Redux store (server-side).
|
|
14
|
+
* - Triggers global XHR error notifications.
|
|
15
|
+
*/
|
|
16
|
+
export const useErrorHandler = (): ((
|
|
17
|
+
error: string | Error | FetchException,
|
|
18
|
+
) => void) => {
|
|
19
|
+
const dispatch = useDispatch();
|
|
20
|
+
|
|
21
|
+
return useCallback(
|
|
22
|
+
/**
|
|
23
|
+
* @param {string | Error | FetchException} error - The error object or message to process.
|
|
24
|
+
*/
|
|
25
|
+
(error: string | Error | FetchException) => {
|
|
26
|
+
const err = typeof error === "string" ? new Error(error) : error;
|
|
27
|
+
dispatch(handleError(err));
|
|
28
|
+
},
|
|
29
|
+
[dispatch],
|
|
30
|
+
);
|
|
31
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useErrorHandler.js","names":["useDispatch","useCallback","handleError","FetchException","useErrorHandler","dispatch","error","err","Error"],"sources":["../../src/hooks/useErrorHandler.js"],"sourcesContent":["// @flow\nimport { useDispatch } from \"react-redux\";\nimport { useCallback } from \"react\";\nimport { handleError } from \"../redux/actions/Error\";\nimport FetchException from \"../exceptions/FetchException\";\n\n/**\n * A hook that returns a memoized function to handle application-wide errors.\n *\n * By default, this handler orchestrates:\n * - Redirects for unauthorized, blocked, or concurrent users.\n * - Handles forced password change triggers.\n * - Saves the error in the Redux store (server-side).\n * - Triggers global XHR error notifications.\n */\nexport const useErrorHandler = (): ((\n error: string | Error | FetchException,\n) => void) => {\n const dispatch = useDispatch();\n\n return useCallback(\n /**\n * @param {string | Error | FetchException} error - The error object or message to process.\n */\n (error: string | Error | FetchException) => {\n const err = typeof error === \"string\" ? new Error(error) : error;\n dispatch(handleError(err));\n },\n [dispatch],\n );\n};\n"],"mappings":"AACA,SAASA,WAAW,QAAQ,aAAa;AACzC,SAASC,WAAW,QAAQ,OAAO;AACnC,SAASC,WAAW,QAAQ,wBAAwB;AACpD,OAAOC,cAAc,MAAM,8BAA8B;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,eAAe,GAAGA,CAAA,KAEjB;EACZ,MAAMC,QAAQ,GAAGL,WAAW,CAAC,CAAC;EAE9B,OAAOC,WAAW;EAChB;AACJ;AACA;EACKK,KAAsC,IAAK;IAC1C,MAAMC,GAAG,GAAG,OAAOD,KAAK,KAAK,QAAQ,GAAG,IAAIE,KAAK,CAACF,KAAK,CAAC,GAAGA,KAAK;IAChED,QAAQ,CAACH,WAAW,CAACK,GAAG,CAAC,CAAC;EAC5B,CAAC,EACD,CAACF,QAAQ,CACX,CAAC;AACH,CAAC","ignoreList":[]}
|
package/esm/hooks/useI18n.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import _JSON$stringify from "@babel/runtime-corejs3/core-js-stable/json/stringify";
|
|
2
2
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
3
|
-
import {
|
|
3
|
+
import { useCallback } from "react";
|
|
4
|
+
import { useDispatch, useSelector } from "react-redux";
|
|
4
5
|
import { createSelector } from "reselect";
|
|
5
6
|
import memoize from "lodash/memoize";
|
|
6
7
|
import { getLocales, getLocale } from "../redux/selectors/i18n";
|
|
8
|
+
import { updateLocale } from "../redux/_i18n/I18nActions";
|
|
7
9
|
const getMessage = createSelector([getLocales, getLocale], (locales, localeCode) => memoize((id, defaultMessage, placeholders) => locales.getLocale(localeCode).getMessage(id, defaultMessage, placeholders), (...args) => _JSON$stringify(args)));
|
|
8
10
|
|
|
9
11
|
/**
|
|
@@ -23,5 +25,17 @@ const getLocaleCodes = createSelector(state => state.i18n.locales, locales => _m
|
|
|
23
25
|
* Retrieve all available locale codes
|
|
24
26
|
*/
|
|
25
27
|
const useLocaleCodes = () => useSelector(getLocaleCodes);
|
|
26
|
-
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* A hook that returns a memoized function to update the application locale.
|
|
31
|
+
*
|
|
32
|
+
* @returns {(locale: string) => void} A memoized function to update the locale.
|
|
33
|
+
*/
|
|
34
|
+
const useUpdateLocale = () => {
|
|
35
|
+
const dispatch = useDispatch();
|
|
36
|
+
return useCallback(locale => {
|
|
37
|
+
dispatch(updateLocale(locale));
|
|
38
|
+
}, [dispatch]);
|
|
39
|
+
};
|
|
40
|
+
export { useTranslate, useMessage, useLocale, useLocaleCodes, useUpdateLocale };
|
|
27
41
|
//# sourceMappingURL=useI18n.js.map
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
// @flow
|
|
2
|
-
import {
|
|
2
|
+
import { useCallback } from "react";
|
|
3
|
+
import { useDispatch, useSelector } from "react-redux";
|
|
3
4
|
import { createSelector } from "reselect";
|
|
5
|
+
|
|
4
6
|
import memoize from "lodash/memoize";
|
|
5
7
|
|
|
6
8
|
import { getLocales, getLocale } from "../redux/selectors/i18n";
|
|
9
|
+
import { updateLocale } from "../redux/_i18n/I18nActions";
|
|
7
10
|
|
|
8
11
|
const getMessage = createSelector(
|
|
9
12
|
[getLocales, getLocale],
|
|
@@ -43,4 +46,20 @@ const getLocaleCodes = createSelector(
|
|
|
43
46
|
*/
|
|
44
47
|
const useLocaleCodes = (): Array<string> => useSelector(getLocaleCodes);
|
|
45
48
|
|
|
46
|
-
|
|
49
|
+
/**
|
|
50
|
+
* A hook that returns a memoized function to update the application locale.
|
|
51
|
+
*
|
|
52
|
+
* @returns {(locale: string) => void} A memoized function to update the locale.
|
|
53
|
+
*/
|
|
54
|
+
const useUpdateLocale = (): ((locale: string) => void) => {
|
|
55
|
+
const dispatch = useDispatch();
|
|
56
|
+
|
|
57
|
+
return useCallback(
|
|
58
|
+
(locale: string) => {
|
|
59
|
+
dispatch(updateLocale(locale));
|
|
60
|
+
},
|
|
61
|
+
[dispatch],
|
|
62
|
+
);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export { useTranslate, useMessage, useLocale, useLocaleCodes, useUpdateLocale };
|
package/esm/hooks/useI18n.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useI18n.js","names":["useSelector","createSelector","memoize","getLocales","getLocale","getMessage","locales","localeCode","id","defaultMessage","placeholders","args","_JSON$stringify","useMessage","useTranslate","useLocale","getLocaleCodes","state","i18n","_mapInstanceProperty","call","locale","code","useLocaleCodes"],"sources":["../../src/hooks/useI18n.js"],"sourcesContent":["// @flow\nimport { useSelector } from \"react-redux\";\nimport { createSelector } from \"reselect\";\nimport memoize from \"lodash/memoize\";\n\nimport { getLocales, getLocale } from \"../redux/selectors/i18n\";\n\nconst getMessage = createSelector(\n [getLocales, getLocale],\n (locales, localeCode) =>\n memoize(\n (id: string, defaultMessage?: string, placeholders?: Object) =>\n locales\n .getLocale(localeCode)\n .getMessage(id, defaultMessage, placeholders),\n (...args) => JSON.stringify(args),\n ),\n);\n\n/**\n */\nconst useMessage = (\n id: string,\n defaultMessage?: string,\n placeholders?: Object | null,\n): any => useSelector(getMessage)(id, defaultMessage, placeholders);\n\n/**\n */\nconst useTranslate = (): ((...any) => any) => useSelector(getMessage);\n\n/**\n */\nconst useLocale = (): string => useSelector(getLocale);\n\nconst getLocaleCodes = createSelector(\n (state) => state.i18n.locales,\n (locales) => locales.map((locale) => locale.code),\n);\n\n/**\n * Retrieve all available locale codes\n */\nconst useLocaleCodes = (): Array<string> => useSelector(getLocaleCodes);\n\nexport { useTranslate, useMessage, useLocale, useLocaleCodes };\n"],"mappings":";;AACA,SAASA,WAAW,QAAQ,aAAa;
|
|
1
|
+
{"version":3,"file":"useI18n.js","names":["useCallback","useDispatch","useSelector","createSelector","memoize","getLocales","getLocale","updateLocale","getMessage","locales","localeCode","id","defaultMessage","placeholders","args","_JSON$stringify","useMessage","useTranslate","useLocale","getLocaleCodes","state","i18n","_mapInstanceProperty","call","locale","code","useLocaleCodes","useUpdateLocale","dispatch"],"sources":["../../src/hooks/useI18n.js"],"sourcesContent":["// @flow\nimport { useCallback } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { createSelector } from \"reselect\";\n\nimport memoize from \"lodash/memoize\";\n\nimport { getLocales, getLocale } from \"../redux/selectors/i18n\";\nimport { updateLocale } from \"../redux/_i18n/I18nActions\";\n\nconst getMessage = createSelector(\n [getLocales, getLocale],\n (locales, localeCode) =>\n memoize(\n (id: string, defaultMessage?: string, placeholders?: Object) =>\n locales\n .getLocale(localeCode)\n .getMessage(id, defaultMessage, placeholders),\n (...args) => JSON.stringify(args),\n ),\n);\n\n/**\n */\nconst useMessage = (\n id: string,\n defaultMessage?: string,\n placeholders?: Object | null,\n): any => useSelector(getMessage)(id, defaultMessage, placeholders);\n\n/**\n */\nconst useTranslate = (): ((...any) => any) => useSelector(getMessage);\n\n/**\n */\nconst useLocale = (): string => useSelector(getLocale);\n\nconst getLocaleCodes = createSelector(\n (state) => state.i18n.locales,\n (locales) => locales.map((locale) => locale.code),\n);\n\n/**\n * Retrieve all available locale codes\n */\nconst useLocaleCodes = (): Array<string> => useSelector(getLocaleCodes);\n\n/**\n * A hook that returns a memoized function to update the application locale.\n *\n * @returns {(locale: string) => void} A memoized function to update the locale.\n */\nconst useUpdateLocale = (): ((locale: string) => void) => {\n const dispatch = useDispatch();\n\n return useCallback(\n (locale: string) => {\n dispatch(updateLocale(locale));\n },\n [dispatch],\n );\n};\n\nexport { useTranslate, useMessage, useLocale, useLocaleCodes, useUpdateLocale };\n"],"mappings":";;AACA,SAASA,WAAW,QAAQ,OAAO;AACnC,SA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,OAAOD,WAAW,CACfwB,MAAc,IAAK;IAClBI,QAAQ,CAACrB,YAAY,CAACiB,MAAM,CAAC,CAAC;EAChC,CAAC,EACD,CAACI,QAAQ,CACX,CAAC;AACH,CAAC;AAED,SAASX,YAAY,EAAED,UAAU,EAAEE,SAAS,EAAEQ,cAAc,EAAEC,eAAe","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useSelector } from "react-redux";
|
|
2
|
-
import { getAllModelsByInstance, getFirstModelByInstance, getActiveModelByInstance, modelByHref, keyByHref, allKeysByHref, getActiveModels, getAllFinishedModels } from "../redux/_modularui/ModularUISelectors";
|
|
2
|
+
import { getAllModelsByInstance, getFirstModelByInstance, getActiveModelByInstance, modelByHref, keyByHref, allKeysByHref, getActiveModels, getAllFinishedModels, getApplication } from "../redux/_modularui/ModularUISelectors";
|
|
3
3
|
import Href from "../models/href/Href";
|
|
4
|
-
|
|
4
|
+
import ApplicationModel from "../models/application/ApplicationModel";
|
|
5
5
|
/**
|
|
6
6
|
* Returns all models in the store that are instances of the provided class
|
|
7
7
|
* and match the current application locale.
|
|
@@ -70,4 +70,15 @@ export const useActiveModels = () => {
|
|
|
70
70
|
export const useAllFinishedModels = () => {
|
|
71
71
|
return useSelector(getAllFinishedModels);
|
|
72
72
|
};
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Returns the current active application, without retrying to request it.
|
|
76
|
+
*/
|
|
77
|
+
export const useCurrentApplication = () => {
|
|
78
|
+
const application = useSelector(getApplication);
|
|
79
|
+
if (application instanceof ApplicationModel) {
|
|
80
|
+
return application;
|
|
81
|
+
}
|
|
82
|
+
return null;
|
|
83
|
+
};
|
|
73
84
|
//# sourceMappingURL=useModelSelectors.js.map
|
|
@@ -10,10 +10,13 @@ import {
|
|
|
10
10
|
allKeysByHref,
|
|
11
11
|
getActiveModels,
|
|
12
12
|
getAllFinishedModels,
|
|
13
|
+
getApplication,
|
|
13
14
|
} from "../redux/_modularui/ModularUISelectors";
|
|
15
|
+
import Href from "../models/href/Href";
|
|
16
|
+
import ApplicationModel from "../models/application/ApplicationModel";
|
|
17
|
+
|
|
14
18
|
import type { ModularUIModel } from "../models/types";
|
|
15
19
|
import type { ReduxState } from "../redux/types";
|
|
16
|
-
import Href from "../models/href/Href";
|
|
17
20
|
|
|
18
21
|
/**
|
|
19
22
|
* Returns all models in the store that are instances of the provided class
|
|
@@ -96,3 +99,14 @@ export const useActiveModels = (): Array<{
|
|
|
96
99
|
export const useAllFinishedModels = (): Array<ModularUIModel> => {
|
|
97
100
|
return useSelector(getAllFinishedModels);
|
|
98
101
|
};
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Returns the current active application, without retrying to request it.
|
|
105
|
+
*/
|
|
106
|
+
export const useCurrentApplication = (): ApplicationModel | null => {
|
|
107
|
+
const application = useSelector(getApplication);
|
|
108
|
+
if (application instanceof ApplicationModel) {
|
|
109
|
+
return application;
|
|
110
|
+
}
|
|
111
|
+
return null;
|
|
112
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useModelSelectors.js","names":["useSelector","getAllModelsByInstance","getFirstModelByInstance","getActiveModelByInstance","modelByHref","keyByHref","allKeysByHref","getActiveModels","getAllFinishedModels","Href","useAllModelsByInstance","instance","state","useFirstModelByInstance","useActiveModelByInstance","useModelByHref","href","useKeyByHref","useAllKeysByHref","useActiveModels","useAllFinishedModels"],"sources":["../../src/hooks/useModelSelectors.js"],"sourcesContent":["// @flow\nimport { useSelector } from \"react-redux\";\n\nimport {\n getAllModelsByInstance,\n getFirstModelByInstance,\n getActiveModelByInstance,\n modelByHref,\n keyByHref,\n allKeysByHref,\n getActiveModels,\n getAllFinishedModels,\n} from \"../redux/_modularui/ModularUISelectors\";\nimport
|
|
1
|
+
{"version":3,"file":"useModelSelectors.js","names":["useSelector","getAllModelsByInstance","getFirstModelByInstance","getActiveModelByInstance","modelByHref","keyByHref","allKeysByHref","getActiveModels","getAllFinishedModels","getApplication","Href","ApplicationModel","useAllModelsByInstance","instance","state","useFirstModelByInstance","useActiveModelByInstance","useModelByHref","href","useKeyByHref","useAllKeysByHref","useActiveModels","useAllFinishedModels","useCurrentApplication","application"],"sources":["../../src/hooks/useModelSelectors.js"],"sourcesContent":["// @flow\nimport { useSelector } from \"react-redux\";\n\nimport {\n getAllModelsByInstance,\n getFirstModelByInstance,\n getActiveModelByInstance,\n modelByHref,\n keyByHref,\n allKeysByHref,\n getActiveModels,\n getAllFinishedModels,\n getApplication,\n} from \"../redux/_modularui/ModularUISelectors\";\nimport Href from \"../models/href/Href\";\nimport ApplicationModel from \"../models/application/ApplicationModel\";\n\nimport type { ModularUIModel } from \"../models/types\";\nimport type { ReduxState } from \"../redux/types\";\n\n/**\n * Returns all models in the store that are instances of the provided class\n * and match the current application locale.\n */\nexport const useAllModelsByInstance = <T>(\n instance: Class<T>,\n): Array<ModularUIModel> => {\n return useSelector((state: ReduxState) =>\n getAllModelsByInstance(state, instance),\n );\n};\n\n/**\n * Returns the first model found in the store that is an instance of the\n * provided class and matches the current locale.\n */\nexport const useFirstModelByInstance = <T>(instance: Class<T>): T | null => {\n return useSelector((state: ReduxState) =>\n getFirstModelByInstance(state, instance),\n );\n};\n\n/**\n * Returns the model instance that is currently \"active\" based on the URL path.\n * It checks if the current router location starts with the model's selfhref path.\n */\nexport const useActiveModelByInstance = <T>(instance: Class<T>): T | null => {\n return useSelector((state: ReduxState) =>\n getActiveModelByInstance(state, instance),\n );\n};\n\n/**\n * Retrieves a specific model from the store based on its unique Href.\n * @param {Href | string} href - The Href object or string path of the model.\n * @returns {ModularUIModel | null} The model matching the href or null.\n */\nexport const useModelByHref = (href: Href | string): null | ModularUIModel => {\n return useSelector((state: ReduxState) => modelByHref(state, href));\n};\n\n/**\n * Returns the unique store key (identifier) for a model associated with a specific Href.\n * @param {Href | string} href - The Href object or string path.\n * @returns {string | null | void} The internal key of the model.\n */\nexport const useKeyByHref = (href: Href | string): ?string => {\n return useSelector((state: ReduxState) => keyByHref(state, href));\n};\n\n/**\n * Returns all internal keys found in the store for a specific Href.\n * Useful if multiple versions/entries exist for the same path.\n * @param {Href | string} href - The Href object or string path.\n * @returns {Array<string>} An array of keys.\n */\nexport const useAllKeysByHref = (href: Href | string): Array<string> => {\n return useSelector((state: ReduxState) => allKeysByHref(state, href));\n};\n\n/**\n * Returns a list of simplified model info (key, href, label, type) for all\n * models currently active in the navigation context (breadcrumbs).\n * @returns {Array<{key: string, href: Href, label: string, type: string}>}\n */\nexport const useActiveModels = (): Array<{\n key: string,\n href: Href,\n label: string,\n type: string,\n}> => {\n return useSelector(getActiveModels);\n};\n\n/**\n * Returns all models in the store that have a status of MODULARUI_STATUS.FINISHED.\n * @returns {Array<ModularUIModel>} An array of fully loaded models.\n */\nexport const useAllFinishedModels = (): Array<ModularUIModel> => {\n return useSelector(getAllFinishedModels);\n};\n\n/**\n * Returns the current active application, without retrying to request it.\n */\nexport const useCurrentApplication = (): ApplicationModel | null => {\n const application = useSelector(getApplication);\n if (application instanceof ApplicationModel) {\n return application;\n }\n return null;\n};\n"],"mappings":"AACA,SAASA,WAAW,QAAQ,aAAa;AAEzC,SACEC,sBAAsB,EACtBC,uBAAuB,EACvBC,wBAAwB,EACxBC,WAAW,EACXC,SAAS,EACTC,aAAa,EACbC,eAAe,EACfC,oBAAoB,EACpBC,cAAc,QACT,wCAAwC;AAC/C,OAAOC,IAAI,MAAM,qBAAqB;AACtC,OAAOC,gBAAgB,MAAM,wCAAwC;AAKrE;AACA;AACA;AACA;AACA,OAAO,MAAMC,sBAAsB,GACjCC,QAAkB,IACQ;EAC1B,OAAOb,WAAW,CAAEc,KAAiB,IACnCb,sBAAsB,CAACa,KAAK,EAAED,QAAQ,CACxC,CAAC;AACH,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,MAAME,uBAAuB,GAAOF,QAAkB,IAAe;EAC1E,OAAOb,WAAW,CAAEc,KAAiB,IACnCZ,uBAAuB,CAACY,KAAK,EAAED,QAAQ,CAC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|
import ConceptTypeDetailModel from "./ConceptTypeDetailModel";
|
|
8
8
|
import { getSetting } from "../../constants/Settings";
|
|
9
9
|
/**
|
|
10
|
+
* @deprecated use the ConceptDetailModel with concept type BusinessScenarios#BusinessScenario
|
|
10
11
|
*/
|
|
11
12
|
class BusinessScenarioModel extends ConceptDetailModel {
|
|
12
13
|
constructor(...args) {
|
|
@@ -10,6 +10,7 @@ import type ConceptLinkModel from "./ConceptLinkModel";
|
|
|
10
10
|
import type ErrorResponse from "../error/ErrorResponse";
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
+
* @deprecated use the ConceptDetailModel with concept type BusinessScenarios#BusinessScenario
|
|
13
14
|
*/
|
|
14
15
|
class BusinessScenarioModel extends ConceptDetailModel {
|
|
15
16
|
_scenarioSteps: Array<ConceptDetailModel>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BusinessScenarioModel.js","names":["ConceptDetailModel","ConceptTypeDetailModel","getSetting","BusinessScenarioModel","constructor","args","_defineProperty","type","modelName","isApplicableModel","data","isOfConceptType","_links","concepttype","href","conceptTypeHref","settingNames","Array","isArray","TypeError","pathToKmt","conceptTypeSettings","STEP","PERSONA","SYSTEM","SCENARIO","decodedConceptTypeHref","decodeURIComponent","some","settingName","conceptTypeSetting","_endsWithInstanceProperty","call","getInitialChildModelLinks","_context","_context2","childModelLinks","scenarioStepLinks","_mapInstanceProperty","_filterInstanceProperty","relationsCollection","all","relation","direction","concept","concepttypeHref","path","asLinkModel","length","push","setChildModels","models","errors","conceptTypeModel","_findInstanceProperty","model","conceptType","scenarioSteps","i","selfhref","_scenarioSteps","actors","forEach","scenarioStep","_context3","relationsToActor","newRelationToActor","actor","key"],"sources":["../../../src/models/concepts/BusinessScenarioModel.js"],"sourcesContent":["// @flow\nimport ConceptDetailModel from \"./ConceptDetailModel\";\nimport ConceptTypeDetailModel from \"./ConceptTypeDetailModel\";\nimport { getSetting } from \"../../constants/Settings\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type { ModularUIModel } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type ConceptLinkModel from \"./ConceptLinkModel\";\nimport type ErrorResponse from \"../error/ErrorResponse\";\n\n/**\n */\nclass BusinessScenarioModel extends ConceptDetailModel {\n _scenarioSteps: Array<ConceptDetailModel>;\n\n /**\n */\n get type(): string {\n return \"BusinessScenario\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"BusinessScenario\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return BusinessScenarioModel.isOfConceptType(\n data?.data?._links?.concepttype?.href,\n [\"SCENARIO\"],\n );\n }\n\n /**\n */\n static isOfConceptType(\n conceptTypeHref: ?string,\n settingNames: Array<\"STEP\" | \"PERSONA\" | \"SCENARIO\" | \"SYSTEM\">,\n ): boolean {\n if (!conceptTypeHref) {\n return false;\n }\n\n // Check if settingNames is an array\n if (!Array.isArray(settingNames)) {\n throw new TypeError(\"settingNames must be an array\");\n }\n\n const pathToKmt = \"/Library/KMTs/Business scenarios.bixml\";\n\n const conceptTypeSettings = {\n STEP: getSetting(\"BUSINESS_SCENARIO_STEP_CONCEPT_TYPE\", [\n `${pathToKmt}/ScenarioStep`,\n ]),\n PERSONA: getSetting(\"BUSINESS_SCENARIO_PERSONA_CONCEPT_TYPE\", [\n `${pathToKmt}/Persona`,\n ]),\n SYSTEM: getSetting(\"BUSINESS_SCENARIO_SYSTEM_CONCEPT_TYPE\", [\n `${pathToKmt}/System`,\n ]),\n SCENARIO: getSetting(\"BUSINESS_SCENARIO_CONCEPT_TYPE\", [\n `${pathToKmt}/BusinessScenario`,\n ]),\n };\n\n const decodedConceptTypeHref = decodeURIComponent(conceptTypeHref);\n\n return settingNames.some(\n (settingName) =>\n Array.isArray(conceptTypeSettings[settingName]) &&\n conceptTypeSettings[settingName].some((conceptTypeSetting) =>\n decodedConceptTypeHref.endsWith(conceptTypeSetting),\n ),\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const childModelLinks = super.getInitialChildModelLinks();\n\n const scenarioStepLinks = this.relationsCollection.all\n .filter(\n (relation) =>\n relation.direction === \"outgoing\" &&\n BusinessScenarioModel.isOfConceptType(\n relation.concept.concepttypeHref?.path,\n [\"STEP\"],\n ),\n )\n .map((relation) => relation.concept.asLinkModel());\n\n if (scenarioStepLinks.length > 0) {\n childModelLinks.push(...scenarioStepLinks);\n }\n\n return childModelLinks;\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>, errors: Array<ErrorResponse>) {\n // $FlowExpectedError[incompatible-type]\n const conceptTypeModel: ?ConceptTypeDetailModel = models.find(\n (model) => model instanceof ConceptTypeDetailModel,\n );\n\n if (conceptTypeModel) {\n this.conceptType = conceptTypeModel;\n }\n\n this.relationsCollection.setChildModels(models, errors);\n\n const scenarioSteps = [];\n for (let i = 0; i < models.length; i++) {\n const model = models[i];\n\n if (\n model instanceof ConceptDetailModel &&\n BusinessScenarioModel.isOfConceptType(\n model.conceptType?.selfhref.path,\n [\"STEP\"],\n )\n ) {\n scenarioSteps.push(model);\n }\n }\n\n this.scenarioSteps = scenarioSteps;\n }\n\n /**\n */\n set scenarioSteps(models: Array<ConceptDetailModel>) {\n this._scenarioSteps = models;\n }\n\n /**\n */\n get scenarioSteps(): Array<ConceptDetailModel> {\n return this._scenarioSteps;\n }\n\n /**\n */\n get actors(): Array<ConceptLinkModel> {\n const actors = [];\n\n this.scenarioSteps.forEach((scenarioStep) => {\n const relationsToActor = scenarioStep.relationsCollection.find(\n (relation) =>\n relation.direction === \"outgoing\" &&\n BusinessScenarioModel.isOfConceptType(\n relation.concept.concepttypeHref?.path,\n [\"PERSONA\", \"SYSTEM\"],\n ),\n );\n\n const newRelationToActor =\n relationsToActor &&\n !actors.some((actor) => actor.key === relationsToActor.concept.key);\n\n if (relationsToActor && newRelationToActor) {\n actors.push(relationsToActor.concept);\n }\n });\n\n return actors;\n }\n}\n\nexport default BusinessScenarioModel;\n"],"mappings":";;;;;AACA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KAAK,CAACC,GAAG,KAAKH,gBAAgB,CAACrB,OAAO,CAACwB,GAAG,CAAC;MAErE,IAAIH,gBAAgB,IAAIC,kBAAkB,EAAE;QAC1CL,MAAM,CAACZ,IAAI,CAACgB,gBAAgB,CAACrB,OAAO,CAAC;MACvC;IACF,CAAC,CAAC;IAEF,OAAOiB,MAAM;EACf;AACF;AAEA,eAAe1D,qBAAqB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"BusinessScenarioModel.js","names":["ConceptDetailModel","ConceptTypeDetailModel","getSetting","BusinessScenarioModel","constructor","args","_defineProperty","type","modelName","isApplicableModel","data","isOfConceptType","_links","concepttype","href","conceptTypeHref","settingNames","Array","isArray","TypeError","pathToKmt","conceptTypeSettings","STEP","PERSONA","SYSTEM","SCENARIO","decodedConceptTypeHref","decodeURIComponent","some","settingName","conceptTypeSetting","_endsWithInstanceProperty","call","getInitialChildModelLinks","_context","_context2","childModelLinks","scenarioStepLinks","_mapInstanceProperty","_filterInstanceProperty","relationsCollection","all","relation","direction","concept","concepttypeHref","path","asLinkModel","length","push","setChildModels","models","errors","conceptTypeModel","_findInstanceProperty","model","conceptType","scenarioSteps","i","selfhref","_scenarioSteps","actors","forEach","scenarioStep","_context3","relationsToActor","newRelationToActor","actor","key"],"sources":["../../../src/models/concepts/BusinessScenarioModel.js"],"sourcesContent":["// @flow\nimport ConceptDetailModel from \"./ConceptDetailModel\";\nimport ConceptTypeDetailModel from \"./ConceptTypeDetailModel\";\nimport { getSetting } from \"../../constants/Settings\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type { ModularUIModel } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type ConceptLinkModel from \"./ConceptLinkModel\";\nimport type ErrorResponse from \"../error/ErrorResponse\";\n\n/**\n * @deprecated use the ConceptDetailModel with concept type BusinessScenarios#BusinessScenario\n */\nclass BusinessScenarioModel extends ConceptDetailModel {\n _scenarioSteps: Array<ConceptDetailModel>;\n\n /**\n */\n get type(): string {\n return \"BusinessScenario\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"BusinessScenario\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return BusinessScenarioModel.isOfConceptType(\n data?.data?._links?.concepttype?.href,\n [\"SCENARIO\"],\n );\n }\n\n /**\n */\n static isOfConceptType(\n conceptTypeHref: ?string,\n settingNames: Array<\"STEP\" | \"PERSONA\" | \"SCENARIO\" | \"SYSTEM\">,\n ): boolean {\n if (!conceptTypeHref) {\n return false;\n }\n\n // Check if settingNames is an array\n if (!Array.isArray(settingNames)) {\n throw new TypeError(\"settingNames must be an array\");\n }\n\n const pathToKmt = \"/Library/KMTs/Business scenarios.bixml\";\n\n const conceptTypeSettings = {\n STEP: getSetting(\"BUSINESS_SCENARIO_STEP_CONCEPT_TYPE\", [\n `${pathToKmt}/ScenarioStep`,\n ]),\n PERSONA: getSetting(\"BUSINESS_SCENARIO_PERSONA_CONCEPT_TYPE\", [\n `${pathToKmt}/Persona`,\n ]),\n SYSTEM: getSetting(\"BUSINESS_SCENARIO_SYSTEM_CONCEPT_TYPE\", [\n `${pathToKmt}/System`,\n ]),\n SCENARIO: getSetting(\"BUSINESS_SCENARIO_CONCEPT_TYPE\", [\n `${pathToKmt}/BusinessScenario`,\n ]),\n };\n\n const decodedConceptTypeHref = decodeURIComponent(conceptTypeHref);\n\n return settingNames.some(\n (settingName) =>\n Array.isArray(conceptTypeSettings[settingName]) &&\n conceptTypeSettings[settingName].some((conceptTypeSetting) =>\n decodedConceptTypeHref.endsWith(conceptTypeSetting),\n ),\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const childModelLinks = super.getInitialChildModelLinks();\n\n const scenarioStepLinks = this.relationsCollection.all\n .filter(\n (relation) =>\n relation.direction === \"outgoing\" &&\n BusinessScenarioModel.isOfConceptType(\n relation.concept.concepttypeHref?.path,\n [\"STEP\"],\n ),\n )\n .map((relation) => relation.concept.asLinkModel());\n\n if (scenarioStepLinks.length > 0) {\n childModelLinks.push(...scenarioStepLinks);\n }\n\n return childModelLinks;\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>, errors: Array<ErrorResponse>) {\n // $FlowExpectedError[incompatible-type]\n const conceptTypeModel: ?ConceptTypeDetailModel = models.find(\n (model) => model instanceof ConceptTypeDetailModel,\n );\n\n if (conceptTypeModel) {\n this.conceptType = conceptTypeModel;\n }\n\n this.relationsCollection.setChildModels(models, errors);\n\n const scenarioSteps = [];\n for (let i = 0; i < models.length; i++) {\n const model = models[i];\n\n if (\n model instanceof ConceptDetailModel &&\n BusinessScenarioModel.isOfConceptType(\n model.conceptType?.selfhref.path,\n [\"STEP\"],\n )\n ) {\n scenarioSteps.push(model);\n }\n }\n\n this.scenarioSteps = scenarioSteps;\n }\n\n /**\n */\n set scenarioSteps(models: Array<ConceptDetailModel>) {\n this._scenarioSteps = models;\n }\n\n /**\n */\n get scenarioSteps(): Array<ConceptDetailModel> {\n return this._scenarioSteps;\n }\n\n /**\n */\n get actors(): Array<ConceptLinkModel> {\n const actors = [];\n\n this.scenarioSteps.forEach((scenarioStep) => {\n const relationsToActor = scenarioStep.relationsCollection.find(\n (relation) =>\n relation.direction === \"outgoing\" &&\n BusinessScenarioModel.isOfConceptType(\n relation.concept.concepttypeHref?.path,\n [\"PERSONA\", \"SYSTEM\"],\n ),\n );\n\n const newRelationToActor =\n relationsToActor &&\n !actors.some((actor) => actor.key === relationsToActor.concept.key);\n\n if (relationsToActor && newRelationToActor) {\n actors.push(relationsToActor.concept);\n }\n });\n\n return actors;\n }\n}\n\nexport default BusinessScenarioModel;\n"],"mappings":";;;;;AACA,OAAOA,kBAAkB,MAAM,sBAAsB;AACrD,OAAOC,sBAAsB,MAAM,0BAA0B;AAC7D,SAASC,UAAU,QAAQ,0BAA0B;AAQrD;AACA;AACA;AACA,MAAMC,qBAAqB,SAASH,kBAAkB,CAAC;EAAAI,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA;E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EACf;AACF;AAEA,eAAe1D,qBAAqB","ignoreList":[]}
|
|
@@ -6,11 +6,25 @@ export type I18nState = {
|
|
|
6
6
|
+locale: string,
|
|
7
7
|
};
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated This manual action type will be removed in a future major release.
|
|
11
|
+
* Recommended fixes:
|
|
12
|
+
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
13
|
+
* - Use the appropriate hook (useUpdateLocale) to encapsulate this logic.
|
|
14
|
+
* - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.
|
|
15
|
+
*/
|
|
9
16
|
export type UpdateLocaleAction = {
|
|
10
17
|
type: "UPDATE_LOCALE",
|
|
11
18
|
payload: string,
|
|
12
19
|
};
|
|
13
20
|
|
|
21
|
+
/**
|
|
22
|
+
* @deprecated This manual action type will be removed in a future major release.
|
|
23
|
+
* Recommended fixes:
|
|
24
|
+
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
25
|
+
* - Use the appropriate hook to encapsulate this logic.
|
|
26
|
+
* - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.
|
|
27
|
+
*/
|
|
14
28
|
export type SetLocalesAction = {
|
|
15
29
|
type: "SET_LOCALES",
|
|
16
30
|
payload: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../src/redux/_i18n/types.js"],"sourcesContent":["// @flow\nimport type Locales from \"../../i18n/Locales\";\n\nexport type I18nState = {\n +locales: Locales,\n +locale: string,\n};\n\nexport type UpdateLocaleAction = {\n type: \"UPDATE_LOCALE\",\n payload: string,\n};\n\nexport type SetLocalesAction = {\n type: \"SET_LOCALES\",\n payload: {\n locales: Locales,\n locale: string,\n },\n};\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../src/redux/_i18n/types.js"],"sourcesContent":["// @flow\nimport type Locales from \"../../i18n/Locales\";\n\nexport type I18nState = {\n +locales: Locales,\n +locale: string,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useUpdateLocale) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type UpdateLocaleAction = {\n type: \"UPDATE_LOCALE\",\n payload: string,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type SetLocalesAction = {\n type: \"SET_LOCALES\",\n payload: {\n locales: Locales,\n locale: string,\n },\n};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -236,10 +236,16 @@ export const getModelsByType = (state, type) => {
|
|
|
236
236
|
|
|
237
237
|
/**
|
|
238
238
|
*/
|
|
239
|
-
export const getAllFinishedModels = createSelector(state => state.modularui, modularui => {
|
|
239
|
+
export const getAllFinishedModels = createSelector([state => state.modularui, state => state.i18n.locale], (modularui, locale) => {
|
|
240
240
|
if (modularui) {
|
|
241
241
|
var _context0, _context1;
|
|
242
|
-
return _mapInstanceProperty(_context0 = _filterInstanceProperty(_context1 = _Object$keys(modularui)).call(_context1, key =>
|
|
242
|
+
return _mapInstanceProperty(_context0 = _filterInstanceProperty(_context1 = _Object$keys(modularui)).call(_context1, key => {
|
|
243
|
+
if (modularui[key]) {
|
|
244
|
+
const item = modularui[key];
|
|
245
|
+
return item.status === MODULARUI_STATUS.FINISHED && item.model?.locale === locale;
|
|
246
|
+
}
|
|
247
|
+
return false;
|
|
248
|
+
})).call(_context0, key => modularui[key].model);
|
|
243
249
|
}
|
|
244
250
|
return [];
|
|
245
251
|
});
|
|
@@ -305,15 +305,20 @@ export const getModelsByType = (
|
|
|
305
305
|
export const getAllFinishedModels: (
|
|
306
306
|
state: ReduxState,
|
|
307
307
|
) => Array<ModularUIModel> = createSelector(
|
|
308
|
-
(state
|
|
309
|
-
(modularui): Array<ModularUIModel> => {
|
|
308
|
+
[(state) => state.modularui, (state) => state.i18n.locale],
|
|
309
|
+
(modularui, locale): Array<ModularUIModel> => {
|
|
310
310
|
if (modularui) {
|
|
311
311
|
return Object.keys(modularui)
|
|
312
|
-
.filter(
|
|
313
|
-
(key)
|
|
314
|
-
modularui[key]
|
|
315
|
-
|
|
316
|
-
|
|
312
|
+
.filter((key) => {
|
|
313
|
+
if (modularui[key]) {
|
|
314
|
+
const item = modularui[key];
|
|
315
|
+
return (
|
|
316
|
+
item.status === MODULARUI_STATUS.FINISHED &&
|
|
317
|
+
item.model?.locale === locale
|
|
318
|
+
);
|
|
319
|
+
}
|
|
320
|
+
return false;
|
|
321
|
+
})
|
|
317
322
|
.map((key) => modularui[key].model);
|
|
318
323
|
}
|
|
319
324
|
return [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModularUISelectors.js","names":["createSelector","createSelectorCreator","defaultMemoize","has","Href","ContentModel","ContentTOCModel","ApplicationModel","TabModel","CaseViewModel","FormModel","MODULARUI_STATUS","getAllModelsByInstance","state","instance","locale","i18n","modularui","_context","_context2","_mapInstanceProperty","_filterInstanceProperty","_Object$keys","call","key","model","getFirstModelByInstance","_context3","foundKey","_findInstanceProperty","entry","isInstance","localeMatches","getActiveModelByInstance","location","getLocation","_context4","_startsWithInstanceProperty","selfhref","path","getApplication","getTab","getCaseView","getForm","modelByHref","href","_context5","findHref","modelConfigKey","equals","keyByHref","_context6","allKeysByHref","_context7","router","pathname","getModels","models","forEach","modelKey","modelEntry","label","type","modelInfo","selfContentLink","push","getActiveModels","value","other","_JSON$stringify","contextModels","locationParts","split","reduce","accumulator","current","comparePath","decodeURIComponent","replace","foundEntry","encodedHref","toString","getPreference","preferenceName","preferences","getModelsByType","_context8","_context9","getAllFinishedModels","_context0","_context1","status","FINISHED"],"sources":["../../../src/redux/_modularui/ModularUISelectors.js"],"sourcesContent":["// @flow\nimport {\n createSelector,\n createSelectorCreator,\n defaultMemoize,\n} from \"reselect\";\nimport { has } from \"../../utils/helpers/objects\";\n\nimport Href from \"../../models/href/Href\";\nimport ContentModel from \"../../models/content/ContentModel\";\nimport ContentTOCModel from \"../../models/content/ContentTOCModel\";\nimport ApplicationModel from \"../../models/application/ApplicationModel\";\nimport TabModel from \"../../models/tab/TabModel\";\nimport CaseViewModel from \"../../models/caseview/CaseViewModel\";\nimport FormModel from \"../../models/form/FormModel\";\n\nimport type { ReduxState, PreferenceValue } from \"../types\";\nimport type { ModularUIModel } from \"../../models/types\";\nimport { MODULARUI_STATUS } from \"../../constants\";\n\n/**\n */\nexport const getAllModelsByInstance = <T>(\n state: ReduxState,\n instance: Class<T>,\n): Array<ModularUIModel> => {\n const locale = state?.i18n?.locale || \"en\";\n const modularui = state?.modularui;\n\n if (modularui) {\n return Object.keys(modularui)\n .filter((key) => {\n const { model } = modularui[key];\n return model instanceof instance && model.locale === locale;\n })\n .map((key) => modularui[key].model);\n }\n\n return [];\n};\n\n/**\n */\nexport const getFirstModelByInstance = <T = ModularUIModel>(\n state: ReduxState,\n instance: Class<T>,\n): T | null => {\n const locale = state?.i18n?.locale || \"en\";\n const modularui = state?.modularui;\n\n if (!modularui) return null;\n\n const foundKey = Object.keys(modularui).find((key) => {\n const entry = modularui[key];\n if (!entry || !entry.model) return false;\n\n const isInstance = entry.model instanceof instance;\n const localeMatches = entry.model.locale === locale;\n\n return isInstance && localeMatches;\n });\n\n // $FlowIssue\n return foundKey ? modularui[foundKey].model : null;\n};\n\n/**\n */\nexport const getActiveModelByInstance = <T>(\n state: ReduxState,\n instance: Class<T>,\n): T | null => {\n const location = getLocation(state);\n\n const locale = state?.i18n?.locale || \"en\";\n const modularui = state?.modularui;\n\n if (modularui) {\n const key = Object.keys(modularui).find((key) => {\n const { model } = modularui[key];\n return (\n model instanceof instance &&\n model.locale === locale &&\n location.startsWith(model.selfhref.path)\n );\n });\n\n if (key) {\n const { model } = modularui[key];\n if (model instanceof instance) {\n return model;\n }\n }\n }\n\n return null;\n};\n\n/**\n * Get the application model, which is the model with selfhref '/'\n */\nexport const getApplication = (state: ReduxState): null | ApplicationModel =>\n getFirstModelByInstance(state, ApplicationModel);\n\n/**\n */\nexport const getTab = (state: ReduxState): null | TabModel =>\n getFirstModelByInstance(state, TabModel);\n\n/**\n */\nexport const getCaseView = (state: ReduxState): null | CaseViewModel =>\n getFirstModelByInstance(state, CaseViewModel);\n\n/**\n */\nexport const getForm = (state: ReduxState): null | FormModel =>\n getFirstModelByInstance(state, FormModel);\n\n/**\n * Get the model by it's href\n */\nexport const modelByHref = (\n state: ReduxState,\n href: Href | string,\n): null | ModularUIModel => {\n if (state && state.modularui) {\n const findHref = href instanceof Href ? href : new Href(href);\n\n const modelConfigKey = Object.keys(state.modularui).find((key) => {\n const model = state.modularui[key];\n\n return (\n model.model &&\n model.model.selfhref &&\n model.model.selfhref.equals(findHref)\n );\n });\n\n if (modelConfigKey) {\n return state.modularui[modelConfigKey].model;\n }\n }\n\n return null;\n};\n\n/**\n * Return the key of a model by the selfhref the model is saved in the reducer\n */\nexport const keyByHref = (state: ReduxState, href: Href | string): ?string => {\n if (state && state.modularui) {\n const findHref = href instanceof Href ? href : new Href(href);\n\n return Object.keys(state.modularui).find((key) => {\n const { model } = state.modularui[key];\n return model && model.selfhref && model.selfhref.equals(findHref);\n });\n }\n\n return null;\n};\n\n/**\n * Returns all model keys found in the store, restrict on href\n */\nexport const allKeysByHref = (\n state: ReduxState,\n href: Href | string,\n): Array<string> => {\n if (state && state.modularui) {\n const findHref = href instanceof Href ? href : new Href(href);\n\n return Object.keys(state.modularui).filter((key) => {\n const { model } = state.modularui[key];\n return model && model.selfhref && model.selfhref.equals(findHref);\n });\n }\n\n return [];\n};\n\n/**\n */\nconst getLocation = (state: ReduxState): string =>\n state?.router?.location.pathname;\n\n/**\n */\nconst getModels = (state: ReduxState) => {\n const models = [];\n\n Object.keys(state.modularui).forEach((modelKey: string) => {\n const modelEntry = state.modularui[modelKey];\n\n if (has(modelEntry, \"model\")) {\n const { key, selfhref, label, type } = modelEntry.model;\n\n const modelInfo = {\n key,\n selfhref,\n label,\n type,\n selfContentLink: null,\n };\n\n if (\n modelEntry.model instanceof ContentModel ||\n modelEntry.model instanceof ContentTOCModel\n ) {\n models.push({\n ...modelInfo,\n selfContentLink: modelEntry.model.selfContentLink,\n });\n } else {\n models.push(modelInfo);\n }\n }\n });\n\n return models;\n};\n\nexport const getActiveModels: (state: ReduxState) => Array<{\n key: string,\n href: Href,\n label: string,\n type: string,\n}> = createSelectorCreator(\n defaultMemoize,\n (value, other) => JSON.stringify(value) === JSON.stringify(other),\n)([getLocation, getModels], (location, models) => {\n const contextModels = [];\n\n if (location) {\n const locationParts = location.split(\"/\");\n\n locationParts.reduce((accumulator, current) => {\n const path = `${accumulator}/${current}`;\n\n // Remove modelcatalog part to match breadcrumb parts\n const comparePath = decodeURIComponent(path).replace(\n \"/modelcatalog/\",\n \"/\",\n );\n\n const foundEntry = models.find(\n (model) => model.selfhref && model.selfhref.equals(comparePath),\n );\n\n if (foundEntry) {\n const { key, label, type, selfhref, selfContentLink } = foundEntry;\n\n const href =\n path.startsWith(\"/modelcatalog/\") && selfContentLink\n ? new Href(`/modelcatalog${selfContentLink.encodedHref.toString()}`)\n : selfhref;\n\n contextModels.push({ key, href, label, type });\n }\n\n return path;\n });\n }\n\n return contextModels;\n});\n\n/**\n */\nexport const getPreference = (\n state: ReduxState,\n preferenceName: string,\n): null | PreferenceValue => {\n if (state && state.preferences) {\n return state.preferences[preferenceName];\n }\n\n return null;\n};\n\n/**\n * @deprecated - Use getFirstModelByInstance or the appropriate getter for the model type: getApplication, getTab, etc\n */\nexport const getModelsByType = (\n state: ReduxState,\n type: string,\n): Array<ModularUIModel> => {\n if (state && state.modularui) {\n return Object.keys(state.modularui)\n .filter(\n (key) =>\n state.modularui[key] &&\n state.modularui[key].model &&\n state.modularui[key].model.type === type,\n )\n .map((key) => state.modularui[key].model);\n }\n\n return [];\n};\n\n/**\n */\nexport const getAllFinishedModels: (\n state: ReduxState,\n) => Array<ModularUIModel> = createSelector(\n (state: ReduxState) => state.modularui,\n (modularui): Array<ModularUIModel> => {\n if (modularui) {\n return Object.keys(modularui)\n .filter(\n (key) =>\n modularui[key] &&\n modularui[key].status === MODULARUI_STATUS.FINISHED,\n )\n .map((key) => modularui[key].model);\n }\n return [];\n },\n);\n"],"mappings":";;;;;;AACA,SACEA,cAAc,EACdC,qBAAqB,EACrBC,cAAc,QACT,UAAU;AACjB,SAASC,GAAG,QAAQ,6BAA6B;AAEjD,OAAOC,IAAI,MAAM,wBAAwB;AACzC,OAAOC,YAAY,MAAM,mCAAmC;AAC5D,OAAOC,eAAe,MAAM,sCAAsC;AAClE,OAAOC,gBAAgB,MAAM,2CAA2C;AACxE,OAAOC,QAAQ,MAAM,2BAA2B;AAChD,OAAOC,aAAa,MAAM,qCAAqC;AAC/D,OAAOC,SAAS,MAAM,6BAA6B;AAInD,SAASC,gBAAgB,QAAQ,iBAAiB;;AAElD;AACA;AACA,OAAO,MAAMC,sBAAsB,GAAGA,CACpCC,KAAiB,EACjBC,QAAkB,KACQ;EAC1B,MAAMC,MAAM,GAAGF,KAAK,EAAEG,IAAI,EAAED,MAAM,IAAI,IAAI;EAC1C,MAAME,SAAS,GAAGJ,KAAK,EAAEI,SAAS;EAElC,IAAIA,SAAS,EAAE;IAAA,IAAAC,QAAA,EAAAC,SAAA;IACb,OAAOC,oBAAA,CAAAF,QAAA,GAAAG,uBAAA,CAAAF,SAAA,GAAAG,YAAA,CAAYL,SAAS,CAAC,EAAAM,IAAA,CAAAJ,SAAA,EAClBK,GAAG,IAAK;MACf,MAAM;QAAEC;MAAM,CAAC,GAAGR,SAAS,CAACO,GAAG,CAAC;MAChC,OAAOC,KAAK,YAAYX,QAAQ,IAAIW,KAAK,CAACV,MAAM,KAAKA,MAAM;IAC7D,CAAC,CAAC,EAAAQ,IAAA,CAAAL,QAAA,EACIM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,IAA4B;EACpC,IAAIA,SAAS,EAAE;IAAA,IAAAwE,SAAA,EAAAC,SAAA;IACb,OAAOtE,oBAAA,CAAAqE,SAAA,GAAApE,uBAAA,CAAAqE,SAAA,GAAApE,YAAA,CAAYL,SAAS,CAAC,EAAAM,IAAA,CAAAmE,SAAA,EAExBlE,GAAG,IACFP,SAAS,CAACO,GAAG,CAAC,IACdP,SAAS,CAACO,GAAG,CAAC,CAACmE,MAAM,KAAKhF,gBAAgB,CAACiF,QAC/C,CAAC,EAAArE,IAAA,CAAAkE,SAAA,EACKjE,GAAG,IAAKP,SAAS,CAACO,GAAG,CAAC,CAACC,KAAK,CAAC;EACvC;EACA,OAAO,EAAE;AACX,CACF,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ModularUISelectors.js","names":["createSelector","createSelectorCreator","defaultMemoize","has","Href","ContentModel","ContentTOCModel","ApplicationModel","TabModel","CaseViewModel","FormModel","MODULARUI_STATUS","getAllModelsByInstance","state","instance","locale","i18n","modularui","_context","_context2","_mapInstanceProperty","_filterInstanceProperty","_Object$keys","call","key","model","getFirstModelByInstance","_context3","foundKey","_findInstanceProperty","entry","isInstance","localeMatches","getActiveModelByInstance","location","getLocation","_context4","_startsWithInstanceProperty","selfhref","path","getApplication","getTab","getCaseView","getForm","modelByHref","href","_context5","findHref","modelConfigKey","equals","keyByHref","_context6","allKeysByHref","_context7","router","pathname","getModels","models","forEach","modelKey","modelEntry","label","type","modelInfo","selfContentLink","push","getActiveModels","value","other","_JSON$stringify","contextModels","locationParts","split","reduce","accumulator","current","comparePath","decodeURIComponent","replace","foundEntry","encodedHref","toString","getPreference","preferenceName","preferences","getModelsByType","_context8","_context9","getAllFinishedModels","_context0","_context1","item","status","FINISHED"],"sources":["../../../src/redux/_modularui/ModularUISelectors.js"],"sourcesContent":["// @flow\nimport {\n createSelector,\n createSelectorCreator,\n defaultMemoize,\n} from \"reselect\";\nimport { has } from \"../../utils/helpers/objects\";\n\nimport Href from \"../../models/href/Href\";\nimport ContentModel from \"../../models/content/ContentModel\";\nimport ContentTOCModel from \"../../models/content/ContentTOCModel\";\nimport ApplicationModel from \"../../models/application/ApplicationModel\";\nimport TabModel from \"../../models/tab/TabModel\";\nimport CaseViewModel from \"../../models/caseview/CaseViewModel\";\nimport FormModel from \"../../models/form/FormModel\";\n\nimport type { ReduxState, PreferenceValue } from \"../types\";\nimport type { ModularUIModel } from \"../../models/types\";\nimport { MODULARUI_STATUS } from \"../../constants\";\n\n/**\n */\nexport const getAllModelsByInstance = <T>(\n state: ReduxState,\n instance: Class<T>,\n): Array<ModularUIModel> => {\n const locale = state?.i18n?.locale || \"en\";\n const modularui = state?.modularui;\n\n if (modularui) {\n return Object.keys(modularui)\n .filter((key) => {\n const { model } = modularui[key];\n return model instanceof instance && model.locale === locale;\n })\n .map((key) => modularui[key].model);\n }\n\n return [];\n};\n\n/**\n */\nexport const getFirstModelByInstance = <T = ModularUIModel>(\n state: ReduxState,\n instance: Class<T>,\n): T | null => {\n const locale = state?.i18n?.locale || \"en\";\n const modularui = state?.modularui;\n\n if (!modularui) return null;\n\n const foundKey = Object.keys(modularui).find((key) => {\n const entry = modularui[key];\n if (!entry || !entry.model) return false;\n\n const isInstance = entry.model instanceof instance;\n const localeMatches = entry.model.locale === locale;\n\n return isInstance && localeMatches;\n });\n\n // $FlowIssue\n return foundKey ? modularui[foundKey].model : null;\n};\n\n/**\n */\nexport const getActiveModelByInstance = <T>(\n state: ReduxState,\n instance: Class<T>,\n): T | null => {\n const location = getLocation(state);\n\n const locale = state?.i18n?.locale || \"en\";\n const modularui = state?.modularui;\n\n if (modularui) {\n const key = Object.keys(modularui).find((key) => {\n const { model } = modularui[key];\n return (\n model instanceof instance &&\n model.locale === locale &&\n location.startsWith(model.selfhref.path)\n );\n });\n\n if (key) {\n const { model } = modularui[key];\n if (model instanceof instance) {\n return model;\n }\n }\n }\n\n return null;\n};\n\n/**\n * Get the application model, which is the model with selfhref '/'\n */\nexport const getApplication = (state: ReduxState): null | ApplicationModel =>\n getFirstModelByInstance(state, ApplicationModel);\n\n/**\n */\nexport const getTab = (state: ReduxState): null | TabModel =>\n getFirstModelByInstance(state, TabModel);\n\n/**\n */\nexport const getCaseView = (state: ReduxState): null | CaseViewModel =>\n getFirstModelByInstance(state, CaseViewModel);\n\n/**\n */\nexport const getForm = (state: ReduxState): null | FormModel =>\n getFirstModelByInstance(state, FormModel);\n\n/**\n * Get the model by it's href\n */\nexport const modelByHref = (\n state: ReduxState,\n href: Href | string,\n): null | ModularUIModel => {\n if (state && state.modularui) {\n const findHref = href instanceof Href ? href : new Href(href);\n\n const modelConfigKey = Object.keys(state.modularui).find((key) => {\n const model = state.modularui[key];\n\n return (\n model.model &&\n model.model.selfhref &&\n model.model.selfhref.equals(findHref)\n );\n });\n\n if (modelConfigKey) {\n return state.modularui[modelConfigKey].model;\n }\n }\n\n return null;\n};\n\n/**\n * Return the key of a model by the selfhref the model is saved in the reducer\n */\nexport const keyByHref = (state: ReduxState, href: Href | string): ?string => {\n if (state && state.modularui) {\n const findHref = href instanceof Href ? href : new Href(href);\n\n return Object.keys(state.modularui).find((key) => {\n const { model } = state.modularui[key];\n return model && model.selfhref && model.selfhref.equals(findHref);\n });\n }\n\n return null;\n};\n\n/**\n * Returns all model keys found in the store, restrict on href\n */\nexport const allKeysByHref = (\n state: ReduxState,\n href: Href | string,\n): Array<string> => {\n if (state && state.modularui) {\n const findHref = href instanceof Href ? href : new Href(href);\n\n return Object.keys(state.modularui).filter((key) => {\n const { model } = state.modularui[key];\n return model && model.selfhref && model.selfhref.equals(findHref);\n });\n }\n\n return [];\n};\n\n/**\n */\nconst getLocation = (state: ReduxState): string =>\n state?.router?.location.pathname;\n\n/**\n */\nconst getModels = (state: ReduxState) => {\n const models = [];\n\n Object.keys(state.modularui).forEach((modelKey: string) => {\n const modelEntry = state.modularui[modelKey];\n\n if (has(modelEntry, \"model\")) {\n const { key, selfhref, label, type } = modelEntry.model;\n\n const modelInfo = {\n key,\n selfhref,\n label,\n type,\n selfContentLink: null,\n };\n\n if (\n modelEntry.model instanceof ContentModel ||\n modelEntry.model instanceof ContentTOCModel\n ) {\n models.push({\n ...modelInfo,\n selfContentLink: modelEntry.model.selfContentLink,\n });\n } else {\n models.push(modelInfo);\n }\n }\n });\n\n return models;\n};\n\nexport const getActiveModels: (state: ReduxState) => Array<{\n key: string,\n href: Href,\n label: string,\n type: string,\n}> = createSelectorCreator(\n defaultMemoize,\n (value, other) => JSON.stringify(value) === JSON.stringify(other),\n)([getLocation, getModels], (location, models) => {\n const contextModels = [];\n\n if (location) {\n const locationParts = location.split(\"/\");\n\n locationParts.reduce((accumulator, current) => {\n const path = `${accumulator}/${current}`;\n\n // Remove modelcatalog part to match breadcrumb parts\n const comparePath = decodeURIComponent(path).replace(\n \"/modelcatalog/\",\n \"/\",\n );\n\n const foundEntry = models.find(\n (model) => model.selfhref && model.selfhref.equals(comparePath),\n );\n\n if (foundEntry) {\n const { key, label, type, selfhref, selfContentLink } = foundEntry;\n\n const href =\n path.startsWith(\"/modelcatalog/\") && selfContentLink\n ? new Href(`/modelcatalog${selfContentLink.encodedHref.toString()}`)\n : selfhref;\n\n contextModels.push({ key, href, label, type });\n }\n\n return path;\n });\n }\n\n return contextModels;\n});\n\n/**\n */\nexport const getPreference = (\n state: ReduxState,\n preferenceName: string,\n): null | PreferenceValue => {\n if (state && state.preferences) {\n return state.preferences[preferenceName];\n }\n\n return null;\n};\n\n/**\n * @deprecated - Use getFirstModelByInstance or the appropriate getter for the model type: getApplication, getTab, etc\n */\nexport const getModelsByType = (\n state: ReduxState,\n type: string,\n): Array<ModularUIModel> => {\n if (state && state.modularui) {\n return Object.keys(state.modularui)\n .filter(\n (key) =>\n state.modularui[key] &&\n state.modularui[key].model &&\n state.modularui[key].model.type === type,\n )\n .map((key) => state.modularui[key].model);\n }\n\n return [];\n};\n\n/**\n */\nexport const getAllFinishedModels: (\n state: ReduxState,\n) => Array<ModularUIModel> = createSelector(\n [(state) => state.modularui, (state) => state.i18n.locale],\n (modularui, locale): Array<ModularUIModel> => {\n if (modularui) {\n return Object.keys(modularui)\n .filter((key) => {\n if (modularui[key]) {\n const item = modularui[key];\n return (\n item.status === MODULARUI_STATUS.FINISHED &&\n item.model?.locale === locale\n );\n }\n return false;\n })\n .map((key) => modularui[key].model);\n }\n return [];\n },\n);\n"],"mappings":";;;;;;AACA,SACEA,cAAc,EACdC,qBAAqB,EACrBC,cAAc,QACT,UAAU;AACjB,SAASC,GAAG,QAAQ,6BAA6B;AAEjD,OAAOC,IAAI,MAAM,wBAAwB;AACzC,OAAOC,YAAY,MAAM,mCAAmC;AAC5D,OAAOC,eAAe,MAAM,sCAAsC;AAClE,OAAOC,gBAAgB,MAAM,2CAA2C;AACxE,OAAOC,QAAQ,MAAM,2BAA2B;AAChD,OAAOC,aAAa,MAAM,qCAAqC;AAC/D,OAAOC,SAAS,MAAM,6BAA6B;AAInD,SAASC,gBAAgB,QAAQ,iBAAiB;;AAElD;AACA;AACA,OAAO,MAAMC,sBAAsB,GAAGA,CACpCC,KAAiB,EACjBC,QAAkB,KACQ;EAC1B,MAAMC,MAAM,GAAGF,KAAK,EAAEG,IAAI,EAAED,MAAM,IAAI,IAAI;EAC1C,MAAME,SAAS,GAAGJ,KAAK,EAAEI,SAAS;EAElC,IAAIA,SAAS,EAAE;IAAA,IAAAC,QAAA,EAAAC,SAAA;IACb,OAAOC,oBAAA,CAAAF,QAAA,GAAAG,uBAAA,CAAAF,SAAA,GAAAG,YAAA,CAAYL,SAAS,CAAC,EAAAM,IAAA,CAAAJ,SAAA,EAClBK,GAAG,IAAK;MACf,MAAM;QAAEC;MAAM,CAAC,GAAGR,SAAS,CAACO,GAAG,CAAC;MAChC,OAAOC,KAAK,YAAYX,QAAQ,IAAIW,KAAK,CAACV,MAAM,KAAKA,MAAM;IAC7D,CAAC,CAAC,EAAAQ,IAAA,CAAAL,QAAA,EACIM,GAAG,IAAKP,SAAS,CAACO,GAAG,CAAC,CAACC,KAAK,CAAC;E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