1"use strict";(self.rspackChunkcircle=self.rspackChunkcircle||[]).push([[78588],{805354(e,t,s){s.d(t,{SuggestedSpacesSection:()=>v});var n=s(391426),r=s(933578),a=s(417980),i=s(288513),c=s(570310);function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var s=0,n=Array(t);s<t;s++)n[s]=e[s];return n}var l=function(e){var t,s=e.initialPage,l=e.fetchNewPage,d=function(e){if(Array.isArray(e))return e}(t=(0,r.useState)(void 0===s?2:s))||function(e){var t,s,n=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r=[],a=!0,i=!1;try{for(n=n.call(e);!(a=(t=n.next()).done)&&(r.push(t.value),2!==r.length);a=!0);}catch(e){i=!0,s=e}finally{try{a||null==n.return||n.return()}finally{if(i)throw s}}return r}}(t)||function(e){if(e){if("string"==typeof e)return o(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return o(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),u=d[0],m=d[1],p=function(){m(u+1)},h=function(){l(u),p()};return(0,n.jsx)("div",{className:(0,c.x)((0,i._h)("pagination-load-more"),"flex justify-center pt-8"),children:(0,n.jsx)("button",{type:"button",className:(0,i.W2)("btn btn-secondary"),onClick:function(){return h()},children:(0,a.t)("show_more_button")})})},d=s(269131),u=s(41907),m=s(938372),p=s.n(m),h=s(595260),g=s(202090),f=function(e){var t=e.id,s=e.url,o=e.emoji,l=e.customEmojiUrl,m=e.customEmojiDarkUrl,p=e.name,f=e.totalMembers,x=e.shouldHideMembersCount,_=e.handleJoinSpace,j=(0,h.G)(),b=j.isJoined,v=j.joinSpace,y=(0,g.wR)().currentAppearance;return(0,r.useEffect)(function(){b&&_(t)},[b]),(0,n.jsx)("div",{className:(0,i.W2)("space-card"),children:(0,n.jsxs)("div",{className:(0,i.W2)("space-card__inside"),children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:(0,i.W2)("space-card__icon"),children:(0,n.jsx)("a",{href:s,children:(0,n.jsx)(d.K,{className:(0,c.x)((0,i.W2)("title-emoji"),"!h-10 !max-h-10 !w-10"),emoji:o,appearance:y,customEmojiUrl:l,customEmojiDarkUrl:m})})}),(0,n.jsx)("div",{className:(0,c.x)((0,i.W2)("space-card__title"),"truncate"),children:(0,n.jsx)("a",{href:s,children:(0,n.jsx)("span",{className:(0,i.W2)("title-name"),"data-testid":"title-name",children:p})})})]}),(0,n.jsx)("div",{className:(0,i.W2)("space-card__members"),children:!x&&(0,n.jsx)("span",{children:(0,a.t)("settings.manage_members.member_count",{count:f,formattedCount:(0,u.Rt)(f)})})}),(0,n.jsx)("div",{className:(0,i.W2)("space-card__actions"),children:b?(0,n.jsx)("span",{className:(0,i.W2)("btn btn-secondary"),children:(0,a.t)("joined")}):(0,n.jsx)("button",{type:"button",className:(0,i.W2)("btn btn-secondary"),onClick:function(){return v(t)},children:(0,a.t)("join_space")})})]})})};f.propTypes={id:p().string,url:p().string,emoji:p().string,customEmojiUrl:p().string,customEmojiDarkUrl:p().string,name:p().string,totalMembers:p().number,handleJoinSpace:p().func};var x=s(568316),_=s(820844),j=s(288349),b=function(){return(0,n.jsx)("div",{"data-testid":"suggested-spaces-empty-state",children:(0,n.jsx)(j.p,{header:(0,a.t)("feed"),description:(0,a.t)("landing_page.settings.empty_suggested_spaces_text")})})},v=function(){var e=(0,_.G)(),t=e.spaces,s=void 0===t?[]:t,o=e.fetchSpaceSuggestions,d=e.participatingSpacesIds,u=e.spacesHasNextPage,m=e.setParticipatingSpacesIds,p=(d||{}).size,h=void 0===p?0:p,g=s.length;(0,r.useEffect)(function(){o({page:1})},[]);var j=function(e){var t=new Set(d);t.add(e),m(t)},v=(0,r.useMemo)(function(){return Math.max(3-h,0)},[h]);return(0,r.useMemo)(function(){return g>=v},[g,v])?(0,n.jsxs)("div",{className:(0,c.x)((0,i.W2)("suggested-spaces"),"mb-20 px-5 pt-6 lg:px-0"),children:[(0,n.jsxs)("div",{className:(0,c.x)((0,i._h)("suggested-spaces__header"),"flex flex-col lg:flex-row justify-between text-center lg:text-left mb-8"),children:[(0,n.jsxs)("div",{className:(0,c.x)((0,i.W2)("header__left"),"mb-5 lg:mb-0"),children:[(0,n.jsx)("div",{className:(0,
1c.x)((0,i.W2)("header__title"),"text-dark"),children:(0,n.jsx)("div",{className:"mb-1",children:v>0?(0,n.jsx)(x.o.TitleMd,{weight:"font-normal",children:(0,a.t)("home_page.suggested_spaces.join_count_spaces",{count:v})}):(0,n.jsx)(x.o.TitleMd,{weight:"font-normal",children:(0,a.t)("home_page.suggested_spaces.you_are_ready")})})}),(0,n.jsx)("div",{className:(0,c.x)((0,i._h)("header__subtitle"),"text-default"),children:v>0?(0,a.t)("home_page.suggested_spaces.to_get_started"):(0,a.t)("home_page.suggested_spaces.click_continue")})]}),(0,n.jsx)("div",{className:(0,c.x)((0,i._h)("header__right"),"flex justify-center lg:justify-end"),children:(0,n.jsx)("button",{type:"button",className:(0,i.W2)("btn btn-primary"),disabled:d.size<3,onClick:function(){return window.location.reload()},children:(0,a.t)("home_page.suggested_spaces.continue")})})]}),(0,n.jsx)("div",{className:(0,c.x)((0,i.W2)("suggested-spaces__listing"),"grid grid-cols-[repeat(auto-fill,minmax(200px,1fr))] gap-8 p-0"),children:s.map(function(e){return(0,n.jsx)(f,{id:e.id,url:e.url,emoji:e.emoji,customEmojiUrl:e.custom_emoji_url,customEmojiDarkUrl:e.custom_emoji_dark_url,name:e.name,totalMembers:e.total_members,shouldHideMembersCount:e.hide_members_count,handleJoinSpace:j},e.id)})}),u&&(0,n.jsx)(l,{fetchNewPage:function(e){return o({page:e})},initialPage:2})]}):(0,n.jsx)(b,{})}}}]); 2//# sourceMappingURL=/packs/js/HomeSuggestedSpacesSection-5611c83b0114817e.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.