function launch_chaty(t){(void 0==t||"widget_index"==t)&&(t=0),jQuery("#chaty-widget-_"+t).length?jQuery("#chaty-widget-_"+t+" .chaty-cta-button .open-chaty").trigger("click"):jQuery("#chaty-widget-"+t).length&&jQuery("#chaty-widget-"+t+" .chaty-cta-button .open-chaty").trigger("click")}!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):"undefined"!=typeof module&&module.exports?module.exports=t(require("jquery")):t(jQuery)}(function(t,a){var e,c,i=[],n="",s=/(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,o=["System Stack","Arial","Tahoma","Verdana","Helvetica","Times New Roman","Trebuchet MS","Georgia","-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"],h=!1,l=!1,r=0,d=!1,y=!1,g=[],p=0,f=0,v="",m=0,u="";function w(e){if(a!=t("#chaty-widget-"+e).data("animation")&&"none"!=t("#chaty-widget-"+e).data("animation")){var c="chaty-animation-"+t("#chaty-widget-"+e).data("animation");t("#chaty-widget-"+e+" ."+c).removeClass(c)}}function $(){i.length&&(t("body").append(' '),t.each(i,function(a,e){var c="",n="",h=0,g={};if(t.each(e.channels,function(t,a){x(a)&&(h++,g=a)}),"open"==e.settings.default_state&&1==h&&(e.settings.default_state="click",i[a].settings.default_state="click"),h>0&&!t("#chaty-widget-"+e.id).length){var p,f=L(e.settings);f="right"==f?"right":"left";var v=(p=e,"vertical"!=p.settings.icon_view?"top":"right"==L(p.settings)?"left":"right");if("chat-view"==e.settings.cta_type){var m,u,w,$,C,T,j,z="";t("body").append(z),u=(m=e).id,null==(w=M(u))&&(w=-1),$=m.settings.cta_body,C=m.settings.cta_head,T=t("title").text(),E(T)?($=$.replace(/{title}/g,""),C=C.replace(/{title}/g,"")):($=$.replace(/{title}/g,T),C=C.replace(/{title}/g,T)),$=$.replace(/{url}/g,""+window.location.href+""),C=C.replace(/{url}/g,""+window.location.href+""),j="",j+="",t("#chaty-widget-"+u).append(j)}else{var z="";t("body").append(z)}G(e.triggers.auto_hide_widget)&&parseInt(e.triggers.hide_after)>0&&(t("#chaty-widget-"+e.id).addClass("auto-hide-chaty"),t("#chaty-widget-"+e.id).attr("data-time",e.triggers.hide_after));var B=Y(e.id,"c-widget");if(t("#chaty-widget-"+e.id).addClass(e.settings.show_cta),1==h&&"chat-view"!=e.settings.cta_type){"vertical"!=e.settings.icon_view&&(v="right"!=f?"right":"left");var A=S(g,e.id,v);t("#chaty-widget-"+e.id+" .chaty-i-trigger").html(A),t("#chaty-widget-"+e.id+" .chaty-i-trigger").addClass("single-channel"),t("#chaty-widget-"+e.id+" .chaty-i-trigger .chaty-channel").addClass("single"),t("#chaty-widget-"+e.id+" .chaty-widget").addClass("has-single");var P=e.settings.cta_text;E(P)||(P=_(P)),"first_click"==e.settings.show_cta&&(B?(t("#chaty-widget-"+e.id+" .chaty-tooltip").removeClass("chaty-tooltip"),t("#chaty-widget-"+e.id+" .chaty-i-trigger .chaty-channel").addClass("active").addClass("chaty-tooltip").addClass("pos-"+v),t("#chaty-widget-"+e.id+" .chaty-i-trigger .chaty-channel").append(""+P+"").addClass("active").addClass("has-on-hover"),t("#chaty-widget-"+e.id+" .chaty-i-trigger .chaty-channel a").append(""+P+"").addClass("has-on-hover"),t("#chaty-widget-"+e.id+" .chaty-i-trigger .chaty-channel a").attr("data-text",P),t("#chaty-widget-"+e.id+" .chaty-i-trigger .chaty-channel a").attr("aria-label",P)):t("#chaty-widget-"+e.id+" .chaty-i-trigger .chaty-channel a").append(""+P+"").removeClass("active").addClass("has-on-hover")),"all_time"==e.settings.show_cta&&(t("#chaty-widget-"+e.id+" .chaty-i-trigger .chaty-tooltip").append(""+P+"").addClass("active").addClass("has-on-hover"),t("#chaty-widget-"+e.id+" .chaty-i-trigger.single-channel .chaty-channel a").attr("data-text",P));var I=g;("Instagram"!=I.channel_type||"#ffffff"!=I.icon_color&&"#fff"!=I.icon_color)&&(c+="#chaty-widget-"+e.id+" ."+I.channel_type+"-channel .color-element{ fill: "+I.icon_color+"; color: "+I.icon_color+";}",c+="#chaty-widget-"+e.id+" .channel-icon-"+I.channel_type+" .color-element{ fill: "+I.icon_color+"; color: "+I.icon_color+";}"),c+="#chaty-widget-"+e.id+" ."+I.channel_type+"-channel .chaty-custom-icon { background-color: "+I.icon_color+"; }",c+="#chaty-widget-"+e.id+" ."+I.channel_type+"-channel .chaty-svg { background-color: "+I.icon_color+";}",c+="#chaty-widget-"+e.id+" .channel-icon-"+I.channel_type+" .chaty-svg { background-color: "+I.icon_color+";}","Contact_Us"==I.channel_type&&(c+=".chaty-contact-form-box #chaty-submit-button-"+e.id+" {background-color: "+I.contact_form_settings.button_bg_color+"; color: "+I.contact_form_settings.button_text_color+";} ")}else{t.each(e.channels,function(a,i){if(x(i)){if(U(i.channel_type)&&(i.channel_type=i.channel),"chat-view"==e.settings.cta_type){var n=S(i,e.id,"top");t(".chaty-chat-view-"+e.id+" .chaty-view-channels").append(n)}else{var n=S(i,e.id,v);t("#chaty-widget-"+e.id+" .chaty-channel-list").append(n)}("Instagram"!=i.channel_type||"#ffffff"!=i.icon_color&&"#fff"!=i.icon_color)&&(c+="#chaty-widget-"+e.id+" ."+i.channel_type+"-channel .color-element{ fill: "+i.icon_color+"; color: "+i.icon_color+";}",c+="#chaty-widget-"+e.id+" .channel-icon-"+i.channel_type+" .color-element{ fill: "+i.icon_color+"; color: "+i.icon_color+";}"),c+="#chaty-widget-"+e.id+" ."+i.channel_type+"-channel .chaty-custom-icon { background-color: "+i.icon_color+"; }",c+="#chaty-widget-"+e.id+" ."+i.channel_type+"-channel .chaty-svg { background-color: "+i.icon_color+";}",c+="#chaty-widget-"+e.id+" .channel-icon-"+i.channel_type+" .chaty-svg { background-color: "+i.icon_color+";}",c+=".chaty-chat-view-"+e.id+" ."+i.channel_type+"-channel .chaty-custom-icon { background-color: "+i.icon_color+"; }",c+=".chaty-chat-view-"+e.id+" ."+i.channel_type+"-channel .chaty-svg { background-color: "+i.icon_color+";}",c+=".chaty-chat-view-"+e.id+" .channel-icon-"+i.channel_type+" .chaty-svg { background-color: "+i.icon_color+";}","Contact_Us"==i.channel_type&&(c+=".chaty-contact-form-box #chaty-submit-button-"+e.id+" {background-color: "+i.contact_form_settings.button_bg_color+"; color: "+i.contact_form_settings.button_text_color+";} ")}});var W,q,O=(W=e.settings,q=e.id,(""==W.widget_icon?W.widget_icon="chat-base":"chat-image"==W.widget_icon&&E(W.widget_icon_url)?W.widget_icon="chat-base":"chat-fa-icon"==W.widget_icon&&E(W.widget_fa_icon)&&(W.widget_icon="chat-base"),"chat-image"==W.widget_icon)?"Chaty Widget":"chat-fa-icon"==W.widget_icon?"":''+function t(a,e,c,i){switch(a){case"chat-smile":return'';case"chat-bubble":return'';case"chat-db":return'';default:return''}}(W.widget_icon,W.widget_color,"#ffffff",q)+""),P=e.settings.cta_text;"first_click"!=e.settings.show_cta||B||(P="");var F=v;"horizontal"==e.settings.icon_view&&(F="left"==f?"right":"left"),E(P)||(P=_(P));var D='
'+P+'
';t("#chaty-widget-"+e.id+" .chaty-i-trigger").html(D);var H='
';t("#chaty-widget-"+e.id+" .chaty-i-trigger").append(H)}t.each(e.channels,function(t,a){"Contact_Us"==a.channel_type&&"yes"==a.hide_recaptcha_badge&&(c+=".grecaptcha-badge {visibility: hidden;}")});var N,R,X,J,B=Y(e.id,"c-widget");B&&("open"!=e.settings.default_state||1==h)&&(N=e.settings,Y(R=e.id,"c-widget")&&G(N.is_pending_mesg_enabled)&&parseInt(N.pending_mesg_count)>0&&(t("#chaty-widget-"+R+" .chaty-widget").hasClass("has-single")?"sheen"==N.attention_effect||"spin"==N.attention_effect||"pulse"==N.attention_effect?t("#chaty-widget-"+R+" .chaty-i-trigger .chaty-channel").append(""+N.pending_mesg_count+""):t("#chaty-widget-"+R+" .chaty-i-trigger .chaty-channel .chaty-svg").append(""+N.pending_mesg_count+""):"jump"==N.attention_effect||"waggle"==N.attention_effect||"blink"==N.attention_effect||"pulse-icon"==N.attention_effect?t("#chaty-widget-"+R+" .chaty-i-trigger .chaty-cta-main .chaty-cta-button").append(""+N.pending_mesg_count+""):t("#chaty-widget-"+R+" .chaty-i-trigger .chaty-cta-main").append(""+N.pending_mesg_count+"")),X=e.settings,Y(J=e.id,"c-widget")&&"none"!=X.attention_effect&&""!=X.attention_effect&&(t("#chaty-widget-"+J).attr("data-animation",X.attention_effect),t("#chaty-widget-"+J+" .chaty-widget").hasClass("has-single")?t("#chaty-widget-"+J+" .chaty-i-trigger .chaty-channel .chaty-svg").addClass("chaty-animation-"+X.attention_effect):t("#chaty-widget-"+J+" .chaty-i-trigger .chaty-cta-main .chaty-cta-button").addClass("chaty-animation-"+X.attention_effect)));var Z,Q,K=0;"open"!=e.settings.default_state||G(e.settings.show_close_button)||(t("#chaty-widget-"+e.id+" .chaty-widget").addClass("chaty-no-close-button").addClass("chaty-open"),K=1),G(e.settings.is_google_analytics_enabled)&&(t("#chaty-widget-"+e.id+" .chaty-channel-list .chaty-channel > a").addClass("has-gae"),t("#chaty-form-"+e.id+"-chaty-chat-view .chaty-channel > a").addClass("has-gae"),t("#chaty-widget-"+e.id+" .chaty-i-trigger.single-channel .chaty-channel > a").addClass("has-gae"),t(".chaty-outer-forms.chaty-whatsapp-form.chaty-form-"+e.id+" form.add-analytics").addClass("form-google-analytics"),t(".whatsapp-chaty-form-"+e.id).addClass("has-form-gae")),G(e.settings.has_custom_css)&&!E(e.settings.custom_css)&&(n+=e.settings.custom_css),"hover"==e.settings.default_state?t("#chaty-widget-"+e.id).addClass("open-on-hover"):"open"==e.settings.default_state&&(t("#chaty-widget-"+e.id+" .chaty-widget").addClass("default-open"),(B||!G(e.settings.show_close_button))&&t("#chaty-widget-"+e.id+" .chaty-widget").addClass("chaty-open"));var tt=(Z=e.settings.widget_size,Q=e.settings.custom_widget_size,Z);if(tt=parseInt(tt),c+="#chaty-widget-"+e.id+" .chaty-channel-list .chaty-channel {width: "+tt+"px; height: "+tt+"px; }",c+="#chaty-widget-"+e.id+" .chaty-channel-list .chaty-channel > a {width: "+tt+"px; height: "+tt+"px; }",c+="#chaty-widget-"+e.id+" .chaty-channel-list .chaty-channel > a .chaty-custom-icon {display:block; width: "+tt+"px; height: "+tt+"px; line-height: "+tt+"px; font-size: "+parseInt(tt/2)+"px; }",c+="#chaty-widget-"+e.id+" .chaty-channel-list .chaty-channel button {width: "+tt+"px; height: "+tt+"px; margin: 0; padding:0; outline: none; border-radius: 50%;}",c+="#chaty-widget-"+e.id+" .chaty-channel-list .chaty-channel .chaty-svg {width: "+tt+"px; height: "+tt+"px; }",c+="#chaty-widget-"+e.id+" .chaty-channel-list .chaty-channel .chaty-svg img {width: "+tt+"px; height: "+tt+"px; }",c+="#chaty-widget-"+e.id+" .chaty-channel-list .chaty-channel span.chaty-icon {width: "+tt+"px; height: "+tt+"px; }",c+="#chaty-widget-"+e.id+" .chaty-channel-list .chaty-channel a {width: "+tt+"px; height: "+tt+"px; }",c+="#chaty-widget-"+e.id+" .chaty-channel-list .chaty-channel .chaty-svg .chaty-custom-channel-icon {width: "+tt+"px; height: "+tt+"px; line-height: "+tt+"px; display: block; font-size:"+parseInt(tt/2)+"px; }",c+="#chaty-widget-"+e.id+" .chaty-i-trigger .chaty-cta-button {background-color: "+e.settings.widget_color+"; }",c+="#chaty-widget-"+e.id+" .chaty-i-trigger .chaty-cta-button button {background-color: "+e.settings.widget_color+"; }",c+="#chaty-widget-"+e.id+" .chaty-i-trigger .chaty-channel {width: "+tt+"px; height: "+tt+"px; }",c+="#chaty-widget-"+e.id+" .chaty-i-trigger .chaty-channel > a {width: "+tt+"px; height: "+tt+"px; }",c+="#chaty-widget-"+e.id+" .chaty-i-trigger .chaty-channel > a .chaty-custom-icon {display:block; width: "+tt+"px; height: "+tt+"px; line-height: "+tt+"px; font-size: "+parseInt(tt/2)+"px; }",c+="#chaty-widget-"+e.id+" .chaty-i-trigger .chaty-channel button {width: "+tt+"px; height: "+tt+"px; margin: 0; padding:0; outline: none; border-radius: 50%;}",c+="#chaty-widget-"+e.id+" .chaty-i-trigger .chaty-channel .chaty-svg {width: "+tt+"px; height: "+tt+"px; }",c+="#chaty-widget-"+e.id+" .chaty-i-trigger .chaty-channel .chaty-svg img {width: "+tt+"px; height: "+tt+"px; }",c+="#chaty-widget-"+e.id+" .chaty-i-trigger .chaty-channel span.chaty-icon {width: "+tt+"px; height: "+tt+"px; }",c+="#chaty-widget-"+e.id+" .chaty-i-trigger .chaty-channel a {width: "+tt+"px; height: "+tt+"px; }",c+="#chaty-widget-"+e.id+" .chaty-i-trigger .chaty-channel .chaty-svg .chaty-custom-channel-icon {width: "+tt+"px; height: "+tt+"px; line-height: "+tt+"px; display: block; font-size:"+parseInt(tt/2)+"px; }",c+="#chaty-widget-"+e.id+" .chaty-i-trigger .ch-pending-msg {background-color: "+e.settings.pending_mesg_count_bgcolor+"; color: "+e.settings.pending_mesg_count_color+"; }",c+="#chaty-widget-"+e.id+" .chaty-i-trigger .chaty-channel .chaty-svg .widget-fa-icon {line-height: "+tt+"px; font-size:"+parseInt(tt/2)+"px; }","vertical"==e.settings.icon_view){c+="#chaty-widget-"+e.id+" .chaty-channel-list {height: "+h*(tt+8)+"px; }",c+="#chaty-widget-"+e.id+" .chaty-channel-list {width: "+(tt+8)+"px; }";for(var ta=0;ta<=h;ta++)c+="#chaty-widget-"+e.id+" .chaty-open .chaty-channel-list .chaty-channel:nth-child("+(ta+1)+") {-webkit-transform: translateY(-"+(tt+8)*(h-ta-K)+"px); transform: translateY(-"+(tt+8)*(h-ta-K)+"px);}"}else{t("#chaty-widget-"+e.id+" .chaty-widget").addClass("hor-mode"),c+="#chaty-widget-"+e.id+" .chaty-channel-list {width: "+h*(tt+8)+"px; }",c+="#chaty-widget-"+e.id+" .chaty-channel-list {height: "+tt+"px; }";for(var ta=0;ta<=h;ta++)c+="#chaty-widget-"+e.id+" .chaty-widget.left-position.hor-mode.chaty-open .chaty-channel-list .chaty-channel:nth-child("+(ta+1)+") {-webkit-transform: translateX("+(tt+8)*(h-ta-K)+"px); transform: translateX("+(tt+8)*(h-ta-K)+"px);}",c+="#chaty-widget-"+e.id+" .chaty-widget.right-position.hor-mode.chaty-open .chaty-channel-list .chaty-channel:nth-child("+(ta+1)+") {-webkit-transform: translateX(-"+(tt+8)*(h-ta-K)+"px); transform: translateX(-"+(tt+8)*(h-ta-K)+"px);}"}var te=e.settings.bottom_spacing,tc=e.settings.side_spacing;c+="#chaty-widget-"+e.id+" .chaty-widget {bottom: "+te+"px}","left"==f?(c+="#chaty-widget-"+e.id+" .chaty-widget {left: "+tc+"px; right: auto;}",c+=".chaty-outer-forms.pos-left.chaty-form-"+e.id+" {left: "+tc+"px}",t(".chaty-form-"+e.id).addClass("pos-left")):(c+="#chaty-widget-"+e.id+" .chaty-widget {right: "+tc+"px; left:auto;}",t(".chaty-form-"+e.id).addClass("pos-right"),c+=".chaty-outer-forms.pos-right.chaty-form-"+e.id+" {right: "+tc+"px; left:auto;}"),t(".chaty-form-"+e.id).show();var ti=tt+15+parseInt(te);c+=".chaty-outer-forms.active.chaty-form-"+e.id+" {-webkit-transform: translateY(-"+ti+"px); transform: translateY(-"+ti+"px)} ",c+="#chaty-widget-"+e.id+".chaty:not(.form-open) .chaty-widget.chaty-open + .chaty-chat-view {-webkit-transform: translateY(-"+ti+"px); transform: translateY(-"+ti+"px)} ",c+="#chaty-widget-"+e.id+" .chaty-tooltip:after {background-color: "+e.settings.cta_bg_color+"; color: "+e.settings.cta_text_color+"}",c+="#chaty-widget-"+e.id+" .chaty-tooltip.pos-top:before {border-top-color: "+e.settings.cta_bg_color+"; }",c+="#chaty-widget-"+e.id+" .chaty-tooltip.pos-left:before {border-left-color: "+e.settings.cta_bg_color+"; }",c+="#chaty-widget-"+e.id+" .chaty-tooltip.pos-right:before {border-right-color: "+e.settings.cta_bg_color+";}",c+="#chaty-widget-"+e.id+" .on-hover-text {background-color: "+e.settings.cta_bg_color+"; color: "+e.settings.cta_text_color+"}",c+="#chaty-widget-"+e.id+" .chaty-tooltip.pos-top .on-hover-text:before {border-top-color: "+e.settings.cta_bg_color+"; }",c+="#chaty-widget-"+e.id+" .chaty-tooltip.pos-left .on-hover-text:before {border-left-color: "+e.settings.cta_bg_color+"; }",c+="#chaty-widget-"+e.id+" .chaty-tooltip.pos-right .on-hover-text:before {border-right-color: "+e.settings.cta_bg_color+";}";var tn=ti+72+tt;tn>0&&(c+=".chaty-outer-forms.chaty-form-"+e.id+" .chaty-agent-body {max-height: calc(100vh - "+tn+"px); overflow-y: auto; } "),c+="#chaty-form-"+e.id+"-chaty-chat-view .chaty-view-header {background-color: "+e.settings.cta_head_bg_color+";}",c+="#chaty-form-"+e.id+"-chaty-chat-view .chaty-view-header {color: "+e.settings.cta_head_text_color+";}",c+="#chaty-form-"+e.id+"-chaty-chat-view .chaty-view-header svg {fill : "+e.settings.cta_head_text_color+";}";var ts=ti+72+tt;ts>0&&(c+=".chaty-outer-forms.chaty-whatsapp-form.chaty-form-"+e.id+" .chaty-whatsapp-content {max-height: calc(100vh - "+ts+"px); overflow-y: auto; } ");var to=ti+82+tt;if(to>0&&(c+=".chaty-outer-forms.chaty-contact-form-box.chaty-form-"+e.id+" .chaty-contact-inputs {max-height: calc(100vh - "+to+"px); overflow-y: auto; } "),(25!=te||25!=tc)&&(t(".chaty-outer-forms.chaty-form-"+e.id).addClass("custom-cht-pos"),t("#chaty-widget-"+e.id).addClass("has-custom-pos")),Y(e.id,"v-widget")&&(G(e.triggers.exit_intent)||G(e.triggers.has_time_delay)||G(e.triggers.has_display_after_page_scroll)>0)?(G(e.triggers.has_time_delay)&&0==parseInt(e.triggers.time_delay)?(k(e.id),t("#chaty-widget-"+e.id).addClass("active")):G(e.triggers.has_time_delay)&&parseInt(e.triggers.time_delay)>0&&(l=!0,parseInt(e.triggers.time_delay)>r&&(r=e.triggers.time_delay),t("#chaty-widget-"+e.id).addClass("on-chaty-delay"),t("#chaty-widget-"+e.id).addClass("delay-time-"+parseInt(e.triggers.time_delay)),t("#chaty-widget-"+e.id).attr("data-time",parseInt(e.triggers.time_delay))),G(e.triggers.has_display_after_page_scroll)&&0==parseInt(e.triggers.display_after_page_scroll)?(k(e.id),t("#chaty-widget-"+e.id).addClass("active")):G(e.triggers.has_display_after_page_scroll)&&parseInt(e.triggers.display_after_page_scroll)>0&&(d=!0,t("#chaty-widget-"+e.id).addClass("on-chaty-scroll"),t("#chaty-widget-"+e.id).addClass("page-scroll-"+parseInt(e.triggers.display_after_page_scroll)),t("#chaty-widget-"+e.id).attr("data-scroll",parseInt(e.triggers.display_after_page_scroll))),G(e.triggers.exit_intent)&&(y=!0,t("#chaty-widget-"+e.id).addClass("on-chaty-exit-intent"))):(k(e.id),t("#chaty-widget-"+e.id).addClass("active")),!E(e.settings.font_family)&&"none"!=e.settings.font_family){var th=e.settings.font_family;-1!=t.inArray(th,o)?"System Stack"==th&&(th="-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"):(t("head").append(''),t("head").append('')),c+="#chaty-widget-"+e.id+", #chaty-widget-"+e.id+" .chaty-tooltip:after {font-family: "+th+"}"}}y&&(s?function a(){if(window.history&&window.history.pushState&&y){function e(){y&&""!==location.hash.split("#!/")[1]&&""===window.location.hash&&V()}var c=100;window.history.state&&window.history.state.page&&(c=window.history.state.page),window.history.pushState({page:c+1},""),window.history.pushState({page:c+2},""),window.onpopstate=function(){e()},window.history.onpopstate=function(){e()},window.addEventListener("popstate",function(){e()}),document.addEventListener("backbutton",function(){e()}),window.addEventListener("backbutton",function(){e()}),t(window).on("popstate",function(){e()})}}():t(document).mouseleave(function(t){var a,e,c="mouseout";a=document,e=function(t){null==t.toElement&&null==t.relatedTarget&&V()},a.addEventListener?(a.addEventListener(c,e,!1),V()):a.attachEvent&&a.attachEvent("on"+c,e)})),""!=c&&(t("#custom-chaty-css").length||t("head").append(""),t("#custom-chaty-css").append(c)),""!=n&&(t("#custom-advance-chaty-css").length||t("head").append(""),t("#custom-advance-chaty-css").append(n)),i.length,t(".chaty-sms-channel").length&&t(".chaty-sms-channel").each(function(){var a=t(this).attr("href");a=(a=a.replace(/{title}/g,b())).replace(/{url}/g,window.location.href),t(this).attr("href",a)})}),t("#custom-advance-chaty-css").length||t("head").append(""),t("#custom-advance-chaty-css").append(v),(t(".v3_site_key").length&&!E(t(".v3_site_key").val())||t(".v2_site_key").length&&!E(t(".v2_site_key").val()))&&function t(){if(jQuery(".v2_site_key").length&&""!=jQuery(".v2_site_key").val()){var a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src="https://www.google.com/recaptcha/api.js?onload=onloadChatyCallback&render=explicit&hl=en",(document.getElementsByTagName("head")[0]||document.getElementsByTagName("body")[0]).appendChild(a)}jQuery(".v3_site_key").length&&""!=jQuery(".v3_site_key").val()&&jQuery(".v3_site_key").length&&""!=jQuery(".v3_site_key").val()&&jQuery(".front-google-captcha").length&&jQuery(".front-google-captcha:not(.loaded)").each(function(){jQuery(this).addClass("loaded");var t=jQuery(".v3_site_key").val(),a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src="https://www.google.com/recaptcha/api.js?onload=onloadCallbackChatyV3&render="+t,(document.getElementsByTagName("head")[0]||document.getElementsByTagName("body")[0]).appendChild(a),a.loadEventEnd=function(){}})}()),t(".chaty-tooltip").each(function(){""==t(this).data("hover")&&t(this).removeClass("left").removeClass("right").removeClass("top").removeClass("chaty-tooltip")}),t(".chaty.auto-hide-chaty").length&&(c=setInterval(function(){var a=++m;if(t(".chaty.auto-hide-chaty.hide-after-"+m).length){var e=t(".chaty.auto-hide-chaty.hide-after-"+a).data("id");t(".chaty-form-"+e).removeClass("active"),t(".chaty.auto-hide-chaty.hide-after-"+a).removeClass("active"),t("#chaty-widget-0"+e).removeClass("auto-hide-chaty")}0==t(".chaty.auto-hide-chaty").length&&clearInterval(c)},1e3)),l&&(e=setInterval(function(){if(t(".chaty.delay-time-"+ ++p).length){var a=t(".chaty.delay-time-"+p).data("id");W(a)}},1e3)),d&&(t(window).on("scroll",function(){if(d){var a=t(document).height()-t(window).height(),e=t(window).scrollTop();if(0!=a){var c=parseInt(e/a*100);if(f<=c){var i=f;f=c;for(var n=i;n<=c;n++)-1==t.inArray(n,g)&&t(".chaty.on-chaty-scroll.page-scroll-"+n).length&&t(".chaty.on-chaty-scroll.page-scroll-"+n).each(function(){var a=t(this).data("id");t(this).removeClass("on-chaty-scroll"),W(a)});f=c}}}}),window.innerWidth,document.documentElement.clientWidth)}function b(){return t("title").length?t("title").text():""}function _(t){return new DOMParser().parseFromString(t,"text/html").documentElement.textContent}function x(t){if(G(t.is_agent)){if(t.agent_data.length&&(!s&&G(t.is_agent_desktop)||s&&G(t.is_agent_mobile)))return!0}else if((!s&&G(t.is_desktop)||s&&G(t.is_mobile))&&(""!=t.value||"Contact_Us"==t.channel))return!0;return!1}function k(a){if(parseInt(chaty_settings.capture_analytics)&&(chaty_settings.capture_analytics=0,t.ajax({url:chaty_settings.ajax_url,type:"post",data:{action:"update_chaty_view",token:chaty_settings.token}})),t("#chaty-widget-"+a+" .chaty-channel.chaty-default-open").length){var e=t("#chaty-widget-"+a+" .chaty-channel.chaty-default-open a.chaty-whatsapp-form").data("form");if(!E(e)){var c=Y(a,"c-"+t("#chaty-widget-"+a+" .chaty-channel.chaty-default-open").data("channel"));if(c&&(t("#"+e).addClass("is-active"),t("#"+e).length)){var n=t("#chaty-widget-"+a+" .chaty-channel.chaty-default-open a.chaty-whatsapp-form").html()+""+chaty_settings.lang.hide_whatsapp_form+"";if(w(a),t("#chaty-widget-"+a).find(".ch-pending-msg").remove(),t("#chaty-widget-"+a+" .chaty-widget").removeClass("chaty-open"),t("#chaty-widget-"+a).addClass("form-open"),t("#"+e).addClass("active"),t("#chaty-widget-"+a+" .open-chaty-channel").html(n),t("#chaty-widget-"+a).addClass("active"),t("#chaty-widget-"+a).addClass("active"),t("#chaty-widget-"+a).hasClass("auto-hide-chaty")){var s=parseInt(t("#chaty-widget-"+a).data("time"));s>0&&(s+=m,t("#chaty-widget-"+a).addClass("hide-after-"+s))}return}}}if(t("#chaty-widget-"+a).addClass("active"),t("#chaty-widget-"+a).hasClass("auto-hide-chaty")){var s=parseInt(t("#chaty-widget-"+a).data("time"));s>0&&(s+=m,t("#chaty-widget-"+a).addClass("hide-after-"+s))}if(Y(a,"v-widget")){N(a,"v-widget");var o,h=[],l=0,r=0;i[t("#chaty-widget-"+a).data("key")];var d=X("activechatyWidgets");null!=d?(d=d.split(","),-1==t.inArray(a,d)&&(d.push(a),R("activechatyWidgets",d=d.join(","),1))):(d=a,R("activechatyWidgets",d,1)),t("#chaty-widget-"+a+" .chaty-widget").hasClass("has-single")?(l=1,o=t("#chaty-widget-"+a+" .chaty-channel").data("channel"),Y(a,"v-"+o)&&void 0!==o&&(N(a,"v-"+o),h.push(o))):t("#chaty-widget-"+a+" .chaty-widget").hasClass("chaty-open")&&(r=1,t("#chaty-widget-"+a).hasClass("chaty-has-chat-view")?t(".chaty-chat-view.chaty-chat-view-"+a+" .chaty-view-channels").find(".chaty-channel").each(function(){chatyChannel=t(this).data("channel"),(c=Y(a,"v-"+chatyChannel))&&"undefined"!=typeof chatyChannel&&(N(a,"v-"+chatyChannel),h.push(chatyChannel))}):t("#chaty-widget-"+a+" .chaty-channel-list .chaty-channel").each(function(){o=t(this).data("channel"),Y(a,"v-"+o)&&void 0!==o&&(N(a,"v-"+o),h.push(o))}))}}function C(a){var e=t("#chaty-widget-"+a).data("user");chatySaasCheckCookie("triggeredFor"+e)||R("triggeredFor"+e,a,2)}function T(t,a){return t}function S(a,e,c){var i="";if(G(a.is_agent)){if(a.agent_data.length){var n=0,o=[];if(t.each(a.agent_data,function(t,a){""!=a.value&&(n++,o=a)}),n>0){var h,l,r,d,y,g,p=M(e);return null==p&&(p=-1),r=a,d=e,y="",null==(g=M(d))&&(g=-1),y+="",v+=".chaty-agent-header.agent-info-"+d+"-"+r.channel+" { background-color: "+r.header_bg_color+"; color: "+r.header_text_color+" } ",v+=".agent-info-"+d+"-"+r.channel+" .chaty-close-agent-list svg { fill: "+r.header_text_color+" } ",t("body").append(y),h=P(a,e),l=A(a,h,c,e),("Instagram"!=a.channel||"#ffffff"!=a.icon_color&&"#fff"!=a.icon_color)&&(v+=".chaty-agent-"+e+"-"+a.channel+" .color-element {fill: "+a.icon_color+"; color: "+a.icon_color+";}"),v+=".chaty-agent-"+e+"-"+a.channel+" .chaty-custom-icon { background-color: "+a.icon_color+";}",v+=".chaty-agent-"+e+"-"+a.channel+" .chaty-svg-img { background-color: "+a.icon_color+";}","
"+l+"
"}}}else{U(a.channel_type)&&(a.channel_type=a.channel);var h=P(a,e),l=A(a,h,c,e);return"Contact_Us"==a.channel_type?i+=" has-chaty-box chaty-contact-form":"Whatsapp"==a.channel_type&&G(a.has_welcome_message)&&!E(a.chat_welcome_message)&&G(a.is_default_open)&&Y(e,"c-"+a.channel_type)&&(i+=" chaty-default-open"),"
"+l+"
"}}function j(a,e,c,i,n){var o=e.value,h="_blank";if("Whatsapp"==a.channel_type){var l=z(e.value);s?(h="",o="https://wa.me/"+l):(h="_blank",o="https://web.whatsapp.com/send?phone="+l)}else"WeChat"==a.channel_type?(h="",o="javascript:;"):"Email"==a.channel_type?(h="",o="mailto:"+e.value):"Facebook_Messenger"==a.channel_type?h=s?"":"_blank":"SMS"==a.channel_type?(h="",o="sms:"+e.value):"Telegram"==a.channel_type?(o="https://telegram.me/"+(o=B(e.value,"@")),h="_blank"):"Twitter"==a.channel_type?o="https://twitter.com/"+t.trim(e.value):"Phone"==a.channel_type?(h="",o="tel:"+t.trim(e.value)):"Skype"==a.channel_type?(h="",o="skype:"+t.trim(e.value)+"?chat"):"Snapchat"==a.channel_type?o="https://www.snapchat.com/add/"+t.trim(e.value):"Vkontakte"==a.channel_type?o="https://vk.me/"+t.trim(e.value):"Linkedin"==a.channel_type?o="personal"==e.link_type?"https://www.linkedin.com/in/"+t.trim(e.value):"https://www.linkedin.com/company/"+t.trim(e.value):"Viber"==a.channel_type?(isNaN(o=B(e.value,"+"))||(o=o.replace("+",""),navigator.userAgent.match(/(iPod|iPhone|iPad)/)&&(o="+"+o),o="viber://chat?number="+o),h=""):"TikTok"==a.channel_type&&(o="https://www.tiktok.com/@"+(o=B(t.trim(e.value),"@")),h="");return""+i+""}function z(t){return t=(t=(t=(t=B(t,"+")).replace(/ /g,"")).replace(/-/g,"")).replace(/_/g,"")}function B(a,e){for(a=t.trim(a);a.charAt(0)==e;)a=a.substring(1);for(;a.charAt(a.length-1)==e;)a=a.substring(0,a.length-1);return a}function A(a,e,c,i){var n,o,h,l,r,d,y,g,p="";if(G(a.is_agent))a.url="javascript:;",a.target="";else if("Whatsapp"==a.channel_type){if(G(a.has_welcome_message)&&!E(a.chat_welcome_message))a.url="javascript:;",a.target="",p+=" has-chaty-box chaty-whatsapp-form",function a(e,c){var i="",n=M(c);null==n&&(n=-1);var o="https://web.whatsapp.com/send",h="";if(s?o="https://wa.me/"+e.value:(o=G(e.is_use_web_version)?"https://web.whatsapp.com/send":"https://wa.me/"+e.value,h="_blank"),i+="",t("body").append(i),t("#chaty-form-"+c+"-"+e.channel_type+" .chaty-whatsapp-message").html(e.chat_welcome_message),!E(e.pre_set_message)){var l=e.pre_set_message,r=t("title").text();l=(l=E(r)?l.replace(/{title}/g,""):l.replace(/{title}/g,r)).replace(/{url}/g,window.location),t("#chaty-form-"+c+"-"+e.channel_type+" .csass-whatsapp-input").val(l)}t("#chaty-form-"+c+"-"+e.channel_type).show()}(a,i);else{var f="";if(!E(a.pre_set_message)){f=decodeURI(a.pre_set_message);var v=t("title").text();f=(f=E(v)?f.replace(/{title}/g,""):f.replace(/{title}/g,v)).replace(/{url}/g,window.location),f=encodeURIComponent(f)}s?(a.target="",a.url="https://wa.me/"+a.value+"?text="+f):(a.target="_blank",G(a.is_use_web_version)?a.url="https://wa.me/"+a.value+"?text="+f:a.url="https://web.whatsapp.com/?phone="+a.value+"&text="+f)}}else if("WeChat"==a.channel_type){E(a.qr_code_image_url)||(n=a,h="",null==(l=M(o=i))&&(l=-1),h+="",t("body").append(h),a.url="javascript:;",a.target="",p+=" has-chaty-box chaty-qr-code-form")}else if("Contact_Us"==a.channel_type){r=a,y="",null==(g=M(d=i))&&(g=-1),y+="",t("body").append(y),a.url="javascript:;",a.target="",p+=" has-chaty-box chaty-contact-us-form"}else if("Email"==a.channel_type){if(!E(a.mail_subject)){var m=decodeURI(a.mail_subject),v=t("title").text();m=(m=E(v)?m.replace(/{title}/g,""):m.replace(/{title}/g,v)).replace(/{url}/g,window.location),m=encodeURIComponent(m),a.url+="?subject="+m}}else"Viber"==a.channel_type?(a.value=B(a.value,"+"),s&&!isNaN(a.value)&&navigator.userAgent.match(/(iPod|iPhone|iPad)/)&&(a.value="+"+a.value),a.url="viber://chat?number="+a.value,a.target=""):"Vkontakte"==a.channel_type&&(a.url="https://vk.me/"+t.trim(a.value));u="Link"==a.channel||"Custom_Link"==a.channel||"Custom_Link_3"==a.channel||"Custom_Link_4"==a.channel||"Custom_Link_5"==a.channel?E(a.hover_text)?a.channell:a.hover_text:a.channel;var w="";return E(a.click_event)||(w='onclick="'+a.click_event+'"',a.target="",a.url="javascript:;"),""+e+""}function _(t){return new DOMParser().parseFromString(t,"text/html").documentElement.textContent}function M(a){var e=null;return i.length&&t.each(i,function(t,c){c.id==a&&(e=t)}),e}function E(a){return null==a||""==a||""==t.trim(a)}function P(t){return""!=t.custom_image_url&&"null"!=t.custom_image_url?""+t.hover_text+"":""+t.svg_icon+""}function U(a){return""==a||""==t.trim(a)||null==a||"null"==a}function L(t){return"custom"==t.position?t.custom_position:t.position}function I(){jQuery(".chaty.active .chaty-open").length&&jQuery(".chaty.active .chaty-open").each(function(){jQuery(this).find(".chaty-cta-close").trigger("click")})}function V(){y&&t(".on-chaty-exit-intent").length&&t(".on-chaty-exit-intent").each(function(){var a=t(this).data("id");t(this).removeClass("on-chaty-exit-intent"),W(a),t("#chaty-widget-"+a+" .chaty-widget").append("
"),setTimeout(function(){t(".chaty-exit-intent").addClass("animate"),setTimeout(function(){t(".chaty-exit-intent").removeClass("animate")},2500)},500)})}function W(a){k(a),t(".chaty-widget-"+a).removeClass("on-chaty-delay"),t(".chaty-widget-"+a).removeClass("on-chaty-exit-intent"),t(".chaty-widget-"+a).removeClass("on-chaty-scroll"),t(".chaty.on-chaty-delay").length||(clearInterval(e),l=!1),t(".chaty.on-chaty-exit-intent").length||(y=!1),t(".chaty.on-chaty-scroll").length||(d=!1)}function q(t){for(t=t.toString();t.length<2;)t="0"+t;return t}function O(t){return!0}function G(t){return"1"==t||1==t||!0==t||"true"==t||"yes"==t||"on"==t}function F(t,a){if(isNaN(a)){var e=new Date(t.toLocaleString("en-US",{timeZone:a})),c=t.getTime()-e.getTime();return new Date(t.getTime()-c)}var i=new Date;if(i=i.toLocaleString("en-US",{timeZone:"UTC"}),i=new Date(i),-1!=a.indexOf("+")){var n=a.replace("+",""),s=parseInt(n),o=60*parseFloat(n%s);(o=i.getUTCMinutes()+o)>59&&(s+=parseInt(o/60),o%=60),i.setUTCHours(i.getUTCHours()+s,o)}else if(-1!=a.indexOf("-")){var n=a.replace("-",""),s=parseInt(n),o=60*parseFloat(n%s);(o=i.getUTCMinutes()-o)<0&&(s-=parseInt(o/60),o%=60),i.setUTCHours(i.getUTCHours()-s,-o)}var c=t.getTime()-i.getTime();return new Date(t.getTime()-c)}function D(t){return!0}function H(t){return!0}function N(t,a){var e=X("chatyWidget_"+t),c=[];null!=e&&""!=e&&(c=JSON.parse(e));var i=!1;if(c.length>0)for(var n=0;n0){for(var n=0;n=2))return!1}return!0}function R(t,a,e){var c=new Date;c.setTime(c.getTime()+864e5*e);var i="expires="+c.toUTCString();document.cookie=t+"="+a+"; "+i+"; path=/; SameSite=Lax"}function X(t){for(var t=t+"=",a=document.cookie.split(";"),e=0;e1&&(e=e[1])&&(""==(e=e.toUpperCase())&&(e="-"),a=e,"undefined"!=typeof Storage?null==window.sessionStorage.getItem("chaty_user_country_code")&&window.sessionStorage.setItem("chaty_user_country_code",a):J("chaty_user_country_code")||R("chaty_user_country_code",a,365),$())}):$()),t(window).height()>t(window).width()?t("body").addClass("cht-portrait").removeClass("cht-landscape"):t("body").addClass("cht-landscape").removeClass("cht-portrait"),t(document).on("click","html, body",function(a){t(".form-open").removeClass("form-open"),t(".chaty-outer-forms").removeClass("active"),t(".chaty .chaty-widget.chaty-no-close-button").addClass("chaty-open")}),t(document).on("click",".chaty, .chaty-outer-forms",function(t){t.stopPropagation()}),t(document).on("click",".chaty-close-view-list",function(){t(this).closest(".chaty").find(".chaty-widget").removeClass("chaty-open")}),t(document).on("submit",".whatsapp-chaty-form",function(){if(t(this).hasClass("form-google-analytics")){var a="Whatsapp";if(window.hasOwnProperty("gtag")&>ag("event","chaty_"+a,{eventCategory:"chaty_"+a,event_action:"chaty_"+a,method:"chaty_"+a}),window.hasOwnProperty("ga")){var e=window.ga.getAll()[0];e&&e.send("event","click",{eventCategory:"chaty_"+a,eventAction:"chaty_"+a,method:"chaty_"+a})}}var c=t(this).data("widget"),i=t(this).data("channel"),n=Y(c,"c-"+i);N(c,"c-"+i),(!E(c)||0==c)&&n&&N(c,"c-"+i),t("#chaty-widget-"+c).length&&(t("#chaty-widget-"+c).removeClass("form-open"),t(this).closest(".chaty-outer-forms").removeClass("active"),t("#chaty-widget-"+c).find(".chaty-widget").hasClass("cssas-no-close-button")&&t("#chaty-widget-"+c).find(".chaty-widget").addClass("chaty-open"))}),t(document).on("click",".chaty-close-button, .chaty-close-agent-list",function(a){a.preventDefault(),a.stopPropagation();var e=t(this).closest(".chaty-outer-forms").data("widget");if((!E(e)||0==e)&&(t("#chaty-widget-"+e).length&&(t("#chaty-widget-"+e).removeClass("form-open"),t(this).closest(".chaty-outer-forms").removeClass("active"),t("#chaty-widget-"+e).find(".chaty-widget").hasClass("chaty-no-close-button")&&t("#chaty-widget-"+e).find(".chaty-widget").addClass("chaty-open")),t(this).closest(".chaty-whatsapp-form").length)){var c=t(this).closest(".chaty-outer-forms").data("channel");!E(c)&&Y(e,"c-"+c)&&N(e,"c-"+c),Y(e,"v-widget")&&k(e)}}),t(document).on("click","a.chaty-qr-code-form",function(a){a.preventDefault();var e=t(this).data("form");if(!E(e)&&t("#"+e).length){var c=t(this).html();t("#"+e).hasClass("active")?(t(this).closest(".chaty").find(".chaty-widget").addClass("chaty-open"),t(this).closest(".chaty").removeClass("form-open"),t("#"+e).removeClass("active")):(t(this).closest(".chaty").find(".chaty-widget").removeClass("chaty-open"),t(this).closest(".chaty").addClass("form-open"),t("#"+e).addClass("active"),t(this).closest(".chaty").find(".open-chaty-channel").html(c))}}),t(document).on("click","a.chaty-contact-us-form",function(a){a.preventDefault();var e=t(this).data("form");if(!E(e)&&t("#"+e).length){""!=googleV3Token&&(googleV3Token="",refreshG3Token());var c=t(this).html();t("#"+e).hasClass("active")?(t(this).closest(".chaty").find(".chaty-widget").addClass("chaty-open"),t(this).closest(".chaty").removeClass("form-open"),t("#"+e).removeClass("active")):(t(this).closest(".chaty").find(".chaty-widget").removeClass("chaty-open"),t(this).closest(".chaty").addClass("form-open"),t("#"+e).addClass("active"),t("#"+e).find(".chaty-ajax-success-message").remove(),t("#"+e).find(".chaty-ajax-error-message").remove(),t("#"+e).find(".has-chaty-error").removeClass("has-chaty-error"),t(this).closest(".chaty").find(".open-chaty-channel").html(c))}}),t(document).on("click","a.chaty-whatsapp-form",function(a){a.preventDefault();var e=t(this).data("form");if(!E(e)&&t("#"+e).length){var c=t(this).html();t("#"+e).addClass("is-active"),t("#"+e).hasClass("active")?(t(this).closest(".chaty").find(".chaty-widget").addClass("chaty-open"),t(this).closest(".chaty").removeClass("form-open"),t("#"+e).removeClass("active")):(t(this).closest(".chaty").find(".chaty-widget").removeClass("chaty-open"),t(this).closest(".chaty").addClass("form-open"),t("#"+e).addClass("active"),t(this).closest(".chaty").find(".chaty-widget").find(".open-chaty-channel").html(c))}}),t(document).on("click",".chaty-channel.chaty-agent-button",function(a){a.preventDefault();var e=t(this).data("form");if(!E(e)&&t("#"+e).length){if(t(this).closest(".chaty").find(".chaty-widget").hasClass("has-single")){if(t(this).closest(".chaty").hasClass("form-open"))t(this).closest(".chaty").find(".chaty-widget").addClass("chaty-open"),t(this).closest(".chaty").removeClass("form-open"),t("#"+e).removeClass("active");else{var c=t(this).html();t("#"+e).addClass("is-active"),t(this).closest(".chaty").find(".chaty-widget").removeClass("chaty-open"),t(this).closest(".chaty").addClass("form-open"),t("#"+e).addClass("active"),t(this).closest(".chaty").find(".open-chaty-channel").html(c)}}else{var c=t(this).html();t("#"+e).addClass("is-active"),t(this).closest(".chaty").find(".chaty-widget").removeClass("chaty-open"),t(this).closest(".chaty").addClass("form-open"),t("#"+e).addClass("active"),t(this).closest(".chaty").find(".open-chaty-channel").html(c)}}}),t(document).on("click",".chaty-channel a.has-gae",function(e){e.stopPropagation();var c=t(this).closest(".chaty-channel").data("channel");if(c!==a&&""!=c&&null!=c&&(window.hasOwnProperty("gtag")&>ag("event","chaty_"+c,{eventCategory:"chaty_"+c,event_action:"chaty_"+c,method:"chaty_"+c}),window.hasOwnProperty("ga"))){var i=window.ga.getAll()[0];i&&i.send("event","click",{eventCategory:"chaty_"+c,eventAction:"chaty_"+c,method:"chaty_"+c})}}),t(document).on("mouseover",".chaty-widget.has-single .chaty-channel a.has-on-hover[data-hover]",function(){t(this).find(".on-hover-text").html(t(this).data("hover")),t(this).attr("aria-label",t(this).data("hover"))}).on("mouseleave",".chaty-widget.has-single .chaty-channel a.has-on-hover[data-text]",function(){t(this).find(".on-hover-text").html(t(this).data("text")),t(this).attr("aria-label",t(this).data("text"))}),t(document).on("submit",".whatsapp-chaty-form.has-form-gae",function(){var e=t(this).data("widget"),c=t("#Whatsapp-"+e+"-channel").data("channel");if(c!==a&&""!=c&&null!=c&&(window.hasOwnProperty("gtag")&>ag("event","chaty_whatsapp_redirect",{eventCategory:"chaty_whatsapp_redirect",event_action:"chaty_whatsapp_redirect",method:"chaty_whatsapp_redirect"}),window.hasOwnProperty("ga"))){var i=window.ga.getAll()[0];i&&i.send("event","click",{eventCategory:"chaty_whatsapp_redirect",eventAction:"chaty_whatsapp_redirect",method:"chaty_whatsapp_redirect"})}}),t(document).on("click",".chaty-i-trigger:not(.single-channel)",function(){t(this).closest(".chaty").hasClass("form-open")?(t(this).closest(".chaty").removeClass("form-open"),t(this).closest(".chaty-widget").addClass("chaty-open")):t(this).closest(".chaty-widget").toggleClass("chaty-open"),t(".chaty-outer-forms.active").each(function(){t(this).removeClass("active");var a=t(this).data("widget");t("#chaty-widget-"+a).removeClass("form-open")}),t(this).closest(".chaty").find(".chaty-widget").hasClass("chaty-no-close-button")&&t(this).closest(".chaty").find(".chaty-widget").addClass("chaty-open")}),s||t(document).on("mouseover","body:not(.chaty-in-mobile) .chaty.open-on-hover .chaty-i-trigger:not(.single-channel)",function(){t(this).closest(".chaty-widget").hasClass("chaty-open")||t(this).closest(".chaty-widget").hasClass("on-chaty-widget")||(t(this).closest(".chaty-widget").addClass("on-chaty-widget"),t(this).find(".chaty-cta-main").trigger("click"))}).on("mouseleave","body:not(.chaty-in-mobile) .chaty.open-on-hover .chaty-i-trigger:not(.single-channel)",function(){t(this).closest(".chaty-widget").hasClass("chaty-open")||t(this).closest(".chaty-widget").removeClass("on-chaty-widget")}),t(document).on("click",".chaty-channel.single a",function(){if(t(this).closest(".chaty").hasClass("first_click")){var a=t(this).closest(".chaty").data("id");N(a,"c-widget"),t(this).closest(".chaty-channel").removeClass("active")}}),t(document).on("click",".chaty-channel",function(a){var e,c,i,n=[],s=t(this).closest(".chaty").data("id");void 0!==s&&void 0!==(i=t("#chaty-widget-"+s).data("identifier"))&&(t("#chaty-widget-"+s).data("user"),w(s),t(this).hasClass("chaty-cta-main")||t(this).hasClass("chaty-cta-close")?(e=Y(s,"c-widget"),t("#chaty-widget-"+s).find(".ch-pending-msg").remove(),e&&(N(s,"c-widget"),t(this).hasClass("chaty-cta-main")&&(n=[],t("#chaty-widget-"+s).hasClass("chaty-has-chat-view")?t(".chaty-chat-view.chaty-chat-view-"+s+" .chaty-view-channels").find(".chaty-channel").each(function(){c=t(this).data("channel"),(e=Y(s,"v-"+c))&&void 0!==c&&(N(s,"v-"+c),n.push(c))}):t("#chaty-widget-"+s+" .chaty-channel-list").find(".chaty-channel").each(function(){c=t(this).data("channel"),(e=Y(s,"v-"+c))&&void 0!==c&&(N(s,"v-"+c),n.push(c))}))),t("#chaty-widget-"+s).hasClass("first_click")&&(t("#chaty-widget-"+s+" .chaty-cta-main").removeClass("active"),t("#chaty-widget-"+s+" .chaty-cta-main").removeClass("chaty-tooltip"))):t(this).hasClass("single")?(t("#chaty-widget-"+s).find(".ch-pending-msg").remove(),e=Y(s,"c-widget"),t("#chaty-widget-"+s).hasClass("first_click")&&(t("#chaty-widget-"+s+" .chaty-tooltip").removeClass("chaty-tooltip"),t("#chaty-widget-"+s+" .single-channel a").addClass("chaty-tooltip"))):t(this).hasClass("chaty-channel")&&(c=t(this).data("channel"),(e=Y(s,"c-"+c))&&N(s,"c-"+c)))}),t(document).on("submit",".chaty-ajax-contact-form",function(a){a.preventDefault();var e=0;if(t(this).find(".has-chaty-error").each(function(){t(this).removeClass("has-chaty-error")}),t(this).find(".chaty-error-msg").remove(),t(this).find(".chaty-ajax-error-message").remove(),t(this).find(".chaty-ajax-success-message").remove(),t(this).find(".is-required").each(function(){""==jQuery.trim(t(this).val())&&(e++,t(this).addClass("has-chaty-error"))}),0==e){var c=t(this);t(".chaty-submit-button").attr("disabled",!0),t("#chaty-submit-button-"+c.data("index")+" .chaty-loader").addClass("active"),jQuery.ajax({url:chaty_settings.ajax_url,data:{action:"chaty_front_form_save_data",name:c.find(".field-name").length?c.find(".field-name").val():"",email:c.find(".field-email").length?c.find(".field-email").val():"",phone:c.find(".field-phone").length?c.find(".field-phone").val():"",message:c.find(".field-message").length?c.find(".field-message").val():"",nonce:c.data("token"),channel:c.data("channel"),widget:c.data("index"),ref_url:window.location.href,token:googleV3Token,page_id:chaty_settings.page_id,page_title:b(),v2token:c.find(".g-recaptcha-response").length?c.find(".g-recaptcha-response").val():""},type:"post",async:!0,defer:!0,dataType:"json",success:function(a){if(""!=googleV3Token&&(googleV3Token="",refreshG3Token()),t(".chaty-ajax-error-message").remove(),t(".chaty-ajax-success-message").remove(),t(".chaty-submit-button").attr("disabled",!1),1==a.status)t("#chaty-submit-button-"+c.data("index")+" .chaty-loader").removeClass("active"),t(".chaty-contact-inputs").append("
"+a.message+"
"),t(".field-name, .field-email, .field-message, .field-phone").val(""),"yes"==a.redirect_action&&("yes"==a.link_in_new_tab?window.open(a.redirect_link,"_blank"):window.location=a.redirect_link),"yes"==a.close_form_after&&setTimeout(function(){if(t(".chaty-outer-forms.active").length){var a=t(".chaty-outer-forms.active").data("widget");(!E(a)||0==a)&&t("#chaty-widget-"+a).length&&(t("#chaty-widget-"+a).removeClass("form-open"),t(".chaty-outer-forms.active").removeClass("active"),t("#chaty-widget-"+a).find(".chaty-widget").hasClass("chaty-no-close-button")&&t("#chaty-widget-"+a).find(".chaty-widget").addClass("chaty-open"))}},1e3*parseInt(a.close_form_after_seconds));else if(1==a.error){if(a.errors.length)for(var e=0;e"+a.errors[e].message+"");t(".chaty-loader").removeClass("active")}else 0==a.status&&(t(".chaty-contact-inputs").append("
"+a.message+"
"),t(".chaty-loader").removeClass("active"))}})}else t(".has-chaty-error:first").focus();return!1}),t(document).on("click",".chaty-widget.has-single .chaty-i-trigger .chaty-channel:not(.chaty-agent-button).Phone-channel",function(){window.location=t(this).find("a").prop("href")}),t(document).on("click",".chaty-widget.has-single .chaty-i-trigger .chaty-channel:not(.chaty-agent-button).Phone-channel a",function(t){t.stopPropagation(),t.stopImmediatePropagation()})}),t(window).resize(function(){t(window).height()>t(window).width()?t("body").addClass("cht-portrait").removeClass("cht-landscape"):t("body").addClass("cht-landscape").removeClass("cht-portrait")})});var googleV3Token="";function onloadCallbackChatyV3(){var t=jQuery(".v3_site_key").val();t&&""==googleV3Token&&grecaptcha.ready(function(){grecaptcha.execute(t,{action:"contact_form"}).then(function(t){googleV3Token=t})})}function refreshG3Token(){if("function"==typeof grecaptcha||"object"==typeof grecaptcha){var t=jQuery(".v3_site_key").val();t&&""==googleV3Token&&grecaptcha.ready(function(){grecaptcha.execute(t,{action:"contact_form"}).then(function(t){googleV3Token=t})})}}function onloadChatyCallback(){jQuery(".v2_site_key").length&&""!=jQuery(".v2_site_key").val()&&jQuery(".front-google-captcha").length&&jQuery(".front-google-captcha:not(.loaded)").each(function(){var t=jQuery(this).attr("id");jQuery(this).addClass("loaded"),document.getElementById(t)&&grecaptcha.render(t,{sitekey:jQuery(".v2_site_key").val()})})}