@rakun-kit/manager-react 1.5.0 → 1.5.2
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/dist/cjs/helpers/get-action-error-message.js +18 -2
- package/dist/cjs/helpers/get-action-error-message.js.map +1 -1
- package/dist/cjs/i18n/catalog.js +11 -0
- package/dist/cjs/i18n/catalog.js.map +1 -1
- package/dist/cjs/router/dashboard/[contentType]/[edit]/_components/EditTabPanels.js +5 -11
- package/dist/cjs/router/dashboard/[contentType]/[edit]/_components/EditTabPanels.js.map +1 -1
- package/dist/cjs/router/dashboard/[contentType]/[edit]/_components/EditToolbar.js +5 -3
- package/dist/cjs/router/dashboard/[contentType]/[edit]/_components/EditToolbar.js.map +1 -1
- package/dist/cjs/router/dashboard/[contentType]/[edit]/_components/ModuleNavigation.js +12 -12
- package/dist/cjs/router/dashboard/[contentType]/[edit]/_components/ModuleNavigation.js.map +1 -1
- package/dist/cjs/router/dashboard/[contentType]/[edit]/_context/EditPageContext.js +94 -57
- package/dist/cjs/router/dashboard/[contentType]/[edit]/_context/EditPageContext.js.map +1 -1
- package/dist/cjs/router/dashboard/[contentType]/[edit]/_fields/ListField/IteratorModulePicker.js +11 -2
- package/dist/cjs/router/dashboard/[contentType]/[edit]/_fields/ListField/IteratorModulePicker.js.map +1 -1
- package/dist/cjs/router/dashboard/[contentType]/[edit]/_fields/ListField/ListUI.js +2 -8
- package/dist/cjs/router/dashboard/[contentType]/[edit]/_fields/ListField/ListUI.js.map +1 -1
- package/dist/cjs/router/dashboard/[contentType]/[edit]/_hooks/useContentDocumentActions.js +10 -11
- package/dist/cjs/router/dashboard/[contentType]/[edit]/_hooks/useContentDocumentActions.js.map +1 -1
- package/dist/cjs/router/dashboard/[contentType]/[edit]/_hooks/useContentPreview.js +9 -3
- package/dist/cjs/router/dashboard/[contentType]/[edit]/_hooks/useContentPreview.js.map +1 -1
- package/dist/cjs/router/dashboard/[contentType]/[edit]/_hooks/useEditTabErrors.js +9 -1
- package/dist/cjs/router/dashboard/[contentType]/[edit]/_hooks/useEditTabErrors.js.map +1 -1
- package/dist/cjs/router/dashboard/[contentType]/[edit]/edit.js +2 -1
- package/dist/cjs/router/dashboard/[contentType]/[edit]/edit.js.map +1 -1
- package/dist/docs/index.md +14 -1
- package/dist/esm/helpers/get-action-error-message.d.ts.map +1 -1
- package/dist/esm/helpers/get-action-error-message.js +18 -2
- package/dist/esm/helpers/get-action-error-message.js.map +1 -1
- package/dist/esm/i18n/catalog.d.ts +15 -0
- package/dist/esm/i18n/catalog.d.ts.map +1 -1
- package/dist/esm/i18n/catalog.js +11 -0
- package/dist/esm/i18n/catalog.js.map +1 -1
- package/dist/esm/router/dashboard/[contentType]/[edit]/_components/EditTabPanels.d.ts.map +1 -1
- package/dist/esm/router/dashboard/[contentType]/[edit]/_components/EditTabPanels.js +5 -11
- package/dist/esm/router/dashboard/[contentType]/[edit]/_components/EditTabPanels.js.map +1 -1
- package/dist/esm/router/dashboard/[contentType]/[edit]/_components/EditToolbar.d.ts.map +1 -1
- package/dist/esm/router/dashboard/[contentType]/[edit]/_components/EditToolbar.js +6 -4
- package/dist/esm/router/dashboard/[contentType]/[edit]/_components/EditToolbar.js.map +1 -1
- package/dist/esm/router/dashboard/[contentType]/[edit]/_components/ModuleNavigation.d.ts +5 -1
- package/dist/esm/router/dashboard/[contentType]/[edit]/_components/ModuleNavigation.d.ts.map +1 -1
- package/dist/esm/router/dashboard/[contentType]/[edit]/_components/ModuleNavigation.js +12 -12
- package/dist/esm/router/dashboard/[contentType]/[edit]/_components/ModuleNavigation.js.map +1 -1
- package/dist/esm/router/dashboard/[contentType]/[edit]/_context/EditPageContext.d.ts +10 -7
- package/dist/esm/router/dashboard/[contentType]/[edit]/_context/EditPageContext.d.ts.map +1 -1
- package/dist/esm/router/dashboard/[contentType]/[edit]/_context/EditPageContext.js +96 -59
- package/dist/esm/router/dashboard/[contentType]/[edit]/_context/EditPageContext.js.map +1 -1
- package/dist/esm/router/dashboard/[contentType]/[edit]/_fields/ListField/IteratorModulePicker.d.ts +2 -0
- package/dist/esm/router/dashboard/[contentType]/[edit]/_fields/ListField/IteratorModulePicker.d.ts.map +1 -1
- package/dist/esm/router/dashboard/[contentType]/[edit]/_fields/ListField/IteratorModulePicker.js +9 -1
- package/dist/esm/router/dashboard/[contentType]/[edit]/_fields/ListField/IteratorModulePicker.js.map +1 -1
- package/dist/esm/router/dashboard/[contentType]/[edit]/_fields/ListField/ListUI.d.ts.map +1 -1
- package/dist/esm/router/dashboard/[contentType]/[edit]/_fields/ListField/ListUI.js +1 -7
- package/dist/esm/router/dashboard/[contentType]/[edit]/_fields/ListField/ListUI.js.map +1 -1
- package/dist/esm/router/dashboard/[contentType]/[edit]/_hooks/useContentDocumentActions.d.ts +3 -5
- package/dist/esm/router/dashboard/[contentType]/[edit]/_hooks/useContentDocumentActions.d.ts.map +1 -1
- package/dist/esm/router/dashboard/[contentType]/[edit]/_hooks/useContentDocumentActions.js +10 -11
- package/dist/esm/router/dashboard/[contentType]/[edit]/_hooks/useContentDocumentActions.js.map +1 -1
- package/dist/esm/router/dashboard/[contentType]/[edit]/_hooks/useContentPreview.d.ts +3 -2
- package/dist/esm/router/dashboard/[contentType]/[edit]/_hooks/useContentPreview.d.ts.map +1 -1
- package/dist/esm/router/dashboard/[contentType]/[edit]/_hooks/useContentPreview.js +9 -3
- package/dist/esm/router/dashboard/[contentType]/[edit]/_hooks/useContentPreview.js.map +1 -1
- package/dist/esm/router/dashboard/[contentType]/[edit]/_hooks/useEditTabErrors.d.ts +7 -1
- package/dist/esm/router/dashboard/[contentType]/[edit]/_hooks/useEditTabErrors.d.ts.map +1 -1
- package/dist/esm/router/dashboard/[contentType]/[edit]/_hooks/useEditTabErrors.js +9 -1
- package/dist/esm/router/dashboard/[contentType]/[edit]/_hooks/useEditTabErrors.js.map +1 -1
- package/dist/esm/router/dashboard/[contentType]/[edit]/_hooks/useRouteLayoutData.d.ts.map +1 -1
- package/dist/esm/router/dashboard/[contentType]/[edit]/edit.d.ts.map +1 -1
- package/dist/esm/router/dashboard/[contentType]/[edit]/edit.js +2 -1
- package/dist/esm/router/dashboard/[contentType]/[edit]/edit.js.map +1 -1
- package/dist/esm/router/dashboard/[contentType]/[edit]/edit.types.d.ts +1 -1
- package/dist/esm/router/dashboard/[contentType]/[edit]/edit.types.d.ts.map +1 -1
- package/dist/styles.css +12 -6
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/dist/cjs/router/dashboard/[contentType]/[edit]/_components/LinkedIteratorControl.js +0 -54
- package/dist/cjs/router/dashboard/[contentType]/[edit]/_components/LinkedIteratorControl.js.map +0 -1
- package/dist/esm/router/dashboard/[contentType]/[edit]/_components/LinkedIteratorControl.d.ts +0 -2
- package/dist/esm/router/dashboard/[contentType]/[edit]/_components/LinkedIteratorControl.d.ts.map +0 -1
- package/dist/esm/router/dashboard/[contentType]/[edit]/_components/LinkedIteratorControl.js +0 -50
- package/dist/esm/router/dashboard/[contentType]/[edit]/_components/LinkedIteratorControl.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rakun-kit/manager-react",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.2",
|
|
4
4
|
"description": "React manager UI and client utilities for Rakun.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"@radix-ui/react-separator": "^1.1.8",
|
|
61
61
|
"@radix-ui/react-slot": "^1.2.4",
|
|
62
62
|
"@radix-ui/react-use-controllable-state": "^1.2.2",
|
|
63
|
-
"@rakun-kit/core": "^1.5.
|
|
63
|
+
"@rakun-kit/core": "^1.5.2",
|
|
64
64
|
"@simplewebauthn/browser": "^13.3.0",
|
|
65
65
|
"@tanstack/react-query": "^5.0.0",
|
|
66
66
|
"@tanstack/react-table": "^8.21.3",
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
'use client';
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.LinkedIteratorControl = void 0;
|
|
5
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
const lucide_react_1 = require("lucide-react");
|
|
7
|
-
const EditPageContext_1 = require("../_context/EditPageContext.js");
|
|
8
|
-
const confirm_1 = require("../../../../../components/confirm/index.js");
|
|
9
|
-
const badge_1 = require("../../../../../components/ui/badge.js");
|
|
10
|
-
const button_1 = require("../../../../../components/ui/button.js");
|
|
11
|
-
const i18n_1 = require("../../../../../i18n/index.js");
|
|
12
|
-
const LinkedIteratorControl = () => {
|
|
13
|
-
const t = (0, i18n_1.useTranslations)();
|
|
14
|
-
const { contentTypeId, contentTypeName, documentActions, linkedIterator } = (0, EditPageContext_1.useEditPageContext)();
|
|
15
|
-
const { state, mode } = linkedIterator;
|
|
16
|
-
const askInitialize = async () => {
|
|
17
|
-
await (0, confirm_1.confirm)({
|
|
18
|
-
title: t('contentEdit.useThisAsSharedTitle'),
|
|
19
|
-
description: t('contentEdit.useThisAsSharedDescription'),
|
|
20
|
-
confirmLabel: t('contentEdit.useSharedStructure'),
|
|
21
|
-
onConfirm: async () => {
|
|
22
|
-
await documentActions.handleInitializeLinkedIterator();
|
|
23
|
-
},
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
const askRelink = async () => {
|
|
27
|
-
if (!(await confirm_1.confirm.yes({
|
|
28
|
-
title: t('contentEdit.useSharedTitle'),
|
|
29
|
-
description: t('contentEdit.useSharedDescription'),
|
|
30
|
-
confirmLabel: t('contentEdit.useSharedStructure'),
|
|
31
|
-
}))) {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
linkedIterator.adoptShared();
|
|
35
|
-
};
|
|
36
|
-
if (!linkedIterator.enabled || !state)
|
|
37
|
-
return null;
|
|
38
|
-
if (!state.configured && mode === 'unlinked') {
|
|
39
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: "mb-5 flex flex-wrap items-center justify-between gap-3 rounded-lg border p-4", children: (0, jsx_runtime_1.jsxs)("div", { className: "space-y-1", children: [(0, jsx_runtime_1.jsxs)(badge_1.Badge, { variant: "secondary", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Unlink, {}), t('contentEdit.localStructure')] }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-muted-foreground", children: t('contentEdit.localStructureUnconfiguredDescription') })] }) }));
|
|
40
|
-
}
|
|
41
|
-
if (!state.configured) {
|
|
42
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "mb-5 flex flex-wrap items-center justify-between gap-3 rounded-lg border border-amber-500/40 bg-amber-500/10 p-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "space-y-1", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-2", children: (0, jsx_runtime_1.jsx)(badge_1.Badge, { variant: "outline", children: t('contentEdit.sharedStructureNotConfigured') }) }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-muted-foreground", children: t('contentEdit.chooseSharedStructureDescription') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-wrap gap-2", children: [contentTypeId ? ((0, jsx_runtime_1.jsxs)(button_1.Button, { variant: "outline", onClick: () => linkedIterator.setMode('unlinked'), children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Unlink, {}), t('contentEdit.keepThisEntryLocal')] })) : null, state.canUpdateShared ? ((0, jsx_runtime_1.jsxs)(button_1.Button, { variant: "outline", onClick: () => void askInitialize(), children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Link2, {}), t('contentEdit.useThisStructure')] })) : ((0, jsx_runtime_1.jsx)("p", { className: "text-sm text-muted-foreground", children: contentTypeId
|
|
43
|
-
? t('contentEdit.updateAnyRequired')
|
|
44
|
-
: t('contentEdit.firstEntryInitializes') }))] })] }));
|
|
45
|
-
}
|
|
46
|
-
if (mode === 'unlinked') {
|
|
47
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "mb-5 flex flex-wrap items-center justify-between gap-3 rounded-lg border p-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "space-y-1", children: [(0, jsx_runtime_1.jsxs)(badge_1.Badge, { variant: "secondary", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Unlink, {}), t('contentEdit.localStructure')] }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-muted-foreground", children: t('contentEdit.localStructureDescription') })] }), (0, jsx_runtime_1.jsxs)(button_1.Button, { variant: "outline", onClick: () => void askRelink(), children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Link2, {}), t('contentEdit.useSharedStructure')] })] }));
|
|
48
|
-
}
|
|
49
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "mb-5 flex flex-wrap items-center justify-between gap-3 rounded-lg border p-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "space-y-1", children: [(0, jsx_runtime_1.jsxs)(badge_1.Badge, { children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Link2, {}), t('contentEdit.sharedStructure')] }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-muted-foreground", children: state.canUpdateShared
|
|
50
|
-
? t('contentEdit.iteratorChangesApply', { contentType: contentTypeName })
|
|
51
|
-
: t('contentEdit.sharedIteratorReadOnly') })] }), contentTypeId ? ((0, jsx_runtime_1.jsxs)(button_1.Button, { variant: "outline", onClick: () => linkedIterator.setMode('unlinked'), children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Unlink, {}), t('contentEdit.unlinkThisEntry')] })) : null] }));
|
|
52
|
-
};
|
|
53
|
-
exports.LinkedIteratorControl = LinkedIteratorControl;
|
|
54
|
-
//# sourceMappingURL=LinkedIteratorControl.js.map
|
package/dist/cjs/router/dashboard/[contentType]/[edit]/_components/LinkedIteratorControl.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LinkedIteratorControl.js","sourceRoot":"","sources":["../../../../../../../src/router/dashbo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[contentType]/[edit]/_components/LinkedIteratorControl.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LinkedIteratorControl.d.ts","sourceRoot":"","sources":["../../../../../../../src/router/dashboard/[contentType]/[edit]/_components/LinkedIteratorControl.tsx"],"names":[],"mappings":"AAWA,eAAO,MAAM,qBAAqB,sDA6HjC,CAAA"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Link2, Unlink } from 'lucide-react';
|
|
4
|
-
import { useEditPageContext } from '../_context/EditPageContext.js';
|
|
5
|
-
import { confirm } from '../../../../../components/confirm/index.js';
|
|
6
|
-
import { Badge } from '../../../../../components/ui/badge.js';
|
|
7
|
-
import { Button } from '../../../../../components/ui/button.js';
|
|
8
|
-
import { useTranslations } from '../../../../../i18n/index.js';
|
|
9
|
-
export const LinkedIteratorControl = () => {
|
|
10
|
-
const t = useTranslations();
|
|
11
|
-
const { contentTypeId, contentTypeName, documentActions, linkedIterator } = useEditPageContext();
|
|
12
|
-
const { state, mode } = linkedIterator;
|
|
13
|
-
const askInitialize = async () => {
|
|
14
|
-
await confirm({
|
|
15
|
-
title: t('contentEdit.useThisAsSharedTitle'),
|
|
16
|
-
description: t('contentEdit.useThisAsSharedDescription'),
|
|
17
|
-
confirmLabel: t('contentEdit.useSharedStructure'),
|
|
18
|
-
onConfirm: async () => {
|
|
19
|
-
await documentActions.handleInitializeLinkedIterator();
|
|
20
|
-
},
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
const askRelink = async () => {
|
|
24
|
-
if (!(await confirm.yes({
|
|
25
|
-
title: t('contentEdit.useSharedTitle'),
|
|
26
|
-
description: t('contentEdit.useSharedDescription'),
|
|
27
|
-
confirmLabel: t('contentEdit.useSharedStructure'),
|
|
28
|
-
}))) {
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
linkedIterator.adoptShared();
|
|
32
|
-
};
|
|
33
|
-
if (!linkedIterator.enabled || !state)
|
|
34
|
-
return null;
|
|
35
|
-
if (!state.configured && mode === 'unlinked') {
|
|
36
|
-
return (_jsx("div", { className: "mb-5 flex flex-wrap items-center justify-between gap-3 rounded-lg border p-4", children: _jsxs("div", { className: "space-y-1", children: [_jsxs(Badge, { variant: "secondary", children: [_jsx(Unlink, {}), t('contentEdit.localStructure')] }), _jsx("p", { className: "text-sm text-muted-foreground", children: t('contentEdit.localStructureUnconfiguredDescription') })] }) }));
|
|
37
|
-
}
|
|
38
|
-
if (!state.configured) {
|
|
39
|
-
return (_jsxs("div", { className: "mb-5 flex flex-wrap items-center justify-between gap-3 rounded-lg border border-amber-500/40 bg-amber-500/10 p-4", children: [_jsxs("div", { className: "space-y-1", children: [_jsx("div", { className: "flex items-center gap-2", children: _jsx(Badge, { variant: "outline", children: t('contentEdit.sharedStructureNotConfigured') }) }), _jsx("p", { className: "text-sm text-muted-foreground", children: t('contentEdit.chooseSharedStructureDescription') })] }), _jsxs("div", { className: "flex flex-wrap gap-2", children: [contentTypeId ? (_jsxs(Button, { variant: "outline", onClick: () => linkedIterator.setMode('unlinked'), children: [_jsx(Unlink, {}), t('contentEdit.keepThisEntryLocal')] })) : null, state.canUpdateShared ? (_jsxs(Button, { variant: "outline", onClick: () => void askInitialize(), children: [_jsx(Link2, {}), t('contentEdit.useThisStructure')] })) : (_jsx("p", { className: "text-sm text-muted-foreground", children: contentTypeId
|
|
40
|
-
? t('contentEdit.updateAnyRequired')
|
|
41
|
-
: t('contentEdit.firstEntryInitializes') }))] })] }));
|
|
42
|
-
}
|
|
43
|
-
if (mode === 'unlinked') {
|
|
44
|
-
return (_jsxs("div", { className: "mb-5 flex flex-wrap items-center justify-between gap-3 rounded-lg border p-4", children: [_jsxs("div", { className: "space-y-1", children: [_jsxs(Badge, { variant: "secondary", children: [_jsx(Unlink, {}), t('contentEdit.localStructure')] }), _jsx("p", { className: "text-sm text-muted-foreground", children: t('contentEdit.localStructureDescription') })] }), _jsxs(Button, { variant: "outline", onClick: () => void askRelink(), children: [_jsx(Link2, {}), t('contentEdit.useSharedStructure')] })] }));
|
|
45
|
-
}
|
|
46
|
-
return (_jsxs("div", { className: "mb-5 flex flex-wrap items-center justify-between gap-3 rounded-lg border p-4", children: [_jsxs("div", { className: "space-y-1", children: [_jsxs(Badge, { children: [_jsx(Link2, {}), t('contentEdit.sharedStructure')] }), _jsx("p", { className: "text-sm text-muted-foreground", children: state.canUpdateShared
|
|
47
|
-
? t('contentEdit.iteratorChangesApply', { contentType: contentTypeName })
|
|
48
|
-
: t('contentEdit.sharedIteratorReadOnly') })] }), contentTypeId ? (_jsxs(Button, { variant: "outline", onClick: () => linkedIterator.setMode('unlinked'), children: [_jsx(Unlink, {}), t('contentEdit.unlinkThisEntry')] })) : null] }));
|
|
49
|
-
};
|
|
50
|
-
//# sourceMappingURL=LinkedIteratorControl.js.map
|
package/dist/esm/router/dashboard/[contentType]/[edit]/_components/LinkedIteratorControl.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LinkedIteratorControl.js","sourceRoot":"","sources":["../../../../../../../src/router/dashboard/[contentType]/[edit]/_components/LinkedIteratorControl.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAE5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AAEhE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAExC,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,EAAE;IACxC,MAAM,CAAC,GAAG,eAAe,EAAE,CAAA;IAC3B,M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