/**
 * @fileoverview added by tsickle
 * Generated from: lib/fhir/decourse/details/decourse-details.component.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
import * as tslib_1 from "tslib";
import { Component } from '@angular/core';
import { AlertDecourseDetailsComponent } from '../../../shared/abstracts/alert-decourse-details/alert-decourse-details.component';
var DecourseDetailsComponent = /** @class */ (function (_super) {
    tslib_1.__extends(DecourseDetailsComponent, _super);
    function DecourseDetailsComponent() {
        return _super.call(this) || this;
    }
    /**
     * @return {?}
     */
    DecourseDetailsComponent.prototype.ngOnInit = /**
     * @return {?}
     */
    function () { _super.prototype.ngOnInit.call(this); };
    /**
     * @param {?} comment
     * @return {?}
     */
    DecourseDetailsComponent.prototype.onCallSaveComment = /**
     * @param {?} comment
     * @return {?}
     */
    function (comment) {
        this.inData.note.push(comment);
        this.callCommentSaveAndUpdate.emit(this.inData);
    };
    /**
     * @param {?} comment
     * @return {?}
     */
    DecourseDetailsComponent.prototype.onCallUpdateComment = /**
     * @param {?} comment
     * @return {?}
     */
    function (comment) {
        this.inData.note[this.commentUpdateId] = comment;
        this.callCommentSaveAndUpdate.emit(this.inData);
    };
    /**
     * @return {?}
     */
    DecourseDetailsComponent.prototype.onCallCancelComment = /**
     * @return {?}
     */
    function () { this.callCancelComment.emit(); };
    /**
     * @param {?} comment
     * @return {?}
     */
    DecourseDetailsComponent.prototype.onCallCommentMore = /**
     * @param {?} comment
     * @return {?}
     */
    function (comment) {
        this.callCommentMore.emit({
            component: this.inData,
            index: this.inData.note.indexOf(comment)
        });
    };
    /**
     * @return {?}
     */
    DecourseDetailsComponent.prototype.checkForPermission = /**
     * @return {?}
     */
    function () {
        if (this.user && this.user.uid && this.inData && this.inData.recorder && this.inData.recorder.reference) {
            return this.user.uid === this.inData.recorder.reference;
        }
    };
    /**
     * @param {?} index
     * @return {?}
     */
    DecourseDetailsComponent.prototype.getNote = /**
     * @param {?} index
     * @return {?}
     */
    function (index) {
        if (this.inData && this.inData.note && this.inData.note.length > 0) {
            if (index < 0) {
                return this.inData.note.slice(1);
            }
            return this.inData.note[index];
        }
    };
    /**
     * @return {?}
     */
    DecourseDetailsComponent.prototype.getNotesLength = /**
     * @return {?}
     */
    function () { return this.inData.note.length - 1; };
    DecourseDetailsComponent.decorators = [
        { type: Component, args: [{
                    selector: 'inc-decourse-details',
                    template: "<ion-grid>\r\n  <ion-row>\r\n    <ion-col size=\"11\">\r\n      <ion-row>\r\n        <ion-col size=\"12\" style=\"display: flex;\">\r\n          <span>\r\n            {{getNote(0).time || '' | date: 'yyyy.MM.dd HH:mm:ss' }}\r\n          </span>\r\n        </ion-col>\r\n      </ion-row>\r\n    </ion-col>\r\n    <ion-col size=\"1\">\r\n      <ion-buttons *ngIf=\"checkForPermission()\">\r\n        <ion-button (click)=\"more()\">\r\n          <ion-icon name=\"more\"></ion-icon>\r\n        </ion-button>\r\n      </ion-buttons>\r\n    </ion-col>\r\n  </ion-row>\r\n  <ion-row>\r\n    <ion-col size=\"12\">\r\n      {{getNote(0).text || '' | uppercase | translate}}\r\n    </ion-col>\r\n  </ion-row>\r\n  <ion-row class=\"divide\"></ion-row>\r\n  <ion-row>\r\n    <ion-col size=\"12\" class=\"ion-no-padding\">\r\n      <ion-button id=\"decourse-comment-add-button\" fill=\"clear\" (click)=\"commentsSwitcher()\" expand=\"block\">\r\n        <ion-icon [name]=\"iconName\"></ion-icon> &nbsp;\r\n        {{('COMMENT2' | translate) + '&nbsp;'  + '(' + getNotesLength() + ')'}}\r\n      </ion-button>\r\n    </ion-col>\r\n  </ion-row>\r\n  <ion-row class=\"divide\"></ion-row>\r\n  <div *ngIf=\"postIsOpened\">\r\n    <ion-row *ngIf=\"!commentUpdateId\">\r\n      <inc-decourse-comment-add style=\"width: 100%;\" [user]=\"user\" (callSave)=\"onCallSaveComment($event)\">\r\n      </inc-decourse-comment-add>\r\n    </ion-row>\r\n    <div *ngFor=\"let note of getNote(-1); let i = index\">\r\n      <ion-row>\r\n        <ion-col size=\"12\">\r\n          <div *ngIf=\"(i + 1) === commentUpdateId; else notCommentUpdate\">\r\n            <inc-decourse-comment-add [inData]=\"note\" [user]=\"user\" (callUpdate)=\"onCallUpdateComment($event)\"\r\n              (callCancel)=\"onCallCancelComment()\">\r\n            </inc-decourse-comment-add>\r\n          </div>\r\n          <ng-template #notCommentUpdate>\r\n            <inc-alert-comment-details [inData]=\"note\" [user]=\"user\" (callMore)=\"onCallCommentMore($event)\">\r\n            </inc-alert-comment-details>\r\n          </ng-template>\r\n        </ion-col>\r\n      </ion-row>\r\n    </div>\r\n  </div>\r\n</ion-grid>",
                    styles: [""]
                }] }
    ];
    /** @nocollapse */
    DecourseDetailsComponent.ctorParameters = function () { return []; };
    return DecourseDetailsComponent;
}(AlertDecourseDetailsComponent));
export { DecourseDetailsComponent };
//# sourceMappingURL=data:application/json;base64, 