import { OnInit, OnDestroy, ChangeDetectorRef } from '@angular/core';
import { MJActionEntity, MJActionCategoryEntity, MJActionExecutionLogEntity, ResourceData } from '@memberjunction/core-entities';
import { BaseResourceComponent } from '@memberjunction/ng-shared';
import { FilterFieldConfig } from '@memberjunction/ng-ui-components';
import { Subject, BehaviorSubject } from 'rxjs';
import * as i0 from "@angular/core";
interface ActionMetrics {
    totalActions: number;
    activeActions: number;
    pendingActions: number;
    disabledActions: number;
    totalExecutions: number;
    recentExecutions: number;
    successRate: number;
    totalCategories: number;
    aiGeneratedActions: number;
    customActions: number;
}
interface CategoryStats {
    categoryId: string;
    categoryName: string;
    actionCount: number;
    executionCount: number;
    successRate: number;
}
interface ExecutionWithExpanded extends MJActionExecutionLogEntity {
    isExpanded?: boolean;
}
/**
 * Actions Overview Resource - displays action management dashboard
 */
export declare class ActionsOverviewComponent extends BaseResourceComponent implements OnInit, OnDestroy {
    private cdr;
    isLoading: boolean;
    metrics: ActionMetrics;
    categoryStats: CategoryStats[];
    recentActions: MJActionEntity[];
    recentExecutions: ExecutionWithExpanded[];
    topCategories: MJActionCategoryEntity[];
    /** Full (un-sliced) collections retained so agent tools can resolve any id, not just the visible top-10. */
    private allActions;
    private allExecutions;
    private allCategories;
    /** Last action the agent (or user) selected/opened — surfaced in context as id + name. */
    private selectedAction;
    searchTerm$: BehaviorSubject<string>;
    selectedStatus$: BehaviorSubject<string>;
    selectedType$: BehaviorSubject<string>;
    /** Allowed status filter values (mirrors the Filter popover dropdown). */
    private readonly statusFilterValues;
    /** Allowed type filter values (mirrors the Filter popover dropdown). */
    private readonly typeFilterValues;
    /** Allowed sort fields for the visible-actions list. */
    private readonly sortFieldValues;
    /** Allowed sort directions. */
    private readonly sortDirectionValues;
    protected destroy$: Subject<void>;
    constructor(cdr: ChangeDetectorRef);
    ngOnInit(): void;
    ngOnDestroy(): void;
    private setupFilters;
    /** Publish the current overview state to the agent. Called on load and on every filter change.
     *  Deep context: counts by status/type, success rate, all filter state, the visible
     *  (bounded) action + category names, and the currently selected action (id + name). */
    private publishAgentContext;
    /** Register the read-only / navigational client tools the agent can invoke on this surface. */
    private registerAgentTools;
    private loadData;
    private calculateMetrics;
    private calculateSuccessRate;
    private calculateCategoryStats;
    private loadFilteredData;
    onSearchChange(searchTerm: string): void;
    onStatusFilterChange(status: string): void;
    onTypeFilterChange(type: string): void;
    get FilterFields(): FilterFieldConfig[];
    get FilterValues(): Record<string, unknown>;
    get ActiveFilterCount(): number;
    onFilterValuesChange(v: Record<string, unknown>): void;
    resetFilters(): void;
    openAction(action: MJActionEntity): void;
    /** Sort the visible recent-actions list in place (agent tool — view-only). */
    private sortVisibleActions;
    openCategory(categoryId: string): void;
    openExecution(execution: MJActionExecutionLogEntity): void;
    isExecutionSuccess(execution: MJActionExecutionLogEntity): boolean;
    getStatusColor(status: string): 'success' | 'warning' | 'error' | 'info';
    getTypeIcon(type: string): string;
    onTotalActionsClick(): void;
    onExecutionsClick(): void;
    onCategoriesClick(): void;
    onAIGeneratedClick(): void;
    onActionGalleryClick(): void;
    formatJsonParams(params: string | null): string;
    /**
     * Gets the icon class for an action
     * Falls back to type-based icon if no IconClass is set
     */
    getActionIcon(action: MJActionEntity): string;
    GetResourceDisplayName(data: ResourceData): Promise<string>;
    GetResourceIconClass(data: ResourceData): Promise<string>;
    static ɵfac: i0.ɵɵFactoryDeclaration<ActionsOverviewComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<ActionsOverviewComponent, "mj-actions-overview", never, {}, {}, never, never, false, never>;
}
export {};
//# sourceMappingURL=actions-overview.component.d.ts.map