(()=>{var t;(t=jQuery)((function(){var e=window.location.href,c=void 0!==document.title?document.title:"",n="no";try{n=void 0!==navigator.userAgent&&navigator.userAgent.match(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i)?"yes":"no"}catch(t){}"no"==n&&(n=void 0!==screen.width&&screen.width>1025?"no":"yes");var a={};function _(){localStorage.getItem("ht_ctc_storage")&&(a=localStorage.getItem("ht_ctc_storage"),a=JSON.parse(a))}function o(t){return!!a[t]&&a[t]}function i(t,e){_(),a[t]=e;var c=JSON.stringify(a);localStorage.setItem("ht_ctc_storage",c)}_();var r="";!function(){if("undefined"!=typeof ht_ctc_chat_var)r=ht_ctc_chat_var;else try{if(document.querySelector(".ht_ctc_chat_data")){var e=t(".ht_ctc_chat_data").attr("data-settings");r=JSON.parse(e),window.ht_ctc_chat_var=r}}catch(t){r={}}}();var s,u={};function d(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"open";f(),t(".ctc_cta_stick").remove(),"init"==e?t(".ht_ctc_chat_greetings_box").show(70):t(".ht_ctc_chat_greetings_box").show(400),t(".ht_ctc_chat_greetings_box").addClass("ctc_greetings_opened").removeClass("ctc_greetings_closed"),i("g_action",e),"user_opened"==e&&i("g_user_action",e),function(){if(document.querySelector(".ctc_greetings_modal")&&!document.querySelector(".ht_ctc_modal_backdrop")){var t=document.createElement("div");t.className="ht_ctc_modal_backdrop",document.body.appendChild(t),t.addEventListener("click",(function(){h("user_closed")}))}}()}function l(){g(),setTimeout((function(){h("chat_clicked")}),500)}function h(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"close";g(),"element"==e?t(".ht_ctc_chat_greetings_box").hide(70):t(".ht_ctc_chat_greetings_box").hide(400),t(".ht_ctc_chat_greetings_box").addClass("ctc_greetings_closed").removeClass("ctc_greetings_opened"),i("g_action",e),"user_closed"==e&&i("g_user_action",e)}function g(){var t=document.querySelector(".ht_ctc_modal_backdrop");t&&t.remove()}function m(t){var e;"yes"==n?"show"==r.dis_m&&((e=document.querySelector(".ht_ctc_desktop_chat"))&&e.remove(),t.style.cssText=r.pos_m+r.css,p(t)):"show"==r.dis_d&&((e=document.querySelector(".ht_ctc_mobile_chat"))&&e.remove(),t.style.cssText=r.pos_d+r.css,p(t))}function p(e){try{t(e).show(parseInt(r.se))}catch(t){e.style.display="block"}!function(){if(t(".ht_ctc_chat_greetings_box").length){if(r.g_device){if("yes"!==n&&"mobile"==r.g_device)return void t(".ht_ctc_chat_greetings_box").remove();if("yes"==n&&"desktop"==r.g_device)return void t(".ht_ctc_chat_greetings_box").remove()}document.dispatchEvent(new CustomEvent("ht_ctc_event_after_chat_displayed",{detail:{ctc:r,greetings_open:d,greetings_close:h}})),r.g_init&&"user_closed"!==o("g_user_action")&&("default"==r.g_init?"yes"!==n&&d("init"):"open"==r.g_init&&d("init")),t(document).on("click",'.ctc_greetings, #ctc_greetings, .ctc_greetings_now, [href="#ctc_greetings"]',(function(t){t.preventDefault(),h("element"),d("element")}))}}(),function(){if(document.querySelector(".ht_ctc_notification")&&"stop"!==o("n_badge")){if(document.querySelector(".ctc_nb")){var e=t(".ht_ctc_badge").closest(".ht_ctc_style");t(".ht_ctc_badge").css({top:t(e).find(".ctc_nb").attr("data-nb_top"),right:t(e).find(".ctc_nb").attr("data-nb_right")})}var c=r.n_time?1e3*r.n_time:"150";setTimeout((function(){t(".ht_ctc_notification").show(400)}),c)}}(),function(e){var c=t(e).hasClass("ht_ctc_entry_animation")?1200:120;setTimeout((function(){e.classList.add("ht_ctc_animation",r.ani)}),c),t(".ht-ctc-chat").hover((function(){t(".ht-ctc-chat .ht-ctc-cta-hover").show(120)}),(function(){t(".ht-ctc-chat .ht-ctc-cta-hover").hide(100)}))}(e)}function v(){t(".for_greetings_header_image_badge").length&&(t(".for_greetings_header_image_badge").addClass("g_header_badge_online"),t(".for_greetings_header_image_badge").show())}function f(){document.querySelector(".ht_ctc_notification")&&(i("n_badge","stop"),t(".ht_ctc_notification").remove())}function y(a){document.dispatchEvent(new CustomEvent("ht_ctc_event_number",{detail:{ctc:r}}));var _=r.number,o=r.pre_filled;a.hasAttribute("data-number")&&""!==a.getAttribute("data-number")&&(_=a.getAttribute("data-number")),a.hasAttribute("data-pre_filled")&&(o=a.getAttribute("data-pre_filled"));try{o=o.replaceAll("%","%25");var i=window.location.href;o=o.replace(/\[url]/gi,i),o=encodeURIComponent(decodeURI(o))}catch(t){}if(""!=_||r.custom_url_m&&""!==r.custom_url_m||r.custom_url_d&&""!==r.custom_url_d){var s="https://wa.me/"+_+"?text="+o,d=r.url_target_d?r.url_target_d:"_blank";"yes"==n?(r.url_structure_m&&(s="whatsapp://send?phone="+_+"&text="+o,d="_self"),r.custom_url_m&&""!==r.custom_url_m&&(s=r.custom_url_m)):(r.url_structure_d&&(s="https://web.whatsapp.com/send?phone="+_+"&text="+o),r.custom_url_d&&""!==r.custom_url_d&&(s=r.custom_url_d));var l="popup"==d?"scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no,width=788,height=514,left=100,top=100":"noopener";window.open(s,d,l),r.chat_number=_,function(){if(r.analytics&&"session"==r.analytics){if(sessionStorage.getItem("ht_ctc_analytics"))return;sessionStorage.setItem("ht_ctc_analytics","done")}function t(t){var n=r.chat_number&&""!==r.chat_number?r.chat_number:r.number;try{document.dispatchEvent(new CustomEvent("ht_ctc_event_apply_variables",{detail:{v:t}})),t=(t=(t=(t=void 0!==window.apply_variables_value?window.apply_variables_value:t).replace("{number}",n)).replace("{title}",c)).replace("{url}",e)}catch(t){}return t}document.dispatchEvent(new CustomEvent("ht_ctc_event_analytics"));var n=r.chat_number&&""!==r.chat_number?r.chat_number:r.number,a={},_="Click to Chat for WhatsApp",o="chat: "+n,i=c+", "+e;if(r.ga){var s=r.g_an_event_name&&""!==r.g_an_event_name?r.g_an_event_name:"click to chat";s=t(s),u.g_an_params&&u.g_an_params.forEach((function(e){if(u[e]){var c=u[e],n=c.key,_=c.value;n=t(n),_=t(_),a[n]=_}}));var d=0,l="no";if("undefined"!=typeof dataLayer)try{var h=function(t){t=t.toUpperCase(),g.includes(t)||(g.push(t),(t.startsWith("G-")||t.startsWith("GT-"))&&(a.send_to=t,gtag("event",s,a),d++))};"undefined"==typeof gtag&&(window.gtag=function(){dataLayer.push(arguments)},l="yes");var g=[];if(window.google_tag_data&&window.google_tag_data.tidr&&window.google_tag_data.tidr.destination)for(var m in window.google_tag_data.tidr.destination)h(m);dataLayer.forEach((function(t){"config"==t[0]&&t[1]&&(m=t[1],h(m))}))}catch(t){}0==d&&"no"==l&&("undefined"!=typeof gtag?gtag("event",s,a):"undefined"!=typeof ga&&void 0!==ga.getAll?ga.getAll()[0].send("event",_,o,i):"undefined"!=typeof __gaTracker&&__gaTracker("send","event",_,o,i))}if("undefined"!=typeof dataLayer&&dataLayer.push({event:"Click to Chat",type:"chat",number:n,title:c,url:e,event_category:_,event_label:i,event_action:o,ref:"dataLayer push"}),r.ads&&"undefined"!=typeof gtag_report_conversion&>ag_report_conversion(),r.fb&&"undefined"!=typeof fbq){var p=r.pixel_event_name&&""!==r.pixel_event_name?r.pixel_event_name:"Click to Chat by HoliThemes",v=u.pixel_event_type&&""!==u.pixel_event_type?u.pixel_event_type:"trackCustom",f={};u.pixel_params&&u.pixel_params.forEach((function(e){if(u[e]){var c=u[e],n=c.key,a=c.value;n=t(n),a=t(a),f[n]=a}})),fbq(v,p,f)}}(),function(e){if(r.hook_url){var c={};if(r.hook_v){c=void 0!==b?b:r.hook_v;var n={},a=1;c.forEach((function(t){n["value"+a]=t,a++})),r.hook_v=n}document.dispatchEvent(new CustomEvent("ht_ctc_event_hook",{detail:{ctc:r,number:e}}));var _=r.hook_url;if(c=r.hook_v,r.webhook_format&&"json"==r.webhook_format)var o=c;else o=JSON.stringify(c);t.ajax({url:_,type:"POST",mode:"no-cors",data:o,success:function(t){}})}}(_),f()}else if(r.no_number){var h=document.querySelector(".ctc-no-number-message");h&&(h.style.display="block")}}"undefined"!=typeof ht_ctc_variables?u=ht_ctc_variables:(u={g_an_event_name:"click to chat",pixel_event_name:"Click to Chat by HoliThemes",pixel_event_type:"trackCustom",g_an_params:["g_an_param_1","g_an_param_2","g_an_param_3"],g_an_param_1:{key:"number",value:"{number}"},g_an_param_2:{key:"title",value:"{title}"},g_an_param_3:{key:"url",value:"{url}"},pixel_params:["pixel_param_1","pixel_param_2","pixel_param_3","pixel_param_4"],pixel_param_1:{key:"Category",value:"Click to Chat for WhatsApp"},pixel_param_2:{key:"return_type",value:"chat"},pixel_param_3:{key:"ID",value:"{number}"},pixel_param_4:{key:"Title",value:"{title}"}},window.ht_ctc_variables=u),document.dispatchEvent(new CustomEvent("ht_ctc_event_settings",{detail:{ctc:r}})),(s=document.querySelector(".ht-ctc-chat"))&&(document.dispatchEvent(new CustomEvent("ht_ctc_event_chat")),function(t){"yes"==r.schedule?document.dispatchEvent(new CustomEvent("ht_ctc_event_display",{detail:{ctc:r,display_chat:m,ht_ctc_chat:t,online_content:v}})):(m(t),v())}(s),s.addEventListener("click",(function(){t(".ht_ctc_chat_greetings_box").length||y(s)})),t(".ht_ctc_chat_greetings_box").length&&t(document).on("click",".ht_ctc_chat_style",(function(e){t(".ht_ctc_chat_greetings_box").hasClass("ctc_greetings_opened")?h("user_closed"):d("user_opened")})),t(document).on("click",".ctc_greetings_close_btn",(function(t){h("user_closed")})),t(document).on("click",".ht_ctc_chat_greetings_box_link",(function(e){e.preventDefault(),document.querySelector("#ctc_opt")?t("#ctc_opt").is(":checked")||o("g_optin")?(y(s),l()):t(".ctc_opt_in").show(400).fadeOut("1").fadeIn("1"):(y(s),l()),document.dispatchEvent(new CustomEvent("ht_ctc_event_greetings"))})),document.querySelector("#ctc_opt")&&t("#ctc_opt").on("change",(function(e){t("#ctc_opt").is(":checked")&&(t(".ctc_opt_in").hide(100),i("g_optin","y"),setTimeout((function(){y(s),l()}),500))}))),t(document).on("click",".ht-ctc-sc-chat",(function(){y(this)})),t(document).on("click",".ctc_chat, #ctc_chat",(function(e){y(this),t(this).hasClass("ctc_woo_place")&&e.preventDefault()})),t(document).on("click",'[href="#ctc_chat"]',(function(t){t.preventDefault(),y(this)}));var b=r.hook_v?r.hook_v:""}))})();