function launch_chaty(e=""){if(void 0!==e&&""!==e){if(document.getElementsByClassName("csaas-outer-forms.active").length&&document.querySelectorAll(".csaas-outer-forms.active").forEach((function(e,t){e.classList.remove("active")})),document.getElementsByClassName("csaas").length&&document.querySelectorAll(".csaas.form-open").forEach((function(e,t){e.classList.remove("form-open")})),document.getElementById(`csaas-${e}`)){let t=document.getElementById(`csaas-${e}`);t.classList.contains("has-single")||t.classList.add("csaas-open")}}else document.getElementsByClassName("csaas-widget").length&&document.querySelectorAll(".csaas-widget:not(.has-single)").forEach((function(e,t){e.classList.add("csaas-open")}))}function close_chaty(){document.getElementsByClassName("csaas-outer-forms").length&&document.querySelectorAll(".csaas-outer-forms.active").forEach((function(e,t){e.classList.remove("active")})),document.getElementsByClassName("csaas").length&&document.querySelectorAll(".csaas.form-open").forEach((function(e,t){e.classList.remove("form-open")})),document.getElementsByClassName("csaas-widget").length&&document.querySelectorAll(".csaas-widget.csaas-open").forEach((function(e,t){e.classList.remove("csaas-open")}))}(()=>{"use strict";let e,t,a,s=new Object,n="pixel-chaty",i=[],c="",o=!1,l=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0,4))?1:0,r="",d=document.title,h=["System Stack","Arial","Tahoma","Verdana","Helvetica","Times New Roman","Trebuchet MS","Georgia"],g=!1;e="https://prod-api.chaty.app/api/pixel/",t="https://cdn.chaty.app/";let u=e+"widgets",p=function(){let e=0;return"object"==typeof Ecwid&&(e=Ecwid.getOwnerId()),e},m=function(e){e+="=";let t=document.cookie.split(";");for(let a=0;a0)for(var n=0;n=1}return!0},w=function(e,t,a){let s=new Date;s.setTime(s.getTime()+24*a*60*60*1e3);let n="expires="+s.toUTCString();document.cookie=e+"="+t+"; "+n+"; path=/; SameSite=Lax"},v=function(e,t){var a=m("cSaasWidget_"+e),s=[];null!=a&&""!=a&&(s=JSON.parse(a));var n=!1;if(s.length>0)for(var i=0;i")}function q(e){let t=document.createElement("link");t.rel="stylesheet",t.href=`https://fonts.googleapis.com/css2?family=${e}&display=swap`,document.getElementsByTagName("head")[0].appendChild(t)}function H(e){if(!document.getElementById("csaas-custom-css")){let e=document.getElementsByTagName("head")[0],t=document.createElement("style");t.id="csaas-custom-css",e.appendChild(t)}document.getElementById("csaas-custom-css").innerHTML+=e}let B=function(e,t){if(!document.getElementById(e)){const a=document.createElement("div");a.id=e,a.innerHTML=t,document.body.appendChild(a)}};function j(e,t){for(e=e.trim();e.charAt(0)==t;)e=e.substring(1);for(;e.charAt(e.length-1)==t;)e=e.substring(0,e.length-1);return e}function F(e){return(e=(e=(e=j(e,"+")).replace(/ /g,"")).replace(/-/g,"")).replace(/_/g,"")}function O(e){return e.replace(/./gm,(function(e){return e.match(/[a-z0-9\s]+/i)?e:"&#"+e.charCodeAt(0)+";"}))}function P(e){document.getElementsByTagName("body")[0]&&document.getElementsByTagName("body")[0].classList.add(e)}function N(e){document.getElementsByTagName("body")[0]&&document.getElementsByTagName("body")[0].classList.remove(e)}function z(){P("has--not--chatway"),N("csaas-has-chatway"),N("has--chaty")}let U,R=e+"widgets/views",D=e+"widgets/visitors",W=function(e){return"custom"==e.position?e.custom_position:e.position},X=function(e){return"vertical"!=e.settings.icon_view?"top":"right"==W(e.settings)?"left":"right"};function Z(e){let t=A(e),a=E(e);if(!t||!a)return;t.classList.add("active");let s=function(e){let t=[],a=A(e);return a?(a.querySelectorAll(".csaas-link").forEach((function(e,a){let s=e.getAttribute("data-channel");b(s)||t.push(s)})),t):t}(e);t.querySelectorAll(".csaas-default-open").forEach((function(s,n){let i=s.getAttribute("data-channel");if("WhatsApp"==i&&f(e,"c-"+i)){let s=`csaas-form-${e}-${i}`,n=`channel-${i}-${e}`;if(M(s)&&M(n)){let n=M(s);n.classList.add("is-active"),n&&(a=E(e),a.classList.remove("csaas-open"),t.classList.add("active"),t.classList.add("form-open"),n.classList.add("active"))}}}));var n=f(e,"v-widget");const c=V();if(n&&!c){v(e,"v-widget");let c=t.getAttribute("data-user"),o=0,r=0,d=t.getAttribute("data-key"),h="";if(null!=typeof i[d]){let t=m("activeCsaasWidgets");null!=t||(t=e,w("activeCsaasWidgets",t,1))}if(a.classList.contains("has-single")?(o=1,s.forEach((function(t,a){f(e,"v-"+t)&&void 0!==t&&(v(e,"v-"+t),h+=`&channels[]=${t}`)}))):a.classList.contains("csaas-open")&&(r=1,s.forEach((function(t,a){f(e,"v-"+t)&&void 0!==t&&(v(e,"v-"+t),h+=`&channels[]=${t}`)}))),n){let t={widgetId:e,userId:c,isMobile:l,isOpen:r,isSingle:o};t=x(t)+h;let a=new XMLHttpRequest;a.open("POST",R,!0),a.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),a.onreadystatechange=function(){},a.send(t)}!function(e){let t=A(e),a=V();if(!t)return;let s=t.getAttribute("data-user");if(!_("triggeredFor"+s)&&!a){w("triggeredFor"+s,e,30);let t={widgetId:e,channels:[],userId:s};t=x(t);let a=new XMLHttpRequest;a.open("POST",D,!0),a.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),a.onreadystatechange=function(){},a.send(t)}}(e)}}let Y=function(){let e="";return"object"==typeof Shopify&&(e=Shopify.shop),e};function V(){return void 0!==window.Shopify&&void 0!==window.Shopify.designMode&&window.Shopify.designMode}let J,G=!1,K=0,Q=!1,ee=!1,te=[],ae=0,se=0;function ne(){ee&&document.getElementsByClassName(".on-csaas-exit-intent")&&document.querySelectorAll(".on-csaas-exit-intent").forEach((function(e,t){e.classList.remove("on-csaas-exit-intent"),ie(e.getAttribute("data-id"))}))}function ie(e){let t=A(e);t&&(Z(e),t.classList.remove("on-csaas-delay"),t.classList.remove("on-csaas-exit-intent"),t.classList.remove("on-csaas-scroll"),document.getElementsByClassName(".csaas.on-csaas-delay")||(clearInterval(J),G=!1),document.getElementsByClassName(".csaas.on-csaas-exit-intent")||(ee=!1),document.getElementsByClassName(".csaas.on-csaas-scroll")||(Q=!1))}let ce=function(e){for(e=e.toString();e.length<2;)e="0"+e;return e};function oe(e,t){if(isNaN(t)){let a=new Date(e.toLocaleString("en-US",{timeZone:t})),s=e.getTime()-a.getTime();return new Date(e.getTime()-s)}{let a=new Date;if(a=a.toLocaleString("en-US",{timeZone:"UTC"}),a=new Date(a),-1!=t.indexOf("+")){let e=t.replace("+",""),s=parseInt(e),n=60*parseFloat(e%s);n=a.getUTCMinutes()+n,n>59&&(s+=parseInt(n/60),n%=60),a.setUTCHours(a.getUTCHours()+s,n)}else if(-1!=t.indexOf("-")){let e=t.replace("-",""),s=parseInt(e),n=60*parseFloat(e%s);n=a.getUTCMinutes()-n,n<0&&(s-=parseInt(n/60),n%=60),a.setUTCHours(a.getUTCHours()-s,-n)}let s=e.getTime()-a.getTime();return new Date(e.getTime()-s)}}function le(e){return Object.keys(e).filter((t=>e[t])).join(" ")}let re=function(e){return!o&&y(e.is_agent)&&(e.is_agent=!1,e.agents.length&&!e.value&&(e.value=e.agents[0].value,e.channel_account_type=e.agents[0].channel_account_type,e.custom_image_url=e.agents[0].custom_image_url,e.icon_color=e.agents[0].icon_color,e.is_desktop=e.is_agent_desktop,e.is_mobile=e.is_agent_mobile,(e=ue(e)).agents=[])),e},de=e+"widgets/channel/click";function he(e,a,s,n,i,c){let o="",r="";if(y(e.is_agent))e.url="javascript:;",e.target="",o+=" csaas-agent-button ";else{if("Contact_Us"==e.channel_type)!function(e,a,s){let n="",i=Ee();n+="",B(`csaas-element-${e.channel_type}-${a}`,n),S("csaas-form-title-"+a)&&(M("csaas-form-title-"+a).innerHTML=O(e.contact_form.title));let c,o=M("csaas-form-data-"+a);Object.keys(e.contact_form.form_fields).forEach((function(t,s){if(c="",(s=e.contact_form.form_fields[t]).is_active){let e="";if("name"==t?(e="Name",b(s.field_title)||(e=O(s.field_title)),c="",c+=""):"email"==t?(e="Email",b(s.field_title)||(e=O(s.field_title)),c="",c+=""):"phone"==t?(e="Phone",b(s.field_title)||(e=O(s.field_title)),c="",c+=""):"message"==t&&(e="Message",b(s.field_title)||(e=O(s.field_title)),c="",c+=""),!b(c)){o.innerHTML+="
"+c+"
";let e=M("csaas-input-"+t+"-"+a);e.setAttribute("placeholder",s.value),e.setAttribute("dir",I(s.value)),s.is_required&&(e.classList.add("is-required"),e.setAttribute("required",!0))}}}));let l="";o.innerHTML+="
",l+="#csaas-form-"+a+"-"+e.channel_type+" .csaas-form-button {background:"+e.contact_form.submit_btn_bg_color+"}",l+="#csaas-form-"+a+"-"+e.channel_type+" .csaas-another-form-button {background: "+e.contact_form.submit_btn_bg_color+"}",l+="#csaas-form-"+a+"-"+e.channel_type+" .csaas-contact-form-title {background-color: "+e.contact_form.submit_btn_bg_color+"}",l+="#csaas-form-"+a+"-"+e.channel_type+" input:focus {border-color:"+e.contact_form.submit_btn_bg_color+"}",l+="#csaas-form-"+a+"-"+e.channel_type+" textarea:focus {border-color:"+e.contact_form.submit_btn_bg_color+"}",l+="#csaas-form-"+a+"-"+e.channel_type+" .csaas-form-button {color: "+e.contact_form.submit_btn_txt_color+"}",b(l)||H(l)}(e,n,i),e.url="javascript:;",e.target="",o+=" has-csaas-box csaas-contact-form-button";else if("WhatsApp"==e.channel_type)if(y(e.has_welcome_message))e.url="javascript:;",e.target="",o+=" has-csaas-box csaas-whatsapp-form-button",function(e,a,s){e.value=e.value.replace(/ /g,"");let n="https://web.whatsapp.com/send",i="";l?n="https://api.whatsapp.com/send":(n=y(e.is_use_web_version)?"https://web.whatsapp.com/send":"https://api.whatsapp.com/send",i="_blank");const c=e.heading?e.heading:"",o=`\n
\n \n
${c}
\n
\n \n
\n
\n `,r=b(e.chat_welcome_message)?"":`\n ${e.chat_welcome_message}\n `,d=b(e.profile_name)?"":`\n ${O(e.profile_name)}\n `,h=b(e.profile_image_url)?"":`\n ${e.title}\n `,g={"csaas-whatsapp-body":!0,"has-header":!b(e.heading)},u={"csaas-whatsapp-message":!0,"has-profile-image":!b(e.profile_image_url),"hide-whatsapp-message":b(e.profile_image_url)&&b(e.chat_welcome_message)&&b(e.profile_name)},p=b(r)?`
`:`\n
\n ${h}\n
\n ${d}\n ${r}\n ${function(){const e=new Date;return`${e.getHours().toString().padStart(2,"0")}:${e.getMinutes().toString().padStart(2,"0")}`}()}\n
\n
`,m=b(e.wa_placeholder_text)?"":e.wa_placeholder_text,f=(w=[o,p,`\n \n `],`\n \n `);var w;if(B(`csaas-element-${e.channel_type}-${a}`,f),!b(e.pre_set_message)){let t=e.pre_set_message,s=document.title;if(b(s)?(t=t.replace(/{title}/g,""),t=t.replace(/(title)/g,"")):(t=t.replace(/{title}/g,s),t=t.replace(/(title)/g,s)),t=t.replace(/{url}/g,window.location),t=t.replace(/(url)/g,window.location),t=t.replace(/{URL}/g,window.location),t=t.replace(/(URL)/g,window.location),S(`csass-whatsapp-input-${a}`)){let e=M(`csass-whatsapp-input-${a}`);e.value=t,e.setAttribute("dir",I(t))}}}(e,n,i);else{e.value=e.value.replace(/ /g,"");let t="";if(!b(e.pre_set_message)){t=decodeURI(e.pre_set_message);let a=document.title;b(a)?(t=t.replace(/{title}/g,""),t=t.replace(/(title)/g,"")):(t=t.replace(/{title}/g,a),t=t.replace(/(title)/g,a)),t=t.replace(/{url}/g,window.location),t=t.replace(/{URL}/g,window.location),t=t.replace(/(URL)/g,window.location),t=t.replace(/(url)/g,window.location),t=encodeURIComponent(t)}l?e.url=""!=t?"https://api.whatsapp.com/send/?phone="+e.value+"&text="+t:"https://api.whatsapp.com/send/?phone="+e.value:""!=t?y(e.is_use_web_version)&&!l?(e.target="_blank",e.url="https://web.whatsapp.com/send?phone="+e.value+"&text="+t):e.url="https://api.whatsapp.com/send/?phone="+e.value+"&text="+t:y(e.is_use_web_version)&&!l?(e.target="_blank",e.url="https://web.whatsapp.com/send?phone="+e.value):e.url="https://api.whatsapp.com/send/?phone="+e.value}else if("WeChat"==e.channel_type)b(e.qr_code_image_url)||(function(e,t,a){let s="";s+="",B(`csaas-element-${e.channel_type}-${t}`,s)}(e,n,i),e.url="javascript:;",e.target="",o+=" has-csaas-box csaas-qr-code-form");else if("Email"==e.channel_type){if(!b(e.mail_subject)){let t=decodeURI(e.mail_subject),a=document.title;b(a)?(t=t.replace(/{title}/g,""),t=t.replace(/(title)/g,"")):(t=t.replace(/{title}/g,a),t=t.replace(/(title)/g,a)),t=t.replace(/{url}/g,window.location),t=t.replace(/{URL}/g,window.location),t=t.replace(/(url)/g,window.location),t=t.replace(/(URL)/g,window.location),t=encodeURIComponent(t),e.url+="?subject="+t}}else if("Viber"==e.channel_type&&l){let t=e.value;t=t.replace("+",""),navigator.userAgent.match(/(iPod|iPhone|iPad)/)&&(t="+"+t),t="viber://chat?number="+t,e.url=t}b(e.click_event)||(r="",e.target="",e.url=e.click_event)}let d=e.hover_text;return b(e.hover_text)&&(d=e.channel),y(c.is_google_analytics_enabled)&&(o+=" has-gae"),b(e.hover_text)&&(e.hover_text=""),''+a+''+O(d)+""}function ge(e){if(""!=e.custom_image_url&&"null"!=e.custom_image_url&&!b(e.custom_image_url))return"";let t=e.svg_icon;return"Chatway"==e.channel&&(t=function(e){switch(e){case"icon_2":return' ';case"icon_3":return'';case"icon_4":return' '}return' '}(e.chatway_icon)),""}let ue=function(e){let t=e.value,a="_blank";return"WhatsApp"==e.channel_type?t=F(e.value):"WeChat"==e.channel_type?(a="",t="javascript:;"):"Email"==e.channel_type?(a="",t="mailto:"+e.value):"Facebook_Messenger"==e.channel_type?a=l?"":"_blank":"SMS"==e.channel_type?(a="",t="sms:+"+F(e.value.trim())):"Telegram"==e.channel_type?(t=j(e.value,"@"),t="https://telegram.me/"+t,a="_blank"):"Twitter"==e.channel_type?t="https://twitter.com/"+e.value.trim:"Instagram"==e.channel_type||"Instagram_DM"==e.channel_type?(t="https://www.instagram.com/"+e.value.trim,t="https://ig.me/m/"+e.value.trim):"Phone"==e.channel_type?(a="",t="tel:+"+F(e.value.trim())):"Skype"==e.channel_type?(a="",t="skype:"+e.value.trim+"?chat"):"Snapchat"==e.channel_type?t="https://www.snapchat.com/add/"+e.value.trim:"Vkontakte"==e.channel_type?t="https://vk.me/"+e.value.trim:"Linkedin"==e.channel_type?t="personal"==e.channel_account_type?"https://www.linkedin.com/in/"+e.value.trim:"https://www.linkedin.com/company/"+e.value.trim:"Viber"==e.channel_type?(t=F(e.value.trim()),isNaN(t)||(t=t.replace("+",""),navigator.userAgent.match(/(iPod|iPhone|iPad)/)&&(t="+"+t),t="viber://chat?number="+t),a=""):"TikTok"==e.channel_type&&(t=j(e.value.trim,"@"),t="https://www.tiktok.com/@"+t,a=""),e.value=t,e.url=t,e.target=a,e},pe=function(e){if(y(e.is_agent)){if(e.agents.length&&(!l&&y(e.is_agent_desktop)||l&&y(e.is_agent_mobile))){let t=!1;return Object.keys(e.agents).forEach((function(a,s){b(e.agents[s].value)||(t=!0)})),t}}else if((!l&&y(e.is_desktop)||l&&y(e.is_mobile))&&(""!=e.value||"Contact_Us"==e.channel||"Chatway"==e.channel))return!0;return!1},me=function(e,t,a,s,n){if(T(e.channel_type)&&(e.channel_type=e.channel),!pe(e))return;let i="";if(!y(e.is_agent)){let c=ge(e),o=he(e,c,a,t,s,n);return"Contact_Us"==e.channel_type?i+=" has-csaas-box":"WhatsApp"==e.channel_type&&y(e.is_default_open)&&f(t,"c-"+e.channel_type)&&(i+=" csaas-default-open"),"
"+o+"
"}if(e.agents.length){let o=0,r=[];if(Object.keys(e.agents).forEach((function(t,a){""!=e.agents[a].value&&(o++,r=t)})),o>0){let o,r;return function(e,t){var a="",s=0;null==s&&(s=-1),a+="",b(e.agent_head_bg_color)||(c+=".csaas-agent-header.agent-info-"+t+"-"+e.channel+" { background-color: "+e.agent_head_bg_color+"; } "),b(e.agent_head_text_color)||(c+=".csaas-agent-header.agent-info-"+t+"-"+e.channel+" { color: "+e.agent_head_text_color+" } ",c+="#csaas-form-"+t+"-"+e.channel+" .csaas-close-agent-list svg { fill: "+e.agent_head_text_color+" } "),B(`csaas-element-${e.channel_type}-${t}`,a)}(e,t),o=ge(e),r=he(e,o,a,t,s,n),("Instagram"!=e.channel&&"Instagram_DM"!=e.channel||"#ffffff"!=e.icon_color&&"#fff"!=e.icon_color)&&(c+=".csaas-agent-"+t+"-"+e.channel+" .color-element {fill: "+e.icon_color+"; color: "+e.icon_color+";}"),c+=".csaas-agent-"+t+"-"+e.channel+" .csaas-custom-icon { background-color: "+e.icon_color+";}",c+=".csaas-agent-"+t+"-"+e.channel+" .csaas-svg-img { background-color: "+e.icon_color+";}","
"+r+"
"}}};function fe(e,t){if(!b(t)&&S(t)){let e=M(t),a=e.getAttribute("data-widget"),s=A(a),n=E(a);if(e.classList.contains("active"))e.classList.remove("active"),s.classList.remove("form-open");else{e.classList.add("is-active"),s.classList.add("form-open"),n.classList.remove("csaas-open");let t=document.getElementById("cta-close-"+e.getAttribute("data-widget")).innerHTML;S("cta-btn-"+a)&&(M("cta-btn-"+a).innerHTML=t),e.classList.add("active")}}}let we=e+"widgets/click",ve=e+"widgets/leads";function _e(e){let t=f(e,"c-widget"),a=V(),s=A(e),n=E(e);if(t&&s&&n&&!a){let a=A(e).getAttribute("data-user"),s="",i=n.classList.contains("has-single")?1:0;n.querySelectorAll(".csaas-link").forEach((function(a,n){let c=a.getAttribute("data-channel");if(!b(c)){let a=f(e,"v-"+c);b(c)||(a&&v(e,"v-"+c),i&&(t=f(e,"c-"+c),t&&v(e,"c-"+c)),s="&channels[]="+c)}})),v(e,"c-widget");let c={widgetId:e,userId:a,isMobile:l,isSingle:i};c=x(c)+s;let o=new XMLHttpRequest;o.open("POST",we,!0),o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.onreadystatechange=function(){},o.send(c)}}let ye,be=function(e){let t=A(e);if(t){let a=t.getAttribute("data-animation"),s=M("csaas-i-trigger-"+e);s&&s.querySelectorAll(".csaas-channel .csaas-svg").forEach((function(e,t){e.classList.remove("chaty-animation-"+a)})),S("chaty-cta-"+e)&&document.getElementById("chaty-cta-"+e).classList.remove("chaty-animation-"+a),s.querySelectorAll(".ch-pending-msg").forEach((function(e,t){e.remove()}))}},xe=function(){let e=0;i.length&&(k(),Object.keys(i).forEach((function(t){let a=i[t],s=function(e){if(y(e.triggers.has_countries)&&!b(e.triggers.countries)&&e.triggers.countries.length){let t=ke();if("-"!=t&&!e.triggers.countries.includes(t))return!1}return!0}(a);s=s&&function(e){if(e.triggers.has_date_scheduling_rules){let t=e.triggers.date_scheduling_rules.start_date_time,a=e.triggers.date_scheduling_rules.end_date_time,s=new Date;s=oe(s,e.triggers.time_diff);let n=s.getFullYear()+"-"+ce(s.getMonth()+1)+"-"+ce(s.getDate())+" "+ce(s.getHours())+":"+ce(s.getMinutes())+":"+ce(s.getSeconds());return""==a&&t<=n||""==t&&a>=n||""!=t&&""!=a&&t<=n&&a>=n}return!0}(a),s=s&&function(e){let t=!0;if(y(e.triggers.has_day_hours_scheduling_rules)&&e.triggers.day_hours_scheduling_rules.length>0){let a=e.triggers.day_hours_scheduling_rules;if(a.length>0){t=!1;let s=new Date;s=oe(s,e.triggers.day_time_diff);let n=s.getHours(),i=s.getMinutes(),c=s.getDay();for(let e=0;e=0&&a[e].days<=6?a[e].days==c&&(l=1):7==a[e].days?c>=0&&c<=4&&(l=1):8==a[e].days?c>=1&&c<=5&&(l=1):9==a[e].days&&(5!=c&&6!=c||(l=1)),1==l&&(n>a[e].start_hours&&n=a[e].start_min&&(s=1):n>a[e].start_hours&&n==a[e].end_hours?i<=a[e].end_min&&(s=1):n==a[e].start_hours&&n==a[e].end_hours&&i>=a[e].start_min&&i<=a[e].end_min&&(s=1),1==s&&a[e].start_hours=a[e].start_min||i<=a[e].end_min)&&(o=1):1==s&&i>=a[e].start_min&&i<=a[e].end_min&&(o=1)),1==s&&1==o&&1==l){t=1;break}}}}return t}(a),s&&(e++,function(e,t){let a=[],s=0,n=null,i=0,r=null;Object.keys(e.channels).forEach((function(t){let c=e.channels[t];pe(c)&&("Chatway"===c.channel?(r=c.chatway_position,g=1,"outside-chaty"!==r&&(n=re(c),"inside-chaty"!==r&&"chat-view"!==e.settings.cta_type||(a.push(re(c)),s++),i=1)):(a.push(re(c)),s++))})),1!==s||!i||"above-chaty"===r&&"chat-view"!==e.settings.cta_type||(s=0);let d="";if(i&&(P("csaas-has-chatway"),d="has-chatway-channel"),e.channels=a,o||(e.settings.cta_type="simple-view"),s&&!A(e.id)){L();let a=W(e.settings);if(a="right"==a?"right":"left","chat-view"==e.settings.cta_type){let s="";C(s),e.settings.icon_view="vertical",function(e){let t=e.id,a=e.id,s=$(e.settings.cta_body_text),n=e.settings.cta_heading_text,i=document.title;b(i)?(s=s.replace(/{title}/g,""),n=n.replace(/{title}/g,""),s=s.replace(/(title)/g,""),n=n.replace(/(title)/g,"")):(s=s.replace(/{title}/g,i),n=n.replace(/{title}/g,i),s=s.replace(/(title)/g,i),n=n.replace(/(title)/g,i)),s=s.replace(/{url}/g,""+window.location.href+""),s=s.replace(/(url)/g,""+window.location.href+""),n=n.replace(/{url}/g,""+window.location.href+""),n=n.replace(/(url)/g,""+window.location.href+"");let c="";c+="",A(t).innerHTML+=c}(e)}else{let s="";C(s)}let o=f(e.id,"v-widget"),g=A(e.id),p=E(e.id);if(i&&p.classList.add(r),i&&"above-chaty"===r){p.classList.add("has-chatway");let a=X(e),s=me(n,e.id,a,t,e.settings);M("csaas-channels-"+e.id)&&(document.getElementById("csaas-channels-"+e.id).innerHTML+=s,c+="#csaas-widget-"+e.id+" ."+n.channel_type+"-channel .color-element{ fill: "+n.icon_color+"; color: "+n.icon_color+";}",c+="#csaas-widget-"+e.id+" ."+n.channel_type+"-channel .csaas-svg { background-color: "+n.icon_color+";}",c+=".channel-"+e.id+"-"+n.channel_type+" .csaas-svg { background-color: "+n.icon_color+";}")}1==e.channels.length&&"chat-view"!=e.settings.cta_type?function(e,t){let a=W(e.settings),s=e.settings;a="right"==a?"right":"left";let n=X(e);if("vertical"!=e.settings.icon_view&&(n="right"!=a?"right":"left"),M("csaas-i-trigger-"+e.id)){let a=M("csaas-i-trigger-"+e.id),i=e.channels[0],o=me(i,e.id,n,t,s);a.innerHTML+=o,a.classList.add("single-channel"),M("csaas-"+e.id)&&M("csaas-"+e.id).classList.add("has-single");let l=$(e.settings.cta_text);a.querySelectorAll(".csaas-tooltip").forEach((function(e,t){e.classList.remove("csaas-tooltip")}));let r=f(e.id,"c-widget");a.querySelectorAll(".csaas-channel a").forEach((function(t,a){if(t.classList.add("csaas-tooltip"),t.classList.add("pos-"+n),r||"all_time"==e.settings.show_cta){t.classList.add("active");let a=`${l}`;t.innerHTML+=a,t.classList.add("has-on-hover"),t.classList.add(e.settings.show_cta),t.setAttribute("data-text",l)}b(i.hover_text)||t.setAttribute("data-hover",i.hover_text)}));let d='
';b(e.settings.close_text)&&(d='
'),a.innerHTML+=d,c+="#csaas-widget-"+e.id+" ."+i.channel_type+"-channel .color-element{ fill: "+i.icon_color+"; color: "+i.icon_color+";}",c+="#csaas-widget-"+e.id+" ."+i.channel_type+"-channel .csaas-svg { background-color: "+i.icon_color+";}",c+=".channel-"+e.id+"-"+i.channel_type+" .csaas-svg { background-color: "+i.icon_color+";}"}}(e,t):function(e,t){let a=W(e.settings),s=e.settings;a="right"==a?"right":"left";let n=X(e),i="";Object.keys(e.channels).forEach((function(a){let o=e.channels[a];T(o.channel_type)&&(o.channel_type=o.channel),"chat-view"==e.settings.cta_type?i+=me(o,e.id,"top",t,s):i+=me(o,e.id,n,t,s),c+=".channel-"+e.id+"-"+o.channel_type+" .color-element{ fill: "+o.icon_color+"; color: "+o.icon_color+";}",c+="#csaas-widget-"+e.id+" ."+o.channel_type+"-channel .color-element{ fill: "+o.icon_color+"; color: "+o.icon_color+";}",c+="#csaas-widget-"+e.id+" ."+o.channel_type+"-channel .csaas-svg { background-color: "+o.icon_color+";}",c+=".channel-"+e.id+"-"+o.channel_type+" .csaas-svg { background-color: "+o.icon_color+";}",c+="#csaas-widget-"+e.id+" .channel-icon-"+o.channel_type+"-channel .csaas-svg { background-color: "+o.icon_color+";}",c+=".csaas-chat-view-"+e.id+" ."+o.channel_type+"-channel .csaas-custom-icon { background-color: "+o.icon_color+"; }",c+=".csaas-chat-view-"+e.id+" ."+o.channel_type+"-channel .csaas-svg { background-color: "+o.icon_color+";}",c+=".csaas-chat-view-"+e.id+" .channel-icon-"+o.channel_type+" .csaas-svg { background-color: "+o.icon_color+";}"})),b(i)||("chat-view"==e.settings.cta_type?M("csaas-view-channels-"+e.id)&&(document.getElementById("csaas-view-channels-"+e.id).innerHTML+=i):M("csaas-channels-"+e.id)&&(document.getElementById("csaas-channels-"+e.id).innerHTML+=i));let o=f(e.id,"c-widget"),l=function(e){return(""==e.widget_icon||"chat-image"==e.widget_icon&&b(e.widget_icon_url))&&(e.widget_icon="chat-base"),"chat-image"==e.widget_icon?"":'"}(e.settings,e.id),r=e.settings.cta_text;"first_click"==e.settings.show_cta&&(o||(r=""));let d=n;"horizontal"==e.settings.icon_view&&(d="left"==a?"right":"left"),r=$(r),"opened"==e.settings.default_state&&(r="");let h=`
${r}
`,g=`
\n
\n
\n
`;if(b(e.settings.close_text)&&(g=`
\n
\n
\n
`),M("csaas-i-trigger-"+e.id)){let t=M("csaas-i-trigger-"+e.id);t.innerHTML+=h,t.innerHTML+=g}}(e,t);var u=f(e.id,"c-widget");if(!u||"opened"==e.settings.default_state&&1!=s||(function(e,t){let a=f(t,"c-widget"),s=e.settings;if(a&&y(s.is_pending_mesg_enabled)&&parseInt(s.pending_mesg_count)>0){let a=s.attention_effect;if(1==e.channels.length){let e=M("csaas-i-trigger-"+t);e&&("sheen"==a||"spin"==a||"pulse"==a?e.querySelectorAll(".csaas-channel").forEach((function(e,t){e.innerHTML+=`${s.pending_mesg_count}`})):e.querySelectorAll(".csaas-channel .csaas-svg").forEach((function(e,t){e.innerHTML+=`${s.pending_mesg_count}`})))}else"bounce"==a||"waggle"==a||"pulse"==a?M("chaty-cta-"+t)&&(document.getElementById("chaty-cta-"+t).innerHTML+=`${s.pending_mesg_count}`):M("cta-main-"+t)&&(document.getElementById("cta-main-"+t).innerHTML+=`${s.pending_mesg_count}`)}}(e,e.id),function(e,t){if(f(t,"c-widget")&&"none"!=e.settings.attention_effect&&""!=e.settings.attention_effect)if(A(t).setAttribute("data-animation",e.settings.attention_effect),1==e.channels.length){let a=M("csaas-i-trigger-"+t);a&&a.querySelectorAll(".csaas-channel .csaas-svg").forEach((function(t,a){t.classList.add("chaty-animation-"+e.settings.attention_effect)}))}else S("chaty-cta-"+t)&&document.getElementById("chaty-cta-"+t).classList.add("chaty-animation-"+e.settings.attention_effect)}(e,e.id)),"hover"==e.settings.default_state?g.classList.add("open-on-hover"):"opened"==e.settings.default_state&&(p.classList.add("default-open"),!u&&y(e.settings.show_close_button)||p.classList.contains("has-single")||p.classList.add("csaas-open")),p.classList.add("cta-"+e.settings.show_cta),"chat-view"==e.settings.cta_type?g.classList.add("has-chat-view"):g.classList.add("has-simple-view"),"opened"!=e.settings.default_state||y(e.settings.show_close_button)||p.classList.add("cssas-no-close-button"),o?y(e.triggers.has_time_delay)&&0==parseInt(e.triggers.time_delay)||y(e.triggers.has_display_after_page_scroll)&&0==parseInt(e.triggers.display_after_page_scroll)?Z(e.id):y(e.triggers.exit_intent)||y(e.triggers.has_time_delay)&&parseInt(e.triggers.time_delay)>0||y(e.triggers.has_display_after_page_scroll)&&parseInt(e.triggers.display_after_page_scroll)>0?(y(e.triggers.has_time_delay)&&parseInt(e.triggers.time_delay)>0&&(G=!0,parseInt(e.triggers.time_delay)>K&&(K=e.triggers.time_delay),g.classList.add("on-csaas-delay"),g.classList.add("delay-time-"+parseInt(e.triggers.time_delay)),g.setAttribute("data-time",parseInt(e.triggers.time_delay))),y(e.triggers.has_display_after_page_scroll)&&parseInt(e.triggers.display_after_page_scroll)>0&&(Q=!0,g.classList.add("on-csaas-scroll"),g.classList.add("page-scroll-"+parseInt(e.triggers.display_after_page_scroll)),g.setAttribute("data-scroll",parseInt(e.triggers.display_after_page_scroll))),y(e.triggers.exit_intent)&&(l?y(e.triggers.has_time_delay)&&parseInt(e.triggers.time_delay)>0||y(e.triggers.has_display_after_page_scroll)&&parseInt(e.triggers.display_after_page_scroll)>0||Z(e.id):(ee=!0,g.classList.add("on-csaas-exit-intent")))):Z(e.id):Z(e.id),!b(e.settings.font_family)&&"none"!=e.settings.font_family){let t=e.settings.font_family;h.includes(t)?"System Stack"==t&&(t="-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"):q(t),c+="#csaas-widget-"+e.id+", #csaas-widget-"+e.id+" .csaas-tooltip:after {font-family: "+t+"}"}H(c),c="",function(e,t,a){let s="",n=e.channels.length;"above-chaty"==t&&n++;let i=function(e,t){switch(e=e.toLowerCase()){case"s":return 44;case"m":return 60;case"l":return 70;case"xl":return 84;case"xxl":return 94;case"custom":return""==(t=parseInt(t))||0==t?60:t}return 60}(e.settings.widget_size,e.settings.custom_widget_size),c=0,o=document.getElementById("csaas-"+e.id);if("opened"!=e.settings.default_state||y(e.settings.show_close_button)||(o.classList.add("cssas-no-close-button"),c=1),y(e.settings.has_custom_css)&&!b(e.settings.custom_css)&&(s+=e.settings.custom_css),s+="#csaas-widget-"+e.id+" .csaas-channel-list .csaas-channel {width: "+i+"px; height: "+i+"px; }",s+="#csaas-widget-"+e.id+" .csaas-channel-list .csaas-channel > a {width: "+i+"px; height: "+i+"px; }",s+="#csaas-widget-"+e.id+" .csaas-channel-list .csaas-channel > a .csaas-svg {width: "+i+"px; height: "+i+"px; }",s+="#csaas-widget-"+e.id+" .csaas-channel-list .csaas-channel > a img {width: "+i+"px; height: "+i+"px; object-fit: cover;}",s+="#csaas-widget-"+e.id+" .csaas-i-trigger .csaas-cta-button > button {width: "+i+"px; height: "+i+"px; }",s+="#csaas-widget-"+e.id+" .csaas-i-trigger .csaas-cta-button > button .csaas-svg {width: "+i+"px; height: "+i+"px; }",s+="#csaas-widget-"+e.id+" .csaas-i-trigger .csaas-channel img {width: "+i+"px; height: "+i+"px; }",s+="#csaas-widget-"+e.id+" .csaas-i-trigger .csaas-channel a {width: "+i+"px; height: "+i+"px; }",s+="#csaas-widget-"+e.id+" .csaas-i-trigger .csaas-channel a .csaas-svg {width: "+i+"px; height: "+i+"px; }",s+="#csaas-widget-"+e.id+" .csaas-channel-list .csaas-channel button {width: "+i+"px; height: "+i+"px; }",s+="#csaas-widget-"+e.id+" .csaas-channel-list .csaas-channel .csaas-svg {width: "+i+"px; height: "+i+"px; }",s+="#csaas-widget-"+e.id+" .csaas-channel-list .csaas-channel .csaas-svg img {width: "+i+"px; height: "+i+"px; }","vertical"==e.settings.icon_view)if(s+="#csaas-widget-"+e.id+" .csaas-channel-list {height: "+n*(i+8)+"px; }",s+="#csaas-widget-"+e.id+" .csaas-channel-list {width: "+(i+8)+"px; }",a&&"inside-chaty"==t){let t=0,a=1;Object.keys(e.channels).forEach((function(o,l){o=e.channels[l],s+="body.chatway--active #csaas-widget-"+e.id+" .csaas-open .csaas-channel-list .csaas-channel."+o.channel+"-channel-link {-webkit-transform: translateY(-"+(i+8)*(n-t-c)+"px); transform: translateY(-"+(i+8)*(n-t-c)+"px);}","Chatway"!=o.channel?s+="body:not(.chatway--active) #csaas-widget-"+e.id+" .csaas-open .csaas-channel-list .csaas-channel."+o.channel+"-channel-link {-webkit-transform: translateY(-"+(i+8)*(n-t-a-c)+"px); transform: translateY(-"+(i+8)*(n-t-a-c)+"px);}":a=0,t++}))}else{let a=0;for(a=0;a<=n;a++)s+="#csaas-widget-"+e.id+" .csaas-open .csaas-channel-list .csaas-channel:nth-child("+(a+1)+") {-webkit-transform: translateY(-"+(i+8)*(n-a-c)+"px); transform: translateY(-"+(i+8)*(n-a-c)+"px);}";"above-chaty"==t&&(s+="#csaas-widget-"+e.id+" .csaas-channel-list .Chatway-channel-link {-webkit-transform: translateY(-"+(i+8)*c+"px); transform: translateY(-"+(i+8)*(1-c)+"px);}")}else{o.classList.add("hor-mode"),s+="#csaas-widget-"+e.id+" .csaas-channel-list {width: "+n*(i+8)+"px; }",s+="#csaas-widget-"+e.id+" .csaas-channel-list {height: "+i+"px; }";let l=0;if(a&&"inside-chaty"==t){let t=0,a=1;Object.keys(e.channels).forEach((function(o,l){o=e.channels[l],s+="body.chatway--active #csaas-widget-"+e.id+" .csaas-widget.left-position.hor-mode.csaas-open .csaas-channel-list .csaas-channel:nth-child("+(t+1)+") {-webkit-transform: translateX("+(i+8)*(n-t-c)+"px); transform: translateX("+(i+8)*(n-t-c)+"px);}",s+="body.chatway--active #csaas-widget-"+e.id+" .csaas-widget.right-position.hor-mode.csaas-open .csaas-channel-list .csaas-channel:nth-child("+(t+1)+") {-webkit-transform: translateX(-"+(i+8)*(n-t-c)+"px); transform: translateX(-"+(i+8)*(n-t-c)+"px);}","Chatway"!=o.channel?(s+="body:not(.chatway--active) #csaas-widget-"+e.id+" .csaas-widget.left-position.hor-mode.csaas-open .csaas-channel-list .csaas-channel:nth-child("+(t+1)+") {-webkit-transform: translateX("+(i+8)*(n-t-a-c)+"px); transform: translateX("+(i+8)*(n-t-a-c)+"px);}",s+="body:not(.chatway--active) #csaas-widget-"+e.id+" .csaas-widget.right-position.hor-mode.csaas-open .csaas-channel-list .csaas-channel:nth-child("+(t+1)+") {-webkit-transform: translateX(-"+(i+8)*(n-t-a-c)+"px); transform: translateX(-"+(i+8)*(n-t-a-c)+"px);}"):a=0,t++}))}else{for(l=0;l<=n;l++)s+="#csaas-widget-"+e.id+" .csaas-widget.left-position.hor-mode.csaas-open .csaas-channel-list .csaas-channel:nth-child("+(l+1)+") {-webkit-transform: translateX("+(i+8)*(n-l-c)+"px); transform: translateX("+(i+8)*(n-l-c)+"px);}",s+="#csaas-widget-"+e.id+" .csaas-widget.right-position.hor-mode.csaas-open .csaas-channel-list .csaas-channel:nth-child("+(l+1)+") {-webkit-transform: translateX(-"+(i+8)*(n-l-c)+"px); transform: translateX(-"+(i+8)*(n-l-c)+"px);}";"above-chaty"==t&&(s+="#csaas-widget-"+e.id+" .csaas-widget.left-position.hor-mode .csaas-channel-list .Chatway-channel-link {-webkit-transform: translateX("+(i+8)*(1-c)+"px); transform: translateX("+(i+8)*(1-c)+"px);}",s+="#csaas-widget-"+e.id+" .csaas-widget.right-position.hor-mode .csaas-channel-list .Chatway-channel-link {-webkit-transform: translateX(-"+(i+8)*(1-c)+"px); transform: translateX(-"+(i+8)*(1-c)+"px);}")}}s+="#csaas-widget-"+e.id+" .csaas-chatway-button {width: "+i+"px; height: "+i+"px; }";let l=e.settings.bottom_spacing,r=e.settings.side_spacing,d=W(e.settings),h=d;"custom"==e.settings.position?("left"==d?(s+="#csaas-widget-"+e.id+" > .csaas-widget {left: "+r+"px}",s+=".csaas-outer-forms.pos-left.csaas-form-"+e.id+" {left: "+r+"px}",s+=".csaas-chat-view.csaas-chat-view-"+e.id+" {left: "+r+"px}",h="left"):(s+="#csaas-widget-"+e.id+" > .csaas-widget {left:auto; right: "+r+"px}",s+=".csaas-outer-forms.pos-right.csaas-form-"+e.id+" {left: auto; right: "+r+"px}",s+=".csaas-chat-view.csaas-chat-view-"+e.id+" {left: auto; right: "+r+"px}",h="right"),s+="#csaas-widget-"+e.id+" > .csaas-widget {bottom: "+l+"px}"):(h=e.settings.position,l=25),function(e,t,a,s){document.querySelectorAll(".csaas-form-"+e).length&&document.querySelectorAll(".csaas-form-"+e).forEach((function(e,n){e.classList.add("pos-"+t),e.classList.add("form-active"),e.style.bottom=s,"left"==t?(e.style.left=a,e.style.right="auto"):(e.style.right=a,e.style.left="auto")}))}(e.id,h,r,l);var g=i+15+parseInt(l);s+=".csaas-outer-forms.active.csaas-form-"+e.id+" {-webkit-transform: translateY(-"+g+"px); transform: translateY(-"+g+"px)} ",s+=".csaas:not(.form-open)#csaas-widget-"+e.id+" .csaas-widget.csaas-open + .csaas-chat-view {-webkit-transform: translateY(-"+g+"px); transform: translateY(-"+g+"px)} ",s+="#csaas-widget-"+e.id+" .csaas-tooltip:after {background-color: "+e.settings.cta_bg_color+"; color: "+e.settings.cta_text_color+"}",s+="#csaas-widget-"+e.id+" .csaas-tooltip.pos-top:before {border-top-color: "+e.settings.cta_bg_color+"; }",s+="#csaas-widget-"+e.id+" .csaas-tooltip.pos-left:before {border-left-color: "+e.settings.cta_bg_color+"; }",s+="#csaas-widget-"+e.id+" .csaas-tooltip.pos-right:before {border-right-color: "+e.settings.cta_bg_color+";}",s+="#csaas-widget-"+e.id+" .on-hover-text {background-color: "+e.settings.cta_bg_color+"; color: "+e.settings.cta_text_color+"}",s+="#csaas-widget-"+e.id+" .csaas-tooltip.pos-top .on-hover-text:before {border-top-color: "+e.settings.cta_bg_color+"; }",s+="#csaas-widget-"+e.id+" .csaas-tooltip.pos-left .on-hover-text:before {border-left-color: "+e.settings.cta_bg_color+"; }",s+="#csaas-widget-"+e.id+" .csaas-tooltip.pos-right .on-hover-text:before {border-right-color: "+e.settings.cta_bg_color+";}",s+="#csaas-widget-"+e.id+" .ch-pending-msg {background-color: "+e.settings.pending_mesg_count_bgcolor+";color: "+e.settings.pending_mesg_count_color+";}",s+=".csaas-chat-view-"+e.id+" .csaas-view-header {background-color: "+e.settings.cta_header_bg_color+";color: "+e.settings.cta_header_text_color+";}",s+=".csaas-chat-view-"+e.id+" .csaas-view-header svg {fill: "+e.settings.cta_header_text_color+";}",H(s)}(e,r,i)}}(a,t))})),function(){if(document.querySelectorAll(".Chatway-channel").length||g){if(!document.getElementById("chatway")&&a)try{if(-1!==a.indexOf("chatway_user_identifier")){const e=JSON.parse(a);a=e.chatway_user_identifier}if(a){let e=document.createElement("script");e.src="https://cdn.chatway.app/widget.js?id="+a,e.id="chatway",e.async=!0,document.head.appendChild(e)}}catch(e){a=!1}}else z();g&&!document.querySelectorAll(".Chatway-channel").length&&P("has--not--chatway"),document.querySelectorAll(".hide-show-chaty").forEach((function(e,t){e.onclick=function(t){t.stopPropagation();let a=e.getAttribute("data-widget"),s=E(a);if(s){if(s.classList.contains("has-single")||(be(a),s.classList.contains("csaas-open")?s.classList.remove("csaas-open"):(s.classList.add("csaas-open"),_e(a))),s.classList.contains("cta-first_click")){let e=M("cta-main-"+a);e&&(e.classList.remove("csaas-tooltip"),e.classList.remove("active"),e.removeAttribute("data-hover"))}f(a,"c-widget")&&v(a,"c-widget")}}})),l||document.querySelectorAll(".open-on-hover .open-chaty").forEach((function(e,t){e.addEventListener("mouseover",(function(t){let a=E(e.getAttribute("data-widget"));a&&(e.classList.contains("on-csaas-widget")||a.classList.contains("csaas-open")||(e.classList.add("on-csaas-widget"),e.click()))})),e.addEventListener("mouseleave",(function(t){E(e.getAttribute("data-widget")).classList.contains("csaas-open")||e.classList.remove("on-csaas-widget")}))})),document.querySelectorAll(".csaas-link").forEach((function(e,t){e.onclick=function(t){if(e.closest(".csaas")){let a=e.closest(".csaas").getAttribute("data-id"),s=A(a),n=E(a);if(s&&(be(a),n.classList.contains("has-single")?_e(a):function(e,t){let a=e.getAttribute("data-id"),s=e.getAttribute("data-user"),n=f(a,"c-"+t),i=V();if(n&&!i){v(a,"c-"+t);let e={widgetId:a,userId:s,isMobile:l,channel:t};e=x(e);let n=new XMLHttpRequest;n.open("POST",de,!0),n.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),n.onreadystatechange=function(){},n.send(e)}}(s,e.getAttribute("data-channel")),e.classList.contains("has-gae")&&function(e){if(!b(e)&&(window.hasOwnProperty("gtag")&>ag("event","chaty_"+e,{eventCategory:"chaty_"+e,event_action:"chaty_"+e,method:"chaty_"+e}),window.hasOwnProperty("ga"))){let t=window.ga.getAll()[0];t&&t.send("event","click",{eventCategory:"chaty_"+e,eventAction:"chaty_"+e,method:"chaty_"+e})}}(e.getAttribute("data-channel")),e.classList.contains("has-csaas-box")&&(t.stopPropagation(),fe(0,e.getAttribute("data-form"))),e.classList.contains("csaas-agent-button")&&(t.stopPropagation(),fe(0,e.getAttribute("data-form"))),e.classList.contains("has-on-hover")&&e.classList.contains("first_click")&&(e.classList.remove("has-on-hover"),e.classList.remove("active"),e.querySelectorAll(".on-hover-text").forEach((function(e,t){e.remove()})))),"Chatway"==e.getAttribute("data-channel")){const e=document.getElementsByClassName("chatway-launcher");for(let t=0;t1&&(a=a[1],b(a)&&(a="-"),a&&(a=a.toUpperCase(),t=a,void 0!==s.id&&("undefined"!=typeof Storage?null==window.sessionStorage.getItem("csaas_user_country_code")&&window.sessionStorage.setItem("csaas_user_country_code",t):_("csaas_user_country_code")||w("csaas_user_country_code",t,365)),xe()))}var t},e.send("")}():xe()):xe()}()):-1==e.status&&y(e.show_upgrade_popup)&&document.getElementById("admin-bar-iframe")?function(e){if(document.getElementById("admin-bar-iframe")){L(),q("Poppins:400,600,700");let a=e.visitor_count,s=parseInt(e.next_reset_in_days);s=1==s?"1 day":s+" days",U=e.redirect_url;let n="";n+="",C(n)}}(e):(console.log("No widgets found"),z())):z()}},v.send(x(f))}catch(e){console.log(e)}}()},Ce=!1,Ae=!1,Ee=function(){let e;return null==s.id?"undefined"!=typeof Storage&&null!=window.sessionStorage.getItem("csaas_client_id")?e=window.sessionStorage.getItem("csaas_client_id"):_("csaas_client_id")&&(e=m("csaas_client_id")):e=s.id,null==e?0:e},Se=function(){return m("csaas_referrer")?-1!==m("csaas_referrer").indexOf(window.location.host)?"":m("csaas_referrer"):""},Me=function(){_("csaas_user_id")||w("csaas_user_id",Math.random().toString(36).slice(-16),365),void 0!==s.id&&("undefined"!=typeof Storage?null==window.sessionStorage.getItem("csaas_client_id")&&window.sessionStorage.setItem("csaas_client_id",s.id):_("csaas_client_id")||w("csaas_client_id",s.id,365)),m("csaas_referrer")||w("csaas_referrer",document.referrer,.00138888888888889),setInterval((function(){w("csaas_referrer",Se().length>1?Se():document.referrer,.00138888888888889)}),6e4),Le()},Ie=function(){if(clearInterval(ye),Ae)return!1;Ae=!0,function(){let e,t;if(null==document.getElementById(n)||null==document.getElementById(n)){let a=document.getElementsByTagName("script");for(let s=0;s0){if(null!=(e=e.split("?")[1])&&e.indexOf("&")>-1){e=e.split("&");for(let t=0;t