Module 366554

449,796 characters · in 5aefe0c7210462e8.js
Dependencies
Required by (3)
Lazily required by (0)none
Requires (912)
1215224230743137343245425180888091139302100941387516590179281829319575202302085122231223852504425176286472916030370307933130031408317203252332880343323558736149373973764637766384053850239623419844399045938460544612146367499995306153070535165457055619565625870363152647006748070283706887073070956713937153271547738257439674669748487580477138774687772980703814008361784540863798771993364934659570195781966079691997260973529748397808982079859699696100392100767101058101928102609102937104510104589105732106236106531106713109802111159111162113463113494115063116891123292123791127062128450131352131607132500138134138617139033140735141218142862143582144165145331145497147248147925147964148810150934152056152567153488153659155957155984157559157723159001160946162093163437165191166403168482169869171316172272173936174197174459175880176524176781178015178368182817182859183812184809185438187322189081189213189883192308194261198970199300199966200921201718202541202613202639204050204925206828206885207560207803209932212168212245212739215082217510219887221347224964226640227309228366231570232122233545235079235693235986237218237984240248240921241326241524242653243217243580243721246605248778252732253449254138254313256006256311257433259065260598261835262077264686264779269115269880270003271078271478271866271995273151274184276086277984280450281161281980283517283540284009284016285918287809288737289498289873290595292666295405295648296027297264297642297932300118300839303778305866306471307301307863308528308645310918311043312671314116314647315629317097318785319225320095320448320989321073321078321191323073323091323384327479328968329139329312329551331322331887333216338548339048339984341206341923342744344346346017346055347481347990349288350535351906353835354328355097355622357758358776360615360669363195364522365199365258366010366523366999369163369606370480370997372684375708378102379197379550379848380610381579381941382003384684386171386447386976387722387758388567389737389833390248390646391048391973392164395277396478397438398177400492400669401721403362403581404778406252406360406535406935408018408278410516410767412260412780412848413142413339414079414133416052416378417098417270419954422936423764424994425587426399427262428031428262428275428678429913430795434404435558435748438807439312442433443865444802446404449817450740451909451988452027452832455218457421458977459357459838461546461797461893462887463384464477464946465323465558465932466034466919467962469778470739473145475358476713477782478016479183481344486020486925487329487866488430489277489718492064496431497267498642499454502229502572503698506774507553508274509531512062512599512950514956515183515718515727516761518477520229521078522334522826524170526162527113530005530702531260532197532446532624533792534400534654534952537532540999543465543767545075545934546140546385548118548411549363549406550640551289552122553429554146555837556534557722558001561835562465562519562819565645566769566935567910567926569926572164573648574381575915576705577997580630581781582835583613583995587895588857589051590180591179592598594061594387594943597770597890599941602339602853604121604203607399611881614455614820615396615405616356617061617255617617617641619499621380624456625494625657625841627363627968630579631368631670632119635242636194636763637193639555640238645886646270650442650583650809651439652215652525654107656513658675659324659758661531662758663417663894664121665260665267665671667532668267669067670492672130672140672396674168682348682618682763683071683760684013684732685073687021687123687966688151688810691540691885695366695515696016696451696986699217702841707554710144710195711014711171712440714763717398723702723923724405724624725538725570725807725951728707729919730134731854732280733110734057734066735310735669736056736653738188738262738678742023742885743526743552743790743981745317746080750714751075753806754561754692756625757036759692760677760751761508763754764336766075766928769015773371773447773669775121775602775657776096776351776409778712780907780964782134782603783419783878784075785007787392788833789645790284790782792348792656793574793943796774800120801644803224803306805945806932808658808728809505810412811160811611812729812993813564814278814390814925815332815807815846816453817281818348820739820785821609821956822585823092823894824744825484827053827343830215830543830991831544831653832208832712834040834297834730834981835002835071836602839214839272839628840387840559843282843402844222844828847374847599852712853513854627855267855302856488857020857250859241862482864145864310864386866323866665866945868511868886869038869438871123871633872351873298874486874490875162875444878515880144880482881489883600885386885574885996888916889227890856892208892547897720898461898555899847900686900797903209906688907895909536912851913997914410915043915089915618915725917064917136919395919796922016922795923457926140926268926919927018927813928171930861930863933287933297933832934246934729935208935399935671936388936926938706938796939249940622940856942053943646943775944304945276945810946801950305951260951555952270952572952818953298954225955572957485957565957658960309962644963852963935964355964486965957966327967198968309968671968898970770970931972737974293974544975571975732975940976860976910978263978380980504980707982240983048983511983851984813986238986687987144987197989349990125992526993077993830994500997187997213999291999747999834
Source Raw
function(e,t,i){i.d(t,{D:()=>bQ});var n,s,l,r,a=i(419954),o=i(358776),u=i(780964),d=i(682348),c=i(574381),g=i(17928),m=i(952818),A=i(871633),h=i(933297),E=i(627968),S=i(64700),T=i(627363),x=i(587895),p=i(769015),f=i(751075),N=i(403362);i(321073);var _=i(843402);let I=(0,i(583613).L_)(function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return new Set(t.map(e=>e.exePath))});function C(){let e=(0,g.yK)([m.Ay],()=>m.Ay.getGamesSeen(!1)),t=(0,g.bG)([m.Ay],()=>I(...m.Ay.getOverrides()));S.useEffect(()=>((0,_.a2)(),_.e0),[]);let{gameHistory:i,robloxSubgameHistory:n}=S.useMemo(()=>e.reduce((e,t)=>((0,A.n1)(t)?e.robloxSubgameHistory.push(t):e.gameHistory.push(t),e),{gameHistory:[],robloxSubgameHistory:[]}),[e]);return{gameHistory:i,robloxSubgameHistory:n,overrideExePaths:t}}function b(e){let{gameHistory:t}=C();return{namedGames:S.useMemo(()=>t.values().filter(e=>null!=e.id&&null!=e.name).take(e).toArray(),[t,e]),totalCount:t.length}}function v(e){let{namedGames:t,totalCount:i}=b(e);return{names:t.map(e=>e.name),totalCount:i}}function y(){let{namedGames:e}=b(2),[t,i]=S.useMemo(()=>e.map(e=>e.id),[e]);S.useEffect(()=>{T.Ay.fetchApplications([t,i].filter(N.Vq))},[t,i]);let[n,s]=(0,g.yK)([x.A],()=>[t,i].map(x.A.getApplication),[t,i]);return null==t?null:{frontIcon:{icon:(0,E.jsx)(p.A,{game:n,size:p.M.MEDIUM_LARGE}),shape:f.e0.ROUNDED},backIcon:null!=i?{icon:(0,E.jsx)(p.A,{game:s,size:p.M.MEDIUM}),shape:f.e0.ROUNDED}:null}}var j=i(375708);let O=(0,a.AK)(u.X.ACTIVITY_PRIVACY_TO_REGISTERED_GAMES_NAVIGATOR,{useSubtitle:function(){let{names:e,totalCount:t}=v(2);return j.intl.format(j.t["6nRCFl"],{also:"true",count:t,nameCount:e.length,game1:e[0],game2:e[1]})},useTrailingDecoration:()=>({type:h.wF.STACKED_ICONS,useIcons:y}),destinationKey:u.X.REGISTERED_GAMES_PANEL,usePredicate:()=>{let e=(0,o.SV)("ActivitySharingRelatedSettings"),t=(0,g.bG)([m.Ay],()=>m.Ay.getGamesSeen(!1).some(e=>!(0,A.n1)(e)));return e&&t&&(0,c.xl)()}}),R=(0,a.gN)(u.X.ACTIVITY_SHARING_RELATED_SETTINGS,{buildLayout:()=>[O]});var L=i(885386),D=i(395277);let P=(0,a.zD)(u.X.ACTIVITY_PRIVACY_SETTING,{useTitle:()=>j.intl.string(D.default.WhdCGP),useSubtitle:()=>j.intl.string(D.default.UQ9RHJ),useValue:L.tz.useSetting,setValue:L.tz.updateSetting});var G=i(174459),M=i(406535),U=i(652215);let V=(0,a.zD)(u.X.ACTIVITY_PRIVACY_NOTIFY_FRIENDS_ONLINE_SETTING,{useTitle:()=>j.intl.string(D.default.A0FVCV),useSubtitle:()=>j.intl.string(D.default.vHX6RG),useValue:L.hV.useSetting,setValue:function(e){L.hV.updateSetting(e),G.default.track(U.HAw.NOTIFICATION_SETTINGS_UPDATED,{update_type:M.Y.ACCOUNT,notify_friends_on_come_online:e})}}),k=(0,a.zZ)(u.X.ACTIVITY_PRIVACY_SHARING_CATEGORY,{useTitle:()=>(0,o.SV)("ActivitySharingCategory")?j.intl.string(j.t.WmsPis):j.intl.string(j.t["6x5uWQ"]),useSearchTerms:()=>[j.intl.string(j.t["8ka8li"])],buildLayout:()=>[P,V,R]});var w=i(945810),F=i(106531);let B=(0,w.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}}});function z(e){let t=(0,F.lX)(e),i=B.useConfig({location:e});return t||i.copyChanges}let Y=(0,a.AK)(u.X.ACTIVITY_PRIVACY_TO_PROFILE_PRIVACY_NAVIGATOR,{useSubtitle:()=>j.intl.string(j.t.J0SFL2),destinationKey:u.X.DATA_AND_PRIVACY_PANEL}),X=(0,a.gN)(u.X.ACTIVITY_PRIVACY_RELATED_SETTINGS,{usePredicate:()=>(0,F.lX)("ActivityPrivacyRelatedSettings"),buildLayout:()=>[Y]});var H=i(873298),K=i(192308),W=i(365258);let Z=(0,a.Qx)(u.X.ACTIVITY_PRIVACY_PER_GUILD_DEFAULT_SETTING,{useTitle:()=>{let e=(0,o.SV)("GuildActivitySharingDefaultSetting");return z("GuildActivitySharingDefaultSetting")&&!e?j.intl.string(j.t.vpgck1):j.intl.string(D.default["/LHVbt"])},useSubtitle:()=>(0,o.SV)("GuildActivitySharingDefaultSetting")?j.intl.string(j.t.L5IdzV):null,useOptions:function(){let e=(0,o.SV)("GuildActivitySharingDefaultSetting"),t=z("GuildActivitySharingDefaultSetting");return S.useMemo(()=>e?[{value:H.Qd.ACTIVITY_STATUS_OFF,name:j.intl.string(D.default.m3oL7Q)},{value:H.Qd.ACTIVITY_STATUS_ON_FOR_LARGE_GUILDS,name:j.intl.string(D.default["5+lnTA"])},{value:H.Qd.ACTIVITY_STATUS_ON,name:j.intl.string(D.default["egr+VZ"])}]:t?[{value:H.Qd.ACTIVITY_STATUS_OFF,name:j.intl.string(j.t.FzgQna),desc:j.intl.string(j.t.SQxoyc)},{value:H.Qd.ACTIVITY_STATUS_ON_FOR_LARGE_GUILDS,name:j.intl.string(j.t["1hvuGH"]),desc:j.intl.string(j.t.odUCPE)},{value:H.Qd.ACTIVITY_STATUS_ON,name:j.intl.string(j.t.fQc5la)}]:[{value:H.Qd.ACTIVITY_STATUS_ON,name:j.intl.string(j.t.UzGMH9)},{value:H.Qd.ACTIVITY_STATUS_ON_FOR_LARGE_GUILDS,name:j.intl.string(D.default["/sAeRY"])},{value:H.Qd.ACTIVITY_STATUS_OFF,name:j.intl.string(D.default.m3oL7Q)}],[t,e])},useValue:L._Z.useSetting,setValue:function(e){var t;let n=L._Z.getSetting();if(L._Z.updateSetting(e),t="GuildActivitySharingDefaultSetting",!(0,F.W1)(t)&&!B.getConfig({location:t}).upsell)return;let s=(0,W.g8)(n,e);if(null==s)return;let l=(0,W.Xc)(e);(0,K.openModalLazy)(async()=>{let{default:e}=await Promise.all([i.e("46662"),i.e("81849"),i.e("62041"),i.e("41996")]).then(i.bind(i,32167));return t=>(0,E.jsx)(e,{...t,direction:s.direction,affectedGuildIds:s.affectedGuildIds,settingName:l})})}});var q=i(683071),Q=i(331322),J=i(243721),$=i(892547),ee=i(922016),et=i(980707),ei=i(477782),en=i(939249),es=i(834730),el=i(847374),er=i(661531),ea=i(123292),eo=i(140735),eu=i(498642),ed=i(743790),ec=i(71393),eg=i(711014),em=((n={}).SERVER_ORDER="server-order",n.RECENTLY_JOINED="recently-joined",n.ACTIVITY_SHARING_ON="activity-sharing-on",n.ACTIVITY_SHARING_OFF="activity-sharing-off",n);let eA={"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,i)=>{let n=t.includes(e.id),s=t.includes(i.id);return!n&&s?-1:n&&!s?1:0}),"activity-sharing-off":(e,t)=>e.concat().sort((e,i)=>{let n=t.includes(e.id),s=t.includes(i.id);return n&&!s?-1:!n&&s?1:0}),"server-order":e=>e};var eh=i(775657);function eE(e){let{guild:t,isActivityRestricted:i,onToggleActivityRestrictedGuild:n}=e,s=(0,g.bG)([eu.A],()=>eu.A.getMemberCount(t.id));return(0,E.jsxs)(Q.B,{as:"li",direction:"horizontal",align:"center",gap:16,children:[(0,E.jsx)("div",{className:eh.FO,children:(0,E.jsx)(ed.K,{guild:t,size:48})}),(0,E.jsx)("div",{className:eh.QH,children:(0,E.jsx)(J.d,{label:t.name,description:j.intl.format(j.t.zRl6XR,{count:s??0}),checked:!i,onChange:e=>n({checked:e,guildId:t.id})})})]})}let eS=function(e){let{notice:t}=e,{guilds:i,searchQuery:n,setSearchQuery:s,sortOrder:l,setSortOrder:r,hasActivityRestrictedGuilds:a,onToggleAllActivityRestrictedGuilds:o,onToggleActivityRestrictedGuild:u,isActivityRestricted:d,numActivityRestrictedGuilds:c,numTotalGuilds:m}=function(){let[e,t]=(0,S.useState)(""),[i,n]=(0,S.useState)("server-order"),s=(0,g.bG)([eg.Ay],()=>eg.Ay.getFlattenedGuildIds()),l=(0,g.bG)([ec.A],()=>ec.A.getGuilds()),r=s.map(e=>l[e]).filter(Boolean),a=L.Pw.useSetting(),[o,u]=(0,S.useState)(a);async function d(e){u(e);try{await L.Pw.updateSetting(e)}catch(e){u(a)}}(0,S.useEffect)(()=>{u(a)},[a]);let c=0!==o.length,[m,A]=(0,S.useState)(()=>eA[i](r,a)),h=m.map(e=>l[e.id]).filter(Boolean);return{guilds:""===e?h:h.filter(t=>t.name.toLowerCase().includes(e.toLowerCase())),sortOrder:i,searchQuery:e,setSortOrder:e=>{A(eA[e](r,a)),n(e)},setSearchQuery:t,onToggleActivityRestrictedGuild:function(e){let{checked:t,guildId:i}=e,n=new Set(o);t?n.delete(i):n.add(i),d([...n])},isActivityRestricted:function(e){return o.includes(e)},hasActivityRestrictedGuilds:c,onToggleAllActivityRestrictedGuilds:function(){c?d([]):d(s)},numTotalGuilds:s.length,numActivityRestrictedGuilds:o.length}}(),A=(0,S.useId)(),h=(0,S.useRef)(null),T=(0,S.useMemo)(()=>[{id:em.SERVER_ORDER,label:j.intl.string(j.t.STMPJ2),value:em.SERVER_ORDER},{id:em.RECENTLY_JOINED,label:j.intl.string(j.t.CbaapP),value:em.RECENTLY_JOINED},{id:em.ACTIVITY_SHARING_ON,label:j.intl.string(D.default.ZI51JZ),value:em.ACTIVITY_SHARING_ON},{id:em.ACTIVITY_SHARING_OFF,label:j.intl.string(D.default["+kxafn"]),value:em.ACTIVITY_SHARING_OFF}],[]),x=T.find(e=>e.value===l)?.label??"";return(0,E.jsxs)("div",{className:eh.iE,children:[t,(0,E.jsxs)("div",{className:eh.N1,children:[(0,E.jsx)($.I,{query:n,onChange:s,onClear:function(){G.default.track(U.HAw.ACTIVITY_SHARING_SETTINGS_INTERACTED,{interaction:"search_cleared",sort_order:l,activity_restricted_guild_count:c,total_guild_count:m}),s("")},onFocus:()=>G.default.track(U.HAw.ACTIVITY_SHARING_SETTINGS_INTERACTED,{interaction:"search_focused",sort_order:l,activity_restricted_guild_count:c,total_guild_count:m}),onBlur:()=>G.default.track(U.HAw.ACTIVITY_SHARING_SETTINGS_INTERACTED,{interaction:"search_blurred",sort_order:l,activity_restricted_guild_count:c,total_guild_count:m}),placeholder:j.intl.string(j.t["H+nRYw"]),"aria-label":j.intl.string(j.t["5h0QOP"]),inputProps:{"aria-controls":A,"aria-expanded":!0}}),i.length>0&&(0,E.jsxs)("div",{className:eh.gO,children:[(0,E.jsx)(ee.Y,{targetElementRef:h,position:"bottom",align:"left",renderPopout:e=>{let{closePopout:t}=e;return(0,E.jsx)(et.W,{navId:"guild-sort-order-menu",onClose:t,"aria-label":j.intl.string(j.t.LxVjvJ),onSelect:t,children:(0,E.jsx)(ei.rX,{children:T.map(e=>{let{id:t,label:i,value:n}=e;return(0,E.jsx)(ei.iD,{id:t,group:"sort-order",label:i,checked:l===n,action:()=>{G.default.track(U.HAw.ACTIVITY_SHARING_SETTINGS_INTERACTED,{interaction:"sort_order_changed",sort_order:n,activity_restricted_guild_count:c,total_guild_count:m}),r(n)}},t)})})})},children:e=>(0,E.jsxs)(en.D,{...e,innerRef:h,className:eh.Ku,children:[(0,E.jsx)(es.E,{variant:"text-sm/medium",color:"text-subtle",children:x}),(0,E.jsx)(el.a,{size:"xs",color:er.A.colors.TEXT_SUBTLE})]})}),(0,E.jsx)(ea.Q,{variant:"primary",textVariant:"text-sm/medium",onClick:o,text:a?j.intl.string(j.t["7lxcLO"]):j.intl.string(j.t.zh6UEs)})]})]}),(0,E.jsx)(eo.A,{"aria-live":"polite",role:"region",children:j.intl.format(D.default.EvzDff,{count:i.length})}),(0,E.jsxs)("ul",{className:eh.X1,id:A,"aria-label":j.intl.string(j.t["7hB4kg"]),children:[0===i.length&&(0,E.jsx)("div",{className:eh.pb,children:(0,E.jsx)(es.E,{className:eh.R$,variant:"text-lg/medium",children:j.intl.string(j.t["Xe+fJM"])})}),i.map(e=>(0,E.jsx)(eE,{guild:e,isActivityRestricted:d(e.id),onToggleActivityRestrictedGuild:u},e.id))]})]})};var eT=i(155957);let ex=(0,a.E2)(u.X.ACTIVITY_PRIVACY_PER_GUILD_SETTING,{useSearchTerms:()=>[j.intl.string(D.default["/LHVbt"])],Component:function(){let e=L.tz.useSetting()?null:(0,E.jsx)("div",{className:eT.l,children:(0,E.jsx)(q.w,{type:"warning",children:j.intl.string(D.default["xxI0/W"])})});return(0,E.jsx)(eS,{notice:e})}}),ep=(0,a.zZ)(u.X.ACTIVITY_PRIVACY_PER_GUILD_CATEGORY,{useTitle:()=>{let e=(0,o.SV)("GuildActivitySharingCategory"),t=z("GuildActivitySharingCategory");return e?j.intl.string(j.t.bwqjL9):t?j.intl.string(j.t.VDcvrR):j.intl.string(D.default["1PougL"])},useSubtitle:()=>{let e=z("GuildActivitySharingCategory");return(0,o.SV)("GuildActivitySharingCategory")?null:e?j.intl.string(j.t["/Go08F"]):j.intl.string(D.default.OO17Lg)},buildLayout:()=>(0,o.Bv)("GuildActivitySharingCategory")?[Z,ex,X]:[Z]}),ef=(0,a.zZ)(u.X.ACTIVITY_PRIVACY_MY_SERVERS_CATEGORY,{useTitle:()=>j.intl.string(j.t.TqdOvC),useSubtitle:()=>z("MyServersCategory")?j.intl.string(D.default.OO17Lg):null,buildLayout:()=>[ex,X]}),eN=(0,a.zD)(u.X.ACTIVITY_PRIVACY_FRIENDS_JOIN_SETTING,{useTitle:()=>j.intl.string(D.default.khuuzv),useSubtitle:()=>j.intl.string(D.default["8EWsJ8"]),useValue:()=>L.e.useSetting(),setValue:e=>L.e.updateSetting(e)}),e_=(0,a.E2)(u.X.ACTIVITY_PRIVACY_GAME_JOINING_BLURB,{useSearchTerms:()=>[],Component:function(){return(0,E.jsx)(es.E,{variant:"text-sm/normal",color:"text-muted",children:j.intl.format(j.t.Mf0720,{privacySettingsHook:(e,t)=>(0,E.jsx)(es.E,{tag:"span",variant:"text-sm/semibold",color:"text-muted",children:e},t)})})},usePredicate:()=>(0,o.SV)("GameJoiningBlurb")}),eI=(0,a.zD)(u.X.ACTIVITY_PRIVACY_VOICE_JOIN_SETTING,{useTitle:()=>j.intl.string(D.default.Uz5Ipi),useSubtitle:()=>j.intl.string(D.default.CZI2Gb),useValue:()=>L.UM.useSetting(),setValue:e=>L.UM.updateSetting(e)}),eC=(0,a.zZ)(u.X.ACTIVITY_PRIVACY_GAME_JOINING_CATEGORY,{useTitle:()=>j.intl.string(D.default["89YBr5"]),useSubtitle:()=>(0,o.SV)("GameJoiningCategory")?j.intl.string(j.t.uGDpgH):null,buildLayout:()=>[eN,eI,e_],useSearchTerms:()=>[j.intl.string(j.t.VOszPA)]});var eb=i(993077),ev=i(575915);let ey=(0,a.E2)(u.X.ACTIVITY_PRIVACY_TERMS,{useSearchTerms:()=>[],Component:function(){return(0,E.jsx)(eb.Z,{type:eb.Z.Types.PRIMARY,className:ev.A,children:(0,E.jsx)(es.E,{variant:"text-sm/normal",children:j.intl.format(j.t.xvCsx4,{termsLink:U.X7G.TERMS,privacyLink:U.X7G.PRIVACY})})})}}),ej=(0,a.zZ)(u.X.ACTIVITY_PRIVACY_TERMS_CATEGORY,{buildLayout:()=>[ey],usePredicate:()=>!(0,o.SV)("TermsCategory")}),eO=(0,a.t_)(u.X.ACTIVITY_PRIVACY_PANEL,{useTitle:()=>j.intl.string(j.t.Cq98yL),buildLayout:()=>(0,o.Bv)("ActivityPrivacyPanel")?[k,ep,eC]:[k,ep,ef,eC,ej]}),eR=(0,a.i4)(u.X.ACTIVITY_PRIVACY_SIDEBAR_ITEM,{useTitle:()=>j.intl.string(j.t.Cq98yL),icon:d._,buildLayout:()=>[eO]});var eL=i(935399),eD=i(625657),eP=i(297264),eG=i(821609),eM=i(404778),eU=i(554146),eV=i(131607),ek=i(589051),ew=i(592598),eF=i(351906),eB=i(532624),ez=i(773371),eY=i(184809),eX=i(723702),eH=i(766075),eK=i(999834),eW=i(435558),eZ=i.n(eW),eq=i(350535),eQ=i(672396);let eJ=e0(null);function e$(){var e;let t=e0(eJ);e=eJ,eZ().isEqual(eZ().omit(t,"old_enabled"),eZ().omit(e,"old_enabled"))||(G.default.track(U.HAw.OVERLAY_SETTINGS_UPDATED,{...t}),eJ=t)}function e0(e){let t=eY.default.getNotificationPositionMode(),i=t!==U.G6Q.DISABLED,n=eB.Ay.getOverlayKeybind(),s=eB.Ay.getOverlayChatKeybind();return{enabled:ez.default.enabled,notifications_enabled:i,notifications_position:i?t:null,text_notifications_mode:ew.A.isNotificationDisabled(eQ.KS.TextChat)?"DISABLED":"ENABLED",hotkey:null!=n?(0,eq.dI)(n.shortcut):null,text_activation_hotkey:null!=s?(0,eq.dI)(s.shortcut):null,text_opacity_slider:eY.default.getTextWidgetOpacity(),old_enabled:e?.enabled??ez.default.enabled}}var e1=i(793574),e2=i(237984),e3=i(503698),e6=i.n(e3),e5=i(890856),e4=i(295648);function e8(e){e.preventDefault(),e.stopPropagation()}function e7(e){let{header:t,icon:i,title:n,description:s,action:l,hint:r,warning:a,onClick:o,"aria-label":u,className:d}=e;return(0,E.jsxs)("div",{className:e6()(e4.HS,d),children:[(0,E.jsxs)(e5.s,{"aria-label":u,onClick:o,children:[null!=t&&(0,E.jsx)("div",{className:e4.x_,children:t}),(0,E.jsxs)("div",{className:e4.rN,children:[null!=i&&(0,E.jsx)("div",{className:e4.$t,children:i}),(0,E.jsxs)("div",{className:e4.c8,children:[(0,E.jsx)(es.E,{variant:"text-md/medium",color:"text-strong",className:e4.SZ,children:n}),null!=s&&(0,E.jsx)(es.E,{variant:"text-sm/normal",color:"text-subtle",children:s}),null!=r&&(0,E.jsx)(es.E,{variant:"text-xxs/medium",color:"text-muted",children:r})]}),(0,E.jsx)("div",{className:e4.a$,children:l})]})]}),(0,E.jsx)("div",{className:e4.Om,children:a})]})}let e9=(0,a.E2)(u.X.OVERLAY_BUG_REPORTER_SETTING,{Component:function(){return(0,E.jsx)(e7,{title:j.intl.string(j.t["z4/l+V"]),description:j.intl.string(j.t["3aZq/0"]),action:(0,E.jsx)(eG.$,{variant:"primary",text:j.intl.string(j.t.s2nVhG),onClick:()=>{(0,e2.b)(e1.A.USER_SETTINGS,U.BRT.APP)}}),"aria-label":j.intl.string(j.t["z4/l+V"])})},useSearchTerms:()=>[j.intl.string(j.t["z4/l+V"])]});var te=i(812729),tt=i.n(te),ti=i(429913),tn=i(616356);function ts(e,t){return null!=e&&null!=e.id?e.id:null!=t&&null!=t.id?t.id:void 0}function tl(){let e=(0,g.bG)([tn.A],()=>tn.A.getStreamerActiveStreamMetadata()),t=(0,g.bG)([m.Ay],()=>{let e=m.Ay.getVisibleGame();return null!=e?m.Ay.getGameOrTransformedSubgameForPID(e.pid):null},[],tt()),[i]=(0,ti.A)([ts(e,t)]);return{runningGame:t??void 0,runningGameApplication:i??void 0}}var tr=i(866665),ta=i(478016),to=i(31300),tu=i(780907),td=i(684013),tc=i(56562),tg=i(964486),tm=i(311043),tA=i(569926),th=i(814925),tE=i(810412),tS=i(41984),tT=i(296027),tx=i(562519);let tp=5*i(927813).A.Millis.DAY,tf=new tx.A("overlay_survey_timestamps");function tN(e,t){let n,s;n=Date.now(),null!=(s=Array.from(tf.values()).reduce((e,t)=>Math.max(e,t),0))&&n-s<tp||Array.from(tf.values()).filter(e=>{let t=new Date(e);return t.getMonth()===new Date().getMonth()&&t.getFullYear()===new Date().getFullYear()}).length>=3||(0,K.openModalLazy)(async()=>{let n,{default:s}=await Promise.all([i.e("79969"),i.e("82318")]).then(i.bind(i,387101));return n=Date.now(),tf.add(n),i=>(0,E.jsx)(s,{...i,clientSettingType:e,gameId:t})})}var t_=i(512950),tI=i(975571),tC=i(935671);function tb(){(0,tC.sL)("overlay-settings")}function tv(e){let{className:t,game:i}=e;return(0,tC.NP)()&&null!=i&&i.elevated?(0,E.jsx)("div",{className:t,children:(0,E.jsx)(t_.p,{messageType:t_.Y.WARNING,action:(0,E.jsx)(eG.$,{variant:"secondary",size:"sm",text:j.intl.string(j.t["1iI46O"]),onClick:tb}),children:j.intl.format(j.t["LJzl+0"],{helpCenterLink:tI.A.getArticleURL(U.MVz.SYSTEM_SERVICE)})})}):null}var ty=i(760751),tj=i(189081),tO=i(9302),tR=i(656513),tL=i(320448);let tD=new Set([tS.AR.INITIALIZING,tS.AR.WAITING_FOR_SCREEN_TYPE_RESOLUTION,tS.AR.WAITING_FOR_MODULE_TRACKING,tS.AR.WAITING_FOR_OVERLAY_OPEN,tS.AR.WAITING_FOR_POPOUT_OPEN,tS.AR.WAITING_FOR_MODULE_POPOUT_CAPTURE,tS.AR.WAITING_FOR_REACT_INITIALIZATION,tS.AR.WAITING_FOR_PID_FOCUS,tS.AR.WAITING_FOR_SUCCESSFUL_SHOW]);function tP(e){let{children:t,className:i,onExpand:n,...s}=e,[l,r]=S.useState(!1);return(0,E.jsx)(tR.N,{className:e4.uR,collapsibleContent:(0,E.jsx)("div",{className:e4.oV,children:t}),children:e=>{let{onClick:t}=e;return(0,E.jsx)(e7,{...s,onClick:e=>{var i;r(i=!l),n?.(i),t?.(e)},className:e6()(e4.AC,i),action:(0,E.jsxs)("div",{className:e4.rc,children:[s.action,l?(0,E.jsx)(el.a,{size:"custom",width:20,height:20,color:"var(--interactive-text-active)"}):(0,E.jsx)(tL._,{size:"custom",width:20,height:20,color:"var(--interactive-text-active)"})]})})}})}let tG=(0,a.E2)(u.X.OVERLAY_CURRENT_GAME,{Component:function(){let{runningGame:e,runningGameApplication:t}=tl();(0,tA.I)(e?.id);let i=e?.pid,n=(0,g.bG)([tT.default],()=>null==e||null==i?null:tT.default.getTrackedGameByPid(i),[e,i],tt()),{enabledLegacy:s,enabledOOP:l}=(0,g.cf)([ty.A,tj.A,tm.A],()=>null==e&&null==n?{enabledLegacy:!1,enabledOOP:!1}:null==e?{enabledLegacy:n?.legacyEnabled??!1,enabledOOP:n?.oopEnabled??!1}:(0,m.hw)(e,!1,[ty.A,tj.A,tm.A]),[e,n]),r=(0,g.bG)([m.Ay,ty.A,tj.A,tm.A],()=>null==e?null:(0,m.xU)(e,m.Ay,ty.A,tj.A,tm.A),[e],tt()),[a,o]=S.useState(l),[u,d]=S.useState(s),[c,A]=S.useState(!1);S.useEffect(()=>{o(l),d(s)},[l,s]);let h=!(0,tO.supportsLegacy)(),T=!(0,tO.supportsOutOfProcess)(),{legacyEnabled:x,oopEnabled:f}=(0,g.cf)([tT.default],()=>tT.default.getGlobalEnabledStatus());function N(t,i){if(null==e)return;let n=!1,s=!1;switch(i){case tE.OverlayToggledClientSettingType.LEGACY_GAME:d(t),tu.Ay.toggleOverlay(e,t,a),n=!t&&u;break;case tE.OverlayToggledClientSettingType.OOP_GAME:o(t),tu.Ay.toggleOverlay(e,u,t),s=!t&&a;break;case tE.OverlayToggledClientSettingType.LEGACY:td.A.setEnabled(t,f),(0,tE.Q3)(t,tE.OverlayToggledClientSettingType.LEGACY,e.id??null);break;case tE.OverlayToggledClientSettingType.OOP:td.A.setEnabled(x,t),(0,tE.Q3)(t,tE.OverlayToggledClientSettingType.OOP,e.id??null)}(n||s)&&tN(n?tE.OverlayToggledClientSettingType.LEGACY_GAME:tE.OverlayToggledClientSettingType.OOP_GAME,e.id??null)}let _=h&&T,I=!x&&!f,C=!a&&!x&&u&&!h,b=!u&&!f&&a&&!T,v=n?.overlayMethod===tS.Ue.Disabled,y=n?.state===tS.AR.OVERLAY_RENDERING&&!v,O=n?.state!=null&&tD.has(n.state)&&!v,R=n?.overlayMethod===tS.Ue.OutOfProcess,L=n?.overlayMethod===tS.Ue.OutOfProcessLimitedInteraction,D=n?.overlayMethod===tS.Ue.Hook,P=n?.state===tS.AR.OVERLAY_CRASHED||n?.state===tS.AR.OVERLAY_CRASHED_DISABLED,G=!a&&!u,[M,U]=function(){switch(!0){case y&&R:return[j.intl.format(j.t.hFVBIg,{overlayMethod:j.intl.string(j.t.a3eXSw),overlayMethodHook:function(e,t){return(0,E.jsx)(es.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,E.jsx)(es.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,E.jsx)(es.E,{tag:"span",variant:"text-sm/medium",color:"text-strong",children:e},t)}}),function(){switch(!0){case n?.fullscreenType!==tc.aI.BORDERLESS_FULLSCREEN:return j.intl.string(j.t.mJmbeC);case T:return j.intl.string(j.t.C7bLTQ);case!n?.oopEnabled:return j.intl.string(j.t.WiY24u);case!f:return j.intl.string(j.t.cAFVsL);case!n?.supportsOutOfProcess:return j.intl.string(j.t.XcGEcs);default:return j.intl.string(j.t.bJXH2v)}}()];case P:return[j.intl.string(j.t.OFC2aw),null];case _:return[j.intl.string(j.t.m7X4az),null];case I:return[j.intl.string(j.t["9DUS5l"]),null];case G:return[j.intl.string(j.t.nQ9EdJ),null];case C:case b:return[j.intl.string(j.t.VWUn0a),null];case O:if(R)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==n:return[j.intl.string(j.t.vwHPRi),null];case v:{let e=n?.fullscreenType===tc.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,tg.Ay)(()=>{tu.Ay.getDetectableGames()});let[V,k]=S.useMemo(()=>O?["text-muted",er.A.colors.TEXT_MUTED.css]:y&&L?["text-feedback-warning",er.A.colors.TEXT_FEEDBACK_WARNING.css]:y&&R?["text-feedback-positive",er.A.colors.TEXT_FEEDBACK_POSITIVE.css]:y&&D?["text-strong",er.A.colors.TEXT_STRONG.css]:["interactive-text-default",er.A.colors.INTERACTIVE_TEXT_DEFAULT.css],[O,y,L,R,D]);return null==e?null:(0,E.jsxs)(tP,{onExpand:A,className:c?e4.tx:void 0,title:(0,E.jsxs)(E.Fragment,{children:[t?.name??r?.name??e?.gameName??"",null!=r&&r.verified?(0,E.jsx)(tr.m,{text:j.intl.string(j.t["4PJP5p"]),children:(0,E.jsx)(th.A,{size:16,color:er.A.colors.BACKGROUND_BRAND.css,children:(0,E.jsx)(ta.U,{size:"custom",width:16,height:16,color:er.A.colors.WHITE.css})})}):null]}),description:M,hint:null!=U?U:void 0,header:(0,E.jsxs)(E.Fragment,{children:[y||O?(0,E.jsx)(to.k,{size:"xxs",color:k}):(0,E.jsx)("div",{className:e4.W4}),(0,E.jsx)(es.E,{variant:"text-xs/semibold",color:V,children:j.intl.string(j.t.CDOx3w)})]}),icon:(0,E.jsx)(p.A,{game:t,pid:e?.pid,size:p.M.MEDIUM}),"aria-label":j.intl.string(j.t["87O5GC"]),action:(0,E.jsx)(en.D,{onClick:e=>e8(e),children:(0,E.jsx)(J.d,{checked:a&&f||u&&x,disabled:_,onChange:t=>{!function(t,i){if(null==e)return;let n=!1,s=!1;switch(i){case"game":tu.Ay.toggleOverlay(e,t,t),d(t),o(t),n=!t&&u,s=!t&&a;break;case"global":td.A.setEnabled(t,t),n=!t&&x,s=!t&&f;break;case"both":td.A.setEnabled(t,t),tu.Ay.toggleOverlay(e,t,t),d(t),o(t),n=!t&&x||!t&&u,s=!t&&f||!t&&a}let l=null;n?l="game"===i?tE.OverlayToggledClientSettingType.LEGACY_GAME:tE.OverlayToggledClientSettingType.LEGACY:s&&(l="game"===i?tE.OverlayToggledClientSettingType.OOP_GAME:tE.OverlayToggledClientSettingType.OOP),null!=l&&tN(l,e.id??null)}(t,function(e,t){let i=!t&&e,n=!f&&a,s=!x&&u,l=!a&&f,r=!u&&x;switch(!0){case i&&(n||s)&&(l||r):return"both";case i&&(n||s):return"global";default:return"game"}}(t,a&&f||u&&x))}})}),warning:(0,E.jsx)(tv,{className:e4.Hh,game:e}),children:[(0,E.jsx)(e7,{title:j.intl.string(j.t["7BlVIs"]),description:j.intl.string(j.t.ndgADE),hint:f?void 0:j.intl.string(j.t.cAFVsL),"aria-label":j.intl.string(j.t["7BlVIs"]),action:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(J.d,{checked:a&&f,disabled:T,onChange:e=>{e&&!f?N(e,tE.OverlayToggledClientSettingType.OOP):N(e,tE.OverlayToggledClientSettingType.OOP_GAME)}}),(0,E.jsx)("div",{className:e4.Kz})]})}),(0,E.jsx)(e7,{title:j.intl.string(j.t.BfFpW1),description:j.intl.string(j.t.OzInYk),hint:x?void 0:j.intl.string(j.t["3sYHXm"]),"aria-label":j.intl.string(j.t.BfFpW1),action:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(J.d,{checked:u&&x,disabled:h,onChange:e=>{e&&!x?N(e,tE.OverlayToggledClientSettingType.LEGACY):N(e,tE.OverlayToggledClientSettingType.LEGACY_GAME)}}),(0,E.jsx)("div",{className:e4.Kz})]})})]})},usePredicate:()=>{let{runningGame:e}=tl();return null!=e},useSearchTerms:()=>[j.intl.string(j.t["9cb1Uz"])]});var tM=i(364522),tU=i(206885);function tV(e){let{game:t,gameApplication:i}=e,n=S.useMemo(()=>null==t?null:"pid"in t?t.pid:null,[t]),s=(0,g.bG)([x.A],()=>null!=i?i:x.A.getApplication(t?.id),[i,t]);return(0,E.jsx)(p.A,{game:s,pid:n,size:p.M.SMALL})}function tk(e){let{rawGame:t,gameApplication:i,supportDisabled:n,getEnabledFromStatus:s,onChange:l,clientSettingType:r,ariaLabel:a}=e;(0,tA.I)(t?.id);let o=(0,g.cf)([m.Ay,ty.A,tj.A,tm.A],()=>(0,m.xU)(t,m.Ay,ty.A,tj.A,tm.A)),u=(0,g.cf)([ty.A,tj.A,tm.A],()=>(0,m.hw)(t,!1,[ty.A,tj.A,tm.A]),[t]),d=s(u),[c,A]=S.useState(d);return S.useEffect(()=>{A(d)},[d]),(0,E.jsx)(e7,{title:t.name,icon:(0,E.jsx)(tV,{game:o,gameApplication:i}),"aria-label":a,action:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(J.d,{checked:c,disabled:n,onChange:e=>{let i;return i=!e&&c,void(A(e),l(e,o,u),i&&tN(r,o.id??t?.id??null))}}),(0,E.jsx)("div",{className:e4.Kz})]})})}let tw=(0,a.E2)(u.X.OVERLAY_LEGACY_SETTING,{Component:function(){let[e,t]=S.useState(!1),{legacyEnabled:i,oopEnabled:n}=(0,g.cf)([tT.default],()=>tT.default.getGlobalEnabledStatus()),s=(0,g.yK)([m.Ay],()=>m.Ay.getGamesSeen(!0)).filter(e=>!(0,A.n1)(e)),l=(0,ti.A)(s.map(e=>e.id)),r=!(0,tO.supportsLegacy)();function a(e){td.A.setEnabled(e,n);let t=m.Ay.getCurrentGameForAnalytics()?.id??null;(0,tE.Q3)(e,tE.OverlayToggledClientSettingType.LEGACY,t),!e&&i&&tN(tE.OverlayToggledClientSettingType.LEGACY,t)}function o(e,t,i){let{enabledOOP:n}=i;tu.Ay.toggleOverlay(t,e,n)}let u=S.useMemo(()=>(0,tO.supportsLegacy)()?r?j.intl.string(j.t.r9jEVw):j.intl.string(j.t.OzInYk):j.intl.string(j.t["8Ox6/E"]),[r]);return 0===s.length?(0,E.jsx)(e7,{title:j.intl.string(j.t.BfFpW1),description:u,"aria-label":j.intl.string(j.t.BfFpW1),className:e4.dA,action:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(J.d,{checked:i,disabled:r,onChange:e=>a(e)}),tU.O&&(0,E.jsx)("div",{className:e4.Kz})]})}):(0,E.jsxs)(tP,{onExpand:t,className:e?e4.tx:void 0,title:j.intl.string(j.t.BfFpW1),description:u,"aria-label":j.intl.string(j.t.BfFpW1),action:(0,E.jsx)(en.D,{onClick:e=>e8(e),children:(0,E.jsx)(J.d,{checked:i,disabled:r,onChange:e=>a(e)})}),children:[(0,E.jsx)("div",{className:e4.SC,children:(0,E.jsx)(es.E,{variant:"text-xs/semibold",color:"text-muted",children:j.intl.string(j.t.FzoWRo)})}),(0,E.jsx)(tM.Ip,{className:e4.XG,children:s.map((e,t)=>(0,E.jsx)(tk,{rawGame:e,clientSettingType:tE.OverlayToggledClientSettingType.LEGACY_GAME,supportDisabled:r,gameApplication:l[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)]}),tF=(0,a.E2)(u.X.OVERLAY_OOP_SETTING,{Component:function(){let[e,t]=S.useState(!1),{oopEnabled:i,legacyEnabled:n}=(0,g.cf)([tT.default],()=>tT.default.getGlobalEnabledStatus()),s=!(0,tO.supportsOutOfProcess)(),l=(0,g.yK)([m.Ay],()=>m.Ay.getGamesSeen(!0)).filter(e=>!(0,A.n1)(e)),r=(0,ti.A)(l.map(e=>e.id));function a(e){let t=!e&&i;td.A.setEnabled(n,e);let s=m.Ay.getCurrentGameForAnalytics()?.id??null;(0,tE.Q3)(e,tE.OverlayToggledClientSettingType.OOP,s),t&&tN(tE.OverlayToggledClientSettingType.OOP,s)}function o(e,t,i){let{enabledLegacy:n}=i;tu.Ay.toggleOverlay(t,e,n)}let u=S.useMemo(()=>tU.O?s?j.intl.string(j.t.C7bLTQ):j.intl.string(j.t.ndgADE):j.intl.string(j.t.m7X4az),[s]);return 0===l.length?(0,E.jsx)(e7,{title:j.intl.string(j.t["7BlVIs"]),description:u,"aria-label":j.intl.string(j.t["7BlVIs"]),className:e4.dA,action:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(J.d,{checked:i,disabled:s,onChange:e=>a(e)}),tU.O&&(0,E.jsx)("div",{className:e4.Kz})]})}):(0,E.jsxs)(tP,{onExpand:t,className:e?e4.tx:void 0,title:j.intl.string(j.t["7BlVIs"]),description:u,"aria-label":j.intl.string(j.t["7BlVIs"]),action:(0,E.jsx)(en.D,{onClick:e=>e8(e),children:(0,E.jsx)(J.d,{checked:i,disabled:s,onChange:e=>a(e)})}),children:[(0,E.jsx)("div",{className:e4.SC,children:(0,E.jsx)(es.E,{variant:"text-xs/semibold",color:"text-muted",children:j.intl.string(j.t.FzoWRo)})}),(0,E.jsx)(tM.Ip,{className:e4.XG,children:l.map((e,t)=>(0,E.jsx)(tk,{rawGame:e,clientSettingType:tE.OverlayToggledClientSettingType.OOP_GAME,gameApplication:r[t],supportDisabled:s,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"])]}),tB=(0,a.zZ)(u.X.OVERLAY_ENABLE_CATEGORY,{useSubnavLabel:()=>j.intl.string(j.t["/dp6yY"]),buildLayout:()=>[tG,tF,tw,e9]}),tz=(0,a.zD)(u.X.OVERLAY_CLICKABLE_REGIONS_SETTING,{useValue:()=>(0,g.bG)([eY.default],()=>!eY.default.disableClickableRegions),setValue:e=>{td.A.setDisableClickableRegions(!e)},useTitle:()=>j.intl.string(j.t["+eFXxq"]),useSubtitle:()=>j.intl.string(j.t.kivMAp)});var tY=i(284009),tX=i.n(tY),tH=i(97260),tK=i(635242);let tW=(0,a.E2)(u.X.OVERLAY_KEYBIND_SETTING,{Component:function(){let e=(0,g.bG)([eB.Ay],()=>eB.Ay.getOverlayKeybind()),t=!(0,tO.supportsLegacy)(),i=!(0,tO.supportsOutOfProcess)(),[n,s]=(0,g.yK)([m.Ay],()=>[m.Ay.canShowAdminWarning,m.Ay.getVisibleGame()],[]),l=(0,tC.NP)(),r=null!=s&&s.elevated&&n&&!l,a=!(0,eB.DV)(e?.shortcut??[]);return(0,E.jsx)("div",{className:e4.hc,children:(0,E.jsxs)("div",{className:e4.eH,children:[(0,E.jsxs)("div",{className:e4.Bu,children:[(0,E.jsx)(es.E,{variant:"text-md/medium",color:"text-strong",children:j.intl.string(j.t.VsAZcC)}),r&&(0,E.jsx)(es.E,{variant:"text-xs/normal",color:"text-feedback-warning",className:e4.y7,children:j.intl.string(j.t.NsowVa)}),a&&(0,E.jsx)(es.E,{variant:"text-xs/normal",color:"text-feedback-warning",className:e4.y7,children:j.intl.string(j.t["UNoTw/"])})]}),(0,E.jsx)("div",{className:e4.IH,children:(0,E.jsx)(tK.A,{disabled:t&&i,defaultValue:null!=e?e.shortcut:[],onChange:function(t){tX()(null!=e,"Keybind should never be undefined"),tH.A.setKeybind({...e,shortcut:t})}})})]})})},useSearchTerms:()=>[j.intl.string(j.t.VsAZcC)]});var tZ=i(515183),tq=i(682763);let tQ=(0,a.zD)(u.X.OVERLAY_LIMITED_INTERACTION_OVERRIDE_SETTING,{usePredicate:()=>{let{runningGameApplication:e}=tl();return e?.id!=null},useDisabled:()=>{let{runningGame:e}=tl();return null!=e&&(0,tZ.qJ)(e.pid)},useValue:()=>{let{runningGame:e,runningGameApplication:t}=tl(),i=t?.id,n=(0,g.bG)([ew.A],()=>ew.A.isLimitedInteractionOverrideEnabled(i)),s=null!=e&&(0,tZ.qJ)(e.pid);return n||s},setValue:e=>{let t,i,n,s,{runningGameApplication:l}=(t=tn.A.getStreamerActiveStreamMetadata(),s=ts(t,n=null!=(i=m.Ay.getVisibleGame())?m.Ay.getGameOrTransformedSubgameForPID(i.pid):null),{runningGame:n??void 0,runningGameApplication:x.A.getApplication(s)??void 0});null!=l&&(0,tq.x8)(l.id,e)},useTitle:()=>j.intl.string(j.t.wgVQND),useSubtitle:()=>j.intl.string(j.t["5SsyF5"])}),tJ=(0,a.zZ)(u.X.OVERLAY_GENERAL_CATEGORY,{buildLayout:()=>[tW,tQ,tz]});var t$=i(93465);let t0=[{title:j.t.eVE4LX,description:j.t["72WNqk"],disabledSetting:t$.M.TEXT_CHAT,key:u.X.OVERLAY_NOTIFICATIONS_TEXT_CHAT},{title:j.t.oifnSh,description:j.t.bgU5r0,disabledSetting:t$.M.WELCOME_GENERAL,key:u.X.OVERLAY_NOTIFICATIONS_WELCOME},{title:j.t.hqsZJW,description:j.t.kHjdqc,disabledSetting:t$.M.GO_LIVE_NUDGE,key:u.X.OVERLAY_NOTIFICATIONS_GO_LIVE},{title:j.t.sop3rn,description:j.t.pjgffc,disabledSetting:t$.M.GAME_ACTIVITY,key:u.X.OVERLAY_NOTIFICATIONS_GAME_ACTIVITY},{title:j.t["2QVhbb"],description:j.t.wQ4ilB,disabledSetting:t$.M.NOW_PLAYING,key:u.X.OVERLAY_NOTIFICATIONS_NOW_PLAYING},{title:j.t.giM9fA,description:j.t.EhAfWj,disabledSetting:t$.M.NOW_PLAYING_DIFFERENT_GAMES,key:u.X.OVERLAY_NOTIFICATIONS_NOW_PLAYING_DIFFERENT_GAMES,usePredicate:()=>{let{showNowPlayingForDifferentGames:e}=(0,ek.M8)("OverlayV3NowPlayingDifferentGamesNotificationSetting"),t=(0,g.bG)([ew.A],()=>ew.A.isNotificationDisabledBySetting(t$.M.NOW_PLAYING));return!!e&&!t}}];function t1(e){return(0,a.zD)(e.key,{useTitle:()=>j.intl.string(e.title),useSubtitle:()=>j.intl.string(e.description),useValue:()=>!(0,g.bG)([ew.A],()=>ew.A.getDisabledNotifications().has(e.disabledSetting)),setValue:t=>{td.A.setNotificationDisabledSetting(e.disabledSetting,!t)},usePredicate:e.usePredicate})}let t2=(0,a.FW)(u.X.OVERLAY_NOTIFICATIONS_LIST,{variant:"compact",useTitle:()=>j.intl.string(j.t.gnKWdS),isTitleHiddenVisually:!0,buildLayout:()=>t0.map(t1)}),t3=(0,a.zZ)(u.X.OVERLAY_NOTIFICATIONS_CATEGORY,{useTitle:()=>j.intl.string(j.t.xOE5bA),buildLayout:()=>[t2]}),t6=(0,a.Hn)(u.X.OVERLAY_VOICE_WIDGET_AVATAR_SIZE,{useTitle:()=>j.intl.string(j.t.dnvZSg),useValue:()=>(0,g.bG)([eY.default],()=>eY.default.getAvatarSizeMode()),setValue:e=>{td.A.setAvatarSizeMode(e)},useOptions:()=>[{id:"large",label:j.intl.string(j.t.YcOxtr),value:U.OSZ.LARGE},{id:"small",label:j.intl.string(j.t.BKIKqx),value:U.OSZ.SMALL}]}),t5=(0,a.Hn)(u.X.OVERLAY_VOICE_WIDGET_DISPLAY_NAMES,{useTitle:()=>j.intl.string(j.t.J0dpcB),useValue:()=>(0,g.bG)([eY.default],()=>eY.default.getDisplayNameMode()),setValue:e=>{td.A.setDisplayNameMode(e)},useOptions:()=>[{id:"always",label:j.intl.string(j.t.nBmDrT),value:U.pwA.ALWAYS},{id:"speaking",label:j.intl.string(j.t["2OvIZY"]),value:U.pwA.ONLY_WHILE_SPEAKING},{id:"never",label:j.intl.string(j.t.ekjlPL),value:U.pwA.NEVER}]}),t4=(0,a.Hn)(u.X.OVERLAY_VOICE_WIDGET_DISPLAY_USERS,{useTitle:()=>j.intl.string(j.t.swsWWC),useValue:()=>(0,g.bG)([eY.default],()=>eY.default.getDisplayUserMode()),setValue:e=>{td.A.setDisplayUserMode(e)},useOptions:()=>[{id:"always",label:j.intl.string(j.t.nBmDrT),value:U.f5z.ALWAYS},{id:"speaking",label:j.intl.string(j.t["2OvIZY"]),value:U.f5z.ONLY_WHILE_SPEAKING}]});var t8=i(391973),t7=i(489277),t9=i(897720),ie=i(38502);function it(){let e=t7.A.getWidgetByType(U.uss.VOICE_V3);if(null==e)return null;let t=ie.A.getWidget(e.id);return null!=t&&(0,t9.ZO)(t)?t:null}i(392164);let ii=(0,a.sN)(u.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=it();return e?.meta.voiceStatesMaxShown??8},onValueRender:function(e){return e<1?j.intl.string(j.t.nrUzFL):`${Math.floor(e)}`},setValue:e=>{let t=it();null!=t&&(e<1?(0,t8.cC)(t.id,{voiceStatesMaxShown:-1}):(0,t8.cC)(t.id,{voiceStatesMaxShown:Math.floor(e)}))}});var is=i(43990),il=i(450740),ir=i(968898),ia=i(95701),io=i(889227),iu=i(288737),id=i(287809);function ic(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s="456"+Math.floor(1e6*Math.random());return{voiceState:new iu.A({channelId:"123",userId:s,sessionId:"789",mute:t,deaf:i,selfMute:!1,selfDeaf:!1,selfVideo:!1,selfStream:!1,discoverable:n}),user:new io.A({id:s,username:e}),member:{nick:e,userId:s,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 ig=(0,a.E2)(u.X.OVERLAY_VOICE_WIDGET_PREVIEW,{Component:function(){let e,t=(0,g.bG)([id.default],()=>id.default.getCurrentUser()),{avatarSizeMode:i,displayNameMode:n,displayUserMode:s}=(0,g.cf)([eY.default],()=>({avatarSizeMode:eY.default.getAvatarSizeMode(),displayNameMode:eY.default.getDisplayNameMode(),displayUserMode:eY.default.getDisplayUserMode()})),[l]=S.useState(()=>[ic(j.intl.string(j.t.C0ZDvo),!0,!1),ic(j.intl.string(j.t.iOtj8E),!1,!1,!0),ic(j.intl.string(j.t["0oqNgL"]),!1,!0)]),r=(0,g.bG)([t7.A,ie.A],()=>{let e=t7.A.getWidgetByType(U.uss.VOICE_V3);if(null==e)return null;let t=ie.A.getWidget(e.id);return null!=t&&(0,t9.ZO)(t)?t:null}),a=r?.meta?.voiceStatesMaxShown??8,o=[null!=t?((e=ic(t.username)).user=t,e):null,...l].filter(N.Vq),u=[new Map(o.map(e=>[e.user.id,e])),o.map(e=>e.user.id)],d=(0,E.jsx)(is.N,{theme:U.NJ8.MIDNIGHT,children:e=>(0,E.jsxs)("div",{className:e6()(e4.Y5,e),children:[(0,E.jsx)("div",{className:e4.kJ,children:(0,E.jsx)(il.DH,{id:"voice-widget",title:j.intl.string(j.t.KNJ6Vq),channel:(0,ia.createChannelRecord)({id:"123",name:"Test Channel",type:U.rbe.GUILD_VOICE,guild_id:"456"}),overlayVoiceStates:u,displayNameMode:n,displayUserMode:s,avatarSizeMode:i,widget:U.uss.VOICE,anchorLeft:!0,application:null,stream:null,streamApplication:null,streamMetadata:null,locked:!1,pinned:!1,isSettingsPreview:!0,isPreviewingInGame:!1,maxDisplayedVoiceStates:a})}),(0,E.jsxs)("div",{className:e4.R$,children:[(0,E.jsx)(ir.Pl,{children:j.intl.string(j.t.KNJ6Vq)}),(0,E.jsx)(ir.CS,{}),(0,E.jsx)(ir.O0,{id:r?.id??"voice-widget",pinned:r?.pinned??!1})]})]})});return(0,E.jsx)("div",{className:e4.F9,children:d})},useSearchTerms:()=>[]}),im=(0,a.zZ)(u.X.OVERLAY_VOICE_WIDGET_CATEGORY,{useTitle:()=>j.intl.string(j.t.r1TZfh),buildLayout:()=>[ig,t6,t5,t4,ii]});var iA=i(49999),ih=i(102937);function iE(){let[e,t]=(0,eV.kn)([eU.M.OVERLAY_OOP_SETTINGS_NUX],void 0,!0);return((0,eL.Ay)(()=>()=>{t(iA.i.AUTO_DISMISS)}),e!==eU.M.OVERLAY_OOP_SETTINGS_NUX)?null:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)("div",{className:ih.xC,children:[(0,E.jsx)("div",{children:(0,E.jsx)("img",{src:"https://cdn.discordapp.com/assets/content/10b8ab47f3371360233219f4b20fa86155553ddb810ceb8688654738bf7e15d0.png",alt:j.intl.string(j.t.mdXZh1),className:ih.tl})}),(0,E.jsx)("div",{children:(0,E.jsxs)("div",{className:ih.vJ,children:[(0,E.jsx)(eP.D,{variant:"heading-xl/medium",color:"text-strong",children:j.intl.string(j.t.jzjJQg)}),(0,E.jsx)(es.E,{variant:"text-md/normal",color:"text-muted",children:j.intl.string(j.t["5dOfxb"])})]})}),(0,E.jsx)("div",{children:(0,E.jsx)("img",{src:"https://cdn.discordapp.com/assets/content/2aa57f16c71171fc8e0edb8cca60735f1192195344d17fa667de6d3ca8163ba0.png",alt:j.intl.string(j.t.mdXZh1),className:ih.lh})}),(0,E.jsx)("div",{"data-button-hoisted-classname-wrapper":!0,className:ih.VV,children:(0,E.jsx)(eG.$,{variant:"primary",text:j.intl.string(j.t.Q26diF),onClick:()=>void t(iA.i.DISMISS)})})]}),(0,E.jsx)(eM.c,{className:ih.yF})]})}function iS(){let e=(0,g.bG)([eF.A],()=>eF.A.enabled),t=(0,ek.Mn)("OverlayStreamerModeNotice");return e&&t?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(q.w,{type:"warning",children:j.intl.format(j.t.fuEX5B,{onClick:function(){return(0,eH.openUserSettings)(u.X.STREAMER_MODE_CATEGORY)}})}),(0,E.jsx)(eM.c,{className:ih.yF})]}):null}let iT=(0,a.t_)(u.X.OVERLAY_PANEL,{initialize:function(){return e$(),eB.Ay.addChangeListener(e$),ew.A.addChangeListener(e$),eY.default.addChangeListener(e$),ez.default.addChangeListener(e$),eX.isPlatformEmbedded&&(0,_.a2)(),()=>{eB.Ay.removeChangeListener(e$),ew.A.removeChangeListener(e$),eY.default.removeChangeListener(e$),ez.default.removeChangeListener(e$),eX.isPlatformEmbedded&&(0,_.e0)()}},useTitle:()=>j.intl.string(j.t["9cb1Uz"]),decoration:{type:h.t9.STRONGLY_DISCOURAGED_CUSTOM,component:function(){return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(iE,{}),(0,E.jsx)(iS,{})]})}},buildLayout:()=>[tB,tJ,im,t3]}),ix=(0,a.i4)(u.X.OVERLAY_SIDEBAR_ITEM,{useTitle:()=>j.intl.string(j.t["9cb1Uz"]),icon:eD.l,usePredicate:eK.b_,buildLayout:()=>[iT]});var ip=i(687966);let iN=(0,a.AK)(u.X.REGISTERED_GAMES_TO_ACTIVITY_PRIVACY_NAVIGATOR,{useSubtitle:()=>j.intl.string(j.t.OYYY6q),destinationKey:u.X.ACTIVITY_PRIVACY_PANEL}),i_=(0,a.gN)(u.X.REGISTERED_GAMES_RELATED_SETTINGS,{usePredicate:()=>(0,o.SV)("RegisteredGamesRelatedSettings"),buildLayout:()=>[iN]});var iI=i(396478),iC=i(270003),ib=i(227309),iv=i(363195),iy=i(1215),ij=i(39623),iO=i(952270),iR=i(138134),iL=i(414079),iD=i(29160),iP=i(650583),iG=i(18293),iM=i(582835);let iU=(0,eX.isWindows)();function iV(e){let{rawGame:t,nowPlaying:n=!1,isOverride:s,subgames:l,isSubgame:r=!1,parentGame:a}=e;(0,tA.I)(t.id);let o=(0,g.cf)([m.Ay,ty.A,tj.A,tm.A],()=>(0,m.xU)(t,m.Ay,ty.A,tj.A,tm.A)),{canToggleDetection:u,isCurrentGameDetectionEnabled:d}=(0,g.cf)([m.Ay],()=>({canToggleDetection:null==a||m.Ay.isDetectionEnabled(a),isCurrentGameDetectionEnabled:m.Ay.isDetectionEnabled(o)})),c=(0,g.bG)([m.Ay],()=>m.Ay.getVisibleGame()),[h,T]=S.useState(!1),x=S.useMemo(()=>(0,A.n1)(o)?r?o.gameName:j.intl.formatToPlainString(j.t.G6BGdx,{subgameName:o.gameName}):o.name,[o,r]),[p,f]=S.useState(x??"???"),N=e6()(iM.tR,{[iG.LO]:!n,[iG.Rw]:n,[iG.FB]:null!=o&&n,[iG.xL]:r,[iG.fG]:null!=l&&l.length>0});function _(){null!=l&&l.length>0&&d?(0,K.openModalLazy)(async()=>{let{Modal:e}=await i.e("4823").then(i.bind(i,158954));return t=>(0,E.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:()=>{tu.Ay.toggleDetection(o),t.onClose()},variant:"primary"}]})}):tu.Ay.toggleDetection(o)}let I=null!=c&&(0,m.Es)(o)===(0,m.Es)(c),C=null!=a&&a.id===c?.id||I||null!=l&&l.some(e=>e.id===c?.id);return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)("div",{className:N,children:[(0,E.jsxs)("div",{className:e6()(iG.$K,iM.Vd),children:[o.verified&&!s?(0,E.jsxs)("div",{className:iG.HS,children:[(0,E.jsx)("div",{className:iG.mO,children:x}),(0,E.jsx)(tr.m,{text:j.intl.string(j.t["4PJP5p"]),children:(0,E.jsx)(th.A,{className:iG.qf,size:18,color:er.A.unsafe_rawColors.BRAND_500.css,children:(0,E.jsx)(ta.U,{size:"custom",width:18,height:18,color:er.A.unsafe_rawColors.WHITE.css})})})]}):(0,E.jsx)("input",{className:e6()(iG.mO,iG.sr),type:"text",maxLength:128,value:p,onBlur:function(){o.name!==p&&tu.Ay.editName(o,p)},onKeyDown:function(e){e.key===iP.dh.ENTER&&(e.currentTarget.blur(),e.preventDefault())},onChange:e=>f(e.target.value)}),function(){let e,t,{played:i,exePath:s}=o;return n||I?e=j.intl.string(j.t.VbV5dv):null!=i&&""!==i&&(e=j.intl.format(j.t["gGeOE+"],{when:i})),(0,E.jsx)("div",{className:iG.GN,children:(0,E.jsx)(iD.A,{hoverText:null!=s&&""!==s?(t=s.replace(/^file:\/\//i,""),(0,eX.isWindows)()&&(t=t.toUpperCase()),t):"",children:e})})}()]}),s||h?null:(0,E.jsx)("div",{className:e6()(iM.tR,iM.oA,iM.LT,iG.E3),children:(0,E.jsx)(tr.m,{text:j.intl.string(j.t["y0B+lo"]),children:(0,E.jsx)(en.D,{"aria-label":j.intl.string(j.t["y0B+lo"]),className:iG.ym,onClick:function(){if(h)return;let e=null!=o.id?ty.A.getDetectableGame(o.id):null;G.default.track(U.HAw.USER_SETTINGS_REPORT_INCORRECT_GAME_DETECTION,{application_id:e?.id,game_name:(0,A.n1)(o)?o.gameName:o.name}),T(!0),(0,K.openModalLazy)(async()=>{let{default:t}=await Promise.all([i.e("21072"),i.e("27495")]).then(i.bind(i,651930));return i=>(0,E.jsx)(t,{...i,detectedActivity:{name:o.name??"",application_id:e?.id??o.id??void 0,type:U.$pd.PLAYING},onSubmitted:()=>{}})})},children:(0,E.jsx)(iR.i,{size:"md",color:"currentColor",className:iG.Lj,colorClass:iG.GS})})})}),function(){let{detectable:e}=o,t=e&&u?(0,E.jsx)(ij.b,{size:"md",color:"currentColor",className:iG.Lj,colorClass:iG.GS}):(0,E.jsx)(iO.G,{size:"md",color:"currentColor",className:u?iG.$V:iG.zN,colorClass:iG.GS});return(0,E.jsx)("div",{className:e6()(iM.tR,iM.oA,iM.LT,iG.E3),children:(0,E.jsx)(tr.m,{text:j.intl.string(j.t.QmitzM),children:u?(0,E.jsx)(en.D,{"aria-label":j.intl.string(j.t.QmitzM),className:iG.ym,onClick:_,children:t}):t})})}(),function(){if(!iU||null!=a)return null;let{overlay:e,overlayWarn:t}=o,i=e?(0,E.jsx)(to.k,{size:"md",color:"currentColor",className:iG.Lj,colorClass:iG.GS}):(0,E.jsx)(iy.n,{size:"md",color:"currentColor",className:iG.$V,colorClass:iG.GS}),n=t?(0,E.jsx)(tr.m,{text:j.intl.string(j.t.Vfw2L5),children:(0,E.jsx)("i",{className:iG.kb})}):null;return(0,E.jsxs)("div",{className:e6()(iM.tR,iM.oA,iM.LT,iG.E3),children:[n,(0,E.jsx)(tr.m,{text:j.intl.string(j.t["1+O+Tu"]),children:(0,E.jsx)(en.D,{"aria-label":j.intl.string(j.t["1+O+Tu"]),className:iG.ym,onClick:()=>{var t;return t=!e,void tu.Ay.toggleOverlay(o,t,t)},children:i})})]})}(),n&&!s||C?null:(0,E.jsx)(iL.A,{className:iG.LS,onClick:function(){tu.Ay.deleteEntry(o),l?.forEach(e=>{tu.Ay.deleteEntry(e)})}})]}),null!=l&&l.length>0&&!n&&(0,E.jsx)("div",{className:iG.AQ,children:l.map((e,t)=>(0,E.jsxs)(S.Fragment,{children:[(0,E.jsx)(iV,{rawGame:e,isOverride:!1,isSubgame:!0,parentGame:o}),t!==l.length-1&&(0,E.jsx)("div",{className:iG.PQ})]},(0,m.Es)(e)))})]})}var ik=i(522826);function iw(){let e=(0,g.bG)([iv.A],()=>iv.A.theme);return(0,E.jsxs)(iI.pp,{theme:e,className:ik.eT,children:[(0,E.jsx)(iI.G8,{darkSrc:i(839628),lightSrc:i(446404),width:430,height:250}),(0,E.jsx)(iI.SG,{children:j.intl.string(j.t["1yiJwn"])})]})}function iF(){let{gameHistory:e,robloxSubgameHistory:t,overrideExePaths:i}=C();return 0===e.length?(0,E.jsx)(iw,{}):(0,E.jsx)(iC.n,{children:(0,E.jsx)("div",{children:e.map(e=>(0,E.jsx)(iV,{rawGame:e,isOverride:i.has(e.exePath),subgames:e.id===ib.a7?t:void 0},(0,m.Es)(e)))})})}let iB=(0,a.E2)(u.X.REGISTERED_GAMES_ADDED_GAMES_SETTING,{useSearchTerms:()=>[],Component:()=>(0,E.jsx)(iF,{})});var iz=i(424994);let iY=(0,a.zZ)(u.X.REGISTERED_GAMES_ADDED_GAMES_CATEGORY,{buildLayout:()=>[iB,i_],useTitle:()=>j.intl.string(j.t.jCOdvx),useSubtitle:()=>j.intl.format(j.t.KPA3m9,{igdbLink:iz.s8})});var iX=i(305866),iH=i(783878),iK=i(930863),iW=i(997213);function iZ(e){let{onClose:t}=e,i=(0,g.bG)([m.Ay],()=>m.Ay.getCandidateGames()),[n,s]=S.useState(null),l=i.map(e=>({id:e.pid.toString(),value:e,label:null!=e.name?e.name:""}));return(0,E.jsxs)(iX.l,{className:e6()(iK.H,iW.Y_),"aria-label":j.intl.string(j.t.GTCx0p),children:[(0,E.jsx)(iH.Z,{selectionMode:"single",placeholder:j.intl.string(j.t.XqMe3N),value:n,options:l,onSelectionChange:function(e){s(e)}}),(0,E.jsx)(eM.c,{className:e6()(ik.Ot,ik.QB)}),(0,E.jsxs)("div",{className:e6()(iK.o,iM.xM),children:[(0,E.jsx)(ea.Q,{variant:"secondary",text:j.intl.string(j.t["ETE/oC"]),onClick:t}),(0,E.jsx)(eG.$,{variant:"primary",text:j.intl.string(j.t.GTCx0p),disabled:null==n,onClick:function(){null!=n&&(tu.Ay.addGame(n.pid,n.name),t())}})]})]})}var iq=i(347990);let iQ=(0,a.E2)(u.X.REGISTERED_GAMES_ADD_GAME_SETTING,{useSearchTerms:()=>[j.intl.string(j.t.GTCx0p)],Component:function(){let e=S.useRef(null);return(0,E.jsxs)("div",{className:e6()(iq.a,ik.Gf),children:[(0,E.jsx)("span",{children:j.intl.string(j.t.xwhoqM)}),(0,E.jsx)(ee.Y,{targetElementRef:e,renderPopout:e=>{let{closePopout:t}=e;return(0,E.jsx)(iZ,{onClose:t})},align:"center",position:"bottom",children:t=>(0,E.jsx)(ea.Q,{...t,buttonRef:e,variant:"primary",textVariant:"text-sm/medium",text:j.intl.string(j.t.GjgdXe)})})]})}});function iJ(){return(0,E.jsx)("div",{className:e6()(iM.tR,iG.eS,iG.Rw),children:(0,E.jsxs)("div",{className:e6()(iG.$K,iM.Vd),children:[(0,E.jsx)("div",{className:iG.mO,children:j.intl.string(j.t.H68X9x)}),(0,E.jsx)("div",{className:iG.GN,children:j.intl.string(j.t.T5Ilmw)})]})})}let i$=(0,a.E2)(u.X.REGISTERED_GAMES_CURRENT_GAME_SETTING,{useSearchTerms:()=>[j.intl.string(j.t["MY9/Oe"])],Component:function(){let{robloxSubgameHistory:e,overrideExePaths:t}=C(),i=(0,g.bG)([m.Ay],()=>m.Ay.getVisibleGame());return null!=i?(0,E.jsx)(iV,{rawGame:i,isOverride:t.has(i.exePath),nowPlaying:!0,subgames:i.id===ib.a7?e:void 0},(0,m.Es)(i)):(0,E.jsx)(iJ,{})}}),i0=(0,a.zZ)(u.X.REGISTERED_GAMES_CURRENT_GAME_CATEGORY,{useTitle:()=>j.intl.string(j.t["MY9/Oe"]),buildLayout:()=>[i$,iQ]}),i1=(0,a.t_)(u.X.REGISTERED_GAMES_PANEL,{useTitle:()=>j.intl.string(j.t.AVDyEj),buildLayout:()=>[i0,iY]}),i2=(0,a.i4)(u.X.REGISTERED_GAMES_SIDEBAR_ITEM,{useTitle:()=>j.intl.string(j.t.AVDyEj),icon:ip._,usePredicate:eK.Pi,buildLayout:()=>[i1]}),i3=(0,a.WI)(u.X.ACTIVITY_SECTION,{useTitle:()=>j.intl.string(j.t.nVPpLM),buildLayout:()=>[eR,i2,ix]});var i6=i(550640),i5=i(346055),i4=i(97808),i8=i(778712),i7=i(775602),i9=i(320095),ne=i(963852),nt=i(763754),ni=i(20851),nn=i(486020),ns=i(827053);let nl=new ia.nA({id:"1337",guild_id:"1337",type:U.rbe.GUILD_TEXT,name:"preview"}),nr=[{status:U.clD.IDLE,discriminator:"2"},{status:U.clD.DND,discriminator:"3"},{status:U.clD.ONLINE,mobile:!0,discriminator:"4"}];function na(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,i9.rh)({...(0,ne.Ay)({channelId:nl.id,content:e}),state:U.cmJ.SENT,reactions:t})}var no=i(856488);let nu=(0,a.zD)(u.X.ENABLE_LEGACY_CHAT_INPUT,{useTitle:()=>j.intl.string(j.t.TZ2hZH),useSubtitle:()=>j.intl.string(j.t.Q7wgHc),useValue:()=>L.D_.useSetting(),setValue:e=>L.D_.updateSetting(e)}),nd=(0,a.zD)(u.X.CHAT_INLINE_MEDIA_IMAGE_DESCRIPTIONS,{useTitle:()=>j.intl.string(j.t.XYvMIX),useSubtitle:()=>j.intl.string(j.t.T0rbtM),useValue:L._z.useSetting,setValue:L._z.updateSetting});var nc=i(100767),ng=i(106236),nm=i(113494),nA=i(782134),nh=i(54570),nE=i(8880),nS=i(75804);let nT=eZ().debounce(e=>{(0,nh.zU)(e)},250);function nx(){let[e,t]=S.useState(!1);return(0,eL.l0)(()=>(0,nh.pr)()),(0,E.jsx)(eG.$,{text:j.intl.string(j.t.SKNnqq),icon:e?nm.E:nA.u,size:"sm",onClick:function(){if(e){(0,nh.pr)(),t(!1);return}(0,nh.AU)(j.intl.string(j.t.PKaNJL),!0,void 0,function(){return t(!0)},function(){return t(!1)}),t(!0)}})}let np=(0,a.E2)(u.X.TTS_PLAYBACK_RATE,{useSearchTerms:()=>[j.intl.string(j.t.lsW5Ev)],Component:function(){let e=(0,g.bG)([nE.A],()=>nE.A.speechRate);return(0,E.jsxs)(Q.B,{gap:16,children:[(0,E.jsx)(ng.A,{label:j.intl.string(j.t.lsW5Ev),description:j.intl.string(j.t.Ci4wMS),markers:nS.P,initialValue:e,defaultValue:1,stickToMarkers:!0,onValueChange:nT,onValueRender:e=>`x${e.toFixed(2)}`,onMarkerRender:e=>0===e?(0,E.jsx)(es.E,{variant:"text-xs/medium",color:"text-subtle",children:j.intl.string(j.t["493lwX"])}):10===e?(0,E.jsx)(es.E,{variant:"text-xs/medium",color:"text-subtle",children:j.intl.string(j.t.ZSZEdS)}):1===e?(0,E.jsx)(es.E,{variant:"text-xs/medium",color:"text-feedback-positive",children:"x1.0"}):e%1==0?"":void 0}),(0,E.jsx)(nx,{})]})},usePredicate:()=>nc.$j}),nf=(0,a.zZ)(u.X.AUDIO_AND_SCREEN_READER_CATEGORY,{useTitle:()=>j.intl.string(j.t.XVR0Rb),buildLayout:()=>[np,nd,nu]}),nN=(0,a.AK)(u.X.ACCESSIBILITY_TO_DISPLAY_NAVIGATOR,{useSubtitle:()=>j.intl.string(j.t.aTfeGK),destinationKey:u.X.APPEARANCE_PANEL}),n_=(0,a.gN)(u.X.COLOR_AND_CONTRAST_RELATED_SETTINGS,{buildLayout:()=>[nN]});var nI=i(955572);let nC=(0,a.zD)(u.X.DESATURATE_CUSTOM_COLORS,{useTitle:()=>j.intl.string(j.t.OCJg5f),useSubtitle:()=>j.intl.string(j.t.HEO0s3),useValue:()=>(0,g.bG)([i7.Ay],()=>i7.Ay.desaturateUserColors),setValue:()=>(0,nI.YV)()});var nb=i(652525);let nv=(0,a.zD)(u.X.ENABLE_CUSTOM_CURSOR,{useTitle:()=>j.intl.string(j.t["+Isihb"]),useSubtitle:()=>j.intl.string(j.t.nNZ1Tz),useValue:()=>(0,g.bG)([i7.Ay],()=>i7.Ay.enableCustomCursor),setValue:e=>(0,nI.ts)(e),usePredicate:()=>(0,nb.t)("EnableCustomCursorSetting")}),ny=(0,a.zD)(u.X.ENABLE_SWITCH_ICONS,{useTitle:()=>j.intl.string(j.t["S3z+pV"]),useSubtitle:()=>j.intl.string(j.t["3QuI9+"]),useValue:()=>(0,g.bG)([i7.Ay],()=>i7.Ay.isSwitchIconsEnabled),setValue:e=>(0,nI.Gm)(e),hasIcon:!0}),nj=(0,a.zD)(u.X.HIGH_CONTRAST_MODE,{useTitle:()=>j.intl.string(j.t.aZlePv),useSubtitle:()=>j.intl.string(j.t["v2qF8+"]),useValue:()=>(0,g.bG)([i7.Ay],()=>i7.Ay.isHighContrastModeEnabled),setValue:e=>(0,nI.uh)(e?i7._1.HIGH:i7._1.DEFAULT),getDismissibleBadges:()=>[{badgeType:h.Xi.NEW,dismissibleContent:eU.M.ACCESSIBILITY_HIGH_CONTRAST_MODE_NEW_BADGE}]});var nO=i(406360),nR=i(742023);let nL=(0,a.Qx)(u.X.HIGH_DYNAMIC_RANGE,{useTitle:()=>j.intl.string(j.t.nemtgW),useSubtitle:()=>j.intl.string(j.t["O/Gjvn"]),usePersistentBadge:()=>({badgeType:h.Xi.BETA}),useOptions:function(){return S.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,nO.i)("HDRDynamicRangeSetting")},setValue:function(e){(0,nI.FU)(e)},useValue:function(){return(0,g.bG)([nR.Ay],()=>nR.Ay.hdrDynamicRange)},useSearchTerms:()=>["HDR",j.intl.string(j.t["O/Gjvn"])]}),nD=(0,a.Hn)(u.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,g.bG)([i7.Ay],()=>i7.Ay.officialMessageStyle),setValue:e=>(0,nI.w_)(e)}),nP=(0,a.Hn)(u.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,g.bG)([i7.Ay],()=>i7.Ay.roleStyle),setValue:e=>(0,nI.IX)(e)});(0,a.Qx)(u.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,g.bG)([i7.Ay],()=>i7.Ay.roleStyle),setValue:e=>(0,nI.IX)(e)});let nG=(0,a.sN)(u.X.SATURATION,{useTitle:()=>j.intl.string(j.t["5PWWCY"]),useSubtitle:()=>j.intl.string(j.t.xf5S6P),markers:U.hH7.SATURATION_INCREMENTS,onMarkerRender:e=>100*e%2==0?`${100*e}%`:void 0,stickToMarkers:!0,minValue:0,maxValue:1,getInitialValue:()=>i7.Ay.saturation,asValueChanges:e=>(0,nI.HU)(e)});var nM=i(839214),nU=i(502229);let nV=(0,nM.D)(()=>({syncEnabled:null,updateTimeout:null})),nk=(0,a.zD)(u.X.SYNC_FORCED_COLORS,{useTitle:()=>j.intl.string(j.t.cguiec),useSubtitle:()=>j.intl.format(j.t.GwEVE2,{learnMoreLink:tI.A.getArticleURL(U.MVz.FORCED_COLORS)}),useValue:()=>{let e=(0,g.bG)([i7.Ay],()=>i7.Ay.syncForcedColors);return(0,tg.Ay)(()=>{nV.setState({syncEnabled:i7.Ay.syncForcedColors})}),nV.useState(e=>e.syncEnabled)??e},setValue:e=>{let{updateTimeout:t}=nV.getState();if(null!=t){clearTimeout(t),nV.setState({syncEnabled:e,updateTimeout:null});return}if(e===i7.Ay.syncForcedColors)return void nV.setState({syncEnabled:e});let i=setTimeout(()=>{(0,nI.D3)(e),nV.setState({updateTimeout:null})},150);nV.setState({syncEnabled:e,updateTimeout:i})},usePredicate:()=>(0,nU.D)()}),nw=(0,a.zZ)(u.X.COLOR_AND_CONTRAST_CATEGORY,{useTitle:()=>j.intl.string(j.t.JqvyiY),buildLayout:()=>[nG,nC,nj,nv,nk,nL,nP,nD,ny,n_]});var nF=i(397438),nB=i(355097);function nz(e){return(0,g.bG)([nF.A],()=>(function(e){switch(e){case nB._A.REDUCED_MOTION:return j.intl.format(j.t["1dT9V4"],{});case nB._A.REDUCED_MOTION_STICKERS:return j.intl.string(j.t["2ExvRu"]);default:return}})(nF.A.getAppliedOverrideReasonKey(e)))}let nY=(0,a.zD)(u.X.ANIMATE_EMOJIS,{useTitle:()=>j.intl.string(j.t.iIaOlc),useSubtitle:()=>nz("animateEmoji"),useValue:()=>L.Sf.useSetting(),setValue:e=>L.Sf.updateSetting(e)}),nX=(0,a.zD)(u.X.ANIMATE_GIFS,{useTitle:()=>j.intl.string(j.t.wqsK7q),useSubtitle:()=>nz("gifAutoPlay"),useValue:()=>L.kt.useSetting(),setValue:e=>L.kt.updateSetting(e)});var nH=i(823894);let nK=(0,a.Qx)(u.X.ANIMATE_STICKERS,{useTitle:()=>j.intl.string(j.t.sBHIh0),useSubtitle:()=>nz("animateStickers"),useOptions:()=>[{name:j.intl.string(j.t["Xp+X2U"]),value:nH.BJ.ALWAYS_ANIMATE},{name:j.intl.string(j.t.IlLT7e),desc:j.intl.string(j.t.bIW9Tl),value:nH.BJ.ANIMATE_ON_INTERACTION},{name:j.intl.string(j.t.IGu8x3),value:nH.BJ.NEVER_ANIMATE}],useValue:()=>L.S0.useSetting(),setValue:e=>L.S0.updateSetting(e)}),nW=(0,a.zD)(u.X.REDUCED_MOTION,{useTitle:()=>j.intl.string(j.t.b3XBzg),useSubtitle:()=>j.intl.format(j.t.XqvxJc,{helpdeskArticle:tI.A.getArticleURL(U.MVz.REDUCED_MOTION)}),useValue:()=>(0,g.bG)([i7.Ay],()=>i7.Ay.useReducedMotion),setValue:e=>(0,nI.qz)(e?"reduce":"no-preference")}),nZ=(0,a.zD)(u.X.SYNC_REDUCED_MOTION,{useTitle:()=>j.intl.string(j.t.oL55A6),useValue:()=>(0,g.bG)([i7.Ay],()=>"auto"===i7.Ay.rawPrefersReducedMotion),setValue:e=>(0,nI.qz)(e?"auto":i7.Ay.systemPrefersReducedMotion)}),nq=(0,a.zZ)(u.X.MOTION_CATEGORY,{useTitle:()=>j.intl.string(j.t.e3TR1b),buildLayout:()=>[nW,nZ,nX,nY,nK]});var nQ=i(688810),nJ=i(259065),n$=i(864386);let n0=(0,a.zD)(u.X.DISPLAY_NAME_STYLES,{useTitle:()=>j.intl.string(n$.default["2gFUEw"]),useSubtitle:()=>{let{analyticsLocations:e}=(0,nQ.Ay)();return j.intl.format(n$.default.aEax6P,{onClickOpenModal(){(0,nJ.L)({analyticsLocations:e})}})},useValue:()=>(0,g.bG)([i7.Ay],()=>i7.Ay.displayNameStylesEnabled),setValue:e=>(0,nI.Dm)(e)});function n1(e){return`${e.toFixed(0)}px`}let n2=(0,a.sN)(u.X.APPEARANCE_FONT_SCALING,{useTitle:()=>j.intl.string(j.t.rT3Pq5),useSubtitle:()=>j.intl.string(j.t.LXUhen),markers:U.hH7.FONT_SIZES,stickToMarkers:!0,minValue:U.hH7.FONT_SIZES["0"],maxValue:U.hH7.FONT_SIZES[U.hH7.FONT_SIZES.length-1],useDefaultValue:()=>U.hH7.FONT_SIZE_DEFAULT,getInitialValue:()=>i7.Ay.fontSize,onValueRender:n1,onMarkerRender:n1,asValueChanges:e=>(0,nI.XS)(e)}),n3=(0,a.zD)(u.X.UNDERLINE_LINKS,{useTitle:()=>j.intl.string(j.t.OLZFB8),useSubtitle:()=>j.intl.string(j.t.DIX3ke),useValue:()=>(0,g.bG)([i7.Ay],()=>i7.Ay.alwaysShowLinkDecorations),setValue:e=>(0,nI.kI)(e)}),n6=(0,a.zZ)(u.X.TEXT_READABILITY_CATEGORY,{useTitle:()=>j.intl.string(j.t["bxh/R7"]),buildLayout:()=>[n2,n3,n0]}),n5=(0,a.Qx)(u.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:H.NS.COMPACT},{name:j.intl.string(j.t.bBvAEH),value:H.NS.DEFAULT},{name:j.intl.string(j.t["4cuYHx"]),value:H.NS.COZY}],useValue:()=>L.Xi.useSetting(),setValue:e=>{e!==H.NS.UNSET_UI_DENSITY&&L.Xi.updateSetting(e)}}),n4="cozy",n8="compact",n7=(0,a.Qx)(u.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:n4},{name:j.intl.string(j.t["1JNcPS"]),value:n8}],useValue:()=>L.hH.useSetting()?n8:n4,setValue:e=>{L.hH.updateSetting(e===n8),(0,nI.AC)()}});var n9=i(381941);function se(e){return`${e.toFixed(0)}px`}let st=(0,a.sN)(u.X.APPEARANCE_MESSAGE_GROUP_SPACING,{useTitle:()=>j.intl.string(j.t.Q6lKkg),useSubtitle:()=>j.intl.string(j.t.p7eUrb),markers:n9.qh,stickToMarkers:!0,minValue:n9.qh["0"],maxValue:n9.qh[n9.qh.length-1],useDefaultValue:()=>L.hH.useSetting()?n9.y5:n9.ES,useExternalValue:()=>(0,g.bG)([i7.Ay],()=>i7.Ay.messageGroupSpacing),getInitialValue:()=>i7.Ay.messageGroupSpacing,onValueRender:se,onMarkerRender:se,asValueChanges:e=>{switch(e){case 0:case 4:case 8:case 16:case 24:(0,nI.AC)(e)}}});var si=i(775121);let sn=(0,a.sN)(u.X.APPEARANCE_ZOOM,{usePredicate:()=>eX.isPlatformEmbedded,useTitle:()=>j.intl.string(j.t.i19n5L),useSubtitle:()=>j.intl.format(j.t["x9PK/3"],{modKey:si.A.modKey}),markers:U.hH7.ZOOM_SCALES,stickToMarkers:!0,minValue:U.hH7.ZOOM_SCALES["0"],maxValue:U.hH7.ZOOM_SCALES[U.hH7.ZOOM_SCALES.length-1],useDefaultValue:()=>U.hH7.ZOOM_DEFAULT,getInitialValue:()=>i7.Ay.zoom,useExternalValue:()=>(0,g.bG)([i7.Ay],()=>i7.Ay.zoom),onValueRender:function(e){return`${e.toFixed(0)}%`},setValue:e=>(0,nI.Qp)(e),useSearchTerms:()=>[j.intl.string(j.t.ip0uSf)]}),ss=(0,a.zZ)(u.X.VISUAL_DENSITY_CATEGORY,{useTitle:()=>j.intl.string(j.t.VKYWk8),buildLayout:()=>[n5,n7,st,sn]}),sl=(0,a.t_)(u.X.ACCESSIBILITY_PANEL,{useTitle:()=>j.intl.string(j.t.G0neg7),buildLayout:()=>[n6,ss,nw,nq,nf],decoration:{type:h.t9.STRONGLY_DISCOURAGED_CUSTOM,component:function(){let e=L.hH.useSetting(),t=L.jW.useSetting(),i=S.useMemo(()=>[na(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}]:[]),na(j.intl.formatToPlainString(j.t["4rDfgM"],{link:"https://discord.com/accessibility"}))],[t]),n=(0,g.bG)([i7.Ay],()=>i7.Ay.messageGroupSpacing);return(0,E.jsx)(i5.M,{children:(0,E.jsxs)("section",{"aria-label":j.intl.string(j.t.RC22qg),children:[(0,E.jsx)(eP.D,{variant:"text-md/medium",color:"text-muted",className:ns.Vf,children:j.intl.string(j.t.RC22qg)}),(0,E.jsxs)(tM.Ip,{className:ns.VH,children:[(0,E.jsx)("ol",{className:ns.DZ,style:{gap:n},"aria-label":j.intl.string(j.t.xfjsEV),children:i.map(t=>(0,E.jsx)("li",{children:(0,E.jsx)(ni.A,{message:t,channel:nl,compact:e,author:{...(0,nt.p_)(t),colorString:"#dd80f4"}})},t.id))}),(0,E.jsxs)("div",{className:ns.Jb,children:[(0,E.jsx)("div",{className:ns.HD,children:nr.map(e=>{let{status:t,discriminator:i,mobile:n=!1}=e;return(0,E.jsx)(i4.eu,{status:t,isMobile:n,size:i8._3.SIZE_32,src:nn.Ay.getDefaultAvatarURL(void 0,i),"aria-label":j.intl.string(j.t.VKE5TK)},t)})}),(0,E.jsx)(eG.$,{text:j.intl.string(j.t["2RHHgz"]),size:"sm",variant:"primary"})]})]})]})})},sticky:!0}}),sr=(0,a.i4)(u.X.ACCESSIBILITY_SIDEBAR_ITEM,{useTitle:()=>j.intl.string(j.t.G0neg7),icon:i6.c,useMenu:no.A,buildLayout:()=>[sl]});var sa=i(650809),so=i(562465),su=i(228366),sd=i(74396),sc=i(269880),sg=i(55619),sm=i(812993);let sA=(0,a.zD)(u.X.SHOW_GAME_LIBRARY,{usePredicate:()=>(0,g.bG)([tj.A],()=>tj.A.hasLibraryApplication()),useTitle:()=>j.intl.string(j.t.fi3UQN),useSubtitle:()=>j.intl.string(j.t["8mYp37"]),useValue:()=>!L.l_.useSetting(),setValue:e=>L.l_.updateSetting(!e)}),sh=(0,a.zZ)(u.X.APPEARANCE_ADVANCED_CATEGORY,{useTitle:()=>j.intl.string(j.t["8/udY0"]),buildLayout:()=>[sA]});var sE=i(199966),sS=i(963935);function sT(e){let{title:t}=e;return t}function sx(e){let{useTitle:t,settingKey:i,formatter:n,index:s}=e,l=t();return"string"==typeof l?n({title:l,index:s,key:i}):l}function sp(e){let{setting:t,formatter:i,index:n}=e;return()=>(0,E.jsx)(sx,{useTitle:t.useTitle,settingKey:t.key,formatter:i,index:n},t.key)}function sf(e){return e.type===sS.Z6.LIST}function sN(e,t){let{limit:i=2,formatter:n=sT}=t??{};tX()(i>0,"[useSettingCollapsibleSubtitle] Limit must be greater than 0");let{visibleDirectory:s,accessibleDirectory:l}=(0,sE._)(),r=s.get(e)??l.get(e);tX()(null!=r&&(r.type===sS.Z6.ACCORDION||sf(r)),"[useSettingCollapsibleSubtitle] Node is not a collapsible settings node");let a=sf(r)?r.collapseAfter??0:0,o=r.layout;return S.useMemo(()=>{let e=a,t=[];for(let i of o)if("useTitle"in i&&null!=i.useTitle){if(e>0){e--;continue}t.push({key:i.key,useTitle:i.useTitle})}if(0===t.length)return"";let s=Math.min(i,3);if(t.length<=s)if(1===t.length)return j.intl.format(j.t["3H9tCW"],{settingOneHook:sp({setting:t[0],formatter:n,index:0})});else if(2===t.length)return j.intl.format(j.t.MWryo6,{settingOneHook:sp({setting:t[0],formatter:n,index:0}),settingTwoHook:sp({setting:t[1],formatter:n,index:1})});else return j.intl.format(j.t.a00b5G,{settingOneHook:sp({setting:t[0],formatter:n,index:0}),settingTwoHook:sp({setting:t[1],formatter:n,index:1}),settingThreeHook:sp({setting:t[2],formatter:n,index:2})});return 1===s?j.intl.format(j.t.O8vNbS,{settingOneHook:sp({setting:t[0],formatter:n,index:0})}):2===s?j.intl.format(j.t["acXG/W"],{settingOneHook:sp({setting:t[0],formatter:n,index:0}),settingTwoHook:sp({setting:t[1],formatter:n,index:1})}):j.intl.format(j.t["5+ldWc"],{settingOneHook:sp({setting:t[0],formatter:n,index:0}),settingTwoHook:sp({setting:t[1],formatter:n,index:1}),settingThreeHook:sp({setting:t[2],formatter:n,index:2})})},[i,a,o,n])}var s_=i(951260);let sI=(0,a.zD)(u.X.ENABLE_APPS_BUTTON,{useTitle:()=>j.intl.string(j.t.ZTH4j4),useValue:()=>(0,g.bG)([i7.Ay],()=>i7.Ay.isAppsButtonEnabled),setValue:e=>(0,nI.n8)({appsButtonEnabled:e})}),sC={useTitle:()=>j.intl.string(j.t["I/5LyL"]),useValue:()=>(0,g.bG)([i7.Ay],()=>i7.Ay.isSubmitButtonEnabled),setValue:()=>(0,nI.Xt)()},sb=(0,a.zD)(u.X.ENABLE_SEND_BUTTON,sC),sv=(0,a.zD)(u.X.ENABLE_SEND_BUTTON_OUTSIDE_EXPERIMENT,{...sC,usePredicate:()=>!(0,s_.n)("EnableSendButtonOutsideExperiment")}),sy=(0,a.zD)(u.X.CONDENSE_PICKER_WHEN_NARROW,{useTitle:()=>j.intl.string(j.t.WggFoO),useSubtitle:()=>j.intl.string(j.t.XpErGj),useValue:()=>(0,g.bG)([i7.Ay],()=>i7.Ay.condensePickerWhenNarrow),setValue:e=>(0,nI.n8)({condensePickerWhenNarrow:e}),usePredicate:()=>(0,g.bG)([i7.Ay],()=>i7.Ay.expressionPickerFormat===i7.IG.FLEXIBLE)}),sj=(0,a.zD)(u.X.ENABLE_EMOJI_BUTTON,{useTitle:()=>j.intl.string(j.t.YErWkD),useValue:()=>(0,g.bG)([i7.Ay],()=>i7.Ay.isEmojiButtonEnabled),setValue:e=>(0,nI.n8)({emojiButtonEnabled:e}),usePredicate:()=>(0,g.bG)([i7.Ay],()=>i7.Ay.expressionPickerFormat===i7.IG.FLEXIBLE)}),sO=(0,a.zD)(u.X.ENABLE_GIF_BUTTON,{useTitle:()=>j.intl.string(j.t.k7oNEz),useValue:()=>(0,g.bG)([i7.Ay],()=>i7.Ay.isGifButtonEnabled),setValue:e=>(0,nI.n8)({gifButtonEnabled:e}),usePredicate:()=>(0,g.bG)([i7.Ay],()=>i7.Ay.expressionPickerFormat===i7.IG.FLEXIBLE)}),sR=(0,a.zD)(u.X.ENABLE_STICKER_BUTTON,{useTitle:()=>j.intl.string(j.t.Ar0krj),useValue:()=>(0,g.bG)([i7.Ay],()=>i7.Ay.isStickerButtonEnabled),setValue:e=>(0,nI.n8)({stickerButtonEnabled:e}),usePredicate:()=>(0,g.bG)([i7.Ay],()=>i7.Ay.expressionPickerFormat===i7.IG.FLEXIBLE)}),sL=(0,a.Qx)(u.X.EXPRESSION_PICKER_FORMAT,{useTitle:()=>j.intl.string(j.t.AxRAWt),useValue:()=>(0,g.bG)([i7.Ay],()=>i7.Ay.expressionPickerFormat),setValue:e=>(0,nI.n8)({expressionPickerFormat:e}),useOptions:function(){return[{name:j.intl.string(j.t.k86Soy),desc:j.intl.string(j.t.bSGTTZ),value:i7.IG.FLEXIBLE},{name:j.intl.string(j.t.bjwSOn),desc:j.intl.string(j.t.We36HX),value:i7.IG.CONDENSED},{name:j.intl.string(j.t.FDIKss),desc:j.intl.string(j.t["rclZL/"]),value:i7.IG.HIDDEN}]}}),sD=(0,a.FW)(u.X.EXPRESSION_PICKER_FIELD_SET,{variant:"compact",isTitleHiddenVisually:!0,useTitle:()=>j.intl.string(j.t["V9/cNN"]),buildLayout:()=>[sL,sy,sj,sO,sR]}),sP=(0,a.bd)(u.X.CHAT_BAR_ADVANCED_ACCORDION,{useTitle:function(e){return e?j.intl.string(j.t.IwVGQs):j.intl.string(j.t.cFNDh5)},useCollapsedSubtitle:()=>sN(u.X.CHAT_BAR_ADVANCED_ACCORDION),usePredicate:()=>(0,s_.n)("ChatBarAdvancedAccordion"),buildLayout:()=>[sb,sI,sD]});var sG=i(565645);let sM=(0,a.zD)(u.X.CHAT_EMOJI_CONVERT_EMOTICONS,{useTitle:()=>j.intl.string(j.t["79qal8"]),useSubtitle:()=>j.intl.format(j.t.GejoQK,{emojiHook:(e,t)=>(0,E.jsx)(sG.A,{emojiName:"\uD83D\uDE42"},t)}),useValue:L.j7.useSetting,setValue:L.j7.updateSetting});var sU=i(254313);let sV=(0,a.zD)(u.X.CHAT_GAME_MENTIONS_AUTOCOMPLETE,{useTitle:()=>j.intl.string(j.t.c0oFDw),usePredicate:()=>(0,sU.gs)({location:"GameMentionsInAutocomplete"}).enabled,useValue:L.BQ.useSetting,setValue:L.BQ.updateSetting}),sk=(0,a.zD)(u.X.CHAT_TEXT_BOX_PREVIEWS,{useTitle:()=>j.intl.string(j.t.AqGrEI),useValue:L.SI.useSetting,setValue:e=>{G.default.track(U.HAw.PREVIEW_MARKDOWN_TOGGLED,{enabled:e,location:{section:U.JJy.SETTINGS_TEXT_AND_IMAGES}}),L.SI.updateSetting(e)}}),sw=(0,a.zD)(u.X.CHAT_STICKERS_AUTOCOMPLETE,{useTitle:()=>j.intl.string(j.t["d+It2U"]),useValue:L.ML.useSetting,setValue:e=>{G.default.track(U.HAw.STICKERS_IN_AUTOCOMPLETE_TOGGLED,{enabled:e,location:{section:U.JJy.SETTINGS_TEXT_AND_IMAGES},location_stack:[e1.A.TEXT_AND_IMAGES]}),L.ML.updateSetting(e)}}),sF=(0,a.zZ)(u.X.APPEARANCE_CHAT_BOX_CATEGORY,{useTitle:()=>j.intl.string(j.t.Ob7VMB),useSearchTerms:()=>[j.intl.string(j.t.onqU6o)],buildLayout:()=>[sk,sM,sw,sV,sv,sP]});var sB=i(526162),sz=i(793943),sY=i(792656),sX=i(830543),sH=i(785007),sK=i(806932),sW=i(915089),sZ=i(174197),sq=i(202541);let sQ=(0,a.E2)(u.X.APPEARANCE_IN_APP_ICON,{useSearchTerms:()=>[j.intl.string(j.t.gnwxvT)],Component:function(){let e=(0,sW.GV)(),{ref:t,...i}=(0,sH._u)({orientation:"horizontal",labelledBy:e}),n=(0,g.bG)([sB.A],()=>sB.A.isUpsellPreview);return(0,eL.Ay)(()=>{n&&G.default.track(U.HAw.PREMIUM_UPSELL_VIEWED,{type:sq.e.APP_ICON_UPSELL,location_stack:[e1.A.USER_SETTINGS]})}),(0,E.jsx)("div",{...i,ref:t,children:(0,E.jsx)(Q.B,{direction:"horizontal",wrap:!0,gap:8,children:(0,E.jsx)(sK.m,{disabled:n,size:sZ.N8.SIZE_48})})})}});function sJ(){(0,sz.nf)(sz.HP.APP_ICON),(0,sX.default)()}function s$(){return(0,E.jsx)(sY.A,{subscriptionTier:sq.pe.TIER_2,defaultTextOverride:j.intl.string(j.t.mr4K7D),premiumModalAnalyticsLocation:{object:U.ZSU.BUTTON_CTA,objectType:U.AnalyticsObjectTypes.BUY},fullWidth:!0})}let s0=(0,a.zZ)(u.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,g.bG)([sB.A],()=>sB.A.isUpsellPreview);return S.useMemo(()=>{let t=[];return t.push({id:"preview-icon-button",type:h.UV.BUTTON,text:j.intl.string(j.t["6acvnZ"]),onClick:sJ}),e&&t.push({id:"upsell-button",type:h.UV.STRONGLY_DISCOURAGED_CUSTOM,button:s$}),{type:h.WX.BUTTON_GROUP,buttons:t}},[e])},buildLayout:()=>[sQ]}),s1=(0,a.AK)(u.X.APPEARANCE_CHAT_ACCESSIBLITY_NAVIGATOR,{useSubtitle:()=>j.intl.string(j.t.UDr3Iy),useSearchTerms:()=>[j.intl.string(j.t.UDr3Iy)],destinationKey:u.X.ACCESSIBILITY_PANEL}),s2=(0,a.gN)(u.X.APPEARANCE_CHAT_RELATED_SETTINGS,{buildLayout:()=>[s1]});var s3=i(281980),s6=i(452027),s5=i(976860),s4=i(967198),s8=i(659324),s7=i(668267),s9=i(5180),le=i(551289),lt=i(449817);let li=tI.A.getArticleURL(U.MVz.FAVORITES_GUILD);function ln(){let{analyticsLocations:e}=(0,nQ.Ay)(e1.A.USER_SETTINGS_FAVORITES),t=S.useCallback(()=>{(0,s7.mv)("settings_page"),(0,s5.uh)(U.YYv),(0,sX.default)()},[]);return(0,E.jsx)(nQ.f5,{value:e,children:(0,E.jsx)(s6.D,{label:j.intl.string(lt.default.OT1NK5),description:j.intl.format(lt.default.GR2KOG,{helpCenterLink:li}),layout:"horizontal-responsive",badge:"beta",children:(0,E.jsxs)(Q.B,{direction:"horizontal",gap:8,fullWidth:!1,children:[(0,E.jsx)(eG.$,{variant:"secondary",text:j.intl.string(lt.default["7WwLnr"]),onClick:t}),(0,E.jsx)(sY.A,{subscriptionTier:sq.pe.TIER_2,defaultTextOverride:j.intl.string(lt.default["20sYUU"])})]})})})}let ls=(0,a.E2)(u.X.CHAT_FAVORITES_TOGGLE,{usePredicate:()=>(0,s3.TW)("FavoritesGuildToggle").isExperimentEnabled,useSearchTerms:()=>[j.intl.string(lt.default.OT1NK5)],Component:function(){let{hasAccess:e}=(0,s3.TW)("FavoritesGuildVisibilitySetting"),t=(0,le.dM)(),i=S.useCallback(e=>{(0,s8.tV)(e,"settings_page"),!e&&(0,s9.ai)(s4.A.getGuildId())&&(0,s5.pX)(U.BVt.ME)},[]);return e?(0,E.jsx)(J.d,{checked:t,description:j.intl.format(lt.default.GR2KOG,{helpCenterLink:li}),onChange:i,label:j.intl.string(lt.default.OT1NK5),badge:"beta"}):(0,E.jsx)(ln,{})}}),ll=(0,a.zD)(u.X.CHAT_INLINE_MEDIA_LINKS,{useTitle:()=>j.intl.string(j.t.U47N1p),useValue:L.hD.useSetting,setValue:L.hD.updateSetting}),lr=(0,a.zD)(u.X.CHAT_INLINE_MEDIA_UPLOADS,{useTitle:()=>j.intl.string(j.t.VP11No),useValue:L.X6.useSetting,setValue:L.X6.updateSetting}),la=(0,a.FW)(u.X.CHAT_INLINE_FIELD_SET,{useTitle:()=>j.intl.string(j.t["9nyle0"]),buildLayout:()=>[ll,lr]}),lo=(0,a.zD)(u.X.CHAT_EMBEDS_RENDER_EMBEDS,{useTitle:()=>j.intl.string(j.t["5bK9vw"]),useValue:L.rs.useSetting,setValue:L.rs.updateSetting}),lu=(0,a.zD)(u.X.CHAT_EMOJI_RENDER_REACTIONS,{useTitle:()=>j.intl.string(j.t["zge/fP"]),useValue:L.jW.useSetting,setValue:L.jW.updateSetting});var ld=i(817281);let lc=(0,a.zD)(u.X.APPEARANCE_DISPLAY_COMPACT_AVATARS,{useTitle:()=>j.intl.string(j.t.JgjNG3),useSubtitle:()=>{if(!L.hH.useSetting())return j.intl.format(j.t["31PRaj"],{a11yHook:(e,t)=>(0,E.jsx)(en.D,{tag:"a",onClick:()=>(0,eH.openUserSettings)(u.X.APPEARANCE_MESSAGE_DISPLAY_MODE),children:e},t)})},useDisabled:()=>!L.hH.useSetting(),useValue:()=>{let e=(0,g.bG)([nR.Ay],()=>nR.Ay.displayCompactAvatars);return!L.hH.useSetting()||e},setValue:e=>{ld.Ay.updatedUnsyncedSettings({displayCompactAvatars:e})}}),lg=(0,a.Hn)(u.X.CHAT_SPOILERS_SHOW_SPOILERS,{useTitle:()=>j.intl.string(j.t.QgwmVz),useOptions:()=>[{value:U.P6Q.ON_CLICK,id:U.P6Q.ON_CLICK,label:j.intl.string(j.t["KFH/me"])},{value:U.P6Q.ALWAYS,id:U.P6Q.ALWAYS,label:j.intl.string(j.t.Pe1RbL)},{value:U.P6Q.IF_MODERATOR,id:U.P6Q.IF_MODERATOR,label:j.intl.string(j.t.K5VTBE)}],useValue:L.gs.useSetting,setValue:L.gs.updateSetting}),lm=(0,a.zD)(u.X.CHAT_THREADS_SPLIT_VIEW,{useTitle:()=>j.intl.string(j.t.AInv5m),useValue:L.SY.useSetting,setValue:L.SY.updateSetting}),lA=(0,a.zZ)(u.X.APPEARANCE_MESSAGES_CATEGORY,{useTitle:()=>j.intl.string(j.t.OIgYlQ),useSearchTerms:()=>[j.intl.string(j.t["/VQax8"])],buildLayout:()=>[la,lo,lu,lg,lm,lc,ls,s2]});var lh=i(753806),lE=i(145331);let lS=(0,a.Qx)(u.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:()=>+!!L.Hu.useSetting(),setValue:e=>{let t=1===e;t?lh.A.cleanUpPrivateChannelSearchState():lh.A.cleanUpSearchState({type:U.I4_.DMS}),(0,lE._k)({prevIsCrossDMSettingEnabled:L.Hu.getSetting(),isCrossDMSettingEnabled:t,location:lE.vy.USER_SETTINGS}),L.Hu.updateSetting(t)}}),lT=(0,a.zZ)(u.X.APPEARANCE_SEARCH_CATEGORY,{useTitle:()=>j.intl.string(j.t["5h0QOP"]),buildLayout:()=>[lS]}),lx=(0,a.zD)(u.X.STREAMING_AUTO_STREAMER_MODE,{useTitle:()=>j.intl.string(j.t.IxjaoF),useValue:function(){return(0,g.bG)([eF.A],()=>{let{autoToggle:e}=eF.A.getSettings();return e})},setValue:function(e){sg.A.update({autoToggle:e})},usePredicate:function(){return c.Av}}),lp=(0,a.zD)(u.X.STREAMING_STREAMER_MODE,{useTitle:()=>j.intl.string(j.t.TGNg6T),useSubtitle:()=>j.intl.string(j.t["4nXLnE"]),useValue:function(){return(0,g.bG)([eF.A],()=>{let{enabled:e}=eF.A.getSettings();return e})},setValue:function(e){sg.A.update({enabled:e})}});var lf=i(77729),lN=i(588857);let l_=[],lI=(0,a.Hn)(u.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,eK.b_)(),t=(0,ek.Mn)("StreamerModeSettings");return e&&t},useOptions:function(){return S.useMemo(()=>{let e=[];for(let[t,i]of Object.entries(lN.A))null!=i.streamerModeLabel&&(null==i.predicate||i.predicate())&&e.push({id:t,value:t,label:i.streamerModeLabel()});return e},[])},useValue:function(){return(0,g.bG)([eF.A],()=>eF.A.getSettings().disabledOverlayWidgets??l_)},setValue:e=>sg.A.update({disabledOverlayWidgets:e}),closeOnSelect:!1,wrapTags:!0}),lC=(0,a.zD)(u.X.STREAMER_MODE_HIDE_PERSONAL_INFORMATION,{useTitle:()=>j.intl.string(j.t.LSBUGR),useValue:()=>(0,g.bG)([eF.A],()=>{let{hidePersonalInformation:e}=eF.A.getSettings();return e}),setValue:e=>sg.A.update({hidePersonalInformation:e})}),lb=(0,a.zD)(u.X.STREAMER_MODE_HIDE_INVITE_LINKS,{useTitle:()=>j.intl.string(j.t.uWBOri),useValue:()=>(0,g.bG)([eF.A],()=>{let{hideInstantInvites:e}=eF.A.getSettings();return e}),setValue:e=>sg.A.update({hideInstantInvites:e})}),lv=(0,a.zD)(u.X.STREAMER_MODE_DISABLE_SOUNDS,{useTitle:()=>j.intl.string(j.t.OrqYDP),useValue:()=>(0,g.bG)([eF.A],()=>{let{disableSounds:e}=eF.A.getSettings();return e}),setValue:e=>sg.A.update({disableSounds:e})}),ly=(0,a.zD)(u.X.STREAMER_MODE_DISABLE_NOTIFICATIONS,{useTitle:()=>j.intl.string(j.t.sUAbLd),useValue:()=>(0,g.bG)([eF.A],()=>{let{disableNotifications:e}=eF.A.getSettings();return e}),setValue:e=>sg.A.update({disableNotifications:e})}),lj=(0,a.zD)(u.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,g.bG)([eF.A],()=>{let{enableContentProtection:e}=eF.A.getSettings();return e}),setValue:e=>sg.A.update({enableContentProtection:e}),usePredicate:()=>lf.A?.window?.supportsContentProtection?.()??!1}),lO=(0,a.FW)(u.X.STREAMER_MODE_OPTIONS_LIST,{variant:"compact",useTitle:()=>j.intl.string(j.t.xYhOEh),buildLayout:()=>[lC,lb,lv,ly,lj,lI]}),lR=(0,a.zZ)(u.X.STREAMER_MODE_CATEGORY,{useTitle:()=>j.intl.string(j.t.S5GfOW),buildLayout:()=>[lp,lx,lO]});var lL=i(147248),lD=i(665267),lP=i(414133),lG=i(412848);let lM=(0,a.Hn)(u.X.APPEARANCE_GUILD_THEME_DEFAULT_PREFERENCE,{useTitle:()=>j.intl.string(j.t.Q7mm4g),useSearchTerms:()=>[j.intl.string(lG.default["/6NbRv"])],useOptions:()=>[{id:"guild",label:j.intl.string(j.t["hrS/Pc"]),value:H.tI.GUILD},{id:"personal",label:j.intl.string(j.t.mlvXIq),value:H.tI.PERSONAL}],useValue:()=>L.zY.useSetting(),setValue:L.zY.updateSetting,usePredicate:()=>(0,lP.OS)("GuildThemeDefaultPreferenceSetting")}),lU=(0,a.zD)(u.X.SYNC_PROFILE_THEMES,{useTitle:()=>j.intl.string(j.t.C00w4l),useValue:()=>(0,g.bG)([i7.Ay],()=>i7.Ay.syncProfileThemeWithUserTheme),setValue:()=>(0,nI.M1)()});var lV=i(284016);let lk=(0,a.zD)(u.X.APPEARANCE_SYNC_THEME,{useTitle:()=>j.intl.string(j.t["/B+kEV"]),useSearchTerms:()=>[j.intl.string(j.t.Ksh3ik)],useValue:function(){return(0,g.bG)([lV.A],()=>!1!==lV.A.shouldSync("appearance"))},setValue:function(e){var t;let i=iv.A.theme,n=lL.A.gradientPreset?.id??null,s=L.eh.getSetting()?.customUserThemeSettings!=null;t=U.HAw.SYNC_ACROSS_CLIENTS_TOGGLED,su.h.dispatch({type:"TRACK",event:t,properties:{is_sync_enabled:e,base_theme:i,client_theme:n,has_custom_theme:s}}),ld.Ay.setShouldSyncAppearanceSettings(e)}});var lw=i(98596);let lF=(0,a.AK)(u.X.APPEARANCE_THEME_ACCESSIBLITY_NAVIGATOR,{useSubtitle:()=>j.intl.string(j.t.nhVQDJ),useSearchTerms:()=>[j.intl.string(j.t.nhVQDJ)],destinationKey:u.X.ACCESSIBILITY_PANEL}),lB=(0,a.gN)(u.X.APPEARANCE_THEME_RELATED_SETTINGS,{buildLayout:()=>[lF]}),lz=(0,a.zZ)(u.X.APPEARANCE_THEME_CATEGORY,{useTitle:()=>j.intl.string(j.t.Ksh3ik),useInlineNotice:function(){return(0,g.bG)([i7.Ay],()=>i7.Ay.useForcedColors)?{type:h.lT.INLINE_NOTICE,noticeType:"info",useText:()=>(0,nU.D)()?j.intl.format(j.t.Jae48E,{onClick:()=>{(0,eH.openUserSettings)(u.X.SYNC_FORCED_COLORS)}}):j.intl.string(j.t.AUMSZP)}:null},useHeaderDecoration:function(){return(0,g.bG)([lL.A,i7.Ay],()=>i7.Ay.useForcedColors||lL.A.isPreview)?null:{type:h.WX.BUTTON_GROUP,buttons:[{id:"open-client-themes-button",type:h.UV.BUTTON,text:j.intl.string(j.t["E+COuA"]),onClick:lD.J3}]}},buildLayout:()=>[lw.k,lk,lU,lM,lB]}),lY=(0,a.t_)(u.X.APPEARANCE_PANEL,{initialize:function(){sd.A.isFetching()||(su.h.dispatch({type:"SAVED_CUSTOM_THEMES_FETCH_START"}),so.Bo.get({url:U.Rsh.USERS_ME_CUSTOM_THEMES,oldFormErrors:!0,rejectWithError:!0}).then(e=>{su.h.dispatch({type:"SAVED_CUSTOM_THEMES_FETCH_SUCCESS",themes:e.body?.custom_themes??[]})}).catch(e=>{su.h.dispatch({type:"SAVED_CUSTOM_THEMES_FETCH_FAILURE",error:e})}))},useTitle:()=>j.intl.string(j.t["iHH+ky"]),buildLayout:()=>[lz,s0,lA,sF,lT,lR,sh]}),lX=[{badgeType:h.Xi.NEW,dismissibleContent:eU.M.CLIENT_THEMES_APPEARANCE_SETTINGS_NEW_BADGE},{badgeType:h.Xi.STRONGLY_DISCOURAGED_CUSTOM,dismissibleContent:eU.M.FAVORITES_GUILD_NEW_BADGE,StronglyDiscouragedCustomComponent:function(){return(0,E.jsx)(sm.JI,{text:j.intl.string(j.t.y2b7CA)})}}],lH=(0,a.i4)(u.X.APPEARANCE_SIDEBAR_ITEM,{useTitle:()=>j.intl.string(j.t["iHH+ky"]),icon:sa.B,useMenu:function(){let e,t,i,n=(0,sc.A)(),s=(e=L.D_.useSetting(),t=L.SI.useSetting(),e?null:(0,E.jsx)(ei.sL,{id:"preview-markdown-toggle",label:j.intl.string(j.t.sHJ9wZ),action:()=>{let e=!t;G.default.track(U.HAw.PREVIEW_MARKDOWN_TOGGLED,{enabled:e,location:{section:U.JJy.SETTINGS_CONTEXT_MENU}}),L.SI.updateSetting(e)},checked:t})),l=(i=(0,g.bG)([eF.A],()=>eF.A.enabled,[]),(0,E.jsx)(ei.sL,{id:"streamer-mode-toggle",label:j.intl.string(j.t.p9ZAJZ),action:()=>{sg.A.setEnabled(!i)},checked:i}));return S.useMemo(()=>{let e=[...n];return null!=s&&e.push((0,E.jsx)(ei.rX,{label:j.intl.string(j.t.Ob7VMB),children:s},"text-and-images")),null!=l&&e.push((0,E.jsx)(ei.rX,{children:l},"streamer-mode")),e},[n,s,l])},getDismissibleBadges:()=>lX,buildLayout:()=>[lY]});var lK=i(37646),lW=i(434404);let lZ=(0,a.t_)(u.X.LANGUAGE_AND_TIME_PANEL,{useTitle:()=>j.intl.string(j.t.KyFVyi),buildLayout:()=>[lW.F]}),lq=(0,a.i4)(u.X.LANGUAGE_AND_TIME_SIDEBAR_ITEM,{icon:lK.U,useTitle:()=>j.intl.string(j.t.KyFVyi),buildLayout:()=>[lZ]});var lQ=i(3137),lJ=i(314116),l$=i(369606),l0=i(604121),l1=i(725951),l2=i(400492),l3=i(669067),l6=i(115063),l5=i(754692),l4=i(927018),l8=i(512599),l7=i(532197),l9=i(874486),re=i(989349),rt=i.n(re),ri=i(58703),rn=i(906688),rs=i(892208);function rl(e){let{achievementId:t,dateUnlocked:i}=e,n=(0,l4.vM)(t);if(null==n)return null;let s=null!=i,{name:l,description:r,hideDescriptionUntilUnlock:a,onAction:o}=n,u=a&&!s,d=s?"text-strong":"text-muted",c=s?"text-default":"text-muted",g=rt()(i),m=null!=o&&s,A=m?en.D:"div";return(0,E.jsxs)(A,{className:e6()(rs.kL,m&&rs.b),onClick:function(){m&&o()},children:[(0,E.jsx)("div",{className:rs.zc,children:(0,E.jsx)(rn.A,{achievementId:t,size:rn.A.Sizes.SIZE_40,unlocked:s})}),(0,E.jsxs)("div",{className:rs.VW,children:[null!=i&&(0,E.jsx)(es.E,{variant:"text-xxs/semibold",color:"text-muted",className:rs.YR,children:(0,ri.mk)(g)}),(0,E.jsx)(es.E,{variant:"text-md/medium",color:d,children:l()}),(0,E.jsx)(es.E,{variant:"text-xs/normal",color:c,children:u?"?????":r()})]})]})}var rr=i(776351);function ra(e){let{onBackClick:t}=e,i=(0,g.bG)([l9.A],()=>l9.A.getAllUnlockedAchievements()),n=S.useMemo(()=>Object.values(i).sort((e,t)=>t.dateUnlocked-e.dateUnlocked),[i]),s=S.useMemo(()=>Object.values(l4.l0).filter(N.Vq).filter(e=>null==i[e.id]).sort((e,t)=>e.rarity-t.rarity),[i]);return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(en.D,{onClick:t,className:rr.vv,children:[(0,E.jsx)(l7.A,{direction:l7.A.Directions.LEFT,className:rr.Kk}),(0,E.jsx)(es.E,{variant:"text-lg/normal",color:"text-default",children:j.intl.string(j.t["13/7kX"])})]}),(0,E.jsxs)("div",{className:rr.N1,children:[(0,E.jsxs)("div",{className:rr.if,children:[(0,E.jsx)(eP.D,{variant:"heading-lg/extrabold",color:"text-strong",children:j.intl.string(j.t["6jI0hd"])}),(0,E.jsx)(es.E,{variant:"text-md/normal",color:"text-default",children:j.intl.string(j.t.GuUItX)})]}),(0,E.jsx)("div",{className:rr.nr,children:(0,E.jsx)(l$.O,{size:"custom",color:er.A.unsafe_rawColors.ORANGE_345.css,width:40,height:40})})]}),n.length>0&&(0,E.jsx)("div",{className:rr.yF,children:(0,E.jsx)("div",{className:rr.Eh,children:n.map(e=>{let{achievementId:t,dateUnlocked:i}=e;return(0,E.jsx)(rl,{achievementId:t,dateUnlocked:i},t)})})}),s.length>0&&(0,E.jsxs)("div",{className:rr.yF,children:[(0,E.jsx)("div",{className:rr.if,children:(0,E.jsx)(es.E,{variant:"text-md/bold",color:"text-default",children:j.intl.string(j.t.GFyMg1)})}),(0,E.jsx)("div",{className:rr.Eh,children:s.map(e=>(0,E.jsx)(rl,{achievementId:e.id},e.id))})]}),(0,E.jsx)("div",{className:rr.yF,children:(0,E.jsx)("div",{className:rr.F3})})]})}var ro=i(224964),ru=i(31408),rd=i(381579);let rc={enabled:!0,combosEnabled:!0,screenshakeEnabled:!1,confettiEnabled:!1},rg=(0,eW.range)(0,11),rm=(0,eW.range)(0,2.25,.25),rA=(0,eW.range)(1,11),rh=(0,eW.range)(1,26),rE={0:"poggermode_settings_panel",1:"poggermode_achievements_panel"};function rS(e){let{disabled:t,locations:i,settingsLocations:n,onChange:s}=e,l=i.map(e=>(0,E.jsx)(J.d,{label:e.title,description:e.description,checked:n[e.location],disabled:t,onChange:t=>s({...n,[e.location]:t})},e.location));return(0,E.jsx)(iC.n,{label:j.intl.string(j.t.bWVN1D),children:l})}function rT(e){let{children:t}=e;return(0,E.jsx)(es.E,{className:rd.iF,variant:"text-sm/normal",color:"text-default",children:t})}function rx(e){let{settings:{enabled:t,warningSeen:i},updateSettings:n}=e,s=(0,g.bG)([i7.Ay],()=>i7.Ay.useReducedMotion);return(0,E.jsx)(J.d,{label:j.intl.string(j.t.vuiXm9),description:j.intl.string(j.t.KuYbWN),checked:t,onChange:function(e){e||(0,l5._)(l4.sn.DISABLE_POGGERMODE),e&&(!i||s)?(0,lJ.A)({title:s?j.intl.string(j.t["FxT+p0"]):j.intl.string(j.t.TAZ4F9),subtitle:s?j.intl.string(j.t.gmixrx):j.intl.string(j.t.jN3t3K),confirmText:j.intl.string(j.t.JFfins),onConfirm:()=>n(s?rc:{enabled:!0,warningSeen:!0})}):n({enabled:e})}})}function rp(e){let{settings:{enabled:t,confettiEnabled:i,confettiCount:n,confettiSize:s,confettiEnabledLocations:l},updateSettings:r}=e,a=!t||!i;return(0,E.jsxs)(iC.n,{label:j.intl.string(j.t.mqxwJO),children:[(0,E.jsx)(J.d,{label:j.intl.string(j.t.s0KCgF),description:j.intl.string(j.t.O1Vflg),checked:i,disabled:!t,onChange:e=>r({confettiEnabled:e},0)}),(0,E.jsxs)("div",{children:[(0,E.jsx)(es.E,{variant:"text-md/semibold",color:a?"text-muted":"text-strong",className:rd.KF,children:j.intl.string(j.t.vd0D81)}),(0,E.jsx)(rT,{children:j.intl.string(j.t.a18Sug)}),(0,E.jsx)(ng.A,{disabled:a,markers:rA,stickToMarkers:!0,minValue:rA[0],maxValue:rA[rA.length-1],initialValue:n,onValueChange:e=>r({confettiCount:e},0),onValueRender:e=>`${e}`})]}),(0,E.jsxs)("div",{children:[(0,E.jsx)(es.E,{variant:"text-md/semibold",color:a?"text-muted":"text-strong",className:rd.KF,children:j.intl.string(j.t.sPO3ij)}),(0,E.jsx)(rT,{children:j.intl.string(j.t.xoldVn)}),(0,E.jsx)(ng.A,{disabled:a,markers:rh,stickToMarkers:!0,minValue:rh[0],maxValue:rh[rh.length-1],initialValue:s,onValueChange:e=>r({confettiSize:e},0),onValueRender:e=>`${e}`})]}),(0,E.jsx)(rS,{disabled:a,locations:[{location:ru.k.CHAT_INPUT,title:j.intl.string(j.t.elTtyz),description:j.intl.string(j.t.HtKfMi)},{location:ru.k.REACTION,title:j.intl.string(j.t.Ik4VIa),description:j.intl.string(j.t.y4rqK0)},{location:ru.k.MEMBER_USER,title:j.intl.string(j.t.ZXBlAn),description:j.intl.string(j.t["m9RD+c"])},{location:ru.k.CALL_TILE,title:j.intl.string(j.t.V66giQ),description:j.intl.string(j.t.fiHV7u)}],settingsLocations:l,onChange:e=>r({confettiEnabledLocations:e},0)})]})}function rf(e){let{settings:{enabled:t,combosEnabled:i,comboSoundsEnabled:n,combosRequiredCount:s},updateSettings:l}=e,r=!t||!i;return(0,E.jsxs)(iC.n,{label:j.intl.string(j.t.Xz0ole),children:[(0,E.jsx)(J.d,{label:j.intl.string(j.t.o3iV7B),description:j.intl.string(j.t["31Z8Ee"]),checked:i,disabled:!t,onChange:e=>l({combosEnabled:e})}),(0,E.jsx)(J.d,{label:j.intl.string(j.t["Ax+IoW"]),description:j.intl.string(j.t["9rgQEr"]),checked:n,disabled:!t,onChange:e=>l({comboSoundsEnabled:e})}),(0,E.jsxs)("div",{children:[(0,E.jsx)(es.E,{variant:"text-md/semibold",color:r?"text-muted":"text-strong",className:rd.KF,children:j.intl.string(j.t.L0oQuh)}),(0,E.jsx)(rT,{children:j.intl.string(j.t["/OOFpL"])}),(0,E.jsx)(ng.A,{disabled:r,markers:rg,stickToMarkers:!0,minValue:rg[0],maxValue:rg[rg.length-1],initialValue:s,onValueChange:e=>l({combosRequiredCount:e}),onValueRender:e=>`${e}`})]})]})}function rN(e){let{settings:{enabled:t,screenshakeEnabled:i,shakeIntensity:n,screenshakeEnabledLocations:s},updateSettings:l}=e,r=(0,g.bG)([i7.Ay],()=>i7.Ay.useReducedMotion),a=!t||!i||r;return(0,E.jsxs)(iC.n,{label:j.intl.string(j.t.wVS5Sd),children:[(0,E.jsx)(J.d,{label:j.intl.string(j.t.N004zO),description:r?j.intl.string(j.t.GckHGw):j.intl.string(j.t.Qq5W3v),checked:i&&!r,disabled:!t||r,onChange:e=>l({screenshakeEnabled:e},1)}),(0,E.jsxs)("div",{children:[(0,E.jsx)(es.E,{variant:"text-md/semibold",color:a?"text-muted":"text-strong",className:rd.KF,children:j.intl.string(j.t.UxnnC4)}),(0,E.jsx)(rT,{children:j.intl.string(j.t.CEOEOb)}),(0,E.jsx)(ng.A,{disabled:a,markers:rm,equidistant:!0,stickToMarkers:!0,minValue:rm[0],maxValue:rm[rm.length-1],initialValue:n,onValueChange:e=>{var t;null!=(t={shakeIntensity:e}).shakeIntensity&&t.shakeIntensity>n&&(0,l5._)(l4.sn.MORE),l(t,1)},onMarkerRender:e=>e===rm[rm.length-1]?j.intl.string(j.t["4rbMWc"]):`${100*e}%`})]}),(0,E.jsx)(rS,{disabled:a,locations:[{location:ru.uD.CHAT_INPUT,title:j.intl.string(j.t.vUcvPP),description:j.intl.string(j.t.y00OrF)},{location:ru.uD.VOICE_USER,title:j.intl.string(j.t.TcRO54),description:j.intl.string(j.t.YJCxVY)},{location:ru.uD.MENTION,title:j.intl.string(j.t.oW4shO),description:j.intl.string(j.t["mqfw/H"])}],settingsLocations:s,onChange:e=>l({screenshakeEnabledLocations:e},1)})]})}function r_(e){let{updateSettings:t}=e;return(0,E.jsx)(iC.n,{label:j.intl.string(j.t.EuXv2q),children:(0,E.jsxs)(Q.B,{gap:16,children:[(0,E.jsx)("div",{children:j.intl.string(j.t["1SLnki"])}),(0,E.jsx)("div",{"data-button-hoisted-classname-wrapper":!0,className:rd.hw,children:(0,E.jsx)(eG.$,{variant:"primary",size:"sm",text:j.intl.string(j.t.qz65yY),onClick:function(){t({enabled:!1,settingsVisible:!1}),(0,sX.default)()}})})]})})}function rI(e){let{onChangePage:t}=e;return(0,E.jsxs)(en.D,{onClick:function(){return t(1)},className:rd.Tq,children:[(0,E.jsx)("div",{className:rd.w1,children:(0,E.jsx)(l$.O,{size:"md",color:er.A.unsafe_rawColors.ORANGE_345.css})}),(0,E.jsxs)("div",{className:rd.qL,children:[(0,E.jsx)(eP.D,{variant:"heading-md/semibold",color:"text-strong",children:j.intl.string(j.t["6jI0hd"])}),(0,E.jsx)(es.E,{variant:"text-md/normal",color:"text-default",children:j.intl.string(j.t.GuUItX)})]}),(0,E.jsx)(tL._,{size:"custom",color:"currentColor",width:16,className:rd.nT})]})}function rC(){return i.e("4660").then(i.t.bind(i,662336,19)).then(e=>{let{default:t}=e;return t})}function rb(e){let{onChangePage:t,setShowEnableAnimation:i}=e,n=(0,g.cf)([lQ.A],()=>lQ.A.getState()),[s,l]=S.useState({x:0,y:0}),r=(0,ro.A)();function a(e,t){var l,a,o,u,d,c,g,m;if(e.enabled&&!1===n.enabled&&(i(!0),(0,l2.Ak)("poggermode_enabled"),(0,l6.fO)({duration:2e3,intensity:e.shakeIntensity??n.shakeIntensity})),(0,l8.O9)(e),null==t)return;let A=(l=n.confettiEnabled,a=e.confettiEnabled,o=n.enabled,u=e.enabled,(a??l)&&(u??o));0===t&&A&&r.fire(s.x,s.y,{settings:e});let h=(d=n.screenshakeEnabled,c=e.screenshakeEnabled,g=n.enabled,m=e.enabled,(c??d)&&(m??g));1===t&&h&&(0,l6.fO)({duration:1e3,intensity:e.shakeIntensity??n.shakeIntensity})}function o(e){l({x:e.clientX,y:e.clientY})}return S.useEffect(()=>(window.addEventListener("mousemove",o),()=>window.removeEventListener("mousemove",o)),[]),(0,E.jsxs)(Q.B,{gap:24,children:[(0,E.jsx)(rx,{settings:n,updateSettings:a}),(0,E.jsx)(rI,{onChangePage:t}),(0,E.jsx)(rf,{settings:n,updateSettings:a}),(0,E.jsx)(rN,{settings:n,updateSettings:a}),(0,E.jsx)(rp,{settings:n,updateSettings:a}),(0,E.jsx)(r_,{updateSettings:a})]})}function rv(e){return 0===e?l1.f.LEFT:l1.f.RIGHT}let ry=(0,a.E2)(u.X.POGGERMODE_SETTING,{Component:function(){let[e,t]=S.useState(0),[i,n]=S.useState(rv(e)),[s,l]=S.useState(!1),r=(0,g.bG)([i7.Ay],()=>i7.Ay.useReducedMotion),a=s&&!r;return S.useEffect(()=>{let t=setTimeout(()=>{n(rv(e))},500);return()=>clearTimeout(t)},[e]),S.useEffect(()=>{(0,l3._)(rE[e])},[e]),S.useEffect(()=>{Math.random()>.99&&(0,l5._)(l4.sn.VISITOR_100)},[]),(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(l1.A,{className:rd.l3,step:e,direction:i,children:function(e,t,i){function n(e){return()=>{t(e)}}switch(e){case 0:return(0,E.jsx)(rb,{onChangePage:n(1),setShowEnableAnimation:i});case 1:return(0,E.jsx)(ra,{onBackClick:n(0)});default:return null}}(e,t,l)}),(0,E.jsx)("div",{className:a?rd.Sr:rd.IP,children:(0,E.jsx)(l0.a,{className:rd.gT,importData:rC,shouldAnimate:a,autoplay:!1,resetOnPlay:!0,loop:!1,onComplete:()=>l(!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)]}),rj=(0,a.zZ)(u.X.POGGERMODE_CATEGORY,{buildLayout:()=>[ry]});var rO=i(231570);let rR=(0,a.t_)(u.X.POGGERMODE_PANEL,{useTitle:()=>j.intl.string(j.t.AtCukI),buildLayout:()=>[rj]}),rL=(0,a.i4)(u.X.POGGERMODE_SIDEBAR_ITEM,{useTitle:()=>j.intl.string(j.t.AtCukI),icon:()=>(0,E.jsx)("img",{alt:"",src:i(724405),className:rO.$}),usePredicate:()=>(0,g.bG)([lQ.A],()=>lQ.A.settingsVisible),buildLayout:()=>[rR]});var rD=i(307301),rP=i(410767),rG=i(695366),rM=i(283540),rU=i(868886);function rV(e){let{game:t,application:i}=e;return null==t||null==i?(0,E.jsx)("div",{className:rU.zc,children:(0,E.jsx)(rG.E,{size:"sm",color:er.A.colors.TEXT_FEEDBACK_WARNING})}):(0,E.jsxs)("div",{className:rU.nt,children:[(0,E.jsx)(p.A,{game:i,pid:t.pid,size:p.M.MEDIUM}),(0,E.jsx)("div",{className:rU.Am,children:(0,E.jsx)(rG.E,{size:"sm",color:er.A.colors.TEXT_FEEDBACK_WARNING})})]})}function rk(e){let t=(0,g.bG)([rM.Ay],()=>rM.Ay.getMode()),{runningGame:i,runningGameApplication:n}=tl();null==i||i.elevated||(i=void 0,n=void 0);let s=(0,tC.NP)(),l=s&&null!=i&&t===U.TBI.PUSH_TO_TALK;return{canPrompt:"voice"===e?l:s,runningGame:i,runningGameApplication:n}}function rw(e){let{className:t,sourcePage:i}=e,{canPrompt:n,runningGame:s,runningGameApplication:l}=rk(i);return n?(0,E.jsxs)("div",{className:e6()(rU.kL,t),children:[(0,E.jsx)(rV,{game:s,application:l}),(0,E.jsxs)("div",{className:rU.FS,children:[(0,E.jsx)(es.E,{variant:"text-sm/medium",color:"text-strong",children:"voice"===i?j.intl.string(j.t.vxfv7v):null!=s?j.intl.string(j.t.fAYU2G):j.intl.string(j.t["9V4X/c"])}),(0,E.jsx)(es.E,{variant:"text-xs/medium",color:"text-muted",children:j.intl.format(j.t["/y6htt"],{helpCenterLink:tI.A.getArticleURL(U.MVz.SYSTEM_SERVICE)})})]}),(0,E.jsx)(eG.$,{variant:"secondary",size:"sm",text:j.intl.string(j.t["1iI46O"]),onClick:function(){(0,tC.sL)(i+(null!=s?"-with-game":"-no-game"))}})]}):null}var rF=i(691885),rB=i(408278),rz=i(241326),rY=i(489718),rX=i(189213),rH=i(292666),rK=i(320989),rW=i(978263);let rZ=[];var rq=i(235986),rQ=i(820785),rJ=i(734057),r$=i(808728),r0=i(926140),r1=i(387722);function r2(){}let r3=[r0.rD.VOICE_CHANNEL];function r6(e){e.setOptions({voiceChannelGuildFilter:null}),e.setLimit(1/0)}function r5(){return(0,E.jsx)("div",{className:r1.i1,children:(0,E.jsx)(es.E,{variant:"text-md/medium",color:"text-muted",className:r1.GN,children:j.intl.string(j.t.zHjCd1)})})}function r4(e){let{keybind:t,className:i}=e,n=S.useRef(t);S.useEffect(()=>{n.current=t});let[s,l]=S.useState(t.params?.channelId??void 0),r=S.useCallback(()=>{(0,K.openModalLazy)(async()=>e=>(0,E.jsx)(r8,{...e,onSelect:e=>{l(e),tH.A.setKeybind({...n.current,params:{channelId:e}})}}))},[]);return(0,E.jsx)("div",{className:e6()(r1.a8,i),children:(0,E.jsx)(s6.D,{label:j.intl.string(j.t.q4JpM8),children:(0,E.jsxs)(rq.A,{align:rq.A.Align.STRETCH,children:[(0,E.jsx)("div",{className:r1.$X,children:(0,E.jsx)(r7,{channelId:s})}),(0,E.jsx)(rq.A.Child,{grow:0,shrink:0,children:(0,E.jsx)(eG.$,{variant:"primary",text:j.intl.string(j.t.Dm8O4e),onClick:r})})]})})})}function r8(e){let t,i,{transitionState:n,onClose:s,onSelect:l}=e,r=S.useId(),a=S.useRef(null),{query:o,updateQuery:u,queryResults:d}=function(e){let{visible:t,autocompleterResultTypes:i,autocompleterOptions:n,autocompleterBeforeCreateSearchContext:s}=e,[l,r]=S.useState(""),[a,o]=S.useState(rZ),u=S.useCallback((e,t)=>{""===(t=t.trim()).trim()?o(rZ):o(e)},[]);S.useEffect(()=>rK.A.addRouteChangeListener(()=>{r("")}),[]);let[d]=S.useState(()=>new rW.A(u,i,void 0,n));return S.useEffect(()=>{t?(s?.(d),d.createSearchContext()):(d.clean(),r(""))},[t,d,s]),{queryResults:a,query:l,updateQuery:S.useCallback(e=>{r(e),d.search(e)},[d])}}({visible:!0,autocompleterResultTypes:r3,autocompleterBeforeCreateSearchContext:r6}),c=(t=""!==o,i=(0,g.yK)([r$.Ay,rJ.A,s4.A],()=>{let e=s4.A.getGuildId();if(t||null==e)return[];let i=[];for(let t of r$.Ay.getVocalChannelIds(e)){let e=rJ.A.getChannel(t);null!=e&&i.push(e)}return i},[t]),t?null:i),{focusedIndex:m,setFocusedIndex:A}=function(e){let[t,i]=S.useState(0),n=S.useRef(e);return e!==n.current&&0!==t&&i(0),S.useEffect(()=>{n.current=e}),{focusedIndex:t,setFocusedIndex:i}}(o);S.useEffect(()=>{let{current:e}=a;null==e||e.isItemVisible(0,m,!0)||e.scrollToIndex({section:0,row:m})},[m]);let h=null!=c?c.length:d.length,T=(()=>{if(null!=c)return c[m]?.id;let e=d[m];if(e?.type===r0.rD.VOICE_CHANNEL)return e.record.id})(),x=h>0||""===o?{innerId:r,innerRole:"listbox",innerAriaLabel:j.intl.string(j.t["+N3fW7"]),ref:a,sections:[h],renderRow:function(e){let{row:t}=e,i=(()=>{if(null!=c)return c[t];let e=d[t];if(e?.type===r0.rD.VOICE_CHANNEL)return e.record})();if(null==i)return null;let n=null!=i.parent_id?rJ.A.getChannel(i.parent_id):void 0,r=ec.A.getGuild(i.guild_id);return(0,E.jsx)(rQ.c3,{id:i.id,channel:i,category:n,focused:m===t,onMouseEnter:()=>A(t),onClick:()=>{l(i.id),s()},onFocus:()=>A(t),children:null!=r?(0,E.jsx)("div",{className:r1.J5,children:r.name}):null},i.id)},sectionHeight:0,rowHeight:34}:{sections:[1],renderRow:()=>(0,E.jsx)(r5,{}),sectionHeight:0,rowHeight:52};return(0,E.jsx)(rX.Modal,{transitionState:n,onClose:s,title:j.intl.string(j.t.Dm8O4e),subtitle:j.intl.string(j.t.q4JpM8),actions:void 0,input:(0,E.jsx)(rH.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":s();break;case"enter":{let e=(()=>{if(null!=c)return c[m];let e=d[m];if(e?.type===r0.rD.VOICE_CHANNEL)return e.record})();null==e?l(void 0):l(e.id),s();break}case"arrowup":0===m?A(h-1):A(m-1);break;case"arrowdown":m>=h-1?A(0):A(m+1)}},placeholder:j.intl.string(j.t.tG0r7g),role:"combobox","aria-controls":r,"aria-expanded":h>0,"aria-activedescendant":h>0&&null!=T?T:void 0,"aria-autocomplete":"list",spellCheck:!1,autoFocus:!0}),listProps:x})}function r7(e){let{channelId:t}=e,{channel:i,category:n,guild:s}=(0,g.cf)([rJ.A,ec.A],()=>{let e=null!=t?rJ.A.getChannel(t):void 0;return null!=e?{channel:e,category:null!=e.parent_id?rJ.A.getChannel(e.parent_id):void 0,guild:null!=e.guild_id?ec.A.getGuild(e.guild_id):void 0}:{channel:void 0,category:void 0,guild:void 0}});return null==i?(0,E.jsx)(es.E,{variant:"text-md/medium",color:"text-muted",className:r1.GN,children:j.intl.string(j.t["/fYIK7"])}):(0,E.jsx)(rQ.c3,{channel:i,id:i.id,category:n,onClick:r2,onFocus:r2,onMouseEnter:r2,focused:!1,children:null!=s?(0,E.jsx)("div",{className:r1.J5,children:s.name}):null})}var r9=i(492064);function ae(e){let{keybind:t}=e,i=eq.dI(t.shortcut);return si.A.hasBind(i)?(0,E.jsx)("div",{className:r9.$e,children:(0,E.jsx)(q.w,{type:"warning",children:j.intl.string(j.t["7lQlw3"])})}):iP.Yy.has(i)?(0,E.jsx)("div",{className:r9.$e,children:(0,E.jsx)(q.w,{type:"warning",children:j.intl.format(j.t.MOIaNd,{keyboardNavArticle:tI.A.getArticleURL(U.MVz.KEYBOARD_NAVIGATION)})})}):void 0}function at(e){let{keybind:t}=e;return t.action===U.hCu.SWITCH_TO_VOICE_CHANNEL?(0,E.jsx)(r4,{keybind:t,className:r9._M}):null}let ai=S.memo(function(e){let{keybind:t,keybindDescriptions:i,keybindActionTypes:n}=e,s=S.useCallback(e=>tH.A.setKeybind({...t,action:e}),[t]),l=S.useCallback(e=>tH.A.setKeybind({...t,shortcut:e}),[t]),r=S.useCallback(()=>tH.A.setKeybind({...t,enabled:!t.enabled}),[t]),a=S.useCallback(()=>tH.A.deleteKeybind(t.id),[t.id]),o=S.useId(),u=S.useMemo(()=>n.find(e=>e.value===t.action)?.label??t.action,[t.action,n]);return(0,E.jsxs)("div",{className:r9.f_,children:[(0,E.jsx)(ae,{keybind:t}),(0,E.jsx)("div",{className:r9.XI,children:(0,E.jsx)(rF.l,{selectionMode:"single",label:j.intl.string(j.t.XH5b12),value:t.action,options:n,onSelectionChange:s,disabled:t.managed})}),(0,E.jsx)("div",{className:r9.LE,children:(0,E.jsx)(s6.D,{label:j.intl.string(j.t["1La4tC"]),layout:"vertical",children:(0,E.jsx)(tK.A,{defaultValue:t.shortcut,onChange:l})})}),(0,E.jsxs)("div",{className:r9.ne,children:[!t.managed&&(0,E.jsx)(rB.K,{variant:"icon-only",onClick:a,icon:rz.u,"aria-label":j.intl.string(j.t.qEHmmB)}),(0,E.jsx)(tr.m,{text:j.intl.string(t.enabled?j.t.pNYGbx:j.t["51DGkH"]),ariaHidden:!0,children:(0,E.jsxs)("div",{children:[(0,E.jsx)(eo.A,{id:o,children:j.intl.format(t.enabled?j.t["myr/Y0"]:j.t.lYhtPO,{actionName:u})}),(0,E.jsx)(rY.I,{checked:t.enabled,onChange:r,labelledBy:o})]})})]}),(0,E.jsx)(es.E,{variant:"text-xs/normal",color:"text-subtle",className:r9.h_,children:i[t.action]}),(0,E.jsx)(at,{keybind:t})]})});var an=i(549406),as=i(734066),al=i(880144),ar=i(614455),aa=i(487866);let ao=function(){let e,t,i,n,s,l,{customizableKeybinds:r,keybindDescriptions:a,keybindActionTypes:o}=(e=(0,g.bG)([eB.Ay],()=>eB.Ay.getState()),t=(0,g.bG)([rM.Ay],()=>(0,al.A)(rM.Ay)),i=(0,g.bG)([ar.A],()=>ar.A.isSupported),n=(0,as.sw)(),s=(0,as.BW)(),{customizableKeybinds:function(e){let{keybinds:t,enableClips:i,enableScreenshotKeybind:n,allowSoundboard:s}=e;return eZ()(t).reject(e=>e.managed&&![U.hCu.OVERLAY_ACTIVATE_REGION_TEXT_WIDGET,U.hCu.SAVE_CLIP,U.hCu.SAVE_SCREENSHOT].includes(e.action)).reject(e=>!i&&(e.action===U.hCu.SAVE_CLIP||e.action===U.hCu.SAVE_SCREENSHOT)).reject(e=>!n&&e.action===U.hCu.SAVE_SCREENSHOT).reject(e=>!s&&(e.action===U.hCu.SOUNDBOARD||e.action===U.hCu.SOUNDBOARD_HOLD)).sortBy(e=>e.id).sortBy(e=>!0===e.managed?-1:0).value()}({keybinds:e,enableClips:n,enableScreenshotKeybind:s,allowSoundboard:l=(0,eX.isWindows)()}),keybindActionTypes:function(e){let{overlaySupported:t,canGoLive:i,allowSoundboard:n,enableClips:s,enableScreenshotKeybind:l}=e,r=[{id:"unassigned",value:U.hCu.UNASSIGNED,label:j.intl.string(j.t["0Uh579"])},{id:"push-to-talk",value:U.hCu.PUSH_TO_TALK,label:j.intl.string(j.t.Y5lgTP)},{id:"push-to-talk-priority",value:U.hCu.PUSH_TO_TALK_PRIORITY,label:j.intl.string(j.t.DkSwJ2)},{id:"push-to-mute",value:U.hCu.PUSH_TO_MUTE,label:j.intl.string(j.t.hSCRqd)},{id:"vad-priority",value:U.hCu.VAD_PRIORITY,label:j.intl.string(j.t["49d6Nd"])},{id:"toggle-mute",value:U.hCu.TOGGLE_MUTE,label:j.intl.string(j.t.PlkYKD)},{id:"toggle-deafen",value:U.hCu.TOGGLE_DEAFEN,label:j.intl.string(j.t.NvGq1K)},{id:"toggle-voice-mode",value:U.hCu.TOGGLE_VOICE_MODE,label:j.intl.string(j.t.Wa5H9S)},{id:"toggle-streamer-mode",value:U.hCu.TOGGLE_STREAMER_MODE,label:j.intl.string(j.t.BK0Ncc)},{id:"toggle-camera",value:U.hCu.TOGGLE_CAMERA,label:j.intl.string(j.t.hf8JVT)},{id:"toggle-voice-channel-chat",value:U.hCu.TOGGLE_VOICE_CHANNEL_CHAT,label:j.intl.string(j.t.YeqEjm)}];return t&&(r.push({id:"toggle-overlay-input-lock",value:U.hCu.TOGGLE_OVERLAY_INPUT_LOCK,label:j.intl.string(j.t.VsAZcC)}),r.push({id:"activate-overlay-region-text-widget",value:U.hCu.OVERLAY_ACTIVATE_REGION_TEXT_WIDGET,label:j.intl.string(j.t.hurHWo)})),i&&((0,eX.isWindows)()||rM.Ay.getUseSystemScreensharePicker())&&r.push({id:"toggle-go-live-streaming",value:U.hCu.TOGGLE_GO_LIVE_STREAMING,label:j.intl.string(j.t.ybdjJD)}),(0,eX.isDesktop)()&&(r.push({id:"navigate-back",value:U.hCu.NAVIGATE_BACK,label:j.intl.string(j.t.gRSaOa)},{id:"navigate-forward",value:U.hCu.NAVIGATE_FORWARD,label:j.intl.string(j.t.zOXpjU)},{id:"switch-to-voice-channel",value:U.hCu.SWITCH_TO_VOICE_CHANNEL,label:j.intl.string(j.t.ty7Lxy)},{id:"disconnect-from-voice-channel",value:U.hCu.DISCONNECT_FROM_VOICE_CHANNEL,label:j.intl.string(j.t.CV7mT7)}),n&&r.push({id:"soundboard",value:U.hCu.SOUNDBOARD,label:j.intl.string(j.t.yPH4xm)},{id:"soundboard-hold",value:U.hCu.SOUNDBOARD_HOLD,label:j.intl.string(j.t["1xFbP/"])}),s&&(r.push({id:"save-clip",value:U.hCu.SAVE_CLIP,label:j.intl.string(j.t.U4URzP)}),l&&r.push({id:"save-screenshot",value:U.hCu.SAVE_SCREENSHOT,label:j.intl.string(j.t["+WloFH"])}))),r}({overlaySupported:i,canGoLive:t,allowSoundboard:l,enableClips:n,enableScreenshotKeybind:s}),keybindDescriptions:function(e){let{overlaySupported:t,canGoLive:i,enableClips:n,enableScreenshotKeybind:s}=e,l={[U.hCu.UNASSIGNED]:j.intl.string(j.t.rvlNLv),[U.hCu.PUSH_TO_MUTE]:j.intl.string(j.t.xtESim),[U.hCu.PUSH_TO_TALK]:j.intl.string(j.t.wTcBSy),[U.hCu.PUSH_TO_TALK_PRIORITY]:j.intl.string(j.t.FhHvWH),[U.hCu.TOGGLE_MUTE]:j.intl.string(j.t.X2fbUm),[U.hCu.TOGGLE_DEAFEN]:j.intl.string(j.t.MjREZV),[U.hCu.TOGGLE_VOICE_MODE]:j.intl.string(j.t.snm5YW),[U.hCu.TOGGLE_STREAMER_MODE]:j.intl.string(j.t.YszLLx),[U.hCu.VAD_PRIORITY]:j.intl.string(j.t.rSe8IZ),[U.hCu.TOGGLE_CAMERA]:j.intl.string(j.t.v1JBtL),[U.hCu.TOGGLE_VOICE_CHANNEL_CHAT]:j.intl.string(j.t.desfB4)};return t&&(l[U.hCu.TOGGLE_OVERLAY_INPUT_LOCK]=j.intl.string(j.t.IoP5vc)),i&&(0,eX.isWindows)()&&(l[U.hCu.TOGGLE_GO_LIVE_STREAMING]=j.intl.string(j.t.s4C238)),(0,eX.isDesktop)()&&(l[U.hCu.NAVIGATE_BACK]=j.intl.string(j.t.nKDlEt),l[U.hCu.NAVIGATE_FORWARD]=j.intl.string(j.t.DK0FFk),l[U.hCu.SOUNDBOARD]=(0,eX.isWindows)()?j.intl.string(j.t["5wJefL"]):j.intl.string(j.t.gzjsSP),l[U.hCu.SOUNDBOARD_HOLD]=(0,eX.isWindows)()?j.intl.string(j.t.RRkZc9):j.intl.string(j.t.laNlTl),n&&(l[U.hCu.SAVE_CLIP]=j.intl.string(j.t.z3Wbam),s&&(l[U.hCu.SAVE_SCREENSHOT]=j.intl.string(j.t.m0zd57)))),l}({overlaySupported:i,canGoLive:t,enableClips:n,enableScreenshotKeybind:s})});return 0===r.length?(0,E.jsx)(es.E,{variant:"text-sm/normal",color:"text-subtle",children:j.intl.string(j.t.vyYgWp)}):(0,E.jsx)("div",{className:aa.A,children:r.map((e,t)=>(0,E.jsxs)(S.Fragment,{children:[(0,E.jsx)(ai,{keybind:e,keybindDescriptions:a,keybindActionTypes:o}),t<r.length-1?(0,E.jsx)(eM.c,{className:aa.y,gap:24}):null]},e.id))})},au=(0,a.E2)(u.X.CUSTOM_KEYBINDS_SETTING,{useSearchTerms:()=>[j.intl.string(j.t["069nVT"])],Component:function(){return c.Av?(0,E.jsx)(ao,{}):(0,E.jsx)(q.w,{type:"info",children:j.intl.format(j.t.mPi3F3,{downloadLink:U.X7G.DOWNLOAD})})}});var ad=i(475358),ac=i(28647),ag=i(760677);function am(e){let{children:t}=e;return t([an.Q_.MESSAGE,an.Q_.NAVIGATION,an.Q_.DND,an.Q_.CHAT,an.Q_.VOICE_AND_VIDEO,an.Q_.MISCELLANEOUS])}function aA(e){let{showHeader:t=!0}=e,i=eZ()((0,an.Bx)()).filter(e=>e.description!==j.intl.string(j.t.HnNtEI)).groupBy(e=>e.group).value();return(0,E.jsxs)(Q.B,{gap:48,children:[(0,E.jsx)(iC.n,{label:t?j.intl.string(j.t.Lz5KHI):void 0,children:(0,E.jsx)("div",{className:ag.jh,children:(0,E.jsxs)("div",{className:ag.yZ,children:[(0,E.jsx)(es.E,{variant:"text-md/normal",children:j.intl.string(j.t.sMWLBj)}),(0,E.jsx)("div",{className:ag.DM,children:(0,E.jsx)(ad.e,{shortcut:ac.z.binds["0"],className:ag.LE})})]})})}),(0,E.jsx)(am,{children:e=>(0,E.jsx)(E.Fragment,{children:e.map((e,t)=>{let n=(0,an.Gm)(e),s=(0,an.zF)(e),l=i[e];return(0,E.jsx)(iC.n,{label:n,description:s,children:(0,E.jsx)("div",{className:ag.jh,children:l.map((e,t)=>(0,E.jsxs)(S.Fragment,{children:[0!==t&&(0,E.jsx)(eM.c,{}),(0,E.jsxs)("div",{className:ag.yZ,children:[(0,E.jsx)(es.E,{variant:"text-md/normal",children:e.description}),(0,E.jsx)("div",{className:ag.DM,children:e.binds.map(e=>(0,E.jsx)(ad.e,{shortcut:e,className:ag.LE},e))})]})]},e.description))})},t)})})})]})}let ah=(0,a.E2)(u.X.DEFAULT_KEYBINDS_SETTING,{useSearchTerms:()=>[j.intl.string(j.t.Lz5KHI)],Component:()=>(0,E.jsx)(aA,{showHeader:!1})});var aE=i(19575),aS=i(546385);let aT=(0,a.E2)(u.X.HARDWARE_ACCELERATION,{usePredicate:()=>c.Av&&!(0,c.cX)(),useSearchTerms:()=>[j.intl.string(j.t["/HIxyY"]),j.intl.string(j.t.B0hqpb)],Component:function(){let[e]=S.useState(()=>aE.Ay.getEnableHardwareAcceleration()),t=j.intl.string(j.t["/HIxyY"]),i=j.intl.string(j.t.B0hqpb);return(0,E.jsxs)(Q.B,{children:[(0,E.jsx)(J.d,{label:t,description:i,checked:e,onChange:ax}),!e&&(0,E.jsx)(aS.A,{look:aS.k.WARNING,children:j.intl.string(j.t.j7S6IX)})]})}});function ax(e){let t=e?j.intl.format(j.t.LYXRxL,{}):j.intl.format(j.t.uDP3Kz,{});(0,lJ.A)({title:j.intl.string(j.t.aqpAvn),subtitle:t,confirmText:j.intl.string(j.t.vT7ckk),onConfirm:()=>{aE.Ay.setEnableHardwareAcceleration(e)}})}let ap=(0,nM.D)(()=>({openOnStartup:!0,startMinimized:!1,minimizeToTray:!0}));async function af(){let e=await aE.Ay.getOpenOnStart(),t=await aE.Ay.getSetting("START_MINIMIZED",!1),i=await aE.Ay.getSetting("MINIMIZE_TO_TRAY",!0);ap.setState({openOnStartup:e,startMinimized:t,minimizeToTray:i})}let aN=(0,a.zD)(u.X.OS_OPEN_ON_STARTUP,{useTitle:()=>j.intl.string(j.t["3BeZti"]),usePredicate:()=>c.Av&&!(0,c.cX)(),useValue:()=>ap.useState(e=>e.openOnStartup),setValue:function(e){ap.setState({openOnStartup:e}),aE.Ay.send("TOGGLE_OPEN_ON_STARTUP",e)},initialize:()=>{aE.Ay.getOpenOnStart().then(e=>ap.setState({openOnStartup:e}))}}),a_=(0,a.zD)(u.X.OS_MINIMIZE_TO_TRAY,{useTitle:()=>j.intl.string(j.t.dJ5MUh),useSubtitle:()=>j.intl.string(j.t.nQavHr),usePredicate:()=>c.Av&&!(0,c.cX)(),useValue:()=>ap.useState(e=>e.minimizeToTray),setValue:function(e){ap.setState({minimizeToTray:e}),aE.Ay.send("TOGGLE_MINIMIZE_TO_TRAY",e)},initialize:()=>{aE.Ay.getSetting("MINIMIZE_TO_TRAY",!0).then(e=>ap.setState({minimizeToTray:e}))}}),aI=(0,a.zD)(u.X.OS_START_MINIMIZED,{useTitle:()=>j.intl.string(j.t.GfBL83),useSubtitle:()=>j.intl.string(j.t.XGyhhc),usePredicate:()=>(0,c.uF)(),useValue:()=>ap.useState(e=>!!e.openOnStartup&&e.startMinimized),setValue:function(e){ap.setState({startMinimized:e}),aE.Ay.send("TOGGLE_START_MINIMIZED",e)},useDisabled:()=>!ap.useState(e=>e.openOnStartup),initialize:()=>{aE.Ay.getSetting("START_MINIMIZED",!1).then(e=>ap.setState({startMinimized:e}))}});var aC=i(314647);let ab=new Set(["failure","unknown"]),av=(0,a.E2)(u.X.OS_SYSTEM_SERVICE,{useSearchTerms:()=>[j.intl.string(j.t.roHq80)],Component:function(){let[e,t]=S.useState(!1),[i,n]=S.useState(()=>(0,tC.TC)()),s=(0,g.bG)([m.Ay],()=>m.Ay.getSystemServiceStatus("input-service")),l=S.useCallback(async()=>{t(!0),i?await (0,tC.z8)("windows-settings"):await (0,tC.sL)("windows-settings"),t(!1),n((0,tC.TC)())},[i]);return(0,E.jsxs)("div",{className:aC.q,children:[(0,E.jsxs)("div",{className:aC.L,children:[(0,E.jsxs)(Q.B,{direction:"horizontal",children:[(0,E.jsx)(es.E,{variant:"text-md/medium",color:"text-strong",children:j.intl.string(j.t.roHq80)}),i&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(es.E,{variant:"text-md/medium",color:"text-strong","aria-hidden":!0,children:"\u2022"}),(0,E.jsx)(es.E,{variant:"text-md/medium",color:"running"===s.state?"text-feedback-positive":ab.has(s.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,N.xb)(e.state)}}(s)})]})]}),(0,E.jsx)(es.E,{variant:"text-sm/normal",color:"text-subtle",children:j.intl.format(j.t["8CAL+D"],{helpCenterLink:tI.A.getArticleURL(U.MVz.SYSTEM_SERVICE)})})]}),(0,E.jsx)(eG.$,{variant:i?"critical-secondary":"primary",loading:e,onClick:l,text:i?j.intl.string(j.t.pAwbdL):j.intl.string(j.t["1iI46O"])})]})},usePredicate:tC.XQ});function ay(){su.h.dispatch({type:"DISCORD_STATS_POPOUT_WINDOW_OPEN"})}let aj=(0,a.Tf)(u.X.DISCORD_STATS_POPOUT,{useTitle:()=>"Discord Stats",useSubtitle:()=>"Open a floating panel showing live GPU, CPU, and memory usage.",useLabel:()=>"Open",usePredicate:()=>(0,g.bG)([id.default],()=>id.default.getCurrentUser()?.isStaff()??!1),onClick:()=>{ay()}}),aO=(0,a.zZ)(u.X.SYSTEM_ADVANCED_CATEGORY,{useTitle:()=>j.intl.string(j.t["8/udY0"]),buildLayout:()=>[aj]}),aR=(0,a.zZ)(u.X.SYSTEM_GENERAL_CATEGORY,{useTitle:()=>j.intl.string(j.t.cg6ltt),buildLayout:()=>[aN,aI,a_,aT],usePredicate:()=>c.Av&&((0,c.uF)()||(0,c.j9)()),initialize:()=>{af()}}),aL=(0,a.zZ)(u.X.SYSTEM_CUSTOM_KEYBINDS_CATEGORY,{useTitle:()=>j.intl.string(j.t["069nVT"]),useSubtitle:()=>j.intl.string(j.t.T4LZVL),buildLayout:()=>[au],initialize:()=>(tH.A.enableAll(!1),()=>tH.A.enableAll(!0)),useInlineNotice:function(){return c.Av?{type:h.lT.STRONGLY_DISCOURAGED_CUSTOM,notice:()=>(0,E.jsxs)(Q.B,{direction:"vertical",gap:"md",children:[(0,E.jsx)(q.w,{type:"info",children:j.intl.string(j.t["5pkmHa"])}),(0,E.jsx)(rw,{sourcePage:"keybinds"})]})}:null},useHeaderDecoration:()=>c.Av?{type:h.WX.BUTTON_GROUP,buttons:[{id:"add-keybind",type:h.UV.BUTTON,text:j.intl.string(j.t.zk6Xbs),variant:"secondary",icon:rD.j,onClick:()=>tH.A.addKeybind()}]}:null}),aD=(0,a.zZ)(u.X.SYSTEM_DEFAULT_KEYBINDS_CATEGORY,{useTitle:()=>j.intl.string(j.t.Lz5KHI),buildLayout:()=>[ah]}),aP=(0,a.zZ)(u.X.SYSTEM_HELPER_CATEGORY,{useTitle:()=>j.intl.string(j.t["+XZgmA"]),usePredicate:()=>c.Av&&((0,c.uF)()||(0,c.j9)()),buildLayout:()=>[av]}),aG=(0,a.t_)(u.X.SYSTEM_PANEL,{useTitle:()=>j.intl.string(j.t["VJ/qKo"]),buildLayout:()=>[aR,aL,aD,aP,aO]}),aM=(0,a.i4)(u.X.SYSTEM_SIDEBAR_ITEM,{useTitle:()=>j.intl.string(j.t["VJ/qKo"]),icon:rP.F,buildLayout:()=>[aG]});var aU=i(831544),aV=i(922795),ak=i(212245),aw=i(329551),aF=i(285918),aB=i(413339),az=i(952572),aY=i(382003);let aX=(0,a.E2)(u.X.CAMERA_BACKGROUND_SETTING,{useSearchTerms:()=>[j.intl.string(j.t.lZTUPs)],usePredicate:az.A,Component:function(){let e=(0,ak.p)(),t=S.useRef(!1),i=(0,g.bG)([rM.Ay],()=>rM.Ay.getVideoDeviceId()),[n,s]=S.useState((0,aw.i)(id.default.getCurrentUser())),l=S.useRef(n);return S.useEffect(()=>()=>{t.current&&(0,aF._C)(l.current)},[]),(0,E.jsx)(aY.A,{selectedBackgroundOption:n,onSelectBackgroundOption:function(i){t.current=!0,l.current=i,s(i),(0,aB.gB)(i,{location:e.location}).catch(U.tEg)},currentDeviceId:i})}}),aH=(0,a.zD)(u.X.CAMERA_PREVIEW_PREFERENCE,{useTitle:()=>j.intl.string(j.t["3Ppr1h"]),useSubtitle:()=>j.intl.string(j.t.WNbX4O),useValue:L.bm.useSetting,setValue:e=>{L.bm.updateSetting(e),G.default.track(U.HAw.UPDATE_USER_SETTINGS_LOCAL,{always_preview_video:e})}});var aK=i(625841),aW=i(74848),aZ=i(204050);let aq=(0,nM.D)(()=>({previewEnabled:!1}));var aQ=i(731854);let aJ=(0,a.E2)(u.X.CAMERA_SELECTION_SETTING,{useSearchTerms:()=>[j.intl.string(j.t.FsQ3OR)],Component:function(){let e=(0,g.bG)([rM.Ay],()=>rM.Ay.isVideoAvailable()),{id:t}=(0,aW.x5)(aQ.oh.VIDEO_INPUT),{analyticsLocations:i}=(0,nQ.Ay)();return(0,E.jsx)(aK.U,{label:j.intl.string(j.t.FsQ3OR),deviceType:aQ.oh.VIDEO_INPUT,location:"UserSettingsCameraSelect",isDisabled:!e,helperText:(0,aZ.p)()?j.intl.format(j.t.aJYgRt,{onCameraSettingsClick:()=>{aq.setState({previewEnabled:!1}),window.open((0,aZ.i)(t)),G.default.track(U.HAw.SYSTEM_CAMERA_SETTINGS_OPENED,{location_stack:i})}}):void 0})}});var a$=i(745317),a0=i(514956);let a1=(0,a.E2)(u.X.CAMERA_VIDEO_PREVIEW,{useSearchTerms:()=>[j.intl.string(j.t.JIf4v7)],Component:function(){let e=rM.Ay.getCameraComponent(),t=(0,g.bG)([rM.Ay],()=>rM.Ay.getVideoDeviceId()),i=aq.useField("previewEnabled"),n=(0,g.bG)([rM.Ay],()=>rM.Ay.isVideoAvailable());return((0,tg.l0)(()=>{aq.setState({previewEnabled:!1})}),i)?(0,E.jsx)("div",{className:a0.T9,children:(0,E.jsxs)("div",{className:a0.Xi,children:[(0,E.jsxs)("div",{className:a0.UI,children:[(0,E.jsx)(e,{deviceId:t,width:387,height:218,disabled:!i}),(0,E.jsx)(a$.kE,{})]}),(0,E.jsx)(a$.eK,{})]})}):(0,E.jsx)("div",{className:a0.T9,children:(0,E.jsx)(tr.m,{text:n?null:j.intl.string(j.t["8jSzSe"]),children:(0,E.jsx)(eG.$,{variant:"primary",text:j.intl.string(j.t.JIf4v7),onClick:()=>aq.setState({previewEnabled:!0}),disabled:!n})})})}}),a2=(0,a.zZ)(u.X.CAMERA_CATEGORY,{useTitle:()=>j.intl.string(j.t.uje3P9),usePredicate:()=>(0,g.bG)([rM.Ay],()=>rM.Ay.supports(aQ.O5.VIDEO)),buildLayout:()=>[a1,aH,aJ,aX]});var a3=i(827343);let a6=(0,a.zD)(u.X.VOICE_AND_VIDEO_OPENH264,{useTitle:()=>j.intl.string(j.t.qFphsa),useSubtitle:()=>j.intl.string(j.t.cQfwyY),usePredicate:function(){return(0,c.j9)()},useValue:function(){return(0,g.bG)([rM.Ay],()=>rM.Ay.getOpenH264Enabled())},setValue:function(e){a3.A.setOpenH264Enabled(e),(0,lJ.A)({title:j.intl.string(j.t["9jf31O"]),subtitle:j.intl.string(j.t["J2wg+X"]),confirmText:j.intl.string(j.t.BddRzS),onConfirm:()=>lf.A.app.relaunch()})},useSearchTerms:()=>["open","OpenH264","H264","codec"]}),a5=(0,a.zD)(u.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,g.bG)([rM.Ay],()=>rM.Ay.getAecDump())},setValue:a3.A.setAecDump,usePredicate:function(){return(0,g.bG)([rM.Ay],()=>rM.Ay.isAecDumpSupported())}});var a4=i(139033),a8=i(862482),a7=i(640238),a9=i(825484),oe=i(77138),ot=i(487329),oi=i(353835);let on=(0,nM.D)(()=>({isUploading:!1,isDisabled:!1}));async function os(){let e=await lf.A.fileManager.getLogPath();lf.A.fileManager.showItemInFolder(e)}function ol(e){(0,lJ.A)({title:j.intl.string(j.t["7UXEF2"]),subtitle:j.intl.string(j.t.IYPrRl),confirmText:j.intl.string(j.t.BddRzS),onConfirm:()=>a3.A.setDebugLogging(e)})}async function or(e){let{onUploadStart:t,onUploadFinish:i}=e;t?.();try{let e,t;await rM.Ay.getMediaEngine().writeAudioDebugState(),await oi.A.submitLiveCrashReport({message:{message:"User Live Dump"}}),await (0,oe.a)(U.Umv.RTC),e=j.intl.string(j.t["fKBB8+"]),t=j.intl.string(j.t.BvyxE7),(0,a4.A)({title:e,subtitle:t})}catch(l){var n;let e,t,i,s;n=l.displayMessage,e=j.intl.string(j.t.QZg0J7),t=n??j.intl.string(j.t.VzHcSm),i=(0,ot.B1)(ot.iy.DEBUG_LOG_UPLOAD_FAILED)?.errorCode,s=j.intl.formatToPlainString(j.t.ejOT95,{errorCode:i}),(0,K.openModal)(i=>(0,E.jsx)(a7.a,{header:e,confirmButtonColor:a8.$n.Colors.BRAND,confirmText:j.intl.string(j.t.BddRzS),...i,children:(0,E.jsxs)("div",{style:{display:"flex",flexDirection:"column",height:"100%"},children:[(0,E.jsx)(es.E,{variant:"text-md/normal",children:t}),(0,E.jsx)(es.E,{variant:"text-sm/semibold",selectable:!0,style:{marginTop:"auto"},children:s})]})}))}finally{i?.()}}async function oa(){await or({onUploadStart:()=>on.setState({isUploading:!0}),onUploadFinish:()=>on.setState({isUploading:!1,isDisabled:!0})})}let oo=(0,a.E2)(u.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,g.bG)([rM.Ay],()=>rM.Ay.supports(aQ.O5.DEBUG_LOGGING));return c.Av&&e&&null!=lf.A.fileManager.readLogFiles},Component:function(){let e=(0,g.bG)([rM.Ay],()=>rM.Ay.getDebugLogging()),t=on.useField("isUploading"),i=on.useField("isDisabled"),n=S.useId();return(0,E.jsxs)("fieldset",{children:[(0,E.jsx)(eo.A,{tag:"legend",id:n,children:j.intl.string(j.t["FjN+et"])}),(0,E.jsxs)(Q.B,{direction:"vertical",gap:4,children:[(0,E.jsx)(J.d,{label:j.intl.string(j.t["726JHL"]),description:j.intl.string(j.t["/7ak9Q"]),checked:e,onChange:ol}),(0,E.jsx)("div",{role:"group","aria-labelledby":n,children:(0,E.jsxs)(a9.e,{children:[(0,E.jsx)(eG.$,{variant:"secondary",text:j.intl.string(j.t.EbwFfR),onClick:oa,loading:t,disabled:i,"aria-label":j.intl.string(j.t.aY1OH2)}),(0,E.jsx)(eG.$,{variant:"secondary",text:j.intl.string(j.t.nuPtYi),onClick:os,"aria-label":j.intl.string(j.t["L/hFOe"])})]})})]})]})}});var ou=i(233545),od=i(412780);function oc(){return(0,g.bG)([id.default,rM.Ay],()=>{let e=id.default.getCurrentUser(),t=e?.isStaff()??!1,i="canary"===aE.Ay.releaseChannel||"development"===aE.Ay.releaseChannel,n=rM.Ay.supports(aQ.O5.CONNECTION_REPLAY);return t&&i&&n})}let og=(0,a.zD)(u.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,g.bG)([od.Ay],()=>od.Ay.shouldRecordNextConnection())},setValue:ou.Et,usePredicate:oc}),om=(0,a.Tf)(u.X.VOICE_AND_VIDEO_OPEN_CONNECTION_REPLAY,{useTitle:()=>j.intl.string(j.t.nJnOHO),useLabel:()=>j.intl.string(j.t["3xjX0U"]),onClick:ou.YW,usePredicate:oc});var oA=i(926919),oh=i(111162),oE=i(855302);let oS=(0,a.zD)(u.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,g.bG)([oh.default],()=>oh.default.isStreamInfoOverlayEnabled)},setValue:function(e){let t=oh.default.isStreamInfoOverlayEnabled;(0,oE.A)("stream_info_overlay_enabled",e,t),(0,oA.x)({isStreamInfoOverlayEnabled:e})},usePredicate:function(){return L.Q_.useSetting()}}),oT=(0,a.bd)(u.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:()=>[oS,a5,og,om,oo]});function ox(e,t,i){(0,lJ.A)({title:e,subtitle:t,confirmText:j.intl.string(j.t.BddRzS),onConfirm:i})}let op=(0,a.Tf)(u.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(){ox(j.intl.string(j.t["4iKQ/3"]),j.intl.string(j.t.sQ42iT),a3.A.reset)},useVariant:()=>"critical-secondary"}),of=(0,a.zZ)(u.X.VOICE_AND_VIDEO_DIAGNOSTICS_CATEGORY,{useTitle:()=>j.intl.string(j.t.UDAU9K),buildLayout:()=>[a6,oT,op]});var oN=i(347481),o_=i(852712);let oI=(0,a.zD)(u.X.VOICE_AUTOMATIC_GAIN_CONTROL_SETTING,{useTitle:()=>j.intl.string(j.t.cUMdH0),useSubtitle:()=>j.intl.string(j.t["6EjbvA"]),useValue:function(){return(0,g.bG)([rM.Ay],()=>rM.Ay.getAutomaticGainControl())},setValue:function(e){a3.A.setAutomaticGainControl(e,{page:U.liQ.USER_SETTINGS,section:U.JJy.SETTINGS_VOICE_AND_VIDEO})},useDisabled:function(){return(0,g.bG)([rM.Ay,oN.A],()=>{let e=rM.Ay.getInputDeviceId();return oN.A.hasAutomaticGainControl(e)})},usePredicate:function(){return(0,g.bG)([rM.Ay],()=>rM.Ay.isAutomaticGainControlSupported()&&rM.Ay.isInputProfileCustom())}}),oC=(0,a.sN)(u.X.VOICE_GLOBAL_ATTENUATION_SLIDER,{useTitle:()=>j.intl.string(j.t.AlybXj),setValue:e=>a3.A.setAttenuation(e,rM.Ay.getAttenuateWhileSpeakingSelf(),rM.Ay.getAttenuateWhileSpeakingOthers()),minValue:0,maxValue:100,getInitialValue:()=>rM.Ay.getAttenuation()}),ob=(0,a.zD)(u.X.VOICE_GLOBAL_ATTENUATION_FOR_SELF_SETTING,{useTitle:()=>j.intl.string(j.t["9dHxRY"]),useValue:()=>(0,g.bG)([rM.Ay],()=>rM.Ay.getAttenuateWhileSpeakingSelf()),setValue:e=>a3.A.setAttenuation(rM.Ay.getAttenuation(),e,rM.Ay.getAttenuateWhileSpeakingOthers())}),ov=(0,a.zD)(u.X.VOICE_GLOBAL_ATTENUATION_FOR_OTHERS_SETTING,{useTitle:()=>j.intl.string(j.t.SMt0Gr),useValue:()=>(0,g.bG)([rM.Ay],()=>rM.Ay.getAttenuateWhileSpeakingOthers()),setValue:e=>a3.A.setAttenuation(rM.Ay.getAttenuation(),rM.Ay.getAttenuateWhileSpeakingSelf(),e)}),oy=(0,a.FW)(u.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,g.bG)([rM.Ay],()=>rM.Ay.supports(aQ.O5.ATTENUATION)),buildLayout:()=>[oC,ob,ov]});var oj=i(801644);let oO=(0,a.zD)(u.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,g.bG)([nR.Ay],()=>!nR.Ay.disableHardwareMuteSilenceAlert)},setValue:function(e){(0,oE.A)("hardware_mute_silence_alert_enabled",e,!nR.Ay.disableHardwareMuteSilenceAlert),ld.Ay.updatedUnsyncedSettings({disableHardwareMuteSilenceAlert:!e})},usePredicate:function(){let{enableHardwareSilenceWarning:e}=oj.A.useConfig({location:"HardwareMuteSilenceAlertSetting"});return e}}),oR=(0,a.zD)(u.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,g.bG)([rM.Ay],()=>rM.Ay.getBypassSystemInputProcessing())},setValue:function(e){a3.A.setBypassSystemInputProcessing(e)},usePredicate:function(){return(0,g.bG)([rM.Ay],()=>rM.Ay.showBypassSystemInputProcessing()&&rM.Ay.isInputProfileCustom())}}),oL=(0,a.zD)(u.X.VOICE_SWITCH_CHANNEL_ALERT_SETTING,{useTitle:()=>j.intl.string(j.t.jrWHD3),useSubtitle:()=>j.intl.string(j.t.YCCMkJ),useValue:function(){return(0,g.bG)([nR.Ay],()=>!nR.Ay.disableVoiceChannelChangeAlert)},setValue:function(e){(0,oE.A)("switch_channel_warning_enabled",e,!nR.Ay.disableVoiceChannelChangeAlert),ld.Ay.updatedUnsyncedSettings({disableVoiceChannelChangeAlert:!e})}}),oD=(0,a.zD)(u.X.ADVANCED_VOICE_ACTIVITY_PROCESSING_SETTING,{useTitle:()=>j.intl.string(j.t.BbESsg),useSubtitle:()=>j.intl.string(j.t.LoOB1F),useValue:function(){return(0,g.bG)([rM.Ay],()=>{let{vadUseKrisp:e}=rM.Ay.getModeOptions();return e})},setValue:function(e){let t=rM.Ay.getMode();a3.A.setMode(t,{vadUseKrisp:e})},useDisabled:function(){return(0,g.bG)([rM.Ay],()=>rM.Ay.getMode()!==U.TBI.VOICE_ACTIVITY||!rM.Ay.getModeOptions().autoThreshold)},usePredicate:function(){return(0,g.bG)([rM.Ay],()=>rM.Ay.isAdvancedVoiceActivitySupported()&&rM.Ay.isInputProfileCustom())}}),oP=(0,a.Hn)(u.X.VOICE_AUDIO_SUBSYSTEM_SETTING,{useTitle:()=>j.intl.string(j.t.wVBHr0),useValue:function(){return(0,g.bG)([rM.Ay],()=>rM.Ay.getAudioSubsystem())},setValue:function(e){ox(j.intl.string(j.t.uY7AcQ),j.intl.string(j.t.gBqik6),()=>a3.A.setAudioSubsystem(e))},useOptions:function(){let{legacyAudioSubsystemSupported:e,experimentalAudioSubsystemSupported:t,automaticAudioSubsystemSupported:i}=(0,g.cf)([rM.Ay],()=>({legacyAudioSubsystemSupported:rM.Ay.supports(aQ.O5.LEGACY_AUDIO_SUBSYSTEM),experimentalAudioSubsystemSupported:rM.Ay.supports(aQ.O5.EXPERIMENTAL_AUDIO_SUBSYSTEM),automaticAudioSubsystemSupported:rM.Ay.supports(aQ.O5.AUTOMATIC_AUDIO_SUBSYSTEM)}));return S.useMemo(()=>{let n;return n=[{id:aQ.rB.STANDARD,value:aQ.rB.STANDARD,label:j.intl.string(j.t.dqb2JZ)}],e&&n.push({id:aQ.rB.LEGACY,value:aQ.rB.LEGACY,label:j.intl.string(j.t["TYfH+5"])}),t&&n.push({id:aQ.rB.EXPERIMENTAL,value:aQ.rB.EXPERIMENTAL,label:j.intl.string(j.t.liQmtr)}),i&&n.push({id:aQ.rB.AUTOMATIC,value:aQ.rB.AUTOMATIC,label:j.intl.string(j.t.qNgtO1)}),n},[i,t,e])},usePredicate:function(){return(0,g.bG)([rM.Ay],()=>rM.Ay.shouldOfferManualSubsystemSelection())}}),oG=(0,a.zD)(u.X.VOICE_QUALITY_OF_SERVICE_SETTING,{useTitle:()=>j.intl.string(j.t.uancuJ),useSubtitle:()=>j.intl.string(j.t.I1Eoqq),useValue:function(){return(0,g.bG)([rM.Ay],()=>rM.Ay.getQoS())},setValue:function(e){a3.A.setQoS(e)},usePredicate:function(){return(0,g.bG)([rM.Ay],()=>rM.Ay.supports(aQ.O5.QOS))}}),oM=(0,a.zD)(u.X.VOICE_SILENCE_WARNING_SETTING,{useTitle:()=>j.intl.string(j.t["4rsOPQ"]),useSubtitle:()=>j.intl.string(j.t.jtiiCw),useValue:function(){return(0,g.bG)([rM.Ay],()=>rM.Ay.getEnableSilenceWarning())},setValue:function(e){a3.A.setSilenceWarning(e)},usePredicate:function(){return eX.isPlatformEmbedded}}),oU=(0,a.bd)(u.X.INPUT_PROFILE_VOICE_ADVANCED_ACCORDION,{useTitle:function(e){return e?j.intl.string(j.t.KHsSWK):j.intl.string(j.t.PPDo5V)},useCollapsedSubtitle:()=>sN(u.X.INPUT_PROFILE_VOICE_ADVANCED_ACCORDION,{limit:(0,g.bG)([rM.Ay],()=>rM.Ay.isInputProfileCustom())?3:2}),buildLayout:()=>[oI,oD,oR,oM,oO,oL,oy,oP,oG]}),oV=(0,a.zD)(u.X.VOICE_ECHO_CANCELLATION_SETTING,{useTitle:()=>j.intl.string(j.t.iWTwu6),useValue:function(){return(0,g.bG)([rM.Ay],()=>rM.Ay.getEchoCancellation())},setValue:function(e){a3.A.setEchoCancellation(e,{page:U.liQ.USER_SETTINGS,section:U.JJy.SETTINGS_VOICE_AND_VIDEO})},useDisabled:function(){return(0,g.bG)([rM.Ay,oN.A],()=>{let e=rM.Ay.getInputDeviceId();return oN.A.hasEchoCancellation(e)})},usePredicate:function(){return(0,g.bG)([rM.Ay],()=>rM.Ay.isInputProfileCustom())}});var ok=i(459838),ow=i(451988),oF=i(934246),oB=i(300839);let oz=(0,sW.Ld)();function oY(e){let{isSpeaking:t,className:i,id:n,ariaDescribedBy:s,ariaLabelledBy:l,disabled:r}=e;return(0,E.jsx)("div",{role:"meter",className:e6()(oF.$I,i),id:n,"aria-describedby":s,"aria-labelledby":l,"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,E.jsx)("div",{className:e6()(oF.Jx,oF.NU,{[oF.zY]:t&&!r,[oF.r9]:r})})})}function oX(e){let{volume:t,id:i,ariaDescribedBy:n,ariaLabelledBy:s,disabled:l}=e,{threshold:r,autoThreshold:a}=(0,g.cf)([rM.Ay],()=>({threshold:rM.Ay.getModeOptions().threshold,autoThreshold:rM.Ay.getModeOptions().autoThreshold})),o=(0,g.bG)([rM.Ay],()=>rM.Ay.getMode());return(0,E.jsx)("section",{className:e6()(oF.Mo,oF.jW),id:i,"aria-describedby":n,"aria-labelledby":s,children:(0,E.jsx)(ng.A,{initialValue:r+100,onValueRender:e=>`${(-((100-e)*1)).toFixed(0)}dB`,onValueChange:e=>{var t;return t=-((100-e)*1),void a3.A.setMode(o,{threshold:t,autoThreshold:a})},barStyles:{background:er.A.unsafe_rawColors.GREEN_360.css},fillStyles:{background:er.A.unsafe_rawColors.YELLOW_300.css},"aria-labelledby":oz,disabled:l,children:(0,E.jsxs)("div",{className:e6()(oF.NU,oF.TL,oF.Jx,oB.bar),children:[(0,E.jsx)("div",{className:e6()(oF.GS,oF.SH),style:{width:l?0:t+100+"%"}}),(0,E.jsx)("div",{className:"grow"})]})})})}let oH=(0,a.E2)(u.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,g.bG)([rM.Ay],()=>rM.Ay.isInputProfileCustom()),Component:function(){let{autoThreshold:e,disabled:t}=(0,g.cf)([rM.Ay],()=>({autoThreshold:rM.Ay.getModeOptions().autoThreshold,disabled:rM.Ay.getMode()!==aQ.TB.VOICE_ACTIVITY})),i=S.useCallback(e=>{let t=rM.Ay.getMode(),{threshold:i}=rM.Ay.getModeOptions();a3.A.setMode(t,{autoThreshold:e,threshold:i})},[]),n=(0,g.bG)([rM.Ay],()=>rM.Ay.supports(aQ.O5.AUTOMATIC_VAD)),{volume:s,isSpeaking:l}=function(){let[e,t]=S.useState(-100),[i,n]=S.useState(!1);function s(e,i){t(e),n((i&aQ.ME.VOICE)===aQ.ME.VOICE)}return S.useEffect(()=>{let e=new ow.Ep;return e.start(1e3,()=>{rM.Ay.getMediaEngine().on(ok.bg.VoiceActivity,s),e.stop()}),()=>{rM.Ay.getMediaEngine().removeListener(ok.bg.VoiceActivity,s),e.stop()}},[]),{volume:e,isSpeaking:i}}(),r=(0,g.bG)([rM.Ay],()=>rM.Ay.isEnabled()),a=S.useMemo(()=>!r&&(0,E.jsx)("div",{className:oF.B4,children:(0,E.jsx)(q.w,{type:"warning",children:j.intl.format(j.t["O13I+O"],{onEnableClick:()=>a3.A.enable(!0)})})}),[r]),o=S.useMemo(()=>e?j.intl.string(j.t.JsbzjA):j.intl.string(j.t.MLmyMY),[e]),u=S.useId(),d=S.useId();return n?(0,E.jsxs)("fieldset",{"aria-describedby":d,children:[(0,E.jsx)(eo.A,{tag:"legend",id:u,children:j.intl.string(j.t.GByLar)}),(0,E.jsx)(eo.A,{id:d,children:o}),(0,E.jsxs)(Q.B,{direction:"vertical",gap:8,children:[(0,E.jsx)(J.d,{disabled:t,label:j.intl.string(j.t.lY6j47),description:o,checked:e,onChange:i}),e?(0,E.jsx)(oY,{isSpeaking:l,className:oF.UJ,ariaDescribedBy:d,ariaLabelledBy:u,disabled:t}):(0,E.jsx)(oX,{volume:s,ariaDescribedBy:d,ariaLabelledBy:u,disabled:t}),a]})]}):(0,E.jsxs)(Q.B,{direction:"vertical",gap:8,children:[(0,E.jsx)(s6.D,{label:j.intl.string(j.t["sqUm+k"]),description:o,layout:"vertical",children:i=>e?(0,E.jsx)(oY,{isSpeaking:l,className:oF.UJ,id:i.controlId,ariaDescribedBy:i.describedById,ariaLabelledBy:i.labelId,disabled:t}):(0,E.jsx)(oX,{volume:s,id:i.controlId,ariaDescribedBy:i.describedById,ariaLabelledBy:i.labelId,disabled:t})}),a]})}});var oK=i(366010);let oW=i(993830),oZ=i(413142),oq={page:U.liQ.USER_SETTINGS,section:U.JJy.SETTINGS_VOICE_AND_VIDEO};function oQ(){let e=(0,g.bG)([iv.A],()=>(0,oK.q)(iv.A.theme));return(0,E.jsx)("img",{src:e?oW:oZ,width:48,height:32,alt:""})}let oJ=(0,a.E2)(u.X.VOICE_NOISE_SUPPRESSION_SETTING,{useSearchTerms:()=>[j.intl.string(j.t.t8Qhib),j.intl.string(j.t.hmfkCi)],usePredicate:function(){return(0,g.bG)([rM.Ay],()=>rM.Ay.isInputProfileCustom()&&rM.Ay.isNoiseSuppressionSupported())},Component:function(){let e=S.useCallback(e=>{a3.A.setNoiseCancellation("KRISP"===e,oq),a3.A.setNoiseSuppression("STANDARD"===e,oq)},[]),{noiseCancellation:t,noiseSuppression:i,isNoiseSuppressionSupported:n,isNoiseCancellationSupported:s}=(0,g.cf)([rM.Ay],()=>({noiseCancellation:rM.Ay.getNoiseCancellation(),noiseSuppression:rM.Ay.getNoiseSuppression(),isNoiseSuppressionSupported:rM.Ay.isNoiseSuppressionSupported(),isNoiseCancellationSupported:rM.Ay.isNoiseCancellationSupported()})),l=S.useMemo(()=>{let e=[];return s&&e.push({id:"krisp",label:j.intl.string(j.t.rdoNzt),value:"KRISP"}),n&&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},[s,n]),r=s?j.intl.format(j.t["1q5aTp"],{helpArticle:tI.A.getArticleURL(U.MVz.NOISE_SUPPRESSION)}):j.intl.string(j.t.OWKjw5);return(0,E.jsxs)(Q.B,{direction:"vertical",gap:0,children:[(0,E.jsx)(rF.l,{label:j.intl.string(j.t.t8Qhib),description:r,layout:"horizontal",value:t?"KRISP":i?"STANDARD":"NONE",onSelectionChange:e,options:l,selectionMode:"single",fullWidth:!0}),s&&(0,E.jsx)(oQ,{})]})}});var o$=i(934729),o0=i(621380);let o1=!c.Av;function o2(){return(0,g.bG)([rM.Ay],()=>rM.Ay.getMode()===aQ.TB.PUSH_TO_TALK)}let o3=(0,a.zD)(u.X.VOICE_PUSH_TO_TALK_SETTING,{useTitle:function(){return c.Av?j.intl.string(j.t.tG4Np5):j.intl.string(j.t.JMyQin)},useSubtitle:function(){let e=(0,g.bG)([rM.Ay],()=>rM.Ay.getMode());return S.useMemo(()=>{if(!c.Av&&e===aQ.TB.PUSH_TO_TALK)return j.intl.format(j.t["VHI4+Y"],{onDownloadClick:()=>(0,o$._)("Help Text PTT")})},[e])},usePredicate:function(){return(0,g.bG)([rM.Ay],()=>rM.Ay.getActiveInputProfile()!==o0.m.STUDIO)},useValue:function(){return(0,g.bG)([rM.Ay],()=>rM.Ay.getMode()===aQ.TB.PUSH_TO_TALK)},setValue:function(e){var t,n;t=e?aQ.TB.PUSH_TO_TALK:aQ.TB.VOICE_ACTIVITY,n=[e1.A.USER_SETTINGS_VOICE_AND_VIDEO],t===aQ.TB.PUSH_TO_TALK&&o1&&(0,K.openModalLazy)(async()=>{let{default:e}=await Promise.all([i.e("74558"),i.e("10919")]).then(i.bind(i,556506));return t=>(0,E.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,o$._)("PTT Limited Modal"),body:j.intl.string(j.t.NIozvt),...t})}),a3.A.setMode(t,void 0,void 0,{analyticsLocations:n})},useSearchTerms:()=>[j.intl.string(j.t["pS+K2L"]),j.intl.string(j.t.nuFtHH)]});var o6=i(297932);let o5=(0,a.E2)(u.X.VOICE_PUSH_TO_TALK_KEYBIND_SETTING,{useSearchTerms:()=>[j.intl.string(j.t["pS+K2L"]),j.intl.string(j.t.nuFtHH)],usePredicate:o2,Component:function(){let e=(0,g.bG)([rM.Ay],()=>{let{shortcut:e}=rM.Ay.getModeOptions();return e}),t=j.intl.format(j.t.HVvn5T,{onClick:()=>(0,eH.openUserSettings)(u.X.SYSTEM_CUSTOM_KEYBINDS_CATEGORY)});return(0,E.jsx)(s6.D,{label:j.intl.string(j.t["o+BJQR"]),description:t,layout:"horizontal-responsive",children:(0,E.jsx)("div",{className:o6.e,children:(0,E.jsx)(tK.A,{defaultValue:e,onChange:e=>a3.A.setMode(U.TBI.PUSH_TO_TALK,{shortcut:e})})})})}}),o4=(0,a.sN)(u.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){a3.A.setMode(U.TBI.PUSH_TO_TALK,{delay:e})},minValue:0,maxValue:U.IjB,getInitialValue:function(){let{delay:e}=rM.Ay.getModeOptions();return e},onValueRender:function(e){return e>=1e3?(e/=1e3,`${e.toFixed(2)}s`):`${e.toFixed(0)}\u00A0ms`},usePredicate:o2});var o8=i(957658),o7=i(329139);let o9=(0,a.zD)(u.X.VOICE_SPATIAL_AUDIO_SETTING,{useTitle:()=>j.intl.string(o7.default.LGDPhA),useValue:function(){return(0,g.bG)([rM.Ay],()=>rM.Ay.isSpatialAudioEnabled())},setValue:function(e){a3.A.setSpatialAudio(e,[e1.A.USER_SETTINGS_VOICE_AND_VIDEO])},usePredicate:function(){return(0,o8.A)("VoiceSettings")}}),ue=(0,a.Qx)(u.X.VOICE_INPUT_PROFILE_SETTING,{useTitle:()=>j.intl.string(j.t.LM3U3k),usePredicate:function(){let{enabledInputProfiles:e}=(0,o_._)({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,g.bG)([rM.Ay],()=>rM.Ay.getActiveInputProfile()??o0.m.CUSTOM)},setValue:function(e){let t=[e1.A.USER_SETTINGS_VOICE_AND_VIDEO];a3.A.setActiveInputProfile(e,{analyticsLocations:t})},useOptions:function(){let{enabledInputProfiles:e}=(0,o_.d)({location:"InputProfileCategory"});return[{value:o0.m.VOICE_ISOLATION,name:j.intl.string(j.t.cjPbpT),desc:j.intl.string(j.t.CzhvnE)},{value:o0.m.STUDIO,name:j.intl.string(j.t.VZPR0R),desc:j.intl.string(j.t.ZaJksS)},{value:o0.m.CUSTOM,name:j.intl.string(j.t["N/PQjv"]),desc:j.intl.string(j.t.SnBmuY)}].filter(t=>{let{value:i}=t;return e.includes(i)})}}),ut=(0,a.zZ)(u.X.VOICE_INPUT_PROFILE_CATEGORY,{useInlineNotice:function(){let e=(0,g.bG)([oN.A,rM.Ay],()=>{let e=rM.Ay.getInputDeviceId();return(oN.A.hasEchoCancellation(e)||oN.A.hasNoiseSuppression(e)||oN.A.hasAutomaticGainControl(e))&&rM.Ay.isInputProfileCustom()});return S.useMemo(()=>{if(e)return{type:h.lT.INLINE_NOTICE,noticeType:"info",useText:()=>j.intl.string(j.t["/Whuzi"])}},[e])},buildLayout:()=>[ue,oH,oJ,oV,o9,o3,o5,o4,oU]});var ui=i(403581),un=i(983851),us=i(687021),ul=i(128450),ur=i(796774),ua=i(209932),uo=i(813564),uu=i(984813),ud=i(22231),uc=i(428262),ug=i(792348),um=i(674168),uA=i(333216),uh=i(805945),uE=i(199300);function uS(e){let{onSelect:t}=e,[i,n]=S.useState(!1),s=(0,g.bG)([id.default],()=>id.default.getCurrentUser()),l=uc.Ay.canUseCustomCallSounds(s),r=S.useRef(null);function a(e){l&&(n(!1),t?.(e))}return(0,E.jsx)(ee.Y,{targetElementRef:r,shouldShow:i,position:"left",onRequestClose:()=>n(!1),renderPopout:e=>{let{closePopout:t}=e;return(0,E.jsx)(iX.l,{children:(0,E.jsx)(uA.A,{suppressPlaySound:!0,shouldShowLockedSounds:!1,guildId:null,channel:null,onClose:t,onSelect:a,gridNotice:l?null:(0,E.jsx)(um.m,{}),analyticsSource:"call sounds edit setting"})})},children:e=>(0,E.jsx)(uh.dT,{...e,ref:r,onClick:()=>{n(!i)},text:j.intl.string(j.t.uOe0Az),children:(0,E.jsx)(ud.R,{size:"md",color:"currentColor",className:uE.Wo})})})}function uT(e){let{sound:t}=e,{previewSound:i}=(0,ug.A)(t,null),n=0===(0,uo.wH)()?j.intl.string(j.t.OASXjt):j.intl.formatToPlainString(j.t["/8fYO5"],{emojiName:t.emojiName,soundName:t.name});return(0,E.jsx)(uh.dT,{onClick:i,text:n,children:(0,E.jsx)(un.H,{size:"md",color:"currentColor",className:uE.wg})})}function ux(e){let{sound:t,isGlobal:i,onSelect:n}=e,s=null!=t,l=t?.emojiId,r=t?.emojiName,a=s&&(null!=r||null!=l);return(0,E.jsxs)("div",{className:uE.D6,children:[(0,E.jsxs)("div",{className:uE.kL,children:[a&&(0,E.jsx)(sG.A,{emojiId:l,emojiName:r,className:uE.Zg}),(0,E.jsx)(es.E,{variant:"text-md/normal",color:"text-strong",className:uE.dj,children:null==t?j.intl.string(j.t.PoWNfe):i?j.intl.format(j.t.B6HU6O,{soundName:t.name,subtextHook:function(e){return(0,E.jsx)(es.E,{variant:"text-xs/medium",color:"text-default",tag:"span",children:e})}}):t.name}),s?(0,E.jsx)(uT,{sound:t}):(0,E.jsx)(un.H,{size:"md",color:"currentColor",className:uE.Gk})]}),(0,E.jsxs)("div",{className:uE.kL,children:[(0,E.jsx)(uS,{onSelect:n}),s&&!i&&(0,E.jsx)(uh.dT,{onClick:()=>n(null),text:j.intl.string(j.t.jmtcGA),children:(0,E.jsx)(rz.u,{size:"md",color:er.A.unsafe_rawColors.RED_400.css,className:uE.Wo})})]})]})}var up=i(617617);i(980504);var uf=i(907895);function uN(e){return(0,g.bG)([ua.A],()=>{if(null==e)return null;let{guildId:t,soundId:i}=e;return ua.A.getSound("0"===t?"0":t,i)})}function u_(e){let{guildId:t}=e,i=(0,g.bG)([up.A],()=>up.A.settings.guilds?.guilds?.[t]?.joinSound),n=uN(i);if(null==i||null==n)return null;let{emojiId:s,emojiName:l}=n,r=null!=s||null!=l;return(0,E.jsxs)("div",{className:uf.Io,children:[r?(0,E.jsx)(sG.A,{emojiId:s,emojiName:l,className:uf.nW}):(0,E.jsx)(un.H,{size:"md",color:"currentColor",className:uf.nW}),(0,E.jsx)(es.E,{className:uf.dK,variant:"text-xs/medium",children:n.name})]})}let uI=(0,a.E2)(u.X.ENTRANCE_SOUNDS_SETTING,{useSearchTerms:()=>[j.intl.string(j.t.nzUc3B)],Component:function(){let{analyticsLocations:e}=(0,nQ.Ay)(),[t,i]=S.useState("0"),n=(0,uu.mz)(t),s=uN(n),l=n?.type===uu.PP.GLOBAL,r=(0,g.bG)([ua.A],()=>ua.A.hasFetchedAllSounds())&&null!=n&&null==s;S.useEffect(()=>{r&&(0,uo.ND)({location:e})},[r,e]),S.useEffect(()=>{(0,ur.E7)()},[]);let a=S.useCallback((e,t)=>{let{inDropdown:i}=t;return null==e?null:i?(0,E.jsx)(u_,{guildId:e.value}):null},[]);return(0,E.jsxs)(iC.n,{label:j.intl.string(j.t.nzUc3B),description:j.intl.format(j.t.u9RWmv,{helpdeskArticle:tI.A.getArticleURL(U.MVz.SOUNDBOARD)}),children:[(0,E.jsx)(us.A,{guildId:t,className:uf.Dt,globalOption:{label:j.intl.string(j.t["CpEUP/"]),value:"0"},onChange:e=>{i(null==e?"0":e.id)},renderOptionSuffix:a,hideDivider:!0}),(0,E.jsxs)(ul.A,{title:j.intl.format(j.t.I2TsYN,{nitroWheelHook:()=>(0,E.jsx)(ui.t,{size:"md",color:"currentColor",className:uf.ax})}),children:[(0,E.jsx)(ux,{sound:s,isGlobal:l,onSelect:i=>{null==i?(0,uo.Dv)(t,e):(0,uo.un)(t,i,e)}}),r&&(0,E.jsx)(t_.p,{className:uf.lm,messageType:t_.Y.WARNING,children:j.intl.string(j.t.WkPsFR)})]})]})}});var uC=i(824744);let ub=(0,a.sN)(u.X.SOUNDBOARD_VOLUME_SETTING,{useTitle:()=>j.intl.string(j.t.kbFsAD),useSubtitle:()=>j.intl.format(j.t.BPbGq7,{helpCenterArticle:tI.A.getArticleURL(U.MVz.SOUNDBOARD)}),setValue:function(e){let t=[e1.A.USER_SETTINGS_VOICE_AND_VIDEO],i=(0,uC.w)(e);(0,ur.iy)(i,t)},minValue:0,maxValue:100,getInitialValue:function(){let e=(0,uo.wH)();return(0,uC.M)(e)},onValueRender:function(e){return`${e.toFixed(0)}%`}});var uv=i(864145);let uy=(0,a.sN)(u.X.SOUNDMOJI_VOLUME_SETTING,{useTitle:()=>j.intl.string(j.t["2JbvKw"]),useSubtitle:()=>j.intl.string(j.t.INenzY),setValue:function(e){let t=(0,uC.w)(e);L.HO.updateSetting(t)},minValue:0,maxValue:100,getInitialValue:function(){let e=L.HO.getSetting();return(0,uC.M)(e)},onValueRender:function(e){return`${e.toFixed(0)}%`},usePredicate:function(){return(0,uv.X)({location:"SoundmojiVolumeSetting"})}}),uj=(0,a.zZ)(u.X.SOUNDBOARD_CATEGORY,{useTitle:()=>j.intl.string(j.t.ABjMWI),buildLayout:()=>[ub,uy,uI]});var uO=i(803224),uR=i(552122);let uL=(0,a.E2)(u.X.SOUNDS_HOLIDAY_NOTICE,{useSearchTerms:()=>[j.intl.string(j.t.fgSHf8)],usePredicate:()=>null!=uR.A.useHolidaySoundpack(),Component:()=>(0,E.jsx)(es.E,{variant:"text-md/normal",color:"text-subtle",children:j.intl.format(j.t.Eup6Wv,{onClick:()=>(0,eH.openUserSettings)(u.X.NOTIFICATIONS_SOUNDS_CATEGORY)})})}),uD=(0,a.AK)(u.X.VOICE_AND_VIDEO_TO_NOTIFICATION_SOUNDS_NAVIGATOR,{useSubtitle:()=>j.intl.string(j.t.eyGEE4),useSearchTerms:()=>[j.intl.string(j.t.eyGEE4)],destinationKey:u.X.NOTIFICATIONS_SOUNDS_CATEGORY}),uP=(0,a.gN)(u.X.VOICE_AND_VIDEO_SOUNDS_RELATED_SETTINGS,{buildLayout:()=>[uD]});var uG=i(264686);let uM=(0,nM.D)(()=>({currentPlayingSound:null}));function uU(){let e=uM.getField("currentPlayingSound");e?.stop(),uM.setState({currentPlayingSound:null})}function uV(e){let t=uM.getField("currentPlayingSound");t?.stop();let i=(0,l2.Ak)(e);uM.setState({currentPlayingSound:i})}function uk(e){return(0,a.zD)(`${u.X.SOUNDS_LIST_ITEM_PREFIX}${e.sound}`,{useTitle:e.useTitle,useSubtitle:()=>j.intl.format(j.t.OOiGCM,{onClick:()=>uV(e.sound)}),useSearchTerms:e.useSearchTerms,useValue:()=>{let t=(0,g.bG)([uO.A],()=>uO.A.isSoundDisabled(e.sound)),i=e.useDisabled?.();return!t&&!i},setValue:t=>{let i=uO.A.getDisabledSounds().filter(t=>t!==e.sound);t||i.push(e.sound),uG.default.setDisabledSounds(i)},useDisabled:()=>{let t=e.useDisabled?.(),i=(0,g.bG)([uO.A],()=>uO.A.getDisableAllSounds());return t||i},useDisabledMessage:e.useDisabledMessage})}let uw=[{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"}],uF=(0,a.D1)(u.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:()=>sN(u.X.VOICE_AND_VIDEO_SOUNDS_LIST,{limit:3}),initialize:function(){return()=>{uU()}},buildLayout:()=>uw.map(e=>uk(e))}),uB=(0,a.zZ)(u.X.SOUNDS_CATEGORY,{useTitle:()=>j.intl.string(j.t.MKWyKc),useInlineNotice:function(){let e=(0,g.bG)([uO.A],()=>uO.A.getDisableAllSounds());return S.useMemo(()=>{if(e)return{type:h.lT.INLINE_NOTICE,noticeType:"warning",useText:()=>j.intl.format(j.t.fRvixS,{onClick:()=>(0,eH.openUserSettings)(u.X.NOTIFICATIONS_SOUNDS_CATEGORY)})}},[e])},buildLayout:()=>[uF,uL,uP]}),uz=(0,a.zD)(u.X.STREAMING_SHOW_STREAM_PREVIEWS,{useTitle:()=>j.intl.string(j.t.e3Zz3F),useSubtitle:()=>j.intl.string(j.t.RztTjP),useValue:function(){return!L.uh.useSetting()},setValue:function(e){(0,oE.A)("stream_previews_disabled",!e,L.uh.getSetting(),[e1.A.USER_SETTINGS_VOICE_AND_VIDEO]),L.uh.updateSetting(!e)}}),uY=(0,a.zD)(u.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,g.bG)([rM.Ay],()=>rM.Ay.getVideoHook())},setValue:a3.A.setVideoHook,usePredicate:function(){return(0,g.bG)([rM.Ay],()=>rM.Ay.supportsVideoHook())}}),uX=(0,a.zD)(u.X.STREAMING_EXPERIMENTAL_SOUNDSHARE,{useTitle:()=>j.intl.string(j.t["4I0qzZ"]),useValue:function(){return(0,g.bG)([rM.Ay],()=>rM.Ay.getExperimentalSoundshare())},setValue:a3.A.setExperimentalSoundshare,usePredicate:function(){return(0,g.bG)([rM.Ay],()=>{let e=rM.Ay.supportsExperimentalSoundshare(),t=rM.Ay.supportsHookSoundshare();return e&&t})}}),uH=(0,a.zD)(u.X.STREAMING_STREAM_ATTENUATION,{useTitle:()=>j.intl.string(j.t["/jwMtn"]),useSubtitle:()=>j.intl.string(j.t.zlA23F),useValue:function(){return(0,g.bG)([rM.Ay],()=>rM.Ay.getSidechainCompression())},setValue:function(e){let t=[e1.A.USER_SETTINGS_VOICE_AND_VIDEO];a3.A.setSidechainCompression(e,{analyticsLocations:t})},usePredicate:function(){return rM.Ay.supports(aQ.O5.SIDECHAIN_COMPRESSION)}}),uK=(0,a.sN)(u.X.STREAMING_STREAM_ATTENUATION_STRENGTH,{useTitle:()=>j.intl.string(j.t.fhEzfj),setValue:function(e){let t=[e1.A.USER_SETTINGS_VOICE_AND_VIDEO];a3.A.setSidechainCompressionStrength(e,{analyticsLocations:t})},minValue:1,maxValue:100,getInitialValue:rM.Ay.getSidechainCompressionStrength,usePredicate:function(){let e=(0,g.bG)([rM.Ay],()=>rM.Ay.getSidechainCompression());return rM.Ay.supports(aQ.O5.SIDECHAIN_COMPRESSION)&&e}}),uW=(0,a.zD)(u.X.STREAMING_OS_MENU_SCREEN_CAPTURE,{useTitle:()=>j.intl.string(j.t.lt8rRx),useSubtitle:()=>j.intl.string(j.t.ie1mgY),useValue:function(){return(0,g.bG)([rM.Ay],()=>rM.Ay.getUseSystemScreensharePicker())},setValue:function(e){(0,c.cX)()&&e?(0,lJ.A)({title:j.intl.string(j.t["9jf31O"]),subtitle:j.intl.string(j.t.uBd6JW),variant:"primary",onConfirm:()=>{a3.A.setUseSystemScreensharePicker(e),lf.A.app.relaunch()},confirmText:j.intl.string(j.t.BddRzS)}):a3.A.setUseSystemScreensharePicker(e)},usePredicate:function(){return(0,g.bG)([rM.Ay],()=>rM.Ay.supportsSystemScreensharePicker()&&(0,c.cX)())}}),uZ=(0,a.bd)(u.X.STREAMING_ADVANCED_ACCORDION,{useTitle:e=>e?j.intl.string(j.t.qrMyvm):j.intl.string(j.t.LEtTNl),useCollapsedSubtitle:()=>sN(u.X.STREAMING_ADVANCED_ACCORDION),buildLayout:()=>[uH,uK,uW,uX,uY]}),uq=(0,a.zZ)(u.X.STREAMING_CATEGORY,{useTitle:()=>j.intl.string(j.t.KDdjou),buildLayout:()=>[uz,uZ]});var uQ=i(106713);let uJ=(0,a.E2)(u.X.VOICE_MICROPHONE_INPUT_SELECT,{useSearchTerms:()=>[],Component:function(){let{showDeviceFormFactorIndicators:e}=uQ.A.useConfig({location:"MicrophoneInputSelect"});return(0,E.jsx)(aK.U,{label:j.intl.string(j.t.UTM8VP),deviceType:aQ.oh.AUDIO_INPUT,location:"UserSettingsVoiceVideo",hideDeviceTypeIcon:!e})}}),u$=(0,a.E2)(u.X.VOICE_SPEAKER_OUTPUT_SELECT,{useSearchTerms:()=>[],Component:function(){let{showDeviceFormFactorIndicators:e}=uQ.A.useConfig({location:"SpeakerOutputSelect"});return(0,E.jsx)(aK.U,{label:j.intl.string(j.t.xuYQ0n),deviceType:aQ.oh.AUDIO_OUTPUT,location:"UserSettingsDevices",hideDeviceTypeIcon:!e})}}),u0=(0,a.zC)(u.X.VOICE_INPUT_OUTPUT_DEVICE_SPLIT,{buildLayout:()=>[uJ,u$]}),u1=(0,a.sN)(u.X.VOICE_INPUT_VOLUME_SETTING,{useTitle:()=>j.intl.string(j.t.Rtsr6w),minValue:0,maxValue:100,getInitialValue:function(){let e=rM.Ay.getInputVolume();return(0,uC.M)(e)},asValueChanges:function(e){let t=[e1.A.USER_SETTINGS_VOICE_AND_VIDEO],i=(0,uC.w)(e);a3.A.setInputVolume(i,{analyticsLocations:t})}}),u2=(0,a.sN)(u.X.VOICE_OUTPUT_VOLUME_SETTING,{useTitle:()=>j.intl.string(j.t.aUJ062),minValue:0,maxValue:200,getInitialValue:function(){let e=rM.Ay.getOutputVolume();return(0,uC.M)(e)},onValueRender:function(e){return`${e.toFixed(0)}%`},asValueChanges:function(e){let t=[e1.A.USER_SETTINGS_VOICE_AND_VIDEO],i=(0,uC.w)(e);a3.A.setOutputVolume(i,{analyticsLocations:t})}}),u3=(0,a.zC)(u.X.VOICE_INPUT_OUTPUT_VOLUME_SPLIT,{buildLayout:()=>[u1,u2]});var u6=i(702841),u5=i(349288),u4=i(152567),u8=i(141218);let u7=`${tI.A.getArticleURL(U.MVz.VOICE_VIDEO_TROUBLESHOOTING)}?utm_source=discord&utm_medium=blog&utm_campaign=2020-06_help-voice-video&utm_content=--t%3Apm`,u9=(0,a.E2)(u.X.VOICE_MICROPHONE_TEST_SETTING,{useSearchTerms:()=>[j.intl.string(j.t.nuFtHH)],usePredicate:function(){return(0,u6.bG)([rM.Ay],()=>rM.Ay.supports(aQ.O5.LOOPBACK))},Component:function(){return(0,u6.bG)([rM.Ay],()=>rM.Ay.supports(aQ.O5.LOOPBACK))?(0,E.jsx)(u4.A,{size:"md",notchBackground:u4.V.GRAY,captionVoice:j.intl.string(j.t.bp3JOV),captionNoVoice:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(es.E,{variant:"text-xs/semibold",color:"text-default",children:j.intl.string(j.t.bgn75v)}),j.intl.string(j.t["MA+OZh"]),(0,E.jsx)(u5.Anchor,{className:u8.X,href:tI.A.getArticleURL(U.MVz.NO_INPUT_DETECTED),children:j.intl.string(j.t.RYKKox)})]}),helpText:j.intl.format(j.t["V+B3FH"],{guideURL:u7}),buttonTest:j.intl.string(j.t.gyljWE),buttonStop:j.intl.string(j.t.I6OnJ3),buttonVariant:"primary",location:{page:U.liQ.USER_SETTINGS,section:U.JJy.SETTINGS_VOICE_AND_VIDEO}}):null}}),de=eX.isWindows()?["BTHENUM","BTHHFENUM"]:[];function dt(e){let{inputAndOutputAreBluetooth:t,canPromptSystemServiceInstallForVoice:i}=e;return(0,E.jsxs)(Q.B,{children:[i&&(0,E.jsx)(rw,{sourcePage:"voice"}),t&&(0,E.jsx)(aS.A,{look:aS.k.WARNING,children:j.intl.string(j.t.Ioz3gx)})]})}let di=(0,a.zZ)(u.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=rk("voice"),t=(0,aW.x5)(aQ.oh.AUDIO_INPUT),i=(0,aW.x5)(aQ.oh.AUDIO_OUTPUT),n=S.useMemo(()=>{let e=de.some(e=>t?.hardwareId?.startsWith(e)),n=de.some(e=>i?.hardwareId?.startsWith(e));return e&&n&&t?.containerId!=null&&t.containerId===i?.containerId},[t,i]);return S.useMemo(()=>e.canPrompt||n?{type:h.lT.STRONGLY_DISCOURAGED_CUSTOM,notice:()=>(0,E.jsx)(dt,{inputAndOutputAreBluetooth:n,canPromptSystemServiceInstallForVoice:e.canPrompt})}:null,[e.canPrompt,n])},buildLayout:()=>[u0,u3,u9]}),dn=(0,a.t_)(u.X.VOICE_AND_VIDEO_PANEL,{useTitle:()=>j.intl.string(j.t.B1fFpf),buildLayout:()=>[di,ut,a2,uq,uB,uj,of]}),ds=(0,a.i4)(u.X.VOICE_AND_VIDEO_SIDEBAR_ITEM,{useTitle:()=>j.intl.string(j.t.B1fFpf),usePredicate:()=>rM.Ay.isSupported(),icon:aU.c,useMenu:aV.A,buildLayout:()=>[dn]}),dl=(0,a.WI)(u.X.APP_SECTION,{useTitle:()=>j.intl.string(j.t.gcyH1J),buildLayout:()=>[ds,lH,sr,rL,aM,lq]});var dr=i(360669),da=i(974544),du=i(423764),dd=i(289873),dc=i(132500),dg=i(465323),dm=i(37766),dA=i(194261),dh=i(391048),dE=i(277984),dS=i(99696),dT=i(202613),dx=i(615405),dp=i(580630),df=i(83617),dN=i(935208),d_=i(607399),dI=i(150934),dC=i(256006),db=i(198970),dv=i(71532);let dy=/[^0-9/]/g,dj=/[^0-9]/g;class dO extends S.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 i,n,s,l,{value:r,onChange:a}=this.props,o=this._inputRef;if(e===r||null==o||null==r)return;let u=(n=(i=e.replace(dy,"").split("/"))[0],s=i[1],l=[],parseInt(n,10)>12&&(n=n.substring(0,1)),l.push(n),(parseInt(n,10)>1||2===n.length||null!=s&&""!==s)&&l.push("/"),null!=s&&""!==s&&parseInt(s,10)>99&&(s=(s+"").substring(0,2)),l.push(s),l.join("")),d=o.selectionStart;u===r&&u.length<=3&&r.includes("/")&&!e.includes("/")?u=u.replace(dj,""):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,E.jsx)(rH.k,{...this.props,inputMode:"numeric",onChange:this.handleChange,inputRef:this.setRef})}}var dR=i(832208),dL=i(729919);let dD=[{fields:[{expirationDate:{name:"expirationDate",id:(0,sW.Ld)(),title:()=>j.intl.string(j.t["CeBa/4"]),autoComplete:"cc-exp",placeholder:()=>j.intl.string(j.t.xeEWQ6),pattern:"\\d*",getClassNameForLayout:()=>dL.ep,renderInput:e=>(0,E.jsx)(dO,{...e})}}.expirationDate]}],dP=function(e){let{onCardInfoChange:t,className:i,expirationDate:n,error:s}=e,[l,r]=S.useState(!1),[a,o]=S.useState(null),[u,d]=S.useState(n);return S.useEffect(()=>{t({expirationDate:u},null===a)},[u,t,a]),(0,E.jsx)(dR.A,{className:i,form:dD,values:{expirationDate:u},errors:null!=a?{expirationDate:a}:{},formError:s,onFieldChange:function(e){l||""===e||r(!0),l&&""===e||!(0,dv.So)(e)?o(j.intl.string(j.t["9/zZdl"])):o(null),d(e)}})};var dG=i(219887),dM=i(520229);let dU="isDefault";class dV extends S.PureComponent{static defaultProps={onDelete:()=>{},onSubmit:()=>{},onCancel:()=>{}};constructor(e){super(e);const{paymentSource:t,isDefault:i}=e,n=t.billingAddress;this.state={billingAddress:{name:n.name??"",line1:n.line1??"",line2:n.line2??"",country:n.country??"",state:n.state??"",city:n.city??"",postalCode:n.postalCode??""},expiresMonth:t instanceof dT.YS?t.expiresMonth:void 0,expiresYear:t instanceof dT.YS?t.expiresYear:void 0,billingAddressValid:!1,isDefault:i,expirationValid:!0,dirtyFields:{}}}componentWillUnmount(){su.h.wait(()=>{(0,dE.ey)(),(0,dE.tc)()})}handleSubmit=e=>{if(e.preventDefault(),e.stopPropagation(),0===Object.values(this.state.dirtyFields).filter(N.Vq).length)this.props.onCancel();else{let{billingAddress:e,isDefault:t,expiresMonth:i,expiresYear:n}=this.state;this.props.onSubmit(this.props.paymentSource.id,{billingAddress:e,expiresMonth:i,expiresYear:n,isDefault:t})}};handleCancel=()=>{this.props.onCancel()};handleDelete=()=>{let{onDelete:e,paymentSource:t}=this.props;e(t.id)};handleAddressUpdate=(e,t,i)=>{this.setState({billingAddress:e,billingAddressValid:t,dirtyFields:{...this.state.dirtyFields,billingAddress:i}})};handleExpirationDateUpdate=(e,t)=>{let{expirationDate:i}=e;if(this.setState({expirationValid:t}),null==i||""===i)return;let[n,s]=i.split("/");this.handleFieldChange(Number(n),"expiresMonth"),this.handleFieldChange(Number(`${new Date().getFullYear().toString().slice(0,2)}${s}`),"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,E.jsx)("div",{className:dM.zc,children:(0,E.jsx)(q.w,{type:"critical",children:t.message})}):null:(0,E.jsx)("div",{className:dM.zc,children:(0,E.jsx)(q.w,{type:"critical",children:e.message})})}renderBillingAddressSection(){let{billingAddress:e}=this.state,{updateError:t,paymentSource:i}=this.props,n=(0,dC.g)(i);return(0,E.jsxs)("div",{className:dM.yV,children:[(0,E.jsx)(es.E,{className:dM.bV,variant:"text-sm/normal",children:j.intl.string(j.t["50Auo2"])}),(0,E.jsx)(db.Ay,{...e,mode:db.Ay.Modes.EDIT,layout:n,onBillingAddressChange:this.handleAddressUpdate,error:t})]})}renderCardExpirationSection(){let{expiresMonth:e,expiresYear:t}=this.state;if(null==e||null==t)return null;let i=`${e.toString().padStart(2,"0")}/${t.toString().padStart(2,"0").slice(-2)}`;return(0,E.jsxs)("div",{className:dM.yV,children:[(0,E.jsx)(es.E,{className:dM.bV,variant:"text-sm/normal",children:j.intl.string(j.t.Fo2YP7)}),(0,E.jsx)(dP,{expirationDate:i,onCardInfoChange:this.handleExpirationDateUpdate,error:this.props.updateError})]})}renderActions(){let{submitting:e,removing:t,isForSubscription:i}=this.props,{billingAddressValid:n,expirationValid:s}=this.state;return(0,E.jsx)("div",{className:dM.AU,children:(0,E.jsxs)(Q.B,{direction:"horizontal",justify:"space-between",children:[(0,E.jsx)(a9.e,{children:(0,E.jsxs)("div",{className:dM.lH,children:[i?(0,E.jsx)(tr.m,{text:j.intl.string(j.t["v6/z28"]),children:(0,E.jsx)("div",{"aria-hidden":!0,className:dM.dm})}):null,(0,E.jsx)(eG.$,{type:"button",disabled:i||e,loading:t,onClick:this.handleDelete,variant:"critical-secondary",size:d_.Fr?"sm":"md",text:d_.Fr?j.intl.string(j.t.oyYWHE):j.intl.string(j.t.yk5qfb)})]})}),(0,E.jsxs)(a9.e,{children:[(0,E.jsx)(eG.$,{type:"button",disabled:e||t,onClick:this.handleCancel,variant:"secondary",size:d_.Fr?"sm":"md",text:j.intl.string(j.t["ETE/oC"])}),(0,E.jsx)(eG.$,{loading:e,disabled:!n||t||!s,type:"submit",variant:"active",size:d_.Fr?"sm":"md",text:j.intl.string(j.t["R3BPH+"])})]})]})})}render(){let{paymentSource:e,isDefault:t,locale:i,className:n,isForSubscription:s}=this.props,{isDefault:l}=this.state,r=e instanceof dT.SJ;return(0,E.jsx)(eb.Z,{editable:!0,className:e6()(dM.Nr,n),children:(0,E.jsxs)("form",{onSubmit:this.handleSubmit,noValidate:!0,children:[this.renderError(),(0,E.jsxs)("div",{className:dM.__invalid_paymentSection,children:[(0,E.jsx)(dG.A,{paymentSource:e,isDefault:t,isForSubscription:s,locale:i,showLabels:!0,showPaymentSourceIcon:!0}),e.invalid?(0,E.jsx)("div",{className:dM.Um,children:j.intl.string(j.t["3R0U0b"])}):null,(0,E.jsx)("div",{className:dM.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,E.jsx)("div",{className:dM.D5,children:(0,E.jsx)(dI.S,{value:dU,checked:l,onChange:e=>this.handleFieldChange(e,dU),label:j.intl.string(j.t.nag9Og),labelType:"secondary"})}),(0,E.jsx)(eM.c,{}),this.renderActions()]})})}}let dk=g.Ay.connectStores([dx.A],()=>({updateError:dx.A.editSourceError,removeError:dx.A.removeSourceError}))(dV);var dw=i(776409),dF=i(743526),dB=i(455218);function dz(){(0,dS.HF)({withRedemptionSuccessModal:!0,source:"desktop_billing_page",loadId:(0,dc.A)()})}class dY extends S.PureComponent{static defaultProps={isEditing:!1,hideDivider:!1,onEditClick:()=>{}};handleEditClick=()=>{this.props.onEditClick(this.props.paymentSource.id)};render(){let{paymentSource:e,isDefault:t,isEditing:i,hideDivider:n,isForSubscription:s,locale:l,removing:r,submitting:a,onSubmit:o,onCancel:u,onDelete:d}=this.props;return i?(0,E.jsx)(dk,{paymentSource:e,isDefault:t,removing:r,submitting:a,locale:l,isForSubscription:s,onSubmit:o,onCancel:u,onDelete:d}):(0,E.jsxs)(E.Fragment,{children:[n?null:(0,E.jsx)(eM.c,{className:dB.__invalid_sourceDivider}),(0,E.jsxs)("div",{className:dB.Yb,children:[(0,E.jsx)(dG.A,{paymentSource:e,isDefault:t,isForSubscription:s,locale:l,showSubtext:!0,showLabels:!0,showPaymentSourceIcon:!0}),(0,E.jsx)(eG.$,{variant:"secondary",onClick:this.handleEditClick,size:"sm",text:j.intl.string(j.t.bt75uw)})]})]})}}let dX=S.memo(function(e){let{paymentSource:t,hideDivider:i,isForSubscription:n,locale:s,onRedeemClick:l}=e,[r,a]=S.useState(null),o=(0,g.bG)([id.default],()=>id.default.getCurrentUser()?.storeCountry?.country??null),u=(0,g.bG)([dx.A],()=>dx.A.ipCountryCode),d=S.useMemo(()=>(0,dg.TW)(`-${o??u??"US"}`),[o,u]);return S.useEffect(()=>{void 0===t?a({amount:0,currency:d}):dE.YP(t.id).then(e=>{a(e)})},[t,d]),(0,E.jsxs)(E.Fragment,{children:[i?null:(0,E.jsx)(eM.c,{className:dB.__invalid_sourceDivider}),(0,E.jsxs)("div",{className:dB.Yb,children:[void 0!==t?(0,E.jsx)(dG.A,{paymentSource:t,isDefault:!1,isForSubscription:n,locale:s,showSubtext:!1,showLabels:!1,showPaymentSourceIcon:!0}):(0,E.jsxs)(rq.A,{align:rq.A.Align.CENTER,children:[(0,E.jsx)(dm._,{size:"lg"}),(0,E.jsx)(es.E,{variant:"text-sm/medium",className:dF.Wi,children:j.intl.string(dw.default["/FQWfA"])})]}),(0,E.jsxs)("div",{className:dB.zy,children:[(0,E.jsx)("div",{className:dB.Tq,children:null==r?(0,E.jsx)(dd.y,{type:dd.y.Type.SPINNING_CIRCLE}):(0,E.jsx)(es.E,{variant:"text-sm/medium",children:function(){let{amount:e,currency:t}=r??{},i=t??d,n=String(i).toUpperCase(),s=(0,dp.$g)(e??0,i,{currencyDisplay:"narrowSymbol"});return`${n} ${s}`}()})}),(0,E.jsx)(eG.$,{variant:"secondary",onClick:l,size:"sm",text:j.intl.string(dw.default.hnRau6)})]})]})]})});class dH extends S.PureComponent{state={editingPayment:null};handleEditClick=async e=>{try{await dE.Gr(e),this.setState({editingPayment:e})}catch(e){}};handleCancel=()=>{this.setState({editingPayment:null})};handleDelete=async e=>{try{await dE.JQ(e),this.setState({editingPayment:null})}catch(e){}};handleSubmit=async(e,t)=>{if(null!=e)try{await dE.Ps(e,t),this.setState({editingPayment:null})}catch(e){}};handlePaymentSourceAdded=async e=>{await (0,df.c_)(e.id)};handleAddPaymentMethod=()=>{(0,K.openModalLazy)(async()=>{let{default:e}=await Promise.resolve().then(i.bind(i,362111));return t=>(0,E.jsx)(e,{...t,onAddPaymentSource:this.handlePaymentSourceAdded})},{onCloseCallback:()=>{(0,dh.ET)()}})};renderFooter(){let{paymentSources:e}=this.props;return(0,E.jsxs)("div",{className:dB.qr,children:[0===Object.keys(e).length?(0,E.jsxs)("div",{className:dB.z8,children:[(0,E.jsx)(es.E,{variant:"text-sm/normal",children:j.intl.string(j.t.aRHpAB)}),(0,E.jsx)(es.E,{variant:"text-sm/normal",color:"text-subtle",className:dB.Sv,children:j.intl.string(j.t.o9bOIl)})]}):null,(0,E.jsx)(eG.$,{onClick:this.handleAddPaymentMethod,text:j.intl.string(j.t.CpOiEO)})]})}render(){let e,{showHeader:t,defaultPaymentSourceId:i,paymentSources:n,locale:s,removing:l,submitting:r,premiumSubscriptionPaymentSourceId:a,showGiftCards:o}=this.props,u=eZ().values(n).sort((e,t)=>e.id===i?-1:t.id===i?1:dN.default.compare(e.id,t.id)),d=u.filter(e=>!(e instanceof dT.LQ)),c=u.filter(e=>e instanceof dT.LQ),g=this.state.editingPayment,m=d.findIndex(e=>e.id===g),A=d.map((e,t)=>(0,E.jsx)(dY,{locale:s,paymentSource:e,isDefault:i===e.id,onCancel:this.handleCancel,onDelete:this.handleDelete,isForSubscription:e.id===a,hideDivider:0===t||m===t-1,onSubmit:this.handleSubmit,submitting:r,removing:l,isEditing:g===e.id,onEditClick:this.handleEditClick},e.id));return e=c.length>0?c.map((e,t)=>(0,E.jsx)(dX,{paymentSource:e,hideDivider:0===d.length||m===d.length-1,isForSubscription:e.id===a,locale:s,onRedeemClick:dz},e.id)):(0,E.jsx)(dX,{hideDivider:0===d.length||m===d.length-1,isForSubscription:!1,locale:s,onRedeemClick:dz}),(0,E.jsxs)(E.Fragment,{children:[t?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(eP.D,{variant:"heading-lg/semibold",children:[(0,E.jsx)(dA.X,{size:"sm",className:dB.hz})," ",j.intl.string(j.t.W26xGQ)]}),(0,E.jsx)(es.E,{variant:"text-sm/normal",color:"text-subtle",children:j.intl.string(j.t.h6V3uK)})]}):null,A,o&&e,m!==d.length-1||o&&c.length>0?(0,E.jsx)(eM.c,{}):null,this.renderFooter()]})}}var dK=i(459357),dW=i(295405),dZ=i(166403),dq=i(773669),dQ=i(844828);function dJ(){let e=(0,g.bG)([id.default],()=>id.default.getCurrentUser()?.storeCountry);return e?.country==null?null:{country:e.country,countryName:(0,du.Gw)(e.country)}}let d$=(0,a.E2)(u.X.BILLING_PAYMENT_METHODS,{Component:function(e){let{showHeader:t=!1}=e,i=(0,g.bG)([dx.A],()=>dx.A.isSyncing),n=(0,g.bG)([dW.A],()=>dW.A.paymentSources),s=(0,g.bG)([dW.A],()=>dW.A.defaultPaymentSourceId),l=(0,g.bG)([dq.default],()=>dq.default.locale),r=(0,g.bG)([dZ.A],()=>dZ.A.getPremiumTypeSubscription()),a=(0,g.bG)([dx.A],()=>dx.A.isRemovingPaymentSource),o=(0,g.bG)([dx.A],()=>dx.A.isUpdatingPaymentSource),{enabled:u}=(0,dK.c)({location:"UserSettingsBilling"});return(S.useEffect(()=>{dE.$o(),dE.hP()},[]),i&&0===Object.keys(n).length)?(0,E.jsx)("div",{className:dQ.o,children:(0,E.jsx)(dd.y,{})}):(0,E.jsx)(dH,{showHeader:t,paymentSources:n,defaultPaymentSourceId:s,premiumSubscriptionPaymentSourceId:null!=r&&r.status!==U.Dmq.CANCELED?r.paymentSourceId:null,locale:l,removing:a,submitting:o,showGiftCards:u})},useSearchTerms:()=>[j.intl.string(j.t.W26xGQ),j.intl.string(j.t["3pIjBH"])]}),d0=(0,a.zZ)(u.X.BILLING_PAYMENT_METHODS_CATEGORY,{useTitle:()=>j.intl.string(j.t.W26xGQ),useSubtitle:()=>{let e=dJ();return null!=e?j.intl.format(j.t.e2t1G5,{country:e.countryName}):j.intl.string(j.t.h6V3uK)},useSubtitleDecoration:function(){return null==dJ()?null:{type:h.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:()=>[d$]});var d1=i(549363),d2=i(545075);let d3=(0,a.E2)(u.X.BILLING_TRANSACTION_HISTORY,{Component:function(){let e=(0,g.bG)([dq.default],()=>dq.default.locale);return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(d2.kb,{}),(0,E.jsx)(d1.A,{locale:e})]})},useSearchTerms:()=>[j.intl.string(j.t.obLrcK)]}),d6=(0,a.zZ)(u.X.BILLING_TRANSACTION_HISTORY_CATEGORY,{useTitle:()=>j.intl.string(j.t.obLrcK),buildLayout:()=>[d3]}),d5=(0,a.t_)(u.X.BILLING_PANEL,{useTitle:()=>j.intl.string(j.t.oeUm2s),buildLayout:()=>[d0,d6],useObscuredNotice:da.L}),d4=(0,a.i4)(u.X.BILLING_SIDEBAR_ITEM,{useTitle:()=>j.intl.string(j.t.oeUm2s),icon:dr.B,buildLayout:()=>[d5]});var d8=i(70283),d7=i(597770),d9=i(682618),ce=i(611881),ct=i(962644),ci=i(35587),cn=i(86379);let cs=(0,a.E2)(u.X.GIFT_BLOCKED_PAYMENTS_SETTING,{Component:d2.uK,usePredicate:()=>(0,cn.Hp)(),useSearchTerms:()=>[j.intl.string(j.t.vwMEHS)]}),cl=(0,a.zZ)(u.X.GIFT_BLOCKED_PAYMENTS_CATEGORY,{buildLayout:()=>[cs]});var cr=i(982240),ca=i(788833),co=i(914410),cu=i(360615),cd=i(215082);function cc(e){let{tier:t,active:i=!1}=e;return(0,E.jsxs)("div",{className:e6()(cd.fO,{[cd.bF]:i}),children:[null!=t.simple_icon_url&&(0,E.jsx)("img",{src:t.simple_icon_url,alt:"",className:cd.si}),(0,E.jsxs)("div",{className:cd.tc,children:[(0,E.jsx)(es.E,{variant:"text-sm/semibold",color:"text-subtle",children:t.name??""}),(0,E.jsx)(es.E,{variant:"text-xs/normal",color:"text-muted",children:j.intl.format(cu.default.qvx9E4,{count:(0,cr.rL)(t)})})]})]})}function cg(e){let{tiers:t,currentTier:i}=e;return(0,E.jsx)("div",{className:cd.dw,children:t.map(e=>(0,E.jsx)(cc,{tier:e,active:e.key===i?.key},e.key))})}function cm(e){let{analyticsLocation:t,location:i}=e,{analyticsLocations:n}=(0,nQ.Ay)(e1.A.USER_SETTINGS_GIFT_INVENTORY),{openGiftModal:s}=(0,ca.$)({giftRecipient:void 0,analyticsLocations:n,analyticsObject:{object:U.ZSU.BUTTON_CTA,objectType:U.AnalyticsObjectTypes.GIFT},analyticsLocation:t,location:i});return(0,E.jsx)("div",{className:cd.NG,children:(0,E.jsx)(eG.$,{variant:"primary",icon:d7.o,text:j.intl.string(cu.default.DZnomS),onClick:s})})}function cA(e){let t,{badgeProgress:i,currentTier:n,nextTier:s,giftsRemaining:l}=e,r=(0,cr.rL)(n),a=(0,cr.rL)(s),o=(0,ce.GZ)(i,n,s);return t=null!=s?j.intl.formatToPlainString(cu.default.XTX3OO,{count:l,nextTier:s?.name??""}):j.intl.formatToPlainString(cu.default.LnsdbK,{currentTier:n?.name??""}),(0,E.jsxs)("div",{className:cd.mY,children:[n?.simple_icon_url!=null&&(0,E.jsx)("div",{className:cd.fC,children:(0,E.jsx)("img",{src:n.simple_icon_url,alt:"",className:cd.qS})}),(0,E.jsxs)("div",{className:cd.Qs,children:[(0,E.jsx)(es.E,{variant:"text-md/medium",color:"text-strong",children:t}),(0,E.jsx)(co.Ay,{variant:co.qP.BLUE,weight:co.fh.MEDIUM,progress:o}),(0,E.jsx)(es.E,{variant:"text-xs/normal",color:"text-muted",className:cd.qg,children:j.intl.format(cu.default.iIpfQe,{threshold:null!=s?a:r,count:null!=s?i:r})})]}),s?.simple_icon_url!=null&&(0,E.jsx)("div",{className:cd.fC,children:(0,E.jsx)("img",{src:s.simple_icon_url,alt:"",className:cd.qS})})]})}function ch(e){let{analyticsLocation:t}=e,{badgeProgress:i,currentTier:n,nextTier:s,giftsRemaining:l,tiers:r}=(0,g.cf)([cr.Ay],()=>({badgeProgress:cr.Ay.getSingleRequirementProgress(d8.$.GIFTING)?.current??0,currentTier:cr.Ay.getCurrentTier(d8.$.GIFTING),nextTier:cr.Ay.getNextTier(d8.$.GIFTING),giftsRemaining:cr.Ay.getRemainingToNextTier(d8.$.GIFTING),tiers:cr.Ay.getBadgeById(d8.$.GIFTING)?.tiers??[]}));return 0===r.length?null:(0,E.jsxs)("div",{className:cd.kL,children:[(0,E.jsxs)("div",{className:cd.Jo,children:[i>0&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(cA,{badgeProgress:i,currentTier:n,nextTier:s,giftsRemaining:l}),(0,E.jsx)("div",{className:cd.yF})]}),(0,E.jsx)(cg,{tiers:r,currentTier:n}),(0,E.jsx)(es.E,{variant:"text-xs/normal",color:"text-muted",className:cd.PJ,children:j.intl.string(cu.default["4Yp0mI"])})]}),(0,E.jsx)(cm,{analyticsLocation:t,location:"UserSettingsGiftingBadgeProgress"})]})}let cE=(0,a.zZ)(u.X.GIFTING_BADGE_CATEGORY,{useTitle:()=>j.intl.string(cu.default.sFokBp),buildLayout:()=>[cS],usePredicate:()=>{let e=(0,ce.F5)("gift_inventory"),t=(0,g.bG)([cr.Ay],()=>cr.Ay.getBadgeById(d8.$.GIFTING));return e&&null!=t}}),cS=(0,a.E2)(u.X.GIFTING_BADGE_CONTENT,{useSearchTerms:()=>[j.intl.string(cu.default.sFokBp)],Component:()=>(0,E.jsx)(ch,{})});var cT=i(264779),cx=i(412260),cp=i(3074),cf=i(725807),cN=i(212168),c_=i(469778),cI=i(45938),cC=i(109802),cb=i(869038),cv=i(221347);function cy(e){let{children:t,className:i,splashArtURL:n}=e;return(0,E.jsxs)(rq.A,{className:e6()(cv.wx,i),align:rq.A.Align.CENTER,children:[(0,E.jsx)("div",{className:cv.Bn,style:null!=n?{backgroundImage:`url(${n})`}:void 0}),t]})}function cj(e){let{children:t,className:i}=e;return(0,E.jsx)("div",{className:e6()(cv.rf,i),children:t})}class cO extends S.PureComponent{static Header=cy;static Body=cj;render(){let{children:e,className:t,onMouseEnter:i,onMouseLeave:n}=this.props;return(0,E.jsx)("div",{className:e6()(cv.Nr,t),onMouseEnter:i,onMouseLeave:n,children:e})}}var cR=i(165191),cL=i(871123),cD=i(366523),cP=i(280450),cG=i(30793),cM=i(97352),cU=i(67480),cV=i(147925),ck=i(957565),cw=i(615396),cF=i(990125);class cB extends S.PureComponent{_copyModeTimeout=new ow.Ep;state={copyMode:cC.q.DEFAULT};componentWillUnmount(){this._copyModeTimeout.stop()}get copyButtonText(){switch(this.state.copyMode){case cC.q.SUCCESS:return j.intl.string(j.t.XVvPjU);case cC.q.ERROR:return j.intl.string(j.t.i4GM3L);default:return j.intl.string(j.t.OpuAlK)}}handleRevoke(e){cb.A.revokeGiftCode(e)}handleCopy=e=>{let{giftCode:t,sku:i}=this.props;(0,cI.AK)(t,i),(0,ck.C)(e,()=>this.setState({copyMode:cC.q.SUCCESS}),()=>this.setState({copyMode:cC.q.ERROR})),this._copyModeTimeout.start(1e3,()=>{this.setState({copyMode:cC.q.DEFAULT})})};render(){let{hideCode:e,giftCode:t}=this.props,{copyMode:i}=this.state;return(0,E.jsxs)(rq.A,{direction:rq.A.Direction.VERTICAL,className:cF.Gj,children:[(0,E.jsx)(cC.e,{className:cF.ph,value:(0,cI.Zq)(t.code),text:this.copyButtonText,mode:i,supportsCopy:ck.p5,hideMessage:e?j.intl.string(j.t["0RLn47"]):null,onCopy:this.handleCopy,buttonColor:a8.XD.BRAND,buttonLook:a8.pR.FILLED}),(0,E.jsxs)("div",{className:cF.KB,children:[null!=t.expiresAt?(0,E.jsxs)(S.Fragment,{children:[j.intl.format(j.t.ltVZcJ,{hours:t.expiresAt.diff(rt()(),"h")})," \u2014\xa0"]}):null,(0,E.jsx)(en.D,{tag:"a",onClick:()=>this.handleRevoke(t.code),children:j.intl.string(j.t.v6Yazx)})]})]})}}class cz extends S.PureComponent{_loadedAt=null;state={isOpen:!1,isCreating:!1,isHovered:!1};componentDidMount(){this._loadedAt=Date.now()}handleGenerateGiftCode=async e=>{e.stopPropagation();let{skuId:t,subscriptionPlanId:i,giftStyle:n}=this.props;this.setState({isCreating:!0}),await cb.A.createGiftCode(t,i,n),this.setState({isCreating:!1,isOpen:!0})};handleToggleOpen=()=>{let{skuId:e,subscriptionPlanId:t,loadedAt:i}=this.props,n=!this.state.isOpen;(null==i||null==this._loadedAt||i<this._loadedAt)&&n&&cb.A.fetchUserGiftCodesForSKU(e,t),this.setState({isOpen:!this.state.isOpen})};renderGiftIcon(){let{sku:e,giftStyle:t,application:i}=this.props;return(0,cL.bF)(e)?(0,E.jsx)(cD.e,{shape:"square",sku:e,containerClassName:cF.ez}):null!=t?(0,E.jsx)(cR.A,{giftStyle:t,className:cF.ez,shouldAnimate:this.state.isHovered}):(0,E.jsx)(p.A,{game:i,size:p.M.MEDIUM,skuId:e.id})}renderSubtitle(){let{sku:e,entitlements:t,application:i}=this.props;return(0,cL.bF)(e)?(0,E.jsxs)("div",{className:e6()(cF.Oc,cF.ic),children:[(0,E.jsx)(p.A,{game:i,size:p.M.XSMALL,skuId:e.id,className:cF._u}),j.intl.format(j.t["6plpZi"],{applicationName:i.name,copies:t.length})]}):(0,E.jsx)("div",{className:cF.Oc,children:j.intl.format(j.t.zMcvcA,{copies:t.length})})}renderTitle(){let e,{sku:t,subscriptionPlan:i,giftCodeBatchId:n}=this.props;return e=n===sq.FB?j.intl.string(j.t.odsU6W):n===sq.Bu&&null!=i?j.intl.formatToPlainString(i.interval===sq.WT.MONTH?j.t.uZjpiJ:j.t.bJW1EA,{skuName:t.name,intervalCount:i.intervalCount}):null==i?t.name:j.intl.formatToPlainString(i.interval===sq.WT.MONTH?j.t.rCJvqo:j.t.Vd3Iu8,{skuName:t.name,intervalCount:i.intervalCount}),(0,E.jsx)("div",{className:cF.mO,children:e})}renderGenerateGiftCodeRow(){return(0,E.jsxs)(rq.A,{justify:rq.A.Justify.BETWEEN,align:rq.A.Align.CENTER,className:cF.pe,children:[(0,E.jsx)(es.E,{variant:"text-md/normal",children:j.intl.string(j.t.lELyPj)}),(0,E.jsx)(eG.$,{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:i,className:n,sku:s,isFetching:l,hideCodes:r}=this.props,{isOpen:a}=this.state;return(0,E.jsxs)(cO,{className:n,children:[(0,E.jsx)(en.D,{onClick:this.handleToggleOpen,className:cF.Nr,onMouseEnter:()=>this.setIsHovered(!0),onMouseLeave:()=>this.setIsHovered(!1),children:(0,E.jsx)(cO.Header,{splashArtURL:t.getSplashURL(512),children:(0,E.jsxs)("div",{className:cF.MY,children:[(0,E.jsxs)(rq.A,{align:rq.A.Align.CENTER,children:[this.renderGiftIcon(),(0,E.jsxs)("div",{className:cF.TK,children:[this.renderTitle(),this.renderSubtitle()]})]}),(0,E.jsx)(cV.A,{direction:a?cV.A.Directions.UP:cV.A.Directions.DOWN,className:cF.eO})]})})}),a?(0,E.jsx)(cO.Body,{children:l?(0,E.jsx)(dd.y,{className:cF.u1}):(0,E.jsxs)(S.Fragment,{children:[i.length<e.length?this.renderGenerateGiftCodeRow():null,i.map(e=>(0,E.jsx)(cB,{giftCode:e,sku:s,hideCode:r},e.code))]})}):null]})}}let cY=g.Ay.connectStores([cU.A,eF.A,cG.A,x.A,cM.A,cP.default],e=>{let{skuId:t,subscriptionPlanId:i,giftStyle:n}=e,s=cU.A.get(t);if(null==s)throw Error("SKU was unavailable while rendering gift.");let l=cG.A.getForGifterSKUAndPlan(cP.default.getId(),t,i).filter(e=>!e.isClaimed).filter(e=>e.giftStyle===n);return{sku:s,hideCodes:eF.A.enabled,isFetching:cG.A.getUserGiftCodesFetchingForSKUAndPlan(t,i),loadedAt:cG.A.getUserGiftCodesLoadedAtForSKUAndPlan(t,i),application:x.A.getApplication(s.applicationId),subscriptionPlan:null!=i?(0,cw.c9)(i):null,giftCodes:l}})(cz);var cX=i(725570),cH=i(736653),cK=i(46054);let cW=rt().duration(30,"days");var cZ=i(416052),cq=i(53070);function cQ(e){let{onClose:t,transitionState:i}=e;return(0,E.jsx)(rX.Modal,{title:"",size:"md",input:(0,E.jsx)("div",{className:cq.aR}),onClose:async()=>await t(),actions:[{text:j.intl.string(j.t.cpT0Cq),variant:"primary",onClick:t}],transitionState:i,children:(0,E.jsxs)("div",{className:cq.t4,children:[(0,E.jsx)(eP.D,{variant:"heading-xl/semibold",children:j.intl.string(j.t.iufib1)}),(0,E.jsx)(es.E,{variant:"text-md/normal",className:cq.G3,children:j.intl.string(j.t.eAn6z2)})]})})}let cJ=function(e){let{onClose:t,onClaim:i,code:n,outboundPromotion:s,transitionState:l}=e,[r,a]=S.useState(null),o=(0,sW.GV)(),{analyticsLocations:u}=(0,nQ.Ay)(e1.A.USER_SETTINGS_GIFT_INVENTORY);return(S.useEffect(()=>{null==n&&(0,cT.kd)({promotionId:s.id,promotionTitle:s.outboundTitle,partnerId:s.partnerId,analyticsLocations:u}).then(e=>i(e)).catch(e=>a(e?.body?.code))},[n,s.id,s.outboundTitle,s.partnerId,i,u]),null!=r)?(0,E.jsx)(cQ,{onClose:t,transitionState:l}):null==n?(0,E.jsx)(dd.y,{className:cq.Lq}):(0,E.jsx)(rX.Modal,{title:"",size:"md",onClose:async()=>await t(),input:(0,E.jsxs)("div",{className:cq.N1,children:[(0,E.jsx)("div",{className:cq.Qw}),(0,E.jsx)(eP.D,{variant:"heading-xl/semibold",children:j.intl.string(j.t["23BfZh"])}),(0,E.jsx)(es.E,{variant:"text-md/normal",className:cq.G3,children:s.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,cT.kc)(n,s);window.open(e,"_blank")}}],transitionState:l,"aria-label":o,children:(0,E.jsxs)("div",{children:[(0,E.jsx)(eM.c,{className:cq.M5}),(0,E.jsx)(s6.D,{label:j.intl.string(j.t.s9LFQh),helperText:j.intl.string(j.t["F+nFTZ"]),children:(0,E.jsx)(cZ.A,{value:n,buttonColor:a8.$n.Colors.BRAND,buttonLook:a8.$n.Looks.FILLED,delay:1e3})})]})})};var c$=i(707554),c0=i(339048),c1=i(104589);function c2(){let e=(0,g.yK)([c_.A],()=>c_.A.getGiftable()).filter(e=>{let{giftCodeBatchId:t}=e;return null==t}),t=eZ().groupBy(e,e=>(0,cI.Kx)(e.skuId,e.subscriptionPlanId,e.giftStyle)),[i,n]=S.useState(!1);if(S.useEffect(()=>{su.h.wait(()=>{(0,c0.XJ)().then(()=>n(!0))})},[]),!i)return(0,E.jsx)(dd.y,{className:c1.Lq});if(0===Object.keys(t).length)return(0,E.jsxs)("div",{className:c1.p$,children:[(0,E.jsx)("div",{className:c1.QT}),(0,E.jsx)(c$.H,{className:c1.ks,children:j.intl.string(j.t.B1qgZn)}),(0,E.jsx)("p",{className:c1.WO,children:j.intl.format(j.t.HezvJ8,{onClick:function(){(0,eH.openUserSettings)(u.X.NITRO_PANEL)}})})]});let s=eZ().keys(t).map(e=>{let{skuId:i,subscriptionPlanId:n,giftStyle:s}=(0,cI.X6)(e);return(0,E.jsx)(cY,{skuId:i,subscriptionPlanId:n,entitlements:t[e],giftStyle:s},e)});return(0,E.jsx)(Q.B,{gap:"lg",children:s})}function c3(e){let t,{outboundPromotion:i,code:n}=e,[s,l]=S.useState(!1),[r,a]=S.useState(!1);function o(){return l(e=>!e)}let u=(0,cH.Ay)(),d=(0,cT.WD)(i.id,u),c=null!=n,g=S.useMemo(()=>(0,ri.i$)(c?null!=i.outboundRedemptionEndDate?rt()(i.outboundRedemptionEndDate):rt()(i.endDate).add(cW):rt()(i.endDate),"LL"),[i,c]);c&&s?t=j.intl.format(j.t.pkxVx6,{endDate:g,onClickDetails:o}):c&&!s?t=j.intl.format(j.t["4sFeob"],{endDate:g,onClickDetails:o}):!c&&s?t=j.intl.format(j.t["RBnE+l"],{endDate:g,onClickDetails:o}):c||s||(t=j.intl.format(j.t["57+7Qn"],{endDate:g,onClickDetails:o}));let m=c?j.intl.string(j.t["2cHUti"]):j.intl.string(j.t.O13yhz),A=!0===(0,cp.N)(i),h=S.useCallback(()=>a(!1),[]),{outboundTitle:T,outboundTermsAndConditions:x}=i;return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)("div",{className:c1.AX,children:[(0,E.jsxs)("div",{className:c1.Pg,children:[(0,E.jsxs)("div",{className:c1.At,children:[(0,E.jsx)("div",{className:c1.$G,children:(0,E.jsx)("img",{alt:"",src:d,className:c1.IJ})}),(0,E.jsxs)("div",{children:[(0,E.jsx)(eP.D,{variant:"heading-md/semibold",children:T}),(0,E.jsx)(es.E,{variant:"text-sm/normal",color:"text-default",children:t})]})]}),(c||A)&&(0,E.jsx)(eG.$,{text:m,onClick:()=>a(!0),size:"sm"})]}),s&&(0,E.jsx)(es.E,{className:c1.GL,variant:"text-xs/normal",color:"text-default",children:cK.A.parse(x,!1,{allowLinks:!0})})]}),r&&(0,E.jsx)(cX.aF,{renderModal:e=>(0,E.jsx)(cJ,{...e,onClose:h,onClaim:ct.Ay.addClaimedOutboundPromotionCode,code:n,outboundPromotion:i}),onCloseRequest:h})]})}function c6(e){let{redesign:t=!1}=e,i=(0,g.yK)([c_.A],()=>c_.A.getGiftable()).filter(e=>{let{giftCodeBatchId:t}=e;return null!=t}),n=(0,cp.N)(),{activeOutboundPromotions:s,claimedEndedOutboundPromotions:l,claimedOutboundPromotionCodeMap:r}=(0,ci.y7)(),a=i.find(e=>e.giftCodeBatchId===sq.FB&&!e.consumed),o=i.filter(e=>e.giftCodeBatchId===sq.Bu&&!e.consumed)??[],[u,d]=eZ().partition(o,e=>{let{subscriptionPlanId:t}=e;return t===sq.gD.PREMIUM_YEAR_TIER_2}),c=s.length+l.length>0,m=t||!c?null:(0,E.jsxs)("div",{className:c1.N1,children:[(0,E.jsx)(eP.D,{variant:"heading-md/semibold",children:j.intl.string(j.t.wFsj3B)}),(0,E.jsx)(eM.c,{className:c1.yF})]}),A=!1===n&&c?(0,E.jsxs)("div",{className:c1.uo,children:[(0,E.jsx)(ui.t,{size:"md",color:er.A.colors.REDESIGN_BUTTON_PREMIUM_PRIMARY_PURPLE_FOR_GRADIENT_2,className:c1.PC}),(0,E.jsx)(es.E,{variant:"text-md/normal",className:c1.Qw,children:j.intl.format(j.t.G4fwxK,{onClick:()=>{(0,sX.default)(),(0,s5.pX)(U.BVt.APPLICATION_STORE)}})}),(0,E.jsx)(cf.A,{showGradient:!0,className:c1.aA,subscriptionTier:sq.pe.TIER_2,textOptions:{textOverride:j.intl.string(j.t.mr4K7D)}})]}):null;return(0,E.jsxs)("div",{children:[m,(0,E.jsx)(cN.A,{className:c1.Yj,isShown:!1===n&&c,type:cN.i.PREMIUM,hasBackground:!0,children:(0,E.jsxs)("div",{className:c1.DE,children:[A,l.map(e=>{let{code:t,promotion:i}=e;return(0,E.jsx)(c3,{outboundPromotion:i,code:t},i.id)}),s.map(e=>(0,E.jsx)(c3,{outboundPromotion:e,code:r[e.id]},e.id)),null!=a?(0,E.jsx)(cY,{skuId:a.skuId,subscriptionPlanId:a.subscriptionPlanId,entitlements:[a],giftCodeBatchId:sq.FB},(0,cI.Kx)(a.skuId,a.subscriptionPlanId)):null,u.length>0?(0,E.jsx)(cY,{skuId:u[0].skuId,subscriptionPlanId:u[0].subscriptionPlanId,entitlements:u,giftCodeBatchId:sq.Bu},(0,cI.Kx)(u[0].skuId,u[0].subscriptionPlanId)):null,d.length>0?(0,E.jsx)(cY,{skuId:d[0].skuId,subscriptionPlanId:d[0].subscriptionPlanId,entitlements:d,giftCodeBatchId:sq.Bu},(0,cI.Kx)(d[0].skuId,d[0].subscriptionPlanId)):null]})})]})}let c5=(0,a.zZ)(u.X.MY_GIFTS_CATEGORY,{useTitle:c8,buildLayout:()=>[c4],usePredicate:()=>{let{claimedOutboundPromotionCodes:e,claimedOutboundPromotionCodesLoaded:t}=(0,g.cf)([cx.A],()=>({claimedOutboundPromotionCodes:cx.A.claimedOutboundPromotionCodes,claimedOutboundPromotionCodesLoaded:cx.A.claimedOutboundPromotionCodesLoaded})),i=(0,ci.T1)({includeClaimedPromotions:!0}),n=(0,cT.Wl)(e,i).length;return t&&i.length+n>0}}),c4=(0,a.E2)(u.X.MY_GIFTS_CONTENT,{useSearchTerms:()=>[c8()],Component:()=>(0,E.jsx)(c6,{redesign:!0})});function c8(){return j.intl.string(j.t.YzjdWJ)}let c7=(0,a.zZ)(u.X.PURCHASED_GIFTS_CATEGORY,{useTitle:ge,buildLayout:()=>[c9]}),c9=(0,a.E2)(u.X.PURCHASED_GIFTS_CONTENT,{useSearchTerms:()=>[ge()],Component:()=>(0,E.jsx)(c2,{})});function ge(){return j.intl.string(j.t.FWe6CP)}var gt=i(532446),gi=i(499454);class gn extends S.Component{state={codeInput:"",submitting:!1,hasError:!1,isPromoCode:!1};get analyticsLocation(){let{analyticsContext:{location:e}}=this.props;return{...e,object:U.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 i=t.trim();this.setState({submitting:!0});try{if(this.props.acceptGiftCardRedemption)try{await (0,dS.Qp)(i),(0,dS.HF)({initialCode:i,withRedemptionSuccessModal:!0,source:"user_settings_gift_code_redemption",loadId:(0,dc.A)()}),this.setState({codeInput:""});return}catch{}let e=(0,cI.Vd)(t);if(null==e)return void this.setState({hasError:!0});let n=await cb.A.resolveGiftCode(e);if(null!=n&&null!=n.giftCode.promotion)throw this.setState({isPromoCode:!0}),Error("Cannnot redeem promotion code as gift");G.default.track(U.HAw.OPEN_MODAL,{type:"gift_accept",location:{...this.analyticsLocation,section:U.JJy.LIBRARY_INVENTORY_CODE_REDEMPTION,object:U.ZSU.BUTTON_CTA}}),(0,gi.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:i,submitting:n,hasError:s,isPromoCode:l}=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,E.jsx)(iC.n,{label:e?void 0:j.intl.string(j.t["il+VCo"]),children:(0,E.jsx)("form",{onSubmit:this.handleSubmit,children:(0,E.jsxs)(gt.M,{children:[(0,E.jsx)(rH.k,{label:r,description:a,type:t?"password":"text",value:i,onChange:this.handleChange,placeholder:"WUMP-AAAAA-BBBBB-CCCCC",error:!l&&s?j.intl.string(j.t.Y11a2u):null,helperText:l?j.intl.format(j.t.gPt3PE,{promoLink:()=>{window.open(`https://discord.com/billing/promotions/${i}`)}}):null,fullWidth:!0}),(0,E.jsx)(eG.$,{variant:"primary",text:j.intl.string(j.t.KIpp7M),type:"submit",loading:n,disabled:e&&0===i.length})]})})})}}function gs(e){let{redesign:t=!1}=e,{enabled:i}=(0,dK.c)({location:"UserSettingsBilling"}),n=S.useContext(G.AnalyticsContext),s=(0,g.bG)([eF.A],()=>eF.A.enabled);return(0,E.jsx)(gn,{analyticsContext:n,obscureInput:s,acceptGiftCardRedemption:i,redesign:t})}let gl=(0,a.zZ)(u.X.REDEEM_GIFT_CATEGORY,{useTitle:()=>j.intl.string(j.t["il+VCo"]),buildLayout:()=>[gr],usePredicate:()=>!(0,cn.Hp)()}),gr=(0,a.E2)(u.X.REDEEM_CODE_INPUT,{Component:()=>(0,E.jsx)(gs,{redesign:!0}),useSearchTerms:()=>[j.intl.string(j.t["jcSP+g"]),j.intl.string(j.t["il+VCo"])]}),ga=(0,a.t_)(u.X.GIFT_PANEL,{useTitle:()=>j.intl.string(j.t["jcSP+g"]),buildLayout:()=>[gl,c5,cE,c7,cl],initialize:()=>{ct.Ay.fetchClaimedOutboundPromotionCodes(),(0,ce.Ig)("gift_inventory")&&(0,d9.o0)(d8.$.GIFTING)}}),go=(0,a.i4)(u.X.GIFT_SIDEBAR_ITEM,{useTitle:()=>j.intl.string(j.t["jcSP+g"]),icon:d7.o,usePersistentBadge:function(){return S.useMemo(()=>({badgeType:h.Xi.COUNT,useCount:()=>(0,ci.IO)().length}),[])},buildLayout:()=>[ga]});var gu=i(659758),gd=i(71547),gc=i(815846);let gg=(0,a.E2)(u.X.NITRO_SETTING,{Component:function(){let e=(0,g.bG)([id.default],()=>id.default.getCurrentUser());return(0,uc.YE)(e,sq.PremiumTypes.TIER_2)?(0,E.jsx)(gc.A,{}):(0,E.jsx)(gd.A,{})},useSearchTerms:()=>[j.intl.string(j.t.Ipxkog)]}),gm=(0,a.zZ)(u.X.NITRO_CATEGORY,{buildLayout:()=>[gg]}),gA=(0,a.t_)(u.X.NITRO_PANEL,{useTitle:()=>j.intl.string(j.t.Ipxkog),useObscuredNotice:da.L,buildLayout:()=>[gm]}),gh=(0,a.i4)(u.X.NITRO_SIDEBAR_ITEM,{useTitle:()=>j.intl.string(j.t.Ipxkog),icon:ui.t,usePersistentBadge:function(e){return S.useMemo(()=>({badgeType:h.Xi.STRONGLY_DISCOURAGED_CUSTOM,useCustomBadge:()=>(0,gu.e)(e)}),[e])},buildLayout:()=>[gA]});var gE=i(104510),gS=i(820739),gT=i(73825),gx=i(160946);let gp=(0,i(240921).Ay)({name:"2026-03-boosting-settings-refresh",kind:"user",defaultConfig:{enabled:!1},variations:{0:{enabled:!1},1:{enabled:!0}}});var gf=i(859241),gN=i(531260),g_=i(369163),gI=i(957485),gC=i(926268),gb=i(253449),gv=i(93364);function gy(e){let{className:t,icon:i,children:n}=e;return(0,E.jsxs)("li",{className:e6()(gb.Nr,t),children:[(0,E.jsx)(i,{className:gb.Kk}),(0,E.jsx)(es.E,{className:gb.__invalid_description,variant:"text-sm/medium",children:n})]})}let gj=function(e){let{cardClassName:t}=e;return(0,E.jsxs)("div",{className:gb.iE,children:[(0,E.jsxs)("div",{className:gb.Qs,children:[(0,E.jsx)(eP.D,{className:gb.R_,color:"text-overlay-light",variant:"heading-xxl/bold",children:j.intl.string(j.t.IzKs3o)}),(0,E.jsxs)("ul",{className:gb.kR,children:[(0,E.jsx)(gy,{className:t,icon:g_.v,children:j.intl.string(j.t.TZigSO)}),(0,E.jsx)(gy,{className:t,icon:e=>(0,E.jsx)("img",{className:e6()(e.className,gb.Dp),src:gv,alt:""}),children:j.intl.string(j.t.hjQuV2)}),(0,E.jsx)(gy,{className:t,icon:gI.i,children:j.intl.string(j.t["2RUcaM"])}),(0,E.jsx)(gy,{className:t,icon:gC.C,children:j.intl.string(j.t.bJoZKV)})]})]}),(0,E.jsx)("div",{className:gb.JP})]})};var gO=i(834040),gR=i(999747);let gL=[{getQuestion:()=>j.intl.string(j.t.C4J8UB),getAnswer:()=>j.intl.string(j.t.nhkk6k)},{getQuestion:()=>j.intl.string(j.t.ai4ym2),getAnswer:()=>j.intl.format(j.t["8zlqlD"],{helpCenterUrl:tI.A.getArticleURL(U.MVz.GUILD_BOOSTING_FAQ)})},{getQuestion:()=>j.intl.string(j.t.kMVGsC),getAnswer:()=>j.intl.string(j.t["Vz/SCQ"])},{getQuestion:()=>j.intl.string(j.t.kYmXWF),getAnswer:()=>j.intl.string(j.t["+OURPp"])},{getQuestion:()=>j.intl.string(j.t["LsX/vb"]),getAnswer:()=>j.intl.string(j.t["3TeauK"])},{getQuestion:()=>j.intl.string(j.t.fRlnXU),getAnswer:()=>j.intl.string(j.t.bTRacj)},{getQuestion:()=>j.intl.string(j.t["8Mu5Q9"]),getAnswer:()=>j.intl.string(j.t["2T5iPo"])},{getQuestion:()=>j.intl.string(j.t["6EN+TZ"]),getAnswer:()=>j.intl.string(j.t.NZax1u)},{getQuestion:()=>j.intl.string(j.t.f5B4EW),getAnswer:()=>j.intl.string(j.t.Aje8Pb)}],gD=function(e){let{className:t}=e,[i,n]=S.useState(null);return(0,E.jsxs)("div",{className:e6()(gR.iE,t),children:[(0,E.jsx)(eP.D,{className:gR.R_,variant:"heading-xxl/bold",children:j.intl.string(j.t.HPJ6Nj)}),(0,E.jsx)("ul",{className:gR.p_,children:gL.map((e,t)=>{let s=i===t;return(0,E.jsxs)("div",{className:gR.Aw,children:[(0,E.jsxs)(en.D,{className:e6()(gR.k7,{[gR.lo]:s}),onClick:()=>n(e=>e===t?null:t),tag:"li",children:[(0,E.jsx)(es.E,{className:gR.b1,variant:"text-lg/normal",children:e.getQuestion()}),s?(0,E.jsx)(gO.Q,{size:"md",color:"currentColor",className:gR.q4}):(0,E.jsx)(rD.j,{size:"md",color:"currentColor",className:gR.q4})]}),s&&(0,E.jsx)(es.E,{className:gR.ZF,color:"text-default",variant:"text-md/normal",children:e.getAnswer()})]},t)})})]})};var gP=i(462887),gG=i(933832),gM=i(789645),gU=i(116891),gV=i(537532);let gk=[{getPerkHeading:()=>j.intl.string(j.t.tIiwuj),getPerkPreviewLightTheme:()=>i(604203),getPerkPreviewDarkTheme:()=>i(878515),getTier0Value:()=>sq.TG[U.TVA.NONE].limits.emoji,getTier1Value:()=>sq.TG[U.TVA.TIER_1].limits.emoji,getTier2Value:()=>sq.TG[U.TVA.TIER_2].limits.emoji,getTier3Value:()=>sq.TG[U.TVA.TIER_3].limits.emoji},{getPerkHeading:()=>j.intl.string(j.t["3iccet"]),getPerkPreviewLightTheme:()=>i(105732),getPerkPreviewDarkTheme:()=>i(857020),getTier0Value:()=>sq.TG[U.TVA.NONE].limits.stickers,getTier1Value:()=>sq.TG[U.TVA.TIER_1].limits.stickers,getTier2Value:()=>sq.TG[U.TVA.TIER_2].limits.stickers,getTier3Value:()=>sq.TG[U.TVA.TIER_3].limits.stickers},{getPerkHeading:()=>j.intl.string(j.t["+smCv9"]),getPerkPreviewLightTheme:()=>i(597890),getPerkPreviewDarkTheme:()=>i(297642),getTier0Value:()=>sq.TG[U.TVA.NONE].limits.soundboardSounds,getTier1Value:()=>sq.TG[U.TVA.TIER_1].limits.soundboardSounds,getTier2Value:()=>sq.TG[U.TVA.TIER_2].limits.soundboardSounds,getTier3Value:()=>sq.TG[U.TVA.TIER_3].limits.soundboardSounds},{getPerkHeading:()=>j.intl.string(j.t.SMYauD),getPerkPreviewLightTheme:()=>i(323091),getPerkPreviewDarkTheme:()=>i(261835),getTier0Value:()=>j.intl.formatToPlainString(j.t.zZ6Rdi,{resolution:sq.TG[U.TVA.NONE].limits.screenShareQualityResolution,framerate:sq.TG[U.TVA.NONE].limits.screenShareQualityFramerate}),getTier1Value:()=>j.intl.formatToPlainString(j.t.zZ6Rdi,{resolution:sq.TG[U.TVA.TIER_1].limits.screenShareQualityResolution,framerate:sq.TG[U.TVA.TIER_1].limits.screenShareQualityFramerate}),getTier2Value:()=>j.intl.formatToPlainString(j.t.zZ6Rdi,{resolution:(0,gU.eT)("GuildBoostingMarketingTierComparisonTable"),framerate:sq.TG[U.TVA.TIER_2].limits.screenShareQualityFramerate}),getTier3Value:()=>j.intl.formatToPlainString(j.t.zZ6Rdi,{resolution:(0,gU.eT)("GuildBoostingMarketingTierComparisonTable"),framerate:sq.TG[U.TVA.TIER_3].limits.screenShareQualityFramerate})},{getPerkHeading:()=>j.intl.string(j.t["/79IDj"]),getPerkPreviewLightTheme:()=>i(913997),getPerkPreviewDarkTheme:()=>i(95781),getTier0Value:()=>j.intl.formatToPlainString(j.t.w1gmLt,{bitrate:sq.TG[U.TVA.NONE].limits.bitrate/1e3}),getTier1Value:()=>j.intl.formatToPlainString(j.t.w1gmLt,{bitrate:sq.TG[U.TVA.TIER_1].limits.bitrate/1e3}),getTier2Value:()=>j.intl.formatToPlainString(j.t.w1gmLt,{bitrate:sq.TG[U.TVA.TIER_2].limits.bitrate/1e3}),getTier3Value:()=>j.intl.formatToPlainString(j.t.w1gmLt,{bitrate:sq.TG[U.TVA.TIER_3].limits.bitrate/1e3})},{getPerkHeading:()=>j.intl.string(j.t.R1U2xC),getPerkPreviewLightTheme:()=>i(389833),getPerkPreviewDarkTheme:()=>i(754561),getTier0Value:()=>j.intl.formatToPlainString(j.t.pIn7Af,{size:sq.TG[U.TVA.NONE].limits.fileSize/1048576}),getTier1Value:()=>j.intl.formatToPlainString(j.t.pIn7Af,{size:sq.TG[U.TVA.TIER_1].limits.fileSize/1048576}),getTier2Value:()=>j.intl.formatToPlainString(j.t.pIn7Af,{size:sq.TG[U.TVA.TIER_2].limits.fileSize/1048576}),getTier3Value:()=>j.intl.formatToPlainString(j.t.pIn7Af,{size:sq.TG[U.TVA.TIER_3].limits.fileSize/1048576})},{getPerkHeading:()=>j.intl.string(j.t.f6vfso),getPerkPreviewLightTheme:()=>i(735669),getPerkPreviewDarkTheme:()=>i(283517),getTier0Value:()=>sq.TG[U.TVA.NONE].limits.stageVideoUsers,getTier1Value:()=>sq.TG[U.TVA.TIER_1].limits.stageVideoUsers,getTier2Value:()=>sq.TG[U.TVA.TIER_2].limits.stageVideoUsers,getTier3Value:()=>sq.TG[U.TVA.TIER_3].limits.stageVideoUsers},{getPerkHeading:()=>j.intl.string(j.t.qDqUME),getPerkPreviewLightTheme:()=>i(970770),getPerkPreviewDarkTheme:()=>i(416378),getTier0Value:()=>!1,getTier1Value:()=>!0,getTier2Value:()=>!0,getTier3Value:()=>!0},{getPerkHeading:()=>j.intl.string(j.t.uwqgbu),getPerkPreviewLightTheme:()=>i(243580),getPerkPreviewDarkTheme:()=>i(975940),getTier0Value:()=>!1,getTier1Value:()=>!0,getTier2Value:()=>!0,getTier3Value:()=>!0},{getPerkHeading:()=>j.intl.string(j.t.zxsDxc),getPerkPreviewLightTheme:()=>i(435748),getPerkPreviewDarkTheme:()=>i(978380),getTier0Value:()=>!1,getTier1Value:()=>!1,getTier2Value:()=>j.intl.string(j.t["2TNS3n"]),getTier3Value:()=>j.intl.string(j.t["l+S46U"])},{getPerkHeading:()=>j.intl.string(j.t["bHa+Ee"]),getPerkPreviewLightTheme:()=>i(329312),getPerkPreviewDarkTheme:()=>i(800120),getTier0Value:()=>!1,getTier1Value:()=>!1,getTier2Value:()=>!0,getTier3Value:()=>!0},{getPerkHeading:()=>j.intl.string(j.t.QV6MZQ),getPerkPreviewLightTheme:()=>i(463384),getPerkPreviewDarkTheme:()=>i(481344),getTier0Value:()=>!1,getTier1Value:()=>!1,getTier2Value:()=>!1,getTier3Value:()=>!0}];function gw(e){let{children:t,className:i,tier:n}=e,s=n===U.TVA.NONE?"text-muted":"text-strong",l=n===U.TVA.NONE||null==n?"heading-xl/normal":"heading-xl/bold";return(0,E.jsxs)("th",{className:e6()(gV.PG,i),scope:"col",children:[(0,E.jsx)(eP.D,{color:s,variant:l,children:t}),null!=n&&(0,E.jsx)(es.E,{color:s,variant:"text-md/normal",children:j.intl.format(j.t["pob/cL"],{subscriptions:U.M2T[n]})})]})}function gF(e){let t,{className:i,textVariant:n="text-md/bold",value:s}=e;if("boolean"==typeof s){let e=e6()(gV.Jk,{[gV.I$]:s});t=s?(0,E.jsx)(gG.A,{size:"md",color:"currentColor",className:e}):(0,E.jsx)(gM.P,{size:"md",color:"currentColor",className:e})}else t=(0,E.jsx)(es.E,{color:"interactive-text-active",variant:n,children:s});return(0,E.jsx)("td",{className:e6()(gV.xR,i),children:t})}function gB(e){let{currentTier:t}=e,i=function(e){switch(e){case U.TVA.NONE:case U.TVA.TIER_1:return U.TVA.TIER_2;case U.TVA.TIER_2:case U.TVA.TIER_3:return U.TVA.TIER_3;default:return null}}(t);return null==i?null:(0,E.jsx)("div",{className:e6()(gV.ER,{[gV.GH]:i===U.TVA.TIER_2,[gV.z5]:i===U.TVA.TIER_3}),children:(0,E.jsx)(es.E,{className:gV.uQ,color:"text-overlay-light",variant:"text-xs/bold",children:t===U.TVA.TIER_3?j.intl.string(j.t.d849Up):j.intl.string(j.t.dZeX1z)})})}function gz(e){let{isFocused:t,handleFocus:i,handleRowBlur:n,theme:s,row:l,hideTier0:r}=e,a=S.useRef(null);return(0,E.jsxs)("tr",{className:gV.__invalid_tableRow,children:[(0,E.jsx)("th",{className:e6()(gV.xR,gV.uB),scope:"row",children:(0,E.jsx)(en.D,{className:e6()(gV.VC,gV.xR,gV.Rk),onFocus:i,onBlur:n,onMouseEnter:i,onMouseLeave:n,children:(0,E.jsx)(ee.Y,{targetElementRef:a,align:"center",disablePointerEvents:!0,nudgeAlignIntoViewport:!0,position:"bottom",renderPopout:()=>(0,E.jsx)("img",{className:gV.Mz,src:(0,gP.M)(s)?l.getPerkPreviewDarkTheme():l.getPerkPreviewLightTheme(),alt:""}),shouldShow:t,spacing:16,children:()=>(0,E.jsx)(es.E,{variant:"text-md/normal",ref:a,children:l.getPerkHeading()})})})}),!r&&(0,E.jsx)(gF,{textVariant:"text-md/normal",value:l.getTier0Value()}),(0,E.jsx)(gF,{value:l.getTier1Value()}),(0,E.jsx)(gF,{value:l.getTier2Value()}),(0,E.jsx)(gF,{value:l.getTier3Value()})]})}let gY=function(e){let t=(0,cH.Ay)(),[i,n]=S.useState(null),{className:s,guild:l,hideHeading:r,hideTier0:a}=e;function o(){n(null)}return(0,E.jsxs)("div",{className:s,children:[!r&&(0,E.jsx)(eP.D,{className:gV.R_,variant:"heading-xxl/extrabold",children:j.intl.string(j.t["9GGb9k"])}),(0,E.jsxs)("div",{className:gV.wY,children:[null!=l&&(0,E.jsx)(gB,{currentTier:l.premiumTier}),(0,E.jsxs)("table",{className:gV.tp,cellPadding:0,cellSpacing:0,children:[(0,E.jsx)("thead",{children:(0,E.jsxs)("tr",{className:gV.__invalid_tableRow,children:[(0,E.jsx)(gw,{className:gV.VC,children:j.intl.string(j.t.F5MY0k)}),!a&&(0,E.jsx)(gw,{tier:U.TVA.NONE,children:j.intl.string(j.t.mx8j2m)}),(0,E.jsx)(gw,{tier:U.TVA.TIER_1,children:j.intl.string(j.t.nzXtaS)}),(0,E.jsx)(gw,{tier:U.TVA.TIER_2,children:j.intl.string(j.t["h33/uW"])}),(0,E.jsx)(gw,{tier:U.TVA.TIER_3,children:j.intl.string(j.t.BfF6ED)})]})}),(0,E.jsx)("tbody",{className:gV.__invalid_tableBody,children:gk.map((e,s)=>{let l=i===s;return void 0===e.predicate?(0,E.jsx)(gz,{isFocused:l,handleFocus:function(){n(s)},handleRowBlur:o,theme:t,row:e,hideTier0:a},s):null})})]})]})]})};var gX=i(338548),gH=i(776096),gK=i(178368),gW=i(183812),gZ=i(866323),gq=i(530005),gQ=i(443865),gJ=i(473145);function g$(e){let{guildBoostSlot:t,onClose:n,hasCancelableGuildBoostSlot:s,premiumSubscription:l,onSelect:r,fractionalState:a}=e,o={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:s?null:j.intl.string(j.t.oQ9lOh),disabled:!s},uncancel:{label:j.intl.string(j.t["2glQNp"]),subtext:null,disabled:!1}};switch(l.status){case U.Dmq.PAST_DUE:o.cancel.disabled=!0,o.cancel.subtext=j.intl.string(j.t.WnL6DV),o.uncancel.disabled=!0;break;case U.Dmq.PAUSE_PENDING:case U.Dmq.PAUSED:a===sq.xc.NONE&&(o.transfer.disabled=!0,o.transfer.subtext=j.intl.string(j.t.LiLRRT),o.cancel.subtext=j.intl.string(j.t["1ywaWL"]),o.cancel.disabled=!0,o.uncancel.disabled=!0)}let d=S.useMemo(()=>l.isPausedOrPausePending&&a===sq.xc.NONE?(0,E.jsx)(ei.Dr,{id:"manage-subscription",label:j.intl.string(j.t.obRG6Y),action:()=>(0,eH.openUserSettings)(u.X.SUBSCRIPTIONS_PANEL),iconLeft:gQ.x,leadingAccessory:{type:"icon",icon:gQ.x}}):null,[a,l]);return(0,E.jsxs)(et.W,{"data-menu-migrated-auto":!0,onSelect:r,navId:"subscription-context",variant:"fixed","aria-label":j.intl.string(j.t.ogxXGq),onClose:n,children:[(0,E.jsx)(ei.Dr,{id:"apply",label:o.transfer.label,subtext:o.transfer.subtext,action:function(){(0,K.openModalLazy)(async()=>{let{default:e}=await Promise.resolve().then(i.bind(i,724624));return i=>(0,E.jsx)(e,{...i,guildBoostSlots:[t],locationSection:U.JJy.SETTINGS_PREMIUM})})},disabled:o.transfer.disabled}),(0,gJ.I5)(t)?(0,E.jsx)(ei.Dr,{id:"uncancel",label:o.uncancel.label,subtext:o.uncancel.subtext,action:function(){(0,K.openModalLazy)(async()=>{let{default:e}=await Promise.resolve().then(i.bind(i,342744));return i=>(0,E.jsx)(e,{...i,guildBoostSlotId:t.id})})},disabled:o.uncancel.disabled}):(0,E.jsx)(ei.Dr,{id:"cancel",label:o.cancel.label,subtext:o.cancel.subtext,action:function(){(0,K.openModalLazy)(async()=>{let{default:e}=await Promise.resolve().then(i.bind(i,983511));return i=>(0,E.jsx)(e,{...i,guildBoostSlot:t})})},disabled:o.cancel.disabled,color:"danger"}),d]})}var g0=i(545934),g1=i(496431);let g2=function(e){let{className:t,cooldown:i}=e,n=(0,g1.A)(i);return(0,E.jsx)(es.E,{className:t,variant:"text-sm/medium",color:"text-muted",children:(0,ri.uN)(n,{days:j.t.WUTPDc,hours:j.t.c1qodV,minutes:j.t["2+A3dv"]})})};var g3=i(759692);let g6=function(e){let{className:t,imageClassName:n,boostInCooldown:s,useReducedMotion:l}=e;return(0,E.jsx)("div",{className:e6()(g3.h4,t,{[g3.K2]:s}),children:(0,E.jsx)("img",{className:e6()(g3.Sl,n,{[g3.x8]:s}),src:s?i(650442):l?i(742885):"https://cdn.discordapp.com/assets/content/86fd98fc22283647a8be93d0c503646b53c84e3cb25ca6562a38cecb84327e58.gif",alt:""})})};var g5=i(743552);let g4=function(e){let{className:t,hasCooldown:n,isCanceled:s,useReducedMotion:l}=e;return(0,E.jsxs)("div",{className:e6()(g5.sn,t),children:[s?(0,E.jsx)("img",{className:e6()(g5.$J,g5.qX),src:i(728707),alt:""}):(0,E.jsx)(g6,{className:g5.$J,boostInCooldown:n,useReducedMotion:l}),!s&&n&&(0,E.jsx)("img",{className:g5.De,src:i(438807),alt:""})]})};var g8=i(548118),g7=i(63152),g9=i(944304),me=i(864310),mt=i(310918);let mi=function(e){let{className:t,guildId:i,boostingVariant:n}=e,s=(0,u6.bG)([ec.A],()=>ec.A.getGuild(i),[i]),l=(0,me.A)(s?.id).total;return null==s?(0,E.jsx)("div",{className:e6()(t,mt.bo),children:(0,E.jsx)("div",{className:mt.$g,children:(0,E.jsx)(es.E,{variant:"text-lg/bold",children:j.intl.string(j.t["6Kwwuo"])})})}):(0,E.jsxs)("div",{className:e6()(t,mt.bo),children:[(0,E.jsx)(g8.Ay,{className:mt.__invalid_guildIcon,guild:s,size:g8.Ay.Sizes.LARGER}),(0,E.jsxs)("div",{className:mt.$g,children:[(0,E.jsx)(es.E,{variant:"text-lg/bold",children:s.name}),(0,E.jsxs)("div",{className:mt.TZ,children:[(0,E.jsx)(gE._,{color:er.A.unsafe_rawColors.GUILD_BOOSTING_PINK,className:mt.Me}),(0,E.jsx)(es.E,{variant:"text-sm/bold",color:"text-muted",children:j.intl.format(j.t["pob/cL"],{subscriptions:l})}),(0,E.jsx)("div",{className:mt.me}),(0,E.jsx)(es.E,{variant:"text-sm/bold",color:"text-muted",children:(0,gJ.gb)(s.premiumTier,{useLevels:!1})})]})]}),n?(0,E.jsx)(g9.A,{guild:s,analyticsLocation:{page:U.liQ.GUILD_BOOSTING_USER_SETTINGS,section:U.JJy.GUILD_BOOSTING_RECOMMENDED_SERVER_BOOST_THIS_SERVER_CTA,object:U.ZSU.BUTTON_CTA,objectType:U.AnalyticsObjectTypes.BUY},pauseAnimation:!0,size:a8.$n.Sizes.MEDIUM,color:a8.$n.Colors.PRIMARY,buttonText:j.intl.string(j.t.aBHecF)}):(0,E.jsx)(eG.$,{variant:"secondary",text:j.intl.string(j.t.KLOhbO),onClick:()=>{(0,sX.default)(),(0,g7.K4)({guildId:s.id,location:{section:U.JJy.GUILD_BOOSTING_RECOMMENDED_SERVER_GO_TO_SERVER_CTA}})}})]})};var mn=i(20230);function ms(e){let{guildTier:t,guildBoostSlot:i,showAltText:n,isCanceled:s,premiumSubscription:l,fractionalPremiumInfo:r}=e,a=S.useMemo(()=>{if(s){let e=l.currentPeriodEnd;return l.isPausedForFractionalPremium&&(e=r.endsAt.toDate()),j.intl.format(j.t.Z4ULRD,{date:e})}let e=null!=i.premiumGuildSubscription?dN.default.extractTimestamp(i.premiumGuildSubscription.id):0;return j.intl.formatToPlainString(j.t.lY2Bur,{date:new Date(e)})},[i,s,l,r]),o=S.useMemo(()=>(function(e){if(null==e||e===U.TVA.NONE)return"";let t=[j.intl.formatToPlainString(j.t["dLlKX/"],{numEmojiSlots:sq.TG[e].limits.emoji}),j.intl.formatToPlainString(j.t["+ANIfv"],{numStickerSlots:sq.TG[e].limits.stickers}),j.intl.formatToPlainString(j.t["4gt60b"],{numSoundboardSlots:sq.TG[e].limits.soundboardSounds}),j.intl.formatToPlainString(j.t.XahSjZ,{resolution:sq.TG[e].limits.screenShareQualityResolution,framerate:sq.TG[e].limits.screenShareQualityFramerate}),j.intl.formatToPlainString(j.t.NbNs7S,{bitrate:sq.TG[e].limits.bitrate/1e3}),j.intl.formatToPlainString(j.t.VVKcpn,{filesize:sq.TG[e].limits.fileSize/1024/1024}),j.intl.formatToPlainString(j.t.TbpCvv,{numVideoStageSeats:sq.TG[e].limits.stageVideoUsers}),j.intl.string(j.t.LDyX3i),j.intl.string(j.t.YtGlPW)];e>=U.TVA.TIER_2&&(t.push(j.intl.string(j.t.SztbtN)),t.push(j.intl.string(j.t["3GK91n"]))),e>=U.TVA.TIER_3&&t.push(j.intl.string(j.t["XUUJd+"]));let i=t[Math.floor(Math.random()*t.length)];return j.intl.format(j.t["/dOAmQ"],{perk:i})})(t),[t]),u=(0,gZ.p)(n,{from:{opacity:0},enter:{opacity:1},leave:{opacity:0}},"animate-always");return s||t===U.TVA.NONE?(0,E.jsx)("div",{className:mn.xm,children:(0,E.jsx)(es.E,{variant:"text-sm/medium",color:"text-muted",children:a})}):u((e,t)=>(0,E.jsx)(gW.animated.div,{style:e,className:mn.xm,children:(0,E.jsx)(es.E,{variant:"text-sm/medium",color:"text-muted",children:t?o:a})}))}function ml(e){let{guildTier:t,guildBoostSlot:i,premiumSubscription:n,hasCancelableGuildBoostSlot:s,showAltText:l,isLastGuildBoostSlot:r}=e,a=(0,u6.bG)([i7.Ay],()=>i7.Ay.useReducedMotion),o=S.useMemo(()=>null!=i.cooldownEndsAt?new Date(i.cooldownEndsAt):null,[i]),u=S.useMemo(()=>null!=o&&o>new Date,[o]),d=(0,gJ.I5)(i),c=(0,gN.A)(),g=S.useRef(null);return(0,E.jsxs)("div",{className:mn.PW,children:[(0,E.jsxs)("div",{className:mn.$U,children:[(0,E.jsx)(g4,{isCanceled:d,hasCooldown:u,useReducedMotion:a}),(0,E.jsx)("div",{className:mn.vh,children:null!=o&&u&&!d?(0,E.jsx)(g2,{className:mn.xm,cooldown:o.getTime()}):(0,E.jsx)(ms,{guildTier:t,guildBoostSlot:i,showAltText:l,isCanceled:d,premiumSubscription:n,fractionalPremiumInfo:c})}),(0,E.jsx)(ee.Y,{targetElementRef:g,renderPopout:function(e){let{closePopout:t}=e;return(0,E.jsx)(g$,{onClose:t,guildBoostSlot:i,premiumSubscription:n,hasCancelableGuildBoostSlot:s,fractionalState:c.fractionalState})},position:"right",align:"center",children:e=>(0,E.jsx)(en.D,{...e,innerRef:g,"aria-label":j.intl.string(j.t.PdRCRg),className:mn.oU,children:(0,E.jsx)(gq.F,{size:"md",color:"currentColor"})})})]}),!r&&(0,E.jsx)("div",{className:mn.eX})]})}function mr(e){let{guildId:t,guildBoostSlotRecords:i,premiumSubscription:n,hasCancelableGuildBoostSlot:s,showAltText:l}=e,r=(0,u6.bG)([ec.A],()=>ec.A.getGuild(t),[t]);return(0,E.jsxs)("div",{className:mn.ag,children:[(0,E.jsx)(mi,{guildId:t,boostingVariant:!1}),i.map((e,t)=>(0,E.jsx)(ml,{guildTier:r?.premiumTier,guildBoostSlot:e,premiumSubscription:n,hasCancelableGuildBoostSlot:s,showAltText:l,isLastGuildBoostSlot:t===i.length-1},e.id))]})}function ma(e){let{guildId:t,appliedGuildBoosts:i,premiumSubscription:n}=e,s=(0,u6.bG)([ec.A],()=>ec.A.getGuild(t),[t]),l=dN.default.fromTimestamp(Date.now());if(i.forEach(e=>{(null==l||0>dN.default.compare(e.id,l))&&(l=e.id)}),null==l)return null;let r=g0.A.createFromServer({id:dN.default.fromTimestamp(Date.now()),subscription_id:n.id,canceled:!1,premium_guild_subscription:{id:l,guild_id:t},cooldown_ends_at:null},n);return(0,E.jsxs)("div",{className:mn.ag,children:[(0,E.jsx)(mi,{guildId:t,boostingVariant:!1}),i.map((e,t)=>(0,E.jsx)(ml,{guildTier:s?.premiumTier,guildBoostSlot:r,premiumSubscription:n,hasCancelableGuildBoostSlot:!1,showAltText:!1,isLastGuildBoostSlot:t===i.length-1},t))]})}function mo(e){let{appliedGuildBoosts:t,premiumSubscription:i}=e,n=S.useMemo(()=>{let e={};return t.forEach(t=>{let i=t.guildId;i in e||(e[i]=[]),e[i].push(t)}),e},[t]);return null==i||0===t.length?null:(0,E.jsxs)("div",{className:mn.iE,children:[(0,E.jsx)("div",{className:mn.kL,children:dN.default.keys(n).map(e=>(0,E.jsx)(ma,{guildId:e,premiumSubscription:i,appliedGuildBoosts:n[e]},e))}),(0,E.jsx)("div",{className:mn.vK})]})}function mu(e){let{guildBoostSlots:t,premiumSubscription:i}=e,[n,s]=S.useState(!1);S.useEffect(()=>{let e=-1;return null!=i&&(e=setInterval(()=>{s(e=>!e)},3e3)),()=>{clearInterval(e)}},[i]);let{boostsByGuildId:l,numActiveGuildBoostSlots:r}=S.useMemo(()=>{let e=0,i={};return Object.keys(t).forEach(n=>{let s=t[n];if(!(0,gJ.I5)(s)&&e++,null!=s.premiumGuildSubscription){let e=s.premiumGuildSubscription.guildId;e in i||(i[e]=[]),i[e].push(s)}}),{boostsByGuildId:i,numActiveGuildBoostSlots:e}},[t]);if(null==i||0===Object.keys(l).length)return null;let a=r>uc.Ay.getNumIncludedPremiumGuildSubscriptionSlots(i.planId);return(0,E.jsxs)("div",{className:mn.iE,children:[(0,E.jsx)("div",{className:mn.kL,children:dN.default.keys(l).map(e=>(0,E.jsx)(mr,{guildId:e,guildBoostSlotRecords:l[e],premiumSubscription:i,hasCancelableGuildBoostSlot:a,showAltText:n},e))}),(0,E.jsx)("div",{className:mn.vK})]})}var md=i(461546);let mc=function(e){let{hasGuildBoostSlots:t,hasAppliedGuildBoosts:n,hasBoostPerk:s,canAddBoosts:l}=e;return(0,E.jsxs)("div",{className:md.iE,children:[(0,E.jsx)("div",{className:md.bj,children:(0,E.jsx)("img",{alt:"",className:md.KV,src:i(742885)})}),(0,E.jsxs)("div",{className:md.D7,children:[(0,E.jsx)(eP.D,{variant:"display-md",className:md.R_,children:function(e){let{hasGuildBoostSlots:t,hasAppliedGuildBoosts:i,hasBoostPerk:n,canAddBoosts:s}=e;return s?t?n&&!i?j.intl.format(j.t.s9zQyG,{}):j.intl.format(j.t.Rb8Jhs,{}):j.intl.string(j.t["2rh0by"]):j.intl.format(j.t.Rb8Jhs,{})}({hasGuildBoostSlots:t,hasBoostPerk:s,hasAppliedGuildBoosts:n,canAddBoosts:l})}),(0,E.jsx)("svg",{viewBox:"0 0 660 210",className:md.Mz,children:(0,E.jsx)("path",{d:"M101.3,45.5C57.5,45.9,15.9,82.2,0,99.5V210h660V53.5c-164-137-265.2,32.4-385.8,33.6  C177.7,88.1,158.1,45,101.3,45.5z"})})]})]})};var mg=i(725538),mm=i(168482);function mA(){return(0,E.jsxs)("div",{className:mg.iE,children:[(0,E.jsx)("img",{className:mg.Kk,alt:"",src:mm}),(0,E.jsxs)("div",{className:mg.pq,children:[(0,E.jsx)(es.E,{variant:"text-lg/bold",children:j.intl.string(j.t.ZHNSYf)}),(0,E.jsx)(es.E,{variant:"text-sm/medium",color:"text-muted",children:j.intl.string(j.t.kCj5ps)})]}),(0,E.jsx)(eG.$,{variant:"secondary",text:j.intl.string(j.t.JFlifp),onClick:function(){(0,s5.pX)(U.BVt.GUILD_DISCOVERY),(0,sX.default)()}})]})}var mh=i(502572),mE=i(614820),mS=i(987144),mT=i(178015);let mx=function(){let e=S.useRef(null),{analyticsLocations:t}=(0,nQ.Ay)(),{fractionalState:n}=(0,gN.A)();function s(i){null!=e.current&&(0,K.closeModal)(e.current),(0,mS.g)({analyticsLocation:{page:U.liQ.GUILD_BOOSTING_USER_SETTINGS,section:U.JJy.GUILD_BOOSTING_BOOST_ANY_GUILD_CTA,object:U.ZSU.BUTTON_CTA,objectType:U.AnalyticsObjectTypes.BUY},analyticsLocations:t,guild:i})}async function l(){e.current=await (0,K.openModalLazy)(async()=>{let{default:e}=await Promise.resolve().then(i.bind(i,770101));return t=>(0,E.jsx)(e,{...t,onSelectGuild:s})},{onCloseRequest:()=>{null!=e.current&&(0,K.closeModal)(e.current)}})}let r=(0,gJ.Nc)({fractionalState:n});return(0,E.jsxs)("div",{className:mT.iE,children:[(0,E.jsx)(gE._,{color:er.A.unsafe_rawColors.GUILD_BOOSTING_PINK,className:mT.$J}),(0,E.jsx)(es.E,{className:mT.C,color:"text-default",variant:"text-sm/medium",children:j.intl.format(j.t.kqC5vq,{boostAnyGuildHook:(e,t)=>{let i=null!=r,n=(0,mE.O)(e),s=(0,E.jsx)("div",{className:mT.lO,children:(0,E.jsx)(ea.Q,{variant:"primary",onClick:i?void 0:l,text:n,disabled:i},t)});return i?(0,E.jsx)(mh.A,{text:r,"aria-label":r.toString(),children:e=>(0,E.jsx)("span",{...e,children:s})},t):s}})})]})};var mp=i(735310);let mf=function(e){let{canAddBoosts:t,canApplyBoosts:i}=e,n=(0,g.bG)([gH.A],()=>gH.A.affinities),s=(0,g.bG)([eg.Ay],()=>eg.Ay.getFlattenedGuildIds()),l=S.useMemo(()=>{let e=n.slice(0,3).map(e=>e.guildId);for(let t=0;t<s.length&&!(e.length>=3);t++){let i=s[t];e.includes(i)||e.push(i)}return e},[n,s]);return 0===l.length?null:(0,E.jsxs)("div",{className:mp.iE,children:[t&&(0,E.jsx)(eP.D,{variant:"heading-lg/semibold",className:mp.wx,children:j.intl.string(j.t.r90Wgo)}),l.map(e=>(0,E.jsx)(mi,{className:mp.ZS,guildId:e,boostingVariant:!0},e)),s.length>3&&i&&(0,E.jsx)(mx,{})]})};var mN=i(773447);let m_=function(e){let{hasAppliedGuildBoosts:t,hasBoostPerk:i,hasGuildAffinitiesOrInGuild:n,subscriptionIsPausedOrPausePending:s}=e,{subtitle:l,flavor:r}=function(e){let{hasAppliedGuildBoosts:t,hasBoostPerk:i,hasGuildAffinitiesOrInGuild:n,subscriptionIsPausedOrPausePending:s}=e;if(s)return{flavor:j.intl.format(j.t.doslJu,{onClick:()=>(0,eH.openUserSettings)(u.X.SUBSCRIPTIONS_PANEL)})};if(!n)return{subtitle:j.intl.string(j.t.oiWYAc)};if(t)return{subtitle:j.intl.string(j.t.W5rDjW),flavor:j.intl.format(j.t.cUHcaQ,{helpdeskArticle:tI.A.getArticleURL(U.MVz.GUILD_SUBSCRIPTIONS)})};let l=sq.hd[sq.gD.PREMIUM_MONTH_GUILD],r=uc.Ay.getDefaultPrice(l.id,i),a=(0,dp.CE)((0,dp.$g)(r.amount,r.currency),l.interval,l.intervalCount);return{subtitle:i?j.intl.string(j.t.bhPzXR):j.intl.string(j.t.Zs9h9Z),flavor:j.intl.formatToPlainString(j.t.PGgTdA,{monthlyGuildBoostPrice:a})}}({hasAppliedGuildBoosts:t,hasBoostPerk:i,hasGuildAffinitiesOrInGuild:n,subscriptionIsPausedOrPausePending:s});return(0,E.jsxs)("div",{className:mN.i,children:[(0,E.jsx)(eP.D,{variant:"heading-lg/bold",className:mN.V,children:l}),null!=r&&(0,E.jsx)(es.E,{variant:"text-sm/normal",children:r})]})};var mI=i(724624),mC=i(983511),mb=i(342744),mv=i(87719),my=i(439312);function mj(e){let{guildBoostSlot:t,isCancellable:i,onCancel:n,onUncancel:s,premiumSubscription:l,useReducedMotion:r,fractionalState:a}=e,o=S.useMemo(()=>null!=t.cooldownEndsAt?new Date(t.cooldownEndsAt):null,[t]),u=(0,gJ.I5)(t),d=l?.isPaused===!0&&a===sq.xc.NONE,c=j.intl.string(j.t.mOWsF1);return(0,E.jsxs)("li",{className:my.Hp,children:[(0,E.jsxs)("div",{className:my.YL,children:[(0,E.jsx)(g4,{className:my.W6,hasCooldown:t.isOnCooldown(),isCanceled:u,useReducedMotion:r}),u&&null!=l?(0,E.jsx)(es.E,{color:"text-muted",variant:"text-sm/medium",children:j.intl.format(j.t.Z4ULRD,{date:l.currentPeriodEnd})}):t.isOnCooldown()&&null!=o?(0,E.jsx)(g2,{cooldown:o.getTime()}):(0,E.jsx)(es.E,{className:my.__invalid_unappliedGuildBoostSlotDescription,color:"text-muted",variant:"text-sm/medium",children:j.intl.string(j.t["2mcafz"])})]}),(0,E.jsxs)("div",{className:my.E7,children:[i&&!u&&(0,E.jsx)(mh.A,{shouldShow:d,text:c,"aria-label":c.toString(),children:e=>(0,E.jsx)("div",{className:my.LB,children:(0,E.jsx)(ea.Q,{...e,variant:"primary",text:j.intl.string(j.t.twFU3R),onClick:()=>n(t),disabled:d,size:"sm"})})}),u&&(0,E.jsx)(mh.A,{shouldShow:d,text:c,"aria-label":c.toString(),children:e=>(0,E.jsx)("div",{className:my.LB,children:(0,E.jsx)(ea.Q,{...e,variant:"primary",text:j.intl.string(j.t["2glQNp"]),onClick:()=>s(t),disabled:d,size:"sm"})})})]})]},t.id)}function mO(e){(0,K.openModalLazy)(async()=>t=>(0,E.jsx)(mC.default,{...t,guildBoostSlot:e}))}function mR(e){(0,K.openModalLazy)(async()=>t=>(0,E.jsx)(mb.default,{...t,guildBoostSlotId:e.id}))}let mL=function(e){let t,i,n,{guildBoostSlots:s}=e,l=(0,g.bG)([dZ.A],()=>dZ.A.getPremiumTypeSubscription()),r=l?.isPausedOrPausePending===!0,{fractionalState:a}=(0,gN.A)(),o=(0,g.bG)([i7.Ay],()=>i7.Ay.useReducedMotion),u=(0,g.bG)([id.default],()=>id.default.getCurrentUser()),d=a===sq.xc.FP_SUB_PAUSED,c=r&&!d,{appliedGuildBoostSlots:m,unappliedGuildBoostSlots:A,numActiveGuildBoostSlots:h,hasCooldownBoosts:T,allGuildBoostsAreOnCooldown:x}=S.useMemo(()=>{let e=[],t=[],i=0,n=!1,l=!0;return s.forEach(s=>{!(0,gJ.I5)(s)&&i++,s.isOnCooldown()?n=!0:l=!1,null!=s.premiumGuildSubscription?e.push(s):t.push(s)}),{appliedGuildBoostSlots:e,unappliedGuildBoostSlots:t,numActiveGuildBoostSlots:i,hasCooldownBoosts:n,allGuildBoostsAreOnCooldown:l}},[s]),p=null!=l?uc.Ay.getNumIncludedPremiumGuildSubscriptionSlots(l.planId):0,f=Math.max(0,p-m.length),N=h>p,_=p===s.length,I=_?f:1,C=S.useMemo(()=>{let e=[];for(let t=0;t<I;t++)e.push((0,E.jsx)(g6,{className:my.YA,useReducedMotion:o},t));return e},[I,o]),b=S.useMemo(()=>A.find(e=>e.isAvailable()),[A]);if(0===A.length)return null;let v=A.length;if(t=_?j.intl.formatToPlainString(x?j.t["3DW6Dc"]:j.t["/u15Qc"],{numUnappliedGuildBoostSlots:v}):j.intl.formatToPlainString(x?j.t["3DW6Dc"]:j.t.BPadnO,{numUnappliedGuildBoostSlots:v}),uc.Ay.isPremium(u)){function y(e,t){return(0,E.jsx)(en.D,{className:my.nw,tag:"span",onClick:()=>{(0,mv.e)()},children:e},t)}i=x?j.intl.format(j.t.omcpSE,{learnMoreHook:y}):j.intl.format(j.t["5mAkVi"],{numUnappliedGuildBoostSlots:v,learnMoreHook:y})}else i=x?j.intl.string(j.t["8pcUZi"]):j.intl.formatToPlainString(j.t.Kaw82o,{numUnappliedGuildBoostSlots:v});return n=r&&a===sq.xc.NONE?j.intl.string(j.t.mOWsF1):j.intl.string(j.t.xr4m5B),(0,E.jsx)("div",{className:my.iE,children:(0,E.jsxs)("div",{className:e6()(my.Qs,[my.Yq]),children:[(0,E.jsxs)("div",{className:my.wx,children:[(0,E.jsxs)("div",{className:my.RW,children:[(0,E.jsx)("div",{className:my.PS,children:C}),(0,E.jsxs)("div",{className:my.__invalid_headerCopy,children:[(0,E.jsx)(eP.D,{className:my.gg,variant:"heading-lg/bold",children:t}),(0,E.jsx)(es.E,{className:my.__invalid_headerSubheading,color:"text-strong",variant:"text-sm/normal",children:i})]})]}),(0,E.jsx)("div",{className:my.di,children:(0,E.jsx)(mh.A,{shouldShow:null==b||c,text:n,"aria-label":n.toString(),children:e=>(0,E.jsx)(eG.$,{variant:"primary",text:j.intl.string(j.t.BMx1iy),...e,disabled:null==b||c,onClick:null!=b?()=>{(0,K.openModalLazy)(async()=>e=>(0,E.jsx)(mI.default,{...e,guildBoostSlots:[b],locationSection:U.JJy.SETTINGS_PREMIUM}))}:void 0})})})]}),(!_||T)&&(0,E.jsx)("ul",{className:my.LU,children:A.map(e=>(0,E.jsx)(mj,{guildBoostSlot:e,isCancellable:N,onCancel:mO,onUncancel:mR,premiumSubscription:l,useReducedMotion:o,fractionalState:a},e.id))})]})})};var mD=i(561835);function mP(e){let{premiumSubscription:t}=e,i=(0,g.bG)([gK.A],()=>gK.A.boostSlots),n=S.useMemo(()=>Object.values(i),[i]),s=(0,g.bG)([id.default],()=>id.default.getCurrentUser()),l=uc.Ay.isPremium(s,sq.PremiumTypes.TIER_2),r=(0,g.bG)([gH.A],()=>gH.A.affinities),a=(0,g.bG)([eg.Ay],()=>eg.Ay.getFlattenedGuildIds()),o=r.length>0||a.length>0,u=n.length>0,d=S.useMemo(()=>n.filter(e=>null!=e.premiumGuildSubscription),[n]),c=d.length>0,m=n.length>d.length,A=(0,g.bG)([gf.A],()=>gf.A.getCurrentUserAppliedBoosts()),{fractionalState:h}=(0,gN.A)({forceFetch:!0}),T=s?.isPremiumGroupMember(),x=t?.isPausedOrPausePending===!0&&h===sq.xc.NONE,p=t?.isPausedOrPausePending!==!0&&h===sq.xc.NONE&&!T,f=l&&h===sq.xc.FP_SUB_PAUSED,N=h===sq.xc.NONE&&!T;return(0,E.jsxs)("div",{className:mD.GO,children:[(0,E.jsx)(d2.kb,{className:mD.ek}),(0,E.jsx)(mc,{hasGuildBoostSlots:u,hasAppliedGuildBoosts:c,hasBoostPerk:f,canAddBoosts:p}),N&&(0,E.jsx)(m_,{hasAppliedGuildBoosts:c,hasBoostPerk:f,hasGuildAffinitiesOrInGuild:o,subscriptionIsPausedOrPausePending:x}),T&&(0,E.jsx)(gX.A,{}),!o&&(0,E.jsx)(mA,{}),t?.isPaused&&h!==sq.xc.FP_SUB_PAUSED?(0,E.jsx)(mo,{appliedGuildBoosts:A,premiumSubscription:t}):(0,E.jsx)(mu,{guildBoostSlots:i,premiumSubscription:t}),(0,E.jsx)(mL,{guildBoostSlots:n,fractionalPremiumState:h}),(0,E.jsx)(mf,{canAddBoosts:c&&p,canApplyBoosts:m}),(0,E.jsx)(gY,{className:mD.e4,hideHeading:!0,hideTier0:!0}),(0,E.jsx)(gj,{cardClassName:mD.KW}),(0,E.jsx)(gD,{className:mD.JL})]})}var mG=i(527113),mM=i(365199),mU=i(378102);function mV(e){let{guild:t,className:i}=e,{total:n}=(0,me.A)(t.id);return(0,E.jsxs)("div",{className:i??mU.OA,children:[(0,E.jsx)(g8.Ay,{className:mU.$f,guild:t,size:g8.Ay.Sizes.MEDIUM}),(0,E.jsxs)("div",{className:mU.gI,children:[(0,E.jsx)(es.E,{variant:"heading-md/semibold",color:"text-default",tag:"span",children:t.name}),(0,E.jsxs)("div",{className:mU.ew,children:[(0,E.jsxs)("div",{className:mU.QW,children:[(0,E.jsx)(gE._,{className:mU.Wz,color:er.A.unsafe_rawColors.GUILD_BOOSTING_PINK_REFRESH}),(0,E.jsx)(es.E,{variant:"text-xs/semibold",color:"text-subtle",children:j.intl.format(j.t["pob/cL"],{subscriptions:n})})]}),t.premiumTier!==U.TVA.NONE&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("div",{className:mU.zk}),(0,E.jsx)(es.E,{variant:"text-xs/semibold",color:"text-subtle",children:(0,gJ.gb)(t.premiumTier,{useLevels:!1})})]})]})]})]})}function mk(e){let{guildId:t}=e,i=(0,g.bG)([ec.A],()=>ec.A.getGuild(t),[t]);return null==i?null:(0,E.jsxs)("div",{className:mU.Nr,children:[(0,E.jsx)(mV,{guild:i}),(0,E.jsx)(eG.$,{variant:"secondary",size:"sm",icon:gE._,text:j.intl.string(j.t.aBHecF),onClick:()=>{(0,mS.g)({analyticsLocations:[],analyticsLocation:{page:U.liQ.GUILD_BOOSTING_USER_SETTINGS,section:U.JJy.GUILD_BOOSTING_RECOMMENDED_SERVER_BOOST_THIS_SERVER_CTA,object:U.ZSU.BUTTON_CTA,objectType:U.AnalyticsObjectTypes.BUY},guild:i})}})]})}var mw=i(512062);let mF="https://cdn.discordapp.com/assets/content/272d3fa6496aedb9dee76f2d555913bfd56c9e9aacd6de3c18449644d9749657.png";function mB(e){let{slot:t,guildTier:i,premiumSubscription:n,hasCancelableSlots:s,isLast:l}=e,r=S.useRef(null),a=(0,gJ.I5)(t),o=S.useMemo(()=>null!=t.cooldownEndsAt?new Date(t.cooldownEndsAt):null,[t.cooldownEndsAt]),u=null!=o&&o>new Date,d=(0,gN.A)(),c=S.useMemo(()=>(function(e,t){if(null==e||e===U.TVA.NONE)return"";let i=[j.intl.formatToPlainString(j.t["dLlKX/"],{numEmojiSlots:sq.TG[e].limits.emoji}),j.intl.formatToPlainString(j.t["+ANIfv"],{numStickerSlots:sq.TG[e].limits.stickers}),j.intl.formatToPlainString(j.t["4gt60b"],{numSoundboardSlots:sq.TG[e].limits.soundboardSounds}),j.intl.formatToPlainString(j.t.XahSjZ,{resolution:sq.TG[e].limits.screenShareQualityResolution,framerate:sq.TG[e].limits.screenShareQualityFramerate}),j.intl.formatToPlainString(j.t.NbNs7S,{bitrate:sq.TG[e].limits.bitrate/1e3}),j.intl.formatToPlainString(j.t.VVKcpn,{filesize:sq.TG[e].limits.fileSize/1024/1024}),j.intl.formatToPlainString(j.t.TbpCvv,{numVideoStageSeats:sq.TG[e].limits.stageVideoUsers}),j.intl.string(j.t.LDyX3i),j.intl.string(j.t.YtGlPW)];e>=U.TVA.TIER_2&&(i.push(j.intl.string(j.t.SztbtN)),i.push(j.intl.string(j.t["3GK91n"]))),e>=U.TVA.TIER_3&&i.push(j.intl.string(j.t["XUUJd+"]));let n=0;for(let e=0;e<t.length;e++)n=31*n+t.charCodeAt(e)|0;let s=i[Math.abs(n)%i.length];return j.intl.formatToPlainString(j.t["/dOAmQ"],{perk:s})})(i,t.id),[i,t.id]),g=S.useMemo(()=>{if(""!==c)return c;let e=null!=t.premiumGuildSubscription?dN.default.extractTimestamp(t.premiumGuildSubscription.id):0;return j.intl.formatToPlainString(j.t.lY2Bur,{date:new Date(e)})},[c,t.premiumGuildSubscription]),m=S.useMemo(()=>a?n.isPausedForFractionalPremium?d.endsAt.toDate():n.currentPeriodEnd:null,[a,n,d]);return(0,E.jsxs)("div",{className:e6()(mw.iq,{[mw.Mt]:l}),children:[(0,E.jsxs)("div",{className:mw.kd,children:[(0,E.jsx)("img",{alt:"",className:mw.bB,src:mF}),a&&null!=m?(0,E.jsx)(es.E,{variant:"text-sm/medium",color:"text-subtle",children:j.intl.format(j.t.Z4ULRD,{date:m})}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(es.E,{variant:"text-sm/medium",color:"text-subtle",children:g}),u&&null!=o&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("div",{className:mw.zk}),(0,E.jsx)(es.E,{variant:"text-sm/medium",color:"text-feedback-info",children:j.intl.formatToPlainString(j.t.YJlswH,{date:o.toLocaleDateString()})})]}),!u&&null!=n.trialEndsAt&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("div",{className:mw.zk}),(0,E.jsx)(es.E,{variant:"text-sm/medium",color:"text-feedback-warning",children:j.intl.formatToPlainString(j.t.OdPSpk,{date:new Date(n.trialEndsAt).toLocaleDateString()})})]})]})]}),(0,E.jsx)(ee.Y,{targetElementRef:r,renderPopout:e=>{let{closePopout:i}=e;return(0,E.jsx)(g$,{onClose:i,guildBoostSlot:t,premiumSubscription:n,hasCancelableGuildBoostSlot:s,fractionalState:d.fractionalState})},position:"right",align:"center",children:e=>(0,E.jsx)(en.D,{innerRef:r,"aria-label":j.intl.string(j.t.PdRCRg),className:mw.Mj,...e,children:(0,E.jsx)(mM.j,{size:"xs",color:er.A.colors.INTERACTIVE_TEXT_DEFAULT})})})]})}function mz(e){let{guildId:t,slots:i,premiumSubscription:n,hasCancelableSlots:s}=e,l=(0,g.bG)([ec.A],()=>ec.A.getGuild(t),[t]);return(0,E.jsxs)("div",{className:mw.Nr,children:[(0,E.jsx)("div",{className:mw.MY,children:null!=l?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(mV,{guild:l,className:mw.OA}),(0,E.jsx)(eG.$,{variant:"secondary",size:"sm",text:j.intl.string(j.t.KLOhbO),onClick:()=>{(0,sX.default)(),(0,g7.K4)({guildId:l.id,location:{section:U.JJy.GUILD_BOOSTING_RECOMMENDED_SERVER_GO_TO_SERVER_CTA}})}})]}):(0,E.jsx)("div",{className:mw.OA,children:(0,E.jsx)(eP.D,{variant:"heading-md/semibold",color:"text-default",children:j.intl.string(j.t["6Kwwuo"])})})}),i.map((e,t)=>(0,E.jsx)(mB,{slot:e,guildTier:l?.premiumTier,premiumSubscription:n,hasCancelableSlots:s,isLast:t===i.length-1},e.id))]})}function mY(e){let{guildBoostSlots:t,premiumSubscription:i,pausedAppliedGuildBoosts:n,isPaused:s}=e,{boostsByGuildId:l,numActiveSlots:r}=S.useMemo(()=>{if(s&&null!=i)return{boostsByGuildId:function(e,t){let i={};for(let t of e)t.guildId in i||(i[t.guildId]=[]),i[t.guildId].push(t);let n={};for(let e of Object.keys(i)){let s=i[e];n[e]=s.map(i=>g0.A.createFromServer({id:i.id,subscription_id:t.id,canceled:!1,premium_guild_subscription:{id:i.id,guild_id:e},cooldown_ends_at:null},t))}return n}(n,i),numActiveSlots:0};let e=0,l={};for(let i of Object.keys(t)){let n=t[i];if(!(0,gJ.I5)(n)&&e++,null!=n.premiumGuildSubscription){let e=n.premiumGuildSubscription.guildId;e in l||(l[e]=[]),l[e].push(n)}}return{boostsByGuildId:l,numActiveSlots:e}},[t,s,n,i]);if(null==i||0===Object.keys(l).length)return null;let a=r>uc.Ay.getNumIncludedPremiumGuildSubscriptionSlots(i.planId);return(0,E.jsx)("div",{className:mw.kR,children:dN.default.keys(l).map(e=>(0,E.jsx)(mz,{guildId:e,slots:l[e],premiumSubscription:i,hasCancelableSlots:a},e))})}var mX=i(928171);function mH(e){let{guildBoostSlots:t,fractionalPremiumState:n}=e,s=(0,g.bG)([dZ.A],()=>dZ.A.getPremiumTypeSubscription()),{unappliedSlots:l,numActiveSlots:r}=S.useMemo(()=>{let e=[],i=0;for(let n of t)!(0,gJ.I5)(n)&&i++,null==n.premiumGuildSubscription&&e.push(n);return{unappliedSlots:e,numActiveSlots:i}},[t]),a=r>(null!=s?uc.Ay.getNumIncludedPremiumGuildSubscriptionSlots(s.planId):0),o=s?.isPausedOrPausePending===!0&&n===sq.xc.NONE;return 0===l.length?null:(0,E.jsxs)("div",{className:mX.Nr,children:[(0,E.jsxs)("div",{className:mX.MY,children:[(0,E.jsxs)("div",{className:mX._L,children:[(0,E.jsxs)("div",{className:mX.MD,children:[(0,E.jsx)("img",{alt:"",className:mX.F8,src:mF}),(0,E.jsx)("div",{className:e6()(mX.qS,"theme-dark"),children:(0,E.jsx)("span",{className:mX.Vv,children:l.length})})]}),(0,E.jsxs)("div",{className:mX.Qp,children:[(0,E.jsx)(es.E,{variant:"heading-md/semibold",color:"text-default",tag:"span",children:j.intl.format(j.t.BPadnO,{numUnappliedGuildBoostSlots:l.length})}),(0,E.jsx)(es.E,{variant:"text-xs/semibold",color:"text-subtle",children:j.intl.format(j.t.Kaw82o,{numUnappliedGuildBoostSlots:l.length})})]})]}),(0,E.jsx)(mh.A,{shouldShow:o,text:j.intl.string(j.t.mOWsF1),"aria-label":j.intl.string(j.t.mOWsF1),children:e=>(0,E.jsx)(eG.$,{...e,variant:"primary",size:"sm",icon:gE._,text:j.intl.string(j.t.BMx1iy),disabled:o,onClick:()=>{(0,K.openModalLazy)(async()=>{let{default:e}=await Promise.resolve().then(i.bind(i,770101));return t=>(0,E.jsx)(e,{...t,onSelectGuild:e=>{t.onClose(),(0,mS.g)({analyticsLocations:[],analyticsLocation:{page:U.liQ.GUILD_BOOSTING_USER_SETTINGS,section:U.JJy.SETTINGS_PREMIUM,object:U.ZSU.BUTTON_CTA,objectType:U.AnalyticsObjectTypes.BUY},guild:e})}})})}})})]}),l.map((e,t)=>(0,E.jsx)(mK,{slot:e,isLast:t===l.length-1,isCancelable:a&&!(0,gJ.I5)(e),isCanceled:(0,gJ.I5)(e),premiumSubscription:s,modificationsDisabled:o},e.id))]})}function mK(e){let t,{slot:i,isLast:n,isCancelable:s,isCanceled:l,premiumSubscription:r,modificationsDisabled:a}=e,o=S.useRef(null),u=S.useMemo(()=>null!=i.cooldownEndsAt?new Date(i.cooldownEndsAt):null,[i.cooldownEndsAt]);t=l&&null!=r?(0,E.jsx)(es.E,{variant:"text-sm/medium",color:"text-subtle",children:j.intl.format(j.t.Z4ULRD,{date:r.currentPeriodEnd})}):i.isOnCooldown()&&null!=u?(0,E.jsx)(g2,{cooldown:u.getTime()}):(0,E.jsx)(es.E,{variant:"text-sm/medium",color:"text-subtle",children:j.intl.string(j.t["2mcafz"])});let d=s||l;return(0,E.jsxs)("div",{className:e6()(mX.iq,{[mX.Mt]:n}),children:[(0,E.jsxs)("div",{className:mX.kd,children:[(0,E.jsx)("img",{alt:"",className:mX.bB,src:mF}),t]}),d&&(0,E.jsx)(ee.Y,{targetElementRef:o,renderPopout:e=>{let{closePopout:t}=e;return(0,E.jsxs)(et.W,{navId:"unapplied-boost-actions","aria-label":j.intl.string(j.t.ogxXGq),onSelect:void 0,onClose:t,children:[s&&(0,E.jsx)(ei.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,K.openModalLazy)(async()=>e=>(0,E.jsx)(mC.default,{...e,guildBoostSlot:i}))}}),l&&(0,E.jsx)(ei.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,K.openModalLazy)(async()=>e=>(0,E.jsx)(mb.default,{...e,guildBoostSlotId:i.id}))}})]})},align:"right",position:"bottom",children:e=>(0,E.jsx)(en.D,{innerRef:o,"aria-label":j.intl.string(j.t["UKOtz+"]),className:mX.Mj,...e,children:(0,E.jsx)(mM.j,{size:"xs",color:er.A.colors.INTERACTIVE_TEXT_DEFAULT})})})]})}var mW=i(942053);function mZ(e){let{guildBoostSlots:t,guildBoostSlotsByGuildId:i,premiumSubscription:n,pausedAppliedGuildBoosts:s,fractionalPremiumState:l}=e,r=tI.A.getArticleURL(U.MVz.GUILD_BOOSTING_FAQ),a=n?.isPaused===!0&&l!==sq.xc.FP_SUB_PAUSED,o=t.some(e=>null==e.premiumGuildSubscription),u=a&&s.length>0,d=a?u:t.some(e=>null!=e.premiumGuildSubscription);return o||d?(0,E.jsxs)("div",{className:mW.i,children:[(0,E.jsxs)("div",{className:mW.b,children:[(0,E.jsx)(eP.D,{variant:"heading-md/semibold",children:j.intl.string(j.t.W5rDjW)}),(0,E.jsx)(es.E,{variant:"text-sm/normal",color:"text-muted",children:j.intl.format(j.t.SpDz1x,{helpdeskArticle:r})})]}),(0,E.jsx)(mY,{guildBoostSlots:i,premiumSubscription:n,pausedAppliedGuildBoosts:s,isPaused:a}),(0,E.jsx)(mH,{guildBoostSlots:t,fractionalPremiumState:l})]}):null}var mq=i(917064),mQ=i(401721);function mJ(){return(0,E.jsxs)("div",{className:mQ.iE,children:[(0,E.jsx)(eP.D,{variant:"heading-xl/normal",children:j.intl.string(j.t.IzKs3o)}),(0,E.jsx)("div",{className:mQ.kR,children:mq.s.map((e,t)=>{let i=e.icon;return(0,E.jsxs)("div",{className:mQ.Nr,children:[(0,E.jsx)(i,{className:mQ.Kk}),(0,E.jsx)(es.E,{className:mQ.h_,color:"text-muted",variant:"text-sm/medium",children:e.getText()})]},t)})})]})}var m$=i(232122),m0=i(630579);function m1(){let[e,t]=S.useState(null),[i,n]=S.useState(null);return(0,E.jsxs)("div",{className:m0.iE,children:[(0,E.jsx)(eP.D,{variant:"heading-xl/normal",children:j.intl.string(j.t.HPJ6Nj)}),(0,E.jsx)("ul",{className:m0.p_,children:m$.m.map((s,l)=>{let r=e===l,a=i===l,o=r||a?"text-strong":"text-muted";return(0,E.jsxs)(en.D,{tag:"li",className:e6()(m0.Aw,{[m0.$K]:r}),onClick:()=>t(e=>e===l?null:l),onMouseEnter:()=>n(l),onMouseLeave:()=>n(null),children:[(0,E.jsxs)("div",{className:m0.k7,children:[(0,E.jsx)(es.E,{className:m0.b1,color:o,variant:"heading-md/semibold",tag:"span",children:s.getQuestion()}),(0,E.jsx)(el.a,{size:"sm",color:er.A.colors.INTERACTIVE_ICON_DEFAULT,className:m0.q4,style:{transform:r?"rotate(180deg)":"rotate(0deg)"}})]}),r&&(0,E.jsx)(es.E,{className:m0.ZF,color:"text-muted",variant:"text-sm/medium",children:s.getAnswer()})]},l)})})]})}var m2=i(182859),m3=i(853513),m6=i(880482);function m5(){let e=tI.A.getArticleURL(U.MVz.GUILD_SUBSCRIPTIONS);return(0,E.jsxs)("div",{className:m6.wx,children:[(0,E.jsxs)("div",{className:m6.Qs,children:[(0,E.jsxs)("div",{className:m6.B5,children:[(0,E.jsx)("img",{alt:"",className:m6.F8,src:"/assets/263e4cc9043cab70.svg"}),(0,E.jsx)(eP.D,{variant:"heading-xl/normal",children:j.intl.string(m3.default.hjvcLO)})]}),(0,E.jsx)(es.E,{variant:"text-sm/normal",color:"text-muted",children:j.intl.format(j.t.TUHyoA,{helpdeskArticle:e})})]}),(0,E.jsx)(m2.A,{variant:"member",className:m6.iO,analyticsLocation:{page:U.liQ.GUILD_BOOSTING_USER_SETTINGS,section:U.JJy.HERO,object:U.ZSU.CARD},videoPlacement:"settings_header"})]})}var m4=i(315629),m8=i(524170);function m7(){let e=(0,g.bG)([id.default],()=>id.default.getCurrentUser());if(null==e||uc.Ay.hasFreeBoosts(e))return null;let t=tI.A.getArticleURL(U.MVz.GUILD_BOOSTING_FAQ);return(0,E.jsxs)(m4.h,{color:"nitro-pink",className:m8.vK,children:[(0,E.jsxs)("div",{className:m8.nw,children:[(0,E.jsx)("img",{alt:"",className:m8.q3,src:mF}),(0,E.jsxs)("div",{className:m8.Tm,children:[(0,E.jsx)(es.E,{variant:"heading-md/semibold",color:"text-default",tag:"span",children:j.intl.format(j.t.Idh1Vs,{count:sq.M4,boostCount:sq.M4})}),(0,E.jsxs)("div",{className:m8.xv,children:[(0,E.jsx)(ui.t,{className:m8.nE}),(0,E.jsx)(es.E,{variant:"text-xs/semibold",color:"text-subtle",children:j.intl.format(j.t["6UAu+f"],{count:sq.M4,boostCount:sq.M4,helpdeskArticle:t})})]})]})]}),(0,E.jsx)(eG.$,{variant:"expressive",size:"sm",icon:ui.t,text:j.intl.string(j.t["8x0jKT"]),onClick:mv.e})]})}var m9=i(738262);function Ae(){let e=(0,g.bG)([gH.A],()=>gH.A.affinities),t=(0,g.bG)([eg.Ay],()=>eg.Ay.getFlattenedGuildIds()),i=S.useMemo(()=>{let i=e.slice(0,3).map(e=>e.guildId);for(let e=0;e<t.length&&i.length<3;e++){let n=t[e];i.includes(n)||i.push(n)}return i},[e,t]);return 0===i.length?null:(0,E.jsxs)("div",{className:m9.i,children:[(0,E.jsx)(eP.D,{variant:"heading-md/semibold",children:j.intl.string(j.t.r90Wgo)}),(0,E.jsx)("div",{className:m9.k,children:i.map(e=>(0,E.jsx)(mk,{guildId:e},e))})]})}var At=i(553429);function Ai(e){let{count:t,disabledReason:n}=e,s=tI.A.getArticleURL(U.MVz.GUILD_BOOSTING_FAQ);return(0,E.jsxs)(m4.h,{color:"nitro-pink",className:At.vK,children:[(0,E.jsxs)("div",{className:At.nw,children:[(0,E.jsxs)("div",{className:At.MD,children:[(0,E.jsx)("img",{alt:"",className:At.F8,src:mF}),(0,E.jsx)("div",{className:e6()(At.qS,"theme-dark"),children:(0,E.jsx)("span",{className:At.Vv,children:t})})]}),(0,E.jsxs)("div",{className:At.Tm,children:[(0,E.jsx)(es.E,{variant:"heading-md/semibold",color:"text-default",tag:"span",children:j.intl.format(j.t.KewnLu,{count:t,boostCount:t})}),(0,E.jsxs)("div",{className:At.xv,children:[(0,E.jsx)(ui.t,{className:At.nE}),(0,E.jsx)(es.E,{variant:"text-xs/semibold",color:"text-subtle",children:j.intl.format(j.t["6UAu+f"],{count:sq.M4,boostCount:sq.M4,helpdeskArticle:s})})]})]})]}),(0,E.jsx)(mh.A,{shouldShow:null!=n,text:n??"","aria-label":n,children:e=>(0,E.jsx)(eG.$,{...e,variant:"primary",size:"sm",icon:gE._,text:j.intl.string(j.t.BMx1iy),disabled:null!=n,onClick:()=>{(0,K.openModalLazy)(async()=>{let{default:e}=await Promise.resolve().then(i.bind(i,770101));return t=>(0,E.jsx)(e,{...t,onSelectGuild:e=>{t.onClose(),(0,mS.g)({analyticsLocations:[],analyticsLocation:{page:U.liQ.GUILD_BOOSTING_USER_SETTINGS,section:U.JJy.SETTINGS_PREMIUM,object:U.ZSU.BUTTON_CTA,objectType:U.AnalyticsObjectTypes.BUY},guild:e})}})})}})})]})}function An(e){let{premiumSubscription:t}=e,i=(0,g.bG)([gK.A],()=>gK.A.boostSlots),n=S.useMemo(()=>Object.values(i),[i]),s=(0,g.bG)([id.default],()=>id.default.getCurrentUser()),l=(0,g.bG)([gH.A],()=>gH.A.affinities),r=(0,g.bG)([eg.Ay],()=>eg.Ay.getFlattenedGuildIds()),a=l.length>0||r.length>0,o=S.useMemo(()=>n.filter(e=>null!=e.premiumGuildSubscription),[n]).length,u=(0,g.bG)([gf.A],()=>gf.A.getCurrentUserAppliedBoosts()),{fractionalState:d}=(0,gN.A)({forceFetch:!0}),c=s?.isPremiumGroupMember(),m=t?.isPausedOrPausePending===!0&&d===sq.xc.NONE,A=S.useMemo(()=>n.some(e=>null==e.premiumGuildSubscription&&e.isAvailable()),[n]),h=m?j.intl.string(j.t.mOWsF1):A?void 0:j.intl.string(j.t.xr4m5B),T=S.useMemo(()=>{if(null==t)return 0;let e=uc.Ay.getNumIncludedPremiumGuildSubscriptionSlots(t.planId);return 0===e||e!==n.length?0:Math.max(0,e-o)},[t,n.length,o]);return(0,E.jsxs)("div",{className:mD.GO,children:[(0,E.jsx)(d2.kb,{className:mD.ek}),(0,E.jsx)(m5,{}),(0,E.jsx)(m7,{}),T>0&&(0,E.jsx)(Ai,{count:T,disabledReason:h}),c&&(0,E.jsx)(gX.A,{}),!a&&(0,E.jsx)(mA,{}),(0,E.jsxs)("div",{className:mD.C_,children:[(0,E.jsx)(mZ,{guildBoostSlots:n,guildBoostSlotsByGuildId:i,premiumSubscription:t,pausedAppliedGuildBoosts:u,fractionalPremiumState:d}),(0,E.jsx)(Ae,{}),(0,E.jsx)(mG.A,{hideHeading:!0,hideTier0:!0}),(0,E.jsx)(mJ,{}),(0,E.jsx)(m1,{})]})]})}var As=i(672140);let Al=(0,a.E2)(u.X.PREMIUM_GUILD_SUBSCRIPTIONS_SETTING,{Component:function(){let e=gp.useConfig({location:"UserSettingsPremiumGuildSubscriptions"}).enabled;S.useEffect(()=>{su.h.wait(()=>{dE.hP(),dE.$o(),(0,gS.CD)(),(0,gT.zS)(null,null,U.tF5.DISCOVERY),(0,gS.tO)(!0)})},[]);let{hasFetchedSubscriptions:t,premiumSubscription:i}=(0,g.cf)([dZ.A],()=>({hasFetchedSubscriptions:dZ.A.hasFetchedSubscriptions(),premiumSubscription:dZ.A.getPremiumTypeSubscription()})),n=(0,gx.Y)(),s=(0,g.bG)([dW.A],()=>dW.A.hasFetchedPaymentSources),l=(0,g.bG)([gf.A],()=>gf.A.isFetchingCurrentUserAppliedBoosts),r=!t||!n||!s||l,[a,o]=S.useState(!1);return(r||a||o(!0),r&&!a)?(0,E.jsx)("div",{className:e6()(As.kL,As.Lq),children:(0,E.jsx)(dd.y,{})}):(0,E.jsxs)("div",{className:As.kL,children:[(0,E.jsx)("div",{className:As.Tp}),(0,E.jsx)("div",{className:As.Qs,children:e?(0,E.jsx)(An,{premiumSubscription:i}):(0,E.jsx)(mP,{premiumSubscription:i})})]})},useSearchTerms:()=>[j.intl.string(j.t["+CbP2v"]),j.intl.string(j.t.Nn1lJy)]}),Ar=(0,a.zZ)(u.X.PREMIUM_GUILD_SUBSCRIPTIONS_CATEGORY,{buildLayout:()=>[Al]}),Aa=(0,a.t_)(u.X.PREMIUM_GUILD_SUBSCRIPTIONS_PANEL,{useTitle:()=>j.intl.string(j.t["+CbP2v"]),buildLayout:()=>[Ar]}),Ao=(0,a.i4)(u.X.PREMIUM_GUILD_SUBSCRIPTIONS_SIDEBAR_ITEM,{useTitle:()=>j.intl.string(j.t["+CbP2v"]),icon:gE._,buildLayout:()=>[Aa]});var Au=i(153659),Ad=i(155984),Ac=i(357758),Ag=i(262077),Am=i(696986),AA=i(898555);function Ah(e){let{onClickManageSubscription:t,count:i}=e;return(0,E.jsxs)("div",{children:[(0,E.jsx)(eP.D,{variant:"heading-md/bold",children:j.intl.string(j.t["KzCF/6"])}),(0,E.jsx)(Am.h,{size:4}),(0,E.jsx)(es.E,{variant:"text-md/normal",className:AA.yV,children:j.intl.string(j.t["3D7qCu"])}),(0,E.jsx)(Am.h,{size:24}),(0,E.jsxs)("div",{className:AA.Nr,children:[(0,E.jsx)("img",{src:"/assets/5a420feed295b595.svg",alt:"",className:AA.RI}),(0,E.jsxs)("div",{className:AA.FS,children:[(0,E.jsx)(eP.D,{variant:"heading-xl/semibold",className:AA.wx,children:j.intl.string(j.t["KzCF/6"])}),(0,E.jsx)(es.E,{variant:"text-md/normal",className:AA.h_,children:j.intl.format(j.t["m+pcOO"],{numSubscriptions:i})})]}),(0,E.jsx)(eG.$,{size:"sm",variant:"overlay-primary",text:j.intl.string(j.t["3a8Xxj"]),onClick:t})]})]})}var AE=i(872351),AS=i(9113),AT=i(599941),Ax=i(384684),Ap=i(2242);let Af=[];var AN=i(885574),A_=i(912851),AI=i(497267);let AC=function(e){let{label:t,onClick:i,submitting:n}=e;return(0,E.jsx)(en.D,{onClick:n?void 0:i,className:AI.x6,children:(0,E.jsxs)("div",{className:AI.hQ,children:[n?(0,E.jsx)(dd.y,{type:dd.y.Type.PULSING_ELLIPSIS,className:AI.__invalid_spinner}):(0,E.jsx)(es.E,{variant:"text-md/medium",className:AI.Pf,children:t}),(0,E.jsx)(el.a,{size:"md",color:"currentColor",className:AI.UE})]})})};var Ab=i(465932),Av=i(543767),Ay=i(951555),Aj=i(790284),AO=i(636194),AR=i(624456),AL=i(710144),AD=i(815332),AP=i(162093),AG=i(960309);function AM(e){let{transitionState:t,groupListing:i,listing:n,subscription:s,onClose:l}=e,r=(0,sW.GV)(),{analyticsLocations:a}=(0,nQ.Ay)(e1.A.GUILD_ROLE_SUBSCRIPTION_CANCELLATION_MODAL),{cancelSubscription:o,error:u,submitting:d}=function(e){let[t,i]=S.useState(!1),[n,s]=S.useState(null);return{cancelSubscription:async function(t){try{return i(!0),await dE.M2(t,e),!0}catch(e){s(e)}finally{i(!1)}},error:n,submitting:t}}(a);async function c(){await o(s.id)&&l()}let g=n.role_benefits.benefits.filter(e=>e.ref_type===Ap.bN.CHANNEL),m=n.role_benefits.benefits.filter(e=>e.ref_type===Ap.bN.INTANGIBLE),A=rt()(s.currentPeriodEnd).format("MMMM Do, YYYY"),h=j.intl.formatToPlainString(j.t.KsMRP5,{numChannels:g.length,numAdditionalBenefits:m.length,subscriptionEndDate:A});return(0,E.jsx)(rX.Modal,{transitionState:t,"aria-labelledby":r,actions:[{text:j.intl.string(j.t.EP6EPb),variant:"secondary",onClick:l},{variant:"critical-primary",text:j.intl.string(j.t.F6lUDF),onClick:c,loading:d}],title:j.intl.string(j.t.O6l5tM),subtitle:h,onClose:l,children:(0,E.jsxs)(Q.B,{gap:8,children:[null!=u?(0,E.jsx)(q.w,{type:"critical",children:u.message}):null,(0,E.jsx)(AP.x,{listingId:n.id,guildId:i.guild_id,className:AG.P})]})})}var AU=i(319225),AV=i(746080),Ak=i(74669);function Aw(e){let{label:t,value:i,showInfoIcon:n,infoIconTooltipText:s}=e;return(0,E.jsxs)("div",{className:Ak.L0,children:[(0,E.jsxs)("div",{className:Ak.a5,children:[(0,E.jsx)(eP.D,{variant:"heading-deprecated-12/semibold",className:Ak.HU,children:t}),n&&(0,E.jsx)(tr.m,{text:s,children:(0,E.jsx)(AN.m,{size:"xs",color:"currentColor",className:Ak.Mo})})]}),(0,E.jsx)(eP.D,{variant:"heading-xl/semibold",className:Ak.sx,children:i})]})}function AF(e){let{subscription:t}=e,{analyticsLocations:i}=(0,nQ.Ay)(),[n]=(0,Av.YV)({subscriptionId:t.id,renewal:!0,analyticsLocations:i,analyticsLocation:e1.A.GUILD_ROLE_SUBSCRIPTION_PAYMENT_SOURCE_WITH_INVOICE}),s=(0,g.bG)([dW.A],()=>dW.A.hasFetchedPaymentSources);return null!=n&&s?(0,E.jsx)(Ay.A,{subscription:t,currentInvoicePreview:n}):(0,E.jsx)(dd.y,{})}function AB(e){let{isTrial:t,isCancelled:i,isResubscribing:n,shouldHideRoleSubscriptionEntryPoints:s,onCancelSubscriptionClick:l,onResubscribeClick:r,onChangePlanClick:a}=e;return i&&(t||s)?null:(0,E.jsx)(s6.D,{label:j.intl.string(j.t["4neDM+"]),children:(0,E.jsx)("div",{className:Ak.__invalid_rowButtons,children:i?(0,E.jsx)(eG.$,{variant:"primary",text:j.intl.string(j.t.y3mAE4),onClick:r,loading:n}):(0,E.jsxs)(E.Fragment,{children:[!t&&!s&&(0,E.jsx)(AC,{label:j.intl.string(j.t.FRbWR8),onClick:a}),(0,E.jsx)(AC,{label:j.intl.string(j.t.Dx0lF7),onClick:l})]})})})}let Az=function(e){let{subscription:t}=e,{listing:i,groupListing:n,guild:s,expanded:l,handleToggleExpanded:r,subscriptionInfo:a}=function(e){let t=(0,AR.M)(e),i=(0,g.bG)([AO.A],()=>AO.A.getSubscriptionListingForPlan(t)),n=(0,g.bG)([AO.A],()=>null!=i?AO.A.getSubscriptionGroupListingForSubscriptionListing(i.id):null),s=(0,g.bG)([ec.A],()=>ec.A.getGuild(n?.guild_id)),[l,r]=S.useState(!1),{fetchSubscriptionsSettings:a}=(0,AT.XE)();S.useEffect(()=>{l&&null!=s&&null==AO.A.getSubscriptionSettings(s.id)&&a(s.id)},[l,s,a]);let o=null==i?void 0:function(e){let{subscription:t}=e,i=rt()(t.currentPeriodEnd).format("M/D/YY"),n=null!=t.price?(0,dp.$g)(t.price,t.currency):"",s=rt()(t.createdAt).format("M/D/YY"),l=t.status===U.Dmq.CANCELED,r=t.status===U.Dmq.PAST_DUE,a=t.hasActiveTrial;return{memberSince:s,nextRenewalDate:i,nextRenewalLabel:l?j.intl.string(j.t.UAfot2):j.intl.string(j.t.CVjLcM),subscriptionPrice:n,isCancelled:l,isPastDue:r,isTrial:a}}({subscription:e});return{guild:s,expanded:l,handleToggleExpanded:function(){return r(e=>!e)},listing:i,groupListing:n,subscriptionInfo:o}}(t),[o,d]=S.useState(!1),c=(0,sW.GV)(),{analyticsLocations:m}=(0,nQ.Ay)(),{shouldHideGuildPurchaseEntryPoints:A}=(0,Ab.MH)(s?.id),h=t?.isPurchasedViaAppleGeneric;if(null==n||null==i||null==a)return null;async function T(){try{d(!0),await dE.QP(t,m),(0,AU.E)({title:j.intl.string(j.t.oPV2cy),body:j.intl.string(j.t.DdRizV)})}finally{d(!1)}}let{isCancelled:x,isPastDue:p,subscriptionPrice:f,memberSince:N,nextRenewalDate:_,nextRenewalLabel:I,isTrial:C}=a,b=i.soft_deleted||null==s||h;return(0,E.jsxs)("div",{className:Ak.kL,children:[(0,E.jsx)(AL.A,{onClick:r,className:Ak.N1,children:e=>{let{areaRef:t,handleStopPropagation:n}=e;return(0,E.jsxs)(E.Fragment,{children:[null!=s&&(0,E.jsx)(g8.Ay,{guild:s,active:!0,size:g8.Ay.Sizes.MEDIUM}),(0,E.jsxs)("div",{className:Ak.if,children:[(0,E.jsx)(es.E,{variant:"text-md/medium",className:Ak.J5,children:null!=s?s.name:j.intl.string(j.t["He+cmd"])}),(0,E.jsxs)("div",{className:Ak.xp,children:[(0,E.jsx)(es.E,{variant:"text-sm/normal",className:Ak.KR,children:i.name}),x?(0,E.jsx)(sm.Lp,{text:j.intl.string(j.t["7uFZGt"])}):C?(0,E.jsx)(sm.Lp,{text:j.intl.string(j.t["6anton"]),color:er.A.unsafe_rawColors.BRAND_500.css}):p?(0,E.jsx)(tr.m,{text:j.intl.string(j.t.eSuJE2),children:(0,E.jsx)("div",{children:(0,E.jsx)(sm.Lp,{className:Ak.qc,text:j.intl.string(j.t.NrRwIl),color:er.A.unsafe_rawColors.YELLOW_300.css})})}):null,h?(0,E.jsx)(tr.m,{text:j.intl.string(j.t.nv1IqK),children:(0,E.jsx)("div",{children:(0,E.jsx)(sm.Lp,{text:j.intl.string(j.t["sBl3X/"]),color:er.A.colors.BACKGROUND_MOD_MUTED.css})})}):null]})]}),(0,E.jsx)(en.D,{onClick:n(r),"aria-label":j.intl.string(j.t.e5eQOy),"aria-controls":c,"aria-expanded":l,focusProps:{ringTarget:t},children:(0,E.jsx)(el.a,{size:"md",color:"currentColor",className:e6()(Ak.D6,{[Ak.S7]:l})})})]})}}),null!=n&&l?(0,E.jsxs)("div",{id:c,children:[(0,E.jsx)("div",{className:Ak.yF}),(0,E.jsx)(AD.A,{groupListingId:n.id,subscription:t,className:Ak.kE}),(0,E.jsxs)("div",{className:Ak.Zx,children:[(0,E.jsx)(Aw,{label:I,value:_}),(0,E.jsx)(Aw,{label:j.intl.string(j.t.dltUMH),value:f,showInfoIcon:C,infoIconTooltipText:C?j.intl.string(j.t["/q6fpa"]):void 0}),(0,E.jsx)(Aw,{label:j.intl.string(j.t.AOcwWB),value:N})]}),(0,E.jsx)(Am.h,{size:16}),!x&&!h&&(0,E.jsx)(s6.D,{label:j.intl.string(j.t.wmMFvA),children:(0,E.jsx)(AF,{subscription:t})}),!b&&(0,E.jsx)(AB,{isTrial:C,isCancelled:x,isResubscribing:o,shouldHideRoleSubscriptionEntryPoints:A,onCancelSubscriptionClick:function(){if(null!=s&&null!=n&&null!=i){var e;e={groupListing:n,listing:i,subscription:t},(0,K.openModal)(t=>(0,E.jsx)(AM,{...t,...e}))}},onChangePlanClick:function(){null!=s&&((0,s5.pX)(U.BVt.CHANNEL(s.id,AV.VV.ROLE_SUBSCRIPTIONS)),(0,sX.default)(),A_.A.show(U.kqX.BACK_TO_PREVIOUS_SCREEN,void 0,j.intl.string(j.t.DvbaM4),()=>{Aj.A.setState({subsection:nB.nR}),(0,eH.openUserSettings)(u.X.SUBSCRIPTIONS_PANEL)}))},onResubscribeClick:T})]}):null]})};var AY=i(175880);let AX=function(e){let{onGoBack:t}=e,i=function(){let{ensureFresh:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,g.bG)([Ax.A],()=>(function(){let[e]=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[Ax.A],t=e.getGuildIdsWithPurchasableRoles(),i=!1;return(t.forEach(t=>{e.getUserSubscriptionRoles(t).size>0&&(i=!0)}),i)?Ap.M_.SUBSCRIBED:0===t.size?Ap.M_.NONE:Ap.M_.IN_SUBSCRIPTION_SERVER})([Ax.A]))===Ap.M_.SUBSCRIBED,i=(0,g.bG)([dZ.A],()=>dZ.A.getActiveGuildSubscriptions()),n=S.useRef(!1);return S.useEffect(()=>{(function(e){let{ensureFresh:t,hasFetched:i,hasRoleSubscriptions:n}=e,s=dZ.A.getActiveGuildSubscriptions();return(s?.length??0)===0&&!!n||!!t&&!i||!i&&!dZ.A.hasFetchedSubscriptions()})({ensureFresh:e,hasRoleSubscriptions:t,hasFetched:n.current})&&(n.current=!0,dE.hP())},[e,t]),i??Af}(),{loading:n}=(0,AT.eb)(i);return((0,AS.A)(d_.Fr?"role-subscriptions-user-setting":void 0),n)?(0,E.jsx)(dd.y,{}):0===i.length?null:(0,E.jsxs)("div",{children:[(0,E.jsx)(eG.$,{text:j.intl.string(j.t.hqyhKQ),icon:AE.z,variant:"secondary",onClick:t}),(0,E.jsx)(Am.h,{size:10}),(0,E.jsx)(iC.n,{label:j.intl.string(j.t["KzCF/6"]),description:j.intl.string(j.t["Y+ucR7"]),children:(0,E.jsx)("div",{className:AY.A,children:i.map(e=>(0,E.jsx)(Az,{subscription:e},e.id))})})]})};var AH=i(327479),AK=i(388567);function AW(e){let{onClickManageSubscription:t,count:i}=e;return(0,E.jsxs)("div",{children:[(0,E.jsx)(eP.D,{variant:"heading-md/bold",children:j.intl.string(j.t["48ywCu"])}),(0,E.jsx)(Am.h,{size:4}),(0,E.jsx)(es.E,{variant:"text-md/normal",className:AK.yV,children:j.intl.string(j.t.VWxmSo)}),(0,E.jsx)(Am.h,{size:24}),(0,E.jsxs)("div",{className:AK.Nr,children:[(0,E.jsx)("img",{src:"/assets/d6bcd13fb6c85425.svg",alt:"",className:AK._e}),(0,E.jsxs)("div",{className:AK.FS,children:[(0,E.jsx)(eP.D,{variant:"heading-xl/semibold",className:AK.wx,children:j.intl.string(j.t["48ywCu"])}),(0,E.jsx)(es.E,{variant:"text-md/normal",className:AK.h_,children:j.intl.format(j.t["/esXLj"],{numSubscriptions:i})})]}),(0,E.jsx)(AH.A,{onClick:t,text:j.intl.string(j.t["z5YcJ+"])})]})]})}var AZ=i(548411),Aq=i(417098),AQ=i(143582),AJ=i(915043),A$=i(46367);function A0(e){let{className:t,header:i,headerClassName:n,children:s}=e,l=S.useMemo(()=>{let e=!1;return S.Children.forEach(s,t=>{null!=t&&(e=!0)}),e},[s]);return(0,E.jsxs)("div",{className:e6()(A$.iE,t),children:[(0,E.jsx)("div",{className:e6()(A$.wx,n),children:i}),l&&(0,E.jsx)("div",{className:A$.Qs,children:s})]})}var A1=i(885996),A2=i(144165),A3=i(664121),A6=i(950305),A5=i(943775),A4=i(123791),A8=i(900797),A7=i(300118);let A9=S.createContext({isOpen:!1,toggleOpen:()=>{}});function he(e){let{children:t}=e,[i,n]=S.useReducer(e=>!e,!1),s=S.useMemo(()=>({isOpen:i,toggleOpen:n}),[i]);return(0,E.jsx)(A9.Provider,{value:s,children:t(i)})}he.Toggle=function(e){let{className:t,text:i}=e,{isOpen:n,toggleOpen:s}=S.useContext(A9),l=n?A8.t:el.a,r=null!=i?i:n?j.intl.string(j.t.fgq1gs):j.intl.string(j.t.XJuakA);return(0,E.jsxs)(en.D,{className:e6()(A7.L,t),onClick:s,children:[(0,E.jsx)(es.E,{variant:"heading-sm/semibold",tag:"div",color:"currentColor",children:r}),(0,E.jsx)(l,{size:"sm",color:"currentColor"})]})};var ht=i(243217),hi=i(328968),hn=i(163437),hs=i(3432);function hl(e){return e.toLocaleDateString(void 0,{dateStyle:"long"})}var hr=i(583995),ha=((s={})[s.LOADING=0]="LOADING",s[s.DONE=1]="DONE",s[s.ERROR=2]="ERROR",s);function ho(e){let{subscription:t,navigateToSwitchPlan:i,loadingState:n}=e,s=t.metadata?.application_subscription_guild_id,{renewalMutations:l,planId:r}=t,{appId:a,plan:o,storeListing:u,isGuildSubscription:d,subscriptionForGuild:c,sku:m,isCancelled:A,isOrphanedGuildSubscription:h,renewalPlan:x}=(0,g.cf)([cM.A,cU.A,hi.A,ec.A],()=>{let e,i=cM.A.get(r),n=null!=i?cU.A.get(i.skuId):void 0,a=n?.applicationId,o=null!=i?hi.A.getForSKU(i.skuId):null,u=null!=o&&(0,hn.PJ)(o.skuFlags),d=u&&null!=s?ec.A.getGuild(s):void 0,c=(0,hn.Uo)(t,n),g=u&&null!=s&&null==d;if(!1===c&&null!=l&&l.items.length>0){let t=l.items[0];e=cM.A.get(t.planId)??void 0}return{appId:a,isGuildSubscription:u,isOrphanedGuildSubscription:g,plan:i,sku:n,storeListing:o,subscriptionForGuild:d,isCancelled:c,renewalPlan:e}},[s,r,l,t]),{data:p}=(0,T.YY)(a),f=S.useMemo(()=>null!=p?(0,A5.A)(p,100):null,[p]),N=m?.deleted??!1,_=null!=m&&(0,hn.Se)(m),I=t.status===U.Dmq.PAST_DUE,{analyticsLocations:C}=(0,nQ.Ay)(),[b]=(0,Av.YV)({subscriptionId:t.id,renewal:!0,analyticsLocations:C,analyticsLocation:e1.A.APP_SUBSCRIPTION_PAYMENT_SOURCE_WITH_INVOICE}),v=hl(t.currentPeriodEnd),y=0===n;return(0,E.jsxs)(A0,{headerClassName:hr.dL,header:!1===y?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)("div",{className:hr.VW,children:[null!=f&&(0,E.jsx)(A2._,{src:f.href,imageClassName:hr.Z2,width:40,height:40}),(0,E.jsxs)("div",{className:hr.aF,children:[(0,E.jsx)(eP.D,{variant:"heading-md/semibold",lineClamp:1,children:p?.name??j.intl.string(j.t["7kqy7W"])}),(0,E.jsx)(es.E,{variant:"text-sm/medium",color:"text-default",lineClamp:1,children:o?.name??j.intl.string(j.t.sqkbMK)})]})]}),(0,E.jsx)("div",{className:hr.Pz,children:null!=p&&null!=u&&null!=m&&(0,E.jsx)(hm,{subscription:t,app:p,guild:c,sku:m,storeListing:u,isCancelled:A,isOrphanedGuildSubscription:h,navigateToSwitchPlan:i,renewalSkuId:x?.skuId})})]}):(0,E.jsx)(dd.y,{type:dd.t.PULSING_ELLIPSIS}),children:[A&&(0,E.jsx)(hg,{type:"warning",title:_?j.intl.formatToPlainString(j.t.QOnM1y,{subscriptionPeriodEnd:v}):j.intl.formatToPlainString(j.t.HOaZu8,{subscriptionPeriodEnd:v})}),!A&&h&&(0,E.jsx)(hg,{type:"warning",title:j.intl.string(j.t.SmSP8Q)}),I&&(0,E.jsx)(hg,{type:"danger",title:j.intl.string(j.t.fvOqBo)}),(0,E.jsxs)("div",{className:hr.zH,children:[(0,E.jsx)(hc,{title:j.intl.string(j.t["5D/KEH"]),content:d?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)("span",{className:hr.yW,children:[(0,E.jsx)(A3.R,{size:"xs"}),j.intl.string(j.t.QjL3vn)]}),null!=c&&(0,E.jsxs)("span",{className:hr._t,children:[(0,E.jsx)(es.E,{variant:"text-sm/normal",color:"text-muted",children:j.intl.format(j.t["7ZD8p1"],{guildName:c.name})}),(0,E.jsx)(g8.Ay,{guild:c,size:g8.Ay.Sizes.MINI})]})]}):(0,E.jsxs)("span",{className:hr.yW,children:[(0,E.jsx)(A6.n,{size:"xs"}),j.intl.string(j.t["6anEVv"])]})}),(0,E.jsx)(hu,{invoicePreview:b,subscriptionPlan:o}),(0,E.jsx)(hc,{title:j.intl.string(j.t.dnUzb6),content:hl(t.createdAt??t.currentPeriodStart)}),(0,E.jsx)(hd,{isCancelled:A,subscriptionPeriodEnd:v,renewalPlan:x})]}),(0,E.jsx)(hh,{subscription:t,currentInvoicePreview:b,loadingState:n,isDeleted:N,isCancelled:A}),null!=p&&u?.benefits!=null&&u.benefits.length>0&&(0,E.jsx)(hA,{appId:p.id,listingBenefits:u.benefits})]})}function hu(e){let{subscriptionPlan:t,invoicePreview:i}=e;if(null==t)return(0,E.jsx)(hc,{title:j.intl.string(j.t.KI7ERx),content:""});let n=(0,dp.CE)((0,dp.$g)(t.price,t.currency),t.interval,t.intervalCount),s=i?.findInvoiceItemByPlanId(t.id);if(null==s)return(0,E.jsx)(hc,{title:j.intl.string(j.t.KI7ERx),content:n});let l=(0,dp.CE)((0,dp.$g)(s.subscriptionPlanPrice,t.currency),t.interval,t.intervalCount);return(0,E.jsx)(hc,{title:j.intl.string(j.t.KI7ERx),content:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(es.E,{variant:"text-sm/semibold",children:l}),l!==n&&(0,E.jsx)(tr.m,{text:j.intl.format(j.t["6DoE57"],{listPrice:n}),position:"bottom",children:(0,E.jsx)(es.E,{variant:"text-xs/medium",color:"text-muted",children:(0,E.jsx)("s",{children:n})})})]})})}function hd(e){let{isCancelled:t,subscriptionPeriodEnd:i,renewalPlan:n}=e;if(null!=n){let e=(0,dp.CE)((0,dp.$g)(n.price,n.currency),n.interval,n.intervalCount);return(0,E.jsx)(hc,{title:j.intl.string(j.t.hIhAM3),content:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(es.E,{variant:"text-sm/medium",children:i}),(0,E.jsx)(es.E,{variant:"text-sm/normal",children:j.intl.format(j.t.MCLbvj,{planName:n.name,price:e})})]})})}return(0,E.jsx)(hc,{title:t?j.intl.string(j.t.enxcAl):j.intl.string(j.t["Ms+6Zq"]),content:i})}function hc(e){let{title:t,content:i}=e;return(0,E.jsxs)("div",{className:hr.nM,children:[(0,E.jsx)(es.E,{variant:"text-sm/medium",children:t}),(0,E.jsx)(es.E,{variant:"text-sm/medium",className:hr.u4,children:i})]})}function hg(e){let{type:t,title:i}=e;return(0,E.jsx)(t_.p,{messageType:"warning"===t?t_.Y.WARNING:t_.Y.ERROR,className:hr.Xm,children:(0,E.jsx)(es.E,{variant:"text-sm/normal",children:i})})}function hm(e){let{app:t,storeListing:n,sku:s,subscription:l,isCancelled:r,isOrphanedGuildSubscription:a,guild:o,renewalSkuId:u,navigateToSwitchPlan:d}=e,c=(0,hn.Se)(s),{analyticsLocations:m}=(0,nQ.Ay)(),[A,h]=S.useState(!1),T=(0,A4.C)(t.id),x=(0,g.bG)([cU.A],()=>cU.A.getParentSKU(n.skuId),[n.skuId]),p=S.useMemo(()=>{var e,t;let i;return null==x?[]:(e=n.id,t=T.subscriptions,i=new Set(x.bundledSkuIds),t.filter(t=>t.id!==e&&i.has(t.skuId)))},[n.id,T,x]),f=0!==p.length;async function N(){try{h(!0);let{subscription:e}=await (0,dE.QP)(l,m);if(null==e)return;(0,K.openModalLazy)(async()=>{let{default:t}=await Promise.all([i.e("76229"),i.e("52396")]).then(i.bind(i,115623));return i=>(0,E.jsx)(t,{...i,storeListing:n,subscription:ht.A.createFromServer(e)})})}finally{h(!1)}}return(0,E.jsxs)("div",{className:hr.fw,children:[c||r&&a?null:r?(0,E.jsx)(eG.$,{variant:"secondary",size:"sm",text:j.intl.string(j.t.QtMnkW),onClick:N,loading:A}):(0,E.jsx)(eG.$,{variant:"secondary",size:"sm",text:j.intl.string(j.t["E8G/tr"]),onClick:function(){(0,K.openModalLazy)(async()=>{let{default:e}=await Promise.all([i.e("52266"),i.e("22800")]).then(i.bind(i,301139));return i=>(0,E.jsx)(e,{...i,application:t,storeListing:n,subscription:l,guild:o})})}}),f&&null!=x&&!1===r&&!1===a&&(0,E.jsx)(eG.$,{variant:"primary",size:"sm",text:j.intl.string(j.t.R74ZBR),onClick:()=>{d({currentSubscription:l,alternativeListings:p,app:t,subscriptionGroup:x,currentListing:n,renewalSkuId:u})}})]})}function hA(e){let{appId:t,listingBenefits:i}=e;return(0,E.jsx)(he,{children:e=>(0,E.jsxs)("div",{className:hr.PX,children:[(0,E.jsxs)("div",{className:hr.wV,children:[e&&(0,E.jsx)(es.E,{variant:"text-sm/semibold",children:j.intl.string(j.t.mORL67)}),(0,E.jsx)(he.Toggle,{className:hr.Bh,text:e?j.intl.string(j.t.gsbFAw):j.intl.string(j.t.IwjfxV)})]}),e?i.map(e=>{let{id:i,name:n,description:s,icon:l}=e;return(0,E.jsx)(A1.FY,{header:n,icon:(0,hs.N)(t,l),description:s},i)}):null]})})}function hh(e){let{subscription:t,currentInvoicePreview:i,loadingState:n,isDeleted:s,isCancelled:l}=e;return null==i?null:0===n?(0,E.jsx)("div",{className:hr.Ji,children:(0,E.jsx)(s6.D,{label:j.intl.string(j.t.azZaZa),children:(0,E.jsx)(dd.y,{type:dd.t.PULSING_ELLIPSIS})})}):2===n?(0,E.jsx)("div",{className:hr.Ji,children:(0,E.jsxs)(Aq.$T,{color:Aq.Hv.DANGER,style:{borderRadius:0},children:[j.intl.format(j.t.IIHUUF,{subscriptionId:t.id}),(0,E.jsx)("br",{}),j.intl.format(j.t.fh65ES,{helpLink:"https://support.discord.com/hc/en-us"})]})}):(0,E.jsx)("div",{className:hr.Ji,children:(0,E.jsx)(s6.D,{label:j.intl.string(j.t.azZaZa),children:(0,E.jsx)(Ay.A,{subscription:t,currentInvoicePreview:i,disabled:s||l})})})}var hE=((l={}).HOME="HOME",l.SWITCH_APP_PLANS="SWITCH_APP_PLANS",l);i(938796);var hS=i(38405);let hT=(0,g.UT)(cM.A,{getQueryId:U.fic.SUBSCRIPTION_PLANS,get:e=>{if(null==e)return null;let t=cM.A.getForSKU(e);return 0===t.length?null:t},load:e=>(null==e&&hS.A.addBreadcrumb({message:"Error loading subscription plans: skuId is null"}),null!=e?(0,gT.ur)(e).then(()=>{}):Promise.reject())});var hx=i(240248),hp=i(237218),hf=i(242653);function hN(e){let{children:t,lineClamp:i=2,...n}=e,[s,l]=S.useState(!1),[r,a]=S.useState(null),o=null!=r&&(0,E.jsx)("button",{className:hf.x6,onClick:()=>l(e=>!e),children:(0,E.jsxs)(es.E,{className:hf.B0,variant:"text-sm/medium",color:"text-brand",children:[s?j.intl.string(j.t["JQX/Pb"]):j.intl.string(j.t.Fbrd8J),s?(0,E.jsx)(A8.t,{color:er.A.colors.TEXT_BRAND,size:"xs"}):(0,E.jsx)(el.a,{color:er.A.colors.TEXT_BRAND,size:"xs"})]})}),[u,d]=S.useState(null),c=S.useCallback(()=>{if(null==u)return;let{scrollHeight:e,clientHeight:t}=u;e>t&&a({truncatedHeight:t,expandedHeight:e})},[u]);S.useEffect(()=>{requestAnimationFrame(c)},[c,t,i]);let g="auto";return null!=r&&(g=s?`${r.expandedHeight}px`:`${r.truncatedHeight}px`),(0,E.jsxs)("div",{children:[(0,E.jsx)(es.E,{...n,className:hf.Qs,lineClamp:s?void 0:i,ref:d,style:{height:g},children:t}),o]})}var h_=i(386447);function hI(e){let{cta:t,storeListing:i,className:n}=e,{applicationId:s,benefits:l,description:r}=i,a=S.useMemo(()=>null==i.thumbnail?null:(0,hp.t)(s,i.thumbnail,256),[s,i.thumbnail]),{data:o}=hT(i.skuId),u=S.useMemo(()=>{if(null==o||0===o.length)return null;let e=o[0];return(0,dp._J)(e)},[o]);return null==u?null:(0,E.jsxs)(A0,{className:e6()(h_.iE,n),header:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)("div",{className:h_.qd,children:[null!=a&&(0,E.jsx)(A2._,{src:a.href,imageClassName:h_.rW,width:48,height:48}),(0,E.jsxs)("div",{children:[(0,E.jsx)(eP.D,{variant:"heading-md/bold",children:i.summary}),(0,E.jsx)(es.E,{variant:"text-md/medium",children:u})]})]}),t]}),children:[!(0,hx.uJ)(r)&&(0,E.jsx)("div",{className:h_.h_,children:(0,E.jsx)(hN,{variant:"text-sm/medium",children:r})}),null!=l&&l.length>0&&(0,E.jsx)("div",{className:h_.PX,children:l.map(e=>{let{id:t,name:i,description:n,icon:l}=e;return(0,E.jsx)(A1.FY,{header:i,icon:(0,hs.N)(s,l),description:n},t)})})]})}var hC=i(185438),hb=i(711171);function hv(e){let{app:t,currentSubscription:i,currentListing:n,alternativeListings:s,navigateToHome:l,subscriptionGroup:r,renewalSkuId:a}=e,o=(0,A5.A)(t,100),u=(0,hn.PJ)(r.flags),d=u?A3.R:A6.n,c=u?j.intl.string(j.t["46YF2D"]):j.intl.string(j.t.fFyGiA),m=i.metadata?.application_subscription_guild_id,A=(0,g.bG)([ec.A],()=>u&&null!=m?ec.A.getGuild(m):void 0,[m,u]),h=(0,g.bG)([cU.A],()=>{if(null!=a)return cU.A.get(a)},[a]),S=hl(i.currentPeriodEnd);return(0,E.jsxs)("div",{children:[(0,E.jsxs)("div",{className:hb.wx,children:[null!=o&&(0,E.jsx)(A2._,{src:o.href,imageClassName:hb.Z2,width:48,height:48}),(0,E.jsxs)("div",{children:[(0,E.jsx)(eP.D,{variant:"heading-xl/semibold",children:t.name}),(0,E.jsxs)("div",{className:hb.p4,children:[(0,E.jsxs)(eP.D,{variant:"heading-md/normal",className:hb.N4,children:[(0,E.jsx)(d,{size:"xs",color:"currentColor"})," ",c]}),null!=A&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(es.E,{variant:"text-md/normal",children:"\u2022"}),(0,E.jsxs)("span",{className:hb.vP,children:[(0,E.jsx)(g8.Ay,{guild:A,size:g8.Ay.Sizes.SMOL}),(0,E.jsx)(eP.D,{variant:"heading-md/semibold",color:"text-muted",children:j.intl.format(j.t["7ZD8p1"],{guildName:A.name})})]})]})]})]})]}),(0,E.jsx)(he,{children:e=>(0,E.jsxs)("div",{className:hb._B,children:[(0,E.jsx)(es.E,{variant:"text-md/normal",children:j.intl.string(j.t["goe+hk"])}),e&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(es.E,{variant:"text-md/normal",children:j.intl.format(j.t["Q8qJ+5"],{})}),(0,E.jsx)(es.E,{variant:"text-md/normal",children:j.intl.format(j.t.sqowYz,{})})]}),(0,E.jsx)(he.Toggle,{text:e?j.intl.string(j.t["1Rkq/E"]):j.intl.string(j.t.WsTHkY)})]})}),(0,E.jsxs)("div",{className:hb.x0,children:[(0,E.jsx)(hI,{storeListing:n,className:hb.o3,cta:(0,E.jsxs)("div",{className:hb.cJ,children:[(0,E.jsx)(es.E,{variant:"eyebrow",color:"text-brand",children:j.intl.string(j.t.fHIpOY)}),null!=h&&(0,E.jsx)(es.E,{variant:"text-sm/semibold",color:"text-subtle",children:j.intl.format(j.t["OQk+jr"],{endDate:S})})]})}),s.map(e=>e.skuId===a?(0,E.jsx)(hI,{storeListing:e,cta:(0,E.jsx)(es.E,{variant:"text-sm/semibold",color:"text-subtle",children:j.intl.format(j.t.nn88hB,{startDate:S})})},e.id):(0,E.jsx)(hy,{storeListing:e,guildId:m,navigateToHome:l},e.id))]})]})}function hy(e){let{storeListing:t,guildId:i,navigateToHome:n}=e,{openModal:s}=(0,hC.A)({analyticsLocation:U.ThZ.APP_SUBSCRIPTIONS_MANAGEMENT,skuId:t.skuId,initialSubscribeForGuild:i,disableGuildSelector:!0,onComplete:n});return(0,E.jsx)(hI,{storeListing:t,cta:(0,E.jsx)(eG.$,{variant:"primary",size:"sm",text:j.intl.string(j.t["+KwmBt"]),onClick:s})})}class hj extends S.PureComponent{state={hasError:!1};static getDerivedStateFromError(e){return{hasError:!0}}render(){return this.state.hasError?(0,E.jsxs)(Aq.$T,{color:Aq.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 hO(e){let{subscriptions:t,updateHeader:i}=e,[n,s]=S.useState({route:hE.HOME}),{route:l}=n;function r(){s({route:hE.HOME})}let a=e=>{s({route:hE.SWITCH_APP_PLANS,...e}),i(j.intl.string(j.t.VFqtkP),r)},[o,u]=S.useState({});S.useEffect(()=>{for(let e of t){let t=e.items[0]?.planId;null!=t&&(u(t=>({...t,[e.id]:ha.LOADING})),(0,AQ._R)(t).then(()=>{u(t=>({...t,[e.id]:ha.DONE}))}).catch(()=>{u(t=>({...t,[e.id]:ha.ERROR}))}))}},[t]);let{loadState:d}=(0,AJ.E)(),c=d!==AJ.mJ.LOADED;switch(l){case hE.HOME:return(0,E.jsx)(E.Fragment,{children:t.map(e=>(0,E.jsx)(hj,{subscription:e,children:(0,E.jsx)(ho,{subscription:e,navigateToSwitchPlan:a,loadingState:c?ha.LOADING:o[e.id]??ha.LOADING})},e.id))});case hE.SWITCH_APP_PLANS:let{route:g,...m}=n;return(0,E.jsx)(hv,{...m,navigateToHome:r});default:(0,N.xb)(l)}}var hR=i(131352);function hL(e){let{onGoBack:t}=e,i=(0,g.yK)([dZ.A],()=>dZ.A.getActiveApplicationSubscriptions()?.slice().sort((e,t)=>(e.createdAt?.getTime()??e.currentPeriodStart.getTime())-(t.createdAt?.getTime()??t.currentPeriodStart.getTime()))??[]),[n,s]=S.useState();return null==n&&(n=(0,E.jsx)(hD,{onBack:t,title:j.intl.string(j.t["DB/m9a"])})),(0,E.jsxs)("div",{children:[n,(0,E.jsx)("div",{className:hR.A,children:(0,E.jsx)(hO,{subscriptions:i,updateHeader:function(e,t){s((0,E.jsx)(hD,{title:e,onBack:()=>{t(),s(void 0)}}))}})})]})}function hD(e){let{onBack:t,title:i}=e;return(0,E.jsxs)("div",{className:hR.D,children:[(0,E.jsx)(rB.K,{"aria-label":j.intl.string(j.t["13/7kX"]),icon:()=>(0,E.jsx)(AZ.Z,{size:"sm"}),onClick:t,variant:"icon-only"}),(0,E.jsx)(eP.D,{variant:"heading-lg/semibold",children:i})]})}var hP=i(881489),hG=i(366999),hM=i(466919),hU=i(406252);function hV(e){let t,i,{showChargingUpState:n,rowValueText:s,endsAt:l,fractionalState:r,activationDate:a,hasPremiumGroup:o}=e;o?(t=j.intl.string(hM.default["/S02sx"]),i=j.intl.string(hM.default.OPJNST)):n?(t=j.intl.string(j.t["hT6i/0"]),i=null!=a?j.intl.format(j.t["0Vwb/l"],{activateDate:a}):null):(t=j.intl.string(j.t["3G0CTC"]),i=r===sq.xc.FP_SUB_PAUSED?j.intl.format(j.t.MMvaIG,{resumeDate:l.toDate()}):null);let u=e6()({[hU.Hs]:n,[hU.mT]:!n}),d=e6()({[hU.CQ]:n,[hU.ZM]:!n}),c=e6()({[hU.EM]:!n});return(0,E.jsxs)("div",{className:hU.r6,children:[(0,E.jsxs)("div",{className:hU.Nv,children:[(0,E.jsx)(eP.D,{variant:"heading-md/semibold",className:c,children:t}),null!==i&&(0,E.jsx)(es.E,{variant:"text-sm/normal",children:i})]}),!o&&(0,E.jsx)("div",{className:hU.ZS,children:(0,E.jsx)("div",{className:u,children:(0,E.jsx)(es.E,{variant:"text-sm/semibold",className:d,children:s})})})]})}let hk=function(e){let{fractionalPremiumInfo:t,className:i,activationDate:n,hasPremiumGroup:s}=e,l=(0,uc.kX)(t),r=l.length>0,a=(0,hG.Ay)(t.endsAt,hG.yE.SHORT_TIME),o=r?l:a;return(0,E.jsx)("div",{children:(0,E.jsxs)("div",{className:e6()(i,hU.f8),children:[(0,E.jsx)("div",{className:hU.J_,children:(0,E.jsxs)("div",{className:hU.Bh,children:[(0,E.jsx)("div",{className:hU.xt,children:(0,E.jsx)(ui.t,{size:"md",color:"white",className:hU.T8})}),(0,E.jsx)("div",{className:hU.pt,children:(0,E.jsx)(eP.D,{variant:"heading-md/semibold",children:j.intl.string(j.t.DFMPWS)})}),(0,E.jsx)(es.E,{className:hU.PJ,variant:"text-md/semibold",children:l.length>0?l:j.intl.string(j.t["B66Z+f"])})]})}),(0,E.jsx)(hV,{showChargingUpState:r,rowValueText:o,endsAt:t.endsAt,fractionalState:t.fractionalState,activationDate:n,hasPremiumGroup:s})]})})};var hw=i(983048);function hF(e){let t,{user:i,planId:n,count:s,userPremiumSubscription:l,unconsumedFractionalPremiumUnits:r=[],hasPremiumGroup:a}=e,[o,u]=(0,g.yK)([cM.A],()=>[cM.A.get(n),null!=l?cM.A.get(l.planId):null]);if(null==o||uc.Ay.getInterval(n).intervalType!==sq.WT.MONTH)return null;let d=null!=u?u.skuId:null,c=o.skuId===d,m=uc.Ay.getDisplayName(n);if(a)t=j.intl.string(hM.default["5asczk"]);else if(c&&null!=l){let e;e=new Date(l.status===U.Dmq.PAUSED&&null!=l.pauseEndsAt?l.pauseEndsAt:l.currentPeriodEnd);let i=(0,uc._e)(e,r);t=j.intl.formatToPlainString(j.t["5CNRRA"],{date:i??0})}else t=j.intl.formatToPlainString(j.t.eNXZ5O,{planName:m});let A=i.hasFreePremium()||null!=l&&l.isPurchasedExternally;return(0,E.jsxs)("div",{className:hU.Bh,children:[(0,E.jsx)("div",{className:e6()({[hU.sr]:o.skuId===sq.pe.TIER_0,[hU.lP]:o.skuId===sq.pe.TIER_1,[hU.eb]:o.skuId===sq.pe.TIER_2}),children:(0,E.jsx)(ui.t,{size:"md",color:"currentColor",className:hU.Kk})}),(0,E.jsxs)("div",{className:hU.pt,children:[(0,E.jsx)(eP.D,{variant:"heading-md/semibold",children:j.intl.format(j.t.LzobT9,{planName:m})}),!A&&(0,E.jsx)(eP.D,{className:hU.gj,variant:"heading-sm/semibold",color:"text-default",children:t})]}),(0,E.jsx)(es.E,{className:hU.PJ,variant:"text-md/semibold",children:j.intl.format(j.t["ess/xl"],{count:s})})]})}let hB=function(e){let{className:t,entitlements:i}=e,n=eZ()(Array.from(i)).filter(e=>{let{subscriptionPlanId:t,parentId:i,consumed:n}=e;return null!=t&&null!=i&&!n}).groupBy(e=>e.subscriptionPlanId).value(),s=(0,g.yK)([c_.A],()=>c_.A.getUnactivatedFractionalPremiumUnits()),l=(0,g.bG)([dZ.A],()=>dZ.A.getPremiumSubscription()),r=(0,g.bG)([dZ.A],()=>null==dZ.A.getPremiumTypeSubscription()),a=Object.keys(n).some(e=>e===sq.gD.PREMIUM_MONTH_TIER_1),o=(0,g.bG)([id.default],()=>id.default.getCurrentUser());if(null==o)return null;let u=o.isPremiumWithPremiumGroup();return(0,E.jsxs)("div",{children:[(0,E.jsx)("div",{className:e6()(t,hU.xF,hU.J_),children:Object.keys(n).map(e=>(0,E.jsx)(hF,{planId:e,count:n[e].length,userPremiumSubscription:l,user:o,unconsumedFractionalPremiumUnits:s,hasPremiumGroup:u},e))}),a&&r&&(0,E.jsxs)("div",{children:[(0,E.jsx)(es.E,{className:hU.eT,variant:"text-md/normal",children:j.intl.string(j.t["VNr4+O"])}),(0,E.jsx)(hw.i,{})]})]})};var hz=i(830991);function hY(e){let t,{subscription:i,withOverheadSeparator:n}=e,{analyticsLocations:s}=(0,nQ.Ay)(),[l]=(0,Av.YV)({subscriptionId:i.id,renewal:!0,analyticsLocations:s,analyticsLocation:e1.A.PREMIUM_SUBSCRIPTION_FINE_PRINT_CONTENT});if(null==l)return null;let r=n?hz.r:hz.a,a=l.invoiceItems.find(e=>{let{subscriptionPlanId:t}=e;return(0,uc.xq)(t)});if(null==a)return null;let o=a.subscriptionPlanId,u=cM.A.get(o);tX()(null!=u,"Missing plan");let d=(0,dp.$g)(l.total,l.currency);return u.interval===sq.WT.YEAR?t=j.intl.format(j.t["jPz/39"],{price:d,termsUrl:U.X7G.TERMS,paidURL:U.X7G.PAID_TERMS,privacyUrl:U.X7G.PRIVACY}):u.interval===sq.WT.MONTH&&(t=1===u.intervalCount?j.intl.format(j.t.m27GpI,{price:d,termsUrl:U.X7G.TERMS,paidURL:U.X7G.PAID_TERMS,privacyUrl:U.X7G.PRIVACY}):j.intl.format(j.t["9xf5Vx"],{price:d,termsUrl:U.X7G.TERMS,paidURL:U.X7G.PAID_TERMS,privacyUrl:U.X7G.PRIVACY,intervalCount:u.intervalCount})),(0,E.jsx)(es.E,{color:"text-muted",className:r,variant:"text-xs/normal",children:t})}function hX(e){let{subscription:t,withOverheadSeparator:i}=e;return t.status===U.Dmq.CANCELED||t.isPurchasedExternally?null:(0,E.jsx)(hY,{subscription:t,withOverheadSeparator:i})}var hH=i(37397),hK=i(533792);let hW={[nB.nR]:"role_subscriptions_panel",[nB.PZ]:"application_subscriptions_panel"};function hZ(){return(0,E.jsx)(eb.Z,{className:hK.wb,type:eb.Z.Types.CUSTOM,children:(0,E.jsxs)(rq.A,{align:rq.A.Align.CENTER,children:[(0,E.jsx)(p.A,{game:null,size:p.M.SMALL,className:hK.pV}),(0,E.jsx)("span",{className:hK.O,children:j.intl.string(j.t["jy/hyj"])})]})})}function hq(e,t){return e===t||null==e&&null==t||null!=e&&null!=t&&(0,Ac._)(e,t)}function hQ(){let e=(0,g.bG)([c_.A],()=>c_.A.getForApplication(sq.tv),[],hq);return S.useEffect(()=>{(0,c0.LM)(sq.tv)},[]),(0,E.jsx)(iC.n,{label:j.intl.string(j.t["2GKrvn"]),description:j.intl.string(j.t.kNEjGm),children:null!=e&&uc.Ay.hasAccountCredit(e)?(0,E.jsx)(hB,{className:hK.fX,entitlements:e}):(0,E.jsx)(hZ,{})})}function hJ(){return(0,E.jsx)("hr",{className:hK.hr})}let h$=function(){var e;let t=(0,g.bG)([dZ.A],()=>dZ.A.getPremiumTypeSubscription()),i=(0,Ag.A)({subscriptionFilter:e=>hH.Hy.has(e.status)}),n=(0,g.bG)([id.default],()=>id.default.getCurrentUser()),s=i.length>1,l=(0,g.bG)([dW.A],()=>null!=t&&null!=t.paymentSourceId?dW.A.getPaymentSource(t.paymentSourceId):null,[t]),r=(0,g.bG)([dZ.A],()=>dZ.A.hasFetchedSubscriptions()),a=(0,g.bG)([dx.A],()=>dx.A.isBusy),o=(0,gx.Y)(),d=Aj.A.useField("subsection");S.useEffect(()=>{(0,l3._)(null!=d?hW[d]:u.X.SUBSCRIPTIONS_PANEL)},[d]);let c=(0,g.bG)([dZ.A],()=>dZ.A.getActiveApplicationSubscriptions()?.length??0),m=(0,g.bG)([dZ.A],()=>Object.values(dZ.A.getSubscriptions()??{}).filter(e=>e.type===U.rzx.GUILD).filter(e=>e.status!==U.Dmq.ENDED).length),A=(0,gN.A)({forceFetch:!0}),h=(0,hP.ds)(),T=null!==t?t.currentPeriodEnd:void 0,x=!(h&&!(A.unactivatedUnits.length>0))&&(A.fractionalState!==sq.xc.NONE||A.unactivatedUnits.length>0);return(S.useEffect(()=>(su.h.wait(()=>{(0,gT.zS)(),dE.hP(),(0,gS.CD)(),dE.$o()}),function(){Aj.A.resetState()}),[]),eF.A.enabled)?(0,E.jsx)(da.A,{}):r&&o?d===nB.nR?(0,E.jsx)(AX,{onGoBack:()=>Aj.A.setState({subsection:null})}):d===nB.PZ?(0,E.jsx)(hL,{onGoBack:()=>Aj.A.setState({subsection:null})}):(0,E.jsx)("div",{className:hK.kL,children:(0,E.jsxs)("div",{className:hK.Qs,children:[s?(0,E.jsx)(hH.Sb,{}):null,null!=t?(0,E.jsx)(hH.Ay,{subscription:t,paymentSource:l,busy:a,subscriptions:i}):(0,E.jsx)(hH.TC,{}),x&&(e=!!n?.isPremiumWithPremiumGroup(),(0,E.jsxs)("section",{children:[(0,E.jsx)(eP.D,{variant:"heading-md/bold",className:hK.HL,children:j.intl.string(j.t.Obre8v)}),(0,E.jsx)(es.E,{variant:"text-md/normal",className:hK.JU,children:j.intl.format(j.t["7Zi06b"],{helpCenterLink:tI.A.getArticleURL(U.MVz.FRACTIONAL_PREMIUM_ABOUT)})}),(0,E.jsx)(hk,{className:hK.fX,fractionalPremiumInfo:A,activationDate:T,hasPremiumGroup:e})]})),(0,E.jsx)(hQ,{}),m>0&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(hJ,{}),(0,E.jsx)(Ah,{count:m,onClickManageSubscription:()=>Aj.A.setState({subsection:nB.nR})})]}),c>0&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(hJ,{}),(0,E.jsx)(AW,{count:c,onClickManageSubscription:()=>{Aj.A.setState({subsection:nB.PZ}),G.default.track(U.HAw.PREMIUM_APPLICATION_SUBSCRIPTION_MANAGE_CTA_CLICKED)}})]}),(0,E.jsx)(hJ,{}),null!=t?(0,E.jsx)(hX,{subscription:t,withOverheadSeparator:!1}):null]})}):(0,E.jsx)("div",{className:e6()(hK.kL,hK.Lq),children:(0,E.jsx)(dd.y,{})})},h0=(0,a.E2)(u.X.SUBSCRIPTIONS_SETTINGS,{useSearchTerms:()=>[j.intl.string(j.t.trSpHX),j.intl.string(j.t["2GKrvn"])],Component:()=>(0,E.jsx)(h$,{})}),h1=(0,a.zZ)(u.X.SUBSCRIPTIONS_CATEGORY,{useSearchTerms:()=>[j.intl.string(j.t.trSpHX),j.intl.string(j.t["2GKrvn"])],buildLayout:()=>[h0]}),h2=(0,a.t_)(u.X.SUBSCRIPTIONS_PANEL,{useTitle:()=>j.intl.string(j.t.trSpHX),buildLayout:()=>[h1]}),h3=(0,a.i4)(u.X.SUBSCRIPTIONS_SIDEBAR_ITEM,{useTitle:()=>j.intl.string(j.t.trSpHX),icon:Au.L,usePersistentBadge:function(){return S.useMemo(()=>({badgeType:h.Xi.STRONGLY_DISCOURAGED_CUSTOM,useCustomBadge:()=>(0,Ad.l)()?(0,E.jsx)(rG.E,{size:"xs",color:er.A.unsafe_rawColors.YELLOW_300}):null}),[])},buildLayout:()=>[h2]}),h6=(0,a.WI)(u.X.BILLING_SECTION,{useTitle:()=>j.intl.string(j.t.oeUm2s),buildLayout:()=>[gh,Ao,h3,go,d4]});var h5=i(540999),h4=i(306471),h8=i(964355),h7=i(172272);let h9=(0,a.zD)(u.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,g.bG)([oh.default],()=>oh.default.isAxeEnabled),setValue:e=>(0,oA.x)({axeEnabled:e})}),Ee=(0,a.zD)(u.X.CSS_DEBUGGING,{useTitle:()=>"Enable CSS Debugging",useSubtitle:()=>"Display raw colors as pink. Toggling this will refresh the browser.",useValue:()=>(0,g.bG)([oh.default],()=>oh.default.cssDebuggingEnabled),setValue:e=>{(0,oA.x)({cssDebuggingEnabled:e}).then(()=>{setTimeout(()=>location.reload(),500)})}});var Et=i(276086),Ei=i(354328);let En=(0,a.zD)(u.X.HIGHLIGHT_MANA_COMPONENTS,{useTitle:()=>"Highlight Mana Components",useSubtitle:()=>"Highlights all Mana design system components for easier debugging.",useValue:()=>(0,Ei.A)("highlight_mana_components"),setValue:e=>{(0,Et.L)("highlight_mana_components",e)}}),Es=(0,a.zD)(u.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,Ei.A)("highlight_mana_text_overrides"),setValue:e=>{(0,Et.L)("highlight_mana_text_overrides",e)}}),El=(0,a.zD)(u.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,Ei.A)("highlight_mana_text"),setValue:e=>{(0,Et.L)("highlight_mana_text",e)}}),Er=(0,a.zD)(u.X.HIGHLIGHT_VOID_COMPONENTS,{useTitle:()=>"Highlight Deprecated Void Components",useSubtitle:()=>"Highlights deprecated toggleable components: VoidCheckbox (green), VoidRadioGroup (yellow), VoidSwitch (blue).",useValue:()=>(0,Ei.A)("highlight_void_toggleables"),setValue:e=>{(0,Et.L)("highlight_void_toggleables",e)}}),Ea=(0,a.sN)(u.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,g.bG)([oh.default],()=>oh.default.layoutDebuggingEnabled),minValue:0,maxValue:h7.YR,markers:Array.from({length:h7.YR+1},(e,t)=>t),onValueRender:e=>`${Math.round(e)}px`,onMarkerRender:e=>e%4==0?`${e}`:void 0,getInitialValue:()=>h7.Or.getState().horizontalSpacing,asValueChanges:e=>{h7.Or.getState().setHorizontalSpacing(e)}}),Eo=(0,a.zD)(u.X.LAYOUT_DEBUGGING,{useTitle:()=>"Enable Layout Debugging",useSubtitle:()=>"Renders a grid on top of the app to help debug layout alignment issues.",useValue:()=>(0,g.bG)([oh.default],()=>oh.default.layoutDebuggingEnabled),setValue:e=>{(0,oA.x)({layoutDebuggingEnabled:e})}}),Eu=(0,a.sN)(u.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,g.bG)([oh.default],()=>oh.default.layoutDebuggingEnabled),minValue:0,maxValue:h7.YR,markers:Array.from({length:h7.YR+1},(e,t)=>t),onValueRender:e=>`${Math.round(e)}px`,onMarkerRender:e=>e%4==0?`${e}`:void 0,getInitialValue:()=>h7.Or.getState().verticalSpacing,asValueChanges:e=>{h7.Or.getState().setVerticalSpacing(e)}}),Ed=(0,a.zZ)(u.X.DESIGN_TOOLS,{useTitle:()=>"Design & A11y Tools",useSearchTerms:()=>["accessibility tools"],buildLayout:()=>[Ee,Eo,Ea,Eu,En,El,Es,Er,h9]}),Ec=(0,a.zD)(u.X.AD_OVERRIDE,{useTitle:()=>"Always Deliver Ads",useSubtitle:()=>"Makes the user targetable for all active ads.",useValue:()=>L.HZ.useSetting(),setValue:e=>{L.HZ.updateSetting(e)}});var Eg=i(173936),Em=i(260598),EA=i(148810),Eh=i(380610),EE=i(986238),ES=i(281161),ET=i(663894);let Ex=["discord_web","discord_marketing","discord_developers","discord_ios","discord_android"],Ep=[{id:"branch",value:"branch",label:"Branch Name"},{id:"id",value:"id",label:"Commit SHA"}];function Ef(e){return"discord_ios"in e||"discord_android"in e}class EN extends S.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:i,disabled:n,error:s}=this.props;return(0,E.jsxs)(rq.A,{direction:rq.A.Direction.VERTICAL,className:e6()(ES.oS,ik.SX,ET.N,ES.nM),children:[(0,E.jsx)(iL.A,{className:e6()(ES.lL,{[ES.zi]:n}),onClick:n?void 0:this.handleRemoveBuildOverride}),(0,E.jsxs)(rq.A,{className:ik.QB,children:[(0,E.jsx)(rq.A.Child,{basis:"50%",children:(0,E.jsx)(rF.l,{selectionMode:"single",label:"Override Type",options:Ep,onSelectionChange:this.handleOverrideTypeChanged,value:t,disabled:n})}),(0,E.jsx)(rq.A.Child,{wrap:!0,basis:"50%",children:(0,E.jsx)(rH.k,{label:"branch"===t?"Branch Name":"Commit SHA",value:i,onChange:this.handleOverrideIdChanged,disabled:n})})]}),(0,E.jsxs)(rq.A.Child,{children:[null!=s&&""!==s&&(0,E.jsx)(es.E,{className:ES.AS,color:"text-feedback-critical",variant:"text-sm/normal",children:s}),(0,E.jsxs)(es.E,{variant:"text-sm/normal",className:ES.AS,children:["This controls the build that will be served for the ",(0,E.jsx)("code",{children:e})," project."]})]})]})}}class E_ extends S.Component{state={loading:!0,buildOverrides:{},loadedBuildOverrides:{},errors:{},saving:!1,didSave:!1};async refreshBuildOverrides(){this.setState({loading:!0});let e=await (0,Eh.bD)();this.setState({loading:!1,buildOverrides:e,loadedBuildOverrides:eZ().cloneDeep(e),errors:{}})}isDirty(){let{buildOverrides:e,loadedBuildOverrides:t}=this.state;return!eZ().isEqual(e,t)}componentDidMount(){this.refreshBuildOverrides()}getAvailableProjects(){let{buildOverrides:e}=this.state;if(null==e)return[];let t=Object.keys(e);return eZ().without(Ex,...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:i}=this.state,n={...null!=i?i[e]:{},...t},s={...this.state.buildOverrides,[e]:n};this.setState({buildOverrides:s})};handleBuildOverrideRemoved=e=>{let t={...this.state.buildOverrides};delete t[e],this.setState({buildOverrides:t})};handleDiscardChanges=()=>{this.setState({buildOverrides:eZ().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,EA.Zk)(e);if(200===t.status){let e=t.body;this.setState({buildOverrides:e,loadedBuildOverrides:eZ().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,K.openModal)(t=>(0,E.jsx)(EI,{...t,buildOverrides:e}))};renderEmpty(){return(0,E.jsx)(iI.pp,{theme:iv.A.theme,className:e6()(ik.eT,ik.SX),children:(0,E.jsx)(iI.SG,{children:"You have no build overrides configured."})})}renderItems(){let{buildOverrides:e,saving:t,errors:i}=this.state;return null==e?null:eZ().map(e,(e,n)=>(0,E.jsx)(EN,{project:n,overrideType:e.type,overrideId:e.id,disabled:t,error:i[n],onBuildOverrideUpdated:this.handleBuildOverrideUpdated,onBuildOverrideRemoved:this.handleBuildOverrideRemoved},n))}renderRefreshButton(){return!this.state.didSave||this.isDirty()?null:(0,E.jsx)(eG.$,{variant:"secondary",text:"Reload App",onClick:()=>location.reload()})}renderLinkButton(){let{buildOverrides:e}=this.state;return null==e||0===Object.keys(e).length?null:(0,E.jsx)(tr.m,{text:"Generate Public Link",children:(0,E.jsx)(rB.K,{variant:"secondary",icon:Eg.q,"aria-label":"Generate Public Link",onClick:this.handleLinkGeneration})})}renderSaveButton(){if(!this.isDirty())return null;let{saving:e,buildOverrides:t}=this.state;return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(eG.$,{variant:"critical-primary",text:"Discard Changes",onClick:this.handleDiscardChanges,disabled:e}),(0,E.jsx)(eG.$,{variant:"primary",text:"Save Build Overrides",disabled:Ef(t??{}),onClick:this.handleSaveChanges,loading:e})]})}render(){let e,{loading:t,saving:i,buildOverrides:n}=this.state;e=t?(0,E.jsx)(dd.y,{className:ik.QX}):null!=n&&0===Object.keys(n).length?this.renderEmpty():this.renderItems();let s=!i&&!t&&this.getAvailableProjects().length>0,l=Ef(n??{})&&"stable"!==window.GLOBAL_ENV.RELEASE_CHANNEL?(0,E.jsx)(es.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,E.jsx)(iC.n,{children:(0,E.jsxs)(Q.B,{gap:16,children:[(0,E.jsx)(rF.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:!s}),l,e,(0,E.jsxs)(a9.e,{justify:"end",children:[this.renderRefreshButton(),this.renderLinkButton(),this.renderSaveButton()]})]})})}}class EI extends S.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 i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;e.setState({statusText:t,status:i})}})();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===iP.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,EA.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 Ef(this.props.buildOverrides??{})}renderSettingsForm(){let{ttlSeconds:e,releaseChannel:t,userIdEntry:i,userIdEntryError:n,allowedVersions:s,allowedVersionEntry:l,allowedVersionEntryError:r,allowLoggedOut:a,experiments:o,experimentsError:u}=this.state,d=EE.fL.find(t=>t.value===e),c=s.map(e=>({id:e,label:e,value:e}));return(0,E.jsxs)(Q.B,{gap:20,children:[(0,E.jsx)(rF.l,{selectionMode:"single",label:"Expire After",value:null!=d?d.value:void 0,options:EE.fL,onSelectionChange:this.handleExpirationChange}),this.isMobile()?null:(0,E.jsx)(rF.l,{selectionMode:"single",label:"Release Channel",value:t,options:EE.VP,onSelectionChange:this.handleReleaseChannelChange}),this.isMobile()?(0,E.jsxs)(Q.B,{gap:20,children:[(0,E.jsx)(rH.k,{label:"Add allowed app version (required)",autoFocus:!0,value:l,onKeyDown:this.handleAllowedVersionEnter,error:r,onChange:this.handleAllowedVersionEntry,placeholder:"Example: 34",trailing:{icon:rD.j,onClick:this.handleAddAllowedVersion,"aria-label":"Add"}}),(0,E.jsx)(rF.l,{selectionMode:"single",label:"Remove allowed app version",value:void 0,options:c,onSelectionChange:this.handleRemoveAllowedVersion,disabled:0===s.length})]}):null,this.isMobile()?null:(0,E.jsx)(Em.f,{label:"Limit to User IDs (optional)",helperText:"User IDs can be separated by whitespace or commas.",value:i,error:n,onBlur:()=>this.setUserEntryError(""),onChange:this.handleUserIDEntry}),(0,E.jsx)(Em.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,E.jsx)(J.d,{label:"Allow logged out users",checked:a,onChange:this.handleAllowLoggedOut})]})}renderHelpMessage(){let{statusText:e,status:t}=this.state;if(null==e)return(0,E.jsx)("div",{});let i=t_.Y.INFO;switch(t){case 0:i=t_.Y.ERROR;break;case 1:i=t_.Y.WARNING}return(0,E.jsx)(t_.p,{messageType:i,children:e})}render(){let{onClose:e,transitionState:t}=this.props,{publicLink:i}=this.state;return(0,E.jsx)(rX.Modal,{title:"Generate Public Build Override Link",input:this.renderHelpMessage(),actionBarInput:(0,E.jsx)(cZ.A,{value:i}),transitionState:t,"aria-label":"Generate Public Build Override Link",actions:[{variant:"primary",text:"Generate Link",onClick:this.handleGenerateLink}],onClose:e,children:this.renderSettingsForm()})}}let EC=(0,a.E2)(u.X.BUILD_OVERRIDES,{useSearchTerms:()=>["build overrides"],Component:E_});var Eb=i(256311),Ev=i(883600);let Ey=(0,a.E2)(u.X.CHANGE_LOG_OVERRIDE,{useSearchTerms:()=>["changelog override","change log override"],Component:function(){let e=(0,g.bG)([Ev.A],()=>Ev.A.overrideId());async function t(e){let t=Ev.A.getChangelog(e,"en-US");return null!=t?t:await Eb.A.fetchChangelog(e,"en-US",!1,!0)??null}return(0,E.jsx)(Ez,{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=>Eb.A.setChangelogOverride(e),fetchOverride:t})}});var Ej=i(506774);let EO=new Date("2018-01-01"),ER=(0,a.Tf)(u.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:()=>L.pK.useSetting()===dN.default.fromTimestamp(EO.getTime()),onClick:()=>(Ej.w.set("lastChangeLogDate",EO),L.pK.updateSetting(dN.default.fromTimestamp(EO.getTime())))}),EL=(0,a.zD)(u.X.DISABLE_APP_COLLECTIONS_CACHE,{useTitle:()=>"Disable Application Collections Cache",useSubtitle:()=>"Forces application collection updates to be shown immediately.",useDisabled:()=>(0,g.bG)([oh.default],()=>oh.default.onlyShowPreviewAppCollections),useValue:()=>(0,g.bG)([oh.default],()=>oh.default.disableAppCollectionsCache||oh.default.onlyShowPreviewAppCollections),setValue:e=>(0,oA.x)({disableAppCollectionsCache:e})}),ED=(0,a.zD)(u.X.FORCE_CANARY_API,{useTitle:()=>"Force Canary API",useSubtitle:()=>"Routes all API requests to Canary instances.",useValue:()=>(0,g.bG)([oh.default],()=>oh.default.isForcedCanary),setValue:e=>{(0,oA.x)({canary:e})}}),EP=(0,a.zD)(u.X.LOAD_SOURCE_MAPS,{useTitle:()=>"Load Source Maps",useSubtitle:()=>"Downloads source maps on this client. Only enable on devices you trust.",useValue:()=>(0,g.bG)([oh.default],()=>oh.default.sourceMapsEnabled),setValue:e=>(0,oA.x)({sourceMapsEnabled:e})}),EG=(0,a.zD)(u.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,g.bG)([oh.default],()=>oh.default.onlyShowPreviewAppCollections),setValue:e=>(0,oA.x)({onlyShowPreviewAppCollections:e})});var EM=i(10094),EU=i(683760);let EV=[{id:"none",label:"Non-Nitro",value:0},{id:"tier_0",label:"Nitro Basic",value:sq.PremiumTypes.TIER_0},{id:"tier_1",label:"Nitro Classic",value:sq.PremiumTypes.TIER_1},{id:"tier_2",label:"Nitro Standard",value:sq.PremiumTypes.TIER_2}],Ek=(0,a.Hn)(u.X.PREMIUM_TYPE_OVERRIDE,{useTitle:()=>"Premium Type Override",useSearchTerms:()=>["nitro override"],useSubtitle:()=>"Overrides the client's local premium type.",useOptions:()=>EV,clearable:!0,useValue:()=>(0,g.bG)([EU.A],()=>{let e=EU.A.getPremiumTypeOverride();return null===e?0:e}),setValue:e=>{0===e?(0,EM.O)(null,void 0):null===e?(0,EM.O)(void 0,void 0):(0,EM.O)(0===e?null:e,void 0)}});var Ew=i(246605),EF=i(274184);let EB=(0,a.E2)(u.X.SURVEY_OVERRIDE,{useSearchTerms:()=>["survey override"],Component:function(){let e=(0,g.bG)([EF.Ay],()=>EF.Ay.getSurveyOverride());return(0,E.jsx)(Ez,{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=>Ew.xr(e),fetchOverride:e=>Ew.BC(e,!0)??null})}});function Ez(e){let{label:t,description:i,placeholder:n,overrideId:s,setOverride:l,fetchOverride:r}=e,[a,o]=S.useState(s??""),u=S.useRef(null),[d,c]=S.useState(0);function g(){null!=u.current&&(clearTimeout(u.current),u.current=null)}return S.useEffect(()=>g,[]),(0,E.jsx)(s6.D,{layout:"horizontal-responsive",label:t,description:i,children:(0,E.jsx)(rH.k,{placeholder:n,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),g(),0===e.length){c(0),l(null);return}u.current=setTimeout(()=>{c(1),r(e).then(t=>{c(null==t?2:3),null!=t&&l(e)})},500)}},clearable:!0})})}let EY=(0,a.zZ)(u.X.DEV_OVERRIDES,{useTitle:()=>"Overrides",buildLayout:()=>[Ek,EB,Ey,ER,ED,Ec,EG,EL,EP,EC],useInlineNotice:()=>({type:h.lT.INLINE_NOTICE,noticeType:"info",useText:()=>j.intl.format(j.t.UeZJlg,{link:"https://i.dis.gd/dev-settings-changes"})})}),EX=(0,a.zD)(u.X.ANALYTICS_LOGS,{useTitle:()=>"Enable Logging of Analytics Events",useSubtitle:()=>"Logs all analytics events to the developer console.",useValue:()=>(0,g.bG)([oh.default],()=>oh.default.isLoggingAnalyticsEvents),setValue:e=>(0,oA.x)({logAnalyticsEvents:e})}),EH=(0,a.zD)(u.X.GATEWAY_LOGS,{useTitle:()=>"Log Gateway Events",useSubtitle:()=>"Logs all gateway events to console, including content. Enable verbose logs to see them.",useValue:()=>(0,g.bG)([oh.default],()=>oh.default.isLoggingGatewayEvents),setValue:e=>(0,oA.x)({logGatewayEvents:e})}),EK=(0,a.zD)(u.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,g.bG)([oh.default],()=>oh.default.preventPopoutClose),setValue:e=>(0,oA.x)({preventPopoutClose:e})}),EW=(0,a.zD)(u.X.KEYBOARD_MISMATCHES,{useTitle:()=>"Enable Logging of Keyboard Mismatches",useSubtitle:()=>"Logs mismatches in detected keyboard codes to the console.",useValue:()=>(0,g.bG)([oh.default],()=>oh.default.logKeyboardMismatches),setValue:e=>(0,oA.x)({logKeyboardMismatches:e})}),EZ=(0,a.zD)(u.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,g.bG)([oh.default],()=>oh.default.isLoggingOverlayEvents),setValue:e=>(0,oA.x)({logOverlayEvents:e})}),Eq=(0,a.zD)(u.X.QUEST_LOGGING,{useTitle:()=>"Enable Quests Debug Logging",useSubtitle:()=>"Logs quest lifecycle events to the developer console.",useValue:()=>(0,g.bG)([oh.default],()=>oh.default.isLoggingQuestEvents),setValue:e=>(0,oA.x)({logQuestEvents:e})}),EQ=(0,a.zD)(u.X.REQUEST_TRACING,{useTitle:()=>"Enable Tracing Requests",useSubtitle:()=>"Force trace all client requests with APM.",useValue:()=>(0,g.bG)([oh.default],()=>oh.default.isTracingRequests),setValue:e=>(0,oA.x)({trace:e})}),EJ=(0,a.zZ)(u.X.LOGGING,{useTitle:()=>"Logging",buildLayout:()=>[EH,EZ,EQ,EX,EW,EK,Eq]}),E$=(0,a.t_)(u.X.DEVELOPER_OPTIONS_PANEL,{useTitle:()=>"Developer Options",buildLayout:()=>[EY,EJ,Ed]}),E0=(0,a.i4)(u.X.DEVELOPER_OPTIONS_SIDEBAR_ITEM,{useTitle:()=>"Developer Options",icon:h4.V,useMenu:function(){let{layoutDebuggingEnabled:e,isDeveloper:t,isLoggingGatewayEvents:i,isLoggingOverlayEvents:n,isLoggingAnalyticsEvents:s,isTracingRequests:l,isForcedCanary:r,isAxeEnabled:a,preventPopoutClose:o,onlyShowPreviewAppCollections:d,disableAppCollectionsCache:c,isStaff:m}=(0,g.cf)([oh.default,h5.A,id.default],()=>({layoutDebuggingEnabled:oh.default.layoutDebuggingEnabled,isDeveloper:h5.A.isDeveloper,isLoggingGatewayEvents:oh.default.isLoggingGatewayEvents,isLoggingOverlayEvents:oh.default.isLoggingOverlayEvents,isLoggingAnalyticsEvents:oh.default.isLoggingAnalyticsEvents,isTracingRequests:oh.default.isTracingRequests,isForcedCanary:oh.default.isForcedCanary,isSourceMapsEnabled:oh.default.sourceMapsEnabled,isAxeEnabled:oh.default.isAxeEnabled,preventPopoutClose:oh.default.preventPopoutClose,onlyShowPreviewAppCollections:oh.default.onlyShowPreviewAppCollections,disableAppCollectionsCache:oh.default.disableAppCollectionsCache,isStaff:id.default.getCurrentUser()?.isStaff()??!1})),{horizontalSpacing:A,verticalSpacing:h}=(0,h7.Or)(),{setHorizontalSpacing:S,setVerticalSpacing:T}=h7.Or.getState(),x=L.HZ.useSetting();return t?[(0,E.jsxs)(ei.Dr,{id:"overrides",label:"Overrides",action:()=>{(0,eH.openUserSettings)(u.X.DEV_OVERRIDES)},children:[(0,E.jsx)(ei.sL,{id:"always-deliver",label:"Always Deliver Ads",checked:x,action:()=>{L.HZ.updateSetting(!x)}},"always-deliver"),(0,E.jsx)(ei.sL,{id:"forced-canary",label:"Forced Canary",checked:r,action:()=>{(0,oA.x)({canary:!r})}},"forced-canary"),(0,E.jsx)(ei.sL,{id:"preview-collections",label:"Preview Unpublished Collections",checked:d,action:()=>{(0,oA.x)({onlyShowPreviewAppCollections:!d})}},"preview-collections"),(0,E.jsx)(ei.sL,{id:"disable-collections-cache",label:"Disable Collections Cache",checked:c,action:()=>{(0,oA.x)({disableAppCollectionsCache:!c})}},"disable-collections-cache")]},"overrides"),(0,E.jsxs)(ei.Dr,{id:"logging",label:"Logging",action:()=>{(0,eH.openUserSettings)(u.X.LOGGING)},children:[(0,E.jsx)(ei.sL,{id:"gateway-events",label:"Gateway Events",checked:i,action:()=>{(0,oA.x)({logGatewayEvents:!i})}},"gateway-events"),(0,E.jsx)(ei.sL,{id:"overlay-events",label:"Overlay RPC Events",checked:n,action:()=>{(0,oA.x)({logOverlayEvents:!n})}},"overlay-events"),(0,E.jsx)(ei.sL,{id:"analytics-events",label:"Analytics Events",checked:s,action:()=>{(0,oA.x)({logAnalyticsEvents:!s})}},"analytics-events"),(0,E.jsx)(ei.sL,{id:"tracing-requests",label:"Tracing Requests",checked:l,action:()=>{(0,oA.x)({trace:!l})}},"tracing-requests"),(0,E.jsx)(ei.sL,{id:"prevent-popout-close",label:"Prevent Popouts From Closing",checked:o,action:()=>{(0,oA.x)({preventPopoutClose:!o})}},"prevent-popout-close")]},"logging"),(0,E.jsxs)(ei.Dr,{id:"design-tools",label:"Design/A11y Tools",action:()=>{(0,eH.openUserSettings)(u.X.DESIGN_TOOLS)},children:[(0,E.jsx)(ei.sL,{id:"accessibility-auditing",label:"Accessibility Auditing",checked:a,action:()=>{(0,oA.x)({axeEnabled:!a})}},"accessibility-auditing"),(0,E.jsx)(ei.sL,{id:"layout-debugging",label:"Enable Layout Debugging",checked:e,action:()=>{(0,oA.x)({layoutDebuggingEnabled:!e})}},"layout-debugging"),e&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(ei.aK,{id:"horizontal-spacing",label:"Horizontal Spacing",control:(e,t)=>(0,E.jsx)(h8.i,{...e,ref:t,value:A,minValue:0,maxValue:h7.YR,onChange:e=>S(e),renderValue:e=>`${Math.round(e)}px`,"aria-label":"Horizontal Spacing"})},"horizontal-spacing"),(0,E.jsx)(ei.aK,{id:"vertical-spacing",label:"Vertical Spacing",control:(e,t)=>(0,E.jsx)(h8.i,{...e,ref:t,value:h,minValue:0,maxValue:h7.YR,onChange:e=>T(e),"aria-label":"Vertical Spacing",renderValue:e=>`${Math.round(e)}px`})},"vertical-spacing")]})]},"design-tools"),m?(0,E.jsx)(ei.Dr,{id:"discord-stats",label:"Discord Stats",action:()=>ay()},"discord-stats"):null]:null},buildLayout:()=>[E$]});var E1=i(127062),E2=i(25044),E3=i(80703),E6=i(691540),E5=i(857250),E4=i(97483),E8=i(100392),E7=i(102609),E9=i(271478),Se=i(736056),St=i(710195),Si=i(386976),Sn=i(257433),Ss=i(32523),Sl=i(96919),Sr=i(688151),Sa=i(142862);function So(e){let{experiment:t,experimentId:i,overrideInfo:n,defaultOpen:s}=e,[l,r]=S.useState(s),[a,o]=S.useState(!1),u=S.useCallback(()=>{r(e=>!e)},[]),d=(0,g.bG)([cP.default],()=>cP.default.getId()),c=(0,g.bG)([cP.default],()=>{let e=cP.default.getInstallationForTracking();return null==e?null:(0,E3.v)(e)}),m="installation"===t.kind&&null!=c?c:d,A=(0,Sn.iN)(t,m),h=(0,Sn.Fm)(t,m),T=(0,g.yK)([Se.A],()=>eZ().sortBy(Se.A.getRecentExposures(Sr.Vh.USER,i),e=>{let[t,i]=e;return-i}).map(e=>{let[t,i]=e;return`${new Date(i).toLocaleString()} (${t})`})),x=S.useCallback(e=>{(0,ck.C)((0,E8.yA)(i),()=>{(0,E6.P0)({id:"experiment-link-copied",message:"Copied experiment link",type:E4.Ck.SUCCESS}),e.preventDefault(),e.stopPropagation()})},[i]),p=(0,E.jsx)(e5.s,{"aria-label":"Toggle visibility",onClick:u,children:(0,E.jsxs)(es.E,{variant:"text-md/medium",className:Sa.DD,children:[(0,E.jsxs)("div",{children:[(0,E.jsxs)(Q.B,{direction:"horizontal",align:"center",gap:4,children:[t.title," ",ck.p5&&(0,E.jsx)(en.D,{onClick:x,children:(0,E.jsx)(Eg.q,{size:"xs"})})]}),(0,E.jsx)(es.E,{color:"text-muted",variant:"text-sm/normal",children:i})]}),(0,E.jsx)("span",{className:Sa.km,children:"installation"===t.kind?"Installation":"User"})]})});if(!l)return(0,E.jsx)("div",{className:Sa.Os,children:p});let f="";return f=t.system===E7.l5.LEGACY?`Currently assigned to bucket ${A??Sr.RE.NOT_ELIGIBLE}`:null!=A?`Currently assigned to variant ${A}`:"Currently unassigned",(0,E.jsxs)("div",{className:Sa.Os,children:[p,(0,E.jsx)("div",{children:(0,E.jsx)(E9.g,{label:t.system===E7.l5.LEGACY?"Bucket Override":"Variant Override",description:f,experiment:t,experimentId:i,overrideInfo:n})}),(0,E.jsx)("div",{className:Sa.h_,children:null==h?(0,E.jsx)(es.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,E.jsxs)("div",{children:[(0,E.jsx)(es.E,{variant:"text-lg/medium",className:Sa.id,children:"Server Descriptor"}),(0,E.jsx)(es.E,{variant:"code",className:Sa.AS,children:null==h?"None":JSON.stringify(h,void 0,2)}),(0,E.jsx)(es.E,{variant:"text-lg/medium",className:Sa.id,children:"Override Descriptor"}),(0,E.jsx)(es.E,{variant:"code",className:Sa.AS,children:n?.originalDescriptor==null?"None":JSON.stringify(n.originalDescriptor,void 0,2)}),(0,E.jsx)(es.E,{variant:"text-lg/medium",className:Sa.id,children:"Recent Exposures"}),(0,E.jsx)(es.E,{variant:"code",className:Sa.AS,children:0===T.length?"None":T.join("\n")})]}):(0,E.jsx)("div",{className:Sa.id,children:(0,E.jsx)(ea.Q,{variant:"secondary",text:"More Details \xbb",onClick:()=>o(!0)})}),(0,E.jsx)(eM.c,{className:Sa.yF})]})}function Su(e){let{experiment:t,experimentId:i,overrideInfo:n}=e,[s,l]=S.useState(null!=n),[r,a]=S.useState(!1),o=S.useCallback(()=>{l(e=>!e)},[]),u=(0,g.bG)([Se.A],()=>Se.A.getLoadedGuildExperiment(i)),d=(0,g.bG)([Se.A,ec.A,St.A],()=>{if(t.system===E7.l5.LEGACY)return null==Se.A.getLoadedGuildExperiment(i);let e=t.name;return!ec.A.getGuildsArray().some(t=>null!=St.A.getServerAssignment("guild",t.id,e))}),c=(0,g.yK)([Se.A],()=>eZ().sortBy(Se.A.getRecentExposures(Sr.Vh.GUILD,i),e=>{let[t,i]=e;return-i}).map(e=>{let[t,i]=e;return`${new Date(i).toLocaleString()} (${t})`})),[m,A]=(0,g.yK)([cP.default,ec.A,Se.A,St.A],()=>{let e=t.system===E7.l5.LEGACY,n=t.name,s=cP.default.getId(),l=eZ().sortBy(ec.A.getGuildsArray(),e=>e.name.toLowerCase()),r={},a=[];for(let t of l){let l=e?Se.A.getGuildExperimentDescriptor(i,t.id)?.bucket??Sr.RE.NOT_ELIGIBLE:St.A.getEvaluationAndAssignment("guild",t.id,n,s)[1]?.variantId??Sr.RE.NOT_ELIGIBLE;l in r||(r[l]=0),r[l]++,a.push(`${t.name}: ${l}`)}let o=eZ()(r).keys().map(Number).sort().map(e=>`${r[e]} guilds in bucket ${e}`).join(", ");return[a.join("\n"),o]}),h=t.system!==E7.l5.LEGACY,T=(0,g.yK)([ec.A],()=>eZ().sortBy(ec.A.getGuildsArray(),e=>e.name.toLowerCase())),[x,p]=S.useState(()=>s4.A.getGuildId()??s4.A.getLastSelectedGuildId()),f=T.find(e=>e.id===x)?.name,N=(0,g.bG)([St.A],()=>{if(h&&null!=x)return St.A.getServerAssignment("guild",x,t.name)},[h,x,t.name]),_=(0,g.bG)([St.A,cP.default],()=>{if(!h)return;let e=cP.default.getId();return St.A.getEvaluationAndAssignment("user",e,t.name)[1]}),I=null!=_&&(_.isOverride||_.useAsEligibility),C=(0,E.jsx)(en.D,{onClick:o,children:(0,E.jsxs)(es.E,{variant:"text-md/medium",className:Sa.DD,children:[(0,E.jsxs)("div",{children:[(0,E.jsx)("span",{children:t.title}),(0,E.jsx)(es.E,{color:"text-muted",variant:"text-sm/normal",children:i})]}),(0,E.jsx)("span",{className:Sa.km,children:"Guild"})]})});return s?(0,E.jsxs)("div",{className:Sa.Os,children:[C,(0,E.jsx)(E9.g,{label:"Bucket Override",description:`Current Assignments: ${A}`,experiment:t,experimentId:i,overrideInfo:n}),h&&T.length>0&&(0,E.jsx)("div",{className:Sa.h_,children:(0,E.jsx)(rF.l,{label:"Inspect guild",description:"Server assignment and eligibility shown below are for this guild. The override above still applies to all guilds.",value:x??void 0,options:T.map(e=>({id:e.id,label:e.name,value:e.id})),onSelectionChange:e=>p(e),selectionMode:"single",fullWidth:!0})}),(0,E.jsx)("div",{className:Sa.h_,children:d?(0,E.jsx)(es.E,{variant:"text-sm/normal",color:"text-subtle",children:t.system===E7.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}),h&&(0,E.jsxs)("div",{children:[(0,E.jsxs)(es.E,{variant:"text-lg/medium",className:Sa.id,children:["Server Descriptor",null!=f?` (${f})`:""]}),(0,E.jsx)(es.E,{variant:"code",className:Sa.AS,children:null==N?"None":JSON.stringify(N,void 0,2)}),(0,E.jsx)(es.E,{variant:"text-lg/medium",className:Sa.id,children:"Client Eligibility"}),(0,E.jsx)(es.E,{variant:"text-sm/normal",color:"text-muted",children:I?"Eligible: Yes":"Eligible: No"}),(0,E.jsx)(es.E,{variant:"code",className:Sa.AS,children:null==_?"None":JSON.stringify(_,void 0,2)})]}),r?(0,E.jsxs)("div",{children:[(0,E.jsx)(es.E,{variant:"text-lg/medium",className:Sa.id,children:"Guild Assignments"}),(0,E.jsx)(es.E,{variant:"code",className:Sa.AS,children:m}),t.system===E7.l5.LEGACY&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(es.E,{variant:"text-lg/medium",className:Sa.id,children:"Server Descriptor"}),(0,E.jsx)(es.E,{variant:"code",className:Sa.AS,children:null==u?"None":JSON.stringify(u,void 0,2)})]}),(0,E.jsx)(es.E,{variant:"text-lg/medium",className:Sa.id,children:"Override Descriptor"}),(0,E.jsx)(es.E,{variant:"code",className:Sa.AS,children:n?.originalDescriptor==null?"None":JSON.stringify(n.originalDescriptor,void 0,2)}),(0,E.jsx)(es.E,{variant:"text-lg/medium",className:Sa.id,children:"Recent Exposures"}),(0,E.jsx)(es.E,{variant:"code",className:Sa.AS,children:0===c.length?"None":c.join("\n")})]}):(0,E.jsx)("div",{className:Sa.id,children:(0,E.jsx)(ea.Q,{variant:"secondary",text:"More Details \xbb",onClick:()=>a(!0)})}),(0,E.jsx)(eM.c,{className:Sa.yF})]}):(0,E.jsx)("div",{className:Sa.Os,children:C})}let Sd=(0,a.E2)(u.X.EXPERIMENTS_SETTING,{Component:function(){let{experiments:e,overridesInfo:t}=(0,Si.op)(),{experiments:i,overridesInfo:n}=(0,Ss.hI)(),s=S.useMemo(()=>({...i,...e}),[i,e]),l=S.useMemo(()=>({...n,...t}),[n,t]),r=(0,g.bG)([cP.default],()=>{let e=cP.default.getInstallationForTracking();return null==e?null:(0,E3.v)(e)}),[a,o]=S.useState(""),u=(0,Sl.oC)((0,Sl.R3)((0,Sl.Fm)(s),l),a);return(0,E.jsxs)("div",{"data-mtctest-ignore":"true",children:[null!=r&&(0,E.jsxs)(Q.B,{style:{gap:8,marginBottom:16},children:[(0,E.jsxs)(es.E,{variant:"text-xs/medium",color:"text-muted",children:["Installation ID: ",r]}),ck.p5&&(0,E.jsx)(ea.Q,{size:"sm",onClick:()=>{(0,ck.C)(r,()=>{(0,E6.P0)((0,E5.o)("Installation ID copied!",E4.Ck.SUCCESS))})},text:"Copy"})]}),(0,E.jsx)($.I,{placeholder:"Search experiments",query:a,onChange:o,onClear:()=>o("")}),u.length>0?u.map(e=>{let t="guild"===e.experiment.kind?Su:So;return(0,E.jsx)(t,{experiment:e.experiment,experimentId:e.id,overrideInfo:l[e.id],defaultOpen:null!=l[e.id]},e.id)}):(0,E.jsx)("div",{className:Sa.p$,children:(0,E.jsx)(eP.D,{variant:"heading-md/semibold",children:"No Experiments Found"})})]})},useSearchTerms:()=>["Experiments","Bucket Override","Variant Override"]}),Sc=(0,a.zZ)(u.X.EXPERIMENTS_CATEGORY,{buildLayout:()=>[Sd]}),Sg=(0,a.t_)(u.X.EXPERIMENTS_PANEL,{useTitle:()=>"Experiments",buildLayout:()=>[Sc]}),Sm=(0,a.i4)(u.X.EXPERIMENTS_SIDEBAR_ITEM,{useTitle:()=>"Experiments",icon:E1.c,useMenu:E2.A,buildLayout:()=>[Sg]}),SA=(0,a.WI)(u.X.DEVELOPER_SECTION,{useTitle:()=>j.intl.string(j.t["+gHUHA"]),usePredicate:()=>h5.A.isDeveloper,buildLayout:()=>[Sm,E0]});var Sh=i(712440),SE=i(370997);let SS=(0,a.E2)(u.X.AUTHORIZED_APPS_LIST_SETTING,{Component:SE.Ay,useSearchTerms:()=>[j.intl.string(j.t["f6kk+r"])]});var ST=i(187322),Sx=i(77468),Sp=i(289498),Sf=i(573648),SN=i(874490),S_=i(370480),SI=i(968309);let SC=new Set([U.fg2.XBOX,U.fg2.PLAYSTATION,U.fg2.PLAYSTATION_STAGING,U.fg2.CRUNCHYROLL]);var Sb=i(169869),Sv=i(235693),Sy=i(757036),Sj=i(555837),SO=i(733110),SR=i(241524),SL=i(346017),SD=i(631368),SP=i(968671),SG=i(212739),SM=i(30370),SU=i(933287),SV=i(594387),Sk=i(651439);function Sw(){let e,t,n,s,l,{variant:r,showFooter:a}=(e=(0,SD.$)(),t=(0,SP.GM)("connectedAccountsBannerFooter"),n=(0,SG.O)(),l=null!=(s=(0,g.bG)([SM.A],()=>SM.A.getAccount(null,U.fg2.XBOX)))&&!s.revoked,e===SD.C.NONE||n?{variant:SD.C.NONE,showFooter:!1}:{variant:e,showFooter:t&&e===SD.C.NO_ACCESS&&!l}),{analyticsLocations:o}=(0,nQ.Ay)(e1.A.XBOX_CONNECTED_ACCOUNTS_BANNER),u=(0,SL.yW)(o),d=(0,SR.A)("(max-width: 485px)");if(r===SD.C.NONE)return null;let c=d?"md":"sm",m="",A=null;switch(r){case SD.C.HAS_ACCESS:m=j.intl.string(SU.default["7PdsMK"]),A=(0,E.jsx)(eG.$,{variant:"overlay-primary",size:c,fullWidth:d,text:j.intl.string(SU.default.CubeLC),onClick:()=>{(0,K.openModalLazy)(async()=>{let{default:e}=await Promise.all([i.e("52283"),i.e("13088")]).then(i.bind(i,347171));return t=>(0,E.jsx)(e,{...t,sourceAnalyticsLocations:o})})}});break;case SD.C.NO_ACCESS:m=j.intl.string(SU.default.NwkRTZ),A=(0,E.jsx)(sY.A,{defaultTextOverride:j.intl.string(SU.default["0vY+ie"]),variantOverride:"overlay-primary",size:c,fullWidth:d,subscriptionTier:sq.pe.TIER_2});break;default:(0,N.xb)(r)}return(0,E.jsxs)(nQ.f5,{value:o,children:[(0,E.jsxs)("div",{className:Sk.bV,children:[(0,E.jsx)(eP.D,{variant:"heading-md/semibold",color:"text-strong",children:j.intl.string(j.t.NG1e6l)}),(0,E.jsx)(ui.t,{size:"xs",color:"var(--icon-default)"})]}),(0,E.jsx)(is.N,{theme:"dark",children:e=>(0,E.jsx)("div",{className:e,children:(0,E.jsxs)("div",{className:Sk.Nr,children:[(0,E.jsxs)("div",{className:Sk.Tp,children:[(0,E.jsx)("div",{className:Sk.Qw,style:{backgroundImage:`url(${a?"https://cdn.discordapp.com/assets/content/1858990b1e56c7d51e887008753104d4663d06c0e0e296d8fe0ea85c7e3e8341.png":"https://cdn.discordapp.com/assets/content/7308e937fbd3074b9de0ebba1fa3571fa7b10a2b88f384b382f711bae99f40e6.png"})`}}),(0,E.jsx)("div",{className:Sk.$h}),(0,E.jsx)("div",{className:Sk.Rv}),(0,E.jsx)("div",{className:Sk.Lw})]}),(0,E.jsxs)("div",{className:Sk.Mn,children:[(0,E.jsxs)("div",{className:Sk.mY,children:[(0,E.jsx)("img",{className:Sk.wm,src:"https://cdn.discordapp.com/assets/content/c5fab2b5d1155c4c9bc088b07f8563b6db8d2d08666357486efc5aea6e97fbea.png",alt:"Xbox Game Pass"}),(0,E.jsx)(es.E,{variant:"text-lg/semibold",color:"text-strong",className:Sk.DD,children:m})]}),(0,E.jsx)("div",{className:Sk.lO,children:A})]}),a&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("div",{className:Sk.yF}),(0,E.jsxs)("div",{className:Sk.sQ,children:[(0,E.jsx)(d7.o,{size:d?"md":"sm",color:er.A.colors.ICON_STRONG}),(0,E.jsx)(es.E,{variant:"text-sm/normal",color:"text-default",children:j.intl.format(SV.default.mXY4Rb,{onConnect:()=>{u(SL.Hx.CONNECT),(0,SI.A)({platformType:U.fg2.XBOX,location:"Connected Accounts Banner"})}})})]})]})]})})})]})}var SF=i(201718),SB=i(321078),Sz=i(672130),SY=i(379848),SX=i(567910);function SH(e){let{markAsDismissed:t}=e;return S.useEffect(()=>t(iA.i.UNKNOWN),[t]),(0,E.jsx)(sm.Lp,{className:SX.Ad,text:j.intl.string(j.t.y2b7CA)})}function SK(e){let{title:t,body:i,img:n,newIndicatorDismissibleContent:s,onClick:l}=e;return(0,E.jsxs)("div",{className:SX.kL,children:[n,(0,E.jsxs)("div",{className:SX.FS,children:[(0,E.jsxs)("div",{className:SX.TK,children:[(0,E.jsx)(SY.Ay,{contentTypes:[s],children:e=>{let{visibleContent:t,markAsDismissed:i}=e;return t===s?(0,E.jsx)(SH,{markAsDismissed:i}):null}}),(0,E.jsx)(es.E,{variant:"text-md/semibold",children:t})]}),(0,E.jsx)(es.E,{variant:"text-xs/normal",children:i})]}),(0,E.jsx)(eG.$,{text:j.intl.string(j.t.vD60Pv),onClick:l})]})}function SW(){let e=tI.A.getArticleURL(U.MVz.PS_CONNECTION);return(0,E.jsx)(SK,{title:j.intl.string(j.t.v20wwm),body:j.intl.format(j.t.lTZBit,{help_article:e}),img:(0,E.jsx)("img",{src:"/assets/88954903b6a5b9cc.svg",width:"82",height:"auto",alt:""}),newIndicatorDismissibleContent:eU.M.PS_ONE_WAY_RECONNECT,onClick:()=>(0,SI.A)({platformType:U.fg2.PLAYSTATION,location:"PS two way upsell"})})}let SZ="/assets/9df988a227916145.png";function Sq(){return(0,E.jsx)(SK,{title:j.intl.string(SV.default["9cLtDI"]),body:j.intl.format(SV.default["D+kUbg"],{learnMoreLink:tI.A.getArticleURL(U.MVz.XBOX_GAME_PASS_PERKS)}),img:(0,E.jsx)("img",{src:SZ,width:"auto",height:"45",alt:""}),newIndicatorDismissibleContent:eU.M.XBOX_PERKS_RECONNECT_UPSELL,onClick:()=>(0,SI.A)({platformType:U.fg2.XBOX,location:"Xbox perks reconnect upsell"})})}function SQ(){let e=tI.A.getArticleURL(U.MVz.XBOX_CONNECTION);return(0,E.jsx)(SK,{title:j.intl.string(j.t["2okkZV"]),body:j.intl.format(j.t.OnERSS,{help_article:e}),img:(0,E.jsx)("img",{src:SZ,width:"auto",height:"45",alt:""}),newIndicatorDismissibleContent:eU.M.XBOX_ONE_WAY_RECONNECT,onClick:()=>(0,SI.A)({platformType:U.fg2.XBOX,location:"Xbox two way upsell"})})}var SJ=i(783419),S$=i(534952),S0=i(452832),S1=i(113463);function S2(e){let t,{integration:i}=e,{isJoining:n,joinErrorMessage:s,showJoinErrorMessage:l}=(0,g.cf)([SM.A],()=>({isJoining:SM.A.isJoining(i.id),joinErrorMessage:""===SM.A.joinErrorMessage(i.id)?j.intl.string(j.t.j2d6Km):SM.A.joinErrorMessage(i.id),showJoinErrorMessage:void 0!==SM.A.joinErrorMessage(i.id)}),[i.id]);return null!=(0,g.bG)([ec.A],()=>ec.A.getGuild(i.guild.id),[i.guild.id])||(t=(0,E.jsx)(eG.$,{size:"sm",onClick:function(){Sx.A.joinServer(i.id,()=>{})},disabled:n,variant:"primary",text:n?j.intl.string(j.t.RXvQQu):j.intl.string(j.t.XpeFYr)})),(0,E.jsxs)("div",{className:S1.iA,children:[(0,E.jsxs)("div",{className:S1.XX,children:[(0,E.jsx)(g8.Ay,{size:g8.Ay.Sizes.SMALL,guild:i.guild,className:S1.$f}),(0,E.jsxs)("div",{className:S1.Vn,children:[(0,E.jsx)(es.E,{variant:"text-md/semibold",color:"text-strong",children:i.guild.name}),(0,E.jsx)(u5.Anchor,{href:Sf.A.get(i.type)?.getPlatformUserUrl?.(i.account),children:(0,E.jsx)(es.E,{variant:"text-xs/normal",color:"text-default",children:i.account.name})})]}),t]}),l&&(0,E.jsx)(es.E,{variant:"text-xs/normal",color:"text-feedback-critical",className:S1.R,children:s})]})}function S3(e){var t;let i,n,{account:s}=e,l=(t=s.id,i=(0,Sj.G)({location:"useShouldShowXboxPerksReconnectUpsell"}),n=(0,Sy.L)(sq.PremiumTypes.TIER_2),!i&&!n&&!/^\d+$/.test(t));return s.type===U.fg2.XBOX&&l?(0,E.jsx)(Sq,{}):s.twoWayLink?null:s.type===U.fg2.XBOX?(0,E.jsx)(SQ,{}):s.type===U.fg2.PLAYSTATION?(0,E.jsx)(SW,{}):null}function S6(e){let t,i,n,s,l,r,a,{onDisconnect:o,account:u,theme:d,locale:c}=e,[g,m]=S.useState(u.friendSync),[A,h]=S.useState(u.visibility),[T,x]=S.useState(u.metadataVisibility),[p,f]=S.useState(u.showActivity),[N,_]=S.useState(null),[I,C]=S.useState(null),[b,v]=S.useState(!1),[y,O]=S.useState([]),R=(0,SN.ML)(u.type),L=Sf.A.get(R);S.useEffect(()=>{m(u.friendSync),h(u.visibility),x(u.metadataVisibility),f(u.showActivity)},[u]);let D={inProgressVisibility:N,inProgressMetadataVisibility:I},P=S.useRef(D);return S.useEffect(()=>{P.current=D}),S.useEffect(()=>{if(!1===u.verified)return;let{inProgressVisibility:e,inProgressMetadataVisibility:t}=P.current;null!=e&&(h(e),Sx.A.setVisibility(u.type,u.id,e),_(null)),null!=t&&(x(t),Sx.A.setMetadataVisibility(u.type,u.id,t),C(null))},[u]),(0,E.jsxs)("div",{className:S1.FI,children:[(t=Sf.A.get(u.type),i=Sf.A.get(R),n="1"===(u.metadata??{})[SJ.pK.TWITTER_VERIFIED],s=null,t.type===U.fg2.TWITTER&&n&&(s=(0,E.jsx)(tr.m,{text:j.intl.string(j.t.Jebrww),children:(0,E.jsx)(th.A,{color:er.A.unsafe_rawColors.PLATFORM_TWITTER.css,children:(0,E.jsx)(ta.U,{size:"xs",color:er.A.unsafe_rawColors.WHITE.css})})})),(0,E.jsxs)("div",{className:S1.Il,children:[(0,E.jsx)("img",{alt:i.name,className:S1.gj,src:(0,gP.M)(d)?i.icon.darkSVG:i.icon.lightSVG}),(0,E.jsxs)("div",{children:[(0,E.jsxs)("div",{className:S1.$p,children:[(0,E.jsx)(es.E,{color:"text-strong",variant:"text-md/semibold",className:S1.RW,children:u.name}),null!=s&&(0,E.jsx)("div",{className:S1.cG,children:s})]}),(0,E.jsx)(es.E,{variant:"text-xs/normal",color:"text-default",className:S1.Au,children:i.migrationData?.getMigrationExperimentEnabled("User Settings Connections Web")?j.intl.format(S0.default.Glhokn,{platformName:i.name}):i.name})]}),(0,E.jsx)(en.D,{className:S1.uH,onClick:function(){let e=Sf.A.get(u.type);(0,K.openModal)(t=>(0,E.jsx)(rX.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:SC.has(u.type)&&u.twoWayLink&&(0,E.jsx)(aS.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,E.jsx)(gM.P,{size:"xs",color:"currentColor"})})]})),(0,E.jsx)(S3,{account:u}),function(e){let t=e.metadata??{},i=null,n=(0,S_.An)(t[SJ.pK.CREATED_AT],c);switch(e.type){case U.fg2.REDDIT:i=(0,Sb.xE)(t,S1.Nz);break;case U.fg2.STEAM:i=(0,Sb.dy)(t,S1.Nz);break;case U.fg2.BLUESKY:case U.fg2.TWITTER:case U.fg2.MASTODON:i=(0,Sb.ED)(t,S1.Nz);break;case U.fg2.EBAY:i=(0,Sb.ub)(t,S1.Nz);break;case U.fg2.PAYPAL:i=(0,Sb.gZ)(t,S1.Nz);break;case U.fg2.TIKTOK:i=(0,Sb.HU)(t,S1.Nz)}null!==n&&(null==i&&(i=[]),i?.push((0,E.jsx)(es.E,{variant:"text-xs/normal",color:"text-subtle",className:S1.M4,children:j.intl.format(j.t["9rfonh"],{date:n})},"member-since")));let s=y.includes(e.id),l=j.intl.string(j.t.wzzjk9);if(null==i||0===i.length)if(!0!==Sf.A.get(e.type).hasMetadata)return null;else i=[(0,E.jsx)(sm.Lp,{className:S1.Z3,text:j.intl.string(j.t.y2b7CA)},"badge"),(0,E.jsx)(es.E,{variant:"text-xs/normal",className:S1.vt,children:j.intl.format(j.t.Up2ni7,{helpdeskUrl:tI.A.getArticleURL(U.MVz.CONNECTION_DETAILS)})},"label")],l=j.intl.string(j.t["LVh3/5"]);return s&&(l=j.intl.string(j.t.i4jeWR)),i.push((0,E.jsx)("div",{className:S1.jy,children:(0,E.jsx)(eG.$,{text:l,variant:"secondary",size:"sm",loading:b,disabled:s,"aria-label":j.intl.string(j.t.sCkLYH),onClick:s?void 0:()=>{v(!0),Sx.A.refresh(e.type,e.id).finally(()=>{setTimeout(()=>{y.push(e.id),O(y),v(!1)},2e3)})}})},"refresh-button")),(0,E.jsx)("div",{className:S1.tJ,children:i})}(u),(U.txh.has(u.type)&&(l=(0,E.jsx)(J.d,{label:j.intl.string(j.t["+KCMSi"]),checked:g,onChange:function(e){m(e),Sx.A.setFriendSync(u.type,u.id,e)}})),U.ewM.has(u.type)&&(r=(0,E.jsx)(J.d,{label:j.intl.format(j.t["6u6J0q"],{platform:L.name}),checked:p,onChange:function(e){f(e),Sx.A.setShowActivity(u.type,u.id,e)}})),Sf.A.get(u.type)?.hasMetadata===!0&&(a=(0,E.jsx)(J.d,{label:j.intl.string(j.t.FYKGsL),checked:1===T,onChange:function(e){let{verified:t}=u,i=+!!e;if(e&&!t){C(i),(0,SI.A)({platformType:u.type,location:"User Settings"});return}x(i),Sx.A.setMetadataVisibility(u.type,u.id,i)},disabled:1!==A||null==u.metadata})),(0,E.jsxs)("div",{className:S1.HZ,children:[(0,E.jsx)(J.d,{label:j.intl.string(j.t.f7yOAX),checked:1===A,onChange:function(e){let{verified:t}=u,i=+!!e;if(e&&!t){_(i),(0,SI.A)({platformType:u.type,location:"User Settings"});return}h(i),Sx.A.setVisibility(u.type,u.id,i)}}),a,r,l]})),function(){if(u.revoked||u.integrations.length>0)return(0,E.jsx)(eM.c,{})}(),u.revoked?(0,E.jsx)(t_.p,{messageType:t_.Y.INFO,children:j.intl.format(j.t["6C4lgA"],{onReconnect:function(){(0,SI.A)({platformType:u.type,location:"User Settings"})}})}):u.integrations.length>0?(0,E.jsx)(s6.D,{label:j.intl.string(j.t.fOe3fZ),children:u.integrations.map(e=>(0,E.jsx)(S2,{integration:e},e.id))}):void 0,(0,E.jsx)(Sv.A,{partner:u.type})]})}function S5(e){let{appIdentity:t,oauth2Token:i}=e;return null==i?null:(0,E.jsxs)("div",{className:S1.FI,children:[function(e,t){let{application:i}=t,n=nn.Ay.getApplicationIconURL({id:i.id,icon:i.icon});return(0,E.jsxs)("div",{className:S1.Il,children:[(0,E.jsx)("img",{alt:i.name,className:e6()(S1.gj,S1.sN),src:n}),(0,E.jsxs)("div",{children:[(0,E.jsx)("div",{className:S1.$p,children:(0,E.jsx)(es.E,{color:"text-strong",variant:"text-md/semibold",className:S1.RW,children:e.profile.username})}),(0,E.jsx)(es.E,{variant:"text-xs/normal",color:"text-strong",className:S1.Au,children:i.name})]}),(0,E.jsx)(en.D,{className:S1.uH,onClick:()=>(0,SE.d1)(i,t.scopes,()=>{Sh.A.delete(t.id)}),"aria-label":j.intl.string(j.t.ppppRJ),focusProps:{offset:{top:-4,left:-4,right:-4}},children:(0,E.jsx)(gM.P,{size:"xs",color:"currentColor"})})]})}(t,i),(0,E.jsx)("div",{className:S1.HZ,children:(0,E.jsx)(J.d,{label:j.intl.string(j.t.f7yOAX),checked:t.profile?.connection_visible??!1,onChange:e=>{SF.A.updateApplicationIdentityConfig(i.application.id,t.provider_issued_user_id,{connection_visible:e})}})})]})}function S4(e){let t=Sf.A.get(e);(0,SI.A)({platformType:t.type}),G.default.track(U.HAw.ACCOUNT_LINK_STEP,{previous_step:"desktop connections",current_step:"desktop oauth",platform_type:t.type})}function S8(){let e=(0,SN.gn)(),t=(0,ti.A)((0,S$.Gl)("NewConnectionsList"));return(0,E.jsxs)("div",{className:S1.lA,children:[t.map(e=>null!=e&&(0,E.jsx)(Sz.A,{application:e,className:S1.__invalid_accountButton,innerClassName:S1.U$},e.id)),e.slice(0,10-t.length).map(e=>(0,E.jsx)(Sp.A,{type:e.type,className:S1.__invalid_accountButton,innerClassName:S1.U$},e.type)),(0,E.jsx)(tr.m,{text:j.intl.string(j.t.QqTz8b),children:(0,E.jsx)("div",{className:e6()(S1.ej,S1.__invalid_accountButton),children:(0,E.jsx)(ST.vN,{children:(0,E.jsx)("button",{className:e6()(S1.R8,S1.U$),type:"button",onClick:function(){su.h.dispatch({type:"CONNECTIONS_GRID_MODAL_SHOW",onComplete:S4})},"aria-label":j.intl.string(j.t.Zhcj9X),children:(0,E.jsx)(tL._,{color:"currentColor",size:"md","aria-label":j.intl.string(j.t.QqTz8b)})})})})})]})}function S7(e){let t,{fetching:i,accounts:n,appIdentities:s,authorizedApps:l,theme:r,locale:a}=e,u=(0,o.SV)("ConnectionsList"),d=S.useMemo(()=>n.filter(e=>Sf.A.isSupported(e.type)),[n]);return t=i?(0,E.jsx)(dd.y,{type:dd.y.Type.SPINNING_CIRCLE}):0===d.length&&0===s.length?(0,E.jsx)(iI.pp,{theme:r,className:u?S1.p$:void 0,children:(0,E.jsx)(iI.SG,{note:j.intl.string(j.t.WenGZ2),children:j.intl.string(j.t.aoLS84)})}):(0,E.jsxs)(E.Fragment,{children:[u&&(0,E.jsx)(eP.D,{variant:"heading-md/semibold",color:"text-strong",children:j.intl.format(j.t.AioIGb,{count:s.length+d.length})}),s.map((e,t)=>(0,E.jsx)(S5,{appIdentity:e,oauth2Token:l.find(t=>t.application.id===e.application_id)},`app-${t}`)),d.map((e,t)=>(0,E.jsx)(S6,{theme:r,account:e,locale:a,onDisconnect:()=>(function(e){let{type:t,id:i}=e;Sx.A.disconnect(t,i)})(e)},`connection-${t}`))]}),(0,E.jsx)("div",{className:S1.V,children:t})}let S9=(0,a.E2)(u.X.CONNECTIONS_ADD_CONNECTIONS_SETTING,{Component:function(){let e=(0,o.SV)("NewConnectSection");return(0,E.jsx)(s6.D,{label:j.intl.string(e?j.t["t+aGse"]:j.t.ZeDrUf),description:e?void 0:j.intl.format(j.t["oYc+Gz"],{privacyPolicyUrl:U.X7G.PRIVACY}),children:(0,E.jsx)(S8,{})})},useSearchTerms:()=>[j.intl.string(j.t.ZeDrUf),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"])]}),Te=(0,a.E2)(u.X.CONNECTIONS_CONNECTED_ACCOUNTS_SETTING,{Component:function(){let e=(0,g.bG)([eF.A],()=>eF.A.hidePersonalInformation),t=(0,g.bG)([SM.A],()=>SM.A.isFetching()),i=(0,g.bG)([SM.A],()=>SM.A.getAccounts()),{authorizedAppsFetchState:n,authorizedApps:s}=(0,g.cf)([SO.default],()=>({authorizedAppsFetchState:SO.default.getFetchState(),authorizedApps:SO.default.getNewestTokensForNonChildrenApplications()})),{isLoading:l,filteredAppIdentities:r}=(0,SB.A)(id.default.getCurrentUser().id,{includeHidden:!0}),a=(0,cH.Ay)(),o=(0,g.bG)([dq.default],()=>dq.default.locale);return(S.useEffect(()=>{n===SO.FetchState.NOT_FETCHED&&Sh.A.fetch()},[n]),e)?null:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(Sw,{}),(0,E.jsx)(S7,{fetching:t||l||r.length>0&&n!==SO.FetchState.FETCHED,accounts:i,appIdentities:r,authorizedApps:s,theme:a,locale:o})]})},initialize:()=>{Sx.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 Tt=i(206828);function Ti(){let e=(0,g.bG)([SM.A],()=>SM.A.getAccounts()),t=S.useMemo(()=>Sf.A.filter(e=>e.migrationData?.getMigrationExperimentEnabled("ConnectionDeprecationInlineNotice")===!0).filter(t=>e.some(e=>e.type===t.type)),[e]),[i,n]=S.useState(0),[s,l]=S.useState(t),r=t!==s;r&&(l(t),n(0));let a=S.useMemo(()=>t[i],[t,i]),o=(0,ti.h)(a?.migrationData?.replacedBy),{canStartAuthorization:u,hasAlreadyLinked:d,fetched:c}=(0,Tt.RD)(o),m=a?.type===U.fg2.RIOT_GAMES||a?.type===U.fg2.LEAGUE_OF_LEGENDS?j.intl.string(S0.default["1S6oAo"]):o?.name,A=null!=a&&c,E=A&&!d&&u&&o?.connectionEntrypointUrl!=null;return r||!A||E||n(e=>e+1),S.useMemo(()=>E?{type:h.lT.INLINE_NOTICE,noticeType:"info",useText:()=>j.intl.format(S0.default.wUXupS,{connectionName:a.name,applicationName:m,connectionEntrypointUrl:o?.connectionEntrypointUrl,helpCenterLink:a.migrationData?.helpCenterLinkIntlMessage!=null?j.intl.string(a.migrationData.helpCenterLinkIntlMessage):void 0})}:null,[a,m,o,E])}let Tn=(0,a.zZ)(u.X.CONNECTIONS_CATEGORY,{useTitle:()=>j.intl.string(j.t["3fe7U5"]),useSubtitle:()=>j.intl.string(j.t.U22vw6),useInlineNotice:Ti,buildLayout:()=>[S9,Te]}),Ts=(0,a.zZ)(u.X.AUTHORIZED_APPS_CATEGORY,{useTitle:()=>j.intl.string(j.t["f6kk+r"]),useSubtitle:()=>j.intl.string(j.t.G9JfLg),buildLayout:()=>[SS],initialize:()=>(Sh.A.fetch(),()=>{SE.iU.setState({searchQuery:""})})}),Tl=(0,a.t_)(u.X.CONNECTED_APPS_PANEL,{useTitle:()=>j.intl.string(j.t.lrVuZO),useObscuredNotice:da.L,buildLayout:()=>[Tn,Ts]}),Tr=(0,a.i4)(u.X.CONNECTED_APPS_SIDEBAR_ITEM,{useTitle:()=>j.intl.string(j.t.lrVuZO),icon:Eg.q,buildLayout:()=>[Tl]}),Ta=(0,a.WI)(u.X.GAMES_AND_APPS_SECTION,{useTitle:()=>j.intl.string(j.t.BA9200),buildLayout:()=>[i2,eR,ix,Tr]});var To=i(631670),Tu=i(619499),Td=i(836602),Tc=i(591179),Tg=i(854627),Tm=i(975732),TA=i(761508),Th=i(159001),TE=i(344346),TS=i(919395),TT=i(699217);function Tx(e){let{title:t,children:i}=e;return(0,E.jsxs)("div",{children:[(0,E.jsx)(eP.D,{variant:"text-md/medium",className:TT.Vf,children:t}),i]})}function Tp(e){let{children:t,className:i,layoutClassName:n,profilePreview:s,profilePreviewTitle:l,nameplatePreview:r,stickyPreview:a=!0}=e;return(0,E.jsx)("div",{className:e6()(TT.UA,i),children:(0,E.jsxs)("div",{className:e6()(TT.yt,n),children:[(0,E.jsx)("div",{className:e6()(TT.Fp,a&&TT.Oz),children:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(Tx,{title:l??j.intl.string(j.t.Zb06yP),children:s}),null!=r?(0,E.jsx)(Tx,{title:j.intl.string(j.t.x5CoXR),children:r}):null]})}),(0,E.jsx)("div",{className:TT.oB,children:t})]})})}var Tf=i(986687),TN=i(101058),T_=i(321191),TI=i(696451),TC=i(271078);function Tb(){return(0,E.jsxs)("div",{className:TC.p$,children:[(0,E.jsx)("img",{src:"/assets/b3b15f93f9f43174.svg",alt:"",className:TC.Sl}),(0,E.jsx)(eP.D,{className:TC.h8,variant:"heading-lg/extrabold",children:j.intl.string(j.t.Z1OZCV)}),(0,E.jsx)(es.E,{className:TC.h8,variant:"text-md/normal",children:j.intl.string(j.t.ZSt4Tt)}),(0,E.jsx)("div",{"data-button-hoisted-classname-wrapper":!0,className:TC.h8,children:(0,E.jsx)(eG.$,{variant:"primary",text:j.intl.string(j.t.jQ3pqt),onClick:function(){(0,s5.pX)(U.BVt.GUILD_DISCOVERY),(0,sX.default)()}})})]})}var Tv=i(81400),Ty=i(252732),Tj=i(355622),TO=i(408018),TR=i(138617),TL=i(594943);let TD=(0,sW.Ld)(),TP=(0,ia.createChannelRecord)({id:"1",type:U.rbe.DM}),TG=(0,sW.Ld)();function TM(e){let{sectionTitle:t,errors:i,onBioChange:n,pendingBio:s,placeholder:l,currentBio:r,disabled:a=!1}=e,[o,u]=S.useState(s??r),[d,c]=S.useState((0,TO.x7)(o)),g=S.useRef(r),m=S.useRef(!1);return S.useEffect(()=>{if(g.current!==r){let e=(0,TO.x7)(r);u(r),c(e)}g.current=r},[r]),S.useEffect(()=>{void 0!==s||o===r||m.current||(u(r),c((0,TO.x7)(r)))},[s,r,o]),(0,E.jsxs)(ul.A,{title:t,titleId:TD,description:j.intl.string(j.t.Bbw6Ac),errors:i,disabled:a,children:[(0,E.jsx)(TR.Ay,{"aria-describedby":TG,"aria-labelledby":TD,className:TL.i,innerClassName:TL.Z,maxCharacterCount:U.NA2,onChange:function(e,t,i){t!==o&&(u(t),c(i),n(t))},placeholder:l,channel:TP,textValue:o,richValue:d,emojiPickerCloseOnModalOuterClick:!0,parentModalKey:eH.USER_SETTINGS_MODAL_KEY,type:Tj.oU.PROFILE_BIO_INPUT,onBlur:()=>{m.current=!1},onFocus:()=>{m.current=!0},focused:m.current,onSubmit:function(){return new Promise(e=>{e({shouldClear:!1,shouldRefocus:!0})})}}),(0,E.jsx)(eo.A,{id:TG,children:j.intl.format(j.t["+DFxLc"],{maxLength:U.NA2})})]})}var TU=i(930861),TV=i(821956),Tk=i(562819),Tw=i(84540),TF=i(70956);function TB(e){let{user:t,guild:i,className:n,sectionTitle:s,forcedDivider:l=!1,withTutorial:r=!1}=e,{analyticsLocations:a}=(0,nQ.Ay)(),o=(0,TS.a4)({user:t,guildId:i?.id}),{pendingAvatarDecoration:u,errors:d}=(0,TS.CP)(i?.id),c=r?TU.wL:a8.$n;return(0,E.jsx)(ul.A,{className:n,forcedDivider:l,hasBackground:!0,title:s,errors:d,children:(0,E.jsxs)("div",{className:TF.NC,children:[(0,E.jsx)(c,{size:a8.$n.Sizes.SMALL,onClick:function(){(0,Tk.L)({analyticsLocations:a,guild:i})},className:e6()({[TF.yj]:r}),children:j.intl.string(j.t.BVcYCx)}),(void 0===u?null!=o:null!=u)&&(0,E.jsx)("div",{"data-button-hoisted-classname-wrapper":!0,className:TF.DT,children:(0,E.jsx)(eG.$,{variant:"secondary",size:"sm",text:(0,TV.uZ)(t,i)?j.intl.string(j.t.CHf9iJ):j.intl.string(j.t.OrokWm),onClick:function(){(0,Tw.p)({guildId:i?.id,avatarDecoration:null})}})})]})})}var Tz=i(339984),TY=i(831653);let TX=[{name:"gif",extensions:["gif"]}];function TH(e){let{showRemoveAvatarButton:t,errors:i,onAvatarChange:n,sectionTitle:s,changeAvatarButtonText:l,guildId:r,className:a,disabled:o=!1,isTryItOut:u=!1,forcedDivider:d,withHighlight:c=!1}=e,{newestAnalyticsLocation:g}=(0,nQ.Ay)(),m=c?TU.wL:a8.$n,A=S.useCallback(()=>{(0,Ty.XD)({uploadType:Tz.HL.AVATAR,analyticsSource:g,filters:u?TX:void 0,guildId:r,isTryItOut:u})},[r,g,u]);return(0,E.jsx)(ul.A,{className:a,title:s,errors:i,disabled:o,forcedDivider:d,children:(0,E.jsxs)("div",{className:TY.NC,children:[(0,E.jsx)(m,{className:e6()({[TY.yj]:c}),size:a8.$n.Sizes.SMALL,onClick:A,children:l??j.intl.string(j.t["4OynCD"])}),t&&(0,E.jsx)("div",{"data-button-hoisted-classname-wrapper":!0,className:TY.DT,children:(0,E.jsx)(eG.$,{variant:"secondary",size:"sm",text:null!=r?j.intl.string(j.t.TDjKDm):j.intl.string(j.t.twB3fz),onClick:()=>n(null)})})]})})}var TK=i(248778),TW=i(479183);function TZ(e){let{user:t,guildId:i,className:n}=e,s=uc.Ay.canUsePremiumProfileCustomization(t),{analyticsLocations:l}=(0,nQ.Ay)(),{userDisplayNameStyles:r,guildDisplayNameStyles:a,pendingDisplayNameStyles:o,pendingErrors:u}=(0,TS.B0)(t,i),d=(0,TK.ux)("DisplayNameStylesSection"),[c,g]=(0,eV.kn)(d?[eU.M.DISPLAY_NAME_STYLES_FLYWHEEL_NEW_BADGE_PROFILE_PAGE]:[]),m=c===eU.M.DISPLAY_NAME_STYLES_FLYWHEEL_NEW_BADGE_PROFILE_PAGE,A=(0,S.useCallback)(()=>{g(iA.i.TAKE_ACTION),G.default.track(U.HAw.DISPLAY_NAME_STYLES_FROM_SETTINGS),(0,nJ.L)({analyticsLocations:l,guildId:i})},[l,i,g]),h=(0,S.useCallback)(()=>{(0,Tw.p)({displayNameStyles:null}),G.default.track(U.HAw.DISPLAY_NAME_STYLES_REMOVED)},[]),T=(0,S.useCallback)(()=>{(0,Tw.p)({guildId:i,displayNameStyles:null})},[i]),x=void 0!==o?o:null!=i?a:r;return(0,E.jsx)(ul.A,{title:j.intl.string(n$.default["86GtGH"]),titleBadge:m?(0,E.jsx)(sm.Lp,{text:j.intl.string(j.t.y2b7CA),className:TW.A}):void 0,className:n,showPremiumIcon:s,errors:u,children:(0,E.jsxs)("div",{className:TW.N,children:[(0,E.jsx)(eG.$,{variant:"primary",size:"sm",text:j.intl.string(n$.default.vJqrIg),onClick:A}),null==i&&null!=x&&(0,E.jsx)(eG.$,{variant:"secondary",size:"sm",text:j.intl.string(n$.default.ymq8WQ),onClick:h}),null!=i&&null!=x&&(0,E.jsx)(eG.$,{variant:"secondary",size:"sm",text:j.intl.string(n$.default["j/KRxc"]),onClick:T})]})})}var Tq=i(637193),TQ=i(946801);function TJ(e){let{user:t,guild:i,titleIcon:n}=e,{analyticsLocations:s}=(0,nQ.Ay)(),l=null!=i,{userNameplate:r,guildNameplate:a,pendingNameplate:o,pendingErrors:u}=(0,TS.rv)(t,i?.id),d=S.useCallback(()=>{(0,Tq.p)({analyticsLocations:s,guildId:i?.id})},[s,i?.id]),c=S.useCallback(()=>{(0,Tw.p)({guildId:i?.id,nameplate:null})},[i?.id]);return(0,E.jsx)(ul.A,{title:j.intl.string(j.t.x5CoXR),titleIcon:n,errors:u,children:(0,E.jsxs)("div",{className:TQ.u,children:[(0,E.jsx)(eG.$,{variant:"primary",size:"sm",text:j.intl.string(j.t.BwdeM1),onClick:d}),(void 0===o?(l?a:r)!=null:null!=o)&&(0,E.jsx)(eG.$,{variant:"secondary",size:"sm",text:l?j.intl.string(j.t.CHf9iJ):j.intl.string(j.t["9zwziY"]),onClick:c})]})})}var T$=i(617255);function T0(e){let{showRemoveBannerButton:t,errors:i,onBannerChange:n,guildId:s,className:l,disabled:r=!1,showPremiumIcon:a=!0,isTryItOut:o=!1,forcedDivider:u,withHighlight:d=!1}=e,{newestAnalyticsLocation:c}=(0,nQ.Ay)(),g=d?TU.wL:a8.$n;return(0,E.jsx)(ul.A,{className:l,title:j.intl.string(j.t.Vgdusv),showPremiumIcon:a,errors:i,disabled:r,forcedDivider:u,children:(0,E.jsxs)("div",{className:T$.NC,children:[(0,E.jsx)(g,{className:e6()({[T$.yj]:d}),size:a8.$n.Sizes.SMALL,onClick:()=>(0,Ty.XD)({uploadType:Tz.HL.BANNER,analyticsSource:c,guildId:s,isTryItOut:o}),children:j.intl.string(j.t.N0bC3P)}),t&&(0,E.jsx)("div",{"data-button-hoisted-classname-wrapper":!0,className:T$.DT,children:(0,E.jsx)(eG.$,{variant:"secondary",size:"sm",text:null!=s?j.intl.string(j.t.jHlJNS):j.intl.string(j.t.tT9n7D),onClick:()=>n(null)})})]})})}var T1=i(617061),T2=i(869438);function T3(e){let{user:t,guild:i,initialSelectedEffect:n,className:s,sectionTitle:l,forcedDivider:r=!1,withTutorial:a=!1,showBorder:o=!1}=e,{analyticsLocations:u}=(0,nQ.Ay)(),d=uc.Ay.canUsePremiumProfileCustomization(t),c=(0,TS.N2)({user:t,guildId:i?.id}),{pendingProfileEffect:g,errors:m}=(0,TS.nZ)(i?.id);S.useEffect(()=>{d&&G.default.track(U.HAw.PREMIUM_UPSELL_VIEWED,{type:sq.e.PROFILE_EFFECTS_INLINE_SETTINGS,location_stack:u})},[d,u]);let A=a?TU.wL:a8.$n;return(0,E.jsx)(ul.A,{forcedDivider:r,borderType:cN.i.PREMIUM,hasBackground:!0,title:l,showBorder:o,errors:m,className:s,children:(0,E.jsxs)("div",{className:T2.NC,children:[(0,E.jsx)(A,{size:a8.$n.Sizes.SMALL,onClick:function(){(0,T1.W)({analyticsLocations:u,guild:i,initialSelectedEffect:n})},className:e6()({[T2.yj]:a}),children:j.intl.string(j.t["/dRfCf"])}),(void 0===g?null!=c:null!=g)&&(0,E.jsx)("div",{"data-button-hoisted-classname-wrapper":!0,className:T2.DT,children:(0,E.jsx)(eG.$,{variant:"secondary",size:"sm",text:null!=i?j.intl.string(j.t.CHf9iJ):j.intl.string(j.t.uMuafO),onClick:function(){(0,Tw.p)({guildId:i?.id,profileEffect:null})}})})]})})}var T6=i(13875),T5=i(515727),T4=i(566935);function T8(e){let{user:t,guild:i,sectionTitle:n}=e,{analyticsLocations:s}=(0,nQ.Ay)(),l=(0,T6.sk)("ProfileFrameSection"),r=(0,TS.Xf)({user:t,guildId:i?.id}),{pendingProfileFrame:a,errors:o}=(0,TS.Tu)(i?.id),[u,d]=(0,eV.kn)([eU.M.PROFILE_FRAME_USER_PROFILE_NEW_BADGE]),c=u===eU.M.PROFILE_FRAME_USER_PROFILE_NEW_BADGE;return l?(0,E.jsx)(ul.A,{showBorder:c,borderType:c?cN.i.NEW_UPSELL:cN.i.PREMIUM,hasBackground:c,title:n,titleBadge:c?(0,E.jsx)(sm.Lp,{text:j.intl.string(j.t.y2b7CA),className:T4.Ad}):void 0,description:c?j.intl.string(j.t.yMoMAt):void 0,errors:o,children:(0,E.jsxs)("div",{className:T4.NC,children:[(0,E.jsx)(eG.$,{variant:"primary",size:"sm",text:j.intl.string(j.t["9/hmle"]),onClick:function(){(0,T5.w)({analyticsLocations:s,guild:i}),d(iA.i.TAKE_ACTION)}}),(void 0===a?null!=r:null!=a)&&(0,E.jsx)("div",{"data-button-hoisted-classname-wrapper":!0,className:T4.DT,children:(0,E.jsx)(eG.$,{variant:"secondary",size:"sm",text:null!=i?j.intl.string(j.t.CHf9iJ):j.intl.string(j.t.nQBruk),onClick:function(){(0,Tw.p)({guildId:i?.id,profileFrame:null})}})})]})}):null}var T7=i(602853),T9=i(654107),xe=i(999291),xt=i(101928),xi=i(317097),xn=i(508274),xs=i(919796),xl=i(426399);function xr(e){let{onChange:t,onClose:i,color:n,suggestedColors:s,disabled:l,label:r,colorPickerMiddle:a,colorPickerFooter:o,showEyeDropper:u}=e,d=S.useRef(null),c=(0,T7.r)(er.A.colors.BACKGROUND_BASE_LOW).hex(),g=er.A.colors.BACKGROUND_MOD_MUTED.css,m=(0,Ty.sN)(n),A=(0,xi.Hl)(n),h=A===c?g:A,T=m?er.A.unsafe_rawColors.WHITE.css:er.A.unsafe_rawColors.PRIMARY_530.css,x=(0,xs.A)(a),p=(0,xs.A)(o),[f,N]=S.useState((0,dc.A)());return S.useEffect(()=>{(x!==a||p!==o)&&N((0,dc.A)())},[o,a,p,x]),(0,E.jsx)(ee.Y,{targetElementRef:d,positionKey:f,renderPopout:e=>(0,E.jsx)(xn.VN,{...e,value:n,onChange:t,suggestedColors:s,middle:a,footer:o,showEyeDropper:u}),onRequestClose:i,children:e=>{let{onClick:t,...i}=e;return(0,E.jsxs)("div",{ref:d,className:e6()(xl.oP,{[xl.r9]:l}),children:[(0,E.jsx)(en.D,{...i,tabIndex:l?-1:0,onClick:l?U.tEg:t,style:{backgroundColor:A,borderColor:h},className:xl.nf,"aria-label":j.intl.string(j.t.Qp04hK),focusProps:{ringTarget:d},children:(0,E.jsx)(ud.R,{size:"custom",className:xl.BW,width:14,height:14,color:T})}),r]})}})}var xa=i(811160);function xo(e){let{user:t,pendingAvatarSrc:i,pendingColors:n,onThemeColorsChange:s,preventDisabled:l,guildId:r,className:a,showPremiumIcon:o=!0,showResetThemeButton:u=!1,forcedDivider:d}=e,c=(0,xe.Ay)(t.id,r),{primaryColor:g,secondaryColor:m}=(0,xt.A)({user:t,displayProfile:c,pendingThemeColors:n,isPreview:!0}),A=uc.Ay.canUsePremiumProfileCustomization(t),h=null!=i?i:t.getAvatarURL(r,80),S=(0,T7.r)(er.A.unsafe_rawColors.PRIMARY_530).hex(),T=(0,T9.rh)(h,S,!1);return null==g||null==m?null:(0,E.jsx)(ul.A,{title:j.intl.string(j.t.DMeO2X),disabled:!A&&!l,className:e6()(xa.__invalid_profileThemesSection,a),showPremiumIcon:o,forcedDivider:d,children:(0,E.jsxs)("div",{className:xa.hd,children:[(0,E.jsx)("div",{className:xa.YX,children:(0,E.jsx)(xr,{onChange:e=>s([e,m]),color:g,suggestedColors:T,showEyeDropper:!0,label:(0,E.jsx)(es.E,{className:xa.yz,color:"text-default",variant:"text-xs/normal","aria-hidden":!0,children:j.intl.string(j.t.C3KTQk)})})}),(0,E.jsx)("div",{className:xa.YX,children:(0,E.jsx)(xr,{onChange:e=>s([g,e]),color:m,suggestedColors:T,showEyeDropper:!0,label:(0,E.jsx)(es.E,{className:xa.yz,color:"text-default",variant:"text-xs/normal","aria-hidden":!0,children:j.intl.string(j.t["8elvy6"])})})}),u&&null!=r&&(0,E.jsx)("div",{"data-button-hoisted-classname-wrapper":!0,className:xa.WA,children:(0,E.jsx)(eG.$,{variant:"secondary",size:"sm",text:j.intl.string(j.t["L+GmoR"]),onClick:()=>s([null,null])})})]})})}function xu(e){let{sectionTitle:t,errors:i,onPronounsChange:n,pendingPronouns:s,placeholder:l,currentPronouns:r,disabled:a=!1}=e,o=(0,sW.GV)();return(0,E.jsx)(ul.A,{title:t,titleId:o,errors:i,disabled:a,children:(0,E.jsx)(rH.k,{"aria-labelledby":o,placeholder:l??j.intl.string(j.t.NPEUUu),maxLength:40,value:s??r,onChange:function(e){n(e===r?void 0:e)},disabled:a})})}var xd=i(427262),xc=i(684732),xg=i(576705),xm=i(522334);function xA(e){let{errors:t,pendingNick:i,currentNick:n,username:s,user:l,guild:r}=e,a=(0,g.bG)([xg.A],()=>xg.A.can(U.xBc.CHANGE_NICKNAME,r)||xg.A.can(U.xBc.MANAGE_NICKNAMES,r)),o=(0,Sy.L)(sq.PremiumTypes.TIER_2);return(0,E.jsxs)(ul.A,{title:j.intl.string(j.t.me1lRk),errors:t,children:[(0,E.jsx)(rH.k,{value:i??n??"",placeholder:s,maxLength:U.d0r,onChange:function(e){(0,Tw.p)({guildId:r.id,nickname:e})},disabled:!a,helperText:a?void 0:j.intl.string(j.t.gzjxQi)}),o&&(0,E.jsx)(TZ,{user:l,guildId:r.id,className:xm.F})]})}var xh=i(816453);let xE="/assets/b25da78aa7949feb.png";function xS(e){let{user:t,showOverlay:i,children:n}=e,s=(0,cH.Ay)(),{analyticsLocations:l}=(0,nQ.Ay)(e1.A.PREMIUM_UPSELL_OVERLAY);return(S.useEffect(()=>{i&&G.default.track(U.HAw.PREMIUM_UPSELL_VIEWED,{location_stack:l,type:sq.e.PREMIUM_GUILD_MEMBER_PROFILE_UPSELL_INLINE})},[i,l]),i)?(0,E.jsxs)("div",{className:xh.ry,children:[(0,E.jsx)("div",{children:n}),(0,E.jsxs)("div",{className:xh.Wc,children:[(0,E.jsx)("img",{className:xh.Tn,alt:j.intl.string(j.t.LHFZQy),src:function(e){switch(e){case U.NJ8.DARK:case U.NJ8.DARKER:case U.NJ8.MIDNIGHT:return xE;case U.NJ8.LIGHT:return"/assets/a98f1410707fafea.png";default:return xE}}(s)}),(0,E.jsxs)("div",{className:xh._9,children:[(0,E.jsx)(es.E,{variant:"text-lg/semibold",color:"text-overlay-light",children:j.intl.string(j.t.dMaDFX)}),(0,E.jsx)(es.E,{variant:"text-sm/normal",color:"text-overlay-light",children:j.intl.string(j.t.F7sgFH)})]}),(0,E.jsx)(cf.A,{size:a8.$n.Sizes.LARGE,color:a8.$n.Colors.GREEN,textOptions:{textOverride:uc.Ay.isPremium(t)?j.intl.string(j.t.AfRWI8):j.intl.string(j.t.nkdUym)},subscriptionTier:sq.pe.TIER_2})]})]}):n}var xT=i(784075);function xx(){let e=(0,g.bG)([id.default],()=>{let e=id.default.getCurrentUser();return tX()(null!=e,"GuildIdentitySettingsPage: user cannot be undefined"),e}),t=(0,Sy.L)(sq.PremiumTypes.TIER_2),i=(0,g.bG)([Td.A,ec.A],()=>ec.A.getGuild(Td.A.selectedGuildId));tX()(null!=i,"guild should not be null");let{pendingAvatar:n,pendingNickname:s,pendingBanner:l,pendingBio:r,pendingPronouns:a,pendingThemeColors:o,errors:u}=(0,g.cf)([Td.A],()=>({...Td.A.getPendingChanges(i.id),errors:Td.A.getErrors(i.id)})),d=(0,TN.V7)({userId:e.id,image:n}),c=(0,Tv.EC)(i.id),m=(0,g.bG)([TI.Ay],()=>null==i.id?null:TI.Ay.getMember(i.id,e.id)),A=(0,g.bG)([T_.A],()=>T_.A.getGuildMemberProfile(e.id,i.id)),h=uc.Ay.canUsePremiumProfileCustomization(e),S=(0,TS.z5)(n,m?.avatar),T=(0,TS.Ac)(l,A?.banner),x=(0,xc.l)(o,A?.themeColors),p=A?.bio??"",f=A?.pronouns??"";return(0,E.jsxs)("div",{className:xT.Q,children:[(0,E.jsx)(xA,{errors:u?.nick??c?.nick,username:xd.Ay.getName(e),pendingNick:s,currentNick:m?.nick,user:e,guild:i},"nick"),(0,E.jsx)(xu,{sectionTitle:j.intl.string(j.t["+T3RI/"]),errors:u?.pronouns,onPronounsChange:e=>(0,Tw.p)({guildId:i.id,pronouns:e}),pendingPronouns:a,currentPronouns:f},"pronouns"),(0,E.jsxs)(xS,{user:e,showOverlay:!h,children:[(0,E.jsx)(TH,{sectionTitle:(0,E.jsxs)(E.Fragment,{children:[j.intl.string(j.t.lqaIxI),(0,E.jsx)(tr.m,{text:j.intl.string(j.t["5AFxuK"]),children:(0,E.jsx)(ui.t,{size:"md",color:"currentColor",className:xT.a})})]}),showRemoveAvatarButton:S,onAvatarChange:function(e){if(null!=i)return(0,Ty.rM)(e,m?.avatar,e=>(0,Tw.p)({guildId:i.id,avatar:e}))},errors:u?.avatar,guildId:i.id,disabled:!h},"avatar"),(0,E.jsx)(TB,{sectionTitle:(0,E.jsxs)(E.Fragment,{children:[j.intl.string(j.t["7v0T9P"]),(0,E.jsx)(tr.m,{text:j.intl.string(j.t["5AFxuK"]),children:(0,E.jsx)(ui.t,{size:"md",color:"currentColor",className:xT.a})})]}),user:e,guild:i},"decoration"),!t&&(0,E.jsx)(TZ,{user:e,guildId:i.id}),(0,E.jsx)(TJ,{user:e,guild:i,titleIcon:(0,E.jsx)(tr.m,{text:j.intl.string(j.t["5AFxuK"]),children:(0,E.jsx)(ui.t,{size:"md",color:"currentColor",className:xT.a})})},"nameplate"),(0,E.jsx)(T3,{sectionTitle:(0,E.jsxs)(E.Fragment,{children:[j.intl.string(j.t.wR5wOo),(0,E.jsx)(tr.m,{text:j.intl.string(j.t["5AFxuK"]),children:(0,E.jsx)(ui.t,{size:"md",color:"currentColor",className:xT.a})})]}),user:e,guild:i},"effect"),(0,E.jsx)(T8,{user:e,guild:i,sectionTitle:(0,E.jsxs)(E.Fragment,{children:[j.intl.string(j.t.GWrZOd),(0,E.jsx)(tr.m,{text:j.intl.string(j.t["5AFxuK"]),children:(0,E.jsx)(ui.t,{size:"md",color:"currentColor",className:xT.a})})]})},"frame"),(0,E.jsx)(T0,{showRemoveBannerButton:T,errors:u?.banner,onBannerChange:function(e){if(null!=i)return(0,Ty.rM)(e,A?.banner,e=>(0,Tw.p)({guildId:i.id,banner:e}))},guildId:i.id,disabled:!h},"banner"),(0,E.jsx)(xo,{user:e,pendingAvatarSrc:d,pendingColors:o,onThemeColorsChange:e=>(0,Tw.p)({guildId:i.id,themeColors:e}),guildId:i.id,showResetThemeButton:x}),(0,E.jsx)(TM,{placeholder:j.intl.string(j.t["/7NKgv"]),sectionTitle:(0,E.jsxs)(E.Fragment,{children:[j.intl.string(j.t.ZzAR2Y),(0,E.jsx)(tr.m,{text:j.intl.string(j.t["5AFxuK"]),children:(0,E.jsx)(ui.t,{size:"md",color:"currentColor",className:xT.a})})]}),onBioChange:e=>(0,Tw.p)({guildId:i.id,bio:e}),errors:u?.bio??c?.bio,pendingBio:r,currentBio:p,disabled:!h},"about")]})]})}var xp=i(379550);function xf(e){(0,K.openModalLazy)(async()=>{let{default:t}=await Promise.all([i.e("41509"),i.e("66901"),i.e("61129")]).then(i.bind(i,475312));return i=>(0,E.jsx)(t,{source:{...e,page:U.liQ.GUILD_MEMBER_PROFILE_SETTINGS},...i})})}function xN(e){let{selectedGuild:t,onGuildChange:i}=e,{analyticsLocations:n}=(0,nQ.Ay)(e1.A.USER_SETTINGS_GUILD_PROFILE),s=(0,g.bG)([id.default],()=>{let e=id.default.getCurrentUser();return tX()(null!=e,"GuildIdentitySettingsPage: user cannot be undefined"),e}),l=(0,g.bG)([TI.Ay],()=>null!=t?TI.Ay.getMember(t.id,s.id):null),r=(0,g.bG)([T_.A],()=>!T_.A.isFetchingProfile(s.id,t?.id)),a=(0,g.bG)([eF.A],()=>eF.A.hidePersonalInformation),{pendingAvatar:o,pendingNameplate:u,...d}=(0,g.cf)([Td.A],()=>Td.A.getPendingChanges(t?.id)),c=(0,TN.V7)({userId:s.id,image:o}),m=(0,TS.lw)({pendingValue:u,userValue:s?.collectibles?.nameplate,guildValue:l?.collectibles?.nameplate,guildId:t?.id}),{pendingDisplayNameStyles:A}=(0,TS.B0)(s,t?.id);return(S.useEffect(()=>()=>su.h.wait(Th.IM),[]),a)?(0,E.jsx)(da.A,{}):r?(0,E.jsxs)(nQ.f5,{value:n,children:[(0,E.jsx)(es.E,{variant:"text-sm/normal",children:j.intl.format(j.t["/PTB2E"],{helpCenterLink:tI.A.getArticleURL(U.MVz.GUILD_PROFILES)})}),null!=t?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(us.A,{guildId:t.id,onChange:i}),(0,E.jsx)(Tp,{profilePreviewTitle:(0,E.jsx)(eP.D,{variant:"heading-md/medium",className:xp.YV,children:j.intl.formatToPlainString(j.t.Tc0slG,{guildName:t?.name})}),profilePreview:(0,E.jsx)(Tf.A,{...d,pendingAvatar:c,pendingDisplayNameStyles:A,user:s,guild:t,canUsePremiumCustomization:uc.Ay.canUsePremiumProfileCustomization(s),onUpsellClick:xf,containerClassName:xp.ti}),nameplatePreview:(0,E.jsx)(TE.A,{...d,pendingDisplayNameStyles:A,user:s,guildId:t?.id,nameplate:m,className:null==m?xp.tJ:void 0,isHighlighted:!0}),children:(0,E.jsx)(xx,{})})]}):(0,E.jsx)(Tb,{})]}):(0,E.jsx)(dd.y,{})}var x_=i(903209),xI=i(834297);function xC(e){let{children:t,notice:i}=e;return(0,E.jsxs)("div",{className:xI.r,children:[i,(0,E.jsx)("div",{children:t})]})}var xb=i(269115),xv=i(823092),xy=i(34332),xj=i(379197),xO=i(488430),xR=i(457421),xL=i(940622),xD=i(25176),xP=i(341206);let xG=function(){let e,t,i,n,{analyticsLocations:s}=(0,nQ.Ay)(e1.A.COLLECTIBLES_PROFILE_SETTINGS_UPSELL),l=S.useRef(null),{asset:r,popoutAsset:a,title:o,body:u,version:d,revertTextColor:c}=(e=(0,xL.mb)(xD.RN.UPSELL_BANNER),t=(0,xL.mb)(xD.RN.UPSELL_BANNER_POPOUT),i=(0,g.bG)([xR.A],()=>xR.A.getMarketingBySurface(xj.R.EDIT_PROFILE_SETTINGS)),n=S.useMemo(()=>null!=i?i:{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},[i]),S.useMemo(()=>({...n,type:xO.G.BANNER,asset:e??n.asset,popoutAsset:t??n.popoutAsset}),[e,t,n])),{navigateWithValidation:m}=(0,xv.L_)();return S.useEffect(()=>{G.default.track(U.HAw.PREMIUM_UPSELL_VIEWED,{type:sq.e.COLLECTIBLES_PROFILE_SETTINGS_UPSELL,location_stack:s,version:d})},[s,d]),(0,E.jsxs)("div",{ref:l,className:xP.kL,style:{backgroundImage:`url(${r})`},children:[(0,E.jsx)("div",{className:xP.JS,"aria-hidden":!0,role:"presentation",children:(0,E.jsx)("img",{src:a,className:xP.Qw,alt:""})}),(0,E.jsxs)("div",{className:xP.Em,children:[(0,E.jsx)(eP.D,{variant:"heading-lg/extrabold",color:c?"text-overlay-dark":"currentColor",className:xP.DD,children:o}),(0,E.jsx)(es.E,{variant:"text-sm/normal",color:c?"text-overlay-dark":"currentColor",children:u})]}),(0,E.jsx)(eG.$,{onClick:function(){m(()=>(0,xy.Cz)({analyticsLocations:s,analyticsSource:e1.A.COLLECTIBLES_PROFILE_SETTINGS_UPSELL}))},variant:"overlay-primary",text:j.intl.string(j.t.fYfGgK)})]})};var xM=i(451909),xU=i(202639),xV=i(400669),xk=i(835071),xw=i(422936),xF=i(732280),xB=i(590180),xz=i(898461),xY=i(207803),xX=i(461797);let xH=Object.keys(xX.jB);function xK(e){let t=null==e?xH:xH.filter(t=>t!==e);return t[Math.floor(Math.random()*t.length)]}var xW=i(764336),xZ=i(461893);function xq(e){let{preset:t,onShuffle:i}=e,n=(0,g.bG)([i7.Ay],()=>i7.Ay.useReducedMotion),s=(0,xW.Xf)({useReducedMotion:n}),{name:l,header:r}=S.useMemo(()=>{let e=(0,xX.Wt)(t);return{name:e.getName(),header:e.getHeaderSrc()}},[t]);return(0,E.jsxs)("div",{className:xZ.kL,children:[(0,E.jsx)(en.D,{onClick:()=>{i(),s.startAnimation(!1)},className:xZ.x6,"aria-label":j.intl.string(j.t["44yJxh"]),children:s.render()}),(0,E.jsxs)(en.D,{onClick:()=>{i(),s.startAnimation(!1)},"aria-label":`${l}: ${j.intl.string(j.t["44yJxh"])}`,className:xZ.Lt,children:[(0,E.jsx)("img",{alt:"","aria-hidden":!0,src:r,className:xZ.L_}),(0,E.jsx)(es.E,{className:xZ._e,variant:"text-sm/bold",color:"text-overlay-light",children:l})]})]})}var xQ=i(410516),xJ=i(811611),x$=i(515718),x0=i(507553);function x1(e,t){let i=x0.A.useField("scrollPosition"),n=(0,g.bG)([i7.Ay],()=>i7.Ay.useReducedMotion);(0,S.useEffect)(()=>{let s=e.current;if(null==s||i!==t)return;let l=requestAnimationFrame(()=>{s.scrollIntoView({behavior:n?"auto":"smooth"}),x0.A.setState({scrollPosition:null})});return()=>cancelAnimationFrame(l)},[e,t,i,n])}var x2=i(844222),x3=i(4542);function x6(e){let{user:t}=e,{reducedMotion:n}=S.useContext(x2.C),{pendingAvatar:s,pendingBanner:l,pendingAvatarDecoration:r,pendingProfileEffect:a,pendingDisplayNameStyles:o,pendingThemeColors:u,pendingPronouns:d,pendingBio:c,tryItOutThemeColors:m,tryItOutAvatar:A,tryItOutBanner:h,tryItOutAvatarDecoration:T,tryItOutDisplayNameStyles:x}=(0,g.cf)([Td.A],()=>{let e=Td.A.getPendingChanges(),t=Td.A.getTryItOutChanges();return{...e,...t}}),p=(0,TN.V7)({userId:t.id,image:A??s});return(0,E.jsx)(Tf.A,{user:t,pendingPronouns:d,pendingBio:c,pendingBanner:h??l??i(636763),pendingDisplayNameStyles:x??o,pendingAvatar:p,pendingThemeColors:m??u,pendingAvatarDecoration:void 0!==T?T:r,pendingProfileEffect:a,avatarClassName:null!=A||null!=s||n.enabled?void 0:x3.WX,containerClassName:x3.ti,canUsePremiumCustomization:!0,isTryItOut:!0,hideExampleButton:!0})}var x5=i(530702);function x4(e){let{user:t,isVisible:i,shouldShow:n}=e,s=uc.Ay.isPremium(t),l=uc.Ay.canUseAnimatedAvatar(t),{pendingAvatar:r,pendingThemeColors:a,tryItOutThemeColors:o,tryItOutAvatar:u,tryItOutBanner:d}=(0,g.cf)([Td.A],()=>{let e=Td.A.getPendingChanges(),t=Td.A.getErrors(),i=Td.A.getTryItOutChanges();return{...e,...i,errors:t}}),{preset:c,onShuffle:m}=function(){let e=(0,g.bG)([i7.Ay],()=>i7.Ay.useReducedMotion),[t,i]=(0,S.useState)(xK()),{banner:n,themeColors:s,avatarDecorationSkuId:l,displayNameStyles:r}=(0,S.useMemo)(()=>{let i=(0,xX.Wt)(t);return{banner:i.getBannerSrc(e),themeColors:i.themeColors,avatarDecorationSkuId:i.avatarDecorationSkuId,displayNameStyles:i.displayNameStyles}},[t,e]),a=(0,g.bG)([xB.A],()=>{let e=xB.A.getProduct(l);return(0,xz.T)(e?.items[0])?e.items[0]:null});(0,S.useEffect)(()=>{(0,xY.w5)({banner:n,themeColors:s,avatarDecoration:a,displayNameStyles:r})},[n,s,a,r]);let o=(0,S.useCallback)(()=>{let e=xK(t);i(e),G.default.track(U.HAw.TRY_IT_OUT_PRESET_SHUFFLED,{preset:e})},[t]);return{preset:t,onShuffle:o}}(),A=S.useRef(null);x1(A,nB._F.TRY_IT_OUT);let{analyticsLocations:h,sourceAnalyticsLocations:T}=(0,nQ.Ay)(e1.A.USER_SETTINGS_TRY_OUT_PREMIUM);function x(e){e&&(d?.startsWith("https:")===!0?fetch(d).then(e=>e.blob()).then(e=>(0,x$.We)(e)).then(e=>{(0,Tw.p)({avatar:u,themeColors:o,banner:e})}).catch(()=>{(0,Tw.p)({avatar:u,themeColors:o})}):null!=d?(0,Tw.p)({avatar:u,themeColors:o,banner:d}):(0,Tw.p)({avatar:u,themeColors:o}),G.default.track(U.HAw.TRY_IT_OUT_PRESET_SELECTED,{preset:c}))}S.useEffect(()=>{i&&G.default.track(U.HAw.PREMIUM_UPSELL_VIEWED,{type:sq.e.PREMIUM_PROFILE_TRY_IT_OUT,location:{page:U.liQ.USER_SETTINGS},location_stack:T})},[T,t,i]);let p=(0,xF.V)()?.subscription_trial?.sku_id===sq.pe.TIER_2,f=(0,xw.O)(),N=(0,xQ.U9)(f,sq.pe.TIER_2);return n?(0,E.jsx)(nQ.f5,{value:h,children:(0,E.jsxs)(cN.A,{ref:A,className:x5.MT,type:cN.i.PREMIUM,isShown:!0,hasBackground:!0,children:[(0,E.jsx)(Tp,{stickyPreview:!1,layoutClassName:x5.th,profilePreviewTitle:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(ui.t,{size:"md",color:"currentColor",className:x5.PC}),j.intl.string(j.t.gMlDNd)]}),profilePreview:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(xq,{preset:c,onShuffle:m}),(0,E.jsx)(x6,{user:t})]}),children:(0,E.jsxs)("div",{children:[(0,E.jsxs)("div",{children:[(0,E.jsx)(eP.D,{variant:"heading-xl/extrabold",children:j.intl.string(j.t["2zGdAW"])}),(0,E.jsx)(es.E,{className:x5.h_,variant:"text-sm/normal",children:j.intl.string(j.t.xeEC20)})]}),(0,E.jsx)(xo,{className:x5.fz,user:t,pendingAvatarSrc:(0,TN.V7)({userId:t.id,image:u??r}),pendingColors:o??a,onThemeColorsChange:xY.a,showPremiumIcon:!1,preventDisabled:!0}),(0,E.jsx)(T0,{className:x5.fz,isTryItOut:!0,showRemoveBannerButton:null!=d,onBannerChange:xY.xe,showPremiumIcon:!1}),!l&&(0,E.jsx)(TH,{className:x5.fz,isTryItOut:!0,onAvatarChange:xY.e$,showRemoveAvatarButton:!1,changeAvatarButtonText:j.intl.string(j.t["7z0D1c"]),sectionTitle:j.intl.string(j.t.vtFfPX)}),(0,E.jsx)(TZ,{user:t,className:x5.fz}),!p&&(0,E.jsx)(es.E,{variant:"text-sm/normal",children:j.intl.string(j.t["smo74/"])})]})}),!p&&(0,E.jsx)(xU.d,{onSubscribeModalClose:x,className:x5.Kv,showUpsell:!0,text:j.intl.format(j.t.TmfgI2,{onClick:()=>{(0,xk.K)({onSubscribeFinish:x})}}),button:s?j.intl.string(j.t.AfRWI8):N?j.intl.formatToPlainString(j.t.bkQ4bH,{percent:f?.discount.amount}):j.intl.string(j.t.pj0XBN),position:"inline"}),p&&(0,E.jsxs)("div",{children:[(0,E.jsx)("div",{className:x5.BU}),(0,E.jsx)(xJ.Ay,{type:sq.e.CUSTOM_PROFILE_TRY_OUT_UPSELL,subscriptionTier:sq.pe.TIER_2})]})]})}):null}var x8=i(814390),x7=i(909536),x9=i(843282),pe=i(145497),pt=i(685073),pi=i(534400),pn=i(581781),ps=i(743981),pl=i(217510);let pr=(0,sW.Ld)(),pa=S.memo(function(e){let{availablePrimaryGuilds:t,pendingPrimaryGuildId:i,onChange:n}=e,s=S.useMemo(()=>new Map(t.map(e=>[e.id,e])),[t]),l=(0,g.bG)([id.default],()=>(0,pt.Zo)(id.default.getCurrentUser()?.primaryGuild).guildId),r=void 0!==i?i:l,a=S.useMemo(()=>t.reduce((e,t)=>(t.profile?.tag!=null&&e.push({label:t.name,value:t.id}),e),[]),[t]),o=S.useCallback(e=>{if(null==e)return null;let t=s.get(e.value);if(null==t)return null;let i=t.profile?.tag;return null==i?null:(0,E.jsx)(pn.A,{guildTag:i,guildBadge:t.profile?.badge??void 0,guildId:t.id,guildName:e.label,guildIcon:t.icon,guildIconSize:32})},[s]),u=S.useCallback(e=>{if(null==e)return null;let t=s.get(e.value);return null==t||null==t.profile?.tag?null:(0,E.jsx)(pe.j,{guildId:t.id,guildName:t.name,guildIcon:t.icon,iconSize:32,animate:!1})},[s]),d=S.useCallback(e=>{if(null==e)return null;let t=s.get(e.value);if(null==t)return null;let i=t.profile?.tag;return null==i?null:(0,E.jsx)(pi.o9,{guildId:t.id,guildTag:i,guildBadge:t.profile?.badge??void 0,badgeSize:ps.Sl.SIZE_16,textColor:"interactive-text-default",textVariant:"text-sm/semibold"})},[s]),c=S.useCallback(e=>{let t=e[0];return null==t?null:(0,E.jsx)(E.Fragment,{children:o(t)})},[o]),m=S.useCallback(e=>{n?.(e)},[n]),A=S.useCallback(e=>e===r,[r]),h=S.useCallback(e=>e,[]),T=S.useCallback(()=>{n?.(null)},[n]),x=S.useRef(null);return x1(x,nB._F.GUILD_TAG),(0,E.jsxs)(ul.A,{title:j.intl.string(j.t.Pdd1nd),titleId:pr,ref:x,children:[(0,E.jsx)(es.E,{className:pl.VA,variant:"text-sm/normal",children:j.intl.string(j.t.mlZ6Jx)}),(0,E.jsx)(x9.Pw,{className:pl.Lt,optionClassName:pl.S0,isSelected:A,options:a,select:m,renderLeading:u,renderTrailing:d,renderOptionValue:c,serialize:h,clear:T,clearable:null!=r,maxVisibleItems:8,"data-migration-pending":!0})]})});var po=i(318785),pu=i(992526),pd=i(470739);let pc=function(){return(0,pu.J9)({location:"UserSettingsProfileCustomization"})?(0,E.jsx)(ul.A,{title:j.intl.string(j.t.l6w3Vj),description:j.intl.string(j.t.joHqdj),children:(0,E.jsx)(eG.$,{text:j.intl.string(j.t.wRraFx),onClick:()=>{(0,pd._)()},size:"sm"})}):null};var pg=i(182817);let pm=(0,sW.Ld)();function pA(e){let t=(0,Sy.L)(sq.PremiumTypes.TIER_2);return(0,E.jsxs)(ul.A,{errors:e.errors,disabled:e.disabled,title:j.intl.string(j.t["9AjdkD"]),titleId:pm,children:[(0,E.jsx)("div",{children:(0,E.jsx)(rH.k,{"aria-labelledby":pm,placeholder:e.placeholder,maxLength:U.zzC,onChange:e.onGlobalNameChange,value:e.pendingGlobalName??e.currentGlobalName??""})}),t&&(0,E.jsx)(TZ,{user:e.user,className:pg.F})]})}var ph=i(273151);function pE(e){let{legacyUsername:t,pendingLegacyUsernameDisabled:i}=e,n=L.m$.useSetting(),s=void 0!==i?i:n;return(0,E.jsx)("div",{className:ph.u,children:(0,E.jsx)(J.d,{label:j.intl.string(j.t["3cWDuO"]),description:s?null:j.intl.formatToPlainString(j.t.aYhclf,{username:t}),checked:!s,onChange:e=>{!e===n?(0,To._e)():(0,Tw.p)({legacyUsernameDisabled:!e})}})})}function pS(e){let{user:t,savedUserColor:i,pendingColor:n,setPendingAccentColor:s}=e,l=t.getAvatarURL(null,80),r=(0,T7.r)(er.A.unsafe_rawColors.PRIMARY_530).hex(),a=(0,T9.rh)(l,r,!1),o=(0,xi.LX)(a[0]);return(0,E.jsx)(ul.A,{title:j.intl.string(j.t["/X3fkf"]),children:(0,E.jsx)(xr,{onChange:e=>s(e),color:n??i??o,suggestedColors:a,showEyeDropper:!0})})}var pT=i(518477);let px=function(){let e=(0,g.bG)([cP.default],()=>cP.default.getId());return(0,E.jsx)(ul.A,{title:j.intl.string(j.t.Jzj9q4),children:(0,E.jsx)(eG.$,{text:j.intl.string(j.t.Geikwq),onClick:()=>{(0,Tm.openUserProfileModal)({userId:e,sourceAnalyticsLocations:[e1.A.USER_SETTINGS_USER_PROFILE],hideRestrictedProfile:!0,tabSection:pT.RP.WIDGETS})},size:"sm"})})};var pp=i(577997);function pf(){let e=(0,g.bG)([id.default],()=>{let e=id.default.getCurrentUser();return tX()(null!=e,"DefaultCustomizationSections: user cannot be undefined"),e}),t=(0,g.bG)([T_.A],()=>T_.A.getUserProfile(e.id)),{pendingAvatar:i,pendingGlobalName:n,pendingBanner:s,pendingBio:l,pendingPronouns:r,pendingAccentColor:a,pendingThemeColors:o,pendingLegacyUsernameDisabled:u,pendingPrimaryGuildId:d,errors:c}=(0,g.cf)([Td.A],()=>{let e=Td.A.getPendingChanges(),t=Td.A.getErrors();return{...e,errors:t}}),m=(0,TN.V7)({userId:e.id,image:i}),A=(0,Tv.EC)(),h=uc.Ay.canUsePremiumProfileCustomization(e),S=(0,TS.z5)(i,e.avatar),T=(0,TS.Ac)(s,t?.banner),x=(0,xe.Ay)(e.id),p=x?.getLegacyUsername(),f=(c.global_name?.length??0)>0?c.global_name:A?.nick??[],N=(c.bio?.length??0)>0?c.bio:A?.bio??[],_=(0,po.b)();return(0,E.jsxs)("div",{className:pp.Q,children:[(0,E.jsx)(pA,{placeholder:e.username,errors:f,currentGlobalName:e.globalName,pendingGlobalName:n,onGlobalNameChange:e=>(0,Tw.p)({globalName:e}),user:e}),(0,E.jsx)(xu,{sectionTitle:j.intl.string(j.t["+T3RI/"]),errors:c.pronouns,onPronounsChange:e=>(0,Tw.p)({pronouns:e}),pendingPronouns:r,currentPronouns:t?.pronouns??""},"pronouns"),(0,E.jsx)(px,{}),(0,E.jsx)(TH,{onAvatarChange:e=>{(0,Tw.p)({avatar:e}),(0,TS.WU)(null==e?"remove":"set")},showRemoveAvatarButton:S,errors:c.avatar,sectionTitle:j.intl.string(j.t.lqaIxI),forcedDivider:!0},"avatar"),(0,E.jsx)(TB,{user:e,sectionTitle:j.intl.string(j.t["7v0T9P"])},"decoration"),(0,E.jsx)(TJ,{user:e}),(0,E.jsx)(T3,{user:e,sectionTitle:j.intl.string(j.t.wR5wOo)},"effect"),(0,E.jsx)(T8,{user:e,sectionTitle:j.intl.string(j.t.GWrZOd)},"frame"),h?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(T0,{showRemoveBannerButton:T,errors:c.banner,onBannerChange:e=>(0,Tw.p)({banner:e}),forcedDivider:!0},"banner"),(0,E.jsx)(xo,{user:e,pendingAvatarSrc:m,pendingColors:o,onThemeColorsChange:e=>(0,Tw.p)({themeColors:e}),forcedDivider:!0})]}):(0,E.jsx)(pS,{user:e,savedUserColor:t?.accentColor,pendingColor:a,setPendingAccentColor:e=>(0,Tw.p)({accentColor:e})},"color"),(0,E.jsx)(TM,{sectionTitle:j.intl.string(j.t.ZzAR2Y),errors:N,onBioChange:e=>(0,Tw.p)({bio:e}),pendingBio:l,currentBio:t?.bio??""},"bio"),_.length>0&&(0,E.jsx)(pa,{availablePrimaryGuilds:_,pendingPrimaryGuildId:d,onChange:e=>(0,Tw.p)({primaryGuildId:e})}),null!=p&&(0,E.jsx)(pE,{legacyUsername:p,pendingLegacyUsernameDisabled:u},"legacy_username"),(0,E.jsx)(pc,{},"badges")]})}function pN(){(0,K.openModalLazy)(async()=>{let{default:e}=await Promise.all([i.e("41509"),i.e("66901"),i.e("41704")]).then(i.bind(i,562011));return t=>(0,E.jsx)(e,{...t,source:{page:U.liQ.USER_SETTINGS,section:U.JJy.SETTINGS_CUSTOMIZE_PROFILE,object:U.ZSU.BUTTON_CTA,type:U.AnalyticsObjectTypes.BUY}})})}var p_=i(157723);function pI(){let e=(0,g.bG)([id.default],()=>{let e=id.default.getCurrentUser();return tX()(null!=e,"UserSettingsProfileCustomization: user cannot be undefined"),e}),t=(0,g.bG)([eF.A],()=>eF.A.hidePersonalInformation),{pendingBio:i,pendingAvatar:n,pendingNameplate:s,showNotice:l,...r}=(0,g.cf)([Td.A],()=>({...Td.A.getPendingChanges(),showNotice:Td.A.showNotice()})),a=(0,TN.V7)({userId:e.id,image:n}),o=(0,TS.lw)({pendingValue:s,userValue:e?.collectibles?.nameplate}),u=(0,x8.A)()&&null!=i?xM.Ay.parse(void 0,i).content:i,d=uc.Ay.canUsePremiumProfileCustomization(e),c=(0,x7.St)("edit-profile-upsell"),{analyticsLocations:m}=(0,nQ.Ay)(e1.A.USER_SETTINGS_USER_PROFILE);S.useEffect(()=>()=>su.h.wait(To.IM),[]);let[A,h]=S.useState(!1),T=!d,x=S.useRef(null);return t?(0,E.jsx)(da.A,{}):(0,E.jsxs)(nQ.f5,{value:m,children:[(0,E.jsx)(xG,{}),(0,E.jsx)(Tp,{profilePreview:(0,E.jsx)(Tf.A,{user:e,canUsePremiumCustomization:d,onUpsellClick:pN,pendingBio:u,...r,pendingAvatar:a,containerClassName:p_.ti}),nameplatePreview:(0,E.jsx)(TE.A,{user:e,nameplate:o,...r,className:null==o?p_.tJ:void 0,isHighlighted:!0}),children:(0,E.jsx)(pf,{})}),(0,E.jsx)(xb.L,{innerRef:x,onChange:e=>h(e),threshold:.25,active:T,children:(0,E.jsx)("div",{ref:x,children:(0,E.jsx)(x4,{user:e,shouldShow:T,isVisible:A})})}),T&&!l&&(0,E.jsx)(xU.d,{className:p_.EL,showUpsell:!A,text:j.intl.format(j.t.TmfgI2,{onClick:()=>(0,xk.K)({})}),textVariant:"heading-md/medium",useUpdatedStyling:!0,leadingAction:c?(0,E.jsx)(xV.l,{size:"md",location:e1.A.PREMIUM_WISHLIST_EDIT_PROFILE_UPSELL}):void 0,button:(0,E.jsx)("div",{className:p_.Xl,children:(0,E.jsx)(eG.$,{variant:"overlay-primary",onClick:()=>{G.default.track(U.HAw.TRY_IT_OUT_PRESET_CLICKED,{cta_variant:"floating_action_button"}),x?.current?.scrollIntoView({behavior:"smooth"})},text:j.intl.string(j.t.uw9zI7),icon:ui.t})})})]})}var pC=i(625494);i(46121);var pb=i(521078);let pv={[nB.Eq.USER_PROFILE]:"main_profile_tab",[nB.Eq.GUILD]:"guild_profile_tab"},py=(0,a.E2)(u.X.PROFILE_SETTING,{Component:function(){let e=(0,g.bG)([s4.A,eg.Ay,Td.A],()=>{let e=Td.A.selectedGuildId??s4.A.getGuildId();return null==e||Td._.has(e)?eg.Ay.getFlattenedGuildIds().find(e=>!Td._.has(e)):e}),t=(0,g.bG)([ec.A],()=>ec.A.getGuild(e)),i=(0,g.bG)([Td.A],()=>Td.A.showNotice()),n=(0,g.bG)([id.default],()=>id.default.getCurrentUser()),s=x0.A.useField("subsection");return S.useEffect(()=>{(0,l3._)(pv[s])},[s]),S.useEffect(()=>{null!=n&&t?.id!=null&&(0,x_.A)(n.id,n.getAvatarURL(t?.id,80),{guildId:t?.id})},[t?.id,n]),(0,E.jsx)(xC,{children:(0,E.jsxs)(c$.F,{component:(0,E.jsx)(eo.A,{children:(0,E.jsx)(eP.D,{variant:"heading-xl/normal",children:j.intl.string(j.t["vi7f+q"])})}),children:[(0,E.jsxs)(TA.V,{className:pb.$H,type:"top",look:"brand",selectedItem:s,onItemSelect:function(e){if(s!==e){if(i){(0,l6.fO)({duration:300,intensity:1.4}),pC._.dispatch(U.jej.EMPHASIZE_NOTICE);return}e===nB.Eq.GUILD&&null!=t&&(0,Th.V2)(t.id),x0.A.setState({subsection:e})}},children:[(0,E.jsx)(TA.V.Item,{className:pb.YU,id:nB.Eq.USER_PROFILE,children:j.intl.string(j.t["2p07FR"])},nB.Eq.USER_PROFILE),(0,E.jsx)(TA.V.Item,{className:e6()(pb.YU,pb.HY),"aria-label":j.intl.string(j.t.kPHroX),id:nB.Eq.GUILD,children:j.intl.string(j.t.kPHroX)},nB.Eq.GUILD)]}),s===nB.Eq.GUILD?(0,E.jsx)(xN,{selectedGuild:t,onGuildChange:function(e){if(i){(0,l6.fO)({duration:300,intensity:1.4}),pC._.dispatch(U.jej.EMPHASIZE_NOTICE);return}null!=e&&(0,Th.JJ)(e.id)}}):(0,E.jsx)(pI,{})]})})},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)]}),pj=(0,a.zZ)(u.X.PROFILE_CATEGORY,{buildLayout:()=>[py]});var pO=i(938706);function pR(){let e=(0,g.bG)([id.default],()=>id.default.getCurrentUser()),{avatarSrc:t,avatarDecorationSrc:i}=(0,Tg.A)({userId:e?.id,size:i8._3.SIZE_48});return null==e?null:(0,E.jsxs)("div",{className:pO.a5,children:[(0,E.jsx)(i4.eu,{src:t,avatarDecoration:i,size:i8._3.SIZE_48,"aria-label":j.intl.string(j.t.lqaIxI)}),(0,E.jsxs)("div",{className:pO.FS,children:[(0,E.jsx)(es.E,{color:"text-strong",variant:"text-md/medium",lineClamp:1,children:e.globalName??e.username}),(0,E.jsxs)("div",{className:pO.Fk,children:[(0,E.jsx)(es.E,{variant:"text-sm/normal",color:"currentColor",lineClamp:1,children:j.intl.string(j.t.Ip9nBS)}),(0,E.jsx)(ud.R,{size:"xxs",color:"currentColor"})]})]})]})}let pL=(0,a.t_)(u.X.PROFILE_PANEL,{useTitle:()=>j.intl.string(j.t["vi7f+q"]),notice:{stores:[Td.A],element:Tu.A},initialize:()=>()=>su.h.wait(()=>{(0,To.F7)()}),buildLayout:()=>[pj]}),pD=(0,a.i4)(u.X.PROFILE_SIDEBAR_ITEM,{useTitle:()=>j.intl.string(j.t["vi7f+q"]),icon:pG,StronglyDiscouragedCustomComponent:pR,usePredicate:()=>!(0,Tc.X)("user_settings_sidebar"),buildLayout:()=>[pL]}),pP=(0,a.i4)(u.X.PROFILE_SIDEBAR_ITEM_WYSIWYG,{useTitle:()=>j.intl.string(j.t["vi7f+q"]),icon:pG,StronglyDiscouragedCustomComponent:pR,usePredicate:()=>(0,Tc.X)("user_settings_sidebar"),onClick:()=>{let e=cP.default.getId();(0,Tm.openUserProfileModal)({userId:e})},buildLayout:()=>[]});function pG(){let e=(0,g.bG)([id.default],()=>id.default.getCurrentUser()),{avatarSrc:t,avatarDecorationSrc:i}=(0,Tg.A)({userId:e?.id,size:i8._3.SIZE_48});return(0,E.jsx)(i4.eu,{src:t,avatarDecoration:i,size:i8._3.SIZE_20,"aria-hidden":!0})}let pM=(0,a.WI)(u.X.PROFILE_SECTION,{hoisted:!0,buildLayout:()=>[pD,pP]});var pU=i(98207),pV=(i(204925),i(818348));let pk=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;(0,K.openModalLazy)(async()=>{let{default:t}=await Promise.all([i.e("69757"),i.e("19623"),i.e("21007")]).then(i.bind(i,888363));return i=>(0,E.jsx)(t,{claimRequired:e,...i})},{onCloseRequest:e?pV.tE:null,onCloseCallback:t})};var pw=i(940856),pF=i(36149),pB=i(207560);function pz(e){let t=(0,pB.fk)(),i=(0,pF.b8)(),n=(0,pF.yM)(),s=(0,pF.Y2)();if(!t)return!1;let l=!i||n;switch(e){case"verify":return l;case"edit":return!l&&s;case"info":return!l&&!s;default:return!1}}var pY=i(516761);function pX(){let e=j.intl.string(j.t.XxRj7f);return(0,E.jsxs)(es.E,{variant:"text-md/medium",children:[`${e} \u{2022} `,j.intl.format(pY.default.WM5adV,{handleOnHelpUrlHook:function(){return window.open(tI.A.getArticleURL(U.MVz.TIGGER_PAWTECT_LEARN_MORE),"_blank")}})]})}let pH=(0,a.Tf)(u.X.ACCOUNT_INFO_AGE_GROUP_EDIT_SETTING,{usePredicate:()=>pz("edit"),useTitle:()=>j.intl.string(j.t["/52UYy"]),useVariant:()=>"secondary",useTrailingContent:()=>({type:h._1.STRONGLY_DISCOURAGED_CUSTOM,StronglyDiscouragedCustomComponent:pX}),useLabel:()=>j.intl.string(j.t.bt75uw),onClick:function(){(0,K.openModalLazy)(async()=>{let{default:e}=await i.e("45361").then(i.bind(i,151080));return t=>(0,E.jsx)(e,{...t})})}}),pK=(0,a.E2)(u.X.ACCOUNT_INFO_AGE_GROUP_INFO_SETTING,{usePredicate:()=>pz("info"),useSearchTerms:()=>[j.intl.string(j.t["/52UYy"])],Component:function(){return(0,E.jsx)(s6.D,{label:j.intl.string(j.t["/52UYy"]),layout:"horizontal",children:(0,E.jsxs)(Q.B,{direction:"horizontal",align:"center",justify:"end",gap:"md",children:[(0,E.jsx)(es.E,{variant:"text-md/medium",children:j.intl.string(j.t.XxRj7f)}),(0,E.jsx)("div",{style:{visibility:"hidden"},children:(0,E.jsx)(eG.$,{onClick:pV.tE,text:j.intl.string(j.t.bt75uw),"aria-hidden":!0})})]})})}});var pW=i(31720),pZ=i(847599);function pq(){return(0,pF.yM)()?j.intl.string(j.t.sK0dmH):j.intl.string(j.t.lKDPGA)}let pQ=(0,a.Tf)(u.X.ACCOUNT_INFO_AGE_GROUP_VERIFY_SETTING,{usePredicate:()=>pz("verify"),useTitle:()=>j.intl.string(j.t["/52UYy"]),useVariant:()=>"secondary",useTrailingContent:()=>({type:h._1.TEXT,useText:pq}),useLabel:function(){return(0,pF.yM)()?j.intl.string(j.t["9KiIz6"]):j.intl.string(j.t.DVywUB)},onClick:()=>pW.A.showAgeVerificationGetStartedModal({entryPoint:pZ.q1.ACCOUNT_AGE_GROUP})}),pJ=(0,a.Tf)(u.X.ACCOUNT_INFO_CLAIM_ACCOUNT_SETTING,{usePredicate:()=>{let e=(0,g.bG)([id.default],()=>id.default.getCurrentUser());return null!=e&&!e.isClaimed()},useTitle:()=>j.intl.string(j.t.tlZllC),useVariant:()=>"secondary",useTrailingContent:()=>({type:h._1.TEXT,useText:()=>j.intl.string(j.t.qxk9zo)}),useLabel:()=>j.intl.string(j.t.BleMPB),onClick:()=>pk()});function p$(e){return`${"*".repeat(e.length-4)}${e.slice(-4)}`}function p0(e){let[t,i]=e.split("@");return`${"*".repeat(t.length)}@${i}`}function p1(e){let{text:t,censor:i,revealLabel:n,hideLabel:s,redesign:l=!1}=e,[r,a]=S.useState(!1),o=r?t:i(t);return(0,E.jsxs)(Q.B,{direction:"horizontal",align:"center",gap:4,justify:l?"end":"start",children:[l?(0,E.jsx)(es.E,{variant:"text-md/medium",children:o}):o,(0,E.jsx)(ea.Q,{variant:"primary",textVariant:l?"text-md/medium":"text-sm/medium","aria-label":r?s:n,onClick:()=>a(!r),text:r?j.intl.string(j.t.fgq1gs):j.intl.string(j.t.dcztdU)})]})}function p2(){let e=(0,g.bG)([id.default],()=>id.default.getCurrentUser()?.email);return null==e?(0,E.jsx)(es.E,{variant:"text-md/medium",children:j.intl.string(j.t["8SfTN/"])}):(0,E.jsx)(p1,{text:e,censor:p0,revealLabel:j.intl.string(j.t["Zvx+yV"]),hideLabel:j.intl.string(j.t.nqTD4d),redesign:!0})}let p3=(0,a.Tf)(u.X.ACCOUNT_INFO_EMAIL_SETTING,{usePredicate:()=>(0,g.bG)([id.default],()=>id.default.getCurrentUser()?.isClaimed())??!1,useTitle:()=>j.intl.string(j.t.tlZllC),useVariant:()=>"secondary",useTrailingContent:()=>({type:h._1.STRONGLY_DISCOURAGED_CUSTOM,StronglyDiscouragedCustomComponent:p2}),useLabel:function(){return null==(0,g.bG)([id.default],()=>id.default.getCurrentUser()?.email)?j.intl.string(j.t.OYkgVk):j.intl.string(j.t.bt75uw)},useAriaLabel:function(){return null==(0,g.bG)([id.default],()=>id.default.getCurrentUser()?.email)?j.intl.string(j.t["pvBD+W"]):j.intl.string(j.t["8peUT0"])},onClick:function(){(0,K.openModalLazy)(async()=>{let{default:e}=await Promise.all([i.e("11322"),i.e("20577"),i.e("65861")]).then(i.bind(i,97060));return t=>(0,E.jsx)(e,{...t})})}});var p6=i(557722),p5=i(53516);function p4(){let e=(0,g.bG)([id.default],()=>id.default.getCurrentUser()),t=e?.phone??null;return null==e||null==t?(0,E.jsx)(es.E,{variant:"text-md/medium",children:j.intl.string(j.t.I5kDqj)}):(0,E.jsx)(Q.B,{direction:"horizontal",align:"center",justify:"end",gap:"md",children:(0,E.jsx)(p1,{text:t,censor:p$,revealLabel:j.intl.string(j.t.eY3xlT),hideLabel:j.intl.string(j.t["jllbv+"]),redesign:!0})})}let p8=(0,a.Tf)(u.X.ACCOUNT_INFO_PHONE_SETTING,{usePredicate:()=>(0,g.bG)([id.default],()=>id.default.getCurrentUser()?.isClaimed())??!1,useTitle:()=>j.intl.string(j.t.kerONq),useAriaLabel:function(){return null==(0,g.bG)([id.default],()=>id.default.getCurrentUser()?.phone)?j.intl.string(j.t["SfUuE+"]):j.intl.string(j.t.YDabSe)},useVariant:()=>"secondary",useTrailingContent:()=>({type:h._1.STRONGLY_DISCOURAGED_CUSTOM,StronglyDiscouragedCustomComponent:p4}),useLabel:function(){return null==(0,g.bG)([id.default],()=>id.default.getCurrentUser()?.phone)?j.intl.string(j.t.OYkgVk):j.intl.string(j.t.bt75uw)},onClick:function(){null==id.default.getCurrentUser()?.phone?(0,K.openModalLazy)(async()=>{let{default:e}=await Promise.all([i.e("49747"),i.e("72712"),i.e("89545"),i.e("11493"),i.e("84704"),i.e("86197")]).then(i.bind(i,615715));return t=>(0,E.jsx)(e,{reason:p6.d.USER_SETTINGS_UPDATE,...t})},{modalKey:p5.V}):(0,K.openModalLazy)(async()=>{let{default:e}=await Promise.all([i.e("55682"),i.e("40933")]).then(i.bind(i,660740));return t=>(0,E.jsx)(e,{...t})})}});function p7(){let e=(0,g.bG)([id.default],()=>id.default.getCurrentUser());return null!=e&&!e.isClaimed()}function p9(){let e=(0,Tv.EC)(),t=e?.nick?.[0]??null,i=(0,g.bG)([id.default],()=>id.default.getCurrentUser());if(null==i)return null;let n=i.hasUniqueUsername()?i.username:`${i.username}#${i.discriminator}`;return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(es.E,{variant:"text-md/medium",children:n}),null!=t&&(0,E.jsx)(tr.m,{__unsupportedReactNodeAsText:t,"aria-label":!1,children:(0,E.jsx)(rG.E,{size:"custom",width:20,height:20,color:er.A.colors.STATUS_WARNING.css})})]})}let fe=(0,a.Tf)(u.X.ACCOUNT_INFO_USERNAME_SETTING,{useTitle:()=>j.intl.string(j.t.qqhR3L),useTrailingContent:()=>({type:h._1.STRONGLY_DISCOURAGED_CUSTOM,StronglyDiscouragedCustomComponent:p9}),useLabel:()=>j.intl.string(j.t.bt75uw),useAriaLabel:()=>j.intl.string(j.t.JECa91),useSubtitle:()=>p7()?j.intl.string(j.t["7Ngnyr"]):void 0,useVariant:()=>"secondary",useDisabled:p7,onClick:function(){(0,K.openModalLazy)(async()=>{let{default:e}=await Promise.all([i.e("80032"),i.e("20429"),i.e("20969")]).then(i.bind(i,667792));return t=>(0,E.jsx)(e,{...t})})}}),ft=(0,a.zZ)(u.X.ACCOUNT_INFO_CATEGORY,{usePredicate:()=>(0,g.bG)([id.default],()=>null!=id.default.getCurrentUser()),useTitle:()=>j.intl.string(j.t.apNo4l),useInlineNotice:function(){let e=(0,g.bG)([id.default],()=>id.default.getCurrentUser());return null==e?null:e.isClaimed()?null==e.email||e.verified?null:{type:h.lT.INLINE_NOTICE,noticeType:"warning",useTitle:()=>j.intl.string(j.t.tuGzBT),useText:()=>j.intl.string(j.t.NAzplE),button:{useText:()=>j.intl.string(j.t.lm1UKt),onClick:()=>(0,pw.S)(e)}}:{type:h.lT.INLINE_NOTICE,noticeType:"critical",useTitle:()=>j.intl.string(j.t["/3qnL/"]),useText:()=>j.intl.string(j.t.qKs3vg),button:{useText:()=>j.intl.string(j.t["7psymi"]),onClick:()=>pk()}}},buildLayout:()=>[fe,pJ,p3,p8,pQ,pH,pK]});var fi=i(398177);let fn=(0,a.Tf)(u.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,K.openModal)(e=>(0,E.jsx)(fi.default,{...e,onSuccess:()=>e.onClose()}))}});var fs=i(200921);let fl=[];function fr(){fl=[]}class fa extends g.Ay.Store{static displayName="AuthSessionsStore";getSessions(){return fl}}let fo=new fa(su.h,{LOGOUT:fr,LOGIN_SUCCESS:fr,FETCH_AUTH_SESSIONS_SUCCESS:function(e){let{sessions:t}=e;fl=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,i=[...fl],n=!1;for(let e of t){let t=i.findIndex(t=>t.id_hash===e);t>=0&&(i.splice(t,1),n=!0)}if(!n)return!1;fl=i}});function fu(){let e=(0,g.cf)([fo],()=>fo.getSessions());return S.useMemo(()=>{let t=[...e],i=null,n=cP.default.getAuthSessionIdHash();if(null!=n){let e=t.findIndex(e=>e.id_hash===n);e>=0&&(i=t.splice(e,1)[0])}return t.sort((e,t)=>t.approx_last_used_time.valueOf()-e.approx_last_used_time.valueOf()),{currentSession:i,otherSessions:t}},[e])}function fd(e){return(Date.now()-e.valueOf())/1e3/60/60<1?j.intl.string(j.t.TXCmfL):rt()(e).fromNow()}var fc=i(176524),fg=i(646270),fm=i(738678),fA=i(53061);function fh(e){let{icon:t,label:i,subLabel:n,description:s,children:l,muted:r}=e;return(0,E.jsxs)(Q.B,{direction:"horizontal",align:"center",gap:"sm",role:"listitem",children:[(0,E.jsx)(fc.A,{Icon:t,color:r?er.A.colors.ICON_MUTED:"currentColor"}),(0,E.jsxs)(Q.B,{direction:"vertical",gap:"xxs",children:[(0,E.jsxs)(Q.B,{direction:"horizontal",gap:"xs",children:[(0,E.jsx)(es.E,{variant:"text-md/semibold",color:"text-strong",children:i}),null!=i&&null!=n&&(0,E.jsx)(es.E,{variant:"text-md/medium",color:"text-subtle","aria-hidden":!0,children:"\u2022"}),null!=n&&(0,E.jsx)(es.E,{variant:"text-md/medium",color:"text-subtle",children:n})]}),(0,E.jsx)(es.E,{variant:"text-sm/normal",color:"text-muted",children:s})]}),l]})}function fE(e){let{session:t,current:i}=e,{location:n,platform:s,os:l,Icon:r,lastActive:a}=function(e,t){let i=e.client_info?.location??e.client_info?.ip,n=e.client_info?.platform,{text:s,icon:l}=function(e){switch(e?.toLowerCase().trim()){case null:case void 0:case"":return{text:j.intl.string(j.t.cDHCNY),icon:to.k};case"ios":case"android":return{text:e,icon:fg.u};case"horizon os":return{text:e,icon:fm.G};default:return{text:e,icon:to.k}}}(e.client_info?.os);return{location:i,platform:n,os:s,Icon:l,lastActive:t?null:fd(e.approx_last_used_time)}}(t,i),o=[n,a].filter(N.Vq);return(0,E.jsx)(fh,{icon:r,label:l,subLabel:s,description:o.join(" \xb7 "),children:!i&&(0,E.jsx)(en.D,{className:fA.X,onClick:()=>(0,fs.U0)(t.id_hash),"aria-label":j.intl.string(j.t.E4MJNt),children:(0,E.jsx)(gM.P,{size:"md",color:"currentColor"})})})}function fS(e){let{title:t,children:i}=e,n=S.useId();return(0,E.jsxs)(Q.B,{role:"group","aria-labelledby":n,gap:"xl",padding:{top:8,bottom:8},children:[(0,E.jsx)(eP.D,{id:n,variant:"heading-md/semibold",color:"text-muted",children:t}),(0,E.jsx)(Q.B,{role:"list",gap:"xl",children:i})]})}let fT=(0,a.E2)(u.X.SESSIONS_CURRENT_SESSION_SETTING,{Component:function(){let{currentSession:e}=fu();return null==e?(0,E.jsx)(dd.y,{}):(0,E.jsx)(fS,{title:j.intl.string(j.t.LLS19o),children:(0,E.jsx)(fE,{session:e,current:!0})})},useSearchTerms:()=>[]}),fx=(0,a.E2)(u.X.SESSIONS_LOGOUT_ALL_SESSIONS_SETTING,{Component:function(){let{otherSessions:e}=fu();return(0,E.jsx)(s6.D,{label:j.intl.string(j.t.Vij32M),description:j.intl.string(j.t.OTXyaf),children:(0,E.jsx)(eG.$,{onClick:()=>(0,fs.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}=fu();return e.length>0}});var fp=i(766928);function ff(){return(0,E.jsx)(fh,{icon:fp.W,label:j.intl.string(j.t.iUa0sn),description:j.intl.format(j.t["044+8i"],{onClick:()=>(0,eH.openUserSettings)(u.X.ACCOUNT_PANEL,{analyticsLocations:[e1.A.USER_SETTINGS_SESSIONS]})}),muted:!0})}let fN=(0,a.E2)(u.X.SESSIONS_OTHER_SESSIONS_SETTING,{Component:function(){let{otherSessions:e}=fu(),t=(0,g.bG)([id.default],()=>id.default.getCurrentUser());return(0,E.jsxs)(fS,{title:j.intl.string(j.t.xx1MWc),children:[e.map(e=>(0,E.jsx)(fE,{session:e},e.id_hash)),t?.mfaEnabled?null:(0,E.jsx)(ff,{})]})},useSearchTerms:()=>[j.intl.string(j.t.Vij32M)],usePredicate:()=>{let{otherSessions:e}=fu(),t=(0,g.bG)([id.default],()=>id.default.getCurrentUser()?.mfaEnabled);return e.length>0||!t}}),f_=(0,a.zZ)(u.X.SESSIONS_CATEGORY,{useTitle:()=>j.intl.string(j.t.mEndXM),useSubtitle:()=>j.intl.string(j.t.b7ZpTM),initialize:()=>{(0,fs.GY)()},buildLayout:()=>[fT,fN,fx],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)]}),fI=(0,a.t_)(u.X.SESSIONS_PANEL,{useTitle:()=>j.intl.string(j.t.mEndXM),useObscuredNotice:da.L,buildLayout:()=>[f_]}),fC=(0,a.t0)(u.X.ACCOUNT_SESSIONS_NESTED_PANEL,{buildLayout:()=>[fI],initialize:()=>{(0,fs.GY)()},useTrailingDecoration:()=>({type:h.xn.TEXT,useText:()=>{let{currentSession:e,otherSessions:t}=fu(),i=t.length+ +(null!=e);return i>0?j.intl.formatToPlainString(j.t.G7zwOk,{count:i}):j.intl.string(j.t.MKDeyL)}})});var fb=i(464477);function fv(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(U.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 fy(){return(0,u6.bG)([id.default],()=>{let e=id.default.getCurrentUser();return null!=e&&e.mfaEnabled})}var fj=((r={}).AVAILABLE="available",r.UNAVAILABLE_NO_CRYPTO="unavailable_no_crypto",r.UNAVAILABLE_UNVERIFIED="unavailable_unverified",r);function fO(){let e=(0,u6.bG)([id.default],()=>id.default.getCurrentUser()?.verified);return fb.K7?!1===e?"unavailable_unverified":"available":"unavailable_no_crypto"}function fR(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,u6.bG)([ec.A,xg.A,id.default],()=>id.default.getCurrentUser()?.hasAnyStaffLevel()?e?j.intl.string(j.t.hxf9fX):j.intl.string(j.t["3iKih7"]):ec.A.getGuildsArray().some(e=>e.features.has(U.GuildFeatures.ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE)&&xg.A.can(U.xBc.ADMINISTRATOR,e))?e?j.intl.string(j.t.OYTCUh):j.intl.string(j.t.HC8uSZ):null)}var fL=i(466034);let fD=(0,a.Tf)(u.X.AUTHENTICATOR_APP_DISABLE_BUTTON,{useTitle:()=>j.intl.string(j.t.lQsY7B),useSubtitle:()=>fR(!0),useDisabled:()=>null!==fR(!0),useLabel:()=>j.intl.string(j.t.N86XcP),useVariant:()=>"critical-secondary",usePredicate:()=>{let e=(0,g.bG)([cP.default],()=>cP.default.hasTOTPEnabled()),t=fO()===fj.AVAILABLE;return e&&t},onClick:()=>void(0,lJ.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:()=>pU.A.disable()})}),fP=(0,a.zZ)(u.X.AUTHENTICATOR_APP_CATEGORY,{useTitle:()=>j.intl.string(j.t.RumMFo),useSubtitle:()=>j.intl.string(j.t.iTbTo7),useHeaderDecoration:function(){let e=(0,g.bG)([cP.default],()=>cP.default.hasTOTPEnabled()),t=fO()===fj.AVAILABLE;if(!e&&t)return{type:h.WX.BUTTON_GROUP,buttons:[{type:h.UV.BUTTON,id:"mfa-setup-button",text:j.intl.string(j.t.cTNUeD),onClick:fL.Ay.enableMFA}]}},useInlineNotice:function(){switch(fO()){case fj.UNAVAILABLE_NO_CRYPTO:return{type:h.lT.INLINE_NOTICE,noticeType:"info",useText:()=>j.intl.string(j.t.PhHhsj)};case fj.UNAVAILABLE_UNVERIFIED:return{type:h.lT.INLINE_NOTICE,noticeType:"warning",useText:()=>j.intl.string(j.t.uggF7o)};case fj.AVAILABLE:return}},collapseOnEmpty:!1,buildLayout:()=>[fD]});var fG=i(670492),fM=i(32880),fU=i(663417),fV=i(658675),fk=i(900686);function fw(){(0,K.openModalLazy)(async()=>{let{default:e}=await Promise.resolve().then(i.bind(i,662758));return t=>(0,E.jsx)(e,{...t,handleSubmit:e=>pU.A.sendMFABackupCodesVerificationKeyEmail(e).then(()=>{var t;return t=e,void(0,K.openModalLazy)(async()=>{let{default:e}=await Promise.all([i.e("12536"),i.e("96179")]).then(i.bind(i,518142));return i=>(0,E.jsx)(e,{...i,password:t})},{stackingBehavior:"stack"})}),title:j.intl.string(j.t.PsQmzU),actionText:j.intl.string(j.t.ajkYcF)})})}var fF=i(808658);function fB(e){return`${e.slice(0,4)}-${e.slice(4)}`}async function fz(){let e=fG.A.getVerificationKey();try{await pU.A.confirmViewBackupCodes(e,!0)}catch(e){(0,E6.P0)({message:e.body?.message??j.intl.string(j.t.F8FvUy),type:E4.Ck.FAILURE,id:"backup-code-regen-failed"})}}function fY(e){let{code:{code:t,consumed:i}}=e,n=fB(t),s=S.useRef(null),l=(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(fV.P,{checked:i}),(0,E.jsx)(es.E,{variant:"text-md/normal",children:n})]});return ck.p5?(0,E.jsx)(en.D,{tag:"li",className:e6()(fF.aY,fF.vk),innerRef:s,onKeyDown:function(e){"c"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),e.stopPropagation(),(0,ck.C)(n),s?.current?.focus())},onClick:function(){(0,ck.C)(n),(0,E6.P0)({message:j.intl.string(j.t.mGZ66D),type:E4.Ck.SUCCESS,id:"backup-code-copied"})},children:l}):(0,E.jsx)("li",{className:fF.aY,children:l})}let fX=(0,a.zZ)(u.X.BACKUP_CODES_CATEGORY,{useTitle:()=>j.intl.string(j.t.fC9qV0),useSubtitle:()=>(0,g.bG)([fG.A],()=>fG.A.getBackupCodes().length>0)?j.intl.format(j.t.tp7zEK,{}):j.intl.string(j.t.LoOi4S),usePredicate:fy,buildLayout:()=>[fH]}),fH=(0,a.E2)(u.X.BACKUP_CODES_SETTING,{useSearchTerms:()=>[j.intl.string(j.t.fC9qV0)],Component:function(){let e=(0,g.bG)([fG.A],()=>fG.A.getBackupCodes()),t=S.useMemo(()=>e.map(e=>{let{code:t,consumed:i}=e;return`* ${fB(t)}`+(i?` (${j.intl.string(j.t["ycME+9"])})`:"")}).join("\r\n"),[e]);return 0===e.length?(0,E.jsx)(eG.$,{text:j.intl.string(j.t.Jc2myK),size:"sm",variant:"secondary",onClick:fw}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("ul",{className:fF.E5,children:e.map(e=>(0,E.jsx)(fY,{code:e},e.code))}),(0,E.jsxs)(a9.e,{size:"sm",children:[(0,E.jsx)(fk.A,{fileContents:t,contentType:"text/plain",fileName:"discord_backup_codes.txt",children:(0,E.jsx)(eG.$,{text:j.intl.string(j.t["OO+Nib"]),variant:"secondary",icon:fM.s})}),(0,E.jsx)(eG.$,{text:j.intl.string(j.t["3x962E"]),variant:"secondary",icon:fU.f,onClick:fz})]})]})}}),fK=(0,a.Tf)(u.X.SMS_AUTH_DISABLE_BUTTON,{useTitle:()=>j.intl.string(j.t.lQsY7B),useSubtitle:function(){let[e,t]=S.useState(!1),i=(0,g.bG)([id.default],()=>id.default.getCurrentUser()?.phone);return null==i?null:j.intl.format(e?j.t["xDBk/I"]:j.t.bnKdnl,{phone:e?i:i.slice(-4),toggleButton:()=>(0,E.jsx)(ea.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,g.bG)([id.default],()=>id.default.getCurrentUser()?.hasFlag(U.nhx.MFA_SMS)??!1),onClick:()=>void(0,K.openModalLazy)(async()=>{let{default:e}=await Promise.resolve().then(i.bind(i,662758));return t=>(0,E.jsx)(e,{...t,handleSubmit:pU.A.disableSMS,title:j.intl.string(j.t.KLWnit),children:j.intl.string(j.t["W0/Duf"])})})}),fW=(0,a.zZ)(u.X.SMS_AUTH_CATEGORY,{useTitle:()=>j.intl.string(j.t.wuHuI5),useSubtitle:()=>(0,g.bG)([id.default],()=>fv(id.default.getCurrentUser(),!0)),useHeaderDecoration:()=>{let e=(0,g.bG)([id.default],()=>id.default.getCurrentUser()?.hasFlag(U.nhx.MFA_SMS)??!1),t=(0,g.bG)([id.default],()=>null!=fv(id.default.getCurrentUser()));if(!e)return{type:h.WX.BUTTON_GROUP,buttons:[{type:h.UV.BUTTON,id:"sms-setup-button",text:j.intl.string(j.t.Age7yU),onClick:fZ,disabled:t}]}},collapseOnEmpty:!1,usePredicate:()=>{let e=fO(),t=fy(),i=(0,g.bG)([cP.default],()=>cP.default.hasTOTPEnabled());return e===fj.AVAILABLE&&t&&i},buildLayout:()=>[fK]});function fZ(){let e=id.default.getCurrentUser();if(null!=e)if(null==e.phone){var t;t={reason:p6.d.USER_SETTINGS_UPDATE,onAddedPhone:pU.A.enableSMS},(0,K.openModalLazy)(async()=>{let{default:e}=await Promise.all([i.e("49747"),i.e("72712"),i.e("89545"),i.e("11493"),i.e("84704"),i.e("86197")]).then(i.bind(i,615715));return i=>(0,E.jsx)(e,{...i,...t})},{modalKey:p5.V})}else pU.A.enableSMS()}var fq=i(665671),fQ=i(442433),fJ=i(917136),f$=i(976910),f0=i(303778);function f1(e){let{credential:t}=e;return(0,E.jsxs)("li",{className:f0.e,children:[(0,E.jsxs)("div",{children:[(0,E.jsx)(es.E,{variant:"text-md/normal",children:t.name}),null!=t.last_used&&(0,E.jsx)(es.E,{variant:"text-sm/normal",color:"text-muted",children:j.intl.format(j.t["7JgxF5"],{lastUsed:fd(t.last_used)})})]}),(0,E.jsx)(rB.K,{icon:mM.j,variant:"icon-only",size:"sm","aria-label":j.intl.string(j.t["+nrTbK"]),onClick:e=>{(0,fQ.L3)(e,async()=>{let{default:e}=await i.e("32529").then(i.bind(i,41e3));return i=>(0,E.jsx)(e,{credential:t,...i})})}})]})}let f2=(0,a.zZ)(u.X.SECURITY_KEYS_CATEGORY,{useTitle:()=>j.intl.string(j.t.IBq4Y3),useSubtitle:()=>j.intl.string(j.t.yK9edS),useHeaderDecoration:function(){if(fO()===fj.AVAILABLE)return{type:h.WX.BUTTON_GROUP,buttons:[{type:h.UV.BUTTON,id:"add-security-key-button",text:j.intl.string(j.t["Tzs/fw"]),icon:rD.j,onClick:fq.A}]}},useInlineNotice:()=>(function(){switch(fO()){case fj.UNAVAILABLE_NO_CRYPTO:return{type:h.lT.INLINE_NOTICE,noticeType:"info",useText:()=>j.intl.string(j.t.bWCGI9)};case fj.UNAVAILABLE_UNVERIFIED:return{type:h.lT.INLINE_NOTICE,noticeType:"warning",useText:()=>j.intl.string(j.t.uggF7o)};case fj.AVAILABLE:return}})(),buildLayout:()=>[f3]}),f3=(0,a.E2)(u.X.SECURITY_KEYS_LIST,{useSearchTerms:()=>[j.intl.string(j.t.y7SXYX)],Component:function(){let{credentials:e,hasFetchedCredentials:t}=(0,g.cf)([f$.A],()=>({hasFetchedCredentials:f$.A.hasFetchedCredentials(),credentials:f$.A.getCredentials()}));return(S.useEffect(()=>{t||fJ.JQ()},[t]),t)?(0,E.jsx)(Q.B,{direction:"vertical",gap:"sm",as:"ul",children:e.map(e=>(0,E.jsx)(f1,{credential:e},e.id))}):(0,E.jsx)(dd.y,{})}}),f6=(0,a.t_)(u.X.MULTI_FACTOR_AUTHENTICATION,{useTitle:()=>j.intl.string(j.t.m0FidJ),buildLayout:()=>[f2,fP,fW,fX]}),f5=(0,a.t0)(u.X.ACCOUNT_MFA_NESTED_PANEL,{useTrailingDecoration:()=>({type:h.xn.TEXT,useText:()=>fy()?j.intl.string(j.t.lQsY7B):j.intl.string(j.t.WsUuTt)}),buildLayout:()=>[f6]}),f4=(0,a.zZ)(u.X.ACCOUNT_PASSWORD_SECURITY_CATEGORY,{useTitle:()=>j.intl.string(j.t["0iH2vc"]),buildLayout:()=>[fn,f5,fC]});var f8=i(308645),f7=i(271995),f9=i(855267);let Ne=(0,a.E2)(u.X.ACCOUNT_STANDING_SETTING,{useSearchTerms:()=>[j.intl.string(j.t["16r9jm"])],Component:f9.A}),Nt=(0,a.zZ)(u.X.ACCOUNT_STANDING_NESTED_CATEGORY,{buildLayout:()=>[Ne]}),Ni=(0,a.t_)(u.X.ACCOUNT_STANDING_PANEL,{useTitle:()=>j.intl.string(j.t["16r9jm"]),buildLayout:()=>[Nt]}),Nn=(0,a.zZ)(u.X.ACCOUNT_STANDING_CATEGORY,{useTitle:()=>j.intl.string(j.t["16r9jm"]),buildLayout:()=>[Ns]}),Ns=(0,a.t0)(u.X.ACCOUNT_STANDING_NESTED_PANEL,{useTitle:f7.$b,useSubtitle:f7.bh,useLeadingDecoration:function(){let{color:e,backgroundColor:t,Icon:i}=(0,f7._k)();return{type:h.Xy.ICON,icon:i,color:e,backgroundColor:t}},initialize:()=>{f8.Yn()},buildLayout:()=>[Ni]});var Nl=i(738188),Nr=i(834981),Na=i(987197),No=i(822585),Nu=i(840387),Nd=i(465558),Nc=i(602339);let Ng=(0,a.E2)(u.X.FAMILY_CENTER_SETTING,{Component:Nd.p,useSearchTerms:()=>[j.intl.string(Nc.default.RZqaJn),j.intl.string(Nc.default.bdBmqy),j.intl.string(Nc.default["gVWG+6"]),j.intl.string(Nc.default.ahKIJO),j.intl.string(Nc.default["8SLtqb"])]}),Nm=(0,a.zZ)(u.X.FAMILY_CENTER_CATEGORY,{buildLayout:()=>[Ng]}),NA=(0,a.t_)(u.X.FAMILY_CENTER_PANEL,{useTitle:()=>j.intl.string(Nc.default.RZqaJn),buildLayout:()=>[Nm]}),Nh=(0,a.zZ)(u.X.ACCOUNT_FAMILY_CENTER_CATEGORY,{useTitle:()=>j.intl.string(Nc.default.RZqaJn),usePersistentBadge:function(){let e=(0,Na.f)(),t=(0,No.L)()?.daysRemaining??null,i=e&&null!=t&&t>=0;return S.useMemo(()=>i?{badgeType:h.Xi.WARNING}:{badgeType:h.Xi.COUNT,useCount:Nr.VT},[i])},buildLayout:()=>[NE]}),NE=(0,a.t0)(u.X.ACCOUNT_FAMILY_CENTER_NESTED_PANEL,{useTitle:()=>(0,Nr.Li)()?j.intl.string(Nc.default.IcMQUP):j.intl.string(Nc.default["n8wrn/"]),useSubtitle:()=>{let e=(0,Nu.Z)(),t=(0,Nr.Li)();return e?t?j.intl.string(Nc.default.G8lHFU):j.intl.string(Nc.default.uOLNEZ):j.intl.string(Nc.default.Z53oSM)},useLeadingDecoration:function(){let e=(0,Na.f)(),t=(0,No.L)()?.daysRemaining??null;return!e||null==t||t<0?null:{type:h.Xy.ICON,icon:Nl.i,color:er.A.colors.ICON_FEEDBACK_WARNING,backgroundColor:er.A.colors.BACKGROUND_FEEDBACK_WARNING}},buildLayout:()=>[NA]});var NS=i(425587),NT=i(662758);function Nx(e){if(e.body.code===U.t02.INVALID_PASSWORD)throw e;(0,a4.A)({title:j.intl.string(j.t.LX0nT8),subtitle:e.body.message})}async function Np(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=id.default.getCurrentUser();if(null==t)return;let i=[];try{i=(await NS.A.fetchTeams(!0)).body}catch{}i.filter(e=>e.owner_user_id===t.id).length>0?(0,a4.A)({title:j.intl.string(j.t["Y++oNe"]),subtitle:j.intl.format(j.t.alpAUm,{devPortalLink:"https://discord.com/developers/teams"})}):ec.A.getGuildsArray().filter(e=>e.ownerId===t.id).length>0?(0,a4.A)({title:j.intl.string(j.t.vJiTOL),subtitle:j.intl.string(j.t.UyVVan)}):t.isClaimed()?(0,K.openModal)(t=>(0,E.jsx)(NT.default,{...t,handleSubmit:t=>(0,To.U_)(t,e).then(U.tEg,Nx),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,lJ.A)({title:j.intl.string(j.t.xca2ts),subtitle:j.intl.string(j.t.FB4H1D),confirmText:j.intl.string(j.t["8lQ2rR"]),onConfirm:()=>(0,To.U_)("",!0)})}let Nf=(0,a.Tf)(u.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:()=>Np(!0)}),NN=(0,a.Tf)(u.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:()=>Np(!1),usePredicate:()=>{let e=(0,g.bG)([id.default],()=>id.default.getCurrentUser());return e?.isClaimed()??!1}}),N_=(0,a.zZ)(u.X.ACCOUNT_REMOVAL_CATEGORY,{buildLayout:()=>[NN,Nf]}),NI=(0,a.t_)(u.X.ACCOUNT_PANEL,{useTitle:()=>j.intl.string(j.t["ldCE/p"]),initialize:function(){return()=>{pU.A.clearBackupCodes(),(0,To.Uo)()}},useObscuredNotice:da.L,buildLayout:()=>[ft,f4,Nn,Nh,N_]}),NC=(0,a.i4)(u.X.ACCOUNT_SIDEBAR_ITEM,{useTitle:()=>j.intl.string(j.t["ldCE/p"]),icon:A6.n,buildLayout:()=>[NI]});var Nb=i(323384);let Nv=(0,a.zZ)(u.X.AUTHORIZED_APPS_CATEGORY,{buildLayout:()=>[SS],initialize:()=>(Sh.A.fetch(),()=>{SE.iU.setState({searchQuery:""})})}),Ny=(0,a.t_)(u.X.AUTHORIZED_APPS_PANEL,{useTitle:()=>j.intl.string(j.t["f6kk+r"]),useObscuredNotice:da.L,buildLayout:()=>[Nv]}),Nj=(0,a.i4)(u.X.AUTHORIZED_APPS_SIDEBAR_ITEM,{useTitle:()=>j.intl.string(j.t["f6kk+r"]),icon:Nb.k,buildLayout:()=>[Ny]});var NO=i(176781),NR=i(888916),NL=i(341923),ND=i(572164),NP=i(430795),NG=i(915725),NM=i(16590);let NU=(0,a.zD)(u.X.CLIPS_ENABLE_AUTOCLIPPING,{useTitle:()=>j.intl.string(NM.default.j29uJx),useSubtitle:()=>j.intl.format(NM.default.UCzGcQ,{learnMoreLink:tI.A.getArticleURL(U.MVz.CLIPS)}),useValue:()=>(0,g.bG)([NG.Ay],()=>NG.Ay.getEnableAutoclipping()),setValue:NP.uL,useDisabled:NR.Rt}),NV=(0,a.zD)(u.X.CLIPS_ENABLE_GAME_SIGNALS,{useTitle:()=>j.intl.string(j.t.iV6KcI),useSubtitle:()=>j.intl.string(j.t["dJ2tX+"]),useValue:()=>(0,g.bG)([NG.Ay],()=>NG.Ay.getSettings().clipSignals.enableGameSignals),usePredicate:()=>!1,setValue:e=>{let t=NG.Ay.getSettings().clipSignals;NP.PW({...t,enableGameSignals:e})},useDisabled:NR.A0}),Nk=(0,a.zY)(u.X.CLIPS_AUTOCLIPPING_CARD,{buildLayout:()=>[NU,NV],headerSettingKey:NU.key}),Nw=(0,a.zZ)(u.X.CLIPS_AUTOCLIPPING_CATEGORY,{useTitle:()=>j.intl.string(NM.default.XWkJoi),useSubtitle:()=>j.intl.string(NM.default["MJ/VsO"]),usePredicate:function(){let e=(0,NR.As)(),t=(0,NL.H)();return e&&t},usePersistentBadge:()=>({badgeType:h.Xi.BETA}),useInlineNotice:()=>(0,ND.Et)()?null:{type:h.lT.INLINE_NOTICE,noticeType:"info",iconAlign:"center",useText:()=>j.intl.string(NM.default.wUpqua),button:{variant:"primary",size:"sm",useText:()=>j.intl.string(NM.default.qGgW4M),onClick:()=>NP.yO({clipsEnabled:!0,trackAnalytics:!0})}},buildLayout:()=>[Nk]});var NF=i(974293),NB=i(458977),Nz=i(486925),NY=i(696016);let NX=(()=>{let e=[NY.wN];for(let t=10;t<=NY.qh;t+=10)e.push(t);return e[e.length-1]!==NY.qh&&e.push(NY.qh),e})(),NH=(0,a.sN)(u.X.CLIPS_AUTO_CLIP_STORAGE_LIMIT,{usePredicate:()=>!(0,Nz.M2)(),useTitle:()=>j.intl.string(j.t.yfsrDI),useSubtitle:()=>j.intl.string(j.t.vlDHdC),minValue:NY.wN,maxValue:NY.qh,getInitialValue:()=>NG.Ay.getSettings().maxAutoClips,onValueRender:e=>`${Math.floor(e)}`,asValueChanges:e=>NP.e6(Math.floor(e)),markers:NX,onMarkerRender:e=>`${Math.floor(e)}`,useDisabled:NR.Rt}),NK=(0,a.zZ)(u.X.CLIPS_AUTOMATIC_CLIPPING_CATEGORY,{useTitle:()=>j.intl.string(j.t.sA0WKL),usePredicate:()=>{let e=(0,NR.As)(),t=(0,NF.aJ)("ClipsAutomaticClippingCategory"),i=NB.A.useConfig({location:"ClipsAutomaticClippingCategory"}).enableDistributedClips;return!e&&(t||i)},buildLayout:()=>[NH,NV]}),NW=[NY.zq,25,50,NY.Y2,NY.rv],NZ=(0,a.sN)(u.X.CLIPS_BITRATE,{usePredicate:()=>(0,NF.V0)("ClipsBitrateSetting"),useTitle:()=>j.intl.string(j.t["8bZyov"]),useSubtitle:()=>j.intl.string(j.t["h8DSx/"]),minValue:NY.zq,maxValue:NY.rv,useDefaultValue:()=>NY.Y2,getInitialValue:()=>NG.Ay.getSettings().clipsQuality.bitratePercent??NY.Y2,onValueRender:e=>`${Math.round(e)}%`,setValue:e=>{let{clipsQuality:t}=NG.Ay.getSettings();NP.GS({...t,bitratePercent:Math.round(e)})},markers:NW,onMarkerRender:e=>`${Math.round(e)}%`,useDisabled:NR.Rt});var Nq=i(226640);let NQ=(0,a.Hn)(u.X.CLIPS_FRAME_RATE,{useTitle:()=>j.intl.string(j.t["2wScL1"]),useSubtitle:()=>j.intl.string(j.t["Rf9+fy"]),useValue:()=>(0,g.bG)([NG.Ay],()=>NG.Ay.getSettings().clipsQuality.frameRate),setValue:e=>{let{clipsQuality:t}=NG.Ay.getSettings();NP.GS({...t,frameRate:e})},useOptions:Nq.Fz,useDisabled:NR.Rt});var NJ=i(372684);let N$=(0,a.E2)(u.X.CLIPS_HARDWARE_CLASSIFICATION_WARNING,{useSearchTerms:()=>[j.intl.string(j.t.SIxrIF)],usePredicate:()=>(0,g.bG)([NG.Ay],()=>NG.Ay.getHardwareClassification())===NJ.k9.BELOW_MINIMUM,Component:()=>(0,E.jsx)(aS.A,{look:aS.k.WARNING,children:j.intl.string(j.t.SIxrIF)})}),N0=(0,a.Hn)(u.X.CLIPS_LENGTH,{useTitle:()=>j.intl.string(j.t.OgfUio),useSubtitle:()=>j.intl.string(j.t.H7j4tY),useValue:()=>(0,g.bG)([NG.Ay],()=>NG.Ay.getSettings().clipsLength),setValue:e=>NP.h$(e),useOptions:Nq.Qu,useDisabled:NR.Rt}),N1=(0,a.E2)(u.X.CLIPS_QUALITY_INFOBOX,{useSearchTerms:()=>[j.intl.string(j.t["Z+MfqT"])],Component:()=>(0,E.jsx)(aS.A,{look:aS.k.INFO,children:j.intl.string(j.t["Z+MfqT"])})}),N2=(0,a.Hn)(u.X.CLIPS_RESOLUTION,{useTitle:()=>j.intl.string(j.t.aFudZJ),useSubtitle:()=>j.intl.string(j.t.nIrkW5),useValue:()=>(0,g.bG)([NG.Ay],()=>NG.Ay.getSettings().clipsQuality.resolution),setValue:e=>{let{clipsQuality:t}=NG.Ay.getSettings();NP.GS({...t,resolution:e})},useOptions:Nq.gF,useDisabled:NR.Rt}),N3=(0,a.zD)(u.X.CLIPS_ENABLE_REMINDERS,{useTitle:()=>j.intl.string(j.t["3zwNf6"]),useSubtitle:()=>j.intl.string(j.t.m4Cjj9),useValue:()=>(0,g.bG)([NG.Ay],()=>NG.Ay.getSettings().remindersEnabled),setValue:e=>NP.Mt(e),useDisabled:NR.Rt}),N6=(0,a.zZ)(u.X.CLIPS_CAPTURE_SETTINGS_CATEGORY,{useTitle:()=>j.intl.string(NM.default.TGwzMe),usePredicate:NR.As,buildLayout:()=>[N$,N0,NQ,N2,NZ,N1,N3]}),N5=(0,a.zD)(u.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,g.bG)([NG.Ay],()=>NG.Ay.getSettings().debugTooltipsEnabled),setValue:e=>NP.YP(e)}),N4=(0,a.zD)(u.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,g.bG)([NG.Ay],()=>NG.Ay.getSettings().showPovClipsInGallery),setValue:e=>NP.Uh(e)}),N8=(0,a.zZ)(u.X.CLIPS_DEVELOPER_CATEGORY,{useTitle:()=>"Developer",usePredicate:()=>(0,g.bG)([id.default],()=>{let e=id.default.getCurrentUser();return e?.isStaff()===!0||e?.isStaffPersonal()===!0}),buildLayout:()=>[N5,N4]});var N7=i(417270),N9=i(645886);let _e=(0,a.E2)(u.X.CLIPS_KEYBIND,{useSearchTerms:()=>[j.intl.string(j.t.pf54EU),j.intl.string(j.t["QyB/jK"])],Component:()=>{let e=(0,g.bG)([eB.Ay],()=>eB.Ay.getKeybindForAction(U.hCu.SAVE_CLIP,!0));tX()(null!=e,"Save clip keybind unset");let t=(0,NR.Rt)(),i=(0,NR.As)(),n=S.useRef(null),s=S.useCallback(t=>{tH.A.setKeybind({...e,shortcut:t})},[e]),l=S.useCallback(()=>{tH.A.setKeybind({...e,shortcut:(0,eq.OH)(NY.Ot)})},[e]);return(0,E.jsx)(s6.D,{label:j.intl.string(j.t.pf54EU),description:j.intl.string(j.t["QyB/jK"]),layout:"horizontal-responsive",children:(0,E.jsx)("div",{className:N9.g,children:(0,E.jsx)(tK.A,{ref:n,disabled:t,defaultValue:e.shortcut,onChange:s,trailingActions:i?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(tr.m,{text:j.intl.string(NM.default.bUtubv),position:"top",ariaHidden:!0,children:(0,E.jsx)(rB.K,{icon:rP.F,size:"sm",variant:"secondary",disabled:t,"aria-label":j.intl.string(NM.default.bUtubv),onClick:e=>{e.stopPropagation(),n.current?.toggleRecordMode()}})}),(0,E.jsx)(tr.m,{text:j.intl.string(NM.default.Kyk1Tp),position:"top",ariaHidden:!0,children:(0,E.jsx)(rB.K,{icon:N7.m,size:"sm",variant:"secondary",disabled:t,"aria-label":j.intl.string(NM.default.Kyk1Tp),onClick:e=>{e.stopPropagation(),l()}})})]}):void 0})})})}}),_t=(0,a.E2)(u.X.CLIPS_SCREENSHOT_KEYBIND,{useSearchTerms:()=>[j.intl.string(j.t["0U/hj7"]),j.intl.string(j.t["5zxkdo"])],usePredicate:as.BW,Component:()=>{let e=(0,g.bG)([eB.Ay],()=>eB.Ay.getKeybindForAction(U.hCu.SAVE_CLIP,!0)),t=(0,g.bG)([eB.Ay],()=>eB.Ay.getKeybindForAction(U.hCu.SAVE_SCREENSHOT,!0));tX()(null!=e,"Save clip keybind unset"),tX()(null!=t,"Save screenshot keybind unset");let i=S.useCallback(e=>{tH.A.setKeybind({...t,shortcut:e})},[t]);return(0,E.jsx)(s6.D,{label:j.intl.string(j.t["0U/hj7"]),description:j.intl.string(j.t["5zxkdo"]),layout:"horizontal",children:(0,E.jsx)("div",{className:N9.g,children:(0,E.jsx)(tK.A,{defaultValue:t.shortcut,onChange:i})})})}}),_i=(0,a.zD)(u.X.CLIPS_ENABLE,{useTitle:()=>j.intl.string(j.t.h8rgrK),useSubtitle:()=>j.intl.string(j.t["4Qw3NO"]),useValue:()=>(0,ND.Et)(),setValue:e=>NP.yO({clipsEnabled:e,trackAnalytics:!0})});var _n=i(915618);let _s=(0,a.zD)(u.X.CLIPS_ENABLE_DECOUPLED_CLIPPING,{useTitle:()=>j.intl.string(j.t.yXvykv),useSubtitle:()=>j.intl.string(j.t.YP3ujk),useValue:ND.XT,setValue:e=>NP.fd({enabled:e,trackAnalytics:!0}),usePredicate:function(){let e=(0,eX.isWindows)(),t=(0,_n.A)(rM.Ay),i=(0,NR.As)();return e&&t&&!i},useDisabled:NR.Rt}),_l=(0,a.zY)(u.X.CLIPS_GENERAL_CARD,{buildLayout:()=>[_i,_s,_e,_t],headerSettingKey:_i.key}),_r=(0,a.zZ)(u.X.CLIPS_GENERAL_CATEGORY,{useTitle:()=>j.intl.string(j.t["rWKv+e"]),useSubtitle:()=>j.intl.format(NM.default["dh7g+S"],{learnMoreLink:tI.A.getArticleURL(U.MVz.CLIPS)}),usePredicate:NR.As,buildLayout:()=>[_l]}),_a=(0,a.E2)(u.X.CLIPS_STORAGE_LOCATION,{useSearchTerms:()=>[j.intl.string(j.t.s4773E),j.intl.string(j.t.svjwGh)],Component:()=>{let e=(0,g.bG)([NG.Ay],()=>NG.Ay.getSettings().storageLocation),t=(0,NR.Rt)(),i=S.useRef(!1);async function n(){if(!t&&!i.current){i.current=!0;try{let e=await lf.A.fileManager.showOpenDialog({properties:["openDirectory","createDirectory"]});e.length>0&&NP.HU(e[0])}finally{i.current=!1}}}return(0,E.jsx)(s6.D,{label:j.intl.string(j.t.s4773E),description:j.intl.string(j.t.svjwGh),layout:"vertical",children:(0,E.jsxs)(Q.B,{direction:"horizontal",align:"center",gap:"sm",children:[(0,E.jsx)(rH.k,{fullWidth:!0,value:e,editable:!1,disabled:t,"aria-label":j.intl.formatToPlainString(j.t.iMONTj,{storageLocation:e})}),(0,E.jsx)(eG.$,{variant:"secondary",disabled:t,onClick:n,text:j.intl.string(NM.default.yQAN6B)})]})})}}),_o=(0,a.zZ)(u.X.CLIPS_RECORDING_CATEGORY,{useTitle:()=>j.intl.string(j.t.iIwmV5),usePredicate:()=>!(0,NR.As)(),buildLayout:()=>[N1,N$,_i,_s,N3,N0,N2,NQ,_e,_t,_a]}),_u=(0,a.zZ)(u.X.CLIPS_STORAGE_CATEGORY,{useTitle:()=>j.intl.string(NM.default["0Q+pdZ"]),usePredicate:NR.As,buildLayout:()=>[_a,NH]}),_d=(0,a.t_)(u.X.CLIPS_PANEL,{useTitle:()=>j.intl.string(j.t.z2jK6X),usePredicate:as.sw,buildLayout:()=>[_r,Nw,N6,_u,_o,NK,N8]}),_c=(0,a.i4)(u.X.CLIPS_SIDEBAR_ITEM,{useTitle:()=>j.intl.string(j.t.z2jK6X),icon:NO.x,buildLayout:()=>[_d]}),_g=(0,a.zZ)(u.X.CONNECTIONS_ADD_CONNECTIONS_CATEGORY,{buildLayout:()=>[S9],useInlineNotice:Ti}),_m=(0,a.zZ)(u.X.CONNECTIONS_CONNECTED_ACCOUNTS_CATEGORY,{buildLayout:()=>[Te]}),_A=(0,a.t_)(u.X.CONNECTIONS_PANEL,{useTitle:()=>j.intl.string(j.t["3fe7U5"]),useObscuredNotice:da.L,buildLayout:()=>[_g,_m]}),_h=(0,a.i4)(u.X.CONNECTIONS_SIDEBAR_ITEM,{useTitle:()=>j.intl.string(j.t["3fe7U5"]),icon:Eg.q,buildLayout:()=>[_A]});var _E=i(875444);function _S(e,t){let i=(0,g.bG)([SO.default],()=>SO.default.getFetchState()),n=(0,g.bG)([SO.default],()=>e?SO.default.getNewestTokensForNonChildrenApplications():SO.default.getNewestTokens()),s=S.useMemo(()=>null==n?[]:n.filter(e=>(0,_E.O)(e.application,e.scopes)).map(e=>e.application),[n]);return S.useEffect(()=>{t||Sh.A.fetch()},[t]),{showLoadingIndicator:i!==SO.FetchState.FETCHED&&(null==n||0===n.length),slayerSdkApplications:s}}var _T=i(390646);function _x(e){let{applications:t}=e,i=S.useMemo(()=>t.sort((e,t)=>dN.default.compare(t.id,e.id)),[t]),n=S.useMemo(()=>{let e=[];for(let t=0;t<3;t++){let n=i[t];if(null==n)break;e.push(n.name)}let t=e.join(", "),n=i.length-3;return n>0?j.intl.format(j.t.sHFdTg,{gameList:t,plusMoreHook:(e,t)=>(0,E.jsx)(es.E,{tag:"span",variant:"text-sm/medium",color:"text-muted",children:j.intl.format(j.t["EADv+4"],{count:n})},t)}):e.join(", ")},[i]),s=S.useMemo(()=>{let e=[];for(let t=0;t<3;t++){let n=i[t];if(null==n)break;let{icon:s,name:l,id:r}=n,a=nn.Ay.getApplicationIconURL({id:r,icon:s});e.push((0,E.jsx)(tr.m,{__unsupportedReactNodeAsText:l,children:(0,E.jsx)("img",{src:a,"aria-label":l,className:_T.Kk})},r))}let t=i.length-3;return t>0&&e.push((0,E.jsx)("div",{className:_T.lK,children:(0,E.jsx)(es.E,{variant:"text-xs/medium",color:"text-default",children:`+${t}`})},"omitted")),e},[i]);return(0,E.jsxs)("div",{className:_T.wx,children:[(0,E.jsxs)("div",{className:_T.kX,children:[(0,E.jsx)(es.E,{variant:"text-md/normal",color:"text-strong",children:n}),(0,E.jsxs)(en.D,{onClick:function(){(0,eH.openUserSettings)(u.X.AUTHORIZED_APPS_PANEL)},className:_T.bJ,children:[(0,E.jsx)(es.E,{variant:"text-xs/normal",color:"interactive-text-default",children:j.intl.format(j.t.oYaYOe,{})}),(0,E.jsx)(tL._,{size:"xxs",color:er.A.colors.INTERACTIVE_TEXT_DEFAULT,className:_T.g7})]})]}),(0,E.jsx)("div",{className:_T.yF}),(0,E.jsx)("div",{className:_T.lJ,children:s})]})}function _p(){return(0,E.jsxs)("div",{className:_T.do,children:[(0,E.jsx)(es.E,{variant:"text-md/medium",color:"text-strong",className:_T.xV,children:j.intl.string(j.t["+0U77d"])}),(0,E.jsx)(es.E,{variant:"text-sm/normal",color:"text-muted",children:j.intl.format(j.t.V8wClM,{helpdeskArticle:tI.A.getArticleURL(U.MVz.SOCIAL_LAYER_CONNECTIONS)})})]})}function _f(e){let{applications:t}=e;return t.length>0?(0,E.jsx)(_x,{applications:t}):(0,E.jsx)(_p,{})}let _N=(0,a.E2)(u.X.CONTENT_AND_SOCIAL_CONNECTED_GAMES,{useSearchTerms:()=>[j.intl.string(j.t.YpCiMt)],Component:function(){let{showLoadingIndicator:e,slayerSdkApplications:t}=_S(!0);return e?(0,E.jsx)(dd.y,{}):(0,E.jsx)(_f,{applications:t})}});function __(){let{showLoadingIndicator:e,slayerSdkApplications:t}=_S(!0,!0);return!e&&t.length>0}let _I=(0,a.zD)(u.X.CONTENT_AND_SOCIAL_ALLOW_GAME_FRIEND_DMS_SETTING,{useTitle:()=>(0,o.SV)("GameFriendDMSetting")?j.intl.string(j.t.W8JtfT):j.intl.string(j.t.XpBObB),useSubtitle:()=>(0,o.SV)("GameFriendDMSetting")?j.intl.string(j.t.a99KKy):j.intl.format(j.t.oZsHTD,{helpdeskArticle:tI.A.getArticleURL(U.MVz.SLAYER_GAME_FRIENDS)}),useSearchTerms:()=>[j.intl.string(j.t["Uv/eTx"])],useValue:()=>L.Zk.useSetting(),setValue:e=>L.Zk.updateSetting(e),usePredicate:__}),_C=(0,a.Qx)(u.X.CONTENT_AND_SOCIAL_IN_GAME_DMS_SETTING,{useTitle:()=>j.intl.string(j.t["ms+Tme"]),useSubtitle:()=>(0,o.SV)("InGameDMsSetting")?j.intl.string(j.t["0ryspy"]):j.intl.string(j.t["4NN4+/"]),useOptions:function(){return[{name:j.intl.string(j.t.JIFnN9),value:H.fL.SLAYER_SDK_RECEIVE_IN_GAME_DMS_ALL},{name:j.intl.string(j.t.rRdsk1),value:H.fL.SLAYER_SDK_RECEIVE_IN_GAME_DMS_USERS_WITH_GAME},{name:(0,o.SV)("InGameDMsSetting")?j.intl.string(j.t.IVRPMX):j.intl.string(j.t.AolKwN),value:H.fL.SLAYER_SDK_RECEIVE_IN_GAME_DMS_NONE}]},useValue:function(){let e=L.TA.useSetting();return e===H.fL.SLAYER_SDK_RECEIVE_IN_GAME_DMS_UNSET?H.fL.SLAYER_SDK_RECEIVE_IN_GAME_DMS_ALL:e},setValue:e=>L.TA.updateSetting(e),usePredicate:__}),_b=(0,a.zZ)(u.X.CONNECTED_GAMES_CATEGORY,{useSearchTerms:()=>[j.intl.string(j.t.YpCiMt)],buildLayout:()=>[_N,_I,_C]});var _v=i(687123),_y=i(444802),_j=i(558001);i(866945);var _O=i(835002);function _R(){let e=(0,_y.WX)();S.useEffect(()=>{(0,_j.N)(_O.YA.AGE_CONFIRMATION_NOTICE,_O.YX.VIEWED)},[]);let t=S.useCallback(()=>{window.open(tI.A.getArticleURL(e),"_blank"),(0,_j.N)(_O.YA.AGE_CONFIRMATION_NOTICE,_O.YX.LEARN_MORE)},[e]),i=S.useCallback(()=>{pW.A.showAgeVerificationGetStartedModal({entryPoint:pZ.q1.CONTENT_AND_SOCIAL_NOTICE}),(0,_j.N)(_O.YA.AGE_CONFIRMATION_NOTICE,_O.YX.CONFIRM_AGE)},[]);return(0,E.jsx)(t_.p,{messageType:t_.Y.INFO,action:(0,E.jsx)(ea.Q,{variant:"secondary",size:"sm",textVariant:"text-sm/medium",text:j.intl.string(j.t.FDSSia),onClick:i}),children:j.intl.format(j.t.mFgsfg,{hook:(e,i)=>(0,E.jsx)(u5.Anchor,{onClick:t,children:e},i)})})}function _L(){let e=(0,pB.aX)(_v.t.REACTIVE_CHECK),t=(0,pF.b8)();return S.useMemo(()=>{if(e&&!t)return{type:h.lT.STRONGLY_DISCOURAGED_CUSTOM,notice:_R}},[e,t])}var _D=i(308528),_P=i(171316);function _G(){let e=(0,_P.uM)(),t=(0,Nr.vx)(),i=S.useCallback(()=>{(0,sX.default)(),_D.A.openPrivateChannel({recipientIds:t}),(0,_j.N)(_O.YA.CONTENT_AND_SOCIAL_PARENTAL_CONTROLS_NOTICE,_O.YX.LEARN_MORE)},[t]),n=S.useCallback(()=>{(0,_j.N)(_O.YA.CONTENT_AND_SOCIAL_PARENTAL_CONTROLS_NOTICE,_O.YX.VIEWED)},[]);return S.useMemo(()=>{if(e)return{type:h.lT.INLINE_NOTICE,noticeType:"info",trackView:n,useText:()=>j.intl.format(Nc.default.i284fU,{hook:(e,t)=>(0,E.jsx)(u5.Anchor,{onClick:i,children:e},t),count:t.length})}},[i,e,t.length,n])}var _M=i(323073),_U=i(386171),_V=i(96607);let _k=(0,a.zD)(u.X.CONTENT_AND_SOCIAL_AGE_RESTRICTED_DM_SETTING,{useTitle:()=>(0,o.SV)("AgeRestrictedDMCommandsSetting")?j.intl.string(j.t.gvC6q7):j.intl.string(j.t.XahVjj),useSubtitle:()=>(0,o.SV)("AgeRestrictedDMCommandsSetting")?j.intl.string(j.t.zirUC1):j.intl.string(j.t.R9fXyS),useValue:_U.hT,useDisabled:function(){let e=(0,_V.A)()??!0,t=(0,_M.sP)(),i=(0,pF.yM)();return(!t||!!i)&&!e},setValue:function(e){(0,_M.p5)()&&e?pW.A.showAgeVerificationGetStartedModal({entryPoint:pZ.q1.AGE_RESTRICTED_DM_COMMANDS_SETTINGS}):L.Qe.updateSetting(e)}}),_w=(0,a.zD)(u.X.CONTENT_AND_SOCIAL_AGE_RESTRICTED_IOS_SETTING,{useTitle:()=>j.intl.string(j.t["L+yTsa"]),useSubtitle:()=>(0,o.SV)("AgeRestrictediOSSetting")?j.intl.string(j.t["t6i/jW"]):j.intl.string(j.t.hiM8pU),useValue:_U.tI,useDisabled:function(){let e=(0,_V.A)()??!0,t=(0,_M.sP)(),i=(0,pF.yM)();return S.useMemo(()=>(!t||!!i)&&!e,[t,e,i])},setValue:function(e){(0,_M.p5)()&&e?pW.A.showAgeVerificationGetStartedModal({entryPoint:pZ.q1.AGE_RESTRICTED_SERVERS_ACCESS_SETTINGS}):L.Kg.updateSetting(e)}}),_F=(0,a.AK)(u.X.CONTENT_FILTERS_APPEARANCE_NAVIGATOR,{useSubtitle:()=>j.intl.string(j.t.hOXd45),destinationKey:u.X.APPEARANCE_MESSAGES_CATEGORY}),_B=(0,a.gN)(u.X.CONTENT_FILTERS_RELATED_SETTINGS,{buildLayout:()=>[_F]});i(667532);var _z=i(390248),_Y=i(632119),_X=i(945276),_H=i(389737),_K=i(566769);function _W(){let e,t=(0,_X.A)()??!0,i=(0,_P.uM)(),n=(0,_P.uM)(),{explicitContentGuilds:s,explicitContentFriendDm:l,explicitContentNonFriendDm:r}=(e=(0,u6.cf)([up.A],()=>up.A.settings.textAndImages?.explicitContentSettings??(0,_Y.C$)()),{explicitContentGuilds:(0,_Y.Ys)({setting:e?.explicitContentGuilds}),explicitContentNonFriendDm:(0,_Y.Ys)({setting:e?.explicitContentNonFriendDm,isDm:!0}),explicitContentFriendDm:(0,_Y.Ys)({setting:e?.explicitContentFriendDm,isDm:!0,isFriend:!0})});function a(e){let t=Object.values(e);(0,_z.hK)()&&t.includes(H.TO.SHOW)?pW.A.showAgeVerificationGetStartedModal({entryPoint:pZ.q1.SENSITIVE_MEDIA_FILTER_SETTINGS}):(0,_Y.Jz)(e)}let o=[{value:H.TO.BLUR,label:j.intl.string(j.t.S49Uad)},{value:H.TO.BLOCK,label:j.intl.string(j.t["D/157Y"])}],u=[{value:H.TO.BLUR,label:j.intl.string(j.t.S49Uad)}],d={value:H.TO.SHOW,label:j.intl.string(j.t["5k5OFp"])};t&&(o.unshift(d),u.unshift(d));let c={isDisabled:n,tooltipText:i?j.intl.string(Nc.default["6Af/cw"]):void 0};return(0,E.jsxs)(_H.E,{description:j.intl.string(j.t.Wnojv1),children:[(0,E.jsx)(_K.A,{title:j.intl.string(j.t["+uI23H"]),value:l,onChange:e=>a({explicitContentFriendDm:e}),options:o,...c}),(0,E.jsx)(_K.A,{title:j.intl.string(j.t["Yh+HX1"]),value:r,onChange:e=>a({explicitContentNonFriendDm:e}),options:o,...c}),(0,E.jsx)(_K.A,{title:j.intl.string(j.t["FP+a42"]),value:s,onChange:e=>a({explicitContentGuilds:e}),isDisabled:!t||n,tooltipText:i?j.intl.string(Nc.default["6Af/cw"]):void 0,options:u})]})}function _Z(){let e,t=(0,_X.A)()??!0,i=(0,_P.uM)(),n=(0,_P.uM)(),{goreContentGuilds:s,goreContentFriendDm:l,goreContentNonFriendDm:r}=(e=(0,u6.cf)([up.A],()=>up.A.settings.textAndImages?.goreContentSettings??(0,_y.T4)()),{goreContentGuilds:(0,_y.gC)({setting:e?.goreContentGuilds}),goreContentNonFriendDm:(0,_y.gC)({setting:e?.goreContentNonFriendDm,isDm:!0}),goreContentFriendDm:(0,_y.gC)({setting:e?.goreContentFriendDm,isDm:!0,isFriend:!0})});function a(e){let t=Object.values(e);(0,_z.hK)()&&t.includes(H.TO.SHOW)?pW.A.showAgeVerificationGetStartedModal({entryPoint:pZ.q1.SENSITIVE_MEDIA_FILTER_SETTINGS}):(0,_y.qY)(e)}let o=[{value:H.TO.BLUR,label:j.intl.string(j.t.S49Uad)},{value:H.TO.BLOCK,label:j.intl.string(j.t["D/157Y"])}],u=[{value:H.TO.BLUR,label:j.intl.string(j.t.S49Uad)}],d={value:H.TO.SHOW,label:j.intl.string(j.t["5k5OFp"])};t&&(o.unshift(d),u.unshift(d));let c={isDisabled:n,tooltipText:i?j.intl.string(Nc.default["6Af/cw"]):void 0};return(0,E.jsxs)(_H.E,{description:j.intl.string(j.t.XgH9eh),children:[(0,E.jsx)(_K.A,{title:j.intl.string(j.t["+uI23H"]),value:l,onChange:e=>a({goreContentFriendDm:e}),options:o,...c}),(0,E.jsx)(_K.A,{title:j.intl.string(j.t["Yh+HX1"]),value:r,onChange:e=>a({goreContentNonFriendDm:e}),options:o,...c}),(0,E.jsx)(_K.A,{title:j.intl.string(j.t["FP+a42"]),value:s,onChange:e=>a({goreContentGuilds:e}),isDisabled:!t||n,options:u,tooltipText:i?j.intl.string(Nc.default["6Af/cw"]):void 0})]})}var _q=i(464946),_Q=i(875162),_J=i(428275);let _$=(0,a.E2)(u.X.CONTENT_AND_SOCIAL_CONTENT_FILTERS_SETTING,{Component:function(){let e=(0,_y.WX)(),t=S.useMemo(()=>[{id:"explicit-media-redaction",title:j.intl.string(j.t.GYpoAq),component:_W,orientation:"vertical"},{id:"gore-media-redaction",title:j.intl.string(j.t["16/3Bi"]),component:_Z,orientation:"vertical"}],[]);return(0,E.jsxs)(_q.h,{children:[(0,E.jsx)(_q._,{header:j.intl.string(j.t["Hj/But"]),description:j.intl.format(j.t.dliU4j,{learnMoreLink:tI.A.getArticleURL(e)})}),(0,E.jsx)(_Q.A,{tabs:t,orientation:"vertical",tabsClassName:_J.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 _0=i(639555),_1=i(617641),_2=i(546140),_3=i(406935),_6=i(594061);let _5=(0,a.zD)(u.X.CONTENT_AND_SOCIAL_DM_SAFETY_ALERTS_SETTING,{useTitle:()=>j.intl.string(j.t.qFsx5q),useSubtitle:()=>j.intl.format(j.t.lunaRv,{learnMoreLink:tI.A.getArticleURL(U.MVz.SAFETY_ALERTS)}),useValue:_2.L,setValue:function(e){return _6.wc.updateAsync("privacy",t=>{t.inappropriateConversationWarnings=_3._t.create({value:e})},_6.Sb.INFREQUENT_USER_ACTION)},usePredicate:function(){let e=(0,_1.Lc)({location:"DMSafetyAlertsSetting"}),t=(0,_0.Rv)({location:"DMSafetyAlertsSetting"}),i=(0,_X.A)()??!0;return e&&!i&&!t}});var _4=i(809505),_8=i(923457),_7=i(750714);let _9=(0,a.Qx)(u.X.CONTENT_AND_SOCIAL_DM_SPAM_SETTING,{useTitle:()=>(0,o.SV)("DMSpamSetting")?j.intl.string(j.t.puwSkY):j.intl.string(j.t.tiCXaH),useSubtitle:()=>(0,o.SV)("DMSpamSetting")?j.intl.string(j.t["+sXN3T"]):j.intl.format(j.t.RvjRRI,{appealLink:tI.A.getArticleURL(U.MVz.SAFE_DIRECT_MESSAGING)}),useValue:function(){let e=L.he.useSetting(),t=L.cj.useSetting(),i=(0,g.bG)([id.default],()=>id.default.getCurrentUser()),n=(0,pB.yv)(_8.p.SPAM_FILTERS);return e!==H.he.DEFAULT_UNSET?e:i?.nsfwAllowed===!1&&n?H.he.FRIENDS_AND_NON_FRIENDS:_7.xY.get(t)??H.he.NON_FRIENDS},setValue:e=>L.he.updateSetting(e),useOptions:function(){let e=(0,o.SV)("DMSpamSetting");return S.useMemo(()=>e?[{name:j.intl.string(j.t["+w5yKk"]),value:H.he.FRIENDS_AND_NON_FRIENDS},{name:j.intl.string(j.t.yAPg6r),value:H.he.NON_FRIENDS},{name:j.intl.string(j.t.FEXKsv),value:H.he.DISABLED}]:(0,_4.YS)(),[e])},useSearchTerms:()=>[j.intl.string(j.t.JzaP4h),j.intl.string(j.t.H9XOl3),j.intl.string(j.t.k4W40P)]}),Ie=(0,a.zZ)(u.X.CONTENT_CATEGORY,{useTitle:()=>(0,o.SV)("ContentCategory")?j.intl.string(j.t["3upKU8"]):j.intl.string(j.t.xVRG4P),useInlineNotice:function(){let e,t,i,n,s,l,r,a,o,u=_G(),d=(e=(0,Nu.Z)(),t=(0,_y.WX)(),i=S.useCallback(()=>{window.open(tI.A.getArticleURL(t),"_blank"),(0,_j.N)(_O.YA.SENSITIVE_CONTENT_FILTER_TEEN_NOTICE,_O.YX.LEARN_MORE)},[t]),n=S.useCallback(()=>{(0,_j.N)(_O.YA.SENSITIVE_CONTENT_FILTER_TEEN_NOTICE,_O.YX.VIEWED)},[]),S.useMemo(()=>{if(e)return{type:h.lT.INLINE_NOTICE,noticeType:"info",trackView:n,useText:()=>j.intl.format(j.t.EUo0yj,{hook:(e,t)=>(0,E.jsx)(u5.Anchor,{onClick:i,children:e},t)})}},[i,e,n])),c=(s=(0,pB.SJ)(),l=(0,pF.b8)(),r=s&&!l,a=S.useCallback(()=>{pW.A.showAgeVerificationGetStartedModal({entryPoint:pZ.q1.CONTENT_AND_SOCIAL_NOTICE}),(0,_j.N)(_O.YA.SENSITIVE_CONTENT_FILTER_AGE_VERIFICATION_NOTICE,_O.YX.LEARN_MORE)},[]),o=S.useCallback(()=>{(0,_j.N)(_O.YA.SENSITIVE_CONTENT_FILTER_AGE_VERIFICATION_NOTICE,_O.YX.VIEWED)},[]),S.useMemo(()=>{if(r)return{type:h.lT.INLINE_NOTICE,noticeType:"info",trackView:o,useText:()=>j.intl.format(j.t.OX4ybh,{hook:(e,t)=>(0,E.jsx)(u5.Anchor,{onClick:a,children:e},t)})}},[a,r,o])),g=_L();return u??g??c??d},buildLayout:()=>(0,o.Bv)("ContentCategory")?[_$,_5,_k,_w,_B]:[_$,_9,_5,_k,_w]});var It=i(189883);let Ii=(0,a.zD)(u.X.CONTENT_AND_SOCIAL_FRIEND_REQUESTS_EVERYONE_SETTING,{useTitle:()=>j.intl.string(j.t["7x9dyE"]),useValue:function(){let e=L.FA.useSetting();return S.useMemo(()=>(0,l6.Lx)(e),[e]).all},setValue:function(e){L.FA.updateSetting(e?U.yKI:U.yKI&~U.dzt.NO_RELATION)},useDisabled:function(){return(0,_P.uM)()}});var In=i(665260);let Is=(0,a.zD)(u.X.CONTENT_AND_SOCIAL_FRIEND_REQUESTS_MUTUAL_FRIENDS_SETTING,{useTitle:()=>j.intl.string(j.t.NfeuZ3),useValue:function(){let e=L.FA.useSetting(),t=S.useMemo(()=>(0,l6.Lx)(e),[e]);return t.all||t.mutualFriends},setValue:function(e){let t=L.FA.getSetting();L.FA.updateSetting(e?In.UI(t,U.dzt.MUTUAL_FRIENDS):In.iE(t,U.dzt.MUTUAL_FRIENDS,U.dzt.NO_RELATION))},useDisabled:function(){return(0,_P.uM)()}}),Il=(0,a.zD)(u.X.CONTENT_AND_SOCIAL_FRIEND_REQUESTS_MUTUAL_GUILDS_SETTING,{useTitle:()=>j.intl.string(j.t.qsMfsH),useSubtitle:()=>(0,o.SV)("FriendRequestsMutualGuildsSetting")?j.intl.string(j.t["6DqAp0"]):void 0,useValue:function(){let e=L.FA.useSetting(),t=S.useMemo(()=>(0,l6.Lx)(e),[e]);return t.all||t.mutualGuilds},setValue:function(e){let t=L.FA.getSetting();L.FA.updateSetting(e?In.UI(t,U.dzt.MUTUAL_GUILDS):In.iE(t,U.dzt.MUTUAL_GUILDS,U.dzt.NO_RELATION))},useDisabled:function(){return(0,_P.uM)()}}),Ir=(0,a.FW)(u.X.FRIEND_REQUESTS_FIELDSET,{useTitle:()=>j.intl.string(j.t.wTdS6S),buildLayout:()=>[Ii,Is,Il]}),Ia=(0,a.zD)(u.X.CONTENT_AND_SOCIAL_FRIEND_REQUESTS_NOTES_SETTING,{useTitle:()=>j.intl.string(j.t["jK+wdr"]),useSubtitle:()=>j.intl.string(j.t["RYh/pW"]),useValue:()=>!L.Zd.useSetting(),setValue:function(e){L.Zd.updateSetting(!e)},usePredicate:()=>It.A.useConfig({location:"Friend Request Setting"}).enabled,usePersistentBadge:()=>({badgeType:h.Xi.BETA})});function Io(){let{enabled:e}=It.A.useConfig({location:"Friend Request Setting"});return e?j.intl.string(j.t.QVbF3l):void 0}let Iu=(0,a.zZ)(u.X.FRIEND_REQUESTS_CATEGORY,{useTitle:()=>j.intl.string(j.t["5gxWrt"]),useSubtitle:Io,useSubnavLabel:()=>j.intl.string(j.t.fyA115),useInlineNotice:_G,buildLayout:()=>[Ir,Ia]}),Id=(0,a.zZ)(u.X.FRIEND_REQUESTS_CATEGORY,{useTitle:()=>j.intl.string(j.t.MNaVwq),useSubtitle:Io,useInlineNotice:_G,buildLayout:()=>[Ii,Is,Il,Ia]});var Ic=i(994500),Ig=i(428678),Im=i(717398),IA=i(730134),Ih=i(943646);function IE(e){let{listType:t,numberOfUsers:i}=e,n="blocked"===t;return(0,E.jsxs)("div",{className:Ih.wx,children:[(0,E.jsx)("div",{className:Ih.zc,children:n?(0,E.jsx)(Ig.K,{}):(0,E.jsx)(iO.G,{})}),(0,E.jsxs)("div",{className:Ih.Qq,children:[(0,E.jsx)(es.E,{variant:"text-md/semibold",color:"interactive-text-active",children:j.intl.string(n?j.t.PFOUKW:j.t["93ZDWE"])}),(0,E.jsx)(es.E,{variant:"text-md/medium",color:"text-default",children:n?j.intl.format(j.t["r91W/h"],{numberOfBlockedUsers:i}):j.intl.format(j.t.rXUeOl,{numberOfIgnoredUsers:i})})]})]})}function IS(e){let{userId:t,last:i}=e,n=(0,g.bG)([Ic.A],()=>Ic.A.isBlocked(t)),s=(0,g.bG)([id.default],()=>id.default.getUser(t)),[l,r]=S.useState(!1),a=S.useCallback(()=>{r(!0),n?Im.A.unblockUser(t).catch(()=>{r(!1)}):Im.A.unignoreUser(t,e1.A.USER_SETTINGS).catch(()=>{r(!1)})},[n,t]);return null==s?null:(0,E.jsxs)("div",{className:e6()(Ih.nM,{[Ih.fW]:i}),children:[(0,E.jsxs)("div",{className:Ih.eF,children:[(0,E.jsx)(IA.A,{user:s,size:i8._3.SIZE_40}),(0,E.jsxs)("div",{className:Ih.Qq,children:[(0,E.jsx)(es.E,{variant:"text-md/semibold",color:"text-strong",children:s.globalName??s.username}),(0,E.jsx)(es.E,{variant:"text-sm/medium",color:"text-default",children:null!=s.globalName?s.username:null})]})]}),(0,E.jsx)(eG.$,{variant:"secondary",text:j.intl.string(n?j.t.XyHpKH:j.t["8wXU9B"]),onClick:a,loading:l})]})}function IT(e){let{userIds:t,listType:i}=e,[n,s]=S.useState(5);return(0,E.jsx)(_q.h,{children:(0,E.jsxs)("div",{className:Ih.Nr,children:[(0,E.jsx)(IE,{listType:i,numberOfUsers:t.length}),(0,E.jsx)("div",{className:Ih.jS,children:t.slice(0,n).map((e,i)=>(0,E.jsx)(IS,{userId:e,last:i===t.length-1},e))}),n<t.length?(0,E.jsx)("div",{className:Ih.vM,children:(0,E.jsx)(en.D,{onClick:function(){s(e=>e+5)},className:Ih.Qf,children:(0,E.jsx)(es.E,{variant:"text-sm/semibold",color:"text-default",children:j.intl.format(j.t.jULEDr,{numberOfUsers:n+5<t.length?5:t.length-n})})})}):null]})})}let Ix=(0,a.E2)(u.X.CONTENT_AND_SOCIAL_BLOCKED_USERS,{useSearchTerms:()=>[j.intl.string(j.t.PFOUKW)],usePredicate:()=>(0,g.bG)([Ic.A],()=>Ic.A.getBlockedIDs().length>0),Component:function(){let e=(0,g.yK)([Ic.A],()=>Ic.A.getBlockedIDs());return(0,E.jsx)(IT,{userIds:e,listType:"blocked"})}}),Ip=(0,a.E2)(u.X.CONTENT_AND_SOCIAL_IGNORED_USERS,{useSearchTerms:()=>[j.intl.string(j.t["93ZDWE"])],usePredicate:()=>(0,g.bG)([Ic.A],()=>Ic.A.getIgnoredIDs().length>0),Component:function(){let e=(0,g.yK)([Ic.A],()=>Ic.A.getIgnoredIDs());return(0,E.jsx)(IT,{userIds:e,listType:"ignored"})}}),If=(0,a.zZ)(u.X.RESTRICTED_USERS_CATEGORY,{useTitle:()=>(0,o.SV)("RestrictedUsersCategory")?j.intl.string(j.t["+Iryf3"]):j.intl.string(j.t.LVwR56),useSubtitle:()=>j.intl.format(j.t["0aNQo9"],{helpArticle:tI.A.getArticleURL(U.MVz.STEALTH_REMEDIATION_FEATURE_GUIDE)}),buildLayout:()=>[Ix,Ip],usePredicate:function(){let{hasBlockedUsers:e,hasIgnoredUsers:t}=(0,g.cf)([Ic.A],()=>({hasBlockedUsers:Ic.A.getBlockedIDs().length>0,hasIgnoredUsers:Ic.A.getIgnoredIDs().length>0}));return t||e}});var IN=i(22385),I_=i(556534),II=i(111159),IC=i(152056),Ib=i(467962);let Iv={label:()=>j.intl.string(j.t["32u1Dx"]),value:IN.YG};var Iy=i(954225);function Ij(){return(0,I_.Tx)()!==IN.YG}function IO(){return j.intl.string(j.t["T+nevN"])}let IR=(0,a.zD)(u.X.CONTENT_AND_SOCIAL_PERMISSIONS_ACTIVITY_JOIN_SETTING,{useTitle:IO,useSubtitle:()=>j.intl.format(j.t.jXKQCu,{helpdeskArticle:tI.A.getArticleURL(U.MVz.ACTIVITY_STATUS_SETTINGS)}),useValue:function(){let e=(0,I_.Tx)();return!L.pE.useSetting().includes(e)},setValue:function(e){let t=IN.xk.getState().selectedGuildId,i=(0,l6.CN)();e?i.delete(t):i.add(t),L.pE.updateSetting([...i]),G.default.track(U.HAw.USER_SERVER_PRIVACY_SETTINGS_ACTION,{action:Iy.m.RESTRICT_GUILD_ACTIVITY_JOIN_TOGGLE,ingress:nB.bf.USER_SETTINGS_PRIVACY_SAFETY,guild_id:t})},usePredicate:Ij});function IL(){return(0,I_.Tx)()!==IN.YG}function ID(){return j.intl.string(D.default.WhdCGP)}let IP=(0,a.zD)(u.X.CONTENT_AND_SOCIAL_PERMISSIONS_ACTIVITY_SHARE_SETTING,{useTitle:ID,useSubtitle:()=>j.intl.string(D.default.UQ9RHJ),useValue:function(){let e=(0,I_.Tx)();return!L.JG.useSetting().includes(e)},setValue:function(e){let t=IN.xk.getState().selectedGuildId,i=(0,l6.Kk)();e?i.delete(t):i.add(t),L.JG.updateSetting([...i]),G.default.track(U.HAw.USER_SERVER_PRIVACY_SETTINGS_ACTION,{action:Iy.m.RESTRICT_GUILD_ACTIVITY_STATUS_TOGGLE,ingress:nB.bf.USER_SETTINGS_PRIVACY_SAFETY,guild_id:t})},usePredicate:IL});var IG=i(307863),IM=i(428031),IU=i(972737);function IV(){return(0,IG.e)()?j.intl.string(j.t.PMsfcH):j.intl.string(j.t.RAQUSN)}function Ik(){let e=(0,I_.Tx)(),t=(0,I_.q9)(),i=(0,IG.e)();return e===IN.YG?i?j.intl.string(j.t.XXGmuB):j.intl.string(j.t.wbYDfT):t?j.intl.string(j.t.V0ka0Q):i?j.intl.string(j.t.F9WY3f):j.intl.string(j.t.G7c3Xo)}function Iw(){let e=(0,I_.Tx)(),t=L.$s.useSetting().includes(e),i=(0,IM.K)();return e===IN.YG?!i:!t}function IF(){let e=(0,_P.uM)();return(0,I_.Tx)()===IN.YG&&e}function IB(e,t){G.default.track(U.HAw.GUILD_DEFAULT_DMS_UPDATED,{default_guilds_restricted:e,applied_to_existing_guilds:t})}function Iz(e){let t=IN.xk.getState().selectedGuildId;if(t===IN.YG){var i;i=!e,(0,IU.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:a8.$n.Colors.BRAND,onConfirm:function(){L.n6.updateSetting(i),IB(i,!1)},onCancel:function(){L.n6.updateSetting(i),L.$s.updateSetting(i?ec.A.getGuildIds():[]),IB(i,!0)}})}else{let i=(0,l6.Tb)();e?i.delete(t):i.add(t),L.$s.updateSetting(Array.from(i)),G.default.track(U.HAw.USER_SERVER_PRIVACY_SETTINGS_ACTION,{action:Iy.m.DIRECT_MESSAGES_TOGGLE,ingress:nB.bf.USER_SETTINGS_PRIVACY_SAFETY,guild_id:t})}}let IY=(0,a.zD)(u.X.CONTENT_AND_SOCIAL_PERMISSIONS_DMS_SETTING,{useTitle:Ik,useValue:Iw,useDisabled:IF,setValue:Iz}),IX=(0,a.zD)(u.X.CONTENT_AND_SOCIAL_PERMISSIONS_DMS_SETTING,{useTitle:IV,useSubtitle:Ik,useValue:Iw,useDisabled:IF,setValue:Iz});var IH=i(953298);function IK(e,t){G.default.track(U.HAw.GUILD_DEFAULT_MESSAGE_REQUEST_UPDATED,{default_guilds_restricted:e,applied_to_existing_guilds:t})}function IW(){let e=(0,o.SV)("PermissionsMessageRequestsSetting"),t=(0,I_.q9)();if(e)if(t)return j.intl.string(j.t["982I7+"]);else return j.intl.string(j.t["3yHM5i"]);return j.intl.string(j.t["3o2ojh"])}let IZ=(0,a.zD)(u.X.CONTENT_AND_SOCIAL_PERMISSIONS_MESSAGE_REQUESTS_SETTING,{useTitle:IW,useSubtitle:function(){let e=(0,o.SV)("PermissionsMessageRequestsSetting"),t=(0,I_.q9)();return e?j.intl.format(j.t.BoCjTy,{learnMoreUrl:tI.A.getArticleURL(U.MVz.MESSAGE_REQUESTS)}):t?j.intl.format(j.t.WpnWLc,{helpdeskArticle:tI.A.getArticleURL(U.MVz.MESSAGE_REQUESTS)}):j.intl.format(j.t.wkm9a3,{helpdeskArticle:tI.A.getArticleURL(U.MVz.MESSAGE_REQUESTS)})},useValue:function(){let e=(0,I_.Tx)(),t=(0,IM.K)(),i=L.$s.useSetting().includes(e),n=L.YX.useSetting(),s=L.Zr.useSetting().includes(e);return e===IN.YG?!t&&!n:!i&&!s},useDisabled:function(){let e=(0,I_.Tx)(),t=(0,_P.uM)(),i=(0,IM.K)(),n=L.$s.useSetting().includes(e);return e===IN.YG?i||t:n},setValue:function(e){let t=IN.xk.getState().selectedGuildId;if(!e&&(0,IH.w)())return void pW.A.showAgeVerificationGetStartedModal({entryPoint:pZ.q1.MESSAGE_REQUESTS_SETTINGS});if(t===IN.YG){var i;i=!e,(0,IU.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:a8.$n.Colors.BRAND,onConfirm:function(){L.YX.updateSetting(i),IK(i,!1)},onCancel:function(){L.YX.updateSetting(i),L.Zr.updateSetting(i?ec.A.getGuildIds():[]),IK(i,!0)}})}else{let i=(0,l6.xo)();e?i.delete(t):i.add(t),L.Zr.updateSetting(Array.from(i)),G.default.track(U.HAw.USER_SERVER_PRIVACY_SETTINGS_ACTION,{action:Iy.m.RESTRICT_GUILD_MESSAGE_REQUEST_TOGGLE,ingress:nB.bf.USER_SETTINGS_PRIVACY_SAFETY,guild_id:t})}}}),Iq=(0,a.E2)(u.X.CONTENT_AND_SOCIAL_PERMISSIONS_GUILD_SELECTOR,{useSearchTerms:function(){let e=(0,o.SV)("GuildSelect"),t=[IV(),IW()],i=ID(),n=IL();!e&&n&&t.push(i);let s=IO(),l=Ij();return!e&&l&&t.push(s),t},Component:function(){let{selectedGuildId:e,setSelectedGuildId:t}=(0,IN.xk)(),i=(0,g.bG)([eg.Ay],()=>eg.Ay.getFlattenedGuildIds()),n=(0,g.bG)([ec.A],()=>ec.A.getGuilds()),s=i[0];S.useEffect(()=>IC.A.subscribe(e=>{let{query:t}=e;return t.trim()},(e,i)=>{let n=IN.xk.getState().selectedGuildId;""===i&&""!==e&&n===IN.YG&&null!=s?t(s):""===e&&n!==IN.YG&&t(IN.YG)},{equalityFn:(e,t)=>e===t}),[s,t]);let l=S.useMemo(()=>{let e=[];return e.push({...Iv,id:Iv.value,label:Iv.label(),leading:(0,E.jsx)("div",{className:Ib.KP,children:(0,E.jsx)(II.p,{size:"sm",color:"white","aria-hidden":!0,className:Ib.cl})})}),i.forEach(t=>{let i=n[t];null!=i&&e.push({id:i.id,label:i.name,value:i.id,leading:(0,E.jsx)(g8.Ay,{className:Ib.cl,guild:i,size:g8.Ay.Sizes.SMALLER,active:!0})})}),e},[i,n]);return(0,E.jsx)(iH.Z,{selectionMode:"single",onSelectionChange:function(e){t(e)},value:e,options:l})}});function IQ(){let e=_G(),t=_L();if((0,I_.Tx)()===IN.YG)return e??t}let IJ=(0,a.zZ)(u.X.PERMISSIONS_CATEGORY,{useTitle:()=>j.intl.string(j.t.Y5GYcX),useSubnavLabel:()=>j.intl.string(j.t.YUU0RF),useInlineNotice:IQ,buildLayout:()=>[Iq,IY,IZ]}),I$=(0,a.zZ)(u.X.PERMISSIONS_CATEGORY,{useTitle:()=>j.intl.string(j.t.eYaT7L),useInlineNotice:IQ,buildLayout:()=>[Iq,IX,IZ,IP,IR]}),I0=(0,a.dT)(u.X.CONTENT_AND_SOCIAL_MAIN_TAB,{getTitle:()=>j.intl.string(j.t["/7xJCF"]),buildLayout:()=>[Ie,I$,Id,If]}),I1=(0,a.dT)(u.X.CONTENT_AND_SOCIAL_CONNECTED_GAMES_TAB,{initialize:()=>{Sh.A.fetch()},getTitle:()=>j.intl.string(j.t.YpCiMt),buildLayout:()=>[_b]}),I2=(0,a.t_)(u.X.CONTENT_AND_SOCIAL_PANEL,{useTitle:()=>j.intl.string(j.t["+o1pDZ"]),buildLayout:()=>[I0,I1]}),I3=(0,a.i4)(u.X.CONTENT_AND_SOCIAL_SIDEBAR_ITEM,{useTitle:()=>j.intl.string(j.t["+o1pDZ"]),icon:gI.i,buildLayout:()=>[I2]});var I6=i(254138),I5=i(290595),I4=i(153488);let I8=(0,a.zD)(u.X.CLIPS_ALLOW_VOICE_RECORDING_SETTING,{useTitle:()=>j.intl.string(j.t.AGDDkH),useSubtitle:()=>j.intl.string(j.t.kyo3dJ),useValue:()=>L.Q$.useSetting(),setValue:e=>NP.eQ({allowVoiceRecording:e})});var I7=i(157559),I9=i(331887);function Ce(){let e=(0,g.bG)([id.default],()=>id.default.getCurrentUser()),t=(0,g.bG)([I9.A],()=>I9.A.harvestType),[i,n]=S.useState(()=>Date.now()),s=null==t?i:new Date(t.created_at).getTime()+2592e6,l=S.useRef(null);return(S.useEffect(()=>{let e=s-Date.now();if(e>0){let t=setTimeout(()=>n(Date.now()),e);clearTimeout(l.current),l.current=t}return()=>clearTimeout(l.current)},[s]),e?.verified)?e.isStaff()?{allowed:!1,reason:"staff"}:null==t?{allowed:!0}:s>i?{allowed:!1,reason:"rate_limited",nextAllowed:new Date(s)}:{allowed:!0}:{allowed:!1,reason:"not_verified"}}let Ct=(0,a.Tf)(u.X.DATA_HARVEST_REQUEST_SETTING,{useTitle:()=>j.intl.string(j.t.qfFFos),useSubtitle:function(){let e=Ce();if(e.allowed)return j.intl.format(j.t.NRI6vt,{article:tI.A.getArticleURL(U.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,E.jsx)(en.D,{tag:"a",onClick:()=>(0,eH.openUserSettings)(u.X.ACCOUNT_INFO_EMAIL_SETTING),children:e},t)});case"rate_limited":{let t=rt()(e.nextAllowed).format("MMMM Do YYYY");return j.intl.format(j.t["VLMG1+"],{date:t})}default:return}},initialize:()=>{su.h.dispatch({type:"LOAD_DATA_HARVEST_TYPE_START"}),so.Bo.get({url:U.Rsh.USER_HARVEST,oldFormErrors:!0,rejectWithError:!1}).then(e=>{su.h.dispatch({type:"UPDATE_DATA_HARVEST_TYPE",harvestType:e.body})}).catch(e=>{su.h.dispatch({type:"LOAD_DATA_HARVEST_TYPE_FAILURE",error:e})})},useDisabled:()=>!Ce().allowed,useLoading:()=>(0,g.bG)([I9.A],()=>I9.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,...n}=e;(0,K.openModalLazy)(async()=>{let{default:e}=await i.e("92063").then(i.bind(i,970018));return i=>(0,E.jsx)(e,{modalProps:i,onConfirm:t})},n)}({onConfirm:i=>{t=!1,(0,To.$I)(i).then(e=>(null!=e&&null!=e.body&&su.h.dispatch({type:"UPDATE_DATA_HARVEST_TYPE",harvestType:e.body}),e)).then(e=>{null!=e&&null!=e.body?I7.A.show({title:j.intl.string(j.t.i2iul5),body:j.intl.string(j.t["6Nmv4i"])}):I7.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"]);I7.A.show({title:j.intl.string(j.t.OjbtDm),body:t})}).finally(e)},onCloseCallback:()=>{t&&e()}})})}}),Ci=(0,a.v_)(u.X.DATA_USAGE_DISCLAIMER_SETTING,{useTitle:()=>j.intl.string(j.t.D60Gfj),useSubtitle:()=>j.intl.format(j.t.dszICC,{onClickDisable:()=>(0,eH.openUserSettings)(u.X.ACCOUNT_DISABLE_SETTING),onClickDelete:()=>(0,eH.openUserSettings)(u.X.ACCOUNT_DELETE_SETTING)})}),Cn=(0,a.zD)(u.X.DATA_USAGE_PERSONALIZATION_SETTING,{useTitle:()=>j.intl.string(j.t.MNKzyg),useSubtitle:()=>j.intl.format(j.t["2SiYln"],{helpdeskArticle:tI.A.getArticleURL(U.MVz.DATA_USED_FOR_RECOMMENDED)}),useValue:function(){return(0,g.bG)([I4.A],()=>I4.A.hasConsented(U.YAq.PERSONALIZATION))},setValue:function(e){e?(0,I5.U)([U.YAq.PERSONALIZATION],[]).catch(IU.i):(0,IU.O)({header:j.intl.string(j.t["9SNpzv"]),confirmText:j.intl.string(j.t["9g5UGw"]),cancelText:j.intl.string(j.t["+ZLPw9"]),onConfirm:()=>{(0,I5.U)([],[U.YAq.PERSONALIZATION]).catch(IU.i)},body:j.intl.string(j.t.gJvDDh)})},useDisabled:_P.uM}),Cs=(0,a.zD)(u.X.DATA_USAGE_QUESTS_3P_SETTING,{useTitle:()=>j.intl.string(j.t.CyLYKZ),useSubtitle:()=>j.intl.format(j.t["md5l4/"],{helpdeskArticle:tI.A.getArticleURL(U.MVz.QUESTS_PRIVACY_CONTROLS)}),useValue:function(){return!L.vf.useSetting()},setValue:function(e){L.vf.updateSetting(!e)},useDisabled:function(){let e=L.H1.useSetting(),t=(0,_P.uM)();return e||t},useSearchTerms:()=>[j.intl.string(j.t.CyLYKZ)]}),Cl=(0,a.zD)(u.X.DATA_USAGE_QUESTS_SETTING,{useTitle:()=>j.intl.string(j.t.sJYh5t),useSubtitle:()=>j.intl.string(j.t.w4fvxe),useValue:function(){return!L.H1.useSetting()},setValue:function(e){L.H1.updateSetting(!e)},useSearchTerms:()=>[j.intl.string(j.t.VkS7Yd)],useDisabled:_P.uM}),Cr=(0,a.AK)(u.X.DATA_USAGE_ACTIVITY_PRIVACY_NAVIGATOR,{destinationKey:u.X.REGISTERED_GAMES_PANEL,useSubtitle:function(){let{names:e,totalCount:t}=v(2);return j.intl.format(j.t.GaTAYM,{count:t,nameCount:e.length,game1:e[0],game2:e[1]})},useTrailingDecoration:()=>({type:h.wF.STACKED_ICONS,useIcons:y}),usePredicate:()=>(0,g.bG)([m.Ay],()=>m.Ay.getGamesSeen(!1).some(e=>!(0,A.n1)(e)))&&(0,c.xl)()}),Ca=(0,a.gN)(u.X.DATA_USAGE_RELATED_SETTINGS,{buildLayout:()=>[Cr]}),Co=(0,a.zD)(u.X.DATA_USAGE_STATISTICS_SETTING,{useTitle:()=>j.intl.string(j.t.XuADY2),useSubtitle:()=>j.intl.format(j.t.FNqmmX,{helpdeskArticle:tI.A.getArticleURL(U.MVz.DATA_PRIVACY_CONTROLS)}),useValue:function(){return(0,g.bG)([I4.A],()=>I4.A.hasConsented(U.YAq.USAGE_STATISTICS))},setValue:function(e){e?(0,I5.U)([U.YAq.USAGE_STATISTICS],[]).catch(IU.i):(0,IU.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,I5.U)([],[U.YAq.USAGE_STATISTICS]).catch(IU.i)})},useSearchTerms:()=>[j.intl.string(j.t.XuADY2)],useDisabled:_P.uM}),Cu=(0,a.zZ)(u.X.DATA_USAGE_CATEGORY,{useTitle:()=>j.intl.string(j.t.QDAriI),useInlineNotice:_G,initialize:()=>{I4.A.fetchedConsents||(0,I5.Q)()},buildLayout:()=>[Ci,Co,Cn,Cl,Cs,I8,Ct,Ca]});var Cd=i(567926);let Cc=(0,a.zD)(u.X.NOTIFY_FRIENDS_ON_PROFILE_UPDATE_SETTING,{useTitle:()=>j.intl.string(Cd.default.F3llsQ),useSubtitle:()=>j.intl.string(Cd.default["6goWcz"]),useValue:L.Sy.useSetting,setValue:function(e){L.Sy.updateSetting(e),G.default.track(U.HAw.NOTIFICATION_SETTINGS_UPDATED,{update_type:M.Y.ACCOUNT,notify_friends_on_profile_update:e})}});function Cg(){let e=L.JG.useSetting();return(0,g.yK)([eg.Ay,ec.A],()=>{let t=new Set(e);return eg.Ay.getFlattenedGuildIds().filter(e=>null!=ec.A.getGuild(e)&&!t.has(e))},[e])}let Cm={type:h.wF.STACKED_ICONS,useIcons:function(){let e=Cg(),t=(0,g.yK)([ec.A],()=>e.slice(0,2).map(e=>ec.A.getGuild(e)).filter(e=>null!=e),[e]);return 0===t.length?null:t.length>=2?{frontIcon:{icon:(0,E.jsx)(ed.$,{guild:t[0],size:f.CD}),shape:f.e0.SQUIRCLE},backIcon:{icon:(0,E.jsx)(ed.$,{guild:t[1],size:f.CD}),shape:f.e0.SQUIRCLE}}:{frontIcon:{icon:(0,E.jsx)(ed.$,{guild:t[0],size:f.CD}),shape:f.e0.SQUIRCLE}}}},CA=(0,a.AK)(u.X.PROFILE_PRIVACY_TO_ACTIVITY_PRIVACY_NAVIGATOR,{useSubtitle:function(){let e=Cg();if(0===e.length)return j.intl.format(j.t.QJIJ5p,{});let t=ec.A.getGuild(e[0]),i=t?.name??"",n=e.length-1;return 0===n?j.intl.format(j.t["T+8J4A"],{guildName:i}):j.intl.format(j.t["3JyODQ"],{guildName:i,count:n})},useTrailingDecoration:function(){return Cm},destinationKey:u.X.ACTIVITY_PRIVACY_PANEL}),Ch=(0,a.gN)(u.X.PROFILE_PRIVACY_RELATED_SETTINGS,{usePredicate:()=>(0,F.lX)("ProfilePrivacyRelatedSettings"),buildLayout:()=>[CA]}),CE=(0,a.Qx)(u.X.PROFILE_PRIVACY_SETTING,{usePredicate:()=>(0,F.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:H.KP.FRIENDS_AND_ALL_GUILDS},{name:j.intl.string(j.t.YOIKBt),desc:j.intl.string(j.t.y0JZ4s),value:H.KP.FRIENDS_AND_SMALL_GUILDS},{name:j.intl.string(j.t.u0nlJv),desc:j.intl.string(j.t["4jnKHu"]),value:H.KP.FRIENDS_ONLY}]},useValue:L.KP.useSetting,setValue:function(e){let t=L.KP.getSetting();if(L.KP.updateSetting(e),!(0,F.W1)("ProfilePrivacySetting"))return;let n=(0,W.gS)(t,e);null!=n&&(0,K.openModalLazy)(async()=>{let{default:e}=await Promise.all([i.e("46662"),i.e("81849"),i.e("62041"),i.e("63786")]).then(i.bind(i,413201));return t=>(0,E.jsx)(e,{...t,direction:n.direction,affectedGuildIds:n.affectedGuildIds,settingName:n.settingName,mappedActivityValue:n.mappedActivityValue})})},useSearchTerms:()=>[j.intl.string(j.t.Qnf32C)]}),CS=(0,a.zZ)(u.X.PROFILE_PRIVACY_CATEGORY,{useTitle:()=>j.intl.string(j.t.ul884f),useSubtitle:()=>j.intl.format(j.t.N4jSgR,{learnMoreUrl:tI.A.getArticleURL("38859942749463-Profile-Privacy-Setting-on-Discord")}),buildLayout:()=>[CE,Cc,Ch]});var CT=i(936388),Cx=i(714763),Cp=i(814278);let Cf=(0,a.zD)(u.X.PERSISTENT_VERIFICATION_CODES_SETTING,{useTitle:()=>j.intl.string(j.t["opi/XK"]),useSubtitle:()=>j.intl.format(j.t["/T+ZlP"],{helpArticle:(0,Cp.Lu)()}),useValue:function(){return(0,g.bG)([Cx.A],()=>Cx.A.getPersistentCodesEnabled())},setValue:function(e){CT.A.updatePersistentCodesEnabled(e)}});var CN=i(787392);function C_(){return(0,g.yK)([CN.A],()=>CN.A.getUserIds())}var CI=i(803306),CC=i(966327),Cb=i(509531);function Cv(e){let{userId:t,count:i}=e,{analyticsLocations:n}=(0,nQ.Ay)(),s=(0,g.bG)([id.default],()=>id.default.getUser(t)),l=xd.Ay.getFormattedName(s),r=S.useCallback(()=>{(0,Cp.kj)(t)},[t]),a=S.useCallback(()=>(0,Tm.openUserProfileModal)({userId:t,sourceAnalyticsLocations:n}),[t,n]);return S.useEffect(()=>{(0,CI.getUser)(t)},[t]),(0,E.jsxs)("div",{className:Cb.uW,children:[null!=s&&(0,E.jsx)(CC.A,{className:Cb.my,user:s,size:i8._3.SIZE_40}),(0,E.jsxs)("div",{className:Cb.Qq,children:[(0,E.jsx)(en.D,{className:Cb.Xh,onClick:a,children:(0,E.jsx)(es.E,{variant:"text-md/semibold",color:"interactive-text-active",children:l})}),(0,E.jsx)(es.E,{variant:"text-md/medium",color:"text-default",children:j.intl.format(j.t["/MBjYF"],{count:i})})]}),(0,E.jsx)(en.D,{onClick:r,className:Cb.Qz,children:(0,E.jsx)(rz.u,{size:"xs"})})]})}function Cy(e){let{className:t,userId:i,verification:n,index:s}=e,l=(0,Cp.tC)(n.timestamp),r=S.useCallback(()=>{(0,Cp.W0)(i,n.verifiedKey)},[n.verifiedKey,i]);return(0,E.jsxs)("div",{className:t,children:[(0,E.jsxs)("div",{className:Cb.Qq,children:[(0,E.jsx)(es.E,{variant:"text-sm/semibold",color:"interactive-text-active",children:j.intl.format(j.t.N4qBBO,{index:s+1})}),(0,E.jsx)(es.E,{variant:"text-sm/medium",color:"text-default",children:l})]}),(0,E.jsx)(en.D,{className:Cb.Kk,onClick:r,children:(0,E.jsx)(gM.P,{size:"md",color:er.A.colors.INTERACTIVE_TEXT_DEFAULT})})]})}function Cj(e){let{userId:t}=e,i=(0,g.yK)([CN.A],()=>eZ()(CN.A.getUserVerifiedKeys(t)).entries().map(e=>{let[t,i]=e;return{verifiedKey:t,timestamp:i}}).sortBy(e=>-1*e.timestamp).value());return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(Cv,{userId:t,count:i.length}),i.map((e,n)=>(0,E.jsxs)(S.Fragment,{children:[(0,E.jsx)(Cy,{className:Cb.nM,userId:t,index:n,verification:e}),n!==i.length-1&&(0,E.jsx)("div",{className:Cb.yF})]},`${n}-${e.timestamp}`))]})}var CO=i(756625);let CR=(0,a.E2)(u.X.USERS_VERIFIED_KEYS_LIST_SETTING,{useSearchTerms:()=>[j.intl.string(j.t["5b3FNI"])],usePredicate:function(){let e=C_();return null!=e&&e.length>0},Component:function(){let e=C_();return(0,E.jsxs)(_q.h,{children:[(0,E.jsx)(_q._,{header:j.intl.string(j.t["5b3FNI"]),description:j.intl.format(j.t.jrTSWU,{helpArticle:(0,Cp.dc)()})}),e.map(e=>(0,E.jsx)("div",{className:CO.A,children:(0,E.jsx)(Cj,{userId:e})},e))]})}}),CL=(0,a.zZ)(u.X.VOICE_SECURITY_CATEGORY,{useTitle:()=>j.intl.string(j.t.bTwjaz),usePredicate:()=>(0,eX.isDesktop)(),buildLayout:()=>[Cf,CR]}),CD=(0,a.t_)(u.X.DATA_AND_PRIVACY_PANEL,{useTitle:()=>j.intl.string(j.t.OAuOHD),buildLayout:()=>[Cu,CS,CL]}),CP=(0,a.i4)(u.X.DATA_AND_PRIVACY_SIDEBAR_ITEM,{useTitle:()=>j.intl.string(j.t.OAuOHD),icon:I6.m,buildLayout:()=>[CD]});var CG=i(476713);let CM=(0,a.AK)(u.X.CONNECTED_GAMES_AUTHORIZED_APPS_NAVIGATOR,{useSubtitle:()=>j.intl.string(j.t.O65dzZ),useTitle:()=>j.intl.string(j.t["f6kk+r"]),destinationKey:u.X.AUTHORIZED_APPS_CATEGORY}),CU=(0,a.gN)(u.X.CONNECTED_GAMES_RELATED_SETTINGS,{buildLayout:()=>[CM]}),CV=(0,a.E2)(u.X.CONNECTED_GAMES_UNAVAILABLE,{Component:function(){let{showLoadingIndicator:e}=_S(!0,!0);return e?(0,E.jsx)(dd.y,{}):(0,E.jsx)(_p,{})},useSearchTerms:()=>[j.intl.string(j.t["+0U77d"])],usePredicate:()=>{let{showLoadingIndicator:e,slayerSdkApplications:t}=_S(!0,!0);return e||0===t.length}});function Ck(){let{slayerSdkApplications:e,showLoadingIndicator:t}=_S(!0,!0);return{sortedGames:S.useMemo(()=>e.toSorted((e,t)=>dN.default.compare(t.id,e.id)),[e]),showLoadingIndicator:t}}function Cw(){let{sortedGames:e}=Ck();return S.useMemo(()=>{let t=e[0];if(null==t)return null;let i=e[1];return{frontIcon:{icon:(0,E.jsx)("img",{src:nn.Ay.getApplicationIconURL({id:t.id,icon:t.icon}),alt:t.name,width:f.CD,height:f.CD}),shape:f.e0.ROUNDED},...null!=i&&{backIcon:{icon:(0,E.jsx)("img",{src:nn.Ay.getApplicationIconURL({id:i.id,icon:i.icon}),alt:i.name,width:f.YP,height:f.YP}),shape:f.e0.ROUNDED}}}},[e])}i(839272);let CF=(0,a.zZ)(u.X.SPAM_FILTERS_CATEGORY,{useTitle:()=>j.intl.string(j.t.Qwuoic),buildLayout:()=>[_9]}),CB=(0,a.zZ)(u.X.CONNECTED_GAMES_CATEGORY,{useTitle:()=>j.intl.string(j.t.RyvebU),useSubtitle:function(){let{sortedGames:e}=Ck();function t(e,t){return(0,E.jsx)(es.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:()=>({type:h.WX.STACKED_ICONS,useIcons:Cw}),useSearchTerms:()=>[j.intl.string(j.t.YpCiMt)],initialize:()=>{Sh.A.fetch()},buildLayout:()=>[_I,_C,CV,CU]}),Cz=(0,a.t_)(u.X.MESSAGING_PERMISSIONS_PANEL,{useTitle:()=>j.intl.string(j.t.Cz07t8),buildLayout:()=>[Ie,CF,IJ,Iu,CB,If]}),CY=(0,a.i4)(u.X.MESSAGING_PERMISSIONS_SIDEBAR_ITEM,{useTitle:()=>j.intl.string(j.t.Cz07t8),icon:CG.l,buildLayout:()=>[Cz]});var CX=i(782603),CH=i(899847),CK=i(695515),CW=i(936926);let CZ=(0,a.Hn)(u.X.MOBILE_NOTIFICATION_DELAY,{useTitle:()=>j.intl.string(j.t["8rHeOr"]),useSubtitle:()=>j.intl.string(j.t["eJE6+J"]),useValue:L.cU.useSetting,setValue:L.cU.updateSetting,useOptions:()=>eW.range(1,11).map(e=>({id:e.toString(),value:60*e,label:j.intl.formatToPlainString(j.t.iXLF9W,{minutes:e})}))}),Cq=(0,a.zD)(u.X.TEXT_TO_SPEECH_COMMAND,{useTitle:()=>j.intl.string(j.t["btbS+Z"]),useSubtitle:()=>j.intl.format(j.t.Q5crhR,{onClick:()=>(0,eH.openUserSettings)(u.X.TTS_PLAYBACK_RATE)}),useValue:L.on.useSetting,setValue:L.on.updateSetting}),CQ=(0,a.Qx)(u.X.TEXT_TO_SPEECH_NOTIFICATIONS,{useTitle:()=>j.intl.string(j.t.JZxxGx),useSubtitle:()=>j.intl.string(j.t.HDLtJl),useValue:()=>(0,g.bG)([uO.A],()=>uO.A.getTTSType()),setValue:e=>uG.default.setTTSType(e),useOptions:function(){return[{name:j.intl.string(j.t.B1AGeJ),value:U.aVn.ALL_CHANNELS},{name:j.intl.string(j.t.uzZg9e),value:U.aVn.SELECTED_CHANNEL},{name:j.intl.string(j.t.DYO5Oi),value:U.aVn.NEVER}]},usePredicate:()=>nc.$j}),CJ=u.X.NOTIFICATIONS_ADVANCED_ACCORDION,C$=(0,a.bd)(CJ,{useTitle:e=>e?j.intl.string(j.t.RyimDk):j.intl.string(j.t.CUICbO),useCollapsedSubtitle:function(){return sN(CJ,{formatter:e=>{let{title:t,index:i}=e;return"string"!=typeof t?t:0===i?`${t.charAt(0).toLocaleUpperCase()}${t.slice(1).toLocaleLowerCase()}`:t.toLocaleLowerCase()}})},buildLayout:()=>[CZ,Cq,CQ]}),C0=(0,a.zZ)(u.X.NOTIFICATIONS_ADVANCED_CATEGORY,{useTitle:()=>j.intl.string(j.t["31DySj"]),buildLayout:()=>[C$]}),C1=(0,a.zD)(u.X.ENABLE_UNREAD_MESSAGE_BADGE,{useTitle:()=>j.intl.string(j.t.VH8AIJ),useSubtitle:()=>j.intl.string(j.t["9K4qwX"]),useValue:function(){return(0,g.bG)([uO.A],()=>!uO.A.getDisableUnreadBadge())},setValue:e=>uG.default.setDisableUnreadBadge(!e)}),C2=(0,a.zZ)(u.X.NOTIFICATIONS_BADGES_CATEGORY,{useTitle:()=>j.intl.string(j.t.l6w3Vj),buildLayout:()=>[C1]});var C3=i(840559),C6=i(997187),C5=i(723923);let C4=C5.px.map(e=>(0,a.zD)(`${u.X.EMAIL_LIST_ITEM_PREFIX}${e.category}`,{useTitle:e.label,useSubtitle:e.subLabel,useValue:()=>(function(e){let{categories:t}=(0,g.cf)([C6.A],()=>C6.A.getEmailSettings());return!!t[e]})(e.category),setValue:t=>(0,C3.CA)(e.category,t)})),C8=(0,a.Tf)(u.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,g.cf)([C6.A],()=>C6.A.getEmailSettings());return C5.Zk.every(t=>!e[t])},onClick:()=>(0,C3.NI)(),useVariant:()=>"critical-secondary"}),C7=(0,a.zZ)(u.X.NOTIFICATIONS_EMAIL_CATEGORY,{useTitle:()=>j.intl.string(j.t["w/qqKK"]),initialize:function(){let{initialized:e}=C6.A.getEmailSettings();e||(0,C3.cR)()},buildLayout:()=>[...C4,C8]}),C9=(0,a.zD)(u.X.DESKTOP_NOTIFICATIONS,{useTitle:()=>j.intl.string(j.t["/0WCll"]),useSubtitle:()=>j.intl.string(j.t.wF9ih3),useValue:function(){return(0,g.bG)([uO.A],()=>uO.A.getDesktopType())!==U.nRU.NEVER},setValue:e=>uG.default.setDesktopType(e?U.nRU.ALL:U.nRU.NEVER)});var be=i(832712),bt=i(543465),bi=i(790782);let bn=(0,a.zD)(u.X.EXPERIMENTAL_UNREADS,{useTitle:()=>j.intl.string(j.t["k6m/si"]),useSubtitle:()=>j.intl.string(j.t.LGynPs),useValue:()=>(0,g.bG)([bt.Ay],()=>bt.Ay.useNewNotifications),setValue:function(e){be.A.setAccountFlag(M.i.USE_NEW_NOTIFICATIONS,e),e||(Ej.w.set("turnedOffNewNotifications",!0),G.default.track(U.HAw.NOTIFICATION_MIGRATION_OPTOUT,{num_guilds_with_new_setting:ec.A.getGuildsArray().filter(e=>bt.Ay.resolveGuildUnreadSetting(e)===bi.e.ONLY_MENTIONS).length}))},usePredicate:()=>(0,g.bG)([id.default,bt.Ay],()=>id.default.getCurrentUser()?.isStaff()||id.default.getCurrentUser()?.isStaffPersonal()||bt.Ay.useNewNotifications)});var bs=i(534654);let bl=(0,a.zD)(u.X.SCREEN_DOWNTIME_REMINDER,{useTitle:()=>j.intl.string(j.t.z9h8Ym),useSubtitle:()=>j.intl.string(j.t.TummoQ),useValue:()=>(0,g.bG)([uO.A],()=>uO.A.screenDowntimeReminder),setValue:e=>uG.default.setScreenDowntimeReminder(e),usePredicate:function(){let e=(0,CW.Vh)({location:"ScreenDowntimeReminderSetting"}),t=(0,bs.A)(),i=(0,Nr.Du)();return e&&t&&i}}),br=(0,a.zD)(u.X.SCREEN_DOWNTIME_SCHEDULE,{useTitle:()=>j.intl.string(j.t.onrAy7),useSubtitle:()=>j.intl.string(j.t["/071J7"]),useValue:L.gY.useSetting,setValue:e=>L.gY.updateSetting(e),usePredicate:function(){let e=(0,CW.Vh)({location:"ScreenDowntimeScheduleSetting"}),t=(0,bs.A)(),i=(0,Nr.Du)();return e&&t&&i}});var ba=i(70730);let bo=(0,a.zD)(u.X.FRIEND_ANNIVERSARY_NOTIFICATIONS,{useTitle:()=>j.intl.string(j.t.NjOMvh),useValue:L.oz.useSetting,setValue:function(e){L.oz.updateSetting(e),G.default.track(U.HAw.NOTIFICATION_SETTINGS_UPDATED,{update_type:M.Y.ACCOUNT,friend_anniversary_notifications:e})},useSearchTerms:()=>[j.intl.string(j.t.hi4dSk)],usePredicate:()=>{let{enabled:e}=ba.u.getConfig({location:"FriendAnniversaryNotifications"});return e}}),bu=(0,w.mj)({kind:"user",name:"2026-03-friend-is-online-v3",defaultConfig:{showSettingsToggle:!1},variations:{1:{showSettingsToggle:!0},2:{showSettingsToggle:!0}}}),bd=(0,a.zD)(u.X.FRIEND_ONLINE_NOTIFICATIONS,{useTitle:()=>j.intl.string(j.t.sQQgFj),useValue:L.NR.useSetting,setValue:function(e){L.NR.updateSetting(e),G.default.track(U.HAw.NOTIFICATION_SETTINGS_UPDATED,{update_type:M.Y.ACCOUNT,friend_online_notifications:e})},usePredicate:()=>bu.useConfig({location:"FriendOnlineNotifications"}).showSettingsToggle}),bc=(0,a.zD)(u.X.GO_LIVE_NOTIFICATIONS,{useTitle:()=>j.intl.string(j.t.FSNIvs),useValue:L.Yh.useSetting,setValue:function(e){L.Yh.updateSetting(e),G.default.track(U.HAw.NOTIFICATION_SETTINGS_UPDATED,{update_type:M.Y.ACCOUNT,go_live_notifications:e})}}),bg=(0,w.mj)({kind:"user",name:"2026-01-profile-updates-notification",defaultConfig:{showSettingsToggle:!1},variations:{0:{showSettingsToggle:!1},1:{showSettingsToggle:!0},2:{showSettingsToggle:!0}}}),bm=(0,a.zD)(u.X.PROFILE_UPDATES_NOTIFICATIONS,{useTitle:()=>j.intl.string(j.t.xBLMhQ),useValue:L.T3.useSetting,setValue:function(e){L.T3.updateSetting(e),G.default.track(U.HAw.NOTIFICATION_SETTINGS_UPDATED,{update_type:M.Y.ACCOUNT,profile_updates_notifications:e})},usePredicate:()=>bg.useConfig({location:"user_settings.ProfileUpdatesNotifications"}).showSettingsToggle});var bA=i(815807);let bh=(0,a.Hn)(u.X.REACTION_NOTIFICATIONS,{useTitle:()=>j.intl.string(j.t.Wxj9Hp),useOptions:()=>[{id:"enabled",label:j.intl.string(j.t["9x/RtT"]),value:H.Tz.NOTIFICATIONS_ENABLED},{id:"only_dms",label:j.intl.string(j.t.fJAbQd),value:H.Tz.ONLY_DMS},{id:"disabled",label:j.intl.string(j.t["xu+UDU"]),value:H.Tz.NOTIFICATIONS_DISABLED}],useValue:L.Zp.useSetting,setValue:e=>(0,bA.n4)(e,L.Zp.getSetting())}),bE=(0,a.zD)(u.X.SERVER_TRENDING_NOTIFICATIONS,{useTitle:()=>j.intl.string(j.t["k51K1+"]),useValue:L.Qr.useSetting,setValue:function(e){L.Qr.updateSetting(e),G.default.track(U.HAw.NOTIFICATION_SETTINGS_UPDATED,{update_type:M.Y.ACCOUNT,server_trending_notifications:e})},usePredicate:()=>!1}),bS=(0,w.mj)({kind:"user",name:"2026-04-upcoming-server-event",defaultConfig:{showSettingsToggle:!1},variations:{1:{showSettingsToggle:!0},2:{showSettingsToggle:!0},3:{showSettingsToggle:!0}}}),bT=(0,a.zD)(u.X.UPCOMING_SERVER_EVENT_NOTIFICATIONS,{useTitle:()=>j.intl.string(j.t.G8NPz6),useValue:L.zS.useSetting,setValue:function(e){L.zS.updateSetting(e),G.default.track(U.HAw.NOTIFICATION_SETTINGS_UPDATED,{update_type:M.Y.ACCOUNT,upcoming_server_event_notifications:e})},usePredicate:()=>bS.useConfig({location:"UpcomingServerEventNotifications"}).showSettingsToggle}),bx=(0,a.FW)(u.X.NOTIFICATION_SELECTION_FIELD_SET,{variant:"compact",useTitle:()=>j.intl.string(j.t.FEVRDV),buildLayout:()=>[bc,bo,bd,bE,bT,bm,bh]}),bp=(0,a.zD)(u.X.TASK_BAR_FLASHING,{useTitle:()=>j.intl.string(j.t.xSmFQG),useSubtitle:()=>j.intl.string(j.t.bd4j4x),useValue:()=>(0,g.bG)([uO.A],()=>uO.A.taskbarFlash),setValue:e=>uG.default.setTaskbarFlash(e),usePredicate:()=>(0,c.uF)()}),bf=(0,a.zZ)(u.X.NOTIFICATIONS_OVERVIEW_CATEGORY,{useTitle:()=>j.intl.string(j.t["/dp6yY"]),buildLayout:()=>[C9,bp,bx,bn,br,bl]});var bN=i(965957),b_=i(312671),bI=i(235079);let bC=(0,a.zD)(u.X.NOTIFICATION_HOLIDAY_SOUNDPACK,{useTitle:()=>{let e=uR.A.useHolidaySoundpack();return null==e?"":j.intl.format(j.t["E/OyBr"],{soundpack:j.intl.string(e.soundpackLabel)})},useValue:function(){let e=(0,g.bG)([b_.A],()=>b_.A.getSoundpack()),t=uR.A.useHolidaySoundpack();return e===t?.soundpack},setValue:function(e){let t=uR.A.getHolidaySoundpack();tX()(null!=t,"predicate should fail if no soundpack is available"),(0,bN.p)(e?t:bI.i.CLASSIC)},usePredicate:uR.A.useIsEligible});var bb=i(970931);let bv={useTitle:()=>j.intl.string(j.t.jD1qzM),sound:"message1",useDisabled:bb.kB,useDisabledMessage:()=>(0,bb.kB)()?j.intl.string(j.t.cIRG0s):void 0},by={useTitle:()=>j.intl.string(j.t.XBrJT6),sound:"call_ringing"},bj=(0,a.zD)(u.X.SELECTED_CHANNEL_NOTIFICATIONS,{useTitle:()=>j.intl.string(j.t.TzjwV9),useSubtitle:()=>j.intl.format(j.t.OOiGCM,{onClick:()=>uV("message3")}),useValue:()=>(0,g.bG)([uO.A],()=>uO.A.getNotifyMessagesInSelectedChannel()&&!uO.A.getDisableAllSounds()),setValue:e=>uG.default.setNotifyMessagesInSelectedChannel(e),useDisabled:()=>(0,g.bG)([uO.A],()=>uO.A.getDisableAllSounds())}),bO=(0,a.zD)(u.X.DISABLE_ALL_NOTIFICATION_SOUNDS,{useTitle:()=>j.intl.string(j.t["2ZhCOd"]),useSubtitle:()=>j.intl.string(j.t.EAKdPr),useValue:()=>(0,g.bG)([uO.A],()=>uO.A.getDisableAllSounds()),setValue:e=>uG.default.toggleDisableAllSounds(e)}),bR=(0,a.D1)(u.X.NOTIFICATION_SOUNDS_LIST,{initialize:function(){return()=>{uU()}},buildLayout:()=>[uk(bv),bj,uk(by),bO]}),bL=(0,a.AK)(u.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:u.X.SOUNDS_CATEGORY}),bD=(0,a.gN)(u.X.NOTIFICATIONS_SOUNDS_RELATED_SETTINGS,{buildLayout:()=>[bL]}),bP=(0,a.zZ)(u.X.NOTIFICATIONS_SOUNDS_CATEGORY,{useTitle:()=>j.intl.string(j.t.LweOYy),buildLayout:()=>[bC,bR,bD]}),bG=(0,a.t_)(u.X.NOTIFICATIONS_PANEL,{useTitle:()=>j.intl.string(j.t.HcoRu0),initialize:()=>{!(0,CW.Eq)({location:"NotificationsPanel"})||null!=CK.A.getAgeGroup()||CK.A.isLoading()||CK.A.canRefetch()&&CH.Ay.initialPageLoad()},buildLayout:()=>[bf,bP,C2,C7,C0]}),bM=(0,a.i4)(u.X.NOTIFICATIONS_SIDEBAR_ITEM,{useTitle:()=>j.intl.string(j.t.HcoRu0),icon:CX.X,buildLayout:()=>[bG]}),bU=(0,a.WI)(u.X.USER_SECTION,{useTitle:()=>j.intl.string(j.t.ShSTDe),hideTitle:!0,buildLayout:()=>{let e=(0,o.Bv)("UserSection");return[NC,...e?[]:[I3],CP,...e?[CY]:[],...e?[]:[Nj],...e?[]:[_h],bM,_c]}});var bV=i(387758),bk=i(271866),bw=i(147964),bF=i(868511);let bB=(0,a.zD)(u.X.APPLICATION_TEST_MODE,{useTitle:()=>j.intl.string(j.t.erOqlh),useSubtitle:()=>j.intl.string(j.t["52hMnD"]),usePredicate:L.Q_.useSetting,useValue:()=>(0,g.bG)([bw.A],()=>null!=bw.A.testModeApplicationId),setValue:e=>{e?(0,K.openModal)(e=>(0,E.jsx)(bF.A,{...e})):bk.cL()}}),bz=(0,a.zD)(u.X.DEVELOPER_MODE,{useTitle:()=>j.intl.string(j.t.ObIb1Q),useSubtitle:()=>j.intl.format(j.t["CY6q/Q"],{apiDocsUrl:U.X7G.API_DOCS}),useValue:L.Q_.useSetting,setValue:L.Q_.updateSetting,usePredicate:()=>ck.p5}),bY=(0,a.zZ)(u.X.DEVELOPER_CATEGORY,{buildLayout:()=>[bz,bB]}),bX=(0,a.t_)(u.X.DEVELOPER_PANEL,{useTitle:()=>j.intl.string(j.t["0BRxRp"]),buildLayout:()=>[bY]}),bH=(0,a.i4)(u.X.DEVELOPER_SIDEBAR_ITEM,{icon:bV.G,useTitle:()=>j.intl.string(j.t["0BRxRp"]),buildLayout:()=>[bX]});var bK=i(70688),bW=i(830215);let bZ=(0,a.i4)(u.X.LOGOUT_SIDEBAR_ITEM,{variant:"destructive",useTitle:()=>j.intl.string(j.t["2jxGer"]),icon:bK.o,onClick:()=>{(0,lJ.A)({title:j.intl.string(j.t["2jxGer"]),subtitle:j.intl.string(j.t.SUnWBB),confirmText:j.intl.string(j.t["2jxGer"]),onConfirm:()=>{bW.A.logout("settings")}})},buildLayout:()=>[]}),bq=(0,a.WI)(u.X.UTILITY_SECTION,{useTitle:()=>j.intl.string(j.t["2kOEFe"]),hideTitle:!0,buildLayout:()=>[bH,bZ]}),bQ=(0,a.Hr)({buildLayout:function(){return[pM,bU,h6,dl,(0,o.Bv)("UserSettingsRoot_buildLayout")?Ta:i3,SA,bq]},analyticsKey:"user_settings"})}