Comments – wpDiscuz - Version 7.5

Version Description

Download this release

Release Info

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

Code changes from version 7.4.2 to 7.5

assets/js/wpdiscuz-combo-no_quill.min.js CHANGED
@@ -3,11 +3,11 @@
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 */
10
- jQuery(document).ready(function($){if($("body").on("click","#wpdcom .wmu-upload-wrap",function(){$(".wpd-form-foot",$(this).parents(".wpd_comm_form")).slideDown(parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0)}),$("body").on("change",".wmu-add-files",function(){var a=$(this),c=a.parents(".wpd_comm_form"),b=a[0].files?a[0].files:[];b.length&&function(c,b,e){b.attr("data-uploading","true");var a=new FormData;a.append("action","wmuUploadFiles"),a.append("wmuAttachmentsData",$(".wmu-attachments-data",b).val()),a.append("uniqueId",b.find(".wpdiscuz_unique_id").val());var d=0;$.each(e,function(c,b){d+=b.size,a.append(wpdiscuzAjaxObj.wmuInput+"["+c+"]",b)}),d>parseInt(wpdiscuzAjaxObj.wmuMaxFileSize)?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhraseMaxFileSize,"wmuPhraseMaxFileSize",c),"error",3e3):d>parseInt(wpdiscuzAjaxObj.wmuPostMaxSize)?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhrasePostMaxSize,"wmuPhrasePostMaxSize",c),"error",3e3):wpdiscuzAjaxObj.getAjaxObj(!0,!0,a).done(function(a){var d,c;a.success?($(".wmu-attached-data-info",b).remove(),$(".wmu-add-files",b).after(a.data.attachmentsHtml),a.data.tooltip&&$(".wmu-upload-wrap",b).attr("wpd-tooltip",a.data.tooltip),d=b,c=a,$.each(c.data.previewsData,function(a,b){$(".wmu-action-wrap .wmu-"+a+"-tab",d).html(""),$.each(b,function(i,c){var g=c.id,e="",h=c.fullname,f=c.shortname;a==wpdiscuzAjaxObj.wmuKeyImages?(e=c.url,f=""):a==wpdiscuzAjaxObj.wmuKeyVideos?e=wpdiscuzAjaxObj.wmuIconVideo:a==wpdiscuzAjaxObj.wmuKeyFiles&&(e=wpdiscuzAjaxObj.wmuIconFile);var b='<div class="wmu-preview [PREVIEW_TYPE_CLASS]" title="[PREVIEW_TITLE]" data-wmu-type="[PREVIEW_TYPE]" data-wmu-attachment="[PREVIEW_ID]"><div class="wmu-preview-remove"><img class="wmu-preview-img" src="[PREVIEW_ICON]"><div class="wmu-file-name">[PREVIEW_FILENAME]</div><div class="wmu-delete">&nbsp;</div></div></div>';b=(b=(b=(b=(b=(b=b.replace("[PREVIEW_TYPE_CLASS]","wmu-preview-"+a)).replace("[PREVIEW_TITLE]",h)).replace("[PREVIEW_TYPE]",a)).replace("[PREVIEW_ID]",g)).replace("[PREVIEW_ICON]",e)).replace("[PREVIEW_FILENAME]",f),$(".wmu-action-wrap .wmu-"+a+"-tab",d).removeClass("wmu-hide").append(b)})}),a.data.errors&&(wpdiscuzAjaxObj.setCommentMessage(a.data.errors,"error",3e3),console.log(a.data.errors))):a.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data.errorCode],a.data.errorCode,b),"error",3e3):a.data.error&&wpdiscuzAjaxObj.setCommentMessage(a.data.error,"error",3e3),$("#wpdiscuz-loading-bar").fadeOut(250),b.attr("data-uploading","false")}).fail(function(c,d,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250),b.attr("data-uploading","false")})}(a,c,b)}),$("body").on("click",".wmu-attachment-delete",function(c){if(confirm(wpdiscuzAjaxObj.wmuPhraseConfirmDelete)){var b=$(this).data("wmu-attachment"),a=new FormData;a.append("action","wmuDeleteAttachment"),a.append("attachmentId",b),wpdiscuzAjaxObj.getAjaxObj(!0,!0,a).done(function(c){if(c.success){var a=$(".wmu-attachment-"+b).parents(".wmu-comment-attachments");$(".wmu-attachment-"+b).remove(),$(".wmu-attached-images *",a).length||$(".wmu-attached-images",a).remove(),$(".wmu-attached-videos *",a).length||$(".wmu-attached-videos",a).remove(),$(".wmu-attached-files *",a).length||$(".wmu-attached-files",a).remove()}else c.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[c.data.errorCode],c.data.errorCode,a),"error",3e3):c.data.error&&wpdiscuzAjaxObj.setCommentMessage(c.data.error,"error",3e3);$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}else console.log("canceled")}),$("body").on("click",".wmu-preview",function(){var b=$(this),c=b.parents(".wpd_comm_form");b.data("wmu-type");var d=b.data("wmu-attachment"),a=new FormData;a.append("action","wmuRemoveAttachmentPreview"),a.append("attachmentId",d),a.append("wmuAttachmentsData",$(".wmu-attachments-data",c).val()),a.append("uniqueId",c.find(".wpdiscuz_unique_id").val()),wpdiscuzAjaxObj.getAjaxObj(!0,!0,a).done(function(a){if(a.success){b.remove();var d=$(".wmu-tabs",c);$.each(d,function(b,a){$(".wmu-preview",a).length?$(a).removeClass("wmu-hide"):$(a).addClass("wmu-hide")}),$(".wmu-attached-data-info",c).remove(),$(".wmu-add-files",c).after(a.data.attachmentsHtml),a.data.tooltip&&$(".wmu-upload-wrap",c).attr("wpd-tooltip",a.data.tooltip)}else a.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data.errorCode],a.data.errorCode,c),"error",3e3):a.data.error&&wpdiscuzAjaxObj.setCommentMessage(a.data.error,"error",3e3);$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),parseInt(wpdiscuzAjaxObj.wmuIsLightbox)){function a(){$(".wmu-lightbox").colorbox({maxHeight:"95%",maxWidth:"95%",rel:"wmu-lightbox",fixed:!0})}a(),wpdiscuzAjaxObj.wmuAddLightBox=a}wpdiscuzAjaxObj.wmuHideAll=function(a,b){"object"==typeof a?a.success?($(".wmu-tabs",b).addClass("wmu-hide"),$(".wmu-preview",b).remove(),$(".wmu-attached-data-info",b).remove()):console.log(a.data):console.log(a)}})
11
  /* Lity */
12
  !function(e,t){"function"==typeof define&&define.amd?define(["jquery"],function(n){return t(e,n)}):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(e,require("jquery")):e.lity=t(e,e.jQuery||e.Zepto)}("undefined"!=typeof window?window:this,function(e,t){"use strict";var n=e.document,i=t(e),r=t.Deferred,o=t("html"),a=[],l="aria-hidden",s="lity-"+l,d='a[href],area[href],input:not([disabled]),select:not([disabled]),textarea:not([disabled]),button:not([disabled]),iframe,object,embed,[contenteditable],[tabindex]:not([tabindex^="-"])',c={esc:!0,handler:null,handlers:{image:C,inline:function(e,n){var i,r,o;try{i=t(e)}catch(e){return!1}if(!i.length)return!1;return r=t('<i style="display:none !important"/>'),o=i.hasClass("lity-hide"),n.element().one("lity:remove",function(){r.before(i).remove(),o&&!i.closest(".lity-content").length&&i.addClass("lity-hide")}),i.removeClass("lity-hide").after(r)},youtube:function(e){var n=f.exec(e);if(!n)return!1;return k(x(e,w("https://www.youtube"+(n[2]||"")+".com/embed/"+n[4],t.extend({autoplay:1},b(n[5]||"")))))},vimeo:function(e){var n=y.exec(e);if(!n)return!1;return k(x(e,w("https://player.vimeo.com/video/"+n[3],t.extend({autoplay:1},b(n[4]||"")))))},googlemaps:function(e){var t=v.exec(e);if(!t)return!1;return k(x(e,w("https://www.google."+t[3]+"/maps?"+t[6],{output:t[6].indexOf("layer=c")>0?"svembed":"embed"})))},facebookvideo:function(e){var n=p.exec(e);if(!n)return!1;0!==e.indexOf("http")&&(e="https:"+e);return k(x(e,w("https://www.facebook.com/plugins/video.php?href="+e,t.extend({autoplay:1},b(n[4]||"")))))},iframe:k},template:'<div class="lity" role="dialog" aria-label="Dialog Window (Press escape to close)" tabindex="-1"><div class="lity-wrap" data-lity-close role="document"><div class="lity-loader" aria-hidden="true">Loading...</div><div class="lity-container"><div class="lity-content"></div><button class="lity-close" type="button" aria-label="Close (Press escape to close)" data-lity-close>&times;</button></div></div></div>'},u=/(^data:image\/)|(\.(png|jpe?g|gif|svg|webp|bmp|ico|tiff?)(\?\S*)?$)/i,f=/(youtube(-nocookie)?\.com|youtu\.be)\/(watch\?v=|v\/|u\/|embed\/?)?([\w-]{11})(.*)?/i,y=/(vimeo(pro)?.com)\/(?:[^\d]+)?(\d+)\??(.*)?$/,v=/((maps|www)\.)?google\.([^\/\?]+)\/?((maps\/?)?\?)(.*)/i,p=/(facebook\.com)\/([a-z0-9_-]*)\/videos\/([0-9]*)(.*)?$/i,m=function(){var e=n.createElement("div"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in t)if(void 0!==e.style[i])return t[i];return!1}();function h(e){var t=r();return m&&e.length?(e.one(m,t.resolve),setTimeout(t.resolve,500)):t.resolve(),t.promise()}function g(e,n,i){if(1===arguments.length)return t.extend({},e);if("string"==typeof n){if(void 0===i)return void 0===e[n]?null:e[n];e[n]=i}else t.extend(e,n);return this}function b(e){for(var t,n=decodeURI(e.split("#")[0]).split("&"),i={},r=0,o=n.length;r<o;r++)n[r]&&(i[(t=n[r].split("="))[0]]=t[1]);return i}function w(e,n){return e+(e.indexOf("?")>-1?"&":"?")+t.param(n)}function x(e,t){var n=e.indexOf("#");return-1===n?t:(n>0&&(e=e.substr(n)),t+e)}function C(e,n){var i=n.opener()&&n.opener().data("lity-desc")||"Image with no description",o=t('<img src="'+e+'" alt="'+i+'"/>'),a=r(),l=function(){var e;a.reject((e="Failed loading image",t('<span class="lity-error"/>').append(e)))};return o.on("load",function(){if(0===this.naturalWidth)return l();a.resolve(o)}).on("error",l),a.promise()}function k(e){return'<div class="lity-iframe-container"><iframe frameborder="0" allowfullscreen src="'+e+'"/></div>'}function E(){return n.documentElement.clientHeight?.9*n.documentElement.clientHeight:Math.round(.9*i.height())}function j(e){var t,i,r,o=z();o&&(27===e.keyCode&&o.options("esc")&&o.close(),9===e.keyCode&&(t=e,i=o.element().find(d),r=i.index(n.activeElement),t.shiftKey&&r<=0?(i.get(i.length-1).focus(),t.preventDefault()):t.shiftKey||r!==i.length-1||(i.get(0).focus(),t.preventDefault())))}function D(){t.each(a,function(e,t){t.resize()})}function z(){return 0===a.length?null:a[0]}function T(e,d,u,f){var y,v,p,m,b,w,x,C,k,z,T,O=this,q=!1,W=!1;d=t.extend({},c,d),v=t(d.template),O.element=function(){return v},O.opener=function(){return u},O.options=t.proxy(g,O,d),O.handlers=t.proxy(g,O,d.handlers),O.resize=function(){q&&!W&&p.css("max-height",E()+"px").trigger("lity:resize",[O])},O.close=function(){if(q&&!W){var e;W=!0,(e=O).element().attr(l,"true"),1===a.length&&(o.removeClass("lity-active"),i.off({resize:D,keydown:j})),((a=t.grep(a,function(t){return e!==t})).length?a[0].element():t(".lity-hidden")).removeClass("lity-hidden").each(function(){var e=t(this),n=e.data(s);n?e.attr(l,n):e.removeAttr(l),e.removeData(s)});var d=r();if(f&&(n.activeElement===v[0]||t.contains(v[0],n.activeElement)))try{f.focus()}catch(e){}return p.trigger("lity:close",[O]),v.removeClass("lity-opened").addClass("lity-closed"),h(p.add(v)).always(function(){p.trigger("lity:remove",[O]),v.remove(),v=void 0,d.resolve()}),d.promise()}},m=e,b=O,w=d.handlers,x=d.handler,k="inline",z=t.extend({},w),x&&z[x]?(C=z[x](m,b),k=x):(t.each(["inline","iframe"],function(e,t){delete z[t],z[t]=w[t]}),t.each(z,function(e,t){return!t||!(!t.test||t.test(m,b))||(!1!==(C=t(m,b))?(k=e,!1):void 0)})),y={handler:k,content:C||""},v.attr(l,"false").addClass("lity-loading lity-opened lity-"+y.handler).appendTo("body").focus().on("click","[data-lity-close]",function(e){t(e.target).is("[data-lity-close]")&&O.close()}).trigger("lity:open",[O]),T=O,1===a.unshift(T)&&(o.addClass("lity-active"),i.on({resize:D,keydown:j})),t("body > *").not(T.element()).addClass("lity-hidden").each(function(){var e=t(this);void 0===e.data(s)&&e.data(s,e.attr(l)||null)}).attr(l,"true"),t.when(y.content).always(function(e){p=t(e).css("max-height",E()+"px"),v.find(".lity-loader").each(function(){var e=t(this);h(e).always(function(){e.remove()})}),v.removeClass("lity-loading").find(".lity-content").empty().append(p),q=!0,p.trigger("lity:ready",[O])})}function O(e,i,r){e.preventDefault?(e.preventDefault(),e=(r=t(this)).data("lity-target")||r.attr("rel")||r.attr("src")):r=t(r);var o=new T(e,t.extend({},r.data("lity-options")||r.data("lity"),i),r,n.activeElement);if(!e.preventDefault)return o}return C.test=function(e){return u.test(e)},O.version="2.2.2",O.options=t.proxy(g,O,c),O.handlers=t.proxy(g,O,c.handlers),O.current=z,t(n).on("click.lity","[data-wpd-lity]",O),O});
