import { Component, Inject } from '@angular/core';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { TranslateLibraryService } from '../../../../services/translation-registry.service';
import { takeUntil } from 'rxjs/operators';
import { QMSCKEditorBaseComponent } from '../../../qms-ckeditor-base.component';
import { QMSCKEditorDialogData } from '../../models/qms-ckeditor-dialog.model';
export class QMSCKEditorConfirmComponent extends QMSCKEditorBaseComponent {
    constructor(translate, dialogRef, data) {
        super();
        this.translate = translate;
        this.dialogRef = dialogRef;
        this.data = data;
        this.isNotShowAgain = false;
    }
    ngOnInit() {
        this.translate.getLanguageSubject$.pipe(takeUntil(this.ngUnsubcribe)).subscribe((res) => {
            if (res) {
                this.LANG = this.translate.getObjectLang(res);
            }
        });
    }
    onCancelClick() {
        this.dialogRef.close();
    }
    onConfirmClick() {
        this.dialogRef.close(true);
    }
    onAdvanceConfirmClick() {
        const obj = { isConfirmed: true, isNotShowAgain: this.isNotShowAgain };
        this.dialogRef.close(obj);
    }
}
QMSCKEditorConfirmComponent.decorators = [
    { type: Component, args: [{
                selector: 'app-confirm-popup',
                template: "<div\r\n  id=\"qmsckeditor-confirm\"\r\n  class=\"qmsckeditor qmsckeditor__confirm__container\"\r\n>\r\n  <h2>{{ data.title }}</h2>\r\n  <div class=\"row ml2 mr-0 me-0\" [innerHTML]=\"data.content\"></div>\r\n  <div *ngIf=\"!data.isMessage\" class=\"row ml-0 mr-0 mt20 ms-0 me-0\">\r\n    <div *ngIf=\"data.isAdvance\" class=\"mt-4\">\r\n      <mat-checkbox [(ngModel)]=\"isNotShowAgain\">{{\r\n        data.checkText\r\n      }}</mat-checkbox>\r\n    </div>\r\n    <div class=\"qmsckeditor confirm__button__groups ml-auto mt-auto\">\r\n      <button mat-button class=\"cancel\" (click)=\"onCancelClick()\">\r\n        {{ LANG.QMSCKEDITOR.CANCEL }}\r\n      </button>\r\n      <button\r\n        *ngIf=\"!data.isAdvance\"\r\n        mat-button\r\n        class=\"confirm ml3\"\r\n        (click)=\"onConfirmClick()\"\r\n      >\r\n        {{ LANG.QMSCKEDITOR.CONFIRM }}\r\n      </button>\r\n      <button\r\n        *ngIf=\"data.isAdvance\"\r\n        mat-button\r\n        class=\"confirm ml3\"\r\n        (click)=\"onAdvanceConfirmClick()\"\r\n      >\r\n        {{ LANG.QMSCKEDITOR.CONFIRM }}\r\n      </button>\r\n    </div>\r\n  </div>\r\n  <div *ngIf=\"data.isMessage\" class=\"row ml-0 mr-0 mt20 ms-0 me-0\">\r\n    <div class=\"ml-auto mt-auto\">\r\n      <button mat-button class=\"save ml-3 ms-3\" (click)=\"onConfirmClick()\">\r\n        {{ LANG.QMSCKEDITOR.OK }}\r\n      </button>\r\n    </div>\r\n  </div>\r\n</div>\r\n",
                styles: [".mt5{margin-top:5px!important}.mt10{margin-top:10px!important}.mt7{margin-top:7px!important}.mt15{margin-top:15px!important}.mt20{margin-top:20px!important}.mt30{margin-top:30px!important}.mt40{margin-top:40px!important}.ml2{margin-left:2px!important}.ml3{margin-left:3px!important}.ml5{margin-left:5px!important}.ml15{margin-left:15px!important}.ml10{margin-left:10px!important}.ml12{margin-left:12px!important}.ml16{margin-left:16px!important}.ml-auto{margin-left:auto!important}.ml-25{margin-left:-25px!important}.mr5{margin-right:5px!important}.mr12{margin-right:12px!important}.mr15{margin-right:15px!important}.mb5{margin-bottom:5px!important}.mb10{margin-bottom:10px!important}.mb15{margin-bottom:15px!important}.pt8{padding-top:8px!important}.pt10{padding-top:10px!important}.pt15{padding-top:15px!important}.pt16{padding-top:16px!important}.pl15{padding-left:15px!important}.pl0{padding-left:0!important}.pr0{padding-right:0!important}.pr15{padding-right:15px!important}.fs12{font-size:12px}.fs14{font-size:14px!important}.fs16{font-size:16px!important}.fs22{font-size:22px!important}.fw500{font-weight:500!important}.italic-text{font-style:italic}.display-flex{display:flex}.qmsckeditor{font-family:Roboto,Helvetica Neue,sans-serif;font-size:14px;font-weight:400}.qmsckeditor h2{font-size:20px;font-weight:400}.qmsckeditor .mat-dialog-content{padding:0}.qmsckeditor .mat-icon{color:#909497}.qmsckeditor__fullscreen{position:fixed;top:0;left:0;right:0;bottom:0;background:#fff;overflow-y:auto;max-height:100vh;overflow-x:hidden}.qmsckeditor__cursor{cursor:pointer}.qmsckeditor__notallowed{cursor:not-allowed}.qmsckeditor.button__close,.qmsckeditor.button__done{float:right;top:-24px;right:-24px;cursor:pointer}.qmsckeditor.button__done{margin-right:20px}.qmsckeditor.button__done .mat-icon{color:#28a745;font-weight:700}.qmsckeditor.button__groups button{min-height:40px;width:100%;border-radius:4px;border:1px solid #c5c5c5;font-family:Open Sans;font-weight:600;font-size:14px;letter-spacing:1px;line-height:16px}.qmsckeditor.button__groups .save{background:#f8f9f9}.qmsckeditor.button__groups .save:hover{background:#e5e7e9}.qmsckeditor.button__groups .save:disabled{cursor:not-allowed}.qmsckeditor.button__groups .cancel{background:#f8f9f9}.qmsckeditor.button__groups .cancel:hover{background:#e5e7e9}.qmsckeditor.button__groups .cancel:disabled{cursor:not-allowed}.qmsckeditor.button__groups .delete{background:#f8f9f9}.qmsckeditor.button__groups .delete:hover{background:#e5e7e9}.qmsckeditor.button__groups .delete:disabled{cursor:not-allowed}.qmsckeditor.confirm__button__groups button{min-height:36px;border-radius:4px;width:auto;border:1px solid #c5c5c5;font-family:Open Sans;font-weight:600;font-size:14px;letter-spacing:1px;line-height:16px;padding-left:15px;padding-right:15px}.qmsckeditor.confirm__button__groups .confirm{background:#f8f9f9}.qmsckeditor.confirm__button__groups .confirm:hover{background:#e5e7e9}.qmsckeditor.confirm__button__groups .cancel{background:#f8f9f9}.qmsckeditor.confirm__button__groups .cancel:hover{background:#e5e7e9}.qmsckeditor.template-content.height{min-height:420px;max-height:520px;overflow:auto}.qmsckeditor.template-content.title{margin-left:-9px}.qmsckeditor.link__content.height{min-height:400px;max-height:520px}.qmsckeditor.card{margin-bottom:10px;min-height:60px;box-shadow:none;border:1px solid #e5e5e5}.qmsckeditor.card .title{font-weight:700}.qmsckeditor.card .content{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.qmsckeditor.card .material-icons{font-size:20px}.qmsckeditor.tooltip-content.height{min-height:400px;max-height:472px;overflow:auto}.qmsckeditor.save__as__template.height{height:125px}.ck-content .ck-horizontal-line,.ck-content .page-break{width:100%}.ck-content hr{background:#ccc}"]
            },] }
];
QMSCKEditorConfirmComponent.ctorParameters = () => [
    { type: TranslateLibraryService },
    { type: MatDialogRef },
    { type: QMSCKEditorDialogData, decorators: [{ type: Inject, args: [MAT_DIALOG_DATA,] }] }
];
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicW1zLWNrZWRpdG9yLWNvbmZpcm0uY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvcW1zLWFuZ3VsYXIvc3JjL2xpYi9xbXMtY2tlZGl0b3ItY29tcG9uZW50cy9jb21tb24vbW9kdWxlL2NvbmZpcm0vcW1zLWNrZWRpdG9yLWNvbmZpcm0uY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSxFQUFVLE1BQU0sZUFBZSxDQUFDO0FBQzFELE9BQU8sRUFBRSxZQUFZLEVBQUUsZUFBZSxFQUFFLE1BQU0sMEJBQTBCLENBQUM7QUFDekUsT0FBTyxFQUFFLHVCQUF1QixFQUFFLE1BQU0sbURBQW1ELENBQUM7QUFDNUYsT0FBTyxFQUFFLFNBQVMsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBQzNDLE9BQU8sRUFBRSx3QkFBd0IsRUFBRSxNQUFNLHNDQUFzQyxDQUFDO0FBQ2hGLE9BQU8sRUFBRSxxQkFBcUIsRUFBRSxNQUFNLHdDQUF3QyxDQUFDO0FBTy9FLE1BQU0sT0FBTywyQkFBNEIsU0FBUSx3QkFBd0I7SUFJdkUsWUF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