1/*! For license information please see 2152.cbdd5e53.chunk.js.LICENSE.txt */ 2"use strict";(self.webpackChunkfrontend=self.webpackChunkfrontend||[]).push([[2152],{25553(e,t,a){a.d(t,{A:()=>s});const s=(0,a(36230).A)("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]])},25692(e,t,a){a.d(t,{A:()=>s});const s=(0,a(36230).A)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]])},30621(e,t,a){a.d(t,{A:()=>s});const s=(0,a(36230).A)("play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]])},31760(e,t,a){a.d(t,{l:()=>l});a(9950);var s=a(44414);const l=e=>{let{className:t="w-5 h-5",style:a={},alt:l="Peerless Etiquette"}=e;return(0,s.jsx)("img",{src:"https://customer-assets.emergentagent.com/job_665e0490-655f-4a42-85ca-0a99b51fcedb/artifacts/ee0ihixc_Business%20Cards%202026%20%28200%20x%20200%20px%29.png",alt:l,className:"object-contain ".concat(t),style:a,loading:"lazy"})};l.displayName="PELogo"},31855(e,t,a){a.d(t,{A:()=>s});const s=(0,a(36230).A)("map-pin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]])},35097(e,t,a){a.d(t,{A:()=>s});const s=(0,a(36230).A)("user-plus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]])},36150(e,t,a){a.d(t,{A:()=>s});const s=(0,a(36230).A)("clipboard-list",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]])},45462(e,t,a){a.d(t,{A:()=>s});const s=(0,a(36230).A)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},51654(e,t,a){a.d(t,{A:()=>s});const s=(0,a(36230).A)("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]])},52152(e,t,a){a.d(t,{OnboardingAvatarPage:()=>G,OnboardingCompletePage:()=>ie,OnboardingPreferencesPage:()=>ae,PersonalizedDashboard:()=>ge,ProfileCreationPage:()=>k,QuestionnairePage:()=>I,SignupPage:()=>w,TailoringLoaderPage:()=>ne,WelcomeGatePage:()=>c});var s=a(9950),l=a(55677),i=a(92994),n=a(45462),r=a(35097),o=a(44414);const c=()=>
2{const e=(0,i.Zp)(),[t,a]=(0,s.useState)(!1);(0,s.useEffect)(()=>{const e=localStorage.getItem("peerless_token")||localStorage.getItem("token");e&&c(e)},[]);const c=async t=>{try{const a=await fetch("".concat("https://peerlessetiquette.com","/api/onboarding/state"),{headers:{Authorization:"Bearer ".concat(t)}});if(a.ok){switch((await a.json()).onboarding_state){case"PROFILE":e("/onboarding/profile");break;case"QUESTIONNAIRE":e("/onboarding/questionnaire");break;case"COMPLETED":e("/personalized-dashboard")}}}catch(a){console.error("Failed to check onboarding state:",a)}};return(0,o.jsxs)("div",{className:"min-h-screen bg-[#F8F6F3]",style:{fontFamily:"'Lato', sans-serif"},children:[(0,o.jsxs)("div",{className:"relative h-[340px] sm:h-[380px] overflow-hidden bg-[#22364A]",children:[(0,o.jsx)("div",{className:"absolute inset-0 opacity-[0.03]",style:{backgroundImage:"radial-gradient(circle at 2px 2px, #A8936B 1px, transparent 0)",backgroundSize:"40px 40px"}}),(0,o.jsx)("div",{className:"absolute top-0 left-0 right-0 h-[2px] bg-gradient-to-r from-transparent via-[#A58958]/60 to-transparent"}),(0,o.jsx)(l.P.button,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.3},onClick:()=>e("/"),className:"absolute top-6 left-6 z-20 flex items-center text-white/70 hover:text-white transition-all group","data-testid":"back-btn",children:(0,o.jsx)(n.A,{size:20,className:"group-hover:-translate-x-1 transition-transform"})}),(0,o.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-white z-10 px-6",children:[(0,o.jsx)(l.P.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{delay:.15,duration:.5},className:"w-20 h-20 mb-5",children:(0,o.jsx)("img",{loading:"lazy",src:"/assets/crest.png",alt:"Peerless Etiquette Crest",className:"w-full h-full object-contain"})}),(0,o.jsx)(l.P.p,{initial:{opacity:0}
2,animate:{opacity:1},transition:{delay:.25},className:"text-[10px] uppercase tracking-[0.4em] text-[#A8936B]/80 mb-5",children:"Peerless Etiquette"}),(0,o.jsx)(l.P.h1,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.3,duration:.6},className:"text-3xl sm:text-4xl tracking-wide text-white",style:{fontFamily:"'Inter', -apple-system, sans-serif"},children:"Welcome"}),(0,o.jsxs)(l.P.p,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.45,duration:.6},className:"text-white/80 text-sm sm:text-base mt-3 tracking-wide text-center",style:{fontFamily:"'Inter', -apple-system, sans-serif"},children:["Enter a world of ",(0,o.jsx)("span",{className:"italic text-[#D4C4A0]",children:"refined elegance."})]})]})]}),(0,o.jsx)(l.P.div,{initial:{opacity:0,y:30},animate:{opacity:1,y:0},transition:{delay:.3,duration:.6},className:"relative -mt-8 bg-[#FDFCFA] rounded-t-[32px] min-h-[calc(100vh-300px)] sm:min-h-[calc(100vh-340px)]",style:{boxShadow:"0 -10px 40px rgba(0,0,0,0.08)"},children:(0,o.jsxs)("div",{className:"max-w-md mx-auto px-6 sm:px-8 pt-10 pb-12",children:[(0,o.jsx)(l.P.div,{initial:{opacity:0}
2,animate:{opacity:1},transition:{delay:.5},className:"text-center mb-10",children:(0,o.jsx)("p",{className:"text-[#5e5e5e] text-sm leading-relaxed",children:"Become a member to access exclusive courses, interactive games, and personalized etiquette guidance."})}),(0,o.jsxs)(l.P.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.6},className:"space-y-4",children:[(0,o.jsx)(l.P.div,{whileHover:{scale:1.01},whileTap:{scale:.99},children:(0,o.jsxs)("button",{onClick:()=>e("/signup"),disabled:t,className:"navy-cta w-full h-12 rounded-lg font-medium uppercase tracking-[0.12em] text-sm transition-all flex items-center justify-center gap-3 group bg-[#22364A] text-white hover:bg-[#1a1a1a]","data-testid":"become-member-btn",children:[(0,o.jsx)(r.A,{className:"w-4 h-4"}),(0,o.jsx)("span",{children:"Become a Member"})]})}),(0,o.jsx)(l.P.div,{whileHover:{scale:1.01},whileTap:{scale:.99},children:(0,o.jsx)("button",{onClick:()=>e("/auth"),className:"w-full h-12 rounded-lg font-medium uppercase tracking-[0.12em] text-sm transition-all border border-[#594D44] text-[#2B2B2B] bg-transparent hover:bg-[#22364A] hover:text-white","data-testid":"sign-in-btn",children:"Sign In"})})]}),(0,o.jsx)(l.P.button,{initial:{opacity:0}
2,animate:{opacity:1},transition:{delay:.75},onClick:()=>e("/discover"),className:"w-full text-center text-[#999] hover:text-[#1a1a1a] text-sm mt-6 transition-colors",children:"Continue as Guest"}),(0,o.jsxs)(l.P.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.8},className:"text-center text-[#999] text-xs mt-8 leading-relaxed",children:["By continuing, you agree to our"," ",(0,o.jsx)("a",{href:"/terms",className:"text-[#B8A67A] hover:underline",children:"Terms of Service"})," ","and"," ",(0,o.jsx)("a",{href:"/privacy",className:"text-[#B8A67A] hover:underline",children:"Privacy Policy"})]})]})})]})};var d=a(89379),m=a(51654),x=a(7838),p=a(96479),h=a(81064),u=a(388),g=a(93971),f=a(88276),b=a(86009),y=a(42989),j=a(52257);const v=(0,s.memo)(e=>{let{icon:t,label:a,value:s,onChange:l,type:i="text",placeholder:n,showToggle:r=!1,showPassword:c,onTogglePassword:d,error:h,testId:u}=e;return(0,o.jsxs)("div",{className:"space-y-1.5",children:[(0,o.jsx)("label",{className:"block text-xs uppercase tracking-wider text-[#5e5e5e]",children:a}),(0,o.jsxs)("div",{className:"relative",children:[(0,o.jsx)(t,{className:"absolute left-4 top-1/2 -translate-y-1/2 w-4 h-4 text-[#2B2B2B]/30"}),(0,o.jsx)("input",{type:r?c?"text":"password":i,value:s,onChange:l,placeholder:n,autoComplete:"off",autoCorrect:"off",autoCapitalize:"email"===i?"none":"words",spellCheck:"false",className:"w-full pl-12 ".concat(r?"pr-12":"pr-4"," py-3.5 rounded-xl bg-white/5 border ").concat(h?"border-red-500/50":"border-[#1B7B9E]/20"," text-[#2B2B2B] placeholder-white/30 focus:border-[#A8936B]/50 focus:outline-none transition-colors"),"data-testid":u}),r&&(0,o.jsx)("button",{type:"button",onClick:d,className:"absolute right-4 top-1/2 -translate-y-1/2 text-[#2B2B2B]/30 hover:text-[#5e5e5e]",children:c?(0,o.jsx)(m.A,{className:"w-4 h-4"}):(0,o.jsx)(x.A,{className:"w-4 h-4"})})]}),h&&(0,o.jsxs)("p",{className:"text-xs text-red-400 flex items-center gap-1",children:[(0,o.jsx)(p.A,{className:"w-3 h-3"}),h]})]})});v.displayName="InputField";const w=()=>
2{const e=(0,i.Zp)(),[t,a]=(0,s.useState)(!1),[l,r]=(0,s.useState)(!1),[c,m]=(0,s.useState)(!1),[x,p]=(0,s.useState)(""),[w,B]=(0,s.useState)({}),[N,A]=(0,s.useState)(""),[k,C]=(0,s.useState)(""),[_,P]=(0,s.useState)(""),[S,F]=(0,s.useState)(""),[E,z]=(0,s.useState)(""),[M,I]=(0,s.useState)(""),[q,T]=(0,s.useState)(""),D=(0,s.useCallback)(e=>{const t=e.replace(/\D/g,"");return t.length<=3?t:t.length<=6?"(".concat(t.slice(0,3),") ").concat(t.slice(3)):"(".concat(t.slice(0,3),") ").concat(t.slice(3,6),"-").concat(t.slice(6,10))},[]),O=(0,s.useMemo)(()=>{if(!E)return{strength:0,label:"",color:""};let e=0;return E.length>=8&&e++,E.length>=12&&e++,/[A-Z]/.test(E)&&e++,/[0-9]/.test(E)&&e++,/[^A-Za-z0-9]/.test(E)&&e++,e<=2?{strength:e,label:"Weak",color:"#EF4444"}:e<=3?{strength:e,label:"Medium",color:"#F59E0B"}:{strength:e,label:"Strong",color:"#10B981"}},[E]),L=(0,s.useCallback)(e=>{A(e.target.value),B(e=>(0,d.A)((0,d.A)({},e),{},{first_name:""}))},[]),H=(0,s.useCallback)(e=>{C(e.target.value),B(e=>(0,d.A)((0,d.A)({},e),{},{last_name:""}))},[]),R=(0,s.useCallback)(e=>{P(e.target.value),B(e=>(0,d.A)((0,d.A)({},e),{},{email:""}))},[]),Z=(0,s.useCallback)(e=>{F(D(e.target.value)),B(e=>(0,d.A)((0,d.A)({},e),{},{phone:""}))},[D]),Y=(0,s.useCallback)(e=>{z(e.target.value),B(e=>(0,d.A)((0,d.A)({},e),{},{password:""}))},[]),W=(0,s.useCallback)(e=>{I(e.target.value),B(e=>(0,d.A)((0,d.A)({},e),{},{confirm_password:""}))},[]),J=(0,s.useCallback)(e=>{T(e.target.value.toUpperCase())},[]),U=(0,s.useCallback)(()=>{r(e=>!e)},[]),G=(0,s.useCallback)(()=>{m(e=>!e)},[]),Q=(0,s.useCallback)(()=>{const e={};N.trim()||(e.first_name="First name is required"),k.trim()||(e.last_name="Last name is required"),_.trim()?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(_)||(e.email="Please enter a valid email"):e.email="Email is required";const t=S.replace(/\D/g,"");return t?t.length<10&&(e.phone="Please enter a valid phone number"):e.phone="Phone number is required",E?E.length<8&&(e.password="Password must be at least 8 characters"):e.password="Password is required",M?E!==M&&(e.confirm_password="Passwords do not match"):e.confirm_password="Please confirm your password",B(e),0===Object.keys(e).length},[N,k,_,S,E,M]),V=(0,s.useCallback)(async t=>{if(t.preventDefault(),Q()){a(!0),p("");try{const t=await fetch("".concat("https://peerlessetiquette.com","/api/onboarding/signup"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({first_name:N,last_name:k,email:_,phone:S.replace(/\D/g,""),password:E,confirm_password:M,referral_code:q||null})}),a=await t.json();if(!t.ok){if(422===t.status&&Array.isArray(a.detail)){const e=a.detail.map(e=>{var t,a;const s=(null===(t=e.loc)||void 0===t||null===(a=t.slice(-1))||void 0===a?void 0:a[0])||"field";return"".concat({first_name:"First name",last_name:"Last name",email:"Email",phone:"Phone number",password:"Password",confirm_password:"Password confirmation"}[s]||s,": ").concat(e.msg)});throw new Error(e.join("\n"))}throw new Error("string"===typeof a.detail?a.detail:"Registration failed. Please check your information and try again.")}localStorage.setItem("peerless_token",a.token),localStorage.setItem("user_id",a.user_id),e("/onboarding/profile")}catch(s){p(s.message)}finally{a(!1)}}},[N,k,_,S,E,M,q,Q,e]),X=(0,s.useCallback)(()=>{e("/onboarding/welcome")},[e]),K=(0,s.useCallback)(()=>{e("/auth")},[e]);return(0,o.jsxs)("div",{className:"min-h-screen bg-[#f3f0e8] flex flex-col relative overflow-hidden",children:[(0,o.jsx)("div",{className:"absolute inset-0 pointer-events-none",children:(0,o.jsx)("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-[800px] h-[400px] bg-[radial-gradient(ellipse_at_center,_rgba(168,147,107,0.06)_0%,_transparent_70%)]"})}),(0,o.jsx)("div",{className:"absolute top-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-[#A58958]/50 to-transparent"}),(0,o.jsx)("header",{className:"relative z-10 px-6 py-6",children:(0,o.jsxs)("button",{onClick:X,className:"flex items-center gap-2 text-[#5e5e5e] hover:text-[#2B2B2B] transition-colors",children:[(0,o.jsx)(n.A,{className:"w-4 h-4"}),(0,o.jsx)("span",{className:"text-sm",children:"Back"})]})}),(0,o.jsx)("main",{className:"relative z-10 flex-1 flex flex-col items-center px-6 py-8 overflow-y-auto",style:{WebkitOverflowScrolling:"touch"},children:(0,o.jsxs)("div",{className:"w-full max-w-md",children:[(0,o.jsxs)("div",{className:"text-center mb-8",children:[(0,o.jsx)("div",{className:"w-14 h-14 mx-auto mb-4",children:(0,o.jsx)("img",{loading:"lazy",src:"https://customer-assets.emergentagent.com/job_63a951ff-c63c-4dfd-bff8-3f8fbdfd3874/artifacts/fkztv17w_Business%20Cards%202026%20%28200%20x%20200%20px%29.png",alt:"Peerless Etiquette",className:"w-full h-full object-contain"})}),(0,o.jsx)("img",{loading:"lazy",src:"/assets/crest.png",alt:"",className:"w-16 h-16 mx-auto mb-5 opacity-90"}),(0,o.jsx)("h1",{className:"text-2xl text-[#2B2B2B] font-light mb-2",style:{fontFamily:"'Inter', -apple-system, sans-serif"},children:"Become a Member"}),(0,o.jsx)("p",{className:"text-[#5e5e5e] text-sm",children:"Join our community of refined individuals"})]}),(0,o.jsxs)("form",{onSubmit:V,className:"space-y-4",children:[(0,o.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,o.jsx)(v,{icon:h.A,label:"First Name",value:N,onChange:L,placeholder:"First",error:w.first_name,testId:"signup-first_name"}),(0,o.jsx)(v,{icon:h.A,label:"Last Name",value:k,onChange:H,placeholder:"Last",error:w.last_name,testId:"signup-last_name"})]}
2),(0,o.jsx)(v,{icon:u.A,label:"Email",value:_,onChange:R,type:"email",placeholder:"[email protected]",error:w.email,testId:"signup-email"}),(0,o.jsx)(v,{icon:g.A,label:"Phone",value:S,onChange:Z,placeholder:"(555) 123-4567",error:w.phone,testId:"signup-phone"}),(0,o.jsxs)("div",{className:"space-y-1.5",children:[(0,o.jsx)(v,{icon:f.A,label:"Password",value:E,onChange:Y,placeholder:"Min 8 characters",showToggle:!0,showPassword:l,onTogglePassword:U,error:w.password,testId:"signup-password"}),E&&(0,o.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[(0,o.jsx)("div",{className:"flex-1 h-1 rounded-full bg-white/10 overflow-hidden",children:(0,o.jsx)("div",{className:"h-full transition-all duration-300",style:{width:"".concat(O.strength/5*100,"%"),backgroundColor:O.color}})}),(0,o.jsx)("span",{className:"text-xs",style:{color:O.color},children:O.label})]})]}),(0,o.jsx)(v,{icon:f.A,label:"Confirm Password",value:M,onChange:W,placeholder:"Confirm password",showToggle:!0,showPassword:c,onTogglePassword:G,error:w.confirm_password,testId:"signup-confirm_password"}),(0,o.jsxs)("div",{className:"space-y-1.5",children:[(0,o.jsx)("label",{className:"block text-xs uppercase tracking-wider text-[#5e5e5e]",children:"Referral Code (Optional)"}),(0,o.jsxs)("div",{className:"relative",children:[(0,o.jsx)(b.A,{className:"absolute left-4 top-1/2 -translate-y-1/2 w-4 h-4 text-[#2B2B2B]/30"}),(0,o.jsx)("input",{type:"text",value:q,onChange:J,placeholder:"PE12345678",autoComplete:"off",autoCorrect:"off",autoCapitalize:"characters",spellCheck:"false",className:"w-full pl-12 pr-4 py-3.5 rounded-xl bg-white/5 border border-[#1B7B9E]/20 text-[#2B2B2B] placeholder-white/30 focus:border-[#A8936B]/50 focus:outline-none transition-colors uppercase","data-testid":"signup-referral"})]})]}),x&&(0,o.jsx)("div",{className:"p-3 rounded-lg bg-red-500/10 border border-red-500/20 text-red-400 text-sm",children:x}),(0,o.jsx)("button",{type:"submit",disabled:t,className:"w-full py-4 px-8 rounded-xl font-medium uppercase tracking-[0.15em] text-sm transition-all flex items-center justify-center gap-3 mt-6 disabled:opacity-50",style:{background:"linear-gradient(135deg, #A8936B 0%, #D4BC8B 50%, #A8936B 100%)",color:"#f3f0e8",boxShadow:"0 8px 32px -8px rgba(168,147,107,0.5), inset 0 1px 0 rgba(255,255,255,0.2)"},"data-testid":"signup-submit-btn",children:t?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(y.A,{className:"w-4 h-4 animate-spin"}),(0,o.jsx)("span",{children:"Creating Account..."})]}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{children:"Continue"}),(0,o.jsx)(j.A,{className:"w-4 h-4"})]})})]}),(0,o.jsxs)("p",{className:"text-center mt-8 text-[#5e5e5e] text-sm pb-8",children:["Already a member?"," ",(0,o.jsx)("button",{onClick:K,className:"text-[#A8936B] hover:text-[#FCF6BA] transition-colors",children:"Sign In"})]})]})})]})};var B=a(41420),N=a(31855);const A="https://peerlessetiquette.com",k=()=>{const e=(0,i.Zp)(),t=(0,s.useRef)(null),[a,l]=(0,s.useState)(!1),[r,c]=(0,s.useState)(!1),[d,m]=(0,s.useState)(""),[x,u]=(0,s.useState)(null),[g,f]=(0,s.useState)(""),[b,v]=(0,s.useState)(""),[w,k]=(0,s.useState)(null),C=(0,s.useCallback)(async e=>{var t;const a=null===(t=e.target.files)||void 0===t?void 0:t[0];if(!a)return;if(!a.type.startsWith("image/"))return void m("Please select an image file");if(a.size>5242880)return void m("Image must be less than 5MB");const s=new FileReader;s.onload=e=>{k(e.target.result)},s.readAsDataURL(a),c(!0),m("");try{const e=localStorage.getItem("peerless_token")||localStorage.getItem("token"),t=new FormData;t.append("file",a);const s=await fetch("".concat(A,"/api/avatars/me/upload"),{method:"POST",headers:{Authorization:"Bearer ".concat(e)},body:t});if(!s.ok)throw new Error("Failed to upload photo");const l=await s.json();u(l.avatar_url)}catch(l){m("Failed to upload photo. Please try again."),k(null)}finally{c(!1)}},[]),_=(0,s.useCallback)(()=>{k(null),u(null),t.current&&(t.current.value="")},[]),P=(0,s.useCallback)(e=>{f(e.target.value),m("")},[]),S=(0,s.useCallback)(e=>{v(e.target.value),m("")},[]),F=(0,s.useCallback)(async t=>{if(t.preventDefault(),g.trim())if(b.trim()){l(!0),m("");try{const t=localStorage.getItem("peerless_token")||localStorage.getItem("token"),a=await fetch("".concat(A,"/api/onboarding/profile"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t)},body:JSON.stringify({profile_photo_url:x,display_name:g,location:b})}),s=await a.json();if(!a.ok)throw new Error(s.detail||"Failed to save profile");e("/onboarding/questionnaire")}catch(a){m(a.message)}finally{l(!1)}}else m("Please enter your location");else m("Please enter your display name")},[g,b,x,e]),E=(0,s.useCallback)(()=>{e(-1)},[e]),z=(0,s.useCallback)(()=>{var e;null===(e=t.current)||void 0===e||e.click()},[]);return(0,o.jsxs)("div",{className:"min-h-screen bg-[#f3f0e8] flex flex-col relative overflow-hidden",children:[(0,o.jsx)("div",{className:"absolute inset-0 pointer-events-none",children:(0,o.jsx)("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-[800px] h-[400px] bg-[radial-gradient(ellipse_at_center,_rgba(168,147,107,0.06)_0%,_transparent_70%)]"})}),(0,o.jsx)("div",{className:"absolute top-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-[#A58958]/50 to-transparent"}),(0,o.jsx)("div",{className:"absolute top-0 left-0 right-0 h-1 bg-white/5",children:(0,o.jsx)("div",{className:"h-full bg-[#22364A] hover:opacity-90 rounded-full",style:{width:"33%"}})}),(0,o.jsxs)("header",{className:"relative z-10 px-6 py-6 flex items-center justify-between",children:[(0,o.jsxs)("button",{onClick:E,className:"flex items-center gap-2 text-[#5e5e5e] hover:text-[#2B2B2B] transition-colors",children:[(0,o.jsx)(n.A,{className:"w-4 h-4"}),(0,o.jsx)("span",{className:"text-sm",children:"Back"})]}),(0,o.jsx)("span",{className:"text-xs uppercase tracking-wider text-[#2B2B2B]/30",children:"Step 1 of 3"})]}),(0,o.jsx)("main",{className:"relative z-10 flex-1 flex flex-col items-center px-6 py-8 overflow-y-auto",style:{WebkitOverflowScrolling:"touch"},children:(0,o.jsxs)("div",{className:"w-full max-w-md",children:[(0,o.jsxs)("div",{className:"text-center mb-8",children:[(0,o.jsx)("img",{loading:"lazy",src:"/assets/crest.png",alt:"",className:"w-16 h-16 mx-auto mb-5 opacity-90"}),(0,o.jsx)("h1",{className:"text-2xl text-[#2B2B2B] font-light mb-2",style:{fontFamily:"'Inter', -apple-system, sans-serif"},children:"Create Your Profile"}),(0,o.jsx)("p",{className:"text-[#5e5e5e] text-sm",children:"Let others know who you are"})]}),(0,o.jsxs)("form",{onSubmit:F,className:"space-y-6",children:[(0,o.jsxs)("div",{className:"flex flex-col items-center",children:[(0,o.jsxs)("div",{className:"relative",children:[(0,o.jsx)("input",{ref:t,type:"file",accept:"image/*",onChange:C,className:"hidden","data-testid":"profile-photo-input"}),(0,o.jsx)("button",{type:"button",onClick:z,disabled:r,className:"w-28 h-28 rounded-full border-2 border-dashed border-[#1B7B9E]/25 hover:border-[#A8936B]/50 transition-colors flex items-center justify-center overflow-hidden group",children:w?(0,o.jsx)("img",{loading:"lazy",src:w,alt:"Profile",className:"w-full h-full object-cover"}):r?(0,o.jsx)(y.A,{className:"w-8 h-8 text-[#A8936B] animate-spin"}):(0,o.jsxs)("div",{className:"text-center",children:[(0,o.jsx)(B.A,{className:"w-8 h-8 text-[#2B2B2B]/30 group-hover:text-[#A8936B] transition-colors mx-auto mb-1"}),(0,o.jsx)("span",{className:"text-[10px] uppercase tracking-wider text-[#2B2B2B]/30",children:"Add Photo"})]})}),w&&(0,o.jsx)("button",{type:"button",onClick:_,className:"absolute -top-1 -right-1 w-6 h-6 rounded-full bg-red-500 text-[#2B2B2B] flex items-center justify-center hover:bg-red-600 transition-colors",children:(0,o.jsx)(p.A,{className:"w-3 h-3"})})]}),(0,o.jsx)("p",{className:"text-xs text-[#5e5e5e] mt-3",children:"Optional \u2022 Max 5MB"})]}),(0,o.jsxs)("div",{className:"space-y-1.5",children:[(0,o.jsx)("label",{className:"block text-xs uppercase tracking-wider text-[#5e5e5e]",children:"Display Name"}),(0,o.jsxs)("div",{className:"relative",children:[(0,o.jsx)(h.A,{className:"absolute left-4 top-1/2 -translate-y-1/2 w-4 h-4 text-[#2B2B2B]/30"}),(0,o.jsx)("input",{type:"text",value:g,onChange:P,placeholder:"How should we address you?",autoComplete:"off",autoCorrect:"off",autoCapitalize:"words",spellCheck:"false",className:"w-full pl-12 pr-4 py-3.5 rounded-xl bg-white/5 border border-[#1B7B9E]/20 text-[#2B2B2B] placeholder-white/30 focus:border-[#A8936B]/50 focus:outline-none transition-colors","data-testid":"profile-display-name"})]})]}),(0,o.jsxs)("div",{className:"space-y-1.5",children:[(0,o.jsx)("label",{className:"block text-xs uppercase tracking-wider text-[#5e5e5e]",children:"Location"}),(0,o.jsxs)("div",{className:"relative",children:[(0,o.jsx)(N.A,{className:"absolute left-4 top-1/2 -translate-y-1/2 w-4 h-4 text-[#2B2B2B]/30"}),(0,o.jsx)("input",{type:"text",value:b,onChange:S,placeholder:"City, State or Country",autoComplete:"off",autoCorrect:"off",autoCapitalize:"words",spellCheck:"false",className:"w-full pl-12 pr-4 py-3.5 rounded-xl bg-white/5 border border-[#1B7B9E]/20 text-[#2B2B2B] placeholder-white/30 focus:border-[#A8936B]/50 focus:outline-none transition-colors","data-testid":"profile-location"})]})]}),d&&(0,o.jsx)("div",{className:"p-3 rounded-lg bg-red-500/10 border border-red-500/20 text-red-400 text-sm",children:d}),(0,o.jsx)("button",{type:"submit",disabled:a||r,className:"w-full py-4 px-8 rounded-xl font-medium uppercase tracking-[0.15em] text-sm transition-all flex items-center justify-center gap-3 mt-6 disabled:opacity-50",style:{background:"linear-gradient(135deg, #A8936B 0%, #D4BC8B 50%, #A8936B 100%)",color:"#f3f0e8",boxShadow:"0 8px 32px -8px rgba(168,147,107,0.5), inset 0 1px 0 rgba(255,255,255,0.2)"},"data-testid":"profile-submit-btn",children:a?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(y.A,{className:"w-4 h-4 animate-spin"}),(0,o.jsx)("span",{children:"Saving..."})]}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{children:"Continue"}),(0,o.jsx)(j.A,{className:"w-4 h-4"})]})})]})]})})]})};
2var C=a(76429),_=a(76274),P=a(80903),S=a(29975),F=a(34700),E=a(86311),z=a(31760);const M="https://peerlessetiquette.com",I=()=>{const e=(0,i.Zp)(),[t,a]=(0,s.useState)(!0),[r,c]=(0,s.useState)(!1),[m,x]=(0,s.useState)(""),[p,h]=(0,s.useState)(0),[u,g]=(0,s.useState)([]),[f,b]=(0,s.useState)({goals:[],learning_style:"",social_comfort:"",aspirational_identity:[],avatar_preferences:""}),v={goals:_.A,learning_style:P.A,social_comfort:S.A,aspirational_identity:"PELogo",avatar_preferences:F.A};(0,s.useEffect)(()=>{(async()=>{try{const e=await fetch("".concat(M,"/api/onboarding/questionnaire/options")),t=await e.json();g(t.steps)}catch(e){x("Failed to load questionnaire")}finally{a(!1)}})()},[]);const w=u[p],B="multiple_choice"===(null===w||void 0===w?void 0:w.type),N=w&&v[w.id]||_.A,A=()=>{if(!w)return!1;const e=w.id;if(B){const t=w.min_selections||1;return(f[e]||[]).length>=t}return!!f[e]},k=async()=>{c(!0),x("");try{const t=localStorage.getItem("peerless_token")||localStorage.getItem("token"),a=await fetch("".concat(M,"/api/onboarding/questionnaire"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t)},body:JSON.stringify(f)}),s=await a.json();if(!a.ok)throw new Error(s.detail||"Failed to save questionnaire");localStorage.setItem("personalization",JSON.stringify(s.personalization)),e("/onboarding/preferences")}catch(t){x(t.message)}finally{c(!1)}};return t?(0,o.jsx)("div",{className:"min-h-screen bg-[#f3f0e8] flex items-center justify-center",children:(0,o.jsx)(y.A,{className:"w-8 h-8 text-[#A8936B] animate-spin"})}):(0,o.jsxs)("div",{className:"min-h-screen bg-[#f3f0e8] flex flex-col relative overflow-hidden",children:[(0,o.jsx)("div",{className:"absolute inset-0 pointer-events-none",children:(0,o.jsx)("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-[800px] h-[400px] bg-[radial-gradient(ellipse_at_center,_rgba(168,147,107,0.06)_0%,_transparent_70%)]"})}),(0,o.jsx)("div",{className:"absolute top-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-[#A58958]/50 to-transparent"}),(0,o.jsx)("div",{className:"absolute top-0 left-0 right-0 h-1 bg-white/5",children:(0,o.jsx)(l.P.div,{initial:{width:"33%"},animate:{width:"".concat(33+(p+1)/u.length*67,"%")},className:"h-full bg-[#22364A] hover:opacity-90 rounded-full",transition:{duration:.3}})}),(0,o.jsxs)("header",{className:"relative z-10 px-6 py-6 flex items-center justify-between",children:[(0,o.jsxs)("button",{onClick:()=>{p>0?h(e=>e-1):e("/onboarding/profile")},className:"flex items-center gap-2 text-[#5e5e5e] hover:text-[#2B2B2B] transition-colors",children:[(0,o.jsx)(n.A,{className:"w-4 h-4"}),(0,o.jsx)("span",{className:"text-sm",children:"Back"})]}),(0,o.jsxs)("span",{className:"text-xs uppercase tracking-wider text-[#2B2B2B]/30",children:["Step ",p+2," of ",u.length+1]})]}),(0,o.jsx)("main",{className:"relative z-10 flex-1 flex flex-col px-6 py-8 max-w-xl mx-auto w-full",children:(0,o.jsx)(C.N,{mode:"wait",children:w&&(0,o.jsxs)(l.P.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},transition:{duration:.3},className:"flex-1 flex flex-col",children:[(0,o.jsxs)("div",{className:"text-center mb-8",children:[(0,o.jsx)("div",{className:"w-14 h-14 mx-auto rounded-xl bg-gradient-to-br from-[#A8936B]/20 to-[#A8936B]/5 border border-[#A8936B]/20 flex items-center justify-center mb-4",children:(0,o.jsx)(N,{className:"w-7 h-7 text-[#FCF6BA]"})}),(0,o.jsx)("img",{loading:"lazy",src:"/assets/crest.png",alt:"",className:"w-16 h-16 mx-auto mb-5 opacity-90"}),(0,o.jsx)("h1",{className:"text-2xl text-[#2B2B2B] font-light mb-2",style:{fontFamily:"'Inter', -apple-system, sans-serif"},children:w.title}),(0,o.jsx)("p",{className:"text-[#5e5e5e] text-sm",children:w.subtitle}),B&&(0,o.jsx)("p",{className:"text-[#A8936B] text-xs mt-2",children:"Select all that apply"})]}),(0,o.jsx)("div",{className:"flex items-center justify-center gap-2 mb-8",children:u.map((e,t)=>(0,o.jsx)("div",{className:"w-2 h-2 rounded-full transition-all ".concat(t===p?"w-6 bg-[#A8936B]":t<p?"bg-[#A8936B]/60":"bg-white/10")},t))}),(0,o.jsx)("div",{className:"flex-1 space-y-3",children:w.options.map((e,t)=>{const a=(e=>{const t=w.id;return B?(f[t]||[]).includes(e):f[t]===e})(e);return(0,o.jsxs)(l.P.button,{initial:{opacity:0,y:10}
2,animate:{opacity:1,y:0},transition:{delay:.05*t},onClick:()=>(e=>{const t=w.id;b(B?a=>{const s=a[t]||[];return s.includes(e)?(0,d.A)((0,d.A)({},a),{},{[t]:s.filter(t=>t!==e)}):(0,d.A)((0,d.A)({},a),{},{[t]:[...s,e]})}:a=>(0,d.A)((0,d.A)({},a),{},{[t]:e}))})(e),className:"w-full p-4 rounded-xl text-left transition-all flex items-center justify-between group ".concat(a?"bg-[#A8936B]/20 border-[#A8936B]/50":"bg-white/5 border-[#1B7B9E]/20 hover:border-[#A8936B]/30"," border"),"data-testid":"questionnaire-option-".concat(w.id,"-").concat(t),children:[(0,o.jsx)("span",{className:"text-sm ".concat("text-[#2B2B2B]"),children:e}),(0,o.jsx)("div",{className:"w-5 h-5 rounded-full border-2 flex items-center justify-center transition-all ".concat(a?"border-[#A8936B] bg-[#A8936B]":"border-[#1B7B9E]/25 group-hover:border-[#A8936B]/50"),children:a&&(0,o.jsx)(E.A,{className:"w-3 h-3 text-[#2B2B2B]"})})]},e)})}),m&&(0,o.jsx)(l.P.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"p-3 rounded-lg bg-red-500/10 border border-red-500/20 text-red-400 text-sm mt-4",children:m}),(0,o.jsx)("button",{onClick:async()=>{A()&&(p<u.length-1?h(e=>e+1):await k())},disabled:!A()||r,className:"w-full py-4 px-8 rounded-xl font-medium uppercase tracking-[0.15em] text-sm transition-all flex items-center justify-center gap-3 mt-8 disabled:opacity-50 disabled:cursor-not-allowed",style:{background:A()?"linear-gradient(135deg, #A8936B 0%, #D4BC8B 50%, #A8936B 100%)":"rgba(255,255,255,0.1)",color:A()?"#f3f0e8":"rgba(255,255,255,0.85)",boxShadow:A()?"0 8px 32px -8px rgba(168,147,107,0.5), inset 0 1px 0 rgba(255,255,255,0.2)":"none"},"data-testid":"questionnaire-next-btn",children:r?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(y.A,{className:"w-4 h-4 animate-spin"}),(0,o.jsx)("span",{children:"Processing..."})]}):p===u.length-1?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{children:"Complete"}),(0,o.jsx)(E.A,{className:"w-4 h-4"})]}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{children:"Continue"}),(0,o.jsx)(j.A,{className:"w-4 h-4"})]})})]},p)})})]})};var q=a(90983),T=a(45536),D=a(56149),O=a(36150),L=a(27304),H=a(89318);const R=[{id:1,path:"/onboarding/start",label:"Welcome",icon:D.A},{id:2,path:"/onboarding/profile",label:"Profile",icon:h.A},{id:3,path:"/onboarding/questionnaire",label:"Questions",icon:O.A},{id:4,path:"/onboarding/avatar",label:"Avatar",icon:L.A},{id:5,path:"/onboarding/preferences",label:"Preferences",icon:H.A},{id:6,path:"/onboarding/complete",label:"Complete",icon:E.A}],Z=e=>{let{currentStep:t,completedSteps:a=[]}=e;const s=(0,i.Zp)(),n=(0,i.zy)(),r=t||R.findIndex(e=>e.path===n.pathname)+1||1;return(0,o.jsxs)("div",{className:"w-full max-w-2xl mx-auto px-4 py-6",children:[(0,o.jsx)("div",{className:"text-center mb-4",children:(0,o.jsxs)("span",{className:"text-[#A8936B] text-sm uppercase tracking-wider",children:["Step ",r," of ",R.length]})}),(0,o.jsxs)("div",{className:"relative",children:[(0,o.jsx)("div",{className:"absolute top-5 left-0 right-0 h-0.5 bg-white/10"}),(0,o.jsx)(l.P.div,{className:"absolute top-5 left-0 h-0.5 bg-gradient-to-r from-[#A8936B] to-[#A58958]",initial:{width:"0%"},animate:{width:"".concat((r-1)/(R.length-1)*100,"%")},transition:{duration:.5,ease:"easeOut"}}),(0,o.jsx)("div",{className:"relative flex justify-between",children:R.map(e=>{const t=e.id===r,i=e.id<r||a.includes(e.id),n=e.id<=r||a.includes(e.id),c=e.icon;return(0,o.jsxs)(l.P.button,{onClick:()=>(e=>{(e.id<=r||a.includes(e.id))&&s(e.path)})(e),disabled:!n,className:"\n relative flex flex-col items-center group\n ".concat(n?"cursor-pointer":"cursor-not-allowed","\n "),whileHover:n?{scale:1.05}:{},whileTap:n?{scale:.95}:{},children:[(0,o.jsx)(l.P.div,{className:"\n w-10 h-10 rounded-full flex items-center justify-center border-2 transition-all\n ".concat(i?"bg-[#A8936B] border-[#A8936B]":t?"bg-[#f3f0e8] border-[#A8936B]":"bg-[#f3f0e8] border-white/20","\n "),initial:!1,animate:t?{scale:[1,1.1,1]}:{},transition:{duration:.3},children:i?(0,o.jsx)(E.A,{className:"w-5 h-5 text-[#2B2B2B]"}):(0,o.jsx)(c,{className:"w-4 h-4 ".concat(t?"text-[#A8936B]":"text-[#2B2B2B]/30")})}),(0,o.jsx)("span",{className:"\n mt-2 text-[10px] uppercase tracking-wider font-medium\n ".concat(t?"text-[#A8936B]":i?"text-[#2B2B2B]/60":"text-[#2B2B2B]/30","\n "),children:e.label})]},e.id)})})]})]})},Y=e=>{let{children:t,currentStep:a,showProgress:s=!0,showBackButton:r=!0,
2completedSteps:c=[]}=e;const d=(0,i.zy)(),m=(0,i.Zp)(),x=R.findIndex(e=>e.path===d.pathname),p=a||(x>=0?x+1:1),h=1===p;return(0,o.jsxs)("div",{className:"min-h-screen bg-[#f3f0e8]",children:[(0,o.jsx)("div",{className:"fixed inset-0 pointer-events-none opacity-5",style:{backgroundImage:"radial-gradient(circle at 2px 2px, #A8936B 1px, transparent 0)",backgroundSize:"40px 40px"}}),(0,o.jsxs)("header",{className:"relative z-10 px-6 py-4 flex items-center justify-between",children:[r&&!h?(0,o.jsxs)("button",{onClick:()=>{m(x>0?R[x-1].path:"/")},className:"flex items-center gap-2 text-[#2B2B2B]/50 hover:text-[#A8936B] transition-colors",children:[(0,o.jsx)(n.A,{className:"w-4 h-4"}),(0,o.jsx)("span",{className:"text-sm",children:"Back"})]}):(0,o.jsx)("div",{}),(0,o.jsx)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2",children:(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,o.jsx)(T.A,{className:"w-6 h-6 text-[#A8936B]"}),(0,o.jsx)("span",{className:"text-[#2B2B2B] text-sm uppercase tracking-[0.2em] font-light hidden sm:inline",children:"Peerless Etiquette"})]})}),(0,o.jsxs)("div",{className:"sm:hidden text-[#A8936B] text-xs",children:[p,"/",R.length]})]}),s&&(0,o.jsx)(Z,{currentStep:p,completedSteps:c}),(0,o.jsx)(l.P.main,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{duration:.3},className:"relative z-10 px-6 pb-20",children:t}),(0,o.jsx)("div",{className:"fixed bottom-0 left-0 right-0 h-32 pointer-events-none",style:{background:"linear-gradient(to top, rgba(10,10,10,0.8) 0%, transparent 100%)"}})]})};var W=a(45532);const J=[{id:"classic",label:"Classic",description:"Timeless elegance"},{id:"modern",label:"Modern",description:"Contemporary style"},{id:"professional",label:"Professional",description:"Business ready"},{id:"artistic",label:"Artistic",description:"Creative expression"}],U=[{id:"avatar_1",url:"/avatars/classic_1.png",category:"classic"},{id:"avatar_2",url:"/avatars/classic_2.png",category:"classic"},{id:"avatar_3",url:"/avatars/modern_1.png",category:"modern"},{id:"avatar_4",url:"/avatars/modern_2.png",category:"modern"},{id:"avatar_5",url:"/avatars/professional_1.png",category:"professional"},{id:"avatar_6",url:"/avatars/professional_2.png",category:"professional"},{id:"avatar_7",url:"/avatars/artistic_1.png",category:"artistic"},{id:"avatar_8",url:"/avatars/artistic_2.png",category:"artistic"}],G=()=>{const e=(0,i.Zp)(),{user:t,updateUser:a}=(0,W.A)(),[n,r]=(0,s.useState)((null===t||void 0===t?void 0:t.avatar)||null),[c,m]=(0,s.useState)("classic"),[x,p]=(0,s.use
2State)(!1),[u,g]=(0,s.useState)(U),f=u.filter(e=>e.category===c),b=()=>{e("/onboarding/preferences")};return(0,o.jsx)(Y,{currentStep:4,children:(0,o.jsxs)("div",{className:"max-w-2xl mx-auto",children:[(0,o.jsxs)("div",{className:"text-center mb-8",children:[(0,o.jsx)(l.P.div,{initial:{scale:0},animate:{scale:1},className:"w-16 h-16 mx-auto mb-4 rounded-full bg-gradient-to-br from-[#A8936B] to-[#A58958] flex items-center justify-center",children:(0,o.jsx)(z.l,{className:"w-8 h-8"})}),(0,o.jsx)("img",{loading:"lazy",src:"/assets/crest.png",alt:"",className:"w-16 h-16 mx-auto mb-5 opacity-90"}),(0,o.jsx)("h1",{className:"text-3xl text-[#2B2B2B] mb-2",style:{fontFamily:"'Inter', -apple-system, sans-serif"},children:"Choose Your Avatar"}),(0,o.jsx)("p",{className:"text-[#5e5e5e]",children:"Select an avatar that represents your refined self"})]}),(0,o.jsx)("div",{className:"flex justify-center gap-2 mb-6 flex-wrap",children:J.map(e=>(0,o.jsx)("button",{onClick:()=>m(e.id),className:"px-4 py-2 rounded-full text-sm transition-all ".concat(c===e.id?"bg-[#A8936B] text-black":"bg-white/5 text-[#5e5e5e] hover:bg-white/10"),children:e.label},e.id))}),(0,o.jsx)("div",{className:"grid grid-cols-4 gap-4 mb-8",children:f.map(e=>(0,o.jsxs)(l.P.button,{whileHover:{scale:1.05},whileTap:{scale:.95},onClick:()=>(e=>{r(e.id)})(e),className:"relative aspect-square rounded-xl overflow-hidden border-2 transition-all ".concat(n===e.id?"border-[#A8936B] ring-2 ring-[#A8936B]/50":"border-[#1B7B9E]/20 hover:border-white/30"),children:[(0,o.jsx)("div",{className:"w-full h-full bg-gradient-to-br from-white/10 to-white/5 flex items-center justify-center",children:(0,o.jsx)(h.A,{className:"w-12 h-12 text-[#2B2B2B]/30"})}),n===e.id&&(0,o.jsx)(l.P.div,{initial:{scale:0},animate:{scale:1},className:"absolute top-2 right-2 w-6 h-6 rounded-full bg-[#A8936B] flex items-center justify-center",children:(0,o.jsx)(E.A,{className:"w-4 h-4 text-black"})})]},e.id))}),n&&(0,o.jsxs)(l.P.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"text-center mb-8 p-4 bg-white/5 rounded-xl border border-[#1B7B9E]/20",children:[(0,o.jsx)("p",{className:"text-[#5e5e5e] text-sm",children:"Selected avatar"}),(0,o.jsx)("p",{className:"text-[#A8936B] font-medium",children:n})]}),(0,o.jsxs)("div",{className:"flex gap-4",children:[(0,o.jsx)("button",{onClick:b,className:"flex-1 py-4 rounded-xl bg-white/5 border border-[#1B7B9E]/20 text-[#5e5e5e] hover:bg-white/10 transition-all",children:"Skip for Now"}),(0,o.jsx)(l.P.button,{whileHover:{scale:1.02},whileTap:{scale:.98},onClick:async()=>{if(n){p(!0);try{const s=localStorage.getItem("peerless_token")||localStorage.getItem("token"),l=await fetch("".concat("https://peerlessetiquette.com","/api/onboarding/avatar"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(s)},body:JSON.stringify({avatar:n})});if(l.ok){await l.json();a&&a((0,d.A)((0,d.A)({},t),{},{avatar:n}))}e("/onboarding/preferences")}catch(s){console.error("Failed to save avatar:",s),e("/onboarding/preferences")}finally{p(!1)}}else b()},disabled:x,className:"flex-1 py-4 rounded-xl bg-[#A8936B] text-black font-medium flex items-center justify-center gap-2",children:x?(0,o.jsx)("span",{children:"Saving..."}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{children:"Continue"}),(0,o.jsx)(q.A,{className:"w-5 h-5"})]})})]})]})})};var Q=a(59469),V=a(19201),X=a(95674),K=a(25553),$=a(358),ee=a(96356);const te=e=>{let{icon:t,label:a,description:s,enabled:i,onChange:n}=e;return(0,o.jsxs)(l.P.button,{whileHover:{scale:1.01},whileTap:{scale:.99},onClick:()=>n(!i),className:"w-full p-4 rounded-xl border flex items-center gap-4 transition-all ".concat(i?"bg-[#A8936B]/10 border-[#A8936B]/30":"bg-white/5 border-[#1B7B9E]/20 hover:border-[#1B7B9E]/25"),children:[(0,o.jsx)("div",{className:"w-10 h-10 rounded-lg flex items-center justify-center ".concat(i?"bg-[#A8936B]/20":"bg-white/10"),children:(0,o.jsx)(t,{className:"w-5 h-5 ".concat(i?"text-[#A8936B]":"text-[#5e5e5e]")})}),(0,o.jsxs)("div",{className:"flex-1 text-left",children:[(0,o.jsx)("p",{className:"font-medium ".concat("text-[#2B2B2B]"),children:a}),(0,o.jsx)("p",{className:"text-sm text-[#5e5e5e]",children:s})]}),(0,o.jsx)("div",{className:"w-12 h-6 rounded-full relative transition-colors ".concat(i?"bg-[#A8936B]":"bg-white/20"),children:(0,o.jsx)(l.P.div,{className:"absolute top-1 w-4 h-4 rounded-full bg-white shadow-md",animate:{left:i?"26px":"4px"},transition:{type:"spring",stiffness:500,damping:30}})})]})},ae=()=>{const e=(0,i.Zp)(),{user:t,updateUser:a}
2=(0,W.A)(),[n,r]=(0,s.useState)(!1),[c,m]=(0,s.useState)({notifications:!0,emailDigest:!0,darkMode:!0,soundEffects:!0,dailyReminders:!0,achievementAlerts:!0}),x=(e,t)=>{m(a=>(0,d.A)((0,d.A)({},a),{},{[e]:t}))};return(0,o.jsx)(Y,{currentStep:5,children:(0,o.jsxs)("div",{className:"max-w-xl mx-auto",children:[(0,o.jsxs)("div",{className:"text-center mb-8",children:[(0,o.jsx)(l.P.div,{initial:{scale:0},animate:{scale:1},className:"w-16 h-16 mx-auto mb-4 rounded-full bg-gradient-to-br from-[#A8936B] to-[#A58958] flex items-center justify-center",children:(0,o.jsx)(H.A,{className:"w-8 h-8 text-[#2B2B2B]"})}),(0,o.jsx)("img",{loading:"lazy",src:"/assets/crest.png",alt:"",className:"w-16 h-16 mx-auto mb-5 opacity-90"}),(0,o.jsx)("h1",{className:"text-3xl text-[#2B2B2B] mb-2",style:{fontFamily:"'Inter', -apple-system, sans-serif"},children:"Your Preferences"}),(0,o.jsx)("p",{className:"text-[#5e5e5e]",children:"Customize your Peerless experience"})]}),(0,o.jsxs)("div",{className:"space-y-3 mb-8",children:[(0,o.jsx)("p",{className:"text-[10px] uppercase tracking-wider text-[#A8936B] mb-2",children:"Notifications"}),(0,o.jsx)(te,{icon:Q.A,label:"Push Notifications",description:"Get alerts for new challenges and achievements",enabled:c.notifications,onChange:e=>x("notifications",e)}),(0,o.jsx)(te,{icon:u.A,label:"Email Digest",description:"Weekly summary of your progress",enabled:c.emailDigest,onChange:e=>x("emailDigest",e)}),(0,o.jsx)(te,{icon:V.A,label:"Daily Reminders",description:"Gentle nudge to practice etiquette daily",enabled:c.dailyReminders,onChange:e=>x("dailyReminders",e)}),(0,o.jsx)(te,{icon:D.A,label:"Achievement Alerts",description:"Celebrate when you earn badges",enabled:c.achievementAlerts,onChange:e=>x("achievementAlerts",e)}),(0,o.jsx)("p",{className:"text-[10px] uppercase tracking-wider text-[#A8936B] mb-2 mt-6",children:"Experience"}),(0,o.jsx)(te,{icon:c.darkMode?X.A:K.A,label:"Dark Mode",description:"Elegant dark theme for comfortable viewing",enabled:c.darkMode,onChange:e=>x("darkMode",e)}),(0,o.jsx)(te,{icon:c.soundEffects?$.A:ee.A,label:"Sound Effects",description:"Audio feedback for actions and achievements",enabled:c.soundEffects,onChange:e=>x("soundEffects",e)})]}),(0,o.jsx)(l.P.button,{whileHover:{scale:1.02},whileTap:{scale:.98},onClick:async()=>{r(!0);try{const s=localStorage.getItem("peerless_token")||localStorage.getItem("token"),l=await fetch("".concat("https://peerlessetiquette.com","/api/onboarding/preferences"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(s)},body:JSON.stringify(c)});if(l.ok){await l.json();a&&a((0,d.A)((0,d.A)({},t),{},{preferences:c}))}e("/onboarding/complete")}catch(s){console.error("Failed to save preferences:",s),e("/onboarding/complete")}finally{r(!1)}},disabled:n,className:"w-full py-4 rounded-xl bg-[#A8936B] text-black font-medium flex items-center justify-center gap-2",children:n?(0,o.jsx)("span",{children:"Saving..."}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{children:"Complete Setup"}),(0,o.jsx)(q.A,{className:"w-5 h-5"})]})}),(0,o.jsx)("p",{className:"text-center text-[#2B2B2B]/30 text-sm mt-4",children:"You can change these anytime in Settings"})]})})};var se=a(2263),le=a(88141);const ie=()=>{const e=(0,i.Zp)(),{user:t,updateUser:a}=(0,W.A)(),[n,r]=(0,s.useState)(!0);(0,s.useEffect)(()=>{(async()=>{try{const e=localStorage.getItem("peerless_token")||localStorage.getItem("token"),s=await fetch("".concat("https://peerlessetiquette.com","/api/onboarding/complete"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)}});if(s.ok){await s.json();a&&a((0,d.A)((0,d.A)({},t),{},{onboarding_state:"COMPLETED"}))}}catch(e){console.error("Failed to complete onboarding:",e)}finally{r(!1)}})();const e=Date.now()+3e3,s=()=>{(0,le.A)({particleCount:3,angle:60,spread:55,origin:{x:0},colors:["#A8936B","#A58958","#FCF6BA"]}),(0,le.A)({particleCount:3,angle:120,spread:55,origin:{x:1},colors:["#A8936B","#A58958","#FCF6BA"]}),Date.now()<e&&requestAnimationFrame(s)};s()},[]);return(0,o.jsxs)("div",{className:"min-h-screen bg-[#f3f0e8] flex items-center justify-center p-6",children:[(0,o.jsxs)("div",{className:"fixed inset-0 pointer-events-none",children:[(0,o.jsx)("div",{className:"absolute top-1/4 left-1/4 w-96 h-96 rounded-full opacity-10",style:{background:"radial-gradient(circle, #A8936B 0%, transparent 70%)"}}),(0,o.jsx)("div",{className:"absolute bottom-1/4 right-1/4 w-80 h-80 rounded-full opacity-10",style:{background:"radial-gradient(circle, #A58958 0%, transparent 70%)"}})]}),(0,o.jsxs)("div",{className:"relative z-10 max-w-lg w-full text-center",children:[(0,o.jsxs)(l.P.div,{initial:{scale:0,rotate:-180},animate:{scale:1,rotate:0},transition:{type:"spring",duration:1,delay:.2},className:"relative w-32 h-32 mx-auto mb-8",children:[(0,o.jsx)("div",{className:"absolute inset-0 rounded-full bg-gradient-to-br from-[#A8936B] to-[#A58958] animate-pulse"}),(0,o.jsx)("div",{className:"absolute inset-2 rounded-full bg-[#f3f0e8] flex items-center justify-center",children:(0,o.jsx)(T.A,{className:"w-16 h-16 text-[#A58958]"})}),[...Array(6)].map((e,t)=>(0,o.jsx)(l.P.div,{initial:{scale:0,opacity:0}
2,animate:{scale:[0,1,0],opacity:[0,1,0],x:[0,40*(t%2?1:-1)],y:[0,-40-10*t]},transition:{duration:2,delay:.5+.2*t,repeat:1/0,repeatDelay:1},className:"absolute top-1/2 left-1/2",children:(0,o.jsx)(z.l,{className:"w-4 h-4"})},t))]}),(0,o.jsxs)(l.P.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.5},children:[(0,o.jsx)("img",{loading:"lazy",src:"/assets/crest.png",alt:"",className:"w-16 h-16 mx-auto mb-5 opacity-90"}),(0,o.jsx)("h1",{className:"text-4xl lg:text-5xl text-[#2B2B2B] mb-4",style:{fontFamily:"'Inter', -apple-system, sans-serif"},children:"Welcome to Peerless"}),(0,o.jsx)("p",{className:"text-xl text-[#A8936B] italic mb-6",children:"Your journey to refined excellence begins now"}),(0,o.jsx)("p",{className:"text-[#5e5e5e] mb-8",children:"You've completed your profile setup. You now have full access to all 7 tiers of the Peerless experience."})]}),(0,o.jsxs)(l.P.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.7},className:"grid grid-cols-3 gap-4 mb-8",children:[(0,o.jsxs)("div",{className:"p-4 rounded-xl bg-white/5 border border-[#1B7B9E]/20",children:[(0,o.jsx)(b.A,{className:"w-6 h-6 mx-auto mb-2 text-[#A8936B]"}),(0,o.jsx)("p",{className:"text-[#2B2B2B] font-bold",children:"100"}),(0,o.jsx)("p",{className:"text-[10px] text-[#5e5e5e] uppercase",children:"Bonus Coins"})]}),(0,o.jsxs)("div",{className:"p-4 rounded-xl bg-white/5 border border-[#1B7B9E]/20",children:[(0,o.jsx)(se.A,{className:"w-6 h-6 mx-auto mb-2 text-[#A58958]"}),(0,o.jsx)("p",{className:"text-[#2B2B2B] font-bold",children:"50"}),(0,o.jsx)("p",{className:"text-[10px] text-[#5e5e5e] uppercase",children:"XP Earned"})]}),(0,o.jsxs)("div",{className:"p-4 rounded-xl bg-white/5 border border-[#1B7B9E]/20",children:[(0,o.jsx)(D.A,{className:"w-6 h-6 mx-auto mb-2 text-emerald-400"}),(0,o.jsx)("p",{className:"text-[#2B2B2B] font-bold",children:"1"}),(0,o.jsx)("p",{className:"text-[10px] text-[#5e5e5e] uppercase",children:"Badge Unlocked"})]})]}),(0,o.jsxs)(l.P.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.9},className:"space-y-3",children:[(0,o.jsxs)(l.P.button,{whileHover:{scale:1.02},whileTap:{scale:.98},onClick:()=>{e("/tiers")},className:"w-full py-4 rounded-xl bg-[#A8936B] text-black font-bold flex items-center justify-center gap-2",children:[(0,o.jsx)("span",{children:"Explore the Tiers"}),(0,o.jsx)(j.A,{className:"w-5 h-5"})]}),(0,o.jsx)("button",{onClick:()=>{e("/dashboard")},className:"w-full py-4 rounded-xl bg-white/5 border border-[#1B7B9E]/20 text-[#2B2B2B] hover:bg-white/10 transition-all flex items-center justify-center gap-2",children:(0,o.jsx)("span",{children:"Go to Dashboard"})})]}),(0,o.jsxs)(l.P.div,{initial:{opacity:0}
2,animate:{opacity:1},transition:{delay:1.2},className:"mt-8 flex items-center justify-center gap-2 text-emerald-400",children:[(0,o.jsx)(E.A,{className:"w-5 h-5"}),(0,o.jsx)("span",{className:"text-sm",children:"Onboarding Complete"})]})]})]})},ne=()=>{const e=(0,i.Zp)(),[t,a]=(0,s.useState)(0),[n,r]=(0,s.useState)(!1),c=[{label:"Analyzing your goals",icon:"\ud83c\udfaf"},{label:"Matching learning style",icon:"\ud83d\udcda"},{label:"Personalizing your path",icon:"\u2728"},{label:"Preparing your dashboard",icon:"\ud83c\udfe0"}];return(0,s.useEffect)(()=>{c.forEach((t,s)=>{setTimeout(()=>{a(s),s===c.length-1&&setTimeout(()=>{r(!0),setTimeout(()=>{e("/personalized-dashboard")},1e3)},800)},800*s)})},[e]),(0,o.jsxs)("div",{className:"min-h-screen bg-[#f3f0e8] flex flex-col items-center justify-center relative overflow-hidden",children:[(0,o.jsx)("div",{className:"absolute inset-0 pointer-events-none",children:(0,o.jsx)("div",{className:"absolute top-1/4 left-1/2 -translate-x-1/2 w-[600px] h-[600px] bg-[radial-gradient(ellipse_at_center,_rgba(168,147,107,0.1)_0%,_transparent_70%)]"})}),(0,o.jsx)("div",{className:"absolute top-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-[#A58958]/50 to-transparent"}),(0,o.jsx)("div",{className:"absolute top-0 left-0 right-0 h-1 bg-white/5",children:(0,o.jsx)(l.P.div,{initial:{width:"0%"},animate:{width:n?"100%":"".concat((t+1)/c.length*100,"%")},className:"h-full bg-[#22364A] hover:opacity-90 rounded-full",transition:{duration:.5}})}),(0,o.jsxs)(l.P.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"relative z-10 text-center px-6 max-w-md",children:[(0,o.jsx)(l.P.div,{animate:{scale:[1,1.05,1],rotate:n?[0,5,-5,0]:0},transition:{scale:{repeat:1/0,duration:2},rotate:{duration:.5}},className:"w-20 h-20 mx-auto rounded-2xl bg-gradient-to-br from-[#A8936B] via-[#FCF6BA] to-[#A8936B] p-0.5 mb-8",children:(0,o.jsx)("div",{className:"w-full h-full rounded-2xl bg-[#f3f0e8] flex items-center justify-center",children:n?(0,o.jsx)(l.P.div,{initial:{scale:0},animate:{scale:1},transition:{type:"spring",damping:15},children:(0,o.jsx)(E.A,{className:"w-10 h-10 text-[#FCF6BA]"})}):(0,o.jsx)(T.A,{className:"w-10 h-10 text-[#FCF6BA]"})})}),(0,o.jsx)("img",{loading:"lazy",src:"/assets/crest.png",alt:"",className:"w-16 h-16 mx-auto mb-5 opacity-90"}),(0,o.jsx)("h1",{className:"text-2xl md:text-3xl font-light mb-4",style:{fontFamily:"'Inter', -apple-system, sans-serif",background:"linear-gradient(180deg, #FCF6BA 0%, #A8936B 50%, #8B7355 100%)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"},children:n?"Your Journey Awaits":"Personalizing Your Experience"}),(0,o.jsx)("p",{className:"text-[#5e5e5e] text-sm mb-12",children:n?"Everything is ready for you":"Creating your unique path to refinement"}),(0,o.jsx)("div",{className:"space-y-4",children:c.map((e,a)=>{const s=a===t,i=a<t||n;return(0,o.jsxs)(l.P.div,{initial:{opacity:0,x:-20},animate:{opacity:a<=t||n?1:.3,x:0},transition:{delay:.1*a},className:"flex items-center gap-4 p-4 rounded-xl transition-all ".concat(s?"bg-[#A8936B]/10 border border-[#A8936B]/30":i?"bg-white/5 border border-[#1B7B9E]/20":"bg-transparent border border-transparent"),children:[(0,o.jsx)("div",{className:"w-10 h-10 rounded-full flex items-center justify-center transition-all ".concat(i?"bg-[#A8936B]":s?"bg-[#A8936B]/20 border border-[#A8936B]/50":"bg-white/5"),children:i?(0,o.jsx)(E.A,{className:"w-5 h-5 text-[#2B2B2B]"}):s?(0,o.jsx)(y.A,{className:"w-5 h-5 text-[#A8936B] animate-spin"}):(0,o.jsx)("span",{className:"text-lg",children:e.icon})}),(0,o.jsx)("span",{className:"text-sm ".concat(i||s?"text-[#2B2B2B]":"text-[#5e5e5e]"),children:e.label})]},e.label)})}),n&&(0,o.jsx)(l.P.div,{initial:{opacity:0}
2,animate:{opacity:1},className:"absolute inset-0 pointer-events-none",children:[...Array(6)].map((e,t)=>(0,o.jsx)(l.P.div,{initial:{opacity:0,scale:0},animate:{opacity:[0,1,0],scale:[0,1,0],x:200*Math.random()-100,y:200*Math.random()-100},transition:{duration:1.5,delay:.1*t,repeat:1/0,repeatDelay:1},className:"absolute left-1/2 top-1/2",children:(0,o.jsx)(z.l,{className:"w-4 h-4"})},t))})]})]})};var re=a(42309),oe=a(52607),ce=a(30621),de=a(66987),me=a(25692),xe=a(78130),pe=a(32443),he=a(30855);const ue="https://peerlessetiquette.com",ge=()=>{const e=(0,i.Zp)(),[t]=(0,i.ok)(),[a,n]=(0,s.useState)(null),[r,c]=(0,s.useState)(null),[d,m]=(0,s.useState)(!0),[x,p]=(0,s.useState)("home");(0,s.useEffect)(()=>{t.get("session_id")&&(u(),window.history.replaceState({},"","/personalized-dashboard"))},[t]),(0,s.useEffect)(()=>{u()},[]);const u=async()=>{try{const t=localStorage.getItem("peerless_token")||localStorage.getItem("token");if(!t)return void e("/onboarding/welcome");const[a,s,l]=await Promise.all([fetch("".concat(ue,"/api/auth/me"),{headers:{Authorization:"Bearer ".concat(t)}}),fetch("".concat(ue,"/api/onboarding/progress/resume"),{headers:{Authorization:"Bearer ".concat(t)}}),fetch("".concat(ue,"/api/onboarding/state"),{headers:{Authorization:"Bearer ".concat(t)}})]);if(l.ok){const t=await l.json();if(t.onboarding_state&&"COMPLETED"!==t.onboarding_state)switch(t.onboarding_state){case"PROFILE":return void e("/onboarding/profile");case"QUESTIONNAIRE":return void e("/onboarding/questionnaire");default:return void e("/onboarding/welcome")}}if(a.ok){const e=await a.json();n(e)}else if(401===a.status)return localStorage.removeItem("peerless_token"),localStorage.removeItem("token"),void e("/onboarding/welcome");if(s.ok){const e=await s.json();c(e)}}catch(t){console.error("Failed to fetch user data:",t)}finally{m(!1)}},g=(0,s.useCallback)(()=>{e("/challenge-engine")},[e]),f=(0,s.useCallback)(()=>{null!==r&&void 0!==r&&r.last_challenge_id?e("/challenge-engine?challenge=".concat(r.last_challenge_id)):e("/challenge-engine")},[r,e]),b=(0,s.useCallback)(async()=>{try{const t=localStorage.getItem("peerless_token")||localStorage.getItem("token"),a=await fetch("".concat(ue,"/api/onboarding/progress/reset"),{method:"POST",headers:{Authorization:"Bearer ".concat(t)}});if(a.ok){(await a.json()).first_challenge_id?g():e("/play-and-learn")}}catch(t){console.error("Failed to reset progress:",t)}},[g,e]),y=(0,s.useCallback)(()=>{e("/coins")},[e]),v=(0,s.useCallback)(()=>{if(null!==a&&void 0!==a&&a.recommended_path_id){const t={path_general:"/refinement-journey",path_leadership:"/refinement-journey?focus=leadership",path_confidence:"/refinement-journey?focus=confidence",path_social:"/refinement-journey?focus=social",path_refinement:"/refinement-journey?focus=refinement",path_communication:"/refinement-journey?focus=communication"}[a.recommended_path_id]||"/refinement-journey";e(t)}else e("/refinement-journey")},[a,e]),w=(0,s.useCallback)(t=>{e(t)},[e]),B=((0,s.useCallback)(async()=>{const e=localStorage.getItem("peerless_token")||localStorage.getItem("token");if(e)try{const t=await fetch("".concat(ue,"/api/auth/me"),{headers:{Authorization:"Bearer ".concat(e)}});if(t.ok){const e=await t.json();n(e)}}catch(t){console.error("Failed to refresh stats:",t)}},[]),e=>({foundation:"Foundation",foundation_plus:"Foundation+",refinement:"Refinement",mastery:"Mastery",legacy:"Legacy"}[e]||"Foundation")),N=()=>{var e;const t=(null===a||void 0===a?void 0:a.tone_preferences)||"warm",s=(null===a||void 0===a||null===(e=a.display_name)||void 0===e?void 0:e.split(" ")[0])||"Member",l={warm:"Welcome back, ".concat(s,"!"),empowering:"Ready to conquer, ".concat(s,"?"),elegant:"A pleasure to see you, ".concat(s),nurturing:"So glad you're here, ".concat(s)};return l[t]||l.warm};return d?(0,o.jsx)("div",{className:"min-h-screen bg-[#f3f0e8] flex items-center justify-center",children:(0,o.jsx)(l.P.div,{animate:{rotate:360},transition:{repeat:1/0,duration:1,ease:"linear"},children:(0,o.jsx)(T.A,{className:"w-8 h-8 text-[#A8936B]"})})}):(0,o.jsxs)("div",{className:"min-h-screen bg-[#f3f0e8] flex flex-col relative overflow-hidden pb-24",children:[(0,o.jsx)("div",{className:"absolute inset-0 pointer-events-none",children:(0,o.jsx)("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-[800px] h-[400px] bg-[radial-gradient(ellipse_at_center,_rgba(168,147,107,0.06)_0%,_transparent_70%)]"})}),(0,o.jsx)("div",{className:"absolute top-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-[#A58958]/50 to-transparent"}),(0,o.jsx)("header",{className:"relative z-10 px-6 py-6",children:(0,o.jsxs)("div",{className:"flex items-center justify-between",children:[(0,o.jsxs)("button",{onClick:()=>e("/profile"),className:"flex items-center gap-4 text-left",children:[(0,o.jsx)("div",{className:"w-12 h-12 rounded-full bg-gradient-to-br from-[#A8936B] via-[#FCF6BA] to-[#A8936B] p-0.5",children:(0,o.jsx)("div",{className:"w-full h-full rounded-full bg-[#f3f0e8] flex items-center justify-center overflow-hidden",children:null!==a&&void 0!==a&&a.avatar_url?(0,o.jsx)("img",{loading:"lazy",src:a.avatar_url,alt:"",className:"w-full h-full object-cover"}):(0,o.jsx)(h.A,{className:"w-6 h-6 text-[#A8936B]"})})}),(0,o.jsxs)("div",{children:[(0,o.jsx)("p",{className:"text-[#2B2B2B] font-medium",children:(null===a||void 0===a?void 0:a.display_name)||(null===a||void 0===a?void 0:a.name)||"Member"}),(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,o.jsx)("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:(e=>
2{const t={foundation:"#B0B0B0",foundation_plus:"#A8936B",refinement:"#FFD700",mastery:"#E0115F",legacy:"#4169E1"};return t[e]||t.foundation})(null===a||void 0===a?void 0:a.refinement_tier)}}),(0,o.jsx)("span",{className:"text-xs text-[#5e5e5e]",children:B(null===a||void 0===a?void 0:a.refinement_tier)})]})]})]}),(0,o.jsxs)("button",{onClick:y,className:"flex items-center gap-2 px-4 py-2 rounded-full bg-white/5 border border-[#1B7B9E]/20 hover:border-[#A8936B]/50 transition-all group","data-testid":"coins-balance-btn",children:[(0,o.jsx)("div",{className:"w-5 h-5 rounded-full bg-gradient-to-br from-[#FFD700] to-[#FFA500] flex items-center justify-center",children:(0,o.jsx)(re.A,{className:"w-3 h-3 text-[#f3f0e8]"})}),(0,o.jsx)("span",{className:"text-[#2B2B2B] font-medium",children:(null===a||void 0===a?void 0:a.coins)||0}),(0,o.jsx)(oe.A,{className:"w-3 h-3 text-[#5e5e5e] group-hover:text-[#A8936B] transition-colors"})]})]})}),(0,o.jsxs)("main",{className:"relative z-10 flex-1 px-6 py-4 space-y-6 overflow-y-auto",children:[null!==r&&void 0!==r&&r.can_resume?(0,o.jsxs)(l.P.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"p-5 rounded-2xl bg-gradient-to-br from-[#A8936B]/20 to-[#A8936B]/5 border border-[#A8936B]/30","data-testid":"resume-card",children:[(0,o.jsxs)("div",{className:"flex items-start justify-between mb-4",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("h2",{className:"text-lg text-[#2B2B2B] font-medium mb-1",children:N()}),(0,o.jsx)("p",{className:"text-[#5e5e5e] text-sm",children:"Continue where you left off"})]}),(0,o.jsx)(ce.A,{className:"w-8 h-8 text-[#A8936B]"})]}),(0,o.jsxs)("div",{className:"flex gap-3",children:[(0,o.jsxs)("button",{onClick:f,className:"flex-1 py-3 px-4 rounded-xl font-medium text-sm transition-all flex items-center justify-center gap-2",style:{background:"linear-gradient(135deg, #A8936B 0%, #D4BC8B 50%, #A8936B 100%)",color:"#f3f0e8"},"data-testid":"continue-btn",children:[(0,o.jsx)("span",{children:"Continue"}),(0,o.jsx)(j.A,{className:"w-4 h-4"})]}),(0,o.jsxs)("button",{onClick:b,className:"py-3 px-4 rounded-xl text-[#2B2B2B] hover:text-[#2B2B2B] border border-[#1B7B9E]/20 hover:border-[#1B7B9E]/25 transition-colors flex items-center gap-2","data-testid":"start-over-btn",children:[(0,o.jsx)(de.A,{className:"w-4 h-4"}),(0,o.jsx)("span",{className:"text-sm",children:"Start Over"})]})]})]}):(0,o.jsxs)(l.P.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"p-5 rounded-2xl bg-gradient-to-br from-[#A8936B]/20 to-[#A8936B]/5 border border-[#A8936B]/30","data-testid":"begin-journey-card",children:[(0,o.jsxs)("div",{className:"flex items-start justify-between mb-4",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("h2",{className:"text-lg text-[#2B2B2B] font-medium mb-1",children:N()}),(0,o.jsx)("p",{className:"text-[#5e5e5e] text-sm",children:"Your personalized journey awaits"})]}),(0,o.jsx)(z.l,{className:"w-8 h-8"})]}),(0,o.jsxs)("button",{onClick:g,className:"w-full py-3 px-4 rounded-xl font-medium text-sm transition-all flex items-center justify-center gap-2",style:{background:"linear-gradient(135deg, #A8936B 0%, #D4BC8B 50%, #A8936B 100%)",color:"#f3f0e8"},"data-testid":"begin-journey-btn",children:[(0,o.jsx)("span",{children:"Begin My Personalized Journey"}),(0,o.jsx)(j.A,{className:"w-4 h-4"})]})]}),(0,o.jsxs)(l.P.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1},children:[(0,o.jsx)("h3",{className:"text-xs uppercase tracking-wider text-[#5e5e5e] mb-3",children:"Your First Challenge"}),(0,o.jsx)("button",{onClick:g,className:"w-full p-5 rounded-2xl bg-white/5 border border-[#1B7B9E]/20 hover:border-[#A8936B]/30 transition-all text-left group","data-testid":"first-challenge-card",children:(0,o.jsxs)("div",{className:"flex items-center justify-between",children:[(0,o.jsxs)("div",{className:"flex items-center gap-4",children:[(0,o.jsx)("div",{className:"w-12 h-12 rounded-xl bg-gradient-to-br from-[#A8936B]/20 to-transparent flex items-center justify-center",children:(0,o.jsx)(me.A,{className:"w-6 h-6 text-[#FCF6BA]"})}),(0,o.jsxs)("div",{children:[(0,o.jsx)("p",{className:"text-[#2B2B2B] font-medium mb-1",children:"Begin Your Journey"}),(0,o.jsxs)("p",{className:"text-[#5e5e5e] text-sm",children:["challenge_quick_start"===(null===a||void 0===a?void 0:a.first_challenge_id)&&"Quick daily challenge","challenge_scenario_intro"===(null===a||void 0===a?void 0:a.first_challenge_id)&&"Story-based scenario","challenge_quiz_assessment"===(null===a||void 0===a?void 0:a.first_challenge_id)&&"Knowledge assessment","challenge_visual_guide"===(null===a||void 0===a?void 0:a.first_challenge_id)&&"Visual learning guide",(!(null!==a&&void 0!==a&&a.first_challenge_id)||"challenge_welcome"===(null===a||void 0===a?void 0:a.first_challenge_id))&&"Start with a quick challenge"]})]})]}),(0,o.jsx)(q.A,{className:"w-5 h-5 text-[#2B2B2B]/30 group-hover:text-[#A8936B] group-hover:translate-x-1 transition-all"})]})})]}),(0,o.jsxs)(l.P.div,{initial:{opacity:0,y:20}
2,animate:{opacity:1,y:0},transition:{delay:.2},children:[(0,o.jsx)("h3",{className:"text-xs uppercase tracking-wider text-[#5e5e5e] mb-3",children:"Recommended for You"}),(0,o.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,o.jsxs)("button",{onClick:()=>w("/courses"),className:"p-4 rounded-xl bg-white/5 border border-[#1B7B9E]/20 hover:border-[#A8936B]/30 transition-all text-left group","data-testid":"courses-card",children:[(0,o.jsx)(P.A,{className:"w-6 h-6 text-[#A8936B] mb-3"}),(0,o.jsx)("p",{className:"text-[#2B2B2B] text-sm font-medium mb-1",children:"Courses"}),(0,o.jsx)("p",{className:"text-[#5e5e5e] text-xs",children:"Master etiquette"})]}),(0,o.jsxs)("button",{onClick:()=>w("/puzzles"),className:"p-4 rounded-xl bg-white/5 border border-[#1B7B9E]/20 hover:border-[#A8936B]/30 transition-all text-left group","data-testid":"puzzles-card",children:[(0,o.jsx)(_.A,{className:"w-6 h-6 text-[#A8936B] mb-3"}),(0,o.jsx)("p",{className:"text-[#2B2B2B] text-sm font-medium mb-1",children:"Puzzles"}),(0,o.jsx)("p",{className:"text-[#5e5e5e] text-xs",children:"Test your knowledge"})]})]})]}),(0,o.jsxs)(l.P.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.3},children:[(0,o.jsx)("h3",{className:"text-xs uppercase tracking-wider text-[#5e5e5e] mb-3",children:"Your Refinement Path"}),(0,o.jsxs)("button",{onClick:v,className:"w-full p-5 rounded-2xl bg-white/5 border border-[#1B7B9E]/20 hover:border-[#A8936B]/30 transition-all text-left group","data-testid":"refinement-path-card",children:[(0,o.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,o.jsxs)("div",{className:"flex items-center gap-3",children:[(0,o.jsx)(D.A,{className:"w-6 h-6 text-[#FCF6BA]"}),(0,o.jsx)("span",{className:"text-[#2B2B2B] font-medium",children:"Level Progress"})]}),(0,o.jsx)(q.A,{className:"w-5 h-5 text-[#2B2B2B]/30 group-hover:text-[#A8936B] group-hover:translate-x-1 transition-all"})]}),(0,o.jsx)("div",{className:"relative h-2 rounded-full bg-white/10 overflow-hidden",children:(0,o.jsx)(l.P.div,{initial:{width:0},animate:{width:"".concat(Math.min(((null===a||void 0===a?void 0:a.total_points)||0)/10,100),"%")},transition:{delay:.5,duration:1},className:"absolute inset-y-0 left-0 rounded-full bg-[#22364A] hover:opacity-90 rounded-full"})}),(0,o.jsxs)("p",{className:"text-[#5e5e5e] text-xs mt-2",children:[B(null===a||void 0===a?void 0:a.refinement_tier)," \u2022 ",Math.max(150-((null===a||void 0===a?void 0:a.total_points)||0),0)," XP to next level"]})]})]}),(0,o.jsxs)(l.P.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.4},className:"grid grid-cols-3 gap-3",children:[(0,o.jsxs)("div",{className:"p-4 rounded-xl bg-white/5 border border-[#1B7B9E]/20 text-center",children:[(0,o.jsx)(se.A,{className:"w-5 h-5 text-[#FFD700] mx-auto mb-2"}),(0,o.jsx)("p",{className:"text-[#2B2B2B] font-medium",children:(null===a||void 0===a?void 0:a.total_points)||0}),(0,o.jsx)("p",{className:"text-[#5e5e5e] text-xs",children:"Points"})]}),(0,o.jsxs)("div",{className:"p-4 rounded-xl bg-white/5 border border-[#1B7B9E]/20 text-center",children:[(0,o.jsx)(z.l,{className:"w-5 h-5 mx-auto mb-2"}),(0,o.jsx)("p",{className:"text-[#2B2B2B] font-medium",children:(null===a||void 0===a?void 0:a.streak_days)||0}),(0,o.jsx)("p",{className:"text-[#5e5e5e] text-xs",children:"Day Streak"})]}),(0,o.jsxs)("div",{className:"p-4 rounded-xl bg-white/5 border border-[#1B7B9E]/20 text-center",children:[(0,o.jsx)(xe.A,{className:"w-5 h-5 text-[#E0115F] mx-auto mb-2"}),(0,o.jsx)("p",{className:"text-[#2B2B2B] font-medium",children:(null===a||void 0===a?void 0:a.lessons_completed)||0}),(0,o.jsx)("p",{className:"text-[#5e5e5e] text-xs",children:"Completed"})]})]})]}),(0,o.jsx)("nav",{className:"fixed bottom-0 left-0 right-0 bg-[#f3f0e8]/95 backdrop-blur-xl border-t border-[#1B7B9E]/20 px-6 py-4 z-50",children:(0,o.jsx)("div",{className:"flex items-center justify-around max-w-lg mx-auto",children:[{id:"home",icon:pe.A,label:"Home",path:"/personalized-dashboard"},{id:"play",icon:he.A,label:"Play & Learn",path:"/games"},{id:"avatar",icon:T.A,label:"Avatar",path:"/avatar-studio"},{id:"profile",icon:h.A,label:"Profile",path:"/profile"}].map(t=>{const a=t.icon,s=x===t.id;return(0,o.jsxs)("button",{onClick:()=>
2{p(t.id),e(t.path)},className:"flex flex-col items-center gap-1 transition-colors ".concat(s?"text-[#A8936B]":"text-[#5e5e5e] hover:text-[#5e5e5e]"),"data-testid":"nav-".concat(t.id),children:[(0,o.jsx)(a,{className:"w-5 h-5"}),(0,o.jsx)("span",{className:"text-[10px]",children:t.label})]},t.id)})})})]})}},52257(e,t,a){a.d(t,{A:()=>s});const s=(0,a(36230).A)("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]])},56149(e,t,a){a.d(t,{A:()=>s});const s=(0,a(36230).A)("trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]])},59469(e,t,a){a.d(t,{A:()=>s});const s=(0,a(36230).A)("bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]])},66987(e,t,a){a.d(t,{A:()=>s});const s=(0,a(36230).A)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},76274(e,t,a){a.d(t,{A:()=>s});const s=(0,a(36230).A)("target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]])},95674(e,t,a){a.d(t,{A:()=>s});const s=(0,a(36230).A)("moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]])}}]);
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.