13
  /* My Content and Settings */
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(e,t){wpdiscuzAjaxObj.setCommentMessage(e,t),setTimeout((function(){location.href=location.href.substring(0,location.href.indexOf("wpdiscuzUrlAnchor")-1)}),3e3)}wpdiscuzAjaxObj.setCommentMessage=function(e,t,a){var o="wpdiscuz-message-error";if(e instanceof Array)for(var n in e)t instanceof Array?"success"===t[n]?o="wpdiscuz-message-success":"warning"===t[n]&&(o="wpdiscuz-message-warning"):"success"===t?o="wpdiscuz-message-success":"warning"===t&&(o="wpdiscuz-message-warning"),jQuery("<div/>").addClass(o).html(e[n]).prependTo("#wpdiscuz-comment-message").delay(a instanceof Array?a[n]:a||4e3).fadeOut(1e3,(function(){jQuery(this).remove()}));else"success"===t?o="wpdiscuz-message-success":"warning"===t&&(o="wpdiscuz-message-warning"),jQuery("<div/>").addClass(o).html(e).prependTo("#wpdiscuz-comment-message").delay(a||4e3).fadeOut(1e3,(function(){jQuery(this).remove()}))},wpdiscuzAjaxObj.applyFilterOnPhrase=function(e,t,a){return wpdiscuzAjaxObj.phraseFilters&&jQuery.each(wpdiscuzAjaxObj.phraseFilters,(function(o){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[o]]&&(e=wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[o]](e,t,a))})),e},jQuery(document).ready((function(e){e("body").addClass("wpdiscuz_"+wpdiscuzAjaxObj.version);var t=wpdiscuzAjaxObj.is_user_logged_in,a=1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!t,o=1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&t,n=wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion,i=parseInt(wpdiscuzAjaxObj.commentListLoadType),d=parseInt(wpdiscuzAjaxObj.wc_post_id);wpdiscuzAjaxObj.wpdiscuz_nonce="";var s=parseInt(wpdiscuzAjaxObj.commentListUpdateType),c=1e3*parseInt(wpdiscuzAjaxObj.commentListUpdateTimer),p=parseInt(wpdiscuzAjaxObj.liveUpdateGuests),r=wpdiscuzAjaxObj.loadLastCommentId,l=r,w=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 m,u=parseInt(wpdiscuzAjaxObj.wordpressIsPaginate),f=wpdiscuzAjaxObj.storeCommenterData,h=parseInt(wpdiscuzAjaxObj.wmuEnabled),b=wpdiscuzAjaxObj.isCookiesEnabled,_=!0,g=wpdiscuzAjaxObj.cookiehash,z=parseInt(wpdiscuzAjaxObj.isLoadOnlyParentComments),j=parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0,v=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),x=parseInt(wpdiscuzAjaxObj.enableBubble),C=parseInt(wpdiscuzAjaxObj.bubbleLiveUpdate),y=parseInt(wpdiscuzAjaxObj.bubbleHintTimeout),k=parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout)?parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout):5,O=parseInt(wpdiscuzAjaxObj.bubbleShowNewCommentMessage),A=wpdiscuzAjaxObj.bubbleLocation,I=wpdiscuzAjaxObj.inlineFeedbackAttractionType,T=(T=parseInt(wpdiscuzAjaxObj.scrollSize))||32,D=[],F=[],E=[],M=!1,L=1,R=e("html").css("scroll-behavior"),S=e("body").css("scroll-behavior");(e(".wc_social_plugin_wrapper .wp-social-login-provider-list").length?e(".wc_social_plugin_wrapper .wp-social-login-provider-list").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .the_champ_login_container").length?e(".wc_social_plugin_wrapper .the_champ_login_container").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .social_connect_form").length?e(".wc_social_plugin_wrapper .social_connect_form").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .oneall_social_login_providers").length&&e(".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&&e("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0"),window.addEventListener("beforeunload",(function(t){var a=e(".wpd-form").not(":hidden");if(a.length)if(wpdiscuzLoadRichEditor&&document.querySelector(".wpdiscuz-textarea-wrap")){for(var o=0;o<a.length;o++)if("\n"!==wpDiscuzEditor.createEditor(e(a[o]).find(".ql-container").attr("id")).getText())return t.preventDefault(),void(t.returnValue="")}else for(o=0;o<a.length;o++)if(e(a[o]).find(".wc_comment").val())return t.preventDefault(),void(t.returnValue="")})),wpdiscuzLoadRichEditor||(e(document).delegate("textarea.wc_comment","input",(function(){me(e(this))})),e.each(e("textarea.wc_comment"),(function(){me(e(this))}))),e("body").on("focus","#wpdcom .ql-editor, #wpdcom .wc_comment",(function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(j)})),e("body").on("focus","#wpdcom textarea",(function(){e(this).next(".autogrow-textarea-mirror").length||e(this).autoGrow()})),t)||U({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)});if(e(".wpd-vote-down.wpd-dislike-hidden").remove(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd"),e("body").on("click","#wpd-editor-source-code-wrapper-bg",(function(){e(this).hide(),e("#wpd-editor-source-code-wrapper").hide(),e("#wpd-editor-uid").val(""),e("#wpd-editor-source-code").val("")})),wpdiscuzLoadRichEditor&&e("body").on("click","#wpd-insert-source-code",(function(){var t=wpDiscuzEditor.createEditor("#"+e("#wpd-editor-uid").val());t.deleteText(0,t.getLength(),Quill.sources.USER);var a=e("#wpd-editor-source-code").val();a.length&&t.clipboard.dangerouslyPasteHTML(0,a,Quill.sources.USER),t.update(),e("#wpd-editor-source-code-wrapper-bg").hide(),e("#wpd-editor-source-code-wrapper").hide(),e("#wpd-editor-uid").val(""),e("#wpd-editor-source-code").val("")})),e("body").on("click",".wpd-reply-button",(function(){var i=X(e(this),0);e(this).hasClass("wpdiscuz-clonned")?(wpdiscuzLoadRichEditor?setTimeout((function(){wpDiscuzEditor.createEditor("#wpd-editor-"+i).focus()}),j):setTimeout((function(){e("#wc-textarea-"+i).trigger("focus")}),j),e("#wpd-secondary-form-wrapper-"+i).slideToggle(j)):function(a){var o=X(a,0);e("#wpdiscuz_form_anchor-"+o).before(function(t){return e("#wpdiscuz_hidden_secondary_form").html().replace(/wpdiscuzuniqueid/g,t)}(o));var n=e("#wpd-secondary-form-wrapper-"+o);if(!t){U({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-"+o).focus()}),j):setTimeout((function(){e("#wc-textarea-"+o).trigger("focus")}),j);n.slideToggle(j,(function(){a.addClass("wpdiscuz-clonned")}))}(e(this)),function(t){if((a||o)&&"2.0"===n){var i=Y(t);setTimeout((function(){if(!F[i])try{F[i]=grecaptcha.render("wpdiscuz-recaptcha-"+t,{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(a){e("#wpdiscuz-recaptcha-field-"+t).val("key")},"expired-callback":function(){e("#wpdiscuz-recaptcha-field-"+t).val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}}),1e3)}}(i)})),e("body").on("click","#wpdcom [data-wpd-clipboard]",(function(){var t=e(this).data("wpd-clipboard"),a=e("<input/>");a.appendTo("body").css({position:"absolute",top:"-10000000px"}).val(t),a.trigger("select"),document.execCommand("copy"),a.remove(),wpdiscuzAjaxObj.setCommentMessage(t+"<br/>"+wpdiscuzAjaxObj.wc_copied_to_clipboard,"success",5e3)})),e("body").on("click",".wpdiscuz-nofollow,.wc_captcha_refresh_img,.wpd-load-more-submit",(function(e){e.preventDefault()})),e("body").on("click",".wpd-toggle.wpd_not_clicked",(function(){var t=e(this);t.removeClass("wpd_not_clicked");var a=X(e(this),0),o=e(this),n=e(".fas",o);!o.parents(".wpd-comment:not(.wpd-reply)").children(".wpd-reply").length&&z?function(t,a){var o=Y(t),n=new FormData;n.append("action","wpdShowReplies"),n.append("commentId",o),fe(v,!0,n).done((function(o){a.addClass("wpd_not_clicked"),"object"==typeof o&&o.success&&(e("#wpd-comm-"+t).replaceWith(o.data.comment_list),e("#wpd-comm-"+t+" .wpd-toggle .fas").removeClass("fa-chevron-down").addClass("fa-chevron-up"),e("#wpd-comm-"+t+" .wpd-toggle .wpd-view-replies .wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),e("#wpd-comm-"+t+" .wpd-toggle").attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text),ue(o)),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,n){console.log(n),a.addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)}))}(a,t):e("#wpd-comm-"+a+"> .wpd-reply").slideToggle(700,(function(){e(this).is(":hidden")?(n.removeClass("fa-chevron-up"),n.addClass("fa-chevron-down"),o.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_show_replies_text),o.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_show_replies_text)):(n.removeClass("fa-chevron-down"),n.addClass("fa-chevron-up"),o.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),o.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text)),t.addClass("wpd_not_clicked")}))})),e("body").on("mouseenter",".wpd-new-loaded-comment",(function(){e(this).removeClass("wpd-new-loaded-comment")})),e("body").on("click",".wpd-sbs-toggle",(function(){e(".wpdiscuz-subscribe-bar").slideToggle(j)})),parseInt(wpdiscuzAjaxObj.wpDiscuzIsShowOnSubscribeForm)&&!t&&wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&e("#wpdiscuz-subscribe-form").length&&("2.0"===n?(setTimeout((function(){try{grecaptcha.render("wpdiscuz-recaptcha-subscribe-form",{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(t){e("#wpdiscuz-recaptcha-field-subscribe-form").val("key")},"expired-callback":function(){e("#wpdiscuz-recaptcha-field-subscribe-form").val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}}),1e3),e("body").on("submit","#wpdiscuz-subscribe-form",(function(t){e("#wpdiscuz-recaptcha-field-subscribe-form").val()?e(".wpdiscuz-recaptcha",e(this)).css("border","none"):(e(".wpdiscuz-recaptcha",e(this)).css("border","1px solid red"),t.preventDefault())}))):"3.0"===n&&e("body").on("click","#wpdiscuz_subscription_button",(function(t){var a=e(this).parents("#wpdiscuz-subscribe-form");t.preventDefault();try{grecaptcha.ready((function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/wpdAddSubscription"}).then((function(e){console.log(5555),document.getElementById("wpdiscuz-recaptcha-field-subscribe-form").value=e,a.trigger("submit")}),(function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)}))}))}catch(t){console.log(t),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+t.message,"error")}}))),(a||o)&&"2.0"===n){var P=e(window).width(),q=e("#wpdcom").width();q>=1100&&(e("#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)"}),e("#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)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"65%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"35%"})),q>=940&&q<1100&&(e("#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)"}),e("#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)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"60%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"40%"})),q>=810&&q<940&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"40%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"60%"})),q>=730&&q<810&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#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)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"45%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"55%"})),q>=610&&q<730&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.85)","-webkit-transform":"scale(0.85)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"43%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"55%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"30%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"70%"})),P>650&&(q>=510&&q<610&&(e("#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)"}),e("#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)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"35%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"63%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"30%",position:"relative",right:"-60px"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"70%"}),e("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"})),q>=470&&q<510&&(e("#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)"}),e("#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)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"40%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"60%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({float:"none",width:"100%",display:"block"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({float:"none",width:"100%",display:"block"}),e("#wpdcom .wpd_main_comm_form .wc-form-footer").css({"margin-left":"0px"}),e("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"})),q<470&&(e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({margin:"0px auto","transform-origin":"center 0","-webkit-transform-origin":"center 0"}),e("#wpdcom .wpd-form-col-left").css({float:"none",width:"100%",display:"block"}),e("#wpdcom .wpd-form-col-right").css({float:"none",width:"100%",display:"block"}),e("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"}),e("#wpdcom .wpd-secondary-form-wrapper .wc_notification_checkboxes").css({"text-align":"center"}),e("#wpdcom .wpd-secondary-form-wrapper .wc-field-submit").css({"text-align":"center"})))}function H(t,a,o){fe(v||h,!1,a).done((function(a){if(e(o).addClass("wpd_not_clicked"),"object"==typeof a)if(a.success){"collapsed"===wpdiscuzAjaxObj.commentFormView&&e(".wpd-form-foot",t).slideUp(j),a.data.wc_all_comments_count_new=parseInt(a.data.wc_all_comments_count_new),e(".wpd-thread-info").html(a.data.wc_all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",a.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(a.data.wc_all_comments_count_bubble_html);var n=j;a.data.is_main?ne(a.data.message):(n=j+700,e("#wpd-secondary-form-wrapper-"+a.data.uniqueid).slideToggle(700),1==a.data.is_in_same_container?e("#wpd-secondary-form-wrapper-"+a.data.uniqueid).after(a.data.message):e("#wpd-comm-"+a.data.uniqueid).after(a.data.message)),function(e){if(!e.data.held_moderate){var t=new FormData;t.append("action","wpdCheckNotificationType"),t.append("comment_id",e.data.new_comment_id),t.append("email",e.data.comment_author_email),t.append("isParent",e.data.is_main),fe(v,!0,t)}}(a),function(e){if(e.data.redirect>0&&e.data.new_comment_id){var t=new FormData;t.append("action","wpdRedirect"),t.append("commentId",e.data.new_comment_id),fe(v,!0,t).done((function(e){"object"==typeof e&&e.success&&setTimeout((function(){location.href=e.data}),2e3)})).fail((function(e,t,a){console.log(a)}))}}(a),b&&_?function(t){var a=t.comment_author_email,o=t.comment_author,n=t.comment_author_url;null==f?(Cookies.set("comment_author_email_"+g,a),Cookies.set("comment_author_"+g,o),n.length&&Cookies.set("comment_author_url_"+g,n)):(f=parseInt(f),Cookies.set("comment_author_email_"+g,a,{expires:f,path:"/"}),Cookies.set("comment_author_"+g,o,{expires:f,path:"/"}),n.length&&Cookies.set("comment_author_url_"+g,n,{expires:f,path:"/"}));e(".wpd-cookies-checkbox").length&&e(".wpd-cookies-checkbox").prop("checked",!0)}(a.data):_||e(".wpd-cookies-checkbox").prop("checked",!1),t.get(0).reset(),wpdiscuzLoadRichEditor?wpDiscuzEditor.createEditor("#wpd-editor-"+e(".wpdiscuz_unique_id",t).val()).setContents([{insert:"\n"}]):me(t.find(".wc_comment")),U(a.data),e(".wmu-preview-wrap",t).remove(),D.length&&(D.forEach((function(e){e.parents(".wpd-field-checkbox").remove()})),D=[]),parseInt(wpdiscuzAjaxObj.scrollToComment)&&setTimeout((function(){ae(),e("html, body").animate({scrollTop:e("#comment-"+a.data.new_comment_id).offset().top-T},1e3,oe)}),n),ue(a,t)}else a.data&&(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"),ue(a,t));else wpdiscuzAjaxObj.setCommentMessage(a,"error");e("#wpdiscuz-loading-bar").fadeOut(250),M=!1})).fail((function(t,a,n){console.log(n),e(o).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)}))}function U(t){e(".wpd_comm_form .wc_name").val(t.comment_author),t.comment_author_email&&t.comment_author_email.indexOf("@example.com")<0&&e(".wpd_comm_form .wc_email").val(t.comment_author_email),t.comment_author_url&&e(".wpd_comm_form .wc_website").val(t.comment_author_url)}function W(t,a){e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").show(),e("#wpd-comm-"+t+" .wpdiscuz-edit-form-wrap").replaceWith(a),e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-last-edited").show()}e("body").on("click",".wc_comm_submit.wpd_not_clicked",(function(){var i=e(this),d=1,s=e(this).parents("form");if("true"!==s.attr("data-uploading")){if(s.hasClass("wpd_main_comm_form")||(d=function(t){var a=t.attr("class").split(" "),o="";return e.each(a,(function(e,t){"wpd_comment_level"===J(t,!1)&&(o=J(t,!0))})),parseInt(o)+1}(e(this).parents(".wpd-comment"))),te(s,"#wpd-editor-"+e(".wpdiscuz_unique_id",s).val()),s.on("submit",(function(e){e.preventDefault()})),s[0].checkValidity()&&(p=s,r=!0,"2.0"===n&&e("input[name=wc_captcha]",p).length&&!e("input[name=wc_captcha]",p).val().length?(r=!1,e(".wpdiscuz-recaptcha",p).css("border","1px solid red")):"2.0"===n&&e("input[name=wc_captcha]",p).length&&e(".wpdiscuz-recaptcha",p).css("border","none"),r)){M=!0,function(t){e(".wpd-agreement-checkbox",t).each((function(){e(this).hasClass("wpd_agreement_hide")&&b&&e(this).prop("checked")&&(Cookies.set(e(this).attr("name")+"_"+g,1,{expires:30,path:"/"}),e("input[name="+e(this).attr("name")+"]").each((function(){D.push(e(this))})))}))}(s),e(i).removeClass("wpd_not_clicked");var c=new FormData;if(c.append("action","wpdAddComment"),e(":input",s).each((function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&c.append(this.name+"",e(this).val().trim()),"checkbox"!=this.type&&"radio"!=this.type||e(this).is(":checked")&&c.append(this.name+"",e(this).val())})),c.append("wpd_comment_depth",d),wpdiscuzAjaxObj.wpdiscuz_zs&&c.append("wpdiscuz_zs",wpdiscuzAjaxObj.wpdiscuz_zs),e(".wpd-cookies-checkbox",s).length?e(".wpd-cookies-checkbox",s).prop("checked")||(_=!1):t&&(_=!1),e("#wpdiscuz-loading-bar").show(),wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&"3.0"===n&&(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(e){c.append("g-recaptcha-response",e),H(s,c,i)}),(function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)}))}))}catch(t){console.log(t),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+t.message,"error"),e("#wpdiscuz-loading-bar").fadeOut(250)}else H(s,c,i)}var p,r;!function(e){if((a||o)&&"2.0"===n){var t=Y(e);grecaptcha.reset(F[t])}}(e(".wpdiscuz_unique_id",s).val()),e(".wpdiscuz_reset").val("")}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhraseDoingUpload,"wmuPhraseDoingUpload",s),"warning")})),e("body").on("click",".wpd_editable_comment",(function(){m&&e(".wpdiscuz-edit-form-wrap").length&&W(X(e(".wpdiscuz-edit-form-wrap"),0),m);var t=e(this),a=X(t,0),o=Y(a),n=new FormData;n.append("action","wpdEditComment"),n.append("commentId",o),m=e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-text").get(0),fe(v,!0,n).done((function(o){if("object"==typeof o)if(o.success){if(e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text").replaceWith(o.data.html),wpdiscuzLoadRichEditor){var n=wpDiscuzEditor.createEditor("#wpd-editor-edit_"+a);n.clipboard.dangerouslyPasteHTML(0,o.data.content),n.update(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd")}else e("#wc-textarea-edit_"+a).val(o.data.content),me(e("#wc-textarea-edit_"+a));e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").hide(),e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-last-edited").hide()}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[o.data],o.data,t),"error");else console.log(o);e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e("body").on("click",".wc_save_edited_comment",(function(){var t=e(this),a=X(t),o=Y(a),n=e("#wpd-comm-"+a+" #wpdiscuz-edit-form");if(te(n,"#wpd-editor-edit_"+a),n.on("submit",(function(e){e.preventDefault()})),n[0].checkValidity()){var i=new FormData;i.append("action","wpdSaveEditedComment"),i.append("commentId",o),e(":input",n).each((function(){""!==this.name&&"checkbox"!==this.type&&"radio"!==this.type&&i.append(this.name+"",e(this).val()),"checkbox"!==this.type&&"radio"!==this.type||e(this).is(":checked")&&i.append(this.name+"",e(this).val())})),fe(v,!0,i).done((function(n){"object"==typeof n?(console.log("aaaa"),n.success?(W(a,n.data.message),n.data.comment_approved_html&&e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-subheader").append(n.data.comment_approved_html),n.data.lastEdited&&(e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-last-edited").remove(),e(n.data.lastEdited).insertAfter("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text")),n.data.twitterShareLink&&e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_tw").attr("href",n.data.twitterShareLink),n.data.whatsappShareLink&&e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_whatsapp").attr("href",n.data.whatsappShareLink),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+a)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[n.data],n.data,t),"error"),ue(n,o)):wpdiscuzAjaxObj.setCommentMessage(n,"error"),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}))}})),e("body").on("click",".wc_cancel_edit",(function(){var t=X(e(this));W(t,m),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)})),!u&&w&&(L=0,1==w?setTimeout((function(){V(!0)}),500):e("body").on("click",".wpd-load-comments",(function(){e(this).parent(".wpd-load-more-submit-wrap").remove(),V(!0)}))),e("body").on("click",".wpd-load-more-submit",(function(){var t=e(this),a="wpd-loaded";t.hasClass(a)&&V(!1,t,a,"wpd-loading")}));var B=!1;function N(){var t=document.getElementById("wpdiscuzHasMoreComments"),a=0;t&&(a=t.dataset.is_show_load_more);var o=document.getElementById("wpdcom")?document.getElementById("wpdcom").clientHeight:0,n=e(window).height()+e(window).scrollTop();o&&n&&(100*n/o>=80&&!1===B&&1==a&&(B=!0,V(!1,e(".wpd-load-more-submit"))))}function V(t,a,o,n){a&&(a.toggleClass(o),a.toggleClass(n));var d=new FormData;d.append("action","wpdLoadMoreComments");var s=e(".wpdiscuz-sort-button-active").attr("data-sorting");s&&d.append("sorting",s),d.append("offset",L),d.append("lastParentId",e(".wpd-load-more-submit").attr("data-lastparentid")),d.append("isFirstLoad",t?1:0);var c=e(".wpdf-active").attr("data-filter-type");d.append("wpdType",c||""),fe(v,!t||1!=w,d).done((function(d){"object"==typeof d&&d.success&&(L++,t&&e(".wpd-comment").remove(),e(".wpdiscuz_single").remove(),e(".wpdiscuz-comment-pagination").before(d.data.comment_list),K(d,t&&2!==i),B=!1,d.data.loadLastCommentId&&(r=d.data.loadLastCommentId),ue(d),t&&Q(!1)),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),a&&(a.toggleClass(o),a.toggleClass(n))})).fail((function(t,i,d){console.log(d),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),a&&(a.toggleClass(o),a.toggleClass(n))}))}function K(t,a){var o,n=document.getElementById("wpdiscuzHasMoreComments");if(0==t.data.is_show_load_more)n&&(n.dataset.is_show_load_more=0),e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide();else if(o=t.data.last_parent_id,e(".wpd-load-more-submit").attr("data-lastparentid",o),2!==i&&e(".wpdiscuz-comment-pagination").show(),n&&(n.dataset.is_show_load_more=1),a&&e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").show(),t.data.comments_left>0){if(!e(".wpd-load-more-submit .wpd-comments-left").length){const t=e("<span>");t.addClass("wpd-comments-left"),e(".wpd-load-more-submit").append(t)}e(".wpd-load-more-submit .wpd-comments-left").text(t.data.comments_left_text)}ue(t)}function Q(t){var a=location.href.match(/#comment\-(\d+)/);if(null!==a){var o=a[1];if(e("#comment-"+o).length)setTimeout((function(){ae(),e("html, body").animate({scrollTop:e("#comment-"+o).parents("[id^=wpd-comm-]").offset().top-T},1e3,oe),t&&G(o)}),500);else{var n=new FormData;n.append("action","wpdGetSingleComment"),n.append("commentId",o),fe(v,!0,n).done((function(a){if("object"==typeof a&&a.success){var n="#comment-"+o;e("#comment-"+a.data.parentCommentID).length?e("#comment-"+a.data.parentCommentID).parents("[id^=wpd-comm-"+a.data.parentCommentID+"]").replaceWith(a.data.message):e(".wpd-thread-list").prepend(a.data.message),ue(a),ae(),e("html, body").animate({scrollTop:e(n).offset().top-T},1e3,oe),t&&G(o)}e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}))}}}function G(t){setTimeout((function(){e("#comment-"+t).siblings(".wpd-secondary-form-wrapper").is(":visible")||e("#comment-"+t).find(".wpd-reply-button").trigger("click")}),1100)}function $(e){if(void 0!==e.data.message)for(var t,a=e.data.message,o=0;o<a.length;o++)Z((t=a[o]).comment_parent,t.comment_html)}function X(e,t){var a="";return(a=t?e.parents(".wpd-main-form-wrapper").attr("id"):e.parents(".wpd-comment").attr("id")).substring(a.lastIndexOf("-")+1)}function Y(e){return e.substring(0,e.indexOf("_"))}function J(e,t){return t?e.substring(e.indexOf("-")+1):e.substring(0,e.indexOf("-"))}function Z(t,a){if(0==t)ne(a);else{var o=X(e("#comment-"+t),0);e("#wpdiscuz_form_anchor-"+o).after(a)}}function ee(){var t=[];return e(".wpd-comment-right").each((function(){t.push(Y(X(e(this),0)))})),t.join(",")}function te(t,a){var o=t.find(".wpd-required-group");wpdiscuzLoadRichEditor&&t.find(".wc_comment").val(e(a+">.ql-editor").html()),function(e){var t=e.find(".wc_comment"),a=t.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 "),t.val(a)}(t),e.each(o,(function(){e("input",this).prop("required",!1),0===e("input:checked",this).length?e("input",e(this)).prop("required",!0):e(".wpd-field-invalid",this).remove()}))}function ae(){e("html, body").css("scroll-behavior","unset")}function oe(){e("html").css("scroll-behavior",R),e("body").css("scroll-behavior",S)}function ne(t){e(".wpd-sticky-comment").last()[0]?e(t).insertAfter(e(".wpd-sticky-comment").last()[0]):e(".wpd-thread-list").prepend(t)}function ie(t){t?t.prop("required")||(t.val()?t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none")):e.each(e(".wc_email"),(function(t,a){var o=e(a);o.prop("required")||(o.val()?o.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):o.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none"))}))}if(2!==i||u||(e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide(),N(),e(window).scroll((function(){N()}))),wpdiscuzAjaxObj.setLoadMoreVisibility=K,e("body").on("click",".wpd-vote-up.wpd_not_clicked, .wpd-vote-down.wpd_not_clicked",(function(){var t=e(this);e(t).removeClass("wpd_not_clicked");var a,o=Y(X(t));a=e(this).hasClass("wpd-vote-up")?1:-1;var n=new FormData;n.append("action","wpdVoteOnComment"),n.append("commentId",o),n.append("voteType",a),fe(v,!0,n).done((function(n){if(e(t).addClass("wpd_not_clicked"),"object"==typeof n){if(n.success){if("total"===n.data.buttonsStyle){var i=e(".wpd-comment-footer .wpd-vote-result",e("#comment-"+o)),d=n.data.votes;i.text(n.data.votesHumanReadable),i.attr("title",d),i.removeClass("wpd-up wpd-down"),d>0&&i.addClass("wpd-up"),d<0&&i.addClass("wpd-down")}else{var s=e(".wpd-comment-footer .wpd-vote-result-like",e("#comment-"+o)),c=e(".wpd-comment-footer .wpd-vote-result-dislike",e("#comment-"+o));s.text(n.data.likeCountHumanReadable),s.attr("title",n.data.likeCount),c.text(n.data.dislikeCountHumanReadable),c.attr("title",n.data.dislikeCount),parseInt(n.data.likeCount)>0?s.addClass("wpd-up"):s.removeClass("wpd-up"),parseInt(n.data.dislikeCount)<0?c.addClass("wpd-down"):c.removeClass("wpd-down")}var p=e(".wpd-comment-footer .wpd-vote-up",e("#comment-"+o)),r=e(".wpd-comment-footer .wpd-vote-down",e("#comment-"+o));p.removeClass("wpd-up"),r.removeClass("wpd-down"),n.data.curUserReaction>0?p.addClass("wpd-up"):n.data.curUserReaction<0&&r.addClass("wpd-down")}else n.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[n.data],n.data,t),"error");ue(n,o,a)}else console.log(n);e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(a,o,n){console.log(n),e(t).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e(document).on("click","body",(function(t){var a=e(".wpdiscuz-sort-buttons");e(t.target).hasClass("wpdf-sorting")||e(t.target).parent().hasClass("wpdf-sorting")?a.css({display:a.is(":visible")?"none":"flex"}):a.hide()})),e("body").on("click",".wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)",(function(){var t=e(this),a=e(this).attr("data-sorting");if(a){e(".wpdiscuz-sort-button.wpdiscuz-sort-button-active").removeClass("wpdiscuz-sort-button-active").appendTo(".wpdiscuz-sort-buttons"),t.addClass("wpdiscuz-sort-button-active").prependTo(".wpdf-sorting");var o=new FormData;o.append("action","wpdSorting"),o.append("sorting",a);var n=e(".wpdf-active").attr("data-filter-type");o.append("wpdType",n||""),fe(v,!0,o).done((function(t){"object"==typeof t&&t.success&&(e("#wpdcom .wpd-comment").remove(),e("#wpdcom .wpd-thread-list").prepend(t.data.message),K(t,!1),L=1),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}))}})),window.onhashchange=function(){Q(!1)},1!=w&&Q(!1),e("body").on("click",".wpdiscuz-readmore",(function(){var t=X(e(this)),a=Y(t),o=new FormData;o.append("action","wpdReadMore"),o.append("commentId",a),fe(v,!0,o).done((function(o){"object"==typeof o?(o.success?(e("#comment-"+a+" .wpd-comment-text").replaceWith(" "+o.data.message),e("#wpdiscuz-readmore-"+t).remove()):console.log(o.data),ue(o)):console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e("body").on("change",".wpd-required-group",(function(){0!==e("input:checked",this).length?e("input",e(this)).prop("required",!1):e("input",e(this)).prop("required",!0)})),e("body").on("click",".wpdiscuz-spoiler",(function(){e(this).next().slideToggle(),e(this).hasClass("wpdiscuz-spoiler-closed")?e(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-plus").removeClass("fa-plus").addClass("fa-minus"):e(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-minus").removeClass("fa-minus").addClass("fa-plus"),e(this).toggleClass("wpdiscuz-spoiler-closed")})),e("body").on("click",".wpd-tools i",(function(){var t=e(this).siblings(".wpd-tools-actions");t.is(":visible")||e(this).parents(".wpd-comment-right").attr("id")!==e("[id^=comment-]","#wpdcom").last().attr("id")||e("#comments").css({paddingBottom:"160px"}),t.css({display:t.is(":visible")?"none":"flex"})})),e("body").on("mouseleave",".wpd-comment-right",(function(){e(this).find(".wpd-tools-actions").hide(),e("#comments").css({paddingBottom:"0"})})),e("body").on("click",".wpd_stick_btn",(function(){var t=Y(X(e(this),0)),a=new FormData;a.append("action","wpdStickComment"),a.append("commentId",t),fe(v,!0,a).done((function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e("body").on("click",".wpd_close_btn",(function(){var t=Y(X(e(this),0)),a=new FormData;a.append("action","wpdCloseThread"),a.append("commentId",t),fe(v,!0,a).done((function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e("body").on("click",".wpd-filter.wpd_not_clicked[data-filter-type]",(function(){var t=e(this),a=t.attr("data-filter-type");wpdiscuzAjaxObj.resetActiveFilters(".wpdf-"+a),t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var o=new FormData;o.append("action","wpdLoadMoreComments");var n=e(".wpdiscuz-sort-button-active").attr("data-sorting");n&&o.append("sorting",n),o.append("lastParentId",0),o.append("offset",0),L=1,o.append("wpdType",t.hasClass("wpdf-active")?"":a),o.append("isFirstLoad",1),e(this).hasClass("wpdf-inline")?e(this).hasClass("wpdf-active")?e(".wpd-comment-info-bar").hide():e(".wpd-comment-info-bar").css("display","flex"):e(".wpd-comment-info-bar").hide(),fe(v,!1,o).done((function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(t.toggleClass("wpdf-active"),e(".wpd-load-comments").remove(),e(".wpd-comment").remove(),e(".wpd-thread-list").prepend(a.data.comment_list),K(a),r=a.data.loadLastCommentId,e(".wpd-load-more-submit").blur(),ue(a)),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e("body").on("click",".wpdf-reacted.wpd_not_clicked",(function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var a=new FormData;a.append("action","wpdMostReactedComment"),fe(v,!1,a).done((function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(e("#comment-"+a.data.parentCommentID).length?e("#comment-"+a.data.parentCommentID).parents("[id^=wpd-comm-"+a.data.parentCommentID+"]").replaceWith(a.data.message):e("#comment-"+a.data.commentId).length||e(".wpd-thread-list").prepend(a.data.message),ue(a),ae(),e("html, body").animate({scrollTop:e("#comment-"+a.data.commentId).offset().top-T},1e3,oe))})).fail((function(a,o,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner")}))})),e("body").on("click",".wpdf-hottest.wpd_not_clicked",(function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var a=new FormData;a.append("action","wpdHottestThread"),fe(v,!1,a).done((function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(e("#comment-"+a.data.commentId).length?e("#comment-"+a.data.commentId).parents("[id^=wpd-comm-"+a.data.commentId+"]").replaceWith(a.data.message):e(".wpd-thread-list").prepend(a.data.message),ue(a),ae(),e("html, body").animate({scrollTop:e("#comment-"+a.data.commentId).offset().top-T},1e3,oe))})).fail((function(a,o,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner")}))})),e("body").on("click",".wpd-filter-view-all",(function(){e(".wpdf-inline.wpdf-active.wpd_not_clicked").trigger("click")})),e("body").on("click",".wpd-follow-link.wpd_not_clicked",(function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var a=Y(X(t,0)),o=new FormData;o.append("action","wpdFollowUser"),o.append("commentId",a),fe(v,!0,o).done((function(a){t.addClass("wpd_not_clicked"),"object"==typeof a?a.success?(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data.code],a.data.code,t),"success"),t.removeClass("wpd-follow-active"),a.data.followTip&&t.attr("wpd-tooltip",a.data.followTip),a.data.followClass&&t.addClass(a.data.followClass),ue(a)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"):console.log(a),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(a,o,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),ie(),e("body").on("keyup",".wc_email",(function(){ie(e(this))})),x&&e("#wpdcom").length){if(e("#wpd-bubble-wrapper").hover((function(){e(this).addClass("wpd-bubble-hover")}),(function(){e(this).removeClass("wpd-bubble-hover")})),y&&!Cookies.get(wpdiscuzAjaxObj.cookieHideBubbleHint)&&setTimeout((function(){e("#wpd-bubble-wrapper").addClass("wpd-bubble-hover"),Cookies.set(wpdiscuzAjaxObj.cookieHideBubbleHint,"1",{expires:7,path:"/"}),setTimeout((function(){e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")}),1e3*k)}),1e3*y),"content_left"===A)if(e(".entry-content").length){var de=(se=Math.min(e(".entry-content").offset().left,e("#wpdcom").offset().left)-120)>25?se:25;e("#wpd-bubble-wrapper").css({left:de+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".post-entry").length){de=(se=Math.min(e(".post-entry").offset().left,e("#wpdcom").offset().left)-120)>25?se:25;e("#wpd-bubble-wrapper").css({left:de+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".container").length){var se;de=(se=Math.min(e(".container").offset().left,e("#wpdcom").offset().left)-120)>25?se:25;e("#wpd-bubble-wrapper").css({left:de+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else e("#wpd-bubble-wrapper").css({left:"25px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-corner");else"left_corner"===A?(e("#wpd-bubble-wrapper").css({left:"25px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-corner")):"right_corner"===A&&(e("#wpd-bubble-wrapper").css({right:"25px"}),e("#wpd-bubble-wrapper").addClass("wpd-right-corner"));e("#wpd-bubble-wrapper").show(),e("body").on("click","#wpd-bubble-add-message-close",(function(t){t.preventDefault(),t.stopPropagation(),e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")})),e("body").on("click","#wpd-bubble",(function(){ae(),e("#tab-title-reviews").length&&e("#tab-title-reviews a").trigger("click"),e("html, body").animate({scrollTop:e("#wpdcom").offset().top-(T+28)},1e3,(function(){oe(),e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover"),wpdiscuzLoadRichEditor?e("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0").focus():e("#wc-textarea-0_0").length&&e("#wc-textarea-0_0").trigger("focus")}))})),e("body").on("click","#wpd-bubble-comment-close",(function(t){t.preventDefault(),e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")})),e("body").on("click","#wpd-bubble-comment-reply-link a",(function(){var t=e(this).attr("href");setTimeout((function(){e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),Q(!0);var a=t.match(/#comment\-(\d+)/);E=E.filter((function(e){return e!=a[1]})),e("#wpd-bubble-count .wpd-new-comments-count").text(E.length),0==E.length&&e("#wpd-bubble-count").removeClass("wpd-new-comments")}),100)})),e("body").on("click","#wpd-bubble-count",(function(){if(E.length){var t=new FormData;t.append("action","wpdBubbleUpdate"),t.append("newCommentIds",E.join()),fe(v,!0,t).done((function(t){"object"==typeof t&&t.success&&(t.data.message=t.data.message.filter((function(t){if(!e("#comment-"+t.comment_id).length)return t})),$(t),e("#wpd-bubble-count").removeClass("wpd-new-comments"),e("#wpd-bubble-count .wpd-new-comments-count").text("0"),E=[],e(".wpd-new-loaded-comment").length&&(ae(),e("html, body").animate({scrollTop:e(e(".wpd-new-loaded-comment")[0]).offset().top-(T+28)},1e3,oe)),ue(t)),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(e,t,a){console.log(a)}))}}))}if((x&&C||s)&&(t||!t&&p)&&setTimeout((function t(){e.ajax({type:"GET",url:wpdiscuzAjaxObj.bubbleUpdateUrl,beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",wpdiscuzAjaxObj.restNonce)},data:{postId:d,lastId:l,visibleCommentIds:ee()}}).done((function(a){if(!M)if("object"==typeof a){if(a.commentIDsToRemove.forEach((function(t){e("[id^=wpd-comm-"+t+"]").remove()})),a.ids.length){s&&function(){var t=new FormData;t.append("action","wpdUpdateAutomatically"),t.append("loadLastCommentId",r),t.append("visibleCommentIds",ee()),fe(v,!1,t).done((function(t){M||"object"==typeof t&&t.success&&($(t),t.data.wc_all_comments_count_new=parseInt(t.data.wc_all_comments_count_new),e(".wpd-thread-info").html(t.data.wc_all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",t.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(t.data.wc_all_comments_count_bubble_html),r=t.data.loadLastCommentId)})).fail((function(e,t,a){console.log(a)}))}(),a.ids=a.ids.filter((function(t){if(!e("#comment-"+t).length)return t}));var o=5e3;l=parseInt(a.ids[a.ids.length-1]),E=E.concat(a.ids),O&&a.commentText&&(e("#wpd-bubble-author-avatar").html(a.avatar),e("#wpd-bubble-author-name").html(a.authorName),e("#wpd-bubble-comment-date span").html(a.commentDate),e("#wpd-bubble-comment-text").html(a.commentText),e("#wpd-bubble-comment-reply-link a").attr("href",a.commentLink),e("#wpd-bubble-notification-message").show(),o=1e4);var n=parseInt(e(".wpd-new-comments-count").text());n+=a.ids.length,e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),e("#wpd-bubble-wrapper").addClass("wpd-new-comment-added"),setTimeout((function(){e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")}),o),e(".wpd-new-comments-count").text(n),e("#wpd-bubble-count").addClass("wpd-new-comments")}a.all_comments_count=parseInt(a.all_comments_count),e("#wpd-bubble-all-comments-count").replaceWith(a.all_comments_count_bubble_html),e(".wpd-reviews-tab").length||(e(".wpd-thread-info").html(a.all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",a.all_comments_count))}else console.log(a);setTimeout(t,c)})).fail((function(e,a,o){console.log(o),setTimeout(t,c)}))}),c),e(".wpd-inline-form-wrapper").length){var ce=new FormData;ce.append("action","wpdGetInlineCommentForm"),fe(v,!1,ce).done((function(t){"object"==typeof t?t.success?(e(".wpd-inline-form-wrapper").append(t.data),e.each(e("[name=_wpd_inline_nonce]"),(function(){var t=e(this).attr("id"),a=e(this).parents(".wpd-inline-shortcode").attr("id");e(this).attr("id",t+"-"+a.substring(a.lastIndexOf("-")+1))})),e(".wpd-inline-opened").addClass("wpd-active"),e(".wpd-inline-opened").find(".wpd-inline-form-wrapper").show(),e(".wpd-inline-opened").find(".wpd-inline-icon").addClass("wpd-open"),e(".wpd-inline-opened").find(".wpd-inline-icon").removeClass("wpd-ignored"),we()):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data]),t.data,"error"):console.log(t)})).fail((function(e,t,a){console.log(a)}))}function pe(t){if(e(t).hasClass("wpd-inline-shortcode"))var a=e(t).attr("id");else a=e(t).parents(".wpd-inline-shortcode").attr("id");return a.substring(a.lastIndexOf("-")+1)}function re(){e(".wpd-inline-form-wrapper").hide(),e(".wpd-inline-shortcode").removeClass("wpd-active"),e(".wpd-inline-icon").removeClass("wpd-open")}function le(){e.each(e(".wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon"),(function(){var t=e(this),a=t.offset().top-window.pageYOffset;t.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&a>0&&a<300&&("blink"===I?(t.addClass("wpd-blink"),setTimeout((function(){t.removeClass("wpd-blink")}),3e3)):(t.parents(".wpd-inline-shortcode").addClass("wpd-active"),t.siblings(".wpd-inline-form-wrapper").show(),t.addClass("wpd-open"),we(t.siblings(".wpd-inline-form-wrapper"))))}))}function we(t){if(t){if(t.offset().left<=10)t.css("left",Math.ceil(parseInt(t.css("left"))-t.offset().left+10)),(a=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))<3&&(a=3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"px;");else if(t.offset().left+t.width()>document.body.clientWidth-10){var a;t.css("left",Math.ceil(parseInt(t.css("left"))+(document.body.clientWidth-(t.offset().left+t.width()))-10)),(a=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))>t.width()-3&&(a=t.width()-3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"px;")}}else e.each(e(".wpd-inline-form-wrapper:visible"),(function(){if(e(this).offset().left<=10)e(this).css("left",Math.ceil(parseInt(e(this).css("left"))-e(this).offset().left+10)),(t=Math.ceil(e(this).siblings(".wpd-inline-icon.wpd-open").offset().left-e(this).offset().left+2))<3&&(t=3),document.styleSheets[0].addRule("#"+e(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+t+"px;");else if(e(this).offset().left+e(this).width()>document.body.clientWidth-10){var t;e(this).css("left",Math.ceil(parseInt(e(this).css("left"))+(document.body.clientWidth-(e(this).offset().left+e(this).width()))-10)),(t=Math.ceil(e(this).siblings(".wpd-inline-icon.wpd-open").offset().left-e(this).offset().left+2))>e(this).width()-3&&(t=e(this).width()-3),document.styleSheets[0].addRule("#"+e(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+t+"px;")}}))}function me(t){var a,o=0;if(t.parents(".wpd_main_comm_form").length)o=parseInt(wpdiscuzAjaxObj.commentTextMaxLength),a=t.parents(".wpd_main_comm_form");else if(t.parents(".wpd-secondary-form-wrapper").length)o=parseInt(wpdiscuzAjaxObj.replyTextMaxLength),a=t.parents(".wpd-secondary-form-wrapper");else if(t.parents("#wpdiscuz-edit-form").length){var n=X(t);o=parseInt(n.substring(n.lastIndexOf("_")+1))?parseInt(wpdiscuzAjaxObj.replyTextMaxLength):parseInt(wpdiscuzAjaxObj.commentTextMaxLength),a=t.parents("#wpdiscuz-edit-form")}if(o&&a){var i=t.val().length,d=e(".wpd-editor-char-counter",a),s=o-i;d.html(s),s<=10?d.addClass("error"):d.removeClass("error")}}function ue(t,a,o,n){t.data.callbackFunctions&&e.each(t.data.callbackFunctions,(function(e){"function"==typeof wpdiscuzAjaxObj[t.data.callbackFunctions[e]]?wpdiscuzAjaxObj[t.data.callbackFunctions[e]](t,a,o,n):"function"==typeof window[t.data.callbackFunctions[e]]?window[t.data.callbackFunctions[e]](t,a,o,n):console.log(t.data.callbackFunctions[e]+" is not a function")}))}function fe(t,a,o){a&&e("#wpdiscuz-loading-bar").show(),o.append("postId",d),o.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce);var n=o.get("action");wpdiscuzAjaxObj.dataFilterCallbacks&&wpdiscuzAjaxObj.dataFilterCallbacks[n]&&e.each(wpdiscuzAjaxObj.dataFilterCallbacks[n],(function(e){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]]&&(o=wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]](o,t,a))}));var i=t?wpdiscuzAjaxObj.url:wpdiscuzAjaxObj.customAjaxUrl;return e.ajax({type:"POST",url:i,data:o,contentType:!1,processData:!1})}function he(){if(t||wpdiscuzAjaxObj.validateNonceForGuests){var e=new FormData;e.append("action","wpdGetNonce"),fe(v,!1,e).done((function(e){"object"==typeof e?e.success?wpdiscuzAjaxObj.wpdiscuz_nonce=e.data:wpdiscuzAjaxObj.setCommentMessage(e.data,"error"):console.log(e)})).fail((function(e,t,a){console.log(a)}))}}e(document).on("click","body",(function(t){if(e(t.target).hasClass("wpd-inline-form-close")||e(t.target).parents(".wpd-inline-form-close").length)t.preventDefault(),e(t.target).parents(".wpd-inline-form-wrapper").hide(),e(t.target).parents(".wpd-inline-shortcode").removeClass("wpd-active"),e(t.target).parents(".wpd-inline-form-wrapper").siblings(".wpd-inline-icon").removeClass("wpd-open");else if(!e(t.target).hasClass("wpd-inline-form-wrapper")&&!e(t.target).parents(".wpd-inline-form-wrapper").length){re();var a="";e(t.target).hasClass("wpd-inline-icon")?a=e(t.target):e(t.target).parents(".wpd-inline-icon").length&&(a=e(t.target).parents(".wpd-inline-icon")),a.length&&a.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&(a.parents(".wpd-inline-shortcode").addClass("wpd-active"),a.siblings(".wpd-inline-form-wrapper").show(),a.addClass("wpd-open"),a.removeClass("wpd-ignored"),we(a.siblings(".wpd-inline-form-wrapper")))}(!e(t.target).hasClass("wpd-last-inline-comments-wrapper")&&!e(t.target).parents(".wpd-last-inline-comments-wrapper").length||e(t.target).parents(".wpd-last-inline-comments-wrapper").length&&e(t.target).hasClass("wpd-load-inline-comment"))&&e(".wpd-last-inline-comments-wrapper").remove()})),e("body").on("click",".wpd-inline-submit.wpd_not_clicked",(function(t){t.preventDefault();var a=e(this),o=e(this).parents(".wpd_inline_comm_form");if(o[0].checkValidity()){e(this).removeClass("wpd_not_clicked");var n=new FormData;n.append("action","wpdAddInlineComment"),n.append("inline_form_id",pe(o)),e.each(e("input, textarea",o),(function(t,a){"checkbox"===this.type?e(this).is(":checked")&&n.append(e(a).attr("name"),e(a).val()):n.append(e(a).attr("name"),e(a).val())})),fe(v,!0,n).done((function(t){if(a.addClass("wpd_not_clicked"),"object"==typeof t)if(t.success){o[0].reset(),re();var n=parseInt(t.data.newCount),i=a.parents(".wpd-inline-icon-wrapper").find(".wpd-inline-icon-count");i.text(n),n?i.addClass("wpd-has-comments"):i.removeClass("wpd-has-comments"),t.data.allCommentsCountNew=parseInt(t.data.allCommentsCountNew),e(".wpd-thread-info").html(t.data.allCommentsCountBeforeThreadsHtml),e(".wpd-thread-info").attr("data-comments-count",t.data.allCommentsCountNew),e("#wpd-bubble-all-comments-count").replaceWith(t.data.allCommentsCountBubbleHtml),t.data.message&&ne(t.data.message),wpdiscuzAjaxObj.setCommentMessage(t.data.notification,"success")}else t.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data],t.data,a),"error");else wpdiscuzAjaxObj.setCommentMessage(t,"error");e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}))}})),e("body").on("keydown",".wpd-form",(function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_comm_submit").trigger("click")})),e("body").on("keydown","#wpdiscuz-edit-form",(function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_save_edited_comment").trigger("click")})),e("body").on("keydown",".wpd-inline-comment-content",(function(t){t.ctrlKey&&13==t.keyCode&&e(this).parents(".wpd_inline_comm_form").find(".wpd-inline-submit.wpd_not_clicked").trigger("click")})),e("body").on("click",".wpd-inline-icon-count.wpd-has-comments",(function(){var t=e(this),a=new FormData;a.append("action","wpdGetLastInlineComments"),a.append("inline_form_id",pe(t)),fe(v,!0,a).done((function(a){"object"==typeof a?a.success?e(a.data).insertAfter(t):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"):console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e("body").on("click",".wpd-view-all-inline-comments",(function(t){t.preventDefault(),e(this).parents(".wpd-last-inline-comments-wrapper").remove(),e(".wpdf-inline").hasClass("wpdf-active")||e(".wpdf-inline").trigger("click"),ae(),e("html, body").animate({scrollTop:e(".wpdf-inline").offset().top-T},1e3,oe)})),e("body").on("click",".wpd-feedback-content-link",(function(t){t.preventDefault();var a=e(this).data("feedback-content-id");ae(),e("html, body").animate({scrollTop:e("#wpd-inline-"+a).offset().top-(T+6)},1e3,(function(){oe(),e("#wpd-inline-"+a).addClass("wpd-active")}))})),"scroll_open"!==I&&"blink"!==I||(le(),e(window).on("scroll",le)),e("body").on("click","#wpd-post-rating.wpd-not-rated .wpd-rate-starts svg",(function(){var t=new FormData,a=e(this).index();a>=0&&a<5&&(t.append("action","wpdUserRate"),t.append("rating",a+1),fe(v,!0,t).done((function(t){"object"==typeof t?(t.success?location.reload(!0):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data],t.data),"error"),ue(t)):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})))})),e("body").on("submit","#wpdiscuz-subscribe-form",(function(t){t.preventDefault();var a=e(this);const o=e("#wpdiscuz_subscription_button",a);if(a[0].checkValidity()&&(d=a,s=!0,"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",d).length&&!e("input[name=wpdiscuz_recaptcha_subscribe_form]",d).val().length?(s=!1,e(".wpdiscuz-recaptcha",d).css("border","1px solid red")):"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",d).length&&e(".wpdiscuz-recaptcha",d).css("border","none"),s)&&o.hasClass("wpd_not_clicked")){o.removeClass("wpd_not_clicked");var i=new FormData;i.append("action","wpdAddSubscription"),e("*",a).each((function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&i.append(this.name+"",e(this).val()),"checkbox"!=this.type&&"radio"!=this.type||e(this).is(":checked")&&i.append(this.name+"",e(this).val())})),fe(v,!0,i).done((function(t){"object"==typeof t?t.success?(wpdiscuzAjaxObj.setCommentMessage(t.data,"success"),setTimeout((function(){location.reload(!0)}),3e3)):wpdiscuzAjaxObj.setCommentMessage(t.data,"error"):wpdiscuzAjaxObj.setCommentMessage(t,"error"),e("#wpdiscuz-loading-bar").fadeOut(250),M=!1,o.addClass("wpd_not_clicked")})).fail((function(t,a,n){console.log(n),o.addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)}))}var d,s})),e("body").on("click",".wpd-unsubscribe",(function(t){t.preventDefault();var a=new FormData;a.append("action","wpdUnsubscribe"),a.append("sid",e(this).data("sid")),a.append("skey",e(this).data("skey")),fe(v,!0,a).done((function(t){"object"==typeof t?t.success?(wpdiscuzAjaxObj.setCommentMessage(t.data,"success"),setTimeout((function(){location.reload(!0)}),3e3)):wpdiscuzAjaxObj.setCommentMessage(t.data,"error"):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250),M=!1})).fail((function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),wpdiscuzAjaxObj.resetActiveFilters=function(t){e(".wpd-filter.wpdf-active"+(t?":not("+t+")":"")).removeClass("wpdf-active")},wpdiscuzAjaxObj.getAjaxObj=fe,wpdiscuzAjaxObj.initNonce=he,he()}));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(e){jQuery("#wpdiscuz-recaptcha-field-0_0").val("key")},"expired-callback":function(){jQuery("#wpdiscuz-recaptcha-field-0_0").val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.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 */
10
+ jQuery(document).ready(function(e){if(e("body").on("click","#wpdcom .wmu-upload-wrap",function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0)}),e("body").on("change",".wmu-add-files",function(){var a=e(this),t=a.parents(".wpd_comm_form"),r=a[0].files?a[0].files:[];r.length&&function a(t,r,o){r.attr("data-uploading","true");var d=new FormData;d.append("action","wmuUploadFiles"),d.append("wmuAttachmentsData",e(".wmu-attachments-data",r).val()),d.append("uniqueId",r.find(".wpdiscuz_unique_id").val());var m=0;e.each(o,function(e,a){m+=a.size,d.append(wpdiscuzAjaxObj.wmuInput+"["+e+"]",a)}),m>parseInt(wpdiscuzAjaxObj.wmuMaxFileSize)?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhraseMaxFileSize,"wmuPhraseMaxFileSize",t),"error",3e3):m>parseInt(wpdiscuzAjaxObj.wmuPostMaxSize)?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhrasePostMaxSize,"wmuPhrasePostMaxSize",t),"error",3e3):wpdiscuzAjaxObj.getAjaxObj(!0,!0,d).done(function(a){var t,o;a.success?(e(".wmu-attached-data-info",r).remove(),e(".wmu-add-files",r).after(a.data.attachmentsHtml),a.data.tooltip&&e(".wmu-upload-wrap",r).attr("wpd-tooltip",a.data.tooltip),t=r,o=a,e.each(o.data.previewsData,function(a,r){e(".wmu-action-wrap .wmu-"+a+"-tab",t).html(""),e.each(r,function(r,o){var d=o.id,m="",i=o.fullname,n=o.shortname;a==wpdiscuzAjaxObj.wmuKeyImages?(m=o.url,n=""):a==wpdiscuzAjaxObj.wmuKeyVideos?m=wpdiscuzAjaxObj.wmuIconVideo:a==wpdiscuzAjaxObj.wmuKeyFiles&&(m=wpdiscuzAjaxObj.wmuIconFile);var s='<div class="wmu-preview [PREVIEW_TYPE_CLASS]" title="[PREVIEW_TITLE]" data-wmu-type="[PREVIEW_TYPE]" data-wmu-attachment="[PREVIEW_ID]"><div class="wmu-preview-remove"><img class="wmu-preview-img" src="[PREVIEW_ICON]"><div class="wmu-file-name">[PREVIEW_FILENAME]</div><div class="wmu-delete">&nbsp;</div></div></div>';s=(s=(s=(s=(s=(s=s.replace("[PREVIEW_TYPE_CLASS]","wmu-preview-"+a)).replace("[PREVIEW_TITLE]",i)).replace("[PREVIEW_TYPE]",a)).replace("[PREVIEW_ID]",d)).replace("[PREVIEW_ICON]",m)).replace("[PREVIEW_FILENAME]",n),e(".wmu-action-wrap .wmu-"+a+"-tab",t).removeClass("wmu-hide").append(s)})}),a.data.errors&&(wpdiscuzAjaxObj.setCommentMessage(a.data.errors,"error",3e3),console.log(a.data.errors))):a.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data.errorCode],a.data.errorCode,r),"error",3e3):a.data.error&&wpdiscuzAjaxObj.setCommentMessage(a.data.error,"error",3e3),e("#wpdiscuz-loading-bar").fadeOut(250),r.attr("data-uploading","false")}).fail(function(a,t,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250),r.attr("data-uploading","false")})}(a,t,r)}),e("body").on("click",".wmu-attachment-delete",function(a){if(confirm(wpdiscuzAjaxObj.wmuPhraseConfirmDelete)){var t=e(this),r=t.data("wmu-attachment"),o=new FormData;o.append("action","wmuDeleteAttachment"),o.append("attachmentId",r),wpdiscuzAjaxObj.getAjaxObj(!0,!0,o).done(function(a){if(a.success){var r=t.parents(".wmu-comment-attachments");t.parent(".wmu-attachment").remove(),e(".wmu-attached-images *",r).length||e(".wmu-attached-images",r).remove(),e(".wmu-attached-videos *",r).length||e(".wmu-attached-videos",r).remove(),e(".wmu-attached-files *",r).length||e(".wmu-attached-files",r).remove()}else a.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data.errorCode],a.data.errorCode,r),"error",3e3):a.data.error&&wpdiscuzAjaxObj.setCommentMessage(a.data.error,"error",3e3);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,t,r){console.log(r),e("#wpdiscuz-loading-bar").fadeOut(250)})}else console.log("canceled")}),e("body").on("click",".wmu-preview",function(){var a=e(this),t=a.parents(".wpd_comm_form");a.data("wmu-type");var r=a.data("wmu-attachment"),o=new FormData;o.append("action","wmuRemoveAttachmentPreview"),o.append("attachmentId",r),o.append("wmuAttachmentsData",e(".wmu-attachments-data",t).val()),o.append("uniqueId",t.find(".wpdiscuz_unique_id").val()),wpdiscuzAjaxObj.getAjaxObj(!0,!0,o).done(function(r){if(r.success){a.remove();var o=e(".wmu-tabs",t);e.each(o,function(a,t){e(".wmu-preview",t).length?e(t).removeClass("wmu-hide"):e(t).addClass("wmu-hide")}),e(".wmu-attached-data-info",t).remove(),e(".wmu-add-files",t).after(r.data.attachmentsHtml),r.data.tooltip&&e(".wmu-upload-wrap",t).attr("wpd-tooltip",r.data.tooltip)}else r.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[r.data.errorCode],r.data.errorCode,t),"error",3e3):r.data.error&&wpdiscuzAjaxObj.setCommentMessage(r.data.error,"error",3e3);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,t,r){console.log(r),e("#wpdiscuz-loading-bar").fadeOut(250)})}),parseInt(wpdiscuzAjaxObj.wmuIsLightbox)){function a(){e(".wmu-lightbox").colorbox({maxHeight:"95%",maxWidth:"95%",rel:"wmu-lightbox",fixed:!0})}a(),wpdiscuzAjaxObj.wmuAddLightBox=a}wpdiscuzAjaxObj.wmuHideAll=function(a,t){"object"==typeof a?a.success?(e(".wmu-tabs",t).addClass("wmu-hide"),e(".wmu-preview",t).remove(),e(".wmu-attached-data-info",t).remove()):console.log(a.data):console.log(a)}});
11
  /* Lity */
