1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[277],{9344:function(a,b,c){(window.__NEXT_P=window.__NEXT_P||[]).push(["/profile",function(){return c(8812)}])},8812:function(a,b,c){"use strict";c.r(b),c.d(b,{default:function(){return q}});var d=c(7568),e=c(4051),f=c.n(e),g=c(5893),h=c(5400),i=c(3683),j=c(5829),k=c.n(j),l=c(1664),m=c.n(l),n=c(8100),o=c(7294),p=c(4461);function q(a){var b=(0,i.Ek)("/profile"),c=b.data;b.error;var e,j=(0,o.useState)(!1),l=j[0],q=j[1],r=(0,n.kY)().mutate,s=(e=(0,d.Z)(f().mark(function a(b){var c,d;return f().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return b.preventDefault(),c={displayname:b.target.displayname.value,allowemails:b.target.allowemails.checked,repourl:b.target.repourl.value},q(!0),a.next=5,(0,i.sg)("/profile",c);case 5:d=a.sent,setTimeout(function(){return q(!1)},500),d&&"ok"==d.status?r((0,i.JW)("/profile")):(alert("error"),console.log(d));case 8:case"end":return a.stop()}},a)})),function(a){return e.apply(this,arguments)});return c&&c.logged_in?(0,g.jsxs)(h.Z,{title:"Profile",narrow:!0,children:[(0,g.jsx)("h1",{children:"Profile"}),(0,g.jsxs)("form",{onSubmit:s,className:k().form,children:[(0,g.jsx)("label",{htmlFor:"displayname",children:"Display name:"}),(0,g.jsx)("br",{}),(0,g.jsx)("input",{className:k().forminput,type:"text",id:"displayname",name:"displayname",defaultValue:c?c.displayname:"nobody",required:!0}),(0,g.jsx)("label",{htmlFor:"repourl",children:"Repo URL (e.g. github):"}),(0,g.jsx)("br",{}),(0,g.jsx)("input",{className:"",type:"text",id:"repourl",name:"repourl",defaultValue:c?c.repourl:""}),(0,g.jsx)("small",{className:k().light,children:"Optional, will be linked from your name on leaderboards."}),(0,g.jsxs)("p",{children:["Email address: ",(0,g.jsx)("b",{children:c&&c.email||"<none>"})]}),(0,g.jsx)("input",{type:"checkbox",id:"allowemails",name:"allowemails",defaultChecked:!!c&&!!c.allowemails}),(0,g.jsxs)("label",{htmlFor:"allowemails",children:["Receive emails about Protohackers",(0,g.jsx)("br",{}),(0,g.jsx)("small",{className:k().light,children:"You'll receive authentication emails regardless, and we won't share your email address with any third parties."})]}),(0,g.jsx)("br",{}),(0,g.jsx)("br",{}),(0,g.jsx)("br",{}),(0,g.jsx)(p.Z,{loading:l,children:(0,g.jsx)("button",{type:"submit",children:"Update profile"})})]}),(0,g.jsx)("br",{}),(0,g.jsx)("br",{}),(0,g.jsx)("p",{className:k().light,children:(0,g.jsxs)("small",{children:["If you wish to change your email address or delete your account, please email ",(0,g.jsx)("a",{href:"mailto:[email protected]",children:"[email protected]"})," and I'll try to help you."]})})]}):(0,g.jsxs)(h.Z,{title:"Profile",narrow:!0,children:[(0,g.jsx)("h1",{children:"Profile"}),(0,g.jsxs)("p",{children:[(0,g.jsx)("b",{children:"You're not logged in."})," Would you like to ",(0,g.jsx)(m(),{href:"/login",children:"log in"}),"?"]})]})}}},function(a){a.O(0,[770,118,16,774,888,179],function(){var b;return a(a.s=9344)}),_N_E=a.O()}])
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.