Order: ${currentOrder.order_name}
${new Date(currentOrder.created_at).toLocaleDateString('en-US', { month: 'long', day: 'numeric', year: 'numeric' })}
${currentOrder.fulfillment_status}
I want to return some items
${name} - we provide no questions asked returns on eligible items. Please select your reason for return and refund options and we'll get back to you with a confirmation.
`
let bodyHtml = `
${BreadCrumbHtml}
${HelpHtml}
`
let rvMessengerHeader = widgetContentFrameDEV.body.querySelector('.rvMessengerHeader');
rvMessengerHeader.insertAdjacentHTML("afterend", bodyHtml);
RVBotViewDev.orderBreadCrumbsEvent();
RVBotViewDev.initiateReturnEvent();
},
initiateReturnEvent: function(){
let initateReturn = widgetContentFrameDEV.body.querySelector('.initateReturn');
if( initateReturn ){
initateReturn.addEventListener("click", RVBotViewDev.initateReturnFunc);
}
},
initateReturnFunc: function(){
let rvReturnOptions = widgetContentFrameDEV.body.querySelector('.rvReturnOptions');
if(rvReturnOptions){
let orderIndex = RV_ORDER_BREADCRUMBS.currentOrderIndex;
let currentOrder = RV_CUSTOMER_ORDER[orderIndex];
let rvHelpMiddleWrap = widgetContentFrameDEV.body.querySelector('.rvHelpMiddleWrap');
rvHelpMiddleWrap.innerHTML = "";
let rvHelpBottomWrap = widgetContentFrameDEV.body.querySelector('.rvHelpBottomWrap')
rvHelpBottomWrap.innerHTML = "";
let products = currentOrder.products;
let productHtml = "";
for (let i = 0; i < products.length; i++){
let product = products[i];
let productImage = product.productImage;
let productImageHtml = ""
if( productImage && productImage.length > 0 ){
productImageHtml = `
`
}else{
productImageHtml = `
`
}
productHtml += `
${product.name}
$${product.price}*${product.quantity}
$${product.price*product.quantity}
`
}
let middleHtml = `
${productHtml}
Reason of Return
Select
I have changed my mind
Incorrect size or color
Item not as described
Didn't meet my expectation
I don't need the product any more
Refund or Exchange
Select
I'd like to exchange this product
I'd like a refund as store credit (immediate)
I'd like a refund to my original Payment (2-5 days)
`
let endHtml = `
Proceed
`
rvHelpMiddleWrap.innerHTML = middleHtml;
rvHelpBottomWrap.innerHTML = endHtml;
RVBotViewDev.proceedWithReturnEvent();
}
},
proceedWithReturnEvent: function(){
let selectAllOption = widgetContentFrameDEV.body.querySelector('.selectAllOption');
if( selectAllOption ){
selectAllOption.addEventListener("change", RVBotViewDev.productReturnSelectAllFunc);
}
let multipleCheckBoxes = widgetContentFrameDEV.body.querySelectorAll('.productSelect');
for( let i = 0; i < multipleCheckBoxes.length; i++ ){
multipleCheckBoxes[i].addEventListener("change", RVBotViewDev.singleProductCheckboxFunc);
}
let proceedReturnDom = widgetContentFrameDEV.body.querySelector('#proceedReturn');
if( proceedReturnDom ){
proceedReturnDom.addEventListener("click", RVBotViewDev.returnFormSubmissionFunc);
}
},
returnFormSubmissionFunc: async function(){
let multipleCheckBoxes = widgetContentFrameDEV.body.querySelectorAll('.productSelect');
let reasonforreturn = widgetContentFrameDEV.body.querySelector('#reasonforreturn');
let refundOrExchange = widgetContentFrameDEV.body.querySelector('#refundOrExchange');
let productArray = [];
let returnOption = reasonforreturn ? reasonforreturn.value : "";
let refundOption = refundOrExchange ? refundOrExchange.value : "" ;
for( let i = 0; i < multipleCheckBoxes.length; i++ ){
if ( multipleCheckBoxes[i].checked ){
let value = multipleCheckBoxes[i].value;
if( !productArray.includes(value) ){
productArray.push(value);
}
}
}
if( productArray.length === 0 ){
widgetContentFrameDEV.body.querySelector('.rvHelpMiddleWrap .errorFeedBack').innerHTML = "
Please Select the product First
";
}else if( returnOption === "" ){
widgetContentFrameDEV.body.querySelector('.rvHelpMiddleWrap .errorFeedBack').innerHTML = "
Please choose return option
";
}else if( refundOption === "" ){
widgetContentFrameDEV.body.querySelector('.rvHelpMiddleWrap .errorFeedBack').innerHTML = "
Please choose refund option
";
}else{
RV_RETURN_FORM = true;
widgetContentFrameDEV.body.querySelector('.rvHelpMiddleWrap .errorFeedBack').innerHTML = "";
await RVBotViewDev.startConversationFunc(false);
let orderIndex = RV_ORDER_BREADCRUMBS.currentOrderIndex;
let currentOrder = RV_CUSTOMER_ORDER[orderIndex];
let products = currentOrder.products;
let productFaqMessage1 = `
Order
>
I want to return some items
`
let rvMsg = `
` + RV_Customer_Name_DEV +`, ` +RVBotViewDev.rvGetCurrentTime() +`
${productFaqMessage1}
`
RV_CONVERSATION += rvMsg;
if( RV_MSG_BODY_HEIGHT_DEV !== "" ){
RVBotViewDev.removeTyping();
RV_MSG_BODY_HEIGHT_DEV.insertAdjacentHTML("beforebegin", rvMsg);
RVBotViewDev.rvResetMsgScroll();
}
await RVBotViewDev.rvSendMessage(encodeURIComponent(productFaqMessage1), "", "user");
let name = "";
if(currentOrder.first_name){
name += currentOrder.first_name
}
if(currentOrder.last_name){
name += " " + currentOrder.last_name
}
let productHtml = "";
let requestProduct = []
for( let i = 0; i < productArray.length; i++ ){
let currentProduct = products[productArray[i]];
requestProduct.push(currentProduct);
productHtml += `
${currentProduct.name} * ${currentProduct.quantity}
$${currentProduct.price*currentProduct.quantity}
`
}
let url = "/api/v1/requestOrder";
let data = {"Order_Id":currentOrder.order_id,"Order_Number":currentOrder.order_number,"Customer_Name":name, "Customer_Email": currentOrder.email, "Website_Id": Website_Id_DEV, "Order_type": "return", "products":requestProduct, "Visitor_Chat_Id": Visitor_Chat_Id_DEV, "Conversation_Id": Conversation_Id, "reason_for_return": returnOption, "refund_option": refundOption}
if( currentOrder.order_name ){
data.Order_Name = currentOrder.order_name;
}
RVBotViewDev.rvXmlJsonRequest(url, data);
let productFaqMessage2 = `
`
rvMsg = `
`
RV_CONVERSATION += rvMsg;
if( RV_MSG_BODY_HEIGHT_DEV !== "" ){
RVBotViewDev.removeTyping();
RV_MSG_BODY_HEIGHT_DEV.insertAdjacentHTML("beforebegin", rvMsg);
RVBotViewDev.rvResetMsgScroll();
}
await RVBotViewDev.rvSendMessage(encodeURIComponent(productFaqMessage2), "", "user");
let productFaqMessage3 = `
Order: ${currentOrder.order_name}
${new Date(currentOrder.created_at).toLocaleDateString('en-US', { month: 'long', day: 'numeric', year: 'numeric' })}
${currentOrder.fulfillment_status}
Amount
$ ${currentOrder.total_price}
Qty
${currentOrder.products.length}
Selected Items
${productHtml}
`
rvMsg = `
`
RV_CONVERSATION += rvMsg;
if( RV_MSG_BODY_HEIGHT_DEV !== "" ){
RVBotViewDev.removeTyping();
RV_MSG_BODY_HEIGHT_DEV.insertAdjacentHTML("beforebegin", rvMsg);
RVBotViewDev.rvResetMsgScroll();
}
await RVBotViewDev.rvSendMessage((productFaqMessage3), "", "user");
let msg = `Your Return request has been submitted succesfully. The team typically replies in ${botsetting_DEV.Bot_Agent_Reply_Time}`;
var rvMessage =`
Bot, ${RVBotViewDev.rvGetCurrentTime()}
${msg}
`;
RV_CONVERSATION += rvMessage;
RV_MSG_BODY_HEIGHT_DEV.insertAdjacentHTML("beforebegin", rvMessage);
await RVBotViewDev.rvSendMessage( msg, "", "bot");
RVBotViewDev.rvResetMsgScroll();
RV_Customer_Email_DEV = currentOrder.email;
msg = "you will notified here and on email ("+currentOrder.email+") when they reply.";
rvMessage =`
`;
RV_CONVERSATION += rvMessage;
RV_MSG_BODY_HEIGHT_DEV.insertAdjacentHTML("beforebegin", rvMessage);
await RVBotViewDev.rvSendMessage( msg, "", "bot");
RVBotViewDev.rvResetMsgScroll();
RVBotViewDev.rvCollectMessage();
}
},
singleProductCheckboxFunc: function(){
if( widgetContentFrameDEV.body.querySelector('.rvHelpMiddleWrap .errorFeedBack')){
widgetContentFrameDEV.body.querySelector('.rvHelpMiddleWrap .errorFeedBack').innerHTML = "";
}
},
productReturnSelectAllFunc: function(e){
if( widgetContentFrameDEV.body.querySelector('.rvHelpMiddleWrap .errorFeedBack')){
widgetContentFrameDEV.body.querySelector('.rvHelpMiddleWrap .errorFeedBack').innerHTML = "";
}
let options;
if( e.target.checked ){
options = true;
e.target.parentNode.querySelector('.selectAllText').innerHTML = "Unselect All";
}else{
options = false;
e.target.parentNode.querySelector('.selectAllText').innerHTML = "Select All";
}
let multipleCheckBoxes = widgetContentFrameDEV.body.querySelectorAll('.productSelect');
for( let i = 0; i < multipleCheckBoxes.length; i++ ){
multipleCheckBoxes[i].checked = options;
}
},
loadMap: function(address){
const myLatLng = { lat: address.latitude, lng: address.longitude };
const map = new widgetFrameDEV.contentWindow.google.maps.Map(widgetContentFrameDEV.body.querySelector("#map"), {
zoom: 15,
center: myLatLng,
mapTypeControl: false,
draggable: false,
scaleControl: false,
scrollwheel: false,
navigationControl: false,
streetViewControl: false,
});
let contentString = "Shipping Address
";
if( address.province ){
contentString += address.province+ ", "
}
if( address.country ){
contentString += address.country
}
const infowindow = new widgetFrameDEV.contentWindow.google.maps.InfoWindow({
content: contentString,
});
const marker = new widgetFrameDEV.contentWindow.google.maps.Marker({
position: myLatLng,
map,
//title: `Shipping Address
${address.province && address.province+" ,"}${ address.country && address.country}`
});
marker.addListener("click", () => {
infowindow.open({
anchor: marker,
map,
shouldFocus: false,
});
});
},
orderBreadCrumbsEvent: function(){
let orderBreadCrumbs = widgetContentFrameDEV.body.querySelectorAll('.orderBreadCrumbs');
if(orderBreadCrumbs){
for( let i = 0; i < orderBreadCrumbs.length; i++ ){
orderBreadCrumbs[i].addEventListener("click", RVBotViewDev.orderBreadCrumbsClicked);
}
}
},
orderBreadCrumbsClicked: function(e){
let breadCrumbsValue = e.target.dataset.value;
switch (breadCrumbsValue){
case "home":
RVBotViewDev.goBackHomeButtonClicked();
break;
case "order":
RVBotViewDev.loadCustomerOrder();
break;
case 'particularOrder':
RVBotViewDev.loadParticularOrder();
break;
case 'help':
RVBotViewDev.rvHelpEventFunc();
}
},
loadProductFaqEvent: function(){
let productFaqDom = widgetContentFrameDEV.body.querySelector('#rvProdFaqArticle');
if(productFaqDom){
productFaqDom.addEventListener("click", RVBotViewDev.loadProductFaqFunc);
}
let otherAritcleDom = widgetContentFrameDEV.body.querySelector('#rvProdFaqOtherArticle');
if(otherAritcleDom){
otherAritcleDom.addEventListener("click", RVBotViewDev.loadProductFaqFunc);
}
},
loadProductFaqFunc: function(e){
if( RV_ARTICLE_TYPE === "" ){
articleType = e.target.dataset.value;
RV_ARTICLE_TYPE = articleType
}
if( RV_Collection_Article && RV_Collection_Article[articleType] && RV_Collection_Article[articleType].length > 0 ){
let widgetHeader = widgetContentFrameDEV.body.querySelector('.rvMessengerHeader > div');
widgetHeader.innerHTML = "";
if(widgetContentFrameDEV.body.querySelector('.rvHomeScreenWrap')){
widgetContentFrameDEV.body.querySelector('.rvHomeScreenWrap').remove();
}
if(widgetContentFrameDEV.body.querySelector('.rvMessengerHeader .breadCrumbHtml')){
widgetContentFrameDEV.body.querySelector('.rvMessengerHeader .breadCrumbHtml').remove();
}
if(widgetContentFrameDEV.body.querySelector('.rvArticleWrapper')){
widgetContentFrameDEV.body.querySelector('.rvArticleWrapper').remove();
}
//widgetHomeContent.innerHTML = "";
widgetContentFrameDEV.body.querySelector('.rvMessengerHeader').style.height = "55px";
let articleHeader = `
`
widgetHeader.innerHTML = articleHeader;
let rvMessengerHeader = widgetContentFrameDEV.body.querySelector('.rvMessengerHeader');
let collectionsList = "";
for(let i = 0; i < RV_Collection_Article[articleType].length; i++){
collectionsList += `
${RV_Collection_Article[articleType][i]['Title']}
`
}
let rvHeaderTitle = "";
if( RV_ARTICLE_TYPE === "Product FAQs"){
rvHeaderTitle = "Product Questions"
}else{
rvHeaderTitle = "Start a Conversation"
}
var productFaqHtml = `
`;
rvMessengerHeader.insertAdjacentHTML('afterend', productFaqHtml);
RVBotViewDev.collectionClickEvent();
RVBotViewDev.goBackHomeButton();
}
},
collectionClickEvent: function(){
var collectionList = widgetContentFrameDEV.body.querySelectorAll('.rvArticleWrapper .rvArticleColList');
if( collectionList && collectionList.length > 0 ){
for(let i = 0; i < collectionList.length; i++ ){
collectionList[i].addEventListener("click", RVBotViewDev.collectionClicked);
}
}
},
collectionClicked: function(e){
RVBotViewDev.collectionClickedFunction(e.target.dataset.value)
},
collectionClickedFunction: function(indexValue){
if( !collectionBreadCrumb.hasOwnProperty('collectionIndex') || ( collectionBreadCrumb.hasOwnProperty('collectionIndex') && collectionBreadCrumb.collectionIndex === "" ) ){
var collectionIndex = indexValue;
collectionBreadCrumb.collectionIndex = collectionIndex;
var collectionArticles = RV_Collection_Article[RV_ARTICLE_TYPE][collectionIndex].articles;
if( collectionArticles.length > 0 ){
var rvConversationHeader = widgetContentFrameDEV.body.querySelector('.rvConversationHeader');
if(rvConversationHeader.querySelector('.breadCrumbHtml')){
rvConversationHeader.querySelector('.breadCrumbHtml').remove();
}
let rvHeaderTitle = "";
if( RV_ARTICLE_TYPE === "Product FAQs"){
rvHeaderTitle = "Product Questions"
}else{
rvHeaderTitle = "Start a Conversation"
}
var breadCrumbHtml = `
`;
rvConversationHeader.insertAdjacentHTML("beforeend", breadCrumbHtml);
var rvProductFaqHeader = widgetContentFrameDEV.body.querySelector('.rvProductFaqHeader');
if( rvProductFaqHeader.querySelector('.productFaqTitle') ){
rvProductFaqHeader.querySelector('.productFaqTitle').innerHTML = RV_Collection_Article[RV_ARTICLE_TYPE][collectionIndex].Title;
}
if(rvProductFaqHeader.querySelector('.productFaqDescription')){
rvProductFaqHeader.querySelector('.productFaqDescription').remove();
}
let rvCollectionDescription = `
${RV_Collection_Article[RV_ARTICLE_TYPE][collectionIndex].Description}
`
rvProductFaqHeader.querySelector('.productFaqTitle').insertAdjacentHTML("afterend", rvCollectionDescription);
var collectionList = widgetContentFrameDEV.body.querySelectorAll('.rvArticleWrapper .rvArticleColList');
if( collectionList && collectionList.length > 0 ){
for(let i = 0; i < collectionList.length; i++ ){
collectionList[i].remove();
}
}
let articleList = "";
for(let i = 0; i < collectionArticles.length; i++){
articleList += `
${collectionArticles[i]['Title']}
`
}
let rvProductFaqWrap = widgetContentFrameDEV.body.querySelector('.rvArticleWrapper .rvProductFaqWrap');
rvProductFaqWrap.insertAdjacentHTML("beforeend", articleList);
RVBotViewDev.collectionClickEvent();
RVBotViewDev.breadCrumbClickEvent();
}
}else{
var articleIndex = indexValue;
collectionBreadCrumb.articleIndex = articleIndex;
let collectionIndex = collectionBreadCrumb.collectionIndex;
var article = RV_Collection_Article[RV_ARTICLE_TYPE][collectionIndex].articles[articleIndex];
if( article ){
var rvConversationHeader = widgetContentFrameDEV.body.querySelector('.rvConversationHeader');
if(rvConversationHeader.querySelector('.breadCrumbHtml')){
rvConversationHeader.querySelector('.breadCrumbHtml').remove();
}
var breadCrumbHtml = `
${RV_Collection_Article[RV_ARTICLE_TYPE][collectionIndex].Title}
`;
rvConversationHeader.insertAdjacentHTML("beforeend", breadCrumbHtml);
var rvProductFaqHeader = widgetContentFrameDEV.body.querySelector('.rvProductFaqHeader');
if( rvProductFaqHeader.querySelector('.productFaqTitle') ){
rvProductFaqHeader.querySelector('.productFaqTitle').innerHTML = article.Title;
if(rvProductFaqHeader.querySelector('.productFaqDescription')){
rvProductFaqHeader.querySelector('.productFaqDescription').remove();
}
let rvCollectionDescription = `
${article.Content_Json}
`
rvProductFaqHeader.querySelector('.productFaqTitle').insertAdjacentHTML("afterend", rvCollectionDescription);
}
var collectionList = widgetContentFrameDEV.body.querySelectorAll('.rvArticleWrapper .rvArticleColList');
if( collectionList && collectionList.length > 0 ){
for(let i = 0; i < collectionList.length; i++ ){
collectionList[i].remove();
}
}
let articleOptionHtml = `
Okay, thanks
${RV_BTN_TEXT}
`
let rvProductFaqWrap = widgetContentFrameDEV.body.querySelector('.rvArticleWrapper .rvProductFaqWrap');
rvProductFaqWrap.insertAdjacentHTML("beforeend", articleOptionHtml);
RVBotViewDev.breadCrumbClickEvent();
RVBotViewDev.articleOptionsEvent();
}
}
},
articleOptionsEvent: function(){
let rvArticleReturnHome = widgetContentFrameDEV.body.querySelector('.rvArticleColList .rvArticleReturnHome');
if( rvArticleReturnHome ){
rvArticleReturnHome.addEventListener("click", RVBotViewDev.rvArticleReturnHomeClicked);
}
let rvArticleSendMsg = widgetContentFrameDEV.body.querySelector('.rvArticleColList .rvArticleSendMsg');
if( rvArticleSendMsg ){
rvArticleSendMsg.addEventListener("click", RVBotViewDev.rvArticleSendMsgClicked);
}
},
rvArticleReturnHomeClicked: function(){
RVBotViewDev.goBackHomeButtonClicked();
},
rvArticleSendMsgClicked: function(){
RVBotViewDev.startConversationFunc(true, true);
},
breadCrumbClickEvent: function(){
var breadCrumbHtmlDom = widgetContentFrameDEV.body.querySelector('.rvMessengerHeader .breadCrumbHtml');
if( breadCrumbHtmlDom ){
breadCrumbHtmlDom.addEventListener('click', RVBotViewDev.breadCrumbClicked);
}
},
breadCrumbClicked: function(e){
var breadCrumbValue = e.target.dataset.value;
if( breadCrumbValue === "collectionList" ){
collectionBreadCrumb = {}
RVBotViewDev.loadProductFaqFunc();
}else{
let indexValue = collectionBreadCrumb.collectionIndex;
collectionBreadCrumb = {};
RVBotViewDev.collectionClickedFunction(indexValue);
}
},
viewOldConversation: function(){
var rvConversationSummary = widgetContentFrameDEV.body.querySelector('#oldConversation');
rvConversationSummary.addEventListener('click', RVBotViewDev.oldConversationEvent);
},
oldConversationEvent: function(){
if( currentOption !== "live_agent" ){
RVBotViewDev.startConversationFunc(false);
}else{
RVBotViewDev.startConversationFunc(false, false, false);
}
},
rvGetCurrentDate: function(){
let rvDt = new Date();
// if(botTimezone_DEV !="" && botTimezone_DEV != undefined){
// var date = new Date().toLocaleString("en-US", {timeZone: botTimezone_DEV});
// var rvDt = new Date(date)
// }
let rvDate = rvDt.getDate(),
rvMonth = rvDt.getMonth() + 1,
rvYear = rvDt.getFullYear();
if (rvDate.toString().length == 1) {
rvDate = "0" + rvDate;
}
if (rvMonth.toString().length == 1) {
rvMonth = "0" + rvMonth;
}
var rvCurrentDate = rvYear + "-" + rvMonth + "-" + rvDate;
return rvCurrentDate;
},
rvSendMessage: async function(rvMsg, botstatus, type, emit = "", Workflow_Id = "", Workflow_Next_Block = "", activateUser = ""){
if(type !== "activity" ){
RVLastMsg.type = type;
RVLastMsg.message = rvMsg;
RVLastMsg.createdAt = new Date(new Date().toUTCString().slice(0, -3));
}
if (Visitor_Chat_Id_DEV !== "") {
if( rvMsg !== '' && type !== "activity" ){
socketDEV.emit("message", {
Conversation_Id: Conversation_Id,
customer_name: RV_Customer_Name_DEV,
Visitor_Chat_Id_DEV: Visitor_Chat_Id,
Website_Id: Website_Id_DEV,
message: rvMsg,
type: type,
createdDate: new Date(),
createdAt: new Date(),
});
}
if( (type === "activity" && emit !== "" ) || ( activateUser === 1 ) ){
socketDEV.emit( emit, { Conversation_Id: Conversation_Id, Website_Id: Website_Id_DEV });
}
}
if( RV_MSG_BODY_HEIGHT_DEV !== "" ){
var rvMessage = "";
rvMessage += typingLoader;
RVBotViewDev.removeTyping();
RV_MSG_BODY_HEIGHT_DEV.insertAdjacentHTML("beforebegin", rvMessage);
RVBotViewDev.rvResetMsgScroll();
}
let url = "/livechat/send-message";
let data = `Conversation_Id=${Conversation_Id}&type=${type}&Visitor_Chat_Id=${Visitor_Chat_Id_DEV}&message=${rvMsg}&Website_Id=${Website_Id_DEV}&time=${RVBotViewDev.rvGetCurrentDate() + " " + RVBotViewDev.rvGetCurrentTime()}&VisitorId=${VisitorId}¤t_option=${currentOption}&name=${rvGetCookies("rv_name")}&email=${rvGetCookies("rv_email")}`;
// if( Is_Agent_Flag === "changed" ){
// data += `&is_live_chat=${Is_Agent}`
// Is_Agent_Flag = ""
// }
if( botstatus === "no" ){
data += `&dialog=no`
}
if( type === "activity" && emit !== "" ){
data += `&vistor_status=${emit}`
}
if( activateUser === 1 ){
data += `&logged_in=1`
}
if( botstatus === "workflow" ){
data += `&Agent_Bot_Workflow_Id=${Workflow_Id}`
if( Workflow_Next_Block !== ""){
data += `&Workflow_Next_Block=${Workflow_Next_Block}`
}
}
let res = await RVBotViewDev.rvXmlRequest(url, data);
if( res.status === true ){
if (rvGetCookies("customer_id") == "" || rvGetCookies("customer_id") == null) {
rvSetCookies(31, "customer_id", res.Visitor_Chat_Id);
rvSetCookies(31, "conversation_id", res.Conversation_Id);
rvSetCookies(31, "project_id", res.Website_Id);
Visitor_Chat_Id_DEV = res.Visitor_Chat_Id;
Conversation_Id = res.Conversation_Id;
Website_Id_DEV = res.Website_Id;
if( rvMsg !== '' && type !== "activity" ){
socketDEV.emit("message", {
Conversation_Id: Conversation_Id,
customer_name: RV_Customer_Name_DEV,
Visitor_Chat_Id: Visitor_Chat_Id_DEV,
Website_Id: Website_Id_DEV,
message: rvMsg,
type: type,
createdDate: new Date(),
createdAt: new Date(),
});
}
socketDEV.emit( emit, { Conversation_Id: Conversation_Id, Website_Id: Website_Id_DEV });
socketDEV.emit("new_user",
{
Website_Id: res.Website_Id,
Visitor_Chat_Id: res.Visitor_Chat_Id,
}
);
}
if( rvMsg === "started live chat" && type === "activity" ){
socketDEV.emit( emit, { Conversation_Id: Conversation_Id, Website_Id: Website_Id_DEV });
}
if( currentOption === "faq" && botstatus !== "no" ){
RVBotViewDev.faqResponseDisplay(res.dialogflow_response);
}else if(currentOption === "workflow"){
RVBotViewDev.workflowResponseDisplay(res.workflow_response)
}else{
RVBotViewDev.removeTyping();
}
}
},
faqResponseDisplay: function(dialogFlowResponse){
if (Object.keys(dialogFlowResponse).length > 0) {
//removeTyping();
var rvMessages = "";
var rvMsg = dialogFlowResponse.messages;
var rvMessage = "";
var getCurTime = pxGetCurrentTime();
for (let i = 0; i < rvMsg.length; i++) {
let msg = rvMsg[i].replace(/\n/g, "
");
msg = RVBotViewDev.convertMsgHtml(msg);
var name = "Bot";
setTimeout(
function () {
var rvMessage;
if (i === 0) {
rvMessage = `
` +name + `, ` + getCurTime + `
` + msg + `
`;
} else {
rvMessage = `
`;
}
RV_CONVERSATION += rvMessage;
RVBotViewDev.removeTyping();
RV_MSG_BODY_HEIGHT_DEV.insertAdjacentHTML("beforebegin", rvMessage);
if (i === 0) {
RVBotViewDev.play();
}
RVBotViewDev.rvResetMsgScroll();
}, i * 1000, i, RV_MSG_BODY_HEIGHT_DEV, msg, typingLoader
);
socketDEV.emit("message", {
Conversation_Id: Conversation_Id,
Visitor_Chat_Id: Visitor_Chat_Id_DEV,
Website_Id: Website_Id_DEV,
message: msg,
type: "Bot",
createdDate: new Date(),
createdAt: new Date(),
});
}
if (rvMsg.length > 0) {
var dd = divWidgetDEV;
if (dd.style.display == "none") {
var node = notificationContentFrameDEV.getElementsByClassName("new-message");
var htmlContent = node[0].innerHTML;
var nsum = parseInt(htmlContent) + rvMsg.length;
pxSetCookie("1", "notify-value", nsum);
node[0].innerHTML = nsum;
notificationFrameDEV.style.display = "block";
}
}
} else {
RVBotViewDev.removeTyping();
}
},
workflowResponseDisplay: function(workflowResponse){
let rvMessages = "";
let rvMsg = workflowResponse.content;
let rvBtn = workflowResponse.buttons;
let rvMessage = "";
let getCurTime = RVBotViewDev.rvGetCurrentTime();
currentWorkflowId_DEV = workflowResponse.Agent_Bot_Workflow_Id;
let msgArray = [];
for (let i = 0; i < rvMsg.length; i++) {
switch (rvMsg[i].type){
case "text":
msg = rvMsg[i].message.replace(/\n/g, "
");
msg = RVBotViewDev.convertMsgHtml(msg);
msg = `
${msg}
`;
break;
case "image":
msg = `
`
break;
case "gallery":
let gallery = rvMsg[i].gallery;
let galleryInner = '';
let style = "block";
for (let i = 0; i < gallery.length; i++) {
let buttonInnerHtml = msg1 = "";
let btnDetails = gallery[i].buttonDetails
for (let j = 0; j < btnDetails.length; j++) {
let btn = btnDetails[j];
buttonInnerHtml += `
${btn.text} `;
}
if( btnDetails.length > 0 ){
msg1 = `
`;
}
if( i === 0 ){
style="block";
}else{
style="none";
}
galleryInner += `
`
}
if( gallery.length > 0 ){
msg = `
`
}
}
msgArray.push(msg);
var name = botsetting_DEV.Agent_Bot_Name;
setTimeout(
function () {
if (i === 0) {
var rvMessage = `
` +name + `, ` + getCurTime + `
${msgArray[i]}
`;
} else {
var rvMessage = `
`;
}
if( msgArray[i] !== "" ){
RV_CONVERSATION += rvMessage;
RVBotViewDev.removeTyping();
RV_MSG_BODY_HEIGHT_DEV.insertAdjacentHTML("beforebegin", rvMessage);
RV_MSG_BODY_HEIGHT_DEV.insertAdjacentHTML("beforebegin", typingLoader);
}
if (i === 0) {
RVBotViewDev.play();
}
RVBotViewDev.rvResetMsgScroll();
}, i * 1000, i, RV_MSG_BODY_HEIGHT_DEV, msgArray, name, typingLoader
);
socketDEV.emit("message", {
Conversation_Id: Conversation_Id,
Visitor_Chat_Id: Visitor_Chat_Id_DEV,
Website_Id: Website_Id_DEV,
message: msg,
type: "Bot",
createdDate: new Date(),
createdAt: new Date(),
});
}
if (rvMsg.length > 0) {
RVLastMsg.type = "bot";
RVLastMsg.createdAt = new Date(new Date().toUTCString().slice(0, -3));
RVLastMsg.message = msg;
var dd = divWidgetDEV;
if (dd.style.display == "none") {
var node = toggleContentFrameDEV.getElementsByClassName("new-message");
var htmlContent = node[0].innerHTML;
var nsum = parseInt(htmlContent) + rvMsg.length;
pxSetCookie("1", "notify-value", nsum);
node[0].innerHTML = nsum;
node[0].style.display = "block";
}
}
if (rvBtn.length > 0) {
setTimeout(
function () {
RVBotViewDev.removeTyping();
let buttonInnerHtml = "";
for (i = 0; i < rvBtn.length; i++) {
let btn = rvBtn[i];
buttonInnerHtml += `
${btn.buttonText} `;
}
var msg1 = `
`;
RVBotViewDev.removeTyping();
RV_MSG_BODY_HEIGHT_DEV.insertAdjacentHTML("beforebegin", msg1);
RVBotViewDev.rvResetMsgScroll();
}, (rvMsg.length + 1) * 1000, RV_MSG_BODY_HEIGHT_DEV, rvBtn
);
} else {
setTimeout(function () {
RVBotViewDev.removeTyping();
}, (rvMsg.length + 1) * 1000);
}
setTimeout(
function () {
let domButtons = widgetContentFrameDEV.querySelectorAll(".rve_dg_btn_options");
for (let k = 0; k < domButtons.length; k++) {
domButtons[k].addEventListener("click", RVBotViewDev.rveDgClickEvent);
}
}, (rvMsg.length + 1) * 1000
);
},
rveDgClickEvent: function(e){
let msg = e.target.dataset.msg
let nextBlockId = e.target.dataset.value;
if (msg) {
msg = msg.replace(/\n/g, "
");
var msg1 = `
` + RV_Customer_Name_DEV + `, ` + RVBotViewDev.rvGetCurrentTime() + `
` + RVBotViewDev.convertMsgHtml(msg) + `
`;
RVBotViewDev.removeTyping();
if(e.target.parentNode.parentNode.parentNode.parentNode.classList[0] === "rvecGalleryBtnWrapper"){
var galleryParentNode = e.target.parentNode.parentNode.parentNode.parentNode.parentNode
var galleryButtonNode = galleryParentNode.querySelectorAll('.rvConvMsg');
for (let m = 0; m < galleryButtonNode.length; m++) {
galleryButtonNode[m].remove();
}
var userIntent = `
`
RV_MSG_BODY_HEIGHT_DEV.insertAdjacentHTML("beforebegin", userIntent);
}else{
e.target.parentNode.parentNode.innerHTML = msg1;
}
RV_MSG_BODY_HEIGHT_DEV.insertAdjacentHTML("beforebegin", typingLoader);
RVBotViewDev.rvSendMessage( msg, "workflow", "user", "", currentWorkflowId_DEV, nextBlockId);
RVBotViewDev.rvResetMsgScroll();
}
},
rvHomeScreenScroll: function (){
var rvHomeScreen = widgetContentFrameDEV.body.querySelector('.rvHomeScreen');
rvHomeScreen.onscroll = function() {
if(widgetContentFrameDEV.body.querySelector('.rvMsgHeaderOpacity')){
let scrollTop, opacity;
if( rvHomeScreen.scrollTop === 0 ){
scrollTop = 0;
opacity = 1;
}else{
scrollTop = rvHomeScreen.scrollTop / 2;
opacity = 1 / ( scrollTop / 4 );
if( opacity < 0 ){
opacity = 0;
}
if( scrollTop > 120 ){
scrollTop = 120
}
}
widgetContentFrameDEV.body.querySelector('.rvMsgHeaderOpacity').style.opacity = opacity;
widgetContentFrameDEV.body.querySelector('.rvMsgHeaderOpacity').style.transform = `translateY(-${scrollTop}px)`;
}
}
},
addStartConversationEvent: function (){
var startConversationBtn = widgetContentFrameDEV.body.querySelector('#startConversation');
startConversationBtn.addEventListener("click", RVBotViewDev.startConversationFunc);
},
startConversationFunc: function( flag = true, breadCrumbsArgs = false, openTextWidget = true){
var widgetHeader = widgetContentFrameDEV.body.querySelector('.rvMessengerHeader > div');
widgetHeader.innerHTML = "";
if(widgetContentFrameDEV.body.querySelector('.rvHomeScreenWrap')){
widgetContentFrameDEV.body.querySelector('.rvHomeScreenWrap').remove();
}
if( widgetContentFrameDEV.body.querySelector('.rvInnerPageWrap') ){
widgetContentFrameDEV.body.querySelector('.rvInnerPageWrap').remove();
}
let timeText = "Back in";
if( RVAgentOption ){
timeText = "";
}
//widgetHomeContent.innerHTML = "";
widgetContentFrameDEV.body.querySelector('.rvMessengerHeader').style.height = "75px";
var conversationHeader = `
`
widgetHeader.innerHTML = conversationHeader;
var rvMessengerHeader = widgetContentFrameDEV.body.querySelector('.rvMessengerHeader');
if( breadCrumbsArgs ){
let productFaqMessage = `
Start a Conversation
${RV_Collection_Article[RV_ARTICLE_TYPE][collectionBreadCrumb.collectionIndex].Title}
${RV_Collection_Article[RV_ARTICLE_TYPE][collectionBreadCrumb.collectionIndex].articles[collectionBreadCrumb.articleIndex].Title}
`
let rvMsg = `
` + RV_Customer_Name_DEV +`, ` +RVBotViewDev.rvGetCurrentTime() +`
${productFaqMessage}
`
RV_CONVERSATION += rvMsg;
RVBotViewDev.rvSendMessage(encodeURIComponent(productFaqMessage), "", "user");
collectionBreadCrumb = {};
}
var chatConversationHtml = `
`
rvMessengerHeader.insertAdjacentHTML('afterend', chatConversationHtml);
RV_MSG_BODY_HEIGHT_DEV = widgetContentFrameDEV.body.querySelector('#rvMessengerHeight');
RV_MSG_BODY_DEV = widgetContentFrameDEV.body.querySelector('.rvConversationMessage');
var slideHtml = `
❮
❯
`
var galleryOuterContainers = widgetContentFrameDEV.getElementsByClassName('rvecGalleryOuterContainer');
var galleryInnerContainers = widgetContentFrameDEV.getElementsByClassName('rvecGalleryInnerContainer');
if(galleryInnerContainers.length > 0){
for (let galleryIndex = 0; galleryIndex < galleryInnerContainers.length; galleryIndex++) {
let galleryInnerContainerObj = galleryInnerContainers[galleryIndex];
let galleryOuterContainerObj = galleryOuterContainers[galleryIndex];
let slides = galleryInnerContainerObj.children;
if( slides.length > 0 ){
galleryOuterContainerObj.insertAdjacentHTML('beforeend', slideHtml)
}
for (let i = 0; i < slides.length; i++) {
slides[i].style.display = "none";
}
slides[0].style.display = "block";
}
}
RVBotViewDev.goBackHomeButton();
//RVBotViewDev.sendMessageEvent();
RVBotViewDev.rvResetMsgScroll();
if(openTextWidget){
widgetContentFrameDEV.querySelector('.rvReplyInputBox > textarea').setAttribute('disabled', 'disabled');
widgetContentFrameDEV.querySelector('.rvReplyInputBox .rvMessengerReplyInputUtilsButton').classList.add('disabled');
}
if( flag ){
RVBotViewDev.initiateConversation();
}
},
sendMessageEvent: function (){
var textArea = widgetContentFrameDEV.body.querySelector('.rvReplyInputBox textarea');
textArea.addEventListener("keydown", function (e) {
var rvMsg = this.value;
var keyCode = e.keyCode || e.which;
if (keyCode == 13) {
if (!event.shiftKey) {
e.preventDefault();
if (rvMsg) {
rvMsg = rvMsg.replace(/\n/g, "
");
var msg = `
` + RV_Customer_Name_DEV +`, ` +RVBotViewDev.rvGetCurrentTime() +`
` +RVBotViewDev.convertMsgHtml(rvMsg) +`
`;
RV_CONVERSATION += msg;
RVBotViewDev.removeTyping();
RV_MSG_BODY_HEIGHT_DEV.insertAdjacentHTML("beforebegin", msg);
RVBotViewDev.rvSendMessage(this.value, "", "user");
RVBotViewDev.rvResetMsgScroll();
textArea.value = "";
if( msgRead_DEV ){
RVBotViewDev.rvEcUserNotify();
}
}
return false;
}
}
});
textArea.addEventListener("keyup", function (e) {
var rvMsg = this.value;
if (rvMsg) {
widgetContentFrameDEV.querySelector(".rvMessengerReplyInputUtilsButton").classList.add("active");
if (Visitor_Chat_Id_DEV === "") {
socketDEV.emit("user_typing", {
Conversation_Id: Conversation_Id,
Visitor_Chat_Id: Visitor_Chat_Id_DEV,
Website_Id: Website_Id_DEV,
type: "typing",
typing: true,
});
}
RVBotViewDev.rvActiveButtonCall();
} else {
var rvBtnActive = widgetContentFrameDEV.querySelector(".rvMessengerReplyInputUtilsButton.active");
rvBtnActive.removeEventListener("click", RVBotViewDev.sendMsgBtnClick);
widgetContentFrameDEV.querySelector(".rvMessengerReplyInputUtilsButton").classList.remove("active");
}
});
},
rvActiveButtonCall: function() {
var rvBtnActive = widgetContentFrameDEV.querySelector(".rvMessengerReplyInputUtilsButton.active");
rvBtnActive.addEventListener("click", RVBotViewDev.sendMsgBtnClick);
},
sendMsgBtnClick: function(){
var msg = widgetContentFrameDEV.body.querySelector('.rvReplyInputBox textarea').value;
if (RV_Customer_Name_DEV === null) {
name = "me";
}
if (msg) {
msg = msg.replace(/\n/g, "
");
var msg1 = `
` + name + `, ` + RVBotViewDev.rvGetCurrentTime() +`
` + RVBotViewDev.convertMsgHtml(msg) +`
`;
RV_CONVERSATION += msg1;
RVBotViewDev.removeTyping();
RV_MSG_BODY_HEIGHT_DEV.insertAdjacentHTML("beforebegin", msg1);
widgetContentFrameDEV.body.querySelector('.rvReplyInputBox textarea').value = "";
RVBotViewDev.rvSendMessage(msg, "", "user");
RVBotViewDev.rvResetMsgScroll();
this.classList.remove("active");
if( msgRead_DEV ){
RVBotViewDev.rvEcUserNotify();
}
}
},
goBackHomeButton: function (){
var homeButton = widgetContentFrameDEV.body.querySelector('.rvGoBackHome');
homeButton.addEventListener("click", RVBotViewDev.goBackHomeButtonClicked);
},
goBackHomeButtonClicked: function(){
RV_ARTICLE_TYPE = "";
var widgetHeader = widgetContentFrameDEV.body.querySelector('.rvMessengerHeader > div');
widgetHeader.innerHTML = RV_HOME_HEADER;
var rvMessengerHeader = widgetContentFrameDEV.body.querySelector('.rvMessengerHeader');
rvMessengerHeader.insertAdjacentHTML('afterend', RV_HOME_CONTENT);
RVBotViewDev.rvDisplayLastMsg();
widgetContentFrameDEV.body.querySelector('.rvMessengerHeader').style.height = "275px";
if( widgetContentFrameDEV.body.querySelector('.rvConversationMessage') ){
widgetContentFrameDEV.body.querySelector('.rvConversationMessage').remove();
}
if( widgetContentFrameDEV.body.querySelector('.rvReplyInputBox') ){
widgetContentFrameDEV.body.querySelector('.rvReplyInputBox').remove();
}
if( widgetContentFrameDEV.body.querySelector('.rvInnerPageWrap') ){
widgetContentFrameDEV.body.querySelector('.rvInnerPageWrap').remove();
}
RVBotViewDev.homeScreenFunction();
RV_MSG_BODY_HEIGHT_DEV = "";
RV_MSG_BODY_DEV = "";
collectionBreadCrumb = {};
RV_ORDER_BREADCRUMBS = {};
},
rvLoadWidgetHTML: function( setting, botsetting_DEV){
if (navigator.userAgent.toLowerCase().indexOf('firefox') === -1) { // DOM
widgetContentFrameDEV = widgetFrameDEV.contentDocument;
toggleContentFrameDEV = chatToggleFrameDEV.contentDocument;
triggerContentFrameDEV = triggerFrameDEV.contentDocument;
}else { // IE win
widgetContentFrameDEV = widgetFrameDEV.contentWindow.document;
toggleContentFrameDEV = chatToggleFrameDEV.contentWindow.document;
triggerContentFrameDEV = triggerFrameDEV.contentWindow.document;
}
var toggleFrameStyle = document.createElement("style");
toggleFrameStyle.innerText = RVBotViewDev.chatToggleCssFile();
toggleContentFrameDEV.head.appendChild(toggleFrameStyle);
var chatToggleHtml = `
`;
toggleContentFrameDEV.body.insertAdjacentHTML("beforeend", chatToggleHtml);
chatToggleFrameDEV.style.display="block";
var widgetFrameStyle = document.createElement("style");
widgetFrameStyle.innerText = RVBotViewDev.widgetCssFile();
// var widgetFontAwesome = document.createElement("link");
// widgetFontAwesome.rel = "stylesheet";
// widgetFontAwesome.href = "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css";
// widgetFontAwesome.crossorigin = "anonymous";
// widgetFontAwesome.integrity = "sha512-9usAa10IRO0HhonpyAIVpjrylPvoDwiPUiKdWk5t3PyolY1cOd4DSE0Ga+ri4AuTroPR5aQvXU9xC6qOPnzFeg==";
// widgetFontAwesome.referrerpolicy = "no-referrer";
widgetContentFrameDEV.head.appendChild(widgetFrameStyle);
widgetContentFrameDEV.head.insertAdjacentHTML("beforeend", '
');
let welcomeTitle = botsetting_DEV.Welcome_Title
let replaceText = botsetting_DEV.Welcome_Title_Fallback ? botsetting_DEV.Welcome_Title_Fallback : "There";
if( botsetting_DEV.Welcome_Title && botsetting_DEV.Welcome_Title.indexOf("$firstName") !== -1 ){
if( RV_Customer_Name_DEV !== "me" ){
welcomeTitle = botsetting_DEV.Welcome_Title.replace(new RegExp('\\$firstName', 'g'), RV_Customer_Name_DEV);
}else{
welcomeTitle = botsetting_DEV.Welcome_Title.replace(new RegExp('\\$firstName', 'g'), replaceText);
}
}
if( botsetting_DEV.Welcome_Title && botsetting_DEV.Welcome_Title.indexOf("$lastName") !== -1 ){
if( RV_Customer_Name_DEV !== "me" ){
welcomeTitle = botsetting_DEV.Welcome_Title.replace(new RegExp('\\$lastName', 'g'), RV_Customer_Name_DEV);
}else{
welcomeTitle = botsetting_DEV.Welcome_Title.replace(new RegExp('\\$lastName', 'g'), replaceText);
}
}
if( botsetting_DEV.Welcome_Title && botsetting_DEV.Welcome_Title.indexOf("$name") !== -1 ){
if( RV_Customer_Name_DEV !== "me" ){
welcomeTitle = botsetting_DEV.Welcome_Title.replace(new RegExp('\\$name', 'g'), RV_Customer_Name_DEV);
}else{
welcomeTitle = botsetting_DEV.Welcome_Title.replace(new RegExp('\\$name', 'g'), replaceText);
}
}
if( botsetting_DEV.Welcome_Title && botsetting_DEV.Welcome_Title.indexOf("$email") !== -1 ){
if( RV_Customer_Email_DEV !== "" ){
welcomeTitle = botsetting_DEV.Welcome_Title.replace(new RegExp('\\$email', 'g'), RV_Customer_Email_DEV);
}else{
welcomeTitle = botsetting_DEV.Welcome_Title.replace(new RegExp('\\$email', 'g'), replaceText);
}
}
let quickLinksHtml = "",
quickLinkWholeHtml = "";
if( RV_ORDER_STATUS ){
quickLinksHtml += `
Your recent orders
Track and manage your orders
`
}
if( botsetting_DEV.Faq_Article ){
quickLinksHtml += `
Product FAQs
Browse our FAQs
`
}
if( botsetting_DEV.Other_Article ){
quickLinksHtml += `
`
}
if( quickLinksHtml !== "" ){
quickLinkWholeHtml = `
`
}
let timeText = "Back in";
let timeValue = RVBotViewDev.getNextAvailableTime();
if( RVAgentOption ){
timeText = "Team will reply";
timeValue = "As soon as possible";
}
let i = 0;
for (const [key, value] of Object.entries(AgentDetails_DEV)) {
if( i === 3 ){
break;
}
i++;
let initials = "";
if( value.firstName ){
initials = value.firstName.substring(0,1).toUpperCase();
}
if( value.lastName ){
initials += value.lastName.substring(0,1).toUpperCase();
}
agentInformationHtml +=
`
`;
}
RV_HOME_HEADER = `
`
RV_HOME_CONTENT = `
`
var chatWidgetHtml = `
`
widgetContentFrameDEV.body.insertAdjacentHTML("beforeend", chatWidgetHtml);
var triggerFrameStyle = document.createElement("style");
triggerFrameStyle.innerText = RVBotViewDev.triggerMsgCss();
triggerFrameDEV.contentWindow.document.head.appendChild(triggerFrameStyle);
var notificationFrameStyle = document.createElement("style");
notificationFrameStyle.innerText = RVBotViewDev.notificationCssFile();
notificationContentFrameDEV.head.appendChild(notificationFrameStyle);
var notificationWidgetHtml = `
0
`;
notificationContentFrameDEV.body.insertAdjacentHTML("beforeend", notificationWidgetHtml);
},
play: function(){
var audio = widgetContentFrameDEV.getElementById("audio");
audio.play();
},
overAllCssFile: function() {
// Your CSS as text
var styles = `
.rvecIframeBot {
border: none;
}
#rvecChatToggleFrame{
position:fixed;
bottom:30px;
font-size:14px;
line-height:1.5;
z-index: 999999999999;
width: 60px;
height: 60px;
overflow:hidden;
right: 30px;
box-shadow: 0 0 40px rgb(0 0 0 / 10%);
border-radius: 50%;
}
#rvecChatWidgetFrame{
// position:fixed;
// bottom:90px;
// right:30px;
// max-width:390px;
// width:100%;
// display:none;
// -webkit-animation:ptwchatbox_anim .3s;
// -moz-animation:ptwchatbox_anim .3s;
// animation:ptwchatbox_anim .3s;
// z-index: 999999999999;
// box-shadow: 0 0 40px rgb(0 0 0 / 10%);
}
#rvecNotificationFrame{
position:fixed;
bottom: 60px;
right: 30px;
width:20px;
height:20px;
display:none;
z-index: 99999999999999999999999;
}
@-webkit-keyframes ptwchatbox_anim{
0%{-webkit-transform:translateY(10px);opacity:0}
100%{-webkit-transform:translateY(0);opacity:1}
}
@-moz-keyframes ptwchatbox_anim{
0%{-moz-transform:translateY(10px);opacity:0}
100%{-moz-transform:translateY(0);opacity:1}
}
@keyframes ptwchatbox_anim{
0%{transform:translateY(10px);opacity:0}
100%{transform:translateY(0);opacity:1}
}
#rvecChatTriggerFrame {
position: fixed;
z-index: 99999999;
bottom: 90px;
right: 30px;
width: 290px;
}
@media(max-width:430px){
#rvecChatWidgetFrame{
right: 0;
}
}
#RVWidgetFrame{
z-index: 2147483000;
position: fixed;
bottom: 100px;
right: 20px;
height: calc(100% - 120px);
width: 376px;
min-height: 250px;
max-height: 704px;
box-shadow: rgba(0, 0, 0, 0.16) 0px 5px 40px;
opacity: 1;
border-radius: 8px;
overflow: hidden;
transition: width 200ms ease 0s, height ease 0s, max-height ease 0s;
display:none;
}
#RVWidgetFrame > iframe{
width: 100%;
height: 100%;
position: absolute;
}
`;
return styles;
},
chatToggleCssFile: function(){
var styles = `
@charset "UTF-8";@import url(https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap);
body{
margin: 0;
font-family: Poppins,sans-serif;
font-size: 14px;
line-height: 1.5;
}
.ptw_chat_toggle{
z-index: 1;
width:60px;
height:60px;
border-radius:60px;
background-color:#2f26d0;
// box-shadow: 0 0 40px rgb(0 0 0 / 10%);
color:#fff;
display:flex;
align-items:center;
justify-content:center;
font-size:16px;
position:relative;
cursor:pointer;
-webkit-animation:ptwchattoggle_anim .3s;
-moz-animation:ptwchattoggle_anim .3s;
animation:ptwchattoggle_anim .3s;
}
@-webkit-keyframes ptwchattoggle_anim{
0%{-webkit-transform:scale(.5);opacity:0}
100%{-webkit-transform:scale(1);opacity:1}
}
@-moz-keyframes ptwchattoggle_anim{
0%{-moz-transform:scale(.5);opacity:0}
100%{-moz-transform:scale(1);opacity:1}
}
@keyframes ptwchattoggle_anim{
0%{transform:scale(.5);opacity:0}
100%{transform:scale(1);opacity:1}
}
.ptw_chat_toggle>span{
display:none
}
.ptw_chat_toggle>.ptw_chat_bubble_arrow{
content:"";
position:absolute;
top:60%;
right:75%;
display:block;
border-top:20px solid transparent;
border-bottom:0 solid transparent;
border-right:20px solid #2f26d0;
-webkit-transform:rotate(-25deg);
-moz-transform:rotate(-25deg);
transform:rotate(-25deg)
}
`
return styles;
},
notificationCssFile: function(){
var styles = `
.new-message.active {
animation: 0.82s cubic-bezier(0.36, 0.07, 0.19, 0.97) 0s 1 normal both running shake;
}
.new-message {
font-size: 12px;
background: rgb(247, 46, 56);
z-index: 2;
line-height: 1;
}
.new-message, #dnd-indicator {
position: absolute;
top: 0;
font-weight: 700;
color: rgb(255, 255, 255);
right: 0;
pointer-events: none;
border-radius: 10px;
display: flex;
-webkit-box-pack: center;
justify-content: center;
-webkit-box-align: center;
align-items: center;
width: 20px;
height: 20px;
}
`
return styles;
},
widgetCssFile: function(){
var styles = `
@charset "UTF-8";@import url(https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap);
body{
margin:0;
font-family: Poppins,sans-serif;
font-size: 14px;
line-height: 1.5;
overflow: hidden;
display: block;
margin: 8px;
}
select {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
background-color: transparent;
border: none;
padding: 4px 1em 4px 0;
margin: 0;
width: 100%;
font-family: inherit;
font-size: 14px;
cursor: inherit;
line-height: inherit;
z-index: 1;
outline: none;
}
select::-ms-expand {
display: none;
}
.select {
display: grid;
grid-template-areas: "select";
align-items: center;
position: relative;
min-width: 15ch;
max-width: 30ch;
border: 1px solid #777;
border-radius: 0.25em;
padding: 0.25em 0.5em;
font-size: 1.25rem;
cursor: pointer;
line-height: 1.1;
background-color: #fff;
background-image: linear-gradient(to top, #f9f9f9, #fff 33%);
}
.select select, .select::after {
grid-area: select;
}
.select:not(.select--multiple)::after {
content: "";
justify-self: end;
width: 0.8em;
height: 0.5em;
background-color: #777;
-webkit-clip-path: polygon(100% 0%, 0 0%, 50% 100%);
clip-path: polygon(100% 0%, 0 0%, 50% 100%);
}
select:focus + .focus {
position: absolute;
top: -1px;
left: -1px;
right: -1px;
bottom: -1px;
border: 2px solid blue;
border-radius: inherit;
}
select[multiple] {
padding-right: 0;
height: 6rem;
}
select[multiple] option {
white-space: normal;
outline-color: blue;
}
.select--disabled {
cursor: not-allowed;
background-color: #eee;
background-image: linear-gradient(to top, #ddd, #eee 33%);
}
.rvMessenger{
display: flex;
flex-direction: column;
-webkit-box-pack: start;
justify-content: flex-start;
position: absolute;
inset: 0px;
overflow: hidden;
background-color: #fff;
}
.rvMsgHead{
position: relative;
color: white;
transition: height 160ms ease-out 0s;
background-image: linear-gradient(135deg,hsla(0,0%,100%,0),rgba(0,0,0,.32));
height: 295px;
background-color: ${botsetting_DEV.Bot_Agent_Background_Color}
}
.rvMsgHeaderView{
position: absolute;
top: 0px;
left: 0px;
right: 0px;
padding: 24px 40px 87px;
box-sizing: border-box;
transition: transform 0.3s ease-out 0s, opacity 0.3s ease-out 0s;
transform: scale(1);
}
.rvMsgHeaderOpacity{
transform: translateY(0px);
opacity: 1;
}
.rvMsgImgWrap{
height:32px;
/*padding-bottom:16px;*/
}
.rvMsgImgWrap img{
max-width: 100%;
max-height: 100%;
margin: auto 0px;
display: block;
}
.rvMsgContWrap .title{
font-size: 32px;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.rvMsgContWrap .paraContent{
color: rgba(255, 255, 255, 0.7);
display: block;
font-size: 1em;
line-height: 1.5em;
overflow-wrap: break-word;
white-space: pre-line;
}
.rvHomeScreenWrap{
position: relative;
flex: 1 1 0%;
background-color: white;
box-shadow: rgb(0 0 0 / 20%) 0px 21px 4px -20px inset;
}
.rvConversationMessage{
padding: 20px;
background-color: #fff;
height: calc(100% - 218px);
overflow: scroll;
}
.rvHomeScreen{
z-index: 2147483002;
position: fixed;
inset: 0px;
overflow-y: auto;
padding-top:251px;
}
.rvHomeScreenInnerWrap{
display: flex;
flex-direction: column;
box-sizing: border-box;
padding: 0px 16px 55px;
min-height: 100%;
}
.rvTransition{
transition: transform 0.3s ease-out 0s, opacity 0.3s ease-out 0s;
transform: scale(1);
}
.rvHomeScreenCard{
max-width: 100%;
margin-bottom: 17px;
background-color: rgb(255, 255, 255);
border-radius: 3px;
font-size: 14px;
line-height: 1.4;
color: rgb(0, 0, 0);
overflow: hidden;
position: relative;
box-shadow: ${botsetting_DEV.boxShadow};
}
.rv-5qt81h {
/*height: 139.781px;*/
transition: height 250ms ease 0s;
}
.rv-s0sg41 {
padding: 26px 24px 16px;
}
.rv-vmab6f {
margin-bottom: 4px;
}
.rv-66oquk {
line-height: 1.5;
word-break: break-word;
font-size: 16px;
font-weight: 600;
text-align: left;
margin-bottom: 0px;
}
.rv-aga1a1 {
display: flex;
flex-flow: row nowrap;
-webkit-box-align: center;
align-items: center;
align-content: stretch;
position: relative;
outline-offset: -5px;
padding: 16px 24px;
margin: 0px -24px;
}
.rv-aga1a1::before {
/*content: "";
position: absolute;
height: 100%;
left: 0px;
right: 0px;
top: 0px;
border-top: 2px solid transparent;*/
}
.rv-aga1a1 * {
cursor: pointer;
}
.rv-qh16t7 {
flex: 0 0 auto;
left: 15px;
}
.rv-7nfnba {
margin: 0px auto;
border-radius: 50%;
display: inline-block;
vertical-align: middle;
cursor: default;
width: 36px;
height: 36px;
line-height: 36px;
font-size: 18px;
}
.rv-7nfnba img {
width: 36px;
height: 36px;
border-radius: 50%;
}
.rv-7sdh8r {
flex: 1 1 0%;
padding-left: 16px;
padding-right: 8px;
min-width: 0px;
}
.rv-15r69cz {
font-size: 14px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: rgb(115, 115, 118);
margin-bottom: 0px;
}
.rv-15fzge {
margin-left: 4px;
}
.rv-1esx35 {
color: rgb(58, 60, 76);
font-size: 13px;
display: flex;
}
.rv-1fvrbgz {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
color: rgb(0, 0, 0);
}
.rv-ea67jx {
transform: rotate(180deg);
}
.rv-6a43gu {
margin: 0px auto;
width: 9px;
height: 15px;
}
.rvFlex{
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
}
.rvAgentsInformation{
padding: 6px 10px;
border-radius: 12px;
background-color: hsla(0,0%,100%,.08);
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
margin-top: 32px;
margin-bottom: 15px;
}
.rvAgentsPictures{
text-align: center;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: start;
-ms-flex-pack: start;
justify-content: flex-start;
margin: 0;
}
.rvAgentPicture,
.rvAgentsInformation .rvAgentsPictures .rvAgentPicture {
display: inline-block;
margin-left: -8px;
vertical-align: middle;
position: relative;
}
.rvAgentsInformation .rvAgentsPictures .rvAgentPicture:first-child{
margin-left: 0;
}
.settingWidth{
max-width: 280px;
text-align: left;
justify-content: start;
}
.rvInitialsAvatar{
color: #fff;
text-align: center;
line-height: 24px;
position: relative;
width: 24px;
height: 24px;
border-radius: 24px;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-ms-flex-negative: 0;
flex-shrink: 0;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
font-weight: 600;
font-size:9px;
}
.rvAgentPicture:first-child .rvInitialsAvatar,
.rvAgentsInformation .rvAgentsPictures .rvAgentPicture:first-child .rvInitialsAvatar{
background-color: rgb(128, 78, 158);
border: 1px solid rgb(255, 255, 255);
}
.rvAgentsInformation .rvAgentsPictures .rvAgentPicture:nth-child(2) .rvInitialsAvatar{
background-color: rgb(48, 96, 99);
border: 1px solid rgb(255, 255, 255);
}
.rvAgentsInformation .rvAgentsPictures .rvAgentPicture:nth-child(3) .rvInitialsAvatar{
background-color: rgb(147, 106, 37);
border: 1px solid rgb(255, 255, 255);
}
.rv-ea67jx svg > g > g {
fill: ${botsetting_DEV.Bot_Agent_Button_Color};
}
.rvOfflineMessage{
margin-left: 14px;
font-size: 14px;
font-weight: 400;
max-width: 100%;
color: #666;
text-align: left;
line-height: 1;
overflow: hidden;
color: #fff;
}
.rvOfflineMessage overflow-elipses{
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
max-width: 100%;
}
.replyTimeIndicator{
font-weight: 600;
color: #fff;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
}
.replyTimeIndicatorText{
padding-left:4px;
}
.replyTimeIndicator .clockIcon{
height: 14px;
}
.replyTimeIndicator .clockIcon svg{
min-height: 14px;
min-width: 14px;
margin-left: 6px;
}
.rvMessengerHome ::-webkit-scrollbar{width:6px;height:6px}
.rvMessengerHome ::-webkit-scrollbar-track{background-color:#fff;border-radius:10px}
.rvMessengerHome ::-webkit-scrollbar-thumb{background-color:${botsetting_DEV.Bot_Agent_Background_Color};border-radius:10px}
.rvMessengerHome *{scrollbar-color:${botsetting_DEV.Bot_Agent_Background_Color} #f1f1f1;scrollbar-width:thin}
.rvBtnFullWidth{
padding: 0.95rem 1rem;
width: 100%;
max-width: 327px;
color: ${botsetting_DEV.Bot_Agent_Button_Text_Color};
border: 1px solid ${botsetting_DEV.Bot_Agent_Button_Color};
background-color: ${botsetting_DEV.Bot_Agent_Button_Color};
border-radius: 8px;
font-size: 14px;
font-weight: 600;
cursor:pointer;
}
.rvFooterWidget{
z-index: 2147483002;
position: absolute;
bottom: 0px;
left: 0px;
right: 0px;
}
.rvFooterWidget .e1zvd8h1 {
position: absolute;
opacity: 0.97;
width: 100%;
bottom: 0px;
display: flex;
align-items: flex-end;
-webkit-box-pack: center;
justify-content: center;
margin: 0px;
padding: 5px 0px;
background-color: rgb(255, 255, 255);
box-shadow: rgb(0 0 0 / 4%) 0px 0px 0px 1px;
}
.rvFooterWidget .e1zvd8h1 .e1zvd8h3 {
display: flex;
width: 100%;
-webkit-box-pack: center;
justify-content: center;
}
.rv-52kfez {
display: inline-block;
font-size: 13px;
padding: 8px 16px;
border-radius: 16px;
transition: all 80ms ease 0s;
color: rgb(119, 118, 120) !important;
text-decoration:none;
letter-spacing: -0.6px;
}
.rv-52kfez svg {
width: 16px;
height: 16px;
color: rgb(119, 118, 120);
vertical-align: sub;
padding-right: 8px;
}
.rv-edahy21{
padding: 0 20px;
cursor: pointer;
}
.rvJustifyContentSpaceBetween{
-webkit-box-pack: justify;
-ms-flex-pack: justify;
justify-content: space-between;
}
.rvAlignItemsCenter{
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
}
.rvAlignItemsStart{
-webkit-box-align: start;
-ms-flex-align: flex-start;
align-items: flex-start;
}
.qLinkImgWrap{
height: 40px;
width: 40px;
background-color: rgba(0,0,0,.03);
border-radius: 50%;
margin-right: 16px;
}
.qLinkImgWrap svg{
height: 24px;
width: 24px;
}
.qLinkContWrap .qLinkContTitle{
font-size: 14px;
font-weight: 500;
line-height: 1.43;
color: #000;
}
.qLinkContWrap .qLinkContSubTitle{
font-size: 13px;
line-height: 1.54;
color: #6d7175;
font-weight: 400;
}
.rvJustifyContentCenter{
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
}
.rv-awfege .edyhj2e0{
padding-bottom:20px;
}
.paddingTopBottom20{
padding: 20px 0;
}
.rv-edahy21:not(:last-child) .borderBottom{
border-bottom: 1px solid #e5e5e5;
}
.rvConversationHeader {
padding: 15px 20px;
}
.rvGoBackHome {
padding: 0 10px;
margin-right: 10px;
cursor: pointer;
}
.rvConversationHeader .rvAgentsInformation {
margin: 0;
background-color: transparent;
}
.rvMb1{
margin-bottom: 6px;
}
.rvBotName{
font-size: 16px;
}
.rvConversationHeader .replyTimeIndicator .clockIcon svg{
margin-left: 0;
margin-right: 6px;
}
.rvConversationHeader .replyTimeIndicator{
font-size: 14px;
font-weight: 400;
}
.rvConvMsg{
margin-bottom:15px;
-webkit-animation:rvMsgAnim .3s;
-moz-animation:rvMsgAnim .3s;
animation:rvMsgAnim .3s;
-webkit-animation-fill-mode:forwards;
-moz-animation-fill-mode:forwards;
animation-fill-mode:forwards
}
@-webkit-keyframes rvMsgAnim{
0%{-webkit-transform:translateY(10px);opacity:0}
100%{-webkit-transform:translateY(0);opacity:1}
}
@-moz-keyframes rvMsgAnim{
0%{-moz-transform:translateY(10px);opacity:0}
100%{-moz-transform:translateY(0);opacity:1}
}
@keyframes rvMsgAnim{
0%{transform:translateY(10px);opacity:0}
100%{transform:translateY(0);opacity:1}
}
.rvConvMsg>.rvConvMsgInner>.rvConvMsgText{
background-color:#f1f1f1;
color:#222;
padding:10px 12px;
border-radius:10px 10px 10px 0;
font-size:13px;
margin:0;
word-break:break-word;
max-width: 70%;
display: inline-block;
}
.rvConvMsg>.rvConvMsgInner>.rvConvMsgText a{
color:inherit;
text-decoration:underline;
}
.rvConvMsg.rvMsgRight>.rvConvMsgInner>.rvConvMsgText a{
color:#fff;
text-decoration:underline
}
.rvConvMsg>.rvConvMsgInner>.rvConvMsgTime{
font-size:11px;
margin:0;
margin-bottom:2px;
// max-width: 70%;
// display: inline-block;
}
.rvConvMsg.rvMsgRight{
text-align:right
}
.rvConvMsg.rvMsgRight>.rvConvMsgInner>.rvConvMsgText{
background-color:#2f26d0;
color:#fff;
border-radius:10px 10px 0 10px;
margin:0;
display:inline-block;
text-align:left
}
.rvConvMsg.rvMsgRight>.rvConvMsgInner>.rvConvMsgTime{
padding-right:5px
}
.rvReplyInputBox {
position: absolute;
bottom: 46px;
left: 0;
right: 0;
min-height: 53px;
max-height: 200px;
border-top: 1px solid #e6e6e6;
z-index: 1;
}
.rvReplyInputBox textarea{
width: 100%;
height: 100%;
line-height: 1.33;
background: #fff;
white-space: pre-wrap;
word-wrap: break-word;
font-size: 14px;
font-weight: 400;
-webkit-transition: -webkit-box-shadow .2s;
transition: -webkit-box-shadow .2s;
transition: box-shadow .2s;
transition: box-shadow .2s,-webkit-box-shadow .2s;
color: #000;
padding: 17px 40px 17px 15px;
letter-spacing: normal;
position: absolute;
bottom: 0;
left: 0;
font-family: Poppins,sans-serif;
}
.rvMessengerReplyInputUtils {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
position: absolute;
top: 50%;
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
right: 10px;
top: 29px;
}
.rvMessengerReplyInputUtilsButton {
height: 30px;
width: 30px;
display: block;
cursor: pointer;
margin: 0 4px;
background: transparent;
}
.rvReplyInputBox button, .rvReplyInputBox textarea {
border: none;
outline: none;
}
.rve_dg_btn_Wrapper{
flex-wrap: wrap;
overflow: auto;
font-size: 14px;
transform: translateY(10px);
will-change: transform;
}
.rve_buttonGroup button,
.rve_dg_btn_Wrapper button,
.rve_dg_btn_Wrapper .rve_outter_btn_options,
.rve_dg_btn_Wrapper .rve_dg_btn_options{
-webkit-box-align: center;
align-items: center;
padding: 10px 20px;
max-width: 235px;
text-align: left;
cursor: pointer;
margin-bottom: 5px;
margin-top: 5px;
background-color: rgb(237, 240, 247);
border: 1px solid ${botsetting_DEV.Bot_Agent_Button_Color};
border-radius: 8px;
color: rgba(61, 78, 99, 0.8);
display: inline-block;
margin-right: 10px;
transition: background 0.2s ease 0s;
font-size: 15px;
}
.rve_buttonGroup button{
width:100%;
margin: 0 0 15px;
max-width: 100%;
padding: 8px 20px;
border-radius: 5px;
}
.rve_buttonGroup.rve_mb20 button{
margin-bottom: 20px;
}
.rve_buttonGroup button:lastchild{
margin-bottom:0;
}
.rve_buttonGroup button:hover,
.rve_dg_btn_Wrapper button:hover,
.rve_dg_btn_Wrapper .rve_dg_btn_options:hover{
color: rgb(255, 255, 255);
background-color: ${botsetting_DEV.Bot_Agent_Button_Color};
}
.rve_trigger {margin-top: 20px;}
rve_dg_btn_Wrapper button,
.rve_dg_btn_Wrapper .rve_outter_btn_options,
.rve_dg_btn_Wrapper .rve_dg_btn_options{
-webkit-box-align: center;
align-items: center;
padding: 10px 20px;
max-width: 235px;
text-align: left;
cursor: pointer;
margin-bottom: 5px;
margin-top: 5px;
background-color: rgb(237, 240, 247);
border: 1px solid ${botsetting_DEV.Bot_Agent_Button_Color};
border-radius: 8px;
color: rgba(61, 78, 99, 0.8);
display: inline-block;
margin-right: 10px;
transition: background 0.2s ease 0s;
font-size: 15px;
}
.rve_dg_btn_Wrapper button:hover,
.rve_dg_btn_Wrapper .rve_dg_btn_options:hover{
color: rgb(255, 255, 255);
background-color: ${botsetting_DEV.Bot_Agent_Button_Color};
}
.typing-indicator {
/*background-color: #e6e7ed;*/
will-change: transform;
width: auto;
border-radius: 50px;
padding: 20px;
display: inline-block;
margin: 0 auto;
position: relative;
animation: 2s bulge infinite ease-out;
}
.typing-indicator::before, .typing-indicator::after {
content: '';
position: absolute;
bottom: -2px;
left: -2px;
height: 20px;
width: 20px;
border-radius: 50%;
/*background-color: #e6e7ed;*/
}
.typing-indicator::after {
height: 10px;
width: 10px;
left: -10px;
bottom: -10px;
}
.typing-indicator span {
height: 8px;
width: 8px;
float: left;
margin: 0 1px;
background-color: #9e9ea1;
display: block;
border-radius: 50%;
opacity: 0.4;
}
.typing-indicator span:nth-of-type(1) {
animation: 1s blink infinite 0.3333s;
}
.typing-indicator span:nth-of-type(2) {
animation: 1s blink infinite 0.6666s;
}
.typing-indicator span:nth-of-type(3) {
animation: 1s blink infinite 0.9999s;
}
@keyframes blink {
50% {
opacity: 1;
}
}
@keyframes bulge {
50% {
transform: scale(1.05);
}
}
.rvMsgContainer>.rvConvMsg>.rvConvMsgInner .rvecImageWrapper {
padding: 12px 12px;
background-color: #f1f1f1;
border-radius:15px;
display:inline-block;
}
.rvMsgContainer>.rvConvMsg>.rvConvMsgInner .rvecImageWrapper img{
border-top-left-radius:15px;
border-top-right-radius:15px;
max-width:100%;
max-height:180px
}
.rvMsgContainer>.rvConvMsg>.rvConvMsgInner .rvecImageWrapper .rvecImgContTitle{
font-size: 17px;
margin-bottom:10px;
margin-top:10px;
font-weight: bold;
line-height:1.2;
}
.rvMsgContainer>.rvConvMsg>.rvConvMsgInner .rvecImageWrapper .rvecImgContSubTitle a,
.rvMsgContainer>.rvConvMsg>.rvConvMsgInner .rvecImageWrapper .rvecImgContTitle a{
text-decoration: none;
color:inherit;
}
.rvecImageWrapper .rvecImgContSubTitle{
font-size: 14px;
margin: 0;
}
.rvecGalleryInnerContainer {
max-width: 1000px;
position: relative;
margin: auto;
}
.rvecGalleryInnerContainer > div {
display: none;
}
/* Fading animation */
.fade {
-webkit-animation-name: fade;
-webkit-animation-duration: 1.5s;
animation-name: fade;
animation-duration: 1.5s;
}
@-webkit-keyframes fade {
from {opacity: .4}
to {opacity: 1}
}
@keyframes fade {
from {opacity: .4}
to {opacity: 1}
}
/* Next & previous buttons */
.rvecGalleryOuterContainer .rvecgalleryprev, .rvecGalleryOuterContainer .rvecgallerynext {
cursor: pointer;
position: absolute;
top: 50%;
margin-top: -22px;
color: #000;
font-weight: bold;
font-size: 18px;
transition: 0.6s ease;
border-radius: 0 3px 3px 0;
user-select: none;
background-color: rgb(255, 255, 255);
box-shadow: rgb(40 44 53 / 6%) 0px 4px 15px 0px, rgb(40 44 53 / 8%) 0px 2px 2px 0px;
border-radius: 50%;
width: 40px;
height: 40px;
text-align: center;
line-height: 40px;
}
.rvMsgContainer>.rvConvMsg>.rvConvMsgInner .rvecImageWrapper,
.rvMsgContainer>.rvConvMsg>.rvConvMsgInner .rvecGalleryOuterContainer .rvecImageWrapper{
display: inline-block;
width: 280px;
}
.rvMsgContainer>.rvConvMsg>.rvConvMsgInner .rvecGalleryOuterContainer .rvecImageWrapper{
display: block;
margin: 0 auto;
}
.rvMsgContainer>.rvConvMsg>.rvConvMsgInner .rvecImageWrapper img{
border-radius: 5px;
}
.rvMsgContainer>.rvConvMsg>.rvConvMsgInner .rvecImageWrapper .rvecImageInnerWrap{
text-align:center;
}
/* Position the "next button" to the right */
.rvecGalleryOuterContainer .rvecgallerynext {
right: 0;
// border-radius: 3px 0 0 3px;
}
/* On hover, add a black background color with a little bit see-through */
.rvecGalleryOuterContainer .rvecgalleryprev:hover, .rvecGalleryOuterContainer .rvecgallerynext:hover {
// background-color: rgba(0,0,0,0.8);
}
.rvMsgContainer .rvecGalleryOuterContainer .ptw_right {
text-align: right;
}
.rvForm {
padding: 1.5rem;
background: #fff;
border: 1px solid #ccc;
border-top: 2px solid ${botsetting_DEV.Bot_Agent_Background_Color};
border-radius: 5px;
max-width: 250px;
margin-left: auto;
text-align: left;
}
.rvFormWrapper {
font-size: 13px;
color: #4d4d4d;
}
.rvForm .rvFormField label {
margin-bottom: 8px;
font-size: 14px;
font-weight: 400;
}
.rvForm .rvFormField .form-group {
margin-top: 0.75rem;
margin-bottom: 0.75rem;
}
.rvForm .rvFormField .form-control {
border-color: #b3b3b3;
color: #333;
padding: 10px 15px;
height: 50px;
line-height: 50px;
box-shadow: none;
border-width: 1px;
-webkit-appearance: none;
background-color: #fff;
background-image: none;
border-radius: 4px;
border: 1px solid #dcdfe6;
-webkit-box-sizing: border-box;
box-sizing: border-box;
color: #606266;
display: inline-block;
font-size: inherit;
outline: 0;
-webkit-transition: border-color .2s cubic-bezier(.645,.045,.355,1);
transition: border-color .2s cubic-bezier(.645,.045,.355,1);
width: 100%;
border-top-right-radius:0;
border-bottom-right-radius:0;
}
.rvForm .rvFormField .form-button {
background-color: #f5f7fa;
color: #909399;
vertical-align: middle;
display: table-cell;
position: relative;
white-space: nowrap;
}
.rvConvMsgInner .rvForm{
max-width: 100%;
}
.rvConvMsgInner .rvForm.initialLoader{
max-width: 250px;
}
.rvForm .rvFormField .form-button button {
padding: 12px 12px;
height: 50px;
border: none;
width: 40px;
border: 1px solid #dcdfe6;
border-radius: 4px;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
cursor: pointer;
}
.rvForm .rvFormField .form-button button i{
font-size: 20px;
color: ${botsetting_DEV.Bot_Agent_Button_Color};
}
.rvAccessForm .form-group.form-error,
.rvForm .rvFormField .form-input.form-error {
position: relative;
}
.rvAccessForm .form-group.form-error span.form-feedback,
.rvForm .rvFormField span.form-feedback {
position: absolute;
left: 0;
right: 0;
top: 100%;
color: red;
font-size: 11px;
}
.rvAccessForm .form-group.form-error .form-control,
.rvForm .rvFormField .form-input.form-error .form-control {
border-color: red;
}
.rvec_activity .rvConvMsgInner {
padding: 5px 16px;
text-align: center;
font-size: 10px;
display: inline-block;
color: #8898aa !important;
}
.rvec_activity {
text-align: center;
}
.rvArticleColList:hover,
.rv-edahy21:hover{
background-color: ${botsetting_DEV.Bot_Agent_Button_Color}0f;
color: ${botsetting_DEV.Bot_Agent_Background_Text_Color};
}
.rvInnerPageWrap.rvScrollBehaviour{
overflow: auto;
max-height: calc(100% - 103px);
}
.rvInnerPageWrapper{
-webkit-box-flex: 1;
-ms-flex: 1;
flex: 1;
overflow: auto;
overflow-x: hidden;
background-color: #fff;
}
.rvAccessWrap,
.rvProductFaqWrap {
margin: 20px;
width: calc(100% - 40px);
height: unset;
padding-bottom: 7px;
border-radius: 8px;
background: #fff;
-webkit-box-shadow: ${botsetting_DEV.boxShadow};
box-shadow: ${botsetting_DEV.boxShadow};
}
.rvAccessHeader,
.rvProductFaqHeader {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: start;
-ms-flex-align: start;
align-items: flex-start;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
font-size: 24px;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
padding: 20px;
color: #000;
font-weight: 600!important;
}
.rvAccessForm{
padding: 0 20px 20px;
}
.rvAccessForm .form-group{
margin-bottom: 20px;
}
.rvAccessForm .form-group label{
line-height: normal;
text-align: left;
margin-bottom: 8px;
color: rgb(0, 0, 0);
display:inline-block;
}
.rvAccessForm .form-group .input-group input{
border-color: #b3b3b3;
color: #333;
padding: 10px 15px;
height: 40px;
line-height: 40px;
box-shadow: none;
border-width: 1px;
-webkit-appearance: none;
background-color: #fff;
background-image: none;
border-radius: 4px;
border: 1px solid #dcdfe6;
-webkit-box-sizing: border-box;
box-sizing: border-box;
color: #606266;
display: inline-block;
font-size: inherit;
outline: 0;
-webkit-transition: border-color .2s cubic-bezier(.645,.045,.355,1);
transition: border-color .2s cubic-bezier(.645,.045,.355,1);
width: 100%;
}
.rvAccessForm .form-button .accessFormSubmit{
width: 100%;
max-width: 327px;
font-size: 12px;
word-spacing: 1px;
display: flex;
-webkit-box-align: center;
align-items: center;
-webkit-box-pack: center;
justify-content: center;
position: relative;
cursor: pointer;
border-radius: 8px;
color: ${botsetting_DEV.Bot_Agent_Button_Text_Color};
border: 1px solid ${botsetting_DEV.Bot_Agent_Button_Color};
background-color: ${botsetting_DEV.Bot_Agent_Button_Color};
padding: 0.95rem 1.5rem;
font-size: 14px;
}
.removeBefore{
cursor: default !important;
}
.removeBefore:hover{
background-color: transparent !important;
}
.removeBefore:before{
display:none !important;
}
.rvArticleColList > div {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
line-height: 15px;
padding: 20px 0;
color: #000;
cursor: pointer;
border-bottom: 1px solid #eee;
font-size: 22px;
font-weight: 500;
-webkit-transition: border-bottom-color .3s;
transition: border-bottom-color .3s;
outline: none;
}
.rvArticleColList > div span:nth-child(1){
padding: 0 20px;
font-size: 16px;
font-weight: 500;
line-height: 22px;
word-break: break-word;
color: #000;
}
.rvArticleColList > div span:nth-child(2){
margin: 0 20px 0 auto;
-webkit-transition: -webkit-transform .3s;
transition: -webkit-transform .3s;
transition: transform .3s;
transition: transform .3s,-webkit-transform .3s;
font-weight: 500;
color: #4d4d4d;
font-size: 16px;
}
.rvArticleColList > div span:nth-child(2) i{
color: ${botsetting_DEV.Bot_Agent_Button_Color};
}
.rvProductFaqWrap > div:last-child > div{
border-bottom: none;
}
.breadCrumbHtml:before,
.rvArticleColList:before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
.rvArticleColList {
position: relative;
cursor: pointer;
}
.breadCrumbHtml {
font-size: 14px;
font-weight: 500;
background-color: rgba(255, 255, 255, 0.12);
border-radius: 6px;
padding: 6px 16px 6px 6px;
cursor: pointer;
max-width: 100%;
position: relative;
}
.breadCrumbHtml .backText {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
margin-left: 5px;
}
.productFaqDescription{
font-size: 17px;
color: #000;
word-break: break-word;
font-weight: 400;
line-height: 1.4;
margin: 1em 0;
}
.rvArticleColList > div.articleOptionList {
border-top: 1px solid #e5e5e5;
margin-top: 30px;
padding: 20px;
display: block;
cursor: default;
}
.rvHelpBottomWrap > button,
.rvArticleColList > div.articleOptionList button{
overflow: hidden;
text-overflow: ellipsis;
white-space: normal;
line-height: 22px;
display: block;
margin-top: 15px;
width: 100%;
padding: 12px 20px;
font-size: 14px;
border: none;
background-color: ${botsetting_DEV.Bot_Agent_Button_Color};
color: ${botsetting_DEV.Bot_Agent_Button_Text_Color};
border-radius: 8px;
font-weight: 500;
cursor: pointer;
}
.rvHelpBottomWrap > button,
.rvArticleColList > div.articleOptionList button:last-child{
background-color:transparent;
border: 1px solid ${botsetting_DEV.Bot_Agent_Button_Color};
color: ${botsetting_DEV.Bot_Agent_Button_Color};
}
.jounerySteps{
margin-right: 8px;
}
.jounerySteps i{
margin: 0 8px 0 0;
font-size: 12px;
color: #666;
}
[data-value] {
position: relative;
}
[data-value]:before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 1;
}
button#accessFormSubmit .rvConvMsg {
margin-bottom: 0;
}
button#accessFormSubmit .rvConvMsg .rvConvMsgInner .typing-indicator {
padding: 0;
}
button#accessFormSubmit .rvConvMsg .rvConvMsgInner .typing-indicator span {
background-color: ${botsetting_DEV.Bot_Agent_Button_Text_Color};
}
.noOrderMessage {
padding: 20px;
text-align: center;
font-size: 14px;
}
.rvOrderListInner {
padding: 20px;
}
.rvHelpOrderTopWrap{
padding: 20px;
background-color: #f3f3f3;
border-top-left-radius:8px;
border-top-right-radius:8px;
}
.rvHelpOrderTopWrap .orderImage{
background-color: transparent;
}
.rvHelpMiddleWrap {
padding: 15px 20px;
border-bottom: 1px solid #eee;
}
.rvHelpHeadTitle {
font-size: 21px;
font-weight: 600;
}
.rvHelpDescription{
padding-top:15px;
color:#484747;
}
.noBorderBottom{
border-bottom: none !important;
}
.rvHelpBottomWrap{
padding: 0 20px 20px;
}
.rvHelpOptionWrap .rvArticleColList:last-child > div{
border-bottom:none;
}
.orderImage {
width: 40px;
height: 40px;
background: #e7e4e4;
padding: 0px;
display: flex;
justify-content: center;
align-items: center;
margin-right: 10px;
border-radius: 4px;
}
.orderImage svg {
width: 29px;
height: 29px;
}
.orderLeftWrapper .orderNumberWrapper {
font-size: 15px;
font-weight: 500;
line-height: 1;
margin-bottom: 2px;
}
.orderLeftWrapper .orderDateWrapper {
font-size: 12px;
font-weight: 500;
color: #878585;
}
.orderStatusWrapper span {
display: inline-block;
padding: 2px 9px;
background-color: #2daf2d;
color: #fff;
border-radius: 6px;
}
.rvOrderTopWrap {
margin-bottom: 15px;
}
/*.rvHelpOrderTopWrap{
background-color:#ccc;
border-top-left-radius:8px;
border-top-right-radius:8px;
}*/
.rvOrderMiddleWrap .width50 {
width: 50%;
}
.rvMiddleHeadWrap {
font-size: 16px;
font-weight: 400;
color: #878585;
line-height: 1;
}
.rvMiddleContWrap {
font-size: 16px;
font-weight: 600;
}
.rvOrderMiddleWrap {
margin-bottom: 15px;
}
button.rvOrderInnerButton {
padding: 8px 20px;
background: transparent;
outline: none;
box-shadow: none;
border: 1px solid ${botsetting_DEV.Bot_Agent_Button_Color};
color: ${botsetting_DEV.Bot_Agent_Button_Color};
cursor: pointer;
}
button.rvOrderInnerButton:hover{
background-color: ${botsetting_DEV.Bot_Agent_Button_Color};
color: ${botsetting_DEV.Bot_Agent_Button_Text_Color};
}
button.rvOrderInnerButton:not(:last-child) {
margin-right: 10px;
}
.rvFlexWrap{
flex-wrap: wrap;
}
.breadCrumbInnerWrapper {
padding: 12px 20px;
margin-bottom: 10px;
}
.breadCrumbInnerWrapper > div > div {
padding: 2.5px 5px;
display: flex;
align-items: center;
}
.breadCrumbInnerWrapper > div > div:not(:last-child):after {
content: ">";
padding-left: 10px;
font-size: 16px;
font-weight: 500;
line-height: 1;
}
.breadCrumbInnerWrapper > div > div:not(:last-child):after,
.breadCrumbInnerWrapper > div > div:last-child {
color: #8d8d8d;
}
.breadCrumbInnerWrapper > div > div:not(:last-child) {
cursor: pointer;
}
.accessYourAccount.rvInnerPageWrap.rvScrollBehaviour {
background-color: #fff;
height: calc(100% - 141px);
overflow: auto;
}
.rvAddressInnerWrap .orderImage {
width: auto;
height: auto;
padding: 10px;
margin-top: 6px;
}
.rvAddressInnerWrap {
align-items: flex-start;
margin-top: 20px;
}
.rvCustAddressWrapper .rvHeadTitle {
font-size: 15px;
font-weight: 500;
}
.rvCustAddressWrapper .rvHeadDescription {
font-size: 13px;
color: #7a7777;
}
.rvInnerLoader {
flex: 1 1 0%;
position: relative;
width: 100%;
height: 100%;
align-items: center;
justify-content: center;
display: flex;
}
.rvLoaderWrapper{
border: 6px solid #f3f3f3;
border-top: 6px solid ${botsetting_DEV.Bot_Agent_Button_Color};
border-radius: 50%;
width: 30px;
height: 30px;
animation: spin 2s linear infinite;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
.rvProductImageWrapper {
position: relative;
}
.rvProductImage {
width: 40px;
height: 40px;
padding: 7px;
background: #fff;
box-shadow: 0 0 5px rgb(0 0 0 / 10%);
display: flex;
align-items: center;
margin-right: 15px;
border-radius: 8px;
}
img.productImage {
max-width: 100%;
}
.rvProductQty {
position: absolute;
padding: 8px;
top: -8px;
background: ${botsetting_DEV.Bot_Agent_Button_Color};
border-radius: 50%;
width: 5px;
height: 5px;
display: flex;
align-items: center;
justify-content: center;
color: ${botsetting_DEV.Bot_Agent_Button_Text_Color};
left: 40px;
font-size: 12px;
}
.rvProductOuterWrapper {
margin-bottom: 15px;
}
#map {
width: 100%;
height: 160px;
}
.trackingHeaderWrap {
padding: 20px 0 15px;
border-bottom: 1px solid #dcdcdc;
font-size: 16px;
font-weight: 600;
}
.rvCourierName {
padding-left: 15px;
font-weight: 600;
}
.rvTrackingInfoWrap p {
margin: 0;
font-size: 15px;
}
.rvTrackingInfoWrap {
padding-right: 15px;
margin-top: 10px;
}
.rvNoTrackInfo {
padding: 10px 10px 0;
text-align: center;
font-size: 15px;
font-weight: 600;
}
.rvReturnOptionHead {
padding: 0 0 15px;
align-items: center;
border-bottom: 1px solid #eee;
}
.rvReturnOptionHead .helpOptionLeft {
font-weight: 600;
}
.customCheckBox1 {
display: block;
position: relative;
padding-left: 22px;
cursor: pointer;
font-size: 14px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.customCheckBox1 > input {
position: absolute;
opacity: 0;
cursor: pointer;
height: 0;
width: 0;
}
.customCheckBox1 span.checkmark {
position: absolute;
top: 0;
left: 0;
height: 15px;
width: 15px;
background-color: #fff;
border-radius: 50%;
border: 1px solid ${botsetting_DEV.Bot_Agent_Button_Color}3b;
}
.customCheckBox1:hover input ~ .checkmark {
background-color: ${botsetting_DEV.Bot_Agent_Button_Color}3b;
}
.customCheckBox1 input:checked ~ .checkmark {
background-color: ${botsetting_DEV.Bot_Agent_Button_Color};
}
.customCheckBox1 span.checkmark:after {
content: "";
position: absolute;
display: block;
left: 5px;
top: 2px;
width: 3px;
height: 6px;
border: solid ${botsetting_DEV.Bot_Agent_Button_Color}3b;
border-width: 0 2.5px 2.5px 0;
-webkit-transform: rotate(45deg);
-ms-transform: rotate(45deg);
transform: rotate(45deg);
}
.customCheckBox1 input:checked ~ span.checkmark:after{
border-color: ${botsetting_DEV.Bot_Agent_Button_Text_Color};
}
.rvHelpMiddleWrap .rvProductImage {
width: 40px;
height: auto;
background: none;
box-shadow: none;
padding: 0;
}
.rvHelpMiddleWrap .rvProductTitle{
line-height: 1;
}
span.productName.ellipsis {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
display: inline-block;
width: 130px;
margin-bottom:5px;
}
.rvReturnProductWrapper{
margin-bottom: 0;
padding-top: 20px;
padding-bottom: 20px;
border-bottom: 1px solid #eee;
}
.wid100{
width: 100%;
}
.wid80 {
width: 80%;
}
.wid20 {
width: 20%;
}
.rvProductConversationList {
padding: 20px;
background-color: #f2eaea;
}
.rvConvProdTitle {
font-size: 15px;
font-weight: 600;
padding-bottom:10px;
}
.errorFeedBack > div {
padding: 10px 15px 0;
color: red;
}
.reasonForReturns {
margin: 15px 0;
}
.reasonForReturns label {
display: block;
margin-bottom: 5px;
font-weight: 500;
}
.refundOrExchange{
margin-bottom:0;
}
.rvConvMsgInner .rvAccessWrap {
margin: 0;
width: 100%;
text-align: left;
}
.rvConvMsgInner .rvAccessWrap .rvOrderMiddleWrap {
margin-bottom: 0;
}
.rvProductConversationList div {
font-size: 13px;
}
.text-right{
text-align:right;
}
.triggerConversationWrapper button{
width: 100%;
margin: 5px;
padding: 10px 15px;
border-radius: 5px;
background-color: transparent;
border: 1px solid ${botsetting_DEV.Bot_Agent_Button_Color};
color: ${botsetting_DEV.Bot_Agent_Button_Color};
cursor: pointer;
}
.rvForm.loader{
position:realtive;
}
.rvForm.loader:before {
content: '';
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
background-color: rgba(255,255,255,1);
opacity: 0.4;
z-index: 55544;
}
.rvConvMsg.rvMsgRight>.rvConvMsgInner>.rvConvMsgText.articleStartWrapper{
display: inline-block;padding: 1rem;border-radius: 7px;border: 1px solid #ccc;max-width: 85%;font-weight: 400;line-height: 22px;font-size: 15px;background-color: transparent;color: #000;
}
.trackingOuterWrapper{
margin-bottom: 30px;
padding-bottom: 10px;
border-bottom: 1px solid #dcdcdc;
}
.overflow-elipses {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
max-width: 100%;
}
.width85{
width: 85%;
}
.width100{
width:100%;
}
.rvBotAvatar{
box-shadow: #0000001a 0px 5px 10px;
width: 20px;
height: 20px;
border-radius: 50%;
}
`
return styles;
},
triggerMsgCss: function(){
var styles = `
@charset "UTF-8";@import url(https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap);
body{
margin:0;
font-family: Poppins,sans-serif;
font-size: 14px;
line-height: 1.5;
}
.rvBotAvatar{
box-shadow: #0000001a 0px 5px 10px;
border: 1px solid #d3d2d2;
width: 34px;
border-radius: 50%;
}
.rvTrigger.posRelative {
position: relative;
border-radius: 5px 5px 5px 0px;
box-sizing: border-box;
padding: 15px 0px;
background-color: rgb(255, 255, 255);
box-shadow: ${botsetting_DEV.boxShadow};
clear: both;
margin-left: 45px;
margin-bottom: 8px;
}
.rvTriggerBotIcon {
position: absolute;
bottom: 0px;
left: -40px;
box-shadow: rgba(35, 47, 53, 0.09) 0px 2px 8px 0px;
border-radius: 100%;
}
.rvTriggerBotIcon img {
width: 32px;
}
.rvoperatorWrap {
font-size: 10px;
color: rgba(115, 115, 118, 0.7);
padding: 0px 20px 10px;
}
.rvoperatorMsgWrap {
padding: 0px 20px;
max-height: 300px;
}
.rvOperatorContWrap {
font-size: 14px;
line-height: 1.4;
/* margin: 0px 0px 10px; */
}
.rvTrigger.posRelative:after {
content: "";
position: absolute;
bottom: 0px;
left: -5px;
width: 0px;
height: 0px;
border-style: solid;
border-width: 0px 0px 13px 5px;
border-color: transparent transparent white;
}
.flypopup{
padding: 0;
width: 285px;
position: absolute;
bottom: 0;
border-radius: 12px;
display: flex;
flex-direction: column;
z-index: 1;
right: 0;
margin-left: 20px;
opacity:0;
transition: ease-in 2s opacity;
}
.flypopup.enable{
opacity:1;
}
.flypopup .close-button-wrapper {
position: absolute;
bottom: 100%;
opacity: 0;
width: 100%;
height: 45px;
transition: all 0.3s ease 0s;
transform: translateY(10px);
left: 0px;
}
.flypopup .close-button-wrapper button.material-icons.exit-chat.mobile-close {
position: absolute;
top: 0px;
border-radius: 50%;
margin: 0px;
padding: 3px;
box-shadow: rgb(0 0 0 / 16%) 0px 3px 6px, rgb(0 0 0 / 23%) 0px 3px 6px;
height: 24px;
width: 24px;
display: flex;
background: rgb(255, 255, 255);
right: 5px;
}
.flypopup:hover .close-button-wrapper {
opacity: 1;
transform: translateY(0px);
}
button, button.material-icons {
background: none;
border: 0px;
color: inherit;
font-style: inherit;
font-variant: inherit;
font-weight: inherit;
font-stretch: inherit;
font-size: inherit;
font-family: inherit;
line-height: normal;
overflow: visible;
padding: 0px;
user-select: none;
outline: none;
cursor: pointer;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
.rve_trigger button{
margin: 0 0 10px auto;
font-size: 14px;
line-height: 18px;
padding: 10px;
border-radius: 6px;
background-color: rgb(0, 113, 178);
color: rgb(255, 255, 255);
display: block;
}
.rve_trigger button:hover{
background-color: rgb(229, 246, 255);
color: rgb(0, 113, 178);
}
.rve_trigger button:lastchild{
margin-bottom:0;
}
.flypopup .close-button-wrapper button.material-icons.exit-chat.mobile-close svg#ic_close {
width: 20px;
height: 20px;
fill: rgb(136, 148, 171);
}
`
return styles;
},
flyOptionEvent: async function(e){
var activateUser = 0
if (e.target.parentNode.classList[0] === "rve_dg_btn_Wrapper") {
e.target.parentNode.parentNode.remove();
} else {
activateUser = 1;
notificationContentFrameDEV.getElementsByClassName("new-message")[0].innerHTML = 0;
rvSetCookies(31, "notify-value", 0);
var flyMessage = triggerContentFrameDEV.querySelector(".flypopup");
if(flyMessage){
flyMessage.style.display = "none";
triggerFrameDEV.style.display = "none";
var circle_ripple = toggleContentFrameDEV.querySelector(".circle-ripple");
circle_ripple.style.display = "none";
notificationFrameDEV.style.display = "none";
var dd = divWidgetDEV;
dd.style.display = "block";
}
}
var options = e.target.dataset.value;
currentOption = options
rvSetCookies(31, "rvce_current_option", options);
if( options === "live_agent" ){
Is_Agent_DEV = true
Is_Agent_Flag_DEV = "changed"
rvSetCookies( 1, 'agent-chat', true);
}else{
Is_Agent_DEV = false
Is_Agent_Flag_DEV = "changed"
rvSetCookies( 1, 'agent-chat', false);
}
if( options === "workflow"){
await RVBotViewDev.startConversationFunc(false);
workflow_DEV = true;
let index = e.target.dataset.workflow
let websitePage = websitePages_DEV[index]
var getCurTime = RVBotViewDev.rvGetCurrentTime();
msg = websitePage.Trigger_Message.replace(/\n/g, "
");
let name = ( RV_Customer_Name_DEV && RV_Customer_Name_DEV === null ) ? RV_Customer_Name_DEV : 'me';
var rvMessage =`
${name}, ${getCurTime}
${msg}
`;
RV_CONVERSATION += rvMessage;
RVBotViewDev.removeTyping();
RV_MSG_BODY_HEIGHT_DEV.insertAdjacentHTML("beforebegin", rvMessage);
RVBotViewDev.rvSendMessage( msg, "workflow", "user", "", websitePage.Agent_Bot_Workflow_Id, "", activateUser);
currentWorkflowId_DEV = websitePage.Agent_Bot_Workflow_Id;
RVBotViewDev.rvResetMsgScroll();
if( Visitor_Chat_Id_DEV !== "" ){
socketDEV.emit("online", { Conversation_Id: Conversation_Id, Website_Id: Website_Id_DEV })
}
}else{
workflow_DEV = false;
currentWorkflowId_DEV = "";
widgetContentFrameDEV.querySelector('.rvReplyInputBox > textarea').setAttribute('disabled', 'disabled');
widgetContentFrameDEV.querySelector('.rvReplyInputBox .rvMessengerReplyInputUtilsButton').classList.add('disabled');
var lc_msg = "";
if(rvGetCookies("pt_login_customer")){
lc_msg = "Hi "+RV_Customer_Name_DEV+", ";
}
var msg = options === "faq" ? "Please enter your queries" : ''
if (msg) {
await RVBotViewDev.startConversationFunc(false);
var getCurTime = RVBotViewDev.rvGetCurrentTime();
msg = msg.replace(/\n/g, "
");
var rvMessage =`
Bot, ${getCurTime}
${lc_msg+msg}
`;
RV_CONVERSATION += rvMessage;
RVBotViewDev.removeTyping();
RV_MSG_BODY_HEIGHT_DEV.insertAdjacentHTML("beforebegin", rvMessage);
RVBotViewDev.rvSendMessage( msg, "no", "bot", "","","",activateUser);
RVBotViewDev.rvResetMsgScroll();
if( Visitor_Chat_Id_DEV !== "" ){
socketDEV.emit("online", { Conversation_Id: Conversation_Id, Website_Id: Website_Id_DEV })
}
} else {
await RVBotViewDev.startConversationFunc();
RVBotViewDev.initiateConversation();
// if (rvGetCookies("rv_email") || rvGetCookies("login-customerid")) {
// var pt_login_box = widgetContentFrameDEV.querySelector(".loginBox");
// pt_login_box.style.display = "none";
// RVBotViewDev.rvSendMessage("started live chat", "", "activity", "online");
// } else {
// widgetContentFrameDEV.getElementsByClassName('loginBox')[0].style.left = 0;
// // var ptw_cb_footer = document.querySelector(".ptw_cb_footer");
// // ptw_cb_footer.style.display = "none";
// //ptResetMessageScroll();
// }
}
}
},
initiateConversation: function(){
if( RVAgentOption ){
rvSetCookies(31, "rvce_current_option", "live_chat");
currentOption = "live_chat";
}
if(RV_EXISTING_CUSTOMER === false){
var rvMessage =`
Bot, ${RVBotViewDev.rvGetCurrentTime()}
Are you an existing customer?
`;
RV_CONVERSATION += rvMessage;
RVBotViewDev.removeTyping();
RV_MSG_BODY_HEIGHT_DEV.insertAdjacentHTML("beforebegin", rvMessage);
RVBotViewDev.rvSendMessage( "Are you an existing customer?", "", "bot");
var rvMessage = `
Yes, I'm a customer
No, I'm not a customer yet
`;
RVBotViewDev.removeTyping();
RV_MSG_BODY_HEIGHT_DEV.insertAdjacentHTML("beforebegin", rvMessage);
RVBotViewDev.rvResetMsgScroll();
let domButtons = widgetContentFrameDEV.querySelectorAll(".rv_initiate_conversation");
for (i = 0; i < domButtons.length; i++) {
domButtons[i].addEventListener("click", RVBotViewDev.rvCustomerOption);
}
}else{
if( !rvGetCookies("rv_email") ) {
RVBotViewDev.rvCollectEmailInformation();
}else if( !rvGetCookies("rv_name") ) {
RVBotViewDev.rvCollectNameInformation();
}else{
RVBotViewDev.rvCollectMessage();
}
}
},
rvCollectEmailInformation: async function(){
let msg = "Give the team a way to reach you.";
var rvMessage =`
Bot, ${RVBotViewDev.rvGetCurrentTime()}
${msg}
`;
RV_CONVERSATION += rvMessage;
RVBotViewDev.removeTyping();
RV_MSG_BODY_HEIGHT_DEV.insertAdjacentHTML("beforebegin", rvMessage);
RVBotViewDev.rvSendMessage( msg, "", "bot");
var rvMessage = `
`;
RVBotViewDev.removeTyping();
RV_MSG_BODY_HEIGHT_DEV.insertAdjacentHTML("beforebegin", rvMessage);
RVBotViewDev.rvResetMsgScroll();
RVBotViewDev.collectEmailEvent();
},
rvCollectNameInformation: function(){
let msg = "Thanks! A few more details will help assign you to the right person:";
var rvMessage =`
Bot, ${RVBotViewDev.rvGetCurrentTime()}
${msg}
`;
RV_CONVERSATION += rvMessage;
RVBotViewDev.removeTyping();
RV_MSG_BODY_HEIGHT_DEV.insertAdjacentHTML("beforebegin", rvMessage);
RVBotViewDev.rvSendMessage( msg, "", "bot");
var rvMessage = `
`;
RVBotViewDev.removeTyping();
RV_MSG_BODY_HEIGHT_DEV.insertAdjacentHTML("beforebegin", rvMessage);
RVBotViewDev.rvResetMsgScroll();
RVBotViewDev.collectNameEvent();
},
rvCollectMessage: function(){
let msg = "Please leave your message";
var rvMessage =`
Bot, ${RVBotViewDev.rvGetCurrentTime()}
${msg}
`;
RV_CONVERSATION += rvMessage;
RVBotViewDev.removeTyping();
RV_MSG_BODY_HEIGHT_DEV.insertAdjacentHTML("beforebegin", rvMessage);
RVBotViewDev.rvSendMessage( msg, "", "bot");
RVBotViewDev.rvResetMsgScroll();
RVBotViewDev.collectMessageEvent();
},
collectMessageEvent: function (){
widgetContentFrameDEV.querySelector('.rvReplyInputBox > textarea').removeAttribute('disabled');
widgetContentFrameDEV.querySelector('.rvReplyInputBox .rvMessengerReplyInputUtilsButton').classList.remove('disabled');
var textArea = widgetContentFrameDEV.body.querySelector('.rvReplyInputBox textarea');
textArea.addEventListener("keydown", RVBotViewDev.collectMessageKeyDownEvent);
textArea.addEventListener("keyup", RVBotViewDev.collectMessageKeyUpEvent);
},
collectMessageKeyDownEvent: function (e){
var rvMsg = this.value;
var keyCode = e.keyCode || e.which;
if (keyCode == 13) {
if (!e.shiftKey) {
e.preventDefault();
RVBotViewDev.sendMessageBtnClick()
}
}
},
collectMessageKeyUpEvent: function(e){
var rvMsg = this.value;
if (rvMsg) {
widgetContentFrameDEV.querySelector(".rvMessengerReplyInputUtilsButton").classList.add("active");
if (Visitor_Chat_Id_DEV === "") {
socketDEV.emit("user_typing", {
Conversation_Id: Conversation_Id,
Visitor_Chat_Id: Visitor_Chat_Id_DEV,
Website_Id: Website_Id_DEV,
type: "typing",
typing: true,
});
}
RVBotViewDev.collectMessageBtnEvent();
} else {
var rvBtnActive = widgetContentFrameDEV.querySelector(".rvMessengerReplyInputUtilsButton");
rvBtnActive.removeEventListener("click", RVBotViewDev.sendMessageBtnClick);
widgetContentFrameDEV.querySelector(".rvMessengerReplyInputUtilsButton").classList.remove("active");
}
},
collectMessageBtnEvent: function() {
var rvBtnActive = widgetContentFrameDEV.querySelector(".rvMessengerReplyInputUtilsButton.active");
rvBtnActive.addEventListener("click", RVBotViewDev.sendMessageBtnClick);
},
sendMessageBtnClick: async function(){
var msg = widgetContentFrameDEV.body.querySelector('.rvReplyInputBox textarea').value;
if (msg) {
msg = msg.replace(/\n/g, "
");
var msg1 = `
` + RV_Customer_Name_DEV + `, ` + RVBotViewDev.rvGetCurrentTime() +`
` + RVBotViewDev.convertMsgHtml(msg) +`
`;
RV_CONVERSATION += msg1;
RVBotViewDev.removeTyping();
RV_MSG_BODY_HEIGHT_DEV.insertAdjacentHTML("beforebegin", msg1);
RVBotViewDev.rvResetMsgScroll();
var textArea = widgetContentFrameDEV.body.querySelector('.rvReplyInputBox textarea');
var rvBtnActive = widgetContentFrameDEV.querySelector(".rvMessengerReplyInputUtilsButton");
textArea.removeEventListener("keydown", RVBotViewDev.collectMessageKeyDownEvent);
textArea.removeEventListener("keyup", RVBotViewDev.collectMessageKeyUpEvent);
rvBtnActive.removeEventListener("click", RVBotViewDev.sendMessageBtnClick);
widgetContentFrameDEV.body.querySelector('.rvReplyInputBox textarea').value = '';
if( RVAgentOption === true ){
RVBotViewDev.sendMessageEvent();
}else{
widgetContentFrameDEV.querySelector('.rvReplyInputBox > textarea').setAttribute('disabled', 'disabled');
widgetContentFrameDEV.querySelector('.rvReplyInputBox .rvMessengerReplyInputUtilsButton').classList.add('disabled');
}
RVClearNotification_DEV = setInterval(RVBotViewDev.addNotificationMessage, 5000);
let url = "/livechat/updateLead/"+rvWebsiteIdDev;
let data = `VisitorId=${rvGetCookies("VisitorId")}&Visitor_Chat_Id=${Visitor_Chat_Id_DEV}&Conversation_Id=${Conversation_Id}&message=${msg}&RV_RETURN_FORM=${RV_RETURN_FORM}`;
let res = await RVBotViewDev.rvXmlRequest(url, data);
RV_RETURN_FORM = false;
if (res.status == true) {
if (rvGetCookies("customer_id") == "" || rvGetCookies("customer_id") == null) {
rvSetCookies(31, "customer_id", res.Visitor_Chat_Id);
rvSetCookies(31, "conversation_id", res.Conversation_Id);
rvSetCookies(31, "project_id", res.Website_Id);
Visitor_Chat_Id_DEV = res.Visitor_Chat_Id;
Conversation_Id = res.Conversation_Id;
Website_Id_DEV = res.Website_Id;
socketDEV.emit("new_user",{
Website_Id: res.Website_Id,
Visitor_Chat_Id: res.Visitor_Chat_Id,
}
);
}
socketDEV.emit( "online", { Conversation_Id: Conversation_Id, Website_Id: Website_Id_DEV });
}
}
},
addNotificationMessage: function(){
let timeText = "back in";
let timeValue = RVBotViewDev.getNextAvailableTime();
if( RVAgentOption ){
timeText = "reply in";
timeValue = "as soon as possible";
}
let msg = `
You’ll get replies here and in your email:
${RV_Customer_Email_DEV} We’ll be ${timeText}
${timeValue} `;
var rvMessage =`
Bot, ${RVBotViewDev.rvGetCurrentTime()}
${msg}
`;
RV_CONVERSATION += rvMessage;
RVBotViewDev.removeTyping();
RV_MSG_BODY_HEIGHT_DEV.insertAdjacentHTML("beforebegin", rvMessage);
RVBotViewDev.rvSendMessage( msg, "", "bot");
clearInterval(RVClearNotification_DEV);
},
collectEmailEvent: async function(){
let emailDom = widgetContentFrameDEV.body.querySelector('#email');
emailDom.addEventListener('keydown', function(e){
var email = this.value;
if( email === "" ){
e.target.parentNode.classList.add('form-error');
e.target.parentNode.querySelector('.form-feedback').innerHTML = "Please provide email";
return false;
}
if( !/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email) ){
e.target.parentNode.classList.add('form-error');
e.target.parentNode.querySelector('.form-feedback').innerHTML = "Please provide valid email";
return false;
}
e.target.parentNode.classList.remove('form-error');
e.target.parentNode.querySelector('.form-feedback').innerHTML = "";
var keyCode = e.keyCode || e.which;
if (keyCode == 13) {
if (!event.shiftKey) {
RVBotViewDev.updateEmailLead(email);
}
}
});
let emailFormBtn = widgetContentFrameDEV.body.querySelector('.rvCollectUserEmail');
emailFormBtn.addEventListener('click', function(e){
var email = widgetContentFrameDEV.body.querySelector('#email').value;
if( email === "" ){
emailFormBtn.parentNode.parentNode.querySelector('.form-input').classList.add('form-error');
emailFormBtn.parentNode.parentNode.querySelector('.form-feedback').innerHTML = "Please provide email";
return false;
}
if( !/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email) ){
emailFormBtn.parentNode.parentNode.querySelector('.form-input').classList.add('form-error');
emailFormBtn.parentNode.parentNode.querySelector('.form-feedback').innerHTML = "Please provide valid email";
return false;
}
emailFormBtn.parentNode.parentNode.querySelector('.form-input').classList.remove('form-error');
emailFormBtn.parentNode.parentNode.querySelector('.form-feedback').innerHTML = "";
RVBotViewDev.updateEmailLead(email);
})
},
collectNameEvent: async function(){
let nameDom = widgetContentFrameDEV.body.querySelector('#name');
nameDom.addEventListener('keydown', function(e){
var name = this.value;
if( name === "" ){
e.target.parentNode.classList.add('form-error');
e.target.parentNode.querySelector('.form-feedback').innerHTML = "Please provide name";
return false;
}
e.target.parentNode.classList.remove('form-error');
e.target.parentNode.querySelector('.form-feedback').innerHTML = "";
var keyCode = e.keyCode || e.which;
if (keyCode == 13) {
if (!event.shiftKey) {
RVBotViewDev.updateNameLead(name);
}
}
});
let nameFormBtn = widgetContentFrameDEV.body.querySelector('.rvCollectUserName');
nameFormBtn.addEventListener('click', function(e){
var name = widgetContentFrameDEV.body.querySelector('#name').value;
if( name === "" ){
nameFormBtn.parentNode.parentNode.querySelector('.form-input').classList.add('form-error');
nameFormBtn.parentNode.parentNode.querySelector('.form-feedback').innerHTML = "Please provide name";
return false;
}
nameFormBtn.parentNode.parentNode.querySelector('.form-input').classList.remove('form-error');
nameFormBtn.parentNode.parentNode.querySelector('.form-feedback').innerHTML = "";
RVBotViewDev.updateNameLead(name);
})
},
updateEmailLead: async function(email){
let initialLoader = widgetContentFrameDEV.body.querySelector('.initialLoader');
initialLoader.classList.add('loader');
initialLoader.classList.remove('initialLoader');
let url = "/livechat/updateLead/"+rvWebsiteIdDev;
let data = `VisitorId=${VisitorId}&Visitor_Chat_Id=${Visitor_Chat_Id_DEV}&Conversation_Id=${Conversation_Id}&email=${email}`;
let res = await RVBotViewDev.rvXmlRequest(url, data);
if (res.status == true) {
let initialLoader = widgetContentFrameDEV.body.querySelector('.loader');
initialLoader.classList.remove('loader');
rvSetCookies(31, "rv_email", res.email);
RV_Customer_Email_DEV = res.email;
if (rvGetCookies("customer_id") == "" || rvGetCookies("customer_id") == null) {
rvSetCookies(31, "customer_id", res.Visitor_Chat_Id);
rvSetCookies(31, "conversation_id", res.Conversation_Id);
rvSetCookies(31, "project_id", res.Website_Id);
Visitor_Chat_Id_DEV = res.Visitor_Chat_Id;
Conversation_Id = res.Conversation_Id;
Website_Id_DEV = res.Website_Id;
socketDEV.emit("new_user",{
Website_Id: res.Website_Id,
Visitor_Chat_Id: res.Visitor_Chat_Id,
}
);
}
let emailDom = widgetContentFrameDEV.body.querySelector('#email');
emailDom.parentNode.parentNode.innerHTML = email;
let emailMsg = `
`
RV_CONVERSATION += emailMsg;
RVBotViewDev.removeTyping();
RVBotViewDev.rvSendMessage(encodeURIComponent(emailMsg), "", "user");
socketDEV.emit( "online", { Conversation_Id: Conversation_Id, Website_Id: Website_Id_DEV });
RVBotViewDev.rvCollectNameInformation();
}
},
updateNameLead: async function(name){
let initialLoader = widgetContentFrameDEV.body.querySelector('.initialLoader');
initialLoader.classList.add('loader');
initialLoader.classList.remove('initialLoader');
let url = "/livechat/updateLead/"+rvWebsiteIdDev;
let data = `VisitorId=${rvGetCookies("VisitorId")}&Visitor_Chat_Id=${Visitor_Chat_Id_DEV}&Conversation_Id=${Conversation_Id}&name=${name}`;
let res = await RVBotViewDev.rvXmlRequest(url, data);
if (res.status == true) {
let initialLoader = widgetContentFrameDEV.body.querySelector('.loader');
initialLoader.classList.remove('loader');
rvSetCookies(31, "rv_name", name);
RV_Customer_Name_DEV = name;
if (rvGetCookies("customer_id") == "" || rvGetCookies("customer_id") == null) {
rvSetCookies(31, "customer_id", res.Visitor_Chat_Id);
rvSetCookies(31, "conversation_id", res.Conversation_Id);
rvSetCookies(31, "project_id", res.Website_Id);
Visitor_Chat_Id_DEV = res.Visitor_Chat_Id;
Conversation_Id = res.Conversation_Id;
Website_Id_DEV = res.Website_Id;
socketDEV.emit("new_user",{
Website_Id: res.Website_Id,
Visitor_Chat_Id: res.Visitor_Chat_Id,
}
);
}
let nameDom = widgetContentFrameDEV.body.querySelector('#name');
nameDom.parentNode.parentNode.innerHTML = name;
let nameMsg = `
`
RV_CONVERSATION += nameMsg;
RVBotViewDev.removeTyping();
RVBotViewDev.rvSendMessage(encodeURIComponent(nameMsg), "", "user");
socketDEV.emit( "online", { Conversation_Id: Conversation_Id, Website_Id: Website_Id_DEV });
RVBotViewDev.rvCollectMessage();
}
},
rvCustomerOption: async function(e){
let value = e.target.dataset.value
var rvMessage = `
` + RV_Customer_Name_DEV + `, ` + RVBotViewDev.rvGetCurrentTime() + `
` + value + `
`;
e.target.parentNode.parentNode.innerHTML = rvMessage;
RV_EXISTING_CUSTOMER = value;
rvSetCookies(31, "rv_existing_customer", value);
RV_MSG_BODY_HEIGHT_DEV.insertAdjacentHTML("beforebegin", typingLoader);
await RVBotViewDev.rvSendMessage( value, "", "user");
RVBotViewDev.removeTyping();
RVBotViewDev.rvResetMsgScroll();
if( !rvGetCookies("rv_email") ) {
RVBotViewDev.rvCollectEmailInformation();
}else if( !rvGetCookies("rv_name") ) {
RVBotViewDev.rvCollectNameInformation();
}else{
RVBotViewDev.rvCollectMessage();
}
},
removeTyping: function() {
var typingLoaderDom = widgetContentFrameDEV.getElementById("typingLoader");
if (typingLoaderDom) {
typingLoaderDom.remove();
}
},
rvGetCurrentTime: function( argDate = "") {
var date;
if( argDate === "" ){
date = new Date();
}else{
date = new Date(argDate);
}
var hours = date.getHours();
var minutes = date.getMinutes();
var ampm = hours >= 12 ? "PM" : "AM";
hours = hours % 12;
hours = hours ? hours : 12; // the hour '0' should be '12'
minutes = minutes < 10 ? "0" + minutes : minutes;
var strTime = hours + ":" + minutes + " " + ampm;
return strTime;
},
rvConvertDateTime: function (val){
const isoDate = new Date().toISOString();
const today = new Date(isoDate.substring(0, isoDate.length - 5 ));
const endDate = new Date(val);
const days = parseInt(Math.abs(endDate.getTime() - today.getTime()) / (1000 * 60 * 60 * 24));
const hours = parseInt(Math.abs(endDate.getTime() - today.getTime()) / (1000 * 60 * 60) % 24);
const minutes = parseInt(Math.abs(endDate.getTime() - today.getTime()) / (1000 * 60) % 60);
const seconds = parseInt(Math.abs(endDate.getTime() - today.getTime()) / (1000) % 60);
let date = "";
if (days > 0) {
date = days + " days ago";
} else if (hours > 0) {
date = hours + " hours ago";
} else if (minutes > 0) {
date = minutes + " minutes ago";
} else if (seconds > 0) {
date = seconds + " seconds ago";
}
return date;
},
rvEcUserNotify: async function(){
let url = "/livechat/updateUserNotify";
let data = "Visitor_Chat_Id=" + Visitor_Chat_Id + "&Website_Id=" + Website_Id_DEV;
let res = await RVBotViewDev.rvXmlRequest(url, data);
if (res.status == true) {
msgRead_DEV = false
}
},
rvStripHtml: function(html){
let tmp = document.createElement("DIV");
tmp.innerHTML = html;
return tmp.textContent || tmp.innerText || "";
},
}
function rotateRvEcSlide(currentElement, index){
let parentNode = currentElement.parentNode;
let slideIndex = parentNode.getElementsByClassName('slideIndex')[0] ? parseInt(parentNode.getElementsByClassName('slideIndex')[0].value) : 1;
let currentSlideIndex = slideIndex + index
let currentSlideInner = parentNode.getElementsByClassName('rvecGalleryInnerContainer')[0];
let slides = currentSlideInner.children;
if (currentSlideIndex > slides.length) {currentSlideIndex = 1}
if (currentSlideIndex < 1) {currentSlideIndex = slides.length}
for (let i = 0; i < slides.length; i++) {
slides[i].style.display = "none";
}
slides[currentSlideIndex-1].style.display = "block";
if(parentNode.getElementsByClassName('slideIndex')[0]){
parentNode.getElementsByClassName('slideIndex')[0].value = currentSlideIndex
}
}
function rvGetCookies(name){
var rvCookieValue = null,
setcookies = document.cookie,
splitArr = setcookies.split(";");
for (var i = 0; i < splitArr.length; i++) {
var t = splitArr[i].split("=");
if (t.length && t.length >= 2) {
var k = t[0].trim(),
v = t[1].trim();
cookiePrefix+name == k && (rvCookieValue = v);
}
}
return rvCookieValue;
}
function rvSetCookies(rvDays, rvCookieName, rvCookieValue) {
var d = new Date();
d.setTime(d.getTime() + rvDays * 24 * 60 * 60 * 1000);
var expires = "expires=" + d.toUTCString();
document.cookie = cookiePrefix+rvCookieName + "=" + rvCookieValue + ";" + expires;
}
function rvDeleteCookies(name) {
document.cookie = name +'=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;';
}
function rvValidateEmail(email) {
var re = /^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(?!test)(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
return re.test(email);
}
function rvValidatePhone(phone) {
var ph = /^[(]{0,1}[0-9]{3}[)]{0,1}[-\s\.]{0,1}[0-9]{3}[-\s\.]{0,1}[0-9]{4}$/;
return ph.test(phone);
}
window.addEventListener("load", function(){
RVBotViewDev.init();
});