12
  !function(e,t){"function"==typeof define&&define.amd?define(["jquery"],function(n){return t(e,n)}):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(e,require("jquery")):e.lity=t(e,e.jQuery||e.Zepto)}("undefined"!=typeof window?window:this,function(e,t){"use strict";var n=e.document,i=t(e),r=t.Deferred,o=t("html"),a=[],l="aria-hidden",s="lity-"+l,d='a[href],area[href],input:not([disabled]),select:not([disabled]),textarea:not([disabled]),button:not([disabled]),iframe,object,embed,[contenteditable],[tabindex]:not([tabindex^="-"])',c={esc:!0,handler:null,handlers:{image:C,inline:function(e,n){var i,r,o;try{i=t(e)}catch(e){return!1}if(!i.length)return!1;return r=t('<i style="display:none !important"/>'),o=i.hasClass("lity-hide"),n.element().one("lity:remove",function(){r.before(i).remove(),o&&!i.closest(".lity-content").length&&i.addClass("lity-hide")}),i.removeClass("lity-hide").after(r)},youtube:function(e){var n=f.exec(e);if(!n)return!1;return k(x(e,w("https://www.youtube"+(n[2]||"")+".com/embed/"+n[4],t.extend({autoplay:1},b(n[5]||"")))))},vimeo:function(e){var n=y.exec(e);if(!n)return!1;return k(x(e,w("https://player.vimeo.com/video/"+n[3],t.extend({autoplay:1},b(n[4]||"")))))},googlemaps:function(e){var t=v.exec(e);if(!t)return!1;return k(x(e,w("https://www.google."+t[3]+"/maps?"+t[6],{output:t[6].indexOf("layer=c")>0?"svembed":"embed"})))},facebookvideo:function(e){var n=p.exec(e);if(!n)return!1;0!==e.indexOf("http")&&(e="https:"+e);return k(x(e,w("https://www.facebook.com/plugins/video.php?href="+e,t.extend({autoplay:1},b(n[4]||"")))))},iframe:k},template:'<div class="lity" role="dialog" aria-label="Dialog Window (Press escape to close)" tabindex="-1"><div class="lity-wrap" data-lity-close role="document"><div class="lity-loader" aria-hidden="true">Loading...</div><div class="lity-container"><div class="lity-content"></div><button class="lity-close" type="button" aria-label="Close (Press escape to close)" data-lity-close>&times;</button></div></div></div>'},u=/(^data:image\/)|(\.(png|jpe?g|gif|svg|webp|bmp|ico|tiff?)(\?\S*)?$)/i,f=/(youtube(-nocookie)?\.com|youtu\.be)\/(watch\?v=|v\/|u\/|embed\/?)?([\w-]{11})(.*)?/i,y=/(vimeo(pro)?.com)\/(?:[^\d]+)?(\d+)\??(.*)?$/,v=/((maps|www)\.)?google\.([^\/\?]+)\/?((maps\/?)?\?)(.*)/i,p=/(facebook\.com)\/([a-z0-9_-]*)\/videos\/([0-9]*)(.*)?$/i,m=function(){var e=n.createElement("div"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in t)if(void 0!==e.style[i])return t[i];return!1}();function h(e){var t=r();return m&&e.length?(e.one(m,t.resolve),setTimeout(t.resolve,500)):t.resolve(),t.promise()}function g(e,n,i){if(1===arguments.length)return t.extend({},e);if("string"==typeof n){if(void 0===i)return void 0===e[n]?null:e[n];e[n]=i}else t.extend(e,n);return this}function b(e){for(var t,n=decodeURI(e.split("#")[0]).split("&"),i={},r=0,o=n.length;r<o;r++)n[r]&&(i[(t=n[r].split("="))[0]]=t[1]);return i}function w(e,n){return e+(e.indexOf("?")>-1?"&":"?")+t.param(n)}function x(e,t){var n=e.indexOf("#");return-1===n?t:(n>0&&(e=e.substr(n)),t+e)}function C(e,n){var i=n.opener()&&n.opener().data("lity-desc")||"Image with no description",o=t('<img src="'+e+'" alt="'+i+'"/>'),a=r(),l=function(){var e;a.reject((e="Failed loading image",t('<span class="lity-error"/>').append(e)))};return o.on("load",function(){if(0===this.naturalWidth)return l();a.resolve(o)}).on("error",l),a.promise()}function k(e){return'<div class="lity-iframe-container"><iframe frameborder="0" allowfullscreen src="'+e+'"/></div>'}function E(){return n.documentElement.clientHeight?.9*n.documentElement.clientHeight:Math.round(.9*i.height())}function j(e){var t,i,r,o=z();o&&(27===e.keyCode&&o.options("esc")&&o.close(),9===e.keyCode&&(t=e,i=o.element().find(d),r=i.index(n.activeElement),t.shiftKey&&r<=0?(i.get(i.length-1).focus(),t.preventDefault()):t.shiftKey||r!==i.length-1||(i.get(0).focus(),t.preventDefault())))}function D(){t.each(a,function(e,t){t.resize()})}function z(){return 0===a.length?null:a[0]}function T(e,d,u,f){var y,v,p,m,b,w,x,C,k,z,T,O=this,q=!1,W=!1;d=t.extend({},c,d),v=t(d.template),O.element=function(){return v},O.opener=function(){return u},O.options=t.proxy(g,O,d),O.handlers=t.proxy(g,O,d.handlers),O.resize=function(){q&&!W&&p.css("max-height",E()+"px").trigger("lity:resize",[O])},O.close=function(){if(q&&!W){var e;W=!0,(e=O).element().attr(l,"true"),1===a.length&&(o.removeClass("lity-active"),i.off({resize:D,keydown:j})),((a=t.grep(a,function(t){return e!==t})).length?a[0].element():t(".lity-hidden")).removeClass("lity-hidden").each(function(){var e=t(this),n=e.data(s);n?e.attr(l,n):e.removeAttr(l),e.removeData(s)});var d=r();if(f&&(n.activeElement===v[0]||t.contains(v[0],n.activeElement)))try{f.focus()}catch(e){}return p.trigger("lity:close",[O]),v.removeClass("lity-opened").addClass("lity-closed"),h(p.add(v)).always(function(){p.trigger("lity:remove",[O]),v.remove(),v=void 0,d.resolve()}),d.promise()}},m=e,b=O,w=d.handlers,x=d.handler,k="inline",z=t.extend({},w),x&&z[x]?(C=z[x](m,b),k=x):(t.each(["inline","iframe"],function(e,t){delete z[t],z[t]=w[t]}),t.each(z,function(e,t){return!t||!(!t.test||t.test(m,b))||(!1!==(C=t(m,b))?(k=e,!1):void 0)})),y={handler:k,content:C||""},v.attr(l,"false").addClass("lity-loading lity-opened lity-"+y.handler).appendTo("body").focus().on("click","[data-lity-close]",function(e){t(e.target).is("[data-lity-close]")&&O.close()}).trigger("lity:open",[O]),T=O,1===a.unshift(T)&&(o.addClass("lity-active"),i.on({resize:D,keydown:j})),t("body > *").not(T.element()).addClass("lity-hidden").each(function(){var e=t(this);void 0===e.data(s)&&e.data(s,e.attr(l)||null)}).attr(l,"true"),t.when(y.content).always(function(e){p=t(e).css("max-height",E()+"px"),v.find(".lity-loader").each(function(){var e=t(this);h(e).always(function(){e.remove()})}),v.removeClass("lity-loading").find(".lity-content").empty().append(p),q=!0,p.trigger("lity:ready",[O])})}function O(e,i,r){e.preventDefault?(e.preventDefault(),e=(r=t(this)).data("lity-target")||r.attr("rel")||r.attr("src")):r=t(r);var o=new T(e,t.extend({},r.data("lity-options")||r.data("lity"),i),r,n.activeElement);if(!e.preventDefault)return o}return C.test=function(e){return u.test(e)},O.version="2.2.2",O.options=t.proxy(g,O,c),O.handlers=t.proxy(g,O,c.handlers),O.current=z,t(n).on("click.lity","[data-wpd-lity]",O),O});
13
  /* My Content and Settings */
assets/js/wpdiscuz-combo.min.js CHANGED
@@ -7,11 +7,11 @@ 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()}),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 */
14
- jQuery(document).ready(function($){if($("body").on("click","#wpdcom .wmu-upload-wrap",function(){$(".wpd-form-foot",$(this).parents(".wpd_comm_form")).slideDown(parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0)}),$("body").on("change",".wmu-add-files",function(){var a=$(this),c=a.parents(".wpd_comm_form"),b=a[0].files?a[0].files:[];b.length&&function(c,b,e){b.attr("data-uploading","true");var a=new FormData;a.append("action","wmuUploadFiles"),a.append("wmuAttachmentsData",$(".wmu-attachments-data",b).val()),a.append("uniqueId",b.find(".wpdiscuz_unique_id").val());var d=0;$.each(e,function(c,b){d+=b.size,a.append(wpdiscuzAjaxObj.wmuInput+"["+c+"]",b)}),d>parseInt(wpdiscuzAjaxObj.wmuMaxFileSize)?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhraseMaxFileSize,"wmuPhraseMaxFileSize",c),"error",3e3):d>parseInt(wpdiscuzAjaxObj.wmuPostMaxSize)?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhrasePostMaxSize,"wmuPhrasePostMaxSize",c),"error",3e3):wpdiscuzAjaxObj.getAjaxObj(!0,!0,a).done(function(a){var d,c;a.success?($(".wmu-attached-data-info",b).remove(),$(".wmu-add-files",b).after(a.data.attachmentsHtml),a.data.tooltip&&$(".wmu-upload-wrap",b).attr("wpd-tooltip",a.data.tooltip),d=b,c=a,$.each(c.data.previewsData,function(a,b){$(".wmu-action-wrap .wmu-"+a+"-tab",d).html(""),$.each(b,function(i,c){var g=c.id,e="",h=c.fullname,f=c.shortname;a==wpdiscuzAjaxObj.wmuKeyImages?(e=c.url,f=""):a==wpdiscuzAjaxObj.wmuKeyVideos?e=wpdiscuzAjaxObj.wmuIconVideo:a==wpdiscuzAjaxObj.wmuKeyFiles&&(e=wpdiscuzAjaxObj.wmuIconFile);var b='<div class="wmu-preview [PREVIEW_TYPE_CLASS]" title="[PREVIEW_TITLE]" data-wmu-type="[PREVIEW_TYPE]" data-wmu-attachment="[PREVIEW_ID]"><div class="wmu-preview-remove"><img class="wmu-preview-img" src="[PREVIEW_ICON]"><div class="wmu-file-name">[PREVIEW_FILENAME]</div><div class="wmu-delete">&nbsp;</div></div></div>';b=(b=(b=(b=(b=(b=b.replace("[PREVIEW_TYPE_CLASS]","wmu-preview-"+a)).replace("[PREVIEW_TITLE]",h)).replace("[PREVIEW_TYPE]",a)).replace("[PREVIEW_ID]",g)).replace("[PREVIEW_ICON]",e)).replace("[PREVIEW_FILENAME]",f),$(".wmu-action-wrap .wmu-"+a+"-tab",d).removeClass("wmu-hide").append(b)})}),a.data.errors&&(wpdiscuzAjaxObj.setCommentMessage(a.data.errors,"error",3e3),console.log(a.data.errors))):a.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data.errorCode],a.data.errorCode,b),"error",3e3):a.data.error&&wpdiscuzAjaxObj.setCommentMessage(a.data.error,"error",3e3),$("#wpdiscuz-loading-bar").fadeOut(250),b.attr("data-uploading","false")}).fail(function(c,d,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250),b.attr("data-uploading","false")})}(a,c,b)}),$("body").on("click",".wmu-attachment-delete",function(c){if(confirm(wpdiscuzAjaxObj.wmuPhraseConfirmDelete)){var b=$(this).data("wmu-attachment"),a=new FormData;a.append("action","wmuDeleteAttachment"),a.append("attachmentId",b),wpdiscuzAjaxObj.getAjaxObj(!0,!0,a).done(function(c){if(c.success){var a=$(".wmu-attachment-"+b).parents(".wmu-comment-attachments");$(".wmu-attachment-"+b).remove(),$(".wmu-attached-images *",a).length||$(".wmu-attached-images",a).remove(),$(".wmu-attached-videos *",a).length||$(".wmu-attached-videos",a).remove(),$(".wmu-attached-files *",a).length||$(".wmu-attached-files",a).remove()}else c.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[c.data.errorCode],c.data.errorCode,a),"error",3e3):c.data.error&&wpdiscuzAjaxObj.setCommentMessage(c.data.error,"error",3e3);$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}else console.log("canceled")}),$("body").on("click",".wmu-preview",function(){var b=$(this),c=b.parents(".wpd_comm_form");b.data("wmu-type");var d=b.data("wmu-attachment"),a=new FormData;a.append("action","wmuRemoveAttachmentPreview"),a.append("attachmentId",d),a.append("wmuAttachmentsData",$(".wmu-attachments-data",c).val()),a.append("uniqueId",c.find(".wpdiscuz_unique_id").val()),wpdiscuzAjaxObj.getAjaxObj(!0,!0,a).done(function(a){if(a.success){b.remove();var d=$(".wmu-tabs",c);$.each(d,function(b,a){$(".wmu-preview",a).length?$(a).removeClass("wmu-hide"):$(a).addClass("wmu-hide")}),$(".wmu-attached-data-info",c).remove(),$(".wmu-add-files",c).after(a.data.attachmentsHtml),a.data.tooltip&&$(".wmu-upload-wrap",c).attr("wpd-tooltip",a.data.tooltip)}else a.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data.errorCode],a.data.errorCode,c),"error",3e3):a.data.error&&wpdiscuzAjaxObj.setCommentMessage(a.data.error,"error",3e3);$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),parseInt(wpdiscuzAjaxObj.wmuIsLightbox)){function a(){$(".wmu-lightbox").colorbox({maxHeight:"95%",maxWidth:"95%",rel:"wmu-lightbox",fixed:!0})}a(),wpdiscuzAjaxObj.wmuAddLightBox=a}wpdiscuzAjaxObj.wmuHideAll=function(a,b){"object"==typeof a?a.success?($(".wmu-tabs",b).addClass("wmu-hide"),$(".wmu-preview",b).remove(),$(".wmu-attached-data-info",b).remove()):console.log(a.data):console.log(a)}})
15
  /* Lity */
16
  !function(e,t){"function"==typeof define&&define.amd?define(["jquery"],function(n){return t(e,n)}):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(e,require("jquery")):e.lity=t(e,e.jQuery||e.Zepto)}("undefined"!=typeof window?window:this,function(e,t){"use strict";var n=e.document,i=t(e),r=t.Deferred,o=t("html"),a=[],l="aria-hidden",s="lity-"+l,d='a[href],area[href],input:not([disabled]),select:not([disabled]),textarea:not([disabled]),button:not([disabled]),iframe,object,embed,[contenteditable],[tabindex]:not([tabindex^="-"])',c={esc:!0,handler:null,handlers:{image:C,inline:function(e,n){var i,r,o;try{i=t(e)}catch(e){return!1}if(!i.length)return!1;return r=t('<i style="display:none !important"/>'),o=i.hasClass("lity-hide"),n.element().one("lity:remove",function(){r.before(i).remove(),o&&!i.closest(".lity-content").length&&i.addClass("lity-hide")}),i.removeClass("lity-hide").after(r)},youtube:function(e){var n=f.exec(e);if(!n)return!1;return k(x(e,w("https://www.youtube"+(n[2]||"")+".com/embed/"+n[4],t.extend({autoplay:1},b(n[5]||"")))))},vimeo:function(e){var n=y.exec(e);if(!n)return!1;return k(x(e,w("https://player.vimeo.com/video/"+n[3],t.extend({autoplay:1},b(n[4]||"")))))},googlemaps:function(e){var t=v.exec(e);if(!t)return!1;return k(x(e,w("https://www.google."+t[3]+"/maps?"+t[6],{output:t[6].indexOf("layer=c")>0?"svembed":"embed"})))},facebookvideo:function(e){var n=p.exec(e);if(!n)return!1;0!==e.indexOf("http")&&(e="https:"+e);return k(x(e,w("https://www.facebook.com/plugins/video.php?href="+e,t.extend({autoplay:1},b(n[4]||"")))))},iframe:k},template:'<div class="lity" role="dialog" aria-label="Dialog Window (Press escape to close)" tabindex="-1"><div class="lity-wrap" data-lity-close role="document"><div class="lity-loader" aria-hidden="true">Loading...</div><div class="lity-container"><div class="lity-content"></div><button class="lity-close" type="button" aria-label="Close (Press escape to close)" data-lity-close>&times;</button></div></div></div>'},u=/(^data:image\/)|(\.(png|jpe?g|gif|svg|webp|bmp|ico|tiff?)(\?\S*)?$)/i,f=/(youtube(-nocookie)?\.com|youtu\.be)\/(watch\?v=|v\/|u\/|embed\/?)?([\w-]{11})(.*)?/i,y=/(vimeo(pro)?.com)\/(?:[^\d]+)?(\d+)\??(.*)?$/,v=/((maps|www)\.)?google\.([^\/\?]+)\/?((maps\/?)?\?)(.*)/i,p=/(facebook\.com)\/([a-z0-9_-]*)\/videos\/([0-9]*)(.*)?$/i,m=function(){var e=n.createElement("div"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in t)if(void 0!==e.style[i])return t[i];return!1}();function h(e){var t=r();return m&&e.length?(e.one(m,t.resolve),setTimeout(t.resolve,500)):t.resolve(),t.promise()}function g(e,n,i){if(1===arguments.length)return t.extend({},e);if("string"==typeof n){if(void 0===i)return void 0===e[n]?null:e[n];e[n]=i}else t.extend(e,n);return this}function b(e){for(var t,n=decodeURI(e.split("#")[0]).split("&"),i={},r=0,o=n.length;r<o;r++)n[r]&&(i[(t=n[r].split("="))[0]]=t[1]);return i}function w(e,n){return e+(e.indexOf("?")>-1?"&":"?")+t.param(n)}function x(e,t){var n=e.indexOf("#");return-1===n?t:(n>0&&(e=e.substr(n)),t+e)}function C(e,n){var i=n.opener()&&n.opener().data("lity-desc")||"Image with no description",o=t('<img src="'+e+'" alt="'+i+'"/>'),a=r(),l=function(){var e;a.reject((e="Failed loading image",t('<span class="lity-error"/>').append(e)))};return o.on("load",function(){if(0===this.naturalWidth)return l();a.resolve(o)}).on("error",l),a.promise()}function k(e){return'<div class="lity-iframe-container"><iframe frameborder="0" allowfullscreen src="'+e+'"/></div>'}function E(){return n.documentElement.clientHeight?.9*n.documentElement.clientHeight:Math.round(.9*i.height())}function j(e){var t,i,r,o=z();o&&(27===e.keyCode&&o.options("esc")&&o.close(),9===e.keyCode&&(t=e,i=o.element().find(d),r=i.index(n.activeElement),t.shiftKey&&r<=0?(i.get(i.length-1).focus(),t.preventDefault()):t.shiftKey||r!==i.length-1||(i.get(0).focus(),t.preventDefault())))}function D(){t.each(a,function(e,t){t.resize()})}function z(){return 0===a.length?null:a[0]}function T(e,d,u,f){var y,v,p,m,b,w,x,C,k,z,T,O=this,q=!1,W=!1;d=t.extend({},c,d),v=t(d.template),O.element=function(){return v},O.opener=function(){return u},O.options=t.proxy(g,O,d),O.handlers=t.proxy(g,O,d.handlers),O.resize=function(){q&&!W&&p.css("max-height",E()+"px").trigger("lity:resize",[O])},O.close=function(){if(q&&!W){var e;W=!0,(e=O).element().attr(l,"true"),1===a.length&&(o.removeClass("lity-active"),i.off({resize:D,keydown:j})),((a=t.grep(a,function(t){return e!==t})).length?a[0].element():t(".lity-hidden")).removeClass("lity-hidden").each(function(){var e=t(this),n=e.data(s);n?e.attr(l,n):e.removeAttr(l),e.removeData(s)});var d=r();if(f&&(n.activeElement===v[0]||t.contains(v[0],n.activeElement)))try{f.focus()}catch(e){}return p.trigger("lity:close",[O]),v.removeClass("lity-opened").addClass("lity-closed"),h(p.add(v)).always(function(){p.trigger("lity:remove",[O]),v.remove(),v=void 0,d.resolve()}),d.promise()}},m=e,b=O,w=d.handlers,x=d.handler,k="inline",z=t.extend({},w),x&&z[x]?(C=z[x](m,b),k=x):(t.each(["inline","iframe"],function(e,t){delete z[t],z[t]=w[t]}),t.each(z,function(e,t){return!t||!(!t.test||t.test(m,b))||(!1!==(C=t(m,b))?(k=e,!1):void 0)})),y={handler:k,content:C||""},v.attr(l,"false").addClass("lity-loading lity-opened lity-"+y.handler).appendTo("body").focus().on("click","[data-lity-close]",function(e){t(e.target).is("[data-lity-close]")&&O.close()}).trigger("lity:open",[O]),T=O,1===a.unshift(T)&&(o.addClass("lity-active"),i.on({resize:D,keydown:j})),t("body > *").not(T.element()).addClass("lity-hidden").each(function(){var e=t(this);void 0===e.data(s)&&e.data(s,e.attr(l)||null)}).attr(l,"true"),t.when(y.content).always(function(e){p=t(e).css("max-height",E()+"px"),v.find(".lity-loader").each(function(){var e=t(this);h(e).always(function(){e.remove()})}),v.removeClass("lity-loading").find(".lity-content").empty().append(p),q=!0,p.trigger("lity:ready",[O])})}function O(e,i,r){e.preventDefault?(e.preventDefault(),e=(r=t(this)).data("lity-target")||r.attr("rel")||r.attr("src")):r=t(r);var o=new T(e,t.extend({},r.data("lity-options")||r.data("lity"),i),r,n.activeElement);if(!e.preventDefault)return o}return C.test=function(e){return u.test(e)},O.version="2.2.2",O.options=t.proxy(g,O,c),O.handlers=t.proxy(g,O,c.handlers),O.current=z,t(n).on("click.lity","[data-wpd-lity]",O),O});
