import { Component, Inject, ViewEncapsulation } from "@angular/core";
import { MAT_DIALOG_DATA } from "@angular/material/dialog";
import { Subject } from "rxjs";
import { takeUntil } from "rxjs/operators";
import * as i0 from "@angular/core";
import * as i1 from "@angular/material/dialog";
import * as i2 from "../../services/translation-registry.service";
import * as i3 from "@angular/common";
import * as i4 from "@angular/material/icon";
import * as i5 from "../button/button";
export class UploadErrorData {
}
export class QMSUploadFileErrorDialog {
    constructor(dialogRef, trans, data) {
        this.dialogRef = dialogRef;
        this.trans = trans;
        this.data = data;
        this.ngUnsubscribe = new Subject();
        this.unsupportedFiles = this.data.fileNames;
        this.supportedExtensions = this.data.acceptedExtension;
        this.overLimitFiles = this.data.overLimitFiles;
        this.fileSizeLimit = this.data.fileSizeLimit;
        this.fileSizeLimitUnit = this.data.fileSizeLimitUnit || 'MB';
        this.trans.getLanguageSubject$.pipe(takeUntil(this.ngUnsubscribe)).subscribe((res) => {
            if (res) {
                this.LANG = this.trans.getObjectLang(res);
            }
        });
    }
    ok() {
        this.dialogRef.close(null);
    }
    ngOnDestroy() {
        this.ngUnsubscribe.next();
        this.ngUnsubscribe.complete();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: QMSUploadFileErrorDialog, deps: [{ token: i1.MatDialogRef }, { token: i2.TranslateLibraryService }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: QMSUploadFileErrorDialog, selector: "qms-upload-file-error-dialog", ngImport: i0, template: "<div class=\"upload-file-error-dialog\">\n  <div class=\"upload-file-error-dialog__header\">\n    <span class=\"upload-file-error-dialog__header-title\">\n      {{ LANG.SOME_FILES_WERE_NOT_ADDED }}\n    </span>\n    <button qms-btn-text class=\"upload-file-error-dialog__header-exit\" (click)=\"ok()\">\n      <mat-icon>clear</mat-icon>\n    </button>\n  </div>\n  <mat-dialog-content>\n    <div class=\"upload-file-error-dialog__container\" *ngIf=\"unsupportedFiles && unsupportedFiles.length\">\n      <p><strong>{{LANG.FILES_ARE_NOT_SUPPORTED}}:</strong></p>\n      <ul>\n        <li *ngFor=\"let file of unsupportedFiles\">{{file}}</li>\n      </ul>\n      <p class=\"upload-file-error-dialog__warning\">\n        {{ LANG.SUPPORTED_EXTENSIONS }}: {{ supportedExtensions.join(', ') }}\n      </p>\n    </div>\n    <div class=\"upload-file-error-dialog__container\" *ngIf=\"overLimitFiles && overLimitFiles.length\">\n      <p><strong>{{LANG.FILES_EXCEED_UPLOAD_LIMIT}}:</strong></p>\n      <ul>\n        <li *ngFor=\"let file of overLimitFiles\">{{file}}</li>\n      </ul>\n      <p class=\"upload-file-error-dialog__warning\">\n        {{ LANG.FILE_SIZE_LIMIT }}: {{ fileSizeLimit }} {{fileSizeLimitUnit}}\n      </p>\n    </div>\n  </mat-dialog-content>\n  <mat-dialog-actions align=\"end\">\n    <button qms-btn color=\"primary\" (click)=\"ok()\">\n      <span>Ok</span>\n    </button>\n  </mat-dialog-actions>\n</div>\n", styles: [".upload-file-error-dialog{font-size:1em;font-weight:400;font-family:Open Sans;color:#323232}.upload-file-error-dialog .upload-file-error-dialog__header-title,.upload-file-error-dialog .upload-file-error-dialog__warning{font-weight:600}.upload-file-error-dialog .upload-file-error-dialog__header{display:flex;align-items:center;margin-bottom:1rem}.upload-file-error-dialog .upload-file-error-dialog__header .upload-file-error-dialog__header-title{font-family:Raleway}.upload-file-error-dialog .upload-file-error-dialog__header .upload-file-error-dialog__header-exit{color:#0009;margin-left:auto}.upload-file-error-dialog .upload-file-error-dialog__warning{margin-bottom:.5rem}\n"], dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "component", type: i5.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"] }], encapsulation: i0.ViewEncapsulation.None }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: QMSUploadFileErrorDialog, decorators: [{
            type: Component,
            args: [{ selector: 'qms-upload-file-error-dialog', encapsulation: ViewEncapsulation.None, template: "<div class=\"upload-file-error-dialog\">\n  <div class=\"upload-file-error-dialog__header\">\n    <span class=\"upload-file-error-dialog__header-title\">\n      {{ LANG.SOME_FILES_WERE_NOT_ADDED }}\n    </span>\n    <button qms-btn-text class=\"upload-file-error-dialog__header-exit\" (click)=\"ok()\">\n      <mat-icon>clear</mat-icon>\n    </button>\n  </div>\n  <mat-dialog-content>\n    <div class=\"upload-file-error-dialog__container\" *ngIf=\"unsupportedFiles && unsupportedFiles.length\">\n      <p><strong>{{LANG.FILES_ARE_NOT_SUPPORTED}}:</strong></p>\n      <ul>\n        <li *ngFor=\"let file of unsupportedFiles\">{{file}}</li>\n      </ul>\n      <p class=\"upload-file-error-dialog__warning\">\n        {{ LANG.SUPPORTED_EXTENSIONS }}: {{ supportedExtensions.join(', ') }}\n      </p>\n    </div>\n    <div class=\"upload-file-error-dialog__container\" *ngIf=\"overLimitFiles && overLimitFiles.length\">\n      <p><strong>{{LANG.FILES_EXCEED_UPLOAD_LIMIT}}:</strong></p>\n      <ul>\n        <li *ngFor=\"let file of overLimitFiles\">{{file}}</li>\n      </ul>\n      <p class=\"upload-file-error-dialog__warning\">\n        {{ LANG.FILE_SIZE_LIMIT }}: {{ fileSizeLimit }} {{fileSizeLimitUnit}}\n      </p>\n    </div>\n  </mat-dialog-content>\n  <mat-dialog-actions align=\"end\">\n    <button qms-btn color=\"primary\" (click)=\"ok()\">\n      <span>Ok</span>\n    </button>\n  </mat-dialog-actions>\n</div>\n", styles: [".upload-file-error-dialog{font-size:1em;font-weight:400;font-family:Open Sans;color:#323232}.upload-file-error-dialog .upload-file-error-dialog__header-title,.upload-file-error-dialog .upload-file-error-dialog__warning{font-weight:600}.upload-file-error-dialog .upload-file-error-dialog__header{display:flex;align-items:center;margin-bottom:1rem}.upload-file-error-dialog .upload-file-error-dialog__header .upload-file-error-dialog__header-title{font-family:Raleway}.upload-file-error-dialog .upload-file-error-dialog__header .upload-file-error-dialog__header-exit{color:#0009;margin-left:auto}.upload-file-error-dialog .upload-file-error-dialog__warning{margin-bottom:.5rem}\n"] }]
        }], ctorParameters: () => [{ type: i1.MatDialogRef }, { type: i2.TranslateLibraryService }, { type: UploadErrorData, decorators: [{
                    type: Inject,
                    args: [MAT_DIALOG_DATA]
                }] }] });
//# sourceMappingURL=data:application/json;base64, 