import { OnInit, OnDestroy, ChangeDetectorRef } from '@angular/core';
import { BaseResourceComponent, NavigationService } from '@memberjunction/ng-shared';
import { ResourceData, MJVersionLabelEntityType } from '@memberjunction/core-entities';
import * as i0 from "@angular/core";
interface DiffItemView {
    EntityName: string;
    EntityID: string;
    RecordID: string;
    DisplayName: string;
    ChangeType: 'Added' | 'Removed' | 'Modified' | 'Unchanged';
    FieldChanges: FieldChangeView[];
    IsExpanded: boolean;
    IsLoadingFields: boolean;
    FieldsLoaded: boolean;
    /** RecordChangeID from the "from" label (for loading FullRecordJSON). */
    FromRecordChangeID: string;
    /** RecordChangeID from the "to" label (for loading FullRecordJSON). */
    ToRecordChangeID: string;
}
interface FieldChangeView {
    FieldName: string;
    OldValue: string;
    NewValue: string;
    ChangeType: 'Added' | 'Modified' | 'Removed';
}
interface EntityGroupView {
    EntityName: string;
    EntityIcon: string;
    Items: DiffItemView[];
    AddedCount: number;
    RemovedCount: number;
    ModifiedCount: number;
    IsExpanded: boolean;
    NamesLoaded: boolean;
    IsLoadingNames: boolean;
}
export declare class VersionHistoryDiffResourceComponent extends BaseResourceComponent implements OnInit, OnDestroy {
    private cdr;
    private navigationService;
    IsLoading: boolean;
    IsDiffLoading: boolean;
    HasDiffResult: boolean;
    AvailableLabels: MJVersionLabelEntityType[];
    FromLabelId: string;
    ToLabelId: string;
    DiffMode: 'label-to-label' | 'label-to-current';
    EntityGroups: EntityGroupView[];
    FilteredEntityGroups: EntityGroupView[];
    TotalAdded: number;
    TotalRemoved: number;
    TotalModified: number;
    TotalUnchanged: number;
    DiffSortBy: 'name' | 'count';
    DiffSortDir: 'asc' | 'desc';
    DiffFilterType: 'all' | 'added' | 'removed' | 'modified';
    DiffSearch: string;
    ExpandedEntities: Set<string>;
    private static readonly PREFS_KEY;
    private preferencesLoaded;
    private destroy$;
    private metadata;
    constructor(cdr: ChangeDetectorRef, navigationService: NavigationService);
    ngOnInit(): void;
    ngOnDestroy(): void;
    GetResourceDisplayName(data: ResourceData): Promise<string>;
    GetResourceIconClass(data: ResourceData): Promise<string>;
    LoadLabels(): Promise<void>;
    OnDiffModeChange(mode: 'label-to-label' | 'label-to-current'): void;
    private loadUserPreferences;
    private persistPreferences;
    RunDiff(): Promise<void>;
    private loadLabelItems;
    private computeDiff;
    private computeDiffToCurrentState;
    private buildItemKeyMap;
    private buildEntityGroups;
    private resolveEntityName;
    private resolveEntityIcon;
    ToggleEntityGroup(group: EntityGroupView): void;
    ToggleItem(item: DiffItemView): void;
    ExpandAllGroups(): void;
    CollapseAllGroups(): void;
    IsEntityExpanded(entityName: string): boolean;
    /** Open a record in the explorer via NavigationService. */
    OnOpenRecord(item: DiffItemView): void;
    /** Lazy-load record display names for a group using Metadata.GetEntityRecordNames. */
    private loadGroupRecordNames;
    /** Extract the raw UUID from a RecordID that may be in "ID|<uuid>" format. */
    private extractRawRecordId;
    /** Auto-load field changes for all modified items in a group (when first expanded). */
    private loadFieldChangesForGroup;
    /** Lazy-load field-level changes for a single modified item. */
    private loadFieldChangesForItem;
    private loadLatestRecordChange;
    private computeFieldChanges;
    private diffRecordJson;
    private formatFieldValue;
    GetChangeTypeClass(changeType: string): string;
    GetChangeTypeIcon(changeType: string): string;
    FormatRecordID(recordId: string): string;
    FormatLabelOption(label: MJVersionLabelEntityType): string;
    Refresh(): void;
    get CanRunDiff(): boolean;
    get TotalChanges(): number;
    /** From dropdown excludes the currently selected To label. */
    get FilteredFromLabels(): MJVersionLabelEntityType[];
    /** To dropdown excludes the currently selected From label. */
    get FilteredToLabels(): MJVersionLabelEntityType[];
    /** Swap From and To label selections. */
    SwapLabels(): void;
    OnDiffSortChange(sortBy: 'name' | 'count'): void;
    OnDiffFilterChange(filterType: 'all' | 'added' | 'removed' | 'modified'): void;
    OnDiffSearchChange(text: string): void;
    private applySortAndFilterDiff;
    static ɵfac: i0.ɵɵFactoryDeclaration<VersionHistoryDiffResourceComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<VersionHistoryDiffResourceComponent, "mj-version-history-diff-resource", never, {}, {}, never, never, false, never>;
}
export {};
//# sourceMappingURL=diff-resource.component.d.ts.map