17
  /* My Content and Settings */
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(e,t){wpdiscuzAjaxObj.setCommentMessage(e,t),setTimeout((function(){location.href=location.href.substring(0,location.href.indexOf("wpdiscuzUrlAnchor")-1)}),3e3)}wpdiscuzAjaxObj.setCommentMessage=function(e,t,a){var o="wpdiscuz-message-error";if(e instanceof Array)for(var n in e)t instanceof Array?"success"===t[n]?o="wpdiscuz-message-success":"warning"===t[n]&&(o="wpdiscuz-message-warning"):"success"===t?o="wpdiscuz-message-success":"warning"===t&&(o="wpdiscuz-message-warning"),jQuery("<div/>").addClass(o).html(e[n]).prependTo("#wpdiscuz-comment-message").delay(a instanceof Array?a[n]:a||4e3).fadeOut(1e3,(function(){jQuery(this).remove()}));else"success"===t?o="wpdiscuz-message-success":"warning"===t&&(o="wpdiscuz-message-warning"),jQuery("<div/>").addClass(o).html(e).prependTo("#wpdiscuz-comment-message").delay(a||4e3).fadeOut(1e3,(function(){jQuery(this).remove()}))},wpdiscuzAjaxObj.applyFilterOnPhrase=function(e,t,a){return wpdiscuzAjaxObj.phraseFilters&&jQuery.each(wpdiscuzAjaxObj.phraseFilters,(function(o){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[o]]&&(e=wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[o]](e,t,a))})),e},jQuery(document).ready((function(e){e("body").addClass("wpdiscuz_"+wpdiscuzAjaxObj.version);var t=wpdiscuzAjaxObj.is_user_logged_in,a=1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!t,o=1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&t,n=wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion,i=parseInt(wpdiscuzAjaxObj.commentListLoadType),d=parseInt(wpdiscuzAjaxObj.wc_post_id);wpdiscuzAjaxObj.wpdiscuz_nonce="";var s=parseInt(wpdiscuzAjaxObj.commentListUpdateType),c=1e3*parseInt(wpdiscuzAjaxObj.commentListUpdateTimer),p=parseInt(wpdiscuzAjaxObj.liveUpdateGuests),r=wpdiscuzAjaxObj.loadLastCommentId,l=r,w=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 m,u=parseInt(wpdiscuzAjaxObj.wordpressIsPaginate),f=wpdiscuzAjaxObj.storeCommenterData,h=parseInt(wpdiscuzAjaxObj.wmuEnabled),b=wpdiscuzAjaxObj.isCookiesEnabled,_=!0,g=wpdiscuzAjaxObj.cookiehash,z=parseInt(wpdiscuzAjaxObj.isLoadOnlyParentComments),j=parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0,v=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),x=parseInt(wpdiscuzAjaxObj.enableBubble),C=parseInt(wpdiscuzAjaxObj.bubbleLiveUpdate),y=parseInt(wpdiscuzAjaxObj.bubbleHintTimeout),k=parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout)?parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout):5,O=parseInt(wpdiscuzAjaxObj.bubbleShowNewCommentMessage),A=wpdiscuzAjaxObj.bubbleLocation,I=wpdiscuzAjaxObj.inlineFeedbackAttractionType,T=(T=parseInt(wpdiscuzAjaxObj.scrollSize))||32,D=[],F=[],E=[],M=!1,L=1,R=e("html").css("scroll-behavior"),S=e("body").css("scroll-behavior");(e(".wc_social_plugin_wrapper .wp-social-login-provider-list").length?e(".wc_social_plugin_wrapper .wp-social-login-provider-list").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .the_champ_login_container").length?e(".wc_social_plugin_wrapper .the_champ_login_container").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .social_connect_form").length?e(".wc_social_plugin_wrapper .social_connect_form").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .oneall_social_login_providers").length&&e(".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&&e("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0"),window.addEventListener("beforeunload",(function(t){var a=e(".wpd-form").not(":hidden");if(a.length)if(wpdiscuzLoadRichEditor&&document.querySelector(".wpdiscuz-textarea-wrap")){for(var o=0;o<a.length;o++)if("\n"!==wpDiscuzEditor.createEditor(e(a[o]).find(".ql-container").attr("id")).getText())return t.preventDefault(),void(t.returnValue="")}else for(o=0;o<a.length;o++)if(e(a[o]).find(".wc_comment").val())return t.preventDefault(),void(t.returnValue="")})),wpdiscuzLoadRichEditor||(e(document).delegate("textarea.wc_comment","input",(function(){me(e(this))})),e.each(e("textarea.wc_comment"),(function(){me(e(this))}))),e("body").on("focus","#wpdcom .ql-editor, #wpdcom .wc_comment",(function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(j)})),e("body").on("focus","#wpdcom textarea",(function(){e(this).next(".autogrow-textarea-mirror").length||e(this).autoGrow()})),t)||U({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)});if(e(".wpd-vote-down.wpd-dislike-hidden").remove(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd"),e("body").on("click","#wpd-editor-source-code-wrapper-bg",(function(){e(this).hide(),e("#wpd-editor-source-code-wrapper").hide(),e("#wpd-editor-uid").val(""),e("#wpd-editor-source-code").val("")})),wpdiscuzLoadRichEditor&&e("body").on("click","#wpd-insert-source-code",(function(){var t=wpDiscuzEditor.createEditor("#"+e("#wpd-editor-uid").val());t.deleteText(0,t.getLength(),Quill.sources.USER);var a=e("#wpd-editor-source-code").val();a.length&&t.clipboard.dangerouslyPasteHTML(0,a,Quill.sources.USER),t.update(),e("#wpd-editor-source-code-wrapper-bg").hide(),e("#wpd-editor-source-code-wrapper").hide(),e("#wpd-editor-uid").val(""),e("#wpd-editor-source-code").val("")})),e("body").on("click",".wpd-reply-button",(function(){var i=X(e(this),0);e(this).hasClass("wpdiscuz-clonned")?(wpdiscuzLoadRichEditor?setTimeout((function(){wpDiscuzEditor.createEditor("#wpd-editor-"+i).focus()}),j):setTimeout((function(){e("#wc-textarea-"+i).trigger("focus")}),j),e("#wpd-secondary-form-wrapper-"+i).slideToggle(j)):function(a){var o=X(a,0);e("#wpdiscuz_form_anchor-"+o).before(function(t){return e("#wpdiscuz_hidden_secondary_form").html().replace(/wpdiscuzuniqueid/g,t)}(o));var n=e("#wpd-secondary-form-wrapper-"+o);if(!t){U({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-"+o).focus()}),j):setTimeout((function(){e("#wc-textarea-"+o).trigger("focus")}),j);n.slideToggle(j,(function(){a.addClass("wpdiscuz-clonned")}))}(e(this)),function(t){if((a||o)&&"2.0"===n){var i=Y(t);setTimeout((function(){if(!F[i])try{F[i]=grecaptcha.render("wpdiscuz-recaptcha-"+t,{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(a){e("#wpdiscuz-recaptcha-field-"+t).val("key")},"expired-callback":function(){e("#wpdiscuz-recaptcha-field-"+t).val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}}),1e3)}}(i)})),e("body").on("click","#wpdcom [data-wpd-clipboard]",(function(){var t=e(this).data("wpd-clipboard"),a=e("<input/>");a.appendTo("body").css({position:"absolute",top:"-10000000px"}).val(t),a.trigger("select"),document.execCommand("copy"),a.remove(),wpdiscuzAjaxObj.setCommentMessage(t+"<br/>"+wpdiscuzAjaxObj.wc_copied_to_clipboard,"success",5e3)})),e("body").on("click",".wpdiscuz-nofollow,.wc_captcha_refresh_img,.wpd-load-more-submit",(function(e){e.preventDefault()})),e("body").on("click",".wpd-toggle.wpd_not_clicked",(function(){var t=e(this);t.removeClass("wpd_not_clicked");var a=X(e(this),0),o=e(this),n=e(".fas",o);!o.parents(".wpd-comment:not(.wpd-reply)").children(".wpd-reply").length&&z?function(t,a){var o=Y(t),n=new FormData;n.append("action","wpdShowReplies"),n.append("commentId",o),fe(v,!0,n).done((function(o){a.addClass("wpd_not_clicked"),"object"==typeof o&&o.success&&(e("#wpd-comm-"+t).replaceWith(o.data.comment_list),e("#wpd-comm-"+t+" .wpd-toggle .fas").removeClass("fa-chevron-down").addClass("fa-chevron-up"),e("#wpd-comm-"+t+" .wpd-toggle .wpd-view-replies .wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),e("#wpd-comm-"+t+" .wpd-toggle").attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text),ue(o)),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,n){console.log(n),a.addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)}))}(a,t):e("#wpd-comm-"+a+"> .wpd-reply").slideToggle(700,(function(){e(this).is(":hidden")?(n.removeClass("fa-chevron-up"),n.addClass("fa-chevron-down"),o.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_show_replies_text),o.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_show_replies_text)):(n.removeClass("fa-chevron-down"),n.addClass("fa-chevron-up"),o.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),o.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text)),t.addClass("wpd_not_clicked")}))})),e("body").on("mouseenter",".wpd-new-loaded-comment",(function(){e(this).removeClass("wpd-new-loaded-comment")})),e("body").on("click",".wpd-sbs-toggle",(function(){e(".wpdiscuz-subscribe-bar").slideToggle(j)})),parseInt(wpdiscuzAjaxObj.wpDiscuzIsShowOnSubscribeForm)&&!t&&wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&e("#wpdiscuz-subscribe-form").length&&("2.0"===n?(setTimeout((function(){try{grecaptcha.render("wpdiscuz-recaptcha-subscribe-form",{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(t){e("#wpdiscuz-recaptcha-field-subscribe-form").val("key")},"expired-callback":function(){e("#wpdiscuz-recaptcha-field-subscribe-form").val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}}),1e3),e("body").on("submit","#wpdiscuz-subscribe-form",(function(t){e("#wpdiscuz-recaptcha-field-subscribe-form").val()?e(".wpdiscuz-recaptcha",e(this)).css("border","none"):(e(".wpdiscuz-recaptcha",e(this)).css("border","1px solid red"),t.preventDefault())}))):"3.0"===n&&e("body").on("click","#wpdiscuz_subscription_button",(function(t){var a=e(this).parents("#wpdiscuz-subscribe-form");t.preventDefault();try{grecaptcha.ready((function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/wpdAddSubscription"}).then((function(e){console.log(5555),document.getElementById("wpdiscuz-recaptcha-field-subscribe-form").value=e,a.trigger("submit")}),(function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)}))}))}catch(t){console.log(t),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+t.message,"error")}}))),(a||o)&&"2.0"===n){var P=e(window).width(),q=e("#wpdcom").width();q>=1100&&(e("#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)"}),e("#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)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"65%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"35%"})),q>=940&&q<1100&&(e("#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)"}),e("#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)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"60%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"40%"})),q>=810&&q<940&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"40%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"60%"})),q>=730&&q<810&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#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)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"45%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"55%"})),q>=610&&q<730&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.85)","-webkit-transform":"scale(0.85)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"43%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"55%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"30%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"70%"})),P>650&&(q>=510&&q<610&&(e("#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)"}),e("#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)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"35%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"63%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"30%",position:"relative",right:"-60px"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"70%"}),e("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"})),q>=470&&q<510&&(e("#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)"}),e("#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)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"40%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"60%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({float:"none",width:"100%",display:"block"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({float:"none",width:"100%",display:"block"}),e("#wpdcom .wpd_main_comm_form .wc-form-footer").css({"margin-left":"0px"}),e("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"})),q<470&&(e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({margin:"0px auto","transform-origin":"center 0","-webkit-transform-origin":"center 0"}),e("#wpdcom .wpd-form-col-left").css({float:"none",width:"100%",display:"block"}),e("#wpdcom .wpd-form-col-right").css({float:"none",width:"100%",display:"block"}),e("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"}),e("#wpdcom .wpd-secondary-form-wrapper .wc_notification_checkboxes").css({"text-align":"center"}),e("#wpdcom .wpd-secondary-form-wrapper .wc-field-submit").css({"text-align":"center"})))}function H(t,a,o){fe(v||h,!1,a).done((function(a){if(e(o).addClass("wpd_not_clicked"),"object"==typeof a)if(a.success){"collapsed"===wpdiscuzAjaxObj.commentFormView&&e(".wpd-form-foot",t).slideUp(j),a.data.wc_all_comments_count_new=parseInt(a.data.wc_all_comments_count_new),e(".wpd-thread-info").html(a.data.wc_all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",a.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(a.data.wc_all_comments_count_bubble_html);var n=j;a.data.is_main?ne(a.data.message):(n=j+700,e("#wpd-secondary-form-wrapper-"+a.data.uniqueid).slideToggle(700),1==a.data.is_in_same_container?e("#wpd-secondary-form-wrapper-"+a.data.uniqueid).after(a.data.message):e("#wpd-comm-"+a.data.uniqueid).after(a.data.message)),function(e){if(!e.data.held_moderate){var t=new FormData;t.append("action","wpdCheckNotificationType"),t.append("comment_id",e.data.new_comment_id),t.append("email",e.data.comment_author_email),t.append("isParent",e.data.is_main),fe(v,!0,t)}}(a),function(e){if(e.data.redirect>0&&e.data.new_comment_id){var t=new FormData;t.append("action","wpdRedirect"),t.append("commentId",e.data.new_comment_id),fe(v,!0,t).done((function(e){"object"==typeof e&&e.success&&setTimeout((function(){location.href=e.data}),2e3)})).fail((function(e,t,a){console.log(a)}))}}(a),b&&_?function(t){var a=t.comment_author_email,o=t.comment_author,n=t.comment_author_url;null==f?(Cookies.set("comment_author_email_"+g,a),Cookies.set("comment_author_"+g,o),n.length&&Cookies.set("comment_author_url_"+g,n)):(f=parseInt(f),Cookies.set("comment_author_email_"+g,a,{expires:f,path:"/"}),Cookies.set("comment_author_"+g,o,{expires:f,path:"/"}),n.length&&Cookies.set("comment_author_url_"+g,n,{expires:f,path:"/"}));e(".wpd-cookies-checkbox").length&&e(".wpd-cookies-checkbox").prop("checked",!0)}(a.data):_||e(".wpd-cookies-checkbox").prop("checked",!1),t.get(0).reset(),wpdiscuzLoadRichEditor?wpDiscuzEditor.createEditor("#wpd-editor-"+e(".wpdiscuz_unique_id",t).val()).setContents([{insert:"\n"}]):me(t.find(".wc_comment")),U(a.data),e(".wmu-preview-wrap",t).remove(),D.length&&(D.forEach((function(e){e.parents(".wpd-field-checkbox").remove()})),D=[]),parseInt(wpdiscuzAjaxObj.scrollToComment)&&setTimeout((function(){ae(),e("html, body").animate({scrollTop:e("#comment-"+a.data.new_comment_id).offset().top-T},1e3,oe)}),n),ue(a,t)}else a.data&&(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"),ue(a,t));else wpdiscuzAjaxObj.setCommentMessage(a,"error");e("#wpdiscuz-loading-bar").fadeOut(250),M=!1})).fail((function(t,a,n){console.log(n),e(o).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)}))}function U(t){e(".wpd_comm_form .wc_name").val(t.comment_author),t.comment_author_email&&t.comment_author_email.indexOf("@example.com")<0&&e(".wpd_comm_form .wc_email").val(t.comment_author_email),t.comment_author_url&&e(".wpd_comm_form .wc_website").val(t.comment_author_url)}function W(t,a){e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").show(),e("#wpd-comm-"+t+" .wpdiscuz-edit-form-wrap").replaceWith(a),e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-last-edited").show()}e("body").on("click",".wc_comm_submit.wpd_not_clicked",(function(){var i=e(this),d=1,s=e(this).parents("form");if("true"!==s.attr("data-uploading")){if(s.hasClass("wpd_main_comm_form")||(d=function(t){var a=t.attr("class").split(" "),o="";return e.each(a,(function(e,t){"wpd_comment_level"===J(t,!1)&&(o=J(t,!0))})),parseInt(o)+1}(e(this).parents(".wpd-comment"))),te(s,"#wpd-editor-"+e(".wpdiscuz_unique_id",s).val()),s.on("submit",(function(e){e.preventDefault()})),s[0].checkValidity()&&(p=s,r=!0,"2.0"===n&&e("input[name=wc_captcha]",p).length&&!e("input[name=wc_captcha]",p).val().length?(r=!1,e(".wpdiscuz-recaptcha",p).css("border","1px solid red")):"2.0"===n&&e("input[name=wc_captcha]",p).length&&e(".wpdiscuz-recaptcha",p).css("border","none"),r)){M=!0,function(t){e(".wpd-agreement-checkbox",t).each((function(){e(this).hasClass("wpd_agreement_hide")&&b&&e(this).prop("checked")&&(Cookies.set(e(this).attr("name")+"_"+g,1,{expires:30,path:"/"}),e("input[name="+e(this).attr("name")+"]").each((function(){D.push(e(this))})))}))}(s),e(i).removeClass("wpd_not_clicked");var c=new FormData;if(c.append("action","wpdAddComment"),e(":input",s).each((function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&c.append(this.name+"",e(this).val().trim()),"checkbox"!=this.type&&"radio"!=this.type||e(this).is(":checked")&&c.append(this.name+"",e(this).val())})),c.append("wpd_comment_depth",d),wpdiscuzAjaxObj.wpdiscuz_zs&&c.append("wpdiscuz_zs",wpdiscuzAjaxObj.wpdiscuz_zs),e(".wpd-cookies-checkbox",s).length?e(".wpd-cookies-checkbox",s).prop("checked")||(_=!1):t&&(_=!1),e("#wpdiscuz-loading-bar").show(),wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&"3.0"===n&&(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(e){c.append("g-recaptcha-response",e),H(s,c,i)}),(function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)}))}))}catch(t){console.log(t),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+t.message,"error"),e("#wpdiscuz-loading-bar").fadeOut(250)}else H(s,c,i)}var p,r;!function(e){if((a||o)&&"2.0"===n){var t=Y(e);grecaptcha.reset(F[t])}}(e(".wpdiscuz_unique_id",s).val()),e(".wpdiscuz_reset").val("")}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhraseDoingUpload,"wmuPhraseDoingUpload",s),"warning")})),e("body").on("click",".wpd_editable_comment",(function(){m&&e(".wpdiscuz-edit-form-wrap").length&&W(X(e(".wpdiscuz-edit-form-wrap"),0),m);var t=e(this),a=X(t,0),o=Y(a),n=new FormData;n.append("action","wpdEditComment"),n.append("commentId",o),m=e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-text").get(0),fe(v,!0,n).done((function(o){if("object"==typeof o)if(o.success){if(e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text").replaceWith(o.data.html),wpdiscuzLoadRichEditor){var n=wpDiscuzEditor.createEditor("#wpd-editor-edit_"+a);n.clipboard.dangerouslyPasteHTML(0,o.data.content),n.update(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd")}else e("#wc-textarea-edit_"+a).val(o.data.content),me(e("#wc-textarea-edit_"+a));e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").hide(),e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-last-edited").hide()}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[o.data],o.data,t),"error");else console.log(o);e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e("body").on("click",".wc_save_edited_comment",(function(){var t=e(this),a=X(t),o=Y(a),n=e("#wpd-comm-"+a+" #wpdiscuz-edit-form");if(te(n,"#wpd-editor-edit_"+a),n.on("submit",(function(e){e.preventDefault()})),n[0].checkValidity()){var i=new FormData;i.append("action","wpdSaveEditedComment"),i.append("commentId",o),e(":input",n).each((function(){""!==this.name&&"checkbox"!==this.type&&"radio"!==this.type&&i.append(this.name+"",e(this).val()),"checkbox"!==this.type&&"radio"!==this.type||e(this).is(":checked")&&i.append(this.name+"",e(this).val())})),fe(v,!0,i).done((function(n){"object"==typeof n?(console.log("aaaa"),n.success?(W(a,n.data.message),n.data.comment_approved_html&&e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-subheader").append(n.data.comment_approved_html),n.data.lastEdited&&(e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-last-edited").remove(),e(n.data.lastEdited).insertAfter("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text")),n.data.twitterShareLink&&e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_tw").attr("href",n.data.twitterShareLink),n.data.whatsappShareLink&&e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_whatsapp").attr("href",n.data.whatsappShareLink),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+a)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[n.data],n.data,t),"error"),ue(n,o)):wpdiscuzAjaxObj.setCommentMessage(n,"error"),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}))}})),e("body").on("click",".wc_cancel_edit",(function(){var t=X(e(this));W(t,m),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)})),!u&&w&&(L=0,1==w?setTimeout((function(){V(!0)}),500):e("body").on("click",".wpd-load-comments",(function(){e(this).parent(".wpd-load-more-submit-wrap").remove(),V(!0)}))),e("body").on("click",".wpd-load-more-submit",(function(){var t=e(this),a="wpd-loaded";t.hasClass(a)&&V(!1,t,a,"wpd-loading")}));var B=!1;function N(){var t=document.getElementById("wpdiscuzHasMoreComments"),a=0;t&&(a=t.dataset.is_show_load_more);var o=document.getElementById("wpdcom")?document.getElementById("wpdcom").clientHeight:0,n=e(window).height()+e(window).scrollTop();o&&n&&(100*n/o>=80&&!1===B&&1==a&&(B=!0,V(!1,e(".wpd-load-more-submit"))))}function V(t,a,o,n){a&&(a.toggleClass(o),a.toggleClass(n));var d=new FormData;d.append("action","wpdLoadMoreComments");var s=e(".wpdiscuz-sort-button-active").attr("data-sorting");s&&d.append("sorting",s),d.append("offset",L),d.append("lastParentId",e(".wpd-load-more-submit").attr("data-lastparentid")),d.append("isFirstLoad",t?1:0);var c=e(".wpdf-active").attr("data-filter-type");d.append("wpdType",c||""),fe(v,!t||1!=w,d).done((function(d){"object"==typeof d&&d.success&&(L++,t&&e(".wpd-comment").remove(),e(".wpdiscuz_single").remove(),e(".wpdiscuz-comment-pagination").before(d.data.comment_list),K(d,t&&2!==i),B=!1,d.data.loadLastCommentId&&(r=d.data.loadLastCommentId),ue(d),t&&Q(!1)),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),a&&(a.toggleClass(o),a.toggleClass(n))})).fail((function(t,i,d){console.log(d),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),a&&(a.toggleClass(o),a.toggleClass(n))}))}function K(t,a){var o,n=document.getElementById("wpdiscuzHasMoreComments");if(0==t.data.is_show_load_more)n&&(n.dataset.is_show_load_more=0),e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide();else if(o=t.data.last_parent_id,e(".wpd-load-more-submit").attr("data-lastparentid",o),2!==i&&e(".wpdiscuz-comment-pagination").show(),n&&(n.dataset.is_show_load_more=1),a&&e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").show(),t.data.comments_left>0){if(!e(".wpd-load-more-submit .wpd-comments-left").length){const t=e("<span>");t.addClass("wpd-comments-left"),e(".wpd-load-more-submit").append(t)}e(".wpd-load-more-submit .wpd-comments-left").text(t.data.comments_left_text)}ue(t)}function Q(t){var a=location.href.match(/#comment\-(\d+)/);if(null!==a){var o=a[1];if(e("#comment-"+o).length)setTimeout((function(){ae(),e("html, body").animate({scrollTop:e("#comment-"+o).parents("[id^=wpd-comm-]").offset().top-T},1e3,oe),t&&G(o)}),500);else{var n=new FormData;n.append("action","wpdGetSingleComment"),n.append("commentId",o),fe(v,!0,n).done((function(a){if("object"==typeof a&&a.success){var n="#comment-"+o;e("#comment-"+a.data.parentCommentID).length?e("#comment-"+a.data.parentCommentID).parents("[id^=wpd-comm-"+a.data.parentCommentID+"]").replaceWith(a.data.message):e(".wpd-thread-list").prepend(a.data.message),ue(a),ae(),e("html, body").animate({scrollTop:e(n).offset().top-T},1e3,oe),t&&G(o)}e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}))}}}function G(t){setTimeout((function(){e("#comment-"+t).siblings(".wpd-secondary-form-wrapper").is(":visible")||e("#comment-"+t).find(".wpd-reply-button").trigger("click")}),1100)}function $(e){if(void 0!==e.data.message)for(var t,a=e.data.message,o=0;o<a.length;o++)Z((t=a[o]).comment_parent,t.comment_html)}function X(e,t){var a="";return(a=t?e.parents(".wpd-main-form-wrapper").attr("id"):e.parents(".wpd-comment").attr("id")).substring(a.lastIndexOf("-")+1)}function Y(e){return e.substring(0,e.indexOf("_"))}function J(e,t){return t?e.substring(e.indexOf("-")+1):e.substring(0,e.indexOf("-"))}function Z(t,a){if(0==t)ne(a);else{var o=X(e("#comment-"+t),0);e("#wpdiscuz_form_anchor-"+o).after(a)}}function ee(){var t=[];return e(".wpd-comment-right").each((function(){t.push(Y(X(e(this),0)))})),t.join(",")}function te(t,a){var o=t.find(".wpd-required-group");wpdiscuzLoadRichEditor&&t.find(".wc_comment").val(e(a+">.ql-editor").html()),function(e){var t=e.find(".wc_comment"),a=t.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 "),t.val(a)}(t),e.each(o,(function(){e("input",this).prop("required",!1),0===e("input:checked",this).length?e("input",e(this)).prop("required",!0):e(".wpd-field-invalid",this).remove()}))}function ae(){e("html, body").css("scroll-behavior","unset")}function oe(){e("html").css("scroll-behavior",R),e("body").css("scroll-behavior",S)}function ne(t){e(".wpd-sticky-comment").last()[0]?e(t).insertAfter(e(".wpd-sticky-comment").last()[0]):e(".wpd-thread-list").prepend(t)}function ie(t){t?t.prop("required")||(t.val()?t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none")):e.each(e(".wc_email"),(function(t,a){var o=e(a);o.prop("required")||(o.val()?o.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):o.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none"))}))}if(2!==i||u||(e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide(),N(),e(window).scroll((function(){N()}))),wpdiscuzAjaxObj.setLoadMoreVisibility=K,e("body").on("click",".wpd-vote-up.wpd_not_clicked, .wpd-vote-down.wpd_not_clicked",(function(){var t=e(this);e(t).removeClass("wpd_not_clicked");var a,o=Y(X(t));a=e(this).hasClass("wpd-vote-up")?1:-1;var n=new FormData;n.append("action","wpdVoteOnComment"),n.append("commentId",o),n.append("voteType",a),fe(v,!0,n).done((function(n){if(e(t).addClass("wpd_not_clicked"),"object"==typeof n){if(n.success){if("total"===n.data.buttonsStyle){var i=e(".wpd-comment-footer .wpd-vote-result",e("#comment-"+o)),d=n.data.votes;i.text(n.data.votesHumanReadable),i.attr("title",d),i.removeClass("wpd-up wpd-down"),d>0&&i.addClass("wpd-up"),d<0&&i.addClass("wpd-down")}else{var s=e(".wpd-comment-footer .wpd-vote-result-like",e("#comment-"+o)),c=e(".wpd-comment-footer .wpd-vote-result-dislike",e("#comment-"+o));s.text(n.data.likeCountHumanReadable),s.attr("title",n.data.likeCount),c.text(n.data.dislikeCountHumanReadable),c.attr("title",n.data.dislikeCount),parseInt(n.data.likeCount)>0?s.addClass("wpd-up"):s.removeClass("wpd-up"),parseInt(n.data.dislikeCount)<0?c.addClass("wpd-down"):c.removeClass("wpd-down")}var p=e(".wpd-comment-footer .wpd-vote-up",e("#comment-"+o)),r=e(".wpd-comment-footer .wpd-vote-down",e("#comment-"+o));p.removeClass("wpd-up"),r.removeClass("wpd-down"),n.data.curUserReaction>0?p.addClass("wpd-up"):n.data.curUserReaction<0&&r.addClass("wpd-down")}else n.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[n.data],n.data,t),"error");ue(n,o,a)}else console.log(n);e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(a,o,n){console.log(n),e(t).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e(document).on("click","body",(function(t){var a=e(".wpdiscuz-sort-buttons");e(t.target).hasClass("wpdf-sorting")||e(t.target).parent().hasClass("wpdf-sorting")?a.css({display:a.is(":visible")?"none":"flex"}):a.hide()})),e("body").on("click",".wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)",(function(){var t=e(this),a=e(this).attr("data-sorting");if(a){e(".wpdiscuz-sort-button.wpdiscuz-sort-button-active").removeClass("wpdiscuz-sort-button-active").appendTo(".wpdiscuz-sort-buttons"),t.addClass("wpdiscuz-sort-button-active").prependTo(".wpdf-sorting");var o=new FormData;o.append("action","wpdSorting"),o.append("sorting",a);var n=e(".wpdf-active").attr("data-filter-type");o.append("wpdType",n||""),fe(v,!0,o).done((function(t){"object"==typeof t&&t.success&&(e("#wpdcom .wpd-comment").remove(),e("#wpdcom .wpd-thread-list").prepend(t.data.message),K(t,!1),L=1),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}))}})),window.onhashchange=function(){Q(!1)},1!=w&&Q(!1),e("body").on("click",".wpdiscuz-readmore",(function(){var t=X(e(this)),a=Y(t),o=new FormData;o.append("action","wpdReadMore"),o.append("commentId",a),fe(v,!0,o).done((function(o){"object"==typeof o?(o.success?(e("#comment-"+a+" .wpd-comment-text").replaceWith(" "+o.data.message),e("#wpdiscuz-readmore-"+t).remove()):console.log(o.data),ue(o)):console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e("body").on("change",".wpd-required-group",(function(){0!==e("input:checked",this).length?e("input",e(this)).prop("required",!1):e("input",e(this)).prop("required",!0)})),e("body").on("click",".wpdiscuz-spoiler",(function(){e(this).next().slideToggle(),e(this).hasClass("wpdiscuz-spoiler-closed")?e(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-plus").removeClass("fa-plus").addClass("fa-minus"):e(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-minus").removeClass("fa-minus").addClass("fa-plus"),e(this).toggleClass("wpdiscuz-spoiler-closed")})),e("body").on("click",".wpd-tools i",(function(){var t=e(this).siblings(".wpd-tools-actions");t.is(":visible")||e(this).parents(".wpd-comment-right").attr("id")!==e("[id^=comment-]","#wpdcom").last().attr("id")||e("#comments").css({paddingBottom:"160px"}),t.css({display:t.is(":visible")?"none":"flex"})})),e("body").on("mouseleave",".wpd-comment-right",(function(){e(this).find(".wpd-tools-actions").hide(),e("#comments").css({paddingBottom:"0"})})),e("body").on("click",".wpd_stick_btn",(function(){var t=Y(X(e(this),0)),a=new FormData;a.append("action","wpdStickComment"),a.append("commentId",t),fe(v,!0,a).done((function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e("body").on("click",".wpd_close_btn",(function(){var t=Y(X(e(this),0)),a=new FormData;a.append("action","wpdCloseThread"),a.append("commentId",t),fe(v,!0,a).done((function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e("body").on("click",".wpd-filter.wpd_not_clicked[data-filter-type]",(function(){var t=e(this),a=t.attr("data-filter-type");wpdiscuzAjaxObj.resetActiveFilters(".wpdf-"+a),t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var o=new FormData;o.append("action","wpdLoadMoreComments");var n=e(".wpdiscuz-sort-button-active").attr("data-sorting");n&&o.append("sorting",n),o.append("lastParentId",0),o.append("offset",0),L=1,o.append("wpdType",t.hasClass("wpdf-active")?"":a),o.append("isFirstLoad",1),e(this).hasClass("wpdf-inline")?e(this).hasClass("wpdf-active")?e(".wpd-comment-info-bar").hide():e(".wpd-comment-info-bar").css("display","flex"):e(".wpd-comment-info-bar").hide(),fe(v,!1,o).done((function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(t.toggleClass("wpdf-active"),e(".wpd-load-comments").remove(),e(".wpd-comment").remove(),e(".wpd-thread-list").prepend(a.data.comment_list),K(a),r=a.data.loadLastCommentId,e(".wpd-load-more-submit").blur(),ue(a)),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e("body").on("click",".wpdf-reacted.wpd_not_clicked",(function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var a=new FormData;a.append("action","wpdMostReactedComment"),fe(v,!1,a).done((function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(e("#comment-"+a.data.parentCommentID).length?e("#comment-"+a.data.parentCommentID).parents("[id^=wpd-comm-"+a.data.parentCommentID+"]").replaceWith(a.data.message):e("#comment-"+a.data.commentId).length||e(".wpd-thread-list").prepend(a.data.message),ue(a),ae(),e("html, body").animate({scrollTop:e("#comment-"+a.data.commentId).offset().top-T},1e3,oe))})).fail((function(a,o,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner")}))})),e("body").on("click",".wpdf-hottest.wpd_not_clicked",(function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var a=new FormData;a.append("action","wpdHottestThread"),fe(v,!1,a).done((function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(e("#comment-"+a.data.commentId).length?e("#comment-"+a.data.commentId).parents("[id^=wpd-comm-"+a.data.commentId+"]").replaceWith(a.data.message):e(".wpd-thread-list").prepend(a.data.message),ue(a),ae(),e("html, body").animate({scrollTop:e("#comment-"+a.data.commentId).offset().top-T},1e3,oe))})).fail((function(a,o,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner")}))})),e("body").on("click",".wpd-filter-view-all",(function(){e(".wpdf-inline.wpdf-active.wpd_not_clicked").trigger("click")})),e("body").on("click",".wpd-follow-link.wpd_not_clicked",(function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var a=Y(X(t,0)),o=new FormData;o.append("action","wpdFollowUser"),o.append("commentId",a),fe(v,!0,o).done((function(a){t.addClass("wpd_not_clicked"),"object"==typeof a?a.success?(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data.code],a.data.code,t),"success"),t.removeClass("wpd-follow-active"),a.data.followTip&&t.attr("wpd-tooltip",a.data.followTip),a.data.followClass&&t.addClass(a.data.followClass),ue(a)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"):console.log(a),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(a,o,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),ie(),e("body").on("keyup",".wc_email",(function(){ie(e(this))})),x&&e("#wpdcom").length){if(e("#wpd-bubble-wrapper").hover((function(){e(this).addClass("wpd-bubble-hover")}),(function(){e(this).removeClass("wpd-bubble-hover")})),y&&!Cookies.get(wpdiscuzAjaxObj.cookieHideBubbleHint)&&setTimeout((function(){e("#wpd-bubble-wrapper").addClass("wpd-bubble-hover"),Cookies.set(wpdiscuzAjaxObj.cookieHideBubbleHint,"1",{expires:7,path:"/"}),setTimeout((function(){e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")}),1e3*k)}),1e3*y),"content_left"===A)if(e(".entry-content").length){var de=(se=Math.min(e(".entry-content").offset().left,e("#wpdcom").offset().left)-120)>25?se:25;e("#wpd-bubble-wrapper").css({left:de+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".post-entry").length){de=(se=Math.min(e(".post-entry").offset().left,e("#wpdcom").offset().left)-120)>25?se:25;e("#wpd-bubble-wrapper").css({left:de+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".container").length){var se;de=(se=Math.min(e(".container").offset().left,e("#wpdcom").offset().left)-120)>25?se:25;e("#wpd-bubble-wrapper").css({left:de+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else e("#wpd-bubble-wrapper").css({left:"25px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-corner");else"left_corner"===A?(e("#wpd-bubble-wrapper").css({left:"25px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-corner")):"right_corner"===A&&(e("#wpd-bubble-wrapper").css({right:"25px"}),e("#wpd-bubble-wrapper").addClass("wpd-right-corner"));e("#wpd-bubble-wrapper").show(),e("body").on("click","#wpd-bubble-add-message-close",(function(t){t.preventDefault(),t.stopPropagation(),e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")})),e("body").on("click","#wpd-bubble",(function(){ae(),e("#tab-title-reviews").length&&e("#tab-title-reviews a").trigger("click"),e("html, body").animate({scrollTop:e("#wpdcom").offset().top-(T+28)},1e3,(function(){oe(),e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover"),wpdiscuzLoadRichEditor?e("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0").focus():e("#wc-textarea-0_0").length&&e("#wc-textarea-0_0").trigger("focus")}))})),e("body").on("click","#wpd-bubble-comment-close",(function(t){t.preventDefault(),e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")})),e("body").on("click","#wpd-bubble-comment-reply-link a",(function(){var t=e(this).attr("href");setTimeout((function(){e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),Q(!0);var a=t.match(/#comment\-(\d+)/);E=E.filter((function(e){return e!=a[1]})),e("#wpd-bubble-count .wpd-new-comments-count").text(E.length),0==E.length&&e("#wpd-bubble-count").removeClass("wpd-new-comments")}),100)})),e("body").on("click","#wpd-bubble-count",(function(){if(E.length){var t=new FormData;t.append("action","wpdBubbleUpdate"),t.append("newCommentIds",E.join()),fe(v,!0,t).done((function(t){"object"==typeof t&&t.success&&(t.data.message=t.data.message.filter((function(t){if(!e("#comment-"+t.comment_id).length)return t})),$(t),e("#wpd-bubble-count").removeClass("wpd-new-comments"),e("#wpd-bubble-count .wpd-new-comments-count").text("0"),E=[],e(".wpd-new-loaded-comment").length&&(ae(),e("html, body").animate({scrollTop:e(e(".wpd-new-loaded-comment")[0]).offset().top-(T+28)},1e3,oe)),ue(t)),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(e,t,a){console.log(a)}))}}))}if((x&&C||s)&&(t||!t&&p)&&setTimeout((function t(){e.ajax({type:"GET",url:wpdiscuzAjaxObj.bubbleUpdateUrl,beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",wpdiscuzAjaxObj.restNonce)},data:{postId:d,lastId:l,visibleCommentIds:ee()}}).done((function(a){if(!M)if("object"==typeof a){if(a.commentIDsToRemove.forEach((function(t){e("[id^=wpd-comm-"+t+"]").remove()})),a.ids.length){s&&function(){var t=new FormData;t.append("action","wpdUpdateAutomatically"),t.append("loadLastCommentId",r),t.append("visibleCommentIds",ee()),fe(v,!1,t).done((function(t){M||"object"==typeof t&&t.success&&($(t),t.data.wc_all_comments_count_new=parseInt(t.data.wc_all_comments_count_new),e(".wpd-thread-info").html(t.data.wc_all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",t.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(t.data.wc_all_comments_count_bubble_html),r=t.data.loadLastCommentId)})).fail((function(e,t,a){console.log(a)}))}(),a.ids=a.ids.filter((function(t){if(!e("#comment-"+t).length)return t}));var o=5e3;l=parseInt(a.ids[a.ids.length-1]),E=E.concat(a.ids),O&&a.commentText&&(e("#wpd-bubble-author-avatar").html(a.avatar),e("#wpd-bubble-author-name").html(a.authorName),e("#wpd-bubble-comment-date span").html(a.commentDate),e("#wpd-bubble-comment-text").html(a.commentText),e("#wpd-bubble-comment-reply-link a").attr("href",a.commentLink),e("#wpd-bubble-notification-message").show(),o=1e4);var n=parseInt(e(".wpd-new-comments-count").text());n+=a.ids.length,e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),e("#wpd-bubble-wrapper").addClass("wpd-new-comment-added"),setTimeout((function(){e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")}),o),e(".wpd-new-comments-count").text(n),e("#wpd-bubble-count").addClass("wpd-new-comments")}a.all_comments_count=parseInt(a.all_comments_count),e("#wpd-bubble-all-comments-count").replaceWith(a.all_comments_count_bubble_html),e(".wpd-reviews-tab").length||(e(".wpd-thread-info").html(a.all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",a.all_comments_count))}else console.log(a);setTimeout(t,c)})).fail((function(e,a,o){console.log(o),setTimeout(t,c)}))}),c),e(".wpd-inline-form-wrapper").length){var ce=new FormData;ce.append("action","wpdGetInlineCommentForm"),fe(v,!1,ce).done((function(t){"object"==typeof t?t.success?(e(".wpd-inline-form-wrapper").append(t.data),e.each(e("[name=_wpd_inline_nonce]"),(function(){var t=e(this).attr("id"),a=e(this).parents(".wpd-inline-shortcode").attr("id");e(this).attr("id",t+"-"+a.substring(a.lastIndexOf("-")+1))})),e(".wpd-inline-opened").addClass("wpd-active"),e(".wpd-inline-opened").find(".wpd-inline-form-wrapper").show(),e(".wpd-inline-opened").find(".wpd-inline-icon").addClass("wpd-open"),e(".wpd-inline-opened").find(".wpd-inline-icon").removeClass("wpd-ignored"),we()):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data]),t.data,"error"):console.log(t)})).fail((function(e,t,a){console.log(a)}))}function pe(t){if(e(t).hasClass("wpd-inline-shortcode"))var a=e(t).attr("id");else a=e(t).parents(".wpd-inline-shortcode").attr("id");return a.substring(a.lastIndexOf("-")+1)}function re(){e(".wpd-inline-form-wrapper").hide(),e(".wpd-inline-shortcode").removeClass("wpd-active"),e(".wpd-inline-icon").removeClass("wpd-open")}function le(){e.each(e(".wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon"),(function(){var t=e(this),a=t.offset().top-window.pageYOffset;t.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&a>0&&a<300&&("blink"===I?(t.addClass("wpd-blink"),setTimeout((function(){t.removeClass("wpd-blink")}),3e3)):(t.parents(".wpd-inline-shortcode").addClass("wpd-active"),t.siblings(".wpd-inline-form-wrapper").show(),t.addClass("wpd-open"),we(t.siblings(".wpd-inline-form-wrapper"))))}))}function we(t){if(t){if(t.offset().left<=10)t.css("left",Math.ceil(parseInt(t.css("left"))-t.offset().left+10)),(a=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))<3&&(a=3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"px;");else if(t.offset().left+t.width()>document.body.clientWidth-10){var a;t.css("left",Math.ceil(parseInt(t.css("left"))+(document.body.clientWidth-(t.offset().left+t.width()))-10)),(a=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))>t.width()-3&&(a=t.width()-3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"px;")}}else e.each(e(".wpd-inline-form-wrapper:visible"),(function(){if(e(this).offset().left<=10)e(this).css("left",Math.ceil(parseInt(e(this).css("left"))-e(this).offset().left+10)),(t=Math.ceil(e(this).siblings(".wpd-inline-icon.wpd-open").offset().left-e(this).offset().left+2))<3&&(t=3),document.styleSheets[0].addRule("#"+e(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+t+"px;");else if(e(this).offset().left+e(this).width()>document.body.clientWidth-10){var t;e(this).css("left",Math.ceil(parseInt(e(this).css("left"))+(document.body.clientWidth-(e(this).offset().left+e(this).width()))-10)),(t=Math.ceil(e(this).siblings(".wpd-inline-icon.wpd-open").offset().left-e(this).offset().left+2))>e(this).width()-3&&(t=e(this).width()-3),document.styleSheets[0].addRule("#"+e(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+t+"px;")}}))}function me(t){var a,o=0;if(t.parents(".wpd_main_comm_form").length)o=parseInt(wpdiscuzAjaxObj.commentTextMaxLength),a=t.parents(".wpd_main_comm_form");else if(t.parents(".wpd-secondary-form-wrapper").length)o=parseInt(wpdiscuzAjaxObj.replyTextMaxLength),a=t.parents(".wpd-secondary-form-wrapper");else if(t.parents("#wpdiscuz-edit-form").length){var n=X(t);o=parseInt(n.substring(n.lastIndexOf("_")+1))?parseInt(wpdiscuzAjaxObj.replyTextMaxLength):parseInt(wpdiscuzAjaxObj.commentTextMaxLength),a=t.parents("#wpdiscuz-edit-form")}if(o&&a){var i=t.val().length,d=e(".wpd-editor-char-counter",a),s=o-i;d.html(s),s<=10?d.addClass("error"):d.removeClass("error")}}function ue(t,a,o,n){t.data.callbackFunctions&&e.each(t.data.callbackFunctions,(function(e){"function"==typeof wpdiscuzAjaxObj[t.data.callbackFunctions[e]]?wpdiscuzAjaxObj[t.data.callbackFunctions[e]](t,a,o,n):"function"==typeof window[t.data.callbackFunctions[e]]?window[t.data.callbackFunctions[e]](t,a,o,n):console.log(t.data.callbackFunctions[e]+" is not a function")}))}function fe(t,a,o){a&&e("#wpdiscuz-loading-bar").show(),o.append("postId",d),o.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce);var n=o.get("action");wpdiscuzAjaxObj.dataFilterCallbacks&&wpdiscuzAjaxObj.dataFilterCallbacks[n]&&e.each(wpdiscuzAjaxObj.dataFilterCallbacks[n],(function(e){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]]&&(o=wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]](o,t,a))}));var i=t?wpdiscuzAjaxObj.url:wpdiscuzAjaxObj.customAjaxUrl;return e.ajax({type:"POST",url:i,data:o,contentType:!1,processData:!1})}function he(){if(t||wpdiscuzAjaxObj.validateNonceForGuests){var e=new FormData;e.append("action","wpdGetNonce"),fe(v,!1,e).done((function(e){"object"==typeof e?e.success?wpdiscuzAjaxObj.wpdiscuz_nonce=e.data:wpdiscuzAjaxObj.setCommentMessage(e.data,"error"):console.log(e)})).fail((function(e,t,a){console.log(a)}))}}e(document).on("click","body",(function(t){if(e(t.target).hasClass("wpd-inline-form-close")||e(t.target).parents(".wpd-inline-form-close").length)t.preventDefault(),e(t.target).parents(".wpd-inline-form-wrapper").hide(),e(t.target).parents(".wpd-inline-shortcode").removeClass("wpd-active"),e(t.target).parents(".wpd-inline-form-wrapper").siblings(".wpd-inline-icon").removeClass("wpd-open");else if(!e(t.target).hasClass("wpd-inline-form-wrapper")&&!e(t.target).parents(".wpd-inline-form-wrapper").length){re();var a="";e(t.target).hasClass("wpd-inline-icon")?a=e(t.target):e(t.target).parents(".wpd-inline-icon").length&&(a=e(t.target).parents(".wpd-inline-icon")),a.length&&a.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&(a.parents(".wpd-inline-shortcode").addClass("wpd-active"),a.siblings(".wpd-inline-form-wrapper").show(),a.addClass("wpd-open"),a.removeClass("wpd-ignored"),we(a.siblings(".wpd-inline-form-wrapper")))}(!e(t.target).hasClass("wpd-last-inline-comments-wrapper")&&!e(t.target).parents(".wpd-last-inline-comments-wrapper").length||e(t.target).parents(".wpd-last-inline-comments-wrapper").length&&e(t.target).hasClass("wpd-load-inline-comment"))&&e(".wpd-last-inline-comments-wrapper").remove()})),e("body").on("click",".wpd-inline-submit.wpd_not_clicked",(function(t){t.preventDefault();var a=e(this),o=e(this).parents(".wpd_inline_comm_form");if(o[0].checkValidity()){e(this).removeClass("wpd_not_clicked");var n=new FormData;n.append("action","wpdAddInlineComment"),n.append("inline_form_id",pe(o)),e.each(e("input, textarea",o),(function(t,a){"checkbox"===this.type?e(this).is(":checked")&&n.append(e(a).attr("name"),e(a).val()):n.append(e(a).attr("name"),e(a).val())})),fe(v,!0,n).done((function(t){if(a.addClass("wpd_not_clicked"),"object"==typeof t)if(t.success){o[0].reset(),re();var n=parseInt(t.data.newCount),i=a.parents(".wpd-inline-icon-wrapper").find(".wpd-inline-icon-count");i.text(n),n?i.addClass("wpd-has-comments"):i.removeClass("wpd-has-comments"),t.data.allCommentsCountNew=parseInt(t.data.allCommentsCountNew),e(".wpd-thread-info").html(t.data.allCommentsCountBeforeThreadsHtml),e(".wpd-thread-info").attr("data-comments-count",t.data.allCommentsCountNew),e("#wpd-bubble-all-comments-count").replaceWith(t.data.allCommentsCountBubbleHtml),t.data.message&&ne(t.data.message),wpdiscuzAjaxObj.setCommentMessage(t.data.notification,"success")}else t.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data],t.data,a),"error");else wpdiscuzAjaxObj.setCommentMessage(t,"error");e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}))}})),e("body").on("keydown",".wpd-form",(function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_comm_submit").trigger("click")})),e("body").on("keydown","#wpdiscuz-edit-form",(function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_save_edited_comment").trigger("click")})),e("body").on("keydown",".wpd-inline-comment-content",(function(t){t.ctrlKey&&13==t.keyCode&&e(this).parents(".wpd_inline_comm_form").find(".wpd-inline-submit.wpd_not_clicked").trigger("click")})),e("body").on("click",".wpd-inline-icon-count.wpd-has-comments",(function(){var t=e(this),a=new FormData;a.append("action","wpdGetLastInlineComments"),a.append("inline_form_id",pe(t)),fe(v,!0,a).done((function(a){"object"==typeof a?a.success?e(a.data).insertAfter(t):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"):console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e("body").on("click",".wpd-view-all-inline-comments",(function(t){t.preventDefault(),e(this).parents(".wpd-last-inline-comments-wrapper").remove(),e(".wpdf-inline").hasClass("wpdf-active")||e(".wpdf-inline").trigger("click"),ae(),e("html, body").animate({scrollTop:e(".wpdf-inline").offset().top-T},1e3,oe)})),e("body").on("click",".wpd-feedback-content-link",(function(t){t.preventDefault();var a=e(this).data("feedback-content-id");ae(),e("html, body").animate({scrollTop:e("#wpd-inline-"+a).offset().top-(T+6)},1e3,(function(){oe(),e("#wpd-inline-"+a).addClass("wpd-active")}))})),"scroll_open"!==I&&"blink"!==I||(le(),e(window).on("scroll",le)),e("body").on("click","#wpd-post-rating.wpd-not-rated .wpd-rate-starts svg",(function(){var t=new FormData,a=e(this).index();a>=0&&a<5&&(t.append("action","wpdUserRate"),t.append("rating",a+1),fe(v,!0,t).done((function(t){"object"==typeof t?(t.success?location.reload(!0):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data],t.data),"error"),ue(t)):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})))})),e("body").on("submit","#wpdiscuz-subscribe-form",(function(t){t.preventDefault();var a=e(this);const o=e("#wpdiscuz_subscription_button",a);if(a[0].checkValidity()&&(d=a,s=!0,"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",d).length&&!e("input[name=wpdiscuz_recaptcha_subscribe_form]",d).val().length?(s=!1,e(".wpdiscuz-recaptcha",d).css("border","1px solid red")):"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",d).length&&e(".wpdiscuz-recaptcha",d).css("border","none"),s)&&o.hasClass("wpd_not_clicked")){o.removeClass("wpd_not_clicked");var i=new FormData;i.append("action","wpdAddSubscription"),e("*",a).each((function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&i.append(this.name+"",e(this).val()),"checkbox"!=this.type&&"radio"!=this.type||e(this).is(":checked")&&i.append(this.name+"",e(this).val())})),fe(v,!0,i).done((function(t){"object"==typeof t?t.success?(wpdiscuzAjaxObj.setCommentMessage(t.data,"success"),setTimeout((function(){location.reload(!0)}),3e3)):wpdiscuzAjaxObj.setCommentMessage(t.data,"error"):wpdiscuzAjaxObj.setCommentMessage(t,"error"),e("#wpdiscuz-loading-bar").fadeOut(250),M=!1,o.addClass("wpd_not_clicked")})).fail((function(t,a,n){console.log(n),o.addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)}))}var d,s})),e("body").on("click",".wpd-unsubscribe",(function(t){t.preventDefault();var a=new FormData;a.append("action","wpdUnsubscribe"),a.append("sid",e(this).data("sid")),a.append("skey",e(this).data("skey")),fe(v,!0,a).done((function(t){"object"==typeof t?t.success?(wpdiscuzAjaxObj.setCommentMessage(t.data,"success"),setTimeout((function(){location.reload(!0)}),3e3)):wpdiscuzAjaxObj.setCommentMessage(t.data,"error"):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250),M=!1})).fail((function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),wpdiscuzAjaxObj.resetActiveFilters=function(t){e(".wpd-filter.wpdf-active"+(t?":not("+t+")":"")).removeClass("wpdf-active")},wpdiscuzAjaxObj.getAjaxObj=fe,wpdiscuzAjaxObj.initNonce=he,he()}));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(e){jQuery("#wpdiscuz-recaptcha-field-0_0").val("key")},"expired-callback":function(){jQuery("#wpdiscuz-recaptcha-field-0_0").val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.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 */
14
+ jQuery(document).ready(function(e){if(e("body").on("click","#wpdcom .wmu-upload-wrap",function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0)}),e("body").on("change",".wmu-add-files",function(){var a=e(this),t=a.parents(".wpd_comm_form"),r=a[0].files?a[0].files:[];r.length&&function a(t,r,o){r.attr("data-uploading","true");var d=new FormData;d.append("action","wmuUploadFiles"),d.append("wmuAttachmentsData",e(".wmu-attachments-data",r).val()),d.append("uniqueId",r.find(".wpdiscuz_unique_id").val());var m=0;e.each(o,function(e,a){m+=a.size,d.append(wpdiscuzAjaxObj.wmuInput+"["+e+"]",a)}),m>parseInt(wpdiscuzAjaxObj.wmuMaxFileSize)?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhraseMaxFileSize,"wmuPhraseMaxFileSize",t),"error",3e3):m>parseInt(wpdiscuzAjaxObj.wmuPostMaxSize)?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhrasePostMaxSize,"wmuPhrasePostMaxSize",t),"error",3e3):wpdiscuzAjaxObj.getAjaxObj(!0,!0,d).done(function(a){var t,o;a.success?(e(".wmu-attached-data-info",r).remove(),e(".wmu-add-files",r).after(a.data.attachmentsHtml),a.data.tooltip&&e(".wmu-upload-wrap",r).attr("wpd-tooltip",a.data.tooltip),t=r,o=a,e.each(o.data.previewsData,function(a,r){e(".wmu-action-wrap .wmu-"+a+"-tab",t).html(""),e.each(r,function(r,o){var d=o.id,m="",i=o.fullname,n=o.shortname;a==wpdiscuzAjaxObj.wmuKeyImages?(m=o.url,n=""):a==wpdiscuzAjaxObj.wmuKeyVideos?m=wpdiscuzAjaxObj.wmuIconVideo:a==wpdiscuzAjaxObj.wmuKeyFiles&&(m=wpdiscuzAjaxObj.wmuIconFile);var s='<div class="wmu-preview [PREVIEW_TYPE_CLASS]" title="[PREVIEW_TITLE]" data-wmu-type="[PREVIEW_TYPE]" data-wmu-attachment="[PREVIEW_ID]"><div class="wmu-preview-remove"><img class="wmu-preview-img" src="[PREVIEW_ICON]"><div class="wmu-file-name">[PREVIEW_FILENAME]</div><div class="wmu-delete">&nbsp;</div></div></div>';s=(s=(s=(s=(s=(s=s.replace("[PREVIEW_TYPE_CLASS]","wmu-preview-"+a)).replace("[PREVIEW_TITLE]",i)).replace("[PREVIEW_TYPE]",a)).replace("[PREVIEW_ID]",d)).replace("[PREVIEW_ICON]",m)).replace("[PREVIEW_FILENAME]",n),e(".wmu-action-wrap .wmu-"+a+"-tab",t).removeClass("wmu-hide").append(s)})}),a.data.errors&&(wpdiscuzAjaxObj.setCommentMessage(a.data.errors,"error",3e3),console.log(a.data.errors))):a.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data.errorCode],a.data.errorCode,r),"error",3e3):a.data.error&&wpdiscuzAjaxObj.setCommentMessage(a.data.error,"error",3e3),e("#wpdiscuz-loading-bar").fadeOut(250),r.attr("data-uploading","false")}).fail(function(a,t,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250),r.attr("data-uploading","false")})}(a,t,r)}),e("body").on("click",".wmu-attachment-delete",function(a){if(confirm(wpdiscuzAjaxObj.wmuPhraseConfirmDelete)){var t=e(this),r=t.data("wmu-attachment"),o=new FormData;o.append("action","wmuDeleteAttachment"),o.append("attachmentId",r),wpdiscuzAjaxObj.getAjaxObj(!0,!0,o).done(function(a){if(a.success){var r=t.parents(".wmu-comment-attachments");t.parent(".wmu-attachment").remove(),e(".wmu-attached-images *",r).length||e(".wmu-attached-images",r).remove(),e(".wmu-attached-videos *",r).length||e(".wmu-attached-videos",r).remove(),e(".wmu-attached-files *",r).length||e(".wmu-attached-files",r).remove()}else a.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data.errorCode],a.data.errorCode,r),"error",3e3):a.data.error&&wpdiscuzAjaxObj.setCommentMessage(a.data.error,"error",3e3);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,t,r){console.log(r),e("#wpdiscuz-loading-bar").fadeOut(250)})}else console.log("canceled")}),e("body").on("click",".wmu-preview",function(){var a=e(this),t=a.parents(".wpd_comm_form");a.data("wmu-type");var r=a.data("wmu-attachment"),o=new FormData;o.append("action","wmuRemoveAttachmentPreview"),o.append("attachmentId",r),o.append("wmuAttachmentsData",e(".wmu-attachments-data",t).val()),o.append("uniqueId",t.find(".wpdiscuz_unique_id").val()),wpdiscuzAjaxObj.getAjaxObj(!0,!0,o).done(function(r){if(r.success){a.remove();var o=e(".wmu-tabs",t);e.each(o,function(a,t){e(".wmu-preview",t).length?e(t).removeClass("wmu-hide"):e(t).addClass("wmu-hide")}),e(".wmu-attached-data-info",t).remove(),e(".wmu-add-files",t).after(r.data.attachmentsHtml),r.data.tooltip&&e(".wmu-upload-wrap",t).attr("wpd-tooltip",r.data.tooltip)}else r.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[r.data.errorCode],r.data.errorCode,t),"error",3e3):r.data.error&&wpdiscuzAjaxObj.setCommentMessage(r.data.error,"error",3e3);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,t,r){console.log(r),e("#wpdiscuz-loading-bar").fadeOut(250)})}),parseInt(wpdiscuzAjaxObj.wmuIsLightbox)){function a(){e(".wmu-lightbox").colorbox({maxHeight:"95%",maxWidth:"95%",rel:"wmu-lightbox",fixed:!0})}a(),wpdiscuzAjaxObj.wmuAddLightBox=a}wpdiscuzAjaxObj.wmuHideAll=function(a,t){"object"==typeof a?a.success?(e(".wmu-tabs",t).addClass("wmu-hide"),e(".wmu-preview",t).remove(),e(".wmu-attached-data-info",t).remove()):console.log(a.data):console.log(a)}});
15
  /* Lity */
