"use strict";
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
    return function (target, key) { decorator(target, key, paramIndex); }
};
var core_1 = require("@angular/core");
var typescript_angular_utilities_1 = require("typescript-angular-utilities");
var __notification = typescript_angular_utilities_1.services.notification;
var cardContainer_1 = require("../cardContainer");
var form_1 = require("../../form/form");
var async_service_1 = require("../../../services/async/async.service");
var form_service_1 = require("../../../services/form/form.service");
var card_1 = require("./card");
var SelectableCardComponent = SelectableCardComponent_1 = (function (_super) {
    __extends(SelectableCardComponent, _super);
    function SelectableCardComponent(notification, asyncHelper, formService, guidService, parentForm, cardContainer) {
        return _super.call(this, notification, asyncHelper, formService, guidService, parentForm, cardContainer) || this;
    }
    Object.defineProperty(SelectableCardComponent.prototype, "selectableCardContainer", {
        get: function () {
            return this.cardContainer;
        },
        enumerable: true,
        configurable: true
    });
    SelectableCardComponent.prototype.setSelected = function (value) {
        this.selectableCardContainer.setSelected([this.selection], value);
    };
    SelectableCardComponent.prototype.toggleSelected = function () {
        this.setSelected(!this.selection.selected);
    };
    return SelectableCardComponent;
}(card_1.CardComponent));
__decorate([
    core_1.Input(),
    __metadata("design:type", Object)
], SelectableCardComponent.prototype, "selection", void 0);
SelectableCardComponent = SelectableCardComponent_1 = __decorate([
    core_1.Component({
        selector: 'rlSelectableCard',
        template: require('./selectableCard.html'),
        inputs: [card_1.cardInputs.item, card_1.cardInputs.save],
        providers: [
            {
                provide: form_1.FormComponent,
                useExisting: core_1.forwardRef(function () { return SelectableCardComponent_1; }),
            },
            {
                provide: card_1.CardComponent,
                useExisting: core_1.forwardRef(function () { return SelectableCardComponent_1; }),
            },
        ],
        changeDetection: core_1.ChangeDetectionStrategy.OnPush,
    }),
    __param(4, core_1.Optional()), __param(4, core_1.SkipSelf()),
    __param(5, core_1.Inject(core_1.forwardRef(function () { return cardContainer_1.CardContainerComponent; }))),
    __metadata("design:paramtypes", [__notification.NotificationService, async_service_1.AsyncHelper,
        form_service_1.FormService, typescript_angular_utilities_1.services.guid.GuidService, form_1.FormComponent,
        cardContainer_1.CardContainerComponent])
], SelectableCardComponent);
exports.SelectableCardComponent = SelectableCardComponent;
var SelectableCardComponent_1;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VsZWN0YWJsZUNhcmQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJzZWxlY3RhYmxlQ2FyZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSxzQ0FBa0g7QUFHbEgsNkVBQXdEO0FBQ3hELElBQU8sY0FBYyxHQUFHLHVDQUFRLENBQUMsWUFBWSxDQUFDO0FBRTlDLGtEQUEwRDtBQUUxRCx3Q0FBZ0Q7QUFDaEQsdUVBQW9FO0FBQ3BFLG9FQUFrRTtBQUVsRSwrQkFBbUQ7QUFrQm5ELElBQWEsdUJBQXVCO0lBQVksMkNBQWdCO0lBTy9ELGlDQUFZLFlBQWdELEVBQ3pELFdBQXdCLEVBQ3hCLFdBQXdCLEVBQ3hCLFdBQXNDLEVBQ2QsVUFBeUIsRUFDQyxhQU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