import { ChangeDetectionStrategy, Component, forwardRef } from '@angular/core';
import { NG_VALUE_ACCESSOR } from '@angular/forms';
import { TextareaBaseComponent } from '@ironsource/fusion-ui/components/textarea/common/base';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@angular/forms";
function TextareaComponent_div_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "div", 2);
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵproperty("innerHTML", ctx_r0.error, i0.ɵɵsanitizeHtml);
} }
const _c0 = (a0, a1, a2) => ({ disabled: a0, resize: a1, error: a2 });
export class TextareaComponent extends TextareaBaseComponent {
    static { this.ɵfac = /*@__PURE__*/ (() => { let ɵTextareaComponent_BaseFactory; return function TextareaComponent_Factory(t) { return (ɵTextareaComponent_BaseFactory || (ɵTextareaComponent_BaseFactory = i0.ɵɵgetInheritedFactory(TextareaComponent)))(t || TextareaComponent); }; })(); }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: TextareaComponent, selectors: [["fusion-textarea"]], features: [i0.ɵɵProvidersFeature([
                {
                    provide: NG_VALUE_ACCESSOR,
                    useExisting: forwardRef(() => TextareaComponent),
                    multi: true
                }
            ]), i0.ɵɵInheritDefinitionFeature], decls: 2, vars: 12, consts: [["minlength", "1", 1, "is-textarea", 3, "placeholder", "readonly", "required", "name", "ngClass", "ngModel", "disabled", "ngModelChange"], ["class", "error-msg", 3, "innerHTML", 4, "ngIf"], [1, "error-msg", 3, "innerHTML"]], template: function TextareaComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "textarea", 0);
            i0.ɵɵlistener("ngModelChange", function TextareaComponent_Template_textarea_ngModelChange_0_listener($event) { return ctx.onChange($event); });
            i0.ɵɵelementEnd();
            i0.ɵɵtemplate(1, TextareaComponent_div_1_Template, 1, 1, "div", 1);
        } if (rf & 2) {
            i0.ɵɵproperty("placeholder", ctx.placeholder)("readonly", ctx.readonly)("required", ctx.required)("name", ctx.name)("ngClass", i0.ɵɵpureFunction3(8, _c0, ctx.isDisabled, ctx.resize, ctx.error))("ngModel", ctx.model)("disabled", ctx.isDisabled);
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngIf", ctx.error);
        } }, dependencies: [i1.NgClass, i1.NgIf, i2.DefaultValueAccessor, i2.NgControlStatus, i2.RequiredValidator, i2.MinLengthValidator, i2.NgModel], styles: ["[_nghost-%COMP%]   textarea[_ngcontent-%COMP%]::placeholder, [_nghost-%COMP%]   textarea[_ngcontent-%COMP%]{font-size:12px;font-family:HelveticaNeue,helvetica,sans-serif;font-weight:400;letter-spacing:.04px}[_nghost-%COMP%]   .error-msg[_ngcontent-%COMP%]{font-size:11px;font-family:HelveticaNeue,helvetica,sans-serif;font-weight:400}[_nghost-%COMP%]   *[_ngcontent-%COMP%]{box-sizing:border-box}[_nghost-%COMP%]   textarea.error[_ngcontent-%COMP%]:focus, [_nghost-%COMP%]   textarea[_ngcontent-%COMP%]:focus{background-color:var(--fu-light-100, #f7f8f9);border-bottom:solid 2px var(--fu-primary-500, #3083ff);padding-bottom:8px;outline:none;box-shadow:none}[_nghost-%COMP%]{height:inherit}[_nghost-%COMP%]   textarea[_ngcontent-%COMP%]{border:none;border-radius:4px;box-sizing:border-box;background-color:var(--fu-light-100, #f7f8f9);resize:none;width:100%;height:100%;padding:10px;color:var(--fu-dark-300, #313d91);min-height:50px}[_nghost-%COMP%]   textarea[_ngcontent-%COMP%]::placeholder{color:var(--fu-light-800, #8e959d)}[_nghost-%COMP%]   textarea[_ngcontent-%COMP%]:hover{background-color:var(--fu-light-200, #f0f1f2)}[_nghost-%COMP%]   textarea.resize[_ngcontent-%COMP%]{resize:both}[_nghost-%COMP%]   textarea.disabled[_ngcontent-%COMP%], [_nghost-%COMP%]   textarea[_ngcontent-%COMP%]:disabled{pointer-events:all;color:var(--fu-dark-200, #4c548e);resize:none}[_nghost-%COMP%]   textarea.disabled[_ngcontent-%COMP%]:hover, [_nghost-%COMP%]   textarea[_ngcontent-%COMP%]:disabled:hover{cursor:not-allowed}[_nghost-%COMP%]   textarea.disabled[_ngcontent-%COMP%]:focus, [_nghost-%COMP%]   textarea[_ngcontent-%COMP%]:disabled:focus{border-bottom:none;padding-bottom:10px}[_nghost-%COMP%]   textarea.error[_ngcontent-%COMP%]{background-color:var(--fu-negative-100, #ffefee)}[_nghost-%COMP%]   textarea.error[_ngcontent-%COMP%]:focus + .error-msg[_ngcontent-%COMP%]{display:none}[_nghost-%COMP%]   .error-msg[_ngcontent-%COMP%]{color:var(--fu-negative-500, #ff6a63);margin-top:-7px}"] }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TextareaComponent, [{
        type: Component,
        args: [{ selector: 'fusion-textarea', changeDetection: ChangeDetectionStrategy.Default, providers: [
                    {
                        provide: NG_VALUE_ACCESSOR,
                        useExisting: forwardRef(() => TextareaComponent),
                        multi: true
                    }
                ], template: "<textarea\n  class=\"is-textarea\"\n  [placeholder]=\"placeholder\"\n  [readonly]=\"readonly\"\n  [required]=\"required\"\n  minlength=\"1\"\n  [name]=\"name\"\n  [ngClass]=\"{disabled: isDisabled, resize: resize, error:error}\"\n  [ngModel]=\"model\"\n  (ngModelChange)=\"onChange($event)\"\n  [disabled]=\"isDisabled\"></textarea>\n<div class=\"error-msg\" *ngIf=\"error\" [innerHTML]=\"error\"></div>\n", styles: [":host textarea::placeholder,:host textarea{font-size:12px;font-family:HelveticaNeue,helvetica,sans-serif;font-weight:400;letter-spacing:.04px}:host .error-msg{font-size:11px;font-family:HelveticaNeue,helvetica,sans-serif;font-weight:400}:host *{box-sizing:border-box}:host textarea.error:focus,:host textarea:focus{background-color:var(--fu-light-100, #f7f8f9);border-bottom:solid 2px var(--fu-primary-500, #3083ff);padding-bottom:8px;outline:none;box-shadow:none}:host{height:inherit}:host textarea{border:none;border-radius:4px;box-sizing:border-box;background-color:var(--fu-light-100, #f7f8f9);resize:none;width:100%;height:100%;padding:10px;color:var(--fu-dark-300, #313d91);min-height:50px}:host textarea::placeholder{color:var(--fu-light-800, #8e959d)}:host textarea:hover{background-color:var(--fu-light-200, #f0f1f2)}:host textarea.resize{resize:both}:host textarea.disabled,:host textarea:disabled{pointer-events:all;color:var(--fu-dark-200, #4c548e);resize:none}:host textarea.disabled:hover,:host textarea:disabled:hover{cursor:not-allowed}:host textarea.disabled:focus,:host textarea:disabled:focus{border-bottom:none;padding-bottom:10px}:host textarea.error{background-color:var(--fu-negative-100, #ffefee)}:host textarea.error:focus+.error-msg{display:none}:host .error-msg{color:var(--fu-negative-500, #ff6a63);margin-top:-7px}\n"] }]
    }], null, null); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(TextareaComponent, { className: "TextareaComponent", filePath: "textarea.component.ts", lineNumber: 18 }); })();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGV4dGFyZWEuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvZnVzaW9uLXVpL2NvbXBvbmVudHMvdGV4dGFyZWEvdjIvdGV4dGFyZWEuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvZnVzaW9uLXVpL2NvbXBvbmVudHMvdGV4dGFyZWEvY29tbW9uL2Jhc2UvdGV4dGFyZWEuYmFzZS5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUMsdUJBQXVCLEVBQUUsU0FBUyxFQUFFLFVBQVUsRUFBQyxNQUFNLGVBQWUsQ0FBQztBQUM3RSxPQUFPLEVBQUMsaUJBQWlCLEVBQUMsTUFBTSxnQkFBZ0IsQ0FBQztBQUNqRCxPQUFPLEVBQUMscUJBQXFCLEVBQUMsTUFBTSx1REFBdUQsQ0FBQzs7Ozs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