/**
 * @fileoverview Content Autotagging Dashboard
 *
 * Full dashboard for the content autotagging pipeline with left-nav and 5 tabs:
 * Pipeline Monitor, Sources Management, Content Types, Tag Library, Run History.
 * Supports CRUD on sources and content types via slide-in forms,
 * pipeline triggering with real-time GraphQL subscription progress.
 */
import { OnDestroy, AfterViewInit } from '@angular/core';
import { CompositeKey } from '@memberjunction/core';
import { TreeBranchConfig, TreeLeafConfig } from '@memberjunction/ng-trees';
import { ResourceData } from '@memberjunction/core-entities';
import { BaseResourceComponent } from '@memberjunction/ng-shared';
import * as i0 from "@angular/core";
type TabName = 'pipeline' | 'sources' | 'types' | 'tags' | 'history';
interface NavItem {
    Tab: TabName;
    Icon: string;
    Label: string;
    BadgeText: string;
    BadgeClass: string;
}
interface KPIMetric {
    Label: string;
    Value: number;
    Icon: string;
    Trend: string;
    TrendUp: boolean;
}
interface PipelineStageInfo {
    Name: string;
    Icon: string;
    Status: 'idle' | 'active' | 'complete';
    Count: string;
}
interface FeedItem {
    Name: string;
    SourceName: string;
    Tags: string[];
    TimeAgo: string;
    Status: 'complete' | 'processing' | 'error';
}
interface SourceMini {
    ID: string;
    Name: string;
    Icon: string;
    Meta: string;
    StatusClass: 'active' | 'error' | 'inactive';
}
interface SourceCard {
    ID: string;
    Name: string;
    SourceTypeName: string;
    ContentTypeName: string;
    FileTypeName: string;
    Icon: string;
    StatusClass: 'active' | 'error' | 'inactive';
    StatusLabel: string;
    URL: string;
    ItemCount: number;
    TagCount: number;
    AvgTags: string;
    LastRunAgo: string;
    ContentSourceTypeID: string;
    ContentTypeID: string;
    ContentFileTypeID: string;
    EmbeddingModelID: string;
    VectorIndexID: string;
}
interface ContentTypeCard {
    ID: string;
    Name: string;
    Description: string;
    AIModelName: string;
    AIModelID: string;
    MinTags: number;
    MaxTags: number;
    SourcesUsing: number;
    ItemsTagged: number;
    RangeLeftPct: number;
    RangeRightPct: number;
    EmbeddingModelID: string;
    VectorIndexID: string;
}
interface TagRow {
    Tag: string;
    UsageCount: number;
    AvgWeight: number;
    BarWidthPct: number;
    TopSource: string;
    FirstSeen: string;
}
interface TagCloudItem {
    Tag: string;
    AvgWeight: number;
    SizeClass: 'large' | '' | 'small';
}
interface TagBySource {
    SourceName: string;
    Count: number;
}
interface RunHistoryRow {
    ID: string;
    Status: string;
    StatusClass: string;
    SourceName: string;
    StartedDisplay: string;
    Duration: string;
    Items: string;
    Tags: string;
    Errors: string;
    ErrorClass: string;
}
interface DropdownOption {
    ID: string;
    Name: string;
}
interface ContentItemDetail {
    ID: string;
    Name: string;
    SourceName: string;
    SourceTypeName: string;
    ContentTypeName: string;
    FileTypeName: string;
    URL: string;
    TextContent: string;
    Checksum: string;
    Tags: string[];
    CreatedAt: string;
    UpdatedAt: string;
    ContentSourceID: string;
    StatusDot: 'complete' | 'processing' | 'error';
    TagCount: number;
}
interface SourceDetailInfo {
    ID: string;
    Name: string;
    SourceTypeName: string;
    FileTypeName: string;
    ContentTypeName: string;
    StatusClass: 'active' | 'error' | 'inactive';
    StatusLabel: string;
    Icon: string;
    URL: string;
    EmbeddingModelName: string;
    VectorIndexName: string;
    ItemCount: number;
    TagCount: number;
    AvgTags: string;
    LastRunAgo: string;
    ErrorCount: number;
    ContentItems: ContentItemDetail[];
    RunHistory: RunHistoryRow[];
}
type FormMode = 'none' | 'add-source' | 'edit-source' | 'add-type' | 'edit-type';
export declare class AutotaggingPipelineResourceComponent extends BaseResourceComponent implements AfterViewInit, OnDestroy {
    private destroy$;
    private cdr;
    private navigationService;
    IsLoading: boolean;
    ActiveTab: TabName;
    private tabDataLoaded;
    NavItems: NavItem[];
    KPIMetrics: KPIMetric[];
    PipelineStages: PipelineStageInfo[];
    FeedItems: FeedItem[];
    SourceMinis: SourceMini[];
    TrendingTags: TagCloudItem[];
    IsRunning: boolean;
    RunProgress: number;
    RunStage: string;
    RunCurrentItem: string;
    SourceCards: SourceCard[];
    ContentTypeCards: ContentTypeCard[];
    TagRows: TagRow[];
    TagCloud: TagCloudItem[];
    TagsBySource: TagBySource[];
    TagSearchQuery: string;
    FilteredTagRows: TagRow[];
    RunHistoryRows: RunHistoryRow[];
    HistorySourceFilter: string;
    HistoryStatusFilter: string;
    FilteredRunRows: RunHistoryRow[];
    HistorySourceOptions: string[];
    FormMode: FormMode;
    FormSaving: boolean;
    FormSourceName: string;
    FormSourceTypeID: string;
    FormContentTypeID: string;
    FormFileTypeID: string;
    FormSourceURL: string;
    EditingSourceID: string;
    FormTypeName: string;
    FormTypeDescription: string;
    FormTypeAIModelID: string;
    FormTypeMinTags: number;
    FormTypeMaxTags: number;
    EditingTypeID: string;
    FormTypeEmbeddingModelID: string;
    FormTypeVectorIndexID: string;
    FormSourceEmbeddingModelID: string;
    FormSourceVectorIndexID: string;
    SelectedFeedItem: ContentItemDetail | null;
    ShowItemDetail: boolean;
    SelectedSource: SourceDetailInfo | null;
    ShowSourceDetail: boolean;
    SourceDetailLoading: boolean;
    SourceTypeOptions: DropdownOption[];
    ContentTypeOptions: DropdownOption[];
    FileTypeOptions: DropdownOption[];
    AIModelOptions: DropdownOption[];
    EmbeddingModelOptions: DropdownOption[];
    VectorIndexOptions: DropdownOption[];
    AIModelVendorBranch: TreeBranchConfig;
    AllModelsLeaf: TreeLeafConfig;
    EmbeddingModelsLeaf: TreeLeafConfig;
    private contentSourcesRaw;
    private contentItemsRaw;
    private contentTagsRaw;
    private contentRunsRaw;
    private contentSourceTypesRaw;
    private contentTypesRaw;
    private contentFileTypesRaw;
    private aiModelsRaw;
    ngAfterViewInit(): Promise<void>;
    ngOnDestroy(): void;
    GetResourceDisplayName(_data: ResourceData): Promise<string>;
    GetResourceIconClass(_data: ResourceData): Promise<string>;
    SwitchTab(tab: TabName): Promise<void>;
    private loadTabData;
    LoadPipelineData(): Promise<void>;
    private buildNavItems;
    private buildKPIMetrics;
    private buildPipelineStages;
    private buildFeedItems;
    private buildSourceMinis;
    private buildTrendingTags;
    private loadSourcesData;
    private buildSourceCards;
    private loadContentTypesData;
    private buildContentTypeCards;
    private loadTagLibraryData;
    private buildTagRows;
    private buildTagCloud;
    private buildTagsBySource;
    /** Convert a string ID to a CompositeKey for tree-dropdown binding */
    ToCompositeKey(id: string | null | undefined): CompositeKey | null;
    /** Extract the ID string from a CompositeKey (from tree-dropdown ValueChange) */
    FromCompositeKey(key: CompositeKey | CompositeKey[] | null): string;
    FilterTags(): void;
    private loadRunHistoryData;
    private buildRunHistoryRows;
    private buildHistorySourceOptions;
    FilterRunHistory(): void;
    OpenAddSourceForm(): Promise<void>;
    OpenEditSourceForm(card: SourceCard): Promise<void>;
    SaveSource(): Promise<void>;
    DeleteSource(card: SourceCard): Promise<void>;
    OpenAddTypeForm(): Promise<void>;
    OpenEditTypeForm(card: ContentTypeCard): Promise<void>;
    SaveContentType(): Promise<void>;
    CloseForm(): void;
    RunPipeline(): Promise<void>;
    private subscribeToPipelineProgress;
    private updateStagesForActiveRun;
    private formatStageName;
    private countTagsByItem;
    private getTopTagsForItem;
    private countItemsBySource;
    private countTagsBySource;
    private getLastRunBySource;
    private countAllTags;
    /** Compute average weight per tag across all occurrences */
    private computeAvgWeights;
    private getTopSourcePerTag;
    private getFirstSeenPerTag;
    private countSourcesByContentType;
    private countItemsByContentType;
    private inferItemStatus;
    formatRelativeTime(dateStr: string | null | undefined): string;
    formatNumber(n: number): string;
    private formatShortDate;
    private formatDate;
    private computeDuration;
    private displayStatus;
    GetSourceTypeIcon(typeName: string): string;
    private ensureBaseDataLoaded;
    private ensureFormDropdownsLoaded;
    private resetSourceForm;
    private resetTypeForm;
    private refreshSourcesTab;
    private refreshContentTypesTab;
    OpenFeedItemDetail(index: number): void;
    OpenContentItemDetail(item: ContentItemDetail): void;
    CloseItemDetail(): void;
    OpenRecordFromItem(item: ContentItemDetail): void;
    private getAllTagsForItem;
    OpenSourceDetail(card: SourceCard): Promise<void>;
    CloseSourceDetail(): void;
    OpenRecordFromSource(source: SourceDetailInfo): void;
    OpenEditSourceFromDetail(): void;
    RunSourceFromDetail(): Promise<void>;
    DeleteSourceFromDetail(): Promise<void>;
    private loadContentItemsForSource;
    private loadRunHistoryForSource;
    private resolveEmbeddingModelName;
    private resolveVectorIndexName;
    static ɵfac: i0.ɵɵFactoryDeclaration<AutotaggingPipelineResourceComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<AutotaggingPipelineResourceComponent, "app-autotagging-pipeline-resource", never, {}, {}, never, never, false, never>;
}
export declare function LoadAutotaggingPipelineResource(): void;
export {};
//# sourceMappingURL=autotagging-pipeline-resource.component.d.ts.map