(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{3523:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let s=(0,a(2898).Z)("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},7216:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let s=(0,a(2898).Z)("EyeOff",[["path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24",key:"1jxqfv"}],["path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68",key:"9wicm4"}],["path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61",key:"1jreej"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]])},9670:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let s=(0,a(2898).Z)("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},5589:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let s=(0,a(2898).Z)("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]])},4280:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let s=(0,a(2898).Z)("RefreshCw",[["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"}]])},2549:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let s=(0,a(2898).Z)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},4531:function(e,t,a){Promise.resolve().then(a.bind(a,3091))},3091:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return V}});var s=a(7437),l=a(2265),n=a(5251),i=a(2167),r=a(9865),o=a(2898);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let c=(0,o.Z)("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]),d=(0,o.Z)("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);var x=a(5589),u=a(7216),m=a(9670),h=a(5925),p=a(8013);function y(e){let{onLogin:t}=e,[a,o]=(0,l.useState)("login"),[y,f]=(0,l.useState)(!1),[g,b]=(0,l.useState)(!1),[v,j]=(0,l.useState)({email:"",password:"",name:""}),k=(e,t)=>j(a=>({...a,[e]:t})),w=async e=>{if(e.preventDefault(),!v.email||!v.password){h.default.error("Please fill in all fields");return}if("register"===a&&!v.name){h.default.error("Name is required");return}f(!0);try{let e="login"===a?await p.I8.login({email:v.email,password:v.password}):await p.I8.register({email:v.email,password:v.password,name:v.name});localStorage.setItem("muse_token",e.token),h.default.success("login"===a?"Welcome back!":"Account created!"),t(e.user)}catch(e){h.default.error(e.message||"Authentication failed")}finally{f(!1)}};return(0,s.jsxs)("div",{className:"min-h-screen flex items-center justify-center p-4",style:{background:"linear-gradient(135deg, #0f0f1a 0%, #1a1040 50%, #0f0f1a 100%)"},children:[(0,s.jsxs)("div",{className:"fixed inset-0 overflow-hidden pointer-events-none",children:[(0,s.jsx)("div",{className:"absolute top-1/4 left-1/4 w-96 h-96 rounded-full opacity-20",style:{background:"radial-gradient(circle, #6366f1, transparent)",filter:"blur(60px)"}}),(0,s.jsx)("div",{className:"absolute bottom-1/4 right-1/4 w-96 h-96 rounded-full opacity-20",style:{background:"radial-gradient(circle, #a855f7, transparent)",filter:"blur(60px)"}})]}),(0,s.jsxs)(n.E.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"w-full max-w-md relative z-10",children:[(0,s.jsxs)("div",{className:"text-center mb-8",children:[(0,s.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-2xl mb-4",style:{background:"linear-gradient(135deg, #6366f1, #a855f7)"},children:(0,s.jsx)(r.Z,{className:"w-8 h-8 text-white"})}),(0,s.jsx)("h1",{className:"text-3xl font-bold text-white",children:"Muse Pro"}),(0,s.jsx)("p",{className:"text-gray-400 mt-1 text-sm",children:"AI-Powered Athlete Biography Platform"})]}),(0,s.jsxs)("div",{className:"glass rounded-2xl p-8",children:[(0,s.jsx)("div",{className:"flex rounded-xl p-1 mb-6",style:{background:"rgba(255,255,255,0.05)"},children:["login","register"].map(e=>(0,s.jsx)("button",{onClick:()=>o(e),className:"flex-1 py-2 rounded-lg text-sm font-semibold transition-all duration-200",style:a===e?{background:"linear-gradient(135deg, #6366f1, #a855f7)",color:"white"}:{color:"#9ca3af"},children:"login"===e?"Sign In":"Create Account"},e))}),(0,s.jsxs)("form",{onSubmit:w,className:"space-y-4",children:[(0,s.jsx)(i.M,{mode:"wait",children:"register"===a&&(0,s.jsx)(n.E.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},children:(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(c,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),(0,s.jsx)("input",{type:"text",placeholder:"Your full name",value:v.name,onChange:e=>k("name",e.target.value),className:"w-full pl-10 pr-4 py-3 rounded-xl text-sm outline-none transition-all",style:{background:"rgba(255,255,255,0.07)",border:"1.5px solid rgba(255,255,255,0.1)",color:"white"}})]})},"name")}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(d,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),(0,s.jsx)("input",{type:"email",placeholder:"Email address",value:v.email,onChange:e=>k("email",e.target.value),className:"w-full pl-10 pr-4 py-3 rounded-xl text-sm outline-none transition-all",style:{background:"rgba(255,255,255,0.07)",border:"1.5px solid rgba(255,255,255,0.1)",color:"white"}})]}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(x.Z,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),(0,s.jsx)("input",{type:g?"text":"password",placeholder:"Password",value:v.password,onChange:e=>k("password",e.target.value),className:"w-full pl-10 pr-10 py-3 rounded-xl text-sm outline-none transition-all",style:{background:"rgba(255,255,255,0.07)",border:"1.5px solid rgba(255,255,255,0.1)",color:"white"}}),(0,s.jsx)("button",{type:"button",onClick:()=>b(!g),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-white transition-colors",children:g?(0,s.jsx)(u.Z,{className:"w-4 h-4"}):(0,s.jsx)(m.Z,{className:"w-4 h-4"})})]}),(0,s.jsx)("button",{type:"submit",disabled:y,className:"btn-primary w-full py-3 mt-2",children:y?(0,s.jsxs)("span",{className:"flex items-center justify-center gap-2",children:[(0,s.jsx)("span",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"login"===a?"Signing in...":"Creating account..."]}):"login"===a?"Sign In":"Create Account"})]}),(0,s.jsxs)("p",{className:"text-center text-gray-500 text-xs mt-6",children:["login"===a?"Don't have an account? ":"Already have an account? ",(0,s.jsx)("button",{onClick:()=>o("login"===a?"register":"login"),className:"text-indigo-400 hover:text-indigo-300 font-medium transition-colors",children:"login"===a?"Sign up":"Sign in"})]})]})]})]})}var f=a(4033);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let g=(0,o.Z)("Users",[["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"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]),b=(0,o.Z)("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]),v=(0,o.Z)("FileText",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["line",{x1:"16",x2:"8",y1:"13",y2:"13",key:"14keom"}],["line",{x1:"16",x2:"8",y1:"17",y2:"17",key:"17nazh"}],["line",{x1:"10",x2:"8",y1:"9",y2:"9",key:"1a5vjj"}]]),j=(0,o.Z)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);var k=a(4280);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let w=(0,o.Z)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);var N=a(2549),C=a(3523);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let S=(0,o.Z)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]),M=(0,o.Z)("MoreVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]),Z=(0,o.Z)("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]),T=(0,o.Z)("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]),L=(0,o.Z)("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]),D=(0,o.Z)("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);var E=a(3395),O=a(3248);let P=[{label:"Roots",color:"#6366f1",threshold:25},{label:"Journey",color:"#a855f7",threshold:50},{label:"Glory",color:"#f59e0b",threshold:75},{label:"Legacy",color:"#10b981",threshold:100}];function A(e){let{client:t,index:a,onInterview:i,onCopyLink:o,onDelete:c,onViewBook:x,onReset:u,onRegenerateLink:m}=e,[h,p]=(0,l.useState)(!1),y="active"===t.status?"badge-active":"completed"===t.status?"badge-completed":"badge-pending",f=P.find(e=>t.progress<e.threshold)||P[3],g=(Array.isArray(t.messages)?t.messages:[]).filter(e=>"chapter_end"===e.type&&e.chapterComplete).length;return(0,s.jsxs)(n.E.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.05*a,duration:.35},className:"card p-5 flex flex-col gap-3 relative",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,s.jsx)("div",{className:"w-11 h-11 rounded-xl flex items-center justify-center text-2xl flex-shrink-0",style:{background:"linear-gradient(135deg, rgba(99,102,241,0.12), rgba(168,85,247,0.12))"},children:(0,O.w2)(t.sport)}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("h3",{className:"font-bold text-sm truncate",style:{color:"var(--text-primary)"},children:t.name}),(0,s.jsx)("p",{className:"text-xs truncate",style:{color:"var(--text-secondary)"},children:t.bookTitle}),(0,s.jsx)("p",{className:"text-xs mt-0.5",style:{color:"var(--text-secondary)"},children:t.email})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[(0,s.jsx)("span",{className:y,children:t.status}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("button",{onClick:()=>p(!h),className:"btn-ghost p-1.5 rounded-lg",title:"More options",children:(0,s.jsx)(M,{className:"w-3.5 h-3.5"})}),h&&(0,s.jsxs)("div",{className:"absolute right-0 top-full mt-1 w-44 rounded-xl shadow-xl border z-50 overflow-hidden",style:{background:"var(--bg-card)",borderColor:"var(--border)"},onMouseLeave:()=>p(!1),children:[(0,s.jsxs)("button",{onClick:()=>{m(),p(!1)},className:"w-full px-3 py-2.5 text-left text-xs flex items-center gap-2 hover:bg-indigo-50 dark:hover:bg-indigo-900/20 transition-colors",style:{color:"var(--text-primary)"},children:[(0,s.jsx)(k.Z,{className:"w-3.5 h-3.5 text-indigo-500"})," Regenerate Link"]}),(0,s.jsxs)("button",{onClick:()=>{window.open("mailto:".concat(t.email,"?subject=Your Interview Link&body=Hi ").concat(t.name,", here is your interview link: ").concat(window.location.origin,"/interview/link/").concat(t.uniqueLink)),p(!1)},className:"w-full px-3 py-2.5 text-left text-xs flex items-center gap-2 hover:bg-indigo-50 dark:hover:bg-indigo-900/20 transition-colors",style:{color:"var(--text-primary)"},children:[(0,s.jsx)(d,{className:"w-3.5 h-3.5 text-purple-500"})," Email Link"]}),(0,s.jsx)("div",{className:"border-t",style:{borderColor:"var(--border)"}}),(0,s.jsxs)("button",{onClick:()=>{u(),p(!1)},className:"w-full px-3 py-2.5 text-left text-xs flex items-center gap-2 hover:bg-amber-50 dark:hover:bg-amber-900/20 transition-colors text-amber-600",children:[(0,s.jsx)(Z,{className:"w-3.5 h-3.5"})," Reset Interview"]}),(0,s.jsxs)("button",{onClick:()=>{c(),p(!1)},className:"w-full px-3 py-2.5 text-left text-xs flex items-center gap-2 hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors text-red-500",children:[(0,s.jsx)(S,{className:"w-3.5 h-3.5"})," Delete Client"]})]})]})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex justify-between text-xs mb-1.5",children:[(0,s.jsx)("span",{style:{color:"var(--text-secondary)"},children:g>0?"".concat(g,"/12 chapters"):"".concat(t.progress,"% complete")}),(0,s.jsx)("span",{style:{color:f.color,fontWeight:600},children:t.progress>0?f.label:"Not started"})]}),(0,s.jsx)(E.Z,{value:t.progress}),(0,s.jsx)("div",{className:"flex mt-1.5 gap-0.5",children:P.map(e=>(0,s.jsx)("div",{className:"flex-1 h-1 rounded-full transition-all",style:{background:t.progress>=e.threshold?e.color:"".concat(e.color,"25")}},e.label))})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3 text-xs",style:{color:"var(--text-secondary)"},children:[(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)(T,{className:"w-3 h-3"}),(0,O.pi)(t.lastActive)]}),(0,s.jsx)("span",{children:"•"}),(0,s.jsx)("span",{className:"capitalize",children:t.sport}),(0,s.jsx)("span",{children:"•"}),(0,s.jsxs)("span",{children:[(0,O.CJ)(t.wordCount)," words"]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2 px-2.5 py-1.5 rounded-lg text-xs truncate",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)"},children:[(0,s.jsx)(L,{className:"w-3 h-3 flex-shrink-0",style:{color:"#6366f1"}}),(0,s.jsxs)("span",{className:"truncate",style:{color:"var(--text-secondary)"},children:["/interview/link/",t.uniqueLink]}),(0,s.jsx)("button",{onClick:o,className:"flex-shrink-0 text-indigo-500 hover:text-indigo-400 font-medium ml-auto",children:"Copy"})]}),(0,s.jsxs)("div",{className:"flex gap-2 pt-1 border-t",style:{borderColor:"var(--border)"},children:[(0,s.jsxs)("button",{onClick:i,className:"btn-primary flex-1 py-2 text-xs flex items-center justify-center gap-1.5",children:[(0,s.jsx)(D,{className:"w-3.5 h-3.5"}),"pending"===t.status?"Start Interview":"Continue"]}),t.bookDraft&&(0,s.jsxs)("button",{onClick:x,className:"btn-secondary py-2 px-3 text-xs flex items-center gap-1.5",title:"View book",children:[(0,s.jsx)(r.Z,{className:"w-3.5 h-3.5"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"Book"})]})]})]})}function z(e){let{label:t,value:a,icon:l,color:i,delay:r=0}=e;return(0,s.jsxs)(n.E.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:r,duration:.4},className:"card p-5 flex items-center gap-4",children:[(0,s.jsx)("div",{className:"w-12 h-12 rounded-xl flex items-center justify-center flex-shrink-0",style:{background:"".concat(i,"18")},children:(0,s.jsx)(l,{className:"w-6 h-6",style:{color:i}})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-2xl font-bold",style:{color:"var(--text-primary)"},children:a}),(0,s.jsx)("p",{className:"text-sm",style:{color:"var(--text-secondary)"},children:t})]})]})}var I=a(4691);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let q=[{label:"Home",icon:(0,o.Z)("Home",[["path",{d:"m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"y5dka4"}],["polyline",{points:"9 22 9 12 15 12 15 22",key:"e2us08"}]]),path:"/",match:e=>"/"===e},{label:"Clients",icon:g,path:"/?tab=clients",match:e=>e.includes("clients")},{label:"Analytics",icon:(0,o.Z)("BarChart2",[["line",{x1:"18",x2:"18",y1:"20",y2:"10",key:"1xfpm4"}],["line",{x1:"12",x2:"12",y1:"20",y2:"4",key:"be30l9"}],["line",{x1:"6",x2:"6",y1:"20",y2:"14",key:"1r4le6"}]]),path:"/?tab=analytics",match:e=>e.includes("analytics")},{label:"Profile",icon:c,path:"/?tab=profile",match:e=>e.includes("profile")}];function J(e){let{activeTab:t="home",onTabChange:a}=e;return(0,f.useRouter)(),(0,s.jsx)("nav",{className:"fixed bottom-0 left-0 right-0 z-40 safe-bottom border-t lg:hidden",style:{background:"var(--bg-card)",borderColor:"var(--border)"},children:(0,s.jsx)("div",{className:"flex items-center justify-around px-2 py-2",children:q.map(e=>{let l=t===e.label.toLowerCase();return(0,s.jsxs)("button",{onClick:()=>{"vibrate"in navigator&&navigator.vibrate(30),null==a||a(e.label.toLowerCase())},className:"flex flex-col items-center gap-1 px-4 py-1.5 rounded-xl transition-all touch-target",style:{minWidth:60},children:[(0,s.jsx)(n.E.div,{animate:{scale:l?1.1:1},transition:{type:"spring",stiffness:400,damping:20},children:(0,s.jsx)(e.icon,{className:"w-5 h-5",style:{color:l?"#6366f1":"var(--text-secondary)"}})}),(0,s.jsx)("span",{className:"text-xs font-medium",style:{color:l?"#6366f1":"var(--text-secondary)",fontSize:10},children:e.label}),l&&(0,s.jsx)(n.E.div,{layoutId:"nav-indicator",className:"absolute bottom-1 w-1 h-1 rounded-full bg-indigo-500"})]},e.label)})})})}/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let F=(0,o.Z)("WifiOff",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M8.5 16.5a5 5 0 0 1 7 0",key:"sej527"}],["path",{d:"M2 8.82a15 15 0 0 1 4.17-2.65",key:"11utq1"}],["path",{d:"M10.66 5c4.01-.36 8.14.9 11.34 3.76",key:"hxefdu"}],["path",{d:"M16.85 11.25a10 10 0 0 1 2.22 1.68",key:"q734kn"}],["path",{d:"M5 13a10 10 0 0 1 5.24-2.76",key:"piq4yl"}],["line",{x1:"12",x2:"12.01",y1:"20",y2:"20",key:"of4bc4"}]]);function R(){let[e,t]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{let e=()=>t(!1),a=()=>t(!0);return t(!navigator.onLine),window.addEventListener("online",e),window.addEventListener("offline",a),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",a)}},[]),(0,s.jsx)(i.M,{children:e&&(0,s.jsxs)(n.E.div,{initial:{y:-40,opacity:0},animate:{y:0,opacity:1},exit:{y:-40,opacity:0},className:"fixed top-0 left-0 right-0 z-50 flex items-center justify-center gap-2 py-2 text-white text-xs font-semibold",style:{background:"#ef4444"},children:[(0,s.jsx)(F,{className:"w-3.5 h-3.5"}),"No internet connection",(0,s.jsxs)("button",{onClick:()=>window.location.reload(),className:"flex items-center gap-1 underline ml-1",children:[(0,s.jsx)(k.Z,{className:"w-3 h-3"})," Retry"]})]})})}var _=a(1671);let B=["baseball","football","basketball","cricket","boxing","athletics","tennis","soccer"];function H(e){let{user:t,onLogout:a}=e,o=(0,f.useRouter)(),[c,d]=(0,l.useState)([]),[x,u]=(0,l.useState)([]),[m,y]=(0,l.useState)(null),[M,Z]=(0,l.useState)("home"),[T,L]=(0,l.useState)(!0),[D,E]=(0,l.useState)(!1),[P,q]=(0,l.useState)(""),[F,H]=(0,l.useState)("all"),[V,U]=(0,l.useState)(!1),[W,G]=(0,l.useState)(null),[Y,X]=(0,l.useState)({name:"",email:"",bookTitle:"",sport:"baseball"}),[K,Q]=(0,l.useState)(!1),$=(0,l.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e?E(!0):L(!0);try{let[e,t]=await Promise.all([p.yj.list(),p.co.get()]);y(t),u(e.clients)}catch(e){h.default.error(e.message||"Failed to load data")}finally{L(!1),E(!1)}},[]);(0,l.useEffect)(()=>{$()},[]),(0,l.useEffect)(()=>{let e=x;if("all"!==F&&(e=e.filter(e=>e.status===F)),P.trim()){let t=P.toLowerCase();e=e.filter(e=>e.name.toLowerCase().includes(t)||e.bookTitle.toLowerCase().includes(t))}d(e)},[x,F,P]);let ee=async e=>{if(e.preventDefault(),!Y.name||!Y.email||!Y.bookTitle){h.default.error("Please fill in all fields");return}Q(!0);try{await p.yj.create(Y),h.default.success("".concat(Y.name," added successfully!")),U(!1),X({name:"",email:"",bookTitle:"",sport:"baseball"}),$(!0)}catch(e){var t;(null===(t=e.message)||void 0===t?void 0:t.includes("already exists"))?h.default.error(e.message,{duration:5e3}):h.default.error(e.message||"Failed to add client")}finally{Q(!1)}},et=async e=>{try{await p.yj.delete(e),h.default.success("Client deleted"),G(null),$(!0)}catch(e){h.default.error(e.message||"Failed to delete")}},ea=async e=>{if(confirm("Reset this interview? All messages will be cleared but the client will remain."))try{await p.yj.reset(e),h.default.success("Interview reset successfully"),$(!0)}catch(e){h.default.error(e.message||"Failed to reset")}},es=async e=>{try{let t=await p.yj.regenerateLink(e.id);h.default.success("New link generated!"),navigator.clipboard.writeText("".concat(window.location.origin,"/interview/link/").concat(t.uniqueLink)),(0,h.default)("New link copied to clipboard",{icon:"\uD83D\uDCCB"}),$(!0)}catch(e){h.default.error(e.message||"Failed to regenerate link")}},el=e=>{let t="".concat(window.location.origin,"/interview/link/").concat(e.uniqueLink);navigator.clipboard.writeText(t),h.default.success("Interview link copied!")};return(0,s.jsxs)("div",{className:"min-h-screen has-bottom-nav lg:pb-0",style:{background:"var(--bg-secondary)"},children:[(0,s.jsx)(R,{}),(0,s.jsx)("header",{className:"sticky top-0 z-40 border-b",style:{background:"var(--bg-card)",borderColor:"var(--border)"},children:(0,s.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 h-16 flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"w-9 h-9 rounded-xl flex items-center justify-center",style:{background:"linear-gradient(135deg, #6366f1, #a855f7)"},children:(0,s.jsx)(r.Z,{className:"w-5 h-5 text-white"})}),(0,s.jsx)("span",{className:"font-bold text-lg gradient-text",children:"Muse Pro"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsxs)("div",{className:"hidden sm:flex items-center gap-2 text-sm",style:{color:"var(--text-secondary)"},children:[(0,s.jsx)("div",{className:"w-7 h-7 rounded-full flex items-center justify-center text-white text-xs font-bold",style:{background:"linear-gradient(135deg, #6366f1, #a855f7)"},children:t.name[0].toUpperCase()}),(0,s.jsx)("span",{children:t.name})]}),(0,s.jsx)("button",{onClick:a,className:"btn-ghost text-xs",children:"Sign out"})]})]})}),(0,s.jsxs)("main",{className:"max-w-7xl mx-auto px-4 sm:px-6 py-8",children:[m?(0,s.jsxs)("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3 mb-6",children:[(0,s.jsx)(z,{label:"Total Clients",value:m.total,icon:g,color:"#6366f1",delay:0}),(0,s.jsx)(z,{label:"Active Interviews",value:m.active,icon:b,color:"#a855f7",delay:.05}),(0,s.jsx)(z,{label:"Books Completed",value:m.completed,icon:r.Z,color:"#10b981",delay:.1}),(0,s.jsx)(z,{label:"Total Words",value:(0,O.CJ)(m.totalWords),icon:v,color:"#f59e0b",delay:.15})]}):(0,s.jsx)("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3 mb-6",children:[1,2,3,4].map(e=>(0,s.jsx)(_.ZT,{},e))}),(0,s.jsxs)("div",{className:"flex flex-col sm:flex-row gap-3 mb-6",children:[(0,s.jsxs)("div",{className:"relative flex-1",children:[(0,s.jsx)(j,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4",style:{color:"var(--text-secondary)"}}),(0,s.jsx)("input",{type:"text",placeholder:"Search clients...",value:P,onChange:e=>q(e.target.value),className:"input-field pl-9"})]}),(0,s.jsx)("div",{className:"flex gap-2",children:["all","active","completed","pending"].map(e=>(0,s.jsx)("button",{onClick:()=>H(e),className:"px-3 py-2 rounded-lg text-xs font-semibold capitalize transition-all",style:F===e?{background:"linear-gradient(135deg, #6366f1, #a855f7)",color:"white"}:{background:"var(--bg-card)",color:"var(--text-secondary)",border:"1px solid var(--border)"},children:e},e))}),(0,s.jsx)("button",{onClick:()=>$(!0),disabled:D,className:"btn-secondary flex items-center gap-2 px-3",children:(0,s.jsx)(k.Z,{className:"w-4 h-4 ".concat(D?"animate-spin":"")})}),(0,s.jsxs)("button",{onClick:()=>U(!0),className:"btn-primary flex items-center gap-2",children:[(0,s.jsx)(w,{className:"w-4 h-4"})," Add Client"]})]}),T?(0,s.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:[1,2,3,4,5,6].map(e=>(0,s.jsx)(_.bG,{},e))}):0===c.length?(0,s.jsxs)("div",{className:"text-center py-20",children:[(0,s.jsx)("div",{className:"w-16 h-16 rounded-2xl mx-auto mb-4 flex items-center justify-center",style:{background:"rgba(99,102,241,0.1)"},children:(0,s.jsx)(g,{className:"w-8 h-8",style:{color:"#6366f1"}})}),(0,s.jsx)("p",{className:"font-semibold mb-1",style:{color:"var(--text-primary)"},children:"No clients yet"}),(0,s.jsx)("p",{className:"text-sm mb-4",style:{color:"var(--text-secondary)"},children:"Add your first athlete to get started"}),(0,s.jsxs)("button",{onClick:()=>U(!0),className:"btn-primary",children:[(0,s.jsx)(w,{className:"w-4 h-4 inline mr-1"})," Add Client"]})]}):(0,s.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:c.map((e,t)=>(0,s.jsx)(A,{client:e,index:t,onInterview:()=>o.push("/interview/".concat(e.id)),onCopyLink:()=>el(e),onDelete:()=>G(e.id),onViewBook:()=>o.push("/book/".concat(e.id)),onReset:()=>ea(e.id),onRegenerateLink:()=>es(e)},e.id))})]}),(0,s.jsx)(i.M,{children:V&&(0,s.jsx)(n.E.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-50 flex items-center justify-center p-4",style:{background:"rgba(0,0,0,0.6)",backdropFilter:"blur(4px)"},onClick:e=>e.target===e.currentTarget&&U(!1),children:(0,s.jsxs)(n.E.div,{initial:{scale:.95,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.95,opacity:0},className:"card w-full max-w-md p-6",style:{background:"var(--bg-card)"},children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-5",children:[(0,s.jsx)("h2",{className:"font-bold text-lg",style:{color:"var(--text-primary)"},children:"Add New Client"}),(0,s.jsx)("button",{onClick:()=>U(!1),className:"btn-ghost p-1.5 rounded-lg",children:(0,s.jsx)(N.Z,{className:"w-4 h-4"})})]}),(0,s.jsxs)("form",{onSubmit:ee,className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium mb-1.5",style:{color:"var(--text-secondary)"},children:"Athlete Name"}),(0,s.jsx)("input",{type:"text",placeholder:"e.g. Michael Jordan",value:Y.name,onChange:e=>X(t=>({...t,name:e.target.value})),className:"input-field"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium mb-1.5",style:{color:"var(--text-secondary)"},children:"Email"}),(0,s.jsx)("input",{type:"email",placeholder:"athlete@email.com",value:Y.email,onChange:e=>X(t=>({...t,email:e.target.value})),className:"input-field"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium mb-1.5",style:{color:"var(--text-secondary)"},children:"Book Title"}),(0,s.jsx)("input",{type:"text",placeholder:"e.g. The Last Dance",value:Y.bookTitle,onChange:e=>X(t=>({...t,bookTitle:e.target.value})),className:"input-field"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium mb-1.5",style:{color:"var(--text-secondary)"},children:"Sport"}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("select",{value:Y.sport,onChange:e=>X(t=>({...t,sport:e.target.value})),className:"input-field appearance-none pr-8 capitalize",children:B.map(e=>(0,s.jsx)("option",{value:e,children:e},e))}),(0,s.jsx)(C.Z,{className:"absolute right-3 top-1/2 -translate-y-1/2 w-4 h-4 pointer-events-none",style:{color:"var(--text-secondary)"}})]})]}),(0,s.jsxs)("div",{className:"flex gap-3 pt-2",children:[(0,s.jsx)("button",{type:"button",onClick:()=>U(!1),className:"btn-secondary flex-1",children:"Cancel"}),(0,s.jsx)("button",{type:"submit",disabled:K,className:"btn-primary flex-1",children:K?(0,s.jsx)(I.Z,{size:"sm"}):"Add Client"})]})]})]})})}),(0,s.jsx)(i.M,{children:W&&(0,s.jsx)(n.E.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-50 flex items-center justify-center p-4",style:{background:"rgba(0,0,0,0.6)",backdropFilter:"blur(4px)"},children:(0,s.jsxs)(n.E.div,{initial:{scale:.95},animate:{scale:1},exit:{scale:.95},className:"card w-full max-w-sm p-6 text-center",style:{background:"var(--bg-card)"},children:[(0,s.jsx)("div",{className:"w-12 h-12 rounded-full bg-red-100 flex items-center justify-center mx-auto mb-4",children:(0,s.jsx)(S,{className:"w-6 h-6 text-red-500"})}),(0,s.jsx)("h3",{className:"font-bold mb-2",style:{color:"var(--text-primary)"},children:"Delete Client?"}),(0,s.jsx)("p",{className:"text-sm mb-5",style:{color:"var(--text-secondary)"},children:"This will permanently delete the client and all interview data."}),(0,s.jsxs)("div",{className:"flex gap-3",children:[(0,s.jsx)("button",{onClick:()=>G(null),className:"btn-secondary flex-1",children:"Cancel"}),(0,s.jsx)("button",{onClick:()=>et(W),className:"flex-1 py-2.5 rounded-xl font-semibold text-sm text-white bg-red-500 hover:bg-red-600 transition-colors",children:"Delete"})]})]})})}),(0,s.jsx)(J,{activeTab:M,onTabChange:Z})]})}function V(){let[e,t]=(0,l.useState)(null),[a,n]=(0,l.useState)(!0),i=(0,l.useCallback)(async()=>{if(!localStorage.getItem("muse_token")){n(!1);return}try{let{user:e}=await p.I8.verify();t(e)}catch(e){localStorage.removeItem("muse_token")}finally{n(!1)}},[]);(0,l.useEffect)(()=>{i()},[i]);let r=async()=>{try{await p.I8.logout()}catch(e){}localStorage.removeItem("muse_token"),t(null)};return a?(0,s.jsx)("div",{className:"min-h-screen flex items-center justify-center",style:{background:"var(--bg-primary)"},children:(0,s.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[(0,s.jsx)("div",{className:"w-12 h-12 rounded-2xl flex items-center justify-center",style:{background:"linear-gradient(135deg, #6366f1, #a855f7)"},children:(0,s.jsx)("span",{className:"text-white text-xl font-bold",children:"M"})}),(0,s.jsxs)("div",{className:"flex gap-1.5",children:[(0,s.jsx)("div",{className:"typing-dot"}),(0,s.jsx)("div",{className:"typing-dot",style:{animationDelay:"0.2s"}}),(0,s.jsx)("div",{className:"typing-dot",style:{animationDelay:"0.4s"}})]})]})}):e?(0,s.jsx)(H,{user:e,onLogout:r}):(0,s.jsx)(y,{onLogin:e=>t(e)})}},4691:function(e,t,a){"use strict";a.d(t,{Z:function(){return l}});var s=a(7437);function l(e){let{size:t="md"}=e;return(0,s.jsx)("div",{className:"".concat({sm:"w-4 h-4",md:"w-6 h-6",lg:"w-10 h-10"}[t]," border-2 rounded-full animate-spin"),style:{borderColor:"rgba(99,102,241,0.2)",borderTopColor:"#6366f1"}})}},3395:function(e,t,a){"use strict";a.d(t,{Z:function(){return l}});var s=a(7437);function l(e){let{value:t,className:a=""}=e,l=Math.min(Math.max(t,0),100);return(0,s.jsx)("div",{className:"progress-bar ".concat(a),role:"progressbar","aria-valuenow":l,"aria-valuemin":0,"aria-valuemax":100,children:(0,s.jsx)("div",{className:"progress-fill",style:{width:"".concat(l,"%")}})})}},1671:function(e,t,a){"use strict";a.d(t,{ZT:function(){return n},bG:function(){return l},tz:function(){return i}});var s=a(7437);function l(){return(0,s.jsxs)("div",{className:"card p-5 flex flex-col gap-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"skeleton w-11 h-11 rounded-xl"}),(0,s.jsxs)("div",{className:"flex-1 space-y-2",children:[(0,s.jsx)("div",{className:"skeleton h-4 w-32 rounded"}),(0,s.jsx)("div",{className:"skeleton h-3 w-24 rounded"})]}),(0,s.jsx)("div",{className:"skeleton h-5 w-16 rounded-full"})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsxs)("div",{className:"flex justify-between",children:[(0,s.jsx)("div",{className:"skeleton h-3 w-20 rounded"}),(0,s.jsx)("div",{className:"skeleton h-3 w-16 rounded"})]}),(0,s.jsx)("div",{className:"skeleton h-1.5 w-full rounded-full"})]}),(0,s.jsx)("div",{className:"skeleton h-3 w-28 rounded"}),(0,s.jsx)("div",{className:"skeleton h-8 w-full rounded-xl"})]})}function n(){return(0,s.jsxs)("div",{className:"card p-5 flex items-center gap-4",children:[(0,s.jsx)("div",{className:"skeleton w-12 h-12 rounded-xl"}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("div",{className:"skeleton h-6 w-16 rounded"}),(0,s.jsx)("div",{className:"skeleton h-3 w-24 rounded"})]})]})}function i(e){let{isUser:t=!1}=e;return(0,s.jsxs)("div",{className:"flex ".concat(t?"justify-end":"justify-start"," gap-2"),children:[!t&&(0,s.jsx)("div",{className:"skeleton w-7 h-7 rounded-full flex-shrink-0"}),(0,s.jsx)("div",{className:"skeleton rounded-2xl ".concat(t?"w-48 h-12":"w-64 h-16")})]})}},3248:function(e,t,a){"use strict";function s(e){return e>=1e3?"".concat((e/1e3).toFixed(1),"k"):e.toString()}function l(e){var t;return null!==(t=({baseball:"⚾",football:"\uD83C\uDFC8",basketball:"\uD83C\uDFC0",cricket:"\uD83C\uDFCF",boxing:"\uD83E\uDD4A",athletics:"\uD83C\uDFC3",tennis:"\uD83C\uDFBE",soccer:"⚽"})[e])&&void 0!==t?t:"\uD83C\uDFC5"}function n(e){let t=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(t<1)return"just now";if(t<60)return"".concat(t,"m ago");let a=Math.floor(t/60);return a<24?"".concat(a,"h ago"):"".concat(Math.floor(a/24),"d ago")}a.d(t,{CJ:function(){return s},pi:function(){return n},w2:function(){return l}})},8013:function(e,t,a){"use strict";a.d(t,{I8:function(){return n},T6:function(){return r},co:function(){return c},s9:function(){return o},yj:function(){return i}});let s=()=>localStorage.getItem("muse_token");async function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=s(),l={"Content-Type":"application/json",...t.headers};a&&(l.Authorization="Bearer ".concat(a));let n=await fetch("".concat("https://api.wailmehmood.com").concat(e),{...t,headers:l}),i=await n.json();if(!n.ok)throw Error(i.error||"Request failed: ".concat(n.status));return i}let n={register:e=>l("/api/auth/register",{method:"POST",body:JSON.stringify(e)}),login:e=>l("/api/auth/login",{method:"POST",body:JSON.stringify(e)}),verify:()=>l("/api/auth/verify"),logout:()=>l("/api/auth/logout",{method:"POST"})},i={create:e=>l("/api/clients",{method:"POST",body:JSON.stringify(e)}),list:e=>{let t=e?"?"+new URLSearchParams(e).toString():"";return l("/api/clients".concat(t))},get:e=>l("/api/clients/".concat(e)),update:(e,t)=>l("/api/clients/".concat(e),{method:"PUT",body:JSON.stringify(t)}),delete:e=>l("/api/clients/".concat(e),{method:"DELETE"}),getByLink:e=>l("/api/interview/link/".concat(e)),reset:e=>l("/api/clients/".concat(e,"/reset"),{method:"POST"}),regenerateLink:e=>l("/api/clients/".concat(e,"/regenerate-link"),{method:"POST"}),getStats:e=>l("/api/clients/".concat(e,"/stats"))},r={getState:e=>l("/api/interview/state/".concat(e)),startChapter:e=>l("/api/interview/chapter/start",{method:"POST",body:JSON.stringify(e)}),sendMessage:e=>l("/api/interview/message",{method:"POST",body:JSON.stringify(e)}),completeChapter:e=>l("/api/interview/chapter/complete",{method:"POST",body:JSON.stringify(e)}),getInsights:e=>{let t=localStorage.getItem("muse_token");return fetch("".concat("https://api.wailmehmood.com","/api/interview/insights/").concat(e),{headers:{Authorization:"Bearer ".concat(t)}}).then(e=>e.json())}},o={generate:e=>l("/api/book/generate",{method:"POST",body:JSON.stringify({clientId:e})}),get:e=>l("/api/book/".concat(e)),save:(e,t)=>l("/api/book/".concat(e),{method:"PUT",body:JSON.stringify({bookDraft:t})}),export:(e,t)=>l("/api/book/export",{method:"POST",body:JSON.stringify({clientId:e,format:t})}),regenerateChapter:(e,t)=>l("/api/book/regenerate-chapter",{method:"POST",body:JSON.stringify({clientId:e,chapterNum:t})}),preview:(e,t)=>l("/api/interview/preview",{method:"POST",body:JSON.stringify({clientId:e,chapterNum:t})})},c={get:()=>l("/api/analytics")}}},function(e){e.O(0,[114,971,938,744],function(){return e(e.s=4531)}),_N_E=e.O()}]);