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;
};
/**
 * @fileoverview Knowledge Hub Search Dashboard (Task 2)
 *
 * Google-style clean search experience with centered search bar,
 * grouped results, faceted sidebar filters, and "Ask Knowledge Agent" CTA.
 * Registered as BaseResourceComponent for the Knowledge Hub app.
 */
import { Component, ChangeDetectorRef, inject, Injector } from '@angular/core';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { CompositeKey, Metadata } from '@memberjunction/core';
import { RegisterClass } from '@memberjunction/global';
import { BaseResourceComponent, NavigationService } from '@memberjunction/ng-shared';
import { SearchService } from '@memberjunction/ng-search';
import { ConversationBridgeService } from '@memberjunction/ng-conversations';
import * as i0 from "@angular/core";
import * as i1 from "@angular/forms";
import * as i2 from "@memberjunction/ng-search";
import * as i3 from "../results-detail/search-result-detail.component";
import * as i4 from "@angular/common";
const _forTrack0 = ($index, $item) => $item.Query;
function KnowledgeSearchResourceComponent_Conditional_0_Conditional_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 14);
    i0.ɵɵelement(1, "i", 15);
    i0.ɵɵtext(2, " Knowledge Hub ");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(3, "p", 16);
    i0.ɵɵtext(4, "Search across all your knowledge -- entities, documents, content, and more");
    i0.ɵɵelementEnd();
} }
function KnowledgeSearchResourceComponent_Conditional_0_Conditional_7_Template(rf, ctx) { if (rf & 1) {
    const _r3 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "button", 17);
    i0.ɵɵlistener("click", function KnowledgeSearchResourceComponent_Conditional_0_Conditional_7_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.ClearSearch()); });
    i0.ɵɵelement(1, "i", 18);
    i0.ɵɵelementEnd();
} }
function KnowledgeSearchResourceComponent_Conditional_0_Conditional_9_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "i", 10);
} }
function KnowledgeSearchResourceComponent_Conditional_0_Conditional_10_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵtext(0, " Search ");
} }
function KnowledgeSearchResourceComponent_Conditional_0_Conditional_11_Template(rf, ctx) { if (rf & 1) {
    const _r4 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 11)(1, "button", 19);
    i0.ɵɵlistener("click", function KnowledgeSearchResourceComponent_Conditional_0_Conditional_11_Template_button_click_1_listener() { i0.ɵɵrestoreView(_r4); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.OnAskAgent()); });
    i0.ɵɵelement(2, "i", 20);
    i0.ɵɵtext(3, " Ask Knowledge Agent ");
    i0.ɵɵelementEnd()();
} }
function KnowledgeSearchResourceComponent_Conditional_0_Conditional_12_Conditional_1_Template(rf, ctx) { if (rf & 1) {
    const _r6 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "aside", 21)(1, "mj-search-filter", 30);
    i0.ɵɵlistener("FilterChanged", function KnowledgeSearchResourceComponent_Conditional_0_Conditional_12_Conditional_1_Template_mj_search_filter_FilterChanged_1_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.OnFilterChanged($event)); })("FiltersCleared", function KnowledgeSearchResourceComponent_Conditional_0_Conditional_12_Conditional_1_Template_mj_search_filter_FiltersCleared_1_listener() { i0.ɵɵrestoreView(_r6); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.OnFiltersCleared()); });
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(2, "div", 31)(3, "label", 32);
    i0.ɵɵtext(4, " Min Relevance ");
    i0.ɵɵelementStart(5, "span", 33);
    i0.ɵɵtext(6);
    i0.ɵɵpipe(7, "number");
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(8, "input", 34);
    i0.ɵɵlistener("input", function KnowledgeSearchResourceComponent_Conditional_0_Conditional_12_Conditional_1_Template_input_input_8_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.OnThresholdChanged($event.target.value / 100)); });
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(9, "div", 35)(10, "span");
    i0.ɵɵtext(11, "All");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(12, "span");
    i0.ɵɵtext(13, "Strict");
    i0.ɵɵelementEnd()()()();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext(3);
    i0.ɵɵadvance();
    i0.ɵɵproperty("Filters", ctx_r1.Filters)("ActiveFilters", ctx_r1.ActiveFilters);
    i0.ɵɵadvance(5);
    i0.ɵɵtextInterpolate1("", i0.ɵɵpipeBind2(7, 7, ctx_r1.MinScoreThreshold * 100, "1.0-0"), "%");
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("min", 0)("max", 100)("step", 5)("value", ctx_r1.MinScoreThreshold * 100);
} }
function KnowledgeSearchResourceComponent_Conditional_0_Conditional_12_Conditional_6_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 25);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext(3);
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate1("in ", ctx_r1.ElapsedMs, "ms");
} }
function KnowledgeSearchResourceComponent_Conditional_0_Conditional_12_Conditional_8_Conditional_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵtext(0, " Filters Active ");
} }
function KnowledgeSearchResourceComponent_Conditional_0_Conditional_12_Conditional_8_Conditional_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵtext(0, " Filters ");
} }
function KnowledgeSearchResourceComponent_Conditional_0_Conditional_12_Conditional_8_Template(rf, ctx) { if (rf & 1) {
    const _r7 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "button", 36);
    i0.ɵɵlistener("click", function KnowledgeSearchResourceComponent_Conditional_0_Conditional_12_Conditional_8_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r7); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.ToggleFilters()); });
    i0.ɵɵelement(1, "i", 37);
    i0.ɵɵconditionalCreate(2, KnowledgeSearchResourceComponent_Conditional_0_Conditional_12_Conditional_8_Conditional_2_Template, 1, 0)(3, KnowledgeSearchResourceComponent_Conditional_0_Conditional_12_Conditional_8_Conditional_3_Template, 1, 0);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext(3);
    i0.ɵɵadvance(2);
    i0.ɵɵconditional(ctx_r1.HasActiveFilters() ? 2 : 3);
} }
function KnowledgeSearchResourceComponent_Conditional_0_Conditional_12_Conditional_10_Template(rf, ctx) { if (rf & 1) {
    const _r8 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 29);
    i0.ɵɵelement(1, "i", 38);
    i0.ɵɵelementStart(2, "div", 39)(3, "strong");
    i0.ɵɵtext(4, "Can't find what you're looking for?");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(5, "p");
    i0.ɵɵtext(6, "Ask the Knowledge Agent for a deeper analysis");
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(7, "button", 40);
    i0.ɵɵlistener("click", function KnowledgeSearchResourceComponent_Conditional_0_Conditional_12_Conditional_10_Template_button_click_7_listener() { i0.ɵɵrestoreView(_r8); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.OnAskAgent()); });
    i0.ɵɵtext(8, " Ask Agent ");
    i0.ɵɵelementEnd()();
} }
function KnowledgeSearchResourceComponent_Conditional_0_Conditional_12_Template(rf, ctx) { if (rf & 1) {
    const _r5 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 12);
    i0.ɵɵconditionalCreate(1, KnowledgeSearchResourceComponent_Conditional_0_Conditional_12_Conditional_1_Template, 14, 10, "aside", 21);
    i0.ɵɵelementStart(2, "div", 22)(3, "div", 23)(4, "span", 24);
    i0.ɵɵtext(5);
    i0.ɵɵconditionalCreate(6, KnowledgeSearchResourceComponent_Conditional_0_Conditional_12_Conditional_6_Template, 2, 1, "span", 25);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(7, "div", 26);
    i0.ɵɵconditionalCreate(8, KnowledgeSearchResourceComponent_Conditional_0_Conditional_12_Conditional_8_Template, 4, 1, "button", 27);
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(9, "mj-search-results", 28);
    i0.ɵɵlistener("ResultSelected", function KnowledgeSearchResourceComponent_Conditional_0_Conditional_12_Template_mj_search_results_ResultSelected_9_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.OnResultSelected($event)); })("OpenRecordRequested", function KnowledgeSearchResourceComponent_Conditional_0_Conditional_12_Template_mj_search_results_OpenRecordRequested_9_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.OnOpenRecord($event)); });
    i0.ɵɵelementEnd();
    i0.ɵɵconditionalCreate(10, KnowledgeSearchResourceComponent_Conditional_0_Conditional_12_Conditional_10_Template, 9, 0, "div", 29);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r1.ShowFilters && ctx_r1.Filters.length > 0 ? 1 : -1);
    i0.ɵɵadvance(4);
    i0.ɵɵtextInterpolate1(" ", ctx_r1.TotalCount, " results ");
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r1.ElapsedMs > 0 ? 6 : -1);
    i0.ɵɵadvance(2);
    i0.ɵɵconditional(ctx_r1.Filters.length > 0 ? 8 : -1);
    i0.ɵɵadvance();
    i0.ɵɵproperty("ResultGroups", ctx_r1.ResultGroups)("IsLoading", ctx_r1.IsSearching)("TotalCount", ctx_r1.TotalCount)("ElapsedMs", ctx_r1.ElapsedMs);
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r1.TotalCount === 0 && !ctx_r1.IsSearching ? 10 : -1);
} }
function KnowledgeSearchResourceComponent_Conditional_0_Conditional_13_Conditional_1_For_4_Conditional_0_Template(rf, ctx) { if (rf & 1) {
    const _r9 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 44);
    i0.ɵɵlistener("click", function KnowledgeSearchResourceComponent_Conditional_0_Conditional_13_Conditional_1_For_4_Conditional_0_Template_div_click_0_listener() { i0.ɵɵrestoreView(_r9); const recent_r10 = i0.ɵɵnextContext().$implicit; const ctx_r1 = i0.ɵɵnextContext(4); return i0.ɵɵresetView(ctx_r1.ApplyRecentSearch(recent_r10)); });
    i0.ɵɵelement(1, "i", 45);
    i0.ɵɵelementStart(2, "span", 46);
    i0.ɵɵtext(3);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(4, "span", 47);
    i0.ɵɵtext(5);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const recent_r10 = i0.ɵɵnextContext().$implicit;
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate(recent_r10.Query);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate1("", recent_r10.ResultCount, " results");
} }
function KnowledgeSearchResourceComponent_Conditional_0_Conditional_13_Conditional_1_For_4_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵconditionalCreate(0, KnowledgeSearchResourceComponent_Conditional_0_Conditional_13_Conditional_1_For_4_Conditional_0_Template, 6, 2, "div", 43);
} if (rf & 2) {
    const ɵ$index_119_r11 = ctx.$index;
    i0.ɵɵconditional(ɵ$index_119_r11 < 8 ? 0 : -1);
} }
function KnowledgeSearchResourceComponent_Conditional_0_Conditional_13_Conditional_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "h3", 41);
    i0.ɵɵtext(1, "Recent Searches");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(2, "div", 42);
    i0.ɵɵrepeaterCreate(3, KnowledgeSearchResourceComponent_Conditional_0_Conditional_13_Conditional_1_For_4_Template, 1, 1, null, null, _forTrack0);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext(3);
    i0.ɵɵadvance(3);
    i0.ɵɵrepeater(ctx_r1.RecentSearches);
} }
function KnowledgeSearchResourceComponent_Conditional_0_Conditional_13_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 13);
    i0.ɵɵconditionalCreate(1, KnowledgeSearchResourceComponent_Conditional_0_Conditional_13_Conditional_1_Template, 5, 0);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r1.RecentSearches.length > 0 ? 1 : -1);
} }
function KnowledgeSearchResourceComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
    const _r1 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 2)(1, "div", 3);
    i0.ɵɵconditionalCreate(2, KnowledgeSearchResourceComponent_Conditional_0_Conditional_2_Template, 5, 0);
    i0.ɵɵelementStart(3, "div", 4)(4, "div", 5);
    i0.ɵɵelement(5, "i", 6);
    i0.ɵɵelementStart(6, "input", 7);
    i0.ɵɵtwoWayListener("ngModelChange", function KnowledgeSearchResourceComponent_Conditional_0_Template_input_ngModelChange_6_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); i0.ɵɵtwoWayBindingSet(ctx_r1.Query, $event) || (ctx_r1.Query = $event); return i0.ɵɵresetView($event); });
    i0.ɵɵlistener("keydown", function KnowledgeSearchResourceComponent_Conditional_0_Template_input_keydown_6_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.OnSearchKeydown($event)); });
    i0.ɵɵelementEnd();
    i0.ɵɵconditionalCreate(7, KnowledgeSearchResourceComponent_Conditional_0_Conditional_7_Template, 2, 0, "button", 8);
    i0.ɵɵelementStart(8, "button", 9);
    i0.ɵɵlistener("click", function KnowledgeSearchResourceComponent_Conditional_0_Template_button_click_8_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.RunSearch()); });
    i0.ɵɵconditionalCreate(9, KnowledgeSearchResourceComponent_Conditional_0_Conditional_9_Template, 1, 0, "i", 10)(10, KnowledgeSearchResourceComponent_Conditional_0_Conditional_10_Template, 1, 0);
    i0.ɵɵelementEnd()();
    i0.ɵɵconditionalCreate(11, KnowledgeSearchResourceComponent_Conditional_0_Conditional_11_Template, 4, 0, "div", 11);
    i0.ɵɵelementEnd()();
    i0.ɵɵconditionalCreate(12, KnowledgeSearchResourceComponent_Conditional_0_Conditional_12_Template, 11, 9, "div", 12)(13, KnowledgeSearchResourceComponent_Conditional_0_Conditional_13_Template, 2, 1, "div", 13);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵclassProp("search-page-has-results", ctx_r1.HasSearched);
    i0.ɵɵadvance();
    i0.ɵɵclassProp("search-hero-compact", ctx_r1.HasSearched);
    i0.ɵɵadvance();
    i0.ɵɵconditional(!ctx_r1.HasSearched ? 2 : -1);
    i0.ɵɵadvance(4);
    i0.ɵɵtwoWayProperty("ngModel", ctx_r1.Query);
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r1.Query.length > 0 ? 7 : -1);
    i0.ɵɵadvance();
    i0.ɵɵproperty("disabled", ctx_r1.IsSearching || !ctx_r1.Query.trim());
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r1.IsSearching ? 9 : 10);
    i0.ɵɵadvance(2);
    i0.ɵɵconditional(!ctx_r1.HasSearched ? 11 : -1);
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r1.HasSearched ? 12 : !ctx_r1.IsSearching ? 13 : -1);
} }
function KnowledgeSearchResourceComponent_Conditional_1_Template(rf, ctx) { if (rf & 1) {
    const _r12 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "app-search-result-detail", 48);
    i0.ɵɵlistener("BackClicked", function KnowledgeSearchResourceComponent_Conditional_1_Template_app_search_result_detail_BackClicked_0_listener() { i0.ɵɵrestoreView(_r12); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.CloseResultDetail()); })("NavigateToRecord", function KnowledgeSearchResourceComponent_Conditional_1_Template_app_search_result_detail_NavigateToRecord_0_listener($event) { i0.ɵɵrestoreView(_r12); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.OnOpenRecord($event)); });
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵproperty("Result", ctx_r1.DetailResult);
} }
let KnowledgeSearchResourceComponent = class KnowledgeSearchResourceComponent extends BaseResourceComponent {
    cdr = inject(ChangeDetectorRef);
    searchService = inject(SearchService);
    injector = inject(Injector);
    navigationService = inject(NavigationService);
    destroy$ = new Subject();
    // --- State ---
    Query = '';
    IsSearching = false;
    HasSearched = false;
    ShowFilters = false;
    ShowResultDetail = false;
    DetailResult = null;
    // --- Results ---
    AllResults = [];
    ResultGroups = [];
    Filters = [];
    ActiveFilters = {};
    TotalCount = 0;
    ElapsedMs = 0;
    /** Minimum relevance score threshold (0-1). Results below this are hidden. */
    MinScoreThreshold = 0.35;
    // --- Recent & Saved ---
    RecentSearches = [];
    SavedSearches = [];
    async GetResourceDisplayName(_data) {
        return 'Knowledge Search';
    }
    async GetResourceIconClass(_data) {
        return 'fa-solid fa-magnifying-glass';
    }
    ngAfterViewInit() {
        this.subscribeToSearchState();
        this.parseUrlParameters();
    }
    ngOnDestroy() {
        this.destroy$.next();
        this.destroy$.complete();
    }
    /** Execute a search query */
    async RunSearch() {
        const query = this.Query.trim();
        if (!query)
            return;
        const request = {
            Query: query,
            MaxResults: 50,
            ActiveFilters: this.ActiveFilters,
            IncludeSources: ['vector', 'fulltext', 'entity'],
            MinScore: this.MinScoreThreshold,
        };
        const response = await this.searchService.ExecuteSearch(request);
        this.applySearchResponse(response);
    }
    /** Handle pressing Enter in the search box */
    OnSearchKeydown(event) {
        if (event.key === 'Enter') {
            event.preventDefault();
            this.RunSearch();
        }
    }
    /** Handle selecting a result */
    OnResultSelected(event) {
        this.DetailResult = event.Result;
        this.ShowResultDetail = true;
        this.cdr.detectChanges();
    }
    /** Handle "Open Record" — navigate to the entity record via NavigationService */
    OnOpenRecord(event) {
        const md = new Metadata();
        const entityInfo = md.Entities.find(e => e.Name === event.EntityName);
        const pkey = new CompositeKey();
        if (entityInfo) {
            pkey.LoadFromURLSegment(entityInfo, event.RecordID);
        }
        else {
            // Fallback: treat as simple single-field PK
            pkey.KeyValuePairs = [{ FieldName: 'ID', Value: event.RecordID }];
        }
        this.navigationService.OpenEntityRecord(event.EntityName, pkey);
    }
    /** Close the result detail view */
    CloseResultDetail() {
        this.ShowResultDetail = false;
        this.DetailResult = null;
        this.cdr.detectChanges();
    }
    /** Toggle the filter sidebar */
    ToggleFilters() {
        this.ShowFilters = !this.ShowFilters;
        this.cdr.detectChanges();
    }
    /** Handle a filter change from the filter component */
    OnFilterChanged(event) {
        this.ActiveFilters[event.Category] = event.SelectedValues;
        this.RunSearch();
    }
    /** Handle clearing all filters */
    OnFiltersCleared() {
        this.ActiveFilters = {};
        this.MinScoreThreshold = 0.35;
        this.RunSearch();
    }
    /** Handle relevance threshold slider change */
    OnThresholdChanged(value) {
        this.MinScoreThreshold = value;
        this.RunSearch();
    }
    /** Open the chat overlay with Knowledge Agent context */
    OnAskAgent() {
        try {
            const bridge = this.injector.get(ConversationBridgeService, null);
            if (bridge) {
                bridge.SwitchToOverlay(null);
            }
            else {
                console.warn('[KnowledgeSearch] ConversationBridgeService not available');
            }
        }
        catch {
            console.warn('[KnowledgeSearch] ConversationBridgeService not available');
        }
    }
    /** Apply a recent search */
    ApplyRecentSearch(recent) {
        this.Query = recent.Query;
        this.RunSearch();
    }
    /** Clear the current search */
    ClearSearch() {
        this.Query = '';
        this.AllResults = [];
        this.ResultGroups = [];
        this.Filters = [];
        this.ActiveFilters = {};
        this.TotalCount = 0;
        this.HasSearched = false;
        this.ShowFilters = false;
        this.cdr.detectChanges();
    }
    /** Check if any filters are active */
    HasActiveFilters() {
        return Object.values(this.ActiveFilters).some(v => v.length > 0);
    }
    // --- Private Methods ---
    /** Parse URL parameters for deep links (e.g., ?conversationId=xxx or ?q=search+term) */
    parseUrlParameters() {
        try {
            const urlParams = new URLSearchParams(window.location.search);
            const conversationId = urlParams.get('conversationId');
            if (conversationId) {
                // Deep link to conversation - open the agent chat
                this.OnAskAgent();
            }
            const searchQuery = urlParams.get('q');
            if (searchQuery) {
                this.Query = searchQuery;
                this.RunSearch();
            }
        }
        catch {
            // Ignore URL parsing errors
        }
    }
    subscribeToSearchState() {
        this.searchService.IsSearching$
            .pipe(takeUntil(this.destroy$))
            .subscribe((val) => {
            this.IsSearching = val;
            this.cdr.detectChanges();
        });
        this.searchService.RecentSearches$
            .pipe(takeUntil(this.destroy$))
            .subscribe((val) => {
            this.RecentSearches = val;
            this.cdr.detectChanges();
        });
    }
    applySearchResponse(response) {
        this.AllResults = response.Results;
        this.ResultGroups = response.Groups;
        this.Filters = response.Filters;
        this.TotalCount = response.TotalCount;
        this.ElapsedMs = response.ElapsedMs;
        this.HasSearched = true;
        this.ShowFilters = response.Filters.length > 0;
        this.cdr.detectChanges();
    }
    static ɵfac = /*@__PURE__*/ (() => { let ɵKnowledgeSearchResourceComponent_BaseFactory; return function KnowledgeSearchResourceComponent_Factory(__ngFactoryType__) { return (ɵKnowledgeSearchResourceComponent_BaseFactory || (ɵKnowledgeSearchResourceComponent_BaseFactory = i0.ɵɵgetInheritedFactory(KnowledgeSearchResourceComponent)))(__ngFactoryType__ || KnowledgeSearchResourceComponent); }; })();
    static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KnowledgeSearchResourceComponent, selectors: [["app-knowledge-search-resource"]], standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 2, vars: 1, consts: [[1, "search-page", 3, "search-page-has-results"], [3, "Result"], [1, "search-page"], [1, "search-hero"], [1, "search-container"], [1, "search-box"], [1, "fa-solid", "fa-magnifying-glass", "search-box-icon"], ["type", "text", "placeholder", "Search across all your knowledge...", "autocomplete", "off", "spellcheck", "false", 1, "search-box-input", 3, "ngModelChange", "keydown", "ngModel"], [1, "search-clear-btn"], [1, "search-submit-btn", 3, "click", "disabled"], [1, "fa-solid", "fa-spinner", "fa-spin"], [1, "search-quick-actions"], [1, "search-results-layout"], [1, "search-recent-area"], [1, "search-logo"], [1, "fa-solid", "fa-brain"], [1, "search-subtitle"], [1, "search-clear-btn", 3, "click"], [1, "fa-solid", "fa-times"], [1, "quick-action-btn", 3, "click"], [1, "fa-solid", "fa-robot"], [1, "search-sidebar"], [1, "search-results-main"], [1, "search-results-header"], [1, "search-results-count"], [1, "search-results-time"], [1, "search-results-actions"], [1, "toggle-filters-btn"], [3, "ResultSelected", "OpenRecordRequested", "ResultGroups", "IsLoading", "TotalCount", "ElapsedMs"], [1, "search-agent-cta"], [3, "FilterChanged", "FiltersCleared", "Filters", "ActiveFilters"], [1, "threshold-section"], [1, "threshold-label"], [1, "threshold-value"], ["type", "range", 1, "threshold-slider", 3, "input", "min", "max", "step", "value"], [1, "threshold-range-labels"], [1, "toggle-filters-btn", 3, "click"], [1, "fa-solid", "fa-filter"], [1, "fa-solid", "fa-robot", "cta-icon"], [1, "cta-text"], [1, "cta-btn", 3, "click"], [1, "recent-title"], [1, "recent-list"], [1, "recent-item"], [1, "recent-item", 3, "click"], [1, "fa-solid", "fa-clock", "recent-icon"], [1, "recent-query"], [1, "recent-count"], [3, "BackClicked", "NavigateToRecord", "Result"]], template: function KnowledgeSearchResourceComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵconditionalCreate(0, KnowledgeSearchResourceComponent_Conditional_0_Template, 14, 11, "div", 0)(1, KnowledgeSearchResourceComponent_Conditional_1_Template, 1, 1, "app-search-result-detail", 1);
        } if (rf & 2) {
            i0.ɵɵconditional(!ctx.ShowResultDetail ? 0 : 1);
        } }, dependencies: [i1.DefaultValueAccessor, i1.NgControlStatus, i1.NgModel, i2.SearchResultsComponent, i2.SearchFilterComponent, i3.SearchResultDetailComponent, i4.DecimalPipe], styles: ["\n\n\n.search-page[_ngcontent-%COMP%] {\n    min-height: 100%;\n    display: flex;\n    flex-direction: column;\n}\n\n\n\n.search-hero[_ngcontent-%COMP%] {\n    display: flex;\n    flex-direction: column;\n    align-items: center;\n    justify-content: center;\n    padding: 6rem 2rem 2rem;\n    transition: padding 0.4s ease;\n}\n\n.search-hero-compact[_ngcontent-%COMP%] {\n    padding: 1.5rem 2rem 1rem;\n}\n\n.search-logo[_ngcontent-%COMP%] {\n    font-size: 2.2rem;\n    font-weight: 700;\n    color: var(--mj-brand-primary);\n    display: flex;\n    align-items: center;\n    gap: 0.75rem;\n    margin-bottom: 0.5rem;\n    transition: font-size 0.4s ease;\n}\n\n.search-hero-compact[_ngcontent-%COMP%]   .search-logo[_ngcontent-%COMP%] {\n    font-size: 0;\n    height: 0;\n    margin: 0;\n    overflow: hidden;\n}\n\n.search-subtitle[_ngcontent-%COMP%] {\n    color: var(--mj-text-secondary);\n    font-size: 1rem;\n    margin-bottom: 2rem;\n    text-align: center;\n    transition: all 0.4s ease;\n}\n\n.search-hero-compact[_ngcontent-%COMP%]   .search-subtitle[_ngcontent-%COMP%] {\n    font-size: 0;\n    height: 0;\n    margin: 0;\n    overflow: hidden;\n    opacity: 0;\n}\n\n\n\n.search-container[_ngcontent-%COMP%] {\n    width: 100%;\n    max-width: 720px;\n}\n\n.search-box[_ngcontent-%COMP%] {\n    width: 100%;\n    display: flex;\n    align-items: center;\n    background: var(--mj-bg-surface);\n    border: 1.5px solid var(--mj-border-default);\n    border-radius: 12px;\n    padding: 0 0.25rem 0 1rem;\n    gap: 0.5rem;\n    transition: border-color 0.2s ease, box-shadow 0.2s ease;\n}\n\n.search-box[_ngcontent-%COMP%]:focus-within {\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\n.search-box-icon[_ngcontent-%COMP%] {\n    color: var(--mj-text-muted);\n    font-size: 1rem;\n}\n\n.search-box-input[_ngcontent-%COMP%] {\n    flex: 1;\n    border: none;\n    background: transparent;\n    padding: 0.85rem 0;\n    font-size: 1rem;\n    color: var(--mj-text-primary);\n    outline: none;\n    font-family: inherit;\n}\n\n.search-box-input[_ngcontent-%COMP%]::placeholder {\n    color: var(--mj-text-muted);\n}\n\n.search-clear-btn[_ngcontent-%COMP%] {\n    border: none;\n    background: transparent;\n    color: var(--mj-text-muted);\n    cursor: pointer;\n    padding: 0.5rem;\n    border-radius: 6px;\n    font-size: 0.85rem;\n}\n\n.search-clear-btn[_ngcontent-%COMP%]:hover {\n    color: var(--mj-text-primary);\n    background: var(--mj-bg-surface-hover);\n}\n\n.search-submit-btn[_ngcontent-%COMP%] {\n    padding: 0.55rem 1.25rem;\n    border-radius: 8px;\n    border: none;\n    background: var(--mj-brand-primary);\n    color: var(--mj-text-inverse);\n    font-size: 0.9rem;\n    font-weight: 500;\n    cursor: pointer;\n    transition: background 0.15s ease;\n    white-space: nowrap;\n}\n\n.search-submit-btn[_ngcontent-%COMP%]:hover:not(:disabled) {\n    background: var(--mj-brand-primary-hover);\n}\n\n.search-submit-btn[_ngcontent-%COMP%]:disabled {\n    opacity: 0.5;\n    cursor: not-allowed;\n}\n\n\n\n.search-quick-actions[_ngcontent-%COMP%] {\n    display: flex;\n    justify-content: center;\n    gap: 0.75rem;\n    margin-top: 1rem;\n}\n\n.quick-action-btn[_ngcontent-%COMP%] {\n    display: inline-flex;\n    align-items: center;\n    gap: 0.4rem;\n    padding: 0.45rem 1rem;\n    border-radius: 9999px;\n    border: 1px solid var(--mj-border-default);\n    background: var(--mj-bg-surface);\n    color: var(--mj-text-secondary);\n    font-size: 0.85rem;\n    cursor: pointer;\n    transition: all 0.15s ease;\n}\n\n.quick-action-btn[_ngcontent-%COMP%]:hover {\n    border-color: var(--mj-brand-primary);\n    color: var(--mj-brand-primary);\n    background: color-mix(in srgb, var(--mj-brand-primary) 5%, var(--mj-bg-surface));\n}\n\n\n\n.search-results-layout[_ngcontent-%COMP%] {\n    display: flex;\n    flex: 1;\n    gap: 1.5rem;\n    padding: 0 2rem 2rem;\n    max-width: 1200px;\n    margin: 0 auto;\n    width: 100%;\n}\n\n.search-sidebar[_ngcontent-%COMP%] {\n    width: 260px;\n    flex-shrink: 0;\n}\n\n.search-results-main[_ngcontent-%COMP%] {\n    flex: 1;\n    min-width: 0;\n    overflow-y: auto;\n    max-height: calc(100vh - 220px);\n}\n\n\n\n.search-results-header[_ngcontent-%COMP%] {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    margin-bottom: 0.75rem;\n}\n\n.search-results-count[_ngcontent-%COMP%] {\n    font-size: 0.85rem;\n    color: var(--mj-text-secondary);\n}\n\n.search-results-time[_ngcontent-%COMP%] {\n    color: var(--mj-text-muted);\n}\n\n.toggle-filters-btn[_ngcontent-%COMP%] {\n    display: inline-flex;\n    align-items: center;\n    gap: 0.4rem;\n    padding: 0.35rem 0.75rem;\n    border: 1px solid var(--mj-border-default);\n    border-radius: 6px;\n    background: var(--mj-bg-surface);\n    color: var(--mj-text-secondary);\n    font-size: 0.82rem;\n    cursor: pointer;\n}\n\n.toggle-filters-btn[_ngcontent-%COMP%]:hover {\n    background: var(--mj-bg-surface-hover);\n}\n\n\n\n.search-agent-cta[_ngcontent-%COMP%] {\n    display: flex;\n    align-items: center;\n    gap: 1rem;\n    padding: 1.25rem;\n    margin-top: 1.5rem;\n    border: 1px solid var(--mj-border-default);\n    border-radius: 10px;\n    background: color-mix(in srgb, var(--mj-brand-primary) 5%, var(--mj-bg-surface));\n}\n\n.cta-icon[_ngcontent-%COMP%] {\n    font-size: 1.5rem;\n    color: var(--mj-brand-primary);\n    flex-shrink: 0;\n}\n\n.cta-text[_ngcontent-%COMP%] {\n    flex: 1;\n}\n\n.cta-text[_ngcontent-%COMP%]   strong[_ngcontent-%COMP%] {\n    color: var(--mj-text-primary);\n    font-size: 0.9rem;\n}\n\n.cta-text[_ngcontent-%COMP%]   p[_ngcontent-%COMP%] {\n    color: var(--mj-text-muted);\n    font-size: 0.82rem;\n    margin: 0.2rem 0 0;\n}\n\n.cta-btn[_ngcontent-%COMP%] {\n    padding: 0.5rem 1rem;\n    border-radius: 8px;\n    border: none;\n    background: var(--mj-brand-primary);\n    color: var(--mj-text-inverse);\n    font-size: 0.85rem;\n    font-weight: 500;\n    cursor: pointer;\n    white-space: nowrap;\n}\n\n.cta-btn[_ngcontent-%COMP%]:hover {\n    background: var(--mj-brand-primary-hover);\n}\n\n\n\n.search-recent-area[_ngcontent-%COMP%] {\n    max-width: 600px;\n    margin: 0 auto;\n    padding: 1rem 2rem;\n}\n\n.recent-title[_ngcontent-%COMP%] {\n    font-size: 0.82rem;\n    color: var(--mj-text-muted);\n    text-transform: uppercase;\n    letter-spacing: 0.05em;\n    font-weight: 600;\n    margin-bottom: 0.75rem;\n}\n\n.recent-list[_ngcontent-%COMP%] {\n    display: flex;\n    flex-direction: column;\n    gap: 0.25rem;\n}\n\n.recent-item[_ngcontent-%COMP%] {\n    display: flex;\n    align-items: center;\n    gap: 0.75rem;\n    padding: 0.6rem 0.75rem;\n    border-radius: 8px;\n    cursor: pointer;\n    transition: background 0.1s ease;\n}\n\n.recent-item[_ngcontent-%COMP%]:hover {\n    background: var(--mj-bg-surface-hover);\n}\n\n.recent-icon[_ngcontent-%COMP%] {\n    color: var(--mj-text-muted);\n    font-size: 0.82rem;\n}\n\n.recent-query[_ngcontent-%COMP%] {\n    flex: 1;\n    color: var(--mj-text-primary);\n    font-size: 0.9rem;\n}\n\n.recent-count[_ngcontent-%COMP%] {\n    color: var(--mj-text-muted);\n    font-size: 0.78rem;\n}\n\n\n\n.threshold-section[_ngcontent-%COMP%] {\n    margin-top: 1.25rem;\n    padding-top: 1rem;\n    border-top: 1px solid var(--mj-border-subtle);\n}\n\n.threshold-label[_ngcontent-%COMP%] {\n    display: flex;\n    justify-content: space-between;\n    align-items: center;\n    font-size: 0.82rem;\n    font-weight: 600;\n    color: var(--mj-text-secondary);\n    text-transform: uppercase;\n    letter-spacing: 0.05em;\n    margin-bottom: 0.5rem;\n}\n\n.threshold-value[_ngcontent-%COMP%] {\n    font-weight: 700;\n    color: var(--mj-brand-primary);\n    font-size: 0.85rem;\n}\n\n.threshold-slider[_ngcontent-%COMP%] {\n    width: 100%;\n    height: 4px;\n    appearance: none;\n    -webkit-appearance: none;\n    background: var(--mj-border-default);\n    border-radius: 2px;\n    outline: none;\n    cursor: pointer;\n}\n\n.threshold-slider[_ngcontent-%COMP%]::-webkit-slider-thumb {\n    -webkit-appearance: none;\n    width: 16px;\n    height: 16px;\n    border-radius: 50%;\n    background: var(--mj-brand-primary);\n    border: 2px solid var(--mj-bg-surface);\n    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);\n    cursor: pointer;\n}\n\n.threshold-slider[_ngcontent-%COMP%]::-moz-range-thumb {\n    width: 16px;\n    height: 16px;\n    border-radius: 50%;\n    background: var(--mj-brand-primary);\n    border: 2px solid var(--mj-bg-surface);\n    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);\n    cursor: pointer;\n}\n\n.threshold-range-labels[_ngcontent-%COMP%] {\n    display: flex;\n    justify-content: space-between;\n    font-size: 0.72rem;\n    color: var(--mj-text-muted);\n    margin-top: 0.25rem;\n}\n\n\n\n@media (max-width: 768px) {\n    .search-results-layout[_ngcontent-%COMP%] {\n        flex-direction: column;\n        padding: 0 1rem 1rem;\n    }\n\n    .search-sidebar[_ngcontent-%COMP%] {\n        width: 100%;\n    }\n\n    .search-hero[_ngcontent-%COMP%] {\n        padding: 3rem 1rem 1rem;\n    }\n}"] });
};
KnowledgeSearchResourceComponent = __decorate([
    RegisterClass(BaseResourceComponent, 'KnowledgeSearchResource')
], KnowledgeSearchResourceComponent);
export { KnowledgeSearchResourceComponent };
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(KnowledgeSearchResourceComponent, [{
        type: Component,
        args: [{ standalone: false, selector: 'app-knowledge-search-resource', template: "@if (!ShowResultDetail) {\n    <div class=\"search-page\" [class.search-page-has-results]=\"HasSearched\">\n        <!-- Search Hero Section -->\n        <div class=\"search-hero\" [class.search-hero-compact]=\"HasSearched\">\n            @if (!HasSearched) {\n                <div class=\"search-logo\">\n                    <i class=\"fa-solid fa-brain\"></i>\n                    Knowledge Hub\n                </div>\n                <p class=\"search-subtitle\">Search across all your knowledge -- entities, documents, content, and more</p>\n            }\n\n            <!-- Search Bar -->\n            <div class=\"search-container\">\n                <div class=\"search-box\">\n                    <i class=\"fa-solid fa-magnifying-glass search-box-icon\"></i>\n                    <input\n                        type=\"text\"\n                        class=\"search-box-input\"\n                        placeholder=\"Search across all your knowledge...\"\n                        [(ngModel)]=\"Query\"\n                        (keydown)=\"OnSearchKeydown($event)\"\n                        autocomplete=\"off\"\n                        spellcheck=\"false\"\n                    />\n                    @if (Query.length > 0) {\n                        <button class=\"search-clear-btn\" (click)=\"ClearSearch()\">\n                            <i class=\"fa-solid fa-times\"></i>\n                        </button>\n                    }\n                    <button class=\"search-submit-btn\" (click)=\"RunSearch()\" [disabled]=\"IsSearching || !Query.trim()\">\n                        @if (IsSearching) {\n                            <i class=\"fa-solid fa-spinner fa-spin\"></i>\n                        } @else {\n                            Search\n                        }\n                    </button>\n                </div>\n\n                <!-- Quick filters row -->\n                @if (!HasSearched) {\n                    <div class=\"search-quick-actions\">\n                        <button class=\"quick-action-btn\" (click)=\"OnAskAgent()\">\n                            <i class=\"fa-solid fa-robot\"></i>\n                            Ask Knowledge Agent\n                        </button>\n                    </div>\n                }\n            </div>\n        </div>\n\n        @if (HasSearched) {\n            <!-- Results Area -->\n            <div class=\"search-results-layout\">\n                <!-- Sidebar Filters -->\n                @if (ShowFilters && Filters.length > 0) {\n                    <aside class=\"search-sidebar\">\n                        <mj-search-filter\n                            [Filters]=\"Filters\"\n                            [ActiveFilters]=\"ActiveFilters\"\n                            (FilterChanged)=\"OnFilterChanged($event)\"\n                            (FiltersCleared)=\"OnFiltersCleared()\"\n                        ></mj-search-filter>\n\n                        <!-- Relevance Threshold Slider -->\n                        <div class=\"threshold-section\">\n                            <label class=\"threshold-label\">\n                                Min Relevance\n                                <span class=\"threshold-value\">{{ (MinScoreThreshold * 100) | number:'1.0-0' }}%</span>\n                            </label>\n                            <input\n                                type=\"range\"\n                                class=\"threshold-slider\"\n                                [min]=\"0\"\n                                [max]=\"100\"\n                                [step]=\"5\"\n                                [value]=\"MinScoreThreshold * 100\"\n                                (input)=\"OnThresholdChanged($any($event.target).value / 100)\"\n                            />\n                            <div class=\"threshold-range-labels\">\n                                <span>All</span>\n                                <span>Strict</span>\n                            </div>\n                        </div>\n                    </aside>\n                }\n\n                <!-- Results Main -->\n                <div class=\"search-results-main\">\n                    <!-- Results Header -->\n                    <div class=\"search-results-header\">\n                        <span class=\"search-results-count\">\n                            {{ TotalCount }} results\n                            @if (ElapsedMs > 0) {\n                                <span class=\"search-results-time\">in {{ ElapsedMs }}ms</span>\n                            }\n                        </span>\n                        <div class=\"search-results-actions\">\n                            @if (Filters.length > 0) {\n                                <button class=\"toggle-filters-btn\" (click)=\"ToggleFilters()\">\n                                    <i class=\"fa-solid fa-filter\"></i>\n                                    @if (HasActiveFilters()) {\n                                        Filters Active\n                                    } @else {\n                                        Filters\n                                    }\n                                </button>\n                            }\n                        </div>\n                    </div>\n\n                    <!-- Results List -->\n                    <mj-search-results\n                        [ResultGroups]=\"ResultGroups\"\n                        [IsLoading]=\"IsSearching\"\n                        [TotalCount]=\"TotalCount\"\n                        [ElapsedMs]=\"ElapsedMs\"\n                        (ResultSelected)=\"OnResultSelected($event)\"\n                        (OpenRecordRequested)=\"OnOpenRecord($event)\"\n                    ></mj-search-results>\n\n                    <!-- Agent CTA at bottom -->\n                    @if (TotalCount === 0 && !IsSearching) {\n                        <div class=\"search-agent-cta\">\n                            <i class=\"fa-solid fa-robot cta-icon\"></i>\n                            <div class=\"cta-text\">\n                                <strong>Can't find what you're looking for?</strong>\n                                <p>Ask the Knowledge Agent for a deeper analysis</p>\n                            </div>\n                            <button class=\"cta-btn\" (click)=\"OnAskAgent()\">\n                                Ask Agent\n                            </button>\n                        </div>\n                    }\n                </div>\n            </div>\n        } @else if (!IsSearching) {\n            <!-- Empty state: recent searches -->\n            <div class=\"search-recent-area\">\n                @if (RecentSearches.length > 0) {\n                    <h3 class=\"recent-title\">Recent Searches</h3>\n                    <div class=\"recent-list\">\n                        @for (recent of RecentSearches; track recent.Query; let i = $index) {\n                            @if (i < 8) {\n                                <div class=\"recent-item\" (click)=\"ApplyRecentSearch(recent)\">\n                                    <i class=\"fa-solid fa-clock recent-icon\"></i>\n                                    <span class=\"recent-query\">{{ recent.Query }}</span>\n                                    <span class=\"recent-count\">{{ recent.ResultCount }} results</span>\n                                </div>\n                            }\n                        }\n                    </div>\n                }\n            </div>\n        }\n    </div>\n} @else {\n    <!-- Result Detail View (Task 8) -->\n    <app-search-result-detail\n        [Result]=\"DetailResult\"\n        (BackClicked)=\"CloseResultDetail()\"\n        (NavigateToRecord)=\"OnOpenRecord($event)\"\n    ></app-search-result-detail>\n}\n", styles: ["/* Knowledge Search Resource - Google-style clean */\n\n.search-page {\n    min-height: 100%;\n    display: flex;\n    flex-direction: column;\n}\n\n/* Search Hero */\n.search-hero {\n    display: flex;\n    flex-direction: column;\n    align-items: center;\n    justify-content: center;\n    padding: 6rem 2rem 2rem;\n    transition: padding 0.4s ease;\n}\n\n.search-hero-compact {\n    padding: 1.5rem 2rem 1rem;\n}\n\n.search-logo {\n    font-size: 2.2rem;\n    font-weight: 700;\n    color: var(--mj-brand-primary);\n    display: flex;\n    align-items: center;\n    gap: 0.75rem;\n    margin-bottom: 0.5rem;\n    transition: font-size 0.4s ease;\n}\n\n.search-hero-compact .search-logo {\n    font-size: 0;\n    height: 0;\n    margin: 0;\n    overflow: hidden;\n}\n\n.search-subtitle {\n    color: var(--mj-text-secondary);\n    font-size: 1rem;\n    margin-bottom: 2rem;\n    text-align: center;\n    transition: all 0.4s ease;\n}\n\n.search-hero-compact .search-subtitle {\n    font-size: 0;\n    height: 0;\n    margin: 0;\n    overflow: hidden;\n    opacity: 0;\n}\n\n/* Search Box */\n.search-container {\n    width: 100%;\n    max-width: 720px;\n}\n\n.search-box {\n    width: 100%;\n    display: flex;\n    align-items: center;\n    background: var(--mj-bg-surface);\n    border: 1.5px solid var(--mj-border-default);\n    border-radius: 12px;\n    padding: 0 0.25rem 0 1rem;\n    gap: 0.5rem;\n    transition: border-color 0.2s ease, box-shadow 0.2s ease;\n}\n\n.search-box:focus-within {\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\n.search-box-icon {\n    color: var(--mj-text-muted);\n    font-size: 1rem;\n}\n\n.search-box-input {\n    flex: 1;\n    border: none;\n    background: transparent;\n    padding: 0.85rem 0;\n    font-size: 1rem;\n    color: var(--mj-text-primary);\n    outline: none;\n    font-family: inherit;\n}\n\n.search-box-input::placeholder {\n    color: var(--mj-text-muted);\n}\n\n.search-clear-btn {\n    border: none;\n    background: transparent;\n    color: var(--mj-text-muted);\n    cursor: pointer;\n    padding: 0.5rem;\n    border-radius: 6px;\n    font-size: 0.85rem;\n}\n\n.search-clear-btn:hover {\n    color: var(--mj-text-primary);\n    background: var(--mj-bg-surface-hover);\n}\n\n.search-submit-btn {\n    padding: 0.55rem 1.25rem;\n    border-radius: 8px;\n    border: none;\n    background: var(--mj-brand-primary);\n    color: var(--mj-text-inverse);\n    font-size: 0.9rem;\n    font-weight: 500;\n    cursor: pointer;\n    transition: background 0.15s ease;\n    white-space: nowrap;\n}\n\n.search-submit-btn:hover:not(:disabled) {\n    background: var(--mj-brand-primary-hover);\n}\n\n.search-submit-btn:disabled {\n    opacity: 0.5;\n    cursor: not-allowed;\n}\n\n/* Quick Actions */\n.search-quick-actions {\n    display: flex;\n    justify-content: center;\n    gap: 0.75rem;\n    margin-top: 1rem;\n}\n\n.quick-action-btn {\n    display: inline-flex;\n    align-items: center;\n    gap: 0.4rem;\n    padding: 0.45rem 1rem;\n    border-radius: 9999px;\n    border: 1px solid var(--mj-border-default);\n    background: var(--mj-bg-surface);\n    color: var(--mj-text-secondary);\n    font-size: 0.85rem;\n    cursor: pointer;\n    transition: all 0.15s ease;\n}\n\n.quick-action-btn:hover {\n    border-color: var(--mj-brand-primary);\n    color: var(--mj-brand-primary);\n    background: color-mix(in srgb, var(--mj-brand-primary) 5%, var(--mj-bg-surface));\n}\n\n/* Results Layout */\n.search-results-layout {\n    display: flex;\n    flex: 1;\n    gap: 1.5rem;\n    padding: 0 2rem 2rem;\n    max-width: 1200px;\n    margin: 0 auto;\n    width: 100%;\n}\n\n.search-sidebar {\n    width: 260px;\n    flex-shrink: 0;\n}\n\n.search-results-main {\n    flex: 1;\n    min-width: 0;\n    overflow-y: auto;\n    max-height: calc(100vh - 220px);\n}\n\n/* Results Header */\n.search-results-header {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    margin-bottom: 0.75rem;\n}\n\n.search-results-count {\n    font-size: 0.85rem;\n    color: var(--mj-text-secondary);\n}\n\n.search-results-time {\n    color: var(--mj-text-muted);\n}\n\n.toggle-filters-btn {\n    display: inline-flex;\n    align-items: center;\n    gap: 0.4rem;\n    padding: 0.35rem 0.75rem;\n    border: 1px solid var(--mj-border-default);\n    border-radius: 6px;\n    background: var(--mj-bg-surface);\n    color: var(--mj-text-secondary);\n    font-size: 0.82rem;\n    cursor: pointer;\n}\n\n.toggle-filters-btn:hover {\n    background: var(--mj-bg-surface-hover);\n}\n\n/* Agent CTA */\n.search-agent-cta {\n    display: flex;\n    align-items: center;\n    gap: 1rem;\n    padding: 1.25rem;\n    margin-top: 1.5rem;\n    border: 1px solid var(--mj-border-default);\n    border-radius: 10px;\n    background: color-mix(in srgb, var(--mj-brand-primary) 5%, var(--mj-bg-surface));\n}\n\n.cta-icon {\n    font-size: 1.5rem;\n    color: var(--mj-brand-primary);\n    flex-shrink: 0;\n}\n\n.cta-text {\n    flex: 1;\n}\n\n.cta-text strong {\n    color: var(--mj-text-primary);\n    font-size: 0.9rem;\n}\n\n.cta-text p {\n    color: var(--mj-text-muted);\n    font-size: 0.82rem;\n    margin: 0.2rem 0 0;\n}\n\n.cta-btn {\n    padding: 0.5rem 1rem;\n    border-radius: 8px;\n    border: none;\n    background: var(--mj-brand-primary);\n    color: var(--mj-text-inverse);\n    font-size: 0.85rem;\n    font-weight: 500;\n    cursor: pointer;\n    white-space: nowrap;\n}\n\n.cta-btn:hover {\n    background: var(--mj-brand-primary-hover);\n}\n\n/* Recent Searches */\n.search-recent-area {\n    max-width: 600px;\n    margin: 0 auto;\n    padding: 1rem 2rem;\n}\n\n.recent-title {\n    font-size: 0.82rem;\n    color: var(--mj-text-muted);\n    text-transform: uppercase;\n    letter-spacing: 0.05em;\n    font-weight: 600;\n    margin-bottom: 0.75rem;\n}\n\n.recent-list {\n    display: flex;\n    flex-direction: column;\n    gap: 0.25rem;\n}\n\n.recent-item {\n    display: flex;\n    align-items: center;\n    gap: 0.75rem;\n    padding: 0.6rem 0.75rem;\n    border-radius: 8px;\n    cursor: pointer;\n    transition: background 0.1s ease;\n}\n\n.recent-item:hover {\n    background: var(--mj-bg-surface-hover);\n}\n\n.recent-icon {\n    color: var(--mj-text-muted);\n    font-size: 0.82rem;\n}\n\n.recent-query {\n    flex: 1;\n    color: var(--mj-text-primary);\n    font-size: 0.9rem;\n}\n\n.recent-count {\n    color: var(--mj-text-muted);\n    font-size: 0.78rem;\n}\n\n/* Relevance Threshold */\n.threshold-section {\n    margin-top: 1.25rem;\n    padding-top: 1rem;\n    border-top: 1px solid var(--mj-border-subtle);\n}\n\n.threshold-label {\n    display: flex;\n    justify-content: space-between;\n    align-items: center;\n    font-size: 0.82rem;\n    font-weight: 600;\n    color: var(--mj-text-secondary);\n    text-transform: uppercase;\n    letter-spacing: 0.05em;\n    margin-bottom: 0.5rem;\n}\n\n.threshold-value {\n    font-weight: 700;\n    color: var(--mj-brand-primary);\n    font-size: 0.85rem;\n}\n\n.threshold-slider {\n    width: 100%;\n    height: 4px;\n    appearance: none;\n    -webkit-appearance: none;\n    background: var(--mj-border-default);\n    border-radius: 2px;\n    outline: none;\n    cursor: pointer;\n}\n\n.threshold-slider::-webkit-slider-thumb {\n    -webkit-appearance: none;\n    width: 16px;\n    height: 16px;\n    border-radius: 50%;\n    background: var(--mj-brand-primary);\n    border: 2px solid var(--mj-bg-surface);\n    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);\n    cursor: pointer;\n}\n\n.threshold-slider::-moz-range-thumb {\n    width: 16px;\n    height: 16px;\n    border-radius: 50%;\n    background: var(--mj-brand-primary);\n    border: 2px solid var(--mj-bg-surface);\n    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);\n    cursor: pointer;\n}\n\n.threshold-range-labels {\n    display: flex;\n    justify-content: space-between;\n    font-size: 0.72rem;\n    color: var(--mj-text-muted);\n    margin-top: 0.25rem;\n}\n\n/* Mobile responsive */\n@media (max-width: 768px) {\n    .search-results-layout {\n        flex-direction: column;\n        padding: 0 1rem 1rem;\n    }\n\n    .search-sidebar {\n        width: 100%;\n    }\n\n    .search-hero {\n        padding: 3rem 1rem 1rem;\n    }\n}\n"] }]
    }], null, null); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KnowledgeSearchResourceComponent, { className: "KnowledgeSearchResourceComponent", filePath: "src/KnowledgeHub/components/search/knowledge-search-resource.component.ts", lineNumber: 42 }); })();
/** Tree-shaking prevention */
export function LoadKnowledgeSearchResource() {
    // Prevents tree-shaking of the component
}
//# sourceMappingURL=knowledge-search-resource.component.js.map