"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.mapKmehrHost = exports.mapSamHost = void 0;
const samRedirectMap = {
    'api.icure.cloud': 'sam.icure.cloud',
    'nightly.icure.cloud': 'nightly-sam.icure.cloud',
};
const kmehrRedirectMap = {
    'api.icure.cloud': 'kmehr.icure.cloud',
    'nightly.icure.cloud': 'nightly-kmehr.icure.cloud',
};
function mapHost(host, redirectMap) {
    for (const [original, redirect] of Object.entries(redirectMap)) {
        if (host.startsWith(`https://${original}`) || host.startsWith(`wss://${original}`)) {
            return host.replace(RegExp(`^(https|wss)://${original}`), `$1://${redirect}`);
        }
    }
    return host;
}
const mapSamHost = (host) => mapHost(host, samRedirectMap);
exports.mapSamHost = mapSamHost;
const mapKmehrHost = (host) => mapHost(host, kmehrRedirectMap);
exports.mapKmehrHost = mapKmehrHost;
//# sourceMappingURL=proxy-utils.js.map