PageSourceSearch

https://www.codechef.com/build/react2/assets/UserDeletionPage-BH30KElG.js

js codechef.com collected 2026-09-24 08:54:25 UTC 4,943 bytes, 7 lines download raw bytes

1import{r,a3 as a,a2 as p,Z as e}from"./vendor-mui-D5pLRgDb.js";import{S as R}from"./vendor-sweetalert2-CokzRhbv.js";import{U as A,A as f,d as k,e as $,T as H,B as g,g as s,n as w,v as L,M as y,a as O}from"./index-BSFWpFMK.js";import{B as b}from"./BreadCrumbs-Ce1rw5PH.js";import{D as E}from"./DataTable-cROclEAW.js";import"./__commonjsHelpers__-BosuxZz1.js";import"./vendor-mui-datatables-CtAfvKRw.js";import"./index.es-CLmToPHp.js";import"./Select-BphtUsk_.js";import"./InputFields-BJUL-RVv.js";import"./CheckBox-Dkb41L1G.js";const v=()=>[{link:"/",name:"Home"},{link:null,name:"User Deletion Portal"}],I="_container_1dc04_1",Y="_text_1dc04_8",j="_paragraph_1dc04_14",W="_headerCell_1dc04_18",o={container:I,text:Y,paragraph:j,headerCell:W};function te(){const C=r.useContext(A),{state:x,dispatch:l}=C,{userData:d}=x,[i,D]=r.useState([]),[h,u]=r.useState([]),[m,_]=r.useState(!1);r.useEffect(()=>{(async()=>{try{const t=await f.get("api/accounts/multiple");D(t.data.data),await l(k("User Deletion Portal"))}catch(t){await l($(t))}finally{await l(H(!1))}})()},[]);const S=[{label:"Username",name:"user_handle",options:{customBodyRender:n=>e("div",{style:{textAlign:"left",overflow:"hidden",textOverflow:"ellipsis"},children:e(w,{href:`${s()}/users/${n}`,value:n,newTab:!0})}),setCellHeaderProps:()=>({className:o.headerCell})}},{label:"Rating",name:"rating"},{label:"Stars",name:"star"},{label:"Created On",name:"created"},{label:"Last Log In",name:"last_login",options:{sortDirection:"desc"}},{label:"Contests Participated",name:"contests_participated"},{label:"Problems Solved",name:"problems_solved"}],P=(n,t)=>{t.length!==0?u(t[0]):u([])},T=async n=>{n.preventDefault();const t=i[h.dataIndex].user_handle;let c="";t!==d.user.username&&(c='<div style="color: red"><br />Note: You have selected the account from which you are currently logged in, to be deleted. You will be logged out once you confirm.</div>'),R.fire({html:`<div style="text-align: left">
2                    Please confirm that you have selected the following username to retain:
3                    <br /><br /><b>${t}</b><br /><br />
4                    All other accounts will be deleted. In case you need any further help, drop an email to
5                    <a href="mailto:[email protected]">[email protected]</a>.
6                    ${c}
7                </div>`,icon:"warning",showCancelButton:!1,showCloseButton:!0,confirmButtonText:"Confirm"}).then(async N=>{if(N.value){await l(y(!0,"ajax"));try{await f.post("api/accounts/multiple",{user_handle:t}),c===""?_(!0):window.location.href=`${s()}/`}catch(U){O(U)}finally{await l(y(!1))}}})},B={selectableRows:"single",download:!1,viewColumns:!1,filter:!1,searchOpen:!1,selectableRowsOnClick:!0,onRowSelectionChange:P,selectToolbarPlacement:"none"};return m||i.length<2?a(p,{children:[e(b,{data:v()}),a("div",{className:o.container,children:[a("div",{className:o.text,children:[e("div",{className:o.paragraph,children:m?e("div",{children:"Congratulations! You have deleted the other account(s) associated with the e-mail of this account."}):e("div",{children:"Congratulations! We did not find any other account associated with the e-mail of this account."})}),"Thank you for not having multiple accounts and adhering to our Code of Conduct. You can now solve some delicious problems in our"," ",e("b",{children:"Practice"})," ","section, or check the amazing"," ",e("b",{children:"Upcoming Contests"}),"."]}),a("div",{style:{display:"flex"},children:[e(g,{defaultStyles:{marginLeft:"20px"},title:"Go to Practice",type:"primary",handleClick:()=>{window.location.href="/practice"}}),e(g,{defaultStyles:{marginLeft:"auto",marginRight:"20px"},title:"See Upcoming Contests",type:"primary",handleClick:()=>{window.location.href=`${s()}/contests`}})]})]})]}):a(p,{children:[e(b,{data:v()}),a("form",{className:o.container,onSubmit:T,children:[a("div",{className:o.text,children:[a("div",{className:o.paragraph,children:["Hey"," ",e("b",{children:d.user.username}),","]}),a("div",{className:o.paragraph,children:["We have found the following account(s) that have been created with the same e-mail as that of your current account. As you might be aware, having multiple accounts on CodeChef is against the"," ",e(w,{href:`${s()}/codeofconduct`,value:"Code of Conduct",newTab:!0})," ","and may even lead to a permanent ban of all your accounts."]}),e("div",{className:o.paragraph,children:"But do not worry, we will help you in getting rid of your other account(s). Please select one account from the list below which you want to retain. All other accounts will be deleted."}),a("div",{className:o.paragraph,children:["For any help or support, please drop an email to"," ",e("a",{href:"mailto:[email protected]",children:"[email protected]"}),"."]})]}),e(E,{columns:S,data:i,options:B}),e(L,{title:"Delete all unselected accounts",type:"primary",defaultStyles:{margin:"20px"},disabled:h.length<1})]})]})}export{te as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.