PageSourceSearch

https://thephilosopher.ai/_next/static/chunks/app/register/page-a0…?dpl=dpl_GLLTCeQLTkuUwGj1vQiS4jZNGtC5

js thephilosopher.ai collected 2026-10-05 13:17:15 UTC 17,671 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[62454],{14294:(e,r,t)=>{"use strict";t.d(r,{A:()=>s});var n=t(12115);let a=function(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return r.filter((e,r,t)=>!!e&&""!==e.trim()&&t.indexOf(e)===r).join(" ").trim()};var o={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let i=(0,n.forwardRef)((e,r)=>{let{color:t="currentColor",size:i=24,strokeWidth:s=2,absoluteStrokeWidth:l,className:c="",children:u,iconNode:d,...m}=e;return(0,n.createElement)("svg",{ref:r,...o,width:i,height:i,stroke:t,strokeWidth:l?24*Number(s)/Number(i):s,className:a("lucide",c),...m},[...d.map(e=>{let[r,t]=e;return(0,n.createElement)(r,t)}),...Array.isArray(u)?u:[u]])}),s=(e,r)=>{let t=(0,n.forwardRef)((t,o)=>{let{className:s,...l}=t;return(0,n.createElement)(i,{ref:o,iconNode:r,className:a("lucide-".concat(e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),s),...l})});return t.displayName="".concat(e),t}},20063:(e,r,t)=>{"use strict";var n=t(47260);t.o(n,"useParams")&&t.d(r,{useParams:function(){return n.useParams}}),t.o(n,"usePathname")&&t.d(r,{usePathname:function(){return n.usePathname}}),t.o(n,"useRouter")&&t.d(r,{useRouter:function(){return n.useRouter}}),t.o(n,"useSearchParams")&&t.d(r,{useSearchParams:function(){return n.useSearchParams}})},24820:(e,r,t)=>{"use strict";t.d(r,{A:()=>n});let n=(0,t(14294).A)("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]])},27118:(e,r,t)=>{"use strict";t.d(r,{Xs:()=>g});var n=t(12115),a=t(95155),o=(0,n.forwardRef)((e,r)=>{let{as:t="div",...n}=e;return(0,a.jsx)(t,{...n,ref:r})});let i="onloadTurnstileCallback",s=e=>!!document.getElementById(e),l={normal:{width:300,height:65},compact:{width:150,height:140},invisible:{width:0,height:0,overflow:"hidden"},flexible:{minWidth:300,width:"100%",height:65},interactionOnly:{width:"fit-content",height:"auto",display:"flex"}},c="unloaded",u,d=new Promise((e,r)=>{u={resolve:e,reject:r},"ready"===c&&e(void 0)}),m=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i;return"unloaded"===c&&(c="loading",window[e]=()=>{u.resolve(),c="ready",delete window[e]}),d},g=(0,n.forwardRef)((e,r)=>{let{scriptOptions:t,options:u={},siteKey:d,onWidgetLoad:g,onSuccess:f,onExpire:h,onError:p,onBeforeInteractive:y,onAfterInteractive:x,onUnsupported:b,onTimeout:v,onLoadScript:w,id:k,style:N,as:j="div",injectScript:E=!0,rerenderOnCallbackChange:S=!1,...C}=e,T=u.size,A=(0,n.useCallback)(()=>void 0===T?{}:"execute"===u.execution?l.invisible:"interaction-only"===u.appearance?l.interactionOnly:l[T],[u.execution,T,u.appearance]),[I,P]=(0,n.useState)(A()),R=(0,n.useRef)(null),[O,F]=(0,n.useState)(!1),L=(0,n.useRef)(void 0),q=(0,n.useRef)(!1),B=k||"cf-turnstile",D=(0,n.useRef)({onSuccess:f,onError:p,onExpire:h,onBeforeInteractive:y,onAfterInteractive:x,onUnsupported:b,onTimeout:v});(0,n.useEffect)(()=>{S||(D.current={onSuccess:f,onError:p,onExpire:h,onBeforeInteractive:y,onAfterInteractive:x,onUnsupported:b,onTimeout:v})});let z=(null==t?void 0:t.id)||"cf-turnstile-script",_=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"cf-turnstile-script",[r,t]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{let r=()=>{s(e)&&t(!0)},n=new MutationObserver(r);return n.observe(document,{childList:!0,subtree:!0}),r(),()=>{n.disconnect()}},[e]),r}(z),U=(null==t?void 0:t.onLoadCallbackName)||"onloadTurnstileCallback",J=u.appearance||"always",M=(0,n.useMemo)(()=>{var e;return{sitekey:d,action:u.action,cData:u.cData,theme:u.theme||"auto",language:u.language||"auto",tabindex:u.tabIndex,"response-field":u.responseField,"response-field-name":u.responseFieldName,size:function(e){if("invisible"!==e&&"interactionOnly"!==e)return e}(T),retry:u.retry||"auto","retry-interval":u.retryInterval||8e3,"refresh-expired":u.refreshExpired||"auto","refresh-timeout":u.refreshTimeout||"auto",execution:u.execution||"render",appearance:u.appearance||"always","feedback-enabled":null==(e=u.feedbackEnabled)||e,callback:e=>{var r,t;q.current=!0,S?null==f||f(e):null==(r=(t=D.current).onSuccess)||r.call(t,e)},"error-callback":S?p:function(){for(var e,r,t=arguments.length,n=Array(t),a=0;a<t;a++)n[a]=arguments[a];return null==(e=(r=D.current).onError)?void 0:e.call(r,...n)},"expired-callback":S?h:function(){for(var e,r,t=arguments.length,n=Array(t),a=0;a<t;a++)n[a]=arguments[a];return null==(e=(r=D.current).onExpire)?void 0:e.call(r,...n)},"before-interactive-callback":S?y:function(){for(var e,r,t=arguments.length,n=Array(t),a=0;a<t;a++)n[a]=arguments[a];return null==(e=(r=D.current).onBeforeInteractive)?void 0:e.call(r,...n)},"after-interactive-callback":S?x:function(){for(var e,r,t=arguments.length,n=Array(t),a=0;a<t;a++)n[a]=arguments[a];return null==(e=(r=D.current).onAfterInteractive)?void 0:e.call(r,...n)},"unsupported-callback":S?b:function(){for(var e,r,t=arguments.length,n=Array(t),a=0;a<t;a++)n[a]=arguments[a];return null==(e=(r=D.current).onUnsupported)?void 0:e.call(r,...n)},"timeout-callback":S?v:function(){for(var e,r,t=arguments.length,n=Array(t),a=0;a<t;a++)n[a]=arguments[a];return null==(e=(r=D.current).onTimeout)?void 0:e.call(r,...n)}}},[u.action,u.appearance,u.cData,u.execution,u.language,u.refreshExpired,u.responseField,u.responseFieldName,u.retry,u.retryInterval,u.tabIndex,u.theme,u.feedbackEnabled,u.refreshTimeout,d,T,S,S?f:null,S?p:null,S?h:null,S?y:null,S?x:null,S?b:null,S?v:null]),W=(0,n.useCallback)(()=>"u">typeof window&&!!window.turnstile,[]);return(0,n.useEffect)(function(){E&&!O&&(m(U),(e=>{let{render:r="explicit",onLoadCallbackName:t=i,scriptOptions:{nonce:n="",defer:a=!0,async:o=!0,id:l="",appendTo:c,onError:u,crossOrigin:d=""}={}}=e,m=l||"cf-turnstile-script";if(s(m))return;let g=document.createElement("script");g.id=m,g.src="".concat("https://challenges.cloudflare.com/turnstile/v0/api.js","?onload=").concat(t,"&render=").concat(r),document.querySelector('script[src="'.concat(g.src,'"]'))||(g.defer=!!a,g.async=!!o,n&&(g.nonce=n),d&&(g.crossOrigin=d),u&&(g.onerror=u,delete window[t]),("body"===c?document.body:document.getElementsByTagName("head")[0]).appendChild(g))})({onLoadCallbackName:U,scriptOptions:{...t,id:z}}))},[E,O,t,z,U]),(0,n.useEffect)(function(){"ready"!==c&&m(U).then(()=>F(!0)).catch(console.error)},[U]),(0,n.useEffect)(function(){if(!R.current||!O)return;let e=!1;return(async()=>{e||!R.current||(L.current=window.turnstile.render(R.current,M),L.current&&(null==g||g(L.current)))})(),()=>{e=!0,L.current&&(window.turnstile.remove(L.current),q.current=!1)}},[B,O,M]),(0,n.useImperativeHandle)(r,()=>{let{turnstile:e}=window;return{getResponse:()=>(null==e?void 0:e.getResponse)&&L.current&&W()?e.getResponse(L.current):void console.warn("Turnstile has not been loaded"),async getResponsePromise(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e4,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return new Promise((t,n)=>{let a,o=async()=>
1{if(q.current&&window.turnstile&&L.current)try{let e=window.turnstile.getResponse(L.current);return a&&clearTimeout(a),e?t(e):n(Error("No response received"))}catch(e){return a&&clearTimeout(a),console.warn("Failed to get response",e),n(Error("Failed to get response"))}a||(a=setTimeout(()=>{a&&clearTimeout(a),n(Error("Timeout"))},e)),await new Promise(e=>setTimeout(e,r)),await o()};o()})},reset(){if(!(null==e?void 0:e.reset)||!L.current||!W())return void console.warn("Turnstile has not been loaded");"execute"===u.execution&&P(l.invisible);try{q.current=!1,e.reset(L.current)}catch(e){console.warn("Failed to reset Turnstile widget ".concat(L.current),e)}},remove(){if(!(null==e?void 0:e.remove)||!L.current||!W())return void console.warn("Turnstile has not been loaded");P(l.invisible),q.current=!1,e.remove(L.current),L.current=null},render(){if(!(null==e?void 0:e.render)||!R.current||!W()||L.current)return void console.warn("Turnstile has not been loaded or container not found");let r=e.render(R.current,M);return L.current=r,L.current&&(null==g||g(L.current)),"execute"!==u.execution&&P(T?l[T]:{}),r},execute:()=>"execute"!==u.execution?void console.warn('Execution mode is not set to "execute"'):(null==e?void 0:e.execute)&&R.current&&L.current&&W()?void(e.execute(R.current,M),P(T?l[T]:{})):void console.warn("Turnstile has not been loaded or container not found"),isExpired:()=>(null==e?void 0:e.isExpired)&&L.current&&W()?e.isExpired(L.current):(console.warn("Turnstile has not been loaded"),!1)}},[L,u.execution,T,M,R,W,O,g]),(0,n.useEffect)(()=>{if(O||!_)return;if(window.turnstile)return void F(!0);let e=setInterval(()=>{window.turnstile&&(F(!0),clearInterval(e))},50);return()=>{clearInterval(e)}},[O,_]),(0,n.useEffect)(()=>{P(A())},[u.execution,T,J]),(0,n.useEffect)(()=>{_&&"function"==typeof w&&w()},[_]),(0,a.jsx)(o,{ref:R,as:j,id:B,style:{...I,...N},...C})});g.displayName="Turnstile"},64301:(e,r,t)=>{Promise.resolve().then(t.bind(t,99267))},92678:(e,r,t)=>{"use strict";t.d(r,{A:()=>n});let n=(0,t(14294).A)("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]])},99267:(e,r,t)=>{"use strict";t.d(r,{default:()=>m});var n=t(95155),a=t(12115),o=t(20063),i=t(52619),s=t.n(i),l=t(36489),c=t(27118),u=t(24820),d=t(92678);function m(){let[e,r]=(0,a.useState)(""),[t,i]=(0,a.useState)(""),[m,g]=(0,a.useState)(""),[f,h]=(0,a.useState)(""),[p,y]=(0,a.useState)(""),[x,b]=(0,a.useState)(""),[v,w]=(0,a.useState)(!1),[k,N]=(0,a.useState)(!0),[j,E]=(0,a.useState)(null),S=(0,a.useRef)(null),[C,T]=(0,a.useState)(!1),[A,I]=(0,a.useState)(null),[P,R]=(0,a.useState)("I have read and agree to the Terms of Service. I understand that abusing the philosophers or other users will result in a lifetime ban without refund."),O=(0,o.useRouter)(),{data:F,status:L}=(0,l.useSession)(),q="0x4AAAAAAC0diO1hz2XuJ07z";(0,a.useEffect)(()=>{(async()=>{try{let e=await fetch("/api/auth/check-database"),r=await e.json();N(r.isDatabaseConfigured)}catch(e){N(!1)}})()},[]),(0,a.useEffect)(()=>{let e=!1;return(async()=>{try{let r=await fetch("/api/auth/tos-consent-text");if(!r.ok)return;let t=await r.json();!e&&"string"==typeof(null==t?void 0:t.text)&&t.text.trim().length>0&&R(t.text)}catch(e){}})(),()=>{e=!0}},[]);let B=async r=>{if(r.preventDefault(),b(""),m!==f)return void b("Passwords do not match");if(!C)return void b("You must agree to the Terms of Service to register");w(!0);try{let r=await fetch("/api/auth/register",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e,email:t,password:m,invitationCode:p,turnstileToken:j,agreedToTos:C,consentToTermsAt:A})}),n=await r.json();if(!r.ok)throw Error(n.error||"Failed to register");sessionStorage.setItem("pendingVerificationEmail",t.trim().toLowerCase()),O.push(!1===n.verificationEmailSent?"/verify-email?delivery=failed":"/verify-email")}catch(e){var n;b(e instanceof Error?e.message:"Failed to create account"),null==(n=S.current)||n.reset(),E(null)}finally{w(!1)}};return(0,n.jsxs)("div",{className:"mx-auto max-w-md space-y-6 p-6",children:[(0,n.jsxs)("div",{className:"space-y-2 text-center",children:[(0,n.jsx)("h1",{className:"text-3xl font-bold",children:"Create an account"}),(0,n.jsx)("p",{className:"text-gray-600 dark:text-gray-400",children:"Join our community of philosophical thinkers"})]}),!k&&(0,n.jsxs)("div",{className:"rounded-md bg-yellow-50 p-4 text-sm text-yellow-800 dark:bg-yellow-900/50 dark:text-yellow-200",children:[(0,n.jsx)("p",{className:"font-medium",children:"Database Not Configured"}),(0,n.jsx)("p",{className:"mt-1",children:"The database connection is not properly configured. Registration is currently disabled. Please contact the administrator to resolve this issue."})]}),(0,n.jsxs)("form",{onSubmit:B,className:"space-y-4 ".concat(k?""
1:"opacity-60 pointer-events-none"),children:[x&&(0,n.jsx)("div",{className:"rounded-md bg-red-50 p-4 text-sm text-red-500 dark:bg-red-900/50",children:x}),(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)("label",{htmlFor:"name",className:"text-sm font-medium leading-none text-gray-900 dark:text-gray-100",children:"Name"}),(0,n.jsx)("input",{id:"name",type:"text",className:"flex h-10 w-full rounded-md border-2 border-gray-200/20 dark:border-gray-700/50 bg-white dark:bg-black px-3 py-2 text-sm text-gray-900 dark:text-gray-100 ring-1 ring-gray-900/10 dark:ring-gray-700/50 placeholder:text-gray-500 dark:placeholder:text-gray-400 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500/50 disabled:cursor-not-allowed disabled:opacity-50",placeholder:"John Doe",value:e,onChange:e=>r(e.target.value),required:!0})]}),(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)("label",{htmlFor:"email",className:"text-sm font-medium leading-none text-gray-900 dark:text-gray-100",children:"Email"}),(0,n.jsx)("input",{id:"email",type:"email",autoComplete:"email",inputMode:"email",className:"flex h-10 w-full rounded-md border-2 border-gray-200/20 dark:border-gray-700/50 bg-white dark:bg-black px-3 py-2 text-base sm:text-sm text-gray-900 dark:text-gray-100 ring-1 ring-gray-900/10 dark:ring-gray-700/50 placeholder:text-gray-500 dark:placeholder:text-gray-400 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500/50 disabled:cursor-not-allowed disabled:opacity-50",placeholder:"[email protected]",value:t,onChange:e=>i(e.target.value),required:!0})]}),(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)("label",{htmlFor:"password",className:"text-sm font-medium leading-none text-gray-900 dark:text-gray-100",children:"Password"}),(0,n.jsx)("input",{id:"password",type:"password",autoComplete:"new-password",className:"flex h-10 w-full rounded-md border-2 border-gray-200/20 dark:border-gray-700/50 bg-white dark:bg-black px-3 py-2 text-base sm:text-sm text-gray-900 dark:text-gray-100 ring-1 ring-gray-900/10 dark:ring-gray-700/50 placeholder:text-gray-500 dark:placeholder:text-gray-400 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500/50 disabled:cursor-not-allowed disabled:opacity-50",value:m,onChange:e=>g(e.target.value),required:!0}),(0,n.jsx)("p",{className:"text-xs text-gray-500",children:"Use 8–72 bytes with uppercase and lowercase letters, a number, and a symbol."})]}),(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)("label",{htmlFor:"confirmPassword",className:"text-sm font-medium leading-none text-gray-900 dark:text-gray-100",children:"Confirm Password"}),(0,n.jsx)("input",{id:"confirmPassword",type:"password",autoComplete:"new-password",className:"flex h-10 w-full rounded-md border-2 border-gray-200/20 dark:border-gray-700/50 bg-white dark:bg-black px-3 py-2 text-base sm:text-sm text-gray-900 dark:text-gray-100 ring-1 ring-gray-900/10 dark:ring-gray-700/50 placeholder:text-gray-500 dark:placeholder:text-gray-400 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500/50 disabled:cursor-not-allowed disabled:opacity-50",value:f,onChange:e=>h(e.target.value),required:!0})]}),(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)("label",{htmlFor:"invitationCode",className:"text-sm font-medium leading-none text-gray-900 dark:text-gray-100",children:"Invitation Code"}),(0,n.jsx)("input",{id:"invitationCode",type:"text",className:"flex h-10 w-full rounded-md border-2 border-gray-200/20 dark:border-gray-700/50 bg-white dark:bg-black px-3 py-2 text-sm text-gray-900 dark:text-gray-100 ring-1 ring-gray-900/10 dark:ring-gray-700/50 placeholder:text-gray-500 dark:placeholder:text-gray-400 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500/50 disabled:cursor-not-allowed disabled:opacity-50",placeholder:"Enter your invitation code",value:p,onChange:e=>y(e.target.value),required:!0})]}),q&&(0,n.jsx)(c.Xs,{ref:S,siteKey:q,onSuccess:E,options:{theme:"auto"}}),(0,n.jsx)("div",{className:"space-y-2",children:(0,n.jsxs)("button",{type:"button",onClick:()=>{T(e=>{let r=!e;return I(r?new Date().toISOString():null),r})},"aria-checked":C,role:"checkbox",className:"flex w-full items-start gap-3 rounded-md border-2 border-gray-200/20 dark:border-gray-700/50 bg-white dark:bg-black p-3 text-left text-sm text-gray-900 dark:text-gray-100 ring-1 ring-gray-900/10 dark:ring-gray-700/50 hover:bg-gray-50 dark:hover:bg-gray-900 focus:outline-none focus:ring-2 focus:ring-blue-500/50",children:[(0,n.jsx)("span",{className:"mt-0.5 flex-shrink-0 text-primary",children:C?(0,n.jsx)(u.A,{className:"h-5 w-5","aria-hidden":"true"}):(0,n.jsx)(d.A,{className:"h-5 w-5","aria-hidden":"true"})}),(0,n.jsxs)("span",{className:"leading-snug",children:[P," ",(0,n.jsx)(s(),{href:"/terms",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),className:"text-primary underline-offset-4 hover:underline",children:"Read the full Terms"}),"."]})]})}),(0,n.jsx)("button",{type:"submit",className:"inline-flex w-full items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",disabled:v||!k||!C,children:v?"Creating account...":"Create account"})]}),(0,n.jsxs)("div",{className:"text-center text-sm text-gray-600 dark:text-gray-400",children:["Already have an account?"," ",(0,n.jsx)(s(),{href:"/login",className:"text-primary underline-offset-4 hover:underline",children:"Sign in"})]})]})}}},e=>{e.O(0,[36489,52619,28441,31255,77358],()=>e(e.s=64301)),_N_E=e.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.