"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getHotels = void 0;
const getHotels = function () {
  let dataSource = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  let id = arguments.length > 1 ? arguments[1] : undefined;
  if (!id) return;
  let hotels;
  for (const {
    ids = [],
    tagId,
    tags = []
  } of dataSource) {
    if ((!tagId || tagId !== id) && tags.length > 0) {
      var _hotels;
      hotels = getHotels(tags, id);
      if (((_hotels = hotels) === null || _hotels === void 0 ? void 0 : _hotels.length) > 0) break;
    } else if (tagId === id) {
      hotels = ids;
      break;
    }
  }
  return hotels;
};
exports.getHotels = getHotels;
//# sourceMappingURL=getHotels.js.map