import { Component, Inject } from '@angular/core';
import { MAT_DIALOG_DATA } from '@angular/material/dialog';
import { takeUntil } from 'rxjs/operators';
import { QMSCKEditorBaseComponent } from '../../../qms-ckeditor-base.component';
import * as i0 from "@angular/core";
import * as i1 from "../../../../services/translation-registry.service";
import * as i2 from "@angular/material/dialog";
import * as i3 from "@angular/common";
import * as i4 from "@angular/material/icon";
import * as i5 from "@angular/material/checkbox";
import * as i6 from "@angular/forms";
import * as i7 from "@angular/material/button";
import * as i8 from "../../../../components/button/button";
import * as i9 from "../../../../directives/form.directive";
import * as i10 from "../../../../directives/dialog/dialog.content.directive";
import * as i11 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);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: QMSCKEditorConfirmComponent, deps: [{ token: i1.TranslateLibraryService }, { token: i2.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: QMSCKEditorConfirmComponent, selector: "app-confirm-popup", usesInheritance: true, ngImport: i0, template: "<div qms-dialog-container>\n  <div qms-dialog-header>\n    <h3 class=\"title\">{{ data.title }}</h3>\n    <button type=\"button\" qms-btn-icon color=\"light\" class=\"close-button\" [mat-dialog-close]=\"false\"\n      *ngIf=\"data.isCloseBtn\">\n      <mat-icon>close</mat-icon>\n    </button>\n  </div>\n  <div qms-dialog-content>\n    <div class=\"row\">\n      <div class=\"col-12\">\n        <p [innerHTML]=\"data.content\"></p>\n        <div class=\"section-message\" *ngIf=\"!data.isMessage && data.isAdvance\">\n          <mat-checkbox qms-group-options color=\"default\" [(ngModel)]=\"isNotShowAgain\">\n            <span class=\"text-label\">{{data.checkText}}</span>\n          </mat-checkbox>\n        </div>\n      </div>\n    </div>\n  </div>\n  <div qms-dialog-footer>\n    <div *ngIf=\"data.isMessage\" class=\"row ml-0 mr-0 mt20 ms-0 me-0\">\n      <div class=\"ml-auto mt-auto\">\n        <button type=\"button\" qms-btn class=\"save\" (click)=\"onConfirmClick()\">\n          <mat-icon>check</mat-icon>\n          {{ LANG.QMSCKEDITOR.CONFIRM }}\n        </button>\n      </div>\n    </div>\n    <div *ngIf=\"!data.isMessage\">\n      <div class=\"qmsckeditor confirm__button__groups ml-auto mt-auto\">\n        <button mat-button class=\"cancel\" (click)=\"onCancelClick()\">\n          {{ LANG.QMSCKEDITOR.CANCEL }}\n        </button>\n        <button *ngIf=\"!data.isAdvance\" mat-button class=\"confirm ml3\" (click)=\"onConfirmClick()\">\n          {{ LANG.QMSCKEDITOR.CONFIRM }}\n        </button>\n        <button *ngIf=\"data.isAdvance\" mat-button class=\"confirm ml3\" (click)=\"onAdvanceConfirmClick()\">\n          {{ LANG.QMSCKEDITOR.CONFIRM }}\n        </button>\n      </div>\n    </div>\n  </div>\n</div>", 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-icon{color:#909497}.qmsckeditor__fullscreen{position:fixed;inset:0;background:#fff;overflow-y:auto;max-height:100vh;overflow-x:hidden}.qmsckeditor__cursor{cursor:pointer}.qmsckeditor__notallowed{cursor:not-allowed}.qmsckeditor.button__close{float:right;top:-24px;right:-24px;cursor:pointer}.qmsckeditor.button__done{float:right;top:-24px;right:-24px;cursor:pointer;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 .page-break,.ck-content .ck-horizontal-line{width:100%}.ck-content hr{background:#ccc}.ck-font-size-dropdown .ck-dropdown__panel ul{max-height:320px;overflow-y:auto}.ck-font-size-dropdown .ck-dropdown__panel ul li .ck-fontsize-option .ck-button__label{line-height:50px}.qms-dialog-container{font-family:Open Sans;display:flex;flex-flow:column;min-height:150px;max-height:80vh}.qms-dialog-container .qms-dialog-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;flex:0 1 auto;height:50px}.qms-dialog-container .qms-dialog-content{flex:1 1 auto;overflow-y:auto;overflow-x:hidden;margin:0}.qms-dialog-container .qms-dialog-footer{display:flex;flex-wrap:wrap;min-height:50px;align-items:center;box-sizing:content-box;justify-content:end;margin-top:10px;flex:0 1 auto;height:50px}.qms-dialog-container .qms-dialog-footer.qms-dialog-footer-align-center{justify-content:center}.qms-dialog-container .qms-dialog-footer.qms-dialog-footer-align-start{justify-content:start}.qms-dialog-container .title{margin-bottom:0;margin-left:0;font-weight:600;font-size:22px;color:#323232}.qms-dialog-container .close-button{width:40px;height:40px;line-height:40px}.qms-dialog-container .section-message{display:flex;min-height:40px}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i5.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i7.MatButton, selector: "    button[mat-button], button[mat-raised-button], button[mat-flat-button],    button[mat-stroked-button]  ", exportAs: ["matButton"] }, { kind: "component", type: i8.QMSButton, selector: "button[qms-btn], button[qms-btn-lg], button[qms-btn-outlined],\n               button[qms-btn-outlined-lg], button[qms-btn-text], button[qms-btn-text-lg],\n               button[qms-btn-fab],button[qms-btn-fab-sm],button[qms-btn-fab-ext],\n               button[qms-btn-fab-outlined],button[qms-btn-fab-outlined-sm],button[qms-btn-fab-outlined-ext]", inputs: ["disabled", "color"], exportAs: ["qmsButton"] }, { kind: "component", type: i8.QMSButtonIcon, selector: "button[qms-btn-icon]", inputs: ["disabled", "color", "active"], exportAs: ["qmsButtonIcon"] }, { kind: "directive", type: i9.QMSGroupOptionDirective, selector: "[qms-group-options]", inputs: ["label"] }, { kind: "directive", type: i9.AutocompleteOffDirective, selector: "[qms-group-options]" }, { kind: "directive", type: i10.QMSDialogContainer, selector: "[qms-dialog-container], qms-dialog-container, [qmsDialogContainer]", inputs: ["min", "max"] }, { kind: "directive", type: i10.QMSDialogHeader, selector: "[qms-dialog-header], qms-dialog-header, [qmsDialogHeader]", inputs: ["height"], exportAs: ["qmsDialogHeader"] }, { kind: "directive", type: i10.QMSDialogContent, selector: "[qms-dialog-content], qms-dialog-content, [qmsDialogContent]" }, { kind: "directive", type: i10.QMSDialogFooter, selector: "[qms-dialog-footer], qms-dialog-footer, [qmsDialogFooter]", inputs: ["align", "height"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: QMSCKEditorConfirmComponent, decorators: [{
            type: Component,
            args: [{ selector: 'app-confirm-popup', template: "<div qms-dialog-container>\n  <div qms-dialog-header>\n    <h3 class=\"title\">{{ data.title }}</h3>\n    <button type=\"button\" qms-btn-icon color=\"light\" class=\"close-button\" [mat-dialog-close]=\"false\"\n      *ngIf=\"data.isCloseBtn\">\n      <mat-icon>close</mat-icon>\n    </button>\n  </div>\n  <div qms-dialog-content>\n    <div class=\"row\">\n      <div class=\"col-12\">\n        <p [innerHTML]=\"data.content\"></p>\n        <div class=\"section-message\" *ngIf=\"!data.isMessage && data.isAdvance\">\n          <mat-checkbox qms-group-options color=\"default\" [(ngModel)]=\"isNotShowAgain\">\n            <span class=\"text-label\">{{data.checkText}}</span>\n          </mat-checkbox>\n        </div>\n      </div>\n    </div>\n  </div>\n  <div qms-dialog-footer>\n    <div *ngIf=\"data.isMessage\" class=\"row ml-0 mr-0 mt20 ms-0 me-0\">\n      <div class=\"ml-auto mt-auto\">\n        <button type=\"button\" qms-btn class=\"save\" (click)=\"onConfirmClick()\">\n          <mat-icon>check</mat-icon>\n          {{ LANG.QMSCKEDITOR.CONFIRM }}\n        </button>\n      </div>\n    </div>\n    <div *ngIf=\"!data.isMessage\">\n      <div class=\"qmsckeditor confirm__button__groups ml-auto mt-auto\">\n        <button mat-button class=\"cancel\" (click)=\"onCancelClick()\">\n          {{ LANG.QMSCKEDITOR.CANCEL }}\n        </button>\n        <button *ngIf=\"!data.isAdvance\" mat-button class=\"confirm ml3\" (click)=\"onConfirmClick()\">\n          {{ LANG.QMSCKEDITOR.CONFIRM }}\n        </button>\n        <button *ngIf=\"data.isAdvance\" mat-button class=\"confirm ml3\" (click)=\"onAdvanceConfirmClick()\">\n          {{ LANG.QMSCKEDITOR.CONFIRM }}\n        </button>\n      </div>\n    </div>\n  </div>\n</div>", 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-icon{color:#909497}.qmsckeditor__fullscreen{position:fixed;inset:0;background:#fff;overflow-y:auto;max-height:100vh;overflow-x:hidden}.qmsckeditor__cursor{cursor:pointer}.qmsckeditor__notallowed{cursor:not-allowed}.qmsckeditor.button__close{float:right;top:-24px;right:-24px;cursor:pointer}.qmsckeditor.button__done{float:right;top:-24px;right:-24px;cursor:pointer;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 .page-break,.ck-content .ck-horizontal-line{width:100%}.ck-content hr{background:#ccc}.ck-font-size-dropdown .ck-dropdown__panel ul{max-height:320px;overflow-y:auto}.ck-font-size-dropdown .ck-dropdown__panel ul li .ck-fontsize-option .ck-button__label{line-height:50px}.qms-dialog-container{font-family:Open Sans;display:flex;flex-flow:column;min-height:150px;max-height:80vh}.qms-dialog-container .qms-dialog-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;flex:0 1 auto;height:50px}.qms-dialog-container .qms-dialog-content{flex:1 1 auto;overflow-y:auto;overflow-x:hidden;margin:0}.qms-dialog-container .qms-dialog-footer{display:flex;flex-wrap:wrap;min-height:50px;align-items:center;box-sizing:content-box;justify-content:end;margin-top:10px;flex:0 1 auto;height:50px}.qms-dialog-container .qms-dialog-footer.qms-dialog-footer-align-center{justify-content:center}.qms-dialog-container .qms-dialog-footer.qms-dialog-footer-align-start{justify-content:start}.qms-dialog-container .title{margin-bottom:0;margin-left:0;font-weight:600;font-size:22px;color:#323232}.qms-dialog-container .close-button{width:40px;height:40px;line-height:40px}.qms-dialog-container .section-message{display:flex;min-height:40px}\n"] }]
        }], ctorParameters: () => [{ type: i1.TranslateLibraryService }, { type: i2.MatDialogRef }, { type: i11.QMSCKEditorDialogData, decorators: [{
                    type: Inject,
                    args: [MAT_DIALOG_DATA]
                }] }] });
//# sourceMappingURL=data:application/json;base64, 