/**
 * @fileoverview Agent Run Analysis -- Cost Attribution Focus.
 *
 * Displays agent run stats, cost attribution horizontal stacked bars per agent,
 * and a sortable recent agent runs table. All data loaded via RunView from
 * "MJ: AI Agent Runs" and "MJ: AI Prompt Runs" entities.
 */
import { EventEmitter, OnInit, OnDestroy } from '@angular/core';
import { BaseAngularComponent } from '@memberjunction/ng-base-types';
import { GlobalFilterState } from '../../../interfaces/analytics-preferences.interface';
import * as i0 from "@angular/core";
interface AgentRunFilters {
    Agents: string[];
    Statuses: string[];
}
interface AgentRunStats {
    TotalRuns: number;
    TotalCost: number;
    PromptRuns: number;
    AvgCostPerRun: number;
    SuccessRate: number;
    AvgDurationSeconds: number;
}
interface CostAttributionRow {
    AgentName: string;
    AgentID: string;
    TotalCost: number;
    Segments: CostSegment[];
}
interface CostSegment {
    Label: string;
    Value: number;
    Percent: number;
    Color: string;
}
interface RecentRunRow {
    ID: string;
    Agent: string;
    Status: string;
    StatusClass: string;
    StepCount: number;
    Duration: string;
    Cost: string;
    Time: string;
}
type SortField = 'Agent' | 'Status' | 'StepCount' | 'Duration' | 'Cost' | 'Time';
type SortDirection = 'asc' | 'desc';
export declare class AnalyticsAgentRunsComponent extends BaseAngularComponent implements OnInit, OnDestroy {
    private _timeRange;
    set TimeRange(value: string);
    get TimeRange(): string;
    private _filters;
    set Filters(value: AgentRunFilters);
    get Filters(): AgentRunFilters;
    private shallowFiltersEqual;
    TimeRangeChange: EventEmitter<string>;
    FiltersChange: EventEmitter<AgentRunFilters>;
    private initialized;
    private cdr;
    private destroy$;
    IsLoading: boolean;
    Stats: AgentRunStats;
    CostAttributionRows: CostAttributionRow[];
    LegendItems: {
        Label: string;
        Color: string;
    }[];
    RecentRuns: RecentRunRow[];
    SortField: SortField;
    SortDir: SortDirection;
    TableColumns: {
        field: SortField;
        label: string;
    }[];
    /** Bridge the local filter shape to the global shape the filter bar expects */
    get globalFilters(): GlobalFilterState;
    private agentRuns;
    private promptRuns;
    ngOnInit(): void;
    ngOnDestroy(): void;
    OnTimeRangeChange(range: string): void;
    OnFiltersChange(filters: GlobalFilterState): void;
    OnSort(field: SortField): void;
    FormatCurrency(value: number, decimals?: number): string;
    private LoadData;
    private computeStats;
    private get agentRunIdSet();
    private computeCostAttribution;
    private buildRecentRuns;
    private sortRecentRuns;
    private buildDateFilter;
    private buildAgentFilter;
    private buildStatusFilter;
    private timeRangeToMs;
    private getStatusClass;
    private formatDuration;
    private formatRelativeTime;
    static ɵfac: i0.ɵɵFactoryDeclaration<AnalyticsAgentRunsComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<AnalyticsAgentRunsComponent, "app-analytics-agent-runs", never, { "TimeRange": { "alias": "TimeRange"; "required": false; }; "Filters": { "alias": "Filters"; "required": false; }; }, { "TimeRangeChange": "TimeRangeChange"; "FiltersChange": "FiltersChange"; }, never, never, false, never>;
}
export declare function LoadAnalyticsAgentRuns(): void;
export {};
//# sourceMappingURL=agent-run-analysis.component.d.ts.map