import { __decorate, __metadata } from "tslib";
import { Component, EventEmitter, Input, Output } from '@angular/core';
import { ActivationStatus } from '../sales-package';
export var ListIndent;
(function (ListIndent) {
    ListIndent["INDENT_ZERO"] = "indent-zero";
    ListIndent["INDENT_ONE"] = "indent-one";
    ListIndent["INDENT_TWO"] = "indent-two";
})(ListIndent || (ListIndent = {}));
var VaPackageDropdownItemComponent = /** @class */ (function () {
    function VaPackageDropdownItemComponent() {
        this.enableDropdown = false;
        this.indent = ListIndent.INDENT_ZERO;
        this.itemToggled = new EventEmitter();
    }
    VaPackageDropdownItemComponent.prototype.ngOnInit = function () {
    };
    VaPackageDropdownItemComponent.prototype.toggleItem = function () {
        this.itemToggled.emit(null);
    };
    VaPackageDropdownItemComponent.prototype.isActivatedStatus = function (status) {
        return status === ActivationStatus.SUCCESS;
    };
    VaPackageDropdownItemComponent.prototype.isWarningStatus = function (status) {
        return status === ActivationStatus.WARNING;
    };
    VaPackageDropdownItemComponent.prototype.isErrorStatus = function (status) {
        return status === ActivationStatus.ERROR;
    };
    __decorate([
        Input(),
        __metadata("design:type", String)
    ], VaPackageDropdownItemComponent.prototype, "title", void 0);
    __decorate([
        Input(),
        __metadata("design:type", String)
    ], VaPackageDropdownItemComponent.prototype, "titleBadge", void 0);
    __decorate([
        Input(),
        __metadata("design:type", String)
    ], VaPackageDropdownItemComponent.prototype, "titleDescriptor", void 0);
    __decorate([
        Input(),
        __metadata("design:type", String)
    ], VaPackageDropdownItemComponent.prototype, "iconUrl", void 0);
    __decorate([
        Input(),
        __metadata("design:type", String)
    ], VaPackageDropdownItemComponent.prototype, "secondaryIconUrl", void 0);
    __decorate([
        Input(),
        __metadata("design:type", String)
    ], VaPackageDropdownItemComponent.prototype, "secondaryIconName", void 0);
    __decorate([
        Input(),
        __metadata("design:type", String)
    ], VaPackageDropdownItemComponent.prototype, "subtitle", void 0);
    __decorate([
        Input(),
        __metadata("design:type", Object)
    ], VaPackageDropdownItemComponent.prototype, "statusItem", void 0);
    __decorate([
        Input(),
        __metadata("design:type", Object)
    ], VaPackageDropdownItemComponent.prototype, "enableDropdown", void 0);
    __decorate([
        Input(),
        __metadata("design:type", Object)
    ], VaPackageDropdownItemComponent.prototype, "indent", void 0);
    __decorate([
        Input(),
        __metadata("design:type", Boolean)
    ], VaPackageDropdownItemComponent.prototype, "toggleValue", void 0);
    __decorate([
        Input(),
        __metadata("design:type", String)
    ], VaPackageDropdownItemComponent.prototype, "description", void 0);
    __decorate([
        Output(),
        __metadata("design:type", EventEmitter)
    ], VaPackageDropdownItemComponent.prototype, "itemToggled", void 0);
    VaPackageDropdownItemComponent = __decorate([
        Component({
            selector: 'va-package-dropdown-item',
            template: "<mat-list-item [ngClass]=\"indent\" class=\"va-dropdown-list-item\">\n  <va-icon *ngIf=\"!secondaryIconUrl && !secondaryIconName; else dualIcon\" mat-list-avatar [name]=\"title\" [iconUrl]=\"iconUrl\" [diameter]=\"40\"></va-icon>\n  <h3 mat-line class=\"va-dropdown-list-item__title\">{{ title }}\n    <va-badge *ngIf=\"titleBadge\" small color=\"blue-solid\" class=\"va-dropdown-list-item__title-badge\">{{ titleBadge }}</va-badge>\n    <span *ngIf=\"titleDescriptor\" class=\"va-dropdown-list-item__title-descriptor\">{{ titleDescriptor }}</span>\n  </h3>\n  <p class=\"package-dropdown-font\" mat-line>{{subtitle}}</p>\n\n  <span *ngIf=\"!statusItem\" class=\"va-dropdown-list-item__layout\">\n    <p class=\"va-dropdown-list-item__layout va-dropdown-list-item__notice\">{{ description }}</p>\n    <ng-container *ngIf=\"enableDropdown; then dropdownButton\"></ng-container>\n  </span>\n\n  <span *ngIf=\"statusItem\" class=\"va-dropdown-list-item__layout va-dropdown-list-item__status\">\n    <div [ngClass]=\"{\n           'activated': isActivatedStatus(statusItem.status),\n           'warning': isWarningStatus(statusItem.status),\n           'error': isErrorStatus(statusItem.status)}\">\n      <mat-icon>{{statusItem.icon}}</mat-icon>\n    </div>\n    <p class=\"va-dropdown-list-item__notice\"\n       [ngClass]=\"{\n        'activated': isActivatedStatus(statusItem.status),\n        'warning': isWarningStatus(statusItem.status),\n        'error': isErrorStatus(statusItem.status)}\">\n      {{ statusItem.text | translate }}\n    </p>\n    <ng-container *ngIf=\"enableDropdown; then dropdownButton\"></ng-container>\n  </span>\n</mat-list-item>\n\n\n<ng-template #dropdownButton>\n  <button *ngIf=\"enableDropdown\" mat-icon-button type=\"button\" (click)=\"toggleItem()\">\n    <mat-icon mat-list-icon\n              class=\"dropdown-icon\"\n              [ngClass]=\"{'dropdown-icon-rotate-up': !toggleValue, 'dropdown-icon-rotate-down': toggleValue}\">\n      keyboard_arrow_down\n    </mat-icon>\n  </button>\n</ng-template>\n\n<ng-template #dualIcon>\n  <div class=\"dual-icon\">\n    <va-icon mat-list-avatar [iconUrl]=\"iconUrl\" [name]=\"title\" [diameter]=\"40\"></va-icon>\n    <va-icon mat-list-avatar class=\"secondary-icon\" [iconUrl]=\"secondaryIconUrl\" [diameter]=\"20\" [name]=\"secondaryIconName\"></va-icon>\n  </div>\n</ng-template>\n",
            styles: [".va-dropdown-list-item{border-bottom:1px solid rgba(0,0,0,.12)}mat-list-item .va-dropdown-list-item__title{font-weight:700}.va-dropdown-list-item__title-badge{padding-bottom:4px}.indent-one{padding-left:30px}.va-dropdown-list-item__title-descriptor{font-size:11px;font-weight:700;font-style:italic}.indent-two{padding-left:30px}.indent-two .mat-list-avatar{margin-left:40px}.dual-icon{position:relative;display:inline-block;order:-1;margin-right:16px}.dual-icon .secondary-icon{position:absolute;border-radius:50%;bottom:-24px;right:-24px}.va-dropdown-list-item__layout{display:flex;flex-direction:row;align-items:center}.va-dropdown-list-item__layout .va-dropdown-list-item__notice{width:-webkit-max-content;width:-moz-max-content;width:max-content;font-style:italic}@media screen and (max-width:500px){.va-dropdown-list-item__layout p{display:none}}.va-dropdown-list-item__layout mat-icon{padding:0}.va-dropdown-list-item__layout button{padding:0;min-width:0}.va-dropdown-list-item__layout button .dropdown-icon{color:rgba(0,0,0,.54)}.va-dropdown-list-item__layout button .dropdown-icon-rotate-down{transform:rotate(180deg);transition:.4s;pointer-events:none}.va-dropdown-list-item__layout button .dropdown-icon-rotate-up{transform:rotate(0);transition:.4s;pointer-events:none}.va-dropdown-list-item__status{display:flex;flex-direction:row;align-items:center}.va-dropdown-list-item__status p{padding-left:6px;font-size:14px;white-space:nowrap}.va-dropdown-list-item__status .activated{color:#4caf50}.va-dropdown-list-item__status .warning{color:#ffa000}.va-dropdown-list-item__status .error{color:#c62828}", ".package-dropdown-font,.product-dropdown-font{color:rgba(0,0,0,.54);font-size:14px;font-weight:400}.package-list-container{border-top:1px solid rgba(0,0,0,.12);padding:0}.package-list-container mat-list{padding:0}.package-dropdown-stencil-display{display:flex;width:100%;flex-grow:1}.package-dropdown-stencil-display va-icon{margin-right:20px}.package-dropdown-stencil-display .stencil-text{width:inherit;display:flex;flex-direction:column;justify-content:center}.package-dropdown-stencil-display .stencil-text .stencil-title{height:32px;width:40%;margin-bottom:5px!important;margin-top:0!important}.package-dropdown-stencil-display .stencil-text .stencil-tagline{height:32px;width:inherit}.product-or-addon-list{background-color:rgba(0,0,0,.04);overflow:hidden}"]
        })
    ], VaPackageDropdownItemComponent);
    return VaPackageDropdownItemComponent;
}());
export { VaPackageDropdownItemComponent };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFja2FnZS1kcm9wZG93bi1pdGVtLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0B2ZW5kYXN0YS9zdG9yZS8iLCJzb3VyY2VzIjpbImxpYi9wYWNrYWdlLWRyb3Bkb3duL3BhY2thZ2UtZHJvcGRvd24taXRlbS9wYWNrYWdlLWRyb3Bkb3duLWl0ZW0uY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFFLFlBQVksRUFBRSxLQUFLLEVBQVUsTUFBTSxFQUFFLE1BQU0sZUFBZSxDQ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