1import{b as _,u as b,r as p,s as u,j as e,L as A,B as I,O as C,a7 as v,a8 as y,aa as L,ab as q}from"./index-hWzLl5bH.js";import{B as k}from"./badge-Cu8vQsUb.js";import{A as T,a as B,b as S,c as D}from"./accordion-Rk9hnZoZ.js";import{M as E}from"./MobileLayoutWrapper--ZaLsH40.js";import{V as M}from"./video-BvTS1Vdz.js";import{C as Q}from"./calendar-WCYTjw8_.js";import{T as R}from"./trophy-BzgL8mIX.js";import"./index-BwWuY6at.js";const H={ja:"ja-JP",en:"en-US",id:"id-ID",my:"my-MM",vi:"vi-VN"},g={back:{ja:"ä¸è¦§ã«æ»ã",en:"Back to list",id:"Kembali ke daftar",my:"á
á¬áááºá¸ááá¯á·áá¼ááºáá½á¬á¸áááº",vi:"Trá» vá» danh sách"},title:{ja:"AI颿¥ã®å±¥æ´",en:"AI Interview History",id:"Riwayat Wawancara AI",my:"AI á¡ááºáá¬áá»á°á¸ áá¾ááºáááºá¸",vi:"Lá»ch sá» phá»ng vấn AI"},subtitle:{ja:"éå»ã®åé¨çµæãã4軸ã¹ã³ã¢ï¼é¢é£æ§ã»æµæ¢ãã»ã¤ã³ããã¼ã·ã§ã³ã»æ·±ãï¼ã¨è³ªåãã¨ã®è©³ç´°ã§ç¢ºèªã§ãã¾ãã",en:"Review past attempts with four scores (relevance, fluency, intonation, depth) and per-question details.",id:"Lihat hasil sebelumnya dengan empat skor (relevansi, kelancaran, intonasi, kedalaman) dan detail per pertanyaan.",my:"á¡ááááºááááºáá»á¬á¸ááᯠá¡áá¾ááºáá±á¸áá»áá¯á¸ (áááºá
ááºáá¾á¯á áá»á½ááºá¸áá»ááºáá¾á¯á á¡áá¶á¡áá±á¡áá¬á¸á áááºáá¾áá¯ááºá¸áá¾á¯) áá¾áá·áº áá±á¸áá½ááºá¸á¡ááá¯áẠá¡áá±á¸á
áááºáá¼áá·áº áá¼áá·áºáá¾á¯ááá¯ááºáááºá",vi:"Xem kết quả trưá»c Äây vá»i bá»n Äiá»m (liên quan, lưu loát, ngữ Äiá»u, chiá»u sâu) và chi tiết từng câu há»i."},empty:{ja:"ã¾ã åé¨å±¥æ´ãããã¾ããã",en:"No attempts yet.",id:"Belum ada riwayat.",my:"áá¾ááºáááºá¸ááá¾ááá±á¸áá«á",vi:"Chưa có lượt phá»ng vấn nà o."},interview:{ja:"AI颿¥",en:"AI Interview",id:"Wawancara AI",my:"AI á¡ááºáá¬áá»á°á¸",vi:"Phá»ng vấn AI"},relevance:{ja:"é¢é£æ§",en:"Relevance",id:"Relevansi",my:"áááºá
ááºáá¾á¯",vi:"Liên quan"},fluency:{ja:"æµæ¢ã",en:"Fluency",id:"Kelancaran",my:"áá»á½ááºá¸áá»ááºáá¾á¯",vi:"Lưu loát"},intonation:{ja:"ææ",en:"Intonation",id:"Intonasi",my:"á¡áá¶á¡áá±á¡áá¬á¸",vi:"Ngữ Äiá»u"},depth:{ja:"æ·±ã",en:"Depth",id:"Kedalaman",my:"áááºáá¾áá¯ááºá¸áá¾á¯",vi:"Chiá»u sâu"},perQuestion:{ja:"質åãã¨ã®è©³ç´°",en:"Details per question",id:"Detail per pertanyaan",my:"áá±á¸áá½ááºá¸á¡ááá¯áẠá¡áá±á¸á
áááº",vi:"Chi tiết từng câu há»i"},items:{ja:"ä»¶",en:"items",id:"item",my:"áá¯",vi:"câu"},noAnswer:{ja:"(ç¡åç)",en:"(No answer)",id:"(Tidak dijawab)",my:"(á¡áá¼á±ááá¾á)",vi:"(Không trả lá»i)"}},K=(i,r)=>i?new Date(i).toLocaleString(H[r]||"ja-JP",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}):"â",x=({label:i,value:r,max:d=25})=>e.jsxs("div",{className:"flex flex-col items-center justify-center rounded-md border bg-muted/40 px-2 py-1.5 min-w-[68px]",children:[e.jsx("span",{className:"text-[10px] text-muted-foreground",children:i}),e.jsxs("span",{className:"text-sm font-semibold",children:[r==null?"â":`${r}`,e.jsxs("span",{className:"text-[10px] text-muted-foreground font-normal",children:["/",d]})]})]});function X(){const i=_(),{language:r}=b(),d=["ja","en","id","my","vi"].includes(r)?r:"ja",a=t=>g[t][d]||g[t].en,[w,h]=p.useState(!0),[j,N]=p.useState([]);return p.useEffect(()=>{window.scrollTo(0,0),(async()=>{const{data:{session:t}}=await u.auth.getSession();if(!t){i("/login");return}const{data:o,error:m}=await u.from("interview_attempts").select("id, attempt_number, completed_at, created_at, final_score, relevance_score, fluency_score, intonation_score, depth_score, ai_feedback, all_transcriptions, per_question_scores, interview_id").eq("user_id",t.user.id).order("created_at",{ascending:!1});if(m){console.error("Failed to load attempts:",m),h(!1);return}const l=o||[],n=Array.from(new Set(l.map(s=>
1s.interview_id).filter(Boolean)));let c={};if(n.length){const{data:s}=await u.from("ai_interviews").select("id, title").in("id",n);(s||[]).forEach(f=>{c[f.id]=f.title})}N(l.map(s=>({...s,interview_title:s.interview_id?c[s.interview_id]:void 0}))),h(!1)})()},[i]),w?e.jsx("div",{className:"min-h-[calc(100vh-4rem)] flex items-center justify-center",children:e.jsx(A,{className:"h-8 w-8 animate-spin text-primary"})}):e.jsx(E,{className:"min-h-[calc(100vh-4rem)]",children:e.jsxs("div",{className:"px-3 md:px-4 py-4 md:py-8 max-w-4xl mx-auto",children:[e.jsxs(I,{variant:"ghost",size:"sm",onClick:()=>i("/ai-interviews"),className:"mb-3",children:[e.jsx(C,{className:"h-4 w-4 mr-1"})," ",a("back")]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("h1",{className:"text-xl md:text-2xl font-bold mb-1",children:a("title")}),e.jsx("p",{className:"text-muted-foreground text-xs md:text-sm",children:a("subtitle")})]}),j.length===0?e.jsx(v,{children:e.jsxs(y,{className:"py-12 text-center",children:[e.jsx(M,{className:"h-10 w-10 text-muted-foreground mx-auto mb-3"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:a("empty")})]})}):e.jsx("div",{className:"space-y-3",children:j.map(t=>{const o=Array.isArray(t.all_transcriptions)?t.all_transcriptions:[],m=Array.isArray(t.per_question_scores)?t.per_question_scores:[],l={};return m.forEach(n=>{typeof n.question_index=="number"&&(l[n.question_index]=n)}),e.jsxs(v,{children:[e.jsx(L,{className:"pb-2",children:e.jsxs("div",{className:"flex items-start justify-between gap-2 flex-wrap",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs(q,{className:"text-base md:text-lg truncate",children:[t.interview_title||a("interview"),e.jsxs("span",{className:"text-xs text-muted-foreground font-normal ml-2",children:["#",t.attempt_number]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground mt-1",children:[e.jsx(Q,{className:"h-3 w-3"}),K(t.completed_at||t.created_at,d)]})]}),e.jsxs(k,{variant:"secondary",className:"gap-1",children:[e.jsx(R,{className:"h-3 w-3"}),t.final_score??"â","/100"]})]})}),e.jsxs(y,{className:"space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[e.jsx(x,{label:a("relevance"),value:t.relevance_score}),e.jsx(x,{label:a("fluency"),value:t.fluency_score}),e.jsx(x,{label:a("intonation"),value:t.intonation_score}),e.jsx(x,{label:a("depth"),value:t.depth_score})]}),t.ai_feedback&&e.jsx("div",{className:"rounded-md bg-muted/40 p-2.5 text-xs md:text-sm whitespace-pre-wrap",children:t.ai_feedback}),o.length>0&&e.jsx(T,{type:"single",collapsible:!0,children:e.jsxs(B,{value:"qa",className:"border-b-0",children:[e.jsxs(S,{className:"text-xs md:text-sm py-2",children:[a("perQuestion")," (",o.length,a("items"),")"]}),e.jsx(D,{children:e.jsx("div",{className:"space-y-2",children:o.map((n,c)=>{const s=l[c]||l[c+1];return e.jsxs("div",{className:"rounded-md border p-2.5 text-xs md:text-sm space-y-1.5",children:[e.jsxs("div",{children:[e.jsxs("span",{className:"text-muted-foreground font-medium",children:["Q",c+1,": "]}),e.jsx("span",{children:n.questionText||"â"})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground font-medium",children:"A: "}),e.jsx("span",{className:"whitespace-pre-wrap",children:n.answerText||a("noAnswer")})]}),((s==null?void 0:s.depth_note)||(s==null?void 0:s.intonation_note))&&e.jsxs("div",{className:"pt-1.5 mt-1 border-t space-y-1",children:[(s==null?void 0:s.depth_note)&&e.jsxs("div",{className:"text-[11px] text-muted-foreground",children:[e.jsxs("span",{className:"font-medium text-foreground",children:[a("depth"),": "]}),s.depth_note]}),(s==null?void 0:s.intonation_note)&&e.jsxs("div",{className:"text-[11px] text-muted-foreground",children:[e.jsxs("span",{className:"font-medium text-foreground",children:[a("intonation"),": "]}),s.intonation_note]})]})]},c)})})})]})})]})]},t.id)})})]})})}export{X 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.