import { Component, ChangeDetectionStrategy, ContentChildren, HostBinding, Input, ViewEncapsulation, Output, EventEmitter, booleanAttribute, } from '@angular/core';
import { EuimChipSelectorItemDirective } from './euim-chip-selector-item/euim-chip-selector-item.directive';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@ionic/angular";
import * as i3 from "../euim-scroller-x/euim-scroller-x.component";
export class EuimChipSelectorComponent {
    constructor() {
        this.backgroundColor = 'branding';
        this.color = 'white';
        this.chipSelectedColor = 'white';
        this.chipFill = 'default';
        this.sourceData = [];
        this.hasBoxShadow = false;
        this.hasNoScrollerX = false;
        this.hasColorTransparency = false;
        this.selectedChips = [];
        this.isMultiSelectionMode = false;
        this.isCustomMode = false;
        this.euimKeepSelection = false;
        this.hasSearchbar = false;
        this.filterData = new EventEmitter();
        this.clickItems = new EventEmitter();
        this.selectedChipsChange = new EventEmitter();
        this.filteredData = [...this.sourceData];
        this.filterConditions = [];
        this.searchInput = '';
        this.isEmitEvent = true;
        this.clickEventHandled = false;
    }
    get cssClasses() {
        return this.getCssClasses();
    }
    ngAfterViewInit() {
        this.setCssItemClasses();
    }
    ngAfterContentInit() {
        this.subscribeToChanges();
        this.updateChipsAndFilterDataAfterInit();
        this.updateChipsAndFilters();
    }
    ngOnDestroy() {
        if (this.euimChipSelectorItemSubscription) {
            this.euimChipSelectorItemSubscription.unsubscribe();
        }
    }
    subscribeToChanges() {
        if (this.euimChipSelectorItemSubscription) {
            this.euimChipSelectorItemSubscription.unsubscribe();
        }
        this.euimChipSelectorItemSubscription = this.euimChipSelectorItemComponent.changes['subscribe'](() => {
            this.setCssItemClasses();
            this.updateChipsAndFilterDataAfterInit(this.isEmitEvent = false);
            this.updateChipsAndFilters();
        });
    }
    ngOnChanges(changes) {
        if (this.euimChipSelectorItemComponent && this.euimChipSelectorItemComponent.length > 0 &&
            changes['selectedChips']?.currentValue && changes['selectedChips']?.currentValue.length === 1 &&
            changes['selectedChips']?.currentValue.every((value) => value === '0')) {
            this.clearFiltersAndSelectAll();
            return;
        }
        if (this.euimChipSelectorItemComponent && this.euimChipSelectorItemComponent.length > 0 &&
            changes['selectedChips']?.currentValue && !changes['selectedChips']?.currentValue.every((value) => value === '0')) {
            this.updateChipsAndFilterDataAfterInit(this.isEmitEvent = false);
            this.selectedChipsChange.emit(this.selectedChips);
            return;
        }
        if (this.euimChipSelectorItemComponent && this.euimChipSelectorItemComponent.length > 0 &&
            changes['chipSelectedColor']?.currentValue) {
            this.euimChipSelectorItemComponent.forEach(chip => {
                chip.el.nativeElement.classList.remove(`euim-chip-selector__item-selected--color-${changes['chipSelectedColor']?.previousValue}`);
                if (chip.el.nativeElement.getAttribute('selected') === 'true') {
                    chip.el.nativeElement.classList.add(`euim-chip-selector__item-selected--color-${changes['chipSelectedColor']?.currentValue}`);
                }
            });
            return;
        }
    }
    getCssClasses() {
        return [
            'euim-chip-selector',
            this.backgroundColor ? `euim-chip-selector--background-color-${this.backgroundColor}` : '',
            this.hasNoScrollerX ? 'euim-chip-selector--has-no-scroller-x' : '',
        ].join(' ').trim();
    }
    setCssItemClasses() {
        const classes = this.getCssItemClasses();
        this.euimChipSelectorItemComponent.forEach(chip => {
            classes.split(' ').forEach(className => {
                chip.el.nativeElement.classList.add(className);
            });
        });
    }
    getCssItemClasses() {
        return [
            this.chipFill ? `euim-chip-selector__item--fill-${this.chipFill}` : '',
            this.color ? `euim-chip-selector__item--color-${this.color}` : '',
            this.hasColorTransparency ? `euim-chip-selector__item--color-${this.color}-with-transparency` : '',
            this.hasBoxShadow ? 'euim-chip-selector__item--has-box-shadow' : '',
        ]
            .filter(Boolean)
            .join(' ');
    }
    updateChipsAndFilters() {
        this.euimChipSelectorItemComponent.forEach(chip => {
            if (!chip.clickEventAdded) {
                chip.el.nativeElement.addEventListener('click', () => {
                    if (!this.clickEventHandled) {
                        this.clickEventHandled = true;
                        this.euimChipSelectorItemComponent.forEach(innerChip => {
                            if (!this.isMultiSelectionMode || (this.isMultiSelectionMode && innerChip.euimChipSelectorAll)) {
                                this.removeSelectedStyles(innerChip.el.nativeElement);
                            }
                        });
                        this.addSelectedStyles(chip.el.nativeElement);
                        this.onFilterChange(chip.id?.toString(), chip.euimChipSelectorAll, chip.el.nativeElement);
                        this.filterData.emit(this.filteredData);
                        this.clickItems.emit(this.selectedChips);
                        this.selectedChipsChange.emit(this.selectedChips);
                        this.clickEventHandled = false;
                    }
                });
                chip.clickEventAdded = true;
            }
        });
    }
    applyFilter(filterCondition, isAllFilter, multipleFilterConditions) {
        let filteredData = [...this.sourceData];
        if (isAllFilter) {
            filteredData = this.filterBySearch(filteredData, this.searchInput);
        }
        else {
            if (this.isMultiSelectionMode || multipleFilterConditions.length > 0) {
                filteredData = this.filterByMultipleConditions(filteredData, multipleFilterConditions);
            }
            else {
                filteredData = this.filterByCondition(filteredData, filterCondition);
            }
            if (this.euimKeepSelection && this.searchInput !== '') {
                filteredData = this.filterBySearch(filteredData, this.searchInput);
            }
        }
        this.filteredData = filteredData;
    }
    clearFiltersAndSelectAll() {
        this.clearAllSelections();
        let isFirstElement = true;
        this.euimChipSelectorItemComponent.forEach(chip => {
            if (isFirstElement) {
                this.addSelectedStyles(chip.el.nativeElement);
                isFirstElement = false;
            }
        });
        this.filterData.emit(this.sourceData);
        this.selectedChipsChange.emit(this.selectedChips);
    }
    updateChipsAndFilterDataAfterInit(isEmitEvent) {
        this.euimChipSelectorItemComponent.forEach(chip => {
            this.removeSelectedStyles(chip.el.nativeElement);
            if (chip.id === undefined && chip.euimChipSelectorAll) {
                chip.id = 0;
            }
            const chipId = chip.id;
            if (chipId && this.selectedChips.includes(chipId.toString())) {
                this.addSelectedStyles(chip.el.nativeElement);
                this.applyFilter(null, chip.euimChipSelectorAll, this.selectedChips);
                this.filterData.emit(this.filteredData);
            }
            if (this.selectedChips.length === 0 && chip.euimChipSelectorAll) {
                this.addSelectedStyles(chip.el.nativeElement);
                this.selectedChips = ['0'];
                this.filterData.emit(this.sourceData);
            }
            if (this.isCustomMode && this.selectedChips.length === 0) {
                this.filterData.emit(this.sourceData);
            }
        });
        if (isEmitEvent !== false) {
            this.clickItems.emit(this.selectedChips);
        }
    }
    onFilterChange(filterCondition, isFilterAll, item) {
        if (this.isMultiSelectionMode) {
            this.handleMultiSelectionMode(filterCondition, isFilterAll, item);
        }
        else {
            this.handleSingleSelectionMode(filterCondition, isFilterAll, item);
        }
        this.applyFilter(filterCondition, isFilterAll, this.filterConditions);
        this.filterData.emit(this.filteredData);
    }
    // eslint-disable-next-line @typescript-eslint/no-explicit-any
    handleChange(event) {
        this.searchInput = event.detail.value.toLowerCase();
        let filteredData = [...this.sourceData];
        if (this.euimKeepSelection) {
            filteredData = this.filterByChips(filteredData, this.selectedChips);
            filteredData = this.filterBySearch(filteredData, this.searchInput);
        }
        else {
            filteredData = this.filterBySearch(filteredData, this.searchInput);
        }
        this.filteredData = filteredData;
        this.filterData.emit(this.filteredData);
    }
    addSelectedStyles(item) {
        item.classList.add(`euim-chip-selector__item-selected--color-${this.chipSelectedColor}`);
        item.setAttribute('selected', 'true');
    }
    removeSelectedStyles(item) {
        item.classList.remove(`euim-chip-selector__item-selected--color-${this.chipSelectedColor}`);
        item.removeAttribute('selected');
    }
    handleMultiSelectionMode(filterCondition, isFilterAll, item) {
        if (!isFilterAll) {
            this.filterConditions = this.selectedChips;
            if (!this.filterConditions.includes(filterCondition)) {
                this.filterConditions.push(filterCondition);
                this.addSelectedStyles(item);
            }
            else if (this.filterConditions.length > 1) {
                this.filterConditions = this.filterConditions.filter(chip => chip !== filterCondition);
                this.removeSelectedStyles(item);
            }
            else if (this.filterConditions.length > 0 && this.isCustomMode) {
                this.filterConditions = this.filterConditions.filter(chip => chip !== filterCondition);
                this.removeSelectedStyles(item);
            }
            this.selectedChips = this.filterConditions.filter(el => el !== '0');
        }
        else {
            this.clearAllSelections();
            this.addSelectedStyles(item);
        }
    }
    handleSingleSelectionMode(filterCondition, isFilterAll, item) {
        const isSelected = this.selectedChips.includes(filterCondition);
        if (isFilterAll) {
            this.selectedChips = ['0'];
        }
        else {
            this.selectedChips = [filterCondition];
        }
        if (this.isCustomMode && isSelected) {
            this.selectedChips = this.selectedChips.filter(chip => chip !== filterCondition);
            this.removeSelectedStyles(item);
        }
    }
    clearAllSelections() {
        this.euimChipSelectorItemComponent.forEach(chip => {
            this.removeSelectedStyles(chip.el.nativeElement);
        });
        this.filterConditions = [];
        this.selectedChips = ['0'];
    }
    filterBySearch(data, searchInput) {
        if (!searchInput)
            return data;
        return data.filter(obj => obj.title.toLowerCase().includes(searchInput));
    }
    filterByChips(data, selectedChips) {
        if (selectedChips[0] === '0' || selectedChips.length === 0)
            return data;
        return data.filter(item => selectedChips.includes(item.filterId));
    }
    filterByCondition(data, filterCondition) {
        if (this.selectedChips.length === 0) {
            return data;
        }
        return data.filter(item => item.filterId === filterCondition);
    }
    filterByMultipleConditions(data, multipleFilterConditions) {
        if (multipleFilterConditions.length === 0)
            return data;
        return data.filter(item => multipleFilterConditions.includes(item.filterId));
    }
    /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: EuimChipSelectorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: EuimChipSelectorComponent, selector: "euim-chip-selector", inputs: { backgroundColor: "backgroundColor", color: "color", chipSelectedColor: "chipSelectedColor", chipFill: "chipFill", sourceData: "sourceData", hasBoxShadow: ["hasBoxShadow", "hasBoxShadow", booleanAttribute], hasNoScrollerX: ["hasNoScrollerX", "hasNoScrollerX", booleanAttribute], hasColorTransparency: ["hasColorTransparency", "hasColorTransparency", booleanAttribute], selectedChips: "selectedChips", isMultiSelectionMode: ["isMultiSelectionMode", "isMultiSelectionMode", booleanAttribute], isCustomMode: ["isCustomMode", "isCustomMode", booleanAttribute], euimKeepSelection: ["euimKeepSelection", "euimKeepSelection", booleanAttribute], hasSearchbar: ["hasSearchbar", "hasSearchbar", booleanAttribute] }, outputs: { filterData: "filterData", clickItems: "clickItems", selectedChipsChange: "selectedChipsChange" }, host: { properties: { "class": "this.cssClasses" } }, queries: [{ propertyName: "euimChipSelectorItemComponent", predicate: EuimChipSelectorItemDirective, descendants: true }], usesOnChanges: true, ngImport: i0, template: "@if (hasSearchbar) {\n    <ion-searchbar (ionInput)=\"handleChange($event)\"\n                   class=\"euim-chip-selector__searchbar\"></ion-searchbar>\n}\n@if (hasNoScrollerX) {\n    <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n} @else {\n    <euim-scroller-x>\n        <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n    </euim-scroller-x>\n}\n\n<ng-template #content>\n    <ng-content></ng-content>\n</ng-template>\n", styles: [".euim-chip-selector{padding:var(--eui-s-xs) 0;display:flex;justify-content:center;flex-direction:column}.euim-chip-selector ion-chip{margin:calc(var(--eui-s-2xs) / 2) var(--eui-s-xs) calc(var(--eui-s-2xs) / 2) 0;padding:0 var(--eui-s-s)}.euim-chip-selector ion-chip:last-of-type{margin-right:0}.euim-chip-selector .euim-scroller-x{padding:var(--eui-s-xs)}.euim-chip-selector ion-searchbar{padding-top:0;padding-bottom:var(--eui-s-s)}@media (min-width: 768px){.euim-chip-selector .euim-scroller-x{flex-wrap:wrap;gap:var(--eui-s-xs)}.euim-chip-selector .euim-scroller-x ion-chip{margin:0}}.euim-chip-selector--has-no-scroller-x{flex-wrap:wrap;gap:var(--eui-s-xs);flex-direction:row;padding:var(--eui-s-xs);justify-content:left}.euim-chip-selector--has-no-scroller-x ion-chip{margin:0}ion-chip.euim-chip-selector__item--has-box-shadow{box-shadow:0 calc(var(--eui-s-2xs) / 2) var(--eui-s-2xs) #0003;margin-bottom:var(--eui-s-2xs)}.euim-chip-selector__item--fill-default,.euim-chip-selector--fill-solid{border:none}.euim-chip-selector__item--fill-outline{background-color:transparent;border-width:1px;border-style:solid}.euim-chip-selector__item--fill-clear{background-color:transparent!important;border:none}.euim-chip-selector__item--fill-outline-solid{border-width:1px;border-style:solid}.euim-chip-selector--background-color-branding{background-color:var(--eui-c-branding)}.euim-chip-selector--background-color-branding .euim-chip-selector__item--color-white.euim-chip-selector__item--fill-outline{color:var(--eui-c-branding-contrast);background-color:transparent;border-color:var(--eui-c-branding-contrast)}.euim-chip-selector--background-color-branding .euim-chip-selector__item--color-white.euim-chip-selector__item--fill-outline ion-icon{color:var(--eui-c-branding-contrast)}.euim-chip-selector--background-color-branding ion-chip.euim-chip-selector__item--fill-outline.euim-chip-selector__item-selected--color-white{background-color:var(--eui-c-branding-contrast);border-color:var(--eui-c-branding-contrast);color:var(--eui-c-branding)}.euim-chip-selector--background-color-branding ion-chip.euim-chip-selector__item--fill-outline.euim-chip-selector__item-selected--color-white ion-icon{color:var(--eui-c-branding)}.euim-chip-selector--background-color-transparent{background-color:transparent}.euim-chip-selector__item--color-success{background-color:var(--eui-c-success-dark);border-color:var(--eui-c-success-dark);color:var(--eui-c-success-dark-contrast)}.euim-chip-selector__item--color-success ion-icon{color:var(--eui-c-success-dark-contrast)}.euim-chip-selector__item--color-success.euim-chip-selector__item--fill-outline{border-color:var(--eui-c-success-dark);background-color:transparent;color:var(--eui-c-success-dark)}.euim-chip-selector__item--color-success.euim-chip-selector__item--fill-outline ion-icon{color:var(--eui-c-success-dark)}.euim-chip-selector__item--color-success.euim-chip-selector__item--fill-outline.euim-chip-selector__item-selected--color-success{background-color:var(--eui-c-success-dark);border-color:var(--eui-c-success-dark);color:var(--eui-c-success-dark-contrast)}.euim-chip-selector__item--color-success.euim-chip-selector__item--fill-outline.euim-chip-selector__item-selected--color-success ion-icon{color:var(--eui-c-success-dark-contrast)}.euim-chip-selector__item--color-warning{background-color:var(--eui-c-warning);border-color:var(--eui-c-warning);color:var(--eui-c-warning-contrast)}.euim-chip-selector__item--color-warning ion-icon{color:var(--eui-c-warning-contrast)}.euim-chip-selector__item--color-warning.euim-chip-selector__item--fill-outline{border-color:var(--eui-c-warning);background-color:transparent;color:var(--eui-c-warning)}.euim-chip-selector__item--color-warning.euim-chip-selector__item--fill-outline ion-icon{color:var(--eui-c-warning)}.euim-chip-selector__item--color-warning.euim-chip-selector__item--fill-outline.euim-chip-selector__item-selected--color-warning{background-color:var(--eui-c-warning);border-color:var(--eui-c-warning);color:var(--eui-c-warning-contrast)}.euim-chip-selector__item--color-warning.euim-chip-selector__item--fill-outline.euim-chip-selector__item-selected--color-warning ion-icon{color:var(--eui-c-warning-contrast)}.euim-chip-selector__item--color-danger{background-color:var(--eui-c-danger-dark);border-color:var(--eui-c-danger-dark);color:var(--eui-c-danger-dark-contrast)}.euim-chip-selector__item--color-danger ion-icon{color:var(--eui-c-danger-dark-contrast)}.euim-chip-selector__item--color-danger.euim-chip-selector__item--fill-outline{border-color:var(--eui-c-danger-dark);background-color:transparent;color:var(--eui-c-danger-dark)}.euim-chip-selector__item--color-danger.euim-chip-selector__item--fill-outline ion-icon{color:var(--eui-c-danger-dark)}.euim-chip-selector__item--color-danger.euim-chip-selector__item--fill-outline.euim-chip-selector__item-selected--color-danger{background-color:var(--eui-c-danger-dark);border-color:var(--eui-c-danger-dark);color:var(--eui-c-danger-dark-contrast)}.euim-chip-selector__item--color-danger.euim-chip-selector__item--fill-outline.euim-chip-selector__item-selected--color-danger ion-icon{color:var(--eui-c-danger-dark-contrast)}.euim-chip-selector__item--color-primary{background-color:var(--eui-c-primary);border-color:var(--eui-c-primary);color:var(--eui-c-primary-contrast)}.euim-chip-selector__item--color-primary ion-icon{color:var(--eui-c-primary-contrast)}.euim-chip-selector__item--color-primary.euim-chip-selector__item--fill-outline{border-color:var(--eui-c-primary);background-color:transparent;color:var(--eui-c-primary)}.euim-chip-selector__item--color-primary.euim-chip-selector__item--fill-outline ion-icon{color:var(--eui-c-primary)}.euim-chip-selector__item--color-primary.euim-chip-selector__item--fill-outline.euim-chip-selector__item-selected--color-primary{background-color:var(--eui-c-primary);border-color:var(--eui-c-primary);color:var(--eui-c-primary-contrast)}.euim-chip-selector__item--color-primary.euim-chip-selector__item--fill-outline.euim-chip-selector__item-selected--color-primary ion-icon{color:var(--eui-base-color-white)}.euim-chip-selector__item--color-branding{background-color:var(--eui-c-branding);border-color:var(--eui-c-branding);color:var(--eui-c-branding-contrast)}.euim-chip-selector__item--color-branding ion-icon{color:var(--eui-c-branding-contrast)}.euim-chip-selector__item--color-branding.euim-chip-selector__item--fill-outline{border-color:var(--eui-c-branding);background-color:transparent;color:var(--eui-c-branding)}.euim-chip-selector__item--color-branding.euim-chip-selector__item--fill-outline ion-icon{color:var(--eui-c-branding)}.euim-chip-selector__item--color-branding.euim-chip-selector__item--fill-outline.euim-chip-selector__item-selected--color-branding{background-color:var(--eui-c-branding);border-color:var(--eui-c-branding);color:var(--eui-c-branding-contrast)}.euim-chip-selector__item--color-branding.euim-chip-selector__item--fill-outline.euim-chip-selector__item-selected--color-branding ion-icon{color:var(--eui-c-branding-contrast)}.euim-chip-selector__item--color-info{background-color:var(--eui-c-info);border-color:var(--eui-c-info);color:var(--eui-c-info-contrast)}.euim-chip-selector__item--color-info ion-icon{color:var(--eui-c-info-contrast)}.euim-chip-selector__item--color-info.euim-chip-selector__item--fill-outline{border-color:var(--eui-c-info);background-color:transparent;color:var(--eui-c-info)}.euim-chip-selector__item--color-info.euim-chip-selector__item--fill-outline ion-icon{color:var(--eui-c-info)}.euim-chip-selector__item--color-info.euim-chip-selector__item--fill-outline.euim-chip-selector__item-selected--color-info{background-color:var(--eui-c-info);border-color:var(--eui-c-info);color:var(--eui-c-info-contrast)}.euim-chip-selector__item--color-info.euim-chip-selector__item--fill-outline.euim-chip-selector__item-selected--color-info ion-icon{color:var(--eui-c-info-contrast)}.euim-chip-selector__item--color-dark{background-color:var(--eui-c-neutral);border-color:var(--eui-c-neutral);color:var(--eui-c-neutral-contrast)}.euim-chip-selector__item--color-dark ion-icon{color:var(--eui-c-neutral-contrast)}.euim-chip-selector__item--color-dark.euim-chip-selector__item--fill-outline{border-color:var(--eui-c-neutral);background-color:transparent;color:var(--eui-c-neutral)}.euim-chip-selector__item--color-dark.euim-chip-selector__item--fill-outline ion-icon{color:var(--eui-c-neutral)}.euim-chip-selector__item--color-dark.euim-chip-selector__item--fill-outline.euim-chip-selector__item-selected--color-dark{background-color:var(--eui-c-neutral);border-color:var(--eui-c-neutral);color:var(--eui-c-neutral-min)}.euim-chip-selector__item--color-dark.euim-chip-selector__item--fill-outline.euim-chip-selector__item-selected--color-dark ion-icon{color:var(--eui-c-neutral-min)}.euim-chip-selector__item--color-white{background-color:var(--eui-c-neutral-min);border-color:var(--eui-c-neutral-min);color:var(--eui-c-neutral-max)}.euim-chip-selector__item--color-white ion-icon{color:var(--eui-c-neutral-max)}.euim-chip-selector__item--color-white.euim-chip-selector__item--fill-outline{color:var(--eui-c-neutral-min);background-color:transparent;border-color:var(--eui-c-neutral-min)}.euim-chip-selector__item--color-white.euim-chip-selector__item--fill-outline ion-icon{color:var(--eui-c-neutral-min)}.euim-chip-selector__item--color-white.euim-chip-selector__item--fill-outline.euim-chip-selector__item-selected--color-white{background-color:var(--eui-c-neutral-min);border-color:var(--eui-c-neutral-min);color:var(--eui-c-neutral-max)}.euim-chip-selector__item--color-white.euim-chip-selector__item--fill-outline.euim-chip-selector__item-selected--color-white ion-icon{color:var(--eui-c-neutral-max)}.euim-chip-selector__item--color-white.euim-chip-selector__item--color-white-with-transparency{background-color:#ffffff30;border-color:transparent;color:var(--eui-c-white)}.euim-chip-selector__item--color-default{background-color:var(--eui-c-neutral-lighter);border-color:var(--eui-c-neutral-lighter);color:var(--eui-c-neutral-light-contrast)}.euim-chip-selector__item--color-default ion-icon{color:var(--eui-c-neutral-light-contrast)}.euim-chip-selector__item--color-default.euim-chip-selector__item--fill-outline{color:var(--eui-c-neutral-lighter);background-color:transparent;border-color:var(--eui-c-neutral-lighter)}.euim-chip-selector__item--color-default.euim-chip-selector__item--fill-outline ion-icon{color:var(--eui-c-neutral-lighter)}ion-chip.euim-chip-selector__item.euim-chip-selector__item-selected--color-branding{background-color:var(--eui-c-branding);border-color:var(--eui-c-branding);color:var(--eui-c-branding-contrast)}ion-chip.euim-chip-selector__item.euim-chip-selector__item-selected--color-branding ion-icon{color:var(--eui-c-branding-contrast)}ion-chip.euim-chip-selector__item.euim-chip-selector__item-selected--color-success{background-color:var(--eui-c-success-dark);border-color:var(--eui-c-success-dark);color:var(--eui-c-success-dark-contrast)}ion-chip.euim-chip-selector__item.euim-chip-selector__item-selected--color-success ion-icon{color:var(--eui-c-success-dark-contrast)}ion-chip.euim-chip-selector__item.euim-chip-selector__item-selected--color-warning{background-color:var(--eui-c-warning);border-color:var(--eui-c-warning);color:var(--eui-c-warning-contrast)}ion-chip.euim-chip-selector__item.euim-chip-selector__item-selected--color-warning ion-icon{color:var(--eui-c-warning-contrast)}ion-chip.euim-chip-selector__item.euim-chip-selector__item-selected--color-danger{background-color:var(--eui-c-danger-dark);border-color:var(--eui-c-danger-dark);color:var(--eui-c-danger-dark-contrast)}ion-chip.euim-chip-selector__item.euim-chip-selector__item-selected--color-danger ion-icon{color:var(--eui-c-danger-dark-contrast)}ion-chip.euim-chip-selector__item.euim-chip-selector__item-selected--color-primary{background-color:var(--eui-c-primary);border-color:var(--eui-c-primary);color:var(--eui-c-primary-contrast)}ion-chip.euim-chip-selector__item.euim-chip-selector__item-selected--color-primary ion-icon{color:var(--eui-base-color-white)}ion-chip.euim-chip-selector__item.euim-chip-selector__item-selected--color-info{background-color:var(--eui-c-info);border-color:var(--eui-c-info);color:var(--eui-c-info-contrast)}ion-chip.euim-chip-selector__item.euim-chip-selector__item-selected--color-info ion-icon{color:var(--eui-c-info-contrast)}ion-chip.euim-chip-selector__item.euim-chip-selector__item-selected--color-dark{background-color:var(--eui-c-neutral);border-color:var(--eui-c-neutral);color:var(--eui-c-neutral-min)}ion-chip.euim-chip-selector__item.euim-chip-selector__item-selected--color-dark ion-icon{color:var(--eui-c-neutral-min)}ion-chip.euim-chip-selector__item.euim-chip-selector__item-selected--color-white{background-color:var(--eui-c-neutral-min);border-color:var(--eui-c-neutral-min);color:var(--eui-c-neutral-max)}ion-chip.euim-chip-selector__item.euim-chip-selector__item-selected--color-white ion-icon{color:var(--eui-c-neutral-max)}\n"], dependencies: [{ kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i2.IonSearchbar, selector: "ion-searchbar", inputs: ["animated", "autocapitalize", "autocomplete", "autocorrect", "cancelButtonIcon", "cancelButtonText", "clearIcon", "color", "debounce", "disabled", "enterkeyhint", "inputmode", "maxlength", "minlength", "mode", "name", "placeholder", "searchIcon", "showCancelButton", "showClearButton", "spellcheck", "type", "value"] }, { kind: "directive", type: i2.TextValueAccessor, selector: "ion-input:not([type=number]),ion-input-otp[type=text],ion-textarea,ion-searchbar" }, { kind: "component", type: i3.EuimScrollerXComponent, selector: "euim-scroller-x" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: EuimChipSelectorComponent, decorators: [{
            type: Component,
            args: [{ selector: 'euim-chip-selector', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (hasSearchbar) {\n    <ion-searchbar (ionInput)=\"handleChange($event)\"\n                   class=\"euim-chip-selector__searchbar\"></ion-searchbar>\n}\n@if (hasNoScrollerX) {\n    <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n} @else {\n    <euim-scroller-x>\n        <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n    </euim-scroller-x>\n}\n\n<ng-template #content>\n    <ng-content></ng-content>\n</ng-template>\n", styles: [".euim-chip-selector{padding:var(--eui-s-xs) 0;display:flex;justify-content:center;flex-direction:column}.euim-chip-selector ion-chip{margin:calc(var(--eui-s-2xs) / 2) var(--eui-s-xs) calc(var(--eui-s-2xs) / 2) 0;padding:0 var(--eui-s-s)}.euim-chip-selector ion-chip:last-of-type{margin-right:0}.euim-chip-selector .euim-scroller-x{padding:var(--eui-s-xs)}.euim-chip-selector ion-searchbar{padding-top:0;padding-bottom:var(--eui-s-s)}@media (min-width: 768px){.euim-chip-selector .euim-scroller-x{flex-wrap:wrap;gap:var(--eui-s-xs)}.euim-chip-selector .euim-scroller-x ion-chip{margin:0}}.euim-chip-selector--has-no-scroller-x{flex-wrap:wrap;gap:var(--eui-s-xs);flex-direction:row;padding:var(--eui-s-xs);justify-content:left}.euim-chip-selector--has-no-scroller-x ion-chip{margin:0}ion-chip.euim-chip-selector__item--has-box-shadow{box-shadow:0 calc(var(--eui-s-2xs) / 2) var(--eui-s-2xs) #0003;margin-bottom:var(--eui-s-2xs)}.euim-chip-selector__item--fill-default,.euim-chip-selector--fill-solid{border:none}.euim-chip-selector__item--fill-outline{background-color:transparent;border-width:1px;border-style:solid}.euim-chip-selector__item--fill-clear{background-color:transparent!important;border:none}.euim-chip-selector__item--fill-outline-solid{border-width:1px;border-style:solid}.euim-chip-selector--background-color-branding{background-color:var(--eui-c-branding)}.euim-chip-selector--background-color-branding .euim-chip-selector__item--color-white.euim-chip-selector__item--fill-outline{color:var(--eui-c-branding-contrast);background-color:transparent;border-color:var(--eui-c-branding-contrast)}.euim-chip-selector--background-color-branding .euim-chip-selector__item--color-white.euim-chip-selector__item--fill-outline ion-icon{color:var(--eui-c-branding-contrast)}.euim-chip-selector--background-color-branding ion-chip.euim-chip-selector__item--fill-outline.euim-chip-selector__item-selected--color-white{background-color:var(--eui-c-branding-contrast);border-color:var(--eui-c-branding-contrast);color:var(--eui-c-branding)}.euim-chip-selector--background-color-branding ion-chip.euim-chip-selector__item--fill-outline.euim-chip-selector__item-selected--color-white ion-icon{color:var(--eui-c-branding)}.euim-chip-selector--background-color-transparent{background-color:transparent}.euim-chip-selector__item--color-success{background-color:var(--eui-c-success-dark);border-color:var(--eui-c-success-dark);color:var(--eui-c-success-dark-contrast)}.euim-chip-selector__item--color-success ion-icon{color:var(--eui-c-success-dark-contrast)}.euim-chip-selector__item--color-success.euim-chip-selector__item--fill-outline{border-color:var(--eui-c-success-dark);background-color:transparent;color:var(--eui-c-success-dark)}.euim-chip-selector__item--color-success.euim-chip-selector__item--fill-outline ion-icon{color:var(--eui-c-success-dark)}.euim-chip-selector__item--color-success.euim-chip-selector__item--fill-outline.euim-chip-selector__item-selected--color-success{background-color:var(--eui-c-success-dark);border-color:var(--eui-c-success-dark);color:var(--eui-c-success-dark-contrast)}.euim-chip-selector__item--color-success.euim-chip-selector__item--fill-outline.euim-chip-selector__item-selected--color-success ion-icon{color:var(--eui-c-success-dark-contrast)}.euim-chip-selector__item--color-warning{background-color:var(--eui-c-warning);border-color:var(--eui-c-warning);color:var(--eui-c-warning-contrast)}.euim-chip-selector__item--color-warning ion-icon{color:var(--eui-c-warning-contrast)}.euim-chip-selector__item--color-warning.euim-chip-selector__item--fill-outline{border-color:var(--eui-c-warning);background-color:transparent;color:var(--eui-c-warning)}.euim-chip-selector__item--color-warning.euim-chip-selector__item--fill-outline ion-icon{color:var(--eui-c-warning)}.euim-chip-selector__item--color-warning.euim-chip-selector__item--fill-outline.euim-chip-selector__item-selected--color-warning{background-color:var(--eui-c-warning);border-color:var(--eui-c-warning);color:var(--eui-c-warning-contrast)}.euim-chip-selector__item--color-warning.euim-chip-selector__item--fill-outline.euim-chip-selector__item-selected--color-warning ion-icon{color:var(--eui-c-warning-contrast)}.euim-chip-selector__item--color-danger{background-color:var(--eui-c-danger-dark);border-color:var(--eui-c-danger-dark);color:var(--eui-c-danger-dark-contrast)}.euim-chip-selector__item--color-danger ion-icon{color:var(--eui-c-danger-dark-contrast)}.euim-chip-selector__item--color-danger.euim-chip-selector__item--fill-outline{border-color:var(--eui-c-danger-dark);background-color:transparent;color:var(--eui-c-danger-dark)}.euim-chip-selector__item--color-danger.euim-chip-selector__item--fill-outline ion-icon{color:var(--eui-c-danger-dark)}.euim-chip-selector__item--color-danger.euim-chip-selector__item--fill-outline.euim-chip-selector__item-selected--color-danger{background-color:var(--eui-c-danger-dark);border-color:var(--eui-c-danger-dark);color:var(--eui-c-danger-dark-contrast)}.euim-chip-selector__item--color-danger.euim-chip-selector__item--fill-outline.euim-chip-selector__item-selected--color-danger ion-icon{color:var(--eui-c-danger-dark-contrast)}.euim-chip-selector__item--color-primary{background-color:var(--eui-c-primary);border-color:var(--eui-c-primary);color:var(--eui-c-primary-contrast)}.euim-chip-selector__item--color-primary ion-icon{color:var(--eui-c-primary-contrast)}.euim-chip-selector__item--color-primary.euim-chip-selector__item--fill-outline{border-color:var(--eui-c-primary);background-color:transparent;color:var(--eui-c-primary)}.euim-chip-selector__item--color-primary.euim-chip-selector__item--fill-outline ion-icon{color:var(--eui-c-primary)}.euim-chip-selector__item--color-primary.euim-chip-selector__item--fill-outline.euim-chip-selector__item-selected--color-primary{background-color:var(--eui-c-primary);border-color:var(--eui-c-primary);color:var(--eui-c-primary-contrast)}.euim-chip-selector__item--color-primary.euim-chip-selector__item--fill-outline.euim-chip-selector__item-selected--color-primary ion-icon{color:var(--eui-base-color-white)}.euim-chip-selector__item--color-branding{background-color:var(--eui-c-branding);border-color:var(--eui-c-branding);color:var(--eui-c-branding-contrast)}.euim-chip-selector__item--color-branding ion-icon{color:var(--eui-c-branding-contrast)}.euim-chip-selector__item--color-branding.euim-chip-selector__item--fill-outline{border-color:var(--eui-c-branding);background-color:transparent;color:var(--eui-c-branding)}.euim-chip-selector__item--color-branding.euim-chip-selector__item--fill-outline ion-icon{color:var(--eui-c-branding)}.euim-chip-selector__item--color-branding.euim-chip-selector__item--fill-outline.euim-chip-selector__item-selected--color-branding{background-color:var(--eui-c-branding);border-color:var(--eui-c-branding);color:var(--eui-c-branding-contrast)}.euim-chip-selector__item--color-branding.euim-chip-selector__item--fill-outline.euim-chip-selector__item-selected--color-branding ion-icon{color:var(--eui-c-branding-contrast)}.euim-chip-selector__item--color-info{background-color:var(--eui-c-info);border-color:var(--eui-c-info);color:var(--eui-c-info-contrast)}.euim-chip-selector__item--color-info ion-icon{color:var(--eui-c-info-contrast)}.euim-chip-selector__item--color-info.euim-chip-selector__item--fill-outline{border-color:var(--eui-c-info);background-color:transparent;color:var(--eui-c-info)}.euim-chip-selector__item--color-info.euim-chip-selector__item--fill-outline ion-icon{color:var(--eui-c-info)}.euim-chip-selector__item--color-info.euim-chip-selector__item--fill-outline.euim-chip-selector__item-selected--color-info{background-color:var(--eui-c-info);border-color:var(--eui-c-info);color:var(--eui-c-info-contrast)}.euim-chip-selector__item--color-info.euim-chip-selector__item--fill-outline.euim-chip-selector__item-selected--color-info ion-icon{color:var(--eui-c-info-contrast)}.euim-chip-selector__item--color-dark{background-color:var(--eui-c-neutral);border-color:var(--eui-c-neutral);color:var(--eui-c-neutral-contrast)}.euim-chip-selector__item--color-dark ion-icon{color:var(--eui-c-neutral-contrast)}.euim-chip-selector__item--color-dark.euim-chip-selector__item--fill-outline{border-color:var(--eui-c-neutral);background-color:transparent;color:var(--eui-c-neutral)}.euim-chip-selector__item--color-dark.euim-chip-selector__item--fill-outline ion-icon{color:var(--eui-c-neutral)}.euim-chip-selector__item--color-dark.euim-chip-selector__item--fill-outline.euim-chip-selector__item-selected--color-dark{background-color:var(--eui-c-neutral);border-color:var(--eui-c-neutral);color:var(--eui-c-neutral-min)}.euim-chip-selector__item--color-dark.euim-chip-selector__item--fill-outline.euim-chip-selector__item-selected--color-dark ion-icon{color:var(--eui-c-neutral-min)}.euim-chip-selector__item--color-white{background-color:var(--eui-c-neutral-min);border-color:var(--eui-c-neutral-min);color:var(--eui-c-neutral-max)}.euim-chip-selector__item--color-white ion-icon{color:var(--eui-c-neutral-max)}.euim-chip-selector__item--color-white.euim-chip-selector__item--fill-outline{color:var(--eui-c-neutral-min);background-color:transparent;border-color:var(--eui-c-neutral-min)}.euim-chip-selector__item--color-white.euim-chip-selector__item--fill-outline ion-icon{color:var(--eui-c-neutral-min)}.euim-chip-selector__item--color-white.euim-chip-selector__item--fill-outline.euim-chip-selector__item-selected--color-white{background-color:var(--eui-c-neutral-min);border-color:var(--eui-c-neutral-min);color:var(--eui-c-neutral-max)}.euim-chip-selector__item--color-white.euim-chip-selector__item--fill-outline.euim-chip-selector__item-selected--color-white ion-icon{color:var(--eui-c-neutral-max)}.euim-chip-selector__item--color-white.euim-chip-selector__item--color-white-with-transparency{background-color:#ffffff30;border-color:transparent;color:var(--eui-c-white)}.euim-chip-selector__item--color-default{background-color:var(--eui-c-neutral-lighter);border-color:var(--eui-c-neutral-lighter);color:var(--eui-c-neutral-light-contrast)}.euim-chip-selector__item--color-default ion-icon{color:var(--eui-c-neutral-light-contrast)}.euim-chip-selector__item--color-default.euim-chip-selector__item--fill-outline{color:var(--eui-c-neutral-lighter);background-color:transparent;border-color:var(--eui-c-neutral-lighter)}.euim-chip-selector__item--color-default.euim-chip-selector__item--fill-outline ion-icon{color:var(--eui-c-neutral-lighter)}ion-chip.euim-chip-selector__item.euim-chip-selector__item-selected--color-branding{background-color:var(--eui-c-branding);border-color:var(--eui-c-branding);color:var(--eui-c-branding-contrast)}ion-chip.euim-chip-selector__item.euim-chip-selector__item-selected--color-branding ion-icon{color:var(--eui-c-branding-contrast)}ion-chip.euim-chip-selector__item.euim-chip-selector__item-selected--color-success{background-color:var(--eui-c-success-dark);border-color:var(--eui-c-success-dark);color:var(--eui-c-success-dark-contrast)}ion-chip.euim-chip-selector__item.euim-chip-selector__item-selected--color-success ion-icon{color:var(--eui-c-success-dark-contrast)}ion-chip.euim-chip-selector__item.euim-chip-selector__item-selected--color-warning{background-color:var(--eui-c-warning);border-color:var(--eui-c-warning);color:var(--eui-c-warning-contrast)}ion-chip.euim-chip-selector__item.euim-chip-selector__item-selected--color-warning ion-icon{color:var(--eui-c-warning-contrast)}ion-chip.euim-chip-selector__item.euim-chip-selector__item-selected--color-danger{background-color:var(--eui-c-danger-dark);border-color:var(--eui-c-danger-dark);color:var(--eui-c-danger-dark-contrast)}ion-chip.euim-chip-selector__item.euim-chip-selector__item-selected--color-danger ion-icon{color:var(--eui-c-danger-dark-contrast)}ion-chip.euim-chip-selector__item.euim-chip-selector__item-selected--color-primary{background-color:var(--eui-c-primary);border-color:var(--eui-c-primary);color:var(--eui-c-primary-contrast)}ion-chip.euim-chip-selector__item.euim-chip-selector__item-selected--color-primary ion-icon{color:var(--eui-base-color-white)}ion-chip.euim-chip-selector__item.euim-chip-selector__item-selected--color-info{background-color:var(--eui-c-info);border-color:var(--eui-c-info);color:var(--eui-c-info-contrast)}ion-chip.euim-chip-selector__item.euim-chip-selector__item-selected--color-info ion-icon{color:var(--eui-c-info-contrast)}ion-chip.euim-chip-selector__item.euim-chip-selector__item-selected--color-dark{background-color:var(--eui-c-neutral);border-color:var(--eui-c-neutral);color:var(--eui-c-neutral-min)}ion-chip.euim-chip-selector__item.euim-chip-selector__item-selected--color-dark ion-icon{color:var(--eui-c-neutral-min)}ion-chip.euim-chip-selector__item.euim-chip-selector__item-selected--color-white{background-color:var(--eui-c-neutral-min);border-color:var(--eui-c-neutral-min);color:var(--eui-c-neutral-max)}ion-chip.euim-chip-selector__item.euim-chip-selector__item-selected--color-white ion-icon{color:var(--eui-c-neutral-max)}\n"] }]
        }], propDecorators: { backgroundColor: [{
                type: Input
            }], color: [{
                type: Input
            }], chipSelectedColor: [{
                type: Input
            }], chipFill: [{
                type: Input
            }], sourceData: [{
                type: Input
            }], hasBoxShadow: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], hasNoScrollerX: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], hasColorTransparency: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], selectedChips: [{
                type: Input
            }], isMultiSelectionMode: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], isCustomMode: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], euimKeepSelection: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], hasSearchbar: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], filterData: [{
                type: Output
            }], clickItems: [{
                type: Output
            }], selectedChipsChange: [{
                type: Output
            }], cssClasses: [{
                type: HostBinding,
                args: ['class']
            }], euimChipSelectorItemComponent: [{
                type: ContentChildren,
                args: [EuimChipSelectorItemDirective, { descendants: true }]
            }] } });
//# sourceMappingURL=data:application/json;base64, 