import{a as e,d as t,i as n}from"./objectSpread2-DtFdQpqy.js";import{n as r}from"./preload-helper-EQ20WQt-.js";import{F as i,c as a,o,t as s}from"./prop-types-DdDwMzX7.js";import{$ as c,G as l,L as u,V as d,ct as f,i as p,pt as m}from"./poll-DJul990I.js";import{La as h,Oa as g,Ro as _,Sa as v,ko as y,wa as b}from"./time-BE5vfriQ.js";import{t as x}from"./helmet-xJbX5x_5.js";import{n as S}from"./short_number-CCNBtmoH.js";import{t as C}from"./intl-DxYtUOxD.js";import{H as w}from"./status_quoted-DSI-CjDl.js";import{t as T}from"./account_bio-CXY7_ncV.js";import{u as E}from"./navigation_panel-U2eLp0Ah.js";import{t as D}from"./column-DieEwXxQ.js";import{t as O}from"./scrollable_list-DOt8AyRo.js";var k=t(_()),A=t(s()),j=t(p()),M=r();e();var N=a({authorize:{id:`follow_request.authorize`,defaultMessage:`Authorize`},reject:{id:`follow_request.reject`,defaultMessage:`Reject`}}),P=class extends w{render(){let{intl:e,account:t,onAuthorize:n,onReject:r}=this.props;return(0,M.jsxs)(`div`,{className:`account-authorize__wrapper`,children:[(0,M.jsxs)(`div`,{className:`account-authorize`,children:[(0,M.jsxs)(S,{to:`/@${t.get(`acct`)}`,className:`detailed-status__display-name`,children:[(0,M.jsx)(`div`,{className:`account-authorize__avatar`,children:(0,M.jsx)(d,{account:t,size:48})}),(0,M.jsx)(u,{account:t})]}),(0,M.jsx)(T,{accountId:t.id})]}),(0,M.jsxs)(`div`,{className:`account--panel`,children:[(0,M.jsx)(`div`,{className:`account--panel__button`,children:(0,M.jsx)(f,{title:e.formatMessage(N.authorize),icon:`check`,iconComponent:l,onClick:n})}),(0,M.jsx)(`div`,{className:`account--panel__button`,children:(0,M.jsx)(f,{title:e.formatMessage(N.reject),icon:`times`,iconComponent:m,onClick:r})})]})]})}};n(P,`propTypes`,{account:j.default.record.isRequired,onAuthorize:A.default.func.isRequired,onReject:A.default.func.isRequired,intl:A.default.object.isRequired});var F=C(P),I=y(()=>{let e=c();return(t,n)=>({account:e(t,n.id)})},(e,{id:t})=>({onAuthorize(){e(v(t))},onReject(){e(h(t))}}))(F);e();var L=a({heading:{id:`column.follow_requests`,defaultMessage:`Follow requests`}}),R=e=>({accountIds:e.getIn([`user_lists`,`follow_requests`,`items`]),isLoading:e.getIn([`user_lists`,`follow_requests`,`isLoading`],!0),hasMore:!!e.getIn([`user_lists`,`follow_requests`,`next`]),locked:!!e.getIn([`accounts`,i,`locked`]),domain:e.getIn([`meta`,`domain`])}),z=class extends w{constructor(...e){super(...e),n(this,`handleLoadMore`,(0,k.default)(()=>{this.props.dispatch(b())},300,{leading:!0}))}componentDidMount(){this.props.dispatch(g())}render(){let{intl:e,accountIds:t,hasMore:n,multiColumn:r,locked:i,domain:a,isLoading:s}=this.props,c=(0,M.jsx)(o,{id:`empty_column.follow_requests`,defaultMessage:`You don't have any follow requests yet. When you receive one, it will show up here.`}),l=!i&&t.size>0&&(0,M.jsx)(`div`,{className:`follow_requests-unlocked_explanation`,children:(0,M.jsx)(o,{id:`follow_requests.unlocked_explanation`,defaultMessage:`Even though your account is not locked, the {domain} staff thought you might want to review follow requests from these accounts manually.`,values:{domain:a}})});return(0,M.jsxs)(D,{bindToDocument:!r,icon:`user-plus`,iconComponent:E,heading:e.formatMessage(L.heading),alwaysShowBackButton:!0,children:[(0,M.jsx)(O,{scrollKey:`follow_requests`,onLoadMore:this.handleLoadMore,hasMore:n,isLoading:s,showLoading:s&&t.size===0,emptyMessage:c,bindToDocument:!r,prepend:l,children:t.map(e=>(0,M.jsx)(I,{id:e},e))}),(0,M.jsx)(x,{children:(0,M.jsx)(`meta`,{name:`robots`,content:`noindex`})})]})}};n(z,`propTypes`,{params:A.default.object.isRequired,dispatch:A.default.func.isRequired,hasMore:A.default.bool,isLoading:A.default.bool,accountIds:j.default.list,locked:A.default.bool,domain:A.default.string,intl:A.default.object.isRequired,multiColumn:A.default.bool});var B=y(R)(C(z));export{B as default};
//# sourceMappingURL=follow_requests-EGgL2PPZ.js.map