16
  !function(e,t){"function"==typeof define&&define.amd?define(["jquery"],function(n){return t(e,n)}):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(e,require("jquery")):e.lity=t(e,e.jQuery||e.Zepto)}("undefined"!=typeof window?window:this,function(e,t){"use strict";var n=e.document,i=t(e),r=t.Deferred,o=t("html"),a=[],l="aria-hidden",s="lity-"+l,d='a[href],area[href],input:not([disabled]),select:not([disabled]),textarea:not([disabled]),button:not([disabled]),iframe,object,embed,[contenteditable],[tabindex]:not([tabindex^="-"])',c={esc:!0,handler:null,handlers:{image:C,inline:function(e,n){var i,r,o;try{i=t(e)}catch(e){return!1}if(!i.length)return!1;return r=t('<i style="display:none !important"/>'),o=i.hasClass("lity-hide"),n.element().one("lity:remove",function(){r.before(i).remove(),o&&!i.closest(".lity-content").length&&i.addClass("lity-hide")}),i.removeClass("lity-hide").after(r)},youtube:function(e){var n=f.exec(e);if(!n)return!1;return k(x(e,w("https://www.youtube"+(n[2]||"")+".com/embed/"+n[4],t.extend({autoplay:1},b(n[5]||"")))))},vimeo:function(e){var n=y.exec(e);if(!n)return!1;return k(x(e,w("https://player.vimeo.com/video/"+n[3],t.extend({autoplay:1},b(n[4]||"")))))},googlemaps:function(e){var t=v.exec(e);if(!t)return!1;return k(x(e,w("https://www.google."+t[3]+"/maps?"+t[6],{output:t[6].indexOf("layer=c")>0?"svembed":"embed"})))},facebookvideo:function(e){var n=p.exec(e);if(!n)return!1;0!==e.indexOf("http")&&(e="https:"+e);return k(x(e,w("https://www.facebook.com/plugins/video.php?href="+e,t.extend({autoplay:1},b(n[4]||"")))))},iframe:k},template:'<div class="lity" role="dialog" aria-label="Dialog Window (Press escape to close)" tabindex="-1"><div class="lity-wrap" data-lity-close role="document"><div class="lity-loader" aria-hidden="true">Loading...</div><div class="lity-container"><div class="lity-content"></div><button class="lity-close" type="button" aria-label="Close (Press escape to close)" data-lity-close>&times;</button></div></div></div>'},u=/(^data:image\/)|(\.(png|jpe?g|gif|svg|webp|bmp|ico|tiff?)(\?\S*)?$)/i,f=/(youtube(-nocookie)?\.com|youtu\.be)\/(watch\?v=|v\/|u\/|embed\/?)?([\w-]{11})(.*)?/i,y=/(vimeo(pro)?.com)\/(?:[^\d]+)?(\d+)\??(.*)?$/,v=/((maps|www)\.)?google\.([^\/\?]+)\/?((maps\/?)?\?)(.*)/i,p=/(facebook\.com)\/([a-z0-9_-]*)\/videos\/([0-9]*)(.*)?$/i,m=function(){var e=n.createElement("div"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in t)if(void 0!==e.style[i])return t[i];return!1}();function h(e){var t=r();return m&&e.length?(e.one(m,t.resolve),setTimeout(t.resolve,500)):t.resolve(),t.promise()}function g(e,n,i){if(1===arguments.length)return t.extend({},e);if("string"==typeof n){if(void 0===i)return void 0===e[n]?null:e[n];e[n]=i}else t.extend(e,n);return this}function b(e){for(var t,n=decodeURI(e.split("#")[0]).split("&"),i={},r=0,o=n.length;r<o;r++)n[r]&&(i[(t=n[r].split("="))[0]]=t[1]);return i}function w(e,n){return e+(e.indexOf("?")>-1?"&":"?")+t.param(n)}function x(e,t){var n=e.indexOf("#");return-1===n?t:(n>0&&(e=e.substr(n)),t+e)}function C(e,n){var i=n.opener()&&n.opener().data("lity-desc")||"Image with no description",o=t('<img src="'+e+'" alt="'+i+'"/>'),a=r(),l=function(){var e;a.reject((e="Failed loading image",t('<span class="lity-error"/>').append(e)))};return o.on("load",function(){if(0===this.naturalWidth)return l();a.resolve(o)}).on("error",l),a.promise()}function k(e){return'<div class="lity-iframe-container"><iframe frameborder="0" allowfullscreen src="'+e+'"/></div>'}function E(){return n.documentElement.clientHeight?.9*n.documentElement.clientHeight:Math.round(.9*i.height())}function j(e){var t,i,r,o=z();o&&(27===e.keyCode&&o.options("esc")&&o.close(),9===e.keyCode&&(t=e,i=o.element().find(d),r=i.index(n.activeElement),t.shiftKey&&r<=0?(i.get(i.length-1).focus(),t.preventDefault()):t.shiftKey||r!==i.length-1||(i.get(0).focus(),t.preventDefault())))}function D(){t.each(a,function(e,t){t.resize()})}function z(){return 0===a.length?null:a[0]}function T(e,d,u,f){var y,v,p,m,b,w,x,C,k,z,T,O=this,q=!1,W=!1;d=t.extend({},c,d),v=t(d.template),O.element=function(){return v},O.opener=function(){return u},O.options=t.proxy(g,O,d),O.handlers=t.proxy(g,O,d.handlers),O.resize=function(){q&&!W&&p.css("max-height",E()+"px").trigger("lity:resize",[O])},O.close=function(){if(q&&!W){var e;W=!0,(e=O).element().attr(l,"true"),1===a.length&&(o.removeClass("lity-active"),i.off({resize:D,keydown:j})),((a=t.grep(a,function(t){return e!==t})).length?a[0].element():t(".lity-hidden")).removeClass("lity-hidden").each(function(){var e=t(this),n=e.data(s);n?e.attr(l,n):e.removeAttr(l),e.removeData(s)});var d=r();if(f&&(n.activeElement===v[0]||t.contains(v[0],n.activeElement)))try{f.focus()}catch(e){}return p.trigger("lity:close",[O]),v.removeClass("lity-opened").addClass("lity-closed"),h(p.add(v)).always(function(){p.trigger("lity:remove",[O]),v.remove(),v=void 0,d.resolve()}),d.promise()}},m=e,b=O,w=d.handlers,x=d.handler,k="inline",z=t.extend({},w),x&&z[x]?(C=z[x](m,b),k=x):(t.each(["inline","iframe"],function(e,t){delete z[t],z[t]=w[t]}),t.each(z,function(e,t){return!t||!(!t.test||t.test(m,b))||(!1!==(C=t(m,b))?(k=e,!1):void 0)})),y={handler:k,content:C||""},v.attr(l,"false").addClass("lity-loading lity-opened lity-"+y.handler).appendTo("body").focus().on("click","[data-lity-close]",function(e){t(e.target).is("[data-lity-close]")&&O.close()}).trigger("lity:open",[O]),T=O,1===a.unshift(T)&&(o.addClass("lity-active"),i.on({resize:D,keydown:j})),t("body > *").not(T.element()).addClass("lity-hidden").each(function(){var e=t(this);void 0===e.data(s)&&e.data(s,e.attr(l)||null)}).attr(l,"true"),t.when(y.content).always(function(e){p=t(e).css("max-height",E()+"px"),v.find(".lity-loader").each(function(){var e=t(this);h(e).always(function(){e.remove()})}),v.removeClass("lity-loading").find(".lity-content").empty().append(p),q=!0,p.trigger("lity:ready",[O])})}function O(e,i,r){e.preventDefault?(e.preventDefault(),e=(r=t(this)).data("lity-target")||r.attr("rel")||r.attr("src")):r=t(r);var o=new T(e,t.extend({},r.data("lity-options")||r.data("lity"),i),r,n.activeElement);if(!e.preventDefault)return o}return C.test=function(e){return u.test(e)},O.version="2.2.2",O.options=t.proxy(g,O,c),O.handlers=t.proxy(g,O,c.handlers),O.current=z,t(n).on("click.lity","[data-wpd-lity]",O),O});
17
  /* My Content and Settings */
