import{d as e,n as t,t as n}from"./objectSpread2-DtFdQpqy.js";import{a as r,n as i}from"./preload-helper-EQ20WQt-.js";import{o as a,s as o}from"./prop-types-DdDwMzX7.js";import{U as s}from"./poll-DJul990I.js";import{Aa as c,Do as l,Ea as u,Eo as d}from"./time-BE5vfriQ.js";import{t as f}from"./useAccountId-hZkNcTVU.js";import{t as p}from"./index.module-TU-jmGO1.js";import{n as m}from"./limited_account_hint-C4As4qr6.js";import{r as h}from"./number_fields-0_zdDBoP.js";import{i as g,n as _,r as v,t as y}from"./list-BkyFFWN1.js";var b=e(r()),x=i(),S=({domain:e,url:t})=>e?(0,x.jsx)(m,{url:t,message:(0,x.jsx)(a,{id:`hints.profiles.follows_may_be_missing`,defaultMessage:`Follows for this profile may be missing.`}),label:(0,x.jsx)(a,{id:`hints.profiles.see_more_follows`,defaultMessage:`See more follows on {domain}`,values:{domain:(0,x.jsx)(`strong`,{children:e})}})}):null;t();var C=o({id:`following.title`,defaultMessage:`Followed by {name}`}),w=()=>{let e=f(),t=s(e),n=l(e=>{var t;return(t=e.meta.get(`me`))==null?null:t}),r=l(t=>g(t,`following`,e)),i=d();(0,b.useEffect)(()=>{!r&&e&&i(c(e))},[e,i,r]);let o=p(()=>{e&&i(u(e))},300,{leading:!0}),m=h(e),v=m!=null&&m.followed_by?n:null,w=!!(t!=null&&t.hide_collections&&(r==null?void 0:r.items.length)===0&&v)&&(0,x.jsx)(`div`,{className:`empty-column-indicator`,children:(0,x.jsx)(a,{id:`following.hide_other_following`,defaultMessage:`This user has chosen to not make the rest of who they follow visible`,tagName:`span`})}),E=t==null?void 0:t.acct.split(`@`)[1];return(0,x.jsx)(y,{accountId:e,append:E&&(0,x.jsx)(S,{domain:E,url:t.url}),emptyMessage:(0,x.jsx)(T,{account:t}),header:e&&(0,x.jsx)(_,{accountId:e,titleText:C,total:t==null?void 0:t.following_count}),footer:w,list:r,loadMore:o,prependAccountId:v,scrollKey:`following`})},T=e=>(0,x.jsx)(v,n(n({},e),{},{defaultMessage:(0,x.jsx)(a,{id:`account.follows.empty`,defaultMessage:`This user doesn't follow anyone yet.`})}));export{w as default};
//# sourceMappingURL=following-DF_cTbe2.js.map