@acorex-platform/module-common-client 0.0.14

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.
Files changed (44) hide show
  1. package/README.md +3 -0
  2. package/fesm2022/acorex-platform-module-common-client-acorex-platform-module-common-client-IHaYrZeE.mjs +6437 -0
  3. package/fesm2022/acorex-platform-module-common-client-acorex-platform-module-common-client-IHaYrZeE.mjs.map +1 -0
  4. package/fesm2022/acorex-platform-module-common-client-archive-entity.command-Dgsmx1_A.mjs +57 -0
  5. package/fesm2022/acorex-platform-module-common-client-archive-entity.command-Dgsmx1_A.mjs.map +1 -0
  6. package/fesm2022/acorex-platform-module-common-client-archive-entity.command.util-CEvlTSlo.mjs +144 -0
  7. package/fesm2022/acorex-platform-module-common-client-archive-entity.command.util-CEvlTSlo.mjs.map +1 -0
  8. package/fesm2022/acorex-platform-module-common-client-audit-info-column.component-DuZUwD31.mjs +158 -0
  9. package/fesm2022/acorex-platform-module-common-client-audit-info-column.component-DuZUwD31.mjs.map +1 -0
  10. package/fesm2022/acorex-platform-module-common-client-audit-info-edit.component-CSsCG6Dz.mjs +127 -0
  11. package/fesm2022/acorex-platform-module-common-client-audit-info-edit.component-CSsCG6Dz.mjs.map +1 -0
  12. package/fesm2022/acorex-platform-module-common-client-audit-info-view.component-WYXsZcLg.mjs +127 -0
  13. package/fesm2022/acorex-platform-module-common-client-audit-info-view.component-WYXsZcLg.mjs.map +1 -0
  14. package/fesm2022/acorex-platform-module-common-client-bulk-archive-entity.command-DZ6VL4oy.mjs +75 -0
  15. package/fesm2022/acorex-platform-module-common-client-bulk-archive-entity.command-DZ6VL4oy.mjs.map +1 -0
  16. package/fesm2022/acorex-platform-module-common-client-bulk-disable-entity.command-0J4vgsFL.mjs +75 -0
  17. package/fesm2022/acorex-platform-module-common-client-bulk-disable-entity.command-0J4vgsFL.mjs.map +1 -0
  18. package/fesm2022/acorex-platform-module-common-client-bulk-enable-entity.command-DsVuaInC.mjs +75 -0
  19. package/fesm2022/acorex-platform-module-common-client-bulk-enable-entity.command-DsVuaInC.mjs.map +1 -0
  20. package/fesm2022/acorex-platform-module-common-client-bulk-restore-archive-entity.command-C-ptvYRp.mjs +75 -0
  21. package/fesm2022/acorex-platform-module-common-client-bulk-restore-archive-entity.command-C-ptvYRp.mjs.map +1 -0
  22. package/fesm2022/acorex-platform-module-common-client-clone-entity.command-CyIAr8bc.mjs +227 -0
  23. package/fesm2022/acorex-platform-module-common-client-clone-entity.command-CyIAr8bc.mjs.map +1 -0
  24. package/fesm2022/acorex-platform-module-common-client-contracts.mjs +128 -0
  25. package/fesm2022/acorex-platform-module-common-client-contracts.mjs.map +1 -0
  26. package/fesm2022/acorex-platform-module-common-client-disable-entity.command-DWyqAAwo.mjs +57 -0
  27. package/fesm2022/acorex-platform-module-common-client-disable-entity.command-DWyqAAwo.mjs.map +1 -0
  28. package/fesm2022/acorex-platform-module-common-client-disable-entity.command.util-BBwY9Q30.mjs +146 -0
  29. package/fesm2022/acorex-platform-module-common-client-disable-entity.command.util-BBwY9Q30.mjs.map +1 -0
  30. package/fesm2022/acorex-platform-module-common-client-enable-entity.command-BP30gOku.mjs +57 -0
  31. package/fesm2022/acorex-platform-module-common-client-enable-entity.command-BP30gOku.mjs.map +1 -0
  32. package/fesm2022/acorex-platform-module-common-client-get-current-time.command-B7hJTMzT.mjs +72 -0
  33. package/fesm2022/acorex-platform-module-common-client-get-current-time.command-B7hJTMzT.mjs.map +1 -0
  34. package/fesm2022/acorex-platform-module-common-client-restore-archive-entity.command-D6ms054j.mjs +57 -0
  35. package/fesm2022/acorex-platform-module-common-client-restore-archive-entity.command-D6ms054j.mjs.map +1 -0
  36. package/fesm2022/acorex-platform-module-common-client-search-popup.component-upSRWTIO.mjs +136 -0
  37. package/fesm2022/acorex-platform-module-common-client-search-popup.component-upSRWTIO.mjs.map +1 -0
  38. package/fesm2022/acorex-platform-module-common-client-timeline-version-history-popup.component-D4lLwLpx.mjs +59 -0
  39. package/fesm2022/acorex-platform-module-common-client-timeline-version-history-popup.component-D4lLwLpx.mjs.map +1 -0
  40. package/fesm2022/acorex-platform-module-common-client.mjs +2 -0
  41. package/fesm2022/acorex-platform-module-common-client.mjs.map +1 -0
  42. package/package.json +32 -0
  43. package/types/acorex-platform-module-common-client-contracts.d.ts +111 -0
  44. package/types/acorex-platform-module-common-client.d.ts +777 -0