assets/js/wpdiscuz-mu-backend.js CHANGED
@@ -29,7 +29,7 @@ jQuery(document).ready(function ($) {
29
  var ajax = wmuGetAjaxObj(data);
30
  ajax.done(function (r) {
31
  if (r.success) {
32
- $('.wmu-attachment-' + attachmentId).remove();
33
  } else {
34
  if (r.data.error) {
35
  alert(r.data.error);
29
  var ajax = wmuGetAjaxObj(data);
30
  ajax.done(function (r) {
31
  if (r.success) {
32
+ clicked.parent('.wmu-attachment').remove();
33
  } else {
34
  if (r.data.error) {
35
  alert(r.data.error);
assets/js/wpdiscuz-mu-frontend.js CHANGED
@@ -98,8 +98,8 @@ jQuery(document).ready(function ($) {
98
  wpdiscuzAjaxObj.getAjaxObj(true, true, data)
99
  .done(function (r) {
100
  if (r.success) {
101
- var parent = $('.wmu-attachment-' + attachmentId).parents('.wmu-comment-attachments');
102
- $('.wmu-attachment-' + attachmentId).remove();
103
  if (!$('.wmu-attached-images *', parent).length) {
104
  $('.wmu-attached-images', parent).remove();
105
  }
98
  wpdiscuzAjaxObj.getAjaxObj(true, true, data)
99
  .done(function (r) {
100
  if (r.success) {
101
+ var parent = btn.parents('.wmu-comment-attachments');
102
+ btn.parent('.wmu-attachment').remove();
103
  if (!$('.wmu-attached-images *', parent).length) {
104
  $('.wmu-attached-images', parent).remove();
105
  }
assets/js/wpdiscuz-mu-frontend.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function($){if($("body").on("click","#wpdcom .wmu-upload-wrap",function(){$(".wpd-form-foot",$(this).parents(".wpd_comm_form")).slideDown(parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0)}),$("body").on("change",".wmu-add-files",function(){var a=$(this),c=a.parents(".wpd_comm_form"),b=a[0].files?a[0].files:[];b.length&&function(c,b,e){b.attr("data-uploading","true");var a=new FormData;a.append("action","wmuUploadFiles"),a.append("wmuAttachmentsData",$(".wmu-attachments-data",b).val()),a.append("uniqueId",b.find(".wpdiscuz_unique_id").val());var d=0;$.each(e,function(c,b){d+=b.size,a.append(wpdiscuzAjaxObj.wmuInput+"["+c+"]",b)}),d>parseInt(wpdiscuzAjaxObj.wmuMaxFileSize)?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhraseMaxFileSize,"wmuPhraseMaxFileSize",c),"error",3e3):d>parseInt(wpdiscuzAjaxObj.wmuPostMaxSize)?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhrasePostMaxSize,"wmuPhrasePostMaxSize",c),"error",3e3):wpdiscuzAjaxObj.getAjaxObj(!0,!0,a).done(function(a){var d,c;a.success?($(".wmu-attached-data-info",b).remove(),$(".wmu-add-files",b).after(a.data.attachmentsHtml),a.data.tooltip&&$(".wmu-upload-wrap",b).attr("wpd-tooltip",a.data.tooltip),d=b,c=a,$.each(c.data.previewsData,function(a,b){$(".wmu-action-wrap .wmu-"+a+"-tab",d).html(""),$.each(b,function(i,c){var g=c.id,e="",h=c.fullname,f=c.shortname;a==wpdiscuzAjaxObj.wmuKeyImages?(e=c.url,f=""):a==wpdiscuzAjaxObj.wmuKeyVideos?e=wpdiscuzAjaxObj.wmuIconVideo:a==wpdiscuzAjaxObj.wmuKeyFiles&&(e=wpdiscuzAjaxObj.wmuIconFile);var b='<div class="wmu-preview [PREVIEW_TYPE_CLASS]" title="[PREVIEW_TITLE]" data-wmu-type="[PREVIEW_TYPE]" data-wmu-attachment="[PREVIEW_ID]"><div class="wmu-preview-remove"><img class="wmu-preview-img" src="[PREVIEW_ICON]"><div class="wmu-file-name">[PREVIEW_FILENAME]</div><div class="wmu-delete">&nbsp;</div></div></div>';b=(b=(b=(b=(b=(b=b.replace("[PREVIEW_TYPE_CLASS]","wmu-preview-"+a)).replace("[PREVIEW_TITLE]",h)).replace("[PREVIEW_TYPE]",a)).replace("[PREVIEW_ID]",g)).replace("[PREVIEW_ICON]",e)).replace("[PREVIEW_FILENAME]",f),$(".wmu-action-wrap .wmu-"+a+"-tab",d).removeClass("wmu-hide").append(b)})}),a.data.errors&&(wpdiscuzAjaxObj.setCommentMessage(a.data.errors,"error",3e3),console.log(a.data.errors))):a.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data.errorCode],a.data.errorCode,b),"error",3e3):a.data.error&&wpdiscuzAjaxObj.setCommentMessage(a.data.error,"error",3e3),$("#wpdiscuz-loading-bar").fadeOut(250),b.attr("data-uploading","false")}).fail(function(c,d,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250),b.attr("data-uploading","false")})}(a,c,b)}),$("body").on("click",".wmu-attachment-delete",function(c){if(confirm(wpdiscuzAjaxObj.wmuPhraseConfirmDelete)){var b=$(this).data("wmu-attachment"),a=new FormData;a.append("action","wmuDeleteAttachment"),a.append("attachmentId",b),wpdiscuzAjaxObj.getAjaxObj(!0,!0,a).done(function(c){if(c.success){var a=$(".wmu-attachment-"+b).parents(".wmu-comment-attachments");$(".wmu-attachment-"+b).remove(),$(".wmu-attached-images *",a).length||$(".wmu-attached-images",a).remove(),$(".wmu-attached-videos *",a).length||$(".wmu-attached-videos",a).remove(),$(".wmu-attached-files *",a).length||$(".wmu-attached-files",a).remove()}else c.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[c.data.errorCode],c.data.errorCode,a),"error",3e3):c.data.error&&wpdiscuzAjaxObj.setCommentMessage(c.data.error,"error",3e3);$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}else console.log("canceled")}),$("body").on("click",".wmu-preview",function(){var b=$(this),c=b.parents(".wpd_comm_form");b.data("wmu-type");var d=b.data("wmu-attachment"),a=new FormData;a.append("action","wmuRemoveAttachmentPreview"),a.append("attachmentId",d),a.append("wmuAttachmentsData",$(".wmu-attachments-data",c).val()),a.append("uniqueId",c.find(".wpdiscuz_unique_id").val()),wpdiscuzAjaxObj.getAjaxObj(!0,!0,a).done(function(a){if(a.success){b.remove();var d=$(".wmu-tabs",c);$.each(d,function(b,a){$(".wmu-preview",a).length?$(a).removeClass("wmu-hide"):$(a).addClass("wmu-hide")}),$(".wmu-attached-data-info",c).remove(),$(".wmu-add-files",c).after(a.data.attachmentsHtml),a.data.tooltip&&$(".wmu-upload-wrap",c).attr("wpd-tooltip",a.data.tooltip)}else a.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data.errorCode],a.data.errorCode,c),"error",3e3):a.data.error&&wpdiscuzAjaxObj.setCommentMessage(a.data.error,"error",3e3);$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),parseInt(wpdiscuzAjaxObj.wmuIsLightbox)){function a(){$(".wmu-lightbox").colorbox({maxHeight:"95%",maxWidth:"95%",rel:"wmu-lightbox",fixed:!0})}a(),wpdiscuzAjaxObj.wmuAddLightBox=a}wpdiscuzAjaxObj.wmuHideAll=function(a,b){"object"==typeof a?a.success?($(".wmu-tabs",b).addClass("wmu-hide"),$(".wmu-preview",b).remove(),$(".wmu-attached-data-info",b).remove()):console.log(a.data):console.log(a)}})
1
+ jQuery(document).ready(function(e){if(e("body").on("click","#wpdcom .wmu-upload-wrap",function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0)}),e("body").on("change",".wmu-add-files",function(){var a=e(this),t=a.parents(".wpd_comm_form"),r=a[0].files?a[0].files:[];r.length&&function a(t,r,o){r.attr("data-uploading","true");var d=new FormData;d.append("action","wmuUploadFiles"),d.append("wmuAttachmentsData",e(".wmu-attachments-data",r).val()),d.append("uniqueId",r.find(".wpdiscuz_unique_id").val());var m=0;e.each(o,function(e,a){m+=a.size,d.append(wpdiscuzAjaxObj.wmuInput+"["+e+"]",a)}),m>parseInt(wpdiscuzAjaxObj.wmuMaxFileSize)?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhraseMaxFileSize,"wmuPhraseMaxFileSize",t),"error",3e3):m>parseInt(wpdiscuzAjaxObj.wmuPostMaxSize)?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhrasePostMaxSize,"wmuPhrasePostMaxSize",t),"error",3e3):wpdiscuzAjaxObj.getAjaxObj(!0,!0,d).done(function(a){var t,o;a.success?(e(".wmu-attached-data-info",r).remove(),e(".wmu-add-files",r).after(a.data.attachmentsHtml),a.data.tooltip&&e(".wmu-upload-wrap",r).attr("wpd-tooltip",a.data.tooltip),t=r,o=a,e.each(o.data.previewsData,function(a,r){e(".wmu-action-wrap .wmu-"+a+"-tab",t).html(""),e.each(r,function(r,o){var d=o.id,m="",i=o.fullname,n=o.shortname;a==wpdiscuzAjaxObj.wmuKeyImages?(m=o.url,n=""):a==wpdiscuzAjaxObj.wmuKeyVideos?m=wpdiscuzAjaxObj.wmuIconVideo:a==wpdiscuzAjaxObj.wmuKeyFiles&&(m=wpdiscuzAjaxObj.wmuIconFile);var s='<div class="wmu-preview [PREVIEW_TYPE_CLASS]" title="[PREVIEW_TITLE]" data-wmu-type="[PREVIEW_TYPE]" data-wmu-attachment="[PREVIEW_ID]"><div class="wmu-preview-remove"><img class="wmu-preview-img" src="[PREVIEW_ICON]"><div class="wmu-file-name">[PREVIEW_FILENAME]</div><div class="wmu-delete">&nbsp;</div></div></div>';s=(s=(s=(s=(s=(s=s.replace("[PREVIEW_TYPE_CLASS]","wmu-preview-"+a)).replace("[PREVIEW_TITLE]",i)).replace("[PREVIEW_TYPE]",a)).replace("[PREVIEW_ID]",d)).replace("[PREVIEW_ICON]",m)).replace("[PREVIEW_FILENAME]",n),e(".wmu-action-wrap .wmu-"+a+"-tab",t).removeClass("wmu-hide").append(s)})}),a.data.errors&&(wpdiscuzAjaxObj.setCommentMessage(a.data.errors,"error",3e3),console.log(a.data.errors))):a.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data.errorCode],a.data.errorCode,r),"error",3e3):a.data.error&&wpdiscuzAjaxObj.setCommentMessage(a.data.error,"error",3e3),e("#wpdiscuz-loading-bar").fadeOut(250),r.attr("data-uploading","false")}).fail(function(a,t,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250),r.attr("data-uploading","false")})}(a,t,r)}),e("body").on("click",".wmu-attachment-delete",function(a){if(confirm(wpdiscuzAjaxObj.wmuPhraseConfirmDelete)){var t=e(this),r=t.data("wmu-attachment"),o=new FormData;o.append("action","wmuDeleteAttachment"),o.append("attachmentId",r),wpdiscuzAjaxObj.getAjaxObj(!0,!0,o).done(function(a){if(a.success){var r=t.parents(".wmu-comment-attachments");t.parent(".wmu-attachment").remove(),e(".wmu-attached-images *",r).length||e(".wmu-attached-images",r).remove(),e(".wmu-attached-videos *",r).length||e(".wmu-attached-videos",r).remove(),e(".wmu-attached-files *",r).length||e(".wmu-attached-files",r).remove()}else a.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data.errorCode],a.data.errorCode,r),"error",3e3):a.data.error&&wpdiscuzAjaxObj.setCommentMessage(a.data.error,"error",3e3);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,t,r){console.log(r),e("#wpdiscuz-loading-bar").fadeOut(250)})}else console.log("canceled")}),e("body").on("click",".wmu-preview",function(){var a=e(this),t=a.parents(".wpd_comm_form");a.data("wmu-type");var r=a.data("wmu-attachment"),o=new FormData;o.append("action","wmuRemoveAttachmentPreview"),o.append("attachmentId",r),o.append("wmuAttachmentsData",e(".wmu-attachments-data",t).val()),o.append("uniqueId",t.find(".wpdiscuz_unique_id").val()),wpdiscuzAjaxObj.getAjaxObj(!0,!0,o).done(function(r){if(r.success){a.remove();var o=e(".wmu-tabs",t);e.each(o,function(a,t){e(".wmu-preview",t).length?e(t).removeClass("wmu-hide"):e(t).addClass("wmu-hide")}),e(".wmu-attached-data-info",t).remove(),e(".wmu-add-files",t).after(r.data.attachmentsHtml),r.data.tooltip&&e(".wmu-upload-wrap",t).attr("wpd-tooltip",r.data.tooltip)}else r.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[r.data.errorCode],r.data.errorCode,t),"error",3e3):r.data.error&&wpdiscuzAjaxObj.setCommentMessage(r.data.error,"error",3e3);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,t,r){console.log(r),e("#wpdiscuz-loading-bar").fadeOut(250)})}),parseInt(wpdiscuzAjaxObj.wmuIsLightbox)){function a(){e(".wmu-lightbox").colorbox({maxHeight:"95%",maxWidth:"95%",rel:"wmu-lightbox",fixed:!0})}a(),wpdiscuzAjaxObj.wmuAddLightBox=a}wpdiscuzAjaxObj.wmuHideAll=function(a,t){"object"==typeof a?a.success?(e(".wmu-tabs",t).addClass("wmu-hide"),e(".wmu-preview",t).remove(),e(".wmu-attached-data-info",t).remove()):console.log(a.data):console.log(a)}});
assets/js/wpdiscuz.js CHANGED
@@ -810,6 +810,7 @@ jQuery(document).ready(function ($) {
810
  getAjaxObj(isNativeAjaxEnabled, true, data)
811
  .done(function (r) {
812
  if (typeof r === 'object') {
 
813
  if (r.success) {
814
  wpdCancelOrSave(uniqueID, r.data.message);
815
  if (r.data.comment_approved_html) {
@@ -833,7 +834,7 @@ jQuery(document).ready(function ($) {
833
  }
834
  runCallbacks(r, commentID);
835
  } else {
836
- console.log(r);
837
  }
838
  $('#wpdiscuz-loading-bar').fadeOut(250);
839
  })
810
  getAjaxObj(isNativeAjaxEnabled, true, data)
811
  .done(function (r) {
812
  if (typeof r === 'object') {
813
+ console.log('aaaa');
814
  if (r.success) {
815
  wpdCancelOrSave(uniqueID, r.data.message);
816
  if (r.data.comment_approved_html) {
834
  }
835
  runCallbacks(r, commentID);
836
  } else {
837
+ wpdiscuzAjaxObj.setCommentMessage(r, 'error');
838
  }
839
  $('#wpdiscuz-loading-bar').fadeOut(250);
840
  })
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()}),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")}}
1
+ var wpdiscuzLoadRichEditor=parseInt(wpdiscuzAjaxObj.loadRichEditor);if(wpdiscuzLoadRichEditor&&document.querySelector(".wpdiscuz-textarea-wrap"))var wpDiscuzEditor=new WpdEditor;function wpdMessagesOnInit(e,t){wpdiscuzAjaxObj.setCommentMessage(e,t),setTimeout((function(){location.href=location.href.substring(0,location.href.indexOf("wpdiscuzUrlAnchor")-1)}),3e3)}wpdiscuzAjaxObj.setCommentMessage=function(e,t,a){var o="wpdiscuz-message-error";if(e instanceof Array)for(var n in e)t instanceof Array?"success"===t[n]?o="wpdiscuz-message-success":"warning"===t[n]&&(o="wpdiscuz-message-warning"):"success"===t?o="wpdiscuz-message-success":"warning"===t&&(o="wpdiscuz-message-warning"),jQuery("<div/>").addClass(o).html(e[n]).prependTo("#wpdiscuz-comment-message").delay(a instanceof Array?a[n]:a||4e3).fadeOut(1e3,(function(){jQuery(this).remove()}));else"success"===t?o="wpdiscuz-message-success":"warning"===t&&(o="wpdiscuz-message-warning"),jQuery("<div/>").addClass(o).html(e).prependTo("#wpdiscuz-comment-message").delay(a||4e3).fadeOut(1e3,(function(){jQuery(this).remove()}))},wpdiscuzAjaxObj.applyFilterOnPhrase=function(e,t,a){return wpdiscuzAjaxObj.phraseFilters&&jQuery.each(wpdiscuzAjaxObj.phraseFilters,(function(o){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[o]]&&(e=wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[o]](e,t,a))})),e},jQuery(document).ready((function(e){e("body").addClass("wpdiscuz_"+wpdiscuzAjaxObj.version);var t=wpdiscuzAjaxObj.is_user_logged_in,a=1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!t,o=1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&t,n=wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion,i=parseInt(wpdiscuzAjaxObj.commentListLoadType),d=parseInt(wpdiscuzAjaxObj.wc_post_id);wpdiscuzAjaxObj.wpdiscuz_nonce="";var s=parseInt(wpdiscuzAjaxObj.commentListUpdateType),c=1e3*parseInt(wpdiscuzAjaxObj.commentListUpdateTimer),p=parseInt(wpdiscuzAjaxObj.liveUpdateGuests),r=wpdiscuzAjaxObj.loadLastCommentId,l=r,w=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 m,u=parseInt(wpdiscuzAjaxObj.wordpressIsPaginate),f=wpdiscuzAjaxObj.storeCommenterData,h=parseInt(wpdiscuzAjaxObj.wmuEnabled),b=wpdiscuzAjaxObj.isCookiesEnabled,_=!0,g=wpdiscuzAjaxObj.cookiehash,z=parseInt(wpdiscuzAjaxObj.isLoadOnlyParentComments),j=parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0,v=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),x=parseInt(wpdiscuzAjaxObj.enableBubble),C=parseInt(wpdiscuzAjaxObj.bubbleLiveUpdate),y=parseInt(wpdiscuzAjaxObj.bubbleHintTimeout),k=parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout)?parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout):5,O=parseInt(wpdiscuzAjaxObj.bubbleShowNewCommentMessage),A=wpdiscuzAjaxObj.bubbleLocation,I=wpdiscuzAjaxObj.inlineFeedbackAttractionType,T=(T=parseInt(wpdiscuzAjaxObj.scrollSize))||32,D=[],F=[],E=[],M=!1,L=1,R=e("html").css("scroll-behavior"),S=e("body").css("scroll-behavior");(e(".wc_social_plugin_wrapper .wp-social-login-provider-list").length?e(".wc_social_plugin_wrapper .wp-social-login-provider-list").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .the_champ_login_container").length?e(".wc_social_plugin_wrapper .the_champ_login_container").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .social_connect_form").length?e(".wc_social_plugin_wrapper .social_connect_form").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .oneall_social_login_providers").length&&e(".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&&e("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0"),window.addEventListener("beforeunload",(function(t){var a=e(".wpd-form").not(":hidden");if(a.length)if(wpdiscuzLoadRichEditor&&document.querySelector(".wpdiscuz-textarea-wrap")){for(var o=0;o<a.length;o++)if("\n"!==wpDiscuzEditor.createEditor(e(a[o]).find(".ql-container").attr("id")).getText())return t.preventDefault(),void(t.returnValue="")}else for(o=0;o<a.length;o++)if(e(a[o]).find(".wc_comment").val())return t.preventDefault(),void(t.returnValue="")})),wpdiscuzLoadRichEditor||(e(document).delegate("textarea.wc_comment","input",(function(){me(e(this))})),e.each(e("textarea.wc_comment"),(function(){me(e(this))}))),e("body").on("focus","#wpdcom .ql-editor, #wpdcom .wc_comment",(function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(j)})),e("body").on("focus","#wpdcom textarea",(function(){e(this).next(".autogrow-textarea-mirror").length||e(this).autoGrow()})),t)||U({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)});if(e(".wpd-vote-down.wpd-dislike-hidden").remove(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd"),e("body").on("click","#wpd-editor-source-code-wrapper-bg",(function(){e(this).hide(),e("#wpd-editor-source-code-wrapper").hide(),e("#wpd-editor-uid").val(""),e("#wpd-editor-source-code").val("")})),wpdiscuzLoadRichEditor&&e("body").on("click","#wpd-insert-source-code",(function(){var t=wpDiscuzEditor.createEditor("#"+e("#wpd-editor-uid").val());t.deleteText(0,t.getLength(),Quill.sources.USER);var a=e("#wpd-editor-source-code").val();a.length&&t.clipboard.dangerouslyPasteHTML(0,a,Quill.sources.USER),t.update(),e("#wpd-editor-source-code-wrapper-bg").hide(),e("#wpd-editor-source-code-wrapper").hide(),e("#wpd-editor-uid").val(""),e("#wpd-editor-source-code").val("")})),e("body").on("click",".wpd-reply-button",(function(){var i=X(e(this),0);e(this).hasClass("wpdiscuz-clonned")?(wpdiscuzLoadRichEditor?setTimeout((function(){wpDiscuzEditor.createEditor("#wpd-editor-"+i).focus()}),j):setTimeout((function(){e("#wc-textarea-"+i).trigger("focus")}),j),e("#wpd-secondary-form-wrapper-"+i).slideToggle(j)):function(a){var o=X(a,0);e("#wpdiscuz_form_anchor-"+o).before(function(t){return e("#wpdiscuz_hidden_secondary_form").html().replace(/wpdiscuzuniqueid/g,t)}(o));var n=e("#wpd-secondary-form-wrapper-"+o);if(!t){U({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-"+o).focus()}),j):setTimeout((function(){e("#wc-textarea-"+o).trigger("focus")}),j);n.slideToggle(j,(function(){a.addClass("wpdiscuz-clonned")}))}(e(this)),function(t){if((a||o)&&"2.0"===n){var i=Y(t);setTimeout((function(){if(!F[i])try{F[i]=grecaptcha.render("wpdiscuz-recaptcha-"+t,{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(a){e("#wpdiscuz-recaptcha-field-"+t).val("key")},"expired-callback":function(){e("#wpdiscuz-recaptcha-field-"+t).val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}}),1e3)}}(i)})),e("body").on("click","#wpdcom [data-wpd-clipboard]",(function(){var t=e(this).data("wpd-clipboard"),a=e("<input/>");a.appendTo("body").css({position:"absolute",top:"-10000000px"}).val(t),a.trigger("select"),document.execCommand("copy"),a.remove(),wpdiscuzAjaxObj.setCommentMessage(t+"<br/>"+wpdiscuzAjaxObj.wc_copied_to_clipboard,"success",5e3)})),e("body").on("click",".wpdiscuz-nofollow,.wc_captcha_refresh_img,.wpd-load-more-submit",(function(e){e.preventDefault()})),e("body").on("click",".wpd-toggle.wpd_not_clicked",(function(){var t=e(this);t.removeClass("wpd_not_clicked");var a=X(e(this),0),o=e(this),n=e(".fas",o);!o.parents(".wpd-comment:not(.wpd-reply)").children(".wpd-reply").length&&z?function(t,a){var o=Y(t),n=new FormData;n.append("action","wpdShowReplies"),n.append("commentId",o),fe(v,!0,n).done((function(o){a.addClass("wpd_not_clicked"),"object"==typeof o&&o.success&&(e("#wpd-comm-"+t).replaceWith(o.data.comment_list),e("#wpd-comm-"+t+" .wpd-toggle .fas").removeClass("fa-chevron-down").addClass("fa-chevron-up"),e("#wpd-comm-"+t+" .wpd-toggle .wpd-view-replies .wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),e("#wpd-comm-"+t+" .wpd-toggle").attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text),ue(o)),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,n){console.log(n),a.addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)}))}(a,t):e("#wpd-comm-"+a+"> .wpd-reply").slideToggle(700,(function(){e(this).is(":hidden")?(n.removeClass("fa-chevron-up"),n.addClass("fa-chevron-down"),o.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_show_replies_text),o.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_show_replies_text)):(n.removeClass("fa-chevron-down"),n.addClass("fa-chevron-up"),o.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),o.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text)),t.addClass("wpd_not_clicked")}))})),e("body").on("mouseenter",".wpd-new-loaded-comment",(function(){e(this).removeClass("wpd-new-loaded-comment")})),e("body").on("click",".wpd-sbs-toggle",(function(){e(".wpdiscuz-subscribe-bar").slideToggle(j)})),parseInt(wpdiscuzAjaxObj.wpDiscuzIsShowOnSubscribeForm)&&!t&&wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&e("#wpdiscuz-subscribe-form").length&&("2.0"===n?(setTimeout((function(){try{grecaptcha.render("wpdiscuz-recaptcha-subscribe-form",{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(t){e("#wpdiscuz-recaptcha-field-subscribe-form").val("key")},"expired-callback":function(){e("#wpdiscuz-recaptcha-field-subscribe-form").val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}}),1e3),e("body").on("submit","#wpdiscuz-subscribe-form",(function(t){e("#wpdiscuz-recaptcha-field-subscribe-form").val()?e(".wpdiscuz-recaptcha",e(this)).css("border","none"):(e(".wpdiscuz-recaptcha",e(this)).css("border","1px solid red"),t.preventDefault())}))):"3.0"===n&&e("body").on("click","#wpdiscuz_subscription_button",(function(t){var a=e(this).parents("#wpdiscuz-subscribe-form");t.preventDefault();try{grecaptcha.ready((function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/wpdAddSubscription"}).then((function(e){console.log(5555),document.getElementById("wpdiscuz-recaptcha-field-subscribe-form").value=e,a.trigger("submit")}),(function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)}))}))}catch(t){console.log(t),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+t.message,"error")}}))),(a||o)&&"2.0"===n){var P=e(window).width(),q=e("#wpdcom").width();q>=1100&&(e("#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)"}),e("#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)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"65%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"35%"})),q>=940&&q<1100&&(e("#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)"}),e("#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)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"60%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"40%"})),q>=810&&q<940&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"40%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"60%"})),q>=730&&q<810&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#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)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"45%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"55%"})),q>=610&&q<730&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.85)","-webkit-transform":"scale(0.85)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"43%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"55%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"30%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"70%"})),P>650&&(q>=510&&q<610&&(e("#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)"}),e("#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)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"35%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"63%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"30%",position:"relative",right:"-60px"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"70%"}),e("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"})),q>=470&&q<510&&(e("#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)"}),e("#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)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"40%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"60%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({float:"none",width:"100%",display:"block"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({float:"none",width:"100%",display:"block"}),e("#wpdcom .wpd_main_comm_form .wc-form-footer").css({"margin-left":"0px"}),e("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"})),q<470&&(e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({margin:"0px auto","transform-origin":"center 0","-webkit-transform-origin":"center 0"}),e("#wpdcom .wpd-form-col-left").css({float:"none",width:"100%",display:"block"}),e("#wpdcom .wpd-form-col-right").css({float:"none",width:"100%",display:"block"}),e("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"}),e("#wpdcom .wpd-secondary-form-wrapper .wc_notification_checkboxes").css({"text-align":"center"}),e("#wpdcom .wpd-secondary-form-wrapper .wc-field-submit").css({"text-align":"center"})))}function H(t,a,o){fe(v||h,!1,a).done((function(a){if(e(o).addClass("wpd_not_clicked"),"object"==typeof a)if(a.success){"collapsed"===wpdiscuzAjaxObj.commentFormView&&e(".wpd-form-foot",t).slideUp(j),a.data.wc_all_comments_count_new=parseInt(a.data.wc_all_comments_count_new),e(".wpd-thread-info").html(a.data.wc_all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",a.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(a.data.wc_all_comments_count_bubble_html);var n=j;a.data.is_main?ne(a.data.message):(n=j+700,e("#wpd-secondary-form-wrapper-"+a.data.uniqueid).slideToggle(700),1==a.data.is_in_same_container?e("#wpd-secondary-form-wrapper-"+a.data.uniqueid).after(a.data.message):e("#wpd-comm-"+a.data.uniqueid).after(a.data.message)),function(e){if(!e.data.held_moderate){var t=new FormData;t.append("action","wpdCheckNotificationType"),t.append("comment_id",e.data.new_comment_id),t.append("email",e.data.comment_author_email),t.append("isParent",e.data.is_main),fe(v,!0,t)}}(a),function(e){if(e.data.redirect>0&&e.data.new_comment_id){var t=new FormData;t.append("action","wpdRedirect"),t.append("commentId",e.data.new_comment_id),fe(v,!0,t).done((function(e){"object"==typeof e&&e.success&&setTimeout((function(){location.href=e.data}),2e3)})).fail((function(e,t,a){console.log(a)}))}}(a),b&&_?function(t){var a=t.comment_author_email,o=t.comment_author,n=t.comment_author_url;null==f?(Cookies.set("comment_author_email_"+g,a),Cookies.set("comment_author_"+g,o),n.length&&Cookies.set("comment_author_url_"+g,n)):(f=parseInt(f),Cookies.set("comment_author_email_"+g,a,{expires:f,path:"/"}),Cookies.set("comment_author_"+g,o,{expires:f,path:"/"}),n.length&&Cookies.set("comment_author_url_"+g,n,{expires:f,path:"/"}));e(".wpd-cookies-checkbox").length&&e(".wpd-cookies-checkbox").prop("checked",!0)}(a.data):_||e(".wpd-cookies-checkbox").prop("checked",!1),t.get(0).reset(),wpdiscuzLoadRichEditor?wpDiscuzEditor.createEditor("#wpd-editor-"+e(".wpdiscuz_unique_id",t).val()).setContents([{insert:"\n"}]):me(t.find(".wc_comment")),U(a.data),e(".wmu-preview-wrap",t).remove(),D.length&&(D.forEach((function(e){e.parents(".wpd-field-checkbox").remove()})),D=[]),parseInt(wpdiscuzAjaxObj.scrollToComment)&&setTimeout((function(){ae(),e("html, body").animate({scrollTop:e("#comment-"+a.data.new_comment_id).offset().top-T},1e3,oe)}),n),ue(a,t)}else a.data&&(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"),ue(a,t));else wpdiscuzAjaxObj.setCommentMessage(a,"error");e("#wpdiscuz-loading-bar").fadeOut(250),M=!1})).fail((function(t,a,n){console.log(n),e(o).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)}))}function U(t){e(".wpd_comm_form .wc_name").val(t.comment_author),t.comment_author_email&&t.comment_author_email.indexOf("@example.com")<0&&e(".wpd_comm_form .wc_email").val(t.comment_author_email),t.comment_author_url&&e(".wpd_comm_form .wc_website").val(t.comment_author_url)}function W(t,a){e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").show(),e("#wpd-comm-"+t+" .wpdiscuz-edit-form-wrap").replaceWith(a),e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-last-edited").show()}e("body").on("click",".wc_comm_submit.wpd_not_clicked",(function(){var i=e(this),d=1,s=e(this).parents("form");if("true"!==s.attr("data-uploading")){if(s.hasClass("wpd_main_comm_form")||(d=function(t){var a=t.attr("class").split(" "),o="";return e.each(a,(function(e,t){"wpd_comment_level"===J(t,!1)&&(o=J(t,!0))})),parseInt(o)+1}(e(this).parents(".wpd-comment"))),te(s,"#wpd-editor-"+e(".wpdiscuz_unique_id",s).val()),s.on("submit",(function(e){e.preventDefault()})),s[0].checkValidity()&&(p=s,r=!0,"2.0"===n&&e("input[name=wc_captcha]",p).length&&!e("input[name=wc_captcha]",p).val().length?(r=!1,e(".wpdiscuz-recaptcha",p).css("border","1px solid red")):"2.0"===n&&e("input[name=wc_captcha]",p).length&&e(".wpdiscuz-recaptcha",p).css("border","none"),r)){M=!0,function(t){e(".wpd-agreement-checkbox",t).each((function(){e(this).hasClass("wpd_agreement_hide")&&b&&e(this).prop("checked")&&(Cookies.set(e(this).attr("name")+"_"+g,1,{expires:30,path:"/"}),e("input[name="+e(this).attr("name")+"]").each((function(){D.push(e(this))})))}))}(s),e(i).removeClass("wpd_not_clicked");var c=new FormData;if(c.append("action","wpdAddComment"),e(":input",s).each((function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&c.append(this.name+"",e(this).val().trim()),"checkbox"!=this.type&&"radio"!=this.type||e(this).is(":checked")&&c.append(this.name+"",e(this).val())})),c.append("wpd_comment_depth",d),wpdiscuzAjaxObj.wpdiscuz_zs&&c.append("wpdiscuz_zs",wpdiscuzAjaxObj.wpdiscuz_zs),e(".wpd-cookies-checkbox",s).length?e(".wpd-cookies-checkbox",s).prop("checked")||(_=!1):t&&(_=!1),e("#wpdiscuz-loading-bar").show(),wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&"3.0"===n&&(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(e){c.append("g-recaptcha-response",e),H(s,c,i)}),(function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)}))}))}catch(t){console.log(t),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+t.message,"error"),e("#wpdiscuz-loading-bar").fadeOut(250)}else H(s,c,i)}var p,r;!function(e){if((a||o)&&"2.0"===n){var t=Y(e);grecaptcha.reset(F[t])}}(e(".wpdiscuz_unique_id",s).val()),e(".wpdiscuz_reset").val("")}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhraseDoingUpload,"wmuPhraseDoingUpload",s),"warning")})),e("body").on("click",".wpd_editable_comment",(function(){m&&e(".wpdiscuz-edit-form-wrap").length&&W(X(e(".wpdiscuz-edit-form-wrap"),0),m);var t=e(this),a=X(t,0),o=Y(a),n=new FormData;n.append("action","wpdEditComment"),n.append("commentId",o),m=e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-text").get(0),fe(v,!0,n).done((function(o){if("object"==typeof o)if(o.success){if(e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text").replaceWith(o.data.html),wpdiscuzLoadRichEditor){var n=wpDiscuzEditor.createEditor("#wpd-editor-edit_"+a);n.clipboard.dangerouslyPasteHTML(0,o.data.content),n.update(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd")}else e("#wc-textarea-edit_"+a).val(o.data.content),me(e("#wc-textarea-edit_"+a));e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").hide(),e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-last-edited").hide()}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[o.data],o.data,t),"error");else console.log(o);e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e("body").on("click",".wc_save_edited_comment",(function(){var t=e(this),a=X(t),o=Y(a),n=e("#wpd-comm-"+a+" #wpdiscuz-edit-form");if(te(n,"#wpd-editor-edit_"+a),n.on("submit",(function(e){e.preventDefault()})),n[0].checkValidity()){var i=new FormData;i.append("action","wpdSaveEditedComment"),i.append("commentId",o),e(":input",n).each((function(){""!==this.name&&"checkbox"!==this.type&&"radio"!==this.type&&i.append(this.name+"",e(this).val()),"checkbox"!==this.type&&"radio"!==this.type||e(this).is(":checked")&&i.append(this.name+"",e(this).val())})),fe(v,!0,i).done((function(n){"object"==typeof n?(console.log("aaaa"),n.success?(W(a,n.data.message),n.data.comment_approved_html&&e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-subheader").append(n.data.comment_approved_html),n.data.lastEdited&&(e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-last-edited").remove(),e(n.data.lastEdited).insertAfter("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text")),n.data.twitterShareLink&&e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_tw").attr("href",n.data.twitterShareLink),n.data.whatsappShareLink&&e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_whatsapp").attr("href",n.data.whatsappShareLink),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+a)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[n.data],n.data,t),"error"),ue(n,o)):wpdiscuzAjaxObj.setCommentMessage(n,"error"),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}))}})),e("body").on("click",".wc_cancel_edit",(function(){var t=X(e(this));W(t,m),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)})),!u&&w&&(L=0,1==w?setTimeout((function(){V(!0)}),500):e("body").on("click",".wpd-load-comments",(function(){e(this).parent(".wpd-load-more-submit-wrap").remove(),V(!0)}))),e("body").on("click",".wpd-load-more-submit",(function(){var t=e(this),a="wpd-loaded";t.hasClass(a)&&V(!1,t,a,"wpd-loading")}));var B=!1;function N(){var t=document.getElementById("wpdiscuzHasMoreComments"),a=0;t&&(a=t.dataset.is_show_load_more);var o=document.getElementById("wpdcom")?document.getElementById("wpdcom").clientHeight:0,n=e(window).height()+e(window).scrollTop();o&&n&&(100*n/o>=80&&!1===B&&1==a&&(B=!0,V(!1,e(".wpd-load-more-submit"))))}function V(t,a,o,n){a&&(a.toggleClass(o),a.toggleClass(n));var d=new FormData;d.append("action","wpdLoadMoreComments");var s=e(".wpdiscuz-sort-button-active").attr("data-sorting");s&&d.append("sorting",s),d.append("offset",L),d.append("lastParentId",e(".wpd-load-more-submit").attr("data-lastparentid")),d.append("isFirstLoad",t?1:0);var c=e(".wpdf-active").attr("data-filter-type");d.append("wpdType",c||""),fe(v,!t||1!=w,d).done((function(d){"object"==typeof d&&d.success&&(L++,t&&e(".wpd-comment").remove(),e(".wpdiscuz_single").remove(),e(".wpdiscuz-comment-pagination").before(d.data.comment_list),K(d,t&&2!==i),B=!1,d.data.loadLastCommentId&&(r=d.data.loadLastCommentId),ue(d),t&&Q(!1)),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),a&&(a.toggleClass(o),a.toggleClass(n))})).fail((function(t,i,d){console.log(d),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),a&&(a.toggleClass(o),a.toggleClass(n))}))}function K(t,a){var o,n=document.getElementById("wpdiscuzHasMoreComments");if(0==t.data.is_show_load_more)n&&(n.dataset.is_show_load_more=0),e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide();else if(o=t.data.last_parent_id,e(".wpd-load-more-submit").attr("data-lastparentid",o),2!==i&&e(".wpdiscuz-comment-pagination").show(),n&&(n.dataset.is_show_load_more=1),a&&e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").show(),t.data.comments_left>0){if(!e(".wpd-load-more-submit .wpd-comments-left").length){const t=e("<span>");t.addClass("wpd-comments-left"),e(".wpd-load-more-submit").append(t)}e(".wpd-load-more-submit .wpd-comments-left").text(t.data.comments_left_text)}ue(t)}function Q(t){var a=location.href.match(/#comment\-(\d+)/);if(null!==a){var o=a[1];if(e("#comment-"+o).length)setTimeout((function(){ae(),e("html, body").animate({scrollTop:e("#comment-"+o).parents("[id^=wpd-comm-]").offset().top-T},1e3,oe),t&&G(o)}),500);else{var n=new FormData;n.append("action","wpdGetSingleComment"),n.append("commentId",o),fe(v,!0,n).done((function(a){if("object"==typeof a&&a.success){var n="#comment-"+o;e("#comment-"+a.data.parentCommentID).length?e("#comment-"+a.data.parentCommentID).parents("[id^=wpd-comm-"+a.data.parentCommentID+"]").replaceWith(a.data.message):e(".wpd-thread-list").prepend(a.data.message),ue(a),ae(),e("html, body").animate({scrollTop:e(n).offset().top-T},1e3,oe),t&&G(o)}e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}))}}}function G(t){setTimeout((function(){e("#comment-"+t).siblings(".wpd-secondary-form-wrapper").is(":visible")||e("#comment-"+t).find(".wpd-reply-button").trigger("click")}),1100)}function $(e){if(void 0!==e.data.message)for(var t,a=e.data.message,o=0;o<a.length;o++)Z((t=a[o]).comment_parent,t.comment_html)}function X(e,t){var a="";return(a=t?e.parents(".wpd-main-form-wrapper").attr("id"):e.parents(".wpd-comment").attr("id")).substring(a.lastIndexOf("-")+1)}function Y(e){return e.substring(0,e.indexOf("_"))}function J(e,t){return t?e.substring(e.indexOf("-")+1):e.substring(0,e.indexOf("-"))}function Z(t,a){if(0==t)ne(a);else{var o=X(e("#comment-"+t),0);e("#wpdiscuz_form_anchor-"+o).after(a)}}function ee(){var t=[];return e(".wpd-comment-right").each((function(){t.push(Y(X(e(this),0)))})),t.join(",")}function te(t,a){var o=t.find(".wpd-required-group");wpdiscuzLoadRichEditor&&t.find(".wc_comment").val(e(a+">.ql-editor").html()),function(e){var t=e.find(".wc_comment"),a=t.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 "),t.val(a)}(t),e.each(o,(function(){e("input",this).prop("required",!1),0===e("input:checked",this).length?e("input",e(this)).prop("required",!0):e(".wpd-field-invalid",this).remove()}))}function ae(){e("html, body").css("scroll-behavior","unset")}function oe(){e("html").css("scroll-behavior",R),e("body").css("scroll-behavior",S)}function ne(t){e(".wpd-sticky-comment").last()[0]?e(t).insertAfter(e(".wpd-sticky-comment").last()[0]):e(".wpd-thread-list").prepend(t)}function ie(t){t?t.prop("required")||(t.val()?t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none")):e.each(e(".wc_email"),(function(t,a){var o=e(a);o.prop("required")||(o.val()?o.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):o.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none"))}))}if(2!==i||u||(e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide(),N(),e(window).scroll((function(){N()}))),wpdiscuzAjaxObj.setLoadMoreVisibility=K,e("body").on("click",".wpd-vote-up.wpd_not_clicked, .wpd-vote-down.wpd_not_clicked",(function(){var t=e(this);e(t).removeClass("wpd_not_clicked");var a,o=Y(X(t));a=e(this).hasClass("wpd-vote-up")?1:-1;var n=new FormData;n.append("action","wpdVoteOnComment"),n.append("commentId",o),n.append("voteType",a),fe(v,!0,n).done((function(n){if(e(t).addClass("wpd_not_clicked"),"object"==typeof n){if(n.success){if("total"===n.data.buttonsStyle){var i=e(".wpd-comment-footer .wpd-vote-result",e("#comment-"+o)),d=n.data.votes;i.text(n.data.votesHumanReadable),i.attr("title",d),i.removeClass("wpd-up wpd-down"),d>0&&i.addClass("wpd-up"),d<0&&i.addClass("wpd-down")}else{var s=e(".wpd-comment-footer .wpd-vote-result-like",e("#comment-"+o)),c=e(".wpd-comment-footer .wpd-vote-result-dislike",e("#comment-"+o));s.text(n.data.likeCountHumanReadable),s.attr("title",n.data.likeCount),c.text(n.data.dislikeCountHumanReadable),c.attr("title",n.data.dislikeCount),parseInt(n.data.likeCount)>0?s.addClass("wpd-up"):s.removeClass("wpd-up"),parseInt(n.data.dislikeCount)<0?c.addClass("wpd-down"):c.removeClass("wpd-down")}var p=e(".wpd-comment-footer .wpd-vote-up",e("#comment-"+o)),r=e(".wpd-comment-footer .wpd-vote-down",e("#comment-"+o));p.removeClass("wpd-up"),r.removeClass("wpd-down"),n.data.curUserReaction>0?p.addClass("wpd-up"):n.data.curUserReaction<0&&r.addClass("wpd-down")}else n.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[n.data],n.data,t),"error");ue(n,o,a)}else console.log(n);e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(a,o,n){console.log(n),e(t).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e(document).on("click","body",(function(t){var a=e(".wpdiscuz-sort-buttons");e(t.target).hasClass("wpdf-sorting")||e(t.target).parent().hasClass("wpdf-sorting")?a.css({display:a.is(":visible")?"none":"flex"}):a.hide()})),e("body").on("click",".wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)",(function(){var t=e(this),a=e(this).attr("data-sorting");if(a){e(".wpdiscuz-sort-button.wpdiscuz-sort-button-active").removeClass("wpdiscuz-sort-button-active").appendTo(".wpdiscuz-sort-buttons"),t.addClass("wpdiscuz-sort-button-active").prependTo(".wpdf-sorting");var o=new FormData;o.append("action","wpdSorting"),o.append("sorting",a);var n=e(".wpdf-active").attr("data-filter-type");o.append("wpdType",n||""),fe(v,!0,o).done((function(t){"object"==typeof t&&t.success&&(e("#wpdcom .wpd-comment").remove(),e("#wpdcom .wpd-thread-list").prepend(t.data.message),K(t,!1),L=1),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}))}})),window.onhashchange=function(){Q(!1)},1!=w&&Q(!1),e("body").on("click",".wpdiscuz-readmore",(function(){var t=X(e(this)),a=Y(t),o=new FormData;o.append("action","wpdReadMore"),o.append("commentId",a),fe(v,!0,o).done((function(o){"object"==typeof o?(o.success?(e("#comment-"+a+" .wpd-comment-text").replaceWith(" "+o.data.message),e("#wpdiscuz-readmore-"+t).remove()):console.log(o.data),ue(o)):console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e("body").on("change",".wpd-required-group",(function(){0!==e("input:checked",this).length?e("input",e(this)).prop("required",!1):e("input",e(this)).prop("required",!0)})),e("body").on("click",".wpdiscuz-spoiler",(function(){e(this).next().slideToggle(),e(this).hasClass("wpdiscuz-spoiler-closed")?e(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-plus").removeClass("fa-plus").addClass("fa-minus"):e(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-minus").removeClass("fa-minus").addClass("fa-plus"),e(this).toggleClass("wpdiscuz-spoiler-closed")})),e("body").on("click",".wpd-tools i",(function(){var t=e(this).siblings(".wpd-tools-actions");t.is(":visible")||e(this).parents(".wpd-comment-right").attr("id")!==e("[id^=comment-]","#wpdcom").last().attr("id")||e("#comments").css({paddingBottom:"160px"}),t.css({display:t.is(":visible")?"none":"flex"})})),e("body").on("mouseleave",".wpd-comment-right",(function(){e(this).find(".wpd-tools-actions").hide(),e("#comments").css({paddingBottom:"0"})})),e("body").on("click",".wpd_stick_btn",(function(){var t=Y(X(e(this),0)),a=new FormData;a.append("action","wpdStickComment"),a.append("commentId",t),fe(v,!0,a).done((function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e("body").on("click",".wpd_close_btn",(function(){var t=Y(X(e(this),0)),a=new FormData;a.append("action","wpdCloseThread"),a.append("commentId",t),fe(v,!0,a).done((function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e("body").on("click",".wpd-filter.wpd_not_clicked[data-filter-type]",(function(){var t=e(this),a=t.attr("data-filter-type");wpdiscuzAjaxObj.resetActiveFilters(".wpdf-"+a),t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var o=new FormData;o.append("action","wpdLoadMoreComments");var n=e(".wpdiscuz-sort-button-active").attr("data-sorting");n&&o.append("sorting",n),o.append("lastParentId",0),o.append("offset",0),L=1,o.append("wpdType",t.hasClass("wpdf-active")?"":a),o.append("isFirstLoad",1),e(this).hasClass("wpdf-inline")?e(this).hasClass("wpdf-active")?e(".wpd-comment-info-bar").hide():e(".wpd-comment-info-bar").css("display","flex"):e(".wpd-comment-info-bar").hide(),fe(v,!1,o).done((function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(t.toggleClass("wpdf-active"),e(".wpd-load-comments").remove(),e(".wpd-comment").remove(),e(".wpd-thread-list").prepend(a.data.comment_list),K(a),r=a.data.loadLastCommentId,e(".wpd-load-more-submit").blur(),ue(a)),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e("body").on("click",".wpdf-reacted.wpd_not_clicked",(function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var a=new FormData;a.append("action","wpdMostReactedComment"),fe(v,!1,a).done((function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(e("#comment-"+a.data.parentCommentID).length?e("#comment-"+a.data.parentCommentID).parents("[id^=wpd-comm-"+a.data.parentCommentID+"]").replaceWith(a.data.message):e("#comment-"+a.data.commentId).length||e(".wpd-thread-list").prepend(a.data.message),ue(a),ae(),e("html, body").animate({scrollTop:e("#comment-"+a.data.commentId).offset().top-T},1e3,oe))})).fail((function(a,o,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner")}))})),e("body").on("click",".wpdf-hottest.wpd_not_clicked",(function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var a=new FormData;a.append("action","wpdHottestThread"),fe(v,!1,a).done((function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(e("#comment-"+a.data.commentId).length?e("#comment-"+a.data.commentId).parents("[id^=wpd-comm-"+a.data.commentId+"]").replaceWith(a.data.message):e(".wpd-thread-list").prepend(a.data.message),ue(a),ae(),e("html, body").animate({scrollTop:e("#comment-"+a.data.commentId).offset().top-T},1e3,oe))})).fail((function(a,o,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner")}))})),e("body").on("click",".wpd-filter-view-all",(function(){e(".wpdf-inline.wpdf-active.wpd_not_clicked").trigger("click")})),e("body").on("click",".wpd-follow-link.wpd_not_clicked",(function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var a=Y(X(t,0)),o=new FormData;o.append("action","wpdFollowUser"),o.append("commentId",a),fe(v,!0,o).done((function(a){t.addClass("wpd_not_clicked"),"object"==typeof a?a.success?(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data.code],a.data.code,t),"success"),t.removeClass("wpd-follow-active"),a.data.followTip&&t.attr("wpd-tooltip",a.data.followTip),a.data.followClass&&t.addClass(a.data.followClass),ue(a)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"):console.log(a),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(a,o,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),ie(),e("body").on("keyup",".wc_email",(function(){ie(e(this))})),x&&e("#wpdcom").length){if(e("#wpd-bubble-wrapper").hover((function(){e(this).addClass("wpd-bubble-hover")}),(function(){e(this).removeClass("wpd-bubble-hover")})),y&&!Cookies.get(wpdiscuzAjaxObj.cookieHideBubbleHint)&&setTimeout((function(){e("#wpd-bubble-wrapper").addClass("wpd-bubble-hover"),Cookies.set(wpdiscuzAjaxObj.cookieHideBubbleHint,"1",{expires:7,path:"/"}),setTimeout((function(){e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")}),1e3*k)}),1e3*y),"content_left"===A)if(e(".entry-content").length){var de=(se=Math.min(e(".entry-content").offset().left,e("#wpdcom").offset().left)-120)>25?se:25;e("#wpd-bubble-wrapper").css({left:de+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".post-entry").length){de=(se=Math.min(e(".post-entry").offset().left,e("#wpdcom").offset().left)-120)>25?se:25;e("#wpd-bubble-wrapper").css({left:de+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".container").length){var se;de=(se=Math.min(e(".container").offset().left,e("#wpdcom").offset().left)-120)>25?se:25;e("#wpd-bubble-wrapper").css({left:de+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else e("#wpd-bubble-wrapper").css({left:"25px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-corner");else"left_corner"===A?(e("#wpd-bubble-wrapper").css({left:"25px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-corner")):"right_corner"===A&&(e("#wpd-bubble-wrapper").css({right:"25px"}),e("#wpd-bubble-wrapper").addClass("wpd-right-corner"));e("#wpd-bubble-wrapper").show(),e("body").on("click","#wpd-bubble-add-message-close",(function(t){t.preventDefault(),t.stopPropagation(),e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")})),e("body").on("click","#wpd-bubble",(function(){ae(),e("#tab-title-reviews").length&&e("#tab-title-reviews a").trigger("click"),e("html, body").animate({scrollTop:e("#wpdcom").offset().top-(T+28)},1e3,(function(){oe(),e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover"),wpdiscuzLoadRichEditor?e("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0").focus():e("#wc-textarea-0_0").length&&e("#wc-textarea-0_0").trigger("focus")}))})),e("body").on("click","#wpd-bubble-comment-close",(function(t){t.preventDefault(),e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")})),e("body").on("click","#wpd-bubble-comment-reply-link a",(function(){var t=e(this).attr("href");setTimeout((function(){e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),Q(!0);var a=t.match(/#comment\-(\d+)/);E=E.filter((function(e){return e!=a[1]})),e("#wpd-bubble-count .wpd-new-comments-count").text(E.length),0==E.length&&e("#wpd-bubble-count").removeClass("wpd-new-comments")}),100)})),e("body").on("click","#wpd-bubble-count",(function(){if(E.length){var t=new FormData;t.append("action","wpdBubbleUpdate"),t.append("newCommentIds",E.join()),fe(v,!0,t).done((function(t){"object"==typeof t&&t.success&&(t.data.message=t.data.message.filter((function(t){if(!e("#comment-"+t.comment_id).length)return t})),$(t),e("#wpd-bubble-count").removeClass("wpd-new-comments"),e("#wpd-bubble-count .wpd-new-comments-count").text("0"),E=[],e(".wpd-new-loaded-comment").length&&(ae(),e("html, body").animate({scrollTop:e(e(".wpd-new-loaded-comment")[0]).offset().top-(T+28)},1e3,oe)),ue(t)),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(e,t,a){console.log(a)}))}}))}if((x&&C||s)&&(t||!t&&p)&&setTimeout((function t(){e.ajax({type:"GET",url:wpdiscuzAjaxObj.bubbleUpdateUrl,beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",wpdiscuzAjaxObj.restNonce)},data:{postId:d,lastId:l,visibleCommentIds:ee()}}).done((function(a){if(!M)if("object"==typeof a){if(a.commentIDsToRemove.forEach((function(t){e("[id^=wpd-comm-"+t+"]").remove()})),a.ids.length){s&&function(){var t=new FormData;t.append("action","wpdUpdateAutomatically"),t.append("loadLastCommentId",r),t.append("visibleCommentIds",ee()),fe(v,!1,t).done((function(t){M||"object"==typeof t&&t.success&&($(t),t.data.wc_all_comments_count_new=parseInt(t.data.wc_all_comments_count_new),e(".wpd-thread-info").html(t.data.wc_all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",t.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(t.data.wc_all_comments_count_bubble_html),r=t.data.loadLastCommentId)})).fail((function(e,t,a){console.log(a)}))}(),a.ids=a.ids.filter((function(t){if(!e("#comment-"+t).length)return t}));var o=5e3;l=parseInt(a.ids[a.ids.length-1]),E=E.concat(a.ids),O&&a.commentText&&(e("#wpd-bubble-author-avatar").html(a.avatar),e("#wpd-bubble-author-name").html(a.authorName),e("#wpd-bubble-comment-date span").html(a.commentDate),e("#wpd-bubble-comment-text").html(a.commentText),e("#wpd-bubble-comment-reply-link a").attr("href",a.commentLink),e("#wpd-bubble-notification-message").show(),o=1e4);var n=parseInt(e(".wpd-new-comments-count").text());n+=a.ids.length,e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),e("#wpd-bubble-wrapper").addClass("wpd-new-comment-added"),setTimeout((function(){e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")}),o),e(".wpd-new-comments-count").text(n),e("#wpd-bubble-count").addClass("wpd-new-comments")}a.all_comments_count=parseInt(a.all_comments_count),e("#wpd-bubble-all-comments-count").replaceWith(a.all_comments_count_bubble_html),e(".wpd-reviews-tab").length||(e(".wpd-thread-info").html(a.all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",a.all_comments_count))}else console.log(a);setTimeout(t,c)})).fail((function(e,a,o){console.log(o),setTimeout(t,c)}))}),c),e(".wpd-inline-form-wrapper").length){var ce=new FormData;ce.append("action","wpdGetInlineCommentForm"),fe(v,!1,ce).done((function(t){"object"==typeof t?t.success?(e(".wpd-inline-form-wrapper").append(t.data),e.each(e("[name=_wpd_inline_nonce]"),(function(){var t=e(this).attr("id"),a=e(this).parents(".wpd-inline-shortcode").attr("id");e(this).attr("id",t+"-"+a.substring(a.lastIndexOf("-")+1))})),e(".wpd-inline-opened").addClass("wpd-active"),e(".wpd-inline-opened").find(".wpd-inline-form-wrapper").show(),e(".wpd-inline-opened").find(".wpd-inline-icon").addClass("wpd-open"),e(".wpd-inline-opened").find(".wpd-inline-icon").removeClass("wpd-ignored"),we()):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data]),t.data,"error"):console.log(t)})).fail((function(e,t,a){console.log(a)}))}function pe(t){if(e(t).hasClass("wpd-inline-shortcode"))var a=e(t).attr("id");else a=e(t).parents(".wpd-inline-shortcode").attr("id");return a.substring(a.lastIndexOf("-")+1)}function re(){e(".wpd-inline-form-wrapper").hide(),e(".wpd-inline-shortcode").removeClass("wpd-active"),e(".wpd-inline-icon").removeClass("wpd-open")}function le(){e.each(e(".wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon"),(function(){var t=e(this),a=t.offset().top-window.pageYOffset;t.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&a>0&&a<300&&("blink"===I?(t.addClass("wpd-blink"),setTimeout((function(){t.removeClass("wpd-blink")}),3e3)):(t.parents(".wpd-inline-shortcode").addClass("wpd-active"),t.siblings(".wpd-inline-form-wrapper").show(),t.addClass("wpd-open"),we(t.siblings(".wpd-inline-form-wrapper"))))}))}function we(t){if(t){if(t.offset().left<=10)t.css("left",Math.ceil(parseInt(t.css("left"))-t.offset().left+10)),(a=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))<3&&(a=3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"px;");else if(t.offset().left+t.width()>document.body.clientWidth-10){var a;t.css("left",Math.ceil(parseInt(t.css("left"))+(document.body.clientWidth-(t.offset().left+t.width()))-10)),(a=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))>t.width()-3&&(a=t.width()-3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"px;")}}else e.each(e(".wpd-inline-form-wrapper:visible"),(function(){if(e(this).offset().left<=10)e(this).css("left",Math.ceil(parseInt(e(this).css("left"))-e(this).offset().left+10)),(t=Math.ceil(e(this).siblings(".wpd-inline-icon.wpd-open").offset().left-e(this).offset().left+2))<3&&(t=3),document.styleSheets[0].addRule("#"+e(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+t+"px;");else if(e(this).offset().left+e(this).width()>document.body.clientWidth-10){var t;e(this).css("left",Math.ceil(parseInt(e(this).css("left"))+(document.body.clientWidth-(e(this).offset().left+e(this).width()))-10)),(t=Math.ceil(e(this).siblings(".wpd-inline-icon.wpd-open").offset().left-e(this).offset().left+2))>e(this).width()-3&&(t=e(this).width()-3),document.styleSheets[0].addRule("#"+e(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+t+"px;")}}))}function me(t){var a,o=0;if(t.parents(".wpd_main_comm_form").length)o=parseInt(wpdiscuzAjaxObj.commentTextMaxLength),a=t.parents(".wpd_main_comm_form");else if(t.parents(".wpd-secondary-form-wrapper").length)o=parseInt(wpdiscuzAjaxObj.replyTextMaxLength),a=t.parents(".wpd-secondary-form-wrapper");else if(t.parents("#wpdiscuz-edit-form").length){var n=X(t);o=parseInt(n.substring(n.lastIndexOf("_")+1))?parseInt(wpdiscuzAjaxObj.replyTextMaxLength):parseInt(wpdiscuzAjaxObj.commentTextMaxLength),a=t.parents("#wpdiscuz-edit-form")}if(o&&a){var i=t.val().length,d=e(".wpd-editor-char-counter",a),s=o-i;d.html(s),s<=10?d.addClass("error"):d.removeClass("error")}}function ue(t,a,o,n){t.data.callbackFunctions&&e.each(t.data.callbackFunctions,(function(e){"function"==typeof wpdiscuzAjaxObj[t.data.callbackFunctions[e]]?wpdiscuzAjaxObj[t.data.callbackFunctions[e]](t,a,o,n):"function"==typeof window[t.data.callbackFunctions[e]]?window[t.data.callbackFunctions[e]](t,a,o,n):console.log(t.data.callbackFunctions[e]+" is not a function")}))}function fe(t,a,o){a&&e("#wpdiscuz-loading-bar").show(),o.append("postId",d),o.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce);var n=o.get("action");wpdiscuzAjaxObj.dataFilterCallbacks&&wpdiscuzAjaxObj.dataFilterCallbacks[n]&&e.each(wpdiscuzAjaxObj.dataFilterCallbacks[n],(function(e){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]]&&(o=wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]](o,t,a))}));var i=t?wpdiscuzAjaxObj.url:wpdiscuzAjaxObj.customAjaxUrl;return e.ajax({type:"POST",url:i,data:o,contentType:!1,processData:!1})}function he(){if(t||wpdiscuzAjaxObj.validateNonceForGuests){var e=new FormData;e.append("action","wpdGetNonce"),fe(v,!1,e).done((function(e){"object"==typeof e?e.success?wpdiscuzAjaxObj.wpdiscuz_nonce=e.data:wpdiscuzAjaxObj.setCommentMessage(e.data,"error"):console.log(e)})).fail((function(e,t,a){console.log(a)}))}}e(document).on("click","body",(function(t){if(e(t.target).hasClass("wpd-inline-form-close")||e(t.target).parents(".wpd-inline-form-close").length)t.preventDefault(),e(t.target).parents(".wpd-inline-form-wrapper").hide(),e(t.target).parents(".wpd-inline-shortcode").removeClass("wpd-active"),e(t.target).parents(".wpd-inline-form-wrapper").siblings(".wpd-inline-icon").removeClass("wpd-open");else if(!e(t.target).hasClass("wpd-inline-form-wrapper")&&!e(t.target).parents(".wpd-inline-form-wrapper").length){re();var a="";e(t.target).hasClass("wpd-inline-icon")?a=e(t.target):e(t.target).parents(".wpd-inline-icon").length&&(a=e(t.target).parents(".wpd-inline-icon")),a.length&&a.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&(a.parents(".wpd-inline-shortcode").addClass("wpd-active"),a.siblings(".wpd-inline-form-wrapper").show(),a.addClass("wpd-open"),a.removeClass("wpd-ignored"),we(a.siblings(".wpd-inline-form-wrapper")))}(!e(t.target).hasClass("wpd-last-inline-comments-wrapper")&&!e(t.target).parents(".wpd-last-inline-comments-wrapper").length||e(t.target).parents(".wpd-last-inline-comments-wrapper").length&&e(t.target).hasClass("wpd-load-inline-comment"))&&e(".wpd-last-inline-comments-wrapper").remove()})),e("body").on("click",".wpd-inline-submit.wpd_not_clicked",(function(t){t.preventDefault();var a=e(this),o=e(this).parents(".wpd_inline_comm_form");if(o[0].checkValidity()){e(this).removeClass("wpd_not_clicked");var n=new FormData;n.append("action","wpdAddInlineComment"),n.append("inline_form_id",pe(o)),e.each(e("input, textarea",o),(function(t,a){"checkbox"===this.type?e(this).is(":checked")&&n.append(e(a).attr("name"),e(a).val()):n.append(e(a).attr("name"),e(a).val())})),fe(v,!0,n).done((function(t){if(a.addClass("wpd_not_clicked"),"object"==typeof t)if(t.success){o[0].reset(),re();var n=parseInt(t.data.newCount),i=a.parents(".wpd-inline-icon-wrapper").find(".wpd-inline-icon-count");i.text(n),n?i.addClass("wpd-has-comments"):i.removeClass("wpd-has-comments"),t.data.allCommentsCountNew=parseInt(t.data.allCommentsCountNew),e(".wpd-thread-info").html(t.data.allCommentsCountBeforeThreadsHtml),e(".wpd-thread-info").attr("data-comments-count",t.data.allCommentsCountNew),e("#wpd-bubble-all-comments-count").replaceWith(t.data.allCommentsCountBubbleHtml),t.data.message&&ne(t.data.message),wpdiscuzAjaxObj.setCommentMessage(t.data.notification,"success")}else t.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data],t.data,a),"error");else wpdiscuzAjaxObj.setCommentMessage(t,"error");e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}))}})),e("body").on("keydown",".wpd-form",(function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_comm_submit").trigger("click")})),e("body").on("keydown","#wpdiscuz-edit-form",(function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_save_edited_comment").trigger("click")})),e("body").on("keydown",".wpd-inline-comment-content",(function(t){t.ctrlKey&&13==t.keyCode&&e(this).parents(".wpd_inline_comm_form").find(".wpd-inline-submit.wpd_not_clicked").trigger("click")})),e("body").on("click",".wpd-inline-icon-count.wpd-has-comments",(function(){var t=e(this),a=new FormData;a.append("action","wpdGetLastInlineComments"),a.append("inline_form_id",pe(t)),fe(v,!0,a).done((function(a){"object"==typeof a?a.success?e(a.data).insertAfter(t):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"):console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e("body").on("click",".wpd-view-all-inline-comments",(function(t){t.preventDefault(),e(this).parents(".wpd-last-inline-comments-wrapper").remove(),e(".wpdf-inline").hasClass("wpdf-active")||e(".wpdf-inline").trigger("click"),ae(),e("html, body").animate({scrollTop:e(".wpdf-inline").offset().top-T},1e3,oe)})),e("body").on("click",".wpd-feedback-content-link",(function(t){t.preventDefault();var a=e(this).data("feedback-content-id");ae(),e("html, body").animate({scrollTop:e("#wpd-inline-"+a).offset().top-(T+6)},1e3,(function(){oe(),e("#wpd-inline-"+a).addClass("wpd-active")}))})),"scroll_open"!==I&&"blink"!==I||(le(),e(window).on("scroll",le)),e("body").on("click","#wpd-post-rating.wpd-not-rated .wpd-rate-starts svg",(function(){var t=new FormData,a=e(this).index();a>=0&&a<5&&(t.append("action","wpdUserRate"),t.append("rating",a+1),fe(v,!0,t).done((function(t){"object"==typeof t?(t.success?location.reload(!0):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data],t.data),"error"),ue(t)):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})))})),e("body").on("submit","#wpdiscuz-subscribe-form",(function(t){t.preventDefault();var a=e(this);const o=e("#wpdiscuz_subscription_button",a);if(a[0].checkValidity()&&(d=a,s=!0,"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",d).length&&!e("input[name=wpdiscuz_recaptcha_subscribe_form]",d).val().length?(s=!1,e(".wpdiscuz-recaptcha",d).css("border","1px solid red")):"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",d).length&&e(".wpdiscuz-recaptcha",d).css("border","none"),s)&&o.hasClass("wpd_not_clicked")){o.removeClass("wpd_not_clicked");var i=new FormData;i.append("action","wpdAddSubscription"),e("*",a).each((function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&i.append(this.name+"",e(this).val()),"checkbox"!=this.type&&"radio"!=this.type||e(this).is(":checked")&&i.append(this.name+"",e(this).val())})),fe(v,!0,i).done((function(t){"object"==typeof t?t.success?(wpdiscuzAjaxObj.setCommentMessage(t.data,"success"),setTimeout((function(){location.reload(!0)}),3e3)):wpdiscuzAjaxObj.setCommentMessage(t.data,"error"):wpdiscuzAjaxObj.setCommentMessage(t,"error"),e("#wpdiscuz-loading-bar").fadeOut(250),M=!1,o.addClass("wpd_not_clicked")})).fail((function(t,a,n){console.log(n),o.addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)}))}var d,s})),e("body").on("click",".wpd-unsubscribe",(function(t){t.preventDefault();var a=new FormData;a.append("action","wpdUnsubscribe"),a.append("sid",e(this).data("sid")),a.append("skey",e(this).data("skey")),fe(v,!0,a).done((function(t){"object"==typeof t?t.success?(wpdiscuzAjaxObj.setCommentMessage(t.data,"success"),setTimeout((function(){location.reload(!0)}),3e3)):wpdiscuzAjaxObj.setCommentMessage(t.data,"error"):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250),M=!1})).fail((function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),wpdiscuzAjaxObj.resetActiveFilters=function(t){e(".wpd-filter.wpdf-active"+(t?":not("+t+")":"")).removeClass("wpdf-active")},wpdiscuzAjaxObj.getAjaxObj=fe,wpdiscuzAjaxObj.initNonce=he,he()}));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(e){jQuery("#wpdiscuz-recaptcha-field-0_0").val("key")},"expired-callback":function(){jQuery("#wpdiscuz-recaptcha-field-0_0").val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.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.4.2
6
  * Author: gVectors Team
7
  * Author URI: https://gvectors.com/
8
  * Plugin URI: https://wpdiscuz.com/
@@ -421,7 +421,7 @@ class WpdiscuzCore implements WpDiscuzConstants {
421
  if ($closedComment) {
422
  add_comment_meta($new_comment_id, self::META_KEY_CLOSED, "1");
423
  }
424
- $this->form->saveCommentMeta($new_comment_id);
425
  $newComment = get_comment($new_comment_id);
426
  $held_moderate = 1;
427
  if ($newComment->comment_approved === "1") {
@@ -529,17 +529,25 @@ class WpdiscuzCore implements WpDiscuzConstants {
529
 
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"] : "";
537
- $commentarr = [
538
- "comment_ID" => $commentId,
539
- "comment_content" => $commentContent,
540
- "comment_agent" => $userAgent,
541
- "comment_approved" => $comment->comment_approved
542
- ];
543
 
544
 
545
  if (class_exists("Akismet") && method_exists('Akismet', 'auto_check_comment')) {
@@ -551,19 +559,8 @@ class WpdiscuzCore implements WpDiscuzConstants {
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");
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.5
6
  * Author: gVectors Team
7
  * Author URI: https://gvectors.com/
8
  * Plugin URI: https://wpdiscuz.com/
421
  if ($closedComment) {
422
  add_comment_meta($new_comment_id, self::META_KEY_CLOSED, "1");
423
  }
424
+ // $this->form->saveCommentMeta($new_comment_id);
425
  $newComment = get_comment($new_comment_id);
426
  $held_moderate = 1;
427
  if ($newComment->comment_approved === "1") {
529
 
530
  if ($isInRange || $highLevelUser) {
531
  $response = [];
532
+ $commentarr = [
533
+ "comment_ID" => $commentId,
534
+ "comment_content" => $comment->comment_content,
535
+ "comment_approved" => $comment->comment_approved,
536
+ "comment_post_ID" => $comment->comment_post_ID,
537
+ "comment_author" => $comment->comment_author,
538
+ "comment_author_url" => $comment->comment_author_url,
539
+ "comment_author_email" => $comment->comment_author_email,
540
+ "comment_type" => $comment->comment_type,
541
+ "comment_parent" => $comment->comment_parent,
542
+ "user_id" => $comment->user_id
543
+ ];
544
  if ($trimmedContent !== $comment->comment_content) {
545
 
546
  $trimmedContent = $this->helper->replaceCommentContentCode($trimmedContent);
547
  $commentContent = $this->helper->filterCommentText($trimmedContent);
548
  $userAgent = isset($_SERVER["HTTP_USER_AGENT"]) ? $_SERVER["HTTP_USER_AGENT"] : "";
549
+ $commentarr["comment_content"] = $commentContent;
550
+ $commentarr["comment_agent"] = $userAgent;
 
 
 
 
551
 
552
 
553
  if (class_exists("Akismet") && method_exists('Akismet', 'auto_check_comment')) {
559
  $commentarr["comment_approved"] = "spam";
560
  }
561
  }
562
+
563
+ $allow_empty_comment = apply_filters("allow_empty_comment", false, $commentarr);
 
 
 
 
 
 
 
 
 
 
 
564
 
565
  if ("" === $commentContent && !$allow_empty_comment) {
566
  wp_send_json_error("wc_msg_required_fields");
forms/wpDiscuzForm.php CHANGED
@@ -44,6 +44,7 @@ class wpDiscuzForm implements wpdFormConst {
44
  add_action("add_meta_boxes", [$this, "formCustomCssMetabox"]);
45
  add_action("add_meta_boxes_comment", [&$this, "renderEditCommentForm"], 10);
46
  add_filter("comment_save_pre", [&$this, "validateMetaCommentSavePre"], 10);
 
47
  add_action("edit_comment", [&$this, "updateCommentMeta"], 10);
48
  add_filter("comment_text", [&$this, "renderCommentMetaHtml"], 10, 2);
49
  add_filter("wpdiscuz_after_read_more", [&$this, "afterReadMore"], 10, 2);
@@ -73,6 +74,17 @@ class wpDiscuzForm implements wpdFormConst {
73
  return $commentContent;
74
  }
75
 
 
 
 
 
 
 
 
 
 
 
 
76
  public function updateCommentMeta($commentID) {
77
  if (Sanitizer::sanitize(INPUT_POST, "action", "FILTER_SANITIZE_STRING") === "editedcomment") {
78
  $postID = Sanitizer::sanitize(INPUT_POST, "comment_post_ID", FILTER_SANITIZE_NUMBER_INT);
@@ -307,7 +319,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 = !empty($_COOKIE['wp_lang']) && ($lng = $_COOKIE['wp_lang']) ? $lng : 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,7 +389,7 @@ class wpDiscuzForm implements wpdFormConst {
377
  "comment_status" => "closed",
378
  "ping_status" => "closed",
379
  ];
380
- $lang = !empty($_COOKIE['wp_lang']) && ($lng = $_COOKIE['wp_lang']) ? $lng : get_user_locale();;
381
  $formId = wp_insert_post($form);
382
  $defaultFields = [];
383
  $postTypes = [
44
  add_action("add_meta_boxes", [$this, "formCustomCssMetabox"]);
45
  add_action("add_meta_boxes_comment", [&$this, "renderEditCommentForm"], 10);
46
  add_filter("comment_save_pre", [&$this, "validateMetaCommentSavePre"], 10);
47
+ add_action("comment_post", [&$this, "addCommentMeta"], 5);
48
  add_action("edit_comment", [&$this, "updateCommentMeta"], 10);
49
  add_filter("comment_text", [&$this, "renderCommentMetaHtml"], 10, 2);
50
  add_filter("wpdiscuz_after_read_more", [&$this, "afterReadMore"], 10, 2);
74
  return $commentContent;
75
  }
76
 
77
+ public function addCommentMeta($commentID) {
78
+ if (Sanitizer::sanitize(INPUT_POST, "action", "FILTER_SANITIZE_STRING") === "wpdAddComment") {
79
+ $postID = Sanitizer::sanitize(INPUT_POST, "postId", FILTER_SANITIZE_NUMBER_INT);
80
+ $this->getForm($postID);
81
+ if ($this->form) {
82
+ $this->form->saveCommentMeta($commentID);
83
+ }
84
+ }
85
+ }
86
+
87
+
88
  public function updateCommentMeta($commentID) {
89
  if (Sanitizer::sanitize(INPUT_POST, "action", "FILTER_SANITIZE_STRING") === "editedcomment") {
90
  $postID = Sanitizer::sanitize(INPUT_POST, "comment_post_ID", FILTER_SANITIZE_NUMBER_INT);
319
  } elseif (is_string($postType) && isset($this->formContentTypeRel[$postType])) {
320
  $tempContentTypeRel = $this->formContentTypeRel[$postType];
321
  $defaultFormID = array_shift($tempContentTypeRel);
322
+ $lang = get_user_locale();
323
  $formID = isset($this->formContentTypeRel[$postType][$lang]) && $this->formContentTypeRel[$postType][$lang] ? $this->formContentTypeRel[$postType][$lang] : $defaultFormID;
324
  }
325
  $this->form->setFormID($formID);
389
  "comment_status" => "closed",
390
  "ping_status" => "closed",
391
  ];
392
+ $lang = get_user_locale();
393
  $formId = wp_insert_post($form);
394
  $defaultFields = [];
395
  $postTypes = [
forms/wpdFormAttr/Field/HTMLField.php CHANGED
@@ -50,11 +50,22 @@ class HTMLField extends Field {
50
  if (isset($data["value"])) {
51
  $cleanData["value"] = trim($data["value"]);
52
  }
53
- if (isset($data["is_show_sform"])) {
54
- $cleanData["is_show_sform"] = intval($data["is_show_sform"]);
55
- } else {
56
- $cleanData["is_show_sform"] = 0;
57
- }
 
 
 
 
 
 
 
 
 
 
 
58
  return wp_parse_args($cleanData, $this->fieldDefaultData);
59
  }
60
 
50
  if (isset($data["value"])) {
51
  $cleanData["value"] = trim($data["value"]);
52
  }
53
+ if (isset($data["is_show_sform"])) {
54
+ $cleanData["is_show_sform"] = intval($data["is_show_sform"]);
55
+ } else {
56
+ $cleanData["is_show_sform"] = 0;
57
+ }
58
+ if (isset($data["show_for_guests"])) {
59
+ $cleanData["show_for_guests"] = intval($data["show_for_guests"]);
60
+ } else {
61
+ $cleanData["show_for_guests"] = 0;
62
+ }
63
+ if (isset($data["show_for_users"])) {
64
+ $cleanData["show_for_users"] = intval($data["show_for_users"]);
65
+ } else {
66
+ $cleanData["show_for_users"] = 0;
67
+ }
68
+
69
  return wp_parse_args($cleanData, $this->fieldDefaultData);
70
  }
71
 
forms/wpdFormAttr/Field/NumberField.php CHANGED
@@ -185,6 +185,16 @@ class NumberField extends Field {
185
  } else {
186
  $cleanData["is_show_sform"] = 0;
187
  }
 
 
 
 
 
 
 
 
 
 
188
 
189
  return wp_parse_args($cleanData, $this->fieldDefaultData);
190
  }
185
  } else {
186
  $cleanData["is_show_sform"] = 0;
187
  }
188
+ if (isset($data["show_for_guests"])) {
189
+ $cleanData["show_for_guests"] = intval($data["show_for_guests"]);
190
+ } else {
191
+ $cleanData["show_for_guests"] = 0;
192
+ }
193
+ if (isset($data["show_for_users"])) {
194
+ $cleanData["show_for_users"] = intval($data["show_for_users"]);
195
+ } else {
196
+ $cleanData["show_for_users"] = 0;
197
+ }
198
 
199
  return wp_parse_args($cleanData, $this->fieldDefaultData);
200
  }
forms/wpdFormAttr/Form.php CHANGED
@@ -596,7 +596,7 @@ class Form {
596
 
597
  private function validateGeneralOptions($options) {
598
  $validData = [
599
- "lang" => !empty($_COOKIE['wp_lang']) && ($lng = $_COOKIE['wp_lang']) ? $lng : get_user_locale(),
600
  "roles_cannot_see_comments" => [],
601
  "guest_can_see_comments" => 1,
602
  "roles_cannot_comment" => [],
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" => [],
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.4.2
7
  Requires PHP: 5.6 and higher
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
@@ -185,14 +185,22 @@ Nothing will be lost! **Comments - wpDiscuz** will show all old comments.
185
 
186
  == Changelog ==
187
 
188
- = Comments - wpDiscuz v7.4.2 - 12.08.2022 =
 
 
 
 
 
189
 
190
- * Fixed Bug: Undefined array key "wp_lang"
191
 
192
  **IMPORTANT!**
193
 
194
  * Please don't forget delete all caches and purge CDN after the update.
195
 
 
 
 
 
196
  = Comments - wpDiscuz v7.4.1 - 11.08.2022 =
197
 
198
  * Added: Support for dynamic language switcher on WP login page
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.5
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.5 - 12.10.2022 =
189
+
190
+ Fixed Bug: Compatibility with wpForo user profiles
191
+ Fixed Bug: Checkbox field save issue in HTML field type
192
+ Fixed Bug: Compatibility issue with Akismet
193
+ Fixed Vulnerability: Insecure Direct Object References (IDOR)
194
 
 
195
 
196
  **IMPORTANT!**
197
 
198
  * Please don't forget delete all caches and purge CDN after the update.
199
 
200
+ = Comments - wpDiscuz v7.4.2 - 12.08.2022 =
201
+
202
+ * Fixed Bug: Undefined array key "wp_lang"
203
+
204
  = Comments - wpDiscuz v7.4.1 - 11.08.2022 =
205
 
206
  * Added: Support for dynamic language switcher on WP login page
utils/class.WpdiscuzHelper.php CHANGED
@@ -1221,6 +1221,9 @@ class WpdiscuzHelper implements WpDiscuzConstants {
1221
  }
1222
 
1223
  public function addRatingResetButton($postType, $post) {
 
 
 
1224
  $form = $this->wpdiscuzForm->getForm($post->ID);
1225
  if ($form->getFormID() && ($form->getEnableRateOnPost() || $form->getRatingsExists())) {
1226
  add_meta_box("wpd_reset_ratings", __("Reset Ratings", "wpdiscuz"), [&$this, "resetRatingsButtons"], $postType, "side", "low");
1221
  }
1222
 
1223
  public function addRatingResetButton($postType, $post) {
1224
+ if(!$post){
1225
+ return;
1226
+ }
1227
  $form = $this->wpdiscuzForm->getForm($post->ID);
1228
  if ($form->getFormID() && ($form->getEnableRateOnPost() || $form->getRatingsExists())) {
1229
  add_meta_box("wpd_reset_ratings", __("Reset Ratings", "wpdiscuz"), [&$this, "resetRatingsButtons"], $postType, "side", "low");
utils/class.WpdiscuzHelperAjax.php CHANGED
@@ -6,6 +6,9 @@ if (!defined("ABSPATH")) {
6
  class WpdiscuzHelperAjax implements WpDiscuzConstants {
7
 
8
  private $options;
 
 
 
9
  private $dbManager;
10
  private $helper;
11
  private $helperEmail;
6
  class WpdiscuzHelperAjax implements WpDiscuzConstants {
7
 
8
  private $options;
9
+ /**
10
+ * @var WpdiscuzDBManager
11
+ */
12
  private $dbManager;
13
  private $helper;
14
  private $helperEmail;
utils/class.WpdiscuzHelperOptimization.php CHANGED
@@ -96,8 +96,9 @@ class WpdiscuzHelperOptimization implements WpDiscuzConstants {
96
  do_action("wpdiscuz_reset_users_cache", $userId . "_" . $user->user_email . "_" . $user->display_name);
97
  }
98
 
99
- public function wpfProfileUpdate() {
100
- do_action("wpdiscuz_reset_users_cache", WPF()->current_object["user"]["userid"] . "_" . WPF()->current_object["user"]["user_email"] . "_" . WPF()->current_object["user"]["display_name"]);
 
101
  do_action("wpdiscuz_reset_comments_cache");
102
  }
103
 
96
  do_action("wpdiscuz_reset_users_cache", $userId . "_" . $user->user_email . "_" . $user->display_name);
97
  }
98
 
99
+ public function wpfProfileUpdate($user) {
100
+ $wpUser = get_user_by("id", $user["userid"]);
101
+ do_action("wpdiscuz_reset_users_cache", $wpUser->ID . "_" . $wpUser->user_email . "_" . $wpUser->display_name);
102
  do_action("wpdiscuz_reset_comments_cache");
103
  }
104
 
utils/class.WpdiscuzHelperUpload.php CHANGED
@@ -56,6 +56,7 @@ class WpdiscuzHelperUpload implements WpDiscuzConstants {
56
 
57
  add_action("restrict_manage_posts", [$this, "wpdiscuzMediaFiler"]);
58
  add_filter("parse_query", [$this, "getWpdiscuzMedia"]);
 
59
  }
60
  }
61
 
@@ -64,7 +65,7 @@ class WpdiscuzHelperUpload implements WpDiscuzConstants {
64
  $type = apply_filters("wpdiscuz_mu_upload_type", "");
65
  $faIcon = apply_filters("wpdiscuz_mu_upload_icon", "far fa-image");
66
  $allowedExts = apply_filters("wpdiscuz_mu_allowed_extensions", "accept='image/*'");
67
- $html .= "<span class='wmu-upload-wrap' wpd-tooltip='" . esc_attr($this->options->getPhrase("wmuAttachImage", ["unique_id" => $uniqueId])) . "' wpd-tooltip-position='" . (!is_rtl() ? 'left' : 'right' ) . "'>";
68
  $html .= "<label class='wmu-add'>";
69
  $html .= "<i class='$faIcon'></i>";
70
  $html .= "<input style='display:none;' class='wmu-add-files' type='file' name='" . self::INPUT_NAME . "[]' $type $allowedExts/>";
@@ -192,14 +193,16 @@ class WpdiscuzHelperUpload implements WpDiscuzConstants {
192
  $dataSrcValue = "";
193
  }
194
 
195
- $images .= "<div class='wmu-attachment wmu-attachment-$attachment->ID'>";
 
 
196
  if ($lightboxCls) {
197
  $images .= "<a href='$url' class='wmu-attached-image-link $lightboxCls'>";
198
- $images .= "<img style='$style' alt='" . get_post_meta($attachment->ID, "_wp_attachment_image_alt", true) . "' title='" . esc_attr($attachment->post_excerpt) . "' id='wmu-attachemnt-$attachment->ID' class='attachment-$size size-$size wmu-attached-image' src='$srcValue' wmu-data-src='$dataSrcValue' $secondarySizeKey='$secondarySize' />";
199
  $images .= "</a>";
200
  } else {
201
  $images .= apply_filters("wpdiscuz_mu_attached_image_before", "<a href='$url' class='wmu-attached-image-link' target='_blank' rel='noreferrer ugc'>", $attachment->ID);
202
- $images .= "<img style='$style' alt='" . get_post_meta($attachment->ID, "_wp_attachment_image_alt", true) . "' title='" . esc_attr($attachment->post_excerpt) . "' id='wmu-attachemnt-$attachment->ID' class='attachment-$size size-$size wmu-attached-image' src='$srcValue' wmu-data-src='$dataSrcValue' $secondarySizeKey='$secondarySize' />";
203
  $images .= apply_filters("wpdiscuz_mu_attached_image_after", "</a>", $attachment->ID);
204
  }
205
  $images .= $deleteHtml;
@@ -214,16 +217,23 @@ class WpdiscuzHelperUpload implements WpDiscuzConstants {
214
  if ($cId && !empty($_POST["wmu_attachments"])) {
215
  $wmuAttachments = json_decode(stripslashes($_POST["wmu_attachments"]), JSON_OBJECT_AS_ARRAY);
216
  if ($wmuAttachments && is_array($wmuAttachments)) {
217
- update_comment_meta($cId, self::METAKEY_ATTACHMENTS, $wmuAttachments);
218
- foreach ($wmuAttachments as $data) {
 
 
219
  if ($data && is_array($data)) {
220
- foreach ($data as $id) {
221
- if (!empty($id)) {
222
- update_post_meta($id, self::METAKEY_ATTCHMENT_COMMENT_ID, $cId);
 
223
  }
224
  }
225
  }
226
  }
 
 
 
 
227
  }
228
  }
229
  }
@@ -367,19 +377,45 @@ class WpdiscuzHelperUpload implements WpDiscuzConstants {
367
 
368
  if ($attachmentIds) {
369
  $response["attachmentsHtml"] = "<div class='wmu-attached-data-info wmu-hide'>";
370
- $response["attachmentsHtml"] .= "<input class='wmu-attachments-ids' type='hidden' name='wmu_attachments' value='" . esc_attr(json_encode($attachmentIds)) . "'/>";
371
- $response["attachmentsHtml"] .= "<input class='wmu-attachments-data' type='hidden' value='" . esc_attr(json_encode($attachmentsData)) . "'/>";
 
 
372
  $response["attachmentsHtml"] .= "</div>";
373
  $response["previewsData"] = $attachmentsData;
374
  if ($allowedCount == 1) {
375
  $response["tooltip"] = esc_html($this->options->getPhrase("wmuChangeImage", ["unique_id" => $uniqueId]));
376
  }
377
  }
378
-
379
-
380
  wp_send_json_success($response);
381
  }
382
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
383
  private function isAllowedFileType($mimeType, $extension) {
384
  $isAllowed = false;
385
  if (!empty($this->mimeTypes) && is_array($this->mimeTypes)) {
@@ -416,7 +452,8 @@ class WpdiscuzHelperUpload implements WpDiscuzConstants {
416
  public function removeAttachmentPreview() {
417
  $this->helper->validateNonce();
418
  $response = ["errorCode" => "", "error" => "", "attachmentsHtml" => ""];
419
- $attachmentId = WpdiscuzHelper::sanitize(INPUT_POST, "attachmentId", FILTER_SANITIZE_NUMBER_INT, 0);
 
420
  $uniqueId = WpdiscuzHelper::sanitize(INPUT_POST, "uniqueId", "FILTER_SANITIZE_STRING");
421
  $attachment = get_post($attachmentId);
422
 
@@ -447,7 +484,8 @@ class WpdiscuzHelperUpload implements WpDiscuzConstants {
447
  foreach ($wmuAttachmentsData as $key => $value) {
448
  if ($value && is_array($value)) {
449
  foreach ($value as $v) {
450
- if ($v["id"] != $attachmentId) {
 
451
  $attachmentIds[$key][] = $v["id"];
452
  $attachmentsData[$key][] = $v;
453
  $filesCount++;
@@ -471,7 +509,8 @@ class WpdiscuzHelperUpload implements WpDiscuzConstants {
471
  public function deleteAttachment() {
472
  $this->helper->validateNonce();
473
  $response = ["errorCode" => "", "error" => ""];
474
- $attachmentId = isset($_POST["attachmentId"]) ? intval($_POST["attachmentId"]) : 0;
 
475
  $attachment = get_post($attachmentId);
476
  $commentId = get_post_meta($attachmentId, self::METAKEY_ATTCHMENT_COMMENT_ID, true);
477
  $comment = get_comment($commentId);
@@ -489,7 +528,7 @@ class WpdiscuzHelperUpload implements WpDiscuzConstants {
489
  wp_send_json_success($response);
490
  }
491
  } else {
492
- $response["error"] = esc_html__("The attachment not exists", "wpdiscuz");
493
  wp_send_json_error($response);
494
  }
495
  }
@@ -569,7 +608,7 @@ class WpdiscuzHelperUpload implements WpDiscuzConstants {
569
  $ip = WpdiscuzHelper::getRealIPAddr();
570
  update_post_meta($attachId, self::METAKEY_ATTCHMENT_OWNER_IP, $ip);
571
  update_post_meta($attachId, self::METAKEY_ATTCHMENT_COMMENT_ID, 0);
572
- $attachmentData["id"] = $attachId;
573
  $attachmentData["url"] = empty($attachData["sizes"]["thumbnail"]["file"]) ? $this->wpUploadsUrl . "/" . $cleanFileName : $this->wpUploadsUrl . "/" . $attachData["sizes"]["thumbnail"]["file"];
574
  $attachmentData["fullname"] = $cleanRealFileName;
575
  $attachmentData["shortname"] = $this->getFileName($cleanRealFileName);
@@ -720,7 +759,8 @@ class WpdiscuzHelperUpload implements WpDiscuzConstants {
720
  }
721
 
722
  public function getDeleteHtml($currentUser, $attachment, $type) {
723
- $deleteHtml = "<div class='wmu-attachment-delete wmu-delete-$type' title='" . esc_html__("Delete", "wpdiscuz") . "' data-wmu-attachment='$attachment->ID'>&nbsp;</div>";
 
724
  return $this->canEditAttachments($currentUser, $attachment) ? $deleteHtml : "<div class='wmu-separator'></div>";
725
  }
726
 
@@ -842,11 +882,18 @@ class WpdiscuzHelperUpload implements WpDiscuzConstants {
842
  $mode = WpdiscuzHelper::sanitize(INPUT_GET, "mode", "FILTER_SANITIZE_STRING");
843
  $source = WpdiscuzHelper::sanitize(INPUT_GET, "media_source", "FILTER_SANITIZE_STRING");
844
 
845
- if (is_admin() && "upload.php" === $pagenow && $mode === "list" && $source === "wpdiscuz") {
846
  $query->query_vars["meta_key"] = "_wmu_comment_id";
847
  $query->query_vars["meta_value"] = "";
848
  $query->query_vars["meta_compare"] = "!=";
849
  }
850
  }
851
 
 
 
 
 
 
 
 
852
  }
56
 
57
  add_action("restrict_manage_posts", [$this, "wpdiscuzMediaFiler"]);
58
  add_filter("parse_query", [$this, "getWpdiscuzMedia"]);
59
+ // add_filter("manage_media_columns", [$this, "wpdiscuzMediaCommentColumn"], 10, 2);
60
  }
61
  }
62
 
65
  $type = apply_filters("wpdiscuz_mu_upload_type", "");
66
  $faIcon = apply_filters("wpdiscuz_mu_upload_icon", "far fa-image");
67
  $allowedExts = apply_filters("wpdiscuz_mu_allowed_extensions", "accept='image/*'");
68
+ $html .= "<span class='wmu-upload-wrap' wpd-tooltip='" . esc_attr($this->options->getPhrase("wmuAttachImage", ["unique_id" => $uniqueId])) . "' wpd-tooltip-position='" . (!is_rtl() ? 'left' : 'right') . "'>";
69
  $html .= "<label class='wmu-add'>";
70
  $html .= "<i class='$faIcon'></i>";
71
  $html .= "<input style='display:none;' class='wmu-add-files' type='file' name='" . self::INPUT_NAME . "[]' $type $allowedExts/>";
193
  $dataSrcValue = "";
194
  }
195
 
196
+ $attachmentId = self::encrypt($attachment->ID);
197
+
198
+ $images .= "<div class='wmu-attachment wmu-attachment-$attachmentId'>";
199
  if ($lightboxCls) {
200
  $images .= "<a href='$url' class='wmu-attached-image-link $lightboxCls'>";
201
+ $images .= "<img style='$style' alt='" . get_post_meta($attachment->ID, "_wp_attachment_image_alt", true) . "' title='" . esc_attr($attachment->post_excerpt) . "' id='wmu-attachemnt-$attachmentId' class='attachment-$size size-$size wmu-attached-image' src='$srcValue' wmu-data-src='$dataSrcValue' $secondarySizeKey='$secondarySize' />";
202
  $images .= "</a>";
203
  } else {
204
  $images .= apply_filters("wpdiscuz_mu_attached_image_before", "<a href='$url' class='wmu-attached-image-link' target='_blank' rel='noreferrer ugc'>", $attachment->ID);
205
+ $images .= "<img style='$style' alt='" . get_post_meta($attachment->ID, "_wp_attachment_image_alt", true) . "' title='" . esc_attr($attachment->post_excerpt) . "' id='wmu-attachemnt-$attachmentId' class='attachment-$size size-$size wmu-attached-image' src='$srcValue' wmu-data-src='$dataSrcValue' $secondarySizeKey='$secondarySize' />";
206
  $images .= apply_filters("wpdiscuz_mu_attached_image_after", "</a>", $attachment->ID);
207
  }
208
  $images .= $deleteHtml;
217
  if ($cId && !empty($_POST["wmu_attachments"])) {
218
  $wmuAttachments = json_decode(stripslashes($_POST["wmu_attachments"]), JSON_OBJECT_AS_ARRAY);
219
  if ($wmuAttachments && is_array($wmuAttachments)) {
220
+
221
+ $attachments = [];
222
+
223
+ foreach ($wmuAttachments as $key => $data) {
224
  if ($data && is_array($data)) {
225
+ foreach ($data as $attachmentId) {
226
+ if (!empty($attachmentId) && ($attachmentId = self::decrypt($attachmentId))) {
227
+ $attachments[$key][] = $attachmentId;
228
+ update_post_meta($attachmentId, self::METAKEY_ATTCHMENT_COMMENT_ID, $cId);
229
  }
230
  }
231
  }
232
  }
233
+
234
+ if ($attachments) {
235
+ update_comment_meta($cId, self::METAKEY_ATTACHMENTS, $attachments);
236
+ }
237
  }
238
  }
239
  }
377
 
378
  if ($attachmentIds) {
379
  $response["attachmentsHtml"] = "<div class='wmu-attached-data-info wmu-hide'>";
380
+ // $response["attachmentsHtml"] .= "<input class='wmu-attachments-ids' type='hidden' name='wmu_attachments' value='" . esc_attr(json_encode($attachmentIds)) . "'/>";
381
+ $response["attachmentsHtml"] .= "<textarea class='wmu-attachments-ids' name='wmu_attachments'>" . esc_attr(json_encode($attachmentIds)) . "</textarea>";
382
+ $response["attachmentsHtml"] .= "<textarea class='wmu-attachments-data'>" . esc_attr(json_encode($attachmentsData)) . "</textarea>";
383
+ // $response["attachmentsHtml"] .= "<input class='wmu-attachments-data' type='hidden' value='" . esc_attr(json_encode($attachmentsData)) . "'/>";
384
  $response["attachmentsHtml"] .= "</div>";
385
  $response["previewsData"] = $attachmentsData;
386
  if ($allowedCount == 1) {
387
  $response["tooltip"] = esc_html($this->options->getPhrase("wmuChangeImage", ["unique_id" => $uniqueId]));
388
  }
389
  }
 
 
390
  wp_send_json_success($response);
391
  }
392
 
393
+ public static function encrypt($data) {
394
+ $key = __FILE__;
395
+ $plaintext = $data;
396
+ $ivlen = openssl_cipher_iv_length($cipher = 'AES-128-CBC');
397
+ $iv = openssl_random_pseudo_bytes($ivlen);
398
+ $ciphertext_raw = openssl_encrypt($plaintext, $cipher, $key, $options = OPENSSL_RAW_DATA, $iv);
399
+ $hmac = hash_hmac('sha256', $ciphertext_raw, $key, $as_binary = true);
400
+ $ciphertext = base64_encode($iv . $hmac . $ciphertext_raw);
401
+ return $ciphertext;
402
+ }
403
+
404
+ public static function decrypt($data) {
405
+ $key = __FILE__;
406
+ $c = base64_decode($data);
407
+ $ivlen = openssl_cipher_iv_length($cipher = 'AES-128-CBC');
408
+ $iv = substr($c, 0, $ivlen);
409
+ $hmac = substr($c, $ivlen, $sha2len = 32);
410
+ $ciphertext_raw = substr($c, $ivlen + $sha2len);
411
+ $original_plaintext = openssl_decrypt($ciphertext_raw, $cipher, $key, $options = OPENSSL_RAW_DATA, $iv);
412
+ $calcmac = hash_hmac('sha256', $ciphertext_raw, $key, $as_binary = true);
413
+ if ($original_plaintext && hash_equals($hmac, $calcmac)) {
414
+ return $original_plaintext;
415
+ }
416
+ return false;
417
+ }
418
+
419
  private function isAllowedFileType($mimeType, $extension) {
420
  $isAllowed = false;
421
  if (!empty($this->mimeTypes) && is_array($this->mimeTypes)) {
452
  public function removeAttachmentPreview() {
453
  $this->helper->validateNonce();
454
  $response = ["errorCode" => "", "error" => "", "attachmentsHtml" => ""];
455
+ $attachmentId = WpdiscuzHelper::sanitize(INPUT_POST, "attachmentId", "FILTER_SANITIZE_STRING", 0);
456
+ $attachmentId = self::decrypt($attachmentId);
457
  $uniqueId = WpdiscuzHelper::sanitize(INPUT_POST, "uniqueId", "FILTER_SANITIZE_STRING");
458
  $attachment = get_post($attachmentId);
459
 
484
  foreach ($wmuAttachmentsData as $key => $value) {
485
  if ($value && is_array($value)) {
486
  foreach ($value as $v) {
487
+ $attachmentDataId = self::decrypt($v["id"]);
488
+ if ($attachmentDataId != $attachmentId) {
489
  $attachmentIds[$key][] = $v["id"];
490
  $attachmentsData[$key][] = $v;
491
  $filesCount++;
509
  public function deleteAttachment() {
510
  $this->helper->validateNonce();
511
  $response = ["errorCode" => "", "error" => ""];
512
+ $attachmentId = isset($_POST["attachmentId"]) ? trim($_POST["attachmentId"]) : 0;
513
+ $attachmentId = self::decrypt($attachmentId);
514
  $attachment = get_post($attachmentId);
515
  $commentId = get_post_meta($attachmentId, self::METAKEY_ATTCHMENT_COMMENT_ID, true);
516
  $comment = get_comment($commentId);
528
  wp_send_json_success($response);
529
  }
530
  } else {
531
+ $response["error"] = esc_html__("The attachment does not exist", "wpdiscuz");
532
  wp_send_json_error($response);
533
  }
534
  }
608
  $ip = WpdiscuzHelper::getRealIPAddr();
609
  update_post_meta($attachId, self::METAKEY_ATTCHMENT_OWNER_IP, $ip);
610
  update_post_meta($attachId, self::METAKEY_ATTCHMENT_COMMENT_ID, 0);
611
+ $attachmentData["id"] = self::encrypt($attachId);
612
  $attachmentData["url"] = empty($attachData["sizes"]["thumbnail"]["file"]) ? $this->wpUploadsUrl . "/" . $cleanFileName : $this->wpUploadsUrl . "/" . $attachData["sizes"]["thumbnail"]["file"];
613
  $attachmentData["fullname"] = $cleanRealFileName;
614
  $attachmentData["shortname"] = $this->getFileName($cleanRealFileName);
759
  }
760
 
761
  public function getDeleteHtml($currentUser, $attachment, $type) {
762
+ $attachmentId = self::encrypt($attachment->ID);
763
+ $deleteHtml = "<div class='wmu-attachment-delete wmu-delete-$type' title='" . esc_html__("Delete", "wpdiscuz") . "' data-wmu-attachment='$attachmentId'>&nbsp;</div>";
764
  return $this->canEditAttachments($currentUser, $attachment) ? $deleteHtml : "<div class='wmu-separator'></div>";
765
  }
766
 
882
  $mode = WpdiscuzHelper::sanitize(INPUT_GET, "mode", "FILTER_SANITIZE_STRING");
883
  $source = WpdiscuzHelper::sanitize(INPUT_GET, "media_source", "FILTER_SANITIZE_STRING");
884
 
885
+ if (is_admin() && "upload.php" === $pagenow && $mode === "list" && $source === "wpdiscuz") {
886
  $query->query_vars["meta_key"] = "_wmu_comment_id";
887
  $query->query_vars["meta_value"] = "";
888
  $query->query_vars["meta_compare"] = "!=";
889
  }
890
  }
891
 
892
+ public function wpdiscuzMediaCommentColumn($columns, $detached) {
893
+ if ($columns && is_array($columns)) {
894
+ $columns['wpdcomment'] = __('Attached To Comment', 'wpdiscuz');
895
+ }
896
+ return $columns;
897
+ }
898
+
899
  }