in dialogflow-prebuilt-agents/client_side_messenger/retail_assistant/retail_assistant.js [97:163]
function setupHtml() {
console.log('setting up html');
// Create the review container
const reviewContainer = document.createElement('div');
reviewContainer.id = 'review-template';
reviewContainer.classList.add('review-container');
reviewContainer.style.display = 'none';
// Create the review element
const review = document.createElement('div');
review.classList.add('review');
// Create the review header
const reviewHeader = document.createElement('div');
reviewHeader.classList.add('review-header');
// Create the user avatar
const userAvatar = document.createElement('div');
userAvatar.classList.add('user-avatar');
// Create the user info
const userInfo = document.createElement('div');
userInfo.classList.add('user-info');
// Create the user name
const userName = document.createElement('div');
userName.classList.add('user-name');
// Create the user rating
const userRating = document.createElement('div');
userRating.classList.add('user-rating');
// Create the stars
const stars = document.createElement('span');
stars.classList.add('stars');
// Create the rating score
const ratingScore = document.createElement('span');
ratingScore.classList.add('rating-score');
// Create the review text
const reviewText = document.createElement('p');
reviewText.classList.add('review-text');
// Create the review title
const reviewTitle = document.createElement('p');
reviewTitle.classList.add('review-title');
// Append elements to their parents
userRating.appendChild(stars);
userRating.appendChild(ratingScore);
userInfo.appendChild(userName);
userInfo.appendChild(userRating);
reviewHeader.appendChild(userAvatar);
reviewHeader.appendChild(userInfo);
review.appendChild(reviewHeader);
review.appendChild(reviewText);
review.appendChild(reviewTitle);
reviewContainer.appendChild(review);
// Insert the review container next to the <df-messenger>
// dfMessenger.parentNode.insertBefore(reviewContainer,
// dfMessenger.nextSibling);
const chatWindowWrapper = document.querySelector('.chat-window-wrapper');
chatWindowWrapper.append(reviewContainer);
console.log({chatWindowWrapper});
}