import { h } from "@stencil/core";
export const mapOptionsToComboBoxItemModel = (options) => {
    return options.map(option => {
        var _a;
        return {
            value: option.id,
            caption: option.label,
            startImgSrc: (_a = option.iconName) !== null && _a !== void 0 ? _a : ""
        };
    });
};
const escapeRegExp = (string) => {
    return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
};
export const hiChar = (text, search) => {
    if (!search) {
        return text;
    }
    const escapedSearch = escapeRegExp(search);
    const parts = text.split(new RegExp(`(${escapedSearch})`, "gi"));
    return parts.map((part, i) => part.toLowerCase() === search.toLowerCase() ? (h("span", { key: i, class: "hiChar" }, part)) : (part));
};
//# sourceMappingURL=helpers.js.map
