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, "showSidebarButton", {
        get: function () {
            var _a;
            return !!((_a = this._parent) === null || _a === void 0 ? void 0 : _a.sidebar);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BbDashboardHeader.prototype, "isSidebarVisible", {
        get: function () {
            var _a, _b, _c;
            return (_c = (_b = (_a = this._parent) === null || _a === void 0 ? void 0 : _a.sidebar) === null || _b === void 0 ? void 0 : _b.visibilityChanges) !== null && _c !== void 0 ? _c : of(false);
        },
        enumerable: true,
        configurable: true
    });
    BbDashboardHeader.prototype.onToggleSidebarClicked = function () {
        var _a, _b;
        (_b = (_a = this._parent) === null || _a === void 0 ? void 0 : _a.sidebar) === null || _b === void 0 ? void 0 : _b.toggle();
    };
    BbDashboardHeader.ctorParameters = function () { return [
        { type: BbDashboard, decorators: [{ type: Optional }] }
    ]; };
    BbDashboardHeader = __decorate([
        Component({
            selector: 'bb-dashboard-header',
            template: "<!--\r\n    The button that toggles the sidebar.\r\n-->\r\n<button *ngIf=\"showSidebarButton\"\r\n        (click)=\"onToggleSidebarClicked()\"\r\n        [class.reversed]=\"isSidebarVisible | async\"\r\n        class=\"bb-dashboard-header-button\"\r\n        type=\"button\"\r\n        tabindex=\"0\"\r\n        role=\"switch\">\r\n    <svg xmlns=\"http://www.w3.org/2000/svg\"\r\n         viewBox=\"0 0 157 109\"\r\n         width=\"17\"\r\n         height=\"12\"\r\n         role=\"img\">\r\n        <title>\r\n            Toggle\r\n        </title>\r\n        <path fill=\"#fff\"\r\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\">\r\n        </path>\r\n    </svg>\r\n</button>\r\n\r\n<!--\r\n    The extra items of the header.\r\n-->\r\n<div class=\"bb-dashboard-header-items\">\r\n    <ng-content></ng-content>\r\n</div>\r\n",
            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:-ms-flexbox;display:flex;padding:0 8px;min-height:50px;-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;-ms-flex-align:center;align-items:center;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;border:1px solid #4d46d6;background-color:transparent}.bb-dashboard-header-button>svg{height:100%;-ms-transform:none;transform:none;transition:transform .2s cubic-bezier(0,0,.2,1)}.bb-dashboard-header-button.reversed>svg{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:-ms-flexbox;display:flex;margin-left:auto;-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{transform:rotateY(180deg)}.bb-dashboard-header-button.reversed>svg{-ms-transform:none;transform:none}}"]
        }),
        __param(0, Optional())
    ], BbDashboardHeader);
    return BbDashboardHeader;
}());
export { BbDashboardHeader };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGFzaGJvYXJkLWhlYWRlci5jb21wb25lbnQuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9AYnJhdm9iaXQvYmItZm91bmRhdGlvbi9kYXNoYm9hcmQvIiwic291cmNlcyI6WyJsaWIvZGFzaGJvY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