import { Component, EventEmitter, Input, Output } from '@angular/core';
import * as i0 from "@angular/core";
function EventLogComponent_ccd_event_log_table_3_Template(rf, ctx) { if (rf & 1) {
    const _r1 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "ccd-event-log-table", 8);
    i0.ɵɵlistener("onSelect", function EventLogComponent_ccd_event_log_table_3_Template_ccd_event_log_table_onSelect_0_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.select($event)); })("onCaseHistory", function EventLogComponent_ccd_event_log_table_3_Template_ccd_event_log_table_onCaseHistory_0_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.caseHistoryClicked($event)); });
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵproperty("events", ctx_r1.events)("selected", ctx_r1.selected);
} }
function EventLogComponent_ccd_event_log_table_4_Template(rf, ctx) { if (rf & 1) {
    const _r3 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "ccd-event-log-table", 9);
    i0.ɵɵlistener("onSelect", function EventLogComponent_ccd_event_log_table_4_Template_ccd_event_log_table_onSelect_0_listener($event) { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.select($event)); });
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵproperty("events", ctx_r1.events)("selected", ctx_r1.selected);
} }
function EventLogComponent_ccd_event_log_details_7_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "ccd-event-log-details", 10);
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵproperty("event", ctx_r1.selected);
} }
export class EventLogComponent {
    events;
    onCaseHistory = new EventEmitter();
    selected;
    isPartOfCaseTimeline = false;
    ngOnInit() {
        this.selected = this.events[0];
        this.isPartOfCaseTimeline = this.onCaseHistory.observers.length > 0;
    }
    select(event) {
        this.selected = event;
    }
    caseHistoryClicked(eventId) {
        this.onCaseHistory.emit(eventId);
    }
    static ɵfac = function EventLogComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || EventLogComponent)(); };
    static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: EventLogComponent, selectors: [["ccd-event-log"]], inputs: { events: "events" }, outputs: { onCaseHistory: "onCaseHistory" }, decls: 8, vars: 4, consts: [[1, "grid-row"], [1, "column-one-half", "scrollbar"], [3, "ngSwitch"], [3, "events", "selected", "onSelect", "onCaseHistory", 4, "ngSwitchCase"], [3, "events", "selected", "onSelect", 4, "ngSwitchCase"], [1, "column-one-half"], [1, "EventLog-DetailsPanel"], [3, "event", 4, "ngIf"], [3, "onSelect", "onCaseHistory", "events", "selected"], [3, "onSelect", "events", "selected"], [3, "event"]], template: function EventLogComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "div", 0)(1, "div", 1);
            i0.ɵɵelementContainerStart(2, 2);
            i0.ɵɵtemplate(3, EventLogComponent_ccd_event_log_table_3_Template, 1, 2, "ccd-event-log-table", 3)(4, EventLogComponent_ccd_event_log_table_4_Template, 1, 2, "ccd-event-log-table", 4);
            i0.ɵɵelementContainerEnd();
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(5, "div", 5)(6, "div", 6);
            i0.ɵɵtemplate(7, EventLogComponent_ccd_event_log_details_7_Template, 1, 1, "ccd-event-log-details", 7);
            i0.ɵɵelementEnd()()();
        } if (rf & 2) {
            i0.ɵɵadvance(2);
            i0.ɵɵproperty("ngSwitch", ctx.isPartOfCaseTimeline);
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngSwitchCase", true);
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngSwitchCase", false);
            i0.ɵɵadvance(3);
            i0.ɵɵproperty("ngIf", ctx.selected);
        } }, styles: ["@media (max-width: 991px){[class*=col-md][_ngcontent-%COMP%]{margin-bottom:30px}}.column-half[_ngcontent-%COMP%], .column-one-half[_ngcontent-%COMP%]{float:left;width:50%}@media (min-width: 641px){.scrollbar[_ngcontent-%COMP%]{height:70vh;overflow-y:auto}}.EventLog-DetailsPanel[_ngcontent-%COMP%]{border:1px solid #bfc1c3;padding:0 10px 10px;margin-top:20px}"] });
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(EventLogComponent, [{
        type: Component,
        args: [{ selector: 'ccd-event-log', template: "<div class=\"grid-row\">\n  <div class=\"column-one-half scrollbar\">\n    <ng-container [ngSwitch]=\"isPartOfCaseTimeline\">\n      <ccd-event-log-table\n        *ngSwitchCase=\"true\"\n        [events]=\"events\"\n        [selected]=\"selected\"\n        (onSelect)=\"select($event)\"\n        (onCaseHistory)=\"caseHistoryClicked($event)\"\n      ></ccd-event-log-table>\n      <ccd-event-log-table\n        *ngSwitchCase=\"false\"\n        [events]=\"events\"\n        [selected]=\"selected\"\n        (onSelect)=\"select($event)\"\n      ></ccd-event-log-table>\n    </ng-container>\n  </div>\n  <div class=\"column-one-half\">\n    <div class=\"EventLog-DetailsPanel\">\n      <ccd-event-log-details\n        *ngIf=\"selected\"\n        [event]=\"selected\"\n      ></ccd-event-log-details>\n    </div>\n  </div>\n</div>\n", styles: ["@media (max-width: 991px){[class*=col-md]{margin-bottom:30px}}.column-half,.column-one-half{float:left;width:50%}@media (min-width: 641px){.scrollbar{height:70vh;overflow-y:auto}}.EventLog-DetailsPanel{border:1px solid #bfc1c3;padding:0 10px 10px;margin-top:20px}\n"] }]
    }], null, { events: [{
            type: Input
        }], onCaseHistory: [{
            type: Output
        }] }); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(EventLogComponent, { className: "EventLogComponent", filePath: "lib/shared/components/palette/history/event-log/event-log.component.ts", lineNumber: 9 }); })();
//# sourceMappingURL=data:application/json;base64, 