var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { Component, ChangeDetectionStrategy } from '@angular/core';
import { BaseDashboard } from '@memberjunction/ng-shared';
import { RegisterClass } from '@memberjunction/global';
import { Subject } from 'rxjs';
import { debounceTime } from 'rxjs/operators';
import { SharedService } from '@memberjunction/ng-shared';
import { RunView } from '@memberjunction/core';
import * as i0 from "@angular/core";
import * as i1 from "./components/credentials-overview-resource.component";
import * as i2 from "./components/credentials-list-resource.component";
import * as i3 from "./components/credentials-types-resource.component";
import * as i4 from "./components/credentials-categories-resource.component";
import * as i5 from "./components/credentials-audit-resource.component";
function CredentialsDashboardComponent_Conditional_29_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 14);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(ctx_r0.credentialCount);
} }
function CredentialsDashboardComponent_Conditional_34_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 14);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(ctx_r0.typeCount);
} }
function CredentialsDashboardComponent_Case_48_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 20);
    i0.ɵɵelement(1, "mj-credentials-overview-resource");
    i0.ɵɵelementEnd();
} }
function CredentialsDashboardComponent_Case_49_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 20);
    i0.ɵɵelement(1, "mj-credentials-list-resource");
    i0.ɵɵelementEnd();
} }
function CredentialsDashboardComponent_Case_50_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 20);
    i0.ɵɵelement(1, "mj-credentials-types-resource");
    i0.ɵɵelementEnd();
} }
function CredentialsDashboardComponent_Case_51_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 20);
    i0.ɵɵelement(1, "mj-credentials-categories-resource");
    i0.ɵɵelementEnd();
} }
function CredentialsDashboardComponent_Case_52_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 20);
    i0.ɵɵelement(1, "mj-credentials-audit-resource");
    i0.ɵɵelementEnd();
} }
let CredentialsDashboardComponent = class CredentialsDashboardComponent extends BaseDashboard {
    cdr;
    isLoading = false;
    activeTab = 'overview';
    selectedIndex = 0;
    // Counts for badges
    credentialCount = 0;
    typeCount = 0;
    // Track visited tabs for lazy loading
    visitedTabs = new Set();
    // Navigation items
    navigationItems = ['overview', 'credentials', 'types', 'categories', 'audit'];
    tabLabels = {
        'overview': 'Overview',
        'credentials': 'Credentials',
        'types': 'Credential Types',
        'categories': 'Categories',
        'audit': 'Audit Trail'
    };
    stateChangeSubject = new Subject();
    constructor(cdr) {
        super();
        this.cdr = cdr;
        this.setupStateManagement();
    }
    async GetResourceDisplayName(data) {
        return "Credentials";
    }
    ngAfterViewInit() {
        this.visitedTabs.add(this.activeTab);
        this.loadCounts();
        this.emitStateChange();
        this.cdr.detectChanges();
    }
    ngOnDestroy() {
        this.stateChangeSubject.complete();
    }
    async loadCounts() {
        try {
            const rv = new RunView();
            // Load credential count
            const credResult = await rv.RunView({
                EntityName: 'MJ: Credentials',
                ExtraFilter: 'IsActive = 1',
                ResultType: 'count_only'
            });
            if (credResult.Success) {
                this.credentialCount = credResult.RowCount;
            }
            // Load type count
            const typeResult = await rv.RunView({
                EntityName: 'MJ: Credential Types',
                ResultType: 'count_only'
            });
            if (typeResult.Success) {
                this.typeCount = typeResult.RowCount;
            }
            this.cdr.markForCheck();
        }
        catch (error) {
            console.error('Error loading counts:', error);
        }
    }
    onTabChange(tabId) {
        this.activeTab = tabId;
        const index = this.navigationItems.indexOf(tabId);
        this.selectedIndex = index >= 0 ? index : 0;
        setTimeout(() => {
            SharedService.Instance.InvokeManualResize();
        }, 100);
        this.visitedTabs.add(tabId);
        this.emitStateChange();
        this.cdr.markForCheck();
    }
    hasVisited(tabId) {
        return this.visitedTabs.has(tabId);
    }
    setupStateManagement() {
        this.stateChangeSubject.pipe(debounceTime(50)).subscribe(state => {
            this.UserStateChanged.emit(state);
        });
    }
    emitStateChange() {
        const state = {
            activeTab: this.activeTab
        };
        this.stateChangeSubject.next(state);
    }
    loadUserState(state) {
        if (state.activeTab) {
            this.activeTab = state.activeTab;
            const index = this.navigationItems.indexOf(state.activeTab);
            this.selectedIndex = index >= 0 ? index : 0;
            this.visitedTabs.add(state.activeTab);
        }
        this.cdr.markForCheck();
    }
    initDashboard() {
        try {
            this.isLoading = true;
        }
        catch (error) {
            console.error('Error initializing Credentials dashboard:', error);
            this.Error.emit(new Error('Failed to initialize Credentials dashboard. Please try again.'));
        }
        finally {
            this.isLoading = false;
        }
    }
    loadData() {
        if (this.Config?.userState) {
            setTimeout(() => {
                if (this.Config?.userState) {
                    this.loadUserState(this.Config.userState);
                }
            }, 0);
        }
        this.NotifyLoadComplete();
    }
    getCurrentTabLabel() {
        return this.tabLabels[this.activeTab] || 'Credential Management';
    }
    static ɵfac = function CredentialsDashboardComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CredentialsDashboardComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); };
    static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CredentialsDashboardComponent, selectors: [["mj-credentials-dashboard"]], standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 53, vars: 14, consts: [[1, "credentials-dashboard-container"], [1, "dashboard-header"], [1, "header-title"], [1, "fa-solid", "fa-key"], [1, "header-actions"], [1, "security-badge"], [1, "fa-solid", "fa-shield-halved"], [1, "tab-label"], [1, "dashboard-content"], [1, "sidebar"], [1, "sidebar-section"], [1, "sidebar-section-title"], [1, "nav-item", 3, "click"], [1, "fa-solid", "fa-chart-pie"], [1, "badge"], [1, "fa-solid", "fa-cubes"], [1, "fa-solid", "fa-folder-tree"], [1, "fa-solid", "fa-clipboard-list"], [1, "main-content"], [1, "tab-container"], [1, "tab-content"]], template: function CredentialsDashboardComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "div", 2);
            i0.ɵɵelement(3, "i", 3);
            i0.ɵɵelementStart(4, "span");
            i0.ɵɵtext(5, "Credential Management");
            i0.ɵɵelementEnd()();
            i0.ɵɵelementStart(6, "div", 4)(7, "div", 5);
            i0.ɵɵelement(8, "i", 6);
            i0.ɵɵelementStart(9, "span");
            i0.ɵɵtext(10, "Encrypted");
            i0.ɵɵelementEnd()();
            i0.ɵɵelementStart(11, "span", 7);
            i0.ɵɵtext(12);
            i0.ɵɵelementEnd()()();
            i0.ɵɵelementStart(13, "div", 8)(14, "div", 9)(15, "div", 10)(16, "div", 11);
            i0.ɵɵtext(17, "Dashboard");
            i0.ɵɵelementEnd()();
            i0.ɵɵelementStart(18, "div", 12);
            i0.ɵɵlistener("click", function CredentialsDashboardComponent_Template_div_click_18_listener() { return ctx.onTabChange("overview"); });
            i0.ɵɵelement(19, "i", 13);
            i0.ɵɵelementStart(20, "span");
            i0.ɵɵtext(21, "Overview");
            i0.ɵɵelementEnd()();
            i0.ɵɵelementStart(22, "div", 10)(23, "div", 11);
            i0.ɵɵtext(24, "Management");
            i0.ɵɵelementEnd()();
            i0.ɵɵelementStart(25, "div", 12);
            i0.ɵɵlistener("click", function CredentialsDashboardComponent_Template_div_click_25_listener() { return ctx.onTabChange("credentials"); });
            i0.ɵɵelement(26, "i", 3);
            i0.ɵɵelementStart(27, "span");
            i0.ɵɵtext(28, "Credentials");
            i0.ɵɵelementEnd();
            i0.ɵɵconditionalCreate(29, CredentialsDashboardComponent_Conditional_29_Template, 2, 1, "span", 14);
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(30, "div", 12);
            i0.ɵɵlistener("click", function CredentialsDashboardComponent_Template_div_click_30_listener() { return ctx.onTabChange("types"); });
            i0.ɵɵelement(31, "i", 15);
            i0.ɵɵelementStart(32, "span");
            i0.ɵɵtext(33, "Types");
            i0.ɵɵelementEnd();
            i0.ɵɵconditionalCreate(34, CredentialsDashboardComponent_Conditional_34_Template, 2, 1, "span", 14);
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(35, "div", 12);
            i0.ɵɵlistener("click", function CredentialsDashboardComponent_Template_div_click_35_listener() { return ctx.onTabChange("categories"); });
            i0.ɵɵelement(36, "i", 16);
            i0.ɵɵelementStart(37, "span");
            i0.ɵɵtext(38, "Categories");
            i0.ɵɵelementEnd()();
            i0.ɵɵelementStart(39, "div", 10)(40, "div", 11);
            i0.ɵɵtext(41, "Security");
            i0.ɵɵelementEnd()();
            i0.ɵɵelementStart(42, "div", 12);
            i0.ɵɵlistener("click", function CredentialsDashboardComponent_Template_div_click_42_listener() { return ctx.onTabChange("audit"); });
            i0.ɵɵelement(43, "i", 17);
            i0.ɵɵelementStart(44, "span");
            i0.ɵɵtext(45, "Audit Trail");
            i0.ɵɵelementEnd()()();
            i0.ɵɵelementStart(46, "div", 18)(47, "div", 19);
            i0.ɵɵconditionalCreate(48, CredentialsDashboardComponent_Case_48_Template, 2, 0, "div", 20)(49, CredentialsDashboardComponent_Case_49_Template, 2, 0, "div", 20)(50, CredentialsDashboardComponent_Case_50_Template, 2, 0, "div", 20)(51, CredentialsDashboardComponent_Case_51_Template, 2, 0, "div", 20)(52, CredentialsDashboardComponent_Case_52_Template, 2, 0, "div", 20);
            i0.ɵɵelementEnd()()()();
        } if (rf & 2) {
            let tmp_8_0;
            i0.ɵɵadvance(12);
            i0.ɵɵtextInterpolate(ctx.getCurrentTabLabel());
            i0.ɵɵadvance(6);
            i0.ɵɵclassProp("selected", ctx.activeTab === "overview");
            i0.ɵɵadvance(7);
            i0.ɵɵclassProp("selected", ctx.activeTab === "credentials");
            i0.ɵɵadvance(4);
            i0.ɵɵconditional(ctx.credentialCount > 0 ? 29 : -1);
            i0.ɵɵadvance();
            i0.ɵɵclassProp("selected", ctx.activeTab === "types");
            i0.ɵɵadvance(4);
            i0.ɵɵconditional(ctx.typeCount > 0 ? 34 : -1);
            i0.ɵɵadvance();
            i0.ɵɵclassProp("selected", ctx.activeTab === "categories");
            i0.ɵɵadvance(7);
            i0.ɵɵclassProp("selected", ctx.activeTab === "audit");
            i0.ɵɵadvance(6);
            i0.ɵɵconditional((tmp_8_0 = ctx.activeTab) === "overview" ? 48 : tmp_8_0 === "credentials" ? 49 : tmp_8_0 === "types" ? 50 : tmp_8_0 === "categories" ? 51 : tmp_8_0 === "audit" ? 52 : -1);
        } }, dependencies: [i1.CredentialsOverviewResourceComponent, i2.CredentialsListResourceComponent, i3.CredentialsTypesResourceComponent, i4.CredentialsCategoriesResourceComponent, i5.CredentialsAuditResourceComponent], styles: [".credentials-dashboard-container[_ngcontent-%COMP%] {\n    display: flex;\n    flex-direction: column;\n    height: 100%;\n    width: 100%;\n    background-color: var(--mj-bg-page);\n    color: var(--mj-text-primary);\n    font-family: 'Inter', -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif;\n}\n\n.dashboard-header[_ngcontent-%COMP%] {\n    display: flex;\n    justify-content: space-between;\n    align-items: center;\n    padding: 16px 24px;\n    background: var(--mj-bg-surface-card);\n    border-bottom: 1px solid color-mix(in srgb, var(--mj-bg-surface) 10%, transparent);\n    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);\n}\n\n.header-title[_ngcontent-%COMP%] {\n    display: flex;\n    align-items: center;\n    gap: 12px;\n    font-size: 1.25rem;\n    font-weight: 600;\n    color: var(--mj-text-inverse);\n}\n\n.header-title[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n    color: var(--mj-status-warning);\n    font-size: 1.5rem;\n}\n\n.header-actions[_ngcontent-%COMP%] {\n    display: flex;\n    align-items: center;\n    gap: 16px;\n}\n\n.tab-label[_ngcontent-%COMP%] {\n    font-size: 0.875rem;\n    font-weight: 500;\n    color: color-mix(in srgb, var(--mj-bg-surface) 80%, transparent);\n    background: color-mix(in srgb, var(--mj-bg-surface) 15%, transparent);\n    padding: 6px 14px;\n    border-radius: 20px;\n    backdrop-filter: blur(4px);\n}\n\n.security-badge[_ngcontent-%COMP%] {\n    display: flex;\n    align-items: center;\n    gap: 6px;\n    font-size: 0.75rem;\n    font-weight: 600;\n    color: var(--mj-status-success);\n    background: color-mix(in srgb, var(--mj-status-success) 15%, transparent);\n    padding: 6px 12px;\n    border-radius: 20px;\n}\n\n.dashboard-content[_ngcontent-%COMP%] {\n    display: flex;\n    flex: 1;\n    overflow: hidden;\n}\n\n.sidebar[_ngcontent-%COMP%] {\n    width: 260px;\n    background-color: var(--mj-bg-surface);\n    border-right: 1px solid var(--mj-border-default);\n    padding: 20px 0;\n    display: flex;\n    flex-direction: column;\n    gap: 4px;\n}\n\n.sidebar-section[_ngcontent-%COMP%] {\n    padding: 0 16px;\n    margin-bottom: 8px;\n}\n\n.sidebar-section-title[_ngcontent-%COMP%] {\n    font-size: 0.7rem;\n    font-weight: 700;\n    color: var(--mj-text-disabled);\n    text-transform: uppercase;\n    letter-spacing: 0.05em;\n    padding: 8px 0;\n}\n\n.nav-item[_ngcontent-%COMP%] {\n    display: flex;\n    align-items: center;\n    gap: 12px;\n    padding: 12px 20px;\n    margin: 0 8px;\n    cursor: pointer;\n    transition: all 0.2s ease;\n    color: var(--mj-text-secondary);\n    font-weight: 500;\n    border-radius: 10px;\n}\n\n.nav-item[_ngcontent-%COMP%]:hover {\n    background-color: color-mix(in srgb, var(--mj-brand-primary) 8%, var(--mj-bg-surface));\n    color: var(--mj-brand-primary);\n}\n\n.nav-item.selected[_ngcontent-%COMP%] {\n    background: var(--mj-brand-primary);\n    color: var(--mj-text-inverse);\n    box-shadow: 0 4px 6px -1px color-mix(in srgb, var(--mj-brand-primary) 30%, transparent);\n}\n\n.nav-item[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n    width: 20px;\n    text-align: center;\n    font-size: 1rem;\n}\n\n.nav-item[_ngcontent-%COMP%]   .badge[_ngcontent-%COMP%] {\n    margin-left: auto;\n    font-size: 0.7rem;\n    font-weight: 700;\n    padding: 2px 8px;\n    border-radius: 12px;\n    background: color-mix(in srgb, var(--mj-brand-primary) 10%, transparent);\n    color: var(--mj-brand-primary);\n}\n\n.nav-item.selected[_ngcontent-%COMP%]   .badge[_ngcontent-%COMP%] {\n    background: color-mix(in srgb, var(--mj-bg-surface) 20%, transparent);\n    color: var(--mj-text-inverse);\n}\n\n.main-content[_ngcontent-%COMP%] {\n    flex: 1;\n    overflow-y: auto;\n    padding: 24px;\n    background: var(--mj-bg-page);\n}\n\n.tab-container[_ngcontent-%COMP%] {\n    height: 100%;\n}\n\n.tab-content[_ngcontent-%COMP%] {\n    height: 100%;\n    animation: _ngcontent-%COMP%_fadeIn 0.3s ease;\n}\n\n@keyframes _ngcontent-%COMP%_fadeIn {\n    from { opacity: 0; transform: translateY(8px); }\n    to { opacity: 1; transform: translateY(0); }\n}\n\n\n\n.overview-grid[_ngcontent-%COMP%] {\n    display: grid;\n    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));\n    gap: 24px;\n    margin-bottom: 32px;\n}\n\n.stat-card[_ngcontent-%COMP%] {\n    background: var(--mj-bg-surface);\n    border-radius: 16px;\n    padding: 24px;\n    border: 1px solid var(--mj-border-default);\n    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);\n    transition: all 0.3s ease;\n}\n\n.stat-card[_ngcontent-%COMP%]:hover {\n    transform: translateY(-2px);\n    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);\n}\n\n.stat-card[_ngcontent-%COMP%]   .icon-wrapper[_ngcontent-%COMP%] {\n    width: 48px;\n    height: 48px;\n    border-radius: 12px;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    font-size: 1.25rem;\n    margin-bottom: 16px;\n}\n\n.stat-card[_ngcontent-%COMP%]   .icon-wrapper.blue[_ngcontent-%COMP%] {\n    background: var(--mj-brand-primary);\n    color: var(--mj-text-inverse);\n}\n\n.stat-card[_ngcontent-%COMP%]   .icon-wrapper.green[_ngcontent-%COMP%] {\n    background: var(--mj-status-success);\n    color: var(--mj-text-inverse);\n}\n\n.stat-card[_ngcontent-%COMP%]   .icon-wrapper.amber[_ngcontent-%COMP%] {\n    background: var(--mj-status-warning);\n    color: var(--mj-text-inverse);\n}\n\n.stat-card[_ngcontent-%COMP%]   .icon-wrapper.red[_ngcontent-%COMP%] {\n    background: var(--mj-status-error);\n    color: var(--mj-text-inverse);\n}\n\n.stat-card[_ngcontent-%COMP%]   .stat-label[_ngcontent-%COMP%] {\n    font-size: 0.875rem;\n    font-weight: 500;\n    color: var(--mj-text-muted);\n    margin-bottom: 4px;\n}\n\n.stat-card[_ngcontent-%COMP%]   .stat-value[_ngcontent-%COMP%] {\n    font-size: 2rem;\n    font-weight: 800;\n    color: var(--mj-text-primary);\n}\n\n.stat-card[_ngcontent-%COMP%]   .stat-change[_ngcontent-%COMP%] {\n    font-size: 0.75rem;\n    font-weight: 600;\n    margin-top: 8px;\n    display: flex;\n    align-items: center;\n    gap: 4px;\n}\n\n.stat-card[_ngcontent-%COMP%]   .stat-change.positive[_ngcontent-%COMP%] { color: var(--mj-status-success); }\n.stat-card[_ngcontent-%COMP%]   .stat-change.negative[_ngcontent-%COMP%] { color: var(--mj-status-error); }\n\n\n\n.activity-section[_ngcontent-%COMP%] {\n    background: var(--mj-bg-surface);\n    border-radius: 16px;\n    padding: 24px;\n    border: 1px solid var(--mj-border-default);\n}\n\n.section-header[_ngcontent-%COMP%] {\n    display: flex;\n    justify-content: space-between;\n    align-items: center;\n    margin-bottom: 20px;\n}\n\n.section-title[_ngcontent-%COMP%] {\n    font-size: 1.125rem;\n    font-weight: 700;\n    color: var(--mj-text-primary);\n    display: flex;\n    align-items: center;\n    gap: 10px;\n}\n\n.section-title[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n    color: var(--mj-brand-primary);\n}\n\n.view-all-link[_ngcontent-%COMP%] {\n    font-size: 0.875rem;\n    font-weight: 600;\n    color: var(--mj-brand-primary);\n    cursor: pointer;\n    display: flex;\n    align-items: center;\n    gap: 4px;\n}\n\n.view-all-link[_ngcontent-%COMP%]:hover {\n    color: var(--mj-brand-primary-hover);\n    text-decoration: underline;\n}\n\n.activity-list[_ngcontent-%COMP%] {\n    display: flex;\n    flex-direction: column;\n    gap: 12px;\n}\n\n.activity-item[_ngcontent-%COMP%] {\n    display: flex;\n    align-items: center;\n    gap: 16px;\n    padding: 12px 16px;\n    background: var(--mj-bg-page);\n    border-radius: 10px;\n    transition: all 0.2s ease;\n}\n\n.activity-item[_ngcontent-%COMP%]:hover {\n    background: var(--mj-bg-surface-sunken);\n}\n\n.activity-icon[_ngcontent-%COMP%] {\n    width: 40px;\n    height: 40px;\n    border-radius: 10px;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    font-size: 0.875rem;\n}\n\n.activity-icon.decrypt[_ngcontent-%COMP%] { background: color-mix(in srgb, var(--mj-brand-primary) 15%, var(--mj-bg-surface)); color: var(--mj-brand-primary); }\n.activity-icon.create[_ngcontent-%COMP%] { background: color-mix(in srgb, var(--mj-status-success) 15%, var(--mj-bg-surface)); color: var(--mj-status-success); }\n.activity-icon.update[_ngcontent-%COMP%] { background: color-mix(in srgb, var(--mj-status-warning) 8%, var(--mj-bg-surface)); color: var(--mj-status-warning); }\n.activity-icon.delete[_ngcontent-%COMP%] { background: color-mix(in srgb, var(--mj-status-error) 8%, var(--mj-bg-surface)); color: var(--mj-status-error); }\n.activity-icon.validate[_ngcontent-%COMP%] { background: color-mix(in srgb, var(--mj-brand-primary) 15%, var(--mj-bg-surface)); color: var(--mj-brand-primary); }\n\n.activity-details[_ngcontent-%COMP%] {\n    flex: 1;\n}\n\n.activity-details[_ngcontent-%COMP%]   .action[_ngcontent-%COMP%] {\n    font-weight: 600;\n    color: var(--mj-text-primary);\n}\n\n.activity-details[_ngcontent-%COMP%]   .target[_ngcontent-%COMP%] {\n    color: var(--mj-brand-primary);\n}\n\n.activity-details[_ngcontent-%COMP%]   .meta[_ngcontent-%COMP%] {\n    font-size: 0.75rem;\n    color: var(--mj-text-disabled);\n    margin-top: 2px;\n}\n\n.activity-status[_ngcontent-%COMP%] {\n    font-size: 0.75rem;\n    font-weight: 600;\n    padding: 4px 10px;\n    border-radius: 12px;\n}\n\n.activity-status.success[_ngcontent-%COMP%] { background: color-mix(in srgb, var(--mj-status-success) 15%, var(--mj-bg-surface)); color: var(--mj-status-success); }\n.activity-status.failed[_ngcontent-%COMP%] { background: color-mix(in srgb, var(--mj-status-error) 8%, var(--mj-bg-surface)); color: var(--mj-status-error); }\n\n\n\n.empty-state[_ngcontent-%COMP%] {\n    display: flex;\n    flex-direction: column;\n    align-items: center;\n    justify-content: center;\n    padding: 60px 20px;\n    text-align: center;\n}\n\n.empty-state[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n    font-size: 4rem;\n    color: var(--mj-border-strong);\n    margin-bottom: 20px;\n}\n\n.empty-state[_ngcontent-%COMP%]   h3[_ngcontent-%COMP%] {\n    font-size: 1.25rem;\n    font-weight: 700;\n    color: var(--mj-text-secondary);\n    margin: 0 0 8px;\n}\n\n.empty-state[_ngcontent-%COMP%]   p[_ngcontent-%COMP%] {\n    color: var(--mj-text-muted);\n    margin: 0;\n}\n\n\n\n@media (max-width: 1024px) {\n    .sidebar[_ngcontent-%COMP%] {\n        width: 220px;\n    }\n\n    .main-content[_ngcontent-%COMP%] {\n        padding: 20px;\n    }\n}\n\n@media (max-width: 768px) {\n    .dashboard-content[_ngcontent-%COMP%] {\n        flex-direction: column;\n    }\n\n    .sidebar[_ngcontent-%COMP%] {\n        width: 100%;\n        flex-direction: row;\n        padding: 12px;\n        gap: 0;\n        overflow-x: auto;\n        border-right: none;\n        border-bottom: 1px solid var(--mj-border-default);\n    }\n\n    .sidebar-section[_ngcontent-%COMP%] {\n        display: none;\n    }\n\n    .nav-item[_ngcontent-%COMP%] {\n        flex-direction: column;\n        padding: 10px 16px;\n        margin: 0 4px;\n        gap: 6px;\n        white-space: nowrap;\n        font-size: 12px;\n    }\n\n    .nav-item[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n        font-size: 18px;\n    }\n\n    .nav-item[_ngcontent-%COMP%]   .badge[_ngcontent-%COMP%] {\n        position: absolute;\n        top: 4px;\n        right: 4px;\n        margin-left: 0;\n        font-size: 9px;\n        padding: 1px 5px;\n    }\n\n    .main-content[_ngcontent-%COMP%] {\n        padding: 16px;\n    }\n\n    .dashboard-header[_ngcontent-%COMP%] {\n        padding: 12px 16px;\n    }\n\n    .header-title[_ngcontent-%COMP%] {\n        font-size: 1rem;\n    }\n\n    .header-title[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n        font-size: 1.25rem;\n    }\n\n    .tab-label[_ngcontent-%COMP%] {\n        display: none;\n    }\n\n    .security-badge[_ngcontent-%COMP%]   span[_ngcontent-%COMP%] {\n        display: none;\n    }\n\n    .overview-grid[_ngcontent-%COMP%] {\n        grid-template-columns: 1fr;\n        gap: 16px;\n    }\n\n    .stat-card[_ngcontent-%COMP%] {\n        padding: 20px;\n    }\n\n    .stat-card[_ngcontent-%COMP%]   .stat-value[_ngcontent-%COMP%] {\n        font-size: 1.5rem;\n    }\n}\n\n@media (max-width: 480px) {\n    .dashboard-header[_ngcontent-%COMP%] {\n        padding: 10px 12px;\n    }\n\n    .header-title[_ngcontent-%COMP%] {\n        font-size: 0.9rem;\n        gap: 8px;\n    }\n\n    .header-title[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n        font-size: 1.1rem;\n    }\n\n    .security-badge[_ngcontent-%COMP%] {\n        padding: 4px 8px;\n    }\n\n    .security-badge[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n        font-size: 14px;\n    }\n\n    .sidebar[_ngcontent-%COMP%] {\n        padding: 8px;\n    }\n\n    .nav-item[_ngcontent-%COMP%] {\n        padding: 8px 12px;\n        font-size: 11px;\n    }\n\n    .nav-item[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n        font-size: 16px;\n    }\n\n    .main-content[_ngcontent-%COMP%] {\n        padding: 12px;\n    }\n\n    .stat-card[_ngcontent-%COMP%] {\n        padding: 16px;\n        border-radius: 12px;\n    }\n\n    .stat-card[_ngcontent-%COMP%]   .icon-wrapper[_ngcontent-%COMP%] {\n        width: 40px;\n        height: 40px;\n        font-size: 1rem;\n    }\n\n    .stat-card[_ngcontent-%COMP%]   .stat-value[_ngcontent-%COMP%] {\n        font-size: 1.25rem;\n    }\n\n    .section-header[_ngcontent-%COMP%] {\n        flex-direction: column;\n        align-items: flex-start;\n        gap: 12px;\n    }\n\n    .activity-item[_ngcontent-%COMP%] {\n        padding: 10px 12px;\n    }\n\n    .activity-icon[_ngcontent-%COMP%] {\n        width: 36px;\n        height: 36px;\n    }\n\n    .activity-details[_ngcontent-%COMP%]   .action[_ngcontent-%COMP%] {\n        font-size: 13px;\n    }\n}"], changeDetection: 0 });
};
CredentialsDashboardComponent = __decorate([
    RegisterClass(BaseDashboard, 'CredentialsDashboard')
], CredentialsDashboardComponent);
export { CredentialsDashboardComponent };
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CredentialsDashboardComponent, [{
        type: Component,
        args: [{ standalone: false, selector: 'mj-credentials-dashboard', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"credentials-dashboard-container\">\n  <div class=\"dashboard-header\">\n    <div class=\"header-title\">\n      <i class=\"fa-solid fa-key\"></i>\n      <span>Credential Management</span>\n    </div>\n    <div class=\"header-actions\">\n      <div class=\"security-badge\">\n        <i class=\"fa-solid fa-shield-halved\"></i>\n        <span>Encrypted</span>\n      </div>\n      <span class=\"tab-label\">{{getCurrentTabLabel()}}</span>\n    </div>\n  </div>\n\n  <div class=\"dashboard-content\">\n    <div class=\"sidebar\">\n      <div class=\"sidebar-section\">\n        <div class=\"sidebar-section-title\">Dashboard</div>\n      </div>\n      <div class=\"nav-item\" [class.selected]=\"activeTab === 'overview'\" (click)=\"onTabChange('overview')\">\n        <i class=\"fa-solid fa-chart-pie\"></i>\n        <span>Overview</span>\n      </div>\n\n      <div class=\"sidebar-section\">\n        <div class=\"sidebar-section-title\">Management</div>\n      </div>\n      <div class=\"nav-item\" [class.selected]=\"activeTab === 'credentials'\" (click)=\"onTabChange('credentials')\">\n        <i class=\"fa-solid fa-key\"></i>\n        <span>Credentials</span>\n        @if (credentialCount > 0) {\n          <span class=\"badge\">{{credentialCount}}</span>\n        }\n      </div>\n      <div class=\"nav-item\" [class.selected]=\"activeTab === 'types'\" (click)=\"onTabChange('types')\">\n        <i class=\"fa-solid fa-cubes\"></i>\n        <span>Types</span>\n        @if (typeCount > 0) {\n          <span class=\"badge\">{{typeCount}}</span>\n        }\n      </div>\n      <div class=\"nav-item\" [class.selected]=\"activeTab === 'categories'\" (click)=\"onTabChange('categories')\">\n        <i class=\"fa-solid fa-folder-tree\"></i>\n        <span>Categories</span>\n      </div>\n\n      <div class=\"sidebar-section\">\n        <div class=\"sidebar-section-title\">Security</div>\n      </div>\n      <div class=\"nav-item\" [class.selected]=\"activeTab === 'audit'\" (click)=\"onTabChange('audit')\">\n        <i class=\"fa-solid fa-clipboard-list\"></i>\n        <span>Audit Trail</span>\n      </div>\n    </div>\n\n    <div class=\"main-content\">\n      <div class=\"tab-container\">\n        @switch (activeTab) {\n          <!-- Overview Tab -->\n          @case ('overview') {\n            <div class=\"tab-content\">\n              <mj-credentials-overview-resource></mj-credentials-overview-resource>\n            </div>\n          }\n          <!-- Credentials Tab -->\n          @case ('credentials') {\n            <div class=\"tab-content\">\n              <mj-credentials-list-resource></mj-credentials-list-resource>\n            </div>\n          }\n          <!-- Types Tab -->\n          @case ('types') {\n            <div class=\"tab-content\">\n              <mj-credentials-types-resource></mj-credentials-types-resource>\n            </div>\n          }\n          <!-- Categories Tab -->\n          @case ('categories') {\n            <div class=\"tab-content\">\n              <mj-credentials-categories-resource></mj-credentials-categories-resource>\n            </div>\n          }\n          <!-- Audit Trail Tab -->\n          @case ('audit') {\n            <div class=\"tab-content\">\n              <mj-credentials-audit-resource></mj-credentials-audit-resource>\n            </div>\n          }\n        }\n      </div>\n    </div>\n  </div>\n</div>\n", styles: [".credentials-dashboard-container {\n    display: flex;\n    flex-direction: column;\n    height: 100%;\n    width: 100%;\n    background-color: var(--mj-bg-page);\n    color: var(--mj-text-primary);\n    font-family: 'Inter', -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif;\n}\n\n.dashboard-header {\n    display: flex;\n    justify-content: space-between;\n    align-items: center;\n    padding: 16px 24px;\n    background: var(--mj-bg-surface-card);\n    border-bottom: 1px solid color-mix(in srgb, var(--mj-bg-surface) 10%, transparent);\n    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);\n}\n\n.header-title {\n    display: flex;\n    align-items: center;\n    gap: 12px;\n    font-size: 1.25rem;\n    font-weight: 600;\n    color: var(--mj-text-inverse);\n}\n\n.header-title i {\n    color: var(--mj-status-warning);\n    font-size: 1.5rem;\n}\n\n.header-actions {\n    display: flex;\n    align-items: center;\n    gap: 16px;\n}\n\n.tab-label {\n    font-size: 0.875rem;\n    font-weight: 500;\n    color: color-mix(in srgb, var(--mj-bg-surface) 80%, transparent);\n    background: color-mix(in srgb, var(--mj-bg-surface) 15%, transparent);\n    padding: 6px 14px;\n    border-radius: 20px;\n    backdrop-filter: blur(4px);\n}\n\n.security-badge {\n    display: flex;\n    align-items: center;\n    gap: 6px;\n    font-size: 0.75rem;\n    font-weight: 600;\n    color: var(--mj-status-success);\n    background: color-mix(in srgb, var(--mj-status-success) 15%, transparent);\n    padding: 6px 12px;\n    border-radius: 20px;\n}\n\n.dashboard-content {\n    display: flex;\n    flex: 1;\n    overflow: hidden;\n}\n\n.sidebar {\n    width: 260px;\n    background-color: var(--mj-bg-surface);\n    border-right: 1px solid var(--mj-border-default);\n    padding: 20px 0;\n    display: flex;\n    flex-direction: column;\n    gap: 4px;\n}\n\n.sidebar-section {\n    padding: 0 16px;\n    margin-bottom: 8px;\n}\n\n.sidebar-section-title {\n    font-size: 0.7rem;\n    font-weight: 700;\n    color: var(--mj-text-disabled);\n    text-transform: uppercase;\n    letter-spacing: 0.05em;\n    padding: 8px 0;\n}\n\n.nav-item {\n    display: flex;\n    align-items: center;\n    gap: 12px;\n    padding: 12px 20px;\n    margin: 0 8px;\n    cursor: pointer;\n    transition: all 0.2s ease;\n    color: var(--mj-text-secondary);\n    font-weight: 500;\n    border-radius: 10px;\n}\n\n.nav-item:hover {\n    background-color: color-mix(in srgb, var(--mj-brand-primary) 8%, var(--mj-bg-surface));\n    color: var(--mj-brand-primary);\n}\n\n.nav-item.selected {\n    background: var(--mj-brand-primary);\n    color: var(--mj-text-inverse);\n    box-shadow: 0 4px 6px -1px color-mix(in srgb, var(--mj-brand-primary) 30%, transparent);\n}\n\n.nav-item i {\n    width: 20px;\n    text-align: center;\n    font-size: 1rem;\n}\n\n.nav-item .badge {\n    margin-left: auto;\n    font-size: 0.7rem;\n    font-weight: 700;\n    padding: 2px 8px;\n    border-radius: 12px;\n    background: color-mix(in srgb, var(--mj-brand-primary) 10%, transparent);\n    color: var(--mj-brand-primary);\n}\n\n.nav-item.selected .badge {\n    background: color-mix(in srgb, var(--mj-bg-surface) 20%, transparent);\n    color: var(--mj-text-inverse);\n}\n\n.main-content {\n    flex: 1;\n    overflow-y: auto;\n    padding: 24px;\n    background: var(--mj-bg-page);\n}\n\n.tab-container {\n    height: 100%;\n}\n\n.tab-content {\n    height: 100%;\n    animation: fadeIn 0.3s ease;\n}\n\n@keyframes fadeIn {\n    from { opacity: 0; transform: translateY(8px); }\n    to { opacity: 1; transform: translateY(0); }\n}\n\n/* Overview Stats Grid */\n.overview-grid {\n    display: grid;\n    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));\n    gap: 24px;\n    margin-bottom: 32px;\n}\n\n.stat-card {\n    background: var(--mj-bg-surface);\n    border-radius: 16px;\n    padding: 24px;\n    border: 1px solid var(--mj-border-default);\n    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);\n    transition: all 0.3s ease;\n}\n\n.stat-card:hover {\n    transform: translateY(-2px);\n    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);\n}\n\n.stat-card .icon-wrapper {\n    width: 48px;\n    height: 48px;\n    border-radius: 12px;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    font-size: 1.25rem;\n    margin-bottom: 16px;\n}\n\n.stat-card .icon-wrapper.blue {\n    background: var(--mj-brand-primary);\n    color: var(--mj-text-inverse);\n}\n\n.stat-card .icon-wrapper.green {\n    background: var(--mj-status-success);\n    color: var(--mj-text-inverse);\n}\n\n.stat-card .icon-wrapper.amber {\n    background: var(--mj-status-warning);\n    color: var(--mj-text-inverse);\n}\n\n.stat-card .icon-wrapper.red {\n    background: var(--mj-status-error);\n    color: var(--mj-text-inverse);\n}\n\n.stat-card .stat-label {\n    font-size: 0.875rem;\n    font-weight: 500;\n    color: var(--mj-text-muted);\n    margin-bottom: 4px;\n}\n\n.stat-card .stat-value {\n    font-size: 2rem;\n    font-weight: 800;\n    color: var(--mj-text-primary);\n}\n\n.stat-card .stat-change {\n    font-size: 0.75rem;\n    font-weight: 600;\n    margin-top: 8px;\n    display: flex;\n    align-items: center;\n    gap: 4px;\n}\n\n.stat-card .stat-change.positive { color: var(--mj-status-success); }\n.stat-card .stat-change.negative { color: var(--mj-status-error); }\n\n/* Activity Section */\n.activity-section {\n    background: var(--mj-bg-surface);\n    border-radius: 16px;\n    padding: 24px;\n    border: 1px solid var(--mj-border-default);\n}\n\n.section-header {\n    display: flex;\n    justify-content: space-between;\n    align-items: center;\n    margin-bottom: 20px;\n}\n\n.section-title {\n    font-size: 1.125rem;\n    font-weight: 700;\n    color: var(--mj-text-primary);\n    display: flex;\n    align-items: center;\n    gap: 10px;\n}\n\n.section-title i {\n    color: var(--mj-brand-primary);\n}\n\n.view-all-link {\n    font-size: 0.875rem;\n    font-weight: 600;\n    color: var(--mj-brand-primary);\n    cursor: pointer;\n    display: flex;\n    align-items: center;\n    gap: 4px;\n}\n\n.view-all-link:hover {\n    color: var(--mj-brand-primary-hover);\n    text-decoration: underline;\n}\n\n.activity-list {\n    display: flex;\n    flex-direction: column;\n    gap: 12px;\n}\n\n.activity-item {\n    display: flex;\n    align-items: center;\n    gap: 16px;\n    padding: 12px 16px;\n    background: var(--mj-bg-page);\n    border-radius: 10px;\n    transition: all 0.2s ease;\n}\n\n.activity-item:hover {\n    background: var(--mj-bg-surface-sunken);\n}\n\n.activity-icon {\n    width: 40px;\n    height: 40px;\n    border-radius: 10px;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    font-size: 0.875rem;\n}\n\n.activity-icon.decrypt { background: color-mix(in srgb, var(--mj-brand-primary) 15%, var(--mj-bg-surface)); color: var(--mj-brand-primary); }\n.activity-icon.create { background: color-mix(in srgb, var(--mj-status-success) 15%, var(--mj-bg-surface)); color: var(--mj-status-success); }\n.activity-icon.update { background: color-mix(in srgb, var(--mj-status-warning) 8%, var(--mj-bg-surface)); color: var(--mj-status-warning); }\n.activity-icon.delete { background: color-mix(in srgb, var(--mj-status-error) 8%, var(--mj-bg-surface)); color: var(--mj-status-error); }\n.activity-icon.validate { background: color-mix(in srgb, var(--mj-brand-primary) 15%, var(--mj-bg-surface)); color: var(--mj-brand-primary); }\n\n.activity-details {\n    flex: 1;\n}\n\n.activity-details .action {\n    font-weight: 600;\n    color: var(--mj-text-primary);\n}\n\n.activity-details .target {\n    color: var(--mj-brand-primary);\n}\n\n.activity-details .meta {\n    font-size: 0.75rem;\n    color: var(--mj-text-disabled);\n    margin-top: 2px;\n}\n\n.activity-status {\n    font-size: 0.75rem;\n    font-weight: 600;\n    padding: 4px 10px;\n    border-radius: 12px;\n}\n\n.activity-status.success { background: color-mix(in srgb, var(--mj-status-success) 15%, var(--mj-bg-surface)); color: var(--mj-status-success); }\n.activity-status.failed { background: color-mix(in srgb, var(--mj-status-error) 8%, var(--mj-bg-surface)); color: var(--mj-status-error); }\n\n/* Empty State */\n.empty-state {\n    display: flex;\n    flex-direction: column;\n    align-items: center;\n    justify-content: center;\n    padding: 60px 20px;\n    text-align: center;\n}\n\n.empty-state i {\n    font-size: 4rem;\n    color: var(--mj-border-strong);\n    margin-bottom: 20px;\n}\n\n.empty-state h3 {\n    font-size: 1.25rem;\n    font-weight: 700;\n    color: var(--mj-text-secondary);\n    margin: 0 0 8px;\n}\n\n.empty-state p {\n    color: var(--mj-text-muted);\n    margin: 0;\n}\n\n/* Mobile Responsive Styles */\n@media (max-width: 1024px) {\n    .sidebar {\n        width: 220px;\n    }\n\n    .main-content {\n        padding: 20px;\n    }\n}\n\n@media (max-width: 768px) {\n    .dashboard-content {\n        flex-direction: column;\n    }\n\n    .sidebar {\n        width: 100%;\n        flex-direction: row;\n        padding: 12px;\n        gap: 0;\n        overflow-x: auto;\n        border-right: none;\n        border-bottom: 1px solid var(--mj-border-default);\n    }\n\n    .sidebar-section {\n        display: none;\n    }\n\n    .nav-item {\n        flex-direction: column;\n        padding: 10px 16px;\n        margin: 0 4px;\n        gap: 6px;\n        white-space: nowrap;\n        font-size: 12px;\n    }\n\n    .nav-item i {\n        font-size: 18px;\n    }\n\n    .nav-item .badge {\n        position: absolute;\n        top: 4px;\n        right: 4px;\n        margin-left: 0;\n        font-size: 9px;\n        padding: 1px 5px;\n    }\n\n    .main-content {\n        padding: 16px;\n    }\n\n    .dashboard-header {\n        padding: 12px 16px;\n    }\n\n    .header-title {\n        font-size: 1rem;\n    }\n\n    .header-title i {\n        font-size: 1.25rem;\n    }\n\n    .tab-label {\n        display: none;\n    }\n\n    .security-badge span {\n        display: none;\n    }\n\n    .overview-grid {\n        grid-template-columns: 1fr;\n        gap: 16px;\n    }\n\n    .stat-card {\n        padding: 20px;\n    }\n\n    .stat-card .stat-value {\n        font-size: 1.5rem;\n    }\n}\n\n@media (max-width: 480px) {\n    .dashboard-header {\n        padding: 10px 12px;\n    }\n\n    .header-title {\n        font-size: 0.9rem;\n        gap: 8px;\n    }\n\n    .header-title i {\n        font-size: 1.1rem;\n    }\n\n    .security-badge {\n        padding: 4px 8px;\n    }\n\n    .security-badge i {\n        font-size: 14px;\n    }\n\n    .sidebar {\n        padding: 8px;\n    }\n\n    .nav-item {\n        padding: 8px 12px;\n        font-size: 11px;\n    }\n\n    .nav-item i {\n        font-size: 16px;\n    }\n\n    .main-content {\n        padding: 12px;\n    }\n\n    .stat-card {\n        padding: 16px;\n        border-radius: 12px;\n    }\n\n    .stat-card .icon-wrapper {\n        width: 40px;\n        height: 40px;\n        font-size: 1rem;\n    }\n\n    .stat-card .stat-value {\n        font-size: 1.25rem;\n    }\n\n    .section-header {\n        flex-direction: column;\n        align-items: flex-start;\n        gap: 12px;\n    }\n\n    .activity-item {\n        padding: 10px 12px;\n    }\n\n    .activity-icon {\n        width: 36px;\n        height: 36px;\n    }\n\n    .activity-details .action {\n        font-size: 13px;\n    }\n}\n"] }]
    }], () => [{ type: i0.ChangeDetectorRef }], null); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CredentialsDashboardComponent, { className: "CredentialsDashboardComponent", filePath: "src/Credentials/credentials-dashboard.component.ts", lineNumber: 22 }); })();
//# sourceMappingURL=credentials-dashboard.component.js.map