@fgv/ts-res-ui-components 5.0.0-10
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/.rush/temp/03c8b056281d9db0a97d8a6e25eea798a160d393.tar.log +271 -0
- package/.rush/temp/chunked-rush-logs/ts-res-ui-components.build.chunks.jsonl +9 -0
- package/.rush/temp/operation/build/all.log +9 -0
- package/.rush/temp/operation/build/log-chunks.jsonl +9 -0
- package/.rush/temp/operation/build/state.json +3 -0
- package/.rush/temp/shrinkwrap-deps.json +1111 -0
- package/README.md +18 -0
- package/REFACTORING_PLAN.md +171 -0
- package/config/jest.config.json +16 -0
- package/config/jest.setup.js +64 -0
- package/config/rig.json +16 -0
- package/lib/components/common/QualifierContextControl.d.ts +14 -0
- package/lib/components/common/QualifierContextControl.d.ts.map +1 -0
- package/lib/components/common/QualifierContextControl.js +78 -0
- package/lib/components/common/QualifierContextControl.js.map +1 -0
- package/lib/components/common/ResourceListView.d.ts +11 -0
- package/lib/components/common/ResourceListView.d.ts.map +1 -0
- package/lib/components/common/ResourceListView.js +20 -0
- package/lib/components/common/ResourceListView.js.map +1 -0
- package/lib/components/common/ResourceTreeView.d.ts +12 -0
- package/lib/components/common/ResourceTreeView.d.ts.map +1 -0
- package/lib/components/common/ResourceTreeView.js +162 -0
- package/lib/components/common/ResourceTreeView.js.map +1 -0
- package/lib/components/forms/HierarchyEditor.d.ts +10 -0
- package/lib/components/forms/HierarchyEditor.d.ts.map +1 -0
- package/lib/components/forms/HierarchyEditor.js +106 -0
- package/lib/components/forms/HierarchyEditor.js.map +1 -0
- package/lib/components/forms/QualifierEditForm.d.ts +11 -0
- package/lib/components/forms/QualifierEditForm.d.ts.map +1 -0
- package/lib/components/forms/QualifierEditForm.js +181 -0
- package/lib/components/forms/QualifierEditForm.js.map +1 -0
- package/lib/components/forms/QualifierTypeEditForm.d.ts +10 -0
- package/lib/components/forms/QualifierTypeEditForm.d.ts.map +1 -0
- package/lib/components/forms/QualifierTypeEditForm.js +172 -0
- package/lib/components/forms/QualifierTypeEditForm.js.map +1 -0
- package/lib/components/forms/ResourceTypeEditForm.d.ts +10 -0
- package/lib/components/forms/ResourceTypeEditForm.d.ts.map +1 -0
- package/lib/components/forms/ResourceTypeEditForm.js +188 -0
- package/lib/components/forms/ResourceTypeEditForm.js.map +1 -0
- package/lib/components/forms/index.d.ts +9 -0
- package/lib/components/forms/index.d.ts.map +1 -0
- package/lib/components/forms/index.js +5 -0
- package/lib/components/forms/index.js.map +1 -0
- package/lib/components/orchestrator/ResourceOrchestrator.d.ts +14 -0
- package/lib/components/orchestrator/ResourceOrchestrator.d.ts.map +1 -0
- package/lib/components/orchestrator/ResourceOrchestrator.js +278 -0
- package/lib/components/orchestrator/ResourceOrchestrator.js.map +1 -0
- package/lib/components/views/CompiledView/index.d.ts +5 -0
- package/lib/components/views/CompiledView/index.d.ts.map +1 -0
- package/lib/components/views/CompiledView/index.js +595 -0
- package/lib/components/views/CompiledView/index.js.map +1 -0
- package/lib/components/views/ConfigurationView/index.d.ts +5 -0
- package/lib/components/views/ConfigurationView/index.d.ts.map +1 -0
- package/lib/components/views/ConfigurationView/index.js +363 -0
- package/lib/components/views/ConfigurationView/index.js.map +1 -0
- package/lib/components/views/FilterView/index.d.ts +5 -0
- package/lib/components/views/FilterView/index.d.ts.map +1 -0
- package/lib/components/views/FilterView/index.js +463 -0
- package/lib/components/views/FilterView/index.js.map +1 -0
- package/lib/components/views/ImportView/index.d.ts +5 -0
- package/lib/components/views/ImportView/index.d.ts.map +1 -0
- package/lib/components/views/ImportView/index.js +514 -0
- package/lib/components/views/ImportView/index.js.map +1 -0
- package/lib/components/views/ResolutionView/EditableJsonView.d.ts +21 -0
- package/lib/components/views/ResolutionView/EditableJsonView.d.ts.map +1 -0
- package/lib/components/views/ResolutionView/EditableJsonView.js +109 -0
- package/lib/components/views/ResolutionView/EditableJsonView.js.map +1 -0
- package/lib/components/views/ResolutionView/ResolutionEditControls.d.ts +19 -0
- package/lib/components/views/ResolutionView/ResolutionEditControls.d.ts.map +1 -0
- package/lib/components/views/ResolutionView/ResolutionEditControls.js +82 -0
- package/lib/components/views/ResolutionView/ResolutionEditControls.js.map +1 -0
- package/lib/components/views/ResolutionView/index.d.ts +5 -0
- package/lib/components/views/ResolutionView/index.d.ts.map +1 -0
- package/lib/components/views/ResolutionView/index.js +255 -0
- package/lib/components/views/ResolutionView/index.js.map +1 -0
- package/lib/components/views/SourceView/index.d.ts +5 -0
- package/lib/components/views/SourceView/index.d.ts.map +1 -0
- package/lib/components/views/SourceView/index.js +316 -0
- package/lib/components/views/SourceView/index.js.map +1 -0
- package/lib/components/views/ZipLoaderView/index.d.ts +5 -0
- package/lib/components/views/ZipLoaderView/index.d.ts.map +1 -0
- package/lib/components/views/ZipLoaderView/index.js +313 -0
- package/lib/components/views/ZipLoaderView/index.js.map +1 -0
- package/lib/hooks/useConfigurationState.d.ts +46 -0
- package/lib/hooks/useConfigurationState.d.ts.map +1 -0
- package/lib/hooks/useConfigurationState.js +239 -0
- package/lib/hooks/useConfigurationState.js.map +1 -0
- package/lib/hooks/useFilterState.d.ts +7 -0
- package/lib/hooks/useFilterState.d.ts.map +1 -0
- package/lib/hooks/useFilterState.js +80 -0
- package/lib/hooks/useFilterState.js.map +1 -0
- package/lib/hooks/useResolutionState.d.ts +8 -0
- package/lib/hooks/useResolutionState.d.ts.map +1 -0
- package/lib/hooks/useResolutionState.js +253 -0
- package/lib/hooks/useResolutionState.js.map +1 -0
- package/lib/hooks/useResourceData.d.ts +19 -0
- package/lib/hooks/useResourceData.d.ts.map +1 -0
- package/lib/hooks/useResourceData.js +368 -0
- package/lib/hooks/useResourceData.js.map +1 -0
- package/lib/hooks/useViewState.d.ts +10 -0
- package/lib/hooks/useViewState.d.ts.map +1 -0
- package/lib/hooks/useViewState.js +29 -0
- package/lib/hooks/useViewState.js.map +1 -0
- package/lib/index.d.ts +27 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +34 -0
- package/lib/index.js.map +1 -0
- package/lib/test/helpers/testDataLoader.d.ts +37 -0
- package/lib/test/helpers/testDataLoader.d.ts.map +1 -0
- package/lib/test/helpers/testDataLoader.js +171 -0
- package/lib/test/helpers/testDataLoader.js.map +1 -0
- package/lib/test/unit/utils/configurationUtils.test.d.ts +2 -0
- package/lib/test/unit/utils/configurationUtils.test.d.ts.map +1 -0
- package/lib/test/unit/utils/configurationUtils.test.js +497 -0
- package/lib/test/unit/utils/configurationUtils.test.js.map +1 -0
- package/lib/test/unit/utils/fileProcessing.test.d.ts +2 -0
- package/lib/test/unit/utils/fileProcessing.test.d.ts.map +1 -0
- package/lib/test/unit/utils/fileProcessing.test.js +321 -0
- package/lib/test/unit/utils/fileProcessing.test.js.map +1 -0
- package/lib/test/unit/utils/filterResources.test.d.ts +2 -0
- package/lib/test/unit/utils/filterResources.test.d.ts.map +1 -0
- package/lib/test/unit/utils/filterResources.test.js +403 -0
- package/lib/test/unit/utils/filterResources.test.js.map +1 -0
- package/lib/test/unit/utils/resolutionEditing.test.d.ts +2 -0
- package/lib/test/unit/utils/resolutionEditing.test.d.ts.map +1 -0
- package/lib/test/unit/utils/resolutionEditing.test.js +439 -0
- package/lib/test/unit/utils/resolutionEditing.test.js.map +1 -0
- package/lib/test/unit/utils/resolutionUtils.test.d.ts +2 -0
- package/lib/test/unit/utils/resolutionUtils.test.d.ts.map +1 -0
- package/lib/test/unit/utils/resolutionUtils.test.js +397 -0
- package/lib/test/unit/utils/resolutionUtils.test.js.map +1 -0
- package/lib/test/unit/utils/tsResIntegration.test.d.ts +2 -0
- package/lib/test/unit/utils/tsResIntegration.test.d.ts.map +1 -0
- package/lib/test/unit/utils/tsResIntegration.test.js +376 -0
- package/lib/test/unit/utils/tsResIntegration.test.js.map +1 -0
- package/lib/types/index.d.ts +251 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index.js +2 -0
- package/lib/types/index.js.map +1 -0
- package/lib/utils/configurationUtils.d.ts +74 -0
- package/lib/utils/configurationUtils.d.ts.map +1 -0
- package/lib/utils/configurationUtils.js +359 -0
- package/lib/utils/configurationUtils.js.map +1 -0
- package/lib/utils/fileProcessing.d.ts +18 -0
- package/lib/utils/fileProcessing.d.ts.map +1 -0
- package/lib/utils/fileProcessing.js +142 -0
- package/lib/utils/fileProcessing.js.map +1 -0
- package/lib/utils/filterResources.d.ts +38 -0
- package/lib/utils/filterResources.d.ts.map +1 -0
- package/lib/utils/filterResources.js +153 -0
- package/lib/utils/filterResources.js.map +1 -0
- package/lib/utils/resolutionEditing.d.ts +58 -0
- package/lib/utils/resolutionEditing.d.ts.map +1 -0
- package/lib/utils/resolutionEditing.js +246 -0
- package/lib/utils/resolutionEditing.js.map +1 -0
- package/lib/utils/resolutionUtils.d.ts +28 -0
- package/lib/utils/resolutionUtils.d.ts.map +1 -0
- package/lib/utils/resolutionUtils.js +216 -0
- package/lib/utils/resolutionUtils.js.map +1 -0
- package/lib/utils/tsResIntegration.d.ts +71 -0
- package/lib/utils/tsResIntegration.d.ts.map +1 -0
- package/lib/utils/tsResIntegration.js +294 -0
- package/lib/utils/tsResIntegration.js.map +1 -0
- package/lib/utils/zipLoader/browserZipLoader.d.ts +48 -0
- package/lib/utils/zipLoader/browserZipLoader.d.ts.map +1 -0
- package/lib/utils/zipLoader/browserZipLoader.js +247 -0
- package/lib/utils/zipLoader/browserZipLoader.js.map +1 -0
- package/lib/utils/zipLoader/index.d.ts +8 -0
- package/lib/utils/zipLoader/index.d.ts.map +1 -0
- package/lib/utils/zipLoader/index.js +13 -0
- package/lib/utils/zipLoader/index.js.map +1 -0
- package/lib/utils/zipLoader/nodeZipBuilder.d.ts +55 -0
- package/lib/utils/zipLoader/nodeZipBuilder.d.ts.map +1 -0
- package/lib/utils/zipLoader/nodeZipBuilder.js +98 -0
- package/lib/utils/zipLoader/nodeZipBuilder.js.map +1 -0
- package/lib/utils/zipLoader/types.d.ts +139 -0
- package/lib/utils/zipLoader/types.d.ts.map +1 -0
- package/lib/utils/zipLoader/types.js +2 -0
- package/lib/utils/zipLoader/types.js.map +1 -0
- package/lib/utils/zipLoader/zipUtils.d.ts +53 -0
- package/lib/utils/zipLoader/zipUtils.d.ts.map +1 -0
- package/lib/utils/zipLoader/zipUtils.js +229 -0
- package/lib/utils/zipLoader/zipUtils.js.map +1 -0
- package/package.json +69 -0
- package/rush-logs/ts-res-ui-components.build.cache.log +3 -0
- package/rush-logs/ts-res-ui-components.build.log +9 -0
- package/src/components/common/QualifierContextControl.tsx +151 -0
- package/src/components/common/ResourceListView.tsx +63 -0
- package/src/components/common/ResourceTreeView.tsx +271 -0
- package/src/components/forms/HierarchyEditor.tsx +204 -0
- package/src/components/forms/QualifierEditForm.tsx +355 -0
- package/src/components/forms/QualifierTypeEditForm.tsx +347 -0
- package/src/components/forms/ResourceTypeEditForm.tsx +331 -0
- package/src/components/forms/index.ts +11 -0
- package/src/components/orchestrator/ResourceOrchestrator.tsx +372 -0
- package/src/components/views/CompiledView/index.tsx +922 -0
- package/src/components/views/ConfigurationView/index.tsx +800 -0
- package/src/components/views/FilterView/index.tsx +825 -0
- package/src/components/views/ImportView/index.tsx +717 -0
- package/src/components/views/ResolutionView/EditableJsonView.tsx +214 -0
- package/src/components/views/ResolutionView/ResolutionEditControls.tsx +170 -0
- package/src/components/views/ResolutionView/index.tsx +591 -0
- package/src/components/views/SourceView/index.tsx +536 -0
- package/src/components/views/ZipLoaderView/index.tsx +485 -0
- package/src/hooks/useConfigurationState.ts +374 -0
- package/src/hooks/useFilterState.ts +97 -0
- package/src/hooks/useResolutionState.ts +355 -0
- package/src/hooks/useResourceData.ts +467 -0
- package/src/hooks/useViewState.ts +44 -0
- package/src/index.ts +45 -0
- package/src/test/helpers/testDataLoader.ts +195 -0
- package/src/test/unit/utils/configurationUtils.test.ts +630 -0
- package/src/test/unit/utils/fileProcessing.test.ts +391 -0
- package/src/test/unit/utils/filterResources.test.ts +574 -0
- package/src/test/unit/utils/resolutionEditing.test.ts +556 -0
- package/src/test/unit/utils/resolutionUtils.test.ts +521 -0
- package/src/test/unit/utils/tsResIntegration.test.ts +433 -0
- package/src/types/index.ts +322 -0
- package/src/utils/configurationUtils.ts +424 -0
- package/src/utils/fileProcessing.ts +160 -0
- package/src/utils/filterResources.ts +206 -0
- package/src/utils/resolutionEditing.ts +319 -0
- package/src/utils/resolutionUtils.ts +289 -0
- package/src/utils/tsResIntegration.ts +440 -0
- package/src/utils/zipLoader/browserZipLoader.ts +319 -0
- package/src/utils/zipLoader/index.ts +26 -0
- package/src/utils/zipLoader/nodeZipBuilder.ts +153 -0
- package/src/utils/zipLoader/types.ts +175 -0
- package/src/utils/zipLoader/zipUtils.ts +266 -0
- package/temp/build/typescript/ts_gZid87Hu.json +1 -0
- package/tsconfig.json +15 -0
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import { Result } from '@fgv/ts-utils';
|
|
2
|
+
import { ResourceJson, Config, Bundle, Resources, Runtime, QualifierTypes, Qualifiers, ResourceTypes, Import } from '@fgv/ts-res';
|
|
3
|
+
import { JsonValue } from '@fgv/ts-json-base';
|
|
4
|
+
export interface Message {
|
|
5
|
+
id: string;
|
|
6
|
+
type: 'info' | 'warning' | 'error' | 'success';
|
|
7
|
+
message: string;
|
|
8
|
+
timestamp: Date;
|
|
9
|
+
}
|
|
10
|
+
export interface FilterState {
|
|
11
|
+
enabled: boolean;
|
|
12
|
+
values: Record<string, string | undefined>;
|
|
13
|
+
appliedValues: Record<string, string | undefined>;
|
|
14
|
+
hasPendingChanges: boolean;
|
|
15
|
+
reduceQualifiers: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface FilterActions {
|
|
18
|
+
updateFilterEnabled: (enabled: boolean) => void;
|
|
19
|
+
updateFilterValues: (values: Record<string, string | undefined>) => void;
|
|
20
|
+
applyFilterValues: () => void;
|
|
21
|
+
resetFilterValues: () => void;
|
|
22
|
+
updateReduceQualifiers: (reduceQualifiers: boolean) => void;
|
|
23
|
+
}
|
|
24
|
+
export interface ProcessedResources {
|
|
25
|
+
system: {
|
|
26
|
+
resourceManager: Resources.ResourceManagerBuilder;
|
|
27
|
+
qualifierTypes: QualifierTypes.ReadOnlyQualifierTypeCollector;
|
|
28
|
+
qualifiers: Qualifiers.IReadOnlyQualifierCollector;
|
|
29
|
+
resourceTypes: ResourceTypes.ReadOnlyResourceTypeCollector;
|
|
30
|
+
importManager: Import.ImportManager;
|
|
31
|
+
contextQualifierProvider: Runtime.ValidatingSimpleContextQualifierProvider;
|
|
32
|
+
};
|
|
33
|
+
compiledCollection: ResourceJson.Compiled.ICompiledResourceCollection;
|
|
34
|
+
resolver: Runtime.ResourceResolver;
|
|
35
|
+
resourceCount: number;
|
|
36
|
+
summary: {
|
|
37
|
+
totalResources: number;
|
|
38
|
+
resourceIds: string[];
|
|
39
|
+
errorCount: number;
|
|
40
|
+
warnings: string[];
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export interface ExtendedProcessedResources extends ProcessedResources {
|
|
44
|
+
activeConfiguration?: Config.Model.ISystemConfiguration | null;
|
|
45
|
+
isLoadedFromBundle?: boolean;
|
|
46
|
+
bundleMetadata?: Bundle.IBundleMetadata | null;
|
|
47
|
+
}
|
|
48
|
+
export interface ResourceManagerState {
|
|
49
|
+
isProcessing: boolean;
|
|
50
|
+
processedResources: ExtendedProcessedResources | null;
|
|
51
|
+
error: string | null;
|
|
52
|
+
hasProcessedData: boolean;
|
|
53
|
+
activeConfiguration: Config.Model.ISystemConfiguration | null;
|
|
54
|
+
isLoadedFromBundle: boolean;
|
|
55
|
+
bundleMetadata: Bundle.IBundleMetadata | null;
|
|
56
|
+
}
|
|
57
|
+
export interface ImportedFile {
|
|
58
|
+
name: string;
|
|
59
|
+
path?: string;
|
|
60
|
+
content: string;
|
|
61
|
+
type?: string;
|
|
62
|
+
}
|
|
63
|
+
export interface ImportedDirectory {
|
|
64
|
+
name: string;
|
|
65
|
+
path?: string;
|
|
66
|
+
files: ImportedFile[];
|
|
67
|
+
subdirectories?: ImportedDirectory[];
|
|
68
|
+
}
|
|
69
|
+
export interface ViewBaseProps {
|
|
70
|
+
onMessage?: (type: Message['type'], message: string) => void;
|
|
71
|
+
className?: string;
|
|
72
|
+
}
|
|
73
|
+
export interface ImportViewProps extends ViewBaseProps {
|
|
74
|
+
onImport?: (data: ImportedDirectory | ImportedFile[]) => void;
|
|
75
|
+
onBundleImport?: (bundle: Bundle.IBundle) => void;
|
|
76
|
+
onZipImport?: (zipFile: File, config?: Config.Model.ISystemConfiguration) => void;
|
|
77
|
+
acceptedFileTypes?: string[];
|
|
78
|
+
}
|
|
79
|
+
export interface SourceViewProps extends ViewBaseProps {
|
|
80
|
+
resources?: ExtendedProcessedResources | null;
|
|
81
|
+
selectedResourceId?: string | null;
|
|
82
|
+
onResourceSelect?: (resourceId: string) => void;
|
|
83
|
+
onExport?: (data: ResourceJson.Compiled.ICompiledResourceCollection, type: 'json') => void;
|
|
84
|
+
}
|
|
85
|
+
export interface FilterViewProps extends ViewBaseProps {
|
|
86
|
+
resources?: ProcessedResources | null;
|
|
87
|
+
filterState: FilterState;
|
|
88
|
+
filterActions: FilterActions;
|
|
89
|
+
filterResult?: FilterResult | null;
|
|
90
|
+
onFilterResult?: (result: FilterResult | null) => void;
|
|
91
|
+
}
|
|
92
|
+
export interface CompiledViewProps extends ViewBaseProps {
|
|
93
|
+
resources?: ExtendedProcessedResources | null;
|
|
94
|
+
filterState?: FilterState;
|
|
95
|
+
filterResult?: FilterResult | null;
|
|
96
|
+
useNormalization?: boolean;
|
|
97
|
+
onExport?: (data: ResourceJson.Compiled.ICompiledResourceCollection | Bundle.IBundle, type: 'json' | 'bundle') => void;
|
|
98
|
+
}
|
|
99
|
+
export interface ResolutionViewProps extends ViewBaseProps {
|
|
100
|
+
resources?: ProcessedResources | null;
|
|
101
|
+
filterState?: FilterState;
|
|
102
|
+
filterResult?: FilterResult | null;
|
|
103
|
+
resolutionState?: ResolutionState;
|
|
104
|
+
resolutionActions?: ResolutionActions;
|
|
105
|
+
availableQualifiers?: string[];
|
|
106
|
+
}
|
|
107
|
+
export interface EditedResourceInfo {
|
|
108
|
+
resourceId: string;
|
|
109
|
+
originalValue: JsonValue;
|
|
110
|
+
editedValue: JsonValue;
|
|
111
|
+
timestamp: Date;
|
|
112
|
+
}
|
|
113
|
+
export interface ResolutionState {
|
|
114
|
+
contextValues: Record<string, string | undefined>;
|
|
115
|
+
pendingContextValues: Record<string, string | undefined>;
|
|
116
|
+
selectedResourceId: string | null;
|
|
117
|
+
currentResolver: Runtime.ResourceResolver | null;
|
|
118
|
+
resolutionResult: ResolutionResult | null;
|
|
119
|
+
viewMode: 'composed' | 'best' | 'all' | 'raw';
|
|
120
|
+
hasPendingChanges: boolean;
|
|
121
|
+
editedResources: Map<string, JsonValue>;
|
|
122
|
+
hasUnsavedEdits: boolean;
|
|
123
|
+
isApplyingEdits: boolean;
|
|
124
|
+
}
|
|
125
|
+
export interface ResolutionActions {
|
|
126
|
+
updateContextValue: (qualifierName: string, value: string | undefined) => void;
|
|
127
|
+
applyContext: () => void;
|
|
128
|
+
selectResource: (resourceId: string) => void;
|
|
129
|
+
setViewMode: (mode: 'composed' | 'best' | 'all' | 'raw') => void;
|
|
130
|
+
resetCache: () => void;
|
|
131
|
+
saveEdit: (resourceId: string, editedValue: JsonValue, originalValue?: JsonValue) => void;
|
|
132
|
+
getEditedValue: (resourceId: string) => JsonValue | undefined;
|
|
133
|
+
hasEdit: (resourceId: string) => boolean;
|
|
134
|
+
clearEdits: () => void;
|
|
135
|
+
applyEdits: () => Promise<void>;
|
|
136
|
+
discardEdits: () => void;
|
|
137
|
+
}
|
|
138
|
+
export interface ResolutionResult {
|
|
139
|
+
success: boolean;
|
|
140
|
+
resourceId: string;
|
|
141
|
+
resource?: Runtime.IResource;
|
|
142
|
+
bestCandidate?: Runtime.IResourceCandidate;
|
|
143
|
+
allCandidates?: readonly Runtime.IResourceCandidate[];
|
|
144
|
+
candidateDetails?: CandidateInfo[];
|
|
145
|
+
composedValue?: JsonValue;
|
|
146
|
+
error?: string;
|
|
147
|
+
}
|
|
148
|
+
export interface CandidateInfo {
|
|
149
|
+
candidate: Runtime.IResourceCandidate;
|
|
150
|
+
conditionSetKey: string | null;
|
|
151
|
+
candidateIndex: number;
|
|
152
|
+
matched: boolean;
|
|
153
|
+
matchType: 'match' | 'matchAsDefault' | 'noMatch';
|
|
154
|
+
isDefaultMatch: boolean;
|
|
155
|
+
conditionEvaluations?: ConditionEvaluationResult[];
|
|
156
|
+
}
|
|
157
|
+
export interface ConditionEvaluationResult {
|
|
158
|
+
qualifierName: string;
|
|
159
|
+
qualifierValue: string | undefined;
|
|
160
|
+
conditionValue: string | undefined;
|
|
161
|
+
operator: string;
|
|
162
|
+
score: number;
|
|
163
|
+
matched: boolean;
|
|
164
|
+
matchType: 'match' | 'matchAsDefault' | 'noMatch';
|
|
165
|
+
scoreAsDefault?: number;
|
|
166
|
+
conditionIndex: number;
|
|
167
|
+
}
|
|
168
|
+
export interface ConfigurationViewProps extends ViewBaseProps {
|
|
169
|
+
configuration?: Config.Model.ISystemConfiguration | null;
|
|
170
|
+
onConfigurationChange?: (config: Config.Model.ISystemConfiguration) => void;
|
|
171
|
+
onSave?: (config: Config.Model.ISystemConfiguration) => void;
|
|
172
|
+
hasUnsavedChanges?: boolean;
|
|
173
|
+
}
|
|
174
|
+
export interface ZipLoaderViewProps extends ViewBaseProps {
|
|
175
|
+
zipFileUrl?: string;
|
|
176
|
+
zipPath?: string;
|
|
177
|
+
onImport?: (data: ImportedDirectory | ImportedFile[]) => void;
|
|
178
|
+
onConfigurationLoad?: (config: Config.Model.ISystemConfiguration) => void;
|
|
179
|
+
onLoadComplete?: () => void;
|
|
180
|
+
}
|
|
181
|
+
export interface ResourceDetailData {
|
|
182
|
+
id: string;
|
|
183
|
+
resourceType: string;
|
|
184
|
+
candidateCount: number;
|
|
185
|
+
candidates: Array<{
|
|
186
|
+
json: JsonValue;
|
|
187
|
+
conditions: Array<{
|
|
188
|
+
qualifier: string;
|
|
189
|
+
operator: string;
|
|
190
|
+
value: string;
|
|
191
|
+
priority: number;
|
|
192
|
+
scoreAsDefault?: number;
|
|
193
|
+
}>;
|
|
194
|
+
isPartial: boolean;
|
|
195
|
+
mergeMethod: string;
|
|
196
|
+
}>;
|
|
197
|
+
}
|
|
198
|
+
export interface FilteredResource {
|
|
199
|
+
id: string;
|
|
200
|
+
originalCandidateCount: number;
|
|
201
|
+
filteredCandidateCount: number;
|
|
202
|
+
hasWarning: boolean;
|
|
203
|
+
}
|
|
204
|
+
export interface FilterResult {
|
|
205
|
+
success: boolean;
|
|
206
|
+
processedResources?: ProcessedResources;
|
|
207
|
+
filteredResources?: FilteredResource[];
|
|
208
|
+
warnings?: string[];
|
|
209
|
+
error?: string;
|
|
210
|
+
}
|
|
211
|
+
export interface OrchestratorState {
|
|
212
|
+
resources: ExtendedProcessedResources | null;
|
|
213
|
+
configuration: Config.Model.ISystemConfiguration | null;
|
|
214
|
+
filterState: FilterState;
|
|
215
|
+
filterResult: FilterResult | null;
|
|
216
|
+
resolutionState: ResolutionState;
|
|
217
|
+
selectedResourceId: string | null;
|
|
218
|
+
isProcessing: boolean;
|
|
219
|
+
error: string | null;
|
|
220
|
+
messages: Message[];
|
|
221
|
+
}
|
|
222
|
+
export interface OrchestratorActions {
|
|
223
|
+
importDirectory: (directory: ImportedDirectory) => Promise<void>;
|
|
224
|
+
importDirectoryWithConfig: (directory: ImportedDirectory, config: Config.Model.ISystemConfiguration) => Promise<void>;
|
|
225
|
+
importFiles: (files: ImportedFile[]) => Promise<void>;
|
|
226
|
+
importBundle: (bundle: Bundle.IBundle) => Promise<void>;
|
|
227
|
+
clearResources: () => void;
|
|
228
|
+
updateConfiguration: (config: Config.Model.ISystemConfiguration) => void;
|
|
229
|
+
applyConfiguration: (config: Config.Model.ISystemConfiguration) => void;
|
|
230
|
+
updateFilterState: (state: Partial<FilterState>) => void;
|
|
231
|
+
applyFilter: () => Promise<FilterResult | null>;
|
|
232
|
+
resetFilter: () => void;
|
|
233
|
+
updateResolutionContext: (qualifierName: string, value: string | undefined) => void;
|
|
234
|
+
applyResolutionContext: () => void;
|
|
235
|
+
selectResourceForResolution: (resourceId: string) => void;
|
|
236
|
+
setResolutionViewMode: (mode: 'composed' | 'best' | 'all' | 'raw') => void;
|
|
237
|
+
resetResolutionCache: () => void;
|
|
238
|
+
saveResourceEdit: (resourceId: string, editedValue: JsonValue, originalValue?: JsonValue) => void;
|
|
239
|
+
getEditedValue: (resourceId: string) => JsonValue | undefined;
|
|
240
|
+
hasResourceEdit: (resourceId: string) => boolean;
|
|
241
|
+
clearResourceEdits: () => void;
|
|
242
|
+
applyResourceEdits: () => Promise<void>;
|
|
243
|
+
discardResourceEdits: () => void;
|
|
244
|
+
selectResource: (resourceId: string | null) => void;
|
|
245
|
+
addMessage: (type: Message['type'], message: string) => void;
|
|
246
|
+
clearMessages: () => void;
|
|
247
|
+
resolveResource: (resourceId: string, context?: Record<string, string>) => Promise<Result<JsonValue>>;
|
|
248
|
+
}
|
|
249
|
+
export type { Result } from '@fgv/ts-utils';
|
|
250
|
+
export type { JsonValue } from '@fgv/ts-json-base';
|
|
251
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EACL,YAAY,EACZ,MAAM,EACN,MAAM,EACN,SAAS,EACT,OAAO,EACP,cAAc,EACd,UAAU,EACV,aAAa,EACb,MAAM,EACP,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAG9C,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;IAC/C,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,IAAI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CAAC;IACjD,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAC/B,kBAAkB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACxC,oBAAoB,EAAE,MAAM,IAAI,CAAC;IAGjC,cAAc,EAAE,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACpD,UAAU,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7D,aAAa,EAAE,MAAM,IAAI,CAAC;IAG1B,eAAe,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;CACvG;AAGD,YAAY,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"","sourcesContent":["import { Result } from '@fgv/ts-utils';\nimport {\n ResourceJson,\n Config,\n Bundle,\n Resources,\n Runtime,\n QualifierTypes,\n Qualifiers,\n ResourceTypes,\n Import\n} from '@fgv/ts-res';\nimport { JsonValue } from '@fgv/ts-json-base';\n\n// Message system types\nexport interface Message {\n id: string;\n type: 'info' | 'warning' | 'error' | 'success';\n message: string;\n timestamp: Date;\n}\n\n// Filter state management\nexport interface FilterState {\n enabled: boolean;\n values: Record<string, string | undefined>;\n appliedValues: Record<string, string | undefined>;\n hasPendingChanges: boolean;\n reduceQualifiers: boolean;\n}\n\nexport interface FilterActions {\n updateFilterEnabled: (enabled: boolean) => void;\n updateFilterValues: (values: Record<string, string | undefined>) => void;\n applyFilterValues: () => void;\n resetFilterValues: () => void;\n updateReduceQualifiers: (reduceQualifiers: boolean) => void;\n}\n\n// Resource processing types\nexport interface ProcessedResources {\n system: {\n resourceManager: Resources.ResourceManagerBuilder;\n qualifierTypes: QualifierTypes.ReadOnlyQualifierTypeCollector;\n qualifiers: Qualifiers.IReadOnlyQualifierCollector;\n resourceTypes: ResourceTypes.ReadOnlyResourceTypeCollector;\n importManager: Import.ImportManager;\n contextQualifierProvider: Runtime.ValidatingSimpleContextQualifierProvider;\n };\n compiledCollection: ResourceJson.Compiled.ICompiledResourceCollection;\n resolver: Runtime.ResourceResolver;\n resourceCount: number;\n summary: {\n totalResources: number;\n resourceIds: string[];\n errorCount: number;\n warnings: string[];\n };\n}\n\n// Extended processed resources with additional metadata\nexport interface ExtendedProcessedResources extends ProcessedResources {\n activeConfiguration?: Config.Model.ISystemConfiguration | null;\n isLoadedFromBundle?: boolean;\n bundleMetadata?: Bundle.IBundleMetadata | null;\n}\n\n// Resource manager state\nexport interface ResourceManagerState {\n isProcessing: boolean;\n processedResources: ExtendedProcessedResources | null;\n error: string | null;\n hasProcessedData: boolean;\n activeConfiguration: Config.Model.ISystemConfiguration | null;\n isLoadedFromBundle: boolean;\n bundleMetadata: Bundle.IBundleMetadata | null;\n}\n\n// File import types\nexport interface ImportedFile {\n name: string;\n path?: string;\n content: string;\n type?: string;\n}\n\nexport interface ImportedDirectory {\n name: string;\n path?: string;\n files: ImportedFile[];\n subdirectories?: ImportedDirectory[];\n}\n\n// Component prop types for each view\nexport interface ViewBaseProps {\n onMessage?: (type: Message['type'], message: string) => void;\n className?: string;\n}\n\nexport interface ImportViewProps extends ViewBaseProps {\n onImport?: (data: ImportedDirectory | ImportedFile[]) => void;\n onBundleImport?: (bundle: Bundle.IBundle) => void;\n onZipImport?: (zipFile: File, config?: Config.Model.ISystemConfiguration) => void; // Pass raw File for FileTree creation\n acceptedFileTypes?: string[];\n}\n\nexport interface SourceViewProps extends ViewBaseProps {\n resources?: ExtendedProcessedResources | null;\n selectedResourceId?: string | null;\n onResourceSelect?: (resourceId: string) => void;\n onExport?: (data: ResourceJson.Compiled.ICompiledResourceCollection, type: 'json') => void;\n}\n\nexport interface FilterViewProps extends ViewBaseProps {\n resources?: ProcessedResources | null;\n filterState: FilterState;\n filterActions: FilterActions;\n filterResult?: FilterResult | null;\n onFilterResult?: (result: FilterResult | null) => void;\n}\n\nexport interface CompiledViewProps extends ViewBaseProps {\n resources?: ExtendedProcessedResources | null;\n filterState?: FilterState;\n filterResult?: FilterResult | null;\n useNormalization?: boolean;\n onExport?: (\n data: ResourceJson.Compiled.ICompiledResourceCollection | Bundle.IBundle,\n type: 'json' | 'bundle'\n ) => void;\n}\n\nexport interface ResolutionViewProps extends ViewBaseProps {\n resources?: ProcessedResources | null;\n filterState?: FilterState;\n filterResult?: FilterResult | null;\n resolutionState?: ResolutionState;\n resolutionActions?: ResolutionActions;\n availableQualifiers?: string[];\n}\n\n// Resolution editing types\nexport interface EditedResourceInfo {\n resourceId: string;\n originalValue: JsonValue;\n editedValue: JsonValue;\n timestamp: Date;\n}\n\n// Resolution types\nexport interface ResolutionState {\n contextValues: Record<string, string | undefined>;\n pendingContextValues: Record<string, string | undefined>;\n selectedResourceId: string | null;\n currentResolver: Runtime.ResourceResolver | null;\n resolutionResult: ResolutionResult | null;\n viewMode: 'composed' | 'best' | 'all' | 'raw';\n hasPendingChanges: boolean;\n // Edit state\n editedResources: Map<string, JsonValue>;\n hasUnsavedEdits: boolean;\n isApplyingEdits: boolean;\n}\n\nexport interface ResolutionActions {\n updateContextValue: (qualifierName: string, value: string | undefined) => void;\n applyContext: () => void;\n selectResource: (resourceId: string) => void;\n setViewMode: (mode: 'composed' | 'best' | 'all' | 'raw') => void;\n resetCache: () => void;\n // Edit actions\n saveEdit: (resourceId: string, editedValue: JsonValue, originalValue?: JsonValue) => void;\n getEditedValue: (resourceId: string) => JsonValue | undefined;\n hasEdit: (resourceId: string) => boolean;\n clearEdits: () => void;\n applyEdits: () => Promise<void>;\n discardEdits: () => void;\n}\n\nexport interface ResolutionResult {\n success: boolean;\n resourceId: string;\n resource?: Runtime.IResource;\n bestCandidate?: Runtime.IResourceCandidate;\n allCandidates?: readonly Runtime.IResourceCandidate[];\n candidateDetails?: CandidateInfo[];\n composedValue?: JsonValue;\n error?: string;\n}\n\nexport interface CandidateInfo {\n candidate: Runtime.IResourceCandidate;\n conditionSetKey: string | null;\n candidateIndex: number;\n matched: boolean;\n matchType: 'match' | 'matchAsDefault' | 'noMatch';\n isDefaultMatch: boolean;\n conditionEvaluations?: ConditionEvaluationResult[];\n}\n\nexport interface ConditionEvaluationResult {\n qualifierName: string;\n qualifierValue: string | undefined;\n conditionValue: string | undefined;\n operator: string;\n score: number;\n matched: boolean;\n matchType: 'match' | 'matchAsDefault' | 'noMatch';\n scoreAsDefault?: number;\n conditionIndex: number;\n}\n\nexport interface ConfigurationViewProps extends ViewBaseProps {\n configuration?: Config.Model.ISystemConfiguration | null;\n onConfigurationChange?: (config: Config.Model.ISystemConfiguration) => void;\n onSave?: (config: Config.Model.ISystemConfiguration) => void;\n hasUnsavedChanges?: boolean;\n}\n\nexport interface ZipLoaderViewProps extends ViewBaseProps {\n zipFileUrl?: string;\n zipPath?: string;\n onImport?: (data: ImportedDirectory | ImportedFile[]) => void;\n onConfigurationLoad?: (config: Config.Model.ISystemConfiguration) => void;\n onLoadComplete?: () => void;\n}\n\n// Resource detail types for SourceView\nexport interface ResourceDetailData {\n id: string;\n resourceType: string;\n candidateCount: number;\n candidates: Array<{\n json: JsonValue;\n conditions: Array<{\n qualifier: string;\n operator: string;\n value: string;\n priority: number;\n scoreAsDefault?: number;\n }>;\n isPartial: boolean;\n mergeMethod: string;\n }>;\n}\n\nexport interface FilteredResource {\n id: string;\n originalCandidateCount: number;\n filteredCandidateCount: number;\n hasWarning: boolean;\n}\n\n// Filter result type\nexport interface FilterResult {\n success: boolean;\n processedResources?: ProcessedResources;\n filteredResources?: FilteredResource[];\n warnings?: string[];\n error?: string;\n}\n\n// Orchestrator types\nexport interface OrchestratorState {\n resources: ExtendedProcessedResources | null;\n configuration: Config.Model.ISystemConfiguration | null;\n filterState: FilterState;\n filterResult: FilterResult | null;\n resolutionState: ResolutionState;\n selectedResourceId: string | null;\n isProcessing: boolean;\n error: string | null;\n messages: Message[];\n}\n\nexport interface OrchestratorActions {\n // Resource management\n importDirectory: (directory: ImportedDirectory) => Promise<void>;\n importDirectoryWithConfig: (\n directory: ImportedDirectory,\n config: Config.Model.ISystemConfiguration\n ) => Promise<void>;\n importFiles: (files: ImportedFile[]) => Promise<void>;\n importBundle: (bundle: Bundle.IBundle) => Promise<void>;\n clearResources: () => void;\n\n // Configuration management\n updateConfiguration: (config: Config.Model.ISystemConfiguration) => void;\n applyConfiguration: (config: Config.Model.ISystemConfiguration) => void;\n\n // Filter management\n updateFilterState: (state: Partial<FilterState>) => void;\n applyFilter: () => Promise<FilterResult | null>;\n resetFilter: () => void;\n\n // Resolution management\n updateResolutionContext: (qualifierName: string, value: string | undefined) => void;\n applyResolutionContext: () => void;\n selectResourceForResolution: (resourceId: string) => void;\n setResolutionViewMode: (mode: 'composed' | 'best' | 'all' | 'raw') => void;\n resetResolutionCache: () => void;\n\n // Resolution editing\n saveResourceEdit: (resourceId: string, editedValue: JsonValue, originalValue?: JsonValue) => void;\n getEditedValue: (resourceId: string) => JsonValue | undefined;\n hasResourceEdit: (resourceId: string) => boolean;\n clearResourceEdits: () => void;\n applyResourceEdits: () => Promise<void>;\n discardResourceEdits: () => void;\n\n // UI state management\n selectResource: (resourceId: string | null) => void;\n addMessage: (type: Message['type'], message: string) => void;\n clearMessages: () => void;\n\n // Resource resolution\n resolveResource: (resourceId: string, context?: Record<string, string>) => Promise<Result<JsonValue>>;\n}\n\n// Export utility types\nexport type { Result } from '@fgv/ts-utils';\nexport type { JsonValue } from '@fgv/ts-json-base';\n"]}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Result } from '@fgv/ts-utils';
|
|
2
|
+
import { Config } from '@fgv/ts-res';
|
|
3
|
+
/**
|
|
4
|
+
* Configuration change tracking
|
|
5
|
+
*/
|
|
6
|
+
export interface ConfigurationChanges {
|
|
7
|
+
hasChanges: boolean;
|
|
8
|
+
changedSections: string[];
|
|
9
|
+
timestamp: Date;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Configuration validation result
|
|
13
|
+
*/
|
|
14
|
+
export interface ConfigurationValidationResult {
|
|
15
|
+
isValid: boolean;
|
|
16
|
+
errors: string[];
|
|
17
|
+
warnings: string[];
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Configuration export options
|
|
21
|
+
*/
|
|
22
|
+
export interface ConfigurationExportOptions {
|
|
23
|
+
format: 'json' | 'yaml';
|
|
24
|
+
pretty: boolean;
|
|
25
|
+
includeComments?: boolean;
|
|
26
|
+
filename?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Predefined configuration templates
|
|
30
|
+
*/
|
|
31
|
+
export interface ConfigurationTemplate {
|
|
32
|
+
id: string;
|
|
33
|
+
name: string;
|
|
34
|
+
description: string;
|
|
35
|
+
configuration: Config.Model.ISystemConfiguration;
|
|
36
|
+
category: 'basic' | 'intermediate' | 'advanced' | 'enterprise';
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Default system configuration
|
|
40
|
+
*/
|
|
41
|
+
export declare function getDefaultConfiguration(): Config.Model.ISystemConfiguration;
|
|
42
|
+
/**
|
|
43
|
+
* Validate a system configuration
|
|
44
|
+
*/
|
|
45
|
+
export declare function validateConfiguration(config: Config.Model.ISystemConfiguration): ConfigurationValidationResult;
|
|
46
|
+
/**
|
|
47
|
+
* Create a deep copy of a configuration
|
|
48
|
+
*/
|
|
49
|
+
export declare function cloneConfiguration(config: Config.Model.ISystemConfiguration): Config.Model.ISystemConfiguration;
|
|
50
|
+
/**
|
|
51
|
+
* Compare two configurations for equality
|
|
52
|
+
*/
|
|
53
|
+
export declare function compareConfigurations(config1: Config.Model.ISystemConfiguration, config2: Config.Model.ISystemConfiguration): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Track changes between configurations
|
|
56
|
+
*/
|
|
57
|
+
export declare function trackConfigurationChanges(original: Config.Model.ISystemConfiguration, current: Config.Model.ISystemConfiguration): ConfigurationChanges;
|
|
58
|
+
/**
|
|
59
|
+
* Export configuration to JSON string
|
|
60
|
+
*/
|
|
61
|
+
export declare function exportConfiguration(config: Config.Model.ISystemConfiguration, options?: ConfigurationExportOptions): Result<string>;
|
|
62
|
+
/**
|
|
63
|
+
* Import configuration from JSON string
|
|
64
|
+
*/
|
|
65
|
+
export declare function importConfiguration(data: string): Result<Config.Model.ISystemConfiguration>;
|
|
66
|
+
/**
|
|
67
|
+
* Get predefined configuration templates
|
|
68
|
+
*/
|
|
69
|
+
export declare function getConfigurationTemplates(): ConfigurationTemplate[];
|
|
70
|
+
/**
|
|
71
|
+
* Generate a filename for configuration export
|
|
72
|
+
*/
|
|
73
|
+
export declare function generateConfigurationFilename(configName?: string, format?: 'json' | 'yaml'): string;
|
|
74
|
+
//# sourceMappingURL=configurationUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configurationUtils.d.ts","sourceRoot":"","sources":["../../src/utils/configurationUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAiB,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,MAAM,EAA6C,MAAM,aAAa,CAAC;AAEhF;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,OAAO,CAAC;IACpB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,SAAS,EAAE,IAAI,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC5C,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,MAA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