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 } from '@angular/core';
import { BaseResourceComponent } from '@memberjunction/ng-shared';
import { RegisterClass, MJGlobal } from '@memberjunction/global';
import { DevToolsPrefs } from './dev-tools-prefs';
import { buildEventMonitorAgentContext } from './dev-tools-agent-context';
import { validateStringParam, validateEnumParam } from '../shared/agent-tool-validation';
import * as i0 from "@angular/core";
import * as i1 from "@angular/forms";
import * as i2 from "@memberjunction/ng-ui-components";
import * as i3 from "@angular/common";
function EventMonitorComponent_Conditional_4_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "i", 35);
    i0.ɵɵelementStart(1, "span", 6);
    i0.ɵɵtext(2, "Resume");
    i0.ɵɵelementEnd();
} }
function EventMonitorComponent_Conditional_5_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "i", 36);
    i0.ɵɵelementStart(1, "span", 6);
    i0.ɵɵtext(2, "Pause");
    i0.ɵɵelementEnd();
} }
function EventMonitorComponent_Conditional_46_Template(rf, ctx) { if (rf & 1) {
    const _r1 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "button", 37);
    i0.ɵɵlistener("click", function EventMonitorComponent_Conditional_46_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.Filter = ""); });
    i0.ɵɵelement(1, "i", 38);
    i0.ɵɵelementEnd();
} }
function EventMonitorComponent_For_54_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "option", 23);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const t_r3 = ctx.$implicit;
    i0.ɵɵproperty("value", t_r3);
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(t_r3);
} }
function EventMonitorComponent_For_62_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "option", 23);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const c_r4 = ctx.$implicit;
    i0.ɵɵproperty("value", c_r4);
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(c_r4);
} }
function EventMonitorComponent_Conditional_63_For_7_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "option", 23);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const c_r6 = ctx.$implicit;
    i0.ɵɵproperty("value", c_r6);
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(c_r6);
} }
function EventMonitorComponent_Conditional_63_Template(rf, ctx) { if (rf & 1) {
    const _r5 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 19)(1, "label", 20);
    i0.ɵɵtext(2, "Code");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(3, "select", 21);
    i0.ɵɵtwoWayListener("ngModelChange", function EventMonitorComponent_Conditional_63_Template_select_ngModelChange_3_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(); i0.ɵɵtwoWayBindingSet(ctx_r1.CodeFilter, $event) || (ctx_r1.CodeFilter = $event); return i0.ɵɵresetView($event); });
    i0.ɵɵlistener("ngModelChange", function EventMonitorComponent_Conditional_63_Template_select_ngModelChange_3_listener() { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.PersistPrefs()); });
    i0.ɵɵelementStart(4, "option", 22);
    i0.ɵɵtext(5);
    i0.ɵɵelementEnd();
    i0.ɵɵrepeaterCreate(6, EventMonitorComponent_Conditional_63_For_7_Template, 2, 2, "option", 23, i0.ɵɵrepeaterTrackByIdentity);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵadvance(3);
    i0.ɵɵtwoWayProperty("ngModel", ctx_r1.CodeFilter);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate1("All codes (", ctx_r1.KnownCodes.length, ")");
    i0.ɵɵadvance();
    i0.ɵɵrepeater(ctx_r1.KnownCodes);
} }
function EventMonitorComponent_Conditional_64_Template(rf, ctx) { if (rf & 1) {
    const _r7 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "button", 39);
    i0.ɵɵlistener("click", function EventMonitorComponent_Conditional_64_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r7); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.ClearFilters()); });
    i0.ɵɵelement(1, "i", 38);
    i0.ɵɵtext(2, " Clear filters ");
    i0.ɵɵelementEnd();
} }
function EventMonitorComponent_Conditional_69_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "i", 40);
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵclassProp("fa-arrow-down", ctx_r1.SortDir === "desc")("fa-arrow-up", ctx_r1.SortDir === "asc");
} }
function EventMonitorComponent_Conditional_72_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "i", 40);
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵclassProp("fa-arrow-down", ctx_r1.SortDir === "desc")("fa-arrow-up", ctx_r1.SortDir === "asc");
} }
function EventMonitorComponent_Conditional_75_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "i", 40);
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵclassProp("fa-arrow-down", ctx_r1.SortDir === "desc")("fa-arrow-up", ctx_r1.SortDir === "asc");
} }
function EventMonitorComponent_Conditional_78_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "i", 40);
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵclassProp("fa-arrow-down", ctx_r1.SortDir === "desc")("fa-arrow-up", ctx_r1.SortDir === "asc");
} }
function EventMonitorComponent_Conditional_82_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "mj-empty-state", 34);
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵproperty("Variant", ctx_r1.EmptyVariant)("Icon", ctx_r1.EmptyIcon)("Title", ctx_r1.EmptyTitle)("Message", ctx_r1.EmptyMessage);
} }
function EventMonitorComponent_Conditional_83_For_1_Conditional_16_Conditional_0_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "pre", 52)(1, "code");
    i0.ɵɵtext(2);
    i0.ɵɵpipe(3, "json");
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const evt_r9 = i0.ɵɵnextContext(2).$implicit;
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 1, evt_r9.args));
} }
function EventMonitorComponent_Conditional_83_For_1_Conditional_16_Conditional_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 53);
    i0.ɵɵelement(1, "i", 54);
    i0.ɵɵelementStart(2, "span");
    i0.ɵɵtext(3, "This event has no payload.");
    i0.ɵɵelementEnd()();
} }
function EventMonitorComponent_Conditional_83_For_1_Conditional_16_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵconditionalCreate(0, EventMonitorComponent_Conditional_83_For_1_Conditional_16_Conditional_0_Template, 4, 3, "pre", 52)(1, EventMonitorComponent_Conditional_83_For_1_Conditional_16_Conditional_1_Template, 4, 0, "div", 53);
} if (rf & 2) {
    const evt_r9 = i0.ɵɵnextContext().$implicit;
    i0.ɵɵconditional(evt_r9.hasPayload ? 0 : 1);
} }
function EventMonitorComponent_Conditional_83_For_1_Template(rf, ctx) { if (rf & 1) {
    const _r8 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 42)(1, "div", 43);
    i0.ɵɵlistener("click", function EventMonitorComponent_Conditional_83_For_1_Template_div_click_1_listener() { const evt_r9 = i0.ɵɵrestoreView(_r8).$implicit; const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.ToggleRow(evt_r9)); });
    i0.ɵɵelement(2, "i", 44);
    i0.ɵɵelementStart(3, "span", 45);
    i0.ɵɵtext(4);
    i0.ɵɵpipe(5, "date");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(6, "span", 46);
    i0.ɵɵtext(7);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(8, "span", 47);
    i0.ɵɵtext(9);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(10, "span", 48);
    i0.ɵɵtext(11);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(12, "span", 49);
    i0.ɵɵtext(13);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(14, "button", 50);
    i0.ɵɵlistener("click", function EventMonitorComponent_Conditional_83_For_1_Template_button_click_14_listener($event) { const evt_r9 = i0.ɵɵrestoreView(_r8).$implicit; const ctx_r1 = i0.ɵɵnextContext(2); $event.stopPropagation(); return i0.ɵɵresetView(ctx_r1.OnCopyRow(evt_r9)); });
    i0.ɵɵelement(15, "i", 51);
    i0.ɵɵelementEnd()();
    i0.ɵɵconditionalCreate(16, EventMonitorComponent_Conditional_83_For_1_Conditional_16_Template, 2, 1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const evt_r9 = ctx.$implicit;
    i0.ɵɵclassProp("em-row--expanded", evt_r9.expanded);
    i0.ɵɵadvance(2);
    i0.ɵɵclassProp("em-row-chev--down", evt_r9.expanded);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(5, 14, evt_r9.timestamp, "HH:mm:ss.SSS"));
    i0.ɵɵadvance(2);
    i0.ɵɵattribute("data-type", evt_r9.type);
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(evt_r9.type);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate(evt_r9.eventCode || "\u2014");
    i0.ɵɵadvance();
    i0.ɵɵproperty("title", evt_r9.componentName);
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(evt_r9.componentName);
    i0.ɵɵadvance();
    i0.ɵɵclassProp("em-row-summary--empty", !evt_r9.hasPayload);
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(evt_r9.summary);
    i0.ɵɵadvance(3);
    i0.ɵɵconditional(evt_r9.expanded ? 16 : -1);
} }
function EventMonitorComponent_Conditional_83_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵrepeaterCreate(0, EventMonitorComponent_Conditional_83_For_1_Template, 17, 17, "div", 41, i0.ɵɵcomponentInstance().TrackBySeq, true);
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵrepeater(ctx_r1.FilteredEvents);
} }
/**
 * Event Monitor — live tail of `MJGlobal.Instance.GetEventListener()`.
 * Captures events into a ring buffer (configurable cap) with filtering,
 * pause/resume, click-to-expand-payload, copy.
 */
