Loading
function(e,t,n){"use strict";n.d(t,{A:()=>ef});var l=n(627968),i=n(64700),s=n(503698),r=n.n(s),a=n(308186),o=n(17928),u=n(451988),c=n(192308),d=n(245604),m=n(834730),h=n(939249),p=n(140735),f=n(717421),g=n(187322),E=n(775602),A=n(51183),C=n(793574),x=n(688810),I=n(915089),_=n(410540),S=n(7584),y=n(495544),v=n(183555),T=n(679492),N=n(922016),j=n(403777),b=n(462887),R=n(334295),P=n(363195),L=n(403362),M=n(427262),O=n(448613),w=n(8925),k=n(939496),D=n(518477),U=n(307731),G=n(818348),F=n(650583),V=n(375708),B=n(435693);function H(e){let{user:t,guildId:n,entry:s,sourceType:r,sourceDetails:a,setPopoutRef:u,onAction:c,onClose:d}=e,{resetInteraction:m,setInteractionToast:h}=(0,T.Pq)(),{theme:p}=(0,k.E)(),f=(0,o.bG)([P.A],()=>P.A.theme),g=(0,b.M)(f)?!(0,b.M)(p):(0,b.M)(p),E=i.useRef(null);i.useEffect(()=>{u?.(E?.current)},[E,u]),i.useEffect(()=>{function e(e){e.key===F.dh.ESCAPE&&(e.stopPropagation(),m())}return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[d,m]);let A=async e=>{if(null==e)return;r===D.dS.AVATAR?c({action:"SEND_REACT_AVATAR"}):r===D.dS.STATUS?c({action:"SEND_REACT_CUSTOM_STATUS"}):c({action:"SEND_REACT_ACTIVITY"});let n=function(e){let{emoji:t,username:n,sourceType:l,sourceDetails:i}=e,s=`:${t.name}:`;switch(l){case D.dS.ACTIVITY:let r=V.intl.formatToPlainString(V.t.EUFEJt,{username:n}),a=`
> ${i}`;return null!=i?`${w.c5}${r}*${a}
${s}`:`${w.c5}${r}*
${s}`;case D.dS.AVATAR:let o=V.intl.formatToPlainString(V.t.E6H15q,{username:n});return`${w.c5}${o}*
${s}`;case D.dS.STATUS:let u=V.intl.formatToPlainString(V.t.XPQgL2,{username:n}),c=`
> ${i}`;return null!=i?`${w.c5}${u}*${c}
${s}`:`${w.c5}${u}*
${s}`;default:(0,L.xb)(l)}}({emoji:e,username:M.Ay.getName(t),sourceType:r,sourceDetails:a});h(null);try{await (0,O.p)({userId:t.id,content:n,location:"UserProfileReactPopout",openChannel:!1,whenReady:!1,entry:s})}catch(e){}h(D.AQ.REACT)};return(0,l.jsx)(R.A,{headerClassName:g?B.X:void 0,guildId:n??void 0,closePopout:G.tE,onSelectEmoji:async e=>{let{emoji:t,willClose:n}=e;await A(t),n&&(m(),d?.())},pickerIntention:U.EmojiIntention.PROFILE})}var W=n(478437),K=n(305866),Y=n(355622),z=n(408018),Z=n(138617),q=n(95701),$=n(562153),J=n(450262);let X=(0,q.createChannelRecord)({id:"1",type:W.r.DM});function Q(e){let{user:t,guildId:n,channelId:s,sourceType:a,sourceDetails:o,setPopoutRef:u,modalKey:c,onAction:d,onClose:m,entry:h}=e,{resetInteraction:p,setInteractionToast:f}=(0,T.Pq)(),{primaryColor:g}=(0,k.E)(),[E,A]=i.useState(""),[C,x]=i.useState((0,z.x7)(E)),I=i.useRef(!1),_=i.useRef(null),S=i.useCallback(e=>{e.key===F.dh.ESCAPE&&(e.stopPropagation(),p())},[p]);i.useEffect(()=>{u?.(_?.current)},[_,u]);let y=async e=>{if(null==e)return;a===D.dS.AVATAR?d({action:"SEND_REPLY_AVATAR"}):a===D.dS.STATUS?d({action:"SEND_REPLY_CUSTOM_STATUS"}):d({action:"SEND_REPLY_ACTIVITY"});let n=function(e){let{input:t,username:n,sourceType:l,sourceDetails:i}=e;switch(l){case D.dS.ACTIVITY:let s=V.intl.formatToPlainString(V.t.WmvMCo,{username:n}),r=`
> ${i}`;return null!=i?`${w.c5}${s}*${r}
${t}`:`${w.c5}${s}*
${t}`;case D.dS.AVATAR:let a=V.intl.formatToPlainString(V.t.lpaBsB,{username:n});return`${w.c5}${a}*
${t}`;case D.dS.STATUS:let o=V.intl.formatToPlainString(V.t.lFXgFV,{username:n}),u=`
> ${i}`;return null!=i?`${w.c5}${o}*${u}
${t}`:`${w.c5}${o}*
${t}`;default:(0,L.xb)(l)}}({input:e,username:M.Ay.getName(t),sourceType:a,sourceDetails:o});f(null);try{await (0,O.p)({userId:t.id,content:n,location:"UserProfileReplyPopout",openChannel:!1,whenReady:!1,entry:h})}catch(e){}f(D.AQ.REPLY)},v={[J.h5]:a===D.dS.STATUS,[J.my]:a===D.dS.AVATAR,[J.Eb]:a===D.dS.ACTIVITY};return(0,l.jsx)(K.l,{ref:_,onKeyDown:S,children:(0,l.jsx)("div",{className:r()(J.kL,v,{[J.GE]:null!=g}),children:(0,l.jsx)(Z.Ay,{parentModalKey:c,emojiPickerCloseOnModalOuterClick:!0,className:J.hF,innerClassName:J.rn,editorClassName:J.EN,type:Y.oU.USER_PROFILE_REPLY,placeholder:V.intl.formatToPlainString(function(e){switch(e){case D.dS.ACTIVITY:return V.t.Qn081O;case D.dS.AVATAR:return V.t.xGNPFK;case D.dS.STATUS:return V.t.g9BTCM;default:(0,L.xb)(e)}}(a),{username:$.Ay.getName(n,s,t)}),channel:X,textValue:E,richValue:C,onChange:(e,t,n)=>{t!==E&&(A(t),x(n))},focused:I.current,onFocus:()=>{I.current=!0},onSubmit:async e=>{let{value:t}=e,n=t.trim();if(0===n.length)return{shouldClear:!1,shouldRefocus:!1};try{return await y(n),p(),m?.(),{shouldClear:!0,shouldRefocus:!1}}catch{return{shouldClear:!1,shouldRefocus:!1}}}})})})}var ee=n(996988);function et(e){let{user:t,guildId:n,channelId:i,themeType:s,onClose:r,children:a,...o}=e,{interactionType:u,interactionSource:c,resetInteraction:d,interactionSourceId:m,interactionPopoutTargetRef:h}=(0,T.Pq)(),p=[ee.d.MODAL,ee.d.MODAL_V2].includes(s)?(0,j.n)(t.id,n):void 0,f=c===o.sourceType&&u===D.AQ.REACT,g=c===o.sourceType&&u===D.AQ.REPLY,E=(f||g)&&m===o.sourceId;return(0,l.jsx)(N.Y,{targetElementRef:h??void 0,renderPopout:e=>{let{setPopoutRef:a}=e;return(0,l.jsx)(f?H:Q,{user:t,guildId:n,channelId:i,themeType:s,onClose:r,modalKey:p,setPopoutRef:a,...o})},onRequestClose:()=>{d(),r?.()},shouldShow:E,...function(e){let{interactionType:t,interactionSource:n,themeType:l}=e;return t===D.AQ.REACT?{position:"left",align:"top",animationPosition:"right",spacing:8}:l===ee.d.MODAL||l===ee.d.MODAL_V2||n===D.dS.ACTIVITY?{position:"bottom",align:"center",animationPosition:"top",spacing:6}:{position:"bottom",align:"left",animationPosition:"top",spacing:6}}({interactionType:u,interactionSource:c,themeType:s}),children:a})}var en=n(990078),el=n(22231),ei=n(241326),es=n(101555),er=n(885386),ea=n(242744);function eo(e){let{isVisible:t,isExpandable:s,onCloseProfile:a}=e,{analyticsLocations:u}=(0,x.Ay)(),{trackUserProfileAction:d}=(0,v.NJ)(),m=i.useRef(null),h=i.useRef(null),[p,f]=(0,o.yK)([E.Ay],()=>[E.Ay.useReducedMotion,E.Ay.keyboardModeEnabled]),g=!s||p||f?0:300,{themeType:A}=(0,k.E)();return(0,l.jsxs)(es.Ay,{className:r()(ea.oO,{[ea.RK]:t,[ea.lu]:s}),children:[(0,l.jsx)(en.m,{asContainer:!0,targetElementRef:m,text:V.intl.string(V.t.bt75uw),delay:g,ariaHidden:!0,children:(0,l.jsx)(es.$n,{ref:m,className:r()(ea.x6,ea.kb),"aria-label":V.intl.string(V.t.QdHxos),"aria-haspopup":"dialog",onClick:function(){d({action:"PRESS_EDIT_CUSTOM_STATUS"}),function(e){let{analyticsLocations:t,stackingBehavior:i}=e;(0,c.openModalLazy)(async()=>{let{default:e}=await Promise.all([n.e("33973"),n.e("57328"),n.e("4803"),n.e("67251"),n.e("28367"),n.e("20287"),n.e("20491"),n.e("33171"),n.e("72163"),n.e("89122")]).then(n.bind(n,657977));return n=>(0,l.jsx)(e,{...n,sourceAnalyticsLocations:t})},null!=i?{stackingBehavior:i}:void 0)}({analyticsLocations:u,stackingBehavior:A===ee.d.MODAL_V2?"stack":void 0}),a?.()},children:(0,l.jsx)(el.R,{size:"xs",colorClass:ea.Kk})})}),(0,l.jsx)(en.m,{asContainer:!0,text:V.intl.string(V.t.VkKicb),delay:g,ariaHidden:!0,children:(0,l.jsx)(es.$n,{ref:h,className:r()(ea.x6,ea.pG),"aria-label":V.intl.string(V.t.wfYTHe),onClick:function(){d({action:"PRESS_CLEAR_CUSTOM_STATUS"}),er.G2.updateSetting(void 0)},children:(0,l.jsx)(ei.u,{size:"xs",colorClass:ea.Kk})})})]})}var eu=n(713305);function ec(e){let{children:t,className:n}=e;return(0,l.jsx)("div",{className:r()(eu.nL,n),children:(0,l.jsx)("div",{className:eu.A7,children:(0,l.jsx)("span",{className:eu.vW,children:t})})})}let ed=i.forwardRef(function(e,t){let{onCloseProfile:i,prompt:s}=e,a=(0,I.GV)(),{analyticsLocations:o}=(0,x.Ay)(),{trackUserProfileAction:u}=(0,v.NJ)(),{themeType:f}=(0,k.E)(),g=null!=s?s.label():V.intl.string(V.t.evw0oz),E=(0,l.jsxs)("div",{className:eu.Qs,children:[(0,l.jsx)(d.U,{size:"xs",className:eu.Tw,colorClass:eu.qv}),(0,l.jsx)(m.E,{variant:"text-sm/normal",className:r()(eu.ch,null!=s&&eu.R9),children:g})]});return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(ec,{children:E}),(0,l.jsx)("div",{className:r()(eu.kL,eu.LL),ref:t,children:(0,l.jsx)(h.D,{className:eu.A7,"aria-label":V.intl.string(V.t["zrpF/b"]),"aria-describedby":a,onClick:function(){u({action:"PRESS_ADD_CUSTOM_STATUS"}),i?.(),(0,c.openModalLazy)(async()=>{let{default:e}=await Promise.all([n.e("33973"),n.e("57328"),n.e("4803"),n.e("67251"),n.e("28367"),n.e("20287"),n.e("20491"),n.e("33171"),n.e("72163"),n.e("89122")]).then(n.bind(n,657977));return t=>(0,l.jsx)(e,{...t,sourceAnalyticsLocations:o,prompt:s})},f===ee.d.MODAL_V2?{stackingBehavior:"stack"}:void 0)},focusProps:{ringClassName:eu.hN},children:(0,l.jsxs)("span",{className:r()(eu.vW,eu.vk),children:[(0,l.jsx)(d.U,{size:"xs",className:eu.Tw,colorClass:eu.qv}),(0,l.jsxs)(p.A,{id:a,children:[V.intl.string(V.t.EVV6uZ),": ",g]}),(0,l.jsx)(m.E,{variant:"text-sm/normal",className:r()(eu.ch,null!=s&&eu.R9),"aria-hidden":"true",children:g})]})})})]})}),em=i.forwardRef(function(e,t){let{emoji:n,text:s,animate:c,className:d,renderToolbar:h,onShowToolbar:p,placeholderText:C,hasEntered:x=!0}=e,I=(0,T.NR)(),{trackUserProfileAction:_}=(0,v.NJ)(),S=1.25*(null!=n),y=36+S,N=144+S,j=i.useRef(null),b=i.useRef(null),R=i.useRef(null),P=i.useRef(y),L=i.useRef(N),M=null!=n&&null==s,[O,w]=i.useState(!1),[k,U]=i.useState(!0),[G,F]=i.useState(!M&&x),B=x&&O,H=(0,o.bG)([E.Ay],()=>E.Ay.useReducedMotion),[W]=i.useState(()=>new u.Ep);i.useEffect(()=>()=>W.stop(),[W]),i.useEffect(()=>{I?.onInteractionPopoutTargetRefChange(j)},[I]);let[K,Y]=(0,f.z)(()=>({maxHeight:`${P.current}px`,config:{clamp:!0,duration:150}}));function z(e){G&&(e?Y({maxHeight:`${Math.min(L.current,N)}px`,delay:300*!H,config:{clamp:!0,duration:150*!H}}):Y({maxHeight:`${Math.min(P.current,y)}px`,delay:0}),H?U(!e):W.start(e?300:150,()=>U(!e)))}i.useLayoutEffect(()=>{if(w(!0),null==b.current||null==R.current||!B)return;let e=b.current.getBoundingClientRect().height,t=R.current.getBoundingClientRect().height;F(t>e),P.current=e,L.current=t,Y({maxHeight:`${Math.min(k?P.current:L.current,k?y:N)}px`})},[B,s,n,Y,k,y,N]);let Z=null!=n?(0,l.jsx)(A.A,{emoji:n,animate:c,hideTooltip:!1,tooltipDelay:D.In,className:eu.H0}):null,q=null!=s?(0,l.jsx)(m.E,{variant:"text-sm/normal",className:eu.qS,children:s}):null,$=void 0!==C&&null==n?(0,l.jsx)(m.E,{variant:"text-sm/normal",color:"text-muted","aria-label":`${V.intl.string(V.t.EVV6uZ)}: ${C}`,className:r()(eu.qS,eu.R9),children:C??""}):null,J=null==q||""===s?$:q,X=(0,l.jsxs)("div",{ref:b,className:eu.Qs,children:[Z,J]}),Q=(0,l.jsxs)("div",{ref:R,className:r()(eu.Qs,eu.m2),children:[Z,J]}),ee=(0,l.jsx)("div",{ref:t,className:eu.A7,children:(0,l.jsx)("span",{className:eu.vW,children:(0,l.jsxs)(a.animated.div,{style:K,className:r()(eu.Qs,{[eu.m2]:!k}),children:[Z,J]})})}),et=(0,l.jsxs)(ec,{children:[X,Q]});return null==p?(0,l.jsxs)(l.Fragment,{children:[et,(0,l.jsxs)("div",{ref:j,className:r()(eu.kL,d),onMouseEnter:()=>{_({action:"HOVER_CUSTOM_STATUS"}),z(!0)},onMouseLeave:()=>{z(!1)},onFocus:()=>z(!0),onBlur:()=>z(!1),children:[(0,l.jsx)(g.vN,{children:(0,l.jsx)("div",{className:eu.hN,role:"tooltip",tabIndex:0,"aria-label":V.intl.formatToPlainString(V.t.UpF5Qa,{emoji:n?.name??"",status:s}),children:ee})}),h?.(G)]})]}):(0,l.jsxs)(l.Fragment,{children:[et,(0,l.jsxs)("div",{ref:j,className:r()(eu.kL,d),onFocus:()=>{p(!0),z(!0)},onBlur:e=>{j.current?.contains(e.relatedTarget)||(p(!1),z(!1))},onMouseEnter:()=>{_({action:"HOVER_CUSTOM_STATUS"}),p(!0),z(!0)},onMouseLeave:()=>{p(!1),z(!1)},children:[(0,l.jsx)(g.vN,{children:(0,l.jsx)("div",{className:eu.hN,role:"tooltip",tabIndex:0,"aria-label":V.intl.formatToPlainString(V.t.UpF5Qa,{emoji:n?.name??"",status:s}),children:ee})}),h?.(G)]})]})}),eh=i.forwardRef(function(e,t){let{emoji:n,text:s,onCloseProfile:r,...a}=e,[o,u]=i.useState(!1);return(0,l.jsx)(em,{...a,ref:t,emoji:n,text:s,className:eu.LL,onShowToolbar:u,renderToolbar:e=>(0,l.jsx)(eo,{isVisible:o,isExpandable:e,onCloseProfile:r})})});function ep(e){let t,{emoji:n,text:s,user:r,guildId:a,channelId:o,themeType:u,...c}=e,{trackUserProfileAction:d}=(0,v.NJ)(),{interactionType:m,interactionSource:h,resetInteraction:p}=(0,T.Pq)(),f=h===D.dS.STATUS&&m===D.AQ.REACT,g=h===D.dS.STATUS&&m===D.AQ.REPLY,E=f||g,A=i.useRef(null),C=i.useRef(n),x=i.useRef(s);i.useEffect(()=>{h===D.dS.STATUS&&((C.current!==n||x.current!==s)&&p(),C.current=n,x.current=s)},[h,p,n,s]);let[I,_]=i.useState(!1),y=i.useCallback(e=>{(e||!E)&&_(e)},[E]);return(0,l.jsx)(et,{user:r,guildId:a,channelId:o,themeType:u,sourceDetails:(t=null==n?null:null!=n.id?`\`:${n.name}:\``:S.Ay.translateSurrogatesToInlineEmoji(n.name),null==s?t:null==t?s:`${t} ${s}`),sourceType:D.dS.STATUS,onAction:d,onClose:()=>_(!1),children:()=>(0,l.jsx)(em,{...c,ref:A,emoji:n,text:s,themeType:u,className:E?eu.zf:void 0,onShowToolbar:y,renderToolbar:e=>(0,l.jsx)(w.Ay,{targetRef:A,user:r,sourceType:D.dS.STATUS,isVisible:I&&!E,isExpandable:e,onAction:d})})})}let ef=i.forwardRef(function(e,t){let{user:n,onCloseProfile:i,previewText:s,previewEmoji:r,placeholderText:a,prompt:u,disableToolbar:c=!1,...d}=e,m=(0,_.A)(n.id),{analyticsLocations:h}=(0,x.Ay)(C.A.USER_PROFILE_CUSTOM_STATUS_BUBBLE),p=(0,o.bG)([y.default],()=>y.default.getId()===n.id),f=p&&!c,g=!p&&!n.bot&&!c;if(null!=s||null!=r)return(0,l.jsx)(x.f5,{value:h,children:(0,l.jsx)(em,{emoji:r??null,text:null!=s&&""!==s?s:null,placeholderText:a,ref:t,...d})});let E=m?.emoji??null,A=m?.state??null,I=null!=A&&""!==A?A:null;return null!=E||null!=I||f?null==E&&null==I?(0,l.jsx)(x.f5,{value:h,children:(0,l.jsx)(ed,{onCloseProfile:i,prompt:u,ref:t,...d})}):g?(0,l.jsx)(x.f5,{value:h,children:(0,l.jsx)(ep,{user:n,emoji:E,text:I,...d})}):f?(0,l.jsx)(x.f5,{value:h,children:(0,l.jsx)(eh,{emoji:E,text:I,onCloseProfile:i,ref:t,...d})}):(0,l.jsx)(x.f5,{value:h,children:(0,l.jsx)(em,{emoji:E,text:I,ref:t,...d})}):null})}