"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getRatesUrl = void 0;
var _toUrlParams = require("./toUrlParams");
var _Core = require("../../Core.constants");
const getRatesUrl = function () {
  var _rooms$split, _rooms$split$map;
  let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  const {
    applyClubDiscount,
    chainSelectorValue,
    checkin,
    clientCodeStrictSearch,
    contactCenter,
    currency,
    device: deviceType,
    env,
    fingerprint,
    home,
    hsri,
    idchain,
    idtokenprovider,
    language,
    nights,
    notification,
    parties,
    promocode,
    rooms,
    utm_source,
    variant
  } = params;
  return "".concat(process.env.SERVICE_BOOKING, "/").concat(_Core.REDIRECT_PATH).concat((0, _toUrlParams.toUrlParams)({
    applyClubDiscount,
    cart: rooms === null || rooms === void 0 ? void 0 : (_rooms$split = rooms.split(',')) === null || _rooms$split === void 0 ? void 0 : (_rooms$split$map = _rooms$split.map(room => room.replace(/\|/g, '--').split(':')[0])) === null || _rooms$split$map === void 0 ? void 0 : _rooms$split$map.join(','),
    chainSelectorValue,
    checkin,
    clientCode: promocode,
    clientCodeStrictSearch,
    contactCenter,
    currency,
    deviceType,
    env,
    fingerprint,
    home,
    hsri,
    idchain,
    idtokenprovider,
    lang: language,
    nights,
    notification,
    parties,
    utm_source,
    variant
  }));
};
exports.getRatesUrl = getRatesUrl;
//# sourceMappingURL=getRatesUrl.js.map