(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[879],{7077:(e,a,s)=>{Promise.resolve().then(s.bind(s,8111)),Promise.resolve().then(s.bind(s,8431))},8111:(e,a,s)=>{"use strict";s.d(a,{As:()=>d,AuthShell:()=>u});var t=s(5155),n=s(8173),r=s.n(n);let i="AI Trading Coach";function l(){return(0,t.jsxs)(r(),{href:"/workspace",className:"auth-brand","aria-label":i,children:[(0,t.jsx)("div",{className:"brand-mark","aria-hidden":"true",children:"AI"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"brand-name",children:i}),(0,t.jsx)("div",{className:"brand-sub",children:"Discretionary trading, refined."})]})]})}function c(e){let{rightLink:a}=e;return(0,t.jsxs)("header",{className:"auth-topbar",children:[(0,t.jsx)(l,{}),(0,t.jsx)("span",{className:"topbar-spacer"}),a&&(0,t.jsxs)(r(),{className:"topbar-link",href:a.href,children:[a.label," →"]})]})}function o(){return(0,t.jsxs)("footer",{className:"auth-footer",children:[(0,t.jsx)("span",{children:"\xa9 2026 aitrading.coach"}),(0,t.jsx)("span",{className:"sep",children:"\xb7"}),(0,t.jsx)(r(),{href:"/legal/privacy",children:"Privacy"}),(0,t.jsx)("span",{className:"sep",children:"\xb7"}),(0,t.jsx)(r(),{href:"/legal/terms",children:"Terms"}),(0,t.jsx)("span",{className:"sep",children:"\xb7"}),(0,t.jsxs)("a",{href:"https://status.aitrading.coach",target:"_blank",rel:"noreferrer",children:[(0,t.jsx)("span",{className:"status-dot"}),"Status \xb7 all systems normal"]}),(0,t.jsx)("span",{className:"spacer"}),(0,t.jsx)("span",{children:"v1.4.2"})]})}function d(){return(0,t.jsxs)("span",{className:"trust-pill",children:[(0,t.jsx)("span",{className:"dot"}),"MT5 EA \xb7 ",(0,t.jsx)("strong",{children:"authenticated"})," \xb7 14ms"]})}function h(){return(0,t.jsxs)("div",{className:"auth-illust",style:{flexDirection:"column",gap:24},children:[(0,t.jsxs)("div",{style:{fontFamily:"var(--font-mono)",fontSize:9.5,textTransform:"uppercase",letterSpacing:"0.2em",color:"var(--accent)"},children:["\xa7 ",i]}),(0,t.jsxs)("div",{style:{fontFamily:"var(--font-display)",fontSize:38,lineHeight:1.1,letterSpacing:"-0.025em",color:"var(--ink)",maxWidth:380,fontWeight:400},children:["An AI coach that ",(0,t.jsx)("em",{style:{color:"var(--accent-2)"},children:"draws"})," on your chart."]}),(0,t.jsx)("div",{style:{fontFamily:"var(--font-display)",fontStyle:"italic",fontSize:16,color:"var(--ink-3)",maxWidth:380,lineHeight:1.55,fontWeight:350},children:"Discretionary trading, refined. Mark supply zones, FVG, and Wyckoff phases — without leaving the chart."}),(0,t.jsx)("div",{style:{marginTop:20},children:(0,t.jsx)(d,{})})]})}function u(e){let{children:a,rightLink:s}=e;return(0,t.jsxs)("div",{className:"auth-page",children:[(0,t.jsx)(c,{rightLink:s}),(0,t.jsxs)("main",{className:"auth-main",children:[(0,t.jsx)(h,{}),a]}),(0,t.jsx)(o,{})]})}},4529:(e,a,s)=>{"use strict";s.d(a,{X:()=>r});var t=s(5155),n=s(302);function r(e){let{password:a}=e,s=(0,n.n)(a);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"strength s".concat(s),"aria-hidden":"true",children:[(0,t.jsx)("span",{className:"strength-bar"}),(0,t.jsx)("span",{className:"strength-bar"}),(0,t.jsx)("span",{className:"strength-bar"}),(0,t.jsx)("span",{className:"strength-bar"})]}),(0,t.jsxs)("div",{className:"strength-label",children:[(0,t.jsx)("span",{children:"Password strength"}),(0,t.jsx)("span",{className:"level",children:n.a[s]})]})]})}},8431:(e,a,s)=>{"use strict";s.d(a,{SignupForm:()=>h});var t=s(5155),n=s(2115),r=s(8173),i=s.n(r),l=s(3745),c=s(1069),o=s(302),d=s(4529);function h(){let{signup:e}=(0,c.A)(),[a,s]=(0,n.useState)(""),[r,h]=(0,n.useState)(""),[u,m]=(0,n.useState)(!1),[p,x]=(0,n.useState)(!1),[g,f]=(0,n.useState)(null),[j,v]=(0,n.useState)(!1),y=(0,o.n)(r),b=!p&&/\S+@\S+\.\S+/.test(a.trim())&&r.length>=10&&y>=2&&u,N=async s=>{if(s.preventDefault(),b){f(null),x(!0);try{await e({email:a.trim(),password:r}),v(!0)}catch(e){f(e instanceof l.UJ?Array.isArray(e.body.message)?e.body.message.join("; "):e.body.message:"Something went wrong. Try again.")}finally{x(!1)}}};return(0,t.jsxs)("form",{className:"auth-card",onSubmit:N,noValidate:!0,children:[(0,t.jsxs)("div",{className:"auth-eyebrow",children:[(0,t.jsx)("span",{className:"sigil","aria-hidden":"true",children:"\xa7"})," Create account"]}),(0,t.jsxs)("h1",{className:"auth-title",children:["Begin ",(0,t.jsx)("em",{children:"trading"})," with a coach."]}),(0,t.jsx)("p",{className:"auth-sub",children:"Two minutes to a chart marked by an AI."}),(0,t.jsxs)("div",{className:"pricing-chip",children:[(0,t.jsx)("span",{className:"free",children:"14 days free"}),(0,t.jsx)("span",{className:"sep","aria-hidden":"true",children:"\xb7"}),(0,t.jsx)("span",{className:"price",children:"then $19/mo \xb7 cancel anytime"})]}),j?(0,t.jsxs)("div",{className:"alert alert-success",role:"status",children:[(0,t.jsx)("span",{className:"alert-icon","aria-hidden":"true",children:"✓"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("strong",{children:"Check your email."}),(0,t.jsx)("br",{}),"We sent a verification link to"," ",(0,t.jsx)("span",{style:{color:"var(--ink)"},children:a.trim()}),". Click it to continue."]})]}):(0,t.jsxs)(t.Fragment,{children:[g&&(0,t.jsxs)("div",{className:"alert alert-error",role:"alert",children:[(0,t.jsx)("span",{className:"alert-icon","aria-hidden":"true",children:"!"}),(0,t.jsx)("div",{children:g})]}),(0,t.jsxs)("div",{className:"field",children:[(0,t.jsx)("label",{className:"field-label",htmlFor:"signup-email",children:"Email"}),(0,t.jsx)("input",{id:"signup-email",className:"input",type:"email",autoComplete:"email",placeholder:"you@studio.fx",required:!0,value:a,onChange:e=>s(e.target.value),disabled:p})]}),(0,t.jsxs)("div",{className:"field",children:[(0,t.jsxs)("label",{className:"field-label",htmlFor:"signup-password",children:["Password",(0,t.jsx)("span",{className:"helper",children:"10+ chars \xb7 mix of upper, lower, number"})]}),(0,t.jsx)("input",{id:"signup-password",className:"input",type:"password",autoComplete:"new-password",placeholder:"A strong password",required:!0,minLength:10,value:r,onChange:e=>h(e.target.value),disabled:p}),(0,t.jsx)(d.X,{password:r})]}),(0,t.jsxs)("label",{className:"check",children:[(0,t.jsx)("input",{type:"checkbox",checked:u,onChange:e=>m(e.target.checked),disabled:p}),(0,t.jsx)("span",{className:"check-box","aria-hidden":"true"}),(0,t.jsxs)("span",{children:["I agree to the ",(0,t.jsx)(i(),{href:"/legal/terms",children:"Terms of Service"})," and"," ",(0,t.jsx)(i(),{href:"/legal/privacy",children:"Privacy Policy"}),"."]})]}),(0,t.jsxs)("button",{type:"submit",className:"btn btn-primary",disabled:!b,children:[p?"Creating account…":"Create account",(0,t.jsx)("span",{className:"kbd","aria-hidden":"true",children:"↵"})]}),(0,t.jsx)("div",{className:"or-divider","aria-hidden":"true",children:"or"}),(0,t.jsxs)("a",{className:"btn btn-google",href:"/api/auth/google",children:[(0,t.jsx)("span",{className:"g-logo","aria-hidden":"true"}),"Sign up with Google"]})]}),(0,t.jsxs)("div",{className:"auth-meta",children:["Already trading with us? ",(0,t.jsx)(i(),{href:"/login",children:"Log in"})]})]})}},3745:(e,a,s)=>{"use strict";s.d(a,{FH:()=>h,UJ:()=>n,ki:()=>l});let t="https://api.aitrading.coach";class n extends Error{constructor(e,a){super((Array.isArray(a.message)?a.message.join("; "):a.message)||"HTTP ".concat(e)),this.status=e,this.body=a,this.name="ApiException"}}let r=null,i=null;function l(e){r=e}async function c(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{method:s="GET",body:n,signal:i,noRefresh:l,authenticated:c=!0}=a,h={};void 0!==n&&(h["Content-Type"]="application/json"),c&&r&&(h.Authorization="Bearer ".concat(r));let u=await fetch("".concat(t).concat(e),{method:s,headers:h,body:void 0===n?void 0:JSON.stringify(n),credentials:"include",signal:i});if(401===u.status&&c&&!l){let a=await d();if(a)return h.Authorization="Bearer ".concat(a),o(await fetch("".concat(t).concat(e),{method:s,headers:h,body:void 0===n?void 0:JSON.stringify(n),credentials:"include",signal:i}))}return o(u)}async function o(e){let a=await e.text(),s=a?JSON.parse(a):null;if(!e.ok){var t;let r=null!==(t=null==s?void 0:s.error)&&void 0!==t?t:{code:"unknown",message:a||e.statusText,statusCode:e.status};throw new n(e.status,r)}return s}async function d(){return i||(i=(async()=>{try{let e=await c("/v1/auth/refresh",{method:"POST",noRefresh:!0,authenticated:!1});return r=e.accessToken,e.accessToken}catch(e){return r=null,null}finally{i=null}})())}let h={signup:e=>c("/v1/auth/signup",{method:"POST",body:e,authenticated:!1}),verifyEmail:e=>c("/v1/auth/verify-email",{method:"POST",body:e,authenticated:!1}),login:e=>c("/v1/auth/login",{method:"POST",body:e,authenticated:!1}),refresh:()=>c("/v1/auth/refresh",{method:"POST",noRefresh:!0,authenticated:!1}),logout:()=>c("/v1/auth/logout",{method:"POST",noRefresh:!0,authenticated:!1}),forgot:e=>c("/v1/auth/forgot",{method:"POST",body:e,authenticated:!1}),reset:e=>c("/v1/auth/reset",{method:"POST",body:e,authenticated:!1}),enroll2fa:()=>c("/v1/auth/2fa/enroll",{method:"POST"}),verify2fa:e=>c("/v1/auth/2fa/verify",{method:"POST",body:e}),me:()=>c("/v1/auth/me"),health:()=>c("/v1/health",{authenticated:!1,noRefresh:!0})}},1069:(e,a,s)=>{"use strict";s.d(a,{A:()=>c,AuthProvider:()=>l});var t=s(5155),n=s(2115),r=s(3745);let i=(0,n.createContext)(null);function l(e){let{children:a}=e,[s,l]=(0,n.useState)({status:"loading",user:null}),c=(0,n.useCallback)(async()=>{try{let{accessToken:e}=await r.FH.refresh();(0,r.ki)(e);let a=await r.FH.me();l({status:"authenticated",user:a})}catch(e){(0,r.ki)(null),l({status:"anonymous",user:null})}},[]);(0,n.useEffect)(()=>{c()},[c]);let o=(0,n.useCallback)(async e=>{let a=await r.FH.login(e);if("requiresTwoFactor"in a&&a.requiresTwoFactor)return{requiresTwoFactor:!0};if(!("accessToken"in a))throw new r.UJ(500,{code:"unexpected",message:"Login response missing access token",statusCode:500});return(0,r.ki)(a.accessToken),l({status:"authenticated",user:await r.FH.me()}),{}},[]),d=(0,n.useCallback)(async e=>{await r.FH.signup(e),l({status:"anonymous",user:null})},[]),h=(0,n.useCallback)(async()=>{try{await r.FH.logout()}finally{(0,r.ki)(null),l({status:"anonymous",user:null})}},[]),u=(0,n.useMemo)(()=>({...s,login:o,signup:d,logout:h,refresh:c}),[s,o,d,h,c]);return(0,t.jsx)(i.Provider,{value:u,children:a})}function c(){let e=(0,n.useContext)(i);if(!e)throw Error("useAuth must be used inside ");return e}},302:(e,a,s)=>{"use strict";s.d(a,{a:()=>t,n:()=>n});let t={0:"Empty",1:"Weak",2:"Fair",3:"Strong",4:"Excellent"};function n(e){let a=0;return e.length>=8&&(a=1),e.length>=8&&/[A-Z]/.test(e)&&/[a-z]/.test(e)&&(a=2),e.length>=8&&/[A-Z]/.test(e)&&/[a-z]/.test(e)&&/\d/.test(e)&&(a=3),e.length>=12&&/[A-Z]/.test(e)&&/[a-z]/.test(e)&&/\d/.test(e)&&/[^A-Za-z0-9]/.test(e)&&(a=4),a}}},e=>{var a=a=>e(e.s=a);e.O(0,[173,441,517,358],()=>a(7077)),_N_E=e.O()}]);