@@ -0,0 +1,57 @@
1
+ import { AXTranslationService } from '@acorex/core/translation';
2
+ import * as i0 from '@angular/core';
3
+ import { inject, Injectable } from '@angular/core';
4
+ import { A as AXPArchiveEntityCommandHelper, n as normalizeArchiveSingleInput, b as buildArchivePatch, a as buildArchiveRefreshMeta } from './acorex-platform-module-common-client-archive-entity.command.util-CEvlTSlo.mjs';
5
+
6
+ class AXPArchiveEntityCommand {
7
+ constructor() {
8
+ this.helper = inject(AXPArchiveEntityCommandHelper);
9
+ this.translationService = inject(AXTranslationService);
10
+ }
11
+ async execute(input) {
12
+ const context = normalizeArchiveSingleInput(input);
13
+ if (!context) {
14
+ return {
15
+ success: false,
16
+ message: {
17
+ text: await this.translationService.translateAsync('@general:messages.entity.invalid-data'),
18
+ },
19
+ };
20
+ }
21
+ const confirmed = await this.helper.confirm('@general:actions.archive.confirm.title', '@general:actions.archive.confirm.message');
22
+ if (!confirmed) {
23
+ return { success: false };
24
+ }
25
+ const loadingDialog = this.helper.showLoading(await this.translationService.translateAsync('@general:actions.archive.confirm.processing'), 'Archiving...');
26
+ try {
27
+ const entityDefinition = await this.helper.resolveEntity(context.refType);
28
+ const patch = buildArchivePatch(true);
29
+ await this.helper.applyPatch(context.refType, context.refId, patch);
30
+ const meta = buildArchiveRefreshMeta(entityDefinition, context.rowData);
31
+ this.helper.dispatchArchived(context.refType, context.refId, meta);
32
+ await this.helper.showSuccessToast('@general:workflow.entity-archived', '@general:workflow.entity-archived-body');
33
+ return { success: true };
34
+ }
35
+ catch (error) {
36
+ console.error('Archive operation failed:', error);
37
+ return {
38
+ success: false,
39
+ message: {
40
+ text: error instanceof Error ? error.message : 'Archive operation failed',
41
+ },
42
+ };
43
+ }
44
+ finally {
45
+ loadingDialog.close();
46
+ }
47
+ }
48
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPArchiveEntityCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
49
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPArchiveEntityCommand, providedIn: 'root' }); }
50
+ }
51
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPArchiveEntityCommand, decorators: [{
52
+ type: Injectable,
53
+ args: [{ providedIn: 'root' }]
54
+ }] });
55
+
56
+ export { AXPArchiveEntityCommand };
57
+ //# sourceMappingURL=acorex-platform-module-common-client-archive-entity.command-Dgsmx1_A.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-common-client-archive-entity.command-Dgsmx1_A.mjs","sources":["../../../../libs/modules/common/client/src/lib/features/archive-plugin/commands/archive-entity.command.ts"],"sourcesContent":["import { AXPCommand } from '@acorex-platform/framework-shared/runtime';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPExecuteCommandResult, type AXPContextData } from '@acorex-platform/framework-shared/core';\nimport { inject, Injectable } from '@angular/core';\n\nimport { AXPArchiveEntityCommandHelper } from './archive-entity.command.helper';\nimport { buildArchivePatch, buildArchiveRefreshMeta, normalizeArchiveSingleInput } from './archive-entity.command.util';\n\n@Injectable({ providedIn: 'root' })\nexport class AXPArchiveEntityCommand implements AXPCommand<AXPContextData, void> {\n private readonly helper = inject(AXPArchiveEntityCommandHelper);\n private readonly translationService = inject(AXTranslationService);\n\n async execute(input: AXPContextData): Promise<AXPExecuteCommandResult<void>> {\n const context = normalizeArchiveSingleInput(input);\n if (!context) {\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync('@general:messages.entity.invalid-data'),\n },\n };\n }\n\n const confirmed = await this.helper.confirm(\n '@general:actions.archive.confirm.title',\n '@general:actions.archive.confirm.message',\n );\n if (!confirmed) {\n return { success: false };\n }\n\n const loadingDialog = this.helper.showLoading(\n await this.translationService.translateAsync('@general:actions.archive.confirm.processing'),\n 'Archiving...',\n );\n\n try {\n const entityDefinition = await this.helper.resolveEntity(context.refType);\n const patch = buildArchivePatch(true);\n await this.helper.applyPatch(context.refType, context.refId, patch);\n\n const meta = buildArchiveRefreshMeta(entityDefinition, context.rowData);\n this.helper.dispatchArchived(context.refType, context.refId, meta);\n await this.helper.showSuccessToast('@general:workflow.entity-archived', '@general:workflow.entity-archived-body');\n\n return { success: true };\n } catch (error) {\n console.error('Archive operation failed:', error);\n return {\n success: false,\n message: {\n text: error instanceof Error ? error.message : 'Archive operation failed',\n },\n };\n } finally {\n loadingDialog.close();\n }\n }\n}\n"],"names":[],"mappings":";;;;;MASa,uBAAuB,CAAA;AADpC,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,6BAA6B,CAAC;AAC9C,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AAgDnE,IAAA;IA9CC,MAAM,OAAO,CAAC,KAAqB,EAAA;AACjC,QAAA,MAAM,OAAO,GAAG,2BAA2B,CAAC,KAAK,CAAC;QAClD,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO;AACL,gBAAA,OAAO,EAAE,KAAK;AACd,gBAAA,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAAC,uCAAuC,CAAC;AAC5F,iBAAA;aACF;QACH;AAEA,QAAA,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CACzC,wCAAwC,EACxC,0CAA0C,CAC3C;QACD,IAAI,CAAC,SAAS,EAAE;AACd,YAAA,OAAO,EAAE,OAAO,EAAE,KAAK,E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,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uBAAuB,cADV,MAAM,EAAA,CAAA,CAAA;;2FACnB,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBADnC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
@@ -0,0 +1,144 @@
1
+ import { AXDialogService } from '@acorex/components/dialog';
2
+ import { AXLoadingDialogService } from '@acorex/components/loading-dialog';
3
+ import { AXToastService } from '@acorex/components/toast';
4
+ import { AXTranslationService } from '@acorex/core/translation';
5
+ import { AXPSettingsService, AXPCommonSettings, AXPRefreshEvent } from '@acorex-platform/framework-client/common';
6
+ import { AXPEntityDefinitionRegistryService } from '@acorex-platform/framework-client/layout/entity';
7
+ import { createWorkFlowEvent, AXPWorkflowEventService } from '@acorex-platform/framework-client/workflow';
8
+ import * as i0 from '@angular/core';
9
+ import { inject, Injectable } from '@angular/core';
10
+ import { A as AXP_ENTITY_ARCHIVE_OVERRIDES } from './acorex-platform-module-common-client-acorex-platform-module-common-client-IHaYrZeE.mjs';
11
+
12
+ const AXPEntityArchivedEvent = createWorkFlowEvent('[Entity] Archived');
13
+ const AXPEntityUnarchivedEvent = createWorkFlowEvent('[Entity] Unarchived');
14
+ const AXPEntityBulkArchivedEvent = createWorkFlowEvent('[Entity] Bulk Archived');
15
+ const AXPEntityBulkUnarchivedEvent = createWorkFlowEvent('[Entity] Bulk Unarchived');
16
+
17
+ /**
18
+ * Injectable helper for archive commands: confirmation UI, persistence, toasts, and refresh events.
19
+ * Pure input/patch logic lives in {@link archive-entity.command.util}.
20
+ */
21
+ class AXPArchiveEntityCommandHelper {
22
+ constructor() {
23
+ this.entityRegistry = inject(AXPEntityDefinitionRegistryService);
24
+ this.dialogService = inject(AXDialogService);
25
+ this.loadingDialog = inject(AXLoadingDialogService);
26
+ this.translationService = inject(AXTranslationService);
27
+ this.toastService = inject(AXToastService);
28
+ this.settingsService = inject(AXPSettingsService);
29
+ this.workflowEventService = inject(AXPWorkflowEventService);
30
+ this.archiveOverrides = inject(AXP_ENTITY_ARCHIVE_OVERRIDES, { optional: true }) ?? [];
31
+ }
32
+ async resolveEntity(refType) {
33
+ const [moduleName, entityName] = refType.split('.');
34
+ return this.entityRegistry.resolve(moduleName, entityName);
35
+ }
36
+ async applyPatch(refType, refId, patch) {
37
+ const override = this.archiveOverrides.find((entry) => entry.refType === refType);
38
+ if (override) {
39
+ const archived = patch['isArchived'] === true;
40
+ if (archived) {
41
+ await override.archive(refId);
42
+ }
43
+ else {
44
+ await override.restore(refId);
45
+ }
46
+ return;
47
+ }
48
+ const entityDefinition = await this.resolveEntity(refType);
49
+ const updateExec = entityDefinition.commands?.update?.execute;
50
+ if (!updateExec) {
51
+ throw new Error('Entity does not support update operation');
52
+ }
53
+ await updateExec({ id: refId, ...patch });
54
+ }
55
+ async confirm(titleKey, messageKey, messageParams) {
56
+ const dialogResult = await this.dialogService.confirm(await this.translationService.translateAsync(titleKey), await this.translationService.translateAsync(messageKey, { params: messageParams }), 'warning', 'horizontal', false, 'cancel');
57
+ return dialogResult.result === true;
58
+ }
59
+ showLoading(title, status) {
60
+ return this.loadingDialog.show({
61
+ title,
62
+ mode: 'indeterminate',
63
+ status,
64
+ });
65
+ }
66
+ async showSuccessToast(titleKey, contentKey) {
67
+ const enabled = await this.settingsService.get(AXPCommonSettings.EnableOperationToasts);
68
+ if (!enabled) {
69
+ return;
70
+ }
71
+ this.toastService.show({
72
+ color: 'success',
73
+ title: await this.translationService.translateAsync(titleKey),
74
+ content: contentKey ? await this.translationService.translateAsync(contentKey) : undefined,
75
+ });
76
+ }
77
+ dispatchArchived(refType, id, meta) {
78
+ this.workflowEventService.dispatch(AXPEntityArchivedEvent({ entity: refType, id, meta }));
79
+ this.workflowEventService.dispatch(AXPRefreshEvent({ entity: refType, meta }));
80
+ }
81
+ dispatchUnarchived(refType, id, meta) {
82
+ this.workflowEventService.dispatch(AXPEntityUnarchivedEvent({ entity: refType, id, meta }));
83
+ this.workflowEventService.dispatch(AXPRefreshEvent({ entity: refType, meta }));
84
+ }
85
+ dispatchBulkArchived(refType, ids, meta) {
86
+ this.workflowEventService.dispatch(AXPEntityBulkArchivedEvent({ entity: refType, ids, meta }));
87
+ this.workflowEventService.dispatch(AXPRefreshEvent({ entity: refType, meta: { refreshType: 'bulk-archive', ...meta } }));
88
+ }
89
+ dispatchBulkUnarchived(refType, ids, meta) {
90
+ this.workflowEventService.dispatch(AXPEntityBulkUnarchivedEvent({ entity: refType, ids, meta }));
91
+ this.workflowEventService.dispatch(AXPRefreshEvent({ entity: refType, meta: { refreshType: 'bulk-unarchive', ...meta } }));
92
+ }
93
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPArchiveEntityCommandHelper, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
94
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPArchiveEntityCommandHelper, providedIn: 'root' }); }
95
+ }
96
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPArchiveEntityCommandHelper, decorators: [{
97
+ type: Injectable,
98
+ args: [{ providedIn: 'root' }]
99
+ }] });
100
+
101
+ const DEFAULT_ARCHIVE_FIELD = 'isArchived';
102
+ const ARCHIVE_TIMESTAMP_FIELD = 'archivedAt';
103
+ function normalizeArchiveSingleInput(input) {
104
+ const ctx = input['__context__'];
105
+ const options = (input['options'] ?? ctx?.['options'] ?? input);
106
+ const data = ctx?.['data'] ?? input;
107
+ const rowData = Array.isArray(data)
108
+ ? data[0]
109
+ : data;
110
+ const refType = String(options['refType'] ?? ctx?.['entity'] ?? ctx?.['entityInfo']?.['source'] ?? '');
111
+ const rawId = options['refId'] ?? rowData?.['id'] ?? rowData?.['_id'] ?? input['refId'];
112
+ if (!refType || rawId == null || rawId === '') {
113
+ return null;
114
+ }
115
+ return { refId: String(rawId), refType, rowData };
116
+ }
117
+ function normalizeArchiveBulkInput(input) {
118
+ const ctx = input['__context__'];
119
+ const options = (input['options'] ?? ctx?.['options'] ?? input);
120
+ const data = ctx?.['data'] ?? input['data'] ?? input;
121
+ const rows = (Array.isArray(data) ? data : data ? [data] : []);
122
+ const refType = String(options['refType'] ?? ctx?.['entity'] ?? ctx?.['entityInfo']?.['source'] ?? '');
123
+ const ids = rows.map((row) => row?.['id']).filter((id) => id != null && id !== '');
124
+ if (!refType || ids.length === 0) {
125
+ return null;
126
+ }
127
+ return { refType, ids, rows };
128
+ }
129
+ function buildArchivePatch(archived) {
130
+ if (archived) {
131
+ return { [DEFAULT_ARCHIVE_FIELD]: true, [ARCHIVE_TIMESTAMP_FIELD]: new Date() };
132
+ }
133
+ return { [DEFAULT_ARCHIVE_FIELD]: false, [ARCHIVE_TIMESTAMP_FIELD]: null };
134
+ }
135
+ function buildArchiveRefreshMeta(entityDefinition, rowData) {
136
+ const meta = {};
137
+ if (entityDefinition.parentKey && rowData?.[entityDefinition.parentKey] != null) {
138
+ meta['refreshTargetId'] = rowData[entityDefinition.parentKey];
139
+ }
140
+ return meta;
141
+ }
142
+
143
+ export { AXPArchiveEntityCommandHelper as A, buildArchiveRefreshMeta as a, buildArchivePatch as b, normalizeArchiveBulkInput as c, normalizeArchiveSingleInput as n };
144
+ //# sourceMappingURL=acorex-platform-module-common-client-archive-entity.command.util-CEvlTSlo.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-common-client-archive-entity.command.util-CEvlTSlo.mjs","sources":["../../../../libs/modules/common/client/src/lib/features/archive-plugin/archive-entity.events.ts","../../../../libs/modules/common/client/src/lib/features/archive-plugin/commands/archive-entity.command.helper.ts","../../../../libs/modules/common/client/src/lib/features/archive-plugin/commands/archive-entity.command.util.ts"],"sourcesContent":["import { createWorkFlowEvent } from '@acorex-platform/framework-client/workflow';\n\nexport const AXPEntityArchivedEvent = createWorkFlowEvent<{ entity: string; id: string; meta?: unknown }>(\n '[Entity] Archived',\n);\n\nexport const AXPEntityUnarchivedEvent = createWorkFlowEvent<{ entity: string; id: string; meta?: unknown }>(\n '[Entity] Unarchived',\n);\n\nexport const AXPEntityBulkArchivedEvent = createWorkFlowEvent<{\n entity: string;\n ids: string[];\n meta?: unknown;\n}>('[Entity] Bulk Archived');\n\nexport const AXPEntityBulkUnarchivedEvent = createWorkFlowEvent<{\n entity: string;\n ids: string[];\n meta?: unknown;\n}>('[Entity] Bulk Unarchived');\n","import { AXDialogService } from '@acorex/components/dialog';\nimport { AXLoadingDialogService } from '@acorex/components/loading-dialog';\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport type { AXPContextData } from '@acorex-platform/framework-shared/core';\nimport { AXPCommonSettings, AXPRefreshEvent, AXPSettingsService } from '@acorex-platform/framework-client/common';\nimport { AXPEntityDefinitionRegistryService } from '@acorex-platform/framework-client/layout/entity';\nimport { AXPWorkflowEventService } from '@acorex-platform/framework-client/workflow';\nimport type { AXPEntity } from '@acorex-platform/framework-shared/entity';\nimport { inject, Injectable } from '@angular/core';\n\nimport {\n AXPEntityArchivedEvent,\n AXPEntityBulkArchivedEvent,\n AXPEntityBulkUnarchivedEvent,\n AXPEntityUnarchivedEvent,\n} from '../archive-entity.events';\nimport { AXP_ENTITY_ARCHIVE_OVERRIDES } from '../archive-entity.override';\n\n/**\n * Injectable helper for archive commands: confirmation UI, persistence, toasts, and refresh events.\n * Pure input/patch logic lives in {@link archive-entity.command.util}.\n */\n@Injectable({ providedIn: 'root' })\nexport class AXPArchiveEntityCommandHelper {\n private readonly entityRegistry = inject(AXPEntityDefinitionRegistryService);\n private readonly dialogService = inject(AXDialogService);\n private readonly loadingDialog = inject(AXLoadingDialogService);\n private readonly translationService = inject(AXTranslationService);\n private readonly toastService = inject(AXToastService);\n private readonly settingsService = inject(AXPSettingsService);\n private readonly workflowEventService = inject(AXPWorkflowEventService);\n private readonly archiveOverrides = inject(AXP_ENTITY_ARCHIVE_OVERRIDES, { optional: true }) ?? [];\n\n async resolveEntity(refType: string): Promise<AXPEntity> {\n const [moduleName, entityName] = refType.split('.');\n return this.entityRegistry.resolve(moduleName, entityName);\n }\n\n async applyPatch(refType: string, refId: string, patch: AXPContextData): Promise<void> {\n const override = this.archiveOverrides.find((entry) => entry.refType === refType);\n if (override) {\n const archived = patch['isArchived'] === true;\n if (archived) {\n await override.archive(refId);\n } else {\n await override.restore(refId);\n }\n return;\n }\n\n const entityDefinition = await this.resolveEntity(refType);\n const updateExec = entityDefinition.commands?.update?.execute as\n | ((payload: AXPContextData) => Promise<unknown>)\n | undefined;\n\n if (!updateExec) {\n throw new Error('Entity does not support update operation');\n }\n\n await updateExec({ id: refId, ...patch });\n }\n\n async confirm(titleKey: string, messageKey: string, messageParams?: AXPContextData): Promise<boolean> {\n const dialogResult = await this.dialogService.confirm(\n await this.translationService.translateAsync(titleKey),\n await this.translationService.translateAsync(messageKey, { params: messageParams }),\n 'warning',\n 'horizontal',\n false,\n 'cancel',\n );\n return dialogResult.result === true;\n }\n\n showLoading(title: string, status: string) {\n return this.loadingDialog.show({\n title,\n mode: 'indeterminate',\n status,\n });\n }\n\n async showSuccessToast(titleKey: string, contentKey?: string): Promise<void> {\n const enabled = await this.settingsService.get<boolean>(AXPCommonSettings.EnableOperationToasts);\n if (!enabled) {\n return;\n }\n\n this.toastService.show({\n color: 'success',\n title: await this.translationService.translateAsync(titleKey),\n content: contentKey ? await this.translationService.translateAsync(contentKey) : undefined,\n });\n }\n\n dispatchArchived(refType: string, id: string, meta?: AXPContextData): void {\n this.workflowEventService.dispatch(AXPEntityArchivedEvent({ entity: refType, id, meta }));\n this.workflowEventService.dispatch(AXPRefreshEvent({ entity: refType, meta }));\n }\n\n dispatchUnarchived(refType: string, id: string, meta?: AXPContextData): void {\n this.workflowEventService.dispatch(AXPEntityUnarchivedEvent({ entity: refType, id, meta }));\n this.workflowEventService.dispatch(AXPRefreshEvent({ entity: refType, meta }));\n }\n\n dispatchBulkArchived(refType: string, ids: string[], meta?: AXPContextData): void {\n this.workflowEventService.dispatch(AXPEntityBulkArchivedEvent({ entity: refType, ids, meta }));\n this.workflowEventService.dispatch(\n AXPRefreshEvent({ entity: refType, meta: { refreshType: 'bulk-archive', ...meta } }),\n );\n }\n\n dispatchBulkUnarchived(refType: string, ids: string[], meta?: AXPContextData): void {\n this.workflowEventService.dispatch(AXPEntityBulkUnarchivedEvent({ entity: refType, ids, meta }));\n this.workflowEventService.dispatch(\n AXPRefreshEvent({ entity: refType, meta: { refreshType: 'bulk-unarchive', ...meta } }),\n );\n }\n}\n","import type { AXPContextData } from '@acorex-platform/framework-shared/core';\nimport type { AXPEntity } from '@acorex-platform/framework-shared/entity';\n\nexport const DEFAULT_ARCHIVE_FIELD = 'isArchived';\nexport const ARCHIVE_TIMESTAMP_FIELD = 'archivedAt';\n\nexport interface AXPArchiveCommandContext {\n refId: string;\n refType: string;\n rowData?: AXPContextData;\n}\n\nexport interface AXPBulkArchiveCommandContext {\n refType: string;\n ids: string[];\n rows: AXPContextData[];\n}\n\nexport function normalizeArchiveSingleInput(input: AXPContextData): AXPArchiveCommandContext | null {\n const ctx = input['__context__'] as AXPContextData | undefined;\n const options = (input['options'] ?? ctx?.['options'] ?? input) as AXPContextData;\n const data = ctx?.['data'] ?? input;\n const rowData = Array.isArray(data)\n ? (data[0] as AXPContextData | undefined)\n : (data as AXPContextData | undefined);\n\n const refType = String(\n options['refType'] ?? ctx?.['entity'] ?? (ctx?.['entityInfo'] as AXPContextData | undefined)?.['source'] ?? '',\n );\n const rawId = options['refId'] ?? rowData?.['id'] ?? rowData?.['_id'] ?? input['refId'];\n\n if (!refType || rawId == null || rawId === '') {\n return null;\n }\n\n return { refId: String(rawId), refType, rowData };\n}\n\nexport function normalizeArchiveBulkInput(input: AXPContextData): AXPBulkArchiveCommandContext | null {\n const ctx = input['__context__'] as AXPContextData | undefined;\n const options = (input['options'] ?? ctx?.['options'] ?? input) as AXPContextData;\n const data = ctx?.['data'] ?? input['data'] ?? input;\n const rows = (Array.isArray(data) ? data : data ? [data] : []) as AXPContextData[];\n\n const refType = String(\n options['refType'] ?? ctx?.['entity'] ?? (ctx?.['entityInfo'] as AXPContextData | undefined)?.['source'] ?? '',\n );\n const ids = rows.map((row) => row?.['id']).filter((id): id is string => id != null && id !== '');\n\n if (!refType || ids.length === 0) {\n return null;\n }\n\n return { refType, ids, rows };\n}\n\nexport function buildArchivePatch(archived: boolean): AXPContextData {\n if (archived) {\n return { [DEFAULT_ARCHIVE_FIELD]: true, [ARCHIVE_TIMESTAMP_FIELD]: new Date() };\n }\n return { [DEFAULT_ARCHIVE_FIELD]: false, [ARCHIVE_TIMESTAMP_FIELD]: null };\n}\n\nexport function buildArchiveRefreshMeta(\n entityDefinition: AXPEntity,\n rowData?: AXPContextData,\n): AXPContextData {\n const meta: AXPContextData = {};\n if (entityDefinition.parentKey && rowData?.[entityDefinition.parentKey] != null) {\n meta['refreshTargetId'] = rowData[entityDefinition.parentKey];\n }\n return meta;\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAEO,MAAM,sBAAsB,GAAG,mBAAmB,CACvD,mBAAmB,CACpB;AAEM,MAAM,wBAAwB,GAAG,mBAAmB,CACzD,qBAAqB,CACtB;AAEM,MAAM,0BAA0B,GAAG,mBAAmB,CAI1D,wBAAwB,CAAC;AAErB,MAAM,4BAA4B,GAAG,mBAAmB,CAI5D,0BAA0B,CAAC;;ACD9B;;;AAGG;MAEU,6BAA6B,CAAA;AAD1C,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,kCAAkC,CAAC;AAC3D,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,eAAe,CAAC;AACvC,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,sBAAsB,CAAC;AAC9C,QAAA,IAAA,CAAA,kBAAkB,GAAG,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BAAuB,GAAG,IAAI,IAAI,EAAE,EAAE;IACjF;AACA,IAAA,OAAO,EAAE,CAAC,qBAAqB,GAAG,KAAK,EAAE,CAAC,uBAAuB,GAAG,IAAI,EAAE;AAC5E;AAEM,SAAU,uBAAuB,CACrC,gBAA2B,EAC3B,OAAwB,EAAA;IAExB,MAAM,IAAI,GAAmB,EAAE;AAC/B,IAAA,IAAI,gBAAgB,CAAC,SAAS,IAAI,OAAO,GAAG,gBAAgB,CAAC,SAAS,CAAC,IAAI,IAAI,EAAE;QAC/E,IAAI,CAAC,iBAAiB,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,SAAS,CAAC;IAC/D;AACA,IAAA,OAAO,IAAI;AACb;;;;"}
@@ -0,0 +1,158 @@
1
+ import { AXBadgeModule } from '@acorex/components/badge';
2
+ import { AXPColumnWidgetComponent } from '@acorex-platform/framework-client/layout/widget-core';
3
+ import * as i2 from '@acorex/components/button';
4
+ import { AXButtonModule } from '@acorex/components/button';
5
+ import * as i2$1 from '@acorex/components/popover';
6
+ import { AXPopoverModule } from '@acorex/components/popover';
7
+ import { AXFormatService } from '@acorex/core/format';
8
+ import * as i0 from '@angular/core';
9
+ import { inject, viewChild, ElementRef, signal, computed, ChangeDetectionStrategy, Component } from '@angular/core';
10
+ import * as i1 from '@angular/common';
11
+ import { CommonModule } from '@angular/common';
12
+ import * as i4 from '@acorex/core/translation';
13
+ import { AXTranslationModule } from '@acorex/core/translation';
14
+ import { AXPCommandService } from '@acorex-platform/framework-client/runtime';
15
+
16
+ const SHOW_VERSION_HISTORY_POPUP_COMMAND = 'show-version-history-popup';
17
+ class AXPAuditInfoColumnComponent extends AXPColumnWidgetComponent {
18
+ constructor() {
19
+ super(...arguments);
20
+ //#region ---- Dependencies ----
21
+ this.formatService = inject(AXFormatService);
22
+ this.commandService = inject(AXPCommandService);
23
+ //#endregion
24
+ //#region ---- View Children ----
25
+ this.infoButton = viewChild('infoButton', ...(ngDevMode ? [{ debugName: "infoButton" }] : /* istanbul ignore next */ []));
26
+ this.infoPopover = viewChild('infoPopover', ...(ngDevMode ? [{ debugName: "infoPopover" }] : /* istanbul ignore next */ []));
27
+ //#endregion
28
+ //#region ---- Properties ----
29
+ this.host = inject(ElementRef);
30
+ this.isPopoverOpen = signal(false, ...(ngDevMode ? [{ debugName: "isPopoverOpen" }] : /* istanbul ignore next */ []));
31
+ //#endregion
32
+ //#region ---- Computed Properties ----
33
+ this.auditInfo = computed(() => {
34
+ const value = this.rawValue;
35
+ return value && typeof value === 'object' ? value : null;
36
+ }, ...(ngDevMode ? [{ debugName: "auditInfo" }] : /* istanbul ignore next */ []));
37
+ this.displayText = computed(() => {
38
+ const info = this.auditInfo();
39
+ if (!info) {
40
+ return '---';
41
+ }
42
+ if (info.updated?.at) {
43
+ return this.formatAuditEvent(info.updated, 'updated');
44
+ }
45
+ else if (info.created?.at) {
46
+ return this.formatAuditEvent(info.created, 'created');
47
+ }
48
+ return '---';
49
+ }, ...(ngDevMode ? [{ debugName: "displayText" }] : /* istanbul ignore next */ []));
50
+ this.displayDate = computed(() => {
51
+ const info = this.auditInfo();
52
+ if (!info) {
53
+ return '';
54
+ }
55
+ if (info.updated?.at) {
56
+ return this.formatDate(info.updated.at);
57
+ }
58
+ else if (info.created?.at) {
59
+ return this.formatDate(info.created.at);
60
+ }
61
+ return '';
62
+ }, ...(ngDevMode ? [{ debugName: "displayDate" }] : /* istanbul ignore next */ []));
63
+ this.hasAuditInfo = computed(() => {
64
+ const info = this.auditInfo();
65
+ return !!(info?.created || info?.updated || info?.deleted);
66
+ }, ...(ngDevMode ? [{ debugName: "hasAuditInfo" }] : /* istanbul ignore next */ []));
67
+ this.createdEvent = computed(() => {
68
+ return this.auditInfo()?.created ?? null;
69
+ }, ...(ngDevMode ? [{ debugName: "createdEvent" }] : /* istanbul ignore next */ []));
70
+ this.updatedEvent = computed(() => {
71
+ return this.auditInfo()?.updated ?? null;
72
+ }, ...(ngDevMode ? [{ debugName: "updatedEvent" }] : /* istanbul ignore next */ []));
73
+ this.deletedEvent = computed(() => {
74
+ return this.auditInfo()?.deleted ?? null;
75
+ }, ...(ngDevMode ? [{ debugName: "deletedEvent" }] : /* istanbul ignore next */ []));
76
+ this.hasHistoryPlugin = computed(() => {
77
+ const hasHistoryPlugin = this.options?.hasHistoryPlugin ?? false;
78
+ return hasHistoryPlugin && this.commandService.exists(SHOW_VERSION_HISTORY_POPUP_COMMAND);
79
+ }, ...(ngDevMode ? [{ debugName: "hasHistoryPlugin" }] : /* istanbul ignore next */ []));
80
+ }
81
+ //#endregion
82
+ //#region ---- Public Methods ----
83
+ showInfo() {
84
+ this.openPopover();
85
+ }
86
+ onPopoverOpenChange(event) {
87
+ this.isPopoverOpen.set(event);
88
+ }
89
+ formatDate(date) {
90
+ if (!date) {
91
+ return '---';
92
+ }
93
+ try {
94
+ const dateObj = typeof date === 'string' ? new Date(date) : date;
95
+ return this.formatService.format(dateObj, 'datetime', {
96
+ format: 'short',
97
+ });
98
+ }
99
+ catch {
100
+ return '---';
101
+ }
102
+ }
103
+ formatUser(user) {
104
+ if (!user) {
105
+ return '---';
106
+ }
107
+ return user.fullName || user.username || user.id || '---';
108
+ }
109
+ formatAuditEvent(event, type) {
110
+ if (!event?.at) {
111
+ return '---';
112
+ }
113
+ const dateStr = this.formatDate(event.at);
114
+ const userStr = this.formatUser(event.by);
115
+ return `${dateStr}${userStr !== '---' ? ` by ${userStr}` : ''}`;
116
+ }
117
+ //#endregion
118
+ //#region ---- Private Methods ----
119
+ openPopover() {
120
+ if (this.infoPopover() && this.infoButton()) {
121
+ this.infoPopover().target = this.infoButton().nativeElement;
122
+ this.infoPopover().open();
123
+ this.isPopoverOpen.set(true);
124
+ }
125
+ }
126
+ async showHistory() {
127
+ if (!this.hasHistoryPlugin()) {
128
+ return;
129
+ }
130
+ const rowData = this.rowData;
131
+ const entityId = rowData?.['id'];
132
+ if (!entityId) {
133
+ return;
134
+ }
135
+ const entityInfo = this.options?.entityInfo || rowData?.['__entityInfo'];
136
+ const refType = entityInfo?.source || entityInfo?.refType;
137
+ if (!refType) {
138
+ return;
139
+ }
140
+ const fieldTitles = entityInfo?.fieldTitles || {};
141
+ await this.commandService.execute(SHOW_VERSION_HISTORY_POPUP_COMMAND, {
142
+ options: {
143
+ refId: entityId,
144
+ refType,
145
+ fieldTitles,
146
+ },
147
+ });
148
+ }
149
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPAuditInfoColumnComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
150
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: AXPAuditInfoColumnComponent, isStandalone: true, selector: "axp-audit-info-column", inputs: { rawValue: "rawValue", rowData: "rowData" }, viewQueries: [{ propertyName: "infoButton", first: true, predicate: ["infoButton"], descendants: true, isSignal: true }, { propertyName: "infoPopover", first: true, predicate: ["infoPopover"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"flex items-center gap-1.5\">\n @if (hasAuditInfo()) {\n <div class=\"flex items-center gap-1.5 cursor-pointer hover:opacity-80 transition-opacity\"\n (click)=\"showInfo()\" [title]=\"displayText()\" #infoButton>\n <i class=\"fa-light fa-calendar-circle-exclamation\"></i>\n <span class=\"text-xs\" [dir]=\"'ltr'\">{{ displayDate() }}</span>\n </div>\n } @else {\n <span class=\"text-muted\">---</span>\n }\n</div>\n\n<!-- Audit Info Popover -->\n<ax-popover [openOn]=\"'manual'\" #infoPopover (openChange)=\"onPopoverOpenChange($event)\" [adaptivityEnabled]=\"true\">\n <div class=\"lightest-surface border rounded-lg shadow-lg p-3 min-w-[280px]\">\n <div class=\"mb-3 pb-2 border-b\">\n <h3 class=\"text-sm font-semibold\">\n {{ '@general:terms.audit.section-title' | translate | async }}\n </h3>\n </div>\n <div class=\"space-y-2.5\">\n <!-- Created -->\n @if (createdEvent()) {\n <div>\n <div class=\"text-xs mb-1 font-semibold\">\n {{ '@general:terms.audit.created' | translate | async }}\n </div>\n <div class=\"text-xs space-y-0.5\">\n @if (createdEvent()?.at) {\n <div>\n <span [dir]=\"'ltr'\">{{ formatDate(createdEvent()?.at) }}</span>\n @if (createdEvent()?.by) {\n <span class=\"text-muted\"> \u2022 {{ formatUser(createdEvent()?.by) }}</span>\n }\n </div>\n }\n @if (createdEvent()?.reason) {\n <div class=\"text-muted\">{{ createdEvent()?.reason }}</div>\n }\n </div>\n </div>\n }\n\n <!-- Updated -->\n @if (updatedEvent()) {\n <div>\n <div class=\"text-xs mb-1 font-semibold\">\n {{ '@general:terms.audit.updated' | translate | async }}\n </div>\n <div class=\"text-xs space-y-0.5\">\n @if (updatedEvent()?.at) {\n <div>\n <span [dir]=\"'ltr'\">{{ formatDate(updatedEvent()?.at) }}</span>\n @if (updatedEvent()?.by) {\n <span class=\"text-muted\"> \u2022 {{ formatUser(updatedEvent()?.by) }}</span>\n }\n </div>\n }\n @if (updatedEvent()?.reason) {\n <div class=\"text-muted\">{{ updatedEvent()?.reason }}</div>\n }\n </div>\n </div>\n }\n\n <!-- Deleted -->\n @if (deletedEvent()) {\n <div>\n <div class=\"text-xs text-muted mb-1 font-semibold\">\n {{ '@general:terms.audit.deleted' | translate | async }}\n </div>\n <div class=\"text-xs space-y-0.5\">\n @if (deletedEvent()?.at) {\n <div>\n <span [dir]=\"'ltr'\">{{ formatDate(deletedEvent()?.at) }}</span>\n @if (deletedEvent()?.by) {\n <span class=\"text-muted\"> \u2022 {{ formatUser(deletedEvent()?.by) }}</span>\n }\n </div>\n }\n @if (deletedEvent()?.reason) {\n <div class=\"text-muted\">{{ deletedEvent()?.reason }}</div>\n }\n </div>\n </div>\n }\n </div>\n @if (hasHistoryPlugin()) {\n <div class=\"mt-3 pt-3 border-t ax-sm\">\n <ax-button [text]=\"'@general:terms.audit.history' | translate | async\" (click)=\"showHistory()\" class=\"w-full\">\n </ax-button>\n </div>\n }\n </div>\n</ax-popover>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXBadgeModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i2.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXPopoverModule }, { kind: "component", type: i2$1.AXPopoverComponent, selector: "ax-popover", inputs: ["width", "disablePanelClass", "disabled", "offsetX", "offsetY", "target", "placement", "content", "openOn", "closeOn", "hasBackdrop", "openAfter", "closeAfter", "closeOnScroll", "backdropClass", "panelClass", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
151
+ }
152
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPAuditInfoColumnComponent, decorators: [{
153
+ type: Component,
154
+ args: [{ selector: 'axp-audit-info-column', changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule, AXBadgeModule, AXButtonModule, AXPopoverModule, AXTranslationModule], inputs: ['rawValue', 'rowData'], template: "<div class=\"flex items-center gap-1.5\">\n @if (hasAuditInfo()) {\n <div class=\"flex items-center gap-1.5 cursor-pointer hover:opacity-80 transition-opacity\"\n (click)=\"showInfo()\" [title]=\"displayText()\" #infoButton>\n <i class=\"fa-light fa-calendar-circle-exclamation\"></i>\n <span class=\"text-xs\" [dir]=\"'ltr'\">{{ displayDate() }}</span>\n </div>\n } @else {\n <span class=\"text-muted\">---</span>\n }\n</div>\n\n<!-- Audit Info Popover -->\n<ax-popover [openOn]=\"'manual'\" #infoPopover (openChange)=\"onPopoverOpenChange($event)\" [adaptivityEnabled]=\"true\">\n <div class=\"lightest-surface border rounded-lg shadow-lg p-3 min-w-[280px]\">\n <div class=\"mb-3 pb-2 border-b\">\n <h3 class=\"text-sm font-semibold\">\n {{ '@general:terms.audit.section-title' | translate | async }}\n </h3>\n </div>\n <div class=\"space-y-2.5\">\n <!-- Created -->\n @if (createdEvent()) {\n <div>\n <div class=\"text-xs mb-1 font-semibold\">\n {{ '@general:terms.audit.created' | translate | async }}\n </div>\n <div class=\"text-xs space-y-0.5\">\n @if (createdEvent()?.at) {\n <div>\n <span [dir]=\"'ltr'\">{{ formatDate(createdEvent()?.at) }}</span>\n @if (createdEvent()?.by) {\n <span class=\"text-muted\"> \u2022 {{ formatUser(createdEvent()?.by) }}</span>\n }\n </div>\n }\n @if (createdEvent()?.reason) {\n <div class=\"text-muted\">{{ createdEvent()?.reason }}</div>\n }\n </div>\n </div>\n }\n\n <!-- Updated -->\n @if (updatedEvent()) {\n <div>\n <div class=\"text-xs mb-1 font-semibold\">\n {{ '@general:terms.audit.updated' | translate | async }}\n </div>\n <div class=\"text-xs space-y-0.5\">\n @if (updatedEvent()?.at) {\n <div>\n <span [dir]=\"'ltr'\">{{ formatDate(updatedEvent()?.at) }}</span>\n @if (updatedEvent()?.by) {\n <span class=\"text-muted\"> \u2022 {{ formatUser(updatedEvent()?.by) }}</span>\n }\n </div>\n }\n @if (updatedEvent()?.reason) {\n <div class=\"text-muted\">{{ updatedEvent()?.reason }}</div>\n }\n </div>\n </div>\n }\n\n <!-- Deleted -->\n @if (deletedEvent()) {\n <div>\n <div class=\"text-xs text-muted mb-1 font-semibold\">\n {{ '@general:terms.audit.deleted' | translate | async }}\n </div>\n <div class=\"text-xs space-y-0.5\">\n @if (deletedEvent()?.at) {\n <div>\n <span [dir]=\"'ltr'\">{{ formatDate(deletedEvent()?.at) }}</span>\n @if (deletedEvent()?.by) {\n <span class=\"text-muted\"> \u2022 {{ formatUser(deletedEvent()?.by) }}</span>\n }\n </div>\n }\n @if (deletedEvent()?.reason) {\n <div class=\"text-muted\">{{ deletedEvent()?.reason }}</div>\n }\n </div>\n </div>\n }\n </div>\n @if (hasHistoryPlugin()) {\n <div class=\"mt-3 pt-3 border-t ax-sm\">\n <ax-button [text]=\"'@general:terms.audit.history' | translate | async\" (click)=\"showHistory()\" class=\"w-full\">\n </ax-button>\n </div>\n }\n </div>\n</ax-popover>\n" }]
155
+ }], propDecorators: { infoButton: [{ type: i0.ViewChild, args: ['infoButton', { isSignal: true }] }], infoPopover: [{ type: i0.ViewChild, args: ['infoPopover', { isSignal: true }] }] } });
156
+
157
+ export { AXPAuditInfoColumnComponent };
158
+ //# sourceMappingURL=acorex-platform-module-common-client-audit-info-column.component-DuZUwD31.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-common-client-audit-info-column.component-DuZUwD31.mjs","sources":["../../../../libs/modules/common/client/src/lib/features/history-plugin/components/audit-info-column.component.ts","../../../../libs/modules/common/client/src/lib/features/history-plugin/components/audit-info-column.component.html"],"sourcesContent":["import { AXPAuditEvent, AXPRecordAuditInfo } from '@acorex-platform/framework-shared/entity';\nimport { AXBadgeModule } from '@acorex/components/badge';\nimport { AXPColumnWidgetComponent } from '@acorex-platform/framework-client/layout/widget-core';\nimport { AXButtonModule } from '@acorex/components/button';\nimport { AXPopoverComponent, AXPopoverModule } from '@acorex/components/popover';\nimport { AXFormatService } from '@acorex/core/format';\n\nimport { ChangeDetectionStrategy, Component, computed, ElementRef, inject, signal, viewChild } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { AXTranslationModule } from '@acorex/core/translation';\nimport { AXPCommandService } from '@acorex-platform/framework-client/runtime';\n\nconst SHOW_VERSION_HISTORY_POPUP_COMMAND = 'show-version-history-popup';\n\n@Component({\n selector: 'axp-audit-info-column',\n templateUrl: './audit-info-column.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [CommonModule, AXBadgeModule, AXButtonModule, AXPopoverModule, AXTranslationModule],\n inputs: ['rawValue', 'rowData'],\n})\nexport class AXPAuditInfoColumnComponent extends AXPColumnWidgetComponent<AXPRecordAuditInfo> {\n //#region ---- Dependencies ----\n\n private readonly formatService = inject(AXFormatService);\n private readonly commandService = inject(AXPCommandService);\n\n //#endregion\n\n //#region ---- View Children ----\n\n protected infoButton = viewChild<ElementRef>('infoButton');\n protected infoPopover = viewChild<AXPopoverComponent>('infoPopover');\n\n //#endregion\n\n //#region ---- Properties ----\n\n protected host = inject(ElementRef);\n protected isPopoverOpen = signal(false);\n\n //#endregion\n\n //#region ---- Computed Properties ----\n\n protected auditInfo = computed<AXPRecordAuditInfo | null>(() => {\n const value = this.rawValue;\n return value && typeof value === 'object' ? (value as AXPRecordAuditInfo) : null;\n });\n\n protected displayText = computed<string>(() => {\n const info = this.auditInfo();\n if (!info) {\n return '---';\n }\n\n if (info.updated?.at) {\n return this.formatAuditEvent(info.updated, 'updated');\n } else if (info.created?.at) {\n return this.formatAuditEvent(info.created, 'created');\n }\n\n return '---';\n });\n\n protected displayDate = computed<string>(() => {\n const info = this.auditInfo();\n if (!info) {\n return '';\n }\n\n if (info.updated?.at) {\n return this.formatDate(info.updated.at);\n } else if (info.created?.at) {\n return this.formatDate(info.created.at);\n }\n\n return '';\n });\n\n protected hasAuditInfo = computed<boolean>(() => {\n const info = this.auditInfo();\n return !!(info?.created || info?.updated || info?.deleted);\n });\n\n protected createdEvent = computed<AXPAuditEvent | null>(() => {\n return this.auditInfo()?.created ?? null;\n });\n\n protected updatedEvent = computed<AXPAuditEvent | null>(() => {\n return this.auditInfo()?.updated ?? null;\n });\n\n protected deletedEvent = computed<AXPAuditEvent | null>(() => {\n return this.auditInfo()?.deleted ?? null;\n });\n\n //#endregion\n\n //#region ---- Public Methods ----\n\n protected showInfo(): void {\n this.openPopover();\n }\n\n protected onPopoverOpenChange(event: any): void {\n this.isPopoverOpen.set(event);\n }\n\n protected formatDate(date: Date | string | undefined): string {\n if (!date) {\n return '---';\n }\n\n try {\n const dateObj = typeof date === 'string' ? new Date(date) : date;\n return this.formatService.format(dateObj, 'datetime', {\n format: 'short',\n });\n } catch {\n return '---';\n }\n }\n\n protected formatUser(user: any): string {\n if (!user) {\n return '---';\n }\n\n return user.fullName || user.username || user.id || '---';\n }\n\n protected formatAuditEvent(event: AXPAuditEvent, type: 'created' | 'updated' | 'deleted'): string {\n if (!event?.at) {\n return '---';\n }\n\n const dateStr = this.formatDate(event.at);\n const userStr = this.formatUser(event.by);\n return `${dateStr}${userStr !== '---' ? ` by ${userStr}` : ''}`;\n }\n\n //#endregion\n\n //#region ---- Private Methods ----\n\n private openPopover(): void {\n if (this.infoPopover() && this.infoButton()) {\n this.infoPopover()!.target = this.infoButton()!.nativeElement;\n this.infoPopover()!.open();\n this.isPopoverOpen.set(true);\n }\n }\n\n protected hasHistoryPlugin = computed<boolean>(() => {\n const hasHistoryPlugin = (this.options as any)?.hasHistoryPlugin ?? false;\n return hasHistoryPlugin && this.commandService.exists(SHOW_VERSION_HISTORY_POPUP_COMMAND);\n });\n\n protected async showHistory(): Promise<void> {\n if (!this.hasHistoryPlugin()) {\n return;\n }\n\n const rowData = this.rowData as Record<string, any>;\n const entityId = rowData?.['id'];\n\n if (!entityId) {\n return;\n }\n\n const entityInfo = (this.options as any)?.entityInfo || rowData?.['__entityInfo'];\n const refType = entityInfo?.source || entityInfo?.refType;\n\n if (!refType) {\n return;\n }\n\n const fieldTitles = entityInfo?.fieldTitles || {};\n\n await this.commandService.execute(SHOW_VERSION_HISTORY_POPUP_COMMAND, {\n options: {\n refId: entityId,\n refType,\n fieldTitles,\n },\n });\n }\n\n //#endregion\n}\n","<div class=\"flex items-center gap-1.5\">\n @if (hasAuditInfo()) {\n <div class=\"flex items-center gap-1.5 cursor-pointer hover:opacity-80 transition-opacity\"\n (click)=\"showInfo()\" [title]=\"displayText()\" #infoButton>\n <i class=\"fa-light fa-calendar-circle-exclamation\"></i>\n <span class=\"text-xs\" [dir]=\"'ltr'\">{{ displayDate() }}</span>\n </div>\n } @else {\n <span class=\"text-muted\">---</span>\n }\n</div>\n\n<!-- Audit Info Popover -->\n<ax-popover [openOn]=\"'manual'\" #infoPopover (openChange)=\"onPopoverOpenChange($event)\" [adaptivityEnabled]=\"true\">\n <div class=\"lightest-surface border rounded-lg shadow-lg p-3 min-w-[280px]\">\n <div class=\"mb-3 pb-2 border-b\">\n <h3 class=\"text-sm font-semibold\">\n {{ '@general:terms.audit.section-title' | translate | async }}\n </h3>\n </div>\n <div class=\"space-y-2.5\">\n <!-- Created -->\n @if (createdEvent()) {\n <div>\n <div class=\"text-xs mb-1 font-semibold\">\n {{ '@general:terms.audit.created' | translate | async }}\n </div>\n <div class=\"text-xs space-y-0.5\">\n @if (createdEvent()?.at) {\n <div>\n <span [dir]=\"'ltr'\">{{ formatDate(createdEvent()?.at) }}</span>\n @if (createdEvent()?.by) {\n <span class=\"text-muted\"> • {{ formatUser(createdEvent()?.by) }}</span>\n }\n </div>\n }\n @if (createdEvent()?.reason) {\n <div class=\"text-muted\">{{ createdEvent()?.reason }}</div>\n }\n </div>\n </div>\n }\n\n <!-- Updated -->\n @if (updatedEvent()) {\n <div>\n <div class=\"text-xs mb-1 font-semibold\">\n {{ '@general:terms.audit.updated' | translate | async }}\n </div>\n <div class=\"text-xs space-y-0.5\">\n @if (updatedEvent()?.at) {\n <div>\n <span [dir]=\"'ltr'\">{{ formatDate(updatedEvent()?.at) }}</span>\n @if (updatedEvent()?.by) {\n <span class=\"text-muted\"> • {{ formatUser(updatedEvent()?.by) }}</span>\n }\n </div>\n }\n @if (updatedEvent()?.reason) {\n <div class=\"text-muted\">{{ updatedEvent()?.reason }}</div>\n }\n </div>\n </div>\n }\n\n <!-- Deleted -->\n @if (deletedEvent()) {\n <div>\n <div class=\"text-xs text-muted mb-1 font-semibold\">\n {{ '@general:terms.audit.deleted' | translate | async }}\n </div>\n <div class=\"text-xs space-y-0.5\">\n @if (deletedEvent()?.at) {\n <div>\n <span [dir]=\"'ltr'\">{{ formatDate(deletedEvent()?.at) }}</span>\n @if (deletedEvent()?.by) {\n <span class=\"text-muted\"> • {{ formatUser(deletedEvent()?.by) }}</span>\n }\n </div>\n }\n @if (deletedEvent()?.reason) {\n <div class=\"text-muted\">{{ deletedEvent()?.reason }}</div>\n }\n </div>\n </div>\n }\n </div>\n @if (hasHistoryPlugin()) {\n <div class=\"mt-3 pt-3 border-t ax-sm\">\n <ax-button [text]=\"'@general:terms.audit.history' | translate | async\" (click)=\"showHistory()\" class=\"w-full\">\n </ax-button>\n </div>\n }\n </div>\n</ax-popover>\n"],"names":["i1","i2","i3"],"mappings":";;;;;;;;;;;;;;;AAYA,MAAM,kCAAkC,GAAG,4BAA4B;AASjE,MAAO,2BAA4B,SAAQ,wBAA4C,CAAA;AAP7F,IAAA,WAAA,GAAA;;;AAUmB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,eAAe,CAAC;AACvC,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;;;AAMjD,QAAA,IAAA,CAAA,UAAU,GAAG,SAAS,CAAa,YAAY,iFAAC;AAChD,QAAA,IAAA,CAAA,WAAW,GAAG,SAAS,CAAqB,aAAa,kFAAC;;;AAM1D,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC;AACzB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,KAAK,oFAAC;;;AAM7B,QAAA,IAAA,CAAA,SAAS,GAAG,QAAQ,CAA4B,MAAK;AAC7D,YAAA,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ;AAC3B,YAAA,OAAO,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,GAAI,KAA4B,GAAG,IAAI;AAClF,QAAA,CAAC,gFAAC;AAEQ,QAAA,IAAA,CAAA,WAAW,GAAG,QAAQ,CAAS,MAAK;AAC5C,YAAA,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,EAAE;YAC7B,IAAI,CAAC,IAAI,EAAE;AACT,gBAAA,OAAO,KAAK;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AAA,EAAA,cAAA,EAAA,EAAA,UAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CAAA,YAAY,qEACH,aAAa,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;;;"}
@@ -0,0 +1,127 @@
1
+ import { AXFormatService } from '@acorex/core/format';
2
+ import { AXPValueWidgetComponent } from '@acorex-platform/framework-client/layout/widget-core';
3
+ import * as i0 from '@angular/core';
4
+ import { inject, computed, ChangeDetectionStrategy, Component } from '@angular/core';
5
+ import * as i4 from '@acorex/core/translation';
6
+ import { AXTranslationModule } from '@acorex/core/translation';
7
+ import * as i1 from '@angular/common';
8
+ import { CommonModule } from '@angular/common';
9
+
10
+ class AXPAuditInfoEditComponent extends AXPValueWidgetComponent {
11
+ constructor() {
12
+ super(...arguments);
13
+ this.formatService = inject(AXFormatService);
14
+ this.auditInfo = computed(() => {
15
+ let value = this.getValue();
16
+ if (!value) {
17
+ const contextData = this.contextService.data();
18
+ if (contextData && 'auditInfo' in contextData) {
19
+ value = contextData['auditInfo'];
20
+ }
21
+ }
22
+ return value && typeof value === 'object' ? value : null;
23
+ }, ...(ngDevMode ? [{ debugName: "auditInfo" }] : /* istanbul ignore next */ []));
24
+ this.hasAnyAuditInfo = computed(() => {
25
+ const info = this.auditInfo();
26
+ return !!(info?.created || info?.updated || info?.deleted);
27
+ }, ...(ngDevMode ? [{ debugName: "hasAnyAuditInfo" }] : /* istanbul ignore next */ []));
28
+ }
29
+ formatDate(date) {
30
+ if (!date) {
31
+ return '---';
32
+ }
33
+ try {
34
+ const dateObj = typeof date === 'string' ? new Date(date) : date;
35
+ return this.formatService.format(dateObj, 'datetime', {
36
+ format: 'short',
37
+ });
38
+ }
39
+ catch {
40
+ return '---';
41
+ }
42
+ }
43
+ formatUser(user) {
44
+ if (!user) {
45
+ return '---';
46
+ }
47
+ return user.fullName || user.username || user.id || '---';
48
+ }
49
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPAuditInfoEditComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
50
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: AXPAuditInfoEditComponent, isStandalone: true, selector: "axp-audit-info-edit", usesInheritance: true, ngImport: i0, template: `
51
+ @if (auditInfo() && hasAnyAuditInfo()) {
52
+ <div class="text-xs space-y-1">
53
+ @if (auditInfo()?.created) {
54
+ <div>
55
+ <span class="text-muted">{{ '@general:terms.audit.created' | translate | async }}: </span>
56
+ <span [dir]="'ltr'">{{ formatDate(auditInfo()?.created?.at) }}</span>
57
+ @if (auditInfo()?.created?.by) {
58
+ <span class="text-muted"> • {{ formatUser(auditInfo()?.created?.by) }}</span>
59
+ }
60
+ </div>
61
+ }
62
+ @if (auditInfo()?.updated) {
63
+ <div>
64
+ <span class="text-muted">{{ '@general:terms.audit.updated' | translate | async }}: </span>
65
+ <span [dir]="'ltr'">{{ formatDate(auditInfo()?.updated?.at) }}</span>
66
+ @if (auditInfo()?.updated?.by) {
67
+ <span class="text-muted"> • {{ formatUser(auditInfo()?.updated?.by) }}</span>
68
+ }
69
+ </div>
70
+ }
71
+ @if (auditInfo()?.deleted) {
72
+ <div>
73
+ <span class="text-muted">{{ '@general:terms.audit.deleted' | translate | async }}: </span>
74
+ <span [dir]="'ltr'">{{ formatDate(auditInfo()?.deleted?.at) }}</span>
75
+ @if (auditInfo()?.deleted?.by) {
76
+ <span class="text-muted"> • {{ formatUser(auditInfo()?.deleted?.by) }}</span>
77
+ }
78
+ </div>
79
+ }
80
+ </div>
81
+ }
82
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
83
+ }
84
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPAuditInfoEditComponent, decorators: [{
85
+ type: Component,
86
+ args: [{
87
+ selector: 'axp-audit-info-edit',
88
+ template: `
89
+ @if (auditInfo() && hasAnyAuditInfo()) {
90
+ <div class="text-xs space-y-1">
91
+ @if (auditInfo()?.created) {
92
+ <div>
93
+ <span class="text-muted">{{ '@general:terms.audit.created' | translate | async }}: </span>
94
+ <span [dir]="'ltr'">{{ formatDate(auditInfo()?.created?.at) }}</span>
95
+ @if (auditInfo()?.created?.by) {
96
+ <span class="text-muted"> • {{ formatUser(auditInfo()?.created?.by) }}</span>
97
+ }
98
+ </div>
99
+ }
100
+ @if (auditInfo()?.updated) {
101
+ <div>
102
+ <span class="text-muted">{{ '@general:terms.audit.updated' | translate | async }}: </span>
103
+ <span [dir]="'ltr'">{{ formatDate(auditInfo()?.updated?.at) }}</span>
104
+ @if (auditInfo()?.updated?.by) {
105
+ <span class="text-muted"> • {{ formatUser(auditInfo()?.updated?.by) }}</span>
106
+ }
107
+ </div>
108
+ }
109
+ @if (auditInfo()?.deleted) {
110
+ <div>
111
+ <span class="text-muted">{{ '@general:terms.audit.deleted' | translate | async }}: </span>
112
+ <span [dir]="'ltr'">{{ formatDate(auditInfo()?.deleted?.at) }}</span>
113
+ @if (auditInfo()?.deleted?.by) {
114
+ <span class="text-muted"> • {{ formatUser(auditInfo()?.deleted?.by) }}</span>
115
+ }
116
+ </div>
117
+ }
118
+ </div>
119
+ }
120
+ `,
121
+ changeDetection: ChangeDetectionStrategy.OnPush,
122
+ imports: [CommonModule, AXTranslationModule],
123
+ }]
124
+ }] });
125
+
126
+ export { AXPAuditInfoEditComponent };
127
+ //# sourceMappingURL=acorex-platform-module-common-client-audit-info-edit.component-CSsCG6Dz.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-common-client-audit-info-edit.component-CSsCG6Dz.mjs","sources":["../../../../libs/modules/common/client/src/lib/features/history-plugin/components/audit-info-edit.component.ts"],"sourcesContent":["import { AXPRecordAuditInfo } from '@acorex-platform/framework-shared/entity';\nimport { AXFormatService } from '@acorex/core/format';\nimport { AXPValueWidgetComponent } from '@acorex-platform/framework-client/layout/widget-core';\n\nimport { ChangeDetectionStrategy, Component, computed, inject } from '@angular/core';\nimport { AXTranslationModule } from '@acorex/core/translation';\nimport { CommonModule } from '@angular/common';\n\n@Component({\n selector: 'axp-audit-info-edit',\n template: `\n @if (auditInfo() && hasAnyAuditInfo()) {\n <div class=\"text-xs space-y-1\">\n @if (auditInfo()?.created) {\n <div>\n <span class=\"text-muted\">{{ '@general:terms.audit.created' | translate | async }}: </span>\n <span [dir]=\"'ltr'\">{{ formatDate(auditInfo()?.created?.at) }}</span>\n @if (auditInfo()?.created?.by) {\n <span class=\"text-muted\"> • {{ formatUser(auditInfo()?.created?.by) }}</span>\n }\n </div>\n }\n @if (auditInfo()?.updated) {\n <div>\n <span class=\"text-muted\">{{ '@general:terms.audit.updated' | translate | async }}: </span>\n <span [dir]=\"'ltr'\">{{ formatDate(auditInfo()?.updated?.at) }}</span>\n @if (auditInfo()?.updated?.by) {\n <span class=\"text-muted\"> • {{ formatUser(auditInfo()?.updated?.by) }}</span>\n }\n </div>\n }\n @if (auditInfo()?.deleted) {\n <div>\n <span class=\"text-muted\">{{ '@general:terms.audit.deleted' | translate | async }}: </span>\n <span [dir]=\"'ltr'\">{{ formatDate(auditInfo()?.deleted?.at) }}</span>\n @if (auditInfo()?.deleted?.by) {\n <span class=\"text-muted\"> • {{ formatUser(auditInfo()?.deleted?.by) }}</span>\n }\n </div>\n }\n </div>\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [CommonModule, AXTranslationModule],\n})\nexport class AXPAuditInfoEditComponent extends AXPValueWidgetComponent<AXPRecordAuditInfo> {\n private readonly formatService = inject(AXFormatService);\n\n protected auditInfo = computed<AXPRecordAuditInfo | null>(() => {\n let value = this.getValue();\n\n if (!value) {\n const contextData = this.contextService.data() as Record<string, any>;\n if (contextData && 'auditInfo' in contextData) {\n value = contextData['auditInfo'];\n }\n }\n\n return value && typeof value === 'object' ? (value as AXPRecordAuditInfo) : null;\n });\n\n protected hasAnyAuditInfo = computed<boolean>(() => {\n const info = this.auditInfo();\n return !!(info?.created || info?.updated || info?.deleted);\n });\n\n protected formatDate(date: Date | string | undefined): string {\n if (!date) {\n return '---';\n }\n\n try {\n const dateObj = typeof date === 'string' ? new Date(date) : date;\n return this.formatService.format(dateObj, 'datetime', {\n format: 'short',\n });\n } catch {\n return '---';\n }\n }\n\n protected formatUser(user: any): string {\n if (!user) {\n return '---';\n }\n\n return user.fullName || user.username || user.id || '---';\n }\n}\n"],"names":["i2"],"mappings":";;;;;;;;;AA8CM,MAAO,yBAA0B,SAAQ,uBAA2C,CAAA;AAtC1F,IAAA,WAAA,GAAA;;AAuCmB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,eAAe,CAAC;AAE9C,QAAA,IAAA,CAAA,SAAS,GAAG,QAAQ,CAA4B,MAAK;AAC7D,YAAA,IAAI,KAAK,GAAG,IAAI,CAAC,QAAQ,EAAE;YAE3B,IAAI,CAAC,KAAK,EAAE;gBACV,MAAM,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,EAAyB;AACrE,gBAAA,IAAI,WAAW,IAAI,WAAW,IAAI,WAAW,EAAE;AAC7C,oBAAA,KAAK,GAAG,WAAW,CAAC,WAAW,CAAC;gBAClC;YACF;AAEA,YAAA,OAAO,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,GAAI,KAA4B,GAAG,IAAI;AAClF,QAAA,CAAC,gFAAC;AAEQ,QAAA,IAAA,CAAA,eAAe,GAAG,QAAQ,CAAU,MAAK;AACjD,YAAA,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,EAAE;AAC7B,YAAA,OAAO,CAAC,EAAE,IAAI,EAAE,OAAO,IAAI,IAA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