text: import { __decorate } from "tslib";
  import { Injectable } from '@angular/core';
  import { messages } from './messages';
  import { botReplies, gifsLinks, imageLinks } from './bot-replies';
  let ChatService = class ChatService {
      loadMessages() {
          return messages;
      }
      loadBotReplies() {
          return botReplies;
      }
      reply(message) {
          const botReply = this.loadBotReplies()
              .find((reply) => message.search(reply.regExp) !== -1);
          if (botReply.reply.type === 'quote') {
              botReply.reply.quote = message;
          }
          if (botReply.type === 'gif') {
              botReply.reply.files[0].url = gifsLinks[Math.floor(Math.random() * gifsLinks.length)];
          }
          if (botReply.type === 'pic') {
              botReply.reply.files[0].url = imageLinks[Math.floor(Math.random() * imageLinks.length)];
          }
          if (botReply.type === 'group') {
              botReply.reply.files[1].url = gifsLinks[Math.floor(Math.random() * gifsLinks.length)];
              botReply.reply.files[2].url = imageLinks[Math.floor(Math.random() * imageLinks.length)];
          }
          botReply.reply.text = botReply.answerArray[Math.floor(Math.random() * botReply.answerArray.length)];
          return Object.assign({}, botReply.reply);
      }
  };
  ChatService = __decorate([
      Injectable()
  ], ChatService);
  export { ChatService };
  //# sourceMappingURL=chat.service.js.map