import { __decorate, __param } from "tslib";
import { ChangeDetectionStrategy, Component, Optional, ViewEncapsulation } from '@angular/core';
import { BbDashboard } from '../dashboard/dashboard.component';
import { of } from 'rxjs';
var BbDashboardHeader = /** @class */ (function () {
    function BbDashboardHeader(_parent) {
        this._parent = _parent;
    }
    Object.defineProperty(BbDashboardHeader.prototype, "isSidebarVisible", {
        get: function () {
            return this._parent
                ? this._parent.visibility
                : of(false);
        },
        enumerable: true,
        configurable: true
    });
    BbDashboardHeader.prototype.onToggleSidebarClicked = function () {
        // If the parent exists toggle the sidebar visibility.
        this._parent && this._parent.toggleSidebarVisibility();
    };
    BbDashboardHeader.ctorParameters = function () { return [
        { type: BbDashboard, decorators: [{ type: Optional }] }
    ]; };
    BbDashboardHeader = __decorate([
        Component({
            selector: 'bb-dashboard-header',
            template: "<!--\n    The button that toggles the sidebar.\n-->\n<button (click)=\"onToggleSidebarClicked()\"\n        [class.bb-dashboard-header-button--reversed]=\"isSidebarVisible | async\"\n        class=\"bb-dashboard-header-button\"\n        type=\"button\"\n        tabindex=\"0\"\n        role=\"switch\">\n    <svg xmlns=\"http://www.w3.org/2000/svg\"\n         viewBox=\"0 0 157 109\"\n         width=\"17\"\n         height=\"12\"\n         role=\"img\">\n        <title>\n            Toggle\n        </title>\n        <path fill=\"#fff\"\n              d=\"M82 42V11.2L30 54.5l52 43.3V67h75V42zM9.5 109h-2c-4.1 0-7.5-3.4-7.5-7.5v-94C0 3.4 3.4 0 7.5 0h2C13.6 0 17 3.4 17 7.5v94c0 4.1-3.4 7.5-7.5 7.5z\">\n        </path>\n    </svg>\n</button>\n\n<!--\n    The extra items of the header.\n-->\n<div class=\"bb-dashboard-header-items\">\n    <ng-content></ng-content>\n</div>",
            changeDetection: ChangeDetectionStrategy.OnPush,
            encapsulation: ViewEncapsulation.None,
            preserveWhitespaces: false,
            host: {
                'class': 'bb-dashboard-header'
            },
            styles: [".bb-dashboard-header{z-index:1;width:100%;color:#fff;height:50px;display:-webkit-box;display:-ms-flexbox;display:flex;padding:0 8px;min-height:50px;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:#5b53ff;border-bottom:1px solid #4d46d6}.bb-dashboard-header-button{width:68px;height:34px;border-radius:4px;-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;border:1px solid #4d46d6;background-color:transparent}.bb-dashboard-header-button>svg{height:100%;-webkit-transform:none;-ms-transform:none;transform:none;-webkit-transition:-webkit-transform .2s cubic-bezier(0,0,.2,1);transition:transform .2s cubic-bezier(0,0,.2,1);transition:transform .2s cubic-bezier(0,0,.2,1),-webkit-transform .2s cubic-bezier(0,0,.2,1)}.bb-dashboard-header-button--reversed>svg{-webkit-transform:rotateY(180deg);transform:rotateY(180deg)}.bb-dashboard-header-button:hover{background-color:rgba(0,0,0,.04)}.bb-dashboard-header-button:active{background-color:rgba(0,0,0,.08)}.bb-dashboard-header-items{display:-webkit-box;display:-ms-flexbox;display:flex;margin-left:auto;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bb-dashboard-header-items>:not(:first-child){margin-left:8px}@media only screen and (min-width:768px){.bb-dashboard-header-button>svg{-webkit-transform:rotateY(180deg);transform:rotateY(180deg)}.bb-dashboard-header-button--reversed>svg{-webkit-transform:none;-ms-transform:none;transform:none}}"]
        }),
        __param(0, Optional())
    ], BbDashboardHeader);
    return BbDashboardHeader;
}());
export { BbDashboardHeader };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGFzaGJvYXJkLWhlYWRlci5jb21wb25lbnQuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9AYnJhdm9iaXQvYmItZm91bmRhdGlvbi9kYXNoYm9hcmQvIiwic291cmNlcyI6WyJsaWIvZGFzaGJvYXJkLWhlYWRlci9kYXNoYm9hcmQtaGVhZGVyLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1h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