Comments – wpDiscuz - Version 7.4

Version Description

Download this release

Release Info

Developer AdvancedCoding
Plugin Icon 128x128 Comments – wpDiscuz
Version 7.4
Comparing to
See all releases

Code changes from version 7.3.20 to 7.4

assets/js/wpdiscuz-combo-no_quill.min.js CHANGED
@@ -3,7 +3,7 @@
3
  /* Autogrow */
4
  jQuery.fn.autoGrow=function(){return this.each(function(){var createMirror=function(textarea){jQuery(textarea).after('<div class="autogrow-textarea-mirror"></div>');return jQuery(textarea).next(".autogrow-textarea-mirror")[0]};var sendContentToMirror=function(textarea){mirror.innerHTML=String(textarea.value).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n/g,"<br />")+".<br/>.";if(jQuery(textarea).height()!=jQuery(mirror).height())jQuery(textarea).height(jQuery(mirror).height())};var growTextarea=function(){sendContentToMirror(this)};var mirror=createMirror(this);mirror.style.display="none";mirror.style.wordWrap="break-word";mirror.style.padding=jQuery(this).css("padding");mirror.style.width=jQuery(this).css("width");mirror.style.fontFamily=jQuery(this).css("font-family");mirror.style.fontSize=jQuery(this).css("font-size");mirror.style.lineHeight=jQuery(this).css("line-height");this.style.overflow="hidden";this.style.minHeight=this.rows+"em";this.onkeydown=growTextarea;sendContentToMirror(this)})};
5
  /* wpDiscuz */
6
- var wpdiscuzLoadRichEditor=parseInt(wpdiscuzAjaxObj.loadRichEditor);if(wpdiscuzLoadRichEditor&&document.querySelector(".wpdiscuz-textarea-wrap"))var wpDiscuzEditor=new WpdEditor;function wpdMessagesOnInit(a,b){wpdiscuzAjaxObj.setCommentMessage(a,b),setTimeout(function(){location.href=location.href.substring(0,location.href.indexOf("wpdiscuzUrlAnchor")-1)},3e3)}wpdiscuzAjaxObj.setCommentMessage=function(c,b,d){var a="wpdiscuz-message-error";if(c instanceof Array)for(var e in c)b instanceof Array?"success"===b[e]?a="wpdiscuz-message-success":"warning"===b[e]&&(a="wpdiscuz-message-warning"):"success"===b?a="wpdiscuz-message-success":"warning"===b&&(a="wpdiscuz-message-warning"),jQuery("<div/>").addClass(a).html(c[e]).prependTo("#wpdiscuz-comment-message").delay(d instanceof Array?d[e]:d||4e3).fadeOut(1e3,function(){jQuery(this).remove()});else"success"===b?a="wpdiscuz-message-success":"warning"===b&&(a="wpdiscuz-message-warning"),jQuery("<div/>").addClass(a).html(c).prependTo("#wpdiscuz-comment-message").delay(d||4e3).fadeOut(1e3,function(){jQuery(this).remove()})},wpdiscuzAjaxObj.applyFilterOnPhrase=function(a,b,c){return wpdiscuzAjaxObj.phraseFilters&&jQuery.each(wpdiscuzAjaxObj.phraseFilters,function(d){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[d]]&&(a=wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[d]](a,b,c))}),a},jQuery(document).ready(function($){$("body").addClass("wpdiscuz_"+wpdiscuzAjaxObj.version);var H,c=wpdiscuzAjaxObj.is_user_logged_in,q=1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!c,r=1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&c,e=wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion,s=parseInt(wpdiscuzAjaxObj.commentListLoadType),I=parseInt(wpdiscuzAjaxObj.wc_post_id);wpdiscuzAjaxObj.wpdiscuz_nonce="";var t=parseInt(wpdiscuzAjaxObj.commentListUpdateType),u=1e3*parseInt(wpdiscuzAjaxObj.commentListUpdateTimer),v=parseInt(wpdiscuzAjaxObj.liveUpdateGuests),w=wpdiscuzAjaxObj.loadLastCommentId,J=w,f=parseInt(wpdiscuzAjaxObj.firstLoadWithAjax);Cookies.get("wpdiscuz_comments_sorting")&&Cookies.remove("wpdiscuz_comments_sorting",{path:""}),Cookies.get("wordpress_last_visit")&&Cookies.remove("wordpress_last_visit",{path:""}),Cookies.get("wpdiscuz_last_visit")&&Cookies.remove("wpdiscuz_last_visit",{path:""});var i=parseInt(wpdiscuzAjaxObj.wordpressIsPaginate),K=wpdiscuzAjaxObj.storeCommenterData,L=parseInt(wpdiscuzAjaxObj.wmuEnabled),M=wpdiscuzAjaxObj.isCookiesEnabled,N=!0,g=wpdiscuzAjaxObj.cookiehash,O=parseInt(wpdiscuzAjaxObj.isLoadOnlyParentComments),P=parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0,x=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),j=parseInt(wpdiscuzAjaxObj.enableBubble),y=parseInt(wpdiscuzAjaxObj.bubbleLiveUpdate),k=parseInt(wpdiscuzAjaxObj.bubbleHintTimeout),Q=parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout)?parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout):5,R=parseInt(wpdiscuzAjaxObj.bubbleShowNewCommentMessage),h=wpdiscuzAjaxObj.bubbleLocation,l=wpdiscuzAjaxObj.inlineFeedbackAttractionType,m=parseInt(wpdiscuzAjaxObj.scrollSize),m=m||32,S=[],T=[],U=[],V=!1,z=1,W=$("html").css("scroll-behavior"),X=$("body").css("scroll-behavior");if($(".wc_social_plugin_wrapper .wp-social-login-provider-list").length?$(".wc_social_plugin_wrapper .wp-social-login-provider-list").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):$(".wc_social_plugin_wrapper .the_champ_login_container").length?$(".wc_social_plugin_wrapper .the_champ_login_container").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):$(".wc_social_plugin_wrapper .social_connect_form").length?$(".wc_social_plugin_wrapper .social_connect_form").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):$(".wc_social_plugin_wrapper .oneall_social_login_providers").length&&$(".wc_social_plugin_wrapper .oneall_social_login .oneall_social_login_providers").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"),wpdiscuzLoadRichEditor&&$("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0"),window.addEventListener("beforeunload",function(c){var b=$(".wpd-form").not(":hidden");if(b.length){if(wpdiscuzLoadRichEditor&&document.querySelector(".wpdiscuz-textarea-wrap")){for(var a=0;a<b.length;a++)if("\n"!==wpDiscuzEditor.createEditor($(b[a]).find(".ql-container").attr("id")).getText()){c.preventDefault(),c.returnValue="";return}}else for(var a=0;a<b.length;a++)if($(b[a]).find(".wc_comment").val()){c.preventDefault(),c.returnValue="";return}}}),wpdiscuzLoadRichEditor||($(document).delegate("textarea.wc_comment","input",function(){aD($(this))}),$.each($("textarea.wc_comment"),function(){aD($(this))})),$("body").on("focus","#wpdcom .ql-editor, #wpdcom .wc_comment",function(){$(".wpd-form-foot",$(this).parents(".wpd_comm_form")).slideDown(P)}),$("body").on("focus","#wpdcom textarea",function(){$(this).next(".autogrow-textarea-mirror").length||$(this).autoGrow()}),c||aa({comment_author:Cookies.get("comment_author_"+g),comment_author_email:Cookies.get("comment_author_email_"+g),comment_author_url:Cookies.get("comment_author_url_"+g)}),$(".wpd-vote-down.wpd-dislike-hidden").remove(),$(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd"),$("body").on("click","#wpd-editor-source-code-wrapper-bg",function(){$(this).hide(),$("#wpd-editor-source-code-wrapper").hide(),$("#wpd-editor-uid").val(""),$("#wpd-editor-source-code").val("")}),wpdiscuzLoadRichEditor&&$("body").on("click","#wpd-insert-source-code",function(){var a=wpDiscuzEditor.createEditor("#"+$("#wpd-editor-uid").val());a.deleteText(0,a.getLength(),Quill.sources.USER);var b=$("#wpd-editor-source-code").val();b.length&&a.clipboard.dangerouslyPasteHTML(0,b,Quill.sources.USER),a.update(),$("#wpd-editor-source-code-wrapper-bg").hide(),$("#wpd-editor-source-code-wrapper").hide(),$("#wpd-editor-uid").val(""),$("#wpd-editor-source-code").val("")}),$("body").on("click",".wpd-reply-button",function(){var a=aj($(this),0);$(this).hasClass("wpdiscuz-clonned")?(wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+a).focus()},P):setTimeout(function(){$("#wc-textarea-"+a).trigger("focus")},P),$("#wpd-secondary-form-wrapper-"+a).slideToggle(P)):ah($(this)),function(a){if((q||r)&&"2.0"===e){var b=ak(a);setTimeout(function(){if(!T[b])try{T[b]=grecaptcha.render("wpdiscuz-recaptcha-"+a,{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(b){$("#wpdiscuz-recaptcha-field-"+a).val("key")},"expired-callback":function(){$("#wpdiscuz-recaptcha-field-"+a).val("")}})}catch(c){console.log(c),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+c.message,"error")}},1e3)}}(a)}),$("body").on("click","#wpdcom [data-wpd-clipboard]",function(){var b=$(this).data("wpd-clipboard"),a=$("<input/>");a.appendTo("body").css({position:"absolute",top:"-10000000px"}).val(b),a.trigger("select"),document.execCommand("copy"),a.remove(),wpdiscuzAjaxObj.setCommentMessage(b+"<br/>"+wpdiscuzAjaxObj.wc_copied_to_clipboard,"success",5e3)}),$("body").on("click",".wpdiscuz-nofollow,.wc_captcha_refresh_img,.wpd-load-more-submit",function(a){a.preventDefault()}),$("body").on("click",".wpd-toggle.wpd_not_clicked",function(){var a=$(this);a.removeClass("wpd_not_clicked");var b=aj($(this),0),c=$(this),d=$(".fas",c);!c.parents(".wpd-comment:not(.wpd-reply)").children(".wpd-reply").length&&O?aw(b,a):$("#wpd-comm-"+b+"> .wpd-reply").slideToggle(700,function(){$(this).is(":hidden")?(d.removeClass("fa-chevron-up"),d.addClass("fa-chevron-down"),c.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_show_replies_text),c.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_show_replies_text)):(d.removeClass("fa-chevron-down"),d.addClass("fa-chevron-up"),c.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),c.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text)),a.addClass("wpd_not_clicked")})}),$("body").on("mouseenter",".wpd-new-loaded-comment",function(){$(this).removeClass("wpd-new-loaded-comment")}),$("body").on("click",".wpd-sbs-toggle",function(){$(".wpdiscuz-subscribe-bar").slideToggle(P)}),parseInt(wpdiscuzAjaxObj.wpDiscuzIsShowOnSubscribeForm)&&!c&&wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&$("#wpdiscuz-subscribe-form").length&&("2.0"===e?(setTimeout(function(){try{grecaptcha.render("wpdiscuz-recaptcha-subscribe-form",{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(a){$("#wpdiscuz-recaptcha-field-subscribe-form").val("key")},"expired-callback":function(){$("#wpdiscuz-recaptcha-field-subscribe-form").val("")}})}catch(a){console.log(a),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+a.message,"error")}},1e3),$("body").on("submit","#wpdiscuz-subscribe-form",function(a){$("#wpdiscuz-recaptcha-field-subscribe-form").val()?$(".wpdiscuz-recaptcha",$(this)).css("border","none"):($(".wpdiscuz-recaptcha",$(this)).css("border","1px solid red"),a.preventDefault())})):"3.0"===e&&$("body").on("click","#wpdiscuz_subscription_button",function(b){var c=$(this).parents("#wpdiscuz-subscribe-form");b.preventDefault();try{grecaptcha.ready(function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/wpdAddSubscription"}).then(function(a){console.log(5555),document.getElementById("wpdiscuz-recaptcha-field-subscribe-form").value=a,c.trigger("submit")},function(a){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(a)})})}catch(a){console.log(a),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+a.message,"error")}})),(q||r)&&"2.0"===e){var A=$(window).width(),a=$("#wpdcom").width();a>=1100&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"65%"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"35%"})),a>=940&&a<1100&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"60%"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"40%"})),a>=810&&a<940&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"40%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"60%"})),a>=730&&a<810&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"45%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"55%"})),a>=610&&a<730&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.85)","-webkit-transform":"scale(0.85)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"43%"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"55%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"30%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"70%"})),A>650&&(a>=510&&a<610&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"center 0","-webkit-transform-origin":"center 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"35%"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"63%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"30%",position:"relative",right:"-60px"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"70%"}),$("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"})),a>=470&&a<510&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"center 0","-webkit-transform-origin":"center 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"40%"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"60%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({float:"none",width:"100%",display:"block"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({float:"none",width:"100%",display:"block"}),$("#wpdcom .wpd_main_comm_form .wc-form-footer").css({"margin-left":"0px"}),$("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"})),a<470&&($("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({margin:"0px auto","transform-origin":"center 0","-webkit-transform-origin":"center 0"}),$("#wpdcom .wpd-form-col-left").css({float:"none",width:"100%",display:"block"}),$("#wpdcom .wpd-form-col-right").css({float:"none",width:"100%",display:"block"}),$("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"}),$("#wpdcom .wpd-secondary-form-wrapper .wc_notification_checkboxes").css({"text-align":"center"}),$("#wpdcom .wpd-secondary-form-wrapper .wc-field-submit").css({"text-align":"center"})))}function Y(b,a,c){G(x||L,!1,a).done(function(a){if($(c).addClass("wpd_not_clicked"),"object"==typeof a){if(a.success){"collapsed"===wpdiscuzAjaxObj.commentFormView&&$(".wpd-form-foot",b).slideUp(P),a.data.wc_all_comments_count_new=parseInt(a.data.wc_all_comments_count_new),$(".wpd-thread-info").html(a.data.wc_all_comments_count_before_threads_html),$(".wpd-thread-info").attr("data-comments-count",a.data.wc_all_comments_count_new),$("#wpd-bubble-all-comments-count").replaceWith(a.data.wc_all_comments_count_bubble_html);var d=P;a.data.is_main?az(a.data.message):(d=P+700,$("#wpd-secondary-form-wrapper-"+a.data.uniqueid).slideToggle(700),1==a.data.is_in_same_container?$("#wpd-secondary-form-wrapper-"+a.data.uniqueid).after(a.data.message):$("#wpd-comm-"+a.data.uniqueid).after(a.data.message)),Z(a),_(a),M&&N?ab(a.data):N||$(".wpd-cookies-checkbox").prop("checked",!1),b.get(0).reset(),wpdiscuzLoadRichEditor?wpDiscuzEditor.createEditor("#wpd-editor-"+$(".wpdiscuz_unique_id",b).val()).setContents([{insert:"\n"}]):aD(b.find(".wc_comment")),aa(a.data),$(".wmu-preview-wrap",b).remove(),ay(),parseInt(wpdiscuzAjaxObj.scrollToComment)&&setTimeout(function(){au(),$("html, body").animate({scrollTop:$("#comment-"+a.data.new_comment_id).offset().top-m},1e3,av)},d),aE(a,b)}else a.data&&(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,b),"error"),aE(a,b))}else wpdiscuzAjaxObj.setCommentMessage(a,"error");$("#wpdiscuz-loading-bar").fadeOut(250),V=!1}).fail(function(b,d,a){console.log(a),$(c).addClass("wpd_not_clicked"),$("#wpdiscuz-loading-bar").fadeOut(250)})}function Z(b){if(!b.data.held_moderate){var a=new FormData;a.append("action","wpdCheckNotificationType"),a.append("comment_id",b.data.new_comment_id),a.append("email",b.data.comment_author_email),a.append("isParent",b.data.is_main),G(x,!0,a)}}function _(a){if(a.data.redirect>0&&a.data.new_comment_id){var b=new FormData;b.append("action","wpdRedirect"),b.append("commentId",a.data.new_comment_id),G(x,!0,b).done(function(a){"object"==typeof a&&a.success&&setTimeout(function(){location.href=a.data},2e3)}).fail(function(b,c,a){console.log(a)})}}function aa(a){$(".wpd_comm_form .wc_name").val(a.comment_author),a.comment_author_email&&0>a.comment_author_email.indexOf("@example.com")&&$(".wpd_comm_form .wc_email").val(a.comment_author_email),a.comment_author_url&&$(".wpd_comm_form .wc_website").val(a.comment_author_url)}function ab(b){var c=b.comment_author_email,d=b.comment_author,a=b.comment_author_url;null==K?(Cookies.set("comment_author_email_"+g,c),Cookies.set("comment_author_"+g,d),a.length&&Cookies.set("comment_author_url_"+g,a)):(K=parseInt(K),Cookies.set("comment_author_email_"+g,c,{expires:K,path:"/"}),Cookies.set("comment_author_"+g,d,{expires:K,path:"/"}),a.length&&Cookies.set("comment_author_url_"+g,a,{expires:K,path:"/"})),$(".wpd-cookies-checkbox").length&&$(".wpd-cookies-checkbox").prop("checked",!0)}function ac(a,b){$("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").show(),$("#wpd-comm-"+a+" .wpdiscuz-edit-form-wrap").replaceWith(b),$("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-last-edited").show()}$("body").on("click",".wc_comm_submit.wpd_not_clicked",function(){var d=$(this),f=1,a=$(this).parents("form");if("true"===a.attr("data-uploading")){wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhraseDoingUpload,"wmuPhraseDoingUpload",a),"warning");return}if(a.hasClass("wpd_main_comm_form")||(f=an($(this).parents(".wpd-comment"))),as(a,"#wpd-editor-"+$(".wpdiscuz_unique_id",a).val()),a.on("submit",function(a){a.preventDefault()}),""===$(".wc_comment",a).val().trim()){wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wc_msg_required_fields,"wc_msg_required_fields",a),"error");return}if(a[0].checkValidity()&&(h=a,i=!0,"2.0"===e&&$("input[name=wc_captcha]",h).length&&!$("input[name=wc_captcha]",h).val().length?(i=!1,$(".wpdiscuz-recaptcha",h).css("border","1px solid red")):"2.0"===e&&$("input[name=wc_captcha]",h).length&&$(".wpdiscuz-recaptcha",h).css("border","none"),i)){V=!0,ax(a),$(d).removeClass("wpd_not_clicked");var h,i,b=new FormData;if(b.append("action","wpdAddComment"),$(":input",a).each(function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&b.append(this.name+"",$(this).val().trim()),("checkbox"==this.type||"radio"==this.type)&&$(this).is(":checked")&&b.append(this.name+"",$(this).val())}),b.append("wpd_comment_depth",f),wpdiscuzAjaxObj.wpdiscuz_zs&&b.append("wpdiscuz_zs",wpdiscuzAjaxObj.wpdiscuz_zs),$(".wpd-cookies-checkbox",a).length?$(".wpd-cookies-checkbox",a).prop("checked")||(N=!1):c&&(N=!1),$("#wpdiscuz-loading-bar").show(),wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&"3.0"===e&&(1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!wpdiscuzAjaxObj.is_user_logged_in||1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&wpdiscuzAjaxObj.is_user_logged_in))try{grecaptcha.ready(function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/addComment"}).then(function(c){b.append("g-recaptcha-response",c),Y(a,b,d)},function(a){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(a)})})}catch(g){console.log(g),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+g.message,"error"),$("#wpdiscuz-loading-bar").fadeOut(250)}else Y(a,b,d)}(function(a){if((q||r)&&"2.0"===e){var b=ak(a);grecaptcha.reset(T[b])}})($(".wpdiscuz_unique_id",a).val()),ar()}),$("body").on("click",".wpd_editable_comment",function(){H&&$(".wpdiscuz-edit-form-wrap").length&&ac(aj($(".wpdiscuz-edit-form-wrap"),0),H);var c=$(this),b=aj(c,0),d=ak(b),a=new FormData;a.append("action","wpdEditComment"),a.append("commentId",d),H=$("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-text").get(0),G(x,!0,a).done(function(a){if("object"==typeof a){if(a.success){if($("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text").replaceWith(a.data.html),wpdiscuzLoadRichEditor){var d=wpDiscuzEditor.createEditor("#wpd-editor-edit_"+b);d.clipboard.dangerouslyPasteHTML(0,a.data.content),d.update(),$(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd")}else $("#wc-textarea-edit_"+b).val(a.data.content),aD($("#wc-textarea-edit_"+b));$("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").hide(),$("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-last-edited").hide()}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,c),"error")}else console.log(a);$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("click",".wc_save_edited_comment",function(){var d=$(this),b=aj(d),e=ak(b),a=$("#wpd-comm-"+b+" #wpdiscuz-edit-form");if(as(a,"#wpd-editor-edit_"+b),a.on("submit",function(a){a.preventDefault()}),a[0].checkValidity()){var c=new FormData;c.append("action","wpdSaveEditedComment"),c.append("commentId",e),$(":input",a).each(function(){""!==this.name&&"checkbox"!==this.type&&"radio"!==this.type&&c.append(this.name+"",$(this).val()),("checkbox"===this.type||"radio"===this.type)&&$(this).is(":checked")&&c.append(this.name+"",$(this).val())}),G(x,!0,c).done(function(a){"object"==typeof a?(a.success?(ac(b,a.data.message),a.data.lastEdited&&($("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-last-edited").remove(),$(a.data.lastEdited).insertAfter("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text")),a.data.twitterShareLink&&$("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_tw").attr("href",a.data.twitterShareLink),a.data.whatsappShareLink&&$("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_whatsapp").attr("href",a.data.whatsappShareLink),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+b)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,d),"error"),aE(a,e)):console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}}),$("body").on("click",".wc_cancel_edit",function(){var a=aj($(this));ac(a,H),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+a)}),!i&&f&&(z=0,1==f?setTimeout(function(){ae(!0)},500):$("body").on("click",".wpd-load-comments",function(){$(this).parent(".wpd-load-more-submit-wrap").remove(),ae(!0)})),$("body").on("click",".wpd-load-more-submit",function(){var a=$(this),b="wpd-loaded";a.hasClass(b)&&ae(!1,a,b,"wpd-loading")});var ad=!1;function B(){var a=document.getElementById("wpdiscuzHasMoreComments"),b=0;a&&(b=a.dataset.is_show_load_more);var c=document.getElementById("wpdcom")?document.getElementById("wpdcom").clientHeight:0,d=$(window).height()+$(window).scrollTop();c&&d&&100*d/c>=80&& !1===ad&&1==b&&(ad=!0,ae(!1,$(".wpd-load-more-submit")))}function ae(c,b,e,g){b&&(b.toggleClass(e),b.toggleClass(g));var a=new FormData;a.append("action","wpdLoadMoreComments");var d=$(".wpdiscuz-sort-button-active").attr("data-sorting");d&&a.append("sorting",d),a.append("offset",z),a.append("lastParentId",al()),a.append("isFirstLoad",c?1:0);var h=$(".wpdf-active").attr("data-filter-type");a.append("wpdType",h||""),G(x,!c||1!=f,a).done(function(a){"object"==typeof a&&a.success&&(z++,c&&$(".wpd-comment").remove(),$(".wpdiscuz_single").remove(),$(".wpdiscuz-comment-pagination").before(a.data.comment_list),C(a,c&&2!==s),ad=!1,a.data.loadLastCommentId&&(w=a.data.loadLastCommentId),aE(a),c&&D(!1)),$("#wpdiscuz-loading-bar").fadeOut(250),$(".wpd-load-more-submit").blur(),b&&(b.toggleClass(e),b.toggleClass(g))}).fail(function(c,d,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250),$(".wpd-load-more-submit").blur(),b&&(b.toggleClass(e),b.toggleClass(g))})}function C(a,d){var b=document.getElementById("wpdiscuzHasMoreComments");if(!1==a.data.is_show_load_more)b&&(b.dataset.is_show_load_more=0),$(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide();else if(am(a.data.last_parent_id),b&&(b.dataset.is_show_load_more=1),d&&$(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").show(),a.data.comments_left>0){if(!$(".wpd-load-more-submit .wpd-comments-left").length){let c=$("<span>");c.addClass("wpd-comments-left"),$(".wpd-load-more-submit").append(c)}$(".wpd-load-more-submit .wpd-comments-left").text(a.data.comments_left_text)}aE(a)}function D(d){var b=location.href.match(/#comment\-(\d+)/);if(null!==b){var c=b[1];if($("#comment-"+c).length)setTimeout(function(){au(),$("html, body").animate({scrollTop:$("#comment-"+c).parents("[id^=wpd-comm-]").offset().top-m},1e3,av),d&&af(c)},500);else{var a=new FormData;a.append("action","wpdGetSingleComment"),a.append("commentId",c),G(x,!0,a).done(function(a){if("object"==typeof a&&a.success){var b="#comment-"+c;$("#comment-"+a.data.parentCommentID).length?$("#comment-"+a.data.parentCommentID).parents("[id^=wpd-comm-"+a.data.parentCommentID+"]").replaceWith(a.data.message):$(".wpd-thread-list").prepend(a.data.message),aE(a),au(),$("html, body").animate({scrollTop:$(b).offset().top-m},1e3,av),d&&af(c)}$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}}}function af(a){setTimeout(function(){$("#comment-"+a).siblings(".wpd-secondary-form-wrapper").is(":visible")||$("#comment-"+a).find(".wpd-reply-button").trigger("click")},1100)}function ag(b){if(void 0!==b.data.message)for(var c,d=b.data.message,a=0;a<d.length;a++)ap((c=d[a]).comment_parent,c.comment_html)}function ah(b){var a=aj(b,0);$("#wpdiscuz_form_anchor-"+a).before(ai(a));var d=$("#wpd-secondary-form-wrapper-"+a);c||aa({comment_author:Cookies.get("comment_author_"+g),comment_author_email:Cookies.get("comment_author_email_"+g),comment_author_url:Cookies.get("comment_author_url_"+g)}),wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+a).focus()},P):setTimeout(function(){$("#wc-textarea-"+a).trigger("focus")},P),d.slideToggle(P,function(){b.addClass("wpdiscuz-clonned")})}function ai(a){return $("#wpdiscuz_hidden_secondary_form").html().replace(/wpdiscuzuniqueid/g,a)}function aj(a,c){var b="";return(b=c?a.parents(".wpd-main-form-wrapper").attr("id"):a.parents(".wpd-comment").attr("id")).substring(b.lastIndexOf("-")+1)}function ak(a){return a.substring(0,a.indexOf("_"))}function al(){return $(".wpd-load-more-submit").attr("data-lastparentid")}function am(a){$(".wpd-load-more-submit").attr("data-lastparentid",a),2!==s&&$(".wpdiscuz-comment-pagination").show()}function an(a){var b=a.attr("class").split(" "),c="";return $.each(b,function(b,a){"wpd_comment_level"===ao(a,!1)&&(c=ao(a,!0))}),parseInt(c)+1}function ao(a,b){return b?a.substring(a.indexOf("-")+1):a.substring(0,a.indexOf("-"))}function ap(a,b){if(0==a)az(b);else{var c=aj($("#comment-"+a),0);$("#wpdiscuz_form_anchor-"+c).after(b)}}function aq(){var a=[];return $(".wpd-comment-right").each(function(){a.push(ak(aj($(this),0)))}),a.join(",")}function ar(){$(".wpdiscuz_reset").val("")}function as(a,b){var c=a.find(".wpd-required-group");wpdiscuzLoadRichEditor&&a.find(".wc_comment").val($(b+">.ql-editor").html()),at(a),$.each(c,function(){$("input",this).prop("required",!1),0===$("input:checked",this).length?$("input",$(this)).prop("required",!0):$(".wpd-field-invalid",this).remove()})}function at(c){var b=c.find(".wc_comment"),a=b.val().trim().replace(/<p><br><\/p>/g,"\n").replace(/<p>(.*?)<\/p>/g,"$1\n");a=(a=(a=(a=a.replace(/<img src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img[^>]+alt=["|']([^"|']+)["|'][^>]+src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'][^>]?>/g," $1 ")).replace(/<img\s+([^>]*)class=["|']wpdem\-sticker["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img\s+([^>]*)src=["|']([^"|']+)["|'](.*?)[^>]*>/g," $2 "),b.val(a)}function au(){$("html, body").css("scroll-behavior","unset")}function av(){$("html").css("scroll-behavior",W),$("body").css("scroll-behavior",X)}function aw(b,d){var c=ak(b),a=new FormData;a.append("action","wpdShowReplies"),a.append("commentId",c),G(x,!0,a).done(function(a){d.addClass("wpd_not_clicked"),"object"==typeof a&&a.success&&($("#wpd-comm-"+b).replaceWith(a.data.comment_list),$("#wpd-comm-"+b+" .wpd-toggle .fas").removeClass("fa-chevron-down").addClass("fa-chevron-up"),$("#wpd-comm-"+b+" .wpd-toggle .wpd-view-replies .wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),$("#wpd-comm-"+b+" .wpd-toggle").attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text),aE(a)),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),d.addClass("wpd_not_clicked"),$("#wpdiscuz-loading-bar").fadeOut(250)})}function ax(a){$(".wpd-agreement-checkbox",a).each(function(){$(this).hasClass("wpd_agreement_hide")&&M&&$(this).prop("checked")&&(Cookies.set($(this).attr("name")+"_"+g,1,{expires:30,path:"/"}),$("input[name="+$(this).attr("name")+"]").each(function(){S.push($(this))}))})}function ay(){S.length&&(S.forEach(function(a){a.parents(".wpd-field-checkbox").remove()}),S=[])}function az(a){$(".wpd-sticky-comment").last()[0]?$(a).insertAfter($(".wpd-sticky-comment").last()[0]):$(".wpd-thread-list").prepend(a)}function E(a){a?a.prop("required")||(a.val()?a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none")):$.each($(".wc_email"),function(c,b){var a=$(b);a.prop("required")||(a.val()?a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none"))})}if(2!==s||i||($(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide(),B(),$(window).scroll(function(){B()})),wpdiscuzAjaxObj.setLoadMoreVisibility=C,$("body").on("click",".wpd-vote-up.wpd_not_clicked, .wpd-vote-down.wpd_not_clicked",function(){var b,c=$(this);$(c).removeClass("wpd_not_clicked");var d=aj(c),e=ak(d);b=$(this).hasClass("wpd-vote-up")?1:-1;var a=new FormData;a.append("action","wpdVoteOnComment"),a.append("commentId",e),a.append("voteType",b),G(x,!0,a).done(function(a){if($(c).addClass("wpd_not_clicked"),"object"==typeof a){if(a.success){if("total"===a.data.buttonsStyle){var d=$(".wpd-comment-footer .wpd-vote-result",$("#comment-"+e)),h=a.data.votes;d.text(a.data.votesHumanReadable),d.attr("title",h),d.removeClass("wpd-up wpd-down"),h>0&&d.addClass("wpd-up"),h<0&&d.addClass("wpd-down")}else{var f=$(".wpd-comment-footer .wpd-vote-result-like",$("#comment-"+e)),g=$(".wpd-comment-footer .wpd-vote-result-dislike",$("#comment-"+e));f.text(a.data.likeCountHumanReadable),f.attr("title",a.data.likeCount),g.text(a.data.dislikeCountHumanReadable),g.attr("title",a.data.dislikeCount),parseInt(a.data.likeCount)>0?f.addClass("wpd-up"):f.removeClass("wpd-up"),0>parseInt(a.data.dislikeCount)?g.addClass("wpd-down"):g.removeClass("wpd-down")}var i=$(".wpd-comment-footer .wpd-vote-up",$("#comment-"+e)),j=$(".wpd-comment-footer .wpd-vote-down",$("#comment-"+e));i.removeClass("wpd-up"),j.removeClass("wpd-down"),a.data.curUserReaction>0?i.addClass("wpd-up"):a.data.curUserReaction<0&&j.addClass("wpd-down")}else a.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,c),"error");aE(a,e,b)}else console.log(a);$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,d,a){console.log(a),$(c).addClass("wpd_not_clicked"),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$(document).on("click","body",function(b){var a=$(".wpdiscuz-sort-buttons");$(b.target).hasClass("wpdf-sorting")||$(b.target).parent().hasClass("wpdf-sorting")?a.css({display:a.is(":visible")?"none":"flex"}):a.hide()}),$("body").on("click",".wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)",function(){var c=$(this),b=$(this).attr("data-sorting");if(b){$(".wpdiscuz-sort-button.wpdiscuz-sort-button-active").removeClass("wpdiscuz-sort-button-active").appendTo(".wpdiscuz-sort-buttons"),c.addClass("wpdiscuz-sort-button-active").prependTo(".wpdf-sorting");var a=new FormData;a.append("action","wpdSorting"),a.append("sorting",b);var d=$(".wpdf-active").attr("data-filter-type");a.append("wpdType",d||""),G(x,!0,a).done(function(a){"object"==typeof a&&a.success&&($("#wpdcom .wpd-comment").remove(),$("#wpdcom .wpd-thread-list").prepend(a.data.message),C(a,!1),z=1),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}}),window.onhashchange=function(){D(!1)},1!=f&&D(!1),$("body").on("click",".wpdiscuz-readmore",function(){var b=aj($(this)),c=ak(b),a=new FormData;a.append("action","wpdReadMore"),a.append("commentId",c),G(x,!0,a).done(function(a){"object"==typeof a?(a.success?($("#comment-"+c+" .wpd-comment-text").replaceWith(" "+a.data.message),$("#wpdiscuz-readmore-"+b).remove()):console.log(a.data),aE(a)):console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("change",".wpd-required-group",function(){0!==$("input:checked",this).length?$("input",$(this)).prop("required",!1):$("input",$(this)).prop("required",!0)}),$("body").on("click",".wpdiscuz-spoiler",function(){$(this).next().slideToggle(),$(this).hasClass("wpdiscuz-spoiler-closed")?$(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-plus").removeClass("fa-plus").addClass("fa-minus"):$(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-minus").removeClass("fa-minus").addClass("fa-plus"),$(this).toggleClass("wpdiscuz-spoiler-closed")}),$("body").on("click",".wpd-tools i",function(){var a=$(this).siblings(".wpd-tools-actions");a.is(":visible")||$(this).parents(".wpd-comment-right").attr("id")!==$("[id^=comment-]","#wpdcom").last().attr("id")||$("#comments").css({paddingBottom:"160px"}),a.css({display:a.is(":visible")?"none":"flex"})}),$("body").on("mouseleave",".wpd-comment-right",function(){$(this).find(".wpd-tools-actions").hide(),$("#comments").css({paddingBottom:"0"})}),$("body").on("click",".wpd_stick_btn",function(){var b=aj($(this),0),c=ak(b),a=new FormData;a.append("action","wpdStickComment"),a.append("commentId",c),G(x,!0,a).done(function(a){"object"==typeof a&&a.success&&location.reload(!0),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("click",".wpd_close_btn",function(){var b=aj($(this),0),c=ak(b),a=new FormData;a.append("action","wpdCloseThread"),a.append("commentId",c),G(x,!0,a).done(function(a){"object"==typeof a&&a.success&&location.reload(!0),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("click",".wpd-filter.wpd_not_clicked[data-filter-type]",function(){var b=$(this),c=b.attr("data-filter-type");wpdiscuzAjaxObj.resetActiveFilters(".wpdf-"+c),b.removeClass("wpd_not_clicked"),$(".fas",b).addClass("fa-pulse fa-spinner");var a=new FormData;a.append("action","wpdLoadMoreComments");var d=$(".wpdiscuz-sort-button-active").attr("data-sorting");d&&a.append("sorting",d),a.append("lastParentId",0),a.append("offset",0),z=1,a.append("wpdType",b.hasClass("wpdf-active")?"":c),a.append("isFirstLoad",1),$(this).hasClass("wpdf-inline")?$(this).hasClass("wpdf-active")?$(".wpd-comment-info-bar").hide():$(".wpd-comment-info-bar").css("display","flex"):$(".wpd-comment-info-bar").hide(),G(x,!1,a).done(function(a){b.addClass("wpd_not_clicked"),$(".fas",b).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(b.toggleClass("wpdf-active"),$(".wpd-load-comments").remove(),$(".wpd-comment").remove(),$(".wpd-thread-list").prepend(a.data.comment_list),C(a),w=a.data.loadLastCommentId,$(".wpd-load-more-submit").blur(),aE(a)),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("click",".wpdf-reacted.wpd_not_clicked",function(){var a=$(this);a.removeClass("wpd_not_clicked"),$(".fas",a).addClass("fa-pulse fa-spinner");var b=new FormData;b.append("action","wpdMostReactedComment"),G(x,!1,b).done(function(b){a.addClass("wpd_not_clicked"),$(".fas",a).removeClass("fa-pulse fa-spinner"),"object"==typeof b&&b.success&&($("#comment-"+b.data.parentCommentID).length?$("#comment-"+b.data.parentCommentID).parents("[id^=wpd-comm-"+b.data.parentCommentID+"]").replaceWith(b.data.message):$("#comment-"+b.data.commentId).length||$(".wpd-thread-list").prepend(b.data.message),aE(b),au(),$("html, body").animate({scrollTop:$("#comment-"+b.data.commentId).offset().top-m},1e3,av))}).fail(function(c,d,b){console.log(b),$(".fas",a).removeClass("fa-pulse fa-spinner")})}),$("body").on("click",".wpdf-hottest.wpd_not_clicked",function(){var a=$(this);a.removeClass("wpd_not_clicked"),$(".fas",a).addClass("fa-pulse fa-spinner");var b=new FormData;b.append("action","wpdHottestThread"),G(x,!1,b).done(function(b){a.addClass("wpd_not_clicked"),$(".fas",a).removeClass("fa-pulse fa-spinner"),"object"==typeof b&&b.success&&($("#comment-"+b.data.commentId).length?$("#comment-"+b.data.commentId).parents("[id^=wpd-comm-"+b.data.commentId+"]").replaceWith(b.data.message):$(".wpd-thread-list").prepend(b.data.message),aE(b),au(),$("html, body").animate({scrollTop:$("#comment-"+b.data.commentId).offset().top-m},1e3,av))}).fail(function(c,d,b){console.log(b),$(".fas",a).removeClass("fa-pulse fa-spinner")})}),$("body").on("click",".wpd-filter-view-all",function(){$(".wpdf-inline.wpdf-active.wpd_not_clicked").trigger("click")}),$("body").on("click",".wpd-follow-link.wpd_not_clicked",function(){var a=$(this);a.removeClass("wpd_not_clicked"),$(".fas",a).addClass("fa-pulse fa-spinner");var c=aj(a,0),d=ak(c),b=new FormData;b.append("action","wpdFollowUser"),b.append("commentId",d),G(x,!0,b).done(function(b){a.addClass("wpd_not_clicked"),"object"==typeof b?b.success?(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[b.data.code],b.data.code,a),"success"),a.removeClass("wpd-follow-active"),b.data.followTip&&a.attr("wpd-tooltip",b.data.followTip),b.data.followClass&&a.addClass(b.data.followClass),aE(b)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[b.data],b.data,a),"error"):console.log(b),$(".fas",a).removeClass("fa-pulse fa-spinner"),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(c,d,b){console.log(b),$(".fas",a).removeClass("fa-pulse fa-spinner"),$("#wpdiscuz-loading-bar").fadeOut(250)})}),E(),$("body").on("keyup",".wc_email",function(){E($(this))}),j&&$("#wpdcom").length){if($("#wpd-bubble-wrapper").hover(function(){$(this).addClass("wpd-bubble-hover")},function(){$(this).removeClass("wpd-bubble-hover")}),k&&!Cookies.get(wpdiscuzAjaxObj.cookieHideBubbleHint)&&setTimeout(function(){$("#wpd-bubble-wrapper").addClass("wpd-bubble-hover"),Cookies.set(wpdiscuzAjaxObj.cookieHideBubbleHint,"1",{expires:7,path:"/"}),setTimeout(function(){$("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")},1e3*Q)},1e3*k),"content_left"===h){if($(".entry-content").length){var b=Math.min($(".entry-content").offset().left,$("#wpdcom").offset().left)-120,d=b>25?b:25;$("#wpd-bubble-wrapper").css({left:d+"px"}),$("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if($(".post-entry").length){var b=Math.min($(".post-entry").offset().left,$("#wpdcom").offset().left)-120,d=b>25?b:25;$("#wpd-bubble-wrapper").css({left:d+"px"}),$("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if($(".container").length){var b=Math.min($(".container").offset().left,$("#wpdcom").offset().left)-120,d=b>25?b:25;$("#wpd-bubble-wrapper").css({left:d+"px"}),$("#wpd-bubble-wrapper").addClass("wpd-left-content")}else $("#wpd-bubble-wrapper").css({left:"25px"}),$("#wpd-bubble-wrapper").addClass("wpd-left-corner")}else"left_corner"===h?($("#wpd-bubble-wrapper").css({left:"25px"}),$("#wpd-bubble-wrapper").addClass("wpd-left-corner")):"right_corner"===h&&($("#wpd-bubble-wrapper").css({right:"25px"}),$("#wpd-bubble-wrapper").addClass("wpd-right-corner"));$("#wpd-bubble-wrapper").show(),$("body").on("click","#wpd-bubble-add-message-close",function(a){a.preventDefault(),a.stopPropagation(),$("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")}),$("body").on("click","#wpd-bubble",function(){au(),$("#tab-title-reviews").length&&$("#tab-title-reviews a").trigger("click"),$("html, body").animate({scrollTop:$("#wpdcom").offset().top-(m+28)},1e3,function(){av(),$("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover"),wpdiscuzLoadRichEditor?$("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0").focus():$("#wc-textarea-0_0").length&&$("#wc-textarea-0_0").trigger("focus")})}),$("body").on("click","#wpd-bubble-comment-close",function(a){a.preventDefault(),$("#wpd-bubble-notification-message").hide(),$("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")}),$("body").on("click","#wpd-bubble-comment-reply-link a",function(){var a=$(this).attr("href");setTimeout(function(){$("#wpd-bubble-notification-message").hide(),$("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),D(!0);var b=a.match(/#comment\-(\d+)/);U=U.filter(function(a){return a!=b[1]}),$("#wpd-bubble-count .wpd-new-comments-count").text(U.length),0==U.length&&$("#wpd-bubble-count").removeClass("wpd-new-comments")},100)}),$("body").on("click","#wpd-bubble-count",function(){if(U.length){var a=new FormData;a.append("action","wpdBubbleUpdate"),a.append("newCommentIds",U.join()),G(x,!0,a).done(function(a){"object"==typeof a&&a.success&&(a.data.message=a.data.message.filter(function(a){if(!$("#comment-"+a.comment_id).length)return a}),ag(a),$("#wpd-bubble-count").removeClass("wpd-new-comments"),$("#wpd-bubble-count .wpd-new-comments-count").text("0"),U=[],$(".wpd-new-loaded-comment").length&&(au(),$("html, body").animate({scrollTop:$($(".wpd-new-loaded-comment")[0]).offset().top-(m+28)},1e3,av)),aE(a)),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a)})}})}function F(){$.ajax({type:"GET",url:wpdiscuzAjaxObj.bubbleUpdateUrl,beforeSend:function(a){a.setRequestHeader("X-WP-Nonce",wpdiscuzAjaxObj.restNonce)},data:{postId:I,lastId:J,visibleCommentIds:aq()}}).done(function(a){if(!V){if("object"==typeof a){if(a.commentIDsToRemove.forEach(function(a){$("[id^=wpd-comm-"+a+"]").remove()}),a.ids.length){if(t){var b;(b=new FormData).append("action","wpdUpdateAutomatically"),b.append("loadLastCommentId",w),b.append("visibleCommentIds",aq()),G(x,!1,b).done(function(a){!V&&"object"==typeof a&&a.success&&(ag(a),a.data.wc_all_comments_count_new=parseInt(a.data.wc_all_comments_count_new),$(".wpd-thread-info").html(a.data.wc_all_comments_count_before_threads_html),$(".wpd-thread-info").attr("data-comments-count",a.data.wc_all_comments_count_new),$("#wpd-bubble-all-comments-count").replaceWith(a.data.wc_all_comments_count_bubble_html),w=a.data.loadLastCommentId)}).fail(function(b,c,a){console.log(a)})}a.ids=a.ids.filter(function(a){if(!$("#comment-"+a).length)return a});var c=5e3;J=parseInt(a.ids[a.ids.length-1]),U=U.concat(a.ids),R&&a.commentText&&($("#wpd-bubble-author-avatar").html(a.avatar),$("#wpd-bubble-author-name").html(a.authorName),$("#wpd-bubble-comment-date span").html(a.commentDate),$("#wpd-bubble-comment-text").html(a.commentText),$("#wpd-bubble-comment-reply-link a").attr("href",a.commentLink),$("#wpd-bubble-notification-message").show(),c=1e4);var d=parseInt($(".wpd-new-comments-count").text());d+=a.ids.length,$("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),$("#wpd-bubble-wrapper").addClass("wpd-new-comment-added"),setTimeout(function(){$("#wpd-bubble-notification-message").hide(),$("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")},c),$(".wpd-new-comments-count").text(d),$("#wpd-bubble-count").addClass("wpd-new-comments")}a.all_comments_count=parseInt(a.all_comments_count),$("#wpd-bubble-all-comments-count").replaceWith(a.all_comments_count_bubble_html),$(".wpd-reviews-tab").length||($(".wpd-thread-info").html(a.all_comments_count_before_threads_html),$(".wpd-thread-info").attr("data-comments-count",a.all_comments_count))}else console.log(a)}setTimeout(F,u)}).fail(function(b,c,a){console.log(a),setTimeout(F,u)})}if((j&&y||t)&&(c|| !c&&v)&&setTimeout(F,u),$(".wpd-inline-form-wrapper").length){var n=new FormData;n.append("action","wpdGetInlineCommentForm"),G(x,!1,n).done(function(a){"object"==typeof a?a.success?($(".wpd-inline-form-wrapper").append(a.data),$.each($("[name=_wpd_inline_nonce]"),function(){var b=$(this).attr("id"),a=$(this).parents(".wpd-inline-shortcode").attr("id");$(this).attr("id",b+"-"+a.substring(a.lastIndexOf("-")+1))}),$(".wpd-inline-opened").addClass("wpd-active"),$(".wpd-inline-opened").find(".wpd-inline-form-wrapper").show(),$(".wpd-inline-opened").find(".wpd-inline-icon").addClass("wpd-open"),$(".wpd-inline-opened").find(".wpd-inline-icon").removeClass("wpd-ignored"),aC()):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data]),a.data,"error"):console.log(a)}).fail(function(b,c,a){console.log(a)})}function aA(a){if($(a).hasClass("wpd-inline-shortcode"))var b=$(a).attr("id");else var b=$(a).parents(".wpd-inline-shortcode").attr("id");return b.substring(b.lastIndexOf("-")+1)}function aB(){$(".wpd-inline-form-wrapper").hide(),$(".wpd-inline-shortcode").removeClass("wpd-active"),$(".wpd-inline-icon").removeClass("wpd-open")}function o(){$.each($(".wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon"),function(){var a=$(this),b=a.offset().top-window.pageYOffset;a.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&b>0&&b<300&&("blink"===l?(a.addClass("wpd-blink"),setTimeout(function(){a.removeClass("wpd-blink")},3e3)):(a.parents(".wpd-inline-shortcode").addClass("wpd-active"),a.siblings(".wpd-inline-form-wrapper").show(),a.addClass("wpd-open"),aC(a.siblings(".wpd-inline-form-wrapper"))))})}function aC(a){if(a){if(a.offset().left<=10){a.css("left",Math.ceil(parseInt(a.css("left"))-a.offset().left+10));var b=Math.ceil(a.siblings(".wpd-inline-icon.wpd-open").offset().left-a.offset().left+2);b<3&&(b=3),document.styleSheets[0].addRule("#"+a.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+b+"px;")}else if(a.offset().left+a.width()>document.body.clientWidth-10){a.css("left",Math.ceil(parseInt(a.css("left"))+(document.body.clientWidth-(a.offset().left+a.width()))-10));var b=Math.ceil(a.siblings(".wpd-inline-icon.wpd-open").offset().left-a.offset().left+2);b>a.width()-3&&(b=a.width()-3),document.styleSheets[0].addRule("#"+a.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+b+"px;")}}else $.each($(".wpd-inline-form-wrapper:visible"),function(){if($(this).offset().left<=10){$(this).css("left",Math.ceil(parseInt($(this).css("left"))-$(this).offset().left+10));var a=Math.ceil($(this).siblings(".wpd-inline-icon.wpd-open").offset().left-$(this).offset().left+2);a<3&&(a=3),document.styleSheets[0].addRule("#"+$(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"px;")}else if($(this).offset().left+$(this).width()>document.body.clientWidth-10){$(this).css("left",Math.ceil(parseInt($(this).css("left"))+(document.body.clientWidth-($(this).offset().left+$(this).width()))-10));var a=Math.ceil($(this).siblings(".wpd-inline-icon.wpd-open").offset().left-$(this).offset().left+2);a>$(this).width()-3&&(a=$(this).width()-3),document.styleSheets[0].addRule("#"+$(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"px;")}})}function aD(a){var b,c=0;if(a.parents(".wpd_main_comm_form").length)c=parseInt(wpdiscuzAjaxObj.commentTextMaxLength),b=a.parents(".wpd_main_comm_form");else if(a.parents(".wpd-secondary-form-wrapper").length)c=parseInt(wpdiscuzAjaxObj.replyTextMaxLength),b=a.parents(".wpd-secondary-form-wrapper");else if(a.parents("#wpdiscuz-edit-form").length){var e=aj(a);c=parseInt(e.substring(e.lastIndexOf("_")+1))?parseInt(wpdiscuzAjaxObj.replyTextMaxLength):parseInt(wpdiscuzAjaxObj.commentTextMaxLength),b=a.parents("#wpdiscuz-edit-form")}if(c&&b){var g=a.val().length,d=$(".wpd-editor-char-counter",b),f=c-g;d.html(f),f<=10?d.addClass("error"):d.removeClass("error")}}function aE(a,b,c,d){a.data.callbackFunctions&&$.each(a.data.callbackFunctions,function(e){"function"==typeof wpdiscuzAjaxObj[a.data.callbackFunctions[e]]?wpdiscuzAjaxObj[a.data.callbackFunctions[e]](a,b,c,d):"function"==typeof window[a.data.callbackFunctions[e]]?window[a.data.callbackFunctions[e]](a,b,c,d):console.log(a.data.callbackFunctions[e]+" is not a function")})}function G(c,d,a){d&&$("#wpdiscuz-loading-bar").show(),a.append("postId",I),a.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce);var b=a.get("action");wpdiscuzAjaxObj.dataFilterCallbacks&&wpdiscuzAjaxObj.dataFilterCallbacks[b]&&$.each(wpdiscuzAjaxObj.dataFilterCallbacks[b],function(e){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[b][e]]&&(a=wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[b][e]](a,c,d))});var e=c?wpdiscuzAjaxObj.url:wpdiscuzAjaxObj.customAjaxUrl;return $.ajax({type:"POST",url:e,data:a,contentType:!1,processData:!1})}function p(){if(c||wpdiscuzAjaxObj.validateNonceForGuests){var a=new FormData;a.append("action","wpdGetNonce"),G(x,!1,a).done(function(a){"object"==typeof a?a.success?wpdiscuzAjaxObj.wpdiscuz_nonce=a.data:wpdiscuzAjaxObj.setCommentMessage(a.data,"error"):console.log(a)}).fail(function(b,c,a){console.log(a)})}}$(document).on("click","body",function(a){if($(a.target).hasClass("wpd-inline-form-close")||$(a.target).parents(".wpd-inline-form-close").length)a.preventDefault(),$(a.target).parents(".wpd-inline-form-wrapper").hide(),$(a.target).parents(".wpd-inline-shortcode").removeClass("wpd-active"),$(a.target).parents(".wpd-inline-form-wrapper").siblings(".wpd-inline-icon").removeClass("wpd-open");else if(!$(a.target).hasClass("wpd-inline-form-wrapper")&&!$(a.target).parents(".wpd-inline-form-wrapper").length){aB();var b="";$(a.target).hasClass("wpd-inline-icon")?b=$(a.target):$(a.target).parents(".wpd-inline-icon").length&&(b=$(a.target).parents(".wpd-inline-icon")),b.length&&b.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&(b.parents(".wpd-inline-shortcode").addClass("wpd-active"),b.siblings(".wpd-inline-form-wrapper").show(),b.addClass("wpd-open"),b.removeClass("wpd-ignored"),aC(b.siblings(".wpd-inline-form-wrapper")))}(!$(a.target).hasClass("wpd-last-inline-comments-wrapper")&&!$(a.target).parents(".wpd-last-inline-comments-wrapper").length||$(a.target).parents(".wpd-last-inline-comments-wrapper").length&&$(a.target).hasClass("wpd-load-inline-comment"))&&$(".wpd-last-inline-comments-wrapper").remove()}),$("body").on("click",".wpd-inline-submit.wpd_not_clicked",function(c){c.preventDefault();var d=$(this),a=$(this).parents(".wpd_inline_comm_form");if(a[0].checkValidity()){$(this).removeClass("wpd_not_clicked");var b=new FormData;b.append("action","wpdAddInlineComment"),b.append("inline_form_id",aA(a)),$.each($("input, textarea",a),function(c,a){"checkbox"===this.type?$(this).is(":checked")&&b.append($(a).attr("name"),$(a).val()):b.append($(a).attr("name"),$(a).val())}),G(x,!0,b).done(function(b){if(d.addClass("wpd_not_clicked"),"object"==typeof b){if(b.success){a[0].reset(),aB();var e=parseInt(b.data.newCount),c=d.parents(".wpd-inline-icon-wrapper").find(".wpd-inline-icon-count");c.text(e),e?c.addClass("wpd-has-comments"):c.removeClass("wpd-has-comments"),b.data.allCommentsCountNew=parseInt(b.data.allCommentsCountNew),$(".wpd-thread-info").html(b.data.allCommentsCountBeforeThreadsHtml),$(".wpd-thread-info").attr("data-comments-count",b.data.allCommentsCountNew),$("#wpd-bubble-all-comments-count").replaceWith(b.data.allCommentsCountBubbleHtml),b.data.message&&az(b.data.message),wpdiscuzAjaxObj.setCommentMessage(b.data.notification,"success")}else b.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[b.data],b.data,d),"error")}else wpdiscuzAjaxObj.setCommentMessage(b,"error");$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}}),$("body").on("keydown",".wpd-form",function(a){a.ctrlKey&&13==a.keyCode&&$(this).find(".wc_comm_submit").trigger("click")}),$("body").on("keydown","#wpdiscuz-edit-form",function(a){a.ctrlKey&&13==a.keyCode&&$(this).find(".wc_save_edited_comment").trigger("click")}),$("body").on("keydown",".wpd-inline-comment-content",function(a){a.ctrlKey&&13==a.keyCode&&$(this).parents(".wpd_inline_comm_form").find(".wpd-inline-submit.wpd_not_clicked").trigger("click")}),$("body").on("click",".wpd-inline-icon-count.wpd-has-comments",function(){var b=$(this),a=new FormData;a.append("action","wpdGetLastInlineComments"),a.append("inline_form_id",aA(b)),G(x,!0,a).done(function(a){"object"==typeof a?a.success?$(a.data).insertAfter(b):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,b),"error"):console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("click",".wpd-view-all-inline-comments",function(a){a.preventDefault(),$(this).parents(".wpd-last-inline-comments-wrapper").remove(),$(".wpdf-inline").hasClass("wpdf-active")||$(".wpdf-inline").trigger("click"),au(),$("html, body").animate({scrollTop:$(".wpdf-inline").offset().top-m},1e3,av)}),$("body").on("click",".wpd-feedback-content-link",function(a){a.preventDefault();var b=$(this).data("feedback-content-id");au(),$("html, body").animate({scrollTop:$("#wpd-inline-"+b).offset().top-(m+6)},1e3,function(){av(),$("#wpd-inline-"+b).addClass("wpd-active")})}),("scroll_open"===l||"blink"===l)&&(o(),$(window).on("scroll",o)),$("body").on("click","#wpd-post-rating.wpd-not-rated .wpd-rate-starts svg",function(){var a=new FormData,b=$(this).index();b>=0&&b<5&&(a.append("action","wpdUserRate"),a.append("rating",b+1),G(x,!0,a).done(function(a){"object"==typeof a?(a.success?location.reload(!0):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data),"error"),aE(a)):console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)}))}),$("body").on("submit","#wpdiscuz-subscribe-form",function(d){d.preventDefault();var a=$(this);let b=$("#wpdiscuz_subscription_button",a);if(a[0].checkValidity()&&(f=a,g=!0,"2.0"===e&&$("input[name=wpdiscuz_recaptcha_subscribe_form]",f).length&&!$("input[name=wpdiscuz_recaptcha_subscribe_form]",f).val().length?(g=!1,$(".wpdiscuz-recaptcha",f).css("border","1px solid red")):"2.0"===e&&$("input[name=wpdiscuz_recaptcha_subscribe_form]",f).length&&$(".wpdiscuz-recaptcha",f).css("border","none"),g)&&b.hasClass("wpd_not_clicked")){b.removeClass("wpd_not_clicked");var f,g,c=new FormData;c.append("action","wpdAddSubscription"),$("*",a).each(function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&c.append(this.name+"",$(this).val()),("checkbox"==this.type||"radio"==this.type)&&$(this).is(":checked")&&c.append(this.name+"",$(this).val())}),G(x,!0,c).done(function(a){"object"==typeof a?a.success?(wpdiscuzAjaxObj.setCommentMessage(a.data,"success"),setTimeout(function(){location.reload(!0)},3e3)):wpdiscuzAjaxObj.setCommentMessage(a.data,"error"):wpdiscuzAjaxObj.setCommentMessage(a,"error"),$("#wpdiscuz-loading-bar").fadeOut(250),V=!1,b.addClass("wpd_not_clicked")}).fail(function(c,d,a){console.log(a),b.addClass("wpd_not_clicked"),$("#wpdiscuz-loading-bar").fadeOut(250)})}}),$("body").on("click",".wpd-unsubscribe",function(b){b.preventDefault();var a=new FormData;a.append("action","wpdUnsubscribe"),a.append("sid",$(this).data("sid")),a.append("skey",$(this).data("skey")),G(x,!0,a).done(function(a){"object"==typeof a?a.success?(wpdiscuzAjaxObj.setCommentMessage(a.data,"success"),setTimeout(function(){location.reload(!0)},3e3)):wpdiscuzAjaxObj.setCommentMessage(a.data,"error"):console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250),V=!1}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),wpdiscuzAjaxObj.resetActiveFilters=function(a){$(".wpd-filter.wpdf-active"+(a?":not("+a+")":"")).removeClass("wpdf-active")},wpdiscuzAjaxObj.getAjaxObj=G,wpdiscuzAjaxObj.initNonce=p,p()});var onloadCallback=function(){if(document.getElementById("wpdiscuz-recaptcha-0_0")&&"2.0"===wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion&&(1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!wpdiscuzAjaxObj.is_user_logged_in||1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&wpdiscuzAjaxObj.is_user_logged_in))try{grecaptcha.render("wpdiscuz-recaptcha-0_0",{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(a){jQuery("#wpdiscuz-recaptcha-field-0_0").val("key")},"expired-callback":function(){jQuery("#wpdiscuz-recaptcha-field-0_0").val("")}})}catch(a){console.log(a),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+a.message,"error")}}
7
  /* Colorbox */
8
  !function(t,e,i){var o,n,r,h,a,s,l,c,d,g,f,u,p,m,w,v,y,x,b,T,C,H,k,W,E,I,M,L,R,S,K,P,B,O={html:!1,photo:!1,iframe:!1,inline:!1,transition:"elastic",speed:300,fadeOut:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,opacity:.9,preloading:!0,className:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:void 0,closeButton:!0,fastIframe:!0,open:!1,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",photoRegex:/\.(gif|png|jp(e|g|eg)|bmp|ico|webp|jxr|svg)((#|\?).*)?$/i,retinaImage:!1,retinaUrl:!1,retinaSuffix:"@2x.$1",current:"image {current} of {total}",previous:"previous",next:"next",close:"close",xhrError:"This content failed to load.",imgError:"This image failed to load.",returnFocus:!0,trapFocus:!0,onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,rel:function(){return this.rel},href:function(){return t(this).attr("href")},title:function(){return this.title},createImg:function(){var e=new Image,i=t(this).data("cbox-img-attrs");return"object"==typeof i&&t.each(i,function(t,i){e[t]=i}),e},createIframe:function(){var i=e.createElement("iframe"),o=t(this).data("cbox-iframe-attrs");return"object"==typeof o&&t.each(o,function(t,e){i[t]=e}),"frameBorder"in i&&(i.frameBorder=0),"allowTransparency"in i&&(i.allowTransparency="true"),i.name=(new Date).getTime(),i.allowFullscreen=!0,i}},_="colorbox",j="cbox",D=j+"Element",F=j+"_open",N=j+"_load",z=j+"_complete",A=j+"_cleanup",q=j+"_closed",U=j+"_purge",$=t("<a/>"),G="div",Q=0,J={};function V(i,o,n){var r=e.createElement(i);return o&&(r.id=j+o),n&&(r.style.cssText=n),t(r)}function X(){return i.innerHeight?i.innerHeight:t(i).height()}function Y(e,i){i!==Object(i)&&(i={}),this.cache={},this.el=e,this.value=function(e){var o;return void 0===this.cache[e]&&(void 0!==(o=t(this.el).attr("data-cbox-"+e))?this.cache[e]=o:void 0!==i[e]?this.cache[e]=i[e]:void 0!==O[e]&&(this.cache[e]=O[e])),this.cache[e]},this.get=function(t){var e=this.value(t);return"function"==typeof e?e.call(this.el,this):e}}function Z(t){var e=d.length,i=(I+t)%e;return i<0?e+i:i}function tt(t,e){return Math.round((/%/.test(t)?("x"===e?g.width():X())/100:1)*parseInt(t,10))}function et(t,e){return t.get("photo")||t.get("photoRegex").test(e)}function it(t,e){return t.get("retinaUrl")&&i.devicePixelRatio>1?e.replace(t.get("photoRegex"),t.get("retinaSuffix")):e}function ot(t){"contains"in n[0]&&!n[0].contains(t.target)&&t.target!==o[0]&&(t.stopPropagation(),n.trigger("focus"))}function nt(t){nt.str!==t&&(n.add(o).removeClass(nt.str).addClass(t),nt.str=t)}function rt(i){t(e).trigger(i),$.triggerHandler(i)}var ht=function(){var t,e,i=j+"Slideshow_",o="click."+j;function r(){clearTimeout(e)}function h(){(C.get("loop")||d[I+1])&&(r(),e=setTimeout(P.next,C.get("slideshowSpeed")))}function a(){v.html(C.get("slideshowStop")).off(o).one(o,s),$.on(z,h).on(N,r),n.removeClass(i+"off").addClass(i+"on")}function s(){r(),$.off(z,h).off(N,r),v.html(C.get("slideshowStart")).off(o).one(o,function(){P.next(),a()}),n.removeClass(i+"on").addClass(i+"off")}function l(){t=!1,v.hide(),r(),$.off(z,h).off(N,r),n.removeClass(i+"off "+i+"on")}return function(){t?C.get("slideshow")||($.off(A,l),l()):C.get("slideshow")&&d[1]&&(t=!0,$.one(A,l),C.get("slideshowAuto")?a():s(),v.show())}}();function at(r){var g,w;if(!S){if(g=t(r).data(_),C=new Y(r,g),w=C.get("rel"),I=0,w&&!1!==w&&"nofollow"!==w?(d=t("."+D).filter(function(){return new Y(this,t.data(this,_)).get("rel")===w}),-1===(I=d.index(C.el))&&(d=d.add(C.el),I=d.length-1)):d=t(C.el),!L){L=R=!0,nt(C.get("className")),n.css({visibility:"hidden",display:"block",opacity:""}),f=V(G,"LoadedContent","width:0; height:0; overflow:hidden; visibility:hidden"),h.css({width:"",height:""}).append(f),H=a.height()+c.height()+h.outerHeight(!0)-h.height(),k=s.width()+l.width()+h.outerWidth(!0)-h.width(),W=f.outerHeight(!0),E=f.outerWidth(!0);var v=tt(C.get("initialWidth"),"x"),y=tt(C.get("initialHeight"),"y"),x=C.get("maxWidth"),B=C.get("maxHeight");C.w=Math.max((!1!==x?Math.min(v,tt(x,"x")):v)-E-k,0),C.h=Math.max((!1!==B?Math.min(y,tt(B,"y")):y)-W-H,0),f.css({width:"",height:C.h}),P.position(),rt(F),C.get("onOpen"),T.add(m).hide(),n.trigger("focus"),C.get("trapFocus")&&e.addEventListener&&(e.addEventListener("focus",ot,!0),$.one(q,function(){e.removeEventListener("focus",ot,!0)})),C.get("returnFocus")&&$.one(q,function(){t(C.el).trigger("focus")})}var O=parseFloat(C.get("opacity"));o.css({opacity:O==O?O:"",cursor:C.get("overlayClose")?"pointer":"",visibility:"visible"}).show(),C.get("closeButton")?b.html(C.get("close")).appendTo(h):b.appendTo("<div/>"),function(){var e,o,n,r=P.prep,h=++Q;R=!0,M=!1,rt(U),rt(N),C.get("onLoad"),C.h=C.get("height")?tt(C.get("height"),"y")-W-H:C.get("innerHeight")&&tt(C.get("innerHeight"),"y"),C.w=C.get("width")?tt(C.get("width"),"x")-E-k:C.get("innerWidth")&&tt(C.get("innerWidth"),"x"),C.mw=C.w,C.mh=C.h,C.get("maxWidth")&&(C.mw=tt(C.get("maxWidth"),"x")-E-k,C.mw=C.w&&C.w<C.mw?C.w:C.mw);C.get("maxHeight")&&(C.mh=tt(C.get("maxHeight"),"y")-W-H,C.mh=C.h&&C.h<C.mh?C.h:C.mh);if(e=C.get("href"),K=setTimeout(function(){p.show()},100),C.get("inline")){var a=t(e).eq(0);n=t("<div>").hide().insertBefore(a),$.one(U,function(){n.replaceWith(a)}),r(a)}else C.get("iframe")?r(" "):C.get("html")?r(C.get("html")):et(C,e)?(e=it(C,e),M=C.get("createImg"),t(M).addClass(j+"Photo").on("error."+j,function(){r(V(G,"Error").html(C.get("imgError")))}).one("load",function(){h===Q&&setTimeout(function(){var e;C.get("retinaImage")&&i.devicePixelRatio>1&&(M.height=M.height/i.devicePixelRatio,M.width=M.width/i.devicePixelRatio),C.get("scalePhotos")&&(o=function(){M.height-=M.height*e,M.width-=M.width*e},C.mw&&M.width>C.mw&&(e=(M.width-C.mw)/M.width,o()),C.mh&&M.height>C.mh&&(e=(M.height-C.mh)/M.height,o())),C.h&&(M.style.marginTop=Math.max(C.mh-M.height,0)/2+"px"),d[1]&&(C.get("loop")||d[I+1])&&(M.style.cursor="pointer",t(M).on("click."+j,function(){P.next()})),M.style.width=M.width+"px",M.style.height=M.height+"px",r(M)},1)}),M.src=e):e&&u.load(e,C.get("data"),function(e,i){h===Q&&r("error"===i?V(G,"Error").html(C.get("xhrError")):t(this).contents())})}()}}function st(){n||(B=!1,g=t(i),n=V(G).attr({id:_,class:!1===t.support.opacity?j+"IE":"",role:"dialog",tabindex:"-1"}).hide(),o=V(G,"Overlay").hide(),p=t([V(G,"LoadingOverlay")[0],V(G,"LoadingGraphic")[0]]),r=V(G,"Wrapper"),h=V(G,"Content").append(m=V(G,"Title"),w=V(G,"Current"),x=t('<button type="button"/>').attr({id:j+"Previous"}),y=t('<button type="button"/>').attr({id:j+"Next"}),v=t('<button type="button"/>').attr({id:j+"Slideshow"}),p),b=t('<button type="button"/>').attr({id:j+"Close"}),r.append(V(G).append(V(G,"TopLeft"),a=V(G,"TopCenter"),V(G,"TopRight")),V(G,!1,"clear:left").append(s=V(G,"MiddleLeft"),h,l=V(G,"MiddleRight")),V(G,!1,"clear:left").append(V(G,"BottomLeft"),c=V(G,"BottomCenter"),V(G,"BottomRight"))).find("div div").css({float:"left"}),u=V(G,!1,"position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;"),T=y.add(x).add(w).add(v)),e.body&&!n.parent().length&&t(e.body).append(o,n.append(r,u))}function lt(){function i(t){t.which>1||t.shiftKey||t.altKey||t.metaKey||t.ctrlKey||(t.preventDefault(),at(this))}return!!n&&(B||(B=!0,y.on("click",function(){P.next()}),x.on("click",function(){P.prev()}),b.on("click",function(){P.close()}),o.on("click",function(){C.get("overlayClose")&&P.close()}),t(e).on("keydown."+j,function(t){var e=t.keyCode;L&&C.get("escKey")&&27===e&&(t.preventDefault(),P.close()),L&&C.get("arrowKey")&&d[1]&&!t.altKey&&(37===e?(t.preventDefault(),x.trigger("click")):39===e&&(t.preventDefault(),y.trigger("click")))}),"function"==typeof t.fn.on?t(e).on("click."+j,"."+D,i):t("."+D).live("click."+j,i)),!0)}t[_]||(t(st),(P=t.fn[_]=t[_]=function(e,i){var o=this;return e=e||{},"function"==typeof o&&(o=t("<a/>"),e.open=!0),o[0]?(st(),lt()&&(i&&(e.onComplete=i),o.each(function(){var i=t.data(this,_)||{};t.data(this,_,t.extend(i,e))}).addClass(D),new Y(o[0],e).get("open")&&at(o[0])),o):o}).position=function(e,i){var o,d,f,u=0,p=0,m=n.offset();function w(){a[0].style.width=c[0].style.width=h[0].style.width=parseInt(n[0].style.width,10)-k+"px",h[0].style.height=s[0].style.height=l[0].style.height=parseInt(n[0].style.height,10)-H+"px"}if(g.off("resize."+j),n.css({top:-9e4,left:-9e4}),d=g.scrollTop(),f=g.scrollLeft(),C.get("fixed")?(m.top-=d,m.left-=f,n.css({position:"fixed"})):(u=d,p=f,n.css({position:"absolute"})),!1!==C.get("right")?p+=Math.max(g.width()-C.w-E-k-tt(C.get("right"),"x"),0):!1!==C.get("left")?p+=tt(C.get("left"),"x"):p+=Math.round(Math.max(g.width()-C.w-E-k,0)/2),!1!==C.get("bottom")?u+=Math.max(X()-C.h-W-H-tt(C.get("bottom"),"y"),0):!1!==C.get("top")?u+=tt(C.get("top"),"y"):u+=Math.round(Math.max(X()-C.h-W-H,0)/2),n.css({top:m.top,left:m.left,visibility:"visible"}),r[0].style.width=r[0].style.height="9999px",o={width:C.w+E+k,height:C.h+W+H,top:u,left:p},e){var v=0;t.each(o,function(t){o[t]===J[t]||(v=e)}),e=v}J=o,e||n.css(o),n.dequeue().animate(o,{duration:e||0,complete:function(){w(),R=!1,r[0].style.width=C.w+E+k+"px",r[0].style.height=C.h+W+H+"px",C.get("reposition")&&setTimeout(function(){g.on("resize."+j,P.position)},1),"function"==typeof i&&i()},step:w})},P.resize=function(t){var e;L&&((t=t||{}).width&&(C.w=tt(t.width,"x")-E-k),t.innerWidth&&(C.w=tt(t.innerWidth,"x")),f.css({width:C.w}),t.height&&(C.h=tt(t.height,"y")-W-H),t.innerHeight&&(C.h=tt(t.innerHeight,"y")),t.innerHeight||t.height||(e=f.scrollTop(),f.css({height:"auto"}),C.h=f.height()),f.css({height:C.h}),e&&f.scrollTop(e),P.position("none"===C.get("transition")?0:C.get("speed")))},P.prep=function(i){if(L){var o,r="none"===C.get("transition")?0:C.get("speed");f.remove(),(f=V(G,"LoadedContent").append(i)).hide().appendTo(u.show()).css({width:(C.w=C.w||f.width(),C.w=C.mw&&C.mw<C.w?C.mw:C.w,C.w),overflow:C.get("scrolling")?"auto":"hidden"}).css({height:(C.h=C.h||f.height(),C.h=C.mh&&C.mh<C.h?C.mh:C.h,C.h)}).prependTo(h),u.hide(),t(M).css({float:"none"}),nt(C.get("className")),o=function(){var i,o,h=d.length;function a(){!1===t.support.opacity&&n[0].style.removeAttribute("filter")}L&&(o=function(){clearTimeout(K),p.hide(),rt(z),C.get("onComplete")},m.html(C.get("title")).show(),f.show(),h>1?("string"==typeof C.get("current")&&w.html(C.get("current").replace("{current}",I+1).replace("{total}",h)).show(),y[C.get("loop")||I<h-1?"show":"hide"]().html(C.get("next")),x[C.get("loop")||I?"show":"hide"]().html(C.get("previous")),ht(),C.get("preloading")&&t.each([Z(-1),Z(1)],function(){var i=d[this],o=new Y(i,t.data(i,_)),n=o.get("href");n&&et(o,n)&&(n=it(o,n),e.createElement("img").src=n)})):T.hide(),C.get("iframe")?(i=C.get("createIframe"),C.get("scrolling")||(i.scrolling="no"),t(i).attr({src:C.get("href"),class:j+"Iframe"}).one("load",o).appendTo(f),$.one(U,function(){i.src="//about:blank"}),C.get("fastIframe")&&t(i).trigger("load")):o(),"fade"===C.get("transition")?n.fadeTo(r,1,a):a())},"fade"===C.get("transition")?n.fadeTo(r,0,function(){P.position(0,o)}):P.position(r,o)}},P.next=function(){!R&&d[1]&&(C.get("loop")||d[I+1])&&(I=Z(1),at(d[I]))},P.prev=function(){!R&&d[1]&&(C.get("loop")||I)&&(I=Z(-1),at(d[I]))},P.close=function(){L&&!S&&(S=!0,L=!1,rt(A),C.get("onCleanup"),g.off("."+j),o.fadeTo(C.get("fadeOut")||0,0),n.stop().fadeTo(C.get("fadeOut")||0,0,function(){n.hide(),o.hide(),rt(U),f.remove(),setTimeout(function(){S=!1,rt(q),C.get("onClosed")},1)}))},P.remove=function(){n&&(n.stop(),t[_].close(),n.stop(!1,!0).remove(),o.remove(),S=!1,n=null,t("."+D).removeData(_).removeClass(D),t(e).off("click."+j).off("keydown."+j))},P.element=function(){return t(C.el)},P.settings=O)}(jQuery,document,window);
9
  /* Media Uploader */
3
  /* Autogrow */
4
  jQuery.fn.autoGrow=function(){return this.each(function(){var createMirror=function(textarea){jQuery(textarea).after('<div class="autogrow-textarea-mirror"></div>');return jQuery(textarea).next(".autogrow-textarea-mirror")[0]};var sendContentToMirror=function(textarea){mirror.innerHTML=String(textarea.value).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n/g,"<br />")+".<br/>.";if(jQuery(textarea).height()!=jQuery(mirror).height())jQuery(textarea).height(jQuery(mirror).height())};var growTextarea=function(){sendContentToMirror(this)};var mirror=createMirror(this);mirror.style.display="none";mirror.style.wordWrap="break-word";mirror.style.padding=jQuery(this).css("padding");mirror.style.width=jQuery(this).css("width");mirror.style.fontFamily=jQuery(this).css("font-family");mirror.style.fontSize=jQuery(this).css("font-size");mirror.style.lineHeight=jQuery(this).css("line-height");this.style.overflow="hidden";this.style.minHeight=this.rows+"em";this.onkeydown=growTextarea;sendContentToMirror(this)})};
5
  /* wpDiscuz */
6
+ var wpdiscuzLoadRichEditor=parseInt(wpdiscuzAjaxObj.loadRichEditor);if(wpdiscuzLoadRichEditor&&document.querySelector(".wpdiscuz-textarea-wrap"))var wpDiscuzEditor=new WpdEditor;function wpdMessagesOnInit(a,b){wpdiscuzAjaxObj.setCommentMessage(a,b),setTimeout(function(){location.href=location.href.substring(0,location.href.indexOf("wpdiscuzUrlAnchor")-1)},3e3)}wpdiscuzAjaxObj.setCommentMessage=function(c,b,d){var a="wpdiscuz-message-error";if(c instanceof Array)for(var e in c)b instanceof Array?"success"===b[e]?a="wpdiscuz-message-success":"warning"===b[e]&&(a="wpdiscuz-message-warning"):"success"===b?a="wpdiscuz-message-success":"warning"===b&&(a="wpdiscuz-message-warning"),jQuery("<div/>").addClass(a).html(c[e]).prependTo("#wpdiscuz-comment-message").delay(d instanceof Array?d[e]:d||4e3).fadeOut(1e3,function(){jQuery(this).remove()});else"success"===b?a="wpdiscuz-message-success":"warning"===b&&(a="wpdiscuz-message-warning"),jQuery("<div/>").addClass(a).html(c).prependTo("#wpdiscuz-comment-message").delay(d||4e3).fadeOut(1e3,function(){jQuery(this).remove()})},wpdiscuzAjaxObj.applyFilterOnPhrase=function(a,b,c){return wpdiscuzAjaxObj.phraseFilters&&jQuery.each(wpdiscuzAjaxObj.phraseFilters,function(d){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[d]]&&(a=wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[d]](a,b,c))}),a},jQuery(document).ready(function($){$("body").addClass("wpdiscuz_"+wpdiscuzAjaxObj.version);var H,c=wpdiscuzAjaxObj.is_user_logged_in,q=1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!c,r=1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&c,e=wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion,s=parseInt(wpdiscuzAjaxObj.commentListLoadType),I=parseInt(wpdiscuzAjaxObj.wc_post_id);wpdiscuzAjaxObj.wpdiscuz_nonce="";var t=parseInt(wpdiscuzAjaxObj.commentListUpdateType),u=1e3*parseInt(wpdiscuzAjaxObj.commentListUpdateTimer),v=parseInt(wpdiscuzAjaxObj.liveUpdateGuests),w=wpdiscuzAjaxObj.loadLastCommentId,J=w,f=parseInt(wpdiscuzAjaxObj.firstLoadWithAjax);Cookies.get("wpdiscuz_comments_sorting")&&Cookies.remove("wpdiscuz_comments_sorting",{path:""}),Cookies.get("wordpress_last_visit")&&Cookies.remove("wordpress_last_visit",{path:""}),Cookies.get("wpdiscuz_last_visit")&&Cookies.remove("wpdiscuz_last_visit",{path:""});var i=parseInt(wpdiscuzAjaxObj.wordpressIsPaginate),K=wpdiscuzAjaxObj.storeCommenterData,L=parseInt(wpdiscuzAjaxObj.wmuEnabled),M=wpdiscuzAjaxObj.isCookiesEnabled,N=!0,g=wpdiscuzAjaxObj.cookiehash,O=parseInt(wpdiscuzAjaxObj.isLoadOnlyParentComments),P=parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0,x=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),j=parseInt(wpdiscuzAjaxObj.enableBubble),y=parseInt(wpdiscuzAjaxObj.bubbleLiveUpdate),k=parseInt(wpdiscuzAjaxObj.bubbleHintTimeout),Q=parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout)?parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout):5,R=parseInt(wpdiscuzAjaxObj.bubbleShowNewCommentMessage),h=wpdiscuzAjaxObj.bubbleLocation,l=wpdiscuzAjaxObj.inlineFeedbackAttractionType,m=parseInt(wpdiscuzAjaxObj.scrollSize),m=m||32,S=[],T=[],U=[],V=!1,z=1,W=$("html").css("scroll-behavior"),X=$("body").css("scroll-behavior");if($(".wc_social_plugin_wrapper .wp-social-login-provider-list").length?$(".wc_social_plugin_wrapper .wp-social-login-provider-list").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):$(".wc_social_plugin_wrapper .the_champ_login_container").length?$(".wc_social_plugin_wrapper .the_champ_login_container").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):$(".wc_social_plugin_wrapper .social_connect_form").length?$(".wc_social_plugin_wrapper .social_connect_form").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):$(".wc_social_plugin_wrapper .oneall_social_login_providers").length&&$(".wc_social_plugin_wrapper .oneall_social_login .oneall_social_login_providers").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"),wpdiscuzLoadRichEditor&&$("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0"),window.addEventListener("beforeunload",function(c){var b=$(".wpd-form").not(":hidden");if(b.length){if(wpdiscuzLoadRichEditor&&document.querySelector(".wpdiscuz-textarea-wrap")){for(var a=0;a<b.length;a++)if("\n"!==wpDiscuzEditor.createEditor($(b[a]).find(".ql-container").attr("id")).getText()){c.preventDefault(),c.returnValue="";return}}else for(var a=0;a<b.length;a++)if($(b[a]).find(".wc_comment").val()){c.preventDefault(),c.returnValue="";return}}}),wpdiscuzLoadRichEditor||($(document).delegate("textarea.wc_comment","input",function(){aD($(this))}),$.each($("textarea.wc_comment"),function(){aD($(this))})),$("body").on("focus","#wpdcom .ql-editor, #wpdcom .wc_comment",function(){$(".wpd-form-foot",$(this).parents(".wpd_comm_form")).slideDown(P)}),$("body").on("focus","#wpdcom textarea",function(){$(this).next(".autogrow-textarea-mirror").length||$(this).autoGrow()}),c||aa({comment_author:Cookies.get("comment_author_"+g),comment_author_email:Cookies.get("comment_author_email_"+g),comment_author_url:Cookies.get("comment_author_url_"+g)}),$(".wpd-vote-down.wpd-dislike-hidden").remove(),$(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd"),$("body").on("click","#wpd-editor-source-code-wrapper-bg",function(){$(this).hide(),$("#wpd-editor-source-code-wrapper").hide(),$("#wpd-editor-uid").val(""),$("#wpd-editor-source-code").val("")}),wpdiscuzLoadRichEditor&&$("body").on("click","#wpd-insert-source-code",function(){var a=wpDiscuzEditor.createEditor("#"+$("#wpd-editor-uid").val());a.deleteText(0,a.getLength(),Quill.sources.USER);var b=$("#wpd-editor-source-code").val();b.length&&a.clipboard.dangerouslyPasteHTML(0,b,Quill.sources.USER),a.update(),$("#wpd-editor-source-code-wrapper-bg").hide(),$("#wpd-editor-source-code-wrapper").hide(),$("#wpd-editor-uid").val(""),$("#wpd-editor-source-code").val("")}),$("body").on("click",".wpd-reply-button",function(){var a=aj($(this),0);$(this).hasClass("wpdiscuz-clonned")?(wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+a).focus()},P):setTimeout(function(){$("#wc-textarea-"+a).trigger("focus")},P),$("#wpd-secondary-form-wrapper-"+a).slideToggle(P)):ah($(this)),function(a){if((q||r)&&"2.0"===e){var b=ak(a);setTimeout(function(){if(!T[b])try{T[b]=grecaptcha.render("wpdiscuz-recaptcha-"+a,{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(b){$("#wpdiscuz-recaptcha-field-"+a).val("key")},"expired-callback":function(){$("#wpdiscuz-recaptcha-field-"+a).val("")}})}catch(c){console.log(c),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+c.message,"error")}},1e3)}}(a)}),$("body").on("click","#wpdcom [data-wpd-clipboard]",function(){var b=$(this).data("wpd-clipboard"),a=$("<input/>");a.appendTo("body").css({position:"absolute",top:"-10000000px"}).val(b),a.trigger("select"),document.execCommand("copy"),a.remove(),wpdiscuzAjaxObj.setCommentMessage(b+"<br/>"+wpdiscuzAjaxObj.wc_copied_to_clipboard,"success",5e3)}),$("body").on("click",".wpdiscuz-nofollow,.wc_captcha_refresh_img,.wpd-load-more-submit",function(a){a.preventDefault()}),$("body").on("click",".wpd-toggle.wpd_not_clicked",function(){var a=$(this);a.removeClass("wpd_not_clicked");var b=aj($(this),0),c=$(this),d=$(".fas",c);!c.parents(".wpd-comment:not(.wpd-reply)").children(".wpd-reply").length&&O?aw(b,a):$("#wpd-comm-"+b+"> .wpd-reply").slideToggle(700,function(){$(this).is(":hidden")?(d.removeClass("fa-chevron-up"),d.addClass("fa-chevron-down"),c.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_show_replies_text),c.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_show_replies_text)):(d.removeClass("fa-chevron-down"),d.addClass("fa-chevron-up"),c.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),c.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text)),a.addClass("wpd_not_clicked")})}),$("body").on("mouseenter",".wpd-new-loaded-comment",function(){$(this).removeClass("wpd-new-loaded-comment")}),$("body").on("click",".wpd-sbs-toggle",function(){$(".wpdiscuz-subscribe-bar").slideToggle(P)}),parseInt(wpdiscuzAjaxObj.wpDiscuzIsShowOnSubscribeForm)&&!c&&wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&$("#wpdiscuz-subscribe-form").length&&("2.0"===e?(setTimeout(function(){try{grecaptcha.render("wpdiscuz-recaptcha-subscribe-form",{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(a){$("#wpdiscuz-recaptcha-field-subscribe-form").val("key")},"expired-callback":function(){$("#wpdiscuz-recaptcha-field-subscribe-form").val("")}})}catch(a){console.log(a),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+a.message,"error")}},1e3),$("body").on("submit","#wpdiscuz-subscribe-form",function(a){$("#wpdiscuz-recaptcha-field-subscribe-form").val()?$(".wpdiscuz-recaptcha",$(this)).css("border","none"):($(".wpdiscuz-recaptcha",$(this)).css("border","1px solid red"),a.preventDefault())})):"3.0"===e&&$("body").on("click","#wpdiscuz_subscription_button",function(b){var c=$(this).parents("#wpdiscuz-subscribe-form");b.preventDefault();try{grecaptcha.ready(function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/wpdAddSubscription"}).then(function(a){console.log(5555),document.getElementById("wpdiscuz-recaptcha-field-subscribe-form").value=a,c.trigger("submit")},function(a){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(a)})})}catch(a){console.log(a),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+a.message,"error")}})),(q||r)&&"2.0"===e){var A=$(window).width(),a=$("#wpdcom").width();a>=1100&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"65%"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"35%"})),a>=940&&a<1100&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"60%"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"40%"})),a>=810&&a<940&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"40%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"60%"})),a>=730&&a<810&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"45%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"55%"})),a>=610&&a<730&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.85)","-webkit-transform":"scale(0.85)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"43%"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"55%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"30%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"70%"})),A>650&&(a>=510&&a<610&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"center 0","-webkit-transform-origin":"center 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"35%"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"63%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"30%",position:"relative",right:"-60px"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"70%"}),$("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"})),a>=470&&a<510&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"center 0","-webkit-transform-origin":"center 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"40%"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"60%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({float:"none",width:"100%",display:"block"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({float:"none",width:"100%",display:"block"}),$("#wpdcom .wpd_main_comm_form .wc-form-footer").css({"margin-left":"0px"}),$("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"})),a<470&&($("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({margin:"0px auto","transform-origin":"center 0","-webkit-transform-origin":"center 0"}),$("#wpdcom .wpd-form-col-left").css({float:"none",width:"100%",display:"block"}),$("#wpdcom .wpd-form-col-right").css({float:"none",width:"100%",display:"block"}),$("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"}),$("#wpdcom .wpd-secondary-form-wrapper .wc_notification_checkboxes").css({"text-align":"center"}),$("#wpdcom .wpd-secondary-form-wrapper .wc-field-submit").css({"text-align":"center"})))}function Y(b,a,c){G(x||L,!1,a).done(function(a){if($(c).addClass("wpd_not_clicked"),"object"==typeof a){if(a.success){"collapsed"===wpdiscuzAjaxObj.commentFormView&&$(".wpd-form-foot",b).slideUp(P),a.data.wc_all_comments_count_new=parseInt(a.data.wc_all_comments_count_new),$(".wpd-thread-info").html(a.data.wc_all_comments_count_before_threads_html),$(".wpd-thread-info").attr("data-comments-count",a.data.wc_all_comments_count_new),$("#wpd-bubble-all-comments-count").replaceWith(a.data.wc_all_comments_count_bubble_html);var d=P;a.data.is_main?az(a.data.message):(d=P+700,$("#wpd-secondary-form-wrapper-"+a.data.uniqueid).slideToggle(700),1==a.data.is_in_same_container?$("#wpd-secondary-form-wrapper-"+a.data.uniqueid).after(a.data.message):$("#wpd-comm-"+a.data.uniqueid).after(a.data.message)),Z(a),_(a),M&&N?ab(a.data):N||$(".wpd-cookies-checkbox").prop("checked",!1),b.get(0).reset(),wpdiscuzLoadRichEditor?wpDiscuzEditor.createEditor("#wpd-editor-"+$(".wpdiscuz_unique_id",b).val()).setContents([{insert:"\n"}]):aD(b.find(".wc_comment")),aa(a.data),$(".wmu-preview-wrap",b).remove(),ay(),parseInt(wpdiscuzAjaxObj.scrollToComment)&&setTimeout(function(){au(),$("html, body").animate({scrollTop:$("#comment-"+a.data.new_comment_id).offset().top-m},1e3,av)},d),aE(a,b)}else a.data&&(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,b),"error"),aE(a,b))}else wpdiscuzAjaxObj.setCommentMessage(a,"error");$("#wpdiscuz-loading-bar").fadeOut(250),V=!1}).fail(function(b,d,a){console.log(a),$(c).addClass("wpd_not_clicked"),$("#wpdiscuz-loading-bar").fadeOut(250)})}function Z(b){if(!b.data.held_moderate){var a=new FormData;a.append("action","wpdCheckNotificationType"),a.append("comment_id",b.data.new_comment_id),a.append("email",b.data.comment_author_email),a.append("isParent",b.data.is_main),G(x,!0,a)}}function _(a){if(a.data.redirect>0&&a.data.new_comment_id){var b=new FormData;b.append("action","wpdRedirect"),b.append("commentId",a.data.new_comment_id),G(x,!0,b).done(function(a){"object"==typeof a&&a.success&&setTimeout(function(){location.href=a.data},2e3)}).fail(function(b,c,a){console.log(a)})}}function aa(a){$(".wpd_comm_form .wc_name").val(a.comment_author),a.comment_author_email&&0>a.comment_author_email.indexOf("@example.com")&&$(".wpd_comm_form .wc_email").val(a.comment_author_email),a.comment_author_url&&$(".wpd_comm_form .wc_website").val(a.comment_author_url)}function ab(b){var c=b.comment_author_email,d=b.comment_author,a=b.comment_author_url;null==K?(Cookies.set("comment_author_email_"+g,c),Cookies.set("comment_author_"+g,d),a.length&&Cookies.set("comment_author_url_"+g,a)):(K=parseInt(K),Cookies.set("comment_author_email_"+g,c,{expires:K,path:"/"}),Cookies.set("comment_author_"+g,d,{expires:K,path:"/"}),a.length&&Cookies.set("comment_author_url_"+g,a,{expires:K,path:"/"})),$(".wpd-cookies-checkbox").length&&$(".wpd-cookies-checkbox").prop("checked",!0)}function ac(a,b){$("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").show(),$("#wpd-comm-"+a+" .wpdiscuz-edit-form-wrap").replaceWith(b),$("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-last-edited").show()}$("body").on("click",".wc_comm_submit.wpd_not_clicked",function(){var d=$(this),f=1,a=$(this).parents("form");if("true"===a.attr("data-uploading")){wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhraseDoingUpload,"wmuPhraseDoingUpload",a),"warning");return}if(a.hasClass("wpd_main_comm_form")||(f=an($(this).parents(".wpd-comment"))),as(a,"#wpd-editor-"+$(".wpdiscuz_unique_id",a).val()),a.on("submit",function(a){a.preventDefault()}),a[0].checkValidity()&&(h=a,i=!0,"2.0"===e&&$("input[name=wc_captcha]",h).length&&!$("input[name=wc_captcha]",h).val().length?(i=!1,$(".wpdiscuz-recaptcha",h).css("border","1px solid red")):"2.0"===e&&$("input[name=wc_captcha]",h).length&&$(".wpdiscuz-recaptcha",h).css("border","none"),i)){V=!0,ax(a),$(d).removeClass("wpd_not_clicked");var h,i,b=new FormData;if(b.append("action","wpdAddComment"),$(":input",a).each(function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&b.append(this.name+"",$(this).val().trim()),("checkbox"==this.type||"radio"==this.type)&&$(this).is(":checked")&&b.append(this.name+"",$(this).val())}),b.append("wpd_comment_depth",f),wpdiscuzAjaxObj.wpdiscuz_zs&&b.append("wpdiscuz_zs",wpdiscuzAjaxObj.wpdiscuz_zs),$(".wpd-cookies-checkbox",a).length?$(".wpd-cookies-checkbox",a).prop("checked")||(N=!1):c&&(N=!1),$("#wpdiscuz-loading-bar").show(),wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&"3.0"===e&&(1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!wpdiscuzAjaxObj.is_user_logged_in||1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&wpdiscuzAjaxObj.is_user_logged_in))try{grecaptcha.ready(function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/addComment"}).then(function(c){b.append("g-recaptcha-response",c),Y(a,b,d)},function(a){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(a)})})}catch(g){console.log(g),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+g.message,"error"),$("#wpdiscuz-loading-bar").fadeOut(250)}else Y(a,b,d)}(function(a){if((q||r)&&"2.0"===e){var b=ak(a);grecaptcha.reset(T[b])}})($(".wpdiscuz_unique_id",a).val()),ar()}),$("body").on("click",".wpd_editable_comment",function(){H&&$(".wpdiscuz-edit-form-wrap").length&&ac(aj($(".wpdiscuz-edit-form-wrap"),0),H);var c=$(this),b=aj(c,0),d=ak(b),a=new FormData;a.append("action","wpdEditComment"),a.append("commentId",d),H=$("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-text").get(0),G(x,!0,a).done(function(a){if("object"==typeof a){if(a.success){if($("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text").replaceWith(a.data.html),wpdiscuzLoadRichEditor){var d=wpDiscuzEditor.createEditor("#wpd-editor-edit_"+b);d.clipboard.dangerouslyPasteHTML(0,a.data.content),d.update(),$(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd")}else $("#wc-textarea-edit_"+b).val(a.data.content),aD($("#wc-textarea-edit_"+b));$("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").hide(),$("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-last-edited").hide()}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,c),"error")}else console.log(a);$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("click",".wc_save_edited_comment",function(){var d=$(this),b=aj(d),e=ak(b),a=$("#wpd-comm-"+b+" #wpdiscuz-edit-form");if(as(a,"#wpd-editor-edit_"+b),a.on("submit",function(a){a.preventDefault()}),a[0].checkValidity()){var c=new FormData;c.append("action","wpdSaveEditedComment"),c.append("commentId",e),$(":input",a).each(function(){""!==this.name&&"checkbox"!==this.type&&"radio"!==this.type&&c.append(this.name+"",$(this).val()),("checkbox"===this.type||"radio"===this.type)&&$(this).is(":checked")&&c.append(this.name+"",$(this).val())}),G(x,!0,c).done(function(a){"object"==typeof a?(a.success?(ac(b,a.data.message),a.data.comment_approved_html&&$("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-subheader").append(a.data.comment_approved_html),a.data.lastEdited&&($("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-last-edited").remove(),$(a.data.lastEdited).insertAfter("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text")),a.data.twitterShareLink&&$("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_tw").attr("href",a.data.twitterShareLink),a.data.whatsappShareLink&&$("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_whatsapp").attr("href",a.data.whatsappShareLink),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+b)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,d),"error"),aE(a,e)):console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}}),$("body").on("click",".wc_cancel_edit",function(){var a=aj($(this));ac(a,H),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+a)}),!i&&f&&(z=0,1==f?setTimeout(function(){ae(!0)},500):$("body").on("click",".wpd-load-comments",function(){$(this).parent(".wpd-load-more-submit-wrap").remove(),ae(!0)})),$("body").on("click",".wpd-load-more-submit",function(){var a=$(this),b="wpd-loaded";a.hasClass(b)&&ae(!1,a,b,"wpd-loading")});var ad=!1;function B(){var a=document.getElementById("wpdiscuzHasMoreComments"),b=0;a&&(b=a.dataset.is_show_load_more);var c=document.getElementById("wpdcom")?document.getElementById("wpdcom").clientHeight:0,d=$(window).height()+$(window).scrollTop();c&&d&&100*d/c>=80&& !1===ad&&1==b&&(ad=!0,ae(!1,$(".wpd-load-more-submit")))}function ae(c,b,e,g){b&&(b.toggleClass(e),b.toggleClass(g));var a=new FormData;a.append("action","wpdLoadMoreComments");var d=$(".wpdiscuz-sort-button-active").attr("data-sorting");d&&a.append("sorting",d),a.append("offset",z),a.append("lastParentId",al()),a.append("isFirstLoad",c?1:0);var h=$(".wpdf-active").attr("data-filter-type");a.append("wpdType",h||""),G(x,!c||1!=f,a).done(function(a){"object"==typeof a&&a.success&&(z++,c&&$(".wpd-comment").remove(),$(".wpdiscuz_single").remove(),$(".wpdiscuz-comment-pagination").before(a.data.comment_list),C(a,c&&2!==s),ad=!1,a.data.loadLastCommentId&&(w=a.data.loadLastCommentId),aE(a),c&&D(!1)),$("#wpdiscuz-loading-bar").fadeOut(250),$(".wpd-load-more-submit").blur(),b&&(b.toggleClass(e),b.toggleClass(g))}).fail(function(c,d,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250),$(".wpd-load-more-submit").blur(),b&&(b.toggleClass(e),b.toggleClass(g))})}function C(a,d){var b=document.getElementById("wpdiscuzHasMoreComments");if(!1==a.data.is_show_load_more)b&&(b.dataset.is_show_load_more=0),$(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide();else if(am(a.data.last_parent_id),b&&(b.dataset.is_show_load_more=1),d&&$(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").show(),a.data.comments_left>0){if(!$(".wpd-load-more-submit .wpd-comments-left").length){let c=$("<span>");c.addClass("wpd-comments-left"),$(".wpd-load-more-submit").append(c)}$(".wpd-load-more-submit .wpd-comments-left").text(a.data.comments_left_text)}aE(a)}function D(d){var b=location.href.match(/#comment\-(\d+)/);if(null!==b){var c=b[1];if($("#comment-"+c).length)setTimeout(function(){au(),$("html, body").animate({scrollTop:$("#comment-"+c).parents("[id^=wpd-comm-]").offset().top-m},1e3,av),d&&af(c)},500);else{var a=new FormData;a.append("action","wpdGetSingleComment"),a.append("commentId",c),G(x,!0,a).done(function(a){if("object"==typeof a&&a.success){var b="#comment-"+c;$("#comment-"+a.data.parentCommentID).length?$("#comment-"+a.data.parentCommentID).parents("[id^=wpd-comm-"+a.data.parentCommentID+"]").replaceWith(a.data.message):$(".wpd-thread-list").prepend(a.data.message),aE(a),au(),$("html, body").animate({scrollTop:$(b).offset().top-m},1e3,av),d&&af(c)}$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}}}function af(a){setTimeout(function(){$("#comment-"+a).siblings(".wpd-secondary-form-wrapper").is(":visible")||$("#comment-"+a).find(".wpd-reply-button").trigger("click")},1100)}function ag(b){if(void 0!==b.data.message)for(var c,d=b.data.message,a=0;a<d.length;a++)ap((c=d[a]).comment_parent,c.comment_html)}function ah(b){var a=aj(b,0);$("#wpdiscuz_form_anchor-"+a).before(ai(a));var d=$("#wpd-secondary-form-wrapper-"+a);c||aa({comment_author:Cookies.get("comment_author_"+g),comment_author_email:Cookies.get("comment_author_email_"+g),comment_author_url:Cookies.get("comment_author_url_"+g)}),wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+a).focus()},P):setTimeout(function(){$("#wc-textarea-"+a).trigger("focus")},P),d.slideToggle(P,function(){b.addClass("wpdiscuz-clonned")})}function ai(a){return $("#wpdiscuz_hidden_secondary_form").html().replace(/wpdiscuzuniqueid/g,a)}function aj(a,c){var b="";return(b=c?a.parents(".wpd-main-form-wrapper").attr("id"):a.parents(".wpd-comment").attr("id")).substring(b.lastIndexOf("-")+1)}function ak(a){return a.substring(0,a.indexOf("_"))}function al(){return $(".wpd-load-more-submit").attr("data-lastparentid")}function am(a){$(".wpd-load-more-submit").attr("data-lastparentid",a),2!==s&&$(".wpdiscuz-comment-pagination").show()}function an(a){var b=a.attr("class").split(" "),c="";return $.each(b,function(b,a){"wpd_comment_level"===ao(a,!1)&&(c=ao(a,!0))}),parseInt(c)+1}function ao(a,b){return b?a.substring(a.indexOf("-")+1):a.substring(0,a.indexOf("-"))}function ap(a,b){if(0==a)az(b);else{var c=aj($("#comment-"+a),0);$("#wpdiscuz_form_anchor-"+c).after(b)}}function aq(){var a=[];return $(".wpd-comment-right").each(function(){a.push(ak(aj($(this),0)))}),a.join(",")}function ar(){$(".wpdiscuz_reset").val("")}function as(a,b){var c=a.find(".wpd-required-group");wpdiscuzLoadRichEditor&&a.find(".wc_comment").val($(b+">.ql-editor").html()),at(a),$.each(c,function(){$("input",this).prop("required",!1),0===$("input:checked",this).length?$("input",$(this)).prop("required",!0):$(".wpd-field-invalid",this).remove()})}function at(c){var b=c.find(".wc_comment"),a=b.val().trim().replace(/<p><br><\/p>/g,"\n").replace(/<p>(.*?)<\/p>/g,"$1\n");a=(a=(a=(a=a.replace(/<img src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img[^>]+alt=["|']([^"|']+)["|'][^>]+src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'][^>]?>/g," $1 ")).replace(/<img\s+([^>]*)class=["|']wpdem\-sticker["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img\s+([^>]*)src=["|']([^"|']+)["|'](.*?)[^>]*>/g," $2 "),b.val(a)}function au(){$("html, body").css("scroll-behavior","unset")}function av(){$("html").css("scroll-behavior",W),$("body").css("scroll-behavior",X)}function aw(b,d){var c=ak(b),a=new FormData;a.append("action","wpdShowReplies"),a.append("commentId",c),G(x,!0,a).done(function(a){d.addClass("wpd_not_clicked"),"object"==typeof a&&a.success&&($("#wpd-comm-"+b).replaceWith(a.data.comment_list),$("#wpd-comm-"+b+" .wpd-toggle .fas").removeClass("fa-chevron-down").addClass("fa-chevron-up"),$("#wpd-comm-"+b+" .wpd-toggle .wpd-view-replies .wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),$("#wpd-comm-"+b+" .wpd-toggle").attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text),aE(a)),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),d.addClass("wpd_not_clicked"),$("#wpdiscuz-loading-bar").fadeOut(250)})}function ax(a){$(".wpd-agreement-checkbox",a).each(function(){$(this).hasClass("wpd_agreement_hide")&&M&&$(this).prop("checked")&&(Cookies.set($(this).attr("name")+"_"+g,1,{expires:30,path:"/"}),$("input[name="+$(this).attr("name")+"]").each(function(){S.push($(this))}))})}function ay(){S.length&&(S.forEach(function(a){a.parents(".wpd-field-checkbox").remove()}),S=[])}function az(a){$(".wpd-sticky-comment").last()[0]?$(a).insertAfter($(".wpd-sticky-comment").last()[0]):$(".wpd-thread-list").prepend(a)}function E(a){a?a.prop("required")||(a.val()?a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none")):$.each($(".wc_email"),function(c,b){var a=$(b);a.prop("required")||(a.val()?a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none"))})}if(2!==s||i||($(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide(),B(),$(window).scroll(function(){B()})),wpdiscuzAjaxObj.setLoadMoreVisibility=C,$("body").on("click",".wpd-vote-up.wpd_not_clicked, .wpd-vote-down.wpd_not_clicked",function(){var b,c=$(this);$(c).removeClass("wpd_not_clicked");var d=aj(c),e=ak(d);b=$(this).hasClass("wpd-vote-up")?1:-1;var a=new FormData;a.append("action","wpdVoteOnComment"),a.append("commentId",e),a.append("voteType",b),G(x,!0,a).done(function(a){if($(c).addClass("wpd_not_clicked"),"object"==typeof a){if(a.success){if("total"===a.data.buttonsStyle){var d=$(".wpd-comment-footer .wpd-vote-result",$("#comment-"+e)),h=a.data.votes;d.text(a.data.votesHumanReadable),d.attr("title",h),d.removeClass("wpd-up wpd-down"),h>0&&d.addClass("wpd-up"),h<0&&d.addClass("wpd-down")}else{var f=$(".wpd-comment-footer .wpd-vote-result-like",$("#comment-"+e)),g=$(".wpd-comment-footer .wpd-vote-result-dislike",$("#comment-"+e));f.text(a.data.likeCountHumanReadable),f.attr("title",a.data.likeCount),g.text(a.data.dislikeCountHumanReadable),g.attr("title",a.data.dislikeCount),parseInt(a.data.likeCount)>0?f.addClass("wpd-up"):f.removeClass("wpd-up"),0>parseInt(a.data.dislikeCount)?g.addClass("wpd-down"):g.removeClass("wpd-down")}var i=$(".wpd-comment-footer .wpd-vote-up",$("#comment-"+e)),j=$(".wpd-comment-footer .wpd-vote-down",$("#comment-"+e));i.removeClass("wpd-up"),j.removeClass("wpd-down"),a.data.curUserReaction>0?i.addClass("wpd-up"):a.data.curUserReaction<0&&j.addClass("wpd-down")}else a.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,c),"error");aE(a,e,b)}else console.log(a);$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,d,a){console.log(a),$(c).addClass("wpd_not_clicked"),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$(document).on("click","body",function(b){var a=$(".wpdiscuz-sort-buttons");$(b.target).hasClass("wpdf-sorting")||$(b.target).parent().hasClass("wpdf-sorting")?a.css({display:a.is(":visible")?"none":"flex"}):a.hide()}),$("body").on("click",".wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)",function(){var c=$(this),b=$(this).attr("data-sorting");if(b){$(".wpdiscuz-sort-button.wpdiscuz-sort-button-active").removeClass("wpdiscuz-sort-button-active").appendTo(".wpdiscuz-sort-buttons"),c.addClass("wpdiscuz-sort-button-active").prependTo(".wpdf-sorting");var a=new FormData;a.append("action","wpdSorting"),a.append("sorting",b);var d=$(".wpdf-active").attr("data-filter-type");a.append("wpdType",d||""),G(x,!0,a).done(function(a){"object"==typeof a&&a.success&&($("#wpdcom .wpd-comment").remove(),$("#wpdcom .wpd-thread-list").prepend(a.data.message),C(a,!1),z=1),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}}),window.onhashchange=function(){D(!1)},1!=f&&D(!1),$("body").on("click",".wpdiscuz-readmore",function(){var b=aj($(this)),c=ak(b),a=new FormData;a.append("action","wpdReadMore"),a.append("commentId",c),G(x,!0,a).done(function(a){"object"==typeof a?(a.success?($("#comment-"+c+" .wpd-comment-text").replaceWith(" "+a.data.message),$("#wpdiscuz-readmore-"+b).remove()):console.log(a.data),aE(a)):console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("change",".wpd-required-group",function(){0!==$("input:checked",this).length?$("input",$(this)).prop("required",!1):$("input",$(this)).prop("required",!0)}),$("body").on("click",".wpdiscuz-spoiler",function(){$(this).next().slideToggle(),$(this).hasClass("wpdiscuz-spoiler-closed")?$(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-plus").removeClass("fa-plus").addClass("fa-minus"):$(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-minus").removeClass("fa-minus").addClass("fa-plus"),$(this).toggleClass("wpdiscuz-spoiler-closed")}),$("body").on("click",".wpd-tools i",function(){var a=$(this).siblings(".wpd-tools-actions");a.is(":visible")||$(this).parents(".wpd-comment-right").attr("id")!==$("[id^=comment-]","#wpdcom").last().attr("id")||$("#comments").css({paddingBottom:"160px"}),a.css({display:a.is(":visible")?"none":"flex"})}),$("body").on("mouseleave",".wpd-comment-right",function(){$(this).find(".wpd-tools-actions").hide(),$("#comments").css({paddingBottom:"0"})}),$("body").on("click",".wpd_stick_btn",function(){var b=aj($(this),0),c=ak(b),a=new FormData;a.append("action","wpdStickComment"),a.append("commentId",c),G(x,!0,a).done(function(a){"object"==typeof a&&a.success&&location.reload(!0),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("click",".wpd_close_btn",function(){var b=aj($(this),0),c=ak(b),a=new FormData;a.append("action","wpdCloseThread"),a.append("commentId",c),G(x,!0,a).done(function(a){"object"==typeof a&&a.success&&location.reload(!0),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("click",".wpd-filter.wpd_not_clicked[data-filter-type]",function(){var b=$(this),c=b.attr("data-filter-type");wpdiscuzAjaxObj.resetActiveFilters(".wpdf-"+c),b.removeClass("wpd_not_clicked"),$(".fas",b).addClass("fa-pulse fa-spinner");var a=new FormData;a.append("action","wpdLoadMoreComments");var d=$(".wpdiscuz-sort-button-active").attr("data-sorting");d&&a.append("sorting",d),a.append("lastParentId",0),a.append("offset",0),z=1,a.append("wpdType",b.hasClass("wpdf-active")?"":c),a.append("isFirstLoad",1),$(this).hasClass("wpdf-inline")?$(this).hasClass("wpdf-active")?$(".wpd-comment-info-bar").hide():$(".wpd-comment-info-bar").css("display","flex"):$(".wpd-comment-info-bar").hide(),G(x,!1,a).done(function(a){b.addClass("wpd_not_clicked"),$(".fas",b).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(b.toggleClass("wpdf-active"),$(".wpd-load-comments").remove(),$(".wpd-comment").remove(),$(".wpd-thread-list").prepend(a.data.comment_list),C(a),w=a.data.loadLastCommentId,$(".wpd-load-more-submit").blur(),aE(a)),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("click",".wpdf-reacted.wpd_not_clicked",function(){var a=$(this);a.removeClass("wpd_not_clicked"),$(".fas",a).addClass("fa-pulse fa-spinner");var b=new FormData;b.append("action","wpdMostReactedComment"),G(x,!1,b).done(function(b){a.addClass("wpd_not_clicked"),$(".fas",a).removeClass("fa-pulse fa-spinner"),"object"==typeof b&&b.success&&($("#comment-"+b.data.parentCommentID).length?$("#comment-"+b.data.parentCommentID).parents("[id^=wpd-comm-"+b.data.parentCommentID+"]").replaceWith(b.data.message):$("#comment-"+b.data.commentId).length||$(".wpd-thread-list").prepend(b.data.message),aE(b),au(),$("html, body").animate({scrollTop:$("#comment-"+b.data.commentId).offset().top-m},1e3,av))}).fail(function(c,d,b){console.log(b),$(".fas",a).removeClass("fa-pulse fa-spinner")})}),$("body").on("click",".wpdf-hottest.wpd_not_clicked",function(){var a=$(this);a.removeClass("wpd_not_clicked"),$(".fas",a).addClass("fa-pulse fa-spinner");var b=new FormData;b.append("action","wpdHottestThread"),G(x,!1,b).done(function(b){a.addClass("wpd_not_clicked"),$(".fas",a).removeClass("fa-pulse fa-spinner"),"object"==typeof b&&b.success&&($("#comment-"+b.data.commentId).length?$("#comment-"+b.data.commentId).parents("[id^=wpd-comm-"+b.data.commentId+"]").replaceWith(b.data.message):$(".wpd-thread-list").prepend(b.data.message),aE(b),au(),$("html, body").animate({scrollTop:$("#comment-"+b.data.commentId).offset().top-m},1e3,av))}).fail(function(c,d,b){console.log(b),$(".fas",a).removeClass("fa-pulse fa-spinner")})}),$("body").on("click",".wpd-filter-view-all",function(){$(".wpdf-inline.wpdf-active.wpd_not_clicked").trigger("click")}),$("body").on("click",".wpd-follow-link.wpd_not_clicked",function(){var a=$(this);a.removeClass("wpd_not_clicked"),$(".fas",a).addClass("fa-pulse fa-spinner");var c=aj(a,0),d=ak(c),b=new FormData;b.append("action","wpdFollowUser"),b.append("commentId",d),G(x,!0,b).done(function(b){a.addClass("wpd_not_clicked"),"object"==typeof b?b.success?(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[b.data.code],b.data.code,a),"success"),a.removeClass("wpd-follow-active"),b.data.followTip&&a.attr("wpd-tooltip",b.data.followTip),b.data.followClass&&a.addClass(b.data.followClass),aE(b)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[b.data],b.data,a),"error"):console.log(b),$(".fas",a).removeClass("fa-pulse fa-spinner"),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(c,d,b){console.log(b),$(".fas",a).removeClass("fa-pulse fa-spinner"),$("#wpdiscuz-loading-bar").fadeOut(250)})}),E(),$("body").on("keyup",".wc_email",function(){E($(this))}),j&&$("#wpdcom").length){if($("#wpd-bubble-wrapper").hover(function(){$(this).addClass("wpd-bubble-hover")},function(){$(this).removeClass("wpd-bubble-hover")}),k&&!Cookies.get(wpdiscuzAjaxObj.cookieHideBubbleHint)&&setTimeout(function(){$("#wpd-bubble-wrapper").addClass("wpd-bubble-hover"),Cookies.set(wpdiscuzAjaxObj.cookieHideBubbleHint,"1",{expires:7,path:"/"}),setTimeout(function(){$("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")},1e3*Q)},1e3*k),"content_left"===h){if($(".entry-content").length){var b=Math.min($(".entry-content").offset().left,$("#wpdcom").offset().left)-120,d=b>25?b:25;$("#wpd-bubble-wrapper").css({left:d+"px"}),$("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if($(".post-entry").length){var b=Math.min($(".post-entry").offset().left,$("#wpdcom").offset().left)-120,d=b>25?b:25;$("#wpd-bubble-wrapper").css({left:d+"px"}),$("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if($(".container").length){var b=Math.min($(".container").offset().left,$("#wpdcom").offset().left)-120,d=b>25?b:25;$("#wpd-bubble-wrapper").css({left:d+"px"}),$("#wpd-bubble-wrapper").addClass("wpd-left-content")}else $("#wpd-bubble-wrapper").css({left:"25px"}),$("#wpd-bubble-wrapper").addClass("wpd-left-corner")}else"left_corner"===h?($("#wpd-bubble-wrapper").css({left:"25px"}),$("#wpd-bubble-wrapper").addClass("wpd-left-corner")):"right_corner"===h&&($("#wpd-bubble-wrapper").css({right:"25px"}),$("#wpd-bubble-wrapper").addClass("wpd-right-corner"));$("#wpd-bubble-wrapper").show(),$("body").on("click","#wpd-bubble-add-message-close",function(a){a.preventDefault(),a.stopPropagation(),$("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")}),$("body").on("click","#wpd-bubble",function(){au(),$("#tab-title-reviews").length&&$("#tab-title-reviews a").trigger("click"),$("html, body").animate({scrollTop:$("#wpdcom").offset().top-(m+28)},1e3,function(){av(),$("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover"),wpdiscuzLoadRichEditor?$("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0").focus():$("#wc-textarea-0_0").length&&$("#wc-textarea-0_0").trigger("focus")})}),$("body").on("click","#wpd-bubble-comment-close",function(a){a.preventDefault(),$("#wpd-bubble-notification-message").hide(),$("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")}),$("body").on("click","#wpd-bubble-comment-reply-link a",function(){var a=$(this).attr("href");setTimeout(function(){$("#wpd-bubble-notification-message").hide(),$("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),D(!0);var b=a.match(/#comment\-(\d+)/);U=U.filter(function(a){return a!=b[1]}),$("#wpd-bubble-count .wpd-new-comments-count").text(U.length),0==U.length&&$("#wpd-bubble-count").removeClass("wpd-new-comments")},100)}),$("body").on("click","#wpd-bubble-count",function(){if(U.length){var a=new FormData;a.append("action","wpdBubbleUpdate"),a.append("newCommentIds",U.join()),G(x,!0,a).done(function(a){"object"==typeof a&&a.success&&(a.data.message=a.data.message.filter(function(a){if(!$("#comment-"+a.comment_id).length)return a}),ag(a),$("#wpd-bubble-count").removeClass("wpd-new-comments"),$("#wpd-bubble-count .wpd-new-comments-count").text("0"),U=[],$(".wpd-new-loaded-comment").length&&(au(),$("html, body").animate({scrollTop:$($(".wpd-new-loaded-comment")[0]).offset().top-(m+28)},1e3,av)),aE(a)),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a)})}})}function F(){$.ajax({type:"GET",url:wpdiscuzAjaxObj.bubbleUpdateUrl,beforeSend:function(a){a.setRequestHeader("X-WP-Nonce",wpdiscuzAjaxObj.restNonce)},data:{postId:I,lastId:J,visibleCommentIds:aq()}}).done(function(a){if(!V){if("object"==typeof a){if(a.commentIDsToRemove.forEach(function(a){$("[id^=wpd-comm-"+a+"]").remove()}),a.ids.length){if(t){var b;(b=new FormData).append("action","wpdUpdateAutomatically"),b.append("loadLastCommentId",w),b.append("visibleCommentIds",aq()),G(x,!1,b).done(function(a){!V&&"object"==typeof a&&a.success&&(ag(a),a.data.wc_all_comments_count_new=parseInt(a.data.wc_all_comments_count_new),$(".wpd-thread-info").html(a.data.wc_all_comments_count_before_threads_html),$(".wpd-thread-info").attr("data-comments-count",a.data.wc_all_comments_count_new),$("#wpd-bubble-all-comments-count").replaceWith(a.data.wc_all_comments_count_bubble_html),w=a.data.loadLastCommentId)}).fail(function(b,c,a){console.log(a)})}a.ids=a.ids.filter(function(a){if(!$("#comment-"+a).length)return a});var c=5e3;J=parseInt(a.ids[a.ids.length-1]),U=U.concat(a.ids),R&&a.commentText&&($("#wpd-bubble-author-avatar").html(a.avatar),$("#wpd-bubble-author-name").html(a.authorName),$("#wpd-bubble-comment-date span").html(a.commentDate),$("#wpd-bubble-comment-text").html(a.commentText),$("#wpd-bubble-comment-reply-link a").attr("href",a.commentLink),$("#wpd-bubble-notification-message").show(),c=1e4);var d=parseInt($(".wpd-new-comments-count").text());d+=a.ids.length,$("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),$("#wpd-bubble-wrapper").addClass("wpd-new-comment-added"),setTimeout(function(){$("#wpd-bubble-notification-message").hide(),$("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")},c),$(".wpd-new-comments-count").text(d),$("#wpd-bubble-count").addClass("wpd-new-comments")}a.all_comments_count=parseInt(a.all_comments_count),$("#wpd-bubble-all-comments-count").replaceWith(a.all_comments_count_bubble_html),$(".wpd-reviews-tab").length||($(".wpd-thread-info").html(a.all_comments_count_before_threads_html),$(".wpd-thread-info").attr("data-comments-count",a.all_comments_count))}else console.log(a)}setTimeout(F,u)}).fail(function(b,c,a){console.log(a),setTimeout(F,u)})}if((j&&y||t)&&(c|| !c&&v)&&setTimeout(F,u),$(".wpd-inline-form-wrapper").length){var n=new FormData;n.append("action","wpdGetInlineCommentForm"),G(x,!1,n).done(function(a){"object"==typeof a?a.success?($(".wpd-inline-form-wrapper").append(a.data),$.each($("[name=_wpd_inline_nonce]"),function(){var b=$(this).attr("id"),a=$(this).parents(".wpd-inline-shortcode").attr("id");$(this).attr("id",b+"-"+a.substring(a.lastIndexOf("-")+1))}),$(".wpd-inline-opened").addClass("wpd-active"),$(".wpd-inline-opened").find(".wpd-inline-form-wrapper").show(),$(".wpd-inline-opened").find(".wpd-inline-icon").addClass("wpd-open"),$(".wpd-inline-opened").find(".wpd-inline-icon").removeClass("wpd-ignored"),aC()):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data]),a.data,"error"):console.log(a)}).fail(function(b,c,a){console.log(a)})}function aA(a){if($(a).hasClass("wpd-inline-shortcode"))var b=$(a).attr("id");else var b=$(a).parents(".wpd-inline-shortcode").attr("id");return b.substring(b.lastIndexOf("-")+1)}function aB(){$(".wpd-inline-form-wrapper").hide(),$(".wpd-inline-shortcode").removeClass("wpd-active"),$(".wpd-inline-icon").removeClass("wpd-open")}function o(){$.each($(".wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon"),function(){var a=$(this),b=a.offset().top-window.pageYOffset;a.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&b>0&&b<300&&("blink"===l?(a.addClass("wpd-blink"),setTimeout(function(){a.removeClass("wpd-blink")},3e3)):(a.parents(".wpd-inline-shortcode").addClass("wpd-active"),a.siblings(".wpd-inline-form-wrapper").show(),a.addClass("wpd-open"),aC(a.siblings(".wpd-inline-form-wrapper"))))})}function aC(a){if(a){if(a.offset().left<=10){a.css("left",Math.ceil(parseInt(a.css("left"))-a.offset().left+10));var b=Math.ceil(a.siblings(".wpd-inline-icon.wpd-open").offset().left-a.offset().left+2);b<3&&(b=3),document.styleSheets[0].addRule("#"+a.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+b+"px;")}else if(a.offset().left+a.width()>document.body.clientWidth-10){a.css("left",Math.ceil(parseInt(a.css("left"))+(document.body.clientWidth-(a.offset().left+a.width()))-10));var b=Math.ceil(a.siblings(".wpd-inline-icon.wpd-open").offset().left-a.offset().left+2);b>a.width()-3&&(b=a.width()-3),document.styleSheets[0].addRule("#"+a.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+b+"px;")}}else $.each($(".wpd-inline-form-wrapper:visible"),function(){if($(this).offset().left<=10){$(this).css("left",Math.ceil(parseInt($(this).css("left"))-$(this).offset().left+10));var a=Math.ceil($(this).siblings(".wpd-inline-icon.wpd-open").offset().left-$(this).offset().left+2);a<3&&(a=3),document.styleSheets[0].addRule("#"+$(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"px;")}else if($(this).offset().left+$(this).width()>document.body.clientWidth-10){$(this).css("left",Math.ceil(parseInt($(this).css("left"))+(document.body.clientWidth-($(this).offset().left+$(this).width()))-10));var a=Math.ceil($(this).siblings(".wpd-inline-icon.wpd-open").offset().left-$(this).offset().left+2);a>$(this).width()-3&&(a=$(this).width()-3),document.styleSheets[0].addRule("#"+$(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"px;")}})}function aD(a){var b,c=0;if(a.parents(".wpd_main_comm_form").length)c=parseInt(wpdiscuzAjaxObj.commentTextMaxLength),b=a.parents(".wpd_main_comm_form");else if(a.parents(".wpd-secondary-form-wrapper").length)c=parseInt(wpdiscuzAjaxObj.replyTextMaxLength),b=a.parents(".wpd-secondary-form-wrapper");else if(a.parents("#wpdiscuz-edit-form").length){var e=aj(a);c=parseInt(e.substring(e.lastIndexOf("_")+1))?parseInt(wpdiscuzAjaxObj.replyTextMaxLength):parseInt(wpdiscuzAjaxObj.commentTextMaxLength),b=a.parents("#wpdiscuz-edit-form")}if(c&&b){var g=a.val().length,d=$(".wpd-editor-char-counter",b),f=c-g;d.html(f),f<=10?d.addClass("error"):d.removeClass("error")}}function aE(a,b,c,d){a.data.callbackFunctions&&$.each(a.data.callbackFunctions,function(e){"function"==typeof wpdiscuzAjaxObj[a.data.callbackFunctions[e]]?wpdiscuzAjaxObj[a.data.callbackFunctions[e]](a,b,c,d):"function"==typeof window[a.data.callbackFunctions[e]]?window[a.data.callbackFunctions[e]](a,b,c,d):console.log(a.data.callbackFunctions[e]+" is not a function")})}function G(c,d,a){d&&$("#wpdiscuz-loading-bar").show(),a.append("postId",I),a.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce);var b=a.get("action");wpdiscuzAjaxObj.dataFilterCallbacks&&wpdiscuzAjaxObj.dataFilterCallbacks[b]&&$.each(wpdiscuzAjaxObj.dataFilterCallbacks[b],function(e){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[b][e]]&&(a=wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[b][e]](a,c,d))});var e=c?wpdiscuzAjaxObj.url:wpdiscuzAjaxObj.customAjaxUrl;return $.ajax({type:"POST",url:e,data:a,contentType:!1,processData:!1})}function p(){if(c||wpdiscuzAjaxObj.validateNonceForGuests){var a=new FormData;a.append("action","wpdGetNonce"),G(x,!1,a).done(function(a){"object"==typeof a?a.success?wpdiscuzAjaxObj.wpdiscuz_nonce=a.data:wpdiscuzAjaxObj.setCommentMessage(a.data,"error"):console.log(a)}).fail(function(b,c,a){console.log(a)})}}$(document).on("click","body",function(a){if($(a.target).hasClass("wpd-inline-form-close")||$(a.target).parents(".wpd-inline-form-close").length)a.preventDefault(),$(a.target).parents(".wpd-inline-form-wrapper").hide(),$(a.target).parents(".wpd-inline-shortcode").removeClass("wpd-active"),$(a.target).parents(".wpd-inline-form-wrapper").siblings(".wpd-inline-icon").removeClass("wpd-open");else if(!$(a.target).hasClass("wpd-inline-form-wrapper")&&!$(a.target).parents(".wpd-inline-form-wrapper").length){aB();var b="";$(a.target).hasClass("wpd-inline-icon")?b=$(a.target):$(a.target).parents(".wpd-inline-icon").length&&(b=$(a.target).parents(".wpd-inline-icon")),b.length&&b.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&(b.parents(".wpd-inline-shortcode").addClass("wpd-active"),b.siblings(".wpd-inline-form-wrapper").show(),b.addClass("wpd-open"),b.removeClass("wpd-ignored"),aC(b.siblings(".wpd-inline-form-wrapper")))}(!$(a.target).hasClass("wpd-last-inline-comments-wrapper")&&!$(a.target).parents(".wpd-last-inline-comments-wrapper").length||$(a.target).parents(".wpd-last-inline-comments-wrapper").length&&$(a.target).hasClass("wpd-load-inline-comment"))&&$(".wpd-last-inline-comments-wrapper").remove()}),$("body").on("click",".wpd-inline-submit.wpd_not_clicked",function(c){c.preventDefault();var d=$(this),a=$(this).parents(".wpd_inline_comm_form");if(a[0].checkValidity()){$(this).removeClass("wpd_not_clicked");var b=new FormData;b.append("action","wpdAddInlineComment"),b.append("inline_form_id",aA(a)),$.each($("input, textarea",a),function(c,a){"checkbox"===this.type?$(this).is(":checked")&&b.append($(a).attr("name"),$(a).val()):b.append($(a).attr("name"),$(a).val())}),G(x,!0,b).done(function(b){if(d.addClass("wpd_not_clicked"),"object"==typeof b){if(b.success){a[0].reset(),aB();var e=parseInt(b.data.newCount),c=d.parents(".wpd-inline-icon-wrapper").find(".wpd-inline-icon-count");c.text(e),e?c.addClass("wpd-has-comments"):c.removeClass("wpd-has-comments"),b.data.allCommentsCountNew=parseInt(b.data.allCommentsCountNew),$(".wpd-thread-info").html(b.data.allCommentsCountBeforeThreadsHtml),$(".wpd-thread-info").attr("data-comments-count",b.data.allCommentsCountNew),$("#wpd-bubble-all-comments-count").replaceWith(b.data.allCommentsCountBubbleHtml),b.data.message&&az(b.data.message),wpdiscuzAjaxObj.setCommentMessage(b.data.notification,"success")}else b.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[b.data],b.data,d),"error")}else wpdiscuzAjaxObj.setCommentMessage(b,"error");$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}}),$("body").on("keydown",".wpd-form",function(a){a.ctrlKey&&13==a.keyCode&&$(this).find(".wc_comm_submit").trigger("click")}),$("body").on("keydown","#wpdiscuz-edit-form",function(a){a.ctrlKey&&13==a.keyCode&&$(this).find(".wc_save_edited_comment").trigger("click")}),$("body").on("keydown",".wpd-inline-comment-content",function(a){a.ctrlKey&&13==a.keyCode&&$(this).parents(".wpd_inline_comm_form").find(".wpd-inline-submit.wpd_not_clicked").trigger("click")}),$("body").on("click",".wpd-inline-icon-count.wpd-has-comments",function(){var b=$(this),a=new FormData;a.append("action","wpdGetLastInlineComments"),a.append("inline_form_id",aA(b)),G(x,!0,a).done(function(a){"object"==typeof a?a.success?$(a.data).insertAfter(b):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,b),"error"):console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("click",".wpd-view-all-inline-comments",function(a){a.preventDefault(),$(this).parents(".wpd-last-inline-comments-wrapper").remove(),$(".wpdf-inline").hasClass("wpdf-active")||$(".wpdf-inline").trigger("click"),au(),$("html, body").animate({scrollTop:$(".wpdf-inline").offset().top-m},1e3,av)}),$("body").on("click",".wpd-feedback-content-link",function(a){a.preventDefault();var b=$(this).data("feedback-content-id");au(),$("html, body").animate({scrollTop:$("#wpd-inline-"+b).offset().top-(m+6)},1e3,function(){av(),$("#wpd-inline-"+b).addClass("wpd-active")})}),("scroll_open"===l||"blink"===l)&&(o(),$(window).on("scroll",o)),$("body").on("click","#wpd-post-rating.wpd-not-rated .wpd-rate-starts svg",function(){var a=new FormData,b=$(this).index();b>=0&&b<5&&(a.append("action","wpdUserRate"),a.append("rating",b+1),G(x,!0,a).done(function(a){"object"==typeof a?(a.success?location.reload(!0):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data),"error"),aE(a)):console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)}))}),$("body").on("submit","#wpdiscuz-subscribe-form",function(d){d.preventDefault();var a=$(this);let b=$("#wpdiscuz_subscription_button",a);if(a[0].checkValidity()&&(f=a,g=!0,"2.0"===e&&$("input[name=wpdiscuz_recaptcha_subscribe_form]",f).length&&!$("input[name=wpdiscuz_recaptcha_subscribe_form]",f).val().length?(g=!1,$(".wpdiscuz-recaptcha",f).css("border","1px solid red")):"2.0"===e&&$("input[name=wpdiscuz_recaptcha_subscribe_form]",f).length&&$(".wpdiscuz-recaptcha",f).css("border","none"),g)&&b.hasClass("wpd_not_clicked")){b.removeClass("wpd_not_clicked");var f,g,c=new FormData;c.append("action","wpdAddSubscription"),$("*",a).each(function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&c.append(this.name+"",$(this).val()),("checkbox"==this.type||"radio"==this.type)&&$(this).is(":checked")&&c.append(this.name+"",$(this).val())}),G(x,!0,c).done(function(a){"object"==typeof a?a.success?(wpdiscuzAjaxObj.setCommentMessage(a.data,"success"),setTimeout(function(){location.reload(!0)},3e3)):wpdiscuzAjaxObj.setCommentMessage(a.data,"error"):wpdiscuzAjaxObj.setCommentMessage(a,"error"),$("#wpdiscuz-loading-bar").fadeOut(250),V=!1,b.addClass("wpd_not_clicked")}).fail(function(c,d,a){console.log(a),b.addClass("wpd_not_clicked"),$("#wpdiscuz-loading-bar").fadeOut(250)})}}),$("body").on("click",".wpd-unsubscribe",function(b){b.preventDefault();var a=new FormData;a.append("action","wpdUnsubscribe"),a.append("sid",$(this).data("sid")),a.append("skey",$(this).data("skey")),G(x,!0,a).done(function(a){"object"==typeof a?a.success?(wpdiscuzAjaxObj.setCommentMessage(a.data,"success"),setTimeout(function(){location.reload(!0)},3e3)):wpdiscuzAjaxObj.setCommentMessage(a.data,"error"):console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250),V=!1}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),wpdiscuzAjaxObj.resetActiveFilters=function(a){$(".wpd-filter.wpdf-active"+(a?":not("+a+")":"")).removeClass("wpdf-active")},wpdiscuzAjaxObj.getAjaxObj=G,wpdiscuzAjaxObj.initNonce=p,p()});var onloadCallback=function(){if(document.getElementById("wpdiscuz-recaptcha-0_0")&&"2.0"===wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion&&(1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!wpdiscuzAjaxObj.is_user_logged_in||1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&wpdiscuzAjaxObj.is_user_logged_in))try{grecaptcha.render("wpdiscuz-recaptcha-0_0",{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(a){jQuery("#wpdiscuz-recaptcha-field-0_0").val("key")},"expired-callback":function(){jQuery("#wpdiscuz-recaptcha-field-0_0").val("")}})}catch(a){console.log(a),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+a.message,"error")}}
7
  /* Colorbox */
8
  !function(t,e,i){var o,n,r,h,a,s,l,c,d,g,f,u,p,m,w,v,y,x,b,T,C,H,k,W,E,I,M,L,R,S,K,P,B,O={html:!1,photo:!1,iframe:!1,inline:!1,transition:"elastic",speed:300,fadeOut:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,opacity:.9,preloading:!0,className:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:void 0,closeButton:!0,fastIframe:!0,open:!1,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",photoRegex:/\.(gif|png|jp(e|g|eg)|bmp|ico|webp|jxr|svg)((#|\?).*)?$/i,retinaImage:!1,retinaUrl:!1,retinaSuffix:"@2x.$1",current:"image {current} of {total}",previous:"previous",next:"next",close:"close",xhrError:"This content failed to load.",imgError:"This image failed to load.",returnFocus:!0,trapFocus:!0,onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,rel:function(){return this.rel},href:function(){return t(this).attr("href")},title:function(){return this.title},createImg:function(){var e=new Image,i=t(this).data("cbox-img-attrs");return"object"==typeof i&&t.each(i,function(t,i){e[t]=i}),e},createIframe:function(){var i=e.createElement("iframe"),o=t(this).data("cbox-iframe-attrs");return"object"==typeof o&&t.each(o,function(t,e){i[t]=e}),"frameBorder"in i&&(i.frameBorder=0),"allowTransparency"in i&&(i.allowTransparency="true"),i.name=(new Date).getTime(),i.allowFullscreen=!0,i}},_="colorbox",j="cbox",D=j+"Element",F=j+"_open",N=j+"_load",z=j+"_complete",A=j+"_cleanup",q=j+"_closed",U=j+"_purge",$=t("<a/>"),G="div",Q=0,J={};function V(i,o,n){var r=e.createElement(i);return o&&(r.id=j+o),n&&(r.style.cssText=n),t(r)}function X(){return i.innerHeight?i.innerHeight:t(i).height()}function Y(e,i){i!==Object(i)&&(i={}),this.cache={},this.el=e,this.value=function(e){var o;return void 0===this.cache[e]&&(void 0!==(o=t(this.el).attr("data-cbox-"+e))?this.cache[e]=o:void 0!==i[e]?this.cache[e]=i[e]:void 0!==O[e]&&(this.cache[e]=O[e])),this.cache[e]},this.get=function(t){var e=this.value(t);return"function"==typeof e?e.call(this.el,this):e}}function Z(t){var e=d.length,i=(I+t)%e;return i<0?e+i:i}function tt(t,e){return Math.round((/%/.test(t)?("x"===e?g.width():X())/100:1)*parseInt(t,10))}function et(t,e){return t.get("photo")||t.get("photoRegex").test(e)}function it(t,e){return t.get("retinaUrl")&&i.devicePixelRatio>1?e.replace(t.get("photoRegex"),t.get("retinaSuffix")):e}function ot(t){"contains"in n[0]&&!n[0].contains(t.target)&&t.target!==o[0]&&(t.stopPropagation(),n.trigger("focus"))}function nt(t){nt.str!==t&&(n.add(o).removeClass(nt.str).addClass(t),nt.str=t)}function rt(i){t(e).trigger(i),$.triggerHandler(i)}var ht=function(){var t,e,i=j+"Slideshow_",o="click."+j;function r(){clearTimeout(e)}function h(){(C.get("loop")||d[I+1])&&(r(),e=setTimeout(P.next,C.get("slideshowSpeed")))}function a(){v.html(C.get("slideshowStop")).off(o).one(o,s),$.on(z,h).on(N,r),n.removeClass(i+"off").addClass(i+"on")}function s(){r(),$.off(z,h).off(N,r),v.html(C.get("slideshowStart")).off(o).one(o,function(){P.next(),a()}),n.removeClass(i+"on").addClass(i+"off")}function l(){t=!1,v.hide(),r(),$.off(z,h).off(N,r),n.removeClass(i+"off "+i+"on")}return function(){t?C.get("slideshow")||($.off(A,l),l()):C.get("slideshow")&&d[1]&&(t=!0,$.one(A,l),C.get("slideshowAuto")?a():s(),v.show())}}();function at(r){var g,w;if(!S){if(g=t(r).data(_),C=new Y(r,g),w=C.get("rel"),I=0,w&&!1!==w&&"nofollow"!==w?(d=t("."+D).filter(function(){return new Y(this,t.data(this,_)).get("rel")===w}),-1===(I=d.index(C.el))&&(d=d.add(C.el),I=d.length-1)):d=t(C.el),!L){L=R=!0,nt(C.get("className")),n.css({visibility:"hidden",display:"block",opacity:""}),f=V(G,"LoadedContent","width:0; height:0; overflow:hidden; visibility:hidden"),h.css({width:"",height:""}).append(f),H=a.height()+c.height()+h.outerHeight(!0)-h.height(),k=s.width()+l.width()+h.outerWidth(!0)-h.width(),W=f.outerHeight(!0),E=f.outerWidth(!0);var v=tt(C.get("initialWidth"),"x"),y=tt(C.get("initialHeight"),"y"),x=C.get("maxWidth"),B=C.get("maxHeight");C.w=Math.max((!1!==x?Math.min(v,tt(x,"x")):v)-E-k,0),C.h=Math.max((!1!==B?Math.min(y,tt(B,"y")):y)-W-H,0),f.css({width:"",height:C.h}),P.position(),rt(F),C.get("onOpen"),T.add(m).hide(),n.trigger("focus"),C.get("trapFocus")&&e.addEventListener&&(e.addEventListener("focus",ot,!0),$.one(q,function(){e.removeEventListener("focus",ot,!0)})),C.get("returnFocus")&&$.one(q,function(){t(C.el).trigger("focus")})}var O=parseFloat(C.get("opacity"));o.css({opacity:O==O?O:"",cursor:C.get("overlayClose")?"pointer":"",visibility:"visible"}).show(),C.get("closeButton")?b.html(C.get("close")).appendTo(h):b.appendTo("<div/>"),function(){var e,o,n,r=P.prep,h=++Q;R=!0,M=!1,rt(U),rt(N),C.get("onLoad"),C.h=C.get("height")?tt(C.get("height"),"y")-W-H:C.get("innerHeight")&&tt(C.get("innerHeight"),"y"),C.w=C.get("width")?tt(C.get("width"),"x")-E-k:C.get("innerWidth")&&tt(C.get("innerWidth"),"x"),C.mw=C.w,C.mh=C.h,C.get("maxWidth")&&(C.mw=tt(C.get("maxWidth"),"x")-E-k,C.mw=C.w&&C.w<C.mw?C.w:C.mw);C.get("maxHeight")&&(C.mh=tt(C.get("maxHeight"),"y")-W-H,C.mh=C.h&&C.h<C.mh?C.h:C.mh);if(e=C.get("href"),K=setTimeout(function(){p.show()},100),C.get("inline")){var a=t(e).eq(0);n=t("<div>").hide().insertBefore(a),$.one(U,function(){n.replaceWith(a)}),r(a)}else C.get("iframe")?r(" "):C.get("html")?r(C.get("html")):et(C,e)?(e=it(C,e),M=C.get("createImg"),t(M).addClass(j+"Photo").on("error."+j,function(){r(V(G,"Error").html(C.get("imgError")))}).one("load",function(){h===Q&&setTimeout(function(){var e;C.get("retinaImage")&&i.devicePixelRatio>1&&(M.height=M.height/i.devicePixelRatio,M.width=M.width/i.devicePixelRatio),C.get("scalePhotos")&&(o=function(){M.height-=M.height*e,M.width-=M.width*e},C.mw&&M.width>C.mw&&(e=(M.width-C.mw)/M.width,o()),C.mh&&M.height>C.mh&&(e=(M.height-C.mh)/M.height,o())),C.h&&(M.style.marginTop=Math.max(C.mh-M.height,0)/2+"px"),d[1]&&(C.get("loop")||d[I+1])&&(M.style.cursor="pointer",t(M).on("click."+j,function(){P.next()})),M.style.width=M.width+"px",M.style.height=M.height+"px",r(M)},1)}),M.src=e):e&&u.load(e,C.get("data"),function(e,i){h===Q&&r("error"===i?V(G,"Error").html(C.get("xhrError")):t(this).contents())})}()}}function st(){n||(B=!1,g=t(i),n=V(G).attr({id:_,class:!1===t.support.opacity?j+"IE":"",role:"dialog",tabindex:"-1"}).hide(),o=V(G,"Overlay").hide(),p=t([V(G,"LoadingOverlay")[0],V(G,"LoadingGraphic")[0]]),r=V(G,"Wrapper"),h=V(G,"Content").append(m=V(G,"Title"),w=V(G,"Current"),x=t('<button type="button"/>').attr({id:j+"Previous"}),y=t('<button type="button"/>').attr({id:j+"Next"}),v=t('<button type="button"/>').attr({id:j+"Slideshow"}),p),b=t('<button type="button"/>').attr({id:j+"Close"}),r.append(V(G).append(V(G,"TopLeft"),a=V(G,"TopCenter"),V(G,"TopRight")),V(G,!1,"clear:left").append(s=V(G,"MiddleLeft"),h,l=V(G,"MiddleRight")),V(G,!1,"clear:left").append(V(G,"BottomLeft"),c=V(G,"BottomCenter"),V(G,"BottomRight"))).find("div div").css({float:"left"}),u=V(G,!1,"position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;"),T=y.add(x).add(w).add(v)),e.body&&!n.parent().length&&t(e.body).append(o,n.append(r,u))}function lt(){function i(t){t.which>1||t.shiftKey||t.altKey||t.metaKey||t.ctrlKey||(t.preventDefault(),at(this))}return!!n&&(B||(B=!0,y.on("click",function(){P.next()}),x.on("click",function(){P.prev()}),b.on("click",function(){P.close()}),o.on("click",function(){C.get("overlayClose")&&P.close()}),t(e).on("keydown."+j,function(t){var e=t.keyCode;L&&C.get("escKey")&&27===e&&(t.preventDefault(),P.close()),L&&C.get("arrowKey")&&d[1]&&!t.altKey&&(37===e?(t.preventDefault(),x.trigger("click")):39===e&&(t.preventDefault(),y.trigger("click")))}),"function"==typeof t.fn.on?t(e).on("click."+j,"."+D,i):t("."+D).live("click."+j,i)),!0)}t[_]||(t(st),(P=t.fn[_]=t[_]=function(e,i){var o=this;return e=e||{},"function"==typeof o&&(o=t("<a/>"),e.open=!0),o[0]?(st(),lt()&&(i&&(e.onComplete=i),o.each(function(){var i=t.data(this,_)||{};t.data(this,_,t.extend(i,e))}).addClass(D),new Y(o[0],e).get("open")&&at(o[0])),o):o}).position=function(e,i){var o,d,f,u=0,p=0,m=n.offset();function w(){a[0].style.width=c[0].style.width=h[0].style.width=parseInt(n[0].style.width,10)-k+"px",h[0].style.height=s[0].style.height=l[0].style.height=parseInt(n[0].style.height,10)-H+"px"}if(g.off("resize."+j),n.css({top:-9e4,left:-9e4}),d=g.scrollTop(),f=g.scrollLeft(),C.get("fixed")?(m.top-=d,m.left-=f,n.css({position:"fixed"})):(u=d,p=f,n.css({position:"absolute"})),!1!==C.get("right")?p+=Math.max(g.width()-C.w-E-k-tt(C.get("right"),"x"),0):!1!==C.get("left")?p+=tt(C.get("left"),"x"):p+=Math.round(Math.max(g.width()-C.w-E-k,0)/2),!1!==C.get("bottom")?u+=Math.max(X()-C.h-W-H-tt(C.get("bottom"),"y"),0):!1!==C.get("top")?u+=tt(C.get("top"),"y"):u+=Math.round(Math.max(X()-C.h-W-H,0)/2),n.css({top:m.top,left:m.left,visibility:"visible"}),r[0].style.width=r[0].style.height="9999px",o={width:C.w+E+k,height:C.h+W+H,top:u,left:p},e){var v=0;t.each(o,function(t){o[t]===J[t]||(v=e)}),e=v}J=o,e||n.css(o),n.dequeue().animate(o,{duration:e||0,complete:function(){w(),R=!1,r[0].style.width=C.w+E+k+"px",r[0].style.height=C.h+W+H+"px",C.get("reposition")&&setTimeout(function(){g.on("resize."+j,P.position)},1),"function"==typeof i&&i()},step:w})},P.resize=function(t){var e;L&&((t=t||{}).width&&(C.w=tt(t.width,"x")-E-k),t.innerWidth&&(C.w=tt(t.innerWidth,"x")),f.css({width:C.w}),t.height&&(C.h=tt(t.height,"y")-W-H),t.innerHeight&&(C.h=tt(t.innerHeight,"y")),t.innerHeight||t.height||(e=f.scrollTop(),f.css({height:"auto"}),C.h=f.height()),f.css({height:C.h}),e&&f.scrollTop(e),P.position("none"===C.get("transition")?0:C.get("speed")))},P.prep=function(i){if(L){var o,r="none"===C.get("transition")?0:C.get("speed");f.remove(),(f=V(G,"LoadedContent").append(i)).hide().appendTo(u.show()).css({width:(C.w=C.w||f.width(),C.w=C.mw&&C.mw<C.w?C.mw:C.w,C.w),overflow:C.get("scrolling")?"auto":"hidden"}).css({height:(C.h=C.h||f.height(),C.h=C.mh&&C.mh<C.h?C.mh:C.h,C.h)}).prependTo(h),u.hide(),t(M).css({float:"none"}),nt(C.get("className")),o=function(){var i,o,h=d.length;function a(){!1===t.support.opacity&&n[0].style.removeAttribute("filter")}L&&(o=function(){clearTimeout(K),p.hide(),rt(z),C.get("onComplete")},m.html(C.get("title")).show(),f.show(),h>1?("string"==typeof C.get("current")&&w.html(C.get("current").replace("{current}",I+1).replace("{total}",h)).show(),y[C.get("loop")||I<h-1?"show":"hide"]().html(C.get("next")),x[C.get("loop")||I?"show":"hide"]().html(C.get("previous")),ht(),C.get("preloading")&&t.each([Z(-1),Z(1)],function(){var i=d[this],o=new Y(i,t.data(i,_)),n=o.get("href");n&&et(o,n)&&(n=it(o,n),e.createElement("img").src=n)})):T.hide(),C.get("iframe")?(i=C.get("createIframe"),C.get("scrolling")||(i.scrolling="no"),t(i).attr({src:C.get("href"),class:j+"Iframe"}).one("load",o).appendTo(f),$.one(U,function(){i.src="//about:blank"}),C.get("fastIframe")&&t(i).trigger("load")):o(),"fade"===C.get("transition")?n.fadeTo(r,1,a):a())},"fade"===C.get("transition")?n.fadeTo(r,0,function(){P.position(0,o)}):P.position(r,o)}},P.next=function(){!R&&d[1]&&(C.get("loop")||d[I+1])&&(I=Z(1),at(d[I]))},P.prev=function(){!R&&d[1]&&(C.get("loop")||I)&&(I=Z(-1),at(d[I]))},P.close=function(){L&&!S&&(S=!0,L=!1,rt(A),C.get("onCleanup"),g.off("."+j),o.fadeTo(C.get("fadeOut")||0,0),n.stop().fadeTo(C.get("fadeOut")||0,0,function(){n.hide(),o.hide(),rt(U),f.remove(),setTimeout(function(){S=!1,rt(q),C.get("onClosed")},1)}))},P.remove=function(){n&&(n.stop(),t[_].close(),n.stop(!1,!0).remove(),o.remove(),S=!1,n=null,t("."+D).removeData(_).removeClass(D),t(e).off("click."+j).off("keydown."+j))},P.element=function(){return t(C.el)},P.settings=O)}(jQuery,document,window);
9
  /* Media Uploader */
assets/js/wpdiscuz-combo.min.js CHANGED
@@ -7,7 +7,7 @@ class wpdEditorCounter{constructor(b,a){this.quill=b,this.options=a,this.comment
7
  /* Autogrow */
8
  jQuery.fn.autoGrow=function(){return this.each(function(){var createMirror=function(textarea){jQuery(textarea).after('<div class="autogrow-textarea-mirror"></div>');return jQuery(textarea).next(".autogrow-textarea-mirror")[0]};var sendContentToMirror=function(textarea){mirror.innerHTML=String(textarea.value).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n/g,"<br />")+".<br/>.";if(jQuery(textarea).height()!=jQuery(mirror).height())jQuery(textarea).height(jQuery(mirror).height())};var growTextarea=function(){sendContentToMirror(this)};var mirror=createMirror(this);mirror.style.display="none";mirror.style.wordWrap="break-word";mirror.style.padding=jQuery(this).css("padding");mirror.style.width=jQuery(this).css("width");mirror.style.fontFamily=jQuery(this).css("font-family");mirror.style.fontSize=jQuery(this).css("font-size");mirror.style.lineHeight=jQuery(this).css("line-height");this.style.overflow="hidden";this.style.minHeight=this.rows+"em";this.onkeydown=growTextarea;sendContentToMirror(this)})};
9
  /* wpDiscuz */
10
- var wpdiscuzLoadRichEditor=parseInt(wpdiscuzAjaxObj.loadRichEditor);if(wpdiscuzLoadRichEditor&&document.querySelector(".wpdiscuz-textarea-wrap"))var wpDiscuzEditor=new WpdEditor;function wpdMessagesOnInit(a,b){wpdiscuzAjaxObj.setCommentMessage(a,b),setTimeout(function(){location.href=location.href.substring(0,location.href.indexOf("wpdiscuzUrlAnchor")-1)},3e3)}wpdiscuzAjaxObj.setCommentMessage=function(c,b,d){var a="wpdiscuz-message-error";if(c instanceof Array)for(var e in c)b instanceof Array?"success"===b[e]?a="wpdiscuz-message-success":"warning"===b[e]&&(a="wpdiscuz-message-warning"):"success"===b?a="wpdiscuz-message-success":"warning"===b&&(a="wpdiscuz-message-warning"),jQuery("<div/>").addClass(a).html(c[e]).prependTo("#wpdiscuz-comment-message").delay(d instanceof Array?d[e]:d||4e3).fadeOut(1e3,function(){jQuery(this).remove()});else"success"===b?a="wpdiscuz-message-success":"warning"===b&&(a="wpdiscuz-message-warning"),jQuery("<div/>").addClass(a).html(c).prependTo("#wpdiscuz-comment-message").delay(d||4e3).fadeOut(1e3,function(){jQuery(this).remove()})},wpdiscuzAjaxObj.applyFilterOnPhrase=function(a,b,c){return wpdiscuzAjaxObj.phraseFilters&&jQuery.each(wpdiscuzAjaxObj.phraseFilters,function(d){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[d]]&&(a=wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[d]](a,b,c))}),a},jQuery(document).ready(function($){$("body").addClass("wpdiscuz_"+wpdiscuzAjaxObj.version);var H,c=wpdiscuzAjaxObj.is_user_logged_in,q=1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!c,r=1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&c,e=wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion,s=parseInt(wpdiscuzAjaxObj.commentListLoadType),I=parseInt(wpdiscuzAjaxObj.wc_post_id);wpdiscuzAjaxObj.wpdiscuz_nonce="";var t=parseInt(wpdiscuzAjaxObj.commentListUpdateType),u=1e3*parseInt(wpdiscuzAjaxObj.commentListUpdateTimer),v=parseInt(wpdiscuzAjaxObj.liveUpdateGuests),w=wpdiscuzAjaxObj.loadLastCommentId,J=w,f=parseInt(wpdiscuzAjaxObj.firstLoadWithAjax);Cookies.get("wpdiscuz_comments_sorting")&&Cookies.remove("wpdiscuz_comments_sorting",{path:""}),Cookies.get("wordpress_last_visit")&&Cookies.remove("wordpress_last_visit",{path:""}),Cookies.get("wpdiscuz_last_visit")&&Cookies.remove("wpdiscuz_last_visit",{path:""});var i=parseInt(wpdiscuzAjaxObj.wordpressIsPaginate),K=wpdiscuzAjaxObj.storeCommenterData,L=parseInt(wpdiscuzAjaxObj.wmuEnabled),M=wpdiscuzAjaxObj.isCookiesEnabled,N=!0,g=wpdiscuzAjaxObj.cookiehash,O=parseInt(wpdiscuzAjaxObj.isLoadOnlyParentComments),P=parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0,x=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),j=parseInt(wpdiscuzAjaxObj.enableBubble),y=parseInt(wpdiscuzAjaxObj.bubbleLiveUpdate),k=parseInt(wpdiscuzAjaxObj.bubbleHintTimeout),Q=parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout)?parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout):5,R=parseInt(wpdiscuzAjaxObj.bubbleShowNewCommentMessage),h=wpdiscuzAjaxObj.bubbleLocation,l=wpdiscuzAjaxObj.inlineFeedbackAttractionType,m=parseInt(wpdiscuzAjaxObj.scrollSize),m=m||32,S=[],T=[],U=[],V=!1,z=1,W=$("html").css("scroll-behavior"),X=$("body").css("scroll-behavior");if($(".wc_social_plugin_wrapper .wp-social-login-provider-list").length?$(".wc_social_plugin_wrapper .wp-social-login-provider-list").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):$(".wc_social_plugin_wrapper .the_champ_login_container").length?$(".wc_social_plugin_wrapper .the_champ_login_container").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):$(".wc_social_plugin_wrapper .social_connect_form").length?$(".wc_social_plugin_wrapper .social_connect_form").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):$(".wc_social_plugin_wrapper .oneall_social_login_providers").length&&$(".wc_social_plugin_wrapper .oneall_social_login .oneall_social_login_providers").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"),wpdiscuzLoadRichEditor&&$("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0"),window.addEventListener("beforeunload",function(c){var b=$(".wpd-form").not(":hidden");if(b.length){if(wpdiscuzLoadRichEditor&&document.querySelector(".wpdiscuz-textarea-wrap")){for(var a=0;a<b.length;a++)if("\n"!==wpDiscuzEditor.createEditor($(b[a]).find(".ql-container").attr("id")).getText()){c.preventDefault(),c.returnValue="";return}}else for(var a=0;a<b.length;a++)if($(b[a]).find(".wc_comment").val()){c.preventDefault(),c.returnValue="";return}}}),wpdiscuzLoadRichEditor||($(document).delegate("textarea.wc_comment","input",function(){aD($(this))}),$.each($("textarea.wc_comment"),function(){aD($(this))})),$("body").on("focus","#wpdcom .ql-editor, #wpdcom .wc_comment",function(){$(".wpd-form-foot",$(this).parents(".wpd_comm_form")).slideDown(P)}),$("body").on("focus","#wpdcom textarea",function(){$(this).next(".autogrow-textarea-mirror").length||$(this).autoGrow()}),c||aa({comment_author:Cookies.get("comment_author_"+g),comment_author_email:Cookies.get("comment_author_email_"+g),comment_author_url:Cookies.get("comment_author_url_"+g)}),$(".wpd-vote-down.wpd-dislike-hidden").remove(),$(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd"),$("body").on("click","#wpd-editor-source-code-wrapper-bg",function(){$(this).hide(),$("#wpd-editor-source-code-wrapper").hide(),$("#wpd-editor-uid").val(""),$("#wpd-editor-source-code").val("")}),wpdiscuzLoadRichEditor&&$("body").on("click","#wpd-insert-source-code",function(){var a=wpDiscuzEditor.createEditor("#"+$("#wpd-editor-uid").val());a.deleteText(0,a.getLength(),Quill.sources.USER);var b=$("#wpd-editor-source-code").val();b.length&&a.clipboard.dangerouslyPasteHTML(0,b,Quill.sources.USER),a.update(),$("#wpd-editor-source-code-wrapper-bg").hide(),$("#wpd-editor-source-code-wrapper").hide(),$("#wpd-editor-uid").val(""),$("#wpd-editor-source-code").val("")}),$("body").on("click",".wpd-reply-button",function(){var a=aj($(this),0);$(this).hasClass("wpdiscuz-clonned")?(wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+a).focus()},P):setTimeout(function(){$("#wc-textarea-"+a).trigger("focus")},P),$("#wpd-secondary-form-wrapper-"+a).slideToggle(P)):ah($(this)),function(a){if((q||r)&&"2.0"===e){var b=ak(a);setTimeout(function(){if(!T[b])try{T[b]=grecaptcha.render("wpdiscuz-recaptcha-"+a,{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(b){$("#wpdiscuz-recaptcha-field-"+a).val("key")},"expired-callback":function(){$("#wpdiscuz-recaptcha-field-"+a).val("")}})}catch(c){console.log(c),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+c.message,"error")}},1e3)}}(a)}),$("body").on("click","#wpdcom [data-wpd-clipboard]",function(){var b=$(this).data("wpd-clipboard"),a=$("<input/>");a.appendTo("body").css({position:"absolute",top:"-10000000px"}).val(b),a.trigger("select"),document.execCommand("copy"),a.remove(),wpdiscuzAjaxObj.setCommentMessage(b+"<br/>"+wpdiscuzAjaxObj.wc_copied_to_clipboard,"success",5e3)}),$("body").on("click",".wpdiscuz-nofollow,.wc_captcha_refresh_img,.wpd-load-more-submit",function(a){a.preventDefault()}),$("body").on("click",".wpd-toggle.wpd_not_clicked",function(){var a=$(this);a.removeClass("wpd_not_clicked");var b=aj($(this),0),c=$(this),d=$(".fas",c);!c.parents(".wpd-comment:not(.wpd-reply)").children(".wpd-reply").length&&O?aw(b,a):$("#wpd-comm-"+b+"> .wpd-reply").slideToggle(700,function(){$(this).is(":hidden")?(d.removeClass("fa-chevron-up"),d.addClass("fa-chevron-down"),c.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_show_replies_text),c.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_show_replies_text)):(d.removeClass("fa-chevron-down"),d.addClass("fa-chevron-up"),c.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),c.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text)),a.addClass("wpd_not_clicked")})}),$("body").on("mouseenter",".wpd-new-loaded-comment",function(){$(this).removeClass("wpd-new-loaded-comment")}),$("body").on("click",".wpd-sbs-toggle",function(){$(".wpdiscuz-subscribe-bar").slideToggle(P)}),parseInt(wpdiscuzAjaxObj.wpDiscuzIsShowOnSubscribeForm)&&!c&&wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&$("#wpdiscuz-subscribe-form").length&&("2.0"===e?(setTimeout(function(){try{grecaptcha.render("wpdiscuz-recaptcha-subscribe-form",{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(a){$("#wpdiscuz-recaptcha-field-subscribe-form").val("key")},"expired-callback":function(){$("#wpdiscuz-recaptcha-field-subscribe-form").val("")}})}catch(a){console.log(a),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+a.message,"error")}},1e3),$("body").on("submit","#wpdiscuz-subscribe-form",function(a){$("#wpdiscuz-recaptcha-field-subscribe-form").val()?$(".wpdiscuz-recaptcha",$(this)).css("border","none"):($(".wpdiscuz-recaptcha",$(this)).css("border","1px solid red"),a.preventDefault())})):"3.0"===e&&$("body").on("click","#wpdiscuz_subscription_button",function(b){var c=$(this).parents("#wpdiscuz-subscribe-form");b.preventDefault();try{grecaptcha.ready(function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/wpdAddSubscription"}).then(function(a){console.log(5555),document.getElementById("wpdiscuz-recaptcha-field-subscribe-form").value=a,c.trigger("submit")},function(a){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(a)})})}catch(a){console.log(a),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+a.message,"error")}})),(q||r)&&"2.0"===e){var A=$(window).width(),a=$("#wpdcom").width();a>=1100&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"65%"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"35%"})),a>=940&&a<1100&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"60%"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"40%"})),a>=810&&a<940&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"40%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"60%"})),a>=730&&a<810&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"45%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"55%"})),a>=610&&a<730&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.85)","-webkit-transform":"scale(0.85)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"43%"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"55%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"30%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"70%"})),A>650&&(a>=510&&a<610&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"center 0","-webkit-transform-origin":"center 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"35%"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"63%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"30%",position:"relative",right:"-60px"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"70%"}),$("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"})),a>=470&&a<510&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"center 0","-webkit-transform-origin":"center 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"40%"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"60%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({float:"none",width:"100%",display:"block"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({float:"none",width:"100%",display:"block"}),$("#wpdcom .wpd_main_comm_form .wc-form-footer").css({"margin-left":"0px"}),$("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"})),a<470&&($("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({margin:"0px auto","transform-origin":"center 0","-webkit-transform-origin":"center 0"}),$("#wpdcom .wpd-form-col-left").css({float:"none",width:"100%",display:"block"}),$("#wpdcom .wpd-form-col-right").css({float:"none",width:"100%",display:"block"}),$("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"}),$("#wpdcom .wpd-secondary-form-wrapper .wc_notification_checkboxes").css({"text-align":"center"}),$("#wpdcom .wpd-secondary-form-wrapper .wc-field-submit").css({"text-align":"center"})))}function Y(b,a,c){G(x||L,!1,a).done(function(a){if($(c).addClass("wpd_not_clicked"),"object"==typeof a){if(a.success){"collapsed"===wpdiscuzAjaxObj.commentFormView&&$(".wpd-form-foot",b).slideUp(P),a.data.wc_all_comments_count_new=parseInt(a.data.wc_all_comments_count_new),$(".wpd-thread-info").html(a.data.wc_all_comments_count_before_threads_html),$(".wpd-thread-info").attr("data-comments-count",a.data.wc_all_comments_count_new),$("#wpd-bubble-all-comments-count").replaceWith(a.data.wc_all_comments_count_bubble_html);var d=P;a.data.is_main?az(a.data.message):(d=P+700,$("#wpd-secondary-form-wrapper-"+a.data.uniqueid).slideToggle(700),1==a.data.is_in_same_container?$("#wpd-secondary-form-wrapper-"+a.data.uniqueid).after(a.data.message):$("#wpd-comm-"+a.data.uniqueid).after(a.data.message)),Z(a),_(a),M&&N?ab(a.data):N||$(".wpd-cookies-checkbox").prop("checked",!1),b.get(0).reset(),wpdiscuzLoadRichEditor?wpDiscuzEditor.createEditor("#wpd-editor-"+$(".wpdiscuz_unique_id",b).val()).setContents([{insert:"\n"}]):aD(b.find(".wc_comment")),aa(a.data),$(".wmu-preview-wrap",b).remove(),ay(),parseInt(wpdiscuzAjaxObj.scrollToComment)&&setTimeout(function(){au(),$("html, body").animate({scrollTop:$("#comment-"+a.data.new_comment_id).offset().top-m},1e3,av)},d),aE(a,b)}else a.data&&(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,b),"error"),aE(a,b))}else wpdiscuzAjaxObj.setCommentMessage(a,"error");$("#wpdiscuz-loading-bar").fadeOut(250),V=!1}).fail(function(b,d,a){console.log(a),$(c).addClass("wpd_not_clicked"),$("#wpdiscuz-loading-bar").fadeOut(250)})}function Z(b){if(!b.data.held_moderate){var a=new FormData;a.append("action","wpdCheckNotificationType"),a.append("comment_id",b.data.new_comment_id),a.append("email",b.data.comment_author_email),a.append("isParent",b.data.is_main),G(x,!0,a)}}function _(a){if(a.data.redirect>0&&a.data.new_comment_id){var b=new FormData;b.append("action","wpdRedirect"),b.append("commentId",a.data.new_comment_id),G(x,!0,b).done(function(a){"object"==typeof a&&a.success&&setTimeout(function(){location.href=a.data},2e3)}).fail(function(b,c,a){console.log(a)})}}function aa(a){$(".wpd_comm_form .wc_name").val(a.comment_author),a.comment_author_email&&0>a.comment_author_email.indexOf("@example.com")&&$(".wpd_comm_form .wc_email").val(a.comment_author_email),a.comment_author_url&&$(".wpd_comm_form .wc_website").val(a.comment_author_url)}function ab(b){var c=b.comment_author_email,d=b.comment_author,a=b.comment_author_url;null==K?(Cookies.set("comment_author_email_"+g,c),Cookies.set("comment_author_"+g,d),a.length&&Cookies.set("comment_author_url_"+g,a)):(K=parseInt(K),Cookies.set("comment_author_email_"+g,c,{expires:K,path:"/"}),Cookies.set("comment_author_"+g,d,{expires:K,path:"/"}),a.length&&Cookies.set("comment_author_url_"+g,a,{expires:K,path:"/"})),$(".wpd-cookies-checkbox").length&&$(".wpd-cookies-checkbox").prop("checked",!0)}function ac(a,b){$("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").show(),$("#wpd-comm-"+a+" .wpdiscuz-edit-form-wrap").replaceWith(b),$("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-last-edited").show()}$("body").on("click",".wc_comm_submit.wpd_not_clicked",function(){var d=$(this),f=1,a=$(this).parents("form");if("true"===a.attr("data-uploading")){wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhraseDoingUpload,"wmuPhraseDoingUpload",a),"warning");return}if(a.hasClass("wpd_main_comm_form")||(f=an($(this).parents(".wpd-comment"))),as(a,"#wpd-editor-"+$(".wpdiscuz_unique_id",a).val()),a.on("submit",function(a){a.preventDefault()}),""===$(".wc_comment",a).val().trim()){wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wc_msg_required_fields,"wc_msg_required_fields",a),"error");return}if(a[0].checkValidity()&&(h=a,i=!0,"2.0"===e&&$("input[name=wc_captcha]",h).length&&!$("input[name=wc_captcha]",h).val().length?(i=!1,$(".wpdiscuz-recaptcha",h).css("border","1px solid red")):"2.0"===e&&$("input[name=wc_captcha]",h).length&&$(".wpdiscuz-recaptcha",h).css("border","none"),i)){V=!0,ax(a),$(d).removeClass("wpd_not_clicked");var h,i,b=new FormData;if(b.append("action","wpdAddComment"),$(":input",a).each(function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&b.append(this.name+"",$(this).val().trim()),("checkbox"==this.type||"radio"==this.type)&&$(this).is(":checked")&&b.append(this.name+"",$(this).val())}),b.append("wpd_comment_depth",f),wpdiscuzAjaxObj.wpdiscuz_zs&&b.append("wpdiscuz_zs",wpdiscuzAjaxObj.wpdiscuz_zs),$(".wpd-cookies-checkbox",a).length?$(".wpd-cookies-checkbox",a).prop("checked")||(N=!1):c&&(N=!1),$("#wpdiscuz-loading-bar").show(),wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&"3.0"===e&&(1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!wpdiscuzAjaxObj.is_user_logged_in||1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&wpdiscuzAjaxObj.is_user_logged_in))try{grecaptcha.ready(function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/addComment"}).then(function(c){b.append("g-recaptcha-response",c),Y(a,b,d)},function(a){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(a)})})}catch(g){console.log(g),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+g.message,"error"),$("#wpdiscuz-loading-bar").fadeOut(250)}else Y(a,b,d)}(function(a){if((q||r)&&"2.0"===e){var b=ak(a);grecaptcha.reset(T[b])}})($(".wpdiscuz_unique_id",a).val()),ar()}),$("body").on("click",".wpd_editable_comment",function(){H&&$(".wpdiscuz-edit-form-wrap").length&&ac(aj($(".wpdiscuz-edit-form-wrap"),0),H);var c=$(this),b=aj(c,0),d=ak(b),a=new FormData;a.append("action","wpdEditComment"),a.append("commentId",d),H=$("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-text").get(0),G(x,!0,a).done(function(a){if("object"==typeof a){if(a.success){if($("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text").replaceWith(a.data.html),wpdiscuzLoadRichEditor){var d=wpDiscuzEditor.createEditor("#wpd-editor-edit_"+b);d.clipboard.dangerouslyPasteHTML(0,a.data.content),d.update(),$(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd")}else $("#wc-textarea-edit_"+b).val(a.data.content),aD($("#wc-textarea-edit_"+b));$("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").hide(),$("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-last-edited").hide()}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,c),"error")}else console.log(a);$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("click",".wc_save_edited_comment",function(){var d=$(this),b=aj(d),e=ak(b),a=$("#wpd-comm-"+b+" #wpdiscuz-edit-form");if(as(a,"#wpd-editor-edit_"+b),a.on("submit",function(a){a.preventDefault()}),a[0].checkValidity()){var c=new FormData;c.append("action","wpdSaveEditedComment"),c.append("commentId",e),$(":input",a).each(function(){""!==this.name&&"checkbox"!==this.type&&"radio"!==this.type&&c.append(this.name+"",$(this).val()),("checkbox"===this.type||"radio"===this.type)&&$(this).is(":checked")&&c.append(this.name+"",$(this).val())}),G(x,!0,c).done(function(a){"object"==typeof a?(a.success?(ac(b,a.data.message),a.data.lastEdited&&($("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-last-edited").remove(),$(a.data.lastEdited).insertAfter("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text")),a.data.twitterShareLink&&$("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_tw").attr("href",a.data.twitterShareLink),a.data.whatsappShareLink&&$("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_whatsapp").attr("href",a.data.whatsappShareLink),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+b)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,d),"error"),aE(a,e)):console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}}),$("body").on("click",".wc_cancel_edit",function(){var a=aj($(this));ac(a,H),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+a)}),!i&&f&&(z=0,1==f?setTimeout(function(){ae(!0)},500):$("body").on("click",".wpd-load-comments",function(){$(this).parent(".wpd-load-more-submit-wrap").remove(),ae(!0)})),$("body").on("click",".wpd-load-more-submit",function(){var a=$(this),b="wpd-loaded";a.hasClass(b)&&ae(!1,a,b,"wpd-loading")});var ad=!1;function B(){var a=document.getElementById("wpdiscuzHasMoreComments"),b=0;a&&(b=a.dataset.is_show_load_more);var c=document.getElementById("wpdcom")?document.getElementById("wpdcom").clientHeight:0,d=$(window).height()+$(window).scrollTop();c&&d&&100*d/c>=80&& !1===ad&&1==b&&(ad=!0,ae(!1,$(".wpd-load-more-submit")))}function ae(c,b,e,g){b&&(b.toggleClass(e),b.toggleClass(g));var a=new FormData;a.append("action","wpdLoadMoreComments");var d=$(".wpdiscuz-sort-button-active").attr("data-sorting");d&&a.append("sorting",d),a.append("offset",z),a.append("lastParentId",al()),a.append("isFirstLoad",c?1:0);var h=$(".wpdf-active").attr("data-filter-type");a.append("wpdType",h||""),G(x,!c||1!=f,a).done(function(a){"object"==typeof a&&a.success&&(z++,c&&$(".wpd-comment").remove(),$(".wpdiscuz_single").remove(),$(".wpdiscuz-comment-pagination").before(a.data.comment_list),C(a,c&&2!==s),ad=!1,a.data.loadLastCommentId&&(w=a.data.loadLastCommentId),aE(a),c&&D(!1)),$("#wpdiscuz-loading-bar").fadeOut(250),$(".wpd-load-more-submit").blur(),b&&(b.toggleClass(e),b.toggleClass(g))}).fail(function(c,d,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250),$(".wpd-load-more-submit").blur(),b&&(b.toggleClass(e),b.toggleClass(g))})}function C(a,d){var b=document.getElementById("wpdiscuzHasMoreComments");if(!1==a.data.is_show_load_more)b&&(b.dataset.is_show_load_more=0),$(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide();else if(am(a.data.last_parent_id),b&&(b.dataset.is_show_load_more=1),d&&$(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").show(),a.data.comments_left>0){if(!$(".wpd-load-more-submit .wpd-comments-left").length){let c=$("<span>");c.addClass("wpd-comments-left"),$(".wpd-load-more-submit").append(c)}$(".wpd-load-more-submit .wpd-comments-left").text(a.data.comments_left_text)}aE(a)}function D(d){var b=location.href.match(/#comment\-(\d+)/);if(null!==b){var c=b[1];if($("#comment-"+c).length)setTimeout(function(){au(),$("html, body").animate({scrollTop:$("#comment-"+c).parents("[id^=wpd-comm-]").offset().top-m},1e3,av),d&&af(c)},500);else{var a=new FormData;a.append("action","wpdGetSingleComment"),a.append("commentId",c),G(x,!0,a).done(function(a){if("object"==typeof a&&a.success){var b="#comment-"+c;$("#comment-"+a.data.parentCommentID).length?$("#comment-"+a.data.parentCommentID).parents("[id^=wpd-comm-"+a.data.parentCommentID+"]").replaceWith(a.data.message):$(".wpd-thread-list").prepend(a.data.message),aE(a),au(),$("html, body").animate({scrollTop:$(b).offset().top-m},1e3,av),d&&af(c)}$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}}}function af(a){setTimeout(function(){$("#comment-"+a).siblings(".wpd-secondary-form-wrapper").is(":visible")||$("#comment-"+a).find(".wpd-reply-button").trigger("click")},1100)}function ag(b){if(void 0!==b.data.message)for(var c,d=b.data.message,a=0;a<d.length;a++)ap((c=d[a]).comment_parent,c.comment_html)}function ah(b){var a=aj(b,0);$("#wpdiscuz_form_anchor-"+a).before(ai(a));var d=$("#wpd-secondary-form-wrapper-"+a);c||aa({comment_author:Cookies.get("comment_author_"+g),comment_author_email:Cookies.get("comment_author_email_"+g),comment_author_url:Cookies.get("comment_author_url_"+g)}),wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+a).focus()},P):setTimeout(function(){$("#wc-textarea-"+a).trigger("focus")},P),d.slideToggle(P,function(){b.addClass("wpdiscuz-clonned")})}function ai(a){return $("#wpdiscuz_hidden_secondary_form").html().replace(/wpdiscuzuniqueid/g,a)}function aj(a,c){var b="";return(b=c?a.parents(".wpd-main-form-wrapper").attr("id"):a.parents(".wpd-comment").attr("id")).substring(b.lastIndexOf("-")+1)}function ak(a){return a.substring(0,a.indexOf("_"))}function al(){return $(".wpd-load-more-submit").attr("data-lastparentid")}function am(a){$(".wpd-load-more-submit").attr("data-lastparentid",a),2!==s&&$(".wpdiscuz-comment-pagination").show()}function an(a){var b=a.attr("class").split(" "),c="";return $.each(b,function(b,a){"wpd_comment_level"===ao(a,!1)&&(c=ao(a,!0))}),parseInt(c)+1}function ao(a,b){return b?a.substring(a.indexOf("-")+1):a.substring(0,a.indexOf("-"))}function ap(a,b){if(0==a)az(b);else{var c=aj($("#comment-"+a),0);$("#wpdiscuz_form_anchor-"+c).after(b)}}function aq(){var a=[];return $(".wpd-comment-right").each(function(){a.push(ak(aj($(this),0)))}),a.join(",")}function ar(){$(".wpdiscuz_reset").val("")}function as(a,b){var c=a.find(".wpd-required-group");wpdiscuzLoadRichEditor&&a.find(".wc_comment").val($(b+">.ql-editor").html()),at(a),$.each(c,function(){$("input",this).prop("required",!1),0===$("input:checked",this).length?$("input",$(this)).prop("required",!0):$(".wpd-field-invalid",this).remove()})}function at(c){var b=c.find(".wc_comment"),a=b.val().trim().replace(/<p><br><\/p>/g,"\n").replace(/<p>(.*?)<\/p>/g,"$1\n");a=(a=(a=(a=a.replace(/<img src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img[^>]+alt=["|']([^"|']+)["|'][^>]+src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'][^>]?>/g," $1 ")).replace(/<img\s+([^>]*)class=["|']wpdem\-sticker["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img\s+([^>]*)src=["|']([^"|']+)["|'](.*?)[^>]*>/g," $2 "),b.val(a)}function au(){$("html, body").css("scroll-behavior","unset")}function av(){$("html").css("scroll-behavior",W),$("body").css("scroll-behavior",X)}function aw(b,d){var c=ak(b),a=new FormData;a.append("action","wpdShowReplies"),a.append("commentId",c),G(x,!0,a).done(function(a){d.addClass("wpd_not_clicked"),"object"==typeof a&&a.success&&($("#wpd-comm-"+b).replaceWith(a.data.comment_list),$("#wpd-comm-"+b+" .wpd-toggle .fas").removeClass("fa-chevron-down").addClass("fa-chevron-up"),$("#wpd-comm-"+b+" .wpd-toggle .wpd-view-replies .wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),$("#wpd-comm-"+b+" .wpd-toggle").attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text),aE(a)),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),d.addClass("wpd_not_clicked"),$("#wpdiscuz-loading-bar").fadeOut(250)})}function ax(a){$(".wpd-agreement-checkbox",a).each(function(){$(this).hasClass("wpd_agreement_hide")&&M&&$(this).prop("checked")&&(Cookies.set($(this).attr("name")+"_"+g,1,{expires:30,path:"/"}),$("input[name="+$(this).attr("name")+"]").each(function(){S.push($(this))}))})}function ay(){S.length&&(S.forEach(function(a){a.parents(".wpd-field-checkbox").remove()}),S=[])}function az(a){$(".wpd-sticky-comment").last()[0]?$(a).insertAfter($(".wpd-sticky-comment").last()[0]):$(".wpd-thread-list").prepend(a)}function E(a){a?a.prop("required")||(a.val()?a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none")):$.each($(".wc_email"),function(c,b){var a=$(b);a.prop("required")||(a.val()?a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none"))})}if(2!==s||i||($(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide(),B(),$(window).scroll(function(){B()})),wpdiscuzAjaxObj.setLoadMoreVisibility=C,$("body").on("click",".wpd-vote-up.wpd_not_clicked, .wpd-vote-down.wpd_not_clicked",function(){var b,c=$(this);$(c).removeClass("wpd_not_clicked");var d=aj(c),e=ak(d);b=$(this).hasClass("wpd-vote-up")?1:-1;var a=new FormData;a.append("action","wpdVoteOnComment"),a.append("commentId",e),a.append("voteType",b),G(x,!0,a).done(function(a){if($(c).addClass("wpd_not_clicked"),"object"==typeof a){if(a.success){if("total"===a.data.buttonsStyle){var d=$(".wpd-comment-footer .wpd-vote-result",$("#comment-"+e)),h=a.data.votes;d.text(a.data.votesHumanReadable),d.attr("title",h),d.removeClass("wpd-up wpd-down"),h>0&&d.addClass("wpd-up"),h<0&&d.addClass("wpd-down")}else{var f=$(".wpd-comment-footer .wpd-vote-result-like",$("#comment-"+e)),g=$(".wpd-comment-footer .wpd-vote-result-dislike",$("#comment-"+e));f.text(a.data.likeCountHumanReadable),f.attr("title",a.data.likeCount),g.text(a.data.dislikeCountHumanReadable),g.attr("title",a.data.dislikeCount),parseInt(a.data.likeCount)>0?f.addClass("wpd-up"):f.removeClass("wpd-up"),0>parseInt(a.data.dislikeCount)?g.addClass("wpd-down"):g.removeClass("wpd-down")}var i=$(".wpd-comment-footer .wpd-vote-up",$("#comment-"+e)),j=$(".wpd-comment-footer .wpd-vote-down",$("#comment-"+e));i.removeClass("wpd-up"),j.removeClass("wpd-down"),a.data.curUserReaction>0?i.addClass("wpd-up"):a.data.curUserReaction<0&&j.addClass("wpd-down")}else a.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,c),"error");aE(a,e,b)}else console.log(a);$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,d,a){console.log(a),$(c).addClass("wpd_not_clicked"),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$(document).on("click","body",function(b){var a=$(".wpdiscuz-sort-buttons");$(b.target).hasClass("wpdf-sorting")||$(b.target).parent().hasClass("wpdf-sorting")?a.css({display:a.is(":visible")?"none":"flex"}):a.hide()}),$("body").on("click",".wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)",function(){var c=$(this),b=$(this).attr("data-sorting");if(b){$(".wpdiscuz-sort-button.wpdiscuz-sort-button-active").removeClass("wpdiscuz-sort-button-active").appendTo(".wpdiscuz-sort-buttons"),c.addClass("wpdiscuz-sort-button-active").prependTo(".wpdf-sorting");var a=new FormData;a.append("action","wpdSorting"),a.append("sorting",b);var d=$(".wpdf-active").attr("data-filter-type");a.append("wpdType",d||""),G(x,!0,a).done(function(a){"object"==typeof a&&a.success&&($("#wpdcom .wpd-comment").remove(),$("#wpdcom .wpd-thread-list").prepend(a.data.message),C(a,!1),z=1),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}}),window.onhashchange=function(){D(!1)},1!=f&&D(!1),$("body").on("click",".wpdiscuz-readmore",function(){var b=aj($(this)),c=ak(b),a=new FormData;a.append("action","wpdReadMore"),a.append("commentId",c),G(x,!0,a).done(function(a){"object"==typeof a?(a.success?($("#comment-"+c+" .wpd-comment-text").replaceWith(" "+a.data.message),$("#wpdiscuz-readmore-"+b).remove()):console.log(a.data),aE(a)):console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("change",".wpd-required-group",function(){0!==$("input:checked",this).length?$("input",$(this)).prop("required",!1):$("input",$(this)).prop("required",!0)}),$("body").on("click",".wpdiscuz-spoiler",function(){$(this).next().slideToggle(),$(this).hasClass("wpdiscuz-spoiler-closed")?$(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-plus").removeClass("fa-plus").addClass("fa-minus"):$(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-minus").removeClass("fa-minus").addClass("fa-plus"),$(this).toggleClass("wpdiscuz-spoiler-closed")}),$("body").on("click",".wpd-tools i",function(){var a=$(this).siblings(".wpd-tools-actions");a.is(":visible")||$(this).parents(".wpd-comment-right").attr("id")!==$("[id^=comment-]","#wpdcom").last().attr("id")||$("#comments").css({paddingBottom:"160px"}),a.css({display:a.is(":visible")?"none":"flex"})}),$("body").on("mouseleave",".wpd-comment-right",function(){$(this).find(".wpd-tools-actions").hide(),$("#comments").css({paddingBottom:"0"})}),$("body").on("click",".wpd_stick_btn",function(){var b=aj($(this),0),c=ak(b),a=new FormData;a.append("action","wpdStickComment"),a.append("commentId",c),G(x,!0,a).done(function(a){"object"==typeof a&&a.success&&location.reload(!0),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("click",".wpd_close_btn",function(){var b=aj($(this),0),c=ak(b),a=new FormData;a.append("action","wpdCloseThread"),a.append("commentId",c),G(x,!0,a).done(function(a){"object"==typeof a&&a.success&&location.reload(!0),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("click",".wpd-filter.wpd_not_clicked[data-filter-type]",function(){var b=$(this),c=b.attr("data-filter-type");wpdiscuzAjaxObj.resetActiveFilters(".wpdf-"+c),b.removeClass("wpd_not_clicked"),$(".fas",b).addClass("fa-pulse fa-spinner");var a=new FormData;a.append("action","wpdLoadMoreComments");var d=$(".wpdiscuz-sort-button-active").attr("data-sorting");d&&a.append("sorting",d),a.append("lastParentId",0),a.append("offset",0),z=1,a.append("wpdType",b.hasClass("wpdf-active")?"":c),a.append("isFirstLoad",1),$(this).hasClass("wpdf-inline")?$(this).hasClass("wpdf-active")?$(".wpd-comment-info-bar").hide():$(".wpd-comment-info-bar").css("display","flex"):$(".wpd-comment-info-bar").hide(),G(x,!1,a).done(function(a){b.addClass("wpd_not_clicked"),$(".fas",b).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(b.toggleClass("wpdf-active"),$(".wpd-load-comments").remove(),$(".wpd-comment").remove(),$(".wpd-thread-list").prepend(a.data.comment_list),C(a),w=a.data.loadLastCommentId,$(".wpd-load-more-submit").blur(),aE(a)),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("click",".wpdf-reacted.wpd_not_clicked",function(){var a=$(this);a.removeClass("wpd_not_clicked"),$(".fas",a).addClass("fa-pulse fa-spinner");var b=new FormData;b.append("action","wpdMostReactedComment"),G(x,!1,b).done(function(b){a.addClass("wpd_not_clicked"),$(".fas",a).removeClass("fa-pulse fa-spinner"),"object"==typeof b&&b.success&&($("#comment-"+b.data.parentCommentID).length?$("#comment-"+b.data.parentCommentID).parents("[id^=wpd-comm-"+b.data.parentCommentID+"]").replaceWith(b.data.message):$("#comment-"+b.data.commentId).length||$(".wpd-thread-list").prepend(b.data.message),aE(b),au(),$("html, body").animate({scrollTop:$("#comment-"+b.data.commentId).offset().top-m},1e3,av))}).fail(function(c,d,b){console.log(b),$(".fas",a).removeClass("fa-pulse fa-spinner")})}),$("body").on("click",".wpdf-hottest.wpd_not_clicked",function(){var a=$(this);a.removeClass("wpd_not_clicked"),$(".fas",a).addClass("fa-pulse fa-spinner");var b=new FormData;b.append("action","wpdHottestThread"),G(x,!1,b).done(function(b){a.addClass("wpd_not_clicked"),$(".fas",a).removeClass("fa-pulse fa-spinner"),"object"==typeof b&&b.success&&($("#comment-"+b.data.commentId).length?$("#comment-"+b.data.commentId).parents("[id^=wpd-comm-"+b.data.commentId+"]").replaceWith(b.data.message):$(".wpd-thread-list").prepend(b.data.message),aE(b),au(),$("html, body").animate({scrollTop:$("#comment-"+b.data.commentId).offset().top-m},1e3,av))}).fail(function(c,d,b){console.log(b),$(".fas",a).removeClass("fa-pulse fa-spinner")})}),$("body").on("click",".wpd-filter-view-all",function(){$(".wpdf-inline.wpdf-active.wpd_not_clicked").trigger("click")}),$("body").on("click",".wpd-follow-link.wpd_not_clicked",function(){var a=$(this);a.removeClass("wpd_not_clicked"),$(".fas",a).addClass("fa-pulse fa-spinner");var c=aj(a,0),d=ak(c),b=new FormData;b.append("action","wpdFollowUser"),b.append("commentId",d),G(x,!0,b).done(function(b){a.addClass("wpd_not_clicked"),"object"==typeof b?b.success?(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[b.data.code],b.data.code,a),"success"),a.removeClass("wpd-follow-active"),b.data.followTip&&a.attr("wpd-tooltip",b.data.followTip),b.data.followClass&&a.addClass(b.data.followClass),aE(b)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[b.data],b.data,a),"error"):console.log(b),$(".fas",a).removeClass("fa-pulse fa-spinner"),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(c,d,b){console.log(b),$(".fas",a).removeClass("fa-pulse fa-spinner"),$("#wpdiscuz-loading-bar").fadeOut(250)})}),E(),$("body").on("keyup",".wc_email",function(){E($(this))}),j&&$("#wpdcom").length){if($("#wpd-bubble-wrapper").hover(function(){$(this).addClass("wpd-bubble-hover")},function(){$(this).removeClass("wpd-bubble-hover")}),k&&!Cookies.get(wpdiscuzAjaxObj.cookieHideBubbleHint)&&setTimeout(function(){$("#wpd-bubble-wrapper").addClass("wpd-bubble-hover"),Cookies.set(wpdiscuzAjaxObj.cookieHideBubbleHint,"1",{expires:7,path:"/"}),setTimeout(function(){$("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")},1e3*Q)},1e3*k),"content_left"===h){if($(".entry-content").length){var b=Math.min($(".entry-content").offset().left,$("#wpdcom").offset().left)-120,d=b>25?b:25;$("#wpd-bubble-wrapper").css({left:d+"px"}),$("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if($(".post-entry").length){var b=Math.min($(".post-entry").offset().left,$("#wpdcom").offset().left)-120,d=b>25?b:25;$("#wpd-bubble-wrapper").css({left:d+"px"}),$("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if($(".container").length){var b=Math.min($(".container").offset().left,$("#wpdcom").offset().left)-120,d=b>25?b:25;$("#wpd-bubble-wrapper").css({left:d+"px"}),$("#wpd-bubble-wrapper").addClass("wpd-left-content")}else $("#wpd-bubble-wrapper").css({left:"25px"}),$("#wpd-bubble-wrapper").addClass("wpd-left-corner")}else"left_corner"===h?($("#wpd-bubble-wrapper").css({left:"25px"}),$("#wpd-bubble-wrapper").addClass("wpd-left-corner")):"right_corner"===h&&($("#wpd-bubble-wrapper").css({right:"25px"}),$("#wpd-bubble-wrapper").addClass("wpd-right-corner"));$("#wpd-bubble-wrapper").show(),$("body").on("click","#wpd-bubble-add-message-close",function(a){a.preventDefault(),a.stopPropagation(),$("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")}),$("body").on("click","#wpd-bubble",function(){au(),$("#tab-title-reviews").length&&$("#tab-title-reviews a").trigger("click"),$("html, body").animate({scrollTop:$("#wpdcom").offset().top-(m+28)},1e3,function(){av(),$("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover"),wpdiscuzLoadRichEditor?$("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0").focus():$("#wc-textarea-0_0").length&&$("#wc-textarea-0_0").trigger("focus")})}),$("body").on("click","#wpd-bubble-comment-close",function(a){a.preventDefault(),$("#wpd-bubble-notification-message").hide(),$("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")}),$("body").on("click","#wpd-bubble-comment-reply-link a",function(){var a=$(this).attr("href");setTimeout(function(){$("#wpd-bubble-notification-message").hide(),$("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),D(!0);var b=a.match(/#comment\-(\d+)/);U=U.filter(function(a){return a!=b[1]}),$("#wpd-bubble-count .wpd-new-comments-count").text(U.length),0==U.length&&$("#wpd-bubble-count").removeClass("wpd-new-comments")},100)}),$("body").on("click","#wpd-bubble-count",function(){if(U.length){var a=new FormData;a.append("action","wpdBubbleUpdate"),a.append("newCommentIds",U.join()),G(x,!0,a).done(function(a){"object"==typeof a&&a.success&&(a.data.message=a.data.message.filter(function(a){if(!$("#comment-"+a.comment_id).length)return a}),ag(a),$("#wpd-bubble-count").removeClass("wpd-new-comments"),$("#wpd-bubble-count .wpd-new-comments-count").text("0"),U=[],$(".wpd-new-loaded-comment").length&&(au(),$("html, body").animate({scrollTop:$($(".wpd-new-loaded-comment")[0]).offset().top-(m+28)},1e3,av)),aE(a)),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a)})}})}function F(){$.ajax({type:"GET",url:wpdiscuzAjaxObj.bubbleUpdateUrl,beforeSend:function(a){a.setRequestHeader("X-WP-Nonce",wpdiscuzAjaxObj.restNonce)},data:{postId:I,lastId:J,visibleCommentIds:aq()}}).done(function(a){if(!V){if("object"==typeof a){if(a.commentIDsToRemove.forEach(function(a){$("[id^=wpd-comm-"+a+"]").remove()}),a.ids.length){if(t){var b;(b=new FormData).append("action","wpdUpdateAutomatically"),b.append("loadLastCommentId",w),b.append("visibleCommentIds",aq()),G(x,!1,b).done(function(a){!V&&"object"==typeof a&&a.success&&(ag(a),a.data.wc_all_comments_count_new=parseInt(a.data.wc_all_comments_count_new),$(".wpd-thread-info").html(a.data.wc_all_comments_count_before_threads_html),$(".wpd-thread-info").attr("data-comments-count",a.data.wc_all_comments_count_new),$("#wpd-bubble-all-comments-count").replaceWith(a.data.wc_all_comments_count_bubble_html),w=a.data.loadLastCommentId)}).fail(function(b,c,a){console.log(a)})}a.ids=a.ids.filter(function(a){if(!$("#comment-"+a).length)return a});var c=5e3;J=parseInt(a.ids[a.ids.length-1]),U=U.concat(a.ids),R&&a.commentText&&($("#wpd-bubble-author-avatar").html(a.avatar),$("#wpd-bubble-author-name").html(a.authorName),$("#wpd-bubble-comment-date span").html(a.commentDate),$("#wpd-bubble-comment-text").html(a.commentText),$("#wpd-bubble-comment-reply-link a").attr("href",a.commentLink),$("#wpd-bubble-notification-message").show(),c=1e4);var d=parseInt($(".wpd-new-comments-count").text());d+=a.ids.length,$("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),$("#wpd-bubble-wrapper").addClass("wpd-new-comment-added"),setTimeout(function(){$("#wpd-bubble-notification-message").hide(),$("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")},c),$(".wpd-new-comments-count").text(d),$("#wpd-bubble-count").addClass("wpd-new-comments")}a.all_comments_count=parseInt(a.all_comments_count),$("#wpd-bubble-all-comments-count").replaceWith(a.all_comments_count_bubble_html),$(".wpd-reviews-tab").length||($(".wpd-thread-info").html(a.all_comments_count_before_threads_html),$(".wpd-thread-info").attr("data-comments-count",a.all_comments_count))}else console.log(a)}setTimeout(F,u)}).fail(function(b,c,a){console.log(a),setTimeout(F,u)})}if((j&&y||t)&&(c|| !c&&v)&&setTimeout(F,u),$(".wpd-inline-form-wrapper").length){var n=new FormData;n.append("action","wpdGetInlineCommentForm"),G(x,!1,n).done(function(a){"object"==typeof a?a.success?($(".wpd-inline-form-wrapper").append(a.data),$.each($("[name=_wpd_inline_nonce]"),function(){var b=$(this).attr("id"),a=$(this).parents(".wpd-inline-shortcode").attr("id");$(this).attr("id",b+"-"+a.substring(a.lastIndexOf("-")+1))}),$(".wpd-inline-opened").addClass("wpd-active"),$(".wpd-inline-opened").find(".wpd-inline-form-wrapper").show(),$(".wpd-inline-opened").find(".wpd-inline-icon").addClass("wpd-open"),$(".wpd-inline-opened").find(".wpd-inline-icon").removeClass("wpd-ignored"),aC()):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data]),a.data,"error"):console.log(a)}).fail(function(b,c,a){console.log(a)})}function aA(a){if($(a).hasClass("wpd-inline-shortcode"))var b=$(a).attr("id");else var b=$(a).parents(".wpd-inline-shortcode").attr("id");return b.substring(b.lastIndexOf("-")+1)}function aB(){$(".wpd-inline-form-wrapper").hide(),$(".wpd-inline-shortcode").removeClass("wpd-active"),$(".wpd-inline-icon").removeClass("wpd-open")}function o(){$.each($(".wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon"),function(){var a=$(this),b=a.offset().top-window.pageYOffset;a.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&b>0&&b<300&&("blink"===l?(a.addClass("wpd-blink"),setTimeout(function(){a.removeClass("wpd-blink")},3e3)):(a.parents(".wpd-inline-shortcode").addClass("wpd-active"),a.siblings(".wpd-inline-form-wrapper").show(),a.addClass("wpd-open"),aC(a.siblings(".wpd-inline-form-wrapper"))))})}function aC(a){if(a){if(a.offset().left<=10){a.css("left",Math.ceil(parseInt(a.css("left"))-a.offset().left+10));var b=Math.ceil(a.siblings(".wpd-inline-icon.wpd-open").offset().left-a.offset().left+2);b<3&&(b=3),document.styleSheets[0].addRule("#"+a.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+b+"px;")}else if(a.offset().left+a.width()>document.body.clientWidth-10){a.css("left",Math.ceil(parseInt(a.css("left"))+(document.body.clientWidth-(a.offset().left+a.width()))-10));var b=Math.ceil(a.siblings(".wpd-inline-icon.wpd-open").offset().left-a.offset().left+2);b>a.width()-3&&(b=a.width()-3),document.styleSheets[0].addRule("#"+a.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+b+"px;")}}else $.each($(".wpd-inline-form-wrapper:visible"),function(){if($(this).offset().left<=10){$(this).css("left",Math.ceil(parseInt($(this).css("left"))-$(this).offset().left+10));var a=Math.ceil($(this).siblings(".wpd-inline-icon.wpd-open").offset().left-$(this).offset().left+2);a<3&&(a=3),document.styleSheets[0].addRule("#"+$(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"px;")}else if($(this).offset().left+$(this).width()>document.body.clientWidth-10){$(this).css("left",Math.ceil(parseInt($(this).css("left"))+(document.body.clientWidth-($(this).offset().left+$(this).width()))-10));var a=Math.ceil($(this).siblings(".wpd-inline-icon.wpd-open").offset().left-$(this).offset().left+2);a>$(this).width()-3&&(a=$(this).width()-3),document.styleSheets[0].addRule("#"+$(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"px;")}})}function aD(a){var b,c=0;if(a.parents(".wpd_main_comm_form").length)c=parseInt(wpdiscuzAjaxObj.commentTextMaxLength),b=a.parents(".wpd_main_comm_form");else if(a.parents(".wpd-secondary-form-wrapper").length)c=parseInt(wpdiscuzAjaxObj.replyTextMaxLength),b=a.parents(".wpd-secondary-form-wrapper");else if(a.parents("#wpdiscuz-edit-form").length){var e=aj(a);c=parseInt(e.substring(e.lastIndexOf("_")+1))?parseInt(wpdiscuzAjaxObj.replyTextMaxLength):parseInt(wpdiscuzAjaxObj.commentTextMaxLength),b=a.parents("#wpdiscuz-edit-form")}if(c&&b){var g=a.val().length,d=$(".wpd-editor-char-counter",b),f=c-g;d.html(f),f<=10?d.addClass("error"):d.removeClass("error")}}function aE(a,b,c,d){a.data.callbackFunctions&&$.each(a.data.callbackFunctions,function(e){"function"==typeof wpdiscuzAjaxObj[a.data.callbackFunctions[e]]?wpdiscuzAjaxObj[a.data.callbackFunctions[e]](a,b,c,d):"function"==typeof window[a.data.callbackFunctions[e]]?window[a.data.callbackFunctions[e]](a,b,c,d):console.log(a.data.callbackFunctions[e]+" is not a function")})}function G(c,d,a){d&&$("#wpdiscuz-loading-bar").show(),a.append("postId",I),a.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce);var b=a.get("action");wpdiscuzAjaxObj.dataFilterCallbacks&&wpdiscuzAjaxObj.dataFilterCallbacks[b]&&$.each(wpdiscuzAjaxObj.dataFilterCallbacks[b],function(e){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[b][e]]&&(a=wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[b][e]](a,c,d))});var e=c?wpdiscuzAjaxObj.url:wpdiscuzAjaxObj.customAjaxUrl;return $.ajax({type:"POST",url:e,data:a,contentType:!1,processData:!1})}function p(){if(c||wpdiscuzAjaxObj.validateNonceForGuests){var a=new FormData;a.append("action","wpdGetNonce"),G(x,!1,a).done(function(a){"object"==typeof a?a.success?wpdiscuzAjaxObj.wpdiscuz_nonce=a.data:wpdiscuzAjaxObj.setCommentMessage(a.data,"error"):console.log(a)}).fail(function(b,c,a){console.log(a)})}}$(document).on("click","body",function(a){if($(a.target).hasClass("wpd-inline-form-close")||$(a.target).parents(".wpd-inline-form-close").length)a.preventDefault(),$(a.target).parents(".wpd-inline-form-wrapper").hide(),$(a.target).parents(".wpd-inline-shortcode").removeClass("wpd-active"),$(a.target).parents(".wpd-inline-form-wrapper").siblings(".wpd-inline-icon").removeClass("wpd-open");else if(!$(a.target).hasClass("wpd-inline-form-wrapper")&&!$(a.target).parents(".wpd-inline-form-wrapper").length){aB();var b="";$(a.target).hasClass("wpd-inline-icon")?b=$(a.target):$(a.target).parents(".wpd-inline-icon").length&&(b=$(a.target).parents(".wpd-inline-icon")),b.length&&b.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&(b.parents(".wpd-inline-shortcode").addClass("wpd-active"),b.siblings(".wpd-inline-form-wrapper").show(),b.addClass("wpd-open"),b.removeClass("wpd-ignored"),aC(b.siblings(".wpd-inline-form-wrapper")))}(!$(a.target).hasClass("wpd-last-inline-comments-wrapper")&&!$(a.target).parents(".wpd-last-inline-comments-wrapper").length||$(a.target).parents(".wpd-last-inline-comments-wrapper").length&&$(a.target).hasClass("wpd-load-inline-comment"))&&$(".wpd-last-inline-comments-wrapper").remove()}),$("body").on("click",".wpd-inline-submit.wpd_not_clicked",function(c){c.preventDefault();var d=$(this),a=$(this).parents(".wpd_inline_comm_form");if(a[0].checkValidity()){$(this).removeClass("wpd_not_clicked");var b=new FormData;b.append("action","wpdAddInlineComment"),b.append("inline_form_id",aA(a)),$.each($("input, textarea",a),function(c,a){"checkbox"===this.type?$(this).is(":checked")&&b.append($(a).attr("name"),$(a).val()):b.append($(a).attr("name"),$(a).val())}),G(x,!0,b).done(function(b){if(d.addClass("wpd_not_clicked"),"object"==typeof b){if(b.success){a[0].reset(),aB();var e=parseInt(b.data.newCount),c=d.parents(".wpd-inline-icon-wrapper").find(".wpd-inline-icon-count");c.text(e),e?c.addClass("wpd-has-comments"):c.removeClass("wpd-has-comments"),b.data.allCommentsCountNew=parseInt(b.data.allCommentsCountNew),$(".wpd-thread-info").html(b.data.allCommentsCountBeforeThreadsHtml),$(".wpd-thread-info").attr("data-comments-count",b.data.allCommentsCountNew),$("#wpd-bubble-all-comments-count").replaceWith(b.data.allCommentsCountBubbleHtml),b.data.message&&az(b.data.message),wpdiscuzAjaxObj.setCommentMessage(b.data.notification,"success")}else b.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[b.data],b.data,d),"error")}else wpdiscuzAjaxObj.setCommentMessage(b,"error");$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}}),$("body").on("keydown",".wpd-form",function(a){a.ctrlKey&&13==a.keyCode&&$(this).find(".wc_comm_submit").trigger("click")}),$("body").on("keydown","#wpdiscuz-edit-form",function(a){a.ctrlKey&&13==a.keyCode&&$(this).find(".wc_save_edited_comment").trigger("click")}),$("body").on("keydown",".wpd-inline-comment-content",function(a){a.ctrlKey&&13==a.keyCode&&$(this).parents(".wpd_inline_comm_form").find(".wpd-inline-submit.wpd_not_clicked").trigger("click")}),$("body").on("click",".wpd-inline-icon-count.wpd-has-comments",function(){var b=$(this),a=new FormData;a.append("action","wpdGetLastInlineComments"),a.append("inline_form_id",aA(b)),G(x,!0,a).done(function(a){"object"==typeof a?a.success?$(a.data).insertAfter(b):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,b),"error"):console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("click",".wpd-view-all-inline-comments",function(a){a.preventDefault(),$(this).parents(".wpd-last-inline-comments-wrapper").remove(),$(".wpdf-inline").hasClass("wpdf-active")||$(".wpdf-inline").trigger("click"),au(),$("html, body").animate({scrollTop:$(".wpdf-inline").offset().top-m},1e3,av)}),$("body").on("click",".wpd-feedback-content-link",function(a){a.preventDefault();var b=$(this).data("feedback-content-id");au(),$("html, body").animate({scrollTop:$("#wpd-inline-"+b).offset().top-(m+6)},1e3,function(){av(),$("#wpd-inline-"+b).addClass("wpd-active")})}),("scroll_open"===l||"blink"===l)&&(o(),$(window).on("scroll",o)),$("body").on("click","#wpd-post-rating.wpd-not-rated .wpd-rate-starts svg",function(){var a=new FormData,b=$(this).index();b>=0&&b<5&&(a.append("action","wpdUserRate"),a.append("rating",b+1),G(x,!0,a).done(function(a){"object"==typeof a?(a.success?location.reload(!0):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data),"error"),aE(a)):console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)}))}),$("body").on("submit","#wpdiscuz-subscribe-form",function(d){d.preventDefault();var a=$(this);let b=$("#wpdiscuz_subscription_button",a);if(a[0].checkValidity()&&(f=a,g=!0,"2.0"===e&&$("input[name=wpdiscuz_recaptcha_subscribe_form]",f).length&&!$("input[name=wpdiscuz_recaptcha_subscribe_form]",f).val().length?(g=!1,$(".wpdiscuz-recaptcha",f).css("border","1px solid red")):"2.0"===e&&$("input[name=wpdiscuz_recaptcha_subscribe_form]",f).length&&$(".wpdiscuz-recaptcha",f).css("border","none"),g)&&b.hasClass("wpd_not_clicked")){b.removeClass("wpd_not_clicked");var f,g,c=new FormData;c.append("action","wpdAddSubscription"),$("*",a).each(function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&c.append(this.name+"",$(this).val()),("checkbox"==this.type||"radio"==this.type)&&$(this).is(":checked")&&c.append(this.name+"",$(this).val())}),G(x,!0,c).done(function(a){"object"==typeof a?a.success?(wpdiscuzAjaxObj.setCommentMessage(a.data,"success"),setTimeout(function(){location.reload(!0)},3e3)):wpdiscuzAjaxObj.setCommentMessage(a.data,"error"):wpdiscuzAjaxObj.setCommentMessage(a,"error"),$("#wpdiscuz-loading-bar").fadeOut(250),V=!1,b.addClass("wpd_not_clicked")}).fail(function(c,d,a){console.log(a),b.addClass("wpd_not_clicked"),$("#wpdiscuz-loading-bar").fadeOut(250)})}}),$("body").on("click",".wpd-unsubscribe",function(b){b.preventDefault();var a=new FormData;a.append("action","wpdUnsubscribe"),a.append("sid",$(this).data("sid")),a.append("skey",$(this).data("skey")),G(x,!0,a).done(function(a){"object"==typeof a?a.success?(wpdiscuzAjaxObj.setCommentMessage(a.data,"success"),setTimeout(function(){location.reload(!0)},3e3)):wpdiscuzAjaxObj.setCommentMessage(a.data,"error"):console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250),V=!1}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),wpdiscuzAjaxObj.resetActiveFilters=function(a){$(".wpd-filter.wpdf-active"+(a?":not("+a+")":"")).removeClass("wpdf-active")},wpdiscuzAjaxObj.getAjaxObj=G,wpdiscuzAjaxObj.initNonce=p,p()});var onloadCallback=function(){if(document.getElementById("wpdiscuz-recaptcha-0_0")&&"2.0"===wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion&&(1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!wpdiscuzAjaxObj.is_user_logged_in||1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&wpdiscuzAjaxObj.is_user_logged_in))try{grecaptcha.render("wpdiscuz-recaptcha-0_0",{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(a){jQuery("#wpdiscuz-recaptcha-field-0_0").val("key")},"expired-callback":function(){jQuery("#wpdiscuz-recaptcha-field-0_0").val("")}})}catch(a){console.log(a),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+a.message,"error")}}
11
  /* Colorbox */
12
  !function(t,e,i){var o,n,r,h,a,s,l,c,d,g,f,u,p,m,w,v,y,x,b,T,C,H,k,W,E,I,M,L,R,S,K,P,B,O={html:!1,photo:!1,iframe:!1,inline:!1,transition:"elastic",speed:300,fadeOut:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,opacity:.9,preloading:!0,className:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:void 0,closeButton:!0,fastIframe:!0,open:!1,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",photoRegex:/\.(gif|png|jp(e|g|eg)|bmp|ico|webp|jxr|svg)((#|\?).*)?$/i,retinaImage:!1,retinaUrl:!1,retinaSuffix:"@2x.$1",current:"image {current} of {total}",previous:"previous",next:"next",close:"close",xhrError:"This content failed to load.",imgError:"This image failed to load.",returnFocus:!0,trapFocus:!0,onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,rel:function(){return this.rel},href:function(){return t(this).attr("href")},title:function(){return this.title},createImg:function(){var e=new Image,i=t(this).data("cbox-img-attrs");return"object"==typeof i&&t.each(i,function(t,i){e[t]=i}),e},createIframe:function(){var i=e.createElement("iframe"),o=t(this).data("cbox-iframe-attrs");return"object"==typeof o&&t.each(o,function(t,e){i[t]=e}),"frameBorder"in i&&(i.frameBorder=0),"allowTransparency"in i&&(i.allowTransparency="true"),i.name=(new Date).getTime(),i.allowFullscreen=!0,i}},_="colorbox",j="cbox",D=j+"Element",F=j+"_open",N=j+"_load",z=j+"_complete",A=j+"_cleanup",q=j+"_closed",U=j+"_purge",$=t("<a/>"),G="div",Q=0,J={};function V(i,o,n){var r=e.createElement(i);return o&&(r.id=j+o),n&&(r.style.cssText=n),t(r)}function X(){return i.innerHeight?i.innerHeight:t(i).height()}function Y(e,i){i!==Object(i)&&(i={}),this.cache={},this.el=e,this.value=function(e){var o;return void 0===this.cache[e]&&(void 0!==(o=t(this.el).attr("data-cbox-"+e))?this.cache[e]=o:void 0!==i[e]?this.cache[e]=i[e]:void 0!==O[e]&&(this.cache[e]=O[e])),this.cache[e]},this.get=function(t){var e=this.value(t);return"function"==typeof e?e.call(this.el,this):e}}function Z(t){var e=d.length,i=(I+t)%e;return i<0?e+i:i}function tt(t,e){return Math.round((/%/.test(t)?("x"===e?g.width():X())/100:1)*parseInt(t,10))}function et(t,e){return t.get("photo")||t.get("photoRegex").test(e)}function it(t,e){return t.get("retinaUrl")&&i.devicePixelRatio>1?e.replace(t.get("photoRegex"),t.get("retinaSuffix")):e}function ot(t){"contains"in n[0]&&!n[0].contains(t.target)&&t.target!==o[0]&&(t.stopPropagation(),n.trigger("focus"))}function nt(t){nt.str!==t&&(n.add(o).removeClass(nt.str).addClass(t),nt.str=t)}function rt(i){t(e).trigger(i),$.triggerHandler(i)}var ht=function(){var t,e,i=j+"Slideshow_",o="click."+j;function r(){clearTimeout(e)}function h(){(C.get("loop")||d[I+1])&&(r(),e=setTimeout(P.next,C.get("slideshowSpeed")))}function a(){v.html(C.get("slideshowStop")).off(o).one(o,s),$.on(z,h).on(N,r),n.removeClass(i+"off").addClass(i+"on")}function s(){r(),$.off(z,h).off(N,r),v.html(C.get("slideshowStart")).off(o).one(o,function(){P.next(),a()}),n.removeClass(i+"on").addClass(i+"off")}function l(){t=!1,v.hide(),r(),$.off(z,h).off(N,r),n.removeClass(i+"off "+i+"on")}return function(){t?C.get("slideshow")||($.off(A,l),l()):C.get("slideshow")&&d[1]&&(t=!0,$.one(A,l),C.get("slideshowAuto")?a():s(),v.show())}}();function at(r){var g,w;if(!S){if(g=t(r).data(_),C=new Y(r,g),w=C.get("rel"),I=0,w&&!1!==w&&"nofollow"!==w?(d=t("."+D).filter(function(){return new Y(this,t.data(this,_)).get("rel")===w}),-1===(I=d.index(C.el))&&(d=d.add(C.el),I=d.length-1)):d=t(C.el),!L){L=R=!0,nt(C.get("className")),n.css({visibility:"hidden",display:"block",opacity:""}),f=V(G,"LoadedContent","width:0; height:0; overflow:hidden; visibility:hidden"),h.css({width:"",height:""}).append(f),H=a.height()+c.height()+h.outerHeight(!0)-h.height(),k=s.width()+l.width()+h.outerWidth(!0)-h.width(),W=f.outerHeight(!0),E=f.outerWidth(!0);var v=tt(C.get("initialWidth"),"x"),y=tt(C.get("initialHeight"),"y"),x=C.get("maxWidth"),B=C.get("maxHeight");C.w=Math.max((!1!==x?Math.min(v,tt(x,"x")):v)-E-k,0),C.h=Math.max((!1!==B?Math.min(y,tt(B,"y")):y)-W-H,0),f.css({width:"",height:C.h}),P.position(),rt(F),C.get("onOpen"),T.add(m).hide(),n.trigger("focus"),C.get("trapFocus")&&e.addEventListener&&(e.addEventListener("focus",ot,!0),$.one(q,function(){e.removeEventListener("focus",ot,!0)})),C.get("returnFocus")&&$.one(q,function(){t(C.el).trigger("focus")})}var O=parseFloat(C.get("opacity"));o.css({opacity:O==O?O:"",cursor:C.get("overlayClose")?"pointer":"",visibility:"visible"}).show(),C.get("closeButton")?b.html(C.get("close")).appendTo(h):b.appendTo("<div/>"),function(){var e,o,n,r=P.prep,h=++Q;R=!0,M=!1,rt(U),rt(N),C.get("onLoad"),C.h=C.get("height")?tt(C.get("height"),"y")-W-H:C.get("innerHeight")&&tt(C.get("innerHeight"),"y"),C.w=C.get("width")?tt(C.get("width"),"x")-E-k:C.get("innerWidth")&&tt(C.get("innerWidth"),"x"),C.mw=C.w,C.mh=C.h,C.get("maxWidth")&&(C.mw=tt(C.get("maxWidth"),"x")-E-k,C.mw=C.w&&C.w<C.mw?C.w:C.mw);C.get("maxHeight")&&(C.mh=tt(C.get("maxHeight"),"y")-W-H,C.mh=C.h&&C.h<C.mh?C.h:C.mh);if(e=C.get("href"),K=setTimeout(function(){p.show()},100),C.get("inline")){var a=t(e).eq(0);n=t("<div>").hide().insertBefore(a),$.one(U,function(){n.replaceWith(a)}),r(a)}else C.get("iframe")?r(" "):C.get("html")?r(C.get("html")):et(C,e)?(e=it(C,e),M=C.get("createImg"),t(M).addClass(j+"Photo").on("error."+j,function(){r(V(G,"Error").html(C.get("imgError")))}).one("load",function(){h===Q&&setTimeout(function(){var e;C.get("retinaImage")&&i.devicePixelRatio>1&&(M.height=M.height/i.devicePixelRatio,M.width=M.width/i.devicePixelRatio),C.get("scalePhotos")&&(o=function(){M.height-=M.height*e,M.width-=M.width*e},C.mw&&M.width>C.mw&&(e=(M.width-C.mw)/M.width,o()),C.mh&&M.height>C.mh&&(e=(M.height-C.mh)/M.height,o())),C.h&&(M.style.marginTop=Math.max(C.mh-M.height,0)/2+"px"),d[1]&&(C.get("loop")||d[I+1])&&(M.style.cursor="pointer",t(M).on("click."+j,function(){P.next()})),M.style.width=M.width+"px",M.style.height=M.height+"px",r(M)},1)}),M.src=e):e&&u.load(e,C.get("data"),function(e,i){h===Q&&r("error"===i?V(G,"Error").html(C.get("xhrError")):t(this).contents())})}()}}function st(){n||(B=!1,g=t(i),n=V(G).attr({id:_,class:!1===t.support.opacity?j+"IE":"",role:"dialog",tabindex:"-1"}).hide(),o=V(G,"Overlay").hide(),p=t([V(G,"LoadingOverlay")[0],V(G,"LoadingGraphic")[0]]),r=V(G,"Wrapper"),h=V(G,"Content").append(m=V(G,"Title"),w=V(G,"Current"),x=t('<button type="button"/>').attr({id:j+"Previous"}),y=t('<button type="button"/>').attr({id:j+"Next"}),v=t('<button type="button"/>').attr({id:j+"Slideshow"}),p),b=t('<button type="button"/>').attr({id:j+"Close"}),r.append(V(G).append(V(G,"TopLeft"),a=V(G,"TopCenter"),V(G,"TopRight")),V(G,!1,"clear:left").append(s=V(G,"MiddleLeft"),h,l=V(G,"MiddleRight")),V(G,!1,"clear:left").append(V(G,"BottomLeft"),c=V(G,"BottomCenter"),V(G,"BottomRight"))).find("div div").css({float:"left"}),u=V(G,!1,"position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;"),T=y.add(x).add(w).add(v)),e.body&&!n.parent().length&&t(e.body).append(o,n.append(r,u))}function lt(){function i(t){t.which>1||t.shiftKey||t.altKey||t.metaKey||t.ctrlKey||(t.preventDefault(),at(this))}return!!n&&(B||(B=!0,y.on("click",function(){P.next()}),x.on("click",function(){P.prev()}),b.on("click",function(){P.close()}),o.on("click",function(){C.get("overlayClose")&&P.close()}),t(e).on("keydown."+j,function(t){var e=t.keyCode;L&&C.get("escKey")&&27===e&&(t.preventDefault(),P.close()),L&&C.get("arrowKey")&&d[1]&&!t.altKey&&(37===e?(t.preventDefault(),x.trigger("click")):39===e&&(t.preventDefault(),y.trigger("click")))}),"function"==typeof t.fn.on?t(e).on("click."+j,"."+D,i):t("."+D).live("click."+j,i)),!0)}t[_]||(t(st),(P=t.fn[_]=t[_]=function(e,i){var o=this;return e=e||{},"function"==typeof o&&(o=t("<a/>"),e.open=!0),o[0]?(st(),lt()&&(i&&(e.onComplete=i),o.each(function(){var i=t.data(this,_)||{};t.data(this,_,t.extend(i,e))}).addClass(D),new Y(o[0],e).get("open")&&at(o[0])),o):o}).position=function(e,i){var o,d,f,u=0,p=0,m=n.offset();function w(){a[0].style.width=c[0].style.width=h[0].style.width=parseInt(n[0].style.width,10)-k+"px",h[0].style.height=s[0].style.height=l[0].style.height=parseInt(n[0].style.height,10)-H+"px"}if(g.off("resize."+j),n.css({top:-9e4,left:-9e4}),d=g.scrollTop(),f=g.scrollLeft(),C.get("fixed")?(m.top-=d,m.left-=f,n.css({position:"fixed"})):(u=d,p=f,n.css({position:"absolute"})),!1!==C.get("right")?p+=Math.max(g.width()-C.w-E-k-tt(C.get("right"),"x"),0):!1!==C.get("left")?p+=tt(C.get("left"),"x"):p+=Math.round(Math.max(g.width()-C.w-E-k,0)/2),!1!==C.get("bottom")?u+=Math.max(X()-C.h-W-H-tt(C.get("bottom"),"y"),0):!1!==C.get("top")?u+=tt(C.get("top"),"y"):u+=Math.round(Math.max(X()-C.h-W-H,0)/2),n.css({top:m.top,left:m.left,visibility:"visible"}),r[0].style.width=r[0].style.height="9999px",o={width:C.w+E+k,height:C.h+W+H,top:u,left:p},e){var v=0;t.each(o,function(t){o[t]===J[t]||(v=e)}),e=v}J=o,e||n.css(o),n.dequeue().animate(o,{duration:e||0,complete:function(){w(),R=!1,r[0].style.width=C.w+E+k+"px",r[0].style.height=C.h+W+H+"px",C.get("reposition")&&setTimeout(function(){g.on("resize."+j,P.position)},1),"function"==typeof i&&i()},step:w})},P.resize=function(t){var e;L&&((t=t||{}).width&&(C.w=tt(t.width,"x")-E-k),t.innerWidth&&(C.w=tt(t.innerWidth,"x")),f.css({width:C.w}),t.height&&(C.h=tt(t.height,"y")-W-H),t.innerHeight&&(C.h=tt(t.innerHeight,"y")),t.innerHeight||t.height||(e=f.scrollTop(),f.css({height:"auto"}),C.h=f.height()),f.css({height:C.h}),e&&f.scrollTop(e),P.position("none"===C.get("transition")?0:C.get("speed")))},P.prep=function(i){if(L){var o,r="none"===C.get("transition")?0:C.get("speed");f.remove(),(f=V(G,"LoadedContent").append(i)).hide().appendTo(u.show()).css({width:(C.w=C.w||f.width(),C.w=C.mw&&C.mw<C.w?C.mw:C.w,C.w),overflow:C.get("scrolling")?"auto":"hidden"}).css({height:(C.h=C.h||f.height(),C.h=C.mh&&C.mh<C.h?C.mh:C.h,C.h)}).prependTo(h),u.hide(),t(M).css({float:"none"}),nt(C.get("className")),o=function(){var i,o,h=d.length;function a(){!1===t.support.opacity&&n[0].style.removeAttribute("filter")}L&&(o=function(){clearTimeout(K),p.hide(),rt(z),C.get("onComplete")},m.html(C.get("title")).show(),f.show(),h>1?("string"==typeof C.get("current")&&w.html(C.get("current").replace("{current}",I+1).replace("{total}",h)).show(),y[C.get("loop")||I<h-1?"show":"hide"]().html(C.get("next")),x[C.get("loop")||I?"show":"hide"]().html(C.get("previous")),ht(),C.get("preloading")&&t.each([Z(-1),Z(1)],function(){var i=d[this],o=new Y(i,t.data(i,_)),n=o.get("href");n&&et(o,n)&&(n=it(o,n),e.createElement("img").src=n)})):T.hide(),C.get("iframe")?(i=C.get("createIframe"),C.get("scrolling")||(i.scrolling="no"),t(i).attr({src:C.get("href"),class:j+"Iframe"}).one("load",o).appendTo(f),$.one(U,function(){i.src="//about:blank"}),C.get("fastIframe")&&t(i).trigger("load")):o(),"fade"===C.get("transition")?n.fadeTo(r,1,a):a())},"fade"===C.get("transition")?n.fadeTo(r,0,function(){P.position(0,o)}):P.position(r,o)}},P.next=function(){!R&&d[1]&&(C.get("loop")||d[I+1])&&(I=Z(1),at(d[I]))},P.prev=function(){!R&&d[1]&&(C.get("loop")||I)&&(I=Z(-1),at(d[I]))},P.close=function(){L&&!S&&(S=!0,L=!1,rt(A),C.get("onCleanup"),g.off("."+j),o.fadeTo(C.get("fadeOut")||0,0),n.stop().fadeTo(C.get("fadeOut")||0,0,function(){n.hide(),o.hide(),rt(U),f.remove(),setTimeout(function(){S=!1,rt(q),C.get("onClosed")},1)}))},P.remove=function(){n&&(n.stop(),t[_].close(),n.stop(!1,!0).remove(),o.remove(),S=!1,n=null,t("."+D).removeData(_).removeClass(D),t(e).off("click."+j).off("keydown."+j))},P.element=function(){return t(C.el)},P.settings=O)}(jQuery,document,window);
13
  /* Media Uploader */
7
  /* Autogrow */
8
  jQuery.fn.autoGrow=function(){return this.each(function(){var createMirror=function(textarea){jQuery(textarea).after('<div class="autogrow-textarea-mirror"></div>');return jQuery(textarea).next(".autogrow-textarea-mirror")[0]};var sendContentToMirror=function(textarea){mirror.innerHTML=String(textarea.value).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n/g,"<br />")+".<br/>.";if(jQuery(textarea).height()!=jQuery(mirror).height())jQuery(textarea).height(jQuery(mirror).height())};var growTextarea=function(){sendContentToMirror(this)};var mirror=createMirror(this);mirror.style.display="none";mirror.style.wordWrap="break-word";mirror.style.padding=jQuery(this).css("padding");mirror.style.width=jQuery(this).css("width");mirror.style.fontFamily=jQuery(this).css("font-family");mirror.style.fontSize=jQuery(this).css("font-size");mirror.style.lineHeight=jQuery(this).css("line-height");this.style.overflow="hidden";this.style.minHeight=this.rows+"em";this.onkeydown=growTextarea;sendContentToMirror(this)})};
9
  /* wpDiscuz */
10
+ var wpdiscuzLoadRichEditor=parseInt(wpdiscuzAjaxObj.loadRichEditor);if(wpdiscuzLoadRichEditor&&document.querySelector(".wpdiscuz-textarea-wrap"))var wpDiscuzEditor=new WpdEditor;function wpdMessagesOnInit(a,b){wpdiscuzAjaxObj.setCommentMessage(a,b),setTimeout(function(){location.href=location.href.substring(0,location.href.indexOf("wpdiscuzUrlAnchor")-1)},3e3)}wpdiscuzAjaxObj.setCommentMessage=function(c,b,d){var a="wpdiscuz-message-error";if(c instanceof Array)for(var e in c)b instanceof Array?"success"===b[e]?a="wpdiscuz-message-success":"warning"===b[e]&&(a="wpdiscuz-message-warning"):"success"===b?a="wpdiscuz-message-success":"warning"===b&&(a="wpdiscuz-message-warning"),jQuery("<div/>").addClass(a).html(c[e]).prependTo("#wpdiscuz-comment-message").delay(d instanceof Array?d[e]:d||4e3).fadeOut(1e3,function(){jQuery(this).remove()});else"success"===b?a="wpdiscuz-message-success":"warning"===b&&(a="wpdiscuz-message-warning"),jQuery("<div/>").addClass(a).html(c).prependTo("#wpdiscuz-comment-message").delay(d||4e3).fadeOut(1e3,function(){jQuery(this).remove()})},wpdiscuzAjaxObj.applyFilterOnPhrase=function(a,b,c){return wpdiscuzAjaxObj.phraseFilters&&jQuery.each(wpdiscuzAjaxObj.phraseFilters,function(d){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[d]]&&(a=wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[d]](a,b,c))}),a},jQuery(document).ready(function($){$("body").addClass("wpdiscuz_"+wpdiscuzAjaxObj.version);var H,c=wpdiscuzAjaxObj.is_user_logged_in,q=1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!c,r=1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&c,e=wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion,s=parseInt(wpdiscuzAjaxObj.commentListLoadType),I=parseInt(wpdiscuzAjaxObj.wc_post_id);wpdiscuzAjaxObj.wpdiscuz_nonce="";var t=parseInt(wpdiscuzAjaxObj.commentListUpdateType),u=1e3*parseInt(wpdiscuzAjaxObj.commentListUpdateTimer),v=parseInt(wpdiscuzAjaxObj.liveUpdateGuests),w=wpdiscuzAjaxObj.loadLastCommentId,J=w,f=parseInt(wpdiscuzAjaxObj.firstLoadWithAjax);Cookies.get("wpdiscuz_comments_sorting")&&Cookies.remove("wpdiscuz_comments_sorting",{path:""}),Cookies.get("wordpress_last_visit")&&Cookies.remove("wordpress_last_visit",{path:""}),Cookies.get("wpdiscuz_last_visit")&&Cookies.remove("wpdiscuz_last_visit",{path:""});var i=parseInt(wpdiscuzAjaxObj.wordpressIsPaginate),K=wpdiscuzAjaxObj.storeCommenterData,L=parseInt(wpdiscuzAjaxObj.wmuEnabled),M=wpdiscuzAjaxObj.isCookiesEnabled,N=!0,g=wpdiscuzAjaxObj.cookiehash,O=parseInt(wpdiscuzAjaxObj.isLoadOnlyParentComments),P=parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0,x=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),j=parseInt(wpdiscuzAjaxObj.enableBubble),y=parseInt(wpdiscuzAjaxObj.bubbleLiveUpdate),k=parseInt(wpdiscuzAjaxObj.bubbleHintTimeout),Q=parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout)?parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout):5,R=parseInt(wpdiscuzAjaxObj.bubbleShowNewCommentMessage),h=wpdiscuzAjaxObj.bubbleLocation,l=wpdiscuzAjaxObj.inlineFeedbackAttractionType,m=parseInt(wpdiscuzAjaxObj.scrollSize),m=m||32,S=[],T=[],U=[],V=!1,z=1,W=$("html").css("scroll-behavior"),X=$("body").css("scroll-behavior");if($(".wc_social_plugin_wrapper .wp-social-login-provider-list").length?$(".wc_social_plugin_wrapper .wp-social-login-provider-list").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):$(".wc_social_plugin_wrapper .the_champ_login_container").length?$(".wc_social_plugin_wrapper .the_champ_login_container").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):$(".wc_social_plugin_wrapper .social_connect_form").length?$(".wc_social_plugin_wrapper .social_connect_form").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):$(".wc_social_plugin_wrapper .oneall_social_login_providers").length&&$(".wc_social_plugin_wrapper .oneall_social_login .oneall_social_login_providers").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"),wpdiscuzLoadRichEditor&&$("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0"),window.addEventListener("beforeunload",function(c){var b=$(".wpd-form").not(":hidden");if(b.length){if(wpdiscuzLoadRichEditor&&document.querySelector(".wpdiscuz-textarea-wrap")){for(var a=0;a<b.length;a++)if("\n"!==wpDiscuzEditor.createEditor($(b[a]).find(".ql-container").attr("id")).getText()){c.preventDefault(),c.returnValue="";return}}else for(var a=0;a<b.length;a++)if($(b[a]).find(".wc_comment").val()){c.preventDefault(),c.returnValue="";return}}}),wpdiscuzLoadRichEditor||($(document).delegate("textarea.wc_comment","input",function(){aD($(this))}),$.each($("textarea.wc_comment"),function(){aD($(this))})),$("body").on("focus","#wpdcom .ql-editor, #wpdcom .wc_comment",function(){$(".wpd-form-foot",$(this).parents(".wpd_comm_form")).slideDown(P)}),$("body").on("focus","#wpdcom textarea",function(){$(this).next(".autogrow-textarea-mirror").length||$(this).autoGrow()}),c||aa({comment_author:Cookies.get("comment_author_"+g),comment_author_email:Cookies.get("comment_author_email_"+g),comment_author_url:Cookies.get("comment_author_url_"+g)}),$(".wpd-vote-down.wpd-dislike-hidden").remove(),$(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd"),$("body").on("click","#wpd-editor-source-code-wrapper-bg",function(){$(this).hide(),$("#wpd-editor-source-code-wrapper").hide(),$("#wpd-editor-uid").val(""),$("#wpd-editor-source-code").val("")}),wpdiscuzLoadRichEditor&&$("body").on("click","#wpd-insert-source-code",function(){var a=wpDiscuzEditor.createEditor("#"+$("#wpd-editor-uid").val());a.deleteText(0,a.getLength(),Quill.sources.USER);var b=$("#wpd-editor-source-code").val();b.length&&a.clipboard.dangerouslyPasteHTML(0,b,Quill.sources.USER),a.update(),$("#wpd-editor-source-code-wrapper-bg").hide(),$("#wpd-editor-source-code-wrapper").hide(),$("#wpd-editor-uid").val(""),$("#wpd-editor-source-code").val("")}),$("body").on("click",".wpd-reply-button",function(){var a=aj($(this),0);$(this).hasClass("wpdiscuz-clonned")?(wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+a).focus()},P):setTimeout(function(){$("#wc-textarea-"+a).trigger("focus")},P),$("#wpd-secondary-form-wrapper-"+a).slideToggle(P)):ah($(this)),function(a){if((q||r)&&"2.0"===e){var b=ak(a);setTimeout(function(){if(!T[b])try{T[b]=grecaptcha.render("wpdiscuz-recaptcha-"+a,{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(b){$("#wpdiscuz-recaptcha-field-"+a).val("key")},"expired-callback":function(){$("#wpdiscuz-recaptcha-field-"+a).val("")}})}catch(c){console.log(c),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+c.message,"error")}},1e3)}}(a)}),$("body").on("click","#wpdcom [data-wpd-clipboard]",function(){var b=$(this).data("wpd-clipboard"),a=$("<input/>");a.appendTo("body").css({position:"absolute",top:"-10000000px"}).val(b),a.trigger("select"),document.execCommand("copy"),a.remove(),wpdiscuzAjaxObj.setCommentMessage(b+"<br/>"+wpdiscuzAjaxObj.wc_copied_to_clipboard,"success",5e3)}),$("body").on("click",".wpdiscuz-nofollow,.wc_captcha_refresh_img,.wpd-load-more-submit",function(a){a.preventDefault()}),$("body").on("click",".wpd-toggle.wpd_not_clicked",function(){var a=$(this);a.removeClass("wpd_not_clicked");var b=aj($(this),0),c=$(this),d=$(".fas",c);!c.parents(".wpd-comment:not(.wpd-reply)").children(".wpd-reply").length&&O?aw(b,a):$("#wpd-comm-"+b+"> .wpd-reply").slideToggle(700,function(){$(this).is(":hidden")?(d.removeClass("fa-chevron-up"),d.addClass("fa-chevron-down"),c.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_show_replies_text),c.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_show_replies_text)):(d.removeClass("fa-chevron-down"),d.addClass("fa-chevron-up"),c.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),c.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text)),a.addClass("wpd_not_clicked")})}),$("body").on("mouseenter",".wpd-new-loaded-comment",function(){$(this).removeClass("wpd-new-loaded-comment")}),$("body").on("click",".wpd-sbs-toggle",function(){$(".wpdiscuz-subscribe-bar").slideToggle(P)}),parseInt(wpdiscuzAjaxObj.wpDiscuzIsShowOnSubscribeForm)&&!c&&wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&$("#wpdiscuz-subscribe-form").length&&("2.0"===e?(setTimeout(function(){try{grecaptcha.render("wpdiscuz-recaptcha-subscribe-form",{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(a){$("#wpdiscuz-recaptcha-field-subscribe-form").val("key")},"expired-callback":function(){$("#wpdiscuz-recaptcha-field-subscribe-form").val("")}})}catch(a){console.log(a),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+a.message,"error")}},1e3),$("body").on("submit","#wpdiscuz-subscribe-form",function(a){$("#wpdiscuz-recaptcha-field-subscribe-form").val()?$(".wpdiscuz-recaptcha",$(this)).css("border","none"):($(".wpdiscuz-recaptcha",$(this)).css("border","1px solid red"),a.preventDefault())})):"3.0"===e&&$("body").on("click","#wpdiscuz_subscription_button",function(b){var c=$(this).parents("#wpdiscuz-subscribe-form");b.preventDefault();try{grecaptcha.ready(function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/wpdAddSubscription"}).then(function(a){console.log(5555),document.getElementById("wpdiscuz-recaptcha-field-subscribe-form").value=a,c.trigger("submit")},function(a){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(a)})})}catch(a){console.log(a),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+a.message,"error")}})),(q||r)&&"2.0"===e){var A=$(window).width(),a=$("#wpdcom").width();a>=1100&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"65%"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"35%"})),a>=940&&a<1100&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"60%"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"40%"})),a>=810&&a<940&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"40%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"60%"})),a>=730&&a<810&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"45%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"55%"})),a>=610&&a<730&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.85)","-webkit-transform":"scale(0.85)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"43%"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"55%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"30%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"70%"})),A>650&&(a>=510&&a<610&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"center 0","-webkit-transform-origin":"center 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"35%"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"63%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"30%",position:"relative",right:"-60px"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"70%"}),$("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"})),a>=470&&a<510&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"center 0","-webkit-transform-origin":"center 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"40%"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"60%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({float:"none",width:"100%",display:"block"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({float:"none",width:"100%",display:"block"}),$("#wpdcom .wpd_main_comm_form .wc-form-footer").css({"margin-left":"0px"}),$("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"})),a<470&&($("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({margin:"0px auto","transform-origin":"center 0","-webkit-transform-origin":"center 0"}),$("#wpdcom .wpd-form-col-left").css({float:"none",width:"100%",display:"block"}),$("#wpdcom .wpd-form-col-right").css({float:"none",width:"100%",display:"block"}),$("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"}),$("#wpdcom .wpd-secondary-form-wrapper .wc_notification_checkboxes").css({"text-align":"center"}),$("#wpdcom .wpd-secondary-form-wrapper .wc-field-submit").css({"text-align":"center"})))}function Y(b,a,c){G(x||L,!1,a).done(function(a){if($(c).addClass("wpd_not_clicked"),"object"==typeof a){if(a.success){"collapsed"===wpdiscuzAjaxObj.commentFormView&&$(".wpd-form-foot",b).slideUp(P),a.data.wc_all_comments_count_new=parseInt(a.data.wc_all_comments_count_new),$(".wpd-thread-info").html(a.data.wc_all_comments_count_before_threads_html),$(".wpd-thread-info").attr("data-comments-count",a.data.wc_all_comments_count_new),$("#wpd-bubble-all-comments-count").replaceWith(a.data.wc_all_comments_count_bubble_html);var d=P;a.data.is_main?az(a.data.message):(d=P+700,$("#wpd-secondary-form-wrapper-"+a.data.uniqueid).slideToggle(700),1==a.data.is_in_same_container?$("#wpd-secondary-form-wrapper-"+a.data.uniqueid).after(a.data.message):$("#wpd-comm-"+a.data.uniqueid).after(a.data.message)),Z(a),_(a),M&&N?ab(a.data):N||$(".wpd-cookies-checkbox").prop("checked",!1),b.get(0).reset(),wpdiscuzLoadRichEditor?wpDiscuzEditor.createEditor("#wpd-editor-"+$(".wpdiscuz_unique_id",b).val()).setContents([{insert:"\n"}]):aD(b.find(".wc_comment")),aa(a.data),$(".wmu-preview-wrap",b).remove(),ay(),parseInt(wpdiscuzAjaxObj.scrollToComment)&&setTimeout(function(){au(),$("html, body").animate({scrollTop:$("#comment-"+a.data.new_comment_id).offset().top-m},1e3,av)},d),aE(a,b)}else a.data&&(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,b),"error"),aE(a,b))}else wpdiscuzAjaxObj.setCommentMessage(a,"error");$("#wpdiscuz-loading-bar").fadeOut(250),V=!1}).fail(function(b,d,a){console.log(a),$(c).addClass("wpd_not_clicked"),$("#wpdiscuz-loading-bar").fadeOut(250)})}function Z(b){if(!b.data.held_moderate){var a=new FormData;a.append("action","wpdCheckNotificationType"),a.append("comment_id",b.data.new_comment_id),a.append("email",b.data.comment_author_email),a.append("isParent",b.data.is_main),G(x,!0,a)}}function _(a){if(a.data.redirect>0&&a.data.new_comment_id){var b=new FormData;b.append("action","wpdRedirect"),b.append("commentId",a.data.new_comment_id),G(x,!0,b).done(function(a){"object"==typeof a&&a.success&&setTimeout(function(){location.href=a.data},2e3)}).fail(function(b,c,a){console.log(a)})}}function aa(a){$(".wpd_comm_form .wc_name").val(a.comment_author),a.comment_author_email&&0>a.comment_author_email.indexOf("@example.com")&&$(".wpd_comm_form .wc_email").val(a.comment_author_email),a.comment_author_url&&$(".wpd_comm_form .wc_website").val(a.comment_author_url)}function ab(b){var c=b.comment_author_email,d=b.comment_author,a=b.comment_author_url;null==K?(Cookies.set("comment_author_email_"+g,c),Cookies.set("comment_author_"+g,d),a.length&&Cookies.set("comment_author_url_"+g,a)):(K=parseInt(K),Cookies.set("comment_author_email_"+g,c,{expires:K,path:"/"}),Cookies.set("comment_author_"+g,d,{expires:K,path:"/"}),a.length&&Cookies.set("comment_author_url_"+g,a,{expires:K,path:"/"})),$(".wpd-cookies-checkbox").length&&$(".wpd-cookies-checkbox").prop("checked",!0)}function ac(a,b){$("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").show(),$("#wpd-comm-"+a+" .wpdiscuz-edit-form-wrap").replaceWith(b),$("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-last-edited").show()}$("body").on("click",".wc_comm_submit.wpd_not_clicked",function(){var d=$(this),f=1,a=$(this).parents("form");if("true"===a.attr("data-uploading")){wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhraseDoingUpload,"wmuPhraseDoingUpload",a),"warning");return}if(a.hasClass("wpd_main_comm_form")||(f=an($(this).parents(".wpd-comment"))),as(a,"#wpd-editor-"+$(".wpdiscuz_unique_id",a).val()),a.on("submit",function(a){a.preventDefault()}),a[0].checkValidity()&&(h=a,i=!0,"2.0"===e&&$("input[name=wc_captcha]",h).length&&!$("input[name=wc_captcha]",h).val().length?(i=!1,$(".wpdiscuz-recaptcha",h).css("border","1px solid red")):"2.0"===e&&$("input[name=wc_captcha]",h).length&&$(".wpdiscuz-recaptcha",h).css("border","none"),i)){V=!0,ax(a),$(d).removeClass("wpd_not_clicked");var h,i,b=new FormData;if(b.append("action","wpdAddComment"),$(":input",a).each(function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&b.append(this.name+"",$(this).val().trim()),("checkbox"==this.type||"radio"==this.type)&&$(this).is(":checked")&&b.append(this.name+"",$(this).val())}),b.append("wpd_comment_depth",f),wpdiscuzAjaxObj.wpdiscuz_zs&&b.append("wpdiscuz_zs",wpdiscuzAjaxObj.wpdiscuz_zs),$(".wpd-cookies-checkbox",a).length?$(".wpd-cookies-checkbox",a).prop("checked")||(N=!1):c&&(N=!1),$("#wpdiscuz-loading-bar").show(),wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&"3.0"===e&&(1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!wpdiscuzAjaxObj.is_user_logged_in||1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&wpdiscuzAjaxObj.is_user_logged_in))try{grecaptcha.ready(function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/addComment"}).then(function(c){b.append("g-recaptcha-response",c),Y(a,b,d)},function(a){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(a)})})}catch(g){console.log(g),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+g.message,"error"),$("#wpdiscuz-loading-bar").fadeOut(250)}else Y(a,b,d)}(function(a){if((q||r)&&"2.0"===e){var b=ak(a);grecaptcha.reset(T[b])}})($(".wpdiscuz_unique_id",a).val()),ar()}),$("body").on("click",".wpd_editable_comment",function(){H&&$(".wpdiscuz-edit-form-wrap").length&&ac(aj($(".wpdiscuz-edit-form-wrap"),0),H);var c=$(this),b=aj(c,0),d=ak(b),a=new FormData;a.append("action","wpdEditComment"),a.append("commentId",d),H=$("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-text").get(0),G(x,!0,a).done(function(a){if("object"==typeof a){if(a.success){if($("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text").replaceWith(a.data.html),wpdiscuzLoadRichEditor){var d=wpDiscuzEditor.createEditor("#wpd-editor-edit_"+b);d.clipboard.dangerouslyPasteHTML(0,a.data.content),d.update(),$(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd")}else $("#wc-textarea-edit_"+b).val(a.data.content),aD($("#wc-textarea-edit_"+b));$("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").hide(),$("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-last-edited").hide()}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,c),"error")}else console.log(a);$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("click",".wc_save_edited_comment",function(){var d=$(this),b=aj(d),e=ak(b),a=$("#wpd-comm-"+b+" #wpdiscuz-edit-form");if(as(a,"#wpd-editor-edit_"+b),a.on("submit",function(a){a.preventDefault()}),a[0].checkValidity()){var c=new FormData;c.append("action","wpdSaveEditedComment"),c.append("commentId",e),$(":input",a).each(function(){""!==this.name&&"checkbox"!==this.type&&"radio"!==this.type&&c.append(this.name+"",$(this).val()),("checkbox"===this.type||"radio"===this.type)&&$(this).is(":checked")&&c.append(this.name+"",$(this).val())}),G(x,!0,c).done(function(a){"object"==typeof a?(a.success?(ac(b,a.data.message),a.data.comment_approved_html&&$("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-subheader").append(a.data.comment_approved_html),a.data.lastEdited&&($("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-last-edited").remove(),$(a.data.lastEdited).insertAfter("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text")),a.data.twitterShareLink&&$("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_tw").attr("href",a.data.twitterShareLink),a.data.whatsappShareLink&&$("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_whatsapp").attr("href",a.data.whatsappShareLink),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+b)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,d),"error"),aE(a,e)):console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}}),$("body").on("click",".wc_cancel_edit",function(){var a=aj($(this));ac(a,H),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+a)}),!i&&f&&(z=0,1==f?setTimeout(function(){ae(!0)},500):$("body").on("click",".wpd-load-comments",function(){$(this).parent(".wpd-load-more-submit-wrap").remove(),ae(!0)})),$("body").on("click",".wpd-load-more-submit",function(){var a=$(this),b="wpd-loaded";a.hasClass(b)&&ae(!1,a,b,"wpd-loading")});var ad=!1;function B(){var a=document.getElementById("wpdiscuzHasMoreComments"),b=0;a&&(b=a.dataset.is_show_load_more);var c=document.getElementById("wpdcom")?document.getElementById("wpdcom").clientHeight:0,d=$(window).height()+$(window).scrollTop();c&&d&&100*d/c>=80&& !1===ad&&1==b&&(ad=!0,ae(!1,$(".wpd-load-more-submit")))}function ae(c,b,e,g){b&&(b.toggleClass(e),b.toggleClass(g));var a=new FormData;a.append("action","wpdLoadMoreComments");var d=$(".wpdiscuz-sort-button-active").attr("data-sorting");d&&a.append("sorting",d),a.append("offset",z),a.append("lastParentId",al()),a.append("isFirstLoad",c?1:0);var h=$(".wpdf-active").attr("data-filter-type");a.append("wpdType",h||""),G(x,!c||1!=f,a).done(function(a){"object"==typeof a&&a.success&&(z++,c&&$(".wpd-comment").remove(),$(".wpdiscuz_single").remove(),$(".wpdiscuz-comment-pagination").before(a.data.comment_list),C(a,c&&2!==s),ad=!1,a.data.loadLastCommentId&&(w=a.data.loadLastCommentId),aE(a),c&&D(!1)),$("#wpdiscuz-loading-bar").fadeOut(250),$(".wpd-load-more-submit").blur(),b&&(b.toggleClass(e),b.toggleClass(g))}).fail(function(c,d,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250),$(".wpd-load-more-submit").blur(),b&&(b.toggleClass(e),b.toggleClass(g))})}function C(a,d){var b=document.getElementById("wpdiscuzHasMoreComments");if(!1==a.data.is_show_load_more)b&&(b.dataset.is_show_load_more=0),$(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide();else if(am(a.data.last_parent_id),b&&(b.dataset.is_show_load_more=1),d&&$(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").show(),a.data.comments_left>0){if(!$(".wpd-load-more-submit .wpd-comments-left").length){let c=$("<span>");c.addClass("wpd-comments-left"),$(".wpd-load-more-submit").append(c)}$(".wpd-load-more-submit .wpd-comments-left").text(a.data.comments_left_text)}aE(a)}function D(d){var b=location.href.match(/#comment\-(\d+)/);if(null!==b){var c=b[1];if($("#comment-"+c).length)setTimeout(function(){au(),$("html, body").animate({scrollTop:$("#comment-"+c).parents("[id^=wpd-comm-]").offset().top-m},1e3,av),d&&af(c)},500);else{var a=new FormData;a.append("action","wpdGetSingleComment"),a.append("commentId",c),G(x,!0,a).done(function(a){if("object"==typeof a&&a.success){var b="#comment-"+c;$("#comment-"+a.data.parentCommentID).length?$("#comment-"+a.data.parentCommentID).parents("[id^=wpd-comm-"+a.data.parentCommentID+"]").replaceWith(a.data.message):$(".wpd-thread-list").prepend(a.data.message),aE(a),au(),$("html, body").animate({scrollTop:$(b).offset().top-m},1e3,av),d&&af(c)}$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}}}function af(a){setTimeout(function(){$("#comment-"+a).siblings(".wpd-secondary-form-wrapper").is(":visible")||$("#comment-"+a).find(".wpd-reply-button").trigger("click")},1100)}function ag(b){if(void 0!==b.data.message)for(var c,d=b.data.message,a=0;a<d.length;a++)ap((c=d[a]).comment_parent,c.comment_html)}function ah(b){var a=aj(b,0);$("#wpdiscuz_form_anchor-"+a).before(ai(a));var d=$("#wpd-secondary-form-wrapper-"+a);c||aa({comment_author:Cookies.get("comment_author_"+g),comment_author_email:Cookies.get("comment_author_email_"+g),comment_author_url:Cookies.get("comment_author_url_"+g)}),wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+a).focus()},P):setTimeout(function(){$("#wc-textarea-"+a).trigger("focus")},P),d.slideToggle(P,function(){b.addClass("wpdiscuz-clonned")})}function ai(a){return $("#wpdiscuz_hidden_secondary_form").html().replace(/wpdiscuzuniqueid/g,a)}function aj(a,c){var b="";return(b=c?a.parents(".wpd-main-form-wrapper").attr("id"):a.parents(".wpd-comment").attr("id")).substring(b.lastIndexOf("-")+1)}function ak(a){return a.substring(0,a.indexOf("_"))}function al(){return $(".wpd-load-more-submit").attr("data-lastparentid")}function am(a){$(".wpd-load-more-submit").attr("data-lastparentid",a),2!==s&&$(".wpdiscuz-comment-pagination").show()}function an(a){var b=a.attr("class").split(" "),c="";return $.each(b,function(b,a){"wpd_comment_level"===ao(a,!1)&&(c=ao(a,!0))}),parseInt(c)+1}function ao(a,b){return b?a.substring(a.indexOf("-")+1):a.substring(0,a.indexOf("-"))}function ap(a,b){if(0==a)az(b);else{var c=aj($("#comment-"+a),0);$("#wpdiscuz_form_anchor-"+c).after(b)}}function aq(){var a=[];return $(".wpd-comment-right").each(function(){a.push(ak(aj($(this),0)))}),a.join(",")}function ar(){$(".wpdiscuz_reset").val("")}function as(a,b){var c=a.find(".wpd-required-group");wpdiscuzLoadRichEditor&&a.find(".wc_comment").val($(b+">.ql-editor").html()),at(a),$.each(c,function(){$("input",this).prop("required",!1),0===$("input:checked",this).length?$("input",$(this)).prop("required",!0):$(".wpd-field-invalid",this).remove()})}function at(c){var b=c.find(".wc_comment"),a=b.val().trim().replace(/<p><br><\/p>/g,"\n").replace(/<p>(.*?)<\/p>/g,"$1\n");a=(a=(a=(a=a.replace(/<img src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img[^>]+alt=["|']([^"|']+)["|'][^>]+src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'][^>]?>/g," $1 ")).replace(/<img\s+([^>]*)class=["|']wpdem\-sticker["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img\s+([^>]*)src=["|']([^"|']+)["|'](.*?)[^>]*>/g," $2 "),b.val(a)}function au(){$("html, body").css("scroll-behavior","unset")}function av(){$("html").css("scroll-behavior",W),$("body").css("scroll-behavior",X)}function aw(b,d){var c=ak(b),a=new FormData;a.append("action","wpdShowReplies"),a.append("commentId",c),G(x,!0,a).done(function(a){d.addClass("wpd_not_clicked"),"object"==typeof a&&a.success&&($("#wpd-comm-"+b).replaceWith(a.data.comment_list),$("#wpd-comm-"+b+" .wpd-toggle .fas").removeClass("fa-chevron-down").addClass("fa-chevron-up"),$("#wpd-comm-"+b+" .wpd-toggle .wpd-view-replies .wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),$("#wpd-comm-"+b+" .wpd-toggle").attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text),aE(a)),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),d.addClass("wpd_not_clicked"),$("#wpdiscuz-loading-bar").fadeOut(250)})}function ax(a){$(".wpd-agreement-checkbox",a).each(function(){$(this).hasClass("wpd_agreement_hide")&&M&&$(this).prop("checked")&&(Cookies.set($(this).attr("name")+"_"+g,1,{expires:30,path:"/"}),$("input[name="+$(this).attr("name")+"]").each(function(){S.push($(this))}))})}function ay(){S.length&&(S.forEach(function(a){a.parents(".wpd-field-checkbox").remove()}),S=[])}function az(a){$(".wpd-sticky-comment").last()[0]?$(a).insertAfter($(".wpd-sticky-comment").last()[0]):$(".wpd-thread-list").prepend(a)}function E(a){a?a.prop("required")||(a.val()?a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none")):$.each($(".wc_email"),function(c,b){var a=$(b);a.prop("required")||(a.val()?a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none"))})}if(2!==s||i||($(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide(),B(),$(window).scroll(function(){B()})),wpdiscuzAjaxObj.setLoadMoreVisibility=C,$("body").on("click",".wpd-vote-up.wpd_not_clicked, .wpd-vote-down.wpd_not_clicked",function(){var b,c=$(this);$(c).removeClass("wpd_not_clicked");var d=aj(c),e=ak(d);b=$(this).hasClass("wpd-vote-up")?1:-1;var a=new FormData;a.append("action","wpdVoteOnComment"),a.append("commentId",e),a.append("voteType",b),G(x,!0,a).done(function(a){if($(c).addClass("wpd_not_clicked"),"object"==typeof a){if(a.success){if("total"===a.data.buttonsStyle){var d=$(".wpd-comment-footer .wpd-vote-result",$("#comment-"+e)),h=a.data.votes;d.text(a.data.votesHumanReadable),d.attr("title",h),d.removeClass("wpd-up wpd-down"),h>0&&d.addClass("wpd-up"),h<0&&d.addClass("wpd-down")}else{var f=$(".wpd-comment-footer .wpd-vote-result-like",$("#comment-"+e)),g=$(".wpd-comment-footer .wpd-vote-result-dislike",$("#comment-"+e));f.text(a.data.likeCountHumanReadable),f.attr("title",a.data.likeCount),g.text(a.data.dislikeCountHumanReadable),g.attr("title",a.data.dislikeCount),parseInt(a.data.likeCount)>0?f.addClass("wpd-up"):f.removeClass("wpd-up"),0>parseInt(a.data.dislikeCount)?g.addClass("wpd-down"):g.removeClass("wpd-down")}var i=$(".wpd-comment-footer .wpd-vote-up",$("#comment-"+e)),j=$(".wpd-comment-footer .wpd-vote-down",$("#comment-"+e));i.removeClass("wpd-up"),j.removeClass("wpd-down"),a.data.curUserReaction>0?i.addClass("wpd-up"):a.data.curUserReaction<0&&j.addClass("wpd-down")}else a.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,c),"error");aE(a,e,b)}else console.log(a);$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,d,a){console.log(a),$(c).addClass("wpd_not_clicked"),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$(document).on("click","body",function(b){var a=$(".wpdiscuz-sort-buttons");$(b.target).hasClass("wpdf-sorting")||$(b.target).parent().hasClass("wpdf-sorting")?a.css({display:a.is(":visible")?"none":"flex"}):a.hide()}),$("body").on("click",".wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)",function(){var c=$(this),b=$(this).attr("data-sorting");if(b){$(".wpdiscuz-sort-button.wpdiscuz-sort-button-active").removeClass("wpdiscuz-sort-button-active").appendTo(".wpdiscuz-sort-buttons"),c.addClass("wpdiscuz-sort-button-active").prependTo(".wpdf-sorting");var a=new FormData;a.append("action","wpdSorting"),a.append("sorting",b);var d=$(".wpdf-active").attr("data-filter-type");a.append("wpdType",d||""),G(x,!0,a).done(function(a){"object"==typeof a&&a.success&&($("#wpdcom .wpd-comment").remove(),$("#wpdcom .wpd-thread-list").prepend(a.data.message),C(a,!1),z=1),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}}),window.onhashchange=function(){D(!1)},1!=f&&D(!1),$("body").on("click",".wpdiscuz-readmore",function(){var b=aj($(this)),c=ak(b),a=new FormData;a.append("action","wpdReadMore"),a.append("commentId",c),G(x,!0,a).done(function(a){"object"==typeof a?(a.success?($("#comment-"+c+" .wpd-comment-text").replaceWith(" "+a.data.message),$("#wpdiscuz-readmore-"+b).remove()):console.log(a.data),aE(a)):console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("change",".wpd-required-group",function(){0!==$("input:checked",this).length?$("input",$(this)).prop("required",!1):$("input",$(this)).prop("required",!0)}),$("body").on("click",".wpdiscuz-spoiler",function(){$(this).next().slideToggle(),$(this).hasClass("wpdiscuz-spoiler-closed")?$(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-plus").removeClass("fa-plus").addClass("fa-minus"):$(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-minus").removeClass("fa-minus").addClass("fa-plus"),$(this).toggleClass("wpdiscuz-spoiler-closed")}),$("body").on("click",".wpd-tools i",function(){var a=$(this).siblings(".wpd-tools-actions");a.is(":visible")||$(this).parents(".wpd-comment-right").attr("id")!==$("[id^=comment-]","#wpdcom").last().attr("id")||$("#comments").css({paddingBottom:"160px"}),a.css({display:a.is(":visible")?"none":"flex"})}),$("body").on("mouseleave",".wpd-comment-right",function(){$(this).find(".wpd-tools-actions").hide(),$("#comments").css({paddingBottom:"0"})}),$("body").on("click",".wpd_stick_btn",function(){var b=aj($(this),0),c=ak(b),a=new FormData;a.append("action","wpdStickComment"),a.append("commentId",c),G(x,!0,a).done(function(a){"object"==typeof a&&a.success&&location.reload(!0),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("click",".wpd_close_btn",function(){var b=aj($(this),0),c=ak(b),a=new FormData;a.append("action","wpdCloseThread"),a.append("commentId",c),G(x,!0,a).done(function(a){"object"==typeof a&&a.success&&location.reload(!0),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("click",".wpd-filter.wpd_not_clicked[data-filter-type]",function(){var b=$(this),c=b.attr("data-filter-type");wpdiscuzAjaxObj.resetActiveFilters(".wpdf-"+c),b.removeClass("wpd_not_clicked"),$(".fas",b).addClass("fa-pulse fa-spinner");var a=new FormData;a.append("action","wpdLoadMoreComments");var d=$(".wpdiscuz-sort-button-active").attr("data-sorting");d&&a.append("sorting",d),a.append("lastParentId",0),a.append("offset",0),z=1,a.append("wpdType",b.hasClass("wpdf-active")?"":c),a.append("isFirstLoad",1),$(this).hasClass("wpdf-inline")?$(this).hasClass("wpdf-active")?$(".wpd-comment-info-bar").hide():$(".wpd-comment-info-bar").css("display","flex"):$(".wpd-comment-info-bar").hide(),G(x,!1,a).done(function(a){b.addClass("wpd_not_clicked"),$(".fas",b).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(b.toggleClass("wpdf-active"),$(".wpd-load-comments").remove(),$(".wpd-comment").remove(),$(".wpd-thread-list").prepend(a.data.comment_list),C(a),w=a.data.loadLastCommentId,$(".wpd-load-more-submit").blur(),aE(a)),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("click",".wpdf-reacted.wpd_not_clicked",function(){var a=$(this);a.removeClass("wpd_not_clicked"),$(".fas",a).addClass("fa-pulse fa-spinner");var b=new FormData;b.append("action","wpdMostReactedComment"),G(x,!1,b).done(function(b){a.addClass("wpd_not_clicked"),$(".fas",a).removeClass("fa-pulse fa-spinner"),"object"==typeof b&&b.success&&($("#comment-"+b.data.parentCommentID).length?$("#comment-"+b.data.parentCommentID).parents("[id^=wpd-comm-"+b.data.parentCommentID+"]").replaceWith(b.data.message):$("#comment-"+b.data.commentId).length||$(".wpd-thread-list").prepend(b.data.message),aE(b),au(),$("html, body").animate({scrollTop:$("#comment-"+b.data.commentId).offset().top-m},1e3,av))}).fail(function(c,d,b){console.log(b),$(".fas",a).removeClass("fa-pulse fa-spinner")})}),$("body").on("click",".wpdf-hottest.wpd_not_clicked",function(){var a=$(this);a.removeClass("wpd_not_clicked"),$(".fas",a).addClass("fa-pulse fa-spinner");var b=new FormData;b.append("action","wpdHottestThread"),G(x,!1,b).done(function(b){a.addClass("wpd_not_clicked"),$(".fas",a).removeClass("fa-pulse fa-spinner"),"object"==typeof b&&b.success&&($("#comment-"+b.data.commentId).length?$("#comment-"+b.data.commentId).parents("[id^=wpd-comm-"+b.data.commentId+"]").replaceWith(b.data.message):$(".wpd-thread-list").prepend(b.data.message),aE(b),au(),$("html, body").animate({scrollTop:$("#comment-"+b.data.commentId).offset().top-m},1e3,av))}).fail(function(c,d,b){console.log(b),$(".fas",a).removeClass("fa-pulse fa-spinner")})}),$("body").on("click",".wpd-filter-view-all",function(){$(".wpdf-inline.wpdf-active.wpd_not_clicked").trigger("click")}),$("body").on("click",".wpd-follow-link.wpd_not_clicked",function(){var a=$(this);a.removeClass("wpd_not_clicked"),$(".fas",a).addClass("fa-pulse fa-spinner");var c=aj(a,0),d=ak(c),b=new FormData;b.append("action","wpdFollowUser"),b.append("commentId",d),G(x,!0,b).done(function(b){a.addClass("wpd_not_clicked"),"object"==typeof b?b.success?(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[b.data.code],b.data.code,a),"success"),a.removeClass("wpd-follow-active"),b.data.followTip&&a.attr("wpd-tooltip",b.data.followTip),b.data.followClass&&a.addClass(b.data.followClass),aE(b)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[b.data],b.data,a),"error"):console.log(b),$(".fas",a).removeClass("fa-pulse fa-spinner"),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(c,d,b){console.log(b),$(".fas",a).removeClass("fa-pulse fa-spinner"),$("#wpdiscuz-loading-bar").fadeOut(250)})}),E(),$("body").on("keyup",".wc_email",function(){E($(this))}),j&&$("#wpdcom").length){if($("#wpd-bubble-wrapper").hover(function(){$(this).addClass("wpd-bubble-hover")},function(){$(this).removeClass("wpd-bubble-hover")}),k&&!Cookies.get(wpdiscuzAjaxObj.cookieHideBubbleHint)&&setTimeout(function(){$("#wpd-bubble-wrapper").addClass("wpd-bubble-hover"),Cookies.set(wpdiscuzAjaxObj.cookieHideBubbleHint,"1",{expires:7,path:"/"}),setTimeout(function(){$("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")},1e3*Q)},1e3*k),"content_left"===h){if($(".entry-content").length){var b=Math.min($(".entry-content").offset().left,$("#wpdcom").offset().left)-120,d=b>25?b:25;$("#wpd-bubble-wrapper").css({left:d+"px"}),$("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if($(".post-entry").length){var b=Math.min($(".post-entry").offset().left,$("#wpdcom").offset().left)-120,d=b>25?b:25;$("#wpd-bubble-wrapper").css({left:d+"px"}),$("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if($(".container").length){var b=Math.min($(".container").offset().left,$("#wpdcom").offset().left)-120,d=b>25?b:25;$("#wpd-bubble-wrapper").css({left:d+"px"}),$("#wpd-bubble-wrapper").addClass("wpd-left-content")}else $("#wpd-bubble-wrapper").css({left:"25px"}),$("#wpd-bubble-wrapper").addClass("wpd-left-corner")}else"left_corner"===h?($("#wpd-bubble-wrapper").css({left:"25px"}),$("#wpd-bubble-wrapper").addClass("wpd-left-corner")):"right_corner"===h&&($("#wpd-bubble-wrapper").css({right:"25px"}),$("#wpd-bubble-wrapper").addClass("wpd-right-corner"));$("#wpd-bubble-wrapper").show(),$("body").on("click","#wpd-bubble-add-message-close",function(a){a.preventDefault(),a.stopPropagation(),$("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")}),$("body").on("click","#wpd-bubble",function(){au(),$("#tab-title-reviews").length&&$("#tab-title-reviews a").trigger("click"),$("html, body").animate({scrollTop:$("#wpdcom").offset().top-(m+28)},1e3,function(){av(),$("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover"),wpdiscuzLoadRichEditor?$("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0").focus():$("#wc-textarea-0_0").length&&$("#wc-textarea-0_0").trigger("focus")})}),$("body").on("click","#wpd-bubble-comment-close",function(a){a.preventDefault(),$("#wpd-bubble-notification-message").hide(),$("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")}),$("body").on("click","#wpd-bubble-comment-reply-link a",function(){var a=$(this).attr("href");setTimeout(function(){$("#wpd-bubble-notification-message").hide(),$("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),D(!0);var b=a.match(/#comment\-(\d+)/);U=U.filter(function(a){return a!=b[1]}),$("#wpd-bubble-count .wpd-new-comments-count").text(U.length),0==U.length&&$("#wpd-bubble-count").removeClass("wpd-new-comments")},100)}),$("body").on("click","#wpd-bubble-count",function(){if(U.length){var a=new FormData;a.append("action","wpdBubbleUpdate"),a.append("newCommentIds",U.join()),G(x,!0,a).done(function(a){"object"==typeof a&&a.success&&(a.data.message=a.data.message.filter(function(a){if(!$("#comment-"+a.comment_id).length)return a}),ag(a),$("#wpd-bubble-count").removeClass("wpd-new-comments"),$("#wpd-bubble-count .wpd-new-comments-count").text("0"),U=[],$(".wpd-new-loaded-comment").length&&(au(),$("html, body").animate({scrollTop:$($(".wpd-new-loaded-comment")[0]).offset().top-(m+28)},1e3,av)),aE(a)),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a)})}})}function F(){$.ajax({type:"GET",url:wpdiscuzAjaxObj.bubbleUpdateUrl,beforeSend:function(a){a.setRequestHeader("X-WP-Nonce",wpdiscuzAjaxObj.restNonce)},data:{postId:I,lastId:J,visibleCommentIds:aq()}}).done(function(a){if(!V){if("object"==typeof a){if(a.commentIDsToRemove.forEach(function(a){$("[id^=wpd-comm-"+a+"]").remove()}),a.ids.length){if(t){var b;(b=new FormData).append("action","wpdUpdateAutomatically"),b.append("loadLastCommentId",w),b.append("visibleCommentIds",aq()),G(x,!1,b).done(function(a){!V&&"object"==typeof a&&a.success&&(ag(a),a.data.wc_all_comments_count_new=parseInt(a.data.wc_all_comments_count_new),$(".wpd-thread-info").html(a.data.wc_all_comments_count_before_threads_html),$(".wpd-thread-info").attr("data-comments-count",a.data.wc_all_comments_count_new),$("#wpd-bubble-all-comments-count").replaceWith(a.data.wc_all_comments_count_bubble_html),w=a.data.loadLastCommentId)}).fail(function(b,c,a){console.log(a)})}a.ids=a.ids.filter(function(a){if(!$("#comment-"+a).length)return a});var c=5e3;J=parseInt(a.ids[a.ids.length-1]),U=U.concat(a.ids),R&&a.commentText&&($("#wpd-bubble-author-avatar").html(a.avatar),$("#wpd-bubble-author-name").html(a.authorName),$("#wpd-bubble-comment-date span").html(a.commentDate),$("#wpd-bubble-comment-text").html(a.commentText),$("#wpd-bubble-comment-reply-link a").attr("href",a.commentLink),$("#wpd-bubble-notification-message").show(),c=1e4);var d=parseInt($(".wpd-new-comments-count").text());d+=a.ids.length,$("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),$("#wpd-bubble-wrapper").addClass("wpd-new-comment-added"),setTimeout(function(){$("#wpd-bubble-notification-message").hide(),$("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")},c),$(".wpd-new-comments-count").text(d),$("#wpd-bubble-count").addClass("wpd-new-comments")}a.all_comments_count=parseInt(a.all_comments_count),$("#wpd-bubble-all-comments-count").replaceWith(a.all_comments_count_bubble_html),$(".wpd-reviews-tab").length||($(".wpd-thread-info").html(a.all_comments_count_before_threads_html),$(".wpd-thread-info").attr("data-comments-count",a.all_comments_count))}else console.log(a)}setTimeout(F,u)}).fail(function(b,c,a){console.log(a),setTimeout(F,u)})}if((j&&y||t)&&(c|| !c&&v)&&setTimeout(F,u),$(".wpd-inline-form-wrapper").length){var n=new FormData;n.append("action","wpdGetInlineCommentForm"),G(x,!1,n).done(function(a){"object"==typeof a?a.success?($(".wpd-inline-form-wrapper").append(a.data),$.each($("[name=_wpd_inline_nonce]"),function(){var b=$(this).attr("id"),a=$(this).parents(".wpd-inline-shortcode").attr("id");$(this).attr("id",b+"-"+a.substring(a.lastIndexOf("-")+1))}),$(".wpd-inline-opened").addClass("wpd-active"),$(".wpd-inline-opened").find(".wpd-inline-form-wrapper").show(),$(".wpd-inline-opened").find(".wpd-inline-icon").addClass("wpd-open"),$(".wpd-inline-opened").find(".wpd-inline-icon").removeClass("wpd-ignored"),aC()):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data]),a.data,"error"):console.log(a)}).fail(function(b,c,a){console.log(a)})}function aA(a){if($(a).hasClass("wpd-inline-shortcode"))var b=$(a).attr("id");else var b=$(a).parents(".wpd-inline-shortcode").attr("id");return b.substring(b.lastIndexOf("-")+1)}function aB(){$(".wpd-inline-form-wrapper").hide(),$(".wpd-inline-shortcode").removeClass("wpd-active"),$(".wpd-inline-icon").removeClass("wpd-open")}function o(){$.each($(".wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon"),function(){var a=$(this),b=a.offset().top-window.pageYOffset;a.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&b>0&&b<300&&("blink"===l?(a.addClass("wpd-blink"),setTimeout(function(){a.removeClass("wpd-blink")},3e3)):(a.parents(".wpd-inline-shortcode").addClass("wpd-active"),a.siblings(".wpd-inline-form-wrapper").show(),a.addClass("wpd-open"),aC(a.siblings(".wpd-inline-form-wrapper"))))})}function aC(a){if(a){if(a.offset().left<=10){a.css("left",Math.ceil(parseInt(a.css("left"))-a.offset().left+10));var b=Math.ceil(a.siblings(".wpd-inline-icon.wpd-open").offset().left-a.offset().left+2);b<3&&(b=3),document.styleSheets[0].addRule("#"+a.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+b+"px;")}else if(a.offset().left+a.width()>document.body.clientWidth-10){a.css("left",Math.ceil(parseInt(a.css("left"))+(document.body.clientWidth-(a.offset().left+a.width()))-10));var b=Math.ceil(a.siblings(".wpd-inline-icon.wpd-open").offset().left-a.offset().left+2);b>a.width()-3&&(b=a.width()-3),document.styleSheets[0].addRule("#"+a.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+b+"px;")}}else $.each($(".wpd-inline-form-wrapper:visible"),function(){if($(this).offset().left<=10){$(this).css("left",Math.ceil(parseInt($(this).css("left"))-$(this).offset().left+10));var a=Math.ceil($(this).siblings(".wpd-inline-icon.wpd-open").offset().left-$(this).offset().left+2);a<3&&(a=3),document.styleSheets[0].addRule("#"+$(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"px;")}else if($(this).offset().left+$(this).width()>document.body.clientWidth-10){$(this).css("left",Math.ceil(parseInt($(this).css("left"))+(document.body.clientWidth-($(this).offset().left+$(this).width()))-10));var a=Math.ceil($(this).siblings(".wpd-inline-icon.wpd-open").offset().left-$(this).offset().left+2);a>$(this).width()-3&&(a=$(this).width()-3),document.styleSheets[0].addRule("#"+$(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"px;")}})}function aD(a){var b,c=0;if(a.parents(".wpd_main_comm_form").length)c=parseInt(wpdiscuzAjaxObj.commentTextMaxLength),b=a.parents(".wpd_main_comm_form");else if(a.parents(".wpd-secondary-form-wrapper").length)c=parseInt(wpdiscuzAjaxObj.replyTextMaxLength),b=a.parents(".wpd-secondary-form-wrapper");else if(a.parents("#wpdiscuz-edit-form").length){var e=aj(a);c=parseInt(e.substring(e.lastIndexOf("_")+1))?parseInt(wpdiscuzAjaxObj.replyTextMaxLength):parseInt(wpdiscuzAjaxObj.commentTextMaxLength),b=a.parents("#wpdiscuz-edit-form")}if(c&&b){var g=a.val().length,d=$(".wpd-editor-char-counter",b),f=c-g;d.html(f),f<=10?d.addClass("error"):d.removeClass("error")}}function aE(a,b,c,d){a.data.callbackFunctions&&$.each(a.data.callbackFunctions,function(e){"function"==typeof wpdiscuzAjaxObj[a.data.callbackFunctions[e]]?wpdiscuzAjaxObj[a.data.callbackFunctions[e]](a,b,c,d):"function"==typeof window[a.data.callbackFunctions[e]]?window[a.data.callbackFunctions[e]](a,b,c,d):console.log(a.data.callbackFunctions[e]+" is not a function")})}function G(c,d,a){d&&$("#wpdiscuz-loading-bar").show(),a.append("postId",I),a.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce);var b=a.get("action");wpdiscuzAjaxObj.dataFilterCallbacks&&wpdiscuzAjaxObj.dataFilterCallbacks[b]&&$.each(wpdiscuzAjaxObj.dataFilterCallbacks[b],function(e){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[b][e]]&&(a=wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[b][e]](a,c,d))});var e=c?wpdiscuzAjaxObj.url:wpdiscuzAjaxObj.customAjaxUrl;return $.ajax({type:"POST",url:e,data:a,contentType:!1,processData:!1})}function p(){if(c||wpdiscuzAjaxObj.validateNonceForGuests){var a=new FormData;a.append("action","wpdGetNonce"),G(x,!1,a).done(function(a){"object"==typeof a?a.success?wpdiscuzAjaxObj.wpdiscuz_nonce=a.data:wpdiscuzAjaxObj.setCommentMessage(a.data,"error"):console.log(a)}).fail(function(b,c,a){console.log(a)})}}$(document).on("click","body",function(a){if($(a.target).hasClass("wpd-inline-form-close")||$(a.target).parents(".wpd-inline-form-close").length)a.preventDefault(),$(a.target).parents(".wpd-inline-form-wrapper").hide(),$(a.target).parents(".wpd-inline-shortcode").removeClass("wpd-active"),$(a.target).parents(".wpd-inline-form-wrapper").siblings(".wpd-inline-icon").removeClass("wpd-open");else if(!$(a.target).hasClass("wpd-inline-form-wrapper")&&!$(a.target).parents(".wpd-inline-form-wrapper").length){aB();var b="";$(a.target).hasClass("wpd-inline-icon")?b=$(a.target):$(a.target).parents(".wpd-inline-icon").length&&(b=$(a.target).parents(".wpd-inline-icon")),b.length&&b.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&(b.parents(".wpd-inline-shortcode").addClass("wpd-active"),b.siblings(".wpd-inline-form-wrapper").show(),b.addClass("wpd-open"),b.removeClass("wpd-ignored"),aC(b.siblings(".wpd-inline-form-wrapper")))}(!$(a.target).hasClass("wpd-last-inline-comments-wrapper")&&!$(a.target).parents(".wpd-last-inline-comments-wrapper").length||$(a.target).parents(".wpd-last-inline-comments-wrapper").length&&$(a.target).hasClass("wpd-load-inline-comment"))&&$(".wpd-last-inline-comments-wrapper").remove()}),$("body").on("click",".wpd-inline-submit.wpd_not_clicked",function(c){c.preventDefault();var d=$(this),a=$(this).parents(".wpd_inline_comm_form");if(a[0].checkValidity()){$(this).removeClass("wpd_not_clicked");var b=new FormData;b.append("action","wpdAddInlineComment"),b.append("inline_form_id",aA(a)),$.each($("input, textarea",a),function(c,a){"checkbox"===this.type?$(this).is(":checked")&&b.append($(a).attr("name"),$(a).val()):b.append($(a).attr("name"),$(a).val())}),G(x,!0,b).done(function(b){if(d.addClass("wpd_not_clicked"),"object"==typeof b){if(b.success){a[0].reset(),aB();var e=parseInt(b.data.newCount),c=d.parents(".wpd-inline-icon-wrapper").find(".wpd-inline-icon-count");c.text(e),e?c.addClass("wpd-has-comments"):c.removeClass("wpd-has-comments"),b.data.allCommentsCountNew=parseInt(b.data.allCommentsCountNew),$(".wpd-thread-info").html(b.data.allCommentsCountBeforeThreadsHtml),$(".wpd-thread-info").attr("data-comments-count",b.data.allCommentsCountNew),$("#wpd-bubble-all-comments-count").replaceWith(b.data.allCommentsCountBubbleHtml),b.data.message&&az(b.data.message),wpdiscuzAjaxObj.setCommentMessage(b.data.notification,"success")}else b.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[b.data],b.data,d),"error")}else wpdiscuzAjaxObj.setCommentMessage(b,"error");$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}}),$("body").on("keydown",".wpd-form",function(a){a.ctrlKey&&13==a.keyCode&&$(this).find(".wc_comm_submit").trigger("click")}),$("body").on("keydown","#wpdiscuz-edit-form",function(a){a.ctrlKey&&13==a.keyCode&&$(this).find(".wc_save_edited_comment").trigger("click")}),$("body").on("keydown",".wpd-inline-comment-content",function(a){a.ctrlKey&&13==a.keyCode&&$(this).parents(".wpd_inline_comm_form").find(".wpd-inline-submit.wpd_not_clicked").trigger("click")}),$("body").on("click",".wpd-inline-icon-count.wpd-has-comments",function(){var b=$(this),a=new FormData;a.append("action","wpdGetLastInlineComments"),a.append("inline_form_id",aA(b)),G(x,!0,a).done(function(a){"object"==typeof a?a.success?$(a.data).insertAfter(b):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,b),"error"):console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("click",".wpd-view-all-inline-comments",function(a){a.preventDefault(),$(this).parents(".wpd-last-inline-comments-wrapper").remove(),$(".wpdf-inline").hasClass("wpdf-active")||$(".wpdf-inline").trigger("click"),au(),$("html, body").animate({scrollTop:$(".wpdf-inline").offset().top-m},1e3,av)}),$("body").on("click",".wpd-feedback-content-link",function(a){a.preventDefault();var b=$(this).data("feedback-content-id");au(),$("html, body").animate({scrollTop:$("#wpd-inline-"+b).offset().top-(m+6)},1e3,function(){av(),$("#wpd-inline-"+b).addClass("wpd-active")})}),("scroll_open"===l||"blink"===l)&&(o(),$(window).on("scroll",o)),$("body").on("click","#wpd-post-rating.wpd-not-rated .wpd-rate-starts svg",function(){var a=new FormData,b=$(this).index();b>=0&&b<5&&(a.append("action","wpdUserRate"),a.append("rating",b+1),G(x,!0,a).done(function(a){"object"==typeof a?(a.success?location.reload(!0):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data),"error"),aE(a)):console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)}))}),$("body").on("submit","#wpdiscuz-subscribe-form",function(d){d.preventDefault();var a=$(this);let b=$("#wpdiscuz_subscription_button",a);if(a[0].checkValidity()&&(f=a,g=!0,"2.0"===e&&$("input[name=wpdiscuz_recaptcha_subscribe_form]",f).length&&!$("input[name=wpdiscuz_recaptcha_subscribe_form]",f).val().length?(g=!1,$(".wpdiscuz-recaptcha",f).css("border","1px solid red")):"2.0"===e&&$("input[name=wpdiscuz_recaptcha_subscribe_form]",f).length&&$(".wpdiscuz-recaptcha",f).css("border","none"),g)&&b.hasClass("wpd_not_clicked")){b.removeClass("wpd_not_clicked");var f,g,c=new FormData;c.append("action","wpdAddSubscription"),$("*",a).each(function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&c.append(this.name+"",$(this).val()),("checkbox"==this.type||"radio"==this.type)&&$(this).is(":checked")&&c.append(this.name+"",$(this).val())}),G(x,!0,c).done(function(a){"object"==typeof a?a.success?(wpdiscuzAjaxObj.setCommentMessage(a.data,"success"),setTimeout(function(){location.reload(!0)},3e3)):wpdiscuzAjaxObj.setCommentMessage(a.data,"error"):wpdiscuzAjaxObj.setCommentMessage(a,"error"),$("#wpdiscuz-loading-bar").fadeOut(250),V=!1,b.addClass("wpd_not_clicked")}).fail(function(c,d,a){console.log(a),b.addClass("wpd_not_clicked"),$("#wpdiscuz-loading-bar").fadeOut(250)})}}),$("body").on("click",".wpd-unsubscribe",function(b){b.preventDefault();var a=new FormData;a.append("action","wpdUnsubscribe"),a.append("sid",$(this).data("sid")),a.append("skey",$(this).data("skey")),G(x,!0,a).done(function(a){"object"==typeof a?a.success?(wpdiscuzAjaxObj.setCommentMessage(a.data,"success"),setTimeout(function(){location.reload(!0)},3e3)):wpdiscuzAjaxObj.setCommentMessage(a.data,"error"):console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250),V=!1}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),wpdiscuzAjaxObj.resetActiveFilters=function(a){$(".wpd-filter.wpdf-active"+(a?":not("+a+")":"")).removeClass("wpdf-active")},wpdiscuzAjaxObj.getAjaxObj=G,wpdiscuzAjaxObj.initNonce=p,p()});var onloadCallback=function(){if(document.getElementById("wpdiscuz-recaptcha-0_0")&&"2.0"===wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion&&(1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!wpdiscuzAjaxObj.is_user_logged_in||1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&wpdiscuzAjaxObj.is_user_logged_in))try{grecaptcha.render("wpdiscuz-recaptcha-0_0",{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(a){jQuery("#wpdiscuz-recaptcha-field-0_0").val("key")},"expired-callback":function(){jQuery("#wpdiscuz-recaptcha-field-0_0").val("")}})}catch(a){console.log(a),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+a.message,"error")}}
11
  /* Colorbox */
12
  !function(t,e,i){var o,n,r,h,a,s,l,c,d,g,f,u,p,m,w,v,y,x,b,T,C,H,k,W,E,I,M,L,R,S,K,P,B,O={html:!1,photo:!1,iframe:!1,inline:!1,transition:"elastic",speed:300,fadeOut:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,opacity:.9,preloading:!0,className:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:void 0,closeButton:!0,fastIframe:!0,open:!1,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",photoRegex:/\.(gif|png|jp(e|g|eg)|bmp|ico|webp|jxr|svg)((#|\?).*)?$/i,retinaImage:!1,retinaUrl:!1,retinaSuffix:"@2x.$1",current:"image {current} of {total}",previous:"previous",next:"next",close:"close",xhrError:"This content failed to load.",imgError:"This image failed to load.",returnFocus:!0,trapFocus:!0,onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,rel:function(){return this.rel},href:function(){return t(this).attr("href")},title:function(){return this.title},createImg:function(){var e=new Image,i=t(this).data("cbox-img-attrs");return"object"==typeof i&&t.each(i,function(t,i){e[t]=i}),e},createIframe:function(){var i=e.createElement("iframe"),o=t(this).data("cbox-iframe-attrs");return"object"==typeof o&&t.each(o,function(t,e){i[t]=e}),"frameBorder"in i&&(i.frameBorder=0),"allowTransparency"in i&&(i.allowTransparency="true"),i.name=(new Date).getTime(),i.allowFullscreen=!0,i}},_="colorbox",j="cbox",D=j+"Element",F=j+"_open",N=j+"_load",z=j+"_complete",A=j+"_cleanup",q=j+"_closed",U=j+"_purge",$=t("<a/>"),G="div",Q=0,J={};function V(i,o,n){var r=e.createElement(i);return o&&(r.id=j+o),n&&(r.style.cssText=n),t(r)}function X(){return i.innerHeight?i.innerHeight:t(i).height()}function Y(e,i){i!==Object(i)&&(i={}),this.cache={},this.el=e,this.value=function(e){var o;return void 0===this.cache[e]&&(void 0!==(o=t(this.el).attr("data-cbox-"+e))?this.cache[e]=o:void 0!==i[e]?this.cache[e]=i[e]:void 0!==O[e]&&(this.cache[e]=O[e])),this.cache[e]},this.get=function(t){var e=this.value(t);return"function"==typeof e?e.call(this.el,this):e}}function Z(t){var e=d.length,i=(I+t)%e;return i<0?e+i:i}function tt(t,e){return Math.round((/%/.test(t)?("x"===e?g.width():X())/100:1)*parseInt(t,10))}function et(t,e){return t.get("photo")||t.get("photoRegex").test(e)}function it(t,e){return t.get("retinaUrl")&&i.devicePixelRatio>1?e.replace(t.get("photoRegex"),t.get("retinaSuffix")):e}function ot(t){"contains"in n[0]&&!n[0].contains(t.target)&&t.target!==o[0]&&(t.stopPropagation(),n.trigger("focus"))}function nt(t){nt.str!==t&&(n.add(o).removeClass(nt.str).addClass(t),nt.str=t)}function rt(i){t(e).trigger(i),$.triggerHandler(i)}var ht=function(){var t,e,i=j+"Slideshow_",o="click."+j;function r(){clearTimeout(e)}function h(){(C.get("loop")||d[I+1])&&(r(),e=setTimeout(P.next,C.get("slideshowSpeed")))}function a(){v.html(C.get("slideshowStop")).off(o).one(o,s),$.on(z,h).on(N,r),n.removeClass(i+"off").addClass(i+"on")}function s(){r(),$.off(z,h).off(N,r),v.html(C.get("slideshowStart")).off(o).one(o,function(){P.next(),a()}),n.removeClass(i+"on").addClass(i+"off")}function l(){t=!1,v.hide(),r(),$.off(z,h).off(N,r),n.removeClass(i+"off "+i+"on")}return function(){t?C.get("slideshow")||($.off(A,l),l()):C.get("slideshow")&&d[1]&&(t=!0,$.one(A,l),C.get("slideshowAuto")?a():s(),v.show())}}();function at(r){var g,w;if(!S){if(g=t(r).data(_),C=new Y(r,g),w=C.get("rel"),I=0,w&&!1!==w&&"nofollow"!==w?(d=t("."+D).filter(function(){return new Y(this,t.data(this,_)).get("rel")===w}),-1===(I=d.index(C.el))&&(d=d.add(C.el),I=d.length-1)):d=t(C.el),!L){L=R=!0,nt(C.get("className")),n.css({visibility:"hidden",display:"block",opacity:""}),f=V(G,"LoadedContent","width:0; height:0; overflow:hidden; visibility:hidden"),h.css({width:"",height:""}).append(f),H=a.height()+c.height()+h.outerHeight(!0)-h.height(),k=s.width()+l.width()+h.outerWidth(!0)-h.width(),W=f.outerHeight(!0),E=f.outerWidth(!0);var v=tt(C.get("initialWidth"),"x"),y=tt(C.get("initialHeight"),"y"),x=C.get("maxWidth"),B=C.get("maxHeight");C.w=Math.max((!1!==x?Math.min(v,tt(x,"x")):v)-E-k,0),C.h=Math.max((!1!==B?Math.min(y,tt(B,"y")):y)-W-H,0),f.css({width:"",height:C.h}),P.position(),rt(F),C.get("onOpen"),T.add(m).hide(),n.trigger("focus"),C.get("trapFocus")&&e.addEventListener&&(e.addEventListener("focus",ot,!0),$.one(q,function(){e.removeEventListener("focus",ot,!0)})),C.get("returnFocus")&&$.one(q,function(){t(C.el).trigger("focus")})}var O=parseFloat(C.get("opacity"));o.css({opacity:O==O?O:"",cursor:C.get("overlayClose")?"pointer":"",visibility:"visible"}).show(),C.get("closeButton")?b.html(C.get("close")).appendTo(h):b.appendTo("<div/>"),function(){var e,o,n,r=P.prep,h=++Q;R=!0,M=!1,rt(U),rt(N),C.get("onLoad"),C.h=C.get("height")?tt(C.get("height"),"y")-W-H:C.get("innerHeight")&&tt(C.get("innerHeight"),"y"),C.w=C.get("width")?tt(C.get("width"),"x")-E-k:C.get("innerWidth")&&tt(C.get("innerWidth"),"x"),C.mw=C.w,C.mh=C.h,C.get("maxWidth")&&(C.mw=tt(C.get("maxWidth"),"x")-E-k,C.mw=C.w&&C.w<C.mw?C.w:C.mw);C.get("maxHeight")&&(C.mh=tt(C.get("maxHeight"),"y")-W-H,C.mh=C.h&&C.h<C.mh?C.h:C.mh);if(e=C.get("href"),K=setTimeout(function(){p.show()},100),C.get("inline")){var a=t(e).eq(0);n=t("<div>").hide().insertBefore(a),$.one(U,function(){n.replaceWith(a)}),r(a)}else C.get("iframe")?r(" "):C.get("html")?r(C.get("html")):et(C,e)?(e=it(C,e),M=C.get("createImg"),t(M).addClass(j+"Photo").on("error."+j,function(){r(V(G,"Error").html(C.get("imgError")))}).one("load",function(){h===Q&&setTimeout(function(){var e;C.get("retinaImage")&&i.devicePixelRatio>1&&(M.height=M.height/i.devicePixelRatio,M.width=M.width/i.devicePixelRatio),C.get("scalePhotos")&&(o=function(){M.height-=M.height*e,M.width-=M.width*e},C.mw&&M.width>C.mw&&(e=(M.width-C.mw)/M.width,o()),C.mh&&M.height>C.mh&&(e=(M.height-C.mh)/M.height,o())),C.h&&(M.style.marginTop=Math.max(C.mh-M.height,0)/2+"px"),d[1]&&(C.get("loop")||d[I+1])&&(M.style.cursor="pointer",t(M).on("click."+j,function(){P.next()})),M.style.width=M.width+"px",M.style.height=M.height+"px",r(M)},1)}),M.src=e):e&&u.load(e,C.get("data"),function(e,i){h===Q&&r("error"===i?V(G,"Error").html(C.get("xhrError")):t(this).contents())})}()}}function st(){n||(B=!1,g=t(i),n=V(G).attr({id:_,class:!1===t.support.opacity?j+"IE":"",role:"dialog",tabindex:"-1"}).hide(),o=V(G,"Overlay").hide(),p=t([V(G,"LoadingOverlay")[0],V(G,"LoadingGraphic")[0]]),r=V(G,"Wrapper"),h=V(G,"Content").append(m=V(G,"Title"),w=V(G,"Current"),x=t('<button type="button"/>').attr({id:j+"Previous"}),y=t('<button type="button"/>').attr({id:j+"Next"}),v=t('<button type="button"/>').attr({id:j+"Slideshow"}),p),b=t('<button type="button"/>').attr({id:j+"Close"}),r.append(V(G).append(V(G,"TopLeft"),a=V(G,"TopCenter"),V(G,"TopRight")),V(G,!1,"clear:left").append(s=V(G,"MiddleLeft"),h,l=V(G,"MiddleRight")),V(G,!1,"clear:left").append(V(G,"BottomLeft"),c=V(G,"BottomCenter"),V(G,"BottomRight"))).find("div div").css({float:"left"}),u=V(G,!1,"position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;"),T=y.add(x).add(w).add(v)),e.body&&!n.parent().length&&t(e.body).append(o,n.append(r,u))}function lt(){function i(t){t.which>1||t.shiftKey||t.altKey||t.metaKey||t.ctrlKey||(t.preventDefault(),at(this))}return!!n&&(B||(B=!0,y.on("click",function(){P.next()}),x.on("click",function(){P.prev()}),b.on("click",function(){P.close()}),o.on("click",function(){C.get("overlayClose")&&P.close()}),t(e).on("keydown."+j,function(t){var e=t.keyCode;L&&C.get("escKey")&&27===e&&(t.preventDefault(),P.close()),L&&C.get("arrowKey")&&d[1]&&!t.altKey&&(37===e?(t.preventDefault(),x.trigger("click")):39===e&&(t.preventDefault(),y.trigger("click")))}),"function"==typeof t.fn.on?t(e).on("click."+j,"."+D,i):t("."+D).live("click."+j,i)),!0)}t[_]||(t(st),(P=t.fn[_]=t[_]=function(e,i){var o=this;return e=e||{},"function"==typeof o&&(o=t("<a/>"),e.open=!0),o[0]?(st(),lt()&&(i&&(e.onComplete=i),o.each(function(){var i=t.data(this,_)||{};t.data(this,_,t.extend(i,e))}).addClass(D),new Y(o[0],e).get("open")&&at(o[0])),o):o}).position=function(e,i){var o,d,f,u=0,p=0,m=n.offset();function w(){a[0].style.width=c[0].style.width=h[0].style.width=parseInt(n[0].style.width,10)-k+"px",h[0].style.height=s[0].style.height=l[0].style.height=parseInt(n[0].style.height,10)-H+"px"}if(g.off("resize."+j),n.css({top:-9e4,left:-9e4}),d=g.scrollTop(),f=g.scrollLeft(),C.get("fixed")?(m.top-=d,m.left-=f,n.css({position:"fixed"})):(u=d,p=f,n.css({position:"absolute"})),!1!==C.get("right")?p+=Math.max(g.width()-C.w-E-k-tt(C.get("right"),"x"),0):!1!==C.get("left")?p+=tt(C.get("left"),"x"):p+=Math.round(Math.max(g.width()-C.w-E-k,0)/2),!1!==C.get("bottom")?u+=Math.max(X()-C.h-W-H-tt(C.get("bottom"),"y"),0):!1!==C.get("top")?u+=tt(C.get("top"),"y"):u+=Math.round(Math.max(X()-C.h-W-H,0)/2),n.css({top:m.top,left:m.left,visibility:"visible"}),r[0].style.width=r[0].style.height="9999px",o={width:C.w+E+k,height:C.h+W+H,top:u,left:p},e){var v=0;t.each(o,function(t){o[t]===J[t]||(v=e)}),e=v}J=o,e||n.css(o),n.dequeue().animate(o,{duration:e||0,complete:function(){w(),R=!1,r[0].style.width=C.w+E+k+"px",r[0].style.height=C.h+W+H+"px",C.get("reposition")&&setTimeout(function(){g.on("resize."+j,P.position)},1),"function"==typeof i&&i()},step:w})},P.resize=function(t){var e;L&&((t=t||{}).width&&(C.w=tt(t.width,"x")-E-k),t.innerWidth&&(C.w=tt(t.innerWidth,"x")),f.css({width:C.w}),t.height&&(C.h=tt(t.height,"y")-W-H),t.innerHeight&&(C.h=tt(t.innerHeight,"y")),t.innerHeight||t.height||(e=f.scrollTop(),f.css({height:"auto"}),C.h=f.height()),f.css({height:C.h}),e&&f.scrollTop(e),P.position("none"===C.get("transition")?0:C.get("speed")))},P.prep=function(i){if(L){var o,r="none"===C.get("transition")?0:C.get("speed");f.remove(),(f=V(G,"LoadedContent").append(i)).hide().appendTo(u.show()).css({width:(C.w=C.w||f.width(),C.w=C.mw&&C.mw<C.w?C.mw:C.w,C.w),overflow:C.get("scrolling")?"auto":"hidden"}).css({height:(C.h=C.h||f.height(),C.h=C.mh&&C.mh<C.h?C.mh:C.h,C.h)}).prependTo(h),u.hide(),t(M).css({float:"none"}),nt(C.get("className")),o=function(){var i,o,h=d.length;function a(){!1===t.support.opacity&&n[0].style.removeAttribute("filter")}L&&(o=function(){clearTimeout(K),p.hide(),rt(z),C.get("onComplete")},m.html(C.get("title")).show(),f.show(),h>1?("string"==typeof C.get("current")&&w.html(C.get("current").replace("{current}",I+1).replace("{total}",h)).show(),y[C.get("loop")||I<h-1?"show":"hide"]().html(C.get("next")),x[C.get("loop")||I?"show":"hide"]().html(C.get("previous")),ht(),C.get("preloading")&&t.each([Z(-1),Z(1)],function(){var i=d[this],o=new Y(i,t.data(i,_)),n=o.get("href");n&&et(o,n)&&(n=it(o,n),e.createElement("img").src=n)})):T.hide(),C.get("iframe")?(i=C.get("createIframe"),C.get("scrolling")||(i.scrolling="no"),t(i).attr({src:C.get("href"),class:j+"Iframe"}).one("load",o).appendTo(f),$.one(U,function(){i.src="//about:blank"}),C.get("fastIframe")&&t(i).trigger("load")):o(),"fade"===C.get("transition")?n.fadeTo(r,1,a):a())},"fade"===C.get("transition")?n.fadeTo(r,0,function(){P.position(0,o)}):P.position(r,o)}},P.next=function(){!R&&d[1]&&(C.get("loop")||d[I+1])&&(I=Z(1),at(d[I]))},P.prev=function(){!R&&d[1]&&(C.get("loop")||I)&&(I=Z(-1),at(d[I]))},P.close=function(){L&&!S&&(S=!0,L=!1,rt(A),C.get("onCleanup"),g.off("."+j),o.fadeTo(C.get("fadeOut")||0,0),n.stop().fadeTo(C.get("fadeOut")||0,0,function(){n.hide(),o.hide(),rt(U),f.remove(),setTimeout(function(){S=!1,rt(q),C.get("onClosed")},1)}))},P.remove=function(){n&&(n.stop(),t[_].close(),n.stop(!1,!0).remove(),o.remove(),S=!1,n=null,t("."+D).removeData(_).removeClass(D),t(e).off("click."+j).off("keydown."+j))},P.element=function(){return t(C.el)},P.settings=O)}(jQuery,document,window);
13
  /* Media Uploader */
assets/js/wpdiscuz.js CHANGED
@@ -543,10 +543,6 @@ jQuery(document).ready(function ($) {
543
  wcForm.on('submit', function (e) {
544
  e.preventDefault();
545
  });
546
- if ($('.wc_comment', wcForm).val().trim() === '') {
547
- wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wc_msg_required_fields, 'wc_msg_required_fields', wcForm), 'error');
548
- return;
549
- }
550
  if (wcForm[0].checkValidity() && wpdReCaptchaValidate(wcForm)) {
551
  addingComment = true;
552
  addAgreementInCookie(wcForm);
@@ -816,6 +812,9 @@ jQuery(document).ready(function ($) {
816
  if (typeof r === 'object') {
817
  if (r.success) {
818
  wpdCancelOrSave(uniqueID, r.data.message);
 
 
 
819
  if (r.data.lastEdited) {
820
  $('#wpd-comm-' + uniqueID + ' > .wpd-comment-wrap .wpd-comment-last-edited').remove();
821
  $(r.data.lastEdited).insertAfter('#wpd-comm-' + uniqueID + ' > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text');
543
  wcForm.on('submit', function (e) {
544
  e.preventDefault();
545
  });
 
 
 
 
546
  if (wcForm[0].checkValidity() && wpdReCaptchaValidate(wcForm)) {
547
  addingComment = true;
548
  addAgreementInCookie(wcForm);
812
  if (typeof r === 'object') {
813
  if (r.success) {
814
  wpdCancelOrSave(uniqueID, r.data.message);
815
+ if (r.data.comment_approved_html) {
816
+ $('#wpd-comm-' + uniqueID + ' > .wpd-comment-wrap .wpd-comment-subheader').append(r.data.comment_approved_html);
817
+ }
818
  if (r.data.lastEdited) {
819
  $('#wpd-comm-' + uniqueID + ' > .wpd-comment-wrap .wpd-comment-last-edited').remove();
820
  $(r.data.lastEdited).insertAfter('#wpd-comm-' + uniqueID + ' > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text');
assets/js/wpdiscuz.min.js CHANGED
@@ -1 +1 @@
1
- var wpdiscuzLoadRichEditor=parseInt(wpdiscuzAjaxObj.loadRichEditor);if(wpdiscuzLoadRichEditor&&document.querySelector(".wpdiscuz-textarea-wrap"))var wpDiscuzEditor=new WpdEditor;function wpdMessagesOnInit(a,b){wpdiscuzAjaxObj.setCommentMessage(a,b),setTimeout(function(){location.href=location.href.substring(0,location.href.indexOf("wpdiscuzUrlAnchor")-1)},3e3)}wpdiscuzAjaxObj.setCommentMessage=function(c,b,d){var a="wpdiscuz-message-error";if(c instanceof Array)for(var e in c)b instanceof Array?"success"===b[e]?a="wpdiscuz-message-success":"warning"===b[e]&&(a="wpdiscuz-message-warning"):"success"===b?a="wpdiscuz-message-success":"warning"===b&&(a="wpdiscuz-message-warning"),jQuery("<div/>").addClass(a).html(c[e]).prependTo("#wpdiscuz-comment-message").delay(d instanceof Array?d[e]:d||4e3).fadeOut(1e3,function(){jQuery(this).remove()});else"success"===b?a="wpdiscuz-message-success":"warning"===b&&(a="wpdiscuz-message-warning"),jQuery("<div/>").addClass(a).html(c).prependTo("#wpdiscuz-comment-message").delay(d||4e3).fadeOut(1e3,function(){jQuery(this).remove()})},wpdiscuzAjaxObj.applyFilterOnPhrase=function(a,b,c){return wpdiscuzAjaxObj.phraseFilters&&jQuery.each(wpdiscuzAjaxObj.phraseFilters,function(d){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[d]]&&(a=wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[d]](a,b,c))}),a},jQuery(document).ready(function($){$("body").addClass("wpdiscuz_"+wpdiscuzAjaxObj.version);var H,c=wpdiscuzAjaxObj.is_user_logged_in,q=1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!c,r=1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&c,e=wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion,s=parseInt(wpdiscuzAjaxObj.commentListLoadType),I=parseInt(wpdiscuzAjaxObj.wc_post_id);wpdiscuzAjaxObj.wpdiscuz_nonce="";var t=parseInt(wpdiscuzAjaxObj.commentListUpdateType),u=1e3*parseInt(wpdiscuzAjaxObj.commentListUpdateTimer),v=parseInt(wpdiscuzAjaxObj.liveUpdateGuests),w=wpdiscuzAjaxObj.loadLastCommentId,J=w,f=parseInt(wpdiscuzAjaxObj.firstLoadWithAjax);Cookies.get("wpdiscuz_comments_sorting")&&Cookies.remove("wpdiscuz_comments_sorting",{path:""}),Cookies.get("wordpress_last_visit")&&Cookies.remove("wordpress_last_visit",{path:""}),Cookies.get("wpdiscuz_last_visit")&&Cookies.remove("wpdiscuz_last_visit",{path:""});var i=parseInt(wpdiscuzAjaxObj.wordpressIsPaginate),K=wpdiscuzAjaxObj.storeCommenterData,L=parseInt(wpdiscuzAjaxObj.wmuEnabled),M=wpdiscuzAjaxObj.isCookiesEnabled,N=!0,g=wpdiscuzAjaxObj.cookiehash,O=parseInt(wpdiscuzAjaxObj.isLoadOnlyParentComments),P=parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0,x=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),j=parseInt(wpdiscuzAjaxObj.enableBubble),y=parseInt(wpdiscuzAjaxObj.bubbleLiveUpdate),k=parseInt(wpdiscuzAjaxObj.bubbleHintTimeout),Q=parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout)?parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout):5,R=parseInt(wpdiscuzAjaxObj.bubbleShowNewCommentMessage),h=wpdiscuzAjaxObj.bubbleLocation,l=wpdiscuzAjaxObj.inlineFeedbackAttractionType,m=parseInt(wpdiscuzAjaxObj.scrollSize),m=m||32,S=[],T=[],U=[],V=!1,z=1,W=$("html").css("scroll-behavior"),X=$("body").css("scroll-behavior");if($(".wc_social_plugin_wrapper .wp-social-login-provider-list").length?$(".wc_social_plugin_wrapper .wp-social-login-provider-list").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):$(".wc_social_plugin_wrapper .the_champ_login_container").length?$(".wc_social_plugin_wrapper .the_champ_login_container").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):$(".wc_social_plugin_wrapper .social_connect_form").length?$(".wc_social_plugin_wrapper .social_connect_form").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):$(".wc_social_plugin_wrapper .oneall_social_login_providers").length&&$(".wc_social_plugin_wrapper .oneall_social_login .oneall_social_login_providers").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"),wpdiscuzLoadRichEditor&&$("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0"),window.addEventListener("beforeunload",function(c){var b=$(".wpd-form").not(":hidden");if(b.length){if(wpdiscuzLoadRichEditor&&document.querySelector(".wpdiscuz-textarea-wrap")){for(var a=0;a<b.length;a++)if("\n"!==wpDiscuzEditor.createEditor($(b[a]).find(".ql-container").attr("id")).getText()){c.preventDefault(),c.returnValue="";return}}else for(var a=0;a<b.length;a++)if($(b[a]).find(".wc_comment").val()){c.preventDefault(),c.returnValue="";return}}}),wpdiscuzLoadRichEditor||($(document).delegate("textarea.wc_comment","input",function(){aD($(this))}),$.each($("textarea.wc_comment"),function(){aD($(this))})),$("body").on("focus","#wpdcom .ql-editor, #wpdcom .wc_comment",function(){$(".wpd-form-foot",$(this).parents(".wpd_comm_form")).slideDown(P)}),$("body").on("focus","#wpdcom textarea",function(){$(this).next(".autogrow-textarea-mirror").length||$(this).autoGrow()}),c||aa({comment_author:Cookies.get("comment_author_"+g),comment_author_email:Cookies.get("comment_author_email_"+g),comment_author_url:Cookies.get("comment_author_url_"+g)}),$(".wpd-vote-down.wpd-dislike-hidden").remove(),$(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd"),$("body").on("click","#wpd-editor-source-code-wrapper-bg",function(){$(this).hide(),$("#wpd-editor-source-code-wrapper").hide(),$("#wpd-editor-uid").val(""),$("#wpd-editor-source-code").val("")}),wpdiscuzLoadRichEditor&&$("body").on("click","#wpd-insert-source-code",function(){var a=wpDiscuzEditor.createEditor("#"+$("#wpd-editor-uid").val());a.deleteText(0,a.getLength(),Quill.sources.USER);var b=$("#wpd-editor-source-code").val();b.length&&a.clipboard.dangerouslyPasteHTML(0,b,Quill.sources.USER),a.update(),$("#wpd-editor-source-code-wrapper-bg").hide(),$("#wpd-editor-source-code-wrapper").hide(),$("#wpd-editor-uid").val(""),$("#wpd-editor-source-code").val("")}),$("body").on("click",".wpd-reply-button",function(){var a=aj($(this),0);$(this).hasClass("wpdiscuz-clonned")?(wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+a).focus()},P):setTimeout(function(){$("#wc-textarea-"+a).trigger("focus")},P),$("#wpd-secondary-form-wrapper-"+a).slideToggle(P)):ah($(this)),function(a){if((q||r)&&"2.0"===e){var b=ak(a);setTimeout(function(){if(!T[b])try{T[b]=grecaptcha.render("wpdiscuz-recaptcha-"+a,{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(b){$("#wpdiscuz-recaptcha-field-"+a).val("key")},"expired-callback":function(){$("#wpdiscuz-recaptcha-field-"+a).val("")}})}catch(c){console.log(c),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+c.message,"error")}},1e3)}}(a)}),$("body").on("click","#wpdcom [data-wpd-clipboard]",function(){var b=$(this).data("wpd-clipboard"),a=$("<input/>");a.appendTo("body").css({position:"absolute",top:"-10000000px"}).val(b),a.trigger("select"),document.execCommand("copy"),a.remove(),wpdiscuzAjaxObj.setCommentMessage(b+"<br/>"+wpdiscuzAjaxObj.wc_copied_to_clipboard,"success",5e3)}),$("body").on("click",".wpdiscuz-nofollow,.wc_captcha_refresh_img,.wpd-load-more-submit",function(a){a.preventDefault()}),$("body").on("click",".wpd-toggle.wpd_not_clicked",function(){var a=$(this);a.removeClass("wpd_not_clicked");var b=aj($(this),0),c=$(this),d=$(".fas",c);!c.parents(".wpd-comment:not(.wpd-reply)").children(".wpd-reply").length&&O?aw(b,a):$("#wpd-comm-"+b+"> .wpd-reply").slideToggle(700,function(){$(this).is(":hidden")?(d.removeClass("fa-chevron-up"),d.addClass("fa-chevron-down"),c.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_show_replies_text),c.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_show_replies_text)):(d.removeClass("fa-chevron-down"),d.addClass("fa-chevron-up"),c.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),c.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text)),a.addClass("wpd_not_clicked")})}),$("body").on("mouseenter",".wpd-new-loaded-comment",function(){$(this).removeClass("wpd-new-loaded-comment")}),$("body").on("click",".wpd-sbs-toggle",function(){$(".wpdiscuz-subscribe-bar").slideToggle(P)}),parseInt(wpdiscuzAjaxObj.wpDiscuzIsShowOnSubscribeForm)&&!c&&wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&$("#wpdiscuz-subscribe-form").length&&("2.0"===e?(setTimeout(function(){try{grecaptcha.render("wpdiscuz-recaptcha-subscribe-form",{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(a){$("#wpdiscuz-recaptcha-field-subscribe-form").val("key")},"expired-callback":function(){$("#wpdiscuz-recaptcha-field-subscribe-form").val("")}})}catch(a){console.log(a),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+a.message,"error")}},1e3),$("body").on("submit","#wpdiscuz-subscribe-form",function(a){$("#wpdiscuz-recaptcha-field-subscribe-form").val()?$(".wpdiscuz-recaptcha",$(this)).css("border","none"):($(".wpdiscuz-recaptcha",$(this)).css("border","1px solid red"),a.preventDefault())})):"3.0"===e&&$("body").on("click","#wpdiscuz_subscription_button",function(b){var c=$(this).parents("#wpdiscuz-subscribe-form");b.preventDefault();try{grecaptcha.ready(function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/wpdAddSubscription"}).then(function(a){console.log(5555),document.getElementById("wpdiscuz-recaptcha-field-subscribe-form").value=a,c.trigger("submit")},function(a){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(a)})})}catch(a){console.log(a),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+a.message,"error")}})),(q||r)&&"2.0"===e){var A=$(window).width(),a=$("#wpdcom").width();a>=1100&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"65%"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"35%"})),a>=940&&a<1100&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"60%"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"40%"})),a>=810&&a<940&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"40%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"60%"})),a>=730&&a<810&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"45%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"55%"})),a>=610&&a<730&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.85)","-webkit-transform":"scale(0.85)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"43%"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"55%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"30%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"70%"})),A>650&&(a>=510&&a<610&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"center 0","-webkit-transform-origin":"center 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"35%"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"63%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"30%",position:"relative",right:"-60px"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"70%"}),$("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"})),a>=470&&a<510&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"center 0","-webkit-transform-origin":"center 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"40%"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"60%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({float:"none",width:"100%",display:"block"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({float:"none",width:"100%",display:"block"}),$("#wpdcom .wpd_main_comm_form .wc-form-footer").css({"margin-left":"0px"}),$("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"})),a<470&&($("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({margin:"0px auto","transform-origin":"center 0","-webkit-transform-origin":"center 0"}),$("#wpdcom .wpd-form-col-left").css({float:"none",width:"100%",display:"block"}),$("#wpdcom .wpd-form-col-right").css({float:"none",width:"100%",display:"block"}),$("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"}),$("#wpdcom .wpd-secondary-form-wrapper .wc_notification_checkboxes").css({"text-align":"center"}),$("#wpdcom .wpd-secondary-form-wrapper .wc-field-submit").css({"text-align":"center"})))}function Y(b,a,c){G(x||L,!1,a).done(function(a){if($(c).addClass("wpd_not_clicked"),"object"==typeof a){if(a.success){"collapsed"===wpdiscuzAjaxObj.commentFormView&&$(".wpd-form-foot",b).slideUp(P),a.data.wc_all_comments_count_new=parseInt(a.data.wc_all_comments_count_new),$(".wpd-thread-info").html(a.data.wc_all_comments_count_before_threads_html),$(".wpd-thread-info").attr("data-comments-count",a.data.wc_all_comments_count_new),$("#wpd-bubble-all-comments-count").replaceWith(a.data.wc_all_comments_count_bubble_html);var d=P;a.data.is_main?az(a.data.message):(d=P+700,$("#wpd-secondary-form-wrapper-"+a.data.uniqueid).slideToggle(700),1==a.data.is_in_same_container?$("#wpd-secondary-form-wrapper-"+a.data.uniqueid).after(a.data.message):$("#wpd-comm-"+a.data.uniqueid).after(a.data.message)),Z(a),_(a),M&&N?ab(a.data):N||$(".wpd-cookies-checkbox").prop("checked",!1),b.get(0).reset(),wpdiscuzLoadRichEditor?wpDiscuzEditor.createEditor("#wpd-editor-"+$(".wpdiscuz_unique_id",b).val()).setContents([{insert:"\n"}]):aD(b.find(".wc_comment")),aa(a.data),$(".wmu-preview-wrap",b).remove(),ay(),parseInt(wpdiscuzAjaxObj.scrollToComment)&&setTimeout(function(){au(),$("html, body").animate({scrollTop:$("#comment-"+a.data.new_comment_id).offset().top-m},1e3,av)},d),aE(a,b)}else a.data&&(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,b),"error"),aE(a,b))}else wpdiscuzAjaxObj.setCommentMessage(a,"error");$("#wpdiscuz-loading-bar").fadeOut(250),V=!1}).fail(function(b,d,a){console.log(a),$(c).addClass("wpd_not_clicked"),$("#wpdiscuz-loading-bar").fadeOut(250)})}function Z(b){if(!b.data.held_moderate){var a=new FormData;a.append("action","wpdCheckNotificationType"),a.append("comment_id",b.data.new_comment_id),a.append("email",b.data.comment_author_email),a.append("isParent",b.data.is_main),G(x,!0,a)}}function _(a){if(a.data.redirect>0&&a.data.new_comment_id){var b=new FormData;b.append("action","wpdRedirect"),b.append("commentId",a.data.new_comment_id),G(x,!0,b).done(function(a){"object"==typeof a&&a.success&&setTimeout(function(){location.href=a.data},2e3)}).fail(function(b,c,a){console.log(a)})}}function aa(a){$(".wpd_comm_form .wc_name").val(a.comment_author),a.comment_author_email&&0>a.comment_author_email.indexOf("@example.com")&&$(".wpd_comm_form .wc_email").val(a.comment_author_email),a.comment_author_url&&$(".wpd_comm_form .wc_website").val(a.comment_author_url)}function ab(b){var c=b.comment_author_email,d=b.comment_author,a=b.comment_author_url;null==K?(Cookies.set("comment_author_email_"+g,c),Cookies.set("comment_author_"+g,d),a.length&&Cookies.set("comment_author_url_"+g,a)):(K=parseInt(K),Cookies.set("comment_author_email_"+g,c,{expires:K,path:"/"}),Cookies.set("comment_author_"+g,d,{expires:K,path:"/"}),a.length&&Cookies.set("comment_author_url_"+g,a,{expires:K,path:"/"})),$(".wpd-cookies-checkbox").length&&$(".wpd-cookies-checkbox").prop("checked",!0)}function ac(a,b){$("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").show(),$("#wpd-comm-"+a+" .wpdiscuz-edit-form-wrap").replaceWith(b),$("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-last-edited").show()}$("body").on("click",".wc_comm_submit.wpd_not_clicked",function(){var d=$(this),f=1,a=$(this).parents("form");if("true"===a.attr("data-uploading")){wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhraseDoingUpload,"wmuPhraseDoingUpload",a),"warning");return}if(a.hasClass("wpd_main_comm_form")||(f=an($(this).parents(".wpd-comment"))),as(a,"#wpd-editor-"+$(".wpdiscuz_unique_id",a).val()),a.on("submit",function(a){a.preventDefault()}),""===$(".wc_comment",a).val().trim()){wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wc_msg_required_fields,"wc_msg_required_fields",a),"error");return}if(a[0].checkValidity()&&(h=a,i=!0,"2.0"===e&&$("input[name=wc_captcha]",h).length&&!$("input[name=wc_captcha]",h).val().length?(i=!1,$(".wpdiscuz-recaptcha",h).css("border","1px solid red")):"2.0"===e&&$("input[name=wc_captcha]",h).length&&$(".wpdiscuz-recaptcha",h).css("border","none"),i)){V=!0,ax(a),$(d).removeClass("wpd_not_clicked");var h,i,b=new FormData;if(b.append("action","wpdAddComment"),$(":input",a).each(function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&b.append(this.name+"",$(this).val().trim()),("checkbox"==this.type||"radio"==this.type)&&$(this).is(":checked")&&b.append(this.name+"",$(this).val())}),b.append("wpd_comment_depth",f),wpdiscuzAjaxObj.wpdiscuz_zs&&b.append("wpdiscuz_zs",wpdiscuzAjaxObj.wpdiscuz_zs),$(".wpd-cookies-checkbox",a).length?$(".wpd-cookies-checkbox",a).prop("checked")||(N=!1):c&&(N=!1),$("#wpdiscuz-loading-bar").show(),wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&"3.0"===e&&(1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!wpdiscuzAjaxObj.is_user_logged_in||1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&wpdiscuzAjaxObj.is_user_logged_in))try{grecaptcha.ready(function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/addComment"}).then(function(c){b.append("g-recaptcha-response",c),Y(a,b,d)},function(a){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(a)})})}catch(g){console.log(g),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+g.message,"error"),$("#wpdiscuz-loading-bar").fadeOut(250)}else Y(a,b,d)}(function(a){if((q||r)&&"2.0"===e){var b=ak(a);grecaptcha.reset(T[b])}})($(".wpdiscuz_unique_id",a).val()),ar()}),$("body").on("click",".wpd_editable_comment",function(){H&&$(".wpdiscuz-edit-form-wrap").length&&ac(aj($(".wpdiscuz-edit-form-wrap"),0),H);var c=$(this),b=aj(c,0),d=ak(b),a=new FormData;a.append("action","wpdEditComment"),a.append("commentId",d),H=$("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-text").get(0),G(x,!0,a).done(function(a){if("object"==typeof a){if(a.success){if($("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text").replaceWith(a.data.html),wpdiscuzLoadRichEditor){var d=wpDiscuzEditor.createEditor("#wpd-editor-edit_"+b);d.clipboard.dangerouslyPasteHTML(0,a.data.content),d.update(),$(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd")}else $("#wc-textarea-edit_"+b).val(a.data.content),aD($("#wc-textarea-edit_"+b));$("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").hide(),$("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-last-edited").hide()}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,c),"error")}else console.log(a);$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("click",".wc_save_edited_comment",function(){var d=$(this),b=aj(d),e=ak(b),a=$("#wpd-comm-"+b+" #wpdiscuz-edit-form");if(as(a,"#wpd-editor-edit_"+b),a.on("submit",function(a){a.preventDefault()}),a[0].checkValidity()){var c=new FormData;c.append("action","wpdSaveEditedComment"),c.append("commentId",e),$(":input",a).each(function(){""!==this.name&&"checkbox"!==this.type&&"radio"!==this.type&&c.append(this.name+"",$(this).val()),("checkbox"===this.type||"radio"===this.type)&&$(this).is(":checked")&&c.append(this.name+"",$(this).val())}),G(x,!0,c).done(function(a){"object"==typeof a?(a.success?(ac(b,a.data.message),a.data.lastEdited&&($("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-last-edited").remove(),$(a.data.lastEdited).insertAfter("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text")),a.data.twitterShareLink&&$("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_tw").attr("href",a.data.twitterShareLink),a.data.whatsappShareLink&&$("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_whatsapp").attr("href",a.data.whatsappShareLink),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+b)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,d),"error"),aE(a,e)):console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}}),$("body").on("click",".wc_cancel_edit",function(){var a=aj($(this));ac(a,H),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+a)}),!i&&f&&(z=0,1==f?setTimeout(function(){ae(!0)},500):$("body").on("click",".wpd-load-comments",function(){$(this).parent(".wpd-load-more-submit-wrap").remove(),ae(!0)})),$("body").on("click",".wpd-load-more-submit",function(){var a=$(this),b="wpd-loaded";a.hasClass(b)&&ae(!1,a,b,"wpd-loading")});var ad=!1;function B(){var a=document.getElementById("wpdiscuzHasMoreComments"),b=0;a&&(b=a.dataset.is_show_load_more);var c=document.getElementById("wpdcom")?document.getElementById("wpdcom").clientHeight:0,d=$(window).height()+$(window).scrollTop();c&&d&&100*d/c>=80&& !1===ad&&1==b&&(ad=!0,ae(!1,$(".wpd-load-more-submit")))}function ae(c,b,e,g){b&&(b.toggleClass(e),b.toggleClass(g));var a=new FormData;a.append("action","wpdLoadMoreComments");var d=$(".wpdiscuz-sort-button-active").attr("data-sorting");d&&a.append("sorting",d),a.append("offset",z),a.append("lastParentId",al()),a.append("isFirstLoad",c?1:0);var h=$(".wpdf-active").attr("data-filter-type");a.append("wpdType",h||""),G(x,!c||1!=f,a).done(function(a){"object"==typeof a&&a.success&&(z++,c&&$(".wpd-comment").remove(),$(".wpdiscuz_single").remove(),$(".wpdiscuz-comment-pagination").before(a.data.comment_list),C(a,c&&2!==s),ad=!1,a.data.loadLastCommentId&&(w=a.data.loadLastCommentId),aE(a),c&&D(!1)),$("#wpdiscuz-loading-bar").fadeOut(250),$(".wpd-load-more-submit").blur(),b&&(b.toggleClass(e),b.toggleClass(g))}).fail(function(c,d,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250),$(".wpd-load-more-submit").blur(),b&&(b.toggleClass(e),b.toggleClass(g))})}function C(a,d){var b=document.getElementById("wpdiscuzHasMoreComments");if(!1==a.data.is_show_load_more)b&&(b.dataset.is_show_load_more=0),$(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide();else if(am(a.data.last_parent_id),b&&(b.dataset.is_show_load_more=1),d&&$(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").show(),a.data.comments_left>0){if(!$(".wpd-load-more-submit .wpd-comments-left").length){let c=$("<span>");c.addClass("wpd-comments-left"),$(".wpd-load-more-submit").append(c)}$(".wpd-load-more-submit .wpd-comments-left").text(a.data.comments_left_text)}aE(a)}function D(d){var b=location.href.match(/#comment\-(\d+)/);if(null!==b){var c=b[1];if($("#comment-"+c).length)setTimeout(function(){au(),$("html, body").animate({scrollTop:$("#comment-"+c).parents("[id^=wpd-comm-]").offset().top-m},1e3,av),d&&af(c)},500);else{var a=new FormData;a.append("action","wpdGetSingleComment"),a.append("commentId",c),G(x,!0,a).done(function(a){if("object"==typeof a&&a.success){var b="#comment-"+c;$("#comment-"+a.data.parentCommentID).length?$("#comment-"+a.data.parentCommentID).parents("[id^=wpd-comm-"+a.data.parentCommentID+"]").replaceWith(a.data.message):$(".wpd-thread-list").prepend(a.data.message),aE(a),au(),$("html, body").animate({scrollTop:$(b).offset().top-m},1e3,av),d&&af(c)}$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}}}function af(a){setTimeout(function(){$("#comment-"+a).siblings(".wpd-secondary-form-wrapper").is(":visible")||$("#comment-"+a).find(".wpd-reply-button").trigger("click")},1100)}function ag(b){if(void 0!==b.data.message)for(var c,d=b.data.message,a=0;a<d.length;a++)ap((c=d[a]).comment_parent,c.comment_html)}function ah(b){var a=aj(b,0);$("#wpdiscuz_form_anchor-"+a).before(ai(a));var d=$("#wpd-secondary-form-wrapper-"+a);c||aa({comment_author:Cookies.get("comment_author_"+g),comment_author_email:Cookies.get("comment_author_email_"+g),comment_author_url:Cookies.get("comment_author_url_"+g)}),wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+a).focus()},P):setTimeout(function(){$("#wc-textarea-"+a).trigger("focus")},P),d.slideToggle(P,function(){b.addClass("wpdiscuz-clonned")})}function ai(a){return $("#wpdiscuz_hidden_secondary_form").html().replace(/wpdiscuzuniqueid/g,a)}function aj(a,c){var b="";return(b=c?a.parents(".wpd-main-form-wrapper").attr("id"):a.parents(".wpd-comment").attr("id")).substring(b.lastIndexOf("-")+1)}function ak(a){return a.substring(0,a.indexOf("_"))}function al(){return $(".wpd-load-more-submit").attr("data-lastparentid")}function am(a){$(".wpd-load-more-submit").attr("data-lastparentid",a),2!==s&&$(".wpdiscuz-comment-pagination").show()}function an(a){var b=a.attr("class").split(" "),c="";return $.each(b,function(b,a){"wpd_comment_level"===ao(a,!1)&&(c=ao(a,!0))}),parseInt(c)+1}function ao(a,b){return b?a.substring(a.indexOf("-")+1):a.substring(0,a.indexOf("-"))}function ap(a,b){if(0==a)az(b);else{var c=aj($("#comment-"+a),0);$("#wpdiscuz_form_anchor-"+c).after(b)}}function aq(){var a=[];return $(".wpd-comment-right").each(function(){a.push(ak(aj($(this),0)))}),a.join(",")}function ar(){$(".wpdiscuz_reset").val("")}function as(a,b){var c=a.find(".wpd-required-group");wpdiscuzLoadRichEditor&&a.find(".wc_comment").val($(b+">.ql-editor").html()),at(a),$.each(c,function(){$("input",this).prop("required",!1),0===$("input:checked",this).length?$("input",$(this)).prop("required",!0):$(".wpd-field-invalid",this).remove()})}function at(c){var b=c.find(".wc_comment"),a=b.val().trim().replace(/<p><br><\/p>/g,"\n").replace(/<p>(.*?)<\/p>/g,"$1\n");a=(a=(a=(a=a.replace(/<img src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img[^>]+alt=["|']([^"|']+)["|'][^>]+src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'][^>]?>/g," $1 ")).replace(/<img\s+([^>]*)class=["|']wpdem\-sticker["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img\s+([^>]*)src=["|']([^"|']+)["|'](.*?)[^>]*>/g," $2 "),b.val(a)}function au(){$("html, body").css("scroll-behavior","unset")}function av(){$("html").css("scroll-behavior",W),$("body").css("scroll-behavior",X)}function aw(b,d){var c=ak(b),a=new FormData;a.append("action","wpdShowReplies"),a.append("commentId",c),G(x,!0,a).done(function(a){d.addClass("wpd_not_clicked"),"object"==typeof a&&a.success&&($("#wpd-comm-"+b).replaceWith(a.data.comment_list),$("#wpd-comm-"+b+" .wpd-toggle .fas").removeClass("fa-chevron-down").addClass("fa-chevron-up"),$("#wpd-comm-"+b+" .wpd-toggle .wpd-view-replies .wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),$("#wpd-comm-"+b+" .wpd-toggle").attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text),aE(a)),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),d.addClass("wpd_not_clicked"),$("#wpdiscuz-loading-bar").fadeOut(250)})}function ax(a){$(".wpd-agreement-checkbox",a).each(function(){$(this).hasClass("wpd_agreement_hide")&&M&&$(this).prop("checked")&&(Cookies.set($(this).attr("name")+"_"+g,1,{expires:30,path:"/"}),$("input[name="+$(this).attr("name")+"]").each(function(){S.push($(this))}))})}function ay(){S.length&&(S.forEach(function(a){a.parents(".wpd-field-checkbox").remove()}),S=[])}function az(a){$(".wpd-sticky-comment").last()[0]?$(a).insertAfter($(".wpd-sticky-comment").last()[0]):$(".wpd-thread-list").prepend(a)}function E(a){a?a.prop("required")||(a.val()?a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none")):$.each($(".wc_email"),function(c,b){var a=$(b);a.prop("required")||(a.val()?a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none"))})}if(2!==s||i||($(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide(),B(),$(window).scroll(function(){B()})),wpdiscuzAjaxObj.setLoadMoreVisibility=C,$("body").on("click",".wpd-vote-up.wpd_not_clicked, .wpd-vote-down.wpd_not_clicked",function(){var b,c=$(this);$(c).removeClass("wpd_not_clicked");var d=aj(c),e=ak(d);b=$(this).hasClass("wpd-vote-up")?1:-1;var a=new FormData;a.append("action","wpdVoteOnComment"),a.append("commentId",e),a.append("voteType",b),G(x,!0,a).done(function(a){if($(c).addClass("wpd_not_clicked"),"object"==typeof a){if(a.success){if("total"===a.data.buttonsStyle){var d=$(".wpd-comment-footer .wpd-vote-result",$("#comment-"+e)),h=a.data.votes;d.text(a.data.votesHumanReadable),d.attr("title",h),d.removeClass("wpd-up wpd-down"),h>0&&d.addClass("wpd-up"),h<0&&d.addClass("wpd-down")}else{var f=$(".wpd-comment-footer .wpd-vote-result-like",$("#comment-"+e)),g=$(".wpd-comment-footer .wpd-vote-result-dislike",$("#comment-"+e));f.text(a.data.likeCountHumanReadable),f.attr("title",a.data.likeCount),g.text(a.data.dislikeCountHumanReadable),g.attr("title",a.data.dislikeCount),parseInt(a.data.likeCount)>0?f.addClass("wpd-up"):f.removeClass("wpd-up"),0>parseInt(a.data.dislikeCount)?g.addClass("wpd-down"):g.removeClass("wpd-down")}var i=$(".wpd-comment-footer .wpd-vote-up",$("#comment-"+e)),j=$(".wpd-comment-footer .wpd-vote-down",$("#comment-"+e));i.removeClass("wpd-up"),j.removeClass("wpd-down"),a.data.curUserReaction>0?i.addClass("wpd-up"):a.data.curUserReaction<0&&j.addClass("wpd-down")}else a.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,c),"error");aE(a,e,b)}else console.log(a);$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,d,a){console.log(a),$(c).addClass("wpd_not_clicked"),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$(document).on("click","body",function(b){var a=$(".wpdiscuz-sort-buttons");$(b.target).hasClass("wpdf-sorting")||$(b.target).parent().hasClass("wpdf-sorting")?a.css({display:a.is(":visible")?"none":"flex"}):a.hide()}),$("body").on("click",".wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)",function(){var c=$(this),b=$(this).attr("data-sorting");if(b){$(".wpdiscuz-sort-button.wpdiscuz-sort-button-active").removeClass("wpdiscuz-sort-button-active").appendTo(".wpdiscuz-sort-buttons"),c.addClass("wpdiscuz-sort-button-active").prependTo(".wpdf-sorting");var a=new FormData;a.append("action","wpdSorting"),a.append("sorting",b);var d=$(".wpdf-active").attr("data-filter-type");a.append("wpdType",d||""),G(x,!0,a).done(function(a){"object"==typeof a&&a.success&&($("#wpdcom .wpd-comment").remove(),$("#wpdcom .wpd-thread-list").prepend(a.data.message),C(a,!1),z=1),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}}),window.onhashchange=function(){D(!1)},1!=f&&D(!1),$("body").on("click",".wpdiscuz-readmore",function(){var b=aj($(this)),c=ak(b),a=new FormData;a.append("action","wpdReadMore"),a.append("commentId",c),G(x,!0,a).done(function(a){"object"==typeof a?(a.success?($("#comment-"+c+" .wpd-comment-text").replaceWith(" "+a.data.message),$("#wpdiscuz-readmore-"+b).remove()):console.log(a.data),aE(a)):console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("change",".wpd-required-group",function(){0!==$("input:checked",this).length?$("input",$(this)).prop("required",!1):$("input",$(this)).prop("required",!0)}),$("body").on("click",".wpdiscuz-spoiler",function(){$(this).next().slideToggle(),$(this).hasClass("wpdiscuz-spoiler-closed")?$(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-plus").removeClass("fa-plus").addClass("fa-minus"):$(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-minus").removeClass("fa-minus").addClass("fa-plus"),$(this).toggleClass("wpdiscuz-spoiler-closed")}),$("body").on("click",".wpd-tools i",function(){var a=$(this).siblings(".wpd-tools-actions");a.is(":visible")||$(this).parents(".wpd-comment-right").attr("id")!==$("[id^=comment-]","#wpdcom").last().attr("id")||$("#comments").css({paddingBottom:"160px"}),a.css({display:a.is(":visible")?"none":"flex"})}),$("body").on("mouseleave",".wpd-comment-right",function(){$(this).find(".wpd-tools-actions").hide(),$("#comments").css({paddingBottom:"0"})}),$("body").on("click",".wpd_stick_btn",function(){var b=aj($(this),0),c=ak(b),a=new FormData;a.append("action","wpdStickComment"),a.append("commentId",c),G(x,!0,a).done(function(a){"object"==typeof a&&a.success&&location.reload(!0),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("click",".wpd_close_btn",function(){var b=aj($(this),0),c=ak(b),a=new FormData;a.append("action","wpdCloseThread"),a.append("commentId",c),G(x,!0,a).done(function(a){"object"==typeof a&&a.success&&location.reload(!0),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("click",".wpd-filter.wpd_not_clicked[data-filter-type]",function(){var b=$(this),c=b.attr("data-filter-type");wpdiscuzAjaxObj.resetActiveFilters(".wpdf-"+c),b.removeClass("wpd_not_clicked"),$(".fas",b).addClass("fa-pulse fa-spinner");var a=new FormData;a.append("action","wpdLoadMoreComments");var d=$(".wpdiscuz-sort-button-active").attr("data-sorting");d&&a.append("sorting",d),a.append("lastParentId",0),a.append("offset",0),z=1,a.append("wpdType",b.hasClass("wpdf-active")?"":c),a.append("isFirstLoad",1),$(this).hasClass("wpdf-inline")?$(this).hasClass("wpdf-active")?$(".wpd-comment-info-bar").hide():$(".wpd-comment-info-bar").css("display","flex"):$(".wpd-comment-info-bar").hide(),G(x,!1,a).done(function(a){b.addClass("wpd_not_clicked"),$(".fas",b).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(b.toggleClass("wpdf-active"),$(".wpd-load-comments").remove(),$(".wpd-comment").remove(),$(".wpd-thread-list").prepend(a.data.comment_list),C(a),w=a.data.loadLastCommentId,$(".wpd-load-more-submit").blur(),aE(a)),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("click",".wpdf-reacted.wpd_not_clicked",function(){var a=$(this);a.removeClass("wpd_not_clicked"),$(".fas",a).addClass("fa-pulse fa-spinner");var b=new FormData;b.append("action","wpdMostReactedComment"),G(x,!1,b).done(function(b){a.addClass("wpd_not_clicked"),$(".fas",a).removeClass("fa-pulse fa-spinner"),"object"==typeof b&&b.success&&($("#comment-"+b.data.parentCommentID).length?$("#comment-"+b.data.parentCommentID).parents("[id^=wpd-comm-"+b.data.parentCommentID+"]").replaceWith(b.data.message):$("#comment-"+b.data.commentId).length||$(".wpd-thread-list").prepend(b.data.message),aE(b),au(),$("html, body").animate({scrollTop:$("#comment-"+b.data.commentId).offset().top-m},1e3,av))}).fail(function(c,d,b){console.log(b),$(".fas",a).removeClass("fa-pulse fa-spinner")})}),$("body").on("click",".wpdf-hottest.wpd_not_clicked",function(){var a=$(this);a.removeClass("wpd_not_clicked"),$(".fas",a).addClass("fa-pulse fa-spinner");var b=new FormData;b.append("action","wpdHottestThread"),G(x,!1,b).done(function(b){a.addClass("wpd_not_clicked"),$(".fas",a).removeClass("fa-pulse fa-spinner"),"object"==typeof b&&b.success&&($("#comment-"+b.data.commentId).length?$("#comment-"+b.data.commentId).parents("[id^=wpd-comm-"+b.data.commentId+"]").replaceWith(b.data.message):$(".wpd-thread-list").prepend(b.data.message),aE(b),au(),$("html, body").animate({scrollTop:$("#comment-"+b.data.commentId).offset().top-m},1e3,av))}).fail(function(c,d,b){console.log(b),$(".fas",a).removeClass("fa-pulse fa-spinner")})}),$("body").on("click",".wpd-filter-view-all",function(){$(".wpdf-inline.wpdf-active.wpd_not_clicked").trigger("click")}),$("body").on("click",".wpd-follow-link.wpd_not_clicked",function(){var a=$(this);a.removeClass("wpd_not_clicked"),$(".fas",a).addClass("fa-pulse fa-spinner");var c=aj(a,0),d=ak(c),b=new FormData;b.append("action","wpdFollowUser"),b.append("commentId",d),G(x,!0,b).done(function(b){a.addClass("wpd_not_clicked"),"object"==typeof b?b.success?(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[b.data.code],b.data.code,a),"success"),a.removeClass("wpd-follow-active"),b.data.followTip&&a.attr("wpd-tooltip",b.data.followTip),b.data.followClass&&a.addClass(b.data.followClass),aE(b)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[b.data],b.data,a),"error"):console.log(b),$(".fas",a).removeClass("fa-pulse fa-spinner"),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(c,d,b){console.log(b),$(".fas",a).removeClass("fa-pulse fa-spinner"),$("#wpdiscuz-loading-bar").fadeOut(250)})}),E(),$("body").on("keyup",".wc_email",function(){E($(this))}),j&&$("#wpdcom").length){if($("#wpd-bubble-wrapper").hover(function(){$(this).addClass("wpd-bubble-hover")},function(){$(this).removeClass("wpd-bubble-hover")}),k&&!Cookies.get(wpdiscuzAjaxObj.cookieHideBubbleHint)&&setTimeout(function(){$("#wpd-bubble-wrapper").addClass("wpd-bubble-hover"),Cookies.set(wpdiscuzAjaxObj.cookieHideBubbleHint,"1",{expires:7,path:"/"}),setTimeout(function(){$("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")},1e3*Q)},1e3*k),"content_left"===h){if($(".entry-content").length){var b=Math.min($(".entry-content").offset().left,$("#wpdcom").offset().left)-120,d=b>25?b:25;$("#wpd-bubble-wrapper").css({left:d+"px"}),$("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if($(".post-entry").length){var b=Math.min($(".post-entry").offset().left,$("#wpdcom").offset().left)-120,d=b>25?b:25;$("#wpd-bubble-wrapper").css({left:d+"px"}),$("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if($(".container").length){var b=Math.min($(".container").offset().left,$("#wpdcom").offset().left)-120,d=b>25?b:25;$("#wpd-bubble-wrapper").css({left:d+"px"}),$("#wpd-bubble-wrapper").addClass("wpd-left-content")}else $("#wpd-bubble-wrapper").css({left:"25px"}),$("#wpd-bubble-wrapper").addClass("wpd-left-corner")}else"left_corner"===h?($("#wpd-bubble-wrapper").css({left:"25px"}),$("#wpd-bubble-wrapper").addClass("wpd-left-corner")):"right_corner"===h&&($("#wpd-bubble-wrapper").css({right:"25px"}),$("#wpd-bubble-wrapper").addClass("wpd-right-corner"));$("#wpd-bubble-wrapper").show(),$("body").on("click","#wpd-bubble-add-message-close",function(a){a.preventDefault(),a.stopPropagation(),$("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")}),$("body").on("click","#wpd-bubble",function(){au(),$("#tab-title-reviews").length&&$("#tab-title-reviews a").trigger("click"),$("html, body").animate({scrollTop:$("#wpdcom").offset().top-(m+28)},1e3,function(){av(),$("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover"),wpdiscuzLoadRichEditor?$("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0").focus():$("#wc-textarea-0_0").length&&$("#wc-textarea-0_0").trigger("focus")})}),$("body").on("click","#wpd-bubble-comment-close",function(a){a.preventDefault(),$("#wpd-bubble-notification-message").hide(),$("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")}),$("body").on("click","#wpd-bubble-comment-reply-link a",function(){var a=$(this).attr("href");setTimeout(function(){$("#wpd-bubble-notification-message").hide(),$("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),D(!0);var b=a.match(/#comment\-(\d+)/);U=U.filter(function(a){return a!=b[1]}),$("#wpd-bubble-count .wpd-new-comments-count").text(U.length),0==U.length&&$("#wpd-bubble-count").removeClass("wpd-new-comments")},100)}),$("body").on("click","#wpd-bubble-count",function(){if(U.length){var a=new FormData;a.append("action","wpdBubbleUpdate"),a.append("newCommentIds",U.join()),G(x,!0,a).done(function(a){"object"==typeof a&&a.success&&(a.data.message=a.data.message.filter(function(a){if(!$("#comment-"+a.comment_id).length)return a}),ag(a),$("#wpd-bubble-count").removeClass("wpd-new-comments"),$("#wpd-bubble-count .wpd-new-comments-count").text("0"),U=[],$(".wpd-new-loaded-comment").length&&(au(),$("html, body").animate({scrollTop:$($(".wpd-new-loaded-comment")[0]).offset().top-(m+28)},1e3,av)),aE(a)),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a)})}})}function F(){$.ajax({type:"GET",url:wpdiscuzAjaxObj.bubbleUpdateUrl,beforeSend:function(a){a.setRequestHeader("X-WP-Nonce",wpdiscuzAjaxObj.restNonce)},data:{postId:I,lastId:J,visibleCommentIds:aq()}}).done(function(a){if(!V){if("object"==typeof a){if(a.commentIDsToRemove.forEach(function(a){$("[id^=wpd-comm-"+a+"]").remove()}),a.ids.length){if(t){var b;(b=new FormData).append("action","wpdUpdateAutomatically"),b.append("loadLastCommentId",w),b.append("visibleCommentIds",aq()),G(x,!1,b).done(function(a){!V&&"object"==typeof a&&a.success&&(ag(a),a.data.wc_all_comments_count_new=parseInt(a.data.wc_all_comments_count_new),$(".wpd-thread-info").html(a.data.wc_all_comments_count_before_threads_html),$(".wpd-thread-info").attr("data-comments-count",a.data.wc_all_comments_count_new),$("#wpd-bubble-all-comments-count").replaceWith(a.data.wc_all_comments_count_bubble_html),w=a.data.loadLastCommentId)}).fail(function(b,c,a){console.log(a)})}a.ids=a.ids.filter(function(a){if(!$("#comment-"+a).length)return a});var c=5e3;J=parseInt(a.ids[a.ids.length-1]),U=U.concat(a.ids),R&&a.commentText&&($("#wpd-bubble-author-avatar").html(a.avatar),$("#wpd-bubble-author-name").html(a.authorName),$("#wpd-bubble-comment-date span").html(a.commentDate),$("#wpd-bubble-comment-text").html(a.commentText),$("#wpd-bubble-comment-reply-link a").attr("href",a.commentLink),$("#wpd-bubble-notification-message").show(),c=1e4);var d=parseInt($(".wpd-new-comments-count").text());d+=a.ids.length,$("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),$("#wpd-bubble-wrapper").addClass("wpd-new-comment-added"),setTimeout(function(){$("#wpd-bubble-notification-message").hide(),$("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")},c),$(".wpd-new-comments-count").text(d),$("#wpd-bubble-count").addClass("wpd-new-comments")}a.all_comments_count=parseInt(a.all_comments_count),$("#wpd-bubble-all-comments-count").replaceWith(a.all_comments_count_bubble_html),$(".wpd-reviews-tab").length||($(".wpd-thread-info").html(a.all_comments_count_before_threads_html),$(".wpd-thread-info").attr("data-comments-count",a.all_comments_count))}else console.log(a)}setTimeout(F,u)}).fail(function(b,c,a){console.log(a),setTimeout(F,u)})}if((j&&y||t)&&(c|| !c&&v)&&setTimeout(F,u),$(".wpd-inline-form-wrapper").length){var n=new FormData;n.append("action","wpdGetInlineCommentForm"),G(x,!1,n).done(function(a){"object"==typeof a?a.success?($(".wpd-inline-form-wrapper").append(a.data),$.each($("[name=_wpd_inline_nonce]"),function(){var b=$(this).attr("id"),a=$(this).parents(".wpd-inline-shortcode").attr("id");$(this).attr("id",b+"-"+a.substring(a.lastIndexOf("-")+1))}),$(".wpd-inline-opened").addClass("wpd-active"),$(".wpd-inline-opened").find(".wpd-inline-form-wrapper").show(),$(".wpd-inline-opened").find(".wpd-inline-icon").addClass("wpd-open"),$(".wpd-inline-opened").find(".wpd-inline-icon").removeClass("wpd-ignored"),aC()):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data]),a.data,"error"):console.log(a)}).fail(function(b,c,a){console.log(a)})}function aA(a){if($(a).hasClass("wpd-inline-shortcode"))var b=$(a).attr("id");else var b=$(a).parents(".wpd-inline-shortcode").attr("id");return b.substring(b.lastIndexOf("-")+1)}function aB(){$(".wpd-inline-form-wrapper").hide(),$(".wpd-inline-shortcode").removeClass("wpd-active"),$(".wpd-inline-icon").removeClass("wpd-open")}function o(){$.each($(".wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon"),function(){var a=$(this),b=a.offset().top-window.pageYOffset;a.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&b>0&&b<300&&("blink"===l?(a.addClass("wpd-blink"),setTimeout(function(){a.removeClass("wpd-blink")},3e3)):(a.parents(".wpd-inline-shortcode").addClass("wpd-active"),a.siblings(".wpd-inline-form-wrapper").show(),a.addClass("wpd-open"),aC(a.siblings(".wpd-inline-form-wrapper"))))})}function aC(a){if(a){if(a.offset().left<=10){a.css("left",Math.ceil(parseInt(a.css("left"))-a.offset().left+10));var b=Math.ceil(a.siblings(".wpd-inline-icon.wpd-open").offset().left-a.offset().left+2);b<3&&(b=3),document.styleSheets[0].addRule("#"+a.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+b+"px;")}else if(a.offset().left+a.width()>document.body.clientWidth-10){a.css("left",Math.ceil(parseInt(a.css("left"))+(document.body.clientWidth-(a.offset().left+a.width()))-10));var b=Math.ceil(a.siblings(".wpd-inline-icon.wpd-open").offset().left-a.offset().left+2);b>a.width()-3&&(b=a.width()-3),document.styleSheets[0].addRule("#"+a.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+b+"px;")}}else $.each($(".wpd-inline-form-wrapper:visible"),function(){if($(this).offset().left<=10){$(this).css("left",Math.ceil(parseInt($(this).css("left"))-$(this).offset().left+10));var a=Math.ceil($(this).siblings(".wpd-inline-icon.wpd-open").offset().left-$(this).offset().left+2);a<3&&(a=3),document.styleSheets[0].addRule("#"+$(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"px;")}else if($(this).offset().left+$(this).width()>document.body.clientWidth-10){$(this).css("left",Math.ceil(parseInt($(this).css("left"))+(document.body.clientWidth-($(this).offset().left+$(this).width()))-10));var a=Math.ceil($(this).siblings(".wpd-inline-icon.wpd-open").offset().left-$(this).offset().left+2);a>$(this).width()-3&&(a=$(this).width()-3),document.styleSheets[0].addRule("#"+$(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"px;")}})}function aD(a){var b,c=0;if(a.parents(".wpd_main_comm_form").length)c=parseInt(wpdiscuzAjaxObj.commentTextMaxLength),b=a.parents(".wpd_main_comm_form");else if(a.parents(".wpd-secondary-form-wrapper").length)c=parseInt(wpdiscuzAjaxObj.replyTextMaxLength),b=a.parents(".wpd-secondary-form-wrapper");else if(a.parents("#wpdiscuz-edit-form").length){var e=aj(a);c=parseInt(e.substring(e.lastIndexOf("_")+1))?parseInt(wpdiscuzAjaxObj.replyTextMaxLength):parseInt(wpdiscuzAjaxObj.commentTextMaxLength),b=a.parents("#wpdiscuz-edit-form")}if(c&&b){var g=a.val().length,d=$(".wpd-editor-char-counter",b),f=c-g;d.html(f),f<=10?d.addClass("error"):d.removeClass("error")}}function aE(a,b,c,d){a.data.callbackFunctions&&$.each(a.data.callbackFunctions,function(e){"function"==typeof wpdiscuzAjaxObj[a.data.callbackFunctions[e]]?wpdiscuzAjaxObj[a.data.callbackFunctions[e]](a,b,c,d):"function"==typeof window[a.data.callbackFunctions[e]]?window[a.data.callbackFunctions[e]](a,b,c,d):console.log(a.data.callbackFunctions[e]+" is not a function")})}function G(c,d,a){d&&$("#wpdiscuz-loading-bar").show(),a.append("postId",I),a.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce);var b=a.get("action");wpdiscuzAjaxObj.dataFilterCallbacks&&wpdiscuzAjaxObj.dataFilterCallbacks[b]&&$.each(wpdiscuzAjaxObj.dataFilterCallbacks[b],function(e){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[b][e]]&&(a=wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[b][e]](a,c,d))});var e=c?wpdiscuzAjaxObj.url:wpdiscuzAjaxObj.customAjaxUrl;return $.ajax({type:"POST",url:e,data:a,contentType:!1,processData:!1})}function p(){if(c||wpdiscuzAjaxObj.validateNonceForGuests){var a=new FormData;a.append("action","wpdGetNonce"),G(x,!1,a).done(function(a){"object"==typeof a?a.success?wpdiscuzAjaxObj.wpdiscuz_nonce=a.data:wpdiscuzAjaxObj.setCommentMessage(a.data,"error"):console.log(a)}).fail(function(b,c,a){console.log(a)})}}$(document).on("click","body",function(a){if($(a.target).hasClass("wpd-inline-form-close")||$(a.target).parents(".wpd-inline-form-close").length)a.preventDefault(),$(a.target).parents(".wpd-inline-form-wrapper").hide(),$(a.target).parents(".wpd-inline-shortcode").removeClass("wpd-active"),$(a.target).parents(".wpd-inline-form-wrapper").siblings(".wpd-inline-icon").removeClass("wpd-open");else if(!$(a.target).hasClass("wpd-inline-form-wrapper")&&!$(a.target).parents(".wpd-inline-form-wrapper").length){aB();var b="";$(a.target).hasClass("wpd-inline-icon")?b=$(a.target):$(a.target).parents(".wpd-inline-icon").length&&(b=$(a.target).parents(".wpd-inline-icon")),b.length&&b.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&(b.parents(".wpd-inline-shortcode").addClass("wpd-active"),b.siblings(".wpd-inline-form-wrapper").show(),b.addClass("wpd-open"),b.removeClass("wpd-ignored"),aC(b.siblings(".wpd-inline-form-wrapper")))}(!$(a.target).hasClass("wpd-last-inline-comments-wrapper")&&!$(a.target).parents(".wpd-last-inline-comments-wrapper").length||$(a.target).parents(".wpd-last-inline-comments-wrapper").length&&$(a.target).hasClass("wpd-load-inline-comment"))&&$(".wpd-last-inline-comments-wrapper").remove()}),$("body").on("click",".wpd-inline-submit.wpd_not_clicked",function(c){c.preventDefault();var d=$(this),a=$(this).parents(".wpd_inline_comm_form");if(a[0].checkValidity()){$(this).removeClass("wpd_not_clicked");var b=new FormData;b.append("action","wpdAddInlineComment"),b.append("inline_form_id",aA(a)),$.each($("input, textarea",a),function(c,a){"checkbox"===this.type?$(this).is(":checked")&&b.append($(a).attr("name"),$(a).val()):b.append($(a).attr("name"),$(a).val())}),G(x,!0,b).done(function(b){if(d.addClass("wpd_not_clicked"),"object"==typeof b){if(b.success){a[0].reset(),aB();var e=parseInt(b.data.newCount),c=d.parents(".wpd-inline-icon-wrapper").find(".wpd-inline-icon-count");c.text(e),e?c.addClass("wpd-has-comments"):c.removeClass("wpd-has-comments"),b.data.allCommentsCountNew=parseInt(b.data.allCommentsCountNew),$(".wpd-thread-info").html(b.data.allCommentsCountBeforeThreadsHtml),$(".wpd-thread-info").attr("data-comments-count",b.data.allCommentsCountNew),$("#wpd-bubble-all-comments-count").replaceWith(b.data.allCommentsCountBubbleHtml),b.data.message&&az(b.data.message),wpdiscuzAjaxObj.setCommentMessage(b.data.notification,"success")}else b.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[b.data],b.data,d),"error")}else wpdiscuzAjaxObj.setCommentMessage(b,"error");$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}}),$("body").on("keydown",".wpd-form",function(a){a.ctrlKey&&13==a.keyCode&&$(this).find(".wc_comm_submit").trigger("click")}),$("body").on("keydown","#wpdiscuz-edit-form",function(a){a.ctrlKey&&13==a.keyCode&&$(this).find(".wc_save_edited_comment").trigger("click")}),$("body").on("keydown",".wpd-inline-comment-content",function(a){a.ctrlKey&&13==a.keyCode&&$(this).parents(".wpd_inline_comm_form").find(".wpd-inline-submit.wpd_not_clicked").trigger("click")}),$("body").on("click",".wpd-inline-icon-count.wpd-has-comments",function(){var b=$(this),a=new FormData;a.append("action","wpdGetLastInlineComments"),a.append("inline_form_id",aA(b)),G(x,!0,a).done(function(a){"object"==typeof a?a.success?$(a.data).insertAfter(b):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,b),"error"):console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("click",".wpd-view-all-inline-comments",function(a){a.preventDefault(),$(this).parents(".wpd-last-inline-comments-wrapper").remove(),$(".wpdf-inline").hasClass("wpdf-active")||$(".wpdf-inline").trigger("click"),au(),$("html, body").animate({scrollTop:$(".wpdf-inline").offset().top-m},1e3,av)}),$("body").on("click",".wpd-feedback-content-link",function(a){a.preventDefault();var b=$(this).data("feedback-content-id");au(),$("html, body").animate({scrollTop:$("#wpd-inline-"+b).offset().top-(m+6)},1e3,function(){av(),$("#wpd-inline-"+b).addClass("wpd-active")})}),("scroll_open"===l||"blink"===l)&&(o(),$(window).on("scroll",o)),$("body").on("click","#wpd-post-rating.wpd-not-rated .wpd-rate-starts svg",function(){var a=new FormData,b=$(this).index();b>=0&&b<5&&(a.append("action","wpdUserRate"),a.append("rating",b+1),G(x,!0,a).done(function(a){"object"==typeof a?(a.success?location.reload(!0):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data),"error"),aE(a)):console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)}))}),$("body").on("submit","#wpdiscuz-subscribe-form",function(d){d.preventDefault();var a=$(this);let b=$("#wpdiscuz_subscription_button",a);if(a[0].checkValidity()&&(f=a,g=!0,"2.0"===e&&$("input[name=wpdiscuz_recaptcha_subscribe_form]",f).length&&!$("input[name=wpdiscuz_recaptcha_subscribe_form]",f).val().length?(g=!1,$(".wpdiscuz-recaptcha",f).css("border","1px solid red")):"2.0"===e&&$("input[name=wpdiscuz_recaptcha_subscribe_form]",f).length&&$(".wpdiscuz-recaptcha",f).css("border","none"),g)&&b.hasClass("wpd_not_clicked")){b.removeClass("wpd_not_clicked");var f,g,c=new FormData;c.append("action","wpdAddSubscription"),$("*",a).each(function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&c.append(this.name+"",$(this).val()),("checkbox"==this.type||"radio"==this.type)&&$(this).is(":checked")&&c.append(this.name+"",$(this).val())}),G(x,!0,c).done(function(a){"object"==typeof a?a.success?(wpdiscuzAjaxObj.setCommentMessage(a.data,"success"),setTimeout(function(){location.reload(!0)},3e3)):wpdiscuzAjaxObj.setCommentMessage(a.data,"error"):wpdiscuzAjaxObj.setCommentMessage(a,"error"),$("#wpdiscuz-loading-bar").fadeOut(250),V=!1,b.addClass("wpd_not_clicked")}).fail(function(c,d,a){console.log(a),b.addClass("wpd_not_clicked"),$("#wpdiscuz-loading-bar").fadeOut(250)})}}),$("body").on("click",".wpd-unsubscribe",function(b){b.preventDefault();var a=new FormData;a.append("action","wpdUnsubscribe"),a.append("sid",$(this).data("sid")),a.append("skey",$(this).data("skey")),G(x,!0,a).done(function(a){"object"==typeof a?a.success?(wpdiscuzAjaxObj.setCommentMessage(a.data,"success"),setTimeout(function(){location.reload(!0)},3e3)):wpdiscuzAjaxObj.setCommentMessage(a.data,"error"):console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250),V=!1}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),wpdiscuzAjaxObj.resetActiveFilters=function(a){$(".wpd-filter.wpdf-active"+(a?":not("+a+")":"")).removeClass("wpdf-active")},wpdiscuzAjaxObj.getAjaxObj=G,wpdiscuzAjaxObj.initNonce=p,p()});var onloadCallback=function(){if(document.getElementById("wpdiscuz-recaptcha-0_0")&&"2.0"===wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion&&(1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!wpdiscuzAjaxObj.is_user_logged_in||1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&wpdiscuzAjaxObj.is_user_logged_in))try{grecaptcha.render("wpdiscuz-recaptcha-0_0",{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(a){jQuery("#wpdiscuz-recaptcha-field-0_0").val("key")},"expired-callback":function(){jQuery("#wpdiscuz-recaptcha-field-0_0").val("")}})}catch(a){console.log(a),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+a.message,"error")}}
1
+ var wpdiscuzLoadRichEditor=parseInt(wpdiscuzAjaxObj.loadRichEditor);if(wpdiscuzLoadRichEditor&&document.querySelector(".wpdiscuz-textarea-wrap"))var wpDiscuzEditor=new WpdEditor;function wpdMessagesOnInit(a,b){wpdiscuzAjaxObj.setCommentMessage(a,b),setTimeout(function(){location.href=location.href.substring(0,location.href.indexOf("wpdiscuzUrlAnchor")-1)},3e3)}wpdiscuzAjaxObj.setCommentMessage=function(c,b,d){var a="wpdiscuz-message-error";if(c instanceof Array)for(var e in c)b instanceof Array?"success"===b[e]?a="wpdiscuz-message-success":"warning"===b[e]&&(a="wpdiscuz-message-warning"):"success"===b?a="wpdiscuz-message-success":"warning"===b&&(a="wpdiscuz-message-warning"),jQuery("<div/>").addClass(a).html(c[e]).prependTo("#wpdiscuz-comment-message").delay(d instanceof Array?d[e]:d||4e3).fadeOut(1e3,function(){jQuery(this).remove()});else"success"===b?a="wpdiscuz-message-success":"warning"===b&&(a="wpdiscuz-message-warning"),jQuery("<div/>").addClass(a).html(c).prependTo("#wpdiscuz-comment-message").delay(d||4e3).fadeOut(1e3,function(){jQuery(this).remove()})},wpdiscuzAjaxObj.applyFilterOnPhrase=function(a,b,c){return wpdiscuzAjaxObj.phraseFilters&&jQuery.each(wpdiscuzAjaxObj.phraseFilters,function(d){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[d]]&&(a=wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[d]](a,b,c))}),a},jQuery(document).ready(function($){$("body").addClass("wpdiscuz_"+wpdiscuzAjaxObj.version);var H,c=wpdiscuzAjaxObj.is_user_logged_in,q=1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!c,r=1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&c,e=wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion,s=parseInt(wpdiscuzAjaxObj.commentListLoadType),I=parseInt(wpdiscuzAjaxObj.wc_post_id);wpdiscuzAjaxObj.wpdiscuz_nonce="";var t=parseInt(wpdiscuzAjaxObj.commentListUpdateType),u=1e3*parseInt(wpdiscuzAjaxObj.commentListUpdateTimer),v=parseInt(wpdiscuzAjaxObj.liveUpdateGuests),w=wpdiscuzAjaxObj.loadLastCommentId,J=w,f=parseInt(wpdiscuzAjaxObj.firstLoadWithAjax);Cookies.get("wpdiscuz_comments_sorting")&&Cookies.remove("wpdiscuz_comments_sorting",{path:""}),Cookies.get("wordpress_last_visit")&&Cookies.remove("wordpress_last_visit",{path:""}),Cookies.get("wpdiscuz_last_visit")&&Cookies.remove("wpdiscuz_last_visit",{path:""});var i=parseInt(wpdiscuzAjaxObj.wordpressIsPaginate),K=wpdiscuzAjaxObj.storeCommenterData,L=parseInt(wpdiscuzAjaxObj.wmuEnabled),M=wpdiscuzAjaxObj.isCookiesEnabled,N=!0,g=wpdiscuzAjaxObj.cookiehash,O=parseInt(wpdiscuzAjaxObj.isLoadOnlyParentComments),P=parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0,x=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),j=parseInt(wpdiscuzAjaxObj.enableBubble),y=parseInt(wpdiscuzAjaxObj.bubbleLiveUpdate),k=parseInt(wpdiscuzAjaxObj.bubbleHintTimeout),Q=parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout)?parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout):5,R=parseInt(wpdiscuzAjaxObj.bubbleShowNewCommentMessage),h=wpdiscuzAjaxObj.bubbleLocation,l=wpdiscuzAjaxObj.inlineFeedbackAttractionType,m=parseInt(wpdiscuzAjaxObj.scrollSize),m=m||32,S=[],T=[],U=[],V=!1,z=1,W=$("html").css("scroll-behavior"),X=$("body").css("scroll-behavior");if($(".wc_social_plugin_wrapper .wp-social-login-provider-list").length?$(".wc_social_plugin_wrapper .wp-social-login-provider-list").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):$(".wc_social_plugin_wrapper .the_champ_login_container").length?$(".wc_social_plugin_wrapper .the_champ_login_container").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):$(".wc_social_plugin_wrapper .social_connect_form").length?$(".wc_social_plugin_wrapper .social_connect_form").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):$(".wc_social_plugin_wrapper .oneall_social_login_providers").length&&$(".wc_social_plugin_wrapper .oneall_social_login .oneall_social_login_providers").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"),wpdiscuzLoadRichEditor&&$("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0"),window.addEventListener("beforeunload",function(c){var b=$(".wpd-form").not(":hidden");if(b.length){if(wpdiscuzLoadRichEditor&&document.querySelector(".wpdiscuz-textarea-wrap")){for(var a=0;a<b.length;a++)if("\n"!==wpDiscuzEditor.createEditor($(b[a]).find(".ql-container").attr("id")).getText()){c.preventDefault(),c.returnValue="";return}}else for(var a=0;a<b.length;a++)if($(b[a]).find(".wc_comment").val()){c.preventDefault(),c.returnValue="";return}}}),wpdiscuzLoadRichEditor||($(document).delegate("textarea.wc_comment","input",function(){aD($(this))}),$.each($("textarea.wc_comment"),function(){aD($(this))})),$("body").on("focus","#wpdcom .ql-editor, #wpdcom .wc_comment",function(){$(".wpd-form-foot",$(this).parents(".wpd_comm_form")).slideDown(P)}),$("body").on("focus","#wpdcom textarea",function(){$(this).next(".autogrow-textarea-mirror").length||$(this).autoGrow()}),c||aa({comment_author:Cookies.get("comment_author_"+g),comment_author_email:Cookies.get("comment_author_email_"+g),comment_author_url:Cookies.get("comment_author_url_"+g)}),$(".wpd-vote-down.wpd-dislike-hidden").remove(),$(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd"),$("body").on("click","#wpd-editor-source-code-wrapper-bg",function(){$(this).hide(),$("#wpd-editor-source-code-wrapper").hide(),$("#wpd-editor-uid").val(""),$("#wpd-editor-source-code").val("")}),wpdiscuzLoadRichEditor&&$("body").on("click","#wpd-insert-source-code",function(){var a=wpDiscuzEditor.createEditor("#"+$("#wpd-editor-uid").val());a.deleteText(0,a.getLength(),Quill.sources.USER);var b=$("#wpd-editor-source-code").val();b.length&&a.clipboard.dangerouslyPasteHTML(0,b,Quill.sources.USER),a.update(),$("#wpd-editor-source-code-wrapper-bg").hide(),$("#wpd-editor-source-code-wrapper").hide(),$("#wpd-editor-uid").val(""),$("#wpd-editor-source-code").val("")}),$("body").on("click",".wpd-reply-button",function(){var a=aj($(this),0);$(this).hasClass("wpdiscuz-clonned")?(wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+a).focus()},P):setTimeout(function(){$("#wc-textarea-"+a).trigger("focus")},P),$("#wpd-secondary-form-wrapper-"+a).slideToggle(P)):ah($(this)),function(a){if((q||r)&&"2.0"===e){var b=ak(a);setTimeout(function(){if(!T[b])try{T[b]=grecaptcha.render("wpdiscuz-recaptcha-"+a,{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(b){$("#wpdiscuz-recaptcha-field-"+a).val("key")},"expired-callback":function(){$("#wpdiscuz-recaptcha-field-"+a).val("")}})}catch(c){console.log(c),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+c.message,"error")}},1e3)}}(a)}),$("body").on("click","#wpdcom [data-wpd-clipboard]",function(){var b=$(this).data("wpd-clipboard"),a=$("<input/>");a.appendTo("body").css({position:"absolute",top:"-10000000px"}).val(b),a.trigger("select"),document.execCommand("copy"),a.remove(),wpdiscuzAjaxObj.setCommentMessage(b+"<br/>"+wpdiscuzAjaxObj.wc_copied_to_clipboard,"success",5e3)}),$("body").on("click",".wpdiscuz-nofollow,.wc_captcha_refresh_img,.wpd-load-more-submit",function(a){a.preventDefault()}),$("body").on("click",".wpd-toggle.wpd_not_clicked",function(){var a=$(this);a.removeClass("wpd_not_clicked");var b=aj($(this),0),c=$(this),d=$(".fas",c);!c.parents(".wpd-comment:not(.wpd-reply)").children(".wpd-reply").length&&O?aw(b,a):$("#wpd-comm-"+b+"> .wpd-reply").slideToggle(700,function(){$(this).is(":hidden")?(d.removeClass("fa-chevron-up"),d.addClass("fa-chevron-down"),c.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_show_replies_text),c.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_show_replies_text)):(d.removeClass("fa-chevron-down"),d.addClass("fa-chevron-up"),c.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),c.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text)),a.addClass("wpd_not_clicked")})}),$("body").on("mouseenter",".wpd-new-loaded-comment",function(){$(this).removeClass("wpd-new-loaded-comment")}),$("body").on("click",".wpd-sbs-toggle",function(){$(".wpdiscuz-subscribe-bar").slideToggle(P)}),parseInt(wpdiscuzAjaxObj.wpDiscuzIsShowOnSubscribeForm)&&!c&&wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&$("#wpdiscuz-subscribe-form").length&&("2.0"===e?(setTimeout(function(){try{grecaptcha.render("wpdiscuz-recaptcha-subscribe-form",{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(a){$("#wpdiscuz-recaptcha-field-subscribe-form").val("key")},"expired-callback":function(){$("#wpdiscuz-recaptcha-field-subscribe-form").val("")}})}catch(a){console.log(a),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+a.message,"error")}},1e3),$("body").on("submit","#wpdiscuz-subscribe-form",function(a){$("#wpdiscuz-recaptcha-field-subscribe-form").val()?$(".wpdiscuz-recaptcha",$(this)).css("border","none"):($(".wpdiscuz-recaptcha",$(this)).css("border","1px solid red"),a.preventDefault())})):"3.0"===e&&$("body").on("click","#wpdiscuz_subscription_button",function(b){var c=$(this).parents("#wpdiscuz-subscribe-form");b.preventDefault();try{grecaptcha.ready(function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/wpdAddSubscription"}).then(function(a){console.log(5555),document.getElementById("wpdiscuz-recaptcha-field-subscribe-form").value=a,c.trigger("submit")},function(a){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(a)})})}catch(a){console.log(a),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+a.message,"error")}})),(q||r)&&"2.0"===e){var A=$(window).width(),a=$("#wpdcom").width();a>=1100&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"65%"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"35%"})),a>=940&&a<1100&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"60%"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"40%"})),a>=810&&a<940&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"40%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"60%"})),a>=730&&a<810&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"45%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"55%"})),a>=610&&a<730&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.85)","-webkit-transform":"scale(0.85)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"43%"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"55%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"30%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"70%"})),A>650&&(a>=510&&a<610&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"center 0","-webkit-transform-origin":"center 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"35%"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"63%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"30%",position:"relative",right:"-60px"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"70%"}),$("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"})),a>=470&&a<510&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"center 0","-webkit-transform-origin":"center 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"40%"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"60%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({float:"none",width:"100%",display:"block"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({float:"none",width:"100%",display:"block"}),$("#wpdcom .wpd_main_comm_form .wc-form-footer").css({"margin-left":"0px"}),$("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"})),a<470&&($("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({margin:"0px auto","transform-origin":"center 0","-webkit-transform-origin":"center 0"}),$("#wpdcom .wpd-form-col-left").css({float:"none",width:"100%",display:"block"}),$("#wpdcom .wpd-form-col-right").css({float:"none",width:"100%",display:"block"}),$("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"}),$("#wpdcom .wpd-secondary-form-wrapper .wc_notification_checkboxes").css({"text-align":"center"}),$("#wpdcom .wpd-secondary-form-wrapper .wc-field-submit").css({"text-align":"center"})))}function Y(b,a,c){G(x||L,!1,a).done(function(a){if($(c).addClass("wpd_not_clicked"),"object"==typeof a){if(a.success){"collapsed"===wpdiscuzAjaxObj.commentFormView&&$(".wpd-form-foot",b).slideUp(P),a.data.wc_all_comments_count_new=parseInt(a.data.wc_all_comments_count_new),$(".wpd-thread-info").html(a.data.wc_all_comments_count_before_threads_html),$(".wpd-thread-info").attr("data-comments-count",a.data.wc_all_comments_count_new),$("#wpd-bubble-all-comments-count").replaceWith(a.data.wc_all_comments_count_bubble_html);var d=P;a.data.is_main?az(a.data.message):(d=P+700,$("#wpd-secondary-form-wrapper-"+a.data.uniqueid).slideToggle(700),1==a.data.is_in_same_container?$("#wpd-secondary-form-wrapper-"+a.data.uniqueid).after(a.data.message):$("#wpd-comm-"+a.data.uniqueid).after(a.data.message)),Z(a),_(a),M&&N?ab(a.data):N||$(".wpd-cookies-checkbox").prop("checked",!1),b.get(0).reset(),wpdiscuzLoadRichEditor?wpDiscuzEditor.createEditor("#wpd-editor-"+$(".wpdiscuz_unique_id",b).val()).setContents([{insert:"\n"}]):aD(b.find(".wc_comment")),aa(a.data),$(".wmu-preview-wrap",b).remove(),ay(),parseInt(wpdiscuzAjaxObj.scrollToComment)&&setTimeout(function(){au(),$("html, body").animate({scrollTop:$("#comment-"+a.data.new_comment_id).offset().top-m},1e3,av)},d),aE(a,b)}else a.data&&(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,b),"error"),aE(a,b))}else wpdiscuzAjaxObj.setCommentMessage(a,"error");$("#wpdiscuz-loading-bar").fadeOut(250),V=!1}).fail(function(b,d,a){console.log(a),$(c).addClass("wpd_not_clicked"),$("#wpdiscuz-loading-bar").fadeOut(250)})}function Z(b){if(!b.data.held_moderate){var a=new FormData;a.append("action","wpdCheckNotificationType"),a.append("comment_id",b.data.new_comment_id),a.append("email",b.data.comment_author_email),a.append("isParent",b.data.is_main),G(x,!0,a)}}function _(a){if(a.data.redirect>0&&a.data.new_comment_id){var b=new FormData;b.append("action","wpdRedirect"),b.append("commentId",a.data.new_comment_id),G(x,!0,b).done(function(a){"object"==typeof a&&a.success&&setTimeout(function(){location.href=a.data},2e3)}).fail(function(b,c,a){console.log(a)})}}function aa(a){$(".wpd_comm_form .wc_name").val(a.comment_author),a.comment_author_email&&0>a.comment_author_email.indexOf("@example.com")&&$(".wpd_comm_form .wc_email").val(a.comment_author_email),a.comment_author_url&&$(".wpd_comm_form .wc_website").val(a.comment_author_url)}function ab(b){var c=b.comment_author_email,d=b.comment_author,a=b.comment_author_url;null==K?(Cookies.set("comment_author_email_"+g,c),Cookies.set("comment_author_"+g,d),a.length&&Cookies.set("comment_author_url_"+g,a)):(K=parseInt(K),Cookies.set("comment_author_email_"+g,c,{expires:K,path:"/"}),Cookies.set("comment_author_"+g,d,{expires:K,path:"/"}),a.length&&Cookies.set("comment_author_url_"+g,a,{expires:K,path:"/"})),$(".wpd-cookies-checkbox").length&&$(".wpd-cookies-checkbox").prop("checked",!0)}function ac(a,b){$("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").show(),$("#wpd-comm-"+a+" .wpdiscuz-edit-form-wrap").replaceWith(b),$("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-last-edited").show()}$("body").on("click",".wc_comm_submit.wpd_not_clicked",function(){var d=$(this),f=1,a=$(this).parents("form");if("true"===a.attr("data-uploading")){wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhraseDoingUpload,"wmuPhraseDoingUpload",a),"warning");return}if(a.hasClass("wpd_main_comm_form")||(f=an($(this).parents(".wpd-comment"))),as(a,"#wpd-editor-"+$(".wpdiscuz_unique_id",a).val()),a.on("submit",function(a){a.preventDefault()}),a[0].checkValidity()&&(h=a,i=!0,"2.0"===e&&$("input[name=wc_captcha]",h).length&&!$("input[name=wc_captcha]",h).val().length?(i=!1,$(".wpdiscuz-recaptcha",h).css("border","1px solid red")):"2.0"===e&&$("input[name=wc_captcha]",h).length&&$(".wpdiscuz-recaptcha",h).css("border","none"),i)){V=!0,ax(a),$(d).removeClass("wpd_not_clicked");var h,i,b=new FormData;if(b.append("action","wpdAddComment"),$(":input",a).each(function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&b.append(this.name+"",$(this).val().trim()),("checkbox"==this.type||"radio"==this.type)&&$(this).is(":checked")&&b.append(this.name+"",$(this).val())}),b.append("wpd_comment_depth",f),wpdiscuzAjaxObj.wpdiscuz_zs&&b.append("wpdiscuz_zs",wpdiscuzAjaxObj.wpdiscuz_zs),$(".wpd-cookies-checkbox",a).length?$(".wpd-cookies-checkbox",a).prop("checked")||(N=!1):c&&(N=!1),$("#wpdiscuz-loading-bar").show(),wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&"3.0"===e&&(1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!wpdiscuzAjaxObj.is_user_logged_in||1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&wpdiscuzAjaxObj.is_user_logged_in))try{grecaptcha.ready(function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/addComment"}).then(function(c){b.append("g-recaptcha-response",c),Y(a,b,d)},function(a){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(a)})})}catch(g){console.log(g),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+g.message,"error"),$("#wpdiscuz-loading-bar").fadeOut(250)}else Y(a,b,d)}(function(a){if((q||r)&&"2.0"===e){var b=ak(a);grecaptcha.reset(T[b])}})($(".wpdiscuz_unique_id",a).val()),ar()}),$("body").on("click",".wpd_editable_comment",function(){H&&$(".wpdiscuz-edit-form-wrap").length&&ac(aj($(".wpdiscuz-edit-form-wrap"),0),H);var c=$(this),b=aj(c,0),d=ak(b),a=new FormData;a.append("action","wpdEditComment"),a.append("commentId",d),H=$("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-text").get(0),G(x,!0,a).done(function(a){if("object"==typeof a){if(a.success){if($("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text").replaceWith(a.data.html),wpdiscuzLoadRichEditor){var d=wpDiscuzEditor.createEditor("#wpd-editor-edit_"+b);d.clipboard.dangerouslyPasteHTML(0,a.data.content),d.update(),$(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd")}else $("#wc-textarea-edit_"+b).val(a.data.content),aD($("#wc-textarea-edit_"+b));$("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").hide(),$("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-last-edited").hide()}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,c),"error")}else console.log(a);$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("click",".wc_save_edited_comment",function(){var d=$(this),b=aj(d),e=ak(b),a=$("#wpd-comm-"+b+" #wpdiscuz-edit-form");if(as(a,"#wpd-editor-edit_"+b),a.on("submit",function(a){a.preventDefault()}),a[0].checkValidity()){var c=new FormData;c.append("action","wpdSaveEditedComment"),c.append("commentId",e),$(":input",a).each(function(){""!==this.name&&"checkbox"!==this.type&&"radio"!==this.type&&c.append(this.name+"",$(this).val()),("checkbox"===this.type||"radio"===this.type)&&$(this).is(":checked")&&c.append(this.name+"",$(this).val())}),G(x,!0,c).done(function(a){"object"==typeof a?(a.success?(ac(b,a.data.message),a.data.comment_approved_html&&$("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-subheader").append(a.data.comment_approved_html),a.data.lastEdited&&($("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-last-edited").remove(),$(a.data.lastEdited).insertAfter("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text")),a.data.twitterShareLink&&$("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_tw").attr("href",a.data.twitterShareLink),a.data.whatsappShareLink&&$("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_whatsapp").attr("href",a.data.whatsappShareLink),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+b)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,d),"error"),aE(a,e)):console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}}),$("body").on("click",".wc_cancel_edit",function(){var a=aj($(this));ac(a,H),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+a)}),!i&&f&&(z=0,1==f?setTimeout(function(){ae(!0)},500):$("body").on("click",".wpd-load-comments",function(){$(this).parent(".wpd-load-more-submit-wrap").remove(),ae(!0)})),$("body").on("click",".wpd-load-more-submit",function(){var a=$(this),b="wpd-loaded";a.hasClass(b)&&ae(!1,a,b,"wpd-loading")});var ad=!1;function B(){var a=document.getElementById("wpdiscuzHasMoreComments"),b=0;a&&(b=a.dataset.is_show_load_more);var c=document.getElementById("wpdcom")?document.getElementById("wpdcom").clientHeight:0,d=$(window).height()+$(window).scrollTop();c&&d&&100*d/c>=80&& !1===ad&&1==b&&(ad=!0,ae(!1,$(".wpd-load-more-submit")))}function ae(c,b,e,g){b&&(b.toggleClass(e),b.toggleClass(g));var a=new FormData;a.append("action","wpdLoadMoreComments");var d=$(".wpdiscuz-sort-button-active").attr("data-sorting");d&&a.append("sorting",d),a.append("offset",z),a.append("lastParentId",al()),a.append("isFirstLoad",c?1:0);var h=$(".wpdf-active").attr("data-filter-type");a.append("wpdType",h||""),G(x,!c||1!=f,a).done(function(a){"object"==typeof a&&a.success&&(z++,c&&$(".wpd-comment").remove(),$(".wpdiscuz_single").remove(),$(".wpdiscuz-comment-pagination").before(a.data.comment_list),C(a,c&&2!==s),ad=!1,a.data.loadLastCommentId&&(w=a.data.loadLastCommentId),aE(a),c&&D(!1)),$("#wpdiscuz-loading-bar").fadeOut(250),$(".wpd-load-more-submit").blur(),b&&(b.toggleClass(e),b.toggleClass(g))}).fail(function(c,d,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250),$(".wpd-load-more-submit").blur(),b&&(b.toggleClass(e),b.toggleClass(g))})}function C(a,d){var b=document.getElementById("wpdiscuzHasMoreComments");if(!1==a.data.is_show_load_more)b&&(b.dataset.is_show_load_more=0),$(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide();else if(am(a.data.last_parent_id),b&&(b.dataset.is_show_load_more=1),d&&$(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").show(),a.data.comments_left>0){if(!$(".wpd-load-more-submit .wpd-comments-left").length){let c=$("<span>");c.addClass("wpd-comments-left"),$(".wpd-load-more-submit").append(c)}$(".wpd-load-more-submit .wpd-comments-left").text(a.data.comments_left_text)}aE(a)}function D(d){var b=location.href.match(/#comment\-(\d+)/);if(null!==b){var c=b[1];if($("#comment-"+c).length)setTimeout(function(){au(),$("html, body").animate({scrollTop:$("#comment-"+c).parents("[id^=wpd-comm-]").offset().top-m},1e3,av),d&&af(c)},500);else{var a=new FormData;a.append("action","wpdGetSingleComment"),a.append("commentId",c),G(x,!0,a).done(function(a){if("object"==typeof a&&a.success){var b="#comment-"+c;$("#comment-"+a.data.parentCommentID).length?$("#comment-"+a.data.parentCommentID).parents("[id^=wpd-comm-"+a.data.parentCommentID+"]").replaceWith(a.data.message):$(".wpd-thread-list").prepend(a.data.message),aE(a),au(),$("html, body").animate({scrollTop:$(b).offset().top-m},1e3,av),d&&af(c)}$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}}}function af(a){setTimeout(function(){$("#comment-"+a).siblings(".wpd-secondary-form-wrapper").is(":visible")||$("#comment-"+a).find(".wpd-reply-button").trigger("click")},1100)}function ag(b){if(void 0!==b.data.message)for(var c,d=b.data.message,a=0;a<d.length;a++)ap((c=d[a]).comment_parent,c.comment_html)}function ah(b){var a=aj(b,0);$("#wpdiscuz_form_anchor-"+a).before(ai(a));var d=$("#wpd-secondary-form-wrapper-"+a);c||aa({comment_author:Cookies.get("comment_author_"+g),comment_author_email:Cookies.get("comment_author_email_"+g),comment_author_url:Cookies.get("comment_author_url_"+g)}),wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+a).focus()},P):setTimeout(function(){$("#wc-textarea-"+a).trigger("focus")},P),d.slideToggle(P,function(){b.addClass("wpdiscuz-clonned")})}function ai(a){return $("#wpdiscuz_hidden_secondary_form").html().replace(/wpdiscuzuniqueid/g,a)}function aj(a,c){var b="";return(b=c?a.parents(".wpd-main-form-wrapper").attr("id"):a.parents(".wpd-comment").attr("id")).substring(b.lastIndexOf("-")+1)}function ak(a){return a.substring(0,a.indexOf("_"))}function al(){return $(".wpd-load-more-submit").attr("data-lastparentid")}function am(a){$(".wpd-load-more-submit").attr("data-lastparentid",a),2!==s&&$(".wpdiscuz-comment-pagination").show()}function an(a){var b=a.attr("class").split(" "),c="";return $.each(b,function(b,a){"wpd_comment_level"===ao(a,!1)&&(c=ao(a,!0))}),parseInt(c)+1}function ao(a,b){return b?a.substring(a.indexOf("-")+1):a.substring(0,a.indexOf("-"))}function ap(a,b){if(0==a)az(b);else{var c=aj($("#comment-"+a),0);$("#wpdiscuz_form_anchor-"+c).after(b)}}function aq(){var a=[];return $(".wpd-comment-right").each(function(){a.push(ak(aj($(this),0)))}),a.join(",")}function ar(){$(".wpdiscuz_reset").val("")}function as(a,b){var c=a.find(".wpd-required-group");wpdiscuzLoadRichEditor&&a.find(".wc_comment").val($(b+">.ql-editor").html()),at(a),$.each(c,function(){$("input",this).prop("required",!1),0===$("input:checked",this).length?$("input",$(this)).prop("required",!0):$(".wpd-field-invalid",this).remove()})}function at(c){var b=c.find(".wc_comment"),a=b.val().trim().replace(/<p><br><\/p>/g,"\n").replace(/<p>(.*?)<\/p>/g,"$1\n");a=(a=(a=(a=a.replace(/<img src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img[^>]+alt=["|']([^"|']+)["|'][^>]+src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'][^>]?>/g," $1 ")).replace(/<img\s+([^>]*)class=["|']wpdem\-sticker["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img\s+([^>]*)src=["|']([^"|']+)["|'](.*?)[^>]*>/g," $2 "),b.val(a)}function au(){$("html, body").css("scroll-behavior","unset")}function av(){$("html").css("scroll-behavior",W),$("body").css("scroll-behavior",X)}function aw(b,d){var c=ak(b),a=new FormData;a.append("action","wpdShowReplies"),a.append("commentId",c),G(x,!0,a).done(function(a){d.addClass("wpd_not_clicked"),"object"==typeof a&&a.success&&($("#wpd-comm-"+b).replaceWith(a.data.comment_list),$("#wpd-comm-"+b+" .wpd-toggle .fas").removeClass("fa-chevron-down").addClass("fa-chevron-up"),$("#wpd-comm-"+b+" .wpd-toggle .wpd-view-replies .wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),$("#wpd-comm-"+b+" .wpd-toggle").attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text),aE(a)),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),d.addClass("wpd_not_clicked"),$("#wpdiscuz-loading-bar").fadeOut(250)})}function ax(a){$(".wpd-agreement-checkbox",a).each(function(){$(this).hasClass("wpd_agreement_hide")&&M&&$(this).prop("checked")&&(Cookies.set($(this).attr("name")+"_"+g,1,{expires:30,path:"/"}),$("input[name="+$(this).attr("name")+"]").each(function(){S.push($(this))}))})}function ay(){S.length&&(S.forEach(function(a){a.parents(".wpd-field-checkbox").remove()}),S=[])}function az(a){$(".wpd-sticky-comment").last()[0]?$(a).insertAfter($(".wpd-sticky-comment").last()[0]):$(".wpd-thread-list").prepend(a)}function E(a){a?a.prop("required")||(a.val()?a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none")):$.each($(".wc_email"),function(c,b){var a=$(b);a.prop("required")||(a.val()?a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none"))})}if(2!==s||i||($(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide(),B(),$(window).scroll(function(){B()})),wpdiscuzAjaxObj.setLoadMoreVisibility=C,$("body").on("click",".wpd-vote-up.wpd_not_clicked, .wpd-vote-down.wpd_not_clicked",function(){var b,c=$(this);$(c).removeClass("wpd_not_clicked");var d=aj(c),e=ak(d);b=$(this).hasClass("wpd-vote-up")?1:-1;var a=new FormData;a.append("action","wpdVoteOnComment"),a.append("commentId",e),a.append("voteType",b),G(x,!0,a).done(function(a){if($(c).addClass("wpd_not_clicked"),"object"==typeof a){if(a.success){if("total"===a.data.buttonsStyle){var d=$(".wpd-comment-footer .wpd-vote-result",$("#comment-"+e)),h=a.data.votes;d.text(a.data.votesHumanReadable),d.attr("title",h),d.removeClass("wpd-up wpd-down"),h>0&&d.addClass("wpd-up"),h<0&&d.addClass("wpd-down")}else{var f=$(".wpd-comment-footer .wpd-vote-result-like",$("#comment-"+e)),g=$(".wpd-comment-footer .wpd-vote-result-dislike",$("#comment-"+e));f.text(a.data.likeCountHumanReadable),f.attr("title",a.data.likeCount),g.text(a.data.dislikeCountHumanReadable),g.attr("title",a.data.dislikeCount),parseInt(a.data.likeCount)>0?f.addClass("wpd-up"):f.removeClass("wpd-up"),0>parseInt(a.data.dislikeCount)?g.addClass("wpd-down"):g.removeClass("wpd-down")}var i=$(".wpd-comment-footer .wpd-vote-up",$("#comment-"+e)),j=$(".wpd-comment-footer .wpd-vote-down",$("#comment-"+e));i.removeClass("wpd-up"),j.removeClass("wpd-down"),a.data.curUserReaction>0?i.addClass("wpd-up"):a.data.curUserReaction<0&&j.addClass("wpd-down")}else a.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,c),"error");aE(a,e,b)}else console.log(a);$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,d,a){console.log(a),$(c).addClass("wpd_not_clicked"),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$(document).on("click","body",function(b){var a=$(".wpdiscuz-sort-buttons");$(b.target).hasClass("wpdf-sorting")||$(b.target).parent().hasClass("wpdf-sorting")?a.css({display:a.is(":visible")?"none":"flex"}):a.hide()}),$("body").on("click",".wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)",function(){var c=$(this),b=$(this).attr("data-sorting");if(b){$(".wpdiscuz-sort-button.wpdiscuz-sort-button-active").removeClass("wpdiscuz-sort-button-active").appendTo(".wpdiscuz-sort-buttons"),c.addClass("wpdiscuz-sort-button-active").prependTo(".wpdf-sorting");var a=new FormData;a.append("action","wpdSorting"),a.append("sorting",b);var d=$(".wpdf-active").attr("data-filter-type");a.append("wpdType",d||""),G(x,!0,a).done(function(a){"object"==typeof a&&a.success&&($("#wpdcom .wpd-comment").remove(),$("#wpdcom .wpd-thread-list").prepend(a.data.message),C(a,!1),z=1),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}}),window.onhashchange=function(){D(!1)},1!=f&&D(!1),$("body").on("click",".wpdiscuz-readmore",function(){var b=aj($(this)),c=ak(b),a=new FormData;a.append("action","wpdReadMore"),a.append("commentId",c),G(x,!0,a).done(function(a){"object"==typeof a?(a.success?($("#comment-"+c+" .wpd-comment-text").replaceWith(" "+a.data.message),$("#wpdiscuz-readmore-"+b).remove()):console.log(a.data),aE(a)):console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("change",".wpd-required-group",function(){0!==$("input:checked",this).length?$("input",$(this)).prop("required",!1):$("input",$(this)).prop("required",!0)}),$("body").on("click",".wpdiscuz-spoiler",function(){$(this).next().slideToggle(),$(this).hasClass("wpdiscuz-spoiler-closed")?$(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-plus").removeClass("fa-plus").addClass("fa-minus"):$(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-minus").removeClass("fa-minus").addClass("fa-plus"),$(this).toggleClass("wpdiscuz-spoiler-closed")}),$("body").on("click",".wpd-tools i",function(){var a=$(this).siblings(".wpd-tools-actions");a.is(":visible")||$(this).parents(".wpd-comment-right").attr("id")!==$("[id^=comment-]","#wpdcom").last().attr("id")||$("#comments").css({paddingBottom:"160px"}),a.css({display:a.is(":visible")?"none":"flex"})}),$("body").on("mouseleave",".wpd-comment-right",function(){$(this).find(".wpd-tools-actions").hide(),$("#comments").css({paddingBottom:"0"})}),$("body").on("click",".wpd_stick_btn",function(){var b=aj($(this),0),c=ak(b),a=new FormData;a.append("action","wpdStickComment"),a.append("commentId",c),G(x,!0,a).done(function(a){"object"==typeof a&&a.success&&location.reload(!0),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("click",".wpd_close_btn",function(){var b=aj($(this),0),c=ak(b),a=new FormData;a.append("action","wpdCloseThread"),a.append("commentId",c),G(x,!0,a).done(function(a){"object"==typeof a&&a.success&&location.reload(!0),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("click",".wpd-filter.wpd_not_clicked[data-filter-type]",function(){var b=$(this),c=b.attr("data-filter-type");wpdiscuzAjaxObj.resetActiveFilters(".wpdf-"+c),b.removeClass("wpd_not_clicked"),$(".fas",b).addClass("fa-pulse fa-spinner");var a=new FormData;a.append("action","wpdLoadMoreComments");var d=$(".wpdiscuz-sort-button-active").attr("data-sorting");d&&a.append("sorting",d),a.append("lastParentId",0),a.append("offset",0),z=1,a.append("wpdType",b.hasClass("wpdf-active")?"":c),a.append("isFirstLoad",1),$(this).hasClass("wpdf-inline")?$(this).hasClass("wpdf-active")?$(".wpd-comment-info-bar").hide():$(".wpd-comment-info-bar").css("display","flex"):$(".wpd-comment-info-bar").hide(),G(x,!1,a).done(function(a){b.addClass("wpd_not_clicked"),$(".fas",b).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(b.toggleClass("wpdf-active"),$(".wpd-load-comments").remove(),$(".wpd-comment").remove(),$(".wpd-thread-list").prepend(a.data.comment_list),C(a),w=a.data.loadLastCommentId,$(".wpd-load-more-submit").blur(),aE(a)),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("click",".wpdf-reacted.wpd_not_clicked",function(){var a=$(this);a.removeClass("wpd_not_clicked"),$(".fas",a).addClass("fa-pulse fa-spinner");var b=new FormData;b.append("action","wpdMostReactedComment"),G(x,!1,b).done(function(b){a.addClass("wpd_not_clicked"),$(".fas",a).removeClass("fa-pulse fa-spinner"),"object"==typeof b&&b.success&&($("#comment-"+b.data.parentCommentID).length?$("#comment-"+b.data.parentCommentID).parents("[id^=wpd-comm-"+b.data.parentCommentID+"]").replaceWith(b.data.message):$("#comment-"+b.data.commentId).length||$(".wpd-thread-list").prepend(b.data.message),aE(b),au(),$("html, body").animate({scrollTop:$("#comment-"+b.data.commentId).offset().top-m},1e3,av))}).fail(function(c,d,b){console.log(b),$(".fas",a).removeClass("fa-pulse fa-spinner")})}),$("body").on("click",".wpdf-hottest.wpd_not_clicked",function(){var a=$(this);a.removeClass("wpd_not_clicked"),$(".fas",a).addClass("fa-pulse fa-spinner");var b=new FormData;b.append("action","wpdHottestThread"),G(x,!1,b).done(function(b){a.addClass("wpd_not_clicked"),$(".fas",a).removeClass("fa-pulse fa-spinner"),"object"==typeof b&&b.success&&($("#comment-"+b.data.commentId).length?$("#comment-"+b.data.commentId).parents("[id^=wpd-comm-"+b.data.commentId+"]").replaceWith(b.data.message):$(".wpd-thread-list").prepend(b.data.message),aE(b),au(),$("html, body").animate({scrollTop:$("#comment-"+b.data.commentId).offset().top-m},1e3,av))}).fail(function(c,d,b){console.log(b),$(".fas",a).removeClass("fa-pulse fa-spinner")})}),$("body").on("click",".wpd-filter-view-all",function(){$(".wpdf-inline.wpdf-active.wpd_not_clicked").trigger("click")}),$("body").on("click",".wpd-follow-link.wpd_not_clicked",function(){var a=$(this);a.removeClass("wpd_not_clicked"),$(".fas",a).addClass("fa-pulse fa-spinner");var c=aj(a,0),d=ak(c),b=new FormData;b.append("action","wpdFollowUser"),b.append("commentId",d),G(x,!0,b).done(function(b){a.addClass("wpd_not_clicked"),"object"==typeof b?b.success?(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[b.data.code],b.data.code,a),"success"),a.removeClass("wpd-follow-active"),b.data.followTip&&a.attr("wpd-tooltip",b.data.followTip),b.data.followClass&&a.addClass(b.data.followClass),aE(b)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[b.data],b.data,a),"error"):console.log(b),$(".fas",a).removeClass("fa-pulse fa-spinner"),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(c,d,b){console.log(b),$(".fas",a).removeClass("fa-pulse fa-spinner"),$("#wpdiscuz-loading-bar").fadeOut(250)})}),E(),$("body").on("keyup",".wc_email",function(){E($(this))}),j&&$("#wpdcom").length){if($("#wpd-bubble-wrapper").hover(function(){$(this).addClass("wpd-bubble-hover")},function(){$(this).removeClass("wpd-bubble-hover")}),k&&!Cookies.get(wpdiscuzAjaxObj.cookieHideBubbleHint)&&setTimeout(function(){$("#wpd-bubble-wrapper").addClass("wpd-bubble-hover"),Cookies.set(wpdiscuzAjaxObj.cookieHideBubbleHint,"1",{expires:7,path:"/"}),setTimeout(function(){$("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")},1e3*Q)},1e3*k),"content_left"===h){if($(".entry-content").length){var b=Math.min($(".entry-content").offset().left,$("#wpdcom").offset().left)-120,d=b>25?b:25;$("#wpd-bubble-wrapper").css({left:d+"px"}),$("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if($(".post-entry").length){var b=Math.min($(".post-entry").offset().left,$("#wpdcom").offset().left)-120,d=b>25?b:25;$("#wpd-bubble-wrapper").css({left:d+"px"}),$("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if($(".container").length){var b=Math.min($(".container").offset().left,$("#wpdcom").offset().left)-120,d=b>25?b:25;$("#wpd-bubble-wrapper").css({left:d+"px"}),$("#wpd-bubble-wrapper").addClass("wpd-left-content")}else $("#wpd-bubble-wrapper").css({left:"25px"}),$("#wpd-bubble-wrapper").addClass("wpd-left-corner")}else"left_corner"===h?($("#wpd-bubble-wrapper").css({left:"25px"}),$("#wpd-bubble-wrapper").addClass("wpd-left-corner")):"right_corner"===h&&($("#wpd-bubble-wrapper").css({right:"25px"}),$("#wpd-bubble-wrapper").addClass("wpd-right-corner"));$("#wpd-bubble-wrapper").show(),$("body").on("click","#wpd-bubble-add-message-close",function(a){a.preventDefault(),a.stopPropagation(),$("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")}),$("body").on("click","#wpd-bubble",function(){au(),$("#tab-title-reviews").length&&$("#tab-title-reviews a").trigger("click"),$("html, body").animate({scrollTop:$("#wpdcom").offset().top-(m+28)},1e3,function(){av(),$("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover"),wpdiscuzLoadRichEditor?$("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0").focus():$("#wc-textarea-0_0").length&&$("#wc-textarea-0_0").trigger("focus")})}),$("body").on("click","#wpd-bubble-comment-close",function(a){a.preventDefault(),$("#wpd-bubble-notification-message").hide(),$("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")}),$("body").on("click","#wpd-bubble-comment-reply-link a",function(){var a=$(this).attr("href");setTimeout(function(){$("#wpd-bubble-notification-message").hide(),$("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),D(!0);var b=a.match(/#comment\-(\d+)/);U=U.filter(function(a){return a!=b[1]}),$("#wpd-bubble-count .wpd-new-comments-count").text(U.length),0==U.length&&$("#wpd-bubble-count").removeClass("wpd-new-comments")},100)}),$("body").on("click","#wpd-bubble-count",function(){if(U.length){var a=new FormData;a.append("action","wpdBubbleUpdate"),a.append("newCommentIds",U.join()),G(x,!0,a).done(function(a){"object"==typeof a&&a.success&&(a.data.message=a.data.message.filter(function(a){if(!$("#comment-"+a.comment_id).length)return a}),ag(a),$("#wpd-bubble-count").removeClass("wpd-new-comments"),$("#wpd-bubble-count .wpd-new-comments-count").text("0"),U=[],$(".wpd-new-loaded-comment").length&&(au(),$("html, body").animate({scrollTop:$($(".wpd-new-loaded-comment")[0]).offset().top-(m+28)},1e3,av)),aE(a)),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a)})}})}function F(){$.ajax({type:"GET",url:wpdiscuzAjaxObj.bubbleUpdateUrl,beforeSend:function(a){a.setRequestHeader("X-WP-Nonce",wpdiscuzAjaxObj.restNonce)},data:{postId:I,lastId:J,visibleCommentIds:aq()}}).done(function(a){if(!V){if("object"==typeof a){if(a.commentIDsToRemove.forEach(function(a){$("[id^=wpd-comm-"+a+"]").remove()}),a.ids.length){if(t){var b;(b=new FormData).append("action","wpdUpdateAutomatically"),b.append("loadLastCommentId",w),b.append("visibleCommentIds",aq()),G(x,!1,b).done(function(a){!V&&"object"==typeof a&&a.success&&(ag(a),a.data.wc_all_comments_count_new=parseInt(a.data.wc_all_comments_count_new),$(".wpd-thread-info").html(a.data.wc_all_comments_count_before_threads_html),$(".wpd-thread-info").attr("data-comments-count",a.data.wc_all_comments_count_new),$("#wpd-bubble-all-comments-count").replaceWith(a.data.wc_all_comments_count_bubble_html),w=a.data.loadLastCommentId)}).fail(function(b,c,a){console.log(a)})}a.ids=a.ids.filter(function(a){if(!$("#comment-"+a).length)return a});var c=5e3;J=parseInt(a.ids[a.ids.length-1]),U=U.concat(a.ids),R&&a.commentText&&($("#wpd-bubble-author-avatar").html(a.avatar),$("#wpd-bubble-author-name").html(a.authorName),$("#wpd-bubble-comment-date span").html(a.commentDate),$("#wpd-bubble-comment-text").html(a.commentText),$("#wpd-bubble-comment-reply-link a").attr("href",a.commentLink),$("#wpd-bubble-notification-message").show(),c=1e4);var d=parseInt($(".wpd-new-comments-count").text());d+=a.ids.length,$("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),$("#wpd-bubble-wrapper").addClass("wpd-new-comment-added"),setTimeout(function(){$("#wpd-bubble-notification-message").hide(),$("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")},c),$(".wpd-new-comments-count").text(d),$("#wpd-bubble-count").addClass("wpd-new-comments")}a.all_comments_count=parseInt(a.all_comments_count),$("#wpd-bubble-all-comments-count").replaceWith(a.all_comments_count_bubble_html),$(".wpd-reviews-tab").length||($(".wpd-thread-info").html(a.all_comments_count_before_threads_html),$(".wpd-thread-info").attr("data-comments-count",a.all_comments_count))}else console.log(a)}setTimeout(F,u)}).fail(function(b,c,a){console.log(a),setTimeout(F,u)})}if((j&&y||t)&&(c|| !c&&v)&&setTimeout(F,u),$(".wpd-inline-form-wrapper").length){var n=new FormData;n.append("action","wpdGetInlineCommentForm"),G(x,!1,n).done(function(a){"object"==typeof a?a.success?($(".wpd-inline-form-wrapper").append(a.data),$.each($("[name=_wpd_inline_nonce]"),function(){var b=$(this).attr("id"),a=$(this).parents(".wpd-inline-shortcode").attr("id");$(this).attr("id",b+"-"+a.substring(a.lastIndexOf("-")+1))}),$(".wpd-inline-opened").addClass("wpd-active"),$(".wpd-inline-opened").find(".wpd-inline-form-wrapper").show(),$(".wpd-inline-opened").find(".wpd-inline-icon").addClass("wpd-open"),$(".wpd-inline-opened").find(".wpd-inline-icon").removeClass("wpd-ignored"),aC()):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data]),a.data,"error"):console.log(a)}).fail(function(b,c,a){console.log(a)})}function aA(a){if($(a).hasClass("wpd-inline-shortcode"))var b=$(a).attr("id");else var b=$(a).parents(".wpd-inline-shortcode").attr("id");return b.substring(b.lastIndexOf("-")+1)}function aB(){$(".wpd-inline-form-wrapper").hide(),$(".wpd-inline-shortcode").removeClass("wpd-active"),$(".wpd-inline-icon").removeClass("wpd-open")}function o(){$.each($(".wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon"),function(){var a=$(this),b=a.offset().top-window.pageYOffset;a.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&b>0&&b<300&&("blink"===l?(a.addClass("wpd-blink"),setTimeout(function(){a.removeClass("wpd-blink")},3e3)):(a.parents(".wpd-inline-shortcode").addClass("wpd-active"),a.siblings(".wpd-inline-form-wrapper").show(),a.addClass("wpd-open"),aC(a.siblings(".wpd-inline-form-wrapper"))))})}function aC(a){if(a){if(a.offset().left<=10){a.css("left",Math.ceil(parseInt(a.css("left"))-a.offset().left+10));var b=Math.ceil(a.siblings(".wpd-inline-icon.wpd-open").offset().left-a.offset().left+2);b<3&&(b=3),document.styleSheets[0].addRule("#"+a.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+b+"px;")}else if(a.offset().left+a.width()>document.body.clientWidth-10){a.css("left",Math.ceil(parseInt(a.css("left"))+(document.body.clientWidth-(a.offset().left+a.width()))-10));var b=Math.ceil(a.siblings(".wpd-inline-icon.wpd-open").offset().left-a.offset().left+2);b>a.width()-3&&(b=a.width()-3),document.styleSheets[0].addRule("#"+a.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+b+"px;")}}else $.each($(".wpd-inline-form-wrapper:visible"),function(){if($(this).offset().left<=10){$(this).css("left",Math.ceil(parseInt($(this).css("left"))-$(this).offset().left+10));var a=Math.ceil($(this).siblings(".wpd-inline-icon.wpd-open").offset().left-$(this).offset().left+2);a<3&&(a=3),document.styleSheets[0].addRule("#"+$(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"px;")}else if($(this).offset().left+$(this).width()>document.body.clientWidth-10){$(this).css("left",Math.ceil(parseInt($(this).css("left"))+(document.body.clientWidth-($(this).offset().left+$(this).width()))-10));var a=Math.ceil($(this).siblings(".wpd-inline-icon.wpd-open").offset().left-$(this).offset().left+2);a>$(this).width()-3&&(a=$(this).width()-3),document.styleSheets[0].addRule("#"+$(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"px;")}})}function aD(a){var b,c=0;if(a.parents(".wpd_main_comm_form").length)c=parseInt(wpdiscuzAjaxObj.commentTextMaxLength),b=a.parents(".wpd_main_comm_form");else if(a.parents(".wpd-secondary-form-wrapper").length)c=parseInt(wpdiscuzAjaxObj.replyTextMaxLength),b=a.parents(".wpd-secondary-form-wrapper");else if(a.parents("#wpdiscuz-edit-form").length){var e=aj(a);c=parseInt(e.substring(e.lastIndexOf("_")+1))?parseInt(wpdiscuzAjaxObj.replyTextMaxLength):parseInt(wpdiscuzAjaxObj.commentTextMaxLength),b=a.parents("#wpdiscuz-edit-form")}if(c&&b){var g=a.val().length,d=$(".wpd-editor-char-counter",b),f=c-g;d.html(f),f<=10?d.addClass("error"):d.removeClass("error")}}function aE(a,b,c,d){a.data.callbackFunctions&&$.each(a.data.callbackFunctions,function(e){"function"==typeof wpdiscuzAjaxObj[a.data.callbackFunctions[e]]?wpdiscuzAjaxObj[a.data.callbackFunctions[e]](a,b,c,d):"function"==typeof window[a.data.callbackFunctions[e]]?window[a.data.callbackFunctions[e]](a,b,c,d):console.log(a.data.callbackFunctions[e]+" is not a function")})}function G(c,d,a){d&&$("#wpdiscuz-loading-bar").show(),a.append("postId",I),a.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce);var b=a.get("action");wpdiscuzAjaxObj.dataFilterCallbacks&&wpdiscuzAjaxObj.dataFilterCallbacks[b]&&$.each(wpdiscuzAjaxObj.dataFilterCallbacks[b],function(e){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[b][e]]&&(a=wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[b][e]](a,c,d))});var e=c?wpdiscuzAjaxObj.url:wpdiscuzAjaxObj.customAjaxUrl;return $.ajax({type:"POST",url:e,data:a,contentType:!1,processData:!1})}function p(){if(c||wpdiscuzAjaxObj.validateNonceForGuests){var a=new FormData;a.append("action","wpdGetNonce"),G(x,!1,a).done(function(a){"object"==typeof a?a.success?wpdiscuzAjaxObj.wpdiscuz_nonce=a.data:wpdiscuzAjaxObj.setCommentMessage(a.data,"error"):console.log(a)}).fail(function(b,c,a){console.log(a)})}}$(document).on("click","body",function(a){if($(a.target).hasClass("wpd-inline-form-close")||$(a.target).parents(".wpd-inline-form-close").length)a.preventDefault(),$(a.target).parents(".wpd-inline-form-wrapper").hide(),$(a.target).parents(".wpd-inline-shortcode").removeClass("wpd-active"),$(a.target).parents(".wpd-inline-form-wrapper").siblings(".wpd-inline-icon").removeClass("wpd-open");else if(!$(a.target).hasClass("wpd-inline-form-wrapper")&&!$(a.target).parents(".wpd-inline-form-wrapper").length){aB();var b="";$(a.target).hasClass("wpd-inline-icon")?b=$(a.target):$(a.target).parents(".wpd-inline-icon").length&&(b=$(a.target).parents(".wpd-inline-icon")),b.length&&b.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&(b.parents(".wpd-inline-shortcode").addClass("wpd-active"),b.siblings(".wpd-inline-form-wrapper").show(),b.addClass("wpd-open"),b.removeClass("wpd-ignored"),aC(b.siblings(".wpd-inline-form-wrapper")))}(!$(a.target).hasClass("wpd-last-inline-comments-wrapper")&&!$(a.target).parents(".wpd-last-inline-comments-wrapper").length||$(a.target).parents(".wpd-last-inline-comments-wrapper").length&&$(a.target).hasClass("wpd-load-inline-comment"))&&$(".wpd-last-inline-comments-wrapper").remove()}),$("body").on("click",".wpd-inline-submit.wpd_not_clicked",function(c){c.preventDefault();var d=$(this),a=$(this).parents(".wpd_inline_comm_form");if(a[0].checkValidity()){$(this).removeClass("wpd_not_clicked");var b=new FormData;b.append("action","wpdAddInlineComment"),b.append("inline_form_id",aA(a)),$.each($("input, textarea",a),function(c,a){"checkbox"===this.type?$(this).is(":checked")&&b.append($(a).attr("name"),$(a).val()):b.append($(a).attr("name"),$(a).val())}),G(x,!0,b).done(function(b){if(d.addClass("wpd_not_clicked"),"object"==typeof b){if(b.success){a[0].reset(),aB();var e=parseInt(b.data.newCount),c=d.parents(".wpd-inline-icon-wrapper").find(".wpd-inline-icon-count");c.text(e),e?c.addClass("wpd-has-comments"):c.removeClass("wpd-has-comments"),b.data.allCommentsCountNew=parseInt(b.data.allCommentsCountNew),$(".wpd-thread-info").html(b.data.allCommentsCountBeforeThreadsHtml),$(".wpd-thread-info").attr("data-comments-count",b.data.allCommentsCountNew),$("#wpd-bubble-all-comments-count").replaceWith(b.data.allCommentsCountBubbleHtml),b.data.message&&az(b.data.message),wpdiscuzAjaxObj.setCommentMessage(b.data.notification,"success")}else b.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[b.data],b.data,d),"error")}else wpdiscuzAjaxObj.setCommentMessage(b,"error");$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}}),$("body").on("keydown",".wpd-form",function(a){a.ctrlKey&&13==a.keyCode&&$(this).find(".wc_comm_submit").trigger("click")}),$("body").on("keydown","#wpdiscuz-edit-form",function(a){a.ctrlKey&&13==a.keyCode&&$(this).find(".wc_save_edited_comment").trigger("click")}),$("body").on("keydown",".wpd-inline-comment-content",function(a){a.ctrlKey&&13==a.keyCode&&$(this).parents(".wpd_inline_comm_form").find(".wpd-inline-submit.wpd_not_clicked").trigger("click")}),$("body").on("click",".wpd-inline-icon-count.wpd-has-comments",function(){var b=$(this),a=new FormData;a.append("action","wpdGetLastInlineComments"),a.append("inline_form_id",aA(b)),G(x,!0,a).done(function(a){"object"==typeof a?a.success?$(a.data).insertAfter(b):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,b),"error"):console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("click",".wpd-view-all-inline-comments",function(a){a.preventDefault(),$(this).parents(".wpd-last-inline-comments-wrapper").remove(),$(".wpdf-inline").hasClass("wpdf-active")||$(".wpdf-inline").trigger("click"),au(),$("html, body").animate({scrollTop:$(".wpdf-inline").offset().top-m},1e3,av)}),$("body").on("click",".wpd-feedback-content-link",function(a){a.preventDefault();var b=$(this).data("feedback-content-id");au(),$("html, body").animate({scrollTop:$("#wpd-inline-"+b).offset().top-(m+6)},1e3,function(){av(),$("#wpd-inline-"+b).addClass("wpd-active")})}),("scroll_open"===l||"blink"===l)&&(o(),$(window).on("scroll",o)),$("body").on("click","#wpd-post-rating.wpd-not-rated .wpd-rate-starts svg",function(){var a=new FormData,b=$(this).index();b>=0&&b<5&&(a.append("action","wpdUserRate"),a.append("rating",b+1),G(x,!0,a).done(function(a){"object"==typeof a?(a.success?location.reload(!0):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data),"error"),aE(a)):console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)}))}),$("body").on("submit","#wpdiscuz-subscribe-form",function(d){d.preventDefault();var a=$(this);let b=$("#wpdiscuz_subscription_button",a);if(a[0].checkValidity()&&(f=a,g=!0,"2.0"===e&&$("input[name=wpdiscuz_recaptcha_subscribe_form]",f).length&&!$("input[name=wpdiscuz_recaptcha_subscribe_form]",f).val().length?(g=!1,$(".wpdiscuz-recaptcha",f).css("border","1px solid red")):"2.0"===e&&$("input[name=wpdiscuz_recaptcha_subscribe_form]",f).length&&$(".wpdiscuz-recaptcha",f).css("border","none"),g)&&b.hasClass("wpd_not_clicked")){b.removeClass("wpd_not_clicked");var f,g,c=new FormData;c.append("action","wpdAddSubscription"),$("*",a).each(function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&c.append(this.name+"",$(this).val()),("checkbox"==this.type||"radio"==this.type)&&$(this).is(":checked")&&c.append(this.name+"",$(this).val())}),G(x,!0,c).done(function(a){"object"==typeof a?a.success?(wpdiscuzAjaxObj.setCommentMessage(a.data,"success"),setTimeout(function(){location.reload(!0)},3e3)):wpdiscuzAjaxObj.setCommentMessage(a.data,"error"):wpdiscuzAjaxObj.setCommentMessage(a,"error"),$("#wpdiscuz-loading-bar").fadeOut(250),V=!1,b.addClass("wpd_not_clicked")}).fail(function(c,d,a){console.log(a),b.addClass("wpd_not_clicked"),$("#wpdiscuz-loading-bar").fadeOut(250)})}}),$("body").on("click",".wpd-unsubscribe",function(b){b.preventDefault();var a=new FormData;a.append("action","wpdUnsubscribe"),a.append("sid",$(this).data("sid")),a.append("skey",$(this).data("skey")),G(x,!0,a).done(function(a){"object"==typeof a?a.success?(wpdiscuzAjaxObj.setCommentMessage(a.data,"success"),setTimeout(function(){location.reload(!0)},3e3)):wpdiscuzAjaxObj.setCommentMessage(a.data,"error"):console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250),V=!1}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),wpdiscuzAjaxObj.resetActiveFilters=function(a){$(".wpd-filter.wpdf-active"+(a?":not("+a+")":"")).removeClass("wpdf-active")},wpdiscuzAjaxObj.getAjaxObj=G,wpdiscuzAjaxObj.initNonce=p,p()});var onloadCallback=function(){if(document.getElementById("wpdiscuz-recaptcha-0_0")&&"2.0"===wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion&&(1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!wpdiscuzAjaxObj.is_user_logged_in||1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&wpdiscuzAjaxObj.is_user_logged_in))try{grecaptcha.render("wpdiscuz-recaptcha-0_0",{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(a){jQuery("#wpdiscuz-recaptcha-field-0_0").val("key")},"expired-callback":function(){jQuery("#wpdiscuz-recaptcha-field-0_0").val("")}})}catch(a){console.log(a),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+a.message,"error")}}
class.WpdiscuzCore.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  * Plugin Name: wpDiscuz
4
  * Description: #1 WordPress Comment Plugin. Innovative, modern and feature-rich comment system to supercharge your website comment section.
5
- * Version: 7.3.20
6
  * Author: gVectors Team
7
  * Author URI: https://gvectors.com/
8
  * Plugin URI: https://wpdiscuz.com/
@@ -39,6 +39,7 @@ class WpdiscuzCore implements WpDiscuzConstants {
39
  public $helperOptimization;
40
  public $helperUpload;
41
  public $wpdiscuzOptionsJs;
 
42
  /**
43
  * @var WpdiscuzOptions
44
  */
@@ -323,7 +324,7 @@ class WpdiscuzCore implements WpDiscuzConstants {
323
  // $comment_content is filtered in function "$this->helper->filterCommentText" by WP's native function wp_kses
324
  $comment_content = isset($_POST["wc_comment"]) ? $_POST["wc_comment"] : "";
325
 
326
- if ($uniqueId && $postId && $comment_content) {
327
  $this->isWpdiscuzLoaded = true;
328
  $this->form = $this->wpdiscuzForm->getForm($postId);
329
  $this->form->initFormFields();
@@ -369,10 +370,6 @@ class WpdiscuzCore implements WpDiscuzConstants {
369
  $comment_content = ($this->options->form["richEditor"] === "both" || (!wp_is_mobile() && $this->options->form["richEditor"] === "desktop")) && !$this->options->showEditorToolbar() ? html_entity_decode($comment_content) : $comment_content;
370
  $comment_content = $this->helper->replaceCommentContentCode($comment_content);
371
  $comment_content = $this->helper->filterCommentText($comment_content);
372
- if (!$comment_content) {
373
- wp_send_json_error("wc_msg_required_fields");
374
- }
375
-
376
  $uid_data = $this->helper->getUIDData($uniqueId);
377
  $comment_parent = intval($uid_data[0]);
378
  $parentComment = $comment_parent ? get_comment($comment_parent) : null;
@@ -397,7 +394,7 @@ class WpdiscuzCore implements WpDiscuzConstants {
397
  wp_send_json_error("wc_msg_input_max_length");
398
  }
399
 
400
- if ($name && $email && $comment_content) {
401
  $website_url = $website_url ? urldecode($website_url) : "";
402
  $stickyComment = WpdiscuzHelper::sanitize(INPUT_POST, "wc_sticky_comment", FILTER_SANITIZE_NUMBER_INT, "");
403
  $closedComment = absint(WpdiscuzHelper::sanitize(INPUT_POST, "wc_closed_comment", FILTER_SANITIZE_NUMBER_INT, 0));
@@ -416,6 +413,10 @@ class WpdiscuzCore implements WpDiscuzConstants {
416
  "comment_type" => $wooExists ? "review" : ($stickyComment ? self::WPDISCUZ_STICKY_COMMENT : self::$DEFAULT_COMMENT_TYPE),
417
  ];
418
 
 
 
 
 
419
  $new_comment_id = wp_new_comment(wp_slash($new_commentdata));
420
  if ($closedComment) {
421
  add_comment_meta($new_comment_id, self::META_KEY_CLOSED, "1");
@@ -494,9 +495,6 @@ class WpdiscuzCore implements WpDiscuzConstants {
494
  $this->helper->validateNonce();
495
  $commentId = WpdiscuzHelper::sanitize(INPUT_POST, "commentId", FILTER_SANITIZE_NUMBER_INT, 0);
496
  $trimmedContent = isset($_POST["wc_comment"]) ? trim($_POST["wc_comment"]) : "";
497
- if (!$trimmedContent || !strip_tags($trimmedContent)) {
498
- wp_send_json_error("wc_msg_required_fields");
499
- }
500
  $trimmedContent = ($this->options->form["richEditor"] === "both" || (!wp_is_mobile() && $this->options->form["richEditor"] === "desktop")) && !$this->options->showEditorToolbar() ? html_entity_decode($trimmedContent) : $trimmedContent;
501
  if ($commentId) {
502
  $this->isWpdiscuzLoaded = true;
@@ -508,7 +506,7 @@ class WpdiscuzCore implements WpDiscuzConstants {
508
  $this->form = $this->wpdiscuzForm->getForm($comment->comment_post_ID);
509
  $this->form->initFormFields();
510
  $this->form->validateFields($currentUser);
511
- if (!intval(get_comment_meta($comment->comment_ID, self::META_KEY_CLOSED, true)) && ($highLevelUser || $isCurrentUserCanEdit) && $this->form->isUserCanSeeComments($currentUser, $comment->comment_post_ID) && $this->form->isUserCanComment($currentUser, $comment->comment_post_ID)) {
512
  $isInRange = $this->helper->isContentInRange($trimmedContent, $comment->comment_parent);
513
 
514
  if (!$isInRange && !$highLevelUser) {
@@ -532,6 +530,7 @@ class WpdiscuzCore implements WpDiscuzConstants {
532
  if ($isInRange || $highLevelUser) {
533
  $response = [];
534
  if ($trimmedContent !== $comment->comment_content) {
 
535
  $trimmedContent = $this->helper->replaceCommentContentCode($trimmedContent);
536
  $commentContent = $this->helper->filterCommentText($trimmedContent);
537
  $userAgent = isset($_SERVER["HTTP_USER_AGENT"]) ? $_SERVER["HTTP_USER_AGENT"] : "";
@@ -541,6 +540,35 @@ class WpdiscuzCore implements WpDiscuzConstants {
541
  "comment_agent" => $userAgent,
542
  "comment_approved" => $comment->comment_approved
543
  ];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
544
  wp_update_comment(wp_slash($commentarr));
545
  $lastEditedAt = current_time("mysql", 1);
546
  update_comment_meta($commentId, self::META_KEY_LAST_EDITED_AT, $lastEditedAt);
@@ -587,10 +615,14 @@ class WpdiscuzCore implements WpDiscuzConstants {
587
  $feedbackForm = $this->dbManager->getFeedbackForm($inlineFormID);
588
  $inlineContent = "<div class='wpd-inline-feedback-wrapper'><span class='wpd-inline-feedback-info'>" . esc_html($this->options->getPhrase("wc_feedback_content_text")) . "</span> <i class='fas fa-quote-left'></i>" . wp_trim_words($feedbackForm->content, apply_filters("wpdiscuz_feedback_content_words_count", 20)) . "&quot; <a class='wpd-feedback-content-link' data-feedback-content-id='{$feedbackForm->id}' href='#wpd-inline-{$feedbackForm->id}'>" . esc_html($this->options->getPhrase("wc_read_more")) . "</a></div>";
589
  }
 
 
 
590
  $response["message"] = str_replace(["{TEXT_WRAPPER_CLASSES}", "{TEXT}"], [
591
  "wpd-comment-text",
592
  $inlineContent . $commentContent
593
  ], $components["text.html"]);
 
594
  $response["callbackFunctions"] = [];
595
  $response = apply_filters("wpdiscuz_comment_edit_save", $response);
596
  wp_send_json_success($response);
@@ -1999,7 +2031,7 @@ class WpdiscuzCore implements WpDiscuzConstants {
1999
  echo "</div>";
2000
  echo "<div id='wpd-bubble-comment'>";
2001
  echo "<span id='wpd-bubble-comment-text'></span>";
2002
- echo "<span id='wpd-bubble-comment-reply-link'>| <a href='#'>".$this->options->getPhrase("wc_reply_text")."</a></span>";
2003
  echo "</div>";
2004
  echo "</div>";
2005
  }
@@ -2258,9 +2290,7 @@ class WpdiscuzCore implements WpDiscuzConstants {
2258
  // $comment_content is filtered in function "$this->helper->filterCommentText" by WP's native function wp_kses
2259
  $comment_content = !empty($_POST["wpd_inline_comment"]) ? stripslashes(trim($_POST["wpd_inline_comment"])) : "";
2260
  $comment_content = $this->helper->filterCommentText($comment_content);
2261
- if (!$comment_content) {
2262
- wp_send_json_error("wc_msg_required_fields");
2263
- }
2264
  $commentMinLength = intval($this->options->content["commentTextMinLength"]);
2265
  $commentMaxLength = intval($this->options->content["commentTextMaxLength"]);
2266
  $contentLength = function_exists("mb_strlen") ? mb_strlen($comment_content) : strlen($comment_content);
@@ -2271,7 +2301,7 @@ class WpdiscuzCore implements WpDiscuzConstants {
2271
  wp_send_json_error("wc_msg_input_max_length");
2272
  }
2273
 
2274
- if ($name && $email && $comment_content) {
2275
  $wc_user_agent = !empty($_SERVER["HTTP_USER_AGENT"]) ? $_SERVER["HTTP_USER_AGENT"] : "";
2276
  $new_commentdata = [
2277
  "user_id" => $user_id,
@@ -2284,6 +2314,12 @@ class WpdiscuzCore implements WpDiscuzConstants {
2284
  "comment_agent" => $wc_user_agent,
2285
  "comment_type" => self::$DEFAULT_COMMENT_TYPE,
2286
  ];
 
 
 
 
 
 
2287
  $this->helper->restrictCommentingPerUser($email, 0, $inline_form->post_id);
2288
  $new_comment_id = wp_new_comment(wp_slash($new_commentdata));
2289
  add_comment_meta($new_comment_id, self::META_KEY_FEEDBACK_FORM_ID, $inline_form->id);
@@ -2472,8 +2508,6 @@ class WpdiscuzCore implements WpDiscuzConstants {
2472
  return $this->options;
2473
  }
2474
 
2475
-
2476
-
2477
  }
2478
 
2479
  $wpdiscuz = wpDiscuz();
2
  /*
3
  * Plugin Name: wpDiscuz
4
  * Description: #1 WordPress Comment Plugin. Innovative, modern and feature-rich comment system to supercharge your website comment section.
5
+ * Version: 7.4
6
  * Author: gVectors Team
7
  * Author URI: https://gvectors.com/
8
  * Plugin URI: https://wpdiscuz.com/
39
  public $helperOptimization;
40
  public $helperUpload;
41
  public $wpdiscuzOptionsJs;
42
+
43
  /**
44
  * @var WpdiscuzOptions
45
  */
324
  // $comment_content is filtered in function "$this->helper->filterCommentText" by WP's native function wp_kses
325
  $comment_content = isset($_POST["wc_comment"]) ? $_POST["wc_comment"] : "";
326
 
327
+ if ($uniqueId && $postId) {
328
  $this->isWpdiscuzLoaded = true;
329
  $this->form = $this->wpdiscuzForm->getForm($postId);
330
  $this->form->initFormFields();
370
  $comment_content = ($this->options->form["richEditor"] === "both" || (!wp_is_mobile() && $this->options->form["richEditor"] === "desktop")) && !$this->options->showEditorToolbar() ? html_entity_decode($comment_content) : $comment_content;
371
  $comment_content = $this->helper->replaceCommentContentCode($comment_content);
372
  $comment_content = $this->helper->filterCommentText($comment_content);
 
 
 
 
373
  $uid_data = $this->helper->getUIDData($uniqueId);
374
  $comment_parent = intval($uid_data[0]);
375
  $parentComment = $comment_parent ? get_comment($comment_parent) : null;
394
  wp_send_json_error("wc_msg_input_max_length");
395
  }
396
 
397
+ if ($name && $email) {
398
  $website_url = $website_url ? urldecode($website_url) : "";
399
  $stickyComment = WpdiscuzHelper::sanitize(INPUT_POST, "wc_sticky_comment", FILTER_SANITIZE_NUMBER_INT, "");
400
  $closedComment = absint(WpdiscuzHelper::sanitize(INPUT_POST, "wc_closed_comment", FILTER_SANITIZE_NUMBER_INT, 0));
413
  "comment_type" => $wooExists ? "review" : ($stickyComment ? self::WPDISCUZ_STICKY_COMMENT : self::$DEFAULT_COMMENT_TYPE),
414
  ];
415
 
416
+ $allow_empty_comment = apply_filters("allow_empty_comment", false, $new_commentdata);
417
+ if ("" === $comment_content && !$allow_empty_comment) {
418
+ wp_send_json_error("wc_msg_required_fields");
419
+ }
420
  $new_comment_id = wp_new_comment(wp_slash($new_commentdata));
421
  if ($closedComment) {
422
  add_comment_meta($new_comment_id, self::META_KEY_CLOSED, "1");
495
  $this->helper->validateNonce();
496
  $commentId = WpdiscuzHelper::sanitize(INPUT_POST, "commentId", FILTER_SANITIZE_NUMBER_INT, 0);
497
  $trimmedContent = isset($_POST["wc_comment"]) ? trim($_POST["wc_comment"]) : "";
 
 
 
498
  $trimmedContent = ($this->options->form["richEditor"] === "both" || (!wp_is_mobile() && $this->options->form["richEditor"] === "desktop")) && !$this->options->showEditorToolbar() ? html_entity_decode($trimmedContent) : $trimmedContent;
499
  if ($commentId) {
500
  $this->isWpdiscuzLoaded = true;
506
  $this->form = $this->wpdiscuzForm->getForm($comment->comment_post_ID);
507
  $this->form->initFormFields();
508
  $this->form->validateFields($currentUser);
509
+ if (!intval(get_comment_meta($comment->comment_ID, self::META_KEY_CLOSED, true)) && ($highLevelUser || $isCurrentUserCanEdit) && $this->form->isUserCanSeeComments($currentUser, $comment->comment_post_ID) && $this->form->isUserCanComment($currentUser, $comment->comment_post_ID)) {
510
  $isInRange = $this->helper->isContentInRange($trimmedContent, $comment->comment_parent);
511
 
512
  if (!$isInRange && !$highLevelUser) {
530
  if ($isInRange || $highLevelUser) {
531
  $response = [];
532
  if ($trimmedContent !== $comment->comment_content) {
533
+
534
  $trimmedContent = $this->helper->replaceCommentContentCode($trimmedContent);
535
  $commentContent = $this->helper->filterCommentText($trimmedContent);
536
  $userAgent = isset($_SERVER["HTTP_USER_AGENT"]) ? $_SERVER["HTTP_USER_AGENT"] : "";
540
  "comment_agent" => $userAgent,
541
  "comment_approved" => $comment->comment_approved
542
  ];
543
+
544
+
545
+ if (class_exists("Akismet") && method_exists('Akismet', 'auto_check_comment')) {
546
+
547
+ $commentarr = Akismet::auto_check_comment($commentarr);
548
+ if ($commentarr["akismet_result"] === "false" && $comment->comment_approved == "spam") {
549
+ $commentarr["comment_approved"] = 0;
550
+ } else if ($commentarr["akismet_result"] === "true") {
551
+ $commentarr["comment_approved"] = "spam";
552
+ }
553
+ }
554
+
555
+ $commentdata = [
556
+ "comment_post_ID" => $comment->comment_post_ID,
557
+ "comment_author" => $comment->comment_author,
558
+ "comment_author_email" => $comment->comment_author_email,
559
+ "comment_author_url" => $comment->comment_author_url,
560
+ "comment_content" => $commentContent,
561
+ "comment_type" => $comment->comment_type,
562
+ "comment_parent" => $comment->comment_parent,
563
+ "user_id" => $comment->user_id
564
+ ];
565
+
566
+ $allow_empty_comment = apply_filters("allow_empty_comment", false, $commentdata);
567
+
568
+ if ("" === $commentContent && !$allow_empty_comment) {
569
+ wp_send_json_error("wc_msg_required_fields");
570
+ }
571
+
572
  wp_update_comment(wp_slash($commentarr));
573
  $lastEditedAt = current_time("mysql", 1);
574
  update_comment_meta($commentId, self::META_KEY_LAST_EDITED_AT, $lastEditedAt);
615
  $feedbackForm = $this->dbManager->getFeedbackForm($inlineFormID);
616
  $inlineContent = "<div class='wpd-inline-feedback-wrapper'><span class='wpd-inline-feedback-info'>" . esc_html($this->options->getPhrase("wc_feedback_content_text")) . "</span> <i class='fas fa-quote-left'></i>" . wp_trim_words($feedbackForm->content, apply_filters("wpdiscuz_feedback_content_words_count", 20)) . "&quot; <a class='wpd-feedback-content-link' data-feedback-content-id='{$feedbackForm->id}' href='#wpd-inline-{$feedbackForm->id}'>" . esc_html($this->options->getPhrase("wc_read_more")) . "</a></div>";
617
  }
618
+ if ($commentarr["comment_approved"] === "spam") {
619
+ $commentContent = "<span style='color:#fc9007;'>" . esc_html($this->options->getPhrase("wc_awaiting_for_approval", ["comment" => $comment])) . ": " . __("Spam") . "</span>";
620
+ }
621
  $response["message"] = str_replace(["{TEXT_WRAPPER_CLASSES}", "{TEXT}"], [
622
  "wpd-comment-text",
623
  $inlineContent . $commentContent
624
  ], $components["text.html"]);
625
+
626
  $response["callbackFunctions"] = [];
627
  $response = apply_filters("wpdiscuz_comment_edit_save", $response);
628
  wp_send_json_success($response);
2031
  echo "</div>";
2032
  echo "<div id='wpd-bubble-comment'>";
2033
  echo "<span id='wpd-bubble-comment-text'></span>";
2034
+ echo "<span id='wpd-bubble-comment-reply-link'>| <a href='#'>" . $this->options->getPhrase("wc_reply_text") . "</a></span>";
2035
  echo "</div>";
2036
  echo "</div>";
2037
  }
2290
  // $comment_content is filtered in function "$this->helper->filterCommentText" by WP's native function wp_kses
2291
  $comment_content = !empty($_POST["wpd_inline_comment"]) ? stripslashes(trim($_POST["wpd_inline_comment"])) : "";
2292
  $comment_content = $this->helper->filterCommentText($comment_content);
2293
+
 
 
2294
  $commentMinLength = intval($this->options->content["commentTextMinLength"]);
2295
  $commentMaxLength = intval($this->options->content["commentTextMaxLength"]);
2296
  $contentLength = function_exists("mb_strlen") ? mb_strlen($comment_content) : strlen($comment_content);
2301
  wp_send_json_error("wc_msg_input_max_length");
2302
  }
2303
 
2304
+ if ($name && $email) {
2305
  $wc_user_agent = !empty($_SERVER["HTTP_USER_AGENT"]) ? $_SERVER["HTTP_USER_AGENT"] : "";
2306
  $new_commentdata = [
2307
  "user_id" => $user_id,
2314
  "comment_agent" => $wc_user_agent,
2315
  "comment_type" => self::$DEFAULT_COMMENT_TYPE,
2316
  ];
2317
+
2318
+ $allow_empty_comment = apply_filters('allow_empty_comment', false, $new_commentdata);
2319
+ if ('' === $comment_content && !$allow_empty_comment) {
2320
+ wp_send_json_error("wc_msg_required_fields");
2321
+ }
2322
+
2323
  $this->helper->restrictCommentingPerUser($email, 0, $inline_form->post_id);
2324
  $new_comment_id = wp_new_comment(wp_slash($new_commentdata));
2325
  add_comment_meta($new_comment_id, self::META_KEY_FEEDBACK_FORM_ID, $inline_form->id);
2508
  return $this->options;
2509
  }
2510
 
 
 
2511
  }
2512
 
2513
  $wpdiscuz = wpDiscuz();
forms/wpDiscuzForm.php CHANGED
@@ -243,10 +243,10 @@ class wpDiscuzForm implements wpdFormConst {
243
  global $post;
244
  $this->getForm($post->ID);
245
  $this->form->initFormMeta();
246
- $this->form->renderFrontForm("main", "0_0", $commentsCount, $currentUser);
247
  ?>
248
  <div id="wpdiscuz_hidden_secondary_form" style="display: none;">
249
- <?php $this->form->renderFrontForm(0, "wpdiscuzuniqueid", $commentsCount, $currentUser); ?>
250
  </div>
251
  <?php
252
  }
@@ -307,7 +307,7 @@ class wpDiscuzForm implements wpdFormConst {
307
  } elseif (is_string($postType) && isset($this->formContentTypeRel[$postType])) {
308
  $tempContentTypeRel = $this->formContentTypeRel[$postType];
309
  $defaultFormID = array_shift($tempContentTypeRel);
310
- $lang = get_locale();
311
  $formID = isset($this->formContentTypeRel[$postType][$lang]) && $this->formContentTypeRel[$postType][$lang] ? $this->formContentTypeRel[$postType][$lang] : $defaultFormID;
312
  }
313
  $this->form->setFormID($formID);
@@ -377,7 +377,7 @@ class wpDiscuzForm implements wpdFormConst {
377
  "comment_status" => "closed",
378
  "ping_status" => "closed",
379
  ];
380
- $lang = get_locale();
381
  $formId = wp_insert_post($form);
382
  $defaultFields = [];
383
  $postTypes = [
243
  global $post;
244
  $this->getForm($post->ID);
245
  $this->form->initFormMeta();
246
+ $this->form->renderFrontForm("main", "0_0", $commentsCount, $currentUser, $post->ID);
247
  ?>
248
  <div id="wpdiscuz_hidden_secondary_form" style="display: none;">
249
+ <?php $this->form->renderFrontForm(0, "wpdiscuzuniqueid", $commentsCount, $currentUser, $post->ID); ?>
250
  </div>
251
  <?php
252
  }
307
  } elseif (is_string($postType) && isset($this->formContentTypeRel[$postType])) {
308
  $tempContentTypeRel = $this->formContentTypeRel[$postType];
309
  $defaultFormID = array_shift($tempContentTypeRel);
310
+ $lang = get_user_locale();
311
  $formID = isset($this->formContentTypeRel[$postType][$lang]) && $this->formContentTypeRel[$postType][$lang] ? $this->formContentTypeRel[$postType][$lang] : $defaultFormID;
312
  }
313
  $this->form->setFormID($formID);
377
  "comment_status" => "closed",
378
  "ping_status" => "closed",
379
  ];
380
+ $lang = get_user_locale();
381
  $formId = wp_insert_post($form);
382
  $defaultFields = [];
383
  $postTypes = [
forms/wpdFormAttr/Field/AgreementCheckbox.php CHANGED
@@ -50,14 +50,14 @@ class AgreementCheckbox extends Field {
50
  }
51
 
52
  public function editCommentHtml($key, $value, $data, $comment) {
53
- if (current_user_can("moderate_comments") || ($comment->comment_parent && !$data["is_show_sform"]) || !$this->displayField($key, $data)) {
54
  return "";
55
  }
56
  $showAgainClass = $data["donot_show_again_if_checked"] == 1 ? " wpd_agreement_hide " : "";
57
  $uniqueId = uniqid();
58
  $html = "<tr class='" . esc_attr($key) . "-wrapper'><td class='first'>";
59
  $html .= "</td><td>";
60
- $required = $data["required"] ? " wpd-required-group" : "";
61
  $html .= "<div class='wpdiscuz-item" . esc_attr($required) . " wpd-field-group'>";
62
  $html .= "<input checked='checked' id='" . esc_attr($key) . "-1_" . esc_attr($uniqueId) . "' type='checkbox' name='" . esc_attr($key) . "' value='1' class='" . esc_attr($key) . " wpd-field wpd-agreement-checkbox " . esc_attr($showAgainClass) . "' > <label class='wpd-field-label wpd-cursor-pointer' for='" . esc_attr($key) . "-1_" . esc_attr($uniqueId) . "'>" . $data["label"] . "</label>";
63
  $html .= "</div>";
@@ -66,8 +66,9 @@ class AgreementCheckbox extends Field {
66
  }
67
 
68
  public function frontFormHtml($name, $args, $options, $currentUser, $uniqueId, $isMainForm) {
69
- if (empty($args["label"]) || (!$isMainForm && !$args["is_show_sform"]) || (!$args["show_for_users"] && $currentUser->exists()) || (!$args["show_for_guests"] && !$currentUser->exists()) || !$this->displayField($name, $args))
70
  return;
 
71
  $showAagainClass = $args["donot_show_again_if_checked"] == 1 ? " wpd_agreement_hide " : "";
72
  $hasDesc = $args["desc"] ? true : false;
73
  $required = $args["required"] ? " wpd-required-group" : "";
@@ -93,11 +94,11 @@ class AgreementCheckbox extends Field {
93
  }
94
 
95
  public function validateFieldData($fieldName, $args, $options, $currentUser) {
96
- if (current_user_can("moderate_comments") || (!$this->isCommentParentZero() && !$args["is_show_sform"]) || !$this->displayField($fieldName, $args)) {
97
  return;
98
  }
99
  $value = filter_input(INPUT_POST, $fieldName, FILTER_VALIDATE_INT, FILTER_SANITIZE_NUMBER_INT);
100
- if (($args["show_for_users"] && $currentUser->exists() && $args["required"] && !$value ) || ($args["show_for_guests"] && !$currentUser->exists() && $args["required"] && !$value)) {
101
  wp_die(esc_html__($args["name"], "wpdiscuz") . " : " . esc_html__("field is required!", "wpdiscuz"));
102
  }
103
  }
50
  }
51
 
52
  public function editCommentHtml($key, $value, $data, $comment) {
53
+ if (current_user_can("moderate_comments") || !$this->isShowForUser($data) || ($comment->comment_parent && !$data["is_show_sform"]) || !$this->displayField($key, $data)) {
54
  return "";
55
  }
56
  $showAgainClass = $data["donot_show_again_if_checked"] == 1 ? " wpd_agreement_hide " : "";
57
  $uniqueId = uniqid();
58
  $html = "<tr class='" . esc_attr($key) . "-wrapper'><td class='first'>";
59
  $html .= "</td><td>";
60
+ $required = $this->isValidateRequired($data) ? " wpd-required-group" : "";
61
  $html .= "<div class='wpdiscuz-item" . esc_attr($required) . " wpd-field-group'>";
62
  $html .= "<input checked='checked' id='" . esc_attr($key) . "-1_" . esc_attr($uniqueId) . "' type='checkbox' name='" . esc_attr($key) . "' value='1' class='" . esc_attr($key) . " wpd-field wpd-agreement-checkbox " . esc_attr($showAgainClass) . "' > <label class='wpd-field-label wpd-cursor-pointer' for='" . esc_attr($key) . "-1_" . esc_attr($uniqueId) . "'>" . $data["label"] . "</label>";
63
  $html .= "</div>";
66
  }
67
 
68
  public function frontFormHtml($name, $args, $options, $currentUser, $uniqueId, $isMainForm) {
69
+ if (empty($args["label"]) || !$this->isShowForUser($args, $currentUser) || (!$isMainForm && !$args["is_show_sform"]) || !$this->displayField($name, $args)){
70
  return;
71
+ }
72
  $showAagainClass = $args["donot_show_again_if_checked"] == 1 ? " wpd_agreement_hide " : "";
73
  $hasDesc = $args["desc"] ? true : false;
74
  $required = $args["required"] ? " wpd-required-group" : "";
94
  }
95
 
96
  public function validateFieldData($fieldName, $args, $options, $currentUser) {
97
+ if (current_user_can("moderate_comments") || !$this->displayField($fieldName, $args)) {
98
  return;
99
  }
100
  $value = filter_input(INPUT_POST, $fieldName, FILTER_VALIDATE_INT, FILTER_SANITIZE_NUMBER_INT);
101
+ if ($this->isValidateRequired($args, $currentUser) && !$value && $args["required"]) {
102
  wp_die(esc_html__($args["name"], "wpdiscuz") . " : " . esc_html__("field is required!", "wpdiscuz"));
103
  }
104
  }
forms/wpdFormAttr/Field/CheckboxField.php CHANGED
@@ -41,6 +41,14 @@ class CheckboxField extends Field {
41
  <label for="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]"><?php esc_html_e("Display on comment", "wpdiscuz"); ?>:</label>
42
  <input type="checkbox" value="1" <?php checked($this->fieldData["is_show_on_comment"], 1, true); ?> name="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]" id="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]" />
43
  </div>
 
 
 
 
 
 
 
 
44
  <div class="wpd-advaced-options wpd-field-option">
45
  <small class="wpd-advaced-options-title"><?php esc_html_e("Advanced Options", "wpdiscuz"); ?></small>
46
  <div class="wpd-field-option wpd-advaced-options-cont">
@@ -60,7 +68,7 @@ class CheckboxField extends Field {
60
  }
61
 
62
  public function editCommentHtml($key, $value, $data, $comment) {
63
- if ($comment->comment_parent && !$data["is_show_sform"]) {
64
  return "";
65
  }
66
  $valuesMeta = maybe_unserialize($value);
@@ -68,7 +76,7 @@ class CheckboxField extends Field {
68
  $html = "<tr class='" . esc_attr($key) . "-wrapper wpd-edit-checkbox'><td class='first'>";
69
  $html .= "<label for='" . esc_attr($key) . "'>" . esc_html($data["name"]) . ": </label>";
70
  $html .= "</td><td>";
71
- $required = $data["required"] ? " wpd-required-group" : "";
72
  $html .= "<div class='wpdiscuz-item" . esc_attr($required) . " wpd-field-group'>";
73
  foreach ($data["values"] as $index => $val) {
74
  $uniqueId = uniqid();
@@ -82,7 +90,7 @@ class CheckboxField extends Field {
82
  }
83
 
84
  public function frontFormHtml($name, $args, $options, $currentUser, $uniqueId, $isMainForm) {
85
- if (empty($args["values"]) || (!$isMainForm && !$args["is_show_sform"]))
86
  return;
87
  $hasDesc = $args["desc"] ? true : false;
88
  $required = $args["required"] ? " wpd-required-group" : "";
@@ -126,6 +134,9 @@ class CheckboxField extends Field {
126
  }
127
 
128
  public function frontHtml($value, $args) {
 
 
 
129
  $html = "<div class='wpd-custom-field wpd-cf-text'>";
130
  $html .= "<div class='wpd-cf-label'>" . esc_attr($args["name"]) . "</div> <div class='wpd-cf-value'> " . esc_html(apply_filters("wpdiscuz_custom_field_checkbox", implode(", ", $value), $args)) . "</div>";
131
  $html .= "</div>";
@@ -133,9 +144,6 @@ class CheckboxField extends Field {
133
  }
134
 
135
  public function validateFieldData($fieldName, $args, $options, $currentUser) {
136
- if (!$this->isCommentParentZero() && !$args["is_show_sform"]) {
137
- return [];
138
- }
139
  $values = filter_input(INPUT_POST, $fieldName, FILTER_VALIDATE_INT, FILTER_REQUIRE_ARRAY);
140
  $tempValues = is_array($values) ? array_filter($values) : [];
141
  $values = [];
@@ -146,7 +154,7 @@ class CheckboxField extends Field {
146
  $values[] = $args["values"][$val - 1];
147
  }
148
 
149
- if (!$values && $args["required"]) {
150
  wp_die(esc_html__($args["name"], "wpdiscuz") . " : " . esc_html__("field is required!", "wpdiscuz"));
151
  }
152
  return $values;
41
  <label for="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]"><?php esc_html_e("Display on comment", "wpdiscuz"); ?>:</label>
42
  <input type="checkbox" value="1" <?php checked($this->fieldData["is_show_on_comment"], 1, true); ?> name="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]" id="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]" />
43
  </div>
44
+ <div class="wpd-field-option">
45
+ <label for="<?php echo esc_attr($this->fieldInputName); ?>[show_for_guests]"><?php esc_html_e("Display for Guests", "wpdiscuz"); ?>:</label>
46
+ <input type="checkbox" value="1" <?php checked($this->fieldData["show_for_guests"], 1, true); ?> name="<?php echo esc_attr($this->fieldInputName); ?>[show_for_guests]" id="<?php echo esc_attr($this->fieldInputName); ?>[show_for_guests]" />
47
+ </div>
48
+ <div class="wpd-field-option">
49
+ <label for="<?php echo esc_attr($this->fieldInputName); ?>[show_for_users]"><?php esc_html_e("Display for Registered Users", "wpdiscuz"); ?>:</label>
50
+ <input type="checkbox" value="1" <?php checked($this->fieldData["show_for_users"], 1, true); ?> name="<?php echo esc_attr($this->fieldInputName); ?>[show_for_users]" id="<?php echo esc_attr($this->fieldInputName); ?>[show_for_users]" />
51
+ </div>
52
  <div class="wpd-advaced-options wpd-field-option">
53
  <small class="wpd-advaced-options-title"><?php esc_html_e("Advanced Options", "wpdiscuz"); ?></small>
54
  <div class="wpd-field-option wpd-advaced-options-cont">
68
  }
69
 
70
  public function editCommentHtml($key, $value, $data, $comment) {
71
+ if (!$this->isShowForUser($data) || ($comment->comment_parent && !$data["is_show_sform"])) {
72
  return "";
73
  }
74
  $valuesMeta = maybe_unserialize($value);
76
  $html = "<tr class='" . esc_attr($key) . "-wrapper wpd-edit-checkbox'><td class='first'>";
77
  $html .= "<label for='" . esc_attr($key) . "'>" . esc_html($data["name"]) . ": </label>";
78
  $html .= "</td><td>";
79
+ $required = $this->isValidateRequired($data) ? " wpd-required-group" : "";
80
  $html .= "<div class='wpdiscuz-item" . esc_attr($required) . " wpd-field-group'>";
81
  foreach ($data["values"] as $index => $val) {
82
  $uniqueId = uniqid();
90
  }
91
 
92
  public function frontFormHtml($name, $args, $options, $currentUser, $uniqueId, $isMainForm) {
93
+ if (empty($args["values"]) || !$this->isShowForUser($args, $currentUser) || (!$isMainForm && !$args["is_show_sform"]))
94
  return;
95
  $hasDesc = $args["desc"] ? true : false;
96
  $required = $args["required"] ? " wpd-required-group" : "";
134
  }
135
 
136
  public function frontHtml($value, $args) {
137
+ if(!$this->isShowForUser($args)){
138
+ return "";
139
+ }
140
  $html = "<div class='wpd-custom-field wpd-cf-text'>";
141
  $html .= "<div class='wpd-cf-label'>" . esc_attr($args["name"]) . "</div> <div class='wpd-cf-value'> " . esc_html(apply_filters("wpdiscuz_custom_field_checkbox", implode(", ", $value), $args)) . "</div>";
142
  $html .= "</div>";
144
  }
145
 
146
  public function validateFieldData($fieldName, $args, $options, $currentUser) {
 
 
 
147
  $values = filter_input(INPUT_POST, $fieldName, FILTER_VALIDATE_INT, FILTER_REQUIRE_ARRAY);
148
  $tempValues = is_array($values) ? array_filter($values) : [];
149
  $values = [];
154
  $values[] = $args["values"][$val - 1];
155
  }
156
 
157
+ if ($this->isValidateRequired($args, $currentUser) && !$values && $args["required"]) {
158
  wp_die(esc_html__($args["name"], "wpdiscuz") . " : " . esc_html__("field is required!", "wpdiscuz"));
159
  }
160
  return $values;
forms/wpdFormAttr/Field/ColorField.php CHANGED
@@ -39,6 +39,14 @@ class ColorField extends Field {
39
  <label for="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]"><?php esc_html_e("Display on comment", "wpdiscuz"); ?>:</label>
40
  <input type="checkbox" value="1" <?php checked($this->fieldData["is_show_on_comment"], 1, true); ?> name="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]" id="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]" />
41
  </div>
 
 
 
 
 
 
 
 
42
  <div class="wpd-advaced-options wpd-field-option">
43
  <small class="wpd-advaced-options-title"><?php esc_html_e("Advanced Options", "wpdiscuz"); ?></small>
44
  <div class="wpd-field-option wpd-advaced-options-cont">
@@ -58,14 +66,14 @@ class ColorField extends Field {
58
  }
59
 
60
  public function editCommentHtml($key, $value, $data, $comment) {
61
- if ($comment->comment_parent && !$data["is_show_sform"]) {
62
  return "";
63
  }
64
  $html = "<tr class='" . esc_attr($key) . "-wrapper wpd-edit-color'><td class='first'>";
65
  $html .= "<label for='" . esc_attr($key) . "'>" . esc_html($data["name"]) . ": </label>";
66
  $html .= "</td><td>";
67
  $html .= "<div class='wpdiscuz-item'>";
68
- $required = $data["required"] ? "required='required' aria-required='true'" : "";
69
  $html .= "<input " . $required . " class='wpd-field wpd-field-color' type='color' id='" . esc_attr($key) . "' value='" . esc_attr($value) . "' name='" . esc_attr($key) . "' pattern='^\#[A-Za-z0-9]{6}$' title='#ff8040'>";
70
  $html .= "</div>";
71
  $html .= "</td></tr>";
@@ -73,7 +81,7 @@ class ColorField extends Field {
73
  }
74
 
75
  public function frontFormHtml($name, $args, $options, $currentUser, $uniqueId, $isMainForm) {
76
- if (!$isMainForm && !$args["is_show_sform"]) {
77
  return;
78
  }
79
  $hasIcon = $args["icon"] ? true : false;
@@ -97,6 +105,9 @@ class ColorField extends Field {
97
  }
98
 
99
  public function frontHtml($value, $args) {
 
 
 
100
  $html = "<div class='wpd-custom-field wpd-cf-color'>";
101
  $html .= "<div class='wpd-cf-label'>" . esc_html($args["name"]) . "</div> <div class='wpd-cf-value' style='background:" . esc_attr($value) . ";'> " . esc_html(apply_filters("wpdiscuz_custom_field_color", $value, $args)) . " </div>";
102
  $html .= "</div>";
@@ -104,14 +115,11 @@ class ColorField extends Field {
104
  }
105
 
106
  public function validateFieldData($fieldName, $args, $options, $currentUser) {
107
- if (!$this->isCommentParentZero() && !$args["is_show_sform"]) {
108
- return "";
109
- }
110
  $value = Sanitizer::sanitize(INPUT_POST, $fieldName, "FILTER_SANITIZE_STRING");
111
  if ($value && !preg_match("@^\#[A-Za-z0-9]{6}$@is", $value)) {
112
  $value = "";
113
  }
114
- if (!$value && $args["required"]) {
115
  wp_die(esc_html__($args["name"], "wpdiscuz") . " : " . esc_html__("field is required!", "wpdiscuz"));
116
  }
117
  return $value;
39
  <label for="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]"><?php esc_html_e("Display on comment", "wpdiscuz"); ?>:</label>
40
  <input type="checkbox" value="1" <?php checked($this->fieldData["is_show_on_comment"], 1, true); ?> name="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]" id="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]" />
41
  </div>
42
+ <div class="wpd-field-option">
43
+ <label for="<?php echo esc_attr($this->fieldInputName); ?>[show_for_guests]"><?php esc_html_e("Display for Guests", "wpdiscuz"); ?>:</label>
44
+ <input type="checkbox" value="1" <?php checked($this->fieldData["show_for_guests"], 1, true); ?> name="<?php echo esc_attr($this->fieldInputName); ?>[show_for_guests]" id="<?php echo esc_attr($this->fieldInputName); ?>[show_for_guests]" />
45
+ </div>
46
+ <div class="wpd-field-option">
47
+ <label for="<?php echo esc_attr($this->fieldInputName); ?>[show_for_users]"><?php esc_html_e("Display for Registered Users", "wpdiscuz"); ?>:</label>
48
+ <input type="checkbox" value="1" <?php checked($this->fieldData["show_for_users"], 1, true); ?> name="<?php echo esc_attr($this->fieldInputName); ?>[show_for_users]" id="<?php echo esc_attr($this->fieldInputName); ?>[show_for_users]" />
49
+ </div>
50
  <div class="wpd-advaced-options wpd-field-option">
51
  <small class="wpd-advaced-options-title"><?php esc_html_e("Advanced Options", "wpdiscuz"); ?></small>
52
  <div class="wpd-field-option wpd-advaced-options-cont">
66
  }
67
 
68
  public function editCommentHtml($key, $value, $data, $comment) {
69
+ if (!$this->isShowForUser($data) || ($comment->comment_parent && !$data["is_show_sform"])) {
70
  return "";
71
  }
72
  $html = "<tr class='" . esc_attr($key) . "-wrapper wpd-edit-color'><td class='first'>";
73
  $html .= "<label for='" . esc_attr($key) . "'>" . esc_html($data["name"]) . ": </label>";
74
  $html .= "</td><td>";
75
  $html .= "<div class='wpdiscuz-item'>";
76
+ $required = $this->isValidateRequired($data) ? "required='required' aria-required='true'" : "";
77
  $html .= "<input " . $required . " class='wpd-field wpd-field-color' type='color' id='" . esc_attr($key) . "' value='" . esc_attr($value) . "' name='" . esc_attr($key) . "' pattern='^\#[A-Za-z0-9]{6}$' title='#ff8040'>";
78
  $html .= "</div>";
79
  $html .= "</td></tr>";
81
  }
82
 
83
  public function frontFormHtml($name, $args, $options, $currentUser, $uniqueId, $isMainForm) {
84
+ if (!$this->isShowForUser($args, $currentUser) || (!$isMainForm && !$args["is_show_sform"])) {
85
  return;
86
  }
87
  $hasIcon = $args["icon"] ? true : false;
105
  }
106
 
107
  public function frontHtml($value, $args) {
108
+ if(!$this->isShowForUser($args)){
109
+ return "";
110
+ }
111
  $html = "<div class='wpd-custom-field wpd-cf-color'>";
112
  $html .= "<div class='wpd-cf-label'>" . esc_html($args["name"]) . "</div> <div class='wpd-cf-value' style='background:" . esc_attr($value) . ";'> " . esc_html(apply_filters("wpdiscuz_custom_field_color", $value, $args)) . " </div>";
113
  $html .= "</div>";
115
  }
116
 
117
  public function validateFieldData($fieldName, $args, $options, $currentUser) {
 
 
 
118
  $value = Sanitizer::sanitize(INPUT_POST, $fieldName, "FILTER_SANITIZE_STRING");
119
  if ($value && !preg_match("@^\#[A-Za-z0-9]{6}$@is", $value)) {
120
  $value = "";
121
  }
122
+ if ($this->isValidateRequired($args, $currentUser) && !$value && $args["required"]) {
123
  wp_die(esc_html__($args["name"], "wpdiscuz") . " : " . esc_html__("field is required!", "wpdiscuz"));
124
  }
125
  return $value;
forms/wpdFormAttr/Field/DateField.php CHANGED
@@ -39,6 +39,14 @@ class DateField extends Field {
39
  <label for="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]"><?php esc_html_e("Display on comment", "wpdiscuz"); ?>:</label>
40
  <input type="checkbox" value="1" <?php checked($this->fieldData["is_show_on_comment"], 1, true); ?> name="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]" id="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]" />
41
  </div>
 
 
 
 
 
 
 
 
42
  <div class="wpd-advaced-options wpd-field-option">
43
  <small class="wpd-advaced-options-title"><?php esc_html_e("Advanced Options", "wpdiscuz"); ?></small>
44
  <div class="wpd-field-option wpd-advaced-options-cont">
@@ -58,14 +66,14 @@ class DateField extends Field {
58
  }
59
 
60
  public function editCommentHtml($key, $value, $data, $comment) {
61
- if ($comment->comment_parent && !$data["is_show_sform"]) {
62
  return "";
63
  }
64
  $html = "<tr class='" . esc_attr($key) . "-wrapper wpd-edit-date'><td class='first'>";
65
  $html .= "<label for='" . esc_attr($key) . "'>" . esc_html($data["name"]) . ": </label>";
66
  $html .= "</td><td>";
67
  $html .= "<div class='wpdiscuz-item'>";
68
- $required = $data["required"] ? "required='required' aria-required='true'" : "";
69
  $html .= "<input " . $required . " class='wpd-field wpd-field-date' type='date' id='" . esc_attr($key) . "' value='" . esc_attr($value) . "' name='" . esc_attr($key) . "' pattern='^(1[0-2]|0[1-9])/(3[01]|[12][0-9]|0[1-9])/[0-9]{4}$' title='03/28/2016'>";
70
  $html .= "</div>";
71
  $html .= "</td></tr>";
@@ -73,7 +81,7 @@ class DateField extends Field {
73
  }
74
 
75
  public function frontFormHtml($name, $args, $options, $currentUser, $uniqueId, $isMainForm) {
76
- if (!$isMainForm && !$args["is_show_sform"]) {
77
  return;
78
  }
79
  $hasIcon = $args["icon"] ? true : false;
@@ -97,6 +105,9 @@ class DateField extends Field {
97
  }
98
 
99
  public function frontHtml($value, $args) {
 
 
 
100
  $html = "<div class='wpd-custom-field wpd-cf-text'>";
101
  $html .= "<div class='wpd-cf-label'>" . esc_html($args["name"]) . "</div> <div class='wpd-cf-value'> " . esc_html(apply_filters("wpdiscuz_custom_field_date", $value, $args)) . "</div>";
102
  $html .= "</div>";
@@ -104,14 +115,11 @@ class DateField extends Field {
104
  }
105
 
106
  public function validateFieldData($fieldName, $args, $options, $currentUser) {
107
- if (!$this->isCommentParentZero() && !$args["is_show_sform"]) {
108
- return "";
109
- }
110
  $value = Sanitizer::sanitize(INPUT_POST, $fieldName, "FILTER_SANITIZE_STRING");
111
  if ($value && !preg_match("@^[0-9]{4}-[0-9]{2}-[0-9]{2}$@is", $value)) {
112
  $value = "";
113
  }
114
- if (!$value && $args["required"]) {
115
  wp_die(esc_html__($args["name"], "wpdiscuz") . " : " . esc_html__("field is required!", "wpdiscuz"));
116
  }
117
  return $value;
@@ -126,6 +134,8 @@ class DateField extends Field {
126
  "loc" => "bottom",
127
  "is_show_on_comment" => 1,
128
  "is_show_sform" => 1,
 
 
129
  ];
130
  }
131
 
39
  <label for="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]"><?php esc_html_e("Display on comment", "wpdiscuz"); ?>:</label>
40
  <input type="checkbox" value="1" <?php checked($this->fieldData["is_show_on_comment"], 1, true); ?> name="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]" id="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]" />
41
  </div>
42
+ <div class="wpd-field-option">
43
+ <label for="<?php echo esc_attr($this->fieldInputName); ?>[show_for_guests]"><?php esc_html_e("Display for Guests", "wpdiscuz"); ?>:</label>
44
+ <input type="checkbox" value="1" <?php checked($this->fieldData["show_for_guests"], 1, true); ?> name="<?php echo esc_attr($this->fieldInputName); ?>[show_for_guests]" id="<?php echo esc_attr($this->fieldInputName); ?>[show_for_guests]" />
45
+ </div>
46
+ <div class="wpd-field-option">
47
+ <label for="<?php echo esc_attr($this->fieldInputName); ?>[show_for_users]"><?php esc_html_e("Display for Registered Users", "wpdiscuz"); ?>:</label>
48
+ <input type="checkbox" value="1" <?php checked($this->fieldData["show_for_users"], 1, true); ?> name="<?php echo esc_attr($this->fieldInputName); ?>[show_for_users]" id="<?php echo esc_attr($this->fieldInputName); ?>[show_for_users]" />
49
+ </div>
50
  <div class="wpd-advaced-options wpd-field-option">
51
  <small class="wpd-advaced-options-title"><?php esc_html_e("Advanced Options", "wpdiscuz"); ?></small>
52
  <div class="wpd-field-option wpd-advaced-options-cont">
66
  }
67
 
68
  public function editCommentHtml($key, $value, $data, $comment) {
69
+ if (!$this->isShowForUser($data) || ($comment->comment_parent && !$data["is_show_sform"])) {
70
  return "";
71
  }
72
  $html = "<tr class='" . esc_attr($key) . "-wrapper wpd-edit-date'><td class='first'>";
73
  $html .= "<label for='" . esc_attr($key) . "'>" . esc_html($data["name"]) . ": </label>";
74
  $html .= "</td><td>";
75
  $html .= "<div class='wpdiscuz-item'>";
76
+ $required = $this->isValidateRequired($data) ? "required='required' aria-required='true'" : "";
77
  $html .= "<input " . $required . " class='wpd-field wpd-field-date' type='date' id='" . esc_attr($key) . "' value='" . esc_attr($value) . "' name='" . esc_attr($key) . "' pattern='^(1[0-2]|0[1-9])/(3[01]|[12][0-9]|0[1-9])/[0-9]{4}$' title='03/28/2016'>";
78
  $html .= "</div>";
79
  $html .= "</td></tr>";
81
  }
82
 
83
  public function frontFormHtml($name, $args, $options, $currentUser, $uniqueId, $isMainForm) {
84
+ if (!$this->isShowForUser($args, $currentUser) || (!$isMainForm && !$args["is_show_sform"])) {
85
  return;
86
  }
87
  $hasIcon = $args["icon"] ? true : false;
105
  }
106
 
107
  public function frontHtml($value, $args) {
108
+ if(!$this->isShowForUser($args)){
109
+ return "";
110
+ }
111
  $html = "<div class='wpd-custom-field wpd-cf-text'>";
112
  $html .= "<div class='wpd-cf-label'>" . esc_html($args["name"]) . "</div> <div class='wpd-cf-value'> " . esc_html(apply_filters("wpdiscuz_custom_field_date", $value, $args)) . "</div>";
113
  $html .= "</div>";
115
  }
116
 
117
  public function validateFieldData($fieldName, $args, $options, $currentUser) {
 
 
 
118
  $value = Sanitizer::sanitize(INPUT_POST, $fieldName, "FILTER_SANITIZE_STRING");
119
  if ($value && !preg_match("@^[0-9]{4}-[0-9]{2}-[0-9]{2}$@is", $value)) {
120
  $value = "";
121
  }
122
+ if ($this->isValidateRequired($args, $currentUser) && !$value && $args["required"]) {
123
  wp_die(esc_html__($args["name"], "wpdiscuz") . " : " . esc_html__("field is required!", "wpdiscuz"));
124
  }
125
  return $value;
134
  "loc" => "bottom",
135
  "is_show_on_comment" => 1,
136
  "is_show_sform" => 1,
137
+ "show_for_guests" => 1,
138
+ "show_for_users" => 1,
139
  ];
140
  }
141
 
forms/wpdFormAttr/Field/DefaultField/Email.php CHANGED
@@ -76,7 +76,7 @@ class Email extends Field {
76
  }
77
 
78
  public function validateFieldData($fieldName, $args, $options, $currentUser) {
79
- $email = isset($_POST[$fieldName]) ? sanitize_email(trim($_POST[$fieldName])) : "";
80
  if (!$args["required"]) {
81
  if (!$email) {
82
  $email = uniqid() . "@example.com";
@@ -84,7 +84,7 @@ class Email extends Field {
84
  }
85
  }
86
 
87
- if ($email !== "" && filter_var($email, FILTER_VALIDATE_EMAIL) === false) {
88
  wp_send_json_error("wc_error_email_text");
89
  }
90
 
76
  }
77
 
78
  public function validateFieldData($fieldName, $args, $options, $currentUser) {
79
+ $email = isset($_POST[$fieldName]) ? urlencode(sanitize_email(trim($_POST[$fieldName]))) : "";
80
  if (!$args["required"]) {
81
  if (!$email) {
82
  $email = uniqid() . "@example.com";
84
  }
85
  }
86
 
87
+ if ($email !== "" && filter_var(urldecode($email), FILTER_VALIDATE_EMAIL) === false) {
88
  wp_send_json_error("wc_error_email_text");
89
  }
90
 
forms/wpdFormAttr/Field/DefaultField/Name.php CHANGED
@@ -72,7 +72,7 @@ class Name extends Field {
72
  }
73
 
74
  public function validateFieldData($fieldName, $args, $options, $currentUser) {
75
- $name = isset($_POST[$fieldName]) ? sanitize_text_field(wp_unslash($_POST[$fieldName])) : "";
76
  if (!$args["required"]) {
77
  $name = !($name) ? esc_html($options->getPhrase("wc_anonymous")) : $name;
78
  }
72
  }
73
 
74
  public function validateFieldData($fieldName, $args, $options, $currentUser) {
75
+ $name = isset($_POST[$fieldName]) ? urlencode(sanitize_text_field(wp_unslash($_POST[$fieldName]))) : "";
76
  if (!$args["required"]) {
77
  $name = !($name) ? esc_html($options->getPhrase("wc_anonymous")) : $name;
78
  }
forms/wpdFormAttr/Field/Field.php CHANGED
@@ -10,6 +10,8 @@ abstract class Field {
10
  private static $instance = [];
11
  protected $isDefault;
12
  protected $display;
 
 
13
  protected $name;
14
  protected $type;
15
  protected $fieldInputName;
@@ -56,14 +58,14 @@ abstract class Field {
56
  ?>
57
  <div class="wpd-field <?php echo $this->isDefault ? "wpd-default-field" : ""; ?>">
58
  <div class="wpd-field-head">
59
- <?php echo htmlentities($args["name"]); ?>
60
  <?php
61
- if ($args["type"] === "wpdFormAttr\Field\DefaultField\Submit") {
62
  esc_html_e(" (Submit Button)", "wpdiscuz");
63
- } elseif ($args["type"] === "wpdFormAttr\Field\DefaultField\Captcha") {
64
  esc_html_e("Google reCAPTCHA", "wpdiscuz");
65
- } elseif (strpos($args["type"], "wpdFormAttr\Field\DefaultField") === false) {
66
- $fieldLable = str_replace("wpdFormAttr\Field\\", "", $args["type"]);
67
  echo " ( " . htmlentities(str_replace("Field", "", $fieldLable)) . " )";
68
  }
69
  ?>
@@ -77,7 +79,7 @@ abstract class Field {
77
  </div>
78
  </div>
79
  <?php
80
- $this->dashboardForm($row, $col, $name, $args);
81
  ?>
82
  </div>
83
  <?php
@@ -145,7 +147,6 @@ abstract class Field {
145
  $cleanData["values"][] = trim($value);
146
  }
147
  }
148
-
149
  if (isset($data["icon"])) {
150
  $cleanData["icon"] = trim(strip_tags($data["icon"]));
151
  }
@@ -162,9 +163,50 @@ abstract class Field {
162
  } else {
163
  $cleanData["is_show_sform"] = 0;
164
  }
 
 
 
 
 
 
 
 
 
 
165
  return wp_parse_args($cleanData, $this->fieldDefaultData);
166
  }
167
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
168
  protected function isCommentParentZero() {
169
  $isParent = false;
170
  $uniqueID = Sanitizer::sanitize(INPUT_POST, "wpdiscuz_unique_id", "FILTER_SANITIZE_STRING");
@@ -185,7 +227,9 @@ abstract class Field {
185
  "required" => "0",
186
  "loc" => "bottom",
187
  "is_show_on_comment" => 1,
188
- "is_show_sform" => 0
 
 
189
  ];
190
  }
191
 
10
  private static $instance = [];
11
  protected $isDefault;
12
  protected $display;
13
+ protected $displayForGuest;
14
+ protected $displayForUser;
15
  protected $name;
16
  protected $type;
17
  protected $fieldInputName;
58
  ?>
59
  <div class="wpd-field <?php echo $this->isDefault ? "wpd-default-field" : ""; ?>">
60
  <div class="wpd-field-head">
61
+ <?php echo htmlentities($this->fieldData["name"]); ?>
62
  <?php
63
+ if ($this->fieldData["type"] === "wpdFormAttr\Field\DefaultField\Submit") {
64
  esc_html_e(" (Submit Button)", "wpdiscuz");
65
+ } elseif ($this->fieldData["type"] === "wpdFormAttr\Field\DefaultField\Captcha") {
66
  esc_html_e("Google reCAPTCHA", "wpdiscuz");
67
+ } elseif (strpos($this->fieldData["type"], "wpdFormAttr\Field\DefaultField") === false) {
68
+ $fieldLable = str_replace("wpdFormAttr\Field\\", "", $this->fieldData["type"]);
69
  echo " ( " . htmlentities(str_replace("Field", "", $fieldLable)) . " )";
70
  }
71
  ?>
79
  </div>
80
  </div>
81
  <?php
82
+ $this->dashboardForm($row, $col, $name, $this->fieldData);
83
  ?>
84
  </div>
85
  <?php
147
  $cleanData["values"][] = trim($value);
148
  }
149
  }
 
150
  if (isset($data["icon"])) {
151
  $cleanData["icon"] = trim(strip_tags($data["icon"]));
152
  }
163
  } else {
164
  $cleanData["is_show_sform"] = 0;
165
  }
166
+ if (isset($data["show_for_guests"])) {
167
+ $cleanData["show_for_guests"] = intval($data["show_for_guests"]);
168
+ } else {
169
+ $cleanData["show_for_guests"] = 0;
170
+ }
171
+ if (isset($data["show_for_users"])) {
172
+ $cleanData["show_for_users"] = intval($data["show_for_users"]);
173
+ } else {
174
+ $cleanData["show_for_users"] = 0;
175
+ }
176
  return wp_parse_args($cleanData, $this->fieldDefaultData);
177
  }
178
 
179
+ protected function isShowForUser($args, $currentUser = null) {
180
+ $isShowForUser = true;
181
+ if(is_admin() && !wp_doing_ajax() && current_user_can("manage_options")){
182
+ return $isShowForUser;
183
+ }
184
+ if (is_null($currentUser)) {
185
+ $currentUser = wp_get_current_user();
186
+ }
187
+ if(!isset($args["show_for_users"])){
188
+ $args["show_for_users"] = 1;
189
+ }
190
+ if(!isset($args["show_for_guests"])){
191
+ $args["show_for_guests"] = 1;
192
+ }
193
+ if ($currentUser->exists() && !$args["show_for_users"]) {
194
+ $isShowForUser = false;
195
+ }
196
+
197
+ if (!$currentUser->exists() && !$args["show_for_guests"]) {
198
+ $isShowForUser = false;
199
+ }
200
+ return apply_filters("wpdiscuz_show_field_for_user", $isShowForUser, $currentUser, $args);
201
+ }
202
+
203
+ protected function isValidateRequired($args, $currentUser = null) {
204
+ if (!$args["required"] || !$this->isShowForUser($args, $currentUser) || (!$this->isCommentParentZero() && !$args["is_show_sform"]) || (is_admin() && !wp_doing_ajax() && current_user_can("manage_options"))) {
205
+ return false;
206
+ }
207
+ return true;
208
+ }
209
+
210
  protected function isCommentParentZero() {
211
  $isParent = false;
212
  $uniqueID = Sanitizer::sanitize(INPUT_POST, "wpdiscuz_unique_id", "FILTER_SANITIZE_STRING");
227
  "required" => "0",
228
  "loc" => "bottom",
229
  "is_show_on_comment" => 1,
230
+ "is_show_sform" => 0,
231
+ "show_for_guests" => 1,
232
+ "show_for_users" => 1,
233
  ];
234
  }
235
 
forms/wpdFormAttr/Field/HTMLField.php CHANGED
@@ -21,13 +21,21 @@ class HTMLField extends Field {
21
  <label for="<?php echo esc_attr($this->fieldInputName); ?>[is_show_sform]"><?php esc_html_e("Display on reply form", "wpdiscuz"); ?>:</label>
22
  <input type="checkbox" value="1" <?php checked($this->fieldData["is_show_sform"], 1, true); ?> name="<?php echo esc_attr($this->fieldInputName); ?>[is_show_sform]" id="<?php echo esc_attr($this->fieldInputName); ?>[is_show_sform]" />
23
  </div>
 
 
 
 
 
 
 
 
24
  <div style="clear:both;"></div>
25
  </div>
26
  <?php
27
  }
28
 
29
  public function frontFormHtml($name, $args, $options, $currentUser, $uniqueId, $isMainForm) {
30
- if (!$isMainForm && !$args["is_show_sform"])
31
  return;
32
  echo $args["value"];
33
  }
@@ -59,7 +67,9 @@ class HTMLField extends Field {
59
  "loc" => "top",
60
  "is_show_on_comment" => "0",
61
  "is_show_sform" => "1",
62
- "no_insert_meta" => "1"
 
 
63
  ];
64
  }
65
 
21
  <label for="<?php echo esc_attr($this->fieldInputName); ?>[is_show_sform]"><?php esc_html_e("Display on reply form", "wpdiscuz"); ?>:</label>
22
  <input type="checkbox" value="1" <?php checked($this->fieldData["is_show_sform"], 1, true); ?> name="<?php echo esc_attr($this->fieldInputName); ?>[is_show_sform]" id="<?php echo esc_attr($this->fieldInputName); ?>[is_show_sform]" />
23
  </div>
24
+ <div class="wpd-field-option">
25
+ <label for="<?php echo esc_attr($this->fieldInputName); ?>[show_for_guests]"><?php esc_html_e("Display for Guests", "wpdiscuz"); ?>:</label>
26
+ <input type="checkbox" value="1" <?php checked($this->fieldData["show_for_guests"], 1, true); ?> name="<?php echo esc_attr($this->fieldInputName); ?>[show_for_guests]" id="<?php echo esc_attr($this->fieldInputName); ?>[show_for_guests]" />
27
+ </div>
28
+ <div class="wpd-field-option">
29
+ <label for="<?php echo esc_attr($this->fieldInputName); ?>[show_for_users]"><?php esc_html_e("Display for Registered Users", "wpdiscuz"); ?>:</label>
30
+ <input type="checkbox" value="1" <?php checked($this->fieldData["show_for_users"], 1, true); ?> name="<?php echo esc_attr($this->fieldInputName); ?>[show_for_users]" id="<?php echo esc_attr($this->fieldInputName); ?>[show_for_users]" />
31
+ </div>
32
  <div style="clear:both;"></div>
33
  </div>
34
  <?php
35
  }
36
 
37
  public function frontFormHtml($name, $args, $options, $currentUser, $uniqueId, $isMainForm) {
38
+ if (!$this->isShowForUser($args, $currentUser) || !$isMainForm && !$args["is_show_sform"])
39
  return;
40
  echo $args["value"];
41
  }
67
  "loc" => "top",
68
  "is_show_on_comment" => "0",
69
  "is_show_sform" => "1",
70
+ "no_insert_meta" => "1",
71
+ "show_for_guests" => 1,
72
+ "show_for_users" => 1,
73
  ];
74
  }
75
 
forms/wpdFormAttr/Field/NumberField.php CHANGED
@@ -49,6 +49,14 @@ class NumberField extends Field {
49
  <label for="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]"><?php esc_html_e("Display on comment", "wpdiscuz"); ?>:</label>
50
  <input type="checkbox" value="1" <?php checked($this->fieldData["is_show_on_comment"], 1, true); ?> name="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]" id="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]" />
51
  </div>
 
 
 
 
 
 
 
 
52
  <div class="wpd-advaced-options wpd-field-option">
53
  <small class="wpd-advaced-options-title"><?php esc_html_e("Advanced Options", "wpdiscuz"); ?></small>
54
  <div class="wpd-field-option wpd-advaced-options-cont">
@@ -68,14 +76,14 @@ class NumberField extends Field {
68
  }
69
 
70
  public function editCommentHtml($key, $value, $data, $comment) {
71
- if ($comment->comment_parent && !$data["is_show_sform"]) {
72
  return "";
73
  }
74
  $html = "<tr class='" . esc_attr($key) . "-wrapper wpd-edit-number'><td class='first'>";
75
  $html .= "<label for='" . esc_attr($key) . "'>" . esc_html($data["name"]) . ": </label>";
76
  $html .= "</td><td>";
77
  $html .= "<div class='wpdiscuz-item'>";
78
- $required = $data["required"] ? "required='required' aria-required='true'" : "";
79
  $min = is_numeric($data["min"]) ? "min='" . $data["min"] . "'" : "";
80
  $max = is_numeric($data["max"]) ? "max='" . $data["max"] . "'" : "";
81
  $html .= "<input " . $required . " class='wpd-field wpd-field-number' type='number' id='" . esc_attr($key) . "' value='" . esc_attr($value) . "' name='" . esc_attr($key) . "' " . $min . " " . $max . ">";
@@ -85,7 +93,7 @@ class NumberField extends Field {
85
  }
86
 
87
  public function frontFormHtml($name, $args, $options, $currentUser, $uniqueId, $isMainForm) {
88
- if (!$isMainForm && !$args["is_show_sform"]) {
89
  return;
90
  }
91
  $hasIcon = $args["icon"] ? true : false;
@@ -110,6 +118,9 @@ class NumberField extends Field {
110
  }
111
 
112
  public function frontHtml($value, $args) {
 
 
 
113
  $html = "<div class='wpd-custom-field wpd-cf-text'>";
114
  $html .= "<div class='wpd-cf-label'>" . esc_html($args["name"]) . "</div> <div class='wpd-cf-value'> " . esc_html(apply_filters("wpdiscuz_custom_field_number", $value, $args)) . "</div>";
115
  $html .= "</div>";
@@ -117,11 +128,8 @@ class NumberField extends Field {
117
  }
118
 
119
  public function validateFieldData($fieldName, $args, $options, $currentUser) {
120
- if (!$this->isCommentParentZero() && !$args["is_show_sform"]) {
121
- return "";
122
- }
123
  $value = Sanitizer::sanitize(INPUT_POST, $fieldName, FILTER_SANITIZE_NUMBER_INT);
124
- if (!$value && $args["required"]) {
125
  wp_die(esc_html__($args["name"], "wpdiscuz") . " : " . esc_html__("field is required!", "wpdiscuz"));
126
  }
127
  $value = intval($value);
@@ -192,7 +200,9 @@ class NumberField extends Field {
192
  "min" => "",
193
  "max" => "",
194
  "is_show_sform" => 0,
195
- "is_show_on_comment" => 1
 
 
196
  ];
197
  }
198
 
49
  <label for="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]"><?php esc_html_e("Display on comment", "wpdiscuz"); ?>:</label>
50
  <input type="checkbox" value="1" <?php checked($this->fieldData["is_show_on_comment"], 1, true); ?> name="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]" id="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]" />
51
  </div>
52
+ <div class="wpd-field-option">
53
+ <label for="<?php echo esc_attr($this->fieldInputName); ?>[show_for_guests]"><?php esc_html_e("Display for Guests", "wpdiscuz"); ?>:</label>
54
+ <input type="checkbox" value="1" <?php checked($this->fieldData["show_for_guests"], 1, true); ?> name="<?php echo esc_attr($this->fieldInputName); ?>[show_for_guests]" id="<?php echo esc_attr($this->fieldInputName); ?>[show_for_guests]" />
55
+ </div>
56
+ <div class="wpd-field-option">
57
+ <label for="<?php echo esc_attr($this->fieldInputName); ?>[show_for_users]"><?php esc_html_e("Display for Registered Users", "wpdiscuz"); ?>:</label>
58
+ <input type="checkbox" value="1" <?php checked($this->fieldData["show_for_users"], 1, true); ?> name="<?php echo esc_attr($this->fieldInputName); ?>[show_for_users]" id="<?php echo esc_attr($this->fieldInputName); ?>[show_for_users]" />
59
+ </div>
60
  <div class="wpd-advaced-options wpd-field-option">
61
  <small class="wpd-advaced-options-title"><?php esc_html_e("Advanced Options", "wpdiscuz"); ?></small>
62
  <div class="wpd-field-option wpd-advaced-options-cont">
76
  }
77
 
78
  public function editCommentHtml($key, $value, $data, $comment) {
79
+ if (!$this->isShowForUser($data) || ($comment->comment_parent && !$data["is_show_sform"])) {
80
  return "";
81
  }
82
  $html = "<tr class='" . esc_attr($key) . "-wrapper wpd-edit-number'><td class='first'>";
83
  $html .= "<label for='" . esc_attr($key) . "'>" . esc_html($data["name"]) . ": </label>";
84
  $html .= "</td><td>";
85
  $html .= "<div class='wpdiscuz-item'>";
86
+ $required = $this->isValidateRequired($data) ? "required='required' aria-required='true'" : "";
87
  $min = is_numeric($data["min"]) ? "min='" . $data["min"] . "'" : "";
88
  $max = is_numeric($data["max"]) ? "max='" . $data["max"] . "'" : "";
89
  $html .= "<input " . $required . " class='wpd-field wpd-field-number' type='number' id='" . esc_attr($key) . "' value='" . esc_attr($value) . "' name='" . esc_attr($key) . "' " . $min . " " . $max . ">";
93
  }
94
 
95
  public function frontFormHtml($name, $args, $options, $currentUser, $uniqueId, $isMainForm) {
96
+ if (!$this->isShowForUser($args, $currentUser) || (!$isMainForm && !$args["is_show_sform"])) {
97
  return;
98
  }
99
  $hasIcon = $args["icon"] ? true : false;
118
  }
119
 
120
  public function frontHtml($value, $args) {
121
+ if(!$this->isShowForUser($args)){
122
+ return "";
123
+ }
124
  $html = "<div class='wpd-custom-field wpd-cf-text'>";
125
  $html .= "<div class='wpd-cf-label'>" . esc_html($args["name"]) . "</div> <div class='wpd-cf-value'> " . esc_html(apply_filters("wpdiscuz_custom_field_number", $value, $args)) . "</div>";
126
  $html .= "</div>";
128
  }
129
 
130
  public function validateFieldData($fieldName, $args, $options, $currentUser) {
 
 
 
131
  $value = Sanitizer::sanitize(INPUT_POST, $fieldName, FILTER_SANITIZE_NUMBER_INT);
132
+ if ($this->isValidateRequired($args, $currentUser) && !$value && $args["required"]) {
133
  wp_die(esc_html__($args["name"], "wpdiscuz") . " : " . esc_html__("field is required!", "wpdiscuz"));
134
  }
135
  $value = intval($value);
200
  "min" => "",
201
  "max" => "",
202
  "is_show_sform" => 0,
203
+ "is_show_on_comment" => 1,
204
+ "show_for_guests" => 1,
205
+ "show_for_users" => 1,
206
  ];
207
  }
208
 
forms/wpdFormAttr/Field/RadioField.php CHANGED
@@ -43,6 +43,14 @@ class RadioField extends Field {
43
  <label for="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]"><?php esc_html_e("Display on comment", "wpdiscuz"); ?>:</label>
44
  <input type="checkbox" value="1" <?php checked($this->fieldData["is_show_on_comment"], 1, true); ?> name="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]" id="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]" />
45
  </div>
 
 
 
 
 
 
 
 
46
  <div class="wpd-advaced-options wpd-field-option">
47
  <small class="wpd-advaced-options-title"><?php esc_html_e("Advanced Options", "wpdiscuz"); ?></small>
48
  <div class="wpd-field-option wpd-advaced-options-cont">
@@ -62,13 +70,13 @@ class RadioField extends Field {
62
  }
63
 
64
  public function editCommentHtml($key, $value, $data, $comment) {
65
- if ($comment->comment_parent && !$data["is_show_sform"]) {
66
  return "";
67
  }
68
  $html = "<tr class='" . esc_attr($key) . "-wrapper wpd-edit-radio'><td class='first'>";
69
  $html .= "<label for='" . esc_attr($key) . "'>" . esc_html($data["name"]) . ": </label>";
70
  $html .= "</td><td>";
71
- $required = $data["required"] ? " wpd-required-group" : "";
72
  $html .= "<div class='wpdiscuz-item" . esc_attr($required) . " wpd-field-group'>";
73
  foreach ($data["values"] as $index => $val) {
74
  $uniqueId = uniqid();
@@ -82,7 +90,7 @@ class RadioField extends Field {
82
  }
83
 
84
  public function frontFormHtml($name, $args, $options, $currentUser, $uniqueId, $isMainForm) {
85
- if (empty($args["values"]) || (!$isMainForm && !$args["is_show_sform"]))
86
  return;
87
  $hasDesc = $args["desc"] ? true : false;
88
  ?>
@@ -111,6 +119,9 @@ class RadioField extends Field {
111
  }
112
 
113
  public function frontHtml($value, $args) {
 
 
 
114
  $html = "<div class='wpd-custom-field wpd-cf-text'>";
115
  $html .= "<div class='wpd-cf-label'>" . esc_html($args["name"]) . "</div> <div class='wpd-cf-value'> " . esc_html(apply_filters("wpdiscuz_custom_field_radio", $value, $args)) . "</div>";
116
  $html .= "</div>";
@@ -118,16 +129,13 @@ class RadioField extends Field {
118
  }
119
 
120
  public function validateFieldData($fieldName, $args, $options, $currentUser) {
121
- if (!$this->isCommentParentZero() && !$args["is_show_sform"]) {
122
- return "";
123
- }
124
  $value = Sanitizer::sanitize(INPUT_POST, $fieldName, FILTER_VALIDATE_INT);
125
  if (is_int($value) && $value > 0 && key_exists($value - 1, $args["values"])) {
126
  $value = $args["values"][$value - 1];
127
  } else {
128
  $value = "";
129
  }
130
- if (!$value && $args["required"]) {
131
  wp_die(esc_html__($args["name"], "wpdiscuz") . " : " . esc_html__("field is required!", "wpdiscuz"));
132
  }
133
  return $value;
43
  <label for="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]"><?php esc_html_e("Display on comment", "wpdiscuz"); ?>:</label>
44
  <input type="checkbox" value="1" <?php checked($this->fieldData["is_show_on_comment"], 1, true); ?> name="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]" id="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]" />
45
  </div>
46
+ <div class="wpd-field-option">
47
+ <label for="<?php echo esc_attr($this->fieldInputName); ?>[show_for_guests]"><?php esc_html_e("Display for Guests", "wpdiscuz"); ?>:</label>
48
+ <input type="checkbox" value="1" <?php checked($this->fieldData["show_for_guests"], 1, true); ?> name="<?php echo esc_attr($this->fieldInputName); ?>[show_for_guests]" id="<?php echo esc_attr($this->fieldInputName); ?>[show_for_guests]" />
49
+ </div>
50
+ <div class="wpd-field-option">
51
+ <label for="<?php echo esc_attr($this->fieldInputName); ?>[show_for_users]"><?php esc_html_e("Display for Registered Users", "wpdiscuz"); ?>:</label>
52
+ <input type="checkbox" value="1" <?php checked($this->fieldData["show_for_users"], 1, true); ?> name="<?php echo esc_attr($this->fieldInputName); ?>[show_for_users]" id="<?php echo esc_attr($this->fieldInputName); ?>[show_for_users]" />
53
+ </div>
54
  <div class="wpd-advaced-options wpd-field-option">
55
  <small class="wpd-advaced-options-title"><?php esc_html_e("Advanced Options", "wpdiscuz"); ?></small>
56
  <div class="wpd-field-option wpd-advaced-options-cont">
70
  }
71
 
72
  public function editCommentHtml($key, $value, $data, $comment) {
73
+ if (!$this->isShowForUser($data) || ($comment->comment_parent && !$data["is_show_sform"])) {
74
  return "";
75
  }
76
  $html = "<tr class='" . esc_attr($key) . "-wrapper wpd-edit-radio'><td class='first'>";
77
  $html .= "<label for='" . esc_attr($key) . "'>" . esc_html($data["name"]) . ": </label>";
78
  $html .= "</td><td>";
79
+ $required = $this->isValidateRequired($data) ? " wpd-required-group" : "";
80
  $html .= "<div class='wpdiscuz-item" . esc_attr($required) . " wpd-field-group'>";
81
  foreach ($data["values"] as $index => $val) {
82
  $uniqueId = uniqid();
90
  }
91
 
92
  public function frontFormHtml($name, $args, $options, $currentUser, $uniqueId, $isMainForm) {
93
+ if (empty($args["values"]) || !$this->isShowForUser($args, $currentUser) || (!$isMainForm && !$args["is_show_sform"]))
94
  return;
95
  $hasDesc = $args["desc"] ? true : false;
96
  ?>
119
  }
120
 
121
  public function frontHtml($value, $args) {
122
+ if(!$this->isShowForUser($args)){
123
+ return "";
124
+ }
125
  $html = "<div class='wpd-custom-field wpd-cf-text'>";
126
  $html .= "<div class='wpd-cf-label'>" . esc_html($args["name"]) . "</div> <div class='wpd-cf-value'> " . esc_html(apply_filters("wpdiscuz_custom_field_radio", $value, $args)) . "</div>";
127
  $html .= "</div>";
129
  }
130
 
131
  public function validateFieldData($fieldName, $args, $options, $currentUser) {
 
 
 
132
  $value = Sanitizer::sanitize(INPUT_POST, $fieldName, FILTER_VALIDATE_INT);
133
  if (is_int($value) && $value > 0 && key_exists($value - 1, $args["values"])) {
134
  $value = $args["values"][$value - 1];
135
  } else {
136
  $value = "";
137
  }
138
+ if ($this->isValidateRequired($args, $currentUser) && !$value && $args["required"]) {
139
  wp_die(esc_html__($args["name"], "wpdiscuz") . " : " . esc_html__("field is required!", "wpdiscuz"));
140
  }
141
  return $value;
forms/wpdFormAttr/Field/RatingField.php CHANGED
@@ -39,6 +39,14 @@ class RatingField extends Field {
39
  <label for="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]"><?php esc_html_e("Display on comment", "wpdiscuz"); ?>:</label>
40
  <input type="checkbox" value="1" <?php checked($this->fieldData["is_show_on_comment"], 1, true); ?> name="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]" id="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]" />
41
  </div>
 
 
 
 
 
 
 
 
42
  <div class="wpd-advaced-options wpd-field-option">
43
  <small class="wpd-advaced-options-title"><?php esc_html_e("Advanced Options", "wpdiscuz"); ?></small>
44
  <div class="wpd-field-option wpd-advaced-options-cont">
@@ -58,14 +66,14 @@ class RatingField extends Field {
58
  }
59
 
60
  public function editCommentHtml($key, $value, $data, $comment) {
61
- if ($comment->comment_parent) {
62
  return "";
63
  }
64
  $html = "<tr class='" . esc_attr($key) . "-wrapper wpd-edit-rating'><td class='first'>";
65
  $html .= "<label for='" . esc_attr($key) . "'>" . esc_html($data["name"]) . ": </label>";
66
  $html .= "</td><td>";
67
  $uniqueId = uniqid();
68
- $required = $data["required"] ? " wpd-required-group " : "";
69
  $html .= "<div class='wpdiscuz-item wpd-field-group wpd-field-rating " . esc_attr($required) . "'>";
70
  $html .= "<fieldset class='wpdiscuz-rating'>";
71
  for ($i = 5; $i >= 1; $i--) {
@@ -80,7 +88,7 @@ class RatingField extends Field {
80
  }
81
 
82
  public function frontFormHtml($name, $args, $options, $currentUser, $uniqueId, $isMainForm) {
83
- if (!$isMainForm)
84
  return;
85
  $hasDesc = $args["desc"] ? true : false;
86
  $required = $args["required"] ? " wpd-required-group" : "";
@@ -111,6 +119,9 @@ class RatingField extends Field {
111
  }
112
 
113
  public function frontHtml($value, $args) {
 
 
 
114
  $html = "<div class='wpd-custom-field wpd-cf-rating'>";
115
  $html .= "<div class='wpd-cf-label'>" . esc_html($args["name"]) . " : </div><div class='wpd-cf-value'>";
116
  for ($i = 0; $i < 5; $i++) {
@@ -124,10 +135,7 @@ class RatingField extends Field {
124
 
125
  public function validateFieldData($fieldName, $args, $options, $currentUser) {
126
  $value = Sanitizer::sanitize(INPUT_POST, $fieldName, FILTER_SANITIZE_NUMBER_INT);
127
- if (!$this->isCommentParentZero()) {
128
- return 0;
129
- }
130
- if (!$value && $args["required"]) {
131
  wp_die(esc_html__($args["name"], "wpdiscuz") . " : " . esc_html__("field is required!", "wpdiscuz"));
132
  }
133
  return $value;
@@ -141,7 +149,9 @@ class RatingField extends Field {
141
  "required" => "0",
142
  "loc" => "top",
143
  "icon" => "fas fa-star",
144
- "is_show_on_comment" => 1
 
 
145
  ];
146
  }
147
 
39
  <label for="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]"><?php esc_html_e("Display on comment", "wpdiscuz"); ?>:</label>
40
  <input type="checkbox" value="1" <?php checked($this->fieldData["is_show_on_comment"], 1, true); ?> name="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]" id="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]" />
41
  </div>
42
+ <div class="wpd-field-option">
43
+ <label for="<?php echo esc_attr($this->fieldInputName); ?>[show_for_guests]"><?php esc_html_e("Display for Guests", "wpdiscuz"); ?>:</label>
44
+ <input type="checkbox" value="1" <?php checked($this->fieldData["show_for_guests"], 1, true); ?> name="<?php echo esc_attr($this->fieldInputName); ?>[show_for_guests]" id="<?php echo esc_attr($this->fieldInputName); ?>[show_for_guests]" />
45
+ </div>
46
+ <div class="wpd-field-option">
47
+ <label for="<?php echo esc_attr($this->fieldInputName); ?>[show_for_users]"><?php esc_html_e("Display for Registered Users", "wpdiscuz"); ?>:</label>
48
+ <input type="checkbox" value="1" <?php checked($this->fieldData["show_for_users"], 1, true); ?> name="<?php echo esc_attr($this->fieldInputName); ?>[show_for_users]" id="<?php echo esc_attr($this->fieldInputName); ?>[show_for_users]" />
49
+ </div>
50
  <div class="wpd-advaced-options wpd-field-option">
51
  <small class="wpd-advaced-options-title"><?php esc_html_e("Advanced Options", "wpdiscuz"); ?></small>
52
  <div class="wpd-field-option wpd-advaced-options-cont">
66
  }
67
 
68
  public function editCommentHtml($key, $value, $data, $comment) {
69
+ if ($comment->comment_parent || !$this->isShowForUser($data)) {
70
  return "";
71
  }
72
  $html = "<tr class='" . esc_attr($key) . "-wrapper wpd-edit-rating'><td class='first'>";
73
  $html .= "<label for='" . esc_attr($key) . "'>" . esc_html($data["name"]) . ": </label>";
74
  $html .= "</td><td>";
75
  $uniqueId = uniqid();
76
+ $required = $this->isValidateRequired($data) ? " wpd-required-group " : "";
77
  $html .= "<div class='wpdiscuz-item wpd-field-group wpd-field-rating " . esc_attr($required) . "'>";
78
  $html .= "<fieldset class='wpdiscuz-rating'>";
79
  for ($i = 5; $i >= 1; $i--) {
88
  }
89
 
90
  public function frontFormHtml($name, $args, $options, $currentUser, $uniqueId, $isMainForm) {
91
+ if (!$isMainForm || !$this->isShowForUser($args, $currentUser))
92
  return;
93
  $hasDesc = $args["desc"] ? true : false;
94
  $required = $args["required"] ? " wpd-required-group" : "";
119
  }
120
 
121
  public function frontHtml($value, $args) {
122
+ if(!$this->isShowForUser($args)){
123
+ return "";
124
+ }
125
  $html = "<div class='wpd-custom-field wpd-cf-rating'>";
126
  $html .= "<div class='wpd-cf-label'>" . esc_html($args["name"]) . " : </div><div class='wpd-cf-value'>";
127
  for ($i = 0; $i < 5; $i++) {
135
 
136
  public function validateFieldData($fieldName, $args, $options, $currentUser) {
137
  $value = Sanitizer::sanitize(INPUT_POST, $fieldName, FILTER_SANITIZE_NUMBER_INT);
138
+ if ($this->isValidateRequired($args, $currentUser) && !$value && $args["required"]) {
 
 
 
139
  wp_die(esc_html__($args["name"], "wpdiscuz") . " : " . esc_html__("field is required!", "wpdiscuz"));
140
  }
141
  return $value;
149
  "required" => "0",
150
  "loc" => "top",
151
  "icon" => "fas fa-star",
152
+ "is_show_on_comment" => 1,
153
+ "show_for_guests" => 1,
154
+ "show_for_users" => 1,
155
  ];
156
  }
157
 
forms/wpdFormAttr/Field/SelectField.php CHANGED
@@ -43,6 +43,14 @@ class SelectField extends Field {
43
  <label for="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]"><?php esc_html_e("Display on comment", "wpdiscuz"); ?>:</label>
44
  <input type="checkbox" value="1" <?php checked($this->fieldData["is_show_on_comment"], 1, true); ?> name="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]" id="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]" />
45
  </div>
 
 
 
 
 
 
 
 
46
  <div class="wpd-advaced-options wpd-field-option">
47
  <small class="wpd-advaced-options-title"><?php esc_html_e("Advanced Options", "wpdiscuz"); ?></small>
48
  <div class="wpd-field-option wpd-advaced-options-cont">
@@ -62,13 +70,13 @@ class SelectField extends Field {
62
  }
63
 
64
  public function editCommentHtml($key, $value, $data, $comment) {
65
- if ($comment->comment_parent && !$data["is_show_sform"]) {
66
  return "";
67
  }
68
  $html = "<tr class='" . esc_attr($key) . "-wrapper wpd-edit-select'><td class='first'>";
69
  $html .= "<label for='" . esc_attr($key) . "'>" . esc_html($data["name"]) . ": </label>";
70
  $html .= "</td><td>";
71
- $required = $data["required"] ? " required='required' aria-required='true' " : "";
72
  $html .= "<div class='wpdiscuz-item wpd-field-group wpd-field-select'>";
73
  $html .= "<select name='" . esc_attr($key) . "' class='" . esc_attr($key) . " wpd-field wpd-field-select wpdiscuz_select'$required>";
74
  $html .= "<option value=''>...</option>";
@@ -84,7 +92,7 @@ class SelectField extends Field {
84
  }
85
 
86
  public function frontFormHtml($name, $args, $options, $currentUser, $uniqueId, $isMainForm) {
87
- if (empty($args["values"]) || (!$isMainForm && !$args["is_show_sform"]))
88
  return;
89
  $hasDesc = $args["desc"] ? true : false;
90
  ?>
@@ -104,6 +112,9 @@ class SelectField extends Field {
104
  }
105
 
106
  public function frontHtml($value, $args) {
 
 
 
107
  $html = "<div class='wpd-custom-field wpd-cf-text'>";
108
  $html .= "<div class='wpd-cf-label'>" . esc_html($args["name"]) . "</div> <div class='wpd-cf-value'> " . esc_html(apply_filters("wpdiscuz_custom_field_select", $value, $args)) . "</div>";
109
  $html .= "</div>";
@@ -111,16 +122,13 @@ class SelectField extends Field {
111
  }
112
 
113
  public function validateFieldData($fieldName, $args, $options, $currentUser) {
114
- if (!$this->isCommentParentZero() && !$args["is_show_sform"]) {
115
- return "";
116
- }
117
  $value = Sanitizer::sanitize(INPUT_POST, $fieldName, FILTER_VALIDATE_INT);
118
  if (is_int($value) && $value > 0 && key_exists($value - 1, $args["values"])) {
119
  $value = $args["values"][$value - 1];
120
  } else {
121
  $value = "";
122
  }
123
- if (!$value && $args["required"]) {
124
  wp_die(esc_html__($args["name"], "wpdiscuz") . " : " . esc_html__("field is required!", "wpdiscuz"));
125
  }
126
  return $value;
43
  <label for="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]"><?php esc_html_e("Display on comment", "wpdiscuz"); ?>:</label>
44
  <input type="checkbox" value="1" <?php checked($this->fieldData["is_show_on_comment"], 1, true); ?> name="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]" id="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]" />
45
  </div>
46
+ <div class="wpd-field-option">
47
+ <label for="<?php echo esc_attr($this->fieldInputName); ?>[show_for_guests]"><?php esc_html_e("Display for Guests", "wpdiscuz"); ?>:</label>
48
+ <input type="checkbox" value="1" <?php checked($this->fieldData["show_for_guests"], 1, true); ?> name="<?php echo esc_attr($this->fieldInputName); ?>[show_for_guests]" id="<?php echo esc_attr($this->fieldInputName); ?>[show_for_guests]" />
49
+ </div>
50
+ <div class="wpd-field-option">
51
+ <label for="<?php echo esc_attr($this->fieldInputName); ?>[show_for_users]"><?php esc_html_e("Display for Registered Users", "wpdiscuz"); ?>:</label>
52
+ <input type="checkbox" value="1" <?php checked($this->fieldData["show_for_users"], 1, true); ?> name="<?php echo esc_attr($this->fieldInputName); ?>[show_for_users]" id="<?php echo esc_attr($this->fieldInputName); ?>[show_for_users]" />
53
+ </div>
54
  <div class="wpd-advaced-options wpd-field-option">
55
  <small class="wpd-advaced-options-title"><?php esc_html_e("Advanced Options", "wpdiscuz"); ?></small>
56
  <div class="wpd-field-option wpd-advaced-options-cont">
70
  }
71
 
72
  public function editCommentHtml($key, $value, $data, $comment) {
73
+ if (!$this->isShowForUser($data) || ($comment->comment_parent && !$data["is_show_sform"])) {
74
  return "";
75
  }
76
  $html = "<tr class='" . esc_attr($key) . "-wrapper wpd-edit-select'><td class='first'>";
77
  $html .= "<label for='" . esc_attr($key) . "'>" . esc_html($data["name"]) . ": </label>";
78
  $html .= "</td><td>";
79
+ $required = $this->isValidateRequired($data) ? " required='required' aria-required='true' " : "";
80
  $html .= "<div class='wpdiscuz-item wpd-field-group wpd-field-select'>";
81
  $html .= "<select name='" . esc_attr($key) . "' class='" . esc_attr($key) . " wpd-field wpd-field-select wpdiscuz_select'$required>";
82
  $html .= "<option value=''>...</option>";
92
  }
93
 
94
  public function frontFormHtml($name, $args, $options, $currentUser, $uniqueId, $isMainForm) {
95
+ if (empty($args["values"]) || !$this->isShowForUser($args, $currentUser) || (!$isMainForm && !$args["is_show_sform"]))
96
  return;
97
  $hasDesc = $args["desc"] ? true : false;
98
  ?>
112
  }
113
 
114
  public function frontHtml($value, $args) {
115
+ if(!$this->isShowForUser($args)){
116
+ return "";
117
+ }
118
  $html = "<div class='wpd-custom-field wpd-cf-text'>";
119
  $html .= "<div class='wpd-cf-label'>" . esc_html($args["name"]) . "</div> <div class='wpd-cf-value'> " . esc_html(apply_filters("wpdiscuz_custom_field_select", $value, $args)) . "</div>";
120
  $html .= "</div>";
122
  }
123
 
124
  public function validateFieldData($fieldName, $args, $options, $currentUser) {
 
 
 
125
  $value = Sanitizer::sanitize(INPUT_POST, $fieldName, FILTER_VALIDATE_INT);
126
  if (is_int($value) && $value > 0 && key_exists($value - 1, $args["values"])) {
127
  $value = $args["values"][$value - 1];
128
  } else {
129
  $value = "";
130
  }
131
+ if ($this->isValidateRequired($args, $currentUser) && !$value && $args["required"]) {
132
  wp_die(esc_html__($args["name"], "wpdiscuz") . " : " . esc_html__("field is required!", "wpdiscuz"));
133
  }
134
  return $value;
forms/wpdFormAttr/Field/TextAreaField.php CHANGED
@@ -32,6 +32,14 @@ class TextAreaField extends Field {
32
  <label for="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]"><?php esc_html_e("Display on comment", "wpdiscuz"); ?>:</label>
33
  <input type="checkbox" value="1" <?php checked($this->fieldData["is_show_on_comment"], 1, true); ?> name="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]" id="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]" />
34
  </div>
 
 
 
 
 
 
 
 
35
  <div class="wpd-advaced-options wpd-field-option">
36
  <small class="wpd-advaced-options-title"><?php esc_html_e("Advanced Options", "wpdiscuz"); ?></small>
37
  <div class="wpd-field-option wpd-advaced-options-cont">
@@ -51,14 +59,14 @@ class TextAreaField extends Field {
51
  }
52
 
53
  public function editCommentHtml($key, $value, $data, $comment) {
54
- if ($comment->comment_parent && !$data["is_show_sform"]) {
55
  return "";
56
  }
57
  $html = "<tr class='" . esc_attr($key) . "-wrapper wpd-edit-textarea'><td class='first'>";
58
  $html .= "<label for='" . esc_attr($key) . "'>" . esc_html($data["name"]) . ": </label>";
59
  $html .= "</td><td>";
60
  $html .= "<div class='wpdiscuz-item'>";
61
- $required = $data["required"] ? "required='required' aria-required='true'" : "";
62
  $html .= "<textarea $required class='wpd-field wpd-field-textarea' id='" . esc_attr($key) . "' name='" . esc_attr($key) . "'>" . esc_html($value) . "</textarea>";
63
  $html .= "</div>";
64
  $html .= "</td></tr>";
@@ -66,7 +74,7 @@ class TextAreaField extends Field {
66
  }
67
 
68
  public function frontFormHtml($name, $args, $options, $currentUser, $uniqueId, $isMainForm) {
69
- if (!$isMainForm && !$args["is_show_sform"]) {
70
  return;
71
  }
72
  ?>
@@ -82,6 +90,9 @@ class TextAreaField extends Field {
82
  }
83
 
84
  public function frontHtml($value, $args) {
 
 
 
85
  $html = "<div class='wpd-custom-field wpd-cf-text'>";
86
  $html .= "<div class='wpd-cf-label'>" . esc_html($args["name"]) . "</div> <div class='wpd-cf-value'> " . wp_kses(apply_filters("wpdiscuz_custom_field_textarea", nl2br($value), $args), wp_kses_allowed_html("post")) . "</div>";
87
  $html .= "</div>";
@@ -89,11 +100,8 @@ class TextAreaField extends Field {
89
  }
90
 
91
  public function validateFieldData($fieldName, $args, $options, $currentUser) {
92
- if (!$this->isCommentParentZero() && !$args["is_show_sform"]) {
93
- return "";
94
- }
95
  $value = Sanitizer::sanitize(INPUT_POST, $fieldName, "FILTER_SANITIZE_STRING");
96
- if (!$value && $args["required"]) {
97
  wp_die(esc_html__($args["name"], "wpdiscuz") . " : " . esc_html__("field is required!", "wpdiscuz"));
98
  }
99
  return $value;
32
  <label for="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]"><?php esc_html_e("Display on comment", "wpdiscuz"); ?>:</label>
33
  <input type="checkbox" value="1" <?php checked($this->fieldData["is_show_on_comment"], 1, true); ?> name="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]" id="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]" />
34
  </div>
35
+ <div class="wpd-field-option">
36
+ <label for="<?php echo esc_attr($this->fieldInputName); ?>[show_for_guests]"><?php esc_html_e("Display for Guests", "wpdiscuz"); ?>:</label>
37
+ <input type="checkbox" value="1" <?php checked($this->fieldData["show_for_guests"], 1, true); ?> name="<?php echo esc_attr($this->fieldInputName); ?>[show_for_guests]" id="<?php echo esc_attr($this->fieldInputName); ?>[show_for_guests]" />
38
+ </div>
39
+ <div class="wpd-field-option">
40
+ <label for="<?php echo esc_attr($this->fieldInputName); ?>[show_for_users]"><?php esc_html_e("Display for Registered Users", "wpdiscuz"); ?>:</label>
41
+ <input type="checkbox" value="1" <?php checked($this->fieldData["show_for_users"], 1, true); ?> name="<?php echo esc_attr($this->fieldInputName); ?>[show_for_users]" id="<?php echo esc_attr($this->fieldInputName); ?>[show_for_users]" />
42
+ </div>
43
  <div class="wpd-advaced-options wpd-field-option">
44
  <small class="wpd-advaced-options-title"><?php esc_html_e("Advanced Options", "wpdiscuz"); ?></small>
45
  <div class="wpd-field-option wpd-advaced-options-cont">
59
  }
60
 
61
  public function editCommentHtml($key, $value, $data, $comment) {
62
+ if (!$this->isShowForUser($data) || ($comment->comment_parent && !$data["is_show_sform"])) {
63
  return "";
64
  }
65
  $html = "<tr class='" . esc_attr($key) . "-wrapper wpd-edit-textarea'><td class='first'>";
66
  $html .= "<label for='" . esc_attr($key) . "'>" . esc_html($data["name"]) . ": </label>";
67
  $html .= "</td><td>";
68
  $html .= "<div class='wpdiscuz-item'>";
69
+ $required = $this->isValidateRequired($data) ? "required='required' aria-required='true'" : "";
70
  $html .= "<textarea $required class='wpd-field wpd-field-textarea' id='" . esc_attr($key) . "' name='" . esc_attr($key) . "'>" . esc_html($value) . "</textarea>";
71
  $html .= "</div>";
72
  $html .= "</td></tr>";
74
  }
75
 
76
  public function frontFormHtml($name, $args, $options, $currentUser, $uniqueId, $isMainForm) {
77
+ if (!$this->isShowForUser($args, $currentUser) || (!$isMainForm && !$args["is_show_sform"])) {
78
  return;
79
  }
80
  ?>
90
  }
91
 
92
  public function frontHtml($value, $args) {
93
+ if(!$this->isShowForUser($args)){
94
+ return "";
95
+ }
96
  $html = "<div class='wpd-custom-field wpd-cf-text'>";
97
  $html .= "<div class='wpd-cf-label'>" . esc_html($args["name"]) . "</div> <div class='wpd-cf-value'> " . wp_kses(apply_filters("wpdiscuz_custom_field_textarea", nl2br($value), $args), wp_kses_allowed_html("post")) . "</div>";
98
  $html .= "</div>";
100
  }
101
 
102
  public function validateFieldData($fieldName, $args, $options, $currentUser) {
 
 
 
103
  $value = Sanitizer::sanitize(INPUT_POST, $fieldName, "FILTER_SANITIZE_STRING");
104
+ if ($this->isValidateRequired($args, $currentUser) && !$value && $args["required"]) {
105
  wp_die(esc_html__($args["name"], "wpdiscuz") . " : " . esc_html__("field is required!", "wpdiscuz"));
106
  }
107
  return $value;
forms/wpdFormAttr/Field/TextField.php CHANGED
@@ -39,6 +39,14 @@ class TextField extends Field {
39
  <label for="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]"><?php esc_html_e("Display on comment", "wpdiscuz"); ?>:</label>
40
  <input type="checkbox" value="1" <?php checked($this->fieldData["is_show_on_comment"], 1, true); ?> name="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]" id="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]" />
41
  </div>
 
 
 
 
 
 
 
 
42
  <div class="wpd-advaced-options wpd-field-option">
43
  <small class="wpd-advaced-options-title"><?php esc_html_e("Advanced Options", "wpdiscuz"); ?></small>
44
  <div class="wpd-field-option wpd-advaced-options-cont">
@@ -58,14 +66,14 @@ class TextField extends Field {
58
  }
59
 
60
  public function editCommentHtml($key, $value, $data, $comment) {
61
- if ($comment->comment_parent && !$data["is_show_sform"]) {
62
  return "";
63
  }
64
  $html = "<tr class='" . esc_attr($key) . "-wrapper wpd-edit-text'><td class='first'>";
65
  $html .= "<label for='" . esc_attr($key) . "'>" . esc_html($data["name"]) . ": </label>";
66
  $html .= "</td><td>";
67
  $html .= "<div class='wpdiscuz-item'>";
68
- $required = $data["required"] ? "required='required' aria-required='true'" : "";
69
  $html .= "<input $required class='wpd-field wpd-field-text' type='text' id='" . esc_attr($key) . "' value='" . esc_attr($value) . "' name='" . esc_attr($key) . "'>";
70
  $html .= "</div>";
71
  $html .= "</td></tr >";
@@ -73,9 +81,10 @@ class TextField extends Field {
73
  }
74
 
75
  public function frontFormHtml($name, $args, $options, $currentUser, $uniqueId, $isMainForm) {
76
- if (!$isMainForm && !$args["is_show_sform"]) {
77
  return;
78
  }
 
79
  $hasIcon = $args["icon"] ? true : false;
80
  $hasDesc = $args["desc"] ? true : false;
81
  ?>
@@ -94,6 +103,9 @@ class TextField extends Field {
94
  }
95
 
96
  public function frontHtml($value, $args) {
 
 
 
97
  $html = "<div class='wpd-custom-field wpd-cf-text'>";
98
  $html .= "<div class='wpd-cf-label'>" . esc_html($args["name"]) . "</div> <div class='wpd-cf-value'> " . esc_html(apply_filters("wpdiscuz_custom_field_text", $value, $args)) . "</div>";
99
  $html .= "</div>";
@@ -101,11 +113,8 @@ class TextField extends Field {
101
  }
102
 
103
  public function validateFieldData($fieldName, $args, $options, $currentUser) {
104
- if (!$this->isCommentParentZero() && !$args["is_show_sform"]) {
105
- return "";
106
- }
107
  $value = Sanitizer::sanitize(INPUT_POST, $fieldName, "FILTER_SANITIZE_STRING");
108
- if (!$value && $args["required"]) {
109
  wp_die(esc_html__($args["name"], "wpdiscuz") . " : " . esc_html__("field is required!", "wpdiscuz"));
110
  }
111
  return $value;
39
  <label for="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]"><?php esc_html_e("Display on comment", "wpdiscuz"); ?>:</label>
40
  <input type="checkbox" value="1" <?php checked($this->fieldData["is_show_on_comment"], 1, true); ?> name="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]" id="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]" />
41
  </div>
42
+ <div class="wpd-field-option">
43
+ <label for="<?php echo esc_attr($this->fieldInputName); ?>[show_for_guests]"><?php esc_html_e("Display for Guests", "wpdiscuz"); ?>:</label>
44
+ <input type="checkbox" value="1" <?php checked($this->fieldData["show_for_guests"], 1, true); ?> name="<?php echo esc_attr($this->fieldInputName); ?>[show_for_guests]" id="<?php echo esc_attr($this->fieldInputName); ?>[show_for_guests]" />
45
+ </div>
46
+ <div class="wpd-field-option">
47
+ <label for="<?php echo esc_attr($this->fieldInputName); ?>[show_for_users]"><?php esc_html_e("Display for Registered Users", "wpdiscuz"); ?>:</label>
48
+ <input type="checkbox" value="1" <?php checked($this->fieldData["show_for_users"], 1, true); ?> name="<?php echo esc_attr($this->fieldInputName); ?>[show_for_users]" id="<?php echo esc_attr($this->fieldInputName); ?>[show_for_users]" />
49
+ </div>
50
  <div class="wpd-advaced-options wpd-field-option">
51
  <small class="wpd-advaced-options-title"><?php esc_html_e("Advanced Options", "wpdiscuz"); ?></small>
52
  <div class="wpd-field-option wpd-advaced-options-cont">
66
  }
67
 
68
  public function editCommentHtml($key, $value, $data, $comment) {
69
+ if (!$this->isShowForUser($data) || ($comment->comment_parent && !$data["is_show_sform"])) {
70
  return "";
71
  }
72
  $html = "<tr class='" . esc_attr($key) . "-wrapper wpd-edit-text'><td class='first'>";
73
  $html .= "<label for='" . esc_attr($key) . "'>" . esc_html($data["name"]) . ": </label>";
74
  $html .= "</td><td>";
75
  $html .= "<div class='wpdiscuz-item'>";
76
+ $required = $this->isValidateRequired($data) ? "required='required' aria-required='true'" : "";
77
  $html .= "<input $required class='wpd-field wpd-field-text' type='text' id='" . esc_attr($key) . "' value='" . esc_attr($value) . "' name='" . esc_attr($key) . "'>";
78
  $html .= "</div>";
79
  $html .= "</td></tr >";
81
  }
82
 
83
  public function frontFormHtml($name, $args, $options, $currentUser, $uniqueId, $isMainForm) {
84
+ if (!$this->isShowForUser($args, $currentUser) || (!$isMainForm && !$args["is_show_sform"])) {
85
  return;
86
  }
87
+
88
  $hasIcon = $args["icon"] ? true : false;
89
  $hasDesc = $args["desc"] ? true : false;
90
  ?>
103
  }
104
 
105
  public function frontHtml($value, $args) {
106
+ if(!$this->isShowForUser($args)){
107
+ return "";
108
+ }
109
  $html = "<div class='wpd-custom-field wpd-cf-text'>";
110
  $html .= "<div class='wpd-cf-label'>" . esc_html($args["name"]) . "</div> <div class='wpd-cf-value'> " . esc_html(apply_filters("wpdiscuz_custom_field_text", $value, $args)) . "</div>";
111
  $html .= "</div>";
113
  }
114
 
115
  public function validateFieldData($fieldName, $args, $options, $currentUser) {
 
 
 
116
  $value = Sanitizer::sanitize(INPUT_POST, $fieldName, "FILTER_SANITIZE_STRING");
117
+ if ($this->isValidateRequired($args, $currentUser) && !$value && $args["required"]) {
118
  wp_die(esc_html__($args["name"], "wpdiscuz") . " : " . esc_html__("field is required!", "wpdiscuz"));
119
  }
120
  return $value;
forms/wpdFormAttr/Field/UrlField.php CHANGED
@@ -39,6 +39,14 @@ class UrlField extends Field {
39
  <label for="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]"><?php esc_html_e("Display on comment", "wpdiscuz"); ?>:</label>
40
  <input type="checkbox" value="1" <?php checked($this->fieldData["is_show_on_comment"], 1, true); ?> name="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]" id="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]" />
41
  </div>
 
 
 
 
 
 
 
 
42
  <div class="wpd-advaced-options wpd-field-option">
43
  <small class="wpd-advaced-options-title"><?php esc_html_e("Advanced Options", "wpdiscuz"); ?></small>
44
  <div class="wpd-field-option wpd-advaced-options-cont">
@@ -58,14 +66,14 @@ class UrlField extends Field {
58
  }
59
 
60
  public function editCommentHtml($key, $value, $data, $comment) {
61
- if ($comment->comment_parent && !$data["is_show_sform"]) {
62
  return "";
63
  }
64
  $html = "<tr class='" . esc_attr($key) . "-wrapper wpd-edit-url'><td class='first'>";
65
  $html .= "<label for='" . esc_attr($key) . "'>" . esc_html($data["name"]) . ": </label>";
66
  $html .= "</td><td>";
67
  $html .= "<div class='wpdiscuz-item'>";
68
- $required = $data["required"] ? "required='required' aria-required='true'" : "";
69
  $html .= "<input $required class='wpd-field' type='url' id='" . esc_attr($key) . "' value='" . esc_attr($value) . "' name='" . esc_attr($key) . "'>";
70
  $html .= "</div>";
71
  $html .= "</td></tr>";
@@ -73,7 +81,7 @@ class UrlField extends Field {
73
  }
74
 
75
  public function frontFormHtml($name, $args, $options, $currentUser, $uniqueId, $isMainForm) {
76
- if (!$isMainForm && !$args["is_show_sform"]) {
77
  return;
78
  }
79
  $hasIcon = $args["icon"] ? true : false;
@@ -103,6 +111,9 @@ class UrlField extends Field {
103
  }
104
 
105
  public function frontHtml($value, $args) {
 
 
 
106
  $html = "<div class='wpd-custom-field wpd-cf-text'>";
107
  $value = apply_filters("wpdiscuz_custom_field_url", $value, $args);
108
  $html .= "<div class='wpd-cf-label'>" . esc_html($args["name"]) . "</div> <div class='wpd-cf-value'> <a href='" . esc_url_raw($value) . "' target='_blank'>" . esc_url_raw($value) . "</a></div>";
@@ -111,11 +122,8 @@ class UrlField extends Field {
111
  }
112
 
113
  public function validateFieldData($fieldName, $args, $options, $currentUser) {
114
- if (!$this->isCommentParentZero() && !$args["is_show_sform"]) {
115
- return "";
116
- }
117
  $value = Sanitizer::sanitize(INPUT_POST, $fieldName, "FILTER_SANITIZE_STRING");
118
- if (!$value && $args["required"]) {
119
  wp_die(esc_html__($args["name"], "wpdiscuz") . " : " . esc_html__("field is required!", "wpdiscuz"));
120
  }
121
  return $value;
39
  <label for="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]"><?php esc_html_e("Display on comment", "wpdiscuz"); ?>:</label>
40
  <input type="checkbox" value="1" <?php checked($this->fieldData["is_show_on_comment"], 1, true); ?> name="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]" id="<?php echo esc_attr($this->fieldInputName); ?>[is_show_on_comment]" />
41
  </div>
42
+ <div class="wpd-field-option">
43
+ <label for="<?php echo esc_attr($this->fieldInputName); ?>[show_for_guests]"><?php esc_html_e("Display for Guests", "wpdiscuz"); ?>:</label>
44
+ <input type="checkbox" value="1" <?php checked($this->fieldData["show_for_guests"], 1, true); ?> name="<?php echo esc_attr($this->fieldInputName); ?>[show_for_guests]" id="<?php echo esc_attr($this->fieldInputName); ?>[show_for_guests]" />
45
+ </div>
46
+ <div class="wpd-field-option">
47
+ <label for="<?php echo esc_attr($this->fieldInputName); ?>[show_for_users]"><?php esc_html_e("Display for Registered Users", "wpdiscuz"); ?>:</label>
48
+ <input type="checkbox" value="1" <?php checked($this->fieldData["show_for_users"], 1, true); ?> name="<?php echo esc_attr($this->fieldInputName); ?>[show_for_users]" id="<?php echo esc_attr($this->fieldInputName); ?>[show_for_users]" />
49
+ </div>
50
  <div class="wpd-advaced-options wpd-field-option">
51
  <small class="wpd-advaced-options-title"><?php esc_html_e("Advanced Options", "wpdiscuz"); ?></small>
52
  <div class="wpd-field-option wpd-advaced-options-cont">
66
  }
67
 
68
  public function editCommentHtml($key, $value, $data, $comment) {
69
+ if (!$this->isShowForUser($data) || ($comment->comment_parent && !$data["is_show_sform"])) {
70
  return "";
71
  }
72
  $html = "<tr class='" . esc_attr($key) . "-wrapper wpd-edit-url'><td class='first'>";
73
  $html .= "<label for='" . esc_attr($key) . "'>" . esc_html($data["name"]) . ": </label>";
74
  $html .= "</td><td>";
75
  $html .= "<div class='wpdiscuz-item'>";
76
+ $required = $this->isValidateRequired($data) ? "required='required' aria-required='true'" : "";
77
  $html .= "<input $required class='wpd-field' type='url' id='" . esc_attr($key) . "' value='" . esc_attr($value) . "' name='" . esc_attr($key) . "'>";
78
  $html .= "</div>";
79
  $html .= "</td></tr>";
81
  }
82
 
83
  public function frontFormHtml($name, $args, $options, $currentUser, $uniqueId, $isMainForm) {
84
+ if (!$this->isShowForUser($args, $currentUser) || (!$isMainForm && !$args["is_show_sform"])) {
85
  return;
86
  }
87
  $hasIcon = $args["icon"] ? true : false;
111
  }
112
 
113
  public function frontHtml($value, $args) {
114
+ if(!$this->isShowForUser($args)){
115
+ return "";
116
+ }
117
  $html = "<div class='wpd-custom-field wpd-cf-text'>";
118
  $value = apply_filters("wpdiscuz_custom_field_url", $value, $args);
119
  $html .= "<div class='wpd-cf-label'>" . esc_html($args["name"]) . "</div> <div class='wpd-cf-value'> <a href='" . esc_url_raw($value) . "' target='_blank'>" . esc_url_raw($value) . "</a></div>";
122
  }
123
 
124
  public function validateFieldData($fieldName, $args, $options, $currentUser) {
 
 
 
125
  $value = Sanitizer::sanitize(INPUT_POST, $fieldName, "FILTER_SANITIZE_STRING");
126
+ if ($this->isValidateRequired($args, $currentUser) && !$value && $args["required"]) {
127
  wp_die(esc_html__($args["name"], "wpdiscuz") . " : " . esc_html__("field is required!", "wpdiscuz"));
128
  }
129
  return $value;
forms/wpdFormAttr/Form.php CHANGED
@@ -596,7 +596,7 @@ class Form {
596
 
597
  private function validateGeneralOptions($options) {
598
  $validData = [
599
- "lang" => get_locale(),
600
  "roles_cannot_see_comments" => [],
601
  "guest_can_see_comments" => 1,
602
  "roles_cannot_comment" => [],
@@ -782,7 +782,7 @@ class Form {
782
  return $html;
783
  }
784
 
785
- public function renderFrontForm($isMain, $uniqueId, $commentsCount, $currentUser) {
786
  $message = "";
787
  ?>
788
  <div class="wpd-form wpd-form-wrapper <?php echo !$isMain ? "wpd-secondary-form-wrapper" : "wpd-main-form-wrapper"; ?>" <?php echo !$isMain ? "id='wpd-secondary-form-wrapper-" . esc_attr($uniqueId) . "' style='display: none;'" : "id='wpd-main-form-wrapper-" . esc_attr($uniqueId) . "'"; ?>>
@@ -831,6 +831,7 @@ class Form {
831
  ?>
832
  <input type="hidden" class="wpdiscuz_unique_id" value="<?php echo esc_attr($uniqueId); ?>"
833
  name="wpdiscuz_unique_id">
 
834
  </form>
835
  <?php
836
  }
@@ -847,7 +848,7 @@ class Form {
847
  <div id="wpd-editor-char-counter-<?php echo esc_attr($uniqueId); ?>"
848
  class="wpd-editor-char-counter"></div>
849
  <label style="display: none;" for="wc-textarea-<?php echo esc_attr($uniqueId); ?>">Label</label>
850
- <textarea id="wc-textarea-<?php echo esc_attr($uniqueId); ?>" required name="wc_comment"
851
  class="wc_comment wpd-field"></textarea>
852
  <div id="wpd-editor-<?php echo esc_attr($uniqueId); ?>"></div>
853
  <?php $this->renderTextEditorButtons($uniqueId); ?>
@@ -875,7 +876,7 @@ class Form {
875
  <label style="display: none;" for="wc-textarea-<?php echo esc_attr($uniqueId); ?>">Label</label>
876
  <textarea
877
  id="wc-textarea-<?php echo esc_attr($uniqueId); ?>" <?php echo $commentTextLengthRange . ' ' . $textareaMaxLength; ?> placeholder="<?php echo esc_attr($textarea_placeholder); ?>"
878
- aria-label="<?php echo esc_attr($textarea_placeholder); ?>" required name="wc_comment"
879
  class="wc_comment wpd-field"></textarea>
880
  </div>
881
  <div class="wpd-editor-buttons-right">
@@ -969,6 +970,9 @@ class Form {
969
  }
970
  $html .= "<input type='hidden' name='wpdiscuz_unique_id' value='" . esc_attr($uniqueId) . "'>";
971
  $html .= "<div class='wc_save_wrap'><input class='wc_cancel_edit wpd-second-button' type='button' value='" . esc_attr($this->wpdOptions->getPhrase("wc_comment_edit_cancel_button", ["comment" => $comment])) . "'><input id='wpd-field-submit-edit_" . esc_attr($uniqueId) . "' class='wc_save_edited_comment wpd-prim-button' type='submit' value='" . esc_attr($this->wpdOptions->getPhrase("wc_comment_edit_save_button", ["comment" => $comment])) . "'></div>";
 
 
 
972
  $html .= "</form></div>";
973
  return wp_send_json_success(['html' => $html, 'content' => $content]);
974
  }
@@ -1054,7 +1058,7 @@ class Form {
1054
  <?php esc_html_e("Language", "wpdiscuz"); ?>
1055
  </th>
1056
  <td>
1057
- <?php $lang = isset($this->generalOptions["lang"]) ? $this->generalOptions["lang"] : get_locale(); ?>
1058
  <input required="" type="text"
1059
  name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[lang]"
1060
  value="<?php echo htmlentities($lang, ENT_QUOTES); ?>">
596
 
597
  private function validateGeneralOptions($options) {
598
  $validData = [
599
+ "lang" => get_user_locale(),
600
  "roles_cannot_see_comments" => [],
601
  "guest_can_see_comments" => 1,
602
  "roles_cannot_comment" => [],
782
  return $html;
783
  }
784
 
785
+ public function renderFrontForm($isMain, $uniqueId, $commentsCount, $currentUser, $postID) {
786
  $message = "";
787
  ?>
788
  <div class="wpd-form wpd-form-wrapper <?php echo !$isMain ? "wpd-secondary-form-wrapper" : "wpd-main-form-wrapper"; ?>" <?php echo !$isMain ? "id='wpd-secondary-form-wrapper-" . esc_attr($uniqueId) . "' style='display: none;'" : "id='wpd-main-form-wrapper-" . esc_attr($uniqueId) . "'"; ?>>
831
  ?>
832
  <input type="hidden" class="wpdiscuz_unique_id" value="<?php echo esc_attr($uniqueId); ?>"
833
  name="wpdiscuz_unique_id">
834
+ <?php do_action( 'comment_form', $postID);?>
835
  </form>
836
  <?php
837
  }
848
  <div id="wpd-editor-char-counter-<?php echo esc_attr($uniqueId); ?>"
849
  class="wpd-editor-char-counter"></div>
850
  <label style="display: none;" for="wc-textarea-<?php echo esc_attr($uniqueId); ?>">Label</label>
851
+ <textarea id="wc-textarea-<?php echo esc_attr($uniqueId); ?>" name="wc_comment"
852
  class="wc_comment wpd-field"></textarea>
853
  <div id="wpd-editor-<?php echo esc_attr($uniqueId); ?>"></div>
854
  <?php $this->renderTextEditorButtons($uniqueId); ?>
876
  <label style="display: none;" for="wc-textarea-<?php echo esc_attr($uniqueId); ?>">Label</label>
877
  <textarea
878
  id="wc-textarea-<?php echo esc_attr($uniqueId); ?>" <?php echo $commentTextLengthRange . ' ' . $textareaMaxLength; ?> placeholder="<?php echo esc_attr($textarea_placeholder); ?>"
879
+ aria-label="<?php echo esc_attr($textarea_placeholder); ?>" name="wc_comment"
880
  class="wc_comment wpd-field"></textarea>
881
  </div>
882
  <div class="wpd-editor-buttons-right">
970
  }
971
  $html .= "<input type='hidden' name='wpdiscuz_unique_id' value='" . esc_attr($uniqueId) . "'>";
972
  $html .= "<div class='wc_save_wrap'><input class='wc_cancel_edit wpd-second-button' type='button' value='" . esc_attr($this->wpdOptions->getPhrase("wc_comment_edit_cancel_button", ["comment" => $comment])) . "'><input id='wpd-field-submit-edit_" . esc_attr($uniqueId) . "' class='wc_save_edited_comment wpd-prim-button' type='submit' value='" . esc_attr($this->wpdOptions->getPhrase("wc_comment_edit_save_button", ["comment" => $comment])) . "'></div>";
973
+ ob_start();
974
+ do_action("comment_form", $comment->comment_post_ID);
975
+ $html .= ob_get_clean();
976
  $html .= "</form></div>";
977
  return wp_send_json_success(['html' => $html, 'content' => $content]);
978
  }
1058
  <?php esc_html_e("Language", "wpdiscuz"); ?>
1059
  </th>
1060
  <td>
1061
+ <?php $lang = isset($this->generalOptions["lang"]) ? $this->generalOptions["lang"] : get_user_locale(); ?>
1062
  <input required="" type="text"
1063
  name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[lang]"
1064
  value="<?php echo htmlentities($lang, ENT_QUOTES); ?>">
forms/wpdFormAttr/Login/SocialLogin.php CHANGED
@@ -215,7 +215,7 @@ class SocialLogin {
215
  }
216
  $token = $fbAccesTokenData["access_token"];
217
  $appsecret_proof = hash_hmac("sha256", $token, trim($this->generalOptions->social["fbAppSecret"]));
218
- $fbGetUserDataURL = add_query_arg(["fields" => "id,first_name,last_name,picture,email", "access_token" => $token, "appsecret_proof" => $appsecret_proof], "https://graph.facebook.com/v7.0/me");
219
  $getFbUserResponse = wp_remote_get($fbGetUserDataURL);
220
  if (is_wp_error($getFbUserResponse)) {
221
  $this->redirect($postID, $getFbUserResponse->get_error_message());
215
  }
216
  $token = $fbAccesTokenData["access_token"];
217
  $appsecret_proof = hash_hmac("sha256", $token, trim($this->generalOptions->social["fbAppSecret"]));
218
+ $fbGetUserDataURL = add_query_arg(["fields" => "id,first_name,last_name,email", "access_token" => $token, "appsecret_proof" => $appsecret_proof], "https://graph.facebook.com/v7.0/me");
219
  $getFbUserResponse = wp_remote_get($fbGetUserDataURL);
220
  if (is_wp_error($getFbUserResponse)) {
221
  $this->redirect($postID, $getFbUserResponse->get_error_message());
options/class.WpdiscuzOptions.php CHANGED
@@ -1573,8 +1573,8 @@ class WpdiscuzOptions implements WpDiscuzConstants {
1573
  $this->moderation["commentRestrictionType"] = isset($_POST[self::TAB_MODERATION]["commentRestrictionType"]) ? trim(sanitize_text_field($_POST[self::TAB_MODERATION]["commentRestrictionType"])) : "both";
1574
  $this->moderation["userCommentsLimit"] = isset($_POST[self::TAB_MODERATION]["userCommentsLimit"]) ? absint($_POST[self::TAB_MODERATION]["userCommentsLimit"]) : 1;
1575
  } else if (self::TAB_CONTENT === $_POST["wpd_tab"]) {
1576
- $this->content["commentTextMinLength"] = isset($_POST[self::TAB_CONTENT]["commentTextMinLength"]) && absint($_POST[self::TAB_CONTENT]["commentTextMinLength"]) > 0 ? absint($_POST[self::TAB_CONTENT]["commentTextMinLength"]) : 1;
1577
- $this->content["replyTextMinLength"] = isset($_POST[self::TAB_CONTENT]["replyTextMinLength"]) && absint($_POST[self::TAB_CONTENT]["replyTextMinLength"]) > 0 ? absint($_POST[self::TAB_CONTENT]["replyTextMinLength"]) : 1;
1578
  $this->content["commentTextMaxLength"] = isset($_POST[self::TAB_CONTENT]["commentTextMaxLength"]) && absint($_POST[self::TAB_CONTENT]["commentTextMaxLength"]) > 0 ? absint($_POST[self::TAB_CONTENT]["commentTextMaxLength"]) : "";
1579
  $this->content["replyTextMaxLength"] = isset($_POST[self::TAB_CONTENT]["replyTextMaxLength"]) && absint($_POST[self::TAB_CONTENT]["replyTextMaxLength"]) > 0 ? absint($_POST[self::TAB_CONTENT]["replyTextMaxLength"]) : "";
1580
  $this->content["enableImageConversion"] = isset($_POST[self::TAB_CONTENT]["enableImageConversion"]) ? absint($_POST[self::TAB_CONTENT]["enableImageConversion"]) : 0;
1573
  $this->moderation["commentRestrictionType"] = isset($_POST[self::TAB_MODERATION]["commentRestrictionType"]) ? trim(sanitize_text_field($_POST[self::TAB_MODERATION]["commentRestrictionType"])) : "both";
1574
  $this->moderation["userCommentsLimit"] = isset($_POST[self::TAB_MODERATION]["userCommentsLimit"]) ? absint($_POST[self::TAB_MODERATION]["userCommentsLimit"]) : 1;
1575
  } else if (self::TAB_CONTENT === $_POST["wpd_tab"]) {
1576
+ $this->content["commentTextMinLength"] = isset($_POST[self::TAB_CONTENT]["commentTextMinLength"]) && absint($_POST[self::TAB_CONTENT]["commentTextMinLength"]) > 0 ? absint($_POST[self::TAB_CONTENT]["commentTextMinLength"]) : 0;
1577
+ $this->content["replyTextMinLength"] = isset($_POST[self::TAB_CONTENT]["replyTextMinLength"]) && absint($_POST[self::TAB_CONTENT]["replyTextMinLength"]) > 0 ? absint($_POST[self::TAB_CONTENT]["replyTextMinLength"]) : 0;
1578
  $this->content["commentTextMaxLength"] = isset($_POST[self::TAB_CONTENT]["commentTextMaxLength"]) && absint($_POST[self::TAB_CONTENT]["commentTextMaxLength"]) > 0 ? absint($_POST[self::TAB_CONTENT]["commentTextMaxLength"]) : "";
1579
  $this->content["replyTextMaxLength"] = isset($_POST[self::TAB_CONTENT]["replyTextMaxLength"]) && absint($_POST[self::TAB_CONTENT]["replyTextMaxLength"]) > 0 ? absint($_POST[self::TAB_CONTENT]["replyTextMaxLength"]) : "";
1580
  $this->content["enableImageConversion"] = isset($_POST[self::TAB_CONTENT]["enableImageConversion"]) ? absint($_POST[self::TAB_CONTENT]["enableImageConversion"]) : 0;
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: gVectors Team
3
  Tags: comment, comments, ajax comments, comment form, comment fields
4
  Requires at least: 5.0
5
  Tested up to: 6.0
6
- Stable tag: 7.3.20
7
  Requires PHP: 5.6 and higher
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
@@ -185,6 +185,20 @@ Nothing will be lost! **Comments - wpDiscuz** will show all old comments.
185
 
186
  == Changelog ==
187
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
188
  = Comments - wpDiscuz v7.3.20 - 20.07.2022 =
189
 
190
  * Fixed bug: document.querySelectorAll().forEach is not a function. (old browsers)
@@ -194,11 +208,6 @@ Nothing will be lost! **Comments - wpDiscuz** will show all old comments.
194
  * Added: Template function to get all options - wpdiscuzGetOptions()
195
  * Added: Template function to get single option by key / (tab optional) - wpDiscuzGetOption($key, $tab)
196
 
197
-
198
- **IMPORTANT!**
199
-
200
- * Please don't forget delete all caches and purge CDN after the update.
201
-
202
  = Comments - wpDiscuz v7.3.19 - 15.06.2022 =
203
 
204
  * Fixed bug: Uncaught TypeError: array_key_exists()
3
  Tags: comment, comments, ajax comments, comment form, comment fields
4
  Requires at least: 5.0
5
  Tested up to: 6.0
6
+ Stable tag: 7.4
7
  Requires PHP: 5.6 and higher
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
185
 
186
  == Changelog ==
187
 
188
+ = Comments - wpDiscuz v7.4 - 09.08.2022 =
189
+
190
+ * Added: Fields displaying options (logged-in users | guests)
191
+ * Added: Allowing empty comments using a hook - 'allow_empty_comment'
192
+ * Fixed Bug: Supporting plus(+) sign in name or email fields
193
+ * Fixed Bug: Some of the field(s) are invalid unknown error
194
+ * Fixed Bug: Getting comment form in correct locale set by user
195
+ * Fixed Bug: Compatibility with Akismet plugin (on edit comment)
196
+
197
+
198
+ **IMPORTANT!**
199
+
200
+ * Please don't forget delete all caches and purge CDN after the update.
201
+
202
  = Comments - wpDiscuz v7.3.20 - 20.07.2022 =
203
 
204
  * Fixed bug: document.querySelectorAll().forEach is not a function. (old browsers)
208
  * Added: Template function to get all options - wpdiscuzGetOptions()
209
  * Added: Template function to get single option by key / (tab optional) - wpDiscuzGetOption($key, $tab)
210
 
 
 
 
 
 
211
  = Comments - wpDiscuz v7.3.19 - 15.06.2022 =
212
 
213
  * Fixed bug: Uncaught TypeError: array_key_exists()
utils/class.WpdiscuzHelper.php CHANGED
@@ -223,7 +223,7 @@ class WpdiscuzHelper implements WpDiscuzConstants {
223
  public function isCommentEditable($comment) {
224
  $commentTimestamp = strtotime($comment->comment_date);
225
  $timeDiff = self::$current_time - $commentTimestamp;
226
- $editableTimeLimit = $this->options->moderation["commentEditableTime"] === "unlimit" ? abs($timeDiff) + 1 : intval($this->options->moderation["commentEditableTime"]);
227
  return apply_filters("wpdiscuz_is_comment_editable", $editableTimeLimit && ($timeDiff < $editableTimeLimit), $comment);
228
  }
229
 
@@ -240,7 +240,7 @@ class WpdiscuzHelper implements WpDiscuzConstants {
240
  }
241
  $commentContent = trim(strip_tags($commentContent));
242
  $contentLength = function_exists("mb_strlen") ? mb_strlen($commentContent) : strlen($commentContent);
243
- return ($commentMinLength && $contentLength >= $commentMinLength) && ($commentMaxLength == 0 || $contentLength <= $commentMaxLength);
244
  }
245
 
246
  /**
223
  public function isCommentEditable($comment) {
224
  $commentTimestamp = strtotime($comment->comment_date);
225
  $timeDiff = self::$current_time - $commentTimestamp;
226
+ $editableTimeLimit = $this->options->moderation["commentEditableTime"] === "unlimit" ? abs($timeDiff) + 100 : intval($this->options->moderation["commentEditableTime"]);
227
  return apply_filters("wpdiscuz_is_comment_editable", $editableTimeLimit && ($timeDiff < $editableTimeLimit), $comment);
228
  }
229
 
240
  }
241
  $commentContent = trim(strip_tags($commentContent));
242
  $contentLength = function_exists("mb_strlen") ? mb_strlen($commentContent) : strlen($commentContent);
243
+ return ($contentLength >= $commentMinLength) && ($commentMaxLength == 0 || $contentLength <= $commentMaxLength);
244
  }
245
 
246
  /**
utils/class.WpdiscuzHelperAjax.php CHANGED
@@ -792,7 +792,7 @@ class WpdiscuzHelperAjax implements WpDiscuzConstants {
792
  if ($form->isUserCanComment($currentUser, $post_id)) {
793
  $response = "<div class='wpd-inline-form'>";
794
  $response .= "<form method='post' class='wpd_inline_comm_form' autocomplete='off'>";
795
- $response .= "<textarea name='wpd_inline_comment' class='wpd-inline-comment-content' placeholder='" . esc_attr($this->options->getPhrase("wc_inline_form_comment")) . "' required='required'></textarea>";
796
  $response .= "<label class='wpd-inline-notification'><input name='wpd_inline_notify_me' class='wpd-inline-notify-me' type='checkbox' value='1' />&nbsp;" . esc_html($this->options->getPhrase("wc_inline_form_notify")) . '</label>';
797
  $response .= "<div class='wpd-inline-form-second-row'>";
798
  if (empty($currentUser->ID)) {
792
  if ($form->isUserCanComment($currentUser, $post_id)) {
793
  $response = "<div class='wpd-inline-form'>";
794
  $response .= "<form method='post' class='wpd_inline_comm_form' autocomplete='off'>";
795
+ $response .= "<textarea name='wpd_inline_comment' class='wpd-inline-comment-content' placeholder='" . esc_attr($this->options->getPhrase("wc_inline_form_comment")) . "'></textarea>";
796
  $response .= "<label class='wpd-inline-notification'><input name='wpd_inline_notify_me' class='wpd-inline-notify-me' type='checkbox' value='1' />&nbsp;" . esc_html($this->options->getPhrase("wc_inline_form_notify")) . '</label>';
797
  $response .= "<div class='wpd-inline-form-second-row'>";
798
  if (empty($currentUser->ID)) {
utils/class.WpdiscuzHelperUpload.php CHANGED
@@ -799,12 +799,14 @@ class WpdiscuzHelperUpload implements WpDiscuzConstants {
799
  $attachments = get_posts([
800
  "post_type" => "attachment",
801
  "posts_per_page" => apply_filters("wpdiscuz_delete_unattached_files_limit", 20),
 
802
  "date_query" => [
803
  [
804
  "column" => "post_date_gmt",
805
  "before" => "30 minutes ago",
806
  ],
807
  ],
 
808
  "meta_query" => [
809
  [
810
  "key" => self::METAKEY_ATTCHMENT_COMMENT_ID,
799
  $attachments = get_posts([
800
  "post_type" => "attachment",
801
  "posts_per_page" => apply_filters("wpdiscuz_delete_unattached_files_limit", 20),
802
+ /*
803
  "date_query" => [
804
  [
805
  "column" => "post_date_gmt",
806
  "before" => "30 minutes ago",
807
  ],
808
  ],
809
+ */
810
  "meta_query" => [
811
  [
812
  "key" => self::METAKEY_ATTCHMENT_COMMENT_ID,