JSFiddle - React, Tailwind, and code Playground
by Ryan Brackett
JavaScript
$(document).ready(function() {
var e = $(window).width(),
t = $(window).height(),
s = ($("#chat-messenger").height(), "//www.nghs.com/includes/js/chat/images/nghs-leaf_avatar.svg");
$(".chat-options ul").children().each(function(e) {
e += 1, $(this).addClass("chat-option").attr("id", "option-item-" + e)
}), $(".chat-responses").children().each(function(e) {
e += 1, $(this).addClass("chat-response").attr("id", "response-item-" + e)
}), e < 700 && t < 700 && $("#chat-messenger").css({
height: t,
"max-height": t,
"min-height": 0
}), /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || t < 700 && ($("#chat-messenger").css({
height: t - 150,
"max-height": t - 150,
"min-height": 0
}), $("div#chat-messenger .chat-window").css({
"min-height": 0
})), $("#chat-launcher").click(function() {
$("#chat-messenger").toggleClass("active"), $("#chat-tag").fadeOut(), $("#chat-ready").get(0).play(), ga("send", "event", "Chatbot", "OnMouseDown", "Launch Clicked")
}), $(".chat-options.enabled .chat-option").click(function() {
$("#chat-messenger").addClass("session"), $(".chat-options.enabled .chat-option").removeClass("active"), $(this).addClass("active");
var e = $(this).html(),
t = $(this).attr("data-tag"),
a = $(this).attr("id").split("-")[2],
i = $(".chat-responses #response-item-" + a).html();
$(".chat-responses .chat-response").hide(), $(".message-thinking").fadeIn(), $(".chat-window-inner").append("<div class='user-message option-item-" + a + "'><div class='selected-option'>" + e + "</div><div class='message-meta'>Sent by: You</div></div>"), $(".chat-window").delay(0).animate({
scrollTop: $(".user-message:last-of-type").offset().top
}, 800), setTimeout(function() {
$(".chat-window-inner").append('<div class="response chatbot-message reponse-item-' + a + '"><div class="nghs author-avatar"><img src="' + s + '"/></div><div...