1import{o as e}from"./chunk-CMxvf4Kt.js";import{n as t,t as n}from"./jsx-runtime-SsSjplwM.js";import{a as r,c as i,s as a}from"./react-intl-Cop388b4.js";import{b as o}from"./prop-types-BTvjt2rf.js";import{$ as s,A as c,E as l,F as u,J as d,g as f,nt as p,s as m}from"./poll-GhgBJIBe.js";import{Fi as h,fa as g,ga as _,h as v,ki as y,la as b,ma as x,ta as S,ua as C,va as ee,ya as te}from"./render-iwa9xCPR.js";import{at as ne,s as re}from"./accounts_typed-Bx70RYtH.js";import{o as w,s as T}from"./typed_functions-CyAHd4bl.js";import{n as E,t as ie}from"./short_number-Coj2vPT7.js";import{an as ae,cn as D}from"./status_quoted-D8K2gmDl.js";import{t as O}from"./classnames-CYxIelk8.js";import{t as k}from"./skeleton-F9wtbjO5.js";import{t as A}from"./block-BwDpqtqd.js";import{t as j}from"./volume_off-Dp7AosRC.js";var M=e(t()),N=e(O()),P=n(),F=(e,t)=>(0,P.jsx)(r,{id:`account.followers_counter`,defaultMessage:`{count, plural, one {{counter} Follower} other {{counter} Followers}}`,values:{count:t,counter:(0,P.jsx)(`strong`,{children:e})},tagName:`span`}),I=(e,t)=>(0,P.jsx)(r,{id:`account.followers_you_know_counter`,defaultMessage:`{counter} you know`,values:{count:t,counter:(0,P.jsx)(`strong`,{children:e})},tagName:`span`}),L={narrow:479,openable:759,full:1174},R=e=>{let t=`(max-width: ${L[e]}px)`;return(0,M.useSyncExternalStore)(e=>{let n=window.matchMedia(t);return n.addEventListener(`change`,e),()=>{n.removeEventListener(`change`,e)}},()=>window.matchMedia(t).matches)};function z(e,t=`full`){let n=`withMobileLayout(${e.displayName??e.name})`,r=n=>(0,P.jsx)(e,{matchesBreakpoint:R(t),...n});return r.displayName=n,r}var B=a({unfollow:{id:`account.unfollow`,defaultMessage:`Unfollow`},unblock:{id:`account.unblock_short`,defaultMessage:`Unblock`},unmute:{id:`account.unmute_short`,defaultMessage:`Unmute`},follow:{id:`account.follow`,defaultMessage:`Follow`},followBack:{id:`account.follow_back`,defaultMessage:`Follow back`},followRequest:{id:`account.follow_request`,defaultMessage:`Request to follow`},followRequestCancel:{id:`account.follow_request_cancel`,defaultMessage:`Cancel request`},editProfile:{id:`account.edit_profile`,defaultMessage:`Edit profile`}}),V={...B,...a({followBack:{id:`account.follow_back_short`,defaultMessage:`Follow back`},followRequest:{id:`account.follow_request_short`,defaultMessage:`Request`},followRequestCancel:{id:`account.follow_request_cancel_short`,defaultMessage:`Cancel`},editProfile:{id:`account.edit_profile_short`,defaultMessage:`Edit`}})},H=({accountId:e,compact:t,labelLength:n=`auto`,className:r,withUnmute:a=!0})=>{let s=i(),c=w(),{signedIn:l}=d(),u=T(t=>e?t.accounts.get(e):void 0),f=T(t=>e?t.relationships.get(e):void 0),m=f?.following||f?.requested;(0,M.useEffect)(()=>{e&&l&&c(b([e]))},[c,e,l]);let h=(0,M.useCallback)(()=>{l||c(y({modalType:`INTERACTION`,modalProps:{intent:`follow`,accountId:e,url:u?.url}})),!(!f||!e)&&e!==o&&(f.blocking?c(y({modalType:`CONFIRM_UNBLOCK`,modalProps:{account:u}})):f.muting&&a?c(ee(e)):u&&f.following?c(y({modalType:`CONFIRM_UNFOLLOW`,modalProps:{account:u}})):u&&f.requested?c(y({modalType:`CONFIRM_WITHDRAW_REQUEST`,modalProps:{account:u}})):c(C(e)))},[l,f,e,a,u,c]),g=R(`narrow`),_=n===`short`||n===`auto`&&g?V:B,v=u?.locked?_.followRequest:_.follow,x,S=f?.blocked_by||u?.suspended||!!u?.moved;return l?e===o?x=s.formatMessage(_.editProfile):f?f.muting&&a?(x=s.formatMessage(_.unmute),S=!1):f.following?(x=s.formatMessage(_.unfollow),S=!1):f.blocking?(x=s.formatMessage(_.unblock),S=!1):f.requested?(x=s.formatMessage(_.followRequestCancel),S=!1):x=f.followed_by&&!u?.locked?s.formatMessage(_.followBack):s.formatMessage(v):x=(0,P.jsx)(p,{}):x=s.formatMessage(v),e===o?(0,P.jsx)(E,{to:`/profile/edit`,className:(0,N.default)(r,`button button-secondary`,{"button--compact":t}),children:x}):(0,P.jsx)(D,{onClick:h,disabled:S,secondary:m||f?.blocking,compact:t,className:(0,N.default)(r,{"button--destructive":m}),children:x})},U=e=>(0,P.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 16 16`,...e,children:[(0,P.jsx)(`path`,{fill:`url(#badgeGradient)`,d:`M8 .666c.301 0 .595.094.839.268l.101.079.006.005c1.092.956 2.603 1.649 3.721 1.649A1.333 1.333 0 0 1 14 4v4.667c0 1.842-.652 3.259-1.702 4.336-1.032 1.058-2.417 1.76-3.852 2.26l-.005.002a1.334 1.334 0 0 1-.879-.01c-1.437-.496-2.825-1.195-3.858-2.253C2.654 11.926 2 10.509 2 8.667V4a1.334 1.334 0 0 1 1.334-1.333c1.118 0 2.634-.7 3.72-1.65l.007-.004C7.322.789 7.656.666 8 .666Z`}),(0,P.jsx)(`path`,{stroke:`#fff`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,d:`M5 10.998A3.053 3.053 0 0 1 6.173 9.57a3.333 3.333 0 0 1 1.828-.54m0 0c.653 0 1.29.189 1.826.54.537.353.946.852 1.173 1.43M8 9.03c1.179 0 2.133-.903 2.133-2.015C10.133 5.902 9.178 5 8 5c-1.179 0-2.134.902-2.134 2.015 0 1.112.956 2.015 2.135 2.015Z`}),(0,P.jsx)(`defs`,{children:(0,P.jsxs)(`linearGradient`,{id:`badgeGradient`,x1:.5,x2:14,y1:2.5,y2:15,gradientUnits:`userSpaceOnUse`,children:[(0,P.jsx)(`stop`,{stopColor:`#E17100`}),(0,P.jsx)(`stop`,{offset:1,stopColor:`#F0B100`})]})})]}),W=e=>(0,P.jsx)(`svg`,{width:16,height:16,viewBox:`0 0 16 16`,fill:`black`,...e,children:(0,P.jsx)(`path`,{d:`M13.2502 8.00029C13.2502 5.10089 10.8996 2.75044 8.00024 2.75029C5.10075 2.7
15029 2.75024 5.10079 2.75024 8.00029C2.7504 10.8997 5.10084 13.2503 8.00024 13.2503C10.8995 13.2501 13.2501 10.8996 13.2502 8.00029ZM7.41663 4.50029C7.41663 4.17812 7.67808 3.91667 8.00024 3.91667C8.32228 3.91683 8.58301 4.17822 8.58301 4.50029V7.63884L10.5945 8.64458C10.8825 8.78865 10.999 9.13922 10.8551 9.42729C10.711 9.71541 10.3605 9.83276 10.0724 9.68877L7.73877 8.52153C7.54143 8.4227 7.41673 8.221 7.41663 8.00029V4.50029ZM14.4166 8.00029C14.4165 11.5439 11.5438 14.4165 8.00024 14.4167C4.45651 14.4167 1.58316 11.544 1.58301 8.00029C1.58301 4.45646 4.45642 1.58305 8.00024 1.58305C11.5439 1.58321 14.4166 4.45656 14.4166 8.00029Z`})}),G=e=>(0,P.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,...e,children:(0,P.jsx)(`path`,{fill:`currentColor`,d:`M7.467 7.266 11.533 3.2a.586.586 0 0 1 .85-.001.585.585 0 0 1 0 .851L8.317 8.116zm1.416 1.417 3.5-3.5a.586.586 0 0 1 .85 0 .586.586 0 0 1 0 .85l-3.5 3.5zM3.35 12.267Q2 10.917 1.983 9.017q-.015-1.9 1.334-3.25L5.2 3.882l.883.9q.135.133.25.283.117.15.15.35l2.5-2.5a.586.586 0 0 1 .85 0 .586.586 0 0 1 0 .85L6.8 6.8l-.75.766.15.15q.65.65.642 1.55a2.15 2.15 0 0 1-.659 1.55l-.416.417-.85-.85.416-.417a.98.98 0 0 0 .292-.7.94.94 0 0 0-.276-.705l-.582-.578a.586.586 0 0 1 0-.85l.433-.417a.8.8 0 0 0 .233-.57.77.77 0 0 0-.233-.563L4.15 6.616a3.2 3.2 0 0 0-.975 2.409A3.37 3.37 0 0 0 4.2 11.433q1 1 2.387 1t2.38-1L12.68 7.72a.583.583 0 0 1 .853-.002.586.586 0 0 1 0 .85l-3.716 3.7q-1.342 1.35-3.23 1.35t-3.237-1.35M11.2 15.2V14a2.7 2.7 0 0 0 1.983-.817A2.7 2.7 0 0 0 14 11.2h1.2q0 1.66-1.17 2.83T11.2 15.2M.8 4.8q0-1.66 1.17-2.83T4.8.8V2a2.7 2.7 0 0 0-1.983.816A2.7 2.7 0 0 0 2 4.8z`})}),K=e=>(0,P.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,...e,children:[(0,P.jsx)(`path`,{fill:`url(#VerifiedGradient)`,d:`M8 .837a3.168 3.168 0 0 1 2.47 1.187 3.166 3.166 0 0 1 2.601.906 3.168 3.168 0 0 1 .905 2.6A3.167 3.167 0 0 1 15.164 8a3.172 3.172 0 0 1-1.188 2.47 3.167 3.167 0 0 1-.903 2.597 3.168 3.168 0 0 1-2.596.909 3.167 3.167 0 0 1-4.95.001 3.166 3.166 0 0 1-3.397-2.258 3.169 3.169 0 0 1-.107-1.24A3.168 3.168 0 0 1 .826 8a3.17 3.17 0 0 1 1.197-2.479 3.168 3.168 0 0 1 .91-2.593 3.166 3.166 0 0 1 2.596-.905A3.169 3.169 0 0 1 8 .837Z`}),(0,P.jsx)(`path`,{stroke:`#fff`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.333,d:`m6 8 1.333 1.333L10 6.667`}),(0,P.jsx)(`defs`,{children:(0,P.jsxs)(`linearGradient`,{id:`VerifiedGradient`,x1:7.99512,y1:.836914,x2:7.99512,y2:15.1689,gradientUnits:`userSpaceOnUse`,children:[(0,P.jsx)(`stop`,{stopColor:`#00BC7D`}),(0,P.jsx)(`stop`,{offset:1,stopColor:`#00BBA7`})]})})]}),q=e=>(0,P.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,height:24,viewBox:`0 -960 960 960`,width:24,...e,children:(0,P.jsx)(`path`,{d:`M40-160v-112q0-34 17.5-62.5T104-378q62-31 126-46.5T360-440q66 0 130 15.5T616-378q29 15 46.5 43.5T680-272v112H40Zm720 0v-120q0-44-24.5-84.5T666-434q51 6 96 20.5t84 35.5q36 20 55 44.5t19 53.5v120H760ZM247-527q-47-47-47-113t47-113q47-47 113-47t113 47q47 47 47 113t-47 113q-47 47-113 47t-113-47Zm466 0q-47 47-113 47-11 0-28-2.5t-28-5.5q27-32 41.5-71t14.5-81q0-42-14.5-81T544-792q14-5 28-6.5t28-1.5q66 0 113 47t47 113q0 66-47 113ZM120-240h480v-32q0-11-5.5-20T580-306q-54-27-109-40.5T360-360q-56 0-111 13.5T140-306q-9 5-14.5 14t-5.5 20v32Zm296.5-343.5Q440-607 440-640t-23.5-56.5Q393-720 360-720t-56.5 23.5Q280-673 280-640t23.5 56.5Q327-560 360-560t56.5-23.5ZM360-240Zm0-400Z`})}),J=e=>(0,P.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,height:24,viewBox:`0 -960 960 960`,width:24,...e,children:(0,P.jsx)(`path`,{d:`M367-527q-47-47-47-113t47-113q47-47 113-47t113 47q47 47 47 113t-47 113q-47 47-113 47t-113-47ZM160-160v-112q0-34 17.5-62.5T224-378q62-31 126-46.5T480-440q66 0 130 15.5T736-378q29 15 46.5 43.5T800-272v112H160Zm80-80h480v-32q0-11-5.5-20T700-306q-54-27-109-40.5T480-360q-56 0-111 13.5T260-306q-9 5-14.5 14t-5.5 20v32Zm296.5-343.5Q560-607 560-640t-23.5-56.5Q513-720 480-720t-56.5 23.5Q400-673 400-640t23.5 56.5Q447-560 480-560t56.5-23.5ZM480-640Zm0 400Z`})}),Y=e=>(0,P.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,height:24,viewBox:`0 -960 960 960`,width:24,...e,children:(0,P.jsx)(`path`,{d:`M160-360q-50 0-85-35t-35-85q0-50 35-85t85-35v-80q0-33 23.5-56.5T240-760h120q0-50 35-85t85-35q50 0 85 35t35 85h120q33 0 56.5 23.5T800-680v80q50 0 85 35t35 85q0 50-35 85t-85 35v160q0 33-23.5 56.5T720-120H240q-33 0-56.5-23.5T160-200v-160Zm242.5-97.5Q420-475 420-500t-17.5-42.5Q385-560 360-560t-42.5 17.5Q300-525 300-500t17.5 42.5Q335-440 360-440t42.5-17.5Zm240 0Q660-475 660-500t-17.5-42.5Q625-560 600-560t-42.5 17.5Q540-525 540-500t17.5 42.5Q575-440 600-440t42.5-17.5ZM320-280h320v-80H320v80Zm-80 80h480v-480H240v480Zm240-240Z`})}),X={badge:`_comp_badge__badge`,badgeWithoutIcon:`_comp_badge__badgeWithoutIcon`,content:`_comp_badge__content`,domain:`_comp_badge__domain`,default:`_comp_badge__default`,subtle:`_comp_badge__subtle`,feature:`_comp_badge__feature`,inverted:`_comp_badge__inverted`,success:`_comp_badge__success`,warning:`_comp_badge__warning`,danger:`_comp_badge__danger`},Z=({icon:e=(0,P.jsx)(J,{}),variant:t=`default`,label:n,className:r,domain:i,roleId:a,...o})=>(0,P.jsxs)(`div`,{...o,className:(0,N.default)(X.badge,!e&&X.badgeWithoutIcon,X[t],r),"data-account-role-id":a,children:[e,(0,P.jsxs)(`span`,{className:X.content,children:[n,i&&(0,P.jsxs)(`span`,{className:X.domain,children:[` `,i]})]})]}),oe=({label:e,...t})=>(0,P.jsx)(Z,{icon:(0,P.jsx)(U,{}),label:e??(0,P.jsx)(r,{id:`account.badges.admin`,defaultMessage:`Admin`}),...t}),se=({label:e,...t})=>(0,P.jsx)(Z,{icon:(0,P.jsx)(q,{}),label:e??(0,P.jsx)(r,{id:`account.badges.group`,defaultMessage:`Group`}),...t}),ce=e=>(0,P.jsx)(Z,{icon:(0,P.jsx)(Y,{}),label:(0,P.jsx)(r,{id:`account.badges.bot`,defaultMessage:`Automated`}),...e}),le=e=>(0,P.jsx)(Z,{icon:(0,P.jsx)(G,{}),label:(0,P.jsx)(r,{id:`account.follows_you`,defaultMessage:`Follows you`}),...e}),ue=e=>(0,P.jsx)(Z,{variant:`warning`,icon:(0,P.jsx)(W,{}
1),label:(0,P.jsx)(r,{id:`account.pending`,defaultMessage:`Pending`}),...e}),de=({expiresAt:e,label:t,...n})=>{let a=i(),o=null;if(e){let t=new Date(e),n=t.getFullYear()===new Date().getFullYear();o=a.formatDate(t,{month:`short`,day:`numeric`,...n?{}:{year:`numeric`}})}return(0,P.jsx)(Z,{icon:(0,P.jsx)(j,{}),variant:`inverted`,label:t??(o?(0,P.jsx)(r,{id:`account.badges.muted_until`,defaultMessage:`Muted until {until}`,values:{until:o}}):(0,P.jsx)(r,{id:`account.badges.muted`,defaultMessage:`Muted`})),...n})},fe=({label:e,...t})=>(0,P.jsx)(Z,{icon:(0,P.jsx)(A,{}),variant:`danger`,label:e??(0,P.jsx)(r,{id:`account.badges.blocked`,defaultMessage:`Blocked`}),...t}),pe=(e,t,n)=>{if(e===`rel`&&n===`a`)return t===`me`?null:[e,t.split(` `).filter(e=>e!==`me`).join(` `)]},Q=({link:e,className:t})=>(0,P.jsx)(Z,{variant:`success`,icon:(0,P.jsx)(s,{id:`verified`,icon:K,noFill:!0}),label:(0,P.jsx)(u,{as:`span`,htmlString:e,onAttribute:pe}),className:t}),$=a({follow:{id:`account.follow`,defaultMessage:`Follow`},unfollow:{id:`account.unfollow`,defaultMessage:`Unfollow`},cancel_follow_request:{id:`account.cancel_follow_request`,defaultMessage:`Withdraw follow request`},unblock:{id:`account.unblock_short`,defaultMessage:`Unblock`},unmute:{id:`account.unmute_short`,defaultMessage:`Unmute`},mute_notifications:{id:`account.mute_notifications_short`,defaultMessage:`Mute notifications`},unmute_notifications:{id:`account.unmute_notifications_short`,defaultMessage:`Unmute notifications`},mute:{id:`account.mute_short`,defaultMessage:`Mute`},block:{id:`account.block_short`,defaultMessage:`Block`},more:{id:`status.more`,defaultMessage:`More`},addToLists:{id:`account.add_or_remove_from_list`,defaultMessage:`Add or Remove from lists`},openOriginalPage:{id:`account.open_original_page`,defaultMessage:`Open original page`}}),me=({id:e,size:t=46,hidden:n,minimal:a,defaultAction:s,withBio:p,withMenu:b=!0,withBorder:C=!0,extraAccountInfo:O,className:A,children:j})=>{let I=i(),{signedIn:L}=d(),R=T(t=>t.accounts.get(e)),z=T(t=>t.relationships.get(e)),B=w(),V=R?.url,U=R?.acct!==R?.username,W=(0,M.useCallback)(()=>{z?.blocking?B(_(e)):B(S(e))},[B,e,z]),G=(0,M.useCallback)(()=>{z?.muting?B(ee(e)):B(v(R))},[B,e,R,z]),K=(0,M.useMemo)(()=>{let t=[];return s===`mute`?t=[{text:I.formatMessage(z?.muting_notifications?$.unmute_notifications:$.mute_notifications),action:z?.muting_notifications?()=>{B(g(e,!1))}:()=>{B(g(e,!0))}}]:s!==`block`&&(U&&V&&t.push({text:I.formatMessage($.openOriginalPage),href:V}),L&&(t.push({text:I.formatMessage($.addToLists),action:()=>{let t=()=>{B(y({modalType:`LIST_ADDER`,modalProps:{accountId:e}}))};z?.following||z?.requested||e===o?t():B(y({modalType:`CONFIRM_FOLLOW_TO_LIST`,modalProps:{accountId:e,onConfirm:()=>{ne(e).then(e=>{B(re({relationship:e,alreadyFollowing:!1})),t()}).catch(e=>{B(h(e))})}}}))}}),e!==o&&(z?.following||z?.requested)&&t.push({text:I.formatMessage(z.endorsed?{id:`account.unendorse`}:{id:`account.endorse`}),action:()=>{z.endorsed?B(te(e)):B(x(e))}}))),t},[B,I,e,V,z,s,U,L]);if(n)return(0,P.jsxs)(P.Fragment,{children:[R?.display_name,R?.username]});let q,J;K.length>0&&b&&(J=(0,P.jsx)(f,{items:K,icon:`ellipsis-h`,iconComponent:ae,title:I.formatMessage($.more)})),q=s===`block`?(0,P.jsx)(D,{text:I.formatMessage(z?.blocking?$.unblock:$.block),onClick:W}):s===`mute`?(0,P.jsx)(D,{text:I.formatMessage(z?.muting?$.unmute:$.mute),onClick:G}):(0,P.jsx)(H,{accountId:e});let Y;R?.mute_expires_at&&(Y=(0,P.jsxs)(P.Fragment,{children:[`· `,(0,P.jsx)(m,{hasFuture:!0,timestamp:R.mute_expires_at})]}));let X,Z=R?.fields.find(e=>!!e.verified_at);return Z&&(X=(0,P.jsx)(Q,{link:Z.value})),(0,P.jsx)(`div`,{className:(0,N.default)(`account`,A,{"account--minimal":a,"account--without-border":!C}),children:(0,P.jsxs)(`div`,{className:(0,N.default)(`account__wrapper`,{"account__wrapper--with-bio":R&&p}),children:[(0,P.jsxs)(`div`,{className:`account__info-wrapper`,children:[(0,P.jsxs)(E,{className:`account__display-name focusable`,title:R?.acct,to:`/@${R?.acct}`,"data-hover-card-account":e,children:[(0,P.jsx)(`div`,{className:`account__avatar-wrapper`,children:R?(0,P.jsx)(c,{account:R,size:t}):(0,P.jsx)(k,{width:t,height:t})}),(0,P.jsxs)(`div`,{className:`account__contents`,children:[(0,P.jsx)(l,{account:R}),!a&&(0,P.jsx)(`div`,{className:`account__details`,children:R?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(ie,{value:R.followers_count,renderer:F}),` `,X,` `,Y]}):(0,P.jsx)(k,{width:`7ch`})})]})]}),R&&p&&(R.note.length>0?(0,P.jsx)(u,{className:`account__note translate`,htmlString:R.note_emojified,extraEmojis:R.emojis}):(0,P.jsx)(`div`,{className:`account__note account__note--missing`,children:(0,P.jsx)(r,{id:`account.no_bio`,defaultMessage:`No description provided.`})})),O]}),!a&&(0,P.jsxs)(`div`,{className:`account__relationship`,children:[J,q]}),j]})})};export{F as _,fe as a,de as c,J as d,q as f,z as g,R as h,Z as i,ue as l,H as m,oe as n,le as o,K as p,ce as r,se as s,me as t,Q as u,I as v}; 2//# sourceMappingURL=account-Oh3Abk9F.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.