import { Component, EventEmitter, forwardRef, Input, Output } from '@angular/core';
import { NG_VALUE_ACCESSOR } from '@angular/forms';
import { BehaviorSubject, combineLatest } from 'rxjs';
import { debounceTime, distinctUntilChanged, map, shareReplay, switchMap, tap } from 'rxjs/operators';
import { AlarmEventSelectorService } from './alarm-event-selector.service';
import * as i0 from "@angular/core";
import * as i1 from "./alarm-event-selector.service";
import * as i2 from "@c8y/ngx-components";
import * as i3 from "@angular/common";
import * as i4 from "@angular/forms";
import * as i5 from "@c8y/ngx-components/assets-navigator";
import * as i6 from "ngx-bootstrap/collapse";
import * as i7 from "./alarm-event-selector-list-item/alarm-event-selector-list-item.component";
import * as i8 from "./custom-alarm-event-form/custom-alarm-event-form.component";
import * as i9 from "./pipes/includes-alarm.pipe";
export class AlarmEventSelectorComponent {
    constructor(alarmEventSelectorService) {
        this.alarmEventSelectorService = alarmEventSelectorService;
        this.timelineType = 'ALARM';
        this.allowChangingContext = true;
        this.selectedItems = new Array();
        this.allowSearch = true;
        this.groupsSelectable = true;
        this.hideSource = false;
        this.omitProperties = {};
        this.selectionChange = new EventEmitter();
        this.filterString = '';
        this.maxNumberOfItems = 50;
        this.loadingItems$ = new BehaviorSubject(false);
        this.assetSelection = new BehaviorSubject({});
        this.isExpanded = false;
        this.defaultColor = getComputedStyle(document.documentElement).getPropertyValue('--brand-primary') ||
            getComputedStyle(document.documentElement).getPropertyValue('--c8y-brand-primary') ||
            '#1776BF';
        this.filterString$ = new BehaviorSubject('');
    }
    ngOnInit() {
        this.timelineTypeTexts = this.alarmEventSelectorService.timelineTypeTexts(this.timelineType);
        this.setupObservables();
        if (this.contextAsset) {
            this.selectAsset(this.contextAsset);
        }
    }
    itemAdded(item) {
        item.__active = true;
        this.selectedItems = [...this.selectedItems, item];
        this.emitCurrentSelection();
    }
    itemRemoved(alarm) {
        this.selectedItems = this.selectedItems.filter(tmp => tmp.label !== alarm.label ||
            tmp.filters.type !== alarm.filters.type ||
            tmp.__target?.id !== alarm.__target?.id);
        this.emitCurrentSelection();
    }
    assetSelectionChanged(evt) {
        if (evt.items) {
            return this.selectAsset(evt.items.length ? evt.items[0] : evt.items);
        }
        // reset selection
        this.assetSelection.next(null);
    }
    trackByFn(_index, item) {
        return `${item.filters.type}-${item.__target?.id}`;
    }
    filterStringChanged(newValue = '') {
        this.filterString$.next(newValue);
        this.filterString = newValue;
    }
    setLoadingState(state) {
        queueMicrotask(() => this.loadingItems$.next(state));
    }
    setupObservables() {
        this.items$ = this.assetSelection.pipe(tap(() => this.setLoadingState(true)), switchMap((asset) => asset?.id
            ? this.alarmEventSelectorService.getAlarmsOrEvents(asset, this.timelineType)
            : this.alarmEventSelectorService.getItems(this.timelineType)), tap(() => this.setLoadingState(false)), map(items => {
            if (this.omitProperties.color) {
                items.forEach(i => (i.color = this.defaultColor));
            }
            return items;
        }), shareReplay(1));
        this.filterStringChanges$ = this.filterString$.pipe(distinctUntilChanged(), debounceTime(500), shareReplay(1));
        this.filteredItems$ = combineLatest([this.filterStringChanges$, this.items$]).pipe(map(([filterString, items]) => {
            if (!filterString) {
                return items;
            }
            const lowerCaseFilterString = filterString.toLowerCase();
            return items.filter(item => this.includesFilterString(item, lowerCaseFilterString));
        }), map(filtered => filtered.slice(0, this.maxNumberOfItems)));
    }
    selectAsset(asset) {
        this.assetSelection.next(asset);
        this.filterStringChanged();
    }
    emitCurrentSelection() {
        this.selectionChange.emit(this.selectedItems);
    }
    includesFilterString(alarm, lowerCaseFilterString) {
        const label = alarm.label?.toLowerCase();
        if (label && label.includes(lowerCaseFilterString)) {
            return true;
        }
        const type = alarm.filters.type?.toLowerCase();
        if (type && type.includes(lowerCaseFilterString)) {
            return true;
        }
        return false;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AlarmEventSelectorComponent, deps: [{ token: i1.AlarmEventSelectorService }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: AlarmEventSelectorComponent, selector: "c8y-alarm-event-selector", inputs: { timelineType: "timelineType", contextAsset: "contextAsset", allowChangingContext: "allowChangingContext", selectedItems: "selectedItems", allowSearch: "allowSearch", groupsSelectable: "groupsSelectable", hideSource: "hideSource", omitProperties: "omitProperties" }, outputs: { selectionChange: "selectionChange" }, providers: [
            {
                provide: NG_VALUE_ACCESSOR,
                multi: true,
                useExisting: forwardRef(() => AlarmEventSelectorComponent)
            }
        ], ngImport: i0, template: "<div\n  class=\"d-grid grid__row--1 fit-h\"\n  [ngClass]=\"{\n    'grid__col--3-6-3--md': allowChangingContext,\n    'grid__col--8-4--md': !allowChangingContext\n  }\"\n>\n  <div\n    class=\"d-flex d-col p-relative bg-level-1\"\n    *ngIf=\"allowChangingContext\"\n  >\n    <c8y-asset-selector-miller\n      class=\"d-contents\"\n      [(ngModel)]=\"contextAsset\"\n      [asset]=\"contextAsset\"\n      (onSelected)=\"assetSelectionChanged($event)\"\n      [container]=\"''\"\n      [config]=\"{\n        view: 'miller',\n        groupsSelectable: groupsSelectable,\n        columnHeaders: true,\n        showChildDevices: true,\n        showUnassignedDevices: true,\n        singleColumn: true,\n        search: allowSearch,\n        showFilter: true\n      }\"\n    ></c8y-asset-selector-miller>\n  </div>\n  <!-- center column -->\n  <div class=\"inner-scroll bg-component\" data-cy=\"c8y-alarm-event-selector--inner-column\">\n    <ng-template #noDeviceEmptyState>\n      <div class=\"p-16\">\n        <c8y-ui-empty-state\n          [icon]=\"timelineTypeTexts.emptyStateIcon\"\n          [title]=\"timelineTypeTexts.emptyStateTitle | translate\"\n          [subtitle]=\"timelineTypeTexts.assetWithNoItemsEmptyStateSubtitle | translate\"\n          [horizontal]=\"true\"\n        ></c8y-ui-empty-state>\n      </div>\n    </ng-template>\n\n    <ng-template #loadingData>\n      <div class=\"p-16 text-center\">\n        <c8y-loading></c8y-loading>\n      </div>\n    </ng-template>\n\n    <div\n      class=\"bg-inherit\"\n      *ngIf=\"assetSelection | async as asset; else noDeviceEmptyState\"\n    >\n      <div class=\"p-l-16 p-r-16 p-t-8 p-b-8 sticky-top bg-inherit separator-bottom\">\n        <p\n          class=\"text-medium text-truncate\"\n          [title]=\"timelineTypeTexts.availableItemsTitle | translate\"\n        >\n          {{ timelineTypeTexts.availableItemsTitle | translate }}\n        </p>\n        <div class=\"d-flex\">\n          <div\n            class=\"input-group input-group-search m-t-4\"\n            id=\"search\"\n            *ngIf=\"!(loadingItems$ | async)\"\n          >\n            <input\n              class=\"form-control\"\n              placeholder=\"Filter\u2026\"\n              type=\"search\"\n              [ngModel]=\"filterString\"\n              (ngModelChange)=\"filterStringChanged($event)\"\n            />\n            <span class=\"input-group-addon\">\n              <i\n                c8yIcon=\"search\"\n                *ngIf=\"!filterString; else clearFilterString\"\n              ></i>\n              <ng-template #clearFilterString>\n                <i\n                  class=\"text-muted\"\n                  c8yIcon=\"times\"\n                  *ngIf=\"filterString\"\n                  (click)=\"filterStringChanged()\"\n                ></i>\n              </ng-template>\n            </span>\n          </div>\n        </div>\n      </div>\n\n      <ng-container *ngIf=\"filteredItems$ | async as filteredItems; else loadingData\">\n        <ng-container *ngIf=\"!(loadingItems$ | async); else loadingData\">\n          <ng-container *ngIf=\"items$ | async as items\">\n            <div class=\"p-16 bg-level-2 separator-bottom\">\n              <div>\n                <p>\n                  <i\n                    class=\"text-info m-r-4\"\n                    c8yIcon=\"info-circle\"\n                  ></i>\n                  <strong>{{ timelineTypeTexts.recentItemsWarningTitle | translate }}</strong>\n                </p>\n                <p>\n                  {{ timelineTypeTexts.recentItemsWarningText | translate }}\n                  {{ timelineTypeTexts.addCustomText | translate }}\n                </p>\n              </div>\n              <div class=\"p-t-16\">\n                <button\n                  class=\"btn btn-default btn-sm\"\n                  aria-controls=\"collapseCustomItemForm\"\n                  [attr.aria-expanded]=\"isExpanded\"\n                  (click)=\"isExpanded = !isExpanded\"\n                >\n                  {{ timelineTypeTexts.addCustomItemButtonLabel | translate }}\n                </button>\n                <div\n                  class=\"collapse\"\n                  id=\"collapseCustomItemForm\"\n                  [collapse]=\"!isExpanded\"\n                  [isAnimated]=\"true\"\n                >\n                  <div [style.min-height]=\"'230px'\">\n                    <c8y-custom-alarm-event-form\n                      class=\"d-block\"\n                      *ngIf=\"isExpanded\"\n                      [timelineType]=\"timelineType\"\n                      [target]=\"assetSelection | async\"\n                      [omitProperties]=\"omitProperties\"\n                      [defaultColor]=\"defaultColor\"\n                      (added)=\"itemAdded($event); isExpanded = false\"\n                      (cancel)=\"isExpanded = false\"\n                      [selectedItems]=\"selectedItems\"\n                    ></c8y-custom-alarm-event-form>\n                  </div>\n                </div>\n              </div>\n            </div>\n\n            <div\n              class=\"p-16\"\n              *ngIf=\"!filteredItems.length\"\n            >\n              <c8y-ui-empty-state\n                [icon]=\"timelineTypeTexts.emptyStateIcon\"\n                [title]=\"timelineTypeTexts.emptyStateTitle | translate\"\n                [subtitle]=\"\n                  items.length\n                    ? ('Try another filter term.' | translate)\n                    : (timelineTypeTexts.assetWithNoItemsEmptyStateSubtitle | translate)\n                \"\n                [horizontal]=\"true\"\n              ></c8y-ui-empty-state>\n            </div>\n\n            <c8y-list-group>\n              <c8y-list-item\n                class=\"sticky-top\"\n                style=\"top: 72px\"\n                *ngIf=\"items.length > maxNumberOfItems && filteredItems.length >= maxNumberOfItems\"\n              >\n                <div class=\"alert alert-warning m-b-0\">\n                  {{ timelineTypeTexts.largeNumberOfItemsInfo | translate }}\n                </div>\n              </c8y-list-item>\n              <c8y-alarm-event-selector-list-item\n                class=\"d-contents\"\n                [ngModel]=\"item\"\n                [isSelected]=\"selectedItems | includesAlarmOrEvent: item\"\n                (added)=\"itemAdded($event)\"\n                (removed)=\"itemRemoved($event)\"\n                [highlightText]=\"filterStringChanges$ | async\"\n                [timelineType]=\"timelineType\"\n                [hideSource]=\"hideSource\"\n                *ngFor=\"let item of filteredItems; trackBy: trackByFn\"\n              ></c8y-alarm-event-selector-list-item>\n            </c8y-list-group>\n          </ng-container>\n        </ng-container>\n      </ng-container>\n    </div>\n  </div>\n\n  <!-- last column  -->\n  <div class=\"inner-scroll bg-level-1\">\n    <p\n      class=\"text-medium m-b-4 p-l-16 p-r-16 p-t-8 p-b-8 separator-bottom sticky-top text-truncate\"\n      [title]=\"timelineTypeTexts.selectedItemsTitle | translate\"\n    >\n      {{ timelineTypeTexts.selectedItemsTitle | translate }}\n    </p>\n    <div class=\"d-flex flex-wrap gap-8 p-l-16 p-r-16 p-b-16\">\n      <c8y-ui-empty-state\n        [icon]=\"timelineTypeTexts.emptyStateIcon\"\n        [title]=\"timelineTypeTexts.noSelectedItemsTitle | translate\"\n        *ngIf=\"!selectedItems || !selectedItems.length\"\n        [horizontal]=\"true\"\n      ></c8y-ui-empty-state>\n\n      <div\n        [ngClass]=\"{\n          'c8y-alarm-pill': timelineType === 'ALARM',\n          'c8y-event-pill': timelineType === 'EVENT'\n        }\"\n        *ngFor=\"let selectedItem of selectedItems\"\n      >\n        <button\n          [title]=\"'Remove' | translate\"\n          type=\"button\"\n          [ngClass]=\"{\n            'c8y-alarm-pill__btn': timelineType === 'ALARM',\n            'c8y-event-pill__btn': timelineType === 'EVENT'\n          }\"\n          (click)=\"itemRemoved(selectedItem)\"\n        >\n          <i\n            class=\"icon-14\"\n            c8yIcon=\"remove\"\n          ></i>\n        </button>\n        <div\n          class=\"c8y-datapoint-pill__label\"\n          [title]=\"selectedItem.label || selectedItem.filters.type\"\n        >\n          <span\n            class=\"circle-icon-wrapper circle-icon-wrapper--small m-r-4\"\n            [style.background-color]=\"selectedItem.color || defaultColor\"\n          >\n            <i\n              class=\"stroked-icon\"\n              [c8yIcon]=\"timelineType === 'ALARM' ? 'bell' : 'c8y-events'\"\n            ></i>\n          </span>\n          <span class=\"text-truncate\">\n            <span class=\"text-truncate\">{{ selectedItem.label || selectedItem.filters.type }}</span>\n            <small\n              class=\"text-muted text-10\"\n              *ngIf=\"!hideSource && selectedItem?.__target?.name\"\n            >\n              {{ selectedItem?.__target?.name }}\n            </small>\n          </span>\n        </div>\n      </div>\n    </div>\n  </div>\n</div>\n", dependencies: [{ kind: "component", type: i2.EmptyStateComponent, selector: "c8y-ui-empty-state", inputs: ["icon", "title", "subtitle", "horizontal"] }, { kind: "directive", type: i2.IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.LoadingComponent, selector: "c8y-loading", inputs: ["layout", "progress", "message"] }, { kind: "directive", type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i2.ListGroupComponent, selector: "c8y-list-group" }, { kind: "component", type: i2.ListItemComponent, selector: "c8y-list-item, c8y-li", inputs: ["active", "highlighted", "emptyActions", "dense", "collapsed", "selectable"], outputs: ["collapsedChange"] }, { kind: "component", type: i5.MillerViewComponent, selector: "c8y-asset-selector-miller", inputs: ["config", "asset", "selectedDevice", "rootNode", "container"], outputs: ["onSelected", "onClearSelected"] }, { kind: "directive", type: i6.CollapseDirective, selector: "[collapse]", inputs: ["display", "isAnimated", "collapse"], outputs: ["collapsed", "collapses", "expanded", "expands"], exportAs: ["bs-collapse"] }, { kind: "component", type: i7.AlarmEventSelectorListItemComponent, selector: "c8y-alarm-event-selector-list-item", inputs: ["timelineType", "datapoints", "highlightText", "showAddRemoveButton", "isSelected", "optionToRemove", "showActiveToggle", "allowItemEdit", "hideSource", "displayAsSwitch", "omitProperties"], outputs: ["added", "removed"] }, { kind: "component", type: i8.CustomAlarmEventFormComponent, selector: "c8y-custom-alarm-event-form", inputs: ["timelineType", "target", "omitProperties", "selectedItems", "defaultColor"], outputs: ["added", "cancel"] }, { kind: "pipe", type: i2.C8yTranslatePipe, name: "translate" }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i9.IncludesAlarmOrEventPipe, name: "includesAlarmOrEvent" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AlarmEventSelectorComponent, decorators: [{
            type: Component,
            args: [{ selector: 'c8y-alarm-event-selector', providers: [
                        {
                            provide: NG_VALUE_ACCESSOR,
                            multi: true,
                            useExisting: forwardRef(() => AlarmEventSelectorComponent)
                        }
                    ], template: "<div\n  class=\"d-grid grid__row--1 fit-h\"\n  [ngClass]=\"{\n    'grid__col--3-6-3--md': allowChangingContext,\n    'grid__col--8-4--md': !allowChangingContext\n  }\"\n>\n  <div\n    class=\"d-flex d-col p-relative bg-level-1\"\n    *ngIf=\"allowChangingContext\"\n  >\n    <c8y-asset-selector-miller\n      class=\"d-contents\"\n      [(ngModel)]=\"contextAsset\"\n      [asset]=\"contextAsset\"\n      (onSelected)=\"assetSelectionChanged($event)\"\n      [container]=\"''\"\n      [config]=\"{\n        view: 'miller',\n        groupsSelectable: groupsSelectable,\n        columnHeaders: true,\n        showChildDevices: true,\n        showUnassignedDevices: true,\n        singleColumn: true,\n        search: allowSearch,\n        showFilter: true\n      }\"\n    ></c8y-asset-selector-miller>\n  </div>\n  <!-- center column -->\n  <div class=\"inner-scroll bg-component\" data-cy=\"c8y-alarm-event-selector--inner-column\">\n    <ng-template #noDeviceEmptyState>\n      <div class=\"p-16\">\n        <c8y-ui-empty-state\n          [icon]=\"timelineTypeTexts.emptyStateIcon\"\n          [title]=\"timelineTypeTexts.emptyStateTitle | translate\"\n          [subtitle]=\"timelineTypeTexts.assetWithNoItemsEmptyStateSubtitle | translate\"\n          [horizontal]=\"true\"\n        ></c8y-ui-empty-state>\n      </div>\n    </ng-template>\n\n    <ng-template #loadingData>\n      <div class=\"p-16 text-center\">\n        <c8y-loading></c8y-loading>\n      </div>\n    </ng-template>\n\n    <div\n      class=\"bg-inherit\"\n      *ngIf=\"assetSelection | async as asset; else noDeviceEmptyState\"\n    >\n      <div class=\"p-l-16 p-r-16 p-t-8 p-b-8 sticky-top bg-inherit separator-bottom\">\n        <p\n          class=\"text-medium text-truncate\"\n          [title]=\"timelineTypeTexts.availableItemsTitle | translate\"\n        >\n          {{ timelineTypeTexts.availableItemsTitle | translate }}\n        </p>\n        <div class=\"d-flex\">\n          <div\n            class=\"input-group input-group-search m-t-4\"\n            id=\"search\"\n            *ngIf=\"!(loadingItems$ | async)\"\n          >\n            <input\n              class=\"form-control\"\n              placeholder=\"Filter\u2026\"\n              type=\"search\"\n              [ngModel]=\"filterString\"\n              (ngModelChange)=\"filterStringChanged($event)\"\n            />\n            <span class=\"input-group-addon\">\n              <i\n                c8yIcon=\"search\"\n                *ngIf=\"!filterString; else clearFilterString\"\n              ></i>\n              <ng-template #clearFilterString>\n                <i\n                  class=\"text-muted\"\n                  c8yIcon=\"times\"\n                  *ngIf=\"filterString\"\n                  (click)=\"filterStringChanged()\"\n                ></i>\n              </ng-template>\n            </span>\n          </div>\n        </div>\n      </div>\n\n      <ng-container *ngIf=\"filteredItems$ | async as filteredItems; else loadingData\">\n        <ng-container *ngIf=\"!(loadingItems$ | async); else loadingData\">\n          <ng-container *ngIf=\"items$ | async as items\">\n            <div class=\"p-16 bg-level-2 separator-bottom\">\n              <div>\n                <p>\n                  <i\n                    class=\"text-info m-r-4\"\n                    c8yIcon=\"info-circle\"\n                  ></i>\n                  <strong>{{ timelineTypeTexts.recentItemsWarningTitle | translate }}</strong>\n                </p>\n                <p>\n                  {{ timelineTypeTexts.recentItemsWarningText | translate }}\n                  {{ timelineTypeTexts.addCustomText | translate }}\n                </p>\n              </div>\n              <div class=\"p-t-16\">\n                <button\n                  class=\"btn btn-default btn-sm\"\n                  aria-controls=\"collapseCustomItemForm\"\n                  [attr.aria-expanded]=\"isExpanded\"\n                  (click)=\"isExpanded = !isExpanded\"\n                >\n                  {{ timelineTypeTexts.addCustomItemButtonLabel | translate }}\n                </button>\n                <div\n                  class=\"collapse\"\n                  id=\"collapseCustomItemForm\"\n                  [collapse]=\"!isExpanded\"\n                  [isAnimated]=\"true\"\n                >\n                  <div [style.min-height]=\"'230px'\">\n                    <c8y-custom-alarm-event-form\n                      class=\"d-block\"\n                      *ngIf=\"isExpanded\"\n                      [timelineType]=\"timelineType\"\n                      [target]=\"assetSelection | async\"\n                      [omitProperties]=\"omitProperties\"\n                      [defaultColor]=\"defaultColor\"\n                      (added)=\"itemAdded($event); isExpanded = false\"\n                      (cancel)=\"isExpanded = false\"\n                      [selectedItems]=\"selectedItems\"\n                    ></c8y-custom-alarm-event-form>\n                  </div>\n                </div>\n              </div>\n            </div>\n\n            <div\n              class=\"p-16\"\n              *ngIf=\"!filteredItems.length\"\n            >\n              <c8y-ui-empty-state\n                [icon]=\"timelineTypeTexts.emptyStateIcon\"\n                [title]=\"timelineTypeTexts.emptyStateTitle | translate\"\n                [subtitle]=\"\n                  items.length\n                    ? ('Try another filter term.' | translate)\n                    : (timelineTypeTexts.assetWithNoItemsEmptyStateSubtitle | translate)\n                \"\n                [horizontal]=\"true\"\n              ></c8y-ui-empty-state>\n            </div>\n\n            <c8y-list-group>\n              <c8y-list-item\n                class=\"sticky-top\"\n                style=\"top: 72px\"\n                *ngIf=\"items.length > maxNumberOfItems && filteredItems.length >= maxNumberOfItems\"\n              >\n                <div class=\"alert alert-warning m-b-0\">\n                  {{ timelineTypeTexts.largeNumberOfItemsInfo | translate }}\n                </div>\n              </c8y-list-item>\n              <c8y-alarm-event-selector-list-item\n                class=\"d-contents\"\n                [ngModel]=\"item\"\n                [isSelected]=\"selectedItems | includesAlarmOrEvent: item\"\n                (added)=\"itemAdded($event)\"\n                (removed)=\"itemRemoved($event)\"\n                [highlightText]=\"filterStringChanges$ | async\"\n                [timelineType]=\"timelineType\"\n                [hideSource]=\"hideSource\"\n                *ngFor=\"let item of filteredItems; trackBy: trackByFn\"\n              ></c8y-alarm-event-selector-list-item>\n            </c8y-list-group>\n          </ng-container>\n        </ng-container>\n      </ng-container>\n    </div>\n  </div>\n\n  <!-- last column  -->\n  <div class=\"inner-scroll bg-level-1\">\n    <p\n      class=\"text-medium m-b-4 p-l-16 p-r-16 p-t-8 p-b-8 separator-bottom sticky-top text-truncate\"\n      [title]=\"timelineTypeTexts.selectedItemsTitle | translate\"\n    >\n      {{ timelineTypeTexts.selectedItemsTitle | translate }}\n    </p>\n    <div class=\"d-flex flex-wrap gap-8 p-l-16 p-r-16 p-b-16\">\n      <c8y-ui-empty-state\n        [icon]=\"timelineTypeTexts.emptyStateIcon\"\n        [title]=\"timelineTypeTexts.noSelectedItemsTitle | translate\"\n        *ngIf=\"!selectedItems || !selectedItems.length\"\n        [horizontal]=\"true\"\n      ></c8y-ui-empty-state>\n\n      <div\n        [ngClass]=\"{\n          'c8y-alarm-pill': timelineType === 'ALARM',\n          'c8y-event-pill': timelineType === 'EVENT'\n        }\"\n        *ngFor=\"let selectedItem of selectedItems\"\n      >\n        <button\n          [title]=\"'Remove' | translate\"\n          type=\"button\"\n          [ngClass]=\"{\n            'c8y-alarm-pill__btn': timelineType === 'ALARM',\n            'c8y-event-pill__btn': timelineType === 'EVENT'\n          }\"\n          (click)=\"itemRemoved(selectedItem)\"\n        >\n          <i\n            class=\"icon-14\"\n            c8yIcon=\"remove\"\n          ></i>\n        </button>\n        <div\n          class=\"c8y-datapoint-pill__label\"\n          [title]=\"selectedItem.label || selectedItem.filters.type\"\n        >\n          <span\n            class=\"circle-icon-wrapper circle-icon-wrapper--small m-r-4\"\n            [style.background-color]=\"selectedItem.color || defaultColor\"\n          >\n            <i\n              class=\"stroked-icon\"\n              [c8yIcon]=\"timelineType === 'ALARM' ? 'bell' : 'c8y-events'\"\n            ></i>\n          </span>\n          <span class=\"text-truncate\">\n            <span class=\"text-truncate\">{{ selectedItem.label || selectedItem.filters.type }}</span>\n            <small\n              class=\"text-muted text-10\"\n              *ngIf=\"!hideSource && selectedItem?.__target?.name\"\n            >\n              {{ selectedItem?.__target?.name }}\n            </small>\n          </span>\n        </div>\n      </div>\n    </div>\n  </div>\n</div>\n" }]
        }], ctorParameters: () => [{ type: i1.AlarmEventSelectorService }], propDecorators: { timelineType: [{
                type: Input
            }], contextAsset: [{
                type: Input
            }], allowChangingContext: [{
                type: Input
            }], selectedItems: [{
                type: Input
            }], allowSearch: [{
                type: Input
            }], groupsSelectable: [{
                type: Input
            }], hideSource: [{
                type: Input
            }], omitProperties: [{
                type: Input
            }], selectionChange: [{
                type: Output
            }] } });
//# sourceMappingURL=data:application/json;base64, 