@bigbinary/neeto-integrations-frontend 4.0.35 → 4.0.36
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/app/javascript/src/translations/en.json +2 -1
- package/dist/.ready +1 -1
- package/dist/cjs/index.js +19 -4
- package/dist/cjs/index.js.map +1 -1
- package/dist/index.js +19 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -144,7 +144,8 @@
|
|
|
144
144
|
},
|
|
145
145
|
"disconnectionRibbon": {
|
|
146
146
|
"message_one": "Your <integrations /> integration has been disconnected due to a permission issue. Connect it now.",
|
|
147
|
-
"message_other": "Your <integrations /> integrations have been disconnected due to a permission issue. Connect them now."
|
|
147
|
+
"message_other": "Your <integrations /> integrations have been disconnected due to a permission issue. Connect them now.",
|
|
148
|
+
"non_permission_message_one": "Your <integrations /> integration has been disconnected. Connect it now."
|
|
148
149
|
},
|
|
149
150
|
"google": {
|
|
150
151
|
"connect": {
|
package/dist/.ready
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Built at 2026-05-
|
|
1
|
+
Built at 2026-05-22T14:13:57.210Z
|
package/dist/cjs/index.js
CHANGED
|
@@ -9,6 +9,7 @@ var ramda = require('ramda');
|
|
|
9
9
|
var reactI18next = require('react-i18next');
|
|
10
10
|
var reactRouterDom = require('react-router-dom');
|
|
11
11
|
var useDisconnectionAlertsApi = require('../useDisconnectionAlertsApi-CWMlpOJD.js');
|
|
12
|
+
var i18next = require('i18next');
|
|
12
13
|
var jsxRuntime = require('react/jsx-runtime');
|
|
13
14
|
var Daily = require('./Daily.js');
|
|
14
15
|
var DailyForm = require('./DailyForm.js');
|
|
@@ -37,7 +38,6 @@ require('@bigbinary/neetoui/Alert');
|
|
|
37
38
|
require('@tanstack/react-query');
|
|
38
39
|
require('@bigbinary/neeto-commons-frontend/constants');
|
|
39
40
|
require('axios');
|
|
40
|
-
require('i18next');
|
|
41
41
|
require('../useDailiesApi-CEJPknLb.js');
|
|
42
42
|
require('@bigbinary/neeto-commons-frontend/utils');
|
|
43
43
|
require('@bigbinary/neeto-icons/misc/Daily');
|
|
@@ -64,6 +64,21 @@ require('classnames');
|
|
|
64
64
|
require('../index-dxk7jTL7.js');
|
|
65
65
|
require('../success-CsNvTPBG.js');
|
|
66
66
|
|
|
67
|
+
var getHasOnlyUPIIntegration = function getHasOnlyUPIIntegration(alerts) {
|
|
68
|
+
return alerts.length === 1 && alerts[0].serviceName === "eupi";
|
|
69
|
+
};
|
|
70
|
+
var getDisconnectionRibbonDefaultMessage = function getDisconnectionRibbonDefaultMessage(alerts) {
|
|
71
|
+
return getHasOnlyUPIIntegration(alerts) ? i18next.t("neetoIntegrations.disconnectionRibbon.non_permission_message", {
|
|
72
|
+
count: alerts.length
|
|
73
|
+
}) : i18next.t("neetoIntegrations.disconnectionRibbon.message", {
|
|
74
|
+
count: alerts.length
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
var getDisconnectionRibbonI18nKey = function getDisconnectionRibbonI18nKey(alerts, integrationRouteMap) {
|
|
78
|
+
var hasOnlyUPIIntegration = getHasOnlyUPIIntegration(alerts) && integrationRouteMap.eupi;
|
|
79
|
+
return hasOnlyUPIIntegration ? "neetoIntegrations.disconnectionRibbon.non_permission_message" : "neetoIntegrations.disconnectionRibbon.message";
|
|
80
|
+
};
|
|
81
|
+
|
|
67
82
|
var IntegrationLinks = function IntegrationLinks(_ref) {
|
|
68
83
|
var alerts = _ref.alerts,
|
|
69
84
|
integrationRouteMap = _ref.integrationRouteMap;
|
|
@@ -110,14 +125,14 @@ var DisconnectedIntegrationsRibbon = function DisconnectedIntegrationsRibbon(_re
|
|
|
110
125
|
className: "w-full",
|
|
111
126
|
children: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
|
|
112
127
|
count: knownAlerts.length,
|
|
113
|
-
defaults:
|
|
114
|
-
i18nKey: "neetoIntegrations.disconnectionRibbon.message",
|
|
128
|
+
defaults: getDisconnectionRibbonDefaultMessage(knownAlerts),
|
|
115
129
|
components: {
|
|
116
130
|
integrations: /*#__PURE__*/jsxRuntime.jsx(IntegrationLinks, {
|
|
117
131
|
integrationRouteMap: integrationRouteMap,
|
|
118
132
|
alerts: knownAlerts
|
|
119
133
|
})
|
|
120
|
-
}
|
|
134
|
+
},
|
|
135
|
+
i18nKey: getDisconnectionRibbonI18nKey(knownAlerts, integrationRouteMap)
|
|
121
136
|
})
|
|
122
137
|
})
|
|
123
138
|
});
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../app/javascript/src/components/DisconnectedIntegrationsRibbon/index.jsx"],"sourcesContent":["import { useState } from \"react\";\n\nimport { Tag } from \"neetoui\";\nimport { isEmpty } from \"ramda\";\nimport { Trans, useTranslation } from \"react-i18next\";\nimport { Link } from \"react-router-dom\";\n\nimport { useFetchDisconnectionAlerts } from \"hooks/reactQuery/useDisconnectionAlertsApi\";\n\nconst IntegrationLinks = ({ alerts, integrationRouteMap }) =>\n alerts.map((alert, index) => {\n const { label, path } = integrationRouteMap[alert.serviceName];\n const linkPath = alert.redirectPath || path;\n\n return (\n <span key={alert.id}>\n {index > 0 && \", \"}\n <Link className=\"font-semibold underline\" to={linkPath}>\n {label}\n </Link>\n </span>\n );\n });\n\nconst DisconnectedIntegrationsRibbon = ({ integrationRouteMap = {} }) => {\n const [isClosed, setIsClosed] = useState(false);\n\n useTranslation();\n\n const { data: { disconnectionAlerts: alerts = [] } = {} } =\n useFetchDisconnectionAlerts();\n\n const knownAlerts = alerts.filter(\n alert => integrationRouteMap[alert.serviceName]\n );\n\n if (isClosed || isEmpty(knownAlerts)) return null;\n\n return (\n <Tag\n className=\"neeto-molecules-sticky-ribbon w-full p-2.5 text-center\"\n data-testid=\"disconnected-integrations-ribbon\"\n size=\"large\"\n style=\"warning\"\n onClose={() => setIsClosed(true)}\n >\n <span className=\"w-full\">\n <Trans\n count={knownAlerts.length}\n defaults
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../app/javascript/src/components/DisconnectedIntegrationsRibbon/utils.js","../../app/javascript/src/components/DisconnectedIntegrationsRibbon/index.jsx"],"sourcesContent":["import { t } from \"i18next\";\n\nconst getHasOnlyUPIIntegration = alerts =>\n alerts.length === 1 && alerts[0].serviceName === \"eupi\";\n\nexport const getDisconnectionRibbonDefaultMessage = alerts =>\n getHasOnlyUPIIntegration(alerts)\n ? t(\"neetoIntegrations.disconnectionRibbon.non_permission_message\", {\n count: alerts.length,\n })\n : t(\"neetoIntegrations.disconnectionRibbon.message\", {\n count: alerts.length,\n });\n\nexport const getDisconnectionRibbonI18nKey = (alerts, integrationRouteMap) => {\n const hasOnlyUPIIntegration =\n getHasOnlyUPIIntegration(alerts) && integrationRouteMap.eupi;\n\n return hasOnlyUPIIntegration\n ? \"neetoIntegrations.disconnectionRibbon.non_permission_message\"\n : \"neetoIntegrations.disconnectionRibbon.message\";\n};\n","import { useState } from \"react\";\n\nimport { Tag } from \"neetoui\";\nimport { isEmpty } from \"ramda\";\nimport { Trans, useTranslation } from \"react-i18next\";\nimport { Link } from \"react-router-dom\";\n\nimport { useFetchDisconnectionAlerts } from \"hooks/reactQuery/useDisconnectionAlertsApi\";\n\nimport {\n getDisconnectionRibbonDefaultMessage,\n getDisconnectionRibbonI18nKey,\n} from \"./utils\";\n\nconst IntegrationLinks = ({ alerts, integrationRouteMap }) =>\n alerts.map((alert, index) => {\n const { label, path } = integrationRouteMap[alert.serviceName];\n const linkPath = alert.redirectPath || path;\n\n return (\n <span key={alert.id}>\n {index > 0 && \", \"}\n <Link className=\"font-semibold underline\" to={linkPath}>\n {label}\n </Link>\n </span>\n );\n });\n\nconst DisconnectedIntegrationsRibbon = ({ integrationRouteMap = {} }) => {\n const [isClosed, setIsClosed] = useState(false);\n\n useTranslation();\n\n const { data: { disconnectionAlerts: alerts = [] } = {} } =\n useFetchDisconnectionAlerts();\n\n const knownAlerts = alerts.filter(\n alert => integrationRouteMap[alert.serviceName]\n );\n\n if (isClosed || isEmpty(knownAlerts)) return null;\n\n return (\n <Tag\n className=\"neeto-molecules-sticky-ribbon w-full p-2.5 text-center\"\n data-testid=\"disconnected-integrations-ribbon\"\n size=\"large\"\n style=\"warning\"\n onClose={() => setIsClosed(true)}\n >\n <span className=\"w-full\">\n <Trans\n count={knownAlerts.length}\n defaults={getDisconnectionRibbonDefaultMessage(knownAlerts)}\n components={{\n integrations: (\n <IntegrationLinks\n {...{ integrationRouteMap }}\n alerts={knownAlerts}\n />\n ),\n }}\n i18nKey={getDisconnectionRibbonI18nKey(\n knownAlerts,\n integrationRouteMap\n )}\n />\n </span>\n </Tag>\n );\n};\n\nexport default DisconnectedIntegrationsRibbon;\n"],"names":["getHasOnlyUPIIntegration","alerts","length","serviceName","getDisconnectionRibbonDefaultMessage","t","count","getDisconnectionRibbonI18nKey","integrationRouteMap","hasOnlyUPIIntegration","eupi","IntegrationLinks","_ref","map","alert","index","_integrationRouteMap$","label","path","linkPath","redirectPath","_jsxs","children","_jsx","Link","className","to","id","DisconnectedIntegrationsRibbon","_ref2","_ref2$integrationRout","_useState","useState","_useState2","_slicedToArray","isClosed","setIsClosed","useTranslation","_useFetchDisconnectio","useFetchDisconnectionAlerts","_useFetchDisconnectio2","data","_useFetchDisconnectio3","_useFetchDisconnectio4","disconnectionAlerts","knownAlerts","filter","isEmpty","Tag","size","style","onClose","Trans","defaults","components","integrations","i18nKey"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAMA,wBAAwB,GAAG,SAA3BA,wBAAwBA,CAAGC,MAAM,EAAA;AAAA,EAAA,OACrCA,MAAM,CAACC,MAAM,KAAK,CAAC,IAAID,MAAM,CAAC,CAAC,CAAC,CAACE,WAAW,KAAK,MAAM;AAAA,CAAA;AAElD,IAAMC,oCAAoC,GAAG,SAAvCA,oCAAoCA,CAAGH,MAAM,EAAA;EAAA,OACxD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,QAAA,eAEjCC,cAAA,CAAA,MAAA,EAAA;AAAME,MAAAA,SAAS,EAAC,QAAQ;MAAAH,QAAA,eACtBC,cAAA,CAAC6B,kBAAK,EAAA;QACJ9C,KAAK,EAAEuC,WAAW,CAAC3C,MAAO;AAC1BmD,QAAAA,QAAQ,EAAEjD,oCAAoC,CAACyC,WAAW,CAAE;AAC5DS,QAAAA,UAAU,EAAE;UACVC,YAAY,eACVhC,cAAA,CAACZ,gBAAgB,EAAA;AACTH,YAAAA,mBAAmB,EAAnBA,mBAAmB;AACzBP,YAAAA,MAAM,EAAE4C;WACT;SAEH;AACFW,QAAAA,OAAO,EAAEjD,6BAA6B,CACpCsC,WAAW,EACXrC,mBACF;OACD;KACG;AAAC,GACJ,CAAC;AAEV;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.js
CHANGED
|
@@ -7,6 +7,7 @@ import { isEmpty } from 'ramda';
|
|
|
7
7
|
import { useTranslation, Trans } from 'react-i18next';
|
|
8
8
|
import { Link } from 'react-router-dom';
|
|
9
9
|
import { u as useFetchDisconnectionAlerts } from './useDisconnectionAlertsApi-BOc2pEP_.js';
|
|
10
|
+
import { t } from 'i18next';
|
|
10
11
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
11
12
|
export { default as Daily } from './Daily.js';
|
|
12
13
|
export { default as DailyForm } from './DailyForm.js';
|
|
@@ -35,7 +36,6 @@ import '@bigbinary/neetoui/Alert';
|
|
|
35
36
|
import '@tanstack/react-query';
|
|
36
37
|
import '@bigbinary/neeto-commons-frontend/constants';
|
|
37
38
|
import 'axios';
|
|
38
|
-
import 'i18next';
|
|
39
39
|
import './useDailiesApi-aQmuxf-5.js';
|
|
40
40
|
import '@bigbinary/neeto-commons-frontend/utils';
|
|
41
41
|
import '@bigbinary/neeto-icons/misc/Daily';
|
|
@@ -62,6 +62,21 @@ import 'classnames';
|
|
|
62
62
|
import './index-MS1ts-9f.js';
|
|
63
63
|
import './success-C6rQdhhF.js';
|
|
64
64
|
|
|
65
|
+
var getHasOnlyUPIIntegration = function getHasOnlyUPIIntegration(alerts) {
|
|
66
|
+
return alerts.length === 1 && alerts[0].serviceName === "eupi";
|
|
67
|
+
};
|
|
68
|
+
var getDisconnectionRibbonDefaultMessage = function getDisconnectionRibbonDefaultMessage(alerts) {
|
|
69
|
+
return getHasOnlyUPIIntegration(alerts) ? t("neetoIntegrations.disconnectionRibbon.non_permission_message", {
|
|
70
|
+
count: alerts.length
|
|
71
|
+
}) : t("neetoIntegrations.disconnectionRibbon.message", {
|
|
72
|
+
count: alerts.length
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
var getDisconnectionRibbonI18nKey = function getDisconnectionRibbonI18nKey(alerts, integrationRouteMap) {
|
|
76
|
+
var hasOnlyUPIIntegration = getHasOnlyUPIIntegration(alerts) && integrationRouteMap.eupi;
|
|
77
|
+
return hasOnlyUPIIntegration ? "neetoIntegrations.disconnectionRibbon.non_permission_message" : "neetoIntegrations.disconnectionRibbon.message";
|
|
78
|
+
};
|
|
79
|
+
|
|
65
80
|
var IntegrationLinks = function IntegrationLinks(_ref) {
|
|
66
81
|
var alerts = _ref.alerts,
|
|
67
82
|
integrationRouteMap = _ref.integrationRouteMap;
|
|
@@ -108,14 +123,14 @@ var DisconnectedIntegrationsRibbon = function DisconnectedIntegrationsRibbon(_re
|
|
|
108
123
|
className: "w-full",
|
|
109
124
|
children: /*#__PURE__*/jsx(Trans, {
|
|
110
125
|
count: knownAlerts.length,
|
|
111
|
-
defaults:
|
|
112
|
-
i18nKey: "neetoIntegrations.disconnectionRibbon.message",
|
|
126
|
+
defaults: getDisconnectionRibbonDefaultMessage(knownAlerts),
|
|
113
127
|
components: {
|
|
114
128
|
integrations: /*#__PURE__*/jsx(IntegrationLinks, {
|
|
115
129
|
integrationRouteMap: integrationRouteMap,
|
|
116
130
|
alerts: knownAlerts
|
|
117
131
|
})
|
|
118
|
-
}
|
|
132
|
+
},
|
|
133
|
+
i18nKey: getDisconnectionRibbonI18nKey(knownAlerts, integrationRouteMap)
|
|
119
134
|
})
|
|
120
135
|
})
|
|
121
136
|
});
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../app/javascript/src/components/DisconnectedIntegrationsRibbon/index.jsx"],"sourcesContent":["import { useState } from \"react\";\n\nimport { Tag } from \"neetoui\";\nimport { isEmpty } from \"ramda\";\nimport { Trans, useTranslation } from \"react-i18next\";\nimport { Link } from \"react-router-dom\";\n\nimport { useFetchDisconnectionAlerts } from \"hooks/reactQuery/useDisconnectionAlertsApi\";\n\nconst IntegrationLinks = ({ alerts, integrationRouteMap }) =>\n alerts.map((alert, index) => {\n const { label, path } = integrationRouteMap[alert.serviceName];\n const linkPath = alert.redirectPath || path;\n\n return (\n <span key={alert.id}>\n {index > 0 && \", \"}\n <Link className=\"font-semibold underline\" to={linkPath}>\n {label}\n </Link>\n </span>\n );\n });\n\nconst DisconnectedIntegrationsRibbon = ({ integrationRouteMap = {} }) => {\n const [isClosed, setIsClosed] = useState(false);\n\n useTranslation();\n\n const { data: { disconnectionAlerts: alerts = [] } = {} } =\n useFetchDisconnectionAlerts();\n\n const knownAlerts = alerts.filter(\n alert => integrationRouteMap[alert.serviceName]\n );\n\n if (isClosed || isEmpty(knownAlerts)) return null;\n\n return (\n <Tag\n className=\"neeto-molecules-sticky-ribbon w-full p-2.5 text-center\"\n data-testid=\"disconnected-integrations-ribbon\"\n size=\"large\"\n style=\"warning\"\n onClose={() => setIsClosed(true)}\n >\n <span className=\"w-full\">\n <Trans\n count={knownAlerts.length}\n defaults
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../app/javascript/src/components/DisconnectedIntegrationsRibbon/utils.js","../app/javascript/src/components/DisconnectedIntegrationsRibbon/index.jsx"],"sourcesContent":["import { t } from \"i18next\";\n\nconst getHasOnlyUPIIntegration = alerts =>\n alerts.length === 1 && alerts[0].serviceName === \"eupi\";\n\nexport const getDisconnectionRibbonDefaultMessage = alerts =>\n getHasOnlyUPIIntegration(alerts)\n ? t(\"neetoIntegrations.disconnectionRibbon.non_permission_message\", {\n count: alerts.length,\n })\n : t(\"neetoIntegrations.disconnectionRibbon.message\", {\n count: alerts.length,\n });\n\nexport const getDisconnectionRibbonI18nKey = (alerts, integrationRouteMap) => {\n const hasOnlyUPIIntegration =\n getHasOnlyUPIIntegration(alerts) && integrationRouteMap.eupi;\n\n return hasOnlyUPIIntegration\n ? \"neetoIntegrations.disconnectionRibbon.non_permission_message\"\n : \"neetoIntegrations.disconnectionRibbon.message\";\n};\n","import { useState } from \"react\";\n\nimport { Tag } from \"neetoui\";\nimport { isEmpty } from \"ramda\";\nimport { Trans, useTranslation } from \"react-i18next\";\nimport { Link } from \"react-router-dom\";\n\nimport { useFetchDisconnectionAlerts } from \"hooks/reactQuery/useDisconnectionAlertsApi\";\n\nimport {\n getDisconnectionRibbonDefaultMessage,\n getDisconnectionRibbonI18nKey,\n} from \"./utils\";\n\nconst IntegrationLinks = ({ alerts, integrationRouteMap }) =>\n alerts.map((alert, index) => {\n const { label, path } = integrationRouteMap[alert.serviceName];\n const linkPath = alert.redirectPath || path;\n\n return (\n <span key={alert.id}>\n {index > 0 && \", \"}\n <Link className=\"font-semibold underline\" to={linkPath}>\n {label}\n </Link>\n </span>\n );\n });\n\nconst DisconnectedIntegrationsRibbon = ({ integrationRouteMap = {} }) => {\n const [isClosed, setIsClosed] = useState(false);\n\n useTranslation();\n\n const { data: { disconnectionAlerts: alerts = [] } = {} } =\n useFetchDisconnectionAlerts();\n\n const knownAlerts = alerts.filter(\n alert => integrationRouteMap[alert.serviceName]\n );\n\n if (isClosed || isEmpty(knownAlerts)) return null;\n\n return (\n <Tag\n className=\"neeto-molecules-sticky-ribbon w-full p-2.5 text-center\"\n data-testid=\"disconnected-integrations-ribbon\"\n size=\"large\"\n style=\"warning\"\n onClose={() => setIsClosed(true)}\n >\n <span className=\"w-full\">\n <Trans\n count={knownAlerts.length}\n defaults={getDisconnectionRibbonDefaultMessage(knownAlerts)}\n components={{\n integrations: (\n <IntegrationLinks\n {...{ integrationRouteMap }}\n alerts={knownAlerts}\n />\n ),\n }}\n i18nKey={getDisconnectionRibbonI18nKey(\n knownAlerts,\n integrationRouteMap\n )}\n />\n </span>\n </Tag>\n );\n};\n\nexport default DisconnectedIntegrationsRibbon;\n"],"names":["getHasOnlyUPIIntegration","alerts","length","serviceName","getDisconnectionRibbonDefaultMessage","t","count","getDisconnectionRibbonI18nKey","integrationRouteMap","hasOnlyUPIIntegration","eupi","IntegrationLinks","_ref","map","alert","index","_integrationRouteMap$","label","path","linkPath","redirectPath","_jsxs","children","_jsx","Link","className","to","id","DisconnectedIntegrationsRibbon","_ref2","_ref2$integrationRout","_useState","useState","_useState2","_slicedToArray","isClosed","setIsClosed","useTranslation","_useFetchDisconnectio","useFetchDisconnectionAlerts","_useFetchDisconnectio2","data","_useFetchDisconnectio3","_useFetchDisconnectio4","disconnectionAlerts","knownAlerts","filter","isEmpty","Tag","size","style","onClose","Trans","defaults","components","integrations","i18nKey"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAMA,wBAAwB,GAAG,SAA3BA,wBAAwBA,CAAGC,MAAM,EAAA;AAAA,EAAA,OACrCA,MAAM,CAACC,MAAM,KAAK,CAAC,IAAID,MAAM,CAAC,CAAC,CAAC,CAACE,WAAW,KAAK,MAAM;AAAA,CAAA;AAElD,IAAMC,oCAAoC,GAAG,SAAvCA,oCAAoCA,CAAGH,MAAM,EAAA;EAAA,OACxDD,wBAAwB,CAACC,MAAM,CAAC,GAC5BI,CAAC,CAAC,8DAA8D,EAAE;IAChEC,KAAK,EAAEL,MAAM,CAACC;AAChB,GAAC,CAAC,GACFG,CAAC,CAAC,+CAA+C,EAAE;IACjDC,KAAK,EAAEL,MAAM,CAACC;AAChB,GAAC,CAAC;AAAA,CAAA;AAED,IAAMK,6BAA6B,GAAG,SAAhCA,6BAA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