/*!
 * KoliBri - The accessible HTML-Standard
 */
'use strict';

var common = require('./common-DAAt5YQ7.js');
var spellCheck = require('./spell-check-CnmPp0It.js');
var suggestions = require('./suggestions-hTUeCecL.js');
var controller = require('./controller-3DispTOw.js');

const inputTextTypeOptions = ['text', 'search', 'url', 'tel'];
const isInputTextTypePropType = (value) => {
    return typeof value === 'string' && inputTextTypeOptions.includes(value);
};
const validateTypeInputText = (component, value) => {
    common.watchValidator(component, '_type', isInputTextTypePropType, new Set(inputTextTypeOptions), value);
};

class InputTextEmailController extends controller.InputPasswordController {
    constructor(component, name, host) {
        super(component, name, host);
        this.component = component;
    }
    validateSuggestions(value) {
        suggestions.validateSuggestions(this.component, value);
    }
    componentWillLoad() {
        super.componentWillLoad();
        this.validateSuggestions(this.component._suggestions);
    }
}
class InputTextController extends InputTextEmailController {
    constructor(component, name, host) {
        super(component, name, host);
        this.hasError = false;
        this.component = component;
    }
    validateSpellCheck(value) {
        spellCheck.validateSpellCheck(this.component, value);
    }
    validateType(value) {
        validateTypeInputText(this.component, value);
    }
    componentWillLoad() {
        super.componentWillLoad();
        this.validateSpellCheck(this.component._spellCheck);
        this.validateType(this.component._type);
    }
}

exports.InputTextController = InputTextController;
exports.InputTextEmailController = InputTextEmailController;
//# sourceMappingURL=controller-CShnVKSd.js.map

//# sourceMappingURL=controller-CShnVKSd.js.map