PageSourceSearch

https://my-university.pro/assets/TalentProfile-CDUEOvo--c2.js

js my-university.pro collected 2026-10-08 02:57:25 UTC 26,300 bytes, 1 lines download raw bytes

1import{p as Ie,r as x,C as J,D as A,j as e}from"./vendor-react-BnQ9fM-T-c2.js";import{C as L,d as $,a as H,b as U,c as V}from"./card-DMgMxTuf-c2.js";import{Z as Oe,b as $e,S as K,F as ie,G as xe,B as pe,m as k,a5 as ne,q as f,a as D,O as qe,Y as _e,c as ze,U as Ke,C as Be}from"./App-D7PYqPVb-c2.js";import{B as _}from"./badge-s9qqEw5w-c2.js";import{P as Qe}from"./progress-B_rn_oTv-c2.js";import{T as Fe,a as Me,b as F,c as M}from"./tabs-Cvr2UY0n-c2.js";import{D as le,f as re,a as de,b as ce,c as oe,d as me,e as he}from"./dialog-DaefULPF-c2.js";import{I as q}from"./input-IxzIx0tf-c2.js";import{L as T}from"./label-DOkvVJSv-c2.js";import{S as fe,a as ge,b as je,c as ve,d as ye}from"./select-DuNUm4Sn-c2.js";import{S as Ne}from"./slider-c7W9jO-z-c2.js";import{T as Re}from"./textarea-CTYfRCUo-c2.js";import{P as He}from"./PageHeader-vPdpM4W6-c2.js";import{D as Ue}from"./DecorativeIcons-DG1sp69A-c2.js";import{H as Pe}from"./heart-5GuJR5Xu-c2.js";import{T as W}from"./trophy-DA9vMPOE-c2.js";import{P as Y}from"./plus-B9YN9Jpx-c2.js";import{P as Ve}from"./pen-line-BKFoEVbs-c2.js";import{T as Ge}from"./trash-2-BWeU1Ii--c2.js";import{A as Je}from"./award-DdNLWq_v-c2.js";import{T as We}from"./target-CJLFfOlO-c2.js";import{R as Ye}from"./rocket-DMq46uik-c2.js";import{B as Xe}from"./brain-DxITWZyB-c2.js";import{A as Ze}from"./atom-D59RCvij-c2.js";import{P as et}from"./palette-t0zjeCpf-c2.js";import{M as tt}from"./music-p5S7XA_G-c2.js";import{L as st}from"./languages-Bd0j5sRU-c2.js";import{C as at}from"./code-BPPtjA6a-c2.js";import"./index-BjKm8gLZ-c2.js";import"./vendor-ui-DPojF9f0-c2.js";import"./chevron-up-DxlMYeK3-c2.js";import"./arrow-left-D2DLFHle-c2.js";import"./pencil-DAJxxxuy-c2.js";const it={Calculator:Be,Code:at,Languages:st,Music:tt,Palette:et,Atom:Ze,Brain:Xe,Heart:Pe,Users:Ke,Rocket:Ye,BookOpen:ze,Target:We,Trophy:W,Award:Je,Star:K,GraduationCap:xe,Briefcase:pe};function be(p){return p?it[p]||K:K}function Ft({user:p}){const{t:s,i18n:N}=Ie(),P=N.language,{toast:n}=Oe(),[l,o]=x.useState("interests"),[g,S]=x.useState([]),[r,y]=x.useState([]),[j,c]=x.useState([]),[v,m]=x.useState(!1),[d,h]=x.useState(!1),[i,u]=x.useState(null),a=t=>P.startsWith("uk")&&t.name_uk?t.name_uk:P.startsWith("es")&&t.name_es?t.name_es:t.name,{data:C,isLoading:Se}=J({queryKey:["/api/talent-profile/catalogs"]}),{data:b,isLoading:ke}=J({queryKey:["/api/talent-profile"]}),Te=t=>{const w=N.language;return w==="uk"?t.nameUk||t.name_uk||t.name:w==="es"&&(t.nameEs||t.name_es)||t.name},z=t=>{t&&(n({title:s("gamification.badgeEarned","Badge earned!"),description:Te(t),duration:5e3}),f.invalidateQueries({queryKey:["/api/user/badges"]}),f.invalidateQueries({queryKey:["/api/gamification/summary"]}))},X=A({mutationFn:t=>D("PUT","/api/talent-profile/academic-interests",{interestIds:t}),onSuccess:t=>{f.invalidateQueries({queryKey:["/api/talent-profile"]}),f.invalidateQueries({queryKey:["/api/user/stats"]}),n({title:s("talentProfile.saved","Saved!")}),z(t.newBadge)}}),Z=A({mutationFn:t=>D("PUT","/api/talent-profile/career-interests",{interestIds:t}),onSuccess:t=>{f.invalidateQueries({queryKey:["/api/talent-profile"]}),f.invalidateQueries({queryKey:["/api/user/stats"]}),n({title:s("talentProfile.saved","Saved!")}),z(t.newBadge)}}),ee=A({mutationFn:t=>D("PUT","/api/talent-profile/skills",{skills:t}),onSuccess:t=>{f.invalidateQueries({queryKey:["/api/talent-profile"]}),f.invalidateQueries({queryKey:["/api/user/stats"]}),n({title:s("talentProfile.saved","Saved!")}),z(t.newBadge)}}),te=A({mutationFn:t=>D("POST","/api/talent-profile/tests",t),onSuccess:t=>{f.invalidateQueries({queryKey:["/api/talent-profile"]}),f.invalidateQueries({queryKey:["/api/user/stats"]}),m(!1),n({title:s("talentProfile.testAdded","Test added!")}),z(t.newBadge)}}),Ce=A({mutationFn:t=>D("DELETE",`/api/talent-profile/tests/${t}`),onSuccess:()=>{f.invalidateQueries({queryKey:["/api/talent-profile"]}),f.invalidateQueries({queryKey:["/api/user/stats"]}),n({title:s("talentProfile.testDeleted","Test removed")})}}),se=A({mutationFn:t=>D("POST","/api/talent-profile/achievements",t),onSuccess:t=>{f.invalidateQueries({queryKey:["/api/talent-profile"]}),f.invalidateQueries({queryKey:["/api/user/stats"]}),h(!1),n({title:s("talentProfile.achievementAdded","Achievement added!")}),z(t.newBadge)}}),we=A({mutationFn:t=>D("DELETE",`/api/talent-profile/achievements/${t}`),onSuccess:()=>{f.invalidateQueries({queryKey:["/api/talent-profile"]}),f.invalidateQueries({queryKey:["/api/user/stats"]}),n({title:s("talentProfile.achievementDeleted","Achievement removed")})}}),{data:Ae,isLoading:dt}=J({queryKey:["/api/talent-profile/custom-entries"]}),E=A({mutationFn:t=>D("POST","/api/talent-profile/custom-entries",t),onSuccess:()=>{f.invalidateQueries({queryKey:["/api/talent-profile/custom-entries"]}),u(null),n({title:s("talentProfile.customEntryAdded","Entry added!")})}}),I=A({mutationFn:t=>D("DELETE",`/api/talent-profile/custom-entries/${t}`),onSuccess:()=>{f.invalidateQueries({queryKey:["/api/talent-profile/custom-entries"]}),n({title:s("talentProfile.customEntryDeleted","Entry removed")})}}),B=t=>Ae?.filter(w=>w.section===t)||[],De=()=>{if(!b)return 0;let t=0;return b.academicInterests?.length>0&&(t+=25),b.careerInterests?.length>0&&(t+=25),b.skills?.length>0&&(t+=20),b.tests?.length>0&&(t+=15),b.achievements?.length>0&&(t+=15),t},Le=t=>s(`talentProfile.categories.${t}`,t),Q=t=>t.reduce((w,ae)=>{const Ee=ae.category||"Other",G=Le(Ee);return w[G]||(w[G]=[]),w[G].push(ae),w},{});if(Se||ke)return e.jsx("div",{className:"container py-8",children:e.jsxs("div",{className:"animate-pulse space-y-4",children:[e.jsx("div",{className:"h-8 bg-muted rounded w-1/3"}),e.jsx("div",{className:"h-4 bg-muted rounded w-1/2"}),e.jsx("div",{className:"grid gap-4 md:grid-cols-3 mt-6",children:[1,2,3].map(t=>e.jsx("div",{className:"h-32 bg-muted rounded"},t))})]})});const O=De();return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(Ue,{}),e.jsx(He,{title:s("talentProfile.title","My Talent Profile"),subtitle:s("talentProfile.subtitle","Show who you are and what you're good at"),icon:e.jsx($e,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{className:"container py-6 max-w-5xl pb-24 md:pb-10",children:[e.jsx(L,{className:"mb-6",children:e.jsxs($,{className:"pt-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4 mb-2",children:[e.jsx("span",{className:"text-sm font-medium",children:s("talentProfile.completeness","Profile Completeness")}),e.jsxs(_,{variant:O>=80?"default":"secondary","data-testid":"badge-completeness",children:[O,"%"]})]}),e.jsx(Qe,{value:O,className:"h-2","data-testid":"progress-completeness"}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:[O<50&&s("talentProfile.completenessLow","Add more details to stand out!"),O>=50&&O<80&&s("talentProfile.completenessMedium","Great progress! Keep going."),O>=80&&s("talentProfile.completenessHigh","Awesome! Your profile looks great.")]})]})}),e.jsxs(Fe,{value:l,onValueChange:o,className:"space-y-6",children:[e.jsxs(Me,{className:"grid w-full grid-cols-4 lg:grid-cols-4",children:[e.jsxs(F,{value:"interests",className:"flex items-center gap-1 text-xs sm:text-sm","data-testid":"tab-interests",children:[e.jsx(Pe,{className:"h-4 w-4 hidden sm:block"}),s("talentProfile.tabs.interests","Interests")]}),e.jsxs(F,{value:"skills",className:"flex items-center gap-1 text-xs sm:text-sm","data-testid":"tab-skills",children:[e.jsx(K,{className:"h-4 w-4 hidden sm:block"}),s("talentProfile.tabs.skills","Skills")]}),e.jsxs(F,{value:"tests",className:"flex items-center gap-1 text-xs sm:text-sm","data-testid":"tab-tests",children:[e.jsx(ie,{className:"h-4 w-4 hidden sm:block"}),s("talentProfile.tabs.tests","Tests")]}),e.jsxs(F,{value:"achievements",className:"flex items-center gap-1 text-xs sm:text-sm","data-testid":"tab-achievements",children:[e.jsx(W,{className:"h-4 w-4 hidden sm:block"}),s("talentProfile.tabs.achievements","Awards")]})]}),e.jsxs(M,{value:"interests",className:"space-y-6",children:[e.jsxs(L,{children:[e.jsxs(H,{
1children:[e.jsxs(U,{className:"flex items-center gap-2",children:[e.jsx(xe,{className:"h-5 w-5 text-primary"}),s("talentProfile.academicInterests","What subjects do you love?")]}),e.jsx(V,{children:s("talentProfile.academicInterestsDesc","Pick the subjects that excite you the most")})]}),e.jsx($,{children:C?.academicInterests&&e.jsx(ue,{items:C.academicInterests,selected:b?.academicInterests?.map(t=>t.interest_id)||[],getLocalizedName:a,groupByCategory:Q,onSave:t=>X.mutate(t),isPending:X.isPending,t:s})})]}),e.jsxs(L,{children:[e.jsxs(H,{children:[e.jsxs(U,{className:"flex items-center gap-2",children:[e.jsx(pe,{className:"h-5 w-5 text-primary"}),s("talentProfile.careerInterests","What careers interest you?")]}),e.jsx(V,{children:s("talentProfile.careerInterestsDesc","Dream big - what do you want to become?")})]}),e.jsx($,{children:C?.careerInterests&&e.jsx(ue,{items:C.careerInterests,selected:b?.careerInterests?.map(t=>t.interest_id)||[],getLocalizedName:a,groupByCategory:Q,onSave:t=>Z.mutate(t),isPending:Z.isPending,t:s})})]}),e.jsx(R,{section:"interests",entries:B("interests"),showLevel:!1,addOpen:i==="interests",setAddOpen:t=>u(t?"interests":null),onCreate:t=>E.mutate(t),onDelete:t=>I.mutate(t),createPending:E.isPending,deletePending:I.isPending,t:s})]}),e.jsxs(M,{value:"skills",className:"space-y-6",children:[e.jsxs(L,{children:[e.jsxs(H,{
1children:[e.jsxs(U,{className:"flex items-center gap-2",children:[e.jsx(K,{className:"h-5 w-5 text-primary"}),s("talentProfile.skillsTitle","Your Skills & Abilities")]}),e.jsx(V,{children:s("talentProfile.skillsDesc","Rate your proficiency level for each skill")})]}),e.jsx($,{children:C?.skills&&e.jsx(nt,{items:C.skills,selected:b?.skills?.map(t=>({skillId:t.skill_id,level:t.level}))||[],getLocalizedName:a,groupByCategory:Q,onSave:t=>ee.mutate(t),isPending:ee.isPending,t:s})})]}),e.jsx(R,{section:"skills",entries:B("skills"),showLevel:!0,addOpen:i==="skills",setAddOpen:t=>u(t?"skills":null),onCreate:t=>E.mutate(t),onDelete:t=>I.mutate(t),createPending:E.isPending,deletePending:I.isPending,t:s})]}),e.jsxs(M,{value:"tests",className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold","data-testid":"text-tests-title",children:s("talentProfile.testsTitle","Standardized Tests")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("talentProfile.testsDesc","Add your test scores (IELTS, SAT, TOEFL, etc.)")})]}),e.jsxs(le,{open:v,onOpenChange:m,children:[e.jsx(re,{asChild:!0,children:e.jsxs(k,{size:"sm","data-testid":"button-add-test",children:[e.jsx(Y,{className:"h-4 w-4 mr-1"}),s("talentProfile.addTest","Add Test")]})}),e.jsxs(de,{children:[e.jsxs(ce,{children:[e.jsx(oe,{children:s("talentProfile.addTestTitle","Add Test Score")}),e.jsx(me,{children:s("talentProfile.addTestDesc","Enter your test score and details")})]}),e.jsx(lt,{testTypes:C?.testTypes||[],getLocalizedName:a,onSubmit:t=>te.mutate(t),isPending:te.isPending,t:s})]})]})]}),b?.tests?.length===0?e.jsxs(L,{className:"py-12 text-center",children:[e.jsx(ie,{className:"h-12 w-12 mx-auto text-muted-foreground/50 mb-4"}),e.jsx("p",{className:"text-muted-foreground",children:s("talentProfile.noTests","No tests added yet. Add your first test score!")})]}):e.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:b?.tests?.map(t=>e.jsx(L,{className:"relative group",children:e.jsx($,{className:"pt-4",children:e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium","data-testid":`text-test-name-${t.id}`,children:a(t)}),e.jsxs("div",{className:"text-2xl font-bold text-primary mt-1",children:[t.score,t.max_score&&e.jsxs("span",{className:"text-sm text-muted-foreground font-normal",children:["/",t.max_score]})]}),t.test_date&&e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:new Date(t.test_date).toLocaleDateString()})]}),e.jsx(k,{variant:"ghost",size:"icon",className:"opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>Ce.mutate(t.id),"data-testid":`button-delete-test-${t.id}`,children:e.jsx(ne,{className:"h-4 w-4 text-destructive"})})]})})},t.id))}),e.jsx(R,{section:"tests",entries:B("tests"),showLevel:!0,addOpen:i==="tests",setAddOpen:t=>u(t?"tests":null),onCreate:t=>E.mutate(t),onDelete:t=>I.mutate(t),createPending:E.isPending,deletePending:I.isPending,t:s})]}),e.jsxs(M,{value:"achievements",className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold","data-testid":"text-achievements-title",children:s("talentProfile.achievementsTitle","Achievements & Awards")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("talentProfile.achievementsDesc","Show off your accomplishments")})]}),e.jsxs(le,{open:d,onOpenChange:h,children:[e.jsx(re,{asChild:!0,children:e.jsxs(k,{size:"sm","data-testid":"button-add-achievement",children:[e.jsx(Y,{className:"h-4 w-4 mr-1"}),s("talentProfile.addAchievement","Add Achievement")]})}),e.jsxs(de,{children:[e.jsxs(ce,{children:[e.jsx(oe,{children:s("talentProfile.addAchievementTitle","Add Achievement")}),e.jsx(me,{children:s("talentProfile.addAchievementDesc","Tell us about your accomplishment")})]}),e.jsx(rt,{achievementTypes:C?.achievementTypes||[],getLocalizedName:a,groupByCategory:Q,onSubmit:t=>se.mutate(t),isPending:se.isPending,t:s})]})]})]}),b?.achievements?.length===0?e.jsxs(L,{className:"py-12 text-center",children:[e.jsx(W,{className:"h-12 w-12 mx-auto text-muted-foreground
1/50 mb-4"}),e.jsx("p",{className:"text-muted-foreground",children:s("talentProfile.noAchievements","No achievements yet. Add your first one!")})]}):e.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:b?.achievements?.map(t=>e.jsx(L,{className:"relative group",children:e.jsx($,{className:"pt-4",children:e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx(_,{variant:"secondary",className:"text-xs mb-2","data-testid":`badge-achievement-type-${t.id}`,children:a({name:t.type_name,name_uk:t.type_name_uk,name_es:t.type_name_es})}),e.jsx("h4",{className:"font-medium line-clamp-2","data-testid":`text-achievement-title-${t.id}`,children:t.title}),t.organization&&e.jsx("p",{className:"text-sm text-muted-foreground",children:t.organization}),t.place&&e.jsx(_,{variant:"outline",className:"mt-2",children:t.place})]}),e.jsx(k,{variant:"ghost",size:"icon",className:"opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>we.mutate(t.id),"data-testid":`button-delete-achievement-${t.id}`,children:e.jsx(ne,{className:"h-4 w-4 text-destructive"})})]})})},t.id))}),e.jsx(R,{section:"achievements",entries:B("achievements"),showLevel:!1,addOpen:i==="achievements",setAddOpen:t=>u(t?"achievements":null),onCreate:t=>E.mutate(t),onDelete:t=>I.mutate(t),createPending:E.isPending,deletePending:I.isPending,t:s})]})]})]})]})}function ue({items:p,selected:s,getLocalizedName:N,groupByCategory:P,onSave:n,isPending:l,t:o}){const[g,S]=x.useState(s),r=JSON.stringify(g.sort())!==JSON.stringify(s.sort()),y=P(p),j=c=>{S(v=>v.includes(c)?v.filter(m=>m!==c):[...v,c])};return e.jsxs("div",{className:"space-y-4",children:[Object.entries(y).map(([c,v])=>e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-muted-foreground mb-2",children:o(`talentProfile.categories.${c}`,c)}),e.jsx("div",{className:"flex flex-wrap gap-2",children:v.map(m=>{const d=g.includes(m.id),h=be(m.icon);return e.jsxs(_,{variant:d?"default":"outline",className:`cursor-pointer transition-all py-1.5 px-3 ${d?"ring-2 ring-primary/20":"hover:bg-accent"}`,onClick:()=>j(m.id),"data-testid":`badge-interest-${m.id}`,children:[e.jsx(h,{className:"h-3.5 w-3.5 mr-1.5"}),N(m),d&&e.jsx(qe,{className:"h-3 w-3 ml-1.5"})]},m.id)})})]},c)),r&&e.jsx("div",{className:"flex justify-end pt-2",children:e.jsx(k,{onClick:()=>n(g),disabled:l,"data-testid":"button-save-interests",children:l?o("common.saving","Saving..."):o("common.save","Save")})})]})}function nt({items:p,selected:s,getLocalizedName:N,groupByCategory:P,onSave:n,isPending:l,t:o}){const[g,S]=x.useState(s),[r,y]=x.useState(null),j=P(p),c=d=>g.find(h=>h.skillId===d)?.level||0,v=(d,h)=>{S(i=>{const u=i.find(a=>a.skillId===d);return h===0?i.filter(a=>a.skillId!==d):u?i.map(a=>a.skillId===d?{...a,level:h}:a):[...i,{skillId:d,level:h}]})},m=JSON.stringify(g)!==JSON.stringify(s);return e.jsxs("div",{className:"space-y-4",children:[Object.entries(j).map(([d,h])=>e.jsxs("div",{className:"border rounded-lg overflow-hidden",children:[e.jsxs("button",{onClick:()=>y(r===d?null:d),className:"w-full flex items-center justify-between gap-4 p-3 hover:bg-accent transition-colors","data-testid":`button-expand-category-${d.replace(/\s+/g,"-").toLowerCase()}`,children:[e.jsx("span",{className:"font-medium",children:o(`talentProfile.categories.${d}`,d)}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(_,{variant:"secondary",className:"text-xs",children:[h.filter(i=>c(i.id)>0).length,"/",h.length]}),e.jsx(_e,{className:`h-4 w-4 transition-transform ${r===d?"rotate-90":""}`})]})]}),r===d&&e.jsx("div",{className:"p-3 border-t space-y-4 bg-muted/30",children:h.map(i=>{const u=c(i.id),a=be(i.icon);return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(a,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm font-medium","data-testid":`text-skill-name-${i.id}`,children:N(i)})]}),e.jsxs("span",{className:"text-xs text-muted-foreground","data-testid":`text-skill-level-${i.id}`,children:[u===0&&o("talentProfile.skill.notSelected","Not selected"),u>0&&u<=25&&o("talentProfile.skill.beginner","Beginner"),u>25&&u<=50&&o("talentProfile.skill.intermediate","Intermediate"),u>50&&u<=75&&o("talentProfile.skill.advanced","Advanced"),u>75&&o("talentProfile.skill.expert","Expert")]})]}),e.jsx(Ne,{value:[u],onValueChange:([C])=>v(i.id,C),max:100,step:25,className:"w-full","data-testid":`slider-skill-${i.id}`})]},i.id)})})]},d)),m&&e.jsx("div",{className:"flex justify-end pt-2",children:e.jsx(k,{onClick:()=>n(g.filter(d=>d.level>0)),disabled:l,"data-testid":"button-save-skills",children:l?o("common.saving","Saving..."):o("common.save","Save")})})]})}function R({section:p,entries:s,showLevel:N,addOpen:P,setAddOpen:n,onCreate:l,onDelete:o,createPending:g,deletePending:S,t:r}){const[y,j]=x.useState(""),[c,v]=x.useState(""),[m,d]=x.useState(50),h=a=>a>=90?r("talentProfile.skill.expert","Expert"):a>=75?r("talentProfile.skill.advanced","Advanced"):a>=50?r("talentProfile.skill.intermediate","Intermediate"):a>=25?r("talentProfile.skill.basic","Basic"):r("talentProfile.skill.beginner","Beginner"),i=a=>a>
1=90?"text-purple-600 dark:text-purple-400":a>=75?"text-blue-600 dark:text-blue-400":a>=50?"text-green-600 dark:text-green-400":a>=25?"text-yellow-600 dark:text-yellow-400":"text-muted-foreground",u=()=>{y.trim()&&(l({section:p,title:y.trim(),description:c.trim()||void 0,level:N?m:void 0}),j(""),v(""),d(50))};return e.jsxs(L,{className:"mt-4",children:[e.jsxs(H,{className:"pb-3",children:[e.jsxs(U,{className:"text-sm flex items-center gap-2",children:[e.jsx(Ve,{className:"h-4 w-4 text-muted-foreground"}),r("talentProfile.customEntries","Your own additions")]}),e.jsx(V,{className:"text-xs",children:r("talentProfile.customEntriesDesc","Add anything not in our catalog that you want scouts to see")})]}),e.jsxs($,{className:"space-y-3",children:[s.length>0&&e.jsx("div",{className:"space-y-2",children:s.map(a=>e.jsxs("div",{className:"flex items-start justify-between gap-2 p-2.5 rounded-md border bg-muted/30 group","data-testid":`custom-entry-${a.id}`,children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"text-sm font-medium",children:a.title}),a.level!=null&&e.jsxs(_,{variant:"secondary",className:`text-xs ${i(a.level)}`,children:[h(a.level)," (",a.level,"%)"]})]}),a.description&&e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:a.description})]}),e.jsx(k,{variant:"ghost",size:"icon",className:"opacity-0 group-hover:opacity-100 transition-opacity flex-shrink-0",onClick:()=>o(a.id),disabled:S,"data-testid":`button-delete-custom-${a.id}`,children:e.jsx(Ge,{className:"h-4 w-4 text-destructive"})})]},a.id))}),P?e.jsxs("div",{className:"space-y-3 p-3 border rounded-md bg-muted/20",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{className:"text-xs",children:r("talentProfile.customTitle","Title")}),e.jsx(q,{value:y,onChange:a=>j(a.target.value),placeholder:r("talentProfile.customTitlePlaceholder","e.g., Graphic Design, French language, Robotics club..."),"data-testid":`input-custom-title-${p}`})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(T,{className:"text-xs",children:[r("talentProfile.customDescription","Description")," (",r("common.optional","optional"),")"]}),e.jsx(Re,{value:c,onChange:a=>v(a.target.value),placeholder:r("talentProfile.customDescPlaceholder","Describe your experience or achievement..."),className:"resize-none text-sm min-h-[60px]","data-testid":`input-custom-desc-${p}`})]}),N&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(T,{className:"text-xs",children:r("talentProfile.customLevel","Proficiency Level")}),e.jsxs("span",{className:`text-xs ${i(m)}`,children:[h(m)," (",m,"%)"]})]}),e.jsx(Ne,{value:[m],onValueChange:([a])=>d(a),max:100,step:5,className:"w-full","data-testid":`slider-custom-level-${p}`})]}),e.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[e.jsx(k,{variant:"ghost",size:"sm",onClick:()=>{n(!1),j(""),v(""),d(50)},"data-testid":`button-cancel-custom-${p}`,children:r("common.cancel","Cancel")}),e.jsx(k,{size:"sm",onClick:u,disabled:!y.trim()||g,"data-testid":`button-save-custom-${p}`,children:g?r("common.adding","Adding..."):r("common.add","Add")})]})]}):e.jsxs(k,{variant:"outline",size:"sm",className:"w-full",onClick:()=>n(!0),"data-testid":`button-add-custom-${p}`,children:[e.jsx(Y,{className:"h-4 w-4 mr-1"}),r("talentProfile.addCustomEntry","Add your own")]})]})]})}function lt({testTypes:p,getLocalizedName:s,onSubmit:N,isPending:P,t:n}){const[l,o]=x.useState(""),[g,S]=x.useState(""),[r,y]=x.useState(""),j=p.find(c=>c.id===l);return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{children:n("talentProfile.testType","Test Type")}),e.jsxs(fe,{value:l,onValueChange:o,children:[e.jsx(ge,{"data-testid":"select-test-type",children:e.jsx(je,{placeholder:n("talentProfile.selectTestType","Select a test")})}),e.jsx(ve,{children:p.map(c=>e.jsx(ye,{value:c.id,children:s(c)},c.id))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{children:n("talentProfile.testScore","Score")}),e.jsx(q,{type:"number",value:g,onChange:c=>S(c.target.value),placeholder:j?`${j.min_score||0} - ${j.max_score}`:"","data-testid":"input-test-score"}),j&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[n("talentProfile.scoreRange","Range"),": ",j.min_score||0," - ",j.max_score]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(T,{children:[n("talentProfile.testDate","Test Date")," (",n("common.optional","optional"),")"]}),e.jsx(q,{type:"date",value:r,onChange:c=>y(c.target.value),"data-testid":"input-test-date"})]}),e.jsx(he,{children:e.jsx(k,{onClick:()=>N({testTypeId:l,score:parseFloat(g),testDate:r||null}),disabled:!l||!g||P,"data-testid":"button-submit-test",children:P?n("common.adding","Adding..."):n("common.add","Add")})})]})}function rt({achievementTypes:p,getLocalizedName:s,groupByCategory:N,onSubmit:P,isPending:n,t:l}
1){const[o,g]=x.useState(""),[S,r]=x.useState(""),[y,j]=x.useState(""),[c,v]=x.useState(""),[m,d]=x.useState(""),h=N(p);return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{children:l("talentProfile.achievementType","Type")}),e.jsxs(fe,{value:o,onValueChange:g,children:[e.jsx(ge,{"data-testid":"select-achievement-type",children:e.jsx(je,{placeholder:l("talentProfile.selectAchievementType","Select type")})}),e.jsx(ve,{children:Object.entries(h).map(([i,u])=>e.jsxs("div",{children:[e.jsx("div",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground",children:i}),u.map(a=>e.jsx(ye,{value:a.id,children:s(a)},a.id))]},i))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{children:l("talentProfile.achievementTitle","Title")}),e.jsx(q,{value:S,onChange:i=>r(i.target.value),placeholder:l("talentProfile.achievementTitlePlaceholder","e.g., 1st place in Math Olympiad"),"data-testid":"input-achievement-title"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(T,{children:[l("talentProfile.organization","Organization")," (",l("common.optional","optional"),")"]}),e.jsx(q,{value:y,onChange:i=>j(i.target.value),placeholder:l("talentProfile.organizationPlaceholder","e.g., School name or competition organizer"),"data-testid":"input-achievement-organization"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(T,{children:[l("talentProfile.place","Place/Award")," (",l("common.optional","optional"),")"]}),e.jsx(q,{value:c,onChange:i=>v(i.target.value),placeholder:l("talentProfile.placePlaceholder","e.g., 1st place"),"data-testid":"input-achievement-place"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(T,{children:[l("talentProfile.date","Date")," (",l("common.optional","optional"),")"]}),e.jsx(q,{type:"date",value:m,onChange:i=>d(i.target.value),"data-testid":"input-achievement-date"})]})]}),e.jsx(he,{children:e.jsx(k,{onClick:()=>P({achievementTypeId:o,title:S,organization:y||null,place:c||null,date:m||null}),disabled:!o||!S||n,"data-testid":"button-submit-achievement",children:n?l("common.adding","Adding..."):l("common.add","Add")})})]})}export{Ft as default};

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.