Loading
function(e,t,n){"use strict";n.d(t,{Ay:()=>L,LF:()=>R});var l=n(627968),i=n(64700),s=n(503698),r=n.n(s),a=n(702841),o=n(990078),u=n(939249),c=n(983851),d=n(565645),m=n(864145),h=n(926972),p=n(470020),f=n(319993),g=n(102597),E=n(904054),A=n(584014),C=n(885386),x=n(174459),I=n(652215);function _(e,t){let{isPlaying:n,playSound:l}=(0,A.A)(null!=e?(0,g.A)(e.soundId):null);return{isPlaying:n,playSound:i.useCallback(()=>!!l({volume:(0,E.A)(e?.volume??1,C.HO.getSetting())})&&(x.default.track(I.HAw.SOUNDMOJI_PLAY,{guild_id:t?.guild_id,channel_id:t?.id,sound_guild_id:e?.guildId,sound_id:e?.soundId}),!0),[t?.guild_id,t?.id,l,e?.guildId,e?.soundId,e?.volume])}}var S=n(209932),y=n(807348),v=n(805945),T=n(734057),N=n(375708),j=n(720417);function b(e){let{playSound:t}=e;return(0,l.jsxs)(u.D,{title:"Risky Click",tag:"span",onClick:t,className:j.Ls,children:[(0,l.jsx)(c.H,{size:"md",color:"currentColor",className:j.uA}),(0,l.jsx)("span",{children:"Unknown"})]})}function R(e){let{soundId:t}=e,n=(0,a.bG)([S.A],()=>S.A.getSoundById(t)),i=(0,h.tj)({location:"SoundboardMentionInline"}),{isPlaying:s,playSound:r}=_(n);return i?null==n?(0,l.jsx)(b,{}):(0,l.jsx)(P,{className:j.wg,isPlaying:s,playSound:r,sound:n}):null}function P(e){let{className:t,sound:n,playSound:i,isPlaying:s}=e,a=n?.emojiId!=null||n?.emojiName!=null,o=N.intl.formatToPlainString(N.t.tuMUJ2,{emojiName:n?.emojiName,soundName:n?.name});return(0,m.X)({location:"SoundboardMentionInline"})?(0,l.jsxs)(u.D,{"aria-label":o,tag:"span",onClick:i,className:r()(j.Ls,j.oR,{[j.he]:!0===s},t),children:[a&&(0,l.jsx)(d.A,{emojiId:n?.emojiId,emojiName:n?.emojiName,className:j.JS}),(0,l.jsx)("span",{children:` ${n?.name} `})]}):null}let L=function(e){let{channelId:t,messageId:n,soundId:s,messageSounds:r,jumbo:u=!1}=e,c=C.hH.useSetting(),d=(0,a.bG)([S.A],()=>S.A.getSoundById(s),[s]),h=i.useMemo(()=>(0,p.A)(t,n,s,r)??d,[t,n,s,r,d]),g=(0,a.bG)([T.A],()=>T.A.getChannel(t)),E=(0,m.X)({location:"SoundboardMention"}),A=i.useRef(null),{isPlaying:x,playSound:I}=_(h,g),N=i.useCallback(async()=>{await I()&&A.current?.addAnimation()},[I]);return E?null==h?(0,l.jsx)(b,{playSound:N}):u&&!c?(0,l.jsx)(v.Ay,{containerClassName:j.Ti,className:j.UX,sound:h,channel:g,onSelectItem:N,isPlayingSoundOverride:x,isSoundmoji:!0,buttonOverlay:y.If.SOUNDMOJI,tooltipClassName:j.YL,tooltipContentClassName:j.R3,tooltipOverride:(0,l.jsx)(f.WE,{sound:h}),soundmojiVisualEffectRef:A},`${h.soundId}`):(0,l.jsx)(o.m,{"aria-label":h.name,"data-pending-richtooltip-migration":!0,__unsupportedReactNodeAsText:(0,l.jsx)(f.WE,{sound:h}),position:"top",delay:500,children:(0,l.jsx)("span",{children:(0,l.jsx)(P,{sound:h,playSound:N,isPlaying:x})})}):null}}