import { Host, h } from "@stencil/core";
import { cls, getId } from "../../utils/helpers";
import { Lang } from "../../services/lang";
import IMask from "imask";
/**
 * @attribute disabled
 */
export class XInput {
    constructor() {
        /**
         * Typing timer instance
         */
        this.typingTimer = null;
        /**
         * Typing input event instance
         */
        this.typingEvent = null;
        /**
         * Element ID for internal reference
         */
        this.inputId = getId('input');
        this.label = undefined;
        this.name = undefined;
        this.type = 'text';
        this.placeholder = undefined;
        this.info = undefined;
        this.typingtimeout = 1200;
        this.typingindicate = undefined;
        this.required = undefined;
        this.loading = undefined;
        this.readonly = undefined;
        this.cleanable = undefined;
        this.autofocus = undefined;
        this.capitalize = 'off';
        this.autocorrect = 'off';
        this.pattern = undefined;
        this.autocomplete = 'off';
        this.enterkeyhint = undefined;
        this.inputmode = undefined;
        this.max = undefined;
        this.min = undefined;
        this.step = undefined;
        this.maxlength = undefined;
        this.minlength = undefined;
        this.width = undefined;
        this.mask = undefined;
        this.value = '';
        this.inputType = this.type;
        this.isValid = true;
        this.isTyping = undefined;
        this.isFocused = undefined;
        this.isLoading = undefined;
        this.isDisabled = undefined;
    }
    /**
 * On watch mask pattern/options
 */
    watchMask() {
        var _a;
        if (this.mask && !this.maskInstance && this.input) {
            this.maskInstance = IMask(this.input, this.mask);
        }
        (_a = this.maskInstance) === null || _a === void 0 ? void 0 : _a.updateOptions(this.mask);
    }
    /**
     * On watch type property hook
     */
    watchType() {
        this.validateInputType();
    }
    /**
     * This is called when the 'disabled' attribute of the element or or an ancestor <fieldset> is updated
     *
     * @param disabled
     */
    formDisabledCallback(disabled) {
        this.isDisabled = disabled;
    }
    /**
     * This is called when the parent/owner form is reset
     */
    formResetCallback() {
        this.isValid = true;
        this.internals.setFormValue('');
        this.el.dispatchEvent(new InputEvent('input', { bubbles: false }));
    }
    /**
     * This is called when the input is validated
     */
    formValidateCallback() {
        this.isValid = this.input.validity.valid;
        this.onValidateInputEvent.emit(this.input);
    }
    /**
     * This is called on component before load
     */
    componentWillLoad() {
        this.validateInputType();
    }
    /**
     * This is called on component did load
     */
    componentDidLoad() {
        if (this.mask && !this.maskInstance) {
            this.maskInstance = IMask(this.input, this.mask);
        }
    }
    /**
     * Set element value by event
     *
     * @param event
     */
    onInput(event) {
        var _a;
        this.value = event.target.value;
        this.internals.setFormValue(event.target.value);
        this.el.dispatchEvent(new InputEvent('input', { bubbles: false }));
        this.formValidateCallback();
        (_a = this.internals.form) === null || _a === void 0 ? void 0 : _a.dispatchEvent(new InputEvent('input', { bubbles: false }));
    }
    /**
     * This called on input field is unfocused
     */
    onBlurInput() {
        this.isFocused = false;
        setTimeout(() => this.formValidateCallback(), 50);
    }
    /**
     * This called on input field is focused
     */
    onFocusInput() {
        this.isFocused = true;
    }
    /**
     * This called on input field was changed
     *
     * @param event
     */
    onKeyUpInput(event) {
        this.isTyping = true;
        this.typingEvent = event;
        clearTimeout(this.typingTimer);
        this.typingTimer = setTimeout(this.onDoneTypingInput.bind(this), this.typingtimeout);
        this.onStartTypingEvent.emit(this.typingEvent);
    }
    /**
     * This called on input field detect key is down
     */
    onKeyDownInput(event) {
        clearTimeout(this.typingTimer);
        if (this.type === 'numeric') {
            if (event.key === 'ArrowUp') {
                this.sumValue();
            }
            if (event.key === 'ArrowDown') {
                this.subValue();
            }
        }
    }
    /**
     * This called on input field finished typing
     */
    onDoneTypingInput() {
        this.formValidateCallback();
        this.isTyping = false;
        this.onDoneTypingEvent.emit(this.typingEvent);
    }
    /**
     * Return validation of showing the input label
     *
     * @returns
     */
    showLabel() {
        const valueStr = this.value !== undefined && this.value !== null ? this.value.toString() : '';
        return (this.label && this.placeholder) || (this.label && (valueStr.length > 0 || this.isFocused)) || (this.label && ['color', 'otp', 'amount'].includes(this.type));
    }
    /**
     * Compute the placeholder value
     *
     * @returns
     */
    placeholderValue() {
        if (this.type == 'color') {
            return Lang.get('fields.input.color');
        }
        if (this.type == 'amount') {
            return '0.00';
        }
        if (this.label) {
            if (this.placeholder) {
                return this.placeholder;
            }
            else if (!this.showLabel()) {
                return this.label;
            }
        }
        return this.placeholder;
    }
    /**
     * Show the content of input when type is `password`
     *
     * @returns
     */
    togglePasswordVisibility() {
        if (this.isDisabled) {
            return;
        }
        this.inputType = this.inputType == 'password' ? 'text' : 'password';
        setTimeout(() => {
            this.el.querySelector('input').focus();
        }, 100);
    }
    /**
     * Sumarize the actual value if type is `numeric`
     *
     * @returns
     */
    sumValue() {
        if (isNaN(parseInt(this.value.toString()))) {
            this.value = this.min ? this.min : 0;
        }
        if (typeof this.value !== 'number') {
            this.value = parseInt(this.value);
        }
        if (!isNaN(this.max) && this.value >= this.max) {
            return;
        }
        this.value = this.value + (this.step || 1);
        this.el.dispatchEvent(new InputEvent('input', { bubbles: false }));
    }
    /**
     * Substract the actual value if type is `numeric`
     *
     * @returns
     */
    subValue() {
        if (isNaN(parseInt(this.value.toString()))) {
            this.value = this.max ? this.max : 0;
        }
        if (typeof this.value !== 'number') {
            this.value = parseInt(this.value);
        }
        if (!isNaN(this.min) && this.value <= this.min) {
            return;
        }
        this.value = this.value - (this.step || 1);
        this.el.dispatchEvent(new InputEvent('input', { bubbles: false }));
    }
    /**
     * Validate the initials values of the input by type
     */
    validateInputType() {
        this.inputType = this.type;
        switch (this.type) {
            case 'email':
                this.inputmode = this.inputmode || 'email';
                break;
            case 'tel':
                this.inputmode = this.inputmode || 'tel';
                break;
            case 'url':
                this.inputmode = this.inputmode || 'url';
                break;
            case 'search':
                this.inputmode = this.inputmode || 'search';
                this.enterkeyhint = this.enterkeyhint || 'search';
                break;
            case 'number':
            case 'numeric':
                this.inputmode = this.inputmode || 'numeric';
                break;
            case 'amount':
                this.inputmode = this.inputmode || 'decimal';
                this.mask = {
                    mask: Number,
                    scale: 2,
                    radix: '.',
                    mapToRadix: ['.'],
                    thousandsSeparator: ',',
                    padFractionalZeros: false,
                    normalizeZeros: true,
                };
                break;
            default:
                this.inputmode = this.inputmode || 'text';
                break;
        }
        if (this.mask) {
            this.inputType = 'text';
        }
    }
    /**
     * Clears the input value
     */
    clearInput() {
        this.value = '';
        this.el.dispatchEvent(new InputEvent('input', { bubbles: false }));
        if (this.typingTimer != null) {
            clearTimeout(this.typingTimer);
        }
        this.onClearInputEvent.emit(this.typingEvent);
    }
    /**
     * Render component
     */
    render() {
        return h(Host, { key: '825ce69e2cb5d84e4dc1a0373d4a308909b1e84d', "data-for": this.name, style: { maxWidth: this.width } }, h("div", { key: 'e9464cf7ebf3c31a516f5f01704146c135a5e64e', class: cls({
                "input-container": true,
                "focus": this.isFocused,
                "loading": this.loading || this.isLoading,
                "disabled": this.isDisabled,
                "invalid": !this.isValid,
                "required": this.required,
            }) }, h("div", { key: 'c85abe76605719e92f972ae8c9a4ede38f5deadb', class: "indicator" }, h("slot", { key: '4f7568a766f7a769a743e98a585651520e2ee191', name: "indicator" })), h("div", { key: 'fce0ad0bf2ddea3bc05bb76d8e507302f7886ca6', class: "separator" }), h("div", { key: 'd1b4940bd52107cf467847055533094ad199c585', class: "buttons" }, this.inputType == 'numeric' && h("x-button", { key: '546475f01e78abd7478b12eddf60b7b537978764', icon: "plus", onClick: () => this.sumValue() })), h("div", { key: '03d16bc96501f06166fd772ce89e8b0d90dcee15', class: "wrap" }, this.showLabel() && h("label", { key: 'bb31f2166a68fccd689e701c5c89ecff5dadbd56', htmlFor: this.inputId }, this.label), h("input", { key: '4cb7c9acbe2496b5051419e6b9dfcd15598e84e4', "data-field": this.type, ref: el => this.input = el, id: this.inputId, type: this.inputType, required: this.required, disabled: this.isDisabled || this.loading || this.isLoading, pattern: this.pattern, readOnly: this.readonly, autoCorrect: this.autocorrect, autoCapitalize: this.capitalize, autoComplete: this.autocomplete, autoFocus: this.autofocus, enterKeyHint: this.enterkeyhint, inputMode: this.inputmode, min: this.min, max: this.max, minLength: this.minlength, maxLength: this.maxlength, placeholder: this.placeholderValue(), value: this.value, onPaste: () => this.onDoneTypingEvent.emit(this.typingEvent), onChange: (e) => this.onInput(e), onInput: (e) => this.onInput(e), onBlur: () => this.onBlurInput(), onFocus: () => this.onFocusInput(), onKeyUp: (e) => this.onKeyUpInput(e), onKeyDown: (e) => this.onKeyDownInput(e) }), this.inputType == 'color' && h("div", { key: '9a3a0e6409f98d75eebd2ca15c3ebb8fe40ca06d', class: "color-indicator" }, h("i", { key: '719a8b23780d4f382779b13c502c9dd1928c9fd4', style: { background: this.value.toString() } }), h("span", { key: '96caff93710d0c3180334bd69021a97d14e9e8d6' }, this.value || this.placeholderValue()))), this.loading && h("div", { key: 'd4befbaaf7c3f0fc42ffd61756103450cbefebee', class: "loading-indicator" }), this.typingindicate && this.isTyping && h("div", { key: '09b046a95aec1d0b894edf69d7011ed7a254cf10', class: "typing-indicator" }, h("span", { key: 'd7c5e09c5b6ee2ef2d118982e5c55eb437e8903e' }), h("span", { key: '5eca5ad09d65d4504a66eac37a2163fd84c9a5e9' }), h("span", { key: 'f41e5246bc8d42bd9a0e9abd3894c29f080d673a' })), h("div", { key: 'ec014d116b524ebc038062e1d311710446f348c4', class: "buttons" }, this.cleanable && !(this.typingindicate && this.isTyping) && (this.value.toString()).length > 0 && h("x-button", { key: '6537965f346f9c0f2fbd1bc3397b5cd32daef6d2', icon: "backclear", onClick: () => this.clearInput() }), this.type == 'password' && h("x-button", { key: 'aafe7ac440e70a5ff9f28bd71ff371f81d6553b2', icon: this.inputType == 'password' ? 'visible' : 'invisible', onClick: () => this.togglePasswordVisibility() }), this.inputType == 'numeric' && h("x-button", { key: 'b80a2cdfd5d88525c0b65cfb5eff4405cd54ed66', icon: "minus", onClick: () => this.subValue() }), h("slot", { key: 'c427b125a794548eb941ba60f7042bb190d76be4', name: "buttons" })), this.info && h("div", { key: 'fe68a73ccc0f09ef29adc0dde7cda9c03dce73d3', class: "info" }, h("x-tooltip", { key: 'da8dc7223e956f4a19a42d2c1e85ed4e4bb4e7bd', content: this.info }, h("x-icon", { key: 'ef0a1a37f95f2560bd60153aaa5926c549664b24', name: "info" })))), h("slot", { key: 'c26f68deb7f966181bd3633e54965e8720339dec' }));
    }
    static get is() { return "x-input"; }
    static get formAssociated() { return true; }
    static get originalStyleUrls() {
        return {
            "$": ["./style.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["style.css"]
        };
    }
    static get properties() {
        return {
            "label": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Element input label text"
                },
                "attribute": "label",
                "reflect": false
            },
            "name": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Element input name for forms keys"
                },
                "attribute": "name",
                "reflect": false
            },
            "type": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "InputType",
                    "resolved": "\"amount\" | \"color\" | \"email\" | \"hidden\" | \"number\" | \"numeric\" | \"password\" | \"search\" | \"tel\" | \"text\" | \"url\"",
                    "references": {
                        "InputType": {
                            "location": "local",
                            "path": "/opt/atlassian/pipelines/agent/build/src/components/x-input/component.tsx",
                            "id": "src/components/x-input/component.tsx::InputType"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Element input type"
                },
                "attribute": "type",
                "reflect": false,
                "defaultValue": "'text'"
            },
            "placeholder": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Element input placeholder text"
                },
                "attribute": "placeholder",
                "reflect": false
            },
            "info": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Element input information block"
                },
                "attribute": "info",
                "reflect": false
            },
            "typingtimeout": {
                "type": "number",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Element input debounce time"
                },
                "attribute": "typingtimeout",
                "reflect": false,
                "defaultValue": "1200"
            },
            "typingindicate": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Show typing indicator"
                },
                "attribute": "typingindicate",
                "reflect": false
            },
            "required": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Element input required for forms validations"
                },
                "attribute": "required",
                "reflect": false
            },
            "loading": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Element show loading and block for edit"
                },
                "attribute": "loading",
                "reflect": false
            },
            "readonly": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Element input block for edit"
                },
                "attribute": "readonly",
                "reflect": false
            },
            "cleanable": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Element input clear button"
                },
                "attribute": "cleanable",
                "reflect": false
            },
            "autofocus": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Element autofocus on render"
                },
                "attribute": "autofocus",
                "reflect": false
            },
            "capitalize": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "InputAutocapitalizeTypes",
                    "resolved": "\"characters\" | \"none\" | \"off\" | \"on\" | \"sentences\" | \"words\"",
                    "references": {
                        "InputAutocapitalizeTypes": {
                            "location": "local",
                            "path": "/opt/atlassian/pipelines/agent/build/src/components/x-input/component.tsx",
                            "id": "src/components/x-input/component.tsx::InputAutocapitalizeTypes"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Element input autocapitalize options"
                },
                "attribute": "capitalize",
                "reflect": false,
                "defaultValue": "'off'"
            },
            "autocorrect": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "'on' | 'off'",
                    "resolved": "\"off\" | \"on\"",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Element input auto correction should be enabled"
                },
                "attribute": "autocorrect",
                "reflect": false,
                "defaultValue": "'off'"
            },
            "pattern": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Element input regular expression that the value is checked against"
                },
                "attribute": "pattern",
                "reflect": false
            },
            "autocomplete": {
                "type": "string",
                "mutable": true,
                "complexType": {
                    "original": "InputAutocompleteTypes",
                    "resolved": "\"name\" | \"on\" | \"off\" | \"tel\" | \"url\" | \"email\" | \"honorific-prefix\" | \"given-name\" | \"additional-name\" | \"family-name\" | \"honorific-suffix\" | \"nickname\" | \"username\" | \"new-password\" | \"current-password\" | \"one-time-code\" | \"organization-title\" | \"organization\" | \"street-address\" | \"address-line1\" | \"address-line2\" | \"address-line3\" | \"address-level4\" | \"address-level3\" | \"address-level2\" | \"address-level1\" | \"country\" | \"country-name\" | \"postal-code\" | \"cc-name\" | \"cc-given-name\" | \"cc-additional-name\" | \"cc-family-name\" | \"cc-number\" | \"cc-exp\" | \"cc-exp-month\" | \"cc-exp-year\" | \"cc-csc\" | \"cc-type\" | \"transaction-currency\" | \"transaction-amount\" | \"language\" | \"bday\" | \"bday-day\" | \"bday-month\" | \"bday-year\" | \"sex\" | \"tel-country-code\" | \"tel-national\" | \"tel-area-code\" | \"tel-local\" | \"tel-extension\" | \"impp\" | \"photo\"",
                    "references": {
                        "InputAutocompleteTypes": {
                            "location": "local",
                            "path": "/opt/atlassian/pipelines/agent/build/src/components/x-input/component.tsx",
                            "id": "src/components/x-input/component.tsx::InputAutocompleteTypes"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Element input value of the control can be automatically completed by the browser"
                },
                "attribute": "autocomplete",
                "reflect": false,
                "defaultValue": "'off'"
            },
            "enterkeyhint": {
                "type": "string",
                "mutable": true,
                "complexType": {
                    "original": "InputEnterKeyHintType",
                    "resolved": "\"done\" | \"enter\" | \"go\" | \"next\" | \"previous\" | \"search\" | \"send\"",
                    "references": {
                        "InputEnterKeyHintType": {
                            "location": "local",
                            "path": "/opt/atlassian/pipelines/agent/build/src/components/x-input/component.tsx",
                            "id": "src/components/x-input/component.tsx::InputEnterKeyHintType"
                        }
                    }
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Element input hint to the browser for which enter key to display"
                },
                "attribute": "enterkeyhint",
                "reflect": false
            },
            "inputmode": {
                "type": "string",
                "mutable": true,
                "complexType": {
                    "original": "InputModeType",
                    "resolved": "\"decimal\" | \"email\" | \"none\" | \"numeric\" | \"search\" | \"tel\" | \"text\" | \"url\"",
                    "references": {
                        "InputModeType": {
                            "location": "local",
                            "path": "/opt/atlassian/pipelines/agent/build/src/components/x-input/component.tsx",
                            "id": "src/components/x-input/component.tsx::InputModeType"
                        }
                    }
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Element input hint to the browser for which keyboard to display"
                },
                "attribute": "inputmode",
                "reflect": false
            },
            "max": {
                "type": "number",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Element input maximun value"
                },
                "attribute": "max",
                "reflect": false
            },
            "min": {
                "type": "number",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Element input minimun value"
                },
                "attribute": "min",
                "reflect": false
            },
            "step": {
                "type": "number",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Element input value in steps only for numeric|number type"
                },
                "attribute": "step",
                "reflect": false
            },
            "maxlength": {
                "type": "number",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Element input maximun count of characters"
                },
                "attribute": "maxlength",
                "reflect": false
            },
            "minlength": {
                "type": "number",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Element input minimun count of characters"
                },
                "attribute": "minlength",
                "reflect": false
            },
            "width": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Element input width"
                },
                "attribute": "width",
                "reflect": false
            },
            "mask": {
                "type": "string",
                "mutable": true,
                "complexType": {
                    "original": "string | Object",
                    "resolved": "Object | string",
                    "references": {
                        "Object": {
                            "location": "global",
                            "id": "global::Object"
                        }
                    }
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Element input imaks pattern/options"
                },
                "attribute": "mask",
                "reflect": false
            },
            "value": {
                "type": "any",
                "mutable": true,
                "complexType": {
                    "original": "string | number | null",
                    "resolved": "number | string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Element input value"
                },
                "attribute": "value",
                "reflect": false,
                "defaultValue": "''"
            }
        };
    }
    static get states() {
        return {
            "inputType": {},
            "isValid": {},
            "isTyping": {},
            "isFocused": {},
            "isLoading": {},
            "isDisabled": {}
        };
    }
    static get events() {
        return [{
                "method": "onStartTypingEvent",
                "name": "startTyping",
                "bubbles": false,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "On input typing start event"
                },
                "complexType": {
                    "original": "KeyboardEvent",
                    "resolved": "KeyboardEvent",
                    "references": {
                        "KeyboardEvent": {
                            "location": "global",
                            "id": "global::KeyboardEvent"
                        }
                    }
                }
            }, {
                "method": "onDoneTypingEvent",
                "name": "doneTyping",
                "bubbles": false,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "On done input typing event"
                },
                "complexType": {
                    "original": "KeyboardEvent",
                    "resolved": "KeyboardEvent",
                    "references": {
                        "KeyboardEvent": {
                            "location": "global",
                            "id": "global::KeyboardEvent"
                        }
                    }
                }
            }, {
                "method": "onClearInputEvent",
                "name": "clearInput",
                "bubbles": false,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "On clear input event"
                },
                "complexType": {
                    "original": "any",
                    "resolved": "any",
                    "references": {}
                }
            }, {
                "method": "onValidateInputEvent",
                "name": "validated",
                "bubbles": false,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "On validate input event"
                },
                "complexType": {
                    "original": "HTMLInputElement",
                    "resolved": "HTMLInputElement",
                    "references": {
                        "HTMLInputElement": {
                            "location": "global",
                            "id": "global::HTMLInputElement"
                        }
                    }
                }
            }];
    }
    static get elementRef() { return "el"; }
    static get watchers() {
        return [{
                "propName": "mask",
                "methodName": "watchMask"
            }, {
                "propName": "type",
                "methodName": "watchType"
            }];
    }
    static get attachInternalsMemberName() { return "internals"; }
}
