Version Description
Add unlimited chat and social buttons
Download this release
Release Info
Developer | premiocommit |
Plugin | Floating Chat Widget: Contact Chat Icons, Telegram Chat, Line, WeChat, Email, SMS, Call Button – Chaty |
Version | 3.0.4 |
Comparing to | |
See all releases |
Code changes from version 3.0.3 to 3.0.4
- admin/assets/images/agency-price.png +0 -0
- admin/assets/images/agent-image.png +0 -0
- admin/assets/images/agent-infotip.png +0 -0
- admin/assets/images/agent-list.png +0 -0
- admin/assets/images/analytics-image.png +0 -0
- admin/assets/images/analytics-progress.png +0 -0
- admin/assets/images/analytics-search.png +0 -0
- admin/assets/images/analytics-unlock.png +0 -0
- admin/assets/images/arrow.png +0 -0
- admin/assets/images/basic-price-bg.png +0 -0
- admin/assets/images/bg.png +0 -0
- admin/assets/images/chaty-default.png +0 -0
- admin/assets/images/client-image.png +0 -0
- admin/assets/images/empty-state-star.png +0 -0
- admin/assets/images/flags.png +0 -0
- admin/assets/images/flags@2x.png +0 -0
- admin/assets/images/license-left.png +0 -0
- admin/assets/images/move-icon.png +0 -0
- admin/assets/images/no-widget.png +0 -0
- admin/assets/images/owner.jpg +0 -0
- admin/assets/images/owner.png +0 -0
- admin/assets/images/particle.png +0 -0
- admin/assets/images/particle2.png +0 -0
- admin/assets/images/particle3.png +0 -0
- admin/assets/images/payment.png +0 -0
- admin/assets/images/plus-price.png +0 -0
- admin/assets/images/premio-owner.png +0 -0
- admin/assets/images/pro-chat.png +0 -0
- admin/assets/images/pro-devices.png +0 -0
- admin/assets/images/pro-language.png +0 -0
- admin/assets/images/pro-page.png +0 -0
- admin/assets/images/pro-support.png +0 -0
- admin/assets/images/pro-widget.png +0 -0
- admin/assets/images/rpt_recommended.png +0 -0
- admin/assets/images/stars-image.png +0 -0
- admin/assets/images/ui-icons_444444_256x240.png +0 -0
- admin/assets/images/ui-icons_555555_256x240.png +0 -0
- admin/assets/images/update-bg.jpg +0 -0
- admin/assets/images/widget-dashboard.png +0 -0
- admin/assets/js/app.js +1 -1
- admin/assets/js/cht-scripts.js +1 -27
- admin/assets/js/cht-scripts.min.js +1 -1
- admin/class-admin-base.php +0 -67
- cht-icons.php +2 -2
- images/header-bottom.png +0 -0
- images/header-top.png +0 -0
- images/popup-bg.png +0 -0
- images/whatsapp.png +0 -0
- includes/class-frontend.php +0 -4
- readme.txt +10 -7
- views/admin/admin.php +18 -17
- views/admin/channel.php +86 -357
- views/admin/channels-section.php +4 -22
- views/admin/chaty-popup.php +1 -1
- views/admin/chaty_widget.php +4 -4
- views/admin/customize-widget-section.php +165 -222
- views/admin/help.php +1 -1
- views/admin/trigger-and-target.php +10 -15
admin/assets/images/agency-price.png
CHANGED
Binary file
|
admin/assets/images/agent-image.png
CHANGED
Binary file
|
admin/assets/images/agent-infotip.png
CHANGED
Binary file
|
admin/assets/images/agent-list.png
CHANGED
Binary file
|
admin/assets/images/analytics-image.png
CHANGED
Binary file
|
admin/assets/images/analytics-progress.png
DELETED
Binary file
|
admin/assets/images/analytics-search.png
DELETED
Binary file
|
admin/assets/images/analytics-unlock.png
DELETED
Binary file
|
admin/assets/images/arrow.png
DELETED
Binary file
|
admin/assets/images/basic-price-bg.png
CHANGED
Binary file
|
admin/assets/images/bg.png
CHANGED
Binary file
|
admin/assets/images/chaty-default.png
CHANGED
Binary file
|
admin/assets/images/client-image.png
CHANGED
Binary file
|
admin/assets/images/empty-state-star.png
CHANGED
Binary file
|
admin/assets/images/flags.png
CHANGED
Binary file
|
admin/assets/images/flags@2x.png
CHANGED
Binary file
|
admin/assets/images/license-left.png
DELETED
Binary file
|
admin/assets/images/move-icon.png
CHANGED
Binary file
|
admin/assets/images/no-widget.png
DELETED
Binary file
|
admin/assets/images/owner.jpg
DELETED
Binary file
|
admin/assets/images/owner.png
DELETED
Binary file
|
admin/assets/images/particle.png
CHANGED
Binary file
|
admin/assets/images/particle2.png
CHANGED
Binary file
|
admin/assets/images/particle3.png
CHANGED
Binary file
|
admin/assets/images/payment.png
CHANGED
Binary file
|
admin/assets/images/plus-price.png
CHANGED
Binary file
|
admin/assets/images/premio-owner.png
CHANGED
Binary file
|
admin/assets/images/pro-chat.png
CHANGED
Binary file
|
admin/assets/images/pro-devices.png
CHANGED
Binary file
|
admin/assets/images/pro-language.png
CHANGED
Binary file
|
admin/assets/images/pro-page.png
CHANGED
Binary file
|
admin/assets/images/pro-support.png
CHANGED
Binary file
|
admin/assets/images/pro-widget.png
CHANGED
Binary file
|
admin/assets/images/rpt_recommended.png
DELETED
Binary file
|
admin/assets/images/stars-image.png
CHANGED
Binary file
|
admin/assets/images/ui-icons_444444_256x240.png
CHANGED
Binary file
|
admin/assets/images/ui-icons_555555_256x240.png
CHANGED
Binary file
|
admin/assets/images/update-bg.jpg
CHANGED
Binary file
|
admin/assets/images/widget-dashboard.png
CHANGED
Binary file
|
admin/assets/js/app.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(()=>{var e,t={304:(e,t,n)=>{"use strict";n(972);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i=window.jQuery,a=i("#adminmenuwrap").outerWidth(),r=i("#wpadminbar").outerHeight(),c=i(".chaty-header").outerHeight(),s=Boolean(window.isRtl)?"right":"left",l=function(){return innerWidth<600?(scrollY<=r?r-scrollY:0)+"px":r+"px"},d=function(){return innerWidth>=783?a+"px":0},h=function(){return innerWidth<640?(c||0)+20:(c||0)+r};var u=window.jQuery;function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){v(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var g=window.jQuery;const w=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var o=t.reduceRight((function(e,t){return f(f({},e),t)}),{});return function(e){return function(t){return e(f(f({},t),o))}}}({onLayoutChange:function(e){var t;e((o(t={top:l()},s,d()),o(t,"width","calc(100% - ".concat(d(),")")),o(t,"content",h()),t)),onscroll=function(){var t;e((o(t={top:l()},s,d()),o(t,"width","calc(100% - ".concat(d(),")")),o(t,"content",h()),t))},i(document).on("wp-menu-state-set wp-collapse-menu",(function(t,n){var u;a=i("#adminmenuwrap").outerWidth(),r=i("#wpadminbar").outerHeight(),c=i(".chaty-header").outerHeight(),e((o(u={top:l()},s,d()),o(u,"width","calc(100% - ".concat(d(),")")),o(u,"content",h()),u))}))}},{route:new URLSearchParams(window.location.search)})((function(e){var t=g(".chaty-header"),n=g("#chaty-widget-body-tab"),o=g("#chaty-social-channel"),i=g(".back-button"),a=g(".next-button"),r=["chaty-tab-social-channel","chaty-tab-customize-widget","chaty-tab-triger-targeting"],c=Number(e.route.get("step")||0);if(0!==t.length&&0!==o.length){e.onLayoutChange((function(e){t.css(e),n.css("margin-top","".concat(e.content,"px"))}));var s=function(e){if(e<r.length&&e>=0){c=e,g(".social-channel-tabs").removeClass("active"),g("#".concat(r[e])).addClass("active"),g(".chaty-tab").removeClass("active completed").each((function(){if(g(this).addClass("completed"),this.dataset.tabId===r[e])return g(this).addClass("active"),!1})),i.removeClass("cht-disable"),a.removeClass("cht-disable"),e<=0&&i.addClass("cht-disable"),e>=r.length-1&&a.addClass("cht-disable");var t=new URL(window.location.href),n=t.searchParams;n.set("step",e),t.search=n.toString();var o=t.toString();window.history.replaceState({page_id:e},"",o)}};s(c),t.find(".chaty-tab").on("click",(function(){s(r.indexOf(this.dataset.tabId)),"fixed"===t.css("position")&&window.scrollTo({top:(innerWidth>768?t.outerHeight():0)+32+"px",left:0,behavior:"smooth"})})),a.on("click",(function(){s(c+1)})),i.on("click",(function(){s(c-1)})),u(".save-button-container .arrow-btn").on("click",(function(){var e=u(".save-dashboard-button"),t=u(".footer-buttons").offset(),n=u(this).offset(),o=n.top-t.top+45,i=n.left-t.left+40;return 1==u(this).attr("data-click-state")?(u(this).attr("data-click-state",0).removeClass("active"),e.css({display:"none"})):(u(this).attr("data-click-state",1).addClass("active"),e.css({position:"absolute",left:i+"px",top:o+"px",display:"inline-block",transform:"translateX(-100%)"})),!1})),u(window).on("click",(function(e){u(".arrow-btn.active")&&(u(".save-dashboard-button").css({display:"none"}),u(".arrow-btn.active").attr("data-click-state",0).removeClass("active"))}))}}));var m=window.jQuery;var y=window.jQuery;var b=window.jQuery;function C(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(b("#active_widget").length){var t=b(".trigger-block-wrapper"),n=b(".widget-disable-alert"),o=b("#active_widget");null===e&&(e=o[0]),e.checked?(t.show(),n.hide()):(t.hide(),n.show()),b("#active_widget").on("change",(function(){C(this)}))}}var k=window.jQuery;var j=window.jQuery;var _=window.jQuery;var x=window.jQuery;var P=window.jQuery;var O=window.jQuery;function $(){wp.hooks.addAction("chaty.channel_update","channelUpdateHandler",(function(e){var t=e.action,n=e.target,o=e.channel,i=e.isExceeded;!function(e){var t=O(".popover-upgrade-pro");e?(t.addClass("flex shake-it").removeClass("hidden"),t.isInViewport()||t[0].scrollIntoView({behavior:"smooth",block:"center"}),setTimeout((function(){return t.removeClass("shake-it")}),1e3)):t.removeClass("flex shake-it").addClass("hidden")}(i),"added"===t&&!i&&n&&function(e){O("#chaty-social-".concat(e))[0].scrollIntoView({behavior:"smooth",block:"center"})}(n);var a=o.length<=1;O(".chaty-widget-color, .chaty-widget-icon, .chaty-default-state, .chaty-icon-view").toggleClass("hidden",a)}))}var Q=window.jQuery;jQuery((function(){var e;w(),{init:function(){this.$previewBtn=m(".preview-help-btn"),this.$asidePreview=m(".preview-section-chaty"),this.resizeHandler(),this.$previewBtn.on("click",this.showPreview.bind(this)),this.$asidePreview.on("click",this.removePreview.bind(this)),m(window).resize(this.resizeHandler.bind(this))},showPreview:function(e){e.preventDefault(),e.stopPropagation(),this.$asidePreview.removeClass("pb-20 hidden").addClass("fixed top-0 left-0 flex items-center justify-center w-full h-screen bg-black/70").css("z-index",9999999).attr("data-show",1),this.$asidePreview.find(".preview").removeClass("sticky").css("max-width","350px")},removeHandler:function(){this.$asidePreview.addClass("pb-20 hidden").removeClass("fixed top-0 left-0 flex items-center justify-center w-full h-screen bg-black/70").removeAttr("style").attr("data-show",0),this.$asidePreview.find(".preview").addClass("sticky").removeAttr("style")},removePreview:function(e){e&&!e.target.closest(".preview")&&1==this.$asidePreview.attr("data-show")&&this.removeHandler()},position:function(){var e=m("#chaty-widget-body-tab");if(0!==e.length){var t=e.offset(),n=jQuery(document).width();return{centerY:window.innerHeight/2,left:t.left,right:n-(t.left+e.outerWidth()),width:n,containerWidth:e.outerWidth()}}},resizeHandler:function(){if(this.position()){var e=this.position(),t=e.centerY;e.right,e.width<=1024?(this.$previewBtn.css({top:t+"px",right:0,transform:"rotate(-90deg) translateX(137%)",opacity:1,zIndex:999999}),this.$asidePreview.addClass("hidden")):(this.removeHandler(),this.$asidePreview.removeClass("hidden"),this.$previewBtn.css({opacity:0}))}}}.init(),e={init:function(){this.extendJquery(),this.trigger(!1,{$scope:y(document),element:".chaty-color-field"}),y(document).on("chatyColorPicker/trigger",this.trigger.bind(this))},STATE:{current:null,set add(e){!e.is(this.current)&&this.current&&this.current.parent().next().slideUp(),this.current=e,this.closeAll},get closeAll(){var e=this;y("html, .preview-section-chaty").on("click",(function(t){t.target.closest(".cht-colorpicker__dropdown")||e.current.parent().next().slideUp()}))}},trigger:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1?arguments[1]:void 0;t&&this.eventUtils(t);var o=["#202020","#86cd91","#1E88E5","#ff6060","#49E670","#ffdb5e","#ff95ee"];n.$scope.find(n.element).each((function(t,i){var a=n.$scope.find(i);if(!a.data("chaty-color-picker")){var r=a.val()||"#202020",c=AColorPicker.parseColor(r,"hex");Object.assign({$scope:n.$scope,$input:a,defaultColor:r,colors:o,defaultColorDarker:e.colorLuminance(c,-.1)},e).addReplacer(),a.attr("data-chaty-color-picker",!0)}}))},eventUtils:function(e){e.preventDefault(),e.stopPropagation()},addReplacer:function(){var e=this;e.$input.css("display","none"),e.$input.after('\n <div class="cht-colorpicker replacer">\n <div class="cht-colorpicker__preview">\n <span class="cht-colorpicker__preview--inner" style="background-color: '.concat(e.defaultColor,"; border-color: ").concat(e.defaultColorDarker,'"></span>\n </div>\n <div class="cht-colorpicker__dropdown">\n ').concat(e.colorTemplate(),"\n </div>\n </div>\n "));var t=e.$input.parent().find(".cht-colorpicker"),n=t.find(".cht-colorpicker__dropdown"),o=AColorPicker.createPicker(n,{attachTo:t,color:this.defaultColor,showAlpha:!0,showHSL:!1});e.initalize(t),o.on("change",(function(n,o){e.onChange.call(e,o,t,!0)}))},colorTemplate:function(){var e=this;return'\n <ul class="palate">\n '.concat(this.colors.map((function(t,n){return'<li data-color="'.concat(t,'" ').concat(t===e.defaultColor?'class="active"':"",'>\n <span class="template-color" style="background-color: ').concat(t,'"></span>\n </li>')})).join(""),'\n <li class="custom-color ').concat(this.colors.includes(this.defaultColor)?"":"active",'">\n <div>\n <svg class="pointer-events-none" width="16" height="16" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg" svg-inline="" focusable="false" tabindex="-1"><path fill-rule="evenodd" clip-rule="evenodd" d="M7 1a1 1 0 00-2 0v4H1a1 1 0 000 2h4v4a1 1 0 102 0V7h4a1 1 0 100-2H7V1z" fill="currentColor"></path></svg>\n </div>\n </li>\n </ul>\n ')},extendJquery:function(){y.fn.extend({premioFixHorizontalPosition:function(){var e=this.parent().offset().left,t=innerWidth-e;return this.outerWidth()+40>t&&this.css("right","0"),this}})},initalize:function(e){var t=this,n=e.find(".cht-colorpicker__preview--inner"),o=e.find(".cht-colorpicker__dropdown"),i=e.find(".custom-color"),a=e.find(".template-color"),r=e.find(".palate"),c=e.find(".a-color-picker");n.on("click",(function(e){t.eventUtils(e),o.premioFixHorizontalPosition().slideToggle(),c.hide(),setTimeout((function(){r.show()}),500),t.STATE.add=n})),a.on("click",(function(n){t.eventUtils(n),e.find("li").removeClass("active");var o=jQuery(this).parent();o.addClass("active"),t.onChange.call(t,o.data("color"),e,!1)})),i.on("click",(function(){e.find("li").removeClass("active"),jQuery(this).parent().addClass("active"),r.hide(),c.show()}))},colorLuminance:function(e,t){(e=String(e).replace(/[^0-9a-f]/gi,"")).length<6&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),t=t||0;var n,o,i="#";for(o=0;o<3;o++)n=parseInt(e.substr(2*o,2),16),i+=("00"+(n=Math.round(Math.min(Math.max(0,n+n*t),255)).toString(16))).substr(n.length);return i},updatePreviewColor:function(e,t,n){e.find(".cht-colorpicker__preview--inner").css({backgroundColor:t,borderColor:n})},updateCustomPreviewColor:function(e,t){e.find(".custom-color").css({borderColor:t})},updateChannelIconColor:function(e){e.$scope;var t=e.color,n=(e.type,e.channel);jQuery("#chaty_image_"+n+" .custom-chaty-image").css("background-color",t),jQuery("#chaty_image_"+n+" .facustom-icon").css("background-color",t),jQuery("#chaty_image_"+n+" .color-element").css("fill",t)},updateAgentIconColor:function(e){e.$scope;var t=e.color,n=(e.type,e.channel);console.log("color: "+t),console.log("channel: "+n),jQuery("#image_agent_data_agent-"+n+" .custom-agent-image").css("background-color",t),jQuery("#image_agent_data_agent-"+n+" .facustom-icon").css("background-color",t),jQuery("#image_agent_data_agent-"+n+" .color-element").css("fill",t)},updateAgentUserIconColor:function(e){e.$scope;var t=e.color,n=(e.type,e.channel),o=e.agentIndex;jQuery("#image_agent_data_"+n+"-"+o+" .custom-agent-image").css("background-color",t),jQuery("#image_agent_data_"+n+"-"+o+" .facustom-icon").css("background-color",t),jQuery("#image_agent_data_"+n+"-"+o+" .color-element").css("fill",t)},onChange:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=AColorPicker.parseColor(e,"hex"),i=n?this.colorLuminance(o,-.1):o,a=t.parents(".chaty-channel").data("channel");if(this.$input.val(e).attr("value",e),this.updatePreviewColor(t,e,i),n&&this.updateCustomPreviewColor(t,i),this.$input.hasClass("chaty-bg-color")&&(console.log("color: "+e),console.log("channel: "+a),this.updateChannelIconColor({type:"chaty-bg-color",$scope:jQuery(".custom-image-".concat(a)).parent(),color:e,channel:a})),this.$input.hasClass("agent-bg-color")&&this.updateAgentIconColor({type:"agent-bg-color",$scope:jQuery(".custom-image-".concat(a)).parent(),color:e,channel:a}),this.$input.hasClass("agent-icon-color")){var r=t.parents(".agent-channel-setting").data("item");this.updateAgentUserIconColor({type:"agent-icon-color",$scope:jQuery(".custom-image-".concat(a)).parent(),color:e,channel:a,agentIndex:r})}change_custom_preview()}},e.init(),C(),k(document).on("click",".customize-agent-button",(function(){var e=k(this).parents(".chaty-channel");e.find(".customize-agent-button, .agent-button-action").toggleClass("enable"),e.find(".chaty-channel-main-settings").slideToggle(200)})),k(document).on("click",".agent-channel-setting-button",(function(){k(this).parents(".agent-channel-setting").find(".agent-channel-setting-advance").slideToggle(200),k(this).toggleClass("enable")})),j(".close-chaty-popup-btn").on("click",(function(e){e.stopPropagation(),j(".chaty-popup").hide(),j(this).hasClass("channel-setting-btn")&&(j("#chaty-social-channel").trigger("click"),j(window).scrollTop(j("#channels-selected-list").offset().top-120))})),_(".chaty-settings").on("click",(function(e){e.preventDefault(),e.stopPropagation(),_(this).toggleClass("enable");var t=_(this).parents(".chaty-channel"),n=_(window).scrollTop(),o=t.offset().top-n-130;window.scrollBy({top:o,left:0,behavior:"smooth"})})),x(".widget-size-control").on("change",(function(){"radio"===this.type&&(x("#custom-widget-size").css({display:"size-custom"===this.id?"block":"none"}),x(".widget-size-control").prop("checked",!1),x(this).prop("checked",!0)),x("#custom-widget-size-input").val(this.value),change_custom_preview()})),P(".chaty-targeted-collapse").on("click",(function(e){e.preventDefault();var t=this.dataset.target,n=P("#".concat(t)),o=P(this);n.slideToggle(300,(function(){n.is(":hidden")?o.find("svg").css("transform","rotate(0deg)"):o.find("svg").css("transform","rotate(90deg)")}))})),$(),Q(".create-rule").on("click",(function(){Q(this).parents(".chaty-option-box").addClass("show-remove-rule-button")})),Q(".remove-rules").on("click",(function(){Q(this).parents(".chaty-option-box").removeClass("show-remove-rule-button")}))}))},972:()=>{var e=window.jQuery;e.fn.isInViewport=function(){var t=e(this).offset().top,n=t+e(this).outerHeight(),o=e(window).scrollTop(),i=o+e(window).height();return n>o&&t<i}},303:()=>{}},n={};function o(e){var i=n[e];if(void 0!==i)return i.exports;var a=n[e]={exports:{}};return t[e](a,a.exports,o),a.exports}o.m=t,e=[],o.O=(t,n,i,a)=>{if(!n){var r=1/0;for(d=0;d<e.length;d++){for(var[n,i,a]=e[d],c=!0,s=0;s<n.length;s++)(!1&a||r>=a)&&Object.keys(o.O).every((e=>o.O[e](n[s])))?n.splice(s--,1):(c=!1,a<r&&(r=a));if(c){e.splice(d--,1);var l=i();void 0!==l&&(t=l)}}return t}a=a||0;for(var d=e.length;d>0&&e[d-1][2]>a;d--)e[d]=e[d-1];e[d]=[n,i,a]},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={561:0,782:0};o.O.j=t=>0===e[t];var t=(t,n)=>{var i,a,[r,c,s]=n,l=0;if(r.some((t=>0!==e[t]))){for(i in c)o.o(c,i)&&(o.m[i]=c[i]);if(s)var d=s(o)}for(t&&t(n);l<r.length;l++)a=r[l],o.o(e,a)&&e[a]&&e[a][0](),e[a]=0;return o.O(d)},n=self.webpackChunk=self.webpackChunk||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})(),o.O(void 0,[782],(()=>o(304)));var i=o.O(void 0,[782],(()=>o(303)));i=o.O(i)})();
|
1 |
+
(()=>{var e,t={304:(e,t,n)=>{"use strict";n(972);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i=window.jQuery,a=i("#adminmenuwrap").outerWidth(),r=i("#wpadminbar").outerHeight(),c=i(".chaty-header").outerHeight(),s=Boolean(window.isRtl)?"right":"left",l=function(){return innerWidth<600?(scrollY<=r?r-scrollY:0)+"px":r+"px"},d=function(){return innerWidth>=783?a+"px":0},h=function(){return innerWidth<640?(c||0)+20:(c||0)+r};var u=window.jQuery;function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){v(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var g=window.jQuery;const w=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var o=t.reduceRight((function(e,t){return f(f({},e),t)}),{});return function(e){return function(t){return e(f(f({},t),o))}}}({onLayoutChange:function(e){var t;e((o(t={top:l()},s,d()),o(t,"width","calc(100% - ".concat(d(),")")),o(t,"content",h()),t)),onscroll=function(){var t;e((o(t={top:l()},s,d()),o(t,"width","calc(100% - ".concat(d(),")")),o(t,"content",h()),t))},i(document).on("wp-menu-state-set wp-collapse-menu",(function(t,n){var u;a=i("#adminmenuwrap").outerWidth(),r=i("#wpadminbar").outerHeight(),c=i(".chaty-header").outerHeight(),e((o(u={top:l()},s,d()),o(u,"width","calc(100% - ".concat(d(),")")),o(u,"content",h()),u))}))}},{route:new URLSearchParams(window.location.search)})((function(e){var t=g(".chaty-header"),n=g("#chaty-widget-body-tab"),o=g("#chaty-social-channel"),i=g(".back-button"),a=g(".next-button"),r=["chaty-tab-social-channel","chaty-tab-customize-widget","chaty-tab-triger-targeting"],c=Number(e.route.get("step")||0);if(0!==t.length&&0!==o.length){e.onLayoutChange((function(e){t.css(e),n.css("margin-top","".concat(e.content,"px"))}));var s=function(e){if(e<r.length&&e>=0){c=e,g(".social-channel-tabs").removeClass("active"),g("#".concat(r[e])).addClass("active"),g(".chaty-tab").removeClass("active completed").each((function(){if(g(this).addClass("completed"),this.dataset.tabId===r[e])return g(this).addClass("active"),!1})),i.removeClass("cht-disable"),a.removeClass("cht-disable"),e<=0&&i.addClass("cht-disable"),e>=r.length-1&&a.addClass("cht-disable");var t=new URL(window.location.href),n=t.searchParams;n.set("step",e),t.search=n.toString();var o=t.toString();window.history.replaceState({page_id:e},"",o)}};s(c),t.find(".chaty-tab").on("click",(function(){s(r.indexOf(this.dataset.tabId)),"fixed"===t.css("position")&&window.scrollTo({top:(innerWidth>768?t.outerHeight():0)+32+"px",left:0,behavior:"smooth"})})),a.on("click",(function(){s(c+1)})),i.on("click",(function(){s(c-1)})),u(".save-button-container .arrow-btn").on("click",(function(){var e=u(".save-dashboard-button"),t=u(".footer-buttons").offset(),n=u(this).offset(),o=n.top-t.top+45,i=n.left-t.left+40;return 1==u(this).attr("data-click-state")?(u(this).attr("data-click-state",0).removeClass("active"),e.css({display:"none"})):(u(this).attr("data-click-state",1).addClass("active"),e.css({position:"absolute",left:i+"px",top:o+"px",display:"inline-block",transform:"translateX(-100%)"})),!1})),u(window).on("click",(function(e){u(".arrow-btn.active")&&(u(".save-dashboard-button").css({display:"none"}),u(".arrow-btn.active").attr("data-click-state",0).removeClass("active"))}))}}));var m=window.jQuery;var y=window.jQuery;var b=window.jQuery;function C(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(b("#active_widget").length){var t=b(".trigger-block-wrapper"),n=b(".widget-disable-alert"),o=b("#active_widget");null===e&&(e=o[0]),e.checked?(t.show(),n.hide()):(t.hide(),n.show()),b("#active_widget").on("change",(function(){C(this)}))}}var k=window.jQuery;var j=window.jQuery;var _=window.jQuery;var x=window.jQuery;var P=window.jQuery;var O=window.jQuery;function $(){wp.hooks.addAction("chaty.channel_update","channelUpdateHandler",(function(e){var t=e.action,n=e.target,o=e.channel,i=e.isExceeded;!function(e){var t=O(".popover-upgrade-pro");e?(t.addClass("flex shake-it").removeClass("hidden"),t.isInViewport()||t[0].scrollIntoView({behavior:"smooth",block:"center"}),setTimeout((function(){return t.removeClass("shake-it")}),1e3)):t.removeClass("flex shake-it").addClass("hidden")}(i),"added"===t&&!i&&n&&function(e){O("#chaty-social-".concat(e))[0].scrollIntoView({behavior:"smooth",block:"center"})}(n);var a=o.length<=1;O(".chaty-widget-color, .chaty-widget-icon, .chaty-default-state, .chaty-icon-view").toggleClass("hidden",a)}))}var Q=window.jQuery;jQuery((function(){var e;w(),{init:function(){this.$previewBtn=m(".preview-help-btn"),this.$asidePreview=m(".preview-section-chaty"),this.resizeHandler(),this.$previewBtn.on("click",this.showPreview.bind(this)),this.$asidePreview.on("click",this.removePreview.bind(this)),m(window).resize(this.resizeHandler.bind(this))},showPreview:function(e){e.preventDefault(),e.stopPropagation(),this.$asidePreview.removeClass("pb-20 hidden").addClass("fixed top-0 left-0 flex items-center justify-center w-full h-screen bg-black/70").css("z-index",9999999).attr("data-show",1),this.$asidePreview.find(".preview").removeClass("sticky").css("max-width","350px")},removeHandler:function(){this.$asidePreview.addClass("pb-20 hidden").removeClass("fixed top-0 left-0 flex items-center justify-center w-full h-screen bg-black/70").removeAttr("style").attr("data-show",0),this.$asidePreview.find(".preview").addClass("sticky").removeAttr("style")},removePreview:function(e){e&&!e.target.closest(".preview")&&1==this.$asidePreview.attr("data-show")&&this.removeHandler()},position:function(){var e=m("#chaty-widget-body-tab");if(0!==e.length){var t=e.offset(),n=jQuery(document).width();return{centerY:window.innerHeight/2,left:t.left,right:n-(t.left+e.outerWidth()),width:n,containerWidth:e.outerWidth()}}},resizeHandler:function(){if(this.position()){var e=this.position(),t=e.centerY;e.right,e.width<=1024?(this.$previewBtn.css({top:t+"px",right:0,transform:"rotate(-90deg) translateX(137%)",opacity:1,zIndex:999999}),this.$asidePreview.addClass("hidden")):(this.removeHandler(),this.$asidePreview.removeClass("hidden"),this.$previewBtn.css({opacity:0}))}}}.init(),e={init:function(){this.extendJquery(),this.trigger(!1,{$scope:y(document),element:".chaty-color-field"}),y(document).on("chatyColorPicker/trigger",this.trigger.bind(this))},STATE:{current:null,set add(e){!e.is(this.current)&&this.current&&this.current.parent().next().slideUp(),this.current=e,this.closeAll},get closeAll(){var e=this;y("html, .preview-section-chaty").on("click",(function(t){t.target.closest(".cht-colorpicker__dropdown")||e.current.parent().next().slideUp()}))}},trigger:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1?arguments[1]:void 0;t&&this.eventUtils(t);var o=["#202020","#86cd91","#1E88E5","#ff6060","#49E670","#ffdb5e","#ff95ee"];n.$scope.find(n.element).each((function(t,i){var a=n.$scope.find(i);if(!a.data("chaty-color-picker")){var r=a.val()||"#202020",c=AColorPicker.parseColor(r,"hex");Object.assign({$scope:n.$scope,$input:a,defaultColor:r,colors:o,defaultColorDarker:e.colorLuminance(c,-.1)},e).addReplacer(),a.attr("data-chaty-color-picker",!0)}}))},eventUtils:function(e){e.preventDefault(),e.stopPropagation()},addReplacer:function(){var e=this;e.$input.css("display","none"),e.$input.after('\n <div class="cht-colorpicker replacer">\n <div class="cht-colorpicker__preview">\n <span class="cht-colorpicker__preview--inner" style="background-color: '.concat(e.defaultColor,"; border-color: ").concat(e.defaultColorDarker,'"></span>\n </div>\n <div class="cht-colorpicker__dropdown">\n ').concat(e.colorTemplate(),"\n </div>\n </div>\n "));var t=e.$input.parent().find(".cht-colorpicker"),n=t.find(".cht-colorpicker__dropdown"),o=AColorPicker.createPicker(n,{attachTo:t,color:this.defaultColor,showAlpha:!0,showHSL:!1});e.initalize(t),o.on("change",(function(n,o){e.onChange.call(e,o,t,!0)}))},colorTemplate:function(){var e=this;return'\n <ul class="palate">\n '.concat(this.colors.map((function(t,n){return'<li data-color="'.concat(t,'" ').concat(t===e.defaultColor?'class="active"':"",'>\n <span class="template-color" style="background-color: ').concat(t,'"></span>\n </li>')})).join(""),'\n <li class="custom-color ').concat(this.colors.includes(this.defaultColor)?"":"active",'">\n <div>\n <svg class="pointer-events-none" width="16" height="16" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg" svg-inline="" focusable="false" tabindex="-1"><path fill-rule="evenodd" clip-rule="evenodd" d="M7 1a1 1 0 00-2 0v4H1a1 1 0 000 2h4v4a1 1 0 102 0V7h4a1 1 0 100-2H7V1z" fill="currentColor"></path></svg>\n </div>\n </li>\n </ul>\n ')},extendJquery:function(){y.fn.extend({premioFixHorizontalPosition:function(){var e=this.parent().offset().left,t=innerWidth-e;return this.outerWidth()+40>t&&this.css("right","0"),this}})},initalize:function(e){var t=this,n=e.find(".cht-colorpicker__preview--inner"),o=e.find(".cht-colorpicker__dropdown"),i=e.find(".custom-color"),a=e.find(".template-color"),r=e.find(".palate"),c=e.find(".a-color-picker");n.on("click",(function(e){t.eventUtils(e),o.premioFixHorizontalPosition().slideToggle(),c.hide(),setTimeout((function(){r.show()}),500),t.STATE.add=n})),a.on("click",(function(n){t.eventUtils(n),e.find("li").removeClass("active");var o=jQuery(this).parent();o.addClass("active"),t.onChange.call(t,o.data("color"),e,!1)})),i.on("click",(function(){e.find("li").removeClass("active"),jQuery(this).parent().addClass("active"),r.hide(),c.show()}))},colorLuminance:function(e,t){(e=String(e).replace(/[^0-9a-f]/gi,"")).length<6&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),t=t||0;var n,o,i="#";for(o=0;o<3;o++)n=parseInt(e.substr(2*o,2),16),i+=("00"+(n=Math.round(Math.min(Math.max(0,n+n*t),255)).toString(16))).substr(n.length);return i},updatePreviewColor:function(e,t,n){e.find(".cht-colorpicker__preview--inner").css({backgroundColor:t,borderColor:n})},updateCustomPreviewColor:function(e,t){e.find(".custom-color").css({borderColor:t})},updateChannelIconColor:function(e){e.$scope;var t=e.color,n=(e.type,e.channel);jQuery("#chaty_image_"+n+" .custom-chaty-image").css("background-color",t),jQuery("#chaty_image_"+n+" .facustom-icon").css("background-color",t),jQuery("#chaty_image_"+n+" .color-element").css("fill",t)},updateAgentIconColor:function(e){e.$scope;var t=e.color,n=(e.type,e.channel);console.log("color: "+t),console.log("channel: "+n),jQuery("#image_agent_data_agent-"+n+" .custom-agent-image").css("background-color",t),jQuery("#image_agent_data_agent-"+n+" .facustom-icon").css("background-color",t),jQuery("#image_agent_data_agent-"+n+" .color-element").css("fill",t)},updateAgentUserIconColor:function(e){e.$scope;var t=e.color,n=(e.type,e.channel),o=e.agentIndex;jQuery("#image_agent_data_"+n+"-"+o+" .custom-agent-image").css("background-color",t),jQuery("#image_agent_data_"+n+"-"+o+" .facustom-icon").css("background-color",t),jQuery("#image_agent_data_"+n+"-"+o+" .color-element").css("fill",t)},onChange:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=AColorPicker.parseColor(e,"hex"),i=n?this.colorLuminance(o,-.1):o,a=t.parents(".chaty-channel").data("channel");if(this.$input.val(e).attr("value",e),this.updatePreviewColor(t,e,i),n&&this.updateCustomPreviewColor(t,i),this.$input.hasClass("chaty-bg-color")&&(console.log("color: "+e),console.log("channel: "+a),this.updateChannelIconColor({type:"chaty-bg-color",$scope:jQuery(".custom-image-".concat(a)).parent(),color:e,channel:a})),this.$input.hasClass("agent-bg-color")&&this.updateAgentIconColor({type:"agent-bg-color",$scope:jQuery(".custom-image-".concat(a)).parent(),color:e,channel:a}),this.$input.hasClass("agent-icon-color")){var r=t.parents(".agent-channel-setting").data("item");this.updateAgentUserIconColor({type:"agent-icon-color",$scope:jQuery(".custom-image-".concat(a)).parent(),color:e,channel:a,agentIndex:r})}change_custom_preview()}},e.init(),C(),k(document).on("click",".customize-agent-button",(function(){var e=k(this).parents(".chaty-channel");e.find(".customize-agent-button, .agent-button-action").toggleClass("enable"),e.find(".chaty-channel-main-settings").slideToggle(200)})),k(document).on("click",".agent-channel-setting-button",(function(){k(this).parents(".agent-channel-setting").find(".agent-channel-setting-advance").slideToggle(200),k(this).toggleClass("enable")})),j(".close-chaty-popup-btn").on("click",(function(e){e.stopPropagation(),j(".chaty-popup").hide(),j(this).hasClass("channel-setting-btn")&&(j("#chaty-social-channel").trigger("click"),j(window).scrollTop(j("#channels-selected-list").offset().top-120))})),_(".chaty-settings").on("click",(function(e){e.preventDefault(),e.stopPropagation(),_(this).toggleClass("enable");var t=_(this).parents(".chaty-channel"),n=_(window).scrollTop(),o=t.offset().top-n-130;window.scrollBy({top:o,left:0,behavior:"smooth"})})),x(".widget-size-control").on("change",(function(){"radio"===this.type&&(x("#custom-widget-size").css({display:"size-custom"===this.id?"block":"none"}),x(".widget-size-control").prop("checked",!1),x(this).prop("checked",!0)),x("#custom-widget-size-input").val(this.value),change_custom_preview()})),P(".chaty-targeted-collapse").on("click",(function(e){e.preventDefault();var t=this.dataset.target,n=P("#".concat(t)),o=P(this);n.slideToggle(300,(function(){n.is(":hidden")?o.find("svg").css("transform","rotate(0deg)"):o.find("svg").css("transform","rotate(90deg)")}))})),$(),Q(".create-rule").on("click",(function(){Q(this).parents(".chaty-option-box").addClass("show-remove-rule-button")})),Q(".remove-rules").on("click",(function(){Q(this).parents(".chaty-option-box").removeClass("show-remove-rule-button")}))}))},972:()=>{var e=window.jQuery;e.fn.isInViewport=function(){var t=e(this).offset().top,n=t+e(this).outerHeight(),o=e(window).scrollTop(),i=o+e(window).height();return n>o&&t<i}},303:()=>{}},n={};function o(e){var i=n[e];if(void 0!==i)return i.exports;var a=n[e]={exports:{}};return t[e](a,a.exports,o),a.exports}o.m=t,e=[],o.O=(t,n,i,a)=>{if(!n){var r=1/0;for(d=0;d<e.length;d++){for(var[n,i,a]=e[d],c=!0,s=0;s<n.length;s++)(!1&a||r>=a)&&Object.keys(o.O).every((e=>o.O[e](n[s])))?n.splice(s--,1):(c=!1,a<r&&(r=a));if(c){e.splice(d--,1);var l=i();void 0!==l&&(t=l)}}return t}a=a||0;for(var d=e.length;d>0&&e[d-1][2]>a;d--)e[d]=e[d-1];e[d]=[n,i,a]},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={561:0,782:0};o.O.j=t=>0===e[t];var t=(t,n)=>{var i,a,[r,c,s]=n,l=0;if(r.some((t=>0!==e[t]))){for(i in c)o.o(c,i)&&(o.m[i]=c[i]);if(s)var d=s(o)}for(t&&t(n);l<r.length;l++)a=r[l],o.o(e,a)&&e[a]&&e[a][0](),e[a]=0;return o.O(d)},n=self.webpackChunk=self.webpackChunk||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})(),o.O(void 0,[782],(()=>o(304)));var i=o.O(void 0,[782],(()=>o(303)));i=o.O(i)})();
|
admin/assets/js/cht-scripts.js
CHANGED
@@ -704,34 +704,8 @@ function check_for_number_chaty(phoneNumber, validationFor) {
|
|
704 |
jQuery('.add_slug').val(jQuery('.add_slug').val() + ',' + jQuery(this).attr('data-social'));
|
705 |
}
|
706 |
|
707 |
-
|
708 |
-
if (!jQuery('section').is('#pro') && jQuery('.channels-icons > .icon.active').length >= 2) {
|
709 |
-
socialIcon.removeClass('disabled');
|
710 |
-
|
711 |
-
const channel_list2 = [];
|
712 |
-
jQuery('.channels-icons > .icon.active').each( (i, item) => {
|
713 |
-
channel_list2.push( item.dataset.social );
|
714 |
-
} )
|
715 |
-
|
716 |
-
wp.hooks.doAction('chaty.channel_update', {
|
717 |
-
channel : channel_list2, // active channel list
|
718 |
-
target : social, // channel that removed last
|
719 |
-
action : 'added', // added || removed,
|
720 |
-
isExceeded : true,
|
721 |
-
});
|
722 |
-
|
723 |
-
return;
|
724 |
-
}
|
725 |
-
|
726 |
$this.toggleClass('active');
|
727 |
|
728 |
-
if (jQuery('section').is('#pro')) {
|
729 |
-
var token = 'pro';
|
730 |
-
} else {
|
731 |
-
var token = 'free';
|
732 |
-
}
|
733 |
-
|
734 |
-
|
735 |
$.ajax({
|
736 |
type: 'POST',
|
737 |
dataType: 'json',
|
@@ -740,7 +714,7 @@ function check_for_number_chaty(phoneNumber, validationFor) {
|
|
740 |
action: 'choose_social',
|
741 |
social: social,
|
742 |
nonce_code: cht_nonce_ajax.cht_nonce,
|
743 |
-
version:
|
744 |
widget_index: jQuery("#widget_index").val()
|
745 |
},
|
746 |
beforeSend: function (xhr) {
|
704 |
jQuery('.add_slug').val(jQuery('.add_slug').val() + ',' + jQuery(this).attr('data-social'));
|
705 |
}
|
706 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
707 |
$this.toggleClass('active');
|
708 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
709 |
$.ajax({
|
710 |
type: 'POST',
|
711 |
dataType: 'json',
|
714 |
action: 'choose_social',
|
715 |
social: social,
|
716 |
nonce_code: cht_nonce_ajax.cht_nonce,
|
717 |
+
version: 'free',
|
718 |
widget_index: jQuery("#widget_index").val()
|
719 |
},
|
720 |
beforeSend: function (xhr) {
|
admin/assets/js/cht-scripts.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
function check_for_number_chaty(t,e){return!!(""!=t&&("+"==t[0]&&(t=t.substr(1,t.length)),"Phone"==e&&"*"==t[0]&&(t=t.substr(1,t.length)),isNaN(t)))}function check_for_preview_pos(){if(jQuery(".chaty-setting-form").length){if(jQuery(window).width()>1179){var t=parseInt(jQuery(".chaty-setting-form").offset().top);jQuery(".btn-save-sticky").css("top",t+58),jQuery(".btn-help, .preview-help-btn").css("top",t+58+145),jQuery("a.remove-chaty-widget-sticky").css("top",t+58+145+119)}else jQuery(".btn-save-sticky").attr("style",""),jQuery(".btn-help, .preview-help-btn").attr("style",""),jQuery("a.remove-chaty-widget-sticky").attr("style","")}}jQuery(function(t){"use strict";var e,a=!1,c=!1,n=!1,i=!1,o=!1,s=!1,l=!1;function r(){if(t(".chaty-popup").hide(),0==t("#cht-form .js-chanel-desktop").length||0==t("#cht-form .js-chanel-mobile").length)return t("#no-device-popup").show(),!1;if(0==t("#cht-form .js-chanel-desktop:checked").length&&0==t("#cht-form .js-chanel-mobile:checked").length)return t("#device-popup").show(),!1;var e=0;return(t("#channels-selected-list > li:not(#chaty-social-close)").find(".channels__input").each(function(){""==jQuery.trim(t(this).val())&&e++}),e!=t("#channels-selected-list > li:not(#chaty-social-close)").find(".channels__input").length||t("#chaty-social-Contact_Us").length)?h():(t("#no-device-value").show(),!1)}function h(){return(t(".chaty-popup").hide(),t("#trigger_on_time").is(":checked")||t("#chaty_trigger_on_exit").is(":checked")||t("#chaty_trigger_on_scroll").is(":checked"))?d():(t("#trigger-popup").show(),!1)}function d(){return(t(".chaty-popup").hide(),t(".cht_active").is(":checked"))?(a=!0,t("#cht-form").trigger("submit"),!0):(t("#status-popup").show(),!1)}function p(){if(c){if(n){if(i){if(o){if(s)!l&&(l=!0,t("#channels-selected-list .phone-number").length&&t("#channels-selected-list .phone-number").each(function(){if(""!=jQuery.trim(t(this).val())&&jQuery.trim(t(this).val()).length>13)return t("#custom-message-popup .chaty-popup-header").text(t(this).data("label")+" number is not valid"),t("#custom-message-popup .chaty-popup-body").text("Seems like the "+t(this).data("label")+" number you're trying to enter isn't valid. Would you like to publish it anyway?"),t("#custom-message-popup").show(),!1}));else if(s=!0,t("#cht-form #Viber").length&&""!=t("#cht-form #Viber").val()){var a=jQuery.trim(t("#cht-form #Viber").val());if(e=check_for_number_chaty(a,"Viber"))return t("#custom-message-popup .chaty-popup-header").text("Viber number is not valid"),t("#custom-message-popup .chaty-popup-body").text("Seems like the Viber number you're trying to enter isn't in the right syntax. Would you like to publish it anyway?"),t("#custom-message-popup").show(),!1}}else if(o=!0,t("#cht-form #SMS").length&&""!=t("#cht-form #SMS").val()){var a=jQuery.trim(t("#cht-form #SMS").val());if(e=check_for_number_chaty(a,"SMS"))return t("#custom-message-popup .chaty-popup-header").text("SMS number is not valid"),t("#custom-message-popup .chaty-popup-body").text("Seems like the SMS number you're trying to enter isn't in the right syntax. Would you like to publish it anyway?"),t("#custom-message-popup").show(),!1}}else if(i=!0,t("#cht-form #Facebook_Messenger").length&&""!=t("#cht-form #Facebook_Messenger").val()){var a=jQuery.trim(t("#Facebook_Messenger").val());if(t("#cht-form #Facebook_Messenger").val(a),!/(?:http:\/\/)?facebook\.com\/(?:(?:\w)*#!\/)?(?:pages\/)?(?:[\w\-]*\/)*([\w\-]*)/.test(a)&&!/(?:http:\/\/)?m\.me\/(?:(?:\w)*#!\/)?(?:pages\/)?(?:[\w\-]*\/)*([\w\-]*)/.test(a))return t("#custom-message-popup .chaty-popup-header").text("Facebook page's URL is not valid"),t("#custom-message-popup .chaty-popup-body").text("Please make sure your Facebook page's URL looks like, <br/>https://m.me/YOURPAGE"),t("#custom-message-popup").show(),!1}}else if(n=!0,t("#cht-form #Phone").length&&""!=t("#cht-form #Phone").val()){var a=jQuery.trim(t("#cht-form #Phone").val());if(e=check_for_number_chaty(a,"Phone"))return t("#custom-message-popup .chaty-popup-header").text("Phone number is not valid"),t("#custom-message-popup .chaty-popup-body").text("Seems like the phone number you're trying to enter isn't in the right syntax. Would you like to publish it anyway?"),t("#custom-message-popup").show(),!1}}else if(c=!0,t("#cht-form #Whatsapp").length&&""!=t("#cht-form #Whatsapp").val()){var a=jQuery.trim(t("#cht-form #Whatsapp").val());if(e=check_for_number_chaty(a,"Whatsapp"))return t("#custom-message-popup .chaty-popup-header").text("Whatsapp number is not valid"),t("#custom-message-popup .chaty-popup-body").text("Seems like the WhatsApp number you're trying to enter isn't in the right syntax. Would you like to publish it anyway?"),t("#custom-message-popup").show(),!1}return r()}t(document).ready(function(){t(".form-fonts").SumoSelect({placeholder:"Select font family",csvDispCount:3}),t("#chaty_attention_effect, #chaty_default_state").SumoSelect({placeholder:"Select font family",csvDispCount:3}),t(document).on("click","#chaty-social-channel",function(){t("#current_step").val(0)}),t(document).on("click","#chaty-app-customize-widget",function(){t("#current_step").val(1)}),t(document).on("click","#chaty-triger-targeting",function(){t("#current_step").val(2)}),jQuery(document).on("click","#update-chaty-traffic-source-rule",function(t){jQuery(".traffic-options-box").addClass("active"),jQuery("#chaty_traffic_source").val("yes")}),jQuery(document).on("click","#remove-traffic-rules",function(t){jQuery(".traffic-options-box").removeClass("active"),jQuery("#chaty_traffic_source").val("no")}),jQuery(document).on("click",".remove-traffic-option",function(t){jQuery(this).closest(".custom-traffic-rule").remove()}),t(document).on("click",".chaty-switch-toggle",function(){setTimeout(function(){t(".chaty-field-setting").each(function(){t(this).is(":checked")?t(this).closest(".field-setting-col").find(".field-settings").addClass("active"):t(this).closest(".field-setting-col").find(".field-settings").removeClass("active")})},100)}),t(document).on("change",".chaty-close_form_after-setting",function(){setTimeout(function(){t(".chaty-close_form_after-setting").each(function(){t(this).is(":checked")?t(this).closest(".form-field-setting-col").find(".close_form_after-settings").addClass("active"):t(this).closest(".form-field-setting-col").find(".close_form_after-settings").removeClass("active")})},100)}),t(document).on("click",".agent-button-action, .add-agent-btn",function(t){t.preventDefault(),jQuery("#agent-popup").show()}),t("#channel_input_Whatsapp").length&&(cht_settings.channel_settings.Whatsapp=document.querySelector("#channel_input_Whatsapp"),window.intlTelInput(cht_settings.channel_settings.Whatsapp,{dropdownContainer:document.body,formatOnDisplay:!0,hiddenInput:"full_number",initialCountry:"auto",nationalMode:!1,utilsScript:cht_settings.plugin_url+"admin/assets/js/utils.js"})),t(".custom-channel-Whatsapp:not(#channel_input_Whatsapp)").length&&t(".custom-channel-Whatsapp:not(#channel_input_Whatsapp)").each(function(){var e=t(this).closest("li.chaty-channel").data("id");void 0!=e&&t("#channel_input_"+e).length&&(cht_settings.channel_settings[e]=document.querySelector("#channel_input_"+e),window.intlTelInput(cht_settings.channel_settings[e],{dropdownContainer:document.body,formatOnDisplay:!0,hiddenInput:"full_number",initialCountry:"auto",nationalMode:!1,utilsScript:cht_settings.plugin_url+"admin/assets/js/utils.js"}))}),t(document).on("change",".chaty-redirect-setting",function(){setTimeout(function(){t(".chaty-redirect-setting").each(function(){t(this).is(":checked")?t(this).closest(".form-field-setting-col").find(".redirect_action-settings").addClass("active"):t(this).closest(".form-field-setting-col").find(".redirect_action-settings").removeClass("active")})},100)}),t(document).on("click",".email-setting",function(){setTimeout(function(){t(".email-setting-field").each(function(){t(this).is(":checked")?t(this).closest(".form-field-setting-col").find(".email-settings").addClass("active"):t(this).closest(".form-field-setting-col").find(".email-settings").removeClass("active")})},100)});let e=[];jQuery(".channels-icons > .icon.active").each((t,a)=>{e.push(a.dataset.social)}),wp.hooks.doAction("chaty.channel_update",{channel:e,target:null,action:"added",isExceeded:!1}),setTimeout(()=>{t(".whatsapp-welcome-message iframe").contents().find("body").css({backgroundColor:"#fff"})},100),t(document).on("click",".chaty-embedded-window",function(){setTimeout(function(){t(".embedded_window-checkbox").each(function(){if(t(this).is(":checked")){t(this).closest("li.chaty-channel").find(".whatsapp-welcome-message").addClass("active");let e=t(this).closest("li.chaty-channel").find(".whatsapp-welcome-message iframe");e.contents().find("body").css({backgroundColor:"#fff"})}else t(this).closest("li.chaty-channel").find(".whatsapp-welcome-message").removeClass("active")})},300)}),jQuery("input[name='switchPreview']:checked").trigger("change"),t(document).on("change","#cht-form input",function(){c=!1,n=!1,i=!1,o=!1,s=!1,l=!1}),t("#cht-form").on("submit",function(){if(a)return!0;set_social_channel_order();var e=0;return(t("#chaty-page-options .cht-required").length&&t("#chaty-page-options .cht-required").each(function(){""==jQuery.trim(t(this).val())&&(t(this).addClass("cht-input-error"),e++)}),t(".chaty-data-and-time-rules .cht-required").length&&t(".chaty-data-and-time-rules .cht-required").each(function(){""==jQuery.trim(t(this).val())&&(t(this).addClass("cht-input-error"),e++)}),0==e)?p():(t(".cht-input-error:first").focus(),!1)}),t(".chaty-popup-inner").on("click",function(t){t.stopPropagation()}),t(".chaty-popup-outer").on("click",function(e){t(".chaty-popup").hide()}),t(".check-for-numbers").on("click",function(){p()}),t(".check-for-device").on("click",function(){r()}),t(".check-for-triggers").on("click",function(){h()}),t(".check-for-status").on("click",function(){d()}),t(".change-status-and-save").on("click",function(){t(".cht_active").prop("checked",!0),a=!0,t(".chaty-popup").hide(),t("#cht-form").trigger("submit")}),t(".status-and-save").on("click",function(){t(".cht_active").prop("checked",!1),a=!0,t(".chaty-popup").hide(),t("#cht-form").trigger("submit")}),jQuery(document).on("click","#create-date-rule",function(t){jQuery("#date-schedule").addClass("active"),jQuery("#cht_date_rules").val("yes")}),jQuery(document).on("click","#remove-date-rule",function(t){jQuery("#date-schedule").removeClass("active"),jQuery("#cht_date_rules").val("no")})})}),function(t){jQuery(window).on("popstate",function(t){window.onbeforeunload=null,window.history&&window.history.pushState&&window.history.back()}),jQuery(document).ready(function(){jQuery(".chaty-table").length||jQuery("body input, body .icon, body textarea, body .btn-cancel:not(.close-btn-set) ").on("click",function(t){window.onbeforeunload=function(t){(t=t||window.event).preventDefault=!0,t.cancelBubble=!0,t.returnValue="Your beautiful goodbye message"}}),jQuery(document).on("submit","form",function(t){window.onbeforeunload=null}),jQuery(document).on("change",".channel-select-input",function(e){var a=t(this).closest("li").attr("data-id");jQuery.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{social:jQuery(this).val(),channel:a,action:"get_chaty_settings"},success:function(e){1==e.status&&("Whatsapp"==e.data.slug?t("#channel_input_"+e.channel).length&&(cht_settings.channel_settings[e.channel]=document.querySelector("#channel_input_"+e.channel),window.intlTelInput(cht_settings.channel_settings[e.channel],{dropdownContainer:document.body,formatOnDisplay:!0,hiddenInput:"full_number",initialCountry:"auto",nationalMode:!1,utilsScript:cht_settings.plugin_url+"admin/assets/js/utils.js"})):t("#chaty-social-"+e.channel+" .channels__input-box").html("<input type='text' class='channels__input' name='cht_social_"+e.channel+"[value]' id='channel_input_"+e.channel+"' />"),jQuery(".custom-icon-"+e.channel+" svg").html(e.data.svg),jQuery("#chaty-social-"+e.channel).attr("data-channel",e.data.slug),jQuery("#chaty-social-"+e.channel).find(".sp-preview-inner").css("background-color",e.data.color),jQuery("#chaty-social-"+e.channel).find(".chaty-color-field").val(e.data.color),jQuery("#chaty-social-"+e.channel).find(".channels__input").attr("placeholder",e.data.placeholder),jQuery("#chaty-social-"+e.channel).find(".channel-example").text(e.data.example),jQuery("#chaty-social-"+e.channel).find(".chaty-title").val(e.data.title),jQuery("#chaty-social-"+e.channel).find(".icon").attr("data-title",e.data.title),jQuery("#chaty-social-"+e.channel).find(".chaty-color-field").trigger("change"),jQuery(".help-section").html(""),""!=e.data.help_link?jQuery(".help-section").html('<div class="viber-help"><a target="_blank" href="'+e.data.help_link+'">'+e.data.help_title+"</a></div>"):""!=e.data.help_text&&jQuery(".help-section").html('<div class="viber-help"><span class="help-text">'+e.data.help_text+'</span><span class="help-title">'+e.data.help_title+"</span></div>"))}})}),jQuery(document).on("click","#chaty_icons_view",function(t){jQuery(".page-body .chaty-widget").removeClass("vertical").removeClass("horizontal"),jQuery(".page-body .chaty-widget").addClass(jQuery(this).val())}),jQuery(".upg").on("click",function(t){jQuery(".valid_domain_input").val(jQuery(".valid_domain_input").val().replace(" ","")),/^(http(s)?:\/\/)?(www\.)?[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/.test(jQuery(".valid_domain_input").val())||(t.preventDefault(),jQuery(".valid_domain").fadeIn().css({display:"block"}))}),jQuery(document).on("blur","#channels-selected-list > li:not(#chaty-social-close) .channels__input",function(){jQuery(this).hasClass("border-red")&&""!=jQuery(this).val()&&jQuery(this).removeClass("border-red")});var e=1000000003;jQuery(".show_up").on("click",function(){e+=10,jQuery("#upgrade-modal").css({"z-index":e,display:"block","margin-left":"-258px"})}),jQuery(".color-picker-btn, .color-picker-btn-close, .color-picker-custom button").on("click",function(t){t.preventDefault(),jQuery(".color-picker-box").toggle(),jQuery(".color-picker-btn").toggle()}),t(window).on("click",function(t){0===jQuery(t.target).parents(".color-picker-dropdown").length&&(jQuery(".color-picker-btn").show(),jQuery(".color-picker-box").hide())}),jQuery(".color-picker-radio input").on("change",function(){var t=jQuery(this);if(jQuery('.color-picker-custom input[name="cht_custom_color"]').val(""),jQuery(".color-picker-custom .circle").html("?").css({"background-color":"#fff"}),t.prop("checked")){jQuery(".color-picker-radio input").prop("checked",!1),t.prop("checked",!0);var e=t.val(),a=t.prop("title")}else e=jQuery(".color-picker-custom input").val(),a="Custom";""!=e&&-1==e.indexOf("#")&&(e="#"+e),jQuery(".color-picker-btn .circle").css({backgroundColor:e}),jQuery(".color-picker-btn .text").text(a),jQuery("#chaty-social-close ellipse").attr("fill",e)}),jQuery(".color-picker-custom input").on("change",function(){jQuery(".color-picker-radio input").prop("checked",!1);var t=jQuery(this).val();""!=t&&-1==t.indexOf("#")&&(t="#"+t),jQuery(".color-picker-btn .circle").css({backgroundColor:t}),jQuery(".color-picker-btn .text").text("Custom"),jQuery("#chaty-social-close ellipse").attr("fill",t)}),jQuery('[name="cht_position"]').on("change",function(){jQuery("#positionCustom").prop("checked")?jQuery("#positionPro").show():jQuery("#positionPro").hide()}),jQuery(".update_token").on("click",function(e){e.preventDefault();var a=jQuery('input[name="cht_token"]').val();t.ajax({type:"POST",url:ajaxurl,data:{action:"add_token",nonce_code:cht_nonce_ajax.cht_nonce,token:a},beforeSend:function(t){},success:function(t){t?(alert("Your pro plan is activated"),location.reload()):alert("You`ve entered a wrong token")},error:function(t,e,a){}})})})}(jQuery),function(t){jQuery(document).ready(function(){n();var e=jQuery(".channels-icons > .icon-sm"),a=jQuery(".social-inputs"),c=0;function n(){!jQuery("section").is("#pro")&&(jQuery(".channels-selected__item").length<=1?jQuery(".channels-selected__item").hide():jQuery(".channels-selected__item").length>=2&&jQuery(".channels-selected__item").show())}jQuery("input[name=cht_custom_color]").on("keyup",function(t){var e=jQuery(this).val();jQuery(".circle").html(""),""!=e&&(-1==e.indexOf("#")&&(e="#"+e),jQuery(".color-picker-custom .circle").css({"background-color":e})),jQuery(this).val().length<1&&jQuery(".color-picker-custom .circle").html("?")}),e.on("click",function(){jQuery(".popover").removeClass("shake-it"),++c,n();var i=jQuery(this),o=i.data("social");if(a.find(".social-form-group"),i.hasClass("active")){var s=","+jQuery(this).attr("data-social"),l=jQuery(".add_slug").val();l=l.replace(s,""),jQuery(".add_slug").val(l),l=l.replace(s,""),jQuery(".add_slug").val(l),l=l.replace(s,""),jQuery(".add_slug").val(l),l=l.replace(s,""),jQuery(".add_slug").val(l),i.toggleClass("active");let h=[];jQuery(".channels-icons > .icon.active").each((t,e)=>{h.push(e.dataset.social)}),wp.hooks.doAction("chaty.channel_update",{channel:h,target:o,action:"removed",isExceeded:!1});return}if(e.addClass("disabled"),icon=jQuery(this).data("social"),"1"==jQuery(".add_slug").val().indexOf(icon)&&""!=jQuery(".add_slug").val()){var s=","+icon,l=jQuery(".add_slug").val();l=l.replace(s,""),jQuery(".add_slug").val(l),l=l.replace(s,""),jQuery(".add_slug").val(l),l=l.replace(s,""),jQuery(".add_slug").val(l)}else jQuery(".add_slug").val(jQuery(".add_slug").val()+","+jQuery(this).attr("data-social"));if(!jQuery("section").is("#pro")&&jQuery(".channels-icons > .icon.active").length>=2){e.removeClass("disabled");let d=[];jQuery(".channels-icons > .icon.active").each((t,e)=>{d.push(e.dataset.social)}),wp.hooks.doAction("chaty.channel_update",{channel:d,target:o,action:"added",isExceeded:!0});return}if(i.toggleClass("active"),jQuery("section").is("#pro"))var p="pro";else var p="free";t.ajax({type:"POST",dataType:"json",url:ajaxurl,data:{action:"choose_social",social:o,nonce_code:cht_nonce_ajax.cht_nonce,version:p,widget_index:jQuery("#widget_index").val()},beforeSend:function(t){},success:function(a){var c=jQuery(a),i=c.find(".icon").data("title");c.data("channel"),!jQuery('.channels-selected div[data-social="'+i+'"]').length&&(jQuery("#chaty-social-close").before(c),jQuery("#chaty-social-"+o+" .chaty-whatsapp-setting-textarea").length&&(editorId=jQuery("#chaty-social-"+o+" .chaty-whatsapp-setting-textarea").attr("id"),tinymce.execCommand("mceAddEditor",!0,editorId))),e.removeClass("disabled"),t("#iconWidget").show(),r(),n(),set_social_channel_order(),check_for_chaty_close_button(),"Whatsapp"==o&&t("#channel_input_Whatsapp").length&&(cht_settings.channel_settings.Whatsapp=document.querySelector("#channel_input_Whatsapp"),window.intlTelInput(cht_settings.channel_settings.Whatsapp,{dropdownContainer:document.body,formatOnDisplay:!0,hiddenInput:"full_number",initialCountry:"auto",nationalMode:!1,utilsScript:cht_settings.plugin_url+"admin/assets/js/utils.js"})),jQuery(".custom-channel-Whatsapp").length&&jQuery(".custom-channel-Whatsapp").each(function(){if(!jQuery(this).closest(".iti__flag-container").length){var t=jQuery(this).closest("li.chaty-channel").data("id");jQuery("#channel_input_"+t).length&&(cht_settings.channel_settings[t]=document.querySelector("#channel_input_"+t),window.intlTelInput(cht_settings.channel_settings[t],{dropdownContainer:document.body,formatOnDisplay:!0,hiddenInput:"full_number",initialCountry:"auto",nationalMode:!1,utilsScript:cht_settings.plugin_url+"admin/assets/js/utils.js"}))}}),jQuery(document).trigger("chatyColorPicker/trigger",[{$scope:jQuery(`#chaty-social-${o}`),element:".chaty-color-field"}]);let s=[];jQuery(".channels-icons > .icon.active").each((t,e)=>{s.push(e.dataset.social)}),wp.hooks.doAction("chaty.channel_update",{channel:s,target:o,action:"added",isExceeded:!1})},error:function(t,e,a){}}),n()}),jQuery("body").on("click",".icon, .btn-cancel:not(.close-btn-set)",function(t){if(!jQuery(this).hasClass("close-btn-set")){if(t.preventDefault(),!(jQuery(this).hasClass("icon")&&jQuery(this).hasClass("active"))){if(icon=jQuery(this).data("social"),jQuery(this).hasClass("btn-cancel")){jQuery('.icon.active[data-social^="'+icon+'"]').removeClass("active");var e=","+icon,a=jQuery(".add_slug").val();a=a.replace(e,""),jQuery(".add_slug").val(a);let c=[];jQuery(".channels-icons > .icon.active").each((t,e)=>{c.push(e.dataset.social)}),wp.hooks.doAction("chaty.channel_update",{channel:c,target:icon,action:"removed",isExceeded:!1})}jQuery("#chaty-social-"+icon).remove(),jQuery(this).parent(".channels-selected__item"),r(),n(),set_social_channel_order(),check_for_chaty_close_button()}}}),jQuery(".btn-help").on("click",function(t){window.open("https://premio.io/help/chaty/","_blank")}),jQuery(".free-custom-radio, .free-custom-checkbox").on("click",function(t){t.stopPropagation()});var i=jQuery("[name=cht_cta]"),o=jQuery(".preview .tooltip-show");i.on("keyup",function(){var t=jQuery(".preview .page .icon");i.val().length>=1?t.removeClass("no-tooltip"):t.addClass("no-tooltip"),o.attr("data-title",i.val())});var s='<svg version="1.1" id="ch" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="-496 507.7 54 54" style="enable-background:new -496 507.7 54 54;" xml:space="preserve">\n <style type="text/css">.st0 {fill: #A886CD;} .st1 {fill: #FFFFFF;}\n </style><g><circle class="st0" cx="-469" cy="534.7" r="27"/></g><path class="st1" d="M-459.9,523.7h-20.3c-1.9,0-3.4,1.5-3.4,3.4v15.3c0,1.9,1.5,3.4,3.4,3.4h11.4l5.9,4.9c0.2,0.2,0.3,0.2,0.5,0.2 h0.3c0.3-0.2,0.5-0.5,0.5-0.8v-4.2h1.7c1.9,0,3.4-1.5,3.4-3.4v-15.3C-456.5,525.2-458,523.7-459.9,523.7z"/>\n <path class="st0" d="M-477.7,530.5h11.9c0.5,0,0.8,0.4,0.8,0.8l0,0c0,0.5-0.4,0.8-0.8,0.8h-11.9c-0.5,0-0.8-0.4-0.8-0.8l0,0\n C-478.6,530.8-478.2,530.5-477.7,530.5z"/>\n <path class="st0" d="M-477.7,533.5h7.9c0.5,0,0.8,0.4,0.8,0.8l0,0c0,0.5-0.4,0.8-0.8,0.8h-7.9c-0.5,0-0.8-0.4-0.8-0.8l0,0\n C-478.6,533.9-478.2,533.5-477.7,533.5z"/>\n </svg>',l=document.getElementById("iconWidget");function r(){change_custom_preview()}function h(t){return t.element,jQuery('<span><i class="'+t.text+'"></i> '+t.text+"</span>")}function d(t,e){if(jQuery("#iconWidget").length){if(t?l.innerHTML=t:l.innerHTML="",e){var a=jQuery(".color-picker-custom input").val()?jQuery(".color-picker-custom input").val():jQuery(".color-picker-radio input:checked").val();""!=a&&-1==a.indexOf("#")&&(a="#"+a),jQuery(".preview .page #iconWidget svg circle").css({fill:a}),jQuery(".preview .page .chaty-close-icon ellipse").css({fill:a}),jQuery("#chaty-social-close ellipse").attr("fill",a)}"open"==(thisVal=jQuery("#chaty_default_state").val())?jQuery(".hide-show-button").addClass("active"):jQuery(".hide-show-button").removeClass("active"),jQuery(".chaty-widget").removeClass("active").removeClass("hover").removeClass("click").removeClass("hide_arrow"),"open"==thisVal?(jQuery(".chaty-widget").addClass("active").addClass("click"),"open"==thisVal&&jQuery(c+":checked").length>1&&jQuery(".chaty-widget").addClass("hide_arrow")):"hover"==thisVal?jQuery(".chaty-widget").addClass("hover"):jQuery(".chaty-widget").addClass("click"),jQuery(".chaty-channels").html("");var c=".js-chanel-mobile";if(p())var c=".js-chanel-desktop";"open"==thisVal&&jQuery(c+":checked").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()),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-radio 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-radio input").attr("disabled",!1)),jQuery(".page-body .chaty-widget").removeClass("vertical").removeClass("horizontal"),jQuery(c+":checked").length>1?(jQuery(c+":checked").each(function(){var t=jQuery(this).closest("li").find(".icon").html(),t=jQuery(this).closest("li").find(".icon").html(),e=jQuery(this).closest("li").find(".chaty-title").val(),a=jQuery(this).closest(".channels-selected__item").hasClass("img-active")?"img-active":"";""!=e&&(e="<span class='social-tooltip'>"+e+"</span>"),jQuery(".chaty-channels").append("<div class='social-item-box "+a+"'><span class='tooltip-icon'>"+t+"</span>"+e+"</div>")}),"open"==jQuery("#chaty_default_state").val()&&jQuery("#cht_close_button").is(":checked")?(jQuery("#iconWidget").css("display","block"),jQuery(".chaty-widget .tooltiptext").css("display","block"),jQuery(".chaty-widget").removeClass("hide-arrow")):"open"!=jQuery("#chaty_default_state").val()?(jQuery("#iconWidget").css("display","block"),jQuery(".chaty-widget .tooltiptext").css("display","block"),jQuery(".chaty-widget").removeClass("hide-arrow")):"open"==jQuery("#chaty_default_state").val()&&(jQuery("#iconWidget").hide(),jQuery(".chaty-widget .tooltiptext").hide(),jQuery(".chaty-widget").addClass("hide-arrow")),jQuery(".chaty-widget").removeClass("has-single"),jQuery(".page-body .chaty-widget").addClass(jQuery("#chaty_icons_view").val())):1==jQuery(c+":checked").length?("open"!=jQuery("#chaty_default_state").val()||jQuery("#cht_close_button").is(":checked")?"open"!=jQuery("#chaty_default_state").val()&&(jQuery("#iconWidget").css("display","block"),jQuery(".chaty-widget .tooltiptext").css("display","block"),jQuery(".chaty-widget").removeClass("hide-arrow")):(jQuery("#iconWidget").css("display","block"),jQuery(".chaty-widget .tooltiptext").css("display","block"),jQuery(".chaty-widget").removeClass("hide-arrow")),jQuery(".chaty-widget").addClass("has-single"),jQuery(".chaty-widget").removeClass("hide-arrow")):0==jQuery(c+":checked").length&&(jQuery("#iconWidget").hide(),jQuery(".chaty-widget .tooltiptext").hide(),jQuery(".chaty-widget").addClass("hide-arrow"),jQuery(".chaty-widget").removeClass("has-single")),jQuery(".chaty-channels .remove-icon-img").remove(),jQuery("#trigger_on_time").is(":checked")?jQuery("#chaty_trigger_time").attr("readonly",!1):jQuery("#chaty_trigger_time").attr("readonly",!0),jQuery("#chaty_trigger_hide").is(":checked")?jQuery("#chaty_trigger_hide_time").attr("readonly",!1):jQuery("#chaty_trigger_hide_time").attr("readonly",!0),jQuery("#chaty_trigger_on_scroll").is(":checked")?jQuery("#chaty_trigger_on_page_scroll").attr("readonly",!1):jQuery("#chaty_trigger_on_page_scroll").attr("readonly",!0),""==jQuery(".chaty-widget .tooltiptext").text()?jQuery(".chaty-widget .tooltiptext").hide():"open"==jQuery("#chaty_default_state").val()&&jQuery(c+":checked").length>1?jQuery(".chaty-widget .tooltiptext").hide():jQuery(".chaty-widget .tooltiptext").css("display","block")}}function p(){return!!jQuery("#previewDesktop").is(":checked")}jQuery(".color-picker-radio input:checked").val(),jQuery(document).on("keyup","textarea.test_textarea",function(){r()}),jQuery(".js-switch-preview").on("change",function(){p()?jQuery(this).closest(".preview").removeClass("mobiel-view"):jQuery(this).closest(".preview").addClass("mobiel-view"),r()}),jQuery(document).on("change","input[name='cht_pending_messages']",function(){jQuery("#cht_pending_messages").is(":checked")?jQuery(".pending-message-items").addClass("active"):jQuery(".pending-message-items").removeClass("active"),r()}),jQuery(document).on("change","#cht_number_of_messages",function(){r()}),jQuery(document).on("change","#cht_number_color, #cht_number_bg_color",function(){r()}),jQuery(document).on("keyup","#cht_number_of_messages",function(){r()}),jQuery(document).on("blur","#cht_number_of_messages",function(){r()}),jQuery(document).on("change",".js-chanel-icon",function(){r()}),jQuery(document).on("change",".js-widget-i",function(t){s=t.target.classList.contains("js-upload")?jQuery(".file-preview-image").last().parent().html():jQuery("i[data-type="+jQuery(".js-widget-i:checked").val()+"]").html(),r()}),"chat-image"!==jQuery(".js-widget-i:checked").attr("data-type")&&(s=jQuery("i[data-type="+jQuery(".js-widget-i:checked").attr("data-type")+"]").html(),r())}),jQuery(document).ready(function(){jQuery(".toast-message").length&&(jQuery(".toast-message").show(),jQuery(".toast-message").addClass("active"),setTimeout(function(){jQuery(".toast-message").removeClass("active")},5e3)),jQuery(document).on("click",".toast-close-btn a",function(t){t.preventDefault(),jQuery(".toast-message").removeClass("active")}),jQuery(document).on("click",".chaty-popup-box button, #chaty-intro-popup",function(e){e.stopPropagation();var a=jQuery("#chaty_update_popup_status").val();t("#chaty-intro-popup").remove(),t.ajax({type:"POST",url:ajaxurl,data:{action:"update_popup_status",nonce:a},beforeSend:function(t){},success:function(t){},error:function(t,e,a){}})}),jQuery(document).on("click",".chaty-popup-box",function(t){t.stopPropagation()}),jQuery(document).on("click",".remove-chaty-options",function(e){e.preventDefault(),e.stopPropagation(),confirm("Are you sure you want to delete this widget?")&&t.ajax({type:"POST",url:ajaxurl,data:{action:"remove_chaty_widget",nonce_code:cht_nonce_ajax.cht_nonce,widget_index:jQuery("#widget_index").val()},beforeSend:function(t){},success:function(t){window.location=t},error:function(t,e,a){}})}),window.location.href,window.location.href.indexOf("page=chaty-app&widget=")>-1&&jQuery("#toplevel_page_chaty-app .wp-submenu.wp-submenu-wrap li").each(function(){var t=jQuery(this).find("a").attr("href");void 0!==t&&(jQuery(this).removeClass("current"),window.location.href.indexOf(t)>-1&&t.indexOf("&widget=")>-1&&jQuery(this).addClass("current"))})})}(jQuery),jQuery(window).on("resize",function(){check_for_preview_pos()}),jQuery(window).on("scroll",function(){check_for_preview_pos()}),jQuery(document).ready(function(){check_for_preview_pos()});var totalPageOptions=0,pageOptionContent="",totalDateAndTimeOptions=0,dateAndTimeOptionContent="";jQuery(document).ready(function(){var t=!1;function e(){jQuery(".chaty-whatsapp-setting-textarea").length&&jQuery(".chaty-whatsapp-setting-textarea").each(function(){jQuery("#cht_social_embedded_message_"+jQuery(this).data("id")+"_ifr").length&&tinymce.get(jQuery(this).attr("id")).remove(),tinymce.execCommand("mceAddEditor",!0,jQuery(this).attr("id"))})}(/(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)))&&(t=!0),totalPageOptions=parseInt(jQuery(".chaty-page-option").length),pageOptionContent=jQuery(".chaty-page-options-html").html(),jQuery(".chaty-page-options-html").remove(),totalDateAndTimeOptions=parseInt(jQuery(".chaty-date-time-option").length),dateAndTimeOptionContent=jQuery(".chaty-date-and-time-options-html").html(),jQuery(".chaty-date-and-time-options-html").remove(),jQuery(".create-rule").on("click",function(){let t=jQuery(this).parents(".chaty-option-box");t.find(".chaty-page-options").removeClass("hidden"),t.find(".remove-rules").removeClass("hidden").addClass("inline-block")}),jQuery(".remove-rules").on("click",function(){let t=jQuery(this).parents(".chaty-option-box");t.find(".chaty-page-options").addClass("hidden"),t.find(".remove-rules").removeClass("inline-block").addClass("hidden")}),jQuery(document).on("change","#chaty_attention_effect",function(){change_custom_preview()}),jQuery(document).on("change","input[name='cht_color']:checked",function(){var t=jQuery(this),e=t.val(),a=t.prop("title");jQuery(".color-picker-btn .circle").css({backgroundColor:e}),jQuery(".color-picker-btn .text").text(a),jQuery("#chaty-social-close ellipse").attr("fill",e),jQuery(".preview .page #iconWidget svg circle").css({fill:e}),jQuery(".preview .page .chaty-close-icon ellipse").css({fill:e}),jQuery("#cht_custom_color").val(jQuery(this).val()),change_custom_preview()}),jQuery('input[name="cht_color"]:checked').trigger("change"),jQuery(document).on("change","input[name='cht_position']:checked",function(){change_custom_preview()}),setInterval(function(){var t=jQuery("#chaty_attention_effect").attr("data-effect");""!=t?(jQuery("#iconWidget").removeClass("chaty-animation-"+t),jQuery("#iconWidget").removeClass("start-now"),setTimeout(function(){jQuery("#iconWidget").addClass("chaty-animation-"+jQuery("#chaty_attention_effect").val()).addClass("start-now")},1e3)):jQuery("#chaty_attention_effect").attr("data-effect",jQuery("#chaty_attention_effect").val())},5e3),jQuery(document).on("click",".remove-chaty",function(){jQuery(".page-options").toggle()}),jQuery(document).on("click",".remove-page-option",function(){jQuery(".chaty-data-and-time-rules ").toggle()}),jQuery("#image-upload-content .custom-control-label").on("click",function(t){return t.stopPropagation(),jQuery(this).closest(".custom-control").find("input[type=radio]").attr("checked",!0),jQuery(".js-widget-i").trigger("change"),!1}),jQuery(document).trigger("chatyColorPicker/trigger",[{$scope:jQuery(document),element:".chaty-color-field"}]),jQuery(".chaty-color-field").on("change",function(){chaty_set_bg_color(),change_custom_preview()}),jQuery(".remove-chaty-img").on("click",function(t){t.stopPropagation()}),t||jQuery("#channels-selected-list").sortable({placeholder:"ui-chaty-state-hl",items:"li.chaty-channel:not(#chaty-social-close)",handle:".move-icon",stop:function(){e()},update:function(t,a){set_social_channel_order(),change_custom_preview(),e()}}),jQuery(document).ready(function(){e()}),jQuery(".close-button-img img, .close-button-img .image-upload").on("click",function(){var t=wp.media({title:"Upload Image",multiple:!1,library:{type:"image"}}).open().on("select",function(e){imageData=t.state().get("selection").first().toJSON(),jQuery(".close-button-img").addClass("active"),jQuery(".close-button-img input").val(imageData.id),jQuery(".close-button-img img").attr("src",imageData.url),change_custom_preview()})}),jQuery(".remove-close-img").on("click",function(){default_image=jQuery("#default_image").val(),jQuery(".close-button-img").removeClass("active"),jQuery(".close-button-img input").val(""),jQuery(".close-button-img img").attr("src",default_image),change_custom_preview()}),jQuery(document).on("click",".chaty-widget.click",function(t){t.preventDefault(),jQuery(".chaty-widget").toggleClass("active")}),jQuery(document).on("change",".url-options.cht-required",function(t){thisVal=jQuery(this).val(),newURL=siteURL=jQuery("#chaty_site_url").val(),"page_has_url"==thisVal?newURL=siteURL:"page_contains"==thisVal?newURL=siteURL+"%s%":"page_start_with"==thisVal?newURL=siteURL+"s%":"page_end_with"==thisVal&&(newURL=siteURL+"%s"),jQuery(this).closest(".url-content").find(".chaty-url").text(newURL)}),check_for_chaty_close_button(),chaty_set_bg_color(),change_custom_preview(),jQuery(".chaty-settings.cls-btn a, .close-btn-set").on("click",function(t){t.preventDefault(),jQuery(".cls-btn-settings, .close-btn-set").toggleClass("active")}),0==jQuery("input[name='cht_position']:checked").length&&(jQuery("#right-position").attr("checked",!0),jQuery("input[name='cht_position']:checked").trigger("change")),0==jQuery("input[name='widget_icon']:checked").length&&(jQuery("input[name='widget_icon']:first").attr("checked",!0),jQuery("input[name='widget_icon']:checked").trigger("change")),jQuery(document).on("change",".form-fonts",function(){change_custom_preview()})}),jQuery(window).on("load",function(){check_for_chaty_close_button(),chaty_set_bg_color(),jQuery(".chaty-page-options .chaty-page-option").removeClass("last"),jQuery(".chaty-page-options .chaty-page-option:last").addClass("last"),jQuery(".url-options.cht-required").each(function(){jQuery(this).trigger("change")})});var selectedsocialSlug="";function upload_chaty_image(t){selectedsocialSlug=t;var e=wp.media({title:"Upload Image",multiple:!1,library:{type:"image"}}).open().on("select",function(t){imageData=e.state().get("selection").first().toJSON(),jQuery("#cht_social_image_"+selectedsocialSlug).val(imageData.id),jQuery(".custom-image-"+selectedsocialSlug+" img").attr("src",imageData.url),jQuery("#chaty-social-"+selectedsocialSlug+" .channels-selected__item").addClass("img-active"),change_custom_preview()})}function toggle_chaty_setting(t){if(jQuery("#chaty-social-"+t).find(".chaty-advance-settings").toggle(),jQuery("#chaty-social-"+t).find(".chaty-advance-settings").toggleClass("active"),"Contact_Us"==t&&jQuery("#Contact_Us-close-btn").length){var e=jQuery("#Contact_Us-close-btn").data("nonce");jQuery("#Contact_Us-close-btn").hasClass("active")||(jQuery("#Contact_Us-close-btn").addClass("active"),jQuery.ajax({type:"POST",url:ajaxurl,data:{nonce:e,action:"update_channel_setting"},success:function(t){}}))}jQuery("#chaty-social-"+t+" .chaty-advance-settings.active").length&&jQuery("body,html").animate({scrollTop:jQuery("#chaty-social-"+t+" .chaty-advance-settings.active").offset().top-50},500),change_custom_preview()}function chaty_set_bg_color(){jQuery(".chaty-color-field:not(.button-color)").each(function(){""!=jQuery(this).val()&&"#ffffff"!=jQuery(this).val()&&("Linkedin"!=jQuery(this).closest("li").data("id")||"Linkedin"==jQuery(this).closest("li").data("id")&&"#ffffff"!=jQuery(this).val())&&(defaultColor=jQuery(this).val(),jQuery(this).closest(".channels-selected__item").find(".color-element").css("fill",defaultColor),jQuery(this).closest(".channels-selected__item").find(".custom-chaty-image").css("background",defaultColor),jQuery(this).closest(".channels-selected__item").find(".facustom-icon").css("background",defaultColor))}),change_custom_preview()}function upload_qr_code(){var t=wp.media({title:"Upload QR Image",multiple:!1,library:{type:"image"}}).open().on("select",function(e){imageData=t.state().get("selection").first().toJSON(),jQuery("#upload_qr_code_val").val(imageData.id),jQuery("#upload_qr_code img").attr("src",imageData.url),jQuery(".remove-qr-code").addClass("active"),change_custom_preview()})}function remove_qr_code(){jQuery(".remove-qr-code").removeClass("active"),jQuery("#upload_qr_code_val").val(""),default_image=jQuery("#default_image").val(),jQuery("#upload_qr_code img").attr("src",default_image),change_custom_preview()}function remove_chaty_image(t){default_image=jQuery("#default_image").val(),jQuery("#chaty-social-"+t+" .channels-selected__item").removeClass("img-active"),jQuery("#cht_social_image_"+t).val(""),jQuery("#cht_social_image_src_"+t).attr("src",default_image),change_custom_preview()}var baseIcon='<svg version="1.1" id="ch" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="-496 507.7 54 54" style="enable-background:new -496 507.7 54 54;" xml:space="preserve">\n <style type="text/css">.st0 {fill: #A886CD;} .st1 {fill: #FFFFFF;}\n </style><g><circle class="st0" cx="-469" cy="534.7" r="27"/></g><path class="st1" d="M-459.9,523.7h-20.3c-1.9,0-3.4,1.5-3.4,3.4v15.3c0,1.9,1.5,3.4,3.4,3.4h11.4l5.9,4.9c0.2,0.2,0.3,0.2,0.5,0.2 h0.3c0.3-0.2,0.5-0.5,0.5-0.8v-4.2h1.7c1.9,0,3.4-1.5,3.4-3.4v-15.3C-456.5,525.2-458,523.7-459.9,523.7z"/>\n <path class="st0" d="M-477.7,530.5h11.9c0.5,0,0.8,0.4,0.8,0.8l0,0c0,0.5-0.4,0.8-0.8,0.8h-11.9c-0.5,0-0.8-0.4-0.8-0.8l0,0\n C-478.6,530.8-478.2,530.5-477.7,530.5z"/>\n <path class="st0" d="M-477.7,533.5h7.9c0.5,0,0.8,0.4,0.8,0.8l0,0c0,0.5-0.4,0.8-0.8,0.8h-7.9c-0.5,0-0.8-0.4-0.8-0.8l0,0\n C-478.6,533.9-478.2,533.5-477.7,533.5z"/>\n </svg>',defaultIcon='<svg version="1.1" id="ch" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="-496 507.7 54 54" style="enable-background:new -496 507.7 54 54;" xml:space="preserve">\n <style type="text/css">.st0 {fill: #A886CD;} .st1 {fill: #FFFFFF;}\n </style><g><circle class="st0" cx="-469" cy="534.7" r="27"/></g><path class="st1" d="M-459.9,523.7h-20.3c-1.9,0-3.4,1.5-3.4,3.4v15.3c0,1.9,1.5,3.4,3.4,3.4h11.4l5.9,4.9c0.2,0.2,0.3,0.2,0.5,0.2 h0.3c0.3-0.2,0.5-0.5,0.5-0.8v-4.2h1.7c1.9,0,3.4-1.5,3.4-3.4v-15.3C-456.5,525.2-458,523.7-459.9,523.7z"/>\n <path class="st0" d="M-477.7,530.5h11.9c0.5,0,0.8,0.4,0.8,0.8l0,0c0,0.5-0.4,0.8-0.8,0.8h-11.9c-0.5,0-0.8-0.4-0.8-0.8l0,0\n C-478.6,530.8-478.2,530.5-477.7,530.5z"/>\n <path class="st0" d="M-477.7,533.5h7.9c0.5,0,0.8,0.4,0.8,0.8l0,0c0,0.5-0.4,0.8-0.8,0.8h-7.9c-0.5,0-0.8-0.4-0.8-0.8l0,0\n C-478.6,533.9-478.2,533.5-477.7,533.5z"/>\n </svg>',iconBlock=document.getElementById("iconWidget");function set_social_channel_order(){socialString=[],jQuery("#channels-selected-list li").each(function(){socialString.push(jQuery(this).attr("data-id"))}),socialString=socialString.join(","),jQuery("#cht_numb_slug").val(socialString),check_for_chaty_close_button()}var imageDataEvent=!1;function check_for_chaty_close_button(){jQuery("#channels-selected-list > li:not(.chaty-cls-setting)").length>=2?jQuery("#chaty-social-close").show():jQuery("#chaty-social-close").hide(),change_custom_preview();var t="";jQuery("#channels-selected-list > li").each(function(){"undefined"!=jQuery(this).attr("data-id")&&""!=jQuery(this).attr("data-id")&&(t+=jQuery(this).attr("data-id")+","),t=t.trimRight(",")}),jQuery(".add_slug").val(t)}function getChtPreviewDesktop(){return!!jQuery("#previewDesktop").is(":checked")}function setChtIcon(t,e){if(jQuery("iconWidget").length){if(iconBlock=document.getElementById("iconWidget"),t?iconBlock.innerHTML=t:iconBlock.innerHTML="",e){var a=jQuery(".color-picker-custom input").val()?jQuery(".color-picker-custom input").val():jQuery(".color-picker-radio input:checked").val();jQuery(".preview .page #iconWidget svg circle").css({fill:a}),jQuery(".preview .page .chaty-close-icon ellipse").css({fill:a}),jQuery("#chaty-social-close ellipse").attr("fill",a)}jQuery(".js-widget-i:checked").trigger("change")}}jQuery(".close-chaty-popup-btn").on("click",function(t){t.stopPropagation(),jQuery(".chaty-popup").hide()});
|
1 |
+
function check_for_number_chaty(t,e){return!!(""!=t&&("+"==t[0]&&(t=t.substr(1,t.length)),"Phone"==e&&"*"==t[0]&&(t=t.substr(1,t.length)),isNaN(t)))}function check_for_preview_pos(){if(jQuery(".chaty-setting-form").length){if(jQuery(window).width()>1179){var t=parseInt(jQuery(".chaty-setting-form").offset().top);jQuery(".btn-save-sticky").css("top",t+58),jQuery(".btn-help, .preview-help-btn").css("top",t+58+145),jQuery("a.remove-chaty-widget-sticky").css("top",t+58+145+119)}else jQuery(".btn-save-sticky").attr("style",""),jQuery(".btn-help, .preview-help-btn").attr("style",""),jQuery("a.remove-chaty-widget-sticky").attr("style","")}}jQuery(function(t){"use strict";var e,a=!1,c=!1,n=!1,i=!1,o=!1,s=!1,l=!1;function r(){if(t(".chaty-popup").hide(),0==t("#cht-form .js-chanel-desktop").length||0==t("#cht-form .js-chanel-mobile").length)return t("#no-device-popup").show(),!1;if(0==t("#cht-form .js-chanel-desktop:checked").length&&0==t("#cht-form .js-chanel-mobile:checked").length)return t("#device-popup").show(),!1;var e=0;return(t("#channels-selected-list > li:not(#chaty-social-close)").find(".channels__input").each(function(){""==jQuery.trim(t(this).val())&&e++}),e!=t("#channels-selected-list > li:not(#chaty-social-close)").find(".channels__input").length||t("#chaty-social-Contact_Us").length)?h():(t("#no-device-value").show(),!1)}function h(){return(t(".chaty-popup").hide(),t("#trigger_on_time").is(":checked")||t("#chaty_trigger_on_exit").is(":checked")||t("#chaty_trigger_on_scroll").is(":checked"))?d():(t("#trigger-popup").show(),!1)}function d(){return(t(".chaty-popup").hide(),t(".cht_active").is(":checked"))?(a=!0,t("#cht-form").trigger("submit"),!0):(t("#status-popup").show(),!1)}function p(){if(c){if(n){if(i){if(o){if(s)!l&&(l=!0,t("#channels-selected-list .phone-number").length&&t("#channels-selected-list .phone-number").each(function(){if(""!=jQuery.trim(t(this).val())&&jQuery.trim(t(this).val()).length>13)return t("#custom-message-popup .chaty-popup-header").text(t(this).data("label")+" number is not valid"),t("#custom-message-popup .chaty-popup-body").text("Seems like the "+t(this).data("label")+" number you're trying to enter isn't valid. Would you like to publish it anyway?"),t("#custom-message-popup").show(),!1}));else if(s=!0,t("#cht-form #Viber").length&&""!=t("#cht-form #Viber").val()){var a=jQuery.trim(t("#cht-form #Viber").val());if(e=check_for_number_chaty(a,"Viber"))return t("#custom-message-popup .chaty-popup-header").text("Viber number is not valid"),t("#custom-message-popup .chaty-popup-body").text("Seems like the Viber number you're trying to enter isn't in the right syntax. Would you like to publish it anyway?"),t("#custom-message-popup").show(),!1}}else if(o=!0,t("#cht-form #SMS").length&&""!=t("#cht-form #SMS").val()){var a=jQuery.trim(t("#cht-form #SMS").val());if(e=check_for_number_chaty(a,"SMS"))return t("#custom-message-popup .chaty-popup-header").text("SMS number is not valid"),t("#custom-message-popup .chaty-popup-body").text("Seems like the SMS number you're trying to enter isn't in the right syntax. Would you like to publish it anyway?"),t("#custom-message-popup").show(),!1}}else if(i=!0,t("#cht-form #Facebook_Messenger").length&&""!=t("#cht-form #Facebook_Messenger").val()){var a=jQuery.trim(t("#Facebook_Messenger").val());if(t("#cht-form #Facebook_Messenger").val(a),!/(?:http:\/\/)?facebook\.com\/(?:(?:\w)*#!\/)?(?:pages\/)?(?:[\w\-]*\/)*([\w\-]*)/.test(a)&&!/(?:http:\/\/)?m\.me\/(?:(?:\w)*#!\/)?(?:pages\/)?(?:[\w\-]*\/)*([\w\-]*)/.test(a))return t("#custom-message-popup .chaty-popup-header").text("Facebook page's URL is not valid"),t("#custom-message-popup .chaty-popup-body").text("Please make sure your Facebook page's URL looks like, <br/>https://m.me/YOURPAGE"),t("#custom-message-popup").show(),!1}}else if(n=!0,t("#cht-form #Phone").length&&""!=t("#cht-form #Phone").val()){var a=jQuery.trim(t("#cht-form #Phone").val());if(e=check_for_number_chaty(a,"Phone"))return t("#custom-message-popup .chaty-popup-header").text("Phone number is not valid"),t("#custom-message-popup .chaty-popup-body").text("Seems like the phone number you're trying to enter isn't in the right syntax. Would you like to publish it anyway?"),t("#custom-message-popup").show(),!1}}else if(c=!0,t("#cht-form #Whatsapp").length&&""!=t("#cht-form #Whatsapp").val()){var a=jQuery.trim(t("#cht-form #Whatsapp").val());if(e=check_for_number_chaty(a,"Whatsapp"))return t("#custom-message-popup .chaty-popup-header").text("Whatsapp number is not valid"),t("#custom-message-popup .chaty-popup-body").text("Seems like the WhatsApp number you're trying to enter isn't in the right syntax. Would you like to publish it anyway?"),t("#custom-message-popup").show(),!1}return r()}t(document).ready(function(){t(".form-fonts").SumoSelect({placeholder:"Select font family",csvDispCount:3}),t("#chaty_attention_effect, #chaty_default_state").SumoSelect({placeholder:"Select font family",csvDispCount:3}),t(document).on("click","#chaty-social-channel",function(){t("#current_step").val(0)}),t(document).on("click","#chaty-app-customize-widget",function(){t("#current_step").val(1)}),t(document).on("click","#chaty-triger-targeting",function(){t("#current_step").val(2)}),jQuery(document).on("click","#update-chaty-traffic-source-rule",function(t){jQuery(".traffic-options-box").addClass("active"),jQuery("#chaty_traffic_source").val("yes")}),jQuery(document).on("click","#remove-traffic-rules",function(t){jQuery(".traffic-options-box").removeClass("active"),jQuery("#chaty_traffic_source").val("no")}),jQuery(document).on("click",".remove-traffic-option",function(t){jQuery(this).closest(".custom-traffic-rule").remove()}),t(document).on("click",".chaty-switch-toggle",function(){setTimeout(function(){t(".chaty-field-setting").each(function(){t(this).is(":checked")?t(this).closest(".field-setting-col").find(".field-settings").addClass("active"):t(this).closest(".field-setting-col").find(".field-settings").removeClass("active")})},100)}),t(document).on("change",".chaty-close_form_after-setting",function(){setTimeout(function(){t(".chaty-close_form_after-setting").each(function(){t(this).is(":checked")?t(this).closest(".form-field-setting-col").find(".close_form_after-settings").addClass("active"):t(this).closest(".form-field-setting-col").find(".close_form_after-settings").removeClass("active")})},100)}),t(document).on("click",".agent-button-action, .add-agent-btn",function(t){t.preventDefault(),jQuery("#agent-popup").show()}),t("#channel_input_Whatsapp").length&&(cht_settings.channel_settings.Whatsapp=document.querySelector("#channel_input_Whatsapp"),window.intlTelInput(cht_settings.channel_settings.Whatsapp,{dropdownContainer:document.body,formatOnDisplay:!0,hiddenInput:"full_number",initialCountry:"auto",nationalMode:!1,utilsScript:cht_settings.plugin_url+"admin/assets/js/utils.js"})),t(".custom-channel-Whatsapp:not(#channel_input_Whatsapp)").length&&t(".custom-channel-Whatsapp:not(#channel_input_Whatsapp)").each(function(){var e=t(this).closest("li.chaty-channel").data("id");void 0!=e&&t("#channel_input_"+e).length&&(cht_settings.channel_settings[e]=document.querySelector("#channel_input_"+e),window.intlTelInput(cht_settings.channel_settings[e],{dropdownContainer:document.body,formatOnDisplay:!0,hiddenInput:"full_number",initialCountry:"auto",nationalMode:!1,utilsScript:cht_settings.plugin_url+"admin/assets/js/utils.js"}))}),t(document).on("change",".chaty-redirect-setting",function(){setTimeout(function(){t(".chaty-redirect-setting").each(function(){t(this).is(":checked")?t(this).closest(".form-field-setting-col").find(".redirect_action-settings").addClass("active"):t(this).closest(".form-field-setting-col").find(".redirect_action-settings").removeClass("active")})},100)}),t(document).on("click",".email-setting",function(){setTimeout(function(){t(".email-setting-field").each(function(){t(this).is(":checked")?t(this).closest(".form-field-setting-col").find(".email-settings").addClass("active"):t(this).closest(".form-field-setting-col").find(".email-settings").removeClass("active")})},100)});let e=[];jQuery(".channels-icons > .icon.active").each((t,a)=>{e.push(a.dataset.social)}),wp.hooks.doAction("chaty.channel_update",{channel:e,target:null,action:"added",isExceeded:!1}),setTimeout(()=>{t(".whatsapp-welcome-message iframe").contents().find("body").css({backgroundColor:"#fff"})},100),t(document).on("click",".chaty-embedded-window",function(){setTimeout(function(){t(".embedded_window-checkbox").each(function(){if(t(this).is(":checked")){t(this).closest("li.chaty-channel").find(".whatsapp-welcome-message").addClass("active");let e=t(this).closest("li.chaty-channel").find(".whatsapp-welcome-message iframe");e.contents().find("body").css({backgroundColor:"#fff"})}else t(this).closest("li.chaty-channel").find(".whatsapp-welcome-message").removeClass("active")})},300)}),jQuery("input[name='switchPreview']:checked").trigger("change"),t(document).on("change","#cht-form input",function(){c=!1,n=!1,i=!1,o=!1,s=!1,l=!1}),t("#cht-form").on("submit",function(){if(a)return!0;set_social_channel_order();var e=0;return(t("#chaty-page-options .cht-required").length&&t("#chaty-page-options .cht-required").each(function(){""==jQuery.trim(t(this).val())&&(t(this).addClass("cht-input-error"),e++)}),t(".chaty-data-and-time-rules .cht-required").length&&t(".chaty-data-and-time-rules .cht-required").each(function(){""==jQuery.trim(t(this).val())&&(t(this).addClass("cht-input-error"),e++)}),0==e)?p():(t(".cht-input-error:first").focus(),!1)}),t(".chaty-popup-inner").on("click",function(t){t.stopPropagation()}),t(".chaty-popup-outer").on("click",function(e){t(".chaty-popup").hide()}),t(".check-for-numbers").on("click",function(){p()}),t(".check-for-device").on("click",function(){r()}),t(".check-for-triggers").on("click",function(){h()}),t(".check-for-status").on("click",function(){d()}),t(".change-status-and-save").on("click",function(){t(".cht_active").prop("checked",!0),a=!0,t(".chaty-popup").hide(),t("#cht-form").trigger("submit")}),t(".status-and-save").on("click",function(){t(".cht_active").prop("checked",!1),a=!0,t(".chaty-popup").hide(),t("#cht-form").trigger("submit")}),jQuery(document).on("click","#create-date-rule",function(t){jQuery("#date-schedule").addClass("active"),jQuery("#cht_date_rules").val("yes")}),jQuery(document).on("click","#remove-date-rule",function(t){jQuery("#date-schedule").removeClass("active"),jQuery("#cht_date_rules").val("no")})})}),function(t){jQuery(window).on("popstate",function(t){window.onbeforeunload=null,window.history&&window.history.pushState&&window.history.back()}),jQuery(document).ready(function(){jQuery(".chaty-table").length||jQuery("body input, body .icon, body textarea, body .btn-cancel:not(.close-btn-set) ").on("click",function(t){window.onbeforeunload=function(t){(t=t||window.event).preventDefault=!0,t.cancelBubble=!0,t.returnValue="Your beautiful goodbye message"}}),jQuery(document).on("submit","form",function(t){window.onbeforeunload=null}),jQuery(document).on("change",".channel-select-input",function(e){var a=t(this).closest("li").attr("data-id");jQuery.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{social:jQuery(this).val(),channel:a,action:"get_chaty_settings"},success:function(e){1==e.status&&("Whatsapp"==e.data.slug?t("#channel_input_"+e.channel).length&&(cht_settings.channel_settings[e.channel]=document.querySelector("#channel_input_"+e.channel),window.intlTelInput(cht_settings.channel_settings[e.channel],{dropdownContainer:document.body,formatOnDisplay:!0,hiddenInput:"full_number",initialCountry:"auto",nationalMode:!1,utilsScript:cht_settings.plugin_url+"admin/assets/js/utils.js"})):t("#chaty-social-"+e.channel+" .channels__input-box").html("<input type='text' class='channels__input' name='cht_social_"+e.channel+"[value]' id='channel_input_"+e.channel+"' />"),jQuery(".custom-icon-"+e.channel+" svg").html(e.data.svg),jQuery("#chaty-social-"+e.channel).attr("data-channel",e.data.slug),jQuery("#chaty-social-"+e.channel).find(".sp-preview-inner").css("background-color",e.data.color),jQuery("#chaty-social-"+e.channel).find(".chaty-color-field").val(e.data.color),jQuery("#chaty-social-"+e.channel).find(".channels__input").attr("placeholder",e.data.placeholder),jQuery("#chaty-social-"+e.channel).find(".channel-example").text(e.data.example),jQuery("#chaty-social-"+e.channel).find(".chaty-title").val(e.data.title),jQuery("#chaty-social-"+e.channel).find(".icon").attr("data-title",e.data.title),jQuery("#chaty-social-"+e.channel).find(".chaty-color-field").trigger("change"),jQuery(".help-section").html(""),""!=e.data.help_link?jQuery(".help-section").html('<div class="viber-help"><a target="_blank" href="'+e.data.help_link+'">'+e.data.help_title+"</a></div>"):""!=e.data.help_text&&jQuery(".help-section").html('<div class="viber-help"><span class="help-text">'+e.data.help_text+'</span><span class="help-title">'+e.data.help_title+"</span></div>"))}})}),jQuery(document).on("click","#chaty_icons_view",function(t){jQuery(".page-body .chaty-widget").removeClass("vertical").removeClass("horizontal"),jQuery(".page-body .chaty-widget").addClass(jQuery(this).val())}),jQuery(".upg").on("click",function(t){jQuery(".valid_domain_input").val(jQuery(".valid_domain_input").val().replace(" ","")),/^(http(s)?:\/\/)?(www\.)?[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/.test(jQuery(".valid_domain_input").val())||(t.preventDefault(),jQuery(".valid_domain").fadeIn().css({display:"block"}))}),jQuery(document).on("blur","#channels-selected-list > li:not(#chaty-social-close) .channels__input",function(){jQuery(this).hasClass("border-red")&&""!=jQuery(this).val()&&jQuery(this).removeClass("border-red")});var e=1000000003;jQuery(".show_up").on("click",function(){e+=10,jQuery("#upgrade-modal").css({"z-index":e,display:"block","margin-left":"-258px"})}),jQuery(".color-picker-btn, .color-picker-btn-close, .color-picker-custom button").on("click",function(t){t.preventDefault(),jQuery(".color-picker-box").toggle(),jQuery(".color-picker-btn").toggle()}),t(window).on("click",function(t){0===jQuery(t.target).parents(".color-picker-dropdown").length&&(jQuery(".color-picker-btn").show(),jQuery(".color-picker-box").hide())}),jQuery(".color-picker-radio input").on("change",function(){var t=jQuery(this);if(jQuery('.color-picker-custom input[name="cht_custom_color"]').val(""),jQuery(".color-picker-custom .circle").html("?").css({"background-color":"#fff"}),t.prop("checked")){jQuery(".color-picker-radio input").prop("checked",!1),t.prop("checked",!0);var e=t.val(),a=t.prop("title")}else e=jQuery(".color-picker-custom input").val(),a="Custom";""!=e&&-1==e.indexOf("#")&&(e="#"+e),jQuery(".color-picker-btn .circle").css({backgroundColor:e}),jQuery(".color-picker-btn .text").text(a),jQuery("#chaty-social-close ellipse").attr("fill",e)}),jQuery(".color-picker-custom input").on("change",function(){jQuery(".color-picker-radio input").prop("checked",!1);var t=jQuery(this).val();""!=t&&-1==t.indexOf("#")&&(t="#"+t),jQuery(".color-picker-btn .circle").css({backgroundColor:t}),jQuery(".color-picker-btn .text").text("Custom"),jQuery("#chaty-social-close ellipse").attr("fill",t)}),jQuery('[name="cht_position"]').on("change",function(){jQuery("#positionCustom").prop("checked")?jQuery("#positionPro").show():jQuery("#positionPro").hide()}),jQuery(".update_token").on("click",function(e){e.preventDefault();var a=jQuery('input[name="cht_token"]').val();t.ajax({type:"POST",url:ajaxurl,data:{action:"add_token",nonce_code:cht_nonce_ajax.cht_nonce,token:a},beforeSend:function(t){},success:function(t){t?(alert("Your pro plan is activated"),location.reload()):alert("You`ve entered a wrong token")},error:function(t,e,a){}})})})}(jQuery),function(t){jQuery(document).ready(function(){n();var e=jQuery(".channels-icons > .icon-sm"),a=jQuery(".social-inputs"),c=0;function n(){!jQuery("section").is("#pro")&&(jQuery(".channels-selected__item").length<=1?jQuery(".channels-selected__item").hide():jQuery(".channels-selected__item").length>=2&&jQuery(".channels-selected__item").show())}jQuery("input[name=cht_custom_color]").on("keyup",function(t){var e=jQuery(this).val();jQuery(".circle").html(""),""!=e&&(-1==e.indexOf("#")&&(e="#"+e),jQuery(".color-picker-custom .circle").css({"background-color":e})),jQuery(this).val().length<1&&jQuery(".color-picker-custom .circle").html("?")}),e.on("click",function(){jQuery(".popover").removeClass("shake-it"),++c,n();var i=jQuery(this),o=i.data("social");if(a.find(".social-form-group"),i.hasClass("active")){var s=","+jQuery(this).attr("data-social"),l=jQuery(".add_slug").val();l=l.replace(s,""),jQuery(".add_slug").val(l),l=l.replace(s,""),jQuery(".add_slug").val(l),l=l.replace(s,""),jQuery(".add_slug").val(l),l=l.replace(s,""),jQuery(".add_slug").val(l),i.toggleClass("active");let h=[];jQuery(".channels-icons > .icon.active").each((t,e)=>{h.push(e.dataset.social)}),wp.hooks.doAction("chaty.channel_update",{channel:h,target:o,action:"removed",isExceeded:!1});return}if(e.addClass("disabled"),icon=jQuery(this).data("social"),"1"==jQuery(".add_slug").val().indexOf(icon)&&""!=jQuery(".add_slug").val()){var s=","+icon,l=jQuery(".add_slug").val();l=l.replace(s,""),jQuery(".add_slug").val(l),l=l.replace(s,""),jQuery(".add_slug").val(l),l=l.replace(s,""),jQuery(".add_slug").val(l)}else jQuery(".add_slug").val(jQuery(".add_slug").val()+","+jQuery(this).attr("data-social"));i.toggleClass("active"),t.ajax({type:"POST",dataType:"json",url:ajaxurl,data:{action:"choose_social",social:o,nonce_code:cht_nonce_ajax.cht_nonce,version:"free",widget_index:jQuery("#widget_index").val()},beforeSend:function(t){},success:function(a){var c=jQuery(a),i=c.find(".icon").data("title");c.data("channel"),!jQuery('.channels-selected div[data-social="'+i+'"]').length&&(jQuery("#chaty-social-close").before(c),jQuery("#chaty-social-"+o+" .chaty-whatsapp-setting-textarea").length&&(editorId=jQuery("#chaty-social-"+o+" .chaty-whatsapp-setting-textarea").attr("id"),tinymce.execCommand("mceAddEditor",!0,editorId))),e.removeClass("disabled"),t("#iconWidget").show(),r(),n(),set_social_channel_order(),check_for_chaty_close_button(),"Whatsapp"==o&&t("#channel_input_Whatsapp").length&&(cht_settings.channel_settings.Whatsapp=document.querySelector("#channel_input_Whatsapp"),window.intlTelInput(cht_settings.channel_settings.Whatsapp,{dropdownContainer:document.body,formatOnDisplay:!0,hiddenInput:"full_number",initialCountry:"auto",nationalMode:!1,utilsScript:cht_settings.plugin_url+"admin/assets/js/utils.js"})),jQuery(".custom-channel-Whatsapp").length&&jQuery(".custom-channel-Whatsapp").each(function(){if(!jQuery(this).closest(".iti__flag-container").length){var t=jQuery(this).closest("li.chaty-channel").data("id");jQuery("#channel_input_"+t).length&&(cht_settings.channel_settings[t]=document.querySelector("#channel_input_"+t),window.intlTelInput(cht_settings.channel_settings[t],{dropdownContainer:document.body,formatOnDisplay:!0,hiddenInput:"full_number",initialCountry:"auto",nationalMode:!1,utilsScript:cht_settings.plugin_url+"admin/assets/js/utils.js"}))}}),jQuery(document).trigger("chatyColorPicker/trigger",[{$scope:jQuery(`#chaty-social-${o}`),element:".chaty-color-field"}]);let s=[];jQuery(".channels-icons > .icon.active").each((t,e)=>{s.push(e.dataset.social)}),wp.hooks.doAction("chaty.channel_update",{channel:s,target:o,action:"added",isExceeded:!1})},error:function(t,e,a){}}),n()}),jQuery("body").on("click",".icon, .btn-cancel:not(.close-btn-set)",function(t){if(!jQuery(this).hasClass("close-btn-set")){if(t.preventDefault(),!(jQuery(this).hasClass("icon")&&jQuery(this).hasClass("active"))){if(icon=jQuery(this).data("social"),jQuery(this).hasClass("btn-cancel")){jQuery('.icon.active[data-social^="'+icon+'"]').removeClass("active");var e=","+icon,a=jQuery(".add_slug").val();a=a.replace(e,""),jQuery(".add_slug").val(a);let c=[];jQuery(".channels-icons > .icon.active").each((t,e)=>{c.push(e.dataset.social)}),wp.hooks.doAction("chaty.channel_update",{channel:c,target:icon,action:"removed",isExceeded:!1})}jQuery("#chaty-social-"+icon).remove(),jQuery(this).parent(".channels-selected__item"),r(),n(),set_social_channel_order(),check_for_chaty_close_button()}}}),jQuery(".btn-help").on("click",function(t){window.open("https://premio.io/help/chaty/","_blank")}),jQuery(".free-custom-radio, .free-custom-checkbox").on("click",function(t){t.stopPropagation()});var i=jQuery("[name=cht_cta]"),o=jQuery(".preview .tooltip-show");i.on("keyup",function(){var t=jQuery(".preview .page .icon");i.val().length>=1?t.removeClass("no-tooltip"):t.addClass("no-tooltip"),o.attr("data-title",i.val())});var s='<svg version="1.1" id="ch" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="-496 507.7 54 54" style="enable-background:new -496 507.7 54 54;" xml:space="preserve">\n <style type="text/css">.st0 {fill: #A886CD;} .st1 {fill: #FFFFFF;}\n </style><g><circle class="st0" cx="-469" cy="534.7" r="27"/></g><path class="st1" d="M-459.9,523.7h-20.3c-1.9,0-3.4,1.5-3.4,3.4v15.3c0,1.9,1.5,3.4,3.4,3.4h11.4l5.9,4.9c0.2,0.2,0.3,0.2,0.5,0.2 h0.3c0.3-0.2,0.5-0.5,0.5-0.8v-4.2h1.7c1.9,0,3.4-1.5,3.4-3.4v-15.3C-456.5,525.2-458,523.7-459.9,523.7z"/>\n <path class="st0" d="M-477.7,530.5h11.9c0.5,0,0.8,0.4,0.8,0.8l0,0c0,0.5-0.4,0.8-0.8,0.8h-11.9c-0.5,0-0.8-0.4-0.8-0.8l0,0\n C-478.6,530.8-478.2,530.5-477.7,530.5z"/>\n <path class="st0" d="M-477.7,533.5h7.9c0.5,0,0.8,0.4,0.8,0.8l0,0c0,0.5-0.4,0.8-0.8,0.8h-7.9c-0.5,0-0.8-0.4-0.8-0.8l0,0\n C-478.6,533.9-478.2,533.5-477.7,533.5z"/>\n </svg>',l=document.getElementById("iconWidget");function r(){change_custom_preview()}function h(t){return t.element,jQuery('<span><i class="'+t.text+'"></i> '+t.text+"</span>")}function d(t,e){if(jQuery("#iconWidget").length){if(t?l.innerHTML=t:l.innerHTML="",e){var a=jQuery(".color-picker-custom input").val()?jQuery(".color-picker-custom input").val():jQuery(".color-picker-radio input:checked").val();""!=a&&-1==a.indexOf("#")&&(a="#"+a),jQuery(".preview .page #iconWidget svg circle").css({fill:a}),jQuery(".preview .page .chaty-close-icon ellipse").css({fill:a}),jQuery("#chaty-social-close ellipse").attr("fill",a)}"open"==(thisVal=jQuery("#chaty_default_state").val())?jQuery(".hide-show-button").addClass("active"):jQuery(".hide-show-button").removeClass("active"),jQuery(".chaty-widget").removeClass("active").removeClass("hover").removeClass("click").removeClass("hide_arrow"),"open"==thisVal?(jQuery(".chaty-widget").addClass("active").addClass("click"),"open"==thisVal&&jQuery(c+":checked").length>1&&jQuery(".chaty-widget").addClass("hide_arrow")):"hover"==thisVal?jQuery(".chaty-widget").addClass("hover"):jQuery(".chaty-widget").addClass("click"),jQuery(".chaty-channels").html("");var c=".js-chanel-mobile";if(p())var c=".js-chanel-desktop";"open"==thisVal&&jQuery(c+":checked").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()),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-radio 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-radio input").attr("disabled",!1)),jQuery(".page-body .chaty-widget").removeClass("vertical").removeClass("horizontal"),jQuery(c+":checked").length>1?(jQuery(c+":checked").each(function(){var t=jQuery(this).closest("li").find(".icon").html(),t=jQuery(this).closest("li").find(".icon").html(),e=jQuery(this).closest("li").find(".chaty-title").val(),a=jQuery(this).closest(".channels-selected__item").hasClass("img-active")?"img-active":"";""!=e&&(e="<span class='social-tooltip'>"+e+"</span>"),jQuery(".chaty-channels").append("<div class='social-item-box "+a+"'><span class='tooltip-icon'>"+t+"</span>"+e+"</div>")}),"open"==jQuery("#chaty_default_state").val()&&jQuery("#cht_close_button").is(":checked")?(jQuery("#iconWidget").css("display","block"),jQuery(".chaty-widget .tooltiptext").css("display","block"),jQuery(".chaty-widget").removeClass("hide-arrow")):"open"!=jQuery("#chaty_default_state").val()?(jQuery("#iconWidget").css("display","block"),jQuery(".chaty-widget .tooltiptext").css("display","block"),jQuery(".chaty-widget").removeClass("hide-arrow")):"open"==jQuery("#chaty_default_state").val()&&(jQuery("#iconWidget").hide(),jQuery(".chaty-widget .tooltiptext").hide(),jQuery(".chaty-widget").addClass("hide-arrow")),jQuery(".chaty-widget").removeClass("has-single"),jQuery(".page-body .chaty-widget").addClass(jQuery("#chaty_icons_view").val())):1==jQuery(c+":checked").length?("open"!=jQuery("#chaty_default_state").val()||jQuery("#cht_close_button").is(":checked")?"open"!=jQuery("#chaty_default_state").val()&&(jQuery("#iconWidget").css("display","block"),jQuery(".chaty-widget .tooltiptext").css("display","block"),jQuery(".chaty-widget").removeClass("hide-arrow")):(jQuery("#iconWidget").css("display","block"),jQuery(".chaty-widget .tooltiptext").css("display","block"),jQuery(".chaty-widget").removeClass("hide-arrow")),jQuery(".chaty-widget").addClass("has-single"),jQuery(".chaty-widget").removeClass("hide-arrow")):0==jQuery(c+":checked").length&&(jQuery("#iconWidget").hide(),jQuery(".chaty-widget .tooltiptext").hide(),jQuery(".chaty-widget").addClass("hide-arrow"),jQuery(".chaty-widget").removeClass("has-single")),jQuery(".chaty-channels .remove-icon-img").remove(),jQuery("#trigger_on_time").is(":checked")?jQuery("#chaty_trigger_time").attr("readonly",!1):jQuery("#chaty_trigger_time").attr("readonly",!0),jQuery("#chaty_trigger_hide").is(":checked")?jQuery("#chaty_trigger_hide_time").attr("readonly",!1):jQuery("#chaty_trigger_hide_time").attr("readonly",!0),jQuery("#chaty_trigger_on_scroll").is(":checked")?jQuery("#chaty_trigger_on_page_scroll").attr("readonly",!1):jQuery("#chaty_trigger_on_page_scroll").attr("readonly",!0),""==jQuery(".chaty-widget .tooltiptext").text()?jQuery(".chaty-widget .tooltiptext").hide():"open"==jQuery("#chaty_default_state").val()&&jQuery(c+":checked").length>1?jQuery(".chaty-widget .tooltiptext").hide():jQuery(".chaty-widget .tooltiptext").css("display","block")}}function p(){return!!jQuery("#previewDesktop").is(":checked")}jQuery(".color-picker-radio input:checked").val(),jQuery(document).on("keyup","textarea.test_textarea",function(){r()}),jQuery(".js-switch-preview").on("change",function(){p()?jQuery(this).closest(".preview").removeClass("mobiel-view"):jQuery(this).closest(".preview").addClass("mobiel-view"),r()}),jQuery(document).on("change","input[name='cht_pending_messages']",function(){jQuery("#cht_pending_messages").is(":checked")?jQuery(".pending-message-items").addClass("active"):jQuery(".pending-message-items").removeClass("active"),r()}),jQuery(document).on("change","#cht_number_of_messages",function(){r()}),jQuery(document).on("change","#cht_number_color, #cht_number_bg_color",function(){r()}),jQuery(document).on("keyup","#cht_number_of_messages",function(){r()}),jQuery(document).on("blur","#cht_number_of_messages",function(){r()}),jQuery(document).on("change",".js-chanel-icon",function(){r()}),jQuery(document).on("change",".js-widget-i",function(t){s=t.target.classList.contains("js-upload")?jQuery(".file-preview-image").last().parent().html():jQuery("i[data-type="+jQuery(".js-widget-i:checked").val()+"]").html(),r()}),"chat-image"!==jQuery(".js-widget-i:checked").attr("data-type")&&(s=jQuery("i[data-type="+jQuery(".js-widget-i:checked").attr("data-type")+"]").html(),r())}),jQuery(document).ready(function(){jQuery(".toast-message").length&&(jQuery(".toast-message").show(),jQuery(".toast-message").addClass("active"),setTimeout(function(){jQuery(".toast-message").removeClass("active")},5e3)),jQuery(document).on("click",".toast-close-btn a",function(t){t.preventDefault(),jQuery(".toast-message").removeClass("active")}),jQuery(document).on("click",".chaty-popup-box button, #chaty-intro-popup",function(e){e.stopPropagation();var a=jQuery("#chaty_update_popup_status").val();t("#chaty-intro-popup").remove(),t.ajax({type:"POST",url:ajaxurl,data:{action:"update_popup_status",nonce:a},beforeSend:function(t){},success:function(t){},error:function(t,e,a){}})}),jQuery(document).on("click",".chaty-popup-box",function(t){t.stopPropagation()}),jQuery(document).on("click",".remove-chaty-options",function(e){e.preventDefault(),e.stopPropagation(),confirm("Are you sure you want to delete this widget?")&&t.ajax({type:"POST",url:ajaxurl,data:{action:"remove_chaty_widget",nonce_code:cht_nonce_ajax.cht_nonce,widget_index:jQuery("#widget_index").val()},beforeSend:function(t){},success:function(t){window.location=t},error:function(t,e,a){}})}),window.location.href,window.location.href.indexOf("page=chaty-app&widget=")>-1&&jQuery("#toplevel_page_chaty-app .wp-submenu.wp-submenu-wrap li").each(function(){var t=jQuery(this).find("a").attr("href");void 0!==t&&(jQuery(this).removeClass("current"),window.location.href.indexOf(t)>-1&&t.indexOf("&widget=")>-1&&jQuery(this).addClass("current"))})})}(jQuery),jQuery(window).on("resize",function(){check_for_preview_pos()}),jQuery(window).on("scroll",function(){check_for_preview_pos()}),jQuery(document).ready(function(){check_for_preview_pos()});var totalPageOptions=0,pageOptionContent="",totalDateAndTimeOptions=0,dateAndTimeOptionContent="";jQuery(document).ready(function(){var t=!1;function e(){jQuery(".chaty-whatsapp-setting-textarea").length&&jQuery(".chaty-whatsapp-setting-textarea").each(function(){jQuery("#cht_social_embedded_message_"+jQuery(this).data("id")+"_ifr").length&&tinymce.get(jQuery(this).attr("id")).remove(),tinymce.execCommand("mceAddEditor",!0,jQuery(this).attr("id"))})}(/(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)))&&(t=!0),totalPageOptions=parseInt(jQuery(".chaty-page-option").length),pageOptionContent=jQuery(".chaty-page-options-html").html(),jQuery(".chaty-page-options-html").remove(),totalDateAndTimeOptions=parseInt(jQuery(".chaty-date-time-option").length),dateAndTimeOptionContent=jQuery(".chaty-date-and-time-options-html").html(),jQuery(".chaty-date-and-time-options-html").remove(),jQuery(".create-rule").on("click",function(){let t=jQuery(this).parents(".chaty-option-box");t.find(".chaty-page-options").removeClass("hidden"),t.find(".remove-rules").removeClass("hidden").addClass("inline-block")}),jQuery(".remove-rules").on("click",function(){let t=jQuery(this).parents(".chaty-option-box");t.find(".chaty-page-options").addClass("hidden"),t.find(".remove-rules").removeClass("inline-block").addClass("hidden")}),jQuery(document).on("change","#chaty_attention_effect",function(){change_custom_preview()}),jQuery(document).on("change","input[name='cht_color']:checked",function(){var t=jQuery(this),e=t.val(),a=t.prop("title");jQuery(".color-picker-btn .circle").css({backgroundColor:e}),jQuery(".color-picker-btn .text").text(a),jQuery("#chaty-social-close ellipse").attr("fill",e),jQuery(".preview .page #iconWidget svg circle").css({fill:e}),jQuery(".preview .page .chaty-close-icon ellipse").css({fill:e}),jQuery("#cht_custom_color").val(jQuery(this).val()),change_custom_preview()}),jQuery('input[name="cht_color"]:checked').trigger("change"),jQuery(document).on("change","input[name='cht_position']:checked",function(){change_custom_preview()}),setInterval(function(){var t=jQuery("#chaty_attention_effect").attr("data-effect");""!=t?(jQuery("#iconWidget").removeClass("chaty-animation-"+t),jQuery("#iconWidget").removeClass("start-now"),setTimeout(function(){jQuery("#iconWidget").addClass("chaty-animation-"+jQuery("#chaty_attention_effect").val()).addClass("start-now")},1e3)):jQuery("#chaty_attention_effect").attr("data-effect",jQuery("#chaty_attention_effect").val())},5e3),jQuery(document).on("click",".remove-chaty",function(){jQuery(".page-options").toggle()}),jQuery(document).on("click",".remove-page-option",function(){jQuery(".chaty-data-and-time-rules ").toggle()}),jQuery("#image-upload-content .custom-control-label").on("click",function(t){return t.stopPropagation(),jQuery(this).closest(".custom-control").find("input[type=radio]").attr("checked",!0),jQuery(".js-widget-i").trigger("change"),!1}),jQuery(document).trigger("chatyColorPicker/trigger",[{$scope:jQuery(document),element:".chaty-color-field"}]),jQuery(".chaty-color-field").on("change",function(){chaty_set_bg_color(),change_custom_preview()}),jQuery(".remove-chaty-img").on("click",function(t){t.stopPropagation()}),t||jQuery("#channels-selected-list").sortable({placeholder:"ui-chaty-state-hl",items:"li.chaty-channel:not(#chaty-social-close)",handle:".move-icon",stop:function(){e()},update:function(t,a){set_social_channel_order(),change_custom_preview(),e()}}),jQuery(document).ready(function(){e()}),jQuery(".close-button-img img, .close-button-img .image-upload").on("click",function(){var t=wp.media({title:"Upload Image",multiple:!1,library:{type:"image"}}).open().on("select",function(e){imageData=t.state().get("selection").first().toJSON(),jQuery(".close-button-img").addClass("active"),jQuery(".close-button-img input").val(imageData.id),jQuery(".close-button-img img").attr("src",imageData.url),change_custom_preview()})}),jQuery(".remove-close-img").on("click",function(){default_image=jQuery("#default_image").val(),jQuery(".close-button-img").removeClass("active"),jQuery(".close-button-img input").val(""),jQuery(".close-button-img img").attr("src",default_image),change_custom_preview()}),jQuery(document).on("click",".chaty-widget.click",function(t){t.preventDefault(),jQuery(".chaty-widget").toggleClass("active")}),jQuery(document).on("change",".url-options.cht-required",function(t){thisVal=jQuery(this).val(),newURL=siteURL=jQuery("#chaty_site_url").val(),"page_has_url"==thisVal?newURL=siteURL:"page_contains"==thisVal?newURL=siteURL+"%s%":"page_start_with"==thisVal?newURL=siteURL+"s%":"page_end_with"==thisVal&&(newURL=siteURL+"%s"),jQuery(this).closest(".url-content").find(".chaty-url").text(newURL)}),check_for_chaty_close_button(),chaty_set_bg_color(),change_custom_preview(),jQuery(".chaty-settings.cls-btn a, .close-btn-set").on("click",function(t){t.preventDefault(),jQuery(".cls-btn-settings, .close-btn-set").toggleClass("active")}),0==jQuery("input[name='cht_position']:checked").length&&(jQuery("#right-position").attr("checked",!0),jQuery("input[name='cht_position']:checked").trigger("change")),0==jQuery("input[name='widget_icon']:checked").length&&(jQuery("input[name='widget_icon']:first").attr("checked",!0),jQuery("input[name='widget_icon']:checked").trigger("change")),jQuery(document).on("change",".form-fonts",function(){change_custom_preview()})}),jQuery(window).on("load",function(){check_for_chaty_close_button(),chaty_set_bg_color(),jQuery(".chaty-page-options .chaty-page-option").removeClass("last"),jQuery(".chaty-page-options .chaty-page-option:last").addClass("last"),jQuery(".url-options.cht-required").each(function(){jQuery(this).trigger("change")})});var selectedsocialSlug="";function upload_chaty_image(t){selectedsocialSlug=t;var e=wp.media({title:"Upload Image",multiple:!1,library:{type:"image"}}).open().on("select",function(t){imageData=e.state().get("selection").first().toJSON(),jQuery("#cht_social_image_"+selectedsocialSlug).val(imageData.id),jQuery(".custom-image-"+selectedsocialSlug+" img").attr("src",imageData.url),jQuery("#chaty-social-"+selectedsocialSlug+" .channels-selected__item").addClass("img-active"),change_custom_preview()})}function toggle_chaty_setting(t){if(jQuery("#chaty-social-"+t).find(".chaty-advance-settings").toggle(),jQuery("#chaty-social-"+t).find(".chaty-advance-settings").toggleClass("active"),"Contact_Us"==t&&jQuery("#Contact_Us-close-btn").length){var e=jQuery("#Contact_Us-close-btn").data("nonce");jQuery("#Contact_Us-close-btn").hasClass("active")||(jQuery("#Contact_Us-close-btn").addClass("active"),jQuery.ajax({type:"POST",url:ajaxurl,data:{nonce:e,action:"update_channel_setting"},success:function(t){}}))}jQuery("#chaty-social-"+t+" .chaty-advance-settings.active").length&&jQuery("body,html").animate({scrollTop:jQuery("#chaty-social-"+t+" .chaty-advance-settings.active").offset().top-50},500),change_custom_preview()}function chaty_set_bg_color(){jQuery(".chaty-color-field:not(.button-color)").each(function(){""!=jQuery(this).val()&&"#ffffff"!=jQuery(this).val()&&("Linkedin"!=jQuery(this).closest("li").data("id")||"Linkedin"==jQuery(this).closest("li").data("id")&&"#ffffff"!=jQuery(this).val())&&(defaultColor=jQuery(this).val(),jQuery(this).closest(".channels-selected__item").find(".color-element").css("fill",defaultColor),jQuery(this).closest(".channels-selected__item").find(".custom-chaty-image").css("background",defaultColor),jQuery(this).closest(".channels-selected__item").find(".facustom-icon").css("background",defaultColor))}),change_custom_preview()}function upload_qr_code(){var t=wp.media({title:"Upload QR Image",multiple:!1,library:{type:"image"}}).open().on("select",function(e){imageData=t.state().get("selection").first().toJSON(),jQuery("#upload_qr_code_val").val(imageData.id),jQuery("#upload_qr_code img").attr("src",imageData.url),jQuery(".remove-qr-code").addClass("active"),change_custom_preview()})}function remove_qr_code(){jQuery(".remove-qr-code").removeClass("active"),jQuery("#upload_qr_code_val").val(""),default_image=jQuery("#default_image").val(),jQuery("#upload_qr_code img").attr("src",default_image),change_custom_preview()}function remove_chaty_image(t){default_image=jQuery("#default_image").val(),jQuery("#chaty-social-"+t+" .channels-selected__item").removeClass("img-active"),jQuery("#cht_social_image_"+t).val(""),jQuery("#cht_social_image_src_"+t).attr("src",default_image),change_custom_preview()}var baseIcon='<svg version="1.1" id="ch" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="-496 507.7 54 54" style="enable-background:new -496 507.7 54 54;" xml:space="preserve">\n <style type="text/css">.st0 {fill: #A886CD;} .st1 {fill: #FFFFFF;}\n </style><g><circle class="st0" cx="-469" cy="534.7" r="27"/></g><path class="st1" d="M-459.9,523.7h-20.3c-1.9,0-3.4,1.5-3.4,3.4v15.3c0,1.9,1.5,3.4,3.4,3.4h11.4l5.9,4.9c0.2,0.2,0.3,0.2,0.5,0.2 h0.3c0.3-0.2,0.5-0.5,0.5-0.8v-4.2h1.7c1.9,0,3.4-1.5,3.4-3.4v-15.3C-456.5,525.2-458,523.7-459.9,523.7z"/>\n <path class="st0" d="M-477.7,530.5h11.9c0.5,0,0.8,0.4,0.8,0.8l0,0c0,0.5-0.4,0.8-0.8,0.8h-11.9c-0.5,0-0.8-0.4-0.8-0.8l0,0\n C-478.6,530.8-478.2,530.5-477.7,530.5z"/>\n <path class="st0" d="M-477.7,533.5h7.9c0.5,0,0.8,0.4,0.8,0.8l0,0c0,0.5-0.4,0.8-0.8,0.8h-7.9c-0.5,0-0.8-0.4-0.8-0.8l0,0\n C-478.6,533.9-478.2,533.5-477.7,533.5z"/>\n </svg>',defaultIcon='<svg version="1.1" id="ch" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="-496 507.7 54 54" style="enable-background:new -496 507.7 54 54;" xml:space="preserve">\n <style type="text/css">.st0 {fill: #A886CD;} .st1 {fill: #FFFFFF;}\n </style><g><circle class="st0" cx="-469" cy="534.7" r="27"/></g><path class="st1" d="M-459.9,523.7h-20.3c-1.9,0-3.4,1.5-3.4,3.4v15.3c0,1.9,1.5,3.4,3.4,3.4h11.4l5.9,4.9c0.2,0.2,0.3,0.2,0.5,0.2 h0.3c0.3-0.2,0.5-0.5,0.5-0.8v-4.2h1.7c1.9,0,3.4-1.5,3.4-3.4v-15.3C-456.5,525.2-458,523.7-459.9,523.7z"/>\n <path class="st0" d="M-477.7,530.5h11.9c0.5,0,0.8,0.4,0.8,0.8l0,0c0,0.5-0.4,0.8-0.8,0.8h-11.9c-0.5,0-0.8-0.4-0.8-0.8l0,0\n C-478.6,530.8-478.2,530.5-477.7,530.5z"/>\n <path class="st0" d="M-477.7,533.5h7.9c0.5,0,0.8,0.4,0.8,0.8l0,0c0,0.5-0.4,0.8-0.8,0.8h-7.9c-0.5,0-0.8-0.4-0.8-0.8l0,0\n C-478.6,533.9-478.2,533.5-477.7,533.5z"/>\n </svg>',iconBlock=document.getElementById("iconWidget");function set_social_channel_order(){socialString=[],jQuery("#channels-selected-list li").each(function(){socialString.push(jQuery(this).attr("data-id"))}),socialString=socialString.join(","),jQuery("#cht_numb_slug").val(socialString),check_for_chaty_close_button()}var imageDataEvent=!1;function check_for_chaty_close_button(){jQuery("#channels-selected-list > li:not(.chaty-cls-setting)").length>=2?jQuery("#chaty-social-close").show():jQuery("#chaty-social-close").hide(),change_custom_preview();var t="";jQuery("#channels-selected-list > li").each(function(){"undefined"!=jQuery(this).attr("data-id")&&""!=jQuery(this).attr("data-id")&&(t+=jQuery(this).attr("data-id")+","),t=t.trimRight(",")}),jQuery(".add_slug").val(t)}function getChtPreviewDesktop(){return!!jQuery("#previewDesktop").is(":checked")}function setChtIcon(t,e){if(jQuery("iconWidget").length){if(iconBlock=document.getElementById("iconWidget"),t?iconBlock.innerHTML=t:iconBlock.innerHTML="",e){var a=jQuery(".color-picker-custom input").val()?jQuery(".color-picker-custom input").val():jQuery(".color-picker-radio input:checked").val();jQuery(".preview .page #iconWidget svg circle").css({fill:a}),jQuery(".preview .page .chaty-close-icon ellipse").css({fill:a}),jQuery("#chaty-social-close ellipse").attr("fill",a)}jQuery(".js-widget-i:checked").trigger("change")}}jQuery(".close-chaty-popup-btn").on("click",function(t){t.stopPropagation(),jQuery(".chaty-popup").hide()});
|
admin/class-admin-base.php
CHANGED
@@ -749,73 +749,6 @@ class CHT_Admin_Base
|
|
749 |
|
750 |
}//end get_site()
|
751 |
|
752 |
-
/**
|
753 |
-
* Returns is Pro installed
|
754 |
-
*
|
755 |
-
* @since 1.0.0
|
756 |
-
* @access public
|
757 |
-
* @return $is_pro
|
758 |
-
*/
|
759 |
-
public function is_pro($token='')
|
760 |
-
{
|
761 |
-
return false;
|
762 |
-
|
763 |
-
}//end is_pro()
|
764 |
-
|
765 |
-
/**
|
766 |
-
* Returns expired date
|
767 |
-
*
|
768 |
-
* @since 1.0.0
|
769 |
-
* @access public
|
770 |
-
* @return $expired_date
|
771 |
-
*/
|
772 |
-
public function data_has_expired()
|
773 |
-
{
|
774 |
-
return strtotime(date('Y-m-d')) > strtotime(date('Y-m-d', strtotime($this->active_license())));
|
775 |
-
|
776 |
-
}//end data_has_expired()
|
777 |
-
|
778 |
-
|
779 |
-
/**
|
780 |
-
* Checking active license
|
781 |
-
*
|
782 |
-
* @since 1.0.0
|
783 |
-
* @access public
|
784 |
-
* @return $expired_date
|
785 |
-
*/
|
786 |
-
public function active_license()
|
787 |
-
{
|
788 |
-
if (!$this->is_pro()) {
|
789 |
-
return;
|
790 |
-
}
|
791 |
-
|
792 |
-
$body = null;
|
793 |
-
if (empty(self::$response->errors)) {
|
794 |
-
$body = json_decode(self::$response['body']);
|
795 |
-
}
|
796 |
-
|
797 |
-
if (isset($body->expired_date)) {
|
798 |
-
return $body->expired_date->date;
|
799 |
-
}
|
800 |
-
|
801 |
-
}//end active_license()
|
802 |
-
|
803 |
-
/**
|
804 |
-
* Check if is Pro version
|
805 |
-
*
|
806 |
-
* @since 1.0.0
|
807 |
-
* @access public
|
808 |
-
* @return $is_pro
|
809 |
-
*/
|
810 |
-
public function data_check()
|
811 |
-
{
|
812 |
-
if ($this->is_pro()) {
|
813 |
-
return false;
|
814 |
-
};
|
815 |
-
|
816 |
-
}//end data_check()
|
817 |
-
|
818 |
-
|
819 |
/**
|
820 |
* Get current color for widget
|
821 |
*
|
749 |
|
750 |
}//end get_site()
|
751 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
752 |
/**
|
753 |
* Get current color for widget
|
754 |
*
|
cht-icons.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
Author URI: https://premio.io/downloads/chaty/
|
8 |
Text Domain: chaty
|
9 |
Domain Path: /languages
|
10 |
-
Version: 3.0.
|
11 |
License: GPL2
|
12 |
*/
|
13 |
|
@@ -27,7 +27,7 @@ define('CHT_INC', CHT_DIR . '/includes');
|
|
27 |
define('CHT_PRO_URL', admin_url("admin.php?page=chaty-app-upgrade"));
|
28 |
define('CHT_PLUGIN_URL', plugin_dir_url(__FILE__));
|
29 |
define('CHT_PLUGIN_BASE', plugin_basename(CHT_FILE));
|
30 |
-
define('CHT_VERSION', "3.0.
|
31 |
|
32 |
if (!function_exists('wp_doing_ajax')) {
|
33 |
function wp_doing_ajax()
|
7 |
Author URI: https://premio.io/downloads/chaty/
|
8 |
Text Domain: chaty
|
9 |
Domain Path: /languages
|
10 |
+
Version: 3.0.4
|
11 |
License: GPL2
|
12 |
*/
|
13 |
|
27 |
define('CHT_PRO_URL', admin_url("admin.php?page=chaty-app-upgrade"));
|
28 |
define('CHT_PLUGIN_URL', plugin_dir_url(__FILE__));
|
29 |
define('CHT_PLUGIN_BASE', plugin_basename(CHT_FILE));
|
30 |
+
define('CHT_VERSION', "3.0.4");
|
31 |
|
32 |
if (!function_exists('wp_doing_ajax')) {
|
33 |
function wp_doing_ajax()
|
images/header-bottom.png
CHANGED
Binary file
|
images/header-top.png
CHANGED
Binary file
|
images/popup-bg.png
CHANGED
Binary file
|
images/whatsapp.png
CHANGED
Binary file
|
includes/class-frontend.php
CHANGED
@@ -384,10 +384,6 @@ class CHT_Frontend extends CHT_Admin_Base
|
|
384 |
$cta = esc_attr__(wp_unslash($cta));
|
385 |
$cta = html_entity_decode($cta);
|
386 |
|
387 |
-
$isPro = get_option('cht_token');
|
388 |
-
// is PRO version
|
389 |
-
$isPro = (empty($isPro) || $isPro == null) ? 0 : 1;
|
390 |
-
|
391 |
$positionSide = get_option('positionSide');
|
392 |
// get widget position
|
393 |
$chtBottomSpacing = get_option('cht_bottom_spacing');
|
384 |
$cta = esc_attr__(wp_unslash($cta));
|
385 |
$cta = html_entity_decode($cta);
|
386 |
|
|
|
|
|
|
|
|
|
387 |
$positionSide = get_option('positionSide');
|
388 |
// get widget position
|
389 |
$chtBottomSpacing = get_option('cht_bottom_spacing');
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: galdub, tomeraharon, premio
|
|
3 |
Tags: whatsapp, whatsapp chat, facebook messenger, click to chat, chat, chat button, call now button, messenger, whatsapp button, chat icon, contact button, click to call
|
4 |
Requires at least: 3.1
|
5 |
Tested up to: 6.1
|
6 |
-
Stable tag: 3.0.
|
7 |
Plugin URI: https://premio.io/downloads/chaty/
|
8 |
|
9 |
WhatsApp chat, Facebook Messenger, Telegram, TikTok, Viber, Email, Line, WeChat Phone call, SMS, and more with customizable WhatsApp chat widget & call buttons. Chat with your visitors on WhatsApp, Facebook Messenger, and other chat channels!
|
@@ -18,7 +18,7 @@ Show a chat button on the bottom of your site and communicate with your customer
|
|
18 |
* Improve your customer support
|
19 |
* Direct customers to your store's location
|
20 |
|
21 |
-
[youtube https://www.youtube.com/watch?v=
|
22 |
|
23 |
= 💬 Connect with your website visitors on WhatsApp and 20+ chat channels =
|
24 |
Chaty is designed to help you connect with your visitors on WhatsApp or WhatsApp Business with ease. All you have to do is to enter your WhatsApp number, and you’re all set. We also have some advanced WhatsApp features like the WhatsApp popup that emulates a WhatsApp Chat window, WhatsApp Merge tags, WhatsApp agents, and many other features that’ll help you better communicate with your visitors on WhatsApp.
|
@@ -71,10 +71,10 @@ Waze
|
|
71 |
Google Maps
|
72 |
Discord
|
73 |
Microsoft Teams
|
74 |
-
Link to an external channel/contact page (New feature: add
|
75 |
|
76 |
= 🆓 What do you get in the Free plan? =
|
77 |
-
1. Show
|
78 |
2. Select the location of the widget (bottom left/right).
|
79 |
3. Add a custom Call-To-Action message besides your chat widget and set its display frequency
|
80 |
4. Set a display trigger - decide when the widget will appear for the first time. You can show it after a few seconds, on page scroll, or use our powerful exit intent trigger. When you choose more than one trigger, the widget will appear when the first trigger takes place. The exit intent trigger will help you get your website's visitors' attention when they plan to leave your website.
|
@@ -92,7 +92,7 @@ Link to an external channel/contact page (New feature: add 2 custom buttons and
|
|
92 |
15. Select your default state - you can show all your chat channels in an "open-state", or show the widget and let the visitors click on it or hover over it (you decide) to open the chat widget up and see all your chat icons.
|
93 |
16. Show different channels for mobile and desktop. E.g. On mobile, you can display a call now button, Viber button, and a Telegram button, and on desktop, you can display a WhatsApp button and a Facebook Messenger chat button.
|
94 |
17. Change the channel icons order using drag and drop interface.
|
95 |
-
18. New feature: we've added 3 brand new buttons - Instagram, Twitter, LinkedIn, and an option to add
|
96 |
19. Change the font of your chat widget's call-to-action message and the chat channels tooltips.
|
97 |
20. Decide if you want the custom chat button to open in a new tab or in the current tab.
|
98 |
21.New! Launch the Chaty chat button using a JavaScript function launch_chaty(); - you can use it to open the chat button in any custom event.
|
@@ -226,7 +226,7 @@ We don't store any local data about your visitors (unless you select the contact
|
|
226 |
== Frequently Asked Questions ==
|
227 |
|
228 |
= What’s included in the free plan? =
|
229 |
-
You can
|
230 |
|
231 |
= Is there a time limit for the free plan? =
|
232 |
No. You can use the free plan as long as you want.
|
@@ -283,6 +283,9 @@ Yes! You can even decide what chat buttons will show up on each device (desktop/
|
|
283 |
|
284 |
== Changelog ==
|
285 |
|
|
|
|
|
|
|
286 |
= 3.0.3 =
|
287 |
Minor enchantments
|
288 |
|
@@ -540,4 +543,4 @@ Fixed some rare bugs
|
|
540 |
Many cool new features including: new widget icons (including custom widget), decide which channels will be displayed on mobile/desktop, and change widget size
|
541 |
|
542 |
= 1.2.1 =
|
543 |
-
* Bug fixes
|
3 |
Tags: whatsapp, whatsapp chat, facebook messenger, click to chat, chat, chat button, call now button, messenger, whatsapp button, chat icon, contact button, click to call
|
4 |
Requires at least: 3.1
|
5 |
Tested up to: 6.1
|
6 |
+
Stable tag: 3.0.4
|
7 |
Plugin URI: https://premio.io/downloads/chaty/
|
8 |
|
9 |
WhatsApp chat, Facebook Messenger, Telegram, TikTok, Viber, Email, Line, WeChat Phone call, SMS, and more with customizable WhatsApp chat widget & call buttons. Chat with your visitors on WhatsApp, Facebook Messenger, and other chat channels!
|
18 |
* Improve your customer support
|
19 |
* Direct customers to your store's location
|
20 |
|
21 |
+
[youtube https://www.youtube.com/watch?v=i6t05AeuyWg]
|
22 |
|
23 |
= 💬 Connect with your website visitors on WhatsApp and 20+ chat channels =
|
24 |
Chaty is designed to help you connect with your visitors on WhatsApp or WhatsApp Business with ease. All you have to do is to enter your WhatsApp number, and you’re all set. We also have some advanced WhatsApp features like the WhatsApp popup that emulates a WhatsApp Chat window, WhatsApp Merge tags, WhatsApp agents, and many other features that’ll help you better communicate with your visitors on WhatsApp.
|
71 |
Google Maps
|
72 |
Discord
|
73 |
Microsoft Teams
|
74 |
+
Link to an external channel/contact page (New feature: add custom chat buttons and link to any URL you desire)
|
75 |
|
76 |
= 🆓 What do you get in the Free plan? =
|
77 |
+
1. Show unlimited click to chat channels (E.g., WhatsApp, Facebook Messenger, Telegram, Viber, phone click to call, SMS, and more)
|
78 |
2. Select the location of the widget (bottom left/right).
|
79 |
3. Add a custom Call-To-Action message besides your chat widget and set its display frequency
|
80 |
4. Set a display trigger - decide when the widget will appear for the first time. You can show it after a few seconds, on page scroll, or use our powerful exit intent trigger. When you choose more than one trigger, the widget will appear when the first trigger takes place. The exit intent trigger will help you get your website's visitors' attention when they plan to leave your website.
|
92 |
15. Select your default state - you can show all your chat channels in an "open-state", or show the widget and let the visitors click on it or hover over it (you decide) to open the chat widget up and see all your chat icons.
|
93 |
16. Show different channels for mobile and desktop. E.g. On mobile, you can display a call now button, Viber button, and a Telegram button, and on desktop, you can display a WhatsApp button and a Facebook Messenger chat button.
|
94 |
17. Change the channel icons order using drag and drop interface.
|
95 |
+
18. New feature: we've added 3 brand new buttons - Instagram, Twitter, LinkedIn, and an option to add custom chat or social media buttons.
|
96 |
19. Change the font of your chat widget's call-to-action message and the chat channels tooltips.
|
97 |
20. Decide if you want the custom chat button to open in a new tab or in the current tab.
|
98 |
21.New! Launch the Chaty chat button using a JavaScript function launch_chaty(); - you can use it to open the chat button in any custom event.
|
226 |
== Frequently Asked Questions ==
|
227 |
|
228 |
= What’s included in the free plan? =
|
229 |
+
You can add unlimited chat and social media channels like WhatsApp, Facebook Messenger (and 20+ other chat channels), display the widget on mobile and desktop, choose from 6 available colors (unlimited in the pro plan), position the widget on the left or right (custom positioning in the pro plan), custom call-to-action, page targeting (E.g., show the widget on product pages, etc), date & day and hours scheduling, traffic source targeing, country targeting, and more
|
230 |
|
231 |
= Is there a time limit for the free plan? =
|
232 |
No. You can use the free plan as long as you want.
|
283 |
|
284 |
== Changelog ==
|
285 |
|
286 |
+
= 3.0.4 =
|
287 |
+
Add unlimited chat and social buttons
|
288 |
+
|
289 |
= 3.0.3 =
|
290 |
Minor enchantments
|
291 |
|
543 |
Many cool new features including: new widget icons (including custom widget), decide which channels will be displayed on mobile/desktop, and change widget size
|
544 |
|
545 |
= 1.2.1 =
|
546 |
+
* Bug fixes
|
views/admin/admin.php
CHANGED
@@ -10,27 +10,28 @@ if (defined('ABSPATH') === false) {
|
|
10 |
exit;
|
11 |
}
|
12 |
|
13 |
-
|
14 |
-
|
15 |
-
if (!$isPro) {
|
16 |
-
if (get_option('cht_position') == 'custom') {
|
17 |
-
update_option('cht_position', 'right');
|
18 |
-
}
|
19 |
-
|
20 |
-
$social = get_option('cht_numb_slug');
|
21 |
-
$social = explode(",", $social);
|
22 |
-
$social = array_splice($social, 0, 3);
|
23 |
-
$social = implode(',', $social);
|
24 |
-
update_option('cht_numb_slug', $social);
|
25 |
-
if (get_option('cht_custom_color') != '') {
|
26 |
-
update_option('cht_custom_color', '');
|
27 |
-
update_option('cht_color', '#A886CD');
|
28 |
-
}
|
29 |
}
|
30 |
|
31 |
$chtLicenseKey = get_option('cht_license_key');
|
32 |
-
$proClass =
|
33 |
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
<div class="container <?php echo esc_attr($proClass) ?>" dir="ltr" id="chaty-container">
|
35 |
<main class="main">
|
36 |
<form id="cht-form" action="options.php" method="POST" enctype="multipart/form-data">
|
10 |
exit;
|
11 |
}
|
12 |
|
13 |
+
if (get_option('cht_position') == 'custom') {
|
14 |
+
update_option('cht_position', 'right');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
}
|
16 |
|
17 |
$chtLicenseKey = get_option('cht_license_key');
|
18 |
+
$proClass = "none_pro";
|
19 |
?>
|
20 |
+
<div class="sr-only">
|
21 |
+
<svg width="39" height="39" viewBox="0 0 39 39" fill="none" xmlns="http://www.w3.org/2000/svg">
|
22 |
+
<defs>
|
23 |
+
<linearGradient id="linear-gradient" x1="0.892" y1="0.192" x2="0.128" y2="0.85" gradientUnits="objectBoundingBox">
|
24 |
+
<stop offset="0" stop-color="#4a64d5"/>
|
25 |
+
<stop offset="0.322" stop-color="#9737bd"/>
|
26 |
+
<stop offset="0.636" stop-color="#f15540"/>
|
27 |
+
<stop offset="1" stop-color="#fecc69"/>
|
28 |
+
</linearGradient>
|
29 |
+
</defs>
|
30 |
+
<circle class="color-element" cx="19.5" cy="19.5" r="19.5" fill="url(#linear-gradient)"/>
|
31 |
+
<path id="Path_1923" data-name="Path 1923" d="M13.177,0H5.022A5.028,5.028,0,0,0,0,5.022v8.155A5.028,5.028,0,0,0,5.022,18.2h8.155A5.028,5.028,0,0,0,18.2,13.177V5.022A5.028,5.028,0,0,0,13.177,0Zm3.408,13.177a3.412,3.412,0,0,1-3.408,3.408H5.022a3.411,3.411,0,0,1-3.408-3.408V5.022A3.412,3.412,0,0,1,5.022,1.615h8.155a3.412,3.412,0,0,1,3.408,3.408v8.155Z" transform="translate(10 10.4)" fill="#fff"/>
|
32 |
+
<path id="Path_1924" data-name="Path 1924" d="M45.658,40.97a4.689,4.689,0,1,0,4.69,4.69A4.695,4.695,0,0,0,45.658,40.97Zm0,7.764a3.075,3.075,0,1,1,3.075-3.075A3.078,3.078,0,0,1,45.658,48.734Z" transform="translate(-26.558 -26.159)" fill="#fff"/>
|
33 |
+
</svg>
|
34 |
+
</div>
|
35 |
<div class="container <?php echo esc_attr($proClass) ?>" dir="ltr" id="chaty-container">
|
36 |
<main class="main">
|
37 |
<form id="cht-form" action="options.php" method="POST" enctype="multipart/form-data">
|
views/admin/channel.php
CHANGED
@@ -153,7 +153,7 @@ $isAgent = 0;
|
|
153 |
<!-- Social media setting box: start -->
|
154 |
<li data-id="<?php echo esc_attr($social['slug']) ?>" class="chaty-channel <?php echo ($isAgent == 1) ? "has-agent-view" : "" ?>" data-channel="<?php echo esc_attr($channelType) ?>" id="chaty-social-<?php echo esc_attr($social['slug']) ?>">
|
155 |
<!-- channel default settings start -->
|
156 |
-
<div class="channels-selected__item <?php echo esc_attr(($status) ? "img-active" : "") ?>
|
157 |
<!-- icon and input field start -->
|
158 |
<div class="chaty-default-settings space-x-3 flex items-center">
|
159 |
<!-- drag icon and channel icon start -->
|
@@ -388,16 +388,10 @@ $isAgent = 0;
|
|
388 |
?>
|
389 |
<!-- setting for desktop -->
|
390 |
<label class="device_view" for="<?php echo esc_attr($slug); ?>Desktop">
|
391 |
-
<input type="checkbox" id="<?php echo esc_attr($slug); ?>Desktop"
|
392 |
-
class="channels__view-check sr-only js-chanel-icon js-chanel-desktop"
|
393 |
-
data-type="<?php echo str_replace(' ', '_', strtolower(esc_attr__($this->del_space($social['slug'])))); ?>"
|
394 |
-
name="cht_social_<?php echo esc_attr($social['slug']); ?>[is_desktop]" value="checked"
|
395 |
-
data-gramm_editor="false" <?php echo esc_attr($isDesktop) ?> />
|
396 |
<span class="channels__view-txt">
|
397 |
-
<svg width="16" height="12" viewBox="0 0 16 12" fill="none"
|
398 |
-
|
399 |
-
<path
|
400 |
-
d="M13.3333 10.0001C14.0667 10.0001 14.6667 9.40008 14.6667 8.66675V2.00008C14.6667 1.26675 14.0667 0.666748 13.3333 0.666748H2.66667C1.93333 0.666748 1.33333 1.26675 1.33333 2.00008V8.66675C1.33333 9.40008 1.93333 10.0001 2.66667 10.0001H0.666667C0.3 10.0001 0 10.3001 0 10.6667C0 11.0334 0.3 11.3334 0.666667 11.3334H15.3333C15.7 11.3334 16 11.0334 16 10.6667C16 10.3001 15.7 10.0001 15.3333 10.0001H13.3333ZM3.33333 2.00008H12.6667C13.0333 2.00008 13.3333 2.30008 13.3333 2.66675V8.00008C13.3333 8.36675 13.0333 8.66675 12.6667 8.66675H3.33333C2.96667 8.66675 2.66667 8.36675 2.66667 8.00008V2.66675C2.66667 2.30008 2.96667 2.00008 3.33333 2.00008Z" />
|
401 |
</svg>
|
402 |
</span>
|
403 |
<span class="device-tooltip">
|
@@ -408,21 +402,16 @@ $isAgent = 0;
|
|
408 |
|
409 |
<!-- setting for mobile -->
|
410 |
<label class="device_view" for="<?php echo esc_attr($slug); ?>Mobile">
|
411 |
-
<input type="checkbox" id="<?php echo esc_attr($slug); ?>Mobile"
|
412 |
-
class="channels__view-check sr-only js-chanel-icon js-chanel-mobile"
|
413 |
-
data-type="<?php echo str_replace(' ', '_', strtolower(esc_attr__($this->del_space($social['slug'])))); ?>"
|
414 |
-
name="cht_social_<?php echo esc_attr($social['slug']); ?>[is_mobile]" value="checked"
|
415 |
-
data-gramm_editor="false" <?php echo esc_attr($isMobile) ?>>
|
416 |
<span class="channels__view-txt">
|
417 |
<svg width="9" height="16" viewBox="0 0 9 16" fill="none"
|
418 |
xmlns="http://www.w3.org/2000/svg">
|
419 |
-
<path
|
420 |
-
d="M7.33301 0.666748H1.99967C1.07967 0.666748 0.333008 1.41341 0.333008 2.33341V13.6667C0.333008 14.5867 1.07967 15.3334 1.99967 15.3334H7.33301C8.25301 15.3334 8.99967 14.5867 8.99967 13.6667V2.33341C8.99967 1.41341 8.25301 0.666748 7.33301 0.666748ZM4.66634 14.6667C4.11301 14.6667 3.66634 14.2201 3.66634 13.6667C3.66634 13.1134 4.11301 12.6667 4.66634 12.6667C5.21967 12.6667 5.66634 13.1134 5.66634 13.6667C5.66634 14.2201 5.21967 14.6667 4.66634 14.6667ZM7.66634 12.0001H1.66634V2.66675H7.66634V12.0001Z" />
|
421 |
</svg>
|
422 |
</span>
|
423 |
<span class="device-tooltip">
|
424 |
-
<span class="on"><?php esc_html_e("Hide on
|
425 |
-
<span class="off"><?php esc_html_e("Show on
|
426 |
</span>
|
427 |
</label>
|
428 |
</div>
|
@@ -432,15 +421,9 @@ $isAgent = 0;
|
|
432 |
<div class="channels__agent-box relative">
|
433 |
<a href="#" class="add-agent-btn space-x-1 pro-button-wrap">
|
434 |
<svg width="14" height="12" viewBox="0 0 14 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
435 |
-
<path
|
436 |
-
|
437 |
-
|
438 |
-
<path
|
439 |
-
d="M5.25 6.85714C8.1495 6.85714 10.5 9.15968 10.5 12H0C0 9.15968 2.35051 6.85714 5.25 6.85714Z"
|
440 |
-
fill="currentColor" />
|
441 |
-
<path
|
442 |
-
d="M12.25 3.42857C12.25 2.95518 11.8582 2.57143 11.375 2.57143C10.8918 2.57143 10.5 2.95518 10.5 3.42857V4.28571H9.625C9.14175 4.28571 8.75 4.66947 8.75 5.14286C8.75 5.61624 9.14175 6 9.625 6H10.5V6.85714C10.5 7.33053 10.8918 7.71429 11.375 7.71429C11.8582 7.71429 12.25 7.33053 12.25 6.85714V6H13.125C13.6082 6 14 5.61624 14 5.14286C14 4.66947 13.6082 4.28571 13.125 4.28571H12.25V3.42857Z"
|
443 |
-
fill="currentColor" />
|
444 |
</svg>
|
445 |
<span><?php esc_html_e("Add Agents", "chaty"); ?></span>
|
446 |
<div class="pro-button">
|
@@ -454,15 +437,9 @@ $isAgent = 0;
|
|
454 |
<div class="channels__agent-box transparent relative hidden">
|
455 |
<a href="#" class="add-agent-btn pro-button-wrap">
|
456 |
<svg width="14" height="12" viewBox="0 0 14 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
457 |
-
<path
|
458 |
-
|
459 |
-
|
460 |
-
<path
|
461 |
-
d="M5.25 6.85714C8.1495 6.85714 10.5 9.15968 10.5 12H0C0 9.15968 2.35051 6.85714 5.25 6.85714Z"
|
462 |
-
fill="white" />
|
463 |
-
<path
|
464 |
-
d="M12.25 3.42857C12.25 2.95518 11.8582 2.57143 11.375 2.57143C10.8918 2.57143 10.5 2.95518 10.5 3.42857V4.28571H9.625C9.14175 4.28571 8.75 4.66947 8.75 5.14286C8.75 5.61624 9.14175 6 9.625 6H10.5V6.85714C10.5 7.33053 10.8918 7.71429 11.375 7.71429C11.8582 7.71429 12.25 7.33053 12.25 6.85714V6H13.125C13.6082 6 14 5.61624 14 5.14286C14 4.66947 13.6082 4.28571 13.125 4.28571H12.25V3.42857Z"
|
465 |
-
fill="white" />
|
466 |
</svg>
|
467 |
<span><?php esc_html_e("Add Agents", "chaty"); ?></span>
|
468 |
<div class="pro-button">
|
@@ -486,10 +463,7 @@ $isAgent = 0;
|
|
486 |
?>
|
487 |
|
488 |
<!-- settings button -->
|
489 |
-
<div class="chaty-settings <?php echo esc_attr($closeClass) ?>"
|
490 |
-
data-nonce="<?php echo wp_create_nonce($social['slug']."-settings") ?>"
|
491 |
-
id="<?php echo esc_attr($social['slug']); ?>-close-btn"
|
492 |
-
onclick="toggle_chaty_setting('<?php echo esc_attr($social['slug']); ?>')">
|
493 |
<a class="flex items-center space-x-1.5" href="javascript:;">
|
494 |
<span>
|
495 |
<svg width="16" height="16" viewBox="0 0 16 16" fill="none">
|
@@ -497,7 +471,7 @@ $isAgent = 0;
|
|
497 |
<path d="M12.9332 9.99984C12.8444 10.2009 12.818 10.424 12.8572 10.6402C12.8964 10.8565 12.9995 11.056 13.1532 11.2132L13.1932 11.2532C13.3171 11.377 13.4155 11.5241 13.4826 11.6859C13.5497 11.8478 13.5842 12.0213 13.5842 12.1965C13.5842 12.3717 13.5497 12.5452 13.4826 12.7071C13.4155 12.869 13.3171 13.016 13.1932 13.1398C13.0693 13.2638 12.9223 13.3621 12.7604 13.4292C12.5986 13.4963 12.4251 13.5309 12.2498 13.5309C12.0746 13.5309 11.9011 13.4963 11.7392 13.4292C11.5774 13.3621 11.4303 13.2638 11.3065 13.1398L11.2665 13.0998C11.1094 12.9461 10.9098 12.843 10.6936 12.8038C10.4773 12.7646 10.2542 12.7911 10.0532 12.8798C9.85599 12.9643 9.68782 13.1047 9.56937 13.2835C9.45092 13.4624 9.38736 13.672 9.3865 13.8865V13.9998C9.3865 14.3535 9.24603 14.6926 8.99598 14.9426C8.74593 15.1927 8.40679 15.3332 8.05317 15.3332C7.69955 15.3332 7.36041 15.1927 7.11036 14.9426C6.86031 14.6926 6.71984 14.3535 6.71984 13.9998V13.9398C6.71467 13.7192 6.64325 13.5052 6.51484 13.3256C6.38644 13.1461 6.20699 13.0094 5.99984 12.9332C5.79876 12.8444 5.57571 12.818 5.35944 12.8572C5.14318 12.8964 4.94362 12.9995 4.7865 13.1532L4.7465 13.1932C4.62267 13.3171 4.47562 13.4155 4.31376 13.4826C4.15189 13.5497 3.97839 13.5842 3.80317 13.5842C3.62795 13.5842 3.45445 13.5497 3.29258 13.4826C3.13072 13.4155 2.98367 13.3171 2.85984 13.1932C2.73587 13.0693 2.63752 12.9223 2.57042 12.7604C2.50332 12.5986 2.46879 12.4251 2.46879 12.2498C2.46879 12.0746 2.50332 11.9011 2.57042 11.7392C2.63752 11.5774 2.73587 11.4303 2.85984 11.3065L2.89984 11.2665C3.05353 11.1094 3.15663 10.9098 3.19584 10.6936C3.23505 10.4773 3.20858 10.2542 3.11984 10.0532C3.03533 9.85599 2.89501 9.68782 2.71615 9.56937C2.53729 9.45092 2.32769 9.38736 2.11317 9.3865H1.99984C1.64622 9.3865 1.30708 9.24603 1.05703 8.99598C0.80698 8.74593 0.666504 8.40679 0.666504 8.05317C0.666504 7.69955 0.80698 7.36041 1.05703 7.11036C1.30708 6.86031 1.64622 6.71984 1.99984 6.71984H2.05984C2.2805 6.71467 2.49451 6.64325 2.67404 6.51484C2.85357 6.38644 2.99031 6.20699 3.0665 5.99984C3.15525 5.79876 3.18172 5.57571 3.14251 5.35944C3.10329 5.14318 3.00019 4.94362 2.8465 4.7865L2.8065 4.7465C2.68254 4.62267 2.58419 4.47562 2.51709 4.31376C2.44999 4.15189 2.41545 3.97839 2.41545 3.80317C2.41545 3.62795 2.44999 3.45445 2.51709 3.29258C2.58419 3.13072 2.68254 2.98367 2.8065 2.85984C2.93033 2.73587 3.07739 2.63752 3.23925 2.57042C3.40111 2.50332 3.57462 2.46879 3.74984 2.46879C3.92506 2.46879 4.09856 2.50332 4.26042 2.57042C4.42229 2.63752 4.56934 2.73587 4.69317 2.85984L4.73317 2.89984C4.89029 3.05353 5.08985 3.15663 5.30611 3.19584C5.52237 3.23505 5.74543 3.20858 5.9465 3.11984H5.99984C6.19702 3.03533 6.36518 2.89501 6.48363 2.71615C6.60208 2.53729 6.66565 2.32769 6.6665 2.11317V1.99984C6.6665 1.64622 6.80698 1.30708 7.05703 1.05703C7.30708 0.80698 7.64621 0.666504 7.99984 0.666504C8.35346 0.666504 8.6926 0.80698 8.94264 1.05703C9.19269 1.30708 9.33317 1.64622 9.33317 1.99984V2.05984C9.33402 2.27436 9.39759 2.48395 9.51604 2.66281C9.63449 2.84167 9.80266 2.98199 9.99984 3.0665C10.2009 3.15525 10.424 3.18172 10.6402 3.14251C10.8565 3.10329 11.056 3.00019 11.2132 2.8465L11.2532 2.8065C11.377 2.68254 11.5241 2.58419 11.6859 2.51709C11.8478 2.44999 12.0213 2.41545 12.1965 2.41545C12.3717 2.41545 12.5452 2.44999 12.7071 2.51709C12.869 2.58419 13.016 2.68254 13.1398 2.8065C13.2638 2.93033 13.3621 3.07739 13.4292 3.23925C13.4963 3.40111 13.5309 3.57462 13.5309 3.74984C13.5309 3.92506 13.4963 4.09856 13.4292 4.26042C13.3621 4.42229 13.2638 4.56934 13.1398 4.69317L13.0998 4.73317C12.9461 4.89029 12.843 5.08985 12.8038 5.30611C12.7646 5.52237 12.7911 5.74543 12.8798 5.9465V5.99984C12.9643 6.19702 13.1047 6.36518 13.2835 6.48363C13.4624 6.60208 13.672 6.66565 13.8865 6.6665H13.9998C14.3535 6.6665 14.6926 6.80698 14.9426 7.05703C15.1927 7.30708 15.3332 7.64621 15.3332 7.99984C15.3332 8.35346 15.1927 8.6926 14.9426 8.94264C14.6926 9.19269 14.3535 9.33317 13.9998 9.33317H13.9398C13.7253 9.33402 13.5157 9.39759 13.3369 9.51604C13.158 9.63449 13.0177 9.80266 12.9332 9.99984V9.99984Z" stroke="currentColor" stroke-width="1.33" stroke-linecap="round" stroke-linejoin="round"/>
|
498 |
</svg>
|
499 |
</span>
|
500 |
-
<span
|
501 |
</a>
|
502 |
</div>
|
503 |
</div>
|
@@ -505,53 +479,33 @@ $isAgent = 0;
|
|
505 |
|
506 |
|
507 |
<!-- advance setting fields: start -->
|
508 |
-
<?php $className =
|
509 |
-
<div class="chaty-advance-settings mt-5 space-y-4 <?php echo esc_attr($className); ?>"
|
510 |
-
style="<?php echo (empty($closeClass) && $social['slug'] == 'Contact_Us') ? "display:block" : ""; ?>">
|
511 |
<!-- Settings for custom icon and color -->
|
512 |
<div class="chaty-setting-col sm:flex items-center space-y-2 sm:space-y-0 sm:space-x-3">
|
513 |
-
<label class="font-primary text-cht-gray-150 w-44"
|
514 |
<div class="flex items-center">
|
515 |
<!-- input for custom color -->
|
516 |
-
<input type="text" name="cht_social_<?php echo esc_attr($social['slug']); ?>[bg_color]"
|
517 |
-
class="chaty-color-field chaty-bg-color" value="<?php echo esc_attr($value['bg_color']) ?>" />
|
518 |
|
519 |
<!-- button to upload custom image -->
|
520 |
-
<?php if ($this->is_pro()) { ?>
|
521 |
-
<a onclick="upload_chaty_image('<?php echo esc_attr($social['slug']); ?>')" href="javascript:;" class="upload-chaty-icon">
|
522 |
-
<span class="dashicons dashicons-upload"></span>
|
523 |
-
<span class="hidden sm:inline-block ml-1">Custom Image</span>
|
524 |
-
</a>
|
525 |
-
|
526 |
-
<!-- hidden input value for image -->
|
527 |
-
<input id="cht_social_image_<?php echo esc_attr($social['slug']); ?>" type="hidden"
|
528 |
-
name="cht_social_<?php echo esc_attr($social['slug']); ?>[image_id]"
|
529 |
-
value="<?php echo esc_attr($imageId) ?>" />
|
530 |
-
<?php } else { ?>
|
531 |
<div class="pro-features upload-image mx-2">
|
532 |
<div class="pro-item">
|
533 |
-
<a target="_blank" href="<?php echo esc_url($this->getUpgradeMenuItemUrl());?>"
|
534 |
-
class="upload-chaty-icon"><span class="dashicons dashicons-upload"></span> Custom
|
535 |
-
Image</a>
|
536 |
</div>
|
537 |
<div class="pro-button">
|
538 |
-
<a target="_blank"
|
539 |
-
href="<?php echo esc_url($this->getUpgradeMenuItemUrl());?>"><?php esc_html_e('Upgrade to Pro', 'chaty');?></a>
|
540 |
</div>
|
541 |
</div>
|
542 |
|
543 |
<div class="pro-features upload-image">
|
544 |
<div class="pro-item">
|
545 |
-
<a target="_blank" href="<?php echo esc_url($this->getUpgradeMenuItemUrl());?>"
|
546 |
-
class="upload-chaty-icon">Change Icon</a>
|
547 |
</div>
|
548 |
<div class="pro-button">
|
549 |
-
<a target="_blank"
|
550 |
-
href="<?php echo esc_url($this->getUpgradeMenuItemUrl());?>"><?php esc_html_e('Upgrade to Pro', 'chaty');?></a>
|
551 |
</div>
|
552 |
</div>
|
553 |
-
<?php }//end if
|
554 |
-
?>
|
555 |
</div>
|
556 |
</div>
|
557 |
|
@@ -566,43 +520,37 @@ $isAgent = 0;
|
|
566 |
$socials = $this->socials;
|
567 |
?>
|
568 |
<div class="chaty-setting-col space-y-2 sm:space-y-0 sm:flex sm:items-center sm:space-x-3">
|
569 |
-
<label class="font-primary text-cht-gray-150 w-44"
|
570 |
<div>
|
571 |
<!-- input for custom title -->
|
572 |
-
<select class="channel-select-input"
|
573 |
-
|
574 |
-
value="<?php echo esc_attr($channelValue) ?>">
|
575 |
-
<option value="<?php echo esc_attr($social['slug']) ?>">Custom channel</option>
|
576 |
<?php foreach ($socials as $socialIcon) {
|
577 |
$selected = ($socialIcon['slug'] == $channelType) ? "selected" : "";
|
578 |
if ($socialIcon['slug'] != 'Custom_Link' && $socialIcon['slug'] != 'Custom_Link_3' && $socialIcon['slug'] != 'Custom_Link_4' && $socialIcon['slug'] != 'Custom_Link_5' && $socialIcon['slug'] != 'Contact_Us' && $socialIcon['slug'] != 'Link') { ?>
|
579 |
-
|
580 |
-
<?php echo esc_attr($socialIcon['title']) ?></option>
|
581 |
<?php }
|
582 |
}?>
|
583 |
</select>
|
584 |
</div>
|
585 |
</div>
|
586 |
-
<?php
|
587 |
-
|
|
|
588 |
|
589 |
<div class="chaty-setting-col sm:flex sm:items-center space-y-2 sm:space-y-0 sm:space-x-3">
|
590 |
-
<label class="font-primary text-cht-gray-150 w-44"
|
591 |
<div>
|
592 |
-
<input type="text" class="chaty-title"
|
593 |
-
name="cht_social_<?php echo esc_attr($social['slug']); ?>[title]"
|
594 |
-
value="<?php echo esc_attr($value['title']) ?>">
|
595 |
</div>
|
596 |
</div>
|
597 |
|
598 |
<div class="Contact_Us-settings advanced-settings">
|
599 |
<div class="chaty-setting-col sm:flex sm:items-center space-y-2 sm:space-y-0 sm:space-x-3">
|
600 |
-
<label class="font-primary text-cht-gray-150 w-44"
|
601 |
<div>
|
602 |
<?php $contactFormTitle = isset($value['contact_form_title']) ? $value['contact_form_title'] : esc_html__("Contact Us", "chaty"); ?>
|
603 |
-
<input id="cht_social_message_<?php echo esc_attr($social['slug']); ?>_form_title" type="text"
|
604 |
-
name="cht_social_<?php echo esc_attr($social['slug']); ?>[contact_form_title]"
|
605 |
-
value="<?php echo esc_attr($contactFormTitle) ?>">
|
606 |
</div>
|
607 |
</div>
|
608 |
|
@@ -611,104 +559,71 @@ $isAgent = 0;
|
|
611 |
|
612 |
<?php $fieldValue = isset($value['button_text_color']) ? $value['button_text_color'] : "#ffffff" ?>
|
613 |
<div class="chaty-setting-col flex items-center space-x-3">
|
614 |
-
<label class="font-primary text-cht-gray-150 w-44" for="button_text_color_for_<?php echo esc_attr($social['slug']); ?>">
|
615 |
-
color</label>
|
616 |
<div>
|
617 |
-
<input id="button_text_color_for_<?php echo esc_attr($social['slug']); ?>"
|
618 |
-
class="chaty-color-field button-color" type="text"
|
619 |
-
name="cht_social_<?php echo esc_attr($social['slug']); ?>[button_text_color]"
|
620 |
-
value="<?php echo esc_attr($fieldValue); ?>">
|
621 |
</div>
|
622 |
</div>
|
623 |
|
624 |
<?php $fieldValue = isset($value['button_bg_color']) ? $value['button_bg_color'] : "#A886CD" ?>
|
625 |
<div class="chaty-setting-col flex items-center space-x-3">
|
626 |
-
<label class="font-primary text-cht-gray-150 w-44" for="button_bg_color_for_<?php echo esc_attr($social['slug']); ?>">
|
627 |
-
color</label>
|
628 |
<div>
|
629 |
-
<input id="button_bg_color_for_<?php echo esc_attr($social['slug']); ?>"
|
630 |
-
class="chaty-color-field button-color" type="text"
|
631 |
-
name="cht_social_<?php echo esc_attr($social['slug']); ?>[button_bg_color]"
|
632 |
-
value="<?php echo esc_attr($fieldValue); ?>">
|
633 |
</div>
|
634 |
</div>
|
635 |
|
636 |
<?php $fieldValue = isset($value['button_text']) ? $value['button_text'] : "Chat" ?>
|
637 |
<div class="chaty-setting-col sm:flex sm:items-center sm:space-x-3">
|
638 |
-
<label class="font-primary text-cht-gray-150 w-44" for="button_text_for_<?php echo esc_attr($social['slug']); ?>"
|
639 |
<div>
|
640 |
-
<input id="button_text_for_<?php echo esc_attr($social['slug']); ?>" type="text"
|
641 |
-
name="cht_social_<?php echo esc_attr($social['slug']); ?>[button_text]"
|
642 |
-
value="<?php echo esc_attr($fieldValue); ?>">
|
643 |
</div>
|
644 |
</div>
|
645 |
<?php $fieldValue = isset($value['thanks_message']) ? $value['thanks_message'] : "Your message was sent successfully" ?>
|
646 |
<div class="chaty-setting-col sm:flex sm:items-center sm:space-x-3">
|
647 |
-
<label class="font-primary text-cht-gray-150 w-44" for="thanks_message_for_<?php echo esc_attr($social['slug']); ?>"
|
648 |
-
message</label>
|
649 |
<div>
|
650 |
-
<input id="thanks_message_for_<?php echo esc_attr($social['slug']); ?>" type="text"
|
651 |
-
name="cht_social_<?php echo esc_attr($social['slug']); ?>[thanks_message]"
|
652 |
-
value="<?php echo esc_attr($fieldValue); ?>">
|
653 |
</div>
|
654 |
</div>
|
655 |
|
656 |
<?php $fieldValue = isset($value['redirect_action']) ? $value['redirect_action'] : "no" ?>
|
657 |
<div class="chaty-setting-col">
|
658 |
-
<input type="hidden" name="cht_social_<?php echo esc_attr($social['slug']); ?>[redirect_action]"
|
659 |
-
|
660 |
-
|
661 |
-
for="redirect_action_<?php echo esc_attr($social['slug']); ?>">
|
662 |
-
<input type="checkbox" class="chaty-redirect-setting"
|
663 |
-
name="cht_social_<?php echo esc_attr($social['slug']); ?>[redirect_action]"
|
664 |
-
id="redirect_action_<?php echo esc_attr($social['slug']); ?>" value="yes"
|
665 |
-
<?php checked($fieldValue, "yes") ?>>
|
666 |
<div class="chaty-slider round"></div>
|
667 |
-
Redirect visitors after submission
|
668 |
</label>
|
669 |
</div>
|
670 |
<div class="redirect_action-settings <?php echo ($fieldValue == "yes") ? "active" : "" ?>">
|
671 |
<?php $fieldValue = isset($value['redirect_link']) ? $value['redirect_link'] : "" ?>
|
672 |
<div class="chaty-setting-col sm:flex sm:items-center sm:space-x-3 my-2">
|
673 |
-
<label class="font-primary text-cht-gray-150 w-44" for="redirect_link_for_<?php echo esc_attr($social['slug']); ?>">
|
674 |
-
link</label>
|
675 |
<div>
|
676 |
-
<input id="redirect_link_for_<?php echo esc_attr($social['slug']); ?>"
|
677 |
-
placeholder="<?php echo site_url("/") ?>" type="text"
|
678 |
-
name="cht_social_<?php echo esc_attr($social['slug']); ?>[redirect_link]"
|
679 |
-
value="<?php echo esc_attr($fieldValue); ?>">
|
680 |
</div>
|
681 |
</div>
|
682 |
<?php $fieldValue = isset($value['link_in_new_tab']) ? $value['link_in_new_tab'] : "no" ?>
|
683 |
<div class="chaty-setting-col sm:flex sm:items-center">
|
684 |
-
<input type="hidden"
|
685 |
-
|
686 |
-
|
687 |
-
for="link_in_new_tab_<?php echo esc_attr($social['slug']); ?>">
|
688 |
-
<input type="checkbox" class="chaty-field-setting"
|
689 |
-
name="cht_social_<?php echo esc_attr($social['slug']); ?>[link_in_new_tab]"
|
690 |
-
id="link_in_new_tab_<?php echo esc_attr($social['slug']); ?>" value="yes"
|
691 |
-
<?php checked($fieldValue, "yes") ?>>
|
692 |
<div class="chaty-slider round"></div>
|
693 |
-
Open in a new tab
|
694 |
</label>
|
695 |
</div>
|
696 |
</div>
|
697 |
|
698 |
<?php $fieldValue = isset($value['close_form_after']) ? $value['close_form_after'] : "no" ?>
|
699 |
<div class="chaty-setting-col">
|
700 |
-
<input type="hidden"
|
701 |
-
|
702 |
-
|
703 |
-
for="close_form_after_<?php echo esc_attr($social['slug']); ?>">
|
704 |
-
<input type="checkbox" class="chaty-close_form_after-setting"
|
705 |
-
name="cht_social_<?php echo esc_attr($social['slug']); ?>[close_form_after]"
|
706 |
-
id="close_form_after_<?php echo esc_attr($social['slug']); ?>" value="yes"
|
707 |
-
<?php checked($fieldValue, "yes") ?>>
|
708 |
<div class="chaty-slider round"></div>
|
709 |
-
Close form automatically after submission
|
710 |
-
<span class="icon label-tooltip inline-message hidden sm:inline-block"
|
711 |
-
data-label="Close the form automatically after a few seconds based on your choice">
|
712 |
<span>
|
713 |
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">
|
714 |
<path d="M8.00004 14.6654C11.6819 14.6654 14.6667 11.6806 14.6667 7.9987C14.6667 4.3168 11.6819 1.33203 8.00004 1.33203C4.31814 1.33203 1.33337 4.3168 1.33337 7.9987C1.33337 11.6806 4.31814 14.6654 8.00004 14.6654Z" stroke="#72777c" stroke-width="1.33" stroke-linecap="round" stroke-linejoin="round"></path>
|
@@ -722,33 +637,22 @@ $isAgent = 0;
|
|
722 |
<div class="close_form_after-settings <?php echo ($fieldValue == "yes") ? "active" : "" ?>">
|
723 |
<?php $fieldValue = isset($value['close_form_after_seconds']) ? $value['close_form_after_seconds'] : "3" ?>
|
724 |
<div class="chaty-setting-col sm:flex sm:items-center sm:space-x-3">
|
725 |
-
<label class="font-primary text-cht-gray-150 w-44" for="close_form_after_seconds_<?php echo esc_attr($social['slug']); ?>"
|
726 |
-
(Seconds)</label>
|
727 |
<div>
|
728 |
-
<input id="close_form_after_seconds_<?php echo esc_attr($social['slug']); ?>"
|
729 |
-
type="number"
|
730 |
-
min="0"
|
731 |
-
name="cht_social_<?php echo esc_attr($social['slug']); ?>[close_form_after_seconds]"
|
732 |
-
value="<?php echo esc_attr($fieldValue); ?>">
|
733 |
</div>
|
734 |
</div>
|
735 |
</div>
|
736 |
</div>
|
737 |
<div class="form-field-setting-col my-3 space-y-4">
|
738 |
-
<input type="hidden" value="no"
|
739 |
-
|
740 |
-
<input type="hidden" value="yes"
|
741 |
-
name="cht_social_<?php echo esc_attr($social['slug']); ?>[save_leads_locally]">
|
742 |
<?php $fieldValue = isset($val['save_leads_locally']) ? $val['save_leads_locally'] : "yes" ?>
|
743 |
<div class="chaty-setting-col">
|
744 |
<label class="text-cht-gray-150 font-primary full-width chaty-switch" for="save_leads_locally_<?php echo esc_attr($social['slug']); ?>">
|
745 |
-
<input type="checkbox" disabled
|
746 |
-
id="save_leads_locally_<?php echo esc_attr($social['slug']); ?>" value="yes"
|
747 |
-
name="cht_social_<?php echo esc_attr($social['slug']); ?>[save_leads_locally]"
|
748 |
-
<?php checked($fieldValue, "yes") ?>>
|
749 |
<div class="chaty-slider round"></div>
|
750 |
-
Save leads to <a href="<?php echo admin_url("admin.php?page=chaty-contact-form-feed") ?>"
|
751 |
-
target="_blank">this site</a>
|
752 |
<div class="html-tooltip hidden sm:inline-block top no-position">
|
753 |
<span>
|
754 |
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">
|
@@ -757,20 +661,15 @@ $isAgent = 0;
|
|
757 |
<path d="M8 5.33203H8.00667" stroke="#72777c" stroke-width="1.33" stroke-linecap="round" stroke-linejoin="round"></path>
|
758 |
</svg>
|
759 |
</span>
|
760 |
-
<span class="tooltip-text top">Your leads will be saved in your local database, you'll
|
761 |
-
be able to find them <a target="_blank"
|
762 |
-
href="<?php echo admin_url("admin.php?page=chaty-contact-form-feed") ?>">here</a></span>
|
763 |
</div>
|
764 |
</label>
|
765 |
</div>
|
766 |
<?php $fieldValue = isset($value['send_leads_in_email']) ? $value['send_leads_in_email'] : "no" ?>
|
767 |
<div class="chaty-setting-col">
|
768 |
-
<label class="flex items-center group flex-wrap gap-2 text-cht-gray-150 text-base" for="save_leads_to_email_<?php echo esc_attr($social['slug']); ?>"
|
769 |
-
class="email-setting full-width font-primary text-cht-gray-150">
|
770 |
<div class="chaty-switch">
|
771 |
-
<input class="email-setting-field" disabled type="checkbox"
|
772 |
-
id="save_leads_to_email_<?php echo esc_attr($social['slug']); ?>" value="yes"
|
773 |
-
name="cht_social_<?php echo esc_attr($social['slug']); ?>[send_leads_in_email]">
|
774 |
<div class="chaty-slider round"></div>
|
775 |
<?php esc_html_e('Send leads to your email', 'chaty') ?>
|
776 |
</div>
|
@@ -795,28 +694,21 @@ $isAgent = 0;
|
|
795 |
<label for="email_for_<?php echo esc_attr($social['slug']); ?>">Email address</label>
|
796 |
<div>
|
797 |
<?php $fieldValue = isset($value['email_address']) ? $value['email_address'] : "" ?>
|
798 |
-
<input id="email_for_<?php echo esc_attr($social['slug']); ?>" type="text"
|
799 |
-
name="cht_social_<?php echo esc_attr($social['slug']); ?>[email_address]"
|
800 |
-
value="<?php echo esc_attr($fieldValue); ?>">
|
801 |
</div>
|
802 |
</div>
|
803 |
<div class="chaty-setting-col">
|
804 |
<label for="sender_name_for_<?php echo esc_attr($social['slug']); ?>">Sender's name</label>
|
805 |
<div>
|
806 |
<?php $fieldValue = isset($value['sender_name']) ? $value['sender_name'] : "" ?>
|
807 |
-
<input id="sender_name_for_<?php echo esc_attr($social['slug']); ?>" type="text"
|
808 |
-
name="cht_social_<?php echo esc_attr($social['slug']); ?>[sender_name]"
|
809 |
-
value="<?php echo esc_attr($fieldValue); ?>">
|
810 |
</div>
|
811 |
</div>
|
812 |
<div class="chaty-setting-col">
|
813 |
-
<label for="email_subject_for_<?php echo esc_attr($social['slug']); ?>">Email
|
814 |
-
subject</label>
|
815 |
<div>
|
816 |
<?php $fieldValue = isset($value['email_subject']) ? $value['email_subject'] : "New lead from Chaty - {name} - {date} {hour}" ?>
|
817 |
-
<input id="email_subject_for_<?php echo esc_attr($social['slug']); ?>" type="text"
|
818 |
-
name="cht_social_<?php echo esc_attr($social['slug']); ?>[email_subject]"
|
819 |
-
value="<?php echo esc_attr($fieldValue); ?>">
|
820 |
<div class="mail-merge-tags">
|
821 |
<span>{name}</span><span>{phone}</span><span>{email}</span><span>{date}</span><span>{hour}</span>
|
822 |
</div>
|
@@ -826,147 +718,12 @@ $isAgent = 0;
|
|
826 |
</div>
|
827 |
</div>
|
828 |
|
829 |
-
<?php if ($this->is_pro()) { ?>
|
830 |
-
<div class="Whatsapp-settings advanced-settings">
|
831 |
-
<!-- advance setting for Whatsapp -->
|
832 |
-
<div class="chaty-setting-col sm:flex items-start space-y-2 sm:space-y-0 sm:space-x-3">
|
833 |
-
<label class="font-primary text-cht-gray-150 w-44 mt-2">
|
834 |
-
Pre Set Message
|
835 |
-
<span class="icon label-tooltip inline-tooltip"
|
836 |
-
data-label="Add your own pre-set message that's automatically added to the user's message. You can also use merge tags and add the URL or the title of the current visitor's page. E.g. you can add the current URL of a product to the message so you know which product the visitor is talking about when the visitor messages you">
|
837 |
-
<span>
|
838 |
-
<svg xmlns="http://www.w3.org/2000/svg" class="inline-block" width="20" height="27" viewBox="0 0 20 20" fill="none">
|
839 |
-
<path d="M8.00004 14.6654C11.6819 14.6654 14.6667 11.6806 14.6667 7.9987C14.6667 4.3168 11.6819 1.33203 8.00004 1.33203C4.31814 1.33203 1.33337 4.3168 1.33337 7.9987C1.33337 11.6806 4.31814 14.6654 8.00004 14.6654Z" stroke="#72777c" stroke-width="1.33" stroke-linecap="round" stroke-linejoin="round"></path>
|
840 |
-
<path d="M8 10.6667V8" stroke="#72777c" stroke-width="1.33" stroke-linecap="round" stroke-linejoin="round"></path>
|
841 |
-
<path d="M8 5.33203H8.00667" stroke="#72777c" stroke-width="1.33" stroke-linecap="round" stroke-linejoin="round"></path>
|
842 |
-
</svg>
|
843 |
-
</span>
|
844 |
-
</span>
|
845 |
-
</label>
|
846 |
-
<div>
|
847 |
-
<?php $preSetMessage = isset($value['pre_set_message']) ? $value['pre_set_message'] : ""; ?>
|
848 |
-
<input id="cht_social_message_<?php echo esc_attr($social['slug']); ?>" type="text"
|
849 |
-
name="cht_social_<?php echo esc_attr($social['slug']); ?>[pre_set_message]"
|
850 |
-
value="<?php echo esc_attr($preSetMessage) ?>">
|
851 |
-
<span class="supported-tags mt-2"><span class="icon label-tooltip support-tooltip"
|
852 |
-
data-label="{title} tag grabs the page title of the webpage">{title}</span> and <span
|
853 |
-
class="icon label-tooltip support-tooltip"
|
854 |
-
data-label="{url} tag grabs the URL of the page">{url}</span> tags are supported</span>
|
855 |
-
</div>
|
856 |
-
</div>
|
857 |
-
</div>
|
858 |
-
<div class="Email-settings advanced-settings">
|
859 |
-
<!-- advance setting for Email -->
|
860 |
-
<div class="chaty-setting-col sm:flex items-start sm:space-x-3">
|
861 |
-
<label class="font-primary text-cht-gray-150 w-44">
|
862 |
-
Mail Subject
|
863 |
-
<span class="icon label-tooltip inline-tooltip"
|
864 |
-
data-label="Add your own pre-set message that's automatically added to the user's message. You can also use merge tags and add the URL or the title of the current visitor's page. E.g. you can add the current URL of a product to the message so you know which product the visitor is talking about when the visitor messages you"><span
|
865 |
-
class="dashicons dashicons-editor-help"></span></span>
|
866 |
-
</label>
|
867 |
-
<div>
|
868 |
-
<?php $mailSubject = isset($value['mail_subject']) ? $value['mail_subject'] : ""; ?>
|
869 |
-
<input id="cht_social_message_<?php echo esc_attr($social['slug']); ?>" type="text"
|
870 |
-
name="cht_social_<?php echo esc_attr($social['slug']); ?>[mail_subject]"
|
871 |
-
value="<?php echo esc_attr($mailSubject) ?>">
|
872 |
-
<span class="supported-tags"><span class="icon label-tooltip support-tooltip"
|
873 |
-
data-label="{title} tag grabs the page title of the webpage">{title}</span> and <span
|
874 |
-
class="icon label-tooltip support-tooltip"
|
875 |
-
data-label="{url} tag grabs the URL of the page">{url}</span> tags are supported</span>
|
876 |
-
</div>
|
877 |
-
</div>
|
878 |
-
</div>
|
879 |
-
<div class="WeChat-settings advanced-settings">
|
880 |
-
<!-- advance setting for WeChat -->
|
881 |
-
<?php
|
882 |
-
$qrCode = isset($value['qr_code']) ? $value['qr_code'] : "";
|
883 |
-
// Initialize QR code value if not exists. 2.1.0 change
|
884 |
-
$imageUrl = "";
|
885 |
-
$status = 0;
|
886 |
-
if ($qrCode != "") {
|
887 |
-
$imageUrl = wp_get_attachment_image_src($qrCode, "full")[0];
|
888 |
-
// get custom Image URL if exists
|
889 |
-
}
|
890 |
-
|
891 |
-
if ($imageUrl == "") {
|
892 |
-
$imageUrl = plugin_dir_url("")."chaty/admin/assets/images/chaty-default.png";
|
893 |
-
// Initialize with default image URL if URL is not exists
|
894 |
-
} else {
|
895 |
-
$status = 1;
|
896 |
-
}
|
897 |
-
?>
|
898 |
-
<div class="chaty-setting-col flex items-center flex-wrap gap-3">
|
899 |
-
<label class="font-primary text-cht-gray-150 w-44">Upload QR Code</label>
|
900 |
-
<div>
|
901 |
-
<!-- Button to upload QR Code image -->
|
902 |
-
<a class="cht-upload-image <?php echo esc_attr(($status) ? "active" : "") ?>"
|
903 |
-
id="upload_qr_code" href="javascript:;"
|
904 |
-
onclick="upload_qr_code('<?php echo esc_attr($social['slug']); ?>')">
|
905 |
-
<img id="cht_social_image_src_<?php echo esc_attr($social['slug']); ?>"
|
906 |
-
src="<?php echo esc_url($imageUrl) ?>" alt="<?php echo esc_attr($value['title']) ?>">
|
907 |
-
<span class="dashicons dashicons-upload"></span>
|
908 |
-
</a>
|
909 |
-
|
910 |
-
<!-- Button to remove QR Code image -->
|
911 |
-
<a href="javascript:;"
|
912 |
-
class="remove-qr-code remove-qr-code-<?php echo esc_attr($social['slug']); ?> <?php echo esc_attr(($status) ? "active" : "") ?>"
|
913 |
-
onclick="remove_qr_code('<?php echo esc_attr($social['slug']); ?>')"><span
|
914 |
-
class="dashicons dashicons-no-alt"></span></a>
|
915 |
-
|
916 |
-
<!-- input hidden field for QR Code -->
|
917 |
-
<input id="upload_qr_code_val-<?php echo esc_attr($social['slug']); ?>" type="hidden"
|
918 |
-
name="cht_social_<?php echo esc_attr($social['slug']); ?>[qr_code]"
|
919 |
-
value="<?php echo esc_attr($qrCode) ?>">
|
920 |
-
</div>
|
921 |
-
</div>
|
922 |
-
</div>
|
923 |
-
<div
|
924 |
-
class="Link-settings Custom_Link-settings Custom_Link_3-settings Custom_Link_4-settings Custom_Link_5-settings advanced-settings">
|
925 |
-
<?php $isChecked = (!isset($value['new_window']) || $value['new_window'] == 1) ? 1 : 0; ?>
|
926 |
-
<!-- Advance setting for Custom Link -->
|
927 |
-
<div class="clear clearfix"></div>
|
928 |
-
<div class="chaty-setting-col sm:flex sm:items-center sm:space-x-3">
|
929 |
-
<label class="font-primary text-cht-gray-150 w-44">Open In a New Tab</label>
|
930 |
-
<div>
|
931 |
-
<input type="hidden" name="cht_social_<?php echo esc_attr($social['slug']); ?>[new_window]"
|
932 |
-
value="0">
|
933 |
-
<label class="channels__view" for="cht_social_window_<?php echo esc_attr($social['slug']); ?>">
|
934 |
-
<input id="cht_social_window_<?php echo esc_attr($social['slug']); ?>" type="checkbox"
|
935 |
-
class="channels__view-check"
|
936 |
-
name="cht_social_<?php echo esc_attr($social['slug']); ?>[new_window]" value="1"
|
937 |
-
<?php checked($isChecked, 1) ?>>
|
938 |
-
<span class="channels__view-txt"> </span>
|
939 |
-
</label>
|
940 |
-
</div>
|
941 |
-
</div>
|
942 |
-
</div>
|
943 |
-
<div class="Linkedin-settings advanced-settings">
|
944 |
-
<?php $isChecked = isset($value['link_type']) ? $value['link_type'] : "personal"; ?>
|
945 |
-
<!-- Advance setting for Custom Link -->
|
946 |
-
<div class="chaty-setting-col">
|
947 |
-
<label>LinkedIn</label>
|
948 |
-
<div>
|
949 |
-
<label>
|
950 |
-
<input type="radio" <?php checked($isChecked, "personal") ?>
|
951 |
-
name="cht_social_<?php echo esc_attr($social['slug']); ?>[link_type]" value="personal">
|
952 |
-
Personal
|
953 |
-
</label>
|
954 |
-
<label>
|
955 |
-
<input type="radio" <?php checked($isChecked, "company") ?>
|
956 |
-
name="cht_social_<?php echo esc_attr($social['slug']); ?>[link_type]" value="company">
|
957 |
-
Company
|
958 |
-
</label>
|
959 |
-
</div>
|
960 |
-
</div>
|
961 |
-
</div>
|
962 |
-
<?php } else { ?>
|
963 |
<div class="Whatsapp-settings advanced-settings">
|
964 |
<?php $preSetMessage = isset($value['pre_set_message']) ? $value['pre_set_message'] : ""; ?>
|
965 |
<div class="chaty-setting-col sm:flex items-start space-y-2 sm:space-y-0 sm:space-x-3">
|
966 |
<label class="font-primary text-cht-gray-150 w-44 mt-2">
|
967 |
Pre Set Message
|
968 |
-
<span class="icon label-tooltip inline-tooltip"
|
969 |
-
data-label="Add your own pre-set message that's automatically added to the user's message. You can also use merge tags and add the URL or the title of the current visitor's page. E.g. you can add the current URL of a product to the message so you know which product the visitor is talking about when the visitor messages you">
|
970 |
<span>
|
971 |
<svg xmlns="http://www.w3.org/2000/svg" class="inline-block" width="20" height="27" viewBox="0 0 20 20" fill="none">
|
972 |
<path d="M8.00004 14.6654C11.6819 14.6654 14.6667 11.6806 14.6667 7.9987C14.6667 4.3168 11.6819 1.33203 8.00004 1.33203C4.31814 1.33203 1.33337 4.3168 1.33337 7.9987C1.33337 11.6806 4.31814 14.6654 8.00004 14.6654Z" stroke="#72777c" stroke-width="1.33" stroke-linecap="round" stroke-linejoin="round"></path>
|
@@ -979,21 +736,13 @@ $isAgent = 0;
|
|
979 |
<div class="pro-features">
|
980 |
<div class="pro-item">
|
981 |
<?php $preSetMessage = isset($value['pre_set_message']) ? $value['pre_set_message'] : ""; ?>
|
982 |
-
<input disabled id="cht_social_message_<?php echo esc_attr($social['slug']); ?>" type="text"
|
983 |
-
name="cht_social_<?php echo esc_attr($social['slug']); ?>[pre_set_message]"
|
984 |
-
value="<?php echo esc_attr($preSetMessage) ?>">
|
985 |
<span class="supported-tags mt-2">
|
986 |
-
<span class="icon label-tooltip support-tooltip"
|
987 |
-
data-label="{title} tag grabs the page title of the webpage">{title}</span> and <span
|
988 |
-
class="icon label-tooltip support-tooltip"
|
989 |
-
data-label="{url} tag grabs the URL of the page">{url}</span> tags are supported
|
990 |
</span>
|
991 |
</div>
|
992 |
<div class="pro-button h-[44px]">
|
993 |
-
<a
|
994 |
-
target="_blank"
|
995 |
-
class="rounded-[6px]"
|
996 |
-
href="<?php echo esc_url($this->getUpgradeMenuItemUrl());?>"><?php esc_html_e('Upgrade to Pro', 'chaty');?></a>
|
997 |
</div>
|
998 |
</div>
|
999 |
</div>
|
@@ -1001,8 +750,7 @@ $isAgent = 0;
|
|
1001 |
<div class="Email-settings advanced-settings">
|
1002 |
<div class="chaty-setting-col sm:flex items-start sm:space-x-3">
|
1003 |
<label class="font-primary text-cht-gray-150 w-44 space-x-2">Mail Subject
|
1004 |
-
<span class="icon label-tooltip inline-tooltip"
|
1005 |
-
data-label="Add your own pre-set message that's automatically added to the user's message. You can also use merge tags and add the URL or the title of the current visitor's page. E.g. you can add the current URL of a product to the message so you know which product the visitor is talking about when the visitor messages you">
|
1006 |
<span>
|
1007 |
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">
|
1008 |
<path d="M8.00004 14.6654C11.6819 14.6654 14.6667 11.6806 14.6667 7.9987C14.6667 4.3168 11.6819 1.33203 8.00004 1.33203C4.31814 1.33203 1.33337 4.3168 1.33337 7.9987C1.33337 11.6806 4.31814 14.6654 8.00004 14.6654Z" stroke="#72777c" stroke-width="1.33" stroke-linecap="round" stroke-linejoin="round">
|
@@ -1016,17 +764,11 @@ $isAgent = 0;
|
|
1016 |
<div>
|
1017 |
<div class="pro-features">
|
1018 |
<div class="pro-item">
|
1019 |
-
<input disabled id="cht_social_message_<?php echo esc_attr($social['slug']); ?>"
|
1020 |
-
|
1021 |
-
<span class="supported-tags mt-2"><span class="icon label-tooltip support-tooltip"
|
1022 |
-
data-label="{title} tag grabs the page title of the webpage">{title}</span> and
|
1023 |
-
<span class="icon label-tooltip support-tooltip"
|
1024 |
-
data-label="{url} tag grabs the URL of the page">{url}</span> tags are
|
1025 |
-
supported</span>
|
1026 |
</div>
|
1027 |
<div class="pro-button">
|
1028 |
-
<a target="_blank"
|
1029 |
-
href="<?php echo esc_url($this->getUpgradeMenuItemUrl());?>"><?php esc_html_e('Upgrade to Pro', 'chaty');?></a>
|
1030 |
</div>
|
1031 |
</div>
|
1032 |
</div>
|
@@ -1036,12 +778,10 @@ $isAgent = 0;
|
|
1036 |
<div class="chaty-setting-col flex items-center space-x-3">
|
1037 |
<label class="font-primary text-cht-gray-150 w-44">Upload QR Code</label>
|
1038 |
<div>
|
1039 |
-
<a target="_blank" class="cht-upload-image-pro" id="upload_qr_code"
|
1040 |
-
href="<?php echo esc_url($this->getUpgradeMenuItemUrl());?>">
|
1041 |
<span class="dashicons dashicons-upload"></span>
|
1042 |
</a>
|
1043 |
-
<a target="_blank" class="text-cht-primary hover:text-cht-primary hover:underline font-primary"
|
1044 |
-
href="<?php echo esc_url($this->getUpgradeMenuItemUrl());?>"><?php esc_html_e('Upgrade to Pro', 'chaty');?></a>
|
1045 |
</div>
|
1046 |
</div>
|
1047 |
</div>
|
@@ -1052,13 +792,9 @@ $isAgent = 0;
|
|
1052 |
<div class="chaty-setting-col flex items-center space-x-3">
|
1053 |
<label class="font-primary text-cht-gray-150 sm:w-44">Open In a New Tab</label>
|
1054 |
<div>
|
1055 |
-
<input type="hidden" name="cht_social_<?php echo esc_attr($social['slug']); ?>[new_window]"
|
1056 |
-
value="0">
|
1057 |
<label class="channels__view" for="cht_social_window_<?php echo esc_attr($social['slug']); ?>">
|
1058 |
-
<input id="cht_social_window_<?php echo esc_attr($social['slug']); ?>" type="checkbox"
|
1059 |
-
class="channels__view-check"
|
1060 |
-
name="cht_social_<?php echo esc_attr($social['slug']); ?>[new_window]" value="1"
|
1061 |
-
<?php checked($isChecked,1) ?>>
|
1062 |
<span class="chaty-slider round"></span>
|
1063 |
</label>
|
1064 |
</div>
|
@@ -1085,23 +821,16 @@ $isAgent = 0;
|
|
1085 |
</div>
|
1086 |
</div>
|
1087 |
</div>
|
1088 |
-
<?php }//end if
|
1089 |
-
?>
|
1090 |
|
1091 |
<?php $useWhatsappWeb = isset($value['use_whatsapp_web']) ? $value['use_whatsapp_web'] : "yes"; ?>
|
1092 |
<div class="Whatsapp-settings advanced-settings">
|
1093 |
<div class="chaty-setting-col sm:flex items-start space-y-2 sm:space-y-0 sm:space-x-3">
|
1094 |
<label class="font-primary text-cht-gray-150 w-44 mt-2">Whatsapp Web</label>
|
1095 |
-
<input type="hidden" name="cht_social_<?php echo esc_attr($social['slug']); ?>[use_whatsapp_web]"
|
1096 |
-
value="no" />
|
1097 |
<div>
|
1098 |
<div class="checkbox">
|
1099 |
-
<label for="cht_social_<?php echo esc_attr($social['slug']); ?>_use_whatsapp_web"
|
1100 |
-
class="
|
1101 |
-
<input class="sr-only" type="checkbox"
|
1102 |
-
id="cht_social_<?php echo esc_attr($social['slug']); ?>_use_whatsapp_web"
|
1103 |
-
name="cht_social_<?php echo esc_attr($social['slug']); ?>[use_whatsapp_web]"
|
1104 |
-
value="yes" <?php echo checked($useWhatsappWeb, "yes") ?> />
|
1105 |
<span></span>
|
1106 |
Use Whatsapp Web directly on desktop
|
1107 |
</label>
|
153 |
<!-- Social media setting box: start -->
|
154 |
<li data-id="<?php echo esc_attr($social['slug']) ?>" class="chaty-channel <?php echo ($isAgent == 1) ? "has-agent-view" : "" ?>" data-channel="<?php echo esc_attr($channelType) ?>" id="chaty-social-<?php echo esc_attr($social['slug']) ?>">
|
155 |
<!-- channel default settings start -->
|
156 |
+
<div class="channels-selected__item <?php echo esc_attr(($status) ? "img-active" : "") ?> free 1 available">
|
157 |
<!-- icon and input field start -->
|
158 |
<div class="chaty-default-settings space-x-3 flex items-center">
|
159 |
<!-- drag icon and channel icon start -->
|
388 |
?>
|
389 |
<!-- setting for desktop -->
|
390 |
<label class="device_view" for="<?php echo esc_attr($slug); ?>Desktop">
|
391 |
+
<input type="checkbox" id="<?php echo esc_attr($slug); ?>Desktop" class="channels__view-check sr-only js-chanel-icon js-chanel-desktop" data-type="<?php echo str_replace(' ', '_', strtolower(esc_attr__($this->del_space($social['slug'])))); ?>" name="cht_social_<?php echo esc_attr($social['slug']); ?>[is_desktop]" value="checked" data-gramm_editor="false" <?php echo esc_attr($isDesktop) ?> />
|
|
|
|
|
|
|
|
|
392 |
<span class="channels__view-txt">
|
393 |
+
<svg width="16" height="12" viewBox="0 0 16 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
394 |
+
<path d="M13.3333 10.0001C14.0667 10.0001 14.6667 9.40008 14.6667 8.66675V2.00008C14.6667 1.26675 14.0667 0.666748 13.3333 0.666748H2.66667C1.93333 0.666748 1.33333 1.26675 1.33333 2.00008V8.66675C1.33333 9.40008 1.93333 10.0001 2.66667 10.0001H0.666667C0.3 10.0001 0 10.3001 0 10.6667C0 11.0334 0.3 11.3334 0.666667 11.3334H15.3333C15.7 11.3334 16 11.0334 16 10.6667C16 10.3001 15.7 10.0001 15.3333 10.0001H13.3333ZM3.33333 2.00008H12.6667C13.0333 2.00008 13.3333 2.30008 13.3333 2.66675V8.00008C13.3333 8.36675 13.0333 8.66675 12.6667 8.66675H3.33333C2.96667 8.66675 2.66667 8.36675 2.66667 8.00008V2.66675C2.66667 2.30008 2.96667 2.00008 3.33333 2.00008Z" />
|
|
|
|
|
395 |
</svg>
|
396 |
</span>
|
397 |
<span class="device-tooltip">
|
402 |
|
403 |
<!-- setting for mobile -->
|
404 |
<label class="device_view" for="<?php echo esc_attr($slug); ?>Mobile">
|
405 |
+
<input type="checkbox" id="<?php echo esc_attr($slug); ?>Mobile" class="channels__view-check sr-only js-chanel-icon js-chanel-mobile" data-type="<?php echo str_replace(' ', '_', strtolower(esc_attr__($this->del_space($social['slug'])))); ?>" name="cht_social_<?php echo esc_attr($social['slug']); ?>[is_mobile]" value="checked" data-gramm_editor="false" <?php echo esc_attr($isMobile) ?>>
|
|
|
|
|
|
|
|
|
406 |
<span class="channels__view-txt">
|
407 |
<svg width="9" height="16" viewBox="0 0 9 16" fill="none"
|
408 |
xmlns="http://www.w3.org/2000/svg">
|
409 |
+
<path d="M7.33301 0.666748H1.99967C1.07967 0.666748 0.333008 1.41341 0.333008 2.33341V13.6667C0.333008 14.5867 1.07967 15.3334 1.99967 15.3334H7.33301C8.25301 15.3334 8.99967 14.5867 8.99967 13.6667V2.33341C8.99967 1.41341 8.25301 0.666748 7.33301 0.666748ZM4.66634 14.6667C4.11301 14.6667 3.66634 14.2201 3.66634 13.6667C3.66634 13.1134 4.11301 12.6667 4.66634 12.6667C5.21967 12.6667 5.66634 13.1134 5.66634 13.6667C5.66634 14.2201 5.21967 14.6667 4.66634 14.6667ZM7.66634 12.0001H1.66634V2.66675H7.66634V12.0001Z" />
|
|
|
410 |
</svg>
|
411 |
</span>
|
412 |
<span class="device-tooltip">
|
413 |
+
<span class="on"><?php esc_html_e("Hide on mobile", "chaty") ?></span>
|
414 |
+
<span class="off"><?php esc_html_e("Show on mobile", "chaty") ?></span>
|
415 |
</span>
|
416 |
</label>
|
417 |
</div>
|
421 |
<div class="channels__agent-box relative">
|
422 |
<a href="#" class="add-agent-btn space-x-1 pro-button-wrap">
|
423 |
<svg width="14" height="12" viewBox="0 0 14 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
424 |
+
<path d="M5.25 5.14286C6.69975 5.14286 7.875 3.99159 7.875 2.57143C7.875 1.15127 6.69975 0 5.25 0C3.80025 0 2.625 1.15127 2.625 2.57143C2.625 3.99159 3.80025 5.14286 5.25 5.14286Z" fill="currentColor" />
|
425 |
+
<path d="M5.25 6.85714C8.1495 6.85714 10.5 9.15968 10.5 12H0C0 9.15968 2.35051 6.85714 5.25 6.85714Z" fill="currentColor" />
|
426 |
+
<path d="M12.25 3.42857C12.25 2.95518 11.8582 2.57143 11.375 2.57143C10.8918 2.57143 10.5 2.95518 10.5 3.42857V4.28571H9.625C9.14175 4.28571 8.75 4.66947 8.75 5.14286C8.75 5.61624 9.14175 6 9.625 6H10.5V6.85714C10.5 7.33053 10.8918 7.71429 11.375 7.71429C11.8582 7.71429 12.25 7.33053 12.25 6.85714V6H13.125C13.6082 6 14 5.61624 14 5.14286C14 4.66947 13.6082 4.28571 13.125 4.28571H12.25V3.42857Z" fill="currentColor" />
|
|
|
|
|
|
|
|
|
|
|
|
|
427 |
</svg>
|
428 |
<span><?php esc_html_e("Add Agents", "chaty"); ?></span>
|
429 |
<div class="pro-button">
|
437 |
<div class="channels__agent-box transparent relative hidden">
|
438 |
<a href="#" class="add-agent-btn pro-button-wrap">
|
439 |
<svg width="14" height="12" viewBox="0 0 14 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
440 |
+
<path d="M5.25 5.14286C6.69975 5.14286 7.875 3.99159 7.875 2.57143C7.875 1.15127 6.69975 0 5.25 0C3.80025 0 2.625 1.15127 2.625 2.57143C2.625 3.99159 3.80025 5.14286 5.25 5.14286Z" fill="white" />
|
441 |
+
<path d="M5.25 6.85714C8.1495 6.85714 10.5 9.15968 10.5 12H0C0 9.15968 2.35051 6.85714 5.25 6.85714Z" fill="white" />
|
442 |
+
<path d="M12.25 3.42857C12.25 2.95518 11.8582 2.57143 11.375 2.57143C10.8918 2.57143 10.5 2.95518 10.5 3.42857V4.28571H9.625C9.14175 4.28571 8.75 4.66947 8.75 5.14286C8.75 5.61624 9.14175 6 9.625 6H10.5V6.85714C10.5 7.33053 10.8918 7.71429 11.375 7.71429C11.8582 7.71429 12.25 7.33053 12.25 6.85714V6H13.125C13.6082 6 14 5.61624 14 5.14286C14 4.66947 13.6082 4.28571 13.125 4.28571H12.25V3.42857Z" fill="white" />
|
|
|
|
|
|
|
|
|
|
|
|
|
443 |
</svg>
|
444 |
<span><?php esc_html_e("Add Agents", "chaty"); ?></span>
|
445 |
<div class="pro-button">
|
463 |
?>
|
464 |
|
465 |
<!-- settings button -->
|
466 |
+
<div class="chaty-settings <?php echo esc_attr($closeClass) ?>" data-nonce="<?php echo wp_create_nonce($social['slug']."-settings") ?>" id="<?php echo esc_attr($social['slug']); ?>-close-btn" onclick="toggle_chaty_setting('<?php echo esc_attr($social['slug']); ?>')">
|
|
|
|
|
|
|
467 |
<a class="flex items-center space-x-1.5" href="javascript:;">
|
468 |
<span>
|
469 |
<svg width="16" height="16" viewBox="0 0 16 16" fill="none">
|
471 |
<path d="M12.9332 9.99984C12.8444 10.2009 12.818 10.424 12.8572 10.6402C12.8964 10.8565 12.9995 11.056 13.1532 11.2132L13.1932 11.2532C13.3171 11.377 13.4155 11.5241 13.4826 11.6859C13.5497 11.8478 13.5842 12.0213 13.5842 12.1965C13.5842 12.3717 13.5497 12.5452 13.4826 12.7071C13.4155 12.869 13.3171 13.016 13.1932 13.1398C13.0693 13.2638 12.9223 13.3621 12.7604 13.4292C12.5986 13.4963 12.4251 13.5309 12.2498 13.5309C12.0746 13.5309 11.9011 13.4963 11.7392 13.4292C11.5774 13.3621 11.4303 13.2638 11.3065 13.1398L11.2665 13.0998C11.1094 12.9461 10.9098 12.843 10.6936 12.8038C10.4773 12.7646 10.2542 12.7911 10.0532 12.8798C9.85599 12.9643 9.68782 13.1047 9.56937 13.2835C9.45092 13.4624 9.38736 13.672 9.3865 13.8865V13.9998C9.3865 14.3535 9.24603 14.6926 8.99598 14.9426C8.74593 15.1927 8.40679 15.3332 8.05317 15.3332C7.69955 15.3332 7.36041 15.1927 7.11036 14.9426C6.86031 14.6926 6.71984 14.3535 6.71984 13.9998V13.9398C6.71467 13.7192 6.64325 13.5052 6.51484 13.3256C6.38644 13.1461 6.20699 13.0094 5.99984 12.9332C5.79876 12.8444 5.57571 12.818 5.35944 12.8572C5.14318 12.8964 4.94362 12.9995 4.7865 13.1532L4.7465 13.1932C4.62267 13.3171 4.47562 13.4155 4.31376 13.4826C4.15189 13.5497 3.97839 13.5842 3.80317 13.5842C3.62795 13.5842 3.45445 13.5497 3.29258 13.4826C3.13072 13.4155 2.98367 13.3171 2.85984 13.1932C2.73587 13.0693 2.63752 12.9223 2.57042 12.7604C2.50332 12.5986 2.46879 12.4251 2.46879 12.2498C2.46879 12.0746 2.50332 11.9011 2.57042 11.7392C2.63752 11.5774 2.73587 11.4303 2.85984 11.3065L2.89984 11.2665C3.05353 11.1094 3.15663 10.9098 3.19584 10.6936C3.23505 10.4773 3.20858 10.2542 3.11984 10.0532C3.03533 9.85599 2.89501 9.68782 2.71615 9.56937C2.53729 9.45092 2.32769 9.38736 2.11317 9.3865H1.99984C1.64622 9.3865 1.30708 9.24603 1.05703 8.99598C0.80698 8.74593 0.666504 8.40679 0.666504 8.05317C0.666504 7.69955 0.80698 7.36041 1.05703 7.11036C1.30708 6.86031 1.64622 6.71984 1.99984 6.71984H2.05984C2.2805 6.71467 2.49451 6.64325 2.67404 6.51484C2.85357 6.38644 2.99031 6.20699 3.0665 5.99984C3.15525 5.79876 3.18172 5.57571 3.14251 5.35944C3.10329 5.14318 3.00019 4.94362 2.8465 4.7865L2.8065 4.7465C2.68254 4.62267 2.58419 4.47562 2.51709 4.31376C2.44999 4.15189 2.41545 3.97839 2.41545 3.80317C2.41545 3.62795 2.44999 3.45445 2.51709 3.29258C2.58419 3.13072 2.68254 2.98367 2.8065 2.85984C2.93033 2.73587 3.07739 2.63752 3.23925 2.57042C3.40111 2.50332 3.57462 2.46879 3.74984 2.46879C3.92506 2.46879 4.09856 2.50332 4.26042 2.57042C4.42229 2.63752 4.56934 2.73587 4.69317 2.85984L4.73317 2.89984C4.89029 3.05353 5.08985 3.15663 5.30611 3.19584C5.52237 3.23505 5.74543 3.20858 5.9465 3.11984H5.99984C6.19702 3.03533 6.36518 2.89501 6.48363 2.71615C6.60208 2.53729 6.66565 2.32769 6.6665 2.11317V1.99984C6.6665 1.64622 6.80698 1.30708 7.05703 1.05703C7.30708 0.80698 7.64621 0.666504 7.99984 0.666504C8.35346 0.666504 8.6926 0.80698 8.94264 1.05703C9.19269 1.30708 9.33317 1.64622 9.33317 1.99984V2.05984C9.33402 2.27436 9.39759 2.48395 9.51604 2.66281C9.63449 2.84167 9.80266 2.98199 9.99984 3.0665C10.2009 3.15525 10.424 3.18172 10.6402 3.14251C10.8565 3.10329 11.056 3.00019 11.2132 2.8465L11.2532 2.8065C11.377 2.68254 11.5241 2.58419 11.6859 2.51709C11.8478 2.44999 12.0213 2.41545 12.1965 2.41545C12.3717 2.41545 12.5452 2.44999 12.7071 2.51709C12.869 2.58419 13.016 2.68254 13.1398 2.8065C13.2638 2.93033 13.3621 3.07739 13.4292 3.23925C13.4963 3.40111 13.5309 3.57462 13.5309 3.74984C13.5309 3.92506 13.4963 4.09856 13.4292 4.26042C13.3621 4.42229 13.2638 4.56934 13.1398 4.69317L13.0998 4.73317C12.9461 4.89029 12.843 5.08985 12.8038 5.30611C12.7646 5.52237 12.7911 5.74543 12.8798 5.9465V5.99984C12.9643 6.19702 13.1047 6.36518 13.2835 6.48363C13.4624 6.60208 13.672 6.66565 13.8865 6.6665H13.9998C14.3535 6.6665 14.6926 6.80698 14.9426 7.05703C15.1927 7.30708 15.3332 7.64621 15.3332 7.99984C15.3332 8.35346 15.1927 8.6926 14.9426 8.94264C14.6926 9.19269 14.3535 9.33317 13.9998 9.33317H13.9398C13.7253 9.33402 13.5157 9.39759 13.3369 9.51604C13.158 9.63449 13.0177 9.80266 12.9332 9.99984V9.99984Z" stroke="currentColor" stroke-width="1.33" stroke-linecap="round" stroke-linejoin="round"/>
|
472 |
</svg>
|
473 |
</span>
|
474 |
+
<span><?php esc_html_e("Settings", "chaty") ?></span>
|
475 |
</a>
|
476 |
</div>
|
477 |
</div>
|
479 |
|
480 |
|
481 |
<!-- advance setting fields: start -->
|
482 |
+
<?php $className = "not-is-pro"; ?>
|
483 |
+
<div class="chaty-advance-settings mt-5 space-y-4 <?php echo esc_attr($className); ?>" style="<?php echo (empty($closeClass) && $social['slug'] == 'Contact_Us') ? "display:block" : ""; ?>">
|
|
|
484 |
<!-- Settings for custom icon and color -->
|
485 |
<div class="chaty-setting-col sm:flex items-center space-y-2 sm:space-y-0 sm:space-x-3">
|
486 |
+
<label class="font-primary text-cht-gray-150 w-44"><?php esc_html_e("Icon Appearance", "chaty") ?></label>
|
487 |
<div class="flex items-center">
|
488 |
<!-- input for custom color -->
|
489 |
+
<input type="text" name="cht_social_<?php echo esc_attr($social['slug']); ?>[bg_color]" class="chaty-color-field chaty-bg-color" value="<?php echo esc_attr($value['bg_color']) ?>" />
|
|
|
490 |
|
491 |
<!-- button to upload custom image -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
492 |
<div class="pro-features upload-image mx-2">
|
493 |
<div class="pro-item">
|
494 |
+
<a target="_blank" href="<?php echo esc_url($this->getUpgradeMenuItemUrl());?>" class="upload-chaty-icon"><span class="dashicons dashicons-upload"></span> <?php esc_html_e("Custom Image", "chaty") ?></a>
|
|
|
|
|
495 |
</div>
|
496 |
<div class="pro-button">
|
497 |
+
<a target="_blank" href="<?php echo esc_url($this->getUpgradeMenuItemUrl());?>"><?php esc_html_e('Upgrade to Pro', 'chaty');?></a>
|
|
|
498 |
</div>
|
499 |
</div>
|
500 |
|
501 |
<div class="pro-features upload-image">
|
502 |
<div class="pro-item">
|
503 |
+
<a target="_blank" href="<?php echo esc_url($this->getUpgradeMenuItemUrl());?>" class="upload-chaty-icon"><?php esc_html_e("Change Icon", "chaty") ?></a>
|
|
|
504 |
</div>
|
505 |
<div class="pro-button">
|
506 |
+
<a target="_blank" href="<?php echo esc_url($this->getUpgradeMenuItemUrl());?>"><?php esc_html_e('Upgrade to Pro', 'chaty');?></a>
|
|
|
507 |
</div>
|
508 |
</div>
|
|
|
|
|
509 |
</div>
|
510 |
</div>
|
511 |
|
520 |
$socials = $this->socials;
|
521 |
?>
|
522 |
<div class="chaty-setting-col space-y-2 sm:space-y-0 sm:flex sm:items-center sm:space-x-3">
|
523 |
+
<label class="font-primary text-cht-gray-150 w-44"><?php esc_html_e("Channel type", "chaty") ?></label>
|
524 |
<div>
|
525 |
<!-- input for custom title -->
|
526 |
+
<select class="channel-select-input" name="cht_social_<?php echo esc_attr($social['slug']); ?>[channel_type]" value="<?php echo esc_attr($channelValue) ?>">
|
527 |
+
<option value="<?php echo esc_attr($social['slug']) ?>"><?php esc_html_e("Custom channel", "chaty") ?></option>
|
|
|
|
|
528 |
<?php foreach ($socials as $socialIcon) {
|
529 |
$selected = ($socialIcon['slug'] == $channelType) ? "selected" : "";
|
530 |
if ($socialIcon['slug'] != 'Custom_Link' && $socialIcon['slug'] != 'Custom_Link_3' && $socialIcon['slug'] != 'Custom_Link_4' && $socialIcon['slug'] != 'Custom_Link_5' && $socialIcon['slug'] != 'Contact_Us' && $socialIcon['slug'] != 'Link') { ?>
|
531 |
+
<option <?php echo esc_attr($selected) ?> value="<?php echo esc_attr($socialIcon['slug']) ?>"><?php echo esc_attr($socialIcon['title']) ?></option>
|
|
|
532 |
<?php }
|
533 |
}?>
|
534 |
</select>
|
535 |
</div>
|
536 |
</div>
|
537 |
+
<?php
|
538 |
+
}//end if
|
539 |
+
?>
|
540 |
|
541 |
<div class="chaty-setting-col sm:flex sm:items-center space-y-2 sm:space-y-0 sm:space-x-3">
|
542 |
+
<label class="font-primary text-cht-gray-150 w-44"><?php esc_html_e("On Hover Text", "chaty") ?></label>
|
543 |
<div>
|
544 |
+
<input type="text" class="chaty-title" name="cht_social_<?php echo esc_attr($social['slug']); ?>[title]" value="<?php echo esc_attr($value['title']) ?>">
|
|
|
|
|
545 |
</div>
|
546 |
</div>
|
547 |
|
548 |
<div class="Contact_Us-settings advanced-settings">
|
549 |
<div class="chaty-setting-col sm:flex sm:items-center space-y-2 sm:space-y-0 sm:space-x-3">
|
550 |
+
<label class="font-primary text-cht-gray-150 w-44"><?php esc_html_e("Contact Form Title", "chaty") ?></label>
|
551 |
<div>
|
552 |
<?php $contactFormTitle = isset($value['contact_form_title']) ? $value['contact_form_title'] : esc_html__("Contact Us", "chaty"); ?>
|
553 |
+
<input id="cht_social_message_<?php echo esc_attr($social['slug']); ?>_form_title" type="text" name="cht_social_<?php echo esc_attr($social['slug']); ?>[contact_form_title]" value="<?php echo esc_attr($contactFormTitle) ?>">
|
|
|
|
|
554 |
</div>
|
555 |
</div>
|
556 |
|
559 |
|
560 |
<?php $fieldValue = isset($value['button_text_color']) ? $value['button_text_color'] : "#ffffff" ?>
|
561 |
<div class="chaty-setting-col flex items-center space-x-3">
|
562 |
+
<label class="font-primary text-cht-gray-150 w-44" for="button_text_color_for_<?php echo esc_attr($social['slug']); ?>"><?php esc_html_e("Text color", "chaty") ?></label>
|
|
|
563 |
<div>
|
564 |
+
<input id="button_text_color_for_<?php echo esc_attr($social['slug']); ?>" class="chaty-color-field button-color" type="text" name="cht_social_<?php echo esc_attr($social['slug']); ?>[button_text_color]" value="<?php echo esc_attr($fieldValue); ?>">
|
|
|
|
|
|
|
565 |
</div>
|
566 |
</div>
|
567 |
|
568 |
<?php $fieldValue = isset($value['button_bg_color']) ? $value['button_bg_color'] : "#A886CD" ?>
|
569 |
<div class="chaty-setting-col flex items-center space-x-3">
|
570 |
+
<label class="font-primary text-cht-gray-150 w-44" for="button_bg_color_for_<?php echo esc_attr($social['slug']); ?>"><?php esc_html_e("Background color", "chaty") ?></label>
|
|
|
571 |
<div>
|
572 |
+
<input id="button_bg_color_for_<?php echo esc_attr($social['slug']); ?>" class="chaty-color-field button-color" type="text" name="cht_social_<?php echo esc_attr($social['slug']); ?>[button_bg_color]" value="<?php echo esc_attr($fieldValue); ?>">
|
|
|
|
|
|
|
573 |
</div>
|
574 |
</div>
|
575 |
|
576 |
<?php $fieldValue = isset($value['button_text']) ? $value['button_text'] : "Chat" ?>
|
577 |
<div class="chaty-setting-col sm:flex sm:items-center sm:space-x-3">
|
578 |
+
<label class="font-primary text-cht-gray-150 w-44" for="button_text_for_<?php echo esc_attr($social['slug']); ?>"><?php esc_html_e("Button text", "chaty") ?></label>
|
579 |
<div>
|
580 |
+
<input id="button_text_for_<?php echo esc_attr($social['slug']); ?>" type="text" name="cht_social_<?php echo esc_attr($social['slug']); ?>[button_text]" value="<?php echo esc_attr($fieldValue); ?>">
|
|
|
|
|
581 |
</div>
|
582 |
</div>
|
583 |
<?php $fieldValue = isset($value['thanks_message']) ? $value['thanks_message'] : "Your message was sent successfully" ?>
|
584 |
<div class="chaty-setting-col sm:flex sm:items-center sm:space-x-3">
|
585 |
+
<label class="font-primary text-cht-gray-150 w-44" for="thanks_message_for_<?php echo esc_attr($social['slug']); ?>"><?php esc_html_e("Thank you message", "chaty") ?></label>
|
|
|
586 |
<div>
|
587 |
+
<input id="thanks_message_for_<?php echo esc_attr($social['slug']); ?>" type="text" name="cht_social_<?php echo esc_attr($social['slug']); ?>[thanks_message]" value="<?php echo esc_attr($fieldValue); ?>">
|
|
|
|
|
588 |
</div>
|
589 |
</div>
|
590 |
|
591 |
<?php $fieldValue = isset($value['redirect_action']) ? $value['redirect_action'] : "no" ?>
|
592 |
<div class="chaty-setting-col">
|
593 |
+
<input type="hidden" name="cht_social_<?php echo esc_attr($social['slug']); ?>[redirect_action]" value="no">
|
594 |
+
<label class="chaty-switch flex items-center font-primary text-cht-gray-150" for="redirect_action_<?php echo esc_attr($social['slug']); ?>">
|
595 |
+
<input type="checkbox" class="chaty-redirect-setting" name="cht_social_<?php echo esc_attr($social['slug']); ?>[redirect_action]" id="redirect_action_<?php echo esc_attr($social['slug']); ?>" value="yes" <?php checked($fieldValue, "yes") ?>>
|
|
|
|
|
|
|
|
|
|
|
596 |
<div class="chaty-slider round"></div>
|
597 |
+
<?php esc_html_e("Redirect visitors after submission", "chaty") ?>
|
598 |
</label>
|
599 |
</div>
|
600 |
<div class="redirect_action-settings <?php echo ($fieldValue == "yes") ? "active" : "" ?>">
|
601 |
<?php $fieldValue = isset($value['redirect_link']) ? $value['redirect_link'] : "" ?>
|
602 |
<div class="chaty-setting-col sm:flex sm:items-center sm:space-x-3 my-2">
|
603 |
+
<label class="font-primary text-cht-gray-150 w-44" for="redirect_link_for_<?php echo esc_attr($social['slug']); ?>"><?php esc_html_e("Redirect link", "chaty") ?></label>
|
|
|
604 |
<div>
|
605 |
+
<input id="redirect_link_for_<?php echo esc_attr($social['slug']); ?>" placeholder="<?php echo site_url("/") ?>" type="text" name="cht_social_<?php echo esc_attr($social['slug']); ?>[redirect_link]" value="<?php echo esc_attr($fieldValue); ?>">
|
|
|
|
|
|
|
606 |
</div>
|
607 |
</div>
|
608 |
<?php $fieldValue = isset($value['link_in_new_tab']) ? $value['link_in_new_tab'] : "no" ?>
|
609 |
<div class="chaty-setting-col sm:flex sm:items-center">
|
610 |
+
<input type="hidden" name="cht_social_<?php echo esc_attr($social['slug']); ?>[link_in_new_tab]" value="no">
|
611 |
+
<label class="chaty-switch font-primary text-cht-gray-150" for="link_in_new_tab_<?php echo esc_attr($social['slug']); ?>">
|
612 |
+
<input type="checkbox" class="chaty-field-setting" name="cht_social_<?php echo esc_attr($social['slug']); ?>[link_in_new_tab]" id="link_in_new_tab_<?php echo esc_attr($social['slug']); ?>" value="yes" <?php checked($fieldValue, "yes") ?>>
|
|
|
|
|
|
|
|
|
|
|
613 |
<div class="chaty-slider round"></div>
|
614 |
+
<?php esc_html_e("Open in a new tab", "chaty") ?>
|
615 |
</label>
|
616 |
</div>
|
617 |
</div>
|
618 |
|
619 |
<?php $fieldValue = isset($value['close_form_after']) ? $value['close_form_after'] : "no" ?>
|
620 |
<div class="chaty-setting-col">
|
621 |
+
<input type="hidden" name="cht_social_<?php echo esc_attr($social['slug']); ?>[close_form_after]" value="no">
|
622 |
+
<label class="chaty-switch flex items-center font-primary text-cht-gray-150" for="close_form_after_<?php echo esc_attr($social['slug']); ?>">
|
623 |
+
<input type="checkbox" class="chaty-close_form_after-setting" name="cht_social_<?php echo esc_attr($social['slug']); ?>[close_form_after]" id="close_form_after_<?php echo esc_attr($social['slug']); ?>" value="yes" <?php checked($fieldValue, "yes") ?>>
|
|
|
|
|
|
|
|
|
|
|
624 |
<div class="chaty-slider round"></div>
|
625 |
+
<?php esc_html_e("Close form automatically after submission", "chaty") ?>
|
626 |
+
<span class="icon label-tooltip inline-message hidden sm:inline-block" data-label="<?php esc_html_e("Close the form automatically after a few seconds based on your choice", "chaty") ?>">
|
|
|
627 |
<span>
|
628 |
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">
|
629 |
<path d="M8.00004 14.6654C11.6819 14.6654 14.6667 11.6806 14.6667 7.9987C14.6667 4.3168 11.6819 1.33203 8.00004 1.33203C4.31814 1.33203 1.33337 4.3168 1.33337 7.9987C1.33337 11.6806 4.31814 14.6654 8.00004 14.6654Z" stroke="#72777c" stroke-width="1.33" stroke-linecap="round" stroke-linejoin="round"></path>
|
637 |
<div class="close_form_after-settings <?php echo ($fieldValue == "yes") ? "active" : "" ?>">
|
638 |
<?php $fieldValue = isset($value['close_form_after_seconds']) ? $value['close_form_after_seconds'] : "3" ?>
|
639 |
<div class="chaty-setting-col sm:flex sm:items-center sm:space-x-3">
|
640 |
+
<label class="font-primary text-cht-gray-150 w-44" for="close_form_after_seconds_<?php echo esc_attr($social['slug']); ?>"><?php esc_html_e("Close after(Seconds)", "chaty") ?></label>
|
|
|
641 |
<div>
|
642 |
+
<input id="close_form_after_seconds_<?php echo esc_attr($social['slug']); ?>" type="number" min="0" name="cht_social_<?php echo esc_attr($social['slug']); ?>[close_form_after_seconds]" value="<?php echo esc_attr($fieldValue); ?>">
|
|
|
|
|
|
|
|
|
643 |
</div>
|
644 |
</div>
|
645 |
</div>
|
646 |
</div>
|
647 |
<div class="form-field-setting-col my-3 space-y-4">
|
648 |
+
<input type="hidden" value="no"name="cht_social_<?php echo esc_attr($social['slug']); ?>[send_leads_in_email]">
|
649 |
+
<input type="hidden" value="yes" name="cht_social_<?php echo esc_attr($social['slug']); ?>[save_leads_locally]">
|
|
|
|
|
650 |
<?php $fieldValue = isset($val['save_leads_locally']) ? $val['save_leads_locally'] : "yes" ?>
|
651 |
<div class="chaty-setting-col">
|
652 |
<label class="text-cht-gray-150 font-primary full-width chaty-switch" for="save_leads_locally_<?php echo esc_attr($social['slug']); ?>">
|
653 |
+
<input type="checkbox" disabled id="save_leads_locally_<?php echo esc_attr($social['slug']); ?>" value="yes" name="cht_social_<?php echo esc_attr($social['slug']); ?>[save_leads_locally]" <?php checked($fieldValue, "yes") ?>>
|
|
|
|
|
|
|
654 |
<div class="chaty-slider round"></div>
|
655 |
+
Save leads to <a href="<?php echo admin_url("admin.php?page=chaty-contact-form-feed") ?>" target="_blank">this site</a>
|
|
|
656 |
<div class="html-tooltip hidden sm:inline-block top no-position">
|
657 |
<span>
|
658 |
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">
|
661 |
<path d="M8 5.33203H8.00667" stroke="#72777c" stroke-width="1.33" stroke-linecap="round" stroke-linejoin="round"></path>
|
662 |
</svg>
|
663 |
</span>
|
664 |
+
<span class="tooltip-text top">Your leads will be saved in your local database, you'll be able to find them <a target="_blank"href="<?php echo admin_url("admin.php?page=chaty-contact-form-feed") ?>">here</a></span>
|
|
|
|
|
665 |
</div>
|
666 |
</label>
|
667 |
</div>
|
668 |
<?php $fieldValue = isset($value['send_leads_in_email']) ? $value['send_leads_in_email'] : "no" ?>
|
669 |
<div class="chaty-setting-col">
|
670 |
+
<label class="flex items-center group flex-wrap gap-2 text-cht-gray-150 text-base" for="save_leads_to_email_<?php echo esc_attr($social['slug']); ?>" class="email-setting full-width font-primary text-cht-gray-150">
|
|
|
671 |
<div class="chaty-switch">
|
672 |
+
<input class="email-setting-field" disabled type="checkbox" id="save_leads_to_email_<?php echo esc_attr($social['slug']); ?>" value="yes" name="cht_social_<?php echo esc_attr($social['slug']); ?>[send_leads_in_email]">
|
|
|
|
|
673 |
<div class="chaty-slider round"></div>
|
674 |
<?php esc_html_e('Send leads to your email', 'chaty') ?>
|
675 |
</div>
|
694 |
<label for="email_for_<?php echo esc_attr($social['slug']); ?>">Email address</label>
|
695 |
<div>
|
696 |
<?php $fieldValue = isset($value['email_address']) ? $value['email_address'] : "" ?>
|
697 |
+
<input id="email_for_<?php echo esc_attr($social['slug']); ?>" type="text" name="cht_social_<?php echo esc_attr($social['slug']); ?>[email_address]" value="<?php echo esc_attr($fieldValue); ?>">
|
|
|
|
|
698 |
</div>
|
699 |
</div>
|
700 |
<div class="chaty-setting-col">
|
701 |
<label for="sender_name_for_<?php echo esc_attr($social['slug']); ?>">Sender's name</label>
|
702 |
<div>
|
703 |
<?php $fieldValue = isset($value['sender_name']) ? $value['sender_name'] : "" ?>
|
704 |
+
<input id="sender_name_for_<?php echo esc_attr($social['slug']); ?>" type="text" name="cht_social_<?php echo esc_attr($social['slug']); ?>[sender_name]" value="<?php echo esc_attr($fieldValue); ?>">
|
|
|
|
|
705 |
</div>
|
706 |
</div>
|
707 |
<div class="chaty-setting-col">
|
708 |
+
<label for="email_subject_for_<?php echo esc_attr($social['slug']); ?>">Email subject</label>
|
|
|
709 |
<div>
|
710 |
<?php $fieldValue = isset($value['email_subject']) ? $value['email_subject'] : "New lead from Chaty - {name} - {date} {hour}" ?>
|
711 |
+
<input id="email_subject_for_<?php echo esc_attr($social['slug']); ?>" type="text" name="cht_social_<?php echo esc_attr($social['slug']); ?>[email_subject]" value="<?php echo esc_attr($fieldValue); ?>">
|
|
|
|
|
712 |
<div class="mail-merge-tags">
|
713 |
<span>{name}</span><span>{phone}</span><span>{email}</span><span>{date}</span><span>{hour}</span>
|
714 |
</div>
|
718 |
</div>
|
719 |
</div>
|
720 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
721 |
<div class="Whatsapp-settings advanced-settings">
|
722 |
<?php $preSetMessage = isset($value['pre_set_message']) ? $value['pre_set_message'] : ""; ?>
|
723 |
<div class="chaty-setting-col sm:flex items-start space-y-2 sm:space-y-0 sm:space-x-3">
|
724 |
<label class="font-primary text-cht-gray-150 w-44 mt-2">
|
725 |
Pre Set Message
|
726 |
+
<span class="icon label-tooltip inline-tooltip"data-label="Add your own pre-set message that's automatically added to the user's message. You can also use merge tags and add the URL or the title of the current visitor's page. E.g. you can add the current URL of a product to the message so you know which product the visitor is talking about when the visitor messages you">
|
|
|
727 |
<span>
|
728 |
<svg xmlns="http://www.w3.org/2000/svg" class="inline-block" width="20" height="27" viewBox="0 0 20 20" fill="none">
|
729 |
<path d="M8.00004 14.6654C11.6819 14.6654 14.6667 11.6806 14.6667 7.9987C14.6667 4.3168 11.6819 1.33203 8.00004 1.33203C4.31814 1.33203 1.33337 4.3168 1.33337 7.9987C1.33337 11.6806 4.31814 14.6654 8.00004 14.6654Z" stroke="#72777c" stroke-width="1.33" stroke-linecap="round" stroke-linejoin="round"></path>
|
736 |
<div class="pro-features">
|
737 |
<div class="pro-item">
|
738 |
<?php $preSetMessage = isset($value['pre_set_message']) ? $value['pre_set_message'] : ""; ?>
|
739 |
+
<input disabled id="cht_social_message_<?php echo esc_attr($social['slug']); ?>" type="text" name="cht_social_<?php echo esc_attr($social['slug']); ?>[pre_set_message]" value="<?php echo esc_attr($preSetMessage) ?>">
|
|
|
|
|
740 |
<span class="supported-tags mt-2">
|
741 |
+
<span class="icon label-tooltip support-tooltip" data-label="{title} tag grabs the page title of the webpage">{title}</span> and <span class="icon label-tooltip support-tooltip" data-label="{url} tag grabs the URL of the page">{url}</span> tags are supported
|
|
|
|
|
|
|
742 |
</span>
|
743 |
</div>
|
744 |
<div class="pro-button h-[44px]">
|
745 |
+
<a target="_blank" class="rounded-[6px]" href="<?php echo esc_url($this->getUpgradeMenuItemUrl());?>"><?php esc_html_e('Upgrade to Pro', 'chaty');?></a>
|
|
|
|
|
|
|
746 |
</div>
|
747 |
</div>
|
748 |
</div>
|
750 |
<div class="Email-settings advanced-settings">
|
751 |
<div class="chaty-setting-col sm:flex items-start sm:space-x-3">
|
752 |
<label class="font-primary text-cht-gray-150 w-44 space-x-2">Mail Subject
|
753 |
+
<span class="icon label-tooltip inline-tooltip" data-label="Add your own pre-set message that's automatically added to the user's message. You can also use merge tags and add the URL or the title of the current visitor's page. E.g. you can add the current URL of a product to the message so you know which product the visitor is talking about when the visitor messages you">
|
|
|
754 |
<span>
|
755 |
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">
|
756 |
<path d="M8.00004 14.6654C11.6819 14.6654 14.6667 11.6806 14.6667 7.9987C14.6667 4.3168 11.6819 1.33203 8.00004 1.33203C4.31814 1.33203 1.33337 4.3168 1.33337 7.9987C1.33337 11.6806 4.31814 14.6654 8.00004 14.6654Z" stroke="#72777c" stroke-width="1.33" stroke-linecap="round" stroke-linejoin="round">
|
764 |
<div>
|
765 |
<div class="pro-features">
|
766 |
<div class="pro-item">
|
767 |
+
<input disabled id="cht_social_message_<?php echo esc_attr($social['slug']); ?>" type="text" name="" value="">
|
768 |
+
<span class="supported-tags mt-2"><span class="icon label-tooltip support-tooltip" data-label="{title} tag grabs the page title of the webpage">{title}</span> and <span class="icon label-tooltip support-tooltip" data-label="{url} tag grabs the URL of the page">{url}</span> tags aresupported</span>
|
|
|
|
|
|
|
|
|
|
|
769 |
</div>
|
770 |
<div class="pro-button">
|
771 |
+
<a target="_blank" href="<?php echo esc_url($this->getUpgradeMenuItemUrl());?>"><?php esc_html_e('Upgrade to Pro', 'chaty');?></a>
|
|
|
772 |
</div>
|
773 |
</div>
|
774 |
</div>
|
778 |
<div class="chaty-setting-col flex items-center space-x-3">
|
779 |
<label class="font-primary text-cht-gray-150 w-44">Upload QR Code</label>
|
780 |
<div>
|
781 |
+
<a target="_blank" class="cht-upload-image-pro" id="upload_qr_code" href="<?php echo esc_url($this->getUpgradeMenuItemUrl());?>">
|
|
|
782 |
<span class="dashicons dashicons-upload"></span>
|
783 |
</a>
|
784 |
+
<a target="_blank" class="text-cht-primary hover:text-cht-primary hover:underline font-primary" href="<?php echo esc_url($this->getUpgradeMenuItemUrl());?>"><?php esc_html_e('Upgrade to Pro', 'chaty');?></a>
|
|
|
785 |
</div>
|
786 |
</div>
|
787 |
</div>
|
792 |
<div class="chaty-setting-col flex items-center space-x-3">
|
793 |
<label class="font-primary text-cht-gray-150 sm:w-44">Open In a New Tab</label>
|
794 |
<div>
|
795 |
+
<input type="hidden" name="cht_social_<?php echo esc_attr($social['slug']); ?>[new_window]" value="0">
|
|
|
796 |
<label class="channels__view" for="cht_social_window_<?php echo esc_attr($social['slug']); ?>">
|
797 |
+
<input id="cht_social_window_<?php echo esc_attr($social['slug']); ?>" type="checkbox" class="channels__view-check" name="cht_social_<?php echo esc_attr($social['slug']); ?>[new_window]" value="1" <?php checked($isChecked,1) ?>>
|
|
|
|
|
|
|
798 |
<span class="chaty-slider round"></span>
|
799 |
</label>
|
800 |
</div>
|
821 |
</div>
|
822 |
</div>
|
823 |
</div>
|
|
|
|
|
824 |
|
825 |
<?php $useWhatsappWeb = isset($value['use_whatsapp_web']) ? $value['use_whatsapp_web'] : "yes"; ?>
|
826 |
<div class="Whatsapp-settings advanced-settings">
|
827 |
<div class="chaty-setting-col sm:flex items-start space-y-2 sm:space-y-0 sm:space-x-3">
|
828 |
<label class="font-primary text-cht-gray-150 w-44 mt-2">Whatsapp Web</label>
|
829 |
+
<input type="hidden" name="cht_social_<?php echo esc_attr($social['slug']); ?>[use_whatsapp_web]" value="no" />
|
|
|
830 |
<div>
|
831 |
<div class="checkbox">
|
832 |
+
<label for="cht_social_<?php echo esc_attr($social['slug']); ?>_use_whatsapp_web" class="chaty-checkbox font-primary text-cht-gray-150">
|
833 |
+
<input class="sr-only" type="checkbox" id="cht_social_<?php echo esc_attr($social['slug']); ?>_use_whatsapp_web" name="cht_social_<?php echo esc_attr($social['slug']); ?>[use_whatsapp_web]" value="yes" <?php echo checked($useWhatsappWeb, "yes") ?> />
|
|
|
|
|
|
|
|
|
834 |
<span></span>
|
835 |
Use Whatsapp Web directly on desktop
|
836 |
</label>
|
views/admin/channels-section.php
CHANGED
@@ -30,8 +30,7 @@ if (defined('ABSPATH') === false) {
|
|
30 |
?>
|
31 |
</div>
|
32 |
|
33 |
-
|
34 |
-
<section class="section one chaty-setting-form" id="<?php echo esc_attr($proID) ?>" xmlns="http://www.w3.org/1999/html">
|
35 |
<?php
|
36 |
$chtWidgetTitle = get_option("cht_widget_title");
|
37 |
$chtWidgetTitle = empty($chtWidgetTitle) ? "Widget-1" : $chtWidgetTitle;
|
@@ -85,15 +84,7 @@ if (defined('ABSPATH') === false) {
|
|
85 |
<?php esc_html_e('Custom Channel', 'chaty'); ?>
|
86 |
</a>
|
87 |
</div>
|
88 |
-
|
89 |
-
<div class="popover-upgrade-pro hidden bg-white border border-solid gap-4 border-cht-gray-150/20 shadow-lg shadow-cht-gray-50 mt-4 flex-wrap items-center overflow-hidden relative justify-between text-cht-gray-150 rounded-lg p-5 sm:p-2">
|
90 |
-
<span class="flex items-center">
|
91 |
-
<img class="self-end hidden sm:inline-block -ml-2 -mb-2" src="<?php echo esc_url(CHT_PLUGIN_URL."admin/assets/images/license-left.png") ?>"/>
|
92 |
-
<p class="text-base leading-6">Free plan is <strong>limited to 2 channels.</strong> <br/> Get unlimited channels in the Pro plan</p>
|
93 |
-
</span>
|
94 |
-
<a class="text-cht-primary text-sm border border-solid border-cht-primary px-5 py-2 rounded-lg hover:text-white hover:bg-cht-primary" target="_blank" href="<?php echo esc_url($this->getUpgradeMenuItemUrl()); ?>">Check Our Plans</a>
|
95 |
-
</div>
|
96 |
-
<?php endif; ?>
|
97 |
<input type="hidden" class="add_slug" name="cht_numb_slug" placeholder="test" value="<?php echo esc_attr(get_option('cht_numb_slug')); ?>" id="cht_numb_slug" >
|
98 |
|
99 |
<div class="channels-selected mt-4" id="channels-selected-list">
|
@@ -119,8 +110,7 @@ if (defined('ABSPATH') === false) {
|
|
119 |
<?php } ?>
|
120 |
<?php }; ?>
|
121 |
<?php
|
122 |
-
$
|
123 |
-
$proClass = ($isPro) ? "pro" : "free";
|
124 |
$text = get_option("cht_close_button_text");
|
125 |
$text = ($text === false) ? "Hide" : $text;
|
126 |
?>
|
@@ -155,15 +145,7 @@ if (defined('ABSPATH') === false) {
|
|
155 |
|
156 |
<div class="channels-selected__item disabled" style="opacity: 0; display: none;"></div>
|
157 |
|
158 |
-
<input type="hidden" id="is_pro_plugin" value="
|
159 |
-
<?php if ($this->is_pro() && $this->is_expired()) : ?>
|
160 |
-
<div class="popover">
|
161 |
-
<a target="_blank" href="<?php echo esc_url($this->getUpgradeMenuItemUrl()); ?>">
|
162 |
-
<?php esc_html_e('Your Pro Plan has expired. ', 'chaty'); ?>
|
163 |
-
<strong><?php esc_html_e('Upgrade Now', 'chaty'); ?></strong>
|
164 |
-
</a>
|
165 |
-
</div>
|
166 |
-
<?php endif; ?>
|
167 |
</div>
|
168 |
|
169 |
|
30 |
?>
|
31 |
</div>
|
32 |
|
33 |
+
<section class="section one chaty-setting-form" xmlns="http://www.w3.org/1999/html">
|
|
|
34 |
<?php
|
35 |
$chtWidgetTitle = get_option("cht_widget_title");
|
36 |
$chtWidgetTitle = empty($chtWidgetTitle) ? "Widget-1" : $chtWidgetTitle;
|
84 |
<?php esc_html_e('Custom Channel', 'chaty'); ?>
|
85 |
</a>
|
86 |
</div>
|
87 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
<input type="hidden" class="add_slug" name="cht_numb_slug" placeholder="test" value="<?php echo esc_attr(get_option('cht_numb_slug')); ?>" id="cht_numb_slug" >
|
89 |
|
90 |
<div class="channels-selected mt-4" id="channels-selected-list">
|
110 |
<?php } ?>
|
111 |
<?php }; ?>
|
112 |
<?php
|
113 |
+
$proClass = "free";
|
|
|
114 |
$text = get_option("cht_close_button_text");
|
115 |
$text = ($text === false) ? "Hide" : $text;
|
116 |
?>
|
145 |
|
146 |
<div class="channels-selected__item disabled" style="opacity: 0; display: none;"></div>
|
147 |
|
148 |
+
<input type="hidden" id="is_pro_plugin" value="0" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
149 |
</div>
|
150 |
|
151 |
|
views/admin/chaty-popup.php
CHANGED
@@ -27,7 +27,7 @@ if (defined('ABSPATH') === false) {
|
|
27 |
Select chat channels that you'd like to add to your store, and fill out your info. For more info visit our <a class="text-primary hover:unde" target="_blank" href="https://premio.io/help/chaty/?utm_soruce=wordpresschaty">Help Center</a> and check the video.
|
28 |
</p>
|
29 |
|
30 |
-
<iframe class="font-primary text-sm text-cht-gray-150 mb-8 w-[530px] mx-auto bg-cht-primary/40 rounded-xl" height="300" src="https://www.youtube.com/embed/
|
31 |
|
32 |
<button class="btn rounded-md text-base shadow-lg inline-flex items-center space-x-2 shadow-cht-primary/60 font-normal font-primary" type="button">
|
33 |
<span>Go to Chaty</span>
|
27 |
Select chat channels that you'd like to add to your store, and fill out your info. For more info visit our <a class="text-primary hover:unde" target="_blank" href="https://premio.io/help/chaty/?utm_soruce=wordpresschaty">Help Center</a> and check the video.
|
28 |
</p>
|
29 |
|
30 |
+
<iframe class="font-primary text-sm text-cht-gray-150 mb-8 w-[530px] mx-auto bg-cht-primary/40 rounded-xl" height="300" src="https://www.youtube.com/embed/i6t05AeuyWg?rel=0&start=28"></iframe>
|
31 |
|
32 |
<button class="btn rounded-md text-base shadow-lg inline-flex items-center space-x-2 shadow-cht-primary/60 font-normal font-primary" type="button">
|
33 |
<span>Go to Chaty</span>
|
views/admin/chaty_widget.php
CHANGED
@@ -57,10 +57,10 @@ $data = [
|
|
57 |
</a>
|
58 |
<header class="flex py-4 flex-col items-start sm:flex-row sm:justify-between">
|
59 |
<h2 class="font-primary text-cht-gray-150 text-[26px] font-semibold">
|
60 |
-
<?php echo $data['title'] ?>
|
61 |
</h2>
|
62 |
<a class="btn text-base mt-3 sm:mt-0 rounded-lg font-normal border-cht-primary bg-cht-primary text-white drop-shadow-3xl" href="<?php echo esc_url($data['upgrade_url']); ?>">
|
63 |
-
<?php echo $data['upgrade_text'] ?>
|
64 |
</a>
|
65 |
</header>
|
66 |
<main>
|
@@ -70,8 +70,8 @@ $data = [
|
|
70 |
<li class="bg-white shadow-cht-gray-150/10 rounded-xl border border-solid border-gray-300 overflow-hidden">
|
71 |
<div class="p-5 border-b-4 border-cht-primary h-full">
|
72 |
<img class="mb-5" src="<?php echo esc_url($item['logo']) ?>"/>
|
73 |
-
<h2 class="text-cht-gray-150 pb-3 font-semibold font-primary text-[18px]"><?php echo $item['title'] ?></h2>
|
74 |
-
<p class="text-sm font-primary font-normal text-[#49687ECC]"><?php echo $item['desc'] ?></p>
|
75 |
</div>
|
76 |
</li>
|
77 |
<?php endforeach; ?>
|
57 |
</a>
|
58 |
<header class="flex py-4 flex-col items-start sm:flex-row sm:justify-between">
|
59 |
<h2 class="font-primary text-cht-gray-150 text-[26px] font-semibold">
|
60 |
+
<?php echo esc_attr($data['title']) ?>
|
61 |
</h2>
|
62 |
<a class="btn text-base mt-3 sm:mt-0 rounded-lg font-normal border-cht-primary bg-cht-primary text-white drop-shadow-3xl" href="<?php echo esc_url($data['upgrade_url']); ?>">
|
63 |
+
<?php echo esc_attr($data['upgrade_text']) ?>
|
64 |
</a>
|
65 |
</header>
|
66 |
<main>
|
70 |
<li class="bg-white shadow-cht-gray-150/10 rounded-xl border border-solid border-gray-300 overflow-hidden">
|
71 |
<div class="p-5 border-b-4 border-cht-primary h-full">
|
72 |
<img class="mb-5" src="<?php echo esc_url($item['logo']) ?>"/>
|
73 |
+
<h2 class="text-cht-gray-150 pb-3 font-semibold font-primary text-[18px]"><?php echo esc_attr($item['title']) ?></h2>
|
74 |
+
<p class="text-sm font-primary font-normal text-[#49687ECC]"><?php echo esc_attr($item['desc']) ?></p>
|
75 |
</div>
|
76 |
</li>
|
77 |
<?php endforeach; ?>
|
views/admin/customize-widget-section.php
CHANGED
@@ -60,47 +60,17 @@ if (defined('ABSPATH') === false) {
|
|
60 |
</div>
|
61 |
|
62 |
<div class="color-picker-custom">
|
63 |
-
|
64 |
-
<div>
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
];
|
75 |
-
if (in_array($color, $os)) {
|
76 |
-
$color = '';
|
77 |
-
}
|
78 |
-
?>
|
79 |
-
<?php if ($color) : ?>
|
80 |
-
<div class="circle" style="background-color: <?php echo esc_attr($color); ?> "></div>
|
81 |
-
<span class="font-primary text-cht-gray-150 text-base"><?php esc_html_e('Custom color', 'chaty'); ?></span>
|
82 |
-
<?php else : ?>
|
83 |
-
<div class="circle">?</div>
|
84 |
-
<span class="text-cht-gray-150 font-primary text-base"><?php esc_html_e('Custom color', 'chaty'); ?></span>
|
85 |
-
<?php endif ?>
|
86 |
-
</div>
|
87 |
-
<div>
|
88 |
-
<input type="input" name="cht_custom_color" placeholder="HEX code: #ffffff" value="<?php echo esc_attr($color); ?>" />
|
89 |
-
<button class="btn ml-2 py-1 px-2 rounded-lg">Ok</button>
|
90 |
-
</div>
|
91 |
-
<?php else : ?>
|
92 |
-
<div>
|
93 |
-
<div class="circle">?</div>
|
94 |
-
<span class="text-cht-gray-150 font-primary text-base"><?php esc_html_e('Custom color', 'chaty'); ?></span>
|
95 |
-
<a class="text-cht-primary hover:text-cht-primary hover:underline font-primary text-base" target="_blank" href="<?php echo esc_url($this->getUpgradeMenuItemUrl()); ?>">
|
96 |
-
(<?php esc_html_e('Upgrade to Pro', 'chaty'); ?>)
|
97 |
-
</a>
|
98 |
-
</div>
|
99 |
-
<div>
|
100 |
-
<input type="input" name="cht_custom_colo" placeholder="HEX code: #ffffff" value="" readonly style="cursor:not-allowed;width: 227px;" />
|
101 |
-
<button class="btn ml-2 py-2 px-5 rounded-sm"><?php esc_html_e('Ok', 'chaty'); ?></button>
|
102 |
-
</div>
|
103 |
-
<?php endif; ?>
|
104 |
</div>
|
105 |
<?php $color = $this->get_current_color(); ?>
|
106 |
<button class="color-picker-btn-close text-cht-gray-150">
|
@@ -155,26 +125,13 @@ if (defined('ABSPATH') === false) {
|
|
155 |
<span class="custom-control-label"><?php esc_html_e('Right', 'chaty'); ?></span>
|
156 |
</label>
|
157 |
|
158 |
-
|
159 |
-
<
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
<?php else : ?>
|
166 |
-
<span class="custom-control group relative custom-radio free-custom-radio">
|
167 |
-
<input type="radio" class="custom-control-input" disabled>
|
168 |
-
<span class="custom-control-label pointer-events-none"><?php esc_html_e('Custom Position', 'chaty'); ?> </span>
|
169 |
-
<a
|
170 |
-
class="absolute opacity-0 block z-40 group-hover:opacity-100 hover:text-white left-0 top-0 h-full py-[3px] text-base w-full text-center text-white rounded-[3px] bg-cht-primary"
|
171 |
-
target="_blank"
|
172 |
-
href="<?php echo esc_url($this->getUpgradeMenuItemUrl()); ?>"
|
173 |
-
>
|
174 |
-
(<?php esc_html_e('Upgrade to Pro', 'chaty'); ?>)
|
175 |
-
</a>
|
176 |
-
</span>
|
177 |
-
<?php endif; ?>
|
178 |
</div>
|
179 |
</div>
|
180 |
|
@@ -218,6 +175,7 @@ if (defined('ABSPATH') === false) {
|
|
218 |
</select>
|
219 |
</div>
|
220 |
</div>
|
|
|
221 |
<div class="form-horizontal__item flex-center hide-show-button <?php echo esc_attr($state == "open" ? "active" : "") ?>" >
|
222 |
<label class="form-horizontal__item-label"><?php esc_html_e('Show close button', 'chaty');?>:</label>
|
223 |
<div>
|
@@ -369,7 +327,6 @@ if (defined('ABSPATH') === false) {
|
|
369 |
</div>
|
370 |
</div>
|
371 |
|
372 |
-
|
373 |
<div class="form-horizontal__item flex-center">
|
374 |
<label class="form-horizontal__item-label font-primary text-cht-gray-150 block text-base mb-3">
|
375 |
<?php esc_html_e('Pending messages', 'chaty');?>:
|
@@ -431,17 +388,18 @@ if (defined('ABSPATH') === false) {
|
|
431 |
<input value="<?php echo esc_attr($val) ?>" type="text" class="chaty-color-field w-16" name="cht_number_bg_color" id="cht_number_bg_color">
|
432 |
</div>
|
433 |
</div>
|
434 |
-
|
435 |
</div>
|
436 |
</div>
|
437 |
|
438 |
<div class="form-horizontal__item widget-icon__block chaty-widget-icon o-channel <?php echo esc_attr($class) ?>">
|
439 |
<label class="form-horizontal__item-label text-cht-gray-150 font-primary block text-base mb-3">Widget icon:</label>
|
440 |
<?php
|
441 |
-
$proClass =
|
442 |
$widgetIcon = get_option('widget_icon');
|
|
|
443 |
?>
|
444 |
<div class="widget-icon__wrap space-x-4 sm:space-x-7 pb-5 items-center inline-flex <?php echo esc_attr($proClass) ?>">
|
|
|
445 |
<label class="custom-control custom-radio relative">
|
446 |
<input type="radio" name="widget_icon" class="custom-control-input js-widget-i " value="chat-base" data-type="chat-base" data-gramm_editor="false" <?php checked($widgetIcon, "chat-base") ?> />
|
447 |
<i class="icon-chat" data-type="chat-base">
|
@@ -461,8 +419,6 @@ if (defined('ABSPATH') === false) {
|
|
461 |
</i>
|
462 |
<span class="custom-control-radio"></span>
|
463 |
</label>
|
464 |
-
<?php $widgetIcon = get_option('widget_icon'); ?>
|
465 |
-
<?php $disabled = (!$this->is_pro()) ? "disabled" : ""; ?>
|
466 |
|
467 |
<label class="custom-control custom-radio relative">
|
468 |
<input type="radio" name="widget_icon" class="custom-control-input js-widget-i" value="chat-smile" data-type="chat-smile" data-gramm_editor="false" <?php checked($widgetIcon, "chat-smile") ?> >
|
@@ -482,7 +438,6 @@ if (defined('ABSPATH') === false) {
|
|
482 |
<span class="custom-control-radio"></span>
|
483 |
</label>
|
484 |
|
485 |
-
|
486 |
<label class="custom-control custom-radio relative">
|
487 |
<input type="radio" name="widget_icon" class="custom-control-input js-widget-i" value="chat-bubble" data-type="chat-bubble" data-gramm_editor="false" <?php checked($widgetIcon, "chat-bubble") ?> />
|
488 |
<i class="icon-chat" data-type="chat-bubble">
|
@@ -497,8 +452,7 @@ if (defined('ABSPATH') === false) {
|
|
497 |
<span class="custom-control-radio"></span>
|
498 |
</label>
|
499 |
|
500 |
-
|
501 |
-
<label class="custom-control custom-radio relative <?php echo esc_attr(!$this->is_pro() ? "add-border" : "") ?>">
|
502 |
<input type="radio" name="widget_icon" class="custom-control-input js-widget-i" value="chat-db" data-type="chat-db" data-gramm_editor="false" <?php checked($widgetIcon, "chat-db") ?> />
|
503 |
<i class="icon-chat" data-type="chat-db">
|
504 |
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="-496 507.1 54 54" style="enable-background:new -496 507.1 54 54;" xml:space="preserve">
|
@@ -513,174 +467,163 @@ if (defined('ABSPATH') === false) {
|
|
513 |
<span class="custom-control-radio"></span>
|
514 |
</label>
|
515 |
|
516 |
-
<?php if (!$this->is_pro()) : ?>
|
517 |
<div class="custom-control group custom-radio relative upgrade-upload-btn">
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
<div class="
|
522 |
-
<
|
523 |
-
<i class='icon-upload'></i>
|
524 |
-
<div class="file-loading">
|
525 |
-
<input type="file" id="testUpload" name="cht_widget_img" <?php if (!$this->is_pro()) {
|
526 |
-
echo 'disabled';
|
527 |
-
} ?> >
|
528 |
-
</div>
|
529 |
-
<div id="errorBlock" class="help-block"></div>
|
530 |
</div>
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
<?php
|
536 |
-
|
537 |
-
<a class="opacity-0 group-hover:opacity-100 hidden group-hover:inline-block absolute right-0 -bottom-8 w-[170px] text-center px-2 py-1.5 bg-cht-primary rounded-[4px] text-white hover:text-white focus:text-white text-base" target="_blank" href="<?php echo esc_url($this->getUpgradeMenuItemUrl()); ?>"><?php esc_html_e('Upgrade to Pro', 'chaty'); ?></a>
|
538 |
</div>
|
539 |
-
<?php else : ?>
|
540 |
-
</div>
|
541 |
-
<?php endif; ?>
|
542 |
</div>
|
543 |
</div>
|
544 |
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
|
|
568 |
</div>
|
569 |
-
</div>
|
570 |
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
|
|
|
|
642 |
</div>
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
value="<?php echo esc_attr($size) ?>" placeholder="<?php echo esc_attr($size) ?>">px
|
655 |
</div>
|
656 |
</div>
|
|
|
657 |
</div>
|
658 |
-
<input id="custom-widget-size-input" name="cht_widget_size" type="hidden" value="<?php echo esc_attr($size) ?>"/>
|
659 |
-
</div>
|
660 |
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
|
|
675 |
</div>
|
676 |
-
</div>
|
677 |
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
|
|
685 |
</section>
|
686 |
<div id="custom-css"></div>
|
60 |
</div>
|
61 |
|
62 |
<div class="color-picker-custom">
|
63 |
+
<div>
|
64 |
+
<div class="circle">?</div>
|
65 |
+
<span class="text-cht-gray-150 font-primary text-base"><?php esc_html_e('Custom color', 'chaty'); ?></span>
|
66 |
+
<a class="text-cht-primary hover:text-cht-primary hover:underline font-primary text-base" target="_blank" href="<?php echo esc_url($this->getUpgradeMenuItemUrl()); ?>">
|
67 |
+
(<?php esc_html_e('Upgrade to Pro', 'chaty'); ?>)
|
68 |
+
</a>
|
69 |
+
</div>
|
70 |
+
<div>
|
71 |
+
<input type="input" name="cht_custom_colo" placeholder="HEX code: #ffffff" value="" readonly style="cursor:not-allowed;width: 227px;" />
|
72 |
+
<button class="btn ml-2 py-2 px-5 rounded-sm"><?php esc_html_e('Ok', 'chaty'); ?></button>
|
73 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
</div>
|
75 |
<?php $color = $this->get_current_color(); ?>
|
76 |
<button class="color-picker-btn-close text-cht-gray-150">
|
125 |
<span class="custom-control-label"><?php esc_html_e('Right', 'chaty'); ?></span>
|
126 |
</label>
|
127 |
|
128 |
+
<span class="custom-control group relative custom-radio free-custom-radio">
|
129 |
+
<input type="radio" class="custom-control-input" disabled>
|
130 |
+
<span class="custom-control-label pointer-events-none"><?php esc_html_e('Custom Position', 'chaty'); ?> </span>
|
131 |
+
<a class="absolute opacity-0 block z-40 group-hover:opacity-100 hover:text-white left-0 top-0 h-full py-[3px] text-base w-full text-center text-white rounded-[3px] bg-cht-primary" target="_blank" href="<?php echo esc_url($this->getUpgradeMenuItemUrl()); ?>">
|
132 |
+
(<?php esc_html_e('Upgrade to Pro', 'chaty'); ?>)
|
133 |
+
</a>
|
134 |
+
</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
135 |
</div>
|
136 |
</div>
|
137 |
|
175 |
</select>
|
176 |
</div>
|
177 |
</div>
|
178 |
+
|
179 |
<div class="form-horizontal__item flex-center hide-show-button <?php echo esc_attr($state == "open" ? "active" : "") ?>" >
|
180 |
<label class="form-horizontal__item-label"><?php esc_html_e('Show close button', 'chaty');?>:</label>
|
181 |
<div>
|
327 |
</div>
|
328 |
</div>
|
329 |
|
|
|
330 |
<div class="form-horizontal__item flex-center">
|
331 |
<label class="form-horizontal__item-label font-primary text-cht-gray-150 block text-base mb-3">
|
332 |
<?php esc_html_e('Pending messages', 'chaty');?>:
|
388 |
<input value="<?php echo esc_attr($val) ?>" type="text" class="chaty-color-field w-16" name="cht_number_bg_color" id="cht_number_bg_color">
|
389 |
</div>
|
390 |
</div>
|
|
|
391 |
</div>
|
392 |
</div>
|
393 |
|
394 |
<div class="form-horizontal__item widget-icon__block chaty-widget-icon o-channel <?php echo esc_attr($class) ?>">
|
395 |
<label class="form-horizontal__item-label text-cht-gray-150 font-primary block text-base mb-3">Widget icon:</label>
|
396 |
<?php
|
397 |
+
$proClass = "has-free";
|
398 |
$widgetIcon = get_option('widget_icon');
|
399 |
+
$disabled = "disabled";
|
400 |
?>
|
401 |
<div class="widget-icon__wrap space-x-4 sm:space-x-7 pb-5 items-center inline-flex <?php echo esc_attr($proClass) ?>">
|
402 |
+
|
403 |
<label class="custom-control custom-radio relative">
|
404 |
<input type="radio" name="widget_icon" class="custom-control-input js-widget-i " value="chat-base" data-type="chat-base" data-gramm_editor="false" <?php checked($widgetIcon, "chat-base") ?> />
|
405 |
<i class="icon-chat" data-type="chat-base">
|
419 |
</i>
|
420 |
<span class="custom-control-radio"></span>
|
421 |
</label>
|
|
|
|
|
422 |
|
423 |
<label class="custom-control custom-radio relative">
|
424 |
<input type="radio" name="widget_icon" class="custom-control-input js-widget-i" value="chat-smile" data-type="chat-smile" data-gramm_editor="false" <?php checked($widgetIcon, "chat-smile") ?> >
|
438 |
<span class="custom-control-radio"></span>
|
439 |
</label>
|
440 |
|
|
|
441 |
<label class="custom-control custom-radio relative">
|
442 |
<input type="radio" name="widget_icon" class="custom-control-input js-widget-i" value="chat-bubble" data-type="chat-bubble" data-gramm_editor="false" <?php checked($widgetIcon, "chat-bubble") ?> />
|
443 |
<i class="icon-chat" data-type="chat-bubble">
|
452 |
<span class="custom-control-radio"></span>
|
453 |
</label>
|
454 |
|
455 |
+
<label class="custom-control custom-radio relative add-border">
|
|
|
456 |
<input type="radio" name="widget_icon" class="custom-control-input js-widget-i" value="chat-db" data-type="chat-db" data-gramm_editor="false" <?php checked($widgetIcon, "chat-db") ?> />
|
457 |
<i class="icon-chat" data-type="chat-db">
|
458 |
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="-496 507.1 54 54" style="enable-background:new -496 507.1 54 54;" xml:space="preserve">
|
467 |
<span class="custom-control-radio"></span>
|
468 |
</label>
|
469 |
|
|
|
470 |
<div class="custom-control group custom-radio relative upgrade-upload-btn">
|
471 |
+
<div class="form-group" id="image-upload">
|
472 |
+
<div id="elPreviewImage"></div>
|
473 |
+
<i class='icon-upload'></i>
|
474 |
+
<div class="file-loading">
|
475 |
+
<input type="file" id="testUpload" name="cht_widget_img" disabled >
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
476 |
</div>
|
477 |
+
<div id="errorBlock" class="help-block"></div>
|
478 |
+
</div>
|
479 |
+
<span class="custom-control-radio"></span>
|
480 |
+
<a class="opacity-0 group-hover:opacity-100 hidden group-hover:inline-block absolute right-0 -bottom-8 w-[170px] text-center px-2 py-1.5 bg-cht-primary rounded-[4px] text-white hover:text-white focus:text-white text-base" target="_blank" href="<?php echo esc_url($this->getUpgradeMenuItemUrl()); ?>">
|
481 |
+
<?php esc_html_e('Upgrade to Pro', 'chaty'); ?>
|
482 |
+
</a>
|
|
|
483 |
</div>
|
|
|
|
|
|
|
484 |
</div>
|
485 |
</div>
|
486 |
|
487 |
+
<div class="form-horizontal__item font-section">
|
488 |
+
<label class="form-horizontal__item-label font-primary text-cht-gray-150 text-base block mb-2">Font Family:</label>
|
489 |
+
<div>
|
490 |
+
<?php
|
491 |
+
$font = get_option('cht_widget_font');
|
492 |
+
$font = ($font === false)?"System Stack":$font;
|
493 |
+
?>
|
494 |
+
<select name="cht_widget_font" class="form-fonts">
|
495 |
+
<option value="">Select font family</option>
|
496 |
+
<?php $group = '';
|
497 |
+
foreach ($fonts as $key => $value):
|
498 |
+
if ($value != $group) {
|
499 |
+
echo '<optgroup label="' . $value . '">';
|
500 |
+
$group = $value;
|
501 |
+
}
|
502 |
+
$key_value = $key;
|
503 |
+
if($key == "-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',sans-serif") {
|
504 |
+
$key_value = 'system_font';
|
505 |
+
}
|
506 |
+
?>
|
507 |
+
<option data-group="<?php echo esc_attr($value); ?>" value="<?php echo esc_attr($key_value); ?>" data-type="<?php echo esc_attr($value); ?>" <?php selected($font, $key_value); ?>><?php echo esc_attr($key); ?></option>
|
508 |
+
<?php endforeach; ?>
|
509 |
+
</select>
|
510 |
+
</div>
|
511 |
</div>
|
|
|
512 |
|
513 |
+
<div class="form-horizontal__item">
|
514 |
+
<label class="form-horizontal__item-label font-primary text-cht-gray-150 text-base mb-2 inline-block">Widget size:</label>
|
515 |
+
<div class="flex items-center space-x-2">
|
516 |
+
<?php
|
517 |
+
$size = get_option('cht_widget_size');
|
518 |
+
$size = empty($size) ? 54 : $size;
|
519 |
+
$fixedSizes = ["44", "54", "70", "84", "94"];
|
520 |
+
?>
|
521 |
+
<!-- custom widget size start -->
|
522 |
+
<div class="tab-tab-select bg-cht-gray-50 rounded-md p-1 flex-wrap gap-1 inline-flex items-center">
|
523 |
+
<label class="custom-control custom-radio" for="size-s">
|
524 |
+
<input
|
525 |
+
type="radio"
|
526 |
+
id="size-s"
|
527 |
+
class="custom-control-input widget-size-control"
|
528 |
+
<?php checked($size, "44") ?>
|
529 |
+
value="44"
|
530 |
+
/>
|
531 |
+
<span class="custom-control-label">S</span>
|
532 |
+
</label>
|
533 |
|
534 |
+
<label class="custom-control custom-radio" for="size-m">
|
535 |
+
<input
|
536 |
+
type="radio"
|
537 |
+
id="size-m"
|
538 |
+
class="custom-control-input widget-size-control"
|
539 |
+
<?php checked($size, "54") ?>
|
540 |
+
value="54"
|
541 |
+
/>
|
542 |
+
<span class="custom-control-label">M</span>
|
543 |
+
</label>
|
544 |
+
<label class="custom-control custom-radio" for="size-l">
|
545 |
+
<input
|
546 |
+
type="radio"
|
547 |
+
id="size-l"
|
548 |
+
class="custom-control-input widget-size-control"
|
549 |
+
<?php checked($size, "70") ?>
|
550 |
+
value="70"
|
551 |
+
/>
|
552 |
+
<span class="custom-control-label">L</span>
|
553 |
+
</label>
|
554 |
+
<label class="custom-control custom-radio" for="size-xl">
|
555 |
+
<input
|
556 |
+
type="radio"
|
557 |
+
id="size-xl"
|
558 |
+
class="custom-control-input widget-size-control"
|
559 |
+
<?php checked($size, "84") ?>
|
560 |
+
value="84"
|
561 |
+
/>
|
562 |
+
<span class="custom-control-label">XL</span>
|
563 |
+
</label>
|
564 |
+
<label class="custom-control custom-radio" for="size-xxl">
|
565 |
+
<input
|
566 |
+
type="radio"
|
567 |
+
id="size-xxl"
|
568 |
+
class="custom-control-input widget-size-control"
|
569 |
+
<?php checked($size, "94") ?>
|
570 |
+
value="94"
|
571 |
+
/>
|
572 |
+
<span class="custom-control-label">XXL</span>
|
573 |
+
</label>
|
574 |
+
<label class="custom-control custom-radio" for="size-custom">
|
575 |
+
<input
|
576 |
+
type="radio"
|
577 |
+
id="size-custom"
|
578 |
+
class="custom-control-input widget-size-control"
|
579 |
+
value="<?php echo esc_attr($size) ?>"
|
580 |
+
<?php echo in_array($size, $fixedSizes) ? '': 'checked' ?>
|
581 |
+
/>
|
582 |
+
<span class="custom-control-label">Custom</span>
|
583 |
+
</label>
|
584 |
+
</div>
|
585 |
+
<!-- custom widget size ends -->
|
586 |
</div>
|
587 |
+
<div id="custom-widget-size" class="max-w-[410px]" style="display: <?php echo in_array($size, $fixedSizes) ? 'none' : 'block' ?>" >
|
588 |
+
<div class="position-pro">
|
589 |
+
<div class="text-cht-gray-150/70">
|
590 |
+
<label class="text-base text-cht-gray-150/70">Custom widget size:</label>
|
591 |
+
<input
|
592 |
+
type="number"
|
593 |
+
min="0"
|
594 |
+
max="2000"
|
595 |
+
class="widget-size-control"
|
596 |
+
value="<?php echo esc_attr($size) ?>" placeholder="<?php echo esc_attr($size) ?>">px
|
597 |
+
</div>
|
|
|
598 |
</div>
|
599 |
</div>
|
600 |
+
<input id="custom-widget-size-input" name="cht_widget_size" type="hidden" value="<?php echo esc_attr($size) ?>"/>
|
601 |
</div>
|
|
|
|
|
602 |
|
603 |
+
<div class="form-horizontal__item flex-center">
|
604 |
+
<input type="hidden" name="cht_google_analytics" value="0" >
|
605 |
+
<label class="form-horizontal__item-label text-cht-gray-150 font-primary text-base mb-2 block"><?php esc_html_e('Google Analytics', 'chaty');?>:</label>
|
606 |
+
<div>
|
607 |
+
<label class="switch group inline-flex">
|
608 |
+
<?php
|
609 |
+
$checked = get_option('cht_google_analytics');
|
610 |
+
?>
|
611 |
+
<input data-gramm_editor="false" type="checkbox" name="cht_google_analytics" value="1" <?php checked($checked, 1) ?> <?php echo esc_attr($disabled) ?> >
|
612 |
+
<span class="chaty-slider round"></span>
|
613 |
+
<a target="_blank" class="opacity-0 px-5 py-1.5 group-hover:opacity-100 ml-4 pro-btn bg-cht-primary rounded-[6px] text-white hover:text-white" href="<?php echo esc_url($this->getUpgradeMenuItemUrl()); ?>">
|
614 |
+
<?php esc_html_e('Upgrade to Pro', 'chaty'); ?>
|
615 |
+
</a>
|
616 |
+
</label>
|
617 |
+
</div>
|
618 |
</div>
|
|
|
619 |
|
620 |
+
<input type="hidden" id="chaty_site_url" value="<?php echo site_url("/") ?>" >
|
621 |
+
<?php $requestData = filter_input_array(INPUT_GET); ?>
|
622 |
+
<?php if (isset($requestData['page']) && $requestData['page'] == "chaty-widget-settings") { ?>
|
623 |
+
<input type="hidden" name="widget" value="new-widget" >
|
624 |
+
<?php } else if (isset($requestData['widget']) && !empty($requestData['widget']) && is_numeric($requestData['widget']) && $requestData['widget'] > 0) { ?>
|
625 |
+
<input type="hidden" name="widget" value="<?php echo esc_attr($requestData['widget']) ?>" >
|
626 |
+
<?php } ?>
|
627 |
+
</div>
|
628 |
</section>
|
629 |
<div id="custom-css"></div>
|
views/admin/help.php
CHANGED
@@ -34,7 +34,7 @@ if (! defined('ABSPATH')) {
|
|
34 |
</div>
|
35 |
<div class="chaty-help-btn">
|
36 |
<!-- Free/Pro Only URL Change -->
|
37 |
-
<a class="chaty-help-tooltip" href="javascript:;"><img src="<?php echo esc_url(CHT_PLUGIN_URL."admin/assets/images/owner.
|
38 |
<?php
|
39 |
$option = get_option("hide_chaty_cta");
|
40 |
if ($option !== "yes") { ?>
|
34 |
</div>
|
35 |
<div class="chaty-help-btn">
|
36 |
<!-- Free/Pro Only URL Change -->
|
37 |
+
<a class="chaty-help-tooltip" href="javascript:;"><img src="<?php echo esc_url(CHT_PLUGIN_URL."admin/assets/images/premio-owner.png") ?>" alt="<?php esc_html_e("Need help?", 'chaty'); ?>" /></a>
|
38 |
<?php
|
39 |
$option = get_option("hide_chaty_cta");
|
40 |
if ($option !== "yes") { ?>
|
views/admin/trigger-and-target.php
CHANGED
@@ -205,13 +205,11 @@ $days = [
|
|
205 |
</div>
|
206 |
<!-- input fields end -->
|
207 |
</div>
|
208 |
-
|
209 |
-
<
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
</div>
|
214 |
-
<?php } ?>
|
215 |
</div>
|
216 |
<a href="javascript:;" class="remove-rules rounded-lg bg-transparent border-red-500 text-red-500 hover:bg-red-500/10 focus:bg-red-500/10 hover:text-red-500 px-3 py-1 border btn-primary inline-block mt-5" id="remove-date-rule"><?php esc_html_e('Remove Rules', 'chaty');?></a>
|
217 |
</div>
|
@@ -270,14 +268,11 @@ $days = [
|
|
270 |
</div>
|
271 |
</div>
|
272 |
</div>
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
</a>
|
279 |
-
</div>
|
280 |
-
<?php } ?>
|
281 |
</div>
|
282 |
</div>
|
283 |
</div>
|
205 |
</div>
|
206 |
<!-- input fields end -->
|
207 |
</div>
|
208 |
+
<div class="chaty-pro-feature">
|
209 |
+
<a target="_blank" href="<?php echo esc_url($this->getUpgradeMenuItemUrl()) ?>">
|
210 |
+
<?php esc_html_e('Upgrade to Pro', 'chaty'); ?>
|
211 |
+
</a>
|
212 |
+
</div>
|
|
|
|
|
213 |
</div>
|
214 |
<a href="javascript:;" class="remove-rules rounded-lg bg-transparent border-red-500 text-red-500 hover:bg-red-500/10 focus:bg-red-500/10 hover:text-red-500 px-3 py-1 border btn-primary inline-block mt-5" id="remove-date-rule"><?php esc_html_e('Remove Rules', 'chaty');?></a>
|
215 |
</div>
|
268 |
</div>
|
269 |
</div>
|
270 |
</div>
|
271 |
+
<div class="chaty-pro-feature">
|
272 |
+
<a target="_blank" href="<?php echo esc_url($this->getUpgradeMenuItemUrl()) ?>">
|
273 |
+
<?php esc_html_e('Upgrade to Pro', 'chaty'); ?>
|
274 |
+
</a>
|
275 |
+
</div>
|
|
|
|
|
|
|
276 |
</div>
|
277 |
</div>
|
278 |
</div>
|