芝麻web文件管理V1.00
编辑当前文件:/home/royashxg/www/wp-content/plugins/chaty/admin/assets/js/preview.min.js
var previewChannelList=[],advanceCustomCSS="",chtIframeData="";function change_custom_preview(){var a=[];if(jQuery("#channels-selected-list > li.chaty-channel").each((function(){a.push(jQuery(this).attr("data-id"))})),a=a.join(","),jQuery("#cht_numb_slug").val(a),jQuery(".main .channels-icons > .icon.custom-link").length!=jQuery(".main .channels-icons > .icon.custom-link.active").length&&jQuery(".custom-channel-button").show(),jQuery("#trigger_on_time").is(":checked")?jQuery("#chaty_trigger_time").prop("disabled",!1):jQuery("#chaty_trigger_time").prop("disabled",!0),jQuery("#chaty_trigger_on_scroll").is(":checked")?jQuery("#chaty_trigger_on_page_scroll").prop("disabled",!1):jQuery("#chaty_trigger_on_page_scroll").prop("disabled",!0),"open"==jQuery("#chaty_default_state").val()&&jQuery("#channel-list > .icon.active").length>1?(jQuery("#chaty_attention_effect").val(""),jQuery("#chaty_attention_effect, .test_textarea").attr("disabled",!0),jQuery("#chaty_attention_effect option:first-child").text("Doesn't apply for the open state"),"Doesn't apply for the open state"!=jQuery(".test_textarea").val()&&jQuery(".test_textarea").attr("data-value",jQuery(".test_textarea").val().toHtmlEntities()),jQuery(".test_textarea").val("Doesn't apply for the open state"),jQuery("#cht_number_of_messages").attr("disabled",!0),jQuery("#cht_pending_messages").attr("disabled",!0),jQuery(".disable-message").addClass("label-tooltip").addClass("icon"),jQuery("#cht_pending_messages").attr("checked",!1),jQuery(".pending-message-items").removeClass("active"),jQuery("#cta-action input").attr("disabled",!0)):(jQuery("#chaty_attention_effect, .test_textarea").attr("disabled",!1),jQuery("#chaty_attention_effect option:first-child").text("None"),jQuery(".test_textarea").attr("placeholder",""),"Doesn't apply for the open state"==jQuery(".test_textarea").val()&&jQuery(".test_textarea").val(jQuery(".test_textarea").attr("data-value")),jQuery("#cht_number_of_messages").attr("disabled",!1),jQuery("#cht_pending_messages").attr("disabled",!1),jQuery(".disable-message").removeClass("label-tooltip").removeClass("icon"),jQuery("#cta-action input").attr("disabled",!1)),jQuery(".chaty-bg-color").length&&jQuery(".chaty-bg-color").each((function(){"Instagram"==jQuery(this).closest(".chaty-channel").data("channel")?"#ffffff"!=jQuery(this).val()&&jQuery(this).closest("li.chaty-channel").find(".chaty-main-svg").find(".color-element").attr("fill",jQuery(this).val()):jQuery(this).closest("li.chaty-channel").find(".chaty-main-svg").find(".color-element").attr("fill",jQuery(this).val())})),jQuery(".agent-icon-color").length&&jQuery(".agent-icon-color").each((function(){"Instagram"==jQuery(this).closest(".chaty-channel").data("channel")?"#ffffff"!=jQuery(this).val()&&jQuery(this).closest("li.chaty-channel").find(".chaty-main-svg").find(".color-element").attr("fill",jQuery(this).val()):jQuery(this).closest("li.chaty-channel").find(".chaty-main-svg").find(".color-element").attr("fill",jQuery(this).val())})),jQuery(".chaty-preview").height(234),jQuery(".chaty-preview").html(""),previewChannelList=[],!!jQuery("#previewDesktop").is(":checked")?jQuery("#admin-preview .page").removeClass("mobile"):jQuery("#admin-preview .page").addClass("mobile"),jQuery("#channels-selected-list > li:not(.chaty-cls-setting)").length>=2?jQuery("#chaty-social-close").show():jQuery("#chaty-social-close").hide(),jQuery(".csaas-outer-forms").remove(),"open"==jQuery("#chaty_default_state").val()?jQuery(".hide-show-button").addClass("active"):jQuery(".hide-show-button").removeClass("active"),0==jQuery("#channel-list .icon.active").length?jQuery(".channel-empty-state").addClass("active"):jQuery(".channel-empty-state").removeClass("active"),jQuery("#channels-selected-list > li").length>0){advanceCustomCSS="";var e=getActiveChannels();if(e){e<=1&&"chat-view"!=jQuery("input[name='cta_type']:checked").val()?jQuery(".chaty-widget-color").addClass("hidden"):jQuery(".chaty-widget-color").removeClass("hidden"),jQuery("#whatsapp_embedded_window_Whatsapp").length&&jQuery("#whatsapp_embedded_window_Whatsapp").is(":checked")&&jQuery(".chaty-widget-color").removeClass("hidden"),jQuery("#upload_qr_code_val-WeChat").length&&""!=jQuery("#upload_qr_code_val-WeChat").val()&&jQuery(".chaty-widget-color").removeClass("hidden"),jQuery("#chaty-social-Contact_Us").length&&jQuery(".chaty-widget-color").removeClass("hidden");var s=getWidgetPosition();s="right"==s?"right":"left";var t=getToolTipPosition();if("chat-view"==jQuery("input[name='cta_type']:checked").val()){var c="
";jQuery(".chaty-preview").append(c),makeChatyChatView()}else{c="
";jQuery(".chaty-preview").append(c)}if(1==previewChannelList.length&&"chat-view"!=jQuery("input[name='cta_type']:checked").val()){var i=getChannelSetting(previewChannelList[0],0,t);jQuery("#csaas-widget-0 .csaas-i-trigger").html(i),jQuery("#csaas-widget-0 .csaas-i-trigger").addClass("single-channel"),jQuery("#csaas-widget-0 .csaas-i-trigger .csaas-channel").addClass("single"),jQuery("#csaas-widget-0 .csaas-widget").addClass("has-single"),isEmpty(r=jQuery(".test_textarea").val())||(r=htmlDecode(r)),isEmpty(r)||(jQuery("#csaas-widget-0 .csaas-tooltip").removeClass("csaas-tooltip"),jQuery("#csaas-widget-0 .csaas-i-trigger .csaas-channel").attr("data-hover",r.toHtmlEntities()),jQuery("#csaas-widget-0 .csaas-i-trigger .csaas-channel").addClass("active").addClass("csaas-tooltip").addClass(t),jQuery("#csaas-widget-0 .csaas-i-trigger .csaas-channel").addClass("active").addClass("csaas-tooltip").addClass("pos-"+t),jQuery("#csaas-widget-0 .csaas-i-trigger .csaas-channel").append("
"+r.toHtmlEntities()+"
").addClass("active").addClass("has-on-hover"),jQuery("#csaas-widget-0 .csaas-i-trigger .csaas-channel a").append("
"+r.toHtmlEntities()+"
").addClass("has-on-hover"));var n='
Hide csaas
';jQuery("#csaas-widget-0 .csaas-i-trigger").append(n)}else{for(v=0;v
'+r.toHtmlEntities()+'
'+l+'
';jQuery("#csaas-widget-0 .csaas-i-trigger").html(d);var u=jQuery("input[name='cht_close_button_text']").val();isEmpty(u)||(u=htmlDecode(u));n='
';jQuery("#csaas-widget-0 .csaas-i-trigger").append(n)}"open"==jQuery("#chaty_default_state").val()&&1!=previewChannelList.length||(checkForPendingMessage(),checkForWidgetAnimation());var g=0;"open"!=jQuery("#chaty_default_state").val()||jQuery("#cht_close_button").is(":checked")||"simple-view"!=jQuery("input[name='cta_type']:checked").val()||(jQuery("#csaas-widget-0 .csaas-widget").addClass("csaas-no-close-button"),g=1),"hover"==jQuery("#chaty_default_state").val()?jQuery("#csaas-widget-0").addClass("open-on-hover"):"open"==jQuery("#chaty_default_state").val()&&(jQuery("#csaas-widget-0 .csaas-widget").addClass("default-open"),jQuery("#csaas-widget-0 .csaas-widget:not(.has-single)").addClass("csaas-open"),jQuery("#cht_close_button").is(":checked")||jQuery("#csaas-widget-0 .csaas-widget:not(.has-single)").addClass("csaas-open"));var p=parseInt(2*jQuery("#custom-widget-size-input").val()/3);if(advanceCustomCSS+="#csaas-widget-0 .csaas-channel-list .csaas-channel {width: "+p+"px; height: "+p+"px; }",advanceCustomCSS+="#csaas-widget-0 .csaas-channel-list .csaas-channel .custom-csaas-image {width: "+p+"px; height: "+p+"px; }",advanceCustomCSS+="#csaas-widget-0 .csaas-channel-list .facustom-icon { width: "+p+"px; height: "+p+"px; line-height: "+p+"px; font-size:"+parseInt(p/2)+"px; text-align: center; }",advanceCustomCSS+="#csaas-widget-0 .csaas-channel-list .csaas-channel a img {width: "+p+"px; height: "+p+"px; }",advanceCustomCSS+="#csaas-widget-0 .csaas-channel-list .csaas-channel a {width: "+p+"px; height: "+p+"px; }",advanceCustomCSS+="#csaas-widget-0 .csaas-channel-list .csaas-channel .csaas-custom-icon {display:block; width: "+p+"px; height: "+p+"px; line-height: "+p+"px; font-size: "+parseInt(p/2)+"px; }",advanceCustomCSS+="#csaas-widget-0 .csaas-channel-list .csaas-channel button {width: "+p+"px; height: "+p+"px; }",advanceCustomCSS+="#csaas-widget-0 .csaas-channel-list .csaas-channel .csaas-svg {width: "+p+"px; height: "+p+"px; }",advanceCustomCSS+="#csaas-widget-0 .csaas-channel-list .csaas-channel .custom-agent-image {width: "+p+"px; height: "+p+"px; }",advanceCustomCSS+="#csaas-widget-0 .csaas-channel-list .csaas-channel .facustom-icon {width: "+p+"px; height: "+p+"px; }",advanceCustomCSS+="#csaas-widget-0 .csaas-channel-list .csaas-channel .custom-agent-image img {width: "+p+"px; height: "+p+"px; }",advanceCustomCSS+="#csaas-widget-0 .csaas-channel-list .csaas-channel .csaas-svg img {width: "+p+"px; height: "+p+"px; }",advanceCustomCSS+="#csaas-widget-0 .csaas-channel-list .csaas-channel .csaas-svg .csaas-custom-channel-icon {width: "+p+"px; height: "+p+"px; line-height: "+p+"px; display: block; font-size:"+parseInt(p/2)+"px; }",advanceCustomCSS+="#csaas-widget-0 .csaas-channels .csaas-channel {width: "+p+"px; height: "+p+"px; }",advanceCustomCSS+="#csaas-widget-0 .csaas-channels .csaas-channel .custom-csaas-image {width: "+p+"px; height: "+p+"px; }",advanceCustomCSS+="#csaas-widget-0 .csaas-channels .facustom-icon { width: "+p+"px; height: "+p+"px; line-height: "+p+"px; font-size:"+parseInt(p/2)+"px; text-align: center; }",advanceCustomCSS+="#csaas-widget-0 .csaas-channels .csaas-channel a img {width: "+p+"px; height: "+p+"px; }",advanceCustomCSS+="#csaas-widget-0 .csaas-channels .csaas-channel a {width: "+p+"px; height: "+p+"px; }",advanceCustomCSS+="#csaas-widget-0 .csaas-channels .csaas-channel .csaas-custom-icon {display:block; width: "+p+"px; height: "+p+"px; line-height: "+p+"px; font-size: "+parseInt(p/2)+"px; }",advanceCustomCSS+="#csaas-widget-0 .csaas-channels .csaas-channel button {width: "+p+"px; height: "+p+"px; }",advanceCustomCSS+="#csaas-widget-0 .csaas-channels .csaas-channel .csaas-svg {width: "+p+"px; height: "+p+"px; }",advanceCustomCSS+="#csaas-widget-0 .csaas-channels .csaas-channel .custom-agent-image {width: "+p+"px; height: "+p+"px; }",advanceCustomCSS+="#csaas-widget-0 .csaas-channels .csaas-channel .facustom-icon {width: "+p+"px; height: "+p+"px; }",advanceCustomCSS+="#csaas-widget-0 .csaas-channels .csaas-channel .custom-agent-image img {width: "+p+"px; height: "+p+"px; }",advanceCustomCSS+="#csaas-widget-0 .csaas-channels .csaas-channel .csaas-svg img {width: "+p+"px; height: "+p+"px; }",advanceCustomCSS+="#csaas-widget-0 .csaas-channels .csaas-channel .csaas-svg .csaas-custom-channel-icon {width: "+p+"px; height: "+p+"px; line-height: "+p+"px; display: block; font-size:"+parseInt(p/2)+"px; }",advanceCustomCSS+=".csaas-outer-forms.active { bottom: "+(p+15+5)+"px; }","horizontal"==jQuery("input[name='chaty_icons_view']:checked").val()&&"simple-view"==jQuery("input[name='cta_type']:checked").val()){jQuery("#csaas-widget-0 .csaas-widget").addClass("hor-mode"),advanceCustomCSS+="#csaas-widget-0 .csaas-channel-list {width: "+e*(p+8)+"px; }",advanceCustomCSS+="#csaas-widget-0 .csaas-channel-list {height: "+p+"px; }";for(var v=0;v<=e;v++)advanceCustomCSS+="#csaas-widget-0 .csaas-widget.left-position.hor-mode.csaas-open .csaas-channel-list .csaas-channel:nth-child("+(v+1)+") {-webkit-transform: translateX("+(p+8)*(e-v-g)+"px); transform: translateX("+(p+8)*(e-v-g)+"px);}",advanceCustomCSS+="#csaas-widget-0 .csaas-widget.right-position.hor-mode.csaas-open .csaas-channel-list .csaas-channel:nth-child("+(v+1)+") {-webkit-transform: translateX(-"+(p+8)*(e-v-g)+"px); transform: translateX(-"+(p+8)*(e-v-g)+"px);}"}else{advanceCustomCSS+="#csaas-widget-0 .csaas-channel-list {height: "+e*(p+8)+"px; }",advanceCustomCSS+="#csaas-widget-0 .csaas-channel-list {width: "+(p+8)+"px; }";for(v=0;v<=e;v++)advanceCustomCSS+="#csaas-widget-0 .csaas-open .csaas-channel-list .csaas-channel:nth-child("+(v+1)+") {-webkit-transform: translateY(-"+(p+8)*(e-v-g)+"px); transform: translateY(-"+(p+8)*(e-v-g)+"px);}"}if(advanceCustomCSS+="#csaas-widget-0 .csaas-tooltip:after {background-color: "+jQuery("#cht_cta_bg_color").val()+"; color: "+jQuery("#cht_cta_text_color").val()+"}",advanceCustomCSS+="#csaas-widget-0 .csaas-tooltip.top:before {border-top-color: "+jQuery("#cht_cta_bg_color").val()+"; }",advanceCustomCSS+="#csaas-widget-0 .csaas-tooltip.left:before {border-left-color: "+jQuery("#cht_cta_bg_color").val()+"; }",advanceCustomCSS+="#csaas-widget-0 .csaas-tooltip.right:before {border-right-color: "+jQuery("#cht_cta_bg_color").val()+";}",advanceCustomCSS+="#csaas-widget-0 .on-hover-text {background-color: "+jQuery("#cht_cta_bg_color").val()+"; color: "+jQuery("#cht_cta_text_color").val()+"}",advanceCustomCSS+="#csaas-widget-0 .csaas-tooltip.top .on-hover-text:before {border-top-color: "+jQuery("#cht_cta_bg_color").val()+"; }",advanceCustomCSS+="#csaas-widget-0 .csaas-tooltip.left .on-hover-text:before {border-left-color: "+jQuery("#cht_cta_bg_color").val()+"; }",advanceCustomCSS+="#csaas-widget-0 .csaas-tooltip.right .on-hover-text:before {border-right-color: "+jQuery("#cht_cta_bg_color").val()+";}",advanceCustomCSS+="#csaas-form-0-csaas-chat-view .csaas-view-header {background-color: "+jQuery("#cta_header_bg_color").val()+";}",advanceCustomCSS+="#csaas-form-0-csaas-chat-view .csaas-view-header {color: "+jQuery("#cta_header_text_color").val()+";}",advanceCustomCSS+="#csaas-form-0-csaas-chat-view .csaas-view-header .csaas-close-view-list svg {fill: "+jQuery("#cta_header_text_color").val()+";}",advanceCustomCSS+="#csaas-submit-button-0 {color: "+jQuery("#button_text_color_for_Contact_Us").val()+" !important; background: "+jQuery("#button_bg_color_for_Contact_Us").val()+" !important;}",advanceCustomCSS+=".csaas-contact-form-box .csaas-contact-form-title {background-color: "+jQuery("#title_bg_color_for_Contact_Us").val()+";}",updateWidgetViews(),jQuery("#custom-css").html(""),jQuery(".csaas-outer-forms, .csaas-chat-view").show(),jQuery(".csaas-outer-forms, .csaas-chat-view").addClass(s),""!=jQuery("#cht_widget_font").val()){var y=jQuery("#cht_widget_font").val();"System Stack"==y&&(y="-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"),jQuery("#csaas-widget-0").css("font-family",y)}}}if(0!=imageDataEvent&&""!=jQuery("#testUpload").val()&&"chat-image"==jQuery("input[name='widget_icon']:checked").val()&&jQuery("#cta-image").length){var m=document.getElementById("cta-image");m.src=URL.createObjectURL(imageDataEvent.target.files[0]),m.onload=function(){URL.revokeObjectURL(m.src)}}}function makeChatyChatView(){var a=0;null==a&&(a=-1);htmlDecode(jQuery("#cta_body_text").val());var e="";e+="
",e+="
",e+="
"+htmlDecode(jQuery("#cta_heading_text").val()),e+="
",e+="
",e+="
",e+="
",e+=jQuery("#wp-cta_body_text-wrap").find("iframe").contents().find("body").html(),e+="
",e+="
",e+="
",e+="
",e+="
",e+="
",jQuery("#csaas-widget-0").append(e)}function myCustomOnChangeHandler(){change_custom_preview()}function htmlDecode(a){return(new DOMParser).parseFromString(a,"text/html").documentElement.textContent}function updateWidgetViews(){jQuery("#csaas-widget-0").addClass("active")}function checkForWidgetAnimation(){"none"!=jQuery("#chaty_attention_effect").val()&&""!=jQuery("#chaty_attention_effect").val()&&(jQuery("#csaas-widget-0").attr("data-animation",jQuery("#chaty_attention_effect").val()),jQuery("#csaas-widget-0 .csaas-widget").hasClass("has-single")?jQuery("#csaas-widget-0 .csaas-i-trigger .csaas-channel a").addClass("csaas-animation-"+jQuery("#chaty_attention_effect").val()):jQuery("#csaas-widget-0 .csaas-i-trigger .csaas-cta-main .csaas-cta-button").addClass("csaas-animation-"+jQuery("#chaty_attention_effect").val()))}function checkForPendingMessage(){if(jQuery("#cht_pending_messages").is(":checked")&&""!=jQuery("#cht_number_of_messages").val()){var a=jQuery("#chaty_attention_effect").val();jQuery("#csaas-widget-0 .csaas-widget").hasClass("has-single")?"bounce"==a||"jump"==a||"waggle"==a||"pulse"==a||"pulse-icon"==a||"floating"==a?jQuery("#csaas-widget-0 .csaas-i-trigger .csaas-channel a").append("
"+jQuery("#cht_number_of_messages").val()+"
"):jQuery("#csaas-widget-0 .csaas-i-trigger .csaas-channel a").after("
"+jQuery("#cht_number_of_messages").val()+"
"):"bounce"==a||"jump"==a||"waggle"==a||"pulse"==a||"pulse-icon"==a||"floating"==a?jQuery("#csaas-widget-0 .csaas-i-trigger .csaas-cta-main .csaas-cta-button").append("
"+jQuery("#cht_number_of_messages").val()+"
"):jQuery("#csaas-widget-0 .csaas-i-trigger .csaas-cta-main").append("
"+jQuery("#cht_number_of_messages").val()+"
"),jQuery(".ch-pending-msg").css("color",jQuery("#cht_number_color").val()),jQuery(".ch-pending-msg").css("background-color",jQuery("#cht_number_bg_color").val())}}function getCTAWidgetIcon(){var a="chat-base";if(""!=jQuery("input[name='widget_icon']:checked").val()&&(a=jQuery("input[name='widget_icon']:checked").val()),"chat-image"==a){if(jQuery("#elPreviewImage img").length)return"
";a="chat-base"}return'
'+getSvgIcon(a,jQuery("input[name='cht_color']:checked").val().toHtmlEntities())+"
"}function getSvgIcon(a,e){switch(a){case"chat-smile":return'
';case"chat-bubble":return'
';case"chat-db":return'
';default:return'
'}}function getChannelSetting(a,e,s){if(jQuery("#chaty-social-"+a).hasClass("has-agent-view"))return createAgentList(a,e),"
"+(c=getChannelURL(a,t=getChannelIcon(a,e),s,e))+"
";var t=getChannelIcon(a,e),c=getChannelURL(a,t,s,e);return"
"+c+"
"}function createAgentList(a,e){jQuery("#previewDesktop").is(":checked");var s="";s+="
",s+="
",s+="
",s+="
",s+="
",isEmpty(jQuery("#cht_social_agent_title_"+a).val())||(s+="
"+jQuery("#cht_social_agent_title_"+a).val().toHtmlEntities()+"
"),isEmpty(jQuery("#cht_social_agent_sub_title_"+a).val())||(s+="
"+jQuery("#cht_social_agent_sub_title_"+a).val().toHtmlEntities()+"
"),s+="
",jQuery("#chaty-social-"+a+" .chaty-agent-list .agent-list .agent-channel-setting").length&&jQuery("#chaty-social-"+a+" .chaty-agent-list .agent-list .agent-channel-setting").each((function(){var t=jQuery(this).data("item"),c=jQuery("#image_agent_data_"+a+"-"+t).html();c=jQuery("#image_agent_data_"+a+"-"+t).hasClass("img-active")?"
"+c+"
":jQuery("#image_agent_data_"+a+"-"+t).hasClass("icon-active")?"
"+c+"
":"
"+c+"
";var i=getAgentURL(a,e,t,c,jQuery("#agent-"+a+"-"+t+" .chaty-agent-name").val().toHtmlEntities());s+="
"+i+"
"})),s+="
",s+="
",s+="
",jQuery(".chaty-preview").append(s),jQuery(".csaas-agent-header.agent-info-"+e+"-"+a).css("background",jQuery("#agent_head_bg_color_"+a).val()),jQuery(".csaas-agent-header.agent-info-"+e+"-"+a).css("color",jQuery("#agent_head_text_color_"+a).val())}function getAgentURL(a,e,s,t,c){return"
"+t+"
"+c+"
"}function getChannelIcon(a,e){if(jQuery("#chaty-social-"+a).hasClass("has-agent-view")){if(jQuery("#image_agent_data_agent-"+a).length){s=jQuery("#image_agent_data_agent-"+a).html();return jQuery("#image_agent_data_agent-"+a).hasClass("icon-active")?"
"+s+"
":jQuery("#image_agent_data_agent-"+a).hasClass("img-active")?"
"+s+"
":"
"+s+"
"}}else if(jQuery("#chaty_image_"+a).length){var s=jQuery("#chaty_image_"+a).html();return jQuery("#chaty_image_"+a).hasClass("icon-active")?"
"+s+"
":jQuery("#chaty_image_"+a).hasClass("img-active")?"
"+s+"
":"
"+s+"
"}}function getChannelURL(a,e,s,t){var c="";return jQuery("#chaty-social-"+a).hasClass("has-agent-view")||("Whatsapp"==a?jQuery("#chaty-social-"+a+" .embedded_window-checkbox").is(":checked")&&""!=jQuery("#chaty-social-"+a+" .chaty-whatsapp-setting-textarea").val()&&(c+=" has-csaas-box csaas-whatsapp-form",startMakingWhatsAppPopup(a,t)):"WeChat"==a?jQuery(".remove-qr-code-"+a).hasClass("active")&&(c+=" has-csaas-box csaas-qr-code-form",startMakingWeChatChannel(a,0)):"Contact_Us"==a&&(c+=" has-csaas-box csaas-contact-us-form",startMakingContactForm(a,0))),jQuery("#chaty-social-"+a).hasClass("has-agent-view")?"
"+e+"
":"
"+e+"
"}function startMakingContactForm(a,e){var s="";s+="
",s+="
",s+="
",s+="
",s+="
",s+="
"+jQuery("#cht_social_message_"+a+"_form_title").val().toHtmlEntities()+"
",s+="
",jQuery("#chaty-social-Contact_Us .contact_form_custom_value").each((function(){jQuery(this).closest(".field-setting-col").find(".chaty-switch input[type='checkbox']").is(":checked")&&(s+="
",s+="
"+jQuery(this).closest(".field-setting-col").find(".label-input input").val()+"
",s+="
",s+="
","textarea"==jQuery(this).data("type")?s+="
</textarea>":"select"==jQuery(this).data("type")?s+="
"+jQuery(this).find("option:first-child").text()+"
":s+="
",s+="
")})),s+="
"+jQuery("#button_text_for_"+a).val().toHtmlEntities()+"
",s+="
",s+="
",s+="
",s+="
",s+="
",jQuery(".chaty-preview").append(s)}function startMakingWeChatChannel(a,e){var s="";s+="
",s+="
",s+="
",s+="
",s+="
",s+="
",s+="
",s+="
",jQuery(".chaty-preview").append(s)}function startMakingWhatsAppPopup(a,e){const s=new Date;var t=s.getMinutes()<10?"0"+s.getMinutes():s.getMinutes();const c=(s.getHours()<10?"0"+s.getHours():s.getHours())+":"+t;var i="";if(i+="
",i+="
",i+="
",i+="
",i+='
',i+="
",i+="
",i+=jQuery("#wp_popup_headline").val().toHtmlEntities(),i+="
",i+="
",i+='
',i+="
",i+="
",i+="
",""!=jQuery("#wp_popup_profile").val()&&(i+="
",i+="
",i+="
"),i+="
",i+="
"+jQuery("#wp_popup_nickname").val().toHtmlEntities()+"
",i+="
",i+="
"+c+"
",i+="
",i+="
",i+="",i+="
",i+="
",jQuery(".chaty-preview").append(i),jQuery("#csaas-form-"+e+"-"+a+" .csaas-whatsapp-message .csaas-whatsapp-message-content").html(jQuery(".chaty-whatsapp-setting-textarea").val()),!isEmpty(n=jQuery(".pre-set-message-whatsapp").val())){var n=jQuery(".pre-set-message-whatsapp").val().toHtmlEntities();jQuery("#csaas-form-"+e+"-"+a+" .csass-whatsapp-input").val(n)}isEmpty(jQuery(".chaty-whatsapp-setting-textarea").val())&&(jQuery("#csaas-form-"+e+"-"+a+" .wp-profile-img").remove(),jQuery("#csaas-form-"+e+"-"+a+" .csaas-whatsapp-message").remove()),jQuery("#chaty-form-"+e+"-"+a).show(),jQuery("#csaas_whatsapp_input").attr("placeholder",jQuery(".whatsapp-placeholder").val()),jQuery(".whatsapp-emoji").is(":checked")?jQuery(".csaas-whatsapp-field").addClass("has-emoji"):jQuery(".csaas-whatsapp-field").removeClass("has-emoji")}function isEmpty(a){return null==a||""==a||""==jQuery.trim(a)}function getWidgetPosition(){if("custom"==jQuery("input[name='cht_position']:checked").val()){if("left"==jQuery("input[name='positionSide']:checked").val())return"left"}else if("left"==jQuery("input[name='cht_position']:checked").val())return"left";return"right"}function getToolTipPosition(){var a=getWidgetPosition();return"vertical"==jQuery("input[name='chaty_icons_view']:checked").val()?"right"==a?"left":"right":previewChannelList.length>1?"top":"right"==a?"left":"right"}function getActiveChannels(){var a=0;if(jQuery("#channels-selected-list > li:not(.chaty-cls-setting)").length){var e=!!jQuery("#previewDesktop").is(":checked");jQuery("#channels-selected-list > li:not(.csaas-cls-setting)").each((function(){jQuery(this).hasClass("has-agent-view")?e&&jQuery(this).find(".agent-desktop-device").is(":checked")?(previewChannelList.push(jQuery(this).data("id")),a++):!e&&jQuery(this).find(".agent-mobile-device").is(":checked")&&(a++,previewChannelList.push(jQuery(this).data("id"))):(e&&jQuery(this).find(".js-chanel-desktop").is(":checked")||!e&&jQuery(this).find(".js-chanel-mobile").is(":checked"))&&(a++,previewChannelList.push(jQuery(this).data("id")))}))}return a}jQuery(document).ready((function(){var a=jQuery("#wp-cta_body_text-wrap").find("iframe");chtIframeData=a.contents().find("body").html(),setInterval((function(){if(jQuery("#cta-option-chat-view").is(":checked")&&jQuery("#wp-cta_body_text-wrap").length){var a=jQuery("#wp-cta_body_text-wrap").find("iframe");bodyMsg=a.contents().find("body").html(),bodyMsg!=chtIframeData&&(chtIframeData=bodyMsg,change_custom_preview())}}),2e3),jQuery(document).on("click","#save-button",(function(){jQuery("#button_type").val(1)})),jQuery(document).on("click","#save-dashboard-button",(function(){jQuery("#button_type").val(2)})),jQuery(document).on("click",".custom-channel-button a.custom-channel-link",(function(a){a.preventDefault(),jQuery(".main .channels-icons > .icon.custom-link:not(.active):first").trigger("click"),jQuery(".main .channels-icons > .icon.custom-link").length==jQuery(".main .channels-icons > .icon.custom-link.active").length&&jQuery(".custom-channel-button").hide()})),jQuery(document).on("mouseover",".csaas.open-on-hover .csaas-i-trigger:not(.single-channel)",(function(){jQuery(this).closest(".csaas-widget").hasClass("csaas-open")||jQuery(this).closest(".csaas-widget").hasClass("on-csaas-widget")||(jQuery(this).closest(".csaas-widget").addClass("on-csaas-widget"),jQuery(this).find(".csaas-cta-main").trigger("click"))})).on("mouseleave",".csaas.open-on-hover .csaas-i-trigger:not(.single-channel)",(function(){jQuery(this).closest(".csaas-widget").hasClass("csaas-open")||jQuery(this).closest(".csaas-widget").removeClass("on-csaas-widget")})),jQuery(document).on("click",".csaas-close-view-list",(function(){jQuery(this).closest(".csaas").find(".csaas-widget").removeClass("csaas-open")})),jQuery(document).on("click",".csaas-i-trigger:not(.single-channel)",(function(){jQuery(this).closest(".csass").removeClass("form-open"),jQuery(this).closest(".csaas-widget:not(.has-single)").toggleClass("csaas-open"),jQuery(".csaas-outer-forms").removeClass("active"),jQuery(".form-open").removeClass("form-open"),jQuery(".chaty-preview").height(234)})),jQuery(document).on("click","#whatsapp_embedded_window_Whatsapp",(function(){change_custom_preview()})),jQuery(document).on("click","#cht_active",(function(){jQuery(this).is(":checked")?(jQuery("#chaty-turned-on").addClass("active"),jQuery("#chaty-turned-off").removeClass("active")):(jQuery("#chaty-turned-off").addClass("active"),jQuery("#chaty-turned-on").removeClass("active"))})),jQuery(document).on("click","a.csaas-whatsapp-form",(function(a){a.preventDefault();var e=jQuery(this).data("form");if(!isEmpty(e)&&jQuery("#"+e).length)if(jQuery(this).closest(".csaas").hasClass("form-open"))jQuery("#"+e).removeClass("is-active"),jQuery(this).closest(".csaas-widget:not(.has-single)").addClass("csaas-open"),jQuery(this).closest(".csaas").removeClass("form-open"),jQuery("#"+e).removeClass("active");else{var s=parseInt(2*jQuery("#custom-widget-size-input").val()/3),t=parseInt(jQuery("#"+e).height()/2)+s+20;t>234&&jQuery(".chaty-preview").height(t+10);var c=jQuery(this).closest(".csaas-widget").find(".csaas-cta-close").find("button").html();jQuery("#"+e).addClass("is-active"),jQuery(this).closest(".csaas-widget").removeClass("csaas-open"),jQuery(this).closest(".csaas").addClass("form-open"),jQuery("#"+e).addClass("active"),jQuery(this).closest(".csaas-widget").find(".open-csaas-channel").html(c)}})),jQuery(document).on("keyup",".whatsapp-placeholder",(function(){jQuery("#csaas_whatsapp_input").attr("placeholder",jQuery(this).val())})),jQuery(document).on("change",".whatsapp-placeholder",(function(){jQuery("#csaas_whatsapp_input").attr("placeholder",jQuery(this).val())})),jQuery(document).on("click",".whatsapp-emoji",(function(){jQuery(this).is(":checked")?jQuery(".csaas-whatsapp-field").addClass("has-emoji"):jQuery(".csaas-whatsapp-field").removeClass("has-emoji")})),jQuery(document).on("click",".csaas-close-button, .csaas-close-agent-list, .whatsapp-form-close-btn",(function(a){a.preventDefault(),a.stopPropagation(),jQuery(".csaas-outer-forms").removeClass("active"),jQuery("#csaas-widget-0").removeClass("form-open"),jQuery("#csaas-widget-0").find(".csaas-widget").hasClass("csaas-no-close-button")&&jQuery("#csaas-widget-0").find(".csaas-widget:not(.has-single)").addClass("csaas-open"),jQuery(".chaty-preview").height(234)})),jQuery(document).on("click","a.csaas-qr-code-form",(function(a){a.preventDefault();var e=jQuery(this).data("form");if(!isEmpty(e)&&jQuery("#"+e).length){var s=parseInt(2*jQuery("#custom-widget-size-input").val()/3),t=parseInt(jQuery("#"+e).height()/2)+s+20;t>234&&jQuery(".chaty-preview").height(t+10);var c=jQuery(this).closest(".csaas-widget").find(".csaas-cta-close").find("button").html();jQuery(this).closest(".csaas-widget").removeClass("csaas-open"),jQuery(this).closest(".csaas").addClass("form-open"),jQuery("#"+e).addClass("active"),jQuery(this).closest(".csaas-widget").find(".open-csaas-channel").html(c)}})),jQuery(document).on("click","a.csaas-contact-us-form",(function(a){a.preventDefault();var e=jQuery(this).data("form");if(!isEmpty(e)&&jQuery("#"+e).length){var s=parseInt(2*jQuery("#custom-widget-size-input").val()/3),t=parseInt(jQuery("#"+e).height()/2)+s+20;t>234&&(jQuery(".chaty-preview").height(t+10),jQuery(".preview .page").height(t+26));var c=jQuery(this).closest(".csaas-widget").find(".csaas-cta-close").find("button").html();jQuery(this).closest(".csaas-widget").removeClass("csaas-open"),jQuery(this).closest(".csaas").addClass("form-open"),jQuery("#"+e).addClass("active"),jQuery("#"+e).find(".csaas-ajax-success-message").remove(),jQuery("#"+e).find(".csaas-ajax-error-message").remove(),jQuery("#"+e).find(".has-csaas-error").removeClass("has-csaas-error"),jQuery(this).closest(".csaas-widget").find(".open-csaas-channel").html(c)}})),jQuery(document).on("click",".csaas-widget.has-single .csaas-i-trigger.single-channel .csaas-cta-close .csaas-cta-button",(function(){jQuery(this).closest(".csaas").removeClass("form-open"),jQuery(".csaas-outer-forms").removeClass("active")})),jQuery(document).on("keyup","#cht_social_message_Contact_Us_form_title",(function(){jQuery(".csaas-contact-form-title").text(jQuery(this).val().toHtmlEntities())})),jQuery(document).on("keyup","#button_text_for_Contact_Us",(function(){jQuery("#csaas-submit-button-0").text(jQuery(this).val().toHtmlEntities())})),jQuery(document).on("keyup","#cta_heading_text",(function(){jQuery(".csaas-view-header").text(jQuery(this).val().toHtmlEntities())})),jQuery(document).on("keyup","#cta_body_text",(function(){jQuery(".csaas-top-content").text(jQuery(this).val().toHtmlEntities())})),jQuery(document).on("change",".form-field-setting-col input[type='text'], .chaty-input-text",(function(){change_custom_preview()})),jQuery(document).on("click",".form-field-setting-col input[type='checkbox']",(function(){change_custom_preview()})),jQuery(document).on("change",".chaty-agent-name, #chaty_default_state, input[name='chaty_icons_view']:checked",(function(){change_custom_preview()})),jQuery(document).on("keyup","input[name='cht_close_button_text']",(function(){change_custom_preview()})),jQuery(document).on("change","input[name='cht_close_button_text']",(function(){change_custom_preview()})),jQuery(document).on("click",".chaty-preview input, .chaty-preview button",(function(a){a.preventDefault()})),jQuery(document).on("click",".csaas-channel.csaas-agent-button",(function(a){a.preventDefault();var e=jQuery(this).data("form");if(!isEmpty(e)&&jQuery("#"+e).length)if(jQuery(this).closest(".csaas").hasClass("form-open"))jQuery(this).closest(".csaas-widget:not(.has-single)").addClass("csaas-open"),jQuery(this).closest(".csaas").removeClass("form-open"),jQuery("#"+e).removeClass("active");else{var s=parseInt(2*jQuery("#custom-widget-size-input").val()/3),t=parseInt(jQuery("#"+e).height()/2)+s+20;t>234&&(jQuery(".chaty-preview").height(t+10),jQuery(".preview .page").height(t+26));var c=jQuery(this).closest(".csaas-widget").find(".csaas-cta-close").find("button").html();jQuery("#"+e).addClass("is-active"),jQuery(this).closest(".csaas-widget").removeClass("csaas-open"),jQuery(this).closest(".csaas").addClass("form-open"),jQuery("#"+e).addClass("active"),jQuery(this).closest(".csaas-widget").find(".open-csaas-channel").html(c)}})),jQuery(document).on("click","#trigger_on_time, #chaty_trigger_on_scroll, #cht_close_button",(function(){change_custom_preview()})),jQuery(".chaty-color-field.chaty-bg-color").trigger("change"),change_custom_preview()})),jQuery(window).on("load",(function(){jQuery(".chaty-color-field.chaty-bg-color").trigger("change")})),String.prototype.toHtmlEntities=function(){return this.replace(/./gm,(function(a){return a.match(/[a-z0-9\s]+/i)?a:""+a.charCodeAt(0)+";"}))},String.fromHtmlEntities=function(a){return(a+"").replace(/\d+;/gm,(function(a){return String.fromCharCode(a.match(/\d+/gm)[0])}))};