var z=Object.defineProperty;var k=(o,s,t)=>s in o?z(o,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[s]=t;var i=(o,s,t)=>k(o,typeof s!="symbol"?s+"":s,t);import{j as e}from"./client-By3tlFYA.js";import{P as a,L as y}from"./short_number-C9zm8Jg6.js";import{i as h,a as f,m as R}from"./index-TEHZzOO_.js";import{H as A}from"./Helmet-BG0DmkIY.js";import{p as g,q as j,A as S,D as C,av as I,I as m,bD as P,S as L,j as x,bP as T,cQ as N,cP as F,bO as D,z as E,e6 as B}from"./useSelectableClick-CQ_VFIFJ.js";import{S as H}from"./person_add-D-MnufZZ.js";import{S as $}from"./scrollable_list-CvmNAjuh.js";import{C as W}from"./column-35kQ-c0v.js";import{M as d}from"./message-CVkQtbZv.js";import"./numbers-BLyy7tyF.js";import"./index-DkCxcZFY.js";import"./relative_timestamp-BOUL06oe.js";import"./ready-DpOgoWSg.js";import"./index-DUY7J2K7.js";import"./skeleton-CwYXpOUk.js";import"./api-C8Dh2R2O.js";import"./index-DiPYjm3h.js";import"./load_locale-2yQZbENH.js";import"./index-bBdv7bTR.js";import"./scroll_context-DnHnZEup.js";import"./schedule_idle_task-CDh0madc.js";import"./load_more-C4EQy1Kp.js";import"./column_header-fiA4Nho-.js";import"./add-CxOAEcXl.js";import"./chevron_left-tY77j9LU.js";import"./unfold_more-Dg1Ay52N.js";import"./scroll-BygYx8ga.js";const p=f({authorize:{id:"follow_request.authorize",defaultMessage:"Authorize"},reject:{id:"follow_request.reject",defaultMessage:"Reject"}});class _ extends g{render(){const{intl:s,account:t,onAuthorize:n,onReject:r}=this.props;return e.jsxs("div",{className:"account-authorize__wrapper",children:[e.jsxs("div",{className:"account-authorize",children:[e.jsxs(y,{to:"/@".concat(t.get("acct")),className:"detailed-status__display-name",children:[e.jsx("div",{className:"account-authorize__avatar",children:e.jsx(S,{account:t,size:48})}),e.jsx(C,{account:t})]}),e.jsx(I,{className:"account__header__content translate",htmlString:t.get("note_emojified"),extraEmojis:t.get("emojis")})]}),e.jsxs("div",{className:"account--panel",children:[e.jsx("div",{className:"account--panel__button",children:e.jsx(m,{title:s.formatMessage(p.authorize),icon:"check",iconComponent:P,onClick:n})}),e.jsx("div",{className:"account--panel__button",children:e.jsx(m,{title:s.formatMessage(p.reject),icon:"times",iconComponent:L,onClick:r})})]})]})}}i(_,"propTypes",{account:j.record.isRequired,onAuthorize:a.func.isRequired,onReject:a.func.isRequired,intl:a.object.isRequired});const G=h(_),K=()=>{const o=T();return(t,n)=>({account:o(t,n.id)})},O=(o,{id:s})=>({onAuthorize(){o(F(s))},onReject(){o(N(s))}}),Q=x(K,O)(G),U=f({heading:{id:"column.follow_requests",defaultMessage:"Follow requests"}}),Y=o=>({accountIds:o.getIn(["user_lists","follow_requests","items"]),isLoading:o.getIn(["user_lists","follow_requests","isLoading"],!0),hasMore:!!o.getIn(["user_lists","follow_requests","next"]),locked:!!o.getIn(["accounts",R,"locked"]),domain:o.getIn(["meta","domain"])});class q extends g{constructor(){super(...arguments);i(this,"handleLoadMore",E(()=>{this.props.dispatch(B())},300,{leading:!0}))}UNSAFE_componentWillMount(){this.props.dispatch(D())}render(){const{intl:t,accountIds:n,hasMore:r,multiColumn:c,locked:w,domain:M,isLoading:l}=this.props,b=e.jsx(d,{id:"empty_column.follow_requests",defaultMessage:"You don't have any follow requests yet. When you receive one, it will show up here."}),v=!w&&n.size>0&&e.jsx("div",{className:"follow_requests-unlocked_explanation",children:e.jsx(d,{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:M}})});return e.jsxs(W,{bindToDocument:!c,icon:"user-plus",iconComponent:H,heading:t.formatMessage(U.heading),alwaysShowBackButton:!0,children:[e.jsx($,{scrollKey:"follow_requests",onLoadMore:this.handleLoadMore,hasMore:r,isLoading:l,showLoading:l&&n.size===0,emptyMessage:b,bindToDocument:!c,prepend:v,children:n.map(u=>e.jsx(Q,{id:u},u))}),e.jsx(A,{children:e.jsx("meta",{name:"robots",content:"noindex"})})]})}}i(q,"propTypes",{params:a.object.isRequired,dispatch:a.func.isRequired,hasMore:a.bool,isLoading:a.bool,accountIds:j.list,locked:a.bool,domain:a.string,intl:a.object.isRequired,multiColumn:a.bool});const ve=x(Y)(h(q));export{ve as default};
//# sourceMappingURL=follow_requests-index-D55qyGXX.js.map
