import { ChangeDetectionStrategy, Component } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "@clr/angular";
import * as i2 from "@angular/common";
import * as i3 from "@angular/forms";
import * as i4 from "../form-field/form-field-control.directive";
import * as i5 from "../modal-dialog/dialog-buttons.directive";
import * as i6 from "../modal-dialog/dialog-title.directive";
import * as i7 from "@ngx-translate/core";
export class EditNoteDialogComponent {
    constructor() {
        this.displayPrivacyControls = true;
        this.noteIsPrivate = true;
        this.note = '';
    }
    confirm() {
        this.resolveWith({
            note: this.note,
            isPrivate: this.noteIsPrivate,
        });
    }
    cancel() {
        this.resolveWith();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: EditNoteDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: EditNoteDialogComponent, selector: "vdr-edit-note-dialog", ngImport: i0, template: "<ng-template vdrDialogTitle>\n    {{ 'common.edit-note' | translate }}\n</ng-template>\n\n<textarea [(ngModel)]=\"note\" name=\"note\" class=\"note\"></textarea>\n<div class=\"visibility-select\" *ngIf=\"displayPrivacyControls\">\n    <clr-checkbox-wrapper>\n        <input type=\"checkbox\" clrCheckbox [(ngModel)]=\"noteIsPrivate\" />\n        <label>{{ 'order.note-is-private' | translate }}</label>\n    </clr-checkbox-wrapper>\n    <span *ngIf=\"noteIsPrivate\" class=\"private\">\n        {{ 'order.note-only-visible-to-administrators' | translate }}\n    </span>\n    <span *ngIf=\"!noteIsPrivate\" class=\"public\">\n        {{ 'order.note-visible-to-customer' | translate }}\n    </span>\n</div>\n<ng-template vdrDialogButtons>\n    <button type=\"button\" class=\"btn\" (click)=\"cancel()\">{{ 'common.cancel' | translate }}</button>\n    <button type=\"submit\" (click)=\"confirm()\" class=\"btn btn-primary\" [disabled]=\"note.length === 0\">\n        {{ 'common.confirm' | translate }}\n    </button>\n</ng-template>\n", styles: [".visibility-select{display:flex;justify-content:space-between;align-items:baseline}.visibility-select .public{color:var(--color-warning-500)}.visibility-select .private{color:var(--color-success-500)}textarea.note{width:100%;height:72px;border-radius:3px;margin-inline-end:6px}\n"], dependencies: [{ kind: "directive", type: i1.ClrLabel, selector: "label", inputs: ["for"] }, { kind: "directive", type: i1.ClrCheckbox, selector: "[clrCheckbox],[clrToggle]" }, { kind: "component", type: i1.ClrCheckboxWrapper, selector: "clr-checkbox-wrapper,clr-toggle-wrapper" }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i4.FormFieldControlDirective, selector: "input, textarea, select" }, { kind: "directive", type: i5.DialogButtonsDirective, selector: "[vdrDialogButtons]" }, { kind: "directive", type: i6.DialogTitleDirective, selector: "[vdrDialogTitle]" }, { kind: "pipe", type: i7.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: EditNoteDialogComponent, decorators: [{
            type: Component,
            args: [{ selector: 'vdr-edit-note-dialog', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template vdrDialogTitle>\n    {{ 'common.edit-note' | translate }}\n</ng-template>\n\n<textarea [(ngModel)]=\"note\" name=\"note\" class=\"note\"></textarea>\n<div class=\"visibility-select\" *ngIf=\"displayPrivacyControls\">\n    <clr-checkbox-wrapper>\n        <input type=\"checkbox\" clrCheckbox [(ngModel)]=\"noteIsPrivate\" />\n        <label>{{ 'order.note-is-private' | translate }}</label>\n    </clr-checkbox-wrapper>\n    <span *ngIf=\"noteIsPrivate\" class=\"private\">\n        {{ 'order.note-only-visible-to-administrators' | translate }}\n    </span>\n    <span *ngIf=\"!noteIsPrivate\" class=\"public\">\n        {{ 'order.note-visible-to-customer' | translate }}\n    </span>\n</div>\n<ng-template vdrDialogButtons>\n    <button type=\"button\" class=\"btn\" (click)=\"cancel()\">{{ 'common.cancel' | translate }}</button>\n    <button type=\"submit\" (click)=\"confirm()\" class=\"btn btn-primary\" [disabled]=\"note.length === 0\">\n        {{ 'common.confirm' | translate }}\n    </button>\n</ng-template>\n", styles: [".visibility-select{display:flex;justify-content:space-between;align-items:baseline}.visibility-select .public{color:var(--color-warning-500)}.visibility-select .private{color:var(--color-success-500)}textarea.note{width:100%;height:72px;border-radius:3px;margin-inline-end:6px}\n"] }]
        }] });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZWRpdC1ub3RlLWRpYWxvZy5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvbGliL2NvcmUvc3JjL3NoYXJlZC9jb21wb25lbnRzL2VkaXQtbm90ZS1kaWFsb2cvZWRpdC1ub3RlLWRpYWxvZy5jb21wb25lbnQudHMiLCIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvbGliL2NvcmUvc3JjL3NoYXJlZC9jb21wb25lbnRzL2VkaXQtbm90ZS1kaWFsb2cvZWRpdC1ub3RlLWRpYWxvZy5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsdUJBQXVCL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