Files
Nexus_Mat/.next/static/chunks/pages/auth/register-7764882a4d5e8b33.js

11 lines
4.9 KiB
JavaScript

(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[461],{5977:function(e,t,s){"use strict";s.d(t,{Z:function(){return r}});/**
* @license lucide-react v0.344.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/let r=(0,s(4297).Z)("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]])},6659:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/auth/register",function(){return s(1291)}])},1291:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return m}});var r=s(5893),a=s(7294),n=s(1664),o=s.n(n),l=s(1163),i=s(4009),c=s(5977);/**
* @license lucide-react v0.344.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/let d=(0,s(4297).Z)("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);var x=s(9008),u=s.n(x);function m(){let e=(0,l.useRouter)(),[t,s]=(0,a.useState)(!1),[n,x]=(0,a.useState)(""),m=async t=>{t.preventDefault(),s(!0),x("");let r=new FormData(t.currentTarget),a=r.get("username"),n=r.get("password");if(n!==r.get("confirmPassword")){x("Passwords do not match"),s(!1);return}try{let t=await fetch("/api/v1/auth/register",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:a,password:n})}),s=await t.json();s.success?(localStorage.setItem("NEXUS_DATA_MODE","REAL"),e.push("/")):x(s.error||"Registration failed")}catch(e){x("Network error. Please try again.")}finally{s(!1)}};return(0,r.jsxs)("div",{className:"min-h-screen flex items-center justify-center relative overflow-hidden bg-[#020202]",children:[(0,r.jsx)(u(),{children:(0,r.jsx)("title",{children:"NEXUS_MAT.OS"})}),(0,r.jsx)("div",{className:"absolute inset-0 bg-[url('https://grainy-gradients.vercel.app/noise.svg')] opacity-20"}),(0,r.jsx)("div",{className:"absolute bottom-0 right-0 w-[600px] h-[600px] bg-cyber-pink/5 rounded-full blur-[100px] pointer-events-none"}),(0,r.jsxs)("div",{className:"w-full max-w-lg p-8 relative z-10",children:[(0,r.jsxs)("div",{className:"mb-8 text-center",children:[(0,r.jsx)("h1",{className:"text-3xl font-mono font-bold text-white mb-2",children:"JOIN_NETWORK"}),(0,r.jsx)("p",{className:"text-xs text-gray-500 font-mono",children:"ESTABLISH NEW NEURAL LINK"})]}),(0,r.jsxs)("div",{className:"bg-cyber-panel/40 backdrop-blur-md border border-white/10 p-8 rounded-lg shadow-2xl",children:[(0,r.jsxs)("form",{onSubmit:m,className:"space-y-4",children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)("label",{className:"text-[10px] font-mono text-gray-400",children:"USERNAME"}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("input",{name:"username",type:"text",className:"w-full bg-black/50 border border-gray-800 focus:border-cyber-pink text-white p-2.5 pl-8 rounded-sm outline-none font-mono text-sm",required:!0}),(0,r.jsx)(i.Z,{className:"absolute left-2.5 top-3 text-gray-600 w-3 h-3"})]})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)("label",{className:"text-[10px] font-mono text-gray-400",children:"PASSWORD"}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("input",{name:"password",type:"password",className:"w-full bg-black/50 border border-gray-800 focus:border-cyber-pink text-white p-2.5 pl-8 rounded-sm outline-none font-mono text-sm",required:!0}),(0,r.jsx)(c.Z,{className:"absolute left-2.5 top-3 text-gray-600 w-3 h-3"})]})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)("label",{className:"text-[10px] font-mono text-gray-400",children:"CONFIRM_PASSWORD"}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("input",{name:"confirmPassword",type:"password",className:"w-full bg-black/50 border border-gray-800 focus:border-cyber-pink text-white p-2.5 pl-8 rounded-sm outline-none font-mono text-sm",required:!0}),(0,r.jsx)(d,{className:"absolute left-2.5 top-3 text-gray-600 w-3 h-3"})]})]}),n&&(0,r.jsx)("div",{className:"bg-red-900/20 border border-red-500 text-red-500 p-3 rounded text-xs font-mono",children:n}),(0,r.jsx)("button",{type:"submit",disabled:t,className:"w-full bg-cyber-pink text-white font-bold py-3 mt-4 hover:bg-white hover:text-black transition-colors font-mono uppercase tracking-wider shadow-[0_0_15px_rgba(255,0,85,0.3)]",children:t?"PROCESSING...":"CREATE_ACCOUNT"})]}),(0,r.jsxs)("div",{className:"mt-6 text-center text-xs font-mono text-gray-500",children:["ALREADY LINKED? ",(0,r.jsx)(o(),{href:"/auth/login",className:"text-cyber-pink hover:underline",children:"ACCESS_TERMINAL"})]})]})]})]})}},1163:function(e,t,s){e.exports=s(3035)}},function(e){e.O(0,[605,888,774,179],function(){return e(e.s=6659)}),_N_E=e.O()}]);