(()=>{"use strict";var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var o in r)e.o(r,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:r[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.blocks,r=window.React,o=window.wp.blockEditor,l=window.wp.components,s=window.wp.i18n,a=window.wp.serverSideRender;var n=e.n(a);const i=[{label:(0,s._x)("Newest","Groups","buddypress"),value:"newest"},{label:(0,s._x)("Active","Groups","buddypress"),value:"active"},{label:(0,s._x)("Popular","Groups","buddypress"),value:"popular"},{label:(0,s._x)("Alphabetical","Groups","buddypress"),value:"alphabetical"}],u=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"bp/dynamic-groups","title":"Dynamic Groups List","category":"widgets","icon":"buddicons-groups","description":"A dynamic list of recently active, popular, newest, or alphabetical groups.","keywords":["BuddyPress","groups","community"],"textdomain":"buddypress","attributes":{"title":{"type":"string","default":""},"maxGroups":{"type":"number","default":5},"groupDefault":{"type":"string","default":"active"},"linkTitle":{"type":"boolean","default":false}},"supports":{"align":true},"editorScript":"file:index.js","style":"file:index.css"}');(0,t.registerBlockType)(u,{icon:{background:"#fff",foreground:"#d84800",src:"buddicons-groups"},edit:({attributes:e,setAttributes:t})=>{const a=(0,o.useBlockProps)(),{title:u,maxGroups:p,groupDefault:d,linkTitle:c}=e,b=u||(0,s.__)("Groups","buddypress"),y={...e,title:b};return(0,r.createElement)("div",{...a},(0,r.createElement)(o.InspectorControls,null,(0,r.createElement)(l.PanelBody,{title:(0,s.__)("Settings","buddypress"),initialOpen:!0},(0,r.createElement)(l.TextControl,{label:(0,s.__)("Title","buddypress"),value:b,onChange:e=>{t({title:e})}}),(0,r.createElement)(l.RangeControl,{label:(0,s.__)("Max groups to show","buddypress"),value:p,onChange:e=>t({maxGroups:e}),min:1,max:10,required:!0}),(0,r.createElement)(l.SelectControl,{label:(0,s.__)("Default groups to show","buddypress"),value:d,options:i,onChange:e=>{t({groupDefault:e})}}),(0,r.createElement)(l.ToggleControl,{label:(0,s.__)("Link block title to Groups directory","buddypress"),checked:!!c,onChange:()=>{t({linkTitle:!c})}}))),(0,r.createElement)(l.Disabled,null,(0,r.createElement)(n(),{block:"bp/dynamic-groups",attributes:y})))}})})();