Loading
function(e,t,n){n.d(t,{H:()=>d,X:()=>c});var l=n(627968),r=n(64700),i=n(702841),o=n(617710),s=n(579908),a=n(636194);let u=r.createContext(void 0);function c(e){let t=r.useContext(u);if(null==t)throw Error(`${e??"useGroupListingsFetchContext"} must be used within a GroupListingsFetchContextProvider`);let{listingsLoaded:n,fetchGroupListingsForGuild:l}=t;return r.useEffect(()=>{l()},[l]),n}function d(e){let{guildId:t,children:n,refetchOnMount:c,includeSoftDeleted:d,countryCode:E,dontFetchWhileTrue:C}=e,h=(0,i.bG)([o.A],()=>o.A.isConnected()),_=(0,i.bG)([a.A],()=>null!=t?a.A.getSubscriptionGroupListingsForGuildFetchState(t):a.e.FETCHED),[S,m]=r.useState(!0===c),I=r.useCallback(()=>{if(null==t||!h||!0===C)return;let e=a.A.getSubscriptionGroupListingsForGuildFetchState(t);(S||e===a.e.NOT_FETCHED)&&(m(!1),s.WA(t,{includeSoftDeleted:d,countryCode:E}))},[h,t,d,E,C,S]),f=_===a.e.FETCHED&&!S;return(0,l.jsx)(u.Provider,{value:{listingsLoaded:f,fetchGroupListingsForGuild:I},children:n})}}