Loading
Showing the first 250,000 characters. Open raw for the full source.
function(e,t,a){a.d(t,{x:()=>pj}),a(321073);var n,l,s,i,r=a(477900),o=a(582128),d=a(17928),c=a(314116),u=a(270003),m=a(243721),h=a(532446),x=a(821609),p=a(834730),g=a(364522),v=a(611677),j=a(691885),f=a(95477),b=a(404778),y=a(77729),E=a(952818),_=a(905552),C=a(293246),S=a(157257),N=a(915725),A=a(693117),k=a(822151),D=a(227628),I=a(468550);let T=(0,a(196765).v)(()=>({enabled:!1,pending:null,lastResult:null}));function R(e){T.setState({enabled:e})}function O(e){T.setState({pending:e})}function w(e){T.setState({lastResult:e})}var M=a(781710),L=a(696016),P=a(264572).Buffer;function U(){let e=T(e=>e.enabled),t=T(e=>e.pending),a=T(e=>e.lastResult),n=o.useCallback(async(e,t,a,n)=>{let l=C.Ay.getMediaEngine();if(null==l.setClipsPerfMonitoring)return w("setClipsPerfMonitoring unsupported in this build"),null;O(n);try{let n=await l.setClipsPerfMonitoring(e,t,a);return R(n.enabled),n}catch(e){return w(`${n} failed: ${e instanceof Error?e.message:String(e)}`),null}finally{O(null)}},[]),l=o.useCallback(async t=>{R(t);let a=await n(t,!1,!1,t?"enable":"disable");null!=a?w(`recorder ${a.enabled?"enabled":"disabled"}`):R(e)},[n,e]),s=o.useCallback(async()=>{let t=await n(e,!0,!1,"save");if(null==t)return;if(""===t.html)return void w("save: server returned empty html");let a=`clips-perf-${new Date().toISOString().replace(/[:.]/g,"-")}.html`;try{let e=P.from(t.html,"utf8"),n=await y.A.fileManager.saveWithDialog2(e,a);if(null!=n&&!0===n.canceledByUser)return void w("save: canceled");w(`saved ${t.eventCount} events (${t.html.length} bytes)`)}catch(e){w(`save failed: ${e instanceof Error?e.message:String(e)}`)}},[n,e]),i=o.useCallback(async()=>{let t=await n(e,!1,!0,"clear");null!=t&&w(`cleared ${t.eventCount} events`)},[n,e]);return(0,r.jsxs)(u.n,{label:"Clips v3 Performance",children:[(0,r.jsx)(m.d,{label:"Record Clips v3 performance",description:"Toggles the in-process perf recorder inside discord_clips.exe.",checked:e,disabled:null!=t,onChange:l}),(0,r.jsxs)(h.M,{children:[(0,r.jsx)(x.$,{text:"Save as file...",disabled:null!=t,onClick:s}),(0,r.jsx)(x.$,{text:"Clear recording",variant:"secondary",disabled:null!=t,onClick:i})]}),(null!=t||null!=a)&&(0,r.jsx)(p.E,{variant:"text-sm/normal",color:"text-muted",children:null!=t?`working: ${t}...`:a})]})}function G(){let e=(0,D.MZ)(e=>e.isOpen),t=(0,I.sY)(e=>e.isOpen),[a,n]=o.useState(3),l=o.useCallback(e=>{let t=Object.values(N.Ay.getClips()),a=t.find(e=>null!=e.applicationId);if(a?.applicationId==null)return;let n=a.applicationId,l=t.filter(e=>e.applicationId===n).slice(0,e);N.Ay.devSetLastClipsSession({applicationName:a.applicationName,newClipIds:l.map(e=>e.id),ended:!0}),(0,I.M8)(n)},[]),s=o.useCallback(e=>{e?l(a):(0,I.kF)()},[l,a]),i=o.useCallback(()=>{let e=Object.values(N.Ay.getClips()),t=(0,_.A)(E.Ay,S.A),a=(t?.id!=null?e.find(e=>e.applicationId===t.id):void 0)??e.find(e=>null!=e.applicationId);if(a?.applicationId==null)return;let n=a.applicationId,l=e.filter(e=>e.applicationId===n).slice(0,10);N.Ay.devSetLastClipsSession({applicationName:a.applicationName,newClipIds:l.map(e=>e.id),ended:!0}),(0,D.w9)()},[]),C=o.useCallback(e=>{e?i():(0,D.yj)()},[i]),T=o.useCallback(e=>{n(e),t&&l(e)},[l,t]),[R,O]=o.useState(L.rb.KILL),[w,P]=o.useState(1),[G,F]=o.useState(""),[B,$]=o.useState(""),V=(0,d.bG)([N.Ay],()=>N.Ay.isAutoStashEnabled()),W=o.useCallback(e=>{e?(0,c.A)({title:"Stash all gaming sessions?",subtitle:"Every gaming session will be stashed to your Desktop (inside the `decider_stash` folder) when it ends. This setting is not persistent \u2014 it resets to off each time Discord launches.",confirmText:"Enable",variant:"primary",onConfirm:()=>{A.mN(!0)}}):A.mN(!1)},[]),[z,H]=o.useState([]),[K,Y]=o.useState(void 0),q=o.useCallback(e=>{H(e),Y(t=>null!=t&&e.includes(t)?t:e[0])},[]),J=o.useCallback(async()=>{let e=y.A.clips.debugListStashedClipDeciderSessions;null!=e&&q(await e())},[q]);o.useEffect(()=>{let e=!0,t=y.A.clips.debugListStashedClipDeciderSessions;if(null!=t)return t().then(t=>{e&&q(t)}),()=>{e=!1}},[q]);let Q=(0,d.bG)([N.Ay],()=>N.Ay.getState().clipsSettings.enableAutoclipping),X=(0,d.bG)([N.Ay],()=>N.Ay.getEnableAutoclipping());return(0,r.jsx)(g.Ip,{children:(0,r.jsxs)(v.l,{children:[(0,r.jsx)(u.n,{label:"Send Test Signals",children:(0,r.jsxs)(h.M,{children:[(0,r.jsx)(x.$,{text:"Manual",onClick:()=>A.Ts({type:L.Gy.MANUAL})}),(0,r.jsx)(x.$,{text:"Distributed",onClick:()=>A.Ts({type:L.Gy.DISTRIBUTED,remoteTriggerUserId:"123",remoteTriggerClipId:"456"})}),(0,r.jsx)(x.$,{text:"Shouting",onClick:()=>A.Ts({type:L.Gy.SHOUTING,userId:"123",confidence:1})}),(0,r.jsx)(x.$,{text:"Laughter",onClick:()=>k.A.debugCreateRankableLaughterClip()})]})}),(0,r.jsxs)(u.n,{label:"Game Event Creator",children:[(0,r.jsxs)(h.M,{children:[(0,r.jsx)(j.l,{label:"Event Type",value:R,onSelectionChange:e=>O(e),options:[{id:"kill",label:"Kill",value:L.rb.KILL},{id:"multikill",label:"Multikill",value:L.rb.MULTIKILL},{id:"death",label:"Death",value:L.rb.DEATH},{id:"assist",label:"Assist",value:L.rb.ASSIST},{id:"item",label:"Item",value:L.rb.ITEM},{id:"victory",label:"Victory",value:L.rb.VICTORY},{id:"defeat",label:"Defeat",value:L.rb.DEFEAT},{id:"level_up",label:"Level Up",value:L.rb.LEVEL_UP},{id:"treasure",label:"Treasure",value:L.rb.TREASURE},{id:"objective_kill",label:"Objective Kill",value:L.rb.OBJECTIVE_KILL}],selectionMode:"single",fullWidth:!0}),(0,r.jsx)(j.l,{label:"Importance",value:w,onSelectionChange:P,options:[{id:"low",label:"Low",value:0},{id:"medium",label:"Medium",value:.5},{id:"high",label:"High",value:1}],selectionMode:"single",fullWidth:!0})]}),(0,r.jsx)(f.k,{label:"Title (optional)",value:G,onChange:F,placeholder:"e.g., First Blood"}),(0,r.jsx)(f.k,{label:"Description (optional)",value:B,onChange:$,placeholder:"e.g., Killed enemy ADC in bot lane"}),(0,r.jsx)(x.$,{text:"Create Game Event",onClick:()=>{A.Ts({type:L.Gy.GAME_EVENT,eventType:R,importance:w,title:G,description:B})}}),(0,r.jsx)(m.d,{label:"Auto-stash decider data",description:"Stashes every gaming session to your Desktop when it ends. Resets to off on each Discord launch.",checked:V,onChange:W}),(0,r.jsx)(j.l,{label:"Stash session (re-run ranking)",value:K,onSelectionChange:e=>Y(e),options:z.map(e=>({id:e,label:e,value:e})),placeholder:0===z.length?"No stashed sessions":"Most recent",disabled:0===z.length,selectionMode:"single",fullWidth:!0}),(0,r.jsxs)(h.M,{children:[(0,r.jsx)(x.$,{text:"re-run ranking",onClick:()=>{k.i.debugRerunRanking(K).catch(e=>{L.nx.error("re-run ranking failed",e)})}}),(0,r.jsx)(x.$,{text:"refresh sessions",variant:"secondary",onClick:()=>{J()}})]})]}),(0,r.jsx)(u.n,{label:"Clip Metadata Tool",children:(0,r.jsx)(M.A,{})}),(0,r.jsx)(b.c,{}),(0,r.jsx)(U,{}),(0,r.jsx)(b.c,{}),(0,r.jsxs)(u.n,{label:"Reminder UI",children:[(0,r.jsx)(m.d,{label:"Clips Quick Bar",description:"Force-show the inline quick bar above the account panel. Fabricates a session (up to 10 clips) from your recent clips so it can be tested without capturing a real game session.",checked:e,onChange:C}),(0,r.jsx)(m.d,{label:"Clips Reminder",description:"Force-show the post-session ClipsReminder panel. Fabricates a session from your most recent clips (and game) so it can be tested without capturing a real game session.",checked:t,onChange:s}),(0,r.jsx)(j.l,{label:"Clip count",value:a,onSelectionChange:T,options:[{id:"1",label:"1 clip",value:1},{id:"2",label:"2 clips",value:2},{id:"3",label:"3 clips",value:3}],selectionMode:"single",fullWidth:!0}),(0,r.jsx)(b.c,{}),(0,r.jsxs)(u.n,{label:"Clips Settings",children:[(0,r.jsxs)(p.E,{variant:"text-md/normal",children:["autoclippingEnabled (internal): ",String(Q)]}),(0,r.jsxs)(p.E,{variant:"text-md/normal",children:["autoclippingEnabled (exposed): ",String(X)]}),(0,r.jsx)(x.$,{text:"unset autoclipping default",onClick:()=>{A.uL(void 0,!1)}})]})]})]})})}var F=a(503698),B=a.n(F),$=a(939249),V=a(683071),W=a(331322),z=a(811893),H=a(297264),K=a(538064),Y=a(265059),q=a(902592),J=a(869146);a(323874),a(14289),a(35956);var Q=a(789645),X=a(589158),Z=a(65593),ee=a(377980),et=a(581298),ea=a(393284),en=a(287809),el=a(901139),es=a(641886),ei=a(780898),er=a(652215),eo=a(789543),ed=a(427262);function ec(e){let{nameplate:t}=e,a=(0,d.bG)([en.default],()=>en.default.getCurrentUser()),n=ed.Ay.useName(a)??"";return(0,r.jsx)(eo.g,{username:n,selfMute:!1,selfDeaf:!1,serverMute:!1,serverDeaf:!1,suppress:!1,speaking:!1,streaming:!1,status:er.clD.ONLINE,currentUser:a,activities:[],applicationStream:void 0,userTag:"",speakingWhileMuted:!1,speakingWhilePTTInactive:!1,occluded:!1,dismissibleContents:{avatar:[],settings:[]},awaitingRemote:!1,nameplate:t,voiceChannel:null,isQuestBarEmpty:!0,isListenAlongVisible:!1})}var eu=a(736653),em=a(653523),eh=a(429044);function ex(e){let{selected:t,onSelect:a}=e,n=(0,eu.Ay)();return(0,r.jsxs)("div",{className:eh.N,children:[(0,r.jsx)(p.E,{variant:"text-sm/semibold",children:"Preselected Gradient"}),(0,r.jsx)("div",{className:eh.Z,children:es.Z6.map(e=>{let l=n!==er.NJ8.LIGHT?e.darkBackground:e.lightBackground,s=t===e.name;return(0,r.jsx)(em.S4,{onSelect:()=>a(e),style:{background:l},name:e.name,isSelected:s},e.name)})})]})}var ep=a(715069),eg=a(95701),ev=a(331884);function ej(e){let{selected:t,nameplate:a}=e,n=(0,ev.i)(),l=new eg.cq({id:"0",type:er.rbe.DM,name:"self",guild_id:"0",recipients:[n.id]});return(0,r.jsx)(ep.th,{selected:t,channel:l,user:n,nameplate:a})}var ef=a(698638),eb=a(10539);function ey(){let[e,t]=(0,o.useState)(!1),[a,n]=(0,o.useState)(!1),[l,s]=(0,o.useState)(null),{node:i}=(0,et.Ay)(ea.k,""),d=(0,el.Ay)(e=>e.toolsCache),{setToolsCache:c,removeToolsCache:u}=(0,el.DE)(),{setImgCache:m}=(0,el.TW)(),h=(0,o.useCallback)(e=>{let t=d[e];null!=t?s({previewToolKey:t.url,palette:t.palette,skuId:"0"}):s(t=>null==t?{previewToolKey:e,palette:es.Wj,skuId:"0"}:{...t,previewToolKey:e})},[d]),g=(0,o.useCallback)(e=>{s(t=>null==t?null:{...t,palette:e})},[]),v=(0,o.useCallback)(e=>{u(e)},[u]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:eb.ne,children:[(0,r.jsxs)("div",{className:eb.gO,children:[(0,r.jsx)(x.$,{size:"sm",onClick:()=>{n(!1),t(e=>!e)},variant:"secondary",text:"Toggle Themes"}),(0,r.jsx)(x.$,{size:"sm",onClick:()=>{t(!1),n(e=>!e)},variant:"secondary",text:"Toggle Gradients"})]}),(0,r.jsxs)("div",{className:eb.uQ,children:[e&&(0,r.jsx)(ee.A,{node:i}),a&&(0,r.jsx)(ex,{selected:l?.palette?.name,onSelect:e=>{l?.previewToolKey!=null&&c(l.previewToolKey,l.previewToolKey,e),g(e)}})]})]}),(0,r.jsxs)("div",{className:eb.iW,children:[(0,r.jsx)(eE,{nameplate:l},l?.palette?.name),(0,r.jsxs)("div",{className:eb.Uo,children:[(0,r.jsx)(p.E,{variant:"text-sm/semibold",children:"Drag background image to screen"}),(0,r.jsx)(Z.A,{title:"upload image",description:"upload the background",icons:ef.xi,onDrop:async e=>{let t=URL.createObjectURL(e[0]),a=e[0],n=await a.arrayBuffer();m(t,t,(0,ei.nI)(n)),c(t,t,es.Wj)}}),(0,r.jsx)("div",{className:eb.is,children:Object.values(d).map(e=>{let{url:t}=e;return(0,r.jsx)(e_,{src:t,onSetStatic:h,removeAsset:v},t)})}),(0,r.jsx)(eS,{label:"gradient override",onChange:e=>g({name:es.AK,darkBackground:e,lightBackground:e})}),(0,r.jsx)(eC,{label:"set",onClick:()=>{}})]})]})]})}function eE(e){let{nameplate:t}=e,[a,n]=(0,o.useState)(320),l=(0,o.useRef)(null),s=(0,o.useRef)(null),i=(0,o.useRef)(null),d=(0,o.useRef)(document),c=(0,o.useCallback)(e=>{if(null!=l.current){let t=l.current.getBoundingClientRect();n(Math.max(264,Math.min(432,e.clientX-t.left)))}},[]),u=(0,o.useCallback)(e=>{e.preventDefault(),e.stopPropagation();let t=e.currentTarget.ownerDocument;function a(e){e.preventDefault(),c(e)}function n(){null!=s.current&&(t.removeEventListener("mousemove",s.current),s.current=null),null!=i.current&&(t.removeEventListener("mouseup",i.current),i.current=null)}d.current=t,s.current=a,i.current=n,t.addEventListener("mousemove",a),t.addEventListener("mouseup",n)},[c]);return(0,o.useEffect)(()=>()=>{null!=s.current&&(d.current.removeEventListener("mousemove",s.current),s.current=null),null!=i.current&&(d.current.removeEventListener("mouseup",i.current),i.current=null)},[]),(0,r.jsx)(g.Ip,{className:eb.Fp,orientation:"horizontal",children:(0,r.jsxs)("div",{ref:l,className:eb.ey,style:{width:`${a}px`},children:[(0,r.jsx)(p.E,{variant:"text-sm/semibold",children:"Memberlist"}),(0,r.jsx)(eN,{nameplate:t}),(0,r.jsx)(p.E,{variant:"text-sm/semibold",children:"DMs"}),(0,r.jsx)(eA,{nameplate:t}),(0,r.jsx)(p.E,{variant:"text-sm/semibold",children:"RTC"}),(0,r.jsx)(ek,{nameplate:t}),(0,r.jsx)("div",{className:eb.Di,onMouseDown:u})]})})}function e_(e){let{src:t,onSetStatic:a,removeAsset:n}=e;return(0,r.jsxs)("div",{className:eb.xO,children:[(0,r.jsx)($.D,{onClick:()=>n(t),className:eb.yV,children:(0,r.jsx)(Q.P,{size:"custom",width:16,height:16,name:"x"})}),(0,r.jsx)("img",{className:eb.Ez,src:t,alt:""}),(0,r.jsx)("div",{className:eb.Lu,children:(0,r.jsx)(x.$,{onClick:()=>a(t),size:"sm",variant:"secondary",text:"set nameplate"})})]})}function eC(e){let{label:t,onClick:a}=e;return(0,r.jsxs)("div",{className:eb.Uu,children:[(0,r.jsx)(p.E,{variant:"text-sm/normal",children:"coming soon"}),(0,r.jsx)(x.$,{variant:"secondary",size:"sm",text:t,disabled:!0,onClick:a})]})}function eS(e){let{label:t,onChange:a}=e;return(0,r.jsxs)("div",{className:eb.Im,children:[(0,r.jsx)(p.E,{variant:"text-sm/normal",children:t}),(0,r.jsx)("input",{onChange:e=>{a(e.target.value)},className:eb.QL,placeholder:"#000000"})]})}function eN(e){let{nameplate:t}=e,a=(0,d.bG)([en.default],()=>en.default.getCurrentUser());return(0,r.jsx)("div",{className:eb.VH,children:(0,r.jsxs)("div",{className:eb.H1,children:[(0,r.jsx)(p.E,{className:eb.Pf,variant:"text-sm/semibold",children:"DEFAULT"}),(0,r.jsx)(X.A,{nameplate:t,user:a,currentUser:a}),(0,r.jsx)(p.E,{className:eb.Pf,variant:"text-sm/semibold",children:"FOCUSED"}),(0,r.jsxs)("div",{children:[(0,r.jsx)(X.A,{nameplate:t,selected:!0,user:a,currentUser:a}),(0,r.jsx)(X.A,{selected:!0,user:a,currentUser:a})]})]})})}function eA(e){let{nameplate:t}=e;return(0,r.jsx)("div",{className:eb.VH,children:(0,r.jsxs)("div",{className:eb.H1,children:[(0,r.jsx)(p.E,{className:eb.Pf,variant:"text-sm/semibold",children:"DEFAULT"}),(0,r.jsx)(ej,{nameplate:t}),(0,r.jsx)(p.E,{className:eb.Pf,variant:"text-sm/semibold",children:"FOCUSED"}),(0,r.jsxs)("div",{children:[(0,r.jsx)(ej,{selected:!0,nameplate:t}),(0,r.jsx)(ej,{selected:!0})]})]})})}function ek(e){let{nameplate:t}=e;return(0,r.jsx)("div",{className:eb.VH,children:(0,r.jsx)("div",{className:eb.X2,children:(0,r.jsx)(ec,{nameplate:t})})})}a(508300);var eD=a(132500),eI=a(157559),eT=a(780777),eR=a(993408),eO=a(579151),ew=a(25176),eM=a(816866),eL=a(87558),eP=a(575593),eU=a(631903),eG=a(224640),eF=a(408278),eB=a(972213),e$=a(43990),eV=a(192308),eW=a(661531),ez=a(231723),eH=a(900686),eK=a(986687),eY=a(977850),eq=a(435558),eJ=a.n(eq),eQ=a(855915),eX=a(480335);let eZ=e=>{let{profileEffect:t}=e,a=o.useMemo(()=>(0,eq.cloneDeep)(t),[t]),n=o.useMemo(()=>t.effects.some(e=>null!=e.randomizedSources&&e.randomizedSources.length>0),[t.effects]),l=o.useMemo(()=>{if(n){var e;let n=1===(e=a.effects.reduce((e,t)=>{let a=1+(t.randomizedSources??[]).length;return a>1?1===e?a:Math.min(a,e):e},1))?-1:Math.floor(Math.random()*e);n>0&&t.effects.forEach((e,t)=>{null!=e.randomizedSources&&e.randomizedSources.length>0&&(a.effects[t].src=e.randomizedSources[n-1].src)})}return a},[t.effects,a,n]),s="debug",{layerData:i}=(0,eQ.A)({skuId:s,layers:l.effects});return(0,r.jsx)(eX.p,{profileEffect:l,skuId:s,layerData:i})};var e0=a(227373),e1=a(778765);let e2="https://cdn.discordapp.com/assets/content/ad2a252a6866e1ecb3bab521e2baaabbf13ab2d1ecaa8af67862c53c91f76761.png",e3={[eL.qH.THUMBNAIL]:null,[eL.qH.STATIC]:null,[eL.qH.REDUCED_MOTION]:null},e8="debug",e5="reduced-motion-preview-modal";function e6(e){let{transitionState:t,onClose:a,frameSrc:n,theme:l}=e;return(0,r.jsx)(eG.d,{transitionState:t,size:"md",onClose:a,maxHeight:"viewport",children:(0,r.jsxs)("div",{className:e0.Xd,children:[(0,r.jsx)("div",{className:e0.y6,children:(0,r.jsx)(eF.K,{"aria-label":"Close",onClick:a,icon:eB.d,variant:"overlay-secondary",size:"sm"})}),(0,r.jsxs)("div",{className:e0.rU,children:[(0,r.jsx)(e$.N,{theme:l,children:e=>(0,r.jsx)("img",{src:e2,alt:"",className:B()(e0.aM,e),"aria-hidden":!0})}),null!=n&&""!==n&&(0,r.jsx)("img",{src:n,className:e0.SD,alt:"Reduced motion preview"})]})]})})}function e7(e){let{type:t,frame:a,theme:n,onClear:l}=e,s=t===eL.qH.REDUCED_MOTION,i=s?e2:e1.A,o=(0,r.jsx)(e$.N,{theme:n,children:e=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("img",{src:i,alt:"",className:B()(e0.aM,e),"aria-hidden":!0}),a?.src!=null&&""!==a.src&&(0,r.jsx)("img",{src:a.src,className:B()(e0.SD,e),alt:""})]})});return(0,r.jsxs)("div",{className:e0.pK,children:[(0,r.jsx)(H.D,{variant:"heading-sm/bold",children:t}),s?(0,r.jsx)($.D,{className:B()(e0.zd,e0.eB),onClick:function(){(0,eV.hasModalOpen)(e5)?(0,eV.closeModal)(e5):(0,eV.openModalLazy)(()=>Promise.resolve(e=>(0,r.jsx)(e6,{...e,frameSrc:a?.src??null,theme:n})),{modalKey:e5,onCloseRequest:()=>(0,eV.closeModal)(e5)})},children:o}):(0,r.jsx)("div",{className:e0.zd,children:o}),null!=a&&(0,r.jsx)(x.$,{variant:"critical-secondary",size:"sm",text:"Clear",onClick:l})]})}let e4=e=>{let{profileEffect:t}=e,{upsertProfileEffect:a}=(0,eM.wu)(),n=(0,d.bG)([en.default],()=>en.default.getCurrentUser()),[l,s]=o.useState(!0),i=o.useRef({}),[c,u]=o.useState(!1),[m,h]=o.useState(!1),[g,v]=o.useState(8),[j,f]=o.useState([]),[b,y]=o.useState(e3),E=o.useRef([]),[_,C]=o.useState(t.name),S=_.toLowerCase().replace(/\s+/g,"_"),N=o.useMemo(()=>({type:eP.R.PROFILE_EFFECT,skuId:e8,title:e8,description:e8,accessibilityLabel:e8,reducedMotionSrc:"",thumbnailPreviewSrc:"",effects:j,animationType:eU.l.ANIMATION_TYPE_UNSPECIFIED}),[j]),A=c?eW.A.themes.DARKER:eW.A.themes.LIGHT;function k(e){let t=e.currentTarget.files;return null==t?null:t[0]}function D(e,t){let a=k(t);null!=a&&(0,eL.Mz)(a,t=>{y(n=>({...n,[e]:(0,eL.GT)(t,a)}))})}o.useEffect(()=>{let e=t.effects;e.length>0&&f(e.map(e=>({...e,name:e.name??(0,eL.XG)(e.src),randomizedSources:e.randomizedSources?.map(e=>({...e,filename:e.filename??(0,eL.XG)(e.src)}))})))},[t.effects]),o.useEffect(()=>{let e=t.stillFrames;null!=e&&Object.entries(e).forEach(e=>{let[t,a]=e;if(null!=a){if(""!==a.src&&null!=a.src&&(""===a.base64||null==a.base64))y(e=>({...e,[t]:a}));else if(""!==a.base64&&null!=a.base64){let e=(0,eL.fB)(a.base64);a.src=e,E.current.push(e),y(e=>({...e,[t]:a}))}}})},[t.stillFrames]);let I={profileEffect:t,upsertProfileEffect:a},T=o.useRef(I);return(o.useEffect(()=>{T.current=I}),o.useEffect(()=>{let{profileEffect:e,upsertProfileEffect:t}=T.current;e.readonly||t({skuId:e.skuId,name:_,effects:j,stillFrames:b})},[j,b,_]),o.useEffect(()=>()=>{E.current.forEach(e=>{URL.revokeObjectURL(e)}),E.current=[]},[]),null==n)?(0,r.jsx)("div",{}):(0,r.jsxs)("div",{className:e0.zr,children:[(0,r.jsxs)("div",{style:{display:"none"},children:[(0,r.jsx)(eT.A,{ref:e=>{i.current.animated=e},onChange:function(e){let t=k(e);null!=t&&(0,eL.Mz)(t,async e=>{let a=await (0,eL.Ay)(e,t,j.length);f(e=>[...e,a])})},multiple:!1}),(0,r.jsx)(eT.A,{ref:e=>{i.current.thumbnail=e},onChange:e=>D(eL.qH.THUMBNAIL,e),multiple:!1}),(0,r.jsx)(eT.A,{ref:e=>{i.current.static=e},onChange:e=>D(eL.qH.STATIC,e),multiple:!1}),(0,r.jsx)(eT.A,{ref:e=>{i.current.reducedMotion=e},onChange:e=>D(eL.qH.REDUCED_MOTION,e),multiple:!1})]}),(0,r.jsxs)("div",{className:e0.Vg,children:[(0,r.jsxs)("div",{className:B()(e0.nM,e0.uW),children:[(0,r.jsx)(p.E,{variant:"text-md/normal",children:"Profile Effect Name"}),(0,r.jsx)("input",{type:"text",value:_,className:e0.hF,onChange:e=>{C(e.target.value)}})]}),(0,r.jsxs)("div",{className:e0.nM,children:[(0,r.jsx)(p.E,{variant:"text-md/normal",children:"Dark Theme"}),(0,r.jsx)("input",{type:"checkbox",checked:c,className:e0.OO,onChange:()=>{u(!c)}}),(0,r.jsx)(p.E,{variant:"text-md/normal",children:"Show User Profile"}),(0,r.jsx)("input",{type:"checkbox",checked:m,className:e0.OO,onChange:()=>{h(!m)}})]}),(0,r.jsxs)("div",{className:e0.nM,children:[(0,r.jsx)(p.E,{variant:"text-md/normal",children:"Border Radius"}),(0,r.jsx)("input",{type:"range",min:4,max:24,step:2,value:g,onChange:e=>v(+e.target.value)}),(0,r.jsxs)(p.E,{variant:"text-sm/normal",children:[g,"px"]})]}),(0,r.jsxs)("div",{className:B()(e0.nz,e0.VH),style:{borderRadius:g},children:[m?(0,r.jsx)("div",{className:e0.jq,children:(0,r.jsx)(eY.A,{user:n,currentUser:n,transitionState:ez.ip.ENTERED,onClose:()=>{},themeContainerClassName:e0.JB})}):(0,r.jsx)(e$.N,{theme:A,children:e=>(0,r.jsx)("div",{className:B()(e0.aM,e),children:(0,r.jsx)("img",{src:e1.A,alt:"",width:400})})}),l&&(0,r.jsx)("div",{className:e0.KJ,children:(0,r.jsx)(eZ,{profileEffect:N})})]}),(0,r.jsx)("div",{children:m&&(0,r.jsxs)("div",{className:B()(e0.f5,e0.VH),style:{borderRadius:g},children:[(0,r.jsx)(eK.A,{user:n,pendingAvatar:void 0,pendingProfileEffect:null,hideProfileFrame:!0,canUsePremiumCustomization:!0,isTryItOut:!0}),(0,r.jsx)(eZ,{profileEffect:N})]})}),(0,r.jsxs)("div",{className:e0.nz,children:[(0,r.jsxs)("div",{className:e0.nM,children:[(0,r.jsx)(x.$,{variant:"active",text:"Upload Animated Layer",onClick:()=>i.current.animated?.activateUploadDialogue()}),(0,r.jsx)(p.E,{variant:"text-sm/semibold",children:"Make sure to upload the bottommost layer first!"})]}),(0,r.jsxs)("div",{className:e0.nM,children:[(0,r.jsx)(x.$,{variant:"active",text:"Upload thumbnail.png",onClick:()=>i.current.thumbnail?.activateUploadDialogue()}),(0,r.jsx)(x.$,{variant:"active",text:"Upload static.png",onClick:()=>i.current.static?.activateUploadDialogue()}),(0,r.jsx)(x.$,{variant:"active",text:"Upload reduced_motion.png",onClick:()=>i.current.reducedMotion?.activateUploadDialogue()})]}),(0,r.jsx)("div",{className:e0.q6,children:(0,r.jsx)("div",{className:e0.nM,children:(0,r.jsx)(x.$,{variant:"primary",text:"Replay Animation",onClick:()=>{s(!1),setTimeout(()=>s(!0),100)}})})}),(0,r.jsxs)("div",{className:B()(e0.q6,e0.XA),children:[(0,r.jsx)(p.E,{variant:"text-sm/semibold",children:"Please download both configs for the drop package!"}),(0,r.jsx)(p.E,{variant:"text-sm/bold",color:"text-feedback-critical",children:"WARNING: The full config is really big :0"}),(0,r.jsxs)("div",{className:e0.nM,children:[(0,r.jsx)(eH.A,{fileContents:()=>(0,eL.rs)(j),contentType:"text/plain",fileName:`${S}_timing_config.txt`,children:(0,r.jsx)(x.$,{variant:"primary",size:"sm",text:"Download Timing Config"})}),(0,r.jsx)(eH.A,{fileContents:function(){return JSON.stringify({...t,name:_,readonly:!1,effects:j,stillFrames:b})},contentType:"text/plain",fileName:`${S}_config.txt`,children:(0,r.jsx)(x.$,{variant:"primary",size:"sm",text:"Download Full Config"})})]})]}),(0,r.jsxs)("div",{className:e0.uW,children:[(0,r.jsx)(H.D,{variant:"heading-lg/bold",children:"Still Frames"}),(0,r.jsx)("div",{className:e0.mv,children:Object.entries(b).map(e=>{let[t,a]=e;return(0,r.jsx)(e7,{type:t,frame:a,theme:A,onClear:()=>{y(e=>({...e,[t]:null}))}},t)})})]}),j.some(e=>(e.randomizedSources??[]).length>0)&&(0,r.jsxs)("div",{className:B()(e0.uW,e0.l7),children:[(0,r.jsx)(p.E,{variant:"text-md/bold",children:"Rules of Randomized Effects"}),(0,r.jsxs)("ol",{children:[(0,r.jsx)("li",{children:"When an effect has randomization, all layers with random options must have the same number of options."}),(0,r.jsx)("li",{children:"The duration for the random options of a layer must be the same"}),(0,r.jsx)("li",{children:"If multiple layers have randomization, the same option will be used for all layers. (For example, the second option will be used for ALL layers)"}),(0,r.jsx)("li",{children:'Click "Replay Animation" to "reroll" the randomization'})]})]})]}),(0,r.jsxs)("div",{className:B()(e0.Vg,e0.ZF),children:[(0,r.jsx)("div",{className:e0.cD,children:(0,r.jsx)(x.$,{variant:"critical-secondary",text:"Clear Assets",onClick:function(){f([]),y(e3)}})}),j.map((e,t)=>(0,r.jsxs)("div",{className:e0.ec,children:[(0,r.jsxs)("div",{className:e0.D1,children:[(0,r.jsx)(H.D,{variant:"heading-md/bold",children:e.name}),(0,r.jsx)("img",{src:e.src,className:e0.oq,alt:""}),null!=e.randomizedSources&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(H.D,{variant:"heading-md/bold",children:"Alternatives"}),e.randomizedSources.map((e,t)=>(0,r.jsxs)("div",{children:[null!=e.filename&&(0,r.jsx)(H.D,{variant:"heading-sm/semibold",children:e.filename}),(0,r.jsx)("img",{src:e.src,className:e0.oq,alt:""})]},e.filename??`randomized-${t}`))]})]}),(0,r.jsxs)("div",{className:B()(e0.Vg,e0.uW),children:[(0,r.jsxs)("div",{className:e0.nz,children:[(0,r.jsx)(p.E,{variant:"text-md/bold",children:"Start"}),(0,r.jsx)("input",{type:"number",value:e.start,className:e0.hF,onChange:e=>{f(a=>{let n=[...a],l=a[t];return l.start=+e.target.value,n[t]=l,n})},contentEditable:!0})]}),(0,r.jsxs)("div",{className:e0.nz,children:[(0,r.jsx)(p.E,{variant:"text-md/bold",children:"Duration"}),(0,r.jsx)("input",{type:"number",value:e.duration,className:e0.hF,onChange:e=>{f(a=>{let n=[...a],l=a[t];return l.duration=+e.target.value,n[t]=l,n})},contentEditable:!0})]})]}),(0,r.jsxs)("div",{className:B()(e0.Vg,e0.uW),children:[(0,r.jsxs)("div",{className:e0.nz,children:[(0,r.jsx)(p.E,{variant:"text-md/bold",children:"Loop"}),(0,r.jsx)("input",{type:"checkbox",checked:e.loop,className:e0.OO,onChange:e=>{f(a=>{let n=[...a],l=a[t];return l.loop=e.target.checked,n[t]=l,n})}})]}),(0,r.jsx)("div",{className:e0.nz,children:e.loop&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(p.E,{variant:"text-md/bold",children:"Loop Delay"}),(0,r.jsx)("input",{type:"number",value:e.loopDelay,className:e0.hF,onChange:e=>{f(a=>{let n=[...a],l=a[t];return l.loopDelay=+e.target.value,n[t]=l,n})},contentEditable:!0})]})})]}),(0,r.jsx)("div",{style:{display:"none"},children:(0,r.jsx)(eT.A,{ref:e=>{i.current[`randomized-${t}`]=e},onChange:e=>{let a;null!=(a=k(e))&&(0,eL.Mz)(a,e=>{f(n=>{let l=[...n],s=n[t];if(null==s)return n;let i={...s};return null==i.randomizedSources&&(i.randomizedSources=[]),i.randomizedSources.push({src:e,filename:a.name}),l[t]=i,l})})},multiple:!1})}),(0,r.jsxs)("div",{className:B()(e0.nM,e0._N),children:[(0,r.jsx)(x.$,{variant:"secondary",text:"Add Alternative",onClick:()=>i.current[`randomized-${t}`]?.activateUploadDialogue()}),(0,r.jsx)(x.$,{variant:"critical-secondary",text:"Remove Layer",onClick:()=>{f(t=>t.filter(t=>t!==e))}})]})]},t))]})]})]})},e9="Make sure you're only uploading text files!";function te(e){let{profileEffect:t,onClick:a}=e,{deleteProfileEffect:n}=(0,eM.wu)();return(0,r.jsxs)($.D,{className:e0.B0,onClick:a,children:[(0,r.jsx)("div",{className:e0.yV,style:{backgroundImage:`url(${t.effects?.[0]?.base64})`}}),(0,r.jsxs)("div",{className:e0.eL,children:[(0,r.jsx)(p.E,{variant:"text-md/bold",children:t.name}),(0,r.jsx)(x.$,{variant:"critical-secondary",text:"Delete",onClick:e=>{e.preventDefault(),e.stopPropagation(),n(t.skuId)}})]})]})}function tt(){let{profileEffects:e,upsertProfileEffect:t,clearAll:a}=(0,eM.wu)(),[n,l]=o.useState(),s=o.useRef(null),{categories:i}=(0,eO.A)(),d=o.useMemo(()=>(0,eR.Wj)(i),[i]),[c,u]=o.useState(""),m=o.useMemo(()=>""===c?d:d.filter(e=>{let t=c.toLowerCase(),a=e.title?.toLowerCase()??"",n=e.description?.toLowerCase()??"";return a.includes(t)||n.includes(t)}),[c,d]),h=o.useCallback((e,a)=>{if(null==a||!e.type.startsWith("text/"))return(0,ew.Ni)(e9);let[n,l]=a.split(",");if(!n.includes("text/plain"))return(0,ew.Ni)(e9);let s=JSON.parse(atob(l));s.skuId=(0,eD.A)(),t(s),(0,ew.GF)("Profile Effect (maybe??) imported!")},[t]),g=o.useCallback(e=>{e.currentTarget?.files==null?(0,ew.Ni)("Error uploading file. Try again!"):(0,ew.KE)(e.currentTarget.files,h,ew.Ni)},[h]);return(0,r.jsxs)("div",{className:e0.zr,children:[null==n&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:e0.nz,children:[(0,r.jsxs)("div",{className:B()(e0.uW,e0.nM),children:[(0,r.jsx)(H.D,{variant:"heading-xl/bold",children:"Custom Profile Effects"}),(0,r.jsx)(x.$,{variant:"critical-secondary",text:"Clear All",onClick:async()=>{await eI.A.confirm({title:"Clear All Profile Effects",body:"Are you sure you want to clear all profile effects? This cannot be undone.",confirmText:"Clear All",confirmVariant:"critical-primary"})&&(a(),(0,ew.GF)("All profile effects cleared!"))}})]}),(0,r.jsx)("div",{className:e0.Iv,children:Object.values(e).map(e=>(0,r.jsx)(te,{profileEffect:e,onClick:()=>l(e)},e.skuId))})]}),(0,r.jsxs)("div",{className:B()(e0.nM,e0._N,e0.uW),children:[(0,r.jsxs)("div",{className:e0.au,children:[(0,r.jsx)(p.E,{variant:"text-md/normal",color:"text-overlay-light",children:"Import Shared Config"}),(0,r.jsx)(eT.A,{ref:s,onChange:g,multiple:!1})]}),(0,r.jsx)(x.$,{variant:"primary",text:"Create New Effect",onClick:function(){t({skuId:(0,eD.A)(),name:"New Profile Effect",effects:[]})}})]}),(0,r.jsx)("hr",{}),(0,r.jsxs)("div",{className:e0.uW,children:[(0,r.jsx)(H.D,{variant:"heading-xl/bold",children:"All Effects"}),(0,r.jsx)(f.k,{value:c,onChange:e=>{u(e)}}),(0,r.jsx)("div",{className:e0.xm,children:m.map(e=>(0,r.jsx)($.D,{className:e0.S5,style:{backgroundImage:`url(${e.thumbnailPreviewSrc})`},onClick:()=>{let t={[eL.qH.THUMBNAIL]:null!=e.thumbnailPreviewSrc&&""!==e.thumbnailPreviewSrc?{src:e.thumbnailPreviewSrc,name:"thumbnail.png",base64:""}:null,[eL.qH.STATIC]:null!=e.staticFrameSrc&&""!==e.staticFrameSrc?{src:e.staticFrameSrc,name:"static.png",base64:""}:null,[eL.qH.REDUCED_MOTION]:null!=e.reducedMotionSrc&&""!==e.reducedMotionSrc?{src:e.reducedMotionSrc,name:"reduced_motion.png",base64:""}:null};l({skuId:e.skuId,name:e.title,effects:e.effects,stillFrames:t,readonly:!0})},children:(0,r.jsx)("div",{className:e0.Hd,children:(0,r.jsx)(p.E,{variant:"text-md/normal",color:"text-overlay-light",children:e.title})})},e.skuId))})]})]}),null!=n&&(0,r.jsx)(e4,{profileEffect:n})]})}var ta=a(935399),tn=a(462887),tl=a(289873),ts=a(478016),ti=a(565645),tr=a(7584),to=a(619499),td=a(207803),tc=a(84540),tu=a(836602),tm=a(999291),th=a(903209),tx=a(841702),tp=a(892118),tg=a(744808),tv=a(92943),tj=a(626768),tf=a(464896);function tb(){let e=(0,eu.Ay)();return(0,r.jsxs)("div",{className:tv.z3,children:[(0,r.jsx)("img",{src:(0,tn.M)(e)?tj:tf,alt:""}),(0,r.jsx)(p.E,{variant:"text-sm/normal",children:"No frames found on your account. You must be granted test profile frame entitlements to use this tool."})]})}function ty(){let e=(0,d.bG)([en.default],()=>en.default.getCurrentUser()),t=(0,tm.Ay)(e?.id);o.useEffect(()=>{e?.id!=null&&(0,th.A)(e.id)},[e?.id]);let{purchases:a,isFetchingPurchases:n}=(0,tx.Bf)(),l=o.useMemo(()=>(0,eR.MG)(a,new Map),[a]),[{pendingProfileFrame:s},i]=(0,d.yK)([tu.A],()=>[tu.A.getPendingChanges(),tu.A.showNotice()]),c=void 0===s?t?.profileFrame:s,u=null!=c?a.get(c.skuId):void 0,m=(0,tp.s)(u?.items[0])?u.items[0]:void 0;return(0,ta.l0)(td.RE),(0,r.jsxs)("div",{className:tv.kL,children:[(0,r.jsxs)(H.D,{variant:"heading-xl/bold",children:[(0,r.jsx)(ti.A,{emojiName:tr.Ay.getByName("frame_with_picture")?.surrogates,className:tv.Zg}),"Profile Frames!"]}),0===l.length&&n&&(0,r.jsx)(tl.y,{}),0===l.length&&!n&&(0,r.jsx)(tb,{}),l.length>0&&(0,r.jsxs)("div",{className:tv.MK,children:[(0,r.jsx)(p.E,{variant:"text-sm/normal",children:"Select a frame to preview. Save to apply the frame to your main profile."}),(0,r.jsxs)("ul",{className:tv.p_,children:[(0,r.jsx)("li",{children:(0,r.jsx)(x.$,{text:"None",variant:"secondary",fullWidth:!0,icon:null==c?ts.U:void 0,disabled:null==c,onClick:()=>(0,tc.p)({profileFrame:null})})},"none"),l.map(e=>{let t=a.get(e.skuId);return null==t?null:(0,r.jsx)("li",{children:(0,r.jsx)(x.$,{text:t.name,variant:"secondary",fullWidth:!0,icon:c?.skuId===e.skuId?ts.U:void 0,disabled:c?.skuId===e.skuId,onClick:()=>(0,tc.p)({profileFrame:e})})},e.skuId)})]}),i&&(0,r.jsx)(to.A,{}),(0,r.jsxs)("div",{className:tv.VH,children:[(0,r.jsx)(p.E,{variant:"text-sm/normal",children:"Preview:"}),(0,r.jsxs)("div",{className:tv.ME,children:[(0,r.jsx)("img",{src:e1.A,alt:""}),null!=m&&(0,r.jsx)(tg.A,{frame:m})]})]})]})]})}var tE=a(702841),t_=a(793574),tC=a(590180),tS=a(4227),tN=a(258245),tA=a(61750),tk=a(128818);let tD=e=>{let[t,a]=o.useState(0);return o.useLayoutEffect(()=>{let e=tS.A.getPurchase;return tS.A.getPurchase=e=>void 0,tS.A.emitChange(),a(1),()=>{tS.A.getPurchase=e,tS.A.emitChange()}},[]),(0,r.jsx)("div",{className:tk.Do,children:(0,r.jsx)(tN.A,{...e},t)})},tI=()=>{let e=(0,tE.bG)([en.default],()=>en.default.getCurrentUser()),t=(0,tE.bG)([tC.A],()=>tC.A.categories),a=(0,tE.bG)([tS.A],()=>tS.A.purchases),n=(0,tE.bG)([tC.A],()=>tC.A.lastSuccessfulFetch),l=t.size>0&&a.size>0&&null!=n,{isFetching:s,categories:i}=(0,tx.Ay)({logPerf:!1,stalePurchasesOK:!0,noOp:l}),d=l?t:i,c=l||!s&&d.size>0,[u,m]=o.useState(""),[h,g]=o.useState(null),[v,j]=o.useState(null);return(o.useEffect(()=>{if(""===u.trim()||!c){g(null),j(null);return}let e=tC.A.getProduct(u),t=tC.A.getCategoryForProduct(u);null!=e&&null!=t?(g(e),j(t)):(g(null),j(null))},[u,c]),s)?(0,r.jsx)(p.E,{variant:"text-md/normal",children:"Loading categories and collectibles..."}):null==e?(0,r.jsx)(p.E,{variant:"text-md/normal",children:"No user found"}):(0,r.jsxs)("div",{className:tk.kL,children:[(0,r.jsxs)("div",{className:tk.uW,children:[(0,r.jsx)(H.D,{variant:"heading-lg/semibold",children:"Product Configuration"}),(0,r.jsxs)("div",{className:tk.qp,children:[(0,r.jsx)(p.E,{variant:"text-md/semibold",className:tk.NB,children:"Primary Product SKU ID"}),(0,r.jsx)(f.k,{value:u,onChange:m,placeholder:"Enter product SKU ID"}),!c&&""!==u.trim()&&(0,r.jsx)(p.E,{variant:"text-sm/normal",className:tk.KQ,children:"Loading products..."}),c&&""!==u.trim()&&null==h&&(0,r.jsx)(p.E,{variant:"text-sm/normal",className:tk.kc,children:"Product not found"}),null!=h&&(0,r.jsxs)(p.E,{variant:"text-sm/normal",className:tk.xT,children:["Found: ",h.name]})]})]}),(0,r.jsxs)("div",{className:tk.uW,children:[(0,r.jsx)(H.D,{variant:"heading-lg/semibold",children:"Product Preview"}),null!=h&&null!=v?(0,r.jsxs)("div",{className:tk.i1,children:[(0,r.jsx)(tD,{skuId:h.skuId}),(0,r.jsx)(x.$,{variant:"primary",onClick:function(){null!=h&&null!=e&&(0,tA.A)({product:h,analyticsLocations:[t_.A.COLLECTIBLES_SHOP_CARD]})},text:"Show Collectibles Collected Modal"})]}):(0,r.jsx)("div",{className:tk.qf,children:(0,r.jsx)(p.E,{variant:"text-md/normal",className:tk.X2,children:"Enter a valid product SKU ID to see the preview"})})]})]})};var tT=a(788620);let tR={profile_effects:1,nameplates:2,profile_frames:3,product_preview:4};function tO(e){let{setTab:t}=e,a=(0,d.bG)([J.A],()=>J.A.getWindowOpen(er.MLl.DEVTOOLS_POPOUT));return(0,r.jsxs)("div",{className:tT.Qs,children:[(0,r.jsx)($.D,{onClick:()=>{t(1)},children:(0,r.jsx)("div",{className:B()(tT.vK,tT.Dg),children:(0,r.jsx)(p.E,{variant:"text-md/bold",color:"text-overlay-light",children:"Profile Effects"})})}),(0,r.jsx)($.D,{onClick:()=>{t(2)},children:(0,r.jsx)("div",{className:B()(tT.vK,tT.st),children:(0,r.jsx)(p.E,{variant:"text-md/bold",color:"text-overlay-light",children:"Nameplates"})})}),(0,r.jsx)($.D,{onClick:()=>{t(3)},children:(0,r.jsx)("div",{className:B()(tT.vK,tT.BW),children:(0,r.jsx)(p.E,{variant:"text-md/bold",color:"text-overlay-light",children:"Profile Frames"})})}),(0,r.jsx)($.D,{onClick:()=>{t(4)},children:(0,r.jsx)("div",{className:B()(tT.vK,tT.IP),children:(0,r.jsx)(p.E,{variant:"text-md/bold",color:"text-overlay-light",children:"Products"})})}),!a&&(0,r.jsx)("div",{style:{marginTop:16},children:(0,r.jsx)(V.w,{type:"warning",children:(0,r.jsxs)(W.B,{gap:8,children:[(0,r.jsx)(p.E,{variant:"text-md/semibold",children:"Not enough space?"}),(0,r.jsx)(p.E,{variant:"text-sm/normal",children:"You can pop out the DevTools to see the full layout."}),(0,r.jsx)(x.$,{size:"sm",icon:z.t,variant:"secondary",onClick:q.openDevToolsPopout,text:"Popout DevTools"})]})})})]})}let tw=function(){let[e,t]=o.useState(()=>{let e=Y.A.lastOpenSubTabId;return null!=e&&e in tR?tR[e]:0});return o.useEffect(()=>{null!=Y.A.lastOpenSubTabId&&(0,K.Jt)({lastOpenSubTabId:null})},[]),(0,r.jsxs)(g.Ip,{className:tT.iE,children:[(0,r.jsxs)("div",{className:tT.C$,children:[(0,r.jsx)(H.D,{variant:"heading-xxl/medium",children:"Collectibles DevTools"}),0!==e&&(0,r.jsx)(x.$,{variant:"primary",onClick:()=>t(0),text:"Back"})]}),function(){switch(e){case 1:return(0,r.jsx)(tt,{});case 2:return(0,r.jsx)(ey,{});case 3:return(0,r.jsx)(ty,{});case 4:return(0,r.jsx)(tI,{});default:return(0,r.jsx)(tO,{setTab:t})}}()]})};var tM=a(681154),tL=a(306264),tP=a(506774),tU=a(228366),tG=a(587895),tF=a(429913),tB=a(475825),t$=a(221694);function tV(e){let{columns:t,data:a,className:n,rowClassName:l,onClickRow:s,selectedRowKey:i,rowHeight:d=40}=e,c=o.useMemo(()=>t.map(e=>({renderHeader:()=>(0,r.jsx)(p.E,{variant:"text-sm/semibold",children:e.key}),...e})),[t]),u=0===a.length?[1]:[a.length];return(0,r.jsx)("div",{className:t$.CZ,children:(0,r.jsx)(tB.OZ,{className:n,innerClassName:t$.tp,sections:u,sectionHeight:40,renderSection:e=>{let{section:t}=e,n=t$.ZR;return(0,r.jsx)("div",{className:n,children:c.map(e=>{let n=e.cellClassName,l={width:`calc(${e.cellWidth??"1fr"} - 16px)`};return(0,r.jsx)("div",{className:n,style:l,children:e.renderHeader?.(e,a)},`dev-tools-th-${t}-${e.key}`)})},`dev-tools-header-${t}`)},rowHeight:d,renderRow:e=>{let{rowIndex:t}=e,n=a[t];if(null==n)return null;let o=n.key,u=B()(t$.jD,{[t$.wD]:o===i,rowClassName:l});return(0,r.jsx)($.D,{className:u,onClick:()=>s?.(n),children:c.map(e=>{let a=e.cellClassName,l={width:`calc(${e.cellWidth??"1fr"} - 16px)`,height:`calc(${d}px - 16px)`};return(0,r.jsx)("div",{className:a,style:l,children:e.render?.(n,void 0,t)},`dev-tools-td-${t}-${e.key}`)})},`dev-tools-tr-${t}`)}})})}var tW=a(409626),tz=a(692969),tH=a(760751),tK=a(403362),tY=a(435738),tq=a(99753),tJ=a(975732),tQ=a(574520),tX=a(808323),tZ=a(583846),t0=a(424994),t1=a(510525);function t2(e){let{id:t}=e,a=(0,d.bG)([en.default],()=>en.default.getUser(t));return null==a?null:(0,r.jsx)($.D,{className:t1._,onClick:function(){(0,tJ.openUserProfileModal)({sourceAnalyticsLocations:[t_.A.DEV_TOOLS],userId:t})},children:(0,r.jsx)(p.E,{variant:"text-md/semibold",children:a.username})})}function t3(){let e=(0,d.bG)([tq.A],()=>tq.A.getFeed(t0.X1.GLOBAL_FEED)),t=(0,d.bG)([tq.A],()=>tq.A.getFilters()),a=(0,d.cf)([tQ.A],()=>{let t={};for(let a of e?.entries??[])t[(0,tQ.$)(a.content)]=tQ.A.canRenderContent(a.content);return t},[e]),n=(0,d.bG)([tY.A],()=>tY.A.getImpressionCappedItemIds());if(null==t)return null;let l=e?.entries?.flatMap(e=>{let{content:l}=e;if(!(0,tX.l)(t,l))return[];let s=a[(0,tQ.$)(l)];return(0,r.jsxs)("li",{className:t1.p,children:[(0,r.jsx)(t2,{type:l.author_type,id:l.author_id}),!s&&(0,r.jsx)(p.E,{variant:"text-md/normal",children:"Expired or no matching presence"}),(0,tZ.I5)(l)&&(0,r.jsxs)(p.E,{variant:"text-md/normal",children:["Expired at ",l.expires_at]}),n.has(l.id)&&(0,r.jsx)(p.E,{variant:"text-md/normal",children:"Impression capped"})]},l.id)});return(0,r.jsxs)("div",{children:[(0,r.jsx)(H.D,{variant:"heading-md/semibold",children:"Selected Content"}),null!=l?(0,r.jsx)("ul",{children:l}):(0,r.jsx)("div",{children:"(none?)"})]})}var t8=a(576470),t5=a(693879);function t6(){let e=(0,d.bG)([tq.A],()=>tq.A.getFeed(t0.X1.GLOBAL_FEED)?.refresh_stale_inbox_after_ms!=null),{loading:t,nextFetchDate:a}=(0,d.cf)([tq.A],()=>tq.A.getFeedState(t0.X1.GLOBAL_FEED)??{loading:!1}),n=(0,d.bG)([tq.A],()=>tq.A.getLastFeedFetchDate(t0.X1.GLOBAL_FEED));return(0,r.jsxs)("div",{children:[t?(0,r.jsx)(p.E,{variant:"text-md/normal",children:"(fetching)"}):(0,r.jsxs)(p.E,{variant:"text-md/normal",children:["Next fetch: ",null!=a?(0,r.jsx)(t8.A,{deadline:a}):e?"(awaiting push)":"(unscheduled)"]}),(0,r.jsxs)(p.E,{variant:"text-md/normal",children:["Last fetch:"," ",null!=n?(0,r.jsx)(t5.z,{inline:!0,entry:{start:n.getTime()}}):"(never)"]})]})}var t7=a(965599);let t4=[{key:"type",cellClassName:B()(t7.Hn,t7.T$),render(e){let{type:t}=e;return(0,r.jsx)(p.E,{variant:"text-md/semibold",children:tM.ContentInventoryEntryType[t]})}},{key:"count",cellClassName:B()(t7.Hn,t7.MX),render(e){let{entries:t}=e;return(0,r.jsx)("div",{children:(0,r.jsx)(p.E,{variant:"text-md/normal",children:t.length})})}},{key:"only?",cellClassName:t7.Hn,render(e){let{type:t}=e;return(0,r.jsx)(t9,{type:t})}}];function t9(e){let{type:t}=e,a=(0,d.bG)([tq.A],()=>tq.A.getFilters()),n=a?.types?.has(t)??!1;return(0,r.jsx)(m.d,{checked:n,onChange:function(){n?tU.h.dispatch({type:"CONTENT_INVENTORY_SET_FILTERS",filters:void 0}):tU.h.dispatch({type:"CONTENT_INVENTORY_SET_FILTERS",filters:{types:new Set([t])}})}})}function ae(){var e;let t,a=(0,d.bG)([tq.A],()=>tq.A.getFeed(t0.X1.GLOBAL_FEED)),n=(0,d.bG)([tq.A],()=>tq.A.getDebugImpressionCappingDisabled()),l=(0,d.bG)([tY.A],()=>tY.A.getDebugFastImpressionCappingEnabled()),s=(e=a?.entries?.map(e=>e.content),Object.keys(t=eJ().groupBy(e,e=>e.content_type)).map(e=>{let a=t[e];return{key:`${e}`,type:a[0].content_type,entries:a}})),i=(0,d.bG)([tq.A],()=>tq.A.getFeedState(t0.X1.GLOBAL_FEED)?.loading===!0),[c,u]=o.useState(""),m=(0,d.bG)([tH.A,tG.A],()=>parseInt(c)>0?c:tH.A.searchGamesByName(c)[0]??tG.A.getApplicationByName(c)?.id,[c]),h=(0,tz.A)({applicationId:m,location:"DevToolsContentInventory",source:tW.GameProfileSources.DevTools}),v=Object.entries(tP.w.get("GameProfileModal")??{}).filter(e=>{let[t,a]=e;return a}).map(e=>{let[t]=e;return t}),j=(0,tF.A)(v).filter(tK.Vq);return(0,r.jsx)("div",{className:t$.nd,children:(0,r.jsxs)(g.Ip,{className:t7.Qs,children:[(0,r.jsxs)(W.B,{gap:8,children:[(0,r.jsx)(p.E,{variant:"text-md/semibold",children:"Inventory"}),s.length>0&&(0,r.jsx)(tV,{columns:t4,data:s}),(0,r.jsx)(t6,{}),(0,r.jsx)(x.$,{variant:"primary",text:"Refresh Now",fullWidth:!0,onClick:function(){tU.h.dispatch({type:"CONTENT_INVENTORY_MANUAL_REFRESH",feedId:t0.X1.GLOBAL_FEED,feature:tL.M.INBOX})},loading:i})]}),(0,r.jsxs)(W.B,{gap:8,children:[(0,r.jsx)(p.E,{variant:"text-md/semibold",children:"Impression Capping"}),(0,r.jsx)(x.$,{variant:"primary",text:"Clear Impressions",fullWidth:!0,onClick:function(){tU.h.dispatch({type:"CONTENT_INVENTORY_DEBUG_CLEAR_IMPRESSIONS"})}}),(0,r.jsx)(x.$,{variant:"primary",text:"Log Impressions",fullWidth:!0,onClick:function(){tU.h.dispatch({type:"CONTENT_INVENTORY_DEBUG_LOG_IMPRESSIONS"})}}),(0,r.jsx)(x.$,{variant:"primary",text:n?"Enable Impression Capping":"Disable Impression Capping",fullWidth:!0,onClick:function(){tU.h.dispatch({type:"CONTENT_INVENTORY_DEBUG_TOGGLE_IMPRESSION_CAPPING"})}}),(0,r.jsx)(x.$,{variant:"primary",text:l?"Disable Fast Impression Capping":"Enable Fast Impression Capping",fullWidth:!0,onClick:function(){tU.h.dispatch({type:"CONTENT_INVENTORY_DEBUG_TOGGLE_FAST_IMPRESSION_CAPPING"})}})]}),!1,(0,r.jsx)(t3,{}),(0,r.jsxs)(W.B,{gap:8,children:[(0,r.jsx)(p.E,{variant:"text-md/semibold",children:"Game Profile"}),(0,r.jsx)(f.k,{placeholder:"App ID or full name",onChange:e=>(0===e.length||e.length>=18)&&u(e),onKeyDown:e=>{"Enter"===e.key&&(c===e.currentTarget.value?h?.(e):u(e.currentTarget.value))},error:c.length>0&&null==h?`No game profile for ${m??c+" - try by id"}.`:void 0,helperText:null!=h?"Game profile found":void 0}),(0,r.jsx)("ul",{children:j.map(e=>(0,r.jsx)("li",{children:(0,r.jsx)(at,{application:e})},`follow-game-${e.id}`))})]})]})})}function at(e){let{application:t}=e,a=(0,tz.A)({applicationId:t.id,location:"DevToolsContentInventory",source:tW.GameProfileSources.DevTools});return(0,r.jsx)($.D,{onClick:a,children:(0,r.jsx)(p.E,{variant:"text-xs/normal",color:"text-muted",children:t.name})})}var aa=a(783878),an=a(769015),al=a(311043),as=a(569926),ai=a(282435);function ar(e){return ai.jN.get(e)??0}function ao(e){let{gameId:t}=e,{data:a,isLoading:n}=(0,as.I)(t),l=(0,d.bG)([al.A],()=>al.A.hasNoData(t),[t]);return n||null==a&&!l?(0,r.jsx)(p.E,{variant:"text-sm/normal",color:"text-muted",children:"Loading\u2026"}):null==a?(0,r.jsxs)(p.E,{variant:"text-sm/normal",color:"text-feedback-critical",children:["No game found for ID ",t]}):(0,r.jsxs)(W.B,{direction:"horizontal",gap:8,align:"center",children:[(0,r.jsx)(an.A,{game:a,size:an.M.SMALL}),(0,r.jsxs)(W.B,{gap:0,children:[(0,r.jsx)(p.E,{variant:"text-md/semibold",children:a.name}),(0,r.jsx)(p.E,{variant:"text-xxs/normal",color:"text-muted",children:a.id})]})]})}function ad(){let[e,t]=o.useState(null),[a,n]=o.useState(""),l=(0,d.bG)([tH.A],()=>tH.A.games),s=o.useMemo(()=>l.filter(e=>null!=e.name&&""!==e.name).map(e=>({id:e.id,value:e.id,label:e.name})).sort((e,t)=>ar(t.value)-ar(e.value)),[l]),i=o.useMemo(()=>({baseSort:(e,t)=>ar(t.item.value)-ar(e.item.value),keys:["label"]}),[]),c=o.useCallback(e=>{t(e),null!=e&&n("")},[]),u=o.useCallback(e=>{n(e),e.trim().length>0&&t(null)},[]),m=a.trim(),h=m.length>0?m:e??void 0,g=(0,tz.A)({gameId:h,location:"DevToolsGameProfile",source:tW.GameProfileSources.DevTools});return(0,r.jsx)("div",{className:t$.nd,children:(0,r.jsxs)(W.B,{gap:32,padding:12,fullWidth:!1,children:[(0,r.jsxs)(W.B,{gap:4,children:[(0,r.jsx)(H.D,{variant:"heading-md/bold",children:"Game Profile"}),(0,r.jsx)(p.E,{variant:"text-sm/normal",color:"text-muted",children:"Search for a game by name, or paste a game ID, then open its profile."})]}),(0,r.jsxs)(W.B,{gap:8,children:[(0,r.jsx)(H.D,{variant:"heading-sm/bold",children:"Search"}),(0,r.jsx)(aa.Z,{label:"Search games",hideLabel:!0,placeholder:"Search for a game\u2026",options:s,value:m.length>0?void 0:e??void 0,onSelectionChange:c,selectionMode:"single",clearable:!0,matchSorterOptions:i})]}),(0,r.jsxs)(W.B,{gap:8,children:[(0,r.jsx)(H.D,{variant:"heading-sm/bold",children:"Game ID"}),(0,r.jsx)(f.k,{label:"Game ID",hideLabel:!0,placeholder:"Paste a game ID",value:a,onChange:u}),m.length>0&&(0,r.jsx)(ao,{gameId:m})]}),(0,r.jsx)(x.$,{variant:"primary",text:"Open Game Profile",fullWidth:!0,disabled:null==g,onClick:g??void 0})]})})}var ac=a(923477),au=a(773529);function am(){let e=(0,ac.O)(e=>e.requestHighlightFirstCard);return(0,r.jsxs)("div",{className:B()(t$.nd,au.k),children:[(0,r.jsx)(H.D,{variant:"heading-lg/normal",children:"Game Server Hosting"}),(0,r.jsx)(p.E,{variant:"text-sm/normal",color:"text-muted",children:'Replays the post-purchase scroll + highlight on the first card in the "Your game servers" list, exactly like clicking "View game server" after checkout. Open the Game Servers shop tab (/shop?tab=game-servers) with at least one owned server first.'}),(0,r.jsx)(x.$,{variant:"secondary",text:"Run post-purchase highlight (first card)",onClick:e})]})}var ah=a(554146),ax=a(594061),ap=a(617617),ag=a(355898),av=a(644103),aj=a(574560),af=a(726078);let ab=[ah.M.GAME_ACCOUNT_LINK_RECURRING_UPSELL,ah.M.APP_WIDGET_V2_PROFILE_UPSELL_COACHMARK,ah.M.APP_WIDGET_V2_PROFILE_UPSELL_SUGGESTED].map(e=>({id:String(e),label:ah.M[e],value:e})),ay={"global-cooldown":"global cooldown","per-game-cooldown":"per-game cooldown",disabled:"disabled"};function aE(){let[e,t]=o.useState("dismissals"),[a,n]=o.useState(ah.M.GAME_ACCOUNT_LINK_RECURRING_UPSELL),l=(0,d.bG)([ap.A],()=>ap.A.settings.userContent?.recurringDismissibleContentStates[a]??null),s=(0,d.bG)([aj.A],()=>aj.A.getAllGameUpsellDismissals(a)),i=o.useMemo(()=>Object.keys(s??{}),[s]),c=(0,tF.A)(i),[u,m]=o.useState(""),[h,g]=o.useState([]);o.useEffect(()=>(0,av.Y)(e=>{g(t=>[e,...t].slice(0,100))}),[]);let v=o.useMemo(()=>{let e=new Set;for(let t of h)for(let a of t.applicationIds)e.add(a);return[...e]},[h]),y=(0,tF.A)(v),E=o.useMemo(()=>Object.fromEntries(v.map((e,t)=>[e,y[t]])),[v,y]),_=l?.lastDismissedAtMs!=null&&"0"!==l.lastDismissedAtMs?new Date(Number(l.lastDismissedAtMs)).toLocaleString():"Never";return(0,r.jsxs)("div",{className:af.nd,children:[(0,r.jsxs)("div",{className:af.$H,children:[(0,r.jsx)($.D,{className:B()(af.V3,{[af.u7]:"dismissals"===e}),onClick:()=>t("dismissals"),children:"Dismissals"}),(0,r.jsxs)($.D,{className:B()(af.V3,{[af.u7]:"call-log"===e}),onClick:()=>t("call-log"),children:["Call Log ",h.length>0?`(${h.length})`:""]})]}),"dismissals"===e?(0,r.jsxs)("div",{className:af.Lj,children:[(0,r.jsx)("div",{className:af.uW,children:(0,r.jsx)(j.l,{label:"Dismissible Content",value:a,onSelectionChange:e=>n(e),options:ab,selectionMode:"single",fullWidth:!0})}),(0,r.jsxs)("div",{className:af.uW,children:[(0,r.jsx)(H.D,{variant:"heading-md/bold",children:"Global DCF State"}),(0,r.jsxs)(p.E,{variant:"text-sm/normal",children:["Last dismissed: ",_]}),(0,r.jsxs)(p.E,{variant:"text-sm/normal",children:["Times dismissed: ",l?.numTimesDismissed??0]}),(0,r.jsx)(x.$,{variant:"secondary",text:"Reset Global DCF State",onClick:()=>(0,ax._N)(a)})]}),(0,r.jsxs)("div",{className:af.uW,children:[(0,r.jsx)(H.D,{variant:"heading-md/bold",children:"Mark as Dismissed"}),(0,r.jsx)(f.k,{label:"Game ID",value:u,onChange:e=>m(e),placeholder:"Enter Game ID"}),(0,r.jsx)(x.$,{variant:"secondary",text:"Mark as Dismissed",disabled:""===u.trim(),onClick:()=>{(0,ag.M)([u.trim()],a),m("")}})]}),(0,r.jsx)(b.c,{}),(0,r.jsxs)("div",{className:B()(af.uW,af.LY),children:[(0,r.jsxs)(H.D,{variant:"heading-md/bold",children:["Per-Game Dismissals (",i.length,")"]}),0===i.length?(0,r.jsx)(p.E,{variant:"text-sm/normal",color:"text-muted",children:"No dismissal data for this content type."}):(0,r.jsxs)(r.Fragment,{children:[i.map((e,t)=>{let n=c[t],l=s?.[e];if(null==l)return null;let i=n?.getIconURL(32);return(0,r.jsxs)("div",{className:af.Nr,children:[(0,r.jsxs)("div",{className:af.MY,children:[null!=i&&(0,r.jsx)("img",{src:i,alt:"",className:af.Z2}),(0,r.jsxs)("div",{className:af.qi,children:[(0,r.jsx)(p.E,{variant:"text-sm/semibold",children:n?.name??"Unknown App"}),(0,r.jsx)(p.E,{variant:"text-xs/normal",color:"text-muted",children:e})]}),(0,r.jsx)(x.$,{variant:"secondary",text:"Clear",onClick:()=>(0,ag.e)(e,a)})]}),(0,r.jsxs)(p.E,{variant:"text-xs/normal",children:["Last dismissed: ",new Date(l.dismissedAt).toLocaleString()]}),(0,r.jsxs)(p.E,{variant:"text-xs/normal",children:["Times dismissed: ",l.timesDismissed]})]},e)}),(0,r.jsx)(x.$,{variant:"critical-primary",text:"Clear All",onClick:()=>{for(let e of i)(0,ag.e)(e,a)}})]})]})]}):(0,r.jsx)("div",{className:af.Lj,children:(0,r.jsxs)("div",{className:af.uW,children:[(0,r.jsxs)("div",{className:af.aq,children:[(0,r.jsxs)(H.D,{variant:"heading-md/bold",children:["Hook Calls (",h.length,")"]}),(0,r.jsx)(x.$,{variant:"secondary",text:"Clear",onClick:()=>g([])})]}),0===h.length?(0,r.jsx)(p.E,{variant:"text-sm/normal",color:"text-muted",children:"No calls recorded yet. Hook calls to useShouldShowGameUpsellForMultipleGames will appear here."}):h.map((e,t)=>(0,r.jsxs)("div",{className:af.Nr,children:[(0,r.jsxs)("div",{className:af.O9,children:[(0,r.jsx)(p.E,{variant:"text-xs/semibold",children:new Date(e.timestamp).toLocaleTimeString()}),e.disabled&&(0,r.jsx)("span",{className:af.t7,children:"(disabled)"}),(0,r.jsx)(p.E,{variant:"text-xs/normal",color:"text-muted",children:ah.M[e.dismissibleContent]})]}),0===e.applicationIds.length?(0,r.jsx)(p.E,{variant:"text-xs/normal",color:"text-muted",children:"No apps"}):e.applicationIds.map(t=>{let a=E[t],n=a?.getIconURL(20),l=e.eligibleToShow.includes(t),s=e.excludedReasons[t];return(0,r.jsxs)("div",{className:af.Ss,children:[null!=n&&(0,r.jsx)("img",{src:n,alt:"",className:af.rb}),(0,r.jsx)("span",{className:af.Jd,children:a?.name??t}),l?(0,r.jsx)("span",{className:af.OK,children:"eligible"}):null!=s?(0,r.jsx)("span",{className:af.t7,children:ay[s]}):null]},t)})]},t))]})})]})}var a_=a(696986),aC=a(47167),aS=a(734057),aN=a(994500),aA=a(310031),ak=a(394953),aD=a(989709);let aI=[{key:"channelName",cellClassName:B()(aD.Hn,aD.HA),render(e){let{channelName:t}=e;return(0,r.jsx)(p.E,{variant:"text-md/normal",children:t})}},{key:"channelId",cellClassName:B()(aD.Hn,aD.Zm),render(e){let{channelId:t}=e;return(0,r.jsx)(p.E,{variant:"text-md/normal",children:t})}}],aT=[{key:"channelName",cellClassName:B()(aD.Hn,aD.HA),render(e){let{channelName:t}=e;return(0,r.jsx)(p.E,{variant:"text-md/normal",children:t})}},{key:"loadState",cellClassName:B()(aD.Hn,aD.C7),render(e){let{loadState:t}=e;return(0,r.jsx)(p.E,{variant:"text-md/normal",children:t})}},{key:"channelId",cellClassName:B()(aD.Hn,aD.Zm),render(e){let{channelId:t}=e;return(0,r.jsx)(p.E,{variant:"text-md/normal",children:t})}}];function aR(){let{unreadRecentMentionsCount:e,unreadChannelIds:t}=(0,ak.U4)(),{isLoading:a,hasLoadedEver:n,hasPreloaded:l,hasMoreToLoad:s,isLoadingComplete:i}=(0,tE.cf)([aA.A],()=>({isLoading:aA.A.isLoading,hasLoadedEver:aA.A.hasLoadedEver,hasPreloaded:aA.A.hasPreloaded,hasMoreToLoad:aA.A.hasMoreToLoad,isLoadingComplete:aA.A.isLoadingComplete})),o=(0,tE.bG)([aA.A],()=>aA.A.currentRequestAnalyticsPayload),d=(0,tE.cf)([aA.A],()=>aA.A.getChannelInfoMap()),c=(0,tE.cf)([aS.A],()=>{let e={};return Object.entries(d).forEach(t=>{let[a]=t,n=aS.A.getChannel(a);e[a]=n??null}),e}),u=(0,tE.cf)([aS.A],()=>t.reduce((e,t)=>{let a=aS.A.getChannel(t);return e[t]=a??null,e},{})),h=(0,tE.bG)([aA.A],()=>aA.A.getInboxMessages()),x=(0,tE.bG)([aA.A],()=>aA.A.getDevOverrides().navOnClick);return(0,r.jsx)("div",{className:t$.nd,children:(0,r.jsxs)(g.Ip,{className:aD.Qs,children:[(0,r.jsxs)("div",{children:[(0,r.jsx)(H.D,{variant:"heading-lg/semibold",children:"Inbox"}),(0,r.jsxs)("div",{children:["Inbox Message Count: ",h.length]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)(H.D,{variant:"heading-lg/semibold",children:"Dev Overrides"}),(0,r.jsx)("div",{style:{display:"flex",alignItems:"center",marginTop:8},children:(0,r.jsx)(m.d,{label:"Nav On Click",checked:!!x,onChange:e=>{tU.h.dispatch({type:"NOTIFICATIONS_INBOX_SET_DEV_OVERRIDES",navOnClick:e})}})})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)(H.D,{variant:"heading-lg/semibold",children:"Unreads and Badging"}),(0,r.jsx)(a_.h,{size:8}),(0,r.jsxs)("div",{children:["Unread Recent Mentions Count: ",e]}),(0,r.jsxs)("div",{children:["Unread Channel Count: ",t.length]}),(0,r.jsx)(tV,{columns:aI,data:Object.entries(u).map(e=>{let[t,a]=e;return{key:t,channelId:t,channelName:null!=a?(0,aC.m1)(a,en.default,aN.A):""}})})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)(H.D,{variant:"heading-lg/semibold",children:"Store State"}),(0,r.jsxs)("div",{children:["Is Loading: ",a?"\u2705":"\u274C"]}),(0,r.jsxs)("div",{children:["Has Preloaded: ",l?"\u2705":"\u274C"]}),(0,r.jsxs)("div",{children:["Has Loaded Ever: ",n?"\u2705":"\u274C"]}),(0,r.jsxs)("div",{children:["Has More To Load: ",s?"\u2705":"\u274C"]}),(0,r.jsxs)("div",{children:["Is Loading Complete: ",i?"\u2705":"\u274C"]}),(0,r.jsxs)("div",{children:["Last Loading Trigger: ",o?.loadingTrigger]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)(H.D,{variant:"heading-lg/semibold",children:"Channel Info Map"}),(0,r.jsxs)("div",{children:["Total Channels: ",Object.keys(d).length]}),(0,r.jsx)(tV,{columns:aT,data:Object.entries(d).map(e=>{let t,[a,n]=e;return{key:a,channelId:a,channelName:null!=(t=c[a])?(0,aC.m1)(t,en.default,aN.A):"",loadState:n.loadState}})})]})]})})}var aO=a(976860),aw=a(352774),aM=a(490811);let aL=function(){return(0,r.jsxs)("div",{className:aM.k,children:[(0,r.jsx)(p.E,{variant:"text-md/normal",color:"text-feedback-info",style:{marginBottom:"8px"},children:"Click the button below to clear your Minor Reward Capping History."}),(0,r.jsx)(x.$,{onClick:()=>{(0,aw.Ov)(),(0,aO.pX)(er.BVt.QUEST_HOME)},text:"Clear History"}),(0,r.jsx)(p.E,{variant:"text-md/normal",color:"text-feedback-info",children:"Your may have to refresh your client after being redirected to the Quest Home in order to see these changes."})]})};var aP=a(271866),aU=a(868511),aG=a(147964),aF=a(760716),aB=a(115093),a$=a(784263);let aV=window.GLOBAL_ENV.RELEASE_CHANNEL===aB.B.STAGING?"1438571444891025408":"1346069614634864772";function aW(){let e=(0,aF.i)(e=>e.overrideApplicationId),t=(0,aF.i)(e=>e.setOverrideApplicationId),a=null!=e,n=(0,aF.i)(e=>e.overrideNitroEligibilityForSocialLayerStorefront),l=(0,aF.i)(e=>e.setOverrideNitroEligibilityForSocialLayerStorefront),s=(0,aF.i)(e=>e.isNitroEligibleForSocialLayerStorefront),i=(0,aF.i)(e=>e.setIsNitroEligibleForSocialLayerStorefront),[c,u]=o.useState(aV),[h,p]=o.useState(er.FYj),g=o.useCallback(e=>{e?t(c):t(null)},[c,t]),v=o.useCallback(e=>{u(e),a&&t(e)},[a,t]),j=(0,aF.i)(e=>e.showSelfActivity),b=(0,aF.i)(e=>e.setShowSelfActivity),y=(0,aF.i)(e=>e.recommendationApplicationIds),E=(0,aF.i)(e=>e.setRecommendationApplicationIds),_=o.useCallback(e=>{e?E(h):E(null)},[h,E]),C=(0,d.bG)([aG.A],()=>null!=aG.A.testModeApplicationId),S=o.useCallback(e=>{e?(0,eV.openModal)(e=>(0,r.jsx)(aU.A,{...e})):aP.cL()},[]),N=(0,tz.A)({location:"DevToolsSlayerStorefrontPanel",applicationId:c,source:tW.GameProfileSources.Embed,trackEntryPointImpression:!0}),A=o.useCallback(e=>{N?.(e)},[N]),k=o.useCallback(()=>{(0,aO.pX)(er.BVt.COLLECTIBLES_SHOP_GAME_SHOP(c))},[c]);return(0,r.jsx)("div",{className:B()(t$.nd,a$.n),children:(0,r.jsxs)("div",{className:a$.k,children:[(0,r.jsx)(f.k,{label:"Application ID",value:c,onChange:v}),(0,r.jsx)(H.D,{variant:"heading-lg/normal",children:"Activity Override"}),(0,r.jsx)(m.d,{label:"Override activity application ID",checked:a,onChange:g}),(0,r.jsx)(m.d,{label:"Show own voice activity (bypass self check)",checked:j,onChange:b}),(0,r.jsx)(m.d,{label:"Enable application test mode",checked:C,onChange:S}),(0,r.jsx)(x.$,{text:"Open Game Profile Modal",onClick:A}),(0,r.jsx)(x.$,{text:"Navigate to App Game Shop",onClick:k}),(0,r.jsx)(H.D,{variant:"heading-lg/normal",children:"Wishlists"}),(0,r.jsx)(f.k,{label:"Recommendation application IDs",value:h,onChange:p,disabled:null==y}),(0,r.jsx)(m.d,{label:"Enable recommendation application IDs override",checked:null!=y,onChange:_}),(0,r.jsx)(m.d,{label:"Override nitro eligibility for social layer storefront",checked:n,onChange:l}),(0,r.jsx)(m.d,{label:"Is nitro eligible for social layer storefront",checked:s,onChange:i})]})})}var az=a(540999),aH=a(723702),aK=a(865116);a(670812),a(772958);var aY=a(58736);a(558179),a(21574);var aq=a(231545),aJ=a(761929),aQ=a(641895);function aX(e){let{resizableNode:t,minHeight:a,onResize:n}=e,l=(0,aJ.A)({minDimension:a,resizableDomNodeRef:t,onElementResize:n,orientation:aJ.R.VERTICAL_TOP,usePointerEvents:!0});return(0,r.jsx)("div",{onPointerDown:l,className:aQ.Di})}function aZ(e){let{children:t,className:a,initialHeight:n,minHeight:l}=e,s=o.useRef(null),[i,d]=o.useState(n);return(0,r.jsxs)("div",{ref:s,className:aQ.kL,style:{minHeight:l,height:i},children:[(0,r.jsx)(aX,{resizableNode:s,minHeight:l,onResize:d}),(0,r.jsx)("div",{className:B()(aQ.KZ,a),children:t})]})}var a0=a(231643);a(686545),a0.fu.NONE,a0.fu.NONE;var a1=a(825484),a2=a(688810),a3=a(975460),a8=a(206828),a5=a(487431),a6=a(712440),a7=a(733110),a4=a(134861),a9=a(71393),ne=a(967198),nt=a(942370),na=a(375708),nn=a(311350),nl=a(368142);function ns(){var e;let t,a,n=o.useRef(null),{analyticsLocations:l}=(0,a2.Ay)(t_.A.DEV_TOOLS),[s,i]=o.useState(""),c=(0,d.bG)([ne.A],()=>ne.A.getGuildId()),u=(0,d.bG)([a9.A],()=>a9.A.getGuild(c)),m=u?.gameApplicationIds??[],h=(0,tF.A)(m).filter(e=>null!=e),g=(0,d.bG)([E.Ay,S.A],()=>(0,_.A)(E.Ay,S.A)),v=(0,tF.h)(s),j=(0,a3.g)(v),y=(0,d.yK)([tG.A],()=>v?.linkedGames?.map(e=>tG.A.getApplication(e.id)).filter(e=>null!=e)??[]),C=(0,a8.RD)(v,{allowedFlows:[nt._.RPC],debug:!0}),N=(0,a8.RD)(v,{allowedFlows:[nt._.WEB],debug:!0}),A=(0,d.bG)([a4.A],()=>null!=j&&a4.A.isConnected(j.id)),k=(0,a8.RD)(v,{debug:!0}),{canDeauthorize:D,deauthorize:I}=(e=k.connectionApp?.id,t=(0,d.bG)([a7.default],()=>a7.default.getNewestTokenForApplication(e)),a=o.useCallback(()=>{null!=t&&a6.A.delete(t.id)},[t]),{canDeauthorize:null!=t,deauthorize:a});return(0,r.jsxs)("div",{ref:n,className:B()(t$.nd,nl.nd),children:[(0,r.jsxs)("div",{className:nl.kL,children:[(0,r.jsx)(H.D,{variant:"heading-lg/normal",children:"Application"}),(0,r.jsx)(f.k,{label:"Application ID",value:s,onChange:i}),null!=g&&null!=g.id?(0,r.jsx)(x.$,{onClick:()=>i(g.id),variant:"primary",text:`Use detected game: ${g.name} (${g.id})`}):null,null!=u?h.length>0?(0,r.jsxs)("div",{className:nl.Mc,children:[(0,r.jsxs)(p.E,{variant:"text-sm/semibold",color:"text-subtle",children:[u.name," (",u.id,") \xb7 Official games"]}),(0,r.jsx)(a1.e,{size:"sm",wrap:!0,children:h.map(e=>(0,r.jsx)(x.$,{onClick:()=>i(e.id),variant:s===e.id?"primary":"secondary",text:`${e.name} (${e.id})`},e.id))})]}):(0,r.jsxs)(p.E,{variant:"text-md/normal",color:"text-subtle",children:[u.name," (",u.id,") \xb7 No official games"]}):(0,r.jsx)(p.E,{variant:"text-md/normal",color:"text-subtle",children:"No guild selected"}),(0,r.jsx)(b.c,{}),(0,r.jsxs)("div",{className:nl.J3,children:[(0,r.jsxs)(p.E,{variant:"text-md/normal",children:["Application Name: ",null!=v?v.name:"N/A"]}),(0,r.jsxs)(p.E,{variant:"text-md/normal",children:["Linked Games:"," ",y.length>0?y.map(e=>(0,a3.t)(v)?.id===e.id?`${e.name}*`:e.name).join(", "):"N/A"]})]})]}),(0,r.jsx)(b.c,{}),(0,r.jsxs)("div",{className:nl.kL,children:[(0,r.jsx)(H.D,{variant:"heading-lg/normal",children:"Authorization status"}),(0,r.jsx)(a5.VT,{flow:nt._.RPC,showGlobalFlowToggle:!0,overallStatus:C.debug.isSubscribedToAuthorizeRequest?a5.nW.OVERALL_GOOD:A?a5.nW.WARN:a5.nW.OVERALL_BAD,name:na.intl.string(nn.default.AGLx00),steps:[{status:A?a5.nW.GOOD:a5.nW.BAD,text:na.intl.string(nn.default.kxF9br),description:A?null:na.intl.string(nn.default.PFxxJa),learnMoreLink:A?null:"https://discord.com/developers/docs/discord-social-sdk/how-to/debug-log"},{status:C.debug.isSubscribedToAuthorizeRequest?a5.nW.GOOD:A?a5.nW.WARN:a5.nW.BAD,text:na.intl.string(nn.default.S94dzs),description:C.debug.isSubscribedToAuthorizeRequest||!A?null:na.intl.string(nn.default.aTULMB),learnMoreLink:C.debug.isSubscribedToAuthorizeRequest||!A?null:"https://discord.com/developers/docs/discord-social-sdk/how-to/debug-log"}],isChosen:k.chosenFlow===nt._.RPC}),(0,r.jsx)(a5.VT,{flow:nt._.WEB,showGlobalFlowToggle:!0,overallStatus:N.debug.hasConnectionEntrypointUrl?a5.nW.OVERALL_GOOD:a5.nW.OVERALL_BAD,name:na.intl.string(nn.default.K3ObrU),steps:[{status:N.debug.hasConnectionEntrypointUrl?a5.nW.GOOD:a5.nW.BAD,text:na.intl.string(nn.default["8a7IrV"]),description:N.debug.hasConnectionEntrypointUrl?na.intl.formatToPlainString(nn.default["9iLeL2"],{url:N.connectionApp?.connectionEntrypointUrl}):null}],isChosen:k.chosenFlow===nt._.WEB}),(0,r.jsx)(a5.Sy,{status:k.hasAlreadyLinked?a5.nW.OVERALL_GOOD:a5.nW.OVERALL_BAD,text:na.intl.string(na.t["Vu/zmQ"])}),0===k.debug.validFlows.length&&(0,r.jsx)(p.E,{style:{minWidth:0,overflow:"hidden"},variant:"text-md/medium",children:na.intl.string(nn.default.eg0mNa)}),(0,r.jsx)(x.$,{disabled:!k.canStartAuthorization,fullWidth:!0,onClick:()=>k.startAuthorization({analyticsLocations:l}),variant:"primary",text:"Start Authorization"}),(0,r.jsx)(p.E,{variant:"text-sm/normal",color:"text-subtle",children:"This will start whichever authorization flow is available. RPC authorization takes precedence over web."}),(0,r.jsxs)(a1.e,{fullWidth:!0,children:[(0,r.jsx)(x.$,{disabled:!C.canStartAuthorization,onClick:()=>C.startAuthorization({analyticsLocations:l}),variant:"secondary",text:"Start In-App Authorization"}),(0,r.jsx)(x.$,{disabled:!N.canStartAuthorization,onClick:()=>N.startAuthorization({analyticsLocations:l}),variant:"secondary",text:"Start Web Authorization"})]}),(0,r.jsx)(x.$,{disabled:!D,fullWidth:!0,onClick:I,variant:"critical-primary",text:"Deauthorize"})]}),v?.applicationAccountLinkBenefitConfig!=null&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(b.c,{}),(0,r.jsxs)("div",{className:nl.kL,children:[(0,r.jsx)(H.D,{variant:"heading-lg/normal",children:"Benefit configuration"}),(0,r.jsx)("div",{className:nl.Nr,children:(0,r.jsxs)("div",{className:nl.Tc,children:[null!=v.applicationAccountLinkBenefitConfig.reward_image&&(0,r.jsx)("img",{src:v.applicationAccountLinkBenefitConfig.reward_image,alt:"Reward",className:nl.L8}),(0,r.jsx)(p.E,{variant:"text-md/semibold",children:v.applicationAccountLinkBenefitConfig.reward_name??"Unnamed Reward"})]})})]})]})]})}var ni=a(427358),nr=a(116681);function no(e){let{title:t,sortKey:a,activeSortKey:n,sortDir:l,onClick:s}=e,i=n===a?"desc"===l?" \u25BC":" \u25B2":"";return(0,r.jsx)($.D,{className:nr.K8,onClick:()=>s(a),children:(0,r.jsx)(p.E,{variant:"text-sm/semibold",children:t+i})})}function nd(){let[e,t]=o.useState("affinity"),[a,n]=o.useState("desc"),l=o.useCallback(a=>{e===a?n(e=>"asc"===e?"desc":"asc"):(t(a),n("username"===a?"asc":"desc"))},[e]),s=(0,d.yK)([ni.A,en.default],()=>ni.A.getUserAffinities().map(e=>{let{otherUserId:t,communicationProbability:a,vcProbability:n,isFriend:l}=e;return{user:en.default.getUser(t),affinity:a,vcProbability:n,isFriend:l,key:t}})),i=o.useMemo(()=>[...s].sort((t,n)=>{let l;if("username"===e){let e=t.user?.username??t.key,a=n.user?.username??n.key;l=e.localeCompare(a)}else l=t[e]-n[e];return"desc"===a?-l:l}),[s,e,a]),c=o.useMemo(()=>[{key:"user",cellClassName:nr.iL,renderHeader:()=>(0,r.jsx)(no,{title:"USER",sortKey:"username",activeSortKey:e,sortDir:a,onClick:l}),render(e){let{user:t,key:a}=e;return t?.username??a}},{key:"affinity",renderHeader:()=>(0,r.jsx)(no,{title:"COMMUNICATION AFFINITY",sortKey:"affinity",activeSortKey:e,sortDir:a,onClick:l}),cellClassName:nr.nz,render(e){let{affinity:t}=e;return t.toFixed(5)}},{key:"vcProbability",renderHeader:()=>(0,r.jsx)(no,{title:"VOICE AFFINITY",sortKey:"vcProbability",activeSortKey:e,sortDir:a,onClick:l}),cellClassName:nr.nz,render(e){let{vcProbability:t}=e;return t.toFixed(5)}},{key:"isFriend",renderHeader:()=>(0,r.jsx)(p.E,{variant:"text-sm/semibold",children:"IS FRIEND"}),cellClassName:nr.nz,render(e){let{isFriend:t}=e;return t.toString()}}],[e,a,l]);return 0===s.length?null:(0,r.jsx)(tV,{className:t$.nd,columns:c,rowClassName:nr.nM,data:i})}var nc=a(31720),nu=a(847599),nm=a(27621);function nh(){return(0,r.jsx)("div",{className:B()(t$.nd,nm.k),children:(0,r.jsxs)("div",{children:[(0,r.jsx)(H.D,{variant:"heading-lg/semibold",children:"Quick Actions"}),(0,r.jsx)(b.c,{gap:16}),(0,r.jsxs)("div",{className:nm.h,children:[(0,r.jsx)(x.$,{variant:"primary",size:"sm",text:"Launch Age Verification Test Tool",onClick:()=>void(0,eV.openModalLazy)(async()=>{let{default:e}=await a.e("51460").then(a.bind(a,357578));return t=>(0,r.jsx)(e,{...t})},{onCloseCallback:void 0}),fullWidth:!0}),(0,r.jsx)(x.$,{variant:"primary",size:"sm",text:"Launch Age Verification Modal",onClick:()=>nc.A.showAgeVerificationGetStartedModal({entryPoint:nu.q1.DEV_TOOLS_QUICK_ACTIONS}),fullWidth:!0})]})]})})}var nx=a(989349),np=a.n(nx),ng=a(862482),nv=a(624479),nj=a(555704),nf=a(285796),nb=a(241326),ny=a(892547),nE=a(297413),n_=a(379078),nC=a(704554),nS=a(957565),nN=a(58703),nA=a(80703),nk=a(280450);let nD=0,nI=[],nT=0,nR=[],nO=!1;class nw extends d.Ay.Store{static displayName="AnalyticsLogStore";initialize(){this.waitFor(nk.default,az.A)}get loggedEvents(){return nI}get loggedEventsVersion(){return nT}get loggedTriggers(){return nR}get trackTriggers(){return nO}}let nM=new nw(tU.h,{TRACK:function(e){let{event:t,properties:a,fingerprint:n}=e;az.A.isDeveloper&&(nI.push({key:(nD++).toString(),event:t,properties:a,fingerprint:null!=n?(0,nA.d)(n):nk.default.getId(),timestamp:new Date}),nT++,nI.length>500&&(nI=nI.slice(-Math.floor(250))))},TRACK_TRIGGER:function(e){let{experimentId:t,descriptor:a,exposureType:n,excluded:l,location:s,previouslyTracked:i}=e;!az.A.isDeveloper||nO&&(nR=[...nR,{key:(0,eD.A)(),experimentId:t,descriptor:a,exposureType:n,excluded:l,location:s,previouslyTracked:i,timestamp:new Date}]).length>500&&nR.shift()},SET_TRACK_TRIGGERS:function(e){let{enabled:t}=e;nO=t},ANALYTICS_LOG_CLEAR:function(){nI=[],nT++,nR=[]}});var nL=a(658675);function nP(e){let{className:t,children:a}=e;return(0,r.jsx)("dl",{className:B()(t$.qo,t),children:a})}function nU(e){let{name:t,children:a,copyValue:n}=e,[l,s]=o.useState(!1);return o.useEffect(()=>{if(l){let e=setTimeout(()=>s(!1),1e3);return()=>clearTimeout(e)}},[l]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("dt",{className:t$.Bz,children:t}),(0,r.jsxs)("dd",{className:t$.Nw,children:[a,null!=n?(0,r.jsx)($.D,{tag:"span",className:t$.nH,onClick:()=>(0,nS.C)(n,()=>s(!0)),children:l?(0,r.jsx)(ts.U,{color:"currentColor",size:"sm"}):(0,r.jsx)(nv.T,{color:"currentColor",size:"sm"})}):null]})]})}function nG(e){let{value:t}=e;return(0,r.jsx)(nL.P,{checked:t})}var nF=a(308433);let nB=[{key:"event",cellClassName:nF.Hz,render(e){let{event:t}=e;return t}},{key:"location",cellClassName:nF.QN,render(e){let{properties:t}=e;return null==t.location?null:t.location}}];function n$(e){let{children:t}=e;return(0,r.jsx)(g.Ip,{className:nF._D,children:(0,r.jsx)("dl",{children:t})})}function nV(e){let{name:t,children:a,copyValue:n}=e,[l,s]=o.useState(!1);return o.useEffect(()=>{if(l){let e=setTimeout(()=>s(!1),1e3);return()=>clearTimeout(e)}},[l]),(0,r.jsxs)("div",{className:nF.fY,children:[(0,r.jsx)("dt",{className:nF.m2,children:t}),(0,r.jsx)("dd",{children:a}),(0,r.jsx)($.D,{tag:"span",className:nF.nH,onClick:()=>(0,nS.C)(JSON.stringify(n),()=>s(!0)),children:l?(0,r.jsx)(ts.U,{color:"currentColor",size:"sm"}):(0,r.jsx)(nv.T,{color:"currentColor",size:"sm"})})]})}let nW=new Set(["client_performance_cpu","client_performance_memory"]),nz=[{id:"details",name:"Details",group:a0.fu.NONE,render:e=>{let{loggedEvent:{event:t,properties:a,timestamp:n,fingerprint:l},onClose:s,filteredEvents:i}=e,o=en.default.getUser(l),d=np()(n);return(0,r.jsxs)("div",{className:nF.sw,"data-mtctest-ignore":"true",children:[(0,r.jsxs)(aY.Ay,{className:B()(t$.jr,nF.nZ),children:[(0,r.jsx)(aY.Ay.Icon,{icon:nj.U,tooltip:t}),(0,r.jsxs)(aY.Ay.Title,{wrapperClassName:nF.qd,children:[t,(0,r.jsx)($.D,{tag:"span",className:nF.KE,onClick:()=>(0,nS.C)(t),children:(0,r.jsx)(nv.T,{color:"currentColor",size:"sm"})})]}),(0,r.jsx)(aY.Ay.Icon,{icon:nv.T,tooltip:"Copy all properties",onClick:()=>{(0,nS.C)(JSON.stringify({event:t,timestamp:n,fingerprint:l,user:o?.id,...a},(e,t)=>void 0===t?null:t,2))}}),(0,r.jsx)(aY.Ay.Icon,{icon:nf.a,tooltip:"Close",onClick:s})]}),(0,r.jsxs)(nP,{className:nF.ZK,children:[(0,r.jsx)(nU,{name:"Timestamp (local)",copyValue:n.toISOString(),children:(0,r.jsxs)("time",{dateTime:n.toISOString(),title:(0,nN.i$)(d,"LLLL"),children:["(",np().locale(),") ",(0,nN.mk)(d)]})}),null!=o&&(0,r.jsx)(nU,{name:"User",copyValue:o.id,children:(0,r.jsx)(nE.A,{user:o})}),(0,r.jsx)(nU,{name:"Fingerprint",copyValue:l,children:(0,r.jsx)("code",{children:l})})]}),(0,r.jsx)(n$,{children:Object.entries(a).map(e=>{let[a,n]=e,l=nW.has(a)?function(e,t,a){let n=e.filter(e=>e.event===t);if(0===n.length)return{average:null,count:0};let l=null,s=0;for(let e of n){let t=e.properties[a];"number"==typeof t&&(s+=1,null==l?l=t:l+=t)}return{average:null!==l?l/n.length:null,count:s}}(i,t,a):null;return(0,r.jsxs)("div",{children:[(0,r.jsx)(nV,{name:`${a}:`,copyValue:{[a]:n||null},children:null!=n?(0,r.jsx)("code",{children:JSON.stringify(n)}):(0,r.jsx)("code",{className:nF.HO,children:"null"})},a),null!==l&&null!==l.average&&(0,r.jsx)(nV,{name:`${a}_avg:`,copyValue:{[a]:n||null},children:(0,r.jsxs)("code",{children:[l.average.toFixed(3)," (",l.count,")"]})},`${a}_avg`)]},`${a}_container`)})})]})}}],nH={events:{label:"Events",filter:e=>Object.entries(nH).filter(e=>{let[t]=e;return"events"!==t}).map(t=>{let[a,{filter:n}]=t;return!n(e)}).every(e=>e)},experiments:{label:"Experiments",filter:e=>["experiment_user_triggered","experiment_guild_triggered"].includes(e.event)},impressions:{label:"Impressions",filter:e=>e.event.startsWith("impression_")},networkActions:{label:"Network",filter:e=>e.event.startsWith("network_action")}},nK={searchType:n_.n.REGEX,searchStringGenerator:e=>{let{event:t,properties:a}=e;return null!=a.location?[t,a.location]:t},throttleMs:100};function nY(){let e=o.useRef(null),[t,a]=o.useState(""),n=(0,d.bG)([nM],()=>nM.loggedEventsVersion),[l,s]=o.useState(()=>Object.keys(nH)),[i,c]=o.useState(nM.loggedEvents),u=o.useCallback(e=>{c(e)},[]);(0,nC.RT)(t,nM.loggedEvents,u,nK,[n]);let m=i.filter(e=>{for(let t of l)if(nH[t].filter(e))return!0;return!1}),[h,x]=o.useState(void 0),p=m.find(e=>e.key===h),{TabBar:g,renderSelectedTab:v}=(0,a0.Ay)({tabs:nz},[]);return(0,r.jsxs)("div",{ref:e,className:B()(t$.nd,nF.nd),children:[(0,r.jsxs)("div",{className:nF.rh,children:[(0,r.jsx)(ng.$n,{className:nF.Q$,look:ng.$n.Looks.BLANK,size:ng.$n.Sizes.ICON,onClick:K.eY,children:(0,r.jsx)("span",{title:na.intl.string(na.t.VkKicb),children:(0,r.jsx)(nb.u,{size:"md",color:"currentColor","aria-label":na.intl.string(na.t.VkKicb)})})}),(0,r.jsx)("div",{className:nF.Bi}),(0,r.jsx)("div",{className:nF.uW,children:Object.entries(nH).map(e=>{let[t,a]=e;return(0,r.jsx)($.D,{className:B()(nF.pb,l.includes(t)&&nF.bx),onClick:()=>{s(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},children:a.label},t)})})]}),(0,r.jsx)("div",{className:nF.rh,children:(0,r.jsx)(ny.I,{size:"sm",query:t,onChange:a,onClear:()=>a(""),placeholder:"Search by event name"})}),(0,r.jsx)(tV,{columns:nB,data:m,selectedRowKey:h,onClickRow:e=>x(e.key)}),null!=p&&(0,r.jsxs)(aZ,{className:nF.rf,minHeight:100,initialHeight:null!=e.current?e.current.clientHeight/2:300,children:[(0,r.jsx)(g,{}),v({loggedEvent:p,onClose:()=>x(void 0),filteredEvents:m})]})]})}var nq=a(382483),nJ=a(385113),nQ=a(755541);function nX(e){let{config:t}=e,a=Object.entries(t.surfaces??{});return(0,r.jsxs)(W.B,{gap:8,padding:8,className:nQ.lt,children:[(0,r.jsx)(p.E,{variant:"text-sm/semibold",color:"text-strong",children:t.display_name}),(0,r.jsxs)(p.E,{variant:"text-xs/normal",color:"text-muted",children:["Config ID: ",t.config_id]}),(0,r.jsxs)(p.E,{variant:"text-xs/normal",color:"text-muted",children:["App ID: ",t.application_id]}),(0,r.jsxs)(p.E,{variant:"text-xs/normal",color:"text-muted",children:["Status: ",t.status]}),null!=t.updated_at&&(0,r.jsxs)(p.E,{variant:"text-xs/normal",color:"text-muted",children:["Updated: ",t.updated_at]}),null!=t.published_at&&(0,r.jsxs)(p.E,{variant:"text-xs/normal",color:"text-muted",children:["Published: ",t.published_at]}),(0,r.jsx)(b.c,{}),(0,r.jsxs)(p.E,{variant:"text-xs/semibold",color:"text-strong",children:["Surfaces (",a.length,")"]}),0===a.length?(0,r.jsx)(p.E,{variant:"text-xs/normal",color:"text-muted",children:"No surfaces configured"}):a.map(e=>{let[t,a]=e;return(0,r.jsxs)(W.B,{gap:4,padding:4,className:nQ.YL,children:[(0,r.jsx)(p.E,{variant:"text-xs/semibold",color:"text-default",children:t}),(0,r.jsxs)(p.E,{variant:"text-xs/normal",color:"text-muted",children:["Layout: ",a.layout]})]},t)})]})}function nZ(e){let{config:t,isSelected:a,onSelect:n}=e;return(0,r.jsxs)(W.B,{direction:"horizontal",align:"center",gap:8,padding:8,className:a?nQ.FM:nQ.gt,children:[(0,r.jsx)($.D,{className:nQ.Av,onClick:n,children:(0,r.jsxs)(W.B,{gap:4,children:[(0,r.jsx)(p.E,{variant:"text-sm/medium",color:"text-strong",children:t.display_name}),(0,r.jsxs)(p.E,{variant:"text-xs/normal",color:"text-muted",children:[t.config_id," \xb7 ",t.application_id]})]})}),(0,r.jsx)(x.$,{variant:"secondary",size:"sm",text:"Refetch",onClick:()=>(0,nq.un)(t.application_id,{force:!0})})]})}function n0(){let e=(0,d.bG)([nJ.A],()=>nJ.A.getFeaturedFetchState());return(0,r.jsxs)(W.B,{gap:8,children:[(0,r.jsxs)(W.B,{direction:"horizontal",gap:8,align:"center",children:[(0,r.jsx)(p.E,{variant:"text-md/semibold",color:"text-strong",children:"Featured Configs"}),(0,r.jsxs)(p.E,{variant:"text-xs/normal",color:"text-muted",children:["(",e,")"]})]}),(0,r.jsx)(x.$,{variant:"primary",size:"sm",text:"Force Refetch",onClick:()=>(0,nq.Wq)({force:!0})})]})}function n1(){let e=(0,d.bG)([nJ.A],()=>nJ.A.getDeveloperFetchState());return(0,r.jsxs)(W.B,{gap:8,children:[(0,r.jsxs)(W.B,{direction:"horizontal",gap:8,align:"center",children:[(0,r.jsx)(p.E,{variant:"text-md/semibold",color:"text-strong",children:"Developer Configs"}),(0,r.jsxs)(p.E,{variant:"text-xs/normal",color:"text-muted",children:["(",e,")"]})]}),(0,r.jsx)(x.$,{variant:"primary",size:"sm",text:"Force Refetch",onClick:()=>(0,nq.i$)({force:!0})})]})}function n2(){let[e,t]=o.useState(""),a=(0,d.bG)([nJ.A],()=>e.length>0?nJ.A.getFetchState(e):null),n=(0,d.bG)([nJ.A],()=>e.length>0?nJ.A.getConfigs(e):null);return(0,r.jsxs)(W.B,{gap:8,children:[(0,r.jsx)(p.E,{variant:"text-md/semibold",color:"text-strong",children:"Fetch by Application ID"}),(0,r.jsx)(f.k,{placeholder:"Application ID",value:e,onChange:e=>t(e)}),(0,r.jsx)(x.$,{variant:"primary",size:"sm",text:"Fetch",disabled:0===e.length,onClick:()=>(0,nq.un)(e,{force:!0})}),null!=a&&(0,r.jsxs)(p.E,{variant:"text-xs/normal",color:"text-muted",children:["Status: ",a]}),null!=n&&n.length>0&&(0,r.jsx)(W.B,{gap:4,children:n.map(e=>(0,r.jsx)(nX,{config:e},e.config_id))})]})}function n3(e){let{configs:t,selectedConfigId:a,onSelectConfig:n}=e,l=(0,d.bG)([nJ.A],()=>nJ.A.getFeaturedFetchState());return(0,r.jsxs)(W.B,{gap:8,children:[(0,r.jsxs)(p.E,{variant:"text-md/semibold",color:"text-strong",children:["All Loaded Configs (",t.length,")"]}),l===nJ.e.FETCHING&&(0,r.jsx)(p.E,{variant:"text-sm/normal",color:"text-muted",children:"Loading..."}),t.map(e=>(0,r.jsx)(nZ,{config:e,isSelected:a===e.config_id,onSelect:()=>n(a===e.config_id?null:e.config_id)},e.config_id))]})}function n8(e){let{config:t}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(b.c,{}),(0,r.jsxs)(W.B,{gap:8,children:[(0,r.jsx)(p.E,{variant:"text-md/semibold",color:"text-strong",children:"Config Details"}),(0,r.jsx)(nX,{config:t})]})]})}function n5(){let[e,t]=o.useState(null),a=Object.values((0,d.bG)([nJ.A],()=>nJ.A.getAllConfigsByApplication())).flat(),n=null!=e?a.find(t=>t.config_id===e):null;return(0,r.jsx)(g.Ar,{children:(0,r.jsxs)(W.B,{gap:16,padding:8,className:nQ.zr,children:[(0,r.jsx)(H.D,{variant:"heading-lg/semibold",color:"text-strong",children:"Application Widget Configs"}),(0,r.jsx)(x.$,{size:"sm",variant:"critical-secondary",text:"Reset store",onClick:()=>tU.h.dispatch({type:"APPLICATION_WIDGET_CONFIG_DEBUG_RESET"})}),(0,r.jsx)(n0,{}),(0,r.jsx)(b.c,{}),(0,r.jsx)(n1,{}),(0,r.jsx)(b.c,{}),(0,r.jsx)(n2,{}),(0,r.jsx)(b.c,{}),(0,r.jsx)(n3,{configs:a,selectedConfigId:e,onSelectConfig:t}),null!=n&&(0,r.jsx)(n8,{config:n})]})})}var n6=a(562465),n7=a(153488),n4=a(927813);let n9=12*n4.A.Millis.HOUR,le=new Map,lt=!1,la=Object.freeze({channelAffinities:[],lastFetched:0}),ln={...la};function ll(){le=new Map(ln.channelAffinities.map(e=>[e.channelId,e]))}class ls extends d.Ay.PersistedStore{static displayName="ChannelAffinitiesV2Store";static persistKey="ChannelAffinitiesStoreV2";initialize(e){null!=e&&(ln.channelAffinities=e.channelAffinities,ln.lastFetched=e.lastFetched,ll())}shouldFetch(){if(!lt)return Date.now()-ln.lastFetched>n9}isFetching(){return lt}getChannelAffinities(){return ln.channelAffinities}getChannelAffinitiesMap(){return le}getChannelAffinity(e){return le.get(e)}compare(e,t){return(le.get(t)?.score??0)-(le.get(e)?.score??0)}getState(){return ln}}let li=new ls(tU.h,{LOAD_CHANNEL_AFFINITIES_V2:function(){lt=!0},LOAD_CHANNEL_AFFINITIES_V2_SUCCESS:function(e){let{affineChannels:t}=e;ln.lastFetched=Date.now(),lt=!1,ln.channelAffinities=t,ll()},LOAD_CHANNEL_AFFINITIES_V2_FAILURE:function(){lt=!1},LOGOUT:function(){ln={...la},le=new Map,lt=!1}});var lr=a(686392);let lo=[{key:"channel",cellClassName:lr._w,render(e){let{channelName:t}=e;return t}},{key:"score",renderHeader:()=>(0,r.jsx)(p.E,{variant:"text-sm/semibold",children:"SCORE"}),cellClassName:lr.t6,render(e){let{score:t}=e;return t.toFixed(5)}}];function ld(){o.useEffect(()=>{!function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];li.shouldFetch()&&n7.A.hasConsented(er.YAq.PERSONALIZATION)?(tU.h.dispatch({type:"LOAD_CHANNEL_AFFINITIES_V2"}),n6.Bo.get({url:er.Rsh.CHANNEL_AFFINITIES_V2,retries:3*!!e,oldFormErrors:!0,rejectWithError:!1}).then(e=>{let{body:t}=e;tU.h.dispatch({type:"LOAD_CHANNEL_AFFINITIES_V2_SUCCESS",affineChannels:t.channel_affinities.map(e=>({channelId:e.channel_id,score:e.score??0}))})},()=>{tU.h.dispatch({type:"LOAD_CHANNEL_AFFINITIES_V2_FAILURE"})})):Promise.resolve()}()},[]);let e=(0,d.yK)([li,aS.A],()=>li.getChannelAffinities().map(e=>{let{channelId:t,score:a}=e;return{key:t,channelName:aS.A.getChannel(t)?.name??t,score:a}}).sort((e,t)=>t.score-e.score));return 0===e.length?null:(0,r.jsx)(tV,{className:t$.nd,columns:lo,rowClassName:lr.nM,data:e})}function lc(){return(0,r.jsxs)(p.E,{variant:"text-lg/normal",children:["Under Construction"," ",(0,r.jsx)("span",{role:"img","aria-label":"Construction",children:"\uD83D\uDEA7"})]})}var lu=a(105565),lm=a(558845),lh=a(182113);function lx(e){switch(e){case lu.r.DC_DISMISSED:return"DISMISS:";case lu.r.DC_SHOWN:return"SHOW:";case lu.r.DC_SHOW_REQUEST:return"REQUEST TO SHOW:";default:return"UNKNOWN TYPE:"}}let lp=[{key:"events",render(e){let{event:t,dismissibleContent:a}=e;return`${t} ${ah.M[a]}`}}],lg=[{key:"candidates",render(e){let{dismissibleContent:t}=e;return`${ah.M[t]}`}}];function lv(){let e=(0,d.bG)([lu.A],()=>lu.A.getDCFEvents()),t=(0,lm.Ay)(e=>e.candidates),a=(0,lm.Ay)(e=>e.lastWinnerTime),n=0!==a?np()(a).fromNow():"n/a",l=(0,lm.Ay)(e=>0===e.lastWinnerTime?null:e.recentlyShown[0]),s=e.map(e=>{let{eventType:t,dismissibleContent:a}=e;return{key:lx(t)+a.toString(),event:lx(t),dismissibleContent:a}}),i=Array.from(t.keys()).map(e=>({key:e.toString(),dismissibleContent:e}));return(0,r.jsxs)("div",{className:lh.KE,children:[(0,r.jsxs)("div",{className:lh.pq,children:["Last winner time: ",n]}),(0,r.jsx)("br",{}),(0,r.jsxs)("div",{className:lh.pq,children:["Last winner: ",null!=l?ah.M[l]:"None"]}),(0,r.jsx)("br",{}),(0,r.jsx)("div",{className:lh.uI,children:(0,r.jsx)(tV,{className:lh.Th,columns:lg,data:i})}),(0,r.jsx)("br",{}),(0,r.jsx)(tV,{columns:lp,data:s})]})}var lj=a(689175),lf=a(541689),lb=a(199773);function ly(){let e=(0,o.useCallback)(e=>{let t=new Set(lE());t.delete(e);let a=Array.from(t).slice(0,4);a.unshift(e),tP.w.set("RecentDismissibleOverrides",a)},[]);return[lE(),e]}function lE(){return tP.w.get("RecentDismissibleOverrides")??[]}a(667532);var l_=a(662546),lC=a(643278),lS=a(256787),lN=a(20439);let lA=o.memo(function(e){let{className:t,content:a,onChange:n}=e,l=ah.M[a],{isDismissed:s,handleToggleDismissState:i}=(0,lN.A)(l),[d,c]=o.useState(!1),u=o.useCallback(()=>{n?.(a),i()},[n,i,a]),h=o.useCallback(e=>{e.preventDefault(),c(!0),navigator.clipboard.writeText(a.toLowerCase())},[a]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(W.B,{className:t,direction:"horizontal",align:"center",children:[(0,r.jsx)(eF.K,{size:"sm",variant:"icon-only",icon:d?l_.O:lC.s,onClick:h,"aria-label":d?"Copied":"Copy"}),(0,r.jsx)(m.d,{label:`${a.toLowerCase()} (${ah.M[a]})`,description:(0,lS.Zm)(l)?function(e){let t=ap.A.settings.userContent?.recurringDismissibleContentStates?.[e];if(null==t)return null;let a=[],{lastDismissedVersion:n,lastDismissedAtMs:l,lastDismissedObjectId:s}=t;if(void 0!==n&&0!==n&&a.push(`last_dismissed_version: ${n}`),void 0!==l){let e=Number(l),t=Number.isNaN(e)?"n/a":new Date(e).toLocaleString();a.push(`last_dismissed_at: ${t}`)}return(void 0!==s&&"0"!==s&&a.push(`last_dismissed_object_id: ${s}`),0===a.length)?null:a.join(", ")}(l):null,checked:s,onChange:u})]}),(0,r.jsx)(b.c,{})]})});function lk(e){let{items:t,onChange:a}=e,[n,l]=ly(),s=(0,o.useCallback)(e=>{l(e),a?.(e)},[l,a]);return(0,r.jsx)(W.B,{gap:16,children:t.filter(e=>isNaN(Number(e))).map(e=>(0,r.jsx)(lA,{content:e,onChange:s},e))})}function lD(e){let{searchQuery:t=""}=e,a=(0,lm.Ay)(e=>e.recentlyShown),[n,l]=ly(),s=n.filter(e=>e.toLowerCase().includes(t.toLowerCase())).filter(e=>!a.includes(ah.M[e])).slice(0,3);return 0===s.length?null:(0,r.jsx)(u.n,{label:"Recent Overrides",children:(0,r.jsx)(lk,{items:s})})}function lI(e){let{searchQuery:t=""}=e,a=(0,lm.Ay)(e=>e.recentlyShown).map(e=>ah.M[e]).filter(e=>e.toLowerCase().includes(t.toLowerCase())).slice(0,3);return 0===a.length?null:(0,r.jsx)(u.n,{label:"Recently Shown",children:(0,r.jsx)(lk,{items:a})})}var lT=a(692995);function lR(){let{dailyCapReached:e,dailyCapOverridden:t,newUserMinAgeRequiredOverridden:a}=(0,d.cf)([lb.A],()=>({dailyCapReached:lb.A.hasUserHitDCCap(),dailyCapOverridden:lb.A.dailyCapOverridden,newUserMinAgeRequiredOverridden:lb.A.newUserMinAgeRequiredOverridden})),[n,l]=o.useState(""),[s,i]=o.useState(20),c=o.useMemo(()=>Object.keys(ah.M).filter(e=>e.toLowerCase().includes(n.toLowerCase())).reverse(),[n]),h=o.useCallback(e=>{let t=e.currentTarget;t.scrollHeight-t.scrollTop<=t.clientHeight+100&&s<c.length&&i(e=>e+100)},[s,c.length]);return(0,r.jsx)(lj.Ch,{onScroll:h,children:(0,r.jsxs)("div",{className:lT.KE,children:[(0,r.jsxs)(u.n,{label:"Dismissible Content Overrides",children:[(0,r.jsxs)(W.B,{gap:4,children:[(0,r.jsx)(x.$,{variant:"primary",text:"Reset Daily Cap",onClick:()=>(0,lf.Ab)()}),(0,r.jsx)(x.$,{variant:"primary",text:"Undismiss All DCs",onClick:()=>(0,ax.nT)()}),(0,r.jsx)(x.$,{variant:"primary",text:"Dismiss All DCs",onClick:()=>(0,ax.D1)()}),(0,r.jsx)(p.E,{variant:"text-sm/normal",color:"text-subtle",children:`Daily Cap Reached: ${e?"Yes":"No"}`})]}),(0,r.jsx)(m.d,{label:"Override Dismissible Content Daily Cap",checked:t,onChange:lf.SE}),(0,r.jsx)(m.d,{label:"Override Minimum User Account Age Requirement",checked:a,onChange:lf.U$})]}),(0,r.jsx)(lI,{}),(0,r.jsx)(lD,{}),(0,r.jsxs)(u.n,{label:"All Dismissible Contents",children:[(0,r.jsx)(ny.I,{query:n,onChange:l,onClear:()=>l("")}),(0,r.jsx)(lk,{items:c.slice(0,s)})]})]})})}var lO=a(276086),lw=a(154323),lM=a(386904);function lL(){let e=(0,d.bG)([lw.A],()=>lw.A.allWithDescriptions(),[],d.My),t=o.useMemo(()=>e.map(e=>{let[t,a,n]=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(m.d,{label:n,description:t,checked:a,onChange:e=>(0,lO.L)(t,e)},t),(0,r.jsx)(b.c,{gap:16})]})}),[e]);return(0,r.jsxs)("div",{className:lM.kL,children:[(0,r.jsx)("div",{"data-button-hoisted-classname-wrapper":!0,className:lM.x6,children:(0,r.jsx)(x.$,{variant:"primary",text:"Clear all",onClick:lO.$,fullWidth:!0})}),(0,r.jsx)("div",{className:lM.vu,children:t})]})}var lP=a(744980);function lU(){let e=(0,d.bG)([tH.A],()=>tH.A.detectableGamesEtag),t=(0,d.bG)([tH.A],()=>tH.A.lastFetched),a=(0,d.bG)([tH.A],()=>tH.A.games.length);return(0,r.jsxs)(W.B,{gap:4,children:[(0,r.jsx)(H.D,{variant:"heading-sm/bold",children:"Cache Status"}),(0,r.jsxs)(p.E,{variant:"text-sm/normal",children:[(0,r.jsx)("strong",{children:"Total games:"})," ",a]}),(0,r.jsxs)(p.E,{variant:"text-sm/normal",children:[(0,r.jsx)("strong",{children:"ETag:"})," ",""===e?"(empty)":(0,r.jsx)("span",{className:lP.ti,children:e})]}),(0,r.jsxs)(p.E,{variant:"text-sm/normal",children:[(0,r.jsx)("strong",{children:"Last fetched:"})," ",null==t?"never":new Date(t).toLocaleString()]})]})}function lG(e){let{game:t}=e,{data:a}=(0,as.I)(t.id),n=null!=a&&a.name!==t.name;return(0,r.jsxs)(W.B,{gap:12,className:lP.f_,children:[(0,r.jsxs)(W.B,{direction:"horizontal",gap:12,align:"center",children:[(0,r.jsx)(an.A,{game:a,size:an.M.LARGE}),(0,r.jsxs)(W.B,{gap:4,children:[(0,r.jsx)(H.D,{variant:"heading-lg/bold",children:t.name}),(0,r.jsx)(p.E,{variant:"text-sm/normal",color:"text-muted",children:t.id})]})]}),(0,r.jsxs)(W.B,{gap:4,children:[(0,r.jsx)(p.E,{variant:"text-sm/semibold",children:"GameStore"}),(0,r.jsx)(p.E,{variant:"text-sm/normal",color:"text-muted",children:null==a?"No record fetched. The icon above comes from here, not from the detectable payload, so it is blank.":`name: ${a.name}`}),n&&(0,r.jsx)(p.E,{variant:"text-sm/normal",color:"text-feedback-critical",children:"Differs from the detectable name above."})]}),(0,r.jsxs)(W.B,{gap:4,children:[(0,r.jsx)(p.E,{variant:"text-sm/semibold",children:"DetectableGameStore"}),(0,r.jsx)("pre",{className:lP.aY,children:JSON.stringify(t,null,2)})]})]})}function lF(){let[e,t]=o.useState(null),[a,n]=o.useState(""),l=(0,d.bG)([tH.A],()=>tH.A.games),s=o.useMemo(()=>l.filter(e=>null!=e.name&&""!==e.name).map(e=>({id:e.id,value:e.id,label:e.name})),[l]),i=o.useCallback(e=>{t(e),null!=e&&n("")},[]),c=o.useCallback(e=>{n(e),e.trim().length>0&&t(null)},[]),u=a.trim(),m=u.length>0?u:e??void 0,h=(0,d.bG)([tH.A],()=>null!=m?tH.A.getDetectableGame(m)??null:null,[m]);return(0,r.jsx)("div",{className:B()(t$.nd,lP.kL),children:(0,r.jsxs)(W.B,{gap:16,padding:12,className:lP.rf,children:[(0,r.jsxs)(W.B,{gap:4,children:[(0,r.jsx)(H.D,{variant:"heading-md/bold",children:"Detectable Cache"}),(0,r.jsx)(p.E,{variant:"text-sm/normal",color:"text-muted",children:"Inspect the local detectable games cache. Use this to verify whether a SKU or executable change has propagated to your client."})]}),(0,r.jsx)(lU,{}),(0,r.jsxs)(W.B,{gap:8,children:[(0,r.jsx)(H.D,{variant:"heading-sm/bold",children:"Search"}),(0,r.jsx)(aa.Z,{label:"Search games",hideLabel:!0,placeholder:"Search for a game\u2026",options:s,value:u.length>0?void 0:e??void 0,onSelectionChange:i,selectionMode:"single",clearable:!0})]}),(0,r.jsxs)(W.B,{gap:8,children:[(0,r.jsx)(H.D,{variant:"heading-sm/bold",children:"Game ID"}),(0,r.jsx)(f.k,{label:"Game ID",hideLabel:!0,placeholder:"Paste a game ID",value:a,onChange:c})]}),null!=m&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(b.c,{}),null!=h?(0,r.jsx)(lG,{game:h}):(0,r.jsxs)(p.E,{variant:"text-sm/normal",color:"text-feedback-critical",children:["No entry in cache for ID ",m,"."]})]})]})})}var lB=a(691540),l$=a(97483),lV=a(123292),lW=a(780907),lz=a(56562);let lH=[{label:"Wuthering Waves",value:"1247227126416146462"},{label:"Marvel Rivals",value:"1314395942253756416"},{label:"VALORANT",value:"700136079562375258"},{label:"League of Legends",value:"1402418696126992445"},{label:"World of Warcraft",value:"356875762940379136"}];function lK(e){let{runningGame:t,isDebugGame:a}=e,{data:n}=(0,as.I)(t.id);return(0,r.jsxs)(W.B,{direction:"horizontal",gap:8,children:[null!=n&&(0,r.jsx)(an.A,{game:n}),(0,r.jsxs)(W.B,{justify:"center",gap:0,children:[(0,r.jsx)(p.E,{variant:"text-md/normal",children:n?.name}),a&&(0,r.jsx)(p.E,{variant:"text-xxs/normal",children:"Debug"})]})]})}function lY(){let e=(0,d.bG)([E.Ay],()=>E.Ay.getRunningGames()),t=(0,d.bG)([E.Ay],()=>E.Ay.getDebugRunningGame()),[a,n]=(0,o.useState)(t?.id??""),l=(0,o.useMemo)(()=>lH.map(e=>{let{label:t,value:a}=e;return{label:t,value:a,id:a}}),[]);function s(e){if(null==e||""===e)return void(0,lW.xt)(null);let t=tH.A.getDetectableGame(e),a=t?.executables[0],n=t?.thirdPartySkus[0]?.distributor;if(null==t||null==a)return(0,lB.P0)({id:"devtools-set-debug-game-error",type:l$.Ck.FAILURE,message:"Invalid Game ID"});(0,lW.xt)({id:t.id,name:t.name,exeName:a.name,exePath:"",lastFocused:Date.now()/1e3,pid:-1,pidPath:[],hidden:!1,elevated:!1,processName:a.name,distributor:n,windowHandle:void 0,fullscreenType:lz.aI.UNKNOWN,cmdLine:"",nativeProcessObserverId:-1})}return(0,r.jsxs)(W.B,{gap:32,padding:12,fullWidth:!1,children:[(0,r.jsxs)(W.B,{gap:8,children:[(0,r.jsx)(H.D,{variant:"heading-md/bold",children:"Running Games"}),e.length>0&&(0,r.jsx)("div",{children:e.map(e=>(0,r.jsx)(lK,{runningGame:e,isDebugGame:t?.id===e.id},e.id))})]}),(0,r.jsx)(b.c,{}),(0,r.jsxs)(W.B,{gap:8,children:[(0,r.jsx)(H.D,{variant:"heading-md/bold",children:"Set Debug Running Game"}),(0,r.jsx)(f.k,{label:"Custom Game ID",value:a,onChange:n}),(0,r.jsx)(aa.Z,{label:"Pick a Preset Game",options:l,value:t?.id??"",onSelectionChange:function(e){s(e)},selectionMode:"single",clearable:!0}),(0,r.jsxs)(W.B,{direction:"horizontal",gap:16,justify:"end",align:"end",children:[null!=t&&(0,r.jsx)(lV.Q,{variant:"secondary",text:"Clear",onClick:()=>s(null)}),(0,r.jsx)(x.$,{variant:"primary",text:"Detect Game",onClick:()=>s(a)})]})]})]})}var lq=a(240248),lJ=a(958451);function lQ(){let[e,t]=o.useState(!1),[a,n]=o.useState(null),[l,s]=o.useState(null),i=o.useCallback(async()=>{try{t(!0),n(null),s(null);let e=await n6.Bo.put({url:"/users/@me/developer-portal/onboarding",body:{completed:!1},rejectWithError:!0});n(`${e.status}: ${e.text}`)}catch(e){s(e instanceof Error?e.message:String(e))}finally{t(!1)}},[]);return(0,r.jsxs)(W.B,{direction:"vertical",gap:4,children:[(0,r.jsx)(x.$,{variant:"primary",onClick:i,text:"Reset Onboarding",disabled:e,fullWidth:!0}),!(0,lq.uJ)(a)&&(0,r.jsx)(p.E,{variant:"text-md/normal",color:"status-positive",children:a}),!(0,lq.uJ)(l)&&(0,r.jsx)(p.E,{variant:"text-md/normal",color:"text-feedback-critical",children:l})]})}function lX(){return(0,r.jsx)("div",{className:lJ.n,children:(0,r.jsx)(W.B,{direction:"vertical",gap:16,children:(0,r.jsx)(lQ,{})})})}a(172879);var lZ=a(64015),l0=a.n(lZ),l1=a(874804),l2=a(866665),l3=a(782134),l8=a(113494),l5=a(603349),l6=a(177298);function l7(e){return parseFloat(e.toFixed(3))}let l4=[{key:"store",cellClassName:l6.lA,render(e){let{trace:t}=e;return t.name}},{key:"time",cellClassName:l6.i7,render(e){let{trace:t}=e;return`${l7(t.time)} ms`}}];function l9(e){let{actionLog:t}=e,a=o.useMemo(()=>t.traces.map(e=>({key:e.name,trace:e})),[t]);return(0,r.jsx)(g.Ip,{children:(0,r.jsx)(tV,{columns:l4,data:a})})}let se=[{id:"action",name:"Action",group:a0.fu.NONE,render(e){let{actionLog:t}=e,a=np()(t.createdAt);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(nP,{className:l6.mP,children:[(0,r.jsx)(nU,{name:"Created at",children:(0,r.jsx)("time",{dateTime:t.createdAt?.toISOString(),title:(0,nN.i$)(a,"LLLL"),children:(0,nN.mk)(a)})}),(0,r.jsxs)(nU,{name:"Total Time",children:[l7(t.totalTime)," ms"]})]}),(0,r.jsx)(g.Ip,{className:l6.Dx,children:(0,r.jsx)(aq.A,{data:t.action})})]})}},{id:"traces",name:"Store Handlers",group:a0.fu.NONE,render(e){let{actionLog:t}=e;return(0,r.jsx)(l9,{actionLog:t})}}];function st(e){let{actionLog:t,initialHeight:a}=e,n=o.useMemo(()=>t.error?[...se,{id:"error",name:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l5.A,{className:l6.ik}),"Error"]}),group:a0.fu.NONE,render(e){let{actionLog:t}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:B()(l6.u4,t$.KE),children:(0,r.jsx)("div",{className:t$.R5,children:(0,r.jsx)(ng.$n,{className:t$.Q$,size:ng.$n.Sizes.MIN,onClick:()=>console.error(t.error),children:"Log to Console"})})}),(0,r.jsx)(g.Ip,{className:l6.Dx,children:(0,r.jsx)(aq.A,{data:t.error})})]})}}]:se,[t]),{TabBar:l,renderSelectedTab:s}=(0,a0.Ay)({tabs:n},[n]);return(0,r.jsxs)(aZ,{className:l6.rf,minHeight:100,initialHeight:a,children:[(0,r.jsx)(l,{}),(0,r.jsxs)(aY.Ay,{className:B()(t$.jr,l6.nZ),children:[(0,r.jsx)(aY.Ay.Icon,{icon:l1.K,tooltip:t.name}),(0,r.jsx)(aY.Ay.Title,{wrapperClassName:B()(t$.qd,t$.ZE),className:t$.Pz,children:t.name}),(0,r.jsx)(aY.Ay.Icon,{icon:nv.T,tooltip:"Copy event data",onClick:()=>{var e;let a=JSON.stringify(Object.keys(e=t.action).reduce((t,a)=>{var n;return t[a]=(n=e[a],er.AKn.test(n)?"REDACTED":n),t},{}),null,2);(0,nS.C)(a,()=>(0,lB.P0)({id:"copy-action-log-name",type:l$.Ck.SUCCESS,message:"Copied action log data to clipboard"}))}})]}),s({actionLog:t})]})}let sa=[{key:"action",cellClassName:l6.lA,render(e){let{actionLog:t}=e;return(0,r.jsxs)(r.Fragment,{children:[t.error&&(0,r.jsx)(l5.A,{className:l6.ik}),t.name]})}},{key:"total time",cellClassName:l6.i7,render(e){let{actionLog:t}=e;return`${l7(t.totalTime)} ms`}},{key:"timestamp",cellClassName:l6.i7,render(e){let{actionLog:t}=e;return np()(t.createdAt).format("HH:mm:ss.SSS")}}],sn={searchType:n_.n.REGEX,searchStringGenerator:e=>{let{actionLog:t}=e;return t.name},throttleMs:100};function sl(){let e=o.useRef(null),[t,a]=o.useState(""),n=function(e){let[t,a]=o.useState(e.logs);return o.useEffect(()=>{let t=l0()(()=>{a([...e.logs])},500);return e.on("log",t),()=>{e.off("log",t)}},[e]),t}(tU.h.actionLogger),l=o.useMemo(()=>n.map(e=>({key:e.id.toString(),actionLog:e})).toReversed(),[n]),[s,i]=o.useState(l),[d,c]=o.useState(l),[u,m]=o.useState(!1),[h,x]=o.useState(),p=o.useCallback(e=>{c(e)},[]);(0,nC.RT)(t,u?s:l,p,sn);let g=o.useCallback(e=>{i(l),m(e)},[l]),v=t.trim().length>0,j=o.useMemo(()=>v?d:u?s:l,[l,d,v,u,s]),f=u?"Enable Event Tracking":"Pause Event Tracking";return(0,r.jsxs)("div",{ref:e,className:B()(t$.nd,l6.nd),children:[(0,r.jsxs)("div",{className:l6.KE,children:[(0,r.jsx)(l2.m,{text:f,children:(0,r.jsx)(eF.K,{size:"sm",variant:u?"primary":"active",icon:u?l3.u:l8.E,"aria-label":f,onClick:()=>g(!u)})}),(0,r.jsx)(ny.I,{size:"sm",query:t,onChange:a,onClear:()=>a(""),placeholder:"Search by action name"})]}),(0,r.jsx)(tV,{columns:sa,data:j,selectedRowKey:h?.id.toString(),onClickRow:e=>x(e.actionLog)}),null!=h&&(0,r.jsx)(st,{actionLog:h,initialHeight:null!=e.current?e.current.clientHeight/2:300})]})}var ss=a(936388),si=a(463993);function sr(){let e=o.useRef(null);return(0,r.jsx)("div",{ref:e,className:B()(t$.nd,si.n),children:(0,r.jsx)(x.$,{variant:"primary",size:"sm",text:"Reset Uploaded Key Versions Cache",onClick:ss.A.clearUploadedKeyVersions})})}var so=a(37962),sd=a(881520),sc=a(670455),su=a(930400);let sm=[{id:"seconds",label:"second(s)",value:1e3},{id:"minutes",label:"minute(s)",value:6e4},{id:"hours",label:"hour(s)",value:36e5},{id:"days",label:"day(s)",value:864e5}];function sh(){let[e,t]=o.useState(null),[a,n]=o.useState(0),[l,s]=o.useState(1e3),[i,c]=o.useState(0),m=(0,d.bG)([sd.A],()=>null===e?null:sd.A.getFeedbackConfig(sc.MW[e])??so.u[sc.MW[e]]),h=Object.entries(sc.MW),g=h.slice(h.length/2).map(e=>{let[t]=e;return{id:t,label:t,value:t}}),v=o.useMemo(()=>null!=e&&i>=0&&i<=100&&a>=0,[e,i,a]);return(0,r.jsx)("div",{className:su.kL,children:(0,r.jsxs)(W.B,{gap:32,children:[(0,r.jsx)(j.l,{label:"Feedback Survey",options:g,value:e,onSelectionChange:t,placeholder:"Select Feedback Survey",selectionMode:"single",fullWidth:!0}),(0,r.jsxs)(u.n,{label:"Override Survey Cooldown",children:[null!=m&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(p.E,{variant:"text-sm/semibold",children:"Current cooldown"}),(0,r.jsx)(p.E,{variant:"text-sm/normal",children:`${m.cooldown/1e3} second(s) or`}),(0,r.jsx)(p.E,{variant:"text-sm/normal",children:`${m.cooldown/6e4} minute(s) or`}),(0,r.jsx)(p.E,{variant:"text-sm/normal",children:`${m.cooldown/36e5} hour(s) or`}),(0,r.jsx)(p.E,{variant:"text-sm/normal",children:`${m.cooldown/864e5} day(s)`})]}),(0,r.jsxs)(W.B,{direction:"horizontal",align:"end",children:[(0,r.jsx)(f.k,{label:"Override cooldown",min:0,value:a.toString(),type:"number",placeholder:"Duration length",onChange:e=>n(parseFloat(e))}),(0,r.jsx)(j.l,{label:"Override cooldown duration type",hideLabel:!0,options:sm,value:l,onSelectionChange:s,selectionMode:"single",fullWidth:!0})]})]}),(0,r.jsx)(b.c,{}),(0,r.jsx)(u.n,{label:"Override Survey Chance",children:(0,r.jsx)(f.k,{label:"Override chance",description:null!=m?`Current chance: ${100*m.chance}%`:void 0,helperText:"As a percentage",min:0,max:100,value:i.toString(),type:"number",onChange:e=>c(parseFloat(e))})}),(0,r.jsxs)(a1.e,{children:[(0,r.jsx)(x.$,{variant:"critical-primary",text:"Clear Override",onClick:()=>void(null!=m&&tU.h.dispatch({type:"FEEDBACK_OVERRIDE_CLEAR",feedbackType:m.feedbackType})),disabled:!v}),(0,r.jsx)(x.$,{variant:"primary",text:"Update",onClick:()=>void(null!=m&&tU.h.dispatch({type:"FEEDBACK_OVERRIDE_SET",feedbackType:m.feedbackType,cooldown:a*l,chance:i/100})),disabled:!v})]}),null==e&&(0,r.jsx)(p.E,{variant:"text-sm/normal",color:"text-feedback-critical",children:"Error: need to select a survey"}),!(a>=0)&&(0,r.jsx)(p.E,{variant:"text-sm/normal",color:"text-feedback-critical",children:"Error: cooldown needs to be a number greater than 0"}),!(i>=0&&i<=100)&&(0,r.jsx)(p.E,{variant:"text-sm/normal",color:"text-feedback-critical",children:"Error: chance needs to be a number between 0 and 100"}),(0,r.jsx)(p.E,{variant:"text-sm/normal",children:"Clear override resets a feedback survey to its default values"})]})})}var sx=a(334279),sp=a(663417),sg=a(147925),sv=a(557009),sj=a(202541);async function sf(){return(await n6.Bo.get({url:er.Rsh.ENTITLEMENTS_FOR_APPLICATION(sj.tv),oldFormErrors:!0,query:{exclude_consumed:!0,exclude_ended:!0},rejectWithError:!0})).body.map(e=>sv.A.createFromServer(e))}async function sb(e){await n6.Bo.post({url:"/debug/entitlements/fractional-premium",body:{count:1,sku_id:e},rejectWithError:!1})}async function sy(e){let t="/debug/entitlements/fractional-premium";null!=e&&(t=`${t}/${e}`),await n6.Bo.del({url:t,rejectWithError:!0})}async function sE(){await n6.Bo.post({url:"/debug/entitlements/fulfillment",rejectWithError:!1})}function s_(){let[e,t]=o.useState([]),[a,n]=o.useState(!1),l=(0,o.useCallback)(async()=>{try{n(!0);let e=await sf();t(e)}finally{n(!1)}},[]),s=(0,o.useCallback)(async e=>{await sb(e),await l()},[l]);return{grantFractionalPremium:s,deleteFractionalPremium:(0,o.useCallback)(async e=>{await sy(e),await l()},[l]),triggerNextEntitlementFulfillment:(0,o.useCallback)(async()=>{await sE(),await l()},[l]),refreshEntitlementList:l,entitlements:e,loading:a}}var sC=a(773230),sS=a(255212);let sN={[er.GD.QUEST_REWARD]:"Quest Reward",[er.GD.DEVELOPER_GIFT]:"Developer Gift",[er.GD.INVOICE]:"Invoice",[er.GD.REVERSE_TRIAL]:"Reverse Trial",[er.GD.FRACTIONAL_PREMIUM_GIVEBACK]:"Giveback",[er.GD.SUBSCRIPTION]:"Subscription",[er.GD.SUBSCRIPTION_MEMBER]:"Subscription Member"};function sA(e){let t,{entitlement:a,active:n,onDelete:l}=e;function s(e){return null!=e?(0,nN.i$)(e,"LLL"):"---"}return(0,r.jsxs)("div",{className:B()(sC.Nr,n?sS.C1:""),children:[(0,r.jsxs)(p.E,{variant:"text-md/normal",children:["ID: ",a.id," "]}),!n&&(0,r.jsxs)(p.E,{variant:"text-md/normal",children:["SKU: ",sk.find(e=>e.value===a.skuId)?.label]}),null!=a.startsAt&&null!=a.endsAt&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(p.E,{variant:"text-md/normal",children:["Start: ",s(a.startsAt)," "]}),(0,r.jsxs)(p.E,{variant:"text-md/normal",children:["End: ",s(a.endsAt)," "]})]}),(0,r.jsxs)(p.E,{variant:"text-md/normal",children:["Entitlement source type: ",null!=(t=a.sourceType)&&t in sN?sN[t]:`Unknown source type ${t}`]}),n&&null!=l&&(0,r.jsx)(ng.$n,{className:sC.RW,size:ng.$n.Sizes.TINY,color:ng.$n.Colors.RED,look:ng.$n.Looks.OUTLINED,onClick:l,children:"Delete"})]})}let sk=[{id:"1h",label:"1 hour",value:sx.j.PREMIUM_TIER_2_1_HOUR},{id:"1d",label:"1 day",value:sx.j.PREMIUM_TIER_2_1_DAY},{id:"3d",label:"3 days",value:sx.j.PREMIUM_TIER_2_3_DAY}];function sD(){let[e,t]=o.useState(!1),[a,n]=o.useState(sx.j.PREMIUM_TIER_2_1_HOUR),[l,s]=o.useState([]),[i,d]=o.useState([]),{refreshEntitlementList:c,grantFractionalPremium:u,deleteFractionalPremium:m,triggerNextEntitlementFulfillment:h,entitlements:v,loading:f}=s_();return o.useEffect(()=>{c()},[c]),o.useEffect(()=>{s(v.filter(e=>null!=e.endsAt&&e.endsAt>new Date&&e.type===er.zF_.FRACTIONAL_REDEMPTION)),d(v.filter(e=>Object.values(sx.j).includes(e.skuId)&&null==e.startsAt))},[v]),(0,r.jsx)(g.Ip,{className:t$.nd,children:(0,r.jsxs)("div",{className:sS.l$,children:[(0,r.jsxs)("div",{className:sS.dL,children:[(0,r.jsx)(p.E,{style:{marginBottom:"8px"},variant:"text-lg/bold",children:"Manage Fractional Nitro"}),(0,r.jsxs)($.D,{onClick:()=>t(!e),className:sC.As,children:[(0,r.jsx)("div",{children:(0,r.jsx)(p.E,{variant:"text-md/normal",children:"Info"})}),(0,r.jsx)(sg.A,{direction:e?sg.A.Directions.UP:sg.A.Directions.DOWN})]})]}),e&&(0,r.jsxs)("div",{style:{margin:"8px 0"},children:[(0,r.jsx)(p.E,{variant:"text-md/normal",style:{fontStyle:"italic"},color:"text-muted",children:"Subscriptions paused by Fractional Nitro do not automatically resume in local or staging environments. Subscription has to be resumed manually via Admin."}),(0,r.jsx)("br",{}),(0,r.jsx)(p.E,{variant:"text-md/normal",style:{fontStyle:"italic"},color:"text-muted",children:"Entitlement fulfillment tasks do not run automatically in local environments. This task is required to handle the scheduled unfulfillment of Fractional Nitro after it's time has elapsed."})]}),(0,r.jsxs)("section",{style:{marginBottom:"8px"},className:B()([sC.uW,sS.Uo]),children:[(0,r.jsx)(j.l,{label:"Fractional Premium SKU",value:a,options:sk,onSelectionChange:n,selectionMode:"single",fullWidth:!0}),(0,r.jsx)(x.$,{variant:"primary",text:"Grant Fractional Nitro",onClick:()=>u(a)})]}),(0,r.jsxs)("section",{className:sC.uW,children:[(0,r.jsxs)("div",{style:{flexWrap:"wrap"},className:sS.dL,children:[(0,r.jsx)(p.E,{style:{marginBottom:"8px"},variant:"text-lg/semibold",children:"Entitlements"}),(0,r.jsxs)("div",{className:sC.GC,children:[(0,r.jsx)(ng.$n,{disabled:f,size:ng.$n.Sizes.TINY,color:ng.$n.Colors.PRIMARY,look:ng.$n.Looks.OUTLINED,onClick:()=>h(),children:"Run fulfillment"}),(0,r.jsx)(ng.$n,{disabled:f,size:ng.$n.Sizes.TINY,color:ng.$n.Colors.RED,look:ng.$n.Looks.OUTLINED,onClick:()=>m(),children:"Delete all"}),(0,r.jsx)(ng.$n,{disabled:f,look:ng.$n.Looks.BLANK,size:ng.$n.Sizes.ICON,onClick:c,children:(0,r.jsx)("span",{title:"Refresh",children:(0,r.jsx)(sp.f,{size:"xs",color:"currentColor"})})})]})]}),l.length>0&&(0,r.jsxs)("div",{children:[(0,r.jsx)(p.E,{style:{marginTop:"15px"},variant:"text-md/bold",children:"Active premium"}),(0,r.jsx)("div",{children:l.map(e=>(0,r.jsx)(sA,{entitlement:e,active:!0,onDelete:()=>m(e.id)},e.id))})]}),i.length>0&&(0,r.jsxs)("div",{children:[(0,r.jsx)(p.E,{style:{marginTop:"15px"},variant:"text-md/bold",children:"Unconsumed Fractional Premium"}),(0,r.jsx)("div",{children:i.map(e=>(0,r.jsx)(sA,{entitlement:e},e.id))})]})]})]})})}var sI=a(832604),sT=a(264572).Buffer;let sR=/[^a-zA-Z0-9_.-]+/g;function sO(e){let{runningGame:t}=e,a=(0,sI.A)(t.pid,void 0),[n,l]=(0,o.useState)(!1),s=t.name??t.exeName??"",i=null!=a&&!n;async function d(){if(null!=a){l(!0);try{let e,t=await y.A.fileManager.saveWithDialog2(sT.from(a.slice(a.indexOf(",")+1),"base64"),(e=s.trim().replace(sR,"_"),`${e.length>0?e:"icon"}.png`),void 0);null==t||t.canceledByUser||(0,lB.P0)({id:"devtools-save-icon-success",type:l$.Ck.SUCCESS,message:`Saved icon to ${t.directory}`})}catch{(0,lB.P0)({id:"devtools-save-icon-failure",type:l$.Ck.FAILURE,message:"Failed to save icon"})}finally{l(!1)}}}return(0,r.jsxs)(W.B,{direction:"horizontal",align:"center",justify:"space-between",gap:12,children:[(0,r.jsxs)(W.B,{direction:"horizontal",align:"center",gap:12,fullWidth:!1,children:[null!=a?(0,r.jsx)("img",{src:a,alt:s,width:48,height:48}):(0,r.jsx)(p.E,{variant:"text-xxs/normal",color:"text-muted",children:"no icon"}),(0,r.jsxs)(W.B,{direction:"vertical",gap:0,fullWidth:!1,children:[(0,r.jsx)(p.E,{variant:"text-md/normal",children:s}),(0,r.jsxs)(p.E,{variant:"text-xxs/normal",color:"text-muted",children:[t.id??"(no id)"," \xb7 ",t.distributor??"unknown",":",t.sku??"\u2014"]}),(0,r.jsx)(p.E,{variant:"text-xxs/normal",color:"text-muted",children:t.exePath})]})]}),(0,r.jsx)(x.$,{variant:"primary",text:"Save Icon",onClick:d,disabled:!i})]})}function sw(){let e=(0,d.bG)([E.Ay],()=>E.Ay.getRunningGames());return(0,r.jsxs)(W.B,{gap:16,padding:12,fullWidth:!1,children:[(0,r.jsxs)(W.B,{gap:8,children:[(0,r.jsx)(H.D,{variant:"heading-md/bold",children:"Game Icon Extractor"}),(0,r.jsx)(p.E,{variant:"text-sm/normal",children:"Save a running game's locally-detected icon as a PNG."})]}),(0,r.jsx)(b.c,{}),(0,r.jsxs)(W.B,{gap:12,children:[(0,r.jsx)(H.D,{variant:"heading-sm/bold",children:"Running Games"}),0===e.length?(0,r.jsx)(p.E,{variant:"text-sm/normal",children:"No games detected. Launch a game first."}):e.map(e=>(0,r.jsx)(sO,{runningGame:e},`${e.pid}-${e.exePath}`))]})]})}var sM=a(390544),sL=a(498480),sP=a(475669),sU=a(15018);function sG(){let e=(0,d.bG)([ne.A],()=>ne.A.getGuildId()),t=(0,d.bG)([a9.A],()=>a9.A.getGuild(e)?.name),a=(0,d.bG)([sP.A],()=>sP.A.getStateForGuild(e)?.instances),n=o.useMemo(()=>Object.values(a??{})[0],[a]),l=o.useCallback(t=>{null!=n&&null!=e&&tU.h.dispatch({type:"GAME_SERVER_UPDATE_INSTANCE_SUCCESS",guildId:e,instance:{...n,status:t}})},[n,e]),s=o.useMemo(()=>Object.values(sM.M).map(e=>(0,r.jsx)(x.$,{variant:"primary",text:e,onClick:()=>{l(e)}},e)),[l]),i=o.useCallback(()=>{null!=n&&null!=e&&tU.h.dispatch({type:"GAME_SERVER_UPDATE_INSTANCE_SUCCESS",guildId:e,instance:{...n,serverIP:void 0,port:void 0,gameServerPanelUrl:void 0}})},[n,e]);return null==e?null:(0,r.jsxs)(g.Ip,{className:sU.kL,children:[(0,r.jsx)("div",{className:sU.uW,children:(0,r.jsx)(H.D,{variant:"heading-md/normal",children:`Current guild: ${t}`})}),(0,r.jsxs)("div",{className:sU.uW,children:[(0,r.jsx)(p.E,{variant:"eyebrow",children:`Set server state for first server: ${n?.name}`}),(0,r.jsx)("div",{className:sU.UD,children:s}),(0,r.jsx)(p.E,{variant:"eyebrow",children:"Remove Server Info"}),(0,r.jsx)("div",{className:sU.UD,children:(0,r.jsx)(x.$,{variant:"primary",text:"Remove IP Address & Game Server Panel URL",onClick:i})}),(0,r.jsx)(p.E,{variant:"eyebrow",children:"Reset server"}),(0,r.jsx)(x.$,{variant:"primary",text:"Reset",onClick:()=>{(0,sL.cq)(e)}})]})]})}function sF(e,t){let a="boolean"==typeof t?t:!aK.Ay.get(e);tU.h.dispatch({type:"DEV_TOOLS_DEV_SETTING_SET",toggle:e,value:a})}var sB=a(476145);function s$(e){let{devSettingsCategory:t}=e,a=(0,d.bG)([aK.Ay],()=>aK.Ay.allByCategory(t),[t],d.My),n=o.useMemo(()=>a.map(e=>{let[t,a,{label:n}]=e;return(0,r.jsx)(m.d,{label:n,description:t,checked:a,onChange:e=>sF(t,e)},t)}),[a]);return(0,r.jsx)("div",{className:B()(t$.nd,sB.n),children:n})}var sV=a(950305),sW=a(231483),sz=a(597770),sH=a(433492),sK=a(695458),sY=a(796140),sq=a(268791),sJ=a(836480),sQ=a(855473),sX=a(626258),sZ=a(420854),s0=a(373846),s1=a(657044),s2=a(141060),s3=a(608599),s8=a(685761),s5=a(157225),s6=a(362704),s7=a(625903),s4=a(628284),s9=a(320448),ie=a(562708),it=a(830215),ia=a(381689),il=a(889227),is=a(499785),ii=a(315069);class ir extends ii.A{id;summary;userIds;password;constructor(e){super(),this.id=e.pool_id,this.summary=e.summary,this.userIds=e.user_ids}static fromServer(e){return new ir(e)}setPassword(e){return this.password=e,this}}let io={pools:null,users:null};function id(e){null==io.users&&(io.users=new Map),io.users.set(e.id,new il.A(e))}class ic extends d.Ay.PersistedStore{static displayName="GeneratedTestUsersStore";static persistKey="GeneratedTestUsersStore";initialize(e){null!=e&&(null!=e.pools&&(io.pools=new Map(Object.entries(e.pools))),null!=e.users&&(io.users=new Map(Object.entries(e.users))))}getState(){return{pools:null!=io.pools?Object.fromEntries(io.pools):null,users:null!=io.users?Object.fromEntries(io.users):null}}getUsersForPool(e){return Array.from(io.users?.values()??[]).filter(t=>io.pools?.get(e)?.userIds.includes(t.id))}getPool(e){return io.pools?.get(e)??null}getUser(e){return io.users?.get(e)??null}getPools(){return null===io.pools?null:Array.from(io.pools.values())}}let iu=new ic(tU.h,{GENERATED_POOL_BY_ID_FETCH_SUCCESS:function(e){let{pool:t,users:a}=e;null==io.pools&&(io.pools=new Map),io.pools.set(t.id,t),a.forEach(id)},GENERATED_POOL_REMOVE_FROM_LIST:function(e){let{poolId:t}=e,a=io.pools?.get(t);if(null==a)return!1;a.userIds.length>0&&a.userIds.forEach(e=>{io.users?.delete(e)}),io.pools?.delete(t)}});var im=a(835002);async function ih(e,t){return await is.A.get({url:er.Rsh.GENERATED_POOL_BY_ID(e),trackedActionData:{event:ie.NetworkActionNames.USER_LOGIN},rejectWithError:!1}).then(e=>{let{ok:a,body:n}=e;if(!a)return void ia.A.showFailedToast(im.OB.GENERIC_ERROR);let{generated_pool:l,users:s}=n;tU.h.dispatch({type:"GENERATED_POOL_BY_ID_FETCH_SUCCESS",pool:ir.fromServer(l).setPassword(t),users:s.map(e=>new il.A(e))})}).catch(()=>(ia.A.showFailedToast(im.OB.GENERIC_ERROR),null))}var ix=a(844330),ip=a(464259);let ig=[sV.n,sW.l,sz.o,sH.K,sK.m,sY.c,sq.$,sJ.Q,sQ.Z,sX.A,sZ.E,s0.C,s1._,s2.i,s3.L,s8.f,s5.N,s6.Y,s7.Z],iv=["text-default","text-feedback-positive","text-feedback-warning","text-feedback-info","text-feedback-critical"];function ij(){let[e,t]=o.useState(""),[a,n]=o.useState(""),[l,s]=o.useState(!1);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("form",{onSubmit:async l=>{l.preventDefault(),s(!0);try{await ih(e,a),t(""),n("")}finally{s(!1)}},children:(0,r.jsxs)(W.B,{direction:"vertical",align:"center",gap:8,children:[(0,r.jsxs)(W.B,{direction:"horizontal",align:"center",gap:4,children:[(0,r.jsx)(f.k,{fullWidth:!0,value:e,onChange:t,placeholder:"Pool ID",disabled:l}),(0,r.jsx)(f.k,{type:"password",fullWidth:!0,value:a,onChange:n,placeholder:"Password",disabled:l})]}),(0,r.jsxs)(W.B,{direction:"horizontal",align:"center",gap:4,children:[(0,r.jsx)(x.$,{type:"button",size:"md",fullWidth:!0,variant:"secondary",text:"Clear",onClick:()=>{t(""),n("")},disabled:0===e.length||0===a.length||l}),(0,r.jsx)(x.$,{type:"submit",size:"md",fullWidth:!0,variant:"primary",text:"Add Pool",disabled:0===e.length||0===a.length||l,loading:l})]})]})}),(0,r.jsx)(b.c,{gap:4})]})}function ib(e){let{pool:t}=e,{id:a,summary:n}=t,l=iu.getUsersForPool(a),s=(0,d.bG)([nk.default],()=>nk.default.getId()),i=ig[Number(a)%ig.length],c=iv[Number(a)%iv.length],u=o.useCallback(()=>{tU.h.dispatch({type:"GENERATED_POOL_REMOVE_FROM_LIST",poolId:a})},[a]);return(0,r.jsx)(W.B,{direction:"horizontal",align:"start",justify:"space-between",children:(0,r.jsx)(ix.A,{icon:(0,r.jsx)(p.E,{variant:"text-md/medium",color:c,className:ip.td,children:(0,r.jsx)(i,{size:"custom",width:24,height:24,color:"currentColor"})}),title:n,className:ip.JC,subtitle:`${l.length} users`,children:(0,r.jsxs)(W.B,{direction:"vertical",gap:4,padding:{left:24,right:8,bottom:16},fullWidth:!1,children:[l.map((e,a)=>(0,r.jsxs)(o.Fragment,{children:[0!==a&&(0,r.jsx)(b.c,{gap:4}),(0,r.jsx)($.D,{onClick:a=>{a.stopPropagation(),function(e,t){let a=iu.getUser(t);if(null==a)throw Error("User not found");let n=iu.getPool(e)?.password;if(null==n)throw Error("Pool password not found");if(null==a.email)throw Error("User email not found");it.A.login({login:a.email,password:n,isMultiAccount:!0,source:"generated_test_user"}).catch(()=>(ia.A.showFailedToast(im.OB.GENERIC_ERROR),null))}(t.id,e.id)},"aria-disabled":s===e.id,className:B()(ip.vk,{[ip.Pe]:s===e.id}),children:(0,r.jsxs)(W.B,{direction:"horizontal",align:"center",justify:"space-between",gap:8,padding:{right:8},fullWidth:!1,children:[(0,r.jsxs)(W.B,{direction:"horizontal",align:"center",gap:8,fullWidth:!1,className:B()({[ip.WP]:s===e.id}),children:[(0,r.jsx)(sV.n,{size:"custom",width:20,height:20,color:"currentColor"}),(0,r.jsxs)("div",{children:[(0,r.jsx)(p.E,{variant:"text-sm/normal",color:"text-default",children:e.username}),(0,r.jsx)(p.E,{variant:"text-xs/normal",color:"text-muted",className:ip.c1,children:e.email})]})]}),s===e.id?(0,r.jsx)(p.E,{variant:"text-sm/normal",color:"text-feedback-positive",children:(0,r.jsx)(s4.y,{size:"sm",color:"currentColor"})}):(0,r.jsx)(s9._,{size:"sm",color:"currentColor"})]},e.id)},e.id)]},e.id)),(0,r.jsx)("div",{className:ip.UD,children:(0,r.jsx)(x.$,{icon:nb.u,text:"",size:"sm",variant:"secondary",onClick:u})})]})})})}function iy(){let e=(0,d.yK)([iu],()=>iu.getPools()??[]);return(0,r.jsxs)(W.B,{padding:16,gap:16,fullWidth:!1,className:ip.kL,children:[(0,r.jsx)(ij,{}),(0,r.jsx)(g.Ip,{className:ip.Ik,children:e?.map(e=>(0,r.jsx)(ib,{pool:e},e.id))})]})}var iE=a(582306),i_=a(507104),iC=a(2693);function iS(e){let t=new Date(e);return t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})+" "+t.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})}function iN(e,t){return null!=t?`/users/@me/gift-intents/dismissals/${e}/${t}`:`/users/@me/gift-intents/dismissals/${e}`}let iA=sj.np.FRIEND_ANNIVERSARY;function ik(e){return 403===e?.status?"Forbidden (403). This account is likely not in the backend-persistence experiment; clearing also requires a staff account.":e instanceof Error?e.message:String(e)}function iD(){let e=(0,d.bG)([i_.Ay],()=>i_.Ay.getDevToolTotalFriendAnniversaries()),t=(0,d.bG)([i_.Ay],()=>i_.Ay.getDevToolCurrentDate()),a=(0,d.bG)([i_.Ay],()=>i_.Ay.getMessageGiftIntentLastShownMap()),n=(0,d.bG)([i_.Ay],()=>i_.Ay.getHighestAffinityFriendAnniversaries()),l=(0,d.bG)([i_.Ay],()=>i_.Ay.getHighAffinityFriendAnniversaries()),s=(0,d.bG)([en.default],()=>en.default.getCurrentUser()?.isStaff()??!1),i=(0,d.bG)([aN.A],()=>aN.A.getFriendIDs().filter(e=>!aN.A.isIgnored(e)&&null!=aN.A.getSince(e)).length),c=(0,d.bG)([ap.A],()=>{let e=Number(ap.A.settings.userContent?.lastGiftIntentDismissedAtMs??"0");return Number.isNaN(e)||0===e?null:e}),[u,m]=o.useState([]),[h,v]=o.useState(null),[f,b]=o.useState(!1),[y,E]=o.useState(!1),[_,C]=o.useState(!1),[S,N]=o.useState(void 0),A=o.useCallback(async()=>{E(!0);try{let{body:e}=await n6.Bo.get({url:"/users/@me/gift-intent-dismissals",rejectWithError:!0});m(e.dismissals??[]),v(null),b(!1)}catch(t){let e=t.status;v(ik(t)),b(403===e),403===e&&m([])}finally{E(!1)}},[]);async function k(e){C(!0);try{await e(),v(null),await A()}catch(e){v(ik(e))}finally{C(!1)}}o.useEffect(()=>{A()},[A,c]);let D=u.filter(e=>e.intent_type===iA),I=new Map(D.map(e=>[e.target_id,Number(e.dismissed_at_ms)])),T=Array.from(new Set([...Object.keys(a),...I.keys()])),R=Array.from(new Set([...n,...l])),O=R.map(e=>({id:e,value:e,label:en.default.getUser(e)?.username??`Unknown User (${e})`})),w=y||_;function M(e){tU.h.dispatch({type:"DEV_TOOLS_SET_FRIEND_ANNIVERSARY_COUNT",total:e})}function L(e){let t=ni.A.getUserAffinity(e);return t?.dmProbability!=null?`${(100*t.dmProbability).toFixed(3)}%`:"N/A"}return(0,r.jsx)(g.Ip,{className:t$.nd,children:(0,r.jsxs)("div",{className:iC.l$,children:[(0,r.jsx)(p.E,{className:iC.Iv,variant:"text-lg/bold",children:"Friend Anniversary"}),(0,r.jsx)("div",{className:iC.Pm,children:(0,r.jsxs)(W.B,{gap:8,direction:"horizontal",style:{flex:1},children:[(0,r.jsx)(j.l,{label:"Number of anniversaries to generate",selectionMode:"single",options:[{id:"none",label:"None",value:null},{id:"1",label:"1",value:1},{id:"2",label:"2",value:2},{id:"3",label:"3",value:3},{id:"4",label:"4",value:4},{id:"5",label:"5",value:5},{id:"10",label:"10",value:10},{id:"25",label:"25",value:25}],value:e,onSelectionChange:e=>{M(e)}}),(0,r.jsx)(x.$,{size:"sm",variant:"secondary",text:"Re-randomize",disabled:null==e,onClick:function(){tU.h.dispatch({type:"DEV_TOOLS_RESAMPLE_FRIEND_ANNIVERSARIES"})}}),(0,r.jsx)(x.$,{size:"sm",variant:"secondary",text:"Clear",onClick:()=>{M(null)}})]})}),null!=e&&(0,r.jsx)("div",{className:iC.Pm,children:(0,r.jsxs)(W.B,{gap:8,children:[0===i?(0,r.jsx)(p.E,{variant:"text-xs/normal",color:"text-feedback-warning",children:"No friends with an anniversary date, so no anniversaries can be generated."}):(0,r.jsxs)(p.E,{variant:"text-xs/normal",children:["Generated ",R.length," of ",e," requested",R.length<e?` (only ${i} friend${1===i?"":"s"} with an anniversary date).`:"."]}),(0,r.jsx)(p.E,{variant:"text-xs/normal",children:"Affinity is the percent chance that User A will DM or GDM User B in the next 7 days."}),(0,r.jsx)(p.E,{variant:"text-xs/normal",children:"The devtool automatically assigns users as high affinity regardless of actual affinity for testing."}),n.length>0&&(0,r.jsxs)(W.B,{gap:4,children:[(0,r.jsx)(p.E,{variant:"text-xs/semibold",children:"Highest Affinity Friend Anniversaries:"}),n.map(e=>{let t=en.default.getUser(e),a=t?.username??`Unknown User (${e})`;return(0,r.jsxs)(p.E,{variant:"text-xs/normal",children:[a," (",L(e),")"]},e)})]}),l.length>0&&(0,r.jsxs)(W.B,{gap:4,children:[(0,r.jsx)(p.E,{variant:"text-xs/semibold",children:"High Affinity Friend Anniversaries:"}),l.map(e=>{let t=en.default.getUser(e),a=t?.username??`Unknown User (${e})`;return(0,r.jsxs)(p.E,{variant:"text-xs/normal",children:[a," (",L(e),")"]},e)})]})]})}),(0,r.jsx)("div",{className:iC.Pm,children:(0,r.jsxs)(W.B,{gap:8,direction:"horizontal",children:[(0,r.jsx)(iE.J,{label:"Override current date used for cooldowns",value:null!=t?np()(t):void 0,onSelect:function(e){let t=np()(),a=e.clone().hours(t.hours()).minutes(t.minutes()).seconds(t.seconds()).milliseconds(t.milliseconds());tU.h.dispatch({type:"DEV_TOOLS_SET_CURRENT_DATE",date:a.valueOf()})}}),(0,r.jsx)(x.$,{variant:"secondary",size:"sm",text:"Clear",onClick:function(){tU.h.dispatch({type:"DEV_TOOLS_RESET_CURRENT_DATE"})}})]})}),(0,r.jsxs)("div",{className:iC.Pm,children:[(0,r.jsx)(p.E,{variant:"text-md/normal",children:"Reset gift message cooldown (per-user, 14d)"}),(0,r.jsx)(x.$,{variant:"primary",size:"sm",text:"Reset",onClick:function(){tU.h.dispatch({type:"DEV_TOOLS_GIFT_MESSAGE_COOLDOWN_RESET"})}})]}),(0,r.jsxs)("div",{className:iC.Pm,children:[(0,r.jsx)(p.E,{variant:"text-md/normal",children:"Clear last seen friend anniversaries in All Friends"}),(0,r.jsx)(x.$,{variant:"primary",size:"sm",text:"Clear",onClick:function(){tU.h.dispatch({type:"DEV_TOOLS_FRIENDS_LIST_GIFT_INTENTS_SHOWN_RESET"})}})]}),(0,r.jsx)("div",{className:iC.Pm,children:(0,r.jsxs)(W.B,{gap:12,fullWidth:!0,children:[(0,r.jsx)(p.E,{variant:"text-md/semibold",children:"Backend dismissal sync"}),(0,r.jsxs)(W.B,{gap:4,children:[f&&(0,r.jsx)(p.E,{variant:"text-xs/normal",color:"text-feedback-warning",children:"This account is not in the backend-persistence experiment, so nothing here will persist to the server."}),!s&&(0,r.jsx)(p.E,{variant:"text-xs/normal",color:"text-feedback-warning",children:"Clearing server dismissals requires a staff account."}),(0,r.jsxs)(p.E,{variant:"text-xs/normal",children:["Server last recorded a dismissal:"," ",null!=c?iS(c):"never"]})]}),(0,r.jsxs)(W.B,{gap:8,direction:"horizontal",align:"end",children:[(0,r.jsx)(x.$,{size:"sm",variant:"secondary",text:"Refresh",onClick:()=>{A()},disabled:w}),(0,r.jsx)(x.$,{size:"sm",variant:"primary",text:"Clear all",onClick:function(){k(()=>n6.Bo.del({url:iN(iA),rejectWithError:!0}))},disabled:w||!s||f||0===D.length})]}),(0,r.jsxs)(W.B,{gap:8,direction:"horizontal",align:"end",children:[(0,r.jsx)(j.l,{label:"Dismiss a generated anniversary on the server",selectionMode:"single",options:O,value:S,onSelectionChange:e=>{N(e)}}),(0,r.jsx)(x.$,{size:"sm",variant:"secondary",text:"Dismiss on server",onClick:function(){null!=S&&k(()=>n6.Bo.post({url:"/users/@me/gift-intents/dismiss",body:{intent_type:iA,target_id:S},rejectWithError:!0}))},disabled:w||f||null==S})]}),0===O.length&&(0,r.jsx)(p.E,{variant:"text-xs/normal",children:"Generate friend anniversaries above to pick a target to dismiss."}),null!=h&&(0,r.jsx)(p.E,{variant:"text-xs/normal",color:"text-feedback-critical",children:h}),y&&(0,r.jsx)(p.E,{variant:"text-xs/normal",children:"Loading..."}),!y&&0===T.length&&(0,r.jsx)(p.E,{variant:"text-xs/normal",children:"No dismissals recorded locally or on the server."}),!y&&T.length>0&&(0,r.jsxs)(W.B,{gap:4,children:[(0,r.jsx)(p.E,{variant:"text-xs/semibold",children:"Local vs. server (per friend):"}),T.map(e=>{let t=en.default.getUser(e),n=t?.username??`Unknown User (${e})`,l=a[e],i=I.get(e);return(0,r.jsxs)(W.B,{gap:8,direction:"horizontal",justify:"space-between",align:"center",children:[(0,r.jsxs)(p.E,{variant:"text-xs/normal",children:[n,": local ",null!=l?iS(l):"none",", server"," ",null!=i?iS(i):"none"]}),null!=i&&(0,r.jsx)(x.$,{size:"sm",variant:"secondary",text:"Clear",onClick:()=>{k(()=>n6.Bo.del({url:iN(iA,e),rejectWithError:!0}))},disabled:w||!s||f})]},e)})]})]})})]})})}var iI=a(460890),iT=a(349288),iR=a(517461),iO=a(214947),iw=a(403581),iM=a(34188);let iL=["ILLO_BLUE","ILLO_GREEN","ILLO_PINK","ILLO_ORANGE","ILLO_PURPLE","ILLO_YELLOW","BLUE_NEW","GREEN_NEW","NEUTRAL","ORANGE_NEW","RED_NEW","TEAL_NEW","YELLOW_NEW"];var iP=a(810822);let iU=[0,.5,1],iG=["Center","Inner ring","Outer ring"],iF=iU.length,iB="ILLO_BLUE",i$="ILLO_BLUE_40",iV=Array.from({length:iF},()=>i$),iW=Array.from({length:iF},()=>iB),iz=["1","0.5","0"],iH=/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i,iK=[{label:"Light",value:er.NJ8.LIGHT,id:er.NJ8.LIGHT},{label:"Dark",value:er.NJ8.DARK,id:er.NJ8.DARK},{label:"Darker",value:er.NJ8.DARKER,id:er.NJ8.DARKER},{label:"Midnight",value:er.NJ8.MIDNIGHT,id:er.NJ8.MIDNIGHT}],iY={[er.NJ8.MIDNIGHT]:er.NJ8.DARKER,[er.NJ8.DARKER]:er.NJ8.DARK,[er.NJ8.LIGHT]:er.NJ8.DARK},iq={[er.NJ8.LIGHT]:"light",[er.NJ8.DARK]:"ash",[er.NJ8.DARKER]:"dark",[er.NJ8.MIDNIGHT]:"onyx"},iJ=[{id:"friends",icon:iO.$,text:"Friends"},{id:"nitro",icon:iw.t,text:"Nitro Home",nitroHoverGradient:!0},{id:"shop",icon:iM.U,text:"Shop",useCustomGradient:!0}],iQ=iL.map(e=>({label:e,value:e,id:e})),iX=Object.fromEntries(iL.map(e=>[e,Object.keys(eW.A.unsafe_rawColors).filter(t=>String(t).startsWith(e+"_")).sort((e,t)=>parseInt(String(e).split("_").pop()??"0",10)-parseInt(String(t).split("_").pop()??"0",10)).map(e=>{let t=String(e).split("_").pop()??e,[a,n,l]=eW.A.unsafe_rawColors[e].resolve().rgba(),s=(.299*a+.587*n+.114*l)/255>.5?eW.A.unsafe_rawColors.OPACITY_BLACK_28:eW.A.unsafe_rawColors.OPACITY_WHITE_28,i=(0,r.jsx)("span",{className:iP.oP,style:{background:`rgb(${a}, ${n}, ${l})`,border:`1px solid ${s.css}`}});return{label:t,value:e,id:String(e),leading:i}})]));var iZ=a(306327);function i0(e,t,a){return e.map((e,n)=>n===t?a:e)}function i1(e,t){let[a,n,l,s]=eW.A.unsafe_rawColors[e].resolve().rgba({opacity:t});return{r:a,g:n,b:l,a:s}}function i2(e,t){let a=eW.A.unsafe_rawColors[e].resolve();return null!=t?a.hex({opacity:t}):a.hex()}function i3(e){let{yaml:t,label:a}=e,n=o.useCallback(()=>{navigator.clipboard.writeText(t)},[t]);return(0,r.jsxs)(W.B,{gap:4,children:[(0,r.jsxs)(W.B,{direction:"horizontal",gap:8,align:"center",justify:"space-between",children:[(0,r.jsx)(p.E,{variant:"text-md/semibold",children:a}),(0,r.jsx)(eF.K,{icon:nv.T,"aria-label":`Copy ${a} YAML`,onClick:n,variant:"secondary",size:"sm"})]}),(0,r.jsx)("pre",{className:iP.RP,children:t})]})}function i8(e){let{allResolvedStops:t}=e,a=o.useMemo(()=>iG.map((e,a)=>{let n;return n=iK.map(e=>{let n,l,{value:s}=e,i=iq[s],r=t[s];return` ${i}:
color: ${-1===(l=(n=String(r.colors[a]).toLowerCase()).lastIndexOf("_"))?n.replace(/_/g,"-"):n.slice(0,l).replace(/_/g,"-")+"."+n.slice(l+1)}
opacity: ${r.opacities[a]}`}).join("\n"),`type: background
colors:
${n}
gradient-colors:
color-mix: false
codegen:
web: true
mobile: false`}),[t]);return(0,r.jsxs)(W.B,{gap:16,children:[(0,r.jsx)(H.D,{variant:"heading-sm/semibold",children:"Token YAML"}),iG.map((e,t)=>(0,r.jsx)(i3,{yaml:a[t],label:e},e))]})}function i5(e,t,a){let{r:n,g:l,b:s,a:i}=function(e,t){if(t<=e[0].position){let t=e[0];return{r:t.r,g:t.g,b:t.b,a:t.opacity}}for(let a=0;a<e.length-1;a++){let n=e[a],l=e[a+1];if(t<=l.position){if(l.position===n.position)return{r:n.r,g:n.g,b:n.b,a:n.opacity};let e=(t-n.position)/(l.position-n.position);return{r:n.r+(l.r-n.r)*e,g:n.g+(l.g-n.g)*e,b:n.b+(l.b-n.b)*e,a:n.opacity+(l.opacity-n.opacity)*e}}}let a=e[e.length-1];return{r:a.r,g:a.g,b:a.b,a:a.opacity}}(t,a),r=.5*i;return new iZ.A("srgb",[(e.r*(1-r)+n*r)/255,(e.g*(1-r)+l*r)/255,(e.b*(1-r)+s*r)/255])}function i6(e,t,a){var n;let l=a.map(e=>{let[t,a,n]=eW.A.unsafe_rawColors[e.color].resolve().rgba();return{r:t,g:a,b:n,opacity:e.opacity,position:e.position}}),s=1/0;for(let a of l)(n=e.contrast(i5(t,l,a.position),"WCAG21"))<s&&(s=n);for(let a=0;a<l.length-1;a++){let{contrast:n}=function(e,t,a,n,l){let s=1/0,i=n;for(let r=0;r<=100;r++){let o=n+r/100*(l-n),d=a.contrast(i5(e,t,o),"WCAG21");d<s&&(s=d,i=o)}return{contrast:s,position:i}}(t,l,e,l[a].position,l[a+1].position);n<s&&(s=n)}return Math.round(100*s)/100}function i7(e){let[t,a,n]=eW.A.colors.TEXT_DEFAULT.resolve(e).rgba(),[l,s,i]=eW.A.colors.BACKGROUND_BASE_LOWEST.resolve(e).rgba(),[r,o,d,c]=eW.A.colors.INTERACTIVE_BACKGROUND_HOVER.resolve(e).rgba();return{text:new iZ.A("srgb",[t/255,a/255,n/255]),background:{r:l*(1-c)+r*c,g:s*(1-c)+o*c,b:i*(1-c)+d*c}}}function i4(){return{colors:Array.from({length:iF},()=>void 0),scales:Array.from({length:iF},()=>void 0),opacities:Array.from({length:iF},()=>void 0)}}function i9(){return{[er.NJ8.LIGHT]:i4(),[er.NJ8.DARK]:{colors:[...iV],scales:[...iW],opacities:[...iz]},[er.NJ8.DARKER]:i4(),[er.NJ8.MIDNIGHT]:i4()}}function re(){let e=(0,iI.G9)(),[t,a]=o.useState(er.NJ8.DARK),[n,l]=(0,iR.V)("DevToolsGradientContrastPanel_themeStops",i9()),s=n??i9(),[i,d]=o.useState(["","",""]),[c,u]=o.useState([null,null,null]),[m,h]=o.useState(null),{images:v,renderPickers:j}=function(){let[e,t]=o.useState(null),a=o.useRef(null),n=o.useCallback(e=>{let a=e.target.files?.[0];if(null==a)return;let n=new FileReader;n.onload=()=>t({src:n.result,name:a.name}),n.readAsDataURL(a),e.target.value=""},[]),l=o.useCallback(()=>(0,r.jsxs)(W.B,{direction:"horizontal",gap:8,align:"center",children:[(0,r.jsx)("input",{ref:a,type:"file",accept:"image/jpeg,image/png,image/gif,image/webp,image/avif",onChange:n,style:{display:"none"}}),null!=e?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(p.E,{variant:"text-sm/normal",children:e.name}),(0,r.jsx)(lV.Q,{text:"Remove",variant:"critical",textVariant:"text-sm/medium",onClick:()=>t(null)})]}):(0,r.jsx)(x.$,{variant:"secondary",size:"sm",text:"Upload button hover image",onClick:()=>a.current?.click()})]}),[e,n]);return{images:{buttonBackground:e},renderPickers:l}}(),b=o.useMemo(()=>Object.fromEntries(iK.map(e=>{let{value:t}=e;return[t,function(e,t){let a=[],n=[],l=[];for(let s=0;s<iF;s++){let i,r,o,d=t;for(;null!=d;){let t=e[d];if(i??=t.colors[s],r??=t.scales[s],o??=t.opacities[s],null!=i&&null!=r&&null!=o)break;d=iY[d]}a.push(i??iV[s]),n.push(r??iW[s]),l.push(o??iz[s])}return{colors:a,scales:n,opacities:l}}(s,t)]})),[s]),y=b[t],E=o.useCallback(e=>{l({...s,[t]:e(s[t])})},[t,l,s]),_=o.useMemo(()=>i7({theme:t,saturation:1}),[t]),C=o.useMemo(()=>{let e=[];for(let t=0;t<iF;t++){let a=parseFloat(y.opacities[t]);if(isNaN(a)||a<0||a>1)return null;e.push({color:y.colors[t],opacity:a,position:iU[t]})}return e},[y]),S=o.useMemo(()=>{if(null==C)return null;let{text:e,background:t}=_;return iG.map((a,n)=>iX[y.scales[n]].map(a=>{let l=i6(e,t,i0(C,n,{...C[n],color:a.value}));return{...a,trailing:`(${l}:1)`}}))},[C,_,y.scales]),N=o.useMemo(()=>{try{return iK.map(e=>{let{value:t,label:a}=e,n=b[t],l=[];for(let e=0;e<iF;e++){let s=parseFloat(n.opacities[e]);if(isNaN(s)||s<0||s>1)return{theme:t,label:a,result:null};l.push({color:n.colors[e],opacity:s,position:iU[e]})}return{theme:t,label:a,result:function(e,t){let a,{text:n,background:l}=i7(t),s=i6(n,l,e),i=s>=4.5;if(!i)for(let t=0;t<e.length;t++){let s=function(e){let t=String(e).match(/^(.+)_\d+$/);if(null==t)return null;let a=t[1];return iL.includes(a)?a:null}(e[t].color);if(null==s)continue;let i=parseInt(String(e[t].color).split("_").pop()??"0",10),r=1/0;for(let{value:o}of iX[s]){if(o===e[t].color)continue;let s=i6(n,l,i0(e,t,{...e[t],color:o}));if(s>=4.5){let e=Math.abs(parseInt(String(o).split("_").pop()??"0",10)-i);e<r&&(r=e,a={stopIndex:t,suggestedColor:o,resultingMinContrast:s})}}}return{passes:i,minContrastRatio:s,suggestion:a}}(l,{theme:t,saturation:1})}})}catch{return null}},[b]);return(0,r.jsx)(g.Ar,{className:iP.XG,children:(0,r.jsxs)(W.B,{gap:24,padding:8,className:iP.zr,children:[(0,r.jsx)(H.D,{variant:"heading-lg/medium",children:"Tab Hover Gradient Token Generator & Contrast Checker"}),(0,r.jsxs)(W.B,{gap:8,children:[(0,r.jsx)(p.E,{variant:"text-md/normal",children:"Checks that tab hover gradients pass WCAG AA (4.5:1) contrast against the text in the tab, accounting for opacities and hover states."}),(0,r.jsx)(p.E,{variant:"text-sm/normal",children:"Pick colors for each gradient stop (center, inner ring, outer ring) per theme. Each color in the dropdown will show the minimum contrast ratio for the gradient if the color were selected. Dark-family themes inherit: values set on Dark cascade to Darker and Midnight unless overridden."}),(0,r.jsx)(p.E,{variant:"text-sm/normal",children:"Use the hex field to paste in a hex color \u2014 it will snap to the closest allowed token and show the deltaE distance."}),(0,r.jsxs)(p.E,{variant:"text-sm/normal",children:["Copy the generated YAML at the bottom to create your token definitions to be used by the"," ",(0,r.jsx)(iT.Anchor,{href:"https://design.discord.tools/foundations/color/token-pipeline",children:"token pipeline"}),"."]})]}),(0,r.jsx)(aa.Z,{selectionMode:"single",label:"Theme",value:t,onSelectionChange:e=>a(e),closeOnSelect:!0,options:iK}),(0,r.jsxs)(W.B,{gap:16,children:[(0,r.jsx)(H.D,{variant:"heading-sm/semibold",children:"Gradient Stops"}),(0,r.jsx)("div",{className:iP.G9,children:iG.map((e,t)=>{let a=""!==i[t];return(0,r.jsxs)(o.Fragment,{children:[(0,r.jsxs)(W.B,{gap:0,className:iP.hi,children:[(0,r.jsx)(p.E,{variant:"text-md/medium",children:e}),(0,r.jsx)(lV.Q,{variant:"secondary",textVariant:"text-xs/normal",text:`(${i2(y.colors[t],parseFloat(y.opacities[t]))})`,onClick:()=>navigator.clipboard.writeText(i2(y.colors[t],parseFloat(y.opacities[t])))})]}),(0,r.jsx)(aa.Z,{selectionMode:"single",label:"Scale",disabled:a,value:y.scales[t],onSelectionChange:e=>{let a=iX[e][0]?.value;E(n=>({...n,scales:i0(n.scales,t,e),colors:null!=a?i0(n.colors,t,a):n.colors}))},closeOnSelect:!0,options:iQ}),(0,r.jsx)(aa.Z,{selectionMode:"single",label:"Value",disabled:a,value:y.colors[t],onSelectionChange:e=>E(a=>({...a,colors:i0(a.colors,t,e)})),closeOnSelect:!0,options:S?.[t]??iX[y.scales[t]]}),(0,r.jsx)(f.k,{label:"Opacity",name:`opacity-${t}`,value:y.opacities[t],onChange:e=>E(a=>({...a,opacities:i0(a.opacities,t,e)})),placeholder:"0\u20131"}),(0,r.jsx)(f.k,{label:`Hex${a&&null!=c[t]?` (dE: ${c[t]})`:""}`,name:`hex-${t}`,value:i[t],onChange:e=>{d(a=>i0(a,t,e));let a=function(e){if(!iH.test(e))return null;try{return new iZ.A(e.startsWith("#")?e:`#${e}`)}catch{return null}}(e);if(null!=a){let e=function(e){let t=i$,a=iB,n=1/0;for(let l of iL)for(let s of iX[l]){let i=e.deltaE(function(e){let[t,a,n]=eW.A.unsafe_rawColors[e].resolve().rgba();return new iZ.A("srgb",[t/255,a/255,n/255])}(s.value),"2000");i<n&&(n=i,t=s.value,a=l)}return{color:t,scale:a,deltaE:Math.round(100*n)/100}}(a);u(a=>i0(a,t,e.deltaE)),E(a=>({...a,scales:i0(a.scales,t,e.scale),colors:i0(a.colors,t,e.color)}))}else u(e=>i0(e,t,null))},placeholder:"#hex"})]},t)})})]}),j(),(0,r.jsx)(H.D,{variant:"heading-sm/semibold",children:"Preview"}),(0,r.jsx)(iI.GE,{value:{...e,theme:t},children:(0,r.jsx)(e$.N,{theme:t,children:e=>(0,r.jsx)("div",{className:e,children:(0,r.jsx)(W.B,{gap:16,children:(0,r.jsx)("ul",{className:iP.$8,style:{background:eW.A.colors.BACKGROUND_BASE_LOWEST.css},children:iJ.map((e,t)=>(0,r.jsx)(ep.z9,{route:"",selected:m===e.id,onClick:()=>h(e.id),icon:e.icon,text:e.text,showHoverGradient:!0,nitroHoverGradient:"nitroHoverGradient"in e,role:"listitem",tabIndex:0,onFocus:()=>{},..."useCustomGradient"in e&&{hoverGradientStart:i1(y.colors[0],parseFloat(y.opacities[0])),hoverGradientMiddle:i1(y.colors[1],parseFloat(y.opacities[1])),hoverGradientEnd:i1(y.colors[2],parseFloat(y.opacities[2]))},...{"data-list-item-id":`devtools-preview-${t}`},children:"useCustomGradient"in e&&v.buttonBackground?.src!=null&&(0,r.jsx)("div",{style:{position:"absolute",height:"100%",bottom:0,insetInlineEnd:0,pointerEvents:"none",borderRadius:"inherit"},children:(0,r.jsx)("img",{src:v.buttonBackground.src,alt:"","aria-hidden":!0,style:{height:"100%",maxWidth:"100%",objectFit:"cover",objectPosition:"bottom right",borderRadius:"inherit"}})})},e.id))})})})})}),null!=N&&(0,r.jsxs)(W.B,{gap:16,children:[(0,r.jsx)(H.D,{variant:"heading-sm/semibold",children:"Results"}),N.map(e=>{let{theme:t,label:a,result:n}=e;return null!=n?(0,r.jsxs)(W.B,{gap:8,children:[(0,r.jsx)(p.E,{variant:"text-md/semibold",children:a}),(0,r.jsxs)(V.w,{type:n.passes?"success":"critical",children:[n.passes?"\u2713 Passes":"\u2717 Fails"," WCAG AA \u2014 Min contrast: ",n.minContrastRatio," : 1"]}),!n.passes&&null!=n.suggestion&&(0,r.jsxs)(W.B,{gap:4,children:[(0,r.jsx)(p.E,{variant:"text-sm/semibold",children:"Suggestion:"}),(0,r.jsxs)(p.E,{variant:"text-sm/normal",children:[iG[n.suggestion.stopIndex],": ",(0,r.jsx)("strong",{children:n.suggestion.suggestedColor})," \u2192"," ",n.suggestion.resultingMinContrast," : 1"]})]}),!n.passes&&null==n.suggestion&&(0,r.jsx)(p.E,{variant:"text-sm/normal",children:"No single swap from the same color scale would fix the contrast ratio."})]},t):null})]}),(0,r.jsx)(i8,{allResolvedStops:b})]})})}var rt=a(820739),ra=a(230135),rn=a(45780),rl=a(868652),rs=a(859241);let ri=[ah.M.GUILD_POWERUP_PERKS_COACHMARK,ah.M.GUILD_POWERUPS_OVERVIEW_SIDEBAR_COACHMARK,ah.M.GUILD_POWERUP_NOTIFICATION,ah.M.GUILD_TAG_AVAILABLE_COACHMARK,ah.M.GUILD_POWERUP_NEW_PERK_AVAILABLE_COACHMARK,ah.M.GUILD_POWERUP_NEW_PERK_AVAILABLE_BADGE],rr=[ah.V.GUILD_POWERUP_LEVEL_1_COACHMARK,ah.V.GUILD_POWERUP_LEVEL_2_COACHMARK,ah.V.GUILD_POWERUP_LEVEL_3_COACHMARK,ah.V.GUILD_POWERUP_SINGLE_SKU_PURCHASE_COACHMARK,ah.V.GUILD_POWERUP_CHOICE_SKU_PURCHASE_COACHMARK],ro=[ah.V.ADOPT_CLAN_IDENTITY_NOTICE],rd=[ah.M.VANITY_URL_POWERUP_ROLLBACK_NOTIFICATION,ah.M.VANITY_URL_POWERUP_ROLLBACK_MODAL,ah.M.VANITY_URL_POWERUP_EDUCATIONAL_POPOVER];function rc(e){switch(e){case ah.V.GUILD_POWERUP_LEVEL_1_COACHMARK:return"GUILD_POWERUP_LEVEL_1_COACHMARK";case ah.V.GUILD_POWERUP_LEVEL_2_COACHMARK:return"GUILD_POWERUP_LEVEL_2_COACHMARK";case ah.V.GUILD_POWERUP_LEVEL_3_COACHMARK:return"GUILD_POWERUP_LEVEL_3_COACHMARK";case ah.V.GUILD_POWERUP_SINGLE_SKU_PURCHASE_COACHMARK:return"GUILD_POWERUP_SINGLE_SKU_PURCHASE_COACHMARK";case ah.V.GUILD_POWERUP_CHOICE_SKU_PURCHASE_COACHMARK:return"GUILD_POWERUP_CHOICE_SKU_PURCHASE_COACHMARK";case ah.V.ADOPT_CLAN_IDENTITY_NOTICE:return"ADOPT_CLAN_IDENTITY_NOTICE";default:return String(e)}}var ru=a(283631);async function rm(e,t,a){await n6.Bo.patch({url:er.Rsh.APPLIED_BOOST_MODIFY_END_DATE,body:{applied_boost_ids:t.map(e=>e.id),ends_at:a?null:np()().add(1,"day")},rejectWithError:!0}),(0,rt.VU)(e),(0,rl.Xd)(e,!0)}async function rh(e){await n6.Bo.post({url:er.Rsh.SEND_POWERUPS_SYSTEM_MESSAGE(e),rejectWithError:!0})}function rx(){let e=(0,d.bG)([ne.A],()=>ne.A.getGuildId()),t=(0,d.bG)([a9.A],()=>a9.A.getGuild(e)?.name),a=(0,d.yK)([ap.A],()=>[...rr,...ro].filter(t=>null!=e&&(0,rn.zs)(t,e))),n=(0,d.yK)([rs.A],()=>null!=e?rs.A.getAppliedGuildBoostsForGuild(e)??[]:[]);if(null!=e)return(0,r.jsxs)(g.Ip,{className:ru.kL,children:[(0,r.jsx)("div",{className:ru.uW,children:(0,r.jsx)(H.D,{variant:"heading-md/normal",children:`Current guild: ${t}`})}),(0,r.jsxs)("div",{className:ru.uW,children:[(0,r.jsx)(p.E,{variant:"eyebrow",className:ru.wx,children:"Reset Notification Indicators"}),(0,r.jsx)(x.$,{variant:"primary",text:"Reset",onClick:()=>{(0,rl.qM)()}})]}),(0,r.jsxs)("div",{className:ru.uW,children:[(0,r.jsx)(p.E,{variant:"eyebrow",className:ru.wx,children:"Reset Progress Bar State"}),(0,r.jsx)(x.$,{variant:"primary",text:"Reset",onClick:ra.O})]}),(0,r.jsxs)("div",{className:ru.uW,children:[(0,r.jsx)(p.E,{variant:"eyebrow",children:"Set Warning State"}),(0,r.jsxs)("div",{children:[(0,r.jsx)(x.$,{variant:"primary",text:"Set Half Boosts expiring in 1 day",onClick:()=>{rm(e,n.slice(Math.floor(n.length/2)),!1)}}),(0,r.jsx)(x.$,{variant:"primary",text:"Reset End Date",onClick:()=>{rm(e,n,!0)}})]})]}),(0,r.jsxs)("div",{className:ru.uW,children:[(0,r.jsx)(p.E,{variant:"eyebrow",className:ru.wx,children:"Reset User Level DCs"}),(0,r.jsx)(W.B,{gap:16,children:ri.map(e=>(0,r.jsx)(lA,{className:ru.z6,content:ah.M[e]},ah.M[e]))})]}),(0,r.jsx)("div",{className:ru.uW,children:(0,r.jsx)(u.n,{label:"Reset Guild Level DCs",children:rr.map(t=>(0,r.jsx)(m.d,{label:rc(t),checked:a.includes(t),onChange:a=>{a?(0,rn._$)(t,e,!1):((0,ax._N)(ah.M.GUILD_POWERUP_NOTIFICATION),(0,rn.hk)(t,e))}},t))})}),(0,r.jsx)("div",{className:ru.uW,children:(0,r.jsx)(u.n,{label:"Reset Server Tag Guild Level DCs",children:ro.map(t=>(0,r.jsx)(m.d,{label:rc(t),checked:a.includes(t),onChange:a=>{a?(0,rn._$)(t,e,!1):((0,ax._N)(ah.M.GUILD_POWERUP_NOTIFICATION),(0,rn.hk)(t,e))}},t))})}),(0,r.jsxs)("div",{className:ru.uW,children:[(0,r.jsx)(p.E,{variant:"eyebrow",className:ru.wx,children:"Reset Powerup Rollback DCs"}),rd.map(e=>(0,r.jsx)(lA,{className:ru.z6,content:ah.M[e]},ah.M[e]))]}),(0,r.jsxs)("div",{className:ru.uW,children:[(0,r.jsx)(p.E,{variant:"eyebrow",className:ru.wx,children:"Send Powerups System Message"}),(0,r.jsx)(x.$,{variant:"primary",text:"Send System Message",onClick:()=>{rh(e)}})]}),(0,r.jsx)(x.$,{variant:"primary",text:"Reset GameServer ToS",onClick:()=>{(0,sL.Wp)(!1)}})]})}var rp=a(450510),rg=a(28673);function rv(e){let{hotspotLocation:t}=e,[a,n]=(0,d.yK)([rp.HP],()=>[rp.HP.hasHotspot(t,!0),rp.HP.getHotspotOverride(t)]);return(0,r.jsx)(j.l,{label:t,errorMessage:a?"Inactive":void 0,successMessage:a?"Active":void 0,value:n,options:[{id:"none",value:void 0,label:"No Override"},{id:"active",value:!0,label:"Force Active"},{id:"inactive",value:!1,label:"Force Inactive"}],onSelectionChange:e=>null!=e?(0,rp.Kl)(t,e):(0,rp.LF)(t),selectionMode:"single",fullWidth:!0})}function rj(){return(0,r.jsx)(g.Ip,{className:t$.nd,children:(0,r.jsx)(u.n,{label:"Hotspots",description:"All the 'hotspots' in app, and their current status. Use the select menu to override them on or off.",className:rg.IN,children:(0,r.jsx)(W.B,{gap:20,children:Object.keys(rp._2).sort((e,t)=>e.localeCompare(t)).map(e=>(0,r.jsx)(rv,{hotspotLocation:e},e))})})})}var rf=a(982253),rb=a(855522),ry=a(37646),rE=a(773669);function r_(){let e=(0,d.bG)([rE.default],()=>rE.default.locale),[t,a]=o.useState(),n=(0,rf.runtimeHashMessageKey)(t??""),l=o.useMemo(()=>na.t[n],[n]);return(0,r.jsxs)("div",{children:[(0,r.jsxs)(aY.Ay,{children:[(0,r.jsx)(aY.Ay.Icon,{icon:ry.U,tooltip:"Locale"}),(0,r.jsx)(aY.Ay.Title,{children:"Locale"})]}),(0,r.jsxs)(nP,{children:[(0,r.jsx)(nU,{name:"Active System",children:"@discord/intl"}),(0,r.jsx)(nU,{name:"App",children:e}),(0,r.jsx)(nU,{name:"System",children:na.systemLocale}),(0,r.jsx)(nU,{name:"@discord/intl",children:na.intl.currentLocale}),(0,r.jsx)(nU,{name:"common i18n",children:rb.A.getLocale()}),(0,r.jsx)(nU,{name:"Moment",children:np().locale()})]}),(0,r.jsxs)(aY.Ay,{children:[(0,r.jsx)(aY.Ay.Icon,{icon:ry.U,tooltip:"Messages"}),(0,r.jsx)(aY.Ay.Title,{children:"New System Messages"})]}),(0,r.jsx)(nP,{children:(0,r.jsx)(nU,{name:"Unique Rendered Main Messages",children:Object.keys(na.t).length})}),(0,r.jsx)("div",{style:{margin:16},children:(0,r.jsx)(f.k,{onChange:function(e){a(e)},name:"Message name",placeholder:"Find a message"})}),(0,r.jsxs)(nP,{children:[(0,r.jsx)(nU,{name:"Hashed key",children:n}),(0,r.jsx)(nU,{name:"Exists?",children:null!=l?"yes":"no"})]}),(0,r.jsx)(aq.A,{data:l?.(e)})]})}var rC=a(434404);function rS(){let{node:e}=(0,et.Ay)(rC.F,"");return(0,r.jsx)(g.Ip,{className:t$.nd,children:(0,r.jsx)("div",{style:{padding:"var(--space-8)"},children:(0,r.jsx)(ee.A,{node:e},e.key)})})}var rN=a(361158),rA=a(80556),rk=a(128846),rD=a(887476),rI=a(87404);function rT(){return(0,r.jsx)(g.Ip,{className:t$.nd,children:(0,r.jsxs)("div",{className:sS.l$,children:[(0,r.jsxs)("section",{className:sS.uW,children:[(0,r.jsx)(H.D,{variant:"heading-md/semibold",children:"Verification Layer"}),(0,r.jsx)("div",{className:sS.bd,children:(0,r.jsx)(x.$,{variant:"primary",text:"Open Verification Layer",onClick:function(){(0,rN.B8)(()=>(0,r.jsx)(rD.A,{}),{layerKey:rI._s,Layer:rA.Ay})}})})]}),(0,r.jsxs)("section",{className:sS.uW,children:[(0,r.jsx)(H.D,{variant:"heading-md/semibold",children:"Safety Flow"}),(0,r.jsx)("div",{className:sS.bd,children:(0,r.jsx)(x.$,{variant:"primary",text:"Open Safety Flow",onClick:function(){(0,rN.B8)(e=>{let{closeLayer:t}=e;return(0,r.jsx)(rk.A,{onClose:t})},{layerKey:rI._s,Layer:rA.Ay})}})})]}),(0,r.jsxs)("section",{className:sS.uW,children:[(0,r.jsx)(H.D,{variant:"heading-md/semibold",children:"Layer Controls"}),(0,r.jsx)("div",{className:sS.bd,children:(0,r.jsx)(x.$,{variant:"primary",text:"Close All Layers",onClick:function(){rN.xr.setState({fullScreenLayers:[]})}})})]})]})})}a(393431),a(532706),a(42231),a(232424),a(949626),a(767709),a(65162);var rR=a(687813),rO=a(604121);let rw={"discord_common/js/packages/tokens/tools/platforms/lottie/originals/native/Lottie_Navigation_Messages_Opt.lottie":()=>a.e("14127").then(a.t.bind(a,655671,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/native/Lottie_Navigation_Notifications_Opt.lottie":()=>a.e("5252").then(a.t.bind(a,323823,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/native/Lottie_Navigation_Servers_CombinedEE.lottie":()=>a.e("65154").then(a.t.bind(a,670649,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/native/Lottie_Navigation_Servers_Opt.lottie":()=>a.e("77248").then(a.t.bind(a,342787,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/native/Lottie_Navigation_You_Opt.lottie":()=>a.e("93401").then(a.t.bind(a,959328,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/native/Lottie_Requests_Messages.lottie":()=>a.e("48614").then(a.t.bind(a,713893,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/web/Activities.lottie":()=>a.e("32431").then(a.t.bind(a,857778,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/web/AppsIcon.lottie":()=>a.e("37415").then(a.t.bind(a,996858,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/web/Camera.lottie":()=>a.e("75913").then(a.t.bind(a,999344,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/web/Deafen.lottie":()=>a.e("83690").then(a.t.bind(a,433356,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/web/EndCall.lottie":()=>a.e("27847").then(a.t.bind(a,72922,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/web/GIF.lottie":()=>a.e("10505").then(a.t.bind(a,456309,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/web/Gift.lottie":()=>a.e("43734").then(a.t.bind(a,733813,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/web/Microphone.lottie":()=>a.e("26620").then(a.t.bind(a,890007,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/web/OrbsEarnSpend.lottie":()=>a.e("92568").then(a.t.bind(a,149707,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/web/OrbsEarnSpendLightTheme.lottie":()=>a.e("82715").then(a.t.bind(a,147734,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/web/Screenshare.lottie":()=>a.e("29721").then(a.t.bind(a,218048,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/web/Settings.lottie":()=>a.e("94483").then(a.t.bind(a,155806,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/web/Soundboard.lottie":()=>a.e("50115").then(a.t.bind(a,535662,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/web/Sticker.lottie":()=>a.e("97473").then(a.t.bind(a,956248,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/web/Waveform.lottie":()=>a.e("65373").then(a.t.bind(a,914028,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/native/gems/Lottie_NitroGems_Badge01.lottie":()=>a.e("75199").then(a.t.bind(a,904066,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/native/gems/Lottie_NitroGems_Badge02.lottie":()=>a.e("33900").then(a.t.bind(a,185319,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/native/gems/Lottie_NitroGems_Badge03.lottie":()=>a.e("65405").then(a.t.bind(a,743372,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/native/gems/Lottie_NitroGems_Badge06.lottie":()=>a.e("27648").then(a.t.bind(a,195011,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/native/gems/Lottie_NitroGems_Badge09.lottie":()=>a.e("29095").then(a.t.bind(a,619578,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/native/gems/Lottie_NitroGems_Badge12.lottie":()=>a.e("94131").then(a.t.bind(a,676574,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/native/gems/Lottie_NitroGems_Badge15.lottie":()=>a.e("43023").then(a.t.bind(a,384407,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/native/gems/Lottie_NitroGems_Badge18.lottie":()=>a.e("11817").then(a.t.bind(a,110320,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/native/gems/Lottie_NitroGems_Badge24.lottie":()=>a.e("84996").then(a.t.bind(a,248476,17)),"discord_common/js/shared/animations/app/gifts/seasonal/box/box-action.lottiejson":()=>a.e("19534").then(a.t.bind(a,87037,19)),"discord_common/js/shared/animations/app/gifts/seasonal/box/box-idle.lottiejson":()=>a.e("12250").then(a.t.bind(a,553998,19)),"discord_common/js/shared/animations/app/gifts/seasonal/box/box-loop.lottiejson":()=>a.e("58526").then(a.t.bind(a,138157,19)),"discord_common/js/shared/animations/app/gifts/seasonal/cake/cake-action.lottiejson":()=>a.e("64376").then(a.t.bind(a,37259,19)),"discord_common/js/shared/animations/app/gifts/seasonal/cake/cake-idle.lottiejson":()=>a.e("30800").then(a.t.bind(a,683891,19)),"discord_common/js/shared/animations/app/gifts/seasonal/cake/cake-loop.lottiejson":()=>a.e("52436").then(a.t.bind(a,45887,19)),"discord_common/js/shared/animations/app/gifts/seasonal/chest/chest-action.lottiejson":()=>a.e("3086").then(a.t.bind(a,118301,19)),"discord_common/js/shared/animations/app/gifts/seasonal/chest/chest-idle.lottiejson":()=>a.e("37690").then(a.t.bind(a,733057,19)),"discord_common/js/shared/animations/app/gifts/seasonal/chest/chest-loop.lottiejson":()=>a.e("82078").then(a.t.bind(a,553101,19)),"discord_common/js/shared/animations/app/gifts/seasonal/coffee/coffee-action.lottiejson":()=>a.e("51992").then(a.t.bind(a,558251,19)),"discord_common/js/shared/animations/app/gifts/seasonal/coffee/coffee-idle.lottiejson":()=>a.e("64400").then(a.t.bind(a,94995,19)),"discord_common/js/shared/animations/app/gifts/seasonal/coffee/coffee-loop.lottiejson":()=>a.e("39476").then(a.t.bind(a,367327,19)),"discord_common/js/shared/animations/app/gifts/seasonal/marketing/gift_icon/seasonal-gifting-wumpus-action.lottiejson":()=>a.e("27568").then(a.t.bind(a,579571,19)),"discord_common/js/shared/animations/app/gifts/seasonal/marketing/gift_icon/seasonal-gifting-wumpus-loop.lottiejson":()=>a.e("25676").then(a.t.bind(a,322151,19)),"discord_common/js/shared/animations/app/gifts/seasonal/marketing/seasonal_wumpus/seasonal-wumpus-action.lottiejson":()=>a.e("10803").then(a.t.bind(a,805489,19)),"discord_common/js/shared/animations/app/gifts/seasonal/marketing/seasonal_wumpus/seasonal-wumpus-idle.lottiejson":()=>a.e("10191").then(a.t.bind(a,837074,19)),"discord_common/js/shared/animations/app/gifts/seasonal/marketing/seasonal_wumpus/seasonal-wumpus-loop.lottiejson":()=>a.e("61223").then(a.t.bind(a,547450,19)),"discord_common/js/shared/animations/app/gifts/seasonal/nitroween/halloween-action.lottiejson":()=>a.e("69842").then(a.t.bind(a,809865,19)),"discord_common/js/shared/animations/app/gifts/seasonal/nitroween/halloween-idle.lottiejson":()=>a.e("99166").then(a.t.bind(a,334829,19)),"discord_common/js/shared/animations/app/gifts/standard/box/box-action.lottiejson":()=>a.e("98287").then(a.t.bind(a,380082,19)),"discord_common/js/shared/animations/app/gifts/standard/box/box-idle.lottiejson":()=>a.e("12427").then(a.t.bind(a,676614,19)),"discord_common/js/shared/animations/app/gifts/standard/box/box-loop.lottiejson":()=>a.e("31939").then(a.t.bind(a,900110,19)),"discord_common/js/shared/animations/app/gifts/standard/cake/cake-action.lottiejson":()=>a.e("71305").then(a.t.bind(a,629456,19)),"discord_common/js/shared/animations/app/gifts/standard/cake/cake-idle.lottiejson":()=>a.e("70625").then(a.t.bind(a,254424,19)),"discord_common/js/shared/animations/app/gifts/standard/cake/cake-loop.lottiejson":()=>a.e("33449").then(a.t.bind(a,690576,19)),"discord_common/js/shared/animations/app/gifts/standard/chest/chest-action.lottiejson":()=>a.e("46791").then(a.t.bind(a,690842,19)),"discord_common/js/shared/animations/app/gifts/standard/chest/chest-idle.lottiejson":()=>a.e("28115").then(a.t.bind(a,755678,19)),"discord_common/js/shared/animations/app/gifts/standard/chest/chest-loop.lottiejson":()=>a.e("31272").then(a.t.bind(a,778422,19)),"discord_common/js/shared/animations/app/gifts/standard/coffee/coffee-action.lottiejson":()=>a.e("58009").then(a.t.bind(a,433504,19)),"discord_common/js/shared/animations/app/gifts/standard/coffee/coffee-idle.lottiejson":()=>a.e("2897").then(a.t.bind(a,976584,19)),"discord_common/js/shared/animations/app/gifts/standard/coffee/coffee-loop.lottiejson":()=>a.e("52793").then(a.t.bind(a,858464,19)),"discord_app/images/burst_reactions/BurstReaction_Anime_v01_Lottie.lottiejson":()=>a.e("74149").then(a.t.bind(a,965892,19)),"discord_app/images/burst_reactions/BurstReaction_Arcade_v01.lottiejson":()=>a.e("17087").then(a.t.bind(a,44194,19)),"discord_app/images/burst_reactions/BurstReaction_BlackHoles_v01.lottiejson":()=>a.e("4289").then(a.t.bind(a,141208,19)),"discord_app/images/burst_reactions/BurstReaction_BlastOff_v04.lottiejson":()=>a.e("77339").then(a.t.bind(a,420054,19)),"discord_app/images/burst_reactions/BurstReaction_Crystal_v04.lottiejson":()=>a.e("66414").then(a.t.bind(a,33565,19)),"discord_app/images/burst_reactions/BurstReaction_Fireworks_v03.lottiejson":()=>a.e("31165").then(a.t.bind(a,414956,19)),"discord_app/images/burst_reactions/BurstReaction_Fusion_v03.lottiejson":()=>a.e("58541").then(a.t.bind(a,221340,19)),"discord_app/images/burst_reactions/BurstReaction_Pop_v04.lottiejson":()=>a.e("10169").then(a.t.bind(a,710208,19)),"discord_app/images/burst_reactions/BurstReaction_PowerUp_v05.lottiejson":()=>a.e("76601").then(a.t.bind(a,333984,19)),"discord_app/images/burst_reactions/BurstReaction_Puzzle_v01_Lottie.lottiejson":()=>a.e("84163").then(a.t.bind(a,211342,19)),"discord_app/images/burst_reactions/BurstReaction_Spotlight_v01_Lottie.lottiejson":()=>a.e("52029").then(a.t.bind(a,714316,19)),"discord_app/images/burst_reactions/BurstReaction_StarBlast_v03.lottiejson":()=>a.e("23997").then(a.t.bind(a,851404,19)),"discord_app/images/burst_reactions/BurstReaction_Tube_v01_Lottie.lottiejson":()=>a.e("67133").then(a.t.bind(a,821644,19)),"discord_app/images/burst_reactions/BurstReaction_UFO_v01_Lottie.lottiejson":()=>a.e("84765").then(a.t.bind(a,51244,19)),"discord_app/images/burst_reactions/BurstReaction_Whirlwind_v01_Lottie.lottiejson":()=>a.e("35583").then(a.t.bind(a,668994,19)),"discord_app/images/burst_reactions/mobile/fullscreen/SuperReactions_Mobile_Send_Spotlight_v1.lottiejson":()=>a.e("47862").then(a.t.bind(a,911573,19)),"discord_app/images/burst_reactions/mobile/SuperReactions_Mobile_Anime_v1.lottiejson":()=>a.e("46711").then(a.t.bind(a,23434,19)),"discord_app/images/burst_reactions/mobile/SuperReactions_Mobile_Arcade_v1.lottiejson":()=>a.e("51153").then(a.t.bind(a,743496,19)),"discord_app/images/burst_reactions/mobile/SuperReactions_Mobile_BlackHoles_v1.lottiejson":()=>a.e("32803").then(a.t.bind(a,252462,19)),"discord_app/images/burst_reactions/mobile/SuperReactions_Mobile_BlastOff_v1.lottiejson":()=>a.e("19842").then(a.t.bind(a,341529,19)),"discord_app/images/burst_reactions/mobile/SuperReactions_Mobile_Crystal_v1.lottiejson":()=>a.e("85529").then(a.t.bind(a,762464,19)),"discord_app/images/burst_reactions/mobile/SuperReactions_Mobile_Fireworks_v1.lottiejson":()=>a.e("97197").then(a.t.bind(a,47036,19)),"discord_app/images/burst_reactions/mobile/SuperReactions_Mobile_Fusion_v1.lottiejson":()=>a.e("92933").then(a.t.bind(a,279172,19)),"discord_app/images/burst_reactions/mobile/SuperReactions_Mobile_Pop_v1.lottiejson":()=>a.e("5560").then(a.t.bind(a,824888,19)),"discord_app/images/burst_reactions/mobile/SuperReactions_Mobile_PowerUp_v1.lottiejson":()=>a.e("63011").then(a.t.bind(a,432302,19)),"discord_app/images/burst_reactions/mobile/SuperReactions_Mobile_Puzzle_v1.lottiejson":()=>a.e("69845").then(a.t.bind(a,854420,19)),"discord_app/images/burst_reactions/mobile/SuperReactions_Mobile_Spotlight_v1.lottiejson":()=>a.e("88607").then(a.t.bind(a,997730,19)),"discord_app/images/burst_reactions/mobile/SuperReactions_Mobile_StarBlast_v2.lottiejson":()=>a.e("74493").then(a.t.bind(a,281073,19)),"discord_app/images/burst_reactions/mobile/SuperReactions_Mobile_Tube_v1.lottiejson":()=>a.e("94147").then(a.t.bind(a,192718,19)),"discord_app/images/burst_reactions/mobile/SuperReactions_Mobile_UFO_v2.lottiejson":()=>a.e("84992").then(a.t.bind(a,513667,19)),"discord_app/images/burst_reactions/mobile/SuperReactions_Mobile_Whirlwind_v1.lottiejson":()=>a.e("49693").then(a.t.bind(a,754124,19)),"discord_app/modules/guild_member_verification/images/islandMiddleAnimation.lottiejson":()=>a.e("44678").then(a.t.bind(a,144759,19)),"discord_app/modules/premium/web/animations/guild_sidebar_premium_entrypoint_dt.json":()=>a.e("15048").then(a.t.bind(a,366043,19)),"discord_app/modules/premium/web/animations/guild_sidebar_premium_entrypoint_lt.json":()=>a.e("12512").then(a.t.bind(a,789091,19)),"discord_common/js/shared/animations/app/activities/AppsIconWordlePromo.lottiejson":()=>a.e("73550").then(a.t.bind(a,527613,19)),"discord_common/js/shared/animations/app/nearby/nearby.lottiejson":()=>a.e("93780").then(a.t.bind(a,957439,19)),"discord_common/js/shared/animations/app/premium_guild_subscribe/dark.lottiejson":()=>a.e("45470").then(a.t.bind(a,622637,19)),"discord_common/js/shared/animations/app/premium_guild_subscribe/light.lottiejson":()=>a.e("23478").then(a.t.bind(a,262037,19)),"discord_common/js/shared/animations/app/premium_guild_subscription_system_message_easter_egg/index.lottiejson":()=>a.e("98150").then(a.t.bind(a,633343,19)),"discord_common/js/shared/animations/app/premium_marketing_surface/hd_streaming.lottiejson":()=>a.e("20795").then(a.t.bind(a,551574,19)),"discord_common/js/shared/animations/app/premium-payment-tier-2/index.lottiejson":()=>a.e("69421").then(a.t.bind(a,548375,19)),"discord_app/images/burst_reactions/BurstReaction_Bubbles_v03.lottiejson":()=>a.e("91770").then(a.t.bind(a,95553,19)),"discord_app/images/burst_reactions/BurstReaction_Portal_v03.lottiejson":()=>a.e("96515").then(a.t.bind(a,178862,19)),"discord_app/images/burst_reactions/BurstReaction_Slime_v02.lottiejson":()=>a.e("9302").then(a.t.bind(a,16341,19)),"discord_app/images/burst_reactions/mobile/fullscreen/SuperReactions_Mobile_Send_Slime_v1.lottiejson":()=>a.e("47554").then(a.t.bind(a,748761,19)),"discord_app/images/burst_reactions/mobile/SuperReactions_Mobile_Bubbles_v2.lottiejson":()=>a.e("7739").then(a.t.bind(a,106870,19)),"discord_app/images/burst_reactions/mobile/SuperReactions_Mobile_Portal_v1.lottiejson":()=>a.e("79067").then(a.t.bind(a,458486,19)),"discord_app/images/burst_reactions/mobile/SuperReactions_Mobile_Slime_v2.lottiejson":()=>a.e("24584").then(a.t.bind(a,388059,19)),"discord_app/modules/app_launcher/native/images/onboarding_glow.lottiejson":()=>a.e("7985").then(a.t.bind(a,9640,19)),"discord_app/modules/global_discovery_apps/discovering-dabatouille-animation.lottiejson":()=>a.e("95947").then(a.t.bind(a,604902,19)),"discord_app/modules/guild_boosting/animations/animated_guild_icon.lottiejson":()=>a.e("24645").then(a.t.bind(a,624420,19)),"discord_app/modules/guild_member_verification/images/wavingHandLottieAnimation.lottiejson":()=>a.e("15423").then(a.t.bind(a,155147,19)),"discord_app/modules/guild_onboarding/native/animations/landing.lottiejson":()=>a.e("24093").then(a.t.bind(a,280780,19)),"discord_app/modules/guild_onboarding/web/animations/balloon-dog.lottiejson":()=>a.e("25961").then(a.t.bind(a,739408,19)),"discord_app/modules/guild_onboarding/web/animations/bubble-island-02.lottiejson":()=>a.e("87356").then(a.t.bind(a,194199,19)),"discord_app/modules/guild_onboarding/web/animations/grilling-island-02.lottiejson":()=>a.e("56026").then(a.t.bind(a,113473,19)),"discord_app/modules/guild_onboarding/web/animations/main-island-02.lottiejson":()=>a.e("16301").then(a.t.bind(a,694268,19)),"discord_app/modules/guild_onboarding/web/animations/waffle-island-02.lottiejson":()=>a.e("22191").then(a.t.bind(a,896018,19)),"discord_app/modules/poggermode/images/enable_animation.lottiejson":()=>a.e("4660").then(a.t.bind(a,662336,19)),"discord_app/modules/premium/powerups/web/images/server_boost_highlight.json":()=>a.e("67807").then(a.t.bind(a,217762,19)),"discord_app/modules/quests/images/confetti.lottiejson":()=>a.e("40119").then(a.t.bind(a,718698,19)),"discord_app/modules/quests/web/images/quest_bar_background.json":()=>a.e("37316").then(a.t.bind(a,599279,19)),"discord_app/modules/quests/web/images/quest_bar_sparkle.json":()=>a.e("97536").then(a.t.bind(a,478979,19)),"discord_app/modules/self_mod/inappropriate_conversation/images/vibing_wumpus.lottiejson":()=>a.e("14823").then(a.t.bind(a,718074,19)),"discord_common/js/shared/animations/app/everyone_popout/dark.lottiejson":()=>a.e("80467").then(a.t.bind(a,661022,19)),"discord_common/js/shared/animations/app/everyone_popout/light.lottiejson":()=>a.e("92705").then(a.t.bind(a,111992,19)),"discord_common/js/shared/animations/app/gifts/seasonal/marketing/coachmark/seasonal-gifting-coachmark.lottiejson":()=>a.e("61250").then(a.t.bind(a,762361,19)),"discord_common/js/shared/animations/app/playstation/playstation_connecting.lottiejson":()=>a.e("35066").then(a.t.bind(a,844512,19)),"discord_common/js/shared/animations/app/premium_marketing_surface/emoji.lottiejson":()=>a.e("17124").then(a.t.bind(a,616175,19)),"discord_common/js/shared/animations/app/premium_marketing_surface/interstitial_wheel_dark.lottiejson":()=>a.e("94675").then(a.t.bind(a,735678,19)),"discord_common/js/shared/animations/app/premium_marketing_surface/interstitial_wheel_light.lottiejson":()=>a.e("78465").then(a.t.bind(a,247704,19)),"discord_common/js/shared/animations/app/premium_marketing_surface/profile_customization.lottiejson":()=>a.e("62807").then(a.t.bind(a,202282,19)),"discord_common/js/shared/animations/app/premium_marketing_surface/unlock.lottiejson":()=>a.e("31838").then(a.t.bind(a,650125,19)),"discord_common/js/shared/animations/app/premium_marketing/index.lottiejson":()=>a.e("6954").then(a.t.bind(a,964529,19)),"discord_common/js/shared/animations/app/premium_payment_guild/index.lottiejson":()=>a.e("45870").then(a.t.bind(a,738503,19)),"discord_common/js/shared/animations/app/premium-activated-tier-1/premium-activated-tier-1.lottiejson":()=>a.e("5642").then(a.t.bind(a,242993,19)),"discord_common/js/shared/animations/app/premium-payment-tier-0/index.lottiejson":()=>a.e("78503").then(a.t.bind(a,635489,19)),"discord_common/js/shared/animations/app/premium-payment-tier-1/index.lottiejson":()=>a.e("19898").then(a.t.bind(a,262546,19)),"discord_common/js/shared/animations/app/xbox/voice_connect.lottiejson":()=>a.e("40348").then(a.t.bind(a,971799,19)),"discord_common/js/shared/animations/app/xbox/xbox_connecting.lottiejson":()=>a.e("76121").then(a.t.bind(a,709376,19))};function rM(e){let{default:t}=e;return fetch(t).then(e=>e.arrayBuffer()).then(e=>new Promise((t,a)=>{let n=new Uint8Array(e);rR.$1(n,(e,n)=>{null!=e&&a(e);let l=Object.keys(n).reduce((e,t)=>({...e,[t]:JSON.parse(rR.he(n[t]))}),{}),s=l["manifest.json"];t(l[`animations/${s.animations[0].id}.json`])})}))}function rL(){let[e,t]=o.useState(void 0),[a,n]=o.useState(400),[l,s]=o.useState(400);return(0,r.jsx)("div",{style:{margin:24},children:(0,r.jsxs)(W.B,{gap:24,children:[(0,r.jsx)(aa.Z,{options:Object.keys(rw).map(e=>({id:e,label:e,value:e})),value:e,onSelectionChange:t,selectionMode:"single"}),(0,r.jsxs)(W.B,{gap:8,direction:"horizontal",children:[(0,r.jsx)(f.k,{value:a.toString(),onChange:e=>n(Number(e)),label:"Width"}),(0,r.jsx)(f.k,{value:l.toString(),onChange:e=>s(Number(e)),label:"Height"})]}),(0,r.jsx)(x.$,{size:"sm",disabled:null==e,onClick:async()=>{if(null==e)return;let t=rw[e],a=new Blob([JSON.stringify(e.endsWith(".lottie")?await t().then(rM).then(eJ().cloneDeep):await t().then(e=>eJ().cloneDeep(e.default)))],{type:"application/json"}),n=URL.createObjectURL(a),l=document.createElement("a");l.href=n,l.download=`${e.split("/").pop()}.json`,document.body.appendChild(l),l.click(),document.body.removeChild(l),URL.revokeObjectURL(n)},text:"Download"}),null!=e&&(0,r.jsx)("div",{style:{width:a,height:l},children:(0,r.jsx)(rO.a,{importData:()=>{let t=rw[e];return e.endsWith(".lottie")?t().then(rM).then(eJ().cloneDeep):t().then(e=>eJ().cloneDeep(e.default))}},e)})]})})}var rP=a(442433),rU=a(395671);let rG={ClipsContextMenu:async()=>{let{default:e}=await a.e("44751").then(a.bind(a,575538));return t=>(0,r.jsx)(e,{...t})},ActivityPopoutHeaderOverflowMenu:async()=>{let{default:e}=await a.e("32986").then(a.bind(a,728033)),t=new rU.kJ({id:"123456789",name:"Test Activity",icon:null,description:"A test activity for devtools",type:1,coverImage:void 0,primarySkuId:void 0,bot:void 0,splash:void 0,thirdPartySkus:[],isMonetized:!1,isVerified:!1,roleConnectionsVerificationUrl:void 0,parentId:void 0,connectionEntrypointUrl:void 0});return()=>(0,r.jsx)(e,{application:t,channelId:"987654321",onClose:rP.Z_})},GuildChannelListContextMenu:async()=>{let{default:e}=await Promise.all([a.e("9004"),a.e("19690"),a.e("22941"),a.e("10758")]).then(a.bind(a,455557)),t=Object.values(a9.A.getGuilds())[0];return null==t?()=>null:a=>(0,r.jsx)(e,{...a,guild:t})},GuildContextMenu:async()=>{let{default:e}=await Promise.all([a.e("38108"),a.e("35285"),a.e("40351"),a.e("48180"),a.e("67792"),a.e("14767"),a.e("15214"),a.e("76684"),a.e("85631"),a.e("75030"),a.e("8248"),a.e("37175"),a.e("26738"),a.e("41295"),a.e("46148"),a.e("79414"),a.e("91109"),a.e("61439"),a.e("39653"),a.e("39013"),a.e("99265"),a.e("45827"),a.e("96393"),a.e("16123"),a.e("73193"),a.e("78250"),a.e("42529"),a.e("31464"),a.e("3263"),a.e("54964"),a.e("51962"),a.e("35459"),a.e("2861"),a.e("63933"),a.e("42083"),a.e("20182"),a.e("47426"),a.e("202"),a.e("49273"),a.e("83647"),a.e("87085"),a.e("72118"),a.e("65831"),a.e("59729"),a.e("3240"),a.e("72767"),a.e("38647"),a.e("102"),a.e("25473"),a.e("48149"),a.e("46420"),a.e("19834"),a.e("51872"),a.e("27574"),a.e("21149"),a.e("99561"),a.e("49817"),a.e("67578"),a.e("45850"),a.e("21398"),a.e("50482"),a.e("49681"),a.e("69047"),a.e("96382"),a.e("71657"),a.e("22218"),a.e("9004"),a.e("49145"),a.e("30997"),a.e("28136"),a.e("16084"),a.e("43116"),a.e("73669"),a.e("36624"),a.e("66147"),a.e("28235"),a.e("22547"),a.e("61058"),a.e("50342"),a.e("33097"),a.e("10262"),a.e("46313"),a.e("43233"),a.e("63726"),a.e("71329"),a.e("56373"),a.e("83827"),a.e("42749"),a.e("56026"),a.e("16301"),a.e("22191"),a.e("25961"),a.e("74333"),a.e("8364"),a.e("99108"),a.e("52823"),a.e("56967"),a.e("66913"),a.e("83518"),a.e("71719"),a.e("19690"),a.e("93767"),a.e("13848"),a.e("39214"),a.e("88307"),a.e("14878"),a.e("76376"),a.e("26508"),a.e("61347"),a.e("91643"),a.e("47011"),a.e("42935"),a.e("73091"),a.e("69178"),a.e("86692"),a.e("52695"),a.e("16373"),a.e("24484"),a.e("44943"),a.e("32347"),a.e("8458"),a.e("11810"),a.e("91977"),a.e("90152"),a.e("46570"),a.e("87973"),a.e("74337"),a.e("57197"),a.e("14863"),a.e("84951"),a.e("60165"),a.e("12390"),a.e("71167"),a.e("13446"),a.e("61309"),a.e("94529"),a.e("95210"),a.e("98415"),a.e("21300"),a.e("66016"),a.e("53584"),a.e("18489"),a.e("17699"),a.e("57032"),a.e("72238"),a.e("22941"),a.e("94832"),a.e("37038"),a.e("26386"),a.e("65338"),a.e("52191"),a.e("14656"),a.e("39855"),a.e("14530"),a.e("45291"),a.e("32607"),a.e("65011")]).then(a.bind(a,860417)),t=Object.values(a9.A.getGuilds())[0];return null==t?()=>null:a=>(0,r.jsx)(e,{...a,guild:t})},GuildFolderContextMenu:async()=>{let{default:e}=await a.e("32857").then(a.bind(a,842112));return t=>(0,r.jsx)(e,{...t,folderId:1,folderColor:void 0,folderName:void 0,unread:!1})},DeveloperContextMenu:async()=>{let{default:e}=await a.e("15687").then(a.bind(a,646938));return t=>(0,r.jsx)(e,{...t,id:"123456789",label:"Copy Test ID"})},UserSettingsMenu:async()=>{let{default:e}=await Promise.all([a.e("49857"),a.e("26132"),a.e("44491")]).then(a.bind(a,907206));return t=>(0,r.jsx)(e,{...t,onClose:rP.Z_})},ExpressionPickerContextMenu:async()=>{let{default:e}=await a.e("46132").then(a.bind(a,233503));return t=>(0,r.jsx)(e,{...t})},ForumTagContextMenu:async()=>{let{default:e}=await a.e("32612").then(a.bind(a,960015)),t={id:"123456789",name:"Test Forum Tag"};return()=>(0,r.jsx)(e,{tag:t})},GuildRoleConnectionsModalContextMenu:async()=>{let{default:e}=await a.e("68001").then(a.bind(a,699896));return t=>(0,r.jsx)(e,{...t,roleId:"123456789",onLeaveRole:()=>{console.log("Leave role clicked"),(0,rP.Z_)()}})},StaffOnlyEntryDebugMenu:async()=>{let{default:e}=await Promise.all([a.e("86456"),a.e("89346")]).then(a.bind(a,949881)),{ContentInventoryEntryType:t}=await Promise.resolve().then(a.bind(a,681154)),{ContentInventoryAuthorType:n}=await Promise.resolve().then(a.bind(a,6161)),l=en.default.getCurrentUser(),s={id:"mock-entry-123",author_id:l?.id??"123456789",author_type:n.USER,content_type:t.PLAYED_GAME,participants:[],traits:[],extra:{type:"played_game_extra",game_name:"Test Game",application_id:"123456789"}};return()=>(0,r.jsx)(e,{entry:s,requestId:"mock-request-123"})},AddQuestionsContextMenu:async()=>{let{AddQuestionsContextMenu:e}=await Promise.all([a.e("49817"),a.e("45827"),a.e("11810"),a.e("14656")]).then(a.bind(a,892921)),t=Object.values(a9.A.getGuilds())[0];return null==t?()=>null:a=>(0,r.jsx)(e,{...a,addFormField:e=>{console.log("Add form field:",e),(0,rP.Z_)()},guild:t,allowTerms:!0})},ChannelListThreadContextMenu:async()=>{let{default:e}=await Promise.all([a.e("26132"),a.e("38730"),a.e("47502"),a.e("43266"),a.e("12255"),a.e("40959"),a.e("65200"),a.e("85802"),a.e("26250"),a.e("51212"),a.e("84615")]).then(a.bind(a,612826)),t=a9.A.getGuilds(),n=null;for(let e of Object.values(t)){for(let t of Object.values(aS.A.getMutableGuildChannelsForGuild(e.id))){let e=aS.A.getAllThreadsForParent(t.id);if(e.length>0){n=e[0];break}}if(null!=n)break}return null==n?(console.log("No thread channel found for ChannelListThreadContextMenu"),()=>null):t=>(0,r.jsx)(e,{...t,channel:n})},MembersTableSortContextMenu:async()=>{let{default:e}=await a.e("73091").then(a.bind(a,779662)),t=Object.values(a9.A.getGuilds())[0];return null==t?()=>null:()=>(0,r.jsx)(e,{guildId:t.id,onClose:rP.Z_})},MembersTableJoinTypeContextMenu:async()=>{let{default:e}=await Promise.all([a.e("48149"),a.e("71719"),a.e("14878"),a.e("66016")]).then(a.bind(a,316173)),t=Object.values(a9.A.getGuilds())[0];return null==t?()=>null:()=>(0,r.jsx)(e,{guildId:t.id,onClose:rP.Z_})}},rF={GuildShopSortOptions:o.lazy(async()=>{let{default:e}=await Promise.all([a.e("83518"),a.e("55197"),a.e("50974")]).then(a.bind(a,324269)),{default:t}=await a.e("55197").then(a.bind(a,558060));return{default:()=>(0,r.jsx)(t,{defaultSortOption:void 0,children:(0,r.jsx)(e,{})})}})};function rB(){let e=o.useMemo(()=>Object.keys(rG).map(e=>({label:e,value:e,id:e})).sort((e,t)=>e.label.localeCompare(t.label)),[]),t=o.useMemo(()=>Object.keys(rF).map(e=>({label:e,value:e,id:e})).sort((e,t)=>e.label.localeCompare(t.label)),[]),[a,n]=o.useState(null),[l,s]=o.useState(null),i=o.useCallback(e=>{null!=a&&(0,rP.L3)(e,rG[a])},[a]),d=null!=l?rF[l]:null;return(0,r.jsx)(g.Ip,{className:t$.nd,children:(0,r.jsxs)(W.B,{className:sS.l$,gap:16,children:[(0,r.jsxs)(W.B,{gap:8,children:[(0,r.jsx)(p.E,{variant:"eyebrow",children:"Context Menus"}),(0,r.jsx)(p.E,{variant:"text-sm/normal",color:"text-muted",children:"Select a menu and click Open to trigger it as a context menu at the button position."})]}),(0,r.jsxs)(W.B,{direction:"horizontal",gap:8,align:"end",children:[(0,r.jsx)(aa.Z,{label:"Open a Context Menu",placeholder:"Select a menu",options:e,value:a,onSelectionChange:n,selectionMode:"single"}),(0,r.jsx)(x.$,{variant:"primary",text:"Open",disabled:null==a,onClick:i})]}),(0,r.jsxs)(W.B,{gap:8,children:[(0,r.jsx)(p.E,{variant:"eyebrow",children:"Popout Menus"}),(0,r.jsx)(p.E,{variant:"text-sm/normal",color:"text-muted",children:"Select a popout menu to render it. Click the rendered button to open the popout."})]}),(0,r.jsx)(W.B,{direction:"horizontal",gap:8,align:"end",children:(0,r.jsx)(aa.Z,{label:"Render a Popout Menu",placeholder:"Select a popout",options:t,value:l,onSelectionChange:s,selectionMode:"single"})}),null!=d&&(0,r.jsx)(o.Suspense,{fallback:(0,r.jsx)(p.E,{variant:"text-sm/normal",color:"text-muted",children:"Loading..."}),children:(0,r.jsx)(d,{})})]})})}var r$=a(253506),rV=a(665260),rW=a(97808),rz=a(778712),rH=a(308528),rK=a(148494),rY=a(571694),rq=a(963852),rJ=a(704844),rQ=a(309010),rX=a(645959),rZ=a(716371),r0=a(792049);let r1=[{id:"USER_JOIN",value:er.lAJ.USER_JOIN,label:"User Join"},{id:"CHANNEL_PINNED_MESSAGE",value:er.lAJ.CHANNEL_PINNED_MESSAGE,label:"Channel Pinned Message"},{id:"GUILD_BOOST",value:er.lAJ.GUILD_BOOST,label:"Guild Boost"},{id:"GUILD_BOOST_TIER_1",value:er.lAJ.GUILD_BOOST_TIER_1,label:"Guild Boost Tier 1"},{id:"GUILD_BOOST_TIER_2",value:er.lAJ.GUILD_BOOST_TIER_2,label:"Guild Boost Tier 2"},{id:"GUILD_BOOST_TIER_3",value:er.lAJ.GUILD_BOOST_TIER_3,label:"Guild Boost Tier 3"},{id:"THREAD_CREATED",value:er.lAJ.THREAD_CREATED,label:"Thread Created"},{id:"CHANNEL_FOLLOW_ADD",value:er.lAJ.CHANNEL_FOLLOW_ADD,label:"Channel Follow Add"},{id:"STAGE_START",value:er.lAJ.STAGE_START,label:"Stage Start"},{id:"STAGE_END",value:er.lAJ.STAGE_END,label:"Stage End"},{id:"STAGE_SPEAKER",value:er.lAJ.STAGE_SPEAKER,label:"Stage Speaker"},{id:"STAGE_RAISE_HAND",value:er.lAJ.STAGE_RAISE_HAND,label:"Stage Raise Hand"},{id:"STAGE_TOPIC",value:er.lAJ.STAGE_TOPIC,label:"Stage Topic"},{id:"VOICE_SESSION",value:er.lAJ.VOICE_SESSION,label:"Voice Session"},{id:"FRIEND_REQUEST_ACCEPTED",value:er.lAJ.FRIEND_REQUEST_ACCEPTED,label:"Friend Request Accepted"},{id:"GUILD_DISCOVERY_DISQUALIFIED",value:er.lAJ.GUILD_DISCOVERY_DISQUALIFIED,label:"Discovery Disqualified"},{id:"GUILD_DISCOVERY_REQUALIFIED",value:er.lAJ.GUILD_DISCOVERY_REQUALIFIED,label:"Discovery Requalified"},{id:"GUILD_DISCOVERY_GRACE_PERIOD_INITIAL_WARNING",value:er.lAJ.GUILD_DISCOVERY_GRACE_PERIOD_INITIAL_WARNING,label:"Discovery Grace Initial Warning"},{id:"GUILD_DISCOVERY_GRACE_PERIOD_FINAL_WARNING",value:er.lAJ.GUILD_DISCOVERY_GRACE_PERIOD_FINAL_WARNING,label:"Discovery Grace Final Warning"},{id:"RECIPIENT_ADD",value:er.lAJ.RECIPIENT_ADD,label:"Recipient Add"},{id:"RECIPIENT_REMOVE",value:er.lAJ.RECIPIENT_REMOVE,label:"Recipient Remove"},{id:"CALL",value:er.lAJ.CALL,label:"Call"}];function r2(){let[e,t]=o.useState(er.lAJ.USER_JOIN),a=(0,d.bG)([rQ.Ay],()=>rQ.Ay.getChannelId(),[]),n=o.useCallback(()=>{if(null==a||null==e)return;let t=(0,rq.Ay)({channelId:a,content:"",type:e,state:er.cmJ.SENT});rK.A.receiveMessage(a,t,!1)},[a,e]),l=o.useCallback(()=>{if(null!=a)for(let{value:e}of r1){let t=(0,rq.Ay)({channelId:a,content:"",type:e,state:er.cmJ.SENT});rK.A.receiveMessage(a,t,!1)}},[a]);return(0,r.jsxs)("div",{className:r0.gs,children:[(0,r.jsx)(aa.Z,{label:"Inject System Message",selectionMode:"single",options:r1,placeholder:"Select type",value:e,onSelectionChange:t}),(0,r.jsx)(x.$,{variant:"primary",size:"sm",text:"Inject",onClick:n,disabled:null==a||null==e}),(0,r.jsx)(x.$,{variant:"secondary",size:"sm",text:"Inject All",onClick:l,disabled:null==a})]})}function r3(){let e=(0,d.yK)([rX.A],()=>rX.A.getSortedChannels()[1]),[t,a]=o.useState(e.length>0?e[0].channelId:void 0),{selectedChannel:n,options:l}=(0,d.cf)([aS.A,en.default,aN.A],()=>({selectedChannel:aS.A.getChannel(t),options:e.map(e=>{let t=aS.A.getChannel(e.channelId);return{id:e.channelId,value:e.channelId,label:null!=t?(0,aC.m1)(t,en.default,aN.A):e.channelId,leading:null!=t?(0,r.jsx)(rW.eu,{src:(0,rY.Y)(t),"aria-hidden":!0,size:rz._3.SIZE_16}):void 0}})})),s=o.useCallback(()=>{if(null==n||!n.isPrivate())return;let e=(0,rV.PQ)(n.recipientFlags??0,r$.o.DISMISSED_IN_GAME_MESSAGE_NUX);rJ.A.updatePrivateChannelRecipientFlags(n.id,e)},[n]),i=!!n?.isPrivate()&&(0,rV.Lt)(n.recipientFlags??0,r$.o.DISMISSED_IN_GAME_MESSAGE_NUX);return(0,r.jsxs)("div",{className:r0.gs,children:[(0,r.jsx)(aa.Z,{label:"In-Game NUX Message for DMs",selectionMode:"single",options:l,placeholder:"Select DM",value:t,onSelectionChange:a}),(0,r.jsx)(x.$,{variant:"primary",size:"sm",text:i?"Clear NUX Flag":"Set NUX Flag",onClick:s,disabled:null==t})]})}function r8(){let e=o.useCallback(()=>{rH.A.openPrivateChannel({recipientIds:[rZ.K]})},[]);return(0,r.jsx)(x.$,{variant:"primary",size:"sm",text:"Open System DM",onClick:e})}function r5(){let e=(0,d.bG)([aK.Ay],()=>aK.Ay.allByCategory(aK.xW.MESSAGING),[],d.My).map(e=>{let[t,a,{label:n}]=e;return(0,r.jsx)(m.d,{label:n,description:t,checked:a,onChange:e=>sF(t,e)},t)});return(0,r.jsxs)("div",{className:B()(t$.nd,r0.nd),children:[e,(0,r.jsx)("div",{className:r0.yF}),(0,r.jsx)(r2,{}),(0,r.jsx)("div",{className:r0.yF}),(0,r.jsx)(r3,{}),(0,r.jsx)("div",{className:r0.yF}),(0,r.jsx)(r8,{})]})}var r6=a(459838),r7=a(772707),r4=a(150934),r9=a(598653),oe=a(166403),ot=a(625494),oa=a(204925),on=a(325278);let ol={EmailEnterModal:async()=>{let{default:e}=await a.e("29232").then(a.bind(a,180275));return t=>(0,r.jsx)(e,{...t,headerText:na.intl.string(na.t.ZLRYGU),confirmButtonText:na.intl.string(na.t.PDTjLN),confirmButtonVariant:"primary"})},EmailPincodeModal:async()=>{let{default:e}=await a.e("19840").then(a.bind(a,79779));return t=>(0,r.jsx)(e,{...t,headerText:na.intl.string(na.t.H3Q7U8),onFormSubmit:()=>{},onResend:()=>{},onSuccess:()=>{},confirmButtonText:na.intl.string(na.t["13ofGu"]),impression:{impressionName:ie.ImpressionNames.URF_CONFIRM_EMAIL_CODE}})},AgeVerificationRetryModal:async()=>{let{default:e}=await Promise.all([a.e("15574"),a.e("34260"),a.e("18467")]).then(a.bind(a,297102));return t=>(0,r.jsx)(e,{...t,entryPoint:nu.q1.DEV_TOOLS_AGE_VERIFICATION_RETRY_MODAL})},ExistingUserAgeGatePrompt:async()=>{let{default:e}=await Promise.all([a.e("11441"),a.e("82758"),a.e("80022"),a.e("10136")]).then(a.bind(a,776971));return t=>(0,r.jsx)(e,{...t,source:oa.w_.NSFW_SERVER})},ExistingUserAgeGateUnderage:async()=>{let{default:e}=await a.e("80959").then(a.bind(a,784578));return t=>(0,r.jsx)(e,{...t})},NewUserAgeGate:async()=>{let{default:e}=await Promise.all([a.e("11441"),a.e("82758"),a.e("19623"),a.e("80022"),a.e("1143")]).then(a.bind(a,284778));return t=>(0,r.jsx)(e,{...t})},NUFModal:async()=>{let{default:e}=await Promise.all([a.e("97556"),a.e("21009"),a.e("11895"),a.e("11441"),a.e("93413"),a.e("19580"),a.e("97804"),a.e("56856"),a.e("82758"),a.e("99574"),a.e("80022"),a.e("50475"),a.e("93265"),a.e("58118")]).then(a.bind(a,111185));return t=>(0,r.jsx)(e,{...t,onSlideChange:()=>{}})},ClaimAccountModal:async()=>{let{default:e}=await Promise.all([a.e("69757"),a.e("19623"),a.e("21007")]).then(a.bind(a,888363));return t=>(0,r.jsx)(e,{claimRequired:!0,...t})},AutomatedUnderageAppealModal:async()=>{let{default:e}=await Promise.all([a.e("28813"),a.e("9018")]).then(a.bind(a,466702));return t=>(0,r.jsx)(e,{...t,classificationId:"123"})},AutomodRaidResolveModal:async()=>{let{default:e}=await Promise.all([a.e("94766"),a.e("73669"),a.e("7133")]).then(a.bind(a,580812));return t=>(0,r.jsx)(e,{...t,guildId:"123",messageId:null})},AutomodUserProfileQuarantineAlert:async()=>{let{default:e}=await a.e("52343").then(a.bind(a,725034));return t=>(0,r.jsx)(e,{...t,guildId:"123"})},PhoneVerificationModal:async()=>{let{default:e}=await Promise.all([a.e("49747"),a.e("72712"),a.e("89545"),a.e("11493")]).then(a.bind(a,914724));return t=>(0,r.jsx)(e,{error:null,working:!1,validPhone:!1,...t})},VoiceSettingsModal:async()=>{let{default:e}=await a.e("96531").then(a.bind(a,880510));return t=>(0,r.jsx)(e,{...t,mediaEngineContext:r6.x.DEFAULT,subtitle:"Devtools subtitle"})},DynamicGraphicDemo:async()=>{let{DynamicGraphicComponent:e}=await Promise.resolve().then(a.bind(a,116833));return t=>(0,r.jsx)(r7.k,{...t,title:"Dynamic Graphics Demo",subtitle:"This modal demonstrates the dynamic graphics system",graphic:{type:"dynamic",component:e.DEMO,aspectRatio:"6/4",props:{text:"Dynamic Content Loaded!"}},actions:[{variant:"primary",text:"Close",onClick:t.onClose}],children:(0,r.jsx)("div",{children:"This modal showcases the new dynamic graphics system where components can be loaded dynamically based on enum values, providing type safety while maintaining runtime flexibility."})})},OverlayDisabledSurveyModal:async()=>{let{default:e}=await Promise.all([a.e("79969"),a.e("82318")]).then(a.bind(a,387101)),{OverlayToggledClientSettingType:t}=await Promise.resolve().then(a.bind(a,810412));return a=>(0,r.jsx)(e,{...a,clientSettingType:t.LEGACY_GAME,gameId:"123456789"})},PremiumSubscriptionPauseModal:async()=>{let{PremiumSubscriptionPauseModalSelect:e}=await Promise.all([a.e("91170"),a.e("80347")]).then(a.bind(a,318998)),{CancellationContext:t}=await Promise.resolve().then(a.bind(a,916974)),{PremiumTypes:n}=await Promise.resolve().then(a.bind(a,202541)),l={id:"test-subscription-id",userId:"test-user-id",status:1,currency:"usd",currentPeriodStart:new Date,currentPeriodEnd:new Date(Date.now()+2592e6),items:[{id:"test-item-id",planId:"511651880837840896",quantity:1}],paymentSourceId:"test-payment-source",renewalMutations:null,hasActiveTrial:!1},s=o.forwardRef((a,s)=>{let[i,d]=o.useState(null);return(0,r.jsx)(t.Provider,{value:{setStep:()=>{},premiumType:n.TIER_2,onClose:a.onClose,transitionState:a.transitionState,premiumSubscription:l,analyticsLocations:[],analyticsLocation:void 0,confettiCanvas:null,churnUserDiscountOffer:null,isFetchingChurnDiscountOffer:!1,fullPrice:"$9.99",discountedPrice:void 0,planId:"511651880837840896",paymentsBlocked:!1,renewalInvoice:null,renewalInvoiceDetails:null,handleCancellation:async()=>{},applyOffer:async()=>{},pauseDuration:i,setPauseDuration:d},children:(0,r.jsx)(e,{})})});return s.displayName="PremiumSubscriptionPauseModalWrapper",e=>(0,r.jsx)(s,{...e})},NewMemberActionModal:async()=>{let{default:e}=await Promise.all([a.e("27867"),a.e("87973"),a.e("52191"),a.e("13949"),a.e("54569")]).then(a.bind(a,251632)),{NewMemberActionTypes:t}=await Promise.resolve().then(a.bind(a,374084)),n={channelId:"123456789",title:"Welcome to the server!",description:"Say hello in the welcome channel",actionType:t.CHAT,emoji:null,icon:null};return t=>(0,r.jsx)(e,{...t,guildId:"123456789",action:n,onSave:(e,t,a)=>{console.log("NewMemberActionModal onSave:",{action:e,iconData:t,shouldSaveIcon:a})},onDelete:()=>{console.log("NewMemberActionModal onDelete")}})},PlayStationModal:async()=>{let{default:e}=await Promise.all([a.e("47661"),a.e("38035")]).then(a.bind(a,14860)),t=await Promise.resolve().then(a.bind(a,643501)),{createChannelRecord:n}=await Promise.resolve().then(a.bind(a,95701)),l=n({id:"123456789",name:"test-voice-channel",type:2,guild_id:"987654321",position:0,permissionOverwrites:{},parent_id:void 0,nsfw:!1,topic:void 0,lastMessageId:void 0,bitrate:64e3,userLimit:0,rateLimitPerUser:0,icon:null,ownerId:null,application_id:null,lastPinTimestamp:null,rtcRegion:null,videoQualityMode:null,messageCount:0,memberCount:0,threadMetadata:void 0,member:void 0,defaultAutoArchiveDuration:void 0,flags:0,totalMessageSent:0,availableTags:[],appliedTags:[],defaultReactionEmoji:null,defaultThreadRateLimitPerUser:0,defaultSortOrder:null,defaultForumLayout:0}),s={"device-1":{id:"device-1",name:"PS5 - Living Room",platform:"playstation"},"device-2":{id:"device-2",name:"PS5 - Bedroom",platform:"playstation"},"device-3":{id:"device-3",name:"PS4 - Office",platform:"playstation"}},i=a=>{let n=t.default.getDevicesForPlatform,i=t.default.getFetchingDevices,o=t.default.getLastSelectedDeviceByPlatform,d=t.default.getAwaitingRemoteSessionInfo;t.default.getDevicesForPlatform=e=>e===er.fg2.PLAYSTATION?s:n.call(t.default,e),t.default.getFetchingDevices=e=>e!==er.fg2.PLAYSTATION&&i.call(t.default,e),t.default.getLastSelectedDeviceByPlatform=e=>e===er.fg2.PLAYSTATION?"device-1":o.call(t.default,e),t.default.getAwaitingRemoteSessionInfo=()=>null;let c=a.onClose;return a.onClose=async()=>{t.default.getDevicesForPlatform=n,t.default.getFetchingDevices=i,t.default.getLastSelectedDeviceByPlatform=o,t.default.getAwaitingRemoteSessionInfo=d,await c()},(0,r.jsx)(e,{...a,channel:l,platform:er.fg2.PLAYSTATION})};return i.displayName="PlayStationModalWrapper",i},GameDetectionReportModal:async()=>{let{default:e}=await Promise.all([a.e("21072"),a.e("27495")]).then(a.bind(a,651930));return t=>(0,r.jsx)(e,{...t,detected:{applicationId:"123456789",name:"Test Game"}})},AppealIngestionModal:async()=>{let{default:e}=await Promise.all([a.e("51897"),a.e("19503"),a.e("4458"),a.e("92030"),a.e("51471")]).then(a.bind(a,550560));return t=>(0,r.jsx)(e,{...t,classificationId:"123456789"})},CreateTagModal:async()=>{let{default:e}=await Promise.all([a.e("28713"),a.e("47326")]).then(a.bind(a,950989));return t=>(0,r.jsx)(e,{...t,channelId:"123456789",guildId:"987654321"})},CreateTagModalEdit:async()=>{let{default:e}=await Promise.all([a.e("28713"),a.e("47326")]).then(a.bind(a,950989)),t={id:"tag-123",name:"Bug Report",emojiId:"123456789",emojiName:"\uD83D\uDC1B",moderated:!0};return a=>(0,r.jsx)(e,{...a,channelId:"123456789",guildId:"987654321",tag:t})},ConfirmModal:async()=>{let{ConfirmModal:e}=await a.e("4823").then(a.bind(a,158954));return t=>(0,r.jsx)(e,{...t,title:"Confirm Action",subtitle:"Are you sure you want to perform this action? This action cannot be undone.",confirmText:"Confirm",onConfirm:()=>console.log("ConfirmModal: Confirmed"),onCancel:()=>console.log("ConfirmModal: Cancelled")})},AlertModal:async()=>{let{default:e}=await Promise.all([a.e("74558"),a.e("10919")]).then(a.bind(a,556506));return t=>(0,r.jsx)(e,{...t,title:"Alert",body:"This is an alert message with a single action.",confirmText:"OK",onConfirm:()=>console.log("AlertModal: Confirmed")})},AlertModalWithCancel:async()=>{let{default:e}=await Promise.all([a.e("74558"),a.e("10919")]).then(a.bind(a,556506));return t=>(0,r.jsx)(e,{...t,title:"Confirm Action",body:"Are you sure you want to proceed with this action?",confirmText:"Yes",cancelText:"No",onConfirm:()=>console.log("AlertModalWithCancel: Confirmed"),onCancel:()=>console.log("AlertModalWithCancel: Cancelled")})},AlertModalWithSecondary:async()=>{let{default:e}=await Promise.all([a.e("74558"),a.e("10919")]).then(a.bind(a,556506));return t=>(0,r.jsx)(e,{...t,title:"Settings Change",body:"This will change your account settings.",confirmText:"Apply",cancelText:"Cancel",secondaryConfirmText:"Don't show this again",onConfirm:()=>console.log("AlertModalWithSecondary: Confirmed"),onCancel:()=>console.log("AlertModalWithSecondary: Cancelled"),onConfirmSecondary:()=>console.log("AlertModalWithSecondary: Secondary action confirmed")})},GuildDisableCommunicationModal:async()=>{let{Button:e,Text:t,Heading:n,Checkbox:l,ButtonGroup:s}=await Promise.all([a.e("4823"),a.e("77260")]).then(a.bind(a,397927)),{DisableCommunicationDuration:i,getFriendlyDurationString:o}=await Promise.resolve().then(a.bind(a,200700)),d=await Promise.resolve().then(a.t.bind(a,582128,19)),c="TestUser";function u(a){let[u,m]=d.useState(i.DURATION_60_SEC),[h,x]=d.useState(""),[p,g]=d.useState(!1),[v,j]=d.useState(!1),f=[{value:i.DURATION_60_SEC,label:o(i.DURATION_60_SEC)},{value:i.DURATION_5_MIN,label:o(i.DURATION_5_MIN)},{value:i.DURATION_10_MIN,label:o(i.DURATION_10_MIN)},{value:i.DURATION_1_HOUR,label:o(i.DURATION_1_HOUR)},{value:i.DURATION_1_DAY,label:o(i.DURATION_1_DAY)},{value:i.DURATION_1_WEEK,label:o(i.DURATION_1_WEEK)}],b=d.useCallback(async()=>{g(!0),console.log("GuildDisableCommunicationModal: Timing out user",{user:c,duration:o(u),reason:null!=h?h:"No reason provided",resolveFlag:v}),await new Promise(e=>setTimeout(e,1e3)),g(!1),a.onClose()},[u,h,v,a]);return(0,r.jsxs)("div",{style:{padding:"20px",maxWidth:"500px"},children:[(0,r.jsxs)(n,{variant:"heading-lg/semibold",className:"mb-2",children:["Disable Communication for ",c,"#","0001"]}),(0,r.jsx)(t,{variant:"text-sm/normal",className:"mb-4",color:"text-subtle",children:"This will temporarily disable the user's ability to communicate in this server."}),(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsx)(n,{variant:"heading-sm/semibold",className:"mb-2",children:"Duration"}),(0,r.jsx)(s,{children:f.map(t=>(0,r.jsx)(e,{variant:u===t.value?"primary":"secondary",size:"sm",text:t.label,onClick:()=>m(t.value)},t.value))})]}),(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsx)(n,{variant:"heading-sm/semibold",className:"mb-2",children:"Reason (Optional)"}),(0,r.jsx)("textarea",{value:h,onChange:e=>x(e.target.value),placeholder:"Enter reason for timeout...",style:{width:"100%",minHeight:"80px",padding:"8px",border:"1px solid var(--border-subtle)",borderRadius:"4px",backgroundColor:"var(--background-base-low)",color:"var(--text-strong)",resize:"vertical"}})]}),(0,r.jsx)("div",{className:"mb-4",children:(0,r.jsx)(l,{checked:v,onChange:j,label:"Resolve associated mod report"})}),(0,r.jsxs)("div",{style:{display:"flex",gap:"8px",justifyContent:"flex-end"},children:[(0,r.jsx)(e,{variant:"secondary",text:"Cancel",onClick:a.onClose}),(0,r.jsx)(e,{variant:"primary",text:"Timeout User",onClick:b,disabled:p})]})]})}return e=>(0,r.jsx)(u,{...e})},GuildPowerupDeactivateModal:async()=>{let{Button:e,Text:t,Heading:n,Checkbox:l}=await Promise.all([a.e("4823"),a.e("77260")]).then(a.bind(a,397927)),s=await Promise.resolve().then(a.t.bind(a,582128,19)),i="Level 3 Server Boost",o=200,d=60,c=8;function u(a){let[u,m]=s.useState(!1),[h,x]=s.useState(!1),p=s.useCallback(async()=>{x(!0),console.log("GuildPowerupDeactivateModal: Deactivating powerup",{powerup:i,guildId:"123456789"}),await new Promise(e=>setTimeout(e,2e3)),x(!1),a.onClose()},[a]);return(0,r.jsxs)("div",{style:{padding:"20px",maxWidth:"500px"},children:[(0,r.jsxs)(n,{variant:"heading-lg/semibold",className:"mb-2",children:["Deactivate ",i]}),(0,r.jsxs)(t,{variant:"text-sm/normal",className:"mb-4",color:"text-subtle",children:["This will remove the ",i," from your server and disable all associated features."]}),(0,r.jsxs)("div",{className:"mb-4",style:{backgroundColor:"var(--background-base-lower)",padding:"16px",borderRadius:"8px",border:"1px solid var(--border-subtle)"},children:[(0,r.jsx)(n,{variant:"heading-sm/semibold",className:"mb-2",children:"Current Features"}),(0,r.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"8px"},children:[(0,r.jsxs)(t,{variant:"text-sm/normal",color:"text-subtle",children:["\u2022 ",o," emoji slots"]}),(0,r.jsxs)(t,{variant:"text-sm/normal",color:"text-subtle",children:["\u2022 ",d," sticker slots"]}),(0,r.jsxs)(t,{variant:"text-sm/normal",color:"text-subtle",children:["\u2022 ",c," sound slots"]}),(0,r.jsx)(t,{variant:"text-sm/normal",color:"text-subtle",children:"\u2022 Custom server banner"})]})]}),(0,r.jsxs)("div",{className:"mb-4",style:{backgroundColor:"var(--background-danger)",padding:"16px",borderRadius:"8px",border:"1px solid var(--border-feedback-critical)"},children:[(0,r.jsxs)(t,{variant:"eyebrow",color:"text-feedback-critical",className:"mb-2",children:[(0,r.jsx)("span",{role:"img","aria-label":"Warning",children:"\u26A0\uFE0F"})," ","Warning"]}),(0,r.jsx)(t,{variant:"text-sm/medium",color:"text-feedback-critical",children:"Deactivating this powerup will immediately remove all Level 3 features from your server. Members will lose access to custom emojis, stickers, and other premium features. This action cannot be undone."})]}),(0,r.jsx)("div",{className:"mb-4",children:(0,r.jsx)(l,{checked:u,onChange:m,label:"I understand that deactivating this powerup will remove all Level 3 features from my server",labelType:"secondary"})}),(0,r.jsxs)("div",{style:{display:"flex",gap:"8px",justifyContent:"flex-end"},children:[(0,r.jsx)(e,{variant:"secondary",text:"Cancel",onClick:a.onClose}),(0,r.jsx)(e,{variant:"critical-primary",text:"Deactivate Level",onClick:p,disabled:!u,loading:h})]})]})}return e=>(0,r.jsx)(u,{...e})},DataHarvestModal:async()=>{let{default:e}=await a.e("92063").then(a.bind(a,970018));return t=>(0,r.jsx)(e,{modalProps:t,onConfirm:e=>{console.log("DataHarvestModal: Requesting data export for:",e),setTimeout(()=>{console.log("DataHarvestModal: Data export request submitted successfully")},1e3)}})},EnableCommunityModal:async()=>{let{default:e}=await Promise.all([a.e("65706"),a.e("82721"),a.e("52823"),a.e("74832")]).then(a.bind(a,709779));return t=>(0,r.jsx)(e,{...t,onClose:async()=>{console.log("EnableCommunityModal: Closed"),await t.onClose()}})},DeprivateModal:async()=>{let e=(await Promise.all([a.e("11206"),a.e("54857")]).then(a.bind(a,147696))).default;return t=>(0,r.jsx)(e,{...t,guildId:"123456789012345678",startingChannelId:"987654321098765432"})},CameraPreviewModal:async()=>{let{default:e}=await Promise.all([a.e("58751"),a.e("10534")]).then(a.bind(a,308229));return t=>(0,r.jsx)(e,{...t,videoEnabled:!1,onEnable:()=>console.log("Camera enabled")})},CameraPreviewModalWithVideo:async()=>{let{default:e}=await Promise.all([a.e("58751"),a.e("10534")]).then(a.bind(a,308229));return t=>(0,r.jsx)(e,{...t,videoEnabled:!0,onEnable:()=>console.log("Camera enabled")})},ModeratorReportResolveConfirmModal:async()=>{let{default:e}=await Promise.resolve().then(a.bind(a,390897));return t=>(0,r.jsx)(e,{...t,handleResolveFlag:()=>console.log("ModeratorReportResolveConfirmModal: Flag resolved")})},SelectFriendsModal:async()=>{let{default:e,SelectFriendsModalScreens:t}=await Promise.resolve().then(a.bind(a,212737));return a=>{let{onClose:n,...l}=a;return(0,r.jsx)(e,{onClose:async()=>{console.log("SelectFriendsModal: Closed"),await n()},startingScreen:t.SELECT_FRIENDS,...l})}},SelectFriendsModalReminder:async()=>{let{default:e,SelectFriendsModalScreens:t}=await Promise.resolve().then(a.bind(a,212737));return a=>{let{onClose:n,...l}=a;return(0,r.jsx)(e,{onClose:async()=>{console.log("SelectFriendsModalReminder: Closed"),await n()},startingScreen:t.REMINDER,...l})}},AddFavoriteChannelModal:async()=>{let{default:e}=await Promise.all([a.e("73883"),a.e("73216"),a.e("69977"),a.e("74390"),a.e("36946"),a.e("92639"),a.e("90480"),a.e("40963"),a.e("66031"),a.e("94317"),a.e("64307")]).then(a.bind(a,420222));return t=>(0,r.jsx)(e,{...t,parentId:null})},ActivityShareMomentModal:async()=>{let{default:e}=await Promise.all([a.e("73883"),a.e("73216"),a.e("69977"),a.e("34558"),a.e("36946"),a.e("92639"),a.e("90480"),a.e("40963"),a.e("66031"),a.e("94317"),a.e("21743")]).then(a.bind(a,190930));return t=>(0,r.jsx)(e,{...t,applicationId:"123456789",mediaUrl:"https://picsum.photos/400/300.jpg"})},CallUserConfirmationModal:async()=>{let{default:e}=await a.e("19106").then(a.bind(a,279673));return t=>(0,r.jsx)(e,{...t,onSubmit:()=>{console.log("CallUserConfirmationModal: Call confirmed"),t.onClose()}})},OptInReorderAttemptModal:async()=>{let{default:e}=await Promise.all([a.e("57729"),a.e("97585"),a.e("24848")]).then(a.bind(a,354643));return t=>(0,r.jsx)(e,{...t,onClose:()=>(console.log("OptInReorderAttemptModal: Modal closed"),t.onClose())})},GuildAntiRaidReportModal:async()=>{let{default:e}=await Promise.all([a.e("73669"),a.e("64499")]).then(a.bind(a,296222));return t=>(0,r.jsx)(e,{...t,guildId:"123456789",onClose:()=>(console.log("GuildAntiRaidReportModal: Modal closed"),t.onClose())})},ConsentCheckBoxModal:async()=>{let{ConfirmModal:e}=await a.e("4823").then(a.bind(a,158954)),{Text:t,Heading:n}=await Promise.all([a.e("4823"),a.e("77260")]).then(a.bind(a,397927)),l=await Promise.resolve().then(a.t.bind(a,582128,19));function s(a){let[s,i]=l.useState(!1),[o,d]=l.useState(!1);return(0,r.jsx)(e,{...a,title:"Consent CheckBox Examples",confirmText:"Close",cancelText:"",onConfirm:()=>(console.log("ConsentCheckBoxModal: Modal closed"),a.onClose()),onCancel:()=>{},children:(0,r.jsxs)("div",{style:{padding:"20px",display:"flex",flexDirection:"column",gap:"20px"},children:[(0,r.jsxs)("div",{children:[(0,r.jsx)(n,{variant:"heading-md/semibold",style:{marginBottom:"12px"},children:"Terms of Service Consent"}),(0,r.jsx)(r4.S,{label:"I agree to Discord's Terms of Service and Privacy Policy",checked:s,onChange:e=>i(e),labelType:"secondary"}),(0,r.jsxs)(t,{variant:"text-sm/normal",color:"text-subtle",style:{marginTop:"8px"},children:["Consent status: ",s?"Agreed":"Not agreed"]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)(n,{variant:"heading-md/semibold",style:{marginBottom:"12px"},children:"Promotional Email Consent"}),(0,r.jsx)(r4.S,{label:"I would like to receive promotional emails from Discord about new features, events, and other updates.",checked:o,onChange:e=>d(e),labelType:"secondary"}),(0,r.jsxs)(t,{variant:"text-sm/normal",color:"text-subtle",style:{marginTop:"8px"},children:["Promo consent status: ",o?"Opted in":"Not opted in"]})]})]})})}return s.displayName="ConsentCheckBoxModalContent",e=>(0,r.jsx)(s,{...e})},GuildRaidLockdownFeedbackModal:async()=>{let{default:e}=await Promise.all([a.e("102"),a.e("46313")]).then(a.bind(a,336496));return t=>(0,r.jsx)(e,{...t,guildId:"123456789",onClose:()=>(console.log("GuildRaidLockdownFeedbackModal: Modal closed"),t.onClose())})},GuildVerificationLevelModal:async()=>{let{default:e}=await Promise.all([a.e("82653"),a.e("78618"),a.e("70232")]).then(a.bind(a,313003)),{dangerouslyConstructGuildRecordFromUntypedObject:t}=await Promise.resolve().then(a.bind(a,149790)),n=t({id:"123456789",name:"Test Server",description:"A test server for development",ownerId:"987654321",icon:null,splash:null,banner:null,homeHeader:null,features:[],preferredLocale:"en-US",afkChannelId:null,afkTimeout:300,systemChannelId:null,verificationLevel:2,joinedAt:new Date,defaultMessageNotifications:0,mfaLevel:0,application_id:null,explicitContentFilter:0,vanityURLCode:null,premiumTier:0,premiumSubscriberCount:0,premiumProgressBarEnabled:!1,systemChannelFlags:0,discoverySplash:null,rulesChannelId:null,safetyAlertsChannelId:null,publicUpdatesChannelId:null,maxStageVideoChannelUsers:10,maxVideoChannelUsers:25,maxMembers:5e5,nsfwLevel:0,ownerConfiguredContentLevel:null,hubType:null,latestOnboardingQuestionId:null,profile:null,premiumFeatures:null,moderatorReporting:null});return t=>(0,r.jsx)(e,{...t,guild:n})},GuildVerificationLevelModalCommunity:async()=>{let{default:e}=await Promise.all([a.e("82653"),a.e("78618"),a.e("70232")]).then(a.bind(a,313003)),{dangerouslyConstructGuildRecordFromUntypedObject:t}=await Promise.resolve().then(a.bind(a,149790)),{GuildFeatures:n}=await Promise.resolve().then(a.bind(a,652215)),l=t({id:"123456789",name:"Test Community Server",description:"A test community server for development",ownerId:"987654321",icon:null,splash:null,banner:null,homeHeader:null,features:[n.COMMUNITY],preferredLocale:"en-US",afkChannelId:null,afkTimeout:300,systemChannelId:null,verificationLevel:3,joinedAt:new Date,defaultMessageNotifications:0,mfaLevel:0,application_id:null,explicitContentFilter:0,vanityURLCode:null,premiumTier:0,premiumSubscriberCount:0,premiumProgressBarEnabled:!1,systemChannelFlags:0,discoverySplash:null,rulesChannelId:null,safetyAlertsChannelId:null,publicUpdatesChannelId:null,maxStageVideoChannelUsers:10,maxVideoChannelUsers:25,maxMembers:5e5,nsfwLevel:0,ownerConfiguredContentLevel:null,hubType:null,latestOnboardingQuestionId:null,profile:null,premiumFeatures:null,moderatorReporting:null});return t=>(0,r.jsx)(e,{...t,guild:l})},EmojiAddModal:async()=>{let{EmojiAddModal:e}=await Promise.all([a.e("23217"),a.e("90410")]).then(a.bind(a,126033));return t=>(0,r.jsx)(e,{...t,guildId:"123456789",initialTierEmojiIds:new Set(["emoji1"]),onSubmit:e=>{console.log("EmojiAddModal: Selected emojis:",Array.from(e))},transitionToManageEmoji:()=>{console.log("EmojiAddModal: Transition to manage emoji clicked")},onClose:()=>(console.log("EmojiAddModal: Modal closed"),t.onClose())})},StreamFullModal:async()=>{let{default:e}=await a.e("25894").then(a.bind(a,166789));return t=>(0,r.jsx)(e,{...t})},VoiceCallFeedback:async()=>{let{default:e}=await Promise.all([a.e("4079"),a.e("22255"),a.e("55925"),a.e("37381"),a.e("47004"),a.e("13937"),a.e("31389")]).then(a.bind(a,492)),t={channel_id:"123456789",channel_type:er.rbe.GUILD_VOICE,guild_id:"987654321",rtc_connection_id:"devtools-rtc-connection",duration:6e4,voice_state_count:2,video_stream_count:0,video_enabled:!1,media_session_id:"devtools-media-session",duration_muted_ms:0,output_audio_route_type:null};return a=>(0,r.jsx)(e,{...a,analyticsData:t})},StreamFeedback:async()=>{let{default:e}=await Promise.all([a.e("4079"),a.e("22255"),a.e("55925"),a.e("37381"),a.e("47004"),a.e("13937"),a.e("17171"),a.e("62767")]).then(a.bind(a,218738)),t={ownerId:"987654321",guildId:"123456789",channelId:"123456789",streamType:on.U4.GUILD},n={id:"123456789",name:"Test Game"},l={rtc_connection_id:"devtools-rtc-connection",media_session_id:"devtools-media-session",duration:6e4,stream_region:"us-west",max_viewers:3,avg_bitrate:2500,avg_fps:60,avg_resolution:1080,inbound_bitrate_estimate_percentile99:3e3,parent_media_session_id:null};return a=>(0,r.jsx)(e,{...a,isStreamer:!1,stream:t,streamApplication:n,analyticsData:l})},FamilyCenterAcceptLinkModal:async()=>{let e=en.default.getUser("12345"),t=en.default.getUser("67890");if(void 0===e||void 0===t)return()=>null;let{default:n}=await Promise.all([a.e("38307"),a.e("55738"),a.e("31385")]).then(a.bind(a,58144));return a=>(0,r.jsx)(n,{...a,currentUser:t,otherUser:e})},FamilyCenterDeclineLinkModal:async()=>{let e=en.default.getUser("12345"),t=en.default.getUser("67890");if(void 0===e||void 0===t)return()=>null;let{default:n}=await Promise.all([a.e("38307"),a.e("55738"),a.e("84811")]).then(a.bind(a,389094));return a=>(0,r.jsx)(n,{...a,currentUser:t,otherUser:e})},FamilyCenterCancelLinkModal:async()=>{let e=en.default.getUser("12345"),t=en.default.getUser("67890");if(void 0===e||void 0===t)return()=>null;let{default:n}=await Promise.all([a.e("38307"),a.e("55738"),a.e("17219")]).then(a.bind(a,187278));return a=>(0,r.jsx)(n,{...a,currentUser:e,otherUser:t})},FamilyCenterDisconnectLinkModal:async()=>{let e=en.default.getUser("12345"),t=en.default.getUser("67890");if(void 0===e||void 0===t)return()=>null;let{default:n}=await Promise.all([a.e("77680"),a.e("43139")]).then(a.bind(a,179950));return a=>(0,r.jsx)(n,{...a,currentUser:e,otherUser:t})},FamilyCenterQRCodeModal:async()=>{let{default:e}=await Promise.all([a.e("98300"),a.e("72875")]).then(a.bind(a,320742));return t=>(0,r.jsx)(e,{...t})},PremiumGroupFriendsSelectorModal:async()=>{let{default:e}=await Promise.all([a.e("86248"),a.e("85579")]).then(a.bind(a,785606)),t=oe.A.getPremiumGroupSubscription();return null==t?()=>null:a=>(0,r.jsx)(e,{...a,subscription:t})},PremiumGroupAcceptInviteModal:async()=>{let{default:e}=await Promise.all([a.e("58611"),a.e("99910")]).then(a.bind(a,826181));return t=>(0,r.jsx)(e,{...t,premiumGroupSubscriptionId:"1234567890",premiumGroupInviteId:"1234567890",isExistingSub:!1,premiumGroupPrimaryName:"Test User"})},QuarantineModeInfoModal:async()=>{let{default:e}=await a.e("74575").then(a.bind(a,218642));return t=>(0,r.jsx)(e,{...t})},CaptchaTestModal:async()=>{let{default:e}=await a.e("17724").then(a.bind(a,563255));return t=>(0,r.jsx)(e,{...t})},PasswordConfirm:async()=>{let{default:e}=await Promise.resolve().then(a.bind(a,662758));return t=>(0,r.jsx)(e,{...t,title:"Confirm Password",actionText:"Submit",handleSubmit:async e=>{console.log("PasswordConfirm: Password submitted:",e),await new Promise(e=>setTimeout(e,1e3))}})},BlockedDomainModal:async()=>{let{default:e}=await Promise.all([a.e("89971"),a.e("20577"),a.e("58062"),a.e("20723")]).then(a.bind(a,667934));return t=>(0,r.jsx)(e,{...t,url:"https://example-phishing-site.com/malicious-page"})},DmSettingsUpsellModal:async()=>{let{default:e}=await Promise.all([a.e("84665"),a.e("62684")]).then(a.bind(a,228855)),t=Object.keys(a9.A.getGuilds())[0];return a=>(0,r.jsx)(e,{...a,guildId:t})},UrgentMessageModal:async()=>{let{default:e}=await Promise.all([a.e("89913"),a.e("36724")]).then(a.bind(a,531519));return t=>(0,r.jsx)(e,{...t})},UserAgreementsModal:async()=>{let{default:e}=await Promise.all([a.e("17209"),a.e("82911"),a.e("22220")]).then(a.bind(a,639719));return t=>(0,r.jsx)(e,{...t})},DisableRiskyPermsModal:async()=>{let{default:e}=await Promise.all([a.e("54706"),a.e("52823"),a.e("71905")]).then(a.bind(a,868952)),t=Object.values(a9.A.getGuilds())[0];return null==t?()=>null:a=>(0,r.jsx)(e,{...a,guild:t})},OtherFriendRequestsModal:async()=>{let{default:e}=await Promise.all([a.e("40681"),a.e("11988"),a.e("50117"),a.e("73152"),a.e("25281")]).then(a.bind(a,516259));return t=>(0,r.jsx)(e,{...t})},AcceptInviteModal:async()=>{let{default:e}=await Promise.all([a.e("55"),a.e("56356"),a.e("26726"),a.e("7265"),a.e("81079"),a.e("1352"),a.e("79023"),a.e("48672")]).then(a.bind(a,777307));return t=>(0,r.jsx)(e,{...t})},PremiumGroupSubscribeModal:async()=>{let{default:e}=await Promise.all([a.e("99709"),a.e("69595")]).then(a.bind(a,526710));return t=>(0,r.jsx)(e,{...t})},NewUserOnboarding:async()=>{let{default:e}=await Promise.all([a.e("97556"),a.e("21009"),a.e("11895"),a.e("89322"),a.e("23058"),a.e("19580"),a.e("82721"),a.e("97804"),a.e("56856"),a.e("19623"),a.e("99574"),a.e("57794"),a.e("78963")]).then(a.bind(a,427294));return t=>(0,r.jsx)(e,{...t})}};function os(){let e=o.useMemo(()=>Object.keys(ol).map(e=>({label:e,value:e,id:e})).sort((e,t)=>e.label.localeCompare(t.label)),[]),[t,a]=o.useState(null);return(0,r.jsx)(g.Ip,{className:t$.nd,children:(0,r.jsxs)("div",{className:sS.l$,children:[(0,r.jsx)("section",{className:sS.uW,children:(0,r.jsxs)(W.B,{direction:"horizontal",gap:8,align:"end",children:[(0,r.jsx)(aa.Z,{label:"Open a Modal",placeholder:"Select a modal",options:e,value:t,onSelectionChange:a,selectionMode:"single"}),(0,r.jsx)(x.$,{variant:"primary",text:"Open",disabled:null==t,onClick:()=>null!=t&&(0,eV.openModalLazy)(ol[t])})]})}),(0,r.jsxs)("section",{className:sS.uW,children:[(0,r.jsx)(H.D,{variant:"heading-md/semibold",children:"Wow moment"}),(0,r.jsx)("div",{className:sS.bd,children:(0,r.jsx)(x.$,{variant:"primary",text:"Open",onClick:function(){(0,r9.o)(!0),ot._.dispatch(er.jej.PREMIUM_SUBSCRIPTION_CREATED)}})})]})]})})}var oi=a(933832),or=a(472229),oo=a(945960),od=a(669316),oc=a(354670),ou=a(158045);async function om(){try{let{body:e}=await n6.Bo.get({url:er.Rsh.USER_OFFER_IDS,rejectWithError:!0});return e}catch(e){return[]}}async function oh(){try{let{body:e}=await n6.Bo.get({url:er.Rsh.USER_OFFERS,rejectWithError:!0});return{trial:e.trial,discount:e.discount.map(od.A.createFromServer)}}catch(e){return{trial:[],discount:[]}}}async function ox(e,t){try{await n6.Bo.post({url:er.Rsh.CREATE_USER_OFFER(e,t),rejectWithError:!0})}catch{}finally{await (0,oo._D)()}}async function op(e,t){try{await n6.Bo.del({url:er.Rsh.UPDATE_USER_OFFER(e,t),rejectWithError:!0})}catch{}finally{await (0,oo._D)()}}async function og(){try{await n6.Bo.del({url:er.Rsh.USER_OFFERS,rejectWithError:!0})}catch{}finally{await oc.A.forceReset(),await (0,oo._D)()}}async function ov(e){await n6.Bo.post({url:er.Rsh.CREATE_REVERSE_TRIAL,body:{ends_at:e},rejectWithError:!0})}function oj(e){let{acked:t,expired:a,inStore:n,onClick:l,secondaryBadge:s}=e,i="Created";return a?i="Expired":t?i="Acked":n&&(i="Active"),(0,r.jsxs)("div",{className:sS.fC,children:[(0,r.jsx)($.D,{onClick:l,className:B()(sS.qS,sS.vk,{[sS.vu]:n,[sS.R1]:t,[sS._7]:a}),children:(0,r.jsxs)(p.E,{variant:"eyebrow",color:t?void 0:"text-overlay-light",children:[i,n?" *":""]})}),null!=s&&s.active&&(0,r.jsx)("div",{className:B()(sS.qS,sS.k3),children:(0,r.jsx)(p.E,{variant:"eyebrow",color:"text-overlay-light",children:s.label})})]})}function of(e){let{offer:t,offerOptions:a,forceRefetch:n,inStore:l=!1}=e,[s,i]=o.useState(!1),[d,c]=o.useState(!1),[u,m]=o.useState(!1),[h,x]=o.useState(!1);o.useEffect(()=>{u&&x(!0);let e=setTimeout(()=>{x(!1)},500);return()=>{clearTimeout(e)}},[u]);let{id:g,expires_at:v,redeemed_at:j,trial_id:f,subscription_trial:b,referrer:y}=t,E=a.find(e=>{let{value:t}=e;return t===f})?.label??"Unknown";null!=y&&(E=`${E} from @${y.username}`);let _=null!=v,C=null!=v&&new Date(v).getTime()<Date.now(),S=b?.sku_id===sj.pe.TIER_0;async function N(){m(!0),_?await A({expiresAt:null}):await (0,oo.u1)(t),n(),m(!1)}async function A(e){m(!0);try{await n6.Bo.patch({url:er.Rsh.UPDATE_USER_OFFER(g,"trial"),body:{..."expiresAt"in e&&{expires_at:e.expiresAt},..."referrerId"in e&&{referrer_id:e.referrerId}},rejectWithError:!0})}finally{n(),m(!1)}}return o.useEffect(()=>{if(s){let e=setTimeout(()=>{i(!1)},3e3);return()=>{clearTimeout(e)}}if(d){let e=setTimeout(()=>{c(!1)},3e3);return()=>{clearTimeout(e)}}},[s,d]),(0,r.jsxs)("div",{className:B()(sS.Nr,S?sS.Qf:sS.C1),children:[(0,r.jsx)("div",{className:B()(sS.nM,sS.S7),children:(0,r.jsx)(H.D,{variant:"heading-lg/semibold",color:"text-overlay-light",children:E})}),(0,r.jsxs)($.D,{className:B()(sS.nM,sS.QB),onClick:()=>{(0,nS.C)(g,()=>i(!0))},children:[(0,r.jsxs)(p.E,{variant:"eyebrow",color:"text-overlay-light",children:["Offer: ",g]}),s?(0,r.jsx)(oi.A,{size:"md",color:"currentColor",className:sS.Kk}):(0,r.jsx)(nv.T,{size:"xs",color:"currentColor",className:sS.Kk})]}),(0,r.jsxs)($.D,{className:B()(sS.nM,sS.QB),onClick:()=>{(0,nS.C)(f,()=>c(!0))},children:[(0,r.jsxs)(p.E,{variant:"eyebrow",color:"text-overlay-light",children:["Trial: ",f]}),d?(0,r.jsx)(oi.A,{size:"md",color:"currentColor",className:sS.Kk}):(0,r.jsx)(nv.T,{size:"xs",color:"currentColor",className:sS.Kk})]}),(0,r.jsx)("div",{className:sS.nM,children:(0,r.jsxs)(p.E,{variant:"eyebrow",color:"text-overlay-light",children:["Trial Length:"," ",(0,ou.re)({intervalType:b?.interval??sj.WT.MONTH,intervalCount:b?.interval_count??1,capitalize:!1})]})}),(0,r.jsxs)("div",{className:sS.nM,children:[(0,r.jsxs)(p.E,{variant:"eyebrow",color:"text-overlay-light",children:["Expires (",(0,or.A)(),"):"]}),(0,r.jsx)("input",{type:"datetime-local",value:(0,nN.Xm)(v),onChange:e=>{A({expiresAt:""!==e.target.value?new Date(e.target.value).toISOString():null})}})]}),(0,r.jsxs)("div",{className:sS.nM,children:[(0,r.jsx)(p.E,{variant:"eyebrow",color:"text-overlay-light",children:"Referrer ID:"}),(0,r.jsx)("input",{type:"text",value:y?.id??"",onChange:e=>A({referrerId:e.target.value})})]}),(0,r.jsx)(oj,{acked:_,expired:C,inStore:l,onClick:N,secondaryBadge:{active:null!=j,label:"Redeemed"}}),(0,r.jsx)($.D,{onClick:async()=>{m(!0),await op(g,"trial"),n(),m(!1)},children:(0,r.jsx)(nb.u,{size:"md",color:"currentColor",className:B()(sS.Kk,sS.IT)})}),(0,r.jsx)("div",{className:B()(sS.g4,{[sS.VP]:u||h}),children:(0,r.jsx)(tl.y,{})})]})}function ob(e){let{offer:t,offerOptions:a,forceRefetch:n,inStore:l=!1}=e,[s,i]=o.useState(!1),[d,c]=o.useState(!1),[u,m]=o.useState(!1),[h,x]=o.useState(!1);o.useEffect(()=>{u&&x(!0);let e=setTimeout(()=>{x(!1)},500);return()=>{clearTimeout(e)}},[u]);let{id:g,expiresAt:v,discountId:j,discount:f}=t,b=a.find(e=>{let{value:t}=e;return t===j})?.label??"Unknown",y=null!=v,E=t.hasExpired(),_=t.isApplied();async function C(){m(!0),y?await S({expiresAt:null}):await (0,oo.u1)(void 0,t),n(),m(!1)}async function S(e){let{expiresAt:t}=e;m(!0);try{await n6.Bo.patch({url:er.Rsh.UPDATE_USER_OFFER(g,"discount"),body:{expires_at:t},rejectWithError:!0})}finally{n(),m(!1)}}return o.useEffect(()=>{if(s){let e=setTimeout(()=>{i(!1)},3e3);return()=>{clearTimeout(e)}}if(d){let e=setTimeout(()=>{c(!1)},3e3);return()=>{clearTimeout(e)}}},[s,d]),(0,r.jsxs)("div",{className:B()(sS.Nr,sS.id),children:[(0,r.jsx)("div",{className:B()(sS.nM,sS.S7),children:(0,r.jsx)(H.D,{variant:"heading-lg/semibold",color:"text-default",children:b})}),(0,r.jsxs)($.D,{className:B()(sS.nM,sS.QB),onClick:()=>{(0,nS.C)(g,()=>i(!0))},children:[(0,r.jsxs)(p.E,{variant:"eyebrow",color:"text-default",children:["Offer: ",g]}),s?(0,r.jsx)(oi.A,{size:"md",color:"currentColor",className:B()(sS.Kk,sS.mK)}):(0,r.jsx)(nv.T,{size:"xs",color:"currentColor",className:sS.Kk})]}),(0,r.jsxs)($.D,{className:B()(sS.nM,sS.QB),onClick:()=>{(0,nS.C)(j,()=>c(!0))},children:[(0,r.jsxs)(p.E,{variant:"eyebrow",color:"text-default",children:["Discount: ",j]}),d?(0,r.jsx)(oi.A,{size:"md",color:"currentColor",className:B()(sS.Kk,sS.mK)}):(0,r.jsx)(nv.T,{size:"xs",color:"currentColor",className:sS.Kk})]}),f?.amount!=null&&(0,r.jsx)("div",{children:(0,r.jsxs)(p.E,{variant:"eyebrow",color:"text-default",children:[f.amount,"% off"]})}),(0,r.jsxs)("div",{className:sS.nM,children:[(0,r.jsxs)(p.E,{variant:"eyebrow",color:"text-overlay-light",children:["Expires (",(0,or.A)(),"):"]}),(0,r.jsx)("input",{type:"datetime-local",value:(0,nN.Xm)(v?.toISOString()),onChange:e=>S({expiresAt:""!==e.target.value?new Date(e.target.value).toISOString():null})})]}),(0,r.jsx)(oj,{acked:y,expired:E,inStore:l,onClick:C,secondaryBadge:{active:_,label:"Applied"}}),(0,r.jsx)($.D,{className:sS.aR,onClick:async()=>{m(!0),await op(g,"discount"),n(),m(!1)},children:(0,r.jsx)(nb.u,{size:"md",color:"currentColor",className:B()(sS.Kk,sS.fy)})}),(0,r.jsx)("div",{className:B()(sS.g4,{[sS.VP]:u||h}),children:(0,r.jsx)(tl.y,{})})]})}function oy(){let[e,t]=o.useState([]),[a,n]=o.useState([]),[l,s]=o.useState(),[i,c]=o.useState(),[u,m]=o.useState(!0),{discountOffers:h,trialOffers:v}=(0,d.cf)([oc.A],()=>({discountOffers:Object.values(oc.A.getState().userDiscountOffers).sort((e,t)=>e.id.localeCompare(t.id)),trialOffers:Object.values(oc.A.getState().userTrialOffers).sort((e,t)=>e.id.localeCompare(t.id))})),[f,b]=o.useState([]),[y,E]=o.useState([]),[_,C]=o.useState(10080),[S,N]=o.useState([]),A=o.useMemo(()=>new Set([...v,...h].map(e=>e.id)),[v,h]),k=o.useMemo(()=>[...v,...f.filter(e=>!A.has(e.id))],[v,f,A]),D=o.useMemo(()=>[...h,...y.filter(e=>!A.has(e.id))],[h,y,A]),{entitlements:I,deleteFractionalPremium:T,refreshEntitlementList:R}=s_();async function O(){null!=l&&(await ox(l,"trial"),m(!0))}async function w(){null!=i&&(await ox(i,"discount"),m(!0))}async function M(){await og(),m(!0)}async function L(){let e=new Date(Date.now()+60*_*1e3).toISOString();await ov(e),R()}return o.useEffect(()=>{R()},[R]),o.useEffect(()=>{N(I.filter(e=>e.sourceType===er.GD.REVERSE_TRIAL&&null!=e.endsAt&&e.endsAt>new Date))},[I]),o.useEffect(()=>{(0===e.length||0===a.length||u)&&om().then(e=>{let a=Object.keys(e.trial).map(t=>({label:t,value:e.trial[t]})),r=Object.keys(e.discount).map(t=>({label:t,value:e.discount[t]}));t(a),n(r),null==l&&s(a[0].value),null==i&&c(r[0].value)})},[e,a,l,i,u]),o.useEffect(()=>{u&&(m(!1),oc.A.forceReset(),(0,oo._D)(),oh().then(e=>{b(e.trial.sort((e,t)=>e.id.localeCompare(t.id))),E(e.discount.sort((e,t)=>e.id.localeCompare(t.id)))}))},[u]),(0,r.jsx)(g.Ip,{className:t$.nd,children:(0,r.jsxs)("div",{className:sS.l$,children:[(0,r.jsxs)("section",{className:sS.uW,children:[(0,r.jsx)(H.D,{variant:"heading-md/semibold",children:"Utils"}),(0,r.jsxs)("div",{className:sS.Uo,children:[(0,r.jsx)(x.$,{variant:"primary",size:"sm",text:"Clear all User Offers",onClick:M}),(0,r.jsx)(x.$,{variant:"primary",size:"sm",text:"Clear Mobile Trials DismissibleContent",onClick:()=>(0,ax.xB)(ah.M.PREMIUM_MOBILE_TRIAL_USER_SETTINGS_AVATAR_BADGE)}),(0,r.jsx)(x.$,{variant:"primary",size:"sm",text:"Clear Offer Nagbar DismissibleContent",onClick:()=>(0,ax._N)(ah.M.NAGBAR_NOTICE_OFFER_EXPIRING)}),(0,r.jsx)(x.$,{variant:"primary",size:"sm",text:"Refresh DevTools",onClick:()=>m(!0)})]})]}),(0,r.jsx)("section",{className:sS.uW,children:(0,r.jsxs)("div",{className:sS.bd,children:[(0,r.jsx)(j.l,{label:"Create a Trial Offer",options:e,formatOption:e=>{let{label:t,value:a}=e;return{label:t,value:a,id:a}},value:l,placeholder:"Trial Type",onSelectionChange:s,selectionMode:"single",fullWidth:!0}),(0,r.jsx)(x.$,{variant:"primary",text:"Create",onClick:O})]})}),(0,r.jsx)("section",{className:sS.uW,children:(0,r.jsxs)("div",{className:sS.bd,children:[(0,r.jsx)(j.l,{label:"Create a Discount Offer",options:a,formatOption:e=>{let{label:t,value:a}=e;return{label:t,value:a,id:a}},value:i,placeholder:"Discount Type",onSelectionChange:c,selectionMode:"single",fullWidth:!0}),(0,r.jsx)(x.$,{variant:"primary",text:"Create",onClick:w})]})}),k.length>0&&(0,r.jsxs)("section",{className:sS.uW,children:[(0,r.jsx)(H.D,{variant:"heading-md/semibold",children:"Existing Trial Offers"}),(0,r.jsx)(p.E,{variant:"text-sm/normal",color:"text-muted",children:"* indicates the offer is currently in UserOfferStore."}),k.map(t=>(0,r.jsx)(of,{offer:t,offerOptions:e,forceRefetch:()=>m(!0),inStore:A.has(t.id)},t.id))]}),D.length>0&&(0,r.jsxs)("section",{className:sS.uW,children:[(0,r.jsx)(H.D,{variant:"heading-md/semibold",children:"Existing Discount Offers"}),(0,r.jsx)(p.E,{variant:"text-sm/normal",color:"text-muted",children:"* indicates the offer is currently in UserOfferStore."}),D.map(e=>(0,r.jsx)(ob,{offer:e,offerOptions:a,forceRefetch:()=>m(!0),inStore:A.has(e.id)},e.id))]}),(0,r.jsx)("section",{className:sS.uW,children:(0,r.jsxs)("div",{className:sS.bd,children:[(0,r.jsx)(j.l,{label:"Create a Reverse Trial Entitlement",options:[{id:"5min",label:"5 minutes",value:5},{id:"1hour",label:"1 hour",value:60},{id:"1day",label:"1 day",value:1440},{id:"1week",label:"1 week",value:10080}],value:_,placeholder:"Reverse Trial Length",onSelectionChange:C,selectionMode:"single",fullWidth:!0}),(0,r.jsx)(x.$,{variant:"primary",text:"Create",onClick:L})]})}),S.length>0&&(0,r.jsxs)("div",{children:[(0,r.jsx)(p.E,{style:{marginTop:"15px"},variant:"text-md/bold",children:"Active reverse trial"}),(0,r.jsx)("div",{children:S.map(e=>(0,r.jsx)(sA,{entitlement:e,active:!0,onDelete:()=>T(e.id)},e.id))})]})]})})}var oE=a(340351),o_=a(26279),oC=a(717318);let oS={[o_.Re.UNSPECIFIED]:"Unspecified",[o_.Re.DRAFT]:"Draft",[o_.Re.SIGNED]:"Signed",[o_.Re.DISCARDED]:"Discarded",[o_.Re.SIGNING_IN_PROGRESS]:"Signing In Progress",[o_.Re.SIGNING_FAILED]:"Signing Failed"},oN={[o_.BM.UNSPECIFIED]:"Unspecified",[o_.BM.ONE_TIME]:"One Time",[o_.BM.SUBSCRIPTION]:"Subscription"};function oA(){let[e,t]=o.useState(null),[a,n]=o.useState(!0),[l,s]=o.useState(null),i=o.useCallback(async()=>{n(!0),s(null);try{let e=await n6.Bo.get({url:`${er.Rsh.ORDER_LIST}?limit=5`,rejectWithError:!0});t(e.body??[])}catch(e){s(e instanceof Error?e.message:"Failed to fetch orders")}finally{n(!1)}},[]);return o.useEffect(()=>{i()},[i]),(0,r.jsx)(g.Ip,{className:t$.nd,children:(0,r.jsxs)("div",{className:sS.l$,children:[(0,r.jsxs)("div",{className:sS.dL,style:{marginBottom:"16px"},children:[(0,r.jsxs)(p.E,{variant:"text-lg/bold",children:["Orders (last ",5,")"]}),(0,r.jsx)(x.$,{variant:"secondary",size:"sm",text:"Refresh",onClick:i,loading:a})]}),null!=l&&(0,r.jsx)(V.w,{type:"critical",children:l}),!a&&null!=e&&0===e.length&&(0,r.jsx)(p.E,{variant:"text-sm/normal",color:"text-muted",children:"No orders found."}),null!=e&&e.map(e=>(0,r.jsx)(ok,{order:e},e.id))]})})}function ok(e){let{order:t}=e,[a,n]=o.useState(!1),[l,s]=o.useState(!1),i=oS[t.status]??`Unknown (${t.status})`,d=[{id:"status",label:`Status: ${i}`,isDisabled:!1},{id:"created",label:`Created: ${new Date(t.created_at).toLocaleString()}`,isDisabled:!1}],c=o.useCallback(()=>{navigator.clipboard.writeText(t.id),s(!0),setTimeout(()=>s(!1),2e3)},[t.id]);return(0,r.jsxs)("div",{className:sS.Nr,children:[(0,r.jsxs)(W.B,{direction:"horizontal",gap:8,align:"center",style:{marginBottom:"4px"},children:[(0,r.jsx)(p.E,{variant:"text-md/semibold",children:t.id}),(0,r.jsx)(x.$,{variant:"secondary",size:"sm",text:l?"Copied!":"Copy ID",onClick:c})]}),(0,r.jsx)(oE.C,{items:d,label:"Order info",layout:"inline",selectionMode:"none",selectionBehavior:"replace",disabledKeys:new Set}),(0,r.jsxs)(W.B,{direction:"vertical",gap:4,style:{marginTop:"8px"},children:[(0,r.jsx)(p.E,{variant:"text-sm/semibold",children:"Line Items"}),0===t.order_line_items.length?(0,r.jsx)(p.E,{variant:"text-xs/normal",color:"text-muted",children:"No line items"}):t.order_line_items.map(e=>(0,r.jsxs)(W.B,{direction:"horizontal",gap:12,children:[(0,r.jsxs)(p.E,{variant:"text-xs/normal",children:["SKU: ",e.sku_id]}),(0,r.jsxs)(p.E,{variant:"text-xs/normal",children:["Qty: ",e.quantity]}),(0,r.jsxs)(p.E,{variant:"text-xs/normal",children:["Type: ",oN[e.purchase_type]??`Unknown (${e.purchase_type})`]}),null!=e.subscription_plan_id&&(0,r.jsxs)(p.E,{variant:"text-xs/normal",children:["Plan: ",e.subscription_plan_id]})]},e.id))]}),null!=t.billing_facet&&(0,r.jsxs)("div",{className:oC.VK,style:{marginTop:"8px"},children:[(0,r.jsxs)($.D,{onClick:()=>n(e=>!e),className:oC.Eh,children:[(0,r.jsx)(p.E,{variant:"text-sm/semibold",children:"Billing Facet"}),(0,r.jsx)(sg.A,{direction:a?sg.A.Directions.UP:sg.A.Directions.DOWN})]}),a&&(0,r.jsxs)("ul",{className:oC.j3,children:[(0,r.jsxs)("li",{children:[(0,r.jsx)(p.E,{variant:"text-xs/semibold",children:"payment_gateway"}),(0,r.jsx)(p.E,{variant:"text-xs/normal",children:String(t.billing_facet.payment_gateway)})]}),null!=t.billing_facet.payment_source_id&&(0,r.jsxs)("li",{children:[(0,r.jsx)(p.E,{variant:"text-xs/semibold",children:"payment_source_id"}),(0,r.jsx)(p.E,{variant:"text-xs/normal",children:t.billing_facet.payment_source_id})]}),null!=t.billing_facet.invoice_preview&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("li",{children:[(0,r.jsx)(p.E,{variant:"text-xs/semibold",children:"currency"}),(0,r.jsx)(p.E,{variant:"text-xs/normal",children:t.billing_facet.invoice_preview.currency})]}),(0,r.jsxs)("li",{children:[(0,r.jsx)(p.E,{variant:"text-xs/semibold",children:"subtotal"}),(0,r.jsx)(p.E,{variant:"text-xs/normal",children:t.billing_facet.invoice_preview.subtotal})]}),(0,r.jsxs)("li",{children:[(0,r.jsx)(p.E,{variant:"text-xs/semibold",children:"tax"}),(0,r.jsx)(p.E,{variant:"text-xs/normal",children:t.billing_facet.invoice_preview.tax})]}),(0,r.jsxs)("li",{children:[(0,r.jsx)(p.E,{variant:"text-xs/semibold",children:"total"}),(0,r.jsx)(p.E,{variant:"text-xs/normal",children:t.billing_facet.invoice_preview.total})]}),t.billing_facet.invoice_preview.line_items.length>0&&(0,r.jsxs)("li",{children:[(0,r.jsx)(p.E,{variant:"text-xs/semibold",children:"invoice line items"}),(0,r.jsx)(W.B,{direction:"vertical",gap:4,style:{marginTop:"4px"},children:t.billing_facet.invoice_preview.line_items.map(e=>(0,r.jsxs)(W.B,{direction:"horizontal",gap:12,children:[(0,r.jsxs)(p.E,{variant:"text-xs/normal",children:["ref: ",e.ref_order_line_item_id]}),(0,r.jsxs)(p.E,{variant:"text-xs/normal",children:["unit: ",e.unit_price]}),(0,r.jsxs)(p.E,{variant:"text-xs/normal",children:["qty: ",e.quantity]})]},e.ref_order_line_item_id))})]})]})]})]})]})}var oD=a(935462),oI=a(260598),oT=a(93688),oR=a(717400),oO=a(676955),ow=a(31300),oM=a(500060),oL=a(391973),oP=a(684013),oU=a(765671),oG=a(235986),oF=a(742589),oB=a(41984),o$=a(181435),oV=a(435736),oW=a(296027),oz=a(515183),oH=a(489277),oK=a(127242),oY=a(869014),oq=a(528772),oJ=a(38502),oQ=a(532624),oX=a(773371),oZ=a(996439),o0=a(350535),o1=a(9302),o2=a(644434),o3=a(61505);let o8={[er.uss.CLICK_ZONE_DEBUG]:e=>({type:er.uss.CLICK_ZONE_DEBUG,id:(0,eD.A)(),layoutId:e,anchor:{top:.35,right:.35},size:{width:100,height:100},...oJ.A.getWidgetDefaultSettings(er.uss.CLICK_ZONE_DEBUG),pinned:!0}),[er.uss.PERFORMANCE_DEBUG]:e=>({type:er.uss.PERFORMANCE_DEBUG,id:(0,eD.A)(),layoutId:e,anchor:{top:.1,right:.1},size:{fixed:!1,width:"auto",height:"auto"},...oJ.A.getWidgetDefaultSettings(er.uss.PERFORMANCE_DEBUG),pinned:!0})},o5={};function o6(e){let{id:t}=e,[a,n]=o.useState(!1);return o.useEffect(()=>{let e;return a&&(e=setTimeout(()=>{n(!1)},1e3)),()=>{null!=e&&clearTimeout(e)}},[a]),(0,r.jsxs)(ng.$n,{look:ng.$n.Looks.LINK,color:ng.$n.Colors.LINK,size:ng.$n.Sizes.MIN,onClick:function(){(0,nS.C)(t,()=>n(!0))},className:o3.DT,children:["Game Id: ",t," ",a?na.intl.string(na.t.t5VZ88):null]})}let o7=o.memo(function(e){let{trackedGame:t}=e,a=(0,d.bG)([E.Ay],()=>E.Ay.getGameOrTransformedSubgameForPID(t.pid)),n=(0,d.bG)([S.A],()=>S.A.getGameForPID(t.pid)),{data:l}=(0,as.I)(n?.id),s=(0,d.bG)([E.Ay],()=>null==a?null:E.Ay.getGameOverlayStatus(a));return(0,r.jsxs)("div",{className:o3.st,children:[(0,r.jsx)(p.E,{variant:"text-md/bold",color:"text-strong",children:t.gameName}),(0,r.jsx)(p.E,{variant:"text-sm/bold",color:"text-subtle",children:t.pid}),(0,r.jsx)(p.E,{variant:"text-sm/normal",color:"text-subtle",children:a?.exeName}),(0,r.jsxs)(p.E,{variant:"text-sm/normal",color:"text-default",children:["isLauncher: ",a?.isLauncher?"Yes":"No"]}),null!=t.gameId&&(0,r.jsx)(p.E,{variant:"text-md/bold",color:"text-strong",children:(0,r.jsx)(o6,{id:t.gameId})}),(0,r.jsxs)(p.E,{variant:"text-sm/normal",color:"text-default",children:["fullscreenType: ",(0,oz.wR)(t.fullscreenType)]}),(0,r.jsxs)(p.E,{variant:"text-sm/normal",color:"text-default",children:["state: ",t.state]}),(0,r.jsxs)(p.E,{variant:"text-sm/normal",color:"text-default",children:["successfullyShown: ",t.successfullyShown?"Yes":"No"]}),(0,r.jsxs)("div",{className:o3.st,children:[(0,r.jsxs)(p.E,{variant:"text-sm/normal",color:"text-default",children:["source: ",t.source]}),(0,r.jsxs)(p.E,{variant:"text-sm/normal",color:"text-default",children:["legacyEnabled: ",t.legacyEnabled?"Yes":"No"]}),(0,r.jsxs)(p.E,{variant:"text-sm/normal",color:"text-default",children:["oopEnabled: ",t.oopEnabled?"Yes":"No"]}),(0,r.jsxs)(p.E,{variant:"text-sm/normal",color:"text-default",children:["overlayMethod: ",(0,oz.gK)(t.overlayMethod)]})]}),null!=s&&(0,r.jsxs)("div",{className:o3.st,children:[(0,r.jsxs)(p.E,{variant:"text-sm/normal",color:"text-default",children:["raw source: ",s.source]}),(0,r.jsxs)(p.E,{variant:"text-sm/normal",color:"text-default",children:["raw enabledLegacy: ",s.enabledLegacy?"Yes":"No"]}),(0,r.jsxs)(p.E,{variant:"text-sm/normal",color:"text-default",children:["raw enabledOOP: ",s.enabledOOP?"Yes":"No"]}),(0,r.jsxs)(p.E,{variant:"text-sm/normal",color:"text-default",children:["raw overlayMethod: ",(0,oz.gK)(s.overlayMethod)]})]}),(0,r.jsxs)(p.E,{variant:"text-sm/normal",color:"text-default",children:["hidden: ",a?.hidden?"Yes":"No"]}),(0,r.jsxs)(p.E,{variant:"text-sm/normal",color:"text-default",children:["hook: ",l?.hook?"Yes":"No"]}),(0,r.jsxs)(p.E,{variant:"text-sm/normal",color:"text-default",children:["overlay: ",l?.overlay?"Yes":"No"]}),(0,r.jsxs)(p.E,{variant:"text-sm/normal",color:"text-default",children:["overlayCompatibilityHook: ",l?.overlayCompatibilityHook?"Yes":"No"]}),(0,r.jsxs)(p.E,{variant:"text-sm/normal",color:"text-default",children:["supportsOutOfProcessOverlay: ",l?.supportsOutOfProcessOverlay?"Yes":"No"]})]})}),o4=o.memo(function(e){let{pid:t}=e,a=(0,d.cf)([oX.default],()=>oX.default.getOverlayPIDStatuses()),n=(0,d.cf)([oW.default],()=>oW.default.getTrackedGames()),l=(0,d.bG)([oX.default],()=>oX.default.isInputLocked(t),[t]),s=(0,d.bG)([oX.default],()=>oX.default.DEV_isInputLockedV3(t),[t]),i=(0,d.bG)([oX.default],()=>oX.default.DEV_isInputLocked(t),[t]),o=(0,d.bG)([oX.default],()=>oX.default.isReady(t),[t]);return(0,r.jsxs)("div",{className:o3.st,children:[(0,r.jsx)(p.E,{variant:"text-md/semibold",color:"text-strong",children:`${t}`}),(0,r.jsxs)(p.E,{variant:"text-sm/normal",color:"text-subtle",children:["Screen Type Resolution: ",function(e){let t=n[e]?.timer;if(null==t||null==t.screenTypeResolutionTimestamp)return"...";let a=t.screenTypeResolutionTimestamp-t.startTrackingTimestamp;return`${a.toFixed(2)}ms`}(t)]}),(0,r.jsxs)(p.E,{variant:"text-sm/normal",color:"text-subtle",children:["Window Creation: ",function(e){let t=n[e]?.timer;if(null==t||null==t.moduleTrackingTimestamp||null==t.screenTypeResolutionTimestamp)return"...";let a=t.moduleTrackingTimestamp-t.screenTypeResolutionTimestamp;return`${a.toFixed(2)}ms`}(t)]}),(0,r.jsxs)(p.E,{variant:"text-sm/normal",color:"text-subtle",children:["Rendering: ",function(e){let t=n[e]?.timer;if(null==t||null==t.overlayRenderingTimestamp||null==t.moduleTrackingTimestamp)return"...";let a=t.overlayRenderingTimestamp-t.moduleTrackingTimestamp;return`${a.toFixed(2)}ms`}(t)]}),(0,r.jsxs)(p.E,{variant:"text-sm/normal",color:"text-strong",children:["Bridge Status: ",a.get(Number(t))]}),(0,r.jsxs)(p.E,{variant:"text-sm/normal",color:"text-strong",children:["isInputLocked: ",l]}),(0,r.jsxs)(p.E,{variant:"text-sm/normal",color:"text-strong",children:["isInputLockedV3: ",s]}),(0,r.jsxs)(p.E,{variant:"text-sm/normal",color:"text-strong",children:["isInputLockedV2: ",i]}),(0,r.jsxs)(p.E,{variant:"text-sm/normal",color:"text-strong",children:["isReady: ",o]})]})});function o9(e){var t;let a=(t=Object.values((0,d.yK)([oJ.A],()=>oJ.A.getWidgetsForLayout(o2.G))),t.find(t=>t.type===e));return[a,function(){if(null!=a)(0,oL.uv)(a.id);else{let t=o8[e];if(null==t)return;let a=t(o2.G);(0,oL.jn)(a)}}]}function de(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t?`${e.toFixed(2)}ms`:(0,nN.i$)(np()(e),"h:mm:ss.SSS")}let dt=o.memo(function(e){let{pid:t,...a}=e,n=(0,d.bG)([oW.default],()=>{if(null==t)return"Unknown";let e=oW.default.getTrackedGameByPid(t)?.gameName;return null!=e?(o5[t]=e,e):o5[t]??"Unknown"},[t]);return(0,r.jsx)(p.E,{...a,variant:"text-md/semibold",color:"text-strong",children:n})});function da(){let e=(0,d.bG)([oK.A],()=>oK.A.hasRenderDebugMode(oB.x7.TrackFocusPIDs)),t=(0,d.yK)([oW.default],()=>oW.default.getDevToolsFocusedPidsWithTimestamp());return(0,r.jsxs)("div",{className:o3.st,children:[(0,r.jsxs)("div",{className:o3.Iv,children:[(0,r.jsx)(m.d,{checked:e,onChange:()=>void oP.A.setRenderDebugMode(!oK.A.hasRenderDebugMode(oB.x7.TrackFocusPIDs),oB.x7.TrackFocusPIDs),label:"Track Focus Pids"}),(0,r.jsx)($.D,{className:o3.LL,onClick:()=>oP.A.clearTrackedPids(),children:(0,r.jsx)(nb.u,{size:"md",color:"currentColor"})})]}),(0,r.jsxs)(g.Ip,{className:B()(o3.st,o3.XG),children:[0===t.length&&(0,r.jsx)(p.E,{variant:"text-sm/normal",color:"text-default",children:"No recent focused pids"}),[...t].reverse().map(e=>{let[t,a,n]=e;return(0,r.jsx)(o.Fragment,{children:(0,r.jsx)(l2.m,{position:"left",text:n===oB.su.TRACK_FOCUS?"Tracked Focus Event":"Clear Focus Event",children:(0,r.jsx)("div",{children:(0,r.jsxs)(p.E,{variant:"text-sm/medium",color:n===oB.su.TRACK_FOCUS?"text-default":"text-feedback-critical",children:[(0,r.jsx)(dt,{pid:a,tag:"span"})," - ",a?.toString()??"null"," @ ",de(t)]})})})},`${a}-${t}`)})]})]})}let dn=o.memo(function(e){let{pid:t}=e,a=(0,d.bG)([oW.default,E.Ay],()=>{if(null==t)return null;let e=oW.default.getTrackedGameByPid(t)?.fullscreenType;if(null!=e)return e;let a=E.Ay.getGameOrTransformedSubgameForPID(t);return a?.fullscreenType??lz.aI.UNKNOWN},[t]);return(0,r.jsxs)(p.E,{variant:"text-sm/normal",color:"text-subtle",tag:"span",children:["Original Screen Type: ",null!=a?(0,oz.wR)(a):"Unknown"]})}),dl=o.memo(function(){let e=(0,d.cf)([oW.default],()=>oW.default.getTrackedGames()),[t,a]=o.useState({}),n=o.useRef(null);return o.useEffect(()=>(n.current=setInterval(async()=>{let e=E.Ay.getRunningGames(),t=[],n=Date.now();for(let a of e)t.push((0,oz.E1)(a.pid,0).then(e=>[a.pid,e,n]));let l=await Promise.all(t);a(e=>l.reduce((e,t)=>{let[a,n,l]=t;if(null==n||null==a)return e;let s=e[a]??[],i=s[s.length-1]?.screenType;return(0===s.length||i!==n)&&(e[a]=[...s,{pid:a,screenType:n,timestamp:l}]),e},{...e}))},+n4.A.Millis.SECOND),()=>clearInterval(n.current)),[]),(0,r.jsx)(l2.m,{position:"left",text:"The most recent screen types we've logged, indexed by pid",children:(0,r.jsx)("div",{children:(0,r.jsxs)(g.Ip,{className:B()(o3.st,o3.XG),children:[0===Object.keys(e).length&&(0,r.jsx)(p.E,{variant:"text-sm/normal",color:"text-default",children:"No recent screen types"}),Object.values(e).map(e=>(0,r.jsxs)("div",{children:[(0,r.jsx)(dt,{tag:"div",pid:e.pid}),(0,r.jsx)(dn,{pid:e.pid}),null!=t[e.pid]&&[...t[e.pid]].reverse().map(t=>{let{screenType:a,timestamp:n}=t;return(0,r.jsx)(p.E,{variant:"text-xs/normal",color:"text-default",children:`${a}:${(0,oz.wR)(a)} @ ${de(n)}`},`${e.pid}-${a}-${n}`)})]},e.pid))]})})})}),ds=o.memo(function(){let e=(0,d.cf)([oW.default],()=>oW.default.getTrackedGames()),t=(0,o1.getPID)(),a=(0,d.bG)([oW.default],()=>oW.default.isOverlayOOPEnabledForPid(t),[t]),[n,l]=(0,d.yK)([oq.A],()=>[oq.A.enabled,oq.A.keepOpen]),s=(0,d.bG)([oX.default],()=>oX.default.getFocusedPID()),i=(0,d.bG)([oX.default],()=>oX.default.isFocusedPidOutOfProcess());return(0,r.jsxs)("div",{className:o3.st,children:[0===Object.keys(e).length&&(0,r.jsx)(p.E,{variant:"text-sm/normal",color:"text-default",children:"No tracked game times"}),Object.values(e).map(e=>(0,r.jsx)(o4,{pid:e.pid},e.pid)),(0,r.jsxs)("div",{children:[(0,r.jsxs)(p.E,{variant:"text-sm/medium",color:"text-strong",children:["focusedPID: ",s?.toString()??"null"]}),(0,r.jsxs)(p.E,{variant:"text-sm/normal",color:"text-subtle",children:["isFocusedPidOutOfProcess: ",i?"Yes":"No"]}),(0,r.jsxs)(p.E,{variant:"text-sm/medium",color:"text-strong",children:["processPid: ",t?.toString()??"unknown"]}),(0,r.jsxs)(p.E,{variant:"text-sm/normal",color:"text-subtle",children:["isOOPEnabledForPid: ",a?"Yes":"No"]}),(0,r.jsxs)(p.E,{variant:"text-sm/normal",color:"text-subtle",children:["SoundboardOverlay.enabled: ",n?"Yes":"No"]}),(0,r.jsxs)(p.E,{variant:"text-sm/normal",color:"text-subtle",children:["SoundboardOverlay.keepOpen: ",l?"Yes":"No"]})]})]})}),di=[{mode:oB.x7.ClickZones,label:"Click Zone Debug Mode",tooltip:"Enables a red border around click zones to help with debugging."},{mode:oB.x7.WidgetAreas,label:"Render Debug Mode",tooltip:"Enables a border around any widgets that are rendered on screen that are pinned (even if they are hidden). Blue = pinned widgets, Gray = unpinned widgets"},{mode:oB.x7.WindowContainer,label:"Window Container Debug Mode",tooltip:"Enables a border the overlay window"},{mode:oB.x7.DisabledGPUBoost,label:"Disable GPU Boost",tooltip:"Disables GPU Boost, which can help with performance when games compete for GPU resources."},{mode:oB.x7.ForceGPUBoost,label:"Force GPU Boost",tooltip:"Forces GPU Boost, which can help with performance when games compete for GPU resources."},{mode:oB.x7.OverlayRafManagerForceEnabled,label:"Overlay SmartRAF",tooltip:"Creates a widget that has a clickzone inside of it, which will show/hide every few seconds."},{mode:oB.x7.LegacyOverlayLogging,label:"Legacy Overlay Logging",tooltip:"Enables legacy overlay logging, which will forward all legacy logging to the main apps console."}],dr=o.memo(function(){let[e,t]=o9(er.uss.CLICK_ZONE_DEBUG),[a,n]=o9(er.uss.PERFORMANCE_DEBUG),l=(0,d.bG)([oK.A],()=>oK.A.getRenderDebugModes()),[s,i]=o.useState({});return o.useEffect(()=>{let e=setInterval(()=>{i({})},200);return()=>clearInterval(e)},[]),(0,r.jsx)("div",{className:o3.st,children:di.map(s=>{let i=s.mode===oB.x7.OverlayRafManagerForceEnabled?`${s.label} (${oY.A.getLastRAFCallbackReason()})`:s.label;function d(){return s.mode===oB.x7.ClickZones?null!=e:s.mode===oB.x7.WidgetAreas?null!=a:l.has(s.mode)}return(0,r.jsx)(o.Fragment,{children:(0,r.jsx)(m.d,{checked:d(),onChange:function(){var e;let a=d();s.mode===oB.x7.ClickZones&&t(),s.mode===oB.x7.WidgetAreas&&n(),e=s.mode,oP.A.setRenderDebugMode(!a,e)},label:i,description:s.tooltip})},s.mode)})})}),dd=o.memo(function(){let e=(0,d.cf)([oW.default],()=>oW.default.getTrackedGames()),t=(0,d.bG)([E.Ay],()=>E.Ay.getRunningGames()).filter(t=>null==e[t.pid]);return(0,r.jsxs)(r.Fragment,{children:[t.length>0&&(0,r.jsx)(l2.m,{position:"left",text:"Games that are running but not tracked by the overlay",children:(0,r.jsx)("div",{children:(0,r.jsxs)("div",{className:o3.st,children:[(0,r.jsx)(p.E,{variant:"text-md/bold",color:"text-feedback-critical",children:"Untracked Running Games"}),t.map(e=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(p.E,{variant:"text-sm/normal",color:"text-feedback-critical",children:`${e.pid} - ${e.name} (${e.exeName})`},e.pid),(0,r.jsx)(dn,{pid:e.pid})]}))]})})}),(0,r.jsx)(l2.m,{position:"left",text:"The current running games process information",children:(0,r.jsx)("div",{children:(0,r.jsxs)("div",{className:o3.st,children:[0===Object.keys(e).length&&(0,r.jsx)(p.E,{variant:"text-sm/normal",color:"text-default",children:"No running games"}),Object.values(e).map(e=>(0,r.jsx)(o7,{trackedGame:e},e.pid))]})})})]})}),dc=o.memo(function(){let e=(0,d.bG)([oW.default],()=>oW.default.getForcedRenderMode()),[t,a]=o.useState(e),n=[{label:oB.V6.UNSET,value:oB.V6.UNSET,id:oB.V6.UNSET},{label:oB.V6.IN_PROCESS_V2,value:oB.V6.IN_PROCESS_V2,id:oB.V6.IN_PROCESS_V2},{label:oB.V6.OUT_OF_PROCESS_V3,value:oB.V6.OUT_OF_PROCESS_V3,id:oB.V6.OUT_OF_PROCESS_V3},{label:oB.V6.OUT_OF_PROCESS_V3_LIMITED_INTERACTION,value:oB.V6.OUT_OF_PROCESS_V3_LIMITED_INTERACTION,id:oB.V6.OUT_OF_PROCESS_V3_LIMITED_INTERACTION}].map(t=>({...t,label:`${t.label} ${e===t.value?"(current)":""}`}));return(0,r.jsx)(j.l,{label:"Override the overlay render mode",value:t,options:n,onSelectionChange:function(e){a(e),oP.A.forceRenderMode(e)},selectionMode:"single",fullWidth:!0})});function du(e){let{modalProps:t,onClose:a}=e,[n,l]=o.useState(null);function s(){a(null)}return(0,r.jsxs)(oD.EO,{size:oD.rI.LARGE,"aria-label":"Breadcrumb Import",...t,transitionState:t.transitionState,parentComponent:"BreadcrumbImportPanel",children:[(0,r.jsxs)(oD.rQ,{align:oG.A.Align.CENTER,justify:oG.A.Justify.BETWEEN,children:[(0,r.jsx)(p.E,{variant:"text-md/bold",color:"text-feedback-critical",children:"Breadcrumb Import"}),(0,r.jsx)(oD.s_,{onClick:s})]}),(0,r.jsx)(oD.$m,{children:(0,r.jsx)("div",{className:o3.st,children:(0,r.jsx)(oI.f,{label:"Paste JSON Here",onChange:l,value:n??"",rows:12})})}),(0,r.jsx)(oD.jl,{children:(0,r.jsxs)(a1.e,{direction:"horizontal-reverse",children:[(0,r.jsx)(x.$,{variant:"primary",text:"Import",onClick:function(){a(n)}}),(0,r.jsx)(x.$,{variant:"secondary",text:"Clear",onClick:s})]})})]})}let dm={native:{label:"Native",filter:e=>e.type===o$.ON.NativeLegacy||e.type===o$.ON.NativeOOP},render:{label:"Render",filter:e=>e.type===o$.ON.Renderer},flux:{label:"Flux",filter:e=>e.type===o$.ON.Flux},client:{label:"Client",filter:e=>e.type===o$.ON.OOPModule||e.type===o$.ON.LegacyModule}};function dh(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o$.QJ.Info;if(t===o$.QJ.Error)return"var(--text-feedback-critical)";switch(e){case o$.ON.NativeLegacy:return"var(--yellow-500)";case o$.ON.NativeOOP:return"var(--green-500)";case o$.ON.Flux:return"var(--brand-400)";case o$.ON.Renderer:return"var(--brand-500)";case o$.ON.LegacyModule:return"var(--yellow-300)";case o$.ON.OOPModule:return"var(--green-300)";default:return"var(--gray-400)"}}let dx=[{key:"type",cellClassName:o3.SZ,renderHeader:()=>null,render(e){let{type:t,logType:a}=e,n=dp(t);return(0,r.jsx)("div",{className:o3.g$,style:{color:dh(t,a)},children:(0,r.jsx)(n,{color:"currentColor",size:"sm"})})}},{key:"name",cellClassName:o3.Cm,render(e){let{name:t,type:a,logType:n}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(p.E,{variant:"text-md/normal",color:function(e){switch(e){case o$.QJ.Info:return"text-strong";case o$.QJ.Warning:return"text-feedback-warning";case o$.QJ.Error:return"text-feedback-critical";default:return"text-subtle"}}(n),children:t}),(0,r.jsxs)(p.E,{variant:"text-sm/normal",color:"text-subtle",children:["(",a,")"]})]})}},{key:"timestamp",cellClassName:o3.DK,render(e){let{timestamp:t}=e;return(0,nN.i$)(np()(t),"h:mm:ss.SSS")}}];function dp(e){switch(e){case o$.ON.NativeLegacy:return oT.W;case o$.ON.NativeOOP:return oR.q;case o$.ON.Renderer:case o$.ON.Flux:return oO.v;case o$.ON.LegacyModule:return ow.k;case o$.ON.OOPModule:return oM.o;default:return ow.k}}function dg(e){return JSON.stringify(e,(e,t)=>void 0===t?null:t,2)}let dv=["__webpack_require__","fn"],dj=["web.js","web.js.map"],df=[{id:"details",name:"Details",group:a0.fu.NONE,render:e=>{let{breadcrumb:t,onClose:a}=e,{name:n,type:l,logType:s,nativeId:i,stack:o,data:d,timestamp:c,pid:u}=t,m=np()(c),h=dp(l);return(0,r.jsxs)(g.Ar,{className:o3.bW,children:[(0,r.jsxs)(oF.A,{className:B()(t$.jr,o3.nZ),children:[(0,r.jsx)("div",{style:{color:dh(l,s)},className:o3.nr,children:(0,r.jsx)(h,{color:"currentColor",size:"sm"})}),(0,r.jsxs)(oF.A.Title,{wrapperClassName:o3.qd,children:[n," (",l,")",(0,r.jsx)($.D,{tag:"span",className:o3.KE,onClick:()=>(0,nS.C)(n),children:(0,r.jsx)(nv.T,{color:"currentColor",size:"sm"})})]}),(0,r.jsx)(oF.A.Icon,{icon:nv.T,tooltip:"Copy all properties",onClick:()=>{(0,nS.C)(dg(t))}}),(0,r.jsx)(oF.A.Icon,{icon:nf.a,tooltip:"Close",onClick:a})]}),(0,r.jsxs)(nP,{className:o3.ZK,children:[(0,r.jsx)(nU,{name:"Timestamp",copyValue:m.toISOString(),children:(0,r.jsx)("time",{dateTime:m.toISOString(),title:(0,nN.i$)(m,"LLLL"),children:(0,nN.i$)(m,"L h:mm:ss.SSS")})}),(0,r.jsx)(nU,{name:"Log Type",copyValue:s,children:(0,r.jsx)("code",{children:s})}),(0,r.jsx)(nU,{name:"PID",copyValue:u?.toString()??"null",children:(0,r.jsx)("code",{children:u?.toString()??"null"})}),(0,r.jsx)(nU,{name:"Native ID",copyValue:i?.toString()??"null",children:(0,r.jsx)("code",{children:i?.toString()??"null"})}),(0,r.jsx)(nU,{name:"Data",copyValue:dg(d),children:(0,r.jsx)("code",{children:dg(d)})}),null!=o&&(0,r.jsx)(nU,{name:"Stack Trace",copyValue:o,children:(0,r.jsx)("code",{children:o.split("\n").map((e,t)=>{let a=e.match(/at (.*) \((.*):(\d+):(\d+)\)/);if(null!=a){let[,e,n,l,s]=a,i=n.split(/[\\/]/).pop();return dv.includes(e.trim())?null:(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:o3.e0,children:e.trim()}),!dj.includes(i??"")&&(0,r.jsxs)(r.Fragment,{children:[" (",(0,r.jsxs)("span",{className:o3.lz,title:n,children:[i,":",l,":",s]}),")"]})]},t)}return(0,r.jsx)("div",{children:e},t)})})})]})]})}}],db={searchType:n_.n.REGEX,searchStringGenerator:e=>{let{name:t,type:a,stack:n,data:l}=e,s=[t,a,JSON.stringify(l)];return null!=n&&s.push(n),s},throttleMs:100};function dy(){let{ref:e,height:t}=(0,oU.Ay)(),a=(0,d.bG)([oK.A],()=>oK.A.isModuleLoggingEnabled()),[n,l]=o.useState(a),[s,i]=o.useState(!1),[c,u]=o.useState(null),[m,h]=o.useState(Object.keys(dm)),[x,g]=(0,d.bG)([oK.A],()=>oK.A.getOverlayLoggingBreadcrumbs(),[],oZ.D),[v,j]=o.useState(null),f=v??x,b=null!=v?-1:g;o.useEffect(()=>{0!==b&&(s?u(f.reduce((e,t)=>"game_tracking_starting"===t.name?Math.max(e,t.timestamp):e,0)):u(null))},[s,f,b]);let[y,E]=o.useState(""),_=o.useMemo(()=>0===b?[]:f.filter(e=>{if(s&&null!=c&&e.timestamp<c)return!1;for(let t of m){let{filter:a}=dm[t];if(a(e))return!0}return!1}),[f,m,c,s,b]),[C,S]=o.useState(_),[N,A]=o.useState(null),k=o.useMemo(()=>f.find(e=>e.key===N),[f,N]),D=o.useCallback(e=>{S(e)},[]),{renderSelectedTab:I}=(0,a0.Ay)({tabs:df},[]);(0,nC.RT)(y,_,D,db,[f]);let T=o.useCallback(e=>{l(e),oP.A.setModuleLogging(e)},[]),[R,O]=o.useState(!1),w=o.useRef(null),M=o.useCallback(()=>{(0,nS.C)(JSON.stringify(_)),O(!0)},[_]);o.useEffect(()=>{if(R)return w.current=setTimeout(()=>{O(!1)},4e3),()=>{null!=w.current&&clearTimeout(w.current)}},[R]);let L=o.useCallback(e=>{j(null!=e?JSON.parse(e):null)},[]),P=o.useCallback(e=>{if(e)return j(null);(0,eV.openModal)(e=>(0,r.jsx)(du,{modalProps:e,onClose:t=>{L(t),e.onClose()}}),{modalKey:"breadcrumb-import-panel"},ez.SY)},[L]);return(0,r.jsxs)("div",{ref:e,className:o3.rh,children:[(0,r.jsxs)("div",{className:o3.st,children:[(0,r.jsxs)("div",{className:B()(o3._V,o3.XQ),children:[(0,r.jsx)("div",{title:"Toggles the Polling of Native",className:o3.iR,children:(0,r.jsx)(r4.S,{label:"Poll Native",checked:n,onChange:e=>T(e)})}),(0,r.jsx)("div",{title:"Only show breadcrumbs for active games",className:o3.iR,children:(0,r.jsx)(r4.S,{label:"Only Active Games",checked:s,onChange:e=>i(e)})}),(0,r.jsxs)($.D,{className:o3.ny,onClick:M,children:[(0,r.jsx)(p.E,{variant:"text-sm/normal",color:"text-subtle",children:R?"Copied":"Copy All"}),R?(0,r.jsx)(oi.A,{size:"sm",color:eW.A.unsafe_rawColors.GREEN_330.css}):(0,r.jsx)(nv.T,{color:"currentColor",size:"sm"})]}),(0,r.jsx)($.D,{className:o3.ny,onClick:()=>P(null!=v),children:(0,r.jsx)(p.E,{variant:"text-sm/normal",color:"currentColor",children:null!=v?"Clear":"Import"})})]}),(0,r.jsx)("div",{className:B()(o3._V,o3.XQ),children:Object.entries(dm).map(e=>{let[t,a]=e;return(0,r.jsx)($.D,{className:B()(o3.pb,m.includes(t)&&o3.bx),onClick:()=>{h(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},children:(0,r.jsx)(p.E,{variant:"text-sm/normal",color:"currentColor",children:a.label})},t)})}),(0,r.jsx)("div",{className:o3._V,children:(0,r.jsx)(ny.I,{query:y,onChange:E,onClear:()=>E(""),placeholder:"Regex search by breadcrumb name and data"})})]}),(0,r.jsx)("div",{className:B()(o3.st,o3.CZ),children:(0,r.jsx)(tV,{columns:dx,data:C,selectedRowKey:N??void 0,onClickRow:e=>A(e.key)})}),null!=k&&(0,r.jsx)(aZ,{className:B()(o3.st,o3.rf),minHeight:100,initialHeight:null!=t?t/3:300,children:I({breadcrumb:k,onClose:()=>A(null)})})]})}let dE=o.memo(function(){let e=(0,d.bG)([oH.A],()=>oH.A.getPopoutInitializationStages());return(0,r.jsxs)("div",{className:o3.st,children:[(0,r.jsx)("div",{className:o3.Iv,children:(0,r.jsx)(p.E,{variant:"text-md/bold",color:"text-strong",children:"Popout Initialization Stages"})}),(0,r.jsx)(p.E,{variant:"text-sm/normal",color:"text-subtle",children:(0,r.jsx)("pre",{children:JSON.stringify(e,void 0,2)})})]})}),d_=o.memo(function(){let e=(0,d.bG)([oK.A],()=>oK.A.isStateDebuggingEnabled()),t=(0,d.bG)([oK.A],()=>oK.A.getDebuggingState());return o.useEffect(()=>(oP.A.setStateDebugging(!0),()=>{oP.A.setStateDebugging(!1)}),[]),(0,r.jsxs)("div",{className:o3.st,children:[(0,r.jsx)("div",{className:o3.Iv,children:(0,r.jsx)(m.d,{checked:e,onChange:()=>oP.A.setStateDebugging(!e),label:"Poll Native Module State"})}),(0,r.jsx)(p.E,{variant:"text-sm/normal",color:"text-subtle",children:(0,r.jsx)("pre",{children:JSON.stringify(t,void 0,2)})})]})});function dC(){return(0,r.jsx)(g.Ar,{children:(0,r.jsxs)("div",{className:B()(t$.nd,o3.rf),children:[(0,r.jsx)(dr,{}),(0,r.jsx)(dc,{}),(0,r.jsx)(dd,{}),(0,r.jsx)(ds,{}),(0,r.jsx)(da,{}),(0,r.jsx)(dl,{}),(0,r.jsx)(dE,{}),(0,r.jsx)(d_,{})]})})}function dS(e){switch(e){case"Disabled":return;case"False":return!1;case"True":return!0}}function dN(e){return null==e?"Disabled":e?"True":"False"}let dA=o.memo(function(){let e=(0,oV.wW)(),t=(0,d.bG)([oQ.Ay],()=>oQ.Ay.getOverlayKeybind());return(0,r.jsxs)("div",{className:o3.st,children:[(0,r.jsx)(H.D,{variant:"heading-lg/semibold",children:"Overlay Default Keybind Experiment"}),(0,r.jsx)(H.D,{variant:"heading-md/semibold",children:"Experiment State"}),(0,r.jsx)(p.E,{variant:"text-sm/normal",color:"text-subtle",children:(0,r.jsx)("pre",{children:JSON.stringify({...e,overlayKeybind:(0,o0.dI)(t.shortcut)},void 0,2)})}),(0,r.jsx)(H.D,{variant:"heading-md/semibold",children:"Overrides"}),(0,r.jsx)(j.l,{label:"Overlay User Status",description:"Override whether the current user was a new or existing user",value:dN(e.overrideIsNewOverlayUser),options:[{label:"Disabled (no override)",value:"Disabled",id:"Disabled"},{label:"Existing user",value:"False",id:"False"},{label:"New user",value:"True",id:"True"}],onSelectionChange:function(e){(0,oV.sw)(dS(e))},selectionMode:"single",fullWidth:!0}),(0,r.jsx)(j.l,{label:"Override Previous Keybind Status",description:"Override whether the user's pre-experiment keybind was the default keybind",value:dN(e.overrideIsUsingDefaultOverlayKeybind),options:[{label:"Disabled (no override)",value:"Disabled",id:"Disabled"},{label:"Using default keybind",value:"True",id:"True"},{label:"Not using default keybind",value:"False",id:"False"}],onSelectionChange:function(e){(0,oV.C3)(dS(e))},selectionMode:"single",fullWidth:!0}),(0,r.jsx)(H.D,{variant:"heading-md/semibold",children:"Actions"}),(0,r.jsx)(x.$,{size:"sm",text:"Reset isNewOverlayUser",onClick:()=>(0,oV.xc)()}),(0,r.jsx)(x.$,{size:"sm",text:"Reset isUsingDefaultOverlayKeybind",onClick:()=>(0,oV.tM)()})]})});function dk(){return(0,r.jsx)(g.Ar,{children:(0,r.jsx)("div",{className:B()(t$.nd,o3.rf),children:(0,r.jsx)(dA,{})})})}function dD(){let[e,t]=o.useState("state");return o.useEffect(()=>(tU.h.dispatch({type:"OVERLAY_SET_DETAILED_LOGGING",enabled:!0}),()=>{tU.h.dispatch({type:"OVERLAY_SET_DETAILED_LOGGING",enabled:!1})}),[]),(0,r.jsxs)("div",{className:B()(t$.nd,o3.nd),children:[(0,r.jsxs)("div",{className:o3._V,children:[(0,r.jsx)($.D,{className:B()(o3.k0,"state"===e&&o3.a),onClick:()=>t("state"),children:(0,r.jsx)(p.E,{variant:"text-md/medium",color:"currentColor",children:"Client State"})}),(0,r.jsx)($.D,{className:B()(o3.k0,"logging"===e&&o3.a),onClick:()=>t("logging"),children:(0,r.jsx)(p.E,{variant:"text-md/medium",color:"currentColor",children:"Logging"})}),(0,r.jsx)($.D,{className:B()(o3.k0,"experiments"===e&&o3.a),onClick:()=>t("experiments"),children:(0,r.jsx)(p.E,{variant:"text-md/medium",color:"currentColor",children:"Experiments"})})]}),"state"===e&&(0,r.jsx)(dC,{}),"logging"===e&&(0,r.jsx)(dy,{}),"experiments"===e&&(0,r.jsx)(dk,{})]})}var dI=a(876648);let dT={xbox_game_pass:"Xbox Game Pass"};function dR(e){return`/debug/partner-subs/${e}`}async function dO(){let{body:e}=await n6.Bo.get({url:"/debug/partner-subs",rejectWithError:!0});return e}async function dw(e,t){await n6.Bo.post({url:dR(e),body:t,rejectWithError:!0})}async function dM(e,t){await n6.Bo.del({url:dR(e),body:t,rejectWithError:!0})}function dL(e){let{active:t}=e;return(0,r.jsx)("span",{className:`${dI.Od} ${t?dI.xk:dI.kS}`,children:t?"Active":"Inactive"})}function dP(e){let{partner:t,connectedAccount:a,onChanged:n}=e,[l,s]=o.useState(!1),i={external_account_id:a.external_account_id},d=Object.keys(a.metadata).length>0;async function c(e){s(!0);try{await e()}finally{await n(),s(!1)}}return(0,r.jsxs)(W.B,{gap:8,className:dI.nM,children:[(0,r.jsxs)(W.B,{direction:"horizontal",align:"center",gap:12,children:[(0,r.jsx)("div",{className:dI.un,children:a.external_account_id}),(0,r.jsx)(dL,{active:a.is_active}),(0,r.jsxs)(W.B,{direction:"horizontal",gap:8,fullWidth:!1,className:dI.cm,children:[(0,r.jsx)(m.d,{label:"",checked:a.is_active,onChange:e=>c(()=>dw(t,{...i,is_active:e})),disabled:l}),(0,r.jsx)(x.$,{variant:"secondary",size:"sm",text:"Unlink",onClick:()=>c(()=>dM(t,i)),disabled:l})]})]}),d&&(0,r.jsx)("div",{className:dI.en,children:JSON.stringify(a.metadata)})]})}function dU(e){var t;let{listing:a,onChanged:n}=e,[l,s]=o.useState(""),[i,d]=o.useState(!0),[c,u]=o.useState(!1);async function h(){u(!0);try{let e={is_active:i},t=l.trim();""!==t&&(e.external_account_id=t),await dw(a.partner,e),s("")}finally{await n(),u(!1)}}return(0,r.jsxs)(W.B,{gap:12,className:dI.ns,children:[(0,r.jsxs)("div",{className:dI.CM,children:["Leave the id blank for a per-Discord-user default. Set the same id on multiple Discord accounts to test cross-account dedup of the ",dT[t=a.partner]??t," membership."]}),(0,r.jsx)(f.k,{label:"External account id",placeholder:a.default_external_account_id,value:l,onChange:s}),(0,r.jsx)(m.d,{label:"Active on link",checked:i,onChange:d}),(0,r.jsx)(W.B,{direction:"horizontal",justify:"start",children:(0,r.jsx)(x.$,{variant:"primary",size:"sm",text:"Link account",onClick:h,disabled:c})})]})}function dG(e){var t;let{listing:a,onChanged:n}=e;return(0,r.jsxs)(W.B,{gap:8,className:dI.Oy,children:[(0,r.jsx)(H.D,{variant:"heading-lg/semibold",children:dT[t=a.partner]??t}),(0,r.jsxs)(p.E,{variant:"text-sm/normal",color:"text-muted",children:["Backed by the ",(0,r.jsx)("code",{children:a.connection_type})," connected account."]}),(0,r.jsx)("div",{className:dI.U,children:"Linked accounts"}),0===a.connected_accounts.length?(0,r.jsx)("div",{className:dI.Ie,children:"None linked yet."}):a.connected_accounts.map(e=>(0,r.jsx)(dP,{partner:a.partner,connectedAccount:e,onChanged:n},e.connection_id)),(0,r.jsx)("div",{className:dI.U,children:"Link a new account"}),(0,r.jsx)(dU,{listing:a,onChanged:n})]})}function dF(){let[e,t]=o.useState([]),[a,n]=o.useState(null),l=o.useCallback(async()=>{try{let e=await dO();t(e),n(null)}catch(e){n(e instanceof Error?e.message:String(e))}},[]);return(0,ta.Ay)(()=>{l()}),(0,r.jsxs)(g.Ip,{className:B()(t$.nd,dI.kL),children:[(0,r.jsx)(H.D,{variant:"heading-lg/semibold",className:t$.wx,chil