import { Component, EventEmitter, Inject, Input, Output } from '@angular/core';
import { EvoSidebarCloseTargets } from '../enums/evo-sidebar-close-targets';
import { SidebarInjectionToken } from '../sidebar-injection-token';
import * as i0 from "@angular/core";
import * as i1 from "../../evo-icon/evo-icon.component";
import * as i2 from "@angular/common";
export class EvoSidebarHeaderComponent {
    constructor(sidebar) {
        this.sidebar = sidebar;
        this.back = new EventEmitter();
    }
    ngOnInit() {
        if (!this.sidebar) {
            throw new Error(`EvoSidebarHeaderComponent must be used inside EvoSidebarComponent only!`);
        }
        this.backButton = this.backButton ?? this.sidebar.backButton;
    }
    handleBackClick() {
        this.back.emit();
    }
    closeSidebar() {
        this.sidebar.closeSidebar(EvoSidebarCloseTargets.BUTTON);
    }
}
EvoSidebarHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: EvoSidebarHeaderComponent, deps: [{ token: SidebarInjectionToken }], target: i0.ɵɵFactoryTarget.Component });
EvoSidebarHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: EvoSidebarHeaderComponent, selector: "evo-sidebar-header, [evo-sidebar-header]", inputs: { backButton: "backButton" }, outputs: { back: "back" }, host: { classAttribute: "evo-sidebar__header" }, ngImport: i0, template: "<div class=\"evo-sidebar__back\"\n    *ngIf=\"backButton\"\n    (click)=\"handleBackClick()\">\n    <evo-icon class=\"evo-sidebar__icon\" shape=\"chevron-left\"></evo-icon>\n</div>\n\n<div class=\"evo-sidebar__title\">\n    <ng-content></ng-content>\n</div>\n\n<div class=\"evo-sidebar__close\" (click)=\"closeSidebar()\">\n    <evo-icon class=\"evo-sidebar__icon\" shape=\"close\"></evo-icon>\n</div>\n\n", styles: [":host{display:flex;flex-shrink:0;align-items:flex-start;margin:0 15px;padding:16px 0;border-bottom:solid 1px #C6C6C6}@media (min-width: 768px){:host{padding-top:32px;padding-bottom:16px}}@media (min-width: 992px){:host{margin:0 32px}}.evo-sidebar__title{flex:1;color:#212121;font-weight:700;font-size:24px;font-family:var(--evo-font-secondary);line-height:32px}@media (min-width: 768px){.evo-sidebar__title{font-size:30px;line-height:38px}}.evo-sidebar__close{flex-shrink:0;margin-left:8px;padding:0;color:#231f20;cursor:pointer;transition:opacity .3s}.evo-sidebar__close:hover{opacity:.8}.evo-sidebar__icon{display:block;width:32px;height:32px;vertical-align:bottom;fill:#91b1b8}@media (min-width: 768px){.evo-sidebar__icon{width:36px;height:36px}}.evo-sidebar__back{flex-shrink:0;margin-right:8px;color:#231f20;cursor:pointer;-webkit-user-select:none;user-select:none}\n"], components: [{ type: i1.EvoIconComponent, selector: "evo-icon", inputs: ["shape", "svgWidth", "svgHeight", "svgViewBox"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: EvoSidebarHeaderComponent, decorators: [{
            type: Component,
            args: [{ selector: 'evo-sidebar-header, [evo-sidebar-header]', host: {
                        class: 'evo-sidebar__header',
                    }, template: "<div class=\"evo-sidebar__back\"\n    *ngIf=\"backButton\"\n    (click)=\"handleBackClick()\">\n    <evo-icon class=\"evo-sidebar__icon\" shape=\"chevron-left\"></evo-icon>\n</div>\n\n<div class=\"evo-sidebar__title\">\n    <ng-content></ng-content>\n</div>\n\n<div class=\"evo-sidebar__close\" (click)=\"closeSidebar()\">\n    <evo-icon class=\"evo-sidebar__icon\" shape=\"close\"></evo-icon>\n</div>\n\n", styles: [":host{display:flex;flex-shrink:0;align-items:flex-start;margin:0 15px;padding:16px 0;border-bottom:solid 1px #C6C6C6}@media (min-width: 768px){:host{padding-top:32px;padding-bottom:16px}}@media (min-width: 992px){:host{margin:0 32px}}.evo-sidebar__title{flex:1;color:#212121;font-weight:700;font-size:24px;font-family:var(--evo-font-secondary);line-height:32px}@media (min-width: 768px){.evo-sidebar__title{font-size:30px;line-height:38px}}.evo-sidebar__close{flex-shrink:0;margin-left:8px;padding:0;color:#231f20;cursor:pointer;transition:opacity .3s}.evo-sidebar__close:hover{opacity:.8}.evo-sidebar__icon{display:block;width:32px;height:32px;vertical-align:bottom;fill:#91b1b8}@media (min-width: 768px){.evo-sidebar__icon{width:36px;height:36px}}.evo-sidebar__back{flex-shrink:0;margin-right:8px;color:#231f20;cursor:pointer;-webkit-user-select:none;user-select:none}\n"] }]
        }], ctorParameters: function () { return [{ type: undefined, decorators: [{
                    type: Inject,
                    args: [SidebarInjectionToken]
                }] }]; }, propDecorators: { backButton: [{
                type: Input
            }], back: [{
                type: Output
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXZvLXNpZGViYXItaGVhZGVyLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2V2by11aS1raXQvc3JjL2xpYi9jb21wb25lbnRzL2V2by1zaWRlYmFyL2V2by1zaWRlYmFyLWhlYWRlci9ldm8tc2lkZWJhci1oZWFkZXIuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvZXZvLXVpLWtpdC9zcmMvbGliL2NvbXBvbmVudHMvZXZvLXNpZGViYXIvZXZvLXNpZGViYXItaGVhZGVyL2V2by1zaWRlYmFyLWhlYWRlci5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUMsU0FBUyxFQUFFLFlBQVksRUFBRSxNQUFNLEVBQUUsS0FBSyxFQUFVLE1BQU0sRUFBQyxNQUFNLGVBQWUsQ0FBQztBQUNyRixPQUFPLEVBQUMsc0JBQXNCLEVBQUMsTUFBTSxvQ0FBb0MsQ0FBQztBQUMxRSxPQUFPLEVBQUMscUJBQXFCLEVBQUMsTUFBTSw0QkFBNEIsQ0FBQzs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