/**
 * @license
 * Copyright ASW (A Software World) All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file
 */
import { Component, Inject } from '@angular/core';
import { FormBuilder } from '@angular/forms';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { Constants, Icons } from '@asoftwareworld/form-builder-pro/common';
import * as i0 from "@angular/core";
import * as i1 from "@angular/forms";
import * as i2 from "@angular/material/dialog";
import * as i3 from "@angular/common";
import * as i4 from "@asoftwareworld/form-builder-pro/image-crop";
import * as i5 from "@angular/material/button";
import * as i6 from "@angular/material/button-toggle";
import * as i7 from "@angular/material/card";
import * as i8 from "@angular/material/divider";
import * as i9 from "@angular/material/tooltip";
import * as i10 from "@asoftwareworld/form-builder-pro/core";
import * as i11 from "@asoftwareworld/form-builder-pro/common";
export class AswImageUploadDialog {
    formBuilder;
    dialogRef;
    control;
    icons = Icons;
    constants = Constants;
    aswImageCropForm;
    imageChangedEvent = '';
    croppedImage = '';
    roundCropper = false;
    canvasRotation = 0;
    rotation;
    translateH = 0;
    translateV = 0;
    scale = 1;
    aspectRatio = 1;
    showCropper = false;
    containWithinAspectRatio = false;
    transform = {
        translateUnit: 'px'
    };
    imageURL;
    isImageLoaded = false;
    allowMoveImage = false;
    constructor(formBuilder, dialogRef, control) {
        this.formBuilder = formBuilder;
        this.dialogRef = dialogRef;
        this.control = control;
    }
    ngOnInit() {
        this.validateFormBuilder();
        this.editProperty(this.control);
        this.croppedImage = this.control.imageUrl;
        this.isImageLoaded = this.control.imageUrl ? false : true;
    }
    fileChangeEvent(event) {
        this.isImageLoaded = true;
        this.imageChangedEvent = event;
    }
    removeImage() {
        this.isImageLoaded = true;
        this.imageChangedEvent = null;
    }
    imageCropped(event) {
        Promise.resolve().then(() => (this.croppedImage = event.base64));
    }
    imageLoaded() {
        this.showCropper = true;
    }
    cropperReady(sourceImageDimensions) {
        this.isImageLoaded = false;
    }
    loadImageFailed() {
        console.log('Load failed');
    }
    rotateLeft() {
        this.isImageLoaded = true;
        setTimeout(() => {
            // Use timeout because rotating image is a heavy operation and will block the ui thread
            this.canvasRotation--;
            this.flipAfterRotate();
        });
    }
    rotateRight() {
        this.isImageLoaded = true;
        setTimeout(() => {
            this.canvasRotation++;
            this.flipAfterRotate();
        });
    }
    moveLeft() {
        this.transform = {
            ...this.transform,
            translateH: ++this.translateH
        };
    }
    moveRight() {
        this.transform = {
            ...this.transform,
            translateH: --this.translateH
        };
    }
    moveTop() {
        this.transform = {
            ...this.transform,
            translateV: ++this.translateV
        };
    }
    moveBottom() {
        this.transform = {
            ...this.transform,
            translateV: --this.translateV
        };
    }
    flipAfterRotate() {
        const flippedH = this.transform.flipH;
        const flippedV = this.transform.flipV;
        this.transform = {
            ...this.transform,
            flipH: flippedV,
            flipV: flippedH
        };
        this.translateH = 0;
        this.translateV = 0;
    }
    flipHorizontal() {
        this.transform = {
            ...this.transform,
            flipH: !this.transform.flipH
        };
    }
    flipVertical() {
        this.transform = {
            ...this.transform,
            flipV: !this.transform.flipV
        };
    }
    resetImage() {
        this.scale = 1;
        this.rotation = 0;
        this.canvasRotation = 0;
        this.transform = {
            translateUnit: 'px'
        };
    }
    zoomOut() {
        this.scale -= 0.1;
        this.transform = {
            ...this.transform,
            scale: this.scale
        };
    }
    zoomIn() {
        this.scale += 0.1;
        this.transform = {
            ...this.transform,
            scale: this.scale
        };
    }
    setRoundCropper(isCircle) {
        this.roundCropper = isCircle;
    }
    toggleContainWithinAspectRatio() {
        this.containWithinAspectRatio = !this.containWithinAspectRatio;
    }
    updateRotation() {
        this.transform = {
            ...this.transform,
            rotate: this.rotation
        };
    }
    onNoClick() {
        this.dialogRef.close();
    }
    validateFormBuilder() {
        this.aswImageCropForm = this.formBuilder.group({
            file: [null]
        });
    }
    editProperty(control) {
        if (control.event) {
            this.isImageLoaded = false;
        }
        this.aswImageCropForm.setValue({
            file: control.imageUrl
        });
    }
    onSubmit() {
        if (this.aswImageCropForm.invalid) {
            return;
        }
        this.control.imageUrl = this.croppedImage;
        this.dialogRef.close(this.control);
    }
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: AswImageUploadDialog, deps: [{ token: i1.FormBuilder }, { token: i2.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
    static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: AswImageUploadDialog, selector: "asw-image-upload-dialog", ngImport: i0, template: "<div class=\"asw-dialog-header\">\r\n    <div class=\"asw-edit-row-dialog\">\r\n        <div class=\"asw-dialog-header clearfix\">\r\n            <div class=\"asw-dialog-about\">\r\n                <h1 mat-dialog-title class=\"asw-m-0\">{{'FormControl.Edit' | aswTranslate}} {{control.label}}</h1>\r\n            </div>\r\n        </div>\r\n    </div>\r\n    <button mat-icon-button (click)=\"onNoClick()\" aria-label=\"Close dialog\" class=\"asw-mt-2 asw-me-2\">\r\n        <div [innerHTML]=\"icons.close | aswSafeHtml\"></div>\r\n    </button>\r\n</div>\r\n<mat-divider></mat-divider>\r\n<form [formGroup]=\"aswImageCropForm\" (ngSubmit)=\"onSubmit()\">\r\n    <mat-dialog-content class=\"mat-typography\">\r\n        <div class=\"asw-row asw-p-2\">\r\n            <div class=\"asw-col-md-9\">\r\n                <div class=\"asw-sticky-top\">\r\n                    <mat-card>\r\n                        <mat-card-content>\r\n                            <div class=\"asw-img-crop-area\">\r\n                                <asw-image-crop\r\n                                    [imageChangedEvent]=\"imageChangedEvent\"\r\n                                    [imageURL]=\"imageURL\"\r\n                                    [imageBase64]=\"control.imageUrl\"\r\n                                    [maintainAspectRatio]=\"true\"\r\n                                    [containWithinAspectRatio]=\"containWithinAspectRatio\"\r\n                                    [aspectRatio]=\"aspectRatio\"\r\n                                    [resizeToWidth]=\"500\"\r\n                                    [imageQuality]=\"92\"\r\n                                    [onlyScaleDown]=\"true\"\r\n                                    [roundCropper]=\"roundCropper\"\r\n                                    [canvasRotation]=\"canvasRotation\"\r\n                                    [(transform)]=\"transform\"\r\n                                    [alignImage]=\"'center'\"\r\n                                    [style.display]=\"showCropper ? null : 'none'\"\r\n                                    [allowMoveImage]=\"allowMoveImage\"\r\n                                    format=\"png\"\r\n                                    (imageCropped)=\"imageCropped($event)\"\r\n                                    (imageLoaded)=\"imageLoaded()\"\r\n                                    (cropperReady)=\"cropperReady($event)\"\r\n                                    (loadImageFailed)=\"loadImageFailed()\">\r\n                                </asw-image-crop>\r\n                            </div>\r\n                        </mat-card-content>\r\n                    </mat-card>\r\n                </div>\r\n            </div>\r\n            <div class=\"asw-col-md-3\">\r\n                <mat-card>\r\n                    <mat-card-content>\r\n                        <div class=\"asw-row\">\r\n                            <div class=\"asw-col-md-12 asw-d-grid\">\r\n                                <button class=\"asw-button asw-button-primary\" type=\"button\"\r\n                                    (click)=\"fileInput.click()\"\r\n                                    matTooltip=\"{{'FormControl.LoadImage' | aswTranslate}}\" \r\n                                    *ngIf=\"isImageLoaded\">\r\n                                    <input style=\"display: none\" \r\n                                        type=\"file\" \r\n                                        #fileInput \r\n                                        (change)=\"fileChangeEvent($event)\"\r\n                                        id=\"imageUpload\" \r\n                                        accept=\".png, .jpg, .jpeg\">\r\n                                    {{'FormControl.LoadImage' | aswTranslate}}\r\n                                </button>\r\n                                <button class=\"asw-button asw-button-primary\" type=\"button\"\r\n                                        matTooltip=\"{{'FormControl.RemoveImage' | aswTranslate}}\"\r\n                                        *ngIf=\"!isImageLoaded\" \r\n                                        (click)=\"removeImage()\">\r\n                                    {{'FormControl.RemoveImage' | aswTranslate}}\r\n                                </button>\r\n                            </div>\r\n                        </div>\r\n                        <h6 class=\"asw-fs-6 asw-my-2\">{{'FormControl.CropType' | aswTranslate}}:</h6>\r\n                        <div class=\"asw-pb-2\">\r\n                            <mat-button-toggle-group class=\"asw-width-100\">\r\n                                <mat-button-toggle matTooltip=\"{{'FormControl.Square' | aswTranslate}}\"\r\n                                        [disabled]=\"isImageLoaded\"\r\n                                        class=\"asw-width-100\" \r\n                                        (change)=\"setRoundCropper(false)\">\r\n                                    {{'FormControl.Square' | aswTranslate}}\r\n                                </mat-button-toggle>\r\n                                <mat-button-toggle matTooltip=\"{{'FormControl.Circle' | aswTranslate}}\"\r\n                                        [disabled]=\"isImageLoaded\"\r\n                                        class=\"asw-width-100\"\r\n                                        (change)=\"setRoundCropper(true)\">\r\n                                    {{'FormControl.Circle' | aswTranslate}}\r\n                                </mat-button-toggle>\r\n                            </mat-button-toggle-group>\r\n                        </div>\r\n                        <div class=\"asw-pb-2\">\r\n                            <mat-button-toggle-group  class=\"asw-width-100\">\r\n                                <mat-button-toggle matTooltip=\"{{(containWithinAspectRatio?'FormControl.FillAspectRatio':'FormControl.ContainWithinAspectRatio') | aswTranslate}}\"\r\n                                        [disabled]=\"isImageLoaded\" \r\n                                        class=\"asw-width-100\"\r\n                                        (change)=\"toggleContainWithinAspectRatio()\">\r\n                                    {{(containWithinAspectRatio?'FormControl.FillAspectRatio':'FormControl.ContainWithinAspectRatio') | aswTranslate}}\r\n                                </mat-button-toggle>\r\n                            </mat-button-toggle-group>\r\n                        </div>\r\n                        <mat-button-toggle-group class=\"asw-width-100\">\r\n                            <mat-button-toggle matTooltip=\"{{'FormControl.SwapHorizontal' | aswTranslate}}\"\r\n                                    [disabled]=\"isImageLoaded\"\r\n                                    class=\"asw-width-100\"\r\n                                    (change)=\"flipHorizontal()\">\r\n                                <div [ngClass]=\"{'asw-icon-disabled': isImageLoaded }\" [innerHTML]=\"icons.swapHoriz | aswSafeHtml\"></div>\r\n                            </mat-button-toggle>\r\n                            <mat-button-toggle matTooltip=\"{{'FormControl.SwapVertical' | aswTranslate}}\"\r\n                                    [disabled]=\"isImageLoaded\"\r\n                                    class=\"asw-width-100\"\r\n                                    (change)=\"flipVertical()\">\r\n                                <div [ngClass]=\"{'asw-icon-disabled': isImageLoaded }\" [innerHTML]=\"icons.swapVert | aswSafeHtml\"></div>\r\n                            </mat-button-toggle>\r\n                            <mat-button-toggle [disabled]=\"isImageLoaded\" \r\n                                    matTooltip=\"{{'FormControl.LeftRotate' | aswTranslate}}\"\r\n                                    class=\"asw-width-100\"\r\n                                    (change)=\"rotateLeft()\">\r\n                                <div [ngClass]=\"{'asw-icon-disabled': isImageLoaded }\" [innerHTML]=\"icons.rotateLeft | aswSafeHtml\"></div>\r\n                            </mat-button-toggle>\r\n                            <mat-button-toggle matTooltip=\"{{'FormControl.RightRotate' | aswTranslate}}\"\r\n                                    [disabled]=\"isImageLoaded\"\r\n                                    class=\"asw-width-100\"\r\n                                    (change)=\"rotateRight()\">\r\n                                <div [ngClass]=\"{'asw-icon-disabled': isImageLoaded }\" [innerHTML]=\"icons.rotateRight | aswSafeHtml\"></div>\r\n                            </mat-button-toggle>\r\n                        </mat-button-toggle-group>\r\n                        <!-- <mat-button-toggle-group>\r\n                            <mat-button-toggle matTooltip=\"{{'FormControl.MoveLeft' | aswTranslate}}\"\r\n                                    [disabled]=\"isImageLoaded\" \r\n                                    (change)=\"moveLeft()\">\r\n                                <div [ngClass]=\"{'asw-icon-disabled': isImageLoaded }\" [innerHTML]=\"icons.west | aswSafeHtml\"></div>\r\n                            </mat-button-toggle>\r\n                            <mat-button-toggle matTooltip=\"{{'FormControl.MoveRight' | aswTranslate}}\"\r\n                                    [disabled]=\"isImageLoaded\" \r\n                                    (change)=\"moveRight()\">\r\n                                <div [ngClass]=\"{'asw-icon-disabled': isImageLoaded }\" [innerHTML]=\"icons.east | aswSafeHtml\"></div>\r\n                            </mat-button-toggle>\r\n                            <mat-button-toggle matTooltip=\"{{'FormControl.MoveTop' | aswTranslate}}\"\r\n                                    [disabled]=\"isImageLoaded\" \r\n                                    (change)=\"moveTop()\">\r\n                                <div [ngClass]=\"{'asw-icon-disabled': isImageLoaded }\" [innerHTML]=\"icons.verticalAlignTop | aswSafeHtml\"></div>\r\n                            </mat-button-toggle>\r\n                            <mat-button-toggle matTooltip=\"{{'FormControl.MoveBottom' | aswTranslate}}\"\r\n                                    [disabled]=\"isImageLoaded\" \r\n                                    (change)=\"moveBottom()\">\r\n                                <div [ngClass]=\"{'asw-icon-disabled': isImageLoaded }\" [innerHTML]=\"icons.verticalAlignBottom | aswSafeHtml\"></div>\r\n                            </mat-button-toggle>\r\n                        </mat-button-toggle-group> -->\r\n                        <h6 class=\"asw-fs-6 asw-my-2\">{{'FormControl.ImageSize' | aswTranslate}}:</h6>\r\n                        <div class=\"asw-pb-2\">\r\n                            <mat-button-toggle-group class=\"asw-width-100\">\r\n                                <mat-button-toggle matTooltip=\"{{'FormControl.ZoomIn' | aswTranslate}}\"\r\n                                        [disabled]=\"isImageLoaded\"\r\n                                        class=\"asw-width-100\" \r\n                                        (change)=\"zoomIn()\">\r\n                                    {{'FormControl.ZoomIn' | aswTranslate}}\r\n                                </mat-button-toggle>\r\n                                <mat-button-toggle matTooltip=\"{{'FormControl.ZoomOut' | aswTranslate}}\"\r\n                                        [disabled]=\"isImageLoaded\"\r\n                                        class=\"asw-width-100\"\r\n                                        (change)=\"zoomOut()\">\r\n                                    {{'FormControl.ZoomOut' | aswTranslate}}\r\n                                </mat-button-toggle>\r\n                            </mat-button-toggle-group>\r\n                        </div>\r\n                        <mat-divider></mat-divider>\r\n                        <div class=\"asw-row asw-pt-2\">\r\n                            <div class=\"asw-col-md-12 asw-d-grid\">\r\n                                <button class=\"asw-button asw-button-secondary\" type=\"button\"\r\n                                        [disabled]=\"isImageLoaded\"\r\n                                        matTooltip=\"{{'FormControl.ResetImage' | aswTranslate}}\"\r\n                                        (click)=\"resetImage()\">\r\n                                    {{'FormControl.ResetImage' | aswTranslate}}\r\n                                </button>\r\n                            </div>\r\n                        </div>\r\n                        <h6 class=\"asw-fs-6 asw-my-2\">{{'FormControl.ImagePreview' | aswTranslate}}:</h6>\r\n                        <div class=\"asw-img-crop-preview\">  \r\n                            <img [src]=\"croppedImage\" /> \r\n                        </div> \r\n                    </mat-card-content>\r\n                </mat-card>\r\n            </div>\r\n        </div>\r\n    </mat-dialog-content>\r\n    <mat-divider></mat-divider>\r\n    <mat-dialog-actions align=\"end\">\r\n        <button type=\"button\"\r\n                class=\"asw-button asw-button-danger asw-mb-1 asw-me-2\"\r\n                (click)=\"onNoClick()\">\r\n            {{'FormControl.No' | aswTranslate}}\r\n        </button>\r\n        <button type=\"submit\"\r\n                class=\"asw-button asw-button-primary asw-mb-1\"\r\n                cdkFocusInitial>\r\n            {{'FormControl.Yes' | aswTranslate}}\r\n        </button>\r\n    </mat-dialog-actions>\r\n</form>", dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i4.AswImageCropComponent, selector: "asw-image-crop", inputs: ["imageChangedEvent", "imageURL", "imageBase64", "imageFile", "format", "transform", "maintainAspectRatio", "aspectRatio", "resizeToWidth", "resizeToHeight", "cropperMinWidth", "cropperMinHeight", "cropperMaxHeight", "cropperMaxWidth", "cropperStaticWidth", "cropperStaticHeight", "canvasRotation", "initialStepSize", "roundCropper", "onlyScaleDown", "imageQuality", "autoCrop", "backgroundColor", "containWithinAspectRatio", "hideResizeSquares", "allowMoveImage", "cropper", "alignImage", "disabled"], outputs: ["imageCropped", "startCropImage", "imageLoaded", "cropperReady", "loadImageFailed", "transformChange"] }, { kind: "component", type: i5.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i6.MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }, { kind: "component", type: i6.MatButtonToggle, selector: "mat-button-toggle", inputs: ["disableRipple", "aria-label", "aria-labelledby", "id", "name", "value", "tabIndex", "appearance", "checked", "disabled"], outputs: ["change"], exportAs: ["matButtonToggle"] }, { kind: "component", type: i7.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i7.MatCardContent, selector: "mat-card-content" }, { kind: "directive", type: i2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i8.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "directive", type: i9.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "pipe", type: i10.AswTranslatePipe, name: "aswTranslate" }, { kind: "pipe", type: i11.AswSafeHtmlPipe, name: "aswSafeHtml" }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: AswImageUploadDialog, decorators: [{
            type: Component,
            args: [{ selector: 'asw-image-upload-dialog', template: "<div class=\"asw-dialog-header\">\r\n    <div class=\"asw-edit-row-dialog\">\r\n        <div class=\"asw-dialog-header clearfix\">\r\n            <div class=\"asw-dialog-about\">\r\n                <h1 mat-dialog-title class=\"asw-m-0\">{{'FormControl.Edit' | aswTranslate}} {{control.label}}</h1>\r\n            </div>\r\n        </div>\r\n    </div>\r\n    <button mat-icon-button (click)=\"onNoClick()\" aria-label=\"Close dialog\" class=\"asw-mt-2 asw-me-2\">\r\n        <div [innerHTML]=\"icons.close | aswSafeHtml\"></div>\r\n    </button>\r\n</div>\r\n<mat-divider></mat-divider>\r\n<form [formGroup]=\"aswImageCropForm\" (ngSubmit)=\"onSubmit()\">\r\n    <mat-dialog-content class=\"mat-typography\">\r\n        <div class=\"asw-row asw-p-2\">\r\n            <div class=\"asw-col-md-9\">\r\n                <div class=\"asw-sticky-top\">\r\n                    <mat-card>\r\n                        <mat-card-content>\r\n                            <div class=\"asw-img-crop-area\">\r\n                                <asw-image-crop\r\n                                    [imageChangedEvent]=\"imageChangedEvent\"\r\n                                    [imageURL]=\"imageURL\"\r\n                                    [imageBase64]=\"control.imageUrl\"\r\n                                    [maintainAspectRatio]=\"true\"\r\n                                    [containWithinAspectRatio]=\"containWithinAspectRatio\"\r\n                                    [aspectRatio]=\"aspectRatio\"\r\n                                    [resizeToWidth]=\"500\"\r\n                                    [imageQuality]=\"92\"\r\n                                    [onlyScaleDown]=\"true\"\r\n                                    [roundCropper]=\"roundCropper\"\r\n                                    [canvasRotation]=\"canvasRotation\"\r\n                                    [(transform)]=\"transform\"\r\n                                    [alignImage]=\"'center'\"\r\n                                    [style.display]=\"showCropper ? null : 'none'\"\r\n                                    [allowMoveImage]=\"allowMoveImage\"\r\n                                    format=\"png\"\r\n                                    (imageCropped)=\"imageCropped($event)\"\r\n                                    (imageLoaded)=\"imageLoaded()\"\r\n                                    (cropperReady)=\"cropperReady($event)\"\r\n                                    (loadImageFailed)=\"loadImageFailed()\">\r\n                                </asw-image-crop>\r\n                            </div>\r\n                        </mat-card-content>\r\n                    </mat-card>\r\n                </div>\r\n            </div>\r\n            <div class=\"asw-col-md-3\">\r\n                <mat-card>\r\n                    <mat-card-content>\r\n                        <div class=\"asw-row\">\r\n                            <div class=\"asw-col-md-12 asw-d-grid\">\r\n                                <button class=\"asw-button asw-button-primary\" type=\"button\"\r\n                                    (click)=\"fileInput.click()\"\r\n                                    matTooltip=\"{{'FormControl.LoadImage' | aswTranslate}}\" \r\n                                    *ngIf=\"isImageLoaded\">\r\n                                    <input style=\"display: none\" \r\n                                        type=\"file\" \r\n                                        #fileInput \r\n                                        (change)=\"fileChangeEvent($event)\"\r\n                                        id=\"imageUpload\" \r\n                                        accept=\".png, .jpg, .jpeg\">\r\n                                    {{'FormControl.LoadImage' | aswTranslate}}\r\n                                </button>\r\n                                <button class=\"asw-button asw-button-primary\" type=\"button\"\r\n                                        matTooltip=\"{{'FormControl.RemoveImage' | aswTranslate}}\"\r\n                                        *ngIf=\"!isImageLoaded\" \r\n                                        (click)=\"removeImage()\">\r\n                                    {{'FormControl.RemoveImage' | aswTranslate}}\r\n                                </button>\r\n                            </div>\r\n                        </div>\r\n                        <h6 class=\"asw-fs-6 asw-my-2\">{{'FormControl.CropType' | aswTranslate}}:</h6>\r\n                        <div class=\"asw-pb-2\">\r\n                            <mat-button-toggle-group class=\"asw-width-100\">\r\n                                <mat-button-toggle matTooltip=\"{{'FormControl.Square' | aswTranslate}}\"\r\n                                        [disabled]=\"isImageLoaded\"\r\n                                        class=\"asw-width-100\" \r\n                                        (change)=\"setRoundCropper(false)\">\r\n                                    {{'FormControl.Square' | aswTranslate}}\r\n                                </mat-button-toggle>\r\n                                <mat-button-toggle matTooltip=\"{{'FormControl.Circle' | aswTranslate}}\"\r\n                                        [disabled]=\"isImageLoaded\"\r\n                                        class=\"asw-width-100\"\r\n                                        (change)=\"setRoundCropper(true)\">\r\n                                    {{'FormControl.Circle' | aswTranslate}}\r\n                                </mat-button-toggle>\r\n                            </mat-button-toggle-group>\r\n                        </div>\r\n                        <div class=\"asw-pb-2\">\r\n                            <mat-button-toggle-group  class=\"asw-width-100\">\r\n                                <mat-button-toggle matTooltip=\"{{(containWithinAspectRatio?'FormControl.FillAspectRatio':'FormControl.ContainWithinAspectRatio') | aswTranslate}}\"\r\n                                        [disabled]=\"isImageLoaded\" \r\n                                        class=\"asw-width-100\"\r\n                                        (change)=\"toggleContainWithinAspectRatio()\">\r\n                                    {{(containWithinAspectRatio?'FormControl.FillAspectRatio':'FormControl.ContainWithinAspectRatio') | aswTranslate}}\r\n                                </mat-button-toggle>\r\n                            </mat-button-toggle-group>\r\n                        </div>\r\n                        <mat-button-toggle-group class=\"asw-width-100\">\r\n                            <mat-button-toggle matTooltip=\"{{'FormControl.SwapHorizontal' | aswTranslate}}\"\r\n                                    [disabled]=\"isImageLoaded\"\r\n                                    class=\"asw-width-100\"\r\n                                    (change)=\"flipHorizontal()\">\r\n                                <div [ngClass]=\"{'asw-icon-disabled': isImageLoaded }\" [innerHTML]=\"icons.swapHoriz | aswSafeHtml\"></div>\r\n                            </mat-button-toggle>\r\n                            <mat-button-toggle matTooltip=\"{{'FormControl.SwapVertical' | aswTranslate}}\"\r\n                                    [disabled]=\"isImageLoaded\"\r\n                                    class=\"asw-width-100\"\r\n                                    (change)=\"flipVertical()\">\r\n                                <div [ngClass]=\"{'asw-icon-disabled': isImageLoaded }\" [innerHTML]=\"icons.swapVert | aswSafeHtml\"></div>\r\n                            </mat-button-toggle>\r\n                            <mat-button-toggle [disabled]=\"isImageLoaded\" \r\n                                    matTooltip=\"{{'FormControl.LeftRotate' | aswTranslate}}\"\r\n                                    class=\"asw-width-100\"\r\n                                    (change)=\"rotateLeft()\">\r\n                                <div [ngClass]=\"{'asw-icon-disabled': isImageLoaded }\" [innerHTML]=\"icons.rotateLeft | aswSafeHtml\"></div>\r\n                            </mat-button-toggle>\r\n                            <mat-button-toggle matTooltip=\"{{'FormControl.RightRotate' | aswTranslate}}\"\r\n                                    [disabled]=\"isImageLoaded\"\r\n                                    class=\"asw-width-100\"\r\n                                    (change)=\"rotateRight()\">\r\n                                <div [ngClass]=\"{'asw-icon-disabled': isImageLoaded }\" [innerHTML]=\"icons.rotateRight | aswSafeHtml\"></div>\r\n                            </mat-button-toggle>\r\n                        </mat-button-toggle-group>\r\n                        <!-- <mat-button-toggle-group>\r\n                            <mat-button-toggle matTooltip=\"{{'FormControl.MoveLeft' | aswTranslate}}\"\r\n                                    [disabled]=\"isImageLoaded\" \r\n                                    (change)=\"moveLeft()\">\r\n                                <div [ngClass]=\"{'asw-icon-disabled': isImageLoaded }\" [innerHTML]=\"icons.west | aswSafeHtml\"></div>\r\n                            </mat-button-toggle>\r\n                            <mat-button-toggle matTooltip=\"{{'FormControl.MoveRight' | aswTranslate}}\"\r\n                                    [disabled]=\"isImageLoaded\" \r\n                                    (change)=\"moveRight()\">\r\n                                <div [ngClass]=\"{'asw-icon-disabled': isImageLoaded }\" [innerHTML]=\"icons.east | aswSafeHtml\"></div>\r\n                            </mat-button-toggle>\r\n                            <mat-button-toggle matTooltip=\"{{'FormControl.MoveTop' | aswTranslate}}\"\r\n                                    [disabled]=\"isImageLoaded\" \r\n                                    (change)=\"moveTop()\">\r\n                                <div [ngClass]=\"{'asw-icon-disabled': isImageLoaded }\" [innerHTML]=\"icons.verticalAlignTop | aswSafeHtml\"></div>\r\n                            </mat-button-toggle>\r\n                            <mat-button-toggle matTooltip=\"{{'FormControl.MoveBottom' | aswTranslate}}\"\r\n                                    [disabled]=\"isImageLoaded\" \r\n                                    (change)=\"moveBottom()\">\r\n                                <div [ngClass]=\"{'asw-icon-disabled': isImageLoaded }\" [innerHTML]=\"icons.verticalAlignBottom | aswSafeHtml\"></div>\r\n                            </mat-button-toggle>\r\n                        </mat-button-toggle-group> -->\r\n                        <h6 class=\"asw-fs-6 asw-my-2\">{{'FormControl.ImageSize' | aswTranslate}}:</h6>\r\n                        <div class=\"asw-pb-2\">\r\n                            <mat-button-toggle-group class=\"asw-width-100\">\r\n                                <mat-button-toggle matTooltip=\"{{'FormControl.ZoomIn' | aswTranslate}}\"\r\n                                        [disabled]=\"isImageLoaded\"\r\n                                        class=\"asw-width-100\" \r\n                                        (change)=\"zoomIn()\">\r\n                                    {{'FormControl.ZoomIn' | aswTranslate}}\r\n                                </mat-button-toggle>\r\n                                <mat-button-toggle matTooltip=\"{{'FormControl.ZoomOut' | aswTranslate}}\"\r\n                                        [disabled]=\"isImageLoaded\"\r\n                                        class=\"asw-width-100\"\r\n                                        (change)=\"zoomOut()\">\r\n                                    {{'FormControl.ZoomOut' | aswTranslate}}\r\n                                </mat-button-toggle>\r\n                            </mat-button-toggle-group>\r\n                        </div>\r\n                        <mat-divider></mat-divider>\r\n                        <div class=\"asw-row asw-pt-2\">\r\n                            <div class=\"asw-col-md-12 asw-d-grid\">\r\n                                <button class=\"asw-button asw-button-secondary\" type=\"button\"\r\n                                        [disabled]=\"isImageLoaded\"\r\n                                        matTooltip=\"{{'FormControl.ResetImage' | aswTranslate}}\"\r\n                                        (click)=\"resetImage()\">\r\n                                    {{'FormControl.ResetImage' | aswTranslate}}\r\n                                </button>\r\n                            </div>\r\n                        </div>\r\n                        <h6 class=\"asw-fs-6 asw-my-2\">{{'FormControl.ImagePreview' | aswTranslate}}:</h6>\r\n                        <div class=\"asw-img-crop-preview\">  \r\n                            <img [src]=\"croppedImage\" /> \r\n                        </div> \r\n                    </mat-card-content>\r\n                </mat-card>\r\n            </div>\r\n        </div>\r\n    </mat-dialog-content>\r\n    <mat-divider></mat-divider>\r\n    <mat-dialog-actions align=\"end\">\r\n        <button type=\"button\"\r\n                class=\"asw-button asw-button-danger asw-mb-1 asw-me-2\"\r\n                (click)=\"onNoClick()\">\r\n            {{'FormControl.No' | aswTranslate}}\r\n        </button>\r\n        <button type=\"submit\"\r\n                class=\"asw-button asw-button-primary asw-mb-1\"\r\n                cdkFocusInitial>\r\n            {{'FormControl.Yes' | aswTranslate}}\r\n        </button>\r\n    </mat-dialog-actions>\r\n</form>" }]
        }], ctorParameters: function () { return [{ type: i1.FormBuilder }, { type: i2.MatDialogRef }, { type: undefined, decorators: [{
                    type: Inject,
                    args: [MAT_DIALOG_DATA]
                }] }]; } });
//# sourceMappingURL=data:application/json;base64, 