import { Host, h } from "@stencil/core";
import { cls, getId } from "../../utils/helpers";
import { Lang } from "../../services/lang";
import IMask from "imask";
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.validate = 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.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
     */
    maskChanged() {
        if (this.mask && !this.maskInstance) {
            this.maskInstance = IMask(this.el.querySelector('input'), this.mask);
        }
        this.maskInstance.updateOptions(this.mask);
    }
    /**
     * On watch type property hook
     */
    typeChanged() {
        this.validateInputType();
    }
    /**
     * Set the value of the input
     */
    async setValue(value) {
        this.value = value;
        this.internals.setFormValue(value);
    }
    /**
     * Validate the input and get the validation result
    */
    async checkValidity() {
        this.onValidate();
        return this.isValid;
    }
    /**
     * 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 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.el.querySelector('input'), this.mask);
        }
    }
    /**
     * Set element value by event
     *
     * @param event
     */
    onInput(event) {
        this.value = event.target.value;
        this.internals.setFormValue(event.target.value);
    }
    /**
     * This called on input field is unfocused
     */
    onBlurInput() {
        this.isFocused = false;
        setTimeout(() => this.onValidate(), 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 called on input field detect key is down
     */
    onKeyDownInput() {
        clearTimeout(this.typingTimer);
    }
    /**
     * This called on input field finished typing
     */
    onDoneTypingInput() {
        this.onValidate();
        this.isTyping = false;
        this.onDoneTypingEvent.emit(this.typingEvent);
    }
    /**
     * Validate the field input
     *
     * @returns
     */
    onValidate() {
        if (!this.validate) {
            return;
        }
        const selectors = ["input", "select", "textarea"];
        let input = null;
        selectors.forEach((selector) => {
            if (input === null) {
                input = this.el.querySelector(selector);
            }
        });
        this.isValid = (input === null || input === void 0 ? void 0 : input.validity) ? input.validity.valid : true;
        this.onValidateInputEvent.emit(input);
    }
    /**
     * Return validation of showing the input label
     *
     * @returns
     */
    showLabel() {
        var _a;
        return (this.label && this.placeholder) || (this.label && (((_a = this.value) === null || _a === void 0 ? void 0 : _a.toString()).length > 0 || this.isFocused)) || (this.label && ['color', 'otp'].includes(this.type));
    }
    /**
     * Compute the placeholder value
     *
     * @returns
     */
    placeholderValue() {
        if (this.type == 'otp') {
            return [...Array(this.maxlength || 0).keys()].map(() => '0').join('');
        }
        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);
    }
    /**
     * 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);
    }
    /**
     * 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 || 'numeric';
                this.mask = {
                    mask: Number,
                    scale: 2,
                    radix: '.',
                    mapToRadix: ['.'],
                    thousandsSeparator: ',',
                    padFractionalZeros: false,
                    normalizeZeros: true,
                };
                break;
            case 'otp':
                this.inputmode = this.inputmode || 'text';
                this.inputType = 'tel';
                this.autocomplete = 'one-time-code';
                this.mask = [...Array(this.maxlength || 0).keys()].map(() => '0').join('');
                break;
            default:
                this.inputmode = this.inputmode || 'text';
                break;
        }
        if (this.mask) {
            this.inputType = 'text';
        }
    }
    /**
     * Clears the input value
     */
    clearInput() {
        this.value = '';
        if (this.typingTimer != null) {
            clearTimeout(this.typingTimer);
        }
        this.onClearInputEvent.emit(this.typingEvent);
    }
    /**
     * Paste the clipboard content to the input
     */
    pasteClipboard() {
        navigator.clipboard.readText().then((text) => {
            if (this.maskInstance) {
                this.maskInstance.unmaskedValue = text;
                this.value = this.maskInstance.value;
                this.internals.setFormValue(this.maskInstance.value);
                this.el.dispatchEvent(new CustomEvent('input'));
            }
            else {
                this.value = text;
                this.internals.setFormValue(this.value);
                this.el.dispatchEvent(new CustomEvent('input'));
            }
        });
    }
    /**
     * Render component
     */
    render() {
        return h(Host, { key: '5244110702239e33c94ec13f7c0d266af86b58ac', "data-for": this.name }, h("div", { key: '76d78c00bf8d0647ed2b7c7e3de3a7cb419c53cd', 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: 'c7047eff4fe90d0f3a76b3f159efd009f8d55285', class: "indicator" }, h("slot", { key: 'bccbc08bc7b639048c8f68b35a905782cc34f275', name: "indicator" })), h("div", { key: '71fed79ab545551ae8714ccde893174b60bdb7b8', class: "separator" }), h("div", { key: '13e7a5718cd9e65d5dff0fddb5dbed153e04cd2c', class: "buttons" }, this.inputType == 'numeric' && h("x-button", { key: 'a396d3e0c7be626b6763cb95b12e2452ea169978', icon: "plus", onClick: () => this.sumValue() })), h("div", { key: 'f10ede395012136ab703cfccff3bd30340b183ed', class: "wrap" }, this.showLabel() && h("label", { key: '64a1d566c3bd1b9c4c120b688a72867489aad4fe', htmlFor: this.inputId }, this.label), h("input", { key: 'cd3d607bee28db31391d23641c03f67886245fc2', "data-field": this.type, 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, onChange: (e) => this.onInput(e), onInput: (e) => this.onInput(e), onBlur: () => this.onBlurInput(), onFocus: () => this.onFocusInput(), onKeyUp: (e) => this.onKeyUpInput(e), onKeyDown: () => this.onKeyDownInput() }), this.inputType == 'color' && h("div", { key: '551925ca333361133a570cc2682874b0586bd304', class: "color-indicator" }, h("i", { key: 'dd9d936d6a6502e1840a3f1684dd7fa328895cf0', style: { background: this.value.toString() } }), h("span", { key: 'e0921e4658a8eb052a21539a8accc277ed74ebb9' }, this.value || this.placeholderValue() || Lang.get('fields.input.color')))), this.loading && h("div", { key: '2cd48f02735377752d4576f21a6b7cb5830ed2d0', class: "loading-indicator" }), h("div", { key: '1e6b7564d5ded31a73cf2f3413e902a1a0d2b9f9', class: "buttons" }, this.cleanable && (this.value.toString()).length > 0 && h("x-button", { key: '3b48a6ed2b016211387c3084f79943b2b05ed686', icon: "backclear", onClick: () => this.clearInput() }), this.type == 'password' && h("x-button", { key: '02b2f241b01200b733eb651c4df011290f37b030', icon: this.inputType == 'password' ? 'visible' : 'invisible', onClick: () => this.togglePasswordVisibility() }), this.type == 'otp' && h("x-button", { key: 'e81a47648e0c1c1453079e9a094141ef75b0dae0', icon: "clipboard", onClick: () => this.pasteClipboard() }), this.inputType == 'numeric' && h("x-button", { key: '6a813781c8bf63ba767974c6d49c1d99be3b8154', icon: "minus", onClick: () => this.subValue() }), h("slot", { key: 'b93e47b08b5ee9f3e36d2ca13e887cc4d9012692', name: "buttons" })), this.info && h("div", { key: 'e497e070f56f31b7adaad552e22d547923e12682', class: "info" }, h("x-tooltip", { key: 'fe15196bced0db136a2e5a78b436e12542b765cc', content: this.info }, h("x-icon", { key: 'f061255d058b0907a0b5739262de821c5e8c83ef', name: "info" })))), h("slot", { key: '80ef39a7c18f36e02a904589a83432efafcfbc61' }));
    }
    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\" | \"number\" | \"numeric\" | \"otp\" | \"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"
            },
            "validate": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Element enable internal validation"
                },
                "attribute": "validate",
                "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\" | \"url\" | \"on\" | \"off\" | \"email\" | \"tel\" | \"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
            },
            "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": "onDoneTypingEvent",
                "name": "doneTyping",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "On done input typing finish event"
                },
                "complexType": {
                    "original": "any",
                    "resolved": "any",
                    "references": {}
                }
            }, {
                "method": "onClearInputEvent",
                "name": "clearInput",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "On clear input event"
                },
                "complexType": {
                    "original": "any",
                    "resolved": "any",
                    "references": {}
                }
            }, {
                "method": "onValidateInputEvent",
                "name": "validated",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "On validate input event"
                },
                "complexType": {
                    "original": "HTMLObjectElement",
                    "resolved": "HTMLObjectElement",
                    "references": {
                        "HTMLObjectElement": {
                            "location": "global",
                            "id": "global::HTMLObjectElement"
                        }
                    }
                }
            }];
    }
    static get methods() {
        return {
            "setValue": {
                "complexType": {
                    "signature": "(value: string) => Promise<void>",
                    "parameters": [{
                            "name": "value",
                            "type": "string",
                            "docs": ""
                        }],
                    "references": {
                        "Promise": {
                            "location": "global",
                            "id": "global::Promise"
                        }
                    },
                    "return": "Promise<void>"
                },
                "docs": {
                    "text": "Set the value of the input",
                    "tags": []
                }
            },
            "checkValidity": {
                "complexType": {
                    "signature": "() => Promise<boolean>",
                    "parameters": [],
                    "references": {
                        "Promise": {
                            "location": "global",
                            "id": "global::Promise"
                        }
                    },
                    "return": "Promise<boolean>"
                },
                "docs": {
                    "text": "Validate the input and get the validation result",
                    "tags": []
                }
            }
        };
    }
    static get elementRef() { return "el"; }
    static get watchers() {
        return [{
                "propName": "mask",
                "methodName": "maskChanged"
            }, {
                "propName": "type",
                "methodName": "typeChanged"
            }];
    }
    static get attachInternalsMemberName() { return "internals"; }
}
