Module 69731

418,128 characters · in a9234a420f998807.js
Dependencies
Required by (3)
Lazily required by (0)none
Requires (872)
121522423137343245428880911393021009413875162361659017928182931957520851222312238525044251762864729160303703079331300314083172032523328803558736149373973764637766384053850239623419844399045938460544612146367499995196553061530705351654570556195576656562587036748070283706887139371532738257439674669748487580477138774687772980703814008361784540863798771993055934659503595477957019660796919972609735297483978089820799696100392100767101058101928102609104510104589106236106531106713107384109802111159111162113463113494115063123292123791127062128450131352131607132500138134138617139033140735141218141343142862143582144165145331145497147248147925147964148810150934152056152567153488153659155957155984157559157723158045159001160946162093163437165191166403168482169869171316172272173936174197174459175880176524176781178368182817182859183208184809185438189081189213189883192308194261196736198970199300199966200921201718201805202541202613202639204050204925206697206828206885207560207803209932212168212245212739215082217510219887221347224964226640227309228366230451231570232122233545235079235693235986237218237984240248241326241524242653243217243721246605248778252589252732254138256006256311257433259065259678260509260598262077264686264779269115269880270003271078271478271866271995273151274184275695276086277984280450281161281445284009284016285918287809288737289498289873290386290595295405295648296027297264297932300118300839303778305866306471307301307863308528308645311043312671314116314647315629317097318785319225320095320448320989321073321078321191322281323073327479328968329139329551331322331887333722338548339048339984341206341923342744342942344346346017346055347481347990349085349288350535351906353835354328355097355622356061357758360308360615360669360729363195364522365199365258366010366523366999369606370480370997375708378102379197379550379848380610381579381941382003384684386171386447386976387722387758388567389737390248390646391048391973392164393284395277396478397438398177400492400669401721403362403581404778406252406360406535406935408018408278410767412260412780412848413142413339414079414133416052417098417270419954423764424994425587426399427262428031428275428678429913432816434404435558442433443865444802446243446404449817450740451909451988452027455218457421458024459357459838461797461893462887464477464946465323465558465932466034466919467962469054469778470739473145475358476713477782477900478016479183484036486020487329487866488430489277489718492064496431497267498642499454502229502572503698506774507553508274509531511484512062512599512950514956515183515727516761518477520229521078522334522826524170526162527113530702531260532197532446532624533792534400534654539572540999543465543767545075545934546140546385548118548411549363549406550640552122553429554146555393555837556534557722558001558076561835562519562819565645566769566935567910567926569926572164573435573648574381576705577997580630581781582128582835583613583995587895588857589051590180591179592598594061594387594943597770599941601298602339602853604121607399611881614455615396615405616356617061617255617617617641619499621380624456624479625494625657625841626584626822627363630579631368631670632119635233635242636194636537637193639555640238645886646270650583650809651439652215652525654107656513658675659758661531662731662758663417663894664121665260665267665671667532669067670492672130672140672396674168682348682618682763683071683760684013684732685073685743687021687123687966688151688810691540691885695366695515696016696451696986699217702841707554710144710195711014711171712440714763717398723702723923724405724651725538725570725807725951729919730134731854732280733110734057734066736056736653738188738262738678742023743526743981745317746080749884750714751075753806754692756625757036758836760677760751761508763754766075766928769015773371773669775121775602775657776096776351776409778712780964782134782603783419783878784075785007787392788833789645790284790782792348792656793574793943796774801644803224803306805945806932808658808728810412811160811611812729812993813564814278814390814925815332815807815846816453817281818348819169820739820785821609821956822585823092823894824744825484827053827343830215830543830991831544831653832208832712834297834730834981835002835071836602839214839272839534839628840387840559843282843402844222844828847374847599848575852712853513854627855267855302856488857250859241862482864145864310864386866665866945868511868886869038869438871123871633872351873298874486874490875162875444876399880144880482881489883600884705885386885574885996889227890856892208892547897720898461898555899847900686900797903209906199906688907895909536912851914410915043915089915725917136919395922016922795923457926140926919927018927813928171930861930863933287933832934246934729935208935399935671936388936926938706938796939249940622940856942053943646943775945276945810946801950305951260951555952270952572952818953298954225955572957565957658960309962644963852963935964355964486965957966327967198968309968671968898970931972737974293974544975571975732976860976910978263980504980707982240983048983511983851984813986238986687987144987197989349990125992526993077993830994500997187997213999291999834
Source Raw
function(e,t,n){n.d(t,{D:()=>Cz});var i,l,s,r,a=n(419954),o=n(780964),u=n(550640),d=n(107384),c=n(477900),g=n(582128),m=n(17928),A=n(652215),h=n(346055),E=n(297264),S=n(364522),x=n(97808),T=n(778712),p=n(821609),f=n(775602),I=n(320095),_=n(963852),N=n(763754),C=n(20851),b=n(95701),y=n(486020),v=n(885386),j=n(375708),O=n(827053);let L=new b.nA({id:"1337",guild_id:"1337",type:A.rbe.GUILD_TEXT,name:"preview"}),D=[{status:A.clD.IDLE,discriminator:"2"},{status:A.clD.DND,discriminator:"3"},{status:A.clD.ONLINE,mobile:!0,discriminator:"4"}];function R(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,I.rh)({...(0,_.Ay)({channelId:L.id,content:e}),state:A.cmJ.SENT,reactions:t})}var P=n(856488);let G=(0,a.zD)(o.X.ENABLE_LEGACY_CHAT_INPUT,{useTitle:()=>j.intl.string(j.t.TZ2hZH),useSubtitle:()=>j.intl.string(j.t.Q7wgHc),useValue:()=>v.D_.useSetting(),setValue:e=>v.D_.updateSetting(e)}),M=(0,a.zD)(o.X.CHAT_INLINE_MEDIA_IMAGE_DESCRIPTIONS,{useTitle:()=>j.intl.string(j.t.XYvMIX),useSubtitle:()=>j.intl.string(j.t.T0rbtM),useValue:v._z.useSetting,setValue:v._z.updateSetting});var U=n(100767),V=n(435558),k=n.n(V),w=n(935399),F=n(331322),B=n(106236),z=n(834730),X=n(113494),Y=n(782134),H=n(54570),K=n(8880),W=n(75804);let Z=k().debounce(e=>{(0,H.zU)(e)},250);function q(){let[e,t]=g.useState(!1);return(0,w.l0)(()=>(0,H.pr)()),(0,c.jsx)(p.$,{text:j.intl.string(j.t.SKNnqq),icon:e?X.E:Y.u,size:"sm",onClick:function(){if(e){(0,H.pr)(),t(!1);return}(0,H.AU)(j.intl.string(j.t.PKaNJL),!0,void 0,function(){return t(!0)},function(){return t(!1)}),t(!0)}})}let Q=(0,a.E2)(o.X.TTS_PLAYBACK_RATE,{useSearchTerms:()=>[j.intl.string(j.t.lsW5Ev)],Component:function(){let e=(0,m.bG)([K.A],()=>K.A.speechRate);return(0,c.jsxs)(F.B,{gap:16,children:[(0,c.jsx)(B.A,{label:j.intl.string(j.t.lsW5Ev),description:j.intl.string(j.t.Ci4wMS),markers:W.P,initialValue:e,defaultValue:1,stickToMarkers:!0,onValueChange:Z,onValueRender:e=>`x${e.toFixed(2)}`,onMarkerRender:e=>0===e?(0,c.jsx)(z.E,{variant:"text-xs/medium",color:"text-subtle",children:j.intl.string(j.t["493lwX"])}):10===e?(0,c.jsx)(z.E,{variant:"text-xs/medium",color:"text-subtle",children:j.intl.string(j.t.ZSZEdS)}):1===e?(0,c.jsx)(z.E,{variant:"text-xs/medium",color:"text-feedback-positive",children:"x1.0"}):e%1==0?"":void 0}),(0,c.jsx)(q,{})]})},usePredicate:()=>U.$j}),J=(0,a.zZ)(o.X.AUDIO_AND_SCREEN_READER_CATEGORY,{useTitle:()=>j.intl.string(j.t.XVR0Rb),buildLayout:()=>[Q,M,G]}),$=(0,a.AK)(o.X.ACCESSIBILITY_TO_DISPLAY_NAVIGATOR,{useSubtitle:()=>j.intl.string(j.t.aTfeGK),destinationKey:o.X.APPEARANCE_PANEL}),ee=(0,a.gN)(o.X.COLOR_AND_CONTRAST_RELATED_SETTINGS,{buildLayout:()=>[$]});var et=n(955572);let en=(0,a.zD)(o.X.DESATURATE_CUSTOM_COLORS,{useTitle:()=>j.intl.string(j.t.OCJg5f),useSubtitle:()=>j.intl.string(j.t.HEO0s3),useValue:()=>(0,m.bG)([f.Ay],()=>f.Ay.desaturateUserColors),setValue:()=>(0,et.YV)()});var ei=n(652525);let el=(0,a.zD)(o.X.ENABLE_CUSTOM_CURSOR,{useTitle:()=>j.intl.string(j.t["+Isihb"]),useSubtitle:()=>j.intl.string(j.t.nNZ1Tz),useValue:()=>(0,m.bG)([f.Ay],()=>f.Ay.enableCustomCursor),setValue:e=>(0,et.ts)(e),usePredicate:()=>(0,ei.t)("EnableCustomCursorSetting")}),es=(0,a.zD)(o.X.ENABLE_SWITCH_ICONS,{useTitle:()=>j.intl.string(j.t["S3z+pV"]),useSubtitle:()=>j.intl.string(j.t["3QuI9+"]),useValue:()=>(0,m.bG)([f.Ay],()=>f.Ay.isSwitchIconsEnabled),setValue:e=>(0,et.Gm)(e),hasIcon:!0});var er=n(554146);let ea=(0,a.zD)(o.X.HIGH_CONTRAST_MODE,{useTitle:()=>j.intl.string(j.t.aZlePv),useSubtitle:()=>j.intl.string(j.t["v2qF8+"]),useValue:()=>(0,m.bG)([f.Ay],()=>f.Ay.isHighContrastModeEnabled),setValue:e=>(0,et.uh)(e?f._1.HIGH:f._1.DEFAULT),getDismissibleBadges:()=>[{badgeType:d.Xi.NEW,dismissibleContent:er.M.ACCESSIBILITY_HIGH_CONTRAST_MODE_NEW_BADGE}]});var eo=n(406360),eu=n(742023);let ed=(0,a.Qx)(o.X.HIGH_DYNAMIC_RANGE,{useTitle:()=>j.intl.string(j.t.nemtgW),useSubtitle:()=>j.intl.string(j.t["O/Gjvn"]),usePersistentBadge:()=>({badgeType:d.Xi.BETA}),useOptions:function(){return g.useMemo(()=>[{name:j.intl.string(j.t.D5Fma9),desc:j.intl.string(j.t.Qj75ck),value:"no-limit"},{name:j.intl.string(j.t.ldcGIH),desc:j.intl.string(j.t["+V/bDk"]),value:"standard"}],[])},usePredicate:function(){return(0,eo.i)("HDRDynamicRangeSetting")},setValue:function(e){(0,et.FU)(e)},useValue:function(){return(0,m.bG)([eu.Ay],()=>eu.Ay.hdrDynamicRange)},useSearchTerms:()=>["HDR",j.intl.string(j.t["O/Gjvn"])]}),ec=(0,a.Hn)(o.X.OFFICIAL_MESSAGE_STYLE,{useTitle:()=>j.intl.string(j.t.nC2XBl),useSubtitle:()=>j.intl.string(j.t.a3IPrX),useOptions:()=>[{id:"default",label:j.intl.string(j.t.ERaS6f),value:"default"},{id:"no_text_color",label:j.intl.string(j.t.JKfipk),value:"no_text_color"},{id:"no_gradient",label:j.intl.string(j.t.O2vBoY),value:"no_gradient"},{id:"hidden",label:j.intl.string(j.t["+loyQl"]),value:"hidden"}],useValue:()=>(0,m.bG)([f.Ay],()=>f.Ay.officialMessageStyle),setValue:e=>(0,et.w_)(e)}),eg=(0,a.Hn)(o.X.ROLE_STYLE,{useTitle:()=>j.intl.string(j.t.uSOPWm),useSubtitle:()=>j.intl.string(j.t.u7fFKS),useOptions:()=>[{id:"username",label:j.intl.string(j.t.eDdMzJ),value:"username"},{id:"dot",label:j.intl.string(j.t.rdmJp0),value:"dot"},{id:"hidden",label:j.intl.string(j.t.Ji2EVJ),value:"hidden"}],useValue:()=>(0,m.bG)([f.Ay],()=>f.Ay.roleStyle),setValue:e=>(0,et.IX)(e)});(0,a.Qx)(o.X.ROLE_STYLE,{useTitle:()=>j.intl.string(j.t.uSOPWm),useSubtitle:()=>j.intl.string(j.t["86hjzQ"]),useOptions:()=>[{name:j.intl.string(j.t.YEOEi6),value:"username"},{name:j.intl.string(j.t.mQaro3),value:"dot"},{name:j.intl.string(j.t.Ji2EVJ),value:"hidden"}],useValue:()=>(0,m.bG)([f.Ay],()=>f.Ay.roleStyle),setValue:e=>(0,et.IX)(e)});let em=(0,a.sN)(o.X.SATURATION,{useTitle:()=>j.intl.string(j.t["5PWWCY"]),useSubtitle:()=>j.intl.string(j.t.xf5S6P),markers:A.hH7.SATURATION_INCREMENTS,onMarkerRender:e=>100*e%2==0?`${100*e}%`:void 0,stickToMarkers:!0,minValue:0,maxValue:1,getInitialValue:()=>f.Ay.saturation,asValueChanges:e=>(0,et.HU)(e)});var eA=n(964486),eh=n(839214),eE=n(502229),eS=n(975571);let ex=(0,eh.D)(()=>({syncEnabled:null,updateTimeout:null})),eT=(0,a.zD)(o.X.SYNC_FORCED_COLORS,{useTitle:()=>j.intl.string(j.t.cguiec),useSubtitle:()=>j.intl.format(j.t.GwEVE2,{learnMoreLink:eS.A.getArticleURL(A.MVz.FORCED_COLORS)}),useValue:()=>{let e=(0,m.bG)([f.Ay],()=>f.Ay.syncForcedColors);return(0,eA.Ay)(()=>{ex.setState({syncEnabled:f.Ay.syncForcedColors})}),ex.useState(e=>e.syncEnabled)??e},setValue:e=>{let{updateTimeout:t}=ex.getState();if(null!=t){clearTimeout(t),ex.setState({syncEnabled:e,updateTimeout:null});return}if(e===f.Ay.syncForcedColors)return void ex.setState({syncEnabled:e});let n=setTimeout(()=>{(0,et.D3)(e),ex.setState({updateTimeout:null})},150);ex.setState({syncEnabled:e,updateTimeout:n})},usePredicate:()=>(0,eE.D)()}),ep=(0,a.zZ)(o.X.COLOR_AND_CONTRAST_CATEGORY,{useTitle:()=>j.intl.string(j.t.JqvyiY),buildLayout:()=>[em,en,ea,el,eT,ed,eg,ec,es,ee]});var ef=n(397438),eI=n(355097);function e_(e){return(0,m.bG)([ef.A],()=>(function(e){switch(e){case eI._A.REDUCED_MOTION:return j.intl.format(j.t["1dT9V4"],{});case eI._A.REDUCED_MOTION_STICKERS:return j.intl.string(j.t["2ExvRu"]);default:return}})(ef.A.getAppliedOverrideReasonKey(e)))}let eN=(0,a.zD)(o.X.ANIMATE_EMOJIS,{useTitle:()=>j.intl.string(j.t.iIaOlc),useSubtitle:()=>e_("animateEmoji"),useValue:()=>v.Sf.useSetting(),setValue:e=>v.Sf.updateSetting(e)}),eC=(0,a.zD)(o.X.ANIMATE_GIFS,{useTitle:()=>j.intl.string(j.t.wqsK7q),useSubtitle:()=>e_("gifAutoPlay"),useValue:()=>v.kt.useSetting(),setValue:e=>v.kt.updateSetting(e)});var eb=n(823894);let ey=(0,a.Qx)(o.X.ANIMATE_STICKERS,{useTitle:()=>j.intl.string(j.t.sBHIh0),useSubtitle:()=>e_("animateStickers"),useOptions:()=>[{name:j.intl.string(j.t["Xp+X2U"]),value:eb.BJ.ALWAYS_ANIMATE},{name:j.intl.string(j.t.IlLT7e),desc:j.intl.string(j.t.bIW9Tl),value:eb.BJ.ANIMATE_ON_INTERACTION},{name:j.intl.string(j.t.IGu8x3),value:eb.BJ.NEVER_ANIMATE}],useValue:()=>v.S0.useSetting(),setValue:e=>v.S0.updateSetting(e)}),ev=(0,a.zD)(o.X.REDUCED_MOTION,{useTitle:()=>j.intl.string(j.t.b3XBzg),useSubtitle:()=>j.intl.format(j.t.XqvxJc,{helpdeskArticle:eS.A.getArticleURL(A.MVz.REDUCED_MOTION)}),useValue:()=>(0,m.bG)([f.Ay],()=>f.Ay.useReducedMotion),setValue:e=>(0,et.qz)(e?"reduce":"no-preference")}),ej=(0,a.zD)(o.X.SYNC_REDUCED_MOTION,{useTitle:()=>j.intl.string(j.t.oL55A6),useValue:()=>(0,m.bG)([f.Ay],()=>"auto"===f.Ay.rawPrefersReducedMotion),setValue:e=>(0,et.qz)(e?"auto":f.Ay.systemPrefersReducedMotion)}),eO=(0,a.zZ)(o.X.MOTION_CATEGORY,{useTitle:()=>j.intl.string(j.t.e3TR1b),buildLayout:()=>[ev,ej,eC,eN,ey]});var eL=n(688810),eD=n(259065),eR=n(864386);let eP=(0,a.zD)(o.X.DISPLAY_NAME_STYLES,{useTitle:()=>j.intl.string(eR.default["2gFUEw"]),useSubtitle:()=>{let{analyticsLocations:e}=(0,eL.Ay)();return j.intl.format(eR.default.aEax6P,{onClickOpenModal(){(0,eD.L)({analyticsLocations:e})}})},useValue:()=>(0,m.bG)([f.Ay],()=>f.Ay.displayNameStylesEnabled),setValue:e=>(0,et.Dm)(e)});function eG(e){return`${e.toFixed(0)}px`}let eM=(0,a.sN)(o.X.APPEARANCE_FONT_SCALING,{useTitle:()=>j.intl.string(j.t.rT3Pq5),useSubtitle:()=>j.intl.string(j.t.LXUhen),markers:A.hH7.FONT_SIZES,stickToMarkers:!0,minValue:A.hH7.FONT_SIZES["0"],maxValue:A.hH7.FONT_SIZES[A.hH7.FONT_SIZES.length-1],useDefaultValue:()=>A.hH7.FONT_SIZE_DEFAULT,getInitialValue:()=>f.Ay.fontSize,onValueRender:eG,onMarkerRender:eG,asValueChanges:e=>(0,et.XS)(e)}),eU=(0,a.zD)(o.X.UNDERLINE_LINKS,{useTitle:()=>j.intl.string(j.t.OLZFB8),useSubtitle:()=>j.intl.string(j.t.DIX3ke),useValue:()=>(0,m.bG)([f.Ay],()=>f.Ay.alwaysShowLinkDecorations),setValue:e=>(0,et.kI)(e)}),eV=(0,a.zZ)(o.X.TEXT_READABILITY_CATEGORY,{useTitle:()=>j.intl.string(j.t["bxh/R7"]),buildLayout:()=>[eM,eU,eP]});var ek=n(873298);let ew=(0,a.Qx)(o.X.APPEARANCE_UI_DENSITY,{useTitle:()=>j.intl.string(j.t["C/5V0A"]),useSubtitle:()=>j.intl.string(j.t.QLZhYk),useSearchTerms:()=>["List Spacing"],useOptions:()=>[{name:j.intl.string(j.t["7iegX4"]),value:ek.NS.COMPACT},{name:j.intl.string(j.t.bBvAEH),value:ek.NS.DEFAULT},{name:j.intl.string(j.t["4cuYHx"]),value:ek.NS.COZY}],useValue:()=>v.Xi.useSetting(),setValue:e=>{e!==ek.NS.UNSET_UI_DENSITY&&v.Xi.updateSetting(e)}}),eF="cozy",eB="compact",ez=(0,a.Qx)(o.X.APPEARANCE_MESSAGE_DISPLAY_MODE,{useTitle:()=>j.intl.string(j.t.nKRoPv),useSubtitle:()=>j.intl.string(j.t.QntEEG),useSearchTerms:()=>[j.intl.string(j.t.ZEoGMd)],useOptions:()=>[{name:j.intl.string(j.t.Jqj4cZ),value:eF},{name:j.intl.string(j.t["1JNcPS"]),value:eB}],useValue:()=>v.hH.useSetting()?eB:eF,setValue:e=>{v.hH.updateSetting(e===eB),(0,et.AC)()}});var eX=n(381941);function eY(e){return`${e.toFixed(0)}px`}let eH=(0,a.sN)(o.X.APPEARANCE_MESSAGE_GROUP_SPACING,{useTitle:()=>j.intl.string(j.t.Q6lKkg),useSubtitle:()=>j.intl.string(j.t.p7eUrb),markers:eX.qh,stickToMarkers:!0,minValue:eX.qh["0"],maxValue:eX.qh[eX.qh.length-1],useDefaultValue:()=>v.hH.useSetting()?eX.y5:eX.ES,useExternalValue:()=>(0,m.bG)([f.Ay],()=>f.Ay.messageGroupSpacing),getInitialValue:()=>f.Ay.messageGroupSpacing,onValueRender:eY,onMarkerRender:eY,asValueChanges:e=>{switch(e){case 0:case 4:case 8:case 16:case 24:(0,et.AC)(e)}}});var eK=n(775121),eW=n(723702);let eZ=(0,a.sN)(o.X.APPEARANCE_ZOOM,{usePredicate:()=>eW.isPlatformEmbedded,useTitle:()=>j.intl.string(j.t.i19n5L),useSubtitle:()=>j.intl.format(j.t["x9PK/3"],{modKey:eK.A.modKey}),markers:A.hH7.ZOOM_SCALES,stickToMarkers:!0,minValue:A.hH7.ZOOM_SCALES["0"],maxValue:A.hH7.ZOOM_SCALES[A.hH7.ZOOM_SCALES.length-1],useDefaultValue:()=>A.hH7.ZOOM_DEFAULT,getInitialValue:()=>f.Ay.zoom,useExternalValue:()=>(0,m.bG)([f.Ay],()=>f.Ay.zoom),onValueRender:function(e){return`${e.toFixed(0)}%`},setValue:e=>(0,et.Qp)(e),useSearchTerms:()=>[j.intl.string(j.t.ip0uSf)]}),eq=(0,a.zZ)(o.X.VISUAL_DENSITY_CATEGORY,{useTitle:()=>j.intl.string(j.t.VKYWk8),buildLayout:()=>[ew,ez,eH,eZ]}),eQ=(0,a.t_)(o.X.ACCESSIBILITY_PANEL,{useTitle:()=>j.intl.string(j.t.G0neg7),buildLayout:()=>[eV,eq,ep,eO,J],decoration:{type:d.t9.STRONGLY_DISCOURAGED_CUSTOM,component:function(){let e=v.hH.useSetting(),t=v.jW.useSetting(),n=g.useMemo(()=>[R(j.intl.formatToPlainString(j.t.BknJRT,{}),t?[{emoji:{id:null,name:"\uD83E\uDD40",animated:!1},me:!0,count:3,me_burst:!1,burst_count:0},{emoji:{id:null,name:"\uD83E\uDEA4",animated:!1},me:!1,count:1,me_burst:!1,burst_count:0}]:[]),R(j.intl.formatToPlainString(j.t["4rDfgM"],{link:"https://discord.com/accessibility"}))],[t]),i=(0,m.bG)([f.Ay],()=>f.Ay.messageGroupSpacing);return(0,c.jsx)(h.M,{children:(0,c.jsxs)("section",{"aria-label":j.intl.string(j.t.RC22qg),children:[(0,c.jsx)(E.D,{variant:"text-md/medium",color:"text-muted",className:O.Vf,children:j.intl.string(j.t.RC22qg)}),(0,c.jsxs)(S.Ip,{className:O.VH,children:[(0,c.jsx)("ol",{className:O.DZ,style:{gap:i},"aria-label":j.intl.string(j.t.xfjsEV),children:n.map(t=>(0,c.jsx)("li",{children:(0,c.jsx)(C.A,{message:t,channel:L,compact:e,author:{...(0,N.p_)(t),colorString:"#dd80f4"}})},t.id))}),(0,c.jsxs)("div",{className:O.Jb,children:[(0,c.jsx)("div",{className:O.HD,children:D.map(e=>{let{status:t,discriminator:n,mobile:i=!1}=e;return(0,c.jsx)(x.eu,{status:t,isMobile:i,size:T._3.SIZE_32,src:y.Ay.getDefaultAvatarURL(void 0,n),"aria-label":j.intl.string(j.t.VKE5TK)},t)})}),(0,c.jsx)(p.$,{text:j.intl.string(j.t["2RHHgz"]),size:"sm",variant:"primary"})]})]})]})})},sticky:!0}}),eJ=(0,a.i4)(o.X.ACCESSIBILITY_SIDEBAR_ITEM,{useTitle:()=>j.intl.string(j.t.G0neg7),icon:u.c,useMenu:P.A,buildLayout:()=>[eQ]});n(321073);var e$=n(650809),e0=n(477782),e1=n(636537),e2=n(228366),e3=n(74396),e5=n(93055),e6=n(269880),e4=n(55619),e8=n(351906),e7=n(174459),e9=n(812993),te=n(189081);let tt=(0,a.zD)(o.X.SHOW_GAME_LIBRARY,{usePredicate:()=>(0,m.bG)([te.A],()=>te.A.hasLibraryApplication()),useTitle:()=>j.intl.string(j.t.fi3UQN),useSubtitle:()=>j.intl.string(j.t["8mYp37"]),useValue:()=>!v.l_.useSetting(),setValue:e=>v.l_.updateSetting(!e)}),tn=(0,a.zZ)(o.X.APPEARANCE_ADVANCED_CATEGORY,{useTitle:()=>j.intl.string(j.t["8/udY0"]),buildLayout:()=>[tt]});var ti=n(284009),tl=n.n(ti),ts=n(199966),tr=n(963935);function ta(e){let{title:t}=e;return t}function to(e){let{useTitle:t,settingKey:n,formatter:i,index:l}=e,s=t();return"string"==typeof s?i({title:s,index:l,key:n}):s}function tu(e){let{setting:t,formatter:n,index:i}=e;return()=>(0,c.jsx)(to,{useTitle:t.useTitle,settingKey:t.key,formatter:n,index:i},t.key)}function td(e){return e.type===tr.Z6.LIST}function tc(e,t){let{limit:n=2,formatter:i=ta}=t??{};tl()(n>0,"[useSettingCollapsibleSubtitle] Limit must be greater than 0");let{visibleDirectory:l,accessibleDirectory:s}=(0,ts._)(),r=l.get(e)??s.get(e);tl()(null!=r&&(r.type===tr.Z6.ACCORDION||td(r)),"[useSettingCollapsibleSubtitle] Node is not a collapsible settings node");let a=td(r)?r.collapseAfter??0:0,o=r.layout;return g.useMemo(()=>{let e=a,t=[];for(let n of o)if("useTitle"in n&&null!=n.useTitle){if(e>0){e--;continue}t.push({key:n.key,useTitle:n.useTitle})}if(0===t.length)return"";let l=Math.min(n,3);if(t.length<=l)if(1===t.length)return j.intl.format(j.t["3H9tCW"],{settingOneHook:tu({setting:t[0],formatter:i,index:0})});else if(2===t.length)return j.intl.format(j.t.MWryo6,{settingOneHook:tu({setting:t[0],formatter:i,index:0}),settingTwoHook:tu({setting:t[1],formatter:i,index:1})});else return j.intl.format(j.t.a00b5G,{settingOneHook:tu({setting:t[0],formatter:i,index:0}),settingTwoHook:tu({setting:t[1],formatter:i,index:1}),settingThreeHook:tu({setting:t[2],formatter:i,index:2})});return 1===l?j.intl.format(j.t.O8vNbS,{settingOneHook:tu({setting:t[0],formatter:i,index:0})}):2===l?j.intl.format(j.t["acXG/W"],{settingOneHook:tu({setting:t[0],formatter:i,index:0}),settingTwoHook:tu({setting:t[1],formatter:i,index:1})}):j.intl.format(j.t["5+ldWc"],{settingOneHook:tu({setting:t[0],formatter:i,index:0}),settingTwoHook:tu({setting:t[1],formatter:i,index:1}),settingThreeHook:tu({setting:t[2],formatter:i,index:2})})},[n,a,o,i])}var tg=n(951260);let tm=(0,a.zD)(o.X.ENABLE_APPS_BUTTON,{useTitle:()=>j.intl.string(j.t.ZTH4j4),useValue:()=>(0,m.bG)([f.Ay],()=>f.Ay.isAppsButtonEnabled),setValue:e=>(0,et.n8)({appsButtonEnabled:e})}),tA={useTitle:()=>j.intl.string(j.t["I/5LyL"]),useValue:()=>(0,m.bG)([f.Ay],()=>f.Ay.isSubmitButtonEnabled),setValue:()=>(0,et.Xt)()},th=(0,a.zD)(o.X.ENABLE_SEND_BUTTON,tA),tE=(0,a.zD)(o.X.ENABLE_SEND_BUTTON_OUTSIDE_EXPERIMENT,{...tA,usePredicate:()=>!(0,tg.n)("EnableSendButtonOutsideExperiment")}),tS=(0,a.zD)(o.X.CONDENSE_PICKER_WHEN_NARROW,{useTitle:()=>j.intl.string(j.t.WggFoO),useSubtitle:()=>j.intl.string(j.t.XpErGj),useValue:()=>(0,m.bG)([f.Ay],()=>f.Ay.condensePickerWhenNarrow),setValue:e=>(0,et.n8)({condensePickerWhenNarrow:e}),usePredicate:()=>(0,m.bG)([f.Ay],()=>f.Ay.expressionPickerFormat===f.IG.FLEXIBLE)}),tx=(0,a.zD)(o.X.ENABLE_EMOJI_BUTTON,{useTitle:()=>j.intl.string(j.t.YErWkD),useValue:()=>(0,m.bG)([f.Ay],()=>f.Ay.isEmojiButtonEnabled),setValue:e=>(0,et.n8)({emojiButtonEnabled:e}),usePredicate:()=>(0,m.bG)([f.Ay],()=>f.Ay.expressionPickerFormat===f.IG.FLEXIBLE)}),tT=(0,a.zD)(o.X.ENABLE_GIF_BUTTON,{useTitle:()=>j.intl.string(j.t.k7oNEz),useValue:()=>(0,m.bG)([f.Ay],()=>f.Ay.isGifButtonEnabled),setValue:e=>(0,et.n8)({gifButtonEnabled:e}),usePredicate:()=>(0,m.bG)([f.Ay],()=>f.Ay.expressionPickerFormat===f.IG.FLEXIBLE)}),tp=(0,a.zD)(o.X.ENABLE_STICKER_BUTTON,{useTitle:()=>j.intl.string(j.t.Ar0krj),useValue:()=>(0,m.bG)([f.Ay],()=>f.Ay.isStickerButtonEnabled),setValue:e=>(0,et.n8)({stickerButtonEnabled:e}),usePredicate:()=>(0,m.bG)([f.Ay],()=>f.Ay.expressionPickerFormat===f.IG.FLEXIBLE)}),tf=(0,a.Qx)(o.X.EXPRESSION_PICKER_FORMAT,{useTitle:()=>j.intl.string(j.t.AxRAWt),useValue:()=>(0,m.bG)([f.Ay],()=>f.Ay.expressionPickerFormat),setValue:e=>(0,et.n8)({expressionPickerFormat:e}),useOptions:function(){return[{name:j.intl.string(j.t.k86Soy),desc:j.intl.string(j.t.bSGTTZ),value:f.IG.FLEXIBLE},{name:j.intl.string(j.t.bjwSOn),desc:j.intl.string(j.t.We36HX),value:f.IG.CONDENSED},{name:j.intl.string(j.t.FDIKss),desc:j.intl.string(j.t["rclZL/"]),value:f.IG.HIDDEN}]}}),tI=(0,a.FW)(o.X.EXPRESSION_PICKER_FIELD_SET,{variant:"compact",isTitleHiddenVisually:!0,useTitle:()=>j.intl.string(j.t["V9/cNN"]),buildLayout:()=>[tf,tS,tx,tT,tp]}),t_=(0,a.bd)(o.X.CHAT_BAR_ADVANCED_ACCORDION,{useTitle:function(e){return e?j.intl.string(j.t.IwVGQs):j.intl.string(j.t.cFNDh5)},useCollapsedSubtitle:()=>tc(o.X.CHAT_BAR_ADVANCED_ACCORDION),usePredicate:()=>(0,tg.n)("ChatBarAdvancedAccordion"),buildLayout:()=>[th,tm,tI]});var tN=n(565645);let tC=(0,a.zD)(o.X.CHAT_EMOJI_CONVERT_EMOTICONS,{useTitle:()=>j.intl.string(j.t["79qal8"]),useSubtitle:()=>j.intl.format(j.t.GejoQK,{emojiHook:(e,t)=>(0,c.jsx)(tN.A,{emojiName:"\uD83D\uDE42"},t)}),useValue:v.j7.useSetting,setValue:v.j7.updateSetting}),tb=(0,a.zD)(o.X.CHAT_GAME_MENTIONS_AUTOCOMPLETE,{useTitle:()=>j.intl.string(j.t.c0oFDw),useValue:v.BQ.useSetting,setValue:v.BQ.updateSetting}),ty=(0,a.zD)(o.X.CHAT_TEXT_BOX_PREVIEWS,{useTitle:()=>j.intl.string(j.t.AqGrEI),useValue:v.SI.useSetting,setValue:e=>{e7.default.track(A.HAw.PREVIEW_MARKDOWN_TOGGLED,{enabled:e,location:{section:A.JJy.SETTINGS_TEXT_AND_IMAGES}}),v.SI.updateSetting(e)}});var tv=n(793574);let tj=(0,a.zD)(o.X.CHAT_STICKERS_AUTOCOMPLETE,{useTitle:()=>j.intl.string(j.t["d+It2U"]),useValue:v.ML.useSetting,setValue:e=>{e7.default.track(A.HAw.STICKERS_IN_AUTOCOMPLETE_TOGGLED,{enabled:e,location:{section:A.JJy.SETTINGS_TEXT_AND_IMAGES},location_stack:[tv.A.TEXT_AND_IMAGES]}),v.ML.updateSetting(e)}}),tO=(0,a.zZ)(o.X.APPEARANCE_CHAT_BOX_CATEGORY,{useTitle:()=>j.intl.string(j.t.Ob7VMB),useSearchTerms:()=>[j.intl.string(j.t.onqU6o)],buildLayout:()=>[ty,tC,tj,tb,tE,t_]});var tL=n(526162),tD=n(793943),tR=n(792656),tP=n(830543),tG=n(785007),tM=n(806932),tU=n(915089),tV=n(174197),tk=n(202541);let tw=(0,a.E2)(o.X.APPEARANCE_IN_APP_ICON,{useSearchTerms:()=>[j.intl.string(j.t.gnwxvT)],Component:function(){let e=(0,tU.GV)(),{ref:t,...n}=(0,tG._u)({orientation:"horizontal",labelledBy:e}),i=(0,m.bG)([tL.A],()=>tL.A.isUpsellPreview);return(0,w.Ay)(()=>{i&&e7.default.track(A.HAw.PREMIUM_UPSELL_VIEWED,{type:tk.e.APP_ICON_UPSELL,location_stack:[tv.A.USER_SETTINGS]})}),(0,c.jsx)("div",{...n,ref:t,children:(0,c.jsx)(F.B,{direction:"horizontal",wrap:!0,gap:8,children:(0,c.jsx)(tM.m,{disabled:i,size:tV.N8.SIZE_48})})})}});function tF(){(0,tD.nf)(tD.HP.APP_ICON),(0,tP.default)()}function tB(){return(0,c.jsx)(tR.A,{subscriptionTier:tk.pe.TIER_2,defaultTextOverride:j.intl.string(j.t.mr4K7D),premiumModalAnalyticsLocation:{object:A.ZSU.BUTTON_CTA,objectType:A.AnalyticsObjectTypes.BUY},fullWidth:!0})}let tz=(0,a.zZ)(o.X.APPEARANCE_IN_APP_ICON_CATEGORY,{useTitle:()=>j.intl.string(j.t.RPh2ou),useSubtitle:()=>j.intl.string(j.t.IgENJo),useHeaderDecoration:function(){let e=(0,m.bG)([tL.A],()=>tL.A.isUpsellPreview);return g.useMemo(()=>{let t=[];return t.push({id:"preview-icon-button",type:d.UV.BUTTON,text:j.intl.string(j.t["6acvnZ"]),onClick:tF}),e&&t.push({id:"upsell-button",type:d.UV.STRONGLY_DISCOURAGED_CUSTOM,button:tB}),{type:d.WX.BUTTON_GROUP,buttons:t}},[e])},buildLayout:()=>[tw]}),tX=(0,a.AK)(o.X.APPEARANCE_CHAT_ACCESSIBLITY_NAVIGATOR,{useSubtitle:()=>j.intl.string(j.t.UDr3Iy),useSearchTerms:()=>[j.intl.string(j.t.UDr3Iy)],destinationKey:o.X.ACCESSIBILITY_PANEL}),tY=(0,a.gN)(o.X.APPEARANCE_CHAT_RELATED_SETTINGS,{buildLayout:()=>[tX]});var tH=n(452027),tK=n(243721),tW=n(976860),tZ=n(16236),tq=n(635233),tQ=n(749884),tJ=n(449817);let t$=eS.A.getArticleURL(A.MVz.FAVORITES_GUILD);function t0(){let{analyticsLocations:e}=(0,eL.Ay)(tv.A.USER_SETTINGS_FAVORITES),t=g.useCallback(()=>{(0,tq.mv)("settings_page"),(0,tW.uh)(A.YYv),(0,tP.default)()},[]);return(0,c.jsx)(eL.f5,{value:e,children:(0,c.jsx)(tH.D,{label:j.intl.string(tJ.default.OT1NK5),description:j.intl.format(tJ.default.GR2KOG,{helpCenterLink:t$}),layout:"horizontal-responsive",badge:"beta",children:(0,c.jsxs)(F.B,{direction:"horizontal",gap:8,fullWidth:!1,children:[(0,c.jsx)(p.$,{variant:"secondary",text:j.intl.string(tJ.default["7WwLnr"]),onClick:t}),(0,c.jsx)(tR.A,{subscriptionTier:tk.pe.TIER_2,defaultTextOverride:j.intl.string(tJ.default["20sYUU"])})]})})})}let t1=(0,a.E2)(o.X.CHAT_FAVORITES_TOGGLE,{usePredicate:()=>(0,e5.TW)("FavoritesGuildToggle").isExperimentEnabled,useSearchTerms:()=>[j.intl.string(tJ.default.OT1NK5)],Component:function(){let{hasAccess:e}=(0,e5.TW)("FavoritesGuildVisibilitySetting"),t=(0,tQ.A)(!1);return e?(0,c.jsx)(tK.d,{checked:t,description:j.intl.format(tJ.default.GR2KOG,{helpCenterLink:t$}),onChange:tZ.kG,label:j.intl.string(tJ.default.OT1NK5),badge:"beta"}):(0,c.jsx)(t0,{})}}),t2=(0,a.zD)(o.X.CHAT_INLINE_MEDIA_LINKS,{useTitle:()=>j.intl.string(j.t.U47N1p),useValue:v.hD.useSetting,setValue:v.hD.updateSetting}),t3=(0,a.zD)(o.X.CHAT_INLINE_MEDIA_UPLOADS,{useTitle:()=>j.intl.string(j.t.VP11No),useValue:v.X6.useSetting,setValue:v.X6.updateSetting}),t5=(0,a.FW)(o.X.CHAT_INLINE_FIELD_SET,{useTitle:()=>j.intl.string(j.t["9nyle0"]),buildLayout:()=>[t2,t3]}),t6=(0,a.zD)(o.X.CHAT_EMBEDS_RENDER_EMBEDS,{useTitle:()=>j.intl.string(j.t["5bK9vw"]),useValue:v.rs.useSetting,setValue:v.rs.updateSetting}),t4=(0,a.zD)(o.X.CHAT_EMOJI_RENDER_REACTIONS,{useTitle:()=>j.intl.string(j.t["zge/fP"]),useValue:v.jW.useSetting,setValue:v.jW.updateSetting});var t8=n(939249),t7=n(817281),t9=n(766075);let ne=(0,a.zD)(o.X.APPEARANCE_DISPLAY_COMPACT_AVATARS,{useTitle:()=>j.intl.string(j.t.JgjNG3),useSubtitle:()=>{if(!v.hH.useSetting())return j.intl.format(j.t["31PRaj"],{a11yHook:(e,t)=>(0,c.jsx)(t8.D,{tag:"a",onClick:()=>(0,t9.openUserSettings)(o.X.APPEARANCE_MESSAGE_DISPLAY_MODE),children:e},t)})},useDisabled:()=>!v.hH.useSetting(),useValue:()=>{let e=(0,m.bG)([eu.Ay],()=>eu.Ay.displayCompactAvatars);return!v.hH.useSetting()||e},setValue:e=>{t7.Ay.updatedUnsyncedSettings({displayCompactAvatars:e})}}),nt=(0,a.Hn)(o.X.CHAT_SPOILERS_SHOW_SPOILERS,{useTitle:()=>j.intl.string(j.t.QgwmVz),useOptions:()=>[{value:A.P6Q.ON_CLICK,id:A.P6Q.ON_CLICK,label:j.intl.string(j.t["KFH/me"])},{value:A.P6Q.ALWAYS,id:A.P6Q.ALWAYS,label:j.intl.string(j.t.Pe1RbL)},{value:A.P6Q.IF_MODERATOR,id:A.P6Q.IF_MODERATOR,label:j.intl.string(j.t.K5VTBE)}],useValue:v.gs.useSetting,setValue:v.gs.updateSetting}),nn=(0,a.zD)(o.X.CHAT_THREADS_SPLIT_VIEW,{useTitle:()=>j.intl.string(j.t.AInv5m),useValue:v.SY.useSetting,setValue:v.SY.updateSetting}),ni=(0,a.zZ)(o.X.APPEARANCE_MESSAGES_CATEGORY,{useTitle:()=>j.intl.string(j.t.OIgYlQ),useSearchTerms:()=>[j.intl.string(j.t["/VQax8"])],buildLayout:()=>[t5,t6,t4,nt,nn,ne,t1,tY]});var nl=n(753806),ns=n(145331);let nr=(0,a.Qx)(o.X.MESSAGE_SEARCH_DEFAULT_DM_SEARCH_BEHAVIOR,{useTitle:()=>j.intl.string(j.t.VkoLsy),useSearchTerms:()=>[j.intl.string(j.t["t4+fbe"])],useOptions:function(){return[{name:j.intl.string(j.t.E9JM4J),value:0},{name:j.intl.string(j.t["Kr+lPi"]),value:1}]},useValue:()=>+!!v.Hu.useSetting(),setValue:e=>{let t=1===e;t?nl.A.cleanUpPrivateChannelSearchState():nl.A.cleanUpSearchState({type:A.I4_.DMS}),(0,ns._k)({prevIsCrossDMSettingEnabled:v.Hu.getSetting(),isCrossDMSettingEnabled:t,location:ns.vy.USER_SETTINGS}),v.Hu.updateSetting(t)}}),na=(0,a.zZ)(o.X.APPEARANCE_SEARCH_CATEGORY,{useTitle:()=>j.intl.string(j.t["5h0QOP"]),buildLayout:()=>[nr]});var no=n(574381);let nu=(0,a.zD)(o.X.STREAMING_AUTO_STREAMER_MODE,{useTitle:()=>j.intl.string(j.t.IxjaoF),useValue:function(){return(0,m.bG)([e8.A],()=>{let{autoToggle:e}=e8.A.getSettings();return e})},setValue:function(e){e4.A.update({autoToggle:e})},usePredicate:function(){return no.Av}}),nd=(0,a.zD)(o.X.STREAMING_STREAMER_MODE,{useTitle:()=>j.intl.string(j.t.TGNg6T),useSubtitle:()=>j.intl.string(j.t["4nXLnE"]),useValue:function(){return(0,m.bG)([e8.A],()=>{let{enabled:e}=e8.A.getSettings();return e})},setValue:function(e){e4.A.update({enabled:e})}});var nc=n(77729),ng=n(589051),nm=n(588857),nA=n(999834);let nh=[],nE=(0,a.Hn)(o.X.STREAMER_MODE_HIDE_OVERLAY_WIDGETS,{selectionMode:"multiple",useTitle:()=>j.intl.string(j.t.VCDSLW),useSearchTerms:()=>[j.intl.string(j.t.VCDSLW)],usePredicate:()=>{let e=(0,nA.b_)(),t=(0,ng.Mn)("StreamerModeSettings");return e&&t},useOptions:function(){return g.useMemo(()=>{let e=[];for(let[t,n]of Object.entries(nm.A))null!=n.streamerModeLabel&&(null==n.predicate||n.predicate())&&e.push({id:t,value:t,label:n.streamerModeLabel()});return e},[])},useValue:function(){return(0,m.bG)([e8.A],()=>e8.A.getSettings().disabledOverlayWidgets??nh)},setValue:e=>e4.A.update({disabledOverlayWidgets:e}),closeOnSelect:!1,wrapTags:!0}),nS=(0,a.zD)(o.X.STREAMER_MODE_HIDE_PERSONAL_INFORMATION,{useTitle:()=>j.intl.string(j.t.LSBUGR),useValue:()=>(0,m.bG)([e8.A],()=>{let{hidePersonalInformation:e}=e8.A.getSettings();return e}),setValue:e=>e4.A.update({hidePersonalInformation:e})}),nx=(0,a.zD)(o.X.STREAMER_MODE_HIDE_INVITE_LINKS,{useTitle:()=>j.intl.string(j.t.uWBOri),useValue:()=>(0,m.bG)([e8.A],()=>{let{hideInstantInvites:e}=e8.A.getSettings();return e}),setValue:e=>e4.A.update({hideInstantInvites:e})}),nT=(0,a.zD)(o.X.STREAMER_MODE_DISABLE_SOUNDS,{useTitle:()=>j.intl.string(j.t.OrqYDP),useValue:()=>(0,m.bG)([e8.A],()=>{let{disableSounds:e}=e8.A.getSettings();return e}),setValue:e=>e4.A.update({disableSounds:e})}),np=(0,a.zD)(o.X.STREAMER_MODE_DISABLE_NOTIFICATIONS,{useTitle:()=>j.intl.string(j.t.sUAbLd),useValue:()=>(0,m.bG)([e8.A],()=>{let{disableNotifications:e}=e8.A.getSettings();return e}),setValue:e=>e4.A.update({disableNotifications:e})}),nf=(0,a.zD)(o.X.STREAMER_MODE_HIDE_DISCORD_WINDOW_FROM_SCREEN_CAPTURE,{useTitle:()=>j.intl.string(j.t["iA81+a"]),useSubtitle:()=>j.intl.string(j.t.P4vj0h),useValue:()=>(0,m.bG)([e8.A],()=>{let{enableContentProtection:e}=e8.A.getSettings();return e}),setValue:e=>e4.A.update({enableContentProtection:e}),usePredicate:()=>nc.A?.window?.supportsContentProtection?.()??!1}),nI=(0,a.FW)(o.X.STREAMER_MODE_OPTIONS_LIST,{variant:"compact",useTitle:()=>j.intl.string(j.t.xYhOEh),buildLayout:()=>[nS,nx,nT,np,nf,nE]}),n_=(0,a.zZ)(o.X.STREAMER_MODE_CATEGORY,{useTitle:()=>j.intl.string(j.t.S5GfOW),buildLayout:()=>[nd,nu,nI]});var nN=n(147248),nC=n(141343),nb=n(665267),ny=n(414133),nv=n(412848);let nj=(0,a.Hn)(o.X.APPEARANCE_GUILD_THEME_DEFAULT_PREFERENCE,{useTitle:()=>j.intl.string(j.t.Q7mm4g),useSearchTerms:()=>[j.intl.string(nv.default["/6NbRv"])],useOptions:()=>[{id:"guild",label:j.intl.string(j.t["hrS/Pc"]),value:ek.tI.GUILD},{id:"personal",label:j.intl.string(j.t.mlvXIq),value:ek.tI.PERSONAL}],useValue:()=>v.zY.useSetting(),setValue:v.zY.updateSetting,usePredicate:()=>(0,ny.OS)("GuildThemeDefaultPreferenceSetting")}),nO=(0,a.zD)(o.X.SYNC_PROFILE_THEMES,{useTitle:()=>j.intl.string(j.t.C00w4l),useValue:()=>(0,m.bG)([f.Ay],()=>f.Ay.syncProfileThemeWithUserTheme),setValue:()=>(0,et.M1)()});var nL=n(458024),nD=n(284016),nR=n(363195);let nP=(0,a.zD)(o.X.APPEARANCE_SYNC_THEME,{useTitle:()=>j.intl.string(j.t["/B+kEV"]),useSearchTerms:()=>[j.intl.string(j.t.Ksh3ik)],useValue:function(){return(0,m.bG)([nD.A],()=>!1!==nD.A.shouldSync("appearance"))},useDisabled:function(){let e=(0,nL.Ay)("SyncThemeSetting"),t=(0,m.bG)([nR.A],()=>nR.A.isSameAsDeviceThemeEnabled());return e&&t},setValue:function(e){var t;let n=nR.A.theme,i=nN.A.gradientPreset?.id??null,l=v.eh.getSetting()?.customUserThemeSettings!=null;t=A.HAw.SYNC_ACROSS_CLIENTS_TOGGLED,e2.h.dispatch({type:"TRACK",event:t,properties:{is_sync_enabled:e,base_theme:n,client_theme:i,has_custom_theme:l}}),t7.Ay.setShouldSyncAppearanceSettings(e)}});var nG=n(393284);let nM=(0,a.AK)(o.X.APPEARANCE_THEME_ACCESSIBLITY_NAVIGATOR,{useSubtitle:()=>j.intl.string(j.t.nhVQDJ),useSearchTerms:()=>[j.intl.string(j.t.nhVQDJ)],destinationKey:o.X.ACCESSIBILITY_PANEL}),nU=(0,a.gN)(o.X.APPEARANCE_THEME_RELATED_SETTINGS,{buildLayout:()=>[nM]}),nV=(0,a.zZ)(o.X.APPEARANCE_THEME_CATEGORY,{useTitle:()=>j.intl.string(j.t.Ksh3ik),useInlineNotice:function(){return(0,m.bG)([f.Ay],()=>f.Ay.useForcedColors)?{type:d.lT.INLINE_NOTICE,noticeType:"info",text:(0,eE.D)()?j.intl.format(j.t.Jae48E,{onClick:()=>{(0,t9.openUserSettings)(o.X.SYNC_FORCED_COLORS)}}):j.intl.string(j.t.AUMSZP)}:null},useHeaderDecoration:function(){let e=(0,m.bG)([nN.A,f.Ay],()=>f.Ay.useForcedColors||nN.A.isPreview),t=(0,nC.V)();return e||t?null:{type:d.WX.BUTTON_GROUP,buttons:[{id:"open-client-themes-button",type:d.UV.BUTTON,text:j.intl.string(j.t["E+COuA"]),onClick:nb.J3}]}},buildLayout:()=>[nG.k,nP,nO,nj,nU]}),nk=(0,a.t_)(o.X.APPEARANCE_PANEL,{initialize:function(){e3.A.isFetching()||(e2.h.dispatch({type:"SAVED_CUSTOM_THEMES_FETCH_START"}),e1.Bo.get({url:A.Rsh.USERS_ME_CUSTOM_THEMES,oldFormErrors:!0,rejectWithError:!0}).then(e=>{e2.h.dispatch({type:"SAVED_CUSTOM_THEMES_FETCH_SUCCESS",themes:e.body?.custom_themes??[]})}).catch(e=>{e2.h.dispatch({type:"SAVED_CUSTOM_THEMES_FETCH_FAILURE",error:e})}))},useTitle:()=>j.intl.string(j.t["iHH+ky"]),buildLayout:()=>[nV,tz,ni,tO,na,n_,tn]}),nw=[{badgeType:d.Xi.NEW,dismissibleContent:er.M.CLIENT_THEMES_APPEARANCE_SETTINGS_NEW_BADGE},{badgeType:d.Xi.STRONGLY_DISCOURAGED_CUSTOM,dismissibleContent:er.M.FAVORITES_GUILD_NEW_BADGE,StronglyDiscouragedCustomComponent:function(){return(0,c.jsx)(e9.JI,{text:j.intl.string(j.t.y2b7CA)})}}],nF=(0,a.i4)(o.X.APPEARANCE_SIDEBAR_ITEM,{useTitle:()=>j.intl.string(j.t["iHH+ky"]),icon:e$.B,useMenu:function(){let e,t,n,i=(0,e6.A)(),l=(e=v.D_.useSetting(),t=v.SI.useSetting(),e?null:(0,c.jsx)(e0.sL,{id:"preview-markdown-toggle",label:j.intl.string(j.t.sHJ9wZ),action:()=>{let e=!t;e7.default.track(A.HAw.PREVIEW_MARKDOWN_TOGGLED,{enabled:e,location:{section:A.JJy.SETTINGS_CONTEXT_MENU}}),v.SI.updateSetting(e)},checked:t})),s=(n=(0,m.bG)([e8.A],()=>e8.A.enabled,[]),(0,c.jsx)(e0.sL,{id:"streamer-mode-toggle",label:j.intl.string(j.t.p9ZAJZ),action:()=>{e4.A.setEnabled(!n)},checked:n}));return g.useMemo(()=>{let e=[...i];return null!=l&&e.push((0,c.jsx)(e0.rX,{label:j.intl.string(j.t.Ob7VMB),children:l},"text-and-images")),null!=s&&e.push((0,c.jsx)(e0.rX,{children:s},"streamer-mode")),e},[i,l,s])},getDismissibleBadges:()=>(0,e5.ad)().isFreemium?nw.filter(e=>{let{dismissibleContent:t}=e;return t!==er.M.FAVORITES_GUILD_NEW_BADGE}):nw,buildLayout:()=>[nk]});var nB=n(37646),nz=n(434404);let nX=(0,a.t_)(o.X.LANGUAGE_AND_TIME_PANEL,{useTitle:()=>j.intl.string(j.t.KyFVyi),buildLayout:()=>[nz.F]}),nY=(0,a.i4)(o.X.LANGUAGE_AND_TIME_SIDEBAR_ITEM,{icon:nB.U,useTitle:()=>j.intl.string(j.t.KyFVyi),buildLayout:()=>[nX]});var nH=n(3137),nK=n(661531),nW=n(314116),nZ=n(270003),nq=n(369606),nQ=n(320448),nJ=n(604121),n$=n(725951),n0=n(400492),n1=n(669067),n2=n(115063),n3=n(754692),n5=n(927018),n6=n(512599),n4=n(532197),n8=n(403362),n7=n(874486),n9=n(503698),ie=n.n(n9),it=n(989349),ii=n.n(it),il=n(58703),is=n(906688),ir=n(892208);function ia(e){let{achievementId:t,dateUnlocked:n}=e,i=(0,n5.vM)(t);if(null==i)return null;let l=null!=n,{name:s,description:r,hideDescriptionUntilUnlock:a,onAction:o}=i,u=a&&!l,d=l?"text-strong":"text-muted",g=l?"text-default":"text-muted",m=ii()(n),A=null!=o&&l,h=A?t8.D:"div";return(0,c.jsxs)(h,{className:ie()(ir.kL,A&&ir.b),onClick:function(){A&&o()},children:[(0,c.jsx)("div",{className:ir.zc,children:(0,c.jsx)(is.A,{achievementId:t,size:is.A.Sizes.SIZE_40,unlocked:l})}),(0,c.jsxs)("div",{className:ir.VW,children:[null!=n&&(0,c.jsx)(z.E,{variant:"text-xxs/semibold",color:"text-muted",className:ir.YR,children:(0,il.mk)(m)}),(0,c.jsx)(z.E,{variant:"text-md/medium",color:d,children:s()}),(0,c.jsx)(z.E,{variant:"text-xs/normal",color:g,children:u?"?????":r()})]})]})}var io=n(776351);function iu(e){let{onBackClick:t}=e,n=(0,m.bG)([n7.A],()=>n7.A.getAllUnlockedAchievements()),i=g.useMemo(()=>Object.values(n).sort((e,t)=>t.dateUnlocked-e.dateUnlocked),[n]),l=g.useMemo(()=>Object.values(n5.l0).filter(n8.Vq).filter(e=>null==n[e.id]).sort((e,t)=>e.rarity-t.rarity),[n]);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(t8.D,{onClick:t,className:io.vv,children:[(0,c.jsx)(n4.A,{direction:n4.A.Directions.LEFT,className:io.Kk}),(0,c.jsx)(z.E,{variant:"text-lg/normal",color:"text-default",children:j.intl.string(j.t["13/7kX"])})]}),(0,c.jsxs)("div",{className:io.N1,children:[(0,c.jsxs)("div",{className:io.if,children:[(0,c.jsx)(E.D,{variant:"heading-lg/extrabold",color:"text-strong",children:j.intl.string(j.t["6jI0hd"])}),(0,c.jsx)(z.E,{variant:"text-md/normal",color:"text-default",children:j.intl.string(j.t.GuUItX)})]}),(0,c.jsx)("div",{className:io.nr,children:(0,c.jsx)(nq.O,{size:"custom",color:nK.A.unsafe_rawColors.ORANGE_345.css,width:40,height:40})})]}),i.length>0&&(0,c.jsx)("div",{className:io.yF,children:(0,c.jsx)("div",{className:io.Eh,children:i.map(e=>{let{achievementId:t,dateUnlocked:n}=e;return(0,c.jsx)(ia,{achievementId:t,dateUnlocked:n},t)})})}),l.length>0&&(0,c.jsxs)("div",{className:io.yF,children:[(0,c.jsx)("div",{className:io.if,children:(0,c.jsx)(z.E,{variant:"text-md/bold",color:"text-default",children:j.intl.string(j.t.GFyMg1)})}),(0,c.jsx)("div",{className:io.Eh,children:l.map(e=>(0,c.jsx)(ia,{achievementId:e.id},e.id))})]}),(0,c.jsx)("div",{className:io.yF,children:(0,c.jsx)("div",{className:io.F3})})]})}var id=n(224964),ic=n(31408),ig=n(381579);let im={enabled:!0,combosEnabled:!0,screenshakeEnabled:!1,confettiEnabled:!1},iA=(0,V.range)(0,11),ih=(0,V.range)(0,2.25,.25),iE=(0,V.range)(1,11),iS=(0,V.range)(1,26),ix={0:"poggermode_settings_panel",1:"poggermode_achievements_panel"};function iT(e){let{disabled:t,locations:n,settingsLocations:i,onChange:l}=e,s=n.map(e=>(0,c.jsx)(tK.d,{label:e.title,description:e.description,checked:i[e.location],disabled:t,onChange:t=>l({...i,[e.location]:t})},e.location));return(0,c.jsx)(nZ.n,{label:j.intl.string(j.t.bWVN1D),children:s})}function ip(e){let{children:t}=e;return(0,c.jsx)(z.E,{className:ig.iF,variant:"text-sm/normal",color:"text-default",children:t})}function iI(e){let{settings:{enabled:t,warningSeen:n},updateSettings:i}=e,l=(0,m.bG)([f.Ay],()=>f.Ay.useReducedMotion);return(0,c.jsx)(tK.d,{label:j.intl.string(j.t.vuiXm9),description:j.intl.string(j.t.KuYbWN),checked:t,onChange:function(e){e||(0,n3._)(n5.sn.DISABLE_POGGERMODE),e&&(!n||l)?(0,nW.A)({title:l?j.intl.string(j.t["FxT+p0"]):j.intl.string(j.t.TAZ4F9),subtitle:l?j.intl.string(j.t.gmixrx):j.intl.string(j.t.jN3t3K),confirmText:j.intl.string(j.t.JFfins),onConfirm:()=>i(l?im:{enabled:!0,warningSeen:!0})}):i({enabled:e})}})}function i_(e){let{settings:{enabled:t,confettiEnabled:n,confettiCount:i,confettiSize:l,confettiEnabledLocations:s},updateSettings:r}=e,a=!t||!n;return(0,c.jsxs)(nZ.n,{label:j.intl.string(j.t.mqxwJO),children:[(0,c.jsx)(tK.d,{label:j.intl.string(j.t.s0KCgF),description:j.intl.string(j.t.O1Vflg),checked:n,disabled:!t,onChange:e=>r({confettiEnabled:e},0)}),(0,c.jsxs)("div",{children:[(0,c.jsx)(z.E,{variant:"text-md/semibold",color:a?"text-muted":"text-strong",className:ig.KF,children:j.intl.string(j.t.vd0D81)}),(0,c.jsx)(ip,{children:j.intl.string(j.t.a18Sug)}),(0,c.jsx)(B.A,{disabled:a,markers:iE,stickToMarkers:!0,minValue:iE[0],maxValue:iE[iE.length-1],initialValue:i,onValueChange:e=>r({confettiCount:e},0),onValueRender:e=>`${e}`})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(z.E,{variant:"text-md/semibold",color:a?"text-muted":"text-strong",className:ig.KF,children:j.intl.string(j.t.sPO3ij)}),(0,c.jsx)(ip,{children:j.intl.string(j.t.xoldVn)}),(0,c.jsx)(B.A,{disabled:a,markers:iS,stickToMarkers:!0,minValue:iS[0],maxValue:iS[iS.length-1],initialValue:l,onValueChange:e=>r({confettiSize:e},0),onValueRender:e=>`${e}`})]}),(0,c.jsx)(iT,{disabled:a,locations:[{location:ic.k.CHAT_INPUT,title:j.intl.string(j.t.elTtyz),description:j.intl.string(j.t.HtKfMi)},{location:ic.k.REACTION,title:j.intl.string(j.t.Ik4VIa),description:j.intl.string(j.t.y4rqK0)},{location:ic.k.MEMBER_USER,title:j.intl.string(j.t.ZXBlAn),description:j.intl.string(j.t["m9RD+c"])},{location:ic.k.CALL_TILE,title:j.intl.string(j.t.V66giQ),description:j.intl.string(j.t.fiHV7u)}],settingsLocations:s,onChange:e=>r({confettiEnabledLocations:e},0)})]})}function iN(e){let{settings:{enabled:t,combosEnabled:n,comboSoundsEnabled:i,combosRequiredCount:l},updateSettings:s}=e,r=!t||!n;return(0,c.jsxs)(nZ.n,{label:j.intl.string(j.t.Xz0ole),children:[(0,c.jsx)(tK.d,{label:j.intl.string(j.t.o3iV7B),description:j.intl.string(j.t["31Z8Ee"]),checked:n,disabled:!t,onChange:e=>s({combosEnabled:e})}),(0,c.jsx)(tK.d,{label:j.intl.string(j.t["Ax+IoW"]),description:j.intl.string(j.t["9rgQEr"]),checked:i,disabled:!t,onChange:e=>s({comboSoundsEnabled:e})}),(0,c.jsxs)("div",{children:[(0,c.jsx)(z.E,{variant:"text-md/semibold",color:r?"text-muted":"text-strong",className:ig.KF,children:j.intl.string(j.t.L0oQuh)}),(0,c.jsx)(ip,{children:j.intl.string(j.t["/OOFpL"])}),(0,c.jsx)(B.A,{disabled:r,markers:iA,stickToMarkers:!0,minValue:iA[0],maxValue:iA[iA.length-1],initialValue:l,onValueChange:e=>s({combosRequiredCount:e}),onValueRender:e=>`${e}`})]})]})}function iC(e){let{settings:{enabled:t,screenshakeEnabled:n,shakeIntensity:i,screenshakeEnabledLocations:l},updateSettings:s}=e,r=(0,m.bG)([f.Ay],()=>f.Ay.useReducedMotion),a=!t||!n||r;return(0,c.jsxs)(nZ.n,{label:j.intl.string(j.t.wVS5Sd),children:[(0,c.jsx)(tK.d,{label:j.intl.string(j.t.N004zO),description:r?j.intl.string(j.t.GckHGw):j.intl.string(j.t.Qq5W3v),checked:n&&!r,disabled:!t||r,onChange:e=>s({screenshakeEnabled:e},1)}),(0,c.jsxs)("div",{children:[(0,c.jsx)(z.E,{variant:"text-md/semibold",color:a?"text-muted":"text-strong",className:ig.KF,children:j.intl.string(j.t.UxnnC4)}),(0,c.jsx)(ip,{children:j.intl.string(j.t.CEOEOb)}),(0,c.jsx)(B.A,{disabled:a,markers:ih,equidistant:!0,stickToMarkers:!0,minValue:ih[0],maxValue:ih[ih.length-1],initialValue:i,onValueChange:e=>{var t;null!=(t={shakeIntensity:e}).shakeIntensity&&t.shakeIntensity>i&&(0,n3._)(n5.sn.MORE),s(t,1)},onMarkerRender:e=>e===ih[ih.length-1]?j.intl.string(j.t["4rbMWc"]):`${100*e}%`})]}),(0,c.jsx)(iT,{disabled:a,locations:[{location:ic.uD.CHAT_INPUT,title:j.intl.string(j.t.vUcvPP),description:j.intl.string(j.t.y00OrF)},{location:ic.uD.VOICE_USER,title:j.intl.string(j.t.TcRO54),description:j.intl.string(j.t.YJCxVY)},{location:ic.uD.MENTION,title:j.intl.string(j.t.oW4shO),description:j.intl.string(j.t["mqfw/H"])}],settingsLocations:l,onChange:e=>s({screenshakeEnabledLocations:e},1)})]})}function ib(e){let{updateSettings:t}=e;return(0,c.jsx)(nZ.n,{label:j.intl.string(j.t.EuXv2q),children:(0,c.jsxs)(F.B,{gap:16,children:[(0,c.jsx)("div",{children:j.intl.string(j.t["1SLnki"])}),(0,c.jsx)("div",{"data-button-hoisted-classname-wrapper":!0,className:ig.hw,children:(0,c.jsx)(p.$,{variant:"primary",size:"sm",text:j.intl.string(j.t.qz65yY),onClick:function(){t({enabled:!1,settingsVisible:!1}),(0,tP.default)()}})})]})})}function iy(e){let{onChangePage:t}=e;return(0,c.jsxs)(t8.D,{onClick:function(){return t(1)},className:ig.Tq,children:[(0,c.jsx)("div",{className:ig.w1,children:(0,c.jsx)(nq.O,{size:"md",color:nK.A.unsafe_rawColors.ORANGE_345.css})}),(0,c.jsxs)("div",{className:ig.qL,children:[(0,c.jsx)(E.D,{variant:"heading-md/semibold",color:"text-strong",children:j.intl.string(j.t["6jI0hd"])}),(0,c.jsx)(z.E,{variant:"text-md/normal",color:"text-default",children:j.intl.string(j.t.GuUItX)})]}),(0,c.jsx)(nQ._,{size:"custom",color:"currentColor",width:16,className:ig.nT})]})}function iv(){return n.e("4660").then(n.t.bind(n,662336,19)).then(e=>{let{default:t}=e;return t})}function ij(e){let{onChangePage:t,setShowEnableAnimation:n}=e,i=(0,m.cf)([nH.A],()=>nH.A.getState()),[l,s]=g.useState({x:0,y:0}),r=(0,id.A)();function a(e,t){var s,a,o,u,d,c,g,m;if(e.enabled&&!1===i.enabled&&(n(!0),(0,n0.Ak)("poggermode_enabled"),(0,n2.fO)({duration:2e3,intensity:e.shakeIntensity??i.shakeIntensity})),(0,n6.O9)(e),null==t)return;let A=(s=i.confettiEnabled,a=e.confettiEnabled,o=i.enabled,u=e.enabled,(a??s)&&(u??o));0===t&&A&&r.fire(l.x,l.y,{settings:e});let h=(d=i.screenshakeEnabled,c=e.screenshakeEnabled,g=i.enabled,m=e.enabled,(c??d)&&(m??g));1===t&&h&&(0,n2.fO)({duration:1e3,intensity:e.shakeIntensity??i.shakeIntensity})}function o(e){s({x:e.clientX,y:e.clientY})}return g.useEffect(()=>(window.addEventListener("mousemove",o),()=>window.removeEventListener("mousemove",o)),[]),(0,c.jsxs)(F.B,{gap:24,children:[(0,c.jsx)(iI,{settings:i,updateSettings:a}),(0,c.jsx)(iy,{onChangePage:t}),(0,c.jsx)(iN,{settings:i,updateSettings:a}),(0,c.jsx)(iC,{settings:i,updateSettings:a}),(0,c.jsx)(i_,{settings:i,updateSettings:a}),(0,c.jsx)(ib,{updateSettings:a})]})}function iO(e){return 0===e?n$.f.LEFT:n$.f.RIGHT}let iL=(0,a.E2)(o.X.POGGERMODE_SETTING,{Component:function(){let[e,t]=g.useState(0),[n,i]=g.useState(iO(e)),[l,s]=g.useState(!1),r=(0,m.bG)([f.Ay],()=>f.Ay.useReducedMotion),a=l&&!r;return g.useEffect(()=>{let t=setTimeout(()=>{i(iO(e))},500);return()=>clearTimeout(t)},[e]),g.useEffect(()=>{(0,n1._)(ix[e])},[e]),g.useEffect(()=>{Math.random()>.99&&(0,n3._)(n5.sn.VISITOR_100)},[]),(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(n$.A,{className:ig.l3,step:e,direction:n,children:function(e,t,n){function i(e){return()=>{t(e)}}switch(e){case 0:return(0,c.jsx)(ij,{onChangePage:i(1),setShowEnableAnimation:n});case 1:return(0,c.jsx)(iu,{onBackClick:i(0)});default:return null}}(e,t,s)}),(0,c.jsx)("div",{className:a?ig.Sr:ig.IP,children:(0,c.jsx)(nJ.a,{className:ig.gT,importData:iv,shouldAnimate:a,autoplay:!1,resetOnPlay:!0,loop:!1,onComplete:()=>s(!1)})})]})},useSearchTerms:()=>[j.intl.string(j.t.AtCukI),j.intl.string(j.t.mqxwJO),j.intl.string(j.t.wVS5Sd),j.intl.string(j.t.Xz0ole),j.intl.string(j.t["Ax+IoW"]),j.intl.string(j.t["6jI0hd"]),j.intl.string(j.t.s0KCgF)]}),iD=(0,a.zZ)(o.X.POGGERMODE_CATEGORY,{buildLayout:()=>[iL]});var iR=n(231570);let iP=(0,a.t_)(o.X.POGGERMODE_PANEL,{useTitle:()=>j.intl.string(j.t.AtCukI),buildLayout:()=>[iD]}),iG=(0,a.i4)(o.X.POGGERMODE_SIDEBAR_ITEM,{useTitle:()=>j.intl.string(j.t.AtCukI),icon:()=>(0,c.jsx)("img",{alt:"",src:n(724405),className:iR.$}),usePredicate:()=>(0,m.bG)([nH.A],()=>nH.A.settingsVisible),buildLayout:()=>[iP]});var iM=n(307301),iU=n(410767),iV=n(683071),ik=n(97260),iw=n(695366),iF=n(812729),iB=n.n(iF),iz=n(587895),iX=n(429913),iY=n(616356),iH=n(952818);function iK(e,t){return null!=e&&null!=e.id?e.id:null!=t&&null!=t.id?t.id:void 0}function iW(){let e=(0,m.bG)([iY.A],()=>iY.A.getStreamerActiveStreamMetadata()),t=(0,m.bG)([iH.Ay],()=>{let e=iH.Ay.getVisibleGame();return null!=e?iH.Ay.getGameOrTransformedSubgameForPID(e.pid):null},[],iB()),[n]=(0,iX.A)([iK(e,t)]);return{runningGame:t??void 0,runningGameApplication:n??void 0}}var iZ=n(769015),iq=n(626822),iQ=n(935671),iJ=n(868886);function i$(e){let{game:t,application:n}=e;return null==t||null==n?(0,c.jsx)("div",{className:iJ.zc,children:(0,c.jsx)(iw.E,{size:"sm",color:nK.A.colors.TEXT_FEEDBACK_WARNING})}):(0,c.jsxs)("div",{className:iJ.nt,children:[(0,c.jsx)(iZ.A,{game:n,pid:t.pid,size:iZ.M.MEDIUM}),(0,c.jsx)("div",{className:iJ.Am,children:(0,c.jsx)(iw.E,{size:"sm",color:nK.A.colors.TEXT_FEEDBACK_WARNING})})]})}function i0(e){let t=(0,m.bG)([iq.Ay],()=>iq.Ay.getMode()),{runningGame:n,runningGameApplication:i}=iW();null==n||n.elevated||(n=void 0,i=void 0);let l=(0,iQ.NP)(),s=l&&null!=n&&t===A.TBI.PUSH_TO_TALK;return{canPrompt:"voice"===e?s:l,runningGame:n,runningGameApplication:i}}function i1(e){let{className:t,sourcePage:n}=e,{canPrompt:i,runningGame:l,runningGameApplication:s}=i0(n);return i?(0,c.jsxs)("div",{className:ie()(iJ.kL,t),children:[(0,c.jsx)(i$,{game:l,application:s}),(0,c.jsxs)("div",{className:iJ.FS,children:[(0,c.jsx)(z.E,{variant:"text-sm/medium",color:"text-strong",children:"voice"===n?j.intl.string(j.t.vxfv7v):null!=l?j.intl.string(j.t.fAYU2G):j.intl.string(j.t["9V4X/c"])}),(0,c.jsx)(z.E,{variant:"text-xs/medium",color:"text-muted",children:j.intl.format(j.t["/y6htt"],{helpCenterLink:eS.A.getArticleURL(A.MVz.SYSTEM_SERVICE)})})]}),(0,c.jsx)(p.$,{variant:"secondary",size:"sm",text:j.intl.string(j.t["1iI46O"]),onClick:function(){(0,iQ.sL)(n+(null!=l?"-with-game":"-no-game"))}})]}):null}var i2=n(404778),i3=n(691885),i5=n(408278),i6=n(241326),i4=n(866665),i8=n(140735),i7=n(489718),i9=n(635242),le=n(350535),lt=n(189213),ln=n(192308),li=n(95477),ll=n(320989),ls=n(978263);let lr=[];var la=n(235986),lo=n(820785),lu=n(734057),ld=n(808728),lc=n(71393),lg=n(967198),lm=n(926140),lA=n(387722);function lh(){}let lE=[lm.rD.VOICE_CHANNEL];function lS(e){e.setOptions({voiceChannelGuildFilter:null}),e.setLimit(1/0)}function lx(){return(0,c.jsx)("div",{className:lA.i1,children:(0,c.jsx)(z.E,{variant:"text-md/medium",color:"text-muted",className:lA.GN,children:j.intl.string(j.t.zHjCd1)})})}function lT(e){let{keybind:t,className:n}=e,i=g.useRef(t);g.useEffect(()=>{i.current=t});let[l,s]=g.useState(t.params?.channelId??void 0),r=g.useCallback(()=>{(0,ln.openModalLazy)(async()=>e=>(0,c.jsx)(lp,{...e,onSelect:e=>{s(e),ik.A.setKeybind({...i.current,params:{channelId:e}})}}))},[]);return(0,c.jsx)("div",{className:ie()(lA.a8,n),children:(0,c.jsx)(tH.D,{label:j.intl.string(j.t.q4JpM8),children:(0,c.jsxs)(la.A,{align:la.A.Align.STRETCH,children:[(0,c.jsx)("div",{className:lA.$X,children:(0,c.jsx)(lf,{channelId:l})}),(0,c.jsx)(la.A.Child,{grow:0,shrink:0,children:(0,c.jsx)(p.$,{variant:"primary",text:j.intl.string(j.t.Dm8O4e),onClick:r})})]})})})}function lp(e){let t,n,{transitionState:i,onClose:l,onSelect:s}=e,r=g.useId(),a=g.useRef(null),{query:o,updateQuery:u,queryResults:d}=function(e){let{visible:t,autocompleterResultTypes:n,autocompleterOptions:i,autocompleterBeforeCreateSearchContext:l}=e,[s,r]=g.useState(""),[a,o]=g.useState(lr),u=g.useCallback((e,t)=>{""===(t=t.trim()).trim()?o(lr):o(e)},[]);g.useEffect(()=>ll.A.addRouteChangeListener(()=>{r("")}),[]);let[d]=g.useState(()=>new ls.A(u,n,void 0,i));return g.useEffect(()=>{t?(l?.(d),d.createSearchContext()):(d.clean(),r(""))},[t,d,l]),{queryResults:a,query:s,updateQuery:g.useCallback(e=>{r(e),d.search(e)},[d])}}({visible:!0,autocompleterResultTypes:lE,autocompleterBeforeCreateSearchContext:lS}),A=(t=""!==o,n=(0,m.yK)([ld.Ay,lu.A,lg.A],()=>{let e=lg.A.getGuildId();if(t||null==e)return[];let n=[];for(let t of ld.Ay.getVocalChannelIds(e)){let e=lu.A.getChannel(t);null!=e&&n.push(e)}return n},[t]),t?null:n),{focusedIndex:h,setFocusedIndex:E}=function(e){let[t,n]=g.useState(0),i=g.useRef(e);return e!==i.current&&0!==t&&n(0),g.useEffect(()=>{i.current=e}),{focusedIndex:t,setFocusedIndex:n}}(o);g.useEffect(()=>{let{current:e}=a;null==e||e.isItemVisible(0,h,!0)||e.scrollToIndex({section:0,row:h})},[h]);let S=null!=A?A.length:d.length,x=(()=>{if(null!=A)return A[h]?.id;let e=d[h];if(e?.type===lm.rD.VOICE_CHANNEL)return e.record.id})(),T=S>0||""===o?{innerId:r,innerRole:"listbox",innerAriaLabel:j.intl.string(j.t["+N3fW7"]),ref:a,sections:[S],renderRow:function(e){let{row:t}=e,n=(()=>{if(null!=A)return A[t];let e=d[t];if(e?.type===lm.rD.VOICE_CHANNEL)return e.record})();if(null==n)return null;let i=null!=n.parent_id?lu.A.getChannel(n.parent_id):void 0,r=lc.A.getGuild(n.guild_id);return(0,c.jsx)(lo.c3,{id:n.id,channel:n,category:i,focused:h===t,onMouseEnter:()=>E(t),onClick:()=>{s(n.id),l()},onFocus:()=>E(t),children:null!=r?(0,c.jsx)("div",{className:lA.J5,children:r.name}):null},n.id)},sectionHeight:0,rowHeight:34}:{sections:[1],renderRow:()=>(0,c.jsx)(lx,{}),sectionHeight:0,rowHeight:52};return(0,c.jsx)(lt.Modal,{transitionState:i,onClose:l,title:j.intl.string(j.t.Dm8O4e),subtitle:j.intl.string(j.t.q4JpM8),actions:void 0,input:(0,c.jsx)(li.k,{value:o,onChange:u,onKeyDown:function(e){let t=e.key.toLowerCase();if("arrowdown"===t||"arrowup"===t||"enter"===t||"escape"===t)switch(e.preventDefault(),t){case"escape":l();break;case"enter":{let e=(()=>{if(null!=A)return A[h];let e=d[h];if(e?.type===lm.rD.VOICE_CHANNEL)return e.record})();null==e?s(void 0):s(e.id),l();break}case"arrowup":0===h?E(S-1):E(h-1);break;case"arrowdown":h>=S-1?E(0):E(h+1)}},placeholder:j.intl.string(j.t.tG0r7g),role:"combobox","aria-controls":r,"aria-expanded":S>0,"aria-activedescendant":S>0&&null!=x?x:void 0,"aria-autocomplete":"list",spellCheck:!1,autoFocus:!0}),listProps:T})}function lf(e){let{channelId:t}=e,{channel:n,category:i,guild:l}=(0,m.cf)([lu.A,lc.A],()=>{let e=null!=t?lu.A.getChannel(t):void 0;return null!=e?{channel:e,category:null!=e.parent_id?lu.A.getChannel(e.parent_id):void 0,guild:null!=e.guild_id?lc.A.getGuild(e.guild_id):void 0}:{channel:void 0,category:void 0,guild:void 0}});return null==n?(0,c.jsx)(z.E,{variant:"text-md/medium",color:"text-muted",className:lA.GN,children:j.intl.string(j.t["/fYIK7"])}):(0,c.jsx)(lo.c3,{channel:n,id:n.id,category:i,onClick:lh,onFocus:lh,onMouseEnter:lh,focused:!1,children:null!=l?(0,c.jsx)("div",{className:lA.J5,children:l.name}):null})}var lI=n(650583),l_=n(492064);function lN(e){let{keybind:t}=e,n=le.dI(t.shortcut);return eK.A.hasBind(n)?(0,c.jsx)("div",{className:l_.$e,children:(0,c.jsx)(iV.w,{type:"warning",children:j.intl.string(j.t["7lQlw3"])})}):lI.Yy.has(n)?(0,c.jsx)("div",{className:l_.$e,children:(0,c.jsx)(iV.w,{type:"warning",children:j.intl.format(j.t.MOIaNd,{keyboardNavArticle:eS.A.getArticleURL(A.MVz.KEYBOARD_NAVIGATION)})})}):void 0}function lC(e){let{keybind:t}=e;return t.action===A.hCu.SWITCH_TO_VOICE_CHANNEL?(0,c.jsx)(lT,{keybind:t,className:l_._M}):null}let lb=g.memo(function(e){let{keybind:t,keybindDescriptions:n,keybindActionTypes:i}=e,l=g.useCallback(e=>ik.A.setKeybind({...t,action:e}),[t]),s=g.useCallback(e=>ik.A.setKeybind({...t,shortcut:e}),[t]),r=g.useCallback(()=>ik.A.setKeybind({...t,enabled:!t.enabled}),[t]),a=g.useCallback(()=>ik.A.deleteKeybind(t.id),[t.id]),o=g.useId(),u=g.useMemo(()=>i.find(e=>e.value===t.action)?.label??t.action,[t.action,i]);return(0,c.jsxs)("div",{className:l_.f_,children:[(0,c.jsx)(lN,{keybind:t}),(0,c.jsx)("div",{className:l_.XI,children:(0,c.jsx)(i3.l,{selectionMode:"single",label:j.intl.string(j.t.XH5b12),value:t.action,options:i,onSelectionChange:l,disabled:t.managed})}),(0,c.jsx)("div",{className:l_.LE,children:(0,c.jsx)(tH.D,{label:j.intl.string(j.t["1La4tC"]),layout:"vertical",children:(0,c.jsx)(i9.A,{defaultValue:t.shortcut,onChange:s})})}),(0,c.jsxs)("div",{className:l_.ne,children:[!t.managed&&(0,c.jsx)(i5.K,{variant:"icon-only",onClick:a,icon:i6.u,"aria-label":j.intl.string(j.t.qEHmmB)}),(0,c.jsx)(i4.m,{text:j.intl.string(t.enabled?j.t.pNYGbx:j.t["51DGkH"]),ariaHidden:!0,children:(0,c.jsxs)("div",{children:[(0,c.jsx)(i8.A,{id:o,children:j.intl.format(t.enabled?j.t["myr/Y0"]:j.t.lYhtPO,{actionName:u})}),(0,c.jsx)(i7.I,{checked:t.enabled,onChange:r,labelledBy:o})]})})]}),(0,c.jsx)(z.E,{variant:"text-xs/normal",color:"text-subtle",className:l_.h_,children:n[t.action]}),(0,c.jsx)(lC,{keybind:t})]})});var ly=n(549406),lv=n(734066),lj=n(880144),lO=n(614455),lL=n(532624),lD=n(731854),lR=n(487866);let lP=function(){let e,t,n,i,l,s,r,{customizableKeybinds:a,keybindDescriptions:o,keybindActionTypes:u}=(e=(0,m.bG)([lL.Ay],()=>lL.Ay.getState()),t=(0,m.bG)([iq.Ay],()=>(0,lj.A)(iq.Ay)),n=(0,m.bG)([iq.Ay],()=>iq.Ay.supports(lD.O5.VIDEO)),i=(0,m.bG)([lO.A],()=>lO.A.isSupported),l=(0,lv.sw)(),s=(0,lv.BW)(),{customizableKeybinds:function(e){let{keybinds:t,enableClips:n,enableScreenshotKeybind:i,allowSoundboard:l}=e;return k()(t).reject(e=>e.managed&&![A.hCu.OVERLAY_ACTIVATE_REGION_TEXT_WIDGET,A.hCu.SAVE_CLIP,A.hCu.SAVE_SCREENSHOT].includes(e.action)).reject(e=>!n&&(e.action===A.hCu.SAVE_CLIP||e.action===A.hCu.SAVE_SCREENSHOT)).reject(e=>!i&&e.action===A.hCu.SAVE_SCREENSHOT).reject(e=>!l&&(e.action===A.hCu.SOUNDBOARD||e.action===A.hCu.SOUNDBOARD_HOLD)).sortBy(e=>e.id).sortBy(e=>!0===e.managed?-1:0).value()}({keybinds:e,enableClips:l,enableScreenshotKeybind:s,allowSoundboard:r=(0,eW.isWindows)()}),keybindActionTypes:function(e){let{overlaySupported:t,canGoLive:n,videoSupported:i,allowSoundboard:l,enableClips:s,enableScreenshotKeybind:r}=e,a=[{id:"unassigned",value:A.hCu.UNASSIGNED,label:j.intl.string(j.t["0Uh579"])},{id:"push-to-talk",value:A.hCu.PUSH_TO_TALK,label:j.intl.string(j.t.Y5lgTP)},{id:"push-to-talk-priority",value:A.hCu.PUSH_TO_TALK_PRIORITY,label:j.intl.string(j.t.DkSwJ2)},{id:"push-to-mute",value:A.hCu.PUSH_TO_MUTE,label:j.intl.string(j.t.hSCRqd)},{id:"vad-priority",value:A.hCu.VAD_PRIORITY,label:j.intl.string(j.t["49d6Nd"])},{id:"toggle-mute",value:A.hCu.TOGGLE_MUTE,label:j.intl.string(j.t.PlkYKD)},{id:"toggle-deafen",value:A.hCu.TOGGLE_DEAFEN,label:j.intl.string(j.t.NvGq1K)},{id:"toggle-voice-mode",value:A.hCu.TOGGLE_VOICE_MODE,label:j.intl.string(j.t.Wa5H9S)},{id:"toggle-streamer-mode",value:A.hCu.TOGGLE_STREAMER_MODE,label:j.intl.string(j.t.BK0Ncc)},{id:"toggle-voice-channel-chat",value:A.hCu.TOGGLE_VOICE_CHANNEL_CHAT,label:j.intl.string(j.t.YeqEjm)}];return i&&a.push({id:"toggle-camera",value:A.hCu.TOGGLE_CAMERA,label:j.intl.string(j.t.hf8JVT)}),t&&(a.push({id:"toggle-overlay-input-lock",value:A.hCu.TOGGLE_OVERLAY_INPUT_LOCK,label:j.intl.string(j.t.VsAZcC)}),a.push({id:"activate-overlay-region-text-widget",value:A.hCu.OVERLAY_ACTIVATE_REGION_TEXT_WIDGET,label:j.intl.string(j.t.hurHWo)})),n&&((0,eW.isWindows)()||iq.Ay.getUseSystemScreensharePicker())&&a.push({id:"toggle-go-live-streaming",value:A.hCu.TOGGLE_GO_LIVE_STREAMING,label:j.intl.string(j.t.ybdjJD)}),(0,eW.isDesktop)()&&(a.push({id:"navigate-back",value:A.hCu.NAVIGATE_BACK,label:j.intl.string(j.t.gRSaOa)},{id:"navigate-forward",value:A.hCu.NAVIGATE_FORWARD,label:j.intl.string(j.t.zOXpjU)},{id:"switch-to-voice-channel",value:A.hCu.SWITCH_TO_VOICE_CHANNEL,label:j.intl.string(j.t.ty7Lxy)},{id:"disconnect-from-voice-channel",value:A.hCu.DISCONNECT_FROM_VOICE_CHANNEL,label:j.intl.string(j.t.CV7mT7)}),l&&a.push({id:"soundboard",value:A.hCu.SOUNDBOARD,label:j.intl.string(j.t.yPH4xm)},{id:"soundboard-hold",value:A.hCu.SOUNDBOARD_HOLD,label:j.intl.string(j.t["1xFbP/"])}),s&&(a.push({id:"save-clip",value:A.hCu.SAVE_CLIP,label:j.intl.string(j.t.U4URzP)}),r&&a.push({id:"save-screenshot",value:A.hCu.SAVE_SCREENSHOT,label:j.intl.string(j.t["+WloFH"])}))),a}({overlaySupported:i,canGoLive:t,videoSupported:n,allowSoundboard:r,enableClips:l,enableScreenshotKeybind:s}),keybindDescriptions:function(e){let{overlaySupported:t,canGoLive:n,videoSupported:i,enableClips:l,enableScreenshotKeybind:s}=e,r={[A.hCu.UNASSIGNED]:j.intl.string(j.t.rvlNLv),[A.hCu.PUSH_TO_MUTE]:j.intl.string(j.t.xtESim),[A.hCu.PUSH_TO_TALK]:j.intl.string(j.t.wTcBSy),[A.hCu.PUSH_TO_TALK_PRIORITY]:j.intl.string(j.t.FhHvWH),[A.hCu.TOGGLE_MUTE]:j.intl.string(j.t.X2fbUm),[A.hCu.TOGGLE_DEAFEN]:j.intl.string(j.t.MjREZV),[A.hCu.TOGGLE_VOICE_MODE]:j.intl.string(j.t.snm5YW),[A.hCu.TOGGLE_STREAMER_MODE]:j.intl.string(j.t.YszLLx),[A.hCu.VAD_PRIORITY]:j.intl.string(j.t.rSe8IZ),[A.hCu.TOGGLE_VOICE_CHANNEL_CHAT]:j.intl.string(j.t.desfB4)};return i&&(r[A.hCu.TOGGLE_CAMERA]=j.intl.string(j.t.v1JBtL)),t&&(r[A.hCu.TOGGLE_OVERLAY_INPUT_LOCK]=j.intl.string(j.t.IoP5vc)),n&&(0,eW.isWindows)()&&(r[A.hCu.TOGGLE_GO_LIVE_STREAMING]=j.intl.string(j.t.s4C238)),(0,eW.isDesktop)()&&(r[A.hCu.NAVIGATE_BACK]=j.intl.string(j.t.nKDlEt),r[A.hCu.NAVIGATE_FORWARD]=j.intl.string(j.t.DK0FFk),r[A.hCu.SOUNDBOARD]=(0,eW.isWindows)()?j.intl.string(j.t["5wJefL"]):j.intl.string(j.t.gzjsSP),r[A.hCu.SOUNDBOARD_HOLD]=(0,eW.isWindows)()?j.intl.string(j.t.RRkZc9):j.intl.string(j.t.laNlTl),l&&(r[A.hCu.SAVE_CLIP]=j.intl.string(j.t.z3Wbam),s&&(r[A.hCu.SAVE_SCREENSHOT]=j.intl.string(j.t.m0zd57)))),r}({overlaySupported:i,canGoLive:t,videoSupported:n,enableClips:l,enableScreenshotKeybind:s})});return 0===a.length?(0,c.jsx)(z.E,{variant:"text-sm/normal",color:"text-subtle",children:j.intl.string(j.t.vyYgWp)}):(0,c.jsx)("div",{className:lR.A,children:a.map((e,t)=>(0,c.jsxs)(g.Fragment,{children:[(0,c.jsx)(lb,{keybind:e,keybindDescriptions:o,keybindActionTypes:u}),t<a.length-1?(0,c.jsx)(i2.c,{className:lR.y,gap:24}):null]},e.id))})},lG=(0,a.E2)(o.X.CUSTOM_KEYBINDS_SETTING,{useSearchTerms:()=>[j.intl.string(j.t["069nVT"])],Component:function(){return no.Av?(0,c.jsx)(lP,{}):(0,c.jsx)(iV.w,{type:"info",children:j.intl.format(j.t.mPi3F3,{downloadLink:A.X7G.DOWNLOAD})})}});var lM=n(475358),lU=n(28647),lV=n(760677);function lk(e){let{children:t}=e;return t([ly.Q_.MESSAGE,ly.Q_.NAVIGATION,ly.Q_.DND,ly.Q_.CHAT,ly.Q_.VOICE_AND_VIDEO,ly.Q_.MISCELLANEOUS])}function lw(e){let{showHeader:t=!0}=e,n=k()((0,ly.Bx)()).filter(e=>e.description!==j.intl.string(j.t.HnNtEI)).groupBy(e=>e.group).value();return(0,c.jsxs)(F.B,{gap:48,children:[(0,c.jsx)(nZ.n,{label:t?j.intl.string(j.t.Lz5KHI):void 0,children:(0,c.jsx)("div",{className:lV.jh,children:(0,c.jsxs)("div",{className:lV.yZ,children:[(0,c.jsx)(z.E,{variant:"text-md/normal",children:j.intl.string(j.t.sMWLBj)}),(0,c.jsx)("div",{className:lV.DM,children:(0,c.jsx)(lM.e,{shortcut:lU.z.binds["0"],className:lV.LE})})]})})}),(0,c.jsx)(lk,{children:e=>(0,c.jsx)(c.Fragment,{children:e.map((e,t)=>{let i=(0,ly.Gm)(e),l=(0,ly.zF)(e),s=n[e];return(0,c.jsx)(nZ.n,{label:i,description:l,children:(0,c.jsx)("div",{className:lV.jh,children:s.map((e,t)=>(0,c.jsxs)(g.Fragment,{children:[0!==t&&(0,c.jsx)(i2.c,{}),(0,c.jsxs)("div",{className:lV.yZ,children:[(0,c.jsx)(z.E,{variant:"text-md/normal",children:e.description}),(0,c.jsx)("div",{className:lV.DM,children:e.binds.map(e=>(0,c.jsx)(lM.e,{shortcut:e,className:lV.LE},e))})]})]},e.description))})},t)})})})]})}let lF=(0,a.E2)(o.X.DEFAULT_KEYBINDS_SETTING,{useSearchTerms:()=>[j.intl.string(j.t.Lz5KHI)],Component:()=>(0,c.jsx)(lw,{showHeader:!1})});var lB=n(19575),lz=n(546385);let lX=(0,a.E2)(o.X.HARDWARE_ACCELERATION,{usePredicate:()=>no.Av&&!(0,no.cX)(),useSearchTerms:()=>[j.intl.string(j.t["/HIxyY"]),j.intl.string(j.t.B0hqpb)],Component:function(){let[e]=g.useState(()=>lB.Ay.getEnableHardwareAcceleration()),t=j.intl.string(j.t["/HIxyY"]),n=j.intl.string(j.t.B0hqpb);return(0,c.jsxs)(F.B,{children:[(0,c.jsx)(tK.d,{label:t,description:n,checked:e,onChange:lY}),!e&&(0,c.jsx)(lz.A,{look:lz.k.WARNING,children:j.intl.string(j.t.j7S6IX)})]})}});function lY(e){let t=e?j.intl.format(j.t.LYXRxL,{}):j.intl.format(j.t.uDP3Kz,{});(0,nW.A)({title:j.intl.string(j.t.aqpAvn),subtitle:t,confirmText:j.intl.string(j.t.vT7ckk),onConfirm:()=>{lB.Ay.setEnableHardwareAcceleration(e)}})}let lH=(0,eh.D)(()=>({openOnStartup:!0,startMinimized:!1,minimizeToTray:!0}));async function lK(){let e=await lB.Ay.getOpenOnStart(),t=await lB.Ay.getSetting("START_MINIMIZED",!1),n=await lB.Ay.getSetting("MINIMIZE_TO_TRAY",!0);lH.setState({openOnStartup:e,startMinimized:t,minimizeToTray:n})}let lW=(0,a.zD)(o.X.OS_OPEN_ON_STARTUP,{useTitle:()=>j.intl.string(j.t["3BeZti"]),usePredicate:()=>no.Av&&!(0,no.cX)(),useValue:()=>lH.useState(e=>e.openOnStartup),setValue:function(e){lH.setState({openOnStartup:e}),lB.Ay.send("TOGGLE_OPEN_ON_STARTUP",e)},initialize:()=>{lB.Ay.getOpenOnStart().then(e=>lH.setState({openOnStartup:e}))}}),lZ=(0,a.zD)(o.X.OS_MINIMIZE_TO_TRAY,{useTitle:()=>j.intl.string(j.t.dJ5MUh),useSubtitle:()=>j.intl.string(j.t.nQavHr),usePredicate:()=>no.Av&&!(0,no.cX)(),useValue:()=>lH.useState(e=>e.minimizeToTray),setValue:function(e){lH.setState({minimizeToTray:e}),lB.Ay.send("TOGGLE_MINIMIZE_TO_TRAY",e)},initialize:()=>{lB.Ay.getSetting("MINIMIZE_TO_TRAY",!0).then(e=>lH.setState({minimizeToTray:e}))}}),lq=(0,a.zD)(o.X.OS_START_MINIMIZED,{useTitle:()=>j.intl.string(j.t.GfBL83),useSubtitle:()=>j.intl.string(j.t.XGyhhc),usePredicate:()=>(0,no.uF)(),useValue:()=>lH.useState(e=>!!e.openOnStartup&&e.startMinimized),setValue:function(e){lH.setState({startMinimized:e}),lB.Ay.send("TOGGLE_START_MINIMIZED",e)},useDisabled:()=>!lH.useState(e=>e.openOnStartup),initialize:()=>{lB.Ay.getSetting("START_MINIMIZED",!1).then(e=>lH.setState({startMinimized:e}))}});var lQ=n(314647);let lJ=new Set(["failure","unknown"]),l$=(0,a.E2)(o.X.OS_SYSTEM_SERVICE,{useSearchTerms:()=>[j.intl.string(j.t.roHq80)],Component:function(){let[e,t]=g.useState(!1),[n,i]=g.useState(()=>(0,iQ.TC)()),l=(0,m.bG)([iH.Ay],()=>iH.Ay.getSystemServiceStatus("input-service")),s=g.useCallback(async()=>{t(!0),n?await (0,iQ.z8)("windows-settings"):await (0,iQ.sL)("windows-settings"),t(!1),i((0,iQ.TC)())},[n]);return(0,c.jsxs)("div",{className:lQ.q,children:[(0,c.jsxs)("div",{className:lQ.L,children:[(0,c.jsxs)(F.B,{direction:"horizontal",children:[(0,c.jsx)(z.E,{variant:"text-md/medium",color:"text-strong",children:j.intl.string(j.t.roHq80)}),n&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(z.E,{variant:"text-md/medium",color:"text-strong","aria-hidden":!0,children:"\u2022"}),(0,c.jsx)(z.E,{variant:"text-md/medium",color:"running"===l.state?"text-feedback-positive":lJ.has(l.state)?"text-feedback-critical":"text-feedback-warning",children:function(e){switch(e.state){case"unknown":return j.intl.string(j.t["KW+nqT"]);case"disabled":return j.intl.string(j.t["Q/wAF7"]);case"disconnected":return j.intl.string(j.t.Xvs9IM);case"initializing":return j.intl.string(j.t.h4qz8W);case"connecting":return j.intl.string(j.t.fSu9XF);case"handshaking":return j.intl.string(j.t["00aYLJ"]);case"running":return j.intl.string(j.t["54TB7Z"]);case"waiting-for-retry":return j.intl.string(j.t["0FONwi"]);case"failure":return j.intl.string(j.t.Ic0nkd);default:(0,n8.xb)(e.state)}}(l)})]})]}),(0,c.jsx)(z.E,{variant:"text-sm/normal",color:"text-subtle",children:j.intl.format(j.t["8CAL+D"],{helpCenterLink:eS.A.getArticleURL(A.MVz.SYSTEM_SERVICE)})})]}),(0,c.jsx)(p.$,{variant:n?"critical-secondary":"primary",loading:e,onClick:s,text:n?j.intl.string(j.t.pAwbdL):j.intl.string(j.t["1iI46O"])})]})},usePredicate:iQ.XQ});function l0(){e2.h.dispatch({type:"DISCORD_STATS_POPOUT_WINDOW_OPEN"})}var l1=n(287809);let l2=(0,a.Tf)(o.X.DISCORD_STATS_POPOUT,{useTitle:()=>"Discord Stats",useSubtitle:()=>"Open a floating panel showing live GPU, CPU, and memory usage.",useLabel:()=>"Open",usePredicate:()=>(0,m.bG)([l1.default],()=>l1.default.getCurrentUser()?.isStaff()??!1),onClick:()=>{l0()}}),l3=(0,a.zZ)(o.X.SYSTEM_ADVANCED_CATEGORY,{useTitle:()=>j.intl.string(j.t["8/udY0"]),buildLayout:()=>[l2]}),l5=(0,a.zZ)(o.X.SYSTEM_GENERAL_CATEGORY,{useTitle:()=>j.intl.string(j.t.cg6ltt),buildLayout:()=>[lW,lq,lZ,lX],usePredicate:()=>no.Av&&((0,no.uF)()||(0,no.j9)()),initialize:()=>{lK()}}),l6=(0,a.zZ)(o.X.SYSTEM_CUSTOM_KEYBINDS_CATEGORY,{useTitle:()=>j.intl.string(j.t["069nVT"]),useSubtitle:()=>j.intl.string(j.t.T4LZVL),buildLayout:()=>[lG],initialize:()=>(ik.A.enableAll(!1),()=>ik.A.enableAll(!0)),useInlineNotice:function(){return no.Av?{type:d.lT.STRONGLY_DISCOURAGED_CUSTOM,notice:()=>(0,c.jsxs)(F.B,{direction:"vertical",gap:"md",children:[(0,c.jsx)(iV.w,{type:"info",children:j.intl.string(j.t["5pkmHa"])}),(0,c.jsx)(i1,{sourcePage:"keybinds"})]})}:null},useHeaderDecoration:()=>no.Av?{type:d.WX.BUTTON_GROUP,buttons:[{id:"add-keybind",type:d.UV.BUTTON,text:j.intl.string(j.t.zk6Xbs),variant:"secondary",icon:iM.j,onClick:()=>ik.A.addKeybind()}]}:null}),l4=(0,a.zZ)(o.X.SYSTEM_DEFAULT_KEYBINDS_CATEGORY,{useTitle:()=>j.intl.string(j.t.Lz5KHI),buildLayout:()=>[lF]}),l8=(0,a.zZ)(o.X.SYSTEM_HELPER_CATEGORY,{useTitle:()=>j.intl.string(j.t["+XZgmA"]),usePredicate:()=>no.Av&&((0,no.uF)()||(0,no.j9)()),buildLayout:()=>[l$]}),l7=(0,a.t_)(o.X.SYSTEM_PANEL,{useTitle:()=>j.intl.string(j.t["VJ/qKo"]),buildLayout:()=>[l5,l6,l4,l8,l3]}),l9=(0,a.i4)(o.X.SYSTEM_SIDEBAR_ITEM,{useTitle:()=>j.intl.string(j.t["VJ/qKo"]),icon:iU.F,buildLayout:()=>[l7]});var se=n(831544),st=n(922795),sn=n(212245),si=n(329551),sl=n(285918),ss=n(413339),sr=n(952572),sa=n(382003);let so=(0,a.E2)(o.X.CAMERA_BACKGROUND_SETTING,{useSearchTerms:()=>[j.intl.string(j.t.lZTUPs)],usePredicate:sr.A,Component:function(){let e=(0,sn.p)(),t=g.useRef(!1),n=(0,m.bG)([iq.Ay],()=>iq.Ay.getVideoDeviceId()),[i,l]=g.useState((0,si.i)(l1.default.getCurrentUser())),s=g.useRef(i);return g.useEffect(()=>()=>{t.current&&(0,sl._C)(s.current)},[]),(0,c.jsx)(sa.A,{selectedBackgroundOption:i,onSelectBackgroundOption:function(n){t.current=!0,s.current=n,l(n),(0,ss.gB)(n,{location:e.location}).catch(A.tEg)},currentDeviceId:n})}}),su=(0,a.zD)(o.X.CAMERA_PREVIEW_PREFERENCE,{useTitle:()=>j.intl.string(j.t["3Ppr1h"]),useSubtitle:()=>j.intl.string(j.t.WNbX4O),useValue:v.bm.useSetting,setValue:e=>{v.bm.updateSetting(e),e7.default.track(A.HAw.UPDATE_USER_SETTINGS_LOCAL,{always_preview_video:e})}});var sd=n(625841),sc=n(74848),sg=n(204050);let sm=(0,eh.D)(()=>({previewEnabled:!1})),sA=(0,a.E2)(o.X.CAMERA_SELECTION_SETTING,{useSearchTerms:()=>[j.intl.string(j.t.FsQ3OR)],Component:function(){let e=(0,m.bG)([iq.Ay],()=>iq.Ay.isVideoAvailable()),{id:t}=(0,sc.x5)(lD.oh.VIDEO_INPUT),{analyticsLocations:n}=(0,eL.Ay)();return(0,c.jsx)(sd.U,{label:j.intl.string(j.t.FsQ3OR),deviceType:lD.oh.VIDEO_INPUT,location:"UserSettingsCameraSelect",isDisabled:!e,helperText:(0,sg.p)()?j.intl.format(j.t.aJYgRt,{onCameraSettingsClick:()=>{sm.setState({previewEnabled:!1}),window.open((0,sg.i)(t)),e7.default.track(A.HAw.SYSTEM_CAMERA_SETTINGS_OPENED,{location_stack:n})}}):void 0})}});var sh=n(745317),sE=n(514956);let sS=(0,a.E2)(o.X.CAMERA_VIDEO_PREVIEW,{useSearchTerms:()=>[j.intl.string(j.t.JIf4v7)],Component:function(){let e=iq.Ay.getCameraComponent(),t=(0,m.bG)([iq.Ay],()=>iq.Ay.getVideoDeviceId()),n=sm.useField("previewEnabled"),i=(0,m.bG)([iq.Ay],()=>iq.Ay.isVideoAvailable());return((0,eA.l0)(()=>{sm.setState({previewEnabled:!1})}),n)?(0,c.jsx)("div",{className:sE.T9,children:(0,c.jsxs)("div",{className:sE.Xi,children:[(0,c.jsxs)("div",{className:sE.UI,children:[(0,c.jsx)(e,{deviceId:t,width:387,height:218,disabled:!n}),(0,c.jsx)(sh.kE,{})]}),(0,c.jsx)(sh.eK,{})]})}):(0,c.jsx)("div",{className:sE.T9,children:(0,c.jsx)(i4.m,{text:i?null:j.intl.string(j.t["8jSzSe"]),children:(0,c.jsx)(p.$,{variant:"primary",text:j.intl.string(j.t.JIf4v7),onClick:()=>sm.setState({previewEnabled:!0}),disabled:!i})})})}}),sx=(0,a.zZ)(o.X.CAMERA_CATEGORY,{useTitle:()=>j.intl.string(j.t.uje3P9),usePredicate:()=>(0,m.bG)([iq.Ay],()=>iq.Ay.supports(lD.O5.VIDEO)),buildLayout:()=>[sS,su,sA,so]});var sT=n(827343);let sp=(0,a.zD)(o.X.VOICE_AND_VIDEO_OPENH264,{useTitle:()=>j.intl.string(j.t.qFphsa),useSubtitle:()=>j.intl.string(j.t.cQfwyY),usePredicate:function(){return(0,no.j9)()},useValue:function(){return(0,m.bG)([iq.Ay],()=>iq.Ay.getOpenH264Enabled())},setValue:function(e){sT.A.setOpenH264Enabled(e),(0,nW.A)({title:j.intl.string(j.t["9jf31O"]),subtitle:j.intl.string(j.t["J2wg+X"]),confirmText:j.intl.string(j.t.BddRzS),onConfirm:()=>nc.A.app.relaunch()})},useSearchTerms:()=>["open","OpenH264","H264","codec"]}),sf=(0,a.zD)(o.X.VOICE_AND_VIDEO_AUDIO_RECORDING,{useTitle:()=>j.intl.string(j.t["r6K+TL"]),useSubtitle:()=>j.intl.string(j.t["xl9+I6"]),useValue:function(){return(0,m.bG)([iq.Ay],()=>iq.Ay.getAecDump())},setValue:sT.A.setAecDump,usePredicate:function(){return(0,m.bG)([iq.Ay],()=>iq.Ay.isAecDumpSupported())}});var sI=n(139033),s_=n(862482),sN=n(640238),sC=n(825484),sb=n(77138),sy=n(487329),sv=n(353835);let sj=(0,eh.D)(()=>({isUploading:!1,isDisabled:!1}));async function sO(){let e=await nc.A.fileManager.getLogPath();nc.A.fileManager.showItemInFolder(e)}function sL(e){(0,nW.A)({title:j.intl.string(j.t["7UXEF2"]),subtitle:j.intl.string(j.t.IYPrRl),confirmText:j.intl.string(j.t.BddRzS),onConfirm:()=>sT.A.setDebugLogging(e)})}async function sD(e){let{onUploadStart:t,onUploadFinish:n}=e;t?.();try{let e,t;await iq.Ay.getMediaEngine().writeAudioDebugState(),await sv.A.submitLiveCrashReport({message:{message:"User Live Dump"}}),await (0,sb.a)(A.Umv.RTC),e=j.intl.string(j.t["fKBB8+"]),t=j.intl.string(j.t.BvyxE7),(0,sI.A)({title:e,subtitle:t})}catch(s){var i;let e,t,n,l;i=s.displayMessage,e=j.intl.string(j.t.QZg0J7),t=i??j.intl.string(j.t.VzHcSm),n=(0,sy.B1)(sy.iy.DEBUG_LOG_UPLOAD_FAILED)?.errorCode,l=j.intl.formatToPlainString(j.t.ejOT95,{errorCode:n}),(0,ln.openModal)(n=>(0,c.jsx)(sN.a,{header:e,confirmButtonColor:s_.$n.Colors.BRAND,confirmText:j.intl.string(j.t.BddRzS),...n,children:(0,c.jsxs)("div",{style:{display:"flex",flexDirection:"column",height:"100%"},children:[(0,c.jsx)(z.E,{variant:"text-md/normal",children:t}),(0,c.jsx)(z.E,{variant:"text-sm/semibold",selectable:!0,style:{marginTop:"auto"},children:l})]})}))}finally{n?.()}}async function sR(){await sD({onUploadStart:()=>sj.setState({isUploading:!0}),onUploadFinish:()=>sj.setState({isUploading:!1,isDisabled:!0})})}let sP=(0,a.E2)(o.X.VOICE_AND_VIDEO_DEBUG_LOGGING,{useSearchTerms:()=>[j.intl.string(j.t["726JHL"]),j.intl.string(j.t.EbwFfR),j.intl.string(j.t.nuPtYi)],usePredicate:function(){let e=(0,m.bG)([iq.Ay],()=>iq.Ay.supports(lD.O5.DEBUG_LOGGING));return no.Av&&e&&null!=nc.A.fileManager.readLogFiles},Component:function(){let e=(0,m.bG)([iq.Ay],()=>iq.Ay.getDebugLogging()),t=sj.useField("isUploading"),n=sj.useField("isDisabled"),i=g.useId();return(0,c.jsxs)("fieldset",{children:[(0,c.jsx)(i8.A,{tag:"legend",id:i,children:j.intl.string(j.t["FjN+et"])}),(0,c.jsxs)(F.B,{direction:"vertical",gap:4,children:[(0,c.jsx)(tK.d,{label:j.intl.string(j.t["726JHL"]),description:j.intl.string(j.t["/7ak9Q"]),checked:e,onChange:sL}),(0,c.jsx)("div",{role:"group","aria-labelledby":i,children:(0,c.jsxs)(sC.e,{children:[(0,c.jsx)(p.$,{variant:"secondary",text:j.intl.string(j.t.EbwFfR),onClick:sR,loading:t,disabled:n,"aria-label":j.intl.string(j.t.aY1OH2)}),(0,c.jsx)(p.$,{variant:"secondary",text:j.intl.string(j.t.nuPtYi),onClick:sO,"aria-label":j.intl.string(j.t["L/hFOe"])})]})})]})]})}});var sG=n(233545),sM=n(412780);function sU(){return(0,m.bG)([l1.default,iq.Ay],()=>{let e=l1.default.getCurrentUser(),t=e?.isStaff()??!1,n="canary"===lB.Ay.releaseChannel||"development"===lB.Ay.releaseChannel,i=iq.Ay.supports(lD.O5.CONNECTION_REPLAY);return t&&n&&i})}let sV=(0,a.zD)(o.X.VOICE_AND_VIDEO_RECORD_CONNECTION_REPLAY,{useTitle:()=>j.intl.string(j.t.U4FgFK),useSubtitle:()=>j.intl.string(j.t.Lm72RU),useValue:function(){return(0,m.bG)([sM.Ay],()=>sM.Ay.shouldRecordNextConnection())},setValue:sG.Et,usePredicate:sU}),sk=(0,a.Tf)(o.X.VOICE_AND_VIDEO_OPEN_CONNECTION_REPLAY,{useTitle:()=>j.intl.string(j.t.nJnOHO),useLabel:()=>j.intl.string(j.t["3xjX0U"]),onClick:sG.YW,usePredicate:sU});var sw=n(926919),sF=n(111162),sB=n(855302);let sz=(0,a.zD)(o.X.VOICE_AND_VIDEO_STREAM_INFO_OVERLAY,{useTitle:()=>j.intl.string(j.t["0CEP6e"]),useSubtitle:()=>j.intl.string(j.t["kBXuW+"]),useValue:function(){return(0,m.bG)([sF.default],()=>sF.default.isStreamInfoOverlayEnabled)},setValue:function(e){let t=sF.default.isStreamInfoOverlayEnabled;(0,sB.A)("stream_info_overlay_enabled",e,t),(0,sw.x)({isStreamInfoOverlayEnabled:e})},usePredicate:function(){return v.Q_.useSetting()}}),sX=(0,a.bd)(o.X.VOICE_AND_VIDEO_DIAGNOSTICS_ACCORDION,{useTitle:e=>e?j.intl.string(j.t["/B4I8H"]):j.intl.string(j.t.BTlsWH),useCollapsedSubtitle:()=>j.intl.string(j.t.la1Ys4),buildLayout:()=>[sz,sf,sV,sk,sP]});function sY(e,t,n){(0,nW.A)({title:e,subtitle:t,confirmText:j.intl.string(j.t.BddRzS),onConfirm:n})}let sH=(0,a.Tf)(o.X.VOICE_AND_VIDEO_RESET_ALL_SETTINGS,{useTitle:()=>j.intl.string(j.t.SXfv1v),useSubtitle:()=>j.intl.string(j.t["buA5/q"]),useLabel:()=>j.intl.string(j.t.yBZMsQ),onClick:function(){sY(j.intl.string(j.t["4iKQ/3"]),j.intl.string(j.t.sQ42iT),sT.A.reset)},useVariant:()=>"critical-secondary"}),sK=(0,a.zZ)(o.X.VOICE_AND_VIDEO_DIAGNOSTICS_CATEGORY,{useTitle:()=>j.intl.string(j.t.UDAU9K),buildLayout:()=>[sp,sX,sH]});var sW=n(736056),sZ=n(360729),sq=n(446243),sQ=n(558076),sJ=n(662731);let s$=(0,a.zD)(o.X.GUILD_ROOMS_REMEMBER_LAST_VIEW_SETTING,{useTitle:()=>j.intl.string(sJ.default.qYzpsI),useSubtitle:()=>j.intl.string(sJ.default["+vMoL1"]),useValue:()=>(0,m.bG)([sQ.A],()=>sQ.A.getRememberVideoOverlayVisibility()),setValue:e=>(0,sq.Ft)(e)}),s0=(0,a.zZ)(o.X.GUILD_ROOMS_CATEGORY,{useTitle:()=>j.intl.string(sJ.default.wRLmM0),usePredicate:function(){let e=(0,m.yK)([lc.A],()=>lc.A.getGuildIds()),{loaded:t,override:n}=(0,m.cf)([sW.A],()=>({loaded:sW.A.getLoadedGuildExperiment(sZ.v),override:sW.A.getExperimentOverrideDescriptor(sZ.v)}));return(0,g.useMemo)(()=>(null!=t||null!=n)&&e.some(e=>sZ.A.getCurrentConfig({guildId:e,location:"useHasGuildRoomsEligibleGuild"},{autoTrackExposure:!1}).enabled),[e,t,n])},buildLayout:()=>[s$]});var s1=n(347481),s2=n(852712);let s3=(0,a.zD)(o.X.VOICE_AUTOMATIC_GAIN_CONTROL_SETTING,{useTitle:()=>j.intl.string(j.t.cUMdH0),useSubtitle:()=>j.intl.string(j.t["6EjbvA"]),useValue:function(){return(0,m.bG)([iq.Ay],()=>iq.Ay.getAutomaticGainControl())},setValue:function(e){sT.A.setAutomaticGainControl(e,{page:A.liQ.USER_SETTINGS,section:A.JJy.SETTINGS_VOICE_AND_VIDEO})},useDisabled:function(){return(0,m.bG)([iq.Ay,s1.A],()=>{let e=iq.Ay.getInputDeviceId();return s1.A.hasAutomaticGainControl(e)})},usePredicate:function(){return(0,m.bG)([iq.Ay],()=>iq.Ay.isAutomaticGainControlSupported()&&iq.Ay.isInputProfileCustom())}}),s5=(0,a.sN)(o.X.VOICE_GLOBAL_ATTENUATION_SLIDER,{useTitle:()=>j.intl.string(j.t.AlybXj),setValue:e=>sT.A.setAttenuation(e,iq.Ay.getAttenuateWhileSpeakingSelf(),iq.Ay.getAttenuateWhileSpeakingOthers()),minValue:0,maxValue:100,getInitialValue:()=>iq.Ay.getAttenuation()}),s6=(0,a.zD)(o.X.VOICE_GLOBAL_ATTENUATION_FOR_SELF_SETTING,{useTitle:()=>j.intl.string(j.t["9dHxRY"]),useValue:()=>(0,m.bG)([iq.Ay],()=>iq.Ay.getAttenuateWhileSpeakingSelf()),setValue:e=>sT.A.setAttenuation(iq.Ay.getAttenuation(),e,iq.Ay.getAttenuateWhileSpeakingOthers())}),s4=(0,a.zD)(o.X.VOICE_GLOBAL_ATTENUATION_FOR_OTHERS_SETTING,{useTitle:()=>j.intl.string(j.t.SMt0Gr),useValue:()=>(0,m.bG)([iq.Ay],()=>iq.Ay.getAttenuateWhileSpeakingOthers()),setValue:e=>sT.A.setAttenuation(iq.Ay.getAttenuation(),iq.Ay.getAttenuateWhileSpeakingSelf(),e)}),s8=(0,a.FW)(o.X.VOICE_GLOBAL_ATTENUATION_FIELD_SET,{variant:"compact",useTitle:()=>j.intl.string(j.t.oSdBvW),useSubtitle:()=>j.intl.string(j.t["0A/8Rt"]),usePredicate:()=>(0,m.bG)([iq.Ay],()=>iq.Ay.supports(lD.O5.ATTENUATION)),buildLayout:()=>[s5,s6,s4]});var s7=n(801644);let s9=(0,a.zD)(o.X.VOICE_HARDWARE_MUTE_SILENCE_ALERT_SETTING,{useTitle:()=>j.intl.string(j.t.pZ0vr4),useSubtitle:()=>j.intl.string(j.t.tVbzoZ),useValue:function(){return(0,m.bG)([eu.Ay],()=>!eu.Ay.disableHardwareMuteSilenceAlert)},setValue:function(e){(0,sB.A)("hardware_mute_silence_alert_enabled",e,!eu.Ay.disableHardwareMuteSilenceAlert),t7.Ay.updatedUnsyncedSettings({disableHardwareMuteSilenceAlert:!e})},usePredicate:function(){let{enableHardwareSilenceWarning:e}=s7.A.useConfig({location:"HardwareMuteSilenceAlertSetting"});return e}}),re=(0,a.zD)(o.X.VOICE_BYPASS_SYSTEM_INPUT_PROCESSING_SETTING,{useTitle:()=>j.intl.string(j.t.DFPXIG),useSubtitle:()=>j.intl.string(j.t["UyRX+C"]),useValue:function(){return(0,m.bG)([iq.Ay],()=>iq.Ay.getBypassSystemInputProcessing())},setValue:function(e){sT.A.setBypassSystemInputProcessing(e)},usePredicate:function(){return(0,m.bG)([iq.Ay],()=>iq.Ay.showBypassSystemInputProcessing()&&iq.Ay.isInputProfileCustom())}}),rt=(0,a.zD)(o.X.VOICE_SWITCH_CHANNEL_ALERT_SETTING,{useTitle:()=>j.intl.string(j.t.jrWHD3),useSubtitle:()=>j.intl.string(j.t.YCCMkJ),useValue:function(){return(0,m.bG)([eu.Ay],()=>!eu.Ay.disableVoiceChannelChangeAlert)},setValue:function(e){(0,sB.A)("switch_channel_warning_enabled",e,!eu.Ay.disableVoiceChannelChangeAlert),t7.Ay.updatedUnsyncedSettings({disableVoiceChannelChangeAlert:!e})}}),rn=(0,a.zD)(o.X.ADVANCED_VOICE_ACTIVITY_PROCESSING_SETTING,{useTitle:()=>j.intl.string(j.t.BbESsg),useSubtitle:()=>j.intl.string(j.t.LoOB1F),useValue:function(){return(0,m.bG)([iq.Ay],()=>{let{vadUseKrisp:e}=iq.Ay.getModeOptions();return e})},setValue:function(e){let t=iq.Ay.getMode();sT.A.setMode(t,{vadUseKrisp:e})},useDisabled:function(){return(0,m.bG)([iq.Ay],()=>iq.Ay.getMode()!==A.TBI.VOICE_ACTIVITY||!iq.Ay.getModeOptions().autoThreshold)},usePredicate:function(){return(0,m.bG)([iq.Ay],()=>iq.Ay.isAdvancedVoiceActivitySupported()&&iq.Ay.isInputProfileCustom())}}),ri=(0,a.Hn)(o.X.VOICE_AUDIO_SUBSYSTEM_SETTING,{useTitle:()=>j.intl.string(j.t.wVBHr0),useValue:function(){return(0,m.bG)([iq.Ay],()=>iq.Ay.getAudioSubsystem())},setValue:function(e){sY(j.intl.string(j.t.uY7AcQ),j.intl.string(j.t.gBqik6),()=>sT.A.setAudioSubsystem(e))},useOptions:function(){let{legacyAudioSubsystemSupported:e,experimentalAudioSubsystemSupported:t,automaticAudioSubsystemSupported:n}=(0,m.cf)([iq.Ay],()=>({legacyAudioSubsystemSupported:iq.Ay.supports(lD.O5.LEGACY_AUDIO_SUBSYSTEM),experimentalAudioSubsystemSupported:iq.Ay.supports(lD.O5.EXPERIMENTAL_AUDIO_SUBSYSTEM),automaticAudioSubsystemSupported:iq.Ay.supports(lD.O5.AUTOMATIC_AUDIO_SUBSYSTEM)}));return g.useMemo(()=>{let i;return i=[{id:lD.rB.STANDARD,value:lD.rB.STANDARD,label:j.intl.string(j.t.dqb2JZ)}],e&&i.push({id:lD.rB.LEGACY,value:lD.rB.LEGACY,label:j.intl.string(j.t["TYfH+5"])}),t&&i.push({id:lD.rB.EXPERIMENTAL,value:lD.rB.EXPERIMENTAL,label:j.intl.string(j.t.liQmtr)}),n&&i.push({id:lD.rB.AUTOMATIC,value:lD.rB.AUTOMATIC,label:j.intl.string(j.t.qNgtO1)}),i},[n,t,e])},usePredicate:function(){return(0,m.bG)([iq.Ay],()=>iq.Ay.shouldOfferManualSubsystemSelection())}}),rl=(0,a.zD)(o.X.VOICE_QUALITY_OF_SERVICE_SETTING,{useTitle:()=>j.intl.string(j.t.uancuJ),useSubtitle:()=>j.intl.string(j.t.I1Eoqq),useValue:function(){return(0,m.bG)([iq.Ay],()=>iq.Ay.getQoS())},setValue:function(e){sT.A.setQoS(e)},usePredicate:function(){return(0,m.bG)([iq.Ay],()=>iq.Ay.supports(lD.O5.QOS))}}),rs=(0,a.zD)(o.X.VOICE_SILENCE_WARNING_SETTING,{useTitle:()=>j.intl.string(j.t["4rsOPQ"]),useSubtitle:()=>j.intl.string(j.t.jtiiCw),useValue:function(){return(0,m.bG)([iq.Ay],()=>iq.Ay.getEnableSilenceWarning())},setValue:function(e){sT.A.setSilenceWarning(e)},usePredicate:function(){return eW.isPlatformEmbedded}}),rr=(0,a.bd)(o.X.INPUT_PROFILE_VOICE_ADVANCED_ACCORDION,{useTitle:function(e){return e?j.intl.string(j.t.KHsSWK):j.intl.string(j.t.PPDo5V)},useCollapsedSubtitle:()=>tc(o.X.INPUT_PROFILE_VOICE_ADVANCED_ACCORDION,{limit:(0,m.bG)([iq.Ay],()=>iq.Ay.isInputProfileCustom())?3:2}),buildLayout:()=>[s3,rn,re,rs,s9,rt,s8,ri,rl]}),ra=(0,a.zD)(o.X.VOICE_ECHO_CANCELLATION_SETTING,{useTitle:()=>j.intl.string(j.t.iWTwu6),useValue:function(){return(0,m.bG)([iq.Ay],()=>iq.Ay.getEchoCancellation())},setValue:function(e){sT.A.setEchoCancellation(e,{page:A.liQ.USER_SETTINGS,section:A.JJy.SETTINGS_VOICE_AND_VIDEO})},useDisabled:function(){return(0,m.bG)([iq.Ay,s1.A],()=>{let e=iq.Ay.getInputDeviceId();return s1.A.hasEchoCancellation(e)})},usePredicate:function(){return(0,m.bG)([iq.Ay],()=>iq.Ay.isInputProfileCustom())}});var ro=n(459838),ru=n(451988),rd=n(934246),rc=n(300839);let rg=(0,tU.Ld)();function rm(e){let{isSpeaking:t,className:n,id:i,ariaDescribedBy:l,ariaLabelledBy:s,disabled:r}=e;return(0,c.jsx)("div",{role:"meter",className:ie()(rd.$I,n),id:i,"aria-describedby":l,"aria-labelledby":s,"aria-valuenow":t&&!r?100:0,"aria-valuemin":0,"aria-valuemax":100,"aria-valuetext":t&&!r?j.intl.string(j.t.haLKZ0):j.intl.string(j.t.X2hJL7),children:(0,c.jsx)("div",{className:ie()(rd.Jx,rd.NU,{[rd.zY]:t&&!r,[rd.r9]:r})})})}function rA(e){let{volume:t,id:n,ariaDescribedBy:i,ariaLabelledBy:l,disabled:s}=e,{threshold:r,autoThreshold:a}=(0,m.cf)([iq.Ay],()=>({threshold:iq.Ay.getModeOptions().threshold,autoThreshold:iq.Ay.getModeOptions().autoThreshold})),o=(0,m.bG)([iq.Ay],()=>iq.Ay.getMode());return(0,c.jsx)("section",{className:ie()(rd.Mo,rd.jW),id:n,"aria-describedby":i,"aria-labelledby":l,children:(0,c.jsx)(B.A,{initialValue:r+100,onValueRender:e=>`${(-((100-e)*1)).toFixed(0)}dB`,onValueChange:e=>{var t;return t=-((100-e)*1),void sT.A.setMode(o,{threshold:t,autoThreshold:a})},barStyles:{background:nK.A.unsafe_rawColors.GREEN_360.css},fillStyles:{background:nK.A.unsafe_rawColors.YELLOW_300.css},"aria-labelledby":rg,disabled:s,children:(0,c.jsxs)("div",{className:ie()(rd.NU,rd.TL,rd.Jx,rc.bar),children:[(0,c.jsx)("div",{className:ie()(rd.GS,rd.SH),style:{width:s?0:t+100+"%"}}),(0,c.jsx)("div",{className:"grow"})]})})})}let rh=(0,a.E2)(o.X.VOICE_INPUT_SENSITIVITY_FIELD_SET,{useSearchTerms:()=>[j.intl.string(j.t["sqUm+k"]),j.intl.string(j.t.I1Zuq0),j.intl.string(j.t.nuFtHH)],usePredicate:()=>(0,m.bG)([iq.Ay],()=>iq.Ay.isInputProfileCustom()),Component:function(){let{autoThreshold:e,disabled:t}=(0,m.cf)([iq.Ay],()=>({autoThreshold:iq.Ay.getModeOptions().autoThreshold,disabled:iq.Ay.getMode()!==lD.TB.VOICE_ACTIVITY})),n=g.useCallback(e=>{let t=iq.Ay.getMode(),{threshold:n}=iq.Ay.getModeOptions();sT.A.setMode(t,{autoThreshold:e,threshold:n})},[]),i=(0,m.bG)([iq.Ay],()=>iq.Ay.supports(lD.O5.AUTOMATIC_VAD)),{volume:l,isSpeaking:s}=function(){let[e,t]=g.useState(-100),[n,i]=g.useState(!1);function l(e,n){t(e),i((n&lD.ME.VOICE)===lD.ME.VOICE)}return g.useEffect(()=>{let e=new ru.Ep;return e.start(1e3,()=>{iq.Ay.getMediaEngine().on(ro.bg.VoiceActivity,l),e.stop()}),()=>{iq.Ay.getMediaEngine().removeListener(ro.bg.VoiceActivity,l),e.stop()}},[]),{volume:e,isSpeaking:n}}(),r=(0,m.bG)([iq.Ay],()=>iq.Ay.isEnabled()),a=g.useMemo(()=>!r&&(0,c.jsx)("div",{className:rd.B4,children:(0,c.jsx)(iV.w,{type:"warning",children:j.intl.format(j.t["O13I+O"],{onEnableClick:()=>sT.A.enable(!0)})})}),[r]),o=g.useMemo(()=>e?j.intl.string(j.t.JsbzjA):j.intl.string(j.t.MLmyMY),[e]),u=g.useId(),d=g.useId();return i?(0,c.jsxs)("fieldset",{"aria-describedby":d,children:[(0,c.jsx)(i8.A,{tag:"legend",id:u,children:j.intl.string(j.t.GByLar)}),(0,c.jsx)(i8.A,{id:d,children:o}),(0,c.jsxs)(F.B,{direction:"vertical",gap:8,children:[(0,c.jsx)(tK.d,{disabled:t,label:j.intl.string(j.t.lY6j47),description:o,checked:e,onChange:n}),e?(0,c.jsx)(rm,{isSpeaking:s,className:rd.UJ,ariaDescribedBy:d,ariaLabelledBy:u,disabled:t}):(0,c.jsx)(rA,{volume:l,ariaDescribedBy:d,ariaLabelledBy:u,disabled:t}),a]})]}):(0,c.jsxs)(F.B,{direction:"vertical",gap:8,children:[(0,c.jsx)(tH.D,{label:j.intl.string(j.t["sqUm+k"]),description:o,layout:"vertical",children:n=>e?(0,c.jsx)(rm,{isSpeaking:s,className:rd.UJ,id:n.controlId,ariaDescribedBy:n.describedById,ariaLabelledBy:n.labelId,disabled:t}):(0,c.jsx)(rA,{volume:l,id:n.controlId,ariaDescribedBy:n.describedById,ariaLabelledBy:n.labelId,disabled:t})}),a]})}});var rE=n(366010);let rS=n(993830),rx=n(413142),rT={page:A.liQ.USER_SETTINGS,section:A.JJy.SETTINGS_VOICE_AND_VIDEO};function rp(){let e=(0,m.bG)([nR.A],()=>(0,rE.q)(nR.A.theme));return(0,c.jsx)("img",{src:e?rS:rx,width:48,height:32,alt:""})}let rf=(0,a.E2)(o.X.VOICE_NOISE_SUPPRESSION_SETTING,{useSearchTerms:()=>[j.intl.string(j.t.t8Qhib),j.intl.string(j.t.hmfkCi)],usePredicate:function(){return(0,m.bG)([iq.Ay],()=>iq.Ay.isInputProfileCustom()&&iq.Ay.isNoiseSuppressionSupported())},Component:function(){let e=g.useCallback(e=>{sT.A.setNoiseCancellation("KRISP"===e,rT),sT.A.setNoiseSuppression("STANDARD"===e,rT)},[]),{noiseCancellation:t,noiseSuppression:n,isNoiseSuppressionSupported:i,isNoiseCancellationSupported:l}=(0,m.cf)([iq.Ay],()=>({noiseCancellation:iq.Ay.getNoiseCancellation(),noiseSuppression:iq.Ay.getNoiseSuppression(),isNoiseSuppressionSupported:iq.Ay.isNoiseSuppressionSupported(),isNoiseCancellationSupported:iq.Ay.isNoiseCancellationSupported()})),s=g.useMemo(()=>{let e=[];return l&&e.push({id:"krisp",label:j.intl.string(j.t.rdoNzt),value:"KRISP"}),i&&e.push({id:"standard",label:j.intl.string(j.t.qXeYHw),value:"STANDARD"}),e.push({id:"disabled",label:j.intl.string(j.t.wkYAlz),value:"NONE"}),e},[l,i]),r=l?j.intl.format(j.t["1q5aTp"],{helpArticle:eS.A.getArticleURL(A.MVz.NOISE_SUPPRESSION)}):j.intl.string(j.t.OWKjw5);return(0,c.jsxs)(F.B,{direction:"vertical",gap:0,children:[(0,c.jsx)(i3.l,{label:j.intl.string(j.t.t8Qhib),description:r,layout:"horizontal",value:t?"KRISP":n?"STANDARD":"NONE",onSelectionChange:e,options:s,selectionMode:"single",fullWidth:!0}),l&&(0,c.jsx)(rp,{})]})}});var rI=n(934729),r_=n(621380);let rN=!no.Av;function rC(){return(0,m.bG)([iq.Ay],()=>iq.Ay.getMode()===lD.TB.PUSH_TO_TALK)}let rb=(0,a.zD)(o.X.VOICE_PUSH_TO_TALK_SETTING,{useTitle:function(){return no.Av?j.intl.string(j.t.tG4Np5):j.intl.string(j.t.JMyQin)},useSubtitle:function(){let e=(0,m.bG)([iq.Ay],()=>iq.Ay.getMode());return g.useMemo(()=>{if(!no.Av&&e===lD.TB.PUSH_TO_TALK)return j.intl.format(j.t["VHI4+Y"],{onDownloadClick:()=>(0,rI._)("Help Text PTT")})},[e])},usePredicate:function(){return(0,m.bG)([iq.Ay],()=>iq.Ay.getActiveInputProfile()!==r_.m.STUDIO)},useValue:function(){return(0,m.bG)([iq.Ay],()=>iq.Ay.getMode()===lD.TB.PUSH_TO_TALK)},setValue:function(e){var t,i;t=e?lD.TB.PUSH_TO_TALK:lD.TB.VOICE_ACTIVITY,i=[tv.A.USER_SETTINGS_VOICE_AND_VIDEO],t===lD.TB.PUSH_TO_TALK&&rN&&(0,ln.openModalLazy)(async()=>{let{default:e}=await Promise.all([n.e("74558"),n.e("10919")]).then(n.bind(n,556506));return t=>(0,c.jsx)(e,{title:j.intl.string(j.t.Kdt0Gb),confirmText:j.intl.string(j.t["1WjMbC"]),cancelText:j.intl.string(j.t.BddRzS),onConfirm:()=>(0,rI._)("PTT Limited Modal"),body:j.intl.string(j.t.NIozvt),...t})}),sT.A.setMode(t,void 0,void 0,{analyticsLocations:i})},useSearchTerms:()=>[j.intl.string(j.t["pS+K2L"]),j.intl.string(j.t.nuFtHH)]});var ry=n(297932);let rv=(0,a.E2)(o.X.VOICE_PUSH_TO_TALK_KEYBIND_SETTING,{useSearchTerms:()=>[j.intl.string(j.t["pS+K2L"]),j.intl.string(j.t.nuFtHH)],usePredicate:rC,Component:function(){let e=(0,m.bG)([iq.Ay],()=>{let{shortcut:e}=iq.Ay.getModeOptions();return e}),t=j.intl.format(j.t.HVvn5T,{onClick:()=>(0,t9.openUserSettings)(o.X.SYSTEM_CUSTOM_KEYBINDS_CATEGORY)});return(0,c.jsx)(tH.D,{label:j.intl.string(j.t["o+BJQR"]),description:t,layout:"horizontal-responsive",children:(0,c.jsx)("div",{className:ry.e,children:(0,c.jsx)(i9.A,{defaultValue:e,onChange:e=>sT.A.setMode(A.TBI.PUSH_TO_TALK,{shortcut:e})})})})}}),rj=(0,a.sN)(o.X.VOICE_PUSH_TO_TALK_RELEASE_DELAY_SETTING,{useTitle:()=>j.intl.string(j.t.GCNMM8),useSearchTerms:()=>[j.intl.string(j.t["pS+K2L"]),j.intl.string(j.t.nuFtHH)],setValue:function(e){sT.A.setMode(A.TBI.PUSH_TO_TALK,{delay:e})},minValue:0,maxValue:A.IjB,getInitialValue:function(){let{delay:e}=iq.Ay.getModeOptions();return e},onValueRender:function(e){return e>=1e3?(e/=1e3,`${e.toFixed(2)}s`):`${e.toFixed(0)}\u00A0ms`},usePredicate:rC});var rO=n(957658),rL=n(329139);let rD=(0,a.zD)(o.X.VOICE_SPATIAL_AUDIO_SETTING,{useTitle:()=>j.intl.string(rL.default.LGDPhA),useValue:function(){return(0,m.bG)([iq.Ay],()=>iq.Ay.isSpatialAudioEnabled())},setValue:function(e){sT.A.setSpatialAudio(e,[tv.A.USER_SETTINGS_VOICE_AND_VIDEO])},usePredicate:function(){return(0,rO.A)("VoiceSettings")}}),rR=(0,a.Qx)(o.X.VOICE_INPUT_PROFILE_SETTING,{useTitle:()=>j.intl.string(j.t.LM3U3k),usePredicate:function(){let{enabledInputProfiles:e}=(0,s2._)({location:"SettingsRendererConfig"});return e.length>0},useSearchTerms:()=>[j.intl.string(j.t.nuFtHH),j.intl.string(j.t.VZPR0R),j.intl.string(j.t.cjPbpT)],useValue:function(){return(0,m.bG)([iq.Ay],()=>iq.Ay.getActiveInputProfile()??r_.m.CUSTOM)},setValue:function(e){let t=[tv.A.USER_SETTINGS_VOICE_AND_VIDEO];sT.A.setActiveInputProfile(e,{analyticsLocations:t})},useOptions:function(){let{enabledInputProfiles:e}=(0,s2.d)({location:"InputProfileCategory"});return[{value:r_.m.VOICE_ISOLATION,name:j.intl.string(j.t.cjPbpT),desc:j.intl.string(j.t.CzhvnE)},{value:r_.m.STUDIO,name:j.intl.string(j.t.VZPR0R),desc:j.intl.string(j.t.ZaJksS)},{value:r_.m.CUSTOM,name:j.intl.string(j.t["N/PQjv"]),desc:j.intl.string(j.t.SnBmuY)}].filter(t=>{let{value:n}=t;return e.includes(n)})}}),rP=(0,a.zZ)(o.X.VOICE_INPUT_PROFILE_CATEGORY,{useInlineNotice:function(){let e=(0,m.bG)([s1.A,iq.Ay],()=>{let e=iq.Ay.getInputDeviceId();return(s1.A.hasEchoCancellation(e)||s1.A.hasNoiseSuppression(e)||s1.A.hasAutomaticGainControl(e))&&iq.Ay.isInputProfileCustom()});return g.useMemo(()=>{if(e)return{type:d.lT.INLINE_NOTICE,noticeType:"info",text:j.intl.string(j.t["/Whuzi"])}},[e])},buildLayout:()=>[rR,rh,rf,ra,rD,rb,rv,rj,rr]});var rG=n(403581),rM=n(512950),rU=n(983851),rV=n(687021),rk=n(128450),rw=n(796774),rF=n(209932),rB=n(813564),rz=n(984813),rX=n(922016),rY=n(305866),rH=n(22231),rK=n(158045),rW=n(792348),rZ=n(674168),rq=n(484036),rQ=n(805945),rJ=n(199300);function r$(e){let{onSelect:t}=e,[n,i]=g.useState(!1),l=(0,m.bG)([l1.default],()=>l1.default.getCurrentUser()),s=rK.Ay.canUseCustomCallSounds(l),r=g.useRef(null);function a(e){s&&(i(!1),t?.(e))}return(0,c.jsx)(rX.Y,{targetElementRef:r,shouldShow:n,position:"left",onRequestClose:()=>i(!1),renderPopout:e=>{let{closePopout:t}=e;return(0,c.jsx)(rY.l,{children:(0,c.jsx)(rq.A,{suppressPlaySound:!0,shouldShowLockedSounds:!1,guildId:null,channel:null,onClose:t,onSelect:a,gridNotice:s?null:(0,c.jsx)(rZ.m,{}),analyticsSource:"call sounds edit setting"})})},children:e=>(0,c.jsx)(rQ.dT,{...e,ref:r,onClick:()=>{i(!n)},text:j.intl.string(j.t.uOe0Az),children:(0,c.jsx)(rH.R,{size:"md",color:"currentColor",className:rJ.Wo})})})}function r0(e){let{sound:t}=e,{previewSound:n}=(0,rW.A)(t,null),i=0===(0,rB.wH)()?j.intl.string(j.t.OASXjt):j.intl.formatToPlainString(j.t["/8fYO5"],{emojiName:t.emojiName,soundName:t.name});return(0,c.jsx)(rQ.dT,{onClick:n,text:i,children:(0,c.jsx)(rU.H,{size:"md",color:"currentColor",className:rJ.wg})})}function r1(e){let{sound:t,isGlobal:n,onSelect:i}=e,l=null!=t,s=t?.emojiId,r=t?.emojiName,a=l&&(null!=r||null!=s);return(0,c.jsxs)("div",{className:rJ.D6,children:[(0,c.jsxs)("div",{className:rJ.kL,children:[a&&(0,c.jsx)(tN.A,{emojiId:s,emojiName:r,className:rJ.Zg}),(0,c.jsx)(z.E,{variant:"text-md/normal",color:"text-strong",className:rJ.dj,children:null==t?j.intl.string(j.t.PoWNfe):n?j.intl.format(j.t.B6HU6O,{soundName:t.name,subtextHook:function(e){return(0,c.jsx)(z.E,{variant:"text-xs/medium",color:"text-default",tag:"span",children:e})}}):t.name}),l?(0,c.jsx)(r0,{sound:t}):(0,c.jsx)(rU.H,{size:"md",color:"currentColor",className:rJ.Gk})]}),(0,c.jsxs)("div",{className:rJ.kL,children:[(0,c.jsx)(r$,{onSelect:i}),l&&!n&&(0,c.jsx)(rQ.dT,{onClick:()=>i(null),text:j.intl.string(j.t.jmtcGA),children:(0,c.jsx)(i6.u,{size:"md",color:nK.A.unsafe_rawColors.RED_400.css,className:rJ.Wo})})]})]})}var r2=n(617617);n(980504);var r3=n(907895);function r5(e){return(0,m.bG)([rF.A],()=>{if(null==e)return null;let{guildId:t,soundId:n}=e;return rF.A.getSound("0"===t?"0":t,n)})}function r6(e){let{guildId:t}=e,n=(0,m.bG)([r2.A],()=>r2.A.settings.guilds?.guilds?.[t]?.joinSound),i=r5(n);if(null==n||null==i)return null;let{emojiId:l,emojiName:s}=i,r=null!=l||null!=s;return(0,c.jsxs)("div",{className:r3.Io,children:[r?(0,c.jsx)(tN.A,{emojiId:l,emojiName:s,className:r3.nW}):(0,c.jsx)(rU.H,{size:"md",color:"currentColor",className:r3.nW}),(0,c.jsx)(z.E,{className:r3.dK,variant:"text-xs/medium",children:i.name})]})}let r4=(0,a.E2)(o.X.ENTRANCE_SOUNDS_SETTING,{useSearchTerms:()=>[j.intl.string(j.t.nzUc3B)],Component:function(){let{analyticsLocations:e}=(0,eL.Ay)(),[t,n]=g.useState("0"),i=(0,rz.mz)(t),l=r5(i),s=i?.type===rz.PP.GLOBAL,r=(0,m.bG)([rF.A],()=>rF.A.hasFetchedAllSounds())&&null!=i&&null==l;g.useEffect(()=>{r&&(0,rB.ND)({location:e})},[r,e]),g.useEffect(()=>{(0,rw.E7)()},[]);let a=g.useCallback((e,t)=>{let{inDropdown:n}=t;return null==e?null:n?(0,c.jsx)(r6,{guildId:e.value}):null},[]);return(0,c.jsxs)(nZ.n,{label:j.intl.string(j.t.nzUc3B),description:j.intl.format(j.t.u9RWmv,{helpdeskArticle:eS.A.getArticleURL(A.MVz.SOUNDBOARD)}),children:[(0,c.jsx)(rV.A,{guildId:t,className:r3.Dt,globalOption:{label:j.intl.string(j.t["CpEUP/"]),value:"0"},onChange:e=>{n(null==e?"0":e.id)},renderOptionSuffix:a,hideDivider:!0}),(0,c.jsxs)(rk.A,{title:j.intl.format(j.t.I2TsYN,{nitroWheelHook:()=>(0,c.jsx)(rG.t,{size:"md",color:"currentColor",className:r3.ax})}),children:[(0,c.jsx)(r1,{sound:l,isGlobal:s,onSelect:n=>{null==n?(0,rB.Dv)(t,e):(0,rB.un)(t,n,e)}}),r&&(0,c.jsx)(rM.p,{className:r3.lm,messageType:rM.Y.WARNING,children:j.intl.string(j.t.WkPsFR)})]})]})}});var r8=n(824744);let r7=(0,a.sN)(o.X.SOUNDBOARD_VOLUME_SETTING,{useTitle:()=>j.intl.string(j.t.kbFsAD),useSubtitle:()=>j.intl.format(j.t.BPbGq7,{helpCenterArticle:eS.A.getArticleURL(A.MVz.SOUNDBOARD)}),setValue:function(e){let t=[tv.A.USER_SETTINGS_VOICE_AND_VIDEO],n=(0,r8.w)(e);(0,rw.iy)(n,t)},minValue:0,maxValue:100,getInitialValue:function(){let e=(0,rB.wH)();return(0,r8.M)(e)},onValueRender:function(e){return`${e.toFixed(0)}%`}});var r9=n(864145);let ae=(0,a.sN)(o.X.SOUNDMOJI_VOLUME_SETTING,{useTitle:()=>j.intl.string(j.t["2JbvKw"]),useSubtitle:()=>j.intl.string(j.t.INenzY),setValue:function(e){let t=(0,r8.w)(e);v.HO.updateSetting(t)},minValue:0,maxValue:100,getInitialValue:function(){let e=v.HO.getSetting();return(0,r8.M)(e)},onValueRender:function(e){return`${e.toFixed(0)}%`},usePredicate:function(){return(0,r9.X)({location:"SoundmojiVolumeSetting"})}}),at=(0,a.zZ)(o.X.SOUNDBOARD_CATEGORY,{useTitle:()=>j.intl.string(j.t.ABjMWI),buildLayout:()=>[r7,ae,r4]});var an=n(803224),ai=n(552122);let al=(0,a.E2)(o.X.SOUNDS_HOLIDAY_NOTICE,{useSearchTerms:()=>[j.intl.string(j.t.fgSHf8)],usePredicate:()=>null!=ai.A.useHolidaySoundpack(),Component:()=>(0,c.jsx)(z.E,{variant:"text-md/normal",color:"text-subtle",children:j.intl.format(j.t.Eup6Wv,{onClick:()=>(0,t9.openUserSettings)(o.X.NOTIFICATIONS_SOUNDS_CATEGORY)})})}),as=(0,a.AK)(o.X.VOICE_AND_VIDEO_TO_NOTIFICATION_SOUNDS_NAVIGATOR,{useSubtitle:()=>j.intl.string(j.t.eyGEE4),useSearchTerms:()=>[j.intl.string(j.t.eyGEE4)],destinationKey:o.X.NOTIFICATIONS_SOUNDS_CATEGORY}),ar=(0,a.gN)(o.X.VOICE_AND_VIDEO_SOUNDS_RELATED_SETTINGS,{buildLayout:()=>[as]});var aa=n(264686);let ao=(0,eh.D)(()=>({currentPlayingSound:null}));function au(){let e=ao.getField("currentPlayingSound");e?.stop(),ao.setState({currentPlayingSound:null})}function ad(e){let t=ao.getField("currentPlayingSound");t?.stop();let n=(0,n0.Ak)(e);ao.setState({currentPlayingSound:n})}function ac(e){return(0,a.zD)(`${o.X.SOUNDS_LIST_ITEM_PREFIX}${e.sound}`,{useTitle:e.useTitle,useSubtitle:()=>j.intl.format(j.t.OOiGCM,{onClick:()=>ad(e.sound)}),useSearchTerms:e.useSearchTerms,useValue:()=>{let t=(0,m.bG)([an.A],()=>an.A.isSoundDisabled(e.sound)),n=e.useDisabled?.();return!t&&!n},setValue:t=>{let n=an.A.getDisabledSounds().filter(t=>t!==e.sound);t||n.push(e.sound),aa.default.setDisabledSounds(n)},useDisabled:()=>{let t=e.useDisabled?.(),n=(0,m.bG)([an.A],()=>an.A.getDisableAllSounds());return t||n},useDisabledMessage:e.useDisabledMessage})}let ag=[{useTitle:()=>j.intl.string(j.t.hK51Yg),sound:"deafen"},{useTitle:()=>j.intl.string(j.t.XiejaJ),sound:"undeafen"},{useTitle:()=>j.intl.string(j.t.w4m945),sound:"mute"},{useTitle:()=>j.intl.string(j.t.YqAjXy),sound:"unmute"},{useTitle:()=>j.intl.string(j.t.JoTq8n),sound:"camera_on"},{useTitle:()=>j.intl.string(j.t["8P6tQ6"]),sound:"camera_off"},{useTitle:()=>j.intl.string(j.t["juL9/L"]),sound:"disconnect"},{useTitle:()=>j.intl.string(j.t.x98vQq),useSearchTerms:()=>[j.intl.string(j.t.Q8gkVL)],sound:"ptt_start"},{useTitle:()=>j.intl.string(j.t["1HjRqC"]),useSearchTerms:()=>[j.intl.string(j.t.Q8gkVL)],sound:"ptt_stop"},{useTitle:()=>j.intl.string(j.t["9JB1Ck"]),sound:"user_join"},{useTitle:()=>j.intl.string(j.t.KUBBNt),sound:"user_leave"},{useTitle:()=>j.intl.string(j.t.EZjqUT),sound:"user_moved"},{useTitle:()=>j.intl.string(j.t.LnNlQh),sound:"call_calling"},{useTitle:()=>j.intl.string(j.t.Nd8P5y),sound:"stream_started"},{useTitle:()=>j.intl.string(j.t["9bYj+G"]),sound:"stream_ended"},{useTitle:()=>j.intl.string(j.t.KccUI1),sound:"stream_user_joined"},{useTitle:()=>j.intl.string(j.t.dsjkiN),sound:"stream_user_left"},{useTitle:()=>j.intl.string(j.t.nFOcf9),sound:"activity_launch"},{useTitle:()=>j.intl.string(j.t["a6lw/u"]),sound:"activity_end"},{useTitle:()=>j.intl.string(j.t.KaFxrY),sound:"activity_user_join"},{useTitle:()=>j.intl.string(j.t.S14z9n),sound:"activity_user_left"},{useTitle:()=>j.intl.string(j.t.CP3DC3),sound:"reconnect"}],am=(0,a.D1)(o.X.VOICE_AND_VIDEO_SOUNDS_LIST,{collapseAfter:4,useCollapsibleTitle:(e,t)=>e?j.intl.formatToPlainString(j.t["0JYT98"],{count:t}):j.intl.formatToPlainString(j.t.ji1uNt,{count:t}),useCollapsedSubtitle:()=>tc(o.X.VOICE_AND_VIDEO_SOUNDS_LIST,{limit:3}),initialize:function(){return()=>{au()}},buildLayout:()=>ag.map(e=>ac(e))}),aA=(0,a.zZ)(o.X.SOUNDS_CATEGORY,{useTitle:()=>j.intl.string(j.t.MKWyKc),useInlineNotice:function(){let e=(0,m.bG)([an.A],()=>an.A.getDisableAllSounds());return g.useMemo(()=>{if(e)return{type:d.lT.INLINE_NOTICE,noticeType:"warning",text:j.intl.format(j.t.fRvixS,{onClick:()=>(0,t9.openUserSettings)(o.X.NOTIFICATIONS_SOUNDS_CATEGORY)})}},[e])},buildLayout:()=>[am,al,ar]}),ah=(0,a.zD)(o.X.STREAMING_SHOW_STREAM_PREVIEWS,{useTitle:()=>j.intl.string(j.t.e3Zz3F),useSubtitle:()=>j.intl.string(j.t.RztTjP),useValue:function(){return!v.uh.useSetting()},setValue:function(e){(0,sB.A)("stream_previews_disabled",!e,v.uh.getSetting(),[tv.A.USER_SETTINGS_VOICE_AND_VIDEO]),v.uh.updateSetting(!e)}}),aE=(0,a.zD)(o.X.STREAMING_ADVANCED_SCREENSHARE,{useTitle:()=>j.intl.string(j.t.GmWk2E),useSearchTerms:()=>[j.intl.string(j.t["Fj/xn1"])],useSubtitle:()=>j.intl.string(j.t["Fj/xn1"]),useValue:function(){return(0,m.bG)([iq.Ay],()=>iq.Ay.getVideoHook())},setValue:sT.A.setVideoHook,usePredicate:function(){return(0,m.bG)([iq.Ay],()=>iq.Ay.supportsVideoHook())}}),aS=(0,a.zD)(o.X.STREAMING_EXPERIMENTAL_SOUNDSHARE,{useTitle:()=>j.intl.string(j.t["4I0qzZ"]),useValue:function(){return(0,m.bG)([iq.Ay],()=>iq.Ay.getExperimentalSoundshare())},setValue:sT.A.setExperimentalSoundshare,usePredicate:function(){return(0,m.bG)([iq.Ay],()=>{let e=iq.Ay.supportsExperimentalSoundshare(),t=iq.Ay.supportsHookSoundshare();return e&&t})}}),ax=(0,a.zD)(o.X.STREAMING_STREAM_ATTENUATION,{useTitle:()=>j.intl.string(j.t["/jwMtn"]),useSubtitle:()=>j.intl.string(j.t.zlA23F),useValue:function(){return(0,m.bG)([iq.Ay],()=>iq.Ay.getSidechainCompression())},setValue:function(e){let t=[tv.A.USER_SETTINGS_VOICE_AND_VIDEO];sT.A.setSidechainCompression(e,{analyticsLocations:t})},usePredicate:function(){return iq.Ay.supports(lD.O5.SIDECHAIN_COMPRESSION)}}),aT=(0,a.sN)(o.X.STREAMING_STREAM_ATTENUATION_STRENGTH,{useTitle:()=>j.intl.string(j.t.fhEzfj),setValue:function(e){let t=[tv.A.USER_SETTINGS_VOICE_AND_VIDEO];sT.A.setSidechainCompressionStrength(e,{analyticsLocations:t})},minValue:1,maxValue:100,getInitialValue:iq.Ay.getSidechainCompressionStrength,usePredicate:function(){let e=(0,m.bG)([iq.Ay],()=>iq.Ay.getSidechainCompression());return iq.Ay.supports(lD.O5.SIDECHAIN_COMPRESSION)&&e}}),ap=(0,a.zD)(o.X.STREAMING_OS_MENU_SCREEN_CAPTURE,{useTitle:()=>j.intl.string(j.t.lt8rRx),useSubtitle:()=>j.intl.string(j.t.ie1mgY),useValue:function(){return(0,m.bG)([iq.Ay],()=>iq.Ay.getUseSystemScreensharePicker())},setValue:function(e){(0,no.cX)()&&e?(0,nW.A)({title:j.intl.string(j.t["9jf31O"]),subtitle:j.intl.string(j.t.uBd6JW),variant:"primary",onConfirm:()=>{sT.A.setUseSystemScreensharePicker(e),nc.A.app.relaunch()},confirmText:j.intl.string(j.t.BddRzS)}):sT.A.setUseSystemScreensharePicker(e)},usePredicate:function(){return(0,m.bG)([iq.Ay],()=>iq.Ay.supportsSystemScreensharePicker()&&(0,no.cX)())}}),af=(0,a.bd)(o.X.STREAMING_ADVANCED_ACCORDION,{useTitle:e=>e?j.intl.string(j.t.qrMyvm):j.intl.string(j.t.LEtTNl),useCollapsedSubtitle:()=>tc(o.X.STREAMING_ADVANCED_ACCORDION),buildLayout:()=>[ax,aT,ap,aS,aE]}),aI=(0,a.zZ)(o.X.STREAMING_CATEGORY,{useTitle:()=>j.intl.string(j.t.KDdjou),buildLayout:()=>[ah,af]});var a_=n(106713);let aN=(0,a.E2)(o.X.VOICE_MICROPHONE_INPUT_SELECT,{useSearchTerms:()=>[],Component:function(){let{showDeviceFormFactorIndicators:e}=a_.A.useConfig({location:"MicrophoneInputSelect"});return(0,c.jsx)(sd.U,{label:j.intl.string(j.t.UTM8VP),deviceType:lD.oh.AUDIO_INPUT,location:"UserSettingsVoiceVideo",hideDeviceTypeIcon:!e})}}),aC=(0,a.E2)(o.X.VOICE_SPEAKER_OUTPUT_SELECT,{useSearchTerms:()=>[],Component:function(){let{showDeviceFormFactorIndicators:e}=a_.A.useConfig({location:"SpeakerOutputSelect"});return(0,c.jsx)(sd.U,{label:j.intl.string(j.t.xuYQ0n),deviceType:lD.oh.AUDIO_OUTPUT,location:"UserSettingsDevices",hideDeviceTypeIcon:!e})}}),ab=(0,a.zC)(o.X.VOICE_INPUT_OUTPUT_DEVICE_SPLIT,{buildLayout:()=>[aN,aC]}),ay=(0,a.sN)(o.X.VOICE_INPUT_VOLUME_SETTING,{useTitle:()=>j.intl.string(j.t.Rtsr6w),minValue:0,maxValue:100,getInitialValue:function(){let e=iq.Ay.getInputVolume();return(0,r8.M)(e)},asValueChanges:function(e){let t=[tv.A.USER_SETTINGS_VOICE_AND_VIDEO],n=(0,r8.w)(e);sT.A.setInputVolume(n,{analyticsLocations:t})}}),av=(0,a.sN)(o.X.VOICE_OUTPUT_VOLUME_SETTING,{useTitle:()=>j.intl.string(j.t.aUJ062),minValue:0,maxValue:200,getInitialValue:function(){let e=iq.Ay.getOutputVolume();return(0,r8.M)(e)},onValueRender:function(e){return`${e.toFixed(0)}%`},asValueChanges:function(e){let t=[tv.A.USER_SETTINGS_VOICE_AND_VIDEO],n=(0,r8.w)(e);sT.A.setOutputVolume(n,{analyticsLocations:t})}}),aj=(0,a.zC)(o.X.VOICE_INPUT_OUTPUT_VOLUME_SPLIT,{buildLayout:()=>[ay,av]});var aO=n(702841),aL=n(349288),aD=n(152567),aR=n(141218);let aP=`${eS.A.getArticleURL(A.MVz.VOICE_VIDEO_TROUBLESHOOTING)}?utm_source=discord&utm_medium=blog&utm_campaign=2020-06_help-voice-video&utm_content=--t%3Apm`,aG=(0,a.E2)(o.X.VOICE_MICROPHONE_TEST_SETTING,{useSearchTerms:()=>[j.intl.string(j.t.nuFtHH)],usePredicate:function(){return(0,aO.bG)([iq.Ay],()=>iq.Ay.supports(lD.O5.LOOPBACK))},Component:function(){return(0,aO.bG)([iq.Ay],()=>iq.Ay.supports(lD.O5.LOOPBACK))?(0,c.jsx)(aD.A,{size:"md",notchBackground:aD.V.GRAY,captionVoice:j.intl.string(j.t.bp3JOV),captionNoVoice:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(z.E,{variant:"text-xs/semibold",color:"text-default",children:j.intl.string(j.t.bgn75v)}),j.intl.string(j.t["MA+OZh"]),(0,c.jsx)(aL.Anchor,{className:aR.X,href:eS.A.getArticleURL(A.MVz.NO_INPUT_DETECTED),children:j.intl.string(j.t.RYKKox)})]}),helpText:j.intl.format(j.t["V+B3FH"],{guideURL:aP}),buttonTest:j.intl.string(j.t.gyljWE),buttonStop:j.intl.string(j.t.I6OnJ3),buttonVariant:"primary",location:{page:A.liQ.USER_SETTINGS,section:A.JJy.SETTINGS_VOICE_AND_VIDEO}}):null}}),aM=eW.isWindows()?["BTHENUM","BTHHFENUM"]:[];function aU(e){let{inputAndOutputAreBluetooth:t,canPromptSystemServiceInstallForVoice:n}=e;return(0,c.jsxs)(F.B,{children:[n&&(0,c.jsx)(i1,{sourcePage:"voice"}),t&&(0,c.jsx)(lz.A,{look:lz.k.WARNING,children:j.intl.string(j.t.Ioz3gx)})]})}let aV=(0,a.zZ)(o.X.VOICE_CATEGORY,{useTitle:()=>j.intl.string(j.t.K3lovD),useSearchTerms:()=>[j.intl.string(j.t.hHMYbb),j.intl.string(j.t.nuFtHH),j.intl.string(j.t.dl18zb),j.intl.string(j.t["3182VD"]),j.intl.string(j.t["DGq/PR"]),j.intl.string(j.t.eATD2B),j.intl.string(j.t.Rtsr6w),j.intl.string(j.t.aUJ062)],useInlineNotice:function(){let e=i0("voice"),t=(0,sc.x5)(lD.oh.AUDIO_INPUT),n=(0,sc.x5)(lD.oh.AUDIO_OUTPUT),i=g.useMemo(()=>{let e=aM.some(e=>t?.hardwareId?.startsWith(e)),i=aM.some(e=>n?.hardwareId?.startsWith(e));return e&&i&&t?.containerId!=null&&t.containerId===n?.containerId},[t,n]);return g.useMemo(()=>e.canPrompt||i?{type:d.lT.STRONGLY_DISCOURAGED_CUSTOM,notice:()=>(0,c.jsx)(aU,{inputAndOutputAreBluetooth:i,canPromptSystemServiceInstallForVoice:e.canPrompt})}:null,[e.canPrompt,i])},buildLayout:()=>[ab,aj,aG]}),ak=(0,a.t_)(o.X.VOICE_AND_VIDEO_PANEL,{useTitle:()=>j.intl.string(j.t.B1fFpf),buildLayout:()=>[aV,rP,sx,aI,aA,at,s0,sK]}),aw=(0,a.i4)(o.X.VOICE_AND_VIDEO_SIDEBAR_ITEM,{useTitle:()=>j.intl.string(j.t.B1fFpf),usePredicate:()=>iq.Ay.isSupported(),icon:se.c,useMenu:st.A,buildLayout:()=>[ak]}),aF=(0,a.WI)(o.X.APP_SECTION,{useTitle:()=>j.intl.string(j.t.gcyH1J),buildLayout:()=>[aw,nF,eJ,iG,l9,nY]});var aB=n(360669),az=n(974544),aX=n(423764),aY=n(289873),aH=n(132500),aK=n(465323),aW=n(37766),aZ=n(194261),aq=n(391048),aQ=n(277984),aJ=n(99696),a$=n(202613),a0=n(615405),a1=n(580630),a2=n(83617),a3=n(935208),a5=n(607399),a6=n(993077),a4=n(150934),a8=n(256006),a7=n(198970),a9=n(71532);let oe=/[^0-9/]/g,ot=/[^0-9]/g;class on extends g.PureComponent{_inputRef;selectionStart=0;componentDidUpdate(e){let t=this._inputRef;e.value!==this.props.value&&null!=t&&t.setSelectionRange(this.selectionStart,this.selectionStart)}setRef=e=>{let{inputRef:t}=this.props;this._inputRef=e,null!=t&&t(e)};handleChange=(e,t)=>{let n,i,l,s,{value:r,onChange:a}=this.props,o=this._inputRef;if(e===r||null==o||null==r)return;let u=(i=(n=e.replace(oe,"").split("/"))[0],l=n[1],s=[],parseInt(i,10)>12&&(i=i.substring(0,1)),s.push(i),(parseInt(i,10)>1||2===i.length||null!=l&&""!==l)&&s.push("/"),null!=l&&""!==l&&parseInt(l,10)>99&&(l=(l+"").substring(0,2)),s.push(l),s.join("")),d=o.selectionStart;u===r&&u.length<=3&&r.includes("/")&&!e.includes("/")?u=u.replace(ot,""):u===r&&e.includes("/")&&!r.includes("/")&&(u+="/"),u.length>e.length&&(d+=u.length-e.length),this.selectionStart=d,null!=a&&a(u,t)};render(){return(0,c.jsx)(li.k,{...this.props,inputMode:"numeric",onChange:this.handleChange,inputRef:this.setRef})}}var oi=n(832208),ol=n(729919);let os=[{fields:[{expirationDate:{name:"expirationDate",id:(0,tU.Ld)(),title:()=>j.intl.string(j.t["CeBa/4"]),autoComplete:"cc-exp",placeholder:()=>j.intl.string(j.t.xeEWQ6),pattern:"\\d*",getClassNameForLayout:()=>ol.ep,renderInput:e=>(0,c.jsx)(on,{...e})}}.expirationDate]}],or=function(e){let{onCardInfoChange:t,className:n,expirationDate:i,error:l}=e,[s,r]=g.useState(!1),[a,o]=g.useState(null),[u,d]=g.useState(i);return g.useEffect(()=>{t({expirationDate:u},null===a)},[u,t,a]),(0,c.jsx)(oi.A,{className:n,form:os,values:{expirationDate:u},errors:null!=a?{expirationDate:a}:{},formError:l,onFieldChange:function(e){s||""===e||r(!0),s&&""===e||!(0,a9.So)(e)?o(j.intl.string(j.t["9/zZdl"])):o(null),d(e)}})};var oa=n(219887),oo=n(520229);let ou="isDefault";class od extends g.PureComponent{static defaultProps={onDelete:()=>{},onSubmit:()=>{},onCancel:()=>{}};constructor(e){super(e);const{paymentSource:t,isDefault:n}=e,i=t.billingAddress;this.state={billingAddress:{name:i.name??"",line1:i.line1??"",line2:i.line2??"",country:i.country??"",state:i.state??"",city:i.city??"",postalCode:i.postalCode??""},expiresMonth:t instanceof a$.YS?t.expiresMonth:void 0,expiresYear:t instanceof a$.YS?t.expiresYear:void 0,billingAddressValid:!1,isDefault:n,expirationValid:!0,dirtyFields:{}}}componentWillUnmount(){e2.h.wait(()=>{(0,aQ.ey)(),(0,aQ.tc)()})}handleSubmit=e=>{if(e.preventDefault(),e.stopPropagation(),0===Object.values(this.state.dirtyFields).filter(n8.Vq).length)this.props.onCancel();else{let{billingAddress:e,isDefault:t,expiresMonth:n,expiresYear:i}=this.state;this.props.onSubmit(this.props.paymentSource.id,{billingAddress:e,expiresMonth:n,expiresYear:i,isDefault:t})}};handleCancel=()=>{this.props.onCancel()};handleDelete=()=>{let{onDelete:e,paymentSource:t}=this.props;e(t.id)};handleAddressUpdate=(e,t,n)=>{this.setState({billingAddress:e,billingAddressValid:t,dirtyFields:{...this.state.dirtyFields,billingAddress:n}})};handleExpirationDateUpdate=(e,t)=>{let{expirationDate:n}=e;if(this.setState({expirationValid:t}),null==n||""===n)return;let[i,l]=n.split("/");this.handleFieldChange(Number(i),"expiresMonth"),this.handleFieldChange(Number(`${new Date().getFullYear().toString().slice(0,2)}${l}`),"expiresYear")};handleFieldChange=(e,t)=>{null!=t&&this.setState({[t]:e,dirtyFields:{...this.state.dirtyFields,[t]:!0}})};renderError(){let{updateError:e,removeError:t}=this.props;return null==e||e.hasCardError()||e.hasAddressError()?null!=t?(0,c.jsx)("div",{className:oo.zc,children:(0,c.jsx)(iV.w,{type:"critical",children:t.message})}):null:(0,c.jsx)("div",{className:oo.zc,children:(0,c.jsx)(iV.w,{type:"critical",children:e.message})})}renderBillingAddressSection(){let{billingAddress:e}=this.state,{updateError:t,paymentSource:n}=this.props,i=(0,a8.g)(n);return(0,c.jsxs)("div",{className:oo.yV,children:[(0,c.jsx)(z.E,{className:oo.bV,variant:"text-sm/normal",children:j.intl.string(j.t["50Auo2"])}),(0,c.jsx)(a7.Ay,{...e,mode:a7.Ay.Modes.EDIT,layout:i,onBillingAddressChange:this.handleAddressUpdate,error:t})]})}renderCardExpirationSection(){let{expiresMonth:e,expiresYear:t}=this.state;if(null==e||null==t)return null;let n=`${e.toString().padStart(2,"0")}/${t.toString().padStart(2,"0").slice(-2)}`;return(0,c.jsxs)("div",{className:oo.yV,children:[(0,c.jsx)(z.E,{className:oo.bV,variant:"text-sm/normal",children:j.intl.string(j.t.Fo2YP7)}),(0,c.jsx)(or,{expirationDate:n,onCardInfoChange:this.handleExpirationDateUpdate,error:this.props.updateError})]})}renderActions(){let{submitting:e,removing:t,isForSubscription:n}=this.props,{billingAddressValid:i,expirationValid:l}=this.state;return(0,c.jsx)("div",{className:oo.AU,children:(0,c.jsxs)(F.B,{direction:"horizontal",justify:"space-between",children:[(0,c.jsx)(sC.e,{children:(0,c.jsxs)("div",{className:oo.lH,children:[n?(0,c.jsx)(i4.m,{text:j.intl.string(j.t["v6/z28"]),children:(0,c.jsx)("div",{"aria-hidden":!0,className:oo.dm})}):null,(0,c.jsx)(p.$,{type:"button",disabled:n||e,loading:t,onClick:this.handleDelete,variant:"critical-secondary",size:a5.Fr?"sm":"md",text:a5.Fr?j.intl.string(j.t.oyYWHE):j.intl.string(j.t.yk5qfb)})]})}),(0,c.jsxs)(sC.e,{children:[(0,c.jsx)(p.$,{type:"button",disabled:e||t,onClick:this.handleCancel,variant:"secondary",size:a5.Fr?"sm":"md",text:j.intl.string(j.t["ETE/oC"])}),(0,c.jsx)(p.$,{loading:e,disabled:!i||t||!l,type:"submit",variant:"active",size:a5.Fr?"sm":"md",text:j.intl.string(j.t["R3BPH+"])})]})]})})}render(){let{paymentSource:e,isDefault:t,locale:n,className:i,isForSubscription:l}=this.props,{isDefault:s}=this.state,r=e instanceof a$.SJ;return(0,c.jsx)(a6.Z,{editable:!0,className:ie()(oo.Nr,i),children:(0,c.jsxs)("form",{onSubmit:this.handleSubmit,noValidate:!0,children:[this.renderError(),(0,c.jsxs)("div",{className:oo.__invalid_paymentSection,children:[(0,c.jsx)(oa.A,{paymentSource:e,isDefault:t,isForSubscription:l,locale:n,showLabels:!0,showPaymentSourceIcon:!0}),e.invalid?(0,c.jsx)("div",{className:oo.Um,children:j.intl.string(j.t["3R0U0b"])}):null,(0,c.jsx)("div",{className:oo.Sv,children:r?j.intl.format(j.t.w9WkBl,{paypalURL:"https://www.paypal.com"}):j.intl.string(j.t.VXndyr)})]}),this.renderCardExpirationSection(),this.renderBillingAddressSection(),(0,c.jsx)("div",{className:oo.D5,children:(0,c.jsx)(a4.S,{value:ou,checked:s,onChange:e=>this.handleFieldChange(e,ou),label:j.intl.string(j.t.nag9Og),labelType:"secondary"})}),(0,c.jsx)(i2.c,{}),this.renderActions()]})})}}let oc=m.Ay.connectStores([a0.A],()=>({updateError:a0.A.editSourceError,removeError:a0.A.removeSourceError}))(od);var og=n(776409),om=n(743526),oA=n(455218);function oh(){(0,aJ.HF)({withRedemptionSuccessModal:!0,source:"desktop_billing_page",loadId:(0,aH.A)()})}class oE extends g.PureComponent{static defaultProps={isEditing:!1,hideDivider:!1,onEditClick:()=>{}};handleEditClick=()=>{this.props.onEditClick(this.props.paymentSource.id)};render(){let{paymentSource:e,isDefault:t,isEditing:n,hideDivider:i,isForSubscription:l,locale:s,removing:r,submitting:a,onSubmit:o,onCancel:u,onDelete:d}=this.props;return n?(0,c.jsx)(oc,{paymentSource:e,isDefault:t,removing:r,submitting:a,locale:s,isForSubscription:l,onSubmit:o,onCancel:u,onDelete:d}):(0,c.jsxs)(c.Fragment,{children:[i?null:(0,c.jsx)(i2.c,{className:oA.__invalid_sourceDivider}),(0,c.jsxs)("div",{className:oA.Yb,children:[(0,c.jsx)(oa.A,{paymentSource:e,isDefault:t,isForSubscription:l,locale:s,showSubtext:!0,showLabels:!0,showPaymentSourceIcon:!0}),(0,c.jsx)(p.$,{variant:"secondary",onClick:this.handleEditClick,size:"sm",text:j.intl.string(j.t.bt75uw)})]})]})}}let oS=g.memo(function(e){let{paymentSource:t,hideDivider:n,isForSubscription:i,locale:l,onRedeemClick:s}=e,[r,a]=g.useState(null),o=(0,m.bG)([l1.default],()=>l1.default.getCurrentUser()?.storeCountry?.country??null),u=(0,m.bG)([a0.A],()=>a0.A.ipCountryCode),d=g.useMemo(()=>(0,aK.TW)(`-${o??u??"US"}`),[o,u]);return g.useEffect(()=>{void 0===t?a({amount:0,currency:d}):aQ.YP(t.id).then(e=>{a(e)})},[t,d]),(0,c.jsxs)(c.Fragment,{children:[n?null:(0,c.jsx)(i2.c,{className:oA.__invalid_sourceDivider}),(0,c.jsxs)("div",{className:oA.Yb,children:[void 0!==t?(0,c.jsx)(oa.A,{paymentSource:t,isDefault:!1,isForSubscription:i,locale:l,showSubtext:!1,showLabels:!1,showPaymentSourceIcon:!0}):(0,c.jsxs)(la.A,{align:la.A.Align.CENTER,children:[(0,c.jsx)(aW._,{size:"lg"}),(0,c.jsx)(z.E,{variant:"text-sm/medium",className:om.Wi,children:j.intl.string(og.default["/FQWfA"])})]}),(0,c.jsxs)("div",{className:oA.zy,children:[(0,c.jsx)("div",{className:oA.Tq,children:null==r?(0,c.jsx)(aY.y,{type:aY.y.Type.SPINNING_CIRCLE}):(0,c.jsx)(z.E,{variant:"text-sm/medium",children:function(){let{amount:e,currency:t}=r??{},n=t??d,i=String(n).toUpperCase(),l=(0,a1.$g)(e??0,n,{currencyDisplay:"narrowSymbol"});return`${i} ${l}`}()})}),(0,c.jsx)(p.$,{variant:"secondary",onClick:s,size:"sm",text:j.intl.string(og.default.hnRau6)})]})]})]})});class ox extends g.PureComponent{state={editingPayment:null};handleEditClick=async e=>{try{await aQ.Gr(e),this.setState({editingPayment:e})}catch(e){}};handleCancel=()=>{this.setState({editingPayment:null})};handleDelete=async e=>{try{await aQ.JQ(e),this.setState({editingPayment:null})}catch(e){}};handleSubmit=async(e,t)=>{if(null!=e)try{await aQ.Ps(e,t),this.setState({editingPayment:null})}catch(e){}};handlePaymentSourceAdded=async e=>{await (0,a2.c_)(e.id)};handleAddPaymentMethod=()=>{(0,ln.openModalLazy)(async()=>{let{default:e}=await Promise.resolve().then(n.bind(n,362111));return t=>(0,c.jsx)(e,{...t,onAddPaymentSource:this.handlePaymentSourceAdded})},{onCloseCallback:()=>{(0,aq.ET)()}})};renderFooter(){let{paymentSources:e}=this.props;return(0,c.jsxs)("div",{className:oA.qr,children:[0===Object.keys(e).length?(0,c.jsxs)("div",{className:oA.z8,children:[(0,c.jsx)(z.E,{variant:"text-sm/normal",children:j.intl.string(j.t.aRHpAB)}),(0,c.jsx)(z.E,{variant:"text-sm/normal",color:"text-subtle",className:oA.Sv,children:j.intl.string(j.t.o9bOIl)})]}):null,(0,c.jsx)(p.$,{onClick:this.handleAddPaymentMethod,text:j.intl.string(j.t.CpOiEO)})]})}render(){let e,{showHeader:t,defaultPaymentSourceId:n,paymentSources:i,locale:l,removing:s,submitting:r,premiumSubscriptionPaymentSourceId:a,showGiftCards:o}=this.props,u=k().values(i).sort((e,t)=>e.id===n?-1:t.id===n?1:a3.default.compare(e.id,t.id)),d=u.filter(e=>!(e instanceof a$.LQ)),g=u.filter(e=>e instanceof a$.LQ),m=this.state.editingPayment,A=d.findIndex(e=>e.id===m),h=d.map((e,t)=>(0,c.jsx)(oE,{locale:l,paymentSource:e,isDefault:n===e.id,onCancel:this.handleCancel,onDelete:this.handleDelete,isForSubscription:e.id===a,hideDivider:0===t||A===t-1,onSubmit:this.handleSubmit,submitting:r,removing:s,isEditing:m===e.id,onEditClick:this.handleEditClick},e.id));return e=g.length>0?g.map((e,t)=>(0,c.jsx)(oS,{paymentSource:e,hideDivider:0===d.length||A===d.length-1,isForSubscription:e.id===a,locale:l,onRedeemClick:oh},e.id)):(0,c.jsx)(oS,{hideDivider:0===d.length||A===d.length-1,isForSubscription:!1,locale:l,onRedeemClick:oh}),(0,c.jsxs)(c.Fragment,{children:[t?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(E.D,{variant:"heading-lg/semibold",children:[(0,c.jsx)(aZ.X,{size:"sm",className:oA.hz})," ",j.intl.string(j.t.W26xGQ)]}),(0,c.jsx)(z.E,{variant:"text-sm/normal",color:"text-subtle",children:j.intl.string(j.t.h6V3uK)})]}):null,h,o&&e,A!==d.length-1||o&&g.length>0?(0,c.jsx)(i2.c,{}):null,this.renderFooter()]})}}var oT=n(459357),op=n(295405),of=n(166403),oI=n(773669),o_=n(844828);function oN(){let e=(0,m.bG)([l1.default],()=>l1.default.getCurrentUser()?.storeCountry);return e?.country==null?null:{country:e.country,countryName:(0,aX.Gw)(e.country)}}let oC=(0,a.E2)(o.X.BILLING_PAYMENT_METHODS,{Component:function(e){let{showHeader:t=!1}=e,n=(0,m.bG)([a0.A],()=>a0.A.isSyncing),i=(0,m.bG)([op.A],()=>op.A.paymentSources),l=(0,m.bG)([op.A],()=>op.A.defaultPaymentSourceId),s=(0,m.bG)([oI.default],()=>oI.default.locale),r=(0,m.bG)([of.A],()=>of.A.getPremiumTypeSubscription()),a=(0,m.bG)([a0.A],()=>a0.A.isRemovingPaymentSource),o=(0,m.bG)([a0.A],()=>a0.A.isUpdatingPaymentSource),{enabled:u}=(0,oT.c)({location:"UserSettingsBilling"});return(g.useEffect(()=>{aQ.$o(),aQ.hP()},[]),n&&0===Object.keys(i).length)?(0,c.jsx)("div",{className:o_.o,children:(0,c.jsx)(aY.y,{})}):(0,c.jsx)(ox,{showHeader:t,paymentSources:i,defaultPaymentSourceId:l,premiumSubscriptionPaymentSourceId:null!=r&&r.status!==A.Dmq.CANCELED?r.paymentSourceId:null,locale:s,removing:a,submitting:o,showGiftCards:u})},useSearchTerms:()=>[j.intl.string(j.t.W26xGQ),j.intl.string(j.t["3pIjBH"])]}),ob=(0,a.zZ)(o.X.BILLING_PAYMENT_METHODS_CATEGORY,{useTitle:()=>j.intl.string(j.t.W26xGQ),useSubtitle:()=>{let e=oN();return null!=e?j.intl.format(j.t.e2t1G5,{country:e.countryName}):j.intl.string(j.t.h6V3uK)},useSubtitleDecoration:function(){return null==oN()?null:{type:d.p3.INFO_POPOVER,ariaLabel:j.intl.string(j.t.PuB1W7),popoverProps:{title:"",body:j.intl.string(j.t["21skUa"]),size:"sm",position:"top",getActions:e=>[{text:j.intl.string(j.t.PuB1W7),variant:"primary",onClick:()=>{window.open("https://support.discord.com/hc/articles/39799791912087","_blank"),e()}}]}}},buildLayout:()=>[oC]});var oy=n(549363),ov=n(545075);let oj=(0,a.E2)(o.X.BILLING_TRANSACTION_HISTORY,{Component:function(){let e=(0,m.bG)([oI.default],()=>oI.default.locale);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(ov.kb,{}),(0,c.jsx)(oy.A,{locale:e})]})},useSearchTerms:()=>[j.intl.string(j.t.obLrcK)]}),oO=(0,a.zZ)(o.X.BILLING_TRANSACTION_HISTORY_CATEGORY,{useTitle:()=>j.intl.string(j.t.obLrcK),buildLayout:()=>[oj]}),oL=(0,a.t_)(o.X.BILLING_PANEL,{useTitle:()=>j.intl.string(j.t.oeUm2s),buildLayout:()=>[ob,oO],useObscuredNotice:az.L}),oD=(0,a.i4)(o.X.BILLING_SIDEBAR_ITEM,{useTitle:()=>j.intl.string(j.t.oeUm2s),icon:aB.B,buildLayout:()=>[oL]});var oR=n(70283),oP=n(597770),oG=n(682618),oM=n(611881),oU=n(962644),oV=n(35587),ok=n(86379);let ow=(0,a.E2)(o.X.GIFT_BLOCKED_PAYMENTS_SETTING,{Component:ov.uK,usePredicate:()=>(0,ok.Hp)(),useSearchTerms:()=>[j.intl.string(j.t.vwMEHS)]}),oF=(0,a.zZ)(o.X.GIFT_BLOCKED_PAYMENTS_CATEGORY,{buildLayout:()=>[ow]});var oB=n(982240),oz=n(788833),oX=n(914410),oY=n(360615),oH=n(215082);function oK(e){let{tier:t,active:n=!1}=e;return(0,c.jsxs)("div",{className:ie()(oH.fO,{[oH.bF]:n}),children:[null!=t.simple_icon_url&&(0,c.jsx)("img",{src:t.simple_icon_url,alt:"",className:oH.si}),(0,c.jsxs)("div",{className:oH.tc,children:[(0,c.jsx)(z.E,{variant:"text-sm/semibold",color:"text-subtle",children:t.name??""}),(0,c.jsx)(z.E,{variant:"text-xs/normal",color:"text-muted",children:j.intl.format(oY.default.qvx9E4,{count:(0,oB.rL)(t)})})]})]})}function oW(e){let{tiers:t,currentTier:n}=e;return(0,c.jsx)("div",{className:oH.dw,children:t.map(e=>(0,c.jsx)(oK,{tier:e,active:e.key===n?.key},e.key))})}function oZ(e){let{analyticsLocation:t,location:n}=e,{analyticsLocations:i}=(0,eL.Ay)(tv.A.USER_SETTINGS_GIFT_INVENTORY),{openGiftModal:l}=(0,oz.$)({giftRecipient:void 0,analyticsLocations:i,analyticsObject:{object:A.ZSU.BUTTON_CTA,objectType:A.AnalyticsObjectTypes.GIFT},analyticsLocation:t,location:n});return(0,c.jsx)("div",{className:oH.NG,children:(0,c.jsx)(p.$,{variant:"primary",icon:oP.o,text:j.intl.string(oY.default.DZnomS),onClick:l})})}function oq(e){let t,{badgeProgress:n,currentTier:i,nextTier:l,giftsRemaining:s}=e,r=(0,oB.rL)(i),a=(0,oB.rL)(l),o=(0,oM.GZ)(n,i,l);return t=null!=l?j.intl.formatToPlainString(oY.default.XTX3OO,{count:s,nextTier:l?.name??""}):j.intl.formatToPlainString(oY.default.LnsdbK,{currentTier:i?.name??""}),(0,c.jsxs)("div",{className:oH.mY,children:[i?.simple_icon_url!=null&&(0,c.jsx)("div",{className:oH.fC,children:(0,c.jsx)("img",{src:i.simple_icon_url,alt:"",className:oH.qS})}),(0,c.jsxs)("div",{className:oH.Qs,children:[(0,c.jsx)(z.E,{variant:"text-md/medium",color:"text-strong",children:t}),(0,c.jsx)(oX.Ay,{variant:oX.qP.BLUE,weight:oX.fh.MEDIUM,progress:o}),(0,c.jsx)(z.E,{variant:"text-xs/normal",color:"text-muted",className:oH.qg,children:j.intl.format(oY.default.iIpfQe,{threshold:null!=l?a:r,count:null!=l?n:r})})]}),l?.simple_icon_url!=null&&(0,c.jsx)("div",{className:oH.fC,children:(0,c.jsx)("img",{src:l.simple_icon_url,alt:"",className:oH.qS})})]})}function oQ(e){let{analyticsLocation:t}=e,{badgeProgress:n,currentTier:i,nextTier:l,giftsRemaining:s,tiers:r}=(0,m.cf)([oB.Ay],()=>({badgeProgress:oB.Ay.getSingleRequirementProgress(oR.$.GIFTING)?.current??0,currentTier:oB.Ay.getCurrentTier(oR.$.GIFTING),nextTier:oB.Ay.getNextTier(oR.$.GIFTING),giftsRemaining:oB.Ay.getRemainingToNextTier(oR.$.GIFTING),tiers:oB.Ay.getBadgeById(oR.$.GIFTING)?.tiers??[]}));return 0===r.length?null:(0,c.jsxs)("div",{className:oH.kL,children:[(0,c.jsxs)("div",{className:oH.Jo,children:[n>0&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(oq,{badgeProgress:n,currentTier:i,nextTier:l,giftsRemaining:s}),(0,c.jsx)("div",{className:oH.yF})]}),(0,c.jsx)(oW,{tiers:r,currentTier:i}),(0,c.jsx)(z.E,{variant:"text-xs/normal",color:"text-muted",className:oH.PJ,children:j.intl.string(oY.default["4Yp0mI"])})]}),(0,c.jsx)(oZ,{analyticsLocation:t,location:"UserSettingsGiftingBadgeProgress"})]})}let oJ=(0,a.zZ)(o.X.GIFTING_BADGE_CATEGORY,{useTitle:()=>j.intl.string(oY.default.sFokBp),buildLayout:()=>[o$],usePredicate:()=>{let e=(0,oM.F5)("gift_inventory"),t=(0,m.bG)([oB.Ay],()=>oB.Ay.getBadgeById(oR.$.GIFTING));return e&&null!=t}}),o$=(0,a.E2)(o.X.GIFTING_BADGE_CONTENT,{useSearchTerms:()=>[j.intl.string(oY.default.sFokBp)],Component:()=>(0,c.jsx)(oQ,{})});var o0=n(264779),o1=n(412260),o2=n(555393),o3=n(725807),o5=n(212168),o6=n(469778),o4=n(45938),o8=n(109802),o7=n(869038),o9=n(221347);function ue(e){let{children:t,className:n,splashArtURL:i}=e;return(0,c.jsxs)(la.A,{className:ie()(o9.wx,n),align:la.A.Align.CENTER,children:[(0,c.jsx)("div",{className:o9.Bn,style:null!=i?{backgroundImage:`url(${i})`}:void 0}),t]})}function ut(e){let{children:t,className:n}=e;return(0,c.jsx)("div",{className:ie()(o9.rf,n),children:t})}class un extends g.PureComponent{static Header=ue;static Body=ut;render(){let{children:e,className:t,onMouseEnter:n,onMouseLeave:i}=this.props;return(0,c.jsx)("div",{className:ie()(o9.Nr,t),onMouseEnter:n,onMouseLeave:i,children:e})}}var ui=n(165191),ul=n(871123),us=n(366523),ur=n(280450),ua=n(30793),uo=n(97352),uu=n(67480),ud=n(147925),uc=n(957565),ug=n(615396),um=n(990125);class uA extends g.PureComponent{_copyModeTimeout=new ru.Ep;state={copyMode:o8.q.DEFAULT};componentWillUnmount(){this._copyModeTimeout.stop()}get copyButtonText(){switch(this.state.copyMode){case o8.q.SUCCESS:return j.intl.string(j.t.XVvPjU);case o8.q.ERROR:return j.intl.string(j.t.i4GM3L);default:return j.intl.string(j.t.OpuAlK)}}handleRevoke(e){o7.A.revokeGiftCode(e)}handleCopy=e=>{let{giftCode:t,sku:n}=this.props;(0,o4.AK)(t,n),(0,uc.C)(e,()=>this.setState({copyMode:o8.q.SUCCESS}),()=>this.setState({copyMode:o8.q.ERROR})),this._copyModeTimeout.start(1e3,()=>{this.setState({copyMode:o8.q.DEFAULT})})};render(){let{hideCode:e,giftCode:t}=this.props,{copyMode:n}=this.state;return(0,c.jsxs)(la.A,{direction:la.A.Direction.VERTICAL,className:um.Gj,children:[(0,c.jsx)(o8.e,{className:um.ph,value:(0,o4.Zq)(t.code),text:this.copyButtonText,mode:n,supportsCopy:uc.p5,hideMessage:e?j.intl.string(j.t["0RLn47"]):null,onCopy:this.handleCopy,buttonColor:s_.XD.BRAND,buttonLook:s_.pR.FILLED}),(0,c.jsxs)("div",{className:um.KB,children:[null!=t.expiresAt?(0,c.jsxs)(g.Fragment,{children:[j.intl.format(j.t.ltVZcJ,{hours:t.expiresAt.diff(ii()(),"h")})," \u2014\xa0"]}):null,(0,c.jsx)(t8.D,{tag:"a",onClick:()=>this.handleRevoke(t.code),children:j.intl.string(j.t.v6Yazx)})]})]})}}class uh extends g.PureComponent{_loadedAt=null;state={isOpen:!1,isCreating:!1,isHovered:!1};componentDidMount(){this._loadedAt=Date.now()}handleGenerateGiftCode=async e=>{e.stopPropagation();let{skuId:t,subscriptionPlanId:n,giftStyle:i}=this.props;this.setState({isCreating:!0}),await o7.A.createGiftCode(t,n,i),this.setState({isCreating:!1,isOpen:!0})};handleToggleOpen=()=>{let{skuId:e,subscriptionPlanId:t,loadedAt:n}=this.props,i=!this.state.isOpen;(null==n||null==this._loadedAt||n<this._loadedAt)&&i&&o7.A.fetchUserGiftCodesForSKU(e,t),this.setState({isOpen:!this.state.isOpen})};renderGiftIcon(){let{sku:e,giftStyle:t,application:n}=this.props;return(0,ul.bF)(e)?(0,c.jsx)(us.e,{shape:"square",sku:e,containerClassName:um.ez}):null!=t?(0,c.jsx)(ui.A,{giftStyle:t,className:um.ez,shouldAnimate:this.state.isHovered}):(0,c.jsx)(iZ.A,{game:n,size:iZ.M.MEDIUM,skuId:e.id})}renderSubtitle(){let{sku:e,entitlements:t,application:n}=this.props;return(0,ul.bF)(e)?(0,c.jsxs)("div",{className:ie()(um.Oc,um.ic),children:[(0,c.jsx)(iZ.A,{game:n,size:iZ.M.XSMALL,skuId:e.id,className:um._u}),j.intl.format(j.t["6plpZi"],{applicationName:n.name,copies:t.length})]}):(0,c.jsx)("div",{className:um.Oc,children:j.intl.format(j.t.zMcvcA,{copies:t.length})})}renderTitle(){let e,{sku:t,subscriptionPlan:n,giftCodeBatchId:i}=this.props;return e=i===tk.FB?j.intl.string(j.t.odsU6W):i===tk.Bu&&null!=n?j.intl.formatToPlainString(n.interval===tk.WT.MONTH?j.t.uZjpiJ:j.t.bJW1EA,{skuName:t.name,intervalCount:n.intervalCount}):null==n?t.name:j.intl.formatToPlainString(n.interval===tk.WT.MONTH?j.t.rCJvqo:j.t.Vd3Iu8,{skuName:t.name,intervalCount:n.intervalCount}),(0,c.jsx)("div",{className:um.mO,children:e})}renderGenerateGiftCodeRow(){return(0,c.jsxs)(la.A,{justify:la.A.Justify.BETWEEN,align:la.A.Align.CENTER,className:um.pe,children:[(0,c.jsx)(z.E,{variant:"text-md/normal",children:j.intl.string(j.t.lELyPj)}),(0,c.jsx)(p.$,{variant:"primary",size:"sm",text:j.intl.string(j.t.Q3Qguo),loading:this.state.isCreating,onClick:this.handleGenerateGiftCode})]})}setIsHovered(e){this.setState({isHovered:e})}render(){let{entitlements:e,application:t,giftCodes:n,className:i,sku:l,isFetching:s,hideCodes:r}=this.props,{isOpen:a}=this.state;return(0,c.jsxs)(un,{className:i,children:[(0,c.jsx)(t8.D,{onClick:this.handleToggleOpen,className:um.Nr,onMouseEnter:()=>this.setIsHovered(!0),onMouseLeave:()=>this.setIsHovered(!1),children:(0,c.jsx)(un.Header,{splashArtURL:t.getSplashURL(512),children:(0,c.jsxs)("div",{className:um.MY,children:[(0,c.jsxs)(la.A,{align:la.A.Align.CENTER,children:[this.renderGiftIcon(),(0,c.jsxs)("div",{className:um.TK,children:[this.renderTitle(),this.renderSubtitle()]})]}),(0,c.jsx)(ud.A,{direction:a?ud.A.Directions.UP:ud.A.Directions.DOWN,className:um.eO})]})})}),a?(0,c.jsx)(un.Body,{children:s?(0,c.jsx)(aY.y,{className:um.u1}):(0,c.jsxs)(g.Fragment,{children:[n.length<e.length?this.renderGenerateGiftCodeRow():null,n.map(e=>(0,c.jsx)(uA,{giftCode:e,sku:l,hideCode:r},e.code))]})}):null]})}}let uE=m.Ay.connectStores([uu.A,e8.A,ua.A,iz.A,uo.A,ur.default],e=>{let{skuId:t,subscriptionPlanId:n,giftStyle:i}=e,l=uu.A.get(t);if(null==l)throw Error("SKU was unavailable while rendering gift.");let s=ua.A.getForGifterSKUAndPlan(ur.default.getId(),t,n).filter(e=>!e.isClaimed).filter(e=>e.giftStyle===i);return{sku:l,hideCodes:e8.A.enabled,isFetching:ua.A.getUserGiftCodesFetchingForSKUAndPlan(t,n),loadedAt:ua.A.getUserGiftCodesLoadedAtForSKUAndPlan(t,n),application:iz.A.getApplication(l.applicationId),subscriptionPlan:null!=n?(0,ug.c9)(n):null,giftCodes:s}})(uh);var uS=n(725570),ux=n(736653),uT=n(46054);let up=ii().duration(30,"days");var uf=n(416052),uI=n(53070);function u_(e){let{onClose:t,transitionState:n}=e;return(0,c.jsx)(lt.Modal,{title:"",size:"md",input:(0,c.jsx)("div",{className:uI.aR}),onClose:async()=>await t(),actions:[{text:j.intl.string(j.t.cpT0Cq),variant:"primary",onClick:t}],transitionState:n,children:(0,c.jsxs)("div",{className:uI.t4,children:[(0,c.jsx)(E.D,{variant:"heading-xl/semibold",children:j.intl.string(j.t.iufib1)}),(0,c.jsx)(z.E,{variant:"text-md/normal",className:uI.G3,children:j.intl.string(j.t.eAn6z2)})]})})}let uN=function(e){let{onClose:t,onClaim:n,code:i,outboundPromotion:l,transitionState:s}=e,[r,a]=g.useState(null),o=(0,tU.GV)(),{analyticsLocations:u}=(0,eL.Ay)(tv.A.USER_SETTINGS_GIFT_INVENTORY);return(g.useEffect(()=>{null==i&&(0,o0.kd)({promotionId:l.id,promotionTitle:l.outboundTitle,partnerId:l.partnerId,analyticsLocations:u}).then(e=>n(e)).catch(e=>a(e?.body?.code))},[i,l.id,l.outboundTitle,l.partnerId,n,u]),null!=r)?(0,c.jsx)(u_,{onClose:t,transitionState:s}):null==i?(0,c.jsx)(aY.y,{className:uI.Lq}):(0,c.jsx)(lt.Modal,{title:"",size:"md",onClose:async()=>await t(),input:(0,c.jsxs)("div",{className:uI.N1,children:[(0,c.jsx)("div",{className:uI.Qw}),(0,c.jsx)(E.D,{variant:"heading-xl/semibold",children:j.intl.string(j.t["23BfZh"])}),(0,c.jsx)(z.E,{variant:"text-md/normal",className:uI.G3,children:l.outboundRedemptionModalBody})]}),actions:[{text:j.intl.string(j.t.TulDPl),variant:"secondary",onClick:async()=>await t()},{text:j.intl.string(j.t["+zx47d"]),variant:"primary",onClick:()=>{let e=(0,o0.kc)(i,l);window.open(e,"_blank")}}],transitionState:s,"aria-label":o,children:(0,c.jsxs)("div",{children:[(0,c.jsx)(i2.c,{className:uI.M5}),(0,c.jsx)(tH.D,{label:j.intl.string(j.t.s9LFQh),helperText:j.intl.string(j.t["F+nFTZ"]),children:(0,c.jsx)(uf.A,{value:i,buttonColor:s_.$n.Colors.BRAND,buttonLook:s_.$n.Looks.FILLED,delay:1e3})})]})})};var uC=n(707554),ub=n(339048),uy=n(104589);function uv(){let e=(0,m.yK)([o6.A],()=>o6.A.getGiftable()).filter(e=>{let{giftCodeBatchId:t}=e;return null==t}),t=k().groupBy(e,e=>(0,o4.Kx)(e.skuId,e.subscriptionPlanId,e.giftStyle)),[n,i]=g.useState(!1);if(g.useEffect(()=>{e2.h.wait(()=>{(0,ub.XJ)().then(()=>i(!0))})},[]),!n)return(0,c.jsx)(aY.y,{className:uy.Lq});if(0===Object.keys(t).length)return(0,c.jsxs)("div",{className:uy.p$,children:[(0,c.jsx)("div",{className:uy.QT}),(0,c.jsx)(uC.H,{className:uy.ks,children:j.intl.string(j.t.B1qgZn)}),(0,c.jsx)("p",{className:uy.WO,children:j.intl.format(j.t.HezvJ8,{onClick:function(){(0,t9.openUserSettings)(o.X.NITRO_PANEL)}})})]});let l=k().keys(t).map(e=>{let{skuId:n,subscriptionPlanId:i,giftStyle:l}=(0,o4.X6)(e);return(0,c.jsx)(uE,{skuId:n,subscriptionPlanId:i,entitlements:t[e],giftStyle:l},e)});return(0,c.jsx)(F.B,{gap:"lg",children:l})}function uj(e){let t,{outboundPromotion:n,code:i}=e,[l,s]=g.useState(!1),[r,a]=g.useState(!1);function o(){return s(e=>!e)}let u=(0,ux.Ay)(),d=(0,o0.WD)(n.id,u),m=null!=i,A=g.useMemo(()=>(0,il.i$)(m?null!=n.outboundRedemptionEndDate?ii()(n.outboundRedemptionEndDate):ii()(n.endDate).add(up):ii()(n.endDate),"LL"),[n,m]);m&&l?t=j.intl.format(j.t.pkxVx6,{endDate:A,onClickDetails:o}):m&&!l?t=j.intl.format(j.t["4sFeob"],{endDate:A,onClickDetails:o}):!m&&l?t=j.intl.format(j.t["RBnE+l"],{endDate:A,onClickDetails:o}):m||l||(t=j.intl.format(j.t["57+7Qn"],{endDate:A,onClickDetails:o}));let h=m?j.intl.string(j.t["2cHUti"]):j.intl.string(j.t.O13yhz),S=(0,o2.N)()?.isEligible===!0,x=g.useCallback(()=>a(!1),[]),{outboundTitle:T,outboundTermsAndConditions:f}=n;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("div",{className:uy.AX,children:[(0,c.jsxs)("div",{className:uy.Pg,children:[(0,c.jsxs)("div",{className:uy.At,children:[(0,c.jsx)("div",{className:uy.$G,children:(0,c.jsx)("img",{alt:"",src:d,className:uy.IJ})}),(0,c.jsxs)("div",{children:[(0,c.jsx)(E.D,{variant:"heading-md/semibold",children:T}),(0,c.jsx)(z.E,{variant:"text-sm/normal",color:"text-default",children:t})]})]}),(m||S)&&(0,c.jsx)(p.$,{text:h,onClick:()=>a(!0),size:"sm"})]}),l&&(0,c.jsx)(z.E,{className:uy.GL,variant:"text-xs/normal",color:"text-default",children:uT.A.parse(f,!1,{allowLinks:!0})})]}),r&&(0,c.jsx)(uS.aF,{renderModal:e=>(0,c.jsx)(uN,{...e,onClose:x,onClaim:oU.Ay.addClaimedOutboundPromotionCode,code:i,outboundPromotion:n}),onCloseRequest:x})]})}function uO(e){let{redesign:t=!1}=e,n=(0,m.yK)([o6.A],()=>o6.A.getGiftable()).filter(e=>{let{giftCodeBatchId:t}=e;return null!=t}),i=(0,o2.N)()?.isEligible??null,{activeOutboundPromotions:l,claimedEndedOutboundPromotions:s,claimedOutboundPromotionCodeMap:r}=(0,oV.y7)(),a=n.find(e=>e.giftCodeBatchId===tk.FB&&!e.consumed),o=n.filter(e=>e.giftCodeBatchId===tk.Bu&&!e.consumed)??[],[u,d]=k().partition(o,e=>{let{subscriptionPlanId:t}=e;return t===tk.gD.PREMIUM_YEAR_TIER_2}),g=l.length+s.length>0,h=t||!g?null:(0,c.jsxs)("div",{className:uy.N1,children:[(0,c.jsx)(E.D,{variant:"heading-md/semibold",children:j.intl.string(j.t.wFsj3B)}),(0,c.jsx)(i2.c,{className:uy.yF})]}),S=!1===i&&g?(0,c.jsxs)("div",{className:uy.uo,children:[(0,c.jsx)(rG.t,{size:"md",color:nK.A.colors.REDESIGN_BUTTON_PREMIUM_PRIMARY_PURPLE_FOR_GRADIENT_2,className:uy.PC}),(0,c.jsx)(z.E,{variant:"text-md/normal",className:uy.Qw,children:j.intl.format(j.t.G4fwxK,{onClick:()=>{(0,tP.default)(),(0,tW.pX)(A.BVt.APPLICATION_STORE)}})}),(0,c.jsx)(o3.A,{showGradient:!0,className:uy.aA,subscriptionTier:tk.pe.TIER_2,textOptions:{textOverride:j.intl.string(j.t.mr4K7D)}})]}):null;return(0,c.jsxs)("div",{children:[h,(0,c.jsx)(o5.A,{className:uy.Yj,isShown:!1===i&&g,type:o5.i.PREMIUM,hasBackground:!0,children:(0,c.jsxs)("div",{className:uy.DE,children:[S,s.map(e=>{let{code:t,promotion:n}=e;return(0,c.jsx)(uj,{outboundPromotion:n,code:t},n.id)}),l.map(e=>(0,c.jsx)(uj,{outboundPromotion:e,code:r[e.id]},e.id)),null!=a?(0,c.jsx)(uE,{skuId:a.skuId,subscriptionPlanId:a.subscriptionPlanId,entitlements:[a],giftCodeBatchId:tk.FB},(0,o4.Kx)(a.skuId,a.subscriptionPlanId)):null,u.length>0?(0,c.jsx)(uE,{skuId:u[0].skuId,subscriptionPlanId:u[0].subscriptionPlanId,entitlements:u,giftCodeBatchId:tk.Bu},(0,o4.Kx)(u[0].skuId,u[0].subscriptionPlanId)):null,d.length>0?(0,c.jsx)(uE,{skuId:d[0].skuId,subscriptionPlanId:d[0].subscriptionPlanId,entitlements:d,giftCodeBatchId:tk.Bu},(0,o4.Kx)(d[0].skuId,d[0].subscriptionPlanId)):null]})})]})}let uL=(0,a.zZ)(o.X.MY_GIFTS_CATEGORY,{useTitle:uR,buildLayout:()=>[uD],usePredicate:()=>{let{claimedOutboundPromotionCodes:e,claimedOutboundPromotionCodesLoaded:t}=(0,m.cf)([o1.A],()=>({claimedOutboundPromotionCodes:o1.A.claimedOutboundPromotionCodes,claimedOutboundPromotionCodesLoaded:o1.A.claimedOutboundPromotionCodesLoaded})),n=(0,oV.T1)({includeClaimedPromotions:!0}),i=(0,o0.Wl)(e,n).length;return t&&n.length+i>0}}),uD=(0,a.E2)(o.X.MY_GIFTS_CONTENT,{useSearchTerms:()=>[uR()],Component:()=>(0,c.jsx)(uO,{redesign:!0})});function uR(){return j.intl.string(j.t.YzjdWJ)}let uP=(0,a.zZ)(o.X.PURCHASED_GIFTS_CATEGORY,{useTitle:uM,buildLayout:()=>[uG]}),uG=(0,a.E2)(o.X.PURCHASED_GIFTS_CONTENT,{useSearchTerms:()=>[uM()],Component:()=>(0,c.jsx)(uv,{})});function uM(){return j.intl.string(j.t.FWe6CP)}var uU=n(532446),uV=n(499454);class uk extends g.Component{state={codeInput:"",submitting:!1,hasError:!1,isPromoCode:!1};get analyticsLocation(){let{analyticsContext:{location:e}}=this.props;return{...e,object:A.ZSU.BUTTON_CTA}}handleChange=e=>{this.setState({codeInput:e,hasError:!1})};handleSubmit=async e=>{e.preventDefault();let{codeInput:t}=this.state;if(""===t)return;let n=t.trim();this.setState({submitting:!0});try{if(this.props.acceptGiftCardRedemption)try{await (0,aJ.Qp)(n),(0,aJ.HF)({initialCode:n,withRedemptionSuccessModal:!0,source:"user_settings_gift_code_redemption",loadId:(0,aH.A)()}),this.setState({codeInput:""});return}catch{}let e=(0,o4.Vd)(t);if(null==e)return void this.setState({hasError:!0});let i=await o7.A.resolveGiftCode(e);if(null!=i&&null!=i.giftCode.promotion)throw this.setState({isPromoCode:!0}),Error("Cannnot redeem promotion code as gift");e7.default.track(A.HAw.OPEN_MODAL,{type:"gift_accept",location:{...this.analyticsLocation,section:A.JJy.LIBRARY_INVENTORY_CODE_REDEMPTION,object:A.ZSU.BUTTON_CTA}}),(0,uV.h)({processedCode:e}),this.setState({codeInput:""})}catch(e){this.setState({hasError:!0})}finally{this.setState({submitting:!1})}};render(){let{redesign:e,obscureInput:t}=this.props,{codeInput:n,submitting:i,hasError:l,isPromoCode:s}=this.state,r=e?j.intl.string(j.t["hVEn/j"]):j.intl.string(j.t.SeKIoS),a=e?j.intl.string(j.t.epHMtp):void 0;return(0,c.jsx)(nZ.n,{label:e?void 0:j.intl.string(j.t["il+VCo"]),children:(0,c.jsx)("form",{onSubmit:this.handleSubmit,children:(0,c.jsxs)(uU.M,{children:[(0,c.jsx)(li.k,{label:r,description:a,type:t?"password":"text",value:n,onChange:this.handleChange,placeholder:"WUMP-AAAAA-BBBBB-CCCCC",error:!s&&l?j.intl.string(j.t.Y11a2u):null,helperText:s?j.intl.format(j.t.gPt3PE,{promoLink:()=>{window.open(`https://discord.com/billing/promotions/${n}`)}}):null,fullWidth:!0}),(0,c.jsx)(p.$,{variant:"primary",text:j.intl.string(j.t.KIpp7M),type:"submit",loading:i,disabled:e&&0===n.length})]})})})}}function uw(e){let{redesign:t=!1}=e,{enabled:n}=(0,oT.c)({location:"UserSettingsBilling"}),i=g.useContext(e7.AnalyticsContext),l=(0,m.bG)([e8.A],()=>e8.A.enabled);return(0,c.jsx)(uk,{analyticsContext:i,obscureInput:l,acceptGiftCardRedemption:n,redesign:t})}let uF=(0,a.zZ)(o.X.REDEEM_GIFT_CATEGORY,{useTitle:()=>j.intl.string(j.t["il+VCo"]),buildLayout:()=>[uB],usePredicate:()=>!(0,ok.Hp)()}),uB=(0,a.E2)(o.X.REDEEM_CODE_INPUT,{Component:()=>(0,c.jsx)(uw,{redesign:!0}),useSearchTerms:()=>[j.intl.string(j.t["jcSP+g"]),j.intl.string(j.t["il+VCo"])]}),uz=(0,a.t_)(o.X.GIFT_PANEL,{useTitle:()=>j.intl.string(j.t["jcSP+g"]),buildLayout:()=>[uF,uL,oJ,uP,oF],initialize:()=>{oU.Ay.fetchClaimedOutboundPromotionCodes(),(0,oM.Ig)("gift_inventory")&&(0,oG.o0)(oR.$.GIFTING)}}),uX=(0,a.i4)(o.X.GIFT_SIDEBAR_ITEM,{useTitle:()=>j.intl.string(j.t["jcSP+g"]),icon:oP.o,usePersistentBadge:function(){let e=(0,oV.IO)().length;return g.useMemo(()=>({badgeType:d.Xi.COUNT,count:e}),[e])},buildLayout:()=>[uz]});var uY=n(659758),uH=n(322281),uK=n(815846);let uW=(0,a.E2)(o.X.NITRO_SETTING,{Component:function(){let e=(0,m.bG)([l1.default],()=>l1.default.getCurrentUser());return(0,rK.YE)(e,tk.PremiumTypes.TIER_2)?(0,c.jsx)(uK.A,{}):(0,c.jsx)(uH.A,{})},useSearchTerms:()=>[j.intl.string(j.t.Ipxkog)]}),uZ=(0,a.zZ)(o.X.NITRO_CATEGORY,{buildLayout:()=>[uW]}),uq=(0,a.t_)(o.X.NITRO_PANEL,{useTitle:()=>j.intl.string(j.t.Ipxkog),useObscuredNotice:az.L,buildLayout:()=>[uZ]}),uQ=(0,a.i4)(o.X.NITRO_SIDEBAR_ITEM,{useTitle:()=>j.intl.string(j.t.Ipxkog),icon:rG.t,usePersistentBadge:function(e){let t=(0,uY.e)(e);return g.useMemo(()=>({badgeType:d.Xi.STRONGLY_DISCOURAGED_CUSTOM,customBadge:t}),[t])},buildLayout:()=>[uq]});var uJ=n(104510),u$=n(820739),u0=n(73825),u1=n(160946),u2=n(859241),u3=n(531260),u5=n(527113),u6=n(338548),u4=n(776096),u8=n(711014),u7=n(178368),u9=n(725538),de=n(168482);function dt(){return(0,c.jsxs)("div",{className:u9.iE,children:[(0,c.jsx)("img",{className:u9.Kk,alt:"",src:de}),(0,c.jsxs)("div",{className:u9.pq,children:[(0,c.jsx)(z.E,{variant:"text-lg/bold",children:j.intl.string(j.t.ZHNSYf)}),(0,c.jsx)(z.E,{variant:"text-sm/medium",color:"text-muted",children:j.intl.string(j.t.kCj5ps)})]}),(0,c.jsx)(p.$,{variant:"secondary",text:j.intl.string(j.t.JFlifp),onClick:function(){(0,tW.pX)(A.BVt.GUILD_DISCOVERY),(0,tP.default)()}})]})}var dn=n(365199),di=n(906199),dl=n(443865),ds=n(980707),dr=n(473145);function da(e){let{guildBoostSlot:t,onClose:i,hasCancelableGuildBoostSlot:l,premiumSubscription:s,onSelect:r,fractionalState:a}=e,u={transfer:{label:null!=t.premiumGuildSubscription?j.intl.string(j.t["PR0n//"]):j.intl.string(j.t["+fmEYG"]),subtext:t.isOnCooldown()?j.intl.string(j.t.XnB8M0):null,disabled:t.isOnCooldown()},cancel:{label:j.intl.string(j.t.twFU3R),subtext:l?null:j.intl.string(j.t.oQ9lOh),disabled:!l},uncancel:{label:j.intl.string(j.t["2glQNp"]),subtext:null,disabled:!1}};switch(s.status){case A.Dmq.PAST_DUE:u.cancel.disabled=!0,u.cancel.subtext=j.intl.string(j.t.WnL6DV),u.uncancel.disabled=!0;break;case A.Dmq.PAUSE_PENDING:case A.Dmq.PAUSED:a===tk.xc.NONE&&(u.transfer.disabled=!0,u.transfer.subtext=j.intl.string(j.t.LiLRRT),u.cancel.subtext=j.intl.string(j.t["1ywaWL"]),u.cancel.disabled=!0,u.uncancel.disabled=!0)}let d=g.useMemo(()=>s.isPausedOrPausePending&&a===tk.xc.NONE?(0,c.jsx)(e0.Dr,{id:"manage-subscription",label:j.intl.string(j.t.obRG6Y),action:()=>(0,t9.openUserSettings)(o.X.SUBSCRIPTIONS_PANEL),iconLeft:dl.x,leadingAccessory:{type:"icon",icon:dl.x}}):null,[a,s]);return(0,c.jsxs)(ds.W,{"data-menu-migrated-auto":!0,onSelect:r,navId:"subscription-context",variant:"fixed","aria-label":j.intl.string(j.t.ogxXGq),onClose:i,children:[(0,c.jsx)(e0.Dr,{id:"apply",label:u.transfer.label,subtext:u.transfer.subtext,action:function(){(0,ln.openModalLazy)(async()=>{let{default:e}=await Promise.all([n.e("50614"),n.e("56275"),n.e("93781"),n.e("87356"),n.e("10943"),n.e("34428"),n.e("93173"),n.e("96329"),n.e("38249")]).then(n.bind(n,724624));return n=>(0,c.jsx)(e,{...n,guildBoostSlots:[t],locationSection:A.JJy.SETTINGS_PREMIUM})})},disabled:u.transfer.disabled}),(0,dr.I5)(t)?(0,c.jsx)(e0.Dr,{id:"uncancel",label:u.uncancel.label,subtext:u.uncancel.subtext,action:function(){(0,ln.openModalLazy)(async()=>{let{default:e}=await Promise.resolve().then(n.bind(n,342744));return n=>(0,c.jsx)(e,{...n,guildBoostSlotId:t.id})})},disabled:u.uncancel.disabled}):(0,c.jsx)(e0.Dr,{id:"cancel",label:u.cancel.label,subtext:u.cancel.subtext,action:function(){(0,ln.openModalLazy)(async()=>{let{default:e}=await Promise.resolve().then(n.bind(n,983511));return n=>(0,c.jsx)(e,{...n,guildBoostSlot:t})})},disabled:u.cancel.disabled,color:"danger"}),d]})}var du=n(545934),dd=n(548118),dc=n(987144),dg=n(864310),dm=n(378102);function dA(e){let{guild:t,className:n}=e,{total:i}=(0,dg.A)(t.id);return(0,c.jsxs)("div",{className:n??dm.OA,children:[(0,c.jsx)(dd.Ay,{className:dm.$f,guild:t,size:dd.Ay.Sizes.MEDIUM}),(0,c.jsxs)("div",{className:dm.gI,children:[(0,c.jsx)(z.E,{variant:"heading-md/semibold",color:"text-default",tag:"span",children:t.name}),(0,c.jsxs)("div",{className:dm.ew,children:[(0,c.jsxs)("div",{className:dm.QW,children:[(0,c.jsx)(uJ._,{className:dm.Wz,color:nK.A.unsafe_rawColors.GUILD_BOOSTING_PINK_REFRESH}),(0,c.jsx)(z.E,{variant:"text-xs/semibold",color:"text-subtle",children:j.intl.format(j.t["pob/cL"],{subscriptions:i})})]}),t.premiumTier!==A.TVA.NONE&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{className:dm.zk}),(0,c.jsx)(z.E,{variant:"text-xs/semibold",color:"text-subtle",children:(0,dr.gb)(t.premiumTier,{useLevels:!1})})]})]})]})]})}function dh(e){let{guildId:t}=e,n=(0,m.bG)([lc.A],()=>lc.A.getGuild(t),[t]);return null==n?null:(0,c.jsxs)("div",{className:dm.Nr,children:[(0,c.jsx)(dA,{guild:n}),(0,c.jsx)(p.$,{variant:"secondary",size:"sm",icon:uJ._,text:j.intl.string(j.t.aBHecF),onClick:()=>{(0,dc.g)({analyticsLocations:[],analyticsLocation:{page:A.liQ.GUILD_BOOSTING_USER_SETTINGS,section:A.JJy.GUILD_BOOSTING_RECOMMENDED_SERVER_BOOST_THIS_SERVER_CTA,object:A.ZSU.BUTTON_CTA,objectType:A.AnalyticsObjectTypes.BUY},guild:n})}})]})}var dE=n(512062);let dS="https://cdn.discordapp.com/assets/content/272d3fa6496aedb9dee76f2d555913bfd56c9e9aacd6de3c18449644d9749657.png";function dx(e){let{slot:t,guildTier:n,premiumSubscription:i,hasCancelableSlots:l,isLast:s}=e,r=g.useRef(null),a=(0,dr.I5)(t),o=g.useMemo(()=>null!=t.cooldownEndsAt?new Date(t.cooldownEndsAt):null,[t.cooldownEndsAt]),u=null!=o&&o>new Date,d=(0,u3.A)(),m=g.useMemo(()=>(function(e,t){if(null==e||e===A.TVA.NONE)return"";let n=[j.intl.formatToPlainString(j.t["dLlKX/"],{numEmojiSlots:tk.TG[e].limits.emoji}),j.intl.formatToPlainString(j.t["+ANIfv"],{numStickerSlots:tk.TG[e].limits.stickers}),j.intl.formatToPlainString(j.t["4gt60b"],{numSoundboardSlots:tk.TG[e].limits.soundboardSounds}),j.intl.formatToPlainString(j.t.XahSjZ,{resolution:tk.TG[e].limits.screenShareQualityResolution,framerate:tk.TG[e].limits.screenShareQualityFramerate}),j.intl.formatToPlainString(j.t.NbNs7S,{bitrate:tk.TG[e].limits.bitrate/1e3}),j.intl.formatToPlainString(j.t.VVKcpn,{filesize:tk.TG[e].limits.fileSize/1024/1024}),j.intl.formatToPlainString(j.t.TbpCvv,{numVideoStageSeats:tk.TG[e].limits.stageVideoUsers}),j.intl.string(j.t.LDyX3i),j.intl.string(j.t.YtGlPW)];e>=A.TVA.TIER_2&&(n.push(j.intl.string(j.t.SztbtN)),n.push(j.intl.string(j.t["3GK91n"]))),e>=A.TVA.TIER_3&&n.push(j.intl.string(j.t["XUUJd+"]));let i=0;for(let e=0;e<t.length;e++)i=31*i+t.charCodeAt(e)|0;let l=n[Math.abs(i)%n.length];return j.intl.formatToPlainString(j.t["/dOAmQ"],{perk:l})})(n,t.id),[n,t.id]),h=g.useMemo(()=>{if(""!==m)return m;let e=null!=t.premiumGuildSubscription?a3.default.extractTimestamp(t.premiumGuildSubscription.id):0;return j.intl.formatToPlainString(j.t.lY2Bur,{date:new Date(e)})},[m,t.premiumGuildSubscription]),E=g.useMemo(()=>a?i.isPausedForFractionalPremium?d.endsAt.toDate():i.currentPeriodEnd:null,[a,i,d]);return(0,c.jsxs)("div",{className:ie()(dE.iq,{[dE.Mt]:s}),children:[(0,c.jsxs)("div",{className:dE.kd,children:[(0,c.jsx)("img",{alt:"",className:dE.bB,src:dS}),a&&null!=E?(0,c.jsx)(z.E,{variant:"text-sm/medium",color:"text-subtle",children:j.intl.format(j.t.Z4ULRD,{date:E})}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(z.E,{variant:"text-sm/medium",color:"text-subtle",children:h}),u&&null!=o&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{className:dE.zk}),(0,c.jsx)(z.E,{variant:"text-sm/medium",color:"text-feedback-info",children:j.intl.formatToPlainString(j.t.YJlswH,{date:o.toLocaleDateString()})})]}),!u&&null!=i.trialEndsAt&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{className:dE.zk}),(0,c.jsx)(z.E,{variant:"text-sm/medium",color:"text-feedback-warning",children:j.intl.formatToPlainString(j.t.OdPSpk,{date:new Date(i.trialEndsAt).toLocaleDateString()})})]})]})]}),(0,c.jsx)(rX.Y,{targetElementRef:r,renderPopout:e=>{let{closePopout:n}=e;return(0,c.jsx)(da,{onClose:n,guildBoostSlot:t,premiumSubscription:i,hasCancelableGuildBoostSlot:l,fractionalState:d.fractionalState})},position:"right",align:"center",children:e=>(0,c.jsx)(t8.D,{innerRef:r,"aria-label":j.intl.string(j.t.PdRCRg),className:dE.Mj,...e,children:(0,c.jsx)(dn.j,{size:"xs",color:nK.A.colors.INTERACTIVE_TEXT_DEFAULT})})})]})}function dT(e){let{guildId:t,slots:n,premiumSubscription:i,hasCancelableSlots:l}=e,s=(0,m.bG)([lc.A],()=>lc.A.getGuild(t),[t]);return(0,c.jsxs)("div",{className:dE.Nr,children:[(0,c.jsx)("div",{className:dE.MY,children:null!=s?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(dA,{guild:s,className:dE.OA}),(0,c.jsx)(p.$,{variant:"secondary",size:"sm",text:j.intl.string(j.t.KLOhbO),onClick:()=>{(0,tP.default)(),(0,di.K4)({guildId:s.id,location:{section:A.JJy.GUILD_BOOSTING_RECOMMENDED_SERVER_GO_TO_SERVER_CTA}})}})]}):(0,c.jsx)("div",{className:dE.OA,children:(0,c.jsx)(E.D,{variant:"heading-md/semibold",color:"text-default",children:j.intl.string(j.t["6Kwwuo"])})})}),n.map((e,t)=>(0,c.jsx)(dx,{slot:e,guildTier:s?.premiumTier,premiumSubscription:i,hasCancelableSlots:l,isLast:t===n.length-1},e.id))]})}function dp(e){let{guildBoostSlots:t,premiumSubscription:n,pausedAppliedGuildBoosts:i,isPaused:l}=e,{boostsByGuildId:s,numActiveSlots:r}=g.useMemo(()=>{if(l&&null!=n)return{boostsByGuildId:function(e,t){let n={};for(let t of e)t.guildId in n||(n[t.guildId]=[]),n[t.guildId].push(t);let i={};for(let e of Object.keys(n)){let l=n[e];i[e]=l.map(n=>du.A.createFromServer({id:n.id,subscription_id:t.id,canceled:!1,premium_guild_subscription:{id:n.id,guild_id:e},cooldown_ends_at:null},t))}return i}(i,n),numActiveSlots:0};let e=0,s={};for(let n of Object.keys(t)){let i=t[n];if(!(0,dr.I5)(i)&&e++,null!=i.premiumGuildSubscription){let e=i.premiumGuildSubscription.guildId;e in s||(s[e]=[]),s[e].push(i)}}return{boostsByGuildId:s,numActiveSlots:e}},[t,l,i,n]);if(null==n||0===Object.keys(s).length)return null;let a=r>rK.Ay.getNumIncludedPremiumGuildSubscriptionSlots(n.planId);return(0,c.jsx)("div",{className:dE.kR,children:a3.default.keys(s).map(e=>(0,c.jsx)(dT,{guildId:e,slots:s[e],premiumSubscription:n,hasCancelableSlots:a},e))})}var df=n(502572),dI=n(983511),d_=n(342744),dN=n(496431);let dC=function(e){let{className:t,cooldown:n}=e,i=(0,dN.A)(n);return(0,c.jsx)(z.E,{className:t,variant:"text-sm/medium",color:"text-muted",children:(0,il.uN)(i,{days:j.t.WUTPDc,hours:j.t.c1qodV,minutes:j.t["2+A3dv"]})})};var db=n(928171);function dy(e){let{guildBoostSlots:t,fractionalPremiumState:i}=e,l=(0,m.bG)([of.A],()=>of.A.getPremiumTypeSubscription()),{unappliedSlots:s,numActiveSlots:r}=g.useMemo(()=>{let e=[],n=0;for(let i of t)!(0,dr.I5)(i)&&n++,null==i.premiumGuildSubscription&&e.push(i);return{unappliedSlots:e,numActiveSlots:n}},[t]),a=r>(null!=l?rK.Ay.getNumIncludedPremiumGuildSubscriptionSlots(l.planId):0),o=l?.isPausedOrPausePending===!0&&i===tk.xc.NONE;return 0===s.length?null:(0,c.jsxs)("div",{className:db.Nr,children:[(0,c.jsxs)("div",{className:db.MY,children:[(0,c.jsxs)("div",{className:db._L,children:[(0,c.jsxs)("div",{className:db.MD,children:[(0,c.jsx)("img",{alt:"",className:db.F8,src:dS}),(0,c.jsx)("div",{className:ie()(db.qS,"theme-dark"),children:(0,c.jsx)("span",{className:db.Vv,children:s.length})})]}),(0,c.jsxs)("div",{className:db.Qp,children:[(0,c.jsx)(z.E,{variant:"heading-md/semibold",color:"text-default",tag:"span",children:j.intl.format(j.t.BPadnO,{numUnappliedGuildBoostSlots:s.length})}),(0,c.jsx)(z.E,{variant:"text-xs/semibold",color:"text-subtle",children:j.intl.format(j.t.Kaw82o,{numUnappliedGuildBoostSlots:s.length})})]})]}),(0,c.jsx)(df.A,{shouldShow:o,text:j.intl.string(j.t.mOWsF1),"aria-label":j.intl.string(j.t.mOWsF1),children:e=>(0,c.jsx)(p.$,{...e,variant:"primary",size:"sm",icon:uJ._,text:j.intl.string(j.t.BMx1iy),disabled:o,onClick:()=>{(0,ln.openModalLazy)(async()=>{let{default:e}=await Promise.all([n.e("93781"),n.e("96329")]).then(n.bind(n,770101));return t=>(0,c.jsx)(e,{...t,onSelectGuild:e=>{t.onClose(),(0,dc.g)({analyticsLocations:[],analyticsLocation:{page:A.liQ.GUILD_BOOSTING_USER_SETTINGS,section:A.JJy.SETTINGS_PREMIUM,object:A.ZSU.BUTTON_CTA,objectType:A.AnalyticsObjectTypes.BUY},guild:e})}})})}})})]}),s.map((e,t)=>(0,c.jsx)(dv,{slot:e,isLast:t===s.length-1,isCancelable:a&&!(0,dr.I5)(e),isCanceled:(0,dr.I5)(e),premiumSubscription:l,modificationsDisabled:o},e.id))]})}function dv(e){let t,{slot:n,isLast:i,isCancelable:l,isCanceled:s,premiumSubscription:r,modificationsDisabled:a}=e,o=g.useRef(null),u=g.useMemo(()=>null!=n.cooldownEndsAt?new Date(n.cooldownEndsAt):null,[n.cooldownEndsAt]);t=s&&null!=r?(0,c.jsx)(z.E,{variant:"text-sm/medium",color:"text-subtle",children:j.intl.format(j.t.Z4ULRD,{date:r.currentPeriodEnd})}):n.isOnCooldown()&&null!=u?(0,c.jsx)(dC,{cooldown:u.getTime()}):(0,c.jsx)(z.E,{variant:"text-sm/medium",color:"text-subtle",children:j.intl.string(j.t["2mcafz"])});let d=l||s;return(0,c.jsxs)("div",{className:ie()(db.iq,{[db.Mt]:i}),children:[(0,c.jsxs)("div",{className:db.kd,children:[(0,c.jsx)("img",{alt:"",className:db.bB,src:dS}),t]}),d&&(0,c.jsx)(rX.Y,{targetElementRef:o,renderPopout:e=>{let{closePopout:t}=e;return(0,c.jsxs)(ds.W,{navId:"unapplied-boost-actions","aria-label":j.intl.string(j.t.ogxXGq),onSelect:void 0,onClose:t,children:[l&&(0,c.jsx)(e0.Dr,{id:"cancel-boost",label:j.intl.string(j.t.twFU3R),color:"danger",disabled:a,subtext:a?j.intl.string(j.t.mOWsF1):void 0,action:()=>{t(),(0,ln.openModalLazy)(async()=>e=>(0,c.jsx)(dI.default,{...e,guildBoostSlot:n}))}}),s&&(0,c.jsx)(e0.Dr,{id:"uncancel-boost",label:j.intl.string(j.t["2glQNp"]),disabled:a,subtext:a?j.intl.string(j.t.mOWsF1):void 0,action:()=>{t(),(0,ln.openModalLazy)(async()=>e=>(0,c.jsx)(d_.default,{...e,guildBoostSlotId:n.id}))}})]})},align:"right",position:"bottom",children:e=>(0,c.jsx)(t8.D,{innerRef:o,"aria-label":j.intl.string(j.t["UKOtz+"]),className:db.Mj,...e,children:(0,c.jsx)(dn.j,{size:"xs",color:nK.A.colors.INTERACTIVE_TEXT_DEFAULT})})})]})}var dj=n(942053);function dO(e){let{guildBoostSlots:t,guildBoostSlotsByGuildId:n,premiumSubscription:i,pausedAppliedGuildBoosts:l,fractionalPremiumState:s}=e,r=eS.A.getArticleURL(A.MVz.GUILD_BOOSTING_FAQ),a=i?.isPaused===!0&&s!==tk.xc.FP_SUB_PAUSED,o=t.some(e=>null==e.premiumGuildSubscription),u=a&&l.length>0,d=a?u:t.some(e=>null!=e.premiumGuildSubscription);return o||d?(0,c.jsxs)("div",{className:dj.i,children:[(0,c.jsxs)("div",{className:dj.b,children:[(0,c.jsx)(E.D,{variant:"heading-md/semibold",children:j.intl.string(j.t.W5rDjW)}),(0,c.jsx)(z.E,{variant:"text-sm/normal",color:"text-muted",children:j.intl.format(j.t.SpDz1x,{helpdeskArticle:r})})]}),(0,c.jsx)(dp,{guildBoostSlots:n,premiumSubscription:i,pausedAppliedGuildBoosts:l,isPaused:a}),(0,c.jsx)(dy,{guildBoostSlots:t,fractionalPremiumState:s})]}):null}var dL=n(333722),dD=n(401721);function dR(){return(0,c.jsxs)("div",{className:dD.iE,children:[(0,c.jsx)(E.D,{variant:"heading-xl/normal",children:j.intl.string(j.t.IzKs3o)}),(0,c.jsx)("div",{className:dD.kR,children:dL.s.map((e,t)=>{let n=e.icon;return(0,c.jsxs)("div",{className:dD.Nr,children:[(0,c.jsx)(n,{className:dD.Kk}),(0,c.jsx)(z.E,{className:dD.h_,color:"text-muted",variant:"text-sm/medium",children:e.getText()})]},t)})})]})}var dP=n(847374),dG=n(232122),dM=n(630579);function dU(){let[e,t]=g.useState(null),[n,i]=g.useState(null);return(0,c.jsxs)("div",{className:dM.iE,children:[(0,c.jsx)(E.D,{variant:"heading-xl/normal",children:j.intl.string(j.t.HPJ6Nj)}),(0,c.jsx)("ul",{className:dM.p_,children:dG.m.map((l,s)=>{let r=e===s,a=n===s,o=r||a?"text-strong":"text-muted";return(0,c.jsxs)(t8.D,{tag:"li",className:ie()(dM.Aw,{[dM.$K]:r}),onClick:()=>t(e=>e===s?null:s),onMouseEnter:()=>i(s),onMouseLeave:()=>i(null),children:[(0,c.jsxs)("div",{className:dM.k7,children:[(0,c.jsx)(z.E,{className:dM.b1,color:o,variant:"heading-md/semibold",tag:"span",children:l.getQuestion()}),(0,c.jsx)(dP.a,{size:"sm",color:nK.A.colors.INTERACTIVE_ICON_DEFAULT,className:dM.q4,style:{transform:r?"rotate(180deg)":"rotate(0deg)"}})]}),r&&(0,c.jsx)(z.E,{className:dM.ZF,color:"text-muted",variant:"text-sm/medium",children:l.getAnswer()})]},s)})})]})}var dV=n(182859),dk=n(853513),dw=n(880482);function dF(){let e=eS.A.getArticleURL(A.MVz.GUILD_SUBSCRIPTIONS);return(0,c.jsxs)("div",{className:dw.wx,children:[(0,c.jsxs)("div",{className:dw.Qs,children:[(0,c.jsxs)("div",{className:dw.B5,children:[(0,c.jsx)("img",{alt:"",className:dw.F8,src:"/assets/263e4cc9043cab70.svg"}),(0,c.jsx)(E.D,{variant:"heading-xl/normal",children:j.intl.string(dk.default.hjvcLO)})]}),(0,c.jsx)(z.E,{variant:"text-sm/normal",color:"text-muted",children:j.intl.format(j.t.TUHyoA,{helpdeskArticle:e})})]}),(0,c.jsx)(dV.A,{variant:"member",className:dw.iO,analyticsLocation:{page:A.liQ.GUILD_BOOSTING_USER_SETTINGS,section:A.JJy.HERO,object:A.ZSU.CARD},videoPlacement:"settings_header"})]})}var dB=n(315629),dz=n(87719),dX=n(524170);function dY(){let e=(0,m.bG)([l1.default],()=>l1.default.getCurrentUser());if(null==e||rK.Ay.hasFreeBoosts(e))return null;let t=eS.A.getArticleURL(A.MVz.GUILD_BOOSTING_FAQ);return(0,c.jsxs)(dB.h,{color:"nitro-pink",className:dX.vK,children:[(0,c.jsxs)("div",{className:dX.nw,children:[(0,c.jsx)("img",{alt:"",className:dX.q3,src:dS}),(0,c.jsxs)("div",{className:dX.Tm,children:[(0,c.jsx)(z.E,{variant:"heading-md/semibold",color:"text-default",tag:"span",children:j.intl.format(j.t.Idh1Vs,{count:tk.M4,boostCount:tk.M4})}),(0,c.jsxs)("div",{className:dX.xv,children:[(0,c.jsx)(rG.t,{className:dX.nE}),(0,c.jsx)(z.E,{variant:"text-xs/semibold",color:"text-subtle",children:j.intl.format(j.t["6UAu+f"],{count:tk.M4,boostCount:tk.M4,helpdeskArticle:t})})]})]})]}),(0,c.jsx)(p.$,{variant:"expressive",size:"sm",icon:rG.t,text:j.intl.string(j.t["8x0jKT"]),onClick:dz.e})]})}var dH=n(738262);function dK(){let e=(0,m.bG)([u4.A],()=>u4.A.affinities),t=(0,m.bG)([u8.Ay],()=>u8.Ay.getFlattenedGuildIds()),n=g.useMemo(()=>{let n=e.slice(0,3).map(e=>e.guildId);for(let e=0;e<t.length&&n.length<3;e++){let i=t[e];n.includes(i)||n.push(i)}return n},[e,t]);return 0===n.length?null:(0,c.jsxs)("div",{className:dH.i,children:[(0,c.jsx)(E.D,{variant:"heading-md/semibold",children:j.intl.string(j.t.r90Wgo)}),(0,c.jsx)("div",{className:dH.k,children:n.map(e=>(0,c.jsx)(dh,{guildId:e},e))})]})}var dW=n(553429);function dZ(e){let{count:t,disabledReason:i}=e,l=eS.A.getArticleURL(A.MVz.GUILD_BOOSTING_FAQ);return(0,c.jsxs)(dB.h,{color:"nitro-pink",className:dW.vK,children:[(0,c.jsxs)("div",{className:dW.nw,children:[(0,c.jsxs)("div",{className:dW.MD,children:[(0,c.jsx)("img",{alt:"",className:dW.F8,src:dS}),(0,c.jsx)("div",{className:ie()(dW.qS,"theme-dark"),children:(0,c.jsx)("span",{className:dW.Vv,children:t})})]}),(0,c.jsxs)("div",{className:dW.Tm,children:[(0,c.jsx)(z.E,{variant:"heading-md/semibold",color:"text-default",tag:"span",children:j.intl.format(j.t.KewnLu,{count:t,boostCount:t})}),(0,c.jsxs)("div",{className:dW.xv,children:[(0,c.jsx)(rG.t,{className:dW.nE}),(0,c.jsx)(z.E,{variant:"text-xs/semibold",color:"text-subtle",children:j.intl.format(j.t["6UAu+f"],{count:tk.M4,boostCount:tk.M4,helpdeskArticle:l})})]})]})]}),(0,c.jsx)(df.A,{shouldShow:null!=i,text:i??"","aria-label":i,children:e=>(0,c.jsx)(p.$,{...e,variant:"primary",size:"sm",icon:uJ._,text:j.intl.string(j.t.BMx1iy),disabled:null!=i,onClick:()=>{(0,ln.openModalLazy)(async()=>{let{default:e}=await Promise.all([n.e("93781"),n.e("96329")]).then(n.bind(n,770101));return t=>(0,c.jsx)(e,{...t,onSelectGuild:e=>{t.onClose(),(0,dc.g)({analyticsLocations:[],analyticsLocation:{page:A.liQ.GUILD_BOOSTING_USER_SETTINGS,section:A.JJy.SETTINGS_PREMIUM,object:A.ZSU.BUTTON_CTA,objectType:A.AnalyticsObjectTypes.BUY},guild:e})}})})}})})]})}var dq=n(561835);function dQ(e){let{premiumSubscription:t}=e,n=(0,m.bG)([u7.A],()=>u7.A.boostSlots),i=g.useMemo(()=>Object.values(n),[n]),l=(0,m.bG)([l1.default],()=>l1.default.getCurrentUser()),s=(0,m.bG)([u4.A],()=>u4.A.affinities),r=(0,m.bG)([u8.Ay],()=>u8.Ay.getFlattenedGuildIds()),a=s.length>0||r.length>0,o=g.useMemo(()=>i.filter(e=>null!=e.premiumGuildSubscription),[i]).length,u=(0,m.bG)([u2.A],()=>u2.A.getCurrentUserAppliedBoosts()),{fractionalState:d}=(0,u3.A)({forceFetch:!0}),A=l?.isPremiumGroupMember(),h=t?.isPausedOrPausePending===!0&&d===tk.xc.NONE,E=g.useMemo(()=>i.some(e=>null==e.premiumGuildSubscription&&e.isAvailable()),[i]),S=h?j.intl.string(j.t.mOWsF1):E?void 0:j.intl.string(j.t.xr4m5B),x=g.useMemo(()=>{if(null==t)return 0;let e=rK.Ay.getNumIncludedPremiumGuildSubscriptionSlots(t.planId);return 0===e||e!==i.length?0:Math.max(0,e-o)},[t,i.length,o]);return(0,c.jsxs)("div",{className:dq.GO,children:[(0,c.jsx)(ov.kb,{className:dq.ek}),(0,c.jsx)(dF,{}),(0,c.jsx)(dY,{}),x>0&&(0,c.jsx)(dZ,{count:x,disabledReason:S}),A&&(0,c.jsx)(u6.A,{}),!a&&(0,c.jsx)(dt,{}),(0,c.jsxs)("div",{className:dq.C_,children:[(0,c.jsx)(dO,{guildBoostSlots:i,guildBoostSlotsByGuildId:n,premiumSubscription:t,pausedAppliedGuildBoosts:u,fractionalPremiumState:d}),(0,c.jsx)(dK,{}),(0,c.jsx)(u5.A,{hideHeading:!0,hideTier0:!0}),(0,c.jsx)(dR,{}),(0,c.jsx)(dU,{})]})]})}var dJ=n(672140);let d$=(0,a.E2)(o.X.PREMIUM_GUILD_SUBSCRIPTIONS_SETTING,{Component:function(){g.useEffect(()=>{e2.h.wait(()=>{aQ.hP(),aQ.$o(),(0,u$.CD)(),(0,u0.zS)(null,null,A.tF5.DISCOVERY),(0,u$.tO)(!0)})},[]);let{hasFetchedSubscriptions:e,premiumSubscription:t}=(0,m.cf)([of.A],()=>({hasFetchedSubscriptions:of.A.hasFetchedSubscriptions(),premiumSubscription:of.A.getPremiumTypeSubscription()})),n=(0,u1.Y)(),i=(0,m.bG)([op.A],()=>op.A.hasFetchedPaymentSources),l=(0,m.bG)([u2.A],()=>u2.A.isFetchingCurrentUserAppliedBoosts),s=!e||!n||!i||l,[r,a]=g.useState(!1);return(s||r||a(!0),s&&!r)?(0,c.jsx)("div",{className:ie()(dJ.kL,dJ.Lq),children:(0,c.jsx)(aY.y,{})}):(0,c.jsxs)("div",{className:dJ.kL,children:[(0,c.jsx)("div",{className:dJ.Tp}),(0,c.jsx)("div",{className:dJ.Qs,children:(0,c.jsx)(dQ,{premiumSubscription:t})})]})},useSearchTerms:()=>[j.intl.string(j.t["+CbP2v"]),j.intl.string(j.t.Nn1lJy)]}),d0=(0,a.zZ)(o.X.PREMIUM_GUILD_SUBSCRIPTIONS_CATEGORY,{buildLayout:()=>[d$]}),d1=(0,a.t_)(o.X.PREMIUM_GUILD_SUBSCRIPTIONS_PANEL,{useTitle:()=>j.intl.string(j.t["+CbP2v"]),buildLayout:()=>[d0]}),d2=(0,a.i4)(o.X.PREMIUM_GUILD_SUBSCRIPTIONS_SIDEBAR_ITEM,{useTitle:()=>j.intl.string(j.t["+CbP2v"]),icon:uJ._,buildLayout:()=>[d1]});var d3=n(153659),d5=n(155984),d6=n(357758),d4=n(262077),d8=n(281445),d7=n(933832),d9=n(624479),ce=n(626584),ct=n(131607),cn=n(95035),ci=n(196736),cl=n(685743),cs=n(349085),cr=n(342942),ca=n(252589),co=n(758836),cu=n(49999),cd=n(275695),cc=n(356061);let cg=new ce.A("GameServerSubscriptionsSection");function cm(e){return e.toLocaleDateString(void 0,{year:"numeric",month:"numeric",day:"numeric"})}function cA(e,t){return e.priceLabel===t.priceLabel&&e.dateLabel===t.dateLabel&&e.isCanceled===t.isCanceled&&e.isDanger===t.isDanger}let ch=g.memo(function(e){let{server:t,planOptionBySkuId:n,canUseShopDiscount:i}=e,{analyticsLocations:l}=(0,eL.Ay)(),s=t.instance.subscriptionId,r=t.instance.planId,a=(0,cs.A)(t.gameId,"cover")??t.coverUrl;g.useEffect(()=>{(0,u0.ur)(r).catch(()=>{})},[r]);let[o,u]=(0,ct.kn)([er.M.GAME_SERVER_HOSTING_PORTKEY_TOS]),d=o!==er.M.GAME_SERVER_HOSTING_PORTKEY_TOS,h=ur.default.getId()??"0",{handleCopyServerIp:E,animateCopyIcon:S}=(0,cl.A)(h,t.id,tv.A.GAME_SERVER_PAGE,t.serverIp),x=g.useCallback(()=>{(0,cr.A)({provider:d8.X.SHOCKBYTE,onAccept:()=>{u(cu.i.TAKE_ACTION),E()}})},[u,E]),{priceLabel:T,dateLabel:f,isCanceled:I,isDanger:_}=(0,m.bG)([of.A,uo.A],()=>{let e=null!=s?of.A.getSubscriptionById(s):null;if(null==e)return{priceLabel:null,dateLabel:null,isCanceled:!1,isDanger:!1};let t=null!=e.canceledAt,l=!t&&null!=e.renewalMutations,r=l?e.renewalMutations?.items[0]?.planId:e.items[0]?.planId,a=null!=r?uo.A.get(r):null,o=null!=a?n.get(a.skuId):null,u=i&&o?.nitroPriceAmount!=null?o.nitroPriceAmount:o?.standardPriceAmount,d=null!=u&&o?.priceCurrency!=null?j.intl.formatToPlainString(j.t.AbOLNu,{price:(0,a1.$g)(u,o.priceCurrency)}):null,c=cm(e.currentPeriodEnd);return{priceLabel:d,dateLabel:t?j.intl.formatToPlainString(cd.default["3aEgK6"],{date:c}):l?j.intl.formatToPlainString(cd.default.KFSA3M,{date:c}):j.intl.formatToPlainString(cd.default["9A6cRW"],{date:c}),isCanceled:t,isDanger:t||l}},[s,n,i],cA),N=g.useCallback(()=>{if(null==s)return;let e=of.A.getSubscriptionById(s),t=null!=e?cm(e.currentPeriodEnd):"";(0,nW.A)({title:j.intl.string(cd.default.TEYPNR),subtitle:j.intl.formatToPlainString(cd.default.XR1WrB,{date:t}),confirmText:j.intl.string(j.t["cY+Oob"]),cancelText:j.intl.string(cd.default.zjfaGH),variant:"critical",onConfirm:async()=>{try{await aQ.M2(s,l),await aQ.hP()}catch(e){cg.error("Failed to cancel game server subscription",e)}}})},[s,l]),C=g.useCallback(()=>{if(null==s)return;let e=of.A.getSubscriptionById(s);if(null==e)return;let t=e.items[0]?.planId,a=null!=t?uo.A.get(t):null,o=null!=a?n.get(a.skuId):null,u=i&&o?.nitroPriceAmount!=null?o.nitroPriceAmount:o?.standardPriceAmount,d=null!=u&&o?.priceCurrency!=null?(0,a1.$g)(u,o.priceCurrency):"",c=cm(e.currentPeriodEnd);(0,nW.A)({title:j.intl.string(cd.default.o96qbc),subtitle:j.intl.formatToPlainString(cd.default["7n6Qq+"],{price:d,date:c}),confirmText:j.intl.string(j.t.iIvF2z),cancelText:j.intl.string(j.t["ETE/oC"]),variant:"primary",onConfirm:async()=>{try{await (0,u0.ur)(r);let t=e.items;await aQ.nV(e,{status:A.Dmq.ACTIVE,items:t,currency:e.currency},{amount:0,currency:e.currency},(0,rK.UC)(t,e.currency),l),await aQ.hP()}catch(e){cg.error("Failed to re-subscribe to game server subscription",e)}}})},[s,r,l,n,i]),b=""!==t.serverIp&&":"!==t.serverIp;return(0,c.jsxs)("div",{className:cc.nM,children:[(0,c.jsxs)("div",{className:cc.M4,children:[(0,c.jsxs)("div",{className:cc.Vs,"aria-hidden":!0,children:[null!=a&&(0,c.jsx)("img",{className:cc.uP,src:a,alt:""}),(0,c.jsx)("div",{className:cc.tw})]}),(0,c.jsxs)("div",{className:cc.CR,children:[(0,c.jsx)(z.E,{variant:"text-md/semibold",color:"text-default",tag:"span",lineClamp:1,children:t.serverName}),(0,c.jsx)(z.E,{variant:"text-sm/medium",color:"text-muted",tag:"span",lineClamp:1,children:`${t.gameName}  \u{2022}  ${t.planName}`}),b&&(d?(0,c.jsxs)("div",{className:cc.CQ,children:[(0,c.jsx)(z.E,{variant:"text-sm/medium",color:"text-muted",tag:"span",lineClamp:1,children:t.serverIp}),(0,c.jsx)(t8.D,{className:cc.cL,onClick:E,"aria-label":j.intl.string(j.t.OpuAlK),children:S?(0,c.jsx)(d7.A,{size:"custom",width:16,height:16,color:"currentColor"}):(0,c.jsx)(d9.T,{size:"custom",width:16,height:16,color:"currentColor"})})]}):(0,c.jsx)(cn.A,{onClick:x,children:j.intl.string(cd.default["f+F7H3"])}))]})]}),(0,c.jsxs)("div",{className:cc.Rd,children:[(0,c.jsxs)("div",{className:cc.Ff,children:[null!=T&&(0,c.jsx)(z.E,{variant:"text-md/semibold",color:"text-default",tag:"span",children:T}),null!=f&&(_?(0,c.jsxs)("div",{className:cc.ez,children:[(0,c.jsx)(iw.E,{size:"xs",color:"text-feedback-critical"}),(0,c.jsx)(z.E,{variant:"text-sm/medium",color:"text-feedback-critical",tag:"span",children:f})]}):(0,c.jsx)(z.E,{variant:"text-sm/medium",color:"text-muted",tag:"span",children:f}))]}),I?(0,c.jsx)(p.$,{variant:"primary",size:"sm",text:j.intl.string(j.t.iIvF2z),onClick:C}):(0,c.jsx)(p.$,{variant:"secondary",size:"sm",text:j.intl.string(j.t["ETE/oC"]),onClick:N})]})]})});function cE(e){let{servers:t}=e,n=(0,ci.H)({location:"user_settings_subscriptions"}),{games:i}=(0,ca.Y)(),l=(0,m.bG)([l1.default],()=>rK.Ay.canUseShopDiscounts(l1.default.getCurrentUser())),s=g.useMemo(()=>{let e=new Map;for(let t of i)for(let n of t.plans??[])e.set(n.id,n);return e},[i]);g.useEffect(()=>{let e=[...s.keys()];e.length>0&&(0,u0.jv)(e).catch(()=>{})},[s]);let r=g.useCallback(()=>{(0,tP.default)(),(0,tW.pX)(A.BVt.COLLECTIBLES_SHOP_WITH_TAB(co.G2.GAME_SERVERS))},[]);return(0,c.jsxs)("div",{className:cc.uW,children:[(0,c.jsxs)("div",{className:cc.wx,children:[(0,c.jsx)(z.E,{variant:"text-lg/medium",color:"text-strong",children:j.intl.string(cd.default.vCzwM7)}),(0,c.jsxs)("div",{className:cc.h_,children:[(0,c.jsx)(z.E,{variant:"text-sm/normal",color:"text-default",tag:"span",children:j.intl.string(cd.default.y85Eg9)}),n&&(0,c.jsx)(cn.A,{onClick:r,children:(0,c.jsx)(z.E,{variant:"text-sm/normal",color:"text-link",tag:"span",children:j.intl.string(cd.default["F/BDbC"])})})]})]}),(0,c.jsx)("div",{className:cc.p_,children:t.map(e=>(0,c.jsx)(ch,{server:e,planOptionBySkuId:s,canUseShopDiscount:l},e.id))})]})}var cS=n(55766),cx=n(696986),cT=n(898555);function cp(e){let{onClickManageSubscription:t,count:n}=e;return(0,c.jsxs)("div",{children:[(0,c.jsx)(E.D,{variant:"heading-md/bold",children:j.intl.string(j.t["KzCF/6"])}),(0,c.jsx)(cx.h,{size:4}),(0,c.jsx)(z.E,{variant:"text-md/normal",className:cT.yV,children:j.intl.string(j.t["3D7qCu"])}),(0,c.jsx)(cx.h,{size:24}),(0,c.jsxs)("div",{className:cT.Nr,children:[(0,c.jsx)("img",{src:"/assets/5a420feed295b595.svg",alt:"",className:cT.RI}),(0,c.jsxs)("div",{className:cT.FS,children:[(0,c.jsx)(E.D,{variant:"heading-xl/semibold",className:cT.wx,children:j.intl.string(j.t["KzCF/6"])}),(0,c.jsx)(z.E,{variant:"text-md/normal",className:cT.h_,children:j.intl.format(j.t["m+pcOO"],{numSubscriptions:n})})]}),(0,c.jsx)(p.$,{size:"sm",variant:"overlay-primary",text:j.intl.string(j.t["3a8Xxj"]),onClick:t})]})]})}var cf=n(872351),cI=n(9113),c_=n(599941),cN=n(384684),cC=n(2242);let cb=[];var cy=n(885574),cv=n(912851),cj=n(497267);let cO=function(e){let{label:t,onClick:n,submitting:i}=e;return(0,c.jsx)(t8.D,{onClick:i?void 0:n,className:cj.x6,children:(0,c.jsxs)("div",{className:cj.hQ,children:[i?(0,c.jsx)(aY.y,{type:aY.y.Type.PULSING_ELLIPSIS,className:cj.__invalid_spinner}):(0,c.jsx)(z.E,{variant:"text-md/medium",className:cj.Pf,children:t}),(0,c.jsx)(dP.a,{size:"md",color:"currentColor",className:cj.UE})]})})};var cL=n(465932),cD=n(543767),cR=n(951555),cP=n(790284),cG=n(636194),cM=n(624456),cU=n(710144),cV=n(815332),ck=n(162093),cw=n(960309);function cF(e){let{transitionState:t,groupListing:n,listing:i,subscription:l,onClose:s}=e,r=(0,tU.GV)(),{analyticsLocations:a}=(0,eL.Ay)(tv.A.GUILD_ROLE_SUBSCRIPTION_CANCELLATION_MODAL),{cancelSubscription:o,error:u,submitting:d}=function(e){let[t,n]=g.useState(!1),[i,l]=g.useState(null);return{cancelSubscription:async function(t){try{return n(!0),await aQ.M2(t,e),!0}catch(e){l(e)}finally{n(!1)}},error:i,submitting:t}}(a);async function m(){await o(l.id)&&s()}let A=i.role_benefits.benefits.filter(e=>e.ref_type===cC.bN.CHANNEL),h=i.role_benefits.benefits.filter(e=>e.ref_type===cC.bN.INTANGIBLE),E=ii()(l.currentPeriodEnd).format("MMMM Do, YYYY"),S=j.intl.formatToPlainString(j.t.KsMRP5,{numChannels:A.length,numAdditionalBenefits:h.length,subscriptionEndDate:E});return(0,c.jsx)(lt.Modal,{transitionState:t,"aria-labelledby":r,actions:[{text:j.intl.string(j.t.EP6EPb),variant:"secondary",onClick:s},{variant:"critical-primary",text:j.intl.string(j.t.F6lUDF),onClick:m,loading:d}],title:j.intl.string(j.t.O6l5tM),subtitle:S,onClose:s,children:(0,c.jsxs)(F.B,{gap:8,children:[null!=u?(0,c.jsx)(iV.w,{type:"critical",children:u.message}):null,(0,c.jsx)(ck.x,{listingId:i.id,guildId:n.guild_id,className:cw.P})]})})}var cB=n(319225),cz=n(746080),cX=n(74669);function cY(e){let{label:t,value:n,showInfoIcon:i,infoIconTooltipText:l}=e;return(0,c.jsxs)("div",{className:cX.L0,children:[(0,c.jsxs)("div",{className:cX.a5,children:[(0,c.jsx)(E.D,{variant:"heading-deprecated-12/semibold",className:cX.HU,children:t}),i&&(0,c.jsx)(i4.m,{text:l,children:(0,c.jsx)(cy.m,{size:"xs",color:"currentColor",className:cX.Mo})})]}),(0,c.jsx)(E.D,{variant:"heading-xl/semibold",className:cX.sx,children:n})]})}function cH(e){let{subscription:t}=e,{analyticsLocations:n}=(0,eL.Ay)(),[i]=(0,cD.YV)({subscriptionId:t.id,renewal:!0,analyticsLocations:n,analyticsLocation:tv.A.GUILD_ROLE_SUBSCRIPTION_PAYMENT_SOURCE_WITH_INVOICE}),l=(0,m.bG)([op.A],()=>op.A.hasFetchedPaymentSources);return null!=i&&l?(0,c.jsx)(cR.A,{subscription:t,currentInvoicePreview:i}):(0,c.jsx)(aY.y,{})}function cK(e){let{isTrial:t,isCancelled:n,isResubscribing:i,shouldHideRoleSubscriptionEntryPoints:l,onCancelSubscriptionClick:s,onResubscribeClick:r,onChangePlanClick:a}=e;return n&&(t||l)?null:(0,c.jsx)(tH.D,{label:j.intl.string(j.t["4neDM+"]),children:(0,c.jsx)("div",{className:cX.__invalid_rowButtons,children:n?(0,c.jsx)(p.$,{variant:"primary",text:j.intl.string(j.t.y3mAE4),onClick:r,loading:i}):(0,c.jsxs)(c.Fragment,{children:[!t&&!l&&(0,c.jsx)(cO,{label:j.intl.string(j.t.FRbWR8),onClick:a}),(0,c.jsx)(cO,{label:j.intl.string(j.t.Dx0lF7),onClick:s})]})})})}let cW=function(e){let{subscription:t}=e,{listing:n,groupListing:i,guild:l,expanded:s,handleToggleExpanded:r,subscriptionInfo:a}=function(e){let t=(0,cM.M)(e),n=(0,m.bG)([cG.A],()=>cG.A.getSubscriptionListingForPlan(t)),i=(0,m.bG)([cG.A],()=>null!=n?cG.A.getSubscriptionGroupListingForSubscriptionListing(n.id):null),l=(0,m.bG)([lc.A],()=>lc.A.getGuild(i?.guild_id)),[s,r]=g.useState(!1),{fetchSubscriptionsSettings:a}=(0,c_.XE)();g.useEffect(()=>{s&&null!=l&&null==cG.A.getSubscriptionSettings(l.id)&&a(l.id)},[s,l,a]);let o=null==n?void 0:function(e){let{subscription:t}=e,n=ii()(t.currentPeriodEnd).format("M/D/YY"),i=null!=t.price?(0,a1.$g)(t.price,t.currency):"",l=ii()(t.createdAt).format("M/D/YY"),s=t.status===A.Dmq.CANCELED,r=t.status===A.Dmq.PAST_DUE,a=t.hasActiveTrial;return{memberSince:l,nextRenewalDate:n,nextRenewalLabel:s?j.intl.string(j.t.UAfot2):j.intl.string(j.t.CVjLcM),subscriptionPrice:i,isCancelled:s,isPastDue:r,isTrial:a}}({subscription:e});return{guild:l,expanded:s,handleToggleExpanded:function(){return r(e=>!e)},listing:n,groupListing:i,subscriptionInfo:o}}(t),[u,d]=g.useState(!1),h=(0,tU.GV)(),{analyticsLocations:E}=(0,eL.Ay)(),{shouldHideGuildPurchaseEntryPoints:S}=(0,cL.MH)(l?.id),x=t?.isPurchasedViaAppleGeneric;if(null==i||null==n||null==a)return null;async function T(){try{d(!0),await aQ.QP(t,E),(0,cB.E)({title:j.intl.string(j.t.oPV2cy),body:j.intl.string(j.t.DdRizV)})}finally{d(!1)}}let{isCancelled:p,isPastDue:f,subscriptionPrice:I,memberSince:_,nextRenewalDate:N,nextRenewalLabel:C,isTrial:b}=a,y=n.soft_deleted||null==l||x;return(0,c.jsxs)("div",{className:cX.kL,children:[(0,c.jsx)(cU.A,{onClick:r,className:cX.N1,children:e=>{let{areaRef:t,handleStopPropagation:i}=e;return(0,c.jsxs)(c.Fragment,{children:[null!=l&&(0,c.jsx)(dd.Ay,{guild:l,active:!0,size:dd.Ay.Sizes.MEDIUM}),(0,c.jsxs)("div",{className:cX.if,children:[(0,c.jsx)(z.E,{variant:"text-md/medium",className:cX.J5,children:null!=l?l.name:j.intl.string(j.t["He+cmd"])}),(0,c.jsxs)("div",{className:cX.xp,children:[(0,c.jsx)(z.E,{variant:"text-sm/normal",className:cX.KR,children:n.name}),p?(0,c.jsx)(e9.Lp,{text:j.intl.string(j.t["7uFZGt"])}):b?(0,c.jsx)(e9.Lp,{text:j.intl.string(j.t["6anton"]),color:nK.A.unsafe_rawColors.BRAND_500.css}):f?(0,c.jsx)(i4.m,{text:j.intl.string(j.t.eSuJE2),children:(0,c.jsx)("div",{children:(0,c.jsx)(e9.Lp,{className:cX.qc,text:j.intl.string(j.t.NrRwIl),color:nK.A.unsafe_rawColors.YELLOW_300.css})})}):null,x?(0,c.jsx)(i4.m,{text:j.intl.string(j.t.nv1IqK),children:(0,c.jsx)("div",{children:(0,c.jsx)(e9.Lp,{text:j.intl.string(j.t["sBl3X/"]),color:nK.A.colors.BACKGROUND_MOD_MUTED.css})})}):null]})]}),(0,c.jsx)(t8.D,{onClick:i(r),"aria-label":j.intl.string(j.t.e5eQOy),"aria-controls":h,"aria-expanded":s,focusProps:{ringTarget:t},children:(0,c.jsx)(dP.a,{size:"md",color:"currentColor",className:ie()(cX.D6,{[cX.S7]:s})})})]})}}),null!=i&&s?(0,c.jsxs)("div",{id:h,children:[(0,c.jsx)("div",{className:cX.yF}),(0,c.jsx)(cV.A,{groupListingId:i.id,subscription:t,className:cX.kE}),(0,c.jsxs)("div",{className:cX.Zx,children:[(0,c.jsx)(cY,{label:C,value:N}),(0,c.jsx)(cY,{label:j.intl.string(j.t.dltUMH),value:I,showInfoIcon:b,infoIconTooltipText:b?j.intl.string(j.t["/q6fpa"]):void 0}),(0,c.jsx)(cY,{label:j.intl.string(j.t.AOcwWB),value:_})]}),(0,c.jsx)(cx.h,{size:16}),!p&&!x&&(0,c.jsx)(tH.D,{label:j.intl.string(j.t.wmMFvA),children:(0,c.jsx)(cH,{subscription:t})}),!y&&(0,c.jsx)(cK,{isTrial:b,isCancelled:p,isResubscribing:u,shouldHideRoleSubscriptionEntryPoints:S,onCancelSubscriptionClick:function(){if(null!=l&&null!=i&&null!=n){var e;e={groupListing:i,listing:n,subscription:t},(0,ln.openModal)(t=>(0,c.jsx)(cF,{...t,...e}))}},onChangePlanClick:function(){null!=l&&((0,tW.pX)(A.BVt.CHANNEL(l.id,cz.VV.ROLE_SUBSCRIPTIONS)),(0,tP.default)(),cv.A.show(A.kqX.BACK_TO_PREVIOUS_SCREEN,void 0,j.intl.string(j.t.DvbaM4),()=>{cP.A.setState({subsection:eI.nR}),(0,t9.openUserSettings)(o.X.SUBSCRIPTIONS_PANEL)}))},onResubscribeClick:T})]}):null]})};var cZ=n(175880);let cq=function(e){let{onGoBack:t}=e,n=function(){let{ensureFresh:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,m.bG)([cN.A],()=>(function(){let[e]=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[cN.A],t=e.getGuildIdsWithPurchasableRoles(),n=!1;return(t.forEach(t=>{e.getUserSubscriptionRoles(t).size>0&&(n=!0)}),n)?cC.M_.SUBSCRIBED:0===t.size?cC.M_.NONE:cC.M_.IN_SUBSCRIPTION_SERVER})([cN.A]))===cC.M_.SUBSCRIBED,n=(0,m.bG)([of.A],()=>of.A.getActiveGuildSubscriptions()),i=g.useRef(!1);return g.useEffect(()=>{(function(e){let{ensureFresh:t,hasFetched:n,hasRoleSubscriptions:i}=e,l=of.A.getActiveGuildSubscriptions();return(l?.length??0)===0&&!!i||!!t&&!n||!n&&!of.A.hasFetchedSubscriptions()})({ensureFresh:e,hasRoleSubscriptions:t,hasFetched:i.current})&&(i.current=!0,aQ.hP())},[e,t]),n??cb}(),{loading:i}=(0,c_.eb)(n);return((0,cI.A)(a5.Fr?"role-subscriptions-user-setting":void 0),i)?(0,c.jsx)(aY.y,{}):0===n.length?null:(0,c.jsxs)("div",{children:[(0,c.jsx)(p.$,{text:j.intl.string(j.t.hqyhKQ),icon:cf.z,variant:"secondary",onClick:t}),(0,c.jsx)(cx.h,{size:10}),(0,c.jsx)(nZ.n,{label:j.intl.string(j.t["KzCF/6"]),description:j.intl.string(j.t["Y+ucR7"]),children:(0,c.jsx)("div",{className:cZ.A,children:n.map(e=>(0,c.jsx)(cW,{subscription:e},e.id))})})]})};var cQ=n(327479),cJ=n(388567);function c$(e){let{onClickManageSubscription:t,count:n}=e;return(0,c.jsxs)("div",{children:[(0,c.jsx)(E.D,{variant:"heading-md/bold",children:j.intl.string(j.t["48ywCu"])}),(0,c.jsx)(cx.h,{size:4}),(0,c.jsx)(z.E,{variant:"text-md/normal",className:cJ.yV,children:j.intl.string(j.t.VWxmSo)}),(0,c.jsx)(cx.h,{size:24}),(0,c.jsxs)("div",{className:cJ.Nr,children:[(0,c.jsx)("img",{src:"/assets/d6bcd13fb6c85425.svg",alt:"",className:cJ._e}),(0,c.jsxs)("div",{className:cJ.FS,children:[(0,c.jsx)(E.D,{variant:"heading-xl/semibold",className:cJ.wx,children:j.intl.string(j.t["48ywCu"])}),(0,c.jsx)(z.E,{variant:"text-md/normal",className:cJ.h_,children:j.intl.format(j.t["/esXLj"],{numSubscriptions:n})})]}),(0,c.jsx)(cQ.A,{onClick:t,text:j.intl.string(j.t["z5YcJ+"])})]})]})}var c0=n(548411),c1=n(417098),c2=n(143582),c3=n(915043),c5=n(46367);function c6(e){let{className:t,header:n,headerClassName:i,children:l}=e,s=g.useMemo(()=>{let e=!1;return g.Children.forEach(l,t=>{null!=t&&(e=!0)}),e},[l]);return(0,c.jsxs)("div",{className:ie()(c5.iE,t),children:[(0,c.jsx)("div",{className:ie()(c5.wx,i),children:n}),s&&(0,c.jsx)("div",{className:c5.Qs,children:l})]})}var c4=n(885996),c8=n(144165),c7=n(664121),c9=n(950305),ge=n(943775),gt=n(123791),gn=n(900797),gi=n(300118);let gl=g.createContext({isOpen:!1,toggleOpen:()=>{}});function gs(e){let{children:t}=e,[n,i]=g.useReducer(e=>!e,!1),l=g.useMemo(()=>({isOpen:n,toggleOpen:i}),[n]);return(0,c.jsx)(gl.Provider,{value:l,children:t(n)})}gs.Toggle=function(e){let{className:t,text:n}=e,{isOpen:i,toggleOpen:l}=g.useContext(gl),s=i?gn.t:dP.a,r=null!=n?n:i?j.intl.string(j.t.fgq1gs):j.intl.string(j.t.XJuakA);return(0,c.jsxs)(t8.D,{className:ie()(gi.L,t),onClick:l,children:[(0,c.jsx)(z.E,{variant:"heading-sm/semibold",tag:"div",color:"currentColor",children:r}),(0,c.jsx)(s,{size:"sm",color:"currentColor"})]})};var gr=n(627363),ga=n(243217),go=n(328968),gu=n(163437),gd=n(3432);function gc(e){return e.toLocaleDateString(void 0,{dateStyle:"long"})}var gg=n(583995),gm=((i={})[i.LOADING=0]="LOADING",i[i.DONE=1]="DONE",i[i.ERROR=2]="ERROR",i);function gA(e){let{subscription:t,navigateToSwitchPlan:n,loadingState:i}=e,l=t.metadata?.application_subscription_guild_id,{renewalMutations:s,planId:r}=t,{appId:a,plan:o,storeListing:u,isGuildSubscription:d,subscriptionForGuild:h,sku:S,isCancelled:x,isOrphanedGuildSubscription:T,renewalPlan:p}=(0,m.cf)([uo.A,uu.A,go.A,lc.A],()=>{let e,n=uo.A.get(r),i=null!=n?uu.A.get(n.skuId):void 0,a=i?.applicationId,o=null!=n?go.A.getForSKU(n.skuId):null,u=null!=o&&(0,gu.PJ)(o.skuFlags),d=u&&null!=l?lc.A.getGuild(l):void 0,c=(0,gu.Uo)(t,i),g=u&&null!=l&&null==d;if(!1===c&&null!=s&&s.items.length>0){let t=s.items[0];e=uo.A.get(t.planId)??void 0}return{appId:a,isGuildSubscription:u,isOrphanedGuildSubscription:g,plan:n,sku:i,storeListing:o,subscriptionForGuild:d,isCancelled:c,renewalPlan:e}},[l,r,s,t]),{data:f}=(0,gr.YY)(a),I=g.useMemo(()=>null!=f?(0,ge.A)(f,100):null,[f]),_=S?.deleted??!1,N=null!=S&&(0,gu.Se)(S),C=t.status===A.Dmq.PAST_DUE,{analyticsLocations:b}=(0,eL.Ay)(),[y]=(0,cD.YV)({subscriptionId:t.id,renewal:!0,analyticsLocations:b,analyticsLocation:tv.A.APP_SUBSCRIPTION_PAYMENT_SOURCE_WITH_INVOICE}),v=gc(t.currentPeriodEnd),O=0===i;return(0,c.jsxs)(c6,{headerClassName:gg.dL,header:!1===O?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("div",{className:gg.VW,children:[null!=I&&(0,c.jsx)(c8._,{src:I.href,imageClassName:gg.Z2,width:40,height:40}),(0,c.jsxs)("div",{className:gg.aF,children:[(0,c.jsx)(E.D,{variant:"heading-md/semibold",lineClamp:1,children:f?.name??j.intl.string(j.t["7kqy7W"])}),(0,c.jsx)(z.E,{variant:"text-sm/medium",color:"text-default",lineClamp:1,children:o?.name??j.intl.string(j.t.sqkbMK)})]})]}),(0,c.jsx)("div",{className:gg.Pz,children:null!=f&&null!=u&&null!=S&&(0,c.jsx)(gT,{subscription:t,app:f,guild:h,sku:S,storeListing:u,isCancelled:x,isOrphanedGuildSubscription:T,navigateToSwitchPlan:n,renewalSkuId:p?.skuId})})]}):(0,c.jsx)(aY.y,{type:aY.t.PULSING_ELLIPSIS}),children:[x&&(0,c.jsx)(gx,{type:"warning",title:N?j.intl.formatToPlainString(j.t.QOnM1y,{subscriptionPeriodEnd:v}):j.intl.formatToPlainString(j.t.HOaZu8,{subscriptionPeriodEnd:v})}),!x&&T&&(0,c.jsx)(gx,{type:"warning",title:j.intl.string(j.t.SmSP8Q)}),C&&(0,c.jsx)(gx,{type:"danger",title:j.intl.string(j.t.fvOqBo)}),(0,c.jsxs)("div",{className:gg.zH,children:[(0,c.jsx)(gS,{title:j.intl.string(j.t["5D/KEH"]),content:d?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("span",{className:gg.yW,children:[(0,c.jsx)(c7.R,{size:"xs"}),j.intl.string(j.t.QjL3vn)]}),null!=h&&(0,c.jsxs)("span",{className:gg._t,children:[(0,c.jsx)(z.E,{variant:"text-sm/normal",color:"text-muted",children:j.intl.format(j.t["7ZD8p1"],{guildName:h.name})}),(0,c.jsx)(dd.Ay,{guild:h,size:dd.Ay.Sizes.MINI})]})]}):(0,c.jsxs)("span",{className:gg.yW,children:[(0,c.jsx)(c9.n,{size:"xs"}),j.intl.string(j.t["6anEVv"])]})}),(0,c.jsx)(gh,{invoicePreview:y,subscriptionPlan:o}),(0,c.jsx)(gS,{title:j.intl.string(j.t.dnUzb6),content:gc(t.createdAt??t.currentPeriodStart)}),(0,c.jsx)(gE,{isCancelled:x,subscriptionPeriodEnd:v,renewalPlan:p})]}),(0,c.jsx)(gf,{subscription:t,currentInvoicePreview:y,loadingState:i,isDeleted:_,isCancelled:x}),null!=f&&u?.benefits!=null&&u.benefits.length>0&&(0,c.jsx)(gp,{appId:f.id,listingBenefits:u.benefits})]})}function gh(e){let{subscriptionPlan:t,invoicePreview:n}=e;if(null==t)return(0,c.jsx)(gS,{title:j.intl.string(j.t.KI7ERx),content:""});let i=(0,a1.CE)((0,a1.$g)(t.price,t.currency),t.interval,t.intervalCount),l=n?.findInvoiceItemByPlanId(t.id);if(null==l)return(0,c.jsx)(gS,{title:j.intl.string(j.t.KI7ERx),content:i});let s=(0,a1.CE)((0,a1.$g)(l.subscriptionPlanPrice,t.currency),t.interval,t.intervalCount);return(0,c.jsx)(gS,{title:j.intl.string(j.t.KI7ERx),content:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(z.E,{variant:"text-sm/semibold",children:s}),s!==i&&(0,c.jsx)(i4.m,{text:j.intl.format(j.t["6DoE57"],{listPrice:i}),position:"bottom",children:(0,c.jsx)(z.E,{variant:"text-xs/medium",color:"text-muted",children:(0,c.jsx)("s",{children:i})})})]})})}function gE(e){let{isCancelled:t,subscriptionPeriodEnd:n,renewalPlan:i}=e;if(null!=i){let e=(0,a1.CE)((0,a1.$g)(i.price,i.currency),i.interval,i.intervalCount);return(0,c.jsx)(gS,{title:j.intl.string(j.t.hIhAM3),content:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(z.E,{variant:"text-sm/medium",children:n}),(0,c.jsx)(z.E,{variant:"text-sm/normal",children:j.intl.format(j.t.MCLbvj,{planName:i.name,price:e})})]})})}return(0,c.jsx)(gS,{title:t?j.intl.string(j.t.enxcAl):j.intl.string(j.t["Ms+6Zq"]),content:n})}function gS(e){let{title:t,content:n}=e;return(0,c.jsxs)("div",{className:gg.nM,children:[(0,c.jsx)(z.E,{variant:"text-sm/medium",children:t}),(0,c.jsx)(z.E,{variant:"text-sm/medium",className:gg.u4,children:n})]})}function gx(e){let{type:t,title:n}=e;return(0,c.jsx)(rM.p,{messageType:"warning"===t?rM.Y.WARNING:rM.Y.ERROR,className:gg.Xm,children:(0,c.jsx)(z.E,{variant:"text-sm/normal",children:n})})}function gT(e){let{app:t,storeListing:i,sku:l,subscription:s,isCancelled:r,isOrphanedGuildSubscription:a,guild:o,renewalSkuId:u,navigateToSwitchPlan:d}=e,A=(0,gu.Se)(l),{analyticsLocations:h}=(0,eL.Ay)(),[E,S]=g.useState(!1),x=(0,gt.C)(t.id),T=(0,m.bG)([uu.A],()=>uu.A.getParentSKU(i.skuId),[i.skuId]),f=g.useMemo(()=>{var e,t;let n;return null==T?[]:(e=i.id,t=x.subscriptions,n=new Set(T.bundledSkuIds),t.filter(t=>t.id!==e&&n.has(t.skuId)))},[i.id,x,T]),I=0!==f.length;async function _(){try{S(!0);let{subscription:e}=await (0,aQ.QP)(s,h);if(null==e)return;(0,ln.openModalLazy)(async()=>{let{default:t}=await Promise.all([n.e("76229"),n.e("52396")]).then(n.bind(n,115623));return n=>(0,c.jsx)(t,{...n,storeListing:i,subscription:ga.A.createFromServer(e)})})}finally{S(!1)}}return(0,c.jsxs)("div",{className:gg.fw,children:[A||r&&a?null:r?(0,c.jsx)(p.$,{variant:"secondary",size:"sm",text:j.intl.string(j.t.QtMnkW),onClick:_,loading:E}):(0,c.jsx)(p.$,{variant:"secondary",size:"sm",text:j.intl.string(j.t["E8G/tr"]),onClick:function(){(0,ln.openModalLazy)(async()=>{let{default:e}=await Promise.all([n.e("52266"),n.e("22800")]).then(n.bind(n,301139));return n=>(0,c.jsx)(e,{...n,application:t,storeListing:i,subscription:s,guild:o})})}}),I&&null!=T&&!1===r&&!1===a&&(0,c.jsx)(p.$,{variant:"primary",size:"sm",text:j.intl.string(j.t.R74ZBR),onClick:()=>{d({currentSubscription:s,alternativeListings:f,app:t,subscriptionGroup:T,currentListing:i,renewalSkuId:u})}})]})}function gp(e){let{appId:t,listingBenefits:n}=e;return(0,c.jsx)(gs,{children:e=>(0,c.jsxs)("div",{className:gg.PX,children:[(0,c.jsxs)("div",{className:gg.wV,children:[e&&(0,c.jsx)(z.E,{variant:"text-sm/semibold",children:j.intl.string(j.t.mORL67)}),(0,c.jsx)(gs.Toggle,{className:gg.Bh,text:e?j.intl.string(j.t.gsbFAw):j.intl.string(j.t.IwjfxV)})]}),e?n.map(e=>{let{id:n,name:i,description:l,icon:s}=e;return(0,c.jsx)(c4.FY,{header:i,icon:(0,gd.N)(t,s),description:l},n)}):null]})})}function gf(e){let{subscription:t,currentInvoicePreview:n,loadingState:i,isDeleted:l,isCancelled:s}=e;return null==n?null:0===i?(0,c.jsx)("div",{className:gg.Ji,children:(0,c.jsx)(tH.D,{label:j.intl.string(j.t.azZaZa),children:(0,c.jsx)(aY.y,{type:aY.t.PULSING_ELLIPSIS})})}):2===i?(0,c.jsx)("div",{className:gg.Ji,children:(0,c.jsxs)(c1.$T,{color:c1.Hv.DANGER,style:{borderRadius:0},children:[j.intl.format(j.t.IIHUUF,{subscriptionId:t.id}),(0,c.jsx)("br",{}),j.intl.format(j.t.fh65ES,{helpLink:"https://support.discord.com/hc/en-us"})]})}):(0,c.jsx)("div",{className:gg.Ji,children:(0,c.jsx)(tH.D,{label:j.intl.string(j.t.azZaZa),children:(0,c.jsx)(cR.A,{subscription:t,currentInvoicePreview:n,disabled:l||s})})})}var gI=((l={}).HOME="HOME",l.SWITCH_APP_PLANS="SWITCH_APP_PLANS",l);n(938796);var g_=n(38405);let gN=(0,m.UT)(uo.A,{getQueryId:A.fic.SUBSCRIPTION_PLANS,get:e=>{if(null==e)return null;let t=uo.A.getForSKU(e);return 0===t.length?null:t},load:e=>(null==e&&g_.A.addBreadcrumb({message:"Error loading subscription plans: skuId is null"}),null!=e?(0,u0.ur)(e).then(()=>{}):Promise.reject())});var gC=n(240248),gb=n(237218),gy=n(242653);function gv(e){let{children:t,lineClamp:n=2,...i}=e,[l,s]=g.useState(!1),[r,a]=g.useState(null),o=null!=r&&(0,c.jsx)("button",{className:gy.x6,onClick:()=>s(e=>!e),children:(0,c.jsxs)(z.E,{className:gy.B0,variant:"text-sm/medium",color:"text-brand",children:[l?j.intl.string(j.t["JQX/Pb"]):j.intl.string(j.t.Fbrd8J),l?(0,c.jsx)(gn.t,{color:nK.A.colors.TEXT_BRAND,size:"xs"}):(0,c.jsx)(dP.a,{color:nK.A.colors.TEXT_BRAND,size:"xs"})]})}),[u,d]=g.useState(null),m=g.useCallback(()=>{if(null==u)return;let{scrollHeight:e,clientHeight:t}=u;e>t&&a({truncatedHeight:t,expandedHeight:e})},[u]);g.useEffect(()=>{requestAnimationFrame(m)},[m,t,n]);let A="auto";return null!=r&&(A=l?`${r.expandedHeight}px`:`${r.truncatedHeight}px`),(0,c.jsxs)("div",{children:[(0,c.jsx)(z.E,{...i,className:gy.Qs,lineClamp:l?void 0:n,ref:d,style:{height:A},children:t}),o]})}var gj=n(386447);function gO(e){let{cta:t,storeListing:n,className:i}=e,{applicationId:l,benefits:s,description:r}=n,a=g.useMemo(()=>null==n.thumbnail?null:(0,gb.t)(l,n.thumbnail,256),[l,n.thumbnail]),{data:o}=gN(n.skuId),u=g.useMemo(()=>{if(null==o||0===o.length)return null;let e=o[0];return(0,a1._J)(e)},[o]);return null==u?null:(0,c.jsxs)(c6,{className:ie()(gj.iE,i),header:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("div",{className:gj.qd,children:[null!=a&&(0,c.jsx)(c8._,{src:a.href,imageClassName:gj.rW,width:48,height:48}),(0,c.jsxs)("div",{children:[(0,c.jsx)(E.D,{variant:"heading-md/bold",children:n.summary}),(0,c.jsx)(z.E,{variant:"text-md/medium",children:u})]})]}),t]}),children:[!(0,gC.uJ)(r)&&(0,c.jsx)("div",{className:gj.h_,children:(0,c.jsx)(gv,{variant:"text-sm/medium",children:r})}),null!=s&&s.length>0&&(0,c.jsx)("div",{className:gj.PX,children:s.map(e=>{let{id:t,name:n,description:i,icon:s}=e;return(0,c.jsx)(c4.FY,{header:n,icon:(0,gd.N)(l,s),description:i},t)})})]})}var gL=n(185438),gD=n(711171);function gR(e){let{app:t,currentSubscription:n,currentListing:i,alternativeListings:l,navigateToHome:s,subscriptionGroup:r,renewalSkuId:a}=e,o=(0,ge.A)(t,100),u=(0,gu.PJ)(r.flags),d=u?c7.R:c9.n,g=u?j.intl.string(j.t["46YF2D"]):j.intl.string(j.t.fFyGiA),A=n.metadata?.application_subscription_guild_id,h=(0,m.bG)([lc.A],()=>u&&null!=A?lc.A.getGuild(A):void 0,[A,u]),S=(0,m.bG)([uu.A],()=>{if(null!=a)return uu.A.get(a)},[a]),x=gc(n.currentPeriodEnd);return(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:gD.wx,children:[null!=o&&(0,c.jsx)(c8._,{src:o.href,imageClassName:gD.Z2,width:48,height:48}),(0,c.jsxs)("div",{children:[(0,c.jsx)(E.D,{variant:"heading-xl/semibold",children:t.name}),(0,c.jsxs)("div",{className:gD.p4,children:[(0,c.jsxs)(E.D,{variant:"heading-md/normal",className:gD.N4,children:[(0,c.jsx)(d,{size:"xs",color:"currentColor"})," ",g]}),null!=h&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(z.E,{variant:"text-md/normal",children:"\u2022"}),(0,c.jsxs)("span",{className:gD.vP,children:[(0,c.jsx)(dd.Ay,{guild:h,size:dd.Ay.Sizes.SMOL}),(0,c.jsx)(E.D,{variant:"heading-md/semibold",color:"text-muted",children:j.intl.format(j.t["7ZD8p1"],{guildName:h.name})})]})]})]})]})]}),(0,c.jsx)(gs,{children:e=>(0,c.jsxs)("div",{className:gD._B,children:[(0,c.jsx)(z.E,{variant:"text-md/normal",children:j.intl.string(j.t["goe+hk"])}),e&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(z.E,{variant:"text-md/normal",children:j.intl.format(j.t["Q8qJ+5"],{})}),(0,c.jsx)(z.E,{variant:"text-md/normal",children:j.intl.format(j.t.sqowYz,{})})]}),(0,c.jsx)(gs.Toggle,{text:e?j.intl.string(j.t["1Rkq/E"]):j.intl.string(j.t.WsTHkY)})]})}),(0,c.jsxs)("div",{className:gD.x0,children:[(0,c.jsx)(gO,{storeListing:i,className:gD.o3,cta:(0,c.jsxs)("div",{className:gD.cJ,children:[(0,c.jsx)(z.E,{variant:"eyebrow",color:"text-brand",children:j.intl.string(j.t.fHIpOY)}),null!=S&&(0,c.jsx)(z.E,{variant:"text-sm/semibold",color:"text-subtle",children:j.intl.format(j.t["OQk+jr"],{endDate:x})})]})}),l.map(e=>e.skuId===a?(0,c.jsx)(gO,{storeListing:e,cta:(0,c.jsx)(z.E,{variant:"text-sm/semibold",color:"text-subtle",children:j.intl.format(j.t.nn88hB,{startDate:x})})},e.id):(0,c.jsx)(gP,{storeListing:e,guildId:A,navigateToHome:s},e.id))]})]})}function gP(e){let{storeListing:t,guildId:n,navigateToHome:i}=e,{openModal:l}=(0,gL.A)({analyticsLocation:A.ThZ.APP_SUBSCRIPTIONS_MANAGEMENT,skuId:t.skuId,initialSubscribeForGuild:n,disableGuildSelector:!0,onComplete:i});return(0,c.jsx)(gO,{storeListing:t,cta:(0,c.jsx)(p.$,{variant:"primary",size:"sm",text:j.intl.string(j.t["+KwmBt"]),onClick:l})})}class gG extends g.PureComponent{state={hasError:!1};static getDerivedStateFromError(e){return{hasError:!0}}render(){return this.state.hasError?(0,c.jsxs)(c1.$T,{color:c1.Hv.DANGER,style:{borderRadius:0},children:[j.intl.format(j.t.IIHUUF,{subscriptionId:this.props.subscription.id})," ",j.intl.format(j.t.fh65ES,{helpLink:"https://support.discord.com/hc/en-us"})]}):this.props.children}}function gM(e){let{subscriptions:t,updateHeader:n}=e,[i,l]=g.useState({route:gI.HOME}),{route:s}=i;function r(){l({route:gI.HOME})}let a=e=>{l({route:gI.SWITCH_APP_PLANS,...e}),n(j.intl.string(j.t.VFqtkP),r)},[o,u]=g.useState({});g.useEffect(()=>{for(let e of t){let t=e.items[0]?.planId;null!=t&&(u(t=>({...t,[e.id]:gm.LOADING})),(0,c2._R)(t).then(()=>{u(t=>({...t,[e.id]:gm.DONE}))}).catch(()=>{u(t=>({...t,[e.id]:gm.ERROR}))}))}},[t]);let{loadState:d}=(0,c3.E)(),m=d!==c3.mJ.LOADED;switch(s){case gI.HOME:return(0,c.jsx)(c.Fragment,{children:t.map(e=>(0,c.jsx)(gG,{subscription:e,children:(0,c.jsx)(gA,{subscription:e,navigateToSwitchPlan:a,loadingState:m?gm.LOADING:o[e.id]??gm.LOADING})},e.id))});case gI.SWITCH_APP_PLANS:let{route:A,...h}=i;return(0,c.jsx)(gR,{...h,navigateToHome:r});default:(0,n8.xb)(s)}}var gU=n(131352);function gV(e){let{onGoBack:t}=e,n=(0,m.yK)([of.A],()=>of.A.getActiveApplicationSubscriptions()?.slice().sort((e,t)=>(e.createdAt?.getTime()??e.currentPeriodStart.getTime())-(t.createdAt?.getTime()??t.currentPeriodStart.getTime()))??[]),[i,l]=g.useState();return null==i&&(i=(0,c.jsx)(gk,{onBack:t,title:j.intl.string(j.t["DB/m9a"])})),(0,c.jsxs)("div",{children:[i,(0,c.jsx)("div",{className:gU.A,children:(0,c.jsx)(gM,{subscriptions:n,updateHeader:function(e,t){l((0,c.jsx)(gk,{title:e,onBack:()=>{t(),l(void 0)}}))}})})]})}function gk(e){let{onBack:t,title:n}=e;return(0,c.jsxs)("div",{className:gU.D,children:[(0,c.jsx)(i5.K,{"aria-label":j.intl.string(j.t["13/7kX"]),icon:()=>(0,c.jsx)(c0.Z,{size:"sm"}),onClick:t,variant:"icon-only"}),(0,c.jsx)(E.D,{variant:"heading-lg/semibold",children:n})]})}var gw=n(881489),gF=n(366999),gB=n(466919),gz=n(406252);function gX(e){let t,n,{showChargingUpState:i,rowValueText:l,endsAt:s,fractionalState:r,activationDate:a,hasPremiumGroup:o}=e;o?(t=j.intl.string(gB.default["/S02sx"]),n=j.intl.string(gB.default.OPJNST)):i?(t=j.intl.string(j.t["hT6i/0"]),n=null!=a?j.intl.format(j.t["0Vwb/l"],{activateDate:a}):null):(t=j.intl.string(j.t["3G0CTC"]),n=r===tk.xc.FP_SUB_PAUSED?j.intl.format(j.t.MMvaIG,{resumeDate:s.toDate()}):null);let u=ie()({[gz.Hs]:i,[gz.mT]:!i}),d=ie()({[gz.CQ]:i,[gz.ZM]:!i}),g=ie()({[gz.EM]:!i});return(0,c.jsxs)("div",{className:gz.r6,children:[(0,c.jsxs)("div",{className:gz.Nv,children:[(0,c.jsx)(E.D,{variant:"heading-md/semibold",className:g,children:t}),null!==n&&(0,c.jsx)(z.E,{variant:"text-sm/normal",children:n})]}),!o&&(0,c.jsx)("div",{className:gz.ZS,children:(0,c.jsx)("div",{className:u,children:(0,c.jsx)(z.E,{variant:"text-sm/semibold",className:d,children:l})})})]})}let gY=function(e){let{fractionalPremiumInfo:t,className:n,activationDate:i,hasPremiumGroup:l}=e,s=(0,rK.kX)(t),r=s.length>0,a=(0,gF.Ay)(t.endsAt,gF.yE.SHORT_TIME),o=r?s:a;return(0,c.jsx)("div",{children:(0,c.jsxs)("div",{className:ie()(n,gz.f8),children:[(0,c.jsx)("div",{className:gz.J_,children:(0,c.jsxs)("div",{className:gz.Bh,children:[(0,c.jsx)("div",{className:gz.xt,children:(0,c.jsx)(rG.t,{size:"md",color:"white",className:gz.T8})}),(0,c.jsx)("div",{className:gz.pt,children:(0,c.jsx)(E.D,{variant:"heading-md/semibold",children:j.intl.string(j.t.DFMPWS)})}),(0,c.jsx)(z.E,{className:gz.PJ,variant:"text-md/semibold",children:s.length>0?s:j.intl.string(j.t["B66Z+f"])})]})}),(0,c.jsx)(gX,{showChargingUpState:r,rowValueText:o,endsAt:t.endsAt,fractionalState:t.fractionalState,activationDate:i,hasPremiumGroup:l})]})})};var gH=n(983048);function gK(e){let t,{user:n,planId:i,count:l,userPremiumSubscription:s,unconsumedFractionalPremiumUnits:r=[],hasPremiumGroup:a}=e,[o,u]=(0,m.yK)([uo.A],()=>[uo.A.get(i),null!=s?uo.A.get(s.planId):null]);if(null==o||rK.Ay.getInterval(i).intervalType!==tk.WT.MONTH)return null;let d=null!=u?u.skuId:null,g=o.skuId===d,h=rK.Ay.getDisplayName(i);if(a)t=j.intl.string(gB.default["5asczk"]);else if(g&&null!=s){let e;e=new Date(s.status===A.Dmq.PAUSED&&null!=s.pauseEndsAt?s.pauseEndsAt:s.currentPeriodEnd);let n=(0,rK._e)(e,r);t=j.intl.formatToPlainString(j.t["5CNRRA"],{date:n??0})}else t=j.intl.formatToPlainString(j.t.eNXZ5O,{planName:h});let S=n.hasFreePremium()||null!=s&&s.isPurchasedExternally;return(0,c.jsxs)("div",{className:gz.Bh,children:[(0,c.jsx)("div",{className:ie()({[gz.sr]:o.skuId===tk.pe.TIER_0,[gz.lP]:o.skuId===tk.pe.TIER_1,[gz.eb]:o.skuId===tk.pe.TIER_2}),children:(0,c.jsx)(rG.t,{size:"md",color:"currentColor",className:gz.Kk})}),(0,c.jsxs)("div",{className:gz.pt,children:[(0,c.jsx)(E.D,{variant:"heading-md/semibold",children:j.intl.format(j.t.LzobT9,{planName:h})}),!S&&(0,c.jsx)(E.D,{className:gz.gj,variant:"heading-sm/semibold",color:"text-default",children:t})]}),(0,c.jsx)(z.E,{className:gz.PJ,variant:"text-md/semibold",children:j.intl.format(j.t["ess/xl"],{count:l})})]})}let gW=function(e){let{className:t,entitlements:n}=e,i=k()(Array.from(n)).filter(e=>{let{subscriptionPlanId:t,parentId:n,consumed:i}=e;return null!=t&&null!=n&&!i}).groupBy(e=>e.subscriptionPlanId).value(),l=(0,m.yK)([o6.A],()=>o6.A.getUnactivatedFractionalPremiumUnits()),s=(0,m.bG)([of.A],()=>of.A.getPremiumSubscription()),r=(0,m.bG)([of.A],()=>null==of.A.getPremiumTypeSubscription()),a=Object.keys(i).some(e=>e===tk.gD.PREMIUM_MONTH_TIER_1),o=(0,m.bG)([l1.default],()=>l1.default.getCurrentUser());if(null==o)return null;let u=o.isPremiumWithPremiumGroup();return(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:ie()(t,gz.xF,gz.J_),children:Object.keys(i).map(e=>(0,c.jsx)(gK,{planId:e,count:i[e].length,userPremiumSubscription:s,user:o,unconsumedFractionalPremiumUnits:l,hasPremiumGroup:u},e))}),a&&r&&(0,c.jsxs)("div",{children:[(0,c.jsx)(z.E,{className:gz.eT,variant:"text-md/normal",children:j.intl.string(j.t["VNr4+O"])}),(0,c.jsx)(gH.i,{})]})]})};var gZ=n(830991);function gq(e){let t,{subscription:n,withOverheadSeparator:i}=e,{analyticsLocations:l}=(0,eL.Ay)(),[s]=(0,cD.YV)({subscriptionId:n.id,renewal:!0,analyticsLocations:l,analyticsLocation:tv.A.PREMIUM_SUBSCRIPTION_FINE_PRINT_CONTENT});if(null==s)return null;let r=i?gZ.r:gZ.a,a=s.invoiceItems.find(e=>{let{subscriptionPlanId:t}=e;return(0,rK.xq)(t)});if(null==a)return null;let o=a.subscriptionPlanId,u=uo.A.get(o);tl()(null!=u,"Missing plan");let d=(0,a1.$g)(s.total,s.currency);return u.interval===tk.WT.YEAR?t=j.intl.format(j.t["jPz/39"],{price:d,termsUrl:A.X7G.TERMS,paidURL:A.X7G.PAID_TERMS,privacyUrl:A.X7G.PRIVACY}):u.interval===tk.WT.MONTH&&(t=1===u.intervalCount?j.intl.format(j.t.m27GpI,{price:d,termsUrl:A.X7G.TERMS,paidURL:A.X7G.PAID_TERMS,privacyUrl:A.X7G.PRIVACY}):j.intl.format(j.t["9xf5Vx"],{price:d,termsUrl:A.X7G.TERMS,paidURL:A.X7G.PAID_TERMS,privacyUrl:A.X7G.PRIVACY,intervalCount:u.intervalCount})),(0,c.jsx)(z.E,{color:"text-muted",className:r,variant:"text-xs/normal",children:t})}function gQ(e){let{subscription:t,withOverheadSeparator:n}=e;return t.status===A.Dmq.CANCELED||t.isPurchasedExternally?null:(0,c.jsx)(gq,{subscription:t,withOverheadSeparator:n})}var gJ=n(37397),g$=n(533792);let g0={[eI.nR]:"role_subscriptions_panel",[eI.PZ]:"application_subscriptions_panel"};function g1(){return(0,c.jsx)(a6.Z,{className:g$.wb,type:a6.Z.Types.CUSTOM,children:(0,c.jsxs)(la.A,{align:la.A.Align.CENTER,children:[(0,c.jsx)(iZ.A,{game:null,size:iZ.M.SMALL,className:g$.pV}),(0,c.jsx)("span",{className:g$.O,children:j.intl.string(j.t["jy/hyj"])})]})})}function g2(e,t){return e===t||null==e&&null==t||null!=e&&null!=t&&(0,d6._)(e,t)}function g3(){let e=(0,m.bG)([o6.A],()=>o6.A.getForApplication(tk.tv),[],g2);return g.useEffect(()=>{(0,ub.LM)(tk.tv)},[]),(0,c.jsx)(nZ.n,{label:j.intl.string(j.t["2GKrvn"]),description:j.intl.string(j.t.kNEjGm),children:null!=e&&rK.Ay.hasAccountCredit(e)?(0,c.jsx)(gW,{className:g$.fX,entitlements:e}):(0,c.jsx)(g1,{})})}function g5(){return(0,c.jsx)("hr",{className:g$.hr})}let g6=function(){var e;let t=(0,m.bG)([of.A],()=>of.A.getPremiumTypeSubscription()),n=(0,d4.A)({subscriptionFilter:e=>gJ.Hy.has(e.status)}),i=(0,m.bG)([l1.default],()=>l1.default.getCurrentUser()),l=n.length>1,s=(0,m.bG)([op.A],()=>null!=t&&null!=t.paymentSourceId?op.A.getPaymentSource(t.paymentSourceId):null,[t]),r=(0,m.bG)([of.A],()=>of.A.hasFetchedSubscriptions()),a=(0,m.bG)([a0.A],()=>a0.A.isBusy),u=(0,u1.Y)(),d=cP.A.useField("subsection"),h=cP.A.useField("scrollToGameServers"),S=g.useRef(null);g.useEffect(()=>{(0,n1._)(null!=d?g0[d]:o.X.SUBSCRIPTIONS_PANEL)},[d]);let x=(0,m.bG)([of.A],()=>of.A.getActiveApplicationSubscriptions()?.length??0),T=(0,m.bG)([of.A],()=>Object.values(of.A.getSubscriptions()??{}).filter(e=>e.type===A.rzx.GUILD).filter(e=>e.status!==A.Dmq.ENDED).length),p=(0,m.bG)([of.A],()=>Object.values(of.A.getSubscriptions()??{}).some(e=>e.type===A.rzx.GAME_SERVER)),{servers:f}=(0,cS.f)({enabled:p}),I=(0,u3.A)({forceFetch:!0}),_=(0,gw.ds)(),N=null!==t?t.currentPeriodEnd:void 0,C=!(_&&!(I.unactivatedUnits.length>0))&&(I.fractionalState!==tk.xc.NONE||I.unactivatedUnits.length>0);return(g.useEffect(()=>{h&&r&&u&&f.length>0&&(S.current?.scrollIntoView({behavior:"smooth",block:"start"}),cP.A.setState({scrollToGameServers:!1}))},[h,r,u,f.length]),g.useEffect(()=>(e2.h.wait(()=>{(0,u0.zS)(),aQ.hP(),(0,u$.CD)(),aQ.$o()}),function(){cP.A.resetState()}),[]),e8.A.enabled)?(0,c.jsx)(az.A,{}):r&&u?d===eI.nR?(0,c.jsx)(cq,{onGoBack:()=>cP.A.setState({subsection:null})}):d===eI.PZ?(0,c.jsx)(gV,{onGoBack:()=>cP.A.setState({subsection:null})}):(0,c.jsx)("div",{className:g$.kL,children:(0,c.jsxs)("div",{className:g$.Qs,children:[l?(0,c.jsx)(gJ.Sb,{}):null,null!=t?(0,c.jsx)(gJ.Ay,{subscription:t,paymentSource:s,busy:a,subscriptions:n}):(0,c.jsx)(gJ.TC,{}),C&&(e=!!i?.isPremiumWithPremiumGroup(),(0,c.jsxs)("section",{children:[(0,c.jsx)(E.D,{variant:"heading-md/bold",className:g$.HL,children:j.intl.string(j.t.Obre8v)}),(0,c.jsx)(z.E,{variant:"text-md/normal",className:g$.JU,children:j.intl.format(j.t["7Zi06b"],{helpCenterLink:eS.A.getArticleURL(A.MVz.FRACTIONAL_PREMIUM_ABOUT)})}),(0,c.jsx)(gY,{className:g$.fX,fractionalPremiumInfo:I,activationDate:N,hasPremiumGroup:e})]})),(0,c.jsx)(g3,{}),T>0&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(g5,{}),(0,c.jsx)(cp,{count:T,onClickManageSubscription:()=>cP.A.setState({subsection:eI.nR})})]}),x>0&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(g5,{}),(0,c.jsx)(c$,{count:x,onClickManageSubscription:()=>{cP.A.setState({subsection:eI.PZ}),e7.default.track(A.HAw.PREMIUM_APPLICATION_SUBSCRIPTION_MANAGE_CTA_CLICKED)}})]}),f.length>0&&(0,c.jsxs)("div",{ref:S,children:[(0,c.jsx)(g5,{}),(0,c.jsx)(cE,{servers:f})]}),(0,c.jsx)(g5,{}),null!=t?(0,c.jsx)(gQ,{subscription:t,withOverheadSeparator:!1}):null]})}):(0,c.jsx)("div",{className:ie()(g$.kL,g$.Lq),children:(0,c.jsx)(aY.y,{})})},g4=(0,a.E2)(o.X.SUBSCRIPTIONS_SETTINGS,{useSearchTerms:()=>[j.intl.string(j.t.trSpHX),j.intl.string(j.t["2GKrvn"])],Component:()=>(0,c.jsx)(g6,{})}),g8=(0,a.zZ)(o.X.SUBSCRIPTIONS_CATEGORY,{useSearchTerms:()=>[j.intl.string(j.t.trSpHX),j.intl.string(j.t["2GKrvn"])],buildLayout:()=>[g4]}),g7=(0,a.t_)(o.X.SUBSCRIPTIONS_PANEL,{useTitle:()=>j.intl.string(j.t.trSpHX),buildLayout:()=>[g8]}),g9=(0,a.i4)(o.X.SUBSCRIPTIONS_SIDEBAR_ITEM,{useTitle:()=>j.intl.string(j.t.trSpHX),icon:d3.L,usePersistentBadge:function(){let e=(0,d5.l)();return g.useMemo(()=>({badgeType:d.Xi.STRONGLY_DISCOURAGED_CUSTOM,customBadge:e?(0,c.jsx)(iw.E,{size:"xs",color:nK.A.unsafe_rawColors.YELLOW_300}):null}),[e])},buildLayout:()=>[g7]}),me=(0,a.WI)(o.X.BILLING_SECTION,{useTitle:()=>j.intl.string(j.t.oeUm2s),buildLayout:()=>[uQ,d2,g9,uX,oD]});var mt=n(540999),mn=n(306471),mi=n(964355),ml=n(172272);let ms=(0,a.zD)(o.X.AXE_AUDITING,{useTitle:()=>"Enable Accessibility Auditing",useSubtitle:()=>"Runs Axe auditing for accessibility while using the app. Violations get logged to the console. Only available in development.",usePredicate:()=>!1,useValue:()=>(0,m.bG)([sF.default],()=>sF.default.isAxeEnabled),setValue:e=>(0,sw.x)({axeEnabled:e})}),mr=(0,a.zD)(o.X.CSS_DEBUGGING,{useTitle:()=>"Enable CSS Debugging",useSubtitle:()=>"Display raw colors as pink. Toggling this will refresh the browser.",useValue:()=>(0,m.bG)([sF.default],()=>sF.default.cssDebuggingEnabled),setValue:e=>{(0,sw.x)({cssDebuggingEnabled:e}).then(()=>{setTimeout(()=>location.reload(),500)})}});var ma=n(276086),mo=n(354328);let mu=(0,a.zD)(o.X.HIGHLIGHT_MANA_COMPONENTS,{useTitle:()=>"Highlight Mana Components",useSubtitle:()=>"Highlights all Mana design system components for easier debugging.",useValue:()=>(0,mo.A)("highlight_mana_components"),setValue:e=>{(0,ma.L)("highlight_mana_components",e)}}),md=(0,a.zD)(o.X.HIGHLIGHT_MANA_TEXT_OVERRIDES,{useTitle:()=>"Audit overridden Mana Text (dashed red)",useSubtitle:()=>"Outlines Mana Text/Heading whose font is overridden by CSS with a dashed red border \u2014 it renders through the component but won\u2019t change between control and variant. Higher cost (measures computed styles), so keep it on only while auditing.",useValue:()=>(0,mo.A)("highlight_mana_text_overrides"),setValue:e=>{(0,ma.L)("highlight_mana_text_overrides",e)}}),mc=(0,a.zD)(o.X.HIGHLIGHT_MANA_TEXT,{useTitle:()=>"Mana Text Migration Highlighter",useSubtitle:()=>"Outlines Mana Text/Heading components in green, text composing a variant (experiment-reachable but not migrated) in yellow, and all other rendered text in red.",useValue:()=>(0,mo.A)("highlight_mana_text"),setValue:e=>{(0,ma.L)("highlight_mana_text",e)}}),mg=(0,a.zD)(o.X.HIGHLIGHT_VOID_COMPONENTS,{useTitle:()=>"Highlight Deprecated Void Components",useSubtitle:()=>"Highlights deprecated toggleable components: VoidCheckbox (green), VoidRadioGroup (yellow), VoidSwitch (blue).",useValue:()=>(0,mo.A)("highlight_void_toggleables"),setValue:e=>{(0,ma.L)("highlight_void_toggleables",e)}}),mm=(0,a.sN)(o.X.LAYOUT_DEBUGGING_HORIZONTAL_SPACING,{useTitle:()=>"Horizontal Grid Spacing",useSubtitle:()=>"Adjust the spacing between horizontal grid lines. Set to 0 to disable horizontal grid lines.",usePredicate:()=>(0,m.bG)([sF.default],()=>sF.default.layoutDebuggingEnabled),minValue:0,maxValue:ml.YR,markers:Array.from({length:ml.YR+1},(e,t)=>t),onValueRender:e=>`${Math.round(e)}px`,onMarkerRender:e=>e%4==0?`${e}`:void 0,getInitialValue:()=>ml.Or.getState().horizontalSpacing,asValueChanges:e=>{ml.Or.getState().setHorizontalSpacing(e)}}),mA=(0,a.zD)(o.X.LAYOUT_DEBUGGING,{useTitle:()=>"Enable Layout Debugging",useSubtitle:()=>"Renders a grid on top of the app to help debug layout alignment issues.",useValue:()=>(0,m.bG)([sF.default],()=>sF.default.layoutDebuggingEnabled),setValue:e=>{(0,sw.x)({layoutDebuggingEnabled:e})}}),mh=(0,a.sN)(o.X.LAYOUT_DEBUGGING_VERTICAL_SPACING,{useTitle:()=>"Vertical Grid Spacing",useSubtitle:()=>"Adjust the spacing between vertical grid lines. Set to 0 to disable vertical grid lines.",usePredicate:()=>(0,m.bG)([sF.default],()=>sF.default.layoutDebuggingEnabled),minValue:0,maxValue:ml.YR,markers:Array.from({length:ml.YR+1},(e,t)=>t),onValueRender:e=>`${Math.round(e)}px`,onMarkerRender:e=>e%4==0?`${e}`:void 0,getInitialValue:()=>ml.Or.getState().verticalSpacing,asValueChanges:e=>{ml.Or.getState().setVerticalSpacing(e)}}),mE=(0,a.zZ)(o.X.DESIGN_TOOLS,{useTitle:()=>"Design & A11y Tools",useSearchTerms:()=>["accessibility tools"],buildLayout:()=>[mr,mA,mm,mh,mu,mc,md,mg,ms]}),mS=(0,a.zD)(o.X.AD_OVERRIDE,{useTitle:()=>"Always Deliver Ads",useSubtitle:()=>"Makes the user targetable for all active ads.",useValue:()=>v.HZ.useSetting(),setValue:e=>{v.HZ.updateSetting(e)}});var mx=n(396478),mT=n(173936),mp=n(260598),mf=n(414079),mI=n(148810),m_=n(380610),mN=n(986238),mC=n(281161),mb=n(663894),my=n(522826);let mv=["discord_web","discord_marketing","discord_developers","discord_ios","discord_android"],mj=[{id:"branch",value:"branch",label:"Branch Name"},{id:"id",value:"id",label:"Commit SHA"}];function mO(e){return"discord_ios"in e||"discord_android"in e}class mL extends g.Component{handleRemoveBuildOverride=()=>{this.props.onBuildOverrideRemoved(this.props.project)};handleOverrideIdChanged=e=>{this.props.onBuildOverrideUpdated(this.props.project,{id:e})};handleOverrideTypeChanged=e=>{this.props.onBuildOverrideUpdated(this.props.project,{type:e,id:""})};render(){let{project:e,overrideType:t,overrideId:n,disabled:i,error:l}=this.props;return(0,c.jsxs)(la.A,{direction:la.A.Direction.VERTICAL,className:ie()(mC.oS,my.SX,mb.N,mC.nM),children:[(0,c.jsx)(mf.A,{className:ie()(mC.lL,{[mC.zi]:i}),onClick:i?void 0:this.handleRemoveBuildOverride}),(0,c.jsxs)(la.A,{className:my.QB,children:[(0,c.jsx)(la.A.Child,{basis:"50%",children:(0,c.jsx)(i3.l,{selectionMode:"single",label:"Override Type",options:mj,onSelectionChange:this.handleOverrideTypeChanged,value:t,disabled:i})}),(0,c.jsx)(la.A.Child,{wrap:!0,basis:"50%",children:(0,c.jsx)(li.k,{label:"branch"===t?"Branch Name":"Commit SHA",value:n,onChange:this.handleOverrideIdChanged,disabled:i})})]}),(0,c.jsxs)(la.A.Child,{children:[null!=l&&""!==l&&(0,c.jsx)(z.E,{className:mC.AS,color:"text-feedback-critical",variant:"text-sm/normal",children:l}),(0,c.jsxs)(z.E,{variant:"text-sm/normal",className:mC.AS,children:["This controls the build that will be served for the ",(0,c.jsx)("code",{children:e})," project."]})]})]})}}class mD extends g.Component{state={loading:!0,buildOverrides:{},loadedBuildOverrides:{},errors:{},saving:!1,didSave:!1};async refreshBuildOverrides(){this.setState({loading:!0});let e=await (0,m_.bD)();this.setState({loading:!1,buildOverrides:e,loadedBuildOverrides:k().cloneDeep(e),errors:{}})}isDirty(){let{buildOverrides:e,loadedBuildOverrides:t}=this.state;return!k().isEqual(e,t)}componentDidMount(){this.refreshBuildOverrides()}getAvailableProjects(){let{buildOverrides:e}=this.state;if(null==e)return[];let t=Object.keys(e);return k().without(mv,...t)}handleAddBuildOverride=e=>{if(null==e)return;let t={...this.state.buildOverrides,[e]:{type:"branch",id:""}};this.setState({buildOverrides:t})};handleBuildOverrideUpdated=(e,t)=>{let{buildOverrides:n}=this.state,i={...null!=n?n[e]:{},...t},l={...this.state.buildOverrides,[e]:i};this.setState({buildOverrides:l})};handleBuildOverrideRemoved=e=>{let t={...this.state.buildOverrides};delete t[e],this.setState({buildOverrides:t})};handleDiscardChanges=()=>{this.setState({buildOverrides:k().cloneDeep(this.state.loadedBuildOverrides),errors:{},didSave:!1})};handleSaveChanges=async()=>{let{buildOverrides:e}=this.state;if(null==e)return;this.setState({saving:!0});let t=await (0,mI.Zk)(e);if(200===t.status){let e=t.body;this.setState({buildOverrides:e,loadedBuildOverrides:k().cloneDeep(e),errors:{},didSave:!0,saving:!1})}else if(400===t.status){let e=t.body;this.setState({errors:e,saving:!1,didSave:!1})}else this.setState({saving:!1,didSave:!1})};handleLinkGeneration=()=>{let{buildOverrides:e}=this.state;(0,ln.openModal)(t=>(0,c.jsx)(mR,{...t,buildOverrides:e}))};renderEmpty(){return(0,c.jsx)(mx.pp,{theme:nR.A.theme,className:ie()(my.eT,my.SX),children:(0,c.jsx)(mx.SG,{children:"You have no build overrides configured."})})}renderItems(){let{buildOverrides:e,saving:t,errors:n}=this.state;return null==e?null:k().map(e,(e,i)=>(0,c.jsx)(mL,{project:i,overrideType:e.type,overrideId:e.id,disabled:t,error:n[i],onBuildOverrideUpdated:this.handleBuildOverrideUpdated,onBuildOverrideRemoved:this.handleBuildOverrideRemoved},i))}renderRefreshButton(){return!this.state.didSave||this.isDirty()?null:(0,c.jsx)(p.$,{variant:"secondary",text:"Reload App",onClick:()=>location.reload()})}renderLinkButton(){let{buildOverrides:e}=this.state;return null==e||0===Object.keys(e).length?null:(0,c.jsx)(i4.m,{text:"Generate Public Link",children:(0,c.jsx)(i5.K,{variant:"secondary",icon:mT.q,"aria-label":"Generate Public Link",onClick:this.handleLinkGeneration})})}renderSaveButton(){if(!this.isDirty())return null;let{saving:e,buildOverrides:t}=this.state;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(p.$,{variant:"critical-primary",text:"Discard Changes",onClick:this.handleDiscardChanges,disabled:e}),(0,c.jsx)(p.$,{variant:"primary",text:"Save Build Overrides",disabled:mO(t??{}),onClick:this.handleSaveChanges,loading:e})]})}render(){let e,{loading:t,saving:n,buildOverrides:i}=this.state;e=t?(0,c.jsx)(aY.y,{className:my.QX}):null!=i&&0===Object.keys(i).length?this.renderEmpty():this.renderItems();let l=!n&&!t&&this.getAvailableProjects().length>0,s=mO(i??{})&&"stable"!==window.GLOBAL_ENV.RELEASE_CHANNEL?(0,c.jsx)(z.E,{color:"text-feedback-critical",variant:"text-md/normal",children:"Mobile build overrides must be generated using the desktop/web stable client for now!"}):null;return(0,c.jsx)(nZ.n,{children:(0,c.jsxs)(F.B,{gap:16,children:[(0,c.jsx)(i3.l,{selectionMode:"single",label:"Add Build Override",placeholder:"discord_project",description:"Select a project to create a build override for.",layout:"horizontal-responsive",value:void 0,options:this.getAvailableProjects().map(e=>({id:e,label:e,value:e})),onSelectionChange:this.handleAddBuildOverride,disabled:!l}),s,e,(0,c.jsxs)(sC.e,{justify:"end",children:[this.renderRefreshButton(),this.renderLinkButton(),this.renderSaveButton()]})]})})}}class mR extends g.Component{state={ttlSeconds:3600,releaseChannel:"all",userIds:new Set,userIdEntry:"",userIdEntryError:null,allowedVersions:[],allowedVersionEntry:"",allowedVersionEntryError:null,publicLink:" ",statusText:null,status:0,allowLoggedOut:!1};setUserEntryError=e=>{this.setState({userIdEntryError:e})};setStatusMessage=(()=>{var e=this;return function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;e.setState({statusText:t,status:n})}})();handleUserIDEntry=e=>{if(!/^[\d\s,]*$/.test(e))return this.setUserEntryError("User IDs are numbers!");let t=new Set(e.split(/[,\s]+/).filter(Boolean));this.setState({userIdEntry:e,userIds:t})};setAllowedVersionError=e=>{this.setState({allowedVersionEntryError:e})};handleAllowedVersionEntry=e=>{this.setState({allowedVersionEntry:e})};handleAllowedVersionEnter=e=>{e.key===lI.dh.ENTER&&this.handleAddAllowedVersion()};handleAddAllowedVersion=()=>{let{allowedVersions:e,allowedVersionEntry:t}=this.state;return 0===(t=t.trim()).length?this.setAllowedVersionError("Enter a valid version number!"):e.indexOf(t)>=0?this.setAllowedVersionError("You already added that version!"):void this.setState({allowedVersions:[...e,t],allowedVersionEntry:"",allowedVersionEntryError:""})};handleRemoveAllowedVersion=e=>{let{allowedVersions:t}=this.state;t=t.filter(t=>t!==e),this.setState({allowedVersions:t})};handleAllowLoggedOut=e=>{this.setState({allowLoggedOut:e})};handleExpirationChange=e=>{this.setState({ttlSeconds:e})};handleReleaseChannelChange=e=>{this.setState({releaseChannel:e})};handleExperiments=e=>{if(0===e.trim().length)return void this.setState({experimentsError:void 0});try{let t=JSON.parse(e);for(let e in t){if(null==e.match(/^[0-9]{4}\-[0-9]{2}(-|_)[a-z0-9_-]+$/))return void this.setState({experimentsError:`${e} is an invalid experiment name`});if("number"!=typeof t[e])return void this.setState({experimentsError:`${e} has an invalid bucket override`})}}catch(e){this.setState({experimentsError:`Unable to parse experiments ${e.message}`});return}this.setState({experiments:e,experimentsError:void 0})};generatePayload=()=>({overrides:this.props.buildOverrides,meta:{release_channel:"all"===this.state.releaseChannel?null:this.state.releaseChannel,ttl_seconds:this.state.ttlSeconds,user_ids:Array.from(this.state.userIds),allowed_versions:this.isMobile()?this.state.allowedVersions:void 0,allow_logged_out:this.state.allowLoggedOut,experiments:null==this.state.experiments?null:JSON.parse(this.state.experiments)}});handleGenerateLink=async()=>{if(this.isMobile()&&0===this.state.allowedVersions.length)return void this.setAllowedVersionError("You must add at least one allowed version for iOS");this.setStatusMessage(null);let e=this.generatePayload(),t=await (0,mI.SB)(e);!1!==t.error?this.setStatusMessage(JSON.stringify(t.error),0):(this.setState({publicLink:t.url.toString()}),0===e.meta.user_ids.length&&this.setStatusMessage("Warning! No users added to the whitelist! This link could be used by anyone to override their build.",1))};isMobile(){return mO(this.props.buildOverrides??{})}renderSettingsForm(){let{ttlSeconds:e,releaseChannel:t,userIdEntry:n,userIdEntryError:i,allowedVersions:l,allowedVersionEntry:s,allowedVersionEntryError:r,allowLoggedOut:a,experiments:o,experimentsError:u}=this.state,d=mN.fL.find(t=>t.value===e),g=l.map(e=>({id:e,label:e,value:e}));return(0,c.jsxs)(F.B,{gap:20,children:[(0,c.jsx)(i3.l,{selectionMode:"single",label:"Expire After",value:null!=d?d.value:void 0,options:mN.fL,onSelectionChange:this.handleExpirationChange}),this.isMobile()?null:(0,c.jsx)(i3.l,{selectionMode:"single",label:"Release Channel",value:t,options:mN.VP,onSelectionChange:this.handleReleaseChannelChange}),this.isMobile()?(0,c.jsxs)(F.B,{gap:20,children:[(0,c.jsx)(li.k,{label:"Add allowed app version (required)",autoFocus:!0,value:s,onKeyDown:this.handleAllowedVersionEnter,error:r,onChange:this.handleAllowedVersionEntry,placeholder:"Example: 34",trailing:{icon:iM.j,onClick:this.handleAddAllowedVersion,"aria-label":"Add"}}),(0,c.jsx)(i3.l,{selectionMode:"single",label:"Remove allowed app version",value:void 0,options:g,onSelectionChange:this.handleRemoveAllowedVersion,disabled:0===l.length})]}):null,this.isMobile()?null:(0,c.jsx)(mp.f,{label:"Limit to User IDs (optional)",helperText:"User IDs can be separated by whitespace or commas.",value:n,error:i,onBlur:()=>this.setUserEntryError(""),onChange:this.handleUserIDEntry}),(0,c.jsx)(mp.f,{label:"Client Experiment Override",description:"Locally override the given experiments to the given bucket. This ONLY applies locally and WILL NOT affect the server. When the user clears build override, the experiment override is removed as well.",value:o,error:u,onChange:this.handleExperiments,placeholder:'{"2022-01_threads":1}'}),(0,c.jsx)(tK.d,{label:"Allow logged out users",checked:a,onChange:this.handleAllowLoggedOut})]})}renderHelpMessage(){let{statusText:e,status:t}=this.state;if(null==e)return(0,c.jsx)("div",{});let n=rM.Y.INFO;switch(t){case 0:n=rM.Y.ERROR;break;case 1:n=rM.Y.WARNING}return(0,c.jsx)(rM.p,{messageType:n,children:e})}render(){let{onClose:e,transitionState:t}=this.props,{publicLink:n}=this.state;return(0,c.jsx)(lt.Modal,{title:"Generate Public Build Override Link",input:this.renderHelpMessage(),actionBarInput:(0,c.jsx)(uf.A,{value:n}),transitionState:t,"aria-label":"Generate Public Build Override Link",actions:[{variant:"primary",text:"Generate Link",onClick:this.handleGenerateLink}],onClose:e,children:this.renderSettingsForm()})}}let mP=(0,a.E2)(o.X.BUILD_OVERRIDES,{useSearchTerms:()=>["build overrides"],Component:mD});var mG=n(256311),mM=n(883600);let mU=(0,a.E2)(o.X.CHANGE_LOG_OVERRIDE,{useSearchTerms:()=>["changelog override","change log override"],Component:function(){let e=(0,m.bG)([mM.A],()=>mM.A.overrideId());async function t(e){let t=mM.A.getChangelog(e,"en-US");return null!=t?t:await mG.A.fetchChangelog(e,"en-US",!1,!0)??null}return(0,c.jsx)(mJ,{label:"Change Log Override",description:"Provide a change log ID to override the change log shown to this user.",placeholder:"Enter Change Log ID...",overrideId:e??null,setOverride:e=>mG.A.setChangelogOverride(e),fetchOverride:t})}});var mV=n(506774);let mk=new Date("2018-01-01"),mw=(0,a.Tf)(o.X.CHANGE_LOG_CLEAR,{useTitle:()=>"Clear Change Log",useSubtitle:()=>"Resets the change log state so that it will show again on the next startup.",useLabel:()=>"Clear",useDisabled:()=>v.pK.useSetting()===a3.default.fromTimestamp(mk.getTime()),onClick:()=>(mV.w.set("lastChangeLogDate",mk),v.pK.updateSetting(a3.default.fromTimestamp(mk.getTime())))}),mF=(0,a.zD)(o.X.DISABLE_APP_COLLECTIONS_CACHE,{useTitle:()=>"Disable Application Collections Cache",useSubtitle:()=>"Forces application collection updates to be shown immediately.",useDisabled:()=>(0,m.bG)([sF.default],()=>sF.default.onlyShowPreviewAppCollections),useValue:()=>(0,m.bG)([sF.default],()=>sF.default.disableAppCollectionsCache||sF.default.onlyShowPreviewAppCollections),setValue:e=>(0,sw.x)({disableAppCollectionsCache:e})}),mB=(0,a.zD)(o.X.FORCE_CANARY_API,{useTitle:()=>"Force Canary API",useSubtitle:()=>"Routes all API requests to Canary instances.",useValue:()=>(0,m.bG)([sF.default],()=>sF.default.isForcedCanary),setValue:e=>{(0,sw.x)({canary:e})}}),mz=(0,a.zD)(o.X.LOAD_SOURCE_MAPS,{useTitle:()=>"Load Source Maps",useSubtitle:()=>"Downloads source maps on this client. Only enable on devices you trust.",useValue:()=>(0,m.bG)([sF.default],()=>sF.default.sourceMapsEnabled),setValue:e=>(0,sw.x)({sourceMapsEnabled:e})}),mX=(0,a.zD)(o.X.ONLY_SHOW_PREVIEW_APP_COLLECTIONS,{useTitle:()=>"Only Show Preview App Collections",useSubtitle:()=>"Only show application collections (e.g. in App Directory, App Launcher in text) that have the 'preview' active state. This disables application collections cache, too, so you can see collections updates immediately.",useValue:()=>(0,m.bG)([sF.default],()=>sF.default.onlyShowPreviewAppCollections),setValue:e=>(0,sw.x)({onlyShowPreviewAppCollections:e})});var mY=n(10094),mH=n(683760);let mK=[{id:"none",label:"Non-Nitro",value:0},{id:"tier_0",label:"Nitro Basic",value:tk.PremiumTypes.TIER_0},{id:"tier_1",label:"Nitro Classic",value:tk.PremiumTypes.TIER_1},{id:"tier_2",label:"Nitro Standard",value:tk.PremiumTypes.TIER_2}],mW=(0,a.Hn)(o.X.PREMIUM_TYPE_OVERRIDE,{useTitle:()=>"Premium Type Override",useSearchTerms:()=>["nitro override"],useSubtitle:()=>"Overrides the client's local premium type.",useOptions:()=>mK,clearable:!0,useValue:()=>(0,m.bG)([mH.A],()=>{let e=mH.A.getPremiumTypeOverride();return null===e?0:e}),setValue:e=>{0===e?(0,mY.O)(null,void 0):null===e?(0,mY.O)(void 0,void 0):(0,mY.O)(0===e?null:e,void 0)}});var mZ=n(246605),mq=n(274184);let mQ=(0,a.E2)(o.X.SURVEY_OVERRIDE,{useSearchTerms:()=>["survey override"],Component:function(){let e=(0,m.bG)([mq.Ay],()=>mq.Ay.getSurveyOverride());return(0,c.jsx)(mJ,{label:"Survey Override",description:"Provide a survey ID to override the survey shown to this user.",placeholder:"Enter Survey ID...",overrideId:e??null,setOverride:e=>mZ.xr(e),fetchOverride:e=>mZ.BC(e,!0)??null})}});function mJ(e){let{label:t,description:n,placeholder:i,overrideId:l,setOverride:s,fetchOverride:r}=e,[a,o]=g.useState(l??""),u=g.useRef(null),[d,m]=g.useState(0);function A(){null!=u.current&&(clearTimeout(u.current),u.current=null)}return g.useEffect(()=>A,[]),(0,c.jsx)(tH.D,{layout:"horizontal-responsive",label:t,description:n,children:(0,c.jsx)(li.k,{placeholder:i,error:2===d?"Failed to fetch override":void 0,successMessage:3===d?"Override applied":void 0,value:a,onChange:function(e){if(!(e.length>0)||/^[0-9]+$/.test(e)){if(o(e),A(),0===e.length){m(0),s(null);return}u.current=setTimeout(()=>{m(1),r(e).then(t=>{m(null==t?2:3),null!=t&&s(e)})},500)}},clearable:!0})})}let m$=(0,a.zZ)(o.X.DEV_OVERRIDES,{useTitle:()=>"Overrides",buildLayout:()=>[mW,mQ,mU,mw,mB,mS,mX,mF,mz,mP],useInlineNotice:()=>({type:d.lT.INLINE_NOTICE,noticeType:"info",text:j.intl.format(j.t.UeZJlg,{link:"https://i.dis.gd/dev-settings-changes"})})}),m0=(0,a.zD)(o.X.ANALYTICS_LOGS,{useTitle:()=>"Enable Logging of Analytics Events",useSubtitle:()=>"Logs all analytics events to the developer console.",useValue:()=>(0,m.bG)([sF.default],()=>sF.default.isLoggingAnalyticsEvents),setValue:e=>(0,sw.x)({logAnalyticsEvents:e})}),m1=(0,a.zD)(o.X.GATEWAY_LOGS,{useTitle:()=>"Log Gateway Events",useSubtitle:()=>"Logs all gateway events to console, including content. Enable verbose logs to see them.",useValue:()=>(0,m.bG)([sF.default],()=>sF.default.isLoggingGatewayEvents),setValue:e=>(0,sw.x)({logGatewayEvents:e})}),m2=(0,a.zD)(o.X.KEEP_POPOUTS_OPEN,{useTitle:()=>"Keep Popouts Open",useSubtitle:()=>"When enabled, popouts will not close automatically, allowing their console contents to be inspected after a crash.",useValue:()=>(0,m.bG)([sF.default],()=>sF.default.preventPopoutClose),setValue:e=>(0,sw.x)({preventPopoutClose:e})}),m3=(0,a.zD)(o.X.KEYBOARD_MISMATCHES,{useTitle:()=>"Enable Logging of Keyboard Mismatches",useSubtitle:()=>"Logs mismatches in detected keyboard codes to the console.",useValue:()=>(0,m.bG)([sF.default],()=>sF.default.logKeyboardMismatches),setValue:e=>(0,sw.x)({logKeyboardMismatches:e})}),m5=(0,a.zD)(o.X.OVERLAY_RPC_LOGS,{useTitle:()=>"Enable Logging of Overlay RPC Events & Commands",useSubtitle:()=>"Logs all overlay related RPC events. Super noisy if an overlay is connected.",useValue:()=>(0,m.bG)([sF.default],()=>sF.default.isLoggingOverlayEvents),setValue:e=>(0,sw.x)({logOverlayEvents:e})}),m6=(0,a.zD)(o.X.QUEST_LOGGING,{useTitle:()=>"Enable Quests Debug Logging",useSubtitle:()=>"Logs quest lifecycle events to the developer console.",useValue:()=>(0,m.bG)([sF.default],()=>sF.default.isLoggingQuestEvents),setValue:e=>(0,sw.x)({logQuestEvents:e})}),m4=(0,a.zD)(o.X.REQUEST_TRACING,{useTitle:()=>"Enable Tracing Requests",useSubtitle:()=>"Force trace all client requests with APM.",useValue:()=>(0,m.bG)([sF.default],()=>sF.default.isTracingRequests),setValue:e=>(0,sw.x)({trace:e})}),m8=(0,a.zZ)(o.X.LOGGING,{useTitle:()=>"Logging",buildLayout:()=>[m1,m5,m4,m0,m3,m2,m6]}),m7=(0,a.t_)(o.X.DEVELOPER_OPTIONS_PANEL,{useTitle:()=>"Developer Options",buildLayout:()=>[m$,m8,mE]}),m9=(0,a.i4)(o.X.DEVELOPER_OPTIONS_SIDEBAR_ITEM,{useTitle:()=>"Developer Options",icon:mn.V,useMenu:function(){let{layoutDebuggingEnabled:e,isDeveloper:t,isLoggingGatewayEvents:n,isLoggingOverlayEvents:i,isLoggingAnalyticsEvents:l,isTracingRequests:s,isForcedCanary:r,isAxeEnabled:a,preventPopoutClose:u,onlyShowPreviewAppCollections:d,disableAppCollectionsCache:g,isStaff:A}=(0,m.cf)([sF.default,mt.A,l1.default],()=>({layoutDebuggingEnabled:sF.default.layoutDebuggingEnabled,isDeveloper:mt.A.isDeveloper,isLoggingGatewayEvents:sF.default.isLoggingGatewayEvents,isLoggingOverlayEvents:sF.default.isLoggingOverlayEvents,isLoggingAnalyticsEvents:sF.default.isLoggingAnalyticsEvents,isTracingRequests:sF.default.isTracingRequests,isForcedCanary:sF.default.isForcedCanary,isSourceMapsEnabled:sF.default.sourceMapsEnabled,isAxeEnabled:sF.default.isAxeEnabled,preventPopoutClose:sF.default.preventPopoutClose,onlyShowPreviewAppCollections:sF.default.onlyShowPreviewAppCollections,disableAppCollectionsCache:sF.default.disableAppCollectionsCache,isStaff:l1.default.getCurrentUser()?.isStaff()??!1})),{horizontalSpacing:h,verticalSpacing:E}=(0,ml.Or)(),{setHorizontalSpacing:S,setVerticalSpacing:x}=ml.Or.getState(),T=v.HZ.useSetting();return t?[(0,c.jsxs)(e0.Dr,{id:"overrides",label:"Overrides",action:()=>{(0,t9.openUserSettings)(o.X.DEV_OVERRIDES)},children:[(0,c.jsx)(e0.sL,{id:"always-deliver",label:"Always Deliver Ads",checked:T,action:()=>{v.HZ.updateSetting(!T)}},"always-deliver"),(0,c.jsx)(e0.sL,{id:"forced-canary",label:"Forced Canary",checked:r,action:()=>{(0,sw.x)({canary:!r})}},"forced-canary"),(0,c.jsx)(e0.sL,{id:"preview-collections",label:"Preview Unpublished Collections",checked:d,action:()=>{(0,sw.x)({onlyShowPreviewAppCollections:!d})}},"preview-collections"),(0,c.jsx)(e0.sL,{id:"disable-collections-cache",label:"Disable Collections Cache",checked:g,action:()=>{(0,sw.x)({disableAppCollectionsCache:!g})}},"disable-collections-cache")]},"overrides"),(0,c.jsxs)(e0.Dr,{id:"logging",label:"Logging",action:()=>{(0,t9.openUserSettings)(o.X.LOGGING)},children:[(0,c.jsx)(e0.sL,{id:"gateway-events",label:"Gateway Events",checked:n,action:()=>{(0,sw.x)({logGatewayEvents:!n})}},"gateway-events"),(0,c.jsx)(e0.sL,{id:"overlay-events",label:"Overlay RPC Events",checked:i,action:()=>{(0,sw.x)({logOverlayEvents:!i})}},"overlay-events"),(0,c.jsx)(e0.sL,{id:"analytics-events",label:"Analytics Events",checked:l,action:()=>{(0,sw.x)({logAnalyticsEvents:!l})}},"analytics-events"),(0,c.jsx)(e0.sL,{id:"tracing-requests",label:"Tracing Requests",checked:s,action:()=>{(0,sw.x)({trace:!s})}},"tracing-requests"),(0,c.jsx)(e0.sL,{id:"prevent-popout-close",label:"Prevent Popouts From Closing",checked:u,action:()=>{(0,sw.x)({preventPopoutClose:!u})}},"prevent-popout-close")]},"logging"),(0,c.jsxs)(e0.Dr,{id:"design-tools",label:"Design/A11y Tools",action:()=>{(0,t9.openUserSettings)(o.X.DESIGN_TOOLS)},children:[(0,c.jsx)(e0.sL,{id:"accessibility-auditing",label:"Accessibility Auditing",checked:a,action:()=>{(0,sw.x)({axeEnabled:!a})}},"accessibility-auditing"),(0,c.jsx)(e0.sL,{id:"layout-debugging",label:"Enable Layout Debugging",checked:e,action:()=>{(0,sw.x)({layoutDebuggingEnabled:!e})}},"layout-debugging"),e&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(e0.aK,{id:"horizontal-spacing",label:"Horizontal Spacing",control:(e,t)=>(0,c.jsx)(mi.i,{...e,ref:t,value:h,minValue:0,maxValue:ml.YR,onChange:e=>S(e),renderValue:e=>`${Math.round(e)}px`,"aria-label":"Horizontal Spacing"})},"horizontal-spacing"),(0,c.jsx)(e0.aK,{id:"vertical-spacing",label:"Vertical Spacing",control:(e,t)=>(0,c.jsx)(mi.i,{...e,ref:t,value:E,minValue:0,maxValue:ml.YR,onChange:e=>x(e),"aria-label":"Vertical Spacing",renderValue:e=>`${Math.round(e)}px`})},"vertical-spacing")]})]},"design-tools"),A?(0,c.jsx)(e0.Dr,{id:"discord-stats",label:"Discord Stats",action:()=>l0()},"discord-stats"):null]:null},buildLayout:()=>[m7]});var Ae=n(127062),At=n(25044),An=n(80703),Ai=n(123292),Al=n(691540),As=n(857250),Ar=n(97483),Aa=n(892547),Ao=n(890856),Au=n(100392),Ad=n(102609),Ac=n(271478),Ag=n(710195),Am=n(386976),AA=n(257433),Ah=n(32523),AE=n(96919),AS=n(688151),Ax=n(142862);function AT(e){let{experiment:t,experimentId:n,overrideInfo:i,defaultOpen:l}=e,[s,r]=g.useState(l),[a,o]=g.useState(!1),u=g.useCallback(()=>{r(e=>!e)},[]),d=(0,m.bG)([ur.default],()=>ur.default.getId()),A=(0,m.bG)([ur.default],()=>{let e=ur.default.getInstallationForTracking();return null==e?null:(0,An.v)(e)}),h="installation"===t.kind&&null!=A?A:d,E=(0,AA.iN)(t,h),S=(0,AA.Fm)(t,h),x=(0,m.yK)([sW.A],()=>k().sortBy(sW.A.getRecentExposures(AS.Vh.USER,n),e=>{let[t,n]=e;return-n}).map(e=>{let[t,n]=e;return`${new Date(n).toLocaleString()} (${t})`})),T=g.useCallback(e=>{(0,uc.C)((0,Au.yA)(n),()=>{(0,Al.P0)({id:"experiment-link-copied",message:"Copied experiment link",type:Ar.Ck.SUCCESS}),e.preventDefault(),e.stopPropagation()})},[n]),p=(0,c.jsx)(Ao.s,{"aria-label":"Toggle visibility",onClick:u,children:(0,c.jsxs)(z.E,{variant:"text-md/medium",className:Ax.DD,children:[(0,c.jsxs)("div",{children:[(0,c.jsxs)(F.B,{direction:"horizontal",align:"center",gap:4,children:[t.title," ",uc.p5&&(0,c.jsx)(t8.D,{onClick:T,children:(0,c.jsx)(mT.q,{size:"xs"})})]}),(0,c.jsx)(z.E,{color:"text-muted",variant:"text-sm/normal",children:n})]}),(0,c.jsx)("span",{className:Ax.km,children:"installation"===t.kind?"Installation":"User"})]})});if(!s)return(0,c.jsx)("div",{className:Ax.Os,children:p});let f="";return f=t.system===Ad.l5.LEGACY?`Currently assigned to bucket ${E??AS.RE.NOT_ELIGIBLE}`:null!=E?`Currently assigned to variant ${E}`:"Currently unassigned",(0,c.jsxs)("div",{className:Ax.Os,children:[p,(0,c.jsx)("div",{children:(0,c.jsx)(Ac.g,{label:t.system===Ad.l5.LEGACY?"Bucket Override":"Variant Override",description:f,experiment:t,experimentId:n,overrideInfo:i})}),(0,c.jsx)("div",{className:Ax.h_,children:null==S?(0,c.jsx)(z.E,{variant:"text-sm/normal",color:"text-subtle",children:'Warning: Server did not send any experiment config. You may need to check the "Send to Client" box in the admin UI.'}):null}),a?(0,c.jsxs)("div",{children:[(0,c.jsx)(z.E,{variant:"text-lg/medium",className:Ax.id,children:"Server Descriptor"}),(0,c.jsx)(z.E,{variant:"code",className:Ax.AS,children:null==S?"None":JSON.stringify(S,void 0,2)}),(0,c.jsx)(z.E,{variant:"text-lg/medium",className:Ax.id,children:"Override Descriptor"}),(0,c.jsx)(z.E,{variant:"code",className:Ax.AS,children:i?.originalDescriptor==null?"None":JSON.stringify(i.originalDescriptor,void 0,2)}),(0,c.jsx)(z.E,{variant:"text-lg/medium",className:Ax.id,children:"Recent Exposures"}),(0,c.jsx)(z.E,{variant:"code",className:Ax.AS,children:0===x.length?"None":x.join("\n")})]}):(0,c.jsx)("div",{className:Ax.id,children:(0,c.jsx)(Ai.Q,{variant:"secondary",text:"More Details \xbb",onClick:()=>o(!0)})}),(0,c.jsx)(i2.c,{className:Ax.yF})]})}function Ap(e){let{experiment:t,experimentId:n,overrideInfo:i}=e,[l,s]=g.useState(null!=i),[r,a]=g.useState(!1),o=g.useCallback(()=>{s(e=>!e)},[]),u=(0,m.bG)([sW.A],()=>sW.A.getLoadedGuildExperiment(n)),d=(0,m.bG)([sW.A,lc.A,Ag.A],()=>{if(t.system===Ad.l5.LEGACY)return null==sW.A.getLoadedGuildExperiment(n);let e=t.name;return!lc.A.getGuildsArray().some(t=>null!=Ag.A.getServerAssignment("guild",t.id,e))}),A=(0,m.yK)([sW.A],()=>k().sortBy(sW.A.getRecentExposures(AS.Vh.GUILD,n),e=>{let[t,n]=e;return-n}).map(e=>{let[t,n]=e;return`${new Date(n).toLocaleString()} (${t})`})),[h,E]=(0,m.yK)([ur.default,lc.A,sW.A,Ag.A],()=>{let e=t.system===Ad.l5.LEGACY,i=t.name,l=ur.default.getId(),s=k().sortBy(lc.A.getGuildsArray(),e=>e.name.toLowerCase()),r={},a=[];for(let t of s){let s=e?sW.A.getGuildExperimentDescriptor(n,t.id)?.bucket??AS.RE.NOT_ELIGIBLE:Ag.A.getEvaluationAndAssignment("guild",t.id,i,l)[1]?.variantId??AS.RE.NOT_ELIGIBLE;s in r||(r[s]=0),r[s]++,a.push(`${t.name}: ${s}`)}let o=k()(r).keys().map(Number).sort().map(e=>`${r[e]} guilds in bucket ${e}`).join(", ");return[a.join("\n"),o]}),S=t.system!==Ad.l5.LEGACY,x=(0,m.yK)([lc.A],()=>k().sortBy(lc.A.getGuildsArray(),e=>e.name.toLowerCase())),[T,p]=g.useState(()=>lg.A.getGuildId()??lg.A.getLastSelectedGuildId()),f=x.find(e=>e.id===T)?.name,I=(0,m.bG)([Ag.A],()=>{if(S&&null!=T)return Ag.A.getServerAssignment("guild",T,t.name)},[S,T,t.name]),_=(0,m.bG)([Ag.A,ur.default],()=>{if(!S)return;let e=ur.default.getId();return Ag.A.getEvaluationAndAssignment("user",e,t.name)[1]}),N=null!=_&&(_.isOverride||_.useAsEligibility),C=(0,c.jsx)(t8.D,{onClick:o,children:(0,c.jsxs)(z.E,{variant:"text-md/medium",className:Ax.DD,children:[(0,c.jsxs)("div",{children:[(0,c.jsx)("span",{children:t.title}),(0,c.jsx)(z.E,{color:"text-muted",variant:"text-sm/normal",children:n})]}),(0,c.jsx)("span",{className:Ax.km,children:"Guild"})]})});return l?(0,c.jsxs)("div",{className:Ax.Os,children:[C,(0,c.jsx)(Ac.g,{label:"Bucket Override",description:`Current Assignments: ${E}`,experiment:t,experimentId:n,overrideInfo:i}),S&&x.length>0&&(0,c.jsx)("div",{className:Ax.h_,children:(0,c.jsx)(i3.l,{label:"Inspect guild",description:"Server assignment and eligibility shown below are for this guild. The override above still applies to all guilds.",value:T??void 0,options:x.map(e=>({id:e.id,label:e.name,value:e.id})),onSelectionChange:e=>p(e),selectionMode:"single",fullWidth:!0})}),(0,c.jsx)("div",{className:Ax.h_,children:d?(0,c.jsx)(z.E,{variant:"text-sm/normal",color:"text-subtle",children:t.system===Ad.l5.LEGACY?'Warning: Server did not send any experiment config. You may need to check the "Send to Client" box in the admin UI.':"Warning: Server did not send an assignment for this experiment. Make sure the experiment is configured to run on the APP surface in the admin UI."}):null}),S&&(0,c.jsxs)("div",{children:[(0,c.jsxs)(z.E,{variant:"text-lg/medium",className:Ax.id,children:["Server Descriptor",null!=f?` (${f})`:""]}),(0,c.jsx)(z.E,{variant:"code",className:Ax.AS,children:null==I?"None":JSON.stringify(I,void 0,2)}),(0,c.jsx)(z.E,{variant:"text-lg/medium",className:Ax.id,children:"Client Eligibility"}),(0,c.jsx)(z.E,{variant:"text-sm/normal",color:"text-muted",children:N?"Eligible: Yes":"Eligible: No"}),(0,c.jsx)(z.E,{variant:"code",className:Ax.AS,children:null==_?"None":JSON.stringify(_,void 0,2)})]}),r?(0,c.jsxs)("div",{children:[(0,c.jsx)(z.E,{variant:"text-lg/medium",className:Ax.id,children:"Guild Assignments"}),(0,c.jsx)(z.E,{variant:"code",className:Ax.AS,children:h}),t.system===Ad.l5.LEGACY&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(z.E,{variant:"text-lg/medium",className:Ax.id,children:"Server Descriptor"}),(0,c.jsx)(z.E,{variant:"code",className:Ax.AS,children:null==u?"None":JSON.stringify(u,void 0,2)})]}),(0,c.jsx)(z.E,{variant:"text-lg/medium",className:Ax.id,children:"Override Descriptor"}),(0,c.jsx)(z.E,{variant:"code",className:Ax.AS,children:i?.originalDescriptor==null?"None":JSON.stringify(i.originalDescriptor,void 0,2)}),(0,c.jsx)(z.E,{variant:"text-lg/medium",className:Ax.id,children:"Recent Exposures"}),(0,c.jsx)(z.E,{variant:"code",className:Ax.AS,children:0===A.length?"None":A.join("\n")})]}):(0,c.jsx)("div",{className:Ax.id,children:(0,c.jsx)(Ai.Q,{variant:"secondary",text:"More Details \xbb",onClick:()=>a(!0)})}),(0,c.jsx)(i2.c,{className:Ax.yF})]}):(0,c.jsx)("div",{className:Ax.Os,children:C})}let Af=(0,a.E2)(o.X.EXPERIMENTS_SETTING,{Component:function(){let{experiments:e,overridesInfo:t}=(0,Am.op)(),{experiments:n,overridesInfo:i}=(0,Ah.hI)(),l=g.useMemo(()=>({...n,...e}),[n,e]),s=g.useMemo(()=>({...i,...t}),[i,t]),r=(0,m.bG)([ur.default],()=>{let e=ur.default.getInstallationForTracking();return null==e?null:(0,An.v)(e)}),[a,o]=g.useState(""),u=(0,AE.oC)((0,AE.R3)((0,AE.Fm)(l),s),a);return(0,c.jsxs)("div",{"data-mtctest-ignore":"true",children:[null!=r&&(0,c.jsxs)(F.B,{style:{gap:8,marginBottom:16},children:[(0,c.jsxs)(z.E,{variant:"text-xs/medium",color:"text-muted",children:["Installation ID: ",r]}),uc.p5&&(0,c.jsx)(Ai.Q,{size:"sm",onClick:()=>{(0,uc.C)(r,()=>{(0,Al.P0)((0,As.o)("Installation ID copied!",Ar.Ck.SUCCESS))})},text:"Copy"})]}),(0,c.jsx)(Aa.I,{placeholder:"Search experiments",query:a,onChange:o,onClear:()=>o("")}),u.length>0?u.map(e=>{let t="guild"===e.experiment.kind?Ap:AT;return(0,c.jsx)(t,{experiment:e.experiment,experimentId:e.id,overrideInfo:s[e.id],defaultOpen:null!=s[e.id]},e.id)}):(0,c.jsx)("div",{className:Ax.p$,children:(0,c.jsx)(E.D,{variant:"heading-md/semibold",children:"No Experiments Found"})})]})},useSearchTerms:()=>["Experiments","Bucket Override","Variant Override"]}),AI=(0,a.zZ)(o.X.EXPERIMENTS_CATEGORY,{buildLayout:()=>[Af]}),A_=(0,a.t_)(o.X.EXPERIMENTS_PANEL,{useTitle:()=>"Experiments",buildLayout:()=>[AI]}),AN=(0,a.i4)(o.X.EXPERIMENTS_SIDEBAR_ITEM,{useTitle:()=>"Experiments",icon:Ae.c,useMenu:At.A,buildLayout:()=>[A_]}),AC=(0,a.WI)(o.X.DEVELOPER_SECTION,{useTitle:()=>j.intl.string(j.t["+gHUHA"]),usePredicate:()=>mt.A.isDeveloper,buildLayout:()=>[AN,m9]});var Ab=n(682348),Ay=n(871633),Av=n(751075),Aj=n(843402);let AO=(0,n(583613).L_)(function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Set(t.map(e=>e.exePath))});function AL(){let e=(0,m.yK)([iH.Ay],()=>iH.Ay.getGamesSeen(!1)),t=(0,m.bG)([iH.Ay],()=>AO(...iH.Ay.getOverrides()));g.useEffect(()=>((0,Aj.a2)(),Aj.e0),[]);let{gameHistory:n,robloxSubgameHistory:i}=g.useMemo(()=>e.reduce((e,t)=>((0,Ay.n1)(t)?e.robloxSubgameHistory.push(t):e.gameHistory.push(t),e),{gameHistory:[],robloxSubgameHistory:[]}),[e]);return{gameHistory:n,robloxSubgameHistory:i,overrideExePaths:t}}function AD(e){let{gameHistory:t}=AL();return{namedGames:g.useMemo(()=>t.values().filter(e=>null!=e.id&&null!=e.name).take(e).toArray(),[t,e]),totalCount:t.length}}function AR(e){let{namedGames:t,totalCount:n}=AD(e);return{names:t.map(e=>e.name),totalCount:n}}function AP(){let{namedGames:e}=AD(2),[t,n]=g.useMemo(()=>e.map(e=>e.id),[e]);g.useEffect(()=>{gr.Ay.fetchApplications([t,n].filter(n8.Vq))},[t,n]);let[i,l]=(0,m.yK)([iz.A],()=>[t,n].map(iz.A.getApplication),[t,n]);return null==t?null:{frontIcon:{icon:(0,c.jsx)(iZ.A,{game:i,size:iZ.M.MEDIUM_LARGE}),shape:Av.e0.ROUNDED},backIcon:null!=n?{icon:(0,c.jsx)(iZ.A,{game:l,size:iZ.M.MEDIUM}),shape:Av.e0.ROUNDED}:null}}let AG=(0,a.AK)(o.X.ACTIVITY_PRIVACY_TO_REGISTERED_GAMES_NAVIGATOR,{useSubtitle:function(){let{names:e,totalCount:t}=AR(2);return j.intl.format(j.t["6nRCFl"],{also:"true",count:t,nameCount:e.length,game1:e[0],game2:e[1]})},useTrailingDecoration:()=>{let e=AP();return{type:d.wF.STACKED_ICONS,icons:e}},destinationKey:o.X.REGISTERED_GAMES_PANEL,usePredicate:()=>(0,m.bG)([iH.Ay],()=>iH.Ay.getGamesSeen(!1).some(e=>!(0,Ay.n1)(e)))&&(0,no.xl)()}),AM=(0,a.gN)(o.X.ACTIVITY_SHARING_RELATED_SETTINGS,{buildLayout:()=>[AG]});var AU=n(395277);let AV=(0,a.zD)(o.X.ACTIVITY_PRIVACY_SETTING,{useTitle:()=>j.intl.string(AU.default.WhdCGP),useSubtitle:()=>j.intl.string(AU.default.UQ9RHJ),useValue:v.tz.useSetting,setValue:v.tz.updateSetting});var Ak=n(406535);let Aw=(0,a.zD)(o.X.ACTIVITY_PRIVACY_NOTIFY_FRIENDS_ONLINE_SETTING,{useTitle:()=>j.intl.string(AU.default.A0FVCV),useSubtitle:()=>j.intl.string(AU.default.vHX6RG),useValue:v.hV.useSetting,setValue:function(e){v.hV.updateSetting(e),e7.default.track(A.HAw.NOTIFICATION_SETTINGS_UPDATED,{update_type:Ak.Y.ACCOUNT,notify_friends_on_come_online:e})}}),AF=(0,a.zZ)(o.X.ACTIVITY_PRIVACY_SHARING_CATEGORY,{useTitle:()=>j.intl.string(j.t.WmsPis),useSearchTerms:()=>[j.intl.string(j.t["8ka8li"])],buildLayout:()=>[AV,Aw,AM]});var AB=n(106531);let Az=(0,a.AK)(o.X.ACTIVITY_PRIVACY_TO_PROFILE_PRIVACY_NAVIGATOR,{useSubtitle:()=>j.intl.string(j.t.J0SFL2),destinationKey:o.X.DATA_AND_PRIVACY_PANEL}),AX=(0,a.gN)(o.X.ACTIVITY_PRIVACY_RELATED_SETTINGS,{usePredicate:()=>(0,AB.lX)("ActivityPrivacyRelatedSettings"),buildLayout:()=>[Az]});var AY=n(945810);let AH=(0,AY.mj)({name:"2026-02-activity-privacy-matching",kind:"user",defaultConfig:{copyChanges:!1,upsell:!1},variations:{0:{copyChanges:!1,upsell:!1},1:{copyChanges:!0,upsell:!1},2:{copyChanges:!0,upsell:!0}}});var AK=n(365258);let AW=(0,a.Qx)(o.X.ACTIVITY_PRIVACY_PER_GUILD_DEFAULT_SETTING,{useTitle:()=>j.intl.string(AU.default["/LHVbt"]),useSubtitle:()=>j.intl.string(j.t.L5IdzV),useOptions:function(){return[{value:ek.Qd.ACTIVITY_STATUS_OFF,name:j.intl.string(AU.default.m3oL7Q)},{value:ek.Qd.ACTIVITY_STATUS_ON_FOR_LARGE_GUILDS,name:j.intl.string(AU.default["5+lnTA"])},{value:ek.Qd.ACTIVITY_STATUS_ON,name:j.intl.string(AU.default["egr+VZ"])}]},useValue:v._Z.useSetting,setValue:function(e){var t;let i=v._Z.getSetting();if(v._Z.updateSetting(e),t="GuildActivitySharingDefaultSetting",!(0,AB.W1)(t)&&!AH.getConfig({location:t}).upsell)return;let l=(0,AK.g8)(i,e);if(null==l)return;let s=(0,AK.Xc)(e);(0,ln.openModalLazy)(async()=>{let{default:e}=await Promise.all([n.e("81849"),n.e("62041"),n.e("41996")]).then(n.bind(n,32167));return t=>(0,c.jsx)(e,{...t,direction:l.direction,affectedGuildIds:l.affectedGuildIds,settingName:s})})}});var AZ=n(498642),Aq=n(573435),AQ=n(260509),AJ=n(876399);function A$(e){let{guild:t,size:n}=e,i=(0,AQ.Iv)(t,n,!1,!0),l=(0,AQ.Rb)(t);return null!=i?(0,c.jsx)("img",{src:i,alt:t.name,height:n,width:n}):(0,c.jsx)("div",{className:AJ.F,children:(0,c.jsx)(z.E,{color:"text-subtle",variant:48===n?"text-md/semibold":"text-xxs/semibold",children:l})})}function A0(e){let{guild:t,size:n}=e;return(0,c.jsx)(Aq.Ay,{className:AJ.z,mask:Aq.Ay.Masks.SQUIRCLE,width:n,height:n,children:(0,c.jsx)(A$,{guild:t,size:n})})}var A1=((s={}).SERVER_ORDER="server-order",s.RECENTLY_JOINED="recently-joined",s.ACTIVITY_SHARING_ON="activity-sharing-on",s.ACTIVITY_SHARING_OFF="activity-sharing-off",s);let A2={"recently-joined":e=>e.concat().sort((e,t)=>null==e.joinedAt?-1:null==t.joinedAt?1:e.joinedAt===t.joinedAt?0:new Date(t.joinedAt).getTime()-new Date(e.joinedAt).getTime()),"activity-sharing-on":(e,t)=>e.concat().sort((e,n)=>{let i=t.includes(e.id),l=t.includes(n.id);return!i&&l?-1:i&&!l?1:0}),"activity-sharing-off":(e,t)=>e.concat().sort((e,n)=>{let i=t.includes(e.id),l=t.includes(n.id);return i&&!l?-1:!i&&l?1:0}),"server-order":e=>e};var A3=n(775657);function A5(e){let{guild:t,isActivityRestricted:n,onToggleActivityRestrictedGuild:i}=e,l=(0,m.bG)([AZ.A],()=>AZ.A.getMemberCount(t.id));return(0,c.jsxs)(F.B,{as:"li",direction:"horizontal",align:"center",gap:16,children:[(0,c.jsx)("div",{className:A3.FO,children:(0,c.jsx)(A0,{guild:t,size:48})}),(0,c.jsx)("div",{className:A3.QH,children:(0,c.jsx)(tK.d,{label:t.name,description:j.intl.format(j.t.zRl6XR,{count:l??0}),checked:!n,onChange:e=>i({checked:e,guildId:t.id})})})]})}let A6=function(e){let{notice:t}=e,{guilds:n,searchQuery:i,setSearchQuery:l,sortOrder:s,setSortOrder:r,hasActivityRestrictedGuilds:a,onToggleAllActivityRestrictedGuilds:o,onToggleActivityRestrictedGuild:u,isActivityRestricted:d,numActivityRestrictedGuilds:h,numTotalGuilds:E}=function(){let[e,t]=(0,g.useState)(""),[n,i]=(0,g.useState)("server-order"),l=(0,m.bG)([u8.Ay],()=>u8.Ay.getFlattenedGuildIds()),s=(0,m.bG)([lc.A],()=>lc.A.getGuilds()),r=l.map(e=>s[e]).filter(Boolean),a=v.Pw.useSetting(),[o,u]=(0,g.useState)(a);async function d(e){u(e);try{await v.Pw.updateSetting(e)}catch(e){u(a)}}(0,g.useEffect)(()=>{u(a)},[a]);let c=0!==o.length,[A,h]=(0,g.useState)(()=>A2[n](r,a)),E=A.map(e=>s[e.id]).filter(Boolean);return{guilds:""===e?E:E.filter(t=>t.name.toLowerCase().includes(e.toLowerCase())),sortOrder:n,searchQuery:e,setSortOrder:e=>{h(A2[e](r,a)),i(e)},setSearchQuery:t,onToggleActivityRestrictedGuild:function(e){let{checked:t,guildId:n}=e,i=new Set(o);t?i.delete(n):i.add(n),d([...i])},isActivityRestricted:function(e){return o.includes(e)},hasActivityRestrictedGuilds:c,onToggleAllActivityRestrictedGuilds:function(){c?d([]):d(l)},numTotalGuilds:l.length,numActivityRestrictedGuilds:o.length}}(),S=(0,g.useId)(),x=(0,g.useRef)(null),T=(0,g.useMemo)(()=>[{id:A1.SERVER_ORDER,label:j.intl.string(j.t.STMPJ2),value:A1.SERVER_ORDER},{id:A1.RECENTLY_JOINED,label:j.intl.string(j.t.CbaapP),value:A1.RECENTLY_JOINED},{id:A1.ACTIVITY_SHARING_ON,label:j.intl.string(AU.default.ZI51JZ),value:A1.ACTIVITY_SHARING_ON},{id:A1.ACTIVITY_SHARING_OFF,label:j.intl.string(AU.default["+kxafn"]),value:A1.ACTIVITY_SHARING_OFF}],[]),p=T.find(e=>e.value===s)?.label??"";return(0,c.jsxs)("div",{className:A3.iE,children:[t,(0,c.jsxs)("div",{className:A3.N1,children:[(0,c.jsx)(Aa.I,{query:i,onChange:l,onClear:function(){e7.default.track(A.HAw.ACTIVITY_SHARING_SETTINGS_INTERACTED,{interaction:"search_cleared",sort_order:s,activity_restricted_guild_count:h,total_guild_count:E}),l("")},onFocus:()=>e7.default.track(A.HAw.ACTIVITY_SHARING_SETTINGS_INTERACTED,{interaction:"search_focused",sort_order:s,activity_restricted_guild_count:h,total_guild_count:E}),onBlur:()=>e7.default.track(A.HAw.ACTIVITY_SHARING_SETTINGS_INTERACTED,{interaction:"search_blurred",sort_order:s,activity_restricted_guild_count:h,total_guild_count:E}),placeholder:j.intl.string(j.t["H+nRYw"]),"aria-label":j.intl.string(j.t["5h0QOP"]),inputProps:{"aria-controls":S,"aria-expanded":!0}}),n.length>0&&(0,c.jsxs)("div",{className:A3.gO,children:[(0,c.jsx)(rX.Y,{targetElementRef:x,position:"bottom",align:"left",renderPopout:e=>{let{closePopout:t}=e;return(0,c.jsx)(ds.W,{navId:"guild-sort-order-menu",onClose:t,"aria-label":j.intl.string(j.t.LxVjvJ),onSelect:t,children:(0,c.jsx)(e0.rX,{children:T.map(e=>{let{id:t,label:n,value:i}=e;return(0,c.jsx)(e0.iD,{id:t,group:"sort-order",label:n,checked:s===i,action:()=>{e7.default.track(A.HAw.ACTIVITY_SHARING_SETTINGS_INTERACTED,{interaction:"sort_order_changed",sort_order:i,activity_restricted_guild_count:h,total_guild_count:E}),r(i)}},t)})})})},children:e=>(0,c.jsxs)(t8.D,{...e,innerRef:x,className:A3.Ku,children:[(0,c.jsx)(z.E,{variant:"text-sm/medium",color:"text-subtle",children:p}),(0,c.jsx)(dP.a,{size:"xs",color:nK.A.colors.TEXT_SUBTLE})]})}),(0,c.jsx)(Ai.Q,{variant:"primary",textVariant:"text-sm/medium",onClick:o,text:a?j.intl.string(j.t["7lxcLO"]):j.intl.string(j.t.zh6UEs)})]})]}),(0,c.jsx)(i8.A,{"aria-live":"polite",role:"region",children:j.intl.format(AU.default.EvzDff,{count:n.length})}),(0,c.jsxs)("ul",{className:A3.X1,id:S,"aria-label":j.intl.string(j.t["7hB4kg"]),children:[0===n.length&&(0,c.jsx)("div",{className:A3.pb,children:(0,c.jsx)(z.E,{className:A3.R$,variant:"text-lg/medium",children:j.intl.string(j.t["Xe+fJM"])})}),n.map(e=>(0,c.jsx)(A5,{guild:e,isActivityRestricted:d(e.id),onToggleActivityRestrictedGuild:u},e.id))]})]})};var A4=n(155957);let A8=(0,a.E2)(o.X.ACTIVITY_PRIVACY_PER_GUILD_SETTING,{useSearchTerms:()=>[j.intl.string(AU.default["/LHVbt"])],Component:function(){let e=v.tz.useSetting()?null:(0,c.jsx)("div",{className:A4.l,children:(0,c.jsx)(iV.w,{type:"warning",children:j.intl.string(AU.default["xxI0/W"])})});return(0,c.jsx)(A6,{notice:e})}}),A7=(0,a.zZ)(o.X.ACTIVITY_PRIVACY_PER_GUILD_CATEGORY,{useTitle:()=>j.intl.string(j.t.bwqjL9),buildLayout:()=>[AW,A8,AX]}),A9=(0,a.zD)(o.X.ACTIVITY_PRIVACY_FRIENDS_JOIN_SETTING,{useTitle:()=>j.intl.string(AU.default.khuuzv),useSubtitle:()=>j.intl.string(AU.default["8EWsJ8"]),useValue:()=>v.e.useSetting(),setValue:e=>v.e.updateSetting(e)}),he=(0,a.E2)(o.X.ACTIVITY_PRIVACY_GAME_JOINING_BLURB,{useSearchTerms:()=>[],Component:function(){return(0,c.jsx)(z.E,{variant:"text-sm/normal",color:"text-muted",children:j.intl.format(j.t.Mf0720,{privacySettingsHook:(e,t)=>(0,c.jsx)(z.E,{tag:"span",variant:"text-sm/semibold",color:"text-muted",children:e},t)})})}}),ht=(0,a.zD)(o.X.ACTIVITY_PRIVACY_VOICE_JOIN_SETTING,{useTitle:()=>j.intl.string(AU.default.Uz5Ipi),useSubtitle:()=>j.intl.string(AU.default.CZI2Gb),useValue:()=>v.UM.useSetting(),setValue:e=>v.UM.updateSetting(e)}),hn=(0,a.zZ)(o.X.ACTIVITY_PRIVACY_GAME_JOINING_CATEGORY,{useTitle:()=>j.intl.string(AU.default["89YBr5"]),useSubtitle:()=>j.intl.string(j.t.uGDpgH),buildLayout:()=>[A9,ht,he],useSearchTerms:()=>[j.intl.string(j.t.VOszPA)]}),hi=(0,a.t_)(o.X.ACTIVITY_PRIVACY_PANEL,{useTitle:()=>j.intl.string(j.t.Cq98yL),buildLayout:()=>[AF,A7,hn]}),hl=(0,a.i4)(o.X.ACTIVITY_PRIVACY_SIDEBAR_ITEM,{useTitle:()=>j.intl.string(j.t.Cq98yL),icon:Ab._,buildLayout:()=>[hi]});var hs=n(712440),hr=n(370997);let ha=(0,a.E2)(o.X.AUTHORIZED_APPS_LIST_SETTING,{Component:hr.Ay,useSearchTerms:()=>[j.intl.string(j.t["f6kk+r"])]});var ho=n(462887),hu=n(478016),hd=n(789645),hc=n(259678),hg=n(77468),hm=n(289498),hA=n(573648),hh=n(874490),hE=n(370480),hS=n(968309);let hx=new Set([A.fg2.XBOX,A.fg2.PLAYSTATION,A.fg2.PLAYSTATION_STAGING,A.fg2.CRUNCHYROLL]);var hT=n(169869),hp=n(235693),hf=n(757036),hI=n(555837),h_=n(814925),hN=n(733110),hC=n(43990),hb=n(241524),hy=n(346017),hv=n(51965),hj=n(631368),hO=n(968671),hL=n(212739),hD=n(30370),hR=n(933287),hP=n(594387),hG=n(651439);function hM(){let e,t,i,l,s,{variant:r,showFooter:a}=(e=(0,hj.$)(),t=(0,hO.GM)("connectedAccountsBannerFooter"),i=(0,hL.O)(),s=null!=(l=(0,m.bG)([hD.A],()=>hD.A.getAccount(null,A.fg2.XBOX)))&&!l.revoked,e===hj.C.NONE||i?{variant:hj.C.NONE,showFooter:!1}:{variant:e,showFooter:t&&e===hj.C.NO_ACCESS&&!s}),{analyticsLocations:o}=(0,eL.Ay)(tv.A.XBOX_CONNECTED_ACCOUNTS_BANNER),u=(0,hy.yW)(o),d=(0,hb.A)("(max-width: 485px)");if(r===hj.C.NONE)return null;let g=d?"md":"sm",h="",S=null;switch(r){case hj.C.HAS_ACCESS:case hj.C.BLOCK_CLAIM:h=j.intl.string(hR.default["7PdsMK"]),S=(0,c.jsx)(hv.A,{variant:"overlay-primary",size:g,fullWidth:d,text:j.intl.string(hR.default.CubeLC),onClick:()=>{(0,ln.openModalLazy)(async()=>{let{default:e}=await Promise.all([n.e("52283"),n.e("13088")]).then(n.bind(n,347171));return t=>(0,c.jsx)(e,{...t,sourceAnalyticsLocations:o})})}});break;case hj.C.NO_ACCESS:h=j.intl.string(hR.default.NwkRTZ),S=(0,c.jsx)(tR.A,{defaultTextOverride:j.intl.string(hR.default["0vY+ie"]),variantOverride:"overlay-primary",size:g,fullWidth:d,subscriptionTier:tk.pe.TIER_2});break;default:(0,n8.xb)(r)}return(0,c.jsxs)(eL.f5,{value:o,children:[(0,c.jsxs)("div",{className:hG.bV,children:[(0,c.jsx)(E.D,{variant:"heading-md/semibold",color:"text-strong",children:j.intl.string(j.t.NG1e6l)}),(0,c.jsx)(rG.t,{size:"xs",color:"var(--icon-default)"})]}),(0,c.jsx)(hC.N,{theme:"dark",children:e=>(0,c.jsx)("div",{className:e,children:(0,c.jsxs)("div",{className:hG.Nr,children:[(0,c.jsxs)("div",{className:hG.Tp,children:[(0,c.jsx)("div",{className:hG.Qw,style:{backgroundImage:`url(${a?"https://cdn.discordapp.com/assets/content/1858990b1e56c7d51e887008753104d4663d06c0e0e296d8fe0ea85c7e3e8341.png":"https://cdn.discordapp.com/assets/content/7308e937fbd3074b9de0ebba1fa3571fa7b10a2b88f384b382f711bae99f40e6.png"})`}}),(0,c.jsx)("div",{className:hG.$h}),(0,c.jsx)("div",{className:hG.Rv}),(0,c.jsx)("div",{className:hG.Lw})]}),(0,c.jsxs)("div",{className:hG.Mn,children:[(0,c.jsxs)("div",{className:hG.mY,children:[(0,c.jsx)("img",{className:hG.wm,src:"https://cdn.discordapp.com/assets/content/c5fab2b5d1155c4c9bc088b07f8563b6db8d2d08666357486efc5aea6e97fbea.png",alt:"Xbox Game Pass"}),(0,c.jsx)(z.E,{variant:"text-lg/semibold",color:"text-strong",className:hG.DD,children:h})]}),(0,c.jsx)("div",{className:hG.lO,children:S})]}),a&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{className:hG.yF}),(0,c.jsxs)("div",{className:hG.sQ,children:[(0,c.jsx)(oP.o,{size:d?"md":"sm",color:nK.A.colors.ICON_STRONG}),(0,c.jsx)(z.E,{variant:"text-sm/normal",color:"text-default",children:j.intl.format(hP.default.mXY4Rb,{onConnect:()=>{u(hy.Hx.CONNECT),(0,hS.A)({platformType:A.fg2.XBOX,location:"Connected Accounts Banner"})}})})]})]})]})})})]})}var hU=n(201718),hV=n(321078),hk=n(672130),hw=n(379848),hF=n(567910);function hB(e){let{markAsDismissed:t}=e;return g.useEffect(()=>t(cu.i.UNKNOWN),[t]),(0,c.jsx)(e9.Lp,{className:hF.Ad,text:j.intl.string(j.t.y2b7CA)})}function hz(e){let{title:t,body:n,img:i,newIndicatorDismissibleContent:l,onClick:s}=e;return(0,c.jsxs)("div",{className:hF.kL,children:[i,(0,c.jsxs)("div",{className:hF.FS,children:[(0,c.jsxs)("div",{className:hF.TK,children:[(0,c.jsx)(hw.Ay,{contentTypes:[l],children:e=>{let{visibleContent:t,markAsDismissed:n}=e;return t===l?(0,c.jsx)(hB,{markAsDismissed:n}):null}}),(0,c.jsx)(z.E,{variant:"text-md/semibold",children:t})]}),(0,c.jsx)(z.E,{variant:"text-xs/normal",children:n})]}),(0,c.jsx)(p.$,{text:j.intl.string(j.t.vD60Pv),onClick:s})]})}function hX(){let e=eS.A.getArticleURL(A.MVz.PS_CONNECTION);return(0,c.jsx)(hz,{title:j.intl.string(j.t.v20wwm),body:j.intl.format(j.t.lTZBit,{help_article:e}),img:(0,c.jsx)("img",{src:"/assets/88954903b6a5b9cc.svg",width:"82",height:"auto",alt:""}),newIndicatorDismissibleContent:er.M.PS_ONE_WAY_RECONNECT,onClick:()=>(0,hS.A)({platformType:A.fg2.PLAYSTATION,location:"PS two way upsell"})})}let hY="/assets/9df988a227916145.png";function hH(){return(0,c.jsx)(hz,{title:j.intl.string(hP.default["9cLtDI"]),body:j.intl.format(hP.default["D+kUbg"],{learnMoreLink:eS.A.getArticleURL(A.MVz.XBOX_GAME_PASS_PERKS)}),img:(0,c.jsx)("img",{src:hY,width:"auto",height:"45",alt:""}),newIndicatorDismissibleContent:er.M.XBOX_PERKS_RECONNECT_UPSELL,onClick:()=>(0,hS.A)({platformType:A.fg2.XBOX,location:"Xbox perks reconnect upsell"})})}function hK(){let e=eS.A.getArticleURL(A.MVz.XBOX_CONNECTION);return(0,c.jsx)(hz,{title:j.intl.string(j.t["2okkZV"]),body:j.intl.format(j.t.OnERSS,{help_article:e}),img:(0,c.jsx)("img",{src:hY,width:"auto",height:"45",alt:""}),newIndicatorDismissibleContent:er.M.XBOX_ONE_WAY_RECONNECT,onClick:()=>(0,hS.A)({platformType:A.fg2.XBOX,location:"Xbox two way upsell"})})}var hW=n(783419),hZ=n(360308),hq=n(230451),hQ=n(113463);function hJ(e){let t,{integration:n}=e,{isJoining:i,joinErrorMessage:l,showJoinErrorMessage:s}=(0,m.cf)([hD.A],()=>({isJoining:hD.A.isJoining(n.id),joinErrorMessage:""===hD.A.joinErrorMessage(n.id)?j.intl.string(j.t.j2d6Km):hD.A.joinErrorMessage(n.id),showJoinErrorMessage:void 0!==hD.A.joinErrorMessage(n.id)}),[n.id]);return null!=(0,m.bG)([lc.A],()=>lc.A.getGuild(n.guild.id),[n.guild.id])||(t=(0,c.jsx)(p.$,{size:"sm",onClick:function(){hg.A.joinServer(n.id,()=>{})},disabled:i,variant:"primary",text:i?j.intl.string(j.t.RXvQQu):j.intl.string(j.t.XpeFYr)})),(0,c.jsxs)("div",{className:hQ.iA,children:[(0,c.jsxs)("div",{className:hQ.XX,children:[(0,c.jsx)(dd.Ay,{size:dd.Ay.Sizes.SMALL,guild:n.guild,className:hQ.$f}),(0,c.jsxs)("div",{className:hQ.Vn,children:[(0,c.jsx)(z.E,{variant:"text-md/semibold",color:"text-strong",children:n.guild.name}),(0,c.jsx)(aL.Anchor,{href:hA.A.get(n.type)?.getPlatformUserUrl?.(n.account),children:(0,c.jsx)(z.E,{variant:"text-xs/normal",color:"text-default",children:n.account.name})})]}),t]}),s&&(0,c.jsx)(z.E,{variant:"text-xs/normal",color:"text-feedback-critical",className:hQ.R,children:l})]})}function h$(e){var t;let n,i,{account:l}=e,s=(t=l.id,n=(0,hI.G)({location:"useShouldShowXboxPerksReconnectUpsell"}),i=(0,hf.L)(tk.PremiumTypes.TIER_2),!n&&!i&&!/^\d+$/.test(t));return l.type===A.fg2.XBOX&&s?(0,c.jsx)(hH,{}):l.twoWayLink?null:l.type===A.fg2.XBOX?(0,c.jsx)(hK,{}):l.type===A.fg2.PLAYSTATION?(0,c.jsx)(hX,{}):null}function h0(e){let t,n,i,l,s,r,a,{onDisconnect:o,account:u,theme:d,locale:m}=e,[h,E]=g.useState(u.friendSync),[S,x]=g.useState(u.visibility),[T,f]=g.useState(u.metadataVisibility),[I,_]=g.useState(u.showActivity),[N,C]=g.useState(null),[b,y]=g.useState(null),[v,O]=g.useState(!1),[L,D]=g.useState([]),R=(0,hh.ML)(u.type),P=hA.A.get(R);g.useEffect(()=>{E(u.friendSync),x(u.visibility),f(u.metadataVisibility),_(u.showActivity)},[u]);let G={inProgressVisibility:N,inProgressMetadataVisibility:b},M=g.useRef(G);return g.useEffect(()=>{M.current=G}),g.useEffect(()=>{if(!1===u.verified)return;let{inProgressVisibility:e,inProgressMetadataVisibility:t}=M.current;null!=e&&(x(e),hg.A.setVisibility(u.type,u.id,e),C(null)),null!=t&&(f(t),hg.A.setMetadataVisibility(u.type,u.id,t),y(null))},[u]),(0,c.jsxs)("div",{className:hQ.FI,children:[(t=hA.A.get(u.type),n=hA.A.get(R),i="1"===(u.metadata??{})[hW.pK.TWITTER_VERIFIED],l=null,t.type===A.fg2.TWITTER&&i&&(l=(0,c.jsx)(i4.m,{text:j.intl.string(j.t.Jebrww),children:(0,c.jsx)(h_.A,{color:nK.A.unsafe_rawColors.PLATFORM_TWITTER.css,children:(0,c.jsx)(hu.U,{size:"xs",color:nK.A.unsafe_rawColors.WHITE.css})})})),(0,c.jsxs)("div",{className:hQ.Il,children:[(0,c.jsx)("img",{alt:n.name,className:hQ.gj,src:(0,ho.M)(d)?n.icon.darkSVG:n.icon.lightSVG}),(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:hQ.$p,children:[(0,c.jsx)(z.E,{color:"text-strong",variant:"text-md/semibold",className:hQ.RW,children:u.name}),null!=l&&(0,c.jsx)("div",{className:hQ.cG,children:l})]}),(0,c.jsx)(z.E,{variant:"text-xs/normal",color:"text-default",className:hQ.Au,children:n.migrationData?.getMigrationExperimentEnabled("User Settings Connections Web")?j.intl.format(hq.default.Glhokn,{platformName:n.name}):n.name})]}),(0,c.jsx)(t8.D,{className:hQ.uH,onClick:function(){let e=hA.A.get(u.type);(0,ln.openModal)(t=>(0,c.jsx)(lt.Modal,{title:j.intl.formatToPlainString(j.t.U5x12f,{name:e.name}),subtitle:j.intl.format(j.t.VgqIPj,{provider:e.name}),actions:[{text:j.intl.string(j.t["ETE/oC"]),onClick:t.onClose,variant:"secondary"},{text:j.intl.string(j.t.bsbMVz),onClick:()=>{o(),t.onClose()},variant:"primary"}],...t,children:hx.has(u.type)&&u.twoWayLink&&(0,c.jsx)(lz.A,{children:j.intl.format(j.t.COW3Xn,{platformName:e.name})})}))},"aria-label":j.intl.string(j.t.ppppRJ),focusProps:{offset:{top:-4,left:-4,right:-4}},children:(0,c.jsx)(hd.P,{size:"xs",color:"currentColor"})})]})),(0,c.jsx)(h$,{account:u}),function(e){let t=e.metadata??{},n=null,i=(0,hE.An)(t[hW.pK.CREATED_AT],m);switch(e.type){case A.fg2.REDDIT:n=(0,hT.xE)(t,hQ.Nz);break;case A.fg2.STEAM:n=(0,hT.dy)(t,hQ.Nz);break;case A.fg2.BLUESKY:case A.fg2.TWITTER:case A.fg2.MASTODON:n=(0,hT.ED)(t,hQ.Nz);break;case A.fg2.EBAY:n=(0,hT.ub)(t,hQ.Nz);break;case A.fg2.PAYPAL:n=(0,hT.gZ)(t,hQ.Nz);break;case A.fg2.TIKTOK:n=(0,hT.HU)(t,hQ.Nz)}null!==i&&(null==n&&(n=[]),n?.push((0,c.jsx)(z.E,{variant:"text-xs/normal",color:"text-subtle",className:hQ.M4,children:j.intl.format(j.t["9rfonh"],{date:i})},"member-since")));let l=L.includes(e.id),s=j.intl.string(j.t.wzzjk9);if(null==n||0===n.length)if(!0!==hA.A.get(e.type).hasMetadata)return null;else n=[(0,c.jsx)(e9.Lp,{className:hQ.Z3,text:j.intl.string(j.t.y2b7CA)},"badge"),(0,c.jsx)(z.E,{variant:"text-xs/normal",className:hQ.vt,children:j.intl.format(j.t.Up2ni7,{helpdeskUrl:eS.A.getArticleURL(A.MVz.CONNECTION_DETAILS)})},"label")],s=j.intl.string(j.t["LVh3/5"]);return l&&(s=j.intl.string(j.t.i4jeWR)),n.push((0,c.jsx)("div",{className:hQ.jy,children:(0,c.jsx)(p.$,{text:s,variant:"secondary",size:"sm",loading:v,disabled:l,"aria-label":j.intl.string(j.t.sCkLYH),onClick:l?void 0:()=>{O(!0),hg.A.refresh(e.type,e.id).finally(()=>{setTimeout(()=>{L.push(e.id),D(L),O(!1)},2e3)})}})},"refresh-button")),(0,c.jsx)("div",{className:hQ.tJ,children:n})}(u),(A.txh.has(u.type)&&(s=(0,c.jsx)(tK.d,{label:j.intl.string(j.t["+KCMSi"]),checked:h,onChange:function(e){E(e),hg.A.setFriendSync(u.type,u.id,e)}})),A.ewM.has(u.type)&&(r=(0,c.jsx)(tK.d,{label:j.intl.format(j.t["6u6J0q"],{platform:P.name}),checked:I,onChange:function(e){_(e),hg.A.setShowActivity(u.type,u.id,e)}})),hA.A.get(u.type)?.hasMetadata===!0&&(a=(0,c.jsx)(tK.d,{label:j.intl.string(j.t.FYKGsL),checked:1===T,onChange:function(e){let{verified:t}=u,n=+!!e;if(e&&!t){y(n),(0,hS.A)({platformType:u.type,location:"User Settings"});return}f(n),hg.A.setMetadataVisibility(u.type,u.id,n)},disabled:1!==S||null==u.metadata})),(0,c.jsxs)("div",{className:hQ.HZ,children:[(0,c.jsx)(tK.d,{label:j.intl.string(j.t.f7yOAX),checked:1===S,onChange:function(e){let{verified:t}=u,n=+!!e;if(e&&!t){C(n),(0,hS.A)({platformType:u.type,location:"User Settings"});return}x(n),hg.A.setVisibility(u.type,u.id,n)}}),a,r,s]})),function(){if(u.revoked||u.integrations.length>0)return(0,c.jsx)(i2.c,{})}(),u.revoked?(0,c.jsx)(rM.p,{messageType:rM.Y.INFO,children:j.intl.format(j.t["6C4lgA"],{onReconnect:function(){(0,hS.A)({platformType:u.type,location:"User Settings"})}})}):u.integrations.length>0?(0,c.jsx)(tH.D,{label:j.intl.string(j.t.fOe3fZ),children:u.integrations.map(e=>(0,c.jsx)(hJ,{integration:e},e.id))}):void 0,(0,c.jsx)(hp.A,{partner:u.type})]})}function h1(e){let{appIdentity:t,oauth2Token:n}=e;return null==n?null:(0,c.jsxs)("div",{className:hQ.FI,children:[function(e,t){let{application:n}=t,i=y.Ay.getApplicationIconURL({id:n.id,icon:n.icon});return(0,c.jsxs)("div",{className:hQ.Il,children:[(0,c.jsx)("img",{alt:n.name,className:ie()(hQ.gj,hQ.sN),src:i}),(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:hQ.$p,children:(0,c.jsx)(z.E,{color:"text-strong",variant:"text-md/semibold",className:hQ.RW,children:e.profile.username})}),(0,c.jsx)(z.E,{variant:"text-xs/normal",color:"text-strong",className:hQ.Au,children:n.name})]}),(0,c.jsx)(t8.D,{className:hQ.uH,onClick:()=>(0,hr.d1)(n,t.scopes,()=>{hs.A.delete(t.id)}),"aria-label":j.intl.string(j.t.ppppRJ),focusProps:{offset:{top:-4,left:-4,right:-4}},children:(0,c.jsx)(hd.P,{size:"xs",color:"currentColor"})})]})}(t,n),(0,c.jsx)("div",{className:hQ.HZ,children:(0,c.jsx)(tK.d,{label:j.intl.string(j.t.f7yOAX),checked:t.profile?.connection_visible??!1,onChange:e=>{hU.A.updateApplicationIdentityConfig(n.application.id,t.provider_issued_user_id,{connection_visible:e})}})})]})}function h2(e){let t=hA.A.get(e);(0,hS.A)({platformType:t.type}),e7.default.track(A.HAw.ACCOUNT_LINK_STEP,{previous_step:"desktop connections",current_step:"desktop oauth",platform_type:t.type})}function h3(){let e=(0,hh.gn)(),t=(0,iX.A)((0,hZ.getMigratedApplicationIdentityConnectionsScreenApplications)("NewConnectionsList"));return(0,c.jsxs)("div",{className:hQ.lA,children:[t.map(e=>null!=e&&(0,c.jsx)(hk.A,{application:e,className:hQ.__invalid_accountButton,innerClassName:hQ.U$},e.id)),e.slice(0,10-t.length).map(e=>(0,c.jsx)(hm.A,{type:e.type,className:hQ.__invalid_accountButton,innerClassName:hQ.U$},e.type)),(0,c.jsx)(i4.m,{text:j.intl.string(j.t.QqTz8b),children:(0,c.jsx)("div",{className:ie()(hQ.ej,hQ.__invalid_accountButton),children:(0,c.jsx)(hc.vN,{children:(0,c.jsx)("button",{className:ie()(hQ.R8,hQ.U$),type:"button",onClick:function(){e2.h.dispatch({type:"CONNECTIONS_GRID_MODAL_SHOW",onComplete:h2})},"aria-label":j.intl.string(j.t.Zhcj9X),children:(0,c.jsx)(nQ._,{color:"currentColor",size:"md","aria-label":j.intl.string(j.t.QqTz8b)})})})})})]})}function h5(e){let t,{fetching:n,accounts:i,appIdentities:l,authorizedApps:s,theme:r,locale:a}=e,o=g.useMemo(()=>i.filter(e=>hA.A.isSupported(e.type)),[i]);return t=n?(0,c.jsx)(aY.y,{type:aY.y.Type.SPINNING_CIRCLE}):0===o.length&&0===l.length?(0,c.jsx)(mx.pp,{theme:r,className:hQ.p$,children:(0,c.jsx)(mx.SG,{note:j.intl.string(j.t.WenGZ2),children:j.intl.string(j.t.aoLS84)})}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(E.D,{variant:"heading-md/semibold",color:"text-strong",children:j.intl.format(j.t.AioIGb,{count:l.length+o.length})}),l.map((e,t)=>(0,c.jsx)(h1,{appIdentity:e,oauth2Token:s.find(t=>t.application.id===e.application_id)},`app-${t}`)),o.map((e,t)=>(0,c.jsx)(h0,{theme:r,account:e,locale:a,onDisconnect:()=>(function(e){let{type:t,id:n}=e;hg.A.disconnect(t,n)})(e)},`connection-${t}`))]}),(0,c.jsx)("div",{className:hQ.V,children:t})}let h6=(0,a.E2)(o.X.CONNECTIONS_ADD_CONNECTIONS_SETTING,{Component:function(){return(0,c.jsx)(tH.D,{label:j.intl.string(j.t["t+aGse"]),children:(0,c.jsx)(h3,{})})},useSearchTerms:()=>[j.intl.string(j.t.Zhcj9X),j.intl.string(j.t.QqTz8b),j.intl.string(j.t["+/hZM/"]),j.intl.string(j.t.bsbMVz),j.intl.string(j.t.f7yOAX),j.intl.string(j.t.FYKGsL),j.intl.string(j.t["+KCMSi"])]}),h4=(0,a.E2)(o.X.CONNECTIONS_CONNECTED_ACCOUNTS_SETTING,{Component:function(){let e=(0,m.bG)([e8.A],()=>e8.A.hidePersonalInformation),t=(0,m.bG)([hD.A],()=>hD.A.isFetching()),n=(0,m.bG)([hD.A],()=>hD.A.getAccounts()),{authorizedAppsFetchState:i,authorizedApps:l}=(0,m.cf)([hN.default],()=>({authorizedAppsFetchState:hN.default.getFetchState(),authorizedApps:hN.default.getNewestTokensForNonChildrenApplications()})),{isLoading:s,filteredAppIdentities:r}=(0,hV.A)(l1.default.getCurrentUser().id,{includeHidden:!0}),a=(0,ux.Ay)(),o=(0,m.bG)([oI.default],()=>oI.default.locale);return(g.useEffect(()=>{i===hN.FetchState.NOT_FETCHED&&hs.A.fetch()},[i]),e)?null:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(hM,{}),(0,c.jsx)(h5,{fetching:t||s||r.length>0&&i!==hN.FetchState.FETCHED,accounts:n,appIdentities:r,authorizedApps:l,theme:a,locale:o})]})},initialize:()=>{hg.A.fetch()},useSearchTerms:()=>[j.intl.string(j.t["+/hZM/"]),j.intl.string(j.t.bsbMVz),j.intl.string(j.t.f7yOAX),j.intl.string(j.t.FYKGsL),j.intl.string(j.t["+KCMSi"])]});var h8=n(206828);let h7=(0,a.zZ)(o.X.CONNECTIONS_CATEGORY,{useTitle:()=>j.intl.string(j.t["3fe7U5"]),useSubtitle:()=>j.intl.string(j.t.U22vw6),useInlineNotice:function(){let e=(0,m.bG)([hD.A],()=>hD.A.getAccounts()),t=g.useMemo(()=>hA.A.filter(e=>e.migrationData?.getMigrationExperimentEnabled("ConnectionDeprecationInlineNotice")===!0).filter(t=>e.some(e=>e.type===t.type)),[e]),[n,i]=g.useState(0),[l,s]=g.useState(t),r=t!==l;r&&(s(t),i(0));let a=g.useMemo(()=>t[n],[t,n]),o=(0,iX.h)(a?.migrationData?.replacedBy),{canStartAuthorization:u,hasAlreadyLinked:c,fetched:h}=(0,h8.RD)(o),E=a?.type===A.fg2.RIOT_GAMES||a?.type===A.fg2.LEAGUE_OF_LEGENDS?j.intl.string(hq.default["1S6oAo"]):o?.name,S=null!=a&&h,x=S&&!c&&u&&o?.connectionEntrypointUrl!=null;return r||!S||x||i(e=>e+1),g.useMemo(()=>x?{type:d.lT.INLINE_NOTICE,noticeType:"info",text:j.intl.format(hq.default.wUXupS,{connectionName:a.name,applicationName:E,connectionEntrypointUrl:o?.connectionEntrypointUrl,helpCenterLink:a.migrationData?.helpCenterLink!=null?a.migrationData.helpCenterLink:""})}:null,[a,E,o,x])},buildLayout:()=>[h6,h4]}),h9=(0,a.zZ)(o.X.AUTHORIZED_APPS_CATEGORY,{useTitle:()=>j.intl.string(j.t["f6kk+r"]),useSubtitle:()=>j.intl.string(j.t.G9JfLg),buildLayout:()=>[ha],initialize:()=>(hs.A.fetch(),()=>{hr.iU.setState({searchQuery:""})})}),Ee=(0,a.t_)(o.X.CONNECTED_APPS_PANEL,{useTitle:()=>j.intl.string(j.t.lrVuZO),useObscuredNotice:az.L,buildLayout:()=>[h7,h9]}),Et=(0,a.i4)(o.X.CONNECTED_APPS_SIDEBAR_ITEM,{useTitle:()=>j.intl.string(j.t.lrVuZO),icon:mT.q,buildLayout:()=>[Ee]});var En=n(625657),Ei=n(592598),El=n(773371),Es=n(184809),Er=n(672396);let Ea=Eu(null);function Eo(){var e;let t=Eu(Ea);e=Ea,k().isEqual(k().omit(t,"old_enabled"),k().omit(e,"old_enabled"))||(e7.default.track(A.HAw.OVERLAY_SETTINGS_UPDATED,{...t}),Ea=t)}function Eu(e){let t=Es.default.getNotificationPositionMode(),n=t!==A.G6Q.DISABLED,i=lL.Ay.getOverlayKeybind(),l=lL.Ay.getOverlayChatKeybind();return{enabled:El.default.enabled,notifications_enabled:n,notifications_position:n?t:null,text_notifications_mode:Ei.A.isNotificationDisabled(Er.KS.TextChat)?"DISABLED":"ENABLED",hotkey:null!=i?(0,le.dI)(i.shortcut):null,text_activation_hotkey:null!=l?(0,le.dI)(l.shortcut):null,text_opacity_slider:Es.default.getTextWidgetOpacity(),old_enabled:e?.enabled??El.default.enabled}}var Ed=n(237984),Ec=n(295648);function Eg(e){e.preventDefault(),e.stopPropagation()}function Em(e){let{header:t,icon:n,title:i,description:l,action:s,hint:r,warning:a,onClick:o,"aria-label":u,className:d}=e;return(0,c.jsxs)("div",{className:ie()(Ec.HS,d),children:[(0,c.jsxs)(Ao.s,{"aria-label":u,onClick:o,children:[null!=t&&(0,c.jsx)("div",{className:Ec.x_,children:t}),(0,c.jsxs)("div",{className:Ec.rN,children:[null!=n&&(0,c.jsx)("div",{className:Ec.$t,children:n}),(0,c.jsxs)("div",{className:Ec.c8,children:[(0,c.jsx)(z.E,{variant:"text-md/medium",color:"text-strong",className:Ec.SZ,children:i}),null!=l&&(0,c.jsx)(z.E,{variant:"text-sm/normal",color:"text-subtle",children:l}),null!=r&&(0,c.jsx)(z.E,{variant:"text-xxs/medium",color:"text-muted",children:r})]}),(0,c.jsx)("div",{className:Ec.a$,children:s})]})]}),(0,c.jsx)("div",{className:Ec.Om,children:a})]})}let EA=(0,a.E2)(o.X.OVERLAY_BUG_REPORTER_SETTING,{Component:function(){return(0,c.jsx)(Em,{title:j.intl.string(j.t["z4/l+V"]),description:j.intl.string(j.t["3aZq/0"]),action:(0,c.jsx)(p.$,{variant:"primary",text:j.intl.string(j.t.s2nVhG),onClick:()=>{(0,Ed.b)(tv.A.USER_SETTINGS,A.BRT.APP)}}),"aria-label":j.intl.string(j.t["z4/l+V"])})},useSearchTerms:()=>[j.intl.string(j.t["z4/l+V"])]});var Eh=n(31300),EE=n(183208),ES=n(684013),Ex=n(56562),ET=n(311043),Ep=n(569926),Ef=n(810412),EI=n(41984),E_=n(296027),EN=n(562519);let EC=5*n(927813).A.Millis.DAY,Eb=new EN.A("overlay_survey_timestamps");function Ey(e,t){let i,l;i=Date.now(),null!=(l=Array.from(Eb.values()).reduce((e,t)=>Math.max(e,t),0))&&i-l<EC||Array.from(Eb.values()).filter(e=>{let t=new Date(e);return t.getMonth()===new Date().getMonth()&&t.getFullYear()===new Date().getFullYear()}).length>=3||(0,ln.openModalLazy)(async()=>{let i,{default:l}=await Promise.all([n.e("79969"),n.e("82318")]).then(n.bind(n,387101));return i=Date.now(),Eb.add(i),n=>(0,c.jsx)(l,{...n,clientSettingType:e,gameId:t})})}function Ev(){(0,iQ.sL)("overlay-settings")}function Ej(e){let{className:t,game:n}=e;return(0,iQ.NP)()&&null!=n&&n.elevated?(0,c.jsx)("div",{className:t,children:(0,c.jsx)(rM.p,{messageType:rM.Y.WARNING,action:(0,c.jsx)(p.$,{variant:"secondary",size:"sm",text:j.intl.string(j.t["1iI46O"]),onClick:Ev}),children:j.intl.format(j.t["LJzl+0"],{helpCenterLink:eS.A.getArticleURL(A.MVz.SYSTEM_SERVICE)})})}):null}var EO=n(760751),EL=n(9302),ED=n(656513);let ER=new Set([EI.AR.INITIALIZING,EI.AR.WAITING_FOR_SCREEN_TYPE_RESOLUTION,EI.AR.WAITING_FOR_MODULE_TRACKING,EI.AR.WAITING_FOR_OVERLAY_OPEN,EI.AR.WAITING_FOR_POPOUT_OPEN,EI.AR.WAITING_FOR_MODULE_POPOUT_CAPTURE,EI.AR.WAITING_FOR_REACT_INITIALIZATION,EI.AR.WAITING_FOR_PID_FOCUS,EI.AR.WAITING_FOR_SUCCESSFUL_SHOW]);function EP(e){let{children:t,className:n,onExpand:i,...l}=e,[s,r]=g.useState(!1);return(0,c.jsx)(ED.N,{className:Ec.uR,collapsibleContent:(0,c.jsx)("div",{className:Ec.oV,children:t}),children:e=>{let{onClick:t}=e;return(0,c.jsx)(Em,{...l,onClick:e=>{var n;r(n=!s),i?.(n),t?.(e)},className:ie()(Ec.AC,n),action:(0,c.jsxs)("div",{className:Ec.rc,children:[l.action,s?(0,c.jsx)(dP.a,{size:"custom",width:20,height:20,color:"var(--interactive-text-active)"}):(0,c.jsx)(nQ._,{size:"custom",width:20,height:20,color:"var(--interactive-text-active)"})]})})}})}let EG=(0,a.E2)(o.X.OVERLAY_CURRENT_GAME,{Component:function(){let{runningGame:e,runningGameApplication:t}=iW();(0,Ep.I)(e?.id);let n=e?.pid,i=(0,m.bG)([E_.default],()=>null==e||null==n?null:E_.default.getTrackedGameByPid(n),[e,n],iB()),{data:l}=(0,Ep.I)(i?.gameId),{enabledLegacy:s,enabledOOP:r}=(0,m.cf)([EO.A,te.A,ET.A],()=>null==e&&null==i?{enabledLegacy:!1,enabledOOP:!1}:null==e?{enabledLegacy:i?.legacyEnabled??!1,enabledOOP:i?.oopEnabled??!1}:(0,iH.hw)(e,!1,[EO.A,te.A,ET.A]),[e,i]),a=(0,m.bG)([iH.Ay,EO.A,te.A,ET.A],()=>null==e?null:(0,iH.xU)(e,iH.Ay,EO.A,te.A,ET.A),[e],iB()),[o,u]=g.useState(r),[d,A]=g.useState(s),[h,E]=g.useState(!1);g.useEffect(()=>{u(r),A(s)},[r,s]);let S=!(0,EL.supportsLegacy)(),x=!(0,EL.supportsOutOfProcess)(),{legacyEnabled:T,oopEnabled:p}=(0,m.cf)([E_.default],()=>E_.default.getGlobalEnabledStatus());function f(t,n){if(null==e)return;let i=!1,l=!1;switch(n){case Ef.OverlayToggledClientSettingType.LEGACY_GAME:A(t),EE.Ay.toggleOverlay(e,t,o),i=!t&&d;break;case Ef.OverlayToggledClientSettingType.OOP_GAME:u(t),EE.Ay.toggleOverlay(e,d,t),l=!t&&o;break;case Ef.OverlayToggledClientSettingType.LEGACY:ES.A.setEnabled(t,p),(0,Ef.Q3)(t,Ef.OverlayToggledClientSettingType.LEGACY,e.id??null);break;case Ef.OverlayToggledClientSettingType.OOP:ES.A.setEnabled(T,t),(0,Ef.Q3)(t,Ef.OverlayToggledClientSettingType.OOP,e.id??null)}(i||l)&&Ey(i?Ef.OverlayToggledClientSettingType.LEGACY_GAME:Ef.OverlayToggledClientSettingType.OOP_GAME,e.id??null)}let I=S&&x,_=!T&&!p,N=!o&&!T&&d&&!S,C=!d&&!p&&o&&!x,b=i?.overlayMethod===EI.Ue.Disabled,y=i?.state===EI.AR.OVERLAY_RENDERING&&!b,v=i?.state!=null&&ER.has(i.state)&&!b,O=i?.overlayMethod===EI.Ue.OutOfProcess,L=i?.overlayMethod===EI.Ue.OutOfProcessLimitedInteraction,D=i?.overlayMethod===EI.Ue.Hook,R=i?.state===EI.AR.OVERLAY_CRASHED||i?.state===EI.AR.OVERLAY_CRASHED_DISABLED,P=!o&&!d,[G,M]=function(){switch(!0){case y&&O:return[j.intl.format(j.t.hFVBIg,{overlayMethod:j.intl.string(j.t.a3eXSw),overlayMethodHook:function(e,t){return(0,c.jsx)(z.E,{tag:"span",variant:"text-sm/medium",color:"text-feedback-positive",children:e},t)}}),null];case y&&L:return[j.intl.format(j.t.hFVBIg,{overlayMethod:j.intl.string(j.t["506Aba"]),overlayMethodHook:function(e,t){return(0,c.jsx)(z.E,{tag:"span",variant:"text-sm/medium",color:"text-feedback-warning",children:e},t)}}),null];case y&&D:return[j.intl.format(j.t.hFVBIg,{overlayMethod:j.intl.string(j.t.bvlpDR),overlayMethodHook:function(e,t){return(0,c.jsx)(z.E,{tag:"span",variant:"text-sm/medium",color:"text-strong",children:e},t)}}),function(){switch(!0){case i?.fullscreenType!==Ex.aI.BORDERLESS_FULLSCREEN:return j.intl.string(j.t.mJmbeC);case x:return j.intl.string(j.t.C7bLTQ);case!i?.oopEnabled:return j.intl.string(j.t.WiY24u);case!p:return j.intl.string(j.t.cAFVsL);case!(l?.supportsOutOfProcessOverlay??!0):return j.intl.string(j.t.XcGEcs);default:return j.intl.string(j.t.bJXH2v)}}()];case R:return[j.intl.string(j.t.OFC2aw),null];case I:return[j.intl.string(j.t.m7X4az),null];case _:return[j.intl.string(j.t["9DUS5l"]),null];case P:return[j.intl.string(j.t.nQ9EdJ),null];case N:case C:return[j.intl.string(j.t.VWUn0a),null];case v:if(O)return[j.intl.string(j.t["s8+CFq"]),null];if(D)return[j.intl.string(j.t.JEEdqt),null];if(L)return[j.intl.string(j.t.pzBMwY),null];return[j.intl.string(j.t["2Xhy9k"]),null];case null==i:return[j.intl.string(j.t.vwHPRi),null];case b:{let e=i?.fullscreenType===Ex.aI.FULLSCREEN?j.intl.string(j.t.mJmbeC):null;return[j.intl.string(j.t.VPW4XY),e]}default:return[j.intl.string(j.t.ONovP5),null]}}();(0,eA.Ay)(()=>{EE.Ay.getDetectableGames()});let[U,V]=g.useMemo(()=>v?["text-muted",nK.A.colors.TEXT_MUTED.css]:y&&L?["text-feedback-warning",nK.A.colors.TEXT_FEEDBACK_WARNING.css]:y&&O?["text-feedback-positive",nK.A.colors.TEXT_FEEDBACK_POSITIVE.css]:y&&D?["text-strong",nK.A.colors.TEXT_STRONG.css]:["interactive-text-default",nK.A.colors.INTERACTIVE_TEXT_DEFAULT.css],[v,y,L,O,D]);return null==e?null:(0,c.jsxs)(EP,{onExpand:E,className:h?Ec.tx:void 0,title:(0,c.jsxs)(c.Fragment,{children:[t?.name??a?.name??e?.gameName??"",null!=a&&a.verified?(0,c.jsx)(i4.m,{text:j.intl.string(j.t["4PJP5p"]),children:(0,c.jsx)(h_.A,{size:16,color:nK.A.colors.BACKGROUND_BRAND.css,children:(0,c.jsx)(hu.U,{size:"custom",width:16,height:16,color:nK.A.colors.WHITE.css})})}):null]}),description:G,hint:null!=M?M:void 0,header:(0,c.jsxs)(c.Fragment,{children:[y||v?(0,c.jsx)(Eh.k,{size:"xxs",color:V}):(0,c.jsx)("div",{className:Ec.W4}),(0,c.jsx)(z.E,{variant:"text-xs/semibold",color:U,children:j.intl.string(j.t.CDOx3w)})]}),icon:(0,c.jsx)(iZ.A,{game:t,pid:e?.pid,size:iZ.M.MEDIUM}),"aria-label":j.intl.string(j.t["87O5GC"]),action:(0,c.jsx)(t8.D,{onClick:e=>Eg(e),children:(0,c.jsx)(tK.d,{checked:o&&p||d&&T,disabled:I,onChange:t=>{!function(t,n){if(null==e)return;let i=!1,l=!1;switch(n){case"game":EE.Ay.toggleOverlay(e,t,t),A(t),u(t),i=!t&&d,l=!t&&o;break;case"global":ES.A.setEnabled(t,t),i=!t&&T,l=!t&&p;break;case"both":ES.A.setEnabled(t,t),EE.Ay.toggleOverlay(e,t,t),A(t),u(t),i=!t&&T||!t&&d,l=!t&&p||!t&&o}let s=null;i?s="game"===n?Ef.OverlayToggledClientSettingType.LEGACY_GAME:Ef.OverlayToggledClientSettingType.LEGACY:l&&(s="game"===n?Ef.OverlayToggledClientSettingType.OOP_GAME:Ef.OverlayToggledClientSettingType.OOP),null!=s&&Ey(s,e.id??null)}(t,function(e,t){let n=!t&&e,i=!p&&o,l=!T&&d,s=!o&&p,r=!d&&T;switch(!0){case n&&(i||l)&&(s||r):return"both";case n&&(i||l):return"global";default:return"game"}}(t,o&&p||d&&T))}})}),warning:(0,c.jsx)(Ej,{className:Ec.Hh,game:e}),children:[(0,c.jsx)(Em,{title:j.intl.string(j.t["7BlVIs"]),description:j.intl.string(j.t.ndgADE),hint:p?void 0:j.intl.string(j.t.cAFVsL),"aria-label":j.intl.string(j.t["7BlVIs"]),action:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(tK.d,{checked:o&&p,disabled:x,onChange:e=>{e&&!p?f(e,Ef.OverlayToggledClientSettingType.OOP):f(e,Ef.OverlayToggledClientSettingType.OOP_GAME)}}),(0,c.jsx)("div",{className:Ec.Kz})]})}),(0,c.jsx)(Em,{title:j.intl.string(j.t.BfFpW1),description:j.intl.string(j.t.OzInYk),hint:T?void 0:j.intl.string(j.t["3sYHXm"]),"aria-label":j.intl.string(j.t.BfFpW1),action:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(tK.d,{checked:d&&T,disabled:S,onChange:e=>{e&&!T?f(e,Ef.OverlayToggledClientSettingType.LEGACY):f(e,Ef.OverlayToggledClientSettingType.LEGACY_GAME)}}),(0,c.jsx)("div",{className:Ec.Kz})]})})]})},usePredicate:()=>{let{runningGame:e}=iW();return null!=e},useSearchTerms:()=>[j.intl.string(j.t["9cb1Uz"])]});var EM=n(206885);function EU(e){let{game:t,gameApplication:n}=e,i=g.useMemo(()=>null==t?null:"pid"in t?t.pid:null,[t]),l=(0,m.bG)([iz.A],()=>null!=n?n:iz.A.getApplication(t?.id),[n,t]);return(0,c.jsx)(iZ.A,{game:l,pid:i,size:iZ.M.SMALL})}function EV(e){let{rawGame:t,gameApplication:n,supportDisabled:i,getEnabledFromStatus:l,onChange:s,clientSettingType:r,ariaLabel:a}=e;(0,Ep.I)(t?.id);let o=(0,m.cf)([iH.Ay,EO.A,te.A,ET.A],()=>(0,iH.xU)(t,iH.Ay,EO.A,te.A,ET.A)),u=(0,m.cf)([EO.A,te.A,ET.A],()=>(0,iH.hw)(t,!1,[EO.A,te.A,ET.A]),[t]),d=l(u),[A,h]=g.useState(d);return g.useEffect(()=>{h(d)},[d]),(0,c.jsx)(Em,{title:t.name,icon:(0,c.jsx)(EU,{game:o,gameApplication:n}),"aria-label":a,action:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(tK.d,{checked:A,disabled:i,onChange:e=>{let n;return n=!e&&A,void(h(e),s(e,o,u),n&&Ey(r,o.id??t?.id??null))}}),(0,c.jsx)("div",{className:Ec.Kz})]})})}let Ek=(0,a.E2)(o.X.OVERLAY_LEGACY_SETTING,{Component:function(){let[e,t]=g.useState(!1),{legacyEnabled:n,oopEnabled:i}=(0,m.cf)([E_.default],()=>E_.default.getGlobalEnabledStatus()),l=(0,m.yK)([iH.Ay],()=>iH.Ay.getGamesSeen(!0)).filter(e=>!(0,Ay.n1)(e)),s=(0,iX.A)(l.map(e=>e.id)),r=!(0,EL.supportsLegacy)();function a(e){ES.A.setEnabled(e,i);let t=iH.Ay.getCurrentGameForAnalytics()?.id??null;(0,Ef.Q3)(e,Ef.OverlayToggledClientSettingType.LEGACY,t),!e&&n&&Ey(Ef.OverlayToggledClientSettingType.LEGACY,t)}function o(e,t,n){let{enabledOOP:i}=n;EE.Ay.toggleOverlay(t,e,i)}let u=g.useMemo(()=>(0,EL.supportsLegacy)()?r?j.intl.string(j.t.r9jEVw):j.intl.string(j.t.OzInYk):j.intl.string(j.t["8Ox6/E"]),[r]);return 0===l.length?(0,c.jsx)(Em,{title:j.intl.string(j.t.BfFpW1),description:u,"aria-label":j.intl.string(j.t.BfFpW1),className:Ec.dA,action:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(tK.d,{checked:n,disabled:r,onChange:e=>a(e)}),EM.O&&(0,c.jsx)("div",{className:Ec.Kz})]})}):(0,c.jsxs)(EP,{onExpand:t,className:e?Ec.tx:void 0,title:j.intl.string(j.t.BfFpW1),description:u,"aria-label":j.intl.string(j.t.BfFpW1),action:(0,c.jsx)(t8.D,{onClick:e=>Eg(e),children:(0,c.jsx)(tK.d,{checked:n,disabled:r,onChange:e=>a(e)})}),children:[(0,c.jsx)("div",{className:Ec.SC,children:(0,c.jsx)(z.E,{variant:"text-xs/semibold",color:"text-muted",children:j.intl.string(j.t.FzoWRo)})}),(0,c.jsx)(S.Ip,{className:Ec.XG,children:l.map((e,t)=>(0,c.jsx)(EV,{rawGame:e,clientSettingType:Ef.OverlayToggledClientSettingType.LEGACY_GAME,supportDisabled:r,gameApplication:s[t],getEnabledFromStatus:e=>{let{enabledLegacy:t}=e;return t},onChange:o,ariaLabel:j.intl.format(j.t.hvPYsF,{gameName:e.name}).toString()},e.id))})]})},useSearchTerms:()=>[j.intl.string(j.t.BfFpW1)]}),Ew=(0,a.E2)(o.X.OVERLAY_OOP_SETTING,{Component:function(){let[e,t]=g.useState(!1),{oopEnabled:n,legacyEnabled:i}=(0,m.cf)([E_.default],()=>E_.default.getGlobalEnabledStatus()),l=!(0,EL.supportsOutOfProcess)(),s=(0,m.yK)([iH.Ay],()=>iH.Ay.getGamesSeen(!0)).filter(e=>!(0,Ay.n1)(e)),r=(0,iX.A)(s.map(e=>e.id));function a(e){let t=!e&&n;ES.A.setEnabled(i,e);let l=iH.Ay.getCurrentGameForAnalytics()?.id??null;(0,Ef.Q3)(e,Ef.OverlayToggledClientSettingType.OOP,l),t&&Ey(Ef.OverlayToggledClientSettingType.OOP,l)}function o(e,t,n){let{enabledLegacy:i}=n;EE.Ay.toggleOverlay(t,e,i)}let u=g.useMemo(()=>EM.O?l?j.intl.string(j.t.C7bLTQ):j.intl.string(j.t.ndgADE):j.intl.string(j.t.m7X4az),[l]);return 0===s.length?(0,c.jsx)(Em,{title:j.intl.string(j.t["7BlVIs"]),description:u,"aria-label":j.intl.string(j.t["7BlVIs"]),className:Ec.dA,action:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(tK.d,{checked:n,disabled:l,onChange:e=>a(e)}),EM.O&&(0,c.jsx)("div",{className:Ec.Kz})]})}):(0,c.jsxs)(EP,{onExpand:t,className:e?Ec.tx:void 0,title:j.intl.string(j.t["7BlVIs"]),description:u,"aria-label":j.intl.string(j.t["7BlVIs"]),action:(0,c.jsx)(t8.D,{onClick:e=>Eg(e),children:(0,c.jsx)(tK.d,{checked:n,disabled:l,onChange:e=>a(e)})}),children:[(0,c.jsx)("div",{className:Ec.SC,children:(0,c.jsx)(z.E,{variant:"text-xs/semibold",color:"text-muted",children:j.intl.string(j.t.FzoWRo)})}),(0,c.jsx)(S.Ip,{className:Ec.XG,children:s.map((e,t)=>(0,c.jsx)(EV,{rawGame:e,clientSettingType:Ef.OverlayToggledClientSettingType.OOP_GAME,gameApplication:r[t],supportDisabled:l,getEnabledFromStatus:e=>{let{enabledOOP:t}=e;return t},onChange:o,ariaLabel:j.intl.format(j.t.nByTd3,{gameName:e.name}).toString()},e.id))})]})},useSearchTerms:()=>[j.intl.string(j.t["7BlVIs"])]}),EF=(0,a.zZ)(o.X.OVERLAY_ENABLE_CATEGORY,{useSubnavLabel:()=>j.intl.string(j.t["/dp6yY"]),buildLayout:()=>[EG,Ew,Ek,EA]}),EB=(0,a.zD)(o.X.OVERLAY_CLICKABLE_REGIONS_SETTING,{useValue:()=>(0,m.bG)([Es.default],()=>!Es.default.disableClickableRegions),setValue:e=>{ES.A.setDisableClickableRegions(!e)},useTitle:()=>j.intl.string(j.t["+eFXxq"]),useSubtitle:()=>j.intl.string(j.t.kivMAp)}),Ez=(0,a.E2)(o.X.OVERLAY_KEYBIND_SETTING,{Component:function(){let e=(0,m.bG)([lL.Ay],()=>lL.Ay.getOverlayKeybind()),t=!(0,EL.supportsLegacy)(),n=!(0,EL.supportsOutOfProcess)(),[i,l]=(0,m.yK)([iH.Ay],()=>[iH.Ay.canShowAdminWarning,iH.Ay.getVisibleGame()],[]),s=(0,iQ.NP)(),r=null!=l&&l.elevated&&i&&!s,a=!(0,lL.DV)(e?.shortcut??[]);return(0,c.jsx)("div",{className:Ec.hc,children:(0,c.jsxs)("div",{className:Ec.eH,children:[(0,c.jsxs)("div",{className:Ec.Bu,children:[(0,c.jsx)(z.E,{variant:"text-md/medium",color:"text-strong",children:j.intl.string(j.t.VsAZcC)}),r&&(0,c.jsx)(z.E,{variant:"text-xs/normal",color:"text-feedback-warning",className:Ec.y7,children:j.intl.string(j.t.NsowVa)}),a&&(0,c.jsx)(z.E,{variant:"text-xs/normal",color:"text-feedback-warning",className:Ec.y7,children:j.intl.string(j.t["UNoTw/"])})]}),(0,c.jsx)("div",{className:Ec.IH,children:(0,c.jsx)(i9.A,{disabled:t&&n,defaultValue:null!=e?e.shortcut:[],onChange:function(t){tl()(null!=e,"Keybind should never be undefined"),ik.A.setKeybind({...e,shortcut:t})}})})]})})},useSearchTerms:()=>[j.intl.string(j.t.VsAZcC)]});var EX=n(515183),EY=n(682763);let EH=(0,a.zD)(o.X.OVERLAY_LIMITED_INTERACTION_OVERRIDE_SETTING,{usePredicate:()=>{let{runningGameApplication:e}=iW();return e?.id!=null},useDisabled:()=>{let{runningGame:e}=iW();return null!=e&&(0,EX.qJ)(e.pid)},useValue:()=>{let{runningGame:e,runningGameApplication:t}=iW(),n=t?.id,i=(0,m.bG)([Ei.A],()=>Ei.A.isLimitedInteractionOverrideEnabled(n)),l=null!=e&&(0,EX.qJ)(e.pid);return i||l},setValue:e=>{let t,n,i,l,{runningGameApplication:s}=(t=iY.A.getStreamerActiveStreamMetadata(),l=iK(t,i=null!=(n=iH.Ay.getVisibleGame())?iH.Ay.getGameOrTransformedSubgameForPID(n.pid):null),{runningGame:i??void 0,runningGameApplication:iz.A.getApplication(l)??void 0});null!=s&&(0,EY.x8)(s.id,e)},useTitle:()=>j.intl.string(j.t.wgVQND),useSubtitle:()=>j.intl.string(j.t["5SsyF5"])}),EK=(0,a.zZ)(o.X.OVERLAY_GENERAL_CATEGORY,{buildLayout:()=>[Ez,EH,EB]});var EW=n(93465);let EZ=[{title:j.t.eVE4LX,description:j.t["72WNqk"],disabledSetting:EW.M.TEXT_CHAT,key:o.X.OVERLAY_NOTIFICATIONS_TEXT_CHAT},{title:j.t.oifnSh,description:j.t.bgU5r0,disabledSetting:EW.M.WELCOME_GENERAL,key:o.X.OVERLAY_NOTIFICATIONS_WELCOME},{title:j.t.hqsZJW,description:j.t.kHjdqc,disabledSetting:EW.M.GO_LIVE_NUDGE,key:o.X.OVERLAY_NOTIFICATIONS_GO_LIVE},{title:j.t.sop3rn,description:j.t.pjgffc,disabledSetting:EW.M.GAME_ACTIVITY,key:o.X.OVERLAY_NOTIFICATIONS_GAME_ACTIVITY},{title:j.t["2QVhbb"],description:j.t.wQ4ilB,disabledSetting:EW.M.NOW_PLAYING,key:o.X.OVERLAY_NOTIFICATIONS_NOW_PLAYING},{title:j.t.giM9fA,description:j.t.EhAfWj,disabledSetting:EW.M.NOW_PLAYING_DIFFERENT_GAMES,key:o.X.OVERLAY_NOTIFICATIONS_NOW_PLAYING_DIFFERENT_GAMES,usePredicate:()=>{let{showNowPlayingForDifferentGames:e}=(0,ng.M8)("OverlayV3NowPlayingDifferentGamesNotificationSetting"),t=(0,m.bG)([Ei.A],()=>Ei.A.isNotificationDisabledBySetting(EW.M.NOW_PLAYING));return!!e&&!t}}];function Eq(e){return(0,a.zD)(e.key,{useTitle:()=>j.intl.string(e.title),useSubtitle:()=>j.intl.string(e.description),useValue:()=>!(0,m.bG)([Ei.A],()=>Ei.A.getDisabledNotifications().has(e.disabledSetting)),setValue:t=>{ES.A.setNotificationDisabledSetting(e.disabledSetting,!t)},usePredicate:e.usePredicate})}let EQ=(0,a.FW)(o.X.OVERLAY_NOTIFICATIONS_LIST,{variant:"compact",useTitle:()=>j.intl.string(j.t.gnKWdS),isTitleHiddenVisually:!0,buildLayout:()=>EZ.map(Eq)}),EJ=(0,a.zZ)(o.X.OVERLAY_NOTIFICATIONS_CATEGORY,{useTitle:()=>j.intl.string(j.t.xOE5bA),buildLayout:()=>[EQ]}),E$=(0,a.Hn)(o.X.OVERLAY_VOICE_WIDGET_AVATAR_SIZE,{useTitle:()=>j.intl.string(j.t.dnvZSg),useValue:()=>(0,m.bG)([Es.default],()=>Es.default.getAvatarSizeMode()),setValue:e=>{ES.A.setAvatarSizeMode(e)},useOptions:()=>[{id:"large",label:j.intl.string(j.t.YcOxtr),value:A.OSZ.LARGE},{id:"small",label:j.intl.string(j.t.BKIKqx),value:A.OSZ.SMALL}]}),E0=(0,a.Hn)(o.X.OVERLAY_VOICE_WIDGET_DISPLAY_NAMES,{useTitle:()=>j.intl.string(j.t.J0dpcB),useValue:()=>(0,m.bG)([Es.default],()=>Es.default.getDisplayNameMode()),setValue:e=>{ES.A.setDisplayNameMode(e)},useOptions:()=>[{id:"always",label:j.intl.string(j.t.nBmDrT),value:A.pwA.ALWAYS},{id:"speaking",label:j.intl.string(j.t["2OvIZY"]),value:A.pwA.ONLY_WHILE_SPEAKING},{id:"never",label:j.intl.string(j.t.ekjlPL),value:A.pwA.NEVER}]}),E1=(0,a.Hn)(o.X.OVERLAY_VOICE_WIDGET_DISPLAY_USERS,{useTitle:()=>j.intl.string(j.t.swsWWC),useValue:()=>(0,m.bG)([Es.default],()=>Es.default.getDisplayUserMode()),setValue:e=>{ES.A.setDisplayUserMode(e)},useOptions:()=>[{id:"always",label:j.intl.string(j.t.nBmDrT),value:A.f5z.ALWAYS},{id:"speaking",label:j.intl.string(j.t["2OvIZY"]),value:A.f5z.ONLY_WHILE_SPEAKING}]});var E2=n(391973),E3=n(489277),E5=n(897720),E6=n(38502);function E4(){let e=E3.A.getWidgetByType(A.uss.VOICE_V3);if(null==e)return null;let t=E6.A.getWidget(e.id);return null!=t&&(0,E5.ZO)(t)?t:null}n(392164);let E8=(0,a.sN)(o.X.OVERLAY_VOICE_WIDGET_MAX_USERS,{useTitle:()=>j.intl.string(j.t["X/Uyzc"]),minValue:0,maxValue:25,markers:[0,5,10,15,20,25],onMarkerRender:e=>e<1?j.intl.string(j.t.nrUzFL):e,getInitialValue:()=>{let e=E4();return e?.meta.voiceStatesMaxShown??8},onValueRender:function(e){return e<1?j.intl.string(j.t.nrUzFL):`${Math.floor(e)}`},setValue:e=>{let t=E4();null!=t&&(e<1?(0,E2.cC)(t.id,{voiceStatesMaxShown:-1}):(0,E2.cC)(t.id,{voiceStatesMaxShown:Math.floor(e)}))}});var E7=n(450740),E9=n(968898),Se=n(889227),St=n(288737);function Sn(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],l="456"+Math.floor(1e6*Math.random());return{voiceState:new St.A({channelId:"123",userId:l,sessionId:"789",mute:t,deaf:n,selfMute:!1,selfDeaf:!1,selfVideo:!1,selfStream:!1,discoverable:i}),user:new Se.A({id:l,username:e}),member:{nick:e,userId:l,guildId:"890",roles:[],hoistRoleId:null,premiumSince:null,joinedAt:new Date().toISOString(),colorString:"#000000",colorStrings:{primaryColor:"#000000",secondaryColor:null,tertiaryColor:null}},nick:e,comparator:e,_isPlaceholder:!0}}let Si=(0,a.E2)(o.X.OVERLAY_VOICE_WIDGET_PREVIEW,{Component:function(){let e,t=(0,m.bG)([l1.default],()=>l1.default.getCurrentUser()),{avatarSizeMode:n,displayNameMode:i,displayUserMode:l}=(0,m.cf)([Es.default],()=>({avatarSizeMode:Es.default.getAvatarSizeMode(),displayNameMode:Es.default.getDisplayNameMode(),displayUserMode:Es.default.getDisplayUserMode()})),[s]=g.useState(()=>[Sn(j.intl.string(j.t.C0ZDvo),!0,!1),Sn(j.intl.string(j.t.iOtj8E),!1,!1,!0),Sn(j.intl.string(j.t["0oqNgL"]),!1,!0)]),r=(0,m.bG)([E3.A,E6.A],()=>{let e=E3.A.getWidgetByType(A.uss.VOICE_V3);if(null==e)return null;let t=E6.A.getWidget(e.id);return null!=t&&(0,E5.ZO)(t)?t:null}),a=r?.meta?.voiceStatesMaxShown??8,o=[null!=t?((e=Sn(t.username)).user=t,e):null,...s].filter(n8.Vq),u=[new Map(o.map(e=>[e.user.id,e])),o.map(e=>e.user.id)],d=(0,c.jsx)(hC.N,{theme:A.NJ8.MIDNIGHT,children:e=>(0,c.jsxs)("div",{className:ie()(Ec.Y5,e),children:[(0,c.jsx)("div",{className:Ec.kJ,children:(0,c.jsx)(E7.DH,{id:"voice-widget",title:j.intl.string(j.t.KNJ6Vq),channel:(0,b.createChannelRecord)({id:"123",name:"Test Channel",type:A.rbe.GUILD_VOICE,guild_id:"456"}),overlayVoiceStates:u,displayNameMode:i,displayUserMode:l,avatarSizeMode:n,widget:A.uss.VOICE,anchorLeft:!0,application:null,stream:null,streamApplication:null,streamMetadata:null,locked:!1,pinned:!1,isSettingsPreview:!0,isPreviewingInGame:!1,maxDisplayedVoiceStates:a})}),(0,c.jsxs)("div",{className:Ec.R$,children:[(0,c.jsx)(E9.Pl,{children:j.intl.string(j.t.KNJ6Vq)}),(0,c.jsx)(E9.CS,{}),(0,c.jsx)(E9.O0,{id:r?.id??"voice-widget",pinned:r?.pinned??!1})]})]})});return(0,c.jsx)("div",{className:Ec.F9,children:d})},useSearchTerms:()=>[]}),Sl=(0,a.zZ)(o.X.OVERLAY_VOICE_WIDGET_CATEGORY,{useTitle:()=>j.intl.string(j.t.r1TZfh),buildLayout:()=>[Si,E$,E0,E1,E8]});var Ss=n(432816);function Sr(){let[e,t]=(0,ct.kn)([er.M.OVERLAY_OOP_SETTINGS_NUX],void 0,!0);return((0,w.Ay)(()=>()=>{t(cu.i.AUTO_DISMISS)}),e!==er.M.OVERLAY_OOP_SETTINGS_NUX)?null:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("div",{className:Ss.xC,children:[(0,c.jsx)("div",{children:(0,c.jsx)("img",{src:"https://cdn.discordapp.com/assets/content/10b8ab47f3371360233219f4b20fa86155553ddb810ceb8688654738bf7e15d0.png",alt:j.intl.string(j.t.mdXZh1),className:Ss.tl})}),(0,c.jsx)("div",{children:(0,c.jsxs)("div",{className:Ss.vJ,children:[(0,c.jsx)(E.D,{variant:"heading-xl/medium",color:"text-strong",children:j.intl.string(j.t.jzjJQg)}),(0,c.jsx)(z.E,{variant:"text-md/normal",color:"text-muted",children:j.intl.string(j.t["5dOfxb"])})]})}),(0,c.jsx)("div",{children:(0,c.jsx)("img",{src:"https://cdn.discordapp.com/assets/content/2aa57f16c71171fc8e0edb8cca60735f1192195344d17fa667de6d3ca8163ba0.png",alt:j.intl.string(j.t.mdXZh1),className:Ss.lh})}),(0,c.jsx)("div",{"data-button-hoisted-classname-wrapper":!0,className:Ss.VV,children:(0,c.jsx)(p.$,{variant:"primary",text:j.intl.string(j.t.Q26diF),onClick:()=>void t(cu.i.DISMISS)})})]}),(0,c.jsx)(i2.c,{className:Ss.yF})]})}function Sa(){let e=(0,m.bG)([e8.A],()=>e8.A.enabled),t=(0,ng.Mn)("OverlayStreamerModeNotice");return e&&t?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(iV.w,{type:"warning",children:j.intl.format(j.t.fuEX5B,{onClick:function(){return(0,t9.openUserSettings)(o.X.STREAMER_MODE_CATEGORY)}})}),(0,c.jsx)(i2.c,{className:Ss.yF})]}):null}let So=(0,a.t_)(o.X.OVERLAY_PANEL,{initialize:function(){return Eo(),lL.Ay.addChangeListener(Eo),Ei.A.addChangeListener(Eo),Es.default.addChangeListener(Eo),El.default.addChangeListener(Eo),eW.isPlatformEmbedded&&(0,Aj.a2)(),()=>{lL.Ay.removeChangeListener(Eo),Ei.A.removeChangeListener(Eo),Es.default.removeChangeListener(Eo),El.default.removeChangeListener(Eo),eW.isPlatformEmbedded&&(0,Aj.e0)()}},useTitle:()=>j.intl.string(j.t["9cb1Uz"]),decoration:{type:d.t9.STRONGLY_DISCOURAGED_CUSTOM,component:function(){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Sr,{}),(0,c.jsx)(Sa,{})]})}},buildLayout:()=>[EF,EK,Sl,EJ]}),Su=(0,a.i4)(o.X.OVERLAY_SIDEBAR_ITEM,{useTitle:()=>j.intl.string(j.t["9cb1Uz"]),icon:En.l,usePredicate:nA.b_,buildLayout:()=>[So]});var Sd=n(687966);let Sc=(0,a.AK)(o.X.REGISTERED_GAMES_TO_ACTIVITY_PRIVACY_NAVIGATOR,{useSubtitle:()=>j.intl.string(j.t.OYYY6q),destinationKey:o.X.ACTIVITY_PRIVACY_PANEL}),Sg=(0,a.gN)(o.X.REGISTERED_GAMES_RELATED_SETTINGS,{buildLayout:()=>[Sc]});var Sm=n(227309),SA=n(1215),Sh=n(39623),SE=n(952270),SS=n(138134),Sx=n(29160),ST=n(18293),Sp=n(582835);let Sf=(0,eW.isWindows)();function SI(e){let{rawGame:t,nowPlaying:i=!1,isOverride:l,subgames:s,isSubgame:r=!1,parentGame:a}=e;(0,Ep.I)(t.id);let o=(0,m.cf)([iH.Ay,EO.A,te.A,ET.A],()=>(0,iH.xU)(t,iH.Ay,EO.A,te.A,ET.A)),{canToggleDetection:u,isCurrentGameDetectionEnabled:d}=(0,m.cf)([iH.Ay],()=>({canToggleDetection:null==a||iH.Ay.isDetectionEnabled(a),isCurrentGameDetectionEnabled:iH.Ay.isDetectionEnabled(o)})),h=(0,m.bG)([iH.Ay],()=>iH.Ay.getVisibleGame()),[E,S]=g.useState(!1),x=g.useMemo(()=>(0,Ay.n1)(o)?r?o.gameName:j.intl.formatToPlainString(j.t.G6BGdx,{subgameName:o.gameName}):o.name,[o,r]),[T,p]=g.useState(x??"???"),f=ie()(Sp.tR,{[ST.LO]:!i,[ST.Rw]:i,[ST.FB]:null!=o&&i,[ST.xL]:r,[ST.fG]:null!=s&&s.length>0});function I(){null!=s&&s.length>0&&d?(0,ln.openModalLazy)(async()=>{let{Modal:e}=await n.e("4823").then(n.bind(n,158954));return t=>(0,c.jsx)(e,{...t,title:j.intl.formatToPlainString(j.t.PZ4fKc,{platform:x}),subtitle:j.intl.formatToPlainString(j.t.ZIQbfb,{platform:x}),actions:[{text:j.intl.string(j.t["ETE/oC"]),onClick:()=>t.onClose(),variant:"secondary"},{text:j.intl.string(j.t.Fmjztz),onClick:()=>{EE.Ay.toggleDetection(o),t.onClose()},variant:"primary"}]})}):EE.Ay.toggleDetection(o)}let _=null!=h&&(0,iH.Es)(o)===(0,iH.Es)(h),N=null!=a&&a.id===h?.id||_||null!=s&&s.some(e=>e.id===h?.id);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("div",{className:f,children:[(0,c.jsxs)("div",{className:ie()(ST.$K,Sp.Vd),children:[o.verified&&!l?(0,c.jsxs)("div",{className:ST.HS,children:[(0,c.jsx)("div",{className:ST.mO,children:x}),(0,c.jsx)(i4.m,{text:j.intl.string(j.t["4PJP5p"]),children:(0,c.jsx)(h_.A,{className:ST.qf,size:18,color:nK.A.unsafe_rawColors.BRAND_500.css,children:(0,c.jsx)(hu.U,{size:"custom",width:18,height:18,color:nK.A.unsafe_rawColors.WHITE.css})})})]}):(0,c.jsx)("input",{className:ie()(ST.mO,ST.sr),type:"text",maxLength:128,value:T,onBlur:function(){o.name!==T&&EE.Ay.editName(o,T)},onKeyDown:function(e){e.key===lI.dh.ENTER&&(e.currentTarget.blur(),e.preventDefault())},onChange:e=>p(e.target.value)}),function(){let e,t,{played:n,exePath:l}=o;return i||_?e=j.intl.string(j.t.VbV5dv):null!=n&&""!==n&&(e=j.intl.format(j.t["gGeOE+"],{when:n})),(0,c.jsx)("div",{className:ST.GN,children:(0,c.jsx)(Sx.A,{hoverText:null!=l&&""!==l?(t=l.replace(/^file:\/\//i,""),(0,eW.isWindows)()&&(t=t.toUpperCase()),t):"",children:e})})}()]}),l||E?null:(0,c.jsx)("div",{className:ie()(Sp.tR,Sp.oA,Sp.LT,ST.E3),children:(0,c.jsx)(i4.m,{text:j.intl.string(j.t["y0B+lo"]),children:(0,c.jsx)(t8.D,{"aria-label":j.intl.string(j.t["y0B+lo"]),className:ST.ym,onClick:function(){if(E)return;let e=null!=o.id?EO.A.getDetectableGame(o.id):null;e7.default.track(A.HAw.USER_SETTINGS_REPORT_INCORRECT_GAME_DETECTION,{application_id:e?.id,game_name:(0,Ay.n1)(o)?o.gameName:o.name}),S(!0),(0,ln.openModalLazy)(async()=>{let{default:t}=await Promise.all([n.e("21072"),n.e("27495")]).then(n.bind(n,651930));return n=>(0,c.jsx)(t,{...n,detected:{name:o.name??"",gameId:e?.id??o.id}})})},children:(0,c.jsx)(SS.i,{size:"md",color:"currentColor",className:ST.Lj,colorClass:ST.GS})})})}),function(){let{detectable:e}=o,t=e&&u?(0,c.jsx)(Sh.b,{size:"md",color:"currentColor",className:ST.Lj,colorClass:ST.GS}):(0,c.jsx)(SE.G,{size:"md",color:"currentColor",className:u?ST.$V:ST.zN,colorClass:ST.GS});return(0,c.jsx)("div",{className:ie()(Sp.tR,Sp.oA,Sp.LT,ST.E3),children:(0,c.jsx)(i4.m,{text:j.intl.string(j.t.QmitzM),children:u?(0,c.jsx)(t8.D,{"aria-label":j.intl.string(j.t.QmitzM),className:ST.ym,onClick:I,children:t}):t})})}(),function(){if(!Sf||null!=a)return null;let{overlay:e,overlayWarn:t}=o,n=e?(0,c.jsx)(Eh.k,{size:"md",color:"currentColor",className:ST.Lj,colorClass:ST.GS}):(0,c.jsx)(SA.n,{size:"md",color:"currentColor",className:ST.$V,colorClass:ST.GS}),i=t?(0,c.jsx)(i4.m,{text:j.intl.string(j.t.Vfw2L5),children:(0,c.jsx)("i",{className:ST.kb})}):null;return(0,c.jsxs)("div",{className:ie()(Sp.tR,Sp.oA,Sp.LT,ST.E3),children:[i,(0,c.jsx)(i4.m,{text:j.intl.string(j.t["1+O+Tu"]),children:(0,c.jsx)(t8.D,{"aria-label":j.intl.string(j.t["1+O+Tu"]),className:ST.ym,onClick:()=>{var t;return t=!e,void EE.Ay.toggleOverlay(o,t,t)},children:n})})]})}(),i&&!l||N?null:(0,c.jsx)(mf.A,{className:ST.LS,onClick:function(){EE.Ay.deleteEntry(o),s?.forEach(e=>{EE.Ay.deleteEntry(e)})}})]}),null!=s&&s.length>0&&!i&&(0,c.jsx)("div",{className:ST.AQ,children:s.map((e,t)=>(0,c.jsxs)(g.Fragment,{children:[(0,c.jsx)(SI,{rawGame:e,isOverride:!1,isSubgame:!0,parentGame:o}),t!==s.length-1&&(0,c.jsx)("div",{className:ST.PQ})]},(0,iH.Es)(e)))})]})}function S_(){let e=(0,m.bG)([nR.A],()=>nR.A.theme);return(0,c.jsxs)(mx.pp,{theme:e,className:my.eT,children:[(0,c.jsx)(mx.G8,{darkSrc:n(839628),lightSrc:n(446404),width:430,height:250}),(0,c.jsx)(mx.SG,{children:j.intl.string(j.t["1yiJwn"])})]})}function SN(){let{gameHistory:e,robloxSubgameHistory:t,overrideExePaths:n}=AL();return 0===e.length?(0,c.jsx)(S_,{}):(0,c.jsx)(nZ.n,{children:(0,c.jsx)("div",{children:e.map(e=>(0,c.jsx)(SI,{rawGame:e,isOverride:n.has(e.exePath),subgames:e.id===Sm.a7?t:void 0},(0,iH.Es)(e)))})})}let SC=(0,a.E2)(o.X.REGISTERED_GAMES_ADDED_GAMES_SETTING,{useSearchTerms:()=>[],Component:()=>(0,c.jsx)(SN,{})});var Sb=n(424994);let Sy=(0,a.zZ)(o.X.REGISTERED_GAMES_ADDED_GAMES_CATEGORY,{buildLayout:()=>[SC,Sg],useTitle:()=>j.intl.string(j.t.jCOdvx),useSubtitle:()=>j.intl.format(j.t.KPA3m9,{igdbLink:Sb.s8})});var Sv=n(783878),Sj=n(930863),SO=n(997213);function SL(e){let{onClose:t}=e,n=(0,m.bG)([iH.Ay],()=>iH.Ay.getCandidateGames()),[i,l]=g.useState(null),s=n.map(e=>({id:e.pid.toString(),value:e,label:null!=e.name?e.name:""}));return(0,c.jsxs)(rY.l,{className:ie()(Sj.H,SO.Y_),"aria-label":j.intl.string(j.t.GTCx0p),children:[(0,c.jsx)(Sv.Z,{selectionMode:"single",placeholder:j.intl.string(j.t.XqMe3N),value:i,options:s,onSelectionChange:function(e){l(e)}}),(0,c.jsx)(i2.c,{className:ie()(my.Ot,my.QB)}),(0,c.jsxs)("div",{className:ie()(Sj.o,Sp.xM),children:[(0,c.jsx)(Ai.Q,{variant:"secondary",text:j.intl.string(j.t["ETE/oC"]),onClick:t}),(0,c.jsx)(p.$,{variant:"primary",text:j.intl.string(j.t.GTCx0p),disabled:null==i,onClick:function(){null!=i&&(EE.Ay.addGame(i.pid,i.name),t())}})]})]})}var SD=n(347990);let SR=(0,a.E2)(o.X.REGISTERED_GAMES_ADD_GAME_SETTING,{useSearchTerms:()=>[j.intl.string(j.t.GTCx0p)],Component:function(){let e=g.useRef(null);return(0,c.jsxs)("div",{className:ie()(SD.a,my.Gf),children:[(0,c.jsx)("span",{children:j.intl.string(j.t.xwhoqM)}),(0,c.jsx)(rX.Y,{targetElementRef:e,renderPopout:e=>{let{closePopout:t}=e;return(0,c.jsx)(SL,{onClose:t})},align:"center",position:"bottom",children:t=>(0,c.jsx)(Ai.Q,{...t,buttonRef:e,variant:"primary",textVariant:"text-sm/medium",text:j.intl.string(j.t.GjgdXe)})})]})}});function SP(){return(0,c.jsx)("div",{className:ie()(Sp.tR,ST.eS,ST.Rw),children:(0,c.jsxs)("div",{className:ie()(ST.$K,Sp.Vd),children:[(0,c.jsx)("div",{className:ST.mO,children:j.intl.string(j.t.H68X9x)}),(0,c.jsx)("div",{className:ST.GN,children:j.intl.string(j.t.T5Ilmw)})]})})}let SG=(0,a.E2)(o.X.REGISTERED_GAMES_CURRENT_GAME_SETTING,{useSearchTerms:()=>[j.intl.string(j.t["MY9/Oe"])],Component:function(){let{robloxSubgameHistory:e,overrideExePaths:t}=AL(),n=(0,m.bG)([iH.Ay],()=>iH.Ay.getVisibleGame());return null!=n?(0,c.jsx)(SI,{rawGame:n,isOverride:t.has(n.exePath),nowPlaying:!0,subgames:n.id===Sm.a7?e:void 0},(0,iH.Es)(n)):(0,c.jsx)(SP,{})}}),SM=(0,a.zZ)(o.X.REGISTERED_GAMES_CURRENT_GAME_CATEGORY,{useTitle:()=>j.intl.string(j.t["MY9/Oe"]),buildLayout:()=>[SG,SR]}),SU=(0,a.t_)(o.X.REGISTERED_GAMES_PANEL,{useTitle:()=>j.intl.string(j.t.AVDyEj),buildLayout:()=>[SM,Sy]}),SV=(0,a.i4)(o.X.REGISTERED_GAMES_SIDEBAR_ITEM,{useTitle:()=>j.intl.string(j.t.AVDyEj),icon:Sd._,usePredicate:nA.Pi,buildLayout:()=>[SU]}),Sk=(0,a.WI)(o.X.GAMES_AND_APPS_SECTION,{useTitle:()=>j.intl.string(j.t.BA9200),buildLayout:()=>[SV,hl,Su,Et]});var Sw=n(631670),SF=n(619499),SB=n(836602),Sz=n(591179),SX=n(854627),SY=n(975732),SH=n(761508),SK=n(159001),SW=n(344346),SZ=n(919395),Sq=n(699217);function SQ(e){let{title:t,children:n}=e;return(0,c.jsxs)("div",{children:[(0,c.jsx)(E.D,{variant:"text-md/medium",className:Sq.Vf,children:t}),n]})}function SJ(e){let{children:t,className:n,layoutClassName:i,profilePreview:l,profilePreviewTitle:s,nameplatePreview:r,stickyPreview:a=!0}=e;return(0,c.jsx)("div",{className:ie()(Sq.UA,n),children:(0,c.jsxs)("div",{className:ie()(Sq.yt,i),children:[(0,c.jsx)("div",{className:ie()(Sq.Fp,a&&Sq.Oz),children:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(SQ,{title:s??j.intl.string(j.t.Zb06yP),children:l}),null!=r?(0,c.jsx)(SQ,{title:j.intl.string(j.t.x5CoXR),children:r}):null]})}),(0,c.jsx)("div",{className:Sq.oB,children:t})]})})}var S$=n(986687),S0=n(101058),S1=n(321191),S2=n(696451),S3=n(271078);function S5(){return(0,c.jsxs)("div",{className:S3.p$,children:[(0,c.jsx)("img",{src:"/assets/b3b15f93f9f43174.svg",alt:"",className:S3.Sl}),(0,c.jsx)(E.D,{className:S3.h8,variant:"heading-lg/extrabold",children:j.intl.string(j.t.Z1OZCV)}),(0,c.jsx)(z.E,{className:S3.h8,variant:"text-md/normal",children:j.intl.string(j.t.ZSt4Tt)}),(0,c.jsx)("div",{"data-button-hoisted-classname-wrapper":!0,className:S3.h8,children:(0,c.jsx)(p.$,{variant:"primary",text:j.intl.string(j.t.jQ3pqt),onClick:function(){(0,tW.pX)(A.BVt.GUILD_DISCOVERY),(0,tP.default)()}})})]})}var S6=n(81400),S4=n(252732),S8=n(355622),S7=n(408018),S9=n(138617),xe=n(290386),xt=n(594943);let xn=(0,tU.Ld)(),xi=(0,b.createChannelRecord)({id:"1",type:A.rbe.DM}),xl=(0,tU.Ld)();function xs(e){let{sectionTitle:t,errors:n,onBioChange:i,pendingBio:l,placeholder:s,currentBio:r,disabled:a=!1}=e,o=(0,xe.U)({location:"profile_customization_about_me"}),[u,d]=g.useState(l??r),[m,A]=g.useState((0,S7.x7)(u)),h=g.useRef(r),E=g.useRef(!1);return g.useEffect(()=>{if(h.current!==r){let e=(0,S7.x7)(r);d(r),A(e)}h.current=r},[r]),g.useEffect(()=>{void 0!==l||u===r||E.current||(d(r),A((0,S7.x7)(r)))},[l,r,u]),(0,c.jsxs)(rk.A,{title:t,titleId:xn,description:j.intl.string(j.t.Bbw6Ac),errors:n,disabled:a,children:[(0,c.jsx)(S9.Ay,{"aria-describedby":xl,"aria-labelledby":xn,className:xt.i,innerClassName:xt.Z,maxCharacterCount:o,onChange:function(e,t,n){t!==u&&(d(t),A(n),i(t))},placeholder:s,channel:xi,textValue:u,richValue:m,emojiPickerCloseOnModalOuterClick:!0,parentModalKey:t9.USER_SETTINGS_MODAL_KEY,type:S8.oU.PROFILE_BIO_INPUT,onBlur:()=>{E.current=!1},onFocus:()=>{E.current=!0},focused:E.current,onSubmit:function(){return new Promise(e=>{e({shouldClear:!1,shouldRefocus:!0})})}}),(0,c.jsx)(i8.A,{id:xl,children:j.intl.format(j.t["+DFxLc"],{maxLength:o})})]})}var xr=n(930861),xa=n(821956),xo=n(562819),xu=n(84540),xd=n(848575);function xc(e){let{user:t,guild:n,className:i,sectionTitle:l,forcedDivider:s=!1,withTutorial:r=!1}=e,{analyticsLocations:a}=(0,eL.Ay)(),o=(0,SZ.a4)({user:t,guildId:n?.id}),{pendingAvatarDecoration:u,errors:d}=(0,SZ.CP)(n?.id),g=r?xr.wL:s_.$n;return(0,c.jsx)(rk.A,{className:i,forcedDivider:s,hasBackground:!0,title:l,errors:d,children:(0,c.jsxs)("div",{className:xd.NC,children:[(0,c.jsx)(g,{size:s_.$n.Sizes.SMALL,onClick:function(){(0,xo.L)({analyticsLocations:a,guild:n})},className:ie()({[xd.yj]:r}),children:j.intl.string(j.t.BVcYCx)}),(void 0===u?null!=o:null!=u)&&(0,c.jsx)("div",{"data-button-hoisted-classname-wrapper":!0,className:xd.DT,children:(0,c.jsx)(p.$,{variant:"secondary",size:"sm",text:(0,xa.uZ)(t,n)?j.intl.string(j.t.CHf9iJ):j.intl.string(j.t.OrokWm),onClick:function(){(0,xu.p)({guildId:n?.id,avatarDecoration:null})}})})]})})}var xg=n(339984),xm=n(831653);let xA=[{name:"gif",extensions:["gif"]}];function xh(e){let{showRemoveAvatarButton:t,errors:n,onAvatarChange:i,sectionTitle:l,changeAvatarButtonText:s,guildId:r,className:a,disabled:o=!1,isTryItOut:u=!1,forcedDivider:d,withHighlight:m=!1}=e,{newestAnalyticsLocation:A}=(0,eL.Ay)(),h=m?xr.wL:s_.$n,E=g.useCallback(()=>{(0,S4.XD)({uploadType:xg.HL.AVATAR,analyticsSource:A,filters:u?xA:void 0,guildId:r,isTryItOut:u})},[r,A,u]);return(0,c.jsx)(rk.A,{className:a,title:l,errors:n,disabled:o,forcedDivider:d,children:(0,c.jsxs)("div",{className:xm.NC,children:[(0,c.jsx)(h,{className:ie()({[xm.yj]:m}),size:s_.$n.Sizes.SMALL,onClick:E,children:s??j.intl.string(j.t["4OynCD"])}),t&&(0,c.jsx)("div",{"data-button-hoisted-classname-wrapper":!0,className:xm.DT,children:(0,c.jsx)(p.$,{variant:"secondary",size:"sm",text:null!=r?j.intl.string(j.t.TDjKDm):j.intl.string(j.t.twB3fz),onClick:()=>i(null)})})]})})}var xE=n(248778),xS=n(479183);function xx(e){let{user:t,guildId:n,className:i}=e,l=rK.Ay.canUsePremiumProfileCustomization(t),{analyticsLocations:s}=(0,eL.Ay)(),{userDisplayNameStyles:r,guildDisplayNameStyles:a,pendingDisplayNameStyles:o,pendingErrors:u}=(0,SZ.B0)(t,n),d=(0,xE.ux)("DisplayNameStylesSection"),[m,h]=(0,ct.kn)(d?[er.M.DISPLAY_NAME_STYLES_FLYWHEEL_NEW_BADGE_PROFILE_PAGE]:[]),E=m===er.M.DISPLAY_NAME_STYLES_FLYWHEEL_NEW_BADGE_PROFILE_PAGE,S=(0,g.useCallback)(()=>{h(cu.i.TAKE_ACTION),e7.default.track(A.HAw.DISPLAY_NAME_STYLES_FROM_SETTINGS),(0,eD.L)({analyticsLocations:s,guildId:n})},[s,n,h]),x=(0,g.useCallback)(()=>{(0,xu.p)({displayNameStyles:null}),e7.default.track(A.HAw.DISPLAY_NAME_STYLES_REMOVED)},[]),T=(0,g.useCallback)(()=>{(0,xu.p)({guildId:n,displayNameStyles:null})},[n]),f=void 0!==o?o:null!=n?a:r;return(0,c.jsx)(rk.A,{title:j.intl.string(eR.default["86GtGH"]),titleBadge:E?(0,c.jsx)(e9.Lp,{text:j.intl.string(j.t.y2b7CA),className:xS.A}):void 0,className:i,showPremiumIcon:l,errors:u,children:(0,c.jsxs)("div",{className:xS.N,children:[(0,c.jsx)(p.$,{variant:"primary",size:"sm",text:j.intl.string(eR.default.vJqrIg),onClick:S}),null==n&&null!=f&&(0,c.jsx)(p.$,{variant:"secondary",size:"sm",text:j.intl.string(eR.default.ymq8WQ),onClick:x}),null!=n&&null!=f&&(0,c.jsx)(p.$,{variant:"secondary",size:"sm",text:j.intl.string(eR.default["j/KRxc"]),onClick:T})]})})}var xT=n(637193),xp=n(946801);function xf(e){let{user:t,guild:n,titleIcon:i}=e,{analyticsLocations:l}=(0,eL.Ay)(),s=null!=n,{userNameplate:r,guildNameplate:a,pendingNameplate:o,pendingErrors:u}=(0,SZ.rv)(t,n?.id),d=g.useCallback(()=>{(0,xT.p)({analyticsLocations:l,guildId:n?.id})},[l,n?.id]),m=g.useCallback(()=>{(0,xu.p)({guildId:n?.id,nameplate:null})},[n?.id]);return(0,c.jsx)(rk.A,{title:j.intl.string(j.t.x5CoXR),titleIcon:i,errors:u,children:(0,c.jsxs)("div",{className:xp.u,children:[(0,c.jsx)(p.$,{variant:"primary",size:"sm",text:j.intl.string(j.t.BwdeM1),onClick:d}),(void 0===o?(s?a:r)!=null:null!=o)&&(0,c.jsx)(p.$,{variant:"secondary",size:"sm",text:s?j.intl.string(j.t.CHf9iJ):j.intl.string(j.t["9zwziY"]),onClick:m})]})})}var xI=n(617255);function x_(e){let{showRemoveBannerButton:t,errors:n,onBannerChange:i,guildId:l,className:s,disabled:r=!1,showPremiumIcon:a=!0,isTryItOut:o=!1,forcedDivider:u,withHighlight:d=!1}=e,{newestAnalyticsLocation:g}=(0,eL.Ay)(),m=d?xr.wL:s_.$n;return(0,c.jsx)(rk.A,{className:s,title:j.intl.string(j.t.Vgdusv),showPremiumIcon:a,errors:n,disabled:r,forcedDivider:u,children:(0,c.jsxs)("div",{className:xI.NC,children:[(0,c.jsx)(m,{className:ie()({[xI.yj]:d}),size:s_.$n.Sizes.SMALL,onClick:()=>(0,S4.XD)({uploadType:xg.HL.BANNER,analyticsSource:g,guildId:l,isTryItOut:o}),children:j.intl.string(j.t.N0bC3P)}),t&&(0,c.jsx)("div",{"data-button-hoisted-classname-wrapper":!0,className:xI.DT,children:(0,c.jsx)(p.$,{variant:"secondary",size:"sm",text:null!=l?j.intl.string(j.t.jHlJNS):j.intl.string(j.t.tT9n7D),onClick:()=>i(null)})})]})})}var xN=n(617061),xC=n(869438);function xb(e){let{user:t,guild:n,initialSelectedEffect:i,className:l,sectionTitle:s,forcedDivider:r=!1,withTutorial:a=!1,showBorder:o=!1}=e,{analyticsLocations:u}=(0,eL.Ay)(),d=rK.Ay.canUsePremiumProfileCustomization(t),m=(0,SZ.N2)({user:t,guildId:n?.id}),{pendingProfileEffect:h,errors:E}=(0,SZ.nZ)(n?.id);g.useEffect(()=>{d&&e7.default.track(A.HAw.PREMIUM_UPSELL_VIEWED,{type:tk.e.PROFILE_EFFECTS_INLINE_SETTINGS,location_stack:u})},[d,u]);let S=a?xr.wL:s_.$n;return(0,c.jsx)(rk.A,{forcedDivider:r,borderType:o5.i.PREMIUM,hasBackground:!0,title:s,showBorder:o,errors:E,className:l,children:(0,c.jsxs)("div",{className:xC.NC,children:[(0,c.jsx)(S,{size:s_.$n.Sizes.SMALL,onClick:function(){(0,xN.W)({analyticsLocations:u,guild:n,initialSelectedEffect:i})},className:ie()({[xC.yj]:a}),children:j.intl.string(j.t["/dRfCf"])}),(void 0===h?null!=m:null!=h)&&(0,c.jsx)("div",{"data-button-hoisted-classname-wrapper":!0,className:xC.DT,children:(0,c.jsx)(p.$,{variant:"secondary",size:"sm",text:null!=n?j.intl.string(j.t.CHf9iJ):j.intl.string(j.t.uMuafO),onClick:function(){(0,xu.p)({guildId:n?.id,profileEffect:null})}})})]})})}var xy=n(13875),xv=n(515727),xj=n(566935);function xO(e){let{user:t,guild:n,sectionTitle:i}=e,{analyticsLocations:l}=(0,eL.Ay)(),s=(0,xy.sk)("ProfileFrameSection"),r=(0,SZ.Xf)({user:t,guildId:n?.id}),{pendingProfileFrame:a,errors:o}=(0,SZ.Tu)(n?.id),[u,d]=(0,ct.kn)([er.M.PROFILE_FRAME_USER_PROFILE_NEW_BADGE]),g=u===er.M.PROFILE_FRAME_USER_PROFILE_NEW_BADGE;return s?(0,c.jsx)(rk.A,{showBorder:g,borderType:g?o5.i.NEW_UPSELL:o5.i.PREMIUM,hasBackground:g,title:i,titleBadge:g?(0,c.jsx)(e9.Lp,{text:j.intl.string(j.t.y2b7CA),className:xj.Ad}):void 0,description:g?j.intl.string(j.t.yMoMAt):void 0,errors:o,children:(0,c.jsxs)("div",{className:xj.NC,children:[(0,c.jsx)(p.$,{variant:"primary",size:"sm",text:j.intl.string(j.t["9/hmle"]),onClick:function(){(0,xv.w)({analyticsLocations:l,guild:n}),d(cu.i.TAKE_ACTION)}}),(void 0===a?null!=r:null!=a)&&(0,c.jsx)("div",{"data-button-hoisted-classname-wrapper":!0,className:xj.DT,children:(0,c.jsx)(p.$,{variant:"secondary",size:"sm",text:null!=n?j.intl.string(j.t.CHf9iJ):j.intl.string(j.t.nQBruk),onClick:function(){(0,xu.p)({guildId:n?.id,profileFrame:null})}})})]})}):null}var xL=n(602853),xD=n(654107),xR=n(999291),xP=n(101928),xG=n(819169),xM=n(317097),xU=n(508274),xV=n(426399);function xk(e){let{onChange:t,onClose:n,color:i,suggestedColors:l,disabled:s,label:r,colorPickerMiddle:a,colorPickerFooter:o,showEyeDropper:u}=e,d=g.useRef(null),m=(0,xL.r)(nK.A.colors.BACKGROUND_BASE_LOW).hex(),h=nK.A.colors.BACKGROUND_MOD_MUTED.css,E=(0,S4.sN)(i),S=(0,xM.Hl)(i),x=S===m?h:S,T=E?nK.A.unsafe_rawColors.WHITE.css:nK.A.unsafe_rawColors.PRIMARY_530.css,p=(0,xG.A)(a),f=(0,xG.A)(o),[I,_]=g.useState((0,aH.A)());return g.useEffect(()=>{(p!==a||f!==o)&&_((0,aH.A)())},[o,a,f,p]),(0,c.jsx)(rX.Y,{targetElementRef:d,positionKey:I,renderPopout:e=>(0,c.jsx)(xU.VN,{...e,value:i,onChange:t,suggestedColors:l,middle:a,footer:o,showEyeDropper:u}),onRequestClose:n,children:e=>{let{onClick:t,...n}=e;return(0,c.jsxs)("div",{ref:d,className:ie()(xV.oP,{[xV.r9]:s}),children:[(0,c.jsx)(t8.D,{...n,tabIndex:s?-1:0,onClick:s?A.tEg:t,style:{backgroundColor:S,borderColor:x},className:xV.nf,"aria-label":j.intl.string(j.t.Qp04hK),focusProps:{ringTarget:d},children:(0,c.jsx)(rH.R,{size:"custom",className:xV.BW,width:14,height:14,color:T})}),r]})}})}var xw=n(811160);function xF(e){let{user:t,pendingAvatarSrc:n,pendingColors:i,onThemeColorsChange:l,preventDisabled:s,guildId:r,className:a,showPremiumIcon:o=!0,showResetThemeButton:u=!1,forcedDivider:d}=e,g=(0,xR.Ay)(t.id,r),{primaryColor:m,secondaryColor:A}=(0,xP.A)({user:t,displayProfile:g,pendingThemeColors:i,isPreview:!0}),h=rK.Ay.canUsePremiumProfileCustomization(t),E=null!=n?n:t.getAvatarURL(r,80),S=(0,xL.r)(nK.A.unsafe_rawColors.PRIMARY_530).hex(),x=(0,xD.rh)(E,S,!1);return null==m||null==A?null:(0,c.jsx)(rk.A,{title:j.intl.string(j.t.DMeO2X),disabled:!h&&!s,className:ie()(xw.__invalid_profileThemesSection,a),showPremiumIcon:o,forcedDivider:d,children:(0,c.jsxs)("div",{className:xw.hd,children:[(0,c.jsx)("div",{className:xw.YX,children:(0,c.jsx)(xk,{onChange:e=>l([e,A]),color:m,suggestedColors:x,showEyeDropper:!0,label:(0,c.jsx)(z.E,{className:xw.yz,color:"text-default",variant:"text-xs/normal","aria-hidden":!0,children:j.intl.string(j.t.C3KTQk)})})}),(0,c.jsx)("div",{className:xw.YX,children:(0,c.jsx)(xk,{onChange:e=>l([m,e]),color:A,suggestedColors:x,showEyeDropper:!0,label:(0,c.jsx)(z.E,{className:xw.yz,color:"text-default",variant:"text-xs/normal","aria-hidden":!0,children:j.intl.string(j.t["8elvy6"])})})}),u&&null!=r&&(0,c.jsx)("div",{"data-button-hoisted-classname-wrapper":!0,className:xw.WA,children:(0,c.jsx)(p.$,{variant:"secondary",size:"sm",text:j.intl.string(j.t["L+GmoR"]),onClick:()=>l([null,null])})})]})})}function xB(e){let{sectionTitle:t,errors:n,onPronounsChange:i,pendingPronouns:l,placeholder:s,currentPronouns:r,disabled:a=!1}=e,o=(0,tU.GV)();return(0,c.jsx)(rk.A,{title:t,titleId:o,errors:n,disabled:a,children:(0,c.jsx)(li.k,{"aria-labelledby":o,placeholder:s??j.intl.string(j.t.NPEUUu),maxLength:40,value:l??r,onChange:function(e){i(e===r?void 0:e)},disabled:a})})}var xz=n(427262),xX=n(684732),xY=n(576705),xH=n(522334);function xK(e){let{errors:t,pendingNick:n,currentNick:i,username:l,user:s,guild:r}=e,a=(0,m.bG)([xY.A],()=>xY.A.can(A.xBc.CHANGE_NICKNAME,r)||xY.A.can(A.xBc.MANAGE_NICKNAMES,r)),o=(0,hf.L)(tk.PremiumTypes.TIER_2);return(0,c.jsxs)(rk.A,{title:j.intl.string(j.t.me1lRk),errors:t,children:[(0,c.jsx)(li.k,{value:n??i??"",placeholder:l,maxLength:A.d0r,onChange:function(e){(0,xu.p)({guildId:r.id,nickname:e})},disabled:!a,helperText:a?void 0:j.intl.string(j.t.gzjxQi)}),o&&(0,c.jsx)(xx,{user:s,guildId:r.id,className:xH.F})]})}var xW=n(816453);let xZ="/assets/b25da78aa7949feb.png";function xq(e){let{user:t,showOverlay:n,children:i}=e,l=(0,ux.Ay)(),{analyticsLocations:s}=(0,eL.Ay)(tv.A.PREMIUM_UPSELL_OVERLAY);return(g.useEffect(()=>{n&&e7.default.track(A.HAw.PREMIUM_UPSELL_VIEWED,{location_stack:s,type:tk.e.PREMIUM_GUILD_MEMBER_PROFILE_UPSELL_INLINE})},[n,s]),n)?(0,c.jsxs)("div",{className:xW.ry,children:[(0,c.jsx)("div",{children:i}),(0,c.jsxs)("div",{className:xW.Wc,children:[(0,c.jsx)("img",{className:xW.Tn,alt:j.intl.string(j.t.LHFZQy),src:function(e){switch(e){case A.NJ8.DARK:case A.NJ8.DARKER:case A.NJ8.MIDNIGHT:return xZ;case A.NJ8.LIGHT:return"/assets/a98f1410707fafea.png";default:return xZ}}(l)}),(0,c.jsxs)("div",{className:xW._9,children:[(0,c.jsx)(z.E,{variant:"text-lg/semibold",color:"text-overlay-light",children:j.intl.string(j.t.dMaDFX)}),(0,c.jsx)(z.E,{variant:"text-sm/normal",color:"text-overlay-light",children:j.intl.string(j.t.F7sgFH)})]}),(0,c.jsx)(o3.A,{size:s_.$n.Sizes.LARGE,color:s_.$n.Colors.GREEN,textOptions:{textOverride:rK.Ay.isPremium(t)?j.intl.string(j.t.AfRWI8):j.intl.string(j.t.nkdUym)},subscriptionTier:tk.pe.TIER_2})]})]}):i}var xQ=n(784075);function xJ(){let e=(0,m.bG)([l1.default],()=>{let e=l1.default.getCurrentUser();return tl()(null!=e,"GuildIdentitySettingsPage: user cannot be undefined"),e}),t=(0,hf.L)(tk.PremiumTypes.TIER_2),n=(0,m.bG)([SB.A,lc.A],()=>lc.A.getGuild(SB.A.selectedGuildId));tl()(null!=n,"guild should not be null");let{pendingAvatar:i,pendingNickname:l,pendingBanner:s,pendingBio:r,pendingPronouns:a,pendingThemeColors:o,errors:u}=(0,m.cf)([SB.A],()=>({...SB.A.getPendingChanges(n.id),errors:SB.A.getErrors(n.id)})),d=(0,S0.V7)({userId:e.id,image:i}),g=(0,S6.EC)(n.id),A=(0,m.bG)([S2.Ay],()=>null==n.id?null:S2.Ay.getMember(n.id,e.id)),h=(0,m.bG)([S1.A],()=>S1.A.getGuildMemberProfile(e.id,n.id)),E=rK.Ay.canUsePremiumProfileCustomization(e),S=(0,SZ.z5)(i,A?.avatar),x=(0,SZ.Ac)(s,h?.banner),T=(0,xX.l)(o,h?.themeColors),p=h?.bio??"",f=h?.pronouns??"";return(0,c.jsxs)("div",{className:xQ.Q,children:[(0,c.jsx)(xK,{errors:u?.nick??g?.nick,username:xz.Ay.getName(e),pendingNick:l,currentNick:A?.nick,user:e,guild:n},"nick"),(0,c.jsx)(xB,{sectionTitle:j.intl.string(j.t["+T3RI/"]),errors:u?.pronouns,onPronounsChange:e=>(0,xu.p)({guildId:n.id,pronouns:e}),pendingPronouns:a,currentPronouns:f},"pronouns"),(0,c.jsxs)(xq,{user:e,showOverlay:!E,children:[(0,c.jsx)(xh,{sectionTitle:(0,c.jsxs)(c.Fragment,{children:[j.intl.string(j.t.lqaIxI),(0,c.jsx)(i4.m,{text:j.intl.string(j.t["5AFxuK"]),children:(0,c.jsx)(rG.t,{size:"md",color:"currentColor",className:xQ.a})})]}),showRemoveAvatarButton:S,onAvatarChange:function(e){if(null!=n)return(0,S4.rM)(e,A?.avatar,e=>(0,xu.p)({guildId:n.id,avatar:e}))},errors:u?.avatar,guildId:n.id,disabled:!E},"avatar"),(0,c.jsx)(xc,{sectionTitle:(0,c.jsxs)(c.Fragment,{children:[j.intl.string(j.t["7v0T9P"]),(0,c.jsx)(i4.m,{text:j.intl.string(j.t["5AFxuK"]),children:(0,c.jsx)(rG.t,{size:"md",color:"currentColor",className:xQ.a})})]}),user:e,guild:n},"decoration"),!t&&(0,c.jsx)(xx,{user:e,guildId:n.id}),(0,c.jsx)(xf,{user:e,guild:n,titleIcon:(0,c.jsx)(i4.m,{text:j.intl.string(j.t["5AFxuK"]),children:(0,c.jsx)(rG.t,{size:"md",color:"currentColor",className:xQ.a})})},"nameplate"),(0,c.jsx)(xb,{sectionTitle:(0,c.jsxs)(c.Fragment,{children:[j.intl.string(j.t.wR5wOo),(0,c.jsx)(i4.m,{text:j.intl.string(j.t["5AFxuK"]),children:(0,c.jsx)(rG.t,{size:"md",color:"currentColor",className:xQ.a})})]}),user:e,guild:n},"effect"),(0,c.jsx)(xO,{user:e,guild:n,sectionTitle:(0,c.jsxs)(c.Fragment,{children:[j.intl.string(j.t.GWrZOd),(0,c.jsx)(i4.m,{text:j.intl.string(j.t["5AFxuK"]),children:(0,c.jsx)(rG.t,{size:"md",color:"currentColor",className:xQ.a})})]})},"frame"),(0,c.jsx)(x_,{showRemoveBannerButton:x,errors:u?.banner,onBannerChange:function(e){if(null!=n)return(0,S4.rM)(e,h?.banner,e=>(0,xu.p)({guildId:n.id,banner:e}))},guildId:n.id,disabled:!E},"banner"),(0,c.jsx)(xF,{user:e,pendingAvatarSrc:d,pendingColors:o,onThemeColorsChange:e=>(0,xu.p)({guildId:n.id,themeColors:e}),guildId:n.id,showResetThemeButton:T}),(0,c.jsx)(xs,{placeholder:j.intl.string(j.t["/7NKgv"]),sectionTitle:(0,c.jsxs)(c.Fragment,{children:[j.intl.string(j.t.ZzAR2Y),(0,c.jsx)(i4.m,{text:j.intl.string(j.t["5AFxuK"]),children:(0,c.jsx)(rG.t,{size:"md",color:"currentColor",className:xQ.a})})]}),onBioChange:e=>(0,xu.p)({guildId:n.id,bio:e}),errors:u?.bio??g?.bio,pendingBio:r,currentBio:p,disabled:!E},"about")]})]})}var x$=n(379550);function x0(e){(0,ln.openModalLazy)(async()=>{let{default:t}=await Promise.all([n.e("41509"),n.e("66901"),n.e("61129")]).then(n.bind(n,475312));return n=>(0,c.jsx)(t,{source:{...e,page:A.liQ.GUILD_MEMBER_PROFILE_SETTINGS},...n})})}function x1(e){let{selectedGuild:t,onGuildChange:n}=e,{analyticsLocations:i}=(0,eL.Ay)(tv.A.USER_SETTINGS_GUILD_PROFILE),l=(0,m.bG)([l1.default],()=>{let e=l1.default.getCurrentUser();return tl()(null!=e,"GuildIdentitySettingsPage: user cannot be undefined"),e}),s=(0,m.bG)([S2.Ay],()=>null!=t?S2.Ay.getMember(t.id,l.id):null),r=(0,m.bG)([S1.A],()=>!S1.A.isFetchingProfile(l.id,t?.id)),a=(0,m.bG)([e8.A],()=>e8.A.hidePersonalInformation),{pendingAvatar:o,pendingNameplate:u,...d}=(0,m.cf)([SB.A],()=>SB.A.getPendingChanges(t?.id)),h=(0,S0.V7)({userId:l.id,image:o}),S=(0,SZ.lw)({pendingValue:u,userValue:l?.collectibles?.nameplate,guildValue:s?.collectibles?.nameplate,guildId:t?.id}),{pendingDisplayNameStyles:x}=(0,SZ.B0)(l,t?.id);return(g.useEffect(()=>()=>e2.h.wait(SK.IM),[]),a)?(0,c.jsx)(az.A,{}):r?(0,c.jsxs)(eL.f5,{value:i,children:[(0,c.jsx)(z.E,{variant:"text-sm/normal",children:j.intl.format(j.t["/PTB2E"],{helpCenterLink:eS.A.getArticleURL(A.MVz.GUILD_PROFILES)})}),null!=t?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(rV.A,{guildId:t.id,onChange:n}),(0,c.jsx)(SJ,{profilePreviewTitle:(0,c.jsx)(E.D,{variant:"heading-md/medium",className:x$.YV,children:j.intl.formatToPlainString(j.t.Tc0slG,{guildName:t?.name})}),profilePreview:(0,c.jsx)(S$.A,{...d,pendingAvatar:h,pendingDisplayNameStyles:x,user:l,guild:t,canUsePremiumCustomization:rK.Ay.canUsePremiumProfileCustomization(l),onUpsellClick:x0,containerClassName:x$.ti}),nameplatePreview:(0,c.jsx)(SW.A,{...d,pendingDisplayNameStyles:x,user:l,guildId:t?.id,nameplate:S,className:null==S?x$.tJ:void 0,isHighlighted:!0}),children:(0,c.jsx)(xJ,{})})]}):(0,c.jsx)(S5,{})]}):(0,c.jsx)(aY.y,{})}var x2=n(903209),x3=n(834297);function x5(e){let{children:t,notice:n}=e;return(0,c.jsxs)("div",{className:x3.r,children:[n,(0,c.jsx)("div",{children:t})]})}var x6=n(269115),x4=n(823092),x8=n(839534),x7=n(379197),x9=n(488430),Te=n(457421),Tt=n(940622),Tn=n(25176),Ti=n(341206);let Tl=function(){let e,t,n,i,{analyticsLocations:l}=(0,eL.Ay)(tv.A.COLLECTIBLES_PROFILE_SETTINGS_UPSELL),s=g.useRef(null),{asset:r,popoutAsset:a,title:o,body:u,version:d,revertTextColor:h}=(e=(0,Tt.mb)(Tn.RN.UPSELL_BANNER),t=(0,Tt.mb)(Tn.RN.UPSELL_BANNER_POPOUT),n=(0,m.bG)([Te.A],()=>Te.A.getMarketingBySurface(x7.R.EDIT_PROFILE_SETTINGS)),i=g.useMemo(()=>null!=n?n:{asset:"/assets/30e2c68819facd98.png",popoutAsset:"/assets/c6d55507d7473057.png",title:j.intl.string(j.t.QZVVBh),body:j.intl.string(j.t.sajmAq),version:0,revertTextColor:!1},[n]),g.useMemo(()=>({...i,type:x9.G.BANNER,asset:e??i.asset,popoutAsset:t??i.popoutAsset}),[e,t,i])),{navigateWithValidation:S}=(0,x4.L_)();return g.useEffect(()=>{e7.default.track(A.HAw.PREMIUM_UPSELL_VIEWED,{type:tk.e.COLLECTIBLES_PROFILE_SETTINGS_UPSELL,location_stack:l,version:d})},[l,d]),(0,c.jsxs)("div",{ref:s,className:Ti.kL,style:{backgroundImage:`url(${r})`},children:[(0,c.jsx)("div",{className:Ti.JS,"aria-hidden":!0,role:"presentation",children:(0,c.jsx)("img",{src:a,className:Ti.Qw,alt:""})}),(0,c.jsxs)("div",{className:Ti.Em,children:[(0,c.jsx)(E.D,{variant:"heading-lg/extrabold",color:h?"text-overlay-dark":"currentColor",className:Ti.DD,children:o}),(0,c.jsx)(z.E,{variant:"text-sm/normal",color:h?"text-overlay-dark":"currentColor",children:u})]}),(0,c.jsx)(p.$,{onClick:function(){S(()=>(0,x8.Cz)({analyticsLocations:l,analyticsSource:tv.A.COLLECTIBLES_PROFILE_SETTINGS_UPSELL}))},variant:"overlay-primary",text:j.intl.string(j.t.fYfGgK)})]})};var Ts=n(451909),Tr=n(202639),Ta=n(400669),To=n(835071),Tu=n(724651),Td=n(732280),Tc=n(590180),Tg=n(898461),Tm=n(469054),TA=n(601298),Th=n(207803),TE=n(461797);let TS=Object.keys(TE.jB);function Tx(e){let t=null==e?TS:TS.filter(t=>t!==e);return t[Math.floor(Math.random()*t.length)]}var TT=n(201805),Tp=n(461893);function Tf(e){let{preset:t,onShuffle:n}=e,i=(0,m.bG)([f.Ay],()=>f.Ay.useReducedMotion),l=(0,TT.Xf)({useReducedMotion:i}),{name:s,header:r}=g.useMemo(()=>{let e=(0,TE.Wt)(t);return{name:e.getName(),header:e.getHeaderSrc()}},[t]);return(0,c.jsxs)("div",{className:Tp.kL,children:[(0,c.jsx)(t8.D,{onClick:()=>{n(),l.startAnimation(!1)},className:Tp.x6,"aria-label":j.intl.string(j.t["44yJxh"]),children:l.render()}),(0,c.jsxs)(t8.D,{onClick:()=>{n(),l.startAnimation(!1)},"aria-label":`${s}: ${j.intl.string(j.t["44yJxh"])}`,className:Tp.Lt,children:[(0,c.jsx)("img",{alt:"","aria-hidden":!0,src:r,className:Tp.L_}),(0,c.jsx)(z.E,{className:Tp._e,variant:"text-sm/bold",color:"text-overlay-light",children:s})]})]})}var TI=n(511484),T_=n(811611),TN=n(206697),TC=n(507553);function Tb(e,t){let n=TC.A.useField("scrollPosition"),i=(0,m.bG)([f.Ay],()=>f.Ay.useReducedMotion);(0,g.useEffect)(()=>{let l=e.current;if(null==l||n!==t)return;let s=requestAnimationFrame(()=>{l.scrollIntoView({behavior:i?"auto":"smooth"}),TC.A.setState({scrollPosition:null})});return()=>cancelAnimationFrame(s)},[e,t,n,i])}var Ty=n(844222),Tv=n(4542);let Tj="/assets/d4955aabdcb5bdee.png",TO={assetOrigin:Tm.E.NEW_ASSET,imageUri:Tj,staticImageUri:Tj,description:"",originalAsset:void 0};function TL(e){let{user:t}=e,{reducedMotion:n}=g.useContext(Ty.C),{pendingAvatar:i,pendingBanner:l,pendingAvatarDecoration:s,pendingProfileEffect:r,pendingDisplayNameStyles:a,pendingThemeColors:o,pendingPronouns:u,pendingBio:d,tryItOutThemeColors:A,tryItOutAvatar:h,tryItOutBanner:E,tryItOutAvatarDecoration:S,tryItOutDisplayNameStyles:x}=(0,m.cf)([SB.A],()=>{let e=SB.A.getPendingChanges(),t=SB.A.getTryItOutChanges();return{...e,...t}}),T=(0,S0.V7)({userId:t.id,image:h??i});return(0,c.jsx)(S$.A,{user:t,pendingPronouns:u,pendingBio:d,pendingBanner:E??l??TO,pendingDisplayNameStyles:x??a,pendingAvatar:T,pendingThemeColors:A??o,pendingAvatarDecoration:void 0!==S?S:s,pendingProfileEffect:r,avatarClassName:null!=h||null!=i||n.enabled?void 0:Tv.WX,containerClassName:Tv.ti,canUsePremiumCustomization:!0,isTryItOut:!0,hideExampleButton:!0})}var TD=n(530702);function TR(e){let{user:t,isVisible:n,shouldShow:i}=e,l=rK.Ay.isPremium(t),s=rK.Ay.canUseAnimatedAvatar(t),{pendingAvatar:r,pendingThemeColors:a,tryItOutThemeColors:o,tryItOutAvatar:u,tryItOutBanner:d}=(0,m.cf)([SB.A],()=>{let e=SB.A.getPendingChanges(),t=SB.A.getErrors(),n=SB.A.getTryItOutChanges();return{...e,...n,errors:t}}),{preset:h,onShuffle:S}=function(){let[e,t]=(0,g.useState)(Tx()),{banner:n,themeColors:i,avatarDecorationSkuId:l,displayNameStyles:s}=(0,g.useMemo)(()=>{let t=(0,TE.Wt)(e);return{banner:(0,TA.X)({assetOrigin:Tm.E.NEW_ASSET,imageUri:t.getBannerSrc(!1),staticImageUri:t.getBannerSrc(!0),description:t.getBannerAltText(),originalAsset:void 0}),themeColors:t.themeColorsLegacy,avatarDecorationSkuId:t.avatarDecorationSkuId,displayNameStyles:t.displayNameStyles}},[e]),r=(0,m.bG)([Tc.A],()=>{let e=Tc.A.getProduct(l);return(0,Tg.T)(e?.items[0])?e.items[0]:null});(0,g.useEffect)(()=>{(0,Th.w5)({banner:n,themeColors:i,avatarDecoration:r,displayNameStyles:s})},[n,i,r,s]);let a=(0,g.useCallback)(()=>{let n=Tx(e);t(n),e7.default.track(A.HAw.TRY_IT_OUT_PRESET_SHUFFLED,{preset:n})},[e]);return{preset:e,onShuffle:a}}(),x=g.useRef(null);Tb(x,eI._F.TRY_IT_OUT);let{analyticsLocations:T,sourceAnalyticsLocations:p}=(0,eL.Ay)(tv.A.USER_SETTINGS_TRY_OUT_PREMIUM);function f(e){e&&((0,TN.T)(),e7.default.track(A.HAw.TRY_IT_OUT_PRESET_SELECTED,{preset:h}))}g.useEffect(()=>{n&&e7.default.track(A.HAw.PREMIUM_UPSELL_VIEWED,{type:tk.e.PREMIUM_PROFILE_TRY_IT_OUT,location:{page:A.liQ.USER_SETTINGS},location_stack:p})},[p,t,n]);let I=(0,Td.V)()?.subscription_trial?.sku_id===tk.pe.TIER_2,_=(0,Tu.O)(),N=(0,TI.U9)(_,tk.pe.TIER_2);return i?(0,c.jsx)(eL.f5,{value:T,children:(0,c.jsxs)(o5.A,{ref:x,className:TD.MT,type:o5.i.PREMIUM,isShown:!0,hasBackground:!0,children:[(0,c.jsx)(SJ,{stickyPreview:!1,layoutClassName:TD.th,profilePreviewTitle:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(rG.t,{size:"md",color:"currentColor",className:TD.PC}),j.intl.string(j.t.gMlDNd)]}),profilePreview:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Tf,{preset:h,onShuffle:S}),(0,c.jsx)(TL,{user:t})]}),children:(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(E.D,{variant:"heading-xl/extrabold",children:j.intl.string(j.t["2zGdAW"])}),(0,c.jsx)(z.E,{className:TD.h_,variant:"text-sm/normal",children:j.intl.string(j.t.xeEC20)})]}),(0,c.jsx)(xF,{className:TD.fz,user:t,pendingAvatarSrc:(0,S0.V7)({userId:t.id,image:u??r}),pendingColors:o??a,onThemeColorsChange:Th.a,showPremiumIcon:!1,preventDisabled:!0}),(0,c.jsx)(x_,{className:TD.fz,isTryItOut:!0,showRemoveBannerButton:null!=d,onBannerChange:Th.xe,showPremiumIcon:!1}),!s&&(0,c.jsx)(xh,{className:TD.fz,isTryItOut:!0,onAvatarChange:Th.e$,showRemoveAvatarButton:!1,changeAvatarButtonText:j.intl.string(j.t["7z0D1c"]),sectionTitle:j.intl.string(j.t.vtFfPX)}),(0,c.jsx)(xx,{user:t,className:TD.fz}),!I&&(0,c.jsx)(z.E,{variant:"text-sm/normal",children:j.intl.string(j.t["smo74/"])})]})}),!I&&(0,c.jsx)(Tr.d,{onSubscribeModalClose:f,className:TD.Kv,showUpsell:!0,text:j.intl.format(j.t.TmfgI2,{onClick:()=>{(0,To.K)({onSubscribeFinish:f})}}),button:l?j.intl.string(j.t.AfRWI8):N?j.intl.formatToPlainString(j.t.bkQ4bH,{percent:_?.discount.amount}):j.intl.string(j.t.pj0XBN),position:"inline"}),I&&(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:TD.BU}),(0,c.jsx)(T_.Ay,{type:tk.e.CUSTOM_PROFILE_TRY_OUT_UPSELL,subscriptionTier:tk.pe.TIER_2})]})]})}):null}var TP=n(814390),TG=n(909536),TM=n(843282),TU=n(145497),TV=n(685073),Tk=n(534400),Tw=n(581781),TF=n(743981),TB=n(217510);let Tz=(0,tU.Ld)(),TX=g.memo(function(e){let{availablePrimaryGuilds:t,pendingPrimaryGuildId:n,onChange:i}=e,l=g.useMemo(()=>new Map(t.map(e=>[e.id,e])),[t]),s=(0,m.bG)([l1.default],()=>(0,TV.Zo)(l1.default.getCurrentUser()?.primaryGuild).guildId),r=void 0!==n?n:s,a=g.useMemo(()=>t.reduce((e,t)=>(t.profile?.tag!=null&&e.push({label:t.name,value:t.id}),e),[]),[t]),o=g.useCallback(e=>{if(null==e)return null;let t=l.get(e.value);if(null==t)return null;let n=t.profile?.tag;return null==n?null:(0,c.jsx)(Tw.A,{guildTag:n,guildBadge:t.profile?.badge??void 0,guildId:t.id,guildName:e.label,guildIcon:t.icon,guildIconSize:32})},[l]),u=g.useCallback(e=>{if(null==e)return null;let t=l.get(e.value);return null==t||null==t.profile?.tag?null:(0,c.jsx)(TU.j,{guildId:t.id,guildName:t.name,guildIcon:t.icon,iconSize:32,animate:!1})},[l]),d=g.useCallback(e=>{if(null==e)return null;let t=l.get(e.value);if(null==t)return null;let n=t.profile?.tag;return null==n?null:(0,c.jsx)(Tk.o9,{guildId:t.id,guildTag:n,guildBadge:t.profile?.badge??void 0,badgeSize:TF.Sl.SIZE_16,textColor:"interactive-text-default",textVariant:"text-sm/semibold"})},[l]),A=g.useCallback(e=>{let t=e[0];return null==t?null:(0,c.jsx)(c.Fragment,{children:o(t)})},[o]),h=g.useCallback(e=>{i?.(e)},[i]),E=g.useCallback(e=>e===r,[r]),S=g.useCallback(e=>e,[]),x=g.useCallback(()=>{i?.(null)},[i]),T=g.useRef(null);return Tb(T,eI._F.GUILD_TAG),(0,c.jsxs)(rk.A,{title:j.intl.string(j.t.Pdd1nd),titleId:Tz,ref:T,children:[(0,c.jsx)(z.E,{className:TB.VA,variant:"text-sm/normal",children:j.intl.string(j.t.mlZ6Jx)}),(0,c.jsx)(TM.Pw,{className:TB.Lt,optionClassName:TB.S0,isSelected:E,options:a,select:h,renderLeading:u,renderTrailing:d,renderOptionValue:A,serialize:S,clear:x,clearable:null!=r,maxVisibleItems:8,"data-migration-pending":!0})]})});var TY=n(318785),TH=n(992526),TK=n(470739);let TW=function(){return(0,TH.J9)({location:"UserSettingsProfileCustomization"})?(0,c.jsx)(rk.A,{title:j.intl.string(j.t.l6w3Vj),description:j.intl.string(j.t.joHqdj),children:(0,c.jsx)(p.$,{text:j.intl.string(j.t.wRraFx),onClick:()=>{(0,TK._)()},size:"sm"})}):null};var TZ=n(182817);let Tq=(0,tU.Ld)();function TQ(e){let t=(0,hf.L)(tk.PremiumTypes.TIER_2);return(0,c.jsxs)(rk.A,{errors:e.errors,disabled:e.disabled,title:j.intl.string(j.t["9AjdkD"]),titleId:Tq,children:[(0,c.jsx)("div",{children:(0,c.jsx)(li.k,{"aria-labelledby":Tq,placeholder:e.placeholder,maxLength:A.zzC,onChange:e.onGlobalNameChange,value:e.pendingGlobalName??e.currentGlobalName??""})}),t&&(0,c.jsx)(xx,{user:e.user,className:TZ.F})]})}var TJ=n(273151);function T$(e){let{legacyUsername:t,pendingLegacyUsernameDisabled:n}=e,i=v.m$.useSetting(),l=void 0!==n?n:i;return(0,c.jsx)("div",{className:TJ.u,children:(0,c.jsx)(tK.d,{label:j.intl.string(j.t["3cWDuO"]),description:l?null:j.intl.formatToPlainString(j.t.aYhclf,{username:t}),checked:!l,onChange:e=>{!e===i?(0,Sw._e)():(0,xu.p)({legacyUsernameDisabled:!e})}})})}function T0(e){let{user:t,savedUserColor:n,pendingColor:i,setPendingAccentColor:l}=e,s=t.getAvatarURL(null,80),r=(0,xL.r)(nK.A.unsafe_rawColors.PRIMARY_530).hex(),a=(0,xD.rh)(s,r,!1),o=(0,xM.LX)(a[0]);return(0,c.jsx)(rk.A,{title:j.intl.string(j.t["/X3fkf"]),children:(0,c.jsx)(xk,{onChange:e=>l(e),color:i??n??o,suggestedColors:a,showEyeDropper:!0})})}var T1=n(518477);let T2=function(){let e=(0,m.bG)([ur.default],()=>ur.default.getId());return(0,c.jsx)(rk.A,{title:j.intl.string(j.t.Jzj9q4),children:(0,c.jsx)(p.$,{text:j.intl.string(j.t.Geikwq),onClick:()=>{(0,SY.openUserProfileModal)({userId:e,sourceAnalyticsLocations:[tv.A.USER_SETTINGS_USER_PROFILE],hideRestrictedProfile:!0,tabSection:T1.RP.WIDGETS})},size:"sm"})})};var T3=n(577997);function T5(){let e=(0,m.bG)([l1.default],()=>{let e=l1.default.getCurrentUser();return tl()(null!=e,"DefaultCustomizationSections: user cannot be undefined"),e}),t=(0,m.bG)([S1.A],()=>S1.A.getUserProfile(e.id)),{pendingAvatar:n,pendingGlobalName:i,pendingBanner:l,pendingBio:s,pendingPronouns:r,pendingAccentColor:a,pendingThemeColors:o,pendingLegacyUsernameDisabled:u,pendingPrimaryGuildId:d,errors:g}=(0,m.cf)([SB.A],()=>{let e=SB.A.getPendingChanges(),t=SB.A.getErrors();return{...e,errors:t}}),A=(0,S0.V7)({userId:e.id,image:n}),h=(0,S6.EC)(),E=rK.Ay.canUsePremiumProfileCustomization(e),S=(0,SZ.z5)(n,e.avatar),x=(0,SZ.Ac)(l,t?.banner),T=(0,xR.Ay)(e.id),p=T?.getLegacyUsername(),f=(g.global_name?.length??0)>0?g.global_name:h?.nick??[],I=(g.bio?.length??0)>0?g.bio:h?.bio??[],_=(0,TY.b)();return(0,c.jsxs)("div",{className:T3.Q,children:[(0,c.jsx)(TQ,{placeholder:e.username,errors:f,currentGlobalName:e.globalName,pendingGlobalName:i,onGlobalNameChange:e=>(0,xu.p)({globalName:e}),user:e}),(0,c.jsx)(xB,{sectionTitle:j.intl.string(j.t["+T3RI/"]),errors:g.pronouns,onPronounsChange:e=>(0,xu.p)({pronouns:e}),pendingPronouns:r,currentPronouns:t?.pronouns??""},"pronouns"),(0,c.jsx)(T2,{}),(0,c.jsx)(xh,{onAvatarChange:e=>{(0,xu.p)({avatar:e}),(0,SZ.WU)(null==e?"remove":"set")},showRemoveAvatarButton:S,errors:g.avatar,sectionTitle:j.intl.string(j.t.lqaIxI),forcedDivider:!0},"avatar"),(0,c.jsx)(xc,{user:e,sectionTitle:j.intl.string(j.t["7v0T9P"])},"decoration"),(0,c.jsx)(xf,{user:e}),(0,c.jsx)(xb,{user:e,sectionTitle:j.intl.string(j.t.wR5wOo)},"effect"),(0,c.jsx)(xO,{user:e,sectionTitle:j.intl.string(j.t.GWrZOd)},"frame"),E?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(x_,{showRemoveBannerButton:x,errors:g.banner,onBannerChange:e=>(0,xu.p)({banner:e}),forcedDivider:!0},"banner"),(0,c.jsx)(xF,{user:e,pendingAvatarSrc:A,pendingColors:o,onThemeColorsChange:e=>(0,xu.p)({themeColors:e}),forcedDivider:!0})]}):(0,c.jsx)(T0,{user:e,savedUserColor:t?.accentColor,pendingColor:a,setPendingAccentColor:e=>(0,xu.p)({accentColor:e})},"color"),(0,c.jsx)(xs,{sectionTitle:j.intl.string(j.t.ZzAR2Y),errors:I,onBioChange:e=>(0,xu.p)({bio:e}),pendingBio:s,currentBio:t?.bio??""},"bio"),_.length>0&&(0,c.jsx)(TX,{availablePrimaryGuilds:_,pendingPrimaryGuildId:d,onChange:e=>(0,xu.p)({primaryGuildId:e})}),null!=p&&(0,c.jsx)(T$,{legacyUsername:p,pendingLegacyUsernameDisabled:u},"legacy_username"),(0,c.jsx)(TW,{},"badges")]})}function T6(){(0,ln.openModalLazy)(async()=>{let{default:e}=await Promise.all([n.e("41509"),n.e("66901"),n.e("41704")]).then(n.bind(n,562011));return t=>(0,c.jsx)(e,{...t,source:{page:A.liQ.USER_SETTINGS,section:A.JJy.SETTINGS_CUSTOMIZE_PROFILE,object:A.ZSU.BUTTON_CTA,type:A.AnalyticsObjectTypes.BUY}})})}var T4=n(157723);function T8(){let e=(0,m.bG)([l1.default],()=>{let e=l1.default.getCurrentUser();return tl()(null!=e,"UserSettingsProfileCustomization: user cannot be undefined"),e}),t=(0,m.bG)([e8.A],()=>e8.A.hidePersonalInformation),{pendingBio:n,pendingAvatar:i,pendingNameplate:l,showNotice:s,...r}=(0,m.cf)([SB.A],()=>({...SB.A.getPendingChanges(),showNotice:SB.A.showNotice()})),a=(0,S0.V7)({userId:e.id,image:i}),o=(0,SZ.lw)({pendingValue:l,userValue:e?.collectibles?.nameplate}),u=(0,TP.A)()&&null!=n?Ts.Ay.parse(void 0,n).content:n,d=rK.Ay.canUsePremiumProfileCustomization(e),h=(0,TG.St)("edit-profile-upsell"),{analyticsLocations:E}=(0,eL.Ay)(tv.A.USER_SETTINGS_USER_PROFILE);g.useEffect(()=>()=>e2.h.wait(Sw.IM),[]);let[S,x]=g.useState(!1),T=!d,f=g.useRef(null);return t?(0,c.jsx)(az.A,{}):(0,c.jsxs)(eL.f5,{value:E,children:[(0,c.jsx)(Tl,{}),(0,c.jsx)(SJ,{profilePreview:(0,c.jsx)(S$.A,{user:e,canUsePremiumCustomization:d,onUpsellClick:T6,pendingBio:u,...r,pendingAvatar:a,containerClassName:T4.ti}),nameplatePreview:(0,c.jsx)(SW.A,{user:e,nameplate:o,...r,className:null==o?T4.tJ:void 0,isHighlighted:!0}),children:(0,c.jsx)(T5,{})}),(0,c.jsx)(x6.L,{innerRef:f,onChange:e=>x(e),threshold:.25,active:T,children:(0,c.jsx)("div",{ref:f,children:(0,c.jsx)(TR,{user:e,shouldShow:T,isVisible:S})})}),T&&!s&&(0,c.jsx)(Tr.d,{className:T4.EL,showUpsell:!S,text:j.intl.format(j.t.TmfgI2,{onClick:()=>(0,To.K)({})}),textVariant:"heading-md/medium",useUpdatedStyling:!0,leadingAction:h?(0,c.jsx)(Ta.l,{size:"md",location:tv.A.PREMIUM_WISHLIST_EDIT_PROFILE_UPSELL}):void 0,button:(0,c.jsx)("div",{className:T4.Xl,children:(0,c.jsx)(p.$,{variant:"overlay-primary",onClick:()=>{e7.default.track(A.HAw.TRY_IT_OUT_PRESET_CLICKED,{cta_variant:"floating_action_button"}),f?.current?.scrollIntoView({behavior:"smooth"})},text:j.intl.string(j.t.uw9zI7),icon:rG.t})})})]})}var T7=n(625494);n(46121);var T9=n(521078);let pe={[eI.Eq.USER_PROFILE]:"main_profile_tab",[eI.Eq.GUILD]:"guild_profile_tab"},pt=(0,a.E2)(o.X.PROFILE_SETTING,{Component:function(){let e=(0,m.bG)([lg.A,u8.Ay,SB.A],()=>{let e=SB.A.selectedGuildId??lg.A.getGuildId();return null==e||SB._.has(e)?u8.Ay.getFlattenedGuildIds().find(e=>!SB._.has(e)):e}),t=(0,m.bG)([lc.A],()=>lc.A.getGuild(e)),n=(0,m.bG)([SB.A],()=>SB.A.showNotice()),i=(0,m.bG)([l1.default],()=>l1.default.getCurrentUser()),l=TC.A.useField("subsection");return g.useEffect(()=>{(0,n1._)(pe[l])},[l]),g.useEffect(()=>{null!=i&&t?.id!=null&&(0,x2.A)(i.id,i.getAvatarURL(t?.id,80),{guildId:t?.id})},[t?.id,i]),(0,c.jsx)(x5,{children:(0,c.jsxs)(uC.F,{component:(0,c.jsx)(i8.A,{children:(0,c.jsx)(E.D,{variant:"heading-xl/normal",children:j.intl.string(j.t["vi7f+q"])})}),children:[(0,c.jsxs)(SH.V,{className:T9.$H,type:"top",look:"brand",selectedItem:l,onItemSelect:function(e){if(l!==e){if(n){(0,n2.fO)({duration:300,intensity:1.4}),T7._.dispatch(A.jej.EMPHASIZE_NOTICE);return}e===eI.Eq.GUILD&&null!=t&&(0,SK.V2)(t.id),TC.A.setState({subsection:e})}},children:[(0,c.jsx)(SH.V.Item,{className:T9.YU,id:eI.Eq.USER_PROFILE,children:j.intl.string(j.t["2p07FR"])},eI.Eq.USER_PROFILE),(0,c.jsx)(SH.V.Item,{className:ie()(T9.YU,T9.HY),"aria-label":j.intl.string(j.t.kPHroX),id:eI.Eq.GUILD,children:j.intl.string(j.t.kPHroX)},eI.Eq.GUILD)]}),l===eI.Eq.GUILD?(0,c.jsx)(x1,{selectedGuild:t,onGuildChange:function(e){if(n){(0,n2.fO)({duration:300,intensity:1.4}),T7._.dispatch(A.jej.EMPHASIZE_NOTICE);return}null!=e&&(0,SK.JJ)(e.id)}}):(0,c.jsx)(T8,{})]})})},useSearchTerms:()=>[j.intl.string(j.t["vi7f+q"]),j.intl.string(j.t.Ip9nBS),j.intl.string(j.t["2p07FR"]),j.intl.string(j.t["7vhiqk"]),j.intl.string(j.t.kPHroX),j.intl.string(j.t.lqaIxI),j.intl.string(j.t.Vgdusv),j.intl.string(j.t.DMeO2X)]}),pn=(0,a.zZ)(o.X.PROFILE_CATEGORY,{buildLayout:()=>[pt]});var pi=n(938706);function pl(){let e=(0,m.bG)([l1.default],()=>l1.default.getCurrentUser()),{avatarSrc:t,avatarDecorationSrc:n}=(0,SX.A)({userId:e?.id,size:T._3.SIZE_48});return null==e?null:(0,c.jsxs)("div",{className:pi.a5,children:[(0,c.jsx)(x.eu,{src:t,avatarDecoration:n,size:T._3.SIZE_48,"aria-label":j.intl.string(j.t.lqaIxI)}),(0,c.jsxs)("div",{className:pi.FS,children:[(0,c.jsx)(z.E,{color:"text-strong",variant:"text-md/medium",lineClamp:1,children:e.globalName??e.username}),(0,c.jsxs)("div",{className:pi.Fk,children:[(0,c.jsx)(z.E,{variant:"text-sm/normal",color:"currentColor",lineClamp:1,children:j.intl.string(j.t.Ip9nBS)}),(0,c.jsx)(rH.R,{size:"xxs",color:"currentColor"})]})]})]})}let ps=(0,a.t_)(o.X.PROFILE_PANEL,{useTitle:()=>j.intl.string(j.t["vi7f+q"]),notice:{stores:[SB.A],element:SF.A},initialize:()=>()=>e2.h.wait(()=>{(0,Sw.F7)()}),buildLayout:()=>[pn]}),pr=(0,a.i4)(o.X.PROFILE_SIDEBAR_ITEM,{useTitle:()=>j.intl.string(j.t["vi7f+q"]),icon:po,StronglyDiscouragedCustomComponent:pl,usePredicate:()=>!(0,Sz.X)("user_settings_sidebar"),buildLayout:()=>[ps]}),pa=(0,a.i4)(o.X.PROFILE_SIDEBAR_ITEM_WYSIWYG,{useTitle:()=>j.intl.string(j.t["vi7f+q"]),icon:po,StronglyDiscouragedCustomComponent:pl,usePredicate:()=>(0,Sz.X)("user_settings_sidebar"),onClick:()=>{let e=ur.default.getId();(0,SY.openUserProfileModal)({userId:e})},buildLayout:()=>[]});function po(){let e=(0,m.bG)([l1.default],()=>l1.default.getCurrentUser()),{avatarSrc:t,avatarDecorationSrc:n}=(0,SX.A)({userId:e?.id,size:T._3.SIZE_48});return(0,c.jsx)(x.eu,{src:t,avatarDecoration:n,size:T._3.SIZE_20,"aria-hidden":!0})}let pu=(0,a.WI)(o.X.PROFILE_SECTION,{hoisted:!0,buildLayout:()=>[pr,pa]});var pd=n(98207),pc=(n(204925),n(818348));let pg=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;(0,ln.openModalLazy)(async()=>{let{default:t}=await Promise.all([n.e("69757"),n.e("19623"),n.e("21007")]).then(n.bind(n,888363));return n=>(0,c.jsx)(t,{claimRequired:e,...n})},{onCloseRequest:e?pc.tE:null,onCloseCallback:t})};var pm=n(940856),pA=n(36149),ph=n(207560);function pE(e){let t=(0,ph.fk)(),n=(0,pA.b8)(),i=(0,pA.yM)(),l=(0,pA.Y2)();if(!t)return!1;let s=!n||i;switch(e){case"verify":return s;case"edit":return!s&&l;case"info":return!s&&!l;default:return!1}}var pS=n(516761);function px(){let e=j.intl.string(j.t.XxRj7f);return(0,c.jsxs)(z.E,{variant:"text-md/medium",children:[`${e} \u{2022} `,j.intl.format(pS.default.WM5adV,{handleOnHelpUrlHook:function(){return window.open(eS.A.getArticleURL(A.MVz.TIGGER_PAWTECT_LEARN_MORE),"_blank")}})]})}let pT=(0,a.Tf)(o.X.ACCOUNT_INFO_AGE_GROUP_EDIT_SETTING,{usePredicate:()=>pE("edit"),useTitle:()=>j.intl.string(j.t["/52UYy"]),useVariant:()=>"secondary",useTrailingDecoration:()=>({type:d.fq.STRONGLY_DISCOURAGED_CUSTOM,StronglyDiscouragedCustomComponent:px}),useLabel:()=>j.intl.string(j.t.bt75uw),onClick:function(){(0,ln.openModalLazy)(async()=>{let{default:e}=await n.e("45361").then(n.bind(n,151080));return t=>(0,c.jsx)(e,{...t})})}}),pp=(0,a.E2)(o.X.ACCOUNT_INFO_AGE_GROUP_INFO_SETTING,{usePredicate:()=>pE("info"),useSearchTerms:()=>[j.intl.string(j.t["/52UYy"])],Component:function(){return(0,c.jsx)(tH.D,{label:j.intl.string(j.t["/52UYy"]),layout:"horizontal",children:(0,c.jsxs)(F.B,{direction:"horizontal",align:"center",justify:"end",gap:"md",children:[(0,c.jsx)(z.E,{variant:"text-md/medium",children:j.intl.string(j.t.XxRj7f)}),(0,c.jsx)("div",{style:{visibility:"hidden"},children:(0,c.jsx)(p.$,{onClick:pc.tE,text:j.intl.string(j.t.bt75uw),"aria-hidden":!0})})]})})}});var pf=n(31720),pI=n(847599);let p_=(0,a.Tf)(o.X.ACCOUNT_INFO_AGE_GROUP_VERIFY_SETTING,{usePredicate:()=>pE("verify"),useTitle:()=>j.intl.string(j.t["/52UYy"]),useVariant:()=>"secondary",useTrailingDecoration:()=>({type:d.fq.TEXT,text:(0,pA.yM)()?j.intl.string(j.t.sK0dmH):j.intl.string(j.t.lKDPGA)}),useLabel:function(){return(0,pA.yM)()?j.intl.string(j.t["9KiIz6"]):j.intl.string(j.t.DVywUB)},onClick:()=>pf.A.showAgeVerificationGetStartedModal({entryPoint:pI.q1.ACCOUNT_AGE_GROUP})}),pN=(0,a.Tf)(o.X.ACCOUNT_INFO_CLAIM_ACCOUNT_SETTING,{usePredicate:()=>{let e=(0,m.bG)([l1.default],()=>l1.default.getCurrentUser());return null!=e&&!e.isClaimed()},useTitle:()=>j.intl.string(j.t.tlZllC),useVariant:()=>"secondary",useTrailingDecoration:()=>({type:d.fq.TEXT,text:j.intl.string(j.t.qxk9zo)}),useLabel:()=>j.intl.string(j.t.BleMPB),onClick:()=>pg()});function pC(e){return`${"*".repeat(e.length-4)}${e.slice(-4)}`}function pb(e){let[t,n]=e.split("@");return`${"*".repeat(t.length)}@${n}`}function py(e){let{text:t,censor:n,revealLabel:i,hideLabel:l}=e,[s,r]=g.useState(!1),a=s?t:n(t);return(0,c.jsxs)(F.B,{direction:"horizontal",align:"center",gap:4,justify:"end",children:[(0,c.jsx)(z.E,{variant:"text-md/medium",children:a}),(0,c.jsx)(Ai.Q,{variant:"primary",textVariant:"text-md/medium","aria-label":s?l:i,onClick:()=>r(!s),text:s?j.intl.string(j.t.fgq1gs):j.intl.string(j.t.dcztdU)})]})}function pv(){let e=(0,m.bG)([l1.default],()=>l1.default.getCurrentUser()?.email);return null==e?(0,c.jsx)(z.E,{variant:"text-md/medium",children:j.intl.string(j.t["8SfTN/"])}):(0,c.jsx)(py,{text:e,censor:pb,revealLabel:j.intl.string(j.t["Zvx+yV"]),hideLabel:j.intl.string(j.t.nqTD4d)})}let pj=(0,a.Tf)(o.X.ACCOUNT_INFO_EMAIL_SETTING,{usePredicate:()=>(0,m.bG)([l1.default],()=>l1.default.getCurrentUser()?.isClaimed())??!1,useTitle:()=>j.intl.string(j.t.tlZllC),useVariant:()=>"secondary",useTrailingDecoration:()=>({type:d.fq.STRONGLY_DISCOURAGED_CUSTOM,StronglyDiscouragedCustomComponent:pv}),useLabel:function(){return null==(0,m.bG)([l1.default],()=>l1.default.getCurrentUser()?.email)?j.intl.string(j.t.OYkgVk):j.intl.string(j.t.bt75uw)},useAriaLabel:function(){return null==(0,m.bG)([l1.default],()=>l1.default.getCurrentUser()?.email)?j.intl.string(j.t["pvBD+W"]):j.intl.string(j.t["8peUT0"])},onClick:function(){(0,ln.openModalLazy)(async()=>{let{default:e}=await Promise.all([n.e("11322"),n.e("20577"),n.e("65861")]).then(n.bind(n,97060));return t=>(0,c.jsx)(e,{...t})})}});var pO=n(557722),pL=n(53516);function pD(){let e=(0,m.bG)([l1.default],()=>l1.default.getCurrentUser()),t=e?.phone??null;return null==e||null==t?(0,c.jsx)(z.E,{variant:"text-md/medium",children:j.intl.string(j.t.I5kDqj)}):(0,c.jsx)(F.B,{direction:"horizontal",align:"center",justify:"end",gap:"md",children:(0,c.jsx)(py,{text:t,censor:pC,revealLabel:j.intl.string(j.t.eY3xlT),hideLabel:j.intl.string(j.t["jllbv+"])})})}let pR=(0,a.Tf)(o.X.ACCOUNT_INFO_PHONE_SETTING,{usePredicate:()=>(0,m.bG)([l1.default],()=>l1.default.getCurrentUser()?.isClaimed())??!1,useTitle:()=>j.intl.string(j.t.kerONq),useAriaLabel:function(){return null==(0,m.bG)([l1.default],()=>l1.default.getCurrentUser()?.phone)?j.intl.string(j.t["SfUuE+"]):j.intl.string(j.t.YDabSe)},useVariant:()=>"secondary",useTrailingDecoration:()=>({type:d.fq.STRONGLY_DISCOURAGED_CUSTOM,StronglyDiscouragedCustomComponent:pD}),useLabel:function(){return null==(0,m.bG)([l1.default],()=>l1.default.getCurrentUser()?.phone)?j.intl.string(j.t.OYkgVk):j.intl.string(j.t.bt75uw)},onClick:function(){null==l1.default.getCurrentUser()?.phone?(0,ln.openModalLazy)(async()=>{let{default:e}=await Promise.all([n.e("49747"),n.e("72712"),n.e("89545"),n.e("11493"),n.e("84704"),n.e("86197")]).then(n.bind(n,615715));return t=>(0,c.jsx)(e,{reason:pO.d.USER_SETTINGS_UPDATE,...t})},{modalKey:pL.V}):(0,ln.openModalLazy)(async()=>{let{default:e}=await Promise.all([n.e("55682"),n.e("40933")]).then(n.bind(n,660740));return t=>(0,c.jsx)(e,{...t})})}});function pP(){let e=(0,m.bG)([l1.default],()=>l1.default.getCurrentUser());return null!=e&&!e.isClaimed()}function pG(){let e=(0,S6.EC)(),t=e?.nick?.[0]??null,n=(0,m.bG)([l1.default],()=>l1.default.getCurrentUser());if(null==n)return null;let i=n.hasUniqueUsername()?n.username:`${n.username}#${n.discriminator}`;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(z.E,{variant:"text-md/medium",children:i}),null!=t&&(0,c.jsx)(i4.m,{__unsupportedReactNodeAsText:t,"aria-label":!1,children:(0,c.jsx)(iw.E,{size:"custom",width:20,height:20,color:nK.A.colors.STATUS_WARNING.css})})]})}let pM=(0,a.Tf)(o.X.ACCOUNT_INFO_USERNAME_SETTING,{useTitle:()=>j.intl.string(j.t.qqhR3L),useTrailingDecoration:()=>({type:d.fq.STRONGLY_DISCOURAGED_CUSTOM,StronglyDiscouragedCustomComponent:pG}),useLabel:()=>j.intl.string(j.t.bt75uw),useAriaLabel:()=>j.intl.string(j.t.JECa91),useSubtitle:()=>pP()?j.intl.string(j.t["7Ngnyr"]):void 0,useVariant:()=>"secondary",useDisabled:pP,onClick:function(){(0,ln.openModalLazy)(async()=>{let{default:e}=await Promise.all([n.e("80032"),n.e("20429"),n.e("43350")]).then(n.bind(n,667792));return t=>(0,c.jsx)(e,{...t})})}}),pU=(0,a.zZ)(o.X.ACCOUNT_INFO_CATEGORY,{usePredicate:()=>(0,m.bG)([l1.default],()=>null!=l1.default.getCurrentUser()),useTitle:()=>j.intl.string(j.t.apNo4l),useInlineNotice:function(){let e=(0,m.bG)([l1.default],()=>l1.default.getCurrentUser());return null==e?null:e.isClaimed()?null==e.email||e.verified?null:{type:d.lT.INLINE_NOTICE,noticeType:"warning",title:j.intl.string(j.t.tuGzBT),text:j.intl.string(j.t.NAzplE),button:{text:j.intl.string(j.t.lm1UKt),onClick:()=>(0,pm.S)(e)}}:{type:d.lT.INLINE_NOTICE,noticeType:"critical",title:j.intl.string(j.t["/3qnL/"]),text:j.intl.string(j.t.qKs3vg),button:{text:j.intl.string(j.t["7psymi"]),onClick:()=>pg()}}},buildLayout:()=>[pM,pN,pj,pR,p_,pT,pp]});var pV=n(398177);let pk=(0,a.Tf)(o.X.ACCOUNT_CHANGE_PASSWORD_SETTING,{useTitle:()=>j.intl.string(j.t["CIGa+7"]),useLabel:()=>j.intl.string(j.t.bt75uw),useAriaLabel:()=>j.intl.string(j.t["FRep5/"]),useVariant:()=>"secondary",onClick:()=>{(0,ln.openModal)(e=>(0,c.jsx)(pV.default,{...e,onSuccess:()=>e.onClose()}))}});var pw=n(200921);let pF=[];function pB(){pF=[]}class pz extends m.Ay.Store{static displayName="AuthSessionsStore";getSessions(){return pF}}let pX=new pz(e2.h,{LOGOUT:pB,LOGIN_SUCCESS:pB,FETCH_AUTH_SESSIONS_SUCCESS:function(e){let{sessions:t}=e;pF=t.map(e=>({...e,approx_last_used_time:new Date(e.approx_last_used_time)}))},LOGOUT_AUTH_SESSIONS_SUCCESS:function(e){let{sessionIdHashes:t}=e,n=[...pF],i=!1;for(let e of t){let t=n.findIndex(t=>t.id_hash===e);t>=0&&(n.splice(t,1),i=!0)}if(!i)return!1;pF=n}});function pY(){let e=(0,m.cf)([pX],()=>pX.getSessions());return g.useMemo(()=>{let t=[...e],n=null,i=ur.default.getAuthSessionIdHash();if(null!=i){let e=t.findIndex(e=>e.id_hash===i);e>=0&&(n=t.splice(e,1)[0])}return t.sort((e,t)=>t.approx_last_used_time.valueOf()-e.approx_last_used_time.valueOf()),{currentSession:n,otherSessions:t}},[e])}function pH(e){return(Date.now()-e.valueOf())/1e3/60/60<1?j.intl.string(j.t.TXCmfL):ii()(e).fromNow()}var pK=n(176524),pW=n(646270),pZ=n(738678),pq=n(53061);function pQ(e){let{icon:t,label:n,subLabel:i,description:l,children:s,muted:r}=e;return(0,c.jsxs)(F.B,{direction:"horizontal",align:"center",gap:"sm",role:"listitem",children:[(0,c.jsx)(pK.A,{icon:t,color:r?nK.A.colors.ICON_MUTED:"currentColor"}),(0,c.jsxs)(F.B,{direction:"vertical",gap:"xxs",children:[(0,c.jsxs)(F.B,{direction:"horizontal",gap:"xs",children:[(0,c.jsx)(z.E,{variant:"text-md/semibold",color:"text-strong",children:n}),null!=n&&null!=i&&(0,c.jsx)(z.E,{variant:"text-md/medium",color:"text-subtle","aria-hidden":!0,children:"\u2022"}),null!=i&&(0,c.jsx)(z.E,{variant:"text-md/medium",color:"text-subtle",children:i})]}),(0,c.jsx)(z.E,{variant:"text-sm/normal",color:"text-muted",children:l})]}),s]})}function pJ(e){let{session:t,current:n}=e,{location:i,platform:l,os:s,Icon:r,lastActive:a}=function(e,t){let n=e.client_info?.location??e.client_info?.ip,i=e.client_info?.platform,{text:l,icon:s}=function(e){switch(e?.toLowerCase().trim()){case null:case void 0:case"":return{text:j.intl.string(j.t.cDHCNY),icon:Eh.k};case"ios":case"android":return{text:e,icon:pW.u};case"horizon os":return{text:e,icon:pZ.G};default:return{text:e,icon:Eh.k}}}(e.client_info?.os);return{location:n,platform:i,os:l,Icon:s,lastActive:t?null:pH(e.approx_last_used_time)}}(t,n),o=[i,a].filter(n8.Vq);return(0,c.jsx)(pQ,{icon:r,label:s,subLabel:l,description:o.join(" \xb7 "),children:!n&&(0,c.jsx)(t8.D,{className:pq.X,onClick:()=>(0,pw.U0)(t.id_hash),"aria-label":j.intl.string(j.t.E4MJNt),children:(0,c.jsx)(hd.P,{size:"md",color:"currentColor"})})})}function p$(e){let{title:t,children:n}=e,i=g.useId();return(0,c.jsxs)(F.B,{role:"group","aria-labelledby":i,gap:"xl",padding:{top:8,bottom:8},children:[(0,c.jsx)(E.D,{id:i,variant:"heading-md/semibold",color:"text-muted",children:t}),(0,c.jsx)(F.B,{role:"list",gap:"xl",children:n})]})}let p0=(0,a.E2)(o.X.SESSIONS_CURRENT_SESSION_SETTING,{Component:function(){let{currentSession:e}=pY();return null==e?(0,c.jsx)(aY.y,{}):(0,c.jsx)(p$,{title:j.intl.string(j.t.LLS19o),children:(0,c.jsx)(pJ,{session:e,current:!0})})},useSearchTerms:()=>[]}),p1=(0,a.E2)(o.X.SESSIONS_LOGOUT_ALL_SESSIONS_SETTING,{Component:function(){let{otherSessions:e}=pY();return(0,c.jsx)(tH.D,{label:j.intl.string(j.t.Vij32M),description:j.intl.string(j.t.OTXyaf),children:(0,c.jsx)(p.$,{onClick:()=>(0,pw.U0)(e.map(e=>e.id_hash)),variant:"critical-primary",size:"sm",text:j.intl.string(j.t.cLmmeY)})})},useSearchTerms:()=>[j.intl.string(j.t.Vij32M)],usePredicate:()=>{let{otherSessions:e}=pY();return e.length>0}});var p2=n(766928);function p3(){return(0,c.jsx)(pQ,{icon:p2.W,label:j.intl.string(j.t.iUa0sn),description:j.intl.format(j.t["044+8i"],{onClick:()=>(0,t9.openUserSettings)(o.X.ACCOUNT_PANEL,{analyticsLocations:[tv.A.USER_SETTINGS_SESSIONS]})}),muted:!0})}let p5=(0,a.E2)(o.X.SESSIONS_OTHER_SESSIONS_SETTING,{Component:function(){let{otherSessions:e}=pY(),t=(0,m.bG)([l1.default],()=>l1.default.getCurrentUser());return(0,c.jsxs)(p$,{title:j.intl.string(j.t.xx1MWc),children:[e.map(e=>(0,c.jsx)(pJ,{session:e},e.id_hash)),t?.mfaEnabled?null:(0,c.jsx)(p3,{})]})},useSearchTerms:()=>[j.intl.string(j.t.Vij32M)],usePredicate:()=>{let{otherSessions:e}=pY(),t=(0,m.bG)([l1.default],()=>l1.default.getCurrentUser()?.mfaEnabled);return e.length>0||!t}}),p6=(0,a.zZ)(o.X.SESSIONS_CATEGORY,{useTitle:()=>j.intl.string(j.t.mEndXM),useSubtitle:()=>j.intl.string(j.t.b7ZpTM),initialize:()=>{(0,pw.GY)()},buildLayout:()=>[p0,p5,p1],useSearchTerms:()=>[j.intl.string(j.t["+1h0k/"]),j.intl.string(j.t.LLS19o),j.intl.string(j.t.xx1MWc),j.intl.string(j.t.lSWsrd)]}),p4=(0,a.t_)(o.X.SESSIONS_PANEL,{useTitle:()=>j.intl.string(j.t.mEndXM),useObscuredNotice:az.L,buildLayout:()=>[p6]}),p8=(0,a.t0)(o.X.ACCOUNT_SESSIONS_NESTED_PANEL,{buildLayout:()=>[p4],initialize:()=>{(0,pw.GY)()},useTrailingDecoration:()=>{let{currentSession:e,otherSessions:t}=pY(),n=t.length+ +(null!=e);return{type:d.xn.TEXT,text:n>0?j.intl.formatToPlainString(j.t.G7zwOk,{count:n}):j.intl.string(j.t.MKDeyL)}}});var p7=n(464477);function p9(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return null==e?null:e.hasAnyStaffLevel()?t?j.intl.string(j.t.YJGvuD):j.intl.string(j.t["3iKih7"]):e.hasFlag(A.nhx.PARTNER)?t?j.intl.string(j.t["9UucjT"]):j.intl.string(j.t.Sq6Q1u):null==e.email?t?j.intl.string(j.t["9VWpT9"]):j.intl.string(j.t.LfCBZG):null}function fe(){return(0,aO.bG)([l1.default],()=>{let e=l1.default.getCurrentUser();return null!=e&&e.mfaEnabled})}var ft=((r={}).AVAILABLE="available",r.UNAVAILABLE_NO_CRYPTO="unavailable_no_crypto",r.UNAVAILABLE_UNVERIFIED="unavailable_unverified",r);function fn(){let e=(0,aO.bG)([l1.default],()=>l1.default.getCurrentUser()?.verified);return p7.K7?!1===e?"unavailable_unverified":"available":"unavailable_no_crypto"}function fi(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,aO.bG)([lc.A,xY.A,l1.default],()=>l1.default.getCurrentUser()?.hasAnyStaffLevel()?e?j.intl.string(j.t.hxf9fX):j.intl.string(j.t["3iKih7"]):lc.A.getGuildsArray().some(e=>e.features.has(A.GuildFeatures.ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE)&&xY.A.can(A.xBc.ADMINISTRATOR,e))?e?j.intl.string(j.t.OYTCUh):j.intl.string(j.t.HC8uSZ):null)}var fl=n(466034);let fs=(0,a.Tf)(o.X.AUTHENTICATOR_APP_DISABLE_BUTTON,{useTitle:()=>j.intl.string(j.t.lQsY7B),useSubtitle:()=>fi(!0),useDisabled:()=>null!==fi(!0),useLabel:()=>j.intl.string(j.t.N86XcP),useVariant:()=>"critical-secondary",usePredicate:()=>{let e=(0,m.bG)([ur.default],()=>ur.default.hasTOTPEnabled()),t=fn()===ft.AVAILABLE;return e&&t},onClick:()=>void(0,nW.A)({title:j.intl.string(j.t["D+aE7g"]),subtitle:j.intl.string(j.t.EA4ZEk),variant:"critical",confirmText:j.intl.string(j.t.N86XcP),onConfirm:()=>pd.A.disable()})}),fr=(0,a.zZ)(o.X.AUTHENTICATOR_APP_CATEGORY,{useTitle:()=>j.intl.string(j.t.RumMFo),useSubtitle:()=>j.intl.string(j.t.iTbTo7),useHeaderDecoration:function(){let e=(0,m.bG)([ur.default],()=>ur.default.hasTOTPEnabled()),t=fn()===ft.AVAILABLE;if(!e&&t)return{type:d.WX.BUTTON_GROUP,buttons:[{type:d.UV.BUTTON,id:"mfa-setup-button",text:j.intl.string(j.t.cTNUeD),onClick:fl.Ay.enableMFA}]}},useInlineNotice:function(){switch(fn()){case ft.UNAVAILABLE_NO_CRYPTO:return{type:d.lT.INLINE_NOTICE,noticeType:"info",text:j.intl.string(j.t.PhHhsj)};case ft.UNAVAILABLE_UNVERIFIED:return{type:d.lT.INLINE_NOTICE,noticeType:"warning",text:j.intl.string(j.t.uggF7o)};case ft.AVAILABLE:return}},collapseOnEmpty:!1,buildLayout:()=>[fs]});var fa=n(670492),fo=n(32880),fu=n(663417),fd=n(658675),fc=n(900686);function fg(){(0,ln.openModalLazy)(async()=>{let{default:e}=await Promise.resolve().then(n.bind(n,662758));return t=>(0,c.jsx)(e,{...t,handleSubmit:e=>pd.A.sendMFABackupCodesVerificationKeyEmail(e).then(()=>{var t;return t=e,void(0,ln.openModalLazy)(async()=>{let{default:e}=await Promise.all([n.e("12536"),n.e("96179")]).then(n.bind(n,518142));return n=>(0,c.jsx)(e,{...n,password:t})},{stackingBehavior:"stack"})}),title:j.intl.string(j.t.PsQmzU),actionText:j.intl.string(j.t.ajkYcF)})})}var fm=n(808658);function fA(e){return`${e.slice(0,4)}-${e.slice(4)}`}async function fh(){let e=fa.A.getVerificationKey();try{await pd.A.confirmViewBackupCodes(e,!0)}catch(e){(0,Al.P0)({message:e.body?.message??j.intl.string(j.t.F8FvUy),type:Ar.Ck.FAILURE,id:"backup-code-regen-failed"})}}function fE(e){let{code:{code:t,consumed:n}}=e,i=fA(t),l=g.useRef(null),s=(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(fd.P,{checked:n}),(0,c.jsx)(z.E,{variant:"text-md/normal",children:i})]});return uc.p5?(0,c.jsx)(t8.D,{tag:"li",className:ie()(fm.aY,fm.vk),innerRef:l,onKeyDown:function(e){"c"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),e.stopPropagation(),(0,uc.C)(i),l?.current?.focus())},onClick:function(){(0,uc.C)(i),(0,Al.P0)({message:j.intl.string(j.t.mGZ66D),type:Ar.Ck.SUCCESS,id:"backup-code-copied"})},children:s}):(0,c.jsx)("li",{className:fm.aY,children:s})}let fS=(0,a.zZ)(o.X.BACKUP_CODES_CATEGORY,{useTitle:()=>j.intl.string(j.t.fC9qV0),useSubtitle:()=>(0,m.bG)([fa.A],()=>fa.A.getBackupCodes().length>0)?j.intl.format(j.t.tp7zEK,{}):j.intl.string(j.t.LoOi4S),usePredicate:fe,buildLayout:()=>[fx]}),fx=(0,a.E2)(o.X.BACKUP_CODES_SETTING,{useSearchTerms:()=>[j.intl.string(j.t.fC9qV0)],Component:function(){let e=(0,m.bG)([fa.A],()=>fa.A.getBackupCodes()),t=g.useMemo(()=>e.map(e=>{let{code:t,consumed:n}=e;return`* ${fA(t)}`+(n?` (${j.intl.string(j.t["ycME+9"])})`:"")}).join("\r\n"),[e]);return 0===e.length?(0,c.jsx)(p.$,{text:j.intl.string(j.t.Jc2myK),size:"sm",variant:"secondary",onClick:fg}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("ul",{className:fm.E5,children:e.map(e=>(0,c.jsx)(fE,{code:e},e.code))}),(0,c.jsxs)(sC.e,{size:"sm",children:[(0,c.jsx)(fc.A,{fileContents:t,contentType:"text/plain",fileName:"discord_backup_codes.txt",children:(0,c.jsx)(p.$,{text:j.intl.string(j.t["OO+Nib"]),variant:"secondary",icon:fo.s})}),(0,c.jsx)(p.$,{text:j.intl.string(j.t["3x962E"]),variant:"secondary",icon:fu.f,onClick:fh})]})]})}}),fT=(0,a.Tf)(o.X.SMS_AUTH_DISABLE_BUTTON,{useTitle:()=>j.intl.string(j.t.lQsY7B),useSubtitle:function(){let[e,t]=g.useState(!1),n=(0,m.bG)([l1.default],()=>l1.default.getCurrentUser()?.phone);return null==n?null:j.intl.format(e?j.t["xDBk/I"]:j.t.bnKdnl,{phone:e?n:n.slice(-4),toggleButton:()=>(0,c.jsx)(Ai.Q,{text:e?j.intl.string(j.t.fgq1gs):j.intl.string(j.t.dcztdU),onClick:()=>t(!e)})})},useLabel:()=>j.intl.string(j.t.N86XcP),useVariant:()=>"critical-secondary",usePredicate:()=>(0,m.bG)([l1.default],()=>l1.default.getCurrentUser()?.hasFlag(A.nhx.MFA_SMS)??!1),onClick:()=>void(0,ln.openModalLazy)(async()=>{let{default:e}=await Promise.resolve().then(n.bind(n,662758));return t=>(0,c.jsx)(e,{...t,handleSubmit:pd.A.disableSMS,title:j.intl.string(j.t.KLWnit),children:j.intl.string(j.t["W0/Duf"])})})}),fp=(0,a.zZ)(o.X.SMS_AUTH_CATEGORY,{useTitle:()=>j.intl.string(j.t.wuHuI5),useSubtitle:()=>(0,m.bG)([l1.default],()=>p9(l1.default.getCurrentUser(),!0)),useHeaderDecoration:()=>{let e=(0,m.bG)([l1.default],()=>l1.default.getCurrentUser()?.hasFlag(A.nhx.MFA_SMS)??!1),t=(0,m.bG)([l1.default],()=>null!=p9(l1.default.getCurrentUser()));if(!e)return{type:d.WX.BUTTON_GROUP,buttons:[{type:d.UV.BUTTON,id:"sms-setup-button",text:j.intl.string(j.t.Age7yU),onClick:ff,disabled:t}]}},collapseOnEmpty:!1,usePredicate:()=>{let e=fn(),t=fe(),n=(0,m.bG)([ur.default],()=>ur.default.hasTOTPEnabled());return e===ft.AVAILABLE&&t&&n},buildLayout:()=>[fT]});function ff(){let e=l1.default.getCurrentUser();if(null!=e)if(null==e.phone){var t;t={reason:pO.d.USER_SETTINGS_UPDATE,onAddedPhone:pd.A.enableSMS},(0,ln.openModalLazy)(async()=>{let{default:e}=await Promise.all([n.e("49747"),n.e("72712"),n.e("89545"),n.e("11493"),n.e("84704"),n.e("86197")]).then(n.bind(n,615715));return n=>(0,c.jsx)(e,{...n,...t})},{modalKey:pL.V})}else pd.A.enableSMS()}var fI=n(665671),f_=n(442433),fN=n(917136),fC=n(976910),fb=n(303778);function fy(e){let{credential:t}=e;return(0,c.jsxs)("li",{className:fb.e,children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(z.E,{variant:"text-md/normal",children:t.name}),null!=t.last_used&&(0,c.jsx)(z.E,{variant:"text-sm/normal",color:"text-muted",children:j.intl.format(j.t["7JgxF5"],{lastUsed:pH(t.last_used)})})]}),(0,c.jsx)(i5.K,{icon:dn.j,variant:"icon-only",size:"sm","aria-label":j.intl.string(j.t["+nrTbK"]),onClick:e=>{(0,f_.L3)(e,async()=>{let{default:e}=await n.e("32529").then(n.bind(n,41e3));return n=>(0,c.jsx)(e,{credential:t,...n})})}})]})}let fv=(0,a.zZ)(o.X.SECURITY_KEYS_CATEGORY,{useTitle:()=>j.intl.string(j.t.IBq4Y3),useSubtitle:()=>j.intl.string(j.t.yK9edS),useHeaderDecoration:function(){if(fn()===ft.AVAILABLE)return{type:d.WX.BUTTON_GROUP,buttons:[{type:d.UV.BUTTON,id:"add-security-key-button",text:j.intl.string(j.t["Tzs/fw"]),icon:iM.j,onClick:fI.A}]}},useInlineNotice:()=>(function(){switch(fn()){case ft.UNAVAILABLE_NO_CRYPTO:return{type:d.lT.INLINE_NOTICE,noticeType:"info",text:j.intl.string(j.t.bWCGI9)};case ft.UNAVAILABLE_UNVERIFIED:return{type:d.lT.INLINE_NOTICE,noticeType:"warning",text:j.intl.string(j.t.uggF7o)};case ft.AVAILABLE:return}})(),buildLayout:()=>[fj]}),fj=(0,a.E2)(o.X.SECURITY_KEYS_LIST,{useSearchTerms:()=>[j.intl.string(j.t.y7SXYX)],Component:function(){let{credentials:e,hasFetchedCredentials:t}=(0,m.cf)([fC.A],()=>({hasFetchedCredentials:fC.A.hasFetchedCredentials(),credentials:fC.A.getCredentials()}));return(g.useEffect(()=>{t||fN.JQ()},[t]),t)?(0,c.jsx)(F.B,{direction:"vertical",gap:"sm",as:"ul",children:e.map(e=>(0,c.jsx)(fy,{credential:e},e.id))}):(0,c.jsx)(aY.y,{})}}),fO=(0,a.t_)(o.X.MULTI_FACTOR_AUTHENTICATION,{useTitle:()=>j.intl.string(j.t.m0FidJ),buildLayout:()=>[fv,fr,fp,fS]}),fL=(0,a.t0)(o.X.ACCOUNT_MFA_NESTED_PANEL,{useTrailingDecoration:()=>{let e=fe();return{type:d.xn.TEXT,text:e?j.intl.string(j.t.lQsY7B):j.intl.string(j.t.WsUuTt)}},buildLayout:()=>[fO]}),fD=(0,a.zZ)(o.X.ACCOUNT_PASSWORD_SECURITY_CATEGORY,{useTitle:()=>j.intl.string(j.t["0iH2vc"]),buildLayout:()=>[pk,fL,p8]});var fR=n(308645),fP=n(271995),fG=n(855267);let fM=(0,a.E2)(o.X.ACCOUNT_STANDING_SETTING,{useSearchTerms:()=>[j.intl.string(j.t["16r9jm"])],Component:fG.A}),fU=(0,a.zZ)(o.X.ACCOUNT_STANDING_NESTED_CATEGORY,{buildLayout:()=>[fM]}),fV=(0,a.t_)(o.X.ACCOUNT_STANDING_PANEL,{useTitle:()=>j.intl.string(j.t["16r9jm"]),buildLayout:()=>[fU]}),fk=(0,a.zZ)(o.X.ACCOUNT_STANDING_CATEGORY,{useTitle:()=>j.intl.string(j.t["16r9jm"]),buildLayout:()=>[fw]}),fw=(0,a.t0)(o.X.ACCOUNT_STANDING_NESTED_PANEL,{useTitle:fP.$b,useSubtitle:fP.bh,useLeadingDecoration:function(){let{color:e,backgroundColor:t,Icon:n}=(0,fP._k)();return{type:d.Xy.ICON,icon:n,color:e,backgroundColor:t}},initialize:()=>{fR.Yn()},buildLayout:()=>[fV]});var fF=n(738188),fB=n(834981),fz=n(987197),fX=n(822585),fY=n(840387),fH=n(465558),fK=n(602339);let fW=(0,a.E2)(o.X.FAMILY_CENTER_SETTING,{Component:fH.p,useSearchTerms:()=>[j.intl.string(fK.default.RZqaJn),j.intl.string(fK.default.bdBmqy),j.intl.string(fK.default["gVWG+6"]),j.intl.string(fK.default.ahKIJO),j.intl.string(fK.default["8SLtqb"])]}),fZ=(0,a.zZ)(o.X.FAMILY_CENTER_CATEGORY,{buildLayout:()=>[fW]}),fq=(0,a.t_)(o.X.FAMILY_CENTER_PANEL,{useTitle:()=>j.intl.string(fK.default.RZqaJn),buildLayout:()=>[fZ]}),fQ=(0,a.zZ)(o.X.ACCOUNT_FAMILY_CENTER_CATEGORY,{useTitle:()=>j.intl.string(fK.default.RZqaJn),usePersistentBadge:function(){let e=(0,fz.f)(),t=(0,fX.L)()?.daysRemaining??null,n=e&&null!=t&&t>=0,i=(0,fB.VT)();return g.useMemo(()=>n?{badgeType:d.Xi.WARNING}:{badgeType:d.Xi.COUNT,count:i},[n,i])},buildLayout:()=>[fJ]}),fJ=(0,a.t0)(o.X.ACCOUNT_FAMILY_CENTER_NESTED_PANEL,{useTitle:()=>(0,fB.Li)()?j.intl.string(fK.default.IcMQUP):j.intl.string(fK.default["n8wrn/"]),useSubtitle:()=>{let e=(0,fY.Z)(),t=(0,fB.Li)();return e?t?j.intl.string(fK.default.G8lHFU):j.intl.string(fK.default.uOLNEZ):j.intl.string(fK.default.Z53oSM)},useLeadingDecoration:function(){let e=(0,fz.f)(),t=(0,fX.L)()?.daysRemaining??null;return!e||null==t||t<0?null:{type:d.Xy.ICON,icon:fF.i,color:nK.A.colors.ICON_FEEDBACK_WARNING,backgroundColor:nK.A.colors.BACKGROUND_FEEDBACK_WARNING}},buildLayout:()=>[fq]});var f$=n(425587),f0=n(662758);function f1(e){if(e.body.code===A.t02.INVALID_PASSWORD)throw e;(0,sI.A)({title:j.intl.string(j.t.LX0nT8),subtitle:e.body.message})}async function f2(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=l1.default.getCurrentUser();if(null==t)return;let n=[];try{n=(await f$.A.fetchTeams(!0)).body}catch{}n.filter(e=>e.owner_user_id===t.id).length>0?(0,sI.A)({title:j.intl.string(j.t["Y++oNe"]),subtitle:j.intl.format(j.t.alpAUm,{devPortalLink:"https://discord.com/developers/teams"})}):lc.A.getGuildsArray().filter(e=>e.ownerId===t.id).length>0?(0,sI.A)({title:j.intl.string(j.t.vJiTOL),subtitle:j.intl.string(j.t.UyVVan)}):t.isClaimed()?(0,ln.openModal)(t=>(0,c.jsx)(f0.default,{...t,handleSubmit:t=>(0,Sw.U_)(t,e).then(A.tEg,f1),title:e?j.intl.string(j.t.xca2ts):j.intl.string(j.t.goXv9g),actionText:e?j.intl.string(j.t["8lQ2rR"]):j.intl.string(j.t.jf5GGb),variant:"critical-primary",children:e?j.intl.string(j.t.FB4H1D):j.intl.string(j.t.gk7h32)})):(0,nW.A)({title:j.intl.string(j.t.xca2ts),subtitle:j.intl.string(j.t.FB4H1D),confirmText:j.intl.string(j.t["8lQ2rR"]),onConfirm:()=>(0,Sw.U_)("",!0)})}let f3=(0,a.Tf)(o.X.ACCOUNT_DELETE_SETTING,{useTitle:()=>j.intl.string(j.t["gIpzR+"]),useSubtitle:()=>j.intl.string(j.t.Bd6dOf),useLabel:()=>j.intl.string(j.t["8lQ2rR"]),useVariant:()=>"critical-primary",onClick:()=>f2(!0)}),f5=(0,a.Tf)(o.X.ACCOUNT_DISABLE_SETTING,{useTitle:()=>j.intl.string(j.t["p/Tjtp"]),useSubtitle:()=>j.intl.string(j.t.YvDmKb),useLabel:()=>j.intl.string(j.t.jf5GGb),useVariant:()=>"critical-secondary",onClick:()=>f2(!1),usePredicate:()=>{let e=(0,m.bG)([l1.default],()=>l1.default.getCurrentUser());return e?.isClaimed()??!1}}),f6=(0,a.zZ)(o.X.ACCOUNT_REMOVAL_CATEGORY,{buildLayout:()=>[f5,f3]}),f4=(0,a.t_)(o.X.ACCOUNT_PANEL,{useTitle:()=>j.intl.string(j.t["ldCE/p"]),initialize:function(){return()=>{pd.A.clearBackupCodes(),(0,Sw.Uo)()}},useObscuredNotice:az.L,buildLayout:()=>[pU,fD,fk,fQ,f6]}),f8=(0,a.i4)(o.X.ACCOUNT_SIDEBAR_ITEM,{useTitle:()=>j.intl.string(j.t["ldCE/p"]),icon:c9.n,buildLayout:()=>[f4]});var f7=n(176781),f9=n(341923),Ie=n(572164),It=n(539572),In=n(915725),Ii=n(16590);let Il=(0,a.zD)(o.X.CLIPS_ENABLE_AUTOCLIPPING,{useTitle:()=>j.intl.string(Ii.default.j29uJx),useSubtitle:()=>j.intl.format(Ii.default.UCzGcQ,{learnMoreLink:eS.A.getArticleURL(A.MVz.CLIPS)}),useValue:()=>(0,m.bG)([In.Ay],()=>In.Ay.getEnableAutoclipping()),setValue:It.uL,useDisabled:()=>!(0,Ie.Et)()}),Is=(0,a.zY)(o.X.CLIPS_AUTOCLIPPING_CARD,{buildLayout:()=>[Il],headerSettingKey:Il.key}),Ir=(0,a.zZ)(o.X.CLIPS_AUTOCLIPPING_CATEGORY,{useTitle:()=>j.intl.string(Ii.default.XWkJoi),useSubtitle:()=>j.intl.string(Ii.default["MJ/VsO"]),usePredicate:f9.H,usePersistentBadge:()=>({badgeType:d.Xi.BETA}),useInlineNotice:()=>(0,Ie.Et)()?null:{type:d.lT.INLINE_NOTICE,noticeType:"info",iconAlign:"center",text:j.intl.string(Ii.default.wUpqua),button:{variant:"primary",size:"sm",text:j.intl.string(Ii.default.qGgW4M),onClick:()=>It.yO({clipsEnabled:!0,trackAnalytics:!0})}},buildLayout:()=>[Is]});var Ia=n(974293),Io=n(696016);let Iu=[Io.zq,25,50,Io.Y2,Io.rv],Id=(0,a.sN)(o.X.CLIPS_BITRATE,{usePredicate:()=>(0,Ia.V0)("ClipsBitrateSetting"),useTitle:()=>j.intl.string(j.t["8bZyov"]),useSubtitle:()=>j.intl.string(j.t["h8DSx/"]),minValue:Io.zq,maxValue:Io.rv,useDefaultValue:()=>Io.Y2,getInitialValue:()=>In.Ay.getSettings().clipsQuality.bitratePercent??Io.Y2,onValueRender:e=>`${Math.round(e)}%`,setValue:e=>{let{clipsQuality:t}=In.Ay.getSettings();It.GS({...t,bitratePercent:Math.round(e)})},markers:Iu,onMarkerRender:e=>`${Math.round(e)}%`,useDisabled:()=>!(0,Ie.Et)()});var Ic=n(226640);let Ig=(0,a.Hn)(o.X.CLIPS_FRAME_RATE,{useTitle:()=>j.intl.string(j.t["2wScL1"]),useSubtitle:()=>j.intl.string(j.t["Rf9+fy"]),useValue:()=>(0,m.bG)([In.Ay],()=>In.Ay.getSettings().clipsQuality.frameRate),setValue:e=>{let{clipsQuality:t}=In.Ay.getSettings();It.GS({...t,frameRate:e})},useOptions:Ic.Fz,useDisabled:()=>!(0,Ie.Et)()}),Im=(0,a.E2)(o.X.CLIPS_HARDWARE_CLASSIFICATION_WARNING,{useSearchTerms:()=>[j.intl.string(j.t.SIxrIF)],usePredicate:()=>(0,m.bG)([In.Ay],()=>In.Ay.getHardwareClassification())===Io.k9.BELOW_MINIMUM,Component:()=>(0,c.jsx)(lz.A,{look:lz.k.WARNING,children:j.intl.string(j.t.SIxrIF)})}),IA=(0,a.Hn)(o.X.CLIPS_LENGTH,{useTitle:()=>j.intl.string(j.t.OgfUio),useSubtitle:()=>j.intl.string(j.t.H7j4tY),useValue:()=>(0,m.bG)([In.Ay],()=>In.Ay.getSettings().clipsLength),setValue:e=>It.h$(e),useOptions:Ic.Qu,useDisabled:()=>!(0,Ie.Et)()}),Ih=(0,a.E2)(o.X.CLIPS_QUALITY_INFOBOX,{useSearchTerms:()=>[j.intl.string(j.t["Z+MfqT"])],Component:()=>(0,c.jsx)(lz.A,{look:lz.k.INFO,children:j.intl.string(j.t["Z+MfqT"])})}),IE=(0,a.Hn)(o.X.CLIPS_RESOLUTION,{useTitle:()=>j.intl.string(j.t.aFudZJ),useSubtitle:()=>j.intl.string(j.t.nIrkW5),useValue:()=>(0,m.bG)([In.Ay],()=>In.Ay.getSettings().clipsQuality.resolution),setValue:e=>{let{clipsQuality:t}=In.Ay.getSettings();It.GS({...t,resolution:e})},useOptions:Ic.gF,useDisabled:()=>!(0,Ie.Et)()}),IS=(0,a.zD)(o.X.CLIPS_ENABLE_REMINDERS,{useTitle:()=>j.intl.string(j.t["3zwNf6"]),useSubtitle:()=>j.intl.string(j.t.m4Cjj9),useValue:()=>(0,m.bG)([In.Ay],()=>In.Ay.getSettings().remindersEnabled),setValue:e=>It.Mt(e),useDisabled:()=>!(0,Ie.Et)()}),Ix=(0,a.zZ)(o.X.CLIPS_CAPTURE_SETTINGS_CATEGORY,{useTitle:()=>j.intl.string(Ii.default.TGwzMe),buildLayout:()=>[Im,IA,Ig,IE,Id,Ih,IS]}),IT=(0,a.zD)(o.X.CLIPS_DEBUG_TOOLTIPS,{useTitle:()=>"Show clips debug tooltips",useSubtitle:()=>"Show overlay tooltips for the clips engine starting, enabled features, auto-clip signals, and save errors. Intended for development and testing.",useValue:()=>(0,m.bG)([In.Ay],()=>In.Ay.getSettings().debugTooltipsEnabled),setValue:e=>It.YP(e)}),Ip=(0,a.zD)(o.X.CLIPS_SHOW_POV_CLIPS,{useTitle:()=>"Show POV clips in Gallery",useSubtitle:()=>"Show clips automatically captured from your point of view when a teammate clips a shared moment. Dev-only for now.",useValue:()=>(0,m.bG)([In.Ay],()=>In.Ay.getSettings().showPovClipsInGallery),setValue:e=>It.Uh(e)}),If=(0,a.zZ)(o.X.CLIPS_DEVELOPER_CATEGORY,{useTitle:()=>"Developer",usePredicate:()=>(0,m.bG)([l1.default],()=>{let e=l1.default.getCurrentUser();return e?.isStaff()===!0||e?.isStaffPersonal()===!0}),buildLayout:()=>[IT,Ip]});var II=n(417270),I_=n(645886);let IN=(0,a.E2)(o.X.CLIPS_KEYBIND,{useSearchTerms:()=>[j.intl.string(j.t.pf54EU),j.intl.string(j.t["QyB/jK"])],Component:()=>{let e=(0,m.bG)([lL.Ay],()=>lL.Ay.getKeybindForAction(A.hCu.SAVE_CLIP,!0));tl()(null!=e,"Save clip keybind unset");let t=!(0,Ie.Et)(),n=g.useRef(null),i=g.useCallback(t=>{ik.A.setKeybind({...e,shortcut:t})},[e]),l=g.useCallback(()=>{ik.A.setKeybind({...e,shortcut:(0,le.OH)(Io.Ot)})},[e]);return(0,c.jsx)(tH.D,{label:j.intl.string(j.t.pf54EU),description:j.intl.string(j.t["QyB/jK"]),layout:"horizontal-responsive",children:(0,c.jsx)("div",{className:I_.g,children:(0,c.jsx)(i9.A,{ref:n,disabled:t,defaultValue:e.shortcut,onChange:i,trailingActions:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(i4.m,{text:j.intl.string(Ii.default.bUtubv),position:"top",ariaHidden:!0,children:(0,c.jsx)(i5.K,{icon:iU.F,size:"sm",variant:"secondary",disabled:t,"aria-label":j.intl.string(Ii.default.bUtubv),onClick:e=>{e.stopPropagation(),n.current?.toggleRecordMode()}})}),(0,c.jsx)(i4.m,{text:j.intl.string(Ii.default.Kyk1Tp),position:"top",ariaHidden:!0,children:(0,c.jsx)(i5.K,{icon:II.m,size:"sm",variant:"secondary",disabled:t,"aria-label":j.intl.string(Ii.default.Kyk1Tp),onClick:e=>{e.stopPropagation(),l()}})})]})})})})}}),IC=(0,a.E2)(o.X.CLIPS_SCREENSHOT_KEYBIND,{useSearchTerms:()=>[j.intl.string(j.t["0U/hj7"]),j.intl.string(j.t["5zxkdo"])],usePredicate:lv.BW,Component:()=>{let e=(0,m.bG)([lL.Ay],()=>lL.Ay.getKeybindForAction(A.hCu.SAVE_CLIP,!0)),t=(0,m.bG)([lL.Ay],()=>lL.Ay.getKeybindForAction(A.hCu.SAVE_SCREENSHOT,!0));tl()(null!=e,"Save clip keybind unset"),tl()(null!=t,"Save screenshot keybind unset");let n=g.useCallback(e=>{ik.A.setKeybind({...t,shortcut:e})},[t]);return(0,c.jsx)(tH.D,{label:j.intl.string(j.t["0U/hj7"]),description:j.intl.string(j.t["5zxkdo"]),layout:"horizontal",children:(0,c.jsx)("div",{className:I_.g,children:(0,c.jsx)(i9.A,{defaultValue:t.shortcut,onChange:n})})})}}),Ib=(0,a.zD)(o.X.CLIPS_ENABLE,{useTitle:()=>j.intl.string(j.t.h8rgrK),useSubtitle:()=>j.intl.string(j.t["4Qw3NO"]),useValue:()=>(0,Ie.Et)(),setValue:e=>It.yO({clipsEnabled:e,trackAnalytics:!0})}),Iy=(0,a.zY)(o.X.CLIPS_GENERAL_CARD,{buildLayout:()=>[Ib,IN,IC],headerSettingKey:Ib.key}),Iv=(0,a.zZ)(o.X.CLIPS_GENERAL_CATEGORY,{useTitle:()=>j.intl.string(j.t["rWKv+e"]),useSubtitle:()=>j.intl.format(Ii.default["dh7g+S"],{learnMoreLink:eS.A.getArticleURL(A.MVz.CLIPS)}),buildLayout:()=>[Iy]}),Ij=(0,a.E2)(o.X.CLIPS_STORAGE_LOCATION,{useSearchTerms:()=>[j.intl.string(j.t.s4773E),j.intl.string(j.t.svjwGh)],Component:()=>{let e=(0,m.bG)([In.Ay],()=>In.Ay.getSettings().storageLocation),t=!(0,Ie.Et)(),n=g.useRef(!1);async function i(){if(!t&&!n.current){n.current=!0;try{let e=await nc.A.fileManager.showOpenDialog({properties:["openDirectory","createDirectory"]});e.length>0&&It.HU(e[0])}finally{n.current=!1}}}return(0,c.jsx)(tH.D,{label:j.intl.string(j.t.s4773E),description:j.intl.string(j.t.svjwGh),layout:"vertical",children:(0,c.jsxs)(F.B,{direction:"horizontal",align:"center",gap:"sm",children:[(0,c.jsx)(li.k,{fullWidth:!0,value:e,editable:!1,disabled:t,"aria-label":j.intl.formatToPlainString(j.t.iMONTj,{storageLocation:e})}),(0,c.jsx)(p.$,{variant:"secondary",disabled:t,onClick:i,text:j.intl.string(Ii.default.yQAN6B)})]})})}}),IO=(0,a.zZ)(o.X.CLIPS_STORAGE_CATEGORY,{useTitle:()=>j.intl.string(Ii.default["0Q+pdZ"]),buildLayout:()=>[Ij]}),IL=(0,a.t_)(o.X.CLIPS_PANEL,{useTitle:()=>j.intl.string(j.t.z2jK6X),usePredicate:lv.sw,buildLayout:()=>[Iv,Ir,Ix,IO,If]}),ID=(0,a.i4)(o.X.CLIPS_SIDEBAR_ITEM,{useTitle:()=>j.intl.string(j.t.z2jK6X),icon:f7.x,buildLayout:()=>[IL]});var IR=n(254138),IP=n(290595),IG=n(153488),IM=n(308528),IU=n(171316),IV=n(558001);n(866945);var Ik=n(835002);function Iw(){let e=(0,IU.uM)(),t=(0,fB.vx)(),n=g.useCallback(()=>{(0,tP.default)(),IM.A.openPrivateChannel({recipientIds:t}),(0,IV.N)(Ik.YA.CONTENT_AND_SOCIAL_PARENTAL_CONTROLS_NOTICE,Ik.YX.LEARN_MORE)},[t]),i=g.useCallback(()=>{(0,IV.N)(Ik.YA.CONTENT_AND_SOCIAL_PARENTAL_CONTROLS_NOTICE,Ik.YX.VIEWED)},[]);return g.useMemo(()=>{if(e)return{type:d.lT.INLINE_NOTICE,noticeType:"info",trackView:i,text:j.intl.format(fK.default.i284fU,{hook:(e,t)=>(0,c.jsx)(aL.Anchor,{onClick:n,children:e},t),count:t.length})}},[n,e,t.length,i])}let IF=(0,a.zD)(o.X.CLIPS_ALLOW_VOICE_RECORDING_SETTING,{useTitle:()=>j.intl.string(j.t.AGDDkH),useSubtitle:()=>j.intl.string(j.t.kyo3dJ),useValue:()=>v.Q$.useSetting(),setValue:e=>It.eQ({allowVoiceRecording:e})});var IB=n(157559),Iz=n(331887);function IX(){let e=(0,m.bG)([l1.default],()=>l1.default.getCurrentUser()),t=(0,m.bG)([Iz.A],()=>Iz.A.harvestType),[n,i]=g.useState(()=>Date.now()),l=null==t?n:new Date(t.created_at).getTime()+2592e6,s=g.useRef(null);return(g.useEffect(()=>{let e=l-Date.now();if(e>0){let t=setTimeout(()=>i(Date.now()),e);clearTimeout(s.current),s.current=t}return()=>clearTimeout(s.current)},[l]),e?.verified)?e.isStaff()?{allowed:!1,reason:"staff"}:null==t?{allowed:!0}:l>n?{allowed:!1,reason:"rate_limited",nextAllowed:new Date(l)}:{allowed:!0}:{allowed:!1,reason:"not_verified"}}let IY=(0,a.Tf)(o.X.DATA_HARVEST_REQUEST_SETTING,{useTitle:()=>j.intl.string(j.t.qfFFos),useSubtitle:function(){let e=IX();if(e.allowed)return j.intl.format(j.t.NRI6vt,{article:eS.A.getArticleURL(A.MVz.GDPR_REQUEST_DATA)});switch(e.reason){case"staff":return j.intl.string(j.t.hIbRso);case"not_verified":return j.intl.format(j.t.rBqJDq,{settingsLink:(e,t)=>(0,c.jsx)(t8.D,{tag:"a",onClick:()=>(0,t9.openUserSettings)(o.X.ACCOUNT_INFO_EMAIL_SETTING),children:e},t)});case"rate_limited":{let t=ii()(e.nextAllowed).format("MMMM Do YYYY");return j.intl.format(j.t["VLMG1+"],{date:t})}default:return}},initialize:()=>{e2.h.dispatch({type:"LOAD_DATA_HARVEST_TYPE_START"}),e1.Bo.get({url:A.Rsh.USER_HARVEST,oldFormErrors:!0,rejectWithError:!1}).then(e=>{e2.h.dispatch({type:"UPDATE_DATA_HARVEST_TYPE",harvestType:e.body})}).catch(e=>{e2.h.dispatch({type:"LOAD_DATA_HARVEST_TYPE_FAILURE",error:e})})},useDisabled:()=>!IX().allowed,useLoading:()=>(0,m.bG)([Iz.A],()=>Iz.A.requestingHarvest),useVariant:()=>"secondary",useLabel:()=>j.intl.string(j.t.dmBSKo),onClick:function(){return new Promise(e=>{let t=!0;!function(e){let{onConfirm:t,...i}=e;(0,ln.openModalLazy)(async()=>{let{default:e}=await n.e("92063").then(n.bind(n,970018));return n=>(0,c.jsx)(e,{modalProps:n,onConfirm:t})},i)}({onConfirm:n=>{t=!1,(0,Sw.$I)(n).then(e=>(null!=e&&null!=e.body&&e2.h.dispatch({type:"UPDATE_DATA_HARVEST_TYPE",harvestType:e.body}),e)).then(e=>{null!=e&&null!=e.body?IB.A.show({title:j.intl.string(j.t.i2iul5),body:j.intl.string(j.t["6Nmv4i"])}):IB.A.show({title:j.intl.string(j.t.OjbtDm),body:j.intl.string(j.t["0F5Jyt"])})},e=>{let t=e?.message||e?.body?.message||j.intl.string(j.t["0F5Jyt"]);IB.A.show({title:j.intl.string(j.t.OjbtDm),body:t})}).finally(e)},onCloseCallback:()=>{t&&e()}})})}}),IH=(0,a.v_)(o.X.DATA_USAGE_DISCLAIMER_SETTING,{useTitle:()=>j.intl.string(j.t.D60Gfj),useSubtitle:()=>j.intl.format(j.t.dszICC,{onClickDisable:()=>(0,t9.openUserSettings)(o.X.ACCOUNT_DISABLE_SETTING),onClickDelete:()=>(0,t9.openUserSettings)(o.X.ACCOUNT_DELETE_SETTING)})});var IK=n(972737);let IW=(0,a.zD)(o.X.DATA_USAGE_PERSONALIZATION_SETTING,{useTitle:()=>j.intl.string(j.t.MNKzyg),useSubtitle:()=>j.intl.format(j.t["2SiYln"],{helpdeskArticle:eS.A.getArticleURL(A.MVz.DATA_USED_FOR_RECOMMENDED)}),useValue:function(){return(0,m.bG)([IG.A],()=>IG.A.hasConsented(A.YAq.PERSONALIZATION))},setValue:function(e){e?(0,IP.U)([A.YAq.PERSONALIZATION],[]).catch(IK.i):(0,IK.O)({header:j.intl.string(j.t["9SNpzv"]),confirmText:j.intl.string(j.t["9g5UGw"]),cancelText:j.intl.string(j.t["+ZLPw9"]),onConfirm:()=>{(0,IP.U)([],[A.YAq.PERSONALIZATION]).catch(IK.i)},body:j.intl.string(j.t.gJvDDh)})},useDisabled:IU.uM});var IZ=n(884705);function Iq(){return(0,m.bG)([IZ.A],()=>IZ.A.isTogglesDisabled())}let IQ=(0,a.zD)(o.X.DATA_USAGE_QUESTS_3P_SETTING,{useTitle:()=>j.intl.string(j.t.CyLYKZ),useSubtitle:()=>j.intl.format(j.t["md5l4/"],{helpdeskArticle:eS.A.getArticleURL(A.MVz.QUESTS_PRIVACY_CONTROLS)}),useValue:function(){return!v.vf.useSetting()},setValue:function(e){v.vf.updateSetting(!e)},useDisabled:function(){let e=Iq(),t=v.H1.useSetting(),n=(0,IU.uM)();return e||t||n},useSearchTerms:()=>[j.intl.string(j.t.CyLYKZ)]}),IJ=(0,a.zD)(o.X.DATA_USAGE_QUESTS_SETTING,{useTitle:()=>j.intl.string(j.t.sJYh5t),useSubtitle:()=>j.intl.string(j.t.w4fvxe),useValue:function(){return!v.H1.useSetting()},setValue:function(e){v.H1.updateSetting(!e)},useSearchTerms:()=>[j.intl.string(j.t.VkS7Yd)],useDisabled:function(){let e=Iq(),t=(0,IU.uM)();return e||t}}),I$=(0,a.AK)(o.X.DATA_USAGE_ACTIVITY_PRIVACY_NAVIGATOR,{destinationKey:o.X.REGISTERED_GAMES_PANEL,useSubtitle:function(){let{names:e,totalCount:t}=AR(2);return j.intl.format(j.t.GaTAYM,{count:t,nameCount:e.length,game1:e[0],game2:e[1]})},useTrailingDecoration:()=>{let e=AP();return{type:d.wF.STACKED_ICONS,icons:e}},usePredicate:()=>(0,m.bG)([iH.Ay],()=>iH.Ay.getGamesSeen(!1).some(e=>!(0,Ay.n1)(e)))&&(0,no.xl)()}),I0=(0,a.gN)(o.X.DATA_USAGE_RELATED_SETTINGS,{buildLayout:()=>[I$]}),I1=(0,a.zD)(o.X.DATA_USAGE_STATISTICS_SETTING,{useTitle:()=>j.intl.string(j.t.XuADY2),useSubtitle:()=>j.intl.format(j.t.FNqmmX,{helpdeskArticle:eS.A.getArticleURL(A.MVz.DATA_PRIVACY_CONTROLS)}),useValue:function(){return(0,m.bG)([IG.A],()=>IG.A.hasConsented(A.YAq.USAGE_STATISTICS))},setValue:function(e){e?(0,IP.U)([A.YAq.USAGE_STATISTICS],[]).catch(IK.i):(0,IK.O)({header:j.intl.string(j.t.OdPCbN),body:j.intl.string(j.t.MGWabA),confirmText:j.intl.string(j.t["D3+rU4"]),cancelText:j.intl.string(j.t.kYpG0u),onConfirm:()=>(0,IP.U)([],[A.YAq.USAGE_STATISTICS]).catch(IK.i)})},useSearchTerms:()=>[j.intl.string(j.t.XuADY2)],useDisabled:IU.uM}),I2=(0,a.zZ)(o.X.DATA_USAGE_CATEGORY,{useTitle:()=>j.intl.string(j.t.QDAriI),useInlineNotice:Iw,initialize:()=>{IG.A.fetchedConsents||(0,IP.Q)()},buildLayout:()=>[IH,I1,IW,IJ,IQ,IF,IY,I0]});var I3=n(567926);let I5=(0,a.zD)(o.X.NOTIFY_FRIENDS_ON_PROFILE_UPDATE_SETTING,{useTitle:()=>j.intl.string(I3.default.F3llsQ),useSubtitle:()=>j.intl.string(I3.default["6goWcz"]),useValue:v.Sy.useSetting,setValue:function(e){v.Sy.updateSetting(e),e7.default.track(A.HAw.NOTIFICATION_SETTINGS_UPDATED,{update_type:Ak.Y.ACCOUNT,notify_friends_on_profile_update:e})}});function I6(){let e=v.JG.useSetting();return(0,m.yK)([u8.Ay,lc.A],()=>{let t=new Set(e);return u8.Ay.getFlattenedGuildIds().filter(e=>null!=lc.A.getGuild(e)&&!t.has(e))},[e])}let I4=(0,a.AK)(o.X.PROFILE_PRIVACY_TO_ACTIVITY_PRIVACY_NAVIGATOR,{useSubtitle:function(){let e=I6();if(0===e.length)return j.intl.format(j.t.QJIJ5p,{});let t=lc.A.getGuild(e[0]),n=t?.name??"",i=e.length-1;return 0===i?j.intl.format(j.t["T+8J4A"],{guildName:n}):j.intl.format(j.t["3JyODQ"],{guildName:n,count:i})},useTrailingDecoration:function(){let e,t,n=(e=I6(),0===(t=(0,m.yK)([lc.A],()=>e.slice(0,2).map(e=>lc.A.getGuild(e)).filter(e=>null!=e),[e])).length?null:t.length>=2?{frontIcon:{icon:(0,c.jsx)(A$,{guild:t[0],size:Av.CD}),shape:Av.e0.SQUIRCLE},backIcon:{icon:(0,c.jsx)(A$,{guild:t[1],size:Av.CD}),shape:Av.e0.SQUIRCLE}}:{frontIcon:{icon:(0,c.jsx)(A$,{guild:t[0],size:Av.CD}),shape:Av.e0.SQUIRCLE}});return{type:d.wF.STACKED_ICONS,icons:n}},destinationKey:o.X.ACTIVITY_PRIVACY_PANEL}),I8=(0,a.gN)(o.X.PROFILE_PRIVACY_RELATED_SETTINGS,{usePredicate:()=>(0,AB.lX)("ProfilePrivacyRelatedSettings"),buildLayout:()=>[I4]}),I7=(0,a.Qx)(o.X.PROFILE_PRIVACY_SETTING,{usePredicate:()=>(0,AB.lX)("ProfilePrivacySetting"),useTitle:()=>j.intl.string(j.t.Qnf32C),useOptions:function(){return[{name:j.intl.string(j.t.Boxc8R),desc:j.intl.string(j.t["nLj+nc"]),value:ek.KP.FRIENDS_AND_ALL_GUILDS},{name:j.intl.string(j.t.YOIKBt),desc:j.intl.string(j.t.y0JZ4s),value:ek.KP.FRIENDS_AND_SMALL_GUILDS},{name:j.intl.string(j.t.u0nlJv),desc:j.intl.string(j.t["4jnKHu"]),value:ek.KP.FRIENDS_ONLY}]},useValue:v.KP.useSetting,setValue:function(e){let t=v.KP.getSetting();if(v.KP.updateSetting(e),!(0,AB.W1)("ProfilePrivacySetting"))return;let i=(0,AK.gS)(t,e);null!=i&&(0,ln.openModalLazy)(async()=>{let{default:e}=await Promise.all([n.e("81849"),n.e("62041"),n.e("63786")]).then(n.bind(n,413201));return t=>(0,c.jsx)(e,{...t,direction:i.direction,affectedGuildIds:i.affectedGuildIds,settingName:i.settingName,mappedActivityValue:i.mappedActivityValue})})},useSearchTerms:()=>[j.intl.string(j.t.Qnf32C)]}),I9=(0,a.zZ)(o.X.PROFILE_PRIVACY_CATEGORY,{useTitle:()=>j.intl.string(j.t.ul884f),useSubtitle:()=>j.intl.format(j.t.N4jSgR,{learnMoreUrl:eS.A.getArticleURL("38859942749463-Profile-Privacy-Setting-on-Discord")}),buildLayout:()=>[I7,I5,I8]});var _e=n(936388),_t=n(714763),_n=n(814278);let _i=(0,a.zD)(o.X.PERSISTENT_VERIFICATION_CODES_SETTING,{useTitle:()=>j.intl.string(j.t["opi/XK"]),useSubtitle:()=>j.intl.format(j.t["/T+ZlP"],{helpArticle:(0,_n.Lu)()}),useValue:function(){return(0,m.bG)([_t.A],()=>_t.A.getPersistentCodesEnabled())},setValue:function(e){_e.A.updatePersistentCodesEnabled(e)}});var _l=n(787392);function _s(){return(0,m.yK)([_l.A],()=>_l.A.getUserIds())}var _r=n(803306),_a=n(966327),_o=n(509531);function _u(e){let{userId:t,count:n}=e,{analyticsLocations:i}=(0,eL.Ay)(),l=(0,m.bG)([l1.default],()=>l1.default.getUser(t)),s=xz.Ay.getFormattedName(l),r=g.useCallback(()=>{(0,_n.kj)(t)},[t]),a=g.useCallback(()=>(0,SY.openUserProfileModal)({userId:t,sourceAnalyticsLocations:i}),[t,i]);return g.useEffect(()=>{(0,_r.getUser)(t)},[t]),(0,c.jsxs)("div",{className:_o.uW,children:[null!=l&&(0,c.jsx)(_a.A,{className:_o.my,user:l,size:T._3.SIZE_40}),(0,c.jsxs)("div",{className:_o.Qq,children:[(0,c.jsx)(t8.D,{className:_o.Xh,onClick:a,children:(0,c.jsx)(z.E,{variant:"text-md/semibold",color:"interactive-text-active",children:s})}),(0,c.jsx)(z.E,{variant:"text-md/medium",color:"text-default",children:j.intl.format(j.t["/MBjYF"],{count:n})})]}),(0,c.jsx)(t8.D,{onClick:r,className:_o.Qz,children:(0,c.jsx)(i6.u,{size:"xs"})})]})}function _d(e){let{className:t,userId:n,verification:i,index:l}=e,s=(0,_n.tC)(i.timestamp),r=g.useCallback(()=>{(0,_n.W0)(n,i.verifiedKey)},[i.verifiedKey,n]);return(0,c.jsxs)("div",{className:t,children:[(0,c.jsxs)("div",{className:_o.Qq,children:[(0,c.jsx)(z.E,{variant:"text-sm/semibold",color:"interactive-text-active",children:j.intl.format(j.t.N4qBBO,{index:l+1})}),(0,c.jsx)(z.E,{variant:"text-sm/medium",color:"text-default",children:s})]}),(0,c.jsx)(t8.D,{className:_o.Kk,onClick:r,children:(0,c.jsx)(hd.P,{size:"md",color:nK.A.colors.INTERACTIVE_TEXT_DEFAULT})})]})}function _c(e){let{userId:t}=e,n=(0,m.yK)([_l.A],()=>k()(_l.A.getUserVerifiedKeys(t)).entries().map(e=>{let[t,n]=e;return{verifiedKey:t,timestamp:n}}).sortBy(e=>-1*e.timestamp).value());return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(_u,{userId:t,count:n.length}),n.map((e,i)=>(0,c.jsxs)(g.Fragment,{children:[(0,c.jsx)(_d,{className:_o.nM,userId:t,index:i,verification:e}),i!==n.length-1&&(0,c.jsx)("div",{className:_o.yF})]},`${i}-${e.timestamp}`))]})}var _g=n(464946),_m=n(756625);let _A=(0,a.E2)(o.X.USERS_VERIFIED_KEYS_LIST_SETTING,{useSearchTerms:()=>[j.intl.string(j.t["5b3FNI"])],usePredicate:function(){let e=_s();return null!=e&&e.length>0},Component:function(){let e=_s();return(0,c.jsxs)(_g.h,{children:[(0,c.jsx)(_g._,{header:j.intl.string(j.t["5b3FNI"]),description:j.intl.format(j.t.jrTSWU,{helpArticle:(0,_n.dc)()})}),e.map(e=>(0,c.jsx)("div",{className:_m.A,children:(0,c.jsx)(_c,{userId:e})},e))]})}}),_h=(0,a.zZ)(o.X.VOICE_SECURITY_CATEGORY,{useTitle:()=>j.intl.string(j.t.bTwjaz),usePredicate:()=>(0,eW.isDesktop)(),buildLayout:()=>[_i,_A]}),_E=(0,a.t_)(o.X.DATA_AND_PRIVACY_PANEL,{useTitle:()=>j.intl.string(j.t.OAuOHD),buildLayout:()=>[I2,I9,_h]}),_S=(0,a.i4)(o.X.DATA_AND_PRIVACY_SIDEBAR_ITEM,{useTitle:()=>j.intl.string(j.t.OAuOHD),icon:IR.m,buildLayout:()=>[_E]});var _x=n(476713);let _T=(0,a.AK)(o.X.CONNECTED_GAMES_AUTHORIZED_APPS_NAVIGATOR,{useSubtitle:()=>j.intl.string(j.t.O65dzZ),useTitle:()=>j.intl.string(j.t["f6kk+r"]),destinationKey:o.X.AUTHORIZED_APPS_CATEGORY}),_p=(0,a.gN)(o.X.CONNECTED_GAMES_RELATED_SETTINGS,{buildLayout:()=>[_T]});var _f=n(875444);function _I(e,t){let n=(0,m.bG)([hN.default],()=>hN.default.getFetchState()),i=(0,m.bG)([hN.default],()=>e?hN.default.getNewestTokensForNonChildrenApplications():hN.default.getNewestTokens()),l=g.useMemo(()=>null==i?[]:i.filter(e=>(0,_f.O)(e.application,e.scopes)).map(e=>e.application),[i]);return g.useEffect(()=>{t||hs.A.fetch()},[t]),{showLoadingIndicator:n!==hN.FetchState.FETCHED&&(null==i||0===i.length),slayerSdkApplications:l}}var __=n(390646);function _N(){return(0,c.jsxs)("div",{className:__.d,children:[(0,c.jsx)(z.E,{variant:"text-md/medium",color:"text-strong",className:__.x,children:j.intl.string(j.t["+0U77d"])}),(0,c.jsx)(z.E,{variant:"text-sm/normal",color:"text-muted",children:j.intl.format(j.t.V8wClM,{helpdeskArticle:eS.A.getArticleURL(A.MVz.SOCIAL_LAYER_CONNECTIONS)})})]})}let _C=(0,a.E2)(o.X.CONNECTED_GAMES_UNAVAILABLE,{Component:function(){let{showLoadingIndicator:e}=_I(!0,!0);return e?(0,c.jsx)(aY.y,{}):(0,c.jsx)(_N,{})},useSearchTerms:()=>[j.intl.string(j.t["+0U77d"])],usePredicate:()=>{let{showLoadingIndicator:e,slayerSdkApplications:t}=_I(!0,!0);return e||0===t.length}});function _b(){let{showLoadingIndicator:e,slayerSdkApplications:t}=_I(!0,!0);return!e&&t.length>0}let _y=(0,a.zD)(o.X.ALLOW_GAME_FRIEND_DMS_SETTING,{useTitle:()=>j.intl.string(j.t.W8JtfT),useSubtitle:()=>j.intl.string(j.t.a99KKy),useSearchTerms:()=>[j.intl.string(j.t["Uv/eTx"])],useValue:()=>v.Zk.useSetting(),setValue:e=>v.Zk.updateSetting(e),usePredicate:_b}),_v=(0,a.Qx)(o.X.IN_GAME_DMS_SETTING,{useTitle:()=>j.intl.string(j.t["ms+Tme"]),useSubtitle:()=>j.intl.string(j.t["0ryspy"]),useOptions:function(){return[{name:j.intl.string(j.t.JIFnN9),value:ek.fL.SLAYER_SDK_RECEIVE_IN_GAME_DMS_ALL},{name:j.intl.string(j.t.rRdsk1),value:ek.fL.SLAYER_SDK_RECEIVE_IN_GAME_DMS_USERS_WITH_GAME},{name:j.intl.string(j.t.IVRPMX),value:ek.fL.SLAYER_SDK_RECEIVE_IN_GAME_DMS_NONE}]},useValue:function(){let e=v.TA.useSetting();return e===ek.fL.SLAYER_SDK_RECEIVE_IN_GAME_DMS_UNSET?ek.fL.SLAYER_SDK_RECEIVE_IN_GAME_DMS_ALL:e},setValue:e=>v.TA.updateSetting(e),usePredicate:_b});function _j(){let{slayerSdkApplications:e,showLoadingIndicator:t}=_I(!0,!0);return{sortedGames:g.useMemo(()=>e.toSorted((e,t)=>a3.default.compare(t.id,e.id)),[e]),showLoadingIndicator:t}}n(839272);var _O=n(687123),_L=n(444802);function _D(){let e=(0,_L.WX)();g.useEffect(()=>{(0,IV.N)(Ik.YA.AGE_CONFIRMATION_NOTICE,Ik.YX.VIEWED)},[]);let t=g.useCallback(()=>{window.open(eS.A.getArticleURL(e),"_blank"),(0,IV.N)(Ik.YA.AGE_CONFIRMATION_NOTICE,Ik.YX.LEARN_MORE)},[e]),n=g.useCallback(()=>{pf.A.showAgeVerificationGetStartedModal({entryPoint:pI.q1.CONTENT_AND_SOCIAL_NOTICE}),(0,IV.N)(Ik.YA.AGE_CONFIRMATION_NOTICE,Ik.YX.CONFIRM_AGE)},[]);return(0,c.jsx)(rM.p,{messageType:rM.Y.INFO,action:(0,c.jsx)(Ai.Q,{variant:"secondary",size:"sm",textVariant:"text-sm/medium",text:j.intl.string(j.t.FDSSia),onClick:n}),children:j.intl.format(j.t.mFgsfg,{hook:(e,n)=>(0,c.jsx)(aL.Anchor,{onClick:t,children:e},n)})})}function _R(){let e=(0,ph.aX)(_O.t.REACTIVE_CHECK),t=(0,pA.b8)();return g.useMemo(()=>{if(e&&!t)return{type:d.lT.STRONGLY_DISCOURAGED_CUSTOM,notice:_D}},[e,t])}var _P=n(323073),_G=n(386171),_M=n(96607);let _U=(0,a.zD)(o.X.AGE_RESTRICTED_DM_SETTING,{useTitle:()=>j.intl.string(j.t.gvC6q7),useSubtitle:()=>j.intl.string(j.t.zirUC1),useValue:_G.hT,useDisabled:function(){let e=(0,_M.A)()??!0,t=(0,_P.sP)(),n=(0,pA.yM)();return(!t||!!n)&&!e},setValue:function(e){(0,_P.p5)()&&e?pf.A.showAgeVerificationGetStartedModal({entryPoint:pI.q1.AGE_RESTRICTED_DM_COMMANDS_SETTINGS}):v.Qe.updateSetting(e)}}),_V=(0,a.zD)(o.X.AGE_RESTRICTED_IOS_SETTING,{useTitle:()=>j.intl.string(j.t["L+yTsa"]),useSubtitle:()=>j.intl.string(j.t["t6i/jW"]),useValue:_G.tI,useDisabled:function(){let e=(0,_M.A)()??!0,t=(0,_P.sP)(),n=(0,pA.yM)();return g.useMemo(()=>(!t||!!n)&&!e,[t,e,n])},setValue:function(e){(0,_P.p5)()&&e?pf.A.showAgeVerificationGetStartedModal({entryPoint:pI.q1.AGE_RESTRICTED_SERVERS_ACCESS_SETTINGS}):v.Kg.updateSetting(e)}}),_k=(0,a.AK)(o.X.CONTENT_FILTERS_APPEARANCE_NAVIGATOR,{useSubtitle:()=>j.intl.string(j.t.hOXd45),destinationKey:o.X.APPEARANCE_MESSAGES_CATEGORY}),_w=(0,a.gN)(o.X.CONTENT_FILTERS_RELATED_SETTINGS,{buildLayout:()=>[_k]});n(667532);var _F=n(390248),_B=n(632119),_z=n(945276),_X=n(389737),_Y=n(566769);function _H(){let e,t=(0,_z.A)()??!0,n=(0,IU.uM)(),i=(0,IU.uM)(),{explicitContentGuilds:l,explicitContentFriendDm:s,explicitContentNonFriendDm:r}=(e=(0,aO.cf)([r2.A],()=>r2.A.settings.textAndImages?.explicitContentSettings??(0,_B.C$)()),{explicitContentGuilds:(0,_B.Ys)({setting:e?.explicitContentGuilds}),explicitContentNonFriendDm:(0,_B.Ys)({setting:e?.explicitContentNonFriendDm,isDm:!0}),explicitContentFriendDm:(0,_B.Ys)({setting:e?.explicitContentFriendDm,isDm:!0,isFriend:!0})});function a(e){let t=Object.values(e);(0,_F.hK)()&&t.includes(ek.TO.SHOW)?pf.A.showAgeVerificationGetStartedModal({entryPoint:pI.q1.SENSITIVE_MEDIA_FILTER_SETTINGS}):(0,_B.Jz)(e)}let o=[{value:ek.TO.BLUR,label:j.intl.string(j.t.S49Uad)},{value:ek.TO.BLOCK,label:j.intl.string(j.t["D/157Y"])}],u=[{value:ek.TO.BLUR,label:j.intl.string(j.t.S49Uad)}],d={value:ek.TO.SHOW,label:j.intl.string(j.t["5k5OFp"])};t&&(o.unshift(d),u.unshift(d));let g={isDisabled:i,tooltipText:n?j.intl.string(fK.default["6Af/cw"]):void 0};return(0,c.jsxs)(_X.E,{description:j.intl.string(j.t.Wnojv1),children:[(0,c.jsx)(_Y.A,{title:j.intl.string(j.t["+uI23H"]),value:s,onChange:e=>a({explicitContentFriendDm:e}),options:o,...g}),(0,c.jsx)(_Y.A,{title:j.intl.string(j.t["Yh+HX1"]),value:r,onChange:e=>a({explicitContentNonFriendDm:e}),options:o,...g}),(0,c.jsx)(_Y.A,{title:j.intl.string(j.t["FP+a42"]),value:l,onChange:e=>a({explicitContentGuilds:e}),isDisabled:!t||i,tooltipText:n?j.intl.string(fK.default["6Af/cw"]):void 0,options:u})]})}function _K(){let e,t=(0,_z.A)()??!0,n=(0,IU.uM)(),i=(0,IU.uM)(),{goreContentGuilds:l,goreContentFriendDm:s,goreContentNonFriendDm:r}=(e=(0,aO.cf)([r2.A],()=>r2.A.settings.textAndImages?.goreContentSettings??(0,_L.T4)()),{goreContentGuilds:(0,_L.gC)({setting:e?.goreContentGuilds}),goreContentNonFriendDm:(0,_L.gC)({setting:e?.goreContentNonFriendDm,isDm:!0}),goreContentFriendDm:(0,_L.gC)({setting:e?.goreContentFriendDm,isDm:!0,isFriend:!0})});function a(e){let t=Object.values(e);(0,_F.hK)()&&t.includes(ek.TO.SHOW)?pf.A.showAgeVerificationGetStartedModal({entryPoint:pI.q1.SENSITIVE_MEDIA_FILTER_SETTINGS}):(0,_L.qY)(e)}let o=[{value:ek.TO.BLUR,label:j.intl.string(j.t.S49Uad)},{value:ek.TO.BLOCK,label:j.intl.string(j.t["D/157Y"])}],u=[{value:ek.TO.BLUR,label:j.intl.string(j.t.S49Uad)}],d={value:ek.TO.SHOW,label:j.intl.string(j.t["5k5OFp"])};t&&(o.unshift(d),u.unshift(d));let g={isDisabled:i,tooltipText:n?j.intl.string(fK.default["6Af/cw"]):void 0};return(0,c.jsxs)(_X.E,{description:j.intl.string(j.t.XgH9eh),children:[(0,c.jsx)(_Y.A,{title:j.intl.string(j.t["+uI23H"]),value:s,onChange:e=>a({goreContentFriendDm:e}),options:o,...g}),(0,c.jsx)(_Y.A,{title:j.intl.string(j.t["Yh+HX1"]),value:r,onChange:e=>a({goreContentNonFriendDm:e}),options:o,...g}),(0,c.jsx)(_Y.A,{title:j.intl.string(j.t["FP+a42"]),value:l,onChange:e=>a({goreContentGuilds:e}),isDisabled:!t||i,options:u,tooltipText:n?j.intl.string(fK.default["6Af/cw"]):void 0})]})}var _W=n(875162),_Z=n(428275);let _q=(0,a.E2)(o.X.CONTENT_FILTERS_SETTING,{Component:function(){let e=(0,_L.WX)(),t=g.useMemo(()=>[{id:"explicit-media-redaction",title:j.intl.string(j.t.GYpoAq),component:_H,orientation:"vertical"},{id:"gore-media-redaction",title:j.intl.string(j.t["16/3Bi"]),component:_K,orientation:"vertical"}],[]);return(0,c.jsxs)(_g.h,{children:[(0,c.jsx)(_g._,{header:j.intl.string(j.t["Hj/But"]),description:j.intl.format(j.t.dliU4j,{learnMoreLink:eS.A.getArticleURL(e)})}),(0,c.jsx)(_W.A,{tabs:t,orientation:"vertical",tabsClassName:_Z.v})]})},useSearchTerms:()=>[j.intl.string(j.t["Hj/But"]),j.intl.string(j.t["N/oRI+"]),j.intl.string(j.t.QVdYsK),j.intl.string(j.t["aWD+tu"]),j.intl.string(j.t["5mnTa7"]),j.intl.string(j.t["K0OWP+"])]});var _Q=n(639555),_J=n(617641),_$=n(546140),_0=n(406935),_1=n(594061);let _2=(0,a.zD)(o.X.DM_SAFETY_ALERTS_SETTING,{useTitle:()=>j.intl.string(j.t.qFsx5q),useSubtitle:()=>j.intl.format(j.t.lunaRv,{learnMoreLink:eS.A.getArticleURL(A.MVz.SAFETY_ALERTS)}),useValue:_$.L,setValue:function(e){return _1.wc.updateAsync("privacy",t=>{t.inappropriateConversationWarnings=_0._t.create({value:e})},_1.Sb.INFREQUENT_USER_ACTION)},usePredicate:function(){let e=(0,_J.Lc)({location:"DMSafetyAlertsSetting"}),t=(0,_Q.Rv)({location:"DMSafetyAlertsSetting"}),n=(0,_z.A)()??!0;return e&&!n&&!t}}),_3=(0,a.zZ)(o.X.CONTENT_CATEGORY,{useTitle:()=>j.intl.string(j.t["3upKU8"]),useInlineNotice:function(){let e,t,n,i,l,s,r,a,o,u=Iw(),m=(e=(0,fY.Z)(),t=(0,_L.WX)(),n=g.useCallback(()=>{window.open(eS.A.getArticleURL(t),"_blank"),(0,IV.N)(Ik.YA.SENSITIVE_CONTENT_FILTER_TEEN_NOTICE,Ik.YX.LEARN_MORE)},[t]),i=g.useCallback(()=>{(0,IV.N)(Ik.YA.SENSITIVE_CONTENT_FILTER_TEEN_NOTICE,Ik.YX.VIEWED)},[]),g.useMemo(()=>{if(e)return{type:d.lT.INLINE_NOTICE,noticeType:"info",trackView:i,text:j.intl.format(j.t.EUo0yj,{hook:(e,t)=>(0,c.jsx)(aL.Anchor,{onClick:n,children:e},t)})}},[n,e,i])),A=(l=(0,ph.SJ)(),s=(0,pA.b8)(),r=l&&!s,a=g.useCallback(()=>{pf.A.showAgeVerificationGetStartedModal({entryPoint:pI.q1.CONTENT_AND_SOCIAL_NOTICE}),(0,IV.N)(Ik.YA.SENSITIVE_CONTENT_FILTER_AGE_VERIFICATION_NOTICE,Ik.YX.LEARN_MORE)},[]),o=g.useCallback(()=>{(0,IV.N)(Ik.YA.SENSITIVE_CONTENT_FILTER_AGE_VERIFICATION_NOTICE,Ik.YX.VIEWED)},[]),g.useMemo(()=>{if(r)return{type:d.lT.INLINE_NOTICE,noticeType:"info",trackView:o,text:j.intl.format(j.t.OX4ybh,{hook:(e,t)=>(0,c.jsx)(aL.Anchor,{onClick:a,children:e},t)})}},[a,r,o])),h=_R();return u??h??A??m},buildLayout:()=>[_q,_2,_U,_V,_w]});var _5=n(923457),_6=n(750714);let _4=(0,a.Qx)(o.X.DM_SPAM_SETTING,{useTitle:()=>j.intl.string(j.t.puwSkY),useSubtitle:()=>j.intl.string(j.t["+sXN3T"]),useValue:function(){let e=v.he.useSetting(),t=v.cj.useSetting(),n=(0,m.bG)([l1.default],()=>l1.default.getCurrentUser()),i=(0,ph.yv)(_5.p.SPAM_FILTERS);return e!==ek.he.DEFAULT_UNSET?e:n?.nsfwAllowed===!1&&i?ek.he.FRIENDS_AND_NON_FRIENDS:_6.xY.get(t)??ek.he.NON_FRIENDS},setValue:e=>v.he.updateSetting(e),useOptions:function(){return[{name:j.intl.string(j.t["+w5yKk"]),value:ek.he.FRIENDS_AND_NON_FRIENDS},{name:j.intl.string(j.t.yAPg6r),value:ek.he.NON_FRIENDS},{name:j.intl.string(j.t.FEXKsv),value:ek.he.DISABLED}]},useSearchTerms:()=>[j.intl.string(j.t.JzaP4h),j.intl.string(j.t.H9XOl3),j.intl.string(j.t.k4W40P)]});var _8=n(189883);let _7=(0,a.zD)(o.X.FRIEND_REQUESTS_EVERYONE_SETTING,{useTitle:()=>j.intl.string(j.t["7x9dyE"]),useValue:function(){let e=v.FA.useSetting();return g.useMemo(()=>(0,n2.Lx)(e),[e]).all},setValue:function(e){v.FA.updateSetting(e?A.yKI:A.yKI&~A.dzt.NO_RELATION)},useDisabled:function(){return(0,IU.uM)()}});var _9=n(665260);let Ne=(0,a.zD)(o.X.FRIEND_REQUESTS_MUTUAL_FRIENDS_SETTING,{useTitle:()=>j.intl.string(j.t.NfeuZ3),useValue:function(){let e=v.FA.useSetting(),t=g.useMemo(()=>(0,n2.Lx)(e),[e]);return t.all||t.mutualFriends},setValue:function(e){let t=v.FA.getSetting();v.FA.updateSetting(e?_9.UI(t,A.dzt.MUTUAL_FRIENDS):_9.iE(t,A.dzt.MUTUAL_FRIENDS,A.dzt.NO_RELATION))},useDisabled:function(){return(0,IU.uM)()}}),Nt=(0,a.zD)(o.X.FRIEND_REQUESTS_MUTUAL_GUILDS_SETTING,{useTitle:()=>j.intl.string(j.t.qsMfsH),useSubtitle:()=>j.intl.string(j.t["6DqAp0"]),useValue:function(){let e=v.FA.useSetting(),t=g.useMemo(()=>(0,n2.Lx)(e),[e]);return t.all||t.mutualGuilds},setValue:function(e){let t=v.FA.getSetting();v.FA.updateSetting(e?_9.UI(t,A.dzt.MUTUAL_GUILDS):_9.iE(t,A.dzt.MUTUAL_GUILDS,A.dzt.NO_RELATION))},useDisabled:function(){return(0,IU.uM)()}}),Nn=(0,a.FW)(o.X.FRIEND_REQUESTS_FIELDSET,{useTitle:()=>j.intl.string(j.t.wTdS6S),buildLayout:()=>[_7,Ne,Nt]}),Ni=(0,a.zD)(o.X.FRIEND_REQUESTS_NOTES_SETTING,{useTitle:()=>j.intl.string(j.t["jK+wdr"]),useSubtitle:()=>j.intl.string(j.t["RYh/pW"]),useValue:()=>!v.Zd.useSetting(),setValue:function(e){v.Zd.updateSetting(!e)},usePredicate:()=>_8.A.useConfig({location:"Friend Request Setting"}).enabled,usePersistentBadge:()=>({badgeType:d.Xi.BETA})}),Nl=(0,a.zZ)(o.X.FRIEND_REQUESTS_CATEGORY,{useTitle:()=>j.intl.string(j.t["5gxWrt"]),useSubtitle:function(){let{enabled:e}=_8.A.useConfig({location:"Friend Request Setting"});return e?j.intl.string(j.t.QVbF3l):void 0},useSubnavLabel:()=>j.intl.string(j.t.fyA115),useInlineNotice:Iw,buildLayout:()=>[Nn,Ni]});var Ns=n(994500),Nr=n(428678),Na=n(717398),No=n(730134),Nu=n(943646);function Nd(e){let{listType:t,numberOfUsers:n}=e,i="blocked"===t;return(0,c.jsxs)("div",{className:Nu.wx,children:[(0,c.jsx)("div",{className:Nu.zc,children:i?(0,c.jsx)(Nr.K,{}):(0,c.jsx)(SE.G,{})}),(0,c.jsxs)("div",{className:Nu.Qq,children:[(0,c.jsx)(z.E,{variant:"text-md/semibold",color:"interactive-text-active",children:j.intl.string(i?j.t.PFOUKW:j.t["93ZDWE"])}),(0,c.jsx)(z.E,{variant:"text-md/medium",color:"text-default",children:i?j.intl.format(j.t["r91W/h"],{numberOfBlockedUsers:n}):j.intl.format(j.t.rXUeOl,{numberOfIgnoredUsers:n})})]})]})}function Nc(e){let{userId:t,last:n}=e,i=(0,m.bG)([Ns.A],()=>Ns.A.isBlocked(t)),l=(0,m.bG)([l1.default],()=>l1.default.getUser(t)),[s,r]=g.useState(!1),a=g.useCallback(()=>{r(!0),i?Na.A.unblockUser(t).catch(()=>{r(!1)}):Na.A.unignoreUser(t,tv.A.USER_SETTINGS).catch(()=>{r(!1)})},[i,t]);return null==l?null:(0,c.jsxs)("div",{className:ie()(Nu.nM,{[Nu.fW]:n}),children:[(0,c.jsxs)("div",{className:Nu.eF,children:[(0,c.jsx)(No.A,{user:l,size:T._3.SIZE_40}),(0,c.jsxs)("div",{className:Nu.Qq,children:[(0,c.jsx)(z.E,{variant:"text-md/semibold",color:"text-strong",children:l.globalName??l.username}),(0,c.jsx)(z.E,{variant:"text-sm/medium",color:"text-default",children:null!=l.globalName?l.username:null})]})]}),(0,c.jsx)(p.$,{variant:"secondary",text:j.intl.string(i?j.t.XyHpKH:j.t["8wXU9B"]),onClick:a,loading:s})]})}function Ng(e){let{userIds:t,listType:n}=e,[i,l]=g.useState(5);return(0,c.jsx)(_g.h,{children:(0,c.jsxs)("div",{className:Nu.Nr,children:[(0,c.jsx)(Nd,{listType:n,numberOfUsers:t.length}),(0,c.jsx)("div",{className:Nu.jS,children:t.slice(0,i).map((e,n)=>(0,c.jsx)(Nc,{userId:e,last:n===t.length-1},e))}),i<t.length?(0,c.jsx)("div",{className:Nu.vM,children:(0,c.jsx)(t8.D,{onClick:function(){l(e=>e+5)},className:Nu.Qf,children:(0,c.jsx)(z.E,{variant:"text-sm/semibold",color:"text-default",children:j.intl.format(j.t.jULEDr,{numberOfUsers:i+5<t.length?5:t.length-i})})})}):null]})})}let Nm=(0,a.E2)(o.X.BLOCKED_USERS,{useSearchTerms:()=>[j.intl.string(j.t.PFOUKW)],usePredicate:()=>(0,m.bG)([Ns.A],()=>Ns.A.getBlockedIDs().length>0),Component:function(){let e=(0,m.yK)([Ns.A],()=>Ns.A.getBlockedIDs());return(0,c.jsx)(Ng,{userIds:e,listType:"blocked"})}}),NA=(0,a.E2)(o.X.IGNORED_USERS,{useSearchTerms:()=>[j.intl.string(j.t["93ZDWE"])],usePredicate:()=>(0,m.bG)([Ns.A],()=>Ns.A.getIgnoredIDs().length>0),Component:function(){let e=(0,m.yK)([Ns.A],()=>Ns.A.getIgnoredIDs());return(0,c.jsx)(Ng,{userIds:e,listType:"ignored"})}}),Nh=(0,a.zZ)(o.X.RESTRICTED_USERS_CATEGORY,{useTitle:()=>j.intl.string(j.t["+Iryf3"]),useSubtitle:()=>j.intl.format(j.t["0aNQo9"],{helpArticle:eS.A.getArticleURL(A.MVz.STEALTH_REMEDIATION_FEATURE_GUIDE)}),buildLayout:()=>[Nm,NA],usePredicate:function(){let{hasBlockedUsers:e,hasIgnoredUsers:t}=(0,m.cf)([Ns.A],()=>({hasBlockedUsers:Ns.A.getBlockedIDs().length>0,hasIgnoredUsers:Ns.A.getIgnoredIDs().length>0}));return t||e}});var NE=n(22385),NS=n(556534),Nx=n(111159),NT=n(152056),Np=n(467962);let Nf={label:()=>j.intl.string(j.t["32u1Dx"]),value:NE.YG};var NI=n(307863),N_=n(428031),NN=n(954225);function NC(){let e=(0,NS.Tx)(),t=(0,NS.q9)(),n=(0,NI.e)();return e===NE.YG?n?j.intl.string(j.t.XXGmuB):j.intl.string(j.t.wbYDfT):t?j.intl.string(j.t.V0ka0Q):n?j.intl.string(j.t.F9WY3f):j.intl.string(j.t.G7c3Xo)}function Nb(e,t){e7.default.track(A.HAw.GUILD_DEFAULT_DMS_UPDATED,{default_guilds_restricted:e,applied_to_existing_guilds:t})}let Ny=(0,a.zD)(o.X.PERMISSIONS_DMS_SETTING,{useTitle:NC,useValue:function(){let e=(0,NS.Tx)(),t=v.$s.useSetting().includes(e),n=(0,N_.K)();return e===NE.YG?!n:!t},useDisabled:function(){let e=(0,IU.uM)();return(0,NS.Tx)()===NE.YG&&e},setValue:function(e){let t=NE.xk.getState().selectedGuildId;if(t===NE.YG){var n;n=!e,(0,IK.O)({header:j.intl.string(j.t["uUr+GR"]),body:j.intl.string(j.t.hjGJBp),confirmText:j.intl.string(j.t.gm1Vej),cancelText:j.intl.string(j.t.p89ACt),confirmButtonColor:s_.$n.Colors.BRAND,onConfirm:function(){v.n6.updateSetting(n),Nb(n,!1)},onCancel:function(){v.n6.updateSetting(n),v.$s.updateSetting(n?lc.A.getGuildIds():[]),Nb(n,!0)}})}else{let n=(0,n2.Tb)();e?n.delete(t):n.add(t),v.$s.updateSetting(Array.from(n)),e7.default.track(A.HAw.USER_SERVER_PRIVACY_SETTINGS_ACTION,{action:NN.m.DIRECT_MESSAGES_TOGGLE,ingress:eI.bf.USER_SETTINGS_PRIVACY_SAFETY,guild_id:t})}}});var Nv=n(953298);function Nj(e,t){e7.default.track(A.HAw.GUILD_DEFAULT_MESSAGE_REQUEST_UPDATED,{default_guilds_restricted:e,applied_to_existing_guilds:t})}function NO(){return(0,NS.q9)()?j.intl.string(j.t["982I7+"]):j.intl.string(j.t["3yHM5i"])}let NL=(0,a.zD)(o.X.PERMISSIONS_MESSAGE_REQUESTS_SETTING,{useTitle:NO,useSubtitle:()=>j.intl.format(j.t.BoCjTy,{learnMoreUrl:eS.A.getArticleURL(A.MVz.MESSAGE_REQUESTS)}),useValue:function(){let e=(0,NS.Tx)(),t=(0,N_.K)(),n=v.$s.useSetting().includes(e),i=v.YX.useSetting(),l=v.Zr.useSetting().includes(e);return e===NE.YG?!t&&!i:!n&&!l},useDisabled:function(){let e=(0,NS.Tx)(),t=(0,IU.uM)(),n=(0,N_.K)(),i=v.$s.useSetting().includes(e);return e===NE.YG?n||t:i},setValue:function(e){let t=NE.xk.getState().selectedGuildId;if(!e&&(0,Nv.w)())return void pf.A.showAgeVerificationGetStartedModal({entryPoint:pI.q1.MESSAGE_REQUESTS_SETTINGS});if(t===NE.YG){var n;n=!e,(0,IK.O)({header:j.intl.string(j.t.yAfu1p),body:j.intl.string(j.t.Ry2z74),confirmText:j.intl.string(j.t.gm1Vej),cancelText:j.intl.string(j.t.p89ACt),confirmButtonColor:s_.$n.Colors.BRAND,onConfirm:function(){v.YX.updateSetting(n),Nj(n,!1)},onCancel:function(){v.YX.updateSetting(n),v.Zr.updateSetting(n?lc.A.getGuildIds():[]),Nj(n,!0)}})}else{let n=(0,n2.xo)();e?n.delete(t):n.add(t),v.Zr.updateSetting(Array.from(n)),e7.default.track(A.HAw.USER_SERVER_PRIVACY_SETTINGS_ACTION,{action:NN.m.RESTRICT_GUILD_MESSAGE_REQUEST_TOGGLE,ingress:eI.bf.USER_SETTINGS_PRIVACY_SAFETY,guild_id:t})}}}),ND=(0,a.E2)(o.X.PERMISSIONS_GUILD_SELECTOR,{useSearchTerms:function(){return[NC(),NO()]},Component:function(){let{selectedGuildId:e,setSelectedGuildId:t}=(0,NE.xk)(),n=(0,m.bG)([u8.Ay],()=>u8.Ay.getFlattenedGuildIds()),i=(0,m.bG)([lc.A],()=>lc.A.getGuilds()),l=n[0];g.useEffect(()=>NT.A.subscribe(e=>{let{query:t}=e;return t.trim()},(e,n)=>{let i=NE.xk.getState().selectedGuildId;""===n&&""!==e&&i===NE.YG&&null!=l?t(l):""===e&&i!==NE.YG&&t(NE.YG)},{equalityFn:(e,t)=>e===t}),[l,t]);let s=g.useMemo(()=>{let e=[];return e.push({...Nf,id:Nf.value,label:Nf.label(),leading:(0,c.jsx)("div",{className:Np.KP,children:(0,c.jsx)(Nx.p,{size:"sm",color:"white","aria-hidden":!0,className:Np.cl})})}),n.forEach(t=>{let n=i[t];null!=n&&e.push({id:n.id,label:n.name,value:n.id,leading:(0,c.jsx)(dd.Ay,{className:Np.cl,guild:n,size:dd.Ay.Sizes.SMALLER,active:!0})})}),e},[n,i]);return(0,c.jsx)(Sv.Z,{selectionMode:"single",onSelectionChange:function(e){t(e)},value:e,options:s})}}),NR=(0,a.zZ)(o.X.PERMISSIONS_CATEGORY,{useTitle:()=>j.intl.string(j.t.Y5GYcX),useSubnavLabel:()=>j.intl.string(j.t.YUU0RF),useInlineNotice:function(){let e=Iw(),t=_R();if((0,NS.Tx)()===NE.YG)return e??t},buildLayout:()=>[ND,Ny,NL]}),NP=(0,a.zZ)(o.X.SPAM_FILTERS_CATEGORY,{useTitle:()=>j.intl.string(j.t.Qwuoic),buildLayout:()=>[_4]}),NG=(0,a.zZ)(o.X.CONNECTED_GAMES_CATEGORY,{useTitle:()=>j.intl.string(j.t.RyvebU),useSubtitle:function(){let{sortedGames:e}=_j();function t(e,t){return(0,c.jsx)(z.E,{tag:"span",variant:"text-sm/normal",color:"text-default",children:e},t)}return 0===e.length?j.intl.string(j.t.Amr1IZ):1===e.length?j.intl.format(j.t["60IaC2"],{gameName:e[0].name,gameListHook:t}):2===e.length?j.intl.format(j.t.lthjd7,{game1:e[0].name,game2:e[1].name,gameListHook:t}):j.intl.format(j.t.RAUmQM,{game1:e[0].name,game2:e[1].name,remaining:e.length-2,gameListHook:t})},useSubnavLabel:()=>j.intl.string(j.t.YpCiMt),useHeaderDecoration:()=>{let e=function(){let{sortedGames:e}=_j();return g.useMemo(()=>{let t=e[0];if(null==t)return null;let n=e[1];return{frontIcon:{icon:(0,c.jsx)("img",{src:y.Ay.getApplicationIconURL({id:t.id,icon:t.icon}),alt:t.name,width:Av.CD,height:Av.CD}),shape:Av.e0.ROUNDED},...null!=n&&{backIcon:{icon:(0,c.jsx)("img",{src:y.Ay.getApplicationIconURL({id:n.id,icon:n.icon}),alt:n.name,width:Av.YP,height:Av.YP}),shape:Av.e0.ROUNDED}}}},[e])}();return{type:d.WX.STACKED_ICONS,icons:e}},useSearchTerms:()=>[j.intl.string(j.t.YpCiMt)],initialize:()=>{hs.A.fetch()},buildLayout:()=>[_y,_v,_C,_p]}),NM=(0,a.t_)(o.X.MESSAGING_PERMISSIONS_PANEL,{useTitle:()=>j.intl.string(j.t.Cz07t8),buildLayout:()=>[_3,NP,NR,Nl,NG,Nh]}),NU=(0,a.i4)(o.X.MESSAGING_PERMISSIONS_SIDEBAR_ITEM,{useTitle:()=>j.intl.string(j.t.Cz07t8),icon:_x.l,buildLayout:()=>[NM]});var NV=n(782603),Nk=n(899847),Nw=n(695515),NF=n(936926);let NB=(0,a.Hn)(o.X.MOBILE_NOTIFICATION_DELAY,{useTitle:()=>j.intl.string(j.t["8rHeOr"]),useSubtitle:()=>j.intl.string(j.t["eJE6+J"]),useValue:v.cU.useSetting,setValue:v.cU.updateSetting,useOptions:()=>V.range(1,11).map(e=>({id:e.toString(),value:60*e,label:j.intl.formatToPlainString(j.t.iXLF9W,{minutes:e})}))}),Nz=(0,a.zD)(o.X.TEXT_TO_SPEECH_COMMAND,{useTitle:()=>j.intl.string(j.t["btbS+Z"]),useSubtitle:()=>j.intl.format(j.t.Q5crhR,{onClick:()=>(0,t9.openUserSettings)(o.X.TTS_PLAYBACK_RATE)}),useValue:v.on.useSetting,setValue:v.on.updateSetting}),NX=(0,a.Qx)(o.X.TEXT_TO_SPEECH_NOTIFICATIONS,{useTitle:()=>j.intl.string(j.t.JZxxGx),useSubtitle:()=>j.intl.string(j.t.HDLtJl),useValue:()=>(0,m.bG)([an.A],()=>an.A.getTTSType()),setValue:e=>aa.default.setTTSType(e),useOptions:function(){return[{name:j.intl.string(j.t.B1AGeJ),value:A.aVn.ALL_CHANNELS},{name:j.intl.string(j.t.uzZg9e),value:A.aVn.SELECTED_CHANNEL},{name:j.intl.string(j.t.DYO5Oi),value:A.aVn.NEVER}]},usePredicate:()=>U.$j}),NY=o.X.NOTIFICATIONS_ADVANCED_ACCORDION,NH=(0,a.bd)(NY,{useTitle:e=>e?j.intl.string(j.t.RyimDk):j.intl.string(j.t.CUICbO),useCollapsedSubtitle:function(){return tc(NY,{formatter:e=>{let{title:t,index:n}=e;return"string"!=typeof t?t:0===n?`${t.charAt(0).toLocaleUpperCase()}${t.slice(1).toLocaleLowerCase()}`:t.toLocaleLowerCase()}})},buildLayout:()=>[NB,Nz,NX]}),NK=(0,a.zZ)(o.X.NOTIFICATIONS_ADVANCED_CATEGORY,{useTitle:()=>j.intl.string(j.t["31DySj"]),buildLayout:()=>[NH]}),NW=(0,a.zD)(o.X.ENABLE_UNREAD_MESSAGE_BADGE,{useTitle:()=>j.intl.string(j.t.VH8AIJ),useSubtitle:()=>j.intl.string(j.t["9K4qwX"]),useValue:function(){return(0,m.bG)([an.A],()=>!an.A.getDisableUnreadBadge())},setValue:e=>aa.default.setDisableUnreadBadge(!e)}),NZ=(0,a.zZ)(o.X.NOTIFICATIONS_BADGES_CATEGORY,{useTitle:()=>j.intl.string(j.t.l6w3Vj),buildLayout:()=>[NW]});var Nq=n(840559),NQ=n(997187),NJ=n(723923);let N$=NJ.px.map(e=>(0,a.zD)(`${o.X.EMAIL_LIST_ITEM_PREFIX}${e.category}`,{useTitle:e.label,useSubtitle:e.subLabel,useValue:()=>(function(e){let{categories:t}=(0,m.cf)([NQ.A],()=>NQ.A.getEmailSettings());return!!t[e]})(e.category),setValue:t=>(0,Nq.CA)(e.category,t)})),N0=(0,a.Tf)(o.X.UNSUBSCRIBE_FROM_ALL_MARKETING_EMAILS,{useTitle:()=>j.intl.string(j.t.Ra9Pwk),useSubtitle:()=>j.intl.string(j.t.iYjQ8X),useLabel:()=>j.intl.string(j.t.KT1pBA),useDisabled:function(){let{categories:e}=(0,m.cf)([NQ.A],()=>NQ.A.getEmailSettings());return NJ.Zk.every(t=>!e[t])},onClick:()=>(0,Nq.NI)(),useVariant:()=>"critical-secondary"}),N1=(0,a.zZ)(o.X.NOTIFICATIONS_EMAIL_CATEGORY,{useTitle:()=>j.intl.string(j.t["w/qqKK"]),initialize:function(){let{initialized:e}=NQ.A.getEmailSettings();e||(0,Nq.cR)()},buildLayout:()=>[...N$,N0]}),N2=(0,a.zD)(o.X.DESKTOP_NOTIFICATIONS,{useTitle:()=>j.intl.string(j.t["/0WCll"]),useSubtitle:()=>j.intl.string(j.t.wF9ih3),useValue:function(){return(0,m.bG)([an.A],()=>an.A.getDesktopType())!==A.nRU.NEVER},setValue:e=>aa.default.setDesktopType(e?A.nRU.ALL:A.nRU.NEVER)});var N3=n(832712),N5=n(543465),N6=n(790782);let N4=(0,a.zD)(o.X.EXPERIMENTAL_UNREADS,{useTitle:()=>j.intl.string(j.t["k6m/si"]),useSubtitle:()=>j.intl.string(j.t.LGynPs),useValue:()=>(0,m.bG)([N5.Ay],()=>N5.Ay.useNewNotifications),setValue:function(e){N3.A.setAccountFlag(Ak.i.USE_NEW_NOTIFICATIONS,e),e||(mV.w.set("turnedOffNewNotifications",!0),e7.default.track(A.HAw.NOTIFICATION_MIGRATION_OPTOUT,{num_guilds_with_new_setting:lc.A.getGuildsArray().filter(e=>N5.Ay.resolveGuildUnreadSetting(e)===N6.e.ONLY_MENTIONS).length}))},usePredicate:()=>(0,m.bG)([l1.default,N5.Ay],()=>l1.default.getCurrentUser()?.isStaff()||l1.default.getCurrentUser()?.isStaffPersonal()||N5.Ay.useNewNotifications)});var N8=n(534654);let N7=(0,a.zD)(o.X.SCREEN_DOWNTIME_REMINDER,{useTitle:()=>j.intl.string(j.t.z9h8Ym),useSubtitle:()=>j.intl.string(j.t.TummoQ),useValue:()=>(0,m.bG)([an.A],()=>an.A.screenDowntimeReminder),setValue:e=>aa.default.setScreenDowntimeReminder(e),usePredicate:function(){let e=(0,NF.Vh)({location:"ScreenDowntimeReminderSetting"}),t=(0,N8.A)(),n=(0,fB.Du)();return e&&t&&n}}),N9=(0,a.zD)(o.X.SCREEN_DOWNTIME_SCHEDULE,{useTitle:()=>j.intl.string(j.t.onrAy7),useSubtitle:()=>j.intl.string(j.t["/071J7"]),useValue:v.gY.useSetting,setValue:e=>v.gY.updateSetting(e),usePredicate:function(){let e=(0,NF.Vh)({location:"ScreenDowntimeScheduleSetting"}),t=(0,N8.A)(),n=(0,fB.Du)();return e&&t&&n}}),Ce=(0,a.zD)(o.X.FRIEND_ANNIVERSARY_NOTIFICATIONS,{useTitle:()=>j.intl.string(j.t.NjOMvh),useValue:v.oz.useSetting,setValue:function(e){v.oz.updateSetting(e),e7.default.track(A.HAw.NOTIFICATION_SETTINGS_UPDATED,{update_type:Ak.Y.ACCOUNT,friend_anniversary_notifications:e})},useSearchTerms:()=>[j.intl.string(j.t.hi4dSk)]}),Ct=(0,AY.mj)({kind:"user",name:"2026-03-friend-is-online-v3",defaultConfig:{showSettingsToggle:!1},variations:{1:{showSettingsToggle:!0},2:{showSettingsToggle:!0}}}),Cn=(0,a.zD)(o.X.FRIEND_ONLINE_NOTIFICATIONS,{useTitle:()=>j.intl.string(j.t.sQQgFj),useValue:v.NR.useSetting,setValue:function(e){v.NR.updateSetting(e),e7.default.track(A.HAw.NOTIFICATION_SETTINGS_UPDATED,{update_type:Ak.Y.ACCOUNT,friend_online_notifications:e})},usePredicate:()=>Ct.useConfig({location:"FriendOnlineNotifications"}).showSettingsToggle}),Ci=(0,a.zD)(o.X.GO_LIVE_NOTIFICATIONS,{useTitle:()=>j.intl.string(j.t.FSNIvs),useValue:v.Yh.useSetting,setValue:function(e){v.Yh.updateSetting(e),e7.default.track(A.HAw.NOTIFICATION_SETTINGS_UPDATED,{update_type:Ak.Y.ACCOUNT,go_live_notifications:e})}}),Cl=(0,AY.mj)({kind:"user",name:"2026-01-profile-updates-notification",defaultConfig:{showSettingsToggle:!1},variations:{0:{showSettingsToggle:!1},1:{showSettingsToggle:!0},2:{showSettingsToggle:!0}}}),Cs=(0,a.zD)(o.X.PROFILE_UPDATES_NOTIFICATIONS,{useTitle:()=>j.intl.string(j.t.xBLMhQ),useValue:v.T3.useSetting,setValue:function(e){v.T3.updateSetting(e),e7.default.track(A.HAw.NOTIFICATION_SETTINGS_UPDATED,{update_type:Ak.Y.ACCOUNT,profile_updates_notifications:e})},usePredicate:()=>Cl.useConfig({location:"user_settings.ProfileUpdatesNotifications"}).showSettingsToggle});var Cr=n(815807);let Ca=(0,a.Hn)(o.X.REACTION_NOTIFICATIONS,{useTitle:()=>j.intl.string(j.t.Wxj9Hp),useOptions:()=>[{id:"enabled",label:j.intl.string(j.t["9x/RtT"]),value:ek.Tz.NOTIFICATIONS_ENABLED},{id:"only_dms",label:j.intl.string(j.t.fJAbQd),value:ek.Tz.ONLY_DMS},{id:"disabled",label:j.intl.string(j.t["xu+UDU"]),value:ek.Tz.NOTIFICATIONS_DISABLED}],useValue:v.Zp.useSetting,setValue:e=>(0,Cr.n4)(e,v.Zp.getSetting())}),Co=(0,a.zD)(o.X.SERVER_TRENDING_NOTIFICATIONS,{useTitle:()=>j.intl.string(j.t["k51K1+"]),useValue:v.Qr.useSetting,setValue:function(e){v.Qr.updateSetting(e),e7.default.track(A.HAw.NOTIFICATION_SETTINGS_UPDATED,{update_type:Ak.Y.ACCOUNT,server_trending_notifications:e})},usePredicate:()=>!1}),Cu=(0,AY.mj)({kind:"user",name:"2026-04-upcoming-server-event",defaultConfig:{showSettingsToggle:!1},variations:{1:{showSettingsToggle:!0},2:{showSettingsToggle:!0},3:{showSettingsToggle:!0}}}),Cd=(0,a.zD)(o.X.UPCOMING_SERVER_EVENT_NOTIFICATIONS,{useTitle:()=>j.intl.string(j.t.G8NPz6),useValue:v.zS.useSetting,setValue:function(e){v.zS.updateSetting(e),e7.default.track(A.HAw.NOTIFICATION_SETTINGS_UPDATED,{update_type:Ak.Y.ACCOUNT,upcoming_server_event_notifications:e})},usePredicate:()=>Cu.useConfig({location:"UpcomingServerEventNotifications"}).showSettingsToggle}),Cc=(0,a.FW)(o.X.NOTIFICATION_SELECTION_FIELD_SET,{variant:"compact",useTitle:()=>j.intl.string(j.t.FEVRDV),buildLayout:()=>[Ci,Ce,Cn,Co,Cd,Cs,Ca]}),Cg=(0,a.zD)(o.X.TASK_BAR_FLASHING,{useTitle:()=>j.intl.string(j.t.xSmFQG),useSubtitle:()=>j.intl.string(j.t.bd4j4x),useValue:()=>(0,m.bG)([an.A],()=>an.A.taskbarFlash),setValue:e=>aa.default.setTaskbarFlash(e),usePredicate:()=>(0,no.uF)()}),Cm=(0,a.zZ)(o.X.NOTIFICATIONS_OVERVIEW_CATEGORY,{useTitle:()=>j.intl.string(j.t["/dp6yY"]),buildLayout:()=>[N2,Cg,Cc,N4,N9,N7]});var CA=n(965957),Ch=n(312671),CE=n(235079);let CS=(0,a.zD)(o.X.NOTIFICATION_HOLIDAY_SOUNDPACK,{useTitle:()=>{let e=ai.A.useHolidaySoundpack();return null==e?"":j.intl.format(j.t["E/OyBr"],{soundpack:j.intl.string(e.soundpackLabel)})},useValue:function(){let e=(0,m.bG)([Ch.A],()=>Ch.A.getSoundpack()),t=ai.A.useHolidaySoundpack();return e===t?.soundpack},setValue:function(e){let t=ai.A.getHolidaySoundpack();tl()(null!=t,"predicate should fail if no soundpack is available"),(0,CA.p)(e?t:CE.i.CLASSIC)},usePredicate:ai.A.useIsEligible});var Cx=n(970931);let CT={useTitle:()=>j.intl.string(j.t.jD1qzM),sound:"message1",useDisabled:Cx.kB,useDisabledMessage:()=>(0,Cx.kB)()?j.intl.string(j.t.cIRG0s):void 0},Cp={useTitle:()=>j.intl.string(j.t.XBrJT6),sound:"call_ringing"},Cf=(0,a.zD)(o.X.SELECTED_CHANNEL_NOTIFICATIONS,{useTitle:()=>j.intl.string(j.t.TzjwV9),useSubtitle:()=>j.intl.format(j.t.OOiGCM,{onClick:()=>ad("message3")}),useValue:()=>(0,m.bG)([an.A],()=>an.A.getNotifyMessagesInSelectedChannel()&&!an.A.getDisableAllSounds()),setValue:e=>aa.default.setNotifyMessagesInSelectedChannel(e),useDisabled:()=>(0,m.bG)([an.A],()=>an.A.getDisableAllSounds())}),CI=(0,a.zD)(o.X.DISABLE_ALL_NOTIFICATION_SOUNDS,{useTitle:()=>j.intl.string(j.t["2ZhCOd"]),useSubtitle:()=>j.intl.string(j.t.EAKdPr),useValue:()=>(0,m.bG)([an.A],()=>an.A.getDisableAllSounds()),setValue:e=>aa.default.toggleDisableAllSounds(e)}),C_=(0,a.D1)(o.X.NOTIFICATION_SOUNDS_LIST,{initialize:function(){return()=>{au()}},buildLayout:()=>[ac(CT),Cf,ac(Cp),CI]}),CN=(0,a.AK)(o.X.NOTIFICATIONS_TO_VOICE_AND_VIDEO_SOUNDS_NAVIGATOR,{useSubtitle:()=>j.intl.string(j.t["MMy+lm"]),useSearchTerms:()=>[j.intl.string(j.t["MMy+lm"])],destinationKey:o.X.SOUNDS_CATEGORY}),CC=(0,a.gN)(o.X.NOTIFICATIONS_SOUNDS_RELATED_SETTINGS,{buildLayout:()=>[CN]}),Cb=(0,a.zZ)(o.X.NOTIFICATIONS_SOUNDS_CATEGORY,{useTitle:()=>j.intl.string(j.t.LweOYy),buildLayout:()=>[CS,C_,CC]}),Cy=(0,a.t_)(o.X.NOTIFICATIONS_PANEL,{useTitle:()=>j.intl.string(j.t.HcoRu0),initialize:()=>{!(0,NF.Eq)({location:"NotificationsPanel"})||null!=Nw.A.getAgeGroup()||Nw.A.isLoading()||Nw.A.canRefetch()&&Nk.Ay.initialPageLoad()},buildLayout:()=>[Cm,Cb,NZ,N1,NK]}),Cv=(0,a.i4)(o.X.NOTIFICATIONS_SIDEBAR_ITEM,{useTitle:()=>j.intl.string(j.t.HcoRu0),icon:NV.X,buildLayout:()=>[Cy]}),Cj=(0,a.WI)(o.X.USER_SECTION,{useTitle:()=>j.intl.string(j.t.ShSTDe),hideTitle:!0,buildLayout:()=>[f8,_S,NU,Cv,ID]});var CO=n(387758),CL=n(271866),CD=n(147964),CR=n(868511);let CP=(0,a.zD)(o.X.APPLICATION_TEST_MODE,{useTitle:()=>j.intl.string(j.t.erOqlh),useSubtitle:()=>j.intl.string(j.t["52hMnD"]),usePredicate:v.Q_.useSetting,useValue:()=>(0,m.bG)([CD.A],()=>null!=CD.A.testModeApplicationId),setValue:e=>{e?(0,ln.openModal)(e=>(0,c.jsx)(CR.A,{...e})):CL.cL()}}),CG=(0,a.zD)(o.X.DEVELOPER_MODE,{useTitle:()=>j.intl.string(j.t.ObIb1Q),useSubtitle:()=>j.intl.format(j.t["CY6q/Q"],{apiDocsUrl:A.X7G.API_DOCS}),useValue:v.Q_.useSetting,setValue:v.Q_.updateSetting,usePredicate:()=>uc.p5}),CM=(0,a.zZ)(o.X.DEVELOPER_CATEGORY,{buildLayout:()=>[CG,CP]}),CU=(0,a.t_)(o.X.DEVELOPER_PANEL,{useTitle:()=>j.intl.string(j.t["0BRxRp"]),buildLayout:()=>[CM]}),CV=(0,a.i4)(o.X.DEVELOPER_SIDEBAR_ITEM,{icon:CO.G,useTitle:()=>j.intl.string(j.t["0BRxRp"]),buildLayout:()=>[CU]});var Ck=n(70688),Cw=n(830215);let CF=(0,a.i4)(o.X.LOGOUT_SIDEBAR_ITEM,{variant:"destructive",useTitle:()=>j.intl.string(j.t["2jxGer"]),icon:Ck.o,onClick:()=>{(0,nW.A)({title:j.intl.string(j.t["2jxGer"]),subtitle:j.intl.string(j.t.SUnWBB),confirmText:j.intl.string(j.t["2jxGer"]),onConfirm:()=>{Cw.A.logout("settings")}})},buildLayout:()=>[]}),CB=(0,a.WI)(o.X.UTILITY_SECTION,{useTitle:()=>j.intl.string(j.t["2kOEFe"]),hideTitle:!0,buildLayout:()=>[CV,CF]}),Cz=(0,a.Hr)({buildLayout:()=>[pu,Cj,me,aF,Sk,AC,CB],analyticsKey:"user_settings"})}