/**
 * `AutoCompleteTextSearchMode` - Enum which describes possible options.
 *
 * @public
 */
export var AutoCompleteTextSearchMode;
(function (AutoCompleteTextSearchMode) {
    /**
     * `startsWith` - The search text must be at the beginning of the string.
     */
    AutoCompleteTextSearchMode["StartsWith"] = "startsWith";
    /**
     * `startsWithCaseSensitive` - The search text must be at the beginning of the string and is case sensitive.
     */
    AutoCompleteTextSearchMode["StartsWithCaseSensitive"] = "startsWithCaseSensitive";
    /**
     * `contains` - The search text must be contained in the string.
     */
    AutoCompleteTextSearchMode["Contains"] = "contains";
    /**
     * `containsCaseSensitive` - The search text must be contained in the string and is case sensitive.
     */
    AutoCompleteTextSearchMode["ContainsCaseSensitive"] = "containsCaseSensitive";
    /**
     * `equals` - The search text must be equal to the string.
     */
    AutoCompleteTextSearchMode["Equals"] = "equals";
    /**
     * `equalsCaseSensitive` - The search text must be equal to the string and is case sensitive.
     */
    AutoCompleteTextSearchMode["EqualsCaseSensitive"] = "equalsCaseSensitive";
})(AutoCompleteTextSearchMode || (AutoCompleteTextSearchMode = {}));
(function (AutoCompleteTextSearchMode) {
    function getPredicate(mode) {
        switch (mode) {
            case AutoCompleteTextSearchMode.Contains:
                return contains;
            case AutoCompleteTextSearchMode.ContainsCaseSensitive:
                return containsCaseSensitive;
            case AutoCompleteTextSearchMode.Equals:
                return equals;
            case AutoCompleteTextSearchMode.EqualsCaseSensitive:
                return equalsCaseSensitive;
            case AutoCompleteTextSearchMode.StartsWith:
                return startsWith;
            case AutoCompleteTextSearchMode.StartsWithCaseSensitive:
                return startsWithCaseSensitive;
            default:
                throw new Error(`Invalid filter mode: ${String(mode)}`);
        }
    }
    AutoCompleteTextSearchMode.getPredicate = getPredicate;
    function contains(text, value) {
        return value.toLowerCase().includes(text.toLowerCase());
    }
    function containsCaseSensitive(text, value) {
        return value.includes(text);
    }
    function equals(text, value) {
        return value.localeCompare(text, undefined, { sensitivity: 'accent' }) === 0;
    }
    function equalsCaseSensitive(text, value) {
        return value.localeCompare(text, undefined, { sensitivity: 'case' }) === 0;
    }
    function startsWith(text, value) {
        return value.toLowerCase().startsWith(text.toLowerCase());
    }
    function startsWithCaseSensitive(text, value) {
        return value.startsWith(text);
    }
})(AutoCompleteTextSearchMode || (AutoCompleteTextSearchMode = {}));
//# sourceMappingURL=AutoCompleteTextSearchMode.js.map