text: /**
  @license
  Copyright (c) 2017 Vaadin Ltd.
  This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
  */
  import{PolymerElement as e}from"../../../@polymer/polymer/polymer-element.js";import{TextFieldMixin as t}from"./vaadin-text-field-mixin.js";import{ControlStateMixin as a}from"../../vaadin-control-state-mixin/vaadin-control-state-mixin.js";import{ThemableMixin as i}from"../../vaadin-themable-mixin/vaadin-themable-mixin.js";import{ElementMixin as r}from"../../vaadin-element-mixin/vaadin-element-mixin.js";import{html as l}from"../../../@polymer/polymer/lib/utils/html-tag.js";class TextAreaElement extends(r(t(a(i(e))))){static get template(){return l`
      <style include="vaadin-text-field-shared-styles">
        .vaadin-text-area-container {
          flex: auto;
          max-height: inherit; /* MSIE 11 */
          min-height: inherit; /* MSIE 11 */
        }
  
        /* The label, helper text and the error message should neither grow nor shrink. */
        [part="label"],
        [part="helper-text"],
        [part="error-message"] {
          flex: none;
        }
  
        [part="input-field"] {
          overflow: auto;
          -webkit-overflow-scrolling: touch;
        }
  
        [part="value"] {
          resize: none;
        }
  
        [part="value"],
        [part="input-field"] ::slotted(*) {
          align-self: flex-start;
        }
  
        @keyframes vaadin-text-area-appear {
          to {
            opacity: 1;
          }
        }
  
        :host {
          animation: 1ms vaadin-text-area-appear;
        }
      </style>
  
      <div class="vaadin-text-area-container">
  
        <label part="label" on-click="focus" id="[[_labelId]]">[[label]]</label>
  
        <div part="input-field" id="[[_inputId]]">
  
          <slot name="prefix"></slot>
  
          <slot name="textarea">
            <textarea part="value"></textarea>
          </slot>
  
          <div part="clear-button" id="clearButton" role="button" aria-label\$="[[i18n.clear]]"></div>
          <slot name="suffix"></slot>
  
        </div>
  
        <div part="helper-text" on-click="focus" id="[[_helperTextId]]">
          <slot name="helper">[[helperText]]</slot>
        </div>
  
        <div part="error-message" id="[[_errorId]]" aria-live="assertive" aria-hidden\$="[[_getErrorMessageAriaHidden(invalid, errorMessage, _errorId)]]">[[errorMessage]]</div>
  
      </div>
  `}static get is(){return"vaadin-text-area"}static get version(){return"2.8.0"}static get observers(){return["_textAreaValueChanged(value)"]}ready(){super.ready(),this._updateHeight(),this.addEventListener("animationend",this._onAnimationEnd)}_onAnimationEnd(e){0===e.animationName.indexOf("vaadin-text-area-appear")&&this._updateHeight()}get _slottedTagName(){return"textarea"}_textAreaValueChanged(e){this._updateHeight()}_updateHeight(){const e=this.root.querySelector("[part=input-field]"),t=e.scrollTop,a=this.inputElement,i=getComputedStyle(a).width,r=this.value?this.value.length:0;this._oldValueLength>=r&&(a.style.maxWidth=i,a.style.height="auto",e.style.display="block"),this._oldValueLength=r;const l=a.scrollHeight;l>a.clientHeight&&(a.style.height=l+"px"),a.style.removeProperty("max-width"),e.style.removeProperty("display"),e.scrollTop=t,this._dispatchIronResizeEventIfNeeded("InputHeight",l)}}customElements.define(TextAreaElement.is,TextAreaElement);export{TextAreaElement};