Comments – wpDiscuz - Version 7.3.18

Version Description

Download this release

Release Info

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

Code changes from version 7.3.17 to 7.3.18

assets/css/wpdiscuz-options.css CHANGED
@@ -543,4 +543,106 @@
543
 
544
  .wpdtool-left {float: left;}
545
  .wpdtool-right {float: right;}
546
- /* ============== TOOLS PAGE ============== */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
543
 
544
  .wpdtool-left {float: left;}
545
  .wpdtool-right {float: right;}
546
+ /* ============== TOOLS PAGE ============== */
547
+
548
+ /* PHRASES ACCORDION START */
549
+ .wc-form .wpd-accordion .wpd-accordion-item {
550
+ margin:7px 0px;
551
+ }
552
+ .wc-form .wpd-accordion .wpd-accordion-title {
553
+ position: relative;
554
+ padding: 4px 50px 4px 4px;
555
+ cursor: pointer;
556
+ display: block;
557
+ border: 1px solid #d3d3d3;
558
+ background-color: #f9f9f9;
559
+ color: #10b493;
560
+ }
561
+
562
+ .wc-form .wpd-accordion .wpd-accordion-title p {
563
+ margin: 5px 0 5px 15px;
564
+ font-weight: normal;
565
+ font-size: 20px;
566
+ }
567
+ .wc-form .wpd-accordion .wpd-accordion-title:after {
568
+ content: "\f139";
569
+ font-family: dashicons;
570
+ display: inline-block;
571
+ position: absolute;
572
+ top: 50%;
573
+ transform: translateY(-50%);
574
+ right: 10px;
575
+ transition: all .4s ease;
576
+ transform-origin: 50%;
577
+ font-size: 25px;
578
+ }
579
+
580
+ .wc-form .wpd-accordion .wpd-accordion-current .wpd-accordion-title:after {
581
+ transform: translateY(-50%) rotateZ(90deg);
582
+ }
583
+ .wc-form .wpd-accordion .wpd-accordion-item:not(.wpd-accordion-current) .wpd-accordion-content {
584
+ display: none;
585
+ }
586
+ .wc-form .wpd-accordion .wpd-accordion-current .wpd-accordion-title {
587
+ background-color: #00B38F;
588
+ color:#f0f0f0;
589
+ }
590
+
591
+ #wpd-setbox .wc-form .wpd-accordion .wpd-accordion-content .wpd-opt-name {
592
+ width: calc(40% - 42px);
593
+ }
594
+ #wpd-setbox .wc-form .wpd-accordion .wpd-accordion-content .wpd-opt-input {
595
+ width: 60%;
596
+ }
597
+
598
+ #wpd-setbox .wc-form .wpd-accordion .wc_available_variable[data-wpd-clipboard] {
599
+ cursor: pointer;
600
+ display: block;
601
+ margin-top: 5px;
602
+ font-weight: normal;
603
+ font-size: 13px;
604
+ }
605
+ /* PHRASES ACCORDION END */
606
+
607
+
608
+ /* NOTICES START */
609
+
610
+ .wpd-notices-container {
611
+ position: fixed;
612
+ top: 36px;
613
+ right: 5px;
614
+ width: 300px;
615
+ line-height: 20px;
616
+ z-index: 999999;
617
+ }
618
+
619
+ .wpd-notice {
620
+ /*background: #fff;*/
621
+ /*border: 1px solid #c3c4c7;*/
622
+ /*border-left-width: 4px;*/
623
+ /*box-shadow: 0 1px 1px rgba(0,0,0,.04);*/
624
+ /*padding: 1px 12px;*/
625
+ margin-top: 5px;
626
+ color: #fff;
627
+ font-size: 14px;
628
+ padding: 10px 20px;
629
+ box-shadow: #666 0px 0px 8px;
630
+ }
631
+
632
+ .wpd-notice-error {
633
+ background-color: #d63638;
634
+ /*border-left-color: #d63638;*/
635
+ }
636
+
637
+ .wpd-notice-warning {
638
+ background-color: #dba617;
639
+ /*border-left-color: #dba617;*/
640
+ }
641
+
642
+ .wpd-notice-success {
643
+ /*background-color: #00a32a;*/
644
+ background-color: #4caf50;
645
+ /*border-left-color: #00a32a;*/
646
+ }
647
+
648
+ /* NOTICES END */
assets/js/wpdiscuz-combo-no_quill.min.js CHANGED
@@ -3,14 +3,14 @@
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),s=parseInt(wpdiscuzAjaxObj.wc_post_id);wpdiscuzAjaxObj.wpdiscuz_nonce="";var d=parseInt(wpdiscuzAjaxObj.commentListUpdateType),c=1e3*parseInt(wpdiscuzAjaxObj.commentListUpdateTimer),p=parseInt(wpdiscuzAjaxObj.liveUpdateGuests),r=wpdiscuzAjaxObj.loadLastCommentId,l=r,m=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 w,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),k=parseInt(wpdiscuzAjaxObj.bubbleHintTimeout),O=parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout)?parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout):5,y=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(){we(e(this))}),e.each(e("textarea.wc_comment"),function(){we(e(this))})),e(document).on("focus","#wpdcom .ql-editor, #wpdcom .wc_comment",function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(j)}),e(document).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(document).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(document).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(document).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){var i={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)};U(i)}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(document).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(document).on("click",".wpdiscuz-nofollow,.wc_captcha_refresh_img,.wpd-load-more-submit",function(e){e.preventDefault()}),e(document).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(document).on("mouseenter",".wpd-new-loaded-comment",function(){e(this).removeClass("wpd-new-loaded-comment")}),e(document).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(document).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(document).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"}]):we(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(document).on("click",".wc_comm_submit.wpd_not_clicked",function(){var i=e(this),s=1,d=e(this).parents("form");if("true"!==d.attr("data-uploading"))if(d.hasClass("wpd_main_comm_form")||(s=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(d,"#wpd-editor-"+e(".wpdiscuz_unique_id",d).val()),d.on("submit",function(e){e.preventDefault()}),""!==e(".wc_comment",d).val().trim()){if(d[0].checkValidity()&&(p=d,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))}))})}(d),e(i).removeClass("wpd_not_clicked");var c=new FormData;if(c.append("action","wpdAddComment"),e(":input",d).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",s),wpdiscuzAjaxObj.wpdiscuz_zs&&c.append("wpdiscuz_zs",wpdiscuzAjaxObj.wpdiscuz_zs),e(".wpd-cookies-checkbox",d).length?e(".wpd-cookies-checkbox",d).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(d,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(d,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",d).val()),e(".wpdiscuz_reset").val("")}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wc_msg_required_fields,"wc_msg_required_fields",d),"error");else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhraseDoingUpload,"wmuPhraseDoingUpload",d),"warning")}),e(document).on("click",".wpd_editable_comment",function(){w&&e(".wpdiscuz-edit-form-wrap").length&&W(X(e(".wpdiscuz-edit-form-wrap"),0),w);var t=e(this),a=X(t,0),o=Y(a),n=new FormData;n.append("action","wpdEditComment"),n.append("commentId",o),w=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),we(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(document).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?(n.success?(W(a,n.data.message),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)):console.log(n),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wc_cancel_edit",function(){var t=X(e(this));W(t,w),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)}),!u&&m&&(L=0,1==m?setTimeout(function(){B(!0)},500):e(document).on("click",".wpd-load-comments",function(){e(this).parent(".wpd-load-more-submit-wrap").remove(),B(!0)})),e(document).on("click",".wpd-load-more-submit",function(){var t=e(this);t.hasClass("wpd-loaded")&&B(!1,t,"wpd-loaded","wpd-loading")});var N=!1;function V(){var t=e("#wpdiscuzHasMoreComments").val(),a=e(document).height(),o=e(window).height()+e(window).scrollTop();a&&o&&(100*o/a>=80&&!1===N&&1==t&&(N=!0,B(!1,e(".wpd-load-more-submit"))))}function B(t,a,o,n){a&&(a.toggleClass(o),a.toggleClass(n));var s=new FormData;s.append("action","wpdLoadMoreComments");var d=e(".wpdiscuz-sort-button-active").attr("data-sorting");d&&s.append("sorting",d),s.append("offset",L),s.append("lastParentId",e(".wpd-load-more-submit").attr("data-lastparentid")),s.append("isFirstLoad",t?1:0);var c=e(".wpdf-active").attr("data-filter-type");s.append("wpdType",c||""),fe(v,!t||1!=m,s).done(function(s){"object"==typeof s&&s.success&&(L++,t&&e(".wpd-comment").remove(),e(".wpdiscuz_single").remove(),e(".wpdiscuz-comment-pagination").before(s.data.comment_list),K(s,t&&2!==i),N=!1,s.data.loadLastCommentId&&(r=s.data.loadLastCommentId),ue(s),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,s){console.log(s),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),a&&(a.toggleClass(o),a.toggleClass(n))})}function K(t,a){if(0==t.data.is_show_load_more)e("#wpdiscuzHasMoreComments").val(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(),e("#wpdiscuzHasMoreComments").val(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)}var o;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(),V(),e(window).scroll(function(){V()})),wpdiscuzAjaxObj.setLoadMoreVisibility=K,e(document).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)),s=n.data.votes;i.text(n.data.votesHumanReadable),i.attr("title",s),i.removeClass("wpd-up wpd-down"),s>0&&i.addClass("wpd-up"),s<0&&i.addClass("wpd-down")}else{var d=e(".wpd-comment-footer .wpd-vote-result-like",e("#comment-"+o)),c=e(".wpd-comment-footer .wpd-vote-result-dislike",e("#comment-"+o));d.text(n.data.likeCountHumanReadable),d.attr("title",n.data.likeCount),c.text(n.data.dislikeCountHumanReadable),c.attr("title",n.data.dislikeCount),parseInt(n.data.likeCount)>0?d.addClass("wpd-up"):d.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(document).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!=m&&Q(!1),e(document).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(document).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(document).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(document).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(document).on("mouseleave",".wpd-comment-right",function(){e(this).find(".wpd-tools-actions").hide(),e("#comments").css({paddingBottom:"0"})}),e(document).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(document).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(document).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(document).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(document).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(document).on("click",".wpd-filter-view-all",function(){e(".wpdf-inline.wpdf-active.wpd_not_clicked").trigger("click")}),e(document).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(document).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")}),k&&!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*O)},1e3*k),"content_left"===A)if(e(".entry-content").length){var se=(de=Math.min(e(".entry-content").offset().left,e("#wpdcom").offset().left)-120)>25?de:25;e("#wpd-bubble-wrapper").css({left:se+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".post-entry").length){se=(de=Math.min(e(".post-entry").offset().left,e("#wpdcom").offset().left)-120)>25?de:25;e("#wpd-bubble-wrapper").css({left:se+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".container").length){var de;se=(de=Math.min(e(".container").offset().left,e("#wpdcom").offset().left)-120)>25?de:25;e("#wpd-bubble-wrapper").css({left:se+"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(document).on("click","#wpd-bubble-add-message-close",function(t){t.preventDefault(),t.stopPropagation(),e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")}),e(document).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(document).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(document).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(document).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||d)&&(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:s,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){d&&((i=new FormData).append("action","wpdUpdateAutomatically"),i.append("loadLastCommentId",r),i.append("visibleCommentIds",ee()),fe(v,!1,i).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),y&&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);var i;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"),me()):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"),me(t.siblings(".wpd-inline-form-wrapper"))))})}function me(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 we(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,s=e(".wpd-editor-char-counter",a),d=o-i;s.html(d),d<=10?s.addClass("error"):s.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",s),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"),me(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(document).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(document).on("keydown",".wpd-form",function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_comm_submit").trigger("click")}),e(document).on("keydown","#wpdiscuz-edit-form",function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_save_edited_comment").trigger("click")}),e(document).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(document).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(document).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(document).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(document).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(document).on("submit","#wpdiscuz-subscribe-form",function(t){t.preventDefault();var a,o,i=e(this);if(i[0].checkValidity()&&(a=i,o=!0,"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).length&&!e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).val().length?(o=!1,e(".wpdiscuz-recaptcha",a).css("border","1px solid red")):"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).length&&e(".wpdiscuz-recaptcha",a).css("border","none"),o)){var s=new FormData;s.append("action","wpdAddSubscription"),e("*",i).each(function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&s.append(this.name+"",e(this).val()),"checkbox"!=this.type&&"radio"!=this.type||e(this).is(":checked")&&s.append(this.name+"",e(this).val())}),fe(v,!0,s).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}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).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(a){if(a(document).on("click","#wpdcom .wmu-upload-wrap",function(){a(".wpd-form-foot",a(this).parents(".wpd_comm_form")).slideDown(parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0)}),a(document).on("change",".wmu-add-files",function(){var e=a(this),t=e.parents(".wpd_comm_form"),d=e[0].files?e[0].files:[];d.length&&function(e,t,d){t.attr("data-uploading","true");var o=new FormData;o.append("action","wmuUploadFiles"),o.append("wmuAttachmentsData",a(".wmu-attachments-data",t).val()),o.append("uniqueId",t.find(".wpdiscuz_unique_id").val());var i=0;a.each(d,function(a,e){i+=e.size,o.append(wpdiscuzAjaxObj.wmuInput+"["+a+"]",e)}),i>parseInt(wpdiscuzAjaxObj.wmuMaxFileSize)?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhraseMaxFileSize,"wmuPhraseMaxFileSize",e),"error",3e3):i>parseInt(wpdiscuzAjaxObj.wmuPostMaxSize)?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhrasePostMaxSize,"wmuPhrasePostMaxSize",e),"error",3e3):wpdiscuzAjaxObj.getAjaxObj(!0,!0,o).done(function(e){e.success?(a(".wmu-attached-data-info",t).remove(),a(".wmu-add-files",t).after(e.data.attachmentsHtml),e.data.tooltip&&a(".wmu-upload-wrap",t).attr("wpd-tooltip",e.data.tooltip),function(e,t){a.each(t.data.previewsData,function(t,d){a(".wmu-action-wrap .wmu-"+t+"-tab",e).html(""),a.each(d,function(d,o){var i=o.id,r="",s=o.fullname,u=o.shortname;t==wpdiscuzAjaxObj.wmuKeyImages?(r=o.url,u=""):t==wpdiscuzAjaxObj.wmuKeyVideos?r=wpdiscuzAjaxObj.wmuIconVideo:t==wpdiscuzAjaxObj.wmuKeyFiles&&(r=wpdiscuzAjaxObj.wmuIconFile);var n='<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>';n=(n=(n=(n=(n=(n=n.replace("[PREVIEW_TYPE_CLASS]","wmu-preview-"+t)).replace("[PREVIEW_TITLE]",s)).replace("[PREVIEW_TYPE]",t)).replace("[PREVIEW_ID]",i)).replace("[PREVIEW_ICON]",r)).replace("[PREVIEW_FILENAME]",u),a(".wmu-action-wrap .wmu-"+t+"-tab",e).removeClass("wmu-hide").append(n)})})}(t,e),e.data.errors&&(wpdiscuzAjaxObj.setCommentMessage(e.data.errors,"error",3e3),console.log(e.data.errors))):e.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[e.data.errorCode],e.data.errorCode,t),"error",3e3):e.data.error&&wpdiscuzAjaxObj.setCommentMessage(e.data.error,"error",3e3),a("#wpdiscuz-loading-bar").fadeOut(250),t.attr("data-uploading","false")}).fail(function(e,d,o){console.log(o),a("#wpdiscuz-loading-bar").fadeOut(250),t.attr("data-uploading","false")})}(e,t,d)}),a(document).on("click",".wmu-attachment-delete",function(e){if(confirm(wpdiscuzAjaxObj.wmuPhraseConfirmDelete)){var t=a(this).data("wmu-attachment"),d=new FormData;d.append("action","wmuDeleteAttachment"),d.append("attachmentId",t),wpdiscuzAjaxObj.getAjaxObj(!0,!0,d).done(function(e){if(e.success){var d=a(".wmu-attachment-"+t).parents(".wmu-comment-attachments");a(".wmu-attachment-"+t).remove(),a(".wmu-attached-images *",d).length||a(".wmu-attached-images",d).remove(),a(".wmu-attached-videos *",d).length||a(".wmu-attached-videos",d).remove(),a(".wmu-attached-files *",d).length||a(".wmu-attached-files",d).remove()}else e.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[e.data.errorCode],e.data.errorCode,d),"error",3e3):e.data.error&&wpdiscuzAjaxObj.setCommentMessage(e.data.error,"error",3e3);a("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,d){console.log(d),a("#wpdiscuz-loading-bar").fadeOut(250)})}else console.log("canceled")}),a(document).on("click",".wmu-preview",function(){var e=a(this),t=e.parents(".wpd_comm_form"),d=(e.data("wmu-type"),e.data("wmu-attachment")),o=new FormData;o.append("action","wmuRemoveAttachmentPreview"),o.append("attachmentId",d),o.append("wmuAttachmentsData",a(".wmu-attachments-data",t).val()),o.append("uniqueId",t.find(".wpdiscuz_unique_id").val()),wpdiscuzAjaxObj.getAjaxObj(!0,!0,o).done(function(d){if(d.success){e.remove();var o=a(".wmu-tabs",t);a.each(o,function(e,t){a(".wmu-preview",t).length?a(t).removeClass("wmu-hide"):a(t).addClass("wmu-hide")}),a(".wmu-attached-data-info",t).remove(),a(".wmu-add-files",t).after(d.data.attachmentsHtml),d.data.tooltip&&a(".wmu-upload-wrap",t).attr("wpd-tooltip",d.data.tooltip)}else d.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[d.data.errorCode],d.data.errorCode,t),"error",3e3):d.data.error&&wpdiscuzAjaxObj.setCommentMessage(d.data.error,"error",3e3);a("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,d){console.log(d),a("#wpdiscuz-loading-bar").fadeOut(250)})}),parseInt(wpdiscuzAjaxObj.wmuIsLightbox)){function e(){a(".wmu-lightbox").colorbox({maxHeight:"95%",maxWidth:"95%",rel:"wmu-lightbox",fixed:!0})}e(),wpdiscuzAjaxObj.wmuAddLightBox=e}wpdiscuzAjaxObj.wmuHideAll=function(e,t){"object"==typeof e?e.success?(a(".wmu-tabs",t).addClass("wmu-hide"),a(".wmu-preview",t).remove(),a(".wmu-attached-data-info",t).remove()):console.log(e.data):console.log(e)}});
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 */
14
- jQuery(document).ready(function(e){var n=0,t=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),a=parseInt(wpdiscuzUCObj.additionalTab);e(document).on("click",".wpd-info,.wpd-page-link,.wpd-delete-content,.wpd-user-email-delete-links",function(e){e.preventDefault()}),e(document).on("click",".wpd-info.wpd-not-clicked",function(n){var d=e(this);d.removeClass("wpd-not-clicked");var i=new FormData;return i.append("action","wpdGetInfo"),function(n,d){var i=e(".fas",n),o=i.attr("class");i.removeClass(),i.addClass("fas fa-pulse fa-spinner"),wpdiscuzAjaxObj.getAjaxObj(t||a,!1,d).done(function(t){n.addClass("wpd-not-clicked"),i.removeClass(),i.addClass(o),t&&(e("#wpdUserContentInfo").html(t),e("#wpdUserContentInfo ul.wpd-list .wpd-list-item:first-child").addClass("wpd-active"),e("#wpdUserContentInfo div.wpd-content .wpd-content-item:first-child").addClass("wpd-active"),e("#wpdUserContentInfo").is(":visible")||e("#wpdUserContentInfoAnchor").trigger("click"))})}(d,i),!1}),e(document).on("click",".wpd-list-item",function(){var n=e("input.wpd-rel",this).val();e("#wpdUserContentInfo .wpd-list-item").removeClass("wpd-active"),e("#wpdUserContentInfo .wpd-content-item").removeClass("wpd-active");var d=e(this);if(e("#wpdUserContentInfo #"+n).text().length)d.addClass("wpd-active"),e("#wpdUserContentInfo #"+n).addClass("wpd-active");else{var i=new FormData;i.append("action",d.attr("data-action")),i.append("page",0),e("#wpdUserContentInfo #"+n).addClass("wpd-active"),e("#wpdUserContentInfo #"+n).css("text-align","center"),wpdiscuzAjaxObj.getAjaxObj(t||a,!0,i).done(function(t){t&&(e("#wpdUserContentInfo #"+n).css("text-align",""),d.addClass("wpd-active"),e("#wpdUserContentInfo #"+n).html(t)),e("#wpdiscuz-loading-bar").hide()})}}),e(document).on("click",".wpd-page-link.wpd-not-clicked",function(n){var d=e(this);d.removeClass("wpd-not-clicked");var i=d.data("wpd-page"),o=e(".wpd-active .wpd-pagination .wpd-action").val(),c=new FormData;c.append("action",o),c.append("page",i),wpdiscuzAjaxObj.getAjaxObj(t||a,!0,c).done(function(n){d.addClass("wpd-not-clicked"),n&&e(".wpd-content-item.wpd-active").html(n),e("#wpdiscuz-loading-bar").hide()})}),e(document).on("click",".wpd-delete-content.wpd-not-clicked",function(){var d=e(this),i=parseInt(d.data("wpd-content-id"));if(!isNaN(i)){var o=d.data("wpd-delete-action");if("wpdDeleteComment"===o&&!confirm(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzUCObj.msgConfirmDeleteComment,"wc_confirm_comment_delete",d)))return!1;if("wpdCancelSubscription"===o&&!confirm(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzUCObj.msgConfirmCancelSubscription,"wc_confirm_cancel_subscription",d)))return!1;if("wpdCancelFollow"===o&&!confirm(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzUCObj.msgConfirmCancelFollow,"wc_confirm_cancel_follow",d)))return!1;var c=e("i",d),s=c.attr("class"),p=e(".wpd-wrapper .wpd-page-number").val(),l=e(".wpd-content-item.wpd-active").children(".wpd-item").length;d.removeClass("wpd-not-clicked"),c.removeClass().addClass("fas fa-pulse fa-spinner"),1===l&&p>0&&(p-=1);var r=new FormData;r.append("id",i),r.append("page",p),r.append("action",o),wpdiscuzAjaxObj.getAjaxObj(t||a,!1,r).done(function(t){d.addClass("wpd-not-clicked"),c.removeClass().addClass(s),e(".wpd-content-item.wpd-active").html(t),n=1})}}),e(document).on("click","[data-lity-close]",function(t){e(t.target).is("[data-lity-close]")&&n&&window.location.reload(!0)}),e(document).on("click",".wpd-user-email-delete-links.wpd-not-clicked",function(){var n=e(this);n.removeClass("wpd-not-clicked"),e(".wpd-loading",n).addClass("wpd-show");var d=new FormData;d.append("action","wpdEmailDeleteLinks"),wpdiscuzAjaxObj.getAjaxObj(t||a,!1,d).done(function(t){n.addClass("wpd-not-clicked"),e("[data-lity-close]",window.parent.document).trigger("click")})}),e(document).on("click",".wpd-user-settings-button.wpd-not-clicked",function(){var n=e(this);n.removeClass("wpd-not-clicked");var d=n.data("wpd-delete-action");if("deleteCookies"!==d){n.find(".wpd-loading").addClass("wpd-show");var i=new FormData;i.append("action","wpdGuestAction"),i.append("guestAction",d),wpdiscuzAjaxObj.getAjaxObj(t||a,!1,i).done(function(t){n.addClass("wpd-not-clicked"),n.find(".wpd-loading").removeClass("wpd-show");try{var a=e.parseJSON(t);n.after(a.message);var d=n.next(".wpd-guest-action-message");d.fadeIn(100).fadeOut(7e3,function(){d.remove(),1===parseInt(a.code)&&(n.parent().remove(),e(".wpd-delete-all-comments").length||e(".wpd-delete-all-subscriptions").length||e(".wpd-delete-all-cookies").parent().addClass("wpd-show"))})}catch(e){console.log(e)}})}else!function(){for(var e=document.cookie.split(";"),n=0;n<e.length;n++){var t=e[n],a=t.indexOf("="),d=a>-1?t.substr(0,a):t;Cookies.remove(d.trim())}location.reload(!0)}()})});
15
  /* Social */
16
- function wpcShareCommentFB(e,s){FB.ui({method:"share",href:e,quote:s},function(e){})}(!parseInt(wpdiscuzAjaxObj.fbUseOAuth2)&&parseInt(wpdiscuzAjaxObj.enableFbLogin)||parseInt(wpdiscuzAjaxObj.enableFbShare))&&wpdiscuzAjaxObj.facebookAppID&&(!function(e,s,n){var o,a=e.getElementsByTagName(s)[0];e.getElementById(n)||((o=e.createElement(s)).id=n,o.src="//connect.facebook.net/en_US/sdk.js",a.parentNode.insertBefore(o,a))}(document,"script","facebook-jssdk"),window.fbAsyncInit=function(){FB.init({appId:wpdiscuzAjaxObj.facebookAppID,cookie:!0,xfbml:!0,version:"v7.0"})}),jQuery(document).ready(function(e){var s;(s=Cookies.get("wpdiscuz_social_login_message"))&&"undefined"!==s&&(Cookies.remove("wpdiscuz_social_login_message"),wpdiscuzAjaxObj.setCommentMessage(decodeURIComponent(s.replace(/\+/g,"%20")),"error")),Cookies.get("wpdiscuz_scroll_to_comments")&&(Cookies.remove("wpdiscuz_scroll_to_comments",{path:"/"}),e("html, body").animate({scrollTop:e("#comments").offset().top-32},1e3)),e(document).on("click",".wpd-comment-share .fa-facebook-f",function(){if(1==wpdiscuzAjaxObj.enableFbShare){var s=e(this).parents(".wpd-comment").find(".wpd-comment-right").attr("id"),n=window.location.href;-1!==n.indexOf("#")&&(n=n.substring(0,n.indexOf("#"))),wpcShareCommentFB(n+="#"+s,e(this).parents(".wpd-comment-right").find(".wpd-comment-text").text())}});var n="";function o(e,s){var n,o="";t(s,1),Cookies.set("wpdiscuz_scroll_to_comments",1,{path:"/"}),"facebook"===e&&0==wpdiscuzAjaxObj.facebookUseOAuth2?FB.getLoginStatus(function(t){"connected"===t.status?(n=t.authResponse.accessToken,o=t.authResponse.userID,a(e,n,o,s)):FB.login(function(t){"connected"===t.status&&(n=t.authResponse.accessToken,o=t.authResponse.userID,a(e,n,o,s))},{scope:"public_profile,email"})}):a(e,n,o,s)}function a(s,n,o,a){return e.ajax({type:"POST",url:wpdiscuzAjaxObj.url,data:{action:"wpd_social_login",provider:s,token:n,userID:o,postID:wpdiscuzAjaxObj.wc_post_id}}).done(function(s){!function(s,n){try{var o=e.parseJSON(s),a=o.code,i=o.message,c=o.url;200===parseInt(a)?location.assign(c):wpdiscuzAjaxObj.setCommentMessage(i,"error")}catch(e){console.log(e)}t(n,0)}(s,a)}),""}function t(e,s){1===s?e.find(".wpdiscuz-social-login-spinner").show():e.find(".wpdiscuz-social-login-spinner").hide()}e(document).on("click","#wpdcom .wpd-social-login .wpdiscuz-login-button",function(){var s=e(this).parents(".wpd-social-login");!function(e,s){1!=parseInt(wpdiscuzAjaxObj.socialLoginAgreementCheckbox)||1==Cookies.get("socialLoginAgreementConfirmed")?o(e,s):s.parents(".wpd-form-wrap, .wpd-form").find(".wpd-social-login-agreement").first().slideDown(700)}(n=function(e){var s="";e.hasClass("wpdsn-fb")&&(s="facebook");e.hasClass("wpdsn-insta")&&(s="instagram");e.hasClass("wpdsn-gg")&&(s="google");e.hasClass("wpdsn-ds")&&(s="disqus");e.hasClass("wpdsn-wp")&&(s="wordpress");e.hasClass("wpdsn-tw")&&(s="twitter");e.hasClass("wpdsn-vk")&&(s="vk");e.hasClass("wpdsn-ok")&&(s="ok");e.hasClass("wpdsn-linked")&&(s="linkedin");e.hasClass("wpdsn-yandex")&&(s="yandex");e.hasClass("wpdsn-mailru")&&(s="mailru");e.hasClass("wpdsn-weixin")&&(s="wechat");e.hasClass("wpdsn-weibo")&&(s="weibo");e.hasClass("wpdsn-qq")&&(s="qq");e.hasClass("wpdsn-baidu")&&(s="baidu");return s}(e(this)),s)}),e(document).on("click","#wpdcom .wpd-agreement-buttons-right .wpd-agreement-button",function(){var s=e(this).parents(".wpd-form-wrap, .wpd-form").find(".wpd-social-login-agreement").slideUp(700);e(this).hasClass("wpd-agreement-button-agree")&&(wpdiscuzAjaxObj.isCookiesEnabled&&Cookies.set("socialLoginAgreementConfirmed",1,{expires:30,path:"/"}),o(n,s))})});
3
  /* Autogrow */
4
  jQuery.fn.autoGrow=function(){return this.each(function(){var createMirror=function(textarea){jQuery(textarea).after('<div class="autogrow-textarea-mirror"></div>');return jQuery(textarea).next(".autogrow-textarea-mirror")[0]};var sendContentToMirror=function(textarea){mirror.innerHTML=String(textarea.value).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n/g,"<br />")+".<br/>.";if(jQuery(textarea).height()!=jQuery(mirror).height())jQuery(textarea).height(jQuery(mirror).height())};var growTextarea=function(){sendContentToMirror(this)};var mirror=createMirror(this);mirror.style.display="none";mirror.style.wordWrap="break-word";mirror.style.padding=jQuery(this).css("padding");mirror.style.width=jQuery(this).css("width");mirror.style.fontFamily=jQuery(this).css("font-family");mirror.style.fontSize=jQuery(this).css("font-size");mirror.style.lineHeight=jQuery(this).css("line-height");this.style.overflow="hidden";this.style.minHeight=this.rows+"em";this.onkeydown=growTextarea;sendContentToMirror(this)})};
5
  /* wpDiscuz */
6
+ var wpdiscuzLoadRichEditor=parseInt(wpdiscuzAjaxObj.loadRichEditor);if(wpdiscuzLoadRichEditor&&document.querySelector(".wpdiscuz-textarea-wrap"))var wpDiscuzEditor=new WpdEditor;function wpdMessagesOnInit(a,b){wpdiscuzAjaxObj.setCommentMessage(a,b),setTimeout(function(){location.href=location.href.substring(0,location.href.indexOf("wpdiscuzUrlAnchor")-1)},3e3)}wpdiscuzAjaxObj.setCommentMessage=function(c,b,d){var a="wpdiscuz-message-error";if(c instanceof Array)for(var e in c)b instanceof Array?"success"===b[e]?a="wpdiscuz-message-success":"warning"===b[e]&&(a="wpdiscuz-message-warning"):"success"===b?a="wpdiscuz-message-success":"warning"===b&&(a="wpdiscuz-message-warning"),jQuery("<div/>").addClass(a).html(c[e]).prependTo("#wpdiscuz-comment-message").delay(d instanceof Array?d[e]:d||4e3).fadeOut(1e3,function(){jQuery(this).remove()});else"success"===b?a="wpdiscuz-message-success":"warning"===b&&(a="wpdiscuz-message-warning"),jQuery("<div/>").addClass(a).html(c).prependTo("#wpdiscuz-comment-message").delay(d||4e3).fadeOut(1e3,function(){jQuery(this).remove()})},wpdiscuzAjaxObj.applyFilterOnPhrase=function(a,b,c){return wpdiscuzAjaxObj.phraseFilters&&jQuery.each(wpdiscuzAjaxObj.phraseFilters,function(d){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[d]]&&(a=wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[d]](a,b,c))}),a},jQuery(document).ready(function($){$("body").addClass("wpdiscuz_"+wpdiscuzAjaxObj.version);var H,c=wpdiscuzAjaxObj.is_user_logged_in,q=1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!c,r=1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&c,e=wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion,s=parseInt(wpdiscuzAjaxObj.commentListLoadType),I=parseInt(wpdiscuzAjaxObj.wc_post_id);wpdiscuzAjaxObj.wpdiscuz_nonce="";var t=parseInt(wpdiscuzAjaxObj.commentListUpdateType),u=1e3*parseInt(wpdiscuzAjaxObj.commentListUpdateTimer),v=parseInt(wpdiscuzAjaxObj.liveUpdateGuests),w=wpdiscuzAjaxObj.loadLastCommentId,J=w,f=parseInt(wpdiscuzAjaxObj.firstLoadWithAjax);Cookies.get("wpdiscuz_comments_sorting")&&Cookies.remove("wpdiscuz_comments_sorting",{path:""}),Cookies.get("wordpress_last_visit")&&Cookies.remove("wordpress_last_visit",{path:""}),Cookies.get("wpdiscuz_last_visit")&&Cookies.remove("wpdiscuz_last_visit",{path:""});var i=parseInt(wpdiscuzAjaxObj.wordpressIsPaginate),K=wpdiscuzAjaxObj.storeCommenterData,L=parseInt(wpdiscuzAjaxObj.wmuEnabled),M=wpdiscuzAjaxObj.isCookiesEnabled,N=!0,g=wpdiscuzAjaxObj.cookiehash,O=parseInt(wpdiscuzAjaxObj.isLoadOnlyParentComments),P=parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0,x=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),j=parseInt(wpdiscuzAjaxObj.enableBubble),y=parseInt(wpdiscuzAjaxObj.bubbleLiveUpdate),k=parseInt(wpdiscuzAjaxObj.bubbleHintTimeout),Q=parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout)?parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout):5,R=parseInt(wpdiscuzAjaxObj.bubbleShowNewCommentMessage),h=wpdiscuzAjaxObj.bubbleLocation,l=wpdiscuzAjaxObj.inlineFeedbackAttractionType,m=parseInt(wpdiscuzAjaxObj.scrollSize),m=m||32,S=[],T=[],U=[],V=!1,z=1,W=$("html").css("scroll-behavior"),X=$("body").css("scroll-behavior");if($(".wc_social_plugin_wrapper .wp-social-login-provider-list").length?$(".wc_social_plugin_wrapper .wp-social-login-provider-list").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):$(".wc_social_plugin_wrapper .the_champ_login_container").length?$(".wc_social_plugin_wrapper .the_champ_login_container").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):$(".wc_social_plugin_wrapper .social_connect_form").length?$(".wc_social_plugin_wrapper .social_connect_form").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):$(".wc_social_plugin_wrapper .oneall_social_login_providers").length&&$(".wc_social_plugin_wrapper .oneall_social_login .oneall_social_login_providers").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"),wpdiscuzLoadRichEditor&&$("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0"),window.addEventListener("beforeunload",function(c){var b=$(".wpd-form").not(":hidden");if(b.length){if(wpdiscuzLoadRichEditor&&document.querySelector(".wpdiscuz-textarea-wrap")){for(var a=0;a<b.length;a++)if("\n"!==wpDiscuzEditor.createEditor($(b[a]).find(".ql-container").attr("id")).getText()){c.preventDefault(),c.returnValue="";return}}else for(var a=0;a<b.length;a++)if($(b[a]).find(".wc_comment").val()){c.preventDefault(),c.returnValue="";return}}}),wpdiscuzLoadRichEditor||($(document).delegate("textarea.wc_comment","input",function(){aD($(this))}),$.each($("textarea.wc_comment"),function(){aD($(this))})),$("body").on("focus","#wpdcom .ql-editor, #wpdcom .wc_comment",function(){$(".wpd-form-foot",$(this).parents(".wpd_comm_form")).slideDown(P)}),$("body").on("focus","#wpdcom textarea",function(){$(this).next(".autogrow-textarea-mirror").length||$(this).autoGrow()}),c||aa({comment_author:Cookies.get("comment_author_"+g),comment_author_email:Cookies.get("comment_author_email_"+g),comment_author_url:Cookies.get("comment_author_url_"+g)}),$(".wpd-vote-down.wpd-dislike-hidden").remove(),$(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd"),$("body").on("click","#wpd-editor-source-code-wrapper-bg",function(){$(this).hide(),$("#wpd-editor-source-code-wrapper").hide(),$("#wpd-editor-uid").val(""),$("#wpd-editor-source-code").val("")}),wpdiscuzLoadRichEditor&&$("body").on("click","#wpd-insert-source-code",function(){var a=wpDiscuzEditor.createEditor("#"+$("#wpd-editor-uid").val());a.deleteText(0,a.getLength(),Quill.sources.USER);var b=$("#wpd-editor-source-code").val();b.length&&a.clipboard.dangerouslyPasteHTML(0,b,Quill.sources.USER),a.update(),$("#wpd-editor-source-code-wrapper-bg").hide(),$("#wpd-editor-source-code-wrapper").hide(),$("#wpd-editor-uid").val(""),$("#wpd-editor-source-code").val("")}),$("body").on("click",".wpd-reply-button",function(){var a=aj($(this),0);$(this).hasClass("wpdiscuz-clonned")?(wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+a).focus()},P):setTimeout(function(){$("#wc-textarea-"+a).trigger("focus")},P),$("#wpd-secondary-form-wrapper-"+a).slideToggle(P)):ah($(this)),function(a){if((q||r)&&"2.0"===e){var b=ak(a);setTimeout(function(){if(!T[b])try{T[b]=grecaptcha.render("wpdiscuz-recaptcha-"+a,{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(b){$("#wpdiscuz-recaptcha-field-"+a).val("key")},"expired-callback":function(){$("#wpdiscuz-recaptcha-field-"+a).val("")}})}catch(c){console.log(c),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+c.message,"error")}},1e3)}}(a)}),$("body").on("click","#wpdcom [data-wpd-clipboard]",function(){var b=$(this).data("wpd-clipboard"),a=$("<input/>");a.appendTo("body").css({position:"absolute",top:"-10000000px"}).val(b),a.trigger("select"),document.execCommand("copy"),a.remove(),wpdiscuzAjaxObj.setCommentMessage(b+"<br/>"+wpdiscuzAjaxObj.wc_copied_to_clipboard,"success",5e3)}),$("body").on("click",".wpdiscuz-nofollow,.wc_captcha_refresh_img,.wpd-load-more-submit",function(a){a.preventDefault()}),$("body").on("click",".wpd-toggle.wpd_not_clicked",function(){var a=$(this);a.removeClass("wpd_not_clicked");var b=aj($(this),0),c=$(this),d=$(".fas",c);!c.parents(".wpd-comment:not(.wpd-reply)").children(".wpd-reply").length&&O?aw(b,a):$("#wpd-comm-"+b+"> .wpd-reply").slideToggle(700,function(){$(this).is(":hidden")?(d.removeClass("fa-chevron-up"),d.addClass("fa-chevron-down"),c.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_show_replies_text),c.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_show_replies_text)):(d.removeClass("fa-chevron-down"),d.addClass("fa-chevron-up"),c.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),c.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text)),a.addClass("wpd_not_clicked")})}),$("body").on("mouseenter",".wpd-new-loaded-comment",function(){$(this).removeClass("wpd-new-loaded-comment")}),$("body").on("click",".wpd-sbs-toggle",function(){$(".wpdiscuz-subscribe-bar").slideToggle(P)}),parseInt(wpdiscuzAjaxObj.wpDiscuzIsShowOnSubscribeForm)&&!c&&wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&$("#wpdiscuz-subscribe-form").length&&("2.0"===e?(setTimeout(function(){try{grecaptcha.render("wpdiscuz-recaptcha-subscribe-form",{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(a){$("#wpdiscuz-recaptcha-field-subscribe-form").val("key")},"expired-callback":function(){$("#wpdiscuz-recaptcha-field-subscribe-form").val("")}})}catch(a){console.log(a),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+a.message,"error")}},1e3),$("body").on("submit","#wpdiscuz-subscribe-form",function(a){$("#wpdiscuz-recaptcha-field-subscribe-form").val()?$(".wpdiscuz-recaptcha",$(this)).css("border","none"):($(".wpdiscuz-recaptcha",$(this)).css("border","1px solid red"),a.preventDefault())})):"3.0"===e&&$("body").on("click","#wpdiscuz_subscription_button",function(b){var c=$(this).parents("#wpdiscuz-subscribe-form");b.preventDefault();try{grecaptcha.ready(function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/wpdAddSubscription"}).then(function(a){console.log(5555),document.getElementById("wpdiscuz-recaptcha-field-subscribe-form").value=a,c.trigger("submit")},function(a){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(a)})})}catch(a){console.log(a),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+a.message,"error")}})),(q||r)&&"2.0"===e){var A=$(window).width(),a=$("#wpdcom").width();a>=1100&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"65%"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"35%"})),a>=940&&a<1100&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"60%"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"40%"})),a>=810&&a<940&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"40%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"60%"})),a>=730&&a<810&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"45%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"55%"})),a>=610&&a<730&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.85)","-webkit-transform":"scale(0.85)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"43%"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"55%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"30%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"70%"})),A>650&&(a>=510&&a<610&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"center 0","-webkit-transform-origin":"center 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"35%"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"63%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"30%",position:"relative",right:"-60px"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"70%"}),$("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"})),a>=470&&a<510&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"center 0","-webkit-transform-origin":"center 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"40%"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"60%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({float:"none",width:"100%",display:"block"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({float:"none",width:"100%",display:"block"}),$("#wpdcom .wpd_main_comm_form .wc-form-footer").css({"margin-left":"0px"}),$("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"})),a<470&&($("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({margin:"0px auto","transform-origin":"center 0","-webkit-transform-origin":"center 0"}),$("#wpdcom .wpd-form-col-left").css({float:"none",width:"100%",display:"block"}),$("#wpdcom .wpd-form-col-right").css({float:"none",width:"100%",display:"block"}),$("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"}),$("#wpdcom .wpd-secondary-form-wrapper .wc_notification_checkboxes").css({"text-align":"center"}),$("#wpdcom .wpd-secondary-form-wrapper .wc-field-submit").css({"text-align":"center"})))}function Y(b,a,c){G(x||L,!1,a).done(function(a){if($(c).addClass("wpd_not_clicked"),"object"==typeof a){if(a.success){"collapsed"===wpdiscuzAjaxObj.commentFormView&&$(".wpd-form-foot",b).slideUp(P),a.data.wc_all_comments_count_new=parseInt(a.data.wc_all_comments_count_new),$(".wpd-thread-info").html(a.data.wc_all_comments_count_before_threads_html),$(".wpd-thread-info").attr("data-comments-count",a.data.wc_all_comments_count_new),$("#wpd-bubble-all-comments-count").replaceWith(a.data.wc_all_comments_count_bubble_html);var d=P;a.data.is_main?az(a.data.message):(d=P+700,$("#wpd-secondary-form-wrapper-"+a.data.uniqueid).slideToggle(700),1==a.data.is_in_same_container?$("#wpd-secondary-form-wrapper-"+a.data.uniqueid).after(a.data.message):$("#wpd-comm-"+a.data.uniqueid).after(a.data.message)),Z(a),_(a),M&&N?ab(a.data):N||$(".wpd-cookies-checkbox").prop("checked",!1),b.get(0).reset(),wpdiscuzLoadRichEditor?wpDiscuzEditor.createEditor("#wpd-editor-"+$(".wpdiscuz_unique_id",b).val()).setContents([{insert:"\n"}]):aD(b.find(".wc_comment")),aa(a.data),$(".wmu-preview-wrap",b).remove(),ay(),parseInt(wpdiscuzAjaxObj.scrollToComment)&&setTimeout(function(){au(),$("html, body").animate({scrollTop:$("#comment-"+a.data.new_comment_id).offset().top-m},1e3,av)},d),aE(a,b)}else a.data&&(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,b),"error"),aE(a,b))}else wpdiscuzAjaxObj.setCommentMessage(a,"error");$("#wpdiscuz-loading-bar").fadeOut(250),V=!1}).fail(function(b,d,a){console.log(a),$(c).addClass("wpd_not_clicked"),$("#wpdiscuz-loading-bar").fadeOut(250)})}function Z(b){if(!b.data.held_moderate){var a=new FormData;a.append("action","wpdCheckNotificationType"),a.append("comment_id",b.data.new_comment_id),a.append("email",b.data.comment_author_email),a.append("isParent",b.data.is_main),G(x,!0,a)}}function _(a){if(a.data.redirect>0&&a.data.new_comment_id){var b=new FormData;b.append("action","wpdRedirect"),b.append("commentId",a.data.new_comment_id),G(x,!0,b).done(function(a){"object"==typeof a&&a.success&&setTimeout(function(){location.href=a.data},2e3)}).fail(function(b,c,a){console.log(a)})}}function aa(a){$(".wpd_comm_form .wc_name").val(a.comment_author),a.comment_author_email&&0>a.comment_author_email.indexOf("@example.com")&&$(".wpd_comm_form .wc_email").val(a.comment_author_email),a.comment_author_url&&$(".wpd_comm_form .wc_website").val(a.comment_author_url)}function ab(b){var c=b.comment_author_email,d=b.comment_author,a=b.comment_author_url;null==K?(Cookies.set("comment_author_email_"+g,c),Cookies.set("comment_author_"+g,d),a.length&&Cookies.set("comment_author_url_"+g,a)):(K=parseInt(K),Cookies.set("comment_author_email_"+g,c,{expires:K,path:"/"}),Cookies.set("comment_author_"+g,d,{expires:K,path:"/"}),a.length&&Cookies.set("comment_author_url_"+g,a,{expires:K,path:"/"})),$(".wpd-cookies-checkbox").length&&$(".wpd-cookies-checkbox").prop("checked",!0)}function ac(a,b){$("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").show(),$("#wpd-comm-"+a+" .wpdiscuz-edit-form-wrap").replaceWith(b),$("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-last-edited").show()}$("body").on("click",".wc_comm_submit.wpd_not_clicked",function(){var d=$(this),f=1,a=$(this).parents("form");if("true"===a.attr("data-uploading")){wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhraseDoingUpload,"wmuPhraseDoingUpload",a),"warning");return}if(a.hasClass("wpd_main_comm_form")||(f=an($(this).parents(".wpd-comment"))),as(a,"#wpd-editor-"+$(".wpdiscuz_unique_id",a).val()),a.on("submit",function(a){a.preventDefault()}),""===$(".wc_comment",a).val().trim()){wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wc_msg_required_fields,"wc_msg_required_fields",a),"error");return}if(a[0].checkValidity()&&(h=a,i=!0,"2.0"===e&&$("input[name=wc_captcha]",h).length&&!$("input[name=wc_captcha]",h).val().length?(i=!1,$(".wpdiscuz-recaptcha",h).css("border","1px solid red")):"2.0"===e&&$("input[name=wc_captcha]",h).length&&$(".wpdiscuz-recaptcha",h).css("border","none"),i)){V=!0,ax(a),$(d).removeClass("wpd_not_clicked");var h,i,b=new FormData;if(b.append("action","wpdAddComment"),$(":input",a).each(function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&b.append(this.name+"",$(this).val().trim()),("checkbox"==this.type||"radio"==this.type)&&$(this).is(":checked")&&b.append(this.name+"",$(this).val())}),b.append("wpd_comment_depth",f),wpdiscuzAjaxObj.wpdiscuz_zs&&b.append("wpdiscuz_zs",wpdiscuzAjaxObj.wpdiscuz_zs),$(".wpd-cookies-checkbox",a).length?$(".wpd-cookies-checkbox",a).prop("checked")||(N=!1):c&&(N=!1),$("#wpdiscuz-loading-bar").show(),wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&"3.0"===e&&(1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!wpdiscuzAjaxObj.is_user_logged_in||1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&wpdiscuzAjaxObj.is_user_logged_in))try{grecaptcha.ready(function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/addComment"}).then(function(c){b.append("g-recaptcha-response",c),Y(a,b,d)},function(a){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(a)})})}catch(g){console.log(g),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+g.message,"error"),$("#wpdiscuz-loading-bar").fadeOut(250)}else Y(a,b,d)}(function(a){if((q||r)&&"2.0"===e){var b=ak(a);grecaptcha.reset(T[b])}})($(".wpdiscuz_unique_id",a).val()),ar()}),$("body").on("click",".wpd_editable_comment",function(){H&&$(".wpdiscuz-edit-form-wrap").length&&ac(aj($(".wpdiscuz-edit-form-wrap"),0),H);var c=$(this),b=aj(c,0),d=ak(b),a=new FormData;a.append("action","wpdEditComment"),a.append("commentId",d),H=$("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-text").get(0),G(x,!0,a).done(function(a){if("object"==typeof a){if(a.success){if($("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text").replaceWith(a.data.html),wpdiscuzLoadRichEditor){var d=wpDiscuzEditor.createEditor("#wpd-editor-edit_"+b);d.clipboard.dangerouslyPasteHTML(0,a.data.content),d.update(),$(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd")}else $("#wc-textarea-edit_"+b).val(a.data.content),aD($("#wc-textarea-edit_"+b));$("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").hide(),$("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-last-edited").hide()}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,c),"error")}else console.log(a);$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("click",".wc_save_edited_comment",function(){var d=$(this),b=aj(d),e=ak(b),a=$("#wpd-comm-"+b+" #wpdiscuz-edit-form");if(as(a,"#wpd-editor-edit_"+b),a.on("submit",function(a){a.preventDefault()}),a[0].checkValidity()){var c=new FormData;c.append("action","wpdSaveEditedComment"),c.append("commentId",e),$(":input",a).each(function(){""!==this.name&&"checkbox"!==this.type&&"radio"!==this.type&&c.append(this.name+"",$(this).val()),("checkbox"===this.type||"radio"===this.type)&&$(this).is(":checked")&&c.append(this.name+"",$(this).val())}),G(x,!0,c).done(function(a){"object"==typeof a?(a.success?(ac(b,a.data.message),a.data.lastEdited&&($("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-last-edited").remove(),$(a.data.lastEdited).insertAfter("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text")),a.data.twitterShareLink&&$("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_tw").attr("href",a.data.twitterShareLink),a.data.whatsappShareLink&&$("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_whatsapp").attr("href",a.data.whatsappShareLink),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+b)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,d),"error"),aE(a,e)):console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}}),$("body").on("click",".wc_cancel_edit",function(){var a=aj($(this));ac(a,H),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+a)}),!i&&f&&(z=0,1==f?setTimeout(function(){ae(!0)},500):$("body").on("click",".wpd-load-comments",function(){$(this).parent(".wpd-load-more-submit-wrap").remove(),ae(!0)})),$("body").on("click",".wpd-load-more-submit",function(){var a=$(this),b="wpd-loaded";a.hasClass(b)&&ae(!1,a,b,"wpd-loading")});var ad=!1;function B(){var a=document.getElementById("wpdiscuzHasMoreComments"),b=0;a&&(b=a.dataset.is_show_load_more);var c=document.getElementById("wpdcom")?document.getElementById("wpdcom").clientHeight:0,d=$(window).height()+$(window).scrollTop();c&&d&&100*d/c>=80&& !1===ad&&1==b&&(ad=!0,ae(!1,$(".wpd-load-more-submit")))}function ae(c,b,e,g){b&&(b.toggleClass(e),b.toggleClass(g));var a=new FormData;a.append("action","wpdLoadMoreComments");var d=$(".wpdiscuz-sort-button-active").attr("data-sorting");d&&a.append("sorting",d),a.append("offset",z),a.append("lastParentId",al()),a.append("isFirstLoad",c?1:0);var h=$(".wpdf-active").attr("data-filter-type");a.append("wpdType",h||""),G(x,!c||1!=f,a).done(function(a){"object"==typeof a&&a.success&&(z++,c&&$(".wpd-comment").remove(),$(".wpdiscuz_single").remove(),$(".wpdiscuz-comment-pagination").before(a.data.comment_list),C(a,c&&2!==s),ad=!1,a.data.loadLastCommentId&&(w=a.data.loadLastCommentId),aE(a),c&&D(!1)),$("#wpdiscuz-loading-bar").fadeOut(250),$(".wpd-load-more-submit").blur(),b&&(b.toggleClass(e),b.toggleClass(g))}).fail(function(c,d,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250),$(".wpd-load-more-submit").blur(),b&&(b.toggleClass(e),b.toggleClass(g))})}function C(a,d){var b=document.getElementById("wpdiscuzHasMoreComments");if(!1==a.data.is_show_load_more)b&&(b.dataset.is_show_load_more=0),$(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide();else if(am(a.data.last_parent_id),b&&(b.dataset.is_show_load_more=1),d&&$(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").show(),a.data.comments_left>0){if(!$(".wpd-load-more-submit .wpd-comments-left").length){let c=$("<span>");c.addClass("wpd-comments-left"),$(".wpd-load-more-submit").append(c)}$(".wpd-load-more-submit .wpd-comments-left").text(a.data.comments_left_text)}aE(a)}function D(d){var b=location.href.match(/#comment\-(\d+)/);if(null!==b){var c=b[1];if($("#comment-"+c).length)setTimeout(function(){au(),$("html, body").animate({scrollTop:$("#comment-"+c).parents("[id^=wpd-comm-]").offset().top-m},1e3,av),d&&af(c)},500);else{var a=new FormData;a.append("action","wpdGetSingleComment"),a.append("commentId",c),G(x,!0,a).done(function(a){if("object"==typeof a&&a.success){var b="#comment-"+c;$("#comment-"+a.data.parentCommentID).length?$("#comment-"+a.data.parentCommentID).parents("[id^=wpd-comm-"+a.data.parentCommentID+"]").replaceWith(a.data.message):$(".wpd-thread-list").prepend(a.data.message),aE(a),au(),$("html, body").animate({scrollTop:$(b).offset().top-m},1e3,av),d&&af(c)}$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}}}function af(a){setTimeout(function(){$("#comment-"+a).siblings(".wpd-secondary-form-wrapper").is(":visible")||$("#comment-"+a).find(".wpd-reply-button").trigger("click")},1100)}function ag(b){if(void 0!==b.data.message)for(var c,d=b.data.message,a=0;a<d.length;a++)ap((c=d[a]).comment_parent,c.comment_html)}function ah(b){var a=aj(b,0);$("#wpdiscuz_form_anchor-"+a).before(ai(a));var d=$("#wpd-secondary-form-wrapper-"+a);c||aa({comment_author:Cookies.get("comment_author_"+g),comment_author_email:Cookies.get("comment_author_email_"+g),comment_author_url:Cookies.get("comment_author_url_"+g)}),wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+a).focus()},P):setTimeout(function(){$("#wc-textarea-"+a).trigger("focus")},P),d.slideToggle(P,function(){b.addClass("wpdiscuz-clonned")})}function ai(a){return $("#wpdiscuz_hidden_secondary_form").html().replace(/wpdiscuzuniqueid/g,a)}function aj(a,c){var b="";return(b=c?a.parents(".wpd-main-form-wrapper").attr("id"):a.parents(".wpd-comment").attr("id")).substring(b.lastIndexOf("-")+1)}function ak(a){return a.substring(0,a.indexOf("_"))}function al(){return $(".wpd-load-more-submit").attr("data-lastparentid")}function am(a){$(".wpd-load-more-submit").attr("data-lastparentid",a),2!==s&&$(".wpdiscuz-comment-pagination").show()}function an(a){var b=a.attr("class").split(" "),c="";return $.each(b,function(b,a){"wpd_comment_level"===ao(a,!1)&&(c=ao(a,!0))}),parseInt(c)+1}function ao(a,b){return b?a.substring(a.indexOf("-")+1):a.substring(0,a.indexOf("-"))}function ap(a,b){if(0==a)az(b);else{var c=aj($("#comment-"+a),0);$("#wpdiscuz_form_anchor-"+c).after(b)}}function aq(){var a=[];return $(".wpd-comment-right").each(function(){a.push(ak(aj($(this),0)))}),a.join(",")}function ar(){$(".wpdiscuz_reset").val("")}function as(a,b){var c=a.find(".wpd-required-group");wpdiscuzLoadRichEditor&&a.find(".wc_comment").val($(b+">.ql-editor").html()),at(a),$.each(c,function(){$("input",this).prop("required",!1),0===$("input:checked",this).length?$("input",$(this)).prop("required",!0):$(".wpd-field-invalid",this).remove()})}function at(c){var b=c.find(".wc_comment"),a=b.val().trim().replace(/<p><br><\/p>/g,"\n").replace(/<p>(.*?)<\/p>/g,"$1\n");a=(a=(a=(a=a.replace(/<img src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img[^>]+alt=["|']([^"|']+)["|'][^>]+src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'][^>]?>/g," $1 ")).replace(/<img\s+([^>]*)class=["|']wpdem\-sticker["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img\s+([^>]*)src=["|']([^"|']+)["|'](.*?)[^>]*>/g," $2 "),b.val(a)}function au(){$("html, body").css("scroll-behavior","unset")}function av(){$("html").css("scroll-behavior",W),$("body").css("scroll-behavior",X)}function aw(b,d){var c=ak(b),a=new FormData;a.append("action","wpdShowReplies"),a.append("commentId",c),G(x,!0,a).done(function(a){d.addClass("wpd_not_clicked"),"object"==typeof a&&a.success&&($("#wpd-comm-"+b).replaceWith(a.data.comment_list),$("#wpd-comm-"+b+" .wpd-toggle .fas").removeClass("fa-chevron-down").addClass("fa-chevron-up"),$("#wpd-comm-"+b+" .wpd-toggle .wpd-view-replies .wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),$("#wpd-comm-"+b+" .wpd-toggle").attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text),aE(a)),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),d.addClass("wpd_not_clicked"),$("#wpdiscuz-loading-bar").fadeOut(250)})}function ax(a){$(".wpd-agreement-checkbox",a).each(function(){$(this).hasClass("wpd_agreement_hide")&&M&&$(this).prop("checked")&&(Cookies.set($(this).attr("name")+"_"+g,1,{expires:30,path:"/"}),$("input[name="+$(this).attr("name")+"]").each(function(){S.push($(this))}))})}function ay(){S.length&&(S.forEach(function(a){a.parents(".wpd-field-checkbox").remove()}),S=[])}function az(a){$(".wpd-sticky-comment").last()[0]?$(a).insertAfter($(".wpd-sticky-comment").last()[0]):$(".wpd-thread-list").prepend(a)}function E(a){a?a.prop("required")||(a.val()?a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none")):$.each($(".wc_email"),function(c,b){var a=$(b);a.prop("required")||(a.val()?a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none"))})}if(2!==s||i||($(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide(),B(),$(window).scroll(function(){B()})),wpdiscuzAjaxObj.setLoadMoreVisibility=C,$("body").on("click",".wpd-vote-up.wpd_not_clicked, .wpd-vote-down.wpd_not_clicked",function(){var b,c=$(this);$(c).removeClass("wpd_not_clicked");var d=aj(c),e=ak(d);b=$(this).hasClass("wpd-vote-up")?1:-1;var a=new FormData;a.append("action","wpdVoteOnComment"),a.append("commentId",e),a.append("voteType",b),G(x,!0,a).done(function(a){if($(c).addClass("wpd_not_clicked"),"object"==typeof a){if(a.success){if("total"===a.data.buttonsStyle){var d=$(".wpd-comment-footer .wpd-vote-result",$("#comment-"+e)),h=a.data.votes;d.text(a.data.votesHumanReadable),d.attr("title",h),d.removeClass("wpd-up wpd-down"),h>0&&d.addClass("wpd-up"),h<0&&d.addClass("wpd-down")}else{var f=$(".wpd-comment-footer .wpd-vote-result-like",$("#comment-"+e)),g=$(".wpd-comment-footer .wpd-vote-result-dislike",$("#comment-"+e));f.text(a.data.likeCountHumanReadable),f.attr("title",a.data.likeCount),g.text(a.data.dislikeCountHumanReadable),g.attr("title",a.data.dislikeCount),parseInt(a.data.likeCount)>0?f.addClass("wpd-up"):f.removeClass("wpd-up"),0>parseInt(a.data.dislikeCount)?g.addClass("wpd-down"):g.removeClass("wpd-down")}var i=$(".wpd-comment-footer .wpd-vote-up",$("#comment-"+e)),j=$(".wpd-comment-footer .wpd-vote-down",$("#comment-"+e));i.removeClass("wpd-up"),j.removeClass("wpd-down"),a.data.curUserReaction>0?i.addClass("wpd-up"):a.data.curUserReaction<0&&j.addClass("wpd-down")}else a.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,c),"error");aE(a,e,b)}else console.log(a);$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,d,a){console.log(a),$(c).addClass("wpd_not_clicked"),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$(document).on("click","body",function(b){var a=$(".wpdiscuz-sort-buttons");$(b.target).hasClass("wpdf-sorting")||$(b.target).parent().hasClass("wpdf-sorting")?a.css({display:a.is(":visible")?"none":"flex"}):a.hide()}),$("body").on("click",".wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)",function(){var c=$(this),b=$(this).attr("data-sorting");if(b){$(".wpdiscuz-sort-button.wpdiscuz-sort-button-active").removeClass("wpdiscuz-sort-button-active").appendTo(".wpdiscuz-sort-buttons"),c.addClass("wpdiscuz-sort-button-active").prependTo(".wpdf-sorting");var a=new FormData;a.append("action","wpdSorting"),a.append("sorting",b);var d=$(".wpdf-active").attr("data-filter-type");a.append("wpdType",d||""),G(x,!0,a).done(function(a){"object"==typeof a&&a.success&&($("#wpdcom .wpd-comment").remove(),$("#wpdcom .wpd-thread-list").prepend(a.data.message),C(a,!1),z=1),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}}),window.onhashchange=function(){D(!1)},1!=f&&D(!1),$("body").on("click",".wpdiscuz-readmore",function(){var b=aj($(this)),c=ak(b),a=new FormData;a.append("action","wpdReadMore"),a.append("commentId",c),G(x,!0,a).done(function(a){"object"==typeof a?(a.success?($("#comment-"+c+" .wpd-comment-text").replaceWith(" "+a.data.message),$("#wpdiscuz-readmore-"+b).remove()):console.log(a.data),aE(a)):console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("change",".wpd-required-group",function(){0!==$("input:checked",this).length?$("input",$(this)).prop("required",!1):$("input",$(this)).prop("required",!0)}),$("body").on("click",".wpdiscuz-spoiler",function(){$(this).next().slideToggle(),$(this).hasClass("wpdiscuz-spoiler-closed")?$(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-plus").removeClass("fa-plus").addClass("fa-minus"):$(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-minus").removeClass("fa-minus").addClass("fa-plus"),$(this).toggleClass("wpdiscuz-spoiler-closed")}),$("body").on("click",".wpd-tools i",function(){var a=$(this).siblings(".wpd-tools-actions");a.is(":visible")||$(this).parents(".wpd-comment-right").attr("id")!==$("[id^=comment-]","#wpdcom").last().attr("id")||$("#comments").css({paddingBottom:"160px"}),a.css({display:a.is(":visible")?"none":"flex"})}),$("body").on("mouseleave",".wpd-comment-right",function(){$(this).find(".wpd-tools-actions").hide(),$("#comments").css({paddingBottom:"0"})}),$("body").on("click",".wpd_stick_btn",function(){var b=aj($(this),0),c=ak(b),a=new FormData;a.append("action","wpdStickComment"),a.append("commentId",c),G(x,!0,a).done(function(a){"object"==typeof a&&a.success&&location.reload(!0),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("click",".wpd_close_btn",function(){var b=aj($(this),0),c=ak(b),a=new FormData;a.append("action","wpdCloseThread"),a.append("commentId",c),G(x,!0,a).done(function(a){"object"==typeof a&&a.success&&location.reload(!0),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("click",".wpd-filter.wpd_not_clicked[data-filter-type]",function(){var b=$(this),c=b.attr("data-filter-type");wpdiscuzAjaxObj.resetActiveFilters(".wpdf-"+c),b.removeClass("wpd_not_clicked"),$(".fas",b).addClass("fa-pulse fa-spinner");var a=new FormData;a.append("action","wpdLoadMoreComments");var d=$(".wpdiscuz-sort-button-active").attr("data-sorting");d&&a.append("sorting",d),a.append("lastParentId",0),a.append("offset",0),z=1,a.append("wpdType",b.hasClass("wpdf-active")?"":c),a.append("isFirstLoad",1),$(this).hasClass("wpdf-inline")?$(this).hasClass("wpdf-active")?$(".wpd-comment-info-bar").hide():$(".wpd-comment-info-bar").css("display","flex"):$(".wpd-comment-info-bar").hide(),G(x,!1,a).done(function(a){b.addClass("wpd_not_clicked"),$(".fas",b).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(b.toggleClass("wpdf-active"),$(".wpd-load-comments").remove(),$(".wpd-comment").remove(),$(".wpd-thread-list").prepend(a.data.comment_list),C(a),w=a.data.loadLastCommentId,$(".wpd-load-more-submit").blur(),aE(a)),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("click",".wpdf-reacted.wpd_not_clicked",function(){var a=$(this);a.removeClass("wpd_not_clicked"),$(".fas",a).addClass("fa-pulse fa-spinner");var b=new FormData;b.append("action","wpdMostReactedComment"),G(x,!1,b).done(function(b){a.addClass("wpd_not_clicked"),$(".fas",a).removeClass("fa-pulse fa-spinner"),"object"==typeof b&&b.success&&($("#comment-"+b.data.parentCommentID).length?$("#comment-"+b.data.parentCommentID).parents("[id^=wpd-comm-"+b.data.parentCommentID+"]").replaceWith(b.data.message):$("#comment-"+b.data.commentId).length||$(".wpd-thread-list").prepend(b.data.message),aE(b),au(),$("html, body").animate({scrollTop:$("#comment-"+b.data.commentId).offset().top-m},1e3,av))}).fail(function(c,d,b){console.log(b),$(".fas",a).removeClass("fa-pulse fa-spinner")})}),$("body").on("click",".wpdf-hottest.wpd_not_clicked",function(){var a=$(this);a.removeClass("wpd_not_clicked"),$(".fas",a).addClass("fa-pulse fa-spinner");var b=new FormData;b.append("action","wpdHottestThread"),G(x,!1,b).done(function(b){a.addClass("wpd_not_clicked"),$(".fas",a).removeClass("fa-pulse fa-spinner"),"object"==typeof b&&b.success&&($("#comment-"+b.data.commentId).length?$("#comment-"+b.data.commentId).parents("[id^=wpd-comm-"+b.data.commentId+"]").replaceWith(b.data.message):$(".wpd-thread-list").prepend(b.data.message),aE(b),au(),$("html, body").animate({scrollTop:$("#comment-"+b.data.commentId).offset().top-m},1e3,av))}).fail(function(c,d,b){console.log(b),$(".fas",a).removeClass("fa-pulse fa-spinner")})}),$("body").on("click",".wpd-filter-view-all",function(){$(".wpdf-inline.wpdf-active.wpd_not_clicked").trigger("click")}),$("body").on("click",".wpd-follow-link.wpd_not_clicked",function(){var a=$(this);a.removeClass("wpd_not_clicked"),$(".fas",a).addClass("fa-pulse fa-spinner");var c=aj(a,0),d=ak(c),b=new FormData;b.append("action","wpdFollowUser"),b.append("commentId",d),G(x,!0,b).done(function(b){a.addClass("wpd_not_clicked"),"object"==typeof b?b.success?(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[b.data.code],b.data.code,a),"success"),a.removeClass("wpd-follow-active"),b.data.followTip&&a.attr("wpd-tooltip",b.data.followTip),b.data.followClass&&a.addClass(b.data.followClass),aE(b)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[b.data],b.data,a),"error"):console.log(b),$(".fas",a).removeClass("fa-pulse fa-spinner"),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(c,d,b){console.log(b),$(".fas",a).removeClass("fa-pulse fa-spinner"),$("#wpdiscuz-loading-bar").fadeOut(250)})}),E(),$("body").on("keyup",".wc_email",function(){E($(this))}),j&&$("#wpdcom").length){if($("#wpd-bubble-wrapper").hover(function(){$(this).addClass("wpd-bubble-hover")},function(){$(this).removeClass("wpd-bubble-hover")}),k&&!Cookies.get(wpdiscuzAjaxObj.cookieHideBubbleHint)&&setTimeout(function(){$("#wpd-bubble-wrapper").addClass("wpd-bubble-hover"),Cookies.set(wpdiscuzAjaxObj.cookieHideBubbleHint,"1",{expires:7,path:"/"}),setTimeout(function(){$("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")},1e3*Q)},1e3*k),"content_left"===h){if($(".entry-content").length){var b=Math.min($(".entry-content").offset().left,$("#wpdcom").offset().left)-120,d=b>25?b:25;$("#wpd-bubble-wrapper").css({left:d+"px"}),$("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if($(".post-entry").length){var b=Math.min($(".post-entry").offset().left,$("#wpdcom").offset().left)-120,d=b>25?b:25;$("#wpd-bubble-wrapper").css({left:d+"px"}),$("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if($(".container").length){var b=Math.min($(".container").offset().left,$("#wpdcom").offset().left)-120,d=b>25?b:25;$("#wpd-bubble-wrapper").css({left:d+"px"}),$("#wpd-bubble-wrapper").addClass("wpd-left-content")}else $("#wpd-bubble-wrapper").css({left:"25px"}),$("#wpd-bubble-wrapper").addClass("wpd-left-corner")}else"left_corner"===h?($("#wpd-bubble-wrapper").css({left:"25px"}),$("#wpd-bubble-wrapper").addClass("wpd-left-corner")):"right_corner"===h&&($("#wpd-bubble-wrapper").css({right:"25px"}),$("#wpd-bubble-wrapper").addClass("wpd-right-corner"));$("#wpd-bubble-wrapper").show(),$("body").on("click","#wpd-bubble-add-message-close",function(a){a.preventDefault(),a.stopPropagation(),$("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")}),$("body").on("click","#wpd-bubble",function(){au(),$("#tab-title-reviews").length&&$("#tab-title-reviews a").trigger("click"),$("html, body").animate({scrollTop:$("#wpdcom").offset().top-(m+28)},1e3,function(){av(),$("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover"),wpdiscuzLoadRichEditor?$("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0").focus():$("#wc-textarea-0_0").length&&$("#wc-textarea-0_0").trigger("focus")})}),$("body").on("click","#wpd-bubble-comment-close",function(a){a.preventDefault(),$("#wpd-bubble-notification-message").hide(),$("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")}),$("body").on("click","#wpd-bubble-comment-reply-link a",function(){var a=$(this).attr("href");setTimeout(function(){$("#wpd-bubble-notification-message").hide(),$("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),D(!0);var b=a.match(/#comment\-(\d+)/);U=U.filter(function(a){return a!=b[1]}),$("#wpd-bubble-count .wpd-new-comments-count").text(U.length),0==U.length&&$("#wpd-bubble-count").removeClass("wpd-new-comments")},100)}),$("body").on("click","#wpd-bubble-count",function(){if(U.length){var a=new FormData;a.append("action","wpdBubbleUpdate"),a.append("newCommentIds",U.join()),G(x,!0,a).done(function(a){"object"==typeof a&&a.success&&(a.data.message=a.data.message.filter(function(a){if(!$("#comment-"+a.comment_id).length)return a}),ag(a),$("#wpd-bubble-count").removeClass("wpd-new-comments"),$("#wpd-bubble-count .wpd-new-comments-count").text("0"),U=[],$(".wpd-new-loaded-comment").length&&(au(),$("html, body").animate({scrollTop:$($(".wpd-new-loaded-comment")[0]).offset().top-(m+28)},1e3,av)),aE(a)),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a)})}})}function F(){$.ajax({type:"GET",url:wpdiscuzAjaxObj.bubbleUpdateUrl,beforeSend:function(a){a.setRequestHeader("X-WP-Nonce",wpdiscuzAjaxObj.restNonce)},data:{postId:I,lastId:J,visibleCommentIds:aq()}}).done(function(a){if(!V){if("object"==typeof a){if(a.commentIDsToRemove.forEach(function(a){$("[id^=wpd-comm-"+a+"]").remove()}),a.ids.length){if(t){var b;(b=new FormData).append("action","wpdUpdateAutomatically"),b.append("loadLastCommentId",w),b.append("visibleCommentIds",aq()),G(x,!1,b).done(function(a){!V&&"object"==typeof a&&a.success&&(ag(a),a.data.wc_all_comments_count_new=parseInt(a.data.wc_all_comments_count_new),$(".wpd-thread-info").html(a.data.wc_all_comments_count_before_threads_html),$(".wpd-thread-info").attr("data-comments-count",a.data.wc_all_comments_count_new),$("#wpd-bubble-all-comments-count").replaceWith(a.data.wc_all_comments_count_bubble_html),w=a.data.loadLastCommentId)}).fail(function(b,c,a){console.log(a)})}a.ids=a.ids.filter(function(a){if(!$("#comment-"+a).length)return a});var c=5e3;J=parseInt(a.ids[a.ids.length-1]),U=U.concat(a.ids),R&&a.commentText&&($("#wpd-bubble-author-avatar").html(a.avatar),$("#wpd-bubble-author-name").html(a.authorName),$("#wpd-bubble-comment-date span").html(a.commentDate),$("#wpd-bubble-comment-text").html(a.commentText),$("#wpd-bubble-comment-reply-link a").attr("href",a.commentLink),$("#wpd-bubble-notification-message").show(),c=1e4);var d=parseInt($(".wpd-new-comments-count").text());d+=a.ids.length,$("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),$("#wpd-bubble-wrapper").addClass("wpd-new-comment-added"),setTimeout(function(){$("#wpd-bubble-notification-message").hide(),$("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")},c),$(".wpd-new-comments-count").text(d),$("#wpd-bubble-count").addClass("wpd-new-comments")}a.all_comments_count=parseInt(a.all_comments_count),$("#wpd-bubble-all-comments-count").replaceWith(a.all_comments_count_bubble_html),$(".wpd-reviews-tab").length||($(".wpd-thread-info").html(a.all_comments_count_before_threads_html),$(".wpd-thread-info").attr("data-comments-count",a.all_comments_count))}else console.log(a)}setTimeout(F,u)}).fail(function(b,c,a){console.log(a),setTimeout(F,u)})}if((j&&y||t)&&(c|| !c&&v)&&setTimeout(F,u),$(".wpd-inline-form-wrapper").length){var n=new FormData;n.append("action","wpdGetInlineCommentForm"),G(x,!1,n).done(function(a){"object"==typeof a?a.success?($(".wpd-inline-form-wrapper").append(a.data),$.each($("[name=_wpd_inline_nonce]"),function(){var b=$(this).attr("id"),a=$(this).parents(".wpd-inline-shortcode").attr("id");$(this).attr("id",b+"-"+a.substring(a.lastIndexOf("-")+1))}),$(".wpd-inline-opened").addClass("wpd-active"),$(".wpd-inline-opened").find(".wpd-inline-form-wrapper").show(),$(".wpd-inline-opened").find(".wpd-inline-icon").addClass("wpd-open"),$(".wpd-inline-opened").find(".wpd-inline-icon").removeClass("wpd-ignored"),aC()):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data]),a.data,"error"):console.log(a)}).fail(function(b,c,a){console.log(a)})}function aA(a){if($(a).hasClass("wpd-inline-shortcode"))var b=$(a).attr("id");else var b=$(a).parents(".wpd-inline-shortcode").attr("id");return b.substring(b.lastIndexOf("-")+1)}function aB(){$(".wpd-inline-form-wrapper").hide(),$(".wpd-inline-shortcode").removeClass("wpd-active"),$(".wpd-inline-icon").removeClass("wpd-open")}function o(){$.each($(".wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon"),function(){var a=$(this),b=a.offset().top-window.pageYOffset;a.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&b>0&&b<300&&("blink"===l?(a.addClass("wpd-blink"),setTimeout(function(){a.removeClass("wpd-blink")},3e3)):(a.parents(".wpd-inline-shortcode").addClass("wpd-active"),a.siblings(".wpd-inline-form-wrapper").show(),a.addClass("wpd-open"),aC(a.siblings(".wpd-inline-form-wrapper"))))})}function aC(a){if(a){if(a.offset().left<=10){a.css("left",Math.ceil(parseInt(a.css("left"))-a.offset().left+10));var b=Math.ceil(a.siblings(".wpd-inline-icon.wpd-open").offset().left-a.offset().left+2);b<3&&(b=3),document.styleSheets[0].addRule("#"+a.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+b+"px;")}else if(a.offset().left+a.width()>document.body.clientWidth-10){a.css("left",Math.ceil(parseInt(a.css("left"))+(document.body.clientWidth-(a.offset().left+a.width()))-10));var b=Math.ceil(a.siblings(".wpd-inline-icon.wpd-open").offset().left-a.offset().left+2);b>a.width()-3&&(b=a.width()-3),document.styleSheets[0].addRule("#"+a.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+b+"px;")}}else $.each($(".wpd-inline-form-wrapper:visible"),function(){if($(this).offset().left<=10){$(this).css("left",Math.ceil(parseInt($(this).css("left"))-$(this).offset().left+10));var a=Math.ceil($(this).siblings(".wpd-inline-icon.wpd-open").offset().left-$(this).offset().left+2);a<3&&(a=3),document.styleSheets[0].addRule("#"+$(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"px;")}else if($(this).offset().left+$(this).width()>document.body.clientWidth-10){$(this).css("left",Math.ceil(parseInt($(this).css("left"))+(document.body.clientWidth-($(this).offset().left+$(this).width()))-10));var a=Math.ceil($(this).siblings(".wpd-inline-icon.wpd-open").offset().left-$(this).offset().left+2);a>$(this).width()-3&&(a=$(this).width()-3),document.styleSheets[0].addRule("#"+$(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"px;")}})}function aD(a){var b,c=0;if(a.parents(".wpd_main_comm_form").length)c=parseInt(wpdiscuzAjaxObj.commentTextMaxLength),b=a.parents(".wpd_main_comm_form");else if(a.parents(".wpd-secondary-form-wrapper").length)c=parseInt(wpdiscuzAjaxObj.replyTextMaxLength),b=a.parents(".wpd-secondary-form-wrapper");else if(a.parents("#wpdiscuz-edit-form").length){var e=aj(a);c=parseInt(e.substring(e.lastIndexOf("_")+1))?parseInt(wpdiscuzAjaxObj.replyTextMaxLength):parseInt(wpdiscuzAjaxObj.commentTextMaxLength),b=a.parents("#wpdiscuz-edit-form")}if(c&&b){var g=a.val().length,d=$(".wpd-editor-char-counter",b),f=c-g;d.html(f),f<=10?d.addClass("error"):d.removeClass("error")}}function aE(a,b,c,d){a.data.callbackFunctions&&$.each(a.data.callbackFunctions,function(e){"function"==typeof wpdiscuzAjaxObj[a.data.callbackFunctions[e]]?wpdiscuzAjaxObj[a.data.callbackFunctions[e]](a,b,c,d):"function"==typeof window[a.data.callbackFunctions[e]]?window[a.data.callbackFunctions[e]](a,b,c,d):console.log(a.data.callbackFunctions[e]+" is not a function")})}function G(c,d,a){d&&$("#wpdiscuz-loading-bar").show(),a.append("postId",I),a.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce);var b=a.get("action");wpdiscuzAjaxObj.dataFilterCallbacks&&wpdiscuzAjaxObj.dataFilterCallbacks[b]&&$.each(wpdiscuzAjaxObj.dataFilterCallbacks[b],function(e){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[b][e]]&&(a=wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[b][e]](a,c,d))});var e=c?wpdiscuzAjaxObj.url:wpdiscuzAjaxObj.customAjaxUrl;return $.ajax({type:"POST",url:e,data:a,contentType:!1,processData:!1})}function p(){if(c||wpdiscuzAjaxObj.validateNonceForGuests){var a=new FormData;a.append("action","wpdGetNonce"),G(x,!1,a).done(function(a){"object"==typeof a?a.success?wpdiscuzAjaxObj.wpdiscuz_nonce=a.data:wpdiscuzAjaxObj.setCommentMessage(a.data,"error"):console.log(a)}).fail(function(b,c,a){console.log(a)})}}$(document).on("click","body",function(a){if($(a.target).hasClass("wpd-inline-form-close")||$(a.target).parents(".wpd-inline-form-close").length)a.preventDefault(),$(a.target).parents(".wpd-inline-form-wrapper").hide(),$(a.target).parents(".wpd-inline-shortcode").removeClass("wpd-active"),$(a.target).parents(".wpd-inline-form-wrapper").siblings(".wpd-inline-icon").removeClass("wpd-open");else if(!$(a.target).hasClass("wpd-inline-form-wrapper")&&!$(a.target).parents(".wpd-inline-form-wrapper").length){aB();var b="";$(a.target).hasClass("wpd-inline-icon")?b=$(a.target):$(a.target).parents(".wpd-inline-icon").length&&(b=$(a.target).parents(".wpd-inline-icon")),b.length&&b.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&(b.parents(".wpd-inline-shortcode").addClass("wpd-active"),b.siblings(".wpd-inline-form-wrapper").show(),b.addClass("wpd-open"),b.removeClass("wpd-ignored"),aC(b.siblings(".wpd-inline-form-wrapper")))}(!$(a.target).hasClass("wpd-last-inline-comments-wrapper")&&!$(a.target).parents(".wpd-last-inline-comments-wrapper").length||$(a.target).parents(".wpd-last-inline-comments-wrapper").length&&$(a.target).hasClass("wpd-load-inline-comment"))&&$(".wpd-last-inline-comments-wrapper").remove()}),$("body").on("click",".wpd-inline-submit.wpd_not_clicked",function(c){c.preventDefault();var d=$(this),a=$(this).parents(".wpd_inline_comm_form");if(a[0].checkValidity()){$(this).removeClass("wpd_not_clicked");var b=new FormData;b.append("action","wpdAddInlineComment"),b.append("inline_form_id",aA(a)),$.each($("input, textarea",a),function(c,a){"checkbox"===this.type?$(this).is(":checked")&&b.append($(a).attr("name"),$(a).val()):b.append($(a).attr("name"),$(a).val())}),G(x,!0,b).done(function(b){if(d.addClass("wpd_not_clicked"),"object"==typeof b){if(b.success){a[0].reset(),aB();var e=parseInt(b.data.newCount),c=d.parents(".wpd-inline-icon-wrapper").find(".wpd-inline-icon-count");c.text(e),e?c.addClass("wpd-has-comments"):c.removeClass("wpd-has-comments"),b.data.allCommentsCountNew=parseInt(b.data.allCommentsCountNew),$(".wpd-thread-info").html(b.data.allCommentsCountBeforeThreadsHtml),$(".wpd-thread-info").attr("data-comments-count",b.data.allCommentsCountNew),$("#wpd-bubble-all-comments-count").replaceWith(b.data.allCommentsCountBubbleHtml),b.data.message&&az(b.data.message),wpdiscuzAjaxObj.setCommentMessage(b.data.notification,"success")}else b.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[b.data],b.data,d),"error")}else wpdiscuzAjaxObj.setCommentMessage(b,"error");$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}}),$("body").on("keydown",".wpd-form",function(a){a.ctrlKey&&13==a.keyCode&&$(this).find(".wc_comm_submit").trigger("click")}),$("body").on("keydown","#wpdiscuz-edit-form",function(a){a.ctrlKey&&13==a.keyCode&&$(this).find(".wc_save_edited_comment").trigger("click")}),$("body").on("keydown",".wpd-inline-comment-content",function(a){a.ctrlKey&&13==a.keyCode&&$(this).parents(".wpd_inline_comm_form").find(".wpd-inline-submit.wpd_not_clicked").trigger("click")}),$("body").on("click",".wpd-inline-icon-count.wpd-has-comments",function(){var b=$(this),a=new FormData;a.append("action","wpdGetLastInlineComments"),a.append("inline_form_id",aA(b)),G(x,!0,a).done(function(a){"object"==typeof a?a.success?$(a.data).insertAfter(b):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,b),"error"):console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("click",".wpd-view-all-inline-comments",function(a){a.preventDefault(),$(this).parents(".wpd-last-inline-comments-wrapper").remove(),$(".wpdf-inline").hasClass("wpdf-active")||$(".wpdf-inline").trigger("click"),au(),$("html, body").animate({scrollTop:$(".wpdf-inline").offset().top-m},1e3,av)}),$("body").on("click",".wpd-feedback-content-link",function(a){a.preventDefault();var b=$(this).data("feedback-content-id");au(),$("html, body").animate({scrollTop:$("#wpd-inline-"+b).offset().top-(m+6)},1e3,function(){av(),$("#wpd-inline-"+b).addClass("wpd-active")})}),("scroll_open"===l||"blink"===l)&&(o(),$(window).on("scroll",o)),$("body").on("click","#wpd-post-rating.wpd-not-rated .wpd-rate-starts svg",function(){var a=new FormData,b=$(this).index();b>=0&&b<5&&(a.append("action","wpdUserRate"),a.append("rating",b+1),G(x,!0,a).done(function(a){"object"==typeof a?(a.success?location.reload(!0):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data),"error"),aE(a)):console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)}))}),$("body").on("submit","#wpdiscuz-subscribe-form",function(d){d.preventDefault();var a=$(this);let b=$("#wpdiscuz_subscription_button",a);if(a[0].checkValidity()&&(f=a,g=!0,"2.0"===e&&$("input[name=wpdiscuz_recaptcha_subscribe_form]",f).length&&!$("input[name=wpdiscuz_recaptcha_subscribe_form]",f).val().length?(g=!1,$(".wpdiscuz-recaptcha",f).css("border","1px solid red")):"2.0"===e&&$("input[name=wpdiscuz_recaptcha_subscribe_form]",f).length&&$(".wpdiscuz-recaptcha",f).css("border","none"),g)&&b.hasClass("wpd_not_clicked")){b.removeClass("wpd_not_clicked");var f,g,c=new FormData;c.append("action","wpdAddSubscription"),$("*",a).each(function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&c.append(this.name+"",$(this).val()),("checkbox"==this.type||"radio"==this.type)&&$(this).is(":checked")&&c.append(this.name+"",$(this).val())}),G(x,!0,c).done(function(a){"object"==typeof a?a.success?(wpdiscuzAjaxObj.setCommentMessage(a.data,"success"),setTimeout(function(){location.reload(!0)},3e3)):wpdiscuzAjaxObj.setCommentMessage(a.data,"error"):wpdiscuzAjaxObj.setCommentMessage(a,"error"),$("#wpdiscuz-loading-bar").fadeOut(250),V=!1,b.addClass("wpd_not_clicked")}).fail(function(c,d,a){console.log(a),b.addClass("wpd_not_clicked"),$("#wpdiscuz-loading-bar").fadeOut(250)})}}),$("body").on("click",".wpd-unsubscribe",function(b){b.preventDefault();var a=new FormData;a.append("action","wpdUnsubscribe"),a.append("sid",$(this).data("sid")),a.append("skey",$(this).data("skey")),G(x,!0,a).done(function(a){"object"==typeof a?a.success?(wpdiscuzAjaxObj.setCommentMessage(a.data,"success"),setTimeout(function(){location.reload(!0)},3e3)):wpdiscuzAjaxObj.setCommentMessage(a.data,"error"):console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250),V=!1}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),wpdiscuzAjaxObj.resetActiveFilters=function(a){$(".wpd-filter.wpdf-active"+(a?":not("+a+")":"")).removeClass("wpdf-active")},wpdiscuzAjaxObj.getAjaxObj=G,wpdiscuzAjaxObj.initNonce=p,p()});var onloadCallback=function(){if(document.getElementById("wpdiscuz-recaptcha-0_0")&&"2.0"===wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion&&(1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!wpdiscuzAjaxObj.is_user_logged_in||1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&wpdiscuzAjaxObj.is_user_logged_in))try{grecaptcha.render("wpdiscuz-recaptcha-0_0",{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(a){jQuery("#wpdiscuz-recaptcha-field-0_0").val("key")},"expired-callback":function(){jQuery("#wpdiscuz-recaptcha-field-0_0").val("")}})}catch(a){console.log(a),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+a.message,"error")}}
7
  /* Colorbox */
8
  !function(t,e,i){var o,n,r,h,a,s,l,c,d,g,f,u,p,m,w,v,y,x,b,T,C,H,k,W,E,I,M,L,R,S,K,P,B,O={html:!1,photo:!1,iframe:!1,inline:!1,transition:"elastic",speed:300,fadeOut:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,opacity:.9,preloading:!0,className:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:void 0,closeButton:!0,fastIframe:!0,open:!1,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",photoRegex:/\.(gif|png|jp(e|g|eg)|bmp|ico|webp|jxr|svg)((#|\?).*)?$/i,retinaImage:!1,retinaUrl:!1,retinaSuffix:"@2x.$1",current:"image {current} of {total}",previous:"previous",next:"next",close:"close",xhrError:"This content failed to load.",imgError:"This image failed to load.",returnFocus:!0,trapFocus:!0,onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,rel:function(){return this.rel},href:function(){return t(this).attr("href")},title:function(){return this.title},createImg:function(){var e=new Image,i=t(this).data("cbox-img-attrs");return"object"==typeof i&&t.each(i,function(t,i){e[t]=i}),e},createIframe:function(){var i=e.createElement("iframe"),o=t(this).data("cbox-iframe-attrs");return"object"==typeof o&&t.each(o,function(t,e){i[t]=e}),"frameBorder"in i&&(i.frameBorder=0),"allowTransparency"in i&&(i.allowTransparency="true"),i.name=(new Date).getTime(),i.allowFullscreen=!0,i}},_="colorbox",j="cbox",D=j+"Element",F=j+"_open",N=j+"_load",z=j+"_complete",A=j+"_cleanup",q=j+"_closed",U=j+"_purge",$=t("<a/>"),G="div",Q=0,J={};function V(i,o,n){var r=e.createElement(i);return o&&(r.id=j+o),n&&(r.style.cssText=n),t(r)}function X(){return i.innerHeight?i.innerHeight:t(i).height()}function Y(e,i){i!==Object(i)&&(i={}),this.cache={},this.el=e,this.value=function(e){var o;return void 0===this.cache[e]&&(void 0!==(o=t(this.el).attr("data-cbox-"+e))?this.cache[e]=o:void 0!==i[e]?this.cache[e]=i[e]:void 0!==O[e]&&(this.cache[e]=O[e])),this.cache[e]},this.get=function(t){var e=this.value(t);return"function"==typeof e?e.call(this.el,this):e}}function Z(t){var e=d.length,i=(I+t)%e;return i<0?e+i:i}function tt(t,e){return Math.round((/%/.test(t)?("x"===e?g.width():X())/100:1)*parseInt(t,10))}function et(t,e){return t.get("photo")||t.get("photoRegex").test(e)}function it(t,e){return t.get("retinaUrl")&&i.devicePixelRatio>1?e.replace(t.get("photoRegex"),t.get("retinaSuffix")):e}function ot(t){"contains"in n[0]&&!n[0].contains(t.target)&&t.target!==o[0]&&(t.stopPropagation(),n.trigger("focus"))}function nt(t){nt.str!==t&&(n.add(o).removeClass(nt.str).addClass(t),nt.str=t)}function rt(i){t(e).trigger(i),$.triggerHandler(i)}var ht=function(){var t,e,i=j+"Slideshow_",o="click."+j;function r(){clearTimeout(e)}function h(){(C.get("loop")||d[I+1])&&(r(),e=setTimeout(P.next,C.get("slideshowSpeed")))}function a(){v.html(C.get("slideshowStop")).off(o).one(o,s),$.on(z,h).on(N,r),n.removeClass(i+"off").addClass(i+"on")}function s(){r(),$.off(z,h).off(N,r),v.html(C.get("slideshowStart")).off(o).one(o,function(){P.next(),a()}),n.removeClass(i+"on").addClass(i+"off")}function l(){t=!1,v.hide(),r(),$.off(z,h).off(N,r),n.removeClass(i+"off "+i+"on")}return function(){t?C.get("slideshow")||($.off(A,l),l()):C.get("slideshow")&&d[1]&&(t=!0,$.one(A,l),C.get("slideshowAuto")?a():s(),v.show())}}();function at(r){var g,w;if(!S){if(g=t(r).data(_),C=new Y(r,g),w=C.get("rel"),I=0,w&&!1!==w&&"nofollow"!==w?(d=t("."+D).filter(function(){return new Y(this,t.data(this,_)).get("rel")===w}),-1===(I=d.index(C.el))&&(d=d.add(C.el),I=d.length-1)):d=t(C.el),!L){L=R=!0,nt(C.get("className")),n.css({visibility:"hidden",display:"block",opacity:""}),f=V(G,"LoadedContent","width:0; height:0; overflow:hidden; visibility:hidden"),h.css({width:"",height:""}).append(f),H=a.height()+c.height()+h.outerHeight(!0)-h.height(),k=s.width()+l.width()+h.outerWidth(!0)-h.width(),W=f.outerHeight(!0),E=f.outerWidth(!0);var v=tt(C.get("initialWidth"),"x"),y=tt(C.get("initialHeight"),"y"),x=C.get("maxWidth"),B=C.get("maxHeight");C.w=Math.max((!1!==x?Math.min(v,tt(x,"x")):v)-E-k,0),C.h=Math.max((!1!==B?Math.min(y,tt(B,"y")):y)-W-H,0),f.css({width:"",height:C.h}),P.position(),rt(F),C.get("onOpen"),T.add(m).hide(),n.trigger("focus"),C.get("trapFocus")&&e.addEventListener&&(e.addEventListener("focus",ot,!0),$.one(q,function(){e.removeEventListener("focus",ot,!0)})),C.get("returnFocus")&&$.one(q,function(){t(C.el).trigger("focus")})}var O=parseFloat(C.get("opacity"));o.css({opacity:O==O?O:"",cursor:C.get("overlayClose")?"pointer":"",visibility:"visible"}).show(),C.get("closeButton")?b.html(C.get("close")).appendTo(h):b.appendTo("<div/>"),function(){var e,o,n,r=P.prep,h=++Q;R=!0,M=!1,rt(U),rt(N),C.get("onLoad"),C.h=C.get("height")?tt(C.get("height"),"y")-W-H:C.get("innerHeight")&&tt(C.get("innerHeight"),"y"),C.w=C.get("width")?tt(C.get("width"),"x")-E-k:C.get("innerWidth")&&tt(C.get("innerWidth"),"x"),C.mw=C.w,C.mh=C.h,C.get("maxWidth")&&(C.mw=tt(C.get("maxWidth"),"x")-E-k,C.mw=C.w&&C.w<C.mw?C.w:C.mw);C.get("maxHeight")&&(C.mh=tt(C.get("maxHeight"),"y")-W-H,C.mh=C.h&&C.h<C.mh?C.h:C.mh);if(e=C.get("href"),K=setTimeout(function(){p.show()},100),C.get("inline")){var a=t(e).eq(0);n=t("<div>").hide().insertBefore(a),$.one(U,function(){n.replaceWith(a)}),r(a)}else C.get("iframe")?r(" "):C.get("html")?r(C.get("html")):et(C,e)?(e=it(C,e),M=C.get("createImg"),t(M).addClass(j+"Photo").on("error."+j,function(){r(V(G,"Error").html(C.get("imgError")))}).one("load",function(){h===Q&&setTimeout(function(){var e;C.get("retinaImage")&&i.devicePixelRatio>1&&(M.height=M.height/i.devicePixelRatio,M.width=M.width/i.devicePixelRatio),C.get("scalePhotos")&&(o=function(){M.height-=M.height*e,M.width-=M.width*e},C.mw&&M.width>C.mw&&(e=(M.width-C.mw)/M.width,o()),C.mh&&M.height>C.mh&&(e=(M.height-C.mh)/M.height,o())),C.h&&(M.style.marginTop=Math.max(C.mh-M.height,0)/2+"px"),d[1]&&(C.get("loop")||d[I+1])&&(M.style.cursor="pointer",t(M).on("click."+j,function(){P.next()})),M.style.width=M.width+"px",M.style.height=M.height+"px",r(M)},1)}),M.src=e):e&&u.load(e,C.get("data"),function(e,i){h===Q&&r("error"===i?V(G,"Error").html(C.get("xhrError")):t(this).contents())})}()}}function st(){n||(B=!1,g=t(i),n=V(G).attr({id:_,class:!1===t.support.opacity?j+"IE":"",role:"dialog",tabindex:"-1"}).hide(),o=V(G,"Overlay").hide(),p=t([V(G,"LoadingOverlay")[0],V(G,"LoadingGraphic")[0]]),r=V(G,"Wrapper"),h=V(G,"Content").append(m=V(G,"Title"),w=V(G,"Current"),x=t('<button type="button"/>').attr({id:j+"Previous"}),y=t('<button type="button"/>').attr({id:j+"Next"}),v=t('<button type="button"/>').attr({id:j+"Slideshow"}),p),b=t('<button type="button"/>').attr({id:j+"Close"}),r.append(V(G).append(V(G,"TopLeft"),a=V(G,"TopCenter"),V(G,"TopRight")),V(G,!1,"clear:left").append(s=V(G,"MiddleLeft"),h,l=V(G,"MiddleRight")),V(G,!1,"clear:left").append(V(G,"BottomLeft"),c=V(G,"BottomCenter"),V(G,"BottomRight"))).find("div div").css({float:"left"}),u=V(G,!1,"position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;"),T=y.add(x).add(w).add(v)),e.body&&!n.parent().length&&t(e.body).append(o,n.append(r,u))}function lt(){function i(t){t.which>1||t.shiftKey||t.altKey||t.metaKey||t.ctrlKey||(t.preventDefault(),at(this))}return!!n&&(B||(B=!0,y.on("click",function(){P.next()}),x.on("click",function(){P.prev()}),b.on("click",function(){P.close()}),o.on("click",function(){C.get("overlayClose")&&P.close()}),t(e).on("keydown."+j,function(t){var e=t.keyCode;L&&C.get("escKey")&&27===e&&(t.preventDefault(),P.close()),L&&C.get("arrowKey")&&d[1]&&!t.altKey&&(37===e?(t.preventDefault(),x.trigger("click")):39===e&&(t.preventDefault(),y.trigger("click")))}),"function"==typeof t.fn.on?t(e).on("click."+j,"."+D,i):t("."+D).live("click."+j,i)),!0)}t[_]||(t(st),(P=t.fn[_]=t[_]=function(e,i){var o=this;return e=e||{},"function"==typeof o&&(o=t("<a/>"),e.open=!0),o[0]?(st(),lt()&&(i&&(e.onComplete=i),o.each(function(){var i=t.data(this,_)||{};t.data(this,_,t.extend(i,e))}).addClass(D),new Y(o[0],e).get("open")&&at(o[0])),o):o}).position=function(e,i){var o,d,f,u=0,p=0,m=n.offset();function w(){a[0].style.width=c[0].style.width=h[0].style.width=parseInt(n[0].style.width,10)-k+"px",h[0].style.height=s[0].style.height=l[0].style.height=parseInt(n[0].style.height,10)-H+"px"}if(g.off("resize."+j),n.css({top:-9e4,left:-9e4}),d=g.scrollTop(),f=g.scrollLeft(),C.get("fixed")?(m.top-=d,m.left-=f,n.css({position:"fixed"})):(u=d,p=f,n.css({position:"absolute"})),!1!==C.get("right")?p+=Math.max(g.width()-C.w-E-k-tt(C.get("right"),"x"),0):!1!==C.get("left")?p+=tt(C.get("left"),"x"):p+=Math.round(Math.max(g.width()-C.w-E-k,0)/2),!1!==C.get("bottom")?u+=Math.max(X()-C.h-W-H-tt(C.get("bottom"),"y"),0):!1!==C.get("top")?u+=tt(C.get("top"),"y"):u+=Math.round(Math.max(X()-C.h-W-H,0)/2),n.css({top:m.top,left:m.left,visibility:"visible"}),r[0].style.width=r[0].style.height="9999px",o={width:C.w+E+k,height:C.h+W+H,top:u,left:p},e){var v=0;t.each(o,function(t){o[t]===J[t]||(v=e)}),e=v}J=o,e||n.css(o),n.dequeue().animate(o,{duration:e||0,complete:function(){w(),R=!1,r[0].style.width=C.w+E+k+"px",r[0].style.height=C.h+W+H+"px",C.get("reposition")&&setTimeout(function(){g.on("resize."+j,P.position)},1),"function"==typeof i&&i()},step:w})},P.resize=function(t){var e;L&&((t=t||{}).width&&(C.w=tt(t.width,"x")-E-k),t.innerWidth&&(C.w=tt(t.innerWidth,"x")),f.css({width:C.w}),t.height&&(C.h=tt(t.height,"y")-W-H),t.innerHeight&&(C.h=tt(t.innerHeight,"y")),t.innerHeight||t.height||(e=f.scrollTop(),f.css({height:"auto"}),C.h=f.height()),f.css({height:C.h}),e&&f.scrollTop(e),P.position("none"===C.get("transition")?0:C.get("speed")))},P.prep=function(i){if(L){var o,r="none"===C.get("transition")?0:C.get("speed");f.remove(),(f=V(G,"LoadedContent").append(i)).hide().appendTo(u.show()).css({width:(C.w=C.w||f.width(),C.w=C.mw&&C.mw<C.w?C.mw:C.w,C.w),overflow:C.get("scrolling")?"auto":"hidden"}).css({height:(C.h=C.h||f.height(),C.h=C.mh&&C.mh<C.h?C.mh:C.h,C.h)}).prependTo(h),u.hide(),t(M).css({float:"none"}),nt(C.get("className")),o=function(){var i,o,h=d.length;function a(){!1===t.support.opacity&&n[0].style.removeAttribute("filter")}L&&(o=function(){clearTimeout(K),p.hide(),rt(z),C.get("onComplete")},m.html(C.get("title")).show(),f.show(),h>1?("string"==typeof C.get("current")&&w.html(C.get("current").replace("{current}",I+1).replace("{total}",h)).show(),y[C.get("loop")||I<h-1?"show":"hide"]().html(C.get("next")),x[C.get("loop")||I?"show":"hide"]().html(C.get("previous")),ht(),C.get("preloading")&&t.each([Z(-1),Z(1)],function(){var i=d[this],o=new Y(i,t.data(i,_)),n=o.get("href");n&&et(o,n)&&(n=it(o,n),e.createElement("img").src=n)})):T.hide(),C.get("iframe")?(i=C.get("createIframe"),C.get("scrolling")||(i.scrolling="no"),t(i).attr({src:C.get("href"),class:j+"Iframe"}).one("load",o).appendTo(f),$.one(U,function(){i.src="//about:blank"}),C.get("fastIframe")&&t(i).trigger("load")):o(),"fade"===C.get("transition")?n.fadeTo(r,1,a):a())},"fade"===C.get("transition")?n.fadeTo(r,0,function(){P.position(0,o)}):P.position(r,o)}},P.next=function(){!R&&d[1]&&(C.get("loop")||d[I+1])&&(I=Z(1),at(d[I]))},P.prev=function(){!R&&d[1]&&(C.get("loop")||I)&&(I=Z(-1),at(d[I]))},P.close=function(){L&&!S&&(S=!0,L=!1,rt(A),C.get("onCleanup"),g.off("."+j),o.fadeTo(C.get("fadeOut")||0,0),n.stop().fadeTo(C.get("fadeOut")||0,0,function(){n.hide(),o.hide(),rt(U),f.remove(),setTimeout(function(){S=!1,rt(q),C.get("onClosed")},1)}))},P.remove=function(){n&&(n.stop(),t[_].close(),n.stop(!1,!0).remove(),o.remove(),S=!1,n=null,t("."+D).removeData(_).removeClass(D),t(e).off("click."+j).off("keydown."+j))},P.element=function(){return t(C.el)},P.settings=O)}(jQuery,document,window);
9
  /* Media Uploader */
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 */
14
+ jQuery(document).ready(function($){var a=0,b=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),c=parseInt(wpdiscuzUCObj.additionalTab);$("body").on("click",".wpd-info,.wpd-page-link,.wpd-delete-content,.wpd-user-email-delete-links",function(a){a.preventDefault()}),$("body").on("click",".wpd-info.wpd-not-clicked",function(i){var e=$(this);e.removeClass("wpd-not-clicked");var f,g,a,h,d=new FormData;return d.append("action","wpdGetInfo"),d.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce),f=e,g=d,h=(a=$(".fas",f)).attr("class"),a.removeClass(),a.addClass("fas fa-pulse fa-spinner"),wpdiscuzAjaxObj.getAjaxObj(b||c,!1,g).done(function(b){f.addClass("wpd-not-clicked"),a.removeClass(),a.addClass(h),b&&($("#wpdUserContentInfo").html(b),$("#wpdUserContentInfo ul.wpd-list .wpd-list-item:first-child").addClass("wpd-active"),$("#wpdUserContentInfo div.wpd-content .wpd-content-item:first-child").addClass("wpd-active"),$("#wpdUserContentInfo").is(":visible")||$("#wpdUserContentInfoAnchor").trigger("click"))}),!1}),$("body").on("click",".wpd-list-item",function(){var a=$("input.wpd-rel",this).val();$("#wpdUserContentInfo .wpd-list-item").removeClass("wpd-active"),$("#wpdUserContentInfo .wpd-content-item").removeClass("wpd-active");var e=$(this);if($("#wpdUserContentInfo #"+a).text().length)e.addClass("wpd-active"),$("#wpdUserContentInfo #"+a).addClass("wpd-active");else{var d=new FormData;d.append("action",e.attr("data-action")),d.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce),d.append("page",0),$("#wpdUserContentInfo #"+a).addClass("wpd-active"),$("#wpdUserContentInfo #"+a).css("text-align","center"),wpdiscuzAjaxObj.getAjaxObj(b||c,!0,d).done(function(b){b&&($("#wpdUserContentInfo #"+a).css("text-align",""),e.addClass("wpd-active"),$("#wpdUserContentInfo #"+a).html(b)),$("#wpdiscuz-loading-bar").hide()})}}),$("body").on("click",".wpd-page-link.wpd-not-clicked",function(g){var d=$(this);d.removeClass("wpd-not-clicked");var e=d.data("wpd-page"),f=$(".wpd-active .wpd-pagination .wpd-action").val(),a=new FormData;a.append("action",f),a.append("page",e),a.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce),wpdiscuzAjaxObj.getAjaxObj(b||c,!0,a).done(function(a){d.addClass("wpd-not-clicked"),a&&$(".wpd-content-item.wpd-active").html(a),$("#wpdiscuz-loading-bar").hide()})}),$("body").on("click",".wpd-delete-content.wpd-not-clicked",function(){var d=$(this),h=parseInt(d.data("wpd-content-id"));if(!isNaN(h)){var f=d.data("wpd-delete-action");if("wpdDeleteComment"===f&&!confirm(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzUCObj.msgConfirmDeleteComment,"wc_confirm_comment_delete",d))||"wpdCancelSubscription"===f&&!confirm(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzUCObj.msgConfirmCancelSubscription,"wc_confirm_cancel_subscription",d))||"wpdCancelFollow"===f&&!confirm(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzUCObj.msgConfirmCancelFollow,"wc_confirm_cancel_follow",d)))return!1;var i=$("i",d),k=i.attr("class"),g=$(".wpd-wrapper .wpd-page-number").val(),j=$(".wpd-content-item.wpd-active").children(".wpd-item").length;d.removeClass("wpd-not-clicked"),i.removeClass().addClass("fas fa-pulse fa-spinner"),1===j&&g>0&&(g-=1);var e=new FormData;e.append("id",h),e.append("page",g),e.append("action",f),e.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce),wpdiscuzAjaxObj.getAjaxObj(b||c,!1,e).done(function(b){d.addClass("wpd-not-clicked"),i.removeClass().addClass(k),$(".wpd-content-item.wpd-active").html(b),a=1})}}),$("body").on("click","[data-lity-close]",function(b){$(b.target).is("[data-lity-close]")&&a&&window.location.reload(!0)}),$("body").on("click",".wpd-user-email-delete-links.wpd-not-clicked",function(){var d=$(this);d.removeClass("wpd-not-clicked"),$(".wpd-loading",d).addClass("wpd-show");var a=new FormData;a.append("action","wpdEmailDeleteLinks"),a.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce),wpdiscuzAjaxObj.getAjaxObj(b||c,!1,a).done(function(a){d.addClass("wpd-not-clicked"),$("[data-lity-close]",window.parent.document).trigger("click")})}),$("body").on("click",".wpd-user-settings-button.wpd-not-clicked",function(){var d=$(this);d.removeClass("wpd-not-clicked");var e=d.data("wpd-delete-action");if("deleteCookies"!==e){d.find(".wpd-loading").addClass("wpd-show");var a=new FormData;a.append("action","wpdGuestAction"),a.append("guestAction",e),a.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce),wpdiscuzAjaxObj.getAjaxObj(b||c,!1,a).done(function(a){d.addClass("wpd-not-clicked"),d.find(".wpd-loading").removeClass("wpd-show");try{var b=$.parseJSON(a);d.after(b.message);var c=d.next(".wpd-guest-action-message");c.fadeIn(100).fadeOut(7e3,function(){c.remove(),1===parseInt(b.code)&&(d.parent().remove(),$(".wpd-delete-all-comments").length||$(".wpd-delete-all-subscriptions").length||$(".wpd-delete-all-cookies").parent().addClass("wpd-show"))})}catch(e){console.log(e)}})}else(function(){for(var c=document.cookie.split(";"),a=0;a<c.length;a++){var b=c[a],d=b.indexOf("="),e=d> -1?b.substr(0,d):b;Cookies.remove(e.trim())}location.reload(!0)})()})})
15
  /* Social */
16
+ function wpcShareCommentFB(a,b){FB.ui({method:"share",href:a,quote:b},function(a){})}(!parseInt(wpdiscuzAjaxObj.fbUseOAuth2)&&parseInt(wpdiscuzAjaxObj.enableFbLogin)||parseInt(wpdiscuzAjaxObj.enableFbShare))&&wpdiscuzAjaxObj.facebookAppID&&(function(a,c,d){var b,e=a.getElementsByTagName(c)[0];a.getElementById(d)||((b=a.createElement(c)).id=d,b.src="//connect.facebook.net/en_US/sdk.js",e.parentNode.insertBefore(b,e))}(document,"script","facebook-jssdk"),window.fbAsyncInit=function(){FB.init({appId:wpdiscuzAjaxObj.facebookAppID,cookie:!0,xfbml:!0,version:"v7.0"})}),jQuery(document).ready(function($){(a=Cookies.get("wpdiscuz_social_login_message"))&&"undefined"!==a&&(Cookies.remove("wpdiscuz_social_login_message"),wpdiscuzAjaxObj.setCommentMessage(decodeURIComponent(a.replace(/\+/g,"%20")),"error")),Cookies.get("wpdiscuz_scroll_to_comments")&&(Cookies.remove("wpdiscuz_scroll_to_comments",{path:"/"}),$("html, body").animate({scrollTop:$("#comments").offset().top-32},1e3)),$("body").on("click",".wpd-comment-share .fa-facebook-f",function(){if(1==wpdiscuzAjaxObj.enableFbShare){var b=$(this).parents(".wpd-comment").find(".wpd-comment-right").attr("id"),a=window.location.href;-1!==a.indexOf("#")&&(a=a.substring(0,a.indexOf("#"))),wpcShareCommentFB(a+="#"+b,$(this).parents(".wpd-comment-right").find(".wpd-comment-text").text())}});var a,b="";function c(a,b){var c,e="";f(b,1),Cookies.set("wpdiscuz_scroll_to_comments",1,{path:"/"}),"facebook"===a&&0==wpdiscuzAjaxObj.facebookUseOAuth2?FB.getLoginStatus(function(f){"connected"===f.status?(c=f.authResponse.accessToken,e=f.authResponse.userID,d(a,c,e,b)):FB.login(function(f){"connected"===f.status&&(c=f.authResponse.accessToken,e=f.authResponse.userID,d(a,c,e,b))},{scope:"public_profile,email"})}):d(a,c,e,b)}function d(a,b,c,d){return $.ajax({type:"POST",url:wpdiscuzAjaxObj.url,data:{action:"wpd_social_login",provider:a,token:b,userID:c,postID:wpdiscuzAjaxObj.wc_post_id}}).done(function(a){e(a,d)}),""}function e(b,c){try{var a=$.parseJSON(b),d=a.code,e=a.message,g=a.url;200===parseInt(d)?location.assign(g):wpdiscuzAjaxObj.setCommentMessage(e,"error")}catch(h){console.log(h)}f(c,0)}function f(a,b){1===b?a.find(".wpdiscuz-social-login-spinner").show():a.find(".wpdiscuz-social-login-spinner").hide()}$("body").on("click","#wpdcom .wpd-social-login .wpdiscuz-login-button",function(){var f,e,d,a,g=$(this).parents(".wpd-social-login");f=b=(d=$(this),a="",d.hasClass("wpdsn-fb")&&(a="facebook"),d.hasClass("wpdsn-insta")&&(a="instagram"),d.hasClass("wpdsn-gg")&&(a="google"),d.hasClass("wpdsn-ds")&&(a="disqus"),d.hasClass("wpdsn-wp")&&(a="wordpress"),d.hasClass("wpdsn-tw")&&(a="twitter"),d.hasClass("wpdsn-vk")&&(a="vk"),d.hasClass("wpdsn-ok")&&(a="ok"),d.hasClass("wpdsn-linked")&&(a="linkedin"),d.hasClass("wpdsn-yandex")&&(a="yandex"),d.hasClass("wpdsn-mailru")&&(a="mailru"),d.hasClass("wpdsn-weixin")&&(a="wechat"),d.hasClass("wpdsn-weibo")&&(a="weibo"),d.hasClass("wpdsn-qq")&&(a="qq"),d.hasClass("wpdsn-baidu")&&(a="baidu"),a),e=g,1!=parseInt(wpdiscuzAjaxObj.socialLoginAgreementCheckbox)||1==Cookies.get("socialLoginAgreementConfirmed")?c(f,e):e.parents(".wpd-form-wrap, .wpd-form").find(".wpd-social-login-agreement").first().slideDown(700)}),$("body").on("click","#wpdcom .wpd-agreement-buttons-right .wpd-agreement-button",function(){var a=$(this).parents(".wpd-form-wrap, .wpd-form").find(".wpd-social-login-agreement").slideUp(700);$(this).hasClass("wpd-agreement-button-agree")&&(wpdiscuzAjaxObj.isCookiesEnabled&&Cookies.set("socialLoginAgreementConfirmed",1,{expires:30,path:"/"}),c(b,a))})})
assets/js/wpdiscuz-combo.min.js CHANGED
@@ -7,14 +7,14 @@
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),s=parseInt(wpdiscuzAjaxObj.wc_post_id);wpdiscuzAjaxObj.wpdiscuz_nonce="";var d=parseInt(wpdiscuzAjaxObj.commentListUpdateType),c=1e3*parseInt(wpdiscuzAjaxObj.commentListUpdateTimer),p=parseInt(wpdiscuzAjaxObj.liveUpdateGuests),r=wpdiscuzAjaxObj.loadLastCommentId,l=r,m=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 w,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),k=parseInt(wpdiscuzAjaxObj.bubbleHintTimeout),O=parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout)?parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout):5,y=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(){we(e(this))}),e.each(e("textarea.wc_comment"),function(){we(e(this))})),e(document).on("focus","#wpdcom .ql-editor, #wpdcom .wc_comment",function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(j)}),e(document).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(document).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(document).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(document).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){var i={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)};U(i)}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(document).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(document).on("click",".wpdiscuz-nofollow,.wc_captcha_refresh_img,.wpd-load-more-submit",function(e){e.preventDefault()}),e(document).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(document).on("mouseenter",".wpd-new-loaded-comment",function(){e(this).removeClass("wpd-new-loaded-comment")}),e(document).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(document).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(document).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"}]):we(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(document).on("click",".wc_comm_submit.wpd_not_clicked",function(){var i=e(this),s=1,d=e(this).parents("form");if("true"!==d.attr("data-uploading"))if(d.hasClass("wpd_main_comm_form")||(s=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(d,"#wpd-editor-"+e(".wpdiscuz_unique_id",d).val()),d.on("submit",function(e){e.preventDefault()}),""!==e(".wc_comment",d).val().trim()){if(d[0].checkValidity()&&(p=d,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))}))})}(d),e(i).removeClass("wpd_not_clicked");var c=new FormData;if(c.append("action","wpdAddComment"),e(":input",d).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",s),wpdiscuzAjaxObj.wpdiscuz_zs&&c.append("wpdiscuz_zs",wpdiscuzAjaxObj.wpdiscuz_zs),e(".wpd-cookies-checkbox",d).length?e(".wpd-cookies-checkbox",d).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(d,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(d,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",d).val()),e(".wpdiscuz_reset").val("")}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wc_msg_required_fields,"wc_msg_required_fields",d),"error");else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhraseDoingUpload,"wmuPhraseDoingUpload",d),"warning")}),e(document).on("click",".wpd_editable_comment",function(){w&&e(".wpdiscuz-edit-form-wrap").length&&W(X(e(".wpdiscuz-edit-form-wrap"),0),w);var t=e(this),a=X(t,0),o=Y(a),n=new FormData;n.append("action","wpdEditComment"),n.append("commentId",o),w=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),we(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(document).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?(n.success?(W(a,n.data.message),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)):console.log(n),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wc_cancel_edit",function(){var t=X(e(this));W(t,w),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)}),!u&&m&&(L=0,1==m?setTimeout(function(){B(!0)},500):e(document).on("click",".wpd-load-comments",function(){e(this).parent(".wpd-load-more-submit-wrap").remove(),B(!0)})),e(document).on("click",".wpd-load-more-submit",function(){var t=e(this);t.hasClass("wpd-loaded")&&B(!1,t,"wpd-loaded","wpd-loading")});var N=!1;function V(){var t=e("#wpdiscuzHasMoreComments").val(),a=e(document).height(),o=e(window).height()+e(window).scrollTop();a&&o&&(100*o/a>=80&&!1===N&&1==t&&(N=!0,B(!1,e(".wpd-load-more-submit"))))}function B(t,a,o,n){a&&(a.toggleClass(o),a.toggleClass(n));var s=new FormData;s.append("action","wpdLoadMoreComments");var d=e(".wpdiscuz-sort-button-active").attr("data-sorting");d&&s.append("sorting",d),s.append("offset",L),s.append("lastParentId",e(".wpd-load-more-submit").attr("data-lastparentid")),s.append("isFirstLoad",t?1:0);var c=e(".wpdf-active").attr("data-filter-type");s.append("wpdType",c||""),fe(v,!t||1!=m,s).done(function(s){"object"==typeof s&&s.success&&(L++,t&&e(".wpd-comment").remove(),e(".wpdiscuz_single").remove(),e(".wpdiscuz-comment-pagination").before(s.data.comment_list),K(s,t&&2!==i),N=!1,s.data.loadLastCommentId&&(r=s.data.loadLastCommentId),ue(s),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,s){console.log(s),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),a&&(a.toggleClass(o),a.toggleClass(n))})}function K(t,a){if(0==t.data.is_show_load_more)e("#wpdiscuzHasMoreComments").val(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(),e("#wpdiscuzHasMoreComments").val(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)}var o;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(),V(),e(window).scroll(function(){V()})),wpdiscuzAjaxObj.setLoadMoreVisibility=K,e(document).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)),s=n.data.votes;i.text(n.data.votesHumanReadable),i.attr("title",s),i.removeClass("wpd-up wpd-down"),s>0&&i.addClass("wpd-up"),s<0&&i.addClass("wpd-down")}else{var d=e(".wpd-comment-footer .wpd-vote-result-like",e("#comment-"+o)),c=e(".wpd-comment-footer .wpd-vote-result-dislike",e("#comment-"+o));d.text(n.data.likeCountHumanReadable),d.attr("title",n.data.likeCount),c.text(n.data.dislikeCountHumanReadable),c.attr("title",n.data.dislikeCount),parseInt(n.data.likeCount)>0?d.addClass("wpd-up"):d.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(document).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!=m&&Q(!1),e(document).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(document).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(document).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(document).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(document).on("mouseleave",".wpd-comment-right",function(){e(this).find(".wpd-tools-actions").hide(),e("#comments").css({paddingBottom:"0"})}),e(document).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(document).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(document).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(document).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(document).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(document).on("click",".wpd-filter-view-all",function(){e(".wpdf-inline.wpdf-active.wpd_not_clicked").trigger("click")}),e(document).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(document).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")}),k&&!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*O)},1e3*k),"content_left"===A)if(e(".entry-content").length){var se=(de=Math.min(e(".entry-content").offset().left,e("#wpdcom").offset().left)-120)>25?de:25;e("#wpd-bubble-wrapper").css({left:se+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".post-entry").length){se=(de=Math.min(e(".post-entry").offset().left,e("#wpdcom").offset().left)-120)>25?de:25;e("#wpd-bubble-wrapper").css({left:se+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".container").length){var de;se=(de=Math.min(e(".container").offset().left,e("#wpdcom").offset().left)-120)>25?de:25;e("#wpd-bubble-wrapper").css({left:se+"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(document).on("click","#wpd-bubble-add-message-close",function(t){t.preventDefault(),t.stopPropagation(),e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")}),e(document).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(document).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(document).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(document).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||d)&&(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:s,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){d&&((i=new FormData).append("action","wpdUpdateAutomatically"),i.append("loadLastCommentId",r),i.append("visibleCommentIds",ee()),fe(v,!1,i).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),y&&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);var i;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"),me()):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"),me(t.siblings(".wpd-inline-form-wrapper"))))})}function me(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 we(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,s=e(".wpd-editor-char-counter",a),d=o-i;s.html(d),d<=10?s.addClass("error"):s.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",s),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"),me(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(document).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(document).on("keydown",".wpd-form",function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_comm_submit").trigger("click")}),e(document).on("keydown","#wpdiscuz-edit-form",function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_save_edited_comment").trigger("click")}),e(document).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(document).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(document).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(document).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(document).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(document).on("submit","#wpdiscuz-subscribe-form",function(t){t.preventDefault();var a,o,i=e(this);if(i[0].checkValidity()&&(a=i,o=!0,"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).length&&!e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).val().length?(o=!1,e(".wpdiscuz-recaptcha",a).css("border","1px solid red")):"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).length&&e(".wpdiscuz-recaptcha",a).css("border","none"),o)){var s=new FormData;s.append("action","wpdAddSubscription"),e("*",i).each(function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&s.append(this.name+"",e(this).val()),"checkbox"!=this.type&&"radio"!=this.type||e(this).is(":checked")&&s.append(this.name+"",e(this).val())}),fe(v,!0,s).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}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).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(a){if(a(document).on("click","#wpdcom .wmu-upload-wrap",function(){a(".wpd-form-foot",a(this).parents(".wpd_comm_form")).slideDown(parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0)}),a(document).on("change",".wmu-add-files",function(){var e=a(this),t=e.parents(".wpd_comm_form"),d=e[0].files?e[0].files:[];d.length&&function(e,t,d){t.attr("data-uploading","true");var o=new FormData;o.append("action","wmuUploadFiles"),o.append("wmuAttachmentsData",a(".wmu-attachments-data",t).val()),o.append("uniqueId",t.find(".wpdiscuz_unique_id").val());var i=0;a.each(d,function(a,e){i+=e.size,o.append(wpdiscuzAjaxObj.wmuInput+"["+a+"]",e)}),i>parseInt(wpdiscuzAjaxObj.wmuMaxFileSize)?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhraseMaxFileSize,"wmuPhraseMaxFileSize",e),"error",3e3):i>parseInt(wpdiscuzAjaxObj.wmuPostMaxSize)?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhrasePostMaxSize,"wmuPhrasePostMaxSize",e),"error",3e3):wpdiscuzAjaxObj.getAjaxObj(!0,!0,o).done(function(e){e.success?(a(".wmu-attached-data-info",t).remove(),a(".wmu-add-files",t).after(e.data.attachmentsHtml),e.data.tooltip&&a(".wmu-upload-wrap",t).attr("wpd-tooltip",e.data.tooltip),function(e,t){a.each(t.data.previewsData,function(t,d){a(".wmu-action-wrap .wmu-"+t+"-tab",e).html(""),a.each(d,function(d,o){var i=o.id,r="",s=o.fullname,u=o.shortname;t==wpdiscuzAjaxObj.wmuKeyImages?(r=o.url,u=""):t==wpdiscuzAjaxObj.wmuKeyVideos?r=wpdiscuzAjaxObj.wmuIconVideo:t==wpdiscuzAjaxObj.wmuKeyFiles&&(r=wpdiscuzAjaxObj.wmuIconFile);var n='<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>';n=(n=(n=(n=(n=(n=n.replace("[PREVIEW_TYPE_CLASS]","wmu-preview-"+t)).replace("[PREVIEW_TITLE]",s)).replace("[PREVIEW_TYPE]",t)).replace("[PREVIEW_ID]",i)).replace("[PREVIEW_ICON]",r)).replace("[PREVIEW_FILENAME]",u),a(".wmu-action-wrap .wmu-"+t+"-tab",e).removeClass("wmu-hide").append(n)})})}(t,e),e.data.errors&&(wpdiscuzAjaxObj.setCommentMessage(e.data.errors,"error",3e3),console.log(e.data.errors))):e.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[e.data.errorCode],e.data.errorCode,t),"error",3e3):e.data.error&&wpdiscuzAjaxObj.setCommentMessage(e.data.error,"error",3e3),a("#wpdiscuz-loading-bar").fadeOut(250),t.attr("data-uploading","false")}).fail(function(e,d,o){console.log(o),a("#wpdiscuz-loading-bar").fadeOut(250),t.attr("data-uploading","false")})}(e,t,d)}),a(document).on("click",".wmu-attachment-delete",function(e){if(confirm(wpdiscuzAjaxObj.wmuPhraseConfirmDelete)){var t=a(this).data("wmu-attachment"),d=new FormData;d.append("action","wmuDeleteAttachment"),d.append("attachmentId",t),wpdiscuzAjaxObj.getAjaxObj(!0,!0,d).done(function(e){if(e.success){var d=a(".wmu-attachment-"+t).parents(".wmu-comment-attachments");a(".wmu-attachment-"+t).remove(),a(".wmu-attached-images *",d).length||a(".wmu-attached-images",d).remove(),a(".wmu-attached-videos *",d).length||a(".wmu-attached-videos",d).remove(),a(".wmu-attached-files *",d).length||a(".wmu-attached-files",d).remove()}else e.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[e.data.errorCode],e.data.errorCode,d),"error",3e3):e.data.error&&wpdiscuzAjaxObj.setCommentMessage(e.data.error,"error",3e3);a("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,d){console.log(d),a("#wpdiscuz-loading-bar").fadeOut(250)})}else console.log("canceled")}),a(document).on("click",".wmu-preview",function(){var e=a(this),t=e.parents(".wpd_comm_form"),d=(e.data("wmu-type"),e.data("wmu-attachment")),o=new FormData;o.append("action","wmuRemoveAttachmentPreview"),o.append("attachmentId",d),o.append("wmuAttachmentsData",a(".wmu-attachments-data",t).val()),o.append("uniqueId",t.find(".wpdiscuz_unique_id").val()),wpdiscuzAjaxObj.getAjaxObj(!0,!0,o).done(function(d){if(d.success){e.remove();var o=a(".wmu-tabs",t);a.each(o,function(e,t){a(".wmu-preview",t).length?a(t).removeClass("wmu-hide"):a(t).addClass("wmu-hide")}),a(".wmu-attached-data-info",t).remove(),a(".wmu-add-files",t).after(d.data.attachmentsHtml),d.data.tooltip&&a(".wmu-upload-wrap",t).attr("wpd-tooltip",d.data.tooltip)}else d.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[d.data.errorCode],d.data.errorCode,t),"error",3e3):d.data.error&&wpdiscuzAjaxObj.setCommentMessage(d.data.error,"error",3e3);a("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,d){console.log(d),a("#wpdiscuz-loading-bar").fadeOut(250)})}),parseInt(wpdiscuzAjaxObj.wmuIsLightbox)){function e(){a(".wmu-lightbox").colorbox({maxHeight:"95%",maxWidth:"95%",rel:"wmu-lightbox",fixed:!0})}e(),wpdiscuzAjaxObj.wmuAddLightBox=e}wpdiscuzAjaxObj.wmuHideAll=function(e,t){"object"==typeof e?e.success?(a(".wmu-tabs",t).addClass("wmu-hide"),a(".wmu-preview",t).remove(),a(".wmu-attached-data-info",t).remove()):console.log(e.data):console.log(e)}});
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 */
18
- jQuery(document).ready(function(e){var n=0,d=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),t=parseInt(wpdiscuzUCObj.additionalTab);e(document).on("click",".wpd-info,.wpd-page-link,.wpd-delete-content,.wpd-user-email-delete-links",function(e){e.preventDefault()}),e(document).on("click",".wpd-info.wpd-not-clicked",function(n){var a=e(this);a.removeClass("wpd-not-clicked");var i=new FormData;return i.append("action","wpdGetInfo"),i.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce),function(n,a){var i=e(".fas",n),c=i.attr("class");i.removeClass(),i.addClass("fas fa-pulse fa-spinner"),wpdiscuzAjaxObj.getAjaxObj(d||t,!1,a).done(function(d){n.addClass("wpd-not-clicked"),i.removeClass(),i.addClass(c),d&&(e("#wpdUserContentInfo").html(d),e("#wpdUserContentInfo ul.wpd-list .wpd-list-item:first-child").addClass("wpd-active"),e("#wpdUserContentInfo div.wpd-content .wpd-content-item:first-child").addClass("wpd-active"),e("#wpdUserContentInfo").is(":visible")||e("#wpdUserContentInfoAnchor").trigger("click"))})}(a,i),!1}),e(document).on("click",".wpd-list-item",function(){var n=e("input.wpd-rel",this).val();e("#wpdUserContentInfo .wpd-list-item").removeClass("wpd-active"),e("#wpdUserContentInfo .wpd-content-item").removeClass("wpd-active");var a=e(this);if(e("#wpdUserContentInfo #"+n).text().length)a.addClass("wpd-active"),e("#wpdUserContentInfo #"+n).addClass("wpd-active");else{var i=new FormData;i.append("action",a.attr("data-action")),i.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce),i.append("page",0),e("#wpdUserContentInfo #"+n).addClass("wpd-active"),e("#wpdUserContentInfo #"+n).css("text-align","center"),wpdiscuzAjaxObj.getAjaxObj(d||t,!0,i).done(function(d){d&&(e("#wpdUserContentInfo #"+n).css("text-align",""),a.addClass("wpd-active"),e("#wpdUserContentInfo #"+n).html(d)),e("#wpdiscuz-loading-bar").hide()})}}),e(document).on("click",".wpd-page-link.wpd-not-clicked",function(n){var a=e(this);a.removeClass("wpd-not-clicked");var i=a.data("wpd-page"),c=e(".wpd-active .wpd-pagination .wpd-action").val(),o=new FormData;o.append("action",c),o.append("page",i),o.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce),wpdiscuzAjaxObj.getAjaxObj(d||t,!0,o).done(function(n){a.addClass("wpd-not-clicked"),n&&e(".wpd-content-item.wpd-active").html(n),e("#wpdiscuz-loading-bar").hide()})}),e(document).on("click",".wpd-delete-content.wpd-not-clicked",function(){var a=e(this),i=parseInt(a.data("wpd-content-id"));if(!isNaN(i)){var c=a.data("wpd-delete-action");if("wpdDeleteComment"===c&&!confirm(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzUCObj.msgConfirmDeleteComment,"wc_confirm_comment_delete",a)))return!1;if("wpdCancelSubscription"===c&&!confirm(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzUCObj.msgConfirmCancelSubscription,"wc_confirm_cancel_subscription",a)))return!1;if("wpdCancelFollow"===c&&!confirm(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzUCObj.msgConfirmCancelFollow,"wc_confirm_cancel_follow",a)))return!1;var o=e("i",a),s=o.attr("class"),p=e(".wpd-wrapper .wpd-page-number").val(),l=e(".wpd-content-item.wpd-active").children(".wpd-item").length;a.removeClass("wpd-not-clicked"),o.removeClass().addClass("fas fa-pulse fa-spinner"),1===l&&p>0&&(p-=1);var w=new FormData;w.append("id",i),w.append("page",p),w.append("action",c),w.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce),wpdiscuzAjaxObj.getAjaxObj(d||t,!1,w).done(function(d){a.addClass("wpd-not-clicked"),o.removeClass().addClass(s),e(".wpd-content-item.wpd-active").html(d),n=1})}}),e(document).on("click","[data-lity-close]",function(d){e(d.target).is("[data-lity-close]")&&n&&window.location.reload(!0)}),e(document).on("click",".wpd-user-email-delete-links.wpd-not-clicked",function(){var n=e(this);n.removeClass("wpd-not-clicked"),e(".wpd-loading",n).addClass("wpd-show");var a=new FormData;a.append("action","wpdEmailDeleteLinks"),a.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce),wpdiscuzAjaxObj.getAjaxObj(d||t,!1,a).done(function(d){n.addClass("wpd-not-clicked"),e("[data-lity-close]",window.parent.document).trigger("click")})}),e(document).on("click",".wpd-user-settings-button.wpd-not-clicked",function(){var n=e(this);n.removeClass("wpd-not-clicked");var a=n.data("wpd-delete-action");if("deleteCookies"!==a){n.find(".wpd-loading").addClass("wpd-show");var i=new FormData;i.append("action","wpdGuestAction"),i.append("guestAction",a),i.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce),wpdiscuzAjaxObj.getAjaxObj(d||t,!1,i).done(function(d){n.addClass("wpd-not-clicked"),n.find(".wpd-loading").removeClass("wpd-show");try{var t=e.parseJSON(d);n.after(t.message);var a=n.next(".wpd-guest-action-message");a.fadeIn(100).fadeOut(7e3,function(){a.remove(),1===parseInt(t.code)&&(n.parent().remove(),e(".wpd-delete-all-comments").length||e(".wpd-delete-all-subscriptions").length||e(".wpd-delete-all-cookies").parent().addClass("wpd-show"))})}catch(e){console.log(e)}})}else!function(){for(var e=document.cookie.split(";"),n=0;n<e.length;n++){var d=e[n],t=d.indexOf("="),a=t>-1?d.substr(0,t):d;Cookies.remove(a.trim())}location.reload(!0)}()})});
19
  /* Social */
20
- function wpcShareCommentFB(e,s){FB.ui({method:"share",href:e,quote:s},function(e){})}(!parseInt(wpdiscuzAjaxObj.fbUseOAuth2)&&parseInt(wpdiscuzAjaxObj.enableFbLogin)||parseInt(wpdiscuzAjaxObj.enableFbShare))&&wpdiscuzAjaxObj.facebookAppID&&(!function(e,s,n){var o,a=e.getElementsByTagName(s)[0];e.getElementById(n)||((o=e.createElement(s)).id=n,o.src="//connect.facebook.net/en_US/sdk.js",a.parentNode.insertBefore(o,a))}(document,"script","facebook-jssdk"),window.fbAsyncInit=function(){FB.init({appId:wpdiscuzAjaxObj.facebookAppID,cookie:!0,xfbml:!0,version:"v7.0"})}),jQuery(document).ready(function(e){var s;(s=Cookies.get("wpdiscuz_social_login_message"))&&"undefined"!==s&&(Cookies.remove("wpdiscuz_social_login_message"),wpdiscuzAjaxObj.setCommentMessage(decodeURIComponent(s.replace(/\+/g,"%20")),"error")),Cookies.get("wpdiscuz_scroll_to_comments")&&(Cookies.remove("wpdiscuz_scroll_to_comments",{path:"/"}),e("html, body").animate({scrollTop:e("#comments").offset().top-32},1e3)),e(document).on("click",".wpd-comment-share .fa-facebook-f",function(){if(1==wpdiscuzAjaxObj.enableFbShare){var s=e(this).parents(".wpd-comment").find(".wpd-comment-right").attr("id"),n=window.location.href;-1!==n.indexOf("#")&&(n=n.substring(0,n.indexOf("#"))),wpcShareCommentFB(n+="#"+s,e(this).parents(".wpd-comment-right").find(".wpd-comment-text").text())}});var n="";function o(e,s){var n,o="";t(s,1),Cookies.set("wpdiscuz_scroll_to_comments",1,{path:"/"}),"facebook"===e&&0==wpdiscuzAjaxObj.facebookUseOAuth2?FB.getLoginStatus(function(t){"connected"===t.status?(n=t.authResponse.accessToken,o=t.authResponse.userID,a(e,n,o,s)):FB.login(function(t){"connected"===t.status&&(n=t.authResponse.accessToken,o=t.authResponse.userID,a(e,n,o,s))},{scope:"public_profile,email"})}):a(e,n,o,s)}function a(s,n,o,a){return e.ajax({type:"POST",url:wpdiscuzAjaxObj.url,data:{action:"wpd_social_login",provider:s,token:n,userID:o,postID:wpdiscuzAjaxObj.wc_post_id}}).done(function(s){!function(s,n){try{var o=e.parseJSON(s),a=o.code,i=o.message,c=o.url;200===parseInt(a)?location.assign(c):wpdiscuzAjaxObj.setCommentMessage(i,"error")}catch(e){console.log(e)}t(n,0)}(s,a)}),""}function t(e,s){1===s?e.find(".wpdiscuz-social-login-spinner").show():e.find(".wpdiscuz-social-login-spinner").hide()}e(document).on("click","#wpdcom .wpd-social-login .wpdiscuz-login-button",function(){var s=e(this).parents(".wpd-social-login");!function(e,s){1!=parseInt(wpdiscuzAjaxObj.socialLoginAgreementCheckbox)||1==Cookies.get("socialLoginAgreementConfirmed")?o(e,s):s.parents(".wpd-form-wrap, .wpd-form").find(".wpd-social-login-agreement").first().slideDown(700)}(n=function(e){var s="";e.hasClass("wpdsn-fb")&&(s="facebook");e.hasClass("wpdsn-insta")&&(s="instagram");e.hasClass("wpdsn-gg")&&(s="google");e.hasClass("wpdsn-ds")&&(s="disqus");e.hasClass("wpdsn-wp")&&(s="wordpress");e.hasClass("wpdsn-tw")&&(s="twitter");e.hasClass("wpdsn-vk")&&(s="vk");e.hasClass("wpdsn-ok")&&(s="ok");e.hasClass("wpdsn-linked")&&(s="linkedin");e.hasClass("wpdsn-yandex")&&(s="yandex");e.hasClass("wpdsn-mailru")&&(s="mailru");e.hasClass("wpdsn-weixin")&&(s="wechat");e.hasClass("wpdsn-weibo")&&(s="weibo");e.hasClass("wpdsn-qq")&&(s="qq");e.hasClass("wpdsn-baidu")&&(s="baidu");return s}(e(this)),s)}),e(document).on("click","#wpdcom .wpd-agreement-buttons-right .wpd-agreement-button",function(){var s=e(this).parents(".wpd-form-wrap, .wpd-form").find(".wpd-social-login-agreement").slideUp(700);e(this).hasClass("wpd-agreement-button-agree")&&(wpdiscuzAjaxObj.isCookiesEnabled&&Cookies.set("socialLoginAgreementConfirmed",1,{expires:30,path:"/"}),o(n,s))})});
7
  /* Autogrow */
8
  jQuery.fn.autoGrow=function(){return this.each(function(){var createMirror=function(textarea){jQuery(textarea).after('<div class="autogrow-textarea-mirror"></div>');return jQuery(textarea).next(".autogrow-textarea-mirror")[0]};var sendContentToMirror=function(textarea){mirror.innerHTML=String(textarea.value).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n/g,"<br />")+".<br/>.";if(jQuery(textarea).height()!=jQuery(mirror).height())jQuery(textarea).height(jQuery(mirror).height())};var growTextarea=function(){sendContentToMirror(this)};var mirror=createMirror(this);mirror.style.display="none";mirror.style.wordWrap="break-word";mirror.style.padding=jQuery(this).css("padding");mirror.style.width=jQuery(this).css("width");mirror.style.fontFamily=jQuery(this).css("font-family");mirror.style.fontSize=jQuery(this).css("font-size");mirror.style.lineHeight=jQuery(this).css("line-height");this.style.overflow="hidden";this.style.minHeight=this.rows+"em";this.onkeydown=growTextarea;sendContentToMirror(this)})};
9
  /* wpDiscuz */
10
+ var wpdiscuzLoadRichEditor=parseInt(wpdiscuzAjaxObj.loadRichEditor);if(wpdiscuzLoadRichEditor&&document.querySelector(".wpdiscuz-textarea-wrap"))var wpDiscuzEditor=new WpdEditor;function wpdMessagesOnInit(a,b){wpdiscuzAjaxObj.setCommentMessage(a,b),setTimeout(function(){location.href=location.href.substring(0,location.href.indexOf("wpdiscuzUrlAnchor")-1)},3e3)}wpdiscuzAjaxObj.setCommentMessage=function(c,b,d){var a="wpdiscuz-message-error";if(c instanceof Array)for(var e in c)b instanceof Array?"success"===b[e]?a="wpdiscuz-message-success":"warning"===b[e]&&(a="wpdiscuz-message-warning"):"success"===b?a="wpdiscuz-message-success":"warning"===b&&(a="wpdiscuz-message-warning"),jQuery("<div/>").addClass(a).html(c[e]).prependTo("#wpdiscuz-comment-message").delay(d instanceof Array?d[e]:d||4e3).fadeOut(1e3,function(){jQuery(this).remove()});else"success"===b?a="wpdiscuz-message-success":"warning"===b&&(a="wpdiscuz-message-warning"),jQuery("<div/>").addClass(a).html(c).prependTo("#wpdiscuz-comment-message").delay(d||4e3).fadeOut(1e3,function(){jQuery(this).remove()})},wpdiscuzAjaxObj.applyFilterOnPhrase=function(a,b,c){return wpdiscuzAjaxObj.phraseFilters&&jQuery.each(wpdiscuzAjaxObj.phraseFilters,function(d){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[d]]&&(a=wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[d]](a,b,c))}),a},jQuery(document).ready(function($){$("body").addClass("wpdiscuz_"+wpdiscuzAjaxObj.version);var H,c=wpdiscuzAjaxObj.is_user_logged_in,q=1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!c,r=1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&c,e=wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion,s=parseInt(wpdiscuzAjaxObj.commentListLoadType),I=parseInt(wpdiscuzAjaxObj.wc_post_id);wpdiscuzAjaxObj.wpdiscuz_nonce="";var t=parseInt(wpdiscuzAjaxObj.commentListUpdateType),u=1e3*parseInt(wpdiscuzAjaxObj.commentListUpdateTimer),v=parseInt(wpdiscuzAjaxObj.liveUpdateGuests),w=wpdiscuzAjaxObj.loadLastCommentId,J=w,f=parseInt(wpdiscuzAjaxObj.firstLoadWithAjax);Cookies.get("wpdiscuz_comments_sorting")&&Cookies.remove("wpdiscuz_comments_sorting",{path:""}),Cookies.get("wordpress_last_visit")&&Cookies.remove("wordpress_last_visit",{path:""}),Cookies.get("wpdiscuz_last_visit")&&Cookies.remove("wpdiscuz_last_visit",{path:""});var i=parseInt(wpdiscuzAjaxObj.wordpressIsPaginate),K=wpdiscuzAjaxObj.storeCommenterData,L=parseInt(wpdiscuzAjaxObj.wmuEnabled),M=wpdiscuzAjaxObj.isCookiesEnabled,N=!0,g=wpdiscuzAjaxObj.cookiehash,O=parseInt(wpdiscuzAjaxObj.isLoadOnlyParentComments),P=parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0,x=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),j=parseInt(wpdiscuzAjaxObj.enableBubble),y=parseInt(wpdiscuzAjaxObj.bubbleLiveUpdate),k=parseInt(wpdiscuzAjaxObj.bubbleHintTimeout),Q=parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout)?parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout):5,R=parseInt(wpdiscuzAjaxObj.bubbleShowNewCommentMessage),h=wpdiscuzAjaxObj.bubbleLocation,l=wpdiscuzAjaxObj.inlineFeedbackAttractionType,m=parseInt(wpdiscuzAjaxObj.scrollSize),m=m||32,S=[],T=[],U=[],V=!1,z=1,W=$("html").css("scroll-behavior"),X=$("body").css("scroll-behavior");if($(".wc_social_plugin_wrapper .wp-social-login-provider-list").length?$(".wc_social_plugin_wrapper .wp-social-login-provider-list").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):$(".wc_social_plugin_wrapper .the_champ_login_container").length?$(".wc_social_plugin_wrapper .the_champ_login_container").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):$(".wc_social_plugin_wrapper .social_connect_form").length?$(".wc_social_plugin_wrapper .social_connect_form").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):$(".wc_social_plugin_wrapper .oneall_social_login_providers").length&&$(".wc_social_plugin_wrapper .oneall_social_login .oneall_social_login_providers").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"),wpdiscuzLoadRichEditor&&$("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0"),window.addEventListener("beforeunload",function(c){var b=$(".wpd-form").not(":hidden");if(b.length){if(wpdiscuzLoadRichEditor&&document.querySelector(".wpdiscuz-textarea-wrap")){for(var a=0;a<b.length;a++)if("\n"!==wpDiscuzEditor.createEditor($(b[a]).find(".ql-container").attr("id")).getText()){c.preventDefault(),c.returnValue="";return}}else for(var a=0;a<b.length;a++)if($(b[a]).find(".wc_comment").val()){c.preventDefault(),c.returnValue="";return}}}),wpdiscuzLoadRichEditor||($(document).delegate("textarea.wc_comment","input",function(){aD($(this))}),$.each($("textarea.wc_comment"),function(){aD($(this))})),$("body").on("focus","#wpdcom .ql-editor, #wpdcom .wc_comment",function(){$(".wpd-form-foot",$(this).parents(".wpd_comm_form")).slideDown(P)}),$("body").on("focus","#wpdcom textarea",function(){$(this).next(".autogrow-textarea-mirror").length||$(this).autoGrow()}),c||aa({comment_author:Cookies.get("comment_author_"+g),comment_author_email:Cookies.get("comment_author_email_"+g),comment_author_url:Cookies.get("comment_author_url_"+g)}),$(".wpd-vote-down.wpd-dislike-hidden").remove(),$(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd"),$("body").on("click","#wpd-editor-source-code-wrapper-bg",function(){$(this).hide(),$("#wpd-editor-source-code-wrapper").hide(),$("#wpd-editor-uid").val(""),$("#wpd-editor-source-code").val("")}),wpdiscuzLoadRichEditor&&$("body").on("click","#wpd-insert-source-code",function(){var a=wpDiscuzEditor.createEditor("#"+$("#wpd-editor-uid").val());a.deleteText(0,a.getLength(),Quill.sources.USER);var b=$("#wpd-editor-source-code").val();b.length&&a.clipboard.dangerouslyPasteHTML(0,b,Quill.sources.USER),a.update(),$("#wpd-editor-source-code-wrapper-bg").hide(),$("#wpd-editor-source-code-wrapper").hide(),$("#wpd-editor-uid").val(""),$("#wpd-editor-source-code").val("")}),$("body").on("click",".wpd-reply-button",function(){var a=aj($(this),0);$(this).hasClass("wpdiscuz-clonned")?(wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+a).focus()},P):setTimeout(function(){$("#wc-textarea-"+a).trigger("focus")},P),$("#wpd-secondary-form-wrapper-"+a).slideToggle(P)):ah($(this)),function(a){if((q||r)&&"2.0"===e){var b=ak(a);setTimeout(function(){if(!T[b])try{T[b]=grecaptcha.render("wpdiscuz-recaptcha-"+a,{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(b){$("#wpdiscuz-recaptcha-field-"+a).val("key")},"expired-callback":function(){$("#wpdiscuz-recaptcha-field-"+a).val("")}})}catch(c){console.log(c),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+c.message,"error")}},1e3)}}(a)}),$("body").on("click","#wpdcom [data-wpd-clipboard]",function(){var b=$(this).data("wpd-clipboard"),a=$("<input/>");a.appendTo("body").css({position:"absolute",top:"-10000000px"}).val(b),a.trigger("select"),document.execCommand("copy"),a.remove(),wpdiscuzAjaxObj.setCommentMessage(b+"<br/>"+wpdiscuzAjaxObj.wc_copied_to_clipboard,"success",5e3)}),$("body").on("click",".wpdiscuz-nofollow,.wc_captcha_refresh_img,.wpd-load-more-submit",function(a){a.preventDefault()}),$("body").on("click",".wpd-toggle.wpd_not_clicked",function(){var a=$(this);a.removeClass("wpd_not_clicked");var b=aj($(this),0),c=$(this),d=$(".fas",c);!c.parents(".wpd-comment:not(.wpd-reply)").children(".wpd-reply").length&&O?aw(b,a):$("#wpd-comm-"+b+"> .wpd-reply").slideToggle(700,function(){$(this).is(":hidden")?(d.removeClass("fa-chevron-up"),d.addClass("fa-chevron-down"),c.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_show_replies_text),c.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_show_replies_text)):(d.removeClass("fa-chevron-down"),d.addClass("fa-chevron-up"),c.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),c.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text)),a.addClass("wpd_not_clicked")})}),$("body").on("mouseenter",".wpd-new-loaded-comment",function(){$(this).removeClass("wpd-new-loaded-comment")}),$("body").on("click",".wpd-sbs-toggle",function(){$(".wpdiscuz-subscribe-bar").slideToggle(P)}),parseInt(wpdiscuzAjaxObj.wpDiscuzIsShowOnSubscribeForm)&&!c&&wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&$("#wpdiscuz-subscribe-form").length&&("2.0"===e?(setTimeout(function(){try{grecaptcha.render("wpdiscuz-recaptcha-subscribe-form",{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(a){$("#wpdiscuz-recaptcha-field-subscribe-form").val("key")},"expired-callback":function(){$("#wpdiscuz-recaptcha-field-subscribe-form").val("")}})}catch(a){console.log(a),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+a.message,"error")}},1e3),$("body").on("submit","#wpdiscuz-subscribe-form",function(a){$("#wpdiscuz-recaptcha-field-subscribe-form").val()?$(".wpdiscuz-recaptcha",$(this)).css("border","none"):($(".wpdiscuz-recaptcha",$(this)).css("border","1px solid red"),a.preventDefault())})):"3.0"===e&&$("body").on("click","#wpdiscuz_subscription_button",function(b){var c=$(this).parents("#wpdiscuz-subscribe-form");b.preventDefault();try{grecaptcha.ready(function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/wpdAddSubscription"}).then(function(a){console.log(5555),document.getElementById("wpdiscuz-recaptcha-field-subscribe-form").value=a,c.trigger("submit")},function(a){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(a)})})}catch(a){console.log(a),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+a.message,"error")}})),(q||r)&&"2.0"===e){var A=$(window).width(),a=$("#wpdcom").width();a>=1100&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"65%"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"35%"})),a>=940&&a<1100&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"60%"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"40%"})),a>=810&&a<940&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"40%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"60%"})),a>=730&&a<810&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"45%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"55%"})),a>=610&&a<730&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.85)","-webkit-transform":"scale(0.85)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"43%"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"55%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"30%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"70%"})),A>650&&(a>=510&&a<610&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"center 0","-webkit-transform-origin":"center 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"35%"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"63%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"30%",position:"relative",right:"-60px"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"70%"}),$("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"})),a>=470&&a<510&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"center 0","-webkit-transform-origin":"center 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"40%"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"60%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({float:"none",width:"100%",display:"block"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({float:"none",width:"100%",display:"block"}),$("#wpdcom .wpd_main_comm_form .wc-form-footer").css({"margin-left":"0px"}),$("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"})),a<470&&($("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({margin:"0px auto","transform-origin":"center 0","-webkit-transform-origin":"center 0"}),$("#wpdcom .wpd-form-col-left").css({float:"none",width:"100%",display:"block"}),$("#wpdcom .wpd-form-col-right").css({float:"none",width:"100%",display:"block"}),$("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"}),$("#wpdcom .wpd-secondary-form-wrapper .wc_notification_checkboxes").css({"text-align":"center"}),$("#wpdcom .wpd-secondary-form-wrapper .wc-field-submit").css({"text-align":"center"})))}function Y(b,a,c){G(x||L,!1,a).done(function(a){if($(c).addClass("wpd_not_clicked"),"object"==typeof a){if(a.success){"collapsed"===wpdiscuzAjaxObj.commentFormView&&$(".wpd-form-foot",b).slideUp(P),a.data.wc_all_comments_count_new=parseInt(a.data.wc_all_comments_count_new),$(".wpd-thread-info").html(a.data.wc_all_comments_count_before_threads_html),$(".wpd-thread-info").attr("data-comments-count",a.data.wc_all_comments_count_new),$("#wpd-bubble-all-comments-count").replaceWith(a.data.wc_all_comments_count_bubble_html);var d=P;a.data.is_main?az(a.data.message):(d=P+700,$("#wpd-secondary-form-wrapper-"+a.data.uniqueid).slideToggle(700),1==a.data.is_in_same_container?$("#wpd-secondary-form-wrapper-"+a.data.uniqueid).after(a.data.message):$("#wpd-comm-"+a.data.uniqueid).after(a.data.message)),Z(a),_(a),M&&N?ab(a.data):N||$(".wpd-cookies-checkbox").prop("checked",!1),b.get(0).reset(),wpdiscuzLoadRichEditor?wpDiscuzEditor.createEditor("#wpd-editor-"+$(".wpdiscuz_unique_id",b).val()).setContents([{insert:"\n"}]):aD(b.find(".wc_comment")),aa(a.data),$(".wmu-preview-wrap",b).remove(),ay(),parseInt(wpdiscuzAjaxObj.scrollToComment)&&setTimeout(function(){au(),$("html, body").animate({scrollTop:$("#comment-"+a.data.new_comment_id).offset().top-m},1e3,av)},d),aE(a,b)}else a.data&&(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,b),"error"),aE(a,b))}else wpdiscuzAjaxObj.setCommentMessage(a,"error");$("#wpdiscuz-loading-bar").fadeOut(250),V=!1}).fail(function(b,d,a){console.log(a),$(c).addClass("wpd_not_clicked"),$("#wpdiscuz-loading-bar").fadeOut(250)})}function Z(b){if(!b.data.held_moderate){var a=new FormData;a.append("action","wpdCheckNotificationType"),a.append("comment_id",b.data.new_comment_id),a.append("email",b.data.comment_author_email),a.append("isParent",b.data.is_main),G(x,!0,a)}}function _(a){if(a.data.redirect>0&&a.data.new_comment_id){var b=new FormData;b.append("action","wpdRedirect"),b.append("commentId",a.data.new_comment_id),G(x,!0,b).done(function(a){"object"==typeof a&&a.success&&setTimeout(function(){location.href=a.data},2e3)}).fail(function(b,c,a){console.log(a)})}}function aa(a){$(".wpd_comm_form .wc_name").val(a.comment_author),a.comment_author_email&&0>a.comment_author_email.indexOf("@example.com")&&$(".wpd_comm_form .wc_email").val(a.comment_author_email),a.comment_author_url&&$(".wpd_comm_form .wc_website").val(a.comment_author_url)}function ab(b){var c=b.comment_author_email,d=b.comment_author,a=b.comment_author_url;null==K?(Cookies.set("comment_author_email_"+g,c),Cookies.set("comment_author_"+g,d),a.length&&Cookies.set("comment_author_url_"+g,a)):(K=parseInt(K),Cookies.set("comment_author_email_"+g,c,{expires:K,path:"/"}),Cookies.set("comment_author_"+g,d,{expires:K,path:"/"}),a.length&&Cookies.set("comment_author_url_"+g,a,{expires:K,path:"/"})),$(".wpd-cookies-checkbox").length&&$(".wpd-cookies-checkbox").prop("checked",!0)}function ac(a,b){$("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").show(),$("#wpd-comm-"+a+" .wpdiscuz-edit-form-wrap").replaceWith(b),$("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-last-edited").show()}$("body").on("click",".wc_comm_submit.wpd_not_clicked",function(){var d=$(this),f=1,a=$(this).parents("form");if("true"===a.attr("data-uploading")){wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhraseDoingUpload,"wmuPhraseDoingUpload",a),"warning");return}if(a.hasClass("wpd_main_comm_form")||(f=an($(this).parents(".wpd-comment"))),as(a,"#wpd-editor-"+$(".wpdiscuz_unique_id",a).val()),a.on("submit",function(a){a.preventDefault()}),""===$(".wc_comment",a).val().trim()){wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wc_msg_required_fields,"wc_msg_required_fields",a),"error");return}if(a[0].checkValidity()&&(h=a,i=!0,"2.0"===e&&$("input[name=wc_captcha]",h).length&&!$("input[name=wc_captcha]",h).val().length?(i=!1,$(".wpdiscuz-recaptcha",h).css("border","1px solid red")):"2.0"===e&&$("input[name=wc_captcha]",h).length&&$(".wpdiscuz-recaptcha",h).css("border","none"),i)){V=!0,ax(a),$(d).removeClass("wpd_not_clicked");var h,i,b=new FormData;if(b.append("action","wpdAddComment"),$(":input",a).each(function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&b.append(this.name+"",$(this).val().trim()),("checkbox"==this.type||"radio"==this.type)&&$(this).is(":checked")&&b.append(this.name+"",$(this).val())}),b.append("wpd_comment_depth",f),wpdiscuzAjaxObj.wpdiscuz_zs&&b.append("wpdiscuz_zs",wpdiscuzAjaxObj.wpdiscuz_zs),$(".wpd-cookies-checkbox",a).length?$(".wpd-cookies-checkbox",a).prop("checked")||(N=!1):c&&(N=!1),$("#wpdiscuz-loading-bar").show(),wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&"3.0"===e&&(1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!wpdiscuzAjaxObj.is_user_logged_in||1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&wpdiscuzAjaxObj.is_user_logged_in))try{grecaptcha.ready(function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/addComment"}).then(function(c){b.append("g-recaptcha-response",c),Y(a,b,d)},function(a){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(a)})})}catch(g){console.log(g),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+g.message,"error"),$("#wpdiscuz-loading-bar").fadeOut(250)}else Y(a,b,d)}(function(a){if((q||r)&&"2.0"===e){var b=ak(a);grecaptcha.reset(T[b])}})($(".wpdiscuz_unique_id",a).val()),ar()}),$("body").on("click",".wpd_editable_comment",function(){H&&$(".wpdiscuz-edit-form-wrap").length&&ac(aj($(".wpdiscuz-edit-form-wrap"),0),H);var c=$(this),b=aj(c,0),d=ak(b),a=new FormData;a.append("action","wpdEditComment"),a.append("commentId",d),H=$("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-text").get(0),G(x,!0,a).done(function(a){if("object"==typeof a){if(a.success){if($("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text").replaceWith(a.data.html),wpdiscuzLoadRichEditor){var d=wpDiscuzEditor.createEditor("#wpd-editor-edit_"+b);d.clipboard.dangerouslyPasteHTML(0,a.data.content),d.update(),$(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd")}else $("#wc-textarea-edit_"+b).val(a.data.content),aD($("#wc-textarea-edit_"+b));$("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").hide(),$("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-last-edited").hide()}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,c),"error")}else console.log(a);$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("click",".wc_save_edited_comment",function(){var d=$(this),b=aj(d),e=ak(b),a=$("#wpd-comm-"+b+" #wpdiscuz-edit-form");if(as(a,"#wpd-editor-edit_"+b),a.on("submit",function(a){a.preventDefault()}),a[0].checkValidity()){var c=new FormData;c.append("action","wpdSaveEditedComment"),c.append("commentId",e),$(":input",a).each(function(){""!==this.name&&"checkbox"!==this.type&&"radio"!==this.type&&c.append(this.name+"",$(this).val()),("checkbox"===this.type||"radio"===this.type)&&$(this).is(":checked")&&c.append(this.name+"",$(this).val())}),G(x,!0,c).done(function(a){"object"==typeof a?(a.success?(ac(b,a.data.message),a.data.lastEdited&&($("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-last-edited").remove(),$(a.data.lastEdited).insertAfter("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text")),a.data.twitterShareLink&&$("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_tw").attr("href",a.data.twitterShareLink),a.data.whatsappShareLink&&$("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_whatsapp").attr("href",a.data.whatsappShareLink),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+b)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,d),"error"),aE(a,e)):console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}}),$("body").on("click",".wc_cancel_edit",function(){var a=aj($(this));ac(a,H),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+a)}),!i&&f&&(z=0,1==f?setTimeout(function(){ae(!0)},500):$("body").on("click",".wpd-load-comments",function(){$(this).parent(".wpd-load-more-submit-wrap").remove(),ae(!0)})),$("body").on("click",".wpd-load-more-submit",function(){var a=$(this),b="wpd-loaded";a.hasClass(b)&&ae(!1,a,b,"wpd-loading")});var ad=!1;function B(){var a=document.getElementById("wpdiscuzHasMoreComments"),b=0;a&&(b=a.dataset.is_show_load_more);var c=document.getElementById("wpdcom")?document.getElementById("wpdcom").clientHeight:0,d=$(window).height()+$(window).scrollTop();c&&d&&100*d/c>=80&& !1===ad&&1==b&&(ad=!0,ae(!1,$(".wpd-load-more-submit")))}function ae(c,b,e,g){b&&(b.toggleClass(e),b.toggleClass(g));var a=new FormData;a.append("action","wpdLoadMoreComments");var d=$(".wpdiscuz-sort-button-active").attr("data-sorting");d&&a.append("sorting",d),a.append("offset",z),a.append("lastParentId",al()),a.append("isFirstLoad",c?1:0);var h=$(".wpdf-active").attr("data-filter-type");a.append("wpdType",h||""),G(x,!c||1!=f,a).done(function(a){"object"==typeof a&&a.success&&(z++,c&&$(".wpd-comment").remove(),$(".wpdiscuz_single").remove(),$(".wpdiscuz-comment-pagination").before(a.data.comment_list),C(a,c&&2!==s),ad=!1,a.data.loadLastCommentId&&(w=a.data.loadLastCommentId),aE(a),c&&D(!1)),$("#wpdiscuz-loading-bar").fadeOut(250),$(".wpd-load-more-submit").blur(),b&&(b.toggleClass(e),b.toggleClass(g))}).fail(function(c,d,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250),$(".wpd-load-more-submit").blur(),b&&(b.toggleClass(e),b.toggleClass(g))})}function C(a,d){var b=document.getElementById("wpdiscuzHasMoreComments");if(!1==a.data.is_show_load_more)b&&(b.dataset.is_show_load_more=0),$(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide();else if(am(a.data.last_parent_id),b&&(b.dataset.is_show_load_more=1),d&&$(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").show(),a.data.comments_left>0){if(!$(".wpd-load-more-submit .wpd-comments-left").length){let c=$("<span>");c.addClass("wpd-comments-left"),$(".wpd-load-more-submit").append(c)}$(".wpd-load-more-submit .wpd-comments-left").text(a.data.comments_left_text)}aE(a)}function D(d){var b=location.href.match(/#comment\-(\d+)/);if(null!==b){var c=b[1];if($("#comment-"+c).length)setTimeout(function(){au(),$("html, body").animate({scrollTop:$("#comment-"+c).parents("[id^=wpd-comm-]").offset().top-m},1e3,av),d&&af(c)},500);else{var a=new FormData;a.append("action","wpdGetSingleComment"),a.append("commentId",c),G(x,!0,a).done(function(a){if("object"==typeof a&&a.success){var b="#comment-"+c;$("#comment-"+a.data.parentCommentID).length?$("#comment-"+a.data.parentCommentID).parents("[id^=wpd-comm-"+a.data.parentCommentID+"]").replaceWith(a.data.message):$(".wpd-thread-list").prepend(a.data.message),aE(a),au(),$("html, body").animate({scrollTop:$(b).offset().top-m},1e3,av),d&&af(c)}$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}}}function af(a){setTimeout(function(){$("#comment-"+a).siblings(".wpd-secondary-form-wrapper").is(":visible")||$("#comment-"+a).find(".wpd-reply-button").trigger("click")},1100)}function ag(b){if(void 0!==b.data.message)for(var c,d=b.data.message,a=0;a<d.length;a++)ap((c=d[a]).comment_parent,c.comment_html)}function ah(b){var a=aj(b,0);$("#wpdiscuz_form_anchor-"+a).before(ai(a));var d=$("#wpd-secondary-form-wrapper-"+a);c||aa({comment_author:Cookies.get("comment_author_"+g),comment_author_email:Cookies.get("comment_author_email_"+g),comment_author_url:Cookies.get("comment_author_url_"+g)}),wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+a).focus()},P):setTimeout(function(){$("#wc-textarea-"+a).trigger("focus")},P),d.slideToggle(P,function(){b.addClass("wpdiscuz-clonned")})}function ai(a){return $("#wpdiscuz_hidden_secondary_form").html().replace(/wpdiscuzuniqueid/g,a)}function aj(a,c){var b="";return(b=c?a.parents(".wpd-main-form-wrapper").attr("id"):a.parents(".wpd-comment").attr("id")).substring(b.lastIndexOf("-")+1)}function ak(a){return a.substring(0,a.indexOf("_"))}function al(){return $(".wpd-load-more-submit").attr("data-lastparentid")}function am(a){$(".wpd-load-more-submit").attr("data-lastparentid",a),2!==s&&$(".wpdiscuz-comment-pagination").show()}function an(a){var b=a.attr("class").split(" "),c="";return $.each(b,function(b,a){"wpd_comment_level"===ao(a,!1)&&(c=ao(a,!0))}),parseInt(c)+1}function ao(a,b){return b?a.substring(a.indexOf("-")+1):a.substring(0,a.indexOf("-"))}function ap(a,b){if(0==a)az(b);else{var c=aj($("#comment-"+a),0);$("#wpdiscuz_form_anchor-"+c).after(b)}}function aq(){var a=[];return $(".wpd-comment-right").each(function(){a.push(ak(aj($(this),0)))}),a.join(",")}function ar(){$(".wpdiscuz_reset").val("")}function as(a,b){var c=a.find(".wpd-required-group");wpdiscuzLoadRichEditor&&a.find(".wc_comment").val($(b+">.ql-editor").html()),at(a),$.each(c,function(){$("input",this).prop("required",!1),0===$("input:checked",this).length?$("input",$(this)).prop("required",!0):$(".wpd-field-invalid",this).remove()})}function at(c){var b=c.find(".wc_comment"),a=b.val().trim().replace(/<p><br><\/p>/g,"\n").replace(/<p>(.*?)<\/p>/g,"$1\n");a=(a=(a=(a=a.replace(/<img src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img[^>]+alt=["|']([^"|']+)["|'][^>]+src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'][^>]?>/g," $1 ")).replace(/<img\s+([^>]*)class=["|']wpdem\-sticker["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img\s+([^>]*)src=["|']([^"|']+)["|'](.*?)[^>]*>/g," $2 "),b.val(a)}function au(){$("html, body").css("scroll-behavior","unset")}function av(){$("html").css("scroll-behavior",W),$("body").css("scroll-behavior",X)}function aw(b,d){var c=ak(b),a=new FormData;a.append("action","wpdShowReplies"),a.append("commentId",c),G(x,!0,a).done(function(a){d.addClass("wpd_not_clicked"),"object"==typeof a&&a.success&&($("#wpd-comm-"+b).replaceWith(a.data.comment_list),$("#wpd-comm-"+b+" .wpd-toggle .fas").removeClass("fa-chevron-down").addClass("fa-chevron-up"),$("#wpd-comm-"+b+" .wpd-toggle .wpd-view-replies .wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),$("#wpd-comm-"+b+" .wpd-toggle").attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text),aE(a)),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),d.addClass("wpd_not_clicked"),$("#wpdiscuz-loading-bar").fadeOut(250)})}function ax(a){$(".wpd-agreement-checkbox",a).each(function(){$(this).hasClass("wpd_agreement_hide")&&M&&$(this).prop("checked")&&(Cookies.set($(this).attr("name")+"_"+g,1,{expires:30,path:"/"}),$("input[name="+$(this).attr("name")+"]").each(function(){S.push($(this))}))})}function ay(){S.length&&(S.forEach(function(a){a.parents(".wpd-field-checkbox").remove()}),S=[])}function az(a){$(".wpd-sticky-comment").last()[0]?$(a).insertAfter($(".wpd-sticky-comment").last()[0]):$(".wpd-thread-list").prepend(a)}function E(a){a?a.prop("required")||(a.val()?a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none")):$.each($(".wc_email"),function(c,b){var a=$(b);a.prop("required")||(a.val()?a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none"))})}if(2!==s||i||($(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide(),B(),$(window).scroll(function(){B()})),wpdiscuzAjaxObj.setLoadMoreVisibility=C,$("body").on("click",".wpd-vote-up.wpd_not_clicked, .wpd-vote-down.wpd_not_clicked",function(){var b,c=$(this);$(c).removeClass("wpd_not_clicked");var d=aj(c),e=ak(d);b=$(this).hasClass("wpd-vote-up")?1:-1;var a=new FormData;a.append("action","wpdVoteOnComment"),a.append("commentId",e),a.append("voteType",b),G(x,!0,a).done(function(a){if($(c).addClass("wpd_not_clicked"),"object"==typeof a){if(a.success){if("total"===a.data.buttonsStyle){var d=$(".wpd-comment-footer .wpd-vote-result",$("#comment-"+e)),h=a.data.votes;d.text(a.data.votesHumanReadable),d.attr("title",h),d.removeClass("wpd-up wpd-down"),h>0&&d.addClass("wpd-up"),h<0&&d.addClass("wpd-down")}else{var f=$(".wpd-comment-footer .wpd-vote-result-like",$("#comment-"+e)),g=$(".wpd-comment-footer .wpd-vote-result-dislike",$("#comment-"+e));f.text(a.data.likeCountHumanReadable),f.attr("title",a.data.likeCount),g.text(a.data.dislikeCountHumanReadable),g.attr("title",a.data.dislikeCount),parseInt(a.data.likeCount)>0?f.addClass("wpd-up"):f.removeClass("wpd-up"),0>parseInt(a.data.dislikeCount)?g.addClass("wpd-down"):g.removeClass("wpd-down")}var i=$(".wpd-comment-footer .wpd-vote-up",$("#comment-"+e)),j=$(".wpd-comment-footer .wpd-vote-down",$("#comment-"+e));i.removeClass("wpd-up"),j.removeClass("wpd-down"),a.data.curUserReaction>0?i.addClass("wpd-up"):a.data.curUserReaction<0&&j.addClass("wpd-down")}else a.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,c),"error");aE(a,e,b)}else console.log(a);$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,d,a){console.log(a),$(c).addClass("wpd_not_clicked"),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$(document).on("click","body",function(b){var a=$(".wpdiscuz-sort-buttons");$(b.target).hasClass("wpdf-sorting")||$(b.target).parent().hasClass("wpdf-sorting")?a.css({display:a.is(":visible")?"none":"flex"}):a.hide()}),$("body").on("click",".wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)",function(){var c=$(this),b=$(this).attr("data-sorting");if(b){$(".wpdiscuz-sort-button.wpdiscuz-sort-button-active").removeClass("wpdiscuz-sort-button-active").appendTo(".wpdiscuz-sort-buttons"),c.addClass("wpdiscuz-sort-button-active").prependTo(".wpdf-sorting");var a=new FormData;a.append("action","wpdSorting"),a.append("sorting",b);var d=$(".wpdf-active").attr("data-filter-type");a.append("wpdType",d||""),G(x,!0,a).done(function(a){"object"==typeof a&&a.success&&($("#wpdcom .wpd-comment").remove(),$("#wpdcom .wpd-thread-list").prepend(a.data.message),C(a,!1),z=1),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}}),window.onhashchange=function(){D(!1)},1!=f&&D(!1),$("body").on("click",".wpdiscuz-readmore",function(){var b=aj($(this)),c=ak(b),a=new FormData;a.append("action","wpdReadMore"),a.append("commentId",c),G(x,!0,a).done(function(a){"object"==typeof a?(a.success?($("#comment-"+c+" .wpd-comment-text").replaceWith(" "+a.data.message),$("#wpdiscuz-readmore-"+b).remove()):console.log(a.data),aE(a)):console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("change",".wpd-required-group",function(){0!==$("input:checked",this).length?$("input",$(this)).prop("required",!1):$("input",$(this)).prop("required",!0)}),$("body").on("click",".wpdiscuz-spoiler",function(){$(this).next().slideToggle(),$(this).hasClass("wpdiscuz-spoiler-closed")?$(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-plus").removeClass("fa-plus").addClass("fa-minus"):$(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-minus").removeClass("fa-minus").addClass("fa-plus"),$(this).toggleClass("wpdiscuz-spoiler-closed")}),$("body").on("click",".wpd-tools i",function(){var a=$(this).siblings(".wpd-tools-actions");a.is(":visible")||$(this).parents(".wpd-comment-right").attr("id")!==$("[id^=comment-]","#wpdcom").last().attr("id")||$("#comments").css({paddingBottom:"160px"}),a.css({display:a.is(":visible")?"none":"flex"})}),$("body").on("mouseleave",".wpd-comment-right",function(){$(this).find(".wpd-tools-actions").hide(),$("#comments").css({paddingBottom:"0"})}),$("body").on("click",".wpd_stick_btn",function(){var b=aj($(this),0),c=ak(b),a=new FormData;a.append("action","wpdStickComment"),a.append("commentId",c),G(x,!0,a).done(function(a){"object"==typeof a&&a.success&&location.reload(!0),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("click",".wpd_close_btn",function(){var b=aj($(this),0),c=ak(b),a=new FormData;a.append("action","wpdCloseThread"),a.append("commentId",c),G(x,!0,a).done(function(a){"object"==typeof a&&a.success&&location.reload(!0),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("click",".wpd-filter.wpd_not_clicked[data-filter-type]",function(){var b=$(this),c=b.attr("data-filter-type");wpdiscuzAjaxObj.resetActiveFilters(".wpdf-"+c),b.removeClass("wpd_not_clicked"),$(".fas",b).addClass("fa-pulse fa-spinner");var a=new FormData;a.append("action","wpdLoadMoreComments");var d=$(".wpdiscuz-sort-button-active").attr("data-sorting");d&&a.append("sorting",d),a.append("lastParentId",0),a.append("offset",0),z=1,a.append("wpdType",b.hasClass("wpdf-active")?"":c),a.append("isFirstLoad",1),$(this).hasClass("wpdf-inline")?$(this).hasClass("wpdf-active")?$(".wpd-comment-info-bar").hide():$(".wpd-comment-info-bar").css("display","flex"):$(".wpd-comment-info-bar").hide(),G(x,!1,a).done(function(a){b.addClass("wpd_not_clicked"),$(".fas",b).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(b.toggleClass("wpdf-active"),$(".wpd-load-comments").remove(),$(".wpd-comment").remove(),$(".wpd-thread-list").prepend(a.data.comment_list),C(a),w=a.data.loadLastCommentId,$(".wpd-load-more-submit").blur(),aE(a)),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("click",".wpdf-reacted.wpd_not_clicked",function(){var a=$(this);a.removeClass("wpd_not_clicked"),$(".fas",a).addClass("fa-pulse fa-spinner");var b=new FormData;b.append("action","wpdMostReactedComment"),G(x,!1,b).done(function(b){a.addClass("wpd_not_clicked"),$(".fas",a).removeClass("fa-pulse fa-spinner"),"object"==typeof b&&b.success&&($("#comment-"+b.data.parentCommentID).length?$("#comment-"+b.data.parentCommentID).parents("[id^=wpd-comm-"+b.data.parentCommentID+"]").replaceWith(b.data.message):$("#comment-"+b.data.commentId).length||$(".wpd-thread-list").prepend(b.data.message),aE(b),au(),$("html, body").animate({scrollTop:$("#comment-"+b.data.commentId).offset().top-m},1e3,av))}).fail(function(c,d,b){console.log(b),$(".fas",a).removeClass("fa-pulse fa-spinner")})}),$("body").on("click",".wpdf-hottest.wpd_not_clicked",function(){var a=$(this);a.removeClass("wpd_not_clicked"),$(".fas",a).addClass("fa-pulse fa-spinner");var b=new FormData;b.append("action","wpdHottestThread"),G(x,!1,b).done(function(b){a.addClass("wpd_not_clicked"),$(".fas",a).removeClass("fa-pulse fa-spinner"),"object"==typeof b&&b.success&&($("#comment-"+b.data.commentId).length?$("#comment-"+b.data.commentId).parents("[id^=wpd-comm-"+b.data.commentId+"]").replaceWith(b.data.message):$(".wpd-thread-list").prepend(b.data.message),aE(b),au(),$("html, body").animate({scrollTop:$("#comment-"+b.data.commentId).offset().top-m},1e3,av))}).fail(function(c,d,b){console.log(b),$(".fas",a).removeClass("fa-pulse fa-spinner")})}),$("body").on("click",".wpd-filter-view-all",function(){$(".wpdf-inline.wpdf-active.wpd_not_clicked").trigger("click")}),$("body").on("click",".wpd-follow-link.wpd_not_clicked",function(){var a=$(this);a.removeClass("wpd_not_clicked"),$(".fas",a).addClass("fa-pulse fa-spinner");var c=aj(a,0),d=ak(c),b=new FormData;b.append("action","wpdFollowUser"),b.append("commentId",d),G(x,!0,b).done(function(b){a.addClass("wpd_not_clicked"),"object"==typeof b?b.success?(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[b.data.code],b.data.code,a),"success"),a.removeClass("wpd-follow-active"),b.data.followTip&&a.attr("wpd-tooltip",b.data.followTip),b.data.followClass&&a.addClass(b.data.followClass),aE(b)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[b.data],b.data,a),"error"):console.log(b),$(".fas",a).removeClass("fa-pulse fa-spinner"),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(c,d,b){console.log(b),$(".fas",a).removeClass("fa-pulse fa-spinner"),$("#wpdiscuz-loading-bar").fadeOut(250)})}),E(),$("body").on("keyup",".wc_email",function(){E($(this))}),j&&$("#wpdcom").length){if($("#wpd-bubble-wrapper").hover(function(){$(this).addClass("wpd-bubble-hover")},function(){$(this).removeClass("wpd-bubble-hover")}),k&&!Cookies.get(wpdiscuzAjaxObj.cookieHideBubbleHint)&&setTimeout(function(){$("#wpd-bubble-wrapper").addClass("wpd-bubble-hover"),Cookies.set(wpdiscuzAjaxObj.cookieHideBubbleHint,"1",{expires:7,path:"/"}),setTimeout(function(){$("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")},1e3*Q)},1e3*k),"content_left"===h){if($(".entry-content").length){var b=Math.min($(".entry-content").offset().left,$("#wpdcom").offset().left)-120,d=b>25?b:25;$("#wpd-bubble-wrapper").css({left:d+"px"}),$("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if($(".post-entry").length){var b=Math.min($(".post-entry").offset().left,$("#wpdcom").offset().left)-120,d=b>25?b:25;$("#wpd-bubble-wrapper").css({left:d+"px"}),$("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if($(".container").length){var b=Math.min($(".container").offset().left,$("#wpdcom").offset().left)-120,d=b>25?b:25;$("#wpd-bubble-wrapper").css({left:d+"px"}),$("#wpd-bubble-wrapper").addClass("wpd-left-content")}else $("#wpd-bubble-wrapper").css({left:"25px"}),$("#wpd-bubble-wrapper").addClass("wpd-left-corner")}else"left_corner"===h?($("#wpd-bubble-wrapper").css({left:"25px"}),$("#wpd-bubble-wrapper").addClass("wpd-left-corner")):"right_corner"===h&&($("#wpd-bubble-wrapper").css({right:"25px"}),$("#wpd-bubble-wrapper").addClass("wpd-right-corner"));$("#wpd-bubble-wrapper").show(),$("body").on("click","#wpd-bubble-add-message-close",function(a){a.preventDefault(),a.stopPropagation(),$("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")}),$("body").on("click","#wpd-bubble",function(){au(),$("#tab-title-reviews").length&&$("#tab-title-reviews a").trigger("click"),$("html, body").animate({scrollTop:$("#wpdcom").offset().top-(m+28)},1e3,function(){av(),$("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover"),wpdiscuzLoadRichEditor?$("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0").focus():$("#wc-textarea-0_0").length&&$("#wc-textarea-0_0").trigger("focus")})}),$("body").on("click","#wpd-bubble-comment-close",function(a){a.preventDefault(),$("#wpd-bubble-notification-message").hide(),$("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")}),$("body").on("click","#wpd-bubble-comment-reply-link a",function(){var a=$(this).attr("href");setTimeout(function(){$("#wpd-bubble-notification-message").hide(),$("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),D(!0);var b=a.match(/#comment\-(\d+)/);U=U.filter(function(a){return a!=b[1]}),$("#wpd-bubble-count .wpd-new-comments-count").text(U.length),0==U.length&&$("#wpd-bubble-count").removeClass("wpd-new-comments")},100)}),$("body").on("click","#wpd-bubble-count",function(){if(U.length){var a=new FormData;a.append("action","wpdBubbleUpdate"),a.append("newCommentIds",U.join()),G(x,!0,a).done(function(a){"object"==typeof a&&a.success&&(a.data.message=a.data.message.filter(function(a){if(!$("#comment-"+a.comment_id).length)return a}),ag(a),$("#wpd-bubble-count").removeClass("wpd-new-comments"),$("#wpd-bubble-count .wpd-new-comments-count").text("0"),U=[],$(".wpd-new-loaded-comment").length&&(au(),$("html, body").animate({scrollTop:$($(".wpd-new-loaded-comment")[0]).offset().top-(m+28)},1e3,av)),aE(a)),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a)})}})}function F(){$.ajax({type:"GET",url:wpdiscuzAjaxObj.bubbleUpdateUrl,beforeSend:function(a){a.setRequestHeader("X-WP-Nonce",wpdiscuzAjaxObj.restNonce)},data:{postId:I,lastId:J,visibleCommentIds:aq()}}).done(function(a){if(!V){if("object"==typeof a){if(a.commentIDsToRemove.forEach(function(a){$("[id^=wpd-comm-"+a+"]").remove()}),a.ids.length){if(t){var b;(b=new FormData).append("action","wpdUpdateAutomatically"),b.append("loadLastCommentId",w),b.append("visibleCommentIds",aq()),G(x,!1,b).done(function(a){!V&&"object"==typeof a&&a.success&&(ag(a),a.data.wc_all_comments_count_new=parseInt(a.data.wc_all_comments_count_new),$(".wpd-thread-info").html(a.data.wc_all_comments_count_before_threads_html),$(".wpd-thread-info").attr("data-comments-count",a.data.wc_all_comments_count_new),$("#wpd-bubble-all-comments-count").replaceWith(a.data.wc_all_comments_count_bubble_html),w=a.data.loadLastCommentId)}).fail(function(b,c,a){console.log(a)})}a.ids=a.ids.filter(function(a){if(!$("#comment-"+a).length)return a});var c=5e3;J=parseInt(a.ids[a.ids.length-1]),U=U.concat(a.ids),R&&a.commentText&&($("#wpd-bubble-author-avatar").html(a.avatar),$("#wpd-bubble-author-name").html(a.authorName),$("#wpd-bubble-comment-date span").html(a.commentDate),$("#wpd-bubble-comment-text").html(a.commentText),$("#wpd-bubble-comment-reply-link a").attr("href",a.commentLink),$("#wpd-bubble-notification-message").show(),c=1e4);var d=parseInt($(".wpd-new-comments-count").text());d+=a.ids.length,$("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),$("#wpd-bubble-wrapper").addClass("wpd-new-comment-added"),setTimeout(function(){$("#wpd-bubble-notification-message").hide(),$("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")},c),$(".wpd-new-comments-count").text(d),$("#wpd-bubble-count").addClass("wpd-new-comments")}a.all_comments_count=parseInt(a.all_comments_count),$("#wpd-bubble-all-comments-count").replaceWith(a.all_comments_count_bubble_html),$(".wpd-reviews-tab").length||($(".wpd-thread-info").html(a.all_comments_count_before_threads_html),$(".wpd-thread-info").attr("data-comments-count",a.all_comments_count))}else console.log(a)}setTimeout(F,u)}).fail(function(b,c,a){console.log(a),setTimeout(F,u)})}if((j&&y||t)&&(c|| !c&&v)&&setTimeout(F,u),$(".wpd-inline-form-wrapper").length){var n=new FormData;n.append("action","wpdGetInlineCommentForm"),G(x,!1,n).done(function(a){"object"==typeof a?a.success?($(".wpd-inline-form-wrapper").append(a.data),$.each($("[name=_wpd_inline_nonce]"),function(){var b=$(this).attr("id"),a=$(this).parents(".wpd-inline-shortcode").attr("id");$(this).attr("id",b+"-"+a.substring(a.lastIndexOf("-")+1))}),$(".wpd-inline-opened").addClass("wpd-active"),$(".wpd-inline-opened").find(".wpd-inline-form-wrapper").show(),$(".wpd-inline-opened").find(".wpd-inline-icon").addClass("wpd-open"),$(".wpd-inline-opened").find(".wpd-inline-icon").removeClass("wpd-ignored"),aC()):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data]),a.data,"error"):console.log(a)}).fail(function(b,c,a){console.log(a)})}function aA(a){if($(a).hasClass("wpd-inline-shortcode"))var b=$(a).attr("id");else var b=$(a).parents(".wpd-inline-shortcode").attr("id");return b.substring(b.lastIndexOf("-")+1)}function aB(){$(".wpd-inline-form-wrapper").hide(),$(".wpd-inline-shortcode").removeClass("wpd-active"),$(".wpd-inline-icon").removeClass("wpd-open")}function o(){$.each($(".wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon"),function(){var a=$(this),b=a.offset().top-window.pageYOffset;a.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&b>0&&b<300&&("blink"===l?(a.addClass("wpd-blink"),setTimeout(function(){a.removeClass("wpd-blink")},3e3)):(a.parents(".wpd-inline-shortcode").addClass("wpd-active"),a.siblings(".wpd-inline-form-wrapper").show(),a.addClass("wpd-open"),aC(a.siblings(".wpd-inline-form-wrapper"))))})}function aC(a){if(a){if(a.offset().left<=10){a.css("left",Math.ceil(parseInt(a.css("left"))-a.offset().left+10));var b=Math.ceil(a.siblings(".wpd-inline-icon.wpd-open").offset().left-a.offset().left+2);b<3&&(b=3),document.styleSheets[0].addRule("#"+a.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+b+"px;")}else if(a.offset().left+a.width()>document.body.clientWidth-10){a.css("left",Math.ceil(parseInt(a.css("left"))+(document.body.clientWidth-(a.offset().left+a.width()))-10));var b=Math.ceil(a.siblings(".wpd-inline-icon.wpd-open").offset().left-a.offset().left+2);b>a.width()-3&&(b=a.width()-3),document.styleSheets[0].addRule("#"+a.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+b+"px;")}}else $.each($(".wpd-inline-form-wrapper:visible"),function(){if($(this).offset().left<=10){$(this).css("left",Math.ceil(parseInt($(this).css("left"))-$(this).offset().left+10));var a=Math.ceil($(this).siblings(".wpd-inline-icon.wpd-open").offset().left-$(this).offset().left+2);a<3&&(a=3),document.styleSheets[0].addRule("#"+$(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"px;")}else if($(this).offset().left+$(this).width()>document.body.clientWidth-10){$(this).css("left",Math.ceil(parseInt($(this).css("left"))+(document.body.clientWidth-($(this).offset().left+$(this).width()))-10));var a=Math.ceil($(this).siblings(".wpd-inline-icon.wpd-open").offset().left-$(this).offset().left+2);a>$(this).width()-3&&(a=$(this).width()-3),document.styleSheets[0].addRule("#"+$(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"px;")}})}function aD(a){var b,c=0;if(a.parents(".wpd_main_comm_form").length)c=parseInt(wpdiscuzAjaxObj.commentTextMaxLength),b=a.parents(".wpd_main_comm_form");else if(a.parents(".wpd-secondary-form-wrapper").length)c=parseInt(wpdiscuzAjaxObj.replyTextMaxLength),b=a.parents(".wpd-secondary-form-wrapper");else if(a.parents("#wpdiscuz-edit-form").length){var e=aj(a);c=parseInt(e.substring(e.lastIndexOf("_")+1))?parseInt(wpdiscuzAjaxObj.replyTextMaxLength):parseInt(wpdiscuzAjaxObj.commentTextMaxLength),b=a.parents("#wpdiscuz-edit-form")}if(c&&b){var g=a.val().length,d=$(".wpd-editor-char-counter",b),f=c-g;d.html(f),f<=10?d.addClass("error"):d.removeClass("error")}}function aE(a,b,c,d){a.data.callbackFunctions&&$.each(a.data.callbackFunctions,function(e){"function"==typeof wpdiscuzAjaxObj[a.data.callbackFunctions[e]]?wpdiscuzAjaxObj[a.data.callbackFunctions[e]](a,b,c,d):"function"==typeof window[a.data.callbackFunctions[e]]?window[a.data.callbackFunctions[e]](a,b,c,d):console.log(a.data.callbackFunctions[e]+" is not a function")})}function G(c,d,a){d&&$("#wpdiscuz-loading-bar").show(),a.append("postId",I),a.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce);var b=a.get("action");wpdiscuzAjaxObj.dataFilterCallbacks&&wpdiscuzAjaxObj.dataFilterCallbacks[b]&&$.each(wpdiscuzAjaxObj.dataFilterCallbacks[b],function(e){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[b][e]]&&(a=wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[b][e]](a,c,d))});var e=c?wpdiscuzAjaxObj.url:wpdiscuzAjaxObj.customAjaxUrl;return $.ajax({type:"POST",url:e,data:a,contentType:!1,processData:!1})}function p(){if(c||wpdiscuzAjaxObj.validateNonceForGuests){var a=new FormData;a.append("action","wpdGetNonce"),G(x,!1,a).done(function(a){"object"==typeof a?a.success?wpdiscuzAjaxObj.wpdiscuz_nonce=a.data:wpdiscuzAjaxObj.setCommentMessage(a.data,"error"):console.log(a)}).fail(function(b,c,a){console.log(a)})}}$(document).on("click","body",function(a){if($(a.target).hasClass("wpd-inline-form-close")||$(a.target).parents(".wpd-inline-form-close").length)a.preventDefault(),$(a.target).parents(".wpd-inline-form-wrapper").hide(),$(a.target).parents(".wpd-inline-shortcode").removeClass("wpd-active"),$(a.target).parents(".wpd-inline-form-wrapper").siblings(".wpd-inline-icon").removeClass("wpd-open");else if(!$(a.target).hasClass("wpd-inline-form-wrapper")&&!$(a.target).parents(".wpd-inline-form-wrapper").length){aB();var b="";$(a.target).hasClass("wpd-inline-icon")?b=$(a.target):$(a.target).parents(".wpd-inline-icon").length&&(b=$(a.target).parents(".wpd-inline-icon")),b.length&&b.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&(b.parents(".wpd-inline-shortcode").addClass("wpd-active"),b.siblings(".wpd-inline-form-wrapper").show(),b.addClass("wpd-open"),b.removeClass("wpd-ignored"),aC(b.siblings(".wpd-inline-form-wrapper")))}(!$(a.target).hasClass("wpd-last-inline-comments-wrapper")&&!$(a.target).parents(".wpd-last-inline-comments-wrapper").length||$(a.target).parents(".wpd-last-inline-comments-wrapper").length&&$(a.target).hasClass("wpd-load-inline-comment"))&&$(".wpd-last-inline-comments-wrapper").remove()}),$("body").on("click",".wpd-inline-submit.wpd_not_clicked",function(c){c.preventDefault();var d=$(this),a=$(this).parents(".wpd_inline_comm_form");if(a[0].checkValidity()){$(this).removeClass("wpd_not_clicked");var b=new FormData;b.append("action","wpdAddInlineComment"),b.append("inline_form_id",aA(a)),$.each($("input, textarea",a),function(c,a){"checkbox"===this.type?$(this).is(":checked")&&b.append($(a).attr("name"),$(a).val()):b.append($(a).attr("name"),$(a).val())}),G(x,!0,b).done(function(b){if(d.addClass("wpd_not_clicked"),"object"==typeof b){if(b.success){a[0].reset(),aB();var e=parseInt(b.data.newCount),c=d.parents(".wpd-inline-icon-wrapper").find(".wpd-inline-icon-count");c.text(e),e?c.addClass("wpd-has-comments"):c.removeClass("wpd-has-comments"),b.data.allCommentsCountNew=parseInt(b.data.allCommentsCountNew),$(".wpd-thread-info").html(b.data.allCommentsCountBeforeThreadsHtml),$(".wpd-thread-info").attr("data-comments-count",b.data.allCommentsCountNew),$("#wpd-bubble-all-comments-count").replaceWith(b.data.allCommentsCountBubbleHtml),b.data.message&&az(b.data.message),wpdiscuzAjaxObj.setCommentMessage(b.data.notification,"success")}else b.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[b.data],b.data,d),"error")}else wpdiscuzAjaxObj.setCommentMessage(b,"error");$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}}),$("body").on("keydown",".wpd-form",function(a){a.ctrlKey&&13==a.keyCode&&$(this).find(".wc_comm_submit").trigger("click")}),$("body").on("keydown","#wpdiscuz-edit-form",function(a){a.ctrlKey&&13==a.keyCode&&$(this).find(".wc_save_edited_comment").trigger("click")}),$("body").on("keydown",".wpd-inline-comment-content",function(a){a.ctrlKey&&13==a.keyCode&&$(this).parents(".wpd_inline_comm_form").find(".wpd-inline-submit.wpd_not_clicked").trigger("click")}),$("body").on("click",".wpd-inline-icon-count.wpd-has-comments",function(){var b=$(this),a=new FormData;a.append("action","wpdGetLastInlineComments"),a.append("inline_form_id",aA(b)),G(x,!0,a).done(function(a){"object"==typeof a?a.success?$(a.data).insertAfter(b):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,b),"error"):console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("click",".wpd-view-all-inline-comments",function(a){a.preventDefault(),$(this).parents(".wpd-last-inline-comments-wrapper").remove(),$(".wpdf-inline").hasClass("wpdf-active")||$(".wpdf-inline").trigger("click"),au(),$("html, body").animate({scrollTop:$(".wpdf-inline").offset().top-m},1e3,av)}),$("body").on("click",".wpd-feedback-content-link",function(a){a.preventDefault();var b=$(this).data("feedback-content-id");au(),$("html, body").animate({scrollTop:$("#wpd-inline-"+b).offset().top-(m+6)},1e3,function(){av(),$("#wpd-inline-"+b).addClass("wpd-active")})}),("scroll_open"===l||"blink"===l)&&(o(),$(window).on("scroll",o)),$("body").on("click","#wpd-post-rating.wpd-not-rated .wpd-rate-starts svg",function(){var a=new FormData,b=$(this).index();b>=0&&b<5&&(a.append("action","wpdUserRate"),a.append("rating",b+1),G(x,!0,a).done(function(a){"object"==typeof a?(a.success?location.reload(!0):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data),"error"),aE(a)):console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)}))}),$("body").on("submit","#wpdiscuz-subscribe-form",function(d){d.preventDefault();var a=$(this);let b=$("#wpdiscuz_subscription_button",a);if(a[0].checkValidity()&&(f=a,g=!0,"2.0"===e&&$("input[name=wpdiscuz_recaptcha_subscribe_form]",f).length&&!$("input[name=wpdiscuz_recaptcha_subscribe_form]",f).val().length?(g=!1,$(".wpdiscuz-recaptcha",f).css("border","1px solid red")):"2.0"===e&&$("input[name=wpdiscuz_recaptcha_subscribe_form]",f).length&&$(".wpdiscuz-recaptcha",f).css("border","none"),g)&&b.hasClass("wpd_not_clicked")){b.removeClass("wpd_not_clicked");var f,g,c=new FormData;c.append("action","wpdAddSubscription"),$("*",a).each(function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&c.append(this.name+"",$(this).val()),("checkbox"==this.type||"radio"==this.type)&&$(this).is(":checked")&&c.append(this.name+"",$(this).val())}),G(x,!0,c).done(function(a){"object"==typeof a?a.success?(wpdiscuzAjaxObj.setCommentMessage(a.data,"success"),setTimeout(function(){location.reload(!0)},3e3)):wpdiscuzAjaxObj.setCommentMessage(a.data,"error"):wpdiscuzAjaxObj.setCommentMessage(a,"error"),$("#wpdiscuz-loading-bar").fadeOut(250),V=!1,b.addClass("wpd_not_clicked")}).fail(function(c,d,a){console.log(a),b.addClass("wpd_not_clicked"),$("#wpdiscuz-loading-bar").fadeOut(250)})}}),$("body").on("click",".wpd-unsubscribe",function(b){b.preventDefault();var a=new FormData;a.append("action","wpdUnsubscribe"),a.append("sid",$(this).data("sid")),a.append("skey",$(this).data("skey")),G(x,!0,a).done(function(a){"object"==typeof a?a.success?(wpdiscuzAjaxObj.setCommentMessage(a.data,"success"),setTimeout(function(){location.reload(!0)},3e3)):wpdiscuzAjaxObj.setCommentMessage(a.data,"error"):console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250),V=!1}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),wpdiscuzAjaxObj.resetActiveFilters=function(a){$(".wpd-filter.wpdf-active"+(a?":not("+a+")":"")).removeClass("wpdf-active")},wpdiscuzAjaxObj.getAjaxObj=G,wpdiscuzAjaxObj.initNonce=p,p()});var onloadCallback=function(){if(document.getElementById("wpdiscuz-recaptcha-0_0")&&"2.0"===wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion&&(1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!wpdiscuzAjaxObj.is_user_logged_in||1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&wpdiscuzAjaxObj.is_user_logged_in))try{grecaptcha.render("wpdiscuz-recaptcha-0_0",{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(a){jQuery("#wpdiscuz-recaptcha-field-0_0").val("key")},"expired-callback":function(){jQuery("#wpdiscuz-recaptcha-field-0_0").val("")}})}catch(a){console.log(a),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+a.message,"error")}}
11
  /* Colorbox */
12
  !function(t,e,i){var o,n,r,h,a,s,l,c,d,g,f,u,p,m,w,v,y,x,b,T,C,H,k,W,E,I,M,L,R,S,K,P,B,O={html:!1,photo:!1,iframe:!1,inline:!1,transition:"elastic",speed:300,fadeOut:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,opacity:.9,preloading:!0,className:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:void 0,closeButton:!0,fastIframe:!0,open:!1,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",photoRegex:/\.(gif|png|jp(e|g|eg)|bmp|ico|webp|jxr|svg)((#|\?).*)?$/i,retinaImage:!1,retinaUrl:!1,retinaSuffix:"@2x.$1",current:"image {current} of {total}",previous:"previous",next:"next",close:"close",xhrError:"This content failed to load.",imgError:"This image failed to load.",returnFocus:!0,trapFocus:!0,onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,rel:function(){return this.rel},href:function(){return t(this).attr("href")},title:function(){return this.title},createImg:function(){var e=new Image,i=t(this).data("cbox-img-attrs");return"object"==typeof i&&t.each(i,function(t,i){e[t]=i}),e},createIframe:function(){var i=e.createElement("iframe"),o=t(this).data("cbox-iframe-attrs");return"object"==typeof o&&t.each(o,function(t,e){i[t]=e}),"frameBorder"in i&&(i.frameBorder=0),"allowTransparency"in i&&(i.allowTransparency="true"),i.name=(new Date).getTime(),i.allowFullscreen=!0,i}},_="colorbox",j="cbox",D=j+"Element",F=j+"_open",N=j+"_load",z=j+"_complete",A=j+"_cleanup",q=j+"_closed",U=j+"_purge",$=t("<a/>"),G="div",Q=0,J={};function V(i,o,n){var r=e.createElement(i);return o&&(r.id=j+o),n&&(r.style.cssText=n),t(r)}function X(){return i.innerHeight?i.innerHeight:t(i).height()}function Y(e,i){i!==Object(i)&&(i={}),this.cache={},this.el=e,this.value=function(e){var o;return void 0===this.cache[e]&&(void 0!==(o=t(this.el).attr("data-cbox-"+e))?this.cache[e]=o:void 0!==i[e]?this.cache[e]=i[e]:void 0!==O[e]&&(this.cache[e]=O[e])),this.cache[e]},this.get=function(t){var e=this.value(t);return"function"==typeof e?e.call(this.el,this):e}}function Z(t){var e=d.length,i=(I+t)%e;return i<0?e+i:i}function tt(t,e){return Math.round((/%/.test(t)?("x"===e?g.width():X())/100:1)*parseInt(t,10))}function et(t,e){return t.get("photo")||t.get("photoRegex").test(e)}function it(t,e){return t.get("retinaUrl")&&i.devicePixelRatio>1?e.replace(t.get("photoRegex"),t.get("retinaSuffix")):e}function ot(t){"contains"in n[0]&&!n[0].contains(t.target)&&t.target!==o[0]&&(t.stopPropagation(),n.trigger("focus"))}function nt(t){nt.str!==t&&(n.add(o).removeClass(nt.str).addClass(t),nt.str=t)}function rt(i){t(e).trigger(i),$.triggerHandler(i)}var ht=function(){var t,e,i=j+"Slideshow_",o="click."+j;function r(){clearTimeout(e)}function h(){(C.get("loop")||d[I+1])&&(r(),e=setTimeout(P.next,C.get("slideshowSpeed")))}function a(){v.html(C.get("slideshowStop")).off(o).one(o,s),$.on(z,h).on(N,r),n.removeClass(i+"off").addClass(i+"on")}function s(){r(),$.off(z,h).off(N,r),v.html(C.get("slideshowStart")).off(o).one(o,function(){P.next(),a()}),n.removeClass(i+"on").addClass(i+"off")}function l(){t=!1,v.hide(),r(),$.off(z,h).off(N,r),n.removeClass(i+"off "+i+"on")}return function(){t?C.get("slideshow")||($.off(A,l),l()):C.get("slideshow")&&d[1]&&(t=!0,$.one(A,l),C.get("slideshowAuto")?a():s(),v.show())}}();function at(r){var g,w;if(!S){if(g=t(r).data(_),C=new Y(r,g),w=C.get("rel"),I=0,w&&!1!==w&&"nofollow"!==w?(d=t("."+D).filter(function(){return new Y(this,t.data(this,_)).get("rel")===w}),-1===(I=d.index(C.el))&&(d=d.add(C.el),I=d.length-1)):d=t(C.el),!L){L=R=!0,nt(C.get("className")),n.css({visibility:"hidden",display:"block",opacity:""}),f=V(G,"LoadedContent","width:0; height:0; overflow:hidden; visibility:hidden"),h.css({width:"",height:""}).append(f),H=a.height()+c.height()+h.outerHeight(!0)-h.height(),k=s.width()+l.width()+h.outerWidth(!0)-h.width(),W=f.outerHeight(!0),E=f.outerWidth(!0);var v=tt(C.get("initialWidth"),"x"),y=tt(C.get("initialHeight"),"y"),x=C.get("maxWidth"),B=C.get("maxHeight");C.w=Math.max((!1!==x?Math.min(v,tt(x,"x")):v)-E-k,0),C.h=Math.max((!1!==B?Math.min(y,tt(B,"y")):y)-W-H,0),f.css({width:"",height:C.h}),P.position(),rt(F),C.get("onOpen"),T.add(m).hide(),n.trigger("focus"),C.get("trapFocus")&&e.addEventListener&&(e.addEventListener("focus",ot,!0),$.one(q,function(){e.removeEventListener("focus",ot,!0)})),C.get("returnFocus")&&$.one(q,function(){t(C.el).trigger("focus")})}var O=parseFloat(C.get("opacity"));o.css({opacity:O==O?O:"",cursor:C.get("overlayClose")?"pointer":"",visibility:"visible"}).show(),C.get("closeButton")?b.html(C.get("close")).appendTo(h):b.appendTo("<div/>"),function(){var e,o,n,r=P.prep,h=++Q;R=!0,M=!1,rt(U),rt(N),C.get("onLoad"),C.h=C.get("height")?tt(C.get("height"),"y")-W-H:C.get("innerHeight")&&tt(C.get("innerHeight"),"y"),C.w=C.get("width")?tt(C.get("width"),"x")-E-k:C.get("innerWidth")&&tt(C.get("innerWidth"),"x"),C.mw=C.w,C.mh=C.h,C.get("maxWidth")&&(C.mw=tt(C.get("maxWidth"),"x")-E-k,C.mw=C.w&&C.w<C.mw?C.w:C.mw);C.get("maxHeight")&&(C.mh=tt(C.get("maxHeight"),"y")-W-H,C.mh=C.h&&C.h<C.mh?C.h:C.mh);if(e=C.get("href"),K=setTimeout(function(){p.show()},100),C.get("inline")){var a=t(e).eq(0);n=t("<div>").hide().insertBefore(a),$.one(U,function(){n.replaceWith(a)}),r(a)}else C.get("iframe")?r(" "):C.get("html")?r(C.get("html")):et(C,e)?(e=it(C,e),M=C.get("createImg"),t(M).addClass(j+"Photo").on("error."+j,function(){r(V(G,"Error").html(C.get("imgError")))}).one("load",function(){h===Q&&setTimeout(function(){var e;C.get("retinaImage")&&i.devicePixelRatio>1&&(M.height=M.height/i.devicePixelRatio,M.width=M.width/i.devicePixelRatio),C.get("scalePhotos")&&(o=function(){M.height-=M.height*e,M.width-=M.width*e},C.mw&&M.width>C.mw&&(e=(M.width-C.mw)/M.width,o()),C.mh&&M.height>C.mh&&(e=(M.height-C.mh)/M.height,o())),C.h&&(M.style.marginTop=Math.max(C.mh-M.height,0)/2+"px"),d[1]&&(C.get("loop")||d[I+1])&&(M.style.cursor="pointer",t(M).on("click."+j,function(){P.next()})),M.style.width=M.width+"px",M.style.height=M.height+"px",r(M)},1)}),M.src=e):e&&u.load(e,C.get("data"),function(e,i){h===Q&&r("error"===i?V(G,"Error").html(C.get("xhrError")):t(this).contents())})}()}}function st(){n||(B=!1,g=t(i),n=V(G).attr({id:_,class:!1===t.support.opacity?j+"IE":"",role:"dialog",tabindex:"-1"}).hide(),o=V(G,"Overlay").hide(),p=t([V(G,"LoadingOverlay")[0],V(G,"LoadingGraphic")[0]]),r=V(G,"Wrapper"),h=V(G,"Content").append(m=V(G,"Title"),w=V(G,"Current"),x=t('<button type="button"/>').attr({id:j+"Previous"}),y=t('<button type="button"/>').attr({id:j+"Next"}),v=t('<button type="button"/>').attr({id:j+"Slideshow"}),p),b=t('<button type="button"/>').attr({id:j+"Close"}),r.append(V(G).append(V(G,"TopLeft"),a=V(G,"TopCenter"),V(G,"TopRight")),V(G,!1,"clear:left").append(s=V(G,"MiddleLeft"),h,l=V(G,"MiddleRight")),V(G,!1,"clear:left").append(V(G,"BottomLeft"),c=V(G,"BottomCenter"),V(G,"BottomRight"))).find("div div").css({float:"left"}),u=V(G,!1,"position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;"),T=y.add(x).add(w).add(v)),e.body&&!n.parent().length&&t(e.body).append(o,n.append(r,u))}function lt(){function i(t){t.which>1||t.shiftKey||t.altKey||t.metaKey||t.ctrlKey||(t.preventDefault(),at(this))}return!!n&&(B||(B=!0,y.on("click",function(){P.next()}),x.on("click",function(){P.prev()}),b.on("click",function(){P.close()}),o.on("click",function(){C.get("overlayClose")&&P.close()}),t(e).on("keydown."+j,function(t){var e=t.keyCode;L&&C.get("escKey")&&27===e&&(t.preventDefault(),P.close()),L&&C.get("arrowKey")&&d[1]&&!t.altKey&&(37===e?(t.preventDefault(),x.trigger("click")):39===e&&(t.preventDefault(),y.trigger("click")))}),"function"==typeof t.fn.on?t(e).on("click."+j,"."+D,i):t("."+D).live("click."+j,i)),!0)}t[_]||(t(st),(P=t.fn[_]=t[_]=function(e,i){var o=this;return e=e||{},"function"==typeof o&&(o=t("<a/>"),e.open=!0),o[0]?(st(),lt()&&(i&&(e.onComplete=i),o.each(function(){var i=t.data(this,_)||{};t.data(this,_,t.extend(i,e))}).addClass(D),new Y(o[0],e).get("open")&&at(o[0])),o):o}).position=function(e,i){var o,d,f,u=0,p=0,m=n.offset();function w(){a[0].style.width=c[0].style.width=h[0].style.width=parseInt(n[0].style.width,10)-k+"px",h[0].style.height=s[0].style.height=l[0].style.height=parseInt(n[0].style.height,10)-H+"px"}if(g.off("resize."+j),n.css({top:-9e4,left:-9e4}),d=g.scrollTop(),f=g.scrollLeft(),C.get("fixed")?(m.top-=d,m.left-=f,n.css({position:"fixed"})):(u=d,p=f,n.css({position:"absolute"})),!1!==C.get("right")?p+=Math.max(g.width()-C.w-E-k-tt(C.get("right"),"x"),0):!1!==C.get("left")?p+=tt(C.get("left"),"x"):p+=Math.round(Math.max(g.width()-C.w-E-k,0)/2),!1!==C.get("bottom")?u+=Math.max(X()-C.h-W-H-tt(C.get("bottom"),"y"),0):!1!==C.get("top")?u+=tt(C.get("top"),"y"):u+=Math.round(Math.max(X()-C.h-W-H,0)/2),n.css({top:m.top,left:m.left,visibility:"visible"}),r[0].style.width=r[0].style.height="9999px",o={width:C.w+E+k,height:C.h+W+H,top:u,left:p},e){var v=0;t.each(o,function(t){o[t]===J[t]||(v=e)}),e=v}J=o,e||n.css(o),n.dequeue().animate(o,{duration:e||0,complete:function(){w(),R=!1,r[0].style.width=C.w+E+k+"px",r[0].style.height=C.h+W+H+"px",C.get("reposition")&&setTimeout(function(){g.on("resize."+j,P.position)},1),"function"==typeof i&&i()},step:w})},P.resize=function(t){var e;L&&((t=t||{}).width&&(C.w=tt(t.width,"x")-E-k),t.innerWidth&&(C.w=tt(t.innerWidth,"x")),f.css({width:C.w}),t.height&&(C.h=tt(t.height,"y")-W-H),t.innerHeight&&(C.h=tt(t.innerHeight,"y")),t.innerHeight||t.height||(e=f.scrollTop(),f.css({height:"auto"}),C.h=f.height()),f.css({height:C.h}),e&&f.scrollTop(e),P.position("none"===C.get("transition")?0:C.get("speed")))},P.prep=function(i){if(L){var o,r="none"===C.get("transition")?0:C.get("speed");f.remove(),(f=V(G,"LoadedContent").append(i)).hide().appendTo(u.show()).css({width:(C.w=C.w||f.width(),C.w=C.mw&&C.mw<C.w?C.mw:C.w,C.w),overflow:C.get("scrolling")?"auto":"hidden"}).css({height:(C.h=C.h||f.height(),C.h=C.mh&&C.mh<C.h?C.mh:C.h,C.h)}).prependTo(h),u.hide(),t(M).css({float:"none"}),nt(C.get("className")),o=function(){var i,o,h=d.length;function a(){!1===t.support.opacity&&n[0].style.removeAttribute("filter")}L&&(o=function(){clearTimeout(K),p.hide(),rt(z),C.get("onComplete")},m.html(C.get("title")).show(),f.show(),h>1?("string"==typeof C.get("current")&&w.html(C.get("current").replace("{current}",I+1).replace("{total}",h)).show(),y[C.get("loop")||I<h-1?"show":"hide"]().html(C.get("next")),x[C.get("loop")||I?"show":"hide"]().html(C.get("previous")),ht(),C.get("preloading")&&t.each([Z(-1),Z(1)],function(){var i=d[this],o=new Y(i,t.data(i,_)),n=o.get("href");n&&et(o,n)&&(n=it(o,n),e.createElement("img").src=n)})):T.hide(),C.get("iframe")?(i=C.get("createIframe"),C.get("scrolling")||(i.scrolling="no"),t(i).attr({src:C.get("href"),class:j+"Iframe"}).one("load",o).appendTo(f),$.one(U,function(){i.src="//about:blank"}),C.get("fastIframe")&&t(i).trigger("load")):o(),"fade"===C.get("transition")?n.fadeTo(r,1,a):a())},"fade"===C.get("transition")?n.fadeTo(r,0,function(){P.position(0,o)}):P.position(r,o)}},P.next=function(){!R&&d[1]&&(C.get("loop")||d[I+1])&&(I=Z(1),at(d[I]))},P.prev=function(){!R&&d[1]&&(C.get("loop")||I)&&(I=Z(-1),at(d[I]))},P.close=function(){L&&!S&&(S=!0,L=!1,rt(A),C.get("onCleanup"),g.off("."+j),o.fadeTo(C.get("fadeOut")||0,0),n.stop().fadeTo(C.get("fadeOut")||0,0,function(){n.hide(),o.hide(),rt(U),f.remove(),setTimeout(function(){S=!1,rt(q),C.get("onClosed")},1)}))},P.remove=function(){n&&(n.stop(),t[_].close(),n.stop(!1,!0).remove(),o.remove(),S=!1,n=null,t("."+D).removeData(_).removeClass(D),t(e).off("click."+j).off("keydown."+j))},P.element=function(){return t(C.el)},P.settings=O)}(jQuery,document,window);
13
  /* Media Uploader */
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 */
18
+ jQuery(document).ready(function($){var a=0,b=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),c=parseInt(wpdiscuzUCObj.additionalTab);$("body").on("click",".wpd-info,.wpd-page-link,.wpd-delete-content,.wpd-user-email-delete-links",function(a){a.preventDefault()}),$("body").on("click",".wpd-info.wpd-not-clicked",function(i){var e=$(this);e.removeClass("wpd-not-clicked");var f,g,a,h,d=new FormData;return d.append("action","wpdGetInfo"),d.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce),f=e,g=d,h=(a=$(".fas",f)).attr("class"),a.removeClass(),a.addClass("fas fa-pulse fa-spinner"),wpdiscuzAjaxObj.getAjaxObj(b||c,!1,g).done(function(b){f.addClass("wpd-not-clicked"),a.removeClass(),a.addClass(h),b&&($("#wpdUserContentInfo").html(b),$("#wpdUserContentInfo ul.wpd-list .wpd-list-item:first-child").addClass("wpd-active"),$("#wpdUserContentInfo div.wpd-content .wpd-content-item:first-child").addClass("wpd-active"),$("#wpdUserContentInfo").is(":visible")||$("#wpdUserContentInfoAnchor").trigger("click"))}),!1}),$("body").on("click",".wpd-list-item",function(){var a=$("input.wpd-rel",this).val();$("#wpdUserContentInfo .wpd-list-item").removeClass("wpd-active"),$("#wpdUserContentInfo .wpd-content-item").removeClass("wpd-active");var e=$(this);if($("#wpdUserContentInfo #"+a).text().length)e.addClass("wpd-active"),$("#wpdUserContentInfo #"+a).addClass("wpd-active");else{var d=new FormData;d.append("action",e.attr("data-action")),d.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce),d.append("page",0),$("#wpdUserContentInfo #"+a).addClass("wpd-active"),$("#wpdUserContentInfo #"+a).css("text-align","center"),wpdiscuzAjaxObj.getAjaxObj(b||c,!0,d).done(function(b){b&&($("#wpdUserContentInfo #"+a).css("text-align",""),e.addClass("wpd-active"),$("#wpdUserContentInfo #"+a).html(b)),$("#wpdiscuz-loading-bar").hide()})}}),$("body").on("click",".wpd-page-link.wpd-not-clicked",function(g){var d=$(this);d.removeClass("wpd-not-clicked");var e=d.data("wpd-page"),f=$(".wpd-active .wpd-pagination .wpd-action").val(),a=new FormData;a.append("action",f),a.append("page",e),a.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce),wpdiscuzAjaxObj.getAjaxObj(b||c,!0,a).done(function(a){d.addClass("wpd-not-clicked"),a&&$(".wpd-content-item.wpd-active").html(a),$("#wpdiscuz-loading-bar").hide()})}),$("body").on("click",".wpd-delete-content.wpd-not-clicked",function(){var d=$(this),h=parseInt(d.data("wpd-content-id"));if(!isNaN(h)){var f=d.data("wpd-delete-action");if("wpdDeleteComment"===f&&!confirm(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzUCObj.msgConfirmDeleteComment,"wc_confirm_comment_delete",d))||"wpdCancelSubscription"===f&&!confirm(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzUCObj.msgConfirmCancelSubscription,"wc_confirm_cancel_subscription",d))||"wpdCancelFollow"===f&&!confirm(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzUCObj.msgConfirmCancelFollow,"wc_confirm_cancel_follow",d)))return!1;var i=$("i",d),k=i.attr("class"),g=$(".wpd-wrapper .wpd-page-number").val(),j=$(".wpd-content-item.wpd-active").children(".wpd-item").length;d.removeClass("wpd-not-clicked"),i.removeClass().addClass("fas fa-pulse fa-spinner"),1===j&&g>0&&(g-=1);var e=new FormData;e.append("id",h),e.append("page",g),e.append("action",f),e.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce),wpdiscuzAjaxObj.getAjaxObj(b||c,!1,e).done(function(b){d.addClass("wpd-not-clicked"),i.removeClass().addClass(k),$(".wpd-content-item.wpd-active").html(b),a=1})}}),$("body").on("click","[data-lity-close]",function(b){$(b.target).is("[data-lity-close]")&&a&&window.location.reload(!0)}),$("body").on("click",".wpd-user-email-delete-links.wpd-not-clicked",function(){var d=$(this);d.removeClass("wpd-not-clicked"),$(".wpd-loading",d).addClass("wpd-show");var a=new FormData;a.append("action","wpdEmailDeleteLinks"),a.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce),wpdiscuzAjaxObj.getAjaxObj(b||c,!1,a).done(function(a){d.addClass("wpd-not-clicked"),$("[data-lity-close]",window.parent.document).trigger("click")})}),$("body").on("click",".wpd-user-settings-button.wpd-not-clicked",function(){var d=$(this);d.removeClass("wpd-not-clicked");var e=d.data("wpd-delete-action");if("deleteCookies"!==e){d.find(".wpd-loading").addClass("wpd-show");var a=new FormData;a.append("action","wpdGuestAction"),a.append("guestAction",e),a.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce),wpdiscuzAjaxObj.getAjaxObj(b||c,!1,a).done(function(a){d.addClass("wpd-not-clicked"),d.find(".wpd-loading").removeClass("wpd-show");try{var b=$.parseJSON(a);d.after(b.message);var c=d.next(".wpd-guest-action-message");c.fadeIn(100).fadeOut(7e3,function(){c.remove(),1===parseInt(b.code)&&(d.parent().remove(),$(".wpd-delete-all-comments").length||$(".wpd-delete-all-subscriptions").length||$(".wpd-delete-all-cookies").parent().addClass("wpd-show"))})}catch(e){console.log(e)}})}else(function(){for(var c=document.cookie.split(";"),a=0;a<c.length;a++){var b=c[a],d=b.indexOf("="),e=d> -1?b.substr(0,d):b;Cookies.remove(e.trim())}location.reload(!0)})()})})
19
  /* Social */
20
+ function wpcShareCommentFB(a,b){FB.ui({method:"share",href:a,quote:b},function(a){})}(!parseInt(wpdiscuzAjaxObj.fbUseOAuth2)&&parseInt(wpdiscuzAjaxObj.enableFbLogin)||parseInt(wpdiscuzAjaxObj.enableFbShare))&&wpdiscuzAjaxObj.facebookAppID&&(function(a,c,d){var b,e=a.getElementsByTagName(c)[0];a.getElementById(d)||((b=a.createElement(c)).id=d,b.src="//connect.facebook.net/en_US/sdk.js",e.parentNode.insertBefore(b,e))}(document,"script","facebook-jssdk"),window.fbAsyncInit=function(){FB.init({appId:wpdiscuzAjaxObj.facebookAppID,cookie:!0,xfbml:!0,version:"v7.0"})}),jQuery(document).ready(function($){(a=Cookies.get("wpdiscuz_social_login_message"))&&"undefined"!==a&&(Cookies.remove("wpdiscuz_social_login_message"),wpdiscuzAjaxObj.setCommentMessage(decodeURIComponent(a.replace(/\+/g,"%20")),"error")),Cookies.get("wpdiscuz_scroll_to_comments")&&(Cookies.remove("wpdiscuz_scroll_to_comments",{path:"/"}),$("html, body").animate({scrollTop:$("#comments").offset().top-32},1e3)),$("body").on("click",".wpd-comment-share .fa-facebook-f",function(){if(1==wpdiscuzAjaxObj.enableFbShare){var b=$(this).parents(".wpd-comment").find(".wpd-comment-right").attr("id"),a=window.location.href;-1!==a.indexOf("#")&&(a=a.substring(0,a.indexOf("#"))),wpcShareCommentFB(a+="#"+b,$(this).parents(".wpd-comment-right").find(".wpd-comment-text").text())}});var a,b="";function c(a,b){var c,e="";f(b,1),Cookies.set("wpdiscuz_scroll_to_comments",1,{path:"/"}),"facebook"===a&&0==wpdiscuzAjaxObj.facebookUseOAuth2?FB.getLoginStatus(function(f){"connected"===f.status?(c=f.authResponse.accessToken,e=f.authResponse.userID,d(a,c,e,b)):FB.login(function(f){"connected"===f.status&&(c=f.authResponse.accessToken,e=f.authResponse.userID,d(a,c,e,b))},{scope:"public_profile,email"})}):d(a,c,e,b)}function d(a,b,c,d){return $.ajax({type:"POST",url:wpdiscuzAjaxObj.url,data:{action:"wpd_social_login",provider:a,token:b,userID:c,postID:wpdiscuzAjaxObj.wc_post_id}}).done(function(a){e(a,d)}),""}function e(b,c){try{var a=$.parseJSON(b),d=a.code,e=a.message,g=a.url;200===parseInt(d)?location.assign(g):wpdiscuzAjaxObj.setCommentMessage(e,"error")}catch(h){console.log(h)}f(c,0)}function f(a,b){1===b?a.find(".wpdiscuz-social-login-spinner").show():a.find(".wpdiscuz-social-login-spinner").hide()}$("body").on("click","#wpdcom .wpd-social-login .wpdiscuz-login-button",function(){var f,e,d,a,g=$(this).parents(".wpd-social-login");f=b=(d=$(this),a="",d.hasClass("wpdsn-fb")&&(a="facebook"),d.hasClass("wpdsn-insta")&&(a="instagram"),d.hasClass("wpdsn-gg")&&(a="google"),d.hasClass("wpdsn-ds")&&(a="disqus"),d.hasClass("wpdsn-wp")&&(a="wordpress"),d.hasClass("wpdsn-tw")&&(a="twitter"),d.hasClass("wpdsn-vk")&&(a="vk"),d.hasClass("wpdsn-ok")&&(a="ok"),d.hasClass("wpdsn-linked")&&(a="linkedin"),d.hasClass("wpdsn-yandex")&&(a="yandex"),d.hasClass("wpdsn-mailru")&&(a="mailru"),d.hasClass("wpdsn-weixin")&&(a="wechat"),d.hasClass("wpdsn-weibo")&&(a="weibo"),d.hasClass("wpdsn-qq")&&(a="qq"),d.hasClass("wpdsn-baidu")&&(a="baidu"),a),e=g,1!=parseInt(wpdiscuzAjaxObj.socialLoginAgreementCheckbox)||1==Cookies.get("socialLoginAgreementConfirmed")?c(f,e):e.parents(".wpd-form-wrap, .wpd-form").find(".wpd-social-login-agreement").first().slideDown(700)}),$("body").on("click","#wpdcom .wpd-agreement-buttons-right .wpd-agreement-button",function(){var a=$(this).parents(".wpd-form-wrap, .wpd-form").find(".wpd-social-login-agreement").slideUp(700);$(this).hasClass("wpd-agreement-button-agree")&&(wpdiscuzAjaxObj.isCookiesEnabled&&Cookies.set("socialLoginAgreementConfirmed",1,{expires:30,path:"/"}),c(b,a))})})
assets/js/wpdiscuz-custom-form.js CHANGED
@@ -6,17 +6,17 @@ $(document).ready(function ($) {
6
 
7
  $('.icp-auto').iconpicker();
8
 
9
- $(document).on('click', '#wpdiscuz_form_add_row', function () {
10
  wpdiscuzForm.addRow('#wpd-form-sortable-rows');
11
  wpdFormFieldSortable();
12
  });
13
 
14
- $(document).on('click', '.wpd-form-row-wrap .wpd-form-row-actions .fa-columns', function () {
15
  wpdiscuzForm.formTwoColumn($(this));
16
  wpdFormFieldSortable();
17
  });
18
 
19
- $(document).on('click', '.wpd-form-row-wrap .wpd-form-row-actions .fa-trash-alt', function () {
20
  if($(this).parents('.wpd-form-row-wrap').find('.wpd-default-field').length){
21
  alert(wpdFormAdminOptions.can_not_delete_field);
22
  return;
@@ -26,7 +26,7 @@ $(document).ready(function ($) {
26
  }
27
  });
28
 
29
- $(document).on('click', '.wpd-form-add-filed', function () {
30
  currentRowId = $(this).parents('.wpd-form-row-wrap').attr('id');
31
  currentColumnType = 'full';
32
  if ($(this).parents('.wpd-form-col').hasClass('left-col')) {
@@ -39,17 +39,17 @@ $(document).ready(function ($) {
39
  return false;
40
  });
41
 
42
- $(document).on('click', '.wpd-field .fa-trash-alt', function () {
43
  if (confirm(wpdFormAdminOptions.confirm_delete_message)) {
44
  $(this).parents('.wpd-field').remove();
45
  }
46
  });
47
 
48
- $(document).on('click', '.wpd-field .fa-pencil-alt', function () {
49
  $(this).parents('.wpd-field').find('.wpd-field-body').toggle(500);
50
  });
51
 
52
- $(document).on('click', '.wpd-field-button', function () {
53
  var fieldType = $(this).attr('id');
54
  var fieldTitle = $(this).text();
55
  var defaultField = '0';
@@ -74,7 +74,7 @@ $(document).ready(function ($) {
74
  });
75
  });
76
 
77
- $(document).on('click', '#wpd-add-field-button', function () {
78
  var tbForm = $('#TB_ajaxContent_form');
79
  tbForm.submit(function (event) {
80
  event.preventDefault();
@@ -129,7 +129,7 @@ $(document).ready(function ($) {
129
  function wpdFieldLoad() {
130
  $('#TB_ajaxContent').html('<img class="wpdFieldLoad" src="' + wpdFormAdminOptions.loaderImg + '">');
131
  }
132
- $(document).on('click', '.wpd-advaced-options-title', function(){
133
  $(this).next('.wpd-advaced-options-cont').toggle();
134
  });
135
  });
6
 
7
  $('.icp-auto').iconpicker();
8
 
9
+ $('body').on('click', '#wpdiscuz_form_add_row', function () {
10
  wpdiscuzForm.addRow('#wpd-form-sortable-rows');
11
  wpdFormFieldSortable();
12
  });
13
 
14
+ $('body').on('click', '.wpd-form-row-wrap .wpd-form-row-actions .fa-columns', function () {
15
  wpdiscuzForm.formTwoColumn($(this));
16
  wpdFormFieldSortable();
17
  });
18
 
19
+ $('body').on('click', '.wpd-form-row-wrap .wpd-form-row-actions .fa-trash-alt', function () {
20
  if($(this).parents('.wpd-form-row-wrap').find('.wpd-default-field').length){
21
  alert(wpdFormAdminOptions.can_not_delete_field);
22
  return;
26
  }
27
  });
28
 
29
+ $('body').on('click', '.wpd-form-add-filed', function () {
30
  currentRowId = $(this).parents('.wpd-form-row-wrap').attr('id');
31
  currentColumnType = 'full';
32
  if ($(this).parents('.wpd-form-col').hasClass('left-col')) {
39
  return false;
40
  });
41
 
42
+ $('body').on('click', '.wpd-field .fa-trash-alt', function () {
43
  if (confirm(wpdFormAdminOptions.confirm_delete_message)) {
44
  $(this).parents('.wpd-field').remove();
45
  }
46
  });
47
 
48
+ $('body').on('click', '.wpd-field .fa-pencil-alt', function () {
49
  $(this).parents('.wpd-field').find('.wpd-field-body').toggle(500);
50
  });
51
 
52
+ $('body').on('click', '.wpd-field-button', function () {
53
  var fieldType = $(this).attr('id');
54
  var fieldTitle = $(this).text();
55
  var defaultField = '0';
74
  });
75
  });
76
 
77
+ $('body').on('click', '#wpd-add-field-button', function () {
78
  var tbForm = $('#TB_ajaxContent_form');
79
  tbForm.submit(function (event) {
80
  event.preventDefault();
129
  function wpdFieldLoad() {
130
  $('#TB_ajaxContent').html('<img class="wpdFieldLoad" src="' + wpdFormAdminOptions.loaderImg + '">');
131
  }
132
+ $('body').on('click', '.wpd-advaced-options-title', function(){
133
  $(this).next('.wpd-advaced-options-cont').toggle();
134
  });
135
  });
assets/js/wpdiscuz-deactivation.js CHANGED
@@ -2,7 +2,7 @@ jQuery(document).ready(function ($) {
2
 
3
  var deactivateUrl = '';
4
 
5
- $(document).on('click', '#the-list tr[data-plugin="wpdiscuz/class.WpdiscuzCore.php"] .deactivate a', function (e) {
6
  e.preventDefault();
7
  $('#wpdDeactivationReasonAnchor').trigger('click');
8
  deactivateUrl = $(this).attr('href');
@@ -13,13 +13,13 @@ jQuery(document).ready(function ($) {
13
  $('.wpd-deactivation-reason-more-info').slideUp(500);
14
  $('.wpd-deactivation-reason-more-info', parentItem).slideDown(500);
15
 
16
- $(document).on('change', '.wpd-deactivation-reason', function (e) {
17
  $('.wpd-deactivation-reason-more-info').slideUp(500);
18
  var parentItem = $(this).parents('.wpd-deactivation-reason-item');
19
  $('.wpd-deactivation-reason-more-info', parentItem).slideDown(500);
20
  });
21
 
22
- $(document).on('click', '.wpd-deactivate', function (e) {
23
  if (isChecked($(this))) {
24
  var formData = '';
25
  if ($(this).hasClass('wpd-submit')) {
2
 
3
  var deactivateUrl = '';
4
 
5
+ $('body').on('click', '#the-list tr[data-plugin="wpdiscuz/class.WpdiscuzCore.php"] .deactivate a', function (e) {
6
  e.preventDefault();
7
  $('#wpdDeactivationReasonAnchor').trigger('click');
8
  deactivateUrl = $(this).attr('href');
13
  $('.wpd-deactivation-reason-more-info').slideUp(500);
14
  $('.wpd-deactivation-reason-more-info', parentItem).slideDown(500);
15
 
16
+ $('body').on('change', '.wpd-deactivation-reason', function (e) {
17
  $('.wpd-deactivation-reason-more-info').slideUp(500);
18
  var parentItem = $(this).parents('.wpd-deactivation-reason-item');
19
  $('.wpd-deactivation-reason-more-info', parentItem).slideDown(500);
20
  });
21
 
22
+ $('body').on('click', '.wpd-deactivate', function (e) {
23
  if (isChecked($(this))) {
24
  var formData = '';
25
  if ($(this).hasClass('wpd-submit')) {
assets/js/wpdiscuz-mu-backend.js CHANGED
@@ -1,24 +1,24 @@
1
  jQuery(document).ready(function ($) {
2
 
3
- $(document).on('click', '#wmuSelectMimes', function (e) {
4
  $('.wpd-mu-mimes input[type="checkbox"]').each(function (i, v) {
5
  $(this).prop('checked', true);
6
  });
7
  });
8
 
9
- $(document).on('click', '#wmuUnselectMimes', function (e) {
10
  $('.wpd-mu-mimes input[type="checkbox"]').each(function (i, v) {
11
  $(this).prop('checked', false);
12
  });
13
  });
14
 
15
- $(document).on('click', '#wmuInvertMimes', function (e) {
16
  $('.wpd-mu-mimes input[type="checkbox"]').each(function (i, v) {
17
  $(this).prop('checked', !$(this).prop('checked'));
18
  });
19
  });
20
 
21
- $(document).on('click', '.wmu-attachment-delete', function (e) {
22
  if (confirm(wpdiscuzMUJsObj.wmuMsgConfirmAttachmentDelete)) {
23
  var data = new FormData();
24
  var clicked = $(this);
@@ -41,7 +41,7 @@ jQuery(document).ready(function ($) {
41
  }
42
  });
43
 
44
- $(document).on('change', '.wmu-image-dimension', function () {
45
  var parent = $(this).parents('.wpd-opt-row');
46
  var wmuSingleImageW = $('.wmu-image-width', parent);
47
  var wmuSingleImageH = $('.wmu-image-height', parent);
@@ -65,7 +65,7 @@ jQuery(document).ready(function ($) {
65
  }
66
  });
67
 
68
- $(document).on('keyup', '.wmu-image-dimension', function () {
69
  var value = $(this).val();
70
  $(this).val(value.replace('-', ''));
71
  });
1
  jQuery(document).ready(function ($) {
2
 
3
+ $('body').on('click', '#wmuSelectMimes', function (e) {
4
  $('.wpd-mu-mimes input[type="checkbox"]').each(function (i, v) {
5
  $(this).prop('checked', true);
6
  });
7
  });
8
 
9
+ $('body').on('click', '#wmuUnselectMimes', function (e) {
10
  $('.wpd-mu-mimes input[type="checkbox"]').each(function (i, v) {
11
  $(this).prop('checked', false);
12
  });
13
  });
14
 
15
+ $('body').on('click', '#wmuInvertMimes', function (e) {
16
  $('.wpd-mu-mimes input[type="checkbox"]').each(function (i, v) {
17
  $(this).prop('checked', !$(this).prop('checked'));
18
  });
19
  });
20
 
21
+ $('body').on('click', '.wmu-attachment-delete', function (e) {
22
  if (confirm(wpdiscuzMUJsObj.wmuMsgConfirmAttachmentDelete)) {
23
  var data = new FormData();
24
  var clicked = $(this);
41
  }
42
  });
43
 
44
+ $('body').on('change', '.wmu-image-dimension', function () {
45
  var parent = $(this).parents('.wpd-opt-row');
46
  var wmuSingleImageW = $('.wmu-image-width', parent);
47
  var wmuSingleImageH = $('.wmu-image-height', parent);
65
  }
66
  });
67
 
68
+ $('body').on('keyup', '.wmu-image-dimension', function () {
69
  var value = $(this).val();
70
  $(this).val(value.replace('-', ''));
71
  });
assets/js/wpdiscuz-mu-frontend.js CHANGED
@@ -1,10 +1,10 @@
1
  jQuery(document).ready(function ($) {
2
 
3
- $(document).on('click', '#wpdcom .wmu-upload-wrap', function () {
4
  $('.wpd-form-foot', $(this).parents('.wpd_comm_form')).slideDown(parseInt(wpdiscuzAjaxObj.enableDropAnimation) ? 500 : 0);
5
  });
6
 
7
- $(document).on('change', '.wmu-add-files', function () {
8
  var btn = $(this);
9
  var form = btn.parents('.wpd_comm_form');
10
  var files = btn[0].files ? btn[0].files : [];
@@ -88,7 +88,7 @@ jQuery(document).ready(function ($) {
88
  });
89
  }
90
 
91
- $(document).on('click', '.wmu-attachment-delete', function (e) {
92
  if (confirm(wpdiscuzAjaxObj.wmuPhraseConfirmDelete)) {
93
  var btn = $(this);
94
  var attachmentId = btn.data('wmu-attachment');
@@ -130,7 +130,7 @@ jQuery(document).ready(function ($) {
130
  * ajax request
131
  * remove preview from frontend (html) and backend (db data)
132
  */
133
- $(document).on('click', '.wmu-preview', function () {
134
  var btn = $(this);
135
  var form = btn.parents('.wpd_comm_form');
136
  var type = btn.data('wmu-type');
1
  jQuery(document).ready(function ($) {
2
 
3
+ $('body').on('click', '#wpdcom .wmu-upload-wrap', function () {
4
  $('.wpd-form-foot', $(this).parents('.wpd_comm_form')).slideDown(parseInt(wpdiscuzAjaxObj.enableDropAnimation) ? 500 : 0);
5
  });
6
 
7
+ $('body').on('change', '.wmu-add-files', function () {
8
  var btn = $(this);
9
  var form = btn.parents('.wpd_comm_form');
10
  var files = btn[0].files ? btn[0].files : [];
88
  });
89
  }
90
 
91
+ $('body').on('click', '.wmu-attachment-delete', function (e) {
92
  if (confirm(wpdiscuzAjaxObj.wmuPhraseConfirmDelete)) {
93
  var btn = $(this);
94
  var attachmentId = btn.data('wmu-attachment');
130
  * ajax request
131
  * remove preview from frontend (html) and backend (db data)
132
  */
133
+ $('body').on('click', '.wmu-preview', function () {
134
  var btn = $(this);
135
  var form = btn.parents('.wpd_comm_form');
136
  var type = btn.data('wmu-type');
assets/js/wpdiscuz-mu-frontend.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function(a){if(a(document).on("click","#wpdcom .wmu-upload-wrap",function(){a(".wpd-form-foot",a(this).parents(".wpd_comm_form")).slideDown(parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0)}),a(document).on("change",".wmu-add-files",function(){var e=a(this),t=e.parents(".wpd_comm_form"),d=e[0].files?e[0].files:[];d.length&&function(e,t,d){t.attr("data-uploading","true");var o=new FormData;o.append("action","wmuUploadFiles"),o.append("wmuAttachmentsData",a(".wmu-attachments-data",t).val()),o.append("uniqueId",t.find(".wpdiscuz_unique_id").val());var i=0;a.each(d,function(a,e){i+=e.size,o.append(wpdiscuzAjaxObj.wmuInput+"["+a+"]",e)}),i>parseInt(wpdiscuzAjaxObj.wmuMaxFileSize)?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhraseMaxFileSize,"wmuPhraseMaxFileSize",e),"error",3e3):i>parseInt(wpdiscuzAjaxObj.wmuPostMaxSize)?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhrasePostMaxSize,"wmuPhrasePostMaxSize",e),"error",3e3):wpdiscuzAjaxObj.getAjaxObj(!0,!0,o).done(function(e){e.success?(a(".wmu-attached-data-info",t).remove(),a(".wmu-add-files",t).after(e.data.attachmentsHtml),e.data.tooltip&&a(".wmu-upload-wrap",t).attr("wpd-tooltip",e.data.tooltip),function(e,t){a.each(t.data.previewsData,function(t,d){a(".wmu-action-wrap .wmu-"+t+"-tab",e).html(""),a.each(d,function(d,o){var i=o.id,r="",s=o.fullname,u=o.shortname;t==wpdiscuzAjaxObj.wmuKeyImages?(r=o.url,u=""):t==wpdiscuzAjaxObj.wmuKeyVideos?r=wpdiscuzAjaxObj.wmuIconVideo:t==wpdiscuzAjaxObj.wmuKeyFiles&&(r=wpdiscuzAjaxObj.wmuIconFile);var n='<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>';n=(n=(n=(n=(n=(n=n.replace("[PREVIEW_TYPE_CLASS]","wmu-preview-"+t)).replace("[PREVIEW_TITLE]",s)).replace("[PREVIEW_TYPE]",t)).replace("[PREVIEW_ID]",i)).replace("[PREVIEW_ICON]",r)).replace("[PREVIEW_FILENAME]",u),a(".wmu-action-wrap .wmu-"+t+"-tab",e).removeClass("wmu-hide").append(n)})})}(t,e),e.data.errors&&(wpdiscuzAjaxObj.setCommentMessage(e.data.errors,"error",3e3),console.log(e.data.errors))):e.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[e.data.errorCode],e.data.errorCode,t),"error",3e3):e.data.error&&wpdiscuzAjaxObj.setCommentMessage(e.data.error,"error",3e3),a("#wpdiscuz-loading-bar").fadeOut(250),t.attr("data-uploading","false")}).fail(function(e,d,o){console.log(o),a("#wpdiscuz-loading-bar").fadeOut(250),t.attr("data-uploading","false")})}(e,t,d)}),a(document).on("click",".wmu-attachment-delete",function(e){if(confirm(wpdiscuzAjaxObj.wmuPhraseConfirmDelete)){var t=a(this).data("wmu-attachment"),d=new FormData;d.append("action","wmuDeleteAttachment"),d.append("attachmentId",t),wpdiscuzAjaxObj.getAjaxObj(!0,!0,d).done(function(e){if(e.success){var d=a(".wmu-attachment-"+t).parents(".wmu-comment-attachments");a(".wmu-attachment-"+t).remove(),a(".wmu-attached-images *",d).length||a(".wmu-attached-images",d).remove(),a(".wmu-attached-videos *",d).length||a(".wmu-attached-videos",d).remove(),a(".wmu-attached-files *",d).length||a(".wmu-attached-files",d).remove()}else e.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[e.data.errorCode],e.data.errorCode,d),"error",3e3):e.data.error&&wpdiscuzAjaxObj.setCommentMessage(e.data.error,"error",3e3);a("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,d){console.log(d),a("#wpdiscuz-loading-bar").fadeOut(250)})}else console.log("canceled")}),a(document).on("click",".wmu-preview",function(){var e=a(this),t=e.parents(".wpd_comm_form"),d=(e.data("wmu-type"),e.data("wmu-attachment")),o=new FormData;o.append("action","wmuRemoveAttachmentPreview"),o.append("attachmentId",d),o.append("wmuAttachmentsData",a(".wmu-attachments-data",t).val()),o.append("uniqueId",t.find(".wpdiscuz_unique_id").val()),wpdiscuzAjaxObj.getAjaxObj(!0,!0,o).done(function(d){if(d.success){e.remove();var o=a(".wmu-tabs",t);a.each(o,function(e,t){a(".wmu-preview",t).length?a(t).removeClass("wmu-hide"):a(t).addClass("wmu-hide")}),a(".wmu-attached-data-info",t).remove(),a(".wmu-add-files",t).after(d.data.attachmentsHtml),d.data.tooltip&&a(".wmu-upload-wrap",t).attr("wpd-tooltip",d.data.tooltip)}else d.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[d.data.errorCode],d.data.errorCode,t),"error",3e3):d.data.error&&wpdiscuzAjaxObj.setCommentMessage(d.data.error,"error",3e3);a("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,d){console.log(d),a("#wpdiscuz-loading-bar").fadeOut(250)})}),parseInt(wpdiscuzAjaxObj.wmuIsLightbox)){function e(){a(".wmu-lightbox").colorbox({maxHeight:"95%",maxWidth:"95%",rel:"wmu-lightbox",fixed:!0})}e(),wpdiscuzAjaxObj.wmuAddLightBox=e}wpdiscuzAjaxObj.wmuHideAll=function(e,t){"object"==typeof e?e.success?(a(".wmu-tabs",t).addClass("wmu-hide"),a(".wmu-preview",t).remove(),a(".wmu-attached-data-info",t).remove()):console.log(e.data):console.log(e)}});
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)}})
assets/js/wpdiscuz-notes.js CHANGED
@@ -1,8 +1,8 @@
1
  jQuery(document).ready(function ($) {
2
- $(document).on('click', '.wpdiscuz_addon_note .notice-dismiss', function () {
3
  $.ajax({url: ajaxurl, data: {action: 'dismiss_wpdiscuz_addon_note'}})
4
  })
5
- $(document).on('click', '.wpdiscuz_tip_note .notice-dismiss', function () {
6
  var tipid = $('#wpdiscuz_tip_note_value').val();
7
  $.ajax({url: ajaxurl, data: {action: 'dismiss_wpdiscuz_tip_note', tip: tipid}})
8
  })
1
  jQuery(document).ready(function ($) {
2
+ $('body').on('click', '.wpdiscuz_addon_note .notice-dismiss', function () {
3
  $.ajax({url: ajaxurl, data: {action: 'dismiss_wpdiscuz_addon_note'}})
4
  })
5
+ $('body').on('click', '.wpdiscuz_tip_note .notice-dismiss', function () {
6
  var tipid = $('#wpdiscuz_tip_note_value').val();
7
  $.ajax({url: ajaxurl, data: {action: 'dismiss_wpdiscuz_tip_note', tip: tipid}})
8
  })
assets/js/wpdiscuz-options.js CHANGED
@@ -6,44 +6,44 @@ jQuery(document).ready(function ($) {
6
  $('.wpdiscuz-color-picker').wpColorPicker();
7
  }
8
 
9
- $(document).on('click', '#wc_share_button_fb',function () {
10
  if ($(this).is(':checked')) {
11
  $('#wpc-fb-api-cont').attr('style', '');
12
  } else {
13
  $('#wpc-fb-api-cont').attr('style', 'display:none');
14
  }
15
  });
16
- $(document).on('click', '#wpdiscuz-reset-all-options', function (e) {
17
  if (!confirm(wpdiscuzObj.msgConfirmResetOptions)) {
18
  e.preventDefault();
19
  return false;
20
  }
21
  });
22
- $(document).on('click', '#wpdiscuz-reset-options', function (e) {
23
  if (!confirm(wpdiscuzObj.msgConfirmResetTabOptions)) {
24
  e.preventDefault();
25
  return false;
26
  }
27
  });
28
- $(document).on('click', '#wpdiscuz-remove-votes', function (e) {
29
  if (!confirm(wpdiscuzObj.msgConfirmRemoveVotes)) {
30
  e.preventDefault();
31
  return false;
32
  }
33
  });
34
- $(document).on('click', '#wpdiscuz-reset-phrases', function (e) {
35
  if (!confirm(wpdiscuzObj.msgConfirmResetPhrases)) {
36
  e.preventDefault();
37
  return false;
38
  }
39
  });
40
- $(document).on('click', '#wpdiscuz-purge-cache', function (e) {
41
  if (!confirm(wpdiscuzObj.msgConfirmPurgeCache)) {
42
  e.preventDefault();
43
  return false;
44
  }
45
  });
46
- $(document).on('click', '.wpd_stick_btn', function (e) {
47
  var btn = $(this);
48
  $('.fas', btn).removeClass('fa-thumbtack');
49
  $('.fas', btn).addClass('fa-pulse fa-spinner');
@@ -53,7 +53,7 @@ jQuery(document).ready(function ($) {
53
  data.append('action', 'wpdStickComment');
54
  data.append('commentId', commentId);
55
  data.append('postId', postId);
56
- data.append('wpdiscuz_nonce',wpdiscuzObj.wpdiscuz_nonce);
57
  $.ajax({
58
  type: 'POST',
59
  url: ajaxurl,
@@ -78,7 +78,7 @@ jQuery(document).ready(function ($) {
78
  e.preventDefault();
79
  return false;
80
  });
81
- $(document).on('click', '.wpd_close_btn', function (e) {
82
  var btn = $(this);
83
  $('.fas', btn).removeClass('fa-lock fa-unlock');
84
  $('.fas', btn).addClass('fa-spinner fa-pulse');
@@ -88,7 +88,7 @@ jQuery(document).ready(function ($) {
88
  data.append('action', 'wpdCloseThread');
89
  data.append('commentId', commentId);
90
  data.append('postId', postId);
91
- data.append('wpdiscuz_nonce',wpdiscuzObj.wpdiscuz_nonce);
92
  $.ajax({
93
  type: 'POST',
94
  url: ajaxurl,
@@ -114,7 +114,7 @@ jQuery(document).ready(function ($) {
114
  e.preventDefault();
115
  return false;
116
  });
117
- $(document).on('click', '.import-stcr', function (e) {
118
  e.preventDefault();
119
  var btn = $(this);
120
  btn.prop('disabled', true);
@@ -127,7 +127,7 @@ jQuery(document).ready(function ($) {
127
  $.ajax({
128
  type: 'POST',
129
  url: ajaxurl,
130
- data: {stcrData: data, 'action': 'wpdImportSTCR' , wpdiscuz_nonce: wpdiscuzObj.wpdiscuz_nonce}
131
  }).done(function (response) {
132
  try {
133
  var resp = JSON.parse(response);
@@ -161,7 +161,7 @@ jQuery(document).ready(function ($) {
161
  });
162
  }
163
 
164
- $(document).on('click', '.import-lstc', function (e) {
165
  e.preventDefault();
166
  var btn = $(this);
167
  btn.prop('disabled', true);
@@ -174,7 +174,7 @@ jQuery(document).ready(function ($) {
174
  $.ajax({
175
  type: 'POST',
176
  url: ajaxurl,
177
- data: {lstcData: data, 'action': 'wpdImportLSTC', wpdiscuz_nonce: wpdiscuzObj.wpdiscuz_nonce}
178
  }).done(function (response) {
179
  try {
180
  var resp = JSON.parse(response);
@@ -209,7 +209,7 @@ jQuery(document).ready(function ($) {
209
  }
210
 
211
  $('.vote-regenerate-step').val(0);
212
- $(document).on('click', '.regenerate-vote-metas', function (e) {
213
  e.preventDefault();
214
  if ($('.vote-regenerate-start-id').val() >= 0 && parseInt($('.vote-regenerate-limit').val()) > 0) {
215
  var btn = $(this);
@@ -263,7 +263,7 @@ jQuery(document).ready(function ($) {
263
  }
264
 
265
  $('.closed-regenerate-step').val(0);
266
- $(document).on('click', '.regenerate-closed-comments', function (e) {
267
  e.preventDefault();
268
  if ($('.closed-regenerate-start-id').val() >= 0 && parseInt($('.closed-regenerate-limit').val()) > 0) {
269
  var btn = $(this);
@@ -317,7 +317,7 @@ jQuery(document).ready(function ($) {
317
  }
318
 
319
  $('.regenerate-vote-data-step').val(0);
320
- $(document).on('click', '.regenerate-vote-data', function (e) {
321
  e.preventDefault();
322
  if ($('.regenerate-vote-data-start-id').val() >= 0 && parseInt($('.regenerate-vote-data-limit').val()) > 0) {
323
  var btn = $(this);
@@ -370,7 +370,7 @@ jQuery(document).ready(function ($) {
370
  });
371
  }
372
 
373
- $(document).on('click', '.sync-commenter-data', function (e) {
374
  e.preventDefault();
375
  var btn = $(this);
376
  btn.prop('disabled', true);
@@ -406,7 +406,7 @@ jQuery(document).ready(function ($) {
406
  }
407
 
408
  $('.rebuild-ratings-step').val(0);
409
- $(document).on('click', '.rebuild-ratings', function (e) {
410
  e.preventDefault();
411
  if ($('.rebuild-ratings-start-id').val() >= 0) {
412
  var btn = $(this);
@@ -458,7 +458,7 @@ jQuery(document).ready(function ($) {
458
  console.log(errorThrown);
459
  });
460
  }
461
- $(document).on('click', '.fix-tables', function (e) {
462
  e.preventDefault();
463
  var btn = $(this);
464
  btn.prop('disabled', true);
@@ -490,7 +490,7 @@ jQuery(document).ready(function ($) {
490
  });
491
  }
492
 
493
- $(document).on('click', '#wpd-disable-addons', function () {
494
  location.href = $('#wpd-disable-addons-action').val();
495
  });
496
  window.addEventListener('beforeunload', function (e) {
@@ -515,7 +515,7 @@ jQuery(document).ready(function ($) {
515
  if (showActivityTab || showFollowsTab || showSubscriptionsTab) {
516
  $('#showUserSettingsButton').prop('checked', true);
517
  }
518
- $(document).on('change', '#showUserSettingsButton', function () {
519
  if ($(this).prop('checked')) {
520
  if (showActivityTab || showFollowsTab || showSubscriptionsTab) {
521
  if (showActivityTab) {
@@ -538,35 +538,35 @@ jQuery(document).ready(function ($) {
538
  $('#showFollowsTab').prop('checked', false);
539
  }
540
  });
541
- $(document).on('change', '#showActivityTab', function () {
542
  if ($(this).prop('checked') || ($('#showSubscriptionsTab').prop('checked') || $('#showFollowsTab').prop('checked'))) {
543
  $('#showUserSettingsButton').prop('checked', true);
544
  } else {
545
  $('#showUserSettingsButton').prop('checked', false);
546
  }
547
  });
548
- $(document).on('change', '#showSubscriptionsTab', function () {
549
  if ($(this).prop('checked') || ($('#showActivityTab').prop('checked') || $('#showFollowsTab').prop('checked'))) {
550
  $('#showUserSettingsButton').prop('checked', true);
551
  } else {
552
  $('#showUserSettingsButton').prop('checked', false);
553
  }
554
  });
555
- $(document).on('change', '#showFollowsTab', function () {
556
  if ($(this).prop('checked') || ($('#showActivityTab').prop('checked') || $('#showSubscriptionsTab').prop('checked'))) {
557
  $('#showUserSettingsButton').prop('checked', true);
558
  } else {
559
  $('#showUserSettingsButton').prop('checked', false);
560
  }
561
  });
562
- $(document).on('change', '#enableProfileURLs', function () {
563
  if (!$(this).prop('checked')) {
564
  $('#websiteAsProfileUrl').prop('checked', false);
565
  }
566
  });
567
  //========================= /SETTINGS_LOGIN =====================//
568
  //========================= SETTINGS_RECAPTCHA =====================//
569
- $(document).on('change', '#siteKey, #secretKey, #v3_sitekey, #v3_secretkey, #useV3', function () {
570
  if ((!$('#useV3').prop('checked') && $('#siteKey').val() && $('#secretKey').val()) || ($('#useV3').prop('checked') && $('#v3_sitekey').val() && $('#v3_secretkey').val())) {
571
  $('#showForGuests').prop('checked', true);
572
  }
@@ -580,7 +580,7 @@ jQuery(document).ready(function ($) {
580
  }
581
  }, 1000);
582
  }
583
- $(document).on('click', '.wpd-toggle-news', function () {
584
  var dash = $(this).children('.dashicons');
585
  if (dash.hasClass('dashicons-arrow-down')) {
586
  $('#wpdiscuz-news').show();
@@ -612,7 +612,7 @@ jQuery(document).ready(function ($) {
612
  var body = el.parents('.wpd-box').children('.wpd-box-body');
613
  wpd_stat_user(el, body);
614
  }
615
- $(document).on('click', '.wpd-box-toggle .dashicons-arrow-up.wpd_not_clicked, .wpd-box-toggle .dashicons-arrow-down.wpd_not_clicked', function () {
616
  var el = $(this);
617
  el.removeClass('wpd_not_clicked');
618
  var show = el.hasClass('dashicons-arrow-down') ? 1 : 0;
@@ -634,22 +634,22 @@ jQuery(document).ready(function ($) {
634
  el.addClass('wpd_not_clicked');
635
  }
636
  });
637
- $(document).on('click', '.wpd-stat-graph .wpd-box-toggle .dashicons-admin-generic', function () {
638
  var sibling = $(this).siblings('.wpd-graph-tools');
639
  sibling.css({display: sibling.is(':visible') ? 'none' : 'flex'});
640
  });
641
- $(document).on('click', 'body', function (e) {
642
  if (!$(e.target).hasClass('dashicons-admin-generic')) {
643
  $('.wpd-stat-graph .wpd-box-toggle .wpd-graph-tools, #wpd-opt-search-results').hide();
644
  }
645
  });
646
- $(document).on('click', '.wpd-stat-graph .wpd-box-toggle .wpd-graph-tools span.wpd_not_clicked', function () {
647
  var el = $(this);
648
  el.removeClass('wpd_not_clicked');
649
  Cookies.set('wpd_stat_graph_interval', el.data('interval'), {expires: 365, path: location.href});
650
  wpd_stat_graph(el, el.parents('.wpd-box').children('.wpd-box-body'));
651
  });
652
- $(document).on('click', '.wpd-stat-user .wpd-sort-field', function () {
653
  var el = $(this);
654
  var order = el.hasClass('wpd-active') && el.children('.dashicons').hasClass('dashicons-arrow-down-alt2') ? 'asc' : 'desc';
655
  Cookies.set('wpd_stat_user_orderby', el.data('orderby'), {expires: 365, path: location.href});
@@ -657,7 +657,7 @@ jQuery(document).ready(function ($) {
657
  wpdStatUserPage = 1;
658
  wpd_stat_user(el, el.parents('.wpd-box').children('.wpd-box-body'));
659
  });
660
- $(document).on('click', '.wpd-stat-user .wpd-box-toggle .dashicons-arrow-left.wpd_not_clicked, .wpd-stat-user .wpd-box-toggle .dashicons-arrow-right.wpd_not_clicked', function () {
661
  var el = $(this);
662
  if (el.hasClass('dashicons-arrow-left')) {
663
  if (wpdStatUserPage > 1) {
@@ -680,17 +680,19 @@ jQuery(document).ready(function ($) {
680
  var matches = location.href.match(/#wpdOpt\-(\w+)/);
681
  if (matches !== null) {
682
  var wpdopt = $('[data-wpd-opt=' + matches[1] + ']');
683
- $('html, body').animate({
684
- scrollTop: wpdopt.offset().top - 32
685
- }, 500, function () {
686
- wpdopt.css('background-color', '#ebebeb');
687
- setTimeout(function () {
688
- wpdopt.css('background-color', 'transparent');
689
- }, 500);
690
- });
 
 
691
  }
692
  }
693
- $(document).on('keydown', '#wpd-opt-search-field, #wpd-opt-search-results', function (e) {
694
  var keycode = e.which;
695
  if (keycode == 27) {
696
  $('#wpd-opt-search-results').hide();
@@ -734,7 +736,7 @@ jQuery(document).ready(function ($) {
734
  $('#wpd-opt-search-field').focus();
735
  }
736
  });
737
- $(document).on('input', '#wpd-opt-search-field', function () {
738
  var s = $(this).val();
739
  s = s.trim();
740
  if (s.length > 2) {
@@ -763,7 +765,7 @@ jQuery(document).ready(function ($) {
763
  });
764
  //========================= /SETTING SEARCH =====================//
765
  //========================= SETTINGS MENU =====================//
766
- $(document).on('click', '.wpd-setbar .wpd-menu-head .dashicons-arrow-down, .wpd-setbar .wpd-menu-head .dashicons-arrow-up', function () {
767
  var $this = $(this);
768
  var up = $this.hasClass('dashicons-arrow-up');
769
  $this.toggleClass('dashicons-arrow-down dashicons-arrow-up');
@@ -775,7 +777,7 @@ jQuery(document).ready(function ($) {
775
  });
776
  //========================= /SETTINGS MENU =====================//
777
  //========================= TOOLBAR OPTIONS =====================//
778
- $(document).on('click', '.wpd-editor-toolbar .wpd-editor-button', function () {
779
  if ($(this).hasClass('wpd-enabled')) {
780
  $(this).removeClass('wpd-enabled');
781
  $(this).addClass('wpd-disabled');
@@ -786,14 +788,14 @@ jQuery(document).ready(function ($) {
786
  $('#' + $(this).attr('id') + '-button').val(1);
787
  }
788
  });
789
- $(document).on('click', '.wpd-editor-toolbar #wpdeb_disable', function () {
790
  $('.wpd-editor-toolbar .wpd-editor-button').removeClass('wpd-enabled');
791
  $('.wpd-editor-toolbar .wpd-editor-button').addClass('wpd-disabled');
792
  $('.wpd-editor-toolbar .wpd-editor-button').next('input').val(0);
793
  $(this).hide();
794
  $('.wpd-editor-toolbar #wpdeb_enable').show();
795
  });
796
- $(document).on('click', '.wpd-editor-toolbar #wpdeb_enable', function () {
797
  $('.wpd-editor-toolbar .wpd-editor-button').addClass('wpd-enabled');
798
  $('.wpd-editor-toolbar .wpd-editor-button').removeClass('wpd-disabled');
799
  $('.wpd-editor-toolbar .wpd-editor-button').next('input').val(1);
@@ -821,7 +823,7 @@ jQuery(document).ready(function ($) {
821
  toolsAccordion(item);
822
  }
823
 
824
- $(document).on('click', '.wpdtool-accordion-title', function () {
825
  var item = $(this);
826
 
827
  if (!supportsHash) {
@@ -864,6 +866,103 @@ jQuery(document).ready(function ($) {
864
  }
865
  /* TOOLS PAGE ACCORDION */
866
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
867
  });
868
  //========================= DASHBOARD =====================//
869
  var wpdSpinner = '<div class="wpd-spinner"><span class="spinner"></span></div>';
6
  $('.wpdiscuz-color-picker').wpColorPicker();
7
  }
8
 
9
+ $('body').on('click', '#wc_share_button_fb', function () {
10
  if ($(this).is(':checked')) {
11
  $('#wpc-fb-api-cont').attr('style', '');
12
  } else {
13
  $('#wpc-fb-api-cont').attr('style', 'display:none');
14
  }
15
  });
16
+ $('body').on('click', '#wpdiscuz-reset-all-options', function (e) {
17
  if (!confirm(wpdiscuzObj.msgConfirmResetOptions)) {
18
  e.preventDefault();
19
  return false;
20
  }
21
  });
22
+ $('body').on('click', '#wpdiscuz-reset-options', function (e) {
23
  if (!confirm(wpdiscuzObj.msgConfirmResetTabOptions)) {
24
  e.preventDefault();
25
  return false;
26
  }
27
  });
28
+ $('body').on('click', '#wpdiscuz-remove-votes', function (e) {
29
  if (!confirm(wpdiscuzObj.msgConfirmRemoveVotes)) {
30
  e.preventDefault();
31
  return false;
32
  }
33
  });
34
+ $('body').on('click', '#wpdiscuz-reset-phrases', function (e) {
35
  if (!confirm(wpdiscuzObj.msgConfirmResetPhrases)) {
36
  e.preventDefault();
37
  return false;
38
  }
39
  });
40
+ $('body').on('click', '#wpdiscuz-purge-cache', function (e) {
41
  if (!confirm(wpdiscuzObj.msgConfirmPurgeCache)) {
42
  e.preventDefault();
43
  return false;
44
  }
45
  });
46
+ $('body').on('click', '.wpd_stick_btn', function (e) {
47
  var btn = $(this);
48
  $('.fas', btn).removeClass('fa-thumbtack');
49
  $('.fas', btn).addClass('fa-pulse fa-spinner');
53
  data.append('action', 'wpdStickComment');
54
  data.append('commentId', commentId);
55
  data.append('postId', postId);
56
+ data.append('wpdiscuz_nonce', wpdiscuzObj.wpdiscuz_nonce);
57
  $.ajax({
58
  type: 'POST',
59
  url: ajaxurl,
78
  e.preventDefault();
79
  return false;
80
  });
81
+ $('body').on('click', '.wpd_close_btn', function (e) {
82
  var btn = $(this);
83
  $('.fas', btn).removeClass('fa-lock fa-unlock');
84
  $('.fas', btn).addClass('fa-spinner fa-pulse');
88
  data.append('action', 'wpdCloseThread');
89
  data.append('commentId', commentId);
90
  data.append('postId', postId);
91
+ data.append('wpdiscuz_nonce', wpdiscuzObj.wpdiscuz_nonce);
92
  $.ajax({
93
  type: 'POST',
94
  url: ajaxurl,
114
  e.preventDefault();
115
  return false;
116
  });
117
+ $('body').on('click', '.import-stcr', function (e) {
118
  e.preventDefault();
119
  var btn = $(this);
120
  btn.prop('disabled', true);
127
  $.ajax({
128
  type: 'POST',
129
  url: ajaxurl,
130
+ data: {stcrData: data, 'action': 'wpdImportSTCR', wpdiscuz_nonce: wpdiscuzObj.wpdiscuz_nonce}
131
  }).done(function (response) {
132
  try {
133
  var resp = JSON.parse(response);
161
  });
162
  }
163
 
164
+ $('body').on('click', '.import-lstc', function (e) {
165
  e.preventDefault();
166
  var btn = $(this);
167
  btn.prop('disabled', true);
174
  $.ajax({
175
  type: 'POST',
176
  url: ajaxurl,
177
+ data: {lstcData: data, 'action': 'wpdImportLSTC', wpdiscuz_nonce: wpdiscuzObj.wpdiscuz_nonce}
178
  }).done(function (response) {
179
  try {
180
  var resp = JSON.parse(response);
209
  }
210
 
211
  $('.vote-regenerate-step').val(0);
212
+ $('body').on('click', '.regenerate-vote-metas', function (e) {
213
  e.preventDefault();
214
  if ($('.vote-regenerate-start-id').val() >= 0 && parseInt($('.vote-regenerate-limit').val()) > 0) {
215
  var btn = $(this);
263
  }
264
 
265
  $('.closed-regenerate-step').val(0);
266
+ $('body').on('click', '.regenerate-closed-comments', function (e) {
267
  e.preventDefault();
268
  if ($('.closed-regenerate-start-id').val() >= 0 && parseInt($('.closed-regenerate-limit').val()) > 0) {
269
  var btn = $(this);
317
  }
318
 
319
  $('.regenerate-vote-data-step').val(0);
320
+ $('body').on('click', '.regenerate-vote-data', function (e) {
321
  e.preventDefault();
322
  if ($('.regenerate-vote-data-start-id').val() >= 0 && parseInt($('.regenerate-vote-data-limit').val()) > 0) {
323
  var btn = $(this);
370
  });
371
  }
372
 
373
+ $('body').on('click', '.sync-commenter-data', function (e) {
374
  e.preventDefault();
375
  var btn = $(this);
376
  btn.prop('disabled', true);
406
  }
407
 
408
  $('.rebuild-ratings-step').val(0);
409
+ $('body').on('click', '.rebuild-ratings', function (e) {
410
  e.preventDefault();
411
  if ($('.rebuild-ratings-start-id').val() >= 0) {
412
  var btn = $(this);
458
  console.log(errorThrown);
459
  });
460
  }
461
+ $('body').on('click', '.fix-tables', function (e) {
462
  e.preventDefault();
463
  var btn = $(this);
464
  btn.prop('disabled', true);
490
  });
491
  }
492
 
493
+ $('body').on('click', '#wpd-disable-addons', function () {
494
  location.href = $('#wpd-disable-addons-action').val();
495
  });
496
  window.addEventListener('beforeunload', function (e) {
515
  if (showActivityTab || showFollowsTab || showSubscriptionsTab) {
516
  $('#showUserSettingsButton').prop('checked', true);
517
  }
518
+ $('body').on('change', '#showUserSettingsButton', function () {
519
  if ($(this).prop('checked')) {
520
  if (showActivityTab || showFollowsTab || showSubscriptionsTab) {
521
  if (showActivityTab) {
538
  $('#showFollowsTab').prop('checked', false);
539
  }
540
  });
541
+ $('body').on('change', '#showActivityTab', function () {
542
  if ($(this).prop('checked') || ($('#showSubscriptionsTab').prop('checked') || $('#showFollowsTab').prop('checked'))) {
543
  $('#showUserSettingsButton').prop('checked', true);
544
  } else {
545
  $('#showUserSettingsButton').prop('checked', false);
546
  }
547
  });
548
+ $('body').on('change', '#showSubscriptionsTab', function () {
549
  if ($(this).prop('checked') || ($('#showActivityTab').prop('checked') || $('#showFollowsTab').prop('checked'))) {
550
  $('#showUserSettingsButton').prop('checked', true);
551
  } else {
552
  $('#showUserSettingsButton').prop('checked', false);
553
  }
554
  });
555
+ $('body').on('change', '#showFollowsTab', function () {
556
  if ($(this).prop('checked') || ($('#showActivityTab').prop('checked') || $('#showSubscriptionsTab').prop('checked'))) {
557
  $('#showUserSettingsButton').prop('checked', true);
558
  } else {
559
  $('#showUserSettingsButton').prop('checked', false);
560
  }
561
  });
562
+ $('body').on('change', '#enableProfileURLs', function () {
563
  if (!$(this).prop('checked')) {
564
  $('#websiteAsProfileUrl').prop('checked', false);
565
  }
566
  });
567
  //========================= /SETTINGS_LOGIN =====================//
568
  //========================= SETTINGS_RECAPTCHA =====================//
569
+ $('body').on('change', '#siteKey, #secretKey, #v3_sitekey, #v3_secretkey, #useV3', function () {
570
  if ((!$('#useV3').prop('checked') && $('#siteKey').val() && $('#secretKey').val()) || ($('#useV3').prop('checked') && $('#v3_sitekey').val() && $('#v3_secretkey').val())) {
571
  $('#showForGuests').prop('checked', true);
572
  }
580
  }
581
  }, 1000);
582
  }
583
+ $('body').on('click', '.wpd-toggle-news', function () {
584
  var dash = $(this).children('.dashicons');
585
  if (dash.hasClass('dashicons-arrow-down')) {
586
  $('#wpdiscuz-news').show();
612
  var body = el.parents('.wpd-box').children('.wpd-box-body');
613
  wpd_stat_user(el, body);
614
  }
615
+ $('body').on('click', '.wpd-box-toggle .dashicons-arrow-up.wpd_not_clicked, .wpd-box-toggle .dashicons-arrow-down.wpd_not_clicked', function () {
616
  var el = $(this);
617
  el.removeClass('wpd_not_clicked');
618
  var show = el.hasClass('dashicons-arrow-down') ? 1 : 0;
634
  el.addClass('wpd_not_clicked');
635
  }
636
  });
637
+ $('body').on('click', '.wpd-stat-graph .wpd-box-toggle .dashicons-admin-generic', function () {
638
  var sibling = $(this).siblings('.wpd-graph-tools');
639
  sibling.css({display: sibling.is(':visible') ? 'none' : 'flex'});
640
  });
641
+ $('body').on('click', 'body', function (e) {
642
  if (!$(e.target).hasClass('dashicons-admin-generic')) {
643
  $('.wpd-stat-graph .wpd-box-toggle .wpd-graph-tools, #wpd-opt-search-results').hide();
644
  }
645
  });
646
+ $('body').on('click', '.wpd-stat-graph .wpd-box-toggle .wpd-graph-tools span.wpd_not_clicked', function () {
647
  var el = $(this);
648
  el.removeClass('wpd_not_clicked');
649
  Cookies.set('wpd_stat_graph_interval', el.data('interval'), {expires: 365, path: location.href});
650
  wpd_stat_graph(el, el.parents('.wpd-box').children('.wpd-box-body'));
651
  });
652
+ $('body').on('click', '.wpd-stat-user .wpd-sort-field', function () {
653
  var el = $(this);
654
  var order = el.hasClass('wpd-active') && el.children('.dashicons').hasClass('dashicons-arrow-down-alt2') ? 'asc' : 'desc';
655
  Cookies.set('wpd_stat_user_orderby', el.data('orderby'), {expires: 365, path: location.href});
657
  wpdStatUserPage = 1;
658
  wpd_stat_user(el, el.parents('.wpd-box').children('.wpd-box-body'));
659
  });
660
+ $('body').on('click', '.wpd-stat-user .wpd-box-toggle .dashicons-arrow-left.wpd_not_clicked, .wpd-stat-user .wpd-box-toggle .dashicons-arrow-right.wpd_not_clicked', function () {
661
  var el = $(this);
662
  if (el.hasClass('dashicons-arrow-left')) {
663
  if (wpdStatUserPage > 1) {
680
  var matches = location.href.match(/#wpdOpt\-(\w+)/);
681
  if (matches !== null) {
682
  var wpdopt = $('[data-wpd-opt=' + matches[1] + ']');
683
+ if (wpdopt.length) {
684
+ $('html, body').animate({
685
+ scrollTop: wpdopt.offset().top - 32
686
+ }, 500, function () {
687
+ wpdopt.css('background-color', '#ebebeb');
688
+ setTimeout(function () {
689
+ wpdopt.css('background-color', 'transparent');
690
+ }, 500);
691
+ });
692
+ }
693
  }
694
  }
695
+ $('body').on('keydown', '#wpd-opt-search-field, #wpd-opt-search-results', function (e) {
696
  var keycode = e.which;
697
  if (keycode == 27) {
698
  $('#wpd-opt-search-results').hide();
736
  $('#wpd-opt-search-field').focus();
737
  }
738
  });
739
+ $('body').on('input', '#wpd-opt-search-field', function () {
740
  var s = $(this).val();
741
  s = s.trim();
742
  if (s.length > 2) {
765
  });
766
  //========================= /SETTING SEARCH =====================//
767
  //========================= SETTINGS MENU =====================//
768
+ $('body').on('click', '.wpd-setbar .wpd-menu-head .dashicons-arrow-down, .wpd-setbar .wpd-menu-head .dashicons-arrow-up', function () {
769
  var $this = $(this);
770
  var up = $this.hasClass('dashicons-arrow-up');
771
  $this.toggleClass('dashicons-arrow-down dashicons-arrow-up');
777
  });
778
  //========================= /SETTINGS MENU =====================//
779
  //========================= TOOLBAR OPTIONS =====================//
780
+ $('body').on('click', '.wpd-editor-toolbar .wpd-editor-button', function () {
781
  if ($(this).hasClass('wpd-enabled')) {
782
  $(this).removeClass('wpd-enabled');
783
  $(this).addClass('wpd-disabled');
788
  $('#' + $(this).attr('id') + '-button').val(1);
789
  }
790
  });
791
+ $('body').on('click', '.wpd-editor-toolbar #wpdeb_disable', function () {
792
  $('.wpd-editor-toolbar .wpd-editor-button').removeClass('wpd-enabled');
793
  $('.wpd-editor-toolbar .wpd-editor-button').addClass('wpd-disabled');
794
  $('.wpd-editor-toolbar .wpd-editor-button').next('input').val(0);
795
  $(this).hide();
796
  $('.wpd-editor-toolbar #wpdeb_enable').show();
797
  });
798
+ $('body').on('click', '.wpd-editor-toolbar #wpdeb_enable', function () {
799
  $('.wpd-editor-toolbar .wpd-editor-button').addClass('wpd-enabled');
800
  $('.wpd-editor-toolbar .wpd-editor-button').removeClass('wpd-disabled');
801
  $('.wpd-editor-toolbar .wpd-editor-button').next('input').val(1);
823
  toolsAccordion(item);
824
  }
825
 
826
+ $('body').on('click', '.wpdtool-accordion-title', function () {
827
  var item = $(this);
828
 
829
  if (!supportsHash) {
866
  }
867
  /* TOOLS PAGE ACCORDION */
868
 
869
+ /*=== NOTIFICATION START ===*/
870
+
871
+ $(document).on("click", "[data-wpd-clipboard]", function () {
872
+ const val = $(this).attr("data-wpd-clipboard");
873
+ const el = $("<input/>");
874
+ el.appendTo("body").css({"position": "absolute", "top": "-10000000px"}).val(val);
875
+ el.trigger("select");
876
+ document.execCommand("copy");
877
+ el.remove();
878
+
879
+ wpdNotify({type: "success", text: `${val} <br> copied to clipboard!`, timeout: 3000});
880
+ });
881
+
882
+ function wpdNotify(options) {
883
+ let ntfContainer = $("<div>");
884
+ ntfContainer.addClass(`wpd-notices-container wpd-notice wpd-notice-${options.type}`);
885
+ ntfContainer.html(`<span>${options.text}</span>`);
886
+
887
+ $(".wpd-notices-container", "body").remove();
888
+ $("body").append(ntfContainer);
889
+
890
+ setTimeout(() => {
891
+ ntfContainer.remove();
892
+ }, options.timeout);
893
+ }
894
+
895
+ /*=== NOTIFICATION END ===*/
896
+
897
+ /*=== EMAIL TEMPLATES ACCORDION START ===*/
898
+
899
+ const hashRegex = /#(wpd\-[a-zA-z0-9\-\_]+)/;
900
+ let urlHash = location.href.match(hashRegex);
901
+ let accordionitem = null;
902
+ let browserSupportsHash = false;
903
+
904
+ if ("onhashchange" in window) {
905
+ browserSupportsHash = true;
906
+ }
907
+
908
+ if (browserSupportsHash) {
909
+ window.addEventListener("hashchange", wpdOnhashchange, false);
910
+ }
911
+
912
+ if (urlHash != null) {
913
+ accordionitem = $('.wpd-accordion-title[data-wpd-selector="' + urlHash[1] + '"');
914
+ wpdAccordion(accordionitem);
915
+ }
916
+
917
+ $('body').on('click', '.wpd-accordion-title', function (e) {
918
+ e.preventDefault();
919
+ e.stopPropagation();
920
+ accordionitem = $(this);
921
+
922
+ if (!browserSupportsHash) {
923
+ wpdAccordion(accordionitem);
924
+ }
925
+
926
+ urlHash = location.href.match(hashRegex);
927
+ const selector = accordionitem.attr("data-wpd-selector");
928
+
929
+ if (urlHash != null) {
930
+ if (urlHash[1] === selector) {
931
+ window.history.replaceState({}, "", location.href.replace("#" + selector, ""));
932
+ if (browserSupportsHash) {
933
+ wpdAccordion(accordionitem);
934
+ }
935
+ } else {
936
+ window.history.replaceState({}, "", location.href.replace(urlHash[1], selector));
937
+ if (browserSupportsHash) {
938
+ window.dispatchEvent(new HashChangeEvent("hashchange"));
939
+ }
940
+ }
941
+ } else {
942
+ location.href = location.href.indexOf("#") >= 0 ? location.href.substring(0, location.href.lastIndexOf("#") + 1) + selector : location.href + "#" + selector;
943
+ }
944
+ });
945
+
946
+ function wpdAccordion(accordionitem) {
947
+ if (accordionitem != null) {
948
+ $(accordionitem).parent().siblings('.wpd-accordion-item').removeClass('wpd-accordion-current');
949
+ $(accordionitem).parent().siblings('.wpd-accordion-item').find('.wpd-accordion-content').slideUp(0);
950
+ $(accordionitem).siblings('.wpd-accordion-content').slideToggle(0);
951
+ $(accordionitem).parent().toggleClass('wpd-accordion-current');
952
+ return false;
953
+ }
954
+ }
955
+
956
+ function wpdOnhashchange() {
957
+ urlHash = location.href.match(hashRegex);
958
+ if (urlHash != null) {
959
+ accordionitem = $('.wpd-accordion-title[data-wpd-selector="' + urlHash[1] + '"');
960
+ wpdAccordion(accordionitem);
961
+ }
962
+ }
963
+
964
+ /*=== EMAIL TEMPLATES ACCORDION START ===*/
965
+
966
  });
967
  //========================= DASHBOARD =====================//
968
  var wpdSpinner = '<div class="wpd-spinner"><span class="spinner"></span></div>';
assets/js/wpdiscuz-shortcode-tinymce.js CHANGED
@@ -19,7 +19,7 @@
19
  }
20
  });
21
 
22
- $(document).on('mousedown', '#wpd-put-shortcode', function () {
23
  var question = $('#wpd-inline-question').val();
24
  var shortcode = '[' + wpdObject.shortcode + ' id="' + Math.random().toString(36).substr(2, 10) + '" question="' + (question ? $('<div>' + question + '</div>').text() : wpdObject.leave_feebdack) + '" opened="' + $('[name=wpd-inline-type]:checked').val() + '"]';
25
  shortcode += tinymce.activeEditor.selection.getContent();
19
  }
20
  });
21
 
22
+ $('body').on('mousedown', '#wpd-put-shortcode', function () {
23
  var question = $('#wpd-inline-question').val();
24
  var shortcode = '[' + wpdObject.shortcode + ' id="' + Math.random().toString(36).substr(2, 10) + '" question="' + (question ? $('<div>' + question + '</div>').text() : wpdObject.leave_feebdack) + '" opened="' + $('[name=wpd-inline-type]:checked').val() + '"]';
25
  shortcode += tinymce.activeEditor.selection.getContent();
assets/js/wpdiscuz-social.js CHANGED
@@ -39,7 +39,7 @@ jQuery(document).ready(function ($) {
39
  scrollTop: $('#comments').offset().top - 32
40
  }, 1000);
41
  }
42
- $(document).on('click', '.wpd-comment-share .fa-facebook-f', function () {
43
  if (wpdiscuzAjaxObj.enableFbShare != 1) {
44
  return;
45
  }
@@ -54,13 +54,13 @@ jQuery(document).ready(function ($) {
54
  });
55
 
56
  var socialLoginProvider = '';
57
- $(document).on('click', '#wpdcom .wpd-social-login .wpdiscuz-login-button', function () {
58
  var socialLoginContainer = $(this).parents('.wpd-social-login');
59
  socialLoginProvider = wpdInitProvider($(this));
60
  wpdSocialLoginIsConfirmAgreement(socialLoginProvider, socialLoginContainer);
61
  });
62
 
63
- $(document).on('click', '#wpdcom .wpd-agreement-buttons-right .wpd-agreement-button', function () {
64
  var socialLoginContainer = $(this).parents('.wpd-form-wrap, .wpd-form').find('.wpd-social-login-agreement').slideUp(700);
65
  if ($(this).hasClass('wpd-agreement-button-agree')) {
66
  if (wpdiscuzAjaxObj.isCookiesEnabled) {
39
  scrollTop: $('#comments').offset().top - 32
40
  }, 1000);
41
  }
42
+ $('body').on('click', '.wpd-comment-share .fa-facebook-f', function () {
43
  if (wpdiscuzAjaxObj.enableFbShare != 1) {
44
  return;
45
  }
54
  });
55
 
56
  var socialLoginProvider = '';
57
+ $('body').on('click', '#wpdcom .wpd-social-login .wpdiscuz-login-button', function () {
58
  var socialLoginContainer = $(this).parents('.wpd-social-login');
59
  socialLoginProvider = wpdInitProvider($(this));
60
  wpdSocialLoginIsConfirmAgreement(socialLoginProvider, socialLoginContainer);
61
  });
62
 
63
+ $('body').on('click', '#wpdcom .wpd-agreement-buttons-right .wpd-agreement-button', function () {
64
  var socialLoginContainer = $(this).parents('.wpd-form-wrap, .wpd-form').find('.wpd-social-login-agreement').slideUp(700);
65
  if ($(this).hasClass('wpd-agreement-button-agree')) {
66
  if (wpdiscuzAjaxObj.isCookiesEnabled) {
assets/js/wpdiscuz-social.min.js CHANGED
@@ -1 +1 @@
1
- function wpcShareCommentFB(e,s){FB.ui({method:"share",href:e,quote:s},function(e){})}(!parseInt(wpdiscuzAjaxObj.fbUseOAuth2)&&parseInt(wpdiscuzAjaxObj.enableFbLogin)||parseInt(wpdiscuzAjaxObj.enableFbShare))&&wpdiscuzAjaxObj.facebookAppID&&(!function(e,s,n){var o,a=e.getElementsByTagName(s)[0];e.getElementById(n)||((o=e.createElement(s)).id=n,o.src="//connect.facebook.net/en_US/sdk.js",a.parentNode.insertBefore(o,a))}(document,"script","facebook-jssdk"),window.fbAsyncInit=function(){FB.init({appId:wpdiscuzAjaxObj.facebookAppID,cookie:!0,xfbml:!0,version:"v7.0"})}),jQuery(document).ready(function(e){var s;(s=Cookies.get("wpdiscuz_social_login_message"))&&"undefined"!==s&&(Cookies.remove("wpdiscuz_social_login_message"),wpdiscuzAjaxObj.setCommentMessage(decodeURIComponent(s.replace(/\+/g,"%20")),"error")),Cookies.get("wpdiscuz_scroll_to_comments")&&(Cookies.remove("wpdiscuz_scroll_to_comments",{path:"/"}),e("html, body").animate({scrollTop:e("#comments").offset().top-32},1e3)),e(document).on("click",".wpd-comment-share .fa-facebook-f",function(){if(1==wpdiscuzAjaxObj.enableFbShare){var s=e(this).parents(".wpd-comment").find(".wpd-comment-right").attr("id"),n=window.location.href;-1!==n.indexOf("#")&&(n=n.substring(0,n.indexOf("#"))),wpcShareCommentFB(n+="#"+s,e(this).parents(".wpd-comment-right").find(".wpd-comment-text").text())}});var n="";function o(e,s){var n,o="";t(s,1),Cookies.set("wpdiscuz_scroll_to_comments",1,{path:"/"}),"facebook"===e&&0==wpdiscuzAjaxObj.facebookUseOAuth2?FB.getLoginStatus(function(t){"connected"===t.status?(n=t.authResponse.accessToken,o=t.authResponse.userID,a(e,n,o,s)):FB.login(function(t){"connected"===t.status&&(n=t.authResponse.accessToken,o=t.authResponse.userID,a(e,n,o,s))},{scope:"public_profile,email"})}):a(e,n,o,s)}function a(s,n,o,a){return e.ajax({type:"POST",url:wpdiscuzAjaxObj.url,data:{action:"wpd_social_login",provider:s,token:n,userID:o,postID:wpdiscuzAjaxObj.wc_post_id}}).done(function(s){!function(s,n){try{var o=e.parseJSON(s),a=o.code,i=o.message,c=o.url;200===parseInt(a)?location.assign(c):wpdiscuzAjaxObj.setCommentMessage(i,"error")}catch(e){console.log(e)}t(n,0)}(s,a)}),""}function t(e,s){1===s?e.find(".wpdiscuz-social-login-spinner").show():e.find(".wpdiscuz-social-login-spinner").hide()}e(document).on("click","#wpdcom .wpd-social-login .wpdiscuz-login-button",function(){var s=e(this).parents(".wpd-social-login");!function(e,s){1!=parseInt(wpdiscuzAjaxObj.socialLoginAgreementCheckbox)||1==Cookies.get("socialLoginAgreementConfirmed")?o(e,s):s.parents(".wpd-form-wrap, .wpd-form").find(".wpd-social-login-agreement").first().slideDown(700)}(n=function(e){var s="";e.hasClass("wpdsn-fb")&&(s="facebook");e.hasClass("wpdsn-insta")&&(s="instagram");e.hasClass("wpdsn-gg")&&(s="google");e.hasClass("wpdsn-ds")&&(s="disqus");e.hasClass("wpdsn-wp")&&(s="wordpress");e.hasClass("wpdsn-tw")&&(s="twitter");e.hasClass("wpdsn-vk")&&(s="vk");e.hasClass("wpdsn-ok")&&(s="ok");e.hasClass("wpdsn-linked")&&(s="linkedin");e.hasClass("wpdsn-yandex")&&(s="yandex");e.hasClass("wpdsn-mailru")&&(s="mailru");e.hasClass("wpdsn-weixin")&&(s="wechat");e.hasClass("wpdsn-weibo")&&(s="weibo");e.hasClass("wpdsn-qq")&&(s="qq");e.hasClass("wpdsn-baidu")&&(s="baidu");return s}(e(this)),s)}),e(document).on("click","#wpdcom .wpd-agreement-buttons-right .wpd-agreement-button",function(){var s=e(this).parents(".wpd-form-wrap, .wpd-form").find(".wpd-social-login-agreement").slideUp(700);e(this).hasClass("wpd-agreement-button-agree")&&(wpdiscuzAjaxObj.isCookiesEnabled&&Cookies.set("socialLoginAgreementConfirmed",1,{expires:30,path:"/"}),o(n,s))})});
1
+ function wpcShareCommentFB(a,b){FB.ui({method:"share",href:a,quote:b},function(a){})}(!parseInt(wpdiscuzAjaxObj.fbUseOAuth2)&&parseInt(wpdiscuzAjaxObj.enableFbLogin)||parseInt(wpdiscuzAjaxObj.enableFbShare))&&wpdiscuzAjaxObj.facebookAppID&&(function(a,c,d){var b,e=a.getElementsByTagName(c)[0];a.getElementById(d)||((b=a.createElement(c)).id=d,b.src="//connect.facebook.net/en_US/sdk.js",e.parentNode.insertBefore(b,e))}(document,"script","facebook-jssdk"),window.fbAsyncInit=function(){FB.init({appId:wpdiscuzAjaxObj.facebookAppID,cookie:!0,xfbml:!0,version:"v7.0"})}),jQuery(document).ready(function($){(a=Cookies.get("wpdiscuz_social_login_message"))&&"undefined"!==a&&(Cookies.remove("wpdiscuz_social_login_message"),wpdiscuzAjaxObj.setCommentMessage(decodeURIComponent(a.replace(/\+/g,"%20")),"error")),Cookies.get("wpdiscuz_scroll_to_comments")&&(Cookies.remove("wpdiscuz_scroll_to_comments",{path:"/"}),$("html, body").animate({scrollTop:$("#comments").offset().top-32},1e3)),$("body").on("click",".wpd-comment-share .fa-facebook-f",function(){if(1==wpdiscuzAjaxObj.enableFbShare){var b=$(this).parents(".wpd-comment").find(".wpd-comment-right").attr("id"),a=window.location.href;-1!==a.indexOf("#")&&(a=a.substring(0,a.indexOf("#"))),wpcShareCommentFB(a+="#"+b,$(this).parents(".wpd-comment-right").find(".wpd-comment-text").text())}});var a,b="";function c(a,b){var c,e="";f(b,1),Cookies.set("wpdiscuz_scroll_to_comments",1,{path:"/"}),"facebook"===a&&0==wpdiscuzAjaxObj.facebookUseOAuth2?FB.getLoginStatus(function(f){"connected"===f.status?(c=f.authResponse.accessToken,e=f.authResponse.userID,d(a,c,e,b)):FB.login(function(f){"connected"===f.status&&(c=f.authResponse.accessToken,e=f.authResponse.userID,d(a,c,e,b))},{scope:"public_profile,email"})}):d(a,c,e,b)}function d(a,b,c,d){return $.ajax({type:"POST",url:wpdiscuzAjaxObj.url,data:{action:"wpd_social_login",provider:a,token:b,userID:c,postID:wpdiscuzAjaxObj.wc_post_id}}).done(function(a){e(a,d)}),""}function e(b,c){try{var a=$.parseJSON(b),d=a.code,e=a.message,g=a.url;200===parseInt(d)?location.assign(g):wpdiscuzAjaxObj.setCommentMessage(e,"error")}catch(h){console.log(h)}f(c,0)}function f(a,b){1===b?a.find(".wpdiscuz-social-login-spinner").show():a.find(".wpdiscuz-social-login-spinner").hide()}$("body").on("click","#wpdcom .wpd-social-login .wpdiscuz-login-button",function(){var f,e,d,a,g=$(this).parents(".wpd-social-login");f=b=(d=$(this),a="",d.hasClass("wpdsn-fb")&&(a="facebook"),d.hasClass("wpdsn-insta")&&(a="instagram"),d.hasClass("wpdsn-gg")&&(a="google"),d.hasClass("wpdsn-ds")&&(a="disqus"),d.hasClass("wpdsn-wp")&&(a="wordpress"),d.hasClass("wpdsn-tw")&&(a="twitter"),d.hasClass("wpdsn-vk")&&(a="vk"),d.hasClass("wpdsn-ok")&&(a="ok"),d.hasClass("wpdsn-linked")&&(a="linkedin"),d.hasClass("wpdsn-yandex")&&(a="yandex"),d.hasClass("wpdsn-mailru")&&(a="mailru"),d.hasClass("wpdsn-weixin")&&(a="wechat"),d.hasClass("wpdsn-weibo")&&(a="weibo"),d.hasClass("wpdsn-qq")&&(a="qq"),d.hasClass("wpdsn-baidu")&&(a="baidu"),a),e=g,1!=parseInt(wpdiscuzAjaxObj.socialLoginAgreementCheckbox)||1==Cookies.get("socialLoginAgreementConfirmed")?c(f,e):e.parents(".wpd-form-wrap, .wpd-form").find(".wpd-social-login-agreement").first().slideDown(700)}),$("body").on("click","#wpdcom .wpd-agreement-buttons-right .wpd-agreement-button",function(){var a=$(this).parents(".wpd-form-wrap, .wpd-form").find(".wpd-social-login-agreement").slideUp(700);$(this).hasClass("wpd-agreement-button-agree")&&(wpdiscuzAjaxObj.isCookiesEnabled&&Cookies.set("socialLoginAgreementConfirmed",1,{expires:30,path:"/"}),c(b,a))})})
assets/js/wpdiscuz-user-content.js CHANGED
@@ -7,11 +7,11 @@ jQuery(document).ready(function ($) {
7
  var refreshAfterDeleting = 0;
8
  var isNativeAjaxEnabled = parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled);
9
  var additionalTab = parseInt(wpdiscuzUCObj.additionalTab);
10
- $(document).on('click', '.wpd-info,.wpd-page-link,.wpd-delete-content,.wpd-user-email-delete-links', function (e) {
11
  e.preventDefault();
12
  });
13
 
14
- $(document).on('click', '.wpd-info.wpd-not-clicked', function (e) {
15
  var btn = $(this);
16
  btn.removeClass('wpd-not-clicked');
17
  var data = new FormData();
@@ -44,7 +44,7 @@ jQuery(document).ready(function ($) {
44
  });
45
  }
46
 
47
- $(document).on('click', '.wpd-list-item', function () {
48
  var relValue = $('input.wpd-rel', this).val();
49
  $('#wpdUserContentInfo .wpd-list-item').removeClass('wpd-active');
50
  $('#wpdUserContentInfo .wpd-content-item').removeClass('wpd-active');
@@ -72,7 +72,7 @@ jQuery(document).ready(function ($) {
72
  });
73
 
74
 
75
- $(document).on('click', '.wpd-page-link.wpd-not-clicked', function (e) {
76
  var btn = $(this);
77
  btn.removeClass('wpd-not-clicked');
78
  var goToPage = btn.data('wpd-page');
@@ -91,7 +91,7 @@ jQuery(document).ready(function ($) {
91
  });
92
  });
93
 
94
- $(document).on('click', '.wpd-delete-content.wpd-not-clicked', function () {
95
  var btn = $(this);
96
  var id = parseInt(btn.data('wpd-content-id'));
97
  if (!isNaN(id)) {
@@ -130,7 +130,7 @@ jQuery(document).ready(function ($) {
130
  }
131
  });
132
 
133
- $(document).on('click', '[data-lity-close]', function (e) {
134
  if ($(e.target).is('[data-lity-close]')) {
135
  if (refreshAfterDeleting) {
136
  window.location.reload(true);
@@ -138,7 +138,7 @@ jQuery(document).ready(function ($) {
138
  }
139
  });
140
 
141
- $(document).on('click', '.wpd-user-email-delete-links.wpd-not-clicked', function () {
142
  var btn = $(this);
143
  btn.removeClass('wpd-not-clicked');
144
  $('.wpd-loading', btn).addClass('wpd-show');
@@ -152,7 +152,7 @@ jQuery(document).ready(function ($) {
152
  });
153
  });
154
 
155
- $(document).on('click', '.wpd-user-settings-button.wpd-not-clicked', function () {
156
  var btn = $(this);
157
  btn.removeClass('wpd-not-clicked');
158
  var guestAction = btn.data('wpd-delete-action');
7
  var refreshAfterDeleting = 0;
8
  var isNativeAjaxEnabled = parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled);
9
  var additionalTab = parseInt(wpdiscuzUCObj.additionalTab);
10
+ $('body').on('click', '.wpd-info,.wpd-page-link,.wpd-delete-content,.wpd-user-email-delete-links', function (e) {
11
  e.preventDefault();
12
  });
13
 
14
+ $('body').on('click', '.wpd-info.wpd-not-clicked', function (e) {
15
  var btn = $(this);
16
  btn.removeClass('wpd-not-clicked');
17
  var data = new FormData();
44
  });
45
  }
46
 
47
+ $('body').on('click', '.wpd-list-item', function () {
48
  var relValue = $('input.wpd-rel', this).val();
49
  $('#wpdUserContentInfo .wpd-list-item').removeClass('wpd-active');
50
  $('#wpdUserContentInfo .wpd-content-item').removeClass('wpd-active');
72
  });
73
 
74
 
75
+ $('body').on('click', '.wpd-page-link.wpd-not-clicked', function (e) {
76
  var btn = $(this);
77
  btn.removeClass('wpd-not-clicked');
78
  var goToPage = btn.data('wpd-page');
91
  });
92
  });
93
 
94
+ $('body').on('click', '.wpd-delete-content.wpd-not-clicked', function () {
95
  var btn = $(this);
96
  var id = parseInt(btn.data('wpd-content-id'));
97
  if (!isNaN(id)) {
130
  }
131
  });
132
 
133
+ $('body').on('click', '[data-lity-close]', function (e) {
134
  if ($(e.target).is('[data-lity-close]')) {
135
  if (refreshAfterDeleting) {
136
  window.location.reload(true);
138
  }
139
  });
140
 
141
+ $('body').on('click', '.wpd-user-email-delete-links.wpd-not-clicked', function () {
142
  var btn = $(this);
143
  btn.removeClass('wpd-not-clicked');
144
  $('.wpd-loading', btn).addClass('wpd-show');
152
  });
153
  });
154
 
155
+ $('body').on('click', '.wpd-user-settings-button.wpd-not-clicked', function () {
156
  var btn = $(this);
157
  btn.removeClass('wpd-not-clicked');
158
  var guestAction = btn.data('wpd-delete-action');
assets/js/wpdiscuz-user-content.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function(e){var n=0,d=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),t=parseInt(wpdiscuzUCObj.additionalTab);e(document).on("click",".wpd-info,.wpd-page-link,.wpd-delete-content,.wpd-user-email-delete-links",function(e){e.preventDefault()}),e(document).on("click",".wpd-info.wpd-not-clicked",function(n){var a=e(this);a.removeClass("wpd-not-clicked");var i=new FormData;return i.append("action","wpdGetInfo"),i.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce),function(n,a){var i=e(".fas",n),c=i.attr("class");i.removeClass(),i.addClass("fas fa-pulse fa-spinner"),wpdiscuzAjaxObj.getAjaxObj(d||t,!1,a).done(function(d){n.addClass("wpd-not-clicked"),i.removeClass(),i.addClass(c),d&&(e("#wpdUserContentInfo").html(d),e("#wpdUserContentInfo ul.wpd-list .wpd-list-item:first-child").addClass("wpd-active"),e("#wpdUserContentInfo div.wpd-content .wpd-content-item:first-child").addClass("wpd-active"),e("#wpdUserContentInfo").is(":visible")||e("#wpdUserContentInfoAnchor").trigger("click"))})}(a,i),!1}),e(document).on("click",".wpd-list-item",function(){var n=e("input.wpd-rel",this).val();e("#wpdUserContentInfo .wpd-list-item").removeClass("wpd-active"),e("#wpdUserContentInfo .wpd-content-item").removeClass("wpd-active");var a=e(this);if(e("#wpdUserContentInfo #"+n).text().length)a.addClass("wpd-active"),e("#wpdUserContentInfo #"+n).addClass("wpd-active");else{var i=new FormData;i.append("action",a.attr("data-action")),i.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce),i.append("page",0),e("#wpdUserContentInfo #"+n).addClass("wpd-active"),e("#wpdUserContentInfo #"+n).css("text-align","center"),wpdiscuzAjaxObj.getAjaxObj(d||t,!0,i).done(function(d){d&&(e("#wpdUserContentInfo #"+n).css("text-align",""),a.addClass("wpd-active"),e("#wpdUserContentInfo #"+n).html(d)),e("#wpdiscuz-loading-bar").hide()})}}),e(document).on("click",".wpd-page-link.wpd-not-clicked",function(n){var a=e(this);a.removeClass("wpd-not-clicked");var i=a.data("wpd-page"),c=e(".wpd-active .wpd-pagination .wpd-action").val(),o=new FormData;o.append("action",c),o.append("page",i),o.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce),wpdiscuzAjaxObj.getAjaxObj(d||t,!0,o).done(function(n){a.addClass("wpd-not-clicked"),n&&e(".wpd-content-item.wpd-active").html(n),e("#wpdiscuz-loading-bar").hide()})}),e(document).on("click",".wpd-delete-content.wpd-not-clicked",function(){var a=e(this),i=parseInt(a.data("wpd-content-id"));if(!isNaN(i)){var c=a.data("wpd-delete-action");if("wpdDeleteComment"===c&&!confirm(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzUCObj.msgConfirmDeleteComment,"wc_confirm_comment_delete",a)))return!1;if("wpdCancelSubscription"===c&&!confirm(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzUCObj.msgConfirmCancelSubscription,"wc_confirm_cancel_subscription",a)))return!1;if("wpdCancelFollow"===c&&!confirm(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzUCObj.msgConfirmCancelFollow,"wc_confirm_cancel_follow",a)))return!1;var o=e("i",a),s=o.attr("class"),p=e(".wpd-wrapper .wpd-page-number").val(),l=e(".wpd-content-item.wpd-active").children(".wpd-item").length;a.removeClass("wpd-not-clicked"),o.removeClass().addClass("fas fa-pulse fa-spinner"),1===l&&p>0&&(p-=1);var w=new FormData;w.append("id",i),w.append("page",p),w.append("action",c),w.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce),wpdiscuzAjaxObj.getAjaxObj(d||t,!1,w).done(function(d){a.addClass("wpd-not-clicked"),o.removeClass().addClass(s),e(".wpd-content-item.wpd-active").html(d),n=1})}}),e(document).on("click","[data-lity-close]",function(d){e(d.target).is("[data-lity-close]")&&n&&window.location.reload(!0)}),e(document).on("click",".wpd-user-email-delete-links.wpd-not-clicked",function(){var n=e(this);n.removeClass("wpd-not-clicked"),e(".wpd-loading",n).addClass("wpd-show");var a=new FormData;a.append("action","wpdEmailDeleteLinks"),a.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce),wpdiscuzAjaxObj.getAjaxObj(d||t,!1,a).done(function(d){n.addClass("wpd-not-clicked"),e("[data-lity-close]",window.parent.document).trigger("click")})}),e(document).on("click",".wpd-user-settings-button.wpd-not-clicked",function(){var n=e(this);n.removeClass("wpd-not-clicked");var a=n.data("wpd-delete-action");if("deleteCookies"!==a){n.find(".wpd-loading").addClass("wpd-show");var i=new FormData;i.append("action","wpdGuestAction"),i.append("guestAction",a),i.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce),wpdiscuzAjaxObj.getAjaxObj(d||t,!1,i).done(function(d){n.addClass("wpd-not-clicked"),n.find(".wpd-loading").removeClass("wpd-show");try{var t=e.parseJSON(d);n.after(t.message);var a=n.next(".wpd-guest-action-message");a.fadeIn(100).fadeOut(7e3,function(){a.remove(),1===parseInt(t.code)&&(n.parent().remove(),e(".wpd-delete-all-comments").length||e(".wpd-delete-all-subscriptions").length||e(".wpd-delete-all-cookies").parent().addClass("wpd-show"))})}catch(e){console.log(e)}})}else!function(){for(var e=document.cookie.split(";"),n=0;n<e.length;n++){var d=e[n],t=d.indexOf("="),a=t>-1?d.substr(0,t):d;Cookies.remove(a.trim())}location.reload(!0)}()})});
1
+ jQuery(document).ready(function($){var a=0,b=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),c=parseInt(wpdiscuzUCObj.additionalTab);$("body").on("click",".wpd-info,.wpd-page-link,.wpd-delete-content,.wpd-user-email-delete-links",function(a){a.preventDefault()}),$("body").on("click",".wpd-info.wpd-not-clicked",function(i){var e=$(this);e.removeClass("wpd-not-clicked");var f,g,a,h,d=new FormData;return d.append("action","wpdGetInfo"),d.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce),f=e,g=d,h=(a=$(".fas",f)).attr("class"),a.removeClass(),a.addClass("fas fa-pulse fa-spinner"),wpdiscuzAjaxObj.getAjaxObj(b||c,!1,g).done(function(b){f.addClass("wpd-not-clicked"),a.removeClass(),a.addClass(h),b&&($("#wpdUserContentInfo").html(b),$("#wpdUserContentInfo ul.wpd-list .wpd-list-item:first-child").addClass("wpd-active"),$("#wpdUserContentInfo div.wpd-content .wpd-content-item:first-child").addClass("wpd-active"),$("#wpdUserContentInfo").is(":visible")||$("#wpdUserContentInfoAnchor").trigger("click"))}),!1}),$("body").on("click",".wpd-list-item",function(){var a=$("input.wpd-rel",this).val();$("#wpdUserContentInfo .wpd-list-item").removeClass("wpd-active"),$("#wpdUserContentInfo .wpd-content-item").removeClass("wpd-active");var e=$(this);if($("#wpdUserContentInfo #"+a).text().length)e.addClass("wpd-active"),$("#wpdUserContentInfo #"+a).addClass("wpd-active");else{var d=new FormData;d.append("action",e.attr("data-action")),d.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce),d.append("page",0),$("#wpdUserContentInfo #"+a).addClass("wpd-active"),$("#wpdUserContentInfo #"+a).css("text-align","center"),wpdiscuzAjaxObj.getAjaxObj(b||c,!0,d).done(function(b){b&&($("#wpdUserContentInfo #"+a).css("text-align",""),e.addClass("wpd-active"),$("#wpdUserContentInfo #"+a).html(b)),$("#wpdiscuz-loading-bar").hide()})}}),$("body").on("click",".wpd-page-link.wpd-not-clicked",function(g){var d=$(this);d.removeClass("wpd-not-clicked");var e=d.data("wpd-page"),f=$(".wpd-active .wpd-pagination .wpd-action").val(),a=new FormData;a.append("action",f),a.append("page",e),a.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce),wpdiscuzAjaxObj.getAjaxObj(b||c,!0,a).done(function(a){d.addClass("wpd-not-clicked"),a&&$(".wpd-content-item.wpd-active").html(a),$("#wpdiscuz-loading-bar").hide()})}),$("body").on("click",".wpd-delete-content.wpd-not-clicked",function(){var d=$(this),h=parseInt(d.data("wpd-content-id"));if(!isNaN(h)){var f=d.data("wpd-delete-action");if("wpdDeleteComment"===f&&!confirm(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzUCObj.msgConfirmDeleteComment,"wc_confirm_comment_delete",d))||"wpdCancelSubscription"===f&&!confirm(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzUCObj.msgConfirmCancelSubscription,"wc_confirm_cancel_subscription",d))||"wpdCancelFollow"===f&&!confirm(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzUCObj.msgConfirmCancelFollow,"wc_confirm_cancel_follow",d)))return!1;var i=$("i",d),k=i.attr("class"),g=$(".wpd-wrapper .wpd-page-number").val(),j=$(".wpd-content-item.wpd-active").children(".wpd-item").length;d.removeClass("wpd-not-clicked"),i.removeClass().addClass("fas fa-pulse fa-spinner"),1===j&&g>0&&(g-=1);var e=new FormData;e.append("id",h),e.append("page",g),e.append("action",f),e.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce),wpdiscuzAjaxObj.getAjaxObj(b||c,!1,e).done(function(b){d.addClass("wpd-not-clicked"),i.removeClass().addClass(k),$(".wpd-content-item.wpd-active").html(b),a=1})}}),$("body").on("click","[data-lity-close]",function(b){$(b.target).is("[data-lity-close]")&&a&&window.location.reload(!0)}),$("body").on("click",".wpd-user-email-delete-links.wpd-not-clicked",function(){var d=$(this);d.removeClass("wpd-not-clicked"),$(".wpd-loading",d).addClass("wpd-show");var a=new FormData;a.append("action","wpdEmailDeleteLinks"),a.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce),wpdiscuzAjaxObj.getAjaxObj(b||c,!1,a).done(function(a){d.addClass("wpd-not-clicked"),$("[data-lity-close]",window.parent.document).trigger("click")})}),$("body").on("click",".wpd-user-settings-button.wpd-not-clicked",function(){var d=$(this);d.removeClass("wpd-not-clicked");var e=d.data("wpd-delete-action");if("deleteCookies"!==e){d.find(".wpd-loading").addClass("wpd-show");var a=new FormData;a.append("action","wpdGuestAction"),a.append("guestAction",e),a.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce),wpdiscuzAjaxObj.getAjaxObj(b||c,!1,a).done(function(a){d.addClass("wpd-not-clicked"),d.find(".wpd-loading").removeClass("wpd-show");try{var b=$.parseJSON(a);d.after(b.message);var c=d.next(".wpd-guest-action-message");c.fadeIn(100).fadeOut(7e3,function(){c.remove(),1===parseInt(b.code)&&(d.parent().remove(),$(".wpd-delete-all-comments").length||$(".wpd-delete-all-subscriptions").length||$(".wpd-delete-all-cookies").parent().addClass("wpd-show"))})}catch(e){console.log(e)}})}else(function(){for(var c=document.cookie.split(";"),a=0;a<c.length;a++){var b=c[a],d=b.indexOf("="),e=d> -1?b.substr(0,d):b;Cookies.remove(e.trim())}location.reload(!0)})()})})
assets/js/wpdiscuz.js CHANGED
@@ -162,10 +162,10 @@ jQuery(document).ready(function ($) {
162
  });
163
  }
164
 
165
- $(document).on('focus', '#wpdcom .ql-editor, #wpdcom .wc_comment', function () {
166
  $('.wpd-form-foot', $(this).parents('.wpd_comm_form')).slideDown(enableDropAnimation);
167
  });
168
- $(document).on('focus', '#wpdcom textarea', function () {
169
  if (!$(this).next('.autogrow-textarea-mirror').length) {
170
  $(this).autoGrow();
171
  }
@@ -183,7 +183,7 @@ jQuery(document).ready(function ($) {
183
  $('.wpd-vote-down.wpd-dislike-hidden').remove();
184
  $('.wpd-toolbar-hidden').prev('[id^=wpd-editor-]').css('border-bottom', "1px solid #dddddd");
185
 
186
- $(document).on('click', '#wpd-editor-source-code-wrapper-bg', function () {
187
  $(this).hide();
188
  $('#wpd-editor-source-code-wrapper').hide();
189
  $('#wpd-editor-uid').val('');
@@ -191,7 +191,7 @@ jQuery(document).ready(function ($) {
191
  });
192
 
193
  if (wpdiscuzLoadRichEditor) {
194
- $(document).on('click', '#wpd-insert-source-code', function () {
195
  var editor = wpDiscuzEditor.createEditor('#' + $('#wpd-editor-uid').val());
196
  editor.deleteText(0, editor.getLength(), Quill.sources.USER);
197
  var html = $('#wpd-editor-source-code').val();
@@ -206,7 +206,7 @@ jQuery(document).ready(function ($) {
206
  });
207
  }
208
 
209
- $(document).on('click', '.wpd-reply-button', function () {
210
  var uniqueID = getUniqueID($(this), 0);
211
  if ($(this).hasClass('wpdiscuz-clonned')) {
212
  if (wpdiscuzLoadRichEditor) {
@@ -225,7 +225,7 @@ jQuery(document).ready(function ($) {
225
  generateReCaptcha(uniqueID);
226
  });
227
 
228
- $(document).on('click', '#wpdcom [data-wpd-clipboard]', function () {
229
  var val = $(this).data('wpd-clipboard');
230
  var el = $('<input/>');
231
  el.appendTo('body').css({'position': 'absolute', 'top': '-10000000px'}).val(val);
@@ -236,11 +236,11 @@ jQuery(document).ready(function ($) {
236
  });
237
 
238
 
239
- $(document).on('click', '.wpdiscuz-nofollow,.wc_captcha_refresh_img,.wpd-load-more-submit', function (e) {
240
  e.preventDefault();
241
  });
242
 
243
- $(document).on('click', '.wpd-toggle.wpd_not_clicked', function () {
244
  var btn = $(this);
245
  btn.removeClass('wpd_not_clicked');
246
  var uniqueID = getUniqueID($(this), 0);
@@ -266,11 +266,11 @@ jQuery(document).ready(function ($) {
266
  }
267
  });
268
 
269
- $(document).on('mouseenter', '.wpd-new-loaded-comment', function () {
270
  $(this).removeClass('wpd-new-loaded-comment');
271
  });
272
 
273
- $(document).on('click', '.wpd-sbs-toggle', function () {
274
  $('.wpdiscuz-subscribe-bar').slideToggle(enableDropAnimation);
275
  });
276
  //============================== reCAPTCHA ============================== //
@@ -294,7 +294,7 @@ jQuery(document).ready(function ($) {
294
  }
295
  }, 1000);
296
 
297
- $(document).on('submit', '#wpdiscuz-subscribe-form', function (e) {
298
  if (!$('#wpdiscuz-recaptcha-field-subscribe-form').val()) {
299
  $('.wpdiscuz-recaptcha', $(this)).css('border', '1px solid red');
300
  e.preventDefault();
@@ -303,7 +303,7 @@ jQuery(document).ready(function ($) {
303
  }
304
  });
305
  } else if (wpdiscuzRecaptchaVersion === '3.0') {
306
- $(document).on('click', '#wpdiscuz_subscription_button', function (e) {
307
  var subscriptionForm = $(this).parents('#wpdiscuz-subscribe-form');
308
  e.preventDefault();
309
  try {
@@ -525,7 +525,7 @@ jQuery(document).ready(function ($) {
525
  //============================== /reCAPTCHA ============================== //
526
  //============================== ADD COMMENT FUNCTION ============================== //
527
 
528
- $(document).on('click', '.wc_comm_submit.wpd_not_clicked', function () {
529
  var currentSubmitBtn = $(this);
530
  var depth = 1;
531
  var wcForm = $(this).parents('form');
@@ -744,7 +744,7 @@ jQuery(document).ready(function ($) {
744
  //============================== EDIT COMMENT FUNCTION ============================== //
745
  var wcCommentTextBeforeEditing;
746
 
747
- $(document).on('click', '.wpd_editable_comment', function () {
748
  if (wcCommentTextBeforeEditing && $('.wpdiscuz-edit-form-wrap').length) {
749
  wpdCancelOrSave(getUniqueID($('.wpdiscuz-edit-form-wrap'), 0), wcCommentTextBeforeEditing);
750
  }
@@ -785,7 +785,7 @@ jQuery(document).ready(function ($) {
785
  });
786
  });
787
 
788
- $(document).on('click', '.wc_save_edited_comment', function () {
789
  var el = $(this)
790
  var uniqueID = getUniqueID(el);
791
  var commentID = getCommentID(uniqueID);
@@ -845,7 +845,7 @@ jQuery(document).ready(function ($) {
845
  }
846
  });
847
 
848
- $(document).on('click', '.wc_cancel_edit', function () {
849
  var uniqueID = getUniqueID($(this));
850
  wpdCancelOrSave(uniqueID, wcCommentTextBeforeEditing);
851
  if (wpdiscuzLoadRichEditor) {
@@ -868,14 +868,14 @@ jQuery(document).ready(function ($) {
868
  wpdiscuzLoadComments(true);
869
  }, 500);
870
  } else {
871
- $(document).on('click', '.wpd-load-comments', function () {
872
  $(this).parent('.wpd-load-more-submit-wrap').remove();
873
  wpdiscuzLoadComments(true);
874
  });
875
  }
876
  }
877
 
878
- $(document).on('click', '.wpd-load-more-submit', function () {
879
  var loadButton = $(this);
880
  var loaded = 'wpd-loaded';
881
  var loading = 'wpd-loading';
@@ -894,8 +894,12 @@ jQuery(document).ready(function ($) {
894
  }
895
 
896
  function wpdiscuzScrollEvents() {
897
- var wpdiscuzHasMoreComments = $('#wpdiscuzHasMoreComments').val();
898
- var scrollHeight = $(document).height();
 
 
 
 
899
  var scrollPosition = $(window).height() + $(window).scrollTop();
900
  if (scrollHeight && scrollPosition) {
901
  var scrollPercent = scrollPosition * 100 / scrollHeight;
@@ -962,12 +966,17 @@ jQuery(document).ready(function ($) {
962
  }
963
 
964
  function setLoadMoreVisibility(r, showPagination) {
 
965
  if (r.data.is_show_load_more == false) {
966
- $('#wpdiscuzHasMoreComments').val(0);
 
 
967
  $('.wpd-load-more-submit').parents('.wpdiscuz-comment-pagination').hide();
968
  } else {
969
  setLastParentID(r.data.last_parent_id);
970
- $('#wpdiscuzHasMoreComments').val(1);
 
 
971
  if (showPagination) {
972
  $('.wpd-load-more-submit').parents('.wpdiscuz-comment-pagination').show();
973
  }
@@ -987,7 +996,7 @@ jQuery(document).ready(function ($) {
987
  wpdiscuzAjaxObj.setLoadMoreVisibility = setLoadMoreVisibility;
988
  //============================== /LOAD MORE ============================== //
989
  //============================== VOTE ============================== //
990
- $(document).on('click', '.wpd-vote-up.wpd_not_clicked, .wpd-vote-down.wpd_not_clicked', function () {
991
  var currentVoteBtn = $(this);
992
  $(currentVoteBtn).removeClass('wpd_not_clicked');
993
  var uniqueId = getUniqueID(currentVoteBtn);
@@ -1064,7 +1073,7 @@ jQuery(document).ready(function ($) {
1064
  children.hide();
1065
  }
1066
  });
1067
- $(document).on('click', '.wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)', function () {
1068
  var clickedBtn = $(this);
1069
  var sorting = $(this).attr("data-sorting");
1070
  if (sorting) {
@@ -1201,7 +1210,7 @@ jQuery(document).ready(function ($) {
1201
 
1202
  //============================== /LIVE UPDATE ============================== //
1203
  //============================== READ MORE ============================== //
1204
- $(document).on('click', '.wpdiscuz-readmore', function () {
1205
  var uniqueId = getUniqueID($(this));
1206
  var commentId = getCommentID(uniqueId);
1207
  var data = new FormData();
@@ -1378,7 +1387,7 @@ jQuery(document).ready(function ($) {
1378
  $('body').css('scroll-behavior', bodyScrollBehavior);
1379
  }
1380
 
1381
- $(document).on('change', '.wpd-required-group', function () {
1382
  if ($('input:checked', this).length !== 0) {
1383
  $('input', $(this)).prop('required', false);
1384
  } else {
@@ -1387,7 +1396,7 @@ jQuery(document).ready(function ($) {
1387
  });
1388
 
1389
  /* SPOILER */
1390
- $(document).on('click', '.wpdiscuz-spoiler', function () {
1391
  $(this).next().slideToggle();
1392
  if ($(this).hasClass('wpdiscuz-spoiler-closed')) {
1393
  $(this).parents('.wpdiscuz-spoiler-wrap').find('.fa-plus').removeClass('fa-plus').addClass('fa-minus');
@@ -1424,19 +1433,19 @@ jQuery(document).ready(function ($) {
1424
  });
1425
  }
1426
 
1427
- $(document).on('click', '.wpd-tools i', function () {
1428
  var sibling = $(this).siblings('.wpd-tools-actions');
1429
  if (!sibling.is(':visible') && $(this).parents('.wpd-comment-right').attr('id') === $('[id^=comment-]', '#wpdcom').last().attr('id')) {
1430
  $('#comments').css({paddingBottom: '160px'});
1431
  }
1432
  sibling.css({display: sibling.is(':visible') ? 'none' : 'flex'});
1433
  });
1434
- $(document).on('mouseleave', '.wpd-comment-right', function () {
1435
  $(this).find('.wpd-tools-actions').hide();
1436
  $('#comments').css({paddingBottom: '0'});
1437
  });
1438
 
1439
- $(document).on('click', '.wpd_stick_btn', function () {
1440
  var uniqueId = getUniqueID($(this), 0);
1441
  var commentId = getCommentID(uniqueId);
1442
  var data = new FormData();
@@ -1457,7 +1466,7 @@ jQuery(document).ready(function ($) {
1457
  });
1458
  });
1459
 
1460
- $(document).on('click', '.wpd_close_btn', function () {
1461
  var uniqueId = getUniqueID($(this), 0);
1462
  var commentId = getCommentID(uniqueId);
1463
  var data = new FormData();
@@ -1478,7 +1487,7 @@ jQuery(document).ready(function ($) {
1478
  });
1479
  });
1480
 
1481
- $(document).on('click', '.wpd-filter.wpd_not_clicked[data-filter-type]', function () {
1482
  var btn = $(this);
1483
  var type = btn.attr('data-filter-type');
1484
  wpdiscuzAjaxObj.resetActiveFilters('.wpdf-' + type);
@@ -1528,7 +1537,7 @@ jQuery(document).ready(function ($) {
1528
  });
1529
  });
1530
 
1531
- $(document).on('click', '.wpdf-reacted.wpd_not_clicked', function () {
1532
  var btn = $(this);
1533
  btn.removeClass('wpd_not_clicked');
1534
  $('.fas', btn).addClass('fa-pulse fa-spinner');
@@ -1560,7 +1569,7 @@ jQuery(document).ready(function ($) {
1560
  });
1561
  });
1562
 
1563
- $(document).on('click', '.wpdf-hottest.wpd_not_clicked', function () {
1564
  var btn = $(this);
1565
  btn.removeClass('wpd_not_clicked');
1566
  $('.fas', btn).addClass('fa-pulse fa-spinner');
@@ -1593,7 +1602,7 @@ jQuery(document).ready(function ($) {
1593
  });
1594
  });
1595
 
1596
- $(document).on('click', '.wpd-filter-view-all', function () {
1597
  $('.wpdf-inline.wpdf-active.wpd_not_clicked').trigger('click');
1598
  });
1599
 
@@ -1618,7 +1627,7 @@ jQuery(document).ready(function ($) {
1618
  }
1619
  }
1620
 
1621
- $(document).on('click', '.wpd-follow-link.wpd_not_clicked', function () {
1622
  var btn = $(this);
1623
  btn.removeClass('wpd_not_clicked');
1624
  $('.fas', btn).addClass('fa-pulse fa-spinner');
@@ -1690,7 +1699,7 @@ jQuery(document).ready(function ($) {
1690
 
1691
  showHideNotificationType();
1692
 
1693
- $(document).on('keyup', '.wc_email', function () {
1694
  showHideNotificationType($(this));
1695
  });
1696
 
@@ -1740,13 +1749,13 @@ jQuery(document).ready(function ($) {
1740
 
1741
  $('#wpd-bubble-wrapper').show();
1742
 
1743
- $(document).on('click', '#wpd-bubble-add-message-close', function (e) {
1744
  e.preventDefault();
1745
  e.stopPropagation();
1746
  $('#wpd-bubble-wrapper').removeClass('wpd-bubble-hover');
1747
  });
1748
 
1749
- $(document).on('click', '#wpd-bubble', function () {
1750
  unsetHtmlAndBodyScrollBehaviors();
1751
  if ($('#tab-title-reviews').length) {
1752
  $('#tab-title-reviews a').trigger('click');
@@ -1766,13 +1775,13 @@ jQuery(document).ready(function ($) {
1766
  });
1767
  });
1768
 
1769
- $(document).on('click', '#wpd-bubble-comment-close', function (e) {
1770
  e.preventDefault();
1771
  $('#wpd-bubble-notification-message').hide();
1772
  $('#wpd-bubble-wrapper').removeClass('wpd-new-comment-added');
1773
  });
1774
 
1775
- $(document).on('click', '#wpd-bubble-comment-reply-link a', function () {
1776
  var href = $(this).attr('href');
1777
  setTimeout(function () {
1778
  $('#wpd-bubble-notification-message').hide();
@@ -1789,7 +1798,7 @@ jQuery(document).ready(function ($) {
1789
  }, 100);
1790
  });
1791
 
1792
- $(document).on('click', '#wpd-bubble-count', function () {
1793
  if (bubbleNewCommentIds.length) {
1794
  var data = new FormData();
1795
  data.append('action', 'wpdBubbleUpdate');
@@ -1953,7 +1962,7 @@ jQuery(document).ready(function ($) {
1953
  $('.wpd-last-inline-comments-wrapper').remove();
1954
  }
1955
  });
1956
- $(document).on('click', '.wpd-inline-submit.wpd_not_clicked', function (e) {
1957
  e.preventDefault();
1958
  var clickedButton = $(this);
1959
  var form = $(this).parents('.wpd_inline_comm_form');
@@ -2008,22 +2017,22 @@ jQuery(document).ready(function ($) {
2008
  });
2009
  }
2010
  });
2011
- $(document).on('keydown', '.wpd-form', function (e) {
2012
  if (e.ctrlKey && e.keyCode == 13) {
2013
  $(this).find('.wc_comm_submit').trigger('click');
2014
  }
2015
  });
2016
- $(document).on('keydown', '#wpdiscuz-edit-form', function (e) {
2017
  if (e.ctrlKey && e.keyCode == 13) {
2018
  $(this).find('.wc_save_edited_comment').trigger('click');
2019
  }
2020
  });
2021
- $(document).on('keydown', '.wpd-inline-comment-content', function (e) {
2022
  if (e.ctrlKey && e.keyCode == 13) {
2023
  $(this).parents('.wpd_inline_comm_form').find('.wpd-inline-submit.wpd_not_clicked').trigger('click');
2024
  }
2025
  });
2026
- $(document).on('click', '.wpd-inline-icon-count.wpd-has-comments', function () {
2027
  var clickedButton = $(this);
2028
  var data = new FormData();
2029
  data.append('action', 'wpdGetLastInlineComments');
@@ -2046,7 +2055,7 @@ jQuery(document).ready(function ($) {
2046
  $('#wpdiscuz-loading-bar').fadeOut(250);
2047
  });
2048
  });
2049
- $(document).on('click', '.wpd-view-all-inline-comments', function (e) {
2050
  e.preventDefault();
2051
  $(this).parents('.wpd-last-inline-comments-wrapper').remove();
2052
  if (!$('.wpdf-inline').hasClass('wpdf-active')) {
@@ -2057,7 +2066,7 @@ jQuery(document).ready(function ($) {
2057
  scrollTop: $('.wpdf-inline').offset().top - scrollSize
2058
  }, 1000, restoreHtmlAndBodyScrollBehaviors);
2059
  });
2060
- $(document).on('click', '.wpd-feedback-content-link', function (e) {
2061
  e.preventDefault();
2062
  var feedbackId = $(this).data('feedback-content-id');
2063
  unsetHtmlAndBodyScrollBehaviors();
@@ -2148,7 +2157,7 @@ jQuery(document).ready(function ($) {
2148
 
2149
  //========================= /INLINE COMMENTS =====================//
2150
  //========================= POST RATING =====================//
2151
- $(document).on('click', '#wpd-post-rating.wpd-not-rated .wpd-rate-starts svg', function () {
2152
  var data = new FormData();
2153
  var rating = $(this).index();
2154
  if (rating >= 0 && rating < 5) {
@@ -2176,10 +2185,12 @@ jQuery(document).ready(function ($) {
2176
  });
2177
  //========================= /POST RATING =====================//
2178
 
2179
- $(document).on('submit', '#wpdiscuz-subscribe-form', function (e) {
2180
  e.preventDefault();
2181
  var wcForm = $(this);
2182
- if (wcForm[0].checkValidity() && wpdReCaptchaValidateOnSubscribeForm(wcForm)) {
 
 
2183
  var data = new FormData();
2184
  data.append('action', 'wpdAddSubscription');
2185
  var elements = $("*", wcForm);
@@ -2209,14 +2220,16 @@ jQuery(document).ready(function ($) {
2209
  }
2210
  $('#wpdiscuz-loading-bar').fadeOut(250);
2211
  addingComment = false;
 
2212
  })
2213
  .fail(function (jqXHR, textStatus, errorThrown) {
2214
  console.log(errorThrown);
 
2215
  $('#wpdiscuz-loading-bar').fadeOut(250);
2216
  });
2217
  }
2218
  });
2219
- $(document).on('click', '.wpd-unsubscribe', function (e) {
2220
  e.preventDefault();
2221
  var data = new FormData();
2222
  data.append('action', 'wpdUnsubscribe');
162
  });
163
  }
164
 
165
+ $('body').on('focus', '#wpdcom .ql-editor, #wpdcom .wc_comment', function () {
166
  $('.wpd-form-foot', $(this).parents('.wpd_comm_form')).slideDown(enableDropAnimation);
167
  });
168
+ $('body').on('focus', '#wpdcom textarea', function () {
169
  if (!$(this).next('.autogrow-textarea-mirror').length) {
170
  $(this).autoGrow();
171
  }
183
  $('.wpd-vote-down.wpd-dislike-hidden').remove();
184
  $('.wpd-toolbar-hidden').prev('[id^=wpd-editor-]').css('border-bottom', "1px solid #dddddd");
185
 
186
+ $('body').on('click', '#wpd-editor-source-code-wrapper-bg', function () {
187
  $(this).hide();
188
  $('#wpd-editor-source-code-wrapper').hide();
189
  $('#wpd-editor-uid').val('');
191
  });
192
 
193
  if (wpdiscuzLoadRichEditor) {
194
+ $('body').on('click', '#wpd-insert-source-code', function () {
195
  var editor = wpDiscuzEditor.createEditor('#' + $('#wpd-editor-uid').val());
196
  editor.deleteText(0, editor.getLength(), Quill.sources.USER);
197
  var html = $('#wpd-editor-source-code').val();
206
  });
207
  }
208
 
209
+ $('body').on('click', '.wpd-reply-button', function () {
210
  var uniqueID = getUniqueID($(this), 0);
211
  if ($(this).hasClass('wpdiscuz-clonned')) {
212
  if (wpdiscuzLoadRichEditor) {
225
  generateReCaptcha(uniqueID);
226
  });
227
 
228
+ $('body').on('click', '#wpdcom [data-wpd-clipboard]', function () {
229
  var val = $(this).data('wpd-clipboard');
230
  var el = $('<input/>');
231
  el.appendTo('body').css({'position': 'absolute', 'top': '-10000000px'}).val(val);
236
  });
237
 
238
 
239
+ $('body').on('click', '.wpdiscuz-nofollow,.wc_captcha_refresh_img,.wpd-load-more-submit', function (e) {
240
  e.preventDefault();
241
  });
242
 
243
+ $('body').on('click', '.wpd-toggle.wpd_not_clicked', function () {
244
  var btn = $(this);
245
  btn.removeClass('wpd_not_clicked');
246
  var uniqueID = getUniqueID($(this), 0);
266
  }
267
  });
268
 
269
+ $('body').on('mouseenter', '.wpd-new-loaded-comment', function () {
270
  $(this).removeClass('wpd-new-loaded-comment');
271
  });
272
 
273
+ $('body').on('click', '.wpd-sbs-toggle', function () {
274
  $('.wpdiscuz-subscribe-bar').slideToggle(enableDropAnimation);
275
  });
276
  //============================== reCAPTCHA ============================== //
294
  }
295
  }, 1000);
296
 
297
+ $('body').on('submit', '#wpdiscuz-subscribe-form', function (e) {
298
  if (!$('#wpdiscuz-recaptcha-field-subscribe-form').val()) {
299
  $('.wpdiscuz-recaptcha', $(this)).css('border', '1px solid red');
300
  e.preventDefault();
303
  }
304
  });
305
  } else if (wpdiscuzRecaptchaVersion === '3.0') {
306
+ $('body').on('click', '#wpdiscuz_subscription_button', function (e) {
307
  var subscriptionForm = $(this).parents('#wpdiscuz-subscribe-form');
308
  e.preventDefault();
309
  try {
525
  //============================== /reCAPTCHA ============================== //
526
  //============================== ADD COMMENT FUNCTION ============================== //
527
 
528
+ $('body').on('click', '.wc_comm_submit.wpd_not_clicked', function () {
529
  var currentSubmitBtn = $(this);
530
  var depth = 1;
531
  var wcForm = $(this).parents('form');
744
  //============================== EDIT COMMENT FUNCTION ============================== //
745
  var wcCommentTextBeforeEditing;
746
 
747
+ $('body').on('click', '.wpd_editable_comment', function () {
748
  if (wcCommentTextBeforeEditing && $('.wpdiscuz-edit-form-wrap').length) {
749
  wpdCancelOrSave(getUniqueID($('.wpdiscuz-edit-form-wrap'), 0), wcCommentTextBeforeEditing);
750
  }
785
  });
786
  });
787
 
788
+ $('body').on('click', '.wc_save_edited_comment', function () {
789
  var el = $(this)
790
  var uniqueID = getUniqueID(el);
791
  var commentID = getCommentID(uniqueID);
845
  }
846
  });
847
 
848
+ $('body').on('click', '.wc_cancel_edit', function () {
849
  var uniqueID = getUniqueID($(this));
850
  wpdCancelOrSave(uniqueID, wcCommentTextBeforeEditing);
851
  if (wpdiscuzLoadRichEditor) {
868
  wpdiscuzLoadComments(true);
869
  }, 500);
870
  } else {
871
+ $('body').on('click', '.wpd-load-comments', function () {
872
  $(this).parent('.wpd-load-more-submit-wrap').remove();
873
  wpdiscuzLoadComments(true);
874
  });
875
  }
876
  }
877
 
878
+ $('body').on('click', '.wpd-load-more-submit', function () {
879
  var loadButton = $(this);
880
  var loaded = 'wpd-loaded';
881
  var loading = 'wpd-loading';
894
  }
895
 
896
  function wpdiscuzScrollEvents() {
897
+ var wpdiscuzHasMoreCommentsElement = document.getElementById('wpdiscuzHasMoreComments');
898
+ var wpdiscuzHasMoreComments = 0;
899
+ if (wpdiscuzHasMoreCommentsElement) {
900
+ wpdiscuzHasMoreComments = wpdiscuzHasMoreCommentsElement.dataset.is_show_load_more;
901
+ }
902
+ var scrollHeight = document.getElementById('wpdcom') ? document.getElementById('wpdcom').clientHeight : 0;
903
  var scrollPosition = $(window).height() + $(window).scrollTop();
904
  if (scrollHeight && scrollPosition) {
905
  var scrollPercent = scrollPosition * 100 / scrollHeight;
966
  }
967
 
968
  function setLoadMoreVisibility(r, showPagination) {
969
+ var wpdiscuzHasMoreCommentsElement = document.getElementById('wpdiscuzHasMoreComments');
970
  if (r.data.is_show_load_more == false) {
971
+ if (wpdiscuzHasMoreCommentsElement) {
972
+ wpdiscuzHasMoreCommentsElement.dataset.is_show_load_more = 0;
973
+ }
974
  $('.wpd-load-more-submit').parents('.wpdiscuz-comment-pagination').hide();
975
  } else {
976
  setLastParentID(r.data.last_parent_id);
977
+ if (wpdiscuzHasMoreCommentsElement) {
978
+ wpdiscuzHasMoreCommentsElement.dataset.is_show_load_more = 1;
979
+ }
980
  if (showPagination) {
981
  $('.wpd-load-more-submit').parents('.wpdiscuz-comment-pagination').show();
982
  }
996
  wpdiscuzAjaxObj.setLoadMoreVisibility = setLoadMoreVisibility;
997
  //============================== /LOAD MORE ============================== //
998
  //============================== VOTE ============================== //
999
+ $('body').on('click', '.wpd-vote-up.wpd_not_clicked, .wpd-vote-down.wpd_not_clicked', function () {
1000
  var currentVoteBtn = $(this);
1001
  $(currentVoteBtn).removeClass('wpd_not_clicked');
1002
  var uniqueId = getUniqueID(currentVoteBtn);
1073
  children.hide();
1074
  }
1075
  });
1076
+ $('body').on('click', '.wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)', function () {
1077
  var clickedBtn = $(this);
1078
  var sorting = $(this).attr("data-sorting");
1079
  if (sorting) {
1210
 
1211
  //============================== /LIVE UPDATE ============================== //
1212
  //============================== READ MORE ============================== //
1213
+ $('body').on('click', '.wpdiscuz-readmore', function () {
1214
  var uniqueId = getUniqueID($(this));
1215
  var commentId = getCommentID(uniqueId);
1216
  var data = new FormData();
1387
  $('body').css('scroll-behavior', bodyScrollBehavior);
1388
  }
1389
 
1390
+ $('body').on('change', '.wpd-required-group', function () {
1391
  if ($('input:checked', this).length !== 0) {
1392
  $('input', $(this)).prop('required', false);
1393
  } else {
1396
  });
1397
 
1398
  /* SPOILER */
1399
+ $('body').on('click', '.wpdiscuz-spoiler', function () {
1400
  $(this).next().slideToggle();
1401
  if ($(this).hasClass('wpdiscuz-spoiler-closed')) {
1402
  $(this).parents('.wpdiscuz-spoiler-wrap').find('.fa-plus').removeClass('fa-plus').addClass('fa-minus');
1433
  });
1434
  }
1435
 
1436
+ $('body').on('click', '.wpd-tools i', function () {
1437
  var sibling = $(this).siblings('.wpd-tools-actions');
1438
  if (!sibling.is(':visible') && $(this).parents('.wpd-comment-right').attr('id') === $('[id^=comment-]', '#wpdcom').last().attr('id')) {
1439
  $('#comments').css({paddingBottom: '160px'});
1440
  }
1441
  sibling.css({display: sibling.is(':visible') ? 'none' : 'flex'});
1442
  });
1443
+ $('body').on('mouseleave', '.wpd-comment-right', function () {
1444
  $(this).find('.wpd-tools-actions').hide();
1445
  $('#comments').css({paddingBottom: '0'});
1446
  });
1447
 
1448
+ $('body').on('click', '.wpd_stick_btn', function () {
1449
  var uniqueId = getUniqueID($(this), 0);
1450
  var commentId = getCommentID(uniqueId);
1451
  var data = new FormData();
1466
  });
1467
  });
1468
 
1469
+ $('body').on('click', '.wpd_close_btn', function () {
1470
  var uniqueId = getUniqueID($(this), 0);
1471
  var commentId = getCommentID(uniqueId);
1472
  var data = new FormData();
1487
  });
1488
  });
1489
 
1490
+ $('body').on('click', '.wpd-filter.wpd_not_clicked[data-filter-type]', function () {
1491
  var btn = $(this);
1492
  var type = btn.attr('data-filter-type');
1493
  wpdiscuzAjaxObj.resetActiveFilters('.wpdf-' + type);
1537
  });
1538
  });
1539
 
1540
+ $('body').on('click', '.wpdf-reacted.wpd_not_clicked', function () {
1541
  var btn = $(this);
1542
  btn.removeClass('wpd_not_clicked');
1543
  $('.fas', btn).addClass('fa-pulse fa-spinner');
1569
  });
1570
  });
1571
 
1572
+ $('body').on('click', '.wpdf-hottest.wpd_not_clicked', function () {
1573
  var btn = $(this);
1574
  btn.removeClass('wpd_not_clicked');
1575
  $('.fas', btn).addClass('fa-pulse fa-spinner');
1602
  });
1603
  });
1604
 
1605
+ $('body').on('click', '.wpd-filter-view-all', function () {
1606
  $('.wpdf-inline.wpdf-active.wpd_not_clicked').trigger('click');
1607
  });
1608
 
1627
  }
1628
  }
1629
 
1630
+ $('body').on('click', '.wpd-follow-link.wpd_not_clicked', function () {
1631
  var btn = $(this);
1632
  btn.removeClass('wpd_not_clicked');
1633
  $('.fas', btn).addClass('fa-pulse fa-spinner');
1699
 
1700
  showHideNotificationType();
1701
 
1702
+ $('body').on('keyup', '.wc_email', function () {
1703
  showHideNotificationType($(this));
1704
  });
1705
 
1749
 
1750
  $('#wpd-bubble-wrapper').show();
1751
 
1752
+ $('body').on('click', '#wpd-bubble-add-message-close', function (e) {
1753
  e.preventDefault();
1754
  e.stopPropagation();
1755
  $('#wpd-bubble-wrapper').removeClass('wpd-bubble-hover');
1756
  });
1757
 
1758
+ $('body').on('click', '#wpd-bubble', function () {
1759
  unsetHtmlAndBodyScrollBehaviors();
1760
  if ($('#tab-title-reviews').length) {
1761
  $('#tab-title-reviews a').trigger('click');
1775
  });
1776
  });
1777
 
1778
+ $('body').on('click', '#wpd-bubble-comment-close', function (e) {
1779
  e.preventDefault();
1780
  $('#wpd-bubble-notification-message').hide();
1781
  $('#wpd-bubble-wrapper').removeClass('wpd-new-comment-added');
1782
  });
1783
 
1784
+ $('body').on('click', '#wpd-bubble-comment-reply-link a', function () {
1785
  var href = $(this).attr('href');
1786
  setTimeout(function () {
1787
  $('#wpd-bubble-notification-message').hide();
1798
  }, 100);
1799
  });
1800
 
1801
+ $('body').on('click', '#wpd-bubble-count', function () {
1802
  if (bubbleNewCommentIds.length) {
1803
  var data = new FormData();
1804
  data.append('action', 'wpdBubbleUpdate');
1962
  $('.wpd-last-inline-comments-wrapper').remove();
1963
  }
1964
  });
1965
+ $('body').on('click', '.wpd-inline-submit.wpd_not_clicked', function (e) {
1966
  e.preventDefault();
1967
  var clickedButton = $(this);
1968
  var form = $(this).parents('.wpd_inline_comm_form');
2017
  });
2018
  }
2019
  });
2020
+ $('body').on('keydown', '.wpd-form', function (e) {
2021
  if (e.ctrlKey && e.keyCode == 13) {
2022
  $(this).find('.wc_comm_submit').trigger('click');
2023
  }
2024
  });
2025
+ $('body').on('keydown', '#wpdiscuz-edit-form', function (e) {
2026
  if (e.ctrlKey && e.keyCode == 13) {
2027
  $(this).find('.wc_save_edited_comment').trigger('click');
2028
  }
2029
  });
2030
+ $('body').on('keydown', '.wpd-inline-comment-content', function (e) {
2031
  if (e.ctrlKey && e.keyCode == 13) {
2032
  $(this).parents('.wpd_inline_comm_form').find('.wpd-inline-submit.wpd_not_clicked').trigger('click');
2033
  }
2034
  });
2035
+ $('body').on('click', '.wpd-inline-icon-count.wpd-has-comments', function () {
2036
  var clickedButton = $(this);
2037
  var data = new FormData();
2038
  data.append('action', 'wpdGetLastInlineComments');
2055
  $('#wpdiscuz-loading-bar').fadeOut(250);
2056
  });
2057
  });
2058
+ $('body').on('click', '.wpd-view-all-inline-comments', function (e) {
2059
  e.preventDefault();
2060
  $(this).parents('.wpd-last-inline-comments-wrapper').remove();
2061
  if (!$('.wpdf-inline').hasClass('wpdf-active')) {
2066
  scrollTop: $('.wpdf-inline').offset().top - scrollSize
2067
  }, 1000, restoreHtmlAndBodyScrollBehaviors);
2068
  });
2069
+ $('body').on('click', '.wpd-feedback-content-link', function (e) {
2070
  e.preventDefault();
2071
  var feedbackId = $(this).data('feedback-content-id');
2072
  unsetHtmlAndBodyScrollBehaviors();
2157
 
2158
  //========================= /INLINE COMMENTS =====================//
2159
  //========================= POST RATING =====================//
2160
+ $('body').on('click', '#wpd-post-rating.wpd-not-rated .wpd-rate-starts svg', function () {
2161
  var data = new FormData();
2162
  var rating = $(this).index();
2163
  if (rating >= 0 && rating < 5) {
2185
  });
2186
  //========================= /POST RATING =====================//
2187
 
2188
+ $('body').on('submit', '#wpdiscuz-subscribe-form', function (e) {
2189
  e.preventDefault();
2190
  var wcForm = $(this);
2191
+ const sbmBtn = $('#wpdiscuz_subscription_button', wcForm);
2192
+ if (wcForm[0].checkValidity() && wpdReCaptchaValidateOnSubscribeForm(wcForm) && sbmBtn.hasClass('wpd_not_clicked')) {
2193
+ sbmBtn.removeClass('wpd_not_clicked');
2194
  var data = new FormData();
2195
  data.append('action', 'wpdAddSubscription');
2196
  var elements = $("*", wcForm);
2220
  }
2221
  $('#wpdiscuz-loading-bar').fadeOut(250);
2222
  addingComment = false;
2223
+ sbmBtn.addClass('wpd_not_clicked');
2224
  })
2225
  .fail(function (jqXHR, textStatus, errorThrown) {
2226
  console.log(errorThrown);
2227
+ sbmBtn.addClass('wpd_not_clicked');
2228
  $('#wpdiscuz-loading-bar').fadeOut(250);
2229
  });
2230
  }
2231
  });
2232
+ $('body').on('click', '.wpd-unsubscribe', function (e) {
2233
  e.preventDefault();
2234
  var data = new FormData();
2235
  data.append('action', 'wpdUnsubscribe');
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(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),s=parseInt(wpdiscuzAjaxObj.wc_post_id);wpdiscuzAjaxObj.wpdiscuz_nonce="";var d=parseInt(wpdiscuzAjaxObj.commentListUpdateType),c=1e3*parseInt(wpdiscuzAjaxObj.commentListUpdateTimer),p=parseInt(wpdiscuzAjaxObj.liveUpdateGuests),r=wpdiscuzAjaxObj.loadLastCommentId,l=r,m=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 w,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),k=parseInt(wpdiscuzAjaxObj.bubbleHintTimeout),O=parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout)?parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout):5,y=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(){we(e(this))}),e.each(e("textarea.wc_comment"),function(){we(e(this))})),e(document).on("focus","#wpdcom .ql-editor, #wpdcom .wc_comment",function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(j)}),e(document).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(document).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(document).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(document).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){var i={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)};U(i)}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(document).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(document).on("click",".wpdiscuz-nofollow,.wc_captcha_refresh_img,.wpd-load-more-submit",function(e){e.preventDefault()}),e(document).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(document).on("mouseenter",".wpd-new-loaded-comment",function(){e(this).removeClass("wpd-new-loaded-comment")}),e(document).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(document).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(document).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"}]):we(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(document).on("click",".wc_comm_submit.wpd_not_clicked",function(){var i=e(this),s=1,d=e(this).parents("form");if("true"!==d.attr("data-uploading"))if(d.hasClass("wpd_main_comm_form")||(s=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(d,"#wpd-editor-"+e(".wpdiscuz_unique_id",d).val()),d.on("submit",function(e){e.preventDefault()}),""!==e(".wc_comment",d).val().trim()){if(d[0].checkValidity()&&(p=d,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))}))})}(d),e(i).removeClass("wpd_not_clicked");var c=new FormData;if(c.append("action","wpdAddComment"),e(":input",d).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",s),wpdiscuzAjaxObj.wpdiscuz_zs&&c.append("wpdiscuz_zs",wpdiscuzAjaxObj.wpdiscuz_zs),e(".wpd-cookies-checkbox",d).length?e(".wpd-cookies-checkbox",d).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(d,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(d,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",d).val()),e(".wpdiscuz_reset").val("")}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wc_msg_required_fields,"wc_msg_required_fields",d),"error");else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhraseDoingUpload,"wmuPhraseDoingUpload",d),"warning")}),e(document).on("click",".wpd_editable_comment",function(){w&&e(".wpdiscuz-edit-form-wrap").length&&W(X(e(".wpdiscuz-edit-form-wrap"),0),w);var t=e(this),a=X(t,0),o=Y(a),n=new FormData;n.append("action","wpdEditComment"),n.append("commentId",o),w=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),we(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(document).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?(n.success?(W(a,n.data.message),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)):console.log(n),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wc_cancel_edit",function(){var t=X(e(this));W(t,w),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)}),!u&&m&&(L=0,1==m?setTimeout(function(){B(!0)},500):e(document).on("click",".wpd-load-comments",function(){e(this).parent(".wpd-load-more-submit-wrap").remove(),B(!0)})),e(document).on("click",".wpd-load-more-submit",function(){var t=e(this);t.hasClass("wpd-loaded")&&B(!1,t,"wpd-loaded","wpd-loading")});var N=!1;function V(){var t=e("#wpdiscuzHasMoreComments").val(),a=e(document).height(),o=e(window).height()+e(window).scrollTop();a&&o&&(100*o/a>=80&&!1===N&&1==t&&(N=!0,B(!1,e(".wpd-load-more-submit"))))}function B(t,a,o,n){a&&(a.toggleClass(o),a.toggleClass(n));var s=new FormData;s.append("action","wpdLoadMoreComments");var d=e(".wpdiscuz-sort-button-active").attr("data-sorting");d&&s.append("sorting",d),s.append("offset",L),s.append("lastParentId",e(".wpd-load-more-submit").attr("data-lastparentid")),s.append("isFirstLoad",t?1:0);var c=e(".wpdf-active").attr("data-filter-type");s.append("wpdType",c||""),fe(v,!t||1!=m,s).done(function(s){"object"==typeof s&&s.success&&(L++,t&&e(".wpd-comment").remove(),e(".wpdiscuz_single").remove(),e(".wpdiscuz-comment-pagination").before(s.data.comment_list),K(s,t&&2!==i),N=!1,s.data.loadLastCommentId&&(r=s.data.loadLastCommentId),ue(s),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,s){console.log(s),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),a&&(a.toggleClass(o),a.toggleClass(n))})}function K(t,a){if(0==t.data.is_show_load_more)e("#wpdiscuzHasMoreComments").val(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(),e("#wpdiscuzHasMoreComments").val(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)}var o;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(),V(),e(window).scroll(function(){V()})),wpdiscuzAjaxObj.setLoadMoreVisibility=K,e(document).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)),s=n.data.votes;i.text(n.data.votesHumanReadable),i.attr("title",s),i.removeClass("wpd-up wpd-down"),s>0&&i.addClass("wpd-up"),s<0&&i.addClass("wpd-down")}else{var d=e(".wpd-comment-footer .wpd-vote-result-like",e("#comment-"+o)),c=e(".wpd-comment-footer .wpd-vote-result-dislike",e("#comment-"+o));d.text(n.data.likeCountHumanReadable),d.attr("title",n.data.likeCount),c.text(n.data.dislikeCountHumanReadable),c.attr("title",n.data.dislikeCount),parseInt(n.data.likeCount)>0?d.addClass("wpd-up"):d.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(document).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!=m&&Q(!1),e(document).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(document).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(document).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(document).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(document).on("mouseleave",".wpd-comment-right",function(){e(this).find(".wpd-tools-actions").hide(),e("#comments").css({paddingBottom:"0"})}),e(document).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(document).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(document).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(document).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(document).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(document).on("click",".wpd-filter-view-all",function(){e(".wpdf-inline.wpdf-active.wpd_not_clicked").trigger("click")}),e(document).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(document).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")}),k&&!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*O)},1e3*k),"content_left"===A)if(e(".entry-content").length){var se=(de=Math.min(e(".entry-content").offset().left,e("#wpdcom").offset().left)-120)>25?de:25;e("#wpd-bubble-wrapper").css({left:se+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".post-entry").length){se=(de=Math.min(e(".post-entry").offset().left,e("#wpdcom").offset().left)-120)>25?de:25;e("#wpd-bubble-wrapper").css({left:se+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".container").length){var de;se=(de=Math.min(e(".container").offset().left,e("#wpdcom").offset().left)-120)>25?de:25;e("#wpd-bubble-wrapper").css({left:se+"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(document).on("click","#wpd-bubble-add-message-close",function(t){t.preventDefault(),t.stopPropagation(),e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")}),e(document).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(document).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(document).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(document).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||d)&&(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:s,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){d&&((i=new FormData).append("action","wpdUpdateAutomatically"),i.append("loadLastCommentId",r),i.append("visibleCommentIds",ee()),fe(v,!1,i).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),y&&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);var i;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"),me()):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"),me(t.siblings(".wpd-inline-form-wrapper"))))})}function me(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 we(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,s=e(".wpd-editor-char-counter",a),d=o-i;s.html(d),d<=10?s.addClass("error"):s.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",s),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"),me(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(document).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(document).on("keydown",".wpd-form",function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_comm_submit").trigger("click")}),e(document).on("keydown","#wpdiscuz-edit-form",function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_save_edited_comment").trigger("click")}),e(document).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(document).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(document).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(document).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(document).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(document).on("submit","#wpdiscuz-subscribe-form",function(t){t.preventDefault();var a,o,i=e(this);if(i[0].checkValidity()&&(a=i,o=!0,"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).length&&!e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).val().length?(o=!1,e(".wpdiscuz-recaptcha",a).css("border","1px solid red")):"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).length&&e(".wpdiscuz-recaptcha",a).css("border","none"),o)){var s=new FormData;s.append("action","wpdAddSubscription"),e("*",i).each(function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&s.append(this.name+"",e(this).val()),"checkbox"!=this.type&&"radio"!=this.type||e(this).is(":checked")&&s.append(this.name+"",e(this).val())}),fe(v,!0,s).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}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).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")}};
1
+ var wpdiscuzLoadRichEditor=parseInt(wpdiscuzAjaxObj.loadRichEditor);if(wpdiscuzLoadRichEditor&&document.querySelector(".wpdiscuz-textarea-wrap"))var wpDiscuzEditor=new WpdEditor;function wpdMessagesOnInit(a,b){wpdiscuzAjaxObj.setCommentMessage(a,b),setTimeout(function(){location.href=location.href.substring(0,location.href.indexOf("wpdiscuzUrlAnchor")-1)},3e3)}wpdiscuzAjaxObj.setCommentMessage=function(c,b,d){var a="wpdiscuz-message-error";if(c instanceof Array)for(var e in c)b instanceof Array?"success"===b[e]?a="wpdiscuz-message-success":"warning"===b[e]&&(a="wpdiscuz-message-warning"):"success"===b?a="wpdiscuz-message-success":"warning"===b&&(a="wpdiscuz-message-warning"),jQuery("<div/>").addClass(a).html(c[e]).prependTo("#wpdiscuz-comment-message").delay(d instanceof Array?d[e]:d||4e3).fadeOut(1e3,function(){jQuery(this).remove()});else"success"===b?a="wpdiscuz-message-success":"warning"===b&&(a="wpdiscuz-message-warning"),jQuery("<div/>").addClass(a).html(c).prependTo("#wpdiscuz-comment-message").delay(d||4e3).fadeOut(1e3,function(){jQuery(this).remove()})},wpdiscuzAjaxObj.applyFilterOnPhrase=function(a,b,c){return wpdiscuzAjaxObj.phraseFilters&&jQuery.each(wpdiscuzAjaxObj.phraseFilters,function(d){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[d]]&&(a=wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[d]](a,b,c))}),a},jQuery(document).ready(function($){$("body").addClass("wpdiscuz_"+wpdiscuzAjaxObj.version);var H,c=wpdiscuzAjaxObj.is_user_logged_in,q=1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!c,r=1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&c,e=wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion,s=parseInt(wpdiscuzAjaxObj.commentListLoadType),I=parseInt(wpdiscuzAjaxObj.wc_post_id);wpdiscuzAjaxObj.wpdiscuz_nonce="";var t=parseInt(wpdiscuzAjaxObj.commentListUpdateType),u=1e3*parseInt(wpdiscuzAjaxObj.commentListUpdateTimer),v=parseInt(wpdiscuzAjaxObj.liveUpdateGuests),w=wpdiscuzAjaxObj.loadLastCommentId,J=w,f=parseInt(wpdiscuzAjaxObj.firstLoadWithAjax);Cookies.get("wpdiscuz_comments_sorting")&&Cookies.remove("wpdiscuz_comments_sorting",{path:""}),Cookies.get("wordpress_last_visit")&&Cookies.remove("wordpress_last_visit",{path:""}),Cookies.get("wpdiscuz_last_visit")&&Cookies.remove("wpdiscuz_last_visit",{path:""});var i=parseInt(wpdiscuzAjaxObj.wordpressIsPaginate),K=wpdiscuzAjaxObj.storeCommenterData,L=parseInt(wpdiscuzAjaxObj.wmuEnabled),M=wpdiscuzAjaxObj.isCookiesEnabled,N=!0,g=wpdiscuzAjaxObj.cookiehash,O=parseInt(wpdiscuzAjaxObj.isLoadOnlyParentComments),P=parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0,x=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),j=parseInt(wpdiscuzAjaxObj.enableBubble),y=parseInt(wpdiscuzAjaxObj.bubbleLiveUpdate),k=parseInt(wpdiscuzAjaxObj.bubbleHintTimeout),Q=parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout)?parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout):5,R=parseInt(wpdiscuzAjaxObj.bubbleShowNewCommentMessage),h=wpdiscuzAjaxObj.bubbleLocation,l=wpdiscuzAjaxObj.inlineFeedbackAttractionType,m=parseInt(wpdiscuzAjaxObj.scrollSize),m=m||32,S=[],T=[],U=[],V=!1,z=1,W=$("html").css("scroll-behavior"),X=$("body").css("scroll-behavior");if($(".wc_social_plugin_wrapper .wp-social-login-provider-list").length?$(".wc_social_plugin_wrapper .wp-social-login-provider-list").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):$(".wc_social_plugin_wrapper .the_champ_login_container").length?$(".wc_social_plugin_wrapper .the_champ_login_container").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):$(".wc_social_plugin_wrapper .social_connect_form").length?$(".wc_social_plugin_wrapper .social_connect_form").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):$(".wc_social_plugin_wrapper .oneall_social_login_providers").length&&$(".wc_social_plugin_wrapper .oneall_social_login .oneall_social_login_providers").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"),wpdiscuzLoadRichEditor&&$("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0"),window.addEventListener("beforeunload",function(c){var b=$(".wpd-form").not(":hidden");if(b.length){if(wpdiscuzLoadRichEditor&&document.querySelector(".wpdiscuz-textarea-wrap")){for(var a=0;a<b.length;a++)if("\n"!==wpDiscuzEditor.createEditor($(b[a]).find(".ql-container").attr("id")).getText()){c.preventDefault(),c.returnValue="";return}}else for(var a=0;a<b.length;a++)if($(b[a]).find(".wc_comment").val()){c.preventDefault(),c.returnValue="";return}}}),wpdiscuzLoadRichEditor||($(document).delegate("textarea.wc_comment","input",function(){aD($(this))}),$.each($("textarea.wc_comment"),function(){aD($(this))})),$("body").on("focus","#wpdcom .ql-editor, #wpdcom .wc_comment",function(){$(".wpd-form-foot",$(this).parents(".wpd_comm_form")).slideDown(P)}),$("body").on("focus","#wpdcom textarea",function(){$(this).next(".autogrow-textarea-mirror").length||$(this).autoGrow()}),c||aa({comment_author:Cookies.get("comment_author_"+g),comment_author_email:Cookies.get("comment_author_email_"+g),comment_author_url:Cookies.get("comment_author_url_"+g)}),$(".wpd-vote-down.wpd-dislike-hidden").remove(),$(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd"),$("body").on("click","#wpd-editor-source-code-wrapper-bg",function(){$(this).hide(),$("#wpd-editor-source-code-wrapper").hide(),$("#wpd-editor-uid").val(""),$("#wpd-editor-source-code").val("")}),wpdiscuzLoadRichEditor&&$("body").on("click","#wpd-insert-source-code",function(){var a=wpDiscuzEditor.createEditor("#"+$("#wpd-editor-uid").val());a.deleteText(0,a.getLength(),Quill.sources.USER);var b=$("#wpd-editor-source-code").val();b.length&&a.clipboard.dangerouslyPasteHTML(0,b,Quill.sources.USER),a.update(),$("#wpd-editor-source-code-wrapper-bg").hide(),$("#wpd-editor-source-code-wrapper").hide(),$("#wpd-editor-uid").val(""),$("#wpd-editor-source-code").val("")}),$("body").on("click",".wpd-reply-button",function(){var a=aj($(this),0);$(this).hasClass("wpdiscuz-clonned")?(wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+a).focus()},P):setTimeout(function(){$("#wc-textarea-"+a).trigger("focus")},P),$("#wpd-secondary-form-wrapper-"+a).slideToggle(P)):ah($(this)),function(a){if((q||r)&&"2.0"===e){var b=ak(a);setTimeout(function(){if(!T[b])try{T[b]=grecaptcha.render("wpdiscuz-recaptcha-"+a,{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(b){$("#wpdiscuz-recaptcha-field-"+a).val("key")},"expired-callback":function(){$("#wpdiscuz-recaptcha-field-"+a).val("")}})}catch(c){console.log(c),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+c.message,"error")}},1e3)}}(a)}),$("body").on("click","#wpdcom [data-wpd-clipboard]",function(){var b=$(this).data("wpd-clipboard"),a=$("<input/>");a.appendTo("body").css({position:"absolute",top:"-10000000px"}).val(b),a.trigger("select"),document.execCommand("copy"),a.remove(),wpdiscuzAjaxObj.setCommentMessage(b+"<br/>"+wpdiscuzAjaxObj.wc_copied_to_clipboard,"success",5e3)}),$("body").on("click",".wpdiscuz-nofollow,.wc_captcha_refresh_img,.wpd-load-more-submit",function(a){a.preventDefault()}),$("body").on("click",".wpd-toggle.wpd_not_clicked",function(){var a=$(this);a.removeClass("wpd_not_clicked");var b=aj($(this),0),c=$(this),d=$(".fas",c);!c.parents(".wpd-comment:not(.wpd-reply)").children(".wpd-reply").length&&O?aw(b,a):$("#wpd-comm-"+b+"> .wpd-reply").slideToggle(700,function(){$(this).is(":hidden")?(d.removeClass("fa-chevron-up"),d.addClass("fa-chevron-down"),c.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_show_replies_text),c.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_show_replies_text)):(d.removeClass("fa-chevron-down"),d.addClass("fa-chevron-up"),c.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),c.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text)),a.addClass("wpd_not_clicked")})}),$("body").on("mouseenter",".wpd-new-loaded-comment",function(){$(this).removeClass("wpd-new-loaded-comment")}),$("body").on("click",".wpd-sbs-toggle",function(){$(".wpdiscuz-subscribe-bar").slideToggle(P)}),parseInt(wpdiscuzAjaxObj.wpDiscuzIsShowOnSubscribeForm)&&!c&&wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&$("#wpdiscuz-subscribe-form").length&&("2.0"===e?(setTimeout(function(){try{grecaptcha.render("wpdiscuz-recaptcha-subscribe-form",{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(a){$("#wpdiscuz-recaptcha-field-subscribe-form").val("key")},"expired-callback":function(){$("#wpdiscuz-recaptcha-field-subscribe-form").val("")}})}catch(a){console.log(a),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+a.message,"error")}},1e3),$("body").on("submit","#wpdiscuz-subscribe-form",function(a){$("#wpdiscuz-recaptcha-field-subscribe-form").val()?$(".wpdiscuz-recaptcha",$(this)).css("border","none"):($(".wpdiscuz-recaptcha",$(this)).css("border","1px solid red"),a.preventDefault())})):"3.0"===e&&$("body").on("click","#wpdiscuz_subscription_button",function(b){var c=$(this).parents("#wpdiscuz-subscribe-form");b.preventDefault();try{grecaptcha.ready(function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/wpdAddSubscription"}).then(function(a){console.log(5555),document.getElementById("wpdiscuz-recaptcha-field-subscribe-form").value=a,c.trigger("submit")},function(a){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(a)})})}catch(a){console.log(a),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+a.message,"error")}})),(q||r)&&"2.0"===e){var A=$(window).width(),a=$("#wpdcom").width();a>=1100&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"65%"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"35%"})),a>=940&&a<1100&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"60%"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"40%"})),a>=810&&a<940&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"40%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"60%"})),a>=730&&a<810&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"45%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"55%"})),a>=610&&a<730&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.85)","-webkit-transform":"scale(0.85)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"43%"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"55%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"30%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"70%"})),A>650&&(a>=510&&a<610&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"center 0","-webkit-transform-origin":"center 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"35%"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"63%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"30%",position:"relative",right:"-60px"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"70%"}),$("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"})),a>=470&&a<510&&($("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"center 0","-webkit-transform-origin":"center 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"40%"}),$("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"60%"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({float:"none",width:"100%",display:"block"}),$("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({float:"none",width:"100%",display:"block"}),$("#wpdcom .wpd_main_comm_form .wc-form-footer").css({"margin-left":"0px"}),$("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"})),a<470&&($("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({margin:"0px auto","transform-origin":"center 0","-webkit-transform-origin":"center 0"}),$("#wpdcom .wpd-form-col-left").css({float:"none",width:"100%",display:"block"}),$("#wpdcom .wpd-form-col-right").css({float:"none",width:"100%",display:"block"}),$("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"}),$("#wpdcom .wpd-secondary-form-wrapper .wc_notification_checkboxes").css({"text-align":"center"}),$("#wpdcom .wpd-secondary-form-wrapper .wc-field-submit").css({"text-align":"center"})))}function Y(b,a,c){G(x||L,!1,a).done(function(a){if($(c).addClass("wpd_not_clicked"),"object"==typeof a){if(a.success){"collapsed"===wpdiscuzAjaxObj.commentFormView&&$(".wpd-form-foot",b).slideUp(P),a.data.wc_all_comments_count_new=parseInt(a.data.wc_all_comments_count_new),$(".wpd-thread-info").html(a.data.wc_all_comments_count_before_threads_html),$(".wpd-thread-info").attr("data-comments-count",a.data.wc_all_comments_count_new),$("#wpd-bubble-all-comments-count").replaceWith(a.data.wc_all_comments_count_bubble_html);var d=P;a.data.is_main?az(a.data.message):(d=P+700,$("#wpd-secondary-form-wrapper-"+a.data.uniqueid).slideToggle(700),1==a.data.is_in_same_container?$("#wpd-secondary-form-wrapper-"+a.data.uniqueid).after(a.data.message):$("#wpd-comm-"+a.data.uniqueid).after(a.data.message)),Z(a),_(a),M&&N?ab(a.data):N||$(".wpd-cookies-checkbox").prop("checked",!1),b.get(0).reset(),wpdiscuzLoadRichEditor?wpDiscuzEditor.createEditor("#wpd-editor-"+$(".wpdiscuz_unique_id",b).val()).setContents([{insert:"\n"}]):aD(b.find(".wc_comment")),aa(a.data),$(".wmu-preview-wrap",b).remove(),ay(),parseInt(wpdiscuzAjaxObj.scrollToComment)&&setTimeout(function(){au(),$("html, body").animate({scrollTop:$("#comment-"+a.data.new_comment_id).offset().top-m},1e3,av)},d),aE(a,b)}else a.data&&(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,b),"error"),aE(a,b))}else wpdiscuzAjaxObj.setCommentMessage(a,"error");$("#wpdiscuz-loading-bar").fadeOut(250),V=!1}).fail(function(b,d,a){console.log(a),$(c).addClass("wpd_not_clicked"),$("#wpdiscuz-loading-bar").fadeOut(250)})}function Z(b){if(!b.data.held_moderate){var a=new FormData;a.append("action","wpdCheckNotificationType"),a.append("comment_id",b.data.new_comment_id),a.append("email",b.data.comment_author_email),a.append("isParent",b.data.is_main),G(x,!0,a)}}function _(a){if(a.data.redirect>0&&a.data.new_comment_id){var b=new FormData;b.append("action","wpdRedirect"),b.append("commentId",a.data.new_comment_id),G(x,!0,b).done(function(a){"object"==typeof a&&a.success&&setTimeout(function(){location.href=a.data},2e3)}).fail(function(b,c,a){console.log(a)})}}function aa(a){$(".wpd_comm_form .wc_name").val(a.comment_author),a.comment_author_email&&0>a.comment_author_email.indexOf("@example.com")&&$(".wpd_comm_form .wc_email").val(a.comment_author_email),a.comment_author_url&&$(".wpd_comm_form .wc_website").val(a.comment_author_url)}function ab(b){var c=b.comment_author_email,d=b.comment_author,a=b.comment_author_url;null==K?(Cookies.set("comment_author_email_"+g,c),Cookies.set("comment_author_"+g,d),a.length&&Cookies.set("comment_author_url_"+g,a)):(K=parseInt(K),Cookies.set("comment_author_email_"+g,c,{expires:K,path:"/"}),Cookies.set("comment_author_"+g,d,{expires:K,path:"/"}),a.length&&Cookies.set("comment_author_url_"+g,a,{expires:K,path:"/"})),$(".wpd-cookies-checkbox").length&&$(".wpd-cookies-checkbox").prop("checked",!0)}function ac(a,b){$("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").show(),$("#wpd-comm-"+a+" .wpdiscuz-edit-form-wrap").replaceWith(b),$("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-last-edited").show()}$("body").on("click",".wc_comm_submit.wpd_not_clicked",function(){var d=$(this),f=1,a=$(this).parents("form");if("true"===a.attr("data-uploading")){wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhraseDoingUpload,"wmuPhraseDoingUpload",a),"warning");return}if(a.hasClass("wpd_main_comm_form")||(f=an($(this).parents(".wpd-comment"))),as(a,"#wpd-editor-"+$(".wpdiscuz_unique_id",a).val()),a.on("submit",function(a){a.preventDefault()}),""===$(".wc_comment",a).val().trim()){wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wc_msg_required_fields,"wc_msg_required_fields",a),"error");return}if(a[0].checkValidity()&&(h=a,i=!0,"2.0"===e&&$("input[name=wc_captcha]",h).length&&!$("input[name=wc_captcha]",h).val().length?(i=!1,$(".wpdiscuz-recaptcha",h).css("border","1px solid red")):"2.0"===e&&$("input[name=wc_captcha]",h).length&&$(".wpdiscuz-recaptcha",h).css("border","none"),i)){V=!0,ax(a),$(d).removeClass("wpd_not_clicked");var h,i,b=new FormData;if(b.append("action","wpdAddComment"),$(":input",a).each(function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&b.append(this.name+"",$(this).val().trim()),("checkbox"==this.type||"radio"==this.type)&&$(this).is(":checked")&&b.append(this.name+"",$(this).val())}),b.append("wpd_comment_depth",f),wpdiscuzAjaxObj.wpdiscuz_zs&&b.append("wpdiscuz_zs",wpdiscuzAjaxObj.wpdiscuz_zs),$(".wpd-cookies-checkbox",a).length?$(".wpd-cookies-checkbox",a).prop("checked")||(N=!1):c&&(N=!1),$("#wpdiscuz-loading-bar").show(),wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&"3.0"===e&&(1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!wpdiscuzAjaxObj.is_user_logged_in||1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&wpdiscuzAjaxObj.is_user_logged_in))try{grecaptcha.ready(function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/addComment"}).then(function(c){b.append("g-recaptcha-response",c),Y(a,b,d)},function(a){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(a)})})}catch(g){console.log(g),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+g.message,"error"),$("#wpdiscuz-loading-bar").fadeOut(250)}else Y(a,b,d)}(function(a){if((q||r)&&"2.0"===e){var b=ak(a);grecaptcha.reset(T[b])}})($(".wpdiscuz_unique_id",a).val()),ar()}),$("body").on("click",".wpd_editable_comment",function(){H&&$(".wpdiscuz-edit-form-wrap").length&&ac(aj($(".wpdiscuz-edit-form-wrap"),0),H);var c=$(this),b=aj(c,0),d=ak(b),a=new FormData;a.append("action","wpdEditComment"),a.append("commentId",d),H=$("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-text").get(0),G(x,!0,a).done(function(a){if("object"==typeof a){if(a.success){if($("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text").replaceWith(a.data.html),wpdiscuzLoadRichEditor){var d=wpDiscuzEditor.createEditor("#wpd-editor-edit_"+b);d.clipboard.dangerouslyPasteHTML(0,a.data.content),d.update(),$(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd")}else $("#wc-textarea-edit_"+b).val(a.data.content),aD($("#wc-textarea-edit_"+b));$("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").hide(),$("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-last-edited").hide()}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,c),"error")}else console.log(a);$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("click",".wc_save_edited_comment",function(){var d=$(this),b=aj(d),e=ak(b),a=$("#wpd-comm-"+b+" #wpdiscuz-edit-form");if(as(a,"#wpd-editor-edit_"+b),a.on("submit",function(a){a.preventDefault()}),a[0].checkValidity()){var c=new FormData;c.append("action","wpdSaveEditedComment"),c.append("commentId",e),$(":input",a).each(function(){""!==this.name&&"checkbox"!==this.type&&"radio"!==this.type&&c.append(this.name+"",$(this).val()),("checkbox"===this.type||"radio"===this.type)&&$(this).is(":checked")&&c.append(this.name+"",$(this).val())}),G(x,!0,c).done(function(a){"object"==typeof a?(a.success?(ac(b,a.data.message),a.data.lastEdited&&($("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-last-edited").remove(),$(a.data.lastEdited).insertAfter("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text")),a.data.twitterShareLink&&$("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_tw").attr("href",a.data.twitterShareLink),a.data.whatsappShareLink&&$("#wpd-comm-"+b+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_whatsapp").attr("href",a.data.whatsappShareLink),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+b)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,d),"error"),aE(a,e)):console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}}),$("body").on("click",".wc_cancel_edit",function(){var a=aj($(this));ac(a,H),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+a)}),!i&&f&&(z=0,1==f?setTimeout(function(){ae(!0)},500):$("body").on("click",".wpd-load-comments",function(){$(this).parent(".wpd-load-more-submit-wrap").remove(),ae(!0)})),$("body").on("click",".wpd-load-more-submit",function(){var a=$(this),b="wpd-loaded";a.hasClass(b)&&ae(!1,a,b,"wpd-loading")});var ad=!1;function B(){var a=document.getElementById("wpdiscuzHasMoreComments"),b=0;a&&(b=a.dataset.is_show_load_more);var c=document.getElementById("wpdcom")?document.getElementById("wpdcom").clientHeight:0,d=$(window).height()+$(window).scrollTop();c&&d&&100*d/c>=80&& !1===ad&&1==b&&(ad=!0,ae(!1,$(".wpd-load-more-submit")))}function ae(c,b,e,g){b&&(b.toggleClass(e),b.toggleClass(g));var a=new FormData;a.append("action","wpdLoadMoreComments");var d=$(".wpdiscuz-sort-button-active").attr("data-sorting");d&&a.append("sorting",d),a.append("offset",z),a.append("lastParentId",al()),a.append("isFirstLoad",c?1:0);var h=$(".wpdf-active").attr("data-filter-type");a.append("wpdType",h||""),G(x,!c||1!=f,a).done(function(a){"object"==typeof a&&a.success&&(z++,c&&$(".wpd-comment").remove(),$(".wpdiscuz_single").remove(),$(".wpdiscuz-comment-pagination").before(a.data.comment_list),C(a,c&&2!==s),ad=!1,a.data.loadLastCommentId&&(w=a.data.loadLastCommentId),aE(a),c&&D(!1)),$("#wpdiscuz-loading-bar").fadeOut(250),$(".wpd-load-more-submit").blur(),b&&(b.toggleClass(e),b.toggleClass(g))}).fail(function(c,d,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250),$(".wpd-load-more-submit").blur(),b&&(b.toggleClass(e),b.toggleClass(g))})}function C(a,d){var b=document.getElementById("wpdiscuzHasMoreComments");if(!1==a.data.is_show_load_more)b&&(b.dataset.is_show_load_more=0),$(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide();else if(am(a.data.last_parent_id),b&&(b.dataset.is_show_load_more=1),d&&$(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").show(),a.data.comments_left>0){if(!$(".wpd-load-more-submit .wpd-comments-left").length){let c=$("<span>");c.addClass("wpd-comments-left"),$(".wpd-load-more-submit").append(c)}$(".wpd-load-more-submit .wpd-comments-left").text(a.data.comments_left_text)}aE(a)}function D(d){var b=location.href.match(/#comment\-(\d+)/);if(null!==b){var c=b[1];if($("#comment-"+c).length)setTimeout(function(){au(),$("html, body").animate({scrollTop:$("#comment-"+c).parents("[id^=wpd-comm-]").offset().top-m},1e3,av),d&&af(c)},500);else{var a=new FormData;a.append("action","wpdGetSingleComment"),a.append("commentId",c),G(x,!0,a).done(function(a){if("object"==typeof a&&a.success){var b="#comment-"+c;$("#comment-"+a.data.parentCommentID).length?$("#comment-"+a.data.parentCommentID).parents("[id^=wpd-comm-"+a.data.parentCommentID+"]").replaceWith(a.data.message):$(".wpd-thread-list").prepend(a.data.message),aE(a),au(),$("html, body").animate({scrollTop:$(b).offset().top-m},1e3,av),d&&af(c)}$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}}}function af(a){setTimeout(function(){$("#comment-"+a).siblings(".wpd-secondary-form-wrapper").is(":visible")||$("#comment-"+a).find(".wpd-reply-button").trigger("click")},1100)}function ag(b){if(void 0!==b.data.message)for(var c,d=b.data.message,a=0;a<d.length;a++)ap((c=d[a]).comment_parent,c.comment_html)}function ah(b){var a=aj(b,0);$("#wpdiscuz_form_anchor-"+a).before(ai(a));var d=$("#wpd-secondary-form-wrapper-"+a);c||aa({comment_author:Cookies.get("comment_author_"+g),comment_author_email:Cookies.get("comment_author_email_"+g),comment_author_url:Cookies.get("comment_author_url_"+g)}),wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+a).focus()},P):setTimeout(function(){$("#wc-textarea-"+a).trigger("focus")},P),d.slideToggle(P,function(){b.addClass("wpdiscuz-clonned")})}function ai(a){return $("#wpdiscuz_hidden_secondary_form").html().replace(/wpdiscuzuniqueid/g,a)}function aj(a,c){var b="";return(b=c?a.parents(".wpd-main-form-wrapper").attr("id"):a.parents(".wpd-comment").attr("id")).substring(b.lastIndexOf("-")+1)}function ak(a){return a.substring(0,a.indexOf("_"))}function al(){return $(".wpd-load-more-submit").attr("data-lastparentid")}function am(a){$(".wpd-load-more-submit").attr("data-lastparentid",a),2!==s&&$(".wpdiscuz-comment-pagination").show()}function an(a){var b=a.attr("class").split(" "),c="";return $.each(b,function(b,a){"wpd_comment_level"===ao(a,!1)&&(c=ao(a,!0))}),parseInt(c)+1}function ao(a,b){return b?a.substring(a.indexOf("-")+1):a.substring(0,a.indexOf("-"))}function ap(a,b){if(0==a)az(b);else{var c=aj($("#comment-"+a),0);$("#wpdiscuz_form_anchor-"+c).after(b)}}function aq(){var a=[];return $(".wpd-comment-right").each(function(){a.push(ak(aj($(this),0)))}),a.join(",")}function ar(){$(".wpdiscuz_reset").val("")}function as(a,b){var c=a.find(".wpd-required-group");wpdiscuzLoadRichEditor&&a.find(".wc_comment").val($(b+">.ql-editor").html()),at(a),$.each(c,function(){$("input",this).prop("required",!1),0===$("input:checked",this).length?$("input",$(this)).prop("required",!0):$(".wpd-field-invalid",this).remove()})}function at(c){var b=c.find(".wc_comment"),a=b.val().trim().replace(/<p><br><\/p>/g,"\n").replace(/<p>(.*?)<\/p>/g,"$1\n");a=(a=(a=(a=a.replace(/<img src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img[^>]+alt=["|']([^"|']+)["|'][^>]+src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'][^>]?>/g," $1 ")).replace(/<img\s+([^>]*)class=["|']wpdem\-sticker["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img\s+([^>]*)src=["|']([^"|']+)["|'](.*?)[^>]*>/g," $2 "),b.val(a)}function au(){$("html, body").css("scroll-behavior","unset")}function av(){$("html").css("scroll-behavior",W),$("body").css("scroll-behavior",X)}function aw(b,d){var c=ak(b),a=new FormData;a.append("action","wpdShowReplies"),a.append("commentId",c),G(x,!0,a).done(function(a){d.addClass("wpd_not_clicked"),"object"==typeof a&&a.success&&($("#wpd-comm-"+b).replaceWith(a.data.comment_list),$("#wpd-comm-"+b+" .wpd-toggle .fas").removeClass("fa-chevron-down").addClass("fa-chevron-up"),$("#wpd-comm-"+b+" .wpd-toggle .wpd-view-replies .wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),$("#wpd-comm-"+b+" .wpd-toggle").attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text),aE(a)),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),d.addClass("wpd_not_clicked"),$("#wpdiscuz-loading-bar").fadeOut(250)})}function ax(a){$(".wpd-agreement-checkbox",a).each(function(){$(this).hasClass("wpd_agreement_hide")&&M&&$(this).prop("checked")&&(Cookies.set($(this).attr("name")+"_"+g,1,{expires:30,path:"/"}),$("input[name="+$(this).attr("name")+"]").each(function(){S.push($(this))}))})}function ay(){S.length&&(S.forEach(function(a){a.parents(".wpd-field-checkbox").remove()}),S=[])}function az(a){$(".wpd-sticky-comment").last()[0]?$(a).insertAfter($(".wpd-sticky-comment").last()[0]):$(".wpd-thread-list").prepend(a)}function E(a){a?a.prop("required")||(a.val()?a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none")):$.each($(".wc_email"),function(c,b){var a=$(b);a.prop("required")||(a.val()?a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none"))})}if(2!==s||i||($(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide(),B(),$(window).scroll(function(){B()})),wpdiscuzAjaxObj.setLoadMoreVisibility=C,$("body").on("click",".wpd-vote-up.wpd_not_clicked, .wpd-vote-down.wpd_not_clicked",function(){var b,c=$(this);$(c).removeClass("wpd_not_clicked");var d=aj(c),e=ak(d);b=$(this).hasClass("wpd-vote-up")?1:-1;var a=new FormData;a.append("action","wpdVoteOnComment"),a.append("commentId",e),a.append("voteType",b),G(x,!0,a).done(function(a){if($(c).addClass("wpd_not_clicked"),"object"==typeof a){if(a.success){if("total"===a.data.buttonsStyle){var d=$(".wpd-comment-footer .wpd-vote-result",$("#comment-"+e)),h=a.data.votes;d.text(a.data.votesHumanReadable),d.attr("title",h),d.removeClass("wpd-up wpd-down"),h>0&&d.addClass("wpd-up"),h<0&&d.addClass("wpd-down")}else{var f=$(".wpd-comment-footer .wpd-vote-result-like",$("#comment-"+e)),g=$(".wpd-comment-footer .wpd-vote-result-dislike",$("#comment-"+e));f.text(a.data.likeCountHumanReadable),f.attr("title",a.data.likeCount),g.text(a.data.dislikeCountHumanReadable),g.attr("title",a.data.dislikeCount),parseInt(a.data.likeCount)>0?f.addClass("wpd-up"):f.removeClass("wpd-up"),0>parseInt(a.data.dislikeCount)?g.addClass("wpd-down"):g.removeClass("wpd-down")}var i=$(".wpd-comment-footer .wpd-vote-up",$("#comment-"+e)),j=$(".wpd-comment-footer .wpd-vote-down",$("#comment-"+e));i.removeClass("wpd-up"),j.removeClass("wpd-down"),a.data.curUserReaction>0?i.addClass("wpd-up"):a.data.curUserReaction<0&&j.addClass("wpd-down")}else a.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,c),"error");aE(a,e,b)}else console.log(a);$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,d,a){console.log(a),$(c).addClass("wpd_not_clicked"),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$(document).on("click","body",function(b){var a=$(".wpdiscuz-sort-buttons");$(b.target).hasClass("wpdf-sorting")||$(b.target).parent().hasClass("wpdf-sorting")?a.css({display:a.is(":visible")?"none":"flex"}):a.hide()}),$("body").on("click",".wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)",function(){var c=$(this),b=$(this).attr("data-sorting");if(b){$(".wpdiscuz-sort-button.wpdiscuz-sort-button-active").removeClass("wpdiscuz-sort-button-active").appendTo(".wpdiscuz-sort-buttons"),c.addClass("wpdiscuz-sort-button-active").prependTo(".wpdf-sorting");var a=new FormData;a.append("action","wpdSorting"),a.append("sorting",b);var d=$(".wpdf-active").attr("data-filter-type");a.append("wpdType",d||""),G(x,!0,a).done(function(a){"object"==typeof a&&a.success&&($("#wpdcom .wpd-comment").remove(),$("#wpdcom .wpd-thread-list").prepend(a.data.message),C(a,!1),z=1),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}}),window.onhashchange=function(){D(!1)},1!=f&&D(!1),$("body").on("click",".wpdiscuz-readmore",function(){var b=aj($(this)),c=ak(b),a=new FormData;a.append("action","wpdReadMore"),a.append("commentId",c),G(x,!0,a).done(function(a){"object"==typeof a?(a.success?($("#comment-"+c+" .wpd-comment-text").replaceWith(" "+a.data.message),$("#wpdiscuz-readmore-"+b).remove()):console.log(a.data),aE(a)):console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("change",".wpd-required-group",function(){0!==$("input:checked",this).length?$("input",$(this)).prop("required",!1):$("input",$(this)).prop("required",!0)}),$("body").on("click",".wpdiscuz-spoiler",function(){$(this).next().slideToggle(),$(this).hasClass("wpdiscuz-spoiler-closed")?$(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-plus").removeClass("fa-plus").addClass("fa-minus"):$(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-minus").removeClass("fa-minus").addClass("fa-plus"),$(this).toggleClass("wpdiscuz-spoiler-closed")}),$("body").on("click",".wpd-tools i",function(){var a=$(this).siblings(".wpd-tools-actions");a.is(":visible")||$(this).parents(".wpd-comment-right").attr("id")!==$("[id^=comment-]","#wpdcom").last().attr("id")||$("#comments").css({paddingBottom:"160px"}),a.css({display:a.is(":visible")?"none":"flex"})}),$("body").on("mouseleave",".wpd-comment-right",function(){$(this).find(".wpd-tools-actions").hide(),$("#comments").css({paddingBottom:"0"})}),$("body").on("click",".wpd_stick_btn",function(){var b=aj($(this),0),c=ak(b),a=new FormData;a.append("action","wpdStickComment"),a.append("commentId",c),G(x,!0,a).done(function(a){"object"==typeof a&&a.success&&location.reload(!0),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("click",".wpd_close_btn",function(){var b=aj($(this),0),c=ak(b),a=new FormData;a.append("action","wpdCloseThread"),a.append("commentId",c),G(x,!0,a).done(function(a){"object"==typeof a&&a.success&&location.reload(!0),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("click",".wpd-filter.wpd_not_clicked[data-filter-type]",function(){var b=$(this),c=b.attr("data-filter-type");wpdiscuzAjaxObj.resetActiveFilters(".wpdf-"+c),b.removeClass("wpd_not_clicked"),$(".fas",b).addClass("fa-pulse fa-spinner");var a=new FormData;a.append("action","wpdLoadMoreComments");var d=$(".wpdiscuz-sort-button-active").attr("data-sorting");d&&a.append("sorting",d),a.append("lastParentId",0),a.append("offset",0),z=1,a.append("wpdType",b.hasClass("wpdf-active")?"":c),a.append("isFirstLoad",1),$(this).hasClass("wpdf-inline")?$(this).hasClass("wpdf-active")?$(".wpd-comment-info-bar").hide():$(".wpd-comment-info-bar").css("display","flex"):$(".wpd-comment-info-bar").hide(),G(x,!1,a).done(function(a){b.addClass("wpd_not_clicked"),$(".fas",b).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(b.toggleClass("wpdf-active"),$(".wpd-load-comments").remove(),$(".wpd-comment").remove(),$(".wpd-thread-list").prepend(a.data.comment_list),C(a),w=a.data.loadLastCommentId,$(".wpd-load-more-submit").blur(),aE(a)),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("click",".wpdf-reacted.wpd_not_clicked",function(){var a=$(this);a.removeClass("wpd_not_clicked"),$(".fas",a).addClass("fa-pulse fa-spinner");var b=new FormData;b.append("action","wpdMostReactedComment"),G(x,!1,b).done(function(b){a.addClass("wpd_not_clicked"),$(".fas",a).removeClass("fa-pulse fa-spinner"),"object"==typeof b&&b.success&&($("#comment-"+b.data.parentCommentID).length?$("#comment-"+b.data.parentCommentID).parents("[id^=wpd-comm-"+b.data.parentCommentID+"]").replaceWith(b.data.message):$("#comment-"+b.data.commentId).length||$(".wpd-thread-list").prepend(b.data.message),aE(b),au(),$("html, body").animate({scrollTop:$("#comment-"+b.data.commentId).offset().top-m},1e3,av))}).fail(function(c,d,b){console.log(b),$(".fas",a).removeClass("fa-pulse fa-spinner")})}),$("body").on("click",".wpdf-hottest.wpd_not_clicked",function(){var a=$(this);a.removeClass("wpd_not_clicked"),$(".fas",a).addClass("fa-pulse fa-spinner");var b=new FormData;b.append("action","wpdHottestThread"),G(x,!1,b).done(function(b){a.addClass("wpd_not_clicked"),$(".fas",a).removeClass("fa-pulse fa-spinner"),"object"==typeof b&&b.success&&($("#comment-"+b.data.commentId).length?$("#comment-"+b.data.commentId).parents("[id^=wpd-comm-"+b.data.commentId+"]").replaceWith(b.data.message):$(".wpd-thread-list").prepend(b.data.message),aE(b),au(),$("html, body").animate({scrollTop:$("#comment-"+b.data.commentId).offset().top-m},1e3,av))}).fail(function(c,d,b){console.log(b),$(".fas",a).removeClass("fa-pulse fa-spinner")})}),$("body").on("click",".wpd-filter-view-all",function(){$(".wpdf-inline.wpdf-active.wpd_not_clicked").trigger("click")}),$("body").on("click",".wpd-follow-link.wpd_not_clicked",function(){var a=$(this);a.removeClass("wpd_not_clicked"),$(".fas",a).addClass("fa-pulse fa-spinner");var c=aj(a,0),d=ak(c),b=new FormData;b.append("action","wpdFollowUser"),b.append("commentId",d),G(x,!0,b).done(function(b){a.addClass("wpd_not_clicked"),"object"==typeof b?b.success?(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[b.data.code],b.data.code,a),"success"),a.removeClass("wpd-follow-active"),b.data.followTip&&a.attr("wpd-tooltip",b.data.followTip),b.data.followClass&&a.addClass(b.data.followClass),aE(b)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[b.data],b.data,a),"error"):console.log(b),$(".fas",a).removeClass("fa-pulse fa-spinner"),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(c,d,b){console.log(b),$(".fas",a).removeClass("fa-pulse fa-spinner"),$("#wpdiscuz-loading-bar").fadeOut(250)})}),E(),$("body").on("keyup",".wc_email",function(){E($(this))}),j&&$("#wpdcom").length){if($("#wpd-bubble-wrapper").hover(function(){$(this).addClass("wpd-bubble-hover")},function(){$(this).removeClass("wpd-bubble-hover")}),k&&!Cookies.get(wpdiscuzAjaxObj.cookieHideBubbleHint)&&setTimeout(function(){$("#wpd-bubble-wrapper").addClass("wpd-bubble-hover"),Cookies.set(wpdiscuzAjaxObj.cookieHideBubbleHint,"1",{expires:7,path:"/"}),setTimeout(function(){$("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")},1e3*Q)},1e3*k),"content_left"===h){if($(".entry-content").length){var b=Math.min($(".entry-content").offset().left,$("#wpdcom").offset().left)-120,d=b>25?b:25;$("#wpd-bubble-wrapper").css({left:d+"px"}),$("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if($(".post-entry").length){var b=Math.min($(".post-entry").offset().left,$("#wpdcom").offset().left)-120,d=b>25?b:25;$("#wpd-bubble-wrapper").css({left:d+"px"}),$("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if($(".container").length){var b=Math.min($(".container").offset().left,$("#wpdcom").offset().left)-120,d=b>25?b:25;$("#wpd-bubble-wrapper").css({left:d+"px"}),$("#wpd-bubble-wrapper").addClass("wpd-left-content")}else $("#wpd-bubble-wrapper").css({left:"25px"}),$("#wpd-bubble-wrapper").addClass("wpd-left-corner")}else"left_corner"===h?($("#wpd-bubble-wrapper").css({left:"25px"}),$("#wpd-bubble-wrapper").addClass("wpd-left-corner")):"right_corner"===h&&($("#wpd-bubble-wrapper").css({right:"25px"}),$("#wpd-bubble-wrapper").addClass("wpd-right-corner"));$("#wpd-bubble-wrapper").show(),$("body").on("click","#wpd-bubble-add-message-close",function(a){a.preventDefault(),a.stopPropagation(),$("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")}),$("body").on("click","#wpd-bubble",function(){au(),$("#tab-title-reviews").length&&$("#tab-title-reviews a").trigger("click"),$("html, body").animate({scrollTop:$("#wpdcom").offset().top-(m+28)},1e3,function(){av(),$("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover"),wpdiscuzLoadRichEditor?$("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0").focus():$("#wc-textarea-0_0").length&&$("#wc-textarea-0_0").trigger("focus")})}),$("body").on("click","#wpd-bubble-comment-close",function(a){a.preventDefault(),$("#wpd-bubble-notification-message").hide(),$("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")}),$("body").on("click","#wpd-bubble-comment-reply-link a",function(){var a=$(this).attr("href");setTimeout(function(){$("#wpd-bubble-notification-message").hide(),$("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),D(!0);var b=a.match(/#comment\-(\d+)/);U=U.filter(function(a){return a!=b[1]}),$("#wpd-bubble-count .wpd-new-comments-count").text(U.length),0==U.length&&$("#wpd-bubble-count").removeClass("wpd-new-comments")},100)}),$("body").on("click","#wpd-bubble-count",function(){if(U.length){var a=new FormData;a.append("action","wpdBubbleUpdate"),a.append("newCommentIds",U.join()),G(x,!0,a).done(function(a){"object"==typeof a&&a.success&&(a.data.message=a.data.message.filter(function(a){if(!$("#comment-"+a.comment_id).length)return a}),ag(a),$("#wpd-bubble-count").removeClass("wpd-new-comments"),$("#wpd-bubble-count .wpd-new-comments-count").text("0"),U=[],$(".wpd-new-loaded-comment").length&&(au(),$("html, body").animate({scrollTop:$($(".wpd-new-loaded-comment")[0]).offset().top-(m+28)},1e3,av)),aE(a)),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a)})}})}function F(){$.ajax({type:"GET",url:wpdiscuzAjaxObj.bubbleUpdateUrl,beforeSend:function(a){a.setRequestHeader("X-WP-Nonce",wpdiscuzAjaxObj.restNonce)},data:{postId:I,lastId:J,visibleCommentIds:aq()}}).done(function(a){if(!V){if("object"==typeof a){if(a.commentIDsToRemove.forEach(function(a){$("[id^=wpd-comm-"+a+"]").remove()}),a.ids.length){if(t){var b;(b=new FormData).append("action","wpdUpdateAutomatically"),b.append("loadLastCommentId",w),b.append("visibleCommentIds",aq()),G(x,!1,b).done(function(a){!V&&"object"==typeof a&&a.success&&(ag(a),a.data.wc_all_comments_count_new=parseInt(a.data.wc_all_comments_count_new),$(".wpd-thread-info").html(a.data.wc_all_comments_count_before_threads_html),$(".wpd-thread-info").attr("data-comments-count",a.data.wc_all_comments_count_new),$("#wpd-bubble-all-comments-count").replaceWith(a.data.wc_all_comments_count_bubble_html),w=a.data.loadLastCommentId)}).fail(function(b,c,a){console.log(a)})}a.ids=a.ids.filter(function(a){if(!$("#comment-"+a).length)return a});var c=5e3;J=parseInt(a.ids[a.ids.length-1]),U=U.concat(a.ids),R&&a.commentText&&($("#wpd-bubble-author-avatar").html(a.avatar),$("#wpd-bubble-author-name").html(a.authorName),$("#wpd-bubble-comment-date span").html(a.commentDate),$("#wpd-bubble-comment-text").html(a.commentText),$("#wpd-bubble-comment-reply-link a").attr("href",a.commentLink),$("#wpd-bubble-notification-message").show(),c=1e4);var d=parseInt($(".wpd-new-comments-count").text());d+=a.ids.length,$("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),$("#wpd-bubble-wrapper").addClass("wpd-new-comment-added"),setTimeout(function(){$("#wpd-bubble-notification-message").hide(),$("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")},c),$(".wpd-new-comments-count").text(d),$("#wpd-bubble-count").addClass("wpd-new-comments")}a.all_comments_count=parseInt(a.all_comments_count),$("#wpd-bubble-all-comments-count").replaceWith(a.all_comments_count_bubble_html),$(".wpd-reviews-tab").length||($(".wpd-thread-info").html(a.all_comments_count_before_threads_html),$(".wpd-thread-info").attr("data-comments-count",a.all_comments_count))}else console.log(a)}setTimeout(F,u)}).fail(function(b,c,a){console.log(a),setTimeout(F,u)})}if((j&&y||t)&&(c|| !c&&v)&&setTimeout(F,u),$(".wpd-inline-form-wrapper").length){var n=new FormData;n.append("action","wpdGetInlineCommentForm"),G(x,!1,n).done(function(a){"object"==typeof a?a.success?($(".wpd-inline-form-wrapper").append(a.data),$.each($("[name=_wpd_inline_nonce]"),function(){var b=$(this).attr("id"),a=$(this).parents(".wpd-inline-shortcode").attr("id");$(this).attr("id",b+"-"+a.substring(a.lastIndexOf("-")+1))}),$(".wpd-inline-opened").addClass("wpd-active"),$(".wpd-inline-opened").find(".wpd-inline-form-wrapper").show(),$(".wpd-inline-opened").find(".wpd-inline-icon").addClass("wpd-open"),$(".wpd-inline-opened").find(".wpd-inline-icon").removeClass("wpd-ignored"),aC()):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data]),a.data,"error"):console.log(a)}).fail(function(b,c,a){console.log(a)})}function aA(a){if($(a).hasClass("wpd-inline-shortcode"))var b=$(a).attr("id");else var b=$(a).parents(".wpd-inline-shortcode").attr("id");return b.substring(b.lastIndexOf("-")+1)}function aB(){$(".wpd-inline-form-wrapper").hide(),$(".wpd-inline-shortcode").removeClass("wpd-active"),$(".wpd-inline-icon").removeClass("wpd-open")}function o(){$.each($(".wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon"),function(){var a=$(this),b=a.offset().top-window.pageYOffset;a.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&b>0&&b<300&&("blink"===l?(a.addClass("wpd-blink"),setTimeout(function(){a.removeClass("wpd-blink")},3e3)):(a.parents(".wpd-inline-shortcode").addClass("wpd-active"),a.siblings(".wpd-inline-form-wrapper").show(),a.addClass("wpd-open"),aC(a.siblings(".wpd-inline-form-wrapper"))))})}function aC(a){if(a){if(a.offset().left<=10){a.css("left",Math.ceil(parseInt(a.css("left"))-a.offset().left+10));var b=Math.ceil(a.siblings(".wpd-inline-icon.wpd-open").offset().left-a.offset().left+2);b<3&&(b=3),document.styleSheets[0].addRule("#"+a.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+b+"px;")}else if(a.offset().left+a.width()>document.body.clientWidth-10){a.css("left",Math.ceil(parseInt(a.css("left"))+(document.body.clientWidth-(a.offset().left+a.width()))-10));var b=Math.ceil(a.siblings(".wpd-inline-icon.wpd-open").offset().left-a.offset().left+2);b>a.width()-3&&(b=a.width()-3),document.styleSheets[0].addRule("#"+a.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+b+"px;")}}else $.each($(".wpd-inline-form-wrapper:visible"),function(){if($(this).offset().left<=10){$(this).css("left",Math.ceil(parseInt($(this).css("left"))-$(this).offset().left+10));var a=Math.ceil($(this).siblings(".wpd-inline-icon.wpd-open").offset().left-$(this).offset().left+2);a<3&&(a=3),document.styleSheets[0].addRule("#"+$(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"px;")}else if($(this).offset().left+$(this).width()>document.body.clientWidth-10){$(this).css("left",Math.ceil(parseInt($(this).css("left"))+(document.body.clientWidth-($(this).offset().left+$(this).width()))-10));var a=Math.ceil($(this).siblings(".wpd-inline-icon.wpd-open").offset().left-$(this).offset().left+2);a>$(this).width()-3&&(a=$(this).width()-3),document.styleSheets[0].addRule("#"+$(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"px;")}})}function aD(a){var b,c=0;if(a.parents(".wpd_main_comm_form").length)c=parseInt(wpdiscuzAjaxObj.commentTextMaxLength),b=a.parents(".wpd_main_comm_form");else if(a.parents(".wpd-secondary-form-wrapper").length)c=parseInt(wpdiscuzAjaxObj.replyTextMaxLength),b=a.parents(".wpd-secondary-form-wrapper");else if(a.parents("#wpdiscuz-edit-form").length){var e=aj(a);c=parseInt(e.substring(e.lastIndexOf("_")+1))?parseInt(wpdiscuzAjaxObj.replyTextMaxLength):parseInt(wpdiscuzAjaxObj.commentTextMaxLength),b=a.parents("#wpdiscuz-edit-form")}if(c&&b){var g=a.val().length,d=$(".wpd-editor-char-counter",b),f=c-g;d.html(f),f<=10?d.addClass("error"):d.removeClass("error")}}function aE(a,b,c,d){a.data.callbackFunctions&&$.each(a.data.callbackFunctions,function(e){"function"==typeof wpdiscuzAjaxObj[a.data.callbackFunctions[e]]?wpdiscuzAjaxObj[a.data.callbackFunctions[e]](a,b,c,d):"function"==typeof window[a.data.callbackFunctions[e]]?window[a.data.callbackFunctions[e]](a,b,c,d):console.log(a.data.callbackFunctions[e]+" is not a function")})}function G(c,d,a){d&&$("#wpdiscuz-loading-bar").show(),a.append("postId",I),a.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce);var b=a.get("action");wpdiscuzAjaxObj.dataFilterCallbacks&&wpdiscuzAjaxObj.dataFilterCallbacks[b]&&$.each(wpdiscuzAjaxObj.dataFilterCallbacks[b],function(e){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[b][e]]&&(a=wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[b][e]](a,c,d))});var e=c?wpdiscuzAjaxObj.url:wpdiscuzAjaxObj.customAjaxUrl;return $.ajax({type:"POST",url:e,data:a,contentType:!1,processData:!1})}function p(){if(c||wpdiscuzAjaxObj.validateNonceForGuests){var a=new FormData;a.append("action","wpdGetNonce"),G(x,!1,a).done(function(a){"object"==typeof a?a.success?wpdiscuzAjaxObj.wpdiscuz_nonce=a.data:wpdiscuzAjaxObj.setCommentMessage(a.data,"error"):console.log(a)}).fail(function(b,c,a){console.log(a)})}}$(document).on("click","body",function(a){if($(a.target).hasClass("wpd-inline-form-close")||$(a.target).parents(".wpd-inline-form-close").length)a.preventDefault(),$(a.target).parents(".wpd-inline-form-wrapper").hide(),$(a.target).parents(".wpd-inline-shortcode").removeClass("wpd-active"),$(a.target).parents(".wpd-inline-form-wrapper").siblings(".wpd-inline-icon").removeClass("wpd-open");else if(!$(a.target).hasClass("wpd-inline-form-wrapper")&&!$(a.target).parents(".wpd-inline-form-wrapper").length){aB();var b="";$(a.target).hasClass("wpd-inline-icon")?b=$(a.target):$(a.target).parents(".wpd-inline-icon").length&&(b=$(a.target).parents(".wpd-inline-icon")),b.length&&b.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&(b.parents(".wpd-inline-shortcode").addClass("wpd-active"),b.siblings(".wpd-inline-form-wrapper").show(),b.addClass("wpd-open"),b.removeClass("wpd-ignored"),aC(b.siblings(".wpd-inline-form-wrapper")))}(!$(a.target).hasClass("wpd-last-inline-comments-wrapper")&&!$(a.target).parents(".wpd-last-inline-comments-wrapper").length||$(a.target).parents(".wpd-last-inline-comments-wrapper").length&&$(a.target).hasClass("wpd-load-inline-comment"))&&$(".wpd-last-inline-comments-wrapper").remove()}),$("body").on("click",".wpd-inline-submit.wpd_not_clicked",function(c){c.preventDefault();var d=$(this),a=$(this).parents(".wpd_inline_comm_form");if(a[0].checkValidity()){$(this).removeClass("wpd_not_clicked");var b=new FormData;b.append("action","wpdAddInlineComment"),b.append("inline_form_id",aA(a)),$.each($("input, textarea",a),function(c,a){"checkbox"===this.type?$(this).is(":checked")&&b.append($(a).attr("name"),$(a).val()):b.append($(a).attr("name"),$(a).val())}),G(x,!0,b).done(function(b){if(d.addClass("wpd_not_clicked"),"object"==typeof b){if(b.success){a[0].reset(),aB();var e=parseInt(b.data.newCount),c=d.parents(".wpd-inline-icon-wrapper").find(".wpd-inline-icon-count");c.text(e),e?c.addClass("wpd-has-comments"):c.removeClass("wpd-has-comments"),b.data.allCommentsCountNew=parseInt(b.data.allCommentsCountNew),$(".wpd-thread-info").html(b.data.allCommentsCountBeforeThreadsHtml),$(".wpd-thread-info").attr("data-comments-count",b.data.allCommentsCountNew),$("#wpd-bubble-all-comments-count").replaceWith(b.data.allCommentsCountBubbleHtml),b.data.message&&az(b.data.message),wpdiscuzAjaxObj.setCommentMessage(b.data.notification,"success")}else b.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[b.data],b.data,d),"error")}else wpdiscuzAjaxObj.setCommentMessage(b,"error");$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}}),$("body").on("keydown",".wpd-form",function(a){a.ctrlKey&&13==a.keyCode&&$(this).find(".wc_comm_submit").trigger("click")}),$("body").on("keydown","#wpdiscuz-edit-form",function(a){a.ctrlKey&&13==a.keyCode&&$(this).find(".wc_save_edited_comment").trigger("click")}),$("body").on("keydown",".wpd-inline-comment-content",function(a){a.ctrlKey&&13==a.keyCode&&$(this).parents(".wpd_inline_comm_form").find(".wpd-inline-submit.wpd_not_clicked").trigger("click")}),$("body").on("click",".wpd-inline-icon-count.wpd-has-comments",function(){var b=$(this),a=new FormData;a.append("action","wpdGetLastInlineComments"),a.append("inline_form_id",aA(b)),G(x,!0,a).done(function(a){"object"==typeof a?a.success?$(a.data).insertAfter(b):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,b),"error"):console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),$("body").on("click",".wpd-view-all-inline-comments",function(a){a.preventDefault(),$(this).parents(".wpd-last-inline-comments-wrapper").remove(),$(".wpdf-inline").hasClass("wpdf-active")||$(".wpdf-inline").trigger("click"),au(),$("html, body").animate({scrollTop:$(".wpdf-inline").offset().top-m},1e3,av)}),$("body").on("click",".wpd-feedback-content-link",function(a){a.preventDefault();var b=$(this).data("feedback-content-id");au(),$("html, body").animate({scrollTop:$("#wpd-inline-"+b).offset().top-(m+6)},1e3,function(){av(),$("#wpd-inline-"+b).addClass("wpd-active")})}),("scroll_open"===l||"blink"===l)&&(o(),$(window).on("scroll",o)),$("body").on("click","#wpd-post-rating.wpd-not-rated .wpd-rate-starts svg",function(){var a=new FormData,b=$(this).index();b>=0&&b<5&&(a.append("action","wpdUserRate"),a.append("rating",b+1),G(x,!0,a).done(function(a){"object"==typeof a?(a.success?location.reload(!0):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data),"error"),aE(a)):console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)}))}),$("body").on("submit","#wpdiscuz-subscribe-form",function(d){d.preventDefault();var a=$(this);let b=$("#wpdiscuz_subscription_button",a);if(a[0].checkValidity()&&(f=a,g=!0,"2.0"===e&&$("input[name=wpdiscuz_recaptcha_subscribe_form]",f).length&&!$("input[name=wpdiscuz_recaptcha_subscribe_form]",f).val().length?(g=!1,$(".wpdiscuz-recaptcha",f).css("border","1px solid red")):"2.0"===e&&$("input[name=wpdiscuz_recaptcha_subscribe_form]",f).length&&$(".wpdiscuz-recaptcha",f).css("border","none"),g)&&b.hasClass("wpd_not_clicked")){b.removeClass("wpd_not_clicked");var f,g,c=new FormData;c.append("action","wpdAddSubscription"),$("*",a).each(function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&c.append(this.name+"",$(this).val()),("checkbox"==this.type||"radio"==this.type)&&$(this).is(":checked")&&c.append(this.name+"",$(this).val())}),G(x,!0,c).done(function(a){"object"==typeof a?a.success?(wpdiscuzAjaxObj.setCommentMessage(a.data,"success"),setTimeout(function(){location.reload(!0)},3e3)):wpdiscuzAjaxObj.setCommentMessage(a.data,"error"):wpdiscuzAjaxObj.setCommentMessage(a,"error"),$("#wpdiscuz-loading-bar").fadeOut(250),V=!1,b.addClass("wpd_not_clicked")}).fail(function(c,d,a){console.log(a),b.addClass("wpd_not_clicked"),$("#wpdiscuz-loading-bar").fadeOut(250)})}}),$("body").on("click",".wpd-unsubscribe",function(b){b.preventDefault();var a=new FormData;a.append("action","wpdUnsubscribe"),a.append("sid",$(this).data("sid")),a.append("skey",$(this).data("skey")),G(x,!0,a).done(function(a){"object"==typeof a?a.success?(wpdiscuzAjaxObj.setCommentMessage(a.data,"success"),setTimeout(function(){location.reload(!0)},3e3)):wpdiscuzAjaxObj.setCommentMessage(a.data,"error"):console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250),V=!1}).fail(function(b,c,a){console.log(a),$("#wpdiscuz-loading-bar").fadeOut(250)})}),wpdiscuzAjaxObj.resetActiveFilters=function(a){$(".wpd-filter.wpdf-active"+(a?":not("+a+")":"")).removeClass("wpdf-active")},wpdiscuzAjaxObj.getAjaxObj=G,wpdiscuzAjaxObj.initNonce=p,p()});var onloadCallback=function(){if(document.getElementById("wpdiscuz-recaptcha-0_0")&&"2.0"===wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion&&(1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!wpdiscuzAjaxObj.is_user_logged_in||1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&wpdiscuzAjaxObj.is_user_logged_in))try{grecaptcha.render("wpdiscuz-recaptcha-0_0",{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(a){jQuery("#wpdiscuz-recaptcha-field-0_0").val("key")},"expired-callback":function(){jQuery("#wpdiscuz-recaptcha-field-0_0").val("")}})}catch(a){console.log(a),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+a.message,"error")}}
class.WpdiscuzCore.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  * Plugin Name: wpDiscuz
4
  * Description: #1 WordPress Comment Plugin. Innovative, modern and feature-rich comment system to supercharge your website comment section.
5
- * Version: 7.3.17
6
  * Author: gVectors Team
7
  * Author URI: https://gvectors.com/
8
  * Plugin URI: https://wpdiscuz.com/
@@ -39,6 +39,9 @@ class WpdiscuzCore implements WpDiscuzConstants {
39
  public $helperOptimization;
40
  public $helperUpload;
41
  public $wpdiscuzOptionsJs;
 
 
 
42
  public $options;
43
  public $commentsArgs;
44
  private $version;
@@ -764,6 +767,13 @@ class WpdiscuzCore implements WpDiscuzConstants {
764
  if ($commentCache = $this->cache->getCommentsCache($this->commentsArgs)) {
765
  $commentList = $commentCache["commentList"];
766
  $commentData = $commentCache["commentData"];
 
 
 
 
 
 
 
767
  if ($this->options->wp["isPaginate"]) {
768
  $commentListArgs["page"] = 0;
769
  $commentListArgs["per_page"] = 0;
@@ -1429,6 +1439,10 @@ class WpdiscuzCore implements WpDiscuzConstants {
1429
  $this->cache->deleteGravatarsFolder();
1430
  $this->dbManager->deleteGravatarsTable();
1431
  }
 
 
 
 
1432
  do_action("wpdiscuz_clean_all_caches", $pluginData["Version"], $this->version);
1433
  }
1434
  do_action("wpdiscuz_check_version");
@@ -1987,7 +2001,7 @@ class WpdiscuzCore implements WpDiscuzConstants {
1987
  echo "</div>";
1988
  echo "<div id='wpd-bubble-comment'>";
1989
  echo "<span id='wpd-bubble-comment-text'></span>";
1990
- echo "<span id='wpd-bubble-comment-reply-link'>| <a href='#'>Reply</a></span>";
1991
  echo "</div>";
1992
  echo "</div>";
1993
  }
2
  /*
3
  * Plugin Name: wpDiscuz
4
  * Description: #1 WordPress Comment Plugin. Innovative, modern and feature-rich comment system to supercharge your website comment section.
5
+ * Version: 7.3.18
6
  * Author: gVectors Team
7
  * Author URI: https://gvectors.com/
8
  * Plugin URI: https://wpdiscuz.com/
39
  public $helperOptimization;
40
  public $helperUpload;
41
  public $wpdiscuzOptionsJs;
42
+ /**
43
+ * @var WpdiscuzOptions
44
+ */
45
  public $options;
46
  public $commentsArgs;
47
  private $version;
767
  if ($commentCache = $this->cache->getCommentsCache($this->commentsArgs)) {
768
  $commentList = $commentCache["commentList"];
769
  $commentData = $commentCache["commentData"];
770
+ if ($commentList && $this->options->thread_layouts["highlightVotingButtons"]) {
771
+ if (!empty($commentListArgs["current_user"]->ID)) {
772
+ $commentListArgs["user_votes"] = $this->dbManager->getUserVotes($commentList, $commentListArgs['current_user']->ID);
773
+ } else {
774
+ $commentListArgs["user_votes"] = $this->dbManager->getUserVotes($commentList, md5($this->helper->getRealIPAddr()));
775
+ }
776
+ }
777
  if ($this->options->wp["isPaginate"]) {
778
  $commentListArgs["page"] = 0;
779
  $commentListArgs["per_page"] = 0;
1439
  $this->cache->deleteGravatarsFolder();
1440
  $this->dbManager->deleteGravatarsTable();
1441
  }
1442
+ // adding email templates as options
1443
+ if (version_compare($this->version, "7.3.17", "<=")) {
1444
+ $this->options->addEmailTemplates(true);
1445
+ }
1446
  do_action("wpdiscuz_clean_all_caches", $pluginData["Version"], $this->version);
1447
  }
1448
  do_action("wpdiscuz_check_version");
2001
  echo "</div>";
2002
  echo "<div id='wpd-bubble-comment'>";
2003
  echo "<span id='wpd-bubble-comment-text'></span>";
2004
+ echo "<span id='wpd-bubble-comment-reply-link'>| <a href='#'>".$this->options->getPhrase("wc_reply_text")."</a></span>";
2005
  echo "</div>";
2006
  echo "</div>";
2007
  }
forms/wpdFormAttr/Form.php CHANGED
@@ -37,9 +37,10 @@ class Form {
37
  }
38
 
39
  public function initFormMeta() {
40
- if ((int) $this->formID) {
41
  if (!$this->generalOptions) {
42
- $this->generalOptions = get_post_meta($this->formID, wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS, true);
 
43
  }
44
  if (!$this->formeStructure) {
45
  $this->formeStructure = get_post_meta($this->formID, wpdFormConst::WPDISCUZ_META_FORMS_STRUCTURE, true);
@@ -169,10 +170,10 @@ class Form {
169
 
170
  public function getEnableRateOnPost() {
171
  $this->initFormMeta();
172
- if (!isset($this->generalOptions["enable_post_rating"])) {
173
  $this->generalOptions["enable_post_rating"] = 1;
174
  }
175
- return $this->generalOptions["enable_post_rating"];
176
  }
177
 
178
  public function getPostRatingTitle() {
@@ -407,9 +408,9 @@ class Form {
407
  $class = wpDiscuz()->dbManager->isUserRated(0, md5(wpDiscuz()->helper->getRealIPAddr()), $post->ID) ? "" : " class='wpd-not-rated'";
408
  }
409
  }
410
- $rating = (float) get_post_meta($post->ID, wpdFormConst::POSTMETA_POST_RATING, true);
411
- $count = (int) get_post_meta($post->ID, wpdFormConst::POSTMETA_POST_RATING_COUNT, true);
412
- $prefix = (int) $rating;
413
  $suffix = $rating - $prefix;
414
  $fullStarSVG = apply_filters("wpdiscuz_full_star_svg", "<svg xmlns='https://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M0 0h24v24H0z' fill='none'/><path class='wpd-star' d='M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z'/><path d='M0 0h24v24H0z' fill='none'/></svg>", "post", "fas fa-star");
415
  $halfStarSVG = apply_filters("wpdiscuz_half_star_svg", "<svg xmlns='https://www.w3.org/2000/svg' xmlns:xlink='https://www.w3.org/1999/xlink' viewBox='0 0 24 24'><defs><path id='a' d='M0 0h24v24H0V0z'/></defs><clipPath id='b'><use xlink:href='#a' overflow='visible'/></clipPath><path class='wpd-star wpd-active' clip-path='url(#b)' d='M22 9.24l-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03L22 9.24zM12 15.4V6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z'/></svg>", "post", "fas fa-star");
@@ -420,7 +421,7 @@ class Form {
420
  <div class='wpd-rating-value'>
421
  <span class='wpdrv'>" . esc_html($rating) . "</span>
422
  <span class='wpdrc'>" . esc_html($count) . "</span>
423
- <span class='wpdrt'>" . ((int) $count === 1 ? esc_html($this->wpdOptions->getPhrase("wc_vote_phrase")) : esc_html($this->wpdOptions->getPhrase("wc_votes_phrase"))) . "</span>";
424
  $html .= "</div>
425
  <div class='wpd-rating-title'>" . esc_html($this->getPostRatingTitle()) . "</div>
426
  <div class='wpd-rating-stars'>";
@@ -462,7 +463,7 @@ class Form {
462
  "itemprop" => !!$this->wpdOptions->rating["enablePostRatingSchema"],
463
  "post_id" => null,
464
  "postid" => null,
465
- ], $atts);
466
  if (!$atts["postid"]) {
467
  if ($atts["post_id"]) {
468
  $post = get_post($atts["post_id"]);
@@ -539,13 +540,13 @@ class Form {
539
  <div class='wpd-rating-value'>
540
  <span class='wpdrv'>" . esc_html($ratingData["average"]) . "</span>
541
  <span class='wpdrc'>" . esc_html($ratingData["count"]) . "</span>
542
- <span class='wpdrt'>" . ((int) $ratingData["count"] === 1 ? esc_html($this->wpdOptions->getPhrase("wc_vote_phrase")) : esc_html($this->wpdOptions->getPhrase("wc_votes_phrase"))) . "</span>";
543
  $html .= "</div>";
544
  if ($args["show-label"]) {
545
  $html .= "<div class='wpd-rating-title'>" . esc_html($title) . "</div>";
546
  }
547
  $html .= "<div class='wpd-rating-stars'>";
548
- $prefix = (int) $ratingData['average'];
549
  $suffix = $ratingData['average'] - $prefix;
550
  if ($prefix) {
551
  for ($i = 1; $i < 6; $i++) {
@@ -654,7 +655,7 @@ class Form {
654
  } else if (!empty($layouts[0])) {
655
  $validData["layout"] = $layouts[0];
656
  }
657
- if (isset($options["enable_post_rating"])) {
658
  $validData["enable_post_rating"] = intval($options["enable_post_rating"]);
659
  }
660
  if (!empty($options["post_rating_title"])) {
@@ -758,8 +759,8 @@ class Form {
758
  if ($top || $bottom) {
759
  $htmlExists = true;
760
  }
761
- $top = ( $top ) ? "<div class='wpd-top-custom-fields'>" . $top . "</div>" : "";
762
- $bottom = ( $bottom ) ? "<div class='wpd-bottom-custom-fields'>" . $bottom . "</div>" : "";
763
  $output = $top . $output . $bottom;
764
  }
765
  return $htmlExists;
@@ -784,14 +785,16 @@ class Form {
784
  public function renderFrontForm($isMain, $uniqueId, $commentsCount, $currentUser) {
785
  $message = "";
786
  ?>
787
- <div class="wpd-form wpd-form-wrapper <?php echo!$isMain ? "wpd-secondary-form-wrapper" : "wpd-main-form-wrapper"; ?>" <?php echo!$isMain ? "id='wpd-secondary-form-wrapper-" . esc_attr($uniqueId) . "' style='display: none;'" : "id='wpd-main-form-wrapper-" . esc_attr($uniqueId) . "'"; ?>>
788
  <?php if (!$isMain) { ?>
789
- <div class="wpd-secondary-forms-social-content"><?php do_action("comment_reply_form_bar_top", $this); ?></div><div class="clearfix"></div>
 
790
  <?php } ?>
791
  <?php
792
  if ($this->isUserCanComment($currentUser, $message)) {
793
  ?>
794
- <form class="wpd_comm_form <?php echo $isMain ? "wpd_main_comm_form" : "wpd-secondary-form-wrapper"; ?>" method="post" enctype="multipart/form-data" data-uploading="false">
 
795
  <div class="wpd-field-comment">
796
  <div class="wpdiscuz-item wc-field-textarea">
797
  <div class="wpdiscuz-textarea-wrap <?php echo $this->wpdOptions->form["richEditor"] === "both" || (!wp_is_mobile() && $this->wpdOptions->form["richEditor"] === "desktop") ? "" : "wpd-txt"; ?>">
@@ -826,7 +829,8 @@ class Form {
826
  echo $this->wpdOptions->goodbyeCaptchaTocken;
827
  }
828
  ?>
829
- <input type="hidden" class="wpdiscuz_unique_id" value="<?php echo esc_attr($uniqueId); ?>" name="wpdiscuz_unique_id">
 
830
  </form>
831
  <?php
832
  }
@@ -840,9 +844,11 @@ class Form {
840
  if ($this->wpdOptions->form["richEditor"] === "both" || (!wp_is_mobile() && $this->wpdOptions->form["richEditor"] === "desktop")) {
841
  ?>
842
  <div id="wpd-editor-wraper-<?php echo esc_attr($uniqueId); ?>" style="display: none;">
843
- <div id="wpd-editor-char-counter-<?php echo esc_attr($uniqueId); ?>" class="wpd-editor-char-counter"></div>
 
844
  <label style="display: none;" for="wc-textarea-<?php echo esc_attr($uniqueId); ?>">Label</label>
845
- <textarea id="wc-textarea-<?php echo esc_attr($uniqueId); ?>" required name="wc_comment" class="wc_comment wpd-field"></textarea>
 
846
  <div id="wpd-editor-<?php echo esc_attr($uniqueId); ?>"></div>
847
  <?php $this->renderTextEditorButtons($uniqueId); ?>
848
  </div>
@@ -864,9 +870,13 @@ class Form {
864
  $textareaMaxLength = $commentTextMaxLength ? "maxlength=$commentTextMaxLength" : '';
865
  ?>
866
  <div class="wpd-textarea-wrap">
867
- <div id="wpd-editor-char-counter-<?php echo esc_attr($uniqueId); ?>" class="wpd-editor-char-counter"></div>
 
868
  <label style="display: none;" for="wc-textarea-<?php echo esc_attr($uniqueId); ?>">Label</label>
869
- <textarea id="wc-textarea-<?php echo esc_attr($uniqueId); ?>" <?php echo $commentTextLengthRange . ' ' . $textareaMaxLength; ?> placeholder="<?php echo esc_attr($textarea_placeholder); ?>" aria-label="<?php echo esc_attr($textarea_placeholder); ?>" required name="wc_comment" class="wc_comment wpd-field"></textarea>
 
 
 
870
  </div>
871
  <div class="wpd-editor-buttons-right">
872
  <?php
@@ -921,7 +931,8 @@ class Form {
921
  $value = $editorButton["value"] ? "value='" . esc_attr($editorButton["value"]) . "'" : "";
922
  $dataName = $editorButton["name"] ? "data-wpde_button_name='" . esc_attr($editorButton["name"]) . "'" : "";
923
  ?>
924
- <button title="<?php esc_attr_e($editorButton["title"], "wpdiscuz"); ?>" class="<?php echo esc_attr($editorButton["class"]); ?>" <?php echo $value; ?> <?php echo $dataName; ?>><?php echo $editorButton["svg"]; ?></button>
 
925
  <?php
926
  }
927
  ?>
@@ -965,26 +976,27 @@ class Form {
965
  public function renderEditAdminCommentForm($comment) {
966
  if ($this->formCustomFields) {
967
  ?>
968
- <div class="stuffbox">
969
  <div class="inside">
970
  <fieldset>
971
  <legend class="edit-comment-author"><?php esc_html_e("Custom Fields", "wpdiscuz"); ?></legend>
972
  <table class="form-table editcomment">
973
  <tbody>
974
- <?php
975
- $allowedFieldsType = $this->row->allowedFieldsType();
976
- foreach ($this->formCustomFields as $key => $data) {
977
- $fieldType = $data["type"];
978
- if (in_array($fieldType, $allowedFieldsType, true)) {
979
- $field = call_user_func($fieldType . "::getInstance");
980
- $value = get_comment_meta($comment->comment_ID, $key, true);
981
- echo $field->editCommentHtml($key, $value, $data, $comment);
982
- }
983
  }
984
- ?>
 
985
  </tbody>
986
  </table>
987
- <input type="hidden" name="wpdiscuz_unique_id" value="<?php echo esc_attr($comment->comment_ID . "_" . $comment->comment_parent); ?>">
 
988
  </fieldset>
989
  </div>
990
  </div>
@@ -996,33 +1008,37 @@ class Form {
996
  $this->initFormMeta();
997
  $blogRoles = get_editable_roles();
998
  ?>
999
- <style>.wpd-form-table td{
1000
  position: relative;
1001
  }
1002
- .wpd-form-table td i.fa-question-circle{
 
1003
  font-size: 16px;
1004
  right: 15px;
1005
  top: 15px;
1006
  position: absolute;
1007
  }
1008
- .wpdiscuz-form-builder-help{
 
1009
  text-align: right;
1010
  padding: 5px;
1011
  font-size: 16px;
1012
  margin-top: -15px;
1013
  }</style>
1014
- <style>[dir=rtl] .wpd-form-table td{
1015
  position: relative;
1016
  padding-left: 25px;
1017
  }
1018
- [dir=rtl] .wpd-form-table td i.fa-question-circle{
 
1019
  font-size: 16px;
1020
- right:auto;
1021
  left: 0px;
1022
  top: 15px;
1023
  position: absolute;
1024
  }
1025
- [dir=rtl] .wpdiscuz-form-builder-help{
 
1026
  text-align: left;
1027
  padding: 5px;
1028
  font-size: 16px;
@@ -1030,267 +1046,385 @@ class Form {
1030
  }</style>
1031
  <div class="wpdiscuz-wrapper">
1032
  <div class="wpd-form-options" style="width:100%;">
1033
- <table class="wpd-form-table" width="100%" border="0" cellspacing="0" cellpadding="0" style="margin:10px 0px 20px 0px;">
 
1034
  <tbody>
1035
- <tr>
1036
- <th>
1037
- <?php esc_html_e("Language", "wpdiscuz"); ?>
1038
- </th>
1039
- <td>
1040
- <?php $lang = isset($this->generalOptions["lang"]) ? $this->generalOptions["lang"] : get_locale(); ?>
1041
- <input required="" type="text" name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[lang]" value="<?php echo htmlentities($lang, ENT_QUOTES); ?>" >
1042
- <a href="https://wpdiscuz.com/docs/wpdiscuz-7/getting-started/manage-comment-forms/comment-form-settings/#language" title="<?php esc_attr_e("Read the documentation", "wpdiscuz") ?>" target="_blank"><i class="far fa-question-circle"></i></a>
1043
- </td>
1044
- </tr>
1045
- <tr>
1046
- <th>
1047
- <?php esc_html_e("Disable commenting for roles", "wpdiscuz"); ?>
1048
- </th>
1049
- <td>
1050
- <?php
1051
- $rolesCannotComment = isset($this->generalOptions["roles_cannot_comment"]) ? $this->generalOptions["roles_cannot_comment"] : [];
1052
- foreach ($blogRoles as $role => $info) {
1053
- if ($role !== "administrator") {
1054
- ?>
1055
- <div style="float:<?php echo (is_rtl()) ? 'right' : 'left'; ?>; display:inline-block; padding:3px 5px 3px 7px; min-width:25%;">
1056
- <input type="checkbox" <?php checked(in_array($role, $rolesCannotComment)); ?> value="<?php echo esc_attr($role); ?>" name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[roles_cannot_comment][]" id="wpd-<?php echo esc_attr($role); ?>" style="margin:0px; vertical-align: middle;" />
1057
- <label for="wpd-<?php echo esc_attr($role); ?>" style="white-space:nowrap; font-size:13px;"><?php echo esc_html($info["name"]); ?></label>
1058
- </div>
1059
- <?php
1060
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1061
  }
1062
  ?>
1063
- <a href="https://wpdiscuz.com/docs/wpdiscuz-7/getting-started/manage-comment-forms/comment-form-settings/#disable_commenting_for_roles" title="<?php esc_attr_e("Read the documentation", "wpdiscuz") ?>" target="_blank"><i class="far fa-question-circle"></i></a>
1064
- </td>
1065
- </tr>
1066
- <tr>
1067
- <th>
1068
- <?php esc_html_e("Allow guests to comment", "wpdiscuz"); ?>
1069
- </th>
1070
- <td>
1071
- <?php $guestCanComment = isset($this->generalOptions["guest_can_comment"]) ? $this->generalOptions["guest_can_comment"] : 1; ?>
1072
- <input <?php checked($guestCanComment, 1, true); ?> type="radio" name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[guest_can_comment]" value="1" id="wpd_cf_guest_yes" > <label for="wpd_cf_guest_yes"><?php esc_html_e("Yes", "wpdiscuz"); ?></label>
1073
- &nbsp;
1074
- <input <?php checked($guestCanComment, 0, true); ?> type="radio" name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[guest_can_comment]" value="0" id="wpd_cf_guest_no"> <label for="wpd_cf_guest_no"><?php esc_html_e("No", "wpdiscuz"); ?></label>
1075
- <a href="https://wpdiscuz.com/docs/wpdiscuz-7/getting-started/manage-comment-forms/comment-form-settings/#only-loggedin" title="<?php esc_attr_e("Read the documentation", "wpdiscuz") ?>" target="_blank"><i class="far fa-question-circle"></i></a>
1076
- </td>
1077
- </tr>
1078
- <tr>
1079
- <th style="max-width: 350px;">
1080
- <?php esc_html_e("Hide comment section for roles", "wpdiscuz"); ?>
1081
- <p class="wpd-info"><?php esc_html_e("This option hides the entire section of comments. Neither the comment form nor the comment list will be visible for selected user roles.", "wpdiscuz"); ?></p>
1082
- </th>
1083
- <td>
1084
- <?php
1085
- $rolesCannotSeeComments = isset($this->generalOptions["roles_cannot_see_comments"]) ? $this->generalOptions["roles_cannot_see_comments"] : [];
1086
- foreach ($blogRoles as $role => $info) {
1087
- if ($role !== "administrator") {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1088
  ?>
1089
- <div style="float:<?php echo (is_rtl()) ? 'right' : 'left'; ?>; display:inline-block; padding:3px 5px 3px 7px; min-width:25%;">
1090
- <input type="checkbox" <?php checked(in_array($role, $rolesCannotSeeComments)); ?> value="<?php echo esc_attr($role); ?>" name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[roles_cannot_see_comments][]" id="wpd-cannot-see-comments-<?php echo esc_attr($role); ?>" style="margin:0px; vertical-align: middle;" />
1091
- <label for="wpd-cannot-see-comments-<?php echo esc_attr($role); ?>" style="white-space:nowrap; font-size:13px;"><?php echo esc_html($info["name"]); ?></label>
1092
- </div>
 
 
1093
  <?php
1094
  }
1095
- }
1096
- ?>
1097
- </td>
1098
- </tr>
1099
- <tr>
1100
- <th style="max-width: 350px;">
1101
- <?php esc_html_e("Allow guests to view comments", "wpdiscuz"); ?>
1102
- <p class="wpd-info"><?php esc_html_e("If you disable this option, it'll hide the entire section of comments. Neither the comment form nor the comment list will be visible for guests.", "wpdiscuz"); ?></p>
1103
- </th>
1104
- <td>
1105
- <?php $guestCanComment = isset($this->generalOptions["guest_can_see_comments"]) ? $this->generalOptions["guest_can_see_comments"] : 1; ?>
1106
- <input <?php checked($guestCanComment, 1, true); ?> type="radio" name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[guest_can_see_comments]" value="1" id="wpd_csc_guest_yes" > <label for="wpd_csc_guest_yes"><?php esc_html_e("Yes", "wpdiscuz"); ?></label>
1107
- &nbsp;
1108
- <input <?php checked($guestCanComment, 0, true); ?> type="radio" name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[guest_can_see_comments]" value="0" id="wpd_csc_guest_no"> <label for="wpd_csc_guest_no"><?php esc_html_e("No", "wpdiscuz"); ?></label>
1109
- </td>
1110
- </tr>
1111
- <tr>
1112
- <th>
1113
- <?php esc_html_e("Enable subscription bar", "wpdiscuz"); ?>
1114
- </th>
1115
- <td>
1116
- <?php $showSubscriptionBar = isset($this->generalOptions["show_subscription_bar"]) ? $this->generalOptions["show_subscription_bar"] : 1; ?>
1117
- <input <?php checked($showSubscriptionBar, 1, true); ?> type="radio" name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[show_subscription_bar]" value="1" id="wpd_cf_sbbar_yes" > <label for="wpd_cf_sbbar_yes"><?php esc_html_e("Yes", "wpdiscuz"); ?></label>
1118
- &nbsp;
1119
- <input <?php checked($showSubscriptionBar, 0, true); ?> type="radio" name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[show_subscription_bar]" value="0" id="wpd_cf_sbbar_no"> <label for="wpd_cf_sbbar_no"><?php esc_html_e("No", "wpdiscuz"); ?></label>
1120
- <a href="https://wpdiscuz.com/docs/wpdiscuz-7/getting-started/manage-comment-forms/comment-form-settings/#subscription-bar" title="<?php esc_attr_e("Read the documentation", "wpdiscuz") ?>" target="_blank"><i class="far fa-question-circle"></i></a>
1121
- </td>
1122
- </tr>
1123
- <tr>
1124
- <th>
1125
- <?php esc_html_e("Display agreement checkbox in comment Subscription Bar", "wpdiscuz"); ?>
1126
- </th>
1127
- <td>
1128
- <?php $showSubscriptionAgreement = isset($this->generalOptions["show_subscription_agreement"]) ? $this->generalOptions["show_subscription_agreement"] : 0; ?>
1129
- <input <?php checked($showSubscriptionAgreement, 1, true); ?> type="radio" name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[show_subscription_agreement]" value="1" id="wpd_cf_sbbar_agreement_yes" > <label for="wpd_cf_sbbar_agreement_yes"><?php esc_html_e("Yes", "wpdiscuz"); ?></label>
1130
- &nbsp;
1131
- <input <?php checked($showSubscriptionAgreement, 0, true); ?> type="radio" name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[show_subscription_agreement]" value="0" id="wpd_cf_sbbar_agreement_no"> <label for="wpd_cf_sbbar_agreement_no"><?php esc_html_e("No", "wpdiscuz"); ?></label>
1132
- <a href="https://wpdiscuz.com/docs/wpdiscuz-7/getting-started/manage-comment-forms/comment-form-settings/#sb-checkbox" title="<?php esc_attr_e("Read the documentation", "wpdiscuz") ?>" target="_blank"><i class="far fa-question-circle"></i></a>
1133
- </td>
1134
- </tr>
1135
- <tr>
1136
- <th>
1137
- <?php esc_html_e("Comment Subscription Bar agreement checkbox label", "wpdiscuz"); ?>
1138
- </th>
1139
- <td>
1140
- <?php $subscriptionAgreementLabel = isset($this->generalOptions["subscription_agreement_label"]) && $this->generalOptions["subscription_agreement_label"] ? $this->generalOptions["subscription_agreement_label"] : esc_html__("I allow to use my email address and send notification about new comments and replies (you can unsubscribe at any time).", "wpdiscuz"); ?>
1141
- <textarea name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[subscription_agreement_label]" style="width:80%;"><?php echo $subscriptionAgreementLabel; ?></textarea>
1142
- </td>
1143
- </tr>
1144
- <tr>
1145
- <th>
1146
- <?php esc_html_e("Comment form header text (singular)", "wpdiscuz"); ?>
1147
- </th>
1148
- <td >
1149
- <div>
1150
- <input type="text" name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[header_text_single]" placeholder="<?php esc_attr_e("Comment", "wpdiscuz"); ?>" value="<?php echo isset($this->generalOptions["header_text_single"]) ? htmlentities($this->generalOptions["header_text_single"], ENT_QUOTES) : esc_html__("Comment", "wpdiscuz"); ?>" style="width:80%;">
1151
- </div>
1152
- <a href="https://wpdiscuz.com/docs/wpdiscuz-7/getting-started/manage-comment-forms/comment-form-settings/#comment_form_header_text" title="<?php esc_attr_e("Read the documentation", "wpdiscuz") ?>" target="_blank"><i class="far fa-question-circle"></i></a>
1153
- </td>
1154
- </tr>
1155
- <tr>
1156
- <th>
1157
- <?php esc_html_e("Comment form header text (plural)", "wpdiscuz"); ?>
1158
- </th>
1159
- <td >
1160
- <div>
1161
- <input type="text" name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[header_text_plural]" placeholder="<?php esc_attr_e("Comments", "wpdiscuz"); ?>" value="<?php echo isset($this->generalOptions["header_text_plural"]) ? htmlentities($this->generalOptions["header_text_plural"], ENT_QUOTES) : esc_html__("Comments", "wpdiscuz"); ?>" style="width:80%;">
1162
- </div>
1163
- <a href="https://wpdiscuz.com/docs/wpdiscuz-7/getting-started/manage-comment-forms/comment-form-settings/#comment_form_header_text" title="<?php esc_attr_e("Read the documentation", "wpdiscuz") ?>" target="_blank"><i class="far fa-question-circle"></i></a>
1164
- </td>
1165
- </tr>
1166
- <tr>
1167
- <th> <?php esc_html_e("Display comment form for post types", "wpdiscuz"); ?></th>
1168
- <td class="wpd-ct">
1169
- <?php
1170
- $this->formPostTypes = $this->formPostTypes ? $this->formPostTypes : [];
1171
- $registeredPostTypes = get_post_types(["public" => true]);
1172
- $formContentTypeRel = $this->wpdOptions->formContentTypeRel;
1173
- $hasForm = false;
1174
- $formRelExistsInfo = "<p class='wpd-info' style='padding-top:3px;'>" . esc_html__("The red marked post types are already attached to other comment form. If you set this form too, the old forms will not be used for them.", "wpdiscuz") . "</p>";
1175
- foreach ($registeredPostTypes as $typeKey => $typeValue) {
1176
- if (!post_type_supports($typeKey, "comments")) {
1177
- continue;
1178
- }
1179
- $checked = array_key_exists($typeKey, $this->formPostTypes) ? "checked" : "";
1180
- $formRelExistsClass = "";
1181
- if (!$checked && !empty($formContentTypeRel[$typeKey][$lang])) {
1182
- $formRelExistsClass = "wpd-form-rel-exixts";
1183
- $hasForm = true;
1184
- }
1185
  ?>
1186
- <label class="<?php echo esc_attr($formRelExistsClass); ?>" for="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_POSTE_TYPES . "-" . $typeKey); ?>">
1187
- <input value="<?php echo esc_attr($typeKey); ?>" id="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_POSTE_TYPES . "-" . $typeKey); ?>" type="checkbox" name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_POSTE_TYPES) . "][" . esc_attr($typeKey) . "]"; ?>" <?php echo $checked; ?>/>
1188
- <span><?php echo esc_html($typeValue); ?></span>
1189
- </label>
1190
- <?php } ?>
1191
- <?php if ($hasForm) echo $formRelExistsInfo; ?>
1192
- <a href="https://wpdiscuz.com/docs/wpdiscuz-7/getting-started/manage-comment-forms/comment-form-settings/#post-types" title="<?php esc_attr_e("Read the documentation", "wpdiscuz") ?>" target="_blank"><i class="far fa-question-circle"></i></a>
1193
- </td>
1194
- </tr>
1195
- <tr>
1196
- <th>
1197
- <?php esc_html_e("Display comment form for post IDs", "wpdiscuz"); ?>
1198
- <p class="wpd-info"> <?php esc_html_e("You can use this form for certain posts/pages specified by comma separated IDs.", "wpdiscuz"); ?></p>
1199
- </th>
1200
- <td>
1201
- <input type="text" name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[postid]" placeholder="5,26,30..." value="<?php echo isset($this->generalOptions["postid"]) ? htmlentities($this->generalOptions["postid"], ENT_QUOTES) : ""; ?>" style="width:80%;">
1202
- <a href="https://wpdiscuz.com/docs/wpdiscuz-7/getting-started/manage-comment-forms/comment-form-settings/#comment_form_for_post_id" title="<?php esc_attr_e("Read the documentation", "wpdiscuz") ?>" target="_blank"><i class="far fa-question-circle"></i></a>
1203
- </td>
1204
- </tr>
1205
- <?php
1206
- if ($themes = $this->getThemes()) {
1207
- $theme = !empty($this->generalOptions["theme"]) && isset($themes[$this->generalOptions["theme"]]) ? $this->generalOptions["theme"] : $this->getDefaultTheme();
1208
- if (count($themes) > 1) {
1209
- ?>
1210
- <tr>
1211
- <th>
1212
- <?php esc_html_e("Theme", "wpdiscuz"); ?>
1213
- </th>
1214
- <td>
1215
  <?php
1216
- foreach ($themes as $k => $val) {
 
1217
  ?>
1218
- <input <?php checked($theme, $k, true); ?> type="radio" name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[theme]" value="<?php echo esc_attr($k); ?>" id="wpd_cf_theme_<?php echo esc_attr($val["name"]); ?>" > <label for="wpd_cf_theme_<?php echo esc_attr($val["name"]); ?>"><?php echo esc_html($val["name"]); ?></label>
1219
- &nbsp;
 
 
 
 
 
 
 
 
 
 
 
 
 
1220
  <?php
1221
  }
1222
  ?>
1223
- </td>
1224
- </tr>
1225
- <?php
1226
- }
1227
- if (($layouts = $this->getLayouts($theme)) && count($layouts) > 1) {
1228
- ?>
1229
- <tr>
1230
- <th>
1231
- <?php esc_html_e("Comment List Layout", "wpdiscuz"); ?>
1232
- </th>
1233
- <td>
1234
- <div id="wpd_comment_layouts" style="width: 290px; margin: 15px 0 0 0">
1235
- <?php
1236
- $layout = !empty($this->generalOptions["layout"]) ? $this->generalOptions["layout"] : $layouts[0];
1237
- foreach ($layouts as $k => $value) {
1238
- ?>
1239
- <div class="wpd-box-layout">
1240
- <a href="#img<?php echo esc_attr($value); ?>"><img src="<?php echo plugins_url(WPDISCUZ_DIR_NAME . "/assets/img/dashboard/layout-" . $value . "s.png"); ?>" class="wpd-com-layout-<?php echo esc_attr($value); ?>" style="height: 85px;"/></a>
1241
- <a href="#_" class="wpd-lightbox" id="img<?php echo esc_attr($value); ?>"><img src="<?php echo plugins_url(WPDISCUZ_DIR_NAME . "/assets/img/dashboard/layout-" . $value . ".png"); ?>"/></a>
1242
- <h4><input <?php checked($layout, $value, true); ?> type="radio" name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[layout]" value="<?php echo esc_attr($value); ?>" id="wpd_cf_layout_<?php echo esc_attr($value); ?>"> <label for="wpd_cf_layout_<?php echo esc_attr($value); ?>"><?php esc_html_e("Layout", "wpdiscuz") ?> #<?php echo esc_html($value); ?></label></h4>
1243
- </div>
1244
- <?php
1245
- }
1246
- ?>
1247
- </div>
1248
- <a href="https://wpdiscuz.com/docs/wpdiscuz-7/getting-started/manage-comment-forms/comment-form-settings/#comment-thread-layout" title="<?php esc_attr_e("Read the documentation", "wpdiscuz") ?>" target="_blank"><i class="far fa-question-circle"></i></a>
1249
- </td>
1250
- </tr>
1251
- <?php
1252
- }
1253
  }
1254
- ?>
1255
- <tr>
1256
- <th>
1257
- <?php esc_html_e("Enable Post Rating", "wpdiscuz"); ?>
1258
- </th>
1259
- <td>
1260
- <?php $enablePostRating = isset($this->generalOptions["enable_post_rating"]) ? $this->generalOptions["enable_post_rating"] : 1; ?>
1261
- <input <?php checked($enablePostRating, 1, true); ?> type="radio" name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[enable_post_rating]" value="1" id="wpd_enable_post_rating_yes" > <label for="wpd_enable_post_rating_yes"><?php esc_html_e("Yes", "wpdiscuz"); ?></label>
1262
- &nbsp;
1263
- <input <?php checked($enablePostRating, 0, true); ?> type="radio" name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[enable_post_rating]" value="0" id="wpd_enable_post_rating_no"> <label for="wpd_enable_post_rating_no"><?php esc_html_e("No", "wpdiscuz"); ?></label>
1264
- <a href="https://wpdiscuz.com/docs/wpdiscuz-7/getting-started/manage-comment-forms/comment-form-settings/#enable-post-rating" title="<?php esc_attr_e("Read the documentation", "wpdiscuz") ?>" target="_blank"><i class="far fa-question-circle"></i></a>
1265
- </td>
1266
- </tr>
1267
- <tr>
1268
- <th>
1269
- <?php esc_html_e("Post Rating Title", "wpdiscuz"); ?>
1270
- </th>
1271
- <td >
1272
- <div>
1273
- <input type="text" name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[post_rating_title]" placeholder="<?php esc_attr_e("Article Rating", "wpdiscuz"); ?>" value="<?php echo isset($this->generalOptions["post_rating_title"]) ? htmlentities($this->generalOptions["post_rating_title"], ENT_QUOTES) : esc_html__("Article Rating", "wpdiscuz"); ?>" style="width:80%;">
1274
- </div>
1275
- </td>
1276
- </tr>
1277
- <tr>
1278
- <th>
1279
- <?php esc_html_e("Allow Guests to Rate", "wpdiscuz"); ?>
1280
- </th>
1281
- <td>
1282
- <?php $allowGuestsRateOnPost = isset($this->generalOptions["allow_guests_rate_on_post"]) ? $this->generalOptions["allow_guests_rate_on_post"] : 1; ?>
1283
- <input <?php checked($allowGuestsRateOnPost, 1, true); ?> type="radio" name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[allow_guests_rate_on_post]" value="1" id="wpd_allow_guests_rate_on_post_yes" > <label for="wpd_allow_guests_rate_on_post_yes"><?php esc_html_e("Yes", "wpdiscuz"); ?></label>
1284
- &nbsp;
1285
- <input <?php checked($allowGuestsRateOnPost, 0, true); ?> type="radio" name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[allow_guests_rate_on_post]" value="0" id="wpd_allow_guests_rate_on_post_no"> <label for="wpd_allow_guests_rate_on_post_no"><?php esc_html_e("No", "wpdiscuz"); ?></label>
1286
- <a href="https://wpdiscuz.com/docs/wpdiscuz-7/getting-started/manage-comment-forms/comment-form-settings/#enable-post-rating" title="<?php esc_attr_e("Read the documentation", "wpdiscuz") ?>" target="_blank"><i class="far fa-question-circle"></i></a>
1287
- </td>
1288
- </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1289
  </tbody>
1290
  </table>
1291
  </div>
1292
  <div class="wpdiscuz-wrapper">
1293
- <div class="wpdiscuz-form-builder-help"><a href="https://wpdiscuz.com/docs/wpdiscuz-7/getting-started/manage-comment-forms/comment-form-builder/" title="<?php esc_attr_e("Read the documentation", "wpdiscuz") ?>" target="_blank"><i class="far fa-question-circle"></i></a></div>
 
 
 
1294
  <div class="wpd-form">
1295
  <div class="wpd-col-wrap">
1296
  <div class="wpd-field">
@@ -1308,8 +1442,11 @@ class Form {
1308
  }
1309
  ?>
1310
  </div>
1311
- <div id="wpdiscuz_form_add_row" class="wpd-field wpd-field-add" style="width:100%; padding:20px; margin:20px 0px; cursor:pointer;" title="Add new custom field">
1312
- <div class="wpd-field-head-new"><i class="fas fa-plus-circle"></i> <?php esc_html_e("ADD ROW", "wpdiscuz"); ?></div>
 
 
 
1313
  </div>
1314
  <div style="clear:both;"></div>
1315
  </div>
37
  }
38
 
39
  public function initFormMeta() {
40
+ if ((int)$this->formID) {
41
  if (!$this->generalOptions) {
42
+ $goptions = get_post_meta($this->formID, wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS, true);
43
+ $this->generalOptions = $goptions ? $goptions : [];
44
  }
45
  if (!$this->formeStructure) {
46
  $this->formeStructure = get_post_meta($this->formID, wpdFormConst::WPDISCUZ_META_FORMS_STRUCTURE, true);
170
 
171
  public function getEnableRateOnPost() {
172
  $this->initFormMeta();
173
+ if (!array_key_exists("enable_post_rating", $this->generalOptions)) {
174
  $this->generalOptions["enable_post_rating"] = 1;
175
  }
176
+ return (int)$this->generalOptions["enable_post_rating"];
177
  }
178
 
179
  public function getPostRatingTitle() {
408
  $class = wpDiscuz()->dbManager->isUserRated(0, md5(wpDiscuz()->helper->getRealIPAddr()), $post->ID) ? "" : " class='wpd-not-rated'";
409
  }
410
  }
411
+ $rating = (float)get_post_meta($post->ID, wpdFormConst::POSTMETA_POST_RATING, true);
412
+ $count = (int)get_post_meta($post->ID, wpdFormConst::POSTMETA_POST_RATING_COUNT, true);
413
+ $prefix = (int)$rating;
414
  $suffix = $rating - $prefix;
415
  $fullStarSVG = apply_filters("wpdiscuz_full_star_svg", "<svg xmlns='https://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M0 0h24v24H0z' fill='none'/><path class='wpd-star' d='M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z'/><path d='M0 0h24v24H0z' fill='none'/></svg>", "post", "fas fa-star");
416
  $halfStarSVG = apply_filters("wpdiscuz_half_star_svg", "<svg xmlns='https://www.w3.org/2000/svg' xmlns:xlink='https://www.w3.org/1999/xlink' viewBox='0 0 24 24'><defs><path id='a' d='M0 0h24v24H0V0z'/></defs><clipPath id='b'><use xlink:href='#a' overflow='visible'/></clipPath><path class='wpd-star wpd-active' clip-path='url(#b)' d='M22 9.24l-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03L22 9.24zM12 15.4V6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z'/></svg>", "post", "fas fa-star");
421
  <div class='wpd-rating-value'>
422
  <span class='wpdrv'>" . esc_html($rating) . "</span>
423
  <span class='wpdrc'>" . esc_html($count) . "</span>
424
+ <span class='wpdrt'>" . ((int)$count === 1 ? esc_html($this->wpdOptions->getPhrase("wc_vote_phrase")) : esc_html($this->wpdOptions->getPhrase("wc_votes_phrase"))) . "</span>";
425
  $html .= "</div>
426
  <div class='wpd-rating-title'>" . esc_html($this->getPostRatingTitle()) . "</div>
427
  <div class='wpd-rating-stars'>";
463
  "itemprop" => !!$this->wpdOptions->rating["enablePostRatingSchema"],
464
  "post_id" => null,
465
  "postid" => null,
466
+ ], $atts);
467
  if (!$atts["postid"]) {
468
  if ($atts["post_id"]) {
469
  $post = get_post($atts["post_id"]);
540
  <div class='wpd-rating-value'>
541
  <span class='wpdrv'>" . esc_html($ratingData["average"]) . "</span>
542
  <span class='wpdrc'>" . esc_html($ratingData["count"]) . "</span>
543
+ <span class='wpdrt'>" . ((int)$ratingData["count"] === 1 ? esc_html($this->wpdOptions->getPhrase("wc_vote_phrase")) : esc_html($this->wpdOptions->getPhrase("wc_votes_phrase"))) . "</span>";
544
  $html .= "</div>";
545
  if ($args["show-label"]) {
546
  $html .= "<div class='wpd-rating-title'>" . esc_html($title) . "</div>";
547
  }
548
  $html .= "<div class='wpd-rating-stars'>";
549
+ $prefix = (int)$ratingData['average'];
550
  $suffix = $ratingData['average'] - $prefix;
551
  if ($prefix) {
552
  for ($i = 1; $i < 6; $i++) {
655
  } else if (!empty($layouts[0])) {
656
  $validData["layout"] = $layouts[0];
657
  }
658
+ if (array_key_exists("enable_post_rating", $options)) {
659
  $validData["enable_post_rating"] = intval($options["enable_post_rating"]);
660
  }
661
  if (!empty($options["post_rating_title"])) {
759
  if ($top || $bottom) {
760
  $htmlExists = true;
761
  }
762
+ $top = ($top) ? "<div class='wpd-top-custom-fields'>" . $top . "</div>" : "";
763
+ $bottom = ($bottom) ? "<div class='wpd-bottom-custom-fields'>" . $bottom . "</div>" : "";
764
  $output = $top . $output . $bottom;
765
  }
766
  return $htmlExists;
785
  public function renderFrontForm($isMain, $uniqueId, $commentsCount, $currentUser) {
786
  $message = "";
787
  ?>
788
+ <div class="wpd-form wpd-form-wrapper <?php echo !$isMain ? "wpd-secondary-form-wrapper" : "wpd-main-form-wrapper"; ?>" <?php echo !$isMain ? "id='wpd-secondary-form-wrapper-" . esc_attr($uniqueId) . "' style='display: none;'" : "id='wpd-main-form-wrapper-" . esc_attr($uniqueId) . "'"; ?>>
789
  <?php if (!$isMain) { ?>
790
+ <div class="wpd-secondary-forms-social-content"><?php do_action("comment_reply_form_bar_top", $this); ?></div>
791
+ <div class="clearfix"></div>
792
  <?php } ?>
793
  <?php
794
  if ($this->isUserCanComment($currentUser, $message)) {
795
  ?>
796
+ <form class="wpd_comm_form <?php echo $isMain ? "wpd_main_comm_form" : "wpd-secondary-form-wrapper"; ?>"
797
+ method="post" enctype="multipart/form-data" data-uploading="false">
798
  <div class="wpd-field-comment">
799
  <div class="wpdiscuz-item wc-field-textarea">
800
  <div class="wpdiscuz-textarea-wrap <?php echo $this->wpdOptions->form["richEditor"] === "both" || (!wp_is_mobile() && $this->wpdOptions->form["richEditor"] === "desktop") ? "" : "wpd-txt"; ?>">
829
  echo $this->wpdOptions->goodbyeCaptchaTocken;
830
  }
831
  ?>
832
+ <input type="hidden" class="wpdiscuz_unique_id" value="<?php echo esc_attr($uniqueId); ?>"
833
+ name="wpdiscuz_unique_id">
834
  </form>
835
  <?php
836
  }
844
  if ($this->wpdOptions->form["richEditor"] === "both" || (!wp_is_mobile() && $this->wpdOptions->form["richEditor"] === "desktop")) {
845
  ?>
846
  <div id="wpd-editor-wraper-<?php echo esc_attr($uniqueId); ?>" style="display: none;">
847
+ <div id="wpd-editor-char-counter-<?php echo esc_attr($uniqueId); ?>"
848
+ class="wpd-editor-char-counter"></div>
849
  <label style="display: none;" for="wc-textarea-<?php echo esc_attr($uniqueId); ?>">Label</label>
850
+ <textarea id="wc-textarea-<?php echo esc_attr($uniqueId); ?>" required name="wc_comment"
851
+ class="wc_comment wpd-field"></textarea>
852
  <div id="wpd-editor-<?php echo esc_attr($uniqueId); ?>"></div>
853
  <?php $this->renderTextEditorButtons($uniqueId); ?>
854
  </div>
870
  $textareaMaxLength = $commentTextMaxLength ? "maxlength=$commentTextMaxLength" : '';
871
  ?>
872
  <div class="wpd-textarea-wrap">
873
+ <div id="wpd-editor-char-counter-<?php echo esc_attr($uniqueId); ?>"
874
+ class="wpd-editor-char-counter"></div>
875
  <label style="display: none;" for="wc-textarea-<?php echo esc_attr($uniqueId); ?>">Label</label>
876
+ <textarea
877
+ id="wc-textarea-<?php echo esc_attr($uniqueId); ?>" <?php echo $commentTextLengthRange . ' ' . $textareaMaxLength; ?> placeholder="<?php echo esc_attr($textarea_placeholder); ?>"
878
+ aria-label="<?php echo esc_attr($textarea_placeholder); ?>" required name="wc_comment"
879
+ class="wc_comment wpd-field"></textarea>
880
  </div>
881
  <div class="wpd-editor-buttons-right">
882
  <?php
931
  $value = $editorButton["value"] ? "value='" . esc_attr($editorButton["value"]) . "'" : "";
932
  $dataName = $editorButton["name"] ? "data-wpde_button_name='" . esc_attr($editorButton["name"]) . "'" : "";
933
  ?>
934
+ <button title="<?php esc_attr_e($editorButton["title"], "wpdiscuz"); ?>"
935
+ class="<?php echo esc_attr($editorButton["class"]); ?>" <?php echo $value; ?> <?php echo $dataName; ?>><?php echo $editorButton["svg"]; ?></button>
936
  <?php
937
  }
938
  ?>
976
  public function renderEditAdminCommentForm($comment) {
977
  if ($this->formCustomFields) {
978
  ?>
979
+ <div class="stuffbox">
980
  <div class="inside">
981
  <fieldset>
982
  <legend class="edit-comment-author"><?php esc_html_e("Custom Fields", "wpdiscuz"); ?></legend>
983
  <table class="form-table editcomment">
984
  <tbody>
985
+ <?php
986
+ $allowedFieldsType = $this->row->allowedFieldsType();
987
+ foreach ($this->formCustomFields as $key => $data) {
988
+ $fieldType = $data["type"];
989
+ if (in_array($fieldType, $allowedFieldsType, true)) {
990
+ $field = call_user_func($fieldType . "::getInstance");
991
+ $value = get_comment_meta($comment->comment_ID, $key, true);
992
+ echo $field->editCommentHtml($key, $value, $data, $comment);
 
993
  }
994
+ }
995
+ ?>
996
  </tbody>
997
  </table>
998
+ <input type="hidden" name="wpdiscuz_unique_id"
999
+ value="<?php echo esc_attr($comment->comment_ID . "_" . $comment->comment_parent); ?>">
1000
  </fieldset>
1001
  </div>
1002
  </div>
1008
  $this->initFormMeta();
1009
  $blogRoles = get_editable_roles();
1010
  ?>
1011
+ <style>.wpd-form-table td {
1012
  position: relative;
1013
  }
1014
+
1015
+ .wpd-form-table td i.fa-question-circle {
1016
  font-size: 16px;
1017
  right: 15px;
1018
  top: 15px;
1019
  position: absolute;
1020
  }
1021
+
1022
+ .wpdiscuz-form-builder-help {
1023
  text-align: right;
1024
  padding: 5px;
1025
  font-size: 16px;
1026
  margin-top: -15px;
1027
  }</style>
1028
+ <style>[dir=rtl] .wpd-form-table td {
1029
  position: relative;
1030
  padding-left: 25px;
1031
  }
1032
+
1033
+ [dir=rtl] .wpd-form-table td i.fa-question-circle {
1034
  font-size: 16px;
1035
+ right: auto;
1036
  left: 0px;
1037
  top: 15px;
1038
  position: absolute;
1039
  }
1040
+
1041
+ [dir=rtl] .wpdiscuz-form-builder-help {
1042
  text-align: left;
1043
  padding: 5px;
1044
  font-size: 16px;
1046
  }</style>
1047
  <div class="wpdiscuz-wrapper">
1048
  <div class="wpd-form-options" style="width:100%;">
1049
+ <table class="wpd-form-table" width="100%" border="0" cellspacing="0" cellpadding="0"
1050
+ style="margin:10px 0px 20px 0px;">
1051
  <tbody>
1052
+ <tr>
1053
+ <th>
1054
+ <?php esc_html_e("Language", "wpdiscuz"); ?>
1055
+ </th>
1056
+ <td>
1057
+ <?php $lang = isset($this->generalOptions["lang"]) ? $this->generalOptions["lang"] : get_locale(); ?>
1058
+ <input required="" type="text"
1059
+ name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[lang]"
1060
+ value="<?php echo htmlentities($lang, ENT_QUOTES); ?>">
1061
+ <a href="https://wpdiscuz.com/docs/wpdiscuz-7/getting-started/manage-comment-forms/comment-form-settings/#language"
1062
+ title="<?php esc_attr_e("Read the documentation", "wpdiscuz") ?>" target="_blank"><i
1063
+ class="far fa-question-circle"></i></a>
1064
+ </td>
1065
+ </tr>
1066
+ <tr>
1067
+ <th>
1068
+ <?php esc_html_e("Disable commenting for roles", "wpdiscuz"); ?>
1069
+ </th>
1070
+ <td>
1071
+ <?php
1072
+ $rolesCannotComment = isset($this->generalOptions["roles_cannot_comment"]) ? $this->generalOptions["roles_cannot_comment"] : [];
1073
+ foreach ($blogRoles as $role => $info) {
1074
+ if ($role !== "administrator") {
1075
+ ?>
1076
+ <div style="float:<?php echo (is_rtl()) ? 'right' : 'left'; ?>; display:inline-block; padding:3px 5px 3px 7px; min-width:25%;">
1077
+ <input type="checkbox" <?php checked(in_array($role, $rolesCannotComment)); ?>
1078
+ value="<?php echo esc_attr($role); ?>"
1079
+ name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[roles_cannot_comment][]"
1080
+ id="wpd-<?php echo esc_attr($role); ?>"
1081
+ style="margin:0px; vertical-align: middle;"/>
1082
+ <label for="wpd-<?php echo esc_attr($role); ?>"
1083
+ style="white-space:nowrap; font-size:13px;"><?php echo esc_html($info["name"]); ?></label>
1084
+ </div>
1085
+ <?php
1086
+ }
1087
+ }
1088
+ ?>
1089
+ <a href="https://wpdiscuz.com/docs/wpdiscuz-7/getting-started/manage-comment-forms/comment-form-settings/#disable_commenting_for_roles"
1090
+ title="<?php esc_attr_e("Read the documentation", "wpdiscuz") ?>" target="_blank"><i
1091
+ class="far fa-question-circle"></i></a>
1092
+ </td>
1093
+ </tr>
1094
+ <tr>
1095
+ <th>
1096
+ <?php esc_html_e("Allow guests to comment", "wpdiscuz"); ?>
1097
+ </th>
1098
+ <td>
1099
+ <?php $guestCanComment = isset($this->generalOptions["guest_can_comment"]) ? $this->generalOptions["guest_can_comment"] : 1; ?>
1100
+ <input <?php checked($guestCanComment, 1, true); ?> type="radio"
1101
+ name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[guest_can_comment]"
1102
+ value="1" id="wpd_cf_guest_yes"> <label
1103
+ for="wpd_cf_guest_yes"><?php esc_html_e("Yes", "wpdiscuz"); ?></label>
1104
+ &nbsp;
1105
+ <input <?php checked($guestCanComment, 0, true); ?> type="radio"
1106
+ name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[guest_can_comment]"
1107
+ value="0" id="wpd_cf_guest_no"> <label
1108
+ for="wpd_cf_guest_no"><?php esc_html_e("No", "wpdiscuz"); ?></label>
1109
+ <a href="https://wpdiscuz.com/docs/wpdiscuz-7/getting-started/manage-comment-forms/comment-form-settings/#only-loggedin"
1110
+ title="<?php esc_attr_e("Read the documentation", "wpdiscuz") ?>" target="_blank"><i
1111
+ class="far fa-question-circle"></i></a>
1112
+ </td>
1113
+ </tr>
1114
+ <tr>
1115
+ <th style="max-width: 350px;">
1116
+ <?php esc_html_e("Hide comment section for roles", "wpdiscuz"); ?>
1117
+ <p class="wpd-info"><?php esc_html_e("This option hides the entire section of comments. Neither the comment form nor the comment list will be visible for selected user roles.", "wpdiscuz"); ?></p>
1118
+ </th>
1119
+ <td>
1120
+ <?php
1121
+ $rolesCannotSeeComments = isset($this->generalOptions["roles_cannot_see_comments"]) ? $this->generalOptions["roles_cannot_see_comments"] : [];
1122
+ foreach ($blogRoles as $role => $info) {
1123
+ if ($role !== "administrator") {
1124
+ ?>
1125
+ <div style="float:<?php echo (is_rtl()) ? 'right' : 'left'; ?>; display:inline-block; padding:3px 5px 3px 7px; min-width:25%;">
1126
+ <input type="checkbox" <?php checked(in_array($role, $rolesCannotSeeComments)); ?>
1127
+ value="<?php echo esc_attr($role); ?>"
1128
+ name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[roles_cannot_see_comments][]"
1129
+ id="wpd-cannot-see-comments-<?php echo esc_attr($role); ?>"
1130
+ style="margin:0px; vertical-align: middle;"/>
1131
+ <label for="wpd-cannot-see-comments-<?php echo esc_attr($role); ?>"
1132
+ style="white-space:nowrap; font-size:13px;"><?php echo esc_html($info["name"]); ?></label>
1133
+ </div>
1134
+ <?php
1135
+ }
1136
+ }
1137
+ ?>
1138
+ </td>
1139
+ </tr>
1140
+ <tr>
1141
+ <th style="max-width: 350px;">
1142
+ <?php esc_html_e("Allow guests to view comments", "wpdiscuz"); ?>
1143
+ <p class="wpd-info"><?php esc_html_e("If you disable this option, it'll hide the entire section of comments. Neither the comment form nor the comment list will be visible for guests.", "wpdiscuz"); ?></p>
1144
+ </th>
1145
+ <td>
1146
+ <?php $guestCanComment = isset($this->generalOptions["guest_can_see_comments"]) ? $this->generalOptions["guest_can_see_comments"] : 1; ?>
1147
+ <input <?php checked($guestCanComment, 1, true); ?> type="radio"
1148
+ name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[guest_can_see_comments]"
1149
+ value="1" id="wpd_csc_guest_yes"> <label
1150
+ for="wpd_csc_guest_yes"><?php esc_html_e("Yes", "wpdiscuz"); ?></label>
1151
+ &nbsp;
1152
+ <input <?php checked($guestCanComment, 0, true); ?> type="radio"
1153
+ name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[guest_can_see_comments]"
1154
+ value="0" id="wpd_csc_guest_no"> <label
1155
+ for="wpd_csc_guest_no"><?php esc_html_e("No", "wpdiscuz"); ?></label>
1156
+ </td>
1157
+ </tr>
1158
+ <tr>
1159
+ <th>
1160
+ <?php esc_html_e("Enable subscription bar", "wpdiscuz"); ?>
1161
+ </th>
1162
+ <td>
1163
+ <?php $showSubscriptionBar = isset($this->generalOptions["show_subscription_bar"]) ? $this->generalOptions["show_subscription_bar"] : 1; ?>
1164
+ <input <?php checked($showSubscriptionBar, 1, true); ?> type="radio"
1165
+ name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[show_subscription_bar]"
1166
+ value="1" id="wpd_cf_sbbar_yes">
1167
+ <label for="wpd_cf_sbbar_yes"><?php esc_html_e("Yes", "wpdiscuz"); ?></label>
1168
+ &nbsp;
1169
+ <input <?php checked($showSubscriptionBar, 0, true); ?> type="radio"
1170
+ name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[show_subscription_bar]"
1171
+ value="0" id="wpd_cf_sbbar_no">
1172
+ <label for="wpd_cf_sbbar_no"><?php esc_html_e("No", "wpdiscuz"); ?></label>
1173
+ <a href="https://wpdiscuz.com/docs/wpdiscuz-7/getting-started/manage-comment-forms/comment-form-settings/#subscription-bar"
1174
+ title="<?php esc_attr_e("Read the documentation", "wpdiscuz") ?>" target="_blank"><i
1175
+ class="far fa-question-circle"></i></a>
1176
+ </td>
1177
+ </tr>
1178
+ <tr>
1179
+ <th>
1180
+ <?php esc_html_e("Display agreement checkbox in comment Subscription Bar", "wpdiscuz"); ?>
1181
+ </th>
1182
+ <td>
1183
+ <?php $showSubscriptionAgreement = isset($this->generalOptions["show_subscription_agreement"]) ? $this->generalOptions["show_subscription_agreement"] : 0; ?>
1184
+ <input <?php checked($showSubscriptionAgreement, 1, true); ?> type="radio"
1185
+ name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[show_subscription_agreement]"
1186
+ value="1"
1187
+ id="wpd_cf_sbbar_agreement_yes">
1188
+ <label for="wpd_cf_sbbar_agreement_yes"><?php esc_html_e("Yes", "wpdiscuz"); ?></label>
1189
+ &nbsp;
1190
+ <input <?php checked($showSubscriptionAgreement, 0, true); ?> type="radio"
1191
+ name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[show_subscription_agreement]"
1192
+ value="0"
1193
+ id="wpd_cf_sbbar_agreement_no">
1194
+ <label for="wpd_cf_sbbar_agreement_no"><?php esc_html_e("No", "wpdiscuz"); ?></label>
1195
+ <a href="https://wpdiscuz.com/docs/wpdiscuz-7/getting-started/manage-comment-forms/comment-form-settings/#sb-checkbox"
1196
+ title="<?php esc_attr_e("Read the documentation", "wpdiscuz") ?>" target="_blank"><i
1197
+ class="far fa-question-circle"></i></a>
1198
+ </td>
1199
+ </tr>
1200
+ <tr>
1201
+ <th>
1202
+ <?php esc_html_e("Comment Subscription Bar agreement checkbox label", "wpdiscuz"); ?>
1203
+ </th>
1204
+ <td>
1205
+ <?php $subscriptionAgreementLabel = isset($this->generalOptions["subscription_agreement_label"]) && $this->generalOptions["subscription_agreement_label"] ? $this->generalOptions["subscription_agreement_label"] : esc_html__("I allow to use my email address and send notification about new comments and replies (you can unsubscribe at any time).", "wpdiscuz"); ?>
1206
+ <textarea
1207
+ name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[subscription_agreement_label]"
1208
+ style="width:80%;"><?php echo $subscriptionAgreementLabel; ?></textarea>
1209
+ </td>
1210
+ </tr>
1211
+ <tr>
1212
+ <th>
1213
+ <?php esc_html_e("Comment form header text (singular)", "wpdiscuz"); ?>
1214
+ </th>
1215
+ <td>
1216
+ <div>
1217
+ <input type="text"
1218
+ name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[header_text_single]"
1219
+ placeholder="<?php esc_attr_e("Comment", "wpdiscuz"); ?>"
1220
+ value="<?php echo isset($this->generalOptions["header_text_single"]) ? htmlentities($this->generalOptions["header_text_single"], ENT_QUOTES) : esc_html__("Comment", "wpdiscuz"); ?>"
1221
+ style="width:80%;">
1222
+ </div>
1223
+ <a href="https://wpdiscuz.com/docs/wpdiscuz-7/getting-started/manage-comment-forms/comment-form-settings/#comment_form_header_text"
1224
+ title="<?php esc_attr_e("Read the documentation", "wpdiscuz") ?>" target="_blank"><i
1225
+ class="far fa-question-circle"></i></a>
1226
+ </td>
1227
+ </tr>
1228
+ <tr>
1229
+ <th>
1230
+ <?php esc_html_e("Comment form header text (plural)", "wpdiscuz"); ?>
1231
+ </th>
1232
+ <td>
1233
+ <div>
1234
+ <input type="text"
1235
+ name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[header_text_plural]"
1236
+ placeholder="<?php esc_attr_e("Comments", "wpdiscuz"); ?>"
1237
+ value="<?php echo isset($this->generalOptions["header_text_plural"]) ? htmlentities($this->generalOptions["header_text_plural"], ENT_QUOTES) : esc_html__("Comments", "wpdiscuz"); ?>"
1238
+ style="width:80%;">
1239
+ </div>
1240
+ <a href="https://wpdiscuz.com/docs/wpdiscuz-7/getting-started/manage-comment-forms/comment-form-settings/#comment_form_header_text"
1241
+ title="<?php esc_attr_e("Read the documentation", "wpdiscuz") ?>" target="_blank"><i
1242
+ class="far fa-question-circle"></i></a>
1243
+ </td>
1244
+ </tr>
1245
+ <tr>
1246
+ <th> <?php esc_html_e("Display comment form for post types", "wpdiscuz"); ?></th>
1247
+ <td class="wpd-ct">
1248
+ <?php
1249
+ $this->formPostTypes = $this->formPostTypes ? $this->formPostTypes : [];
1250
+ $registeredPostTypes = get_post_types(["public" => true]);
1251
+ $formContentTypeRel = $this->wpdOptions->formContentTypeRel;
1252
+ $hasForm = false;
1253
+ $formRelExistsInfo = "<p class='wpd-info' style='padding-top:3px;'>" . esc_html__("The red marked post types are already attached to other comment form. If you set this form too, the old forms will not be used for them.", "wpdiscuz") . "</p>";
1254
+ foreach ($registeredPostTypes as $typeKey => $typeValue) {
1255
+ if (!post_type_supports($typeKey, "comments")) {
1256
+ continue;
1257
+ }
1258
+ $checked = array_key_exists($typeKey, $this->formPostTypes) ? "checked" : "";
1259
+ $formRelExistsClass = "";
1260
+ if (!$checked && !empty($formContentTypeRel[$typeKey][$lang])) {
1261
+ $formRelExistsClass = "wpd-form-rel-exixts";
1262
+ $hasForm = true;
1263
  }
1264
  ?>
1265
+ <label class="<?php echo esc_attr($formRelExistsClass); ?>"
1266
+ for="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_POSTE_TYPES . "-" . $typeKey); ?>">
1267
+ <input value="<?php echo esc_attr($typeKey); ?>"
1268
+ id="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_POSTE_TYPES . "-" . $typeKey); ?>"
1269
+ type="checkbox"
1270
+ name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_POSTE_TYPES) . "][" . esc_attr($typeKey) . "]"; ?>" <?php echo $checked; ?>/>
1271
+ <span><?php echo esc_html($typeValue); ?></span>
1272
+ </label>
1273
+ <?php } ?>
1274
+ <?php if ($hasForm) echo $formRelExistsInfo; ?>
1275
+ <a href="https://wpdiscuz.com/docs/wpdiscuz-7/getting-started/manage-comment-forms/comment-form-settings/#post-types"
1276
+ title="<?php esc_attr_e("Read the documentation", "wpdiscuz") ?>" target="_blank"><i
1277
+ class="far fa-question-circle"></i></a>
1278
+ </td>
1279
+ </tr>
1280
+ <tr>
1281
+ <th>
1282
+ <?php esc_html_e("Display comment form for post IDs", "wpdiscuz"); ?>
1283
+ <p class="wpd-info"> <?php esc_html_e("You can use this form for certain posts/pages specified by comma separated IDs.", "wpdiscuz"); ?></p>
1284
+ </th>
1285
+ <td>
1286
+ <input type="text"
1287
+ name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[postid]"
1288
+ placeholder="5,26,30..."
1289
+ value="<?php echo isset($this->generalOptions["postid"]) ? htmlentities($this->generalOptions["postid"], ENT_QUOTES) : ""; ?>"
1290
+ style="width:80%;">
1291
+ <a href="https://wpdiscuz.com/docs/wpdiscuz-7/getting-started/manage-comment-forms/comment-form-settings/#comment_form_for_post_id"
1292
+ title="<?php esc_attr_e("Read the documentation", "wpdiscuz") ?>" target="_blank"><i
1293
+ class="far fa-question-circle"></i></a>
1294
+ </td>
1295
+ </tr>
1296
+ <?php
1297
+ if ($themes = $this->getThemes()) {
1298
+ $theme = !empty($this->generalOptions["theme"]) && isset($themes[$this->generalOptions["theme"]]) ? $this->generalOptions["theme"] : $this->getDefaultTheme();
1299
+ if (count($themes) > 1) {
1300
+ ?>
1301
+ <tr>
1302
+ <th>
1303
+ <?php esc_html_e("Theme", "wpdiscuz"); ?>
1304
+ </th>
1305
+ <td>
1306
+ <?php
1307
+ foreach ($themes as $k => $val) {
1308
  ?>
1309
+ <input <?php checked($theme, $k, true); ?> type="radio"
1310
+ name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[theme]"
1311
+ value="<?php echo esc_attr($k); ?>"
1312
+ id="wpd_cf_theme_<?php echo esc_attr($val["name"]); ?>">
1313
+ <label for="wpd_cf_theme_<?php echo esc_attr($val["name"]); ?>"><?php echo esc_html($val["name"]); ?></label>
1314
+ &nbsp;
1315
  <?php
1316
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1317
  ?>
1318
+ </td>
1319
+ </tr>
1320
+ <?php
1321
+ }
1322
+ if (($layouts = $this->getLayouts($theme)) && count($layouts) > 1) {
1323
+ ?>
1324
+ <tr>
1325
+ <th>
1326
+ <?php esc_html_e("Comment List Layout", "wpdiscuz"); ?>
1327
+ </th>
1328
+ <td>
1329
+ <div id="wpd_comment_layouts" style="width: 290px; margin: 15px 0 0 0">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1330
  <?php
1331
+ $layout = !empty($this->generalOptions["layout"]) ? $this->generalOptions["layout"] : $layouts[0];
1332
+ foreach ($layouts as $k => $value) {
1333
  ?>
1334
+ <div class="wpd-box-layout">
1335
+ <a href="#img<?php echo esc_attr($value); ?>"><img
1336
+ src="<?php echo plugins_url(WPDISCUZ_DIR_NAME . "/assets/img/dashboard/layout-" . $value . "s.png"); ?>"
1337
+ class="wpd-com-layout-<?php echo esc_attr($value); ?>"
1338
+ style="height: 85px;"/></a>
1339
+ <a href="#_" class="wpd-lightbox"
1340
+ id="img<?php echo esc_attr($value); ?>"><img
1341
+ src="<?php echo plugins_url(WPDISCUZ_DIR_NAME . "/assets/img/dashboard/layout-" . $value . ".png"); ?>"/></a>
1342
+ <h4><input <?php checked($layout, $value, true); ?> type="radio"
1343
+ name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[layout]"
1344
+ value="<?php echo esc_attr($value); ?>"
1345
+ id="wpd_cf_layout_<?php echo esc_attr($value); ?>">
1346
+ <label for="wpd_cf_layout_<?php echo esc_attr($value); ?>"><?php esc_html_e("Layout", "wpdiscuz") ?>
1347
+ #<?php echo esc_html($value); ?></label></h4>
1348
+ </div>
1349
  <?php
1350
  }
1351
  ?>
1352
+ </div>
1353
+ <a href="https://wpdiscuz.com/docs/wpdiscuz-7/getting-started/manage-comment-forms/comment-form-settings/#comment-thread-layout"
1354
+ title="<?php esc_attr_e("Read the documentation", "wpdiscuz") ?>"
1355
+ target="_blank"><i class="far fa-question-circle"></i></a>
1356
+ </td>
1357
+ </tr>
1358
+ <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1359
  }
1360
+ }
1361
+ ?>
1362
+ <tr>
1363
+ <th>
1364
+ <?php esc_html_e("Enable Post Rating", "wpdiscuz"); ?>
1365
+ </th>
1366
+ <td>
1367
+ <?php $enablePostRating = array_key_exists("enable_post_rating", $this->generalOptions) ? $this->generalOptions["enable_post_rating"] : 1; ?>
1368
+ <input <?php checked($enablePostRating, 1, true); ?> type="radio"
1369
+ name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[enable_post_rating]"
1370
+ value="1"
1371
+ id="wpd_enable_post_rating_yes"> <label
1372
+ for="wpd_enable_post_rating_yes"><?php esc_html_e("Yes", "wpdiscuz"); ?></label>
1373
+ &nbsp;
1374
+ <input <?php checked($enablePostRating, 0, true); ?> type="radio"
1375
+ name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[enable_post_rating]"
1376
+ value="0"
1377
+ id="wpd_enable_post_rating_no"> <label
1378
+ for="wpd_enable_post_rating_no"><?php esc_html_e("No", "wpdiscuz"); ?></label>
1379
+ <a href="https://wpdiscuz.com/docs/wpdiscuz-7/getting-started/manage-comment-forms/comment-form-settings/#enable-post-rating"
1380
+ title="<?php esc_attr_e("Read the documentation", "wpdiscuz") ?>" target="_blank"><i
1381
+ class="far fa-question-circle"></i></a>
1382
+ </td>
1383
+ </tr>
1384
+ <tr>
1385
+ <th>
1386
+ <?php esc_html_e("Post Rating Title", "wpdiscuz"); ?>
1387
+ </th>
1388
+ <td>
1389
+ <div>
1390
+ <input type="text"
1391
+ name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[post_rating_title]"
1392
+ placeholder="<?php esc_attr_e("Article Rating", "wpdiscuz"); ?>"
1393
+ value="<?php echo isset($this->generalOptions["post_rating_title"]) ? htmlentities($this->generalOptions["post_rating_title"], ENT_QUOTES) : esc_html__("Article Rating", "wpdiscuz"); ?>"
1394
+ style="width:80%;">
1395
+ </div>
1396
+ </td>
1397
+ </tr>
1398
+ <tr>
1399
+ <th>
1400
+ <?php esc_html_e("Allow Guests to Rate", "wpdiscuz"); ?>
1401
+ </th>
1402
+ <td>
1403
+ <?php $allowGuestsRateOnPost = isset($this->generalOptions["allow_guests_rate_on_post"]) ? $this->generalOptions["allow_guests_rate_on_post"] : 1; ?>
1404
+ <input <?php checked($allowGuestsRateOnPost, 1, true); ?> type="radio"
1405
+ name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[allow_guests_rate_on_post]"
1406
+ value="1"
1407
+ id="wpd_allow_guests_rate_on_post_yes">
1408
+ <label for="wpd_allow_guests_rate_on_post_yes"><?php esc_html_e("Yes", "wpdiscuz"); ?></label>
1409
+ &nbsp;
1410
+ <input <?php checked($allowGuestsRateOnPost, 0, true); ?> type="radio"
1411
+ name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[allow_guests_rate_on_post]"
1412
+ value="0"
1413
+ id="wpd_allow_guests_rate_on_post_no">
1414
+ <label for="wpd_allow_guests_rate_on_post_no"><?php esc_html_e("No", "wpdiscuz"); ?></label>
1415
+ <a href="https://wpdiscuz.com/docs/wpdiscuz-7/getting-started/manage-comment-forms/comment-form-settings/#enable-post-rating"
1416
+ title="<?php esc_attr_e("Read the documentation", "wpdiscuz") ?>" target="_blank"><i
1417
+ class="far fa-question-circle"></i></a>
1418
+ </td>
1419
+ </tr>
1420
  </tbody>
1421
  </table>
1422
  </div>
1423
  <div class="wpdiscuz-wrapper">
1424
+ <div class="wpdiscuz-form-builder-help"><a
1425
+ href="https://wpdiscuz.com/docs/wpdiscuz-7/getting-started/manage-comment-forms/comment-form-builder/"
1426
+ title="<?php esc_attr_e("Read the documentation", "wpdiscuz") ?>" target="_blank"><i
1427
+ class="far fa-question-circle"></i></a></div>
1428
  <div class="wpd-form">
1429
  <div class="wpd-col-wrap">
1430
  <div class="wpd-field">
1442
  }
1443
  ?>
1444
  </div>
1445
+ <div id="wpdiscuz_form_add_row" class="wpd-field wpd-field-add"
1446
+ style="width:100%; padding:20px; margin:20px 0px; cursor:pointer;"
1447
+ title="Add new custom field">
1448
+ <div class="wpd-field-head-new"><i
1449
+ class="fas fa-plus-circle"></i> <?php esc_html_e("ADD ROW", "wpdiscuz"); ?></div>
1450
  </div>
1451
  <div style="clear:both;"></div>
1452
  </div>
forms/wpdFormAttr/Tools/Sanitizer.php CHANGED
@@ -13,7 +13,7 @@ class Sanitizer {
13
  return $default;
14
  }
15
  }
16
- $variable = filter_input($action, $variable_name, $filter, $options);
17
  return $variable ? $variable : $default;
18
  }
19
 
13
  return $default;
14
  }
15
  }
16
+ $variable = isset($variable_name) ? filter_input($action, $variable_name, $filter) : '';
17
  return $variable ? $variable : $default;
18
  }
19
 
includes/class.WpdiscuzDBManager.php CHANGED
@@ -666,13 +666,14 @@ class WpdiscuzDBManager implements WpDiscuzConstants {
666
  public function getMostReactedCommentId($postId, $cache = true) {
667
  if ($cache) {
668
  $stat = get_post_meta($postId, self::POSTMETA_STATISTICS, true);
669
- if (!is_array($stat))
670
  $stat = [];
671
- if ($stat && isset($stat[self::POSTMETA_REACTED])) {
672
- $reacted = intval($stat[self::POSTMETA_REACTED]);
 
673
  } else {
674
  $sql = $this->db->prepare("SELECT v.`comment_id` FROM `{$this->usersVoted}` AS `v` INNER JOIN `{$this->db->comments}` AS `c` ON `v`.`comment_id` = `c`.`comment_ID` WHERE `c`.`comment_post_ID` = %d AND `c`.`comment_approved` = '1' GROUP BY `v`.`comment_id` ORDER BY COUNT(`v`.`comment_id`) DESC, `c`.`comment_ID` DESC LIMIT 1;", $postId);
675
- $reacted = intval($this->db->get_var($sql));
676
  $stat[self::POSTMETA_REACTED] = $reacted;
677
  update_post_meta($postId, self::POSTMETA_STATISTICS, $stat);
678
  }
@@ -712,7 +713,7 @@ class WpdiscuzDBManager implements WpDiscuzConstants {
712
  $sql = "SELECT * FROM `{$this->emailNotification}` WHERE 1";
713
 
714
  if (!empty($args["id"])) {
715
- $sql .= " AND `id` = " . (int) $args["id"];
716
  }
717
 
718
  if (!empty($args["email"])) {
@@ -720,11 +721,11 @@ class WpdiscuzDBManager implements WpDiscuzConstants {
720
  }
721
 
722
  if (!empty($args["subscribtion_id"])) {
723
- $sql .= " AND `subscribtion_id` = " . (int) $args["subscribtion_id"];
724
  }
725
 
726
  if (!empty($args["post_id"])) {
727
- $sql .= " AND `post_id` = " . (int) $args["post_id"];
728
  }
729
 
730
  if (!empty($args["subscribtion_type"])) {
@@ -736,7 +737,7 @@ class WpdiscuzDBManager implements WpDiscuzConstants {
736
  }
737
 
738
  if (!empty($args["confirm"])) {
739
- $sql .= " AND `confirm` = " . (int) $args["confirm"];
740
  }
741
 
742
  if (!empty($args["subscription_date"])) {
@@ -756,11 +757,11 @@ class WpdiscuzDBManager implements WpDiscuzConstants {
756
  }
757
 
758
  if (!empty($args["limit"])) {
759
- $sql .= " LIMIT " . (int) $args["limit"];
760
  }
761
 
762
  if (!empty($args["offset"])) {
763
- $sql .= " OFFSET " . (int) $args["offset"];
764
  }
765
 
766
  return $this->db->get_results($sql, ARRAY_A);
@@ -958,8 +959,8 @@ class WpdiscuzDBManager implements WpDiscuzConstants {
958
  public function regenerateVoteMetas($ids) {
959
  foreach ($ids as $k => $id) {
960
  $votes = $this->getVotes($id);
961
- $like = (int) $votes[0];
962
- $dislike = (int) $votes[1];
963
  update_comment_meta($id, self::META_KEY_VOTES_SEPARATE, ["like" => $like, "dislike" => $dislike]);
964
  update_comment_meta($id, self::META_KEY_VOTES, $like - $dislike);
965
  }
666
  public function getMostReactedCommentId($postId, $cache = true) {
667
  if ($cache) {
668
  $stat = get_post_meta($postId, self::POSTMETA_STATISTICS, true);
669
+ if (!is_array($stat)) {
670
  $stat = [];
671
+ }
672
+ if ($stat && array_key_exists(self::POSTMETA_REACTED, $stat) && $stat[self::POSTMETA_REACTED]) {
673
+ $reacted = (int)$stat[self::POSTMETA_REACTED];
674
  } else {
675
  $sql = $this->db->prepare("SELECT v.`comment_id` FROM `{$this->usersVoted}` AS `v` INNER JOIN `{$this->db->comments}` AS `c` ON `v`.`comment_id` = `c`.`comment_ID` WHERE `c`.`comment_post_ID` = %d AND `c`.`comment_approved` = '1' GROUP BY `v`.`comment_id` ORDER BY COUNT(`v`.`comment_id`) DESC, `c`.`comment_ID` DESC LIMIT 1;", $postId);
676
+ $reacted = (int)$this->db->get_var($sql);
677
  $stat[self::POSTMETA_REACTED] = $reacted;
678
  update_post_meta($postId, self::POSTMETA_STATISTICS, $stat);
679
  }
713
  $sql = "SELECT * FROM `{$this->emailNotification}` WHERE 1";
714
 
715
  if (!empty($args["id"])) {
716
+ $sql .= " AND `id` = " . (int)$args["id"];
717
  }
718
 
719
  if (!empty($args["email"])) {
721
  }
722
 
723
  if (!empty($args["subscribtion_id"])) {
724
+ $sql .= " AND `subscribtion_id` = " . (int)$args["subscribtion_id"];
725
  }
726
 
727
  if (!empty($args["post_id"])) {
728
+ $sql .= " AND `post_id` = " . (int)$args["post_id"];
729
  }
730
 
731
  if (!empty($args["subscribtion_type"])) {
737
  }
738
 
739
  if (!empty($args["confirm"])) {
740
+ $sql .= " AND `confirm` = " . (int)$args["confirm"];
741
  }
742
 
743
  if (!empty($args["subscription_date"])) {
757
  }
758
 
759
  if (!empty($args["limit"])) {
760
+ $sql .= " LIMIT " . (int)$args["limit"];
761
  }
762
 
763
  if (!empty($args["offset"])) {
764
+ $sql .= " OFFSET " . (int)$args["offset"];
765
  }
766
 
767
  return $this->db->get_results($sql, ARRAY_A);
959
  public function regenerateVoteMetas($ids) {
960
  foreach ($ids as $k => $id) {
961
  $votes = $this->getVotes($id);
962
+ $like = (int)$votes[0];
963
+ $dislike = (int)$votes[1];
964
  update_comment_meta($id, self::META_KEY_VOTES_SEPARATE, ["like" => $like, "dislike" => $dislike]);
965
  update_comment_meta($id, self::META_KEY_VOTES, $like - $dislike);
966
  }
options/class.WpdiscuzOptions.php CHANGED
@@ -258,6 +258,22 @@ class WpdiscuzOptions implements WpDiscuzConstants {
258
  $this->subscription["usePostmaticForCommentNotification"] = isset($options[self::TAB_SUBSCRIPTION]["usePostmaticForCommentNotification"]) ? $options[self::TAB_SUBSCRIPTION]["usePostmaticForCommentNotification"] : $defaultOptions[self::TAB_SUBSCRIPTION]["usePostmaticForCommentNotification"];
259
  $this->subscription["isFollowActive"] = isset($options[self::TAB_SUBSCRIPTION]["isFollowActive"]) ? $options[self::TAB_SUBSCRIPTION]["isFollowActive"] : $defaultOptions[self::TAB_SUBSCRIPTION]["isFollowActive"];
260
  $this->subscription["disableFollowConfirmForUsers"] = isset($options[self::TAB_SUBSCRIPTION]["disableFollowConfirmForUsers"]) ? $options[self::TAB_SUBSCRIPTION]["disableFollowConfirmForUsers"] : $defaultOptions[self::TAB_SUBSCRIPTION]["disableFollowConfirmForUsers"];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
261
  /* labels */
262
  $this->labels["blogRoleLabels"] = isset($options[self::TAB_LABELS]["blogRoleLabels"]) ? $options[self::TAB_LABELS]["blogRoleLabels"] : $defaultOptions[self::TAB_LABELS]["blogRoleLabels"];
263
  $this->labels["blogRoles"] = isset($options[self::TAB_LABELS]["blogRoles"]) ? $options[self::TAB_LABELS]["blogRoles"] : $defaultOptions[self::TAB_LABELS]["blogRoles"];
@@ -333,7 +349,6 @@ class WpdiscuzOptions implements WpDiscuzConstants {
333
  "wc_notify_on_new_comment" => esc_html__("new follow-up comments", "wpdiscuz"),
334
  "wc_notify_on_all_new_reply" => esc_html__("new replies to my comments", "wpdiscuz"),
335
  "wc_notify_on_new_reply" => esc_html__("Notify of new replies to this comment", "wpdiscuz"),
336
- "wc_sort_by" => esc_html__("Sort by", "wpdiscuz"),
337
  "wc_newest" => esc_html__("Newest", "wpdiscuz"),
338
  "wc_oldest" => esc_html__("Oldest", "wpdiscuz"),
339
  "wc_most_voted" => esc_html__("Most Voted", "wpdiscuz"),
@@ -733,6 +748,22 @@ class WpdiscuzOptions implements WpDiscuzConstants {
733
  "usePostmaticForCommentNotification" => $this->subscription["usePostmaticForCommentNotification"],
734
  "isFollowActive" => $this->subscription["isFollowActive"],
735
  "disableFollowConfirmForUsers" => $this->subscription["disableFollowConfirmForUsers"],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
736
  ],
737
  self::TAB_LABELS => [
738
  "blogRoleLabels" => $this->labels["blogRoleLabels"],
@@ -980,6 +1011,22 @@ class WpdiscuzOptions implements WpDiscuzConstants {
980
  "usePostmaticForCommentNotification" => 0,
981
  "isFollowActive" => 1,
982
  "disableFollowConfirmForUsers" => 1,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
983
  ],
984
  self::TAB_LABELS => [
985
  "blogRoleLabels" => isset($this->labels["blogRoleLabels"]) ? $this->labels["blogRoleLabels"] : [],
@@ -1254,6 +1301,9 @@ class WpdiscuzOptions implements WpDiscuzConstants {
1254
  if (!current_user_can("manage_options")) {
1255
  die(esc_html_e("Hacker?", "wpdiscuz"));
1256
  }
 
 
 
1257
  check_admin_referer("wc_options_form-" . sanitize_text_field($_POST["wpd_tab"]));
1258
  if (self::TAB_FORM === sanitize_text_field($_POST["wpd_tab"])) {
1259
  $this->form["commentFormView"] = isset($_POST[self::TAB_FORM]["commentFormView"]) ? trim(sanitize_text_field($_POST[self::TAB_FORM]["commentFormView"])) : "collapsed";
@@ -1449,6 +1499,22 @@ class WpdiscuzOptions implements WpDiscuzConstants {
1449
  $this->subscription["usePostmaticForCommentNotification"] = isset($_POST[self::TAB_SUBSCRIPTION]["usePostmaticForCommentNotification"]) ? absint($_POST[self::TAB_SUBSCRIPTION]["usePostmaticForCommentNotification"]) : 0;
1450
  $this->subscription["isFollowActive"] = isset($_POST[self::TAB_SUBSCRIPTION]["isFollowActive"]) ? absint($_POST[self::TAB_SUBSCRIPTION]["isFollowActive"]) : 0;
1451
  $this->subscription["disableFollowConfirmForUsers"] = isset($_POST[self::TAB_SUBSCRIPTION]["disableFollowConfirmForUsers"]) ? absint($_POST[self::TAB_SUBSCRIPTION]["disableFollowConfirmForUsers"]) : 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1452
  } else if (self::TAB_LABELS === $_POST["wpd_tab"]) {
1453
  $emptyRolesArray = array_combine(array_keys($this->labels["blogRoleLabels"]), array_pad([], count($this->labels["blogRoleLabels"]), 0));
1454
  $this->labels["blogRoleLabels"] = isset($_POST[self::TAB_LABELS]["blogRoleLabels"]) ? wp_parse_args($_POST[self::TAB_LABELS]["blogRoleLabels"], $emptyRolesArray) : $emptyRolesArray;
@@ -1532,7 +1598,6 @@ class WpdiscuzOptions implements WpDiscuzConstants {
1532
  $this->phrases["wc_notify_on_new_comment"] = sanitize_text_field($_POST["wc_notify_on_new_comment"]);
1533
  $this->phrases["wc_notify_on_all_new_reply"] = sanitize_text_field($_POST["wc_notify_on_all_new_reply"]);
1534
  $this->phrases["wc_notify_on_new_reply"] = sanitize_text_field($_POST["wc_notify_on_new_reply"]);
1535
- $this->phrases["wc_sort_by"] = sanitize_text_field($_POST["wc_sort_by"]);
1536
  $this->phrases["wc_newest"] = sanitize_text_field($_POST["wc_newest"]);
1537
  $this->phrases["wc_oldest"] = sanitize_text_field($_POST["wc_oldest"]);
1538
  $this->phrases["wc_most_voted"] = sanitize_text_field($_POST["wc_most_voted"]);
@@ -1831,7 +1896,7 @@ class WpdiscuzOptions implements WpDiscuzConstants {
1831
  $data = $phrases;
1832
  }
1833
  }
1834
- if($data) {
1835
  $file_name .= date('Y-m-d') . '.txt';
1836
  header('Content-Description: File Transfer');
1837
  header("Content-Disposition: attachment; filename={$file_name}");
@@ -2203,30 +2268,30 @@ class WpdiscuzOptions implements WpDiscuzConstants {
2203
  <?php esc_html_e("New wpDiscuz addon!"); ?>
2204
  </p>
2205
  <div style="font-size:14px;">
2206
- <!-- --><?php //if(!in_array("BuddyPress Integration", $lastHashArray)): ?>
2207
  <!-- <div style="display:inline-block; min-width:27%; padding-right:10px; margin-bottom:10px;">-->
2208
- <!-- <img src="--><?php //echo plugins_url(WPDISCUZ_DIR_NAME . "/assets/addons/buddypress/header.png"); ?><!--" style="height:50px; width:auto; vertical-align:middle; margin:0px 10px; text-decoration:none; float: left;"/>-->
2209
- <!-- <a href="https://gvectors.com/product/wpdiscuz-buddypress-integration/" target="_blank" style="color:#444; text-decoration:none;" title="--><?php //esc_attr_e("Go to the addon page", "wpdiscuz"); ?><!--">wpDiscuz - BuddyPress Integration <br><span style="margin: 0; font-size: 12px; line-height: 15px; display: block; padding-top: 5px;">This addon integrates wpDiscuz with BuddyPress plugin. Creates &laquoDiscussion&raquo; tab in the users profile page, intgartes notifications, activities, and more...</span></a>-->
2210
  <!-- </div>-->
2211
- <!-- --><?php //endif; ?>
2212
  <?php if (!in_array("User Notifications", $lastHashArray)): ?>
2213
  <div style="display:inline-block; min-width:27%; padding-right:10px; margin-bottom:10px;">
2214
  <img src="<?php echo plugins_url(WPDISCUZ_DIR_NAME . "/assets/addons/notifications/header.png"); ?>" style="height:50px; width:auto; vertical-align:middle; margin:0px 10px; text-decoration:none; float: left;"/>
2215
  <a href="https://gvectors.com/product/wpdiscuz-user-notifications/" target="_blank" style="color:#444; text-decoration:none;" title="<?php esc_attr_e("Go to the addon page", "wpdiscuz"); ?>">wpDiscuz - User Notifications <br><span style="width: 60%; margin: 0; font-size: 12px; line-height: 15px; display: block; padding-top: 5px;">Adds a real-time user notification system to your site, so users can receive updates and notifications directly on your website as they happen (when someone likes your comment, rates your post, mentions you, replies to your comment).</span></a>
2216
  </div>
2217
  <?php endif; ?>
2218
- <!-- --><?php //if(!in_array("GIPHY Integration", $lastHashArray)): ?>
2219
  <!-- <div style="display:inline-block; min-width:27%; padding-right:10px; margin-bottom:10px;">-->
2220
- <!-- <img src="--><?php //echo plugins_url(WPDISCUZ_DIR_NAME . "/assets/addons/giphy/header.png"); ?><!--" style="height:50px; width:auto; vertical-align:middle; margin:0px 10px; text-decoration:none; float: left;"/>-->
2221
- <!-- <a href="https://gvectors.com/product/wpdiscuz-giphy-integration/" target="_blank" style="color:#444; text-decoration:none;" title="--><?php //esc_attr_e("Go to the addon page", "wpdiscuz"); ?><!--">wpDiscuz - GIPHY Integration <br><span style="margin: 0; font-size: 12px; line-height: 15px; display: block; padding-top: 5px;">This adds GIPHY [GIF] button on the toolbar of comment editor. Clicking this will open a new popup where you can search for your favorite gifs and insert them in your comment content.</span></a>-->
2222
  <!-- </div>-->
2223
- <!-- --><?php //endif; ?>
2224
- <!-- --><?php //if(!in_array("Tenor GIFs Integration", $lastHashArray)): ?>
2225
  <!-- <div style="display:inline-block; min-width:27%; padding-right:10px; margin-bottom:10px;">-->
2226
- <!-- <img src="--><?php //echo plugins_url(WPDISCUZ_DIR_NAME . "/assets/addons/tenor/header.png"); ?><!--" style="height:50px; width:auto; vertical-align:middle; margin:0px 10px; text-decoration:none; float: left;"/>-->
2227
- <!-- <a href="https://gvectors.com/product/wpdiscuz-tenor-integration/" target="_blank" style="color:#444; text-decoration:none;" title="--><?php //esc_attr_e("Go to the addon page", "wpdiscuz"); ?><!--">wpDiscuz - Tenor GIFs Integration <br><span style="margin: 0; font-size: 12px; line-height: 15px; display: block; padding-top: 5px;">This adds Tenor [GIF] button on the toolbar of comment editor. Clicking this will open a new popup where you can search for your favorite gifs and insert them in your comment content.</span></a>-->
2228
  <!-- </div>-->
2229
- <!-- --><?php //endif; ?>
2230
  <div style="clear:both;"></div>
2231
  </div>
2232
  <p>&nbsp;&nbsp;&nbsp;<a href="<?php echo esc_url_raw(admin_url("admin.php?page=" . self::PAGE_ADDONS)); ?>"><?php esc_html_e("Go to wpDiscuz Addons subMenu"); ?> &raquo;</a></p>
@@ -2785,6 +2850,7 @@ class WpdiscuzOptions implements WpDiscuzConstants {
2785
  } else if (isset($oldOptions[self::TAB_SUBSCRIPTION]["disableFollowConfirmForUsers"])) {
2786
  $newOptions[self::TAB_SUBSCRIPTION]["disableFollowConfirmForUsers"] = $oldOptions[self::TAB_SUBSCRIPTION]["disableFollowConfirmForUsers"];
2787
  }
 
2788
  if (isset($oldOptions["wc_blog_roles"])) {
2789
  $newOptions[self::TAB_LABELS]["blogRoles"] = $oldOptions["wc_blog_roles"];
2790
  } else if (isset($oldOptions[self::TAB_LABELS]["blogRoles"])) {
@@ -2882,6 +2948,36 @@ class WpdiscuzOptions implements WpDiscuzConstants {
2882
  return $newOptions;
2883
  }
2884
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2885
  public function printDocLink($docUrl) {
2886
  if ($docUrl && $docUrl !== "#") {
2887
  echo "<a href='" . esc_url_raw($docUrl) . "' title='" . esc_attr("Read the documentation", "wpdiscuz") . "' target='_blank'><i class='far fa-question-circle'></i></a>";
@@ -4218,6 +4314,118 @@ class WpdiscuzOptions implements WpDiscuzConstants {
4218
  "description_original" => "",
4219
  "docurl" => "https://wpdiscuz.com/docs/wpdiscuz-7/plugin-settings/subscription-and-user-following/#follow-users-without-email-confirmation",
4220
  ],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4221
  ],
4222
  ],
4223
  WpdiscuzCore::TAB_LABELS => [
258
  $this->subscription["usePostmaticForCommentNotification"] = isset($options[self::TAB_SUBSCRIPTION]["usePostmaticForCommentNotification"]) ? $options[self::TAB_SUBSCRIPTION]["usePostmaticForCommentNotification"] : $defaultOptions[self::TAB_SUBSCRIPTION]["usePostmaticForCommentNotification"];
259
  $this->subscription["isFollowActive"] = isset($options[self::TAB_SUBSCRIPTION]["isFollowActive"]) ? $options[self::TAB_SUBSCRIPTION]["isFollowActive"] : $defaultOptions[self::TAB_SUBSCRIPTION]["isFollowActive"];
260
  $this->subscription["disableFollowConfirmForUsers"] = isset($options[self::TAB_SUBSCRIPTION]["disableFollowConfirmForUsers"]) ? $options[self::TAB_SUBSCRIPTION]["disableFollowConfirmForUsers"] : $defaultOptions[self::TAB_SUBSCRIPTION]["disableFollowConfirmForUsers"];
261
+ $this->subscription["emailSubjectPostComment"] = isset($options[self::TAB_SUBSCRIPTION]["emailSubjectPostComment"]) ? $options[self::TAB_SUBSCRIPTION]["emailSubjectPostComment"] : $defaultOptions[self::TAB_SUBSCRIPTION]["emailSubjectPostComment"];
262
+ $this->subscription["emailContentPostComment"] = isset($options[self::TAB_SUBSCRIPTION]["emailContentPostComment"]) ? $options[self::TAB_SUBSCRIPTION]["emailContentPostComment"] : $defaultOptions[self::TAB_SUBSCRIPTION]["emailContentPostComment"];
263
+ $this->subscription["emailSubjectAllCommentReply"] = isset($options[self::TAB_SUBSCRIPTION]["emailSubjectAllCommentReply"]) ? $options[self::TAB_SUBSCRIPTION]["emailSubjectAllCommentReply"] : $defaultOptions[self::TAB_SUBSCRIPTION]["emailSubjectAllCommentReply"];
264
+ $this->subscription["emailContentAllCommentReply"] = isset($options[self::TAB_SUBSCRIPTION]["emailContentAllCommentReply"]) ? $options[self::TAB_SUBSCRIPTION]["emailContentAllCommentReply"] : $defaultOptions[self::TAB_SUBSCRIPTION]["emailContentAllCommentReply"];
265
+ $this->subscription["emailSubjectCommentReply"] = isset($options[self::TAB_SUBSCRIPTION]["emailSubjectCommentReply"]) ? $options[self::TAB_SUBSCRIPTION]["emailSubjectCommentReply"] : $defaultOptions[self::TAB_SUBSCRIPTION]["emailSubjectCommentReply"];
266
+ $this->subscription["emailContentCommentReply"] = isset($options[self::TAB_SUBSCRIPTION]["emailContentCommentReply"]) ? $options[self::TAB_SUBSCRIPTION]["emailContentCommentReply"] : $defaultOptions[self::TAB_SUBSCRIPTION]["emailContentCommentReply"];
267
+ $this->subscription["emailSubjectSubscriptionConfirmation"] = isset($options[self::TAB_SUBSCRIPTION]["emailSubjectSubscriptionConfirmation"]) ? $options[self::TAB_SUBSCRIPTION]["emailSubjectSubscriptionConfirmation"] : $defaultOptions[self::TAB_SUBSCRIPTION]["emailSubjectSubscriptionConfirmation"];
268
+ $this->subscription["emailContentSubscriptionConfirmation"] = isset($options[self::TAB_SUBSCRIPTION]["emailContentSubscriptionConfirmation"]) ? $options[self::TAB_SUBSCRIPTION]["emailContentSubscriptionConfirmation"] : $defaultOptions[self::TAB_SUBSCRIPTION]["emailContentSubscriptionConfirmation"];
269
+ $this->subscription["emailSubjectCommentApproved"] = isset($options[self::TAB_SUBSCRIPTION]["emailSubjectCommentApproved"]) ? $options[self::TAB_SUBSCRIPTION]["emailSubjectCommentApproved"] : $defaultOptions[self::TAB_SUBSCRIPTION]["emailSubjectCommentApproved"];
270
+ $this->subscription["emailContentCommentApproved"] = isset($options[self::TAB_SUBSCRIPTION]["emailContentCommentApproved"]) ? $options[self::TAB_SUBSCRIPTION]["emailContentCommentApproved"] : $defaultOptions[self::TAB_SUBSCRIPTION]["emailContentCommentApproved"];
271
+ $this->subscription["emailSubjectUserMentioned"] = isset($options[self::TAB_SUBSCRIPTION]["emailSubjectUserMentioned"]) ? $options[self::TAB_SUBSCRIPTION]["emailSubjectUserMentioned"] : $defaultOptions[self::TAB_SUBSCRIPTION]["emailSubjectUserMentioned"];
272
+ $this->subscription["emailContentUserMentioned"] = isset($options[self::TAB_SUBSCRIPTION]["emailContentUserMentioned"]) ? $options[self::TAB_SUBSCRIPTION]["emailContentUserMentioned"] : $defaultOptions[self::TAB_SUBSCRIPTION]["emailContentUserMentioned"];
273
+ $this->subscription["emailSubjectFollowConfirmation"] = isset($options[self::TAB_SUBSCRIPTION]["emailSubjectFollowConfirmation"]) ? $options[self::TAB_SUBSCRIPTION]["emailSubjectFollowConfirmation"] : $defaultOptions[self::TAB_SUBSCRIPTION]["emailSubjectFollowConfirmation"];
274
+ $this->subscription["emailContentFollowConfirmation"] = isset($options[self::TAB_SUBSCRIPTION]["emailContentFollowConfirmation"]) ? $options[self::TAB_SUBSCRIPTION]["emailContentFollowConfirmation"] : $defaultOptions[self::TAB_SUBSCRIPTION]["emailContentFollowConfirmation"];
275
+ $this->subscription["emailSubjectFollowComment"] = isset($options[self::TAB_SUBSCRIPTION]["emailSubjectFollowComment"]) ? $options[self::TAB_SUBSCRIPTION]["emailSubjectFollowComment"] : $defaultOptions[self::TAB_SUBSCRIPTION]["emailSubjectFollowComment"];
276
+ $this->subscription["emailContentFollowComment"] = isset($options[self::TAB_SUBSCRIPTION]["emailContentFollowComment"]) ? $options[self::TAB_SUBSCRIPTION]["emailContentFollowComment"] : $defaultOptions[self::TAB_SUBSCRIPTION]["emailContentFollowComment"];
277
  /* labels */
278
  $this->labels["blogRoleLabels"] = isset($options[self::TAB_LABELS]["blogRoleLabels"]) ? $options[self::TAB_LABELS]["blogRoleLabels"] : $defaultOptions[self::TAB_LABELS]["blogRoleLabels"];
279
  $this->labels["blogRoles"] = isset($options[self::TAB_LABELS]["blogRoles"]) ? $options[self::TAB_LABELS]["blogRoles"] : $defaultOptions[self::TAB_LABELS]["blogRoles"];
349
  "wc_notify_on_new_comment" => esc_html__("new follow-up comments", "wpdiscuz"),
350
  "wc_notify_on_all_new_reply" => esc_html__("new replies to my comments", "wpdiscuz"),
351
  "wc_notify_on_new_reply" => esc_html__("Notify of new replies to this comment", "wpdiscuz"),
 
352
  "wc_newest" => esc_html__("Newest", "wpdiscuz"),
353
  "wc_oldest" => esc_html__("Oldest", "wpdiscuz"),
354
  "wc_most_voted" => esc_html__("Most Voted", "wpdiscuz"),
748
  "usePostmaticForCommentNotification" => $this->subscription["usePostmaticForCommentNotification"],
749
  "isFollowActive" => $this->subscription["isFollowActive"],
750
  "disableFollowConfirmForUsers" => $this->subscription["disableFollowConfirmForUsers"],
751
+ "emailSubjectPostComment" => $this->subscription["emailSubjectPostComment"],
752
+ "emailContentPostComment" => $this->subscription["emailContentPostComment"],
753
+ "emailSubjectAllCommentReply" => $this->subscription["emailSubjectAllCommentReply"],
754
+ "emailContentAllCommentReply" => $this->subscription["emailContentAllCommentReply"],
755
+ "emailSubjectCommentReply" => $this->subscription["emailSubjectCommentReply"],
756
+ "emailContentCommentReply" => $this->subscription["emailContentCommentReply"],
757
+ "emailSubjectSubscriptionConfirmation" => $this->subscription["emailSubjectSubscriptionConfirmation"],
758
+ "emailContentSubscriptionConfirmation" => $this->subscription["emailContentSubscriptionConfirmation"],
759
+ "emailSubjectCommentApproved" => $this->subscription["emailSubjectCommentApproved"],
760
+ "emailContentCommentApproved" => $this->subscription["emailContentCommentApproved"],
761
+ "emailSubjectUserMentioned" => $this->subscription["emailSubjectUserMentioned"],
762
+ "emailContentUserMentioned" => $this->subscription["emailContentUserMentioned"],
763
+ "emailSubjectFollowConfirmation" => $this->subscription["emailSubjectFollowConfirmation"],
764
+ "emailContentFollowConfirmation" => $this->subscription["emailContentFollowConfirmation"],
765
+ "emailSubjectFollowComment" => $this->subscription["emailSubjectFollowComment"],
766
+ "emailContentFollowComment" => $this->subscription["emailContentFollowComment"],
767
  ],
768
  self::TAB_LABELS => [
769
  "blogRoleLabels" => $this->labels["blogRoleLabels"],
1011
  "usePostmaticForCommentNotification" => 0,
1012
  "isFollowActive" => 1,
1013
  "disableFollowConfirmForUsers" => 1,
1014
+ "emailSubjectPostComment" => esc_html__("New Comment", "wpdiscuz"),
1015
+ "emailContentPostComment" => __("Hi [SUBSCRIBER_NAME],<br/><br/> new comment has been posted by the <em><strong>[COMMENT_AUTHOR]</em></strong> on the discussion section you've been interested in<br/><br/><a href='[COMMENT_URL]'>[COMMENT_URL]</a><br/><br/>[COMMENT_CONTENT]<br/><br/><a href='[UNSUBSCRIBE_URL]'>Unsubscribe</a>", "wpdiscuz"),
1016
+ "emailSubjectAllCommentReply" => esc_html__("New Reply ( your comments )", "wpdiscuz"),
1017
+ "emailContentAllCommentReply" => __("Hi [SUBSCRIBER_NAME],<br/><br/> new reply has been posted by the <em><strong>[COMMENT_AUTHOR]</em></strong> on the discussion section you've been interested in<br/><br/><a href='[COMMENT_URL]'>[COMMENT_URL]</a><br/><br/>[COMMENT_CONTENT]<br/><br/><a href='[UNSUBSCRIBE_URL]'>Unsubscribe</a>", "wpdiscuz"),
1018
+ "emailSubjectCommentReply" => esc_html__("New Reply ( your specific comment )", "wpdiscuz"),
1019
+ "emailContentCommentReply" => __("Hi [SUBSCRIBER_NAME],<br/><br/> new reply has been posted by the <em><strong>[COMMENT_AUTHOR]</em></strong> on the discussion section you've been interested in<br/><br/><a href='[COMMENT_URL]'>[COMMENT_URL]</a><br/><br/>[COMMENT_CONTENT]<br/><br/><a href='[UNSUBSCRIBE_URL]'>Unsubscribe</a>", "wpdiscuz"),
1020
+ "emailSubjectSubscriptionConfirmation" => esc_html__("Subscription Confirmation", "wpdiscuz"),
1021
+ "emailContentSubscriptionConfirmation" => __("Hi, <br/> You just subscribed for new comments on our website. This means you will receive an email when new comments are posted according to subscription option you've chosen. <br/> To activate, click confirm below. If you believe this is an error, ignore this message and we'll never bother you again. <br/><br/><a href='[POST_URL]'>[POST_TITLE]</a><br/><br/><a href='[CONFIRM_URL]'>Confirm Your Subscription</a><br/><br/><a href='[CANCEL_URL]'>Cancel Subscription</a>", "wpdiscuz"),
1022
+ "emailSubjectCommentApproved" => esc_html__("Your comment is approved!", "wpdiscuz"),
1023
+ "emailContentCommentApproved" => __('Hi [COMMENT_AUTHOR],<br/><br/>your comment has been approved.<br/><br/><a href="[COMMENT_URL]">[COMMENT_URL]</a><br/><br/>[COMMENT_CONTENT]', "wpdiscuz"),
1024
+ "emailSubjectUserMentioned" => __('You have been mentioned in comment', "wpdiscuz"),
1025
+ "emailContentUserMentioned" => __('Hi [MENTIONED_USER_NAME]!<br/>You have been mentioned in a comment posted on "[POST_TITLE]" post by [COMMENT_AUTHOR].<br/><br/>Comment URL: <a href="[COMMENT_URL]">[COMMENT_URL]</a>', "wpdiscuz"),
1026
+ "emailSubjectFollowConfirmation" => esc_html__('User Following Confirmation', "wpdiscuz"),
1027
+ "emailContentFollowConfirmation" => __('Hi, <br/> You just started following a new user. You\'ll get email notification once new comment is posted by this user. <br/> Please click on "user following confirmation" link to confirm your request. If you believe this is an error, ignore this message and we\'ll never bother you again. <br/><br/><a href="[POST_URL]">[POST_TITLE]</a><br/><br/><a href="[CONFIRM_URL]">' . __("Confirm Follow", "wpdiscuz") . '</a><br/><br/><a href="[CANCEL_URL]">' . esc_html__("Unfollow", "wpdiscuz") . "</a>", "wpdiscuz"),
1028
+ "emailSubjectFollowComment" => esc_html__("New Comment", "wpdiscuz"),
1029
+ "emailContentFollowComment" => __('Hi [FOLLOWER_NAME],<br/><br/> new comment has been posted by the <em><strong>[COMMENT_AUTHOR]</em></strong> you are following<br/><br/><a href="[COMMENT_URL]">[COMMENT_URL]</a><br/><br/>[COMMENT_CONTENT]<br/><br/><a href="[CANCEL_URL]">' . esc_html__("Unfollow", "wpdiscuz") . '</a>', "wpdiscuz"),
1030
  ],
1031
  self::TAB_LABELS => [
1032
  "blogRoleLabels" => isset($this->labels["blogRoleLabels"]) ? $this->labels["blogRoleLabels"] : [],
1301
  if (!current_user_can("manage_options")) {
1302
  die(esc_html_e("Hacker?", "wpdiscuz"));
1303
  }
1304
+
1305
+ $defaultOptions = $this->getDefaultOptions();
1306
+
1307
  check_admin_referer("wc_options_form-" . sanitize_text_field($_POST["wpd_tab"]));
1308
  if (self::TAB_FORM === sanitize_text_field($_POST["wpd_tab"])) {
1309
  $this->form["commentFormView"] = isset($_POST[self::TAB_FORM]["commentFormView"]) ? trim(sanitize_text_field($_POST[self::TAB_FORM]["commentFormView"])) : "collapsed";
1499
  $this->subscription["usePostmaticForCommentNotification"] = isset($_POST[self::TAB_SUBSCRIPTION]["usePostmaticForCommentNotification"]) ? absint($_POST[self::TAB_SUBSCRIPTION]["usePostmaticForCommentNotification"]) : 0;
1500
  $this->subscription["isFollowActive"] = isset($_POST[self::TAB_SUBSCRIPTION]["isFollowActive"]) ? absint($_POST[self::TAB_SUBSCRIPTION]["isFollowActive"]) : 0;
1501
  $this->subscription["disableFollowConfirmForUsers"] = isset($_POST[self::TAB_SUBSCRIPTION]["disableFollowConfirmForUsers"]) ? absint($_POST[self::TAB_SUBSCRIPTION]["disableFollowConfirmForUsers"]) : 0;
1502
+ $this->subscription["emailSubjectPostComment"] = isset($_POST[self::TAB_SUBSCRIPTION]["emailSubjectPostComment"]) ? wp_kses_post(wp_unslash($_POST[self::TAB_SUBSCRIPTION]["emailSubjectPostComment"])) : wp_kses_post(wp_unslash($defaultOptions['emailSubjectPostComment']));
1503
+ $this->subscription["emailContentPostComment"] = isset($_POST[self::TAB_SUBSCRIPTION]["emailContentPostComment"]) ? wp_kses_post(wp_unslash($_POST[self::TAB_SUBSCRIPTION]["emailContentPostComment"])) : wp_kses_post(wp_unslash($defaultOptions['emailContentPostComment']));
1504
+ $this->subscription["emailSubjectAllCommentReply"] = isset($_POST[self::TAB_SUBSCRIPTION]["emailSubjectAllCommentReply"]) ? wp_kses_post(wp_unslash($_POST[self::TAB_SUBSCRIPTION]["emailSubjectAllCommentReply"])) : wp_kses_post(wp_unslash($defaultOptions['emailSubjectAllCommentReply']));
1505
+ $this->subscription["emailContentAllCommentReply"] = isset($_POST[self::TAB_SUBSCRIPTION]["emailContentAllCommentReply"]) ? wp_kses_post(wp_unslash($_POST[self::TAB_SUBSCRIPTION]["emailContentAllCommentReply"])) : wp_kses_post(wp_unslash($defaultOptions['emailContentAllCommentReply']));
1506
+ $this->subscription["emailSubjectCommentReply"] = isset($_POST[self::TAB_SUBSCRIPTION]["emailSubjectCommentReply"]) ? wp_kses_post(wp_unslash($_POST[self::TAB_SUBSCRIPTION]["emailSubjectCommentReply"])) : wp_kses_post(wp_unslash($defaultOptions['emailSubjectCommentReply']));
1507
+ $this->subscription["emailContentCommentReply"] = isset($_POST[self::TAB_SUBSCRIPTION]["emailContentCommentReply"]) ? wp_kses_post(wp_unslash($_POST[self::TAB_SUBSCRIPTION]["emailContentCommentReply"])) : wp_kses_post(wp_unslash($defaultOptions['emailContentCommentReply']));
1508
+ $this->subscription["emailSubjectSubscriptionConfirmation"] = isset($_POST[self::TAB_SUBSCRIPTION]["emailSubjectSubscriptionConfirmation"]) ? wp_kses_post(wp_unslash($_POST[self::TAB_SUBSCRIPTION]["emailSubjectSubscriptionConfirmation"])) : wp_kses_post(wp_unslash($defaultOptions['emailSubjectSubscriptionConfirmation']));
1509
+ $this->subscription["emailContentSubscriptionConfirmation"] = isset($_POST[self::TAB_SUBSCRIPTION]["emailContentSubscriptionConfirmation"]) ? wp_kses_post(wp_unslash($_POST[self::TAB_SUBSCRIPTION]["emailContentSubscriptionConfirmation"])) : wp_kses_post(wp_unslash($defaultOptions['emailContentSubscriptionConfirmation']));
1510
+ $this->subscription["emailSubjectCommentApproved"] = isset($_POST[self::TAB_SUBSCRIPTION]["emailSubjectCommentApproved"]) ? wp_kses_post(wp_unslash($_POST[self::TAB_SUBSCRIPTION]["emailSubjectCommentApproved"])) : wp_kses_post(wp_unslash($defaultOptions['emailSubjectCommentApproved']));
1511
+ $this->subscription["emailContentCommentApproved"] = isset($_POST[self::TAB_SUBSCRIPTION]["emailContentCommentApproved"]) ? wp_kses_post(wp_unslash($_POST[self::TAB_SUBSCRIPTION]["emailContentCommentApproved"])) : wp_kses_post(wp_unslash($defaultOptions['emailContentCommentApproved']));
1512
+ $this->subscription["emailSubjectUserMentioned"] = isset($_POST[self::TAB_SUBSCRIPTION]["emailSubjectUserMentioned"]) ? wp_kses_post(wp_unslash($_POST[self::TAB_SUBSCRIPTION]["emailSubjectUserMentioned"])) : wp_kses_post(wp_unslash($defaultOptions['emailSubjectUserMentioned']));
1513
+ $this->subscription["emailContentUserMentioned"] = isset($_POST[self::TAB_SUBSCRIPTION]["emailContentUserMentioned"]) ? wp_kses_post(wp_unslash($_POST[self::TAB_SUBSCRIPTION]["emailContentUserMentioned"])) : wp_kses_post(wp_unslash($defaultOptions['emailContentUserMentioned']));
1514
+ $this->subscription["emailSubjectFollowConfirmation"] = isset($_POST[self::TAB_SUBSCRIPTION]["emailSubjectFollowConfirmation"]) ? wp_kses_post(wp_unslash($_POST[self::TAB_SUBSCRIPTION]["emailSubjectFollowConfirmation"])) : wp_kses_post(wp_unslash($defaultOptions['emailSubjectFollowConfirmation']));
1515
+ $this->subscription["emailContentFollowConfirmation"] = isset($_POST[self::TAB_SUBSCRIPTION]["emailContentFollowConfirmation"]) ? wp_kses_post(wp_unslash($_POST[self::TAB_SUBSCRIPTION]["emailContentFollowConfirmation"])) : wp_kses_post(wp_unslash($defaultOptions['emailContentFollowConfirmation']));
1516
+ $this->subscription["emailSubjectFollowComment"] = isset($_POST[self::TAB_SUBSCRIPTION]["emailSubjectFollowComment"]) ? wp_kses_post(wp_unslash($_POST[self::TAB_SUBSCRIPTION]["emailSubjectFollowComment"])) : wp_kses_post(wp_unslash($defaultOptions['emailSubjectFollowComment']));
1517
+ $this->subscription["emailContentFollowComment"] = isset($_POST[self::TAB_SUBSCRIPTION]["emailContentFollowComment"]) ? wp_kses_post(wp_unslash($_POST[self::TAB_SUBSCRIPTION]["emailContentFollowComment"])) : wp_kses_post(wp_unslash($defaultOptions['emailContentFollowComment']));
1518
  } else if (self::TAB_LABELS === $_POST["wpd_tab"]) {
1519
  $emptyRolesArray = array_combine(array_keys($this->labels["blogRoleLabels"]), array_pad([], count($this->labels["blogRoleLabels"]), 0));
1520
  $this->labels["blogRoleLabels"] = isset($_POST[self::TAB_LABELS]["blogRoleLabels"]) ? wp_parse_args($_POST[self::TAB_LABELS]["blogRoleLabels"], $emptyRolesArray) : $emptyRolesArray;
1598
  $this->phrases["wc_notify_on_new_comment"] = sanitize_text_field($_POST["wc_notify_on_new_comment"]);
1599
  $this->phrases["wc_notify_on_all_new_reply"] = sanitize_text_field($_POST["wc_notify_on_all_new_reply"]);
1600
  $this->phrases["wc_notify_on_new_reply"] = sanitize_text_field($_POST["wc_notify_on_new_reply"]);
 
1601
  $this->phrases["wc_newest"] = sanitize_text_field($_POST["wc_newest"]);
1602
  $this->phrases["wc_oldest"] = sanitize_text_field($_POST["wc_oldest"]);
1603
  $this->phrases["wc_most_voted"] = sanitize_text_field($_POST["wc_most_voted"]);
1896
  $data = $phrases;
1897
  }
1898
  }
1899
+ if ($data) {
1900
  $file_name .= date('Y-m-d') . '.txt';
1901
  header('Content-Description: File Transfer');
1902
  header("Content-Disposition: attachment; filename={$file_name}");
2268
  <?php esc_html_e("New wpDiscuz addon!"); ?>
2269
  </p>
2270
  <div style="font-size:14px;">
2271
+ <!-- --><?php //if(!in_array("BuddyPress Integration", $lastHashArray)): ?>
2272
  <!-- <div style="display:inline-block; min-width:27%; padding-right:10px; margin-bottom:10px;">-->
2273
+ <!-- <img src="--><?php //echo plugins_url(WPDISCUZ_DIR_NAME . "/assets/addons/buddypress/header.png"); ?><!--" style="height:50px; width:auto; vertical-align:middle; margin:0px 10px; text-decoration:none; float: left;"/>-->
2274
+ <!-- <a href="https://gvectors.com/product/wpdiscuz-buddypress-integration/" target="_blank" style="color:#444; text-decoration:none;" title="--><?php //esc_attr_e("Go to the addon page", "wpdiscuz"); ?><!--">wpDiscuz - BuddyPress Integration <br><span style="margin: 0; font-size: 12px; line-height: 15px; display: block; padding-top: 5px;">This addon integrates wpDiscuz with BuddyPress plugin. Creates &laquoDiscussion&raquo; tab in the users profile page, intgartes notifications, activities, and more...</span></a>-->
2275
  <!-- </div>-->
2276
+ <!-- --><?php //endif; ?>
2277
  <?php if (!in_array("User Notifications", $lastHashArray)): ?>
2278
  <div style="display:inline-block; min-width:27%; padding-right:10px; margin-bottom:10px;">
2279
  <img src="<?php echo plugins_url(WPDISCUZ_DIR_NAME . "/assets/addons/notifications/header.png"); ?>" style="height:50px; width:auto; vertical-align:middle; margin:0px 10px; text-decoration:none; float: left;"/>
2280
  <a href="https://gvectors.com/product/wpdiscuz-user-notifications/" target="_blank" style="color:#444; text-decoration:none;" title="<?php esc_attr_e("Go to the addon page", "wpdiscuz"); ?>">wpDiscuz - User Notifications <br><span style="width: 60%; margin: 0; font-size: 12px; line-height: 15px; display: block; padding-top: 5px;">Adds a real-time user notification system to your site, so users can receive updates and notifications directly on your website as they happen (when someone likes your comment, rates your post, mentions you, replies to your comment).</span></a>
2281
  </div>
2282
  <?php endif; ?>
2283
+ <!-- --><?php //if(!in_array("GIPHY Integration", $lastHashArray)): ?>
2284
  <!-- <div style="display:inline-block; min-width:27%; padding-right:10px; margin-bottom:10px;">-->
2285
+ <!-- <img src="--><?php //echo plugins_url(WPDISCUZ_DIR_NAME . "/assets/addons/giphy/header.png"); ?><!--" style="height:50px; width:auto; vertical-align:middle; margin:0px 10px; text-decoration:none; float: left;"/>-->
2286
+ <!-- <a href="https://gvectors.com/product/wpdiscuz-giphy-integration/" target="_blank" style="color:#444; text-decoration:none;" title="--><?php //esc_attr_e("Go to the addon page", "wpdiscuz"); ?><!--">wpDiscuz - GIPHY Integration <br><span style="margin: 0; font-size: 12px; line-height: 15px; display: block; padding-top: 5px;">This adds GIPHY [GIF] button on the toolbar of comment editor. Clicking this will open a new popup where you can search for your favorite gifs and insert them in your comment content.</span></a>-->
2287
  <!-- </div>-->
2288
+ <!-- --><?php //endif; ?>
2289
+ <!-- --><?php //if(!in_array("Tenor GIFs Integration", $lastHashArray)): ?>
2290
  <!-- <div style="display:inline-block; min-width:27%; padding-right:10px; margin-bottom:10px;">-->
2291
+ <!-- <img src="--><?php //echo plugins_url(WPDISCUZ_DIR_NAME . "/assets/addons/tenor/header.png"); ?><!--" style="height:50px; width:auto; vertical-align:middle; margin:0px 10px; text-decoration:none; float: left;"/>-->
2292
+ <!-- <a href="https://gvectors.com/product/wpdiscuz-tenor-integration/" target="_blank" style="color:#444; text-decoration:none;" title="--><?php //esc_attr_e("Go to the addon page", "wpdiscuz"); ?><!--">wpDiscuz - Tenor GIFs Integration <br><span style="margin: 0; font-size: 12px; line-height: 15px; display: block; padding-top: 5px;">This adds Tenor [GIF] button on the toolbar of comment editor. Clicking this will open a new popup where you can search for your favorite gifs and insert them in your comment content.</span></a>-->
2293
  <!-- </div>-->
2294
+ <!-- --><?php //endif; ?>
2295
  <div style="clear:both;"></div>
2296
  </div>
2297
  <p>&nbsp;&nbsp;&nbsp;<a href="<?php echo esc_url_raw(admin_url("admin.php?page=" . self::PAGE_ADDONS)); ?>"><?php esc_html_e("Go to wpDiscuz Addons subMenu"); ?> &raquo;</a></p>
2850
  } else if (isset($oldOptions[self::TAB_SUBSCRIPTION]["disableFollowConfirmForUsers"])) {
2851
  $newOptions[self::TAB_SUBSCRIPTION]["disableFollowConfirmForUsers"] = $oldOptions[self::TAB_SUBSCRIPTION]["disableFollowConfirmForUsers"];
2852
  }
2853
+ // TODO -- add new options from phrases
2854
  if (isset($oldOptions["wc_blog_roles"])) {
2855
  $newOptions[self::TAB_LABELS]["blogRoles"] = $oldOptions["wc_blog_roles"];
2856
  } else if (isset($oldOptions[self::TAB_LABELS]["blogRoles"])) {
2948
  return $newOptions;
2949
  }
2950
 
2951
+ // TODO
2952
+ public function addEmailTemplates($update = false) {
2953
+ if ($this->dbManager->isPhraseExists("wc_be_the_first_text") && $update) {
2954
+ $defaultOptions = $this->getDefaultOptions();
2955
+ $wc_saved_phrases = $this->dbManager->getPhrases();
2956
+ $this->subscription["emailSubjectPostComment"] = array_key_exists("wc_email_subject", $wc_saved_phrases) ? $wc_saved_phrases["wc_email_subject"] : $defaultOptions["emailSubjectPostComment"];
2957
+ $this->subscription["emailContentPostComment"] = array_key_exists("wc_email_message", $wc_saved_phrases) ? $wc_saved_phrases["wc_email_message"] : $defaultOptions["emailContentPostComment"];
2958
+ $this->subscription["emailSubjectAllCommentReply"] = array_key_exists("wc_all_comment_new_reply_subject", $wc_saved_phrases) ? $wc_saved_phrases["wc_all_comment_new_reply_subject"] : $defaultOptions["emailSubjectAllCommentReply"];
2959
+ $this->subscription["emailContentAllCommentReply"] = array_key_exists("wc_all_comment_new_reply_message", $wc_saved_phrases) ? $wc_saved_phrases['wc_all_comment_new_reply_message'] : $defaultOptions["emailContentAllCommentReply"];
2960
+ $this->subscription["emailSubjectCommentReply"] = array_key_exists("wc_new_reply_email_subject", $wc_saved_phrases) ? $wc_saved_phrases["wc_new_reply_email_subject"] : $defaultOptions["emailSubjectCommentReply"];
2961
+ $this->subscription["emailContentCommentReply"] = array_key_exists("wc_new_reply_email_message", $wc_saved_phrases) ? $wc_saved_phrases["wc_new_reply_email_message"] : $defaultOptions["emailContentCommentReply"];
2962
+ $this->subscription["emailSubjectSubscriptionConfirmation"] = array_key_exists("wc_confirm_email_subject", $wc_saved_phrases) ? $wc_saved_phrases["wc_confirm_email_subject"] : $defaultOptions["emailSubjectSubscriptionConfirmation"];
2963
+ $this->subscription["emailContentSubscriptionConfirmation"] = array_key_exists("wc_confirm_email_message", $wc_saved_phrases) ? $wc_saved_phrases["wc_confirm_email_message"] : $defaultOptions["emailContentSubscriptionConfirmation"];
2964
+ $this->subscription["emailSubjectCommentApproved"] = array_key_exists("wc_comment_approved_email_subject", $wc_saved_phrases) ? $wc_saved_phrases["wc_comment_approved_email_subject"] : $defaultOptions["emailSubjectCommentApproved"];
2965
+ $this->subscription["emailContentCommentApproved"] = array_key_exists("wc_comment_approved_email_message", $wc_saved_phrases) ? $wc_saved_phrases["wc_comment_approved_email_message"] : $defaultOptions["emailContentCommentApproved"];
2966
+ $this->subscription["emailSubjectUserMentioned"] = array_key_exists("wc_mentioned_email_subject", $wc_saved_phrases) ? $wc_saved_phrases["wc_mentioned_email_subject"] : $defaultOptions["emailSubjectUserMentioned"];
2967
+ $this->subscription["emailContentUserMentioned"] = array_key_exists("wc_mentioned_email_message", $wc_saved_phrases) ? $wc_saved_phrases["wc_mentioned_email_message"] : $defaultOptions["emailContentUserMentioned"];
2968
+ $this->subscription["emailSubjectFollowConfirmation"] = array_key_exists("wc_follow_confirm_email_subject", $wc_saved_phrases) ? $wc_saved_phrases["wc_follow_confirm_email_subject"] : $defaultOptions["emailSubjectFollowConfirmation"];
2969
+ $this->subscription["emailContentFollowConfirmation"] = array_key_exists("wc_follow_confirm_email_message", $wc_saved_phrases) ? $wc_saved_phrases["wc_follow_confirm_email_message"] : $defaultOptions["emailContentFollowConfirmation"];
2970
+ $this->subscription["emailSubjectFollowComment"] = array_key_exists("wc_follow_email_subject", $wc_saved_phrases) ? $wc_saved_phrases["wc_follow_email_subject"] : $defaultOptions["emailSubjectFollowComment"];
2971
+ $this->subscription["emailContentFollowComment"] = array_key_exists("wc_follow_email_message", $wc_saved_phrases) ? $wc_saved_phrases["wc_follow_email_message"] : $defaultOptions["emailContentFollowComment"];
2972
+ /**
2973
+ * get options
2974
+ * if keys dont exit add them from phrases else from default options
2975
+ * update options
2976
+ * init options
2977
+ */
2978
+ }
2979
+ }
2980
+
2981
  public function printDocLink($docUrl) {
2982
  if ($docUrl && $docUrl !== "#") {
2983
  echo "<a href='" . esc_url_raw($docUrl) . "' title='" . esc_attr("Read the documentation", "wpdiscuz") . "' target='_blank'><i class='far fa-question-circle'></i></a>";
4314
  "description_original" => "",
4315
  "docurl" => "https://wpdiscuz.com/docs/wpdiscuz-7/plugin-settings/subscription-and-user-following/#follow-users-without-email-confirmation",
4316
  ],
4317
+ "emailSubjectPostComment" => [
4318
+ "label" => esc_html__("Email subject", "wpdiscuz"),
4319
+ "label_original" => "Email subject",
4320
+ "description" => "",
4321
+ "description_original" => "",
4322
+ "docurl" => "",
4323
+ ],
4324
+ "emailContentPostComment" => [
4325
+ "label" => esc_html__("Email content", "wpdiscuz"),
4326
+ "label_original" => "Email content",
4327
+ "description" => "",
4328
+ "description_original" => "",
4329
+ "docurl" => "",
4330
+ ],
4331
+ "emailSubjectAllCommentReply" => [
4332
+ "label" => esc_html__("Email subject", "wpdiscuz"),
4333
+ "label_original" => "Email subject",
4334
+ "description" => "",
4335
+ "description_original" => "",
4336
+ "docurl" => "",
4337
+ ],
4338
+ "emailContentAllCommentReply" => [
4339
+ "label" => esc_html__("Email content", "wpdiscuz"),
4340
+ "label_original" => "Email content",
4341
+ "description" => "",
4342
+ "description_original" => "",
4343
+ "docurl" => "",
4344
+ ],
4345
+ "emailSubjectCommentReply" => [
4346
+ "label" => esc_html__("Email subject", "wpdiscuz"),
4347
+ "label_original" => "Email subject",
4348
+ "description" => "",
4349
+ "description_original" => "",
4350
+ "docurl" => "",
4351
+ ],
4352
+ "emailContentCommentReply" => [
4353
+ "label" => esc_html__("Email content", "wpdiscuz"),
4354
+ "label_original" => "Email content",
4355
+ "description" => "",
4356
+ "description_original" => "",
4357
+ "docurl" => "",
4358
+ ],
4359
+ "emailSubjectSubscriptionConfirmation" => [
4360
+ "label" => esc_html__("Email subject", "wpdiscuz"),
4361
+ "label_original" => "Email subject",
4362
+ "description" => "",
4363
+ "description_original" => "",
4364
+ "docurl" => "",
4365
+ ],
4366
+ "emailContentSubscriptionConfirmation" => [
4367
+ "label" => esc_html__("Email content", "wpdiscuz"),
4368
+ "label_original" => "Email content",
4369
+ "description" => "",
4370
+ "description_original" => "",
4371
+ "docurl" => "",
4372
+ ],
4373
+ "emailSubjectCommentApproved" => [
4374
+ "label" => esc_html__("Email subject", "wpdiscuz"),
4375
+ "label_original" => "Email subject",
4376
+ "description" => "",
4377
+ "description_original" => "",
4378
+ "docurl" => "",
4379
+ ],
4380
+ "emailContentCommentApproved" => [
4381
+ "label" => esc_html__("Email content", "wpdiscuz"),
4382
+ "label_original" => "Email content",
4383
+ "description" => "",
4384
+ "description_original" => "",
4385
+ "docurl" => "",
4386
+ ],
4387
+ "emailSubjectUserMentioned" => [
4388
+ "label" => esc_html__("Email subject", "wpdiscuz"),
4389
+ "label_original" => "Email subject",
4390
+ "description" => "",
4391
+ "description_original" => "",
4392
+ "docurl" => "",
4393
+ ],
4394
+ "emailContentUserMentioned" => [
4395
+ "label" => esc_html__("Email content", "wpdiscuz"),
4396
+ "label_original" => "Email content",
4397
+ "description" => "",
4398
+ "description_original" => "",
4399
+ "docurl" => "",
4400
+ ],
4401
+ "emailSubjectFollowConfirmation" => [
4402
+ "label" => esc_html__("Email subject", "wpdiscuz"),
4403
+ "label_original" => "Email subject",
4404
+ "description" => "",
4405
+ "description_original" => "",
4406
+ "docurl" => "",
4407
+ ],
4408
+ "emailContentFollowConfirmation" => [
4409
+ "label" => esc_html__("Email content", "wpdiscuz"),
4410
+ "label_original" => "Email content",
4411
+ "description" => "",
4412
+ "description_original" => "",
4413
+ "docurl" => "",
4414
+ ],
4415
+ "emailSubjectFollowComment" => [
4416
+ "label" => esc_html__("Email subject", "wpdiscuz"),
4417
+ "label_original" => "Email subject",
4418
+ "description" => "",
4419
+ "description_original" => "",
4420
+ "docurl" => "",
4421
+ ],
4422
+ "emailContentFollowComment" => [
4423
+ "label" => esc_html__("Email content", "wpdiscuz"),
4424
+ "label_original" => "Email content",
4425
+ "description" => "",
4426
+ "description_original" => "",
4427
+ "docurl" => "",
4428
+ ],
4429
  ],
4430
  ],
4431
  WpdiscuzCore::TAB_LABELS => [
options/options-layouts/html-subscription.php CHANGED
@@ -226,5 +226,507 @@ if (!defined("ABSPATH")) {
226
  </div>
227
  <!-- Option end -->
228
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
229
 
230
 
226
  </div>
227
  <!-- Option end -->
228
 
229
+ <div class="wpd-accordion">
230
+
231
+ <div class="wpd-accordion-item">
232
+
233
+ <div class="wpd-subtitle fas wpd-accordion-title" style="margin-top: 20px;" data-wpd-selector="wpd-subscription-templates">
234
+ <p><?php esc_html_e("Subscription email templates", "wpdiscuz") ?></p>
235
+ </div>
236
+
237
+ <div class="wpd-accordion-content">
238
+
239
+ <div class="wpd-subtitle wpd-subtitle" style="margin-top: 20px;">
240
+ <?php esc_html_e("Subscription Type: Post new comment", "wpdiscuz"); ?>
241
+ </div>
242
+
243
+ <!-- Option start -->
244
+ <div class="wpd-opt-row" data-wpd-opt="emailSubjectPostComment">
245
+ <div class="wpd-opt-name">
246
+ <label for="emailSubjectPostComment"><?php esc_html_e($setting["options"]["emailSubjectPostComment"]["label"]) ?></label>
247
+ <p class="wpd-desc"><?php esc_html_e($setting["options"]["emailSubjectPostComment"]["description"]) ?></p>
248
+ <p class="wpd-desc"><?php esc_html_e("Available shortcodes", "wpdiscuz"); ?></p>
249
+ <p class="wpd-desc">
250
+ <span class="wc_available_variable" data-wpd-clipboard="[BLOG_TITLE]">[BLOG_TITLE]</span>
251
+ <span class="wc_available_variable" data-wpd-clipboard="[POST_TITLE]">[POST_TITLE]</span>
252
+ <span class="wc_available_variable" data-wpd-clipboard="[COMMENT_AUTHOR]">[COMMENT_AUTHOR]</span>
253
+ </p>
254
+ </div>
255
+ <div class="wpd-opt-input">
256
+ <input type="text" value="<?php esc_attr_e($this->subscription["emailSubjectPostComment"]); ?>" name="<?php echo WpdiscuzCore::TAB_SUBSCRIPTION; ?>[emailSubjectPostComment]" id="emailSubjectPostComment" />
257
+ </div>
258
+ <div class="wpd-opt-doc">
259
+ <?php $this->printDocLink($setting["options"]["emailSubjectPostComment"]["docurl"]) ?>
260
+ </div>
261
+ </div>
262
+ <!-- Option end -->
263
+
264
+ <!-- Option start -->
265
+ <div class="wpd-opt-row" data-wpd-opt="emailContentPostComment">
266
+ <div class="wpd-opt-name">
267
+ <label for="emailContentPostComment"><?php esc_html_e($setting["options"]["emailContentPostComment"]["label"]) ?></label>
268
+ <p class="wpd-desc"><?php esc_html_e($setting["options"]["emailContentPostComment"]["description"]) ?></p>
269
+ <p class="wpd-desc"><?php esc_html_e("Available shortcodes", "wpdiscuz"); ?></p>
270
+ <span class="wc_available_variable" data-wpd-clipboard="[SITE_URL]">[SITE_URL]</span>
271
+ <span class="wc_available_variable" data-wpd-clipboard="[POST_URL]">[POST_URL]</span>
272
+ <span class="wc_available_variable" data-wpd-clipboard="[BLOG_TITLE]">[BLOG_TITLE]</span>
273
+ <span class="wc_available_variable" data-wpd-clipboard="[POST_TITLE]">[POST_TITLE]</span>
274
+ <span class="wc_available_variable" data-wpd-clipboard="[SUBSCRIBER_NAME]">[SUBSCRIBER_NAME]</span>
275
+ <p class="wpd-desc"><?php esc_html_e("Shortcodes above will work for registered users only", "wpdiscuz"); ?></p>
276
+ <span class="wc_available_variable" data-wpd-clipboard="[COMMENT_URL]">[COMMENT_URL]</span>
277
+ <span class="wc_available_variable" data-wpd-clipboard="[COMMENT_AUTHOR]">[COMMENT_AUTHOR]</span>
278
+ <span class="wc_available_variable" data-wpd-clipboard="[COMMENT_CONTENT]">[COMMENT_CONTENT]</span>
279
+ <span class="wc_available_variable" data-wpd-clipboard="[UNSUBSCRIBE_URL]">[UNSUBSCRIBE_URL]</span>
280
+ </div>
281
+ <div class="wpd-opt-input">
282
+ <?php
283
+ wp_editor($this->subscription["emailContentPostComment"], "emailContentPostComment", [
284
+ "textarea_name" => WpdiscuzCore::TAB_SUBSCRIPTION . "[emailContentPostComment]",
285
+ "textarea_rows" => 10,
286
+ "teeny" => true,
287
+ "media_buttons" => true,
288
+ "default_editor" => "tmce"
289
+ ]);
290
+ ?>
291
+ </div>
292
+ <div class="wpd-opt-doc">
293
+ <?php $this->printDocLink($setting["options"]["emailContentPostComment"]["docurl"]) ?>
294
+ </div>
295
+ </div>
296
+ <!-- Option end -->
297
+
298
+ <div class="wpd-subtitle wpd-subtitle" style="margin-top: 20px;">
299
+ <?php esc_html_e("Subscription Type: Subscriber's comments", "wpdiscuz"); ?>
300
+ </div>
301
+
302
+ <!-- Option start -->
303
+ <div class="wpd-opt-row" data-wpd-opt="emailSubjectAllCommentReply">
304
+ <div class="wpd-opt-name">
305
+ <label for="emailSubjectAllCommentReply"><?php esc_html_e($setting["options"]["emailSubjectAllCommentReply"]["label"]) ?></label>
306
+ <p class="wpd-desc"><?php esc_html_e($setting["options"]["emailSubjectAllCommentReply"]["description"]) ?></p>
307
+ <p class="wpd-desc"><?php esc_html_e("Available shortcodes", "wpdiscuz"); ?></p>
308
+ <p class="wpd-desc">
309
+ <span class="wc_available_variable" data-wpd-clipboard="[BLOG_TITLE]">[BLOG_TITLE]</span>
310
+ <span class="wc_available_variable" data-wpd-clipboard="[POST_TITLE]">[POST_TITLE]</span>
311
+ <span class="wc_available_variable" data-wpd-clipboard="[COMMENT_AUTHOR]">[COMMENT_AUTHOR]</span>
312
+ </p>
313
+ </div>
314
+ <div class="wpd-opt-input">
315
+ <input type="text" value="<?php esc_attr_e($this->subscription["emailSubjectAllCommentReply"]); ?>" name="<?php echo WpdiscuzCore::TAB_SUBSCRIPTION; ?>[emailSubjectAllCommentReply]" id="emailSubjectAllCommentReply" />
316
+ </div>
317
+ <div class="wpd-opt-doc">
318
+ <?php $this->printDocLink($setting["options"]["emailSubjectAllCommentReply"]["docurl"]) ?>
319
+ </div>
320
+ </div>
321
+ <!-- Option end -->
322
+
323
+ <!-- Option start -->
324
+ <div class="wpd-opt-row" data-wpd-opt="emailContentAllCommentReply">
325
+ <div class="wpd-opt-name">
326
+ <label for="emailContentAllCommentReply"><?php esc_html_e($setting["options"]["emailContentAllCommentReply"]["label"]) ?></label>
327
+ <p class="wpd-desc"><?php esc_html_e($setting["options"]["emailContentAllCommentReply"]["description"]) ?></p>
328
+ <p class="wpd-desc"><?php esc_html_e("Available shortcodes", "wpdiscuz"); ?></p>
329
+ <span class="wc_available_variable" data-wpd-clipboard="[SITE_URL]">[SITE_URL]</span>
330
+ <span class="wc_available_variable" data-wpd-clipboard="[POST_URL]">[POST_URL]</span>
331
+ <span class="wc_available_variable" data-wpd-clipboard="[BLOG_TITLE]">[BLOG_TITLE]</span>
332
+ <span class="wc_available_variable" data-wpd-clipboard="[POST_TITLE]">[POST_TITLE]</span>
333
+ <span class="wc_available_variable" data-wpd-clipboard="[SUBSCRIBER_NAME]">[SUBSCRIBER_NAME]</span>
334
+ <p class="wpd-desc"><?php esc_html_e("Shortcodes above will work for registered users only", "wpdiscuz"); ?></p>
335
+ <span class="wc_available_variable" data-wpd-clipboard="[COMMENT_URL]">[COMMENT_URL]</span>
336
+ <span class="wc_available_variable" data-wpd-clipboard="[COMMENT_AUTHOR]">[COMMENT_AUTHOR]</span>
337
+ <span class="wc_available_variable" data-wpd-clipboard="[COMMENT_CONTENT]">[COMMENT_CONTENT]</span>
338
+ <span class="wc_available_variable" data-wpd-clipboard="[UNSUBSCRIBE_URL]">[UNSUBSCRIBE_URL]</span>
339
+ </div>
340
+ <div class="wpd-opt-input">
341
+ <?php
342
+ wp_editor($this->subscription["emailContentAllCommentReply"], "emailContentAllCommentReply", [
343
+ "textarea_name" => WpdiscuzCore::TAB_SUBSCRIPTION . "[emailContentAllCommentReply]",
344
+ "textarea_rows" => 10,
345
+ "teeny" => true,
346
+ "media_buttons" => true,
347
+ "default_editor" => "tmce"
348
+ ]);
349
+ ?>
350
+ </div>
351
+ <div class="wpd-opt-doc">
352
+ <?php $this->printDocLink($setting["options"]["emailContentAllCommentReply"]["docurl"]) ?>
353
+ </div>
354
+ </div>
355
+ <!-- Option end -->
356
+
357
+ <div class="wpd-subtitle wpd-subtitle" style="margin-top: 20px;">
358
+ <?php esc_html_e("Subscription Type: Subscriber's specific comment", "wpdiscuz"); ?>
359
+ </div>
360
+
361
+ <!-- Option start -->
362
+ <div class="wpd-opt-row" data-wpd-opt="emailSubjectCommentReply">
363
+ <div class="wpd-opt-name">
364
+ <label for="emailSubjectCommentReply"><?php esc_html_e($setting["options"]["emailSubjectCommentReply"]["label"]) ?></label>
365
+ <p class="wpd-desc"><?php esc_html_e($setting["options"]["emailSubjectCommentReply"]["description"]) ?></p>
366
+ <p class="wpd-desc"><?php esc_html_e("Available shortcodes", "wpdiscuz"); ?></p>
367
+ <p class="wpd-desc">
368
+ <span class="wc_available_variable" data-wpd-clipboard="[BLOG_TITLE]">[BLOG_TITLE]</span>
369
+ <span class="wc_available_variable" data-wpd-clipboard="[POST_TITLE]">[POST_TITLE]</span>
370
+ <span class="wc_available_variable" data-wpd-clipboard="[COMMENT_AUTHOR]">[COMMENT_AUTHOR]</span>
371
+ </p>
372
+ </div>
373
+ <div class="wpd-opt-input">
374
+ <input type="text" value="<?php esc_attr_e($this->subscription["emailSubjectCommentReply"]); ?>" name="<?php echo WpdiscuzCore::TAB_SUBSCRIPTION; ?>[emailSubjectCommentReply]" id="emailSubjectCommentReply" />
375
+ </div>
376
+ <div class="wpd-opt-doc">
377
+ <?php $this->printDocLink($setting["options"]["emailSubjectCommentReply"]["docurl"]) ?>
378
+ </div>
379
+ </div>
380
+ <!-- Option end -->
381
+
382
+ <!-- Option start -->
383
+ <div class="wpd-opt-row" data-wpd-opt="emailContentCommentReply">
384
+ <div class="wpd-opt-name">
385
+ <label for="emailContentCommentReply"><?php esc_html_e($setting["options"]["emailContentCommentReply"]["label"]) ?></label>
386
+ <p class="wpd-desc"><?php esc_html_e($setting["options"]["emailContentCommentReply"]["description"]) ?></p>
387
+ <p class="wpd-desc"><?php esc_html_e("Available shortcodes", "wpdiscuz"); ?></p>
388
+ <span class="wc_available_variable" data-wpd-clipboard="[SITE_URL]">[SITE_URL]</span>
389
+ <span class="wc_available_variable" data-wpd-clipboard="[POST_URL]">[POST_URL]</span>
390
+ <span class="wc_available_variable" data-wpd-clipboard="[BLOG_TITLE]">[BLOG_TITLE]</span>
391
+ <span class="wc_available_variable" data-wpd-clipboard="[POST_TITLE]">[POST_TITLE]</span>
392
+ <span class="wc_available_variable" data-wpd-clipboard="[SUBSCRIBER_NAME]">[SUBSCRIBER_NAME]</span>
393
+ <p class="wpd-desc"><?php esc_html_e("Shortcodes above will work for registered users only", "wpdiscuz"); ?></p>
394
+ <span class="wc_available_variable" data-wpd-clipboard="[COMMENT_URL]">[COMMENT_URL]</span>
395
+ <span class="wc_available_variable" data-wpd-clipboard="[COMMENT_AUTHOR]">[COMMENT_AUTHOR]</span>
396
+ <span class="wc_available_variable" data-wpd-clipboard="[COMMENT_CONTENT]">[COMMENT_CONTENT]</span>
397
+ <span class="wc_available_variable" data-wpd-clipboard="[UNSUBSCRIBE_URL]">[UNSUBSCRIBE_URL]</span>
398
+ </div>
399
+ <div class="wpd-opt-input">
400
+ <?php
401
+ wp_editor($this->subscription["emailContentCommentReply"], "emailContentCommentReply", [
402
+ "textarea_name" => WpdiscuzCore::TAB_SUBSCRIPTION . "[emailContentCommentReply]",
403
+ "textarea_rows" => 10,
404
+ "teeny" => true,
405
+ "media_buttons" => true,
406
+ "default_editor" => "tmce"
407
+ ]);
408
+ ?>
409
+ </div>
410
+ <div class="wpd-opt-doc">
411
+ <?php $this->printDocLink($setting["options"]["emailContentCommentReply"]["docurl"]) ?>
412
+ </div>
413
+ </div>
414
+ <!-- Option end -->
415
+
416
+ <div class="wpd-subtitle wpd-subtitle" style="margin-top: 20px;">
417
+ <?php esc_html_e("Subscription confirmation", "wpdiscuz"); ?>
418
+ </div>
419
+
420
+ <!-- Option start -->
421
+ <div class="wpd-opt-row" data-wpd-opt="emailSubjectSubscriptionConfirmation">
422
+ <div class="wpd-opt-name">
423
+ <label for="emailSubjectSubscriptionConfirmation"><?php esc_html_e($setting["options"]["emailSubjectSubscriptionConfirmation"]["label"]) ?></label>
424
+ <p class="wpd-desc"><?php esc_html_e($setting["options"]["emailSubjectSubscriptionConfirmation"]["description"]) ?></p>
425
+ <p class="wpd-desc"><?php esc_html_e("Available shortcodes", "wpdiscuz"); ?></p>
426
+ <p class="wpd-desc">
427
+ <span class="wc_available_variable" data-wpd-clipboard="[BLOG_TITLE]">[BLOG_TITLE]</span>
428
+ <span class="wc_available_variable" data-wpd-clipboard="[POST_TITLE]">[POST_TITLE]</span>
429
+ </p>
430
+ </div>
431
+ <div class="wpd-opt-input">
432
+ <input type="text" value="<?php esc_attr_e($this->subscription["emailSubjectSubscriptionConfirmation"]); ?>" name="<?php echo WpdiscuzCore::TAB_SUBSCRIPTION; ?>[emailSubjectSubscriptionConfirmation]" id="emailSubjectSubscriptionConfirmation" />
433
+ </div>
434
+ <div class="wpd-opt-doc">
435
+ <?php $this->printDocLink($setting["options"]["emailSubjectSubscriptionConfirmation"]["docurl"]) ?>
436
+ </div>
437
+ </div>
438
+ <!-- Option end -->
439
+
440
+ <!-- Option start -->
441
+ <div class="wpd-opt-row" data-wpd-opt="emailContentSubscriptionConfirmation">
442
+ <div class="wpd-opt-name">
443
+ <label for="emailContentSubscriptionConfirmation"><?php esc_html_e($setting["options"]["emailContentSubscriptionConfirmation"]["label"]) ?></label>
444
+ <p class="wpd-desc"><?php esc_html_e($setting["options"]["emailContentSubscriptionConfirmation"]["description"]) ?></p>
445
+ <p class="wpd-desc"><?php esc_html_e("Available shortcodes", "wpdiscuz"); ?></p>
446
+ <span class="wc_available_variable" data-wpd-clipboard="[SITE_URL]">[SITE_URL]</span>
447
+ <span class="wc_available_variable" data-wpd-clipboard="[POST_URL]">[POST_URL]</span>
448
+ <span class="wc_available_variable" data-wpd-clipboard="[BLOG_TITLE]">[BLOG_TITLE]</span>
449
+ <span class="wc_available_variable" data-wpd-clipboard="[POST_TITLE]">[POST_TITLE]</span>
450
+ <span class="wc_available_variable" data-wpd-clipboard="[CONFIRM_URL]">[CONFIRM_URL]</span>
451
+ <span class="wc_available_variable" data-wpd-clipboard="[CANCEL_URL]">[CANCEL_URL]</span>
452
+ </div>
453
+ <div class="wpd-opt-input">
454
+ <?php
455
+ wp_editor($this->subscription["emailContentSubscriptionConfirmation"], "emailContentSubscriptionConfirmation", [
456
+ "textarea_name" => WpdiscuzCore::TAB_SUBSCRIPTION . "[emailContentSubscriptionConfirmation]",
457
+ "textarea_rows" => 10,
458
+ "teeny" => true,
459
+ "media_buttons" => true,
460
+ "default_editor" => "tmce"
461
+ ]);
462
+ ?>
463
+ </div>
464
+ <div class="wpd-opt-doc">
465
+ <?php $this->printDocLink($setting["options"]["emailContentSubscriptionConfirmation"]["docurl"]) ?>
466
+ </div>
467
+ </div>
468
+ <!-- Option end -->
469
+
470
+ </div>
471
+
472
+ </div>
473
+
474
+ <div class="wpd-accordion-item">
475
+
476
+ <div class="wpd-subtitle fas wpd-accordion-title" style="margin-top: 20px;" data-wpd-selector="wpd-comment-status-templates">
477
+ <p><?php esc_html_e("Comment status email templates", "wpdiscuz") ?></p>
478
+ </div>
479
+
480
+ <div class="wpd-accordion-content">
481
+
482
+ <div class="wpd-subtitle wpd-subtitle" style="margin-top: 20px;">
483
+ <?php esc_html_e("Approved", "wpdiscuz"); ?>
484
+ </div>
485
+
486
+ <!-- Option start -->
487
+ <div class="wpd-opt-row" data-wpd-opt="emailSubjectCommentApproved">
488
+ <div class="wpd-opt-name">
489
+ <label for="emailSubjectCommentApproved"><?php esc_html_e($setting["options"]["emailSubjectCommentApproved"]["label"]) ?></label>
490
+ <p class="wpd-desc"><?php esc_html_e($setting["options"]["emailSubjectCommentApproved"]["description"]) ?></p>
491
+ <p class="wpd-desc"><?php esc_html_e("Available shortcodes", "wpdiscuz"); ?></p>
492
+ <p class="wpd-desc">
493
+ <span class="wc_available_variable" data-wpd-clipboard="[BLOG_TITLE]">[BLOG_TITLE]</span>
494
+ <span class="wc_available_variable" data-wpd-clipboard="[POST_TITLE]">[POST_TITLE]</span>
495
+ </p>
496
+ </div>
497
+ <div class="wpd-opt-input">
498
+ <input type="text" value="<?php esc_attr_e($this->subscription["emailSubjectCommentApproved"]); ?>" name="<?php echo WpdiscuzCore::TAB_SUBSCRIPTION; ?>[emailSubjectCommentApproved]" id="emailSubjectCommentApproved" />
499
+ </div>
500
+ <div class="wpd-opt-doc">
501
+ <?php $this->printDocLink($setting["options"]["emailSubjectCommentApproved"]["docurl"]) ?>
502
+ </div>
503
+ </div>
504
+ <!-- Option end -->
505
+
506
+ <!-- Option start -->
507
+ <div class="wpd-opt-row" data-wpd-opt="emailContentCommentApproved">
508
+ <div class="wpd-opt-name">
509
+ <label for="emailContentCommentApproved"><?php esc_html_e($setting["options"]["emailContentCommentApproved"]["label"]) ?></label>
510
+ <p class="wpd-desc"><?php esc_html_e($setting["options"]["emailContentCommentApproved"]["description"]) ?></p>
511
+ <p class="wpd-desc"><?php esc_html_e("Available shortcodes", "wpdiscuz"); ?></p>
512
+ <span class="wc_available_variable" data-wpd-clipboard="[SITE_URL]">[SITE_URL]</span>
513
+ <span class="wc_available_variable" data-wpd-clipboard="[POST_URL]">[POST_URL]</span>
514
+ <span class="wc_available_variable" data-wpd-clipboard="[BLOG_TITLE]">[BLOG_TITLE]</span>
515
+ <span class="wc_available_variable" data-wpd-clipboard="[POST_TITLE]">[POST_TITLE]</span>
516
+ <span class="wc_available_variable" data-wpd-clipboard="[COMMENT_URL]">[COMMENT_URL]</span>
517
+ <span class="wc_available_variable" data-wpd-clipboard="[COMMENT_AUTHOR]">[COMMENT_AUTHOR]</span>
518
+ <span class="wc_available_variable" data-wpd-clipboard="[COMMENT_CONTENT]">[COMMENT_CONTENT]</span>
519
+ </div>
520
+ <div class="wpd-opt-input">
521
+ <?php
522
+ wp_editor($this->subscription["emailContentCommentApproved"], "emailContentCommentApproved", [
523
+ "textarea_name" => WpdiscuzCore::TAB_SUBSCRIPTION . "[emailContentCommentApproved]",
524
+ "textarea_rows" => 10,
525
+ "teeny" => true,
526
+ "media_buttons" => true,
527
+ "default_editor" => "tmce"
528
+ ]);
529
+ ?>
530
+ </div>
531
+ <div class="wpd-opt-doc">
532
+ <?php $this->printDocLink($setting["options"]["emailContentCommentApproved"]["docurl"]) ?>
533
+ </div>
534
+ </div>
535
+ <!-- Option end -->
536
+
537
+ </div>
538
+ </div>
539
+
540
+ <div class="wpd-accordion-item">
541
+
542
+ <div class="wpd-subtitle fas wpd-accordion-title" style="margin-top: 20px;" data-wpd-selector="wpd-user-mentioned-templates">
543
+ <p><?php esc_html_e("Mentioning email templates", "wpdiscuz") ?></p>
544
+ </div>
545
+
546
+ <div class="wpd-accordion-content">
547
+
548
+ <div class="wpd-subtitle wpd-subtitle" style="margin-top: 20px;">
549
+ <?php esc_html_e("A user have been mentioned", "wpdiscuz"); ?>
550
+ </div>
551
+
552
+ <!-- Option start -->
553
+ <div class="wpd-opt-row" data-wpd-opt="emailSubjectUserMentioned">
554
+ <div class="wpd-opt-name">
555
+ <label for="emailSubjectUserMentioned"><?php esc_html_e($setting["options"]["emailSubjectUserMentioned"]["label"]) ?></label>
556
+ <p class="wpd-desc"><?php esc_html_e($setting["options"]["emailSubjectUserMentioned"]["description"]) ?></p>
557
+ <p class="wpd-desc"><?php esc_html_e("Available shortcodes", "wpdiscuz"); ?></p>
558
+ <p class="wpd-desc">
559
+ <span class="wc_available_variable" data-wpd-clipboard="[BLOG_TITLE]">[BLOG_TITLE]</span>
560
+ <span class="wc_available_variable" data-wpd-clipboard="[POST_TITLE]">[POST_TITLE]</span>
561
+ </p>
562
+ </div>
563
+ <div class="wpd-opt-input">
564
+ <input type="text" value="<?php esc_attr_e($this->subscription["emailSubjectUserMentioned"]); ?>" name="<?php echo WpdiscuzCore::TAB_SUBSCRIPTION; ?>[emailSubjectUserMentioned]" id="emailSubjectUserMentioned" />
565
+ </div>
566
+ <div class="wpd-opt-doc">
567
+ <?php $this->printDocLink($setting["options"]["emailSubjectUserMentioned"]["docurl"]) ?>
568
+ </div>
569
+ </div>
570
+ <!-- Option end -->
571
+
572
+ <!-- Option start -->
573
+ <div class="wpd-opt-row" data-wpd-opt="emailContentUserMentioned">
574
+ <div class="wpd-opt-name">
575
+ <label for="emailContentUserMentioned"><?php esc_html_e($setting["options"]["emailContentUserMentioned"]["label"]) ?></label>
576
+ <p class="wpd-desc"><?php esc_html_e($setting["options"]["emailContentUserMentioned"]["description"]) ?></p>
577
+ <p class="wpd-desc"><?php esc_html_e("Available shortcodes", "wpdiscuz"); ?></p>
578
+ <span class="wc_available_variable" data-wpd-clipboard="[SITE_URL]">[SITE_URL]</span>
579
+ <span class="wc_available_variable" data-wpd-clipboard="[POST_URL]">[POST_URL]</span>
580
+ <span class="wc_available_variable" data-wpd-clipboard="[BLOG_TITLE]">[BLOG_TITLE]</span>
581
+ <span class="wc_available_variable" data-wpd-clipboard="[POST_TITLE]">[POST_TITLE]</span>
582
+ <span class="wc_available_variable" data-wpd-clipboard="[COMMENT_URL]">[COMMENT_URL]</span>
583
+ <span class="wc_available_variable" data-wpd-clipboard="[COMMENT_AUTHOR]">[COMMENT_AUTHOR]</span>
584
+ <span class="wc_available_variable" data-wpd-clipboard="[MENTIONED_USER_NAME]">[MENTIONED_USER_NAME]</span>
585
+ </div>
586
+ <div class="wpd-opt-input">
587
+ <?php
588
+ wp_editor($this->subscription["emailContentUserMentioned"], "emailContentUserMentioned", [
589
+ "textarea_name" => WpdiscuzCore::TAB_SUBSCRIPTION . "[emailContentUserMentioned]",
590
+ "textarea_rows" => 10,
591
+ "teeny" => true,
592
+ "media_buttons" => true,
593
+ "default_editor" => "tmce"
594
+ ]);
595
+ ?>
596
+ </div>
597
+ <div class="wpd-opt-doc">
598
+ <?php $this->printDocLink($setting["options"]["emailContentUserMentioned"]["docurl"]) ?>
599
+ </div>
600
+ </div>
601
+ <!-- Option end -->
602
+
603
+ </div>
604
+ </div>
605
+
606
+ <div class="wpd-accordion-item">
607
+
608
+ <div class="wpd-subtitle fas wpd-accordion-title" style="margin-top: 20px;" data-wpd-selector="wpd-follow-templates">
609
+ <p><?php esc_html_e("Follow email templates", "wpdiscuz") ?></p>
610
+ </div>
611
+
612
+ <div class="wpd-accordion-content">
613
+
614
+ <div class="wpd-subtitle wpd-subtitle" style="margin-top: 20px;">
615
+ <?php esc_html_e("Follow confirmation", "wpdiscuz"); ?>
616
+ </div>
617
+
618
+ <!-- Option start -->
619
+ <div class="wpd-opt-row" data-wpd-opt="emailSubjectFollowConfirmation">
620
+ <div class="wpd-opt-name">
621
+ <label for="emailSubjectFollowConfirmation"><?php esc_html_e($setting["options"]["emailSubjectFollowConfirmation"]["label"]) ?></label>
622
+ <p class="wpd-desc"><?php esc_html_e($setting["options"]["emailSubjectFollowConfirmation"]["description"]) ?></p>
623
+ <p class="wpd-desc"><?php esc_html_e("Available shortcodes", "wpdiscuz"); ?></p>
624
+ <p class="wpd-desc">
625
+ <span class="wc_available_variable" data-wpd-clipboard="[BLOG_TITLE]">[BLOG_TITLE]</span>
626
+ <span class="wc_available_variable" data-wpd-clipboard="[POST_TITLE]">[POST_TITLE]</span>
627
+ </p>
628
+ </div>
629
+ <div class="wpd-opt-input">
630
+ <input type="text" value="<?php esc_attr_e($this->subscription["emailSubjectFollowConfirmation"]); ?>" name="<?php echo WpdiscuzCore::TAB_SUBSCRIPTION; ?>[emailSubjectFollowConfirmation]" id="emailSubjectFollowConfirmation" />
631
+ </div>
632
+ <div class="wpd-opt-doc">
633
+ <?php $this->printDocLink($setting["options"]["emailSubjectFollowConfirmation"]["docurl"]) ?>
634
+ </div>
635
+ </div>
636
+ <!-- Option end -->
637
+
638
+ <!-- Option start -->
639
+ <div class="wpd-opt-row" data-wpd-opt="emailContentFollowConfirmation">
640
+ <div class="wpd-opt-name">
641
+ <label for="emailContentFollowConfirmation"><?php esc_html_e($setting["options"]["emailContentFollowConfirmation"]["label"]) ?></label>
642
+ <p class="wpd-desc"><?php esc_html_e($setting["options"]["emailContentFollowConfirmation"]["description"]) ?></p>
643
+ <p class="wpd-desc"><?php esc_html_e("Available shortcodes", "wpdiscuz"); ?></p>
644
+ <span class="wc_available_variable" data-wpd-clipboard="[SITE_URL]">[SITE_URL]</span>
645
+ <span class="wc_available_variable" data-wpd-clipboard="[POST_URL]">[POST_URL]</span>
646
+ <span class="wc_available_variable" data-wpd-clipboard="[BLOG_TITLE]">[BLOG_TITLE]</span>
647
+ <span class="wc_available_variable" data-wpd-clipboard="[POST_TITLE]">[POST_TITLE]</span>
648
+ <span class="wc_available_variable" data-wpd-clipboard="[CONFIRM_URL]">[CONFIRM_URL]</span>
649
+ <span class="wc_available_variable" data-wpd-clipboard="[CANCEL_URL]">[CANCEL_URL]</span>
650
+ </div>
651
+ <div class="wpd-opt-input">
652
+ <?php
653
+ wp_editor($this->subscription["emailContentFollowConfirmation"], "emailContentFollowConfirmation", [
654
+ "textarea_name" => WpdiscuzCore::TAB_SUBSCRIPTION . "[emailContentFollowConfirmation]",
655
+ "textarea_rows" => 10,
656
+ "teeny" => true,
657
+ "media_buttons" => true,
658
+ "default_editor" => "tmce"
659
+ ]);
660
+ ?>
661
+ </div>
662
+ <div class="wpd-opt-doc">
663
+ <?php $this->printDocLink($setting["options"]["emailContentFollowConfirmation"]["docurl"]) ?>
664
+ </div>
665
+ </div>
666
+ <!-- Option end -->
667
+
668
+ <div class="wpd-subtitle wpd-subtitle" style="margin-top: 20px;">
669
+ <?php esc_html_e("Following comment", "wpdiscuz"); ?>
670
+ </div>
671
+
672
+ <!-- Option start -->
673
+ <div class="wpd-opt-row" data-wpd-opt="emailSubjectFollowComment">
674
+ <div class="wpd-opt-name">
675
+ <label for="emailSubjectFollowComment"><?php esc_html_e($setting["options"]["emailSubjectFollowComment"]["label"]) ?></label>
676
+ <p class="wpd-desc"><?php esc_html_e($setting["options"]["emailSubjectFollowComment"]["description"]) ?></p>
677
+ <p class="wpd-desc"><?php esc_html_e("Available shortcodes", "wpdiscuz"); ?></p>
678
+ <p class="wpd-desc">
679
+ <span class="wc_available_variable" data-wpd-clipboard="[BLOG_TITLE]">[BLOG_TITLE]</span>
680
+ <span class="wc_available_variable" data-wpd-clipboard="[POST_TITLE]">[POST_TITLE]</span>
681
+ <span class="wc_available_variable" data-wpd-clipboard="[COMMENT_AUTHOR]">[COMMENT_AUTHOR]</span>
682
+ </p>
683
+ </div>
684
+ <div class="wpd-opt-input">
685
+ <input type="text" value="<?php esc_attr_e($this->subscription["emailSubjectFollowComment"]); ?>" name="<?php echo WpdiscuzCore::TAB_SUBSCRIPTION; ?>[emailSubjectFollowComment]" id="emailSubjectFollowComment" />
686
+ </div>
687
+ <div class="wpd-opt-doc">
688
+ <?php $this->printDocLink($setting["options"]["emailSubjectFollowComment"]["docurl"]) ?>
689
+ </div>
690
+ </div>
691
+ <!-- Option end -->
692
+
693
+ <!-- Option start -->
694
+ <div class="wpd-opt-row" data-wpd-opt="emailContentFollowComment">
695
+ <div class="wpd-opt-name">
696
+ <label for="emailContentFollowComment"><?php esc_html_e($setting["options"]["emailContentFollowComment"]["label"]) ?></label>
697
+ <p class="wpd-desc"><?php esc_html_e($setting["options"]["emailContentFollowComment"]["description"]) ?></p>
698
+ <p class="wpd-desc"><?php esc_html_e("Available shortcodes", "wpdiscuz"); ?></p>
699
+ <span class="wc_available_variable" data-wpd-clipboard="[SITE_URL]">[SITE_URL]</span>
700
+ <span class="wc_available_variable" data-wpd-clipboard="[POST_URL]">[POST_URL]</span>
701
+ <span class="wc_available_variable" data-wpd-clipboard="[BLOG_TITLE]">[BLOG_TITLE]</span>
702
+ <span class="wc_available_variable" data-wpd-clipboard="[POST_TITLE]">[POST_TITLE]</span>
703
+ <span class="wc_available_variable" data-wpd-clipboard="[FOLLOWER_NAME]">[FOLLOWER_NAME]</span>
704
+ <span class="wc_available_variable" data-wpd-clipboard="[COMMENT_URL]">[COMMENT_URL]</span>
705
+ <span class="wc_available_variable" data-wpd-clipboard="[COMMENT_AUTHOR]">[COMMENT_AUTHOR]</span>
706
+ <span class="wc_available_variable" data-wpd-clipboard="[COMMENT_CONTENT]">[COMMENT_CONTENT]</span>
707
+ <span class="wc_available_variable" data-wpd-clipboard="[CANCEL_URL]">[CANCEL_URL]</span>
708
+ </div>
709
+ <div class="wpd-opt-input">
710
+ <?php
711
+ wp_editor($this->subscription["emailContentFollowComment"], "emailContentFollowComment", [
712
+ "textarea_name" => WpdiscuzCore::TAB_SUBSCRIPTION . "[emailContentFollowComment]",
713
+ "textarea_rows" => 10,
714
+ "teeny" => true,
715
+ "media_buttons" => true,
716
+ "default_editor" => "tmce"
717
+ ]);
718
+ ?>
719
+ </div>
720
+ <div class="wpd-opt-doc">
721
+ <?php $this->printDocLink($setting["options"]["emailContentFollowComment"]["docurl"]) ?>
722
+ </div>
723
+ </div>
724
+ <!-- Option end -->
725
+
726
+ </div>
727
+
728
+ </div>
729
+
730
+ </div>
731
 
732
 
options/phrases-layouts/phrases-form.php CHANGED
@@ -51,10 +51,6 @@ if (!defined("ABSPATH")) {
51
  <th scope="row"><label for="wc_notify_on_new_reply"><?php esc_html_e("Notify on new replies to this comment", "wpdiscuz"); ?></label></th>
52
  <td colspan="3"><input type="text" value="<?php echo esc_attr($this->phrases["wc_notify_on_new_reply"]); ?>" name="wc_notify_on_new_reply" id="wc_notify_on_new_reply" /></td>
53
  </tr>
54
- <tr valign="top">
55
- <th scope="row"><label for="wc_sort_by"><?php esc_html_e("Sort by", "wpdiscuz"); ?></label></th>
56
- <td colspan="3"><input type="text" value="<?php echo esc_attr($this->phrases["wc_sort_by"]); ?>" name="wc_sort_by" id="wc_sort_by" /></td>
57
- </tr>
58
  <tr valign="top">
59
  <th scope="row"><label for="wc_newest"><?php esc_html_e("Newest", "wpdiscuz"); ?></label></th>
60
  <td colspan="3"><input type="text" value="<?php echo esc_attr($this->phrases["wc_newest"]); ?>" name="wc_newest" id="wc_newest" /></td>
51
  <th scope="row"><label for="wc_notify_on_new_reply"><?php esc_html_e("Notify on new replies to this comment", "wpdiscuz"); ?></label></th>
52
  <td colspan="3"><input type="text" value="<?php echo esc_attr($this->phrases["wc_notify_on_new_reply"]); ?>" name="wc_notify_on_new_reply" id="wc_notify_on_new_reply" /></td>
53
  </tr>
 
 
 
 
54
  <tr valign="top">
55
  <th scope="row"><label for="wc_newest"><?php esc_html_e("Newest", "wpdiscuz"); ?></label></th>
56
  <td colspan="3"><input type="text" value="<?php echo esc_attr($this->phrases["wc_newest"]); ?>" name="wc_newest" id="wc_newest" /></td>
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: gVectors Team
3
  Tags: comment, comments, ajax comments, comment form, comment fields
4
  Requires at least: 5.0
5
- Tested up to: 5.9
6
- Stable tag: 7.3.17
7
  Requires PHP: 5.6 and higher
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
@@ -185,16 +185,33 @@ Nothing will be lost! **Comments - wpDiscuz** will show all old comments.
185
 
186
  == Changelog ==
187
 
188
- = Comments - wpDiscuz v7.3.17 - 30.03.2022 =
189
 
190
- * Fixed Bug: Conflict with Redis based cache plugins
191
- * Fixed Bug: Conflict with Memcached based cache plugins
 
 
 
 
 
 
 
 
 
 
 
 
 
192
 
193
  **IMPORTANT!**
194
 
195
  * Please don't forget delete all caches and purge CDN after the update.
196
 
197
 
 
 
 
 
 
198
 
199
  = Comments - wpDiscuz v7.3.16 - 19.03.2022 =
200
 
2
  Contributors: gVectors Team
3
  Tags: comment, comments, ajax comments, comment form, comment fields
4
  Requires at least: 5.0
5
+ Tested up to: 6.0
6
+ Stable tag: 7.3.18
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
 
189
+ = Comments - wpDiscuz v7.3.18 - 14.06.2022 =
190
+
191
+ * Added: Preventing multiple clicks on subscription button
192
+ * Fixed Bug: Problem with comments Lazy Loading of mobile devices
193
+ * Fixed Bug: jQuery events not triggered
194
+ * Fixed Bug: Problem with most reacted comment
195
+ * Fixed Bug: Cache conflict with voting buttons highlighting
196
+ * Fixed Bug: Problems with Subscription, Follow and other notification messages
197
+ * Fixed Bug: Untranslated UI element, reply button in the bubble notification area
198
+ * Fixed Bug: PHP Error: Undefined variable $options in sanitizer function
199
+ * Fixed Bug: Warning - Illegal string offset 'enable_post_rating'
200
+ * Fixed Bug: PHP Fatal error: Cannot use string offset as an array in class.WpdiscuzWalker.php:45
201
+ * Fixed Bug: PHP Fatal error: array_key_exists() in Form.php (when creating a new form)
202
+ * Fixed Bug: PHP Fatal error: Call to a member function get_children() on null in class.WpdiscuzHelper.php:421
203
+
204
 
205
  **IMPORTANT!**
206
 
207
  * Please don't forget delete all caches and purge CDN after the update.
208
 
209
 
210
+ = Comments - wpDiscuz v7.3.17 - 30.03.2022 =
211
+
212
+ * Fixed Bug: Conflict with Redis based cache plugins
213
+ * Fixed Bug: Conflict with Memcached based cache plugins
214
+
215
 
216
  = Comments - wpDiscuz v7.3.16 - 19.03.2022 =
217
 
themes/default/class.WpdiscuzWalker.php CHANGED
@@ -36,7 +36,7 @@ class WpdiscuzWalker extends Walker_Comment implements WpDiscuzConstants {
36
  $commentOutput = "";
37
  $depth = isset($args["addComment"]) ? $args["addComment"] : $depth;
38
  $uniqueId = $comment->comment_ID . "_" . $comment->comment_parent;
39
- $commentWrapperClass = ["wpd-comment"];
40
  $commentWrapClass = ["wpd-comment-wrap"];
41
 
42
  if (isset($this->extra[$comment->comment_ID]["metas"])) {
36
  $commentOutput = "";
37
  $depth = isset($args["addComment"]) ? $args["addComment"] : $depth;
38
  $uniqueId = $comment->comment_ID . "_" . $comment->comment_parent;
39
+ $commentWrapperClass = get_comment_class("wpd-comment",$comment->comment_ID, $comment->comment_post_ID);
40
  $commentWrapClass = ["wpd-comment-wrap"];
41
 
42
  if (isset($this->extra[$comment->comment_ID]["metas"])) {
themes/default/comment-form.php CHANGED
@@ -275,7 +275,7 @@ if (!post_password_required($post->ID) && $load) {
275
  }
276
  ?>
277
  <div class="wpdiscuz-subscribe-form-button">
278
- <input id="wpdiscuz_subscription_button" class="wpd-prim-button" type="submit" value="<?php echo esc_attr($wpdiscuz->options->getPhrase("wc_form_subscription_submit")); ?>" name="wpdiscuz_subscription_button" />
279
  </div>
280
  <?php
281
  if (!$currentUser->ID && $form->isShowSubscriptionBarAgreement()) {
@@ -459,7 +459,7 @@ if (!post_password_required($post->ID) && $load) {
459
  <?php esc_html_e($loadMoreButtonText); ?>
460
  </button>
461
  </div>
462
- <input id="wpdiscuzHasMoreComments" type="hidden" value="0" />
463
  <?php
464
  } else if ($commentData["is_show_load_more"]) {
465
  $loadMoreButtonText = $wpdiscuz->options->thread_display["commentListLoadType"] == 1 ? $wpdiscuz->options->getPhrase("wc_load_rest_comments_submit_text") : $wpdiscuz->options->getPhrase("wc_load_more_submit_text");
@@ -482,7 +482,7 @@ if (!post_password_required($post->ID) && $load) {
482
  ?>
483
  </button>
484
  </div>
485
- <input id="wpdiscuzHasMoreComments" type="hidden" value="<?php echo esc_attr($commentData["is_show_load_more"]); ?>" />
486
  <?php
487
  }
488
  ?>
275
  }
276
  ?>
277
  <div class="wpdiscuz-subscribe-form-button">
278
+ <input id="wpdiscuz_subscription_button" class="wpd-prim-button wpd_not_clicked" type="submit" value="<?php echo esc_attr($wpdiscuz->options->getPhrase("wc_form_subscription_submit")); ?>" name="wpdiscuz_subscription_button" />
279
  </div>
280
  <?php
281
  if (!$currentUser->ID && $form->isShowSubscriptionBarAgreement()) {
459
  <?php esc_html_e($loadMoreButtonText); ?>
460
  </button>
461
  </div>
462
+ <span id="wpdiscuzHasMoreComments" data-is_show_load_more="0"></span>
463
  <?php
464
  } else if ($commentData["is_show_load_more"]) {
465
  $loadMoreButtonText = $wpdiscuz->options->thread_display["commentListLoadType"] == 1 ? $wpdiscuz->options->getPhrase("wc_load_rest_comments_submit_text") : $wpdiscuz->options->getPhrase("wc_load_more_submit_text");
482
  ?>
483
  </button>
484
  </div>
485
+ <span id="wpdiscuzHasMoreComments" data-is_show_load_more="<?php echo esc_attr($commentData["is_show_load_more"]); ?>"></span>
486
  <?php
487
  }
488
  ?>
utils/class.WpdiscuzCache.php CHANGED
@@ -124,7 +124,7 @@ class WpdiscuzCache implements WpDiscuzConstants {
124
  @unlink($fileInfo["path"]);
125
  return [];
126
  }
127
- if (is_readable($fileInfo["path"]) && ($cache = maybe_unserialize(file_get_contents($fileInfo["path"])))) {
128
  return $cache;
129
  }
130
  }
124
  @unlink($fileInfo["path"]);
125
  return [];
126
  }
127
+ if (is_readable($fileInfo["path"]) && ($cache = maybe_unserialize(file_get_contents($fileInfo["path"]))) && is_array($cache)) {
128
  return $cache;
129
  }
130
  }
utils/class.WpdiscuzHelper.php CHANGED
@@ -413,6 +413,9 @@ class WpdiscuzHelper implements WpDiscuzConstants {
413
  }
414
 
415
  public function canUserEditComment($comment, $currentUser, $commentListArgs = []) {
 
 
 
416
  if (isset($commentListArgs["comment_author_email"])) {
417
  $storedCookieEmail = $commentListArgs["comment_author_email"];
418
  } else {
413
  }
414
 
415
  public function canUserEditComment($comment, $currentUser, $commentListArgs = []) {
416
+ if(!($comment instanceof WP_Comment)){
417
+ return false;
418
+ }
419
  if (isset($commentListArgs["comment_author_email"])) {
420
  $storedCookieEmail = $commentListArgs["comment_author_email"];
421
  } else {
utils/class.WpdiscuzHelperEmail.php CHANGED
@@ -6,8 +6,19 @@ if (!defined("ABSPATH")) {
6
 
7
  class WpdiscuzHelperEmail implements WpDiscuzConstants {
8
 
 
 
 
9
  private $options;
 
 
 
 
10
  private $dbManager;
 
 
 
 
11
  private $helper;
12
 
13
  public function __construct($options, $dbManager, $helper) {
@@ -24,7 +35,7 @@ class WpdiscuzHelperEmail implements WpDiscuzConstants {
24
  public function addSubscription() {
25
  $success = 0;
26
  $currentUser = WpdiscuzHelper::getCurrentUser();
27
- $subscribeFormNonce = WpdiscuzHelper::sanitize(INPUT_POST, "wpdiscuz_subscribe_form_nonce","FILTER_SANITIZE_STRING");
28
  $subscriptionType = WpdiscuzHelper::sanitize(INPUT_POST, "wpdiscuzSubscriptionType", "FILTER_SANITIZE_STRING");
29
  $postId = WpdiscuzHelper::sanitize(INPUT_POST, "postId", FILTER_SANITIZE_NUMBER_INT);
30
  $showSubscriptionBarAgreement = WpdiscuzHelper::sanitize(INPUT_POST, "show_subscription_agreement", FILTER_SANITIZE_NUMBER_INT);
@@ -85,9 +96,9 @@ class WpdiscuzHelperEmail implements WpDiscuzConstants {
85
 
86
  $search = ["[SITE_URL]", "[POST_URL]", "[BLOG_TITLE]", "[POST_TITLE]"];
87
  $replace = [$siteUrl, get_permalink($postId), $blogTitle, $postTitle];
88
- $message = str_replace($search, $replace, $this->options->getPhrase("wc_confirm_email_message"));
89
 
90
- $subject = str_replace(["[BLOG_TITLE]", "[POST_TITLE]"], [$blogTitle, $postTitle], $this->options->getPhrase("wc_confirm_email_subject"));
 
91
 
92
  if (strpos($message, "[CONFIRM_URL]") === false) {
93
  $message .= "<br/><br/><a href='$confirm_url'>" . $this->options->getPhrase("wc_confirm_email") . "</a>";
@@ -172,7 +183,8 @@ class WpdiscuzHelperEmail implements WpDiscuzConstants {
172
  * Check notification type and send email to post new comments subscribers
173
  */
174
  public function checkNotificationType() {
175
- $postId = WpdiscuzHelper::sanitize(INPUT_POST, "postId", FILTER_SANITIZE_NUMBER_INT, 0);;
 
176
  $commentId = WpdiscuzHelper::sanitize(INPUT_POST, "comment_id", FILTER_SANITIZE_NUMBER_INT, 0);
177
  $email = isset($_POST["email"]) ? sanitize_email(trim($_POST["email"])) : "";
178
  $isParent = WpdiscuzHelper::sanitize(INPUT_POST, "isParent", "FILTER_SANITIZE_STRING");
@@ -181,10 +193,10 @@ class WpdiscuzHelperEmail implements WpDiscuzConstants {
181
  $email = $currentUser->user_email;
182
  }
183
  if ($commentId && $email && $postId && ($comment = get_comment($commentId))) {
184
- if (apply_filters("wpdiscuz_enable_user_mentioning", $this->options->subscription["enableUserMentioning"]) && $this->options->subscription["sendMailToMentionedUsers"] && ($mentionedUsers = $this->helper->getMentionedUsers($comment->comment_content))) {
185
- $this->sendMailToMentionedUsers($mentionedUsers, $comment);
186
- }
187
- do_action("wpdiscuz_before_sending_emails", $commentId, $comment);
188
  $this->notifyPostSubscribers($postId, $commentId, $email);
189
  $this->notifyFollowers($postId, $commentId, $email);
190
  if (!$isParent) {
@@ -209,8 +221,8 @@ class WpdiscuzHelperEmail implements WpDiscuzConstants {
209
  */
210
  public function notifyPostSubscribers($postId, $commentId, $email) {
211
  $emailsArray = $this->dbManager->getPostNewCommentNotification($postId, $email);
212
- $subject = $this->options->getPhrase("wc_email_subject");
213
- $message = $this->options->getPhrase("wc_email_message");
214
  foreach ($emailsArray as $k => $eRow) {
215
  $subscriberUserId = $eRow["id"];
216
  $subscriberEmail = $eRow["email"];
@@ -228,8 +240,8 @@ class WpdiscuzHelperEmail implements WpDiscuzConstants {
228
  */
229
  public function notifyAllCommentSubscribers($postId, $newCommentId, $email) {
230
  $emailsArray = $this->dbManager->getAllNewCommentNotification($postId, $email);
231
- $subject = $this->options->getPhrase("wc_all_comment_new_reply_subject");
232
- $message = $this->options->getPhrase("wc_all_comment_new_reply_message");
233
  foreach ($emailsArray as $k => $eRow) {
234
  $subscriberUserId = $eRow["id"];
235
  $subscriberEmail = $eRow["email"];
@@ -248,8 +260,8 @@ class WpdiscuzHelperEmail implements WpDiscuzConstants {
248
  */
249
  public function notifyCommentSubscribers($parentCommentId, $newCommentId, $email) {
250
  $emailsArray = $this->dbManager->getNewReplyNotification($parentCommentId, $email);
251
- $subject = $this->options->getPhrase("wc_new_reply_email_subject");
252
- $message = $this->options->getPhrase("wc_new_reply_email_message");
253
  foreach ($emailsArray as $k => $eRow) {
254
  $subscriberUserId = $eRow["id"];
255
  $subscriberEmail = $eRow["email"];
@@ -280,10 +292,10 @@ class WpdiscuzHelperEmail implements WpDiscuzConstants {
280
  $postId = $comment->comment_post_ID;
281
  $email = $comment->comment_author_email;
282
  $parentComment = $comment->comment_parent ? get_comment($comment->comment_parent) : 0;
283
- if (apply_filters("wpdiscuz_enable_user_mentioning", $this->options->subscription["enableUserMentioning"]) && $this->options->subscription["sendMailToMentionedUsers"] && ($mentionedUsers = $this->helper->getMentionedUsers($comment->comment_content))) {
284
- $this->sendMailToMentionedUsers($mentionedUsers, $comment);
285
- }
286
- do_action("wpdiscuz_before_sending_emails", $commentId, $comment);
287
  $this->notifyPostSubscribers($postId, $commentId, $email);
288
  if ($parentComment) {
289
  $parentCommentEmail = $parentComment->comment_author_email;
@@ -316,26 +328,28 @@ class WpdiscuzHelperEmail implements WpDiscuzConstants {
316
  } else {
317
  $email = $comment->comment_author_email;
318
  }
319
- if (apply_filters("wpdiscuz_send_email_on_approving", true, $email, $comment)) {
320
- $siteUrl = get_site_url();
321
- $blogTitle = get_option("blogname");
322
- $postTitle = get_the_title($comment->comment_post_ID);
323
- $search = ["[SITE_URL]", "[POST_URL]", "[BLOG_TITLE]", "[POST_TITLE]", "[COMMENT_URL]", "[COMMENT_AUTHOR]", "[COMMENT_CONTENT]"];
324
- $replace = [$siteUrl, get_permalink($comment->comment_post_ID), $blogTitle, $postTitle, get_comment_link($comment->comment_ID), $comment->comment_author, wpautop($comment->comment_content)];
325
- $message = str_replace($search, $replace, $this->options->getPhrase("wc_comment_approved_email_message", ["comment" => $comment]));
326
-
327
- $subject = str_replace(["[BLOG_TITLE]", "[POST_TITLE]", "[COMMENT_AUTHOR]"], [$blogTitle, $postTitle, $comment->comment_author], $this->options->getPhrase("wc_comment_approved_email_subject", ["comment" => $comment]));
328
- $headers = [];
329
- $fromName = html_entity_decode($blogTitle, ENT_QUOTES);
330
- $parsedUrl = parse_url($siteUrl);
331
- $domain = isset($parsedUrl["host"]) ? WpdiscuzHelper::fixEmailFrom($parsedUrl["host"]) : "";
332
- $fromEmail = "no-reply@" . $domain;
333
- $headers[] = "Content-Type: text/html; charset=UTF-8";
334
- $headers[] = "From: " . $fromName . " <" . $fromEmail . "> \r\n";
335
- $subject = html_entity_decode($subject, ENT_QUOTES);
336
- $message = html_entity_decode($message, ENT_QUOTES);
337
- wp_mail($email, $subject, do_shortcode($message), $headers);
338
- }
 
 
339
  }
340
  }
341
  }
@@ -348,9 +362,9 @@ class WpdiscuzHelperEmail implements WpDiscuzConstants {
348
  $postTitle = get_the_title($postId);
349
  $search = ["[SITE_URL]", "[POST_URL]", "[BLOG_TITLE]", "[POST_TITLE]"];
350
  $replace = [$siteUrl, get_permalink($postId), $blogTitle, $postTitle];
351
- $message = str_replace($search, $replace, $this->options->getPhrase("wc_follow_confirm_email_message"));
352
 
353
- $subject = str_replace(["[BLOG_TITLE]", "[POST_TITLE]"], [$blogTitle, $postTitle], $this->options->getPhrase("wc_follow_confirm_email_subject"));
 
354
 
355
  if (strpos($message, "[CONFIRM_URL]") === false) {
356
  $message .= "<br/><br/><a href='$confirmUrl'>" . $this->options->getPhrase("wc_follow_confirm") . "</a>";
@@ -391,11 +405,12 @@ class WpdiscuzHelperEmail implements WpDiscuzConstants {
391
  $postUrl = get_permalink($post);
392
  $commentUrl = get_comment_link($comment);
393
 
394
- $subject = str_replace(["[BLOG_TITLE]", "[POST_TITLE]"], [$blogTitle, $postTitle], $this->options->getPhrase("wc_follow_email_subject"));
395
 
396
  $search = ["[SITE_URL]", "[POST_URL]", "[BLOG_TITLE]", "[POST_TITLE]", "[COMMENT_URL]", "[COMMENT_CONTENT]"];
397
  $replace = [$siteUrl, $postUrl, $blogTitle, $postTitle, $commentUrl, wpautop($comment->comment_content)];
398
- $message = str_replace($search, $replace, $this->options->getPhrase("wc_follow_email_message"));
 
399
  global $wp_rewrite;
400
  $cancelLink = !$wp_rewrite->using_permalinks() ? $postUrl . "&" : $postUrl . "?";
401
  $fromName = html_entity_decode($blogTitle, ENT_QUOTES);
@@ -414,7 +429,7 @@ class WpdiscuzHelperEmail implements WpDiscuzConstants {
414
  if (($followerData["follower_email"] === $postAuthor->user_email) && (($moderationNotify && $comment->comment_approved === "0") || ($commentsNotify && $comment->comment_approved === "1"))) {
415
  return;
416
  }
417
- $subject = str_replace(["[COMMENT_AUTHOR]"], [$followerData["user_name"]], $this->options->getPhrase("wc_follow_email_subject"));
418
  $body = str_replace(["[COMMENT_AUTHOR]", "[FOLLOWER_NAME]"], [$followerData["user_name"], $followerData["follower_name"]], $message);
419
  $this->emailToFollower($followerData, $comment, $subject, $body, $cancelLink, $data);
420
  do_action("wpdiscuz_notify_followers", $comment, $followerData);
@@ -440,27 +455,39 @@ class WpdiscuzHelperEmail implements WpDiscuzConstants {
440
  }
441
  }
442
 
443
- public function sendMailToMentionedUsers($users, $comment_data) {
 
 
444
  $parsedUrl = parse_url(get_site_url());
445
  $domain = isset($parsedUrl["host"]) ? WpdiscuzHelper::fixEmailFrom($parsedUrl["host"]) : "";
446
  $fromEmail = "no-reply@" . $domain;
447
  $fromName = html_entity_decode(get_option("blogname"), ENT_QUOTES);
448
  $headers[] = "Content-Type: text/html; charset=UTF-8";
449
  $headers[] = "From: " . $fromName . " <" . $fromEmail . "> \r\n";
450
- $subject = $this->options->getPhrase("wc_mentioned_email_subject");
451
- $message = $this->options->getPhrase("wc_mentioned_email_message");
452
- $search = ["[MENTIONED_USER_NAME]", "[POST_TITLE]", "[COMMENT_URL]", "[COMMENT_AUTHOR]"];
453
- $replace = ["", get_the_title($comment_data->comment_post_ID), get_comment_link($comment_data->comment_ID), $comment_data->comment_author];
 
 
 
 
 
 
 
 
 
 
454
  foreach ($users as $k => $user) {
455
- if ($user["email"] !== $comment_data->comment_author_email) {
456
- if (apply_filters("wpducm_mail_to_mentioned_user", true, $user, $comment_data)) {
457
- $replace[0] = $user["name"];
458
  $body = str_replace($search, $replace, $message);
459
- $subject = apply_filters("wpdiscuz_mentioned_user_mail_subject", $subject, $user, $comment_data);
460
- $body = apply_filters("wpdiscuz_mentioned_user_mail_body", $body, $user, $comment_data);
461
  if ($subject && $body) {
462
- wp_mail($user["email"], $subject, $body, $headers);
463
- }
464
  }
465
  }
466
  }
6
 
7
  class WpdiscuzHelperEmail implements WpDiscuzConstants {
8
 
9
+ /**
10
+ * @var WpdiscuzOptions
11
+ */
12
  private $options;
13
+
14
+ /**
15
+ * @var WpdiscuzDBManager
16
+ */
17
  private $dbManager;
18
+
19
+ /**
20
+ * @var WpdiscuzHelper
21
+ */
22
  private $helper;
23
 
24
  public function __construct($options, $dbManager, $helper) {
35
  public function addSubscription() {
36
  $success = 0;
37
  $currentUser = WpdiscuzHelper::getCurrentUser();
38
+ $subscribeFormNonce = WpdiscuzHelper::sanitize(INPUT_POST, "wpdiscuz_subscribe_form_nonce", "FILTER_SANITIZE_STRING");
39
  $subscriptionType = WpdiscuzHelper::sanitize(INPUT_POST, "wpdiscuzSubscriptionType", "FILTER_SANITIZE_STRING");
40
  $postId = WpdiscuzHelper::sanitize(INPUT_POST, "postId", FILTER_SANITIZE_NUMBER_INT);
41
  $showSubscriptionBarAgreement = WpdiscuzHelper::sanitize(INPUT_POST, "show_subscription_agreement", FILTER_SANITIZE_NUMBER_INT);
96
 
97
  $search = ["[SITE_URL]", "[POST_URL]", "[BLOG_TITLE]", "[POST_TITLE]"];
98
  $replace = [$siteUrl, get_permalink($postId), $blogTitle, $postTitle];
 
99
 
100
+ $subject = str_replace(["[BLOG_TITLE]", "[POST_TITLE]"], [$blogTitle, $postTitle], $this->options->subscription["emailSubjectSubscriptionConfirmation"]);
101
+ $message = str_replace($search, $replace, wpautop($this->options->subscription["emailContentSubscriptionConfirmation"]));
102
 
103
  if (strpos($message, "[CONFIRM_URL]") === false) {
104
  $message .= "<br/><br/><a href='$confirm_url'>" . $this->options->getPhrase("wc_confirm_email") . "</a>";
183
  * Check notification type and send email to post new comments subscribers
184
  */
185
  public function checkNotificationType() {
186
+ $postId = WpdiscuzHelper::sanitize(INPUT_POST, "postId", FILTER_SANITIZE_NUMBER_INT, 0);
187
+ ;
188
  $commentId = WpdiscuzHelper::sanitize(INPUT_POST, "comment_id", FILTER_SANITIZE_NUMBER_INT, 0);
189
  $email = isset($_POST["email"]) ? sanitize_email(trim($_POST["email"])) : "";
190
  $isParent = WpdiscuzHelper::sanitize(INPUT_POST, "isParent", "FILTER_SANITIZE_STRING");
193
  $email = $currentUser->user_email;
194
  }
195
  if ($commentId && $email && $postId && ($comment = get_comment($commentId))) {
196
+ if (apply_filters("wpdiscuz_enable_user_mentioning", $this->options->subscription["enableUserMentioning"]) && $this->options->subscription["sendMailToMentionedUsers"] && ($mentionedUsers = $this->helper->getMentionedUsers($comment->comment_content))) {
197
+ $this->sendMailToMentionedUsers($mentionedUsers, $comment);
198
+ }
199
+ do_action("wpdiscuz_before_sending_emails", $commentId, $comment);
200
  $this->notifyPostSubscribers($postId, $commentId, $email);
201
  $this->notifyFollowers($postId, $commentId, $email);
202
  if (!$isParent) {
221
  */
222
  public function notifyPostSubscribers($postId, $commentId, $email) {
223
  $emailsArray = $this->dbManager->getPostNewCommentNotification($postId, $email);
224
+ $subject = $this->options->subscription["emailSubjectPostComment"];
225
+ $message = wpautop($this->options->subscription["emailContentPostComment"]);
226
  foreach ($emailsArray as $k => $eRow) {
227
  $subscriberUserId = $eRow["id"];
228
  $subscriberEmail = $eRow["email"];
240
  */
241
  public function notifyAllCommentSubscribers($postId, $newCommentId, $email) {
242
  $emailsArray = $this->dbManager->getAllNewCommentNotification($postId, $email);
243
+ $subject = $this->options->subscription["emailSubjectAllCommentReply"];
244
+ $message = wpautop($this->options->subscription["emailContentAllCommentReply"]);
245
  foreach ($emailsArray as $k => $eRow) {
246
  $subscriberUserId = $eRow["id"];
247
  $subscriberEmail = $eRow["email"];
260
  */
261
  public function notifyCommentSubscribers($parentCommentId, $newCommentId, $email) {
262
  $emailsArray = $this->dbManager->getNewReplyNotification($parentCommentId, $email);
263
+ $subject = $this->options->subscription["emailSubjectCommentReply"];
264
+ $message = wpautop($this->options->subscription["emailContentCommentReply"]);
265
  foreach ($emailsArray as $k => $eRow) {
266
  $subscriberUserId = $eRow["id"];
267
  $subscriberEmail = $eRow["email"];
292
  $postId = $comment->comment_post_ID;
293
  $email = $comment->comment_author_email;
294
  $parentComment = $comment->comment_parent ? get_comment($comment->comment_parent) : 0;
295
+ if (apply_filters("wpdiscuz_enable_user_mentioning", $this->options->subscription["enableUserMentioning"]) && $this->options->subscription["sendMailToMentionedUsers"] && ($mentionedUsers = $this->helper->getMentionedUsers($comment->comment_content))) {
296
+ $this->sendMailToMentionedUsers($mentionedUsers, $comment);
297
+ }
298
+ do_action("wpdiscuz_before_sending_emails", $commentId, $comment);
299
  $this->notifyPostSubscribers($postId, $commentId, $email);
300
  if ($parentComment) {
301
  $parentCommentEmail = $parentComment->comment_author_email;
328
  } else {
329
  $email = $comment->comment_author_email;
330
  }
331
+ if (apply_filters("wpdiscuz_send_email_on_approving", true, $email, $comment)) {
332
+ $siteUrl = get_site_url();
333
+ $blogTitle = get_option("blogname");
334
+ $postTitle = get_the_title($comment->comment_post_ID);
335
+ $search = ["[SITE_URL]", "[POST_URL]", "[BLOG_TITLE]", "[POST_TITLE]", "[COMMENT_URL]", "[COMMENT_AUTHOR]", "[COMMENT_CONTENT]"];
336
+ $replace = [$siteUrl, get_permalink($comment->comment_post_ID), $blogTitle, $postTitle, get_comment_link($comment->comment_ID), $comment->comment_author, wpautop($comment->comment_content)];
337
+ $message = str_replace($search, $replace, $this->options->getPhrase("wc_comment_approved_email_message", ["comment" => $comment]));
338
+
339
+ $subject = str_replace(["[BLOG_TITLE]", "[POST_TITLE]", "[COMMENT_AUTHOR]"], [$blogTitle, $postTitle, $comment->comment_author], $this->options->subscription["emailSubjectCommentApproved"]);
340
+ $message = str_replace($search, $replace, wpautop($this->options->subscription["emailContentCommentApproved"]));
341
+
342
+ $headers = [];
343
+ $fromName = html_entity_decode($blogTitle, ENT_QUOTES);
344
+ $parsedUrl = parse_url($siteUrl);
345
+ $domain = isset($parsedUrl["host"]) ? WpdiscuzHelper::fixEmailFrom($parsedUrl["host"]) : "";
346
+ $fromEmail = "no-reply@" . $domain;
347
+ $headers[] = "Content-Type: text/html; charset=UTF-8";
348
+ $headers[] = "From: " . $fromName . " <" . $fromEmail . "> \r\n";
349
+ $subject = html_entity_decode($subject, ENT_QUOTES);
350
+ $message = html_entity_decode($message, ENT_QUOTES);
351
+ wp_mail($email, $subject, do_shortcode($message), $headers);
352
+ }
353
  }
354
  }
355
  }
362
  $postTitle = get_the_title($postId);
363
  $search = ["[SITE_URL]", "[POST_URL]", "[BLOG_TITLE]", "[POST_TITLE]"];
364
  $replace = [$siteUrl, get_permalink($postId), $blogTitle, $postTitle];
 
365
 
366
+ $subject = str_replace(["[BLOG_TITLE]", "[POST_TITLE]"], [$blogTitle, $postTitle], $this->options->subscription["emailSubjectFollowConfirmation"]);
367
+ $message = str_replace($search, $replace, wpautop($this->options->subscription["emailContentFollowConfirmation"]));
368
 
369
  if (strpos($message, "[CONFIRM_URL]") === false) {
370
  $message .= "<br/><br/><a href='$confirmUrl'>" . $this->options->getPhrase("wc_follow_confirm") . "</a>";
405
  $postUrl = get_permalink($post);
406
  $commentUrl = get_comment_link($comment);
407
 
408
+ $subject = str_replace(["[BLOG_TITLE]", "[POST_TITLE]"], [$blogTitle, $postTitle], $this->options->subscription["emailSubjectFollowComment"]);
409
 
410
  $search = ["[SITE_URL]", "[POST_URL]", "[BLOG_TITLE]", "[POST_TITLE]", "[COMMENT_URL]", "[COMMENT_CONTENT]"];
411
  $replace = [$siteUrl, $postUrl, $blogTitle, $postTitle, $commentUrl, wpautop($comment->comment_content)];
412
+
413
+ $message = str_replace($search, $replace, wpautop($this->options->subscription["emailContentFollowComment"]));
414
  global $wp_rewrite;
415
  $cancelLink = !$wp_rewrite->using_permalinks() ? $postUrl . "&" : $postUrl . "?";
416
  $fromName = html_entity_decode($blogTitle, ENT_QUOTES);
429
  if (($followerData["follower_email"] === $postAuthor->user_email) && (($moderationNotify && $comment->comment_approved === "0") || ($commentsNotify && $comment->comment_approved === "1"))) {
430
  return;
431
  }
432
+ $subject = str_replace(["[COMMENT_AUTHOR]"], [$followerData["user_name"]], $subject);
433
  $body = str_replace(["[COMMENT_AUTHOR]", "[FOLLOWER_NAME]"], [$followerData["user_name"], $followerData["follower_name"]], $message);
434
  $this->emailToFollower($followerData, $comment, $subject, $body, $cancelLink, $data);
435
  do_action("wpdiscuz_notify_followers", $comment, $followerData);
455
  }
456
  }
457
 
458
+ public function sendMailToMentionedUsers($users, $comment) {
459
+ $post = get_post($comment->comment_post_ID);
460
+
461
  $parsedUrl = parse_url(get_site_url());
462
  $domain = isset($parsedUrl["host"]) ? WpdiscuzHelper::fixEmailFrom($parsedUrl["host"]) : "";
463
  $fromEmail = "no-reply@" . $domain;
464
  $fromName = html_entity_decode(get_option("blogname"), ENT_QUOTES);
465
  $headers[] = "Content-Type: text/html; charset=UTF-8";
466
  $headers[] = "From: " . $fromName . " <" . $fromEmail . "> \r\n";
467
+
468
+ $siteUrl = get_site_url();
469
+ $blogTitle = get_option("blogname");
470
+ $postTitle = get_the_title($post);
471
+ $postUrl = get_permalink($post);
472
+ $commentUrl = get_comment_link($comment);
473
+ $commentAuthor = $comment->comment_author;
474
+
475
+ $subject = str_replace(["[BLOG_TITLE]", "[POST_TITLE]"], [$blogTitle, $postTitle], $this->options->subscription["emailSubjectUserMentioned"]);
476
+ $message = wpautop($this->options->subscription["emailContentUserMentioned"]);
477
+
478
+ $search = ["[SITE_URL]", "[POST_URL]", "[BLOG_TITLE]", "[POST_TITLE]", "[MENTIONED_USER_NAME]", "[COMMENT_URL]", "[COMMENT_AUTHOR]"];
479
+ $replace = [$siteUrl, $postUrl, $blogTitle, $postTitle, "", $commentUrl, $commentAuthor];
480
+
481
  foreach ($users as $k => $user) {
482
+ if ($user["email"] !== $comment->comment_author_email) {
483
+ if (apply_filters("wpducm_mail_to_mentioned_user", true, $user, $comment)) {
484
+ $replace[4] = $user["name"];
485
  $body = str_replace($search, $replace, $message);
486
+ $subject = apply_filters("wpdiscuz_mentioned_user_mail_subject", $subject, $user, $comment);
487
+ $body = apply_filters("wpdiscuz_mentioned_user_mail_body", $body, $user, $comment);
488
  if ($subject && $body) {
489
+ wp_mail($user["email"], $subject, $body, $headers);
490
+ }
491
  }
492
  }
493
  }
utils/class.WpdiscuzHelperOptimization.php CHANGED
@@ -242,6 +242,8 @@ class WpdiscuzHelperOptimization implements WpDiscuzConstants {
242
  \SiteGround_Optimizer\Supercacher\Supercacher::delete_assets();
243
  }
244
  }
 
 
245
  }
246
 
247
  public function cleanAllCaches() {
242
  \SiteGround_Optimizer\Supercacher\Supercacher::delete_assets();
243
  }
244
  }
245
+
246
+ update_post_meta($postId, self::POSTMETA_STATISTICS, []);
247
  }
248
 
249
  public function cleanAllCaches() {