From 2a0fd573c10322d66209429e5e3f31e0d515781d Mon Sep 17 00:00:00 2001 From: annrra Date: Fri, 10 May 2024 09:35:13 +0300 Subject: [PATCH] [PROD-7388] grunt --- src/bp-templates/bp-nouveau/js/buddypress-nouveau.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bp-templates/bp-nouveau/js/buddypress-nouveau.min.js b/src/bp-templates/bp-nouveau/js/buddypress-nouveau.min.js index bf50f99859..9b27f16970 100644 --- a/src/bp-templates/bp-nouveau/js/buddypress-nouveau.min.js +++ b/src/bp-templates/bp-nouveau/js/buddypress-nouveau.min.js @@ -1 +1 @@ -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(),this.xProfileBlock(),"undefined"!=typeof BB_Nouveau_Presence&&this.userPresenceStatus();var r=this;h(document).on("bb_trigger_toast_message",function(e,t,i,a,n,o,s){r.bbToastMessage(t,i,a,n,o,s)}),bp.Nouveau.lazyLoad(".lazy"),h(window).on("scroll resize",function(){bp.Nouveau.lazyLoad(".lazy")})},bbToastMessage:function(e,t,i,a,n,o){var s,r,d,l,c,p,u;function b(){h(r).removeClass("pull-animation").addClass("close-item").delay(500).remove()}t&&""!=t.trim()&&(s="unique-"+Math.floor(1e6*Math.random()),r="."+s,d="",o=o&&"number"==typeof o?1e3*o:5e3,null!==a&&(d="has-url"),p=c=l="",p+='
',p+='
',e&&(p+=''+e+""),t&&(p+=''+t+""),p+="
",p+='
',p+=a?'':"",h((h(".bb-toast-messages-enable").length||(h(".bb-onscreen-notification-enable ul.notification-list").length?(u=h(".bb-onscreen-notification").hasClass("bb-position-left")?"left":"right",u=h('
    '),h(".bb-onscreen-notification").show(),h(u).insertBefore(".bb-onscreen-notification-enable ul.notification-list")):(u=h('
      '),h("body").append(u))),".bb-toast-messages-enable .toast-messages-list")).append('
    • '+p+"
    • "),n&&setInterval(function(){b()},o),h(r+" .actions .action-close").on("click",function(){b()}))},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 i;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&&(i=h(".buddypress_object_nav .widget-title").html(),h("body").find('*:contains("'+i+'")').each(function(e,t){h(t).hasClass("widget-title")||i!==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,i){var a=this.getStorage(e);return void 0===i&&void 0!==a[t]?delete a[t]:a[t]=i,sessionStorage.setItem(e,JSON.stringify(a)),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 i=t||{amp:"&",lt:"<",gt:">",quot:'"',"#039":"'"};return decodeURIComponent(e.replace(/\+/g," ")).replace(/&([^;]+);/g,function(e,t){return i[t]||""})},ajax:function(e,t,i){this.ajax_request&&void 0===i&&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,i){h(e).length&&t&&(("append"===(i=i||"reset")?h(e).append(t):"prepend"===i?h(e).prepend(t):"after"===i?h(e).after(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="",i="",a="",n=0;if(0<=e.indexOf("http://")?(a=e.indexOf("http://"),n=1):0<=e.indexOf("https://")?(a=e.indexOf("https://"),n=1):0<=e.indexOf("www.")&&(a=e.indexOf("www"),n=1),1===n){for(var o=a;o p:first").hide()}},objectRequest:function(a){var e,n,o=this;if((a=h.extend({object:"",scope:null,filter:null,target:"#buddypress [data-bp-list]",search_terms:"",page:1,extras:null,caller:null,template:null,method:"reset"},a)).object&&a.target)return"activity"==a.object&&"#buddypress [data-bp-list] ul.bp-list"==a.target&&(a.target="#buddypress [data-bp-list] ul.bp-list:not(#bb-media-model-container ul.bp-list)"),["members","activity","media","document"].includes(a.object)&&!h(this.objectNavParent+' [data-bp-scope="'+a.scope+'"]').length&&(a.scope="all"),a.search_terms&&(a.search_terms=a.search_terms.replace(//g,">")),null!==a.scope&&this.setStorage("bp-"+a.object,"scope",a.scope),null!==a.filter&&this.setStorage("bp-"+a.object,"filter",a.filter),null!==a.extras&&this.setStorage("bp-"+a.object,"extras",a.extras),h(this.objectNavParent+" [data-bp-object]").each(function(){h(this).removeClass("selected loading")}),(h(this.objectNavParent+' [data-bp-scope="'+a.scope+'"]').length?h(this.objectNavParent+' [data-bp-scope="'+a.scope+'"], #object-nav li.current'):h(this.objectNavParent+" [data-bp-scope]:eq(0), #object-nav li.current")).addClass("selected loading"),0===h(this.objectNavParent+' [data-bp-scope="'+a.scope+'"]').length&&(e=["group_members"===a.object&&h("body").hasClass("group-members"),"activity"===a.object&&h("body.groups").hasClass("activity"),"document"===a.object&&h("body").hasClass("documents"),"manage_group_members"===a.object&&h("body").hasClass("manage-members"),"document"===a.object&&(h("body").hasClass("document")||h("body").hasClass("documents"))],n=[h(".groups .group-search.members-search"),h(".groups .group-search.activity-search"),h(".documents .bp-document-listing .bb-title"),h(".groups .group-search.search-wrapper"),h("#bp-media-single-folder .bb-title")],e.forEach(function(e,t){e&&n[t].addClass("loading")})),h('#buddypress [data-bp-filter="'+a.object+'"] option[value="'+a.filter+'"]').prop("selected",!0),"friends"===a.object||"group_members"===a.object||"manage_group_members"===a.object?(a.template=a.object,a.object="members"):"group_requests"===a.object?(a.object="groups",a.template="group_requests"):"group_subgroups"===a.object?(a.object="groups",a.template="group_subgroups"):"notifications"===a.object&&(a.object="members",a.template="member_notifications"),e=h.extend({action:a.object+"_filter"},a),this.ajax(e,a.object).done(function(e){if(!1!==e.success&&!_.isUndefined(e.data)){if(_.isUndefined(e.data.layout)||(h(".layout-view").removeClass("active"),h(".layout-"+e.data.layout+"-view").addClass("active")),!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="'+a.scope+'"]').removeClass("loading"),h(o.objectNavParent+' [data-bp-scope="'+a.scope+'"]').find("span").text(""),0===h(o.objectNavParent+' [data-bp-scope="'+a.scope+'"]').length&&n.forEach(function(e){e.removeClass("loading")}),_.isUndefined(e.data)||_.isUndefined(e.data.count)||h(o.objectNavParent+' [data-bp-scope="'+a.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 i;"reset"!==a.method?(o.inject(a.target,e.data.contents,a.method),h(a.target).trigger("bp_ajax_"+a.method,h.extend(a,{response:e.data}))):"pag-bottom"===a.caller?(i=null,i=h("#subnav").length?h("#subnav").parent():h(a.target),h("html,body").animate({scrollTop:i.offset().top},"slow",function(){h(a.target).fadeOut(100,function(){o.inject(this,e.data.contents,a.method),h(this).fadeIn(100),h(a.target).trigger("bp_ajax_request",h.extend(a,{response:e.data})),bp.Nouveau.lazyLoad&&setTimeout(function(){bp.Nouveau.lazyLoad(".lazy")},1e3)})})):h(a.target).fadeOut(100,function(){o.inject(this,e.data.contents,a.method),h(this).fadeIn(100),h(a.target).trigger("bp_ajax_request",h.extend(a,{response:e.data})),bp.Nouveau.lazyLoad&&setTimeout(function(){bp.Nouveau.lazyLoad(".lazy")},1e3)}),setTimeout(function(){o.reportPopUp(),o.reportedPopup(),h(".activity-item.bb-closed-comments").find(".edit-activity, .acomment-edit").parents(".generic-button").hide()},1e3)}})},initObjects:function(){var a,n=this,o={},s="all",r="",d=null,l=null;h.each(this.objects,function(e,t){var i;h('#buddypress [data-bp-list="'+t+'"][data-ajax="false"]').length||(a=n.getStorage("bp-"+t),void 0!==(i=window.location.hash.substr(1))&&"following"==i?s=i:void 0!==a.scope&&(s=a.scope),void 0!==a.extras&&"notifications"!==t&&(d=a.extras),h('#buddypress [data-bp-filter="'+t+'"]').length&&(void 0!==a.filter?(l=a.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!==n.querystring&&(void 0!==n.querystring[t+"_search"]?r=decodeURI(n.querystring[t+"_search"]):void 0!==n.querystring.s&&(r=decodeURI(n.querystring.s)),r&&h('#buddypress [data-bp-search="'+t+'"] input[type=search]').val(r)),h('#buddypress [data-bp-list="'+t+'"]').length&&(o={object:t,scope:s,filter:l,search_terms:r,extras:d},h('#buddypress [data-bp-member-type-filter="'+t+'"]').length?o.member_type_id=h('#buddypress [data-bp-member-type-filter="'+t+'"]').val():h('#buddypress [data-bp-group-type-filter="'+t+'"]').length&&(o.group_type=h('#buddypress [data-bp-group-type-filter="'+t+'"]').val()),n.objectRequest(o)))})},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]").on("keyup","input[name=group_members_search]",this,_.throttle(this.searchQuery,900)),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",'.search-form-has-reset input[type="search"], .search-form-has-reset input#bbp_search',_.throttle(this.directorySearchInput,900)),h(document).on("click",".search-form-has-reset .search-form_reset",this.resetDirectorySearch),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 i,a,n,o,s,r;"1"==h(".bb-onscreen-notification").data("enable")&&(void 0===t.on_screen_notifications&&""===t.on_screen_notifications||(i=h(".bb-onscreen-notification"),r=(a=i.find(".notification-list")).data("removed-items"),n=a.data("animated-items"),o=[],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 i=h(t).find(".actions .action-close").data("notification-id");"-1"==h.inArray(i,n)?(h(t).addClass("pull-animation"),n.push(i),o.push(i)):h(t).removeClass("pull-animation")}),o.length&&r.each(function(e,t){var i=h(t).find(".actions .action-close").data("notification-id");"-1"==h.inArray(i,o)&&(h(t).removeClass("recent-item"),(t=a.data("border-items")).push(i),a.attr("data-border-items",JSON.stringify(t)))}),a.attr("data-animated-items",JSON.stringify(n)),r.length&&(i.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()),i=h(this).find("input").attr("id"),t=h.trim(h(this).find('input[type="email"]').val()),""===e&&""===t?0:""!==e&&""===t?(i=h(this).find('input[type="email"]').attr("id"),a.push(i)):""===e&&""!==t?(i=h(this).find('input[type="text"]').attr("id"),a.push(i)):l.test(t)?n.push(1):(i=h(this).find('input[type="email"]').attr("id"),a.push(i))}),h(".span_error").remove(),0!==a.length)return a.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(u),!1;if(h("#email_0_email_error").length&&h("#email_0_email_error").remove(),0===n.length){o=h("#invitee_0_title").val(),s=h("#email_0_email").val();return""===o&&""===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):(""!==o&&""===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(u)),!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"),i=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:i},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,i,a=e.data,n=h(e.currentTarget).parent(),o="",s=null,r={};if(n.hasClass("no-ajax")||h(e.currentTarget).hasClass("no-ajax")||!n.attr("data-bp-scope"))return e;if(t=n.data("bp-scope"),i=n.data("bp-object"),!t||!i)return e;e.preventDefault();var e=a.getStorage("bp-"+i);void 0!==e.extras&&"notifications"!==i&&(s=e.extras),e=h("#buddypress").find('[data-bp-filter="'+i+'"]').first().val(),h('#buddypress [data-bp-search="'+i+'"] input[type=search]').length&&(o=h('#buddypress [data-bp-search="'+i+'"] input[type=search]').val()),n.hasClass("dynamic")&&n.find("a span").html(""),r={object:i,scope:t,filter:e,search_terms:o,page:1,extras:s},h('#buddypress [data-bp-member-type-filter="'+i+'"]').length?r.member_type_id=h('#buddypress [data-bp-member-type-filter="'+i+'"]').val():h('#buddypress [data-bp-group-type-filter="'+i+'"]').length&&(r.group_type=h('#buddypress [data-bp-group-type-filter="'+i+'"]').val()),a.objectRequest(r)},filterQuery:function(e){var t=e.data,i=h(e.target).data("bp-filter"),a="all",n=h(e.target).val(),o="",s=!1;if(!i)return e;h(t.objectNavParent+" [data-bp-object].selected").length&&(a=h(t.objectNavParent+" [data-bp-object].selected").data("bp-scope")),h('#buddypress [data-bp-search="'+i+'"] input[type=search]').length&&(o=h('#buddypress [data-bp-search="'+i+'"] input[type=search]').val());e=t.getStorage("bp-"+(i="friends"===i?"members":i));void 0!==e.extras&&"notifications"!==i&&(s=e.extras),"members"===i?t.objectRequest({object:i,scope:a,filter:n,search_terms:o,page:1,extras:s,template:null,member_type_id:h('#buddypress [data-bp-member-type-filter="'+i+'"]').val()}):"groups"===i?t.objectRequest({object:i,scope:a,filter:n,search_terms:o,page:1,extras:s,template:null,group_type:h('#buddypress [data-bp-group-type-filter="'+i+'"]').val()}):t.objectRequest({object:i,scope:a,filter:n,search_terms:o,page:1,extras:s,template:null})},typeGroupFilterQuery:function(e){var t=e.data,i=h(e.target).data("bp-group-type-filter"),a="all",n=null,o=null,s="";if(!i)return e;void 0!==(e=t.getStorage("bp-"+i)).extras&&"notifications"!==i&&(o=e.extras),h('#buddypress [data-bp-filter="'+i+'"]').length&&(void 0!==e.filter?(n=e.filter,h('#buddypress [data-bp-filter="'+i+'"] option[value="'+n+'"]').prop("selected",!0)):"-1"!==h('#buddypress [data-bp-filter="'+i+'"]').val()&&"0"!==h('#buddypress [data-bp-filter="'+i+'"]').val()&&(n=h('#buddypress [data-bp-filter="'+i+'"]').val())),h(t.objectNavParent+" [data-bp-object].selected").length&&(a=h(t.objectNavParent+" [data-bp-object].selected").data("bp-scope")),h('#buddypress [data-bp-search="'+i+'"] input[type=search]').length&&(s=h('#buddypress [data-bp-search="'+i+'"] input[type=search]').val()),t.objectRequest({object:i,scope:a,filter:n,search_terms:s,page:1,template:null,extras:o,group_type:h('#buddypress [data-bp-group-type-filter="'+i+'"]').val()})},typeMemberFilterQuery:function(e){var t=e.data,i=h(e.target).data("bp-member-type-filter"),a="all",n=null,o=null,s="";if(!i)return e;void 0!==(e=t.getStorage("bp-"+(i="friends"===i?"members":i))).extras&&"notifications"!==i&&(o=e.extras),h('#buddypress [data-bp-filter="'+i+'"]').length&&(void 0!==e.filter?(n=e.filter,h('#buddypress [data-bp-filter="'+i+'"] option[value="'+n+'"]').prop("selected",!0)):"-1"!==h('#buddypress [data-bp-filter="'+i+'"]').val()&&"0"!==h('#buddypress [data-bp-filter="'+i+'"]').val()&&(n=h('#buddypress [data-bp-filter="'+i+'"]').val())),h(t.objectNavParent+" [data-bp-object].selected").length&&(a=h(t.objectNavParent+" [data-bp-object].selected").data("bp-scope")),h('#buddypress [data-bp-search="'+i+'"] input[type=search]').length&&(s=h('#buddypress [data-bp-search="'+i+'"] input[type=search]').val()),t.objectRequest({object:i,scope:a,filter:n,search_terms:s,page:1,template:null,extras:o,member_type_id:h('#buddypress [data-bp-member-type-filter="'+i+'"]').val()})},searchQuery:function(e){var t,i,a,n=e.data,o="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"),i=h("#buddypress").find('[data-bp-filter="'+t+'"]').first().val(),a=h(e.delegateTarget).find("input[type=search]").first().val(),h(n.objectNavParent+" [data-bp-object]").length&&(o=h(n.objectNavParent+' [data-bp-object="'+t+'"].selected').data("bp-scope"));e=n.getStorage("bp-"+t);void 0!==e.extras&&"notifications"!==t&&(s=e.extras),n.objectRequest({object:t,scope:o,filter:i,search_terms:a,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 a=e.data,n=h(e.currentTarget),o=n.data("bp-btn-action"),t=n.data("bp-nonce"),s=n.closest("[data-bp-item-id]"),i=s.data("bp-item-id"),r=n.closest(".list-wrap"),d=s.data("bp-item-component"),l="",c=s.data("bp-used-to-component");if(!o||!i||!d)return e;if(e.preventDefault(),n.hasClass("bp-toggle-action-button"))return h(document.body).hasClass("buddyboss-theme")&&void 0!==n.data("balloon")?n.attr("data-balloon",n.data("title")):n.text(n.data("title")),n.removeClass("bp-toggle-action-button"),n.addClass("bp-toggle-action-button-clicked"),!1;if(void 0!==n.data("only-admin"))return void 0!==BP_Nouveau.only_admin_notice&&window.alert(BP_Nouveau.only_admin_notice),!1;if("is_friend"!==o&&(void 0!==BP_Nouveau[o+"_confirm"]&&!1===window.confirm(BP_Nouveau[o+"_confirm"])||n.hasClass("pending")))return!1;var p=h(".bb-leave-group-popup"),u=h(n).data("bb-group-name"),b=h(n).data("bb-group-link");if("leave_group"===o&&"true"!==h(n).attr("data-popup-shown")){if(p.length){var m=p.find(".bb-leave-group-content"),e=!!s.hasClass("has-child");return m.html(e?BP_Nouveau.parent_group_leave_confirm:BP_Nouveau.group_leave_confirm),e||m.find(".bb-group-name").html(''+u+""),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(n).attr("data-current-anchor","true"),h(n).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();b={};h(n).closest("#item-header").length?b=h("#item-header .bb-remove-connection"):h(n).closest('.members[data-bp-list="members"]').length?b=h('.members[data-bp-list="members"] .bb-remove-connection'):h(n).closest('.group_members[data-bp-list="group_members"]').length&&(b=h('.group_members[data-bp-list="group_members"] .bb-remove-connection'));u=h(n).data("bb-user-name"),p=h(n).data("bb-user-link");if("is_friend"===o&&"opened"!==h(n).attr("data-popup-shown")){if(b.length)return b.find(".bb-remove-connection-content .bb-user-name").html(''+u+""),h("body").find('[data-current-anchor="true"]').removeClass("bp-toggle-action-button bp-toggle-action-button-hover").addClass("bp-toggle-action-button-clicked"),b.show(),h(n).attr("data-current-anchor","true"),h(n).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"),b.length&&(b.find(".bb-remove-connection-content .bb-user-name").html(""),b.hide());l=t?a.getLinkParams(t,"_wpnonce"):void 0===n.prop("href")?a.getLinkParams(n.attr("href"),"_wpnonce"):a.getLinkParams(n.prop("href"),"_wpnonce"),u={is_friend:"remove_friend",not_friends:"add_friend",pending:"withdraw_friendship",accept_friendship:"accept_friendship",reject_friendship:"reject_friendship"};"members"===d&&void 0!==u[o]&&(o=u[o],d="friends");b={not_following:"follow",following:"unfollow"};"members"===d&&void 0!==b[o]&&(o=b[o],d="follow"),n.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");u="primary",b="single"===t?n.closest(".header-dropdown"):n.closest(".footer-button-wrap");void 0!==b.length&&0"+e.data.feedback+"","info",null,!0])}var t,i;return(h("#friends-personal-li").length&&(i=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?i.length?h(i).html(e.data.friend_count):h(t).append(''+e.data.friend_count+""):h(i).hide())),void 0!==e.data.is_user&&e.data.is_user)?(n.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(a.objectNavParent+' [data-bp-scope="personal"]').length&&(i=Number(h(a.objectNavParent+' [data-bp-scope="personal"] span').html())||0,-1!==h.inArray(o,["leave_group","remove_friend"])?--i:-1!==h.inArray(o,["join_group"])&&(i+=1),i<0&&(i=0),h(a.objectNavParent+' [data-bp-scope="personal"] span').html(i)),"follow"===d&&0"+e.data.feedback+"","error",null,!0])}).fail(function(){var e,t;["unsubscribe","subscribe"].includes(o)&&(25<(e=h(n).data("bb-group-name")).length&&(e=e.substring(0,25)+"..."),t="
      "+BP_Nouveau.subscriptions.error+""+e+".
      ","subscribe"===o&&(t="
      "+BP_Nouveau.subscriptions.subscribe_error+""+e+"
      "),jQuery(document).trigger("bb_trigger_toast_message",["",t,"error",null,!0])),n.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),i=t.data("bp-btn-action"),a=t.closest("[data-bp-item-id]"),n=a.data("bp-item-id"),a=a.data("bp-item-component");return i&&n&&a?(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,i=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,i=e.data,a=h(e.currentTarget),n=null,o=null,s=null,r=null,d=a.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=i.getStorage("bp-"+e)).scope&&(n=t.scope),void 0!==t.filter&&(o=t.filter),void 0!==t.extras&&(r=t.extras)),null!==e&&(void 0!==(t=i.getStorage("bp-"+e)).scope&&(n=t.scope),void 0!==t.filter&&(o=t.filter),void 0!==t.extras&&(r=t.extras));d={object:e,scope:n,filter:o,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:a.closest("[data-bp-pagination]").hasClass("bottom")?"pag-bottom":"",page:i.getLinkParams(a.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()),i.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"),i=h(this).data("bp-content-type"),a=h(this).data("bp-nonce"),n=h(this).attr("href");void 0!==t&&void 0!==i&&void 0!==a&&(h(document).find(".bp-report-form-err").empty(),(e=h(n)).find(".bp-content-id").val(t),e.find(".bp-content-type").val(i),e.find(".bp-nonce").val(a)),0"),void e.preventDefault();t=h(e.currentTarget).closest("#header-cover-image").height(),i=h(e.currentTarget).closest("#header-cover-image").width(),a=Number(h(e.currentTarget).closest("#cover-image-container").find(".header-cover-img").css("top").replace("px","")),n=h(e.currentTarget).closest("#header-cover-image").width()/h(e.currentTarget).closest("#header-cover-image").find(".header-cover-reposition-wrap img")[0].width,l.closest("#cover-image-container").find(".header-cover-reposition-wrap").show(),(r=h(".header-cover-reposition-wrap img")).guillotine({width:i,height:t,eventOnChange:"guillotinechange",init:{scale:n,y:a&&h(e.currentTarget).closest("#header-cover-image").hasClass("has-position")?-a:d,w:i,h:t}}),r.on("guillotinechange",function(e,t){l.closest("#cover-image-container").find(".header-cover-img").attr("data-top",-t.y)})}else h(e.currentTarget).hasClass("cover-image-save")?(o=h(e.currentTarget),s=h(e.currentTarget).closest("#cover-image-container").find(".header-cover-img"),o.addClass("loading"),h.post(BP_Nouveau.ajaxurl,{action:"save_cover_position",position:s.attr("data-top")}).done(function(e){e.success&&e.data&&""!==e.data.content?(o.removeClass("loading"),o.closest("#cover-image-container").find(".header-cover-reposition-wrap").hide(),o.closest("#header-cover-image:not(.has-position)").addClass("has-position"),s.css({top:e.data.content+"px"})):(o.removeClass("loading"),o.closest("#cover-image-container").find(".header-cover-reposition-wrap").hide())}).fail(function(){o.removeClass("loading"),o.closest("#cover-image-container").find(".header-cover-reposition-wrap").hide()})):h(e.currentTarget).hasClass("cover-image-cancel")&&((r=h(".header-cover-reposition-wrap img")).guillotine({width:0,height:0,init:{scale:1,y:0,w:0,h:0}}),r.guillotine("remove"),h(e.currentTarget).closest("#cover-image-container").find(".header-cover-reposition-wrap").hide(),h(e.currentTarget).closest("#cover-image-container").find(".header-cover-img").attr("data-top",""));e.preventDefault()},coverPhotoCropperAlert:function(e){e.preventDefault(),h("#cover-photo-alert").remove()},toggleMoreOption:function(e){h(e.target).hasClass("bb_more_options_action")||h(e.target).parent().hasClass("bb_more_options_action")?(e.preventDefault(),h(e.target).closest(".bb_more_options").find(".bb_more_options_list").hasClass("is_visible")?h(".bb_more_options").find(".bb_more_options_list").removeClass("is_visible"):(h(".bb_more_options").find(".bb_more_options_list").removeClass("is_visible"),h(e.target).closest(".bb_more_options").find(".bb_more_options_list").addClass("is_visible"))):(h(".bb_more_options").find(".bb_more_options_list").removeClass("is_visible"),h(".optionsOpen").removeClass("optionsOpen"))},getVideoThumb:function(d,l){var e,i=new FileReader;i.onload=function(){var t,e=new Blob([i.result],{type:d.type}),n=URL.createObjectURL(e),o=document.createElement("video");o.src=n;var s=0,r=setInterval(function(){var e;05e4;if(i){var a=document.createElement("img");a.src=t;if(d.previewElement){if(h(d.previewElement).find(l).find("img").length)h(d.previewElement).find(l).find("img").attr("src",t);else h(d.previewElement).find(l).append(a);h(d.previewElement).closest(".dz-preview").addClass("dz-has-thumbnail")}else if(h(l).find("img").length)h(l).find("img").attr("src",t);else h(l).append(a);URL.revokeObjectURL(n)}else{if(s>=2){h(d.previewElement).closest(".dz-preview").addClass("dz-has-no-thumbnail");clearInterval(r)}s++}return i}()||(o.removeEventListener("timeupdate",e),o.pause())}),o.preload="metadata",o.src=n,o.muted=!0,o.playsInline=!0,null!=t&&(o.currentTime=Math.floor(t)),o.play(),clearInterval(r)),2<=s&&(h(d.previewElement).closest(".dz-preview").addClass("dz-has-no-thumbnail"),clearInterval(r)),s++},500)},d.dataURL?((e=new XMLHttpRequest).open("GET",d.dataURL,!0),e.responseType="blob",e.onload=function(){var e;200==this.status&&(e=this.response,i.readAsArrayBuffer(e))},e.send()):i.readAsArrayBuffer(d)},bbWidgetMoreFollowing:function(e){e=h(e.currentTarget).attr("href").split("#");if(1 li").each(function(){t+=h(this).outerWidth()}),t>e.width()-10?(e.data("childerWith",t),t>e.width()&&(0===e.find(".medium-editor-toolbar-actions .medium-editor-action-more").length&&e.find(".medium-editor-toolbar-actions").append('
      • '),e.find(".medium-editor-action-more").show(),t+=e.find(".medium-editor-toolbar-actions .medium-editor-action-more").outerWidth(),h(e.find(".medium-editor-action").get().reverse()).each(function(){h(this).hasClass("medium-editor-action-more-button")||t>e.width()&&(t-=h(this).outerWidth(),e.find(".medium-editor-action-more > ul").prepend(h(this).parent()))}))):e.find(".medium-editor-toolbar-actions .medium-editor-action-more").length&&(h(e.find(".medium-editor-action-more ul > li")).each(function(){t+35 li").length&&e.find(".medium-editor-action-more").hide()),h(e).find(".medium-editor-action-more-button").on("click",function(e){e.preventDefault(),h(this).parent(".medium-editor-action-more").toggleClass("active")}),h(e).find(".medium-editor-action-more ul .medium-editor-action").on("click",function(e){e.preventDefault(),h(this).closest(".medium-editor-action-more").toggleClass("active")}),h(window).one("resize",function(){e.removeClass("wrappingInitialised"),h(e).find(".medium-editor-action-more ul .medium-editor-action").unbind("click")}))},isURL:function(e){return/^(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)?[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,24}(:[0-9]{1,5})?(\/.*)?$/.test(h.trim(e))},closeActionPopup:function(e){e.preventDefault(),h(this).closest(".bb-action-popup").hide()},directorySearchInput:function(){var e,t;h(this).val()===h(this).data("last-value")||""===h(this).val()&&void 0===h(this).data("last-value")||(h(this).data("last-value",h(this).val()),t=(e=h(this).closest(".search-form-has-reset")).find(".search-form_reset"),0"),h(this).hasClass("disabled")||h(this).find("input:checked").length&&(a+=""===a?h(this).find('input[type="checkbox"] + label').text().trim():", "+h(this).find('input[type="checkbox"] + label').text().trim(),o++)}),o===h(this).find(e+':not(:first-child) input[type="checkbox"]').length?1==h(this).find(e+':not(:first-child) input[type="checkbox"]').length||(a=t):a=""===a?i:a,0===h(this).find(e+":first-child .bb-mobile-setting").length?h(this).find(e+":first-child").append('
        '+a+"
          "):h(this).find(e+":first-child .bb-mobile-setting .bb-mobile-setting-anchor").text(a),h(this).find(e+":first-child .bb-mobile-setting ul").html(""),h(this).find(e+":first-child .bb-mobile-setting ul").append(n)})},dropZoneGlobalProgress:function(i){0==h(i.element).find(".dz-global-progress").length&&(h(i.element).append('

          '),h(i.element).addClass("dz-progress-view"),h(i.element).find(".dz-remove-all").click(function(){h.each(i.files,function(e,t){i.removeFile(t)})}));var e="",t=0,a=0;1==i.files.length?(h(i.element).addClass("dz-single-view"),e="Uploading "+i.files[0].name+"",t=i.files[0].upload.progress):(h(i.element).removeClass("dz-single-view"),a=0,h.each(i.files,function(e,t){a+=t.upload.progress}),t=a/i.files.length,e="Uploading "+i.files.length+" files"),h(i.element).find(".dz-global-progress .dz-progress").css("width",t+"%"),h(i.element).find(".dz-global-progress > p").html(e)},userPresenceStatus:function(){window.bb_is_user_active=!0;var e=1e3*parseInt(BB_Nouveau_Presence.idle_inactive_span);bp.Nouveau.userPresenceChecker(e),""!==BB_Nouveau_Presence.heartbeat_enabled&&parseInt(BB_Nouveau_Presence.presence_interval)<=60?(h(document).on("heartbeat-send",function(e,t){var i;void 0!==window.bb_is_user_active&&!0===window.bb_is_user_active&&(i=bp.Nouveau.getPageUserIDs(),t.presence_users=i.join(","))}),h(document).on("heartbeat-tick",function(e,t){t.users_presence&&bp.Nouveau.updateUsersPresence(t.users_presence)})):setInterval(function(){var e,t={};void 0!==window.bb_is_user_active&&!0===window.bb_is_user_active&&(t.ids=bp.Nouveau.getPageUserIDs()),void 0!==t.ids&&void 0!==t.ids.length&&0
          '),n.currentPreviewParent=t.find(".bb-url-scrapper-container")),0
          ").html(e)).find("a.bp-suggestions-mention").remove(),i.find('[rel="nofollow"]').remove(),0<=(e=0<=(e=i.html()).indexOf("/g,""):e).indexOf("http://")?o=this.getURL("http://",e):0<=e.indexOf("https://")?o=this.getURL("https://",e):0<=e.indexOf("www.")&&(o=this.getURL("www",e)),""===o&&""===s||(""!==o&&((e=document.createElement("a")).href=o,e=e.hostname,void 0!==BP_Nouveau.forums.params.excluded_hosts&&-1!==BP_Nouveau.forums.params.excluded_hosts.indexOf(e)&&(o="")),""!==o?this.loadURLPreview(o):s&&this.loadURLPreview(s)))},getURL:function(e,t){var i="",a=(t=t.replace(/ /g,"")).indexOf(e),n="";if(_.isUndefined(jQuery(h.parseHTML(t)).attr("href"))){for(var o=a;o"===t[o+1]||"<"===t[o]&&"b"===t[o+1]&&"r"===t[o+2]);o++)i+=t[o];"www"===e&&(i=(e="http://")+i)}else i=jQuery(t).attr("href");e=document.createElement("div");e.innerHTML=i;for(var s=e.getElementsByTagName("*");s[0];)s[0].parentNode.removeChild(s[0]);return n=0',p+='
          ',e&&(p+=''+e+""),t&&(p+=''+t+""),p+="
          ",p+='
          ',p+=a?'':"",h((h(".bb-toast-messages-enable").length||(h(".bb-onscreen-notification-enable ul.notification-list").length?(u=h(".bb-onscreen-notification").hasClass("bb-position-left")?"left":"right",u=h('
            '),h(".bb-onscreen-notification").show(),h(u).insertBefore(".bb-onscreen-notification-enable ul.notification-list")):(u=h('
              '),h("body").append(u))),".bb-toast-messages-enable .toast-messages-list")).append('
            • '+p+"
            • "),n&&setInterval(function(){b()},o),h(r+" .actions .action-close").on("click",function(){b()}))},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 i;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&&(i=h(".buddypress_object_nav .widget-title").html(),h("body").find('*:contains("'+i+'")').each(function(e,t){h(t).hasClass("widget-title")||i!==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,i){var a=this.getStorage(e);return void 0===i&&void 0!==a[t]?delete a[t]:a[t]=i,sessionStorage.setItem(e,JSON.stringify(a)),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 i=t||{amp:"&",lt:"<",gt:">",quot:'"',"#039":"'"};return decodeURIComponent(e.replace(/\+/g," ")).replace(/&([^;]+);/g,function(e,t){return i[t]||""})},ajax:function(e,t,i){this.ajax_request&&void 0===i&&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,i){h(e).length&&t&&(("append"===(i=i||"reset")?h(e).append(t):"prepend"===i?h(e).prepend(t):"after"===i?h(e).after(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="",i="",a="",n=0;if(0<=e.indexOf("http://")?(a=e.indexOf("http://"),n=1):0<=e.indexOf("https://")?(a=e.indexOf("https://"),n=1):0<=e.indexOf("www.")&&(a=e.indexOf("www"),n=1),1===n){for(var o=a;o p:first").hide()}},objectRequest:function(a){var e,n,o=this;if((a=h.extend({object:"",scope:null,filter:null,target:"#buddypress [data-bp-list]",search_terms:"",page:1,extras:null,caller:null,template:null,method:"reset"},a)).object&&a.target)return"activity"==a.object&&"#buddypress [data-bp-list] ul.bp-list"==a.target&&(a.target="#buddypress [data-bp-list] ul.bp-list:not(#bb-media-model-container ul.bp-list)"),["members","activity","media","document"].includes(a.object)&&!h(this.objectNavParent+' [data-bp-scope="'+a.scope+'"]').length&&(a.scope="all"),a.search_terms&&(a.search_terms=a.search_terms.replace(//g,">")),null!==a.scope&&this.setStorage("bp-"+a.object,"scope",a.scope),null!==a.filter&&this.setStorage("bp-"+a.object,"filter",a.filter),null!==a.extras&&this.setStorage("bp-"+a.object,"extras",a.extras),h(this.objectNavParent+" [data-bp-object]").each(function(){h(this).removeClass("selected loading")}),(h(this.objectNavParent+' [data-bp-scope="'+a.scope+'"]').length?h(this.objectNavParent+' [data-bp-scope="'+a.scope+'"], #object-nav li.current'):h(this.objectNavParent+" [data-bp-scope]:eq(0), #object-nav li.current")).addClass("selected loading"),0===h(this.objectNavParent+' [data-bp-scope="'+a.scope+'"]').length&&(e=["group_members"===a.object&&h("body").hasClass("group-members"),"activity"===a.object&&h("body.groups").hasClass("activity"),"document"===a.object&&h("body").hasClass("documents"),"manage_group_members"===a.object&&h("body").hasClass("manage-members"),"document"===a.object&&(h("body").hasClass("document")||h("body").hasClass("documents"))],n=[h(".groups .group-search.members-search"),h(".groups .group-search.activity-search"),h(".documents .bp-document-listing .bb-title"),h(".groups .group-search.search-wrapper"),h("#bp-media-single-folder .bb-title")],e.forEach(function(e,t){e&&n[t].addClass("loading")})),h('#buddypress [data-bp-filter="'+a.object+'"] option[value="'+a.filter+'"]').prop("selected",!0),"friends"===a.object||"group_members"===a.object||"manage_group_members"===a.object?(a.template=a.object,a.object="members"):"group_requests"===a.object?(a.object="groups",a.template="group_requests"):"group_subgroups"===a.object?(a.object="groups",a.template="group_subgroups"):"notifications"===a.object&&(a.object="members",a.template="member_notifications"),e=h.extend({action:a.object+"_filter"},a),this.ajax(e,a.object).done(function(e){if(!1!==e.success&&!_.isUndefined(e.data)){if(_.isUndefined(e.data.layout)||(h(".layout-view").removeClass("active"),h(".layout-"+e.data.layout+"-view").addClass("active")),!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="'+a.scope+'"]').removeClass("loading"),h(o.objectNavParent+' [data-bp-scope="'+a.scope+'"]').find("span").text(""),0===h(o.objectNavParent+' [data-bp-scope="'+a.scope+'"]').length&&n.forEach(function(e){e.removeClass("loading")}),_.isUndefined(e.data)||_.isUndefined(e.data.count)||h(o.objectNavParent+' [data-bp-scope="'+a.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 i;"reset"!==a.method?(o.inject(a.target,e.data.contents,a.method),h(a.target).trigger("bp_ajax_"+a.method,h.extend(a,{response:e.data}))):"pag-bottom"===a.caller?(i=null,i=h("#subnav").length?h("#subnav").parent():h(a.target),h("html,body").animate({scrollTop:i.offset().top},"slow",function(){h(a.target).fadeOut(100,function(){o.inject(this,e.data.contents,a.method),h(this).fadeIn(100),h(a.target).trigger("bp_ajax_request",h.extend(a,{response:e.data})),bp.Nouveau.lazyLoad&&setTimeout(function(){bp.Nouveau.lazyLoad(".lazy")},1e3)})})):h(a.target).fadeOut(100,function(){o.inject(this,e.data.contents,a.method),h(this).fadeIn(100),h(a.target).trigger("bp_ajax_request",h.extend(a,{response:e.data})),bp.Nouveau.lazyLoad&&setTimeout(function(){bp.Nouveau.lazyLoad(".lazy")},1e3)}),setTimeout(function(){o.reportPopUp(),o.reportedPopup(),h(".activity-item.bb-closed-comments").find(".edit-activity, .acomment-edit").parents(".generic-button").hide()},1e3)}})},initObjects:function(){var a,n=this,o={},s="all",r="",d=null,l=null;h.each(this.objects,function(e,t){var i;h('#buddypress [data-bp-list="'+t+'"][data-ajax="false"]').length||(a=n.getStorage("bp-"+t),void 0!==(i=window.location.hash.substr(1))&&"following"==i?s=i:void 0!==a.scope&&(s=a.scope),void 0!==a.extras&&"notifications"!==t&&(d=a.extras),h('#buddypress [data-bp-filter="'+t+'"]').length&&(void 0!==a.filter?(l=a.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!==n.querystring&&(void 0!==n.querystring[t+"_search"]?r=decodeURI(n.querystring[t+"_search"]):void 0!==n.querystring.s&&(r=decodeURI(n.querystring.s)),r&&h('#buddypress [data-bp-search="'+t+'"] input[type=search]').val(r)),h('#buddypress [data-bp-list="'+t+'"]').length&&(o={object:t,scope:s,filter:l,search_terms:r,extras:d},h('#buddypress [data-bp-member-type-filter="'+t+'"]').length?o.member_type_id=h('#buddypress [data-bp-member-type-filter="'+t+'"]').val():h('#buddypress [data-bp-group-type-filter="'+t+'"]').length&&(o.group_type=h('#buddypress [data-bp-group-type-filter="'+t+'"]').val()),n.objectRequest(o)))})},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]").on("keyup","input[name=group_members_search]",this,_.throttle(this.searchQuery,900)),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",'.search-form-has-reset input[type="search"], .search-form-has-reset input#bbp_search',_.throttle(this.directorySearchInput,900)),h(document).on("click",".search-form-has-reset .search-form_reset",this.resetDirectorySearch),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 i,a,n,o,s,r;"1"==h(".bb-onscreen-notification").data("enable")&&(void 0===t.on_screen_notifications&&""===t.on_screen_notifications||(i=h(".bb-onscreen-notification"),r=(a=i.find(".notification-list")).data("removed-items"),n=a.data("animated-items"),o=[],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 i=h(t).find(".actions .action-close").data("notification-id");"-1"==h.inArray(i,n)?(h(t).addClass("pull-animation"),n.push(i),o.push(i)):h(t).removeClass("pull-animation")}),o.length&&r.each(function(e,t){var i=h(t).find(".actions .action-close").data("notification-id");"-1"==h.inArray(i,o)&&(h(t).removeClass("recent-item"),(t=a.data("border-items")).push(i),a.attr("data-border-items",JSON.stringify(t)))}),a.attr("data-animated-items",JSON.stringify(n)),r.length&&(i.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()),i=h(this).find("input").attr("id"),t=h.trim(h(this).find('input[type="email"]').val()),""===e&&""===t?0:""!==e&&""===t?(i=h(this).find('input[type="email"]').attr("id"),a.push(i)):""===e&&""!==t?(i=h(this).find('input[type="text"]').attr("id"),a.push(i)):l.test(t)?n.push(1):(i=h(this).find('input[type="email"]').attr("id"),a.push(i))}),h(".span_error").remove(),0!==a.length)return a.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(u),!1;if(h("#email_0_email_error").length&&h("#email_0_email_error").remove(),0===n.length){o=h("#invitee_0_title").val(),s=h("#email_0_email").val();return""===o&&""===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):(""!==o&&""===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(u)),!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"),i=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:i},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,i,a=e.data,n=h(e.currentTarget).parent(),o="",s=null,r={};if(n.hasClass("no-ajax")||h(e.currentTarget).hasClass("no-ajax")||!n.attr("data-bp-scope"))return e;if(t=n.data("bp-scope"),i=n.data("bp-object"),!t||!i)return e;e.preventDefault();var e=a.getStorage("bp-"+i);void 0!==e.extras&&"notifications"!==i&&(s=e.extras),e=h("#buddypress").find('[data-bp-filter="'+i+'"]').first().val(),h('#buddypress [data-bp-search="'+i+'"] input[type=search]').length&&(o=h('#buddypress [data-bp-search="'+i+'"] input[type=search]').val()),n.hasClass("dynamic")&&n.find("a span").html(""),r={object:i,scope:t,filter:e,search_terms:o,page:1,extras:s},h('#buddypress [data-bp-member-type-filter="'+i+'"]').length?r.member_type_id=h('#buddypress [data-bp-member-type-filter="'+i+'"]').val():h('#buddypress [data-bp-group-type-filter="'+i+'"]').length&&(r.group_type=h('#buddypress [data-bp-group-type-filter="'+i+'"]').val()),a.objectRequest(r)},filterQuery:function(e){var t=e.data,i=h(e.target).data("bp-filter"),a="all",n=h(e.target).val(),o="",s=!1;if(!i)return e;h(t.objectNavParent+" [data-bp-object].selected").length&&(a=h(t.objectNavParent+" [data-bp-object].selected").data("bp-scope")),h('#buddypress [data-bp-search="'+i+'"] input[type=search]').length&&(o=h('#buddypress [data-bp-search="'+i+'"] input[type=search]').val());e=t.getStorage("bp-"+(i="friends"===i?"members":i));void 0!==e.extras&&"notifications"!==i&&(s=e.extras),"members"===i?t.objectRequest({object:i,scope:a,filter:n,search_terms:o,page:1,extras:s,template:null,member_type_id:h('#buddypress [data-bp-member-type-filter="'+i+'"]').val()}):"groups"===i?t.objectRequest({object:i,scope:a,filter:n,search_terms:o,page:1,extras:s,template:null,group_type:h('#buddypress [data-bp-group-type-filter="'+i+'"]').val()}):t.objectRequest({object:i,scope:a,filter:n,search_terms:o,page:1,extras:s,template:null})},typeGroupFilterQuery:function(e){var t=e.data,i=h(e.target).data("bp-group-type-filter"),a="all",n=null,o=null,s="";if(!i)return e;void 0!==(e=t.getStorage("bp-"+i)).extras&&"notifications"!==i&&(o=e.extras),h('#buddypress [data-bp-filter="'+i+'"]').length&&(void 0!==e.filter?(n=e.filter,h('#buddypress [data-bp-filter="'+i+'"] option[value="'+n+'"]').prop("selected",!0)):"-1"!==h('#buddypress [data-bp-filter="'+i+'"]').val()&&"0"!==h('#buddypress [data-bp-filter="'+i+'"]').val()&&(n=h('#buddypress [data-bp-filter="'+i+'"]').val())),h(t.objectNavParent+" [data-bp-object].selected").length&&(a=h(t.objectNavParent+" [data-bp-object].selected").data("bp-scope")),h('#buddypress [data-bp-search="'+i+'"] input[type=search]').length&&(s=h('#buddypress [data-bp-search="'+i+'"] input[type=search]').val()),t.objectRequest({object:i,scope:a,filter:n,search_terms:s,page:1,template:null,extras:o,group_type:h('#buddypress [data-bp-group-type-filter="'+i+'"]').val()})},typeMemberFilterQuery:function(e){var t=e.data,i=h(e.target).data("bp-member-type-filter"),a="all",n=null,o=null,s="";if(!i)return e;void 0!==(e=t.getStorage("bp-"+(i="friends"===i?"members":i))).extras&&"notifications"!==i&&(o=e.extras),h('#buddypress [data-bp-filter="'+i+'"]').length&&(void 0!==e.filter?(n=e.filter,h('#buddypress [data-bp-filter="'+i+'"] option[value="'+n+'"]').prop("selected",!0)):"-1"!==h('#buddypress [data-bp-filter="'+i+'"]').val()&&"0"!==h('#buddypress [data-bp-filter="'+i+'"]').val()&&(n=h('#buddypress [data-bp-filter="'+i+'"]').val())),h(t.objectNavParent+" [data-bp-object].selected").length&&(a=h(t.objectNavParent+" [data-bp-object].selected").data("bp-scope")),h('#buddypress [data-bp-search="'+i+'"] input[type=search]').length&&(s=h('#buddypress [data-bp-search="'+i+'"] input[type=search]').val()),t.objectRequest({object:i,scope:a,filter:n,search_terms:s,page:1,template:null,extras:o,member_type_id:h('#buddypress [data-bp-member-type-filter="'+i+'"]').val()})},searchQuery:function(e){var t,i,a,n=e.data,o="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"),i=h("#buddypress").find('[data-bp-filter="'+t+'"]').first().val(),a=h(e.delegateTarget).find("input[type=search]").first().val(),h(n.objectNavParent+" [data-bp-object]").length&&(o=h(n.objectNavParent+' [data-bp-object="'+t+'"].selected').data("bp-scope"));e=n.getStorage("bp-"+t);void 0!==e.extras&&"notifications"!==t&&(s=e.extras),n.objectRequest({object:t,scope:o,filter:i,search_terms:a,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 a=e.data,n=h(e.currentTarget),o=n.data("bp-btn-action"),t=n.data("bp-nonce"),s=n.closest("[data-bp-item-id]"),i=s.data("bp-item-id"),r=n.closest(".list-wrap"),d=s.data("bp-item-component"),l="",c=s.data("bp-used-to-component");if(!o||!i||!d)return e;if(e.preventDefault(),n.hasClass("bp-toggle-action-button"))return h(document.body).hasClass("buddyboss-theme")&&void 0!==n.data("balloon")?n.attr("data-balloon",n.data("title")):n.text(n.data("title")),n.removeClass("bp-toggle-action-button"),n.addClass("bp-toggle-action-button-clicked"),!1;if(void 0!==n.data("only-admin"))return void 0!==BP_Nouveau.only_admin_notice&&window.alert(BP_Nouveau.only_admin_notice),!1;if("is_friend"!==o&&(void 0!==BP_Nouveau[o+"_confirm"]&&!1===window.confirm(BP_Nouveau[o+"_confirm"])||n.hasClass("pending")))return!1;var p=h(".bb-leave-group-popup"),u=h(n).data("bb-group-name"),b=h(n).data("bb-group-link");if("leave_group"===o&&"true"!==h(n).attr("data-popup-shown")){if(p.length){var m=p.find(".bb-leave-group-content"),e=!!s.hasClass("has-child");return m.html(e?BP_Nouveau.parent_group_leave_confirm:BP_Nouveau.group_leave_confirm),e||m.find(".bb-group-name").html(''+u+""),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(n).attr("data-current-anchor","true"),h(n).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();b={};h(n).closest("#item-header").length?b=h("#item-header .bb-remove-connection"):h(n).closest('.members[data-bp-list="members"]').length?b=h('.members[data-bp-list="members"] .bb-remove-connection'):h(n).closest('.group_members[data-bp-list="group_members"]').length&&(b=h('.group_members[data-bp-list="group_members"] .bb-remove-connection'));u=h(n).data("bb-user-name"),p=h(n).data("bb-user-link");if("is_friend"===o&&"opened"!==h(n).attr("data-popup-shown")){if(b.length)return b.find(".bb-remove-connection-content .bb-user-name").html(''+u+""),h("body").find('[data-current-anchor="true"]').removeClass("bp-toggle-action-button bp-toggle-action-button-hover").addClass("bp-toggle-action-button-clicked"),b.show(),h(n).attr("data-current-anchor","true"),h(n).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"),b.length&&(b.find(".bb-remove-connection-content .bb-user-name").html(""),b.hide());l=t?a.getLinkParams(t,"_wpnonce"):void 0===n.prop("href")?a.getLinkParams(n.attr("href"),"_wpnonce"):a.getLinkParams(n.prop("href"),"_wpnonce"),u={is_friend:"remove_friend",not_friends:"add_friend",pending:"withdraw_friendship",accept_friendship:"accept_friendship",reject_friendship:"reject_friendship"};"members"===d&&void 0!==u[o]&&(o=u[o],d="friends");b={not_following:"follow",following:"unfollow"};"members"===d&&void 0!==b[o]&&(o=b[o],d="follow"),n.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");u="primary",b="single"===t?n.closest(".header-dropdown"):n.closest(".footer-button-wrap");void 0!==b.length&&0"+e.data.feedback+"","info",null,!0])}var t,i;return(h("#friends-personal-li").length&&(i=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?i.length?h(i).html(e.data.friend_count):h(t).append(''+e.data.friend_count+""):h(i).hide())),void 0!==e.data.is_user&&e.data.is_user)?(n.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(a.objectNavParent+' [data-bp-scope="personal"]').length&&(i=Number(h(a.objectNavParent+' [data-bp-scope="personal"] span').html())||0,-1!==h.inArray(o,["leave_group","remove_friend"])?--i:-1!==h.inArray(o,["join_group"])&&(i+=1),i<0&&(i=0),h(a.objectNavParent+' [data-bp-scope="personal"] span').html(i)),"follow"===d&&0"+e.data.feedback+"","error",null,!0])}).fail(function(){var e,t;["unsubscribe","subscribe"].includes(o)&&(25<(e=h(n).data("bb-group-name")).length&&(e=e.substring(0,25)+"..."),t="
              "+BP_Nouveau.subscriptions.error+""+e+".
              ","subscribe"===o&&(t="
              "+BP_Nouveau.subscriptions.subscribe_error+""+e+"
              "),jQuery(document).trigger("bb_trigger_toast_message",["",t,"error",null,!0])),n.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),i=t.data("bp-btn-action"),a=t.closest("[data-bp-item-id]"),n=a.data("bp-item-id"),a=a.data("bp-item-component");return i&&n&&a?(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,i=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,i=e.data,a=h(e.currentTarget),n=null,o=null,s=null,r=null,d=a.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=i.getStorage("bp-"+e)).scope&&(n=t.scope),void 0!==t.filter&&(o=t.filter),void 0!==t.extras&&(r=t.extras)),null!==e&&(void 0!==(t=i.getStorage("bp-"+e)).scope&&(n=t.scope),void 0!==t.filter&&(o=t.filter),void 0!==t.extras&&(r=t.extras));d={object:e,scope:n,filter:o,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:a.closest("[data-bp-pagination]").hasClass("bottom")?"pag-bottom":"",page:i.getLinkParams(a.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()),i.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"),i=h(this).data("bp-content-type"),a=h(this).data("bp-nonce"),n=h(this).attr("href");void 0!==t&&void 0!==i&&void 0!==a&&(h(document).find(".bp-report-form-err").empty(),(e=h(n)).find(".bp-content-id").val(t),e.find(".bp-content-type").val(i),e.find(".bp-nonce").val(a)),0"),void e.preventDefault();t=h(e.currentTarget).closest("#header-cover-image").height(),i=h(e.currentTarget).closest("#header-cover-image").width(),a=Number(h(e.currentTarget).closest("#cover-image-container").find(".header-cover-img").css("top").replace("px","")),n=h(e.currentTarget).closest("#header-cover-image").width()/h(e.currentTarget).closest("#header-cover-image").find(".header-cover-reposition-wrap img")[0].width,l.closest("#cover-image-container").find(".header-cover-reposition-wrap").show(),(r=h(".header-cover-reposition-wrap img")).guillotine({width:i,height:t,eventOnChange:"guillotinechange",init:{scale:n,y:a&&h(e.currentTarget).closest("#header-cover-image").hasClass("has-position")?-a:d,w:i,h:t}}),r.on("guillotinechange",function(e,t){l.closest("#cover-image-container").find(".header-cover-img").attr("data-top",-t.y)})}else h(e.currentTarget).hasClass("cover-image-save")?(o=h(e.currentTarget),s=h(e.currentTarget).closest("#cover-image-container").find(".header-cover-img"),o.addClass("loading"),h.post(BP_Nouveau.ajaxurl,{action:"save_cover_position",position:s.attr("data-top")}).done(function(e){e.success&&e.data&&""!==e.data.content?(o.removeClass("loading"),o.closest("#cover-image-container").find(".header-cover-reposition-wrap").hide(),o.closest("#header-cover-image:not(.has-position)").addClass("has-position"),s.css({top:e.data.content+"px"})):(o.removeClass("loading"),o.closest("#cover-image-container").find(".header-cover-reposition-wrap").hide())}).fail(function(){o.removeClass("loading"),o.closest("#cover-image-container").find(".header-cover-reposition-wrap").hide()})):h(e.currentTarget).hasClass("cover-image-cancel")&&((r=h(".header-cover-reposition-wrap img")).guillotine({width:0,height:0,init:{scale:1,y:0,w:0,h:0}}),r.guillotine("remove"),h(e.currentTarget).closest("#cover-image-container").find(".header-cover-reposition-wrap").hide(),h(e.currentTarget).closest("#cover-image-container").find(".header-cover-img").attr("data-top",""));e.preventDefault()},coverPhotoCropperAlert:function(e){e.preventDefault(),h("#cover-photo-alert").remove()},toggleMoreOption:function(e){h(e.target).hasClass("bb_more_options_action")||h(e.target).parent().hasClass("bb_more_options_action")?(e.preventDefault(),h(e.target).closest(".bb_more_options").find(".bb_more_options_list").hasClass("is_visible")?h(".bb_more_options").find(".bb_more_options_list").removeClass("is_visible"):(h(".bb_more_options").find(".bb_more_options_list").removeClass("is_visible"),h(e.target).closest(".bb_more_options").find(".bb_more_options_list").addClass("is_visible"))):(h(".bb_more_options").find(".bb_more_options_list").removeClass("is_visible"),h(".optionsOpen").removeClass("optionsOpen"))},getVideoThumb:function(d,l){var e,i=new FileReader;i.onload=function(){var t,e=new Blob([i.result],{type:d.type}),n=URL.createObjectURL(e),o=document.createElement("video");o.src=n;var s=0,r=setInterval(function(){var e;05e4;if(i){var a=document.createElement("img");a.src=t;if(d.previewElement){if(h(d.previewElement).find(l).find("img").length)h(d.previewElement).find(l).find("img").attr("src",t);else h(d.previewElement).find(l).append(a);h(d.previewElement).closest(".dz-preview").addClass("dz-has-thumbnail")}else if(h(l).find("img").length)h(l).find("img").attr("src",t);else h(l).append(a);URL.revokeObjectURL(n)}else{if(s>=2){h(d.previewElement).closest(".dz-preview").addClass("dz-has-no-thumbnail");clearInterval(r)}s++}return i}()||(o.removeEventListener("timeupdate",e),o.pause())}),o.preload="metadata",o.src=n,o.muted=!0,o.playsInline=!0,null!=t&&(o.currentTime=Math.floor(t)),o.play(),clearInterval(r)),2<=s&&(h(d.previewElement).closest(".dz-preview").addClass("dz-has-no-thumbnail"),clearInterval(r)),s++},500)},d.dataURL?((e=new XMLHttpRequest).open("GET",d.dataURL,!0),e.responseType="blob",e.onload=function(){var e;200==this.status&&(e=this.response,i.readAsArrayBuffer(e))},e.send()):i.readAsArrayBuffer(d)},bbWidgetMoreFollowing:function(e){e=h(e.currentTarget).attr("href").split("#");if(1 li").each(function(){t+=h(this).outerWidth()}),t>e.width()-10?(e.data("childerWith",t),t>e.width()&&(0===e.find(".medium-editor-toolbar-actions .medium-editor-action-more").length&&e.find(".medium-editor-toolbar-actions").append('
              • '),e.find(".medium-editor-action-more").show(),t+=e.find(".medium-editor-toolbar-actions .medium-editor-action-more").outerWidth(),h(e.find(".medium-editor-action").get().reverse()).each(function(){h(this).hasClass("medium-editor-action-more-button")||t>e.width()&&(t-=h(this).outerWidth(),e.find(".medium-editor-action-more > ul").prepend(h(this).parent()))}))):e.find(".medium-editor-toolbar-actions .medium-editor-action-more").length&&(h(e.find(".medium-editor-action-more ul > li")).each(function(){t+35 li").length&&e.find(".medium-editor-action-more").hide()),h(e).find(".medium-editor-action-more-button").on("click",function(e){e.preventDefault(),h(this).parent(".medium-editor-action-more").toggleClass("active")}),h(e).find(".medium-editor-action-more ul .medium-editor-action").on("click",function(e){e.preventDefault(),h(this).closest(".medium-editor-action-more").toggleClass("active")}),h(window).one("resize",function(){e.removeClass("wrappingInitialised"),h(e).find(".medium-editor-action-more ul .medium-editor-action").unbind("click")}))},isURL:function(e){return/^(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)?[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,24}(:[0-9]{1,5})?(\/.*)?$/.test(h.trim(e))},closeActionPopup:function(e){e.preventDefault(),h(this).closest(".bb-action-popup").hide()},directorySearchInput:function(){var e,t;h(this).val()===h(this).data("last-value")||""===h(this).val()&&void 0===h(this).data("last-value")||(h(this).data("last-value",h(this).val()),t=(e=h(this).closest(".search-form-has-reset")).find(".search-form_reset"),0"),h(this).hasClass("disabled")||h(this).find("input:checked").length&&(a+=""===a?h(this).find('input[type="checkbox"] + label').text().trim():", "+h(this).find('input[type="checkbox"] + label').text().trim(),o++)}),o===h(this).find(e+':not(:first-child) input[type="checkbox"]').length?1==h(this).find(e+':not(:first-child) input[type="checkbox"]').length||(a=t):a=""===a?i:a,0===h(this).find(e+":first-child .bb-mobile-setting").length?h(this).find(e+":first-child").append('
                '+a+"
                  "):h(this).find(e+":first-child .bb-mobile-setting .bb-mobile-setting-anchor").text(a),h(this).find(e+":first-child .bb-mobile-setting ul").html(""),h(this).find(e+":first-child .bb-mobile-setting ul").append(n)})},dropZoneGlobalProgress:function(i){0==h(i.element).find(".dz-global-progress").length&&(h(i.element).append('

                  '),h(i.element).addClass("dz-progress-view"),h(i.element).find(".dz-remove-all").click(function(){h.each(i.files,function(e,t){i.removeFile(t)})}));var e="",t=0,a=0;1==i.files.length?(h(i.element).addClass("dz-single-view"),e=BP_Nouveau.media.i18n_strings.uploading+" "+i.files[0].name+"",t=i.files[0].upload.progress):(h(i.element).removeClass("dz-single-view"),a=0,h.each(i.files,function(e,t){a+=t.upload.progress}),t=a/i.files.length,e=BP_Nouveau.media.i18n_strings.uploading+" "+i.files.length+" files"),h(i.element).find(".dz-global-progress .dz-progress").css("width",t+"%"),h(i.element).find(".dz-global-progress > p").html(e)},userPresenceStatus:function(){window.bb_is_user_active=!0;var e=1e3*parseInt(BB_Nouveau_Presence.idle_inactive_span);bp.Nouveau.userPresenceChecker(e),""!==BB_Nouveau_Presence.heartbeat_enabled&&parseInt(BB_Nouveau_Presence.presence_interval)<=60?(h(document).on("heartbeat-send",function(e,t){var i;void 0!==window.bb_is_user_active&&!0===window.bb_is_user_active&&(i=bp.Nouveau.getPageUserIDs(),t.presence_users=i.join(","))}),h(document).on("heartbeat-tick",function(e,t){t.users_presence&&bp.Nouveau.updateUsersPresence(t.users_presence)})):setInterval(function(){var e,t={};void 0!==window.bb_is_user_active&&!0===window.bb_is_user_active&&(t.ids=bp.Nouveau.getPageUserIDs()),void 0!==t.ids&&void 0!==t.ids.length&&0
                  '),n.currentPreviewParent=t.find(".bb-url-scrapper-container")),0
                  ").html(e)).find("a.bp-suggestions-mention").remove(),i.find('[rel="nofollow"]').remove(),0<=(e=0<=(e=i.html()).indexOf("/g,""):e).indexOf("http://")?o=this.getURL("http://",e):0<=e.indexOf("https://")?o=this.getURL("https://",e):0<=e.indexOf("www.")&&(o=this.getURL("www",e)),""===o&&""===s||(""!==o&&((e=document.createElement("a")).href=o,e=e.hostname,void 0!==BP_Nouveau.forums.params.excluded_hosts&&-1!==BP_Nouveau.forums.params.excluded_hosts.indexOf(e)&&(o="")),""!==o?this.loadURLPreview(o):s&&this.loadURLPreview(s)))},getURL:function(e,t){var i="",a=(t=t.replace(/ /g,"")).indexOf(e),n="";if(_.isUndefined(jQuery(h.parseHTML(t)).attr("href"))){for(var o=a;o"===t[o+1]||"<"===t[o]&&"b"===t[o+1]&&"r"===t[o+2]);o++)i+=t[o];"www"===e&&(i=(e="http://")+i)}else i=jQuery(t).attr("href");e=document.createElement("div");e.innerHTML=i;for(var s=e.getElementsByTagName("*");s[0];)s[0].parentNode.removeChild(s[0]);return n=0