window.wp=window.wp||{},window.bp=window.bp||{},function(h){"undefined"!=typeof BP_Nouveau&&(bp.Nouveau={start:function(){this.setupGlobals(),this.prepareDocument(),this.initObjects(),this.setHeartBeat(),this.addListeners(),this.switchGridList(),this.sendInvitesRevokeAccess(),this.sentInvitesFormValidate(),this.registerPopUp(),this.loginPopUp(),this.reportPopUp(),this.reportActions(),this.reportedPopup(),this.togglePassword(),this.enableSubmitOnLegalAgreement(),this.profileNotificationSetting(),"undefined"!=typeof BB_Nouveau_Presence&&this.userPresenceStatus();var r=this;h(document).on("bb_trigger_toast_message",function(e,t,a,i,o,n,s){r.bbToastMessage(t,a,i,o,n,s)}),bp.Nouveau.lazyLoad(".lazy"),h(window).on("scroll resize",function(){bp.Nouveau.lazyLoad(".lazy")})},bbToastMessage:function(e,t,a,i,o,n){var s,r,d,l,c,p,b;function u(){h(r).removeClass("pull-animation").addClass("close-item").delay(500).remove()}t&&""!=t.trim()&&(s="unique-"+Math.floor(1e6*Math.random()),r="."+s,d="",n=n&&"number"==typeof n?1e3*n:5e3,null!==i&&(d="has-url"),p=c=l="",p+='
',p+='',e&&(p+=''+e+""),t&&(p+=''+t+""),p+="
",p+='',p+=i?'':"",h((h(".bb-toast-messages-enable").length||(h(".bb-onscreen-notification-enable ul.notification-list").length?(b=h(".bb-onscreen-notification").hasClass("bb-position-left")?"left":"right",b=h(''),h(".bb-onscreen-notification").show(),h(b).insertBefore(".bb-onscreen-notification-enable ul.notification-list")):(b=h(''),h("body").append(b))),".bb-toast-messages-enable .toast-messages-list")).append(' '+p+" "),o&&setInterval(function(){u()},n),h(r+" .actions .action-close").on("click",function(){u()}))},setupGlobals:function(){this.ajax_request=null,this.objects=h.map(BP_Nouveau.objects,function(e){return e}),this.objectNavParent=BP_Nouveau.object_nav_parent,this.heartbeat=wp.heartbeat||!1,this.querystring=this.getLinkParams()},prepareDocument:function(){var a;h("body").hasClass("no-js")&&h("body").removeClass("no-js").addClass("js"),BP_Nouveau.warnings&&"undefined"!=typeof console&&console.warn&&h.each(BP_Nouveau.warnings,function(e,t){console.warn(t)}),h(".buddypress_object_nav .widget-title").length&&(a=h(".buddypress_object_nav .widget-title").html(),h("body").find('*:contains("'+a+'")').each(function(e,t){h(t).hasClass("widget-title")||a!==h(t).html()||h(t).is("a")||h(t).remove()}))},getStorage:function(e,t){e=(e=sessionStorage.getItem(e))?JSON.parse(e):{};return void 0!==t?e[t]||!1:e},setStorage:function(e,t,a){var i=this.getStorage(e);return void 0===a&&void 0!==i[t]?delete i[t]:i[t]=a,sessionStorage.setItem(e,JSON.stringify(i)),null!==sessionStorage.getItem(e)},getLinkParams:function(e,t){e=e?-1!==e.indexOf("?")?"?"+e.split("?")[1]:"":document.location.search;if(!e)return null;e=e.replace(/(^\?)/,"").split("&").map(function(e){return this[(e=e.split("="))[0]]=e[1],this}.bind({}))[0];return t?e[t]:e},urlDecode:function(e,t){var a=t||{amp:"&",lt:"<",gt:">",quot:'"',"#039":"'"};return decodeURIComponent(e.replace(/\+/g," ")).replace(/&([^;]+);/g,function(e,t){return a[t]||""})},ajax:function(e,t,a){this.ajax_request&&void 0===a&&this.ajax_request.abort();e=h.extend({},bp.Nouveau.getStorage("bp-"+t),{nonce:BP_Nouveau.nonces[t]},e);return void 0!==BP_Nouveau.customizer_settings&&(e.customized=BP_Nouveau.customizer_settings),void 0!==BP_Nouveau.modbypass&&(e.modbypass=BP_Nouveau.modbypass),this.ajax_request=h.post(BP_Nouveau.ajaxurl,e,"json"),this.ajax_request},inject:function(e,t,a){h(e).length&&t&&(("append"===(a=a||"reset")?h(e).append(t):"prepend"===a?h(e).prepend(t):h(e).html(t)).find("li.activity-item").each(this.hideSingleUrl),"undefined"==typeof bp_mentions&&void 0===bp.mentions||(h(".bp-suggestions").bp_mentions(bp.mentions.users),h("#whats-new").on("inserted.atwho",function(){var e;window.getSelection&&document.createRange?(e=window.getSelection&&window.getSelection())&&0 p").removeAttr("br").removeAttr("a").text(),t="",a="",i="",o=0;if(0<=e.indexOf("http://")?(i=e.indexOf("http://"),o=1):0<=e.indexOf("https://")?(i=e.indexOf("https://"),o=1):0<=e.indexOf("www.")&&(i=e.indexOf("www"),o=1),1===o){for(var n=i;n p:first").hide()}},objectRequest:function(i){var e,o=this;if((i=h.extend({object:"",scope:null,filter:null,target:"#buddypress [data-bp-list]",search_terms:"",page:1,extras:null,caller:null,template:null,method:"reset"},i)).object&&i.target)return"activity"==i.object&&"#buddypress [data-bp-list] ul.bp-list"==i.target&&(i.target="#buddypress [data-bp-list] ul.bp-list:not(#bb-media-model-container ul.bp-list)"),["members","activity","media","document"].includes(i.object)&&!h(this.objectNavParent+' [data-bp-scope="'+i.scope+'"]').length&&(i.scope="all"),i.search_terms&&(i.search_terms=i.search_terms.replace(//g,">")),null!==i.scope&&this.setStorage("bp-"+i.object,"scope",i.scope),null!==i.filter&&this.setStorage("bp-"+i.object,"filter",i.filter),null!==i.extras&&this.setStorage("bp-"+i.object,"extras",i.extras),h(this.objectNavParent+" [data-bp-object]").each(function(){h(this).removeClass("selected loading")}),(h(this.objectNavParent+' [data-bp-scope="'+i.scope+'"]').length?h(this.objectNavParent+' [data-bp-scope="'+i.scope+'"], #object-nav li.current'):h(this.objectNavParent+" [data-bp-scope]:eq(0), #object-nav li.current")).addClass("selected loading"),h('#buddypress [data-bp-filter="'+i.object+'"] option[value="'+i.filter+'"]').prop("selected",!0),"friends"===i.object||"group_members"===i.object?(i.template=i.object,i.object="members"):"group_requests"===i.object?(i.object="groups",i.template="group_requests"):"group_subgroups"===i.object?(i.object="groups",i.template="group_subgroups"):"notifications"===i.object&&(i.object="members",i.template="member_notifications"),e=h.extend({action:i.object+"_filter"},i),this.ajax(e,i.object).done(function(e){if(!1!==e.success&&!_.isUndefined(e.data)){if(!h("body.group-members.members.buddypress").length||_.isUndefined(e.data)||_.isUndefined(e.data.count)||h("body.group-members.members.buddypress ul li#members-groups-li").find("span").text(e.data.count),h(o.objectNavParent+' [data-bp-scope="'+i.scope+'"]').removeClass("loading"),h(o.objectNavParent+' [data-bp-scope="'+i.scope+'"]').find("span").text(""),_.isUndefined(e.data)||_.isUndefined(e.data.count)||h(o.objectNavParent+' [data-bp-scope="'+i.scope+'"]').find("span").text(e.data.count),!_.isUndefined(e.data)&&!_.isUndefined(e.data.scopes))for(var t in e.data.scopes)h(o.objectNavParent+' [data-bp-scope="'+t+'"]').find("span").text(e.data.scopes[t]);var a;"reset"!==i.method?(o.inject(i.target,e.data.contents,i.method),h(i.target).trigger("bp_ajax_"+i.method,h.extend(i,{response:e.data}))):"pag-bottom"===i.caller?(a=null,a=h("#subnav").length?h("#subnav").parent():h(i.target),h("html,body").animate({scrollTop:a.offset().top},"slow",function(){h(i.target).fadeOut(100,function(){o.inject(this,e.data.contents,i.method),h(this).fadeIn(100),h(i.target).trigger("bp_ajax_request",h.extend(i,{response:e.data})),bp.Nouveau.lazyLoad&&setTimeout(function(){bp.Nouveau.lazyLoad(".lazy")},1e3)})})):h(i.target).fadeOut(100,function(){o.inject(this,e.data.contents,i.method),h(this).fadeIn(100),h(i.target).trigger("bp_ajax_request",h.extend(i,{response:e.data})),bp.Nouveau.lazyLoad&&setTimeout(function(){bp.Nouveau.lazyLoad(".lazy")},1e3)}),setTimeout(function(){o.reportPopUp(),o.reportedPopup()},1e3)}})},initObjects:function(){var i,o=this,n={},s="all",r="",d=null,l=null;h.each(this.objects,function(e,t){var a;h('#buddypress [data-bp-list="'+t+'"][data-ajax="false"]').length||(i=o.getStorage("bp-"+t),void 0!==(a=window.location.hash.substr(1))&&"following"==a?s=a:void 0!==i.scope&&(s=i.scope),void 0!==i.extras&&"notifications"!==t&&(d=i.extras),h('#buddypress [data-bp-filter="'+t+'"]').length&&(void 0!==i.filter?(l=i.filter,h('#buddypress [data-bp-filter="'+t+'"] option[value="'+l+'"]').prop("selected",!0)):"-1"!==h('#buddypress [data-bp-filter="'+t+'"]').val()&&"0"!==h('#buddypress [data-bp-filter="'+t+'"]').val()&&(l=h('#buddypress [data-bp-filter="'+t+'"]').val())),h(this.objectNavParent+' [data-bp-object="'+t+'"]').length&&(h(this.objectNavParent+' [data-bp-object="'+t+'"]').each(function(){h(this).removeClass("selected")}),h(this.objectNavParent+' [data-bp-scope="'+t+'"], #object-nav li.current').addClass("selected")),null!==o.querystring&&(void 0!==o.querystring[t+"_search"]?r=decodeURI(o.querystring[t+"_search"]):void 0!==o.querystring.s&&(r=decodeURI(o.querystring.s)),r&&h('#buddypress [data-bp-search="'+t+'"] input[type=search]').val(r)),h('#buddypress [data-bp-list="'+t+'"]').length&&(n={object:t,scope:s,filter:l,search_terms:r,extras:d},h('#buddypress [data-bp-member-type-filter="'+t+'"]').length?n.member_type_id=h('#buddypress [data-bp-member-type-filter="'+t+'"]').val():h('#buddypress [data-bp-group-type-filter="'+t+'"]').length&&(n.group_type=h('#buddypress [data-bp-group-type-filter="'+t+'"]').val()),o.objectRequest(n)))})},setHeartBeat:function(){void 0!==BP_Nouveau.pulse&&this.heartbeat&&(this.heartbeat.interval(Number(BP_Nouveau.pulse)),h.fn.extend({"heartbeat-send":function(){return this.bind("heartbeat-send")}}),h.fn.extend({"heartbeat-tick":function(){return this.bind("heartbeat-tick")}}))},addListeners:function(){h("[data-bp-disable-input]").on("change",this.toggleDisabledInput),h(this.objectNavParent+" .bp-navs").on("click","a",this,this.scopeQuery),h(document).on("change","#buddypress [data-bp-filter]",this,this.filterQuery),h(document).on("change","#buddypress [data-bp-group-type-filter]",this,this.typeGroupFilterQuery),h(document).on("change","#buddypress [data-bp-member-type-filter]",this,this.typeMemberFilterQuery),h("#buddypress [data-bp-search]").on("submit","form",this,this.searchQuery),h("#buddypress [data-bp-search] form").on("search","input[type=search]",this.resetSearch),h("#buddypress [data-bp-list], #buddypress #item-header, #buddypress.bp-shortcode-wrap .dir-list, #buddypress .bp-messages-content").on("click","[data-bp-btn-action]",this,this.buttonAction),h("#buddypress [data-bp-list], #buddypress #item-header, #buddypress.bp-shortcode-wrap .dir-list, #buddypress .messages-screen").on("blur","[data-bp-btn-action]",this,this.buttonRevert),h("#buddypress [data-bp-list], #buddypress #item-header, #buddypress.bp-shortcode-wrap .dir-list, #buddypress .messages-screen").on("mouseover","[data-bp-btn-action]",this,this.buttonHover),h("#buddypress [data-bp-list], #buddypress #item-header, #buddypress.bp-shortcode-wrap .dir-list, #buddypress .messages-screen").on("mouseout","[data-bp-btn-action]",this,this.buttonHoverout),h("#buddypress [data-bp-list], #buddypress #item-header, #buddypress.bp-shortcode-wrap .dir-list, #buddypress .messages-screen").on("mouseover",".awaiting_response_friend",this,this.awaitingButtonHover),h("#buddypress [data-bp-list], #buddypress #item-header, #buddypress.bp-shortcode-wrap .dir-list, #buddypress .messages-screen").on("mouseout",".awaiting_response_friend",this,this.awaitingButtonHoverout),h(document).on("click","#buddypress .bb-leave-group-popup .bb-confirm-leave-group",this.leaveGroupAction),h(document).on("click","#buddypress .bb-leave-group-popup .bb-close-leave-group",this.leaveGroupClose),h(document).on("click","#buddypress .bb-remove-connection .bb-confirm-remove-connection",this.removeConnectionAction),h(document).on("click","#buddypress .bb-remove-connection .bb-close-remove-connection",this.removeConnectionClose),h(document).on("click","#buddypress table.invite-settings .field-actions .field-actions-remove, #buddypress table.invite-settings .field-actions-add",this,this.addRemoveInvite),h(document).on("click",".show-action-popup",this.showActionPopup),h(document).on("click","#message-threads .block-member",this.threadListBlockPopup),h(document).on("click","#message-threads .report-content",this.threadListReportPopup),h(document).on("click",".bb-close-action-popup, .action-popup-overlay",this.closeActionPopup),h(document).on("keyup",this,this.keyUp),h("[data-bp-close]").on("click",this,this.closeNotice),h("#buddypress [data-bp-list]").on("click","[data-bp-pagination] a",this,this.paginateAction),h(document).on("click",this.closePickersOnClick),document.addEventListener("keydown",this.closePickersOnEsc),h(document).on("click","#item-header a.position-change-cover-image, .header-cover-reposition-wrap a.cover-image-save, .header-cover-reposition-wrap a.cover-image-cancel",this.coverPhotoCropper),h(document).on("click","#cover-photo-alert .bb-model-close-button",this.coverPhotoCropperAlert),h(document).on("click",this.toggleMoreOption.bind(this)),h(document).on("heartbeat-send",this.bbHeartbeatSend.bind(this)),h(document).on("heartbeat-tick",this.bbHeartbeatTick.bind(this)),bp.Nouveau.notificationRemovedAction(),bp.Nouveau.removeAllNotification(),bp.Nouveau.setTitle(),h(document).on("click",".more-following .count-more",this.bbWidgetMoreFollowing),h(".bb-accordion .bb-accordion_trigger").on("click",this.toggleAccordion)},bbHeartbeatSend:function(e,t){t.onScreenNotifications=!0,h("#buddypress").trigger("bb_heartbeat_send",t)},bbHeartbeatTick:function(e,t){bp.Nouveau.bbInjectOnScreenNotifications(e,t)},bbInjectOnScreenNotifications:function(e,t){var a,i,o,n,s,r;"1"==h(".bb-onscreen-notification").data("enable")&&(void 0===t.on_screen_notifications&&""===t.on_screen_notifications||(a=h(".bb-onscreen-notification"),r=(i=a.find(".notification-list")).data("removed-items"),o=i.data("animated-items"),n=[],s=h(h.parseHTML(""+t.on_screen_notifications+"
")),h.each(r,function(e,t){t=s.find("[data-notification-id="+t+"]");t.length&&t.closest(".read-item").remove()}),(r=s.find(".read-item")).each(function(e,t){var a=h(t).find(".actions .action-close").data("notification-id");"-1"==h.inArray(a,o)?(h(t).addClass("pull-animation"),o.push(a),n.push(a)):h(t).removeClass("pull-animation")}),n.length&&r.each(function(e,t){var a=h(t).find(".actions .action-close").data("notification-id");"-1"==h.inArray(a,n)&&(h(t).removeClass("recent-item"),(t=i.data("border-items")).push(a),i.attr("data-border-items",JSON.stringify(t)))}),i.attr("data-animated-items",JSON.stringify(o)),r.length&&(a.removeClass("close-all-items"),r.eq(2).nextAll().addClass("bb-more-item"),3 li").each(function(){h(this).removeClass("pull-animation").addClass("close-item").delay(500).remove()}),h(".toast-messages-list > li").each(function(){h(this).removeClass("pull-animation").addClass("close-item").delay(500).remove()}),t.removeClass("bb-more-than-3")})},setTitle:function(){var e=h("html head").find("title").text();h(".bb-onscreen-notification").attr("data-title-tag",e)},visibilityOnScreenClearButton:function(){var e=h(".bb-onscreen-notification");1 tbody > tr").each(function(){h(this).find('input[type="text"]').removeAttr("style"),h(this).find('input[type="email"]').removeAttr("style")}),h("body.send-invites #send-invite-form #member-invites-table > tbody > tr").each(function(){e=h.trim(h(this).find('input[type="text"]').val()),a=h(this).find("input").attr("id"),t=h.trim(h(this).find('input[type="email"]').val()),""===e&&""===t?0:""!==e&&""===t?(a=h(this).find('input[type="email"]').attr("id"),i.push(a)):""===e&&""!==t?(a=h(this).find('input[type="text"]').attr("id"),i.push(a)):l.test(t)?o.push(1):(a=h(this).find('input[type="email"]').attr("id"),i.push(a))}),h(".span_error").remove(),0!==i.length)return i.forEach(function(e){h("#"+e).attr("style","border:1px solid #ef3e46"),-1!==e.indexOf("email_")?h("#"+e).after(''+p+""):h("#"+e).after(''+c+"")}),h("html, body").animate({scrollTop:h("#item-body").offset().top},2e3),alert(b),!1;if(h("#email_0_email_error").length&&h("#email_0_email_error").remove(),0===o.length){n=h("#invitee_0_title").val(),s=h("#email_0_email").val();return""===n&&""===s?(h("#invitee_0_title").attr("style","border:1px solid #ef3e46"),h("#invitee_0_title").focus(),h("#email_0_email").attr("style","border:1px solid #ef3e46"),!1):(""!==n&&""===s?(h("#email_0_email").attr("style","border:1px solid #ef3e46"),h("#email_0_email").focus()):(l.test(s)||(h("#email_0_email").attr("style","border:1px solid #ef3e46"),h("#email_0_email").focus(),h("#email_0_email_error").remove(),h("#email_0_email").after(''+p+"")),alert(b)),!1)}})},sendInvitesRevokeAccess:function(){h("body.sent-invites #member-invites-table").length&&h("body.sent-invites #member-invites-table tr td span a.revoked-access").click(function(e){e.preventDefault();var t=h(this).attr("data-name"),a=h(this).attr("id"),e=h(this).attr("data-revoke-access");if(!confirm(t))return!1;h.ajax({url:e,type:"post",data:{item_id:a},success:function(){window.location.reload(!0)}})})},toggleDisabledInput:function(){var e=h(this).attr("data-bp-disable-input");h(e).prop("disabled",!0)&&!h(this).hasClass("enabled")?(h(this).addClass("enabled").removeClass("disabled"),h(e).prop("disabled",!1)):h(e).prop("disabled",!1)&&h(this).hasClass("enabled")&&(h(this).removeClass("enabled").addClass("disabled"),h(e).attr("disabled","disabled"))},keyUp:function(e){var t=e.data;27===e.keyCode&&t.buttonRevertAll()},scopeQuery:function(e){var t,a,i=e.data,o=h(e.currentTarget).parent(),n="",s=null,r={};if(o.hasClass("no-ajax")||h(e.currentTarget).hasClass("no-ajax")||!o.attr("data-bp-scope"))return e;if(t=o.data("bp-scope"),a=o.data("bp-object"),!t||!a)return e;e.preventDefault();var e=i.getStorage("bp-"+a);void 0!==e.extras&&"notifications"!==a&&(s=e.extras),e=h("#buddypress").find('[data-bp-filter="'+a+'"]').first().val(),h('#buddypress [data-bp-search="'+a+'"] input[type=search]').length&&(n=h('#buddypress [data-bp-search="'+a+'"] input[type=search]').val()),o.hasClass("dynamic")&&o.find("a span").html(""),r={object:a,scope:t,filter:e,search_terms:n,page:1,extras:s},h('#buddypress [data-bp-member-type-filter="'+a+'"]').length?r.member_type_id=h('#buddypress [data-bp-member-type-filter="'+a+'"]').val():h('#buddypress [data-bp-group-type-filter="'+a+'"]').length&&(r.group_type=h('#buddypress [data-bp-group-type-filter="'+a+'"]').val()),i.objectRequest(r)},filterQuery:function(e){var t=e.data,a=h(e.target).data("bp-filter"),i="all",o=h(e.target).val(),n="",s=!1;if(!a)return e;h(t.objectNavParent+" [data-bp-object].selected").length&&(i=h(t.objectNavParent+" [data-bp-object].selected").data("bp-scope")),h('#buddypress [data-bp-search="'+a+'"] input[type=search]').length&&(n=h('#buddypress [data-bp-search="'+a+'"] input[type=search]').val());e=t.getStorage("bp-"+(a="friends"===a?"members":a));void 0!==e.extras&&"notifications"!==a&&(s=e.extras),"members"===a?t.objectRequest({object:a,scope:i,filter:o,search_terms:n,page:1,extras:s,template:null,member_type_id:h('#buddypress [data-bp-member-type-filter="'+a+'"]').val()}):"groups"===a?t.objectRequest({object:a,scope:i,filter:o,search_terms:n,page:1,extras:s,template:null,group_type:h('#buddypress [data-bp-group-type-filter="'+a+'"]').val()}):t.objectRequest({object:a,scope:i,filter:o,search_terms:n,page:1,extras:s,template:null})},typeGroupFilterQuery:function(e){var t=e.data,a=h(e.target).data("bp-group-type-filter"),i="all",o=null,n=null,s="";if(!a)return e;void 0!==(e=t.getStorage("bp-"+a)).extras&&"notifications"!==a&&(n=e.extras),h('#buddypress [data-bp-filter="'+a+'"]').length&&(void 0!==e.filter?(o=e.filter,h('#buddypress [data-bp-filter="'+a+'"] option[value="'+o+'"]').prop("selected",!0)):"-1"!==h('#buddypress [data-bp-filter="'+a+'"]').val()&&"0"!==h('#buddypress [data-bp-filter="'+a+'"]').val()&&(o=h('#buddypress [data-bp-filter="'+a+'"]').val())),h(t.objectNavParent+" [data-bp-object].selected").length&&(i=h(t.objectNavParent+" [data-bp-object].selected").data("bp-scope")),h('#buddypress [data-bp-search="'+a+'"] input[type=search]').length&&(s=h('#buddypress [data-bp-search="'+a+'"] input[type=search]').val()),t.objectRequest({object:a,scope:i,filter:o,search_terms:s,page:1,template:null,extras:n,group_type:h('#buddypress [data-bp-group-type-filter="'+a+'"]').val()})},typeMemberFilterQuery:function(e){var t=e.data,a=h(e.target).data("bp-member-type-filter"),i="all",o=null,n=null,s="";if(!a)return e;void 0!==(e=t.getStorage("bp-"+(a="friends"===a?"members":a))).extras&&"notifications"!==a&&(n=e.extras),h('#buddypress [data-bp-filter="'+a+'"]').length&&(void 0!==e.filter?(o=e.filter,h('#buddypress [data-bp-filter="'+a+'"] option[value="'+o+'"]').prop("selected",!0)):"-1"!==h('#buddypress [data-bp-filter="'+a+'"]').val()&&"0"!==h('#buddypress [data-bp-filter="'+a+'"]').val()&&(o=h('#buddypress [data-bp-filter="'+a+'"]').val())),h(t.objectNavParent+" [data-bp-object].selected").length&&(i=h(t.objectNavParent+" [data-bp-object].selected").data("bp-scope")),h('#buddypress [data-bp-search="'+a+'"] input[type=search]').length&&(s=h('#buddypress [data-bp-search="'+a+'"] input[type=search]').val()),t.objectRequest({object:a,scope:i,filter:o,search_terms:s,page:1,template:null,extras:n,member_type_id:h('#buddypress [data-bp-member-type-filter="'+a+'"]').val()})},searchQuery:function(e){var t,a,i,o=e.data,n="all",s=!1;if(h(e.delegateTarget).hasClass("no-ajax")||void 0===h(e.delegateTarget).data("bp-search"))return e;e.preventDefault(),t=h(e.delegateTarget).data("bp-search"),a=h("#buddypress").find('[data-bp-filter="'+t+'"]').first().val(),i=h(e.delegateTarget).find("input[type=search]").first().val(),h(o.objectNavParent+" [data-bp-object]").length&&(n=h(o.objectNavParent+' [data-bp-object="'+t+'"].selected').data("bp-scope"));e=o.getStorage("bp-"+t);void 0!==e.extras&&"notifications"!==t&&(s=e.extras),o.objectRequest({object:t,scope:n,filter:a,search_terms:i,page:1,extras:s,template:null})},showSearchSubmit:function(e){h(e.delegateTarget).find("[type=submit]").addClass("bp-show"),h("[type=submit]").hasClass("bp-hide")&&h("[type=submit]").removeClass("bp-hide")},resetSearch:function(e){h(e.target).val()?h(e.delegateTarget).find("[type=submit]").show():h(e.delegateTarget).submit()},buttonAction:function(e){var i=e.data,o=h(e.currentTarget),n=o.data("bp-btn-action"),t=o.data("bp-nonce"),s=o.closest("[data-bp-item-id]"),a=s.data("bp-item-id"),r=o.closest(".list-wrap"),d=s.data("bp-item-component"),l="",c=s.data("bp-used-to-component");if(!n||!a||!d)return e;if(e.preventDefault(),o.hasClass("bp-toggle-action-button"))return h(document.body).hasClass("buddyboss-theme")&&void 0!==o.data("balloon")?o.attr("data-balloon",o.data("title")):o.text(o.data("title")),o.removeClass("bp-toggle-action-button"),o.addClass("bp-toggle-action-button-clicked"),!1;if(void 0!==o.data("only-admin"))return void 0!==BP_Nouveau.only_admin_notice&&window.alert(BP_Nouveau.only_admin_notice),!1;if("is_friend"!==n&&(void 0!==BP_Nouveau[n+"_confirm"]&&!1===window.confirm(BP_Nouveau[n+"_confirm"])||o.hasClass("pending")))return!1;var p=h(".bb-leave-group-popup"),b=h(o).data("bb-group-name"),e=h(o).data("bb-group-link");if("leave_group"===n&&"true"!==h(o).attr("data-popup-shown")){if(p.length)return p.find(".bb-leave-group-content .bb-group-name").html(''+b+""),h("body").find('[data-current-anchor="true"]').removeClass("bp-toggle-action-button bp-toggle-action-button-hover").addClass("bp-toggle-action-button-clicked"),p.show(),h(o).attr("data-current-anchor","true"),h(o).attr("data-popup-shown","true"),!1}else h("body").find('[data-popup-shown="true"]').attr("data-popup-shown","false"),h("body").find('[data-current-anchor="true"]').attr("data-current-anchor","false"),p.find(".bb-leave-group-content .bb-group-name").html(""),p.hide();e=h(".bb-remove-connection"),b=h(o).data("bb-user-name"),p=h(o).data("bb-user-link");if("is_friend"===n&&"opened"!==h(o).attr("data-popup-shown")){if(e.length)return e.find(".bb-remove-connection-content .bb-user-name").html(''+b+""),h("body").find('[data-current-anchor="true"]').removeClass("bp-toggle-action-button bp-toggle-action-button-hover").addClass("bp-toggle-action-button-clicked"),e.show(),h(o).attr("data-current-anchor","true"),h(o).attr("data-popup-shown","opened"),!1}else h("body").find('[data-popup-shown="opened"]').attr("data-popup-shown","closed"),h("body").find('[data-current-anchor="true"]').attr("data-current-anchor","false"),e.find(".bb-remove-connection-content .bb-user-name").html(""),e.hide();l=t?i.getLinkParams(t,"_wpnonce"):void 0===o.prop("href")?i.getLinkParams(o.attr("href"),"_wpnonce"):i.getLinkParams(o.prop("href"),"_wpnonce"),b={is_friend:"remove_friend",not_friends:"add_friend",pending:"withdraw_friendship",accept_friendship:"accept_friendship",reject_friendship:"reject_friendship"};"members"===d&&void 0!==b[n]&&(n=b[n],d="friends");e={not_following:"follow",following:"unfollow"};"members"===d&&void 0!==e[n]&&(n=e[n],d="follow"),o.addClass("pending loading");t="";h(document.body).hasClass("directory")&&h(document.body).hasClass("members")||h(document.body).hasClass("group-members")?t="directory":h(document.body).hasClass("bp-user")&&(t="single");b="primary",e="single"===t?o.closest(".header-dropdown"):o.closest(".footer-button-wrap");void 0!==e.length&&0"+e.data.feedback+"","info",null,!0])}var t,a;return(h("#friends-personal-li").length&&(a=h("#friends-personal-li a span"),t=h("#friends-personal-li a"),(void 0!==e.data.is_user&&e.data.is_user&&void 0!==e.data.friend_count||void 0!==e.data.friend_count)&&(0'+e.data.friend_count+""):h(a).hide())),void 0!==e.data.is_user&&e.data.is_user)?(o.parent().html(e.data.feedback),void s.fadeOut(1500)):void 0!==e.data.is_user&&!e.data.is_user&&void 0!==e.data.group_url&&e.data.group_url?window.location=e.data.group_url:(h(i.objectNavParent+' [data-bp-scope="personal"]').length&&(a=Number(h(i.objectNavParent+' [data-bp-scope="personal"] span').html())||0,-1!==h.inArray(n,["leave_group","remove_friend"])?--a:-1!==h.inArray(n,["join_group"])&&(a+=1),a<0&&(a=0),h(i.objectNavParent+' [data-bp-scope="personal"] span').html(a)),"follow"===d&&0"+e.data.feedback+"","error",null,!0])}).fail(function(){var e,t;["unsubscribe","subscribe"].includes(n)&&(25<(e=h(o).data("bb-group-name")).length&&(e=e.substring(0,25)+"..."),t=""+BP_Nouveau.subscriptions.error+""+e+".
","subscribe"===n&&(t=""+BP_Nouveau.subscriptions.subscribe_error+""+e+"
"),jQuery(document).trigger("bb_trigger_toast_message",["",t,"error",null,!0])),o.removeClass("pending loading")})},buttonRevert:function(e){e=h(e.currentTarget);e.hasClass("bp-toggle-action-button-clicked")&&!e.hasClass("loading")&&(h(document.body).hasClass("buddyboss-theme")&&void 0!==e.data("balloon")?e.attr("data-balloon",e.data("title-displayed")):e.text(e.data("title-displayed")),e.removeClass("bp-toggle-action-button-clicked"),e.addClass("bp-toggle-action-button"))},buttonHover:function(e){var t=h(e.currentTarget),a=t.data("bp-btn-action"),i=t.closest("[data-bp-item-id]"),o=i.data("bp-item-id"),i=i.data("bp-item-component");return a&&o&&i?(e.preventDefault(),t.hasClass("bp-toggle-action-button")?(t.hasClass("group-subscription")&&void 0!==t.data("title")&&void 0!==t.data("title-displayed")&&0===t.data("title").replace(/<(.|\n)*?>/g,"").length&&0===t.data("title-displayed").replace(/<(.|\n)*?>/g,"").length||(h(document.body).hasClass("buddyboss-theme")&&void 0!==t.data("balloon")&&(t.hasClass("following")||t.attr("data-balloon",t.data("title").replace(/<(.|\n)*?>/g,"")),t.find("span").html(t.data("title"))),t.html(t.data("title"))),t.removeClass("bp-toggle-action-button"),t.addClass("bp-toggle-action-button-hover"),!1):void 0):e},buttonHoverout:function(e){e=h(e.currentTarget);if(e.hasClass("bp-toggle-action-button-hover")&&!e.hasClass("loading")){if(e.hasClass("group-subscription")&&void 0!==e.data("title")&&void 0!==e.data("title-displayed")&&0===e.data("title").replace(/<(.|\n)*?>/g,"").length&&0===e.data("title-displayed").replace(/<(.|\n)*?>/g,"").length)return e.removeClass("bp-toggle-action-button-hover"),e.addClass("bp-toggle-action-button"),!1;h(document.body).hasClass("buddyboss-theme")&&void 0!==e.data("balloon")&&(e.hasClass("following")||e.attr("data-balloon",e.data("title-displayed").replace(/<(.|\n)*?>/g,"")),e.find("span").html(e.data("title-displayed"))),e.html(e.data("title-displayed")),e.removeClass("bp-toggle-action-button-hover"),e.addClass("bp-toggle-action-button")}},awaitingButtonHover:function(e){var t=h(e.currentTarget);if(e.preventDefault(),t.hasClass("bp-toggle-action-button"))return h(document.body).hasClass("buddyboss-theme")&&void 0!==t.data("balloon")&&(t.hasClass("following")||t.attr("data-balloon",t.data("title").replace(/<(.|\n)*?>/g,"")),t.find("span").html(t.data("title"))),t.html(t.data("title")),t.removeClass("bp-toggle-action-button"),t.addClass("bp-toggle-action-button-hover"),!1},awaitingButtonHoverout:function(e){e=h(e.currentTarget);e.hasClass("bp-toggle-action-button-hover")&&!e.hasClass("loading")&&(h(document.body).hasClass("buddyboss-theme")&&void 0!==e.data("balloon")&&(e.hasClass("following")||e.attr("data-balloon",e.data("title-displayed").replace(/<(.|\n)*?>/g,"")),e.find("span").html(e.data("title-displayed"))),e.html(e.data("title-displayed")),e.removeClass("bp-toggle-action-button-hover"),e.addClass("bp-toggle-action-button"))},leaveGroupAction:function(e){e.preventDefault(),h("body").find('[data-current-anchor="true"]').removeClass("bp-toggle-action-button bp-toggle-action-button-hover").addClass("bp-toggle-action-button-clicked"),h("body").find('[data-current-anchor="true"]').trigger("click")},leaveGroupClose:function(e){e.preventDefault();e=h(e.currentTarget),e=h(e).closest(".bb-leave-group-popup");h("body").find('[data-current-anchor="true"]').attr("data-current-anchor","false"),h("body").find('[data-popup-shown="true"]').attr("data-popup-shown","false"),e.find(".bb-leave-group-content .bb-group-name").html(""),e.hide()},removeConnectionAction:function(e){e.preventDefault(),h("body").find('[data-current-anchor="true"]').removeClass("bp-toggle-action-button bp-toggle-action-button-hover").addClass("bp-toggle-action-button-clicked"),h("body").find('[data-current-anchor="true"]').trigger("click")},removeConnectionClose:function(e){e.preventDefault();e=h(e.currentTarget),e=h(e).closest(".bb-remove-connection");h("body").find('[data-current-anchor="true"]').attr("data-current-anchor","false"),h("body").find('[data-popup-shown="opened"]').attr("data-popup-shown","closed"),e.find(".bb-remove-connection-content .bb-user-name").html(""),e.hide()},buttonRevertAll:function(){h.each(h("#buddypress [data-bp-btn-action]"),function(){h(this).hasClass("bp-toggle-action-button-clicked")&&!h(this).hasClass("loading")&&(h(document.body).hasClass("buddyboss-theme")&&void 0!==h(this).data("balloon")?h(this).attr("data-balloon",h(this).data("title-displayed")):h(this).text(h(this).data("title-displayed")),h(this).removeClass("bp-toggle-action-button-clicked"),h(this).addClass("bp-toggle-action-button"),h(this).trigger("blur"))})},addRemoveInvite:function(e){var t=e.currentTarget,a=h(t).closest("tbody");if(h(t).hasClass("field-actions-remove")){if(!(1"+e+"").insertBefore(h(this).closest("tr")),20 input").attr("name","invitee["+e+"][]"),h(this).find(".field-name > input").attr("id","invitee_"+e+"_title"),h(this).find(".field-email > input").attr("name","email["+e+"][]"),h(this).find(".field-email > input").attr("id","email_"+e+"_email"),h(this).find(".field-member-type > select").attr("name","member-type["+e+"][]"),h(this).find(".field-member-type > select").attr("id","member_type_"+e+"_member_type")})},closeNotice:function(e){var t=h(e.currentTarget);e.preventDefault(),"clear"===t.data("bp-close")&&(void 0!==h.cookie("bp-message")&&h.removeCookie("bp-message"),void 0!==h.cookie("bp-message-type")&&h.removeCookie("bp-message-type")),t.closest(".bp-feedback").hasClass("bp-sitewide-notice")&&bp.Nouveau.ajax({action:"messages_dismiss_sitewide_notice"},"messages"),t.closest(".bp-feedback").remove()},paginateAction:function(e){var t,a=e.data,i=h(e.currentTarget),o=null,n=null,s=null,r=null,d=i.closest("[data-bp-pagination]").data("bp-pagination")||null;if(null===d)return e;e.preventDefault(),null!==(e=h(e.delegateTarget).data("bp-list")||null)&&(void 0!==(t=a.getStorage("bp-"+e)).scope&&(o=t.scope),void 0!==t.filter&&(n=t.filter),void 0!==t.extras&&(r=t.extras)),null!==e&&(void 0!==(t=a.getStorage("bp-"+e)).scope&&(o=t.scope),void 0!==t.filter&&(n=t.filter),void 0!==t.extras&&(r=t.extras));d={object:e,scope:o,filter:n,search_terms:s=h('#buddypress [data-bp-search="'+e+'"] input[type=search]').length?h('#buddypress [data-bp-search="'+e+'"] input[type=search]').val():s,extras:r,caller:i.closest("[data-bp-pagination]").hasClass("bottom")?"pag-bottom":"",page:a.getLinkParams(i.prop("href"),d)||1};h("#buddypress [data-bp-group-type-filter]").length&&(d.group_type=h("#buddypress [data-bp-group-type-filter]").val()),h("#buddypress [data-bp-member-type-filter]").length&&(d.member_type_id=h("#buddypress [data-bp-member-type-filter]").val()),a.objectRequest(d)},enableSubmitOnLegalAgreement:function(){h("body #buddypress #register-page #signup-form #legal_agreement").length&&(h("body #buddypress #register-page #signup-form .submit #signup_submit").prop("disabled",!0),h(document).on("change","body #buddypress #register-page #signup-form #legal_agreement",function(){h(this).prop("checked")?h("body #buddypress #register-page #signup-form .submit #signup_submit").prop("disabled",!1):h("body #buddypress #register-page #signup-form .submit #signup_submit").prop("disabled",!0)}))},registerPopUp:function(){h(".popup-modal-register").length&&h(".popup-modal-register").magnificPopup({type:"inline",preloader:!1,fixedBgPos:!0,fixedContentPos:!0}),h(".popup-modal-dismiss").length&&h(".popup-modal-dismiss").click(function(e){e.preventDefault(),h.magnificPopup.close()})},loginPopUp:function(){h(".popup-modal-login").length&&h(".popup-modal-login").magnificPopup({type:"inline",preloader:!1,fixedBgPos:!0,fixedContentPos:!0}),h(".popup-modal-dismiss").length&&h(".popup-modal-dismiss").click(function(e){e.preventDefault(),h.magnificPopup.close()})},threadListBlockPopup:function(e){e.preventDefault();var t=h(this).data("bp-content-id"),a=h(this).data("bp-content-type"),i=h(this).data("bp-nonce"),o=h(this).attr("href");void 0!==t&&void 0!==a&&void 0!==i&&(h(document).find(".bp-report-form-err").empty(),(e=h(o)).find(".bp-content-id").val(t),e.find(".bp-content-type").val(a),e.find(".bp-nonce").val(i)),0