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