Loading
Showing the first 250,000 characters. Open raw for the full source.
function(e,t,n){n.d(t,{D:()=>jE});var i,l,s,r,a,o,u,d,c,g,m,A,E,h=n(419954),S=n(780964),x=n(550640),T=n(107384),p=n(477900),f=n(582128),_=n(17928),I=n(652215),N=n(346055),C=n(297264),b=n(364522),y=n(97808),v=n(778712),j=n(821609),O=n(775602),L=n(320095),R=n(963852),D=n(763754),P=n(20851),G=n(95701),M=n(486020),U=n(253932),V=n(105292),k=n(345016);let w=new G.nA({id:"1337",guild_id:"1337",type:I.rbe.GUILD_TEXT,name:"preview"}),F=[{status:I.clD.IDLE,discriminator:"2"},{status:I.clD.DND,discriminator:"3"},{status:I.clD.ONLINE,mobile:!0,discriminator:"4"}];function B(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,L.rh)({...(0,R.Ay)({channelId:w.id,content:e}),state:I.cmJ.SENT,reactions:t})}var z=n(856488);let X=(0,h.zD)(S.X.ENABLE_LEGACY_CHAT_INPUT,{useTitle:()=>V.intl.string(V.t.TZ2hZH),useSubtitle:()=>V.intl.string(V.t.Q7wgHc),useValue:()=>U.D_.useSetting(),setValue:e=>U.D_.updateSetting(e)}),Y=(0,h.zD)(S.X.CHAT_INLINE_MEDIA_IMAGE_DESCRIPTIONS,{useTitle:()=>V.intl.string(V.t.XYvMIX),useSubtitle:()=>V.intl.string(V.t.T0rbtM),useValue:U._z.useSetting,setValue:U._z.updateSetting});var H=n(100767),W=n(435558),K=n.n(W),Z=n(935399),q=n(331322),Q=n(893007),J=n(113494),$=n(782134),ee=n(54570),et=n(8880),en=n(75804);let ei=K().debounce(e=>{(0,ee.zU)(e)},250);function el(e){return 0===e?{value:e,label:V.intl.string(V.t["493lwX"])}:10===e?{value:e,label:V.intl.string(V.t.ZSZEdS)}:1===e?{value:e,label:"x1.0"}:{value:e,label:e%1==0?"":void 0}}function es(){let[e,t]=f.useState(!1);return(0,Z.l0)(()=>(0,ee.pr)()),(0,p.jsx)(j.$,{text:V.intl.string(V.t.SKNnqq),icon:e?J.PauseIcon:$.PlayIcon,size:"sm",onClick:function(){if(e){(0,ee.pr)(),t(!1);return}(0,ee.AU)(V.intl.string(V.t.PKaNJL),!0,void 0,function(){return t(!0)},function(){return t(!1)}),t(!0)}})}let er=(0,h.E2)(S.X.TTS_PLAYBACK_RATE,{useSearchTerms:()=>[V.intl.string(V.t.lsW5Ev)],Component:function(){let e=(0,_.bG)([et.A],()=>et.A.speechRate);return(0,p.jsxs)(q.B,{gap:16,children:[(0,p.jsx)(Q.A,{label:V.intl.string(V.t.lsW5Ev),description:V.intl.string(V.t.Ci4wMS),marks:en.P.map(el),defaultValue:e,defaultMark:1,snapToMarks:!0,minValue:en.P["0"],maxValue:en.P[en.P.length-1],onChangeEnd:ei,formatValue:e=>`x${e.toFixed(2)}`}),(0,p.jsx)(es,{})]})},usePredicate:()=>H.$j}),ea=(0,h.zZ)(S.X.AUDIO_AND_SCREEN_READER_CATEGORY,{useTitle:()=>V.intl.string(V.t.XVR0Rb),buildLayout:()=>[er,Y,X]}),eo=(0,h.AK)(S.X.ACCESSIBILITY_TO_DISPLAY_NAVIGATOR,{useSubtitle:()=>V.intl.string(V.t.aTfeGK),destinationKey:S.X.APPEARANCE_PANEL}),eu=(0,h.gN)(S.X.COLOR_AND_CONTRAST_RELATED_SETTINGS,{buildLayout:()=>[eo]});var ed=n(955572);let ec=(0,h.zD)(S.X.DESATURATE_CUSTOM_COLORS,{useTitle:()=>V.intl.string(V.t.OCJg5f),useSubtitle:()=>V.intl.string(V.t.HEO0s3),useValue:()=>(0,_.bG)([O.Ay],()=>O.Ay.desaturateUserColors),setValue:()=>(0,ed.YV)()});var eg=n(652525);let em=(0,h.zD)(S.X.ENABLE_CUSTOM_CURSOR,{useTitle:()=>V.intl.string(V.t["+Isihb"]),useSubtitle:()=>V.intl.string(V.t.nNZ1Tz),useValue:()=>(0,_.bG)([O.Ay],()=>O.Ay.enableCustomCursor),setValue:e=>(0,ed.ts)(e),usePredicate:()=>(0,eg.t)("EnableCustomCursorSetting")}),eA=(0,h.zD)(S.X.ENABLE_SWITCH_ICONS,{useTitle:()=>V.intl.string(V.t["S3z+pV"]),useSubtitle:()=>V.intl.string(V.t["3QuI9+"]),useValue:()=>(0,_.bG)([O.Ay],()=>O.Ay.isSwitchIconsEnabled),setValue:e=>(0,ed.Gm)(e),hasIcon:!0});var eE=n(554146);let eh=(0,h.zD)(S.X.HIGH_CONTRAST_MODE,{useTitle:()=>V.intl.string(V.t.aZlePv),useSubtitle:()=>V.intl.string(V.t["v2qF8+"]),useValue:()=>(0,_.bG)([O.Ay],()=>O.Ay.isHighContrastModeEnabled),setValue:e=>(0,ed.uh)(e?O._1.HIGH:O._1.DEFAULT),getDismissibleBadges:()=>[{badgeType:T.Xi.NEW,dismissibleContent:eE.M.ACCESSIBILITY_HIGH_CONTRAST_MODE_NEW_BADGE}]});var eS=n(406360),ex=n(964404);let eT=(0,h.Qx)(S.X.HIGH_DYNAMIC_RANGE,{useTitle:()=>V.intl.string(V.t.nemtgW),useSubtitle:()=>V.intl.string(V.t["O/Gjvn"]),usePersistentBadge:()=>({badgeType:T.Xi.BETA}),useOptions:function(){return f.useMemo(()=>[{name:V.intl.string(V.t.D5Fma9),desc:V.intl.string(V.t.Qj75ck),value:"no-limit"},{name:V.intl.string(V.t.ldcGIH),desc:V.intl.string(V.t["+V/bDk"]),value:"standard"}],[])},usePredicate:function(){return(0,eS.i)("HDRDynamicRangeSetting")},setValue:function(e){(0,ed.FU)(e)},useValue:function(){return(0,_.bG)([ex.Ay],()=>ex.Ay.hdrDynamicRange)},useSearchTerms:()=>["HDR",V.intl.string(V.t["O/Gjvn"])]}),ep=(0,h.Hn)(S.X.OFFICIAL_MESSAGE_STYLE,{useTitle:()=>V.intl.string(V.t.nC2XBl),useSubtitle:()=>V.intl.string(V.t.a3IPrX),useOptions:()=>[{id:"default",label:V.intl.string(V.t.ERaS6f),value:"default"},{id:"no_text_color",label:V.intl.string(V.t.JKfipk),value:"no_text_color"},{id:"no_gradient",label:V.intl.string(V.t.O2vBoY),value:"no_gradient"},{id:"hidden",label:V.intl.string(V.t["+loyQl"]),value:"hidden"}],useValue:()=>(0,_.bG)([O.Ay],()=>O.Ay.officialMessageStyle),setValue:e=>(0,ed.w_)(e)}),ef=(0,h.Hn)(S.X.ROLE_STYLE,{useTitle:()=>V.intl.string(V.t.uSOPWm),useSubtitle:()=>V.intl.string(V.t.u7fFKS),useOptions:()=>[{id:"username",label:V.intl.string(V.t.eDdMzJ),value:"username"},{id:"dot",label:V.intl.string(V.t.rdmJp0),value:"dot"},{id:"hidden",label:V.intl.string(V.t.Ji2EVJ),value:"hidden"}],useValue:()=>(0,_.bG)([O.Ay],()=>O.Ay.roleStyle),setValue:e=>(0,ed.IX)(e)});(0,h.Qx)(S.X.ROLE_STYLE,{useTitle:()=>V.intl.string(V.t.uSOPWm),useSubtitle:()=>V.intl.string(V.t["86hjzQ"]),useOptions:()=>[{name:V.intl.string(V.t.YEOEi6),value:"username"},{name:V.intl.string(V.t.mQaro3),value:"dot"},{name:V.intl.string(V.t.Ji2EVJ),value:"hidden"}],useValue:()=>(0,_.bG)([O.Ay],()=>O.Ay.roleStyle),setValue:e=>(0,ed.IX)(e)});let e_=(0,h.sN)(S.X.SATURATION,{useTitle:()=>V.intl.string(V.t["5PWWCY"]),useSubtitle:()=>V.intl.string(V.t.xf5S6P),markers:I.hH7.SATURATION_INCREMENTS,onMarkerRender:e=>100*e%2==0?`${100*e}%`:void 0,stickToMarkers:!0,minValue:0,maxValue:1,getInitialValue:()=>O.Ay.saturation,asValueChanges:e=>(0,ed.HU)(e)});var eI=n(964486),eN=n(839214),eC=n(502229),eb=n(975571);let ey=(0,eN.D)(()=>({syncEnabled:null,updateTimeout:null})),ev=(0,h.zD)(S.X.SYNC_FORCED_COLORS,{useTitle:()=>V.intl.string(V.t.cguiec),useSubtitle:()=>V.intl.format(V.t.GwEVE2,{learnMoreLink:eb.A.getArticleURL(I.MVz.FORCED_COLORS)}),useValue:()=>{let e=(0,_.bG)([O.Ay],()=>O.Ay.syncForcedColors);return(0,eI.Ay)(()=>{ey.setState({syncEnabled:O.Ay.syncForcedColors})}),ey.useState(e=>e.syncEnabled)??e},setValue:e=>{let{updateTimeout:t}=ey.getState();if(null!=t){clearTimeout(t),ey.setState({syncEnabled:e,updateTimeout:null});return}if(e===O.Ay.syncForcedColors)return void ey.setState({syncEnabled:e});let n=setTimeout(()=>{(0,ed.D3)(e),ey.setState({updateTimeout:null})},150);ey.setState({syncEnabled:e,updateTimeout:n})},usePredicate:()=>(0,eC.D)()}),ej=(0,h.zZ)(S.X.COLOR_AND_CONTRAST_CATEGORY,{useTitle:()=>V.intl.string(V.t.JqvyiY),buildLayout:()=>[e_,ec,eh,em,ev,eT,ef,ep,eA,eu]});var eO=n(397438),eL=n(355097),eR=n(141531);function eD(e){return(0,_.bG)([eO.A],()=>(function(e){switch(e){case eL._A.REDUCED_MOTION:return V.intl.format(V.t["1dT9V4"],{});case eL._A.REDUCED_MOTION_STICKERS:return V.intl.string(V.t["2ExvRu"]);case eL._A.GAME_MODE:return V.intl.string(eR.default.VGcdxP);default:return}})(eO.A.getAppliedOverrideReasonKey(e)))}function eP(e){return(0,_.bG)([eO.A],()=>eO.A.getAppliedOverrideReasonKey(e)===eL._A.GAME_MODE)}let eG=(0,h.zD)(S.X.ANIMATE_EMOJIS,{useTitle:()=>V.intl.string(V.t.iIaOlc),useSubtitle:()=>eD("animateEmoji"),useDisabled:()=>eP("animateEmoji"),useValue:()=>U.Sf.useSetting(),setValue:e=>U.Sf.updateSetting(e)}),eM=(0,h.zD)(S.X.ANIMATE_GIFS,{useTitle:()=>V.intl.string(V.t.wqsK7q),useSubtitle:()=>eD("gifAutoPlay"),useDisabled:()=>eP("gifAutoPlay"),useValue:()=>U.kt.useSetting(),setValue:e=>U.kt.updateSetting(e)});var eU=n(823894);let eV=(0,h.Qx)(S.X.ANIMATE_STICKERS,{useTitle:()=>V.intl.string(V.t.sBHIh0),useSubtitle:()=>eD("animateStickers"),useDisabled:()=>eP("animateStickers"),useOptions:()=>[{name:V.intl.string(V.t["Xp+X2U"]),value:eU.BJ.ALWAYS_ANIMATE},{name:V.intl.string(V.t.IlLT7e),desc:V.intl.string(V.t.bIW9Tl),value:eU.BJ.ANIMATE_ON_INTERACTION},{name:V.intl.string(V.t.IGu8x3),value:eU.BJ.NEVER_ANIMATE}],useValue:()=>U.S0.useSetting(),setValue:e=>U.S0.updateSetting(e)}),ek=(0,h.zD)(S.X.REDUCED_MOTION,{useTitle:()=>V.intl.string(V.t.b3XBzg),useSubtitle:()=>V.intl.format(V.t.XqvxJc,{helpdeskArticle:eb.A.getArticleURL(I.MVz.REDUCED_MOTION)}),useValue:()=>(0,_.bG)([O.Ay],()=>O.Ay.prefersReducedMotion),setValue:e=>(0,ed.qz)(e?"reduce":"no-preference")}),ew=(0,h.zD)(S.X.SYNC_REDUCED_MOTION,{useTitle:()=>V.intl.string(V.t.oL55A6),useValue:()=>(0,_.bG)([O.Ay],()=>"auto"===O.Ay.rawPrefersReducedMotion),setValue:e=>(0,ed.qz)(e?"auto":O.Ay.systemPrefersReducedMotion)});function eF(e){return V.intl.formatToPlainString(V.t.pyvjRp,{seconds:e})}let eB=(0,h.sN)(S.X.TOAST_DURATION,{useTitle:()=>V.intl.string(V.t["3oxlia"]),useSubtitle:()=>V.intl.string(V.t.CZ3jxp),markers:I.hH7.TOAST_DURATION_SECOND_INCREMENTS,onMarkerRender:e=>e%5==0||e===I.hH7.TOAST_DURATION_MIN_SECONDS||e===I.hH7.TOAST_DURATION_MAX_SECONDS?eF(e):void 0,onValueRender:eF,stickToMarkers:!0,minValue:I.hH7.TOAST_DURATION_MIN_SECONDS,maxValue:I.hH7.TOAST_DURATION_MAX_SECONDS,useDefaultValue:()=>I.hH7.TOAST_DURATION_DEFAULT_MS/1e3,getInitialValue:()=>O.Ay.minToastDurationMs/1e3,asValueChanges:e=>(0,ed.E7)(1e3*e)}),ez=(0,h.zZ)(S.X.MOTION_CATEGORY,{useTitle:()=>V.intl.string(V.t.e3TR1b),buildLayout:()=>[ek,ew,eB,eM,eG,eV]});var eX=n(688810),eY=n(259065),eH=n(701974);let eW=(0,h.zD)(S.X.DISPLAY_NAME_STYLES,{useTitle:()=>V.intl.string(eH.default["2gFUEw"]),useSubtitle:()=>{let{analyticsLocations:e}=(0,eX.Ay)();return V.intl.format(eH.default.aEax6P,{onClickOpenModal(){(0,eY.L)({analyticsLocations:e})}})},useValue:()=>(0,_.bG)([O.Ay],()=>O.Ay.displayNameStylesEnabled),setValue:e=>(0,ed.Dm)(e)});function eK(e){return`${e.toFixed(0)}px`}let eZ=(0,h.sN)(S.X.APPEARANCE_FONT_SCALING,{useTitle:()=>V.intl.string(V.t.rT3Pq5),useSubtitle:()=>V.intl.string(V.t.LXUhen),markers:I.hH7.FONT_SIZES,stickToMarkers:!0,minValue:I.hH7.FONT_SIZES["0"],maxValue:I.hH7.FONT_SIZES[I.hH7.FONT_SIZES.length-1],useDefaultValue:()=>I.hH7.FONT_SIZE_DEFAULT,getInitialValue:()=>O.Ay.fontSize,onValueRender:eK,onMarkerRender:eK,asValueChanges:e=>(0,ed.XS)(e)}),eq=(0,h.zD)(S.X.UNDERLINE_LINKS,{useTitle:()=>V.intl.string(V.t.OLZFB8),useSubtitle:()=>V.intl.string(V.t.DIX3ke),useValue:()=>(0,_.bG)([O.Ay],()=>O.Ay.alwaysShowLinkDecorations),setValue:e=>(0,ed.kI)(e)}),eQ=(0,h.zZ)(S.X.TEXT_READABILITY_CATEGORY,{useTitle:()=>V.intl.string(V.t["bxh/R7"]),buildLayout:()=>[eZ,eq,eW]});var eJ=n(873298);let e$=(0,h.Qx)(S.X.APPEARANCE_UI_DENSITY,{useTitle:()=>V.intl.string(V.t["C/5V0A"]),useSubtitle:()=>V.intl.string(V.t.QLZhYk),useSearchTerms:()=>["List Spacing"],useOptions:()=>[{name:V.intl.string(V.t["7iegX4"]),value:eJ.NS.COMPACT},{name:V.intl.string(V.t.bBvAEH),value:eJ.NS.DEFAULT},{name:V.intl.string(V.t["4cuYHx"]),value:eJ.NS.COZY}],useValue:()=>U.Xi.useSetting(),setValue:e=>{e!==eJ.NS.UNSET_UI_DENSITY&&U.Xi.updateSetting(e)}}),e0="cozy",e1="compact",e2=(0,h.Qx)(S.X.APPEARANCE_MESSAGE_DISPLAY_MODE,{useTitle:()=>V.intl.string(V.t.nKRoPv),useSubtitle:()=>V.intl.string(V.t.QntEEG),useSearchTerms:()=>[V.intl.string(V.t.ZEoGMd)],useOptions:()=>[{name:V.intl.string(V.t.Jqj4cZ),value:e0},{name:V.intl.string(V.t["1JNcPS"]),value:e1}],useValue:()=>U.hH.useSetting()?e1:e0,setValue:e=>{U.hH.updateSetting(e===e1),(0,ed.AC)()}});var e3=n(381941);function e4(e){return`${e.toFixed(0)}px`}let e5=(0,h.sN)(S.X.APPEARANCE_MESSAGE_GROUP_SPACING,{useTitle:()=>V.intl.string(V.t.Q6lKkg),useSubtitle:()=>V.intl.string(V.t.p7eUrb),markers:e3.qh,stickToMarkers:!0,minValue:e3.qh["0"],maxValue:e3.qh[e3.qh.length-1],useDefaultValue:()=>U.hH.useSetting()?e3.y5:e3.ES,useExternalValue:()=>(0,_.bG)([O.Ay],()=>O.Ay.messageGroupSpacing),getInitialValue:()=>O.Ay.messageGroupSpacing,onValueRender:e4,onMarkerRender:e4,asValueChanges:e=>{switch(e){case 0:case 4:case 8:case 16:case 24:(0,ed.AC)(e)}}});var e6=n(775121),e8=n(723702);let e7=(0,h.sN)(S.X.APPEARANCE_ZOOM,{usePredicate:()=>e8.isPlatformEmbedded,useTitle:()=>V.intl.string(V.t.i19n5L),useSubtitle:()=>V.intl.format(V.t["x9PK/3"],{modKey:e6.A.modKey}),markers:I.hH7.ZOOM_SCALES,stickToMarkers:!0,minValue:I.hH7.ZOOM_SCALES["0"],maxValue:I.hH7.ZOOM_SCALES[I.hH7.ZOOM_SCALES.length-1],useDefaultValue:()=>I.hH7.ZOOM_DEFAULT,getInitialValue:()=>O.Ay.zoom,useExternalValue:()=>(0,_.bG)([O.Ay],()=>O.Ay.zoom),onValueRender:function(e){return`${e.toFixed(0)}%`},setValue:e=>(0,ed.Qp)(e),useSearchTerms:()=>[V.intl.string(V.t.ip0uSf)]}),e9=(0,h.zZ)(S.X.VISUAL_DENSITY_CATEGORY,{useTitle:()=>V.intl.string(V.t.VKYWk8),buildLayout:()=>[e$,e2,e5,e7]}),te=(0,h.t_)(S.X.ACCESSIBILITY_PANEL,{useTitle:()=>V.intl.string(V.t.G0neg7),buildLayout:()=>[eQ,e9,ej,ez,ea],decoration:{type:T.t9.STRONGLY_DISCOURAGED_CUSTOM,component:function(){let e=U.hH.useSetting(),t=U.jW.useSetting(),n=f.useMemo(()=>[B(V.intl.formatToPlainString(V.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}]:[]),B(V.intl.formatToPlainString(V.t["4rDfgM"],{link:"https://discord.com/accessibility"}))],[t]),i=(0,_.bG)([O.Ay],()=>O.Ay.messageGroupSpacing);return(0,p.jsx)(N.M,{children:(0,p.jsxs)("section",{"aria-label":V.intl.string(V.t.RC22qg),children:[(0,p.jsx)(C.D,{variant:"text-md/medium",color:"text-muted",className:k.Vf,children:V.intl.string(V.t.RC22qg)}),(0,p.jsxs)(b.Ip,{className:k.VH,children:[(0,p.jsx)("ol",{className:k.DZ,style:{gap:i},"aria-label":V.intl.string(V.t.xfjsEV),children:n.map(t=>(0,p.jsx)("li",{children:(0,p.jsx)(P.A,{message:t,channel:w,compact:e,author:{...(0,D.p_)(t),colorString:"#dd80f4"}})},t.id))}),(0,p.jsxs)("div",{className:k.Jb,children:[(0,p.jsx)("div",{className:k.HD,children:F.map(e=>{let{status:t,discriminator:n,mobile:i=!1}=e;return(0,p.jsx)(y.eu,{status:t,isMobile:i,size:v._3.SIZE_32,src:M.Ay.getDefaultAvatarURL(void 0,n),"aria-label":V.intl.string(V.t.VKE5TK)},t)})}),(0,p.jsx)(j.$,{text:V.intl.string(V.t["2RHHgz"]),size:"sm",variant:"primary"})]})]})]})})},sticky:!0}}),tt=(0,h.i4)(S.X.ACCESSIBILITY_SIDEBAR_ITEM,{useTitle:()=>V.intl.string(V.t.G0neg7),icon:x.c,useMenu:z.A,buildLayout:()=>[te]});n(321073);var tn=n(650809),ti=n(477782),tl=n(636537),ts=n(73153),tr=n(74396),ta=n(269880),to=n(55619),tu=n(351906),td=n(174459),tc=n(189081);let tg=(0,h.zD)(S.X.SHOW_GAME_LIBRARY,{usePredicate:()=>(0,_.bG)([tc.A],()=>tc.A.hasLibraryApplication()),useTitle:()=>V.intl.string(V.t.fi3UQN),useSubtitle:()=>V.intl.string(V.t["8mYp37"]),useValue:()=>!U.l_.useSetting(),setValue:e=>U.l_.updateSetting(!e)}),tm=(0,h.zZ)(S.X.APPEARANCE_ADVANCED_CATEGORY,{useTitle:()=>V.intl.string(V.t["8/udY0"]),buildLayout:()=>[tg]});var tA=n(284009),tE=n.n(tA),th=n(199966),tS=n(963935);function tx(e){let{title:t}=e;return t}function tT(e){let{useTitle:t,settingKey:n,formatter:i,index:l}=e,s=t();return"string"==typeof s?i({title:s,index:l,key:n}):s}function tp(e){let{setting:t,formatter:n,index:i}=e;return()=>(0,p.jsx)(tT,{useTitle:t.useTitle,settingKey:t.key,formatter:n,index:i},t.key)}function tf(e){return e.type===tS.Z6.LIST}function t_(e,t){let{limit:n=2,formatter:i=tx}=t??{};tE()(n>0,"[useSettingCollapsibleSubtitle] Limit must be greater than 0");let{visibleDirectory:l,accessibleDirectory:s}=(0,th._)(),r=l.get(e)??s.get(e);tE()(null!=r&&(r.type===tS.Z6.ACCORDION||tf(r)),"[useSettingCollapsibleSubtitle] Node is not a collapsible settings node");let a=tf(r)?r.collapseAfter??0:0,o=r.layout;return f.useMemo(()=>{let e=a,t=[];for(let n of o)if("useTitle"in n&&null!=n.useTitle){if(e>0){e--;continue}t.push({key:n.key,useTitle:n.useTitle})}if(0===t.length)return"";let l=Math.min(n,3);if(t.length<=l)if(1===t.length)return V.intl.format(V.t["3H9tCW"],{settingOneHook:tp({setting:t[0],formatter:i,index:0})});else if(2===t.length)return V.intl.format(V.t.MWryo6,{settingOneHook:tp({setting:t[0],formatter:i,index:0}),settingTwoHook:tp({setting:t[1],formatter:i,index:1})});else return V.intl.format(V.t.a00b5G,{settingOneHook:tp({setting:t[0],formatter:i,index:0}),settingTwoHook:tp({setting:t[1],formatter:i,index:1}),settingThreeHook:tp({setting:t[2],formatter:i,index:2})});return 1===l?V.intl.format(V.t.O8vNbS,{settingOneHook:tp({setting:t[0],formatter:i,index:0})}):2===l?V.intl.format(V.t["acXG/W"],{settingOneHook:tp({setting:t[0],formatter:i,index:0}),settingTwoHook:tp({setting:t[1],formatter:i,index:1})}):V.intl.format(V.t["5+ldWc"],{settingOneHook:tp({setting:t[0],formatter:i,index:0}),settingTwoHook:tp({setting:t[1],formatter:i,index:1}),settingThreeHook:tp({setting:t[2],formatter:i,index:2})})},[n,a,o,i])}var tI=n(951260);let tN=(0,h.zD)(S.X.ENABLE_APPS_BUTTON,{useTitle:()=>V.intl.string(V.t.ZTH4j4),useValue:()=>(0,_.bG)([O.Ay],()=>O.Ay.isAppsButtonEnabled),setValue:e=>(0,ed.n8)({appsButtonEnabled:e})}),tC={useTitle:()=>V.intl.string(V.t["I/5LyL"]),useValue:()=>(0,_.bG)([O.Ay],()=>O.Ay.isSubmitButtonEnabled),setValue:()=>(0,ed.Xt)()},tb=(0,h.zD)(S.X.ENABLE_SEND_BUTTON,tC),ty=(0,h.zD)(S.X.ENABLE_SEND_BUTTON_OUTSIDE_EXPERIMENT,{...tC,usePredicate:()=>!(0,tI.n)("EnableSendButtonOutsideExperiment")}),tv=(0,h.zD)(S.X.CONDENSE_PICKER_WHEN_NARROW,{useTitle:()=>V.intl.string(V.t.WggFoO),useSubtitle:()=>V.intl.string(V.t.XpErGj),useValue:()=>(0,_.bG)([O.Ay],()=>O.Ay.condensePickerWhenNarrow),setValue:e=>(0,ed.n8)({condensePickerWhenNarrow:e}),usePredicate:()=>(0,_.bG)([O.Ay],()=>O.Ay.expressionPickerFormat===O.IG.FLEXIBLE)}),tj=(0,h.zD)(S.X.ENABLE_EMOJI_BUTTON,{useTitle:()=>V.intl.string(V.t.YErWkD),useValue:()=>(0,_.bG)([O.Ay],()=>O.Ay.isEmojiButtonEnabled),setValue:e=>(0,ed.n8)({emojiButtonEnabled:e}),usePredicate:()=>(0,_.bG)([O.Ay],()=>O.Ay.expressionPickerFormat===O.IG.FLEXIBLE)}),tO=(0,h.zD)(S.X.ENABLE_GIF_BUTTON,{useTitle:()=>V.intl.string(V.t.k7oNEz),useValue:()=>(0,_.bG)([O.Ay],()=>O.Ay.isGifButtonEnabled),setValue:e=>(0,ed.n8)({gifButtonEnabled:e}),usePredicate:()=>(0,_.bG)([O.Ay],()=>O.Ay.expressionPickerFormat===O.IG.FLEXIBLE)}),tL=(0,h.zD)(S.X.ENABLE_STICKER_BUTTON,{useTitle:()=>V.intl.string(V.t.Ar0krj),useValue:()=>(0,_.bG)([O.Ay],()=>O.Ay.isStickerButtonEnabled),setValue:e=>(0,ed.n8)({stickerButtonEnabled:e}),usePredicate:()=>(0,_.bG)([O.Ay],()=>O.Ay.expressionPickerFormat===O.IG.FLEXIBLE)}),tR=(0,h.Qx)(S.X.EXPRESSION_PICKER_FORMAT,{useTitle:()=>V.intl.string(V.t.AxRAWt),useValue:()=>(0,_.bG)([O.Ay],()=>O.Ay.expressionPickerFormat),setValue:e=>(0,ed.n8)({expressionPickerFormat:e}),useOptions:function(){return[{name:V.intl.string(V.t.k86Soy),desc:V.intl.string(V.t.bSGTTZ),value:O.IG.FLEXIBLE},{name:V.intl.string(V.t.bjwSOn),desc:V.intl.string(V.t.We36HX),value:O.IG.CONDENSED},{name:V.intl.string(V.t.FDIKss),desc:V.intl.string(V.t["rclZL/"]),value:O.IG.HIDDEN}]}}),tD=(0,h.FW)(S.X.EXPRESSION_PICKER_FIELD_SET,{variant:"compact",isTitleHiddenVisually:!0,useTitle:()=>V.intl.string(V.t["V9/cNN"]),buildLayout:()=>[tR,tv,tj,tO,tL]}),tP=(0,h.bd)(S.X.CHAT_BAR_ADVANCED_ACCORDION,{useTitle:function(e){return e?V.intl.string(V.t.IwVGQs):V.intl.string(V.t.cFNDh5)},useCollapsedSubtitle:()=>t_(S.X.CHAT_BAR_ADVANCED_ACCORDION),usePredicate:()=>(0,tI.n)("ChatBarAdvancedAccordion"),buildLayout:()=>[tb,tN,tD]});var tG=n(788026);let tM=(0,h.zD)(S.X.CHAT_EMOJI_CONVERT_EMOTICONS,{useTitle:()=>V.intl.string(V.t["79qal8"]),useSubtitle:()=>V.intl.format(V.t.GejoQK,{emojiHook:(e,t)=>(0,p.jsx)(tG.A,{emojiName:"\uD83D\uDE42"},t)}),useValue:U.j7.useSetting,setValue:U.j7.updateSetting}),tU=(0,h.zD)(S.X.CHAT_GAME_MENTIONS_AUTOCOMPLETE,{useTitle:()=>V.intl.string(V.t.c0oFDw),useValue:U.BQ.useSetting,setValue:U.BQ.updateSetting}),tV=(0,h.zD)(S.X.CHAT_TEXT_BOX_PREVIEWS,{useTitle:()=>V.intl.string(V.t.AqGrEI),useValue:U.SI.useSetting,setValue:e=>{td.default.track(I.HAw.PREVIEW_MARKDOWN_TOGGLED,{enabled:e,location:{section:I.JJy.SETTINGS_TEXT_AND_IMAGES}}),U.SI.updateSetting(e)}});var tk=n(793574);let tw=(0,h.zD)(S.X.CHAT_STICKERS_AUTOCOMPLETE,{useTitle:()=>V.intl.string(V.t["d+It2U"]),useValue:U.ML.useSetting,setValue:e=>{td.default.track(I.HAw.STICKERS_IN_AUTOCOMPLETE_TOGGLED,{enabled:e,location:{section:I.JJy.SETTINGS_TEXT_AND_IMAGES},location_stack:[tk.A.TEXT_AND_IMAGES]}),U.ML.updateSetting(e)}}),tF=(0,h.zZ)(S.X.APPEARANCE_CHAT_BOX_CATEGORY,{useTitle:()=>V.intl.string(V.t.Ob7VMB),useSearchTerms:()=>[V.intl.string(V.t.onqU6o)],buildLayout:()=>[tV,tM,tw,tU,ty,tP]});var tB=n(526162),tz=n(793943),tX=n(792656),tY=n(830543),tH=n(785007),tW=n(806932),tK=n(915089),tZ=n(10392),tq=n(82498),tQ=n(174197),tJ=n(202541);let t$=(0,h.E2)(S.X.APPEARANCE_IN_APP_ICON,{useSearchTerms:()=>[V.intl.string(V.t.gnwxvT)],Component:function(){let e=(0,tK.GV)(),{ref:t,...n}=(0,tH._u)({orientation:"horizontal",labelledBy:e}),i=(0,_.bG)([tB.A],()=>tB.A.isUpsellPreview);return(0,Z.Ay)(()=>{i&&(td.default.track(I.HAw.PREMIUM_UPSELL_VIEWED,{type:tJ.e.APP_ICON_UPSELL,location_stack:[tk.A.USER_SETTINGS]}),(0,tZ.sq)(I.U7l.PREMIUM_UPSELL_VIEWED,[tk.A.USER_SETTINGS],()=>(0,tq.uq)(tJ.e.APP_ICON_UPSELL)))}),(0,p.jsx)("div",{...n,ref:t,children:(0,p.jsx)(q.B,{direction:"horizontal",wrap:!0,gap:8,children:(0,p.jsx)(tW.m,{disabled:i,size:tQ.N8.SIZE_48})})})}});function t0(){(0,tz.nf)(tz.HP.APP_ICON),(0,tY.default)()}function t1(){return(0,p.jsx)(tX.A,{subscriptionTier:tJ.pe.TIER_2,defaultTextOverride:V.intl.string(V.t.mr4K7D),premiumModalAnalyticsLocation:{object:I.ZSU.BUTTON_CTA,objectType:I.AnalyticsObjectTypes.BUY},fullWidth:!0})}let t2=(0,h.zZ)(S.X.APPEARANCE_IN_APP_ICON_CATEGORY,{useTitle:()=>V.intl.string(V.t.RPh2ou),useSubtitle:()=>V.intl.string(V.t.IgENJo),useHeaderDecoration:function(){let e=(0,_.bG)([tB.A],()=>tB.A.isUpsellPreview);return f.useMemo(()=>{let t=[];return t.push({id:"preview-icon-button",type:T.UV.BUTTON,text:V.intl.string(V.t["6acvnZ"]),onClick:t0}),e&&t.push({id:"upsell-button",type:T.UV.STRONGLY_DISCOURAGED_CUSTOM,button:t1}),{type:T.WX.BUTTON_GROUP,buttons:t}},[e])},buildLayout:()=>[t$]}),t3=(0,h.AK)(S.X.APPEARANCE_CHAT_ACCESSIBLITY_NAVIGATOR,{useSubtitle:()=>V.intl.string(V.t.UDr3Iy),useSearchTerms:()=>[V.intl.string(V.t.UDr3Iy)],destinationKey:S.X.ACCESSIBILITY_PANEL}),t4=(0,h.gN)(S.X.APPEARANCE_CHAT_RELATED_SETTINGS,{buildLayout:()=>[t3]});var t5=n(193249),t6=n(16236),t8=n(749884),t7=n(22277);let t9=eb.A.getArticleURL(I.MVz.FAVORITES_GUILD),ne=(0,h.E2)(S.X.CHAT_FAVORITES_TOGGLE,{useSearchTerms:()=>[V.intl.string(t7.default.OT1NK5)],Component:function(){let e=(0,t8.A)(!1);return(0,p.jsx)(t5.d,{checked:e,description:V.intl.format(t7.default.GR2KOG,{helpCenterLink:t9}),onChange:t6.kG,label:V.intl.string(t7.default.OT1NK5),badge:"beta"})}}),nt=(0,h.zD)(S.X.CHAT_INLINE_MEDIA_LINKS,{useTitle:()=>V.intl.string(V.t.U47N1p),useValue:U.hD.useSetting,setValue:U.hD.updateSetting}),nn=(0,h.zD)(S.X.CHAT_INLINE_MEDIA_UPLOADS,{useTitle:()=>V.intl.string(V.t.VP11No),useValue:U.X6.useSetting,setValue:U.X6.updateSetting}),ni=(0,h.FW)(S.X.CHAT_INLINE_FIELD_SET,{useTitle:()=>V.intl.string(V.t["9nyle0"]),buildLayout:()=>[nt,nn]}),nl=(0,h.zD)(S.X.CHAT_EMBEDS_RENDER_EMBEDS,{useTitle:()=>V.intl.string(V.t["5bK9vw"]),useValue:U.rs.useSetting,setValue:U.rs.updateSetting}),ns=(0,h.zD)(S.X.CHAT_EMOJI_RENDER_REACTIONS,{useTitle:()=>V.intl.string(V.t["zge/fP"]),useValue:U.jW.useSetting,setValue:U.jW.updateSetting});var nr=n(28863),na=n(766075);let no=(0,h.zD)(S.X.APPEARANCE_DISPLAY_COMPACT_AVATARS,{useTitle:()=>V.intl.string(V.t.JgjNG3),useSubtitle:()=>{if(!U.hH.useSetting())return V.intl.format(V.t["31PRaj"],{a11yHook:(e,t)=>(0,p.jsx)(nr.Anchor,{onClick:()=>(0,na.openUserSettings)(S.X.APPEARANCE_MESSAGE_DISPLAY_MODE),children:e},t)})},useDisabled:()=>!U.hH.useSetting(),useValue:()=>{let e=U.aM.useSetting();return!U.hH.useSetting()||e},setValue:e=>{U.aM.updateSetting(e)}}),nu=(0,h.Hn)(S.X.CHAT_SPOILERS_SHOW_SPOILERS,{useTitle:()=>V.intl.string(V.t.QgwmVz),useOptions:()=>[{value:I.P6Q.ON_CLICK,id:I.P6Q.ON_CLICK,label:V.intl.string(V.t["KFH/me"])},{value:I.P6Q.ALWAYS,id:I.P6Q.ALWAYS,label:V.intl.string(V.t.Pe1RbL)},{value:I.P6Q.IF_MODERATOR,id:I.P6Q.IF_MODERATOR,label:V.intl.string(V.t.K5VTBE)}],useValue:U.gs.useSetting,setValue:U.gs.updateSetting}),nd=(0,h.zD)(S.X.CHAT_THREADS_SPLIT_VIEW,{useTitle:()=>V.intl.string(V.t.AInv5m),useValue:U.SY.useSetting,setValue:U.SY.updateSetting}),nc=(0,h.zZ)(S.X.APPEARANCE_MESSAGES_CATEGORY,{useTitle:()=>V.intl.string(V.t.OIgYlQ),useSearchTerms:()=>[V.intl.string(V.t["/VQax8"])],buildLayout:()=>[ni,nl,ns,nu,nd,no,ne,t4]});var ng=n(753806),nm=n(145331);let nA=(0,h.Qx)(S.X.MESSAGE_SEARCH_DEFAULT_DM_SEARCH_BEHAVIOR,{useTitle:()=>V.intl.string(V.t.VkoLsy),useSearchTerms:()=>[V.intl.string(V.t["t4+fbe"])],useOptions:function(){return[{name:V.intl.string(V.t.E9JM4J),value:0},{name:V.intl.string(V.t["Kr+lPi"]),value:1}]},useValue:()=>+!!U.Hu.useSetting(),setValue:e=>{let t=1===e;t?ng.A.cleanUpPrivateChannelSearchState():ng.A.cleanUpSearchState({type:I.I4_.DMS}),(0,nm._k)({prevIsCrossDMSettingEnabled:U.Hu.getSetting(),isCrossDMSettingEnabled:t,location:nm.vy.USER_SETTINGS}),U.Hu.updateSetting(t)}}),nE=(0,h.zZ)(S.X.APPEARANCE_SEARCH_CATEGORY,{useTitle:()=>V.intl.string(V.t["5h0QOP"]),buildLayout:()=>[nA]});var nh=n(574381);let nS=(0,h.zD)(S.X.STREAMING_AUTO_STREAMER_MODE,{useTitle:()=>V.intl.string(V.t.IxjaoF),useValue:function(){return(0,_.bG)([tu.A],()=>{let{autoToggle:e}=tu.A.getSettings();return e})},setValue:function(e){to.A.update({autoToggle:e})},usePredicate:function(){return nh.Av}}),nx=(0,h.zD)(S.X.STREAMING_STREAMER_MODE,{useTitle:()=>V.intl.string(V.t.TGNg6T),useSubtitle:()=>V.intl.string(V.t["4nXLnE"]),useValue:function(){return(0,_.bG)([tu.A],()=>{let{enabled:e}=tu.A.getSettings();return e})},setValue:function(e){to.A.update({enabled:e})}});var nT=n(77729),np=n(589051),nf=n(81684),n_=n(999834);let nI=[],nN=(0,h.Hn)(S.X.STREAMER_MODE_HIDE_OVERLAY_WIDGETS,{selectionMode:"multiple",useTitle:()=>V.intl.string(V.t.VCDSLW),useSearchTerms:()=>[V.intl.string(V.t.VCDSLW)],usePredicate:()=>{let e=(0,n_.b_)(),t=(0,np.Mn)("StreamerModeSettings");return e&&t},useOptions:function(){return f.useMemo(()=>{let e=[];for(let[t,n]of Object.entries(nf.A))!0===n.hideableInStreamerMode&&null!=n.label&&(null==n.predicate||n.predicate())&&e.push({id:t,value:t,label:n.label()});return e},[])},useValue:function(){return(0,_.bG)([tu.A],()=>tu.A.getSettings().disabledOverlayWidgets??nI)},setValue:e=>to.A.update({disabledOverlayWidgets:e}),closeOnSelect:!1,wrapTags:!0}),nC=(0,h.zD)(S.X.STREAMER_MODE_HIDE_PERSONAL_INFORMATION,{useTitle:()=>V.intl.string(V.t.LSBUGR),useValue:()=>(0,_.bG)([tu.A],()=>{let{hidePersonalInformation:e}=tu.A.getSettings();return e}),setValue:e=>to.A.update({hidePersonalInformation:e})}),nb=(0,h.zD)(S.X.STREAMER_MODE_HIDE_INVITE_LINKS,{useTitle:()=>V.intl.string(V.t.uWBOri),useValue:()=>(0,_.bG)([tu.A],()=>{let{hideInstantInvites:e}=tu.A.getSettings();return e}),setValue:e=>to.A.update({hideInstantInvites:e})}),ny=(0,h.zD)(S.X.STREAMER_MODE_DISABLE_SOUNDS,{useTitle:()=>V.intl.string(V.t.OrqYDP),useValue:()=>(0,_.bG)([tu.A],()=>{let{disableSounds:e}=tu.A.getSettings();return e}),setValue:e=>to.A.update({disableSounds:e})}),nv=(0,h.zD)(S.X.STREAMER_MODE_DISABLE_NOTIFICATIONS,{useTitle:()=>V.intl.string(V.t.sUAbLd),useValue:()=>(0,_.bG)([tu.A],()=>{let{disableNotifications:e}=tu.A.getSettings();return e}),setValue:e=>to.A.update({disableNotifications:e})}),nj=(0,h.zD)(S.X.STREAMER_MODE_HIDE_DISCORD_WINDOW_FROM_SCREEN_CAPTURE,{useTitle:()=>V.intl.string(V.t["iA81+a"]),useSubtitle:()=>V.intl.string(V.t.P4vj0h),useValue:()=>(0,_.bG)([tu.A],()=>{let{enableContentProtection:e}=tu.A.getSettings();return e}),setValue:e=>to.A.update({enableContentProtection:e}),usePredicate:()=>nT.A?.window?.supportsContentProtection?.()??!1}),nO=(0,h.FW)(S.X.STREAMER_MODE_OPTIONS_LIST,{variant:"compact",useTitle:()=>V.intl.string(V.t.xYhOEh),buildLayout:()=>[nC,nb,ny,nv,nj,nN]}),nL=(0,h.zZ)(S.X.STREAMER_MODE_CATEGORY,{useTitle:()=>V.intl.string(V.t.S5GfOW),buildLayout:()=>[nx,nS,nO]});var nR=n(147248),nD=n(141343),nP=n(665267),nG=n(414133),nM=n(98908);let nU=(0,h.Hn)(S.X.APPEARANCE_GUILD_THEME_DEFAULT_PREFERENCE,{useTitle:()=>V.intl.string(V.t.Q7mm4g),useSearchTerms:()=>[V.intl.string(nM.default["/6NbRv"])],useOptions:()=>[{id:"guild",label:V.intl.string(V.t["hrS/Pc"]),value:eJ.tI.GUILD},{id:"personal",label:V.intl.string(V.t.mlvXIq),value:eJ.tI.PERSONAL}],useValue:()=>U.zY.useSetting(),setValue:U.zY.updateSetting,usePredicate:()=>(0,nG.OS)("GuildThemeDefaultPreferenceSetting")}),nV=(0,h.zD)(S.X.SYNC_PROFILE_THEMES,{useTitle:()=>V.intl.string(V.t.C00w4l),useValue:()=>(0,_.bG)([O.Ay],()=>O.Ay.syncProfileThemeWithUserTheme),setValue:()=>(0,ed.M1)()});var nk=n(817281),nw=n(284016),nF=n(363195);let nB=(0,h.zD)(S.X.APPEARANCE_SYNC_THEME,{useTitle:()=>V.intl.string(V.t["/B+kEV"]),useSearchTerms:()=>[V.intl.string(V.t.Ksh3ik)],useValue:function(){return(0,_.bG)([nw.A],()=>!1!==nw.A.shouldSync("appearance"))},useDisabled:function(){return(0,_.bG)([nF.A],()=>nF.A.isSameAsDeviceThemeEnabled())},setValue:function(e){var t;let n=nF.A.theme,i=nR.A.gradientPreset?.id??null,l=U.eh.getSetting()?.customUserThemeSettings!=null;t=I.HAw.SYNC_ACROSS_CLIENTS_TOGGLED,ts.h.dispatch({type:"TRACK",event:t,properties:{is_sync_enabled:e,base_theme:n,client_theme:i,has_custom_theme:l}}),nk.Ay.setShouldSyncAppearanceSettings(e)}});var nz=n(393284);let nX=(0,h.AK)(S.X.APPEARANCE_THEME_ACCESSIBLITY_NAVIGATOR,{useSubtitle:()=>V.intl.string(V.t.nhVQDJ),useSearchTerms:()=>[V.intl.string(V.t.nhVQDJ)],destinationKey:S.X.ACCESSIBILITY_PANEL}),nY=(0,h.gN)(S.X.APPEARANCE_THEME_RELATED_SETTINGS,{buildLayout:()=>[nX]}),nH=(0,h.zZ)(S.X.APPEARANCE_THEME_CATEGORY,{useTitle:()=>V.intl.string(V.t.Ksh3ik),useInlineNotice:function(){return(0,_.bG)([O.Ay],()=>O.Ay.useForcedColors)?{type:T.lT.INLINE_NOTICE,noticeType:"info",role:"none",text:(0,eC.D)()?V.intl.format(V.t.Jae48E,{onClick:()=>{(0,na.openUserSettings)(S.X.SYNC_FORCED_COLORS)}}):V.intl.string(V.t.AUMSZP)}:null},useHeaderDecoration:function(){let e=(0,_.bG)([nR.A,O.Ay],()=>O.Ay.useForcedColors||nR.A.isPreview),t=(0,nD.V)();return e||t?null:{type:T.WX.BUTTON_GROUP,buttons:[{id:"open-client-themes-button",type:T.UV.BUTTON,text:V.intl.string(V.t["E+COuA"]),onClick:nP.J3}]}},buildLayout:()=>[nz.k,nB,nV,nU,nY]}),nW=(0,h.t_)(S.X.APPEARANCE_PANEL,{initialize:function(){tr.A.isFetching()||(ts.h.dispatch({type:"SAVED_CUSTOM_THEMES_FETCH_START"}),tl.Bo.get({url:I.Rsh.USERS_ME_CUSTOM_THEMES,oldFormErrors:!0,rejectWithError:!0}).then(e=>{ts.h.dispatch({type:"SAVED_CUSTOM_THEMES_FETCH_SUCCESS",themes:e.body?.custom_themes??[]})}).catch(e=>{ts.h.dispatch({type:"SAVED_CUSTOM_THEMES_FETCH_FAILURE",error:e})}))},useTitle:()=>V.intl.string(V.t["iHH+ky"]),buildLayout:()=>[nH,t2,nc,tF,nE,nL,tm]}),nK=[{badgeType:T.Xi.NEW,dismissibleContent:eE.M.CLIENT_THEMES_APPEARANCE_SETTINGS_NEW_BADGE}],nZ=(0,h.i4)(S.X.APPEARANCE_SIDEBAR_ITEM,{useTitle:()=>V.intl.string(V.t["iHH+ky"]),icon:tn.PaintPaletteIcon,useMenu:function(){let e,t,n,i=(0,ta.A)(),l=(e=U.D_.useSetting(),t=U.SI.useSetting(),e?null:(0,p.jsx)(ti.sL,{id:"preview-markdown-toggle",label:V.intl.string(V.t.sHJ9wZ),action:()=>{let e=!t;td.default.track(I.HAw.PREVIEW_MARKDOWN_TOGGLED,{enabled:e,location:{section:I.JJy.SETTINGS_CONTEXT_MENU}}),U.SI.updateSetting(e)},checked:t})),s=(n=(0,_.bG)([tu.A],()=>tu.A.enabled,[]),(0,p.jsx)(ti.sL,{id:"streamer-mode-toggle",label:V.intl.string(V.t.p9ZAJZ),action:()=>{to.A.setEnabled(!n)},checked:n}));return f.useMemo(()=>{let e=[...i];return null!=l&&e.push((0,p.jsx)(ti.rX,{label:V.intl.string(V.t.Ob7VMB),children:l},"text-and-images")),null!=s&&e.push((0,p.jsx)(ti.rX,{children:s},"streamer-mode")),e},[i,l,s])},getDismissibleBadges:()=>nK,buildLayout:()=>[nW]});var nq=n(37646),nQ=n(434404);let nJ=(0,h.t_)(S.X.LANGUAGE_AND_TIME_PANEL,{useTitle:()=>V.intl.string(V.t.KyFVyi),buildLayout:()=>[nQ.F]}),n$=(0,h.i4)(S.X.LANGUAGE_AND_TIME_SIDEBAR_ITEM,{icon:nq.U,useTitle:()=>V.intl.string(V.t.KyFVyi),buildLayout:()=>[nJ]});var n0=n(3137),n1=n(661531),n2=n(314116),n3=n(270003),n4=n(834730),n5=n(939249),n6=n(369606),n8=n(320448),n7=n(604121),n9=n(725951),ie=n(400492),it=n(669067),ii=n(115063),il=n(754692),is=n(927018),ir=n(512599),ia=n(532197),io=n(403362),iu=n(874486),id=n(503698),ic=n.n(id),ig=n(536637),im=n.n(ig),iA=n(58703),iE=n(906688),ih=n(98705);function iS(e){let{achievementId:t,dateUnlocked:n}=e,i=(0,is.vM)(t);if(null==i)return null;let l=null!=n,{name:s,description:r,hideDescriptionUntilUnlock:a,onAction:o}=i,u=a&&!l,d=l?"text-strong":"text-muted",c=l?"text-default":"text-muted",g=im()(n),m=null!=o&&l,A=m?n5.D:"div";return(0,p.jsxs)(A,{className:ic()(ih.kL,m&&ih.b),onClick:function(){m&&o()},children:[(0,p.jsx)("div",{className:ih.zc,children:(0,p.jsx)(iE.A,{achievementId:t,size:iE.A.Sizes.SIZE_40,unlocked:l})}),(0,p.jsxs)("div",{className:ih.VW,children:[null!=n&&(0,p.jsx)(n4.E,{variant:"text-xxs/semibold",color:"text-muted",className:ih.YR,children:(0,iA.mk)(g)}),(0,p.jsx)(n4.E,{variant:"text-md/medium",color:d,children:s()}),(0,p.jsx)(n4.E,{variant:"text-xs/normal",color:c,children:u?"?????":r()})]})]})}var ix=n(545744);function iT(e){let{onBackClick:t}=e,n=(0,_.bG)([iu.A],()=>iu.A.getAllUnlockedAchievements()),i=f.useMemo(()=>Object.values(n).sort((e,t)=>t.dateUnlocked-e.dateUnlocked),[n]),l=f.useMemo(()=>Object.values(is.l0).filter(io.Vq).filter(e=>null==n[e.id]).sort((e,t)=>e.rarity-t.rarity),[n]);return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(n5.D,{onClick:t,className:ix.vv,children:[(0,p.jsx)(ia.A,{direction:ia.A.Directions.LEFT,className:ix.Kk}),(0,p.jsx)(n4.E,{variant:"text-lg/normal",color:"text-default",children:V.intl.string(V.t["13/7kX"])})]}),(0,p.jsxs)("div",{className:ix.N1,children:[(0,p.jsxs)("div",{className:ix.if,children:[(0,p.jsx)(C.D,{variant:"heading-lg/extrabold",color:"text-strong",children:V.intl.string(V.t["6jI0hd"])}),(0,p.jsx)(n4.E,{variant:"text-md/normal",color:"text-default",children:V.intl.string(V.t.GuUItX)})]}),(0,p.jsx)("div",{className:ix.nr,children:(0,p.jsx)(n6.TrophyIcon,{size:"custom",color:n1.A.unsafe_rawColors.ORANGE_345.css,width:40,height:40})})]}),i.length>0&&(0,p.jsx)("div",{className:ix.yF,children:(0,p.jsx)("div",{className:ix.Eh,children:i.map(e=>{let{achievementId:t,dateUnlocked:n}=e;return(0,p.jsx)(iS,{achievementId:t,dateUnlocked:n},t)})})}),l.length>0&&(0,p.jsxs)("div",{className:ix.yF,children:[(0,p.jsx)("div",{className:ix.if,children:(0,p.jsx)(n4.E,{variant:"text-md/bold",color:"text-default",children:V.intl.string(V.t.GFyMg1)})}),(0,p.jsx)("div",{className:ix.Eh,children:l.map(e=>(0,p.jsx)(iS,{achievementId:e.id},e.id))})]}),(0,p.jsx)("div",{className:ix.yF,children:(0,p.jsx)("div",{className:ix.F3})})]})}var ip=n(224964),i_=n(31408),iI=n(368588);let iN={enabled:!0,combosEnabled:!0,screenshakeEnabled:!1,confettiEnabled:!1},iC=(0,W.range)(0,11),ib=(0,W.range)(0,2.25,.25),iy=(0,W.range)(1,11),iv=(0,W.range)(1,26),ij={0:"poggermode_settings_panel",1:"poggermode_achievements_panel"};function iO(e){let{disabled:t,locations:n,settingsLocations:i,onChange:l}=e,s=n.map(e=>(0,p.jsx)(t5.d,{label:e.title,description:e.description,checked:i[e.location],disabled:t,onChange:t=>l({...i,[e.location]:t})},e.location));return(0,p.jsx)(n3.n,{label:V.intl.string(V.t.bWVN1D),children:s})}function iL(e){let{children:t}=e;return(0,p.jsx)(n4.E,{className:iI.iF,variant:"text-sm/normal",color:"text-default",children:t})}function iR(e){let{settings:{enabled:t,warningSeen:n},updateSettings:i}=e,l=(0,_.bG)([O.Ay],()=>O.Ay.useReducedMotion);return(0,p.jsx)(t5.d,{label:V.intl.string(V.t.vuiXm9),description:V.intl.string(V.t.KuYbWN),checked:t,onChange:function(e){e||(0,il._)(is.sn.DISABLE_POGGERMODE),e&&(!n||l)?(0,n2.A)({title:l?V.intl.string(V.t["FxT+p0"]):V.intl.string(V.t.TAZ4F9),subtitle:l?V.intl.string(V.t.gmixrx):V.intl.string(V.t.jN3t3K),confirmText:V.intl.string(V.t.JFfins),onConfirm:()=>i(l?iN:{enabled:!0,warningSeen:!0})}):i({enabled:e})}})}function iD(e){let{settings:{enabled:t,confettiEnabled:n,confettiCount:i,confettiSize:l,confettiEnabledLocations:s},updateSettings:r}=e,a=!t||!n;return(0,p.jsxs)(n3.n,{label:V.intl.string(V.t.mqxwJO),children:[(0,p.jsx)(t5.d,{label:V.intl.string(V.t.s0KCgF),description:V.intl.string(V.t.O1Vflg),checked:n,disabled:!t,onChange:e=>r({confettiEnabled:e},0)}),(0,p.jsxs)("div",{children:[(0,p.jsx)(n4.E,{variant:"text-md/semibold",color:a?"text-muted":"text-strong",className:iI.KF,children:V.intl.string(V.t.vd0D81)}),(0,p.jsx)(iL,{children:V.intl.string(V.t.a18Sug)}),(0,p.jsx)(Q.A,{"aria-label":V.intl.string(V.t.vd0D81),disabled:a,marks:iy,snapToMarks:!0,minValue:iy[0],maxValue:iy[iy.length-1],defaultValue:i,onChangeEnd:e=>r({confettiCount:e},0),formatValue:e=>`${e}`})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)(n4.E,{variant:"text-md/semibold",color:a?"text-muted":"text-strong",className:iI.KF,children:V.intl.string(V.t.sPO3ij)}),(0,p.jsx)(iL,{children:V.intl.string(V.t.xoldVn)}),(0,p.jsx)(Q.A,{"aria-label":V.intl.string(V.t.sPO3ij),disabled:a,marks:iv,snapToMarks:!0,minValue:iv[0],maxValue:iv[iv.length-1],defaultValue:l,onChangeEnd:e=>r({confettiSize:e},0),formatValue:e=>`${e}`})]}),(0,p.jsx)(iO,{disabled:a,locations:[{location:i_.k.CHAT_INPUT,title:V.intl.string(V.t.elTtyz),description:V.intl.string(V.t.HtKfMi)},{location:i_.k.REACTION,title:V.intl.string(V.t.Ik4VIa),description:V.intl.string(V.t.y4rqK0)},{location:i_.k.MEMBER_USER,title:V.intl.string(V.t.ZXBlAn),description:V.intl.string(V.t["m9RD+c"])},{location:i_.k.CALL_TILE,title:V.intl.string(V.t.V66giQ),description:V.intl.string(V.t.fiHV7u)}],settingsLocations:s,onChange:e=>r({confettiEnabledLocations:e},0)})]})}function iP(e){let{settings:{enabled:t,combosEnabled:n,comboSoundsEnabled:i,combosRequiredCount:l},updateSettings:s}=e,r=!t||!n;return(0,p.jsxs)(n3.n,{label:V.intl.string(V.t.Xz0ole),children:[(0,p.jsx)(t5.d,{label:V.intl.string(V.t.o3iV7B),description:V.intl.string(V.t["31Z8Ee"]),checked:n,disabled:!t,onChange:e=>s({combosEnabled:e})}),(0,p.jsx)(t5.d,{label:V.intl.string(V.t["Ax+IoW"]),description:V.intl.string(V.t["9rgQEr"]),checked:i,disabled:!t,onChange:e=>s({comboSoundsEnabled:e})}),(0,p.jsxs)("div",{children:[(0,p.jsx)(n4.E,{variant:"text-md/semibold",color:r?"text-muted":"text-strong",className:iI.KF,children:V.intl.string(V.t.L0oQuh)}),(0,p.jsx)(iL,{children:V.intl.string(V.t["/OOFpL"])}),(0,p.jsx)(Q.A,{"aria-label":V.intl.string(V.t.L0oQuh),disabled:r,marks:iC,snapToMarks:!0,minValue:iC[0],maxValue:iC[iC.length-1],defaultValue:l,onChangeEnd:e=>s({combosRequiredCount:e}),formatValue:e=>`${e}`})]})]})}function iG(e){let{settings:{enabled:t,screenshakeEnabled:n,shakeIntensity:i,screenshakeEnabledLocations:l},updateSettings:s}=e,r=(0,_.bG)([O.Ay],()=>O.Ay.useReducedMotion),a=!t||!n||r;return(0,p.jsxs)(n3.n,{label:V.intl.string(V.t.wVS5Sd),children:[(0,p.jsx)(t5.d,{label:V.intl.string(V.t.N004zO),description:r?V.intl.string(V.t.GckHGw):V.intl.string(V.t.Qq5W3v),checked:n&&!r,disabled:!t||r,onChange:e=>s({screenshakeEnabled:e},1)}),(0,p.jsxs)("div",{children:[(0,p.jsx)(n4.E,{variant:"text-md/semibold",color:a?"text-muted":"text-strong",className:iI.KF,children:V.intl.string(V.t.UxnnC4)}),(0,p.jsx)(iL,{children:V.intl.string(V.t.CEOEOb)}),(0,p.jsx)(Q.A,{"aria-label":V.intl.string(V.t.UxnnC4),disabled:a,marks:ib,snapToMarks:!0,minValue:ib[0],maxValue:ib[ib.length-1],defaultValue:i,onChangeEnd:e=>{var t;null!=(t={shakeIntensity:e}).shakeIntensity&&t.shakeIntensity>i&&(0,il._)(is.sn.MORE),s(t,1)},formatValue:e=>e===ib[ib.length-1]?V.intl.string(V.t["4rbMWc"]):`${100*e}%`})]}),(0,p.jsx)(iO,{disabled:a,locations:[{location:i_.uD.CHAT_INPUT,title:V.intl.string(V.t.vUcvPP),description:V.intl.string(V.t.y00OrF)},{location:i_.uD.VOICE_USER,title:V.intl.string(V.t.TcRO54),description:V.intl.string(V.t.YJCxVY)},{location:i_.uD.MENTION,title:V.intl.string(V.t.oW4shO),description:V.intl.string(V.t["mqfw/H"])}],settingsLocations:l,onChange:e=>s({screenshakeEnabledLocations:e},1)})]})}function iM(e){let{updateSettings:t}=e;return(0,p.jsx)(n3.n,{label:V.intl.string(V.t.EuXv2q),children:(0,p.jsxs)(q.B,{gap:16,children:[(0,p.jsx)("div",{children:V.intl.string(V.t["1SLnki"])}),(0,p.jsx)("div",{"data-button-hoisted-classname-wrapper":!0,className:iI.hw,children:(0,p.jsx)(j.$,{variant:"primary",size:"sm",text:V.intl.string(V.t.qz65yY),onClick:function(){t({enabled:!1,settingsVisible:!1}),(0,tY.default)()}})})]})})}function iU(e){let{onChangePage:t}=e;return(0,p.jsxs)(n5.D,{onClick:function(){return t(1)},className:iI.Tq,children:[(0,p.jsx)("div",{className:iI.w1,children:(0,p.jsx)(n6.TrophyIcon,{size:"md",color:n1.A.unsafe_rawColors.ORANGE_345.css})}),(0,p.jsxs)("div",{className:iI.qL,children:[(0,p.jsx)(C.D,{variant:"heading-md/semibold",color:"text-strong",children:V.intl.string(V.t["6jI0hd"])}),(0,p.jsx)(n4.E,{variant:"text-md/normal",color:"text-default",children:V.intl.string(V.t.GuUItX)})]}),(0,p.jsx)(n8._,{size:"custom",color:"currentColor",width:16,className:iI.nT})]})}function iV(){return n.e("504660").then(n.t.bind(n,662336,19)).then(e=>{let{default:t}=e;return t})}function ik(e){let{onChangePage:t,setShowEnableAnimation:n}=e,i=(0,_.cf)([n0.A],()=>n0.A.getState()),[l,s]=f.useState({x:0,y:0}),r=(0,ip.A)();function a(e,t){var s,a,o,u,d,c,g,m;if(e.enabled&&!1===i.enabled&&(n(!0),(0,ie.Ak)("poggermode_enabled"),(0,ii.fO)({duration:2e3,intensity:e.shakeIntensity??i.shakeIntensity})),(0,ir.O9)(e),null==t)return;let A=(s=i.confettiEnabled,a=e.confettiEnabled,o=i.enabled,u=e.enabled,(a??s)&&(u??o));0===t&&A&&r.fire(l.x,l.y,{settings:e});let E=(d=i.screenshakeEnabled,c=e.screenshakeEnabled,g=i.enabled,m=e.enabled,(c??d)&&(m??g));1===t&&E&&(0,ii.fO)({duration:1e3,intensity:e.shakeIntensity??i.shakeIntensity})}function o(e){s({x:e.clientX,y:e.clientY})}return f.useEffect(()=>(window.addEventListener("mousemove",o),()=>window.removeEventListener("mousemove",o)),[]),(0,p.jsxs)(q.B,{gap:24,children:[(0,p.jsx)(iR,{settings:i,updateSettings:a}),(0,p.jsx)(iU,{onChangePage:t}),(0,p.jsx)(iP,{settings:i,updateSettings:a}),(0,p.jsx)(iG,{settings:i,updateSettings:a}),(0,p.jsx)(iD,{settings:i,updateSettings:a}),(0,p.jsx)(iM,{updateSettings:a})]})}function iw(e){return 0===e?n9.f.LEFT:n9.f.RIGHT}let iF=(0,h.E2)(S.X.POGGERMODE_SETTING,{Component:function(){let[e,t]=f.useState(0),[n,i]=f.useState(iw(e)),[l,s]=f.useState(!1),r=(0,_.bG)([O.Ay],()=>O.Ay.useReducedMotion),a=l&&!r;return f.useEffect(()=>{let t=setTimeout(()=>{i(iw(e))},500);return()=>clearTimeout(t)},[e]),f.useEffect(()=>{(0,it._)(ij[e])},[e]),f.useEffect(()=>{Math.random()>.99&&(0,il._)(is.sn.VISITOR_100)},[]),(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(n9.A,{className:iI.l3,step:e,direction:n,children:function(e,t,n){function i(e){return()=>{t(e)}}switch(e){case 0:return(0,p.jsx)(ik,{onChangePage:i(1),setShowEnableAnimation:n});case 1:return(0,p.jsx)(iT,{onBackClick:i(0)});default:return null}}(e,t,s)}),(0,p.jsx)("div",{className:a?iI.Sr:iI.IP,children:(0,p.jsx)(n7.a,{className:iI.gT,importData:iV,shouldAnimate:a,autoplay:!1,resetOnPlay:!0,loop:!1,onComplete:()=>s(!1)})})]})},useSearchTerms:()=>[V.intl.string(V.t.AtCukI),V.intl.string(V.t.mqxwJO),V.intl.string(V.t.wVS5Sd),V.intl.string(V.t.Xz0ole),V.intl.string(V.t["Ax+IoW"]),V.intl.string(V.t["6jI0hd"]),V.intl.string(V.t.s0KCgF)]}),iB=(0,h.zZ)(S.X.POGGERMODE_CATEGORY,{buildLayout:()=>[iF]});var iz=n(212043);let iX=(0,h.t_)(S.X.POGGERMODE_PANEL,{useTitle:()=>V.intl.string(V.t.AtCukI),buildLayout:()=>[iB]}),iY=(0,h.i4)(S.X.POGGERMODE_SIDEBAR_ITEM,{useTitle:()=>V.intl.string(V.t.AtCukI),icon:()=>(0,p.jsx)("img",{alt:"",src:n(724405),className:iz.$}),usePredicate:()=>(0,_.bG)([n0.A],()=>n0.A.settingsVisible),buildLayout:()=>[iX]});var iH=n(307301),iW=n(410767),iK=n(683071),iZ=n(97260),iq=n(710195),iQ=n(57757),iJ=n(188321),i$=n(695366),i0=n(812729),i1=n.n(i0),i2=n(587895),i3=n(429913),i4=n(616356),i5=n(952818);function i6(e,t){return null!=e&&null!=e.id?e.id:null!=t&&null!=t.id?t.id:void 0}function i8(){let e=(0,_.bG)([i4.A],()=>i4.A.getStreamerActiveStreamMetadata()),t=(0,_.bG)([i5.Ay],()=>{let e=i5.Ay.getVisibleGame();return null!=e?i5.Ay.getGameOrTransformedSubgameForPID(e.pid):null},[],i1()),[n]=(0,i3.A)([i6(e,t)]);return{runningGame:t??void 0,runningGameApplication:n??void 0}}var i7=n(769015),i9=n(999926),le=n(935671),lt=n(435075);function ln(e){let{game:t,application:n}=e;return null==t||null==n?(0,p.jsx)("div",{className:lt.zc,children:(0,p.jsx)(i$.E,{size:"sm",color:n1.A.colors.TEXT_FEEDBACK_WARNING})}):(0,p.jsxs)("div",{className:lt.nt,children:[(0,p.jsx)(i7.A,{game:n,pid:t.pid,size:i7.M.MEDIUM}),(0,p.jsx)("div",{className:lt.Am,children:(0,p.jsx)(i$.E,{size:"sm",color:n1.A.colors.TEXT_FEEDBACK_WARNING})})]})}function li(e){let t=(0,_.bG)([i9.Ay],()=>i9.Ay.getMode()),{runningGame:n,runningGameApplication:i}=i8();null==n||n.elevated||(n=void 0,i=void 0);let l=(0,le.NP)(),s=l&&null!=n&&t===I.TBI.PUSH_TO_TALK;return{canPrompt:"voice"===e?s:l,runningGame:n,runningGameApplication:i}}function ll(e){let{className:t,sourcePage:n}=e,{canPrompt:i,runningGame:l,runningGameApplication:s}=li(n);return i?(0,p.jsxs)("div",{className:ic()(lt.kL,t),children:[(0,p.jsx)(ln,{game:l,application:s}),(0,p.jsxs)("div",{className:lt.FS,children:[(0,p.jsx)(n4.E,{variant:"text-sm/medium",color:"text-strong",children:"voice"===n?V.intl.string(V.t.vxfv7v):null!=l?V.intl.string(V.t.fAYU2G):V.intl.string(V.t["9V4X/c"])}),(0,p.jsx)(n4.E,{variant:"text-xs/medium",color:"text-muted",children:V.intl.format(V.t["/y6htt"],{helpCenterLink:eb.A.getArticleURL(I.MVz.SYSTEM_SERVICE)})})]}),(0,p.jsx)(j.$,{variant:"secondary",size:"sm",text:V.intl.string(V.t["1iI46O"]),onClick:function(){(0,le.sL)(n+(null!=l?"-with-game":"-no-game"))}})]}):null}var ls=n(404778),lr=n(579370),la=n(532624),lo=n(691885),lu=n(452027),ld=n(408278),lc=n(241326),lg=n(866665),lm=n(140735),lA=n(489718),lE=n(827343),lh=n(635242),lS=n(350535),lx=n(189213),lT=n(192308),lp=n(95477),lf=n(320989),l_=n(978263);let lI=[];var lN=n(235986),lC=n(484734),lb=n(734057),ly=n(808728),lv=n(71393),lj=n(967198),lO=n(926140),lL=n(847893);function lR(){}let lD=[lO.rD.VOICE_CHANNEL];function lP(e){e.setOptions({voiceChannelGuildFilter:null}),e.setLimit(1/0)}function lG(){return(0,p.jsx)("div",{className:lL.i1,children:(0,p.jsx)(n4.E,{variant:"text-md/medium",color:"text-muted",className:lL.GN,children:V.intl.string(V.t.zHjCd1)})})}function lM(e){let{keybind:t,className:n}=e,i=f.useRef(t);f.useEffect(()=>{i.current=t});let[l,s]=f.useState(t.params?.channelId??void 0),r=f.useCallback(()=>{(0,lT.openModalLazy)(async()=>e=>(0,p.jsx)(lU,{...e,onSelect:e=>{s(e),iZ.A.setKeybind({...i.current,params:{channelId:e}})}}))},[]);return(0,p.jsx)("div",{className:ic()(lL.a8,n),children:(0,p.jsx)(lu.D,{label:V.intl.string(V.t.q4JpM8),children:(0,p.jsxs)(lN.A,{align:lN.A.Align.STRETCH,children:[(0,p.jsx)("div",{className:lL.$X,children:(0,p.jsx)(lV,{channelId:l})}),(0,p.jsx)(lN.A.Child,{grow:0,shrink:0,children:(0,p.jsx)(j.$,{variant:"primary",text:V.intl.string(V.t.Dm8O4e),onClick:r})})]})})})}function lU(e){let t,n,{transitionState:i,onClose:l,onSelect:s}=e,r=f.useId(),a=f.useRef(null),{query:o,updateQuery:u,queryResults:d}=function(e){let{visible:t,autocompleterResultTypes:n,autocompleterOptions:i,autocompleterBeforeCreateSearchContext:l}=e,[s,r]=f.useState(""),[a,o]=f.useState(lI),u=f.useCallback((e,t)=>{""===(t=t.trim()).trim()?o(lI):o(e)},[]);f.useEffect(()=>lf.A.addRouteChangeListener(()=>{r("")}),[]);let[d]=f.useState(()=>new l_.A(u,n,void 0,i));return f.useEffect(()=>{t?(l?.(d),d.createSearchContext()):(d.clean(),r(""))},[t,d,l]),{queryResults:a,query:s,updateQuery:f.useCallback(e=>{r(e),d.search(e)},[d])}}({visible:!0,autocompleterResultTypes:lD,autocompleterBeforeCreateSearchContext:lP}),c=(t=""!==o,n=(0,_.yK)([ly.Ay,lb.A,lj.A],()=>{let e=lj.A.getGuildId();if(t||null==e)return[];let n=[];for(let t of ly.Ay.getVocalChannelIds(e)){let e=lb.A.getChannel(t);null!=e&&n.push(e)}return n},[t]),t?null:n),{focusedIndex:g,setFocusedIndex:m}=function(e){let[t,n]=f.useState(0),i=f.useRef(e);return e!==i.current&&0!==t&&n(0),f.useEffect(()=>{i.current=e}),{focusedIndex:t,setFocusedIndex:n}}(o);f.useEffect(()=>{let{current:e}=a;null==e||e.isItemVisible(0,g,!0)||e.scrollToIndex({section:0,row:g})},[g]);let A=null!=c?c.length:d.length,E=(()=>{if(null!=c)return c[g]?.id;let e=d[g];if(e?.type===lO.rD.VOICE_CHANNEL)return e.record.id})(),h=A>0||""===o?{innerId:r,innerRole:"listbox",innerAriaLabel:V.intl.string(V.t["+N3fW7"]),ref:a,sections:[A],renderRow:function(e){let{row:t}=e,n=(()=>{if(null!=c)return c[t];let e=d[t];if(e?.type===lO.rD.VOICE_CHANNEL)return e.record})();if(null==n)return null;let i=null!=n.parent_id?lb.A.getChannel(n.parent_id):void 0,r=lv.A.getGuild(n.guild_id);return(0,p.jsx)(lC.c3,{id:n.id,channel:n,category:i,focused:g===t,onMouseEnter:()=>m(t),onClick:()=>{s(n.id),l()},onFocus:()=>m(t),children:null!=r?(0,p.jsx)("div",{className:lL.J5,children:r.name}):null},n.id)},sectionHeight:0,rowHeight:34}:{sections:[1],renderRow:()=>(0,p.jsx)(lG,{}),sectionHeight:0,rowHeight:52};return(0,p.jsx)(lx.a,{transitionState:i,onClose:l,title:V.intl.string(V.t.Dm8O4e),subtitle:V.intl.string(V.t.q4JpM8),actions:void 0,input:(0,p.jsx)(lp.k,{value:o,onChange:u,onKeyDown:function(e){let t=e.key.toLowerCase();if("arrowdown"===t||"arrowup"===t||"enter"===t||"escape"===t)switch(e.preventDefault(),t){case"escape":l();break;case"enter":{let e=(()=>{if(null!=c)return c[g];let e=d[g];if(e?.type===lO.rD.VOICE_CHANNEL)return e.record})();null==e?s(void 0):s(e.id),l();break}case"arrowup":0===g?m(A-1):m(g-1);break;case"arrowdown":g>=A-1?m(0):m(g+1)}},placeholder:V.intl.string(V.t.tG0r7g),role:"combobox","aria-controls":r,"aria-expanded":A>0,"aria-activedescendant":A>0&&null!=E?E:void 0,"aria-autocomplete":"list",spellCheck:!1,autoFocus:!0}),listProps:h})}function lV(e){let{channelId:t}=e,{channel:n,category:i,guild:l}=(0,_.cf)([lb.A,lv.A],()=>{let e=null!=t?lb.A.getChannel(t):void 0;return null!=e?{channel:e,category:null!=e.parent_id?lb.A.getChannel(e.parent_id):void 0,guild:null!=e.guild_id?lv.A.getGuild(e.guild_id):void 0}:{channel:void 0,category:void 0,guild:void 0}});return null==n?(0,p.jsx)(n4.E,{variant:"text-md/medium",color:"text-muted",className:lL.GN,children:V.intl.string(V.t["/fYIK7"])}):(0,p.jsx)(lC.c3,{channel:n,id:n.id,category:i,onClick:lR,onFocus:lR,onMouseEnter:lR,focused:!1,children:null!=l?(0,p.jsx)("div",{className:lL.J5,children:l.name}):null})}var lk=n(650583),lw=n(731854),lF=n(94451);function lB(e){let{keybind:t}=e,n=(0,_.bG)([la.Ay],()=>la.Ay.isWaylandPortalActive()),i=(0,_.bG)([la.Ay],()=>la.Ay.getWaylandPortalShortcutState(t.id));return n&&0!==t.shortcut.length&&t.enabled?la.Ay.isWaylandPortalEligibleShortcut(t.shortcut)?null==i?null:i.bound?(0,lr.Rg)(i)?(0,p.jsx)("div",{className:lF.$e,children:(0,p.jsx)(iK.w,{type:"info",message:V.intl.format(V.t.wu2lqV,{trigger:i.triggerDescription}),role:"status"})}):null:(0,p.jsx)("div",{className:lF.$e,children:(0,p.jsx)(iK.w,{type:"warning",message:V.intl.string(V.t.PTCrUP),role:"status"})}):(0,p.jsx)("div",{className:lF.$e,children:(0,p.jsx)(iK.w,{type:"warning",message:V.intl.string(V.t.J0m3aK),role:"status"})}):null}function lz(e){let{keybind:t}=e,n=lS.dI(t.shortcut);return e6.A.hasBind(n)?(0,p.jsx)("div",{className:lF.$e,children:(0,p.jsx)(iK.w,{type:"warning",message:V.intl.string(V.t["7lQlw3"]),role:"status"})}):lk.Yy.has(n)?(0,p.jsx)("div",{className:lF.$e,children:(0,p.jsx)(iK.w,{type:"warning",message:V.intl.format(V.t.MOIaNd,{keyboardNavArticle:eb.A.getArticleURL(I.MVz.KEYBOARD_NAVIGATION)}),role:"status"})}):void 0}function lX(e){let{keybind:t}=e;return t.action===I.hCu.SWITCH_TO_VOICE_CHANNEL?(0,p.jsx)(lM,{keybind:t,className:lF._M}):null}let lY=f.memo(function(e){let{keybind:t,keybindDescriptions:n,keybindActionTypes:i}=e,l=f.useCallback(e=>iZ.A.setKeybind({...t,action:e}),[t]),s=f.useCallback(e=>{if((0,lr.uL)(t.id,t.shortcut,e,la.Ay.getWaylandPortalShortcutState(t.id)),t.managed&&t.action===I.hCu.PUSH_TO_TALK){let n=t.context??lw.x.DEFAULT;lE.default.setMode(i9.Ay.getMode(n),{shortcut:e},n);return}iZ.A.setKeybind({...t,shortcut:e})},[t]),r=f.useCallback(()=>iZ.A.setKeybind({...t,enabled:!t.enabled}),[t]),a=f.useCallback(()=>iZ.A.deleteKeybind(t.id),[t.id]),o=f.useId(),u=f.useMemo(()=>i.find(e=>e.value===t.action)?.label??t.action,[t.action,i]);return(0,p.jsxs)("div",{className:lF.f_,children:[(0,p.jsx)(lz,{keybind:t}),(0,p.jsx)(lB,{keybind:t}),(0,p.jsx)("div",{className:lF.XI,children:(0,p.jsx)(lo.l,{selectionMode:"single",label:V.intl.string(V.t.XH5b12),value:t.action,options:i,onSelectionChange:l,disabled:t.managed})}),(0,p.jsx)("div",{className:lF.LE,children:(0,p.jsx)(lu.D,{label:V.intl.string(V.t["1La4tC"]),layout:"vertical",children:(0,p.jsx)(lh.A,{defaultValue:t.shortcut,onChange:s})})}),(0,p.jsxs)("div",{className:lF.ne,children:[!t.managed&&(0,p.jsx)(ld.K,{variant:"icon-only",onClick:a,icon:lc.TrashIcon,"aria-label":V.intl.string(V.t.qEHmmB)}),(0,p.jsx)(lg.m,{text:V.intl.string(t.enabled?V.t.pNYGbx:V.t["51DGkH"]),ariaHidden:!0,children:(0,p.jsxs)("div",{children:[(0,p.jsx)(lm.A,{id:o,children:V.intl.format(t.enabled?V.t["myr/Y0"]:V.t.lYhtPO,{actionName:u})}),(0,p.jsx)(lA.I,{checked:t.enabled,onChange:r,labelledBy:o})]})})]}),(0,p.jsx)(n4.E,{variant:"text-xs/normal",color:"text-subtle",className:lF.h_,children:n[t.action]}),(0,p.jsx)(lX,{keybind:t})]})});var lH=n(938812),lW=n(734066),lK=n(880144),lZ=n(994778),lq=n(950869),lQ=n(603933);function lJ(){let e=(0,_.bG)([la.Ay],()=>la.Ay.isWaylandPortalActive()),t=f.useMemo(()=>e&&(0,lr.u)(),[e]);return e?(0,p.jsx)(iK.w,{type:"info",message:V.intl.string(V.t.AcH7R7),role:"none",action:t?{text:V.intl.string(V.t.ZPHaPE),onClick:lr.qM}:void 0}):null}let l$=function(){let e,t,n,i,l,s,r,{customizableKeybinds:a,keybindDescriptions:o,keybindActionTypes:u}=(e=(0,_.bG)([la.Ay],()=>la.Ay.getState()),t=(0,_.bG)([i9.Ay],()=>(0,lK.A)(i9.Ay)),n=(0,_.bG)([i9.Ay],()=>i9.Ay.supports(lw.O5.VIDEO)),i=(0,_.bG)([lq.A],()=>lq.A.isSupported),l=(0,lW.sw)(),s=(0,lW.BW)(),{customizableKeybinds:function(e){let{keybinds:t,enableClips:n,enableScreenshotKeybind:i,allowSoundboard:l}=e;return K()(t).reject(e=>e.managed&&![I.hCu.OVERLAY_ACTIVATE_REGION_TEXT_WIDGET,I.hCu.SAVE_CLIP,I.hCu.SAVE_SCREENSHOT].includes(e.action)).reject(e=>!n&&(e.action===I.hCu.SAVE_CLIP||e.action===I.hCu.SAVE_SCREENSHOT)).reject(e=>!i&&e.action===I.hCu.SAVE_SCREENSHOT).reject(e=>!l&&(e.action===I.hCu.SOUNDBOARD||e.action===I.hCu.SOUNDBOARD_HOLD)).sortBy(e=>e.id).sortBy(e=>!0===e.managed?-1:0).value()}({keybinds:e,enableClips:l,enableScreenshotKeybind:s,allowSoundboard:r=(0,e8.isWindows)()}),keybindActionTypes:function(e){let{overlaySupported:t,canGoLive:n,videoSupported:i,allowSoundboard:l,enableClips:s,enableScreenshotKeybind:r}=e,a=[{id:"unassigned",value:I.hCu.UNASSIGNED},{id:"push-to-talk",value:I.hCu.PUSH_TO_TALK},{id:"push-to-talk-priority",value:I.hCu.PUSH_TO_TALK_PRIORITY},{id:"push-to-mute",value:I.hCu.PUSH_TO_MUTE},{id:"vad-priority",value:I.hCu.VAD_PRIORITY},{id:"toggle-mute",value:I.hCu.TOGGLE_MUTE},{id:"toggle-deafen",value:I.hCu.TOGGLE_DEAFEN},{id:"toggle-voice-mode",value:I.hCu.TOGGLE_VOICE_MODE},{id:"toggle-streamer-mode",value:I.hCu.TOGGLE_STREAMER_MODE},{id:"toggle-voice-channel-chat",value:I.hCu.TOGGLE_VOICE_CHANNEL_CHAT}];return i&&a.push({id:"toggle-camera",value:I.hCu.TOGGLE_CAMERA}),t&&(a.push({id:"toggle-overlay-input-lock",value:I.hCu.TOGGLE_OVERLAY_INPUT_LOCK}),a.push({id:"activate-overlay-region-text-widget",value:I.hCu.OVERLAY_ACTIVATE_REGION_TEXT_WIDGET})),n&&((0,e8.isWindows)()||i9.Ay.getUseSystemScreensharePicker())&&a.push({id:"toggle-go-live-streaming",value:I.hCu.TOGGLE_GO_LIVE_STREAMING}),(0,e8.isDesktop)()&&(a.push({id:"navigate-back",value:I.hCu.NAVIGATE_BACK},{id:"navigate-forward",value:I.hCu.NAVIGATE_FORWARD},{id:"switch-to-voice-channel",value:I.hCu.SWITCH_TO_VOICE_CHANNEL},{id:"disconnect-from-voice-channel",value:I.hCu.DISCONNECT_FROM_VOICE_CHANNEL}),l&&a.push({id:"soundboard",value:I.hCu.SOUNDBOARD},{id:"soundboard-hold",value:I.hCu.SOUNDBOARD_HOLD}),s&&(a.push({id:"save-clip",value:I.hCu.SAVE_CLIP}),r&&a.push({id:"save-screenshot",value:I.hCu.SAVE_SCREENSHOT}))),a.map(e=>{let{id:t,value:n}=e;return{id:t,value:n,label:(0,lZ.B)(n)??n}})}({overlaySupported:i,canGoLive:t,videoSupported:n,allowSoundboard:r,enableClips:l,enableScreenshotKeybind:s}),keybindDescriptions:function(e){let{overlaySupported:t,canGoLive:n,videoSupported:i,enableClips:l,enableScreenshotKeybind:s}=e,r={[I.hCu.UNASSIGNED]:V.intl.string(V.t.rvlNLv),[I.hCu.PUSH_TO_MUTE]:V.intl.string(V.t.xtESim),[I.hCu.PUSH_TO_TALK]:V.intl.string(V.t.wTcBSy),[I.hCu.PUSH_TO_TALK_PRIORITY]:V.intl.string(V.t.FhHvWH),[I.hCu.TOGGLE_MUTE]:V.intl.string(V.t.X2fbUm),[I.hCu.TOGGLE_DEAFEN]:V.intl.string(V.t.MjREZV),[I.hCu.TOGGLE_VOICE_MODE]:V.intl.string(V.t.snm5YW),[I.hCu.TOGGLE_STREAMER_MODE]:V.intl.string(V.t.YszLLx),[I.hCu.VAD_PRIORITY]:V.intl.string(V.t.rSe8IZ),[I.hCu.TOGGLE_VOICE_CHANNEL_CHAT]:V.intl.string(V.t.desfB4)};return i&&(r[I.hCu.TOGGLE_CAMERA]=V.intl.string(V.t.v1JBtL)),t&&(r[I.hCu.TOGGLE_OVERLAY_INPUT_LOCK]=V.intl.string(V.t.IoP5vc)),n&&(0,e8.isWindows)()&&(r[I.hCu.TOGGLE_GO_LIVE_STREAMING]=V.intl.string(V.t.s4C238)),(0,e8.isDesktop)()&&(r[I.hCu.NAVIGATE_BACK]=V.intl.string(V.t.nKDlEt),r[I.hCu.NAVIGATE_FORWARD]=V.intl.string(V.t.DK0FFk),r[I.hCu.SOUNDBOARD]=(0,e8.isWindows)()?V.intl.string(V.t["5wJefL"]):V.intl.string(V.t.gzjsSP),r[I.hCu.SOUNDBOARD_HOLD]=(0,e8.isWindows)()?V.intl.string(V.t.RRkZc9):V.intl.string(V.t.laNlTl),l&&(r[I.hCu.SAVE_CLIP]=V.intl.string(V.t.z3Wbam),s&&(r[I.hCu.SAVE_SCREENSHOT]=V.intl.string(V.t.m0zd57)))),r}({overlaySupported:i,canGoLive:t,videoSupported:n,enableClips:l,enableScreenshotKeybind:s})});return 0===a.length?(0,p.jsxs)(q.B,{gap:16,children:[(0,p.jsx)(lJ,{}),(0,p.jsx)(n4.E,{variant:"text-sm/normal",color:"text-subtle",children:V.intl.string(V.t.vyYgWp)})]}):(0,p.jsxs)(q.B,{gap:16,children:[(0,p.jsx)(lJ,{}),(0,p.jsx)("div",{className:lQ.A,children:a.map((e,t)=>(0,p.jsxs)(f.Fragment,{children:[(0,p.jsx)(lY,{keybind:e,keybindDescriptions:o,keybindActionTypes:u}),t<a.length-1?(0,p.jsx)(ls.c,{className:lQ.y,gap:24}):null]},e.id))})]})},l0=(0,h.E2)(S.X.CUSTOM_KEYBINDS_SETTING,{useSearchTerms:()=>[V.intl.string(V.t["069nVT"])],Component:function(){return nh.Av?(0,p.jsx)(l$,{}):(0,p.jsx)(iK.w,{type:"info",message:V.intl.format(V.t.mPi3F3,{downloadLink:I.X7G.DOWNLOAD}),role:"none"})}});var l1=n(475358),l2=n(28647),l3=n(793650);function l4(e){let{children:t}=e;return t([lH.Q_.MESSAGE,lH.Q_.NAVIGATION,lH.Q_.DND,lH.Q_.CHAT,lH.Q_.VOICE_AND_VIDEO,lH.Q_.MISCELLANEOUS])}function l5(e){let{showHeader:t=!0}=e,n=K()((0,lH.Bx)()).filter(e=>e.description!==V.intl.string(V.t.HnNtEI)).filter(e=>e.predicate?.()!==!1).groupBy(e=>e.group).value();return(0,p.jsxs)(q.B,{gap:48,children:[(0,p.jsx)(n3.n,{label:t?V.intl.string(V.t.Lz5KHI):void 0,children:(0,p.jsx)("div",{className:l3.jh,children:(0,p.jsxs)("div",{className:l3.yZ,children:[(0,p.jsx)(n4.E,{variant:"text-md/normal",children:V.intl.string(V.t.sMWLBj)}),(0,p.jsx)("div",{className:l3.DM,children:(0,p.jsx)(l1.e,{shortcut:l2.z.binds["0"],className:l3.LE})})]})})}),(0,p.jsx)(l4,{children:e=>(0,p.jsx)(p.Fragment,{children:e.map((e,t)=>{let i=(0,lH.Gm)(e),l=(0,lH.zF)(e),s=n[e];return(0,p.jsx)(n3.n,{label:i,description:l,children:(0,p.jsx)("div",{className:l3.jh,children:s.map((e,t)=>(0,p.jsxs)(f.Fragment,{children:[0!==t&&(0,p.jsx)(ls.c,{}),(0,p.jsxs)("div",{className:l3.yZ,children:[(0,p.jsx)(n4.E,{variant:"text-md/normal",children:e.description}),(0,p.jsx)("div",{className:l3.DM,children:e.binds.map(e=>(0,p.jsx)(l1.e,{shortcut:e,className:l3.LE},e))})]})]},e.description))})},t)})})})]})}let l6=(0,h.E2)(S.X.DEFAULT_KEYBINDS_SETTING,{useSearchTerms:()=>[V.intl.string(V.t.Lz5KHI)],Component:()=>(0,p.jsx)(l5,{showHeader:!1})}),l8=(0,h.zD)(S.X.GAME_MODE_ENABLED_SETTING,{useTitle:()=>V.intl.string(eR.default.rea2Ar),useSubtitle:()=>V.intl.string(eR.default.DwBO0x),useValue:()=>(0,_.bG)([iJ.A],()=>iJ.A.isEnabledFor(!0)),setValue:e=>{td.default.track(I.HAw.GAME_MODE_TOGGLED,{enabled:e,running_game_id:iJ.A.runningGameId}),ts.h.dispatch({type:"GAME_MODE_SET_ENABLED",enabled:e})}});var l7=n(19575),l9=n(546385);let se=(0,h.E2)(S.X.HARDWARE_ACCELERATION,{usePredicate:()=>nh.Av&&!(0,nh.cX)(),useSearchTerms:()=>[V.intl.string(V.t["/HIxyY"]),V.intl.string(V.t.B0hqpb)],Component:function(){let[e]=f.useState(()=>l7.Ay.getEnableHardwareAcceleration()),t=V.intl.string(V.t["/HIxyY"]),n=V.intl.string(V.t.B0hqpb);return(0,p.jsxs)(q.B,{children:[(0,p.jsx)(t5.d,{label:t,description:n,checked:e,onChange:st}),!e&&(0,p.jsx)(l9.A,{look:l9.k.WARNING,children:V.intl.string(V.t.j7S6IX)})]})}});function st(e){let t=e?V.intl.format(V.t.LYXRxL,{}):V.intl.format(V.t.uDP3Kz,{});(0,n2.A)({title:V.intl.string(V.t.aqpAvn),subtitle:t,confirmText:V.intl.string(V.t.vT7ckk),onConfirm:()=>{l7.Ay.setEnableHardwareAcceleration(e)}})}let sn=(0,eN.D)(()=>({openOnStartup:!0,startMinimized:!1,minimizeToTray:!0}));async function si(){let e=await l7.Ay.getOpenOnStart(),t=await l7.Ay.getSetting("START_MINIMIZED",!1),n=await l7.Ay.getSetting("MINIMIZE_TO_TRAY",!0);sn.setState({openOnStartup:e,startMinimized:t,minimizeToTray:n})}let sl=(0,h.zD)(S.X.OS_OPEN_ON_STARTUP,{useTitle:()=>V.intl.string(V.t["3BeZti"]),usePredicate:()=>nh.Av&&!(0,nh.cX)(),useValue:()=>sn.useState(e=>e.openOnStartup),setValue:function(e){sn.setState({openOnStartup:e}),l7.Ay.send("TOGGLE_OPEN_ON_STARTUP",e)},initialize:()=>{l7.Ay.getOpenOnStart().then(e=>sn.setState({openOnStartup:e}))}}),ss=(0,h.zD)(S.X.OS_MINIMIZE_TO_TRAY,{useTitle:()=>V.intl.string(V.t.dJ5MUh),useSubtitle:()=>V.intl.string(V.t.nQavHr),usePredicate:()=>nh.Av&&!(0,nh.cX)(),useValue:()=>sn.useState(e=>e.minimizeToTray),setValue:function(e){sn.setState({minimizeToTray:e}),l7.Ay.send("TOGGLE_MINIMIZE_TO_TRAY",e)},initialize:()=>{l7.Ay.getSetting("MINIMIZE_TO_TRAY",!0).then(e=>sn.setState({minimizeToTray:e}))}}),sr=(0,h.zD)(S.X.OS_START_MINIMIZED,{useTitle:()=>V.intl.string(V.t.GfBL83),useSubtitle:()=>V.intl.string(V.t.XGyhhc),usePredicate:()=>(0,nh.uF)(),useValue:()=>sn.useState(e=>!!e.openOnStartup&&e.startMinimized),setValue:function(e){sn.setState({startMinimized:e}),l7.Ay.send("TOGGLE_START_MINIMIZED",e)},useDisabled:()=>!sn.useState(e=>e.openOnStartup),initialize:()=>{l7.Ay.getSetting("START_MINIMIZED",!1).then(e=>sn.setState({startMinimized:e}))}});var sa=n(61628);let so=new Set(["failure","unknown"]),su=(0,h.E2)(S.X.OS_SYSTEM_SERVICE,{useSearchTerms:()=>[V.intl.string(V.t.roHq80)],Component:function(){let[e,t]=f.useState(!1),[n,i]=f.useState(()=>(0,le.TC)()),l=(0,_.bG)([i5.Ay],()=>i5.Ay.getSystemServiceStatus("input-service")),s=f.useCallback(async()=>{t(!0),n?await (0,le.z8)("windows-settings"):await (0,le.sL)("windows-settings"),t(!1),i((0,le.TC)())},[n]);return(0,p.jsxs)("div",{className:sa.q,children:[(0,p.jsxs)("div",{className:sa.L,children:[(0,p.jsxs)(q.B,{direction:"horizontal",children:[(0,p.jsx)(n4.E,{variant:"text-md/medium",color:"text-strong",children:V.intl.string(V.t.roHq80)}),n&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(n4.E,{variant:"text-md/medium",color:"text-strong","aria-hidden":!0,children:"\u2022"}),(0,p.jsx)(n4.E,{variant:"text-md/medium",color:"running"===l.state?"text-feedback-positive":so.has(l.state)?"text-feedback-critical":"text-feedback-warning",children:function(e){switch(e.state){case"unknown":return V.intl.string(V.t["KW+nqT"]);case"disabled":return V.intl.string(V.t["Q/wAF7"]);case"disconnected":return V.intl.string(V.t.Xvs9IM);case"initializing":return V.intl.string(V.t.h4qz8W);case"connecting":return V.intl.string(V.t.fSu9XF);case"handshaking":return V.intl.string(V.t["00aYLJ"]);case"running":return V.intl.string(V.t["54TB7Z"]);case"waiting-for-retry":return V.intl.string(V.t["0FONwi"]);case"failure":return V.intl.string(V.t.Ic0nkd);default:(0,io.xb)(e.state)}}(l)})]})]}),(0,p.jsx)(n4.E,{variant:"text-sm/normal",color:"text-subtle",children:V.intl.format(V.t["8CAL+D"],{helpCenterLink:eb.A.getArticleURL(I.MVz.SYSTEM_SERVICE)})})]}),(0,p.jsx)(j.$,{variant:n?"critical-secondary":"primary",loading:e,onClick:s,text:n?V.intl.string(V.t.pAwbdL):V.intl.string(V.t["1iI46O"])})]})},usePredicate:le.XQ});var sd=n(687813),sc=n(562708),sg=n(858899),sm=n(384077);async function sA(){try{await sE()}catch{(0,sg.P0)({text:V.intl.string(V.t["8ihs9i"]),variant:"critical"})}}async function sE(){var e;let t=nT.A.tracing;if(null==t)return;(0,sg.P0)({text:V.intl.string(V.t.qGRW8d)});let[n,i,l]=await Promise.all([t.capturePerformanceTrace({durationMs:3e4}),nT.A.processUtils.getSystemInfo(),nT.A.processUtils.getSystemMetrics((0,sm.uD)())]),s={captured_at:n.startedAtISO,duration_ms:n.durationMs,categories:n.categories,...(0,sc.getSuperProperties)(),native_build_number:nT.A.app.getBuildNumber()},r={systemInfo:i,systemMetrics:l,cumulativeCpuUsage:nT.A.processUtils.getCumulativeCPUUsage()??null,processTypeCpuUsage:nT.A.processUtils.getCpuUsageElectronProcessTypeDetails()??null},a=await (e={"trace.json":n.traceBytes,"system_info.json":(0,sd._u)(JSON.stringify(r,null,2)),"metadata.json":(0,sd._u)(JSON.stringify(s,null,2))},new Promise((t,n)=>{(0,sd.yU)(e,{level:6},(e,i)=>null!=e?n(e):t(i))})),o=`Discord-Trace-${n.startedAtISO.replace(/:/g,"-").replace(/\..*$/,"")}.zip`,{filePath:u}=await t.saveTraceToDownloads(a,o);nT.A.fileManager.showItemInFolder(u),(0,sg.P0)({text:V.intl.string(V.t.gpCRFS),variant:"success"})}let sh=(0,h.Tf)(S.X.CAPTURE_PERFORMANCE_TRACE,{useTitle:()=>V.intl.string(V.t.o6Qr6n),useSubtitle:()=>V.intl.string(V.t.OuGtH8),useLabel:()=>V.intl.string(V.t.bm1WjO),usePredicate:()=>nh.Av&&nT.A?.tracing?.capturePerformanceTrace!=null,onClick:()=>{(0,n2.A)({title:V.intl.string(V.t.o6Qr6n),subtitle:V.intl.string(V.t.JEHHJ1),confirmText:V.intl.string(V.t.bm1WjO),onConfirm:()=>{(0,tY.default)(),sA()}})}});function sS(){ts.h.dispatch({type:"DISCORD_STATS_POPOUT_WINDOW_OPEN"})}var sx=n(287809);let sT=(0,h.Tf)(S.X.DISCORD_STATS_POPOUT,{useTitle:()=>"Discord Stats",useSubtitle:()=>"Open a floating panel showing live GPU, CPU, and memory usage.",useLabel:()=>"Open",usePredicate:()=>(0,_.bG)([sx.default],()=>sx.default.getCurrentUser()?.isStaff()??!1),onClick:()=>{sS()}});var sp=n(114129),sf=n(442325),s_=n(858760);let sI=(0,h.zD)(S.X.ENABLE_TABS_EXPERIENCE,{useTitle:()=>"Enable tabs experience",useSubtitle:()=>"Open channels as browser-style tabs in the title bar, each with its own back/forward history.",usePersistentBadge:()=>({badgeType:T.Xi.BETA}),usePredicate:()=>s_.A.useConfig({location:"EnableTabsExperienceSetting"}).enabled&&(0,nh.xl)(),useValue:()=>(0,_.bG)([sf.A],()=>sf.A.isUserOptedIn()),setValue:sp.lj});var sN=n(731699);let sC={};var sb=n(735729),sy=n(146849);let sv=(0,h.zD)(S.X.NATIVE_MARKDOWN,{useTitle:()=>V.intl.string(V.t["5CIvT4"]),usePredicate:()=>sy.wG.useConfig({location:"NativeMarkdownSetting"}).enabled,useValue:()=>(0,sb.A)(sy.XQ),setValue:e=>(function(e){let{enabled:t=!sN.A.get(e)}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:sC;ts.h.dispatch({type:"LAB_FEATURE_TOGGLE",labFeature:e,enabled:t})})(sy.XQ,{enabled:e})}),sj=(0,h.zZ)(S.X.SYSTEM_ADVANCED_CATEGORY,{useTitle:()=>V.intl.string(V.t["8/udY0"]),buildLayout:()=>[sT,sh,sI,sv]}),sO=(0,h.zZ)(S.X.SYSTEM_GENERAL_CATEGORY,{useTitle:()=>V.intl.string(V.t.cg6ltt),buildLayout:()=>[sl,sr,ss,se],usePredicate:()=>nh.Av&&((0,nh.uF)()||(0,nh.j9)()),initialize:()=>{si()}}),sL=(0,h.zZ)(S.X.SYSTEM_CUSTOM_KEYBINDS_CATEGORY,{useTitle:()=>V.intl.string(V.t["069nVT"]),useSubtitle:()=>V.intl.string(V.t.T4LZVL),buildLayout:()=>[l0],initialize:()=>(iZ.A.enableAll(!1),()=>iZ.A.enableAll(!0)),useInlineNotice:function(){return nh.Av?{type:T.lT.STRONGLY_DISCOURAGED_CUSTOM,notice:()=>(0,p.jsxs)(q.B,{direction:"vertical",gap:"md",children:[(0,p.jsx)(iK.w,{type:"info",message:V.intl.string(V.t["5pkmHa"]),role:"none"}),(0,p.jsx)(ll,{sourcePage:"keybinds"})]})}:null},useHeaderDecoration:()=>nh.Av?{type:T.WX.BUTTON_GROUP,buttons:[{id:"add-keybind",type:T.UV.BUTTON,text:V.intl.string(V.t.zk6Xbs),variant:"secondary",icon:iH.j,onClick:()=>iZ.A.addKeybind()}]}:null}),sR=(0,h.zZ)(S.X.SYSTEM_DEFAULT_KEYBINDS_CATEGORY,{useTitle:()=>V.intl.string(V.t.Lz5KHI),buildLayout:()=>[l6]}),sD=(0,h.zZ)(S.X.SYSTEM_HELPER_CATEGORY,{useTitle:()=>V.intl.string(V.t["+XZgmA"]),usePredicate:()=>nh.Av&&((0,nh.uF)()||(0,nh.j9)()),buildLayout:()=>[su]}),sP=(0,h.zZ)(S.X.SYSTEM_GAME_MODE_CATEGORY,{useTitle:()=>V.intl.string(eR.default.QG0axY),usePredicate:()=>(0,_.bG)([iJ.A,iq.A],()=>e8.isPlatformEmbedded&&iJ.A.hasDetectedGame&&(0,iQ.v)({location:"GameModeCategory"}).enabled),buildLayout:()=>[l8]}),sG=(0,h.t_)(S.X.SYSTEM_PANEL,{useTitle:()=>V.intl.string(V.t["VJ/qKo"]),buildLayout:()=>[sO,sL,sR,sD,sP,sj]}),sM=(0,h.i4)(S.X.SYSTEM_SIDEBAR_ITEM,{useTitle:()=>V.intl.string(V.t["VJ/qKo"]),icon:iW.F,buildLayout:()=>[sG]});var sU=n(831544),sV=n(922795),sk=n(212245),sw=n(329551),sF=n(285918),sB=n(312987),sz=n(952572),sX=n(382003);let sY=(0,h.E2)(S.X.CAMERA_BACKGROUND_SETTING,{useSearchTerms:()=>[V.intl.string(V.t.lZTUPs)],usePredicate:sz.A,Component:function(){let e=(0,sk.p)(),t=f.useRef(!1),n=(0,_.bG)([i9.Ay],()=>i9.Ay.getVideoDeviceId()),[i,l]=f.useState((0,sw.i)(sx.default.getCurrentUser())),s=f.useRef(i);return f.useEffect(()=>()=>{t.current&&(0,sF._C)(s.current)},[]),(0,p.jsx)(sX.A,{selectedBackgroundOption:i,onSelectBackgroundOption:function(n){t.current=!0,s.current=n,l(n),(0,sB.gB)(n,{location:e.location}).catch(I.tEg)},currentDeviceId:n})}}),sH=(0,h.zD)(S.X.CAMERA_PREVIEW_PREFERENCE,{useTitle:()=>V.intl.string(V.t["3Ppr1h"]),useSubtitle:()=>V.intl.string(V.t.WNbX4O),useValue:U.bm.useSetting,setValue:e=>{U.bm.updateSetting(e),td.default.track(I.HAw.UPDATE_USER_SETTINGS_LOCAL,{always_preview_video:e})}});var sW=n(625841),sK=n(74848),sZ=n(204050);let sq=(0,eN.D)(()=>({previewEnabled:!1})),sQ=(0,h.E2)(S.X.CAMERA_SELECTION_SETTING,{useSearchTerms:()=>[V.intl.string(V.t.FsQ3OR)],Component:function(){let e=(0,_.bG)([i9.Ay],()=>i9.Ay.isVideoAvailable()),{id:t}=(0,sK.x5)(lw.oh.VIDEO_INPUT),{analyticsLocations:n}=(0,eX.Ay)();return(0,p.jsx)(sW.U,{label:V.intl.string(V.t.FsQ3OR),deviceType:lw.oh.VIDEO_INPUT,location:"UserSettingsCameraSelect",isDisabled:!e,helperText:(0,sZ.p)()?V.intl.format(V.t.aJYgRt,{onCameraSettingsClick:()=>{sq.setState({previewEnabled:!1}),window.open((0,sZ.i)(t)),td.default.track(I.HAw.SYSTEM_CAMERA_SETTINGS_OPENED,{location_stack:n})}}):void 0})}});var sJ=n(745317),s$=n(9219);let s0=(0,h.E2)(S.X.CAMERA_VIDEO_PREVIEW,{useSearchTerms:()=>[V.intl.string(V.t.JIf4v7)],Component:function(){let e=i9.Ay.getCameraComponent(),t=(0,_.bG)([i9.Ay],()=>i9.Ay.getVideoDeviceId()),n=sq.useField("previewEnabled"),i=(0,_.bG)([i9.Ay],()=>i9.Ay.isVideoAvailable());return((0,eI.l0)(()=>{sq.setState({previewEnabled:!1})}),n)?(0,p.jsx)("div",{className:s$.T9,children:(0,p.jsxs)("div",{className:s$.Xi,children:[(0,p.jsxs)("div",{className:s$.UI,children:[(0,p.jsx)(e,{deviceId:t,width:387,height:218,disabled:!n}),(0,p.jsx)(sJ.kE,{})]}),(0,p.jsx)(sJ.eK,{})]})}):(0,p.jsx)("div",{className:s$.T9,children:(0,p.jsx)(lg.m,{text:i?null:V.intl.string(V.t["8jSzSe"]),children:(0,p.jsx)(j.$,{variant:"primary",text:V.intl.string(V.t.JIf4v7),onClick:()=>sq.setState({previewEnabled:!0}),disabled:!i})})})}}),s1=(0,h.zZ)(S.X.CAMERA_CATEGORY,{useTitle:()=>V.intl.string(V.t.uje3P9),usePredicate:()=>(0,_.bG)([i9.Ay],()=>i9.Ay.supports(lw.O5.VIDEO)),buildLayout:()=>[s0,sH,sQ,sY]}),s2=(0,h.zD)(S.X.VOICE_AND_VIDEO_OPENH264,{useTitle:()=>V.intl.string(V.t.qFphsa),useSubtitle:()=>V.intl.string(V.t.cQfwyY),usePredicate:function(){return(0,nh.j9)()},useValue:function(){return(0,_.bG)([i9.Ay],()=>i9.Ay.getOpenH264Enabled())},setValue:function(e){lE.default.setOpenH264Enabled(e),(0,n2.A)({title:V.intl.string(V.t["9jf31O"]),subtitle:V.intl.string(V.t["J2wg+X"]),confirmText:V.intl.string(V.t.BddRzS),onConfirm:()=>nT.A.app.relaunch()})},useSearchTerms:()=>["open","OpenH264","H264","codec"]}),s3=(0,h.zD)(S.X.VOICE_AND_VIDEO_AUDIO_RECORDING,{useTitle:()=>V.intl.string(V.t["r6K+TL"]),useSubtitle:()=>V.intl.string(V.t["xl9+I6"]),useValue:function(){return(0,_.bG)([i9.Ay],()=>i9.Ay.getAecDump())},setValue:lE.default.setAecDump,usePredicate:function(){return(0,_.bG)([i9.Ay],()=>i9.Ay.isAecDumpSupported())}});var s4=n(139033),s5=n(862482),s6=n(640238),s8=n(825484),s7=n(108088),s9=n(487329),re=n(353835);let rt=(0,eN.D)(()=>({isUploading:!1,isDisabled:!1}));async function rn(){let e=await nT.A.fileManager.getLogPath();nT.A.fileManager.showItemInFolder(e)}function ri(e){(0,n2.A)({title:V.intl.string(V.t["7UXEF2"]),subtitle:V.intl.string(V.t.IYPrRl),confirmText:V.intl.string(V.t.BddRzS),onConfirm:()=>lE.default.setDebugLogging(e)})}async function rl(e){let{onUploadStart:t,onUploadFinish:n}=e;t?.();try{let e,t;await i9.Ay.getMediaEngine().writeAudioDebugState(),await re.A.submitLiveCrashReport({message:{message:"User Live Dump"}}),await (0,s7.a)(I.Umv.RTC),e=V.intl.string(V.t["fKBB8+"]),t=V.intl.string(V.t.BvyxE7),(0,s4.A)({title:e,subtitle:t})}catch(s){var i;let e,t,n,l;i=s.displayMessage,e=V.intl.string(V.t.QZg0J7),t=i??V.intl.string(V.t.VzHcSm),n=(0,s9.B1)(s9.iy.DEBUG_LOG_UPLOAD_FAILED)?.errorCode,l=V.intl.formatToPlainString(V.t.ejOT95,{errorCode:n}),(0,lT.openModal)(n=>(0,p.jsx)(s6.a,{header:e,confirmButtonColor:s5.$n.Colors.BRAND,confirmText:V.intl.string(V.t.BddRzS),...n,children:(0,p.jsxs)("div",{style:{display:"flex",flexDirection:"column",height:"100%"},children:[(0,p.jsx)(n4.E,{variant:"text-md/normal",children:t}),(0,p.jsx)(n4.E,{variant:"text-sm/semibold",selectable:!0,style:{marginTop:"auto"},children:l})]})}))}finally{n?.()}}async function rs(){await rl({onUploadStart:()=>rt.setState({isUploading:!0}),onUploadFinish:()=>rt.setState({isUploading:!1,isDisabled:!0})})}let rr=(0,h.E2)(S.X.VOICE_AND_VIDEO_DEBUG_LOGGING,{useSearchTerms:()=>[V.intl.string(V.t["726JHL"]),V.intl.string(V.t.EbwFfR),V.intl.string(V.t.nuPtYi)],usePredicate:function(){let e=(0,_.bG)([i9.Ay],()=>i9.Ay.supports(lw.O5.DEBUG_LOGGING));return nh.Av&&e&&null!=nT.A.fileManager.readLogFiles},Component:function(){let e=(0,_.bG)([i9.Ay],()=>i9.Ay.getDebugLogging()),t=rt.useField("isUploading"),n=rt.useField("isDisabled"),i=f.useId();return(0,p.jsxs)("fieldset",{children:[(0,p.jsx)(lm.A,{tag:"legend",id:i,children:V.intl.string(V.t["FjN+et"])}),(0,p.jsxs)(q.B,{direction:"vertical",gap:4,children:[(0,p.jsx)(t5.d,{label:V.intl.string(V.t["726JHL"]),description:V.intl.string(V.t["/7ak9Q"]),checked:e,onChange:ri}),(0,p.jsx)("div",{role:"group","aria-labelledby":i,children:(0,p.jsxs)(s8.e,{children:[(0,p.jsx)(j.$,{variant:"secondary",text:V.intl.string(V.t.EbwFfR),onClick:rs,loading:t,disabled:n,"aria-label":V.intl.string(V.t.aY1OH2)}),(0,p.jsx)(j.$,{variant:"secondary",text:V.intl.string(V.t.nuPtYi),onClick:rn,"aria-label":V.intl.string(V.t["L/hFOe"])})]})})]})]})}});var ra=n(233545),ro=n(58663),ru=n(412780);function rd(){return(0,_.bG)([sx.default,i9.Ay],()=>{let e=sx.default.getCurrentUser(),t=e?.isStaff()??!1,n="canary"===l7.Ay.releaseChannel||"development"===l7.Ay.releaseChannel,i=i9.Ay.supports(lw.O5.CONNECTION_REPLAY);return t&&n&&i})}let rc=(0,h.zD)(S.X.VOICE_AND_VIDEO_RECORD_CONNECTION_REPLAY,{useTitle:()=>V.intl.string(V.t.U4FgFK),useSubtitle:()=>V.intl.string(V.t.Lm72RU),useValue:function(){return(0,_.bG)([ru.Ay],()=>ru.Ay.shouldRecordNextConnection())},setValue:ro.A,usePredicate:rd}),rg=(0,h.Tf)(S.X.VOICE_AND_VIDEO_OPEN_CONNECTION_REPLAY,{useTitle:()=>V.intl.string(V.t.nJnOHO),useLabel:()=>V.intl.string(V.t["3xjX0U"]),onClick:ra.YW,usePredicate:rd});var rm=n(926919),rA=n(111162),rE=n(855302);let rh=(0,h.zD)(S.X.VOICE_AND_VIDEO_STREAM_INFO_OVERLAY,{useTitle:()=>V.intl.string(V.t["0CEP6e"]),useSubtitle:()=>V.intl.string(V.t["kBXuW+"]),useValue:function(){return(0,_.bG)([rA.default],()=>rA.default.isStreamInfoOverlayEnabled)},setValue:function(e){let t=rA.default.isStreamInfoOverlayEnabled;(0,rE.A)("stream_info_overlay_enabled",e,t),(0,rm.x)({isStreamInfoOverlayEnabled:e})},usePredicate:function(){return U.Q_.useSetting()}}),rS=(0,h.bd)(S.X.VOICE_AND_VIDEO_DIAGNOSTICS_ACCORDION,{useTitle:e=>e?V.intl.string(V.t["/B4I8H"]):V.intl.string(V.t.BTlsWH),useCollapsedSubtitle:()=>V.intl.string(V.t.la1Ys4),buildLayout:()=>[rh,s3,rc,rg,rr]});function rx(e,t,n){(0,n2.A)({title:e,subtitle:t,confirmText:V.intl.string(V.t.BddRzS),onConfirm:n})}let rT=(0,h.Tf)(S.X.VOICE_AND_VIDEO_RESET_ALL_SETTINGS,{useTitle:()=>V.intl.string(V.t.SXfv1v),useSubtitle:()=>V.intl.string(V.t["buA5/q"]),useLabel:()=>V.intl.string(V.t.yBZMsQ),onClick:function(){rx(V.intl.string(V.t["4iKQ/3"]),V.intl.string(V.t.sQ42iT),lE.default.reset)},useVariant:()=>"critical-secondary"}),rp=(0,h.zZ)(S.X.VOICE_AND_VIDEO_DIAGNOSTICS_CATEGORY,{useTitle:()=>V.intl.string(V.t.UDAU9K),buildLayout:()=>[s2,rS,rT]});var rf=n(736056),r_=n(360729),rI=n(446243),rN=n(558076),rC=n(270103);let rb=(0,h.zD)(S.X.GUILD_ROOMS_REMEMBER_LAST_VIEW_SETTING,{useTitle:()=>V.intl.string(rC.default.qYzpsI),useSubtitle:()=>V.intl.string(rC.default["+vMoL1"]),useValue:()=>(0,_.bG)([rN.A],()=>rN.A.getRememberVideoOverlayVisibility()),setValue:e=>(0,rI.Ft)(e)}),ry=(0,h.zZ)(S.X.GUILD_ROOMS_CATEGORY,{useTitle:()=>V.intl.string(rC.default.wRLmM0),usePredicate:function(){let e=(0,_.yK)([lv.A],()=>lv.A.getGuildIds()),{loaded:t,override:n}=(0,_.cf)([rf.A],()=>({loaded:rf.A.getLoadedGuildExperiment(r_.vJ),override:rf.A.getExperimentOverrideDescriptor(r_.vJ)}));return(0,f.useMemo)(()=>(null!=t||null!=n)&&e.some(e=>(0,r_.W8)({guildId:e,location:"useHasGuildRoomsEligibleGuild"},{autoTrackExposure:!1}).enabled),[e,t,n])},buildLayout:()=>[rb]});var rv=n(347481),rj=n(852712),rO=n(179172),rL=n(868162);let rR=(0,h.zD)(S.X.VOICE_AUDIO_DEVICE_SUGGESTIONS_SETTING,{useTitle:()=>V.intl.string(V.t.gF8HJo),useSubtitle:()=>V.intl.string(V.t.cfrfyZ),useValue:function(){return(0,_.bG)([rL.A],()=>!0!==rL.A.getState().neverShowModal)},setValue:function(e){rO.Bv(!e)},usePredicate:function(){return e8.isPlatformEmbedded}}),rD=(0,h.zD)(S.X.VOICE_AUTOMATIC_GAIN_CONTROL_SETTING,{useTitle:()=>V.intl.string(V.t.cUMdH0),useSubtitle:()=>V.intl.string(V.t["6EjbvA"]),useValue:function(){return(0,_.bG)([i9.Ay],()=>i9.Ay.getAutomaticGainControl())},setValue:function(e){lE.default.setAutomaticGainControl(e,{page:I.liQ.USER_SETTINGS,section:I.JJy.SETTINGS_VOICE_AND_VIDEO})},useDisabled:function(){return(0,_.bG)([i9.Ay,rv.A],()=>{let e=i9.Ay.getInputDeviceId();return rv.A.hasAutomaticGainControl(e)})},usePredicate:function(){return(0,_.bG)([i9.Ay],()=>i9.Ay.isAutomaticGainControlSupported()&&i9.Ay.isInputProfileCustom())}}),rP=(0,h.sN)(S.X.VOICE_GLOBAL_ATTENUATION_SLIDER,{useTitle:()=>V.intl.string(V.t.AlybXj),setValue:e=>lE.default.setAttenuation(e,i9.Ay.getAttenuateWhileSpeakingSelf(),i9.Ay.getAttenuateWhileSpeakingOthers()),minValue:0,maxValue:100,getInitialValue:()=>i9.Ay.getAttenuation()}),rG=(0,h.zD)(S.X.VOICE_GLOBAL_ATTENUATION_FOR_SELF_SETTING,{useTitle:()=>V.intl.string(V.t["9dHxRY"]),useValue:()=>(0,_.bG)([i9.Ay],()=>i9.Ay.getAttenuateWhileSpeakingSelf()),setValue:e=>lE.default.setAttenuation(i9.Ay.getAttenuation(),e,i9.Ay.getAttenuateWhileSpeakingOthers())}),rM=(0,h.zD)(S.X.VOICE_GLOBAL_ATTENUATION_FOR_OTHERS_SETTING,{useTitle:()=>V.intl.string(V.t.SMt0Gr),useValue:()=>(0,_.bG)([i9.Ay],()=>i9.Ay.getAttenuateWhileSpeakingOthers()),setValue:e=>lE.default.setAttenuation(i9.Ay.getAttenuation(),i9.Ay.getAttenuateWhileSpeakingSelf(),e)}),rU=(0,h.FW)(S.X.VOICE_GLOBAL_ATTENUATION_FIELD_SET,{variant:"compact",useTitle:()=>V.intl.string(V.t.oSdBvW),useSubtitle:()=>V.intl.string(V.t["0A/8Rt"]),usePredicate:()=>(0,_.bG)([i9.Ay],()=>i9.Ay.supports(lw.O5.ATTENUATION)),buildLayout:()=>[rP,rG,rM]}),rV=(0,h.zD)(S.X.VOICE_BYPASS_SYSTEM_INPUT_PROCESSING_SETTING,{useTitle:()=>V.intl.string(V.t.DFPXIG),useSubtitle:()=>V.intl.string(V.t["UyRX+C"]),useValue:function(){return(0,_.bG)([i9.Ay],()=>i9.Ay.getBypassSystemInputProcessing())},setValue:function(e){lE.default.setBypassSystemInputProcessing(e)},usePredicate:function(){return(0,_.bG)([i9.Ay],()=>i9.Ay.showBypassSystemInputProcessing()&&i9.Ay.isInputProfileCustom())}}),rk=(0,h.zD)(S.X.VOICE_SWITCH_CHANNEL_ALERT_SETTING,{useTitle:()=>V.intl.string(V.t.jrWHD3),useSubtitle:()=>V.intl.string(V.t.YCCMkJ),useValue:function(){return(0,_.bG)([ex.Ay],()=>!ex.Ay.disableVoiceChannelChangeAlert)},setValue:function(e){(0,rE.A)("switch_channel_warning_enabled",e,!ex.Ay.disableVoiceChannelChangeAlert),nk.Ay.updatedUnsyncedSettings({disableVoiceChannelChangeAlert:!e})}}),rw=(0,h.zD)(S.X.ADVANCED_VOICE_ACTIVITY_PROCESSING_SETTING,{useTitle:()=>V.intl.string(V.t.BbESsg),useSubtitle:()=>V.intl.string(V.t.LoOB1F),useValue:function(){return(0,_.bG)([i9.Ay],()=>{let{vadUseKrisp:e}=i9.Ay.getModeOptions();return e})},setValue:function(e){let t=i9.Ay.getMode();lE.default.setMode(t,{vadUseKrisp:e})},useDisabled:function(){return(0,_.bG)([i9.Ay],()=>i9.Ay.getMode()!==I.TBI.VOICE_ACTIVITY||!i9.Ay.getModeOptions().autoThreshold)},usePredicate:function(){return(0,_.bG)([i9.Ay],()=>i9.Ay.isAdvancedVoiceActivitySupported()&&i9.Ay.isInputProfileCustom())}}),rF=(0,h.Hn)(S.X.VOICE_AUDIO_SUBSYSTEM_SETTING,{useTitle:()=>V.intl.string(V.t.wVBHr0),useValue:function(){return(0,_.bG)([i9.Ay],()=>i9.Ay.getAudioSubsystem())},setValue:function(e){rx(V.intl.string(V.t.uY7AcQ),V.intl.string(V.t.gBqik6),()=>lE.default.setAudioSubsystem(e))},useOptions:function(){let{legacyAudioSubsystemSupported:e,experimentalAudioSubsystemSupported:t,automaticAudioSubsystemSupported:n}=(0,_.cf)([i9.Ay],()=>({legacyAudioSubsystemSupported:i9.Ay.supports(lw.O5.LEGACY_AUDIO_SUBSYSTEM),experimentalAudioSubsystemSupported:i9.Ay.supports(lw.O5.EXPERIMENTAL_AUDIO_SUBSYSTEM),automaticAudioSubsystemSupported:i9.Ay.supports(lw.O5.AUTOMATIC_AUDIO_SUBSYSTEM)}));return f.useMemo(()=>{let i;return i=[{id:lw.rB.STANDARD,value:lw.rB.STANDARD,label:V.intl.string(V.t.dqb2JZ)}],e&&i.push({id:lw.rB.LEGACY,value:lw.rB.LEGACY,label:V.intl.string(V.t["TYfH+5"])}),t&&i.push({id:lw.rB.EXPERIMENTAL,value:lw.rB.EXPERIMENTAL,label:V.intl.string(V.t.liQmtr)}),n&&i.push({id:lw.rB.AUTOMATIC,value:lw.rB.AUTOMATIC,label:V.intl.string(V.t.qNgtO1)}),i},[n,t,e])},usePredicate:function(){return(0,_.bG)([i9.Ay],()=>i9.Ay.shouldOfferManualSubsystemSelection())}}),rB=(0,h.zD)(S.X.VOICE_QUALITY_OF_SERVICE_SETTING,{useTitle:()=>V.intl.string(V.t.uancuJ),useSubtitle:()=>V.intl.string(V.t.I1Eoqq),useValue:function(){return(0,_.bG)([i9.Ay],()=>i9.Ay.getQoS())},setValue:function(e){lE.default.setQoS(e)},usePredicate:function(){return(0,_.bG)([i9.Ay],()=>i9.Ay.supports(lw.O5.QOS))}}),rz=(0,h.zD)(S.X.VOICE_SILENCE_WARNING_SETTING,{useTitle:()=>V.intl.string(V.t["4rsOPQ"]),useSubtitle:()=>V.intl.string(V.t.jtiiCw),useValue:function(){return(0,_.bG)([i9.Ay],()=>i9.Ay.getEnableSilenceWarning())},setValue:function(e){lE.default.setSilenceWarning(e)},usePredicate:function(){return e8.isPlatformEmbedded}}),rX=(0,h.bd)(S.X.INPUT_PROFILE_VOICE_ADVANCED_ACCORDION,{useTitle:function(e){return e?V.intl.string(V.t.KHsSWK):V.intl.string(V.t.PPDo5V)},useCollapsedSubtitle:()=>t_(S.X.INPUT_PROFILE_VOICE_ADVANCED_ACCORDION,{limit:(0,_.bG)([i9.Ay],()=>i9.Ay.isInputProfileCustom())?3:2}),buildLayout:()=>[rD,rw,rV,rR,rz,rk,rU,rF,rB]}),rY=(0,h.zD)(S.X.VOICE_ECHO_CANCELLATION_SETTING,{useTitle:()=>V.intl.string(V.t.iWTwu6),useValue:function(){return(0,_.bG)([i9.Ay],()=>i9.Ay.getEchoCancellation())},setValue:function(e){lE.default.setEchoCancellation(e,{page:I.liQ.USER_SETTINGS,section:I.JJy.SETTINGS_VOICE_AND_VIDEO})},useDisabled:function(){return(0,_.bG)([i9.Ay,rv.A],()=>{let e=i9.Ay.getInputDeviceId();return rv.A.hasEchoCancellation(e)})},usePredicate:function(){return(0,_.bG)([i9.Ay],()=>i9.Ay.isInputProfileCustom())}});var rH=n(205693),rW=n(451988),rK=n(205513),rZ=n(475883),rq=n(303707);let rQ=(0,tK.Ld)();function rJ(e){let{isSpeaking:t,className:n,id:i,ariaDescribedBy:l,ariaLabelledBy:s,disabled:r}=e;return(0,p.jsx)("div",{role:"meter",className:ic()(rZ.$I,n),id:i,"aria-describedby":l,"aria-labelledby":s,"aria-valuenow":t&&!r?100:0,"aria-valuemin":0,"aria-valuemax":100,"aria-valuetext":t&&!r?V.intl.string(V.t.haLKZ0):V.intl.string(V.t.X2hJL7),children:(0,p.jsx)("div",{className:ic()(rZ.Jx,rZ.NU,{[rZ.zY]:t&&!r,[rZ.r9]:r})})})}function r$(e){let{volume:t,id:n,ariaDescribedBy:i,ariaLabelledBy:l,disabled:s}=e,{threshold:r,autoThreshold:a}=(0,_.cf)([i9.Ay],()=>({threshold:i9.Ay.getModeOptions().threshold,autoThreshold:i9.Ay.getModeOptions().autoThreshold})),o=(0,_.bG)([i9.Ay],()=>i9.Ay.getMode());return(0,p.jsx)("section",{className:ic()(rZ.Mo,rZ.jW),id:n,"aria-describedby":i,"aria-labelledby":l,children:(0,p.jsx)(rK.G,{initialValue:r+100,onValueRender:e=>`${(-((100-e)*1)).toFixed(0)}dB`,onValueChange:e=>{var t;return t=-((100-e)*1),void lE.default.setMode(o,{threshold:t,autoThreshold:a})},barStyles:{background:n1.A.unsafe_rawColors.GREEN_360.css},fillStyles:{background:n1.A.unsafe_rawColors.YELLOW_300.css},"aria-labelledby":rQ,disabled:s,children:(0,p.jsxs)("div",{className:ic()(rZ.NU,rZ.TL,rZ.Jx,rq.bar),children:[(0,p.jsx)("div",{className:ic()(rZ.GS,rZ.SH),style:{width:s?0:t+100+"%"}}),(0,p.jsx)("div",{className:"grow"})]})})})}let r0=(0,h.E2)(S.X.VOICE_INPUT_SENSITIVITY_FIELD_SET,{useSearchTerms:()=>[V.intl.string(V.t["sqUm+k"]),V.intl.string(V.t.I1Zuq0),V.intl.string(V.t.nuFtHH)],usePredicate:()=>(0,_.bG)([i9.Ay],()=>i9.Ay.isInputProfileCustom()),Component:function(){let{autoThreshold:e,disabled:t}=(0,_.cf)([i9.Ay],()=>({autoThreshold:i9.Ay.getModeOptions().autoThreshold,disabled:i9.Ay.getMode()!==lw.TB.VOICE_ACTIVITY})),n=f.useCallback(e=>{let t=i9.Ay.getMode(),{threshold:n}=i9.Ay.getModeOptions();lE.default.setMode(t,{autoThreshold:e,threshold:n})},[]),i=(0,_.bG)([i9.Ay],()=>i9.Ay.supports(lw.O5.AUTOMATIC_VAD)),{volume:l,isSpeaking:s}=function(){let[e,t]=f.useState(-100),[n,i]=f.useState(!1);function l(e,n){t(e),i((n&lw.ME.VOICE)===lw.ME.VOICE)}return f.useEffect(()=>{let e=new rW.Ep;return e.start(1e3,()=>{i9.Ay.getMediaEngine().on(rH.bg.VoiceActivity,l),e.stop()}),()=>{i9.Ay.getMediaEngine().removeListener(rH.bg.VoiceActivity,l),e.stop()}},[]),{volume:e,isSpeaking:n}}(),r=(0,_.bG)([i9.Ay],()=>i9.Ay.isEnabled()),a=f.useMemo(()=>!r&&(0,p.jsx)("div",{className:rZ.B4,children:(0,p.jsx)(iK.w,{type:"warning",message:V.intl.format(V.t["O13I+O"],{onEnableClick:()=>lE.default.enable(!0)}),role:"status"})}),[r]),o=f.useMemo(()=>e?V.intl.string(V.t.JsbzjA):V.intl.string(V.t.MLmyMY),[e]),u=f.useId(),d=f.useId();return i?(0,p.jsxs)("fieldset",{"aria-describedby":d,children:[(0,p.jsx)(lm.A,{tag:"legend",id:u,children:V.intl.string(V.t.GByLar)}),(0,p.jsx)(lm.A,{id:d,children:o}),(0,p.jsxs)(q.B,{direction:"vertical",gap:8,children:[(0,p.jsx)(t5.d,{disabled:t,label:V.intl.string(V.t.lY6j47),description:o,checked:e,onChange:n}),e?(0,p.jsx)(rJ,{isSpeaking:s,className:rZ.UJ,ariaDescribedBy:d,ariaLabelledBy:u,disabled:t}):(0,p.jsx)(r$,{volume:l,ariaDescribedBy:d,ariaLabelledBy:u,disabled:t}),a]})]}):(0,p.jsxs)(q.B,{direction:"vertical",gap:8,children:[(0,p.jsx)(lu.D,{label:V.intl.string(V.t["sqUm+k"]),description:o,layout:"vertical",children:n=>e?(0,p.jsx)(rJ,{isSpeaking:s,className:rZ.UJ,id:n.controlId,ariaDescribedBy:n.describedById,ariaLabelledBy:n.labelId,disabled:t}):(0,p.jsx)(r$,{volume:l,id:n.controlId,ariaDescribedBy:n.describedById,ariaLabelledBy:n.labelId,disabled:t})}),a]})}});var r1=n(366010);let r2=n(993830),r3=n(413142),r4={page:I.liQ.USER_SETTINGS,section:I.JJy.SETTINGS_VOICE_AND_VIDEO};function r5(){let e=(0,_.bG)([nF.A],()=>(0,r1.q)(nF.A.theme));return(0,p.jsx)("img",{src:e?r2:r3,width:48,height:32,alt:""})}let r6=(0,h.E2)(S.X.VOICE_NOISE_SUPPRESSION_SETTING,{useSearchTerms:()=>[V.intl.string(V.t.t8Qhib),V.intl.string(V.t.hmfkCi)],usePredicate:function(){return(0,_.bG)([i9.Ay],()=>i9.Ay.isInputProfileCustom()&&i9.Ay.isNoiseSuppressionSupported())},Component:function(){let e=f.useCallback(e=>{lE.default.setNoiseCancellation("KRISP"===e,r4),lE.default.setNoiseSuppression("STANDARD"===e,r4)},[]),{noiseCancellation:t,noiseSuppression:n,isNoiseSuppressionSupported:i,isNoiseCancellationSupported:l}=(0,_.cf)([i9.Ay],()=>({noiseCancellation:i9.Ay.getNoiseCancellation(),noiseSuppression:i9.Ay.getNoiseSuppression(),isNoiseSuppressionSupported:i9.Ay.isNoiseSuppressionSupported(),isNoiseCancellationSupported:i9.Ay.isNoiseCancellationSupported()})),s=f.useMemo(()=>{let e=[];return l&&e.push({id:"krisp",label:V.intl.string(V.t.rdoNzt),value:"KRISP"}),i&&e.push({id:"standard",label:V.intl.string(V.t.qXeYHw),value:"STANDARD"}),e.push({id:"disabled",label:V.intl.string(V.t.wkYAlz),value:"NONE"}),e},[l,i]),r=l?V.intl.format(V.t["1q5aTp"],{helpArticle:eb.A.getArticleURL(I.MVz.NOISE_SUPPRESSION)}):V.intl.string(V.t.OWKjw5);return(0,p.jsxs)(q.B,{direction:"vertical",gap:0,children:[(0,p.jsx)(lo.l,{label:V.intl.string(V.t.t8Qhib),description:r,layout:"horizontal",value:t?"KRISP":n?"STANDARD":"NONE",onSelectionChange:e,options:s,selectionMode:"single",fullWidth:!0}),l&&(0,p.jsx)(r5,{})]})}});var r8=n(934729),r7=n(621380);let r9=!nh.Av;function ae(){return(0,_.bG)([i9.Ay],()=>i9.Ay.getMode()===lw.TB.PUSH_TO_TALK)}let at=(0,h.zD)(S.X.VOICE_PUSH_TO_TALK_SETTING,{useTitle:function(){return nh.Av?V.intl.string(V.t.tG4Np5):V.intl.string(V.t.JMyQin)},useSubtitle:function(){let e=(0,_.bG)([i9.Ay],()=>i9.Ay.getMode());return f.useMemo(()=>{if(!nh.Av&&e===lw.TB.PUSH_TO_TALK)return V.intl.format(V.t["VHI4+Y"],{onDownloadClick:()=>(0,r8._)("Help Text PTT")})},[e])},usePredicate:function(){return(0,_.bG)([i9.Ay],()=>i9.Ay.getActiveInputProfile()!==r7.m.STUDIO)},useValue:function(){return(0,_.bG)([i9.Ay],()=>i9.Ay.getMode()===lw.TB.PUSH_TO_TALK)},setValue:function(e){var t,i;t=e?lw.TB.PUSH_TO_TALK:lw.TB.VOICE_ACTIVITY,i=[tk.A.USER_SETTINGS_VOICE_AND_VIDEO],t===lw.TB.PUSH_TO_TALK&&r9&&(0,lT.openModalLazy)(async()=>{let{Alert:e}=await Promise.all([n.e("844331"),n.e("21553")]).then(n.bind(n,381512));return t=>(0,p.jsx)(e,{title:V.intl.string(V.t.Kdt0Gb),confirmText:V.intl.string(V.t["1WjMbC"]),cancelText:V.intl.string(V.t.BddRzS),onConfirm:()=>(0,r8._)("PTT Limited Modal"),body:V.intl.string(V.t.NIozvt),...t})}),lE.default.setMode(t,void 0,void 0,{analyticsLocations:i})},useSearchTerms:()=>[V.intl.string(V.t["pS+K2L"]),V.intl.string(V.t.nuFtHH)]});var an=n(484599);function ai(e){let{shortcut:t}=e,n=(0,_.bG)([la.Ay],()=>la.Ay.isWaylandPortalActive()),i=(0,_.bG)([la.Ay],()=>{let e=la.Ay.getKeybindForAction(I.hCu.PUSH_TO_TALK,!0);return null!=e?la.Ay.getWaylandPortalShortcutState(e.id):null});return n&&0!==t.length?la.Ay.isWaylandPortalEligibleShortcut(t)?null==i||i.bound?null:(0,p.jsx)(iK.w,{type:"warning",message:V.intl.string(V.t.PTCrUP),role:"status"}):(0,p.jsx)(iK.w,{type:"warning",message:V.intl.string(V.t.J0m3aK),role:"status"}):null}let al=(0,h.E2)(S.X.VOICE_PUSH_TO_TALK_KEYBIND_SETTING,{useSearchTerms:()=>[V.intl.string(V.t["pS+K2L"]),V.intl.string(V.t.nuFtHH)],usePredicate:ae,Component:function(){let e=(0,_.bG)([i9.Ay],()=>{let{shortcut:e}=i9.Ay.getModeOptions();return e}),t=V.intl.format(V.t.HVvn5T,{onClick:()=>(0,na.openUserSettings)(S.X.SYSTEM_CUSTOM_KEYBINDS_CATEGORY)});return(0,p.jsx)(lu.D,{label:V.intl.string(V.t["o+BJQR"]),description:t,layout:"horizontal-responsive",children:(0,p.jsxs)("div",{className:an.e,children:[(0,p.jsx)(lh.A,{defaultValue:e,onChange:e=>{let t=la.Ay.getKeybindForAction(I.hCu.PUSH_TO_TALK,!0);null!=t&&(0,lr.uL)(t.id,t.shortcut,e,la.Ay.getWaylandPortalShortcutState(t.id)),lE.default.setMode(I.TBI.PUSH_TO_TALK,{shortcut:e})}}),(0,p.jsx)(ai,{shortcut:e})]})})}}),as=(0,h.sN)(S.X.VOICE_PUSH_TO_TALK_RELEASE_DELAY_SETTING,{useTitle:()=>V.intl.string(V.t.GCNMM8),useSearchTerms:()=>[V.intl.string(V.t["pS+K2L"]),V.intl.string(V.t.nuFtHH)],setValue:function(e){lE.default.setMode(I.TBI.PUSH_TO_TALK,{delay:e})},minValue:0,maxValue:I.IjB,getInitialValue:function(){let{delay:e}=i9.Ay.getModeOptions();return e},onValueRender:function(e){return e>=1e3?(e/=1e3,`${e.toFixed(2)}s`):`${e.toFixed(0)}\u00A0ms`},usePredicate:ae});var ar=n(833473),aa=n(844981),ao=n(943679);function au(){return(0,aa.Ay)("VoiceSettings")}let ad=(0,h.zD)(S.X.VOICE_SPATIAL_AUDIO_SETTING,{useTitle:()=>V.intl.string(ao.default.LGDPhA),useSubtitle:function(){let e=au();if((0,aa.Xt)(e))return e===aa.L3.BLOCKED_MONO_OUTPUT?V.intl.string(ao.default.rOXfEw):V.intl.string(ao.default.O7Aa3Y)},useValue:function(){return(0,_.bG)([ar.A],()=>ar.A.isSpatialAudioEnabled())},setValue:function(e){lE.default.setSpatialAudio(e,[tk.A.USER_SETTINGS_VOICE_AND_VIDEO])},usePredicate:function(){return au()!==aa.L3.HIDDEN},useDisabled:function(){return(0,aa.Xt)(au())}}),ac=(0,h.Qx)(S.X.VOICE_INPUT_PROFILE_SETTING,{useTitle:()=>V.intl.string(V.t.LM3U3k),usePredicate:function(){let{enabledInputProfiles:e}=(0,rj._)({location:"SettingsRendererConfig"});return e.length>0},useSearchTerms:()=>[V.intl.string(V.t.nuFtHH),V.intl.string(V.t.VZPR0R),V.intl.string(V.t.cjPbpT)],useValue:function(){return(0,_.bG)([i9.Ay],()=>i9.Ay.getActiveInputProfile()??r7.m.CUSTOM)},setValue:function(e){let t=[tk.A.USER_SETTINGS_VOICE_AND_VIDEO];lE.default.setActiveInputProfile(e,{analyticsLocations:t})},useOptions:function(){let{enabledInputProfiles:e}=(0,rj.d)({location:"InputProfileCategory"});return[{value:r7.m.VOICE_ISOLATION,name:V.intl.string(V.t.cjPbpT),desc:V.intl.string(V.t.CzhvnE)},{value:r7.m.STUDIO,name:V.intl.string(V.t.VZPR0R),desc:V.intl.string(V.t.ZaJksS)},{value:r7.m.CUSTOM,name:V.intl.string(V.t["N/PQjv"]),desc:V.intl.string(V.t.SnBmuY)}].filter(t=>{let{value:n}=t;return e.includes(n)})}}),ag=(0,h.zZ)(S.X.VOICE_INPUT_PROFILE_CATEGORY,{useInlineNotice:function(){let e=(0,_.bG)([rv.A,i9.Ay],()=>{let e=i9.Ay.getInputDeviceId();return(rv.A.hasEchoCancellation(e)||rv.A.hasNoiseSuppression(e)||rv.A.hasAutomaticGainControl(e))&&i9.Ay.isInputProfileCustom()});return f.useMemo(()=>{if(e)return{type:T.lT.INLINE_NOTICE,noticeType:"info",role:"status",text:V.intl.string(V.t["/Whuzi"])}},[e])},buildLayout:()=>[ac,r0,r6,rY,ad,at,al,as,rX]});var am=n(403581),aA=n(983851),aE=n(687021),ah=n(128450),aS=n(796774),ax=n(209932),aT=n(813564),ap=n(984813),af=n(265872),a_=n(305866),aI=n(22231),aN=n(342073),aC=n(24482),ab=n(792348),ay=n(674168),av=n(340368),aj=n(754388),aO=n(805945),aL=n(647451);function aR(e){let{onSelect:t}=e,[n,i]=f.useState(!1),l=(0,_.bG)([sx.default],()=>sx.default.getCurrentUser()),s=aC.Ay.canUseCustomCallSounds(l),r=f.useRef(null);function a(e){s&&(i(!1),t?.(e))}return(0,p.jsx)(af.Y,{targetElementRef:r,shouldShow:n,position:"left",onRequestClose:()=>i(!1),renderPopout:e=>{let{closePopout:t}=e;return(0,p.jsx)(a_.l,{children:(0,p.jsx)(aj.A,{suppressPlaySound:!0,shouldShowLockedSounds:!1,guildId:null,channel:null,onClose:t,onSelect:a,gridNotice:s?null:(0,p.jsx)(ay.m,{}),analyticsSource:"call sounds edit setting"})})},children:e=>(0,p.jsx)(aO.dT,{...e,ref:r,onClick:()=>{i(!n)},text:V.intl.string(V.t.uOe0Az),children:(0,p.jsx)(aI.PencilIcon,{size:"md",color:"currentColor",className:aL.Wo})})})}function aD(e){let{sound:t}=e,{previewSound:n}=(0,ab.A)(t,null),i=(0,aT.wH)(),l=(0,av._)("SoundPreviewButton")?aN.L:aA.H,s=0===i?V.intl.string(V.t.OASXjt):V.intl.formatToPlainString(V.t["/8fYO5"],{emojiName:t.emojiName,soundName:t.name});return(0,p.jsx)(aO.dT,{onClick:n,text:s,children:(0,p.jsx)(l,{size:"md",color:"currentColor",className:aL.wg})})}function aP(e){let{sound:t,isGlobal:n,onSelect:i}=e,l=null!=t,s=t?.emojiId,r=t?.emojiName,a=l&&(null!=r||null!=s),o=(0,av._)("SoundboardCustomCallSoundSettingsPreview")?aN.L:aA.H;return(0,p.jsxs)("div",{className:aL.D6,children:[(0,p.jsxs)("div",{className:aL.kL,children:[a&&(0,p.jsx)(tG.A,{emojiId:s,emojiName:r,className:aL.Zg}),(0,p.jsx)(n4.E,{variant:"text-md/normal",color:"text-strong",className:aL.dj,children:null==t?V.intl.string(V.t.PoWNfe):n?V.intl.format(V.t.B6HU6O,{soundName:t.name,subtextHook:function(e){return(0,p.jsx)(n4.E,{variant:"text-xs/medium",color:"text-default",tag:"span",children:e})}}):t.name}),l?(0,p.jsx)(aD,{sound:t}):(0,p.jsx)(o,{size:"md",color:"currentColor",className:aL.Gk})]}),(0,p.jsxs)("div",{className:aL.kL,children:[(0,p.jsx)(aR,{onSelect:i}),l&&!n&&(0,p.jsx)(aO.dT,{onClick:()=>i(null),text:V.intl.string(V.t.jmtcGA),children:(0,p.jsx)(lc.TrashIcon,{size:"md",color:n1.A.unsafe_rawColors.RED_400.css,className:aL.Wo})})]})]})}var aG=n(617617);n(980504);var aM=n(806050);function aU(e){return(0,_.bG)([ax.A],()=>{if(null==e)return null;let{guildId:t,soundId:n}=e;return ax.A.getSound("0"===t?"0":t,n)})}function aV(e){let{guildId:t}=e,n=(0,_.bG)([aG.A],()=>aG.A.settings.guilds?.guilds?.[t]?.joinSound),i=aU(n);if(null==n||null==i)return null;let{emojiId:l,emojiName:s}=i,r=null!=l||null!=s;return(0,p.jsxs)("div",{className:aM.Io,children:[r?(0,p.jsx)(tG.A,{emojiId:l,emojiName:s,className:aM.nW}):(0,p.jsx)(aA.H,{size:"md",color:"currentColor",className:aM.nW}),(0,p.jsx)(n4.E,{className:aM.dK,variant:"text-xs/medium",children:i.name})]})}let ak=(0,h.E2)(S.X.ENTRANCE_SOUNDS_SETTING,{useSearchTerms:()=>[V.intl.string(V.t.nzUc3B)],Component:function(){let{analyticsLocations:e}=(0,eX.Ay)(),[t,n]=f.useState("0"),i=(0,ap.mz)(t),l=aU(i),s=i?.type===ap.PP.GLOBAL,r=(0,_.bG)([ax.A],()=>ax.A.hasFetchedAllSounds())&&null!=i&&null==l;f.useEffect(()=>{r&&(0,aT.ND)({location:e})},[r,e]),f.useEffect(()=>{(0,aS.E7)()},[]);let a=f.useCallback((e,t)=>{let{inDropdown:n}=t;return null==e?null:n?(0,p.jsx)(aV,{guildId:e.value}):null},[]);return(0,p.jsxs)(n3.n,{label:V.intl.string(V.t.nzUc3B),description:V.intl.format(V.t.u9RWmv,{helpdeskArticle:eb.A.getArticleURL(I.MVz.SOUNDBOARD)}),children:[(0,p.jsx)(aE.A,{guildId:t,className:aM.Dt,globalOption:{label:V.intl.string(V.t["CpEUP/"]),value:"0"},onChange:e=>{n(null==e?"0":e.id)},renderOptionSuffix:a,hideDivider:!0}),(0,p.jsxs)(ah.A,{title:V.intl.format(V.t.I2TsYN,{nitroWheelHook:()=>(0,p.jsx)(am.t,{size:"md",color:"currentColor",className:aM.ax})}),children:[(0,p.jsx)(aP,{sound:l,isGlobal:s,onSelect:n=>{null==n?(0,aT.Dv)(t,e):(0,aT.un)(t,n,e)}}),r&&(0,p.jsx)("div",{className:aM.lm,children:(0,p.jsx)(iK.w,{type:"warning",message:V.intl.string(V.t.WkPsFR),role:"status"})})]})]})}});var aw=n(824744);let aF=(0,h.sN)(S.X.SOUNDBOARD_VOLUME_SETTING,{useTitle:()=>V.intl.string(V.t.kbFsAD),useSubtitle:()=>V.intl.format(V.t.BPbGq7,{helpCenterArticle:eb.A.getArticleURL(I.MVz.SOUNDBOARD)}),setValue:function(e){let t=[tk.A.USER_SETTINGS_VOICE_AND_VIDEO],n=(0,aw.w)(e);(0,aS.iy)(n,t)},minValue:0,maxValue:100,getInitialValue:function(){let e=(0,aT.wH)();return(0,aw.M)(e)},onValueRender:function(e){return`${e.toFixed(0)}%`}});var aB=n(864145);let az=(0,h.sN)(S.X.SOUNDMOJI_VOLUME_SETTING,{useTitle:()=>V.intl.string(V.t["2JbvKw"]),useSubtitle:()=>V.intl.string(V.t.INenzY),setValue:function(e){let t=(0,aw.w)(e);U.HO.updateSetting(t)},minValue:0,maxValue:100,getInitialValue:function(){let e=U.HO.getSetting();return(0,aw.M)(e)},onValueRender:function(e){return`${e.toFixed(0)}%`},usePredicate:function(){return(0,aB.X)({location:"SoundmojiVolumeSetting"})}}),aX=(0,h.zZ)(S.X.SOUNDBOARD_CATEGORY,{useTitle:()=>V.intl.string(V.t.ABjMWI),buildLayout:()=>[aF,az,ak]});var aY=n(803224),aH=n(552122);let aW=(0,h.E2)(S.X.SOUNDS_HOLIDAY_NOTICE,{useSearchTerms:()=>[V.intl.string(V.t.fgSHf8)],usePredicate:()=>null!=aH.A.useHolidaySoundpack(),Component:()=>(0,p.jsx)(n4.E,{variant:"text-md/normal",color:"text-subtle",children:V.intl.format(V.t.Eup6Wv,{onClick:()=>(0,na.openUserSettings)(S.X.NOTIFICATIONS_SOUNDS_CATEGORY)})})}),aK=(0,h.AK)(S.X.VOICE_AND_VIDEO_TO_NOTIFICATION_SOUNDS_NAVIGATOR,{useSubtitle:()=>V.intl.string(V.t.eyGEE4),useSearchTerms:()=>[V.intl.string(V.t.eyGEE4)],destinationKey:S.X.NOTIFICATIONS_SOUNDS_CATEGORY}),aZ=(0,h.gN)(S.X.VOICE_AND_VIDEO_SOUNDS_RELATED_SETTINGS,{buildLayout:()=>[aK]});var aq=n(264686);let aQ=(0,eN.D)(()=>({currentPlayingSound:null}));function aJ(){let e=aQ.getField("currentPlayingSound");e?.stop(),aQ.setState({currentPlayingSound:null})}function a$(e){let t=aQ.getField("currentPlayingSound");t?.stop();let n=(0,ie.Ak)(e);aQ.setState({currentPlayingSound:n})}function a0(e){return(0,h.zD)(`${S.X.SOUNDS_LIST_ITEM_PREFIX}${e.sound}`,{useTitle:e.useTitle,useSubtitle:()=>V.intl.format(V.t.OOiGCM,{onClick:()=>a$(e.sound)}),useSearchTerms:e.useSearchTerms,useValue:()=>{let t=(0,_.bG)([aY.A],()=>aY.A.isSoundDisabled(e.sound)),n=e.useDisabled?.();return!t&&!n},setValue:t=>{let n=aY.A.getDisabledSounds().filter(t=>t!==e.sound);t||n.push(e.sound),aq.default.setDisabledSounds(n)},useDisabled:()=>{let t=e.useDisabled?.(),n=(0,_.bG)([aY.A],()=>aY.A.getDisableAllSounds());return t||n},useDisabledMessage:e.useDisabledMessage})}let a1=[{useTitle:()=>V.intl.string(V.t.hK51Yg),sound:"deafen"},{useTitle:()=>V.intl.string(V.t.XiejaJ),sound:"undeafen"},{useTitle:()=>V.intl.string(V.t.w4m945),sound:"mute"},{useTitle:()=>V.intl.string(V.t.YqAjXy),sound:"unmute"},{useTitle:()=>V.intl.string(V.t.JoTq8n),sound:"camera_on"},{useTitle:()=>V.intl.string(V.t["8P6tQ6"]),sound:"camera_off"},{useTitle:()=>V.intl.string(V.t["juL9/L"]),sound:"disconnect"},{useTitle:()=>V.intl.string(V.t.x98vQq),useSearchTerms:()=>[V.intl.string(V.t.Q8gkVL)],sound:"ptt_start"},{useTitle:()=>V.intl.string(V.t["1HjRqC"]),useSearchTerms:()=>[V.intl.string(V.t.Q8gkVL)],sound:"ptt_stop"},{useTitle:()=>V.intl.string(V.t["9JB1Ck"]),sound:"user_join"},{useTitle:()=>V.intl.string(V.t.KUBBNt),sound:"user_leave"},{useTitle:()=>V.intl.string(V.t.EZjqUT),sound:"user_moved"},{useTitle:()=>V.intl.string(V.t.LnNlQh),sound:"call_calling"},{useTitle:()=>V.intl.string(V.t.Nd8P5y),sound:"stream_started"},{useTitle:()=>V.intl.string(V.t["9bYj+G"]),sound:"stream_ended"},{useTitle:()=>V.intl.string(V.t.KccUI1),sound:"stream_user_joined"},{useTitle:()=>V.intl.string(V.t.dsjkiN),sound:"stream_user_left"},{useTitle:()=>V.intl.string(V.t.nFOcf9),sound:"activity_launch"},{useTitle:()=>V.intl.string(V.t["a6lw/u"]),sound:"activity_end"},{useTitle:()=>V.intl.string(V.t.KaFxrY),sound:"activity_user_join"},{useTitle:()=>V.intl.string(V.t.S14z9n),sound:"activity_user_left"},{useTitle:()=>V.intl.string(V.t.CP3DC3),sound:"reconnect"}],a2=(0,h.D1)(S.X.VOICE_AND_VIDEO_SOUNDS_LIST,{collapseAfter:4,useCollapsibleTitle:(e,t)=>e?V.intl.formatToPlainString(V.t["0JYT98"],{count:t}):V.intl.formatToPlainString(V.t.ji1uNt,{count:t}),useCollapsedSubtitle:()=>t_(S.X.VOICE_AND_VIDEO_SOUNDS_LIST,{limit:3}),initialize:function(){return()=>{aJ()}},buildLayout:()=>a1.map(e=>a0(e))}),a3=(0,h.zZ)(S.X.SOUNDS_CATEGORY,{useTitle:()=>V.intl.string(V.t.MKWyKc),useInlineNotice:function(){let e=(0,_.bG)([aY.A],()=>aY.A.getDisableAllSounds());return f.useMemo(()=>{if(e)return{type:T.lT.INLINE_NOTICE,noticeType:"warning",role:"none",text:V.intl.format(V.t.fRvixS,{onClick:()=>(0,na.openUserSettings)(S.X.NOTIFICATIONS_SOUNDS_CATEGORY)})}},[e])},buildLayout:()=>[a2,aW,aZ]}),a4=(0,h.zD)(S.X.STREAMING_SHOW_STREAM_PREVIEWS,{useTitle:()=>V.intl.string(V.t.e3Zz3F),useSubtitle:()=>V.intl.string(V.t.RztTjP),useValue:function(){return!U.uh.useSetting()},setValue:function(e){(0,rE.A)("stream_previews_disabled",!e,U.uh.getSetting(),[tk.A.USER_SETTINGS_VOICE_AND_VIDEO]),U.uh.updateSetting(!e)}}),a5=(0,h.zD)(S.X.STREAMING_ADVANCED_SCREENSHARE,{useTitle:()=>V.intl.string(V.t.GmWk2E),useSearchTerms:()=>[V.intl.string(V.t["Fj/xn1"])],useSubtitle:()=>V.intl.string(V.t["Fj/xn1"]),useValue:function(){return(0,_.bG)([i9.Ay],()=>i9.Ay.getVideoHook())},setValue:lE.default.setVideoHook,usePredicate:function(){return(0,_.bG)([i9.Ay],()=>i9.Ay.supportsVideoHook())}}),a6=(0,h.zD)(S.X.STREAMING_EXPERIMENTAL_SOUNDSHARE,{useTitle:()=>V.intl.string(V.t["4I0qzZ"]),useValue:function(){return(0,_.bG)([i9.Ay],()=>i9.Ay.getExperimentalSoundshare())},setValue:lE.default.setExperimentalSoundshare,usePredicate:function(){return(0,_.bG)([i9.Ay],()=>{let e=i9.Ay.supportsExperimentalSoundshare(),t=i9.Ay.supportsHookSoundshare();return e&&t})}}),a8=(0,h.zD)(S.X.STREAMING_STREAM_ATTENUATION,{useTitle:()=>V.intl.string(V.t["/jwMtn"]),useSubtitle:()=>V.intl.string(V.t.zlA23F),useValue:function(){return(0,_.bG)([i9.Ay],()=>i9.Ay.getSidechainCompression())},setValue:function(e){let t=[tk.A.USER_SETTINGS_VOICE_AND_VIDEO];lE.default.setSidechainCompression(e,{analyticsLocations:t})},usePredicate:function(){return i9.Ay.supports(lw.O5.SIDECHAIN_COMPRESSION)}}),a7=(0,h.sN)(S.X.STREAMING_STREAM_ATTENUATION_STRENGTH,{useTitle:()=>V.intl.string(V.t.fhEzfj),setValue:function(e){let t=[tk.A.USER_SETTINGS_VOICE_AND_VIDEO];lE.default.setSidechainCompressionStrength(e,{analyticsLocations:t})},minValue:1,maxValue:100,getInitialValue:i9.Ay.getSidechainCompressionStrength,usePredicate:function(){let e=(0,_.bG)([i9.Ay],()=>i9.Ay.getSidechainCompression());return i9.Ay.supports(lw.O5.SIDECHAIN_COMPRESSION)&&e}}),a9=(0,h.zD)(S.X.STREAMING_OS_MENU_SCREEN_CAPTURE,{useTitle:()=>V.intl.string(V.t.lt8rRx),useSubtitle:()=>V.intl.string(V.t.ie1mgY),useValue:function(){return(0,_.bG)([i9.Ay],()=>i9.Ay.getUseSystemScreensharePicker())},setValue:function(e){(0,nh.cX)()&&e?(0,n2.A)({title:V.intl.string(V.t["9jf31O"]),subtitle:V.intl.string(V.t.uBd6JW),variant:"primary",onConfirm:()=>{lE.default.setUseSystemScreensharePicker(e),nT.A.app.relaunch()},confirmText:V.intl.string(V.t.BddRzS)}):lE.default.setUseSystemScreensharePicker(e)},usePredicate:function(){return(0,_.bG)([i9.Ay],()=>i9.Ay.supportsSystemScreensharePicker()&&(0,nh.cX)())}}),oe=(0,h.bd)(S.X.STREAMING_ADVANCED_ACCORDION,{useTitle:e=>e?V.intl.string(V.t.qrMyvm):V.intl.string(V.t.LEtTNl),useCollapsedSubtitle:()=>t_(S.X.STREAMING_ADVANCED_ACCORDION),buildLayout:()=>[a8,a7,a9,a6,a5]}),ot=(0,h.zZ)(S.X.STREAMING_CATEGORY,{useTitle:()=>V.intl.string(V.t.KDdjou),buildLayout:()=>[a4,oe]});var on=n(106713);let oi=(0,h.E2)(S.X.VOICE_MICROPHONE_INPUT_SELECT,{useSearchTerms:()=>[],Component:function(){let{showDeviceFormFactorIndicators:e}=on.A.useConfig({location:"MicrophoneInputSelect"});return(0,p.jsx)(sW.U,{label:V.intl.string(V.t.UTM8VP),deviceType:lw.oh.AUDIO_INPUT,location:"UserSettingsVoiceVideo",hideDeviceTypeIcon:!e})}}),ol=(0,h.E2)(S.X.VOICE_SPEAKER_OUTPUT_SELECT,{useSearchTerms:()=>[],Component:function(){let{showDeviceFormFactorIndicators:e}=on.A.useConfig({location:"SpeakerOutputSelect"});return(0,p.jsx)(sW.U,{label:V.intl.string(V.t.xuYQ0n),deviceType:lw.oh.AUDIO_OUTPUT,location:"UserSettingsDevices",hideDeviceTypeIcon:!e})}}),os=(0,h.zC)(S.X.VOICE_INPUT_OUTPUT_DEVICE_SPLIT,{buildLayout:()=>[oi,ol]}),or=(0,h.sN)(S.X.VOICE_INPUT_VOLUME_SETTING,{useTitle:()=>V.intl.string(V.t.Rtsr6w),minValue:0,maxValue:100,getInitialValue:function(){let e=i9.Ay.getInputVolume();return(0,aw.M)(e)},asValueChanges:function(e){let t=[tk.A.USER_SETTINGS_VOICE_AND_VIDEO],n=(0,aw.w)(e);lE.default.setInputVolume(n,{analyticsLocations:t})}}),oa=(0,h.sN)(S.X.VOICE_OUTPUT_VOLUME_SETTING,{useTitle:()=>V.intl.string(V.t.aUJ062),minValue:0,maxValue:200,getInitialValue:function(){let e=i9.Ay.getOutputVolume();return(0,aw.M)(e)},onValueRender:function(e){return`${e.toFixed(0)}%`},asValueChanges:function(e){let t=[tk.A.USER_SETTINGS_VOICE_AND_VIDEO],n=(0,aw.w)(e);lE.default.setOutputVolume(n,{analyticsLocations:t})}}),oo=(0,h.zC)(S.X.VOICE_INPUT_OUTPUT_VOLUME_SPLIT,{buildLayout:()=>[or,oa]});var ou=n(702841),od=n(152567),oc=n(804037);let og=`${eb.A.getArticleURL(I.MVz.VOICE_VIDEO_TROUBLESHOOTING)}?utm_source=discord&utm_medium=blog&utm_campaign=2020-06_help-voice-video&utm_content=--t%3Apm`,om=(0,h.E2)(S.X.VOICE_MICROPHONE_TEST_SETTING,{useSearchTerms:()=>[V.intl.string(V.t.nuFtHH)],usePredicate:function(){return(0,ou.bG)([i9.Ay],()=>i9.Ay.supports(lw.O5.LOOPBACK))},Component:function(){return(0,ou.bG)([i9.Ay],()=>i9.Ay.supports(lw.O5.LOOPBACK))?(0,p.jsx)(od.A,{size:"md",notchBackground:od.V.GRAY,captionVoice:V.intl.string(V.t.bp3JOV),captionNoVoice:(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(n4.E,{variant:"text-xs/semibold",color:"text-default",children:V.intl.string(V.t.bgn75v)}),V.intl.string(V.t["MA+OZh"]),(0,p.jsx)(nr.Anchor,{className:oc.X,href:eb.A.getArticleURL(I.MVz.NO_INPUT_DETECTED),children:V.intl.string(V.t.RYKKox)})]}),helpText:V.intl.format(V.t["V+B3FH"],{guideURL:og}),buttonTest:V.intl.string(V.t.gyljWE),buttonStop:V.intl.string(V.t.I6OnJ3),buttonVariant:"primary",location:{page:I.liQ.USER_SETTINGS,section:I.JJy.SETTINGS_VOICE_AND_VIDEO}}):null}}),oA=e8.isWindows()?["BTHENUM","BTHHFENUM"]:[];function oE(e){let{inputAndOutputAreBluetooth:t,canPromptSystemServiceInstallForVoice:n}=e;return(0,p.jsxs)(q.B,{children:[n&&(0,p.jsx)(ll,{sourcePage:"voice"}),t&&(0,p.jsx)(l9.A,{look:l9.k.WARNING,children:V.intl.string(V.t.Ioz3gx)})]})}let oh=(0,h.zZ)(S.X.VOICE_CATEGORY,{useTitle:()=>V.intl.string(V.t.K3lovD),useSearchTerms:()=>[V.intl.string(V.t.hHMYbb),V.intl.string(V.t.nuFtHH),V.intl.string(V.t.dl18zb),V.intl.string(V.t["3182VD"]),V.intl.string(V.t["DGq/PR"]),V.intl.string(V.t.eATD2B),V.intl.string(V.t.Rtsr6w),V.intl.string(V.t.aUJ062)],useInlineNotice:function(){let e=li("voice"),t=(0,sK.x5)(lw.oh.AUDIO_INPUT),n=(0,sK.x5)(lw.oh.AUDIO_OUTPUT),i=f.useMemo(()=>{let e=oA.some(e=>t?.hardwareId?.startsWith(e)),i=oA.some(e=>n?.hardwareId?.startsWith(e));return e&&i&&t?.containerId!=null&&t.containerId===n?.containerId},[t,n]);return f.useMemo(()=>e.canPrompt||i?{type:T.lT.STRONGLY_DISCOURAGED_CUSTOM,notice:()=>(0,p.jsx)(oE,{inputAndOutputAreBluetooth:i,canPromptSystemServiceInstallForVoice:e.canPrompt})}:null,[e.canPrompt,i])},buildLayout:()=>[os,oo,om]}),oS=(0,h.t_)(S.X.VOICE_AND_VIDEO_PANEL,{useTitle:()=>V.intl.string(V.t.B1fFpf),buildLayout:()=>[oh,ag,s1,ot,a3,aX,ry,rp]}),ox=(0,h.i4)(S.X.VOICE_AND_VIDEO_SIDEBAR_ITEM,{useTitle:()=>V.intl.string(V.t.B1fFpf),usePredicate:()=>i9.Ay.isSupported(),icon:sU.MicrophoneIcon,useMenu:sV.A,buildLayout:()=>[oS]}),oT=(0,h.WI)(S.X.APP_SECTION,{useTitle:()=>V.intl.string(V.t.gcyH1J),buildLayout:()=>[ox,nZ,tt,iY,sM,n$]});var op=n(360669),of=n(643891),o_=n(975807),oI=n(353795),oN=n(534247);function oC(e){let{title:t,children:n,actions:i,graphicSrc:l,graphicLottie:s,footnote:r,size:a="default"}=e,o="compact"===a;return(0,p.jsxs)("div",{className:ic()(oN.kL,{[oN.oE]:o}),children:[(0,p.jsxs)(q.B,{direction:"vertical",align:"start",justify:"center",gap:o?24:16,fullWidth:!1,className:oN.Qs,children:[(0,p.jsxs)(q.B,{direction:"vertical",align:"start",gap:o?12:8,children:[(0,p.jsx)(C.D,{variant:o?"heading-lg/bold":"heading-xl/bold",color:"text-strong",children:t}),n]}),(i.length>0||null!=r)&&(0,p.jsxs)(q.B,{direction:"vertical",align:"start",gap:12,children:[i.length>0&&(0,p.jsx)(q.B,{direction:"horizontal",gap:o?12:16,wrap:!0,fullWidth:!1,children:i.map(e=>(0,p.jsx)(j.$,{variant:"overlay-primary",size:"sm",text:e.text,onClick:e.onClick},String(e.text)))}),null!=r&&(0,p.jsx)(n4.E,{variant:"text-xxs/normal",color:"text-subtle",children:r})]})]}),null!=s?(0,p.jsx)("div",{className:oN.yO,children:(0,p.jsx)(oI.v,{type:"lottie",lottie:s,aspectRatio:"6/4"})}):(0,p.jsx)("img",{src:l,className:oN.fA,alt:""})]})}var ob=n(425565),oy=n(745188),ov=n(936564),oj=n(417792),oO=n(423764),oL=n(289873),oR=n(132500),oD=n(465323),oP=n(37766),oG=n(194261),oM=n(391048),oU=n(277984),oV=n(99696),ok=n(202613),ow=n(615405),oF=n(83617),oB=n(935208),oz=n(607399),oX=n(993077),oY=n(150934),oH=n(256006),oW=n(198970),oK=n(71532);let oZ=/[^0-9/]/g,oq=/[^0-9]/g;class oQ extends f.PureComponent{_inputRef;selectionStart=0;componentDidUpdate(e){let t=this._inputRef;e.value!==this.props.value&&null!=t&&t.setSelectionRange(this.selectionStart,this.selectionStart)}setRef=e=>{let{inputRef:t}=this.props;this._inputRef=e,null!=t&&t(e)};handleChange=(e,t)=>{let n,i,l,s,{value:r,onChange:a}=this.props,o=this._inputRef;if(e===r||null==o||null==r)return;let u=(i=(n=e.replace(oZ,"").split("/"))[0],l=n[1],s=[],parseInt(i,10)>12&&(i=i.substring(0,1)),s.push(i),(parseInt(i,10)>1||2===i.length||null!=l&&""!==l)&&s.push("/"),null!=l&&""!==l&&parseInt(l,10)>99&&(l=(l+"").substring(0,2)),s.push(l),s.join("")),d=o.selectionStart;u===r&&u.length<=3&&r.includes("/")&&!e.includes("/")?u=u.replace(oq,""):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,p.jsx)(lp.k,{...this.props,inputMode:"numeric",onChange:this.handleChange,inputRef:this.setRef})}}var oJ=n(832208),o$=n(782328);let o0=[{fields:[{expirationDate:{name:"expirationDate",id:(0,tK.Ld)(),title:()=>V.intl.string(V.t["CeBa/4"]),autoComplete:"cc-exp",placeholder:()=>V.intl.string(V.t.xeEWQ6),pattern:"\\d*",getClassNameForLayout:()=>o$.ep,renderInput:e=>(0,p.jsx)(oQ,{...e})}}.expirationDate]}],o1=function(e){let{onCardInfoChange:t,className:n,expirationDate:i,error:l}=e,[s,r]=f.useState(!1),[a,o]=f.useState(null),[u,d]=f.useState(i);return f.useEffect(()=>{t({expirationDate:u},null===a)},[u,t,a]),(0,p.jsx)(oJ.A,{className:n,form:o0,values:{expirationDate:u},errors:null!=a?{expirationDate:a}:{},formError:l,onFieldChange:function(e){s||""===e||r(!0),s&&""===e||!(0,oK.So)(e)?o(V.intl.string(V.t["9/zZdl"])):o(null),d(e)}})};var o2=n(219887),o3=n(292856);let o4="isDefault";class o5 extends f.PureComponent{static defaultProps={onDelete:()=>{},onSubmit:()=>{},onCancel:()=>{}};constructor(e){super(e);const{paymentSource:t,isDefault:n}=e,i=t.billingAddress;this.state={billingAddress:{name:i.name??"",line1:i.line1??"",line2:i.line2??"",country:i.country??"",state:i.state??"",city:i.city??"",postalCode:i.postalCode??""},expiresMonth:t instanceof ok.YS?t.expiresMonth:void 0,expiresYear:t instanceof ok.YS?t.expiresYear:void 0,billingAddressValid:!1,isDefault:n,expirationValid:!0,dirtyFields:{}}}componentWillUnmount(){(0,oU.ey)(),(0,oU.tc)()}handleSubmit=e=>{if(e.preventDefault(),e.stopPropagation(),0===Object.values(this.state.dirtyFields).filter(io.Vq).length)this.props.onCancel();else{let{billingAddress:e,isDefault:t,expiresMonth:n,expiresYear:i}=this.state;this.props.onSubmit(this.props.paymentSource.id,{billingAddress:e,expiresMonth:n,expiresYear:i,isDefault:t})}};handleCancel=()=>{this.props.onCancel()};handleDelete=()=>{let{onDelete:e,paymentSource:t}=this.props;e(t.id)};handleAddressUpdate=(e,t,n)=>{this.setState({billingAddress:e,billingAddressValid:t,dirtyFields:{...this.state.dirtyFields,billingAddress:n}})};handleExpirationDateUpdate=(e,t)=>{let{expirationDate:n}=e;if(this.setState({expirationValid:t}),null==n||""===n)return;let[i,l]=n.split("/");this.handleFieldChange(Number(i),"expiresMonth"),this.handleFieldChange(Number(`${new Date().getFullYear().toString().slice(0,2)}${l}`),"expiresYear")};handleFieldChange=(e,t)=>{null!=t&&this.setState({[t]:e,dirtyFields:{...this.state.dirtyFields,[t]:!0}})};renderError(){let{updateError:e,removeError:t}=this.props;return null==e||e.hasCardError()||e.hasAddressError()?null!=t?(0,p.jsx)("div",{className:o3.zc,children:(0,p.jsx)(iK.w,{type:"critical",message:t.message,role:"alert"})}):null:(0,p.jsx)("div",{className:o3.zc,children:(0,p.jsx)(iK.w,{type:"critical",message:e.message,role:"alert"})})}renderBillingAddressSection(){let{billingAddress:e}=this.state,{updateError:t,paymentSource:n}=this.props,i=(0,oH.g)(n);return(0,p.jsxs)("div",{className:o3.yV,children:[(0,p.jsx)(n4.E,{className:o3.bV,variant:"text-sm/normal",children:V.intl.string(V.t["50Auo2"])}),(0,p.jsx)(oW.Ay,{...e,mode:oW.Ay.Modes.EDIT,layout:i,onBillingAddressChange:this.handleAddressUpdate,error:t})]})}renderCardExpirationSection(){let{expiresMonth:e,expiresYear:t}=this.state;if(null==e||null==t)return null;let n=`${e.toString().padStart(2,"0")}/${t.toString().padStart(2,"0").slice(-2)}`;return(0,p.jsxs)("div",{className:o3.yV,children:[(0,p.jsx)(n4.E,{className:o3.bV,variant:"text-sm/normal",children:V.intl.string(V.t.Fo2YP7)}),(0,p.jsx)(o1,{expirationDate:n,onCardInfoChange:this.handleExpirationDateUpdate,error:this.props.updateError})]})}renderActions(){let{submitting:e,removing:t,isForSubscription:n}=this.props,{billingAddressValid:i,expirationValid:l}=this.state;return(0,p.jsx)("div",{className:o3.AU,children:(0,p.jsxs)(q.B,{direction:"horizontal",justify:"space-between",children:[(0,p.jsx)(s8.e,{children:(0,p.jsxs)("div",{className:o3.lH,children:[n?(0,p.jsx)(lg.m,{text:V.intl.string(V.t["v6/z28"]),children:(0,p.jsx)("div",{"aria-hidden":!0,className:o3.dm})}):null,(0,p.jsx)(j.$,{type:"button",disabled:n||e,loading:t,onClick:this.handleDelete,variant:"critical-secondary",size:oz.Fr?"sm":"md",text:oz.Fr?V.intl.string(V.t.oyYWHE):V.intl.string(V.t.yk5qfb)})]})}),(0,p.jsxs)(s8.e,{children:[(0,p.jsx)(j.$,{type:"button",disabled:e||t,onClick:this.handleCancel,variant:"secondary",size:oz.Fr?"sm":"md",text:V.intl.string(V.t["ETE/oC"])}),(0,p.jsx)(j.$,{loading:e,disabled:!i||t||!l,type:"submit",variant:"active",size:oz.Fr?"sm":"md",text:V.intl.string(V.t["R3BPH+"])})]})]})})}render(){let{paymentSource:e,isDefault:t,locale:n,className:i,isForSubscription:l}=this.props,{isDefault:s}=this.state,r=e instanceof ok.SJ;return(0,p.jsx)(oX.Z,{editable:!0,className:ic()(o3.Nr,i),children:(0,p.jsxs)("form",{onSubmit:this.handleSubmit,noValidate:!0,children:[this.renderError(),(0,p.jsxs)("div",{className:o3.__invalid_paymentSection,children:[(0,p.jsx)(o2.A,{paymentSource:e,isDefault:t,isForSubscription:l,locale:n,showLabels:!0,showPaymentSourceIcon:!0}),e.invalid?(0,p.jsx)("div",{className:o3.Um,children:V.intl.string(V.t["3R0U0b"])}):null,(0,p.jsx)("div",{className:o3.Sv,children:r?V.intl.format(V.t.w9WkBl,{paypalURL:"https://www.paypal.com"}):V.intl.string(V.t.VXndyr)})]}),this.renderCardExpirationSection(),this.renderBillingAddressSection(),(0,p.jsx)("div",{className:o3.D5,children:(0,p.jsx)(oY.S,{value:o4,checked:s,onChange:e=>this.handleFieldChange(e,o4),label:V.intl.string(V.t.nag9Og),labelType:"secondary"})}),(0,p.jsx)(ls.c,{}),this.renderActions()]})})}}let o6=_.Ay.connectStores([ow.A],()=>({updateError:ow.A.editSourceError,removeError:ow.A.removeSourceError}))(o5);var o8=n(986485),o7=n(849405),o9=n(329693);function ue(){(0,oV.HF)({withRedemptionSuccessModal:!0,source:"desktop_billing_page",loadId:(0,oR.A)()})}class ut extends f.PureComponent{static defaultProps={isEditing:!1,hideDivider:!1,onEditClick:()=>{}};handleEditClick=()=>{this.props.onEditClick(this.props.paymentSource.id)};render(){let{paymentSource:e,isDefault:t,isEditing:n,hideDivider:i,isForSubscription:l,locale:s,removing:r,submitting:a,onSubmit:o,onCancel:u,onDelete:d}=this.props;return n?(0,p.jsx)(o6,{paymentSource:e,isDefault:t,removing:r,submitting:a,locale:s,isForSubscription:l,onSubmit:o,onCancel:u,onDelete:d}):(0,p.jsxs)(p.Fragment,{children:[i?null:(0,p.jsx)(ls.c,{className:o9.__invalid_sourceDivider}),(0,p.jsxs)("div",{className:o9.Yb,children:[(0,p.jsx)(o2.A,{paymentSource:e,isDefault:t,isForSubscription:l,locale:s,showSubtext:!0,showLabels:!0,showPaymentSourceIcon:!0}),(0,p.jsx)(j.$,{variant:"secondary",onClick:this.handleEditClick,size:"sm",text:V.intl.string(V.t.bt75uw)})]})]})}}let un=f.memo(function(e){let{paymentSource:t,hideDivider:n,isForSubscription:i,locale:l,onRedeemClick:s}=e,[r,a]=f.useState(null),o=(0,_.bG)([sx.default],()=>sx.default.getCurrentUser()?.storeCountry?.country??null),u=(0,_.bG)([ow.A],()=>ow.A.ipCountryCode),d=f.useMemo(()=>(0,oD.TW)(`-${o??u??"US"}`),[o,u]);return f.useEffect(()=>{void 0===t?a({amount:0,currency:d}):oU.YP(t.id).then(e=>{a(e)})},[t,d]),(0,p.jsxs)(p.Fragment,{children:[n?null:(0,p.jsx)(ls.c,{className:o9.__invalid_sourceDivider}),(0,p.jsxs)("div",{className:o9.Yb,children:[void 0!==t?(0,p.jsx)(o2.A,{paymentSource:t,isDefault:!1,isForSubscription:i,locale:l,showSubtext:!1,showLabels:!1,showPaymentSourceIcon:!0}):(0,p.jsxs)(lN.A,{align:lN.A.Align.CENTER,children:[(0,p.jsx)(oP._,{size:"lg"}),(0,p.jsx)(n4.E,{variant:"text-sm/medium",className:o7.Wi,children:V.intl.string(o8.default["/FQWfA"])})]}),(0,p.jsxs)("div",{className:o9.zy,children:[(0,p.jsx)("div",{className:o9.Tq,children:null==r?(0,p.jsx)(oL.y,{type:oL.y.Type.SPINNING_CIRCLE}):(0,p.jsx)(n4.E,{variant:"text-sm/medium",children:function(){let{amount:e,currency:t}=r??{},n=t??d,i=(0,oD.$g)(e??0,n,l,{currencyDisplay:"narrowSymbol"});return`${String(n).toUpperCase()} ${i}`}()})}),(0,p.jsx)(j.$,{variant:"secondary",onClick:s,size:"sm",text:V.intl.string(o8.default.hnRau6)})]})]})]})});class ui extends f.PureComponent{state={editingPayment:null};handleEditClick=async e=>{try{await oU.Gr(e),this.setState({editingPayment:e})}catch(e){}};handleCancel=()=>{this.setState({editingPayment:null})};handleDelete=async e=>{try{await oU.JQ(e),this.setState({editingPayment:null})}catch(e){}};handleSubmit=async(e,t)=>{if(null!=e)try{await oU.Ps(e,t),this.setState({editingPayment:null})}catch(e){}};handlePaymentSourceAdded=async e=>{await (0,oF.c_)(e.id)};handleAddPaymentMethod=()=>{(0,lT.openModalLazy)(async()=>{let{default:e}=await Promise.resolve().then(n.bind(n,362111));return t=>(0,p.jsx)(e,{...t,onAddPaymentSource:this.handlePaymentSourceAdded})},{onCloseCallback:()=>{(0,oM.ET)()}})};renderFooter(){let{paymentSources:e}=this.props;return(0,p.jsxs)("div",{className:o9.qr,children:[0===Object.keys(e).length?(0,p.jsxs)("div",{className:o9.z8,children:[(0,p.jsx)(n4.E,{variant:"text-sm/normal",children:V.intl.string(V.t.aRHpAB)}),(0,p.jsx)(n4.E,{variant:"text-sm/normal",color:"text-subtle",className:o9.Sv,children:V.intl.string(V.t.o9bOIl)})]}):null,(0,p.jsx)(j.$,{onClick:this.handleAddPaymentMethod,text:V.intl.string(V.t.CpOiEO)})]})}render(){let e,{showHeader:t,defaultPaymentSourceId:n,paymentSources:i,locale:l,removing:s,submitting:r,premiumSubscriptionPaymentSourceId:a,showGiftCards:o}=this.props,u=K().values(i).sort((e,t)=>e.id===n?-1:t.id===n?1:oB.default.compare(e.id,t.id)),d=u.filter(e=>!(e instanceof ok.LQ)),c=u.filter(e=>e instanceof ok.LQ),g=this.state.editingPayment,m=d.findIndex(e=>e.id===g),A=d.map((e,t)=>(0,p.jsx)(ut,{locale:l,paymentSource:e,isDefault:n===e.id,onCancel:this.handleCancel,onDelete:this.handleDelete,isForSubscription:e.id===a,hideDivider:0===t||m===t-1,onSubmit:this.handleSubmit,submitting:r,removing:s,isEditing:g===e.id,onEditClick:this.handleEditClick},e.id));return e=c.length>0?c.map((e,t)=>(0,p.jsx)(un,{paymentSource:e,hideDivider:0===d.length||m===d.length-1,isForSubscription:e.id===a,locale:l,onRedeemClick:ue},e.id)):(0,p.jsx)(un,{hideDivider:0===d.length||m===d.length-1,isForSubscription:!1,locale:l,onRedeemClick:ue}),(0,p.jsxs)(p.Fragment,{children:[t?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(C.D,{variant:"heading-lg/semibold",children:[(0,p.jsx)(oG.LockIcon,{size:"sm",className:o9.hz})," ",V.intl.string(V.t.W26xGQ)]}),(0,p.jsx)(n4.E,{variant:"text-sm/normal",color:"text-subtle",children:V.intl.string(V.t.h6V3uK)})]}):null,A,o&&e,m!==d.length-1||o&&c.length>0?(0,p.jsx)(ls.c,{}):null,this.renderFooter()]})}}var ul=n(459357),us=n(295405),ur=n(166403),ua=n(773669),uo=n(943009);function uu(){let e=(0,_.bG)([sx.default],()=>sx.default.getCurrentUser()?.storeCountry);return e?.country==null?null:{country:e.country,countryName:(0,oO.Gw)(e.country)}}let ud=(0,h.E2)(S.X.BILLING_PAYMENT_METHODS,{Component:function(e){let{showHeader:t=!1}=e,n=(0,_.bG)([ow.A],()=>ow.A.isSyncing),i=(0,_.bG)([us.A],()=>us.A.paymentSources),l=(0,_.bG)([us.A],()=>us.A.defaultPaymentSourceId),s=(0,_.bG)([ua.default],()=>ua.default.locale),r=(0,_.bG)([ur.A],()=>ur.A.getPremiumTypeSubscription()),a=(0,_.bG)([ow.A],()=>ow.A.isRemovingPaymentSource),o=(0,_.bG)([ow.A],()=>ow.A.isUpdatingPaymentSource),{enabled:u}=(0,ul.c)({location:"UserSettingsBilling"});return(f.useEffect(()=>{oU.$o(),oU.hP()},[]),n&&0===Object.keys(i).length)?(0,p.jsx)("div",{className:uo.o,children:(0,p.jsx)(oL.y,{})}):(0,p.jsx)(ui,{showHeader:t,paymentSources:i,defaultPaymentSourceId:l,premiumSubscriptionPaymentSourceId:null!=r&&r.status!==I.Dmq.CANCELED?r.paymentSourceId:null,locale:s,removing:a,submitting:o,showGiftCards:u})},useSearchTerms:()=>[V.intl.string(V.t.W26xGQ),V.intl.string(V.t["3pIjBH"])]}),uc=(0,h.E2)(S.X.BILLING_GIFT_CARDS_MARKETING_BANNER,{Component:function(){let e=f.useMemo(()=>[{text:V.intl.string(oy.default["6bWeWP"]),onClick:()=>(0,o_.A)(ob.C)},{text:V.intl.string(oy.default.xYa9Y8),onClick:()=>(0,o_.A)(eb.A.getArticleURL(I.MVz.BUY_GIFT_CARDS))}],[]);return(0,p.jsx)("div",{className:ov.k,children:(0,p.jsx)(oC,{title:V.intl.string(oy.default.w8gzZb),graphicSrc:"https://cdn.discordapp.com/assets/content/ee0bcc3ecc6d909365f70b4692752f0ac9c8a2e49c47afac16e7dbd31efe360f.png",actions:e,children:(0,p.jsx)(n4.E,{variant:"text-md/medium",color:"text-muted",children:V.intl.string(oy.default.qtKobx)})})})},useSearchTerms:()=>[],usePredicate:()=>(0,oj.y)({location:"BillingMarketingBanner",countGiftCardWallet:!1,canFetchPaymentSources:!1})}),ug=(0,h.zZ)(S.X.BILLING_PAYMENT_METHODS_CATEGORY,{useTitle:()=>V.intl.string(V.t.W26xGQ),useSubtitle:()=>{let e=uu();return null!=e?V.intl.format(V.t.e2t1G5,{country:e.countryName}):V.intl.string(V.t.h6V3uK)},useSubtitleDecoration:function(){return null==uu()?null:{type:T.p3.INFO_POPOVER,ariaLabel:V.intl.string(V.t.PuB1W7),popoverProps:{title:"",body:V.intl.string(V.t["21skUa"]),size:"sm",position:"top",getActions:e=>[{text:V.intl.string(V.t.PuB1W7),variant:"primary",onClick:()=>{window.open("https://support.discord.com/hc/articles/39799791912087","_blank"),e()}}]}}},buildLayout:()=>[ud,uc]});var um=n(837381),uA=n(689175),uE=n(928039),uh=n(921853),uS=n(22306);function ux(e){let{currentPageIndex:t,numPages:n,onChangePage:i,children:l,showPageCount:s=!0,ref:r,...a}=e,o=t>=n-1,u=s?V.intl.format(V.t.MtpIwg,{currentPage:t+1,numPages:n}):V.intl.format(V.t.bKI77c,{currentPage:t+1});return(0,p.jsxs)("div",{ref:r,...a,children:[l,(0,p.jsx)("div",{className:uS.v,children:(0,p.jsxs)("div",{className:uS.U,children:[(0,p.jsx)(ld.K,{variant:"icon-only",icon:uh.n,disabled:t<=0,onClick:()=>i(t-1),"aria-label":V.intl.string(V.t.vgfxaA)}),(0,p.jsx)(n4.E,{variant:"text-sm/medium",children:u}),(0,p.jsx)(ld.K,{variant:"icon-only",icon:n8._,disabled:o,onClick:()=>i(t+1),"aria-label":V.intl.string(V.t.XiOHRX)})]})})]})}var uT=n(32731);n(938796);var up=n(334279),uf=n(122817),u_=n(665260),uI=n(315069),uN=n(557009),uC=n(570221),ub=n(243217);class uy extends uI.A{id;createdAt;currency;tax;taxInclusive;amount;amountRefunded;status;description;hasInvoiceURL;hasRefundInvoiceURLs;downloadableInvoice;downloadableRefundInvoices;flags;paymentSource;paymentGateway;subscription;skuId;skuPrice;sku;premiumRefundDisqualificationReasons;entitlements;invoice;static createFromServer(e){let t=null!=e.payment_source?ok.Ay.createFromServer(e.payment_source):null,n=null!=e.sku?uT.A.createFromServer(e.sku):null,i=null!=e.subscription?ub.A.createFromServer(e.subscription):null;return new uy({id:e.id,createdAt:new Date(e.created_at),currency:e.currency,tax:e.tax,taxInclusive:e.tax_inclusive,amount:e.amount,amountRefunded:e.amount_refunded,status:e.status,metadata:e.metadata,description:e.description,paymentSource:t,paymentGateway:e.payment_gateway,flags:e.flags,subscription:i,skuId:e.sku_id,skuPrice:e.sku_price,sku:n,downloadableInvoice:e.downloadable_invoice,downloadableRefundInvoices:e.downloadable_refund_invoices,hasInvoiceURL:e.has_invoice_url,hasRefundInvoiceURLs:e.has_refund_invoice_urls,premiumRefundDisqualificationReasons:e.premium_refund_disqualification_reasons,entitlements:null!=e.entitlements?e.entitlements.map(e=>uN.A.createFromServer(e)):void 0,invoice:null!=e.invoice?uC.Y.createFromServer(e.invoice):null})}constructor(e){super(),this.id=e.id,this.amount=e.amount,this.amountRefunded=e.amountRefunded,this.createdAt=e.createdAt,this.currency=e.currency,this.description=e.description,this.paymentSource=e.paymentSource,this.paymentGateway=e.paymentGateway,this.status=e.status,this.tax=e.tax,this.taxInclusive=e.taxInclusive,this.subscription=e.subscription,this.skuId=e.skuId,this.skuPrice=e.skuPrice,this.sku=e.sku,this.flags=e.flags,this.downloadableInvoice=e.downloadableInvoice,this.downloadableRefundInvoices=e.downloadableRefundInvoices,this.hasInvoiceURL=e.hasInvoiceURL,this.hasRefundInvoiceURLs=e.hasRefundInvoiceURLs,this.premiumRefundDisqualificationReasons=e.premiumRefundDisqualificationReasons,this.entitlements=e.entitlements,this.invoice=e.invoice}get isPurchasedViaApple(){return this.paymentGateway===I.kM_.APPLE}get isPurchasedViaGoogle(){return this.paymentGateway===I.kM_.GOOGLE}get isPurchasedExternally(){return this.isPurchasedViaApple||this.isPurchasedViaGoogle}get isSubscription(){return null!=this.subscription}get isPremiumSubscription(){return null!=this.subscription&&tJ.JM.has(this.subscription.planId)}get isPremiumGuildSubscription(){return null!=this.subscription&&null!=this.subscription.additionalPlans.find(e=>{let{planId:t}=e;return tJ.pW.has(t)})}get isGift(){return u_.Lt(this.flags,1)}get isPremiumGift(){return this.isGift&&null!=this.skuId&&Object.values(tJ.pe).includes(this.skuId)}get isGuildProductPurchase(){return null!=this.sku&&(this.sku.productLine===I.EZt.GUILD_PRODUCT||u_.Lt(this.sku.flags,uf.d.GUILD_PRODUCT))}get isSoftDeletedProduct(){return this.sku?.deleted===!0}get isCollectible(){return null!=this.sku&&this.sku.productLine===I.EZt.COLLECTIBLES}get isFractionalPremium(){return null!=this.skuId&&up.I.ALL.has(this.skuId)}get isShopPurchase(){return this.isCollectible||this.isFractionalPremium}}var uv=((i={})[i.PENDING=1]="PENDING",i[i.PAID=2]="PAID",i[i.FAILED=3]="FAILED",i[i.CANCELED=4]="CANCELED",i[i.PARTIALLY_REFUNDED=5]="PARTIALLY_REFUNDED",i[i.REFUNDED=6]="REFUNDED",i[i.REVERSED=7]="REVERSED",i),uj=((l={})[l.NITRO=1]="NITRO",l[l.NITRO_BASIC=2]="NITRO_BASIC",l[l.SHOP=3]="SHOP",l[l.APPLICATION=4]="APPLICATION",l[l.PRODUCT=5]="PRODUCT",l),uO=((s={})[s.PARTIALLY_REFUNDED=1]="PARTIALLY_REFUNDED",s[s.REFUNDED=2]="REFUNDED",s[s.REVERSED=3]="REVERSED",s),uL=((r={})[r.PREMIUM=1]="PREMIUM",r[r.GIFT=2]="GIFT",r[r.APPLICATION=3]="APPLICATION",r[r.COLLECTIBLE=4]="COLLECTIBLE",r[r.IN_GAME_ITEM=5]="IN_GAME_ITEM",r),uR=((a={})[a.CLAIMED=1]="CLAIMED",a[a.UNCLAIMED=2]="UNCLAIMED",a[a.REDEEMED=3]="REDEEMED",a[a.FAILED=4]="FAILED",a[a.UNREDEEMED=5]="UNREDEEMED",a[a.REFUNDED=6]="REFUNDED",a);function uD(e){let t=e.payments.map(e=>({...e,payment_source:null!=e.payment_source?ok.Ay.createFromServer(e.payment_source):null})),n=t.find(t=>t.id===e.id);return{...e,sku:null!=e.sku?uT.A.createFromServer(e.sku):null,payments:t,receipt_payment:new uy({id:e.id,status:n?.status,paymentSource:n?.payment_source,hasInvoiceURL:e.has_invoice_url,hasRefundInvoiceURLs:e.has_refund_invoice_urls})}}let uP={receipts:[],cursor:null};var uG=n(34188),uM=n(597770),uU=n(206828),uV=n(576243),uk=n(147925),uw=n(707554),uF=n(957565),uB=n(250627),uz=n(871109),uX=n(571654),uY=n(411342),uH=n(179499),uW=n(741231),uK=n(95035),uZ=n(317525),uq=n(460103);function uQ(e){let{description:t,detail:n}=e;return(0,p.jsx)("li",{className:uq.Iu,children:(0,p.jsxs)(lN.A,{justify:lN.A.Justify.BETWEEN,children:[(0,p.jsx)("div",{children:t}),(0,p.jsx)("div",{children:n})]})})}function uJ(e){let{guildId:t,guildProductListingId:n}=e,i=(0,uB.Qi)(t,n,{requireCurrentGuild:!1}),l=(0,uX.z)(i),s=(0,_.bG)([lv.A],()=>lv.A.getGuild(t)),r=i?.role_id!=null&&i?.attachments_count===0?V.intl.string(V.t.H11qcT):l,a=f.useCallback(async()=>{s?.features.has(I.GuildFeatures.PRODUCTS_AVAILABLE_FOR_PURCHASE)?await (0,uW.A)(I.BVt.GUILD_PRODUCT(t,n)):await (0,uW.A)(I.BVt.CHANNEL(t)),(0,tY.default)()},[s,t,n]);return(0,p.jsxs)(p.Fragment,{children:[null!=r&&(0,p.jsx)(uQ,{description:V.intl.string(V.t.lXPbJb),detail:r}),null!=s&&(0,p.jsx)(uQ,{description:V.intl.string(V.t.Wpn8z8),detail:(0,p.jsx)(uK.A,{onClick:a,children:s.name})})]})}function u$(e){let{guildId:t,guildProductListingId:n}=e,i=(0,uB.Qi)(t,n,{requireCurrentGuild:!1}),l=(0,_.bG)([uz.A],()=>uz.A.getGuildProductFetchState(n)===uz.e.FETCHING),s=i?.role_id,r=(0,_.bG)([uZ.A],()=>null!=s?uZ.A.getRole(t,s):void 0,[t,s]),a=(0,uH.A)({guildId:t,productId:n}),o=(i?.attachments?.length??0)>0,u=null!=r;return l?(0,p.jsx)("div",{className:uq.hT,children:(0,p.jsx)(oL.y,{})}):null!=i&&(o||u)?(0,p.jsxs)("div",{className:uq.hT,children:[o&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(n4.E,{variant:"text-xs/semibold",color:"text-default",className:uq.yE,children:V.intl.string(V.t.hxawoy)}),(0,p.jsx)(j.$,{...a})]}),u&&(0,p.jsxs)(p.Fragment,{children:[o&&(0,p.jsx)("div",{className:uq.yF}),(0,p.jsx)(n4.E,{variant:"text-xs/semibold",color:"text-default",className:uq.yE,children:V.intl.string(V.t.gWBNet)}),(0,p.jsx)(uY.A,{role:r})]})]}):null}let u0=function(e,t){(0,lT.openModalLazy)(async()=>{let{default:i}=await n.e("234138").then(n.bind(n,206049));return n=>(0,p.jsx)(i,{payment:e,paymentSource:t,...n})})};var u1=n(818348);async function u2(e){try{return(await tl.Bo.get({url:I.Rsh.BILLING_INVOICE_BREAKDOWN,query:{payment_id:e},oldFormErrors:!0,rejectWithError:!1})).body}catch(e){throw e}}function u3(e){let{payment:t}=e,[n,i]=f.useState(null),[l,s]=f.useState(null);async function r(e){try{let n=await u2(t.id);i(n);let l=e?n.refundInvoiceLinks[0]:n.invoiceLink;window.open(l,"_blank"),s(null)}catch(e){s(e.body?.message)}}let a=null!=t.paymentSource&&t.status===u1.__.COMPLETED,o=n?.invoiceLink,u=n?.refundInvoiceLinks;return t.hasInvoiceURL&&null==n?(0,p.jsxs)("div",{className:uq.It,children:[(0,p.jsx)(nr.Anchor,{onClick:()=>r(!1),children:V.intl.formatToPlainString(V.t.R0xzCN,{})}),t.hasRefundInvoiceURLs?(0,p.jsx)(nr.Anchor,{className:uq.oe,onClick:()=>r(!0),children:V.intl.formatToPlainString(V.t["3x6NGw"],{})}):null,null!=l&&""!==l&&(0,p.jsx)(iK.w,{type:"critical",message:l,role:"alert"})]}):t.hasInvoiceURL&&null!=n?(0,p.jsxs)("div",{className:uq.It,children:[(0,p.jsx)(nr.Anchor,{href:o,children:V.intl.formatToPlainString(V.t.R0xzCN,{})}),null!=u?u.map((e,t)=>(0,p.jsx)(nr.Anchor,{className:uq.oe,href:e,children:V.intl.formatToPlainString(V.t["3x6NGw"],{})},t)):null,null!=l&&""!==l&&(0,p.jsx)(iK.w,{type:"critical",message:l,role:"alert"})]}):a?(0,p.jsx)("div",{className:uq.It,children:(0,p.jsx)(nr.Anchor,{onClick:()=>{var e;e=t.paymentSource,u0(t,e)},children:V.intl.formatToPlainString(V.t.onRIxS,{})})}):null}var u4=n(510022),u5=n(427262),u6=n(106799),u8=n(580630);let u7=e=>`https://${I.XlF}/hc/${e.toLowerCase()}/requests/new?ticket_form_id=360000118612`;function u9(e,t){return t===u1.Yr.DISCORD_ORB?(0,p.jsxs)("span",{className:uq.db,children:[(0,p.jsx)(u6.A,{customSize:16,shouldUseThemeColor:!0}),V.intl.formatToPlainString(V.t.YMor7k,{count:e})]}):(0,u8.$g)(e,t)}function de(e){let{receipt:t,gameItem:n,locale:i,hasLinkedToApplication:l}=e,{analyticsLocations:s}=(0,eX.Ay)(tk.A.BILLING_SETTINGS_BILLING),{sku:r}=t,a=r?.application,o=n.gift_recipient;return n.status===uR.REDEEMED?null:n.status===uR.REFUNDED?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(uw.H,{className:uq.mW,children:V.intl.string(V.t["gIGB/A"])}),(0,p.jsx)("div",{className:uq.iL,children:null!=o?V.intl.format(V.t.Q1K9eg,{username:u5.Ay.getName(o)}):V.intl.format(V.t.IBtGwC,{applicationName:a?.name})})]}):n.status===uR.CLAIMED||n.status===uR.UNCLAIMED?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(uw.H,{className:uq.mW,children:V.intl.string(V.t["gIGB/A"])}),(0,p.jsx)("div",{className:uq.iL,children:null!=o?V.intl.format(V.t.vfUW65,{username:u5.Ay.getName(o)}):V.intl.string(V.t["18wIqp"])}),null==o&&(0,p.jsx)("div",{className:uq.TP,children:(0,p.jsx)(j.$,{variant:"primary",text:V.intl.string(V.t["jcSP+g"]),onClick:()=>(0,na.openUserSettings)(S.X.GIFT_PANEL)})})]}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(uw.H,{className:uq.mW,children:V.intl.string(V.t["gIGB/A"])}),(0,p.jsx)("div",{className:uq.iL,children:l?V.intl.format(V.t.DQQCAw,{applicationName:a?.name,skuName:r?.name}):V.intl.format(V.t.ED2BqF,{applicationName:a?.name,skuName:r?.name})}),(0,p.jsx)("div",{className:uq.TP,children:l?(0,p.jsx)(j.$,{variant:"primary",text:V.intl.string(V.t.zoztQA),onClick:()=>(0,o_.A)(u7(i))}):(0,p.jsx)(j.$,{variant:"primary",text:V.intl.string(V.t["jCqvk/"]),onClick:()=>{null!=r&&null!=a&&(td.default.track(I.HAw.PAYMENT_HISTORY_CONNECT_ACCOUNT_BUTTON_CLICKED,{sku_id:r.id,application_id:a.id,location_stack:s}),(0,u4.n)({sku:r,application:a,analyticsLocations:s}))}})})]})}var dt=n(933832),dn=n(789645);function di(e){let{refund:t,locale:n}=e,i=u7(n),l=t.eligible?dt.CheckmarkLargeIcon:dn.P;return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(uw.H,{className:uq.mW,children:V.intl.string(V.t["n/27pr"])}),(0,p.jsxs)("div",{className:uq.iL,children:[(0,p.jsx)("div",{children:function(e,t){if(null==e.window)return e.policy===uL.IN_GAME_ITEM?V.intl.format(V.t["5lvoVS"],{supportURL:t}):V.intl.string(V.t.s9TZM1);let n=e.window.days;switch(e.policy){case uL.PREMIUM:return e.eligible?V.intl.format(V.t.EPYteX,{dateLimit:n,supportURL:t}):V.intl.formatToPlainString(V.t.dk7vyL,{dateLimit:n});case uL.GIFT:return e.eligible?V.intl.format(V.t["16eP/L"],{dateLimit:n,supportURL:t}):V.intl.formatToPlainString(V.t.owlOWc,{dateLimit:n});default:return e.eligible?V.intl.format(V.t["1LDI4J"],{dateLimit:n,playtimeLimit:2,supportURL:t}):V.intl.formatToPlainString(V.t.s4Kk0C,{dateLimit:n,playtimeLimit:2})}}(t,i)}),t.policy!==uL.IN_GAME_ITEM&&(0,p.jsxs)("div",{className:uq.My,children:[(0,p.jsx)("div",{className:uq.Kf,children:null!=t.window&&(0,p.jsxs)("div",{className:uq._Z,children:[(0,p.jsx)(uw.H,{className:uq.ud,children:V.intl.string(V.t.H0RNz4)}),(0,p.jsxs)("div",{className:uq.z9,children:[(0,p.jsx)(l,{className:uq.xb,color:"currentColor"}),(0,p.jsx)("div",{children:V.intl.formatToPlainString(V.t["7dtXa/"],{daysSincePurchase:t.window.days_since_purchase})})]})]})}),(0,p.jsx)(nr.Anchor,{href:i,children:V.intl.string(V.t.re5nOB)})]})]})]})}var dl=n(679897);function ds(e){let{description:t,cost:n}=e;return(0,p.jsx)("li",{className:uq.mg,children:(0,p.jsxs)(lN.A,{justify:lN.A.Justify.BETWEEN,children:[(0,p.jsx)("div",{children:t}),(0,p.jsx)("div",{children:n})]})})}function dr(e){let{value:t,copyText:n,copyFeedbackText:i}=e,[l,s]=f.useState(!1),[r,a]=f.useState(!1);return(0,p.jsx)(lg.m,{forceOpen:r,text:l?i:n,children:(0,p.jsx)(n5.D,{onMouseEnter:()=>{l&&s(!1)},onMouseLeave:()=>{a(!1)},onClick:function(){(0,uF.C)(t,()=>{a(!0),s(!0)})},children:(0,p.jsx)("div",{className:uq.l9,children:t})})})}function da(e){let{paymentId:t}=e;return(0,p.jsx)("li",{className:uq.mg,children:(0,p.jsxs)("div",{className:uq.bx,children:[(0,p.jsx)("div",{children:V.intl.string(V.t["UQim+r"])}),(0,p.jsx)(dr,{value:t,copyText:V.intl.string(V.t["Mdk9+A"]),copyFeedbackText:V.intl.string(V.t["7eIrA2"])})]})})}function du(e){let{tag:t}=e;if(null==t)return null;let n=t===uO.REVERSED;return(0,p.jsxs)(n4.E,{variant:"text-xxs/semibold",color:"none",tag:"span",className:ic()(dl.XM,n?dl.aB:dl.EN),children:[t===uO.REVERSED&&V.intl.string(V.t.YQv9Li),t===uO.PARTIALLY_REFUNDED&&V.intl.string(V.t.lYbZzz),t===uO.REFUNDED&&V.intl.string(V.t.ZBb6NK)]})}function dd(e){let{payment:t,locale:n}=e,i=t.payment_source??(t.payment_gateway===u1.kM.APPLE_PARTNER?new ok.Pw({}):null);return null==i?null:(0,p.jsx)(o2.A,{paymentSource:i,locale:n,descriptionClassName:uq.iL,showLabels:!0,showPaymentSourceIcon:!0})}function dc(e){let{receipt:t,locale:n}=e;return t.payments.length<=1?1===t.payments.length?(0,p.jsx)(dd,{payment:t.payments[0],locale:n}):null:(0,p.jsx)(q.B,{children:t.payments.map(e=>(0,p.jsxs)(lN.A,{justify:lN.A.Justify.BETWEEN,align:lN.A.Align.CENTER,children:[(0,p.jsx)(dd,{payment:e,locale:n}),(0,p.jsxs)(q.B,{direction:"horizontal",align:"center",gap:8,fullWidth:!1,children:[(0,p.jsx)(du,{tag:e.tag}),(0,p.jsx)(n4.E,{variant:"text-md/normal",color:"text-subtle",children:u9(e.amount,t.currency)})]})]},e.id))})}function dg(e){let{guildProduct:t,locale:n}=e;return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("div",{className:uq.ts}),t.delisted?(0,p.jsx)(iK.w,{type:"warning",message:V.intl.string(V.t["3AvulN"]),role:"none",action:{text:V.intl.string(V.t.zoztQA),onClick:()=>(0,o_.A)(u7(n))}}):null!=t.guild_id&&(0,p.jsx)(u$,{guildId:t.guild_id,guildProductListingId:t.listing_id})]})}function dm(e){let{receipt:t,locale:n,hasLinkedToApplication:i}=e,{currency:l,guild_product:s,game_item:r,refund:a}=t;return(0,p.jsx)(n5.D,{onClick:e=>e.stopPropagation(),children:(0,p.jsxs)("div",{className:uq.WI,children:[(0,p.jsx)(uw.H,{className:uq.mW,children:V.intl.string(V.t.nyzoFb)}),(0,p.jsxs)("div",{className:ic()(uq.iL,uq.W),children:[(0,p.jsx)(dc,{receipt:t,locale:n}),(0,p.jsxs)("ul",{children:[null!=t.subtotal&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(ds,{description:t.description,cost:u9(t.subtotal,l)}),(0,p.jsx)(ds,{description:V.intl.string(V.t.QgWXht),cost:u9(t.tax,l)})]}),(0,p.jsx)(ds,{description:V.intl.string(V.t.txajQG),cost:u9(t.total,l)}),t.amount_refunded>0&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(ds,{description:V.intl.string(V.t["A+I0AP"]),cost:u9(-t.amount_refunded,l)}),(0,p.jsx)(ds,{description:V.intl.string(V.t.xER6Wi),cost:u9(t.net,l)})]}),(0,p.jsx)(da,{paymentId:t.id}),s?.guild_id!=null&&(0,p.jsx)(uJ,{guildId:s.guild_id,guildProductListingId:s.listing_id})]})]}),null!=s&&(0,p.jsx)(dg,{guildProduct:s,locale:n}),(0,p.jsx)(u3,{payment:t.receipt_payment}),null!=r&&(0,p.jsx)(de,{receipt:t,gameItem:r,locale:n,hasLinkedToApplication:i}),null!=a&&(0,p.jsx)(di,{refund:a,locale:n})]})})}function dA(e){let{withGradient:t}=e;return t?(0,p.jsx)(uV.A,{size:24,iconSize:16,color:n1.A.unsafe_rawColors.NEUTRAL_1,className:uq.Sy}):(0,p.jsx)("div",{className:ic()(uq.Sy,uq.uX,uq.Xr),children:(0,p.jsx)(am.t,{size:"custom",width:16,height:16,color:n1.A.colors.ICON_DEFAULT})})}function dE(e){let{receipt:t}=e,n=t.sku?.application,i=(0,_.bG)([lv.A],()=>lv.A.getGuild(n?.guildId));switch(t.icon){case uj.NITRO:return(0,p.jsx)(dA,{withGradient:!0});case uj.NITRO_BASIC:return(0,p.jsx)(dA,{withGradient:!1});case uj.SHOP:return(0,p.jsx)(uG.U,{size:"custom",width:23,height:23,color:"currentColor",className:uq.sV});case uj.APPLICATION:case uj.PRODUCT:return(0,p.jsx)(i7.A,{className:uq.Sy,guildClassName:uq.zA,game:t.icon===uj.APPLICATION?n:void 0,guild:i,size:i7.M.XSMALL,skuId:t.sku?.id})}}function dh(e){let{receipt:t,hasLinkedToApplication:n}=e,{game_item:i}=t;if(null!=i&&t.status===uv.PAID)switch(i.status){case uR.CLAIMED:return(0,p.jsx)("span",{className:uq.gD,children:V.intl.string(V.t.lIsIFo)});case uR.UNCLAIMED:return(0,p.jsx)("span",{className:uq.Tf,children:V.intl.string(V.t["+tqSi3"])});case uR.REDEEMED:return(0,p.jsx)("span",{className:uq.gD,children:V.intl.string(V.t.Osji1u)});case uR.FAILED:return(0,p.jsx)("span",{className:uq.ob,children:V.intl.string(V.t.Yo4ru6)});default:return n?(0,p.jsx)("span",{className:uq.Tf,children:V.intl.string(V.t.y7F0Re)}):(0,p.jsx)("span",{className:uq.Tf,children:V.intl.string(V.t.HHC5Z4)})}switch(t.status){case uv.PENDING:return(0,p.jsx)("span",{className:uq.oE,children:V.intl.string(V.t.y7F0Re)});case uv.FAILED:return(0,p.jsx)("span",{className:uq.ob,children:V.intl.string(V.t.Yo4ru6)});case uv.REVERSED:return(0,p.jsx)("span",{className:uq.ob,children:V.intl.string(V.t.YQv9Li)});case uv.CANCELED:return(0,p.jsx)("span",{className:uq.ob,children:V.intl.string(V.t.ttkBhy)});case uv.PARTIALLY_REFUNDED:return(0,p.jsx)("span",{className:uq.gD,children:V.intl.string(V.t.lYbZzz)});case uv.REFUNDED:return(0,p.jsx)("span",{className:uq.gD,children:V.intl.string(V.t.ZBb6NK)});case uv.PAID:return null}}function dS(e){let{receipt:t,locale:n,className:i}=e,[l,s]=f.useState(!1),{hasAlreadyLinked:r}=(0,uU.RD)(null!=t.game_item?t.sku?.application:void 0);return(0,p.jsx)(um.tG,{id:t.id,children:e=>(0,p.jsxs)(n5.D,{onClick:()=>s(!l),"data-expanded":l,className:ic()(uq.Ji,i),focusProps:{offset:4},...e,children:[(0,p.jsxs)(lN.A,{className:uq.J7,align:lN.A.Align.CENTER,"data-expanded":l,children:[(0,p.jsx)(n4.E,{variant:"text-sm/normal",className:uq.p6,children:(0,iA.i$)(im()(t.created_at),"MM/DD/YYYY")}),(0,p.jsxs)("div",{className:uq.h_,children:[(0,p.jsx)(dE,{receipt:t}),(0,p.jsx)("div",{children:null!=t.subscription?function(e,t){let{paymentSource:n}=e.receipt_payment,i=null!=n&&I.AD1.has(n.type);switch(t.type){case I.rzx.PREMIUM:return t.plans.map(e=>{let{plan_id:t,quantity:n}=e;return(0,aC.xq)(t)?aC.Ay.getDisplayName(t,!1,i):`${n>1?`${n}x `:""}${aC.Ay.getDisplayName(t,!1,i)}`}).join(", ");case I.rzx.GUILD:if(null==t.plan_name)return null;return V.intl.formatToPlainString(t.interval===tJ.WT.YEAR?V.t.V6UFQM:V.t["6oq128"],{planName:t.plan_name});case I.rzx.APPLICATION:return e.sku?.application!=null?V.intl.formatToPlainString(V.t["0wL/VI"],{tier:e.sku.name}):V.intl.string(V.t["9czSYu"]);default:return null}}(t,t.subscription)??t.description:t.guild_product?.delisted===!0?V.intl.string(V.t.O7uLmw):t.description}),t.is_gift?(0,p.jsx)(lg.m,{text:V.intl.string(V.t.QddTpm),children:(0,p.jsx)(uM.GiftIcon,{size:"md",color:"currentColor",className:uq.ez})}):null]}),(0,p.jsxs)("div",{className:uq.vj,children:[(0,p.jsx)(dh,{receipt:t,hasLinkedToApplication:r}),(0,p.jsx)("span",{className:uq.q9,children:u9(t.net,t.currency)})]}),(0,p.jsx)(uk.A,{className:uq.fT,direction:l?uk.A.Directions.UP:uk.A.Directions.DOWN})]}),l?(0,p.jsx)(dm,{receipt:t,locale:n,hasLinkedToApplication:r}):null]})})}var dx=n(949779);function dT(e){let{receipts:t,locale:n,loadNextPage:i}=e,l=f.useRef(null),[s,r]=f.useState(0),a=Math.max(Math.ceil(t.length/10),1),o=t.slice(10*s,(s+1)*10);f.useEffect(()=>{l.current?.scrollTo({to:0})},[s]);let u=f.useCallback(e=>{r(e),e>=a-2&&i()},[a,i]),d=(0,uE.A)("billing-history",l);return(0,p.jsx)(um.hD,{navigator:d,children:(0,p.jsx)(um.PR,{children:e=>{let{ref:t,...i}=e;return(0,p.jsx)(ux,{className:dx.GD,currentPageIndex:s,onChangePage:u,numPages:a,showPageCount:!1,ref:t,...i,children:(0,p.jsx)(uA.Ch,{className:dx.Bd,ref:l,overflow:"auto",children:o.map(e=>(0,p.jsx)(dS,{className:ic()(dx.Nj,dx.Bd),receipt:e,locale:n},e.id))})})}})})}function dp(e){let{subscription:t}=e;return tE()(null!=t.paymentGateway,"Expected payment gateway when rendering for external subscription"),(0,p.jsxs)(oX.Z,{className:dx.K1,children:[(0,p.jsx)("div",{className:dx.BF,children:V.intl.format(V.t["6mIX6s"],{paymentGatewayName:u1.qm[t.paymentGateway]})}),(0,p.jsx)("div",{className:dx.Q2,children:V.intl.format(V.t.eG0uZB,{paymentGatewayName:u1.qm[t.paymentGateway],billingHistoryLink:(0,aC.tW)(t.paymentGateway,"BILLING_HISTORY")})})]})}function df(e){let{locale:t}=e,{receipts:n,hasFetched:i,hasFailed:l,loadNextPage:s}=function(){let[e,t]=f.useState(uP),[n,i]=f.useState(!1),[l,s]=f.useState(!1),[r,a]=f.useState(!1),o=f.useCallback((e,n)=>{tl.Bo.get({url:I.Rsh.BILLING_HISTORY,query:{before:e??void 0,limit:n},rejectWithError:!0}).then(n=>{let{body:i}=n,l=i.receipts.map(uD);t(t=>({receipts:null==e?l:[...t.receipts,...l],cursor:i.cursor}))}).catch(()=>{null==e&&s(!0)}).finally(()=>{i(!0),a(!1)})},[]);f.useEffect(()=>{o(null,30)},[o]);let u=f.useCallback(()=>{r||null==e.cursor||(a(!0),o(e.cursor,10))},[r,o,e.cursor]);return{receipts:e.receipts,hasFetched:n,hasFailed:l,loadNextPage:u}}(),r=(0,_.bG)([ur.A],()=>ur.A.getPremiumTypeSubscription()),a=null!=r&&r.isPurchasedExternally;return i?(0,p.jsxs)("div",{className:dx.GD,children:[null!=r&&a?(0,p.jsx)(dp,{subscription:r}):null,n.length>0?(0,p.jsxs)("div",{className:ic()(dx.PQ,dx.GD),children:[(0,p.jsx)("div",{className:ic()(dx.Nj,dx.Bd),children:(0,p.jsxs)(lN.A,{className:dx.Yi,children:[(0,p.jsx)("div",{className:uq.p6,children:V.intl.string(V.t["5t11BV"])}),(0,p.jsx)("div",{className:dx.Ir,children:V.intl.string(V.t.yAAPb2)}),(0,p.jsx)("div",{className:uq.vj,children:V.intl.string(V.t["6MqHXV"])})]})}),(0,p.jsx)(dT,{receipts:n,locale:t,loadNextPage:s})]}):l?(0,p.jsx)(n4.E,{variant:"text-sm/normal",color:"text-subtle",children:V.intl.string(V.t["fb3n+4"])}):a?null:(0,p.jsx)(n4.E,{variant:"text-sm/normal",color:"text-subtle",children:V.intl.string(V.t.GqvDkk)})]}):(0,p.jsx)(oL.y,{})}var d_=n(545075);let dI=(0,h.E2)(S.X.BILLING_TRANSACTION_HISTORY,{Component:function(){let e=(0,_.bG)([ua.default],()=>ua.default.locale);return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(d_.kb,{}),(0,p.jsx)(df,{locale:e})]})},useSearchTerms:()=>[V.intl.string(V.t.obLrcK)]}),dN=(0,h.zZ)(S.X.BILLING_TRANSACTION_HISTORY_CATEGORY,{useTitle:()=>V.intl.string(V.t.obLrcK),buildLayout:()=>[dI]}),dC=(0,h.t_)(S.X.BILLING_PANEL,{useTitle:()=>V.intl.string(V.t.oeUm2s),buildLayout:()=>[ug,dN],useObscuredNotice:of.L}),db=(0,h.i4)(S.X.BILLING_SIDEBAR_ITEM,{useTitle:()=>V.intl.string(V.t.oeUm2s),icon:op.B,buildLayout:()=>[dC]});var dy=n(70283),dv=n(682618),dj=n(92202),dO=n(534284),dL=n(139486),dR=n(962644),dD=n(35587),dP=n(86379);let dG=(0,h.E2)(S.X.GIFT_BLOCKED_PAYMENTS_SETTING,{Component:d_.uK,usePredicate:()=>(0,dP.Hp)(),useSearchTerms:()=>[V.intl.string(V.t.vwMEHS)]}),dM=(0,h.zZ)(S.X.GIFT_BLOCKED_PAYMENTS_CATEGORY,{buildLayout:()=>[dG]});var dU=n(704333),dV=n(414499),dk=n(31300),dw=n(997101);let dF={[dw.d.US]:[{id:"walmart",name:"Walmart",url:"https://www.walmart.com/ip/Discord-25-Gift-Card-Digital/20844423221?classType=REGULAR&from=/search"},{id:"best_buy",name:"Best Buy\xae",url:"https://www.bestbuy.com/product/discord-25-gift-card-digital/JJG34YFV8K/sku/6685454"},{id:"target",name:"Target",url:"https://www.target.com/p/discord-gift-card-email-delivery/-/A-1013530846?preselect=1013327744"},{id:"gamestop",name:"GameStop",url:"https://www.gamestop.com/gift-cards/virtual-currency/products/discord-25-gift-card/448794.html"}],[dw.d.IT]:[{id:"gamelife",name:"Gamelife",url:"https://www.gamelife.it/cava0261-discord-25-eur-codice-di-attivazione?attribute_values=4"}]},dB=[];function dz(e){return null==e?dB:dF[e]??dB}function dX(e){let{enabled:t}=(0,dj.K)({location:e}),n=(0,_.bG)([sx.default],()=>sx.default.getCurrentUser()?.storeCountry?.country);return t&&dz(n).length>0}var dY=n(178881);function dH(){return n.e("5660").then(n.bind(n,946647))}function dW(e){let{icon:t,children:n}=e;return(0,p.jsxs)(n4.E,{variant:"text-xs/normal",color:"text-default",className:dY.A,children:[(0,p.jsx)(t,{size:"xxs",color:"currentColor","aria-hidden":!0}),(0,p.jsx)("span",{children:n})]})}let dK=(0,h.zZ)(S.X.GIFT_CARDS_MARKETING_BANNER_CATEGORY,{buildLayout:()=>[dZ],usePredicate:()=>dX("GiftInventoryMarketingBanner")}),dZ=(0,h.E2)(S.X.GIFT_CARDS_MARKETING_BANNER,{Component:function(){let e=dX("GiftCardsGiftInventoryBanner"),t=(0,_.bG)([sx.default],()=>sx.default.getCurrentUser()?.storeCountry?.country),n=function(){let{analyticsLocations:e}=(0,eX.Ay)();return f.useCallback(t=>{td.default.track(I.HAw.THIRD_PARTY_PARTNER_CTA_CLICKED,{partner:t.id,cta_type:"retailer",url:t.url,promotion:"gift_cards_in_app_marketing",location_stack:e})},[e])}(),i=f.useMemo(()=>dz(t).map(e=>({text:e.name,onClick:()=>{n(e),(0,o_.A)(e.url)}})),[t,n]);return e?(0,p.jsx)(oC,{size:"compact",title:V.intl.string(oy.default.Ja5Q8Z),graphicLottie:dH,actions:i,children:(0,p.jsxs)(q.B,{direction:"vertical",align:"start",gap:8,children:[(0,p.jsx)(dW,{icon:dU.B,children:V.intl.string(oy.default["9xo1g9"])}),(0,p.jsx)(dW,{icon:dV.h,children:V.intl.string(oy.default.I5UWh9)}),(0,p.jsx)(dW,{icon:uM.GiftIcon,children:V.intl.format(oy.default.ZuneBP,{onBillingSettingsClick:()=>(0,na.openUserSettings)(S.X.BILLING_PANEL)})}),(0,p.jsx)(dW,{icon:dk.k,children:V.intl.format(oy.default.UwYHGm,{websiteUrl:ob.C})})]})}):null},useSearchTerms:()=>[]});var dq=n(982240),dQ=n(948518),dJ=n(914410),d$=n(556427),d0=n(573343);function d1(e){let{tier:t,iconUrl:n,active:i=!1}=e;return(0,p.jsxs)("div",{className:ic()(d0.fO,{[d0.bF]:i}),children:[null!=n&&(0,p.jsx)("img",{src:n,alt:"",className:d0.si}),(0,p.jsxs)("div",{className:d0.tc,children:[(0,p.jsx)(n4.E,{variant:"text-sm/semibold",color:"text-subtle",children:t.name??""}),(0,p.jsx)(n4.E,{variant:"text-xs/normal",color:"text-muted",children:V.intl.format(d$.default.qvx9E4,{count:(0,dq.rL)(t)})})]})]})}function d2(e){let{tiers:t,currentTier:n}=e;return(0,p.jsx)("div",{className:d0.dw,children:t.map(e=>(0,p.jsx)(d1,{tier:e,iconUrl:(0,dL.Se)(e),active:e.key===n?.key},e.key))})}function d3(e){let{analyticsLocation:t,location:n}=e,{analyticsLocations:i}=(0,eX.Ay)(tk.A.USER_SETTINGS_GIFT_INVENTORY),{openGiftModal:l}=(0,dQ.$)({giftRecipient:void 0,analyticsLocations:i,analyticsObject:{object:I.ZSU.BUTTON_CTA,objectType:I.AnalyticsObjectTypes.GIFT},analyticsLocation:t,location:n});return(0,p.jsx)("div",{className:d0.NG,children:(0,p.jsx)(j.$,{variant:"primary",icon:uM.GiftIcon,text:V.intl.string(d$.default.DZnomS),onClick:l})})}function d4(e){let t,{badgeProgress:n,currentTier:i,nextTier:l,giftsRemaining:s}=e,r=(0,dq.rL)(i),a=(0,dq.rL)(l),o=(0,dL.GZ)(n,i,l),u=(0,dL.Se)(i),d=(0,dL.Se)(l);return t=null!=l?V.intl.formatToPlainString(d$.default.XTX3OO,{count:s,nextTier:l?.name??""}):V.intl.formatToPlainString(d$.default.LnsdbK,{currentTier:i?.name??""}),(0,p.jsxs)("div",{className:d0.mY,children:[null!=u&&(0,p.jsx)("div",{className:d0.fC,children:(0,p.jsx)("img",{src:u,alt:"",className:d0.qS})}),(0,p.jsxs)("div",{className:d0.Qs,children:[(0,p.jsx)(n4.E,{variant:"text-md/medium",color:"text-strong",children:t}),(0,p.jsx)(dJ.Ay,{variant:dJ.qP.BLUE,weight:dJ.fh.MEDIUM,progress:o}),(0,p.jsx)(n4.E,{variant:"text-xs/normal",color:"text-muted",className:d0.qg,children:V.intl.format(d$.default.iIpfQe,{threshold:null!=l?a:r,count:null!=l?n:r})})]}),null!=d&&(0,p.jsx)("div",{className:d0.fC,children:(0,p.jsx)("img",{src:d,alt:"",className:d0.qS})})]})}function d5(e){let{analyticsLocation:t}=e,{badgeProgress:n,currentTier:i,nextTier:l,giftsRemaining:s,tiers:r}=(0,_.cf)([dq.Ay],()=>({badgeProgress:dq.Ay.getSingleRequirementProgress(dy.$.GIFTING)?.current??0,currentTier:dq.Ay.getCurrentTier(dy.$.GIFTING),nextTier:dq.Ay.getNextTier(dy.$.GIFTING),giftsRemaining:dq.Ay.getRemainingToNextTier(dy.$.GIFTING),tiers:dq.Ay.getBadgeById(dy.$.GIFTING)?.tiers??[]}));return 0===r.length?null:(0,p.jsxs)("div",{className:d0.kL,children:[(0,p.jsxs)("div",{className:d0.Jo,children:[n>0&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(d4,{badgeProgress:n,currentTier:i,nextTier:l,giftsRemaining:s}),(0,p.jsx)("div",{className:d0.yF})]}),(0,p.jsx)(d2,{tiers:r,currentTier:i}),(0,p.jsx)(n4.E,{variant:"text-xs/normal",color:"text-muted",className:d0.PJ,children:V.intl.string(d$.default["4Yp0mI"])})]}),(0,p.jsx)(d3,{analyticsLocation:t,location:"UserSettingsGiftingBadgeProgress"})]})}let d6=(0,h.zZ)(S.X.GIFTING_BADGE_CATEGORY,{useTitle:()=>V.intl.string(d$.default.sFokBp),buildLayout:()=>[d8],usePredicate:()=>{let e=(0,dL.F5)("gift_inventory"),t=(0,_.bG)([dq.Ay],()=>dq.Ay.getBadgeById(dy.$.GIFTING));return e&&null!=t}}),d8=(0,h.E2)(S.X.GIFTING_BADGE_CONTENT,{useSearchTerms:()=>[V.intl.string(d$.default.sFokBp)],Component:()=>(0,p.jsx)(d5,{})});var d7=n(264779),d9=n(412260),ce=n(555393),ct=n(725807),cn=n(212168),ci=n(976860),cl=n(469778),cs=n(45938),cr=n(109802),ca=n(869038),co=n(380856);function cu(e){let{children:t,className:n,splashArtURL:i}=e;return(0,p.jsxs)(lN.A,{className:ic()(co.wx,n),align:lN.A.Align.CENTER,children:[(0,p.jsx)("div",{className:co.Bn,style:null!=i?{backgroundImage:`url(${i})`}:void 0}),t]})}function cd(e){let{children:t,className:n}=e;return(0,p.jsx)("div",{className:ic()(co.rf,n),children:t})}class cc extends f.PureComponent{static Header=cu;static Body=cd;render(){let{children:e,className:t,onMouseEnter:n,onMouseLeave:i}=this.props;return(0,p.jsx)("div",{className:ic()(co.Nr,t),onMouseEnter:n,onMouseLeave:i,children:e})}}var cg=n(180522),cm=n(871123),cA=n(366523),cE=n(280450),ch=n(30793),cS=n(97352),cx=n(67480),cT=n(615396),cp=n(274904);class cf extends f.PureComponent{_copyModeTimeout=new rW.Ep;state={copyMode:cr.q.DEFAULT};componentWillUnmount(){this._copyModeTimeout.stop()}get copyButtonText(){switch(this.state.copyMode){case cr.q.SUCCESS:return V.intl.string(V.t.XVvPjU);case cr.q.ERROR:return V.intl.string(V.t.i4GM3L);default:return V.intl.string(V.t.OpuAlK)}}handleRevoke(e){ca.Ay.revokeGiftCode(e)}handleCopy=e=>{let{giftCode:t,sku:n}=this.props;(0,cs.AK)(t,n),(0,uF.C)(e,()=>this.setState({copyMode:cr.q.SUCCESS}),()=>this.setState({copyMode:cr.q.ERROR})),this._copyModeTimeout.start(1e3,()=>{this.setState({copyMode:cr.q.DEFAULT})})};render(){let{hideCode:e,giftCode:t}=this.props,{copyMode:n}=this.state;return(0,p.jsxs)(lN.A,{direction:lN.A.Direction.VERTICAL,className:cp.Gj,children:[(0,p.jsx)(cr.e,{className:cp.ph,value:(0,cs.Zq)(t.code),text:this.copyButtonText,mode:n,supportsCopy:uF.p5,hideMessage:e?V.intl.string(V.t["0RLn47"]):null,onCopy:this.handleCopy,buttonColor:s5.XD.BRAND,buttonLook:s5.pR.FILLED}),(0,p.jsxs)("div",{className:cp.KB,children:[null!=t.expiresAt?(0,p.jsxs)(f.Fragment,{children:[V.intl.format(V.t.ltVZcJ,{hours:t.expiresAt.diff(im()(),"h")})," \u2014\xa0"]}):null,(0,p.jsx)(n5.D,{tag:"a",onClick:()=>this.handleRevoke(t.code),children:V.intl.string(V.t.v6Yazx)})]})]})}}class c_ extends f.PureComponent{_loadedAt=null;state={isOpen:!1,isCreating:!1,isHovered:!1};componentDidMount(){this._loadedAt=Date.now()}handleGenerateGiftCode=async e=>{e.stopPropagation();let{skuId:t,subscriptionPlanId:n,giftStyle:i}=this.props;this.setState({isCreating:!0}),await ca.Ay.createGiftCode(t,n,i),this.setState({isCreating:!1,isOpen:!0})};handleToggleOpen=()=>{let{skuId:e,subscriptionPlanId:t,loadedAt:n}=this.props,i=!this.state.isOpen;(null==n||null==this._loadedAt||n<this._loadedAt)&&i&&ca.Ay.fetchUserGiftCodesForSKU(e,t),this.setState({isOpen:!this.state.isOpen})};renderGiftIcon(){let{sku:e,giftStyle:t,application:n}=this.props;return(0,cm.bF)(e)?(0,p.jsx)(cA.e,{shape:"square",sku:e,containerClassName:cp.ez}):null!=t?(0,p.jsx)(cg.A,{giftStyle:t,className:cp.ez,shouldAnimate:this.state.isHovered}):(0,p.jsx)(i7.A,{game:n,size:i7.M.MEDIUM,skuId:e.id})}renderSubtitle(){let{sku:e,entitlements:t,application:n}=this.props;return(0,cm.bF)(e)?(0,p.jsxs)("div",{className:ic()(cp.Oc,cp.ic),children:[(0,p.jsx)(i7.A,{game:n,size:i7.M.XSMALL,skuId:e.id,className:cp._u}),V.intl.format(V.t["6plpZi"],{applicationName:n.name,copies:t.length})]}):(0,p.jsx)("div",{className:cp.Oc,children:V.intl.format(V.t.zMcvcA,{copies:t.length})})}renderTitle(){let e,{sku:t,subscriptionPlan:n,giftCodeBatchId:i}=this.props;return e=i===tJ.FB?V.intl.string(V.t.odsU6W):i===tJ.Bu&&null!=n?V.intl.formatToPlainString(n.interval===tJ.WT.MONTH?V.t.uZjpiJ:V.t.bJW1EA,{skuName:t.name,intervalCount:n.intervalCount}):null==n?t.name:V.intl.formatToPlainString(n.interval===tJ.WT.MONTH?V.t.rCJvqo:V.t.Vd3Iu8,{skuName:t.name,intervalCount:n.intervalCount}),(0,p.jsx)("div",{className:cp.mO,children:e})}renderGenerateGiftCodeRow(){return(0,p.jsxs)(lN.A,{justify:lN.A.Justify.BETWEEN,align:lN.A.Align.CENTER,className:cp.pe,children:[(0,p.jsx)(n4.E,{variant:"text-md/normal",children:V.intl.string(V.t.lELyPj)}),(0,p.jsx)(j.$,{variant:"primary",size:"sm",text:V.intl.string(V.t.Q3Qguo),loading:this.state.isCreating,onClick:this.handleGenerateGiftCode})]})}setIsHovered(e){this.setState({isHovered:e})}render(){let{entitlements:e,application:t,giftCodes:n,className:i,sku:l,isFetching:s,hideCodes:r}=this.props,{isOpen:a}=this.state;return(0,p.jsxs)(cc,{className:i,children:[(0,p.jsx)(n5.D,{onClick:this.handleToggleOpen,className:cp.Nr,onMouseEnter:()=>this.setIsHovered(!0),onMouseLeave:()=>this.setIsHovered(!1),children:(0,p.jsx)(cc.Header,{splashArtURL:t.getSplashURL(512),children:(0,p.jsxs)("div",{className:cp.MY,children:[(0,p.jsxs)(lN.A,{align:lN.A.Align.CENTER,children:[this.renderGiftIcon(),(0,p.jsxs)("div",{className:cp.TK,children:[this.renderTitle(),this.renderSubtitle()]})]}),(0,p.jsx)(uk.A,{direction:a?uk.A.Directions.UP:uk.A.Directions.DOWN,className:cp.eO})]})})}),a?(0,p.jsx)(cc.Body,{children:s?(0,p.jsx)(oL.y,{className:cp.u1}):(0,p.jsxs)(f.Fragment,{children:[n.length<e.length?this.renderGenerateGiftCodeRow():null,n.map(e=>(0,p.jsx)(cf,{giftCode:e,sku:l,hideCode:r},e.code))]})}):null]})}}let cI=_.Ay.connectStores([cx.A,tu.A,ch.A,i2.A,cS.A,cE.default],e=>{let{skuId:t,subscriptionPlanId:n,giftStyle:i}=e,l=cx.A.get(t);if(null==l)throw Error("SKU was unavailable while rendering gift.");let s=ch.A.getForGifterSKUAndPlan(cE.default.getId(),t,n).filter(e=>!e.isClaimed).filter(e=>e.giftStyle===i);return{sku:l,hideCodes:tu.A.enabled,isFetching:ch.A.getUserGiftCodesFetchingForSKUAndPlan(t,n),loadedAt:ch.A.getUserGiftCodesLoadedAtForSKUAndPlan(t,n),application:i2.A.getApplication(l.applicationId),subscriptionPlan:null!=n?(0,cT.c9)(n):null,giftCodes:s}})(c_);var cN=n(725570),cC=n(736653),cb=n(46054);let cy=im().duration(30,"days");var cv=n(416052),cj=n(878309);function cO(e){let{onClose:t,transitionState:n}=e;return(0,p.jsx)(lx.a,{title:"",size:"md",input:(0,p.jsx)("div",{className:cj.aR}),onClose:async()=>await t(),actions:[{text:V.intl.string(V.t.cpT0Cq),variant:"primary",onClick:t}],transitionState:n,children:(0,p.jsxs)("div",{className:cj.t4,children:[(0,p.jsx)(C.D,{variant:"heading-xl/semibold",children:V.intl.string(V.t.iufib1)}),(0,p.jsx)(n4.E,{variant:"text-md/normal",className:cj.G3,children:V.intl.string(V.t.eAn6z2)})]})})}let cL=function(e){let{onClose:t,onClaim:n,code:i,outboundPromotion:l,transitionState:s}=e,[r,a]=f.useState(null),o=(0,tK.GV)(),{analyticsLocations:u}=(0,eX.Ay)(tk.A.USER_SETTINGS_GIFT_INVENTORY);return(f.useEffect(()=>{null==i&&(0,d7.kd)({promotionId:l.id,promotionTitle:l.outboundTitle,partnerId:l.partnerId,analyticsLocations:u}).then(e=>n(e)).catch(e=>a(e?.body?.code))},[i,l.id,l.outboundTitle,l.partnerId,n,u]),null!=r)?(0,p.jsx)(cO,{onClose:t,transitionState:s}):null==i?(0,p.jsx)(oL.y,{className:cj.Lq}):(0,p.jsx)(lx.a,{title:"",size:"md",onClose:async()=>await t(),input:(0,p.jsxs)("div",{className:cj.N1,children:[(0,p.jsx)("div",{className:cj.Qw}),(0,p.jsx)(C.D,{variant:"heading-xl/semibold",children:V.intl.string(V.t["23BfZh"])}),(0,p.jsx)(n4.E,{variant:"text-md/normal",className:cj.G3,children:l.outboundRedemptionModalBody})]}),actions:[{text:V.intl.string(V.t.TulDPl),variant:"secondary",onClick:async()=>await t()},{text:V.intl.string(V.t["+zx47d"]),variant:"primary",onClick:()=>{let e=(0,d7.kc)(i,l);window.open(e,"_blank")}}],transitionState:s,"aria-label":o,children:(0,p.jsxs)("div",{children:[(0,p.jsx)(ls.c,{className:cj.M5}),(0,p.jsx)(lu.D,{label:V.intl.string(V.t.s9LFQh),helperText:V.intl.string(V.t["F+nFTZ"]),children:(0,p.jsx)(cv.A,{value:i,buttonColor:s5.$n.Colors.BRAND,buttonLook:s5.$n.Looks.FILLED,delay:1e3})})]})})};var cR=n(136380);function cD(e){let t,{outboundPromotion:n,code:i}=e,[l,s]=f.useState(!1),[r,a]=f.useState(!1);function o(){return s(e=>!e)}let u=(0,cC.Ay)(),d=(0,d7.WD)(n.id,u),c=null!=i,g=f.useMemo(()=>(0,iA.i$)(c?null!=n.outboundRedemptionEndDate?im()(n.outboundRedemptionEndDate):im()(n.endDate).add(cy):im()(n.endDate),"LL"),[n,c]);c&&l?t=V.intl.format(V.t.pkxVx6,{endDate:g,onClickDetails:o}):c&&!l?t=V.intl.format(V.t["4sFeob"],{endDate:g,onClickDetails:o}):!c&&l?t=V.intl.format(V.t["RBnE+l"],{endDate:g,onClickDetails:o}):c||l||(t=V.intl.format(V.t["57+7Qn"],{endDate:g,onClickDetails:o}));let m=c?V.intl.string(V.t["2cHUti"]):V.intl.string(V.t.O13yhz),A=(0,ce.N)()?.isEligible===!0,E=f.useCallback(()=>a(!1),[]),{outboundTitle:h,outboundTermsAndConditions:S}=n;return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("div",{className:cR.AX,children:[(0,p.jsxs)("div",{className:cR.Pg,children:[(0,p.jsxs)("div",{className:cR.At,children:[(0,p.jsx)("div",{className:cR.$G,children:(0,p.jsx)("img",{alt:"",src:d,className:cR.IJ})}),(0,p.jsxs)("div",{children:[(0,p.jsx)(C.D,{variant:"heading-md/semibold",children:h}),(0,p.jsx)(n4.E,{variant:"text-sm/normal",color:"text-default",children:t})]})]}),(c||A)&&(0,p.jsx)(j.$,{text:m,onClick:()=>a(!0),size:"sm"})]}),l&&(0,p.jsx)(n4.E,{className:cR.GL,variant:"text-xs/normal",color:"text-default",children:cb.A.parse(S,!1,{allowLinks:!0})})]}),r&&(0,p.jsx)(cN.aF,{renderModal:e=>(0,p.jsx)(cL,{...e,onClose:E,onClaim:dR.Ay.addClaimedOutboundPromotionCode,code:i,outboundPromotion:n}),onCloseRequest:E})]})}function cP(e){let{redesign:t=!1}=e,n=(0,_.yK)([cl.A],()=>cl.A.getGiftable()).filter(e=>{let{giftCodeBatchId:t}=e;return null!=t}),i=(0,ce.N)()?.isEligible??null,{activeOutboundPromotions:l,claimedEndedOutboundPromotions:s,claimedOutboundPromotionCodeMap:r}=(0,dD.y7)(),a=n.find(e=>e.giftCodeBatchId===tJ.FB&&!e.consumed),o=n.filter(e=>e.giftCodeBatchId===tJ.Bu&&!e.consumed)??[],[u,d]=K().partition(o,e=>{let{subscriptionPlanId:t}=e;return t===tJ.gD.PREMIUM_YEAR_TIER_2}),c=l.length+s.length>0,g=t||!c?null:(0,p.jsxs)("div",{className:cR.N1,children:[(0,p.jsx)(C.D,{variant:"heading-md/semibold",children:V.intl.string(V.t.wFsj3B)}),(0,p.jsx)(ls.c,{className:cR.yF})]}),m=!1===i&&c?(0,p.jsxs)("div",{className:cR.uo,children:[(0,p.jsx)(am.t,{size:"md",color:n1.A.colors.REDESIGN_BUTTON_PREMIUM_PRIMARY_PURPLE_FOR_GRADIENT_2,className:cR.PC}),(0,p.jsx)(n4.E,{variant:"text-md/normal",className:cR.Qw,children:V.intl.format(V.t.G4fwxK,{onClick:()=>{(0,tY.default)(),(0,ci.pX)(I.BVt.APPLICATION_STORE)}})}),(0,p.jsx)(ct.A,{showGradient:!0,className:cR.aA,subscriptionTier:tJ.pe.TIER_2,textOptions:{textOverride:V.intl.string(V.t.mr4K7D)}})]}):null;return(0,p.jsxs)("div",{children:[g,(0,p.jsx)(cn.A,{className:cR.Yj,isShown:!1===i&&c,type:cn.i.PREMIUM,hasBackground:!0,children:(0,p.jsxs)("div",{className:cR.DE,children:[m,s.map(e=>{let{code:t,promotion:n}=e;return(0,p.jsx)(cD,{outboundPromotion:n,code:t},n.id)}),l.map(e=>(0,p.jsx)(cD,{outboundPromotion:e,code:r[e.id]},e.id)),null!=a?(0,p.jsx)(cI,{skuId:a.skuId,subscriptionPlanId:a.subscriptionPlanId,entitlements:[a],giftCodeBatchId:tJ.FB},(0,cs.Kx)(a.skuId,a.subscriptionPlanId)):null,u.length>0?(0,p.jsx)(cI,{skuId:u[0].skuId,subscriptionPlanId:u[0].subscriptionPlanId,entitlements:u,giftCodeBatchId:tJ.Bu},(0,cs.Kx)(u[0].skuId,u[0].subscriptionPlanId)):null,d.length>0?(0,p.jsx)(cI,{skuId:d[0].skuId,subscriptionPlanId:d[0].subscriptionPlanId,entitlements:d,giftCodeBatchId:tJ.Bu},(0,cs.Kx)(d[0].skuId,d[0].subscriptionPlanId)):null]})})]})}let cG=(0,h.zZ)(S.X.MY_GIFTS_CATEGORY,{useTitle:cU,buildLayout:()=>[cM],usePredicate:()=>{let{claimedOutboundPromotionCodes:e,claimedOutboundPromotionCodesLoaded:t}=(0,_.cf)([d9.A],()=>({claimedOutboundPromotionCodes:d9.A.claimedOutboundPromotionCodes,claimedOutboundPromotionCodesLoaded:d9.A.claimedOutboundPromotionCodesLoaded})),n=(0,dD.T1)({includeClaimedPromotions:!0}),i=(0,d7.Wl)(e,n).length;return t&&n.length+i>0}}),cM=(0,h.E2)(S.X.MY_GIFTS_CONTENT,{useSearchTerms:()=>[cU()],Component:()=>(0,p.jsx)(cP,{redesign:!0})});function cU(){return V.intl.string(V.t.YzjdWJ)}var cV=n(339048),ck=((o={}).GIFT_INVENTORY="gift_inventory",o),cw=n(183636),cF=n(739508);function cB(){var e,t;let n,i,l=(0,_.yK)([cl.A],()=>cl.A.getGiftable()).filter(e=>{let{giftCodeBatchId:t}=e;return null==t}),s=K().groupBy(l,e=>(0,cs.Kx)(e.skuId,e.subscriptionPlanId,e.giftStyle)),[r,a]=f.useState(!1);if(f.useEffect(()=>{(0,cV.XJ)().then(()=>a(!0))},[]),e=ck.GIFT_INVENTORY,t=!r,n=f.useRef(null),i=f.useRef(!1),f.useEffect(()=>{if(i.current)return;if(!t){i.current=!0;return}n.current??=performance.now();let l=setTimeout(()=>{i.current=!0,"focused"===cw.A.getState()&&(0,cF.pM)(Error(`${e} load timed out`),{tags:{...void 0,source:"smag_screen_load",billing_context:function(e){if("gift_inventory"===e)return"gifting"}(e),surface:e}})},Math.max(0,1e4-(performance.now()-n.current)));return()=>clearTimeout(l)},[e,t,void 0]),!r)return(0,p.jsx)(oL.y,{className:cR.Lq});if(0===Object.keys(s).length)return(0,p.jsxs)("div",{className:cR.p$,children:[(0,p.jsx)(uw.H,{className:cR.ks,children:V.intl.string(V.t.B1qgZn)}),(0,p.jsx)("p",{className:cR.WO,children:V.intl.format(V.t.HezvJ8,{onClick:function(){(0,na.openUserSettings)(S.X.NITRO_PANEL)}})})]});let o=K().keys(s).map(e=>{let{skuId:t,subscriptionPlanId:n,giftStyle:i}=(0,cs.X6)(e);return(0,p.jsx)(cI,{skuId:t,subscriptionPlanId:n,entitlements:s[e],giftStyle:i},e)});return(0,p.jsx)(q.B,{gap:"lg",children:o})}let cz=(0,h.zZ)(S.X.PURCHASED_GIFTS_CATEGORY,{useTitle:cY,buildLayout:()=>[cX]}),cX=(0,h.E2)(S.X.PURCHASED_GIFTS_CONTENT,{useSearchTerms:()=>[cY()],Component:()=>(0,p.jsx)(cB,{})});function cY(){return V.intl.string(V.t.FWe6CP)}var cH=n(532446),cW=n(499454);class cK extends f.Component{state={codeInput:"",submitting:!1,hasError:!1,isPromoCode:!1};get analyticsLocation(){let{analyticsContext:{location:e}}=this.props;return{...e,object:I.ZSU.BUTTON_CTA}}handleChange=e=>{this.setState({codeInput:e,hasError:!1})};handleSubmit=async e=>{e.preventDefault();let{codeInput:t}=this.state;if(""===t)return;let n=t.trim();this.setState({submitting:!0});try{if(this.props.acceptGiftCardRedemption)try{await (0,oV.Qp)(n),(0,oV.HF)({initialCode:n,withRedemptionSuccessModal:!0,source:"user_settings_gift_code_redemption",loadId:(0,oR.A)()}),this.setState({codeInput:""});return}catch{}let e=(0,cs.Vd)(t);if(null==e)return void this.setState({hasError:!0});let i=await ca.Ay.resolveGiftCode(e);if(null!=i&&null!=i.giftCode.promotion)throw this.setState({isPromoCode:!0}),Error("Cannnot redeem promotion code as gift");td.default.track(I.HAw.OPEN_MODAL,{type:"gift_accept",location:{...this.analyticsLocation,section:I.JJy.LIBRARY_INVENTORY_CODE_REDEMPTION,object:I.ZSU.BUTTON_CTA}}),(0,cW.h)({processedCode:e}),this.setState({codeInput:""})}catch(e){this.setState({hasError:!0})}finally{this.setState({submitting:!1})}};render(){let{redesign:e,obscureInput:t}=this.props,{codeInput:n,submitting:i,hasError:l,isPromoCode:s}=this.state,r=e?V.intl.string(V.t["hVEn/j"]):V.intl.string(V.t.SeKIoS),a=e?V.intl.string(V.t.epHMtp):void 0;return(0,p.jsx)(n3.n,{label:e?void 0:V.intl.string(V.t["il+VCo"]),children:(0,p.jsx)("form",{onSubmit:this.handleSubmit,children:(0,p.jsxs)(cH.M,{children:[(0,p.jsx)(lp.k,{label:r,description:a,type:t?"password":"text",value:n,onChange:this.handleChange,placeholder:"WUMP-AAAAA-BBBBB-CCCCC",error:!s&&l?V.intl.string(V.t.Y11a2u):null,helperText:s?V.intl.format(V.t.gPt3PE,{promoLink:()=>{window.open(`https://discord.com/billing/promotions/${n}`)}}):null,fullWidth:!0}),(0,p.jsx)(j.$,{variant:"primary",text:V.intl.string(V.t.KIpp7M),type:"submit",loading:i,disabled:e&&0===n.length})]})})})}}function cZ(e){let{redesign:t=!1}=e,{enabled:n}=(0,ul.c)({location:"UserSettingsBilling"}),i=f.useContext(td.AnalyticsContext),l=(0,_.bG)([tu.A],()=>tu.A.enabled);return(0,p.jsx)(cK,{analyticsContext:i,obscureInput:l,acceptGiftCardRedemption:n,redesign:t})}let cq=(0,h.zZ)(S.X.REDEEM_GIFT_CATEGORY,{useTitle:()=>V.intl.string(V.t["il+VCo"]),buildLayout:()=>[cQ],usePredicate:()=>!(0,dP.Hp)()}),cQ=(0,h.E2)(S.X.REDEEM_CODE_INPUT,{Component:()=>(0,p.jsx)(cZ,{redesign:!0}),useSearchTerms:()=>[V.intl.string(V.t["jcSP+g"]),V.intl.string(V.t["il+VCo"])]}),cJ=(0,h.t_)(S.X.GIFT_PANEL,{useTitle:()=>V.intl.string(V.t["jcSP+g"]),buildLayout:()=>[dK,cq,cG,d6,cz,dM],initialize:()=>{dR.Ay.fetchClaimedOutboundPromotionCodes(),(0,dL.Ig)("gift_inventory")&&(0,dv.o0)(dy.$.GIFTING)}}),c$=(0,h.i4)(S.X.GIFT_SIDEBAR_ITEM,{useTitle:()=>V.intl.string(V.t["jcSP+g"]),icon:uM.GiftIcon,usePersistentBadge:function(){let e=(0,dD.IO)().length;return f.useMemo(()=>({badgeType:T.Xi.COUNT,count:e}),[e])},getDismissibleBadges:()=>{let e={location:"UserSettingsGiftInventory"},t=ul.A.getConfig(e).enabled,n=dj.A.getConfig(e).enabled;return t&&n&&(0,dO.q)()?[{badgeType:T.Xi.NEW,dismissibleContent:eE.M.GIFT_INVENTORY_SETTINGS_NEW_BADGE}]:[]},buildLayout:()=>[cJ]});var c0=n(659758),c1=n(877607),c2=n(877624),c3=n(269115),c4=n(462887),c5=n(73825),c6=n(531260),c8=n(160946),c7=n(721668),c9=n(224016),ge=n(526292),gt=n(881489),gn=n(106512),gi=n(22118),gl=n(103411),gs=n(190187),gr=n(930861),ga=n(854627),go=n(889227),gu=n(326084),gd=n(851746),gc=n(664654),gg=n(912140),gm=n(953727);let gA=e=>{let{className:t,backgroundColor:n,backgroundCircleSize:i,...l}=e;return(0,p.jsxs)("svg",{width:"100%",height:"100%",viewBox:"0 0 100 100",fill:"none",style:{overflow:"visible"},xmlns:"http://www.w3.org/2000/svg",...(0,gm.A)({...l}),children:[(0,p.jsx)("circle",{r:i??"40%",cx:"50%",cy:"50%",className:n}),(0,p.jsxs)("g",{transform:"translate(50, 50) scale(0.6) translate(-51, -52)",children:[(0,p.jsx)("path",{d:"M52.0002 11.7556L28.3402 35.4156V68.6956L52.0002 92.3556L75.6602 68.6956V35.4156L52.0002 11.7556ZM63.8302 63.7556L52.0002 75.6289L40.1702 63.7989V40.3122L52.0002 28.4822L63.8302 40.3122V63.7556Z",fill:"#FF6BFA",className:t}),(0,p.jsx)("path",{d:"M40.1702 40.3122V63.7989L52.0002 75.6289L63.8302 63.7989V40.3122L52.0002 28.4822L40.1702 40.3122Z",fill:"#FFDEF9"}),(0,p.jsx)("path",{d:"M52.0002 11.7556V28.4822L63.8302 40.3122L75.6602 35.4156L52.0002 11.7556Z",fill:"#FFB0FF"})]})]})},gE=e=>{let{ellipseOpacity:t,circleColor:n,...i}=e,l=(0,cC.Ay)(),s=(0,c4.q)(l),r=null!=n?n:s?"url(#paint0_linear_1055_83268)":"url(#paint0_linear_1282_11557)";return(0,p.jsxs)("svg",{style:{overflow:"visible"},width:"80%",height:"80%",viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",...(0,gm.A)({...i}),children:[(0,p.jsxs)("svg",{width:"100",height:"100",viewBox:"0 0 114 114",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,p.jsxs)("defs",{children:[(0,p.jsxs)("linearGradient",{id:"purple-gradient",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[(0,p.jsx)("stop",{offset:"0%",style:{stopColor:"#E2C7FA",stopOpacity:1}}),(0,p.jsx)("stop",{offset:"100%",style:{stopColor:"#F3D3DE",stopOpacity:1}})]}),(0,p.jsxs)("linearGradient",{id:"dark-purple-gradient",x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[(0,p.jsx)("stop",{offset:"0%",style:{stopColor:"rgb(36,23,49)",stopOpacity:1}}),(0,p.jsx)("stop",{offset:"100%",style:{stopColor:"rgb(36,23,49)",stopOpacity:1}})]})]}),(0,p.jsx)("ellipse",{cx:"57.2768",cy:"57.0796",rx:"56.3726",ry:"56.3726",fill:null!=n?n:r,fillOpacity:null!=t?t:s?.5:.2}),(0,p.jsxs)("g",{width:"65",transform:"translate(50, 50) scale(.7) translate(-10, -39)",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,p.jsx)("path",{d:"M42.0084 14.8866L33.7687 17.7832C33.3446 17.9281 32.9766 18.2015 32.7161 18.565C32.4555 18.9285 32.3154 19.3641 32.3154 19.8109C32.3154 20.2576 32.4555 20.6932 32.7161 21.0567C32.9766 21.4203 33.3446 21.6936 33.7687 21.8385L42.0084 24.7351C42.3147 24.8404 42.593 25.0138 42.8221 25.2422C43.0512 25.4705 43.2252 25.7478 43.3309 26.053L46.2373 34.2649C46.3827 34.6875 46.657 35.0543 47.0217 35.3139C47.3865 35.5736 47.8236 35.7132 48.2718 35.7132C48.7201 35.7132 49.1572 35.5736 49.522 35.3139C49.8867 35.0543 50.161 34.6875 50.3064 34.2649L53.2128 26.053C53.3204 25.7488 53.495 25.4725 53.7239 25.2444C53.9528 25.0164 54.23 24.8423 54.5353 24.7351L62.7896 21.8385C63.2136 21.6936 63.5817 21.4203 63.8422 21.0567C64.1028 20.6932 64.2428 20.2576 64.2428 19.8109C64.2428 19.3641 64.1028 18.9285 63.8422 18.565C63.5817 18.2015 63.2136 17.9281 62.7896 17.7832L54.5353 14.8866C54.2315 14.7767 53.9557 14.6018 53.7272 14.374C53.4987 14.1463 53.3231 13.8714 53.2128 13.5687L50.3064 5.34234C50.161 4.91974 49.8867 4.55297 49.522 4.2933C49.1572 4.03363 48.7201 3.89404 48.2718 3.89404C47.8236 3.89404 47.3865 4.03363 47.0217 4.2933C46.657 4.55297 46.3827 4.91974 46.2373 5.34234L43.3309 13.5687C43.2233 13.8729 43.0487 14.1492 42.8198 14.3773C42.591 14.6054 42.3137 14.7794 42.0084 14.8866Z",fill:"white",fillOpacity:s?"0.6":"0.4"}),(0,p.jsx)("path",{d:"M34.0878 3.57968L33.0393 0.634802C32.9888 0.483384 32.8917 0.351665 32.7618 0.258321C32.6319 0.164978 32.4759 0.114746 32.3158 0.114746C32.1556 0.114746 31.9996 0.164978 31.8697 0.258321C31.7398 0.351665 31.6427 0.483384 31.5922 0.634802L30.6217 3.57968C30.5838 3.68745 30.5221 3.78534 30.4411 3.86607C30.3601 3.94681 30.2619 4.00831 30.1538 4.04602L27.1555 5.02189C27.0067 5.07415 26.8777 5.17117 26.7865 5.29956C26.6953 5.42795 26.6464 5.58137 26.6464 5.73868C26.6464 5.89598 26.6953 6.04941 26.7865 6.17779C26.8777 6.30618 27.0067 6.4032 27.1555 6.45547L30.0758 7.47451C30.1839 7.51222 30.2821 7.57373 30.3631 7.65446C30.4441 7.7352 30.5059 7.83308 30.5437 7.94085L31.5575 10.8426C31.6081 10.994 31.7052 11.1257 31.835 11.219C31.9649 11.3124 32.121 11.3626 32.2811 11.3626C32.4412 11.3626 32.5973 11.3124 32.7271 11.219C32.857 11.1257 32.9541 10.994 33.0047 10.8426L34.0878 7.94085C34.1257 7.83308 34.1874 7.7352 34.2684 7.65446C34.3494 7.57373 34.4476 7.51222 34.5558 7.47451L37.476 6.45547C37.6249 6.4032 37.7538 6.30618 37.845 6.17779C37.9362 6.04941 37.9852 5.89598 37.9852 5.73868C37.9852 5.58137 37.9362 5.42795 37.845 5.29956C37.7538 5.17117 37.6249 5.07415 37.476 5.02189L34.5211 4.00284C34.4237 3.9656 34.3349 3.90883 34.2604 3.83604C34.1859 3.76326 34.1271 3.676 34.0878 3.57968Z",fill:"white",fillOpacity:"0.8"})]})]}),(0,p.jsxs)("defs",{children:[(0,p.jsxs)("filter",{id:"filter0_d_1282_11577",x:"-6.55945",y:"0.382812",width:"89.2926",height:"70.3945",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[(0,p.jsx)("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),(0,p.jsx)("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),(0,p.jsx)("feOffset",{dy:"4"}),(0,p.jsx)("feGaussianBlur",{stdDeviation:"5"}),(0,p.jsx)("feComposite",{in2:"hardAlpha",operator:"out"}),(0,p.jsx)("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),(0,p.jsx)("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_1282_11577"}),(0,p.jsx)("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_1282_11577",result:"shape"})]}),(0,p.jsxs)("linearGradient",{id:"paint0_linear_1282_11577",x1:"3.44055",y1:"31.5801",x2:"72.7332",y2:"31.5801",gradientUnits:"userSpaceOnUse",children:[(0,p.jsx)("stop",{stopColor:"#B473F5"}),(0,p.jsx)("stop",{offset:"1",stopColor:"#E292AA"})]}),(0,p.jsxs)("linearGradient",{id:"paint2_linear_1986_8686",x1:"3.44073",y1:"43.8345",x2:"72.7334",y2:"43.8345",gradientUnits:"userSpaceOnUse",children:[(0,p.jsx)("stop",{stopColor:"#B473F5"}),(0,p.jsx)("stop",{offset:"1",stopColor:"#E292AA"})]}),(0,p.jsxs)("linearGradient",{id:"paint1_linear_1282_11577",x1:"3.44055",y1:"31.5801",x2:"72.7332",y2:"31.5801",gradientUnits:"userSpaceOnUse",children:[(0,p.jsx)("stop",{stopColor:"#B473F5"}),(0,p.jsx)("stop",{offset:"1",stopColor:"#E292AA"})]}),(0,p.jsxs)("linearGradient",{id:"paint1_linear_1986_8686",x1:"3.44073",y1:"43.8345",x2:"72.7334",y2:"43.8345",gradientUnits:"userSpaceOnUse",children:[(0,p.jsx)("stop",{stopColor:"#B473F5"}),(0,p.jsx)("stop",{offset:"1",stopColor:"#E292AA"})]}),(0,p.jsxs)("linearGradient",{id:"paint2_linear_1282_11577",x1:"3.44055",y1:"31.5801",x2:"72.7332",y2:"31.5801",gradientUnits:"userSpaceOnUse",children:[(0,p.jsx)("stop",{stopColor:"#B473F5"}),(0,p.jsx)("stop",{offset:"1",stopColor:"#E292AA"})]}),(0,p.jsxs)("linearGradient",{id:"paint0_linear_1986_8686",x1:"3.44073",y1:"43.8345",x2:"72.7334",y2:"43.8345",gradientUnits:"userSpaceOnUse",children:[(0,p.jsx)("stop",{stopColor:"#B473F5"}),(0,p.jsx)("stop",{offset:"1",stopColor:"#E292AA"})]}),(0,p.jsxs)("linearGradient",{id:"paint0_linear_1282_11557",x1:"0.904297",y1:"56.5004",x2:"113.649",y2:"56.5004",gradientUnits:"userSpaceOnUse",children:[(0,p.jsx)("stop",{stopColor:"#B473F5"}),(0,p.jsx)("stop",{offset:"1",stopColor:"#E292AA"})]}),(0,p.jsxs)("linearGradient",{id:"paint0_linear_684_72736",x1:"0.904236",y1:"57.0796",x2:"113.649",y2:"57.0796",gradientUnits:"userSpaceOnUse",children:[(0,p.jsx)("stop",{stopColor:"#B473F5"}),(0,p.jsx)("stop",{offset:"1",stopColor:"#E292AA"})]}),(0,p.jsxs)("linearGradient",{id:"paint0_linear_1055_83179",x1:"0.904236",y1:"56.5005",x2:"113.649",y2:"56.5005",gradientUnits:"userSpaceOnUse",children:[(0,p.jsx)("stop",{stopColor:"#B473F5"}),(0,p.jsx)("stop",{offset:"1",stopColor:"#E292AA"})]}),(0,p.jsxs)("linearGradient",{id:"paint0_linear_1055_83268",x1:"0.904236",y1:"57.2461",x2:"113.649",y2:"57.2461",gradientUnits:"userSpaceOnUse",children:[(0,p.jsx)("stop",{stopColor:"#B473F5"}),(0,p.jsx)("stop",{offset:"1",stopColor:"#E292AA"})]})]}),(0,p.jsxs)("g",{filter:s?void 0:"url(#filter0_d_1282_11577)",transform:"translate(50, 50) scale(.8) translate(-44, -30)",children:[(0,p.jsx)("path",{d:"M47.5359 37.8795C51.0149 37.8795 53.8352 35.0592 53.8352 31.5801C53.8352 28.1011 51.0149 25.2808 47.5359 25.2808C44.0568 25.2808 41.2365 28.1011 41.2365 31.5801C41.2365 35.0592 44.0568 37.8795 47.5359 37.8795Z",fill:s?"url(#paint2_linear_1986_8686)":"url(#paint0_linear_1282_11577)"}),(0,p.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M22.3385 6.38281C20.599 6.38281 19.1889 7.79297 19.1889 9.53248C19.1889 11.272 20.599 12.6821 22.3385 12.6821H31.7875C33.527 12.6821 34.9372 14.0923 34.9372 15.8318C34.9372 17.5713 33.527 18.9815 31.7875 18.9815L17.614 18.9815C15.8745 18.9815 14.4644 20.3916 14.4644 22.1311C14.4644 23.8706 15.8745 25.2808 17.614 25.2808L25.4882 25.2808C27.2277 25.2808 28.6379 26.691 28.6379 28.4305C28.6379 30.17 27.2277 31.5801 25.4882 31.5801H19.1889C17.4494 31.5801 16.0392 32.9903 16.0392 34.7298C16.0392 36.4693 17.4494 37.8795 19.1889 37.8795H23.1324C25.9295 48.7472 35.7949 56.7774 47.5359 56.7774C61.4519 56.7774 72.7332 45.4962 72.7332 31.5801C72.7332 17.664 61.4519 6.38281 47.5359 6.38281H22.3385ZM47.5359 44.1788C54.4939 44.1788 60.1345 38.5382 60.1345 31.5801C60.1345 24.6221 54.4939 18.9815 47.5359 18.9815C40.5778 18.9815 34.9372 24.6221 34.9372 31.5801C34.9372 38.5382 40.5778 44.1788 47.5359 44.1788Z",fill:s?"url(#paint1_linear_1986_8686)":"url(#paint1_linear_1282_11577)"}),(0,p.jsx)("path",{d:"M8.16505 25.2808C9.90456 25.2808 11.3147 23.8706 11.3147 22.1311C11.3147 20.3916 9.90456 18.9815 8.16505 18.9815H6.59022C4.8507 18.9815 3.44055 20.3916 3.44055 22.1311C3.44055 23.8706 4.8507 25.2808 6.59022 25.2808H8.16505Z",fill:s?"url(#paint0_linear_1986_8686)":"url(#paint2_linear_1282_11577)"})]}),(0,p.jsx)("g",{width:"65",transform:"translate(50, 50) scale(0.81) translate(-26, -42)",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,p.jsx)("path",{d:"M12.6686 60.7298L10.9101 55.7911C10.8254 55.5372 10.6626 55.3163 10.4448 55.1597C10.227 55.0032 9.96524 54.9189 9.69671 54.9189C9.42818 54.9189 9.16646 55.0032 8.94866 55.1597C8.73086 55.3163 8.56804 55.5372 8.48326 55.7911L6.85565 60.7298C6.7922 60.9105 6.6887 61.0747 6.55284 61.2101C6.41699 61.3455 6.25226 61.4487 6.07091 61.5119L1.04275 63.1485C0.793091 63.2361 0.576874 63.3988 0.423928 63.6141C0.270981 63.8294 0.188843 64.0868 0.188843 64.3506C0.188843 64.6144 0.270981 64.8717 0.423928 65.087C0.576874 65.3023 0.793091 65.465 1.04275 65.5527L5.94012 67.2616C6.12147 67.3249 6.2862 67.428 6.42205 67.5634C6.55791 67.6988 6.66141 67.863 6.72486 68.0437L8.42513 72.91C8.50991 73.1639 8.67273 73.3848 8.89053 73.5414C9.10833 73.6979 9.37005 73.7822 9.63858 73.7822C9.90711 73.7822 10.1688 73.6979 10.3866 73.5414C10.6044 73.3848 10.7672 73.1639 10.852 72.91L12.6686 68.0437C12.732 67.863 12.8355 67.6988 12.9714 67.5634C13.1072 67.428 13.2719 67.3249 13.4533 67.2616L18.3507 65.5527C18.6003 65.465 18.8165 65.3023 18.9695 65.087C19.1224 64.8717 19.2046 64.6144 19.2046 64.3506C19.2046 64.0868 19.1224 63.8294 18.9695 63.6141C18.8165 63.3988 18.6003 63.2361 18.3507 63.1485L13.3952 61.4395C13.2318 61.377 13.083 61.2818 12.958 61.1598C12.833 61.0377 12.7345 60.8914 12.6686 60.7298Z",fill:"white",fillOpacity:"0.8"})})]})};var gh=n(387316),gS=((u={})[u.NITRO_GEM=0]="NITRO_GEM",u[u.NITRO_LOGO=1]="NITRO_LOGO",u[u.AVATAR_DECO=2]="AVATAR_DECO",u);let gx="url(#gradient)",gT=e=>{let{percentage:t=0,children:n,animationClassName:i,initialPercentage:l=0,progressCircleStrokeSize:s=2,progressCircleVariation:r,progressCircleStroke:a}=e,o=43+s/2,u=2*Math.PI*o,[d,c]=f.useState(l);f.useEffect(()=>{let e=setTimeout(()=>{c(t)},200);return()=>clearTimeout(e)},[t]);let g=(0,cC.Ay)(),m=(0,c4.q)(g),A=function(e){switch(e){case 0:case 2:return"var(--background-base-low)";case 1:return"var(--premium-tier-2-purple)";default:return}}(r),E=1===r?m?"0.3":"0.2":void 0,h=a??function(e,t){switch(t){case 0:case 2:return gx;case 1:return e?"url(#gradient_nitro_logo)":gx;default:return}}(m,r);return(0,p.jsxs)("div",{className:gh.Ap,children:[(0,p.jsxs)("svg",{viewBox:"0 0 100 100",className:gh.fB,children:[(0,p.jsx)("circle",{className:0===r||2===r?gh.F3:void 0,fill:"transparent",strokeWidth:s,r:`${o}`,cx:"50%",cy:"50%",stroke:A,strokeOpacity:E}),(0,p.jsx)("circle",{stroke:h,strokeWidth:s,strokeLinecap:"round",strokeDasharray:`${u} ${u}`,className:i,style:{strokeDashoffset:(1-d/100)*u},r:`${o}`,cx:"50%",cy:"50%"})]}),(0,p.jsxs)("svg",{width:"0",height:"0",children:[(0,p.jsxs)("linearGradient",{id:"gradient",x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[(0,p.jsx)("stop",{offset:"0%",style:{stopColor:"#FFBDF2"}}),(0,p.jsx)("stop",{offset:"100%",style:{stopColor:"#E742E1"}})]}),(0,p.jsxs)("linearGradient",{id:"gradient_nitro_logo",x1:"2.99995",y1:"67.6298",x2:"132.55",y2:"67.6298",gradientUnits:"userSpaceOnUse",children:[(0,p.jsx)("stop",{stopColor:"#F9A0E8"}),(0,p.jsx)("stop",{offset:"1",stopColor:"#E742E1"})]}),(0,p.jsxs)("linearGradient",{id:"dark-purple-gradient",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[(0,p.jsx)("stop",{offset:"0%",style:{stopColor:"#241731",stopOpacity:1}}),(0,p.jsx)("stop",{offset:"100%",style:{stopColor:"#241731",stopOpacity:1}})]})]}),(0,p.jsx)("div",{className:gh.Vw,children:n})]})};var gp=n(104773);function gf(e){let{avatarDecorationLegacyAssetId:t,avatarDecorationSkuId:n,avatarDecoAssetDescription:i}=e,l=f.useMemo(()=>(0,gg.A)({legacyAssetId:t,skuId:n,size:v._3.SIZE_120,canAnimate:!1}),[t,n]);return(0,p.jsx)("div",{className:gp.Q7,children:(0,p.jsx)("div",{className:gp.Nk,children:null!=l&&(0,p.jsx)("img",{className:gp.CH,alt:i,src:l})})})}let g_=function(e){let{showAnimations:t=!0,iconClassName:n,staticPercentage:i,innerCircleClassName:l,progressCircleStrokeSize:s,backgroundCircleSize:r,percentage:a,initialPercentage:o,progressCircleVariation:u=gS.NITRO_GEM,avatarDecorationLegacyAssetId:d,avatarDecorationSkuId:c,avatarDecoAssetDescription:g,ellipseOpacity:m,customAnimationClassName:A,circleColor:E,circleStroke:h}=e,S=(0,_.bG)([O.Ay],()=>O.Ay.useReducedMotion),x=t&&!S;return(0,p.jsx)("div",{className:ic()(gp.G3,n),children:(0,p.jsx)(gT,{animationClassName:ic()(gp._0,{[gp.uJ]:x,[A??""]:x}),progressCircleStroke:h,progressCircleStrokeSize:s,percentage:i??a,initialPercentage:i??o,progressCircleVariation:u,children:function(){switch(u){case gS.NITRO_GEM:return(0,p.jsx)(gA,{className:x?gp.Ow:void 0,backgroundColor:ic()(gp.vH,l),backgroundCircleSize:r});case gS.NITRO_LOGO:return(0,p.jsx)(gE,{circleColor:E,ellipseOpacity:m});case gS.AVATAR_DECO:if(null!=c)return(0,p.jsx)(gf,{avatarDecorationLegacyAssetId:d,avatarDecorationSkuId:c,avatarDecoAssetDescription:g});return null;default:return null}}()})})};var gI=n(14313);function gN(e){let{userRecord:t,placement:n}=e,{avatarSrc:i,eventHandlers:l}=(0,ga.A)({userId:t?.id,size:v._3.SIZE_32,animateOnHover:!0}),s=null!=t,r=s?(0,p.jsx)(y.eu,{src:i,"aria-label":t.username,size:v._3.SIZE_32,...l}):(0,p.jsx)(C.D,{variant:"heading-md/semibold",className:gI.n5,children:n});return(0,p.jsx)(lg.m,{text:V.intl.string(V.t.UnKHdo),shouldShow:!s,children:(0,p.jsx)("div",{className:gI.Lg,children:r})})}function gC(e){let{numSentReferrals:t,placement:n}=e;return(0,p.jsxs)("div",{className:gI.Ip,children:[(0,p.jsx)("div",{className:gI.Ej}),(0,p.jsx)("div",{className:ic()({[gI.ch]:t>n,[gI.q_]:t===n})})]})}function gb(e){let{userRecords:t}=e,n=t.length,i=n<1?null:t[0],l=n<2?null:t[1],s=n<3?null:t[2];return(0,p.jsxs)("div",{className:gI.ZM,children:[(0,p.jsx)(gN,{userRecord:i,placement:1}),(0,p.jsx)(gC,{numSentReferrals:n,placement:1}),(0,p.jsx)(gN,{userRecord:l,placement:2}),(0,p.jsx)(gC,{numSentReferrals:n,placement:2}),(0,p.jsx)(gN,{userRecord:s,placement:3})]})}let gy=function(){let e=(0,_.bG)([gd.A],()=>gd.A.getRecipientStatus()),{referralSentUsers:t}=(0,gc.J)(),i=f.useMemo(()=>t.map(e=>new go.A(e)),[t]),l={redeemed:0,converted:0,sent:e.size};e.forEach(e=>{e===gu.aK.REDEEMED&&l.redeemed++,e===gu.aK.CONVERTED&&(l.redeemed++,l.converted++)});let s=l.sent===gc.Z,r=eb.A.getArticleURL(I.MVz.REFERRAL_PROGRAM),{analyticsLocations:a}=(0,eX.Ay)(tk.A.PREMIUM_MARKETING_REFERALL_PROGRAM_PROGRESS_BAR),o=f.useRef(null),u=l.sent/gc.Z*100,d=(0,p.jsxs)("div",{className:gI.hE,children:[(0,p.jsx)(g_,{percentage:u,progressCircleVariation:gS.NITRO_LOGO,iconClassName:gI.ER}),(0,p.jsxs)("div",{className:gI.Ns,children:[(0,p.jsx)(C.D,{variant:"heading-xl/extrabold",className:gI.R0,children:function(e){let{hasSentAll:t}=e;return V.intl.string(V.t.USo4s7)}({hasSentAll:s})}),(0,p.jsx)(gb,{userRecords:i}),(0,p.jsx)(n4.E,{variant:"text-sm/normal",children:function(e){let{helpdeskArticle:t,referralsStatuses:n}=e;return function(e){let{hasSentAll:t,hasSentAtLeastOne:n,helpdeskArticle:i}=e;return t?V.intl.format(V.t["TYu+MH"],{helpdeskArticle:i}):V.intl.format(V.t["omMr+V"],{helpdeskArticle:i})}({hasSentAll:n.sent>=gc.Z,hasSentAtLeastOne:n.sent>=1,helpdeskArticle:t})}({helpdeskArticle:r,referralsStatuses:l})}),(0,p.jsx)("div",{className:gI.Fb,children:(0,p.jsx)(gr.wL,{"data-migration-pending":!0,className:gI.r$,color:s5.XD.CUSTOM,onClick:()=>(function(e){let{analyticsLocations:t}=e;td.default.track(I.HAw.REFERRAL_PROGRAM_SHARE_MODAL_CTA_CLICKED,{location_stack:t}),(0,lT.openModalLazy)(async()=>{let{default:e}=await Promise.all([n.e("647658"),n.e("618589")]).then(n.bind(n,168457));return n=>(0,p.jsx)(e,{...n,sourceAnalyticsLocations:t})})})({analyticsLocations:a}),onlyShineOnHover:!0,children:(0,p.jsxs)("div",{className:gI.Zn,children:[(0,p.jsx)("img",{src:"/assets/3b9b1649f78941df.svg",alt:"",className:gI.QH}),s?V.intl.string(V.t.SY9tyI):V.intl.string(V.t.Lm2nFc)]})})})]})]}),c=l.redeemed===gc.Z;return(0,p.jsx)(eX.f5,{value:a,children:(0,p.jsx)("div",{className:ic()(gI.kL,{[gI.AP]:c}),children:(0,p.jsx)("div",{ref:o,className:ic()(gI.d_,{[gI.kS]:c}),children:d})})})};var gv=n(194509),gj=n(465794),gO=n(774774),gL=n(156601),gR=n(543213),gD=n(88001),gP=n(148155),gG=n(487518);let gM="to_premium_home_button",gU="premium home page";function gV(e){let{premiumSubscription:t,isDiscountApplied:n,activeDiscountInfo:i,theme:l}=e,s=t.hasActiveTrial,r=t.planIdFromItems===tJ.gD.PREMIUM_YEAR_TIER_2,a=t.hasAnyPremiumGroup,o=(0,c6.A)(),u=null!=t.trialEndsAt?im()(t.trialEndsAt).diff(im()(),"d"):0,d=tJ.hd[t.planIdFromItems],c=aC.Ay.getDefaultPrice(d.id),g=aC.Ay.formatPriceString(c,d.interval);if(n||s){let e=(0,c4.M)(l)?gO.at.PREMIUM_TIER_2_WHITE_FILL:gO.at.PREMIUM_TIER_2_OLD_GRADIENT_FILL;return(0,p.jsxs)(p.Fragment,{children:[!s&&(r||a)?(0,p.jsx)(gO.e4,{text:V.intl.string(V.t.EyjDRE),className:gG.LW,colorOptions:e}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(gO.HU,{text:s?V.intl.string(V.t.qYKftX):V.intl.string(V.t.EyjDRE),className:gG.uS,colorOptions:e}),(0,p.jsx)("div",{className:gG.on})]}),(0,p.jsx)(C.D,{variant:"heading-md/normal",color:"text-overlay-light",className:gG.KB,children:function(){if(s)return V.intl.format(V.t["2CGBri"],{remainingTime:u,price:g});if(a&&null!=i&&t.metadata?.active_discount_expires_at!=null){let e=(0,u8.$g)(c.amount,c.currency);return V.intl.format(gP.default.FwjZzr,{percent:i?.percentage??0,discountEndDate:new Date(t.metadata.active_discount_expires_at),regularPrice:e})}return r?V.intl.format(V.t.z2oQtA,{percent:i?.percentage??tJ.Cq,regularPrice:g,renewalDate:aC.Ay.getExpectedRenewalDate(t,o)}):V.intl.formatToPlainString(V.t["3ZiutU"],{percent:i?.percentage??tJ._$,regularPrice:g,numMonths:i?.duration??tJ.OJ})}()})]})}return(0,p.jsx)(gL.A,{variant:void 0,subscriptionTier:tJ.pe.TIER_2,interval:d.interval})}function gk(){let e=(0,ge.k5)(),t=(0,ge.nf)(),n=(0,cC.Ay)(),i=(0,_.bG)([ur.A],()=>ur.A.getPremiumTypeSubscription()),l=(0,_.bG)([sx.default],()=>sx.default.getCurrentUser()),s=l?.isPremiumWithPremiumGroup(),r=(0,c6.A)(),a=(0,gt.ds)(),o=null!==i&&null!==i.planIdFromItems;if(!o&&!r.isFractionalPremiumActive&&!s)return null;let u=r.isFractionalPremiumActive,d=null!==i&&i.hasActiveTrial;return(0,p.jsxs)("div",{className:ic()(gG.$Y,{[gG.J5]:e||d}),children:[(0,p.jsxs)("div",{className:gG.jp,children:[s?(0,p.jsx)(C.D,{variant:"nitro-md",color:"text-overlay-light",className:gG._K,children:(0,gD.DP)()}):(0,p.jsx)(c9.A,{className:gG.TJ}),s&&!e?(0,p.jsx)("div",{style:{marginBottom:"6px"}}):u&&!a?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(gO.e4,{text:V.intl.string(V.t.uXF4c4),className:gG.LW,colorOptions:gO.at.PREMIUM_TIER_2_OLD_GRADIENT_FILL}),(0,p.jsx)(C.D,{variant:"heading-md/normal",color:"text-overlay-light",className:gG.sQ,children:V.intl.format(V.t.sK7fGl,{helpCenterLink:eb.A.getArticleURL(I.MVz.FRACTIONAL_PREMIUM_ABOUT)})})]}):o?(0,p.jsx)(gV,{premiumSubscription:i,isDiscountApplied:e,activeDiscountInfo:t,theme:n}):a?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(gO.HU,{text:V.intl.string(V.t.qYKftX),className:gG.uS,colorOptions:(0,c4.M)(n)?gO.at.PREMIUM_TIER_2_WHITE_FILL:gO.at.PREMIUM_TIER_2_OLD_GRADIENT_FILL}),(0,p.jsx)(C.D,{variant:"heading-md/normal",color:"text-overlay-light",className:gG.KB,children:V.intl.format(V.t["/SfHwl"],{weeks:1})})]}):null,(0,p.jsx)(gR.ZP,{featureSet:l?.isPremiumGroupPrimary()?gR.Nz.PREMIUM_GROUP_PRIMARY:l?.isPremiumGroupMember()?gR.Nz.PREMIUM_GROUP_MEMBER:u?gR.Nz.FRACTIONAL_PREMIUM:gR.Nz.DEFAULT}),u&&!o?(0,p.jsxs)(s8.e,{fullWidth:!0,direction:"vertical",padding:{top:16},children:[(0,p.jsx)(gj.A,{defaultTextOverride:a?V.intl.string(V.t.YScQSF):V.intl.string(V.t["0b3YRn"])}),(0,p.jsx)(j.$,{onClick:()=>{td.default.track(I.HAw.PREMIUM_SETTINGS_INTERACTED,{cta_type:gM,target:gU}),(0,tY.default)(),(0,ci.pX)(I.BVt.APPLICATION_STORE)},variant:"overlay-secondary",fullWidth:!0,size:"md",text:a?V.intl.string(V.t.VR2iVB):V.intl.string(V.t.T1aUAX)})]}):(0,p.jsxs)(s8.e,{fullWidth:!0,direction:"vertical",padding:{top:16},children:[(0,p.jsx)(j.$,{variant:"overlay-primary",fullWidth:!0,onClick:()=>{td.default.track(I.HAw.PREMIUM_SETTINGS_INTERACTED,{cta_type:gM,target:gU}),(0,tY.default)(),(0,ci.pX)(I.BVt.APPLICATION_STORE)},text:V.intl.string(V.t.VR2iVB),size:"md"}),(0,p.jsx)(j.$,{variant:"overlay-secondary",onClick:()=>{td.default.track(I.HAw.PREMIUM_SETTINGS_INTERACTED,{cta_type:"to_subscriptions_button",target:"subscriptions settings"}),(0,na.openUserSettings)(S.X.SUBSCRIPTIONS_PANEL)},text:V.intl.string(V.t["9uDy6C"]),fullWidth:!0,size:"md"})]})]}),(0,p.jsx)("div",{className:gG.ah,children:(0,p.jsx)("img",{className:gG.ah,alt:"",src:"/assets/3aaa2c2d1874c196.svg"})})]})}function gw(){return(0,p.jsxs)("div",{className:gG.T1,children:[(0,p.jsx)("img",{className:gG.GY,alt:"",src:"/assets/9f5bdd034cc313ae.svg"}),(0,p.jsxs)("div",{className:gG.b4,children:[(0,p.jsx)(C.D,{className:gG.Vz,variant:"heading-xl/extrabold",children:V.intl.string(V.t["3KomGa"])}),(0,p.jsx)(n4.E,{className:gG.Oi,variant:"text-sm/normal",children:V.intl.string(V.t.yQ06u1)}),(0,p.jsx)(gv.A,{className:ic()(gG.Tp,gG._c),textOptions:{textOverride:V.intl.string(V.t.Ve9Ge6),textClassName:gG.VV},color:s5.$n.Colors.CUSTOM,onClick:()=>{td.default.track(I.HAw.PREMIUM_SETTINGS_INTERACTED,{cta_type:"gifting_button",target:"payment modal"})}})]})]})}let gF=function(){let e=(0,dP.Hp)(),{analyticsLocations:t}=(0,eX.Ay)(tk.A.PREMIUM_SETTINGS),n=(0,_.bG)([sx.default],()=>sx.default.getCurrentUser()),i=(0,_.bG)([ur.A],()=>ur.A.getPremiumTypeSubscription()),l=(0,_.bG)([ur.A],()=>ur.A.hasFetchedSubscriptions()),s=(0,c8.Y)(tJ.T7),[r,a]=f.useState(!0),o=(0,c6.A)({forceFetch:!0}),u=(0,_.bG)([d9.A],()=>{let e=d9.A.getMarketingComponentByType(c2.C.BILLING_SETTINGS_NITRO_GIFT_BANNER);return null==e||"billingSettingsNitroGiftBanner"!==e.properties.properties.oneofKind?null:e.properties.properties.billingSettingsNitroGiftBanner}),d=!(oz.Fr||oz.v1)&&null!=u,c=f.useRef(null);(0,gs.i)();let g=(0,gl.m)();f.useEffect(()=>{!async function(){e||await Promise.all([oU.hP(),oU.$o(),(0,c5.zS)(null,null,I.tF5.DISCOVERY)]),a(!1)}()},[e]);let[m,A]=f.useState(!1);if(e)return(0,p.jsx)(d_.uK,{});let E=l&&null!==i&&s,h=o.fetched&&o.isFractionalPremiumActive,S=n?.isPremiumWithPremiumGroup();if(!E&&!h&&!r&&!S)return(0,p.jsx)(c7.A,{title:V.intl.string(V.t.dyq9TR),note:null});if(!E&&!h&&!S||r)return(0,p.jsx)(oL.y,{});let x=!!i?.hasActiveTrial;return(0,p.jsx)(eX.f5,{value:t,children:(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(q.B,{direction:"vertical",gap:40,children:[d&&(0,p.jsx)(gn.m,{config:u}),(0,p.jsx)(gk,{}),g&&(0,p.jsx)(gy,{}),!d&&(0,p.jsx)(gw,{}),(0,p.jsx)(gi.A,{hideCTAs:!0,headingOverride:V.intl.string(V.t.dnVvQS),hidePill:!x,selectedPlanColumnClassName:gG.JG,selectedPlanTier:tJ.PremiumTypes.TIER_2})]}),(0,p.jsx)(c3.L,{innerRef:c,onChange:e=>{e&&!m&&(td.default.track(I.HAw.PREMIUM_MARKETING_SURFACE_REACHED_BOTTOM,{location_stack:t}),A(!0))},children:(0,p.jsx)("div",{ref:c,className:gG._Z})})]})})},gB=(0,h.E2)(S.X.NITRO_SETTING,{Component:function(){let e=(0,_.bG)([sx.default],()=>sx.default.getCurrentUser());return(0,aC.YE)(e,tJ.PremiumTypes.TIER_2)?(0,p.jsx)(gF,{}):(0,p.jsx)(c1.A,{})},useSearchTerms:()=>[V.intl.string(V.t.Ipxkog)]}),gz=(0,h.zZ)(S.X.NITRO_CATEGORY,{buildLayout:()=>[gB]}),gX=(0,h.t_)(S.X.NITRO_PANEL,{useTitle:()=>V.intl.string(V.t.Ipxkog),useObscuredNotice:of.L,buildLayout:()=>[gz]}),gY=(0,h.i4)(S.X.NITRO_SIDEBAR_ITEM,{useTitle:()=>V.intl.string(V.t.Ipxkog),icon:am.t,usePersistentBadge:function(e){let t=(0,c0.e)(e);return f.useMemo(()=>({badgeType:T.Xi.STRONGLY_DISCOURAGED_CUSTOM,customBadge:t}),[t])},buildLayout:()=>[gX]});var gH=n(104510),gW=n(820739),gK=n(859241),gZ=n(527113),gq=n(338548),gQ=n(776096),gJ=n(711014),g$=n(178368),g0=n(809545),g1=n(168482);function g2(){return(0,p.jsxs)("div",{className:g0.iE,children:[(0,p.jsx)("img",{className:g0.Kk,alt:"",src:g1}),(0,p.jsxs)("div",{className:g0.pq,children:[(0,p.jsx)(n4.E,{variant:"text-lg/bold",children:V.intl.string(V.t.ZHNSYf)}),(0,p.jsx)(n4.E,{variant:"text-sm/medium",color:"text-muted",children:V.intl.string(V.t.kCj5ps)})]}),(0,p.jsx)(j.$,{variant:"secondary",text:V.intl.string(V.t.JFlifp),onClick:function(){(0,ci.pX)(I.BVt.GUILD_DISCOVERY),(0,tY.default)()}})]})}var g3=n(365199),g4=n(464120),g5=n(443865),g6=n(980707),g8=n(473145);function g7(e){let{guildBoostSlot:t,onClose:i,hasCancelableGuildBoostSlot:l,premiumSubscription:s,onSelect:r,fractionalState:a}=e,o={transfer:{label:null!=t.premiumGuildSubscription?V.intl.string(V.t["PR0n//"]):V.intl.string(V.t["+fmEYG"]),subtext:t.isOnCooldown()?V.intl.string(V.t.XnB8M0):null,disabled:t.isOnCooldown()},cancel:{label:V.intl.string(V.t.twFU3R),subtext:l?null:V.intl.string(V.t.oQ9lOh),disabled:!l},uncancel:{label:V.intl.string(V.t["2glQNp"]),subtext:null,disabled:!1}};switch(s.status){case I.Dmq.PAST_DUE:o.cancel.disabled=!0,o.cancel.subtext=V.intl.string(V.t.WnL6DV),o.uncancel.disabled=!0;break;case I.Dmq.PAUSE_PENDING:case I.Dmq.PAUSED:a===tJ.xc.NONE&&(o.transfer.disabled=!0,o.transfer.subtext=V.intl.string(V.t.LiLRRT),o.cancel.subtext=V.intl.string(V.t["1ywaWL"]),o.cancel.disabled=!0,o.uncancel.disabled=!0)}let u=f.useMemo(()=>s.isPausedOrPausePending&&a===tJ.xc.NONE?(0,p.jsx)(ti.Dr,{id:"manage-subscription",label:V.intl.string(V.t.obRG6Y),action:()=>(0,na.openUserSettings)(S.X.SUBSCRIPTIONS_PANEL),iconLeft:g5.LightbulbIcon,leadingAccessory:{type:"icon",icon:g5.LightbulbIcon}}):null,[a,s]);return(0,p.jsxs)(g6.W,{"data-menu-migrated-auto":!0,onSelect:r,navId:"subscription-context",variant:"fixed","aria-label":V.intl.string(V.t.ogxXGq),onClose:i,children:[(0,p.jsx)(ti.Dr,{id:"apply",label:o.transfer.label,subtext:o.transfer.subtext,action:function(){(0,lT.openModalLazy)(async()=>{let{default:e}=await Promise.all([n.e("295570"),n.e("378357"),n.e("870528"),n.e("205896"),n.e("534428"),n.e("693173"),n.e("418710"),n.e("739957")]).then(n.bind(n,335508));return n=>(0,p.jsx)(e,{...n,guildBoostSlots:[t],locationSection:I.JJy.SETTINGS_PREMIUM})})},disabled:o.transfer.disabled}),(0,g8.I5)(t)?(0,p.jsx)(ti.Dr,{id:"uncancel",label:o.uncancel.label,subtext:o.uncancel.subtext,action:function(){(0,lT.openModalLazy)(async()=>{let{default:e}=await Promise.resolve().then(n.bind(n,342744));return n=>(0,p.jsx)(e,{...n,guildBoostSlotId:t.id})})},disabled:o.uncancel.disabled}):(0,p.jsx)(ti.Dr,{id:"cancel",label:o.cancel.label,subtext:o.cancel.subtext,action:function(){(0,lT.openModalLazy)(async()=>{let{default:e}=await Promise.resolve().then(n.bind(n,983511));return n=>(0,p.jsx)(e,{...n,guildBoostSlot:t})})},disabled:o.cancel.disabled,color:"danger"}),u]})}var g9=n(545934),me=n(548118),mt=n(987144),mn=n(864310),mi=n(290413);function ml(e){let{guild:t,className:n}=e,{total:i}=(0,mn.A)(t.id);return(0,p.jsxs)("div",{className:n??mi.OA,children:[(0,p.jsx)(me.Ay,{className:mi.$f,guild:t,size:me.Ay.Sizes.MEDIUM}),(0,p.jsxs)("div",{className:mi.gI,children:[(0,p.jsx)(n4.E,{variant:"heading-md/semibold",color:"text-default",tag:"span",children:t.name}),(0,p.jsxs)("div",{className:mi.ew,children:[(0,p.jsxs)("div",{className:mi.QW,children:[(0,p.jsx)(gH._,{className:mi.Wz,color:n1.A.unsafe_rawColors.GUILD_BOOSTING_PINK_REFRESH}),(0,p.jsx)(n4.E,{variant:"text-xs/semibold",color:"text-subtle",children:V.intl.format(V.t["pob/cL"],{subscriptions:i})})]}),t.premiumTier!==I.TVA.NONE&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("div",{className:mi.zk}),(0,p.jsx)(n4.E,{variant:"text-xs/semibold",color:"text-subtle",children:(0,g8.gb)(t.premiumTier,{useLevels:!1})})]})]})]})]})}function ms(e){let{guildId:t}=e,n=(0,_.bG)([lv.A],()=>lv.A.getGuild(t),[t]);return null==n?null:(0,p.jsxs)("div",{className:mi.Nr,children:[(0,p.jsx)(ml,{guild:n}),(0,p.jsx)(j.$,{variant:"secondary",size:"sm",icon:gH._,text:V.intl.string(V.t.aBHecF),onClick:()=>{(0,mt.g)({analyticsLocations:[],analyticsLocation:{page:I.liQ.GUILD_BOOSTING_USER_SETTINGS,section:I.JJy.GUILD_BOOSTING_RECOMMENDED_SERVER_BOOST_THIS_SERVER_CTA,object:I.ZSU.BUTTON_CTA,objectType:I.AnalyticsObjectTypes.BUY},guild:n})}})]})}var mr=n(747381);let ma="https://cdn.discordapp.com/assets/content/272d3fa6496aedb9dee76f2d555913bfd56c9e9aacd6de3c18449644d9749657.png";function mo(e){let{slot:t,guildTier:n,premiumSubscription:i,hasCancelableSlots:l,isLast:s}=e,r=f.useRef(null),a=(0,g8.I5)(t),o=f.useMemo(()=>null!=t.cooldownEndsAt?new Date(t.cooldownEndsAt):null,[t.cooldownEndsAt]),u=null!=o&&o>new Date,d=(0,c6.A)(),c=f.useMemo(()=>(function(e,t){if(null==e||e===I.TVA.NONE)return"";let n=[V.intl.formatToPlainString(V.t["dLlKX/"],{numEmojiSlots:tJ.TG[e].limits.emoji}),V.intl.formatToPlainString(V.t["+ANIfv"],{numStickerSlots:tJ.TG[e].limits.stickers}),V.intl.formatToPlainString(V.t["4gt60b"],{numSoundboardSlots:tJ.TG[e].limits.soundboardSounds}),V.intl.formatToPlainString(V.t.XahSjZ,{resolution:tJ.TG[e].limits.screenShareQualityResolution,framerate:tJ.TG[e].limits.screenShareQualityFramerate}),V.intl.formatToPlainString(V.t.NbNs7S,{bitrate:tJ.TG[e].limits.bitrate/1e3}),V.intl.formatToPlainString(V.t.VVKcpn,{filesize:tJ.TG[e].limits.fileSize/1024/1024}),V.intl.formatToPlainString(V.t.TbpCvv,{numVideoStageSeats:tJ.TG[e].limits.stageVideoUsers}),V.intl.string(V.t.LDyX3i),V.intl.string(V.t.YtGlPW)];e>=I.TVA.TIER_2&&(n.push(V.intl.string(V.t.SztbtN)),n.push(V.intl.string(V.t["3GK91n"]))),e>=I.TVA.TIER_3&&n.push(V.intl.string(V.t["XUUJd+"]));let i=0;for(let e=0;e<t.length;e++)i=31*i+t.charCodeAt(e)|0;let l=n[Math.abs(i)%n.length];return V.intl.formatToPlainString(V.t["/dOAmQ"],{perk:l})})(n,t.id),[n,t.id]),g=f.useMemo(()=>{if(""!==c)return c;let e=null!=t.premiumGuildSubscription?oB.default.extractTimestamp(t.premiumGuildSubscription.id):0;return V.intl.formatToPlainString(V.t.lY2Bur,{date:new Date(e)})},[c,t.premiumGuildSubscription]),m=f.useMemo(()=>a?i.isPausedForFractionalPremium?d.endsAt.toDate():i.currentPeriodEnd:null,[a,i,d]),A=null!=m&&!(u&&null!=o&&o<m);return(0,p.jsxs)("div",{className:ic()(mr.iq,{[mr.Mt]:s}),children:[(0,p.jsxs)("div",{className:mr.kd,children:[(0,p.jsx)("img",{alt:"",className:mr.bB,src:ma}),A?(0,p.jsx)(n4.E,{variant:"text-sm/medium",color:"text-subtle",children:V.intl.format(V.t.Z4ULRD,{date:m})}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(n4.E,{variant:"text-sm/medium",color:"text-subtle",children:g}),u&&null!=o&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("div",{className:mr.zk}),(0,p.jsx)(n4.E,{variant:"text-sm/medium",color:"text-feedback-info",children:V.intl.formatToPlainString(V.t.YJlswH,{date:o.toLocaleDateString()})})]}),!u&&null!=i.trialEndsAt&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("div",{className:mr.zk}),(0,p.jsx)(n4.E,{variant:"text-sm/medium",color:"text-feedback-warning",children:V.intl.formatToPlainString(V.t.OdPSpk,{date:new Date(i.trialEndsAt).toLocaleDateString()})})]})]})]}),(0,p.jsx)(af.Y,{targetElementRef:r,renderPopout:e=>{let{closePopout:n}=e;return(0,p.jsx)(g7,{onClose:n,guildBoostSlot:t,premiumSubscription:i,hasCancelableGuildBoostSlot:l,fractionalState:d.fractionalState})},position:"right",align:"center",children:e=>(0,p.jsx)(n5.D,{innerRef:r,"aria-label":V.intl.string(V.t.PdRCRg),className:mr.Mj,...e,children:(0,p.jsx)(g3.MoreHorizontalIcon,{size:"xs",color:n1.A.colors.INTERACTIVE_TEXT_DEFAULT})})})]})}function mu(e){let{guildId:t,slots:n,premiumSubscription:i,hasCancelableSlots:l}=e,s=(0,_.bG)([lv.A],()=>lv.A.getGuild(t),[t]);return(0,p.jsxs)("div",{className:mr.Nr,children:[(0,p.jsx)("div",{className:mr.MY,children:null!=s?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(ml,{guild:s,className:mr.OA}),(0,p.jsx)(j.$,{variant:"secondary",size:"sm",text:V.intl.string(V.t.KLOhbO),onClick:()=>{(0,tY.default)(),(0,g4.K4)({guildId:s.id,location:{section:I.JJy.GUILD_BOOSTING_RECOMMENDED_SERVER_GO_TO_SERVER_CTA}})}})]}):(0,p.jsx)("div",{className:mr.OA,children:(0,p.jsx)(C.D,{variant:"heading-md/semibold",color:"text-default",children:V.intl.string(V.t["6Kwwuo"])})})}),n.map((e,t)=>(0,p.jsx)(mo,{slot:e,guildTier:s?.premiumTier,premiumSubscription:i,hasCancelableSlots:l,isLast:t===n.length-1},e.id))]})}function md(e){let{guildBoostSlots:t,premiumSubscription:n,pausedAppliedGuildBoosts:i,isPaused:l}=e,{boostsByGuildId:s,numActiveSlots:r}=f.useMemo(()=>{if(l&&null!=n)return{boostsByGuildId:function(e,t){let n={};for(let t of e)t.guildId in n||(n[t.guildId]=[]),n[t.guildId].push(t);let i={};for(let e of Object.keys(n)){let l=n[e];i[e]=l.map(n=>g9.A.createFromServer({id:n.id,subscription_id:t.id,canceled:!1,premium_guild_subscription:{id:n.id,guild_id:e},cooldown_ends_at:null},t))}return i}(i,n),numActiveSlots:0};let e=0,s={};for(let n of Object.keys(t)){let i=t[n];if(!(0,g8.I5)(i)&&e++,null!=i.premiumGuildSubscription){let e=i.premiumGuildSubscription.guildId;e in s||(s[e]=[]),s[e].push(i)}}return{boostsByGuildId:s,numActiveSlots:e}},[t,l,i,n]);if(null==n||0===Object.keys(s).length)return null;let a=r>aC.Ay.getNumIncludedPremiumGuildSubscriptionSlots(n.planId);return(0,p.jsx)("div",{className:mr.kR,children:oB.default.keys(s).map(e=>(0,p.jsx)(mu,{guildId:e,slots:s[e],premiumSubscription:n,hasCancelableSlots:a},e))})}var mc=n(502572),mg=n(983511),mm=n(342744),mA=n(496431);let mE=function(e){let{className:t,cooldown:n}=e,i=(0,mA.A)(n);return(0,p.jsx)(n4.E,{className:t,variant:"text-sm/medium",color:"text-muted",children:(0,iA.uN)(i,{days:V.t.WUTPDc,hours:V.t.c1qodV,minutes:V.t["2+A3dv"]})})};var mh=n(731536);function mS(e){let{guildBoostSlots:t,fractionalPremiumState:i}=e,l=(0,_.bG)([ur.A],()=>ur.A.getPremiumTypeSubscription()),{unappliedSlots:s,numActiveSlots:r}=f.useMemo(()=>{let e=[],n=0;for(let i of t)!(0,g8.I5)(i)&&n++,null==i.premiumGuildSubscription&&e.push(i);return{unappliedSlots:e,numActiveSlots:n}},[t]),a=r>(null!=l?aC.Ay.getNumIncludedPremiumGuildSubscriptionSlots(l.planId):0),o=l?.isPausedOrPausePending===!0&&i===tJ.xc.NONE;return 0===s.length?null:(0,p.jsxs)("div",{className:mh.Nr,children:[(0,p.jsxs)("div",{className:mh.MY,children:[(0,p.jsxs)("div",{className:mh._L,children:[(0,p.jsxs)("div",{className:mh.MD,children:[(0,p.jsx)("img",{alt:"",className:mh.F8,src:ma}),(0,p.jsx)("div",{className:ic()(mh.qS,"theme-dark"),children:(0,p.jsx)("span",{className:mh.Vv,children:s.length})})]}),(0,p.jsxs)("div",{className:mh.Qp,children:[(0,p.jsx)(n4.E,{variant:"heading-md/semibold",color:"text-default",tag:"span",children:V.intl.format(V.t.BPadnO,{numUnappliedGuildBoostSlots:s.length})}),(0,p.jsx)(n4.E,{variant:"text-xs/semibold",color:"text-subtle",children:V.intl.format(V.t.Kaw82o,{numUnappliedGuildBoostSlots:s.length})})]})]}),(0,p.jsx)(mc.A,{shouldShow:o,text:V.intl.string(V.t.mOWsF1),"aria-label":V.intl.string(V.t.mOWsF1),children:e=>(0,p.jsx)(j.$,{...e,variant:"primary",size:"sm",icon:gH._,text:V.intl.string(V.t.BMx1iy),disabled:o,onClick:()=>{(0,lT.openModalLazy)(async()=>{let{default:e}=await Promise.all([n.e("378357"),n.e("418710")]).then(n.bind(n,770101));return t=>(0,p.jsx)(e,{...t,onSelectGuild:e=>{t.onClose(),(0,mt.g)({analyticsLocations:[],analyticsLocation:{page:I.liQ.GUILD_BOOSTING_USER_SETTINGS,section:I.JJy.SETTINGS_PREMIUM,object:I.ZSU.BUTTON_CTA,objectType:I.AnalyticsObjectTypes.BUY},guild:e})}})})}})})]}),s.map((e,t)=>(0,p.jsx)(mx,{slot:e,isLast:t===s.length-1,isCancelable:a&&!(0,g8.I5)(e),isCanceled:(0,g8.I5)(e),premiumSubscription:l,modificationsDisabled:o},e.id))]})}function mx(e){let t,{slot:n,isLast:i,isCancelable:l,isCanceled:s,premiumSubscription:r,modificationsDisabled:a}=e,o=f.useRef(null),u=f.useMemo(()=>null!=n.cooldownEndsAt?new Date(n.cooldownEndsAt):null,[n.cooldownEndsAt]),d=s?r?.currentPeriodEnd:null;t=n.isOnCooldown()&&null!=u&&(null==d||u<d)?(0,p.jsx)(mE,{cooldown:u.getTime()}):null!=d?(0,p.jsx)(n4.E,{variant:"text-sm/medium",color:"text-subtle",children:V.intl.format(V.t.Z4ULRD,{date:d})}):(0,p.jsx)(n4.E,{variant:"text-sm/medium",color:"text-subtle",children:V.intl.string(V.t["2mcafz"])});let c=l||s;return(0,p.jsxs)("div",{className:ic()(mh.iq,{[mh.Mt]:i}),children:[(0,p.jsxs)("div",{className:mh.kd,children:[(0,p.jsx)("img",{alt:"",className:mh.bB,src:ma}),t]}),c&&(0,p.jsx)(af.Y,{targetElementRef:o,renderPopout:e=>{let{closePopout:t}=e;return(0,p.jsxs)(g6.W,{navId:"unapplied-boost-actions","aria-label":V.intl.string(V.t.ogxXGq),onSelect:void 0,onClose:t,children:[l&&(0,p.jsx)(ti.Dr,{id:"cancel-boost",label:V.intl.string(V.t.twFU3R),color:"danger",disabled:a,subtext:a?V.intl.string(V.t.mOWsF1):void 0,action:()=>{t(),(0,lT.openModalLazy)(async()=>e=>(0,p.jsx)(mg.default,{...e,guildBoostSlot:n}))}}),s&&(0,p.jsx)(ti.Dr,{id:"uncancel-boost",label:V.intl.string(V.t["2glQNp"]),disabled:a,subtext:a?V.intl.string(V.t.mOWsF1):void 0,action:()=>{t(),(0,lT.openModalLazy)(async()=>e=>(0,p.jsx)(mm.default,{...e,guildBoostSlotId:n.id}))}})]})},align:"right",position:"bottom",children:e=>(0,p.jsx)(n5.D,{innerRef:o,"aria-label":V.intl.string(V.t["UKOtz+"]),className:mh.Mj,...e,children:(0,p.jsx)(g3.MoreHorizontalIcon,{size:"xs",color:n1.A.colors.INTERACTIVE_TEXT_DEFAULT})})})]})}var mT=n(834612);function mp(e){let{guildBoostSlots:t,guildBoostSlotsByGuildId:n,premiumSubscription:i,pausedAppliedGuildBoosts:l,fractionalPremiumState:s}=e,r=eb.A.getArticleURL(I.MVz.GUILD_BOOSTING_FAQ),a=i?.isPaused===!0&&s!==tJ.xc.FP_SUB_PAUSED,o=t.some(e=>null==e.premiumGuildSubscription),u=a&&l.length>0,d=a?u:t.some(e=>null!=e.premiumGuildSubscription);return o||d?(0,p.jsxs)("div",{className:mT.i,children:[(0,p.jsxs)("div",{className:mT.b,children:[(0,p.jsx)(C.D,{variant:"heading-md/semibold",children:V.intl.string(V.t.W5rDjW)}),(0,p.jsx)(n4.E,{variant:"text-sm/normal",color:"text-muted",children:V.intl.format(V.t.SpDz1x,{helpdeskArticle:r})})]}),(0,p.jsx)(md,{guildBoostSlots:n,premiumSubscription:i,pausedAppliedGuildBoosts:l,isPaused:a}),(0,p.jsx)(mS,{guildBoostSlots:t,fractionalPremiumState:s})]}):null}var mf=n(333722),m_=n(9146);function mI(){return(0,p.jsxs)("div",{className:m_.iE,children:[(0,p.jsx)(C.D,{variant:"heading-xl/normal",children:V.intl.string(V.t.IzKs3o)}),(0,p.jsx)("div",{className:m_.kR,children:mf.s.map((e,t)=>{let n=e.icon;return(0,p.jsxs)("div",{className:m_.Nr,children:[(0,p.jsx)(n,{className:m_.Kk}),(0,p.jsx)(n4.E,{className:m_.h_,color:"text-muted",variant:"text-sm/medium",children:e.getText()})]},t)})})]})}var mN=n(847374),mC=n(232122),mb=n(665984);function my(){let[e,t]=f.useState(null),[n,i]=f.useState(null);return(0,p.jsxs)("div",{className:mb.iE,children:[(0,p.jsx)(C.D,{variant:"heading-xl/normal",children:V.intl.string(V.t.HPJ6Nj)}),(0,p.jsx)("ul",{className:mb.p_,children:mC.m.map((l,s)=>{let r=e===s,a=n===s,o=r||a?"text-strong":"text-muted";return(0,p.jsxs)(n5.D,{tag:"li",className:ic()(mb.Aw,{[mb.$K]:r}),onClick:()=>t(e=>e===s?null:s),onMouseEnter:()=>i(s),onMouseLeave:()=>i(null),children:[(0,p.jsxs)("div",{className:mb.k7,children:[(0,p.jsx)(n4.E,{className:mb.b1,color:o,variant:"heading-md/semibold",tag:"span",children:l.getQuestion()}),(0,p.jsx)(mN.a,{size:"sm",color:n1.A.colors.INTERACTIVE_ICON_DEFAULT,className:mb.q4,style:{transform:r?"rotate(180deg)":"rotate(0deg)"}})]}),r&&(0,p.jsx)(n4.E,{className:mb.ZF,color:"text-muted",variant:"text-sm/medium",children:l.getAnswer()})]},s)})})]})}var mv=n(182859),mj=n(25525),mO=n(416763);function mL(){let e=eb.A.getArticleURL(I.MVz.GUILD_SUBSCRIPTIONS);return(0,p.jsxs)("div",{className:mO.wx,children:[(0,p.jsxs)("div",{className:mO.Qs,children:[(0,p.jsxs)("div",{className:mO.B5,children:[(0,p.jsx)("img",{alt:"",className:mO.F8,src:"/assets/263e4cc9043cab70.svg"}),(0,p.jsx)(C.D,{variant:"heading-xl/normal",children:V.intl.string(mj.default.hjvcLO)})]}),(0,p.jsx)(n4.E,{variant:"text-sm/normal",color:"text-muted",children:V.intl.format(V.t.TUHyoA,{helpdeskArticle:e})})]}),(0,p.jsx)(mv.A,{variant:"member",className:mO.iO,analyticsLocation:{page:I.liQ.GUILD_BOOSTING_USER_SETTINGS,section:I.JJy.HERO,object:I.ZSU.CARD},videoPlacement:"settings_header"})]})}var mR=n(315629),mD=n(87719),mP=n(961085);function mG(){let e=(0,_.bG)([sx.default],()=>sx.default.getCurrentUser());if(null==e||aC.Ay.hasFreeBoosts(e))return null;let t=eb.A.getArticleURL(I.MVz.GUILD_BOOSTING_FAQ);return(0,p.jsxs)(mR.h,{color:"nitro-pink",className:mP.vK,children:[(0,p.jsxs)("div",{className:mP.nw,children:[(0,p.jsx)("img",{alt:"",className:mP.q3,src:ma}),(0,p.jsxs)("div",{className:mP.Tm,children:[(0,p.jsx)(n4.E,{variant:"heading-md/semibold",color:"text-default",tag:"span",children:V.intl.format(V.t.Idh1Vs,{count:tJ.M4,boostCount:tJ.M4})}),(0,p.jsxs)("div",{className:mP.xv,children:[(0,p.jsx)(am.t,{className:mP.nE}),(0,p.jsx)(n4.E,{variant:"text-xs/semibold",color:"text-subtle",children:V.intl.format(V.t["6UAu+f"],{count:tJ.M4,boostCount:tJ.M4,helpdeskArticle:t})})]})]})]}),(0,p.jsx)(j.$,{variant:"expressive",size:"sm",icon:am.t,text:V.intl.string(V.t["8x0jKT"]),onClick:mD.e})]})}var mM=n(532991);function mU(){let e=(0,_.bG)([gQ.A],()=>gQ.A.affinities),t=(0,_.bG)([gJ.Ay],()=>gJ.Ay.getFlattenedGuildIds()),n=f.useMemo(()=>{let n=e.slice(0,3).map(e=>e.guildId);for(let e=0;e<t.length&&n.length<3;e++){let i=t[e];n.includes(i)||n.push(i)}return n},[e,t]);return 0===n.length?null:(0,p.jsxs)("div",{className:mM.i,children:[(0,p.jsx)(C.D,{variant:"heading-md/semibold",children:V.intl.string(V.t.r90Wgo)}),(0,p.jsx)("div",{className:mM.k,children:n.map(e=>(0,p.jsx)(ms,{guildId:e},e))})]})}var mV=n(967246);function mk(e){let{count:t}=e,i=eb.A.getArticleURL(I.MVz.GUILD_BOOSTING_FAQ);return(0,p.jsxs)(mR.h,{color:"nitro-pink",className:mV.vK,children:[(0,p.jsxs)("div",{className:mV.nw,children:[(0,p.jsxs)("div",{className:mV.MD,children:[(0,p.jsx)("img",{alt:"",className:mV.F8,src:ma}),(0,p.jsx)("div",{className:ic()(mV.qS,"theme-dark"),children:(0,p.jsx)("span",{className:mV.Vv,children:t})})]}),(0,p.jsxs)("div",{className:mV.Tm,children:[(0,p.jsx)(n4.E,{variant:"heading-md/semibold",color:"text-default",tag:"span",children:V.intl.format(V.t.KewnLu,{count:t,boostCount:t})}),(0,p.jsxs)("div",{className:mV.xv,children:[(0,p.jsx)(am.t,{className:mV.nE}),(0,p.jsx)(n4.E,{variant:"text-xs/semibold",color:"text-subtle",children:V.intl.format(V.t["6UAu+f"],{count:tJ.M4,boostCount:tJ.M4,helpdeskArticle:i})})]})]})]}),(0,p.jsx)(j.$,{variant:"primary",size:"sm",icon:gH._,text:V.intl.string(V.t.BMx1iy),onClick:()=>{(0,lT.openModalLazy)(async()=>{let{default:e}=await Promise.all([n.e("378357"),n.e("418710")]).then(n.bind(n,770101));return t=>(0,p.jsx)(e,{...t,onSelectGuild:e=>{t.onClose(),(0,mt.g)({analyticsLocations:[],analyticsLocation:{page:I.liQ.GUILD_BOOSTING_USER_SETTINGS,section:I.JJy.SETTINGS_PREMIUM,object:I.ZSU.BUTTON_CTA,objectType:I.AnalyticsObjectTypes.BUY},guild:e})}})})}})]})}var mw=n(89150);function mF(e){let{premiumSubscription:t}=e,n=(0,_.bG)([g$.A],()=>g$.A.boostSlots),i=f.useMemo(()=>Object.values(n),[n]),l=(0,_.bG)([sx.default],()=>sx.default.getCurrentUser()),s=(0,_.bG)([gQ.A],()=>gQ.A.affinities),r=(0,_.bG)([gJ.Ay],()=>gJ.Ay.getFlattenedGuildIds()),a=s.length>0||r.length>0,o=(0,_.bG)([gK.A],()=>gK.A.getCurrentUserAppliedBoosts()),{fractionalState:u}=(0,c6.A)({forceFetch:!0}),d=l?.isPremiumGroupMember(),c=t?.isPausedOrPausePending===!0&&u===tJ.xc.NONE,g=f.useMemo(()=>{if(null==t||c)return 0;let e=aC.Ay.getNumIncludedPremiumGuildSubscriptionSlots(t.planId);return 0===e||e!==i.length?0:i.filter(e=>e.isAvailable()).length},[t,c,i]);return(0,p.jsxs)("div",{className:mw.GO,children:[(0,p.jsx)(d_.kb,{className:mw.ek}),(0,p.jsx)(mL,{}),(0,p.jsx)(mG,{}),g>0&&(0,p.jsx)(mk,{count:g}),d&&(0,p.jsx)(gq.A,{}),!a&&(0,p.jsx)(g2,{}),(0,p.jsxs)("div",{className:mw.C_,children:[(0,p.jsx)(mp,{guildBoostSlots:i,guildBoostSlotsByGuildId:n,premiumSubscription:t,pausedAppliedGuildBoosts:o,fractionalPremiumState:u}),(0,p.jsx)(mU,{}),(0,p.jsx)(gZ.A,{hideHeading:!0,hideTier0:!0}),(0,p.jsx)(mI,{}),(0,p.jsx)(my,{})]})]})}var mB=n(819677);let mz=(0,h.E2)(S.X.PREMIUM_GUILD_SUBSCRIPTIONS_SETTING,{Component:function(){f.useEffect(()=>{oU.hP(),oU.$o(),(0,gW.CD)(),(0,c5.zS)(null,null,I.tF5.DISCOVERY),(0,gW.tO)(!0)},[]);let{hasFetchedSubscriptions:e,premiumSubscription:t}=(0,_.cf)([ur.A],()=>({hasFetchedSubscriptions:ur.A.hasFetchedSubscriptions(),premiumSubscription:ur.A.getPremiumTypeSubscription()})),n=(0,c8.Y)(),i=(0,_.bG)([us.A],()=>us.A.hasFetchedPaymentSources),l=(0,_.bG)([gK.A],()=>gK.A.isFetchingCurrentUserAppliedBoosts),s=!e||!n||!i||l,[r,a]=f.useState(!1);return(s||r||a(!0),s&&!r)?(0,p.jsx)("div",{className:ic()(mB.kL,mB.Lq),children:(0,p.jsx)(oL.y,{})}):(0,p.jsxs)("div",{className:mB.kL,children:[(0,p.jsx)("div",{className:mB.Tp}),(0,p.jsx)("div",{className:mB.Qs,children:(0,p.jsx)(mF,{premiumSubscription:t})})]})},useSearchTerms:()=>[V.intl.string(V.t["+CbP2v"]),V.intl.string(V.t.Nn1lJy)]}),mX=(0,h.zZ)(S.X.PREMIUM_GUILD_SUBSCRIPTIONS_CATEGORY,{buildLayout:()=>[mz]}),mY=(0,h.t_)(S.X.PREMIUM_GUILD_SUBSCRIPTIONS_PANEL,{useTitle:()=>V.intl.string(V.t["+CbP2v"]),buildLayout:()=>[mX]}),mH=(0,h.i4)(S.X.PREMIUM_GUILD_SUBSCRIPTIONS_SIDEBAR_ITEM,{useTitle:()=>V.intl.string(V.t["+CbP2v"]),icon:gH._,buildLayout:()=>[mY]});var mW=n(153659),mK=n(155984),mZ=n(357758),mq=n(262077),mQ=n(281445),mJ=n(624479),m$=n(626584),m0=n(131607),m1=n(196736),m2=n(685743),m3=n(349085),m4=n(342942),m5=n(376205),m6=n(252589),m8=n(758836),m7=n(49999),m9=n(394107),Ae=n(439050);let At=new m$.A("GameServerSubscriptionsSection");function An(e){return e.toLocaleDateString(void 0,{year:"numeric",month:"numeric",day:"numeric"})}function Ai(e,t){return e.hasSubscription===t.hasSubscription&&e.priceLabel===t.priceLabel&&e.dateLabel===t.dateLabel&&e.isCanceled===t.isCanceled&&e.isDanger===t.isDanger}let Al=f.memo(function(e){let{server:t,planOptionBySkuId:n,canUseShopDiscount:i}=e,{analyticsLocations:l}=(0,eX.Ay)(),s=t.instance.subscriptionId,r=t.instance.planId,a=(0,m3.A)(t.gameId,"cover")??t.coverUrl,[o,u]=(0,m0.kn)([eE.M.GAME_SERVER_HOSTING_PORTKEY_TOS]),d=o!==eE.M.GAME_SERVER_HOSTING_PORTKEY_TOS,c=cE.default.getId()??"0",{handleCopyServerIp:g,animateCopyIcon:m}=(0,m2.A)(c,t.id,tk.A.GAME_SERVER_PAGE,t.serverIp),A=f.useCallback(()=>{(0,m4.A)({provider:mQ.X.SHOCKBYTE,onAccept:()=>{u(m7.i.TAKE_ACTION),g()}})},[u,g]),{hasSubscription:E,priceLabel:h,dateLabel:S,isCanceled:x,isDanger:T}=(0,_.bG)([ur.A,cS.A],()=>{let e=null!=s?ur.A.getSubscriptionById(s):null;if(null==e)return{hasSubscription:!1,priceLabel:null,dateLabel:null,isCanceled:!1,isDanger:!1};let t=null!=e.canceledAt,l=!t&&null!=e.renewalMutations,r=l?e.renewalMutations?.items[0]?.planId:e.items[0]?.planId,a=null!=r?cS.A.get(r):null,o=null!=a?n.get(a.skuId):null,u=i&&o?.nitroPriceAmount!=null?o.nitroPriceAmount:o?.standardPriceAmount,d=null!=u&&o?.priceCurrency!=null?V.intl.formatToPlainString(V.t.AbOLNu,{price:(0,u8.$g)(u,o.priceCurrency)}):null,c=An(e.currentPeriodEnd);return{hasSubscription:!0,priceLabel:d,dateLabel:t?V.intl.formatToPlainString(m9.default["3aEgK6"],{date:c}):l?V.intl.formatToPlainString(m9.default.KFSA3M,{date:c}):V.intl.formatToPlainString(m9.default["9A6cRW"],{date:c}),isCanceled:t,isDanger:t||l}},[s,n,i],Ai),N=f.useCallback(()=>{if(null==s)return;let e=ur.A.getSubscriptionById(s),t=null!=e?An(e.currentPeriodEnd):"";(0,n2.A)({title:V.intl.string(m9.default.TEYPNR),subtitle:V.intl.formatToPlainString(m9.default.XR1WrB,{date:t}),confirmText:V.intl.string(V.t["cY+Oob"]),cancelText:V.intl.string(m9.default.zjfaGH),variant:"critical",onConfirm:async()=>{try{await oU.M2(s,l),await oU.hP()}catch(e){At.error("Failed to cancel game server subscription",e)}}})},[s,l]),C=f.useCallback(()=>{if(null==s)return;let e=ur.A.getSubscriptionById(s);if(null==e)return;let t=e.items[0]?.planId,a=null!=t?cS.A.get(t):null,o=null!=a?n.get(a.skuId):null,u=i&&o?.nitroPriceAmount!=null?o.nitroPriceAmount:o?.standardPriceAmount,d=null!=u&&o?.priceCurrency!=null?(0,u8.$g)(u,o.priceCurrency):"",c=An(e.currentPeriodEnd);(0,n2.A)({title:V.intl.string(m9.default.o96qbc),subtitle:V.intl.formatToPlainString(m9.default["7n6Qq+"],{price:d,date:c}),confirmText:V.intl.string(V.t.iIvF2z),cancelText:V.intl.string(V.t["ETE/oC"]),variant:"primary",onConfirm:async()=>{try{await (0,c5.ur)(r);let t=e.items;await oU.nV(e,{status:I.Dmq.ACTIVE,items:t,currency:e.currency},{amount:0,currency:e.currency},(0,aC.UC)(t,e.currency),l),await oU.hP()}catch(e){At.error("Failed to re-subscribe to game server subscription",e)}}})},[s,r,l,n,i]),b=""!==t.serverIp&&":"!==t.serverIp;return(0,p.jsxs)("div",{className:Ae.nM,children:[(0,p.jsxs)("div",{className:Ae.M4,children:[(0,p.jsxs)("div",{className:Ae.Vs,"aria-hidden":!0,children:[null!=a&&(0,p.jsx)("img",{className:Ae.uP,src:a,alt:""}),(0,p.jsx)("div",{className:Ae.tw})]}),(0,p.jsxs)("div",{className:Ae.CR,children:[(0,p.jsx)(n4.E,{variant:"text-md/semibold",color:"text-default",tag:"span",lineClamp:1,children:t.serverName}),(0,p.jsx)(n4.E,{variant:"text-sm/medium",color:"text-muted",tag:"span",lineClamp:1,children:`${t.gameName} \u{2022} ${t.planName}`}),b&&(d?(0,p.jsxs)("div",{className:Ae.CQ,children:[(0,p.jsx)(n4.E,{variant:"text-sm/medium",color:"text-muted",tag:"span",lineClamp:1,children:t.serverIp}),(0,p.jsx)(n5.D,{className:Ae.cL,onClick:g,"aria-label":V.intl.string(V.t.OpuAlK),children:m?(0,p.jsx)(dt.CheckmarkLargeIcon,{size:"custom",width:16,height:16,color:"currentColor"}):(0,p.jsx)(mJ.CopyIcon,{size:"custom",width:16,height:16,color:"currentColor"})})]}):(0,p.jsx)(uK.A,{onClick:A,children:V.intl.string(m9.default["f+F7H3"])}))]})]}),(0,p.jsxs)("div",{className:Ae.Rd,children:[(0,p.jsxs)("div",{className:Ae.Ff,children:[null!=h&&(0,p.jsx)(n4.E,{variant:"text-md/semibold",color:"text-default",tag:"span",children:h}),null!=S&&(T?(0,p.jsxs)("div",{className:Ae.ez,children:[(0,p.jsx)(i$.E,{size:"xs",color:"text-feedback-critical"}),(0,p.jsx)(n4.E,{variant:"text-sm/medium",color:"text-feedback-critical",tag:"span",children:S})]}):(0,p.jsx)(n4.E,{variant:"text-sm/medium",color:"text-muted",tag:"span",children:S}))]}),E&&(x?(0,p.jsx)(j.$,{variant:"primary",size:"sm",text:V.intl.string(V.t.iIvF2z),onClick:C}):(0,p.jsx)(j.$,{variant:"secondary",size:"sm",text:V.intl.string(V.t["ETE/oC"]),onClick:N}))]})]})});function As(e){let{servers:t}=e,n=(0,m1.H)({location:"user_settings_subscriptions"}),{games:i}=(0,m6.Y)(),l=(0,_.bG)([sx.default],()=>aC.Ay.canUseShopDiscounts(sx.default.getCurrentUser())),s=f.useMemo(()=>{let e=new Map;for(let t of i)for(let n of t.plans??[])e.set(n.id,n);return e},[i]),r=(0,_.yK)([ur.A],()=>(0,m5.HY)(t,i,e=>ur.A.getSubscriptionById(e)),[t,i]);f.useEffect(()=>{let e=r.filter(e=>!cS.A.isLoadedForSKU(e)&&!cS.A.isFetchingForSKU(e));e.length>0&&(0,c5.jv)(e).catch(()=>{})},[r]);let a=f.useCallback(()=>{(0,tY.default)(),(0,ci.pX)(I.BVt.COLLECTIBLES_SHOP_WITH_TAB(m8.G2.GAME_SERVERS))},[]);return(0,p.jsxs)("div",{className:Ae.uW,children:[(0,p.jsxs)("div",{className:Ae.wx,children:[(0,p.jsx)(n4.E,{variant:"text-lg/medium",color:"text-strong",children:V.intl.string(m9.default.vCzwM7)}),(0,p.jsxs)("div",{className:Ae.h_,children:[(0,p.jsx)(n4.E,{variant:"text-sm/normal",color:"text-default",tag:"span",children:V.intl.string(m9.default.y85Eg9)}),n&&(0,p.jsx)(uK.A,{onClick:a,children:(0,p.jsx)(n4.E,{variant:"text-sm/normal",color:"text-link",tag:"span",children:V.intl.string(m9.default["F/BDbC"])})})]})]}),(0,p.jsx)("div",{className:Ae.p_,children:t.map(e=>(0,p.jsx)(Al,{server:e,planOptionBySkuId:s,canUseShopDiscount:l},e.id))})]})}var Ar=n(55766),Aa=n(696986),Ao=n(364036);function Au(e){let{onClickManageSubscription:t,count:n}=e;return(0,p.jsxs)("div",{children:[(0,p.jsx)(C.D,{variant:"heading-md/bold",children:V.intl.string(V.t["KzCF/6"])}),(0,p.jsx)(Aa.h,{size:4}),(0,p.jsx)(n4.E,{variant:"text-md/normal",className:Ao.yV,children:V.intl.string(V.t["3D7qCu"])}),(0,p.jsx)(Aa.h,{size:24}),(0,p.jsxs)("div",{className:Ao.Nr,children:[(0,p.jsx)("img",{src:"/assets/5a420feed295b595.svg",alt:"",className:Ao.RI}),(0,p.jsxs)("div",{className:Ao.FS,children:[(0,p.jsx)(C.D,{variant:"heading-xl/semibold",className:Ao.wx,children:V.intl.string(V.t["KzCF/6"])}),(0,p.jsx)(n4.E,{variant:"text-md/normal",className:Ao.h_,children:V.intl.format(V.t["m+pcOO"],{numSubscriptions:n})})]}),(0,p.jsx)(j.$,{size:"sm",variant:"overlay-primary",text:V.intl.string(V.t["3a8Xxj"]),onClick:t})]})]})}var Ad=n(872351),Ac=n(9113),Ag=n(599941),Am=n(384684),AA=n(2242);let AE=[];var Ah=n(885574),AS=n(62010),Ax=n(912851),AT=n(182744);let Ap=function(e){let{label:t,onClick:n,submitting:i}=e;return(0,p.jsx)(n5.D,{onClick:i?void 0:n,className:AT.x6,children:(0,p.jsxs)("div",{className:AT.hQ,children:[i?(0,p.jsx)(oL.y,{type:oL.y.Type.PULSING_ELLIPSIS,className:AT.__invalid_spinner}):(0,p.jsx)(n4.E,{variant:"text-md/medium",className:AT.Pf,children:t}),(0,p.jsx)(mN.a,{size:"md",color:"currentColor",className:AT.UE})]})})};var Af=n(465932),A_=n(543767),AI=n(951555),AN=n(790284),AC=n(636194),Ab=n(624456),Ay=n(710144),Av=n(815332),Aj=n(162093),AO=n(557506);function AL(e){let{transitionState:t,groupListing:n,listing:i,subscription:l,onClose:s}=e,r=(0,tK.GV)(),{analyticsLocations:a}=(0,eX.Ay)(tk.A.GUILD_ROLE_SUBSCRIPTION_CANCELLATION_MODAL),{cancelSubscription:o,error:u,submitting:d}=function(e){let[t,n]=f.useState(!1),[i,l]=f.useState(null);return{cancelSubscription:async function(t){try{return n(!0),await oU.M2(t,e),!0}catch(e){l(e)}finally{n(!1)}},error:i,submitting:t}}(a);async function c(){await o(l.id)&&s()}let g=i.role_benefits.benefits.filter(e=>e.ref_type===AA.bN.CHANNEL),m=i.role_benefits.benefits.filter(e=>e.ref_type===AA.bN.INTANGIBLE),A=im()(l.currentPeriodEnd).format("MMMM Do, YYYY"),E=V.intl.formatToPlainString(V.t.KsMRP5,{numChannels:g.length,numAdditionalBenefits:m.length,subscriptionEndDate:A});return(0,p.jsx)(lx.a,{transitionState:t,"aria-labelledby":r,actions:[{text:V.intl.string(V.t.EP6EPb),variant:"secondary",onClick:s},{variant:"critical-primary",text:V.intl.string(V.t.F6lUDF),onClick:c,loading:d}],title:V.intl.string(V.t.O6l5tM),subtitle:E,onClose:s,children:(0,p.jsxs)(q.B,{gap:8,children:[null!=u?(0,p.jsx)(iK.w,{type:"critical",message:u.message,role:"alert"}):null,(0,p.jsx)(Aj.x,{listingId:i.id,guildId:n.guild_id,className:AO.P})]})})}var AR=n(319225),AD=n(746080),AP=n(883616);function AG(e){let{label:t,value:n,showInfoIcon:i,infoIconTooltipText:l}=e;return(0,p.jsxs)("div",{className:AP.L0,children:[(0,p.jsxs)("div",{className:AP.a5,children:[(0,p.jsx)(C.D,{variant:"heading-deprecated-12/semibold",className:AP.HU,children:t}),i&&(0,p.jsx)(lg.m,{text:l,children:(0,p.jsx)(Ah.CircleInformationIcon,{size:"xs",color:"currentColor",className:AP.Mo})})]}),(0,p.jsx)(C.D,{variant:"heading-xl/semibold",className:AP.sx,children:n})]})}function AM(e){let{subscription:t}=e,{analyticsLocations:n}=(0,eX.Ay)(),[i]=(0,A_.YV)({subscriptionId:t.id,renewal:!0,analyticsLocations:n,analyticsLocation:tk.A.GUILD_ROLE_SUBSCRIPTION_PAYMENT_SOURCE_WITH_INVOICE}),[l,s]=(0,_.yK)([us.A],()=>[us.A.hasFetchedPaymentSources,us.A.paymentSourceFetchError]);return null!=i&&(l||s)?(0,p.jsx)(AI.A,{subscription:t,currentInvoicePreview:i}):(0,p.jsx)(oL.y,{})}function AU(e){let{isTrial:t,isCancelled:n,isResubscribing:i,shouldHideRoleSubscriptionEntryPoints:l,onCancelSubscriptionClick:s,onResubscribeClick:r,onChangePlanClick:a}=e;return n&&(t||l)?null:(0,p.jsx)(lu.D,{label:V.intl.string(V.t["4neDM+"]),children:(0,p.jsx)("div",{className:AP.__invalid_rowButtons,children:n?(0,p.jsx)(j.$,{variant:"primary",text:V.intl.string(V.t.y3mAE4),onClick:r,loading:i}):(0,p.jsxs)(p.Fragment,{children:[!t&&!l&&(0,p.jsx)(Ap,{label:V.intl.string(V.t.FRbWR8),onClick:a}),(0,p.jsx)(Ap,{label:V.intl.string(V.t.Dx0lF7),onClick:s})]})})})}let AV=function(e){let{subscription:t}=e,{listing:n,groupListing:i,guild:l,expanded:s,handleToggleExpanded:r,subscriptionInfo:a}=function(e){let t=(0,Ab.M)(e),n=(0,_.bG)([AC.A],()=>AC.A.getSubscriptionListingForPlan(t)),i=(0,_.bG)([AC.A],()=>null!=n?AC.A.getSubscriptionGroupListingForSubscriptionListing(n.id):null),l=(0,_.bG)([lv.A],()=>lv.A.getGuild(i?.guild_id)),[s,r]=f.useState(!1),{fetchSubscriptionsSettings:a}=(0,Ag.XE)();f.useEffect(()=>{s&&null!=l&&null==AC.A.getSubscriptionSettings(l.id)&&a(l.id)},[s,l,a]);let o=null==n?void 0:function(e){let{subscription:t}=e,n=im()(t.currentPeriodEnd).format("M/D/YY"),i=null!=t.price?(0,u8.$g)(t.price,t.currency):"",l=im()(t.createdAt).format("M/D/YY"),s=t.status===I.Dmq.CANCELED,r=t.status===I.Dmq.PAST_DUE,a=t.hasActiveTrial;return{memberSince:l,nextRenewalDate:n,nextRenewalLabel:s?V.intl.string(V.t.UAfot2):V.intl.string(V.t.CVjLcM),subscriptionPrice:i,isCancelled:s,isPastDue:r,isTrial:a}}({subscription:e});return{guild:l,expanded:s,handleToggleExpanded:function(){return r(e=>!e)},listing:n,groupListing:i,subscriptionInfo:o}}(t),[o,u]=f.useState(!1),d=(0,tK.GV)(),{analyticsLocations:c}=(0,eX.Ay)(),{shouldHideGuildPurchaseEntryPoints:g}=(0,Af.MH)(l?.id),m=t?.isPurchasedViaAppleGeneric;if(null==i||null==n||null==a)return null;async function A(){try{u(!0),await oU.QP(t,c),(0,AR.E)({title:V.intl.string(V.t.oPV2cy),body:V.intl.string(V.t.DdRizV)})}finally{u(!1)}}let{isCancelled:E,isPastDue:h,subscriptionPrice:x,memberSince:T,nextRenewalDate:N,nextRenewalLabel:C,isTrial:b}=a,y=n.soft_deleted||null==l||m;return(0,p.jsxs)("div",{className:AP.kL,children:[(0,p.jsx)(Ay.A,{onClick:r,className:AP.N1,children:e=>{let{areaRef:t,handleStopPropagation:i}=e;return(0,p.jsxs)(p.Fragment,{children:[null!=l&&(0,p.jsx)(me.Ay,{guild:l,active:!0,size:me.Ay.Sizes.MEDIUM}),(0,p.jsxs)("div",{className:AP.if,children:[(0,p.jsx)(n4.E,{variant:"text-md/medium",className:AP.J5,children:null!=l?l.name:V.intl.string(V.t["He+cmd"])}),(0,p.jsxs)("div",{className:AP.xp,children:[(0,p.jsx)(n4.E,{variant:"text-sm/normal",className:AP.KR,children:n.name}),E?(0,p.jsx)(AS.E,{type:{text:V.intl.string(V.t["7uFZGt"])},variant:"critical"}):b?(0,p.jsx)(AS.E,{type:{text:V.intl.string(V.t["6anton"])},variant:"primary"}):h?(0,p.jsx)(lg.m,{text:V.intl.string(V.t.eSuJE2),children:(0,p.jsx)("div",{className:AP.qc,children:(0,p.jsx)(AS.E,{type:{text:V.intl.string(V.t.NrRwIl)},variant:"warning"})})}):null,m?(0,p.jsx)(lg.m,{text:V.intl.string(V.t.nv1IqK),children:(0,p.jsx)("div",{className:AP.Bi,children:(0,p.jsx)(AS.E,{type:{text:V.intl.string(V.t["sBl3X/"])},variant:"secondary"})})}):null]})]}),(0,p.jsx)(n5.D,{onClick:i(r),"aria-label":V.intl.string(V.t.e5eQOy),"aria-controls":d,"aria-expanded":s,focusProps:{ringTarget:t},children:(0,p.jsx)(mN.a,{size:"md",color:"currentColor",className:ic()(AP.D6,{[AP.S7]:s})})})]})}}),null!=i&&s?(0,p.jsxs)("div",{id:d,children:[(0,p.jsx)("div",{className:AP.yF}),(0,p.jsx)(Av.A,{groupListingId:i.id,subscription:t,className:AP.kE}),(0,p.jsxs)("div",{className:AP.Zx,children:[(0,p.jsx)(AG,{label:C,value:N}),(0,p.jsx)(AG,{label:V.intl.string(V.t.dltUMH),value:x,showInfoIcon:b,infoIconTooltipText:b?V.intl.string(V.t["/q6fpa"]):void 0}),(0,p.jsx)(AG,{label:V.intl.string(V.t.AOcwWB),value:T})]}),(0,p.jsx)(Aa.h,{size:16}),!E&&!m&&(0,p.jsx)(lu.D,{label:V.intl.string(V.t.wmMFvA),children:(0,p.jsx)(AM,{subscription:t})}),!y&&(0,p.jsx)(AU,{isTrial:b,isCancelled:E,isResubscribing:o,shouldHideRoleSubscriptionEntryPoints:g,onCancelSubscriptionClick:function(){if(null!=l&&null!=i&&null!=n){var e;e={groupListing:i,listing:n,subscription:t},(0,lT.openModal)(t=>(0,p.jsx)(AL,{...t,...e}))}},onChangePlanClick:function(){null!=l&&((0,ci.pX)(I.BVt.CHANNEL(l.id,AD.VV.ROLE_SUBSCRIPTIONS)),(0,tY.default)(),Ax.A.show(I.kqX.BACK_TO_PREVIOUS_SCREEN,void 0,V.intl.string(V.t.DvbaM4),()=>{AN.A.setState({subsection:eL.nR}),(0,na.openUserSettings)(S.X.SUBSCRIPTIONS_PANEL)}))},onResubscribeClick:A})]}):null]})};var Ak=n(661097);let Aw=function(e){let{onGoBack:t}=e,n=function(){let{ensureFresh:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,_.bG)([Am.A],()=>(function(){let[e]=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[Am.A],t=e.getGuildIdsWithPurchasableRoles(),n=!1;return(t.forEach(t=>{e.getUserSubscriptionRoles(t).size>0&&(n=!0)}),n)?AA.M_.SUBSCRIBED:0===t.size?AA.M_.NONE:AA.M_.IN_SUBSCRIPTION_SERVER})([Am.A]))===AA.M_.SUBSCRIBED,n=(0,_.bG)([ur.A],()=>ur.A.getActiveGuildSubscriptions()),i=f.useRef(!1);return f.useEffect(()=>{(function(e){let{ensureFresh:t,hasFetched:n,hasRoleSubscriptions:i}=e,l=ur.A.getActiveGuildSubscriptions();return(l?.length??0)===0&&!!i||!!t&&!n||!n&&!ur.A.hasFetchedSubscriptions()})({ensureFresh:e,hasRoleSubscriptions:t,hasFetched:i.current})&&(i.current=!0,oU.hP())},[e,t]),n??AE}(),{loading:i}=(0,Ag.eb)(n);return((0,Ac.A)(oz.Fr?"role-subscriptions-user-setting":void 0),i)?(0,p.jsx)(oL.y,{}):0===n.length?null:(0,p.jsxs)("div",{children:[(0,p.jsx)(j.$,{text:V.intl.string(V.t.hqyhKQ),icon:Ad.z,variant:"secondary",onClick:t}),(0,p.jsx)(Aa.h,{size:10}),(0,p.jsx)(n3.n,{label:V.intl.string(V.t["KzCF/6"]),description:V.intl.string(V.t["Y+ucR7"]),children:(0,p.jsx)("div",{className:Ak.A,children:n.map(e=>(0,p.jsx)(AV,{subscription:e},e.id))})})]})};var AF=n(327479),AB=n(932012);function Az(e){let{onClickManageSubscription:t,count:n}=e;return(0,p.jsxs)("div",{children:[(0,p.jsx)(C.D,{variant:"heading-md/bold",children:V.intl.string(V.t["48ywCu"])}),(0,p.jsx)(Aa.h,{size:4}),(0,p.jsx)(n4.E,{variant:"text-md/normal",className:AB.yV,children:V.intl.string(V.t.VWxmSo)}),(0,p.jsx)(Aa.h,{size:24}),(0,p.jsxs)("div",{className:AB.Nr,children:[(0,p.jsx)("img",{src:"/assets/d6bcd13fb6c85425.svg",alt:"",className:AB._e}),(0,p.jsxs)("div",{className:AB.FS,children:[(0,p.jsx)(C.D,{variant:"heading-xl/semibold",className:AB.wx,children:V.intl.string(V.t["48ywCu"])}),(0,p.jsx)(n4.E,{variant:"text-md/normal",className:AB.h_,children:V.intl.format(V.t["/esXLj"],{numSubscriptions:n})})]}),(0,p.jsx)(AF.A,{onClick:t,text:V.intl.string(V.t["z5YcJ+"])})]})]})}var AX=n(548411),AY=n(417098),AH=n(143582),AW=n(915043),AK=n(631466);function AZ(e){let{className:t,header:n,headerClassName:i,children:l}=e,s=f.useMemo(()=>{let e=!1;return f.Children.forEach(l,t=>{null!=t&&(e=!0)}),e},[l]);return(0,p.jsxs)("div",{className:ic()(AK.iE,t),children:[(0,p.jsx)("div",{className:ic()(AK.wx,i),children:n}),s&&(0,p.jsx)("div",{className:AK.Qs,children:l})]})}var Aq=n(885996),AQ=n(144165),AJ=n(664121),A$=n(950305),A0=n(943775),A1=n(123791),A2=n(900797),A3=n(611643);let A4=f.createContext({isOpen:!1,toggleOpen:()=>{}});function A5(e){let{children:t}=e,[n,i]=f.useReducer(e=>!e,!1),l=f.useMemo(()=>({isOpen:n,toggleOpen:i}),[n]);return(0,p.jsx)(A4.Provider,{value:l,children:t(n)})}A5.Toggle=function(e){let{className:t,text:n}=e,{isOpen:i,toggleOpen:l}=f.useContext(A4),s=i?A2.t:mN.a,r=null!=n?n:i?V.intl.string(V.t.fgq1gs):V.intl.string(V.t.XJuakA);return(0,p.jsxs)(n5.D,{className:ic()(A3.L,t),onClick:l,children:[(0,p.jsx)(n4.E,{variant:"heading-sm/semibold",tag:"div",color:"currentColor",children:r}),(0,p.jsx)(s,{size:"sm",color:"currentColor"})]})};var A6=n(627363),A8=n(328968),A7=n(163437),A9=n(3432);function Ee(e){return e.toLocaleDateString(void 0,{dateStyle:"long"})}var Et=n(562312),En=((d={})[d.LOADING=0]="LOADING",d[d.DONE=1]="DONE",d[d.ERROR=2]="ERROR",d);function Ei(e){let{subscription:t,navigateToSwitchPlan:n,loadingState:i}=e,l=t.metadata?.application_subscription_guild_id,{renewalMutations:s,planId:r}=t,{appId:a,plan:o,storeListing:u,isGuildSubscription:d,subscriptionForGuild:c,sku:g,isCancelled:m,isOrphanedGuildSubscription:A,renewalPlan:E}=(0,_.cf)([cS.A,cx.A,A8.A,lv.A],()=>{let e,n=cS.A.get(r),i=null!=n?cx.A.get(n.skuId):void 0,a=i?.applicationId,o=null!=n?A8.A.getForSKU(n.skuId):null,u=null!=o&&(0,A7.PJ)(o.skuFlags),d=u&&null!=l?lv.A.getGuild(l):void 0,c=(0,A7.Uo)(t,i),g=u&&null!=l&&null==d;if(!1===c&&null!=s&&s.items.length>0){let t=s.items[0];e=cS.A.get(t.planId)??void 0}return{appId:a,isGuildSubscription:u,isOrphanedGuildSubscription:g,plan:n,sku:i,storeListing:o,subscriptionForGuild:d,isCancelled:c,renewalPlan:e}},[l,r,s,t]),{data:h}=(0,A6.YY)(a),S=f.useMemo(()=>null!=h?(0,A0.A)(h,100):null,[h]),x=g?.deleted??!1,T=null!=g&&(0,A7.Se)(g),N=t.status===I.Dmq.PAST_DUE,{analyticsLocations:b}=(0,eX.Ay)(),[y]=(0,A_.YV)({subscriptionId:t.id,renewal:!0,analyticsLocations:b,analyticsLocation:tk.A.APP_SUBSCRIPTION_PAYMENT_SOURCE_WITH_INVOICE}),v=Ee(t.currentPeriodEnd),j=0===i;return(0,p.jsxs)(AZ,{headerClassName:Et.dL,header:!1===j?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("div",{className:Et.VW,children:[null!=S&&(0,p.jsx)(AQ._,{src:S.href,imageClassName:Et.Z2,width:40,height:40}),(0,p.jsxs)("div",{className:Et.aF,children:[(0,p.jsx)(C.D,{variant:"heading-md/semibold",lineClamp:1,children:h?.name??V.intl.string(V.t["7kqy7W"])}),(0,p.jsx)(n4.E,{variant:"text-sm/medium",color:"text-default",lineClamp:1,children:o?.name??V.intl.string(V.t.sqkbMK)})]})]}),(0,p.jsx)("div",{className:Et.Pz,children:null!=h&&null!=u&&null!=g&&(0,p.jsx)(Eo,{subscription:t,app:h,guild:c,sku:g,storeListing:u,isCancelled:m,isOrphanedGuildSubscription:A,navigateToSwitchPlan:n,renewalSkuId:E?.skuId})})]}):(0,p.jsx)(oL.y,{type:oL.t.PULSING_ELLIPSIS}),children:[m&&(0,p.jsx)(Ea,{type:"warning",title:T?V.intl.formatToPlainString(V.t.QOnM1y,{subscriptionPeriodEnd:v}):V.intl.formatToPlainString(V.t.HOaZu8,{subscriptionPeriodEnd:v})}),!m&&A&&(0,p.jsx)(Ea,{type:"warning",title:V.intl.string(V.t.SmSP8Q)}),N&&(0,p.jsx)(Ea,{type:"danger",title:V.intl.string(V.t.fvOqBo)}),(0,p.jsxs)("div",{className:Et.zH,children:[(0,p.jsx)(Er,{title:V.intl.string(V.t["5D/KEH"]),content:d?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("span",{className:Et.yW,children:[(0,p.jsx)(AJ.R,{size:"xs"}),V.intl.string(V.t.QjL3vn)]}),null!=c&&(0,p.jsxs)("span",{className:Et._t,children:[(0,p.jsx)(n4.E,{variant:"text-sm/normal",color:"text-muted",children:V.intl.format(V.t["7ZD8p1"],{guildName:c.name})}),(0,p.jsx)(me.Ay,{guild:c,size:me.Ay.Sizes.MINI})]})]}):(0,p.jsxs)("span",{className:Et.yW,children:[(0,p.jsx)(A$.UserIcon,{size:"xs"}),V.intl.string(V.t["6anEVv"])]})}),(0,p.jsx)(El,{invoicePreview:y,subscriptionPlan:o}),(0,p.jsx)(Er,{title:V.intl.string(V.t.dnUzb6),content:Ee(t.createdAt??t.currentPeriodStart)}),(0,p.jsx)(Es,{isCancelled:m,subscriptionPeriodEnd:v,renewalPlan:E})]}),(0,p.jsx)(Ed,{subscription:t,currentInvoicePreview:y,loadingState:i,isDeleted:x,isCancelled:m}),null!=h&&u?.benefits!=null&&u.benefits.length>0&&(0,p.jsx)(Eu,{appId:h.id,listingBenefits:u.benefits})]})}function El(e){let{subscriptionPlan:t,invoicePreview:n}=e;if(null==t)return(0,p.jsx)(Er,{title:V.intl.string(V.t.KI7ERx),content:""});let i=(0,u8.CE)((0,u8.$g)(t.price,t.currency),t.interval,t.intervalCount),l=n?.findInvoiceItemByPlanId(t.id);if(null==l)return(0,p.jsx)(Er,{title:V.intl.string(V.t.KI7ERx),content:i});let s=(0,u8.CE)((0,u8.$g)(l.subscriptionPlanPrice,t.currency),t.interval,t.intervalCount);return(0,p.jsx)(Er,{title:V.intl.string(V.t.KI7ERx),content:(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(n4.E,{variant:"text-sm/semibold",children:s}),s!==i&&(0,p.jsx)(lg.m,{text:V.intl.format(V.t["6DoE57"],{listPrice:i}),position:"bottom",children:(0,p.jsx)(n4.E,{variant:"text-xs/medium",color:"text-muted",children:(0,p.jsx)("s",{children:i})})})]})})}function Es(e){let{isCancelled:t,subscriptionPeriodEnd:n,renewalPlan:i}=e;if(null!=i){let e=(0,u8.CE)((0,u8.$g)(i.price,i.currency),i.interval,i.intervalCount);return(0,p.jsx)(Er,{title:V.intl.string(V.t.hIhAM3),content:(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(n4.E,{variant:"text-sm/medium",children:n}),(0,p.jsx)(n4.E,{variant:"text-sm/normal",children:V.intl.format(V.t.MCLbvj,{planName:i.name,price:e})})]})})}return(0,p.jsx)(Er,{title:t?V.intl.string(V.t.enxcAl):V.intl.string(V.t["Ms+6Zq"]),content:n})}function Er(e){let{title:t,content:n}=e;return(0,p.jsxs)("div",{className:Et.nM,children:[(0,p.jsx)(n4.E,{variant:"text-sm/medium",children:t}),(0,p.jsx)(n4.E,{variant:"text-sm/medium",className:Et.u4,children:n})]})}function Ea(e){let{type:t,title:n}=e;return(0,p.jsx)("div",{className:Et.Xm,children:(0,p.jsx)(iK.w,{type:"warning"===t?"warning":"critical",message:n,role:"status"})})}function Eo(e){let{app:t,storeListing:i,sku:l,subscription:s,isCancelled:r,isOrphanedGuildSubscription:a,guild:o,renewalSkuId:u,navigateToSwitchPlan:d}=e,c=(0,A7.Se)(l),{analyticsLocations:g}=(0,eX.Ay)(),[m,A]=f.useState(!1),E=(0,A1.C)(t.id),h=(0,_.bG)([cx.A],()=>cx.A.getParentSKU(i.skuId),[i.skuId]),S=f.useMemo(()=>{var e,t;let n;return null==h?[]:(e=i.id,t=E.subscriptions,n=new Set(h.bundledSkuIds),t.filter(t=>t.id!==e&&n.has(t.skuId)))},[i.id,E,h]),x=0!==S.length;async function T(){try{A(!0);let{subscription:e}=await (0,oU.QP)(s,g);if(null==e)return;(0,lT.openModalLazy)(async()=>{let{default:t}=await Promise.all([n.e("888454"),n.e("52396")]).then(n.bind(n,115623));return n=>(0,p.jsx)(t,{...n,storeListing:i,subscription:ub.A.createFromServer(e)})})}finally{A(!1)}}return(0,p.jsxs)("div",{className:Et.fw,children:[c||r&&a?null:r?(0,p.jsx)(j.$,{variant:"secondary",size:"sm",text:V.intl.string(V.t.QtMnkW),onClick:T,loading:m}):(0,p.jsx)(j.$,{variant:"secondary",size:"sm",text:V.intl.string(V.t["E8G/tr"]),onClick:function(){(0,lT.openModalLazy)(async()=>{let{default:e}=await Promise.all([n.e("509032"),n.e("622800")]).then(n.bind(n,301139));return n=>(0,p.jsx)(e,{...n,application:t,storeListing:i,subscription:s,guild:o})})}}),x&&null!=h&&!1===r&&!1===a&&(0,p.jsx)(j.$,{variant:"primary",size:"sm",text:V.intl.string(V.t.R74ZBR),onClick:()=>{d({currentSubscription:s,alternativeListings:S,app:t,subscriptionGroup:h,currentListing:i,renewalSkuId:u})}})]})}function Eu(e){let{appId:t,listingBenefits:n}=e;return(0,p.jsx)(A5,{children:e=>(0,p.jsxs)("div",{className:Et.PX,children:[(0,p.jsxs)("div",{className:Et.wV,children:[e&&(0,p.jsx)(n4.E,{variant:"text-sm/semibold",children:V.intl.string(V.t.mORL67)}),(0,p.jsx)(A5.Toggle,{className:Et.Bh,text:e?V.intl.string(V.t.gsbFAw):V.intl.string(V.t.IwjfxV)})]}),e?n.map(e=>{let{id:n,name:i,description:l,icon:s}=e;return(0,p.jsx)(Aq.FY,{header:i,icon:(0,A9.N)(t,s),description:l},n)}):null]})})}function Ed(e){let{subscription:t,currentInvoicePreview:n,loadingState:i,isDeleted:l,isCancelled:s}=e;return null==n?null:0===i?(0,p.jsx)("div",{className:Et.Ji,children:(0,p.jsx)(lu.D,{label:V.intl.string(V.t.azZaZa),children:(0,p.jsx)(oL.y,{type:oL.t.PULSING_ELLIPSIS})})}):2===i?(0,p.jsx)("div",{className:Et.Ji,children:(0,p.jsxs)(AY.$T,{color:AY.Hv.DANGER,style:{borderRadius:0},children:[V.intl.format(V.t.IIHUUF,{subscriptionId:t.id}),(0,p.jsx)("br",{}),V.intl.format(V.t.fh65ES,{helpLink:"https://support.discord.com/hc/en-us"})]})}):(0,p.jsx)("div",{className:Et.Ji,children:(0,p.jsx)(lu.D,{label:V.intl.string(V.t.azZaZa),children:(0,p.jsx)(AI.A,{subscription:t,currentInvoicePreview:n,disabled:l||s})})})}var Ec=((c={}).HOME="HOME",c.SWITCH_APP_PLANS="SWITCH_APP_PLANS",c),Eg=n(38405);let Em=(0,_.UT)(cS.A,{getQueryId:I.fic.SUBSCRIPTION_PLANS,get:e=>{if(null==e)return null;let t=cS.A.getForSKU(e);return 0===t.length?null:t},load:e=>(null==e&&Eg.A.addBreadcrumb({message:"Error loading subscription plans: skuId is null"}),null!=e?(0,c5.ur)(e).then(()=>{}):Promise.reject())});var EA=n(240248),EE=n(237218),Eh=n(763064);function ES(e){let{children:t,lineClamp:n=2,...i}=e,[l,s]=f.useState(!1),[r,a]=f.useState(null),o=null!=r&&(0,p.jsx)("button",{className:Eh.x6,onClick:()=>s(e=>!e),children:(0,p.jsxs)(n4.E,{className:Eh.B0,variant:"text-sm/medium",color:"text-brand",children:[l?V.intl.string(V.t["JQX/Pb"]):V.intl.string(V.t.Fbrd8J),l?(0,p.jsx)(A2.t,{color:n1.A.colors.TEXT_BRAND,size:"xs"}):(0,p.jsx)(mN.a,{color:n1.A.colors.TEXT_BRAND,size:"xs"})]})}),[u,d]=f.useState(null),c=f.useCallback(()=>{if(null==u)return;let{scrollHeight:e,clientHeight:t}=u;e>t&&a({truncatedHeight:t,expandedHeight:e})},[u]);f.useEffect(()=>{requestAnimationFrame(c)},[c,t,n]);let g="auto";return null!=r&&(g=l?`${r.expandedHeight}px`:`${r.truncatedHeight}px`),(0,p.jsxs)("div",{children:[(0,p.jsx)(n4.E,{...i,className:Eh.Qs,lineClamp:l?void 0:n,ref:d,style:{height:g},children:t}),o]})}var Ex=n(920352);function ET(e){let{cta:t,storeListing:n,className:i}=e,{applicationId:l,benefits:s,description:r}=n,a=f.useMemo(()=>null==n.thumbnail?null:(0,EE.t)(l,n.thumbnail,256),[l,n.thumbnail]),{data:o}=Em(n.skuId),u=f.useMemo(()=>{if(null==o||0===o.length)return null;let e=o[0];return(0,aC._J)(e)},[o]);return null==u?null:(0,p.jsxs)(AZ,{className:ic()(Ex.iE,i),header:(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("div",{className:Ex.qd,children:[null!=a&&(0,p.jsx)(AQ._,{src:a.href,imageClassName:Ex.rW,width:48,height:48}),(0,p.jsxs)("div",{children:[(0,p.jsx)(C.D,{variant:"heading-md/bold",children:n.summary}),(0,p.jsx)(n4.E,{variant:"text-md/medium",children:u})]})]}),t]}),children:[!(0,EA.uJ)(r)&&(0,p.jsx)("div",{className:Ex.h_,children:(0,p.jsx)(ES,{variant:"text-sm/medium",children:r})}),null!=s&&s.length>0&&(0,p.jsx)("div",{className:Ex.PX,children:s.map(e=>{let{id:t,name:n,description:i,icon:s}=e;return(0,p.jsx)(Aq.FY,{header:n,icon:(0,A9.N)(l,s),description:i},t)})})]})}var Ep=n(185438),Ef=n(683380);function E_(e){let{app:t,currentSubscription:n,currentListing:i,alternativeListings:l,navigateToHome:s,subscriptionGroup:r,renewalSkuId:a}=e,o=(0,A0.A)(t,100),u=(0,A7.PJ)(r.flags),d=u?AJ.R:A$.UserIcon,c=u?V.intl.string(V.t["46YF2D"]):V.intl.string(V.t.fFyGiA),g=n.metadata?.application_subscription_guild_id,m=(0,_.bG)([lv.A],()=>u&&null!=g?lv.A.getGuild(g):void 0,[g,u]),A=(0,_.bG)([cx.A],()=>{if(null!=a)return cx.A.get(a)},[a]),E=Ee(n.currentPeriodEnd);return(0,p.jsxs)("div",{children:[(0,p.jsxs)("div",{className:Ef.wx,children:[null!=o&&(0,p.jsx)(AQ._,{src:o.href,imageClassName:Ef.Z2,width:48,height:48}),(0,p.jsxs)("div",{children:[(0,p.jsx)(C.D,{variant:"heading-xl/semibold",children:t.name}),(0,p.jsxs)("div",{className:Ef.p4,children:[(0,p.jsxs)(C.D,{variant:"heading-md/normal",className:Ef.N4,children:[(0,p.jsx)(d,{size:"xs",color:"currentColor"})," ",c]}),null!=m&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(n4.E,{variant:"text-md/normal",children:"\u2022"}),(0,p.jsxs)("span",{className:Ef.vP,children:[(0,p.jsx)(me.Ay,{guild:m,size:me.Ay.Sizes.SMOL}),(0,p.jsx)(C.D,{variant:"heading-md/semibold",color:"text-muted",children:V.intl.format(V.t["7ZD8p1"],{guildName:m.name})})]})]})]})]})]}),(0,p.jsx)(A5,{children:e=>(0,p.jsxs)("div",{className:Ef._B,children:[(0,p.jsx)(n4.E,{variant:"text-md/normal",children:V.intl.string(V.t["goe+hk"])}),e&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(n4.E,{variant:"text-md/normal",children:V.intl.format(V.t["Q8qJ+5"],{})}),(0,p.jsx)(n4.E,{variant:"text-md/normal",children:V.intl.format(V.t.sqowYz,{})})]}),(0,p.jsx)(A5.Toggle,{text:e?V.intl.string(V.t["1Rkq/E"]):V.intl.string(V.t.WsTHkY)})]})}),(0,p.jsxs)("div",{className:Ef.x0,children:[(0,p.jsx)(ET,{storeListing:i,className:Ef.o3,cta:(0,p.jsxs)("div",{className:Ef.cJ,children:[(0,p.jsx)(n4.E,{variant:"eyebrow",color:"text-brand",children:V.intl.string(V.t.fHIpOY)}),null!=A&&(0,p.jsx)(n4.E,{variant:"text-sm/semibold",color:"text-subtle",children:V.intl.format(V.t["OQk+jr"],{endDate:E})})]})}),l.map(e=>e.skuId===a?(0,p.jsx)(ET,{storeListing:e,cta:(0,p.jsx)(n4.E,{variant:"text-sm/semibold",color:"text-subtle",children:V.intl.format(V.t.nn88hB,{startDate:E})})},e.id):(0,p.jsx)(EI,{storeListing:e,guildId:g,navigateToHome:s},e.id))]})]})}function EI(e){let{storeListing:t,guildId:n,navigateToHome:i}=e,{openModal:l}=(0,Ep.A)({analyticsLocation:I.ThZ.APP_SUBSCRIPTIONS_MANAGEMENT,skuId:t.skuId,initialSubscribeForGuild:n,disableGuildSelector:!0,onComplete:i});return(0,p.jsx)(ET,{storeListing:t,cta:(0,p.jsx)(j.$,{variant:"primary",size:"sm",text:V.intl.string(V.t["+KwmBt"]),onClick:l})})}class EN extends f.PureComponent{state={hasError:!1};static getDerivedStateFromError(e){return{hasError:!0}}render(){return this.state.hasError?(0,p.jsxs)(AY.$T,{color:AY.Hv.DANGER,style:{borderRadius:0},children:[V.intl.format(V.t.IIHUUF,{subscriptionId:this.props.subscription.id})," ",V.intl.format(V.t.fh65ES,{helpLink:"https://support.discord.com/hc/en-us"})]}):this.props.children}}function EC(e){let{subscriptions:t,updateHeader:n}=e,[i,l]=f.useState({route:Ec.HOME}),{route:s}=i;function r(){l({route:Ec.HOME})}let a=e=>{l({route:Ec.SWITCH_APP_PLANS,...e}),n(V.intl.string(V.t.VFqtkP),r)},[o,u]=f.useState({});f.useEffect(()=>{for(let e of t){let t=e.items[0]?.planId;null!=t&&(u(t=>({...t,[e.id]:En.LOADING})),(0,AH._R)(t).then(()=>{u(t=>({...t,[e.id]:En.DONE}))}).catch(()=>{u(t=>({...t,[e.id]:En.ERROR}))}))}},[t]);let{loadState:d}=(0,AW.E)(),c=d!==AW.mJ.LOADED;switch(s){case Ec.HOME:return(0,p.jsx)(p.Fragment,{children:t.map(e=>(0,p.jsx)(EN,{subscription:e,children:(0,p.jsx)(Ei,{subscription:e,navigateToSwitchPlan:a,loadingState:c?En.LOADING:o[e.id]??En.LOADING})},e.id))});case Ec.SWITCH_APP_PLANS:let{route:g,...m}=i;return(0,p.jsx)(E_,{...m,navigateToHome:r});default:(0,io.xb)(s)}}var Eb=n(707989);function Ey(e){let{onGoBack:t}=e,n=(0,_.yK)([ur.A],()=>ur.A.getActiveApplicationSubscriptions()?.slice().sort((e,t)=>(e.createdAt?.getTime()??e.currentPeriodStart.getTime())-(t.createdAt?.getTime()??t.currentPeriodStart.getTime()))??[]),[i,l]=f.useState();return null==i&&(i=(0,p.jsx)(Ev,{onBack:t,title:V.intl.string(V.t["DB/m9a"])})),(0,p.jsxs)("div",{children:[i,(0,p.jsx)("div",{className:Eb.A,children:(0,p.jsx)(EC,{subscriptions:n,updateHeader:function(e,t){l((0,p.jsx)(Ev,{title:e,onBack:()=>{t(),l(void 0)}}))}})})]})}function Ev(e){let{onBack:t,title:n}=e;return(0,p.jsxs)("div",{className:Eb.D,children:[(0,p.jsx)(ld.K,{"aria-label":V.intl.string(V.t["13/7kX"]),icon:()=>(0,p.jsx)(AX.Z,{size:"sm"}),onClick:t,variant:"icon-only"}),(0,p.jsx)(C.D,{variant:"heading-lg/semibold",children:n})]})}var Ej=n(366999),EO=n(391659);function EL(e){let t,n,{showChargingUpState:i,rowValueText:l,endsAt:s,fractionalSt