"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("./query-assigned-elements-8EurZY45.js"),u=require("./tslib.es6-CHeFCc6E.js"),d=require("./textfield-lDKLLJ_h.js"),h=require("./property-DYTC_2-m.js"),p=require("./query-Dv2F3m_t.js"),x=require("./class-map-DTzB8z-1.js"),s=require("./if-defined-CZCqOAYs.js");/**
 * @license
 * Copyright 2019 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const f={fromAttribute(e){return e===null?!1:e===""?!0:e},toAttribute(e){return typeof e=="boolean"?e?"":null:e}};class o extends d.TextFieldBase{constructor(){super(...arguments),this.rows=2,this.cols=20,this.charCounter=!1}render(){const r=this.charCounter&&this.maxLength!==-1,n=r&&this.charCounter==="internal",i=r&&!n,t=!!this.helper||!!this.validationMessage||i,a={"mdc-text-field--disabled":this.disabled,"mdc-text-field--no-label":!this.label,"mdc-text-field--filled":!this.outlined,"mdc-text-field--outlined":this.outlined,"mdc-text-field--end-aligned":this.endAligned,"mdc-text-field--with-internal-counter":n};return l.x`
      <label class="mdc-text-field mdc-text-field--textarea ${x.o(a)}">
        ${this.renderRipple()}
        ${this.outlined?this.renderOutline():this.renderLabel()}
        ${this.renderInput()}
        ${this.renderCharCounter(n)}
        ${this.renderLineRipple()}
      </label>
      ${this.renderHelperText(t,i)}
    `}renderInput(){const r=this.label?"label":void 0,n=this.minLength===-1?void 0:this.minLength,i=this.maxLength===-1?void 0:this.maxLength,t=this.autocapitalize?this.autocapitalize:void 0;return l.x`
      <textarea
          aria-labelledby=${s.l(r)}
          class="mdc-text-field__input"
          .value="${d.l(this.value)}"
          rows="${this.rows}"
          cols="${this.cols}"
          ?disabled="${this.disabled}"
          placeholder="${this.placeholder}"
          ?required="${this.required}"
          ?readonly="${this.readOnly}"
          minlength="${s.l(n)}"
          maxlength="${s.l(i)}"
          name="${s.l(this.name===""?void 0:this.name)}"
          inputmode="${s.l(this.inputMode)}"
          autocapitalize="${s.l(t)}"
          @input="${this.handleInputChange}"
          @blur="${this.onInputBlur}">
      </textarea>`}}u.__decorate([p.i("textarea")],o.prototype,"formElement",void 0);u.__decorate([h.n({type:Number})],o.prototype,"rows",void 0);u.__decorate([h.n({type:Number})],o.prototype,"cols",void 0);u.__decorate([h.n({converter:f})],o.prototype,"charCounter",void 0);/**
 * @license
 * Copyright 2021 Google LLC
 * SPDX-LIcense-Identifier: Apache-2.0
 */const m=l.i`.mdc-text-field{height:100%}.mdc-text-field__input{resize:none}`;var b=Object.getOwnPropertyDescriptor,$=(e,r,n,i)=>{for(var t=i>1?void 0:i?b(r,n):r,a=e.length-1,c;a>=0;a--)(c=e[a])&&(t=c(t)||t);return t};exports.CovalentTextArea=class extends o{};exports.CovalentTextArea.styles=[d.styles,m,l.i`${l.r(d.styles$1)}`];exports.CovalentTextArea=$([l.e("cv-textarea")],exports.CovalentTextArea);const C=exports.CovalentTextArea;exports.default=C;
