import { ScopeType } from './../enlighten-lib/filters/condition-type';
import { Component, Input, Output, EventEmitter } from '@angular/core';
import { ScreenType } from '../enlighten-lib/filters/condition-type';
import { AxoFiltersService } from './axo-filters.service';
import { GeneralFilterType } from '../enlighten-lib/filters/general-filter-type';
import { DataModel } from '../enlighten-lib/data-model/data-model';
import * as i0 from "@angular/core";
import * as i1 from "./axo-filters.service";
function AxoFiltersComponent_span_15_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 21);
    i0.ɵɵtext(1, " Fields ");
    i0.ɵɵelementEnd();
} }
function AxoFiltersComponent_mat_icon_20_Template(rf, ctx) { if (rf & 1) {
    const _r6 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "mat-icon", 22);
    i0.ɵɵlistener("click", function AxoFiltersComponent_mat_icon_20_Template_mat_icon_click_0_listener() { i0.ɵɵrestoreView(_r6); const ctx_r5 = i0.ɵɵnextContext(); return ctx_r5.clear(); });
    i0.ɵɵtext(1, "clear");
    i0.ɵɵelementEnd();
} }
function AxoFiltersComponent_ng_container_22_div_2_label_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "label", 28);
    i0.ɵɵtext(1, " Category ");
    i0.ɵɵelementEnd();
} }
function AxoFiltersComponent_ng_container_22_div_2_ng_container_6_mat_list_option_1_Template(rf, ctx) { if (rf & 1) {
    const _r16 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "mat-list-option", 30);
    i0.ɵɵlistener("selectedChange", function AxoFiltersComponent_ng_container_22_div_2_ng_container_6_mat_list_option_1_Template_mat_list_option_selectedChange_0_listener($event) { i0.ɵɵrestoreView(_r16); const category_r11 = i0.ɵɵnextContext().$implicit; return category_r11.isSelected = $event; });
    i0.ɵɵelementStart(1, "span", 31);
    i0.ɵɵtext(2);
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const category_r11 = i0.ɵɵnextContext().$implicit;
    i0.ɵɵproperty("value", category_r11)("selected", category_r11.isSelected);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("matTooltip", category_r11.name);
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate1(" ", category_r11.name, " ");
} }
function AxoFiltersComponent_ng_container_22_div_2_ng_container_6_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtemplate(1, AxoFiltersComponent_ng_container_22_div_2_ng_container_6_mat_list_option_1_Template, 3, 4, "mat-list-option", 29);
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const category_r11 = ctx.$implicit;
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", !category_r11.isHidden);
} }
const _c0 = function (a0) { return { "field-container": a0 }; };
function AxoFiltersComponent_ng_container_22_div_2_Template(rf, ctx) { if (rf & 1) {
    const _r19 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 24);
    i0.ɵɵelementStart(1, "mat-expansion-panel-header");
    i0.ɵɵtemplate(2, AxoFiltersComponent_ng_container_22_div_2_label_2_Template, 2, 0, "label", 25);
    i0.ɵɵpipe(3, "search");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(4, "mat-selection-list", 26, 27);
    i0.ɵɵlistener("selectionChange", function AxoFiltersComponent_ng_container_22_div_2_Template_mat_selection_list_selectionChange_4_listener($event) { i0.ɵɵrestoreView(_r19); const ctx_r18 = i0.ɵɵnextContext(2); return ctx_r18.getCategoryFilterList($event, ctx_r18.i); });
    i0.ɵɵtemplate(6, AxoFiltersComponent_ng_container_22_div_2_ng_container_6_Template, 2, 1, "ng-container", 19);
    i0.ɵɵpipe(7, "search");
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r7 = i0.ɵɵnextContext(2);
    let tmp_1_0;
    i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(9, _c0, ctx_r7.showSearchBox));
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngIf", (tmp_1_0 = i0.ɵɵpipeBind2(3, 3, ctx_r7.categoryList, ctx_r7.searchedTerm)) == null ? null : tmp_1_0.length);
    i0.ɵɵadvance(4);
    i0.ɵɵproperty("ngForOf", i0.ɵɵpipeBind2(7, 6, ctx_r7.categoryList, ctx_r7.searchedTerm));
} }
function AxoFiltersComponent_ng_container_22_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelementStart(1, "mat-expansion-panel");
    i0.ɵɵtemplate(2, AxoFiltersComponent_ng_container_22_div_2_Template, 8, 11, "div", 23);
    i0.ɵɵpipe(3, "search");
    i0.ɵɵelementEnd();
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const ctx_r3 = i0.ɵɵnextContext();
    let tmp_0_0;
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngIf", (tmp_0_0 = i0.ɵɵpipeBind2(3, 1, ctx_r3.categoryList, ctx_r3.searchedTerm)) == null ? null : tmp_0_0.length);
} }
function AxoFiltersComponent_ng_container_24_ng_container_1_label_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "label", 28);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const entity_r20 = i0.ɵɵnextContext(2).$implicit;
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate1(" ", entity_r20.formName, " ");
} }
function AxoFiltersComponent_ng_container_24_ng_container_1_mat_selection_list_5_ng_container_2_mat_list_option_1_Template(rf, ctx) { if (rf & 1) {
    const _r31 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "mat-list-option", 30);
    i0.ɵɵlistener("selectedChange", function AxoFiltersComponent_ng_container_24_ng_container_1_mat_selection_list_5_ng_container_2_mat_list_option_1_Template_mat_list_option_selectedChange_0_listener($event) { i0.ɵɵrestoreView(_r31); const column_r27 = i0.ɵɵnextContext().$implicit; return column_r27.isSelected = $event; });
    i0.ɵɵelementStart(1, "span", 31);
    i0.ɵɵelement(2, "mat-icon", 34);
    i0.ɵɵtext(3);
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const column_r27 = i0.ɵɵnextContext().$implicit;
    i0.ɵɵproperty("value", column_r27)("selected", column_r27.isSelected);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("matTooltip", column_r27.label);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("svgIcon", column_r27.enlightenType.matIcon);
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate1(" ", column_r27.label, " ");
} }
function AxoFiltersComponent_ng_container_24_ng_container_1_mat_selection_list_5_ng_container_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtemplate(1, AxoFiltersComponent_ng_container_24_ng_container_1_mat_selection_list_5_ng_container_2_mat_list_option_1_Template, 4, 5, "mat-list-option", 29);
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const column_r27 = ctx.$implicit;
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", !column_r27.isHidden);
} }
function AxoFiltersComponent_ng_container_24_ng_container_1_mat_selection_list_5_Template(rf, ctx) { if (rf & 1) {
    const _r35 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "mat-selection-list", 26, 33);
    i0.ɵɵlistener("selectionChange", function AxoFiltersComponent_ng_container_24_ng_container_1_mat_selection_list_5_Template_mat_selection_list_selectionChange_0_listener($event) { i0.ɵɵrestoreView(_r35); const entity_r20 = i0.ɵɵnextContext(2).$implicit; const ctx_r33 = i0.ɵɵnextContext(); return ctx_r33.addBasicFilter($event, entity_r20.formId); });
    i0.ɵɵtemplate(2, AxoFiltersComponent_ng_container_24_ng_container_1_mat_selection_list_5_ng_container_2_Template, 2, 1, "ng-container", 19);
    i0.ɵɵpipe(3, "search");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const entity_r20 = i0.ɵɵnextContext(2).$implicit;
    const ctx_r23 = i0.ɵɵnextContext();
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngForOf", i0.ɵɵpipeBind2(3, 1, entity_r20.columns, ctx_r23.searchedTerm));
} }
function AxoFiltersComponent_ng_container_24_ng_container_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelementStart(1, "mat-expansion-panel");
    i0.ɵɵelementStart(2, "mat-expansion-panel-header");
    i0.ɵɵtemplate(3, AxoFiltersComponent_ng_container_24_ng_container_1_label_3_Template, 2, 1, "label", 25);
    i0.ɵɵpipe(4, "search");
    i0.ɵɵelementEnd();
    i0.ɵɵtemplate(5, AxoFiltersComponent_ng_container_24_ng_container_1_mat_selection_list_5_Template, 4, 4, "mat-selection-list", 32);
    i0.ɵɵpipe(6, "search");
    i0.ɵɵelementEnd();
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const entity_r20 = i0.ɵɵnextContext().$implicit;
    const ctx_r21 = i0.ɵɵnextContext();
    let tmp_0_0;
    let tmp_1_0;
    i0.ɵɵadvance(3);
    i0.ɵɵproperty("ngIf", (tmp_0_0 = i0.ɵɵpipeBind2(4, 2, entity_r20.columns, ctx_r21.searchedTerm)) == null ? null : tmp_0_0.length);
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngIf", ((tmp_1_0 = i0.ɵɵpipeBind2(6, 5, entity_r20.columns, ctx_r21.searchedTerm)) == null ? null : tmp_1_0.length) > 0);
} }
function AxoFiltersComponent_ng_container_24_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtemplate(1, AxoFiltersComponent_ng_container_24_ng_container_1_Template, 7, 8, "ng-container", 17);
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const entity_r20 = ctx.$implicit;
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", !entity_r20.isManyToManyTable);
} }
const _c1 = function (a0) { return { "justify-between px-2.5": a0 }; };
const _c2 = function (a0) { return { "global-border px-2.5": a0 }; };
const _c3 = function (a0) { return { "search-icon": a0 }; };
export class AxoFiltersComponent {
    /**
     *Constructor
     */
    constructor(_axoFilterService) {
        this._axoFilterService = _axoFilterService;
        this.categories = [];
        this.scopeType = 2;
        // <------------ Outputs ----------------------->
        this.dirtyFlowCheckEvent = new EventEmitter();
        this.applyFilterEmit = new EventEmitter();
        this.resetFilterEmit = new EventEmitter();
        this.clearFilterEmit = new EventEmitter();
        this.sendFilterToDashboard = new EventEmitter();
        this.filterCategorySendOnDashboardEvent = new EventEmitter();
        // <---------- Component Level Attributes ------>
        this.commonFilterArray = [];
        this.categoryList = [];
        this.showSearchBox = false;
        this.showField = true;
        this.titleValue = '';
        this.searchedTerm = '';
        this.showApplyFilterEvent = true;
        this.selectedWidget = [];
    }
    ;
    /**
     * Ng On changes get called on Input changes
     *
     * @param changes
     */
    ngOnChanges(changes) {
        if (changes.appVersionId || changes.dataModel) {
            this.initializeAxoFilter();
        }
    }
    /**
     * Initialize axo filter
     */
    initializeAxoFilter() {
        this.generateCommonFilterList();
        if (!this.dataModel && this.appVersionId) {
            this.getDataModel();
        }
    }
    /**
     * Get Data model
     */
    getDataModel() {
        this._axoFilterService.getDataModelByAppVersion(this.appVersionId).then((dataModel) => {
            this.dataModel = new DataModel(dataModel);
        }).catch((error) => {
            console.log(error);
        });
    }
    /**
     * Generate common filter list from existing filters and categories.
     */
    generateCommonFilterList() {
        //Add filters in the common filters list
        this.filters.forEach((filter) => {
            // filter.generalFilterType = GeneralFilterType.filters;
            if (!this.commonFilterArray.includes(filter)) {
                this.commonFilterArray.push(filter);
            }
        });
        //Add Categories in the common filters list
        this.categories.forEach((category) => {
            category.generalFilterType = GeneralFilterType.category;
            if (!this.commonFilterArray.includes(category)) {
                this.commonFilterArray.push(category);
            }
        });
        // sort the filter by order.
        this.commonFilterArray.sort((a, b) => (a.gridProperties.x > b.gridProperties.x) ? 1 : ((b.gridProperties.x > a.gridProperties.x) ? -1 : 0));
    }
    /**
     * This will get called from filter commonent on filter delete.
     *
     * @param index
     */
    deleteFilter(index) {
        const filter = this.commonFilterArray[index];
        this.removeBasicFilter(filter);
    }
    /**
     * Remove filter from filter array if filter is not saved or mark as deleted if it's saved.
     *
     * @param filter
     */
    removeBasicFilter(filter) {
        if (filter.id === 0) {
            this.filters.splice(this.filters.indexOf(filter), 1);
            this.commonFilterArray.splice(this.filters.indexOf(filter), 1);
        }
        else {
            filter.isDeleted = false;
            filter.isSelected = false;
        }
    }
    /**
     * This will get called on MatSelection Change
     * We delete filter if if deselect widget or we create new filter if select widget.
     *
     * @param event
     */
    addBasicFilter(event, formId) {
        // Add new filter
        if (event.option.selected) {
            const attribute = event.option.value;
            attribute.formId = formId;
            this.selectedWidget.push(attribute.identifier);
            this.showApplyFilterEvent = !this.showApplyFilterEvent;
            //created new filter by widget
            const filter = this._axoFilterService.addFilter(this.appVersionId, event, this.filters, ScopeType.global, this.filters.length);
            this.filters.push(filter);
            this.commonFilterArray.push(filter);
        }
        else {
            //remove selected filter
            this.selectedWidget.slice(this.selectedWidget.indexOf(event.option.value.identifier), 1);
            const filter = this.getFilterFromList(event.option.value.identifier);
            this.removeBasicFilter(filter);
        }
    }
    /**
     * Get filter by widget identifier.
     *
     * @param identifier
     * @returns
     */
    getFilterFromList(identifier) {
        for (const filter of this.commonFilterArray) {
            if (filter.searchNodes[0].expression.field.identifier === identifier) {
                return filter;
            }
            ;
        }
        return null;
    }
    closeMatMenu() {
    }
    showFilterDiv() { }
}
AxoFiltersComponent.ɵfac = function AxoFiltersComponent_Factory(t) { return new (t || AxoFiltersComponent)(i0.ɵɵdirectiveInject(i1.AxoFiltersService)); };
AxoFiltersComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: AxoFiltersComponent, selectors: [["axo-filters"]], inputs: { filters: "filters", categories: "categories", screenType: "screenType", appVersionId: "appVersionId", dataModel: "dataModel", scopeType: "scopeType" }, outputs: { dirtyFlowCheckEvent: "dirtyFlowCheckEvent", applyFilterEmit: "applyFilterEmit", resetFilterEmit: "resetFilterEmit", clearFilterEmit: "clearFilterEmit", sendFilterToDashboard: "sendFilterToDashboard", filterCategorySendOnDashboardEvent: "filterCategorySendOnDashboardEvent" }, features: [i0.ɵɵNgOnChangesFeature], decls: 26, vars: 22, consts: [[1, "sticky", "data-list-filter"], [1, "table-heading"], [1, "flex", "items-center", "justify-between", "flex-wrap", "lg:flex-nowrap"], [1, "flex", "items-center", "gap-4", "mx-auto", "w-full"], [1, "report-filter", 2, "position", "relative"], ["mat-icon-button", "", 1, "light-blue-btn", "axo-font", 3, "matMenuTriggerFor"], ["yPosition", "below", "backdropClass", "report-filter-menu-backdrop-class", 1, "filter-field-list"], ["menu", "matMenu"], [1, "sticky", "top-0", "bg-white", "flex", "justify-end", "items-center", "h-10", "z-10"], ["mat-icon-button", "", 1, "light-btn", "min-w-8", "px-2", "py-0", "max-h-5", "h-5", "min-h-5", "leading-5", "axo-font", 3, "click"], [3, "click"], [1, "group", "flex", "items-center", "justify-center", "mb-3", 3, "ngClass"], ["class", "text-f font-medium", 4, "ngIf"], [1, "flex", "items-center", "search-field", 3, "ngClass"], [1, "mt-2", "text-xs", "search-icons", 3, "ngClass", "svgIcon"], ["id", "global-field-search", "autocomplete", "off", "placeholder", "Search...", "matInput", "", 1, "search-bar", "chart-title", 3, "keydown"], ["class", "clear_icon cursor-pointer text-base", 3, "click", 4, "ngIf"], [4, "ngIf"], [1, "fields-div"], [4, "ngFor", "ngForOf"], [1, "data-list-filter-container", 3, "filters", "commonFilterArray", "screenType", "categories", "scopeType", "applyFilterEmit", "resetFilterEmit", "deleteFilterEmit"], [1, "text-f", "font-medium"], [1, "clear_icon", "cursor-pointer", "text-base", 3, "click"], [3, "ngClass", 4, "ngIf"], [3, "ngClass"], ["class", "px-2.5", 4, "ngIf"], [3, "selectionChange"], ["category", ""], [1, "px-2.5"], ["checkboxPosition", "after", "color", "primary", 3, "value", "selected", "selectedChange", 4, "ngIf"], ["checkboxPosition", "after", "color", "primary", 3, "value", "selected", "selectedChange"], [1, "list-field", 3, "matTooltip"], [3, "selectionChange", 4, "ngIf"], ["filters", ""], [1, "svg-icon", "mr-2", 3, "svgIcon"]], template: function AxoFiltersComponent_Template(rf, ctx) { if (rf & 1) {
        i0.ɵɵelementStart(0, "div", 0);
        i0.ɵɵelementStart(1, "div", 1);
        i0.ɵɵelementStart(2, "div", 2);
        i0.ɵɵelementStart(3, "div", 3);
        i0.ɵɵelementStart(4, "div", 4);
        i0.ɵɵelementStart(5, "button", 5);
        i0.ɵɵtext(6, " + Add Filter ");
        i0.ɵɵelementEnd();
        i0.ɵɵelementStart(7, "mat-menu", 6, 7);
        i0.ɵɵelementStart(9, "div", 8);
        i0.ɵɵelementStart(10, "button", 9);
        i0.ɵɵlistener("click", function AxoFiltersComponent_Template_button_click_10_listener() { return ctx.closeMatMenu(); });
        i0.ɵɵelementStart(11, "mat-icon");
        i0.ɵɵtext(12, "clear");
        i0.ɵɵelementEnd();
        i0.ɵɵelementEnd();
        i0.ɵɵelementEnd();
        i0.ɵɵelementStart(13, "div", 10);
        i0.ɵɵlistener("click", function AxoFiltersComponent_Template_div_click_13_listener($event) { return $event.stopPropagation(); });
        i0.ɵɵelementStart(14, "div", 11);
        i0.ɵɵtemplate(15, AxoFiltersComponent_span_15_Template, 2, 0, "span", 12);
        i0.ɵɵelementStart(16, "div", 13);
        i0.ɵɵelementStart(17, "button", 10);
        i0.ɵɵlistener("click", function AxoFiltersComponent_Template_button_click_17_listener() { return ctx.showFilterDiv(); });
        i0.ɵɵelement(18, "mat-icon", 14);
        i0.ɵɵelementEnd();
        i0.ɵɵelementStart(19, "input", 15);
        i0.ɵɵlistener("keydown", function AxoFiltersComponent_Template_input_keydown_19_listener($event) { return $event.stopPropagation(); });
        i0.ɵɵelementEnd();
        i0.ɵɵtemplate(20, AxoFiltersComponent_mat_icon_20_Template, 2, 0, "mat-icon", 16);
        i0.ɵɵelementEnd();
        i0.ɵɵelementEnd();
        i0.ɵɵelementStart(21, "mat-accordion");
        i0.ɵɵtemplate(22, AxoFiltersComponent_ng_container_22_Template, 4, 4, "ng-container", 17);
        i0.ɵɵelementStart(23, "div", 18);
        i0.ɵɵtemplate(24, AxoFiltersComponent_ng_container_24_Template, 2, 1, "ng-container", 19);
        i0.ɵɵelementEnd();
        i0.ɵɵelementEnd();
        i0.ɵɵelementEnd();
        i0.ɵɵelementEnd();
        i0.ɵɵelementEnd();
        i0.ɵɵelementStart(25, "filters", 20);
        i0.ɵɵlistener("applyFilterEmit", function AxoFiltersComponent_Template_filters_applyFilterEmit_25_listener($event) { return ctx.applyFilterEmit.emit($event); })("resetFilterEmit", function AxoFiltersComponent_Template_filters_resetFilterEmit_25_listener($event) { return ctx.resetFilterEmit.emit($event); })("deleteFilterEmit", function AxoFiltersComponent_Template_filters_deleteFilterEmit_25_listener($event) { return ctx.deleteFilter($event); });
        i0.ɵɵelementEnd();
        i0.ɵɵelementEnd();
        i0.ɵɵelementEnd();
        i0.ɵɵelementEnd();
        i0.ɵɵelementEnd();
    } if (rf & 2) {
        const _r0 = i0.ɵɵreference(8);
        i0.ɵɵadvance(5);
        i0.ɵɵproperty("matMenuTriggerFor", _r0);
        i0.ɵɵadvance(9);
        i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(16, _c1, !ctx.showSearchBox));
        i0.ɵɵadvance(1);
        i0.ɵɵproperty("ngIf", ctx.showField);
        i0.ɵɵadvance(1);
        i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(18, _c2, ctx.showSearchBox));
        i0.ɵɵadvance(2);
        i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(20, _c3, ctx.showSearchBox))("svgIcon", "heroicons_solid:search");
        i0.ɵɵadvance(1);
        i0.ɵɵstyleProp("width", !ctx.showSearchBox ? "0" : "100%");
        i0.ɵɵadvance(1);
        i0.ɵɵproperty("ngIf", ctx.showSearchBox);
        i0.ɵɵadvance(2);
        i0.ɵɵproperty("ngIf", ctx.categoryList.length > 0);
        i0.ɵɵadvance(2);
        i0.ɵɵproperty("ngForOf", ctx.dataModel == null ? null : ctx.dataModel.entities);
        i0.ɵɵadvance(1);
        i0.ɵɵproperty("filters", ctx.filters)("commonFilterArray", ctx.commonFilterArray)("screenType", ctx.screenType)("categories", ctx.categories)("scopeType", ctx.scopeType);
    } }, styles: ["lib-data-view-filters[_ngcontent-%COMP%]   .data-list-filter[_ngcontent-%COMP%]   .add-filter[_ngcontent-%COMP%]{background:#EFF6FF;font-family:Roboto,sans-serif;font-style:normal;font-weight:400;font-size:12px;line-height:14px;color:#345ad6;white-space:nowrap;width:90px;height:27px}lib-data-view-filters[_ngcontent-%COMP%]   .data-list-filter[_ngcontent-%COMP%]   .data-list-filter-container[_ngcontent-%COMP%]{display:flex;column-gap:1.25rem!important;width:calc(100% - 120px)!important}lib-data-view-filters[_ngcontent-%COMP%]   .data-list-filter[_ngcontent-%COMP%]   .data-list-filter-container[_ngcontent-%COMP%]   .reset-btn[_ngcontent-%COMP%]{display:flex;margin-top:.5rem;padding-left:.4rem}lib-data-view-filters[_ngcontent-%COMP%]   .data-list-filter[_ngcontent-%COMP%]   .data-list-filter-container[_ngcontent-%COMP%]   .local-filter[_ngcontent-%COMP%]{width:auto}.filter-field-list[_ngcontent-%COMP%]{width:227px!important}.list-field[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;display:inline-block}.list-field[_ngcontent-%COMP%]   .mat-icon[_ngcontent-%COMP%]{vertical-align:middle}.global-border[_ngcontent-%COMP%]{border-bottom:1px solid #dcdcdc}.global-border[_ngcontent-%COMP%]   .search-icon[_ngcontent-%COMP%]{margin-right:16px}.mat-menu-panel[_ngcontent-%COMP%]   .mat-menu-content[_ngcontent-%COMP%]   .mat-menu-item[_ngcontent-%COMP%]{font-size:13px}.mat-list-base[_ngcontent-%COMP%]   .mat-list-item[_ngcontent-%COMP%]   .mat-list-item-content-reverse[_ngcontent-%COMP%], .mat-list-base[_ngcontent-%COMP%]   .mat-list-option[_ngcontent-%COMP%]   .mat-list-item-content-reverse[_ngcontent-%COMP%]{font-size:12px;display:flex!important}.mat-checkbox-ripple[_ngcontent-%COMP%]   .mat-ripple-element[_ngcontent-%COMP%], .mat-checkbox-checked.mat-accent[_ngcontent-%COMP%]   .mat-checkbox-background[_ngcontent-%COMP%]{background-color:#6454c0!important}.mat-accordion[_ngcontent-%COMP%]   .mat-expansion-panel[_ngcontent-%COMP%]{box-shadow:unset!important}"] });
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AxoFiltersComponent, [{
        type: Component,
        args: [{ selector: 'axo-filters', template: "<div class=\"sticky data-list-filter\">\n    <div class=\"table-heading\">\n        <!--filter-->\n        <div class=\"flex items-center justify-between flex-wrap lg:flex-nowrap\">\n            <div class=\"flex items-center gap-4 mx-auto w-full\">\n                <div class=\"report-filter\" style=\"position: relative\">\n                    <!-- Add filter Button  -->\n                    <button class=\"light-blue-btn axo-font\" mat-icon-button [matMenuTriggerFor]=\"menu\">\n                        + Add Filter\n                    </button>\n\n                    <!-- Close button for closing filter dialog -->\n                    <mat-menu #menu=\"matMenu\" yPosition=\"below\" class=\"filter-field-list\" backdropClass=\"report-filter-menu-backdrop-class\">\n                        <div class=\" sticky top-0 bg-white flex justify-end items-center h-10 z-10\">\n                            <button\n                                class=\"light-btn min-w-8 px-2 py-0 max-h-5 h-5 min-h-5 leading-5 axo-font\" mat-icon-button (click)=\"closeMatMenu()\">\n                                <mat-icon>clear</mat-icon>\n                            </button>\n                        </div>\n                        <!-- Field List  -->\n                        <div (click)=\"$event.stopPropagation()\">\n                            <div class=\"group flex items-center justify-center mb-3\" [ngClass]=\"{ 'justify-between px-2.5': !showSearchBox }\">\n                                <span *ngIf=\"showField\" class=\"text-f font-medium\">\n                                    Fields\n                                </span>\n                                <!-- Search Button -->\n                                <div class=\"flex items-center search-field\" [ngClass]=\"{ 'global-border px-2.5': showSearchBox }\">\n                                    <button (click)=\"showFilterDiv()\">\n                                        <mat-icon\n                                            [ngClass]=\"{ 'search-icon': showSearchBox }\"\n                                            class=\"mt-2 text-xs search-icons\"\n                                            [svgIcon]=\"'heroicons_solid:search'\"\n                                        ></mat-icon>\n                                    </button>\n                                    <!-- Search input box -->\n                                    <input id=\"global-field-search\" (keydown)=\"$event.stopPropagation()\" autocomplete=\"off\" placeholder=\"Search...\" matInput class=\"search-bar chart-title\" [style.width]=\"!showSearchBox ? '0' : '100%'\"/>\n                                    <mat-icon (click)=\"clear()\" *ngIf=\"showSearchBox\" class=\"clear_icon cursor-pointer text-base\" >clear</mat-icon>\n                                </div>\n                            </div>\n                            <mat-accordion>\n                                <!-- Category List -->\n                                <ng-container *ngIf=\"categoryList.length > 0\">\n                                    <!-- Mat Expansion panel -->\n                                    <mat-expansion-panel >\n                                        <div [ngClass]=\"{ 'field-container': showSearchBox }\" *ngIf=\"(categoryList | search: searchedTerm)?.length\">\n                                            <!-- Mat expansion panel header -->\n                                            <mat-expansion-panel-header>\n                                                <label class=\"px-2.5\" *ngIf=\"     (categoryList | search: searchedTerm)?.length \" >\n                                                    Category\n                                                </label>\n                                            </mat-expansion-panel-header>\n                                            <!-- Selection Dropdown -->\n                                            <mat-selection-list #category (selectionChange)=\" getCategoryFilterList($event, i) \">\n                                                <ng-container *ngFor=\"let category of categoryList | search: searchedTerm; let i = index \">\n                                                    <mat-list-option *ngIf=\"!category.isHidden\" checkboxPosition=\"after\" [value]=\"category\" [(selected)]=\"category.isSelected\" color=\"primary\">\n                                                        <span class=\"list-field\" [matTooltip]=\"category.name\">\n                                                            {{ category.name }}\n                                                        </span>\n                                                    </mat-list-option>\n                                                </ng-container>\n                                            </mat-selection-list>\n                                        </div>\n                                    </mat-expansion-panel>\n                                </ng-container>\n\n                                <!-- Entity List  -->\n                                <div class=\"fields-div\">\n                                    <ng-container *ngFor=\"let entity of dataModel?.entities\">\n                                        <ng-container *ngIf=\"!entity.isManyToManyTable\">\n                                            <!-- Mat expansion panel -->\n                                            <mat-expansion-panel >\n                                                <!-- Mat expansion panel header -->\n                                                <mat-expansion-panel-header>\n                                                    <label class=\"px-2.5\" *ngIf=\"(entity.columns | search: searchedTerm)?.length\" >\n                                                        {{ entity.formName }}\n                                                    </label>\n                                                </mat-expansion-panel-header>\n                                                <!-- Mat Selection List -->\n                                                <mat-selection-list #filters *ngIf=\"(entity.columns | search: searchedTerm)?.length > 0 \" (selectionChange)=\"addBasicFilter($event,entity.formId)\">\n                                                    <ng-container *ngFor=\"let column of entity.columns | search: searchedTerm \">\n                                                        <!-- Select list options -->\n                                                        <mat-list-option *ngIf=\"!column.isHidden\" checkboxPosition=\"after\" [value]=\"column\" [(selected)]=\"column.isSelected\" color=\"primary\" >\n                                                            <span class=\"list-field\" [matTooltip]=\"column.label\" >\n                                                                <mat-icon class=\"svg-icon mr-2\" [svgIcon]=\"column.enlightenType .matIcon \"></mat-icon>\n                                                                {{ column.label }}\n                                                            </span>\n                                                        </mat-list-option>\n                                                    </ng-container>\n                                                </mat-selection-list>\n                                            </mat-expansion-panel>\n                                        </ng-container>\n                                    </ng-container>\n                                </div>\n                            </mat-accordion>\n                        </div>\n                    </mat-menu>\n                </div>\n                <!-- Selected Filter List -->\n                <filters\n                    class=\"data-list-filter-container\"\n                    [filters]=\"filters\"\n                    [commonFilterArray]=\"commonFilterArray\"\n                    [screenType]=\"screenType\"\n                    [categories]=\"categories\"\n                    [scopeType]=\"scopeType\"\n                    (applyFilterEmit)=\"applyFilterEmit.emit($event)\"\n                    (resetFilterEmit)=\"resetFilterEmit.emit($event)\"\n                    (deleteFilterEmit)=\"deleteFilter($event)\"\n                >\n                </filters>\n            </div>\n        </div>\n    </div>\n</div>\n", styles: ["lib-data-view-filters .data-list-filter .add-filter{background:#EFF6FF;font-family:Roboto,sans-serif;font-style:normal;font-weight:400;font-size:12px;line-height:14px;color:#345ad6;white-space:nowrap;width:90px;height:27px}lib-data-view-filters .data-list-filter .data-list-filter-container{display:flex;column-gap:1.25rem!important;width:calc(100% - 120px)!important}lib-data-view-filters .data-list-filter .data-list-filter-container .reset-btn{display:flex;margin-top:.5rem;padding-left:.4rem}lib-data-view-filters .data-list-filter .data-list-filter-container .local-filter{width:auto}.filter-field-list{width:227px!important}.list-field{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;display:inline-block}.list-field .mat-icon{vertical-align:middle}.global-border{border-bottom:1px solid #dcdcdc}.global-border .search-icon{margin-right:16px}.mat-menu-panel .mat-menu-content .mat-menu-item{font-size:13px}.mat-list-base .mat-list-item .mat-list-item-content-reverse,.mat-list-base .mat-list-option .mat-list-item-content-reverse{font-size:12px;display:flex!important}.mat-checkbox-ripple .mat-ripple-element,.mat-checkbox-checked.mat-accent .mat-checkbox-background{background-color:#6454c0!important}.mat-accordion .mat-expansion-panel{box-shadow:unset!important}\n"] }]
    }], function () { return [{ type: i1.AxoFiltersService }]; }, { filters: [{
            type: Input
        }], categories: [{
            type: Input
        }], screenType: [{
            type: Input
        }], appVersionId: [{
            type: Input
        }], dataModel: [{
            type: Input
        }], scopeType: [{
            type: Input
        }], dirtyFlowCheckEvent: [{
            type: Output
        }], applyFilterEmit: [{
            type: Output
        }], resetFilterEmit: [{
            type: Output
        }], clearFilterEmit: [{
            type: Output
        }], sendFilterToDashboard: [{
            type: Output
        }], filterCategorySendOnDashboardEvent: [{
            type: Output
        }] }); })();
//# sourceMappingURL=data:application/json;base64, 