let EventMonitorComponent = class EventMonitorComponent extends BaseResourceComponent {
    cdr;
    MaxEvents = 500;
    Events = [];
    Paused = false;
    AutoScroll = true;
    Filter = '';
    TypeFilter = ''; // '' = all
    ComponentFilter = ''; // '' = all
    CodeFilter = ''; // '' = all
    KnownTypes = [];
    KnownComponents = [];
    KnownCodes = [];
    Stats = { captured: 0, perSecond: 0, kept: 0 };
    StartedAt = new Date();
    SortField = 'time';
    SortDir = 'desc';
    sub;
    seq = 0;
    rateBucket = []; // event timestamps within last 1s
    rateTimer;
    constructor(cdr) {
        super();
        this.cdr = cdr;
    }
    ngOnInit() {
        this.loadPrefs();
        this.subscribe();
        this.rateTimer = setInterval(() => this.tickRate(), 500);
        this.NotifyLoadComplete();
    }
    ngAfterViewInit() {
        // Publish the initial agent context and register the client tools the AI
        // agent can invoke against this surface. Ongoing re-emit happens in the
        // user-action methods (pause/clear/filter/sort) and in tickRate (live metrics).
        this.publishAgentContext();
        this.registerAgentClientTools();
    }
    ngOnDestroy() {
        this.savePrefs();
        this.sub?.unsubscribe();
        if (this.rateTimer)
            clearInterval(this.rateTimer);
    }
    loadPrefs() {
        const p = DevToolsPrefs.Get('eventMonitor');
        if (!p)
            return;
        this.Filter = p.filter ?? '';
        this.TypeFilter = p.typeFilter ?? '';
        this.ComponentFilter = p.componentFilter ?? '';
        this.CodeFilter = p.codeFilter ?? '';
        this.SortField = p.sortField ?? 'time';
        this.SortDir = p.sortDir ?? 'desc';
    }
    savePrefs() {
        DevToolsPrefs.Save('eventMonitor', {
            filter: this.Filter,
            typeFilter: this.TypeFilter,
            componentFilter: this.ComponentFilter,
            codeFilter: this.CodeFilter,
            sortField: this.SortField,
            sortDir: this.SortDir
        });
    }
    async GetResourceDisplayName() { return 'Event Monitor'; }
    async GetResourceIconClass() { return 'fa-solid fa-bolt'; }
    TogglePause() {
        this.Paused = !this.Paused;
        this.cdr.markForCheck();
        this.publishAgentContext();
    }
    ToggleAutoScroll() {
        this.AutoScroll = !this.AutoScroll;
    }
    Clear() {
        this.Events = [];
        this.seq = 0;
        this.Stats.kept = 0;
        this.cdr.markForCheck();
        this.publishAgentContext();
    }
    ToggleRow(row) {
        row.expanded = !row.expanded;
    }
    OnTypeFilterClick(type) {
        this.TypeFilter = this.TypeFilter === type ? '' : type;
        this.publishAgentContext();
    }
    OnSortClick(field) {
        if (this.SortField === field) {
            this.SortDir = this.SortDir === 'asc' ? 'desc' : 'asc';
        }
        else {
            this.SortField = field;
            this.SortDir = field === 'time' ? 'desc' : 'asc';
        }
        this.savePrefs();
        this.publishAgentContext();
    }
    /** Public so the template can call on every ngModelChange (filters, selects). */
    PersistPrefs() {
        this.savePrefs();
        this.publishAgentContext();
    }
    async OnCopyRow(row) {
        const payload = {
            timestamp: row.timestamp.toISOString(),
            type: row.type,
            eventCode: row.eventCode,
            component: row.componentName,
            args: row.args
        };
        try {
            await navigator.clipboard.writeText(JSON.stringify(payload, null, 2));
        }
        catch { /* clipboard unavailable */ }
    }
    /** Empty-state presentation for the event list — varies by capture state. */
    get EmptyVariant() {
        if (this.Stats.captured === 0)
            return 'empty';
        return this.Paused ? 'warning' : 'no-results';
    }
    get EmptyIcon() {
        if (this.Stats.captured === 0)
            return 'fa-solid fa-radio';
        return this.Paused ? 'fa-solid fa-pause' : 'fa-solid fa-filter';
    }
    get EmptyTitle() {
        if (this.Stats.captured === 0)
            return 'Listening for events…';
        return this.Paused ? 'Capture is paused' : 'No events match your filter';
    }
    get EmptyMessage() {
        if (this.Stats.captured === 0)
            return 'Trigger an action — saves, navigation, AI events all show up here.';
        if (this.Paused)
            return `${this.Stats.captured} events fired since you paused. Click Resume to start collecting again.`;
        return `${this.Stats.kept} events in buffer · clear filters to see them.`;
    }
    get FilteredEvents() {
        let list = this.Events;
        if (this.TypeFilter)
            list = list.filter(e => e.type === this.TypeFilter);
        if (this.ComponentFilter)
            list = list.filter(e => e.componentName === this.ComponentFilter);
        if (this.CodeFilter)
            list = list.filter(e => (e.eventCode ?? '') === this.CodeFilter);
        const q = this.Filter.trim().toLowerCase();
        if (q) {
            list = list.filter(e => e.type.toLowerCase().includes(q) ||
                e.componentName.toLowerCase().includes(q) ||
                e.summary.toLowerCase().includes(q) ||
                (e.eventCode && e.eventCode.toLowerCase().includes(q)));
        }
        // Sort (always returns a new array — preserves the natural seq order otherwise)
        const dir = this.SortDir === 'asc' ? 1 : -1;
        const sorted = [...list].sort((a, b) => {
            switch (this.SortField) {
                case 'time': return (a.seq - b.seq) * dir;
                case 'type': return a.type.localeCompare(b.type) * dir;
                case 'eventCode': return (a.eventCode ?? '').localeCompare(b.eventCode ?? '') * dir;
                case 'component': return a.componentName.localeCompare(b.componentName) * dir;
                default: return 0;
            }
        });
        return sorted;
    }
    ClearFilters() {
        this.Filter = '';
        this.TypeFilter = '';
        this.ComponentFilter = '';
        this.CodeFilter = '';
        this.savePrefs();
        this.publishAgentContext();
    }
    get HasActiveFilters() {
        return !!(this.Filter || this.TypeFilter || this.ComponentFilter || this.CodeFilter);
    }
    get UptimeLabel() {
        const ms = Date.now() - this.StartedAt.getTime();
        const s = Math.floor(ms / 1000);
        const m = Math.floor(s / 60);
        const remainder = s % 60;
        return m > 0 ? `${m}m ${remainder}s` : `${s}s`;
    }
    TrackBySeq = (_i, e) => e.seq;
    // ---------- private ----------
    subscribe() {
        try {
            // withReplay = true so we get historical events that were emitted
            // before this component mounted (within MJGlobal's replay buffer).
            this.sub = MJGlobal.Instance.GetEventListener(true).subscribe((evt) => {
                this.handleEvent(evt);
            });
        }
        catch {
            // Listener unavailable; silent (rare)
        }
    }
    handleEvent(evt) {
        this.Stats.captured++;
        this.rateBucket.push(Date.now());
        if (this.Paused)
            return;
        const type = String(evt.event ?? 'Unknown');
        if (!this.KnownTypes.includes(type)) {
            this.KnownTypes = [...this.KnownTypes, type].sort();
        }
        const componentName = evt.component?.constructor?.name ?? '(no component)';
        if (!this.KnownComponents.includes(componentName)) {
            this.KnownComponents = [...this.KnownComponents, componentName].sort();
        }
        const code = evt.eventCode;
        if (code && !this.KnownCodes.includes(code)) {
            this.KnownCodes = [...this.KnownCodes, code].sort();
        }
        const hasPayload = this.computeHasPayload(evt.args);
        const row = {
            seq: ++this.seq,
            timestamp: new Date(),
            type,
            eventCode: code,
            componentName,
            summary: hasPayload ? this.summarizeArgs(evt.args) : '—',
            args: evt.args,
            expanded: false,
            hasPayload
        };
        this.Events = [row, ...this.Events];
        if (this.Events.length > this.MaxEvents) {
            this.Events = this.Events.slice(0, this.MaxEvents);
        }
        this.Stats.kept = this.Events.length;
        this.cdr.markForCheck();
    }
    computeHasPayload(args) {
        if (args === null || args === undefined)
            return false;
        if (typeof args === 'string')
            return args.length > 0;
        if (Array.isArray(args))
            return args.length > 0;
        if (typeof args === 'object')
            return Object.keys(args).length > 0;
        return true; // numbers, booleans count as payload
    }
    tickRate() {
        const cutoff = Date.now() - 1000;
        this.rateBucket = this.rateBucket.filter(t => t >= cutoff);
        this.Stats.perSecond = this.rateBucket.length;
        this.cdr.markForCheck();
        // Keep the agent's view of live metrics (event count / rate) current.
        this.publishAgentContext();
    }
    summarizeArgs(args) {
        if (args === null || args === undefined)
            return '—';
        if (typeof args === 'string')
            return args.length > 80 ? args.slice(0, 77) + '…' : args;
        if (typeof args === 'number' || typeof args === 'boolean')
            return String(args);
        if (Array.isArray(args))
            return `[ ${args.length} item${args.length === 1 ? '' : 's'} ]`;
        if (typeof args === 'object') {
            const keys = Object.keys(args);
            if (keys.length === 0)
                return '{ }';
            return `{ ${keys.slice(0, 3).join(', ')}${keys.length > 3 ? ', …' : ''} }`;
        }
        return String(args);
    }
    // ========================================
    // AI AGENT CONTEXT & CLIENT TOOLS
    //
    // 🔒 SAFETY BOUNDARY — CLASSIFICATION: SAFE developer diagnostic.
    // The Event Monitor is a live tail of MJGlobal's event bus. The context and
    // tools below report/control only the monitor's own capture state — event
    // counts, live rate, pause flag, the user's filters and sort. No tool reads
    // or mutates application data; the surface is a read-only diagnostic with
    // capture controls scoped entirely to this inspector's in-memory ring buffer.
    // ========================================
    /** Publish the current Event Monitor capture state to the AI agent. */
    publishAgentContext() {
        const filtered = this.FilteredEvents;
        const context = buildEventMonitorAgentContext({
            EventCount: this.Stats.captured,
            BufferedCount: this.Stats.kept,
            EventsPerSecond: this.Stats.perSecond,
            Paused: this.Paused,
            TextFilter: this.Filter,
            TypeFilter: this.TypeFilter,
            ComponentFilter: this.ComponentFilter,
            CodeFilter: this.CodeFilter,
            SortField: this.SortField,
            SortDirection: this.SortDir,
            FilteredCount: filtered.length,
            KnownTypes: this.KnownTypes,
            KnownComponents: this.KnownComponents,
            KnownCodes: this.KnownCodes,
            // Secret-free summaries of the most-recent visible events. `summary` is
            // already a redacted payload-shape preview (keys/length, never values).
            RecentEvents: filtered.slice(0, 25).map(e => ({
                Type: e.type,
                Component: e.componentName,
                Summary: e.summary,
            })),
        });
        this.navigationService.SetAgentContext(this, context);
    }
    /**
     * Register the client tools the AI agent can invoke against the Event Monitor.
     * All operate on the inspector's own capture state — no application mutation.
     * Tools: PauseEventMonitor / ResumeEventMonitor, ClearEventLog,
     * FilterEventsByType, FilterEventsByComponent, ClearEventFilters,
     * SetEventMonitorSort.
     */
    registerAgentClientTools() {
        this.navigationService.SetAgentClientTools(this, [
            {
                Name: 'PauseEventMonitor',
                Description: 'Pause live event capture (events keep counting but are not added to the log).',
                ParameterSchema: { type: 'object', properties: {} },
                Handler: async () => {
                    if (!this.Paused)
                        this.TogglePause();
                    return { Success: true };
                },
            },
            {
                Name: 'ResumeEventMonitor',
                Description: 'Resume live event capture after it was paused.',
                ParameterSchema: { type: 'object', properties: {} },
                Handler: async () => {
                    if (this.Paused)
                        this.TogglePause();
                    return { Success: true };
                },
            },
            {
                Name: 'ClearEventLog',
                Description: 'Clear all events currently held in the Event Monitor buffer.',
                ParameterSchema: { type: 'object', properties: {} },
                Handler: async () => {
                    this.Clear();
                    return { Success: true };
                },
            },
            {
                Name: 'FilterEventsByType',
                Description: 'Filter the event log to a single event type. Pass an empty string to clear the type filter.',
                ParameterSchema: { type: 'object', properties: { type: { type: 'string' } }, required: ['type'] },
                Handler: async (params) => this.toolFilterByType(params),
            },
            {
                Name: 'FilterEventsByComponent',
                Description: 'Filter the event log to a single emitting component name. Pass an empty string to clear the component filter.',
                ParameterSchema: { type: 'object', properties: { component: { type: 'string' } }, required: ['component'] },
                Handler: async (params) => this.toolFilterByComponent(params),
            },
            {
                Name: 'ClearEventFilters',
                Description: 'Clear all active Event Monitor filters (text, type, component, code) so every captured event is shown.',
                ParameterSchema: { type: 'object', properties: {} },
                Handler: async () => {
                    this.ClearFilters();
                    this.cdr.markForCheck();
                    return { Success: true };
                },
            },
            {
                Name: 'SetEventMonitorSort',
                Description: 'Set the event log sort field (time | type | eventCode | component) and direction (asc | desc).',
                ParameterSchema: {
                    type: 'object',
                    properties: {
                        field: { type: 'string', enum: ['time', 'type', 'eventCode', 'component'] },
                        direction: { type: 'string', enum: ['asc', 'desc'] },
                    },
                    required: ['field', 'direction'],
                },
                Handler: async (params) => this.toolSetSort(params),
            },
        ]);
    }
    /** Apply (or clear, on empty string) the event-type filter. */
    toolFilterByType(params) {
        const validated = validateStringParam(params['type'], 'type');
        if (!validated.ok) {
            return validated.result;
        }
        this.TypeFilter = validated.value;
        this.savePrefs();
        this.publishAgentContext();
        this.cdr.markForCheck();
        return { Success: true };
    }
    /** Apply (or clear, on empty string) the component-name filter. */
    toolFilterByComponent(params) {
        const validated = validateStringParam(params['component'], 'component');
        if (!validated.ok) {
            return validated.result;
        }
        this.ComponentFilter = validated.value;
        this.savePrefs();
        this.publishAgentContext();
        this.cdr.markForCheck();
        return { Success: true };
    }
    /** Set the sort field + direction from validated enum params. */
    toolSetSort(params) {
        const field = validateEnumParam(params['field'], ['time', 'type', 'eventCode', 'component'], 'field');
        if (!field.ok) {
            return field.result;
        }
        const dir = validateEnumParam(params['direction'], ['asc', 'desc'], 'direction');
        if (!dir.ok) {
            return dir.result;
        }
        this.SortField = field.value;
        this.SortDir = dir.value;
        this.savePrefs();
        this.publishAgentContext();
        this.cdr.markForCheck();
        return { Success: true };
    }
    static ɵfac = function EventMonitorComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || EventMonitorComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); };
    static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: EventMonitorComponent, selectors: [["mj-event-monitor"]], standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 84, vars: 32, consts: [[1, "mj-inspector", "mj-inspector--solo"], ["Role", "region", "AriaLabel", "Event monitor", "Title", "Event Monitor", "Subtitle", "Live tail of MJGlobal events with filter and pause"], ["actions", ""], ["mjButton", "", "variant", "secondary", "size", "sm", 3, "click", "title"], ["mjButton", "", "variant", "secondary", "size", "sm", "title", "Clear all captured events", 3, "click"], ["aria-hidden", "true", 1, "fa-solid", "fa-broom"], [1, "mj-action-label"], [1, "em-stats"], [1, "em-stat"], [1, "em-pulse"], [1, "em-stat-value"], [1, "em-stat-label"], [1, "em-stat", "em-stat--right"], [1, "em-stat-value", "em-stat-value--small"], [1, "em-toolbar"], [1, "em-search-wrap"], [1, "fa-solid", "fa-search", "em-search-icon"], ["type", "search", "placeholder", "Filter by type, component, payload\u2026", 1, "em-search", 3, "ngModelChange", "ngModel"], ["title", "Clear", 1, "em-search-clear"], [1, "em-select-wrap"], [1, "em-select-label"], [1, "em-select", 3, "ngModelChange", "ngModel"], ["value", ""], [3, "value"], ["type", "button", "title", "Clear all filters", 1, "em-clear-filters"], [1, "em-list"], [1, "em-table-head"], ["type", "button", 1, "em-th", "em-th--time", 3, "click"], [1, "fa-solid", 3, "fa-arrow-down", "fa-arrow-up"], ["type", "button", 1, "em-th", "em-th--type", 3, "click"], ["type", "button", 1, "em-th", "em-th--code", 3, "click"], ["type", "button", 1, "em-th", "em-th--component", 3, "click"], [1, "em-th", "em-th--summary"], [1, "em-th", "em-th--actions"], [3, "Variant", "Icon", "Title", "Message"], ["aria-hidden", "true", 1, "fa-solid", "fa-play"], ["aria-hidden", "true", 1, "fa-solid", "fa-pause"], ["title", "Clear", 1, "em-search-clear", 3, "click"], [1, "fa-solid", "fa-xmark"], ["type", "button", "title", "Clear all filters", 1, "em-clear-filters", 3, "click"], [1, "fa-solid"], [1, "em-row", 3, "em-row--expanded"], [1, "em-row"], [1, "em-row-head", 3, "click"], [1, "em-row-chev", "fa-solid", "fa-chevron-right"], [1, "em-row-time"], [1, "em-row-type"], [1, "em-row-code"], [1, "em-row-component", 3, "title"], [1, "em-row-summary"], ["type", "button", "title", "Copy as JSON", 1, "em-row-copy", 3, "click"], [1, "fa-solid", "fa-clipboard"], [1, "em-row-payload"], [1, "em-row-no-payload"], [1, "fa-regular", "fa-circle"]], template: function EventMonitorComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "div", 0)(1, "mj-page-header-interior", 1)(2, "div", 2)(3, "button", 3);
            i0.ɵɵlistener("click", function EventMonitorComponent_Template_button_click_3_listener() { return ctx.TogglePause(); });
            i0.ɵɵconditionalCreate(4, EventMonitorComponent_Conditional_4_Template, 3, 0)(5, EventMonitorComponent_Conditional_5_Template, 3, 0);
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(6, "button", 4);
            i0.ɵɵlistener("click", function EventMonitorComponent_Template_button_click_6_listener() { return ctx.Clear(); });
            i0.ɵɵelement(7, "i", 5);
            i0.ɵɵelementStart(8, "span", 6);
            i0.ɵɵtext(9, "Clear");
            i0.ɵɵelementEnd()()()();
            i0.ɵɵelementStart(10, "div", 7)(11, "div", 8);
            i0.ɵɵelement(12, "i", 9);
            i0.ɵɵelementStart(13, "div")(14, "div", 10);
            i0.ɵɵtext(15);
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(16, "div", 11);
            i0.ɵɵtext(17);
            i0.ɵɵelementEnd()()();
            i0.ɵɵelementStart(18, "div", 8)(19, "div")(20, "div", 10);
            i0.ɵɵtext(21);
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(22, "div", 11);
            i0.ɵɵtext(23, "Total captured");
            i0.ɵɵelementEnd()()();
            i0.ɵɵelementStart(24, "div", 8)(25, "div")(26, "div", 10);
            i0.ɵɵtext(27);
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(28, "div", 11);
            i0.ɵɵtext(29, "In buffer");
            i0.ɵɵelementEnd()()();
            i0.ɵɵelementStart(30, "div", 8)(31, "div")(32, "div", 10);
            i0.ɵɵtext(33);
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(34, "div", 11);
            i0.ɵɵtext(35, "Last second");
            i0.ɵɵelementEnd()()();
            i0.ɵɵelementStart(36, "div", 12)(37, "div")(38, "div", 13);
            i0.ɵɵtext(39);
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(40, "div", 11);
            i0.ɵɵtext(41, "Watching for");
            i0.ɵɵelementEnd()()()();
            i0.ɵɵelementStart(42, "div", 14)(43, "div", 15);
            i0.ɵɵelement(44, "i", 16);
            i0.ɵɵelementStart(45, "input", 17);
            i0.ɵɵtwoWayListener("ngModelChange", function EventMonitorComponent_Template_input_ngModelChange_45_listener($event) { i0.ɵɵtwoWayBindingSet(ctx.Filter, $event) || (ctx.Filter = $event); return $event; });
            i0.ɵɵlistener("ngModelChange", function EventMonitorComponent_Template_input_ngModelChange_45_listener() { return ctx.PersistPrefs(); });
            i0.ɵɵelementEnd();
            i0.ɵɵconditionalCreate(46, EventMonitorComponent_Conditional_46_Template, 2, 0, "button", 18);
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(47, "div", 19)(48, "label", 20);
            i0.ɵɵtext(49, "Type");
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(50, "select", 21);
            i0.ɵɵtwoWayListener("ngModelChange", function EventMonitorComponent_Template_select_ngModelChange_50_listener($event) { i0.ɵɵtwoWayBindingSet(ctx.TypeFilter, $event) || (ctx.TypeFilter = $event); return $event; });
            i0.ɵɵlistener("ngModelChange", function EventMonitorComponent_Template_select_ngModelChange_50_listener() { return ctx.PersistPrefs(); });
            i0.ɵɵelementStart(51, "option", 22);
            i0.ɵɵtext(52);
            i0.ɵɵelementEnd();
            i0.ɵɵrepeaterCreate(53, EventMonitorComponent_For_54_Template, 2, 2, "option", 23, i0.ɵɵrepeaterTrackByIdentity);
            i0.ɵɵelementEnd()();
            i0.ɵɵelementStart(55, "div", 19)(56, "label", 20);
            i0.ɵɵtext(57, "Component");
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(58, "select", 21);
            i0.ɵɵtwoWayListener("ngModelChange", function EventMonitorComponent_Template_select_ngModelChange_58_listener($event) { i0.ɵɵtwoWayBindingSet(ctx.ComponentFilter, $event) || (ctx.ComponentFilter = $event); return $event; });
            i0.ɵɵlistener("ngModelChange", function EventMonitorComponent_Template_select_ngModelChange_58_listener() { return ctx.PersistPrefs(); });
            i0.ɵɵelementStart(59, "option", 22);
            i0.ɵɵtext(60);
            i0.ɵɵelementEnd();
            i0.ɵɵrepeaterCreate(61, EventMonitorComponent_For_62_Template, 2, 2, "option", 23, i0.ɵɵrepeaterTrackByIdentity);
            i0.ɵɵelementEnd()();
            i0.ɵɵconditionalCreate(63, EventMonitorComponent_Conditional_63_Template, 8, 2, "div", 19);
            i0.ɵɵconditionalCreate(64, EventMonitorComponent_Conditional_64_Template, 3, 0, "button", 24);
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(65, "div", 25)(66, "div", 26)(67, "button", 27);
            i0.ɵɵlistener("click", function EventMonitorComponent_Template_button_click_67_listener() { return ctx.OnSortClick("time"); });
            i0.ɵɵtext(68, " Time ");
            i0.ɵɵconditionalCreate(69, EventMonitorComponent_Conditional_69_Template, 1, 4, "i", 28);
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(70, "button", 29);
            i0.ɵɵlistener("click", function EventMonitorComponent_Template_button_click_70_listener() { return ctx.OnSortClick("type"); });
            i0.ɵɵtext(71, " Type ");
            i0.ɵɵconditionalCreate(72, EventMonitorComponent_Conditional_72_Template, 1, 4, "i", 28);
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(73, "button", 30);
            i0.ɵɵlistener("click", function EventMonitorComponent_Template_button_click_73_listener() { return ctx.OnSortClick("eventCode"); });
            i0.ɵɵtext(74, " Code ");
            i0.ɵɵconditionalCreate(75, EventMonitorComponent_Conditional_75_Template, 1, 4, "i", 28);
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(76, "button", 31);
            i0.ɵɵlistener("click", function EventMonitorComponent_Template_button_click_76_listener() { return ctx.OnSortClick("component"); });
            i0.ɵɵtext(77, " Component ");
            i0.ɵɵconditionalCreate(78, EventMonitorComponent_Conditional_78_Template, 1, 4, "i", 28);
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(79, "span", 32);
            i0.ɵɵtext(80, "Summary");
            i0.ɵɵelementEnd();
            i0.ɵɵelement(81, "span", 33);
            i0.ɵɵelementEnd();
            i0.ɵɵconditionalCreate(82, EventMonitorComponent_Conditional_82_Template, 1, 4, "mj-empty-state", 34)(83, EventMonitorComponent_Conditional_83_Template, 2, 0);
            i0.ɵɵelementEnd()();
        } if (rf & 2) {
            i0.ɵɵadvance(3);
            i0.ɵɵproperty("title", ctx.Paused ? "Resume capture" : "Pause capture");
            i0.ɵɵadvance();
            i0.ɵɵconditional(ctx.Paused ? 4 : 5);
            i0.ɵɵadvance(8);
            i0.ɵɵclassProp("em-pulse--paused", ctx.Paused);
            i0.ɵɵadvance(3);
            i0.ɵɵtextInterpolate(ctx.Paused ? "PAUSED" : "LIVE");
            i0.ɵɵadvance(2);
            i0.ɵɵtextInterpolate(ctx.Paused ? "Capture suspended" : "Capturing events");
            i0.ɵɵadvance(4);
            i0.ɵɵtextInterpolate(ctx.Stats.captured);
            i0.ɵɵadvance(6);
            i0.ɵɵtextInterpolate2("", ctx.Stats.kept, " / ", ctx.MaxEvents);
            i0.ɵɵadvance(6);
            i0.ɵɵtextInterpolate1("", ctx.Stats.perSecond, "/s");
            i0.ɵɵadvance(6);
            i0.ɵɵtextInterpolate(ctx.UptimeLabel);
            i0.ɵɵadvance(6);
            i0.ɵɵtwoWayProperty("ngModel", ctx.Filter);
            i0.ɵɵadvance();
            i0.ɵɵconditional(ctx.Filter ? 46 : -1);
            i0.ɵɵadvance(4);
            i0.ɵɵtwoWayProperty("ngModel", ctx.TypeFilter);
            i0.ɵɵadvance(2);
            i0.ɵɵtextInterpolate1("All types (", ctx.KnownTypes.length, ")");
            i0.ɵɵadvance();
            i0.ɵɵrepeater(ctx.KnownTypes);
            i0.ɵɵadvance(5);
            i0.ɵɵtwoWayProperty("ngModel", ctx.ComponentFilter);
            i0.ɵɵadvance(2);
            i0.ɵɵtextInterpolate1("All components (", ctx.KnownComponents.length, ")");
            i0.ɵɵadvance();
            i0.ɵɵrepeater(ctx.KnownComponents);
            i0.ɵɵadvance(2);
            i0.ɵɵconditional(ctx.KnownCodes.length > 0 ? 63 : -1);
            i0.ɵɵadvance();
            i0.ɵɵconditional(ctx.HasActiveFilters ? 64 : -1);
            i0.ɵɵadvance(3);
            i0.ɵɵclassProp("em-th--sorted", ctx.SortField === "time");
            i0.ɵɵadvance(2);
            i0.ɵɵconditional(ctx.SortField === "time" ? 69 : -1);
            i0.ɵɵadvance();
            i0.ɵɵclassProp("em-th--sorted", ctx.SortField === "type");
            i0.ɵɵadvance(2);
            i0.ɵɵconditional(ctx.SortField === "type" ? 72 : -1);
            i0.ɵɵadvance();
            i0.ɵɵclassProp("em-th--sorted", ctx.SortField === "eventCode");
            i0.ɵɵadvance(2);
            i0.ɵɵconditional(ctx.SortField === "eventCode" ? 75 : -1);
            i0.ɵɵadvance();
            i0.ɵɵclassProp("em-th--sorted", ctx.SortField === "component");
            i0.ɵɵadvance(2);
            i0.ɵɵconditional(ctx.SortField === "component" ? 78 : -1);
            i0.ɵɵadvance(4);
            i0.ɵɵconditional(ctx.FilteredEvents.length === 0 ? 82 : 83);
        } }, dependencies: [i1.NgSelectOption, i1.ɵNgSelectMultipleOption, i1.DefaultValueAccessor, i1.SelectControlValueAccessor, i1.NgControlStatus, i1.NgModel, i2.MJButtonDirective, i2.MJPageHeaderInteriorComponent, i2.MJEmptyStateComponent, i3.JsonPipe, i3.DatePipe], styles: ["[_nghost-%COMP%] { display: block; height: 100%; }\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n.mj-inspector[_ngcontent-%COMP%] {\n    display: flex;\n    flex-direction: column;\n    height: 100%;\n    min-height: 0;\n    background: var(--mj-bg-page);\n    color: var(--mj-text-primary);\n    font-family: inherit;\n}\n\n\n\n.mj-inspector__content[_ngcontent-%COMP%] {\n    flex: 1;\n    min-width: 0;\n    display: flex;\n    flex-direction: column;\n    background: var(--mj-bg-page);\n}\n.mj-inspector__content-head[_ngcontent-%COMP%] {\n    padding: 12px 20px;\n    border-bottom: 1px solid var(--mj-border-subtle);\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    background: var(--mj-bg-surface-card);\n}\n.mj-inspector__content-title[_ngcontent-%COMP%] {\n    margin: 0;\n    font-size: 13px;\n    font-weight: 600;\n    color: var(--mj-text-primary);\n}\n.mj-inspector__content-meta[_ngcontent-%COMP%] {\n    font-size: 11px;\n    color: var(--mj-text-muted);\n}\n.mj-inspector__editor[_ngcontent-%COMP%] {\n    flex: 1;\n    min-height: 0;\n    display: flex;\n    flex-direction: column;\n    overflow: hidden;\n}\n.mj-inspector__editor[_ngcontent-%COMP%]   mj-code-editor[_ngcontent-%COMP%] {\n    flex: 1;\n    min-height: 0;\n    display: block;\n}\n\n\n\n.mj-inspector__empty[_ngcontent-%COMP%] {\n    flex: 1;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    color: var(--mj-text-muted);\n    font-size: 13px;\n}", ".mj-inspector--solo[_ngcontent-%COMP%] { background: var(--mj-bg-page); }\n\n\n\n.em-stats[_ngcontent-%COMP%] {\n    display: flex;\n    gap: 16px;\n    padding: 14px 20px;\n    border-bottom: 1px solid var(--mj-border-subtle);\n    background: var(--mj-bg-surface);\n    align-items: center;\n}\n.em-stat[_ngcontent-%COMP%] {\n    display: flex;\n    align-items: center;\n    gap: 10px;\n    padding: 8px 14px;\n    background: var(--mj-bg-surface-card);\n    border: 1px solid var(--mj-border-subtle);\n    border-radius: 10px;\n    min-width: 130px;\n}\n.em-stat--right[_ngcontent-%COMP%] { margin-left: auto; }\n.em-stat-value[_ngcontent-%COMP%] {\n    font-size: 16px;\n    font-weight: 700;\n    color: var(--mj-text-primary);\n    letter-spacing: -0.3px;\n    line-height: 1;\n}\n.em-stat-value--small[_ngcontent-%COMP%] { font-size: 13px; }\n.em-stat-label[_ngcontent-%COMP%] {\n    font-size: 10px;\n    color: var(--mj-text-muted);\n    text-transform: uppercase;\n    font-weight: 600;\n    letter-spacing: 0.5px;\n    margin-top: 4px;\n}\n\n\n\n.em-pulse[_ngcontent-%COMP%] {\n    width: 10px;\n    height: 10px;\n    border-radius: 50%;\n    background: var(--mj-status-success);\n    box-shadow: 0 0 0 0 var(--mj-status-success);\n    animation: _ngcontent-%COMP%_em-pulse-anim 1.6s ease-out infinite;\n}\n.em-pulse--paused[_ngcontent-%COMP%] {\n    background: var(--mj-status-warning);\n    box-shadow: none;\n    animation: none;\n}\n@keyframes _ngcontent-%COMP%_em-pulse-anim {\n    0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--mj-status-success) 70%, transparent); }\n    70%  { box-shadow: 0 0 0 8px color-mix(in srgb, var(--mj-status-success) 0%, transparent); }\n    100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--mj-status-success) 0%, transparent); }\n}\n@media (prefers-reduced-motion: reduce) { .em-pulse[_ngcontent-%COMP%] { animation: none; } }\n\n\n\n.em-toolbar[_ngcontent-%COMP%] {\n    display: flex;\n    align-items: flex-end;\n    gap: 10px;\n    padding: 10px 20px;\n    border-bottom: 1px solid var(--mj-border-subtle);\n    background: var(--mj-bg-surface);\n    flex-wrap: wrap;\n}\n.em-search-wrap[_ngcontent-%COMP%] {\n    position: relative;\n    width: 280px;\n    flex-shrink: 0;\n}\n.em-select-wrap[_ngcontent-%COMP%] {\n    display: flex;\n    flex-direction: column;\n    gap: 3px;\n    min-width: 0;\n}\n.em-select-label[_ngcontent-%COMP%] {\n    font-size: 9.5px;\n    font-weight: 700;\n    color: var(--mj-text-muted);\n    text-transform: uppercase;\n    letter-spacing: 0.5px;\n}\n.em-select[_ngcontent-%COMP%] {\n    padding: 6px 10px;\n    border: 1px solid var(--mj-border-default);\n    border-radius: 7px;\n    background: var(--mj-bg-surface);\n    color: var(--mj-text-primary);\n    font-size: 12px;\n    font-family: inherit;\n    cursor: pointer;\n    min-width: 160px;\n    max-width: 240px;\n}\n.em-select[_ngcontent-%COMP%]:focus {\n    outline: none;\n    border-color: var(--mj-brand-primary);\n    box-shadow: 0 0 0 3px color-mix(in srgb, var(--mj-brand-primary) 15%, transparent);\n}\n.em-clear-filters[_ngcontent-%COMP%] {\n    align-self: flex-end;\n    padding: 6px 12px;\n    background: transparent;\n    border: 1px solid color-mix(in srgb, var(--mj-status-warning) 30%, var(--mj-border-default));\n    color: color-mix(in srgb, var(--mj-status-warning) 70%, var(--mj-text-primary));\n    border-radius: 7px;\n    font-size: 11.5px;\n    font-weight: 500;\n    cursor: pointer;\n    font-family: inherit;\n    margin-left: auto;\n    display: inline-flex;\n    align-items: center;\n    gap: 5px;\n}\n.em-clear-filters[_ngcontent-%COMP%]:hover {\n    background: color-mix(in srgb, var(--mj-status-warning) 8%, transparent);\n}\n.em-search-icon[_ngcontent-%COMP%] {\n    position: absolute;\n    left: 12px;\n    top: 50%;\n    transform: translateY(-50%);\n    color: var(--mj-text-muted);\n    font-size: 12px;\n    pointer-events: none;\n}\n.em-search[_ngcontent-%COMP%] {\n    width: 100%;\n    padding: 7px 32px 7px 32px;\n    border: 1px solid var(--mj-border-default);\n    border-radius: 8px;\n    background: var(--mj-bg-surface);\n    color: var(--mj-text-primary);\n    font-size: 12.5px;\n    font-family: inherit;\n}\n.em-search[_ngcontent-%COMP%]:focus {\n    outline: none;\n    border-color: var(--mj-brand-primary);\n    box-shadow: 0 0 0 3px color-mix(in srgb, var(--mj-brand-primary) 15%, transparent);\n}\n.em-search-clear[_ngcontent-%COMP%] {\n    position: absolute;\n    right: 8px; top: 50%;\n    transform: translateY(-50%);\n    background: transparent;\n    border: none;\n    color: var(--mj-text-muted);\n    cursor: pointer;\n    width: 22px; height: 22px;\n    border-radius: 4px;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    font-size: 11px;\n}\n.em-search-clear[_ngcontent-%COMP%]:hover { background: var(--mj-bg-surface-hover); color: var(--mj-text-primary); }\n\n\n\n.em-table-head[_ngcontent-%COMP%] {\n    display: grid;\n    grid-template-columns: 110px 160px 140px 200px 1fr 32px;\n    gap: 12px;\n    padding: 8px 20px;\n    background: var(--mj-bg-surface-card);\n    border-bottom: 1px solid var(--mj-border-subtle);\n    position: sticky;\n    top: 0;\n    z-index: 1;\n    align-items: center;\n}\n.em-th[_ngcontent-%COMP%] {\n    font-size: 10px;\n    font-weight: 700;\n    color: var(--mj-text-muted);\n    text-transform: uppercase;\n    letter-spacing: 0.5px;\n    background: transparent;\n    border: none;\n    cursor: pointer;\n    font-family: inherit;\n    text-align: left;\n    padding: 4px 0;\n    display: inline-flex;\n    align-items: center;\n    gap: 5px;\n    transition: color 0.12s;\n}\n.em-th[_ngcontent-%COMP%]:hover { color: var(--mj-text-primary); }\n.em-th--sorted[_ngcontent-%COMP%] {\n    color: var(--mj-brand-primary);\n}\n.em-th--sorted[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] { font-size: 9px; }\n.em-th--summary[_ngcontent-%COMP%], \n.em-th--actions[_ngcontent-%COMP%] {\n    cursor: default;\n}\n.em-th--summary[_ngcontent-%COMP%]:hover, \n.em-th--actions[_ngcontent-%COMP%]:hover { color: var(--mj-text-muted); }\n\n\n\n.em-list[_ngcontent-%COMP%] {\n    flex: 1;\n    min-height: 0;\n    overflow-y: auto;\n    background: var(--mj-bg-page);\n}\n.em-row[_ngcontent-%COMP%] {\n    border-bottom: 1px solid var(--mj-border-subtle);\n    background: var(--mj-bg-surface);\n    transition: background 0.1s;\n    animation: _ngcontent-%COMP%_em-row-in 0.25s ease-out;\n}\n@keyframes _ngcontent-%COMP%_em-row-in {\n    from { opacity: 0; transform: translateY(-3px); }\n    to   { opacity: 1; transform: translateY(0); }\n}\n@media (prefers-reduced-motion: reduce) { .em-row[_ngcontent-%COMP%] { animation: none; } }\n.em-row[_ngcontent-%COMP%]:hover { background: var(--mj-bg-surface-hover); }\n.em-row--expanded[_ngcontent-%COMP%] { background: color-mix(in srgb, var(--mj-brand-primary) 4%, var(--mj-bg-surface)); }\n.em-row--expanded[_ngcontent-%COMP%]:hover { background: color-mix(in srgb, var(--mj-brand-primary) 6%, var(--mj-bg-surface)); }\n\n.em-row-head[_ngcontent-%COMP%] {\n    display: grid;\n    grid-template-columns: 12px 96px 160px 140px 200px 1fr 32px;\n    gap: 12px;\n    padding: 8px 20px;\n    cursor: pointer;\n    font-size: 12.5px;\n    align-items: center;\n}\n.em-row-chev[_ngcontent-%COMP%] {\n    color: var(--mj-text-muted);\n    font-size: 10px;\n    width: 12px;\n    flex-shrink: 0;\n    transition: transform 0.15s;\n    justify-self: start;\n}\n.em-row-chev--down[_ngcontent-%COMP%] { transform: rotate(90deg); }\n.em-row-time[_ngcontent-%COMP%] {\n    color: var(--mj-text-muted);\n    font-family: 'SF Mono', Menlo, Consolas, monospace;\n    font-size: 11px;\n    overflow: hidden;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n}\n.em-row-type[_ngcontent-%COMP%] {\n    font-family: 'SF Mono', Menlo, Consolas, monospace;\n    font-weight: 700;\n    font-size: 11px;\n    padding: 2px 8px;\n    border-radius: 4px;\n    background: color-mix(in srgb, var(--mj-brand-primary) 12%, transparent);\n    color: var(--mj-brand-primary);\n    overflow: hidden;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n    justify-self: start;\n}\n.em-row-type[data-type=\"LoggedIn\"][_ngcontent-%COMP%]                       { background: color-mix(in srgb, var(--mj-status-success) 14%, transparent); color: color-mix(in srgb, var(--mj-status-success) 70%, var(--mj-text-primary)); }\n.em-row-type[data-type=\"LoggedOut\"][_ngcontent-%COMP%], \n.em-row-type[data-type=\"LoginFailed\"][_ngcontent-%COMP%], \n.em-row-type[data-type=\"LogoutFailed\"][_ngcontent-%COMP%]                   { background: color-mix(in srgb, var(--mj-status-error) 14%, transparent); color: color-mix(in srgb, var(--mj-status-error) 70%, var(--mj-text-primary)); }\n.em-row-type[data-type=\"DisplaySimpleNotificationRequest\"][_ngcontent-%COMP%] { background: color-mix(in srgb, var(--mj-status-warning) 14%, transparent); color: color-mix(in srgb, var(--mj-status-warning) 70%, var(--mj-text-primary)); }\n.em-row-type[data-type=\"ManualResizeRequest\"][_ngcontent-%COMP%]            { background: color-mix(in srgb, var(--mj-brand-primary) 12%, transparent); color: color-mix(in srgb, var(--mj-brand-primary) 70%, var(--mj-text-primary)); }\n\n.em-row-code[_ngcontent-%COMP%] {\n    font-family: 'SF Mono', Menlo, Consolas, monospace;\n    font-size: 11px;\n    color: var(--mj-text-secondary);\n    overflow: hidden;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n}\n.em-row-component[_ngcontent-%COMP%] {\n    font-size: 11.5px;\n    color: var(--mj-text-secondary);\n    font-family: 'SF Mono', Menlo, Consolas, monospace;\n    overflow: hidden;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n}\n.em-row-summary[_ngcontent-%COMP%] {\n    font-family: 'SF Mono', Menlo, Consolas, monospace;\n    font-size: 11.5px;\n    color: var(--mj-text-muted);\n    overflow: hidden;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n    min-width: 0;\n}\n.em-row-summary--empty[_ngcontent-%COMP%] { font-style: italic; opacity: 0.6; }\n\n.em-row-no-payload[_ngcontent-%COMP%] {\n    margin: 0 20px 12px 50px;\n    background: var(--mj-bg-surface-sunken);\n    border: 1px dashed var(--mj-border-default);\n    border-radius: 8px;\n    padding: 14px 18px;\n    color: var(--mj-text-muted);\n    font-size: 12px;\n    display: flex;\n    align-items: center;\n    gap: 10px;\n}\n.em-row-no-payload[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] { font-size: 14px; }\n.em-row-copy[_ngcontent-%COMP%] {\n    background: transparent;\n    border: 1px solid transparent;\n    color: var(--mj-text-muted);\n    cursor: pointer;\n    padding: 4px 8px;\n    border-radius: 5px;\n    font-size: 11px;\n    opacity: 0;\n    transition: all 0.12s;\n}\n.em-row[_ngcontent-%COMP%]:hover   .em-row-copy[_ngcontent-%COMP%] { opacity: 1; }\n.em-row-copy[_ngcontent-%COMP%]:hover {\n    background: var(--mj-bg-surface-hover);\n    border-color: var(--mj-border-default);\n    color: var(--mj-text-primary);\n}\n\n.em-row-payload[_ngcontent-%COMP%] {\n    margin: 0 20px 12px 50px;\n    background: var(--mj-bg-surface-sunken);\n    border: 1px solid var(--mj-border-subtle);\n    border-radius: 8px;\n    padding: 12px 14px;\n    font-family: 'SF Mono', Menlo, Consolas, monospace;\n    font-size: 11.5px;\n    color: var(--mj-text-primary);\n    overflow: auto;\n    max-height: 280px;\n}\n.em-row-payload[_ngcontent-%COMP%]   code[_ngcontent-%COMP%] { white-space: pre-wrap; word-break: break-word; }\n\n@media (max-width: 800px) {\n    .em-stats[_ngcontent-%COMP%] { flex-wrap: wrap; }\n    .em-stat--right[_ngcontent-%COMP%] { margin-left: 0; }\n    .em-row-component[_ngcontent-%COMP%] { display: none; }\n    .em-row-time[_ngcontent-%COMP%] { min-width: 70px; }\n    .em-row-payload[_ngcontent-%COMP%] { margin-left: 20px; }\n}"] });
};
EventMonitorComponent = __decorate([
    RegisterClass(BaseResourceComponent, 'EventMonitorInspector')
], EventMonitorComponent);
export { EventMonitorComponent };
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(EventMonitorComponent, [{
        type: Component,
        args: [{ standalone: false, selector: 'mj-event-monitor', template: "<div class=\"mj-inspector mj-inspector--solo\">\n    <mj-page-header-interior\n        Role=\"region\"\n        AriaLabel=\"Event monitor\"\n        Title=\"Event Monitor\"\n        Subtitle=\"Live tail of MJGlobal events with filter and pause\">\n        <div actions>\n            <button mjButton\n                    variant=\"secondary\"\n                    size=\"sm\"\n                    (click)=\"TogglePause()\"\n                    [title]=\"Paused ? 'Resume capture' : 'Pause capture'\">\n                @if (Paused) {\n                    <i class=\"fa-solid fa-play\" aria-hidden=\"true\"></i> <span class=\"mj-action-label\">Resume</span>\n                } @else {\n                    <i class=\"fa-solid fa-pause\" aria-hidden=\"true\"></i> <span class=\"mj-action-label\">Pause</span>\n                }\n            </button>\n            <button mjButton variant=\"secondary\" size=\"sm\" (click)=\"Clear()\" title=\"Clear all captured events\">\n                <i class=\"fa-solid fa-broom\" aria-hidden=\"true\"></i> <span class=\"mj-action-label\">Clear</span>\n            </button>\n        </div>\n    </mj-page-header-interior>\n\n    <div class=\"em-stats\">\n        <div class=\"em-stat\">\n            <i class=\"em-pulse\" [class.em-pulse--paused]=\"Paused\"></i>\n            <div>\n                <div class=\"em-stat-value\">{{ Paused ? 'PAUSED' : 'LIVE' }}</div>\n                <div class=\"em-stat-label\">{{ Paused ? 'Capture suspended' : 'Capturing events' }}</div>\n            </div>\n        </div>\n        <div class=\"em-stat\">\n            <div>\n                <div class=\"em-stat-value\">{{ Stats.captured }}</div>\n                <div class=\"em-stat-label\">Total captured</div>\n            </div>\n        </div>\n        <div class=\"em-stat\">\n            <div>\n                <div class=\"em-stat-value\">{{ Stats.kept }} / {{ MaxEvents }}</div>\n                <div class=\"em-stat-label\">In buffer</div>\n            </div>\n        </div>\n        <div class=\"em-stat\">\n            <div>\n                <div class=\"em-stat-value\">{{ Stats.perSecond }}/s</div>\n                <div class=\"em-stat-label\">Last second</div>\n            </div>\n        </div>\n        <div class=\"em-stat em-stat--right\">\n            <div>\n                <div class=\"em-stat-value em-stat-value--small\">{{ UptimeLabel }}</div>\n                <div class=\"em-stat-label\">Watching for</div>\n            </div>\n        </div>\n    </div>\n\n    <div class=\"em-toolbar\">\n        <div class=\"em-search-wrap\">\n            <i class=\"fa-solid fa-search em-search-icon\"></i>\n            <input type=\"search\"\n                   class=\"em-search\"\n                   placeholder=\"Filter by type, component, payload\u2026\"\n                   [(ngModel)]=\"Filter\"\n                   (ngModelChange)=\"PersistPrefs()\" />\n            @if (Filter) {\n                <button class=\"em-search-clear\" (click)=\"Filter = ''\" title=\"Clear\">\n                    <i class=\"fa-solid fa-xmark\"></i>\n                </button>\n            }\n        </div>\n\n        <div class=\"em-select-wrap\">\n            <label class=\"em-select-label\">Type</label>\n            <select class=\"em-select\" [(ngModel)]=\"TypeFilter\" (ngModelChange)=\"PersistPrefs()\">\n                <option value=\"\">All types ({{ KnownTypes.length }})</option>\n                @for (t of KnownTypes; track t) {\n                    <option [value]=\"t\">{{ t }}</option>\n                }\n            </select>\n        </div>\n\n        <div class=\"em-select-wrap\">\n            <label class=\"em-select-label\">Component</label>\n            <select class=\"em-select\" [(ngModel)]=\"ComponentFilter\" (ngModelChange)=\"PersistPrefs()\">\n                <option value=\"\">All components ({{ KnownComponents.length }})</option>\n                @for (c of KnownComponents; track c) {\n                    <option [value]=\"c\">{{ c }}</option>\n                }\n            </select>\n        </div>\n\n        @if (KnownCodes.length > 0) {\n            <div class=\"em-select-wrap\">\n                <label class=\"em-select-label\">Code</label>\n                <select class=\"em-select\" [(ngModel)]=\"CodeFilter\" (ngModelChange)=\"PersistPrefs()\">\n                    <option value=\"\">All codes ({{ KnownCodes.length }})</option>\n                    @for (c of KnownCodes; track c) {\n                        <option [value]=\"c\">{{ c }}</option>\n                    }\n                </select>\n            </div>\n        }\n\n        @if (HasActiveFilters) {\n            <button class=\"em-clear-filters\" type=\"button\" (click)=\"ClearFilters()\" title=\"Clear all filters\">\n                <i class=\"fa-solid fa-xmark\"></i> Clear filters\n            </button>\n        }\n    </div>\n\n    <div class=\"em-list\">\n        <div class=\"em-table-head\">\n            <button type=\"button\"\n                    class=\"em-th em-th--time\"\n                    [class.em-th--sorted]=\"SortField === 'time'\"\n                    (click)=\"OnSortClick('time')\">\n                Time\n                @if (SortField === 'time') {\n                    <i class=\"fa-solid\" [class.fa-arrow-down]=\"SortDir === 'desc'\" [class.fa-arrow-up]=\"SortDir === 'asc'\"></i>\n                }\n            </button>\n            <button type=\"button\"\n                    class=\"em-th em-th--type\"\n                    [class.em-th--sorted]=\"SortField === 'type'\"\n                    (click)=\"OnSortClick('type')\">\n                Type\n                @if (SortField === 'type') {\n                    <i class=\"fa-solid\" [class.fa-arrow-down]=\"SortDir === 'desc'\" [class.fa-arrow-up]=\"SortDir === 'asc'\"></i>\n                }\n            </button>\n            <button type=\"button\"\n                    class=\"em-th em-th--code\"\n                    [class.em-th--sorted]=\"SortField === 'eventCode'\"\n                    (click)=\"OnSortClick('eventCode')\">\n                Code\n                @if (SortField === 'eventCode') {\n                    <i class=\"fa-solid\" [class.fa-arrow-down]=\"SortDir === 'desc'\" [class.fa-arrow-up]=\"SortDir === 'asc'\"></i>\n                }\n            </button>\n            <button type=\"button\"\n                    class=\"em-th em-th--component\"\n                    [class.em-th--sorted]=\"SortField === 'component'\"\n                    (click)=\"OnSortClick('component')\">\n                Component\n                @if (SortField === 'component') {\n                    <i class=\"fa-solid\" [class.fa-arrow-down]=\"SortDir === 'desc'\" [class.fa-arrow-up]=\"SortDir === 'asc'\"></i>\n                }\n            </button>\n            <span class=\"em-th em-th--summary\">Summary</span>\n            <span class=\"em-th em-th--actions\"></span>\n        </div>\n\n        @if (FilteredEvents.length === 0) {\n            <mj-empty-state [Variant]=\"EmptyVariant\" [Icon]=\"EmptyIcon\"\n                [Title]=\"EmptyTitle\" [Message]=\"EmptyMessage\" />\n        } @else {\n            @for (evt of FilteredEvents; track TrackBySeq($index, evt)) {\n                <div class=\"em-row\" [class.em-row--expanded]=\"evt.expanded\">\n                    <div class=\"em-row-head\" (click)=\"ToggleRow(evt)\">\n                        <i class=\"em-row-chev fa-solid fa-chevron-right\"\n                           [class.em-row-chev--down]=\"evt.expanded\"></i>\n                        <span class=\"em-row-time\">{{ evt.timestamp | date:'HH:mm:ss.SSS' }}</span>\n                        <span class=\"em-row-type\" [attr.data-type]=\"evt.type\">{{ evt.type }}</span>\n                        <span class=\"em-row-code\">{{ evt.eventCode || '\u2014' }}</span>\n                        <span class=\"em-row-component\" [title]=\"evt.componentName\">{{ evt.componentName }}</span>\n                        <span class=\"em-row-summary\" [class.em-row-summary--empty]=\"!evt.hasPayload\">{{ evt.summary }}</span>\n                        <button class=\"em-row-copy\"\n                                type=\"button\"\n                                (click)=\"$event.stopPropagation(); OnCopyRow(evt)\"\n                                title=\"Copy as JSON\">\n                            <i class=\"fa-solid fa-clipboard\"></i>\n                        </button>\n                    </div>\n                    @if (evt.expanded) {\n                        @if (evt.hasPayload) {\n                            <pre class=\"em-row-payload\"><code>{{ evt.args | json }}</code></pre>\n                        } @else {\n                            <div class=\"em-row-no-payload\">\n                                <i class=\"fa-regular fa-circle\"></i>\n                                <span>This event has no payload.</span>\n                            </div>\n                        }\n                    }\n                </div>\n            }\n        }\n    </div>\n</div>\n", styles: [":host { display: block; height: 100%; }\n\n/*\n  Inspector shell \u2014 each Dev Tools sub-page wraps its body in .mj-inspector. The\n  chrome (title icon, title, subtitle, action buttons) was previously rendered\n  via .mj-inspector__header*, but that's been replaced by <mj-page-header-interior>\n  in every inspector template. Action buttons now use the mjButton directive\n  (variant=\"secondary\" / \"success\") so they inherit global button styling. App\n  State + Layout inspectors used to carry an inner left rail (.mj-inspector__body\n  + __sidebar + __nav-item) for L2 sections; that rail was retired 2026-05-19 in\n  favor of <mj-tab-nav> projected into the chrome's [toolbar] slot, matching\n  SystemDiagnostics and the API Keys tab strip. All inspectors are now \"solo\"\n  mode (no sidebar).\n*/\n.mj-inspector {\n    display: flex;\n    flex-direction: column;\n    height: 100%;\n    min-height: 0;\n    background: var(--mj-bg-page);\n    color: var(--mj-text-primary);\n    font-family: inherit;\n}\n\n/* Content area */\n.mj-inspector__content {\n    flex: 1;\n    min-width: 0;\n    display: flex;\n    flex-direction: column;\n    background: var(--mj-bg-page);\n}\n.mj-inspector__content-head {\n    padding: 12px 20px;\n    border-bottom: 1px solid var(--mj-border-subtle);\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    background: var(--mj-bg-surface-card);\n}\n.mj-inspector__content-title {\n    margin: 0;\n    font-size: 13px;\n    font-weight: 600;\n    color: var(--mj-text-primary);\n}\n.mj-inspector__content-meta {\n    font-size: 11px;\n    color: var(--mj-text-muted);\n}\n.mj-inspector__editor {\n    flex: 1;\n    min-height: 0;\n    display: flex;\n    flex-direction: column;\n    overflow: hidden;\n}\n.mj-inspector__editor mj-code-editor {\n    flex: 1;\n    min-height: 0;\n    display: block;\n}\n\n/* Empty state */\n.mj-inspector__empty {\n    flex: 1;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    color: var(--mj-text-muted);\n    font-size: 13px;\n}\n\n", ".mj-inspector--solo { background: var(--mj-bg-page); }\n\n/* Stats row */\n.em-stats {\n    display: flex;\n    gap: 16px;\n    padding: 14px 20px;\n    border-bottom: 1px solid var(--mj-border-subtle);\n    background: var(--mj-bg-surface);\n    align-items: center;\n}\n.em-stat {\n    display: flex;\n    align-items: center;\n    gap: 10px;\n    padding: 8px 14px;\n    background: var(--mj-bg-surface-card);\n    border: 1px solid var(--mj-border-subtle);\n    border-radius: 10px;\n    min-width: 130px;\n}\n.em-stat--right { margin-left: auto; }\n.em-stat-value {\n    font-size: 16px;\n    font-weight: 700;\n    color: var(--mj-text-primary);\n    letter-spacing: -0.3px;\n    line-height: 1;\n}\n.em-stat-value--small { font-size: 13px; }\n.em-stat-label {\n    font-size: 10px;\n    color: var(--mj-text-muted);\n    text-transform: uppercase;\n    font-weight: 600;\n    letter-spacing: 0.5px;\n    margin-top: 4px;\n}\n\n/* Live pulse */\n.em-pulse {\n    width: 10px;\n    height: 10px;\n    border-radius: 50%;\n    background: var(--mj-status-success);\n    box-shadow: 0 0 0 0 var(--mj-status-success);\n    animation: em-pulse-anim 1.6s ease-out infinite;\n}\n.em-pulse--paused {\n    background: var(--mj-status-warning);\n    box-shadow: none;\n    animation: none;\n}\n@keyframes em-pulse-anim {\n    0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--mj-status-success) 70%, transparent); }\n    70%  { box-shadow: 0 0 0 8px color-mix(in srgb, var(--mj-status-success) 0%, transparent); }\n    100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--mj-status-success) 0%, transparent); }\n}\n@media (prefers-reduced-motion: reduce) { .em-pulse { animation: none; } }\n\n/* Toolbar */\n.em-toolbar {\n    display: flex;\n    align-items: flex-end;\n    gap: 10px;\n    padding: 10px 20px;\n    border-bottom: 1px solid var(--mj-border-subtle);\n    background: var(--mj-bg-surface);\n    flex-wrap: wrap;\n}\n.em-search-wrap {\n    position: relative;\n    width: 280px;\n    flex-shrink: 0;\n}\n.em-select-wrap {\n    display: flex;\n    flex-direction: column;\n    gap: 3px;\n    min-width: 0;\n}\n.em-select-label {\n    font-size: 9.5px;\n    font-weight: 700;\n    color: var(--mj-text-muted);\n    text-transform: uppercase;\n    letter-spacing: 0.5px;\n}\n.em-select {\n    padding: 6px 10px;\n    border: 1px solid var(--mj-border-default);\n    border-radius: 7px;\n    background: var(--mj-bg-surface);\n    color: var(--mj-text-primary);\n    font-size: 12px;\n    font-family: inherit;\n    cursor: pointer;\n    min-width: 160px;\n    max-width: 240px;\n}\n.em-select:focus {\n    outline: none;\n    border-color: var(--mj-brand-primary);\n    box-shadow: 0 0 0 3px color-mix(in srgb, var(--mj-brand-primary) 15%, transparent);\n}\n.em-clear-filters {\n    align-self: flex-end;\n    padding: 6px 12px;\n    background: transparent;\n    border: 1px solid color-mix(in srgb, var(--mj-status-warning) 30%, var(--mj-border-default));\n    color: color-mix(in srgb, var(--mj-status-warning) 70%, var(--mj-text-primary));\n    border-radius: 7px;\n    font-size: 11.5px;\n    font-weight: 500;\n    cursor: pointer;\n    font-family: inherit;\n    margin-left: auto;\n    display: inline-flex;\n    align-items: center;\n    gap: 5px;\n}\n.em-clear-filters:hover {\n    background: color-mix(in srgb, var(--mj-status-warning) 8%, transparent);\n}\n.em-search-icon {\n    position: absolute;\n    left: 12px;\n    top: 50%;\n    transform: translateY(-50%);\n    color: var(--mj-text-muted);\n    font-size: 12px;\n    pointer-events: none;\n}\n.em-search {\n    width: 100%;\n    padding: 7px 32px 7px 32px;\n    border: 1px solid var(--mj-border-default);\n    border-radius: 8px;\n    background: var(--mj-bg-surface);\n    color: var(--mj-text-primary);\n    font-size: 12.5px;\n    font-family: inherit;\n}\n.em-search:focus {\n    outline: none;\n    border-color: var(--mj-brand-primary);\n    box-shadow: 0 0 0 3px color-mix(in srgb, var(--mj-brand-primary) 15%, transparent);\n}\n.em-search-clear {\n    position: absolute;\n    right: 8px; top: 50%;\n    transform: translateY(-50%);\n    background: transparent;\n    border: none;\n    color: var(--mj-text-muted);\n    cursor: pointer;\n    width: 22px; height: 22px;\n    border-radius: 4px;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    font-size: 11px;\n}\n.em-search-clear:hover { background: var(--mj-bg-surface-hover); color: var(--mj-text-primary); }\n\n/* Table head with sortable columns */\n.em-table-head {\n    display: grid;\n    grid-template-columns: 110px 160px 140px 200px 1fr 32px;\n    gap: 12px;\n    padding: 8px 20px;\n    background: var(--mj-bg-surface-card);\n    border-bottom: 1px solid var(--mj-border-subtle);\n    position: sticky;\n    top: 0;\n    z-index: 1;\n    align-items: center;\n}\n.em-th {\n    font-size: 10px;\n    font-weight: 700;\n    color: var(--mj-text-muted);\n    text-transform: uppercase;\n    letter-spacing: 0.5px;\n    background: transparent;\n    border: none;\n    cursor: pointer;\n    font-family: inherit;\n    text-align: left;\n    padding: 4px 0;\n    display: inline-flex;\n    align-items: center;\n    gap: 5px;\n    transition: color 0.12s;\n}\n.em-th:hover { color: var(--mj-text-primary); }\n.em-th--sorted {\n    color: var(--mj-brand-primary);\n}\n.em-th--sorted i { font-size: 9px; }\n.em-th--summary,\n.em-th--actions {\n    cursor: default;\n}\n.em-th--summary:hover,\n.em-th--actions:hover { color: var(--mj-text-muted); }\n\n/* List */\n.em-list {\n    flex: 1;\n    min-height: 0;\n    overflow-y: auto;\n    background: var(--mj-bg-page);\n}\n.em-row {\n    border-bottom: 1px solid var(--mj-border-subtle);\n    background: var(--mj-bg-surface);\n    transition: background 0.1s;\n    animation: em-row-in 0.25s ease-out;\n}\n@keyframes em-row-in {\n    from { opacity: 0; transform: translateY(-3px); }\n    to   { opacity: 1; transform: translateY(0); }\n}\n@media (prefers-reduced-motion: reduce) { .em-row { animation: none; } }\n.em-row:hover { background: var(--mj-bg-surface-hover); }\n.em-row--expanded { background: color-mix(in srgb, var(--mj-brand-primary) 4%, var(--mj-bg-surface)); }\n.em-row--expanded:hover { background: color-mix(in srgb, var(--mj-brand-primary) 6%, var(--mj-bg-surface)); }\n\n.em-row-head {\n    display: grid;\n    grid-template-columns: 12px 96px 160px 140px 200px 1fr 32px;\n    gap: 12px;\n    padding: 8px 20px;\n    cursor: pointer;\n    font-size: 12.5px;\n    align-items: center;\n}\n.em-row-chev {\n    color: var(--mj-text-muted);\n    font-size: 10px;\n    width: 12px;\n    flex-shrink: 0;\n    transition: transform 0.15s;\n    justify-self: start;\n}\n.em-row-chev--down { transform: rotate(90deg); }\n.em-row-time {\n    color: var(--mj-text-muted);\n    font-family: 'SF Mono', Menlo, Consolas, monospace;\n    font-size: 11px;\n    overflow: hidden;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n}\n.em-row-type {\n    font-family: 'SF Mono', Menlo, Consolas, monospace;\n    font-weight: 700;\n    font-size: 11px;\n    padding: 2px 8px;\n    border-radius: 4px;\n    background: color-mix(in srgb, var(--mj-brand-primary) 12%, transparent);\n    color: var(--mj-brand-primary);\n    overflow: hidden;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n    justify-self: start;\n}\n.em-row-type[data-type=\"LoggedIn\"]                       { background: color-mix(in srgb, var(--mj-status-success) 14%, transparent); color: color-mix(in srgb, var(--mj-status-success) 70%, var(--mj-text-primary)); }\n.em-row-type[data-type=\"LoggedOut\"],\n.em-row-type[data-type=\"LoginFailed\"],\n.em-row-type[data-type=\"LogoutFailed\"]                   { background: color-mix(in srgb, var(--mj-status-error) 14%, transparent); color: color-mix(in srgb, var(--mj-status-error) 70%, var(--mj-text-primary)); }\n.em-row-type[data-type=\"DisplaySimpleNotificationRequest\"] { background: color-mix(in srgb, var(--mj-status-warning) 14%, transparent); color: color-mix(in srgb, var(--mj-status-warning) 70%, var(--mj-text-primary)); }\n.em-row-type[data-type=\"ManualResizeRequest\"]            { background: color-mix(in srgb, var(--mj-brand-primary) 12%, transparent); color: color-mix(in srgb, var(--mj-brand-primary) 70%, var(--mj-text-primary)); }\n\n.em-row-code {\n    font-family: 'SF Mono', Menlo, Consolas, monospace;\n    font-size: 11px;\n    color: var(--mj-text-secondary);\n    overflow: hidden;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n}\n.em-row-component {\n    font-size: 11.5px;\n    color: var(--mj-text-secondary);\n    font-family: 'SF Mono', Menlo, Consolas, monospace;\n    overflow: hidden;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n}\n.em-row-summary {\n    font-family: 'SF Mono', Menlo, Consolas, monospace;\n    font-size: 11.5px;\n    color: var(--mj-text-muted);\n    overflow: hidden;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n    min-width: 0;\n}\n.em-row-summary--empty { font-style: italic; opacity: 0.6; }\n\n.em-row-no-payload {\n    margin: 0 20px 12px 50px;\n    background: var(--mj-bg-surface-sunken);\n    border: 1px dashed var(--mj-border-default);\n    border-radius: 8px;\n    padding: 14px 18px;\n    color: var(--mj-text-muted);\n    font-size: 12px;\n    display: flex;\n    align-items: center;\n    gap: 10px;\n}\n.em-row-no-payload i { font-size: 14px; }\n.em-row-copy {\n    background: transparent;\n    border: 1px solid transparent;\n    color: var(--mj-text-muted);\n    cursor: pointer;\n    padding: 4px 8px;\n    border-radius: 5px;\n    font-size: 11px;\n    opacity: 0;\n    transition: all 0.12s;\n}\n.em-row:hover .em-row-copy { opacity: 1; }\n.em-row-copy:hover {\n    background: var(--mj-bg-surface-hover);\n    border-color: var(--mj-border-default);\n    color: var(--mj-text-primary);\n}\n\n.em-row-payload {\n    margin: 0 20px 12px 50px;\n    background: var(--mj-bg-surface-sunken);\n    border: 1px solid var(--mj-border-subtle);\n    border-radius: 8px;\n    padding: 12px 14px;\n    font-family: 'SF Mono', Menlo, Consolas, monospace;\n    font-size: 11.5px;\n    color: var(--mj-text-primary);\n    overflow: auto;\n    max-height: 280px;\n}\n.em-row-payload code { white-space: pre-wrap; word-break: break-word; }\n\n@media (max-width: 800px) {\n    .em-stats { flex-wrap: wrap; }\n    .em-stat--right { margin-left: 0; }\n    .em-row-component { display: none; }\n    .em-row-time { min-width: 70px; }\n    .em-row-payload { margin-left: 20px; }\n}\n"] }]
    }], () => [{ type: i0.ChangeDetectorRef }], null); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(EventMonitorComponent, { className: "EventMonitorComponent", filePath: "src/DevTools/event-monitor.component.ts", lineNumber: 46 }); })();
//# sourceMappingURL=event-monitor.component.js.map