Module 659280

11,965 characters · in 0e45183c1736743b.js
Dependencies
Source Raw
function(e,t,n){"use strict";n.d(t,{Sz:()=>ec,Ay:()=>eb,aI:()=>eo});var l=n(627968),i=n(64700),s=n(503698),r=n.n(s),a=n(735438),o=n.n(a),c=n(837381),u=n(939249),d=n(534514),h=n(97808),m=n(778712),p=n(521100),f=n(545442),g=n(678708),x=n(88187),A=n(775602),C=n(392054),E=n(17928),I=n(990078),y=n(834730),S=n(81093);let v=e=>{let{children:t,className:n}=e;return(0,l.jsx)("div",{className:r()(S.um,n),children:t})},N=e=>{let{children:t,className:n}=e;return(0,l.jsx)("div",{className:r()(S.Ov,n),children:t})},_=e=>{let{children:t,className:n}=e;return(0,l.jsx)("div",{className:r()(S.wq,n),children:t})},T=e=>{let{children:t,className:n}=e;return(0,l.jsx)(y.E,{className:r()(n,S.hf),color:"interactive-text-active",variant:"text-md/normal",children:t})},j=e=>{let{children:t,className:n}=e;return(0,l.jsx)(y.E,{className:r()(n,S.p3),color:"interactive-text-default",variant:"text-xs/normal",children:t})},b=e=>{let{children:t,className:n}=e;return(0,l.jsx)(y.E,{className:r()(n,S.I0),color:"interactive-text-default",variant:"text-xs/normal",children:t})};var R=n(696451),O=n(632533);function L(e){let{name:t,className:n,state:i,isInline:s,onClick:a}=e,o=null;i?.isActive&&!s?o=O.vu:i?.lastValidationResult?.success===!1?o=O.z3:i?.hasValue&&!s&&(o=O.hZ);let c=(0,l.jsx)(y.E,{variant:s?"text-md/normal":"text-sm/normal",color:"text-strong",className:r()(O.uK,{[O.mG]:s},o,n),children:t+(s?":":"")});return null==a?c:(0,l.jsx)(u.D,{className:O.vk,onClick:()=>a(t),children:c})}var M=n(649671);n(827669);var w=n(375708),k=n(577332);function P(e,t,n){return(0,l.jsx)(L,{className:k.uK,name:e.displayName,state:t,onClick:n},e.name)}function D(e){let{command:t,optionStates:n,onOptionClick:s}=e,{requiredOptions:r,setOptionalOptions:a,unsetOptionalOptions:o}=i.useMemo(()=>{let e=t.options?.filter(e=>e.required)??[],l=t.options?.filter(e=>!e.required)??[];return{requiredOptions:e,setOptionalOptions:l.filter(e=>n?.[e.name]?.hasValue),unsetOptionalOptions:l.filter(e=>!n?.[e.name]?.hasValue)}},[t.options,n]),c=(0,l.jsx)("div",{className:k.$2,children:o.map(e=>(0,l.jsx)(y.E,{variant:"text-sm/normal",children:e.displayName},e.name))}),u=r.map(e=>P(e,n?.[e.name],s)),h=a.length>0?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(d.D,{className:k.Ki,variant:"heading-deprecated-12/semibold",children:w.intl.string(w.t["5C107K"])}),a.map(e=>P(e,n?.[e.name],s))]}):null,m=o.length>0?(0,l.jsx)(I.m,{__unsupportedReactNodeAsText:c,"aria-label":!1,delay:200,children:(0,l.jsx)(y.E,{className:k.kP,color:"text-muted",variant:"text-sm/normal",children:0===a.length?w.intl.formatToPlainString(w.t["0mI72g"],{count:o.length}):w.intl.formatToPlainString(w.t.BP8N0K,{count:o.length})})}):null;return(0,l.jsxs)(l.Fragment,{children:[u,null!=h||null!=m?(0,l.jsxs)("div",{className:k.gM,children:[h,m]}):null]})}function U(e){let t,{command:n,activeOptionName:s,channel:a,showOptions:o,showImage:c,optionStates:u,onOptionClick:d,section:h,isSelectable:m=!0}=e,p=i.useMemo(()=>n?.options?.find(e=>e.name===s),[s,n]),f=null!=s?u?.[s]:null;t=null!=f&&f.lastValidationResult?.success===!1?f.lastValidationResult.error??"":null;let g=c&&null!=h?(0,M.Rg)(h):null,x=(0,E.bG)([R.Ay],()=>{if(null!=a.guild_id&&h?.botId!=null)return R.Ay.getMember(a.guild_id,h.botId)?.nick});return(0,l.jsxs)("div",{className:r()(k.iE,m?null:k.r9),children:[null!=g?(0,l.jsx)(g,{className:k.Sl,channel:a,section:h,width:32,height:32}):null,(0,l.jsxs)("div",{className:k.QR,children:[(0,l.jsxs)("div",{className:k.nY,children:[(0,l.jsx)(T,{className:k.DD,children:"/"+n.displayName}),o?(0,l.jsx)(D,{command:n,optionStates:u,onOptionClick:d}):null]}),(0,l.jsx)(j,{className:r()(k.h_,null!=t?k.z3:null),children:t??p?.displayDescription??n.displayDescription})]}),(0,l.jsx)(b,{className:k.sP,children:x??h?.name})]})}var G=n(746388),V=n(47167),F=n(713654),H=n(688810),B=n(573435),W=n(174459),K=n(486020),z=n(652215),Z=n(307731),Y=n(788868),q=n(202606);let J=e=>{let{emojis:t}=e,{analyticsLocations:n}=(0,H.Ay)();i.useEffect(()=>{W.default.track(z.HAw.PREMIUM_UPSELL_VIEWED,{type:Y.e.EMOJI_AUTOCOMPLETE_INLINE,location_stack:n})},[n]);let s=(0,l.jsx)("div",{className:q.gm,children:t.slice(0,3).map((e,t)=>{if(null==e.id)return null;let n=(0,l.jsx)("div",{className:q.rT,children:(0,l.jsx)("img",{alt:e.name,className:q.Zg,src:K.Ay.getEmojiURL({id:e.id,animated:e.animated,size:Z.EMOJI_URL_BASE_SIZE})})},e.id);return 2===t?n:(0,l.jsx)(B.Ay,{className:q.j3,mask:B.Ay.Masks.AUTOCOMPLETE_EMOJI_UPSELL_EMOJI,children:n},e.id)})});return(0,l.jsxs)(v,{className:q.UX,children:[(0,l.jsx)(N,{children:(0,l.jsx)(T,{children:w.intl.format(w.t.uEky42,{count:t.length})})}),(0,l.jsx)(b,{children:s})]})};var $=n(785562),X=n(967144),Q=n(565645),ee=n(71393);function et(e){let{sound:t}=e,n=(0,E.bG)([ee.A],()=>"0"===t.guildId?w.intl.string(w.t.Rtvk9X):ee.A.getGuild(t.guildId)?.name);return(0,l.jsxs)(v,{children:[(null!=t.emojiId||null!=t.emojiName)&&(0,l.jsx)(_,{children:(0,l.jsx)(Q.A,{emojiId:t.emojiId,emojiName:t.emojiName})}),(0,l.jsx)(N,{children:(0,l.jsx)(T,{children:t.name})}),null!=n&&(0,l.jsx)(b,{children:n})]})}n(980504);var en=n(750385),el=n(68935),ei=n(885386),es=n(994500),er=n(287809),ea=n(427262);function eo(e){return null!=e?`autocomplete-${e}`:null}function ec(e){return`autocomplete-${e}-title`}let eu=i.createContext(null);class ed extends i.PureComponent{selectable=!0;layoutClass=S.rT;constructor(e){super(e),this.state={hovered:!1}}isSelectable(){return this.selectable}renderContent(){throw Error("AutocompleteRow: renderContent must be extended")}renderClickable(e){let{layoutClass:t,props:{className:n,index:i,selected:s}}=this;return this.isSelectable()?(0,l.jsx)(u.D,{...e,className:r()(S.vk,n,t),id:eo(i)??void 0,onClick:this.handleClick,onMouseMove:()=>{this.setState({hovered:!0}),this.handleMouseEnter()},onMouseLeave:()=>this.setState({hovered:!1}),role:"option","aria-selected":s,children:(0,l.jsx)("div",{className:S.E3,children:this.renderContent()})}):(0,l.jsx)("div",{className:r()(S.vk,n,t),id:eo(i)??void 0,role:"none",children:(0,l.jsx)("div",{className:S.E3,children:this.renderContent()})})}render(){let{index:e}=this.props;return this.isSelectable()?(0,l.jsx)(c.tG,{id:`${e}`,children:e=>this.renderClickable(e)}):this.renderClickable()}handleMouseEnter=()=>{let{onHover:e,index:t,selected:n}=this.props;null==e||n||"number"!=typeof t||e(t)};handleClick=e=>{let{onClick:t,index:n}=this.props;null!=t&&"number"==typeof n&&t(n,e)}}class eh extends ed{renderContent(){let{text:e,description:t}=this.props;return(0,l.jsxs)(v,{children:[(0,l.jsx)(N,{children:(0,l.jsx)(T,{children:e})}),null!=t?(0,l.jsx)(b,{children:t}):null]})}}function em(e){let t=i.useMemo(()=>o().random(60,120),[]);return(0,l.jsx)("div",{className:S.E3,"aria-busy":!0,children:(0,l.jsx)(v,{children:(0,l.jsx)(N,{children:(0,l.jsx)(T,{children:(0,l.jsx)("div",{className:S.M,style:{width:t}})})})})})}function ep(e){let{title:t,className:n,children:s}=e,a=i.useContext(eu);return(0,l.jsx)("div",{className:S.E3,children:(0,l.jsxs)(d.D,{id:ec(a.id),className:r()(S.eu,n),variant:"heading-deprecated-12/semibold",children:[t,s]})})}class ef extends ed{layoutClass=S.fF;selectable=!1;renderContent(){let{className:e}=this.props;return(0,l.jsx)("div",{className:r()(e,S.yF)})}}class eg extends ed{renderContent(){let{user:e,nick:t,status:n,hidePersonalInformation:i,guildId:s}=this.props,r=null==s?es.A.getNickname(e.id):null;return(0,l.jsxs)(v,{children:[(0,l.jsx)(_,{children:(0,l.jsx)(h.eu,{size:m._3.SIZE_24,src:e.getAvatarURL(s,24),"aria-hidden":!0,status:n})}),(0,l.jsx)(N,{children:(0,l.jsx)(T,{children:t??r??ea.Ay.getName(e)})}),(0,l.jsxs)(b,{children:[ea.Ay.getUserTag(e,{mode:"username",identifiable:i?"never":"always"}),i||e.hasUniqueUsername()?null:(0,l.jsxs)("span",{className:S.T,children:["#",e.discriminator]})]})]})}}class ex extends ed{renderContent(){let{role:e,hideDescription:t,guildId:n}=this.props,{colorString:i,colorStrings:s}=e,a="dot"===A.A.roleStyle,o="username"===A.A.roleStyle&&(null!=i||null!=s),c=(0,X.hH)(n,e,s),u=null!=c&&o,{gradientStyle:d,gradientClassname:h}=(0,p.Wq)({colorStrings:s,useReducedMotion:A.A.useReducedMotion,roleStyle:"username",includeConvenienceGlow:!0}),m=o?{...u?d:{color:null!=i?i:void 0}}:void 0;return(0,l.jsxs)(v,{children:[(0,l.jsx)(N,{children:(0,l.jsxs)(T,{children:[a&&(0,l.jsx)(f.W,{className:S.m4,color:i,colors:c,tooltip:!1}),(0,l.jsxs)("span",{className:r()({[h]:u}),style:m,"data-text":u?`@${e.name}`:void 0,children:["@",e.name]})]})}),t?null:(0,l.jsx)(b,{children:w.intl.string(w.t["/91tbr"])})]})}}class eA extends ed{renderContent(){let{timestamp:e,description:t}=this.props;return(0,l.jsxs)(v,{children:[(0,l.jsx)(N,{children:(0,l.jsx)(T,{children:(0,l.jsx)($.A,{node:e,showTooltip:!1})})}),null!=t?(0,l.jsx)(b,{children:t}):null]})}}class eC extends ed{renderContent(){let{channel:e,category:t}=this.props,n=e.type===z.rbe.GUILD_CATEGORY?g.s:(0,F.gU)(e);return(0,l.jsxs)(v,{children:[null!=n&&(0,l.jsx)(_,{children:(0,l.jsx)(n,{className:S.Kk})}),(0,l.jsx)(N,{children:(0,l.jsx)(T,{children:(0,V.m1)(e,er.default,es.A)})}),null!=t?(0,l.jsx)(b,{children:t.name}):null]})}}class eE extends ed{renderContent(){let{command:e}=this.props;return(0,l.jsxs)(v,{children:[(0,l.jsx)(_,{children:(0,l.jsx)(x.F,{size:"xs",color:"currentColor",className:S.Kk,colorClass:S.t4})}),(0,l.jsx)(N,{children:(0,l.jsx)(T,{children:e.displayName})}),(0,l.jsx)(b,{children:e.displayDescription})]})}}class eI extends ed{isSelectable(){return this.props.command.inputType!==C.y$.PLACEHOLDER}renderContent(){let{command:e,channel:t,showImage:n,section:i,selected:s}=this.props,{hovered:r}=this.state,a=this.isSelectable();return e.inputType===C.y$.PLACEHOLDER?(0,l.jsx)(G.A,{}):(0,l.jsx)(U,{command:e,channel:t,showImage:n,showOptions:r||a&&s,section:i,isSelectable:a})}}class ey extends ed{layoutClass=r()(S.rT,S.Mf);renderContent(){let{emoji:e,sentinel:t,guild:n}=this.props,i=ei.Sf.getSetting(),s=null!=e.id||""!==e.url?(0,l.jsx)("img",{alt:"",className:S.mp,src:null!=e.id?K.Ay.getEmojiURL({id:e.id,animated:e.animated&&i,size:Z.EMOJI_URL_BASE_SIZE}):e.url}):(0,l.jsx)("span",{className:S.nT,children:e.surrogates}),r=null!=n?(0,l.jsx)(b,{children:n.name}):null;return(0,l.jsxs)(v,{children:[(0,l.jsx)(_,{children:s}),(0,l.jsx)(N,{children:(0,l.jsxs)(T,{children:[t,e.name,t]})}),r]})}}class eS extends ed{layoutClass=r()(S.rT,S.Mf);renderContent(){let e,{queryMatch:t,renderSticker:n,selected:i,sticker:s}=this.props,{hovered:r}=this.state;return(0,el.FD)(s)?e=en.A.getStickerPack(s.pack_id)?.name:(0,el.Xw)(s)&&(e=ee.A.getGuild(s.guild_id)?.name),(0,l.jsxs)(v,{children:[(0,l.jsx)(_,{children:n(s,r||!0===i)}),(0,l.jsxs)(N,{children:[(0,l.jsx)(T,{children:s.name}),null!=t&&(0,l.jsx)(j,{children:w.intl.format(w.t.PAutaQ,{queryMatch:t})})]}),null!=e&&(0,l.jsx)(b,{children:e})]})}}class ev extends ed{layoutClass=S.ju;renderContent(){let{width:e,height:t,src:n}=this.props;return(0,l.jsx)("img",{alt:"",src:n,width:e,height:t})}}class eN extends ed{renderContent(){return(0,l.jsx)(J,{emojis:this.props.emojis})}}class e_ extends ed{renderContent(){return(0,l.jsx)(et,{...this.props})}}class eT extends ed{renderContent(){let{game:e}=this.props,t=(0,l.jsx)("img",{alt:"",className:S.Kk,src:K.Ay.getApplicationIconURL({id:e.id,icon:e.icon,size:32})});return(0,l.jsxs)(v,{children:[(0,l.jsx)(_,{children:t}),(0,l.jsx)(N,{children:(0,l.jsx)(T,{children:e.name})})]})}}class ej extends i.PureComponent{static Generic=eh;static Loading=em;static Title=ep;static Divider=ef;static User=eg;static Role=ex;static Channel=eC;static Command=eE;static NewCommand=eI;static Emoji=ey;static GIFIntegration=ev;static Sticker=eS;static EmojiUpsell=eN;static Soundmoji=e_;static Game=eT;static Timestamp=eA;render(){let{children:e,className:t,innerClassName:n,id:s,...a}=this.props;return i.Children.count(e)>0?(0,l.jsx)(eu.Provider,{value:{id:s??""},children:(0,l.jsx)("div",{className:r()(S.nx,t),children:(0,l.jsx)("div",{className:r()(S.Fv,n),...a,children:e})})}):null}}let eb=ej}