import { OnInit, OnDestroy, EventEmitter, ChangeDetectorRef } from '@angular/core';
import { MJAPIApplicationEntity, MJAPIApplicationScopeEntity, MJAPIScopeEntity } from '@memberjunction/core-entities';
import { BaseAngularComponent } from '@memberjunction/ng-base-types';
import * as i0 from "@angular/core";
/** Application with scope count */
interface ApplicationWithScopes {
    application: MJAPIApplicationEntity;
    scopeCount: number;
    expanded: boolean;
    scopes: MJAPIApplicationScopeEntity[];
}
/** Scope with selection state for application assignment */
interface ScopeSelection {
    scope: MJAPIScopeEntity;
    selected: boolean;
    pattern: string;
    patternType: 'Include' | 'Exclude';
    isDeny: boolean;
    priority: number;
    displayName: string;
}
/** Scope category for grouping */
interface ScopeCategory {
    name: string;
    icon: string;
    color: string;
    scopes: ScopeSelection[];
    expanded: boolean;
    allSelected: boolean;
}
/**
 * API Applications Panel Component
 * Manages API Applications and their scope assignments
 */
export declare class APIApplicationsPanelComponent extends BaseAngularComponent implements OnInit, OnDestroy {
    ApplicationUpdated: EventEmitter<void>;
    private get md();
    private cdr;
    IsLoading: boolean;
    IsSaving: boolean;
    Applications: ApplicationWithScopes[];
    AllScopes: MJAPIScopeEntity[];
    EditingApplication: MJAPIApplicationEntity | null;
    EditName: string;
    EditDescription: string;
    EditIsActive: boolean;
    ScopeSelections: ScopeSelection[];
    ShowCreatePanel: boolean;
    ShowEditPanel: boolean;
    SelectedApplication: ApplicationWithScopes | null;
    EditTab: 'details' | 'scopes';
    PanelWidth: number;
    IsResizing: boolean;
    private resizeStartX;
    private resizeStartWidth;
    private widthSaveTimeout;
    private DetailsChanged;
    private ScopesChanged;
    ScopeCategories: ScopeCategory[];
    SuccessMessage: string;
    ErrorMessage: string;
    private readonly defaultUIConfig;
    constructor(cdr: ChangeDetectorRef);
    ngOnInit(): Promise<void>;
    ngOnDestroy(): void;
    /**
     * Handle mouse move during resize
     */
    onMouseMove(event: MouseEvent): void;
    /**
     * Handle mouse up to stop resize
     */
    onMouseUp(): void;
    /**
     * Start resizing the panel
     */
    startResize(event: MouseEvent): void;
    /**
     * Load saved panel width from user settings
     */
    private loadPanelWidth;
    /**
     * Debounced save of panel width
     */
    private debouncedSavePanelWidth;
    /**
     * Save panel width to user settings
     */
    private savePanelWidth;
    /**
     * Load all applications and scopes
     * Uses cached data from APIKeysEngineBase for better performance
     */
    loadData(): void;
    /**
     * Open create panel (slide-out)
     */
    openCreatePanel(): void;
    /**
     * Save application (create only - for create panel)
     */
    saveApplication(): Promise<void>;
    /**
     * Open edit panel (slide-out) with optional direct-to-scopes tab
     */
    openEditPanel(appItem: ApplicationWithScopes, goToScopes?: boolean): void;
    /**
     * Build scope categories with proper display names.
     * Uses UIConfig from root scopes for category icons/colors.
     */
    private buildScopeCategories;
    /**
     * Toggle category expansion
     */
    toggleScopeCategory(category: ScopeCategory): void;
    /**
     * Toggle all scopes in a category
     */
    toggleCategoryAll(category: ScopeCategory): void;
    /**
     * Update category state when individual scope changes
     */
    updateCategoryState(category: ScopeCategory): void;
    /**
     * Get total selected scope count
     */
    getSelectedScopeCount(): number;
    /**
     * Get selected scope count for a category
     */
    getCategorySelectedCount(category: ScopeCategory): number;
    /**
     * Save scope assignments (legacy - now handled by saveAll)
     */
    saveScopeAssignments(): Promise<void>;
    /**
     * Toggle application expansion
     */
    toggleExpanded(appItem: ApplicationWithScopes): void;
    /**
     * Close all panels
     */
    closePanel(): void;
    /**
     * Save all changes (both details and scopes)
     */
    saveAll(): Promise<void>;
    /**
     * Internal method to save scope assignments atomically — any failure rolls back every change
     */
    private saveScopeAssignmentsInternal;
    /**
     * Get icon for pattern type
     */
    getPatternIcon(patternType: string, isDeny: boolean): string;
    /**
     * Get class for pattern type
     */
    getPatternClass(patternType: string, isDeny: boolean): string;
    /**
     * Get scope name by ID
     */
    getScopeName(scopeId: string): string;
    static ɵfac: i0.ɵɵFactoryDeclaration<APIApplicationsPanelComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<APIApplicationsPanelComponent, "mj-api-applications-panel", never, {}, { "ApplicationUpdated": "ApplicationUpdated"; }, never, never, false, never>;
}
export {};
//# sourceMappingURL=api-applications-panel.component.d.ts.map