1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,11795,e=>{"use strict";e.i(29225);var t=e.i(72390);let s=null,r=s=(0,t.createBrowserClient)("https://uqraaromjcqdossstcol.supabase.co","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InVxcmFhcm9tamNxZG9zc3N0Y29sIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjkxMTI3OTQsImV4cCI6MjA4NDY4ODc5NH0.QSWUXUnjQfGoaK88YjUoU4EMZGqvFD9stGEHQYfa5uM");e.s(["supabase",0,r])},6538,60435,e=>{"use strict";let t=new Map;async function s(e){let s=e.toLowerCase().trim();if(t.has(s))return t.get(s)||null;try{let e=await fetch(`/api/definition?word=${encodeURIComponent(s)}`);if(!e.ok){if(404===e.status)return t.set(s,null),null;throw Error("Failed to fetch definition")}let r=await e.json();return t.set(s,r),r}catch(t){return console.error(`Error fetching definition for "${e}":`,t),null}}e.s(["fetchDefinition",()=>s],6538),e.s(["FIRST_IMPRESSION_OPTIONS",0,[{value:"totally unfamiliar",labelKey:"firstImpression.totallyUnfamiliar"},{value:"misinterpreted",labelKey:"firstImpression.misinterpreted"},{value:"looks familiar",labelKey:"firstImpression.looksFamiliar"},{value:"guessed on context",labelKey:"firstImpression.guessedOnContext"},{value:"check the meaning",labelKey:"firstImpression.checkTheMeaning"}],"WORD_INSIGHTS",0,[{type:"memory-hook",labelKey:"wordInsights.memoryHook",emoji:"ð§ ",badgeClass:"bg-fuchsia-500/20 text-fuchsia-300 border-fuchsia-500/30 hover:bg-fuchsia-500/30"},{type:"similar-roots",labelKey:"wordInsights.similarRoots",emoji:"ð±",badgeClass:"bg-emerald-500/20 text-emerald-300 border-emerald-500/30 hover:bg-emerald-500/30"},{type:"cultural-background",labelKey:"wordInsights.culturalBackground",emoji:"ðï¸",badgeClass:"bg-pink-500/20 text-pink-300 border-pink-500/30 hover:bg-pink-500/30"}]],60435)},15624,e=>{"use strict";var t=e.i(43476),s=e.i(71645),r=e.i(22016),n=e.i(48148),i=e.i(18566),a=e.i(11795),o=e.i(99058),l=e.i(6538),d=e.i(2594),c=e.i(2971);function h(){let e=(0,n.useTranslations)("home");return(0,t.jsx)("div",{className:"min-h-screen gradient-bg flex items-center justify-center",children:(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-indigo-500 mx-auto mb-4"}),(0,t.jsx)("p",{className:"text-zinc-400",children:e("loading")})]})})}function x(){return(0,t.jsx)(s.Suspense,{fallback:(0,t.jsx)(h,{}),children:(0,t.jsx)(m,{})})}function m(){let e=(0,n.useTranslations)("home"),{user:h,loading:x}=(0,d.useAuth)(),m=(0,i.useSearchParams)(),u=(0,i.useRouter)(),[p,f]=(0,s.useState)(!1),g=(0,s.useRef)(!1),b=(0,s.useMemo)(()=>{let e=m.get("range");if(e){let t=parseInt(e,10);if(!isNaN(t)&&t>=0)return t}return 0},[m]),[j,w]=(0,s.useState)([]),[v,N]=(0,s.useState)(0),[k,y]=(0,s.useState)(new Set),[z,C]=(0,s.useState)(new Map),[M,S]=(0,s.useState)(new Set),[L,I]=(0,s.useState)(()=>{{let e=new URLSearchParams(window.location.search).get("range");if(e){let t=parseInt(e,10);if(!isNaN(t)&&t>=0)return t}}return 0}
1),[E,R]=(0,s.useState)(""),[W,B]=(0,s.useState)(""),[T,F]=(0,s.useState)(""),[P,$]=(0,s.useState)([]),[_,U]=(0,s.useState)(!1),[H,O]=(0,s.useState)(!1),D=(0,s.useRef)(null),[A,V]=(0,s.useState)(!0),[K,G]=(0,s.useState)(!1),[J,q]=(0,s.useState)(null),[Y,Q]=(0,s.useState)(100),[Z,X]=(0,s.useState)(!1),[ee,et]=(0,s.useState)(0),[es,er]=(0,s.useState)(!1),[en,ei]=(0,s.useState)(null),[ea,eo]=(0,s.useState)(!1),[el,ed]=(0,s.useState)([]),[ec,eh]=(0,s.useState)("random"),[ex,em]=(0,s.useState)(null),eu=(0,s.useCallback)(async e=>{I(e);let t=new URL(window.location.href);if(0===e?t.searchParams.delete("range"):t.searchParams.set("range",e.toString()),u.push(t.pathname+t.search,{scroll:!1}),h)try{await a.supabase.from("profiles").update({last_range:e}).eq("id",h.id)}catch(e){console.error("Failed to save range to profile:",e)}},[u,h]),ep=(0,s.useCallback)(async e=>{if(!e||e.length<2)return void $([]);O(!0);try{let t=await fetch(`/api/words?search=${encodeURIComponent(e)}&limit=10`);if(t.ok){let e=await t.json();$(e.words||[])}}catch(e){console.error("Global search failed:",e)}finally{O(!1)}},[]);(0,s.useEffect)(()=>{let e=setTimeout(()=>{ep(T)},300);return()=>clearTimeout(e)},[T,ep]),(0,s.useEffect)(()=>{let e=e=>{D.current&&!D.current.contains(e.target)&&U(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let ef=(0,s.useCallback)(e=>{eu(Math.floor(e/1e3)),F(""),U(!1)},[eu]);(0,s.useEffect)(()=>{f(!0)},[]),(0,s.useEffect)(()=>{if(!g.current){g.current=!0;return}I(b)},[b]),(0,s.useEffect)(()=>{let e=async()=>{if(!m.get("range")&&h)try{let{data:e,error:t}=await a.supabase.from("profiles").select("last_range").eq("id",h.id).single();if(t)throw t;if(e?.last_range&&e.last_range>0){I(e.last_range);let t=new URL(window.location.href);t.searchParams.set("range",e.last_range.toString()),u.replace(t.pathname+t.search,{scroll:!1})}}catch(e){console.error("Failed to load user range:",e)}};x||e()},[h,x,m,u]);let eg=(0,s.useMemo)(()=>{let e=[],t=Math.max(1,Math.ceil(v/1e3));for(let s=0;s<t;s++)e.push({value:s,label:`${1e3*s}-${(s+1)*1e3}`,start:1e3*s,end:(s+1)*1e3});return e},[v]);(0,s.useEffect)(()=>{(async()=>{try{let e=await fetch("/api/words?meta=true"),t=await e.json();N(t.totalWords)}catch(e){console.error("Failed to load metadata:",e)}})()},[]),(0,s.useEffect)(()=>{p&&(async()=>{V(!0);try{let e=await fetch(`/api/words?range=${L}`),t=(await e.json()).words;w(t)}catch(t){console.error("Failed to load range:",t),eb(e("toast.failedLoadRange"),"error")}finally{V(!1)}})()},[L,p]),(0,s.useEffect)(()=>{(async()=>{if(!x)try{if(!h){S(new Set),y(new Set),C(new Map),V(!1);return}let{data:e,error:t}=await a.supabase.from("user_words").select("word_index, word").eq("user_id",h.id);if(t)throw t;let s=new Set(e?.map(e=>e.word_index)||[]);S(s),y(s);let r=new Map;e?.forEach(e=>{r.set(e.word_index,{index:e.word_index,word:e.word||""})}),C(r)}catch(e){console.error("Failed to load saved words:",e)}finally{V(!1)}})()},[h,x]);let eb=(0,s.useCallback)((e,t)=>{q({message:e,type:t}),setTimeout(()=>q(null),3e3)},[]);(0,s.useEffect)(()=>{Q(100)},[L,E]);let ej=(0,s.useMemo)(()=>j.filter(e=>e.word.toLowerCase().includes(E.toLowerCase())),[j,E]);(0,s.useMemo)(()=>j.filter(e=>k.has(e.index)).filter(e=>e.word.toLowerCase().includes(W.toLowerCase())),[j,k,W]);let ew=async e=>{eo(!0),er(!1);try{let[t,s,r]=await Promise.all([(0,l.fetchDefinition)(e.word),fetch(`/api/word-hook?word=${encodeURIComponent(e.word)}`).then(e=>e.ok?e.json():null),fetch(`https://api.dictionaryapi.dev/api/v2/entries/en/${encodeURIComponent(e.word)}`).then(e=>e.ok?e.json():null)]),n=null;if(r&&r[0]?.phonetics){let e=r[0].phonetics.find(e=>e.audio&&""!==e.audio)?.audio;e&&(n=e.startsWith("http")?e:`https:${e}`)}em(n),ei({word:e,definition:t,hook:s?.word_hook||null})}catch(t){ei({word:e,definition:null,hook:null})}finally{eo(!1)}},ev=(0,s.useCallback)(()=>{let t;if(0===k.size)return;let s=[];(k.forEach(e=>{let t=z.get(e);t&&s.push(t)}),0===s.length)?alert(e("flashcardAlert.noWordsToStudy")):(ed(t="random"===ec?[...s].sort(()=>Math.random()-.5):"chronological"===ec?[...s].sort((e,t)=>
1e.index-t.index):[...s].sort((e,t)=>t.index-e.index)),et(0),er(!1),X(!0),ew(t[0]))},[k,z,ec]),eN=(0,s.useCallback)(()=>{if(ee<el.length-1){let e=ee+1;et(e),ew(el[e])}},[ee,el]),ek=(0,s.useCallback)(()=>{if(ee>0){let e=ee-1;et(e),ew(el[e])}},[ee,el]),ey=(0,s.useCallback)(()=>{er(e=>!e)},[]);(0,s.useEffect)(()=>{if(!Z)return;let e=e=>{switch(e.key){case"ArrowLeft":ek();break;case"ArrowRight":eN();break;case" ":case"Enter":e.preventDefault(),ey();break;case"Escape":X(!1)}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[Z,eN,ek,ey]);let ez=async e=>{if(y(t=>new Set([...t,e.index])),C(t=>new Map(t).set(e.index,e)),h)try{let{error:t}=await a.supabase.from("user_words").insert({user_id:h.id,word:e.word.toLowerCase(),word_index:e.index,status:"learning"});t||S(t=>new Set([...t,e.index]))}catch(e){console.error("Failed to save word:",e)}};(0,s.useMemo)(()=>{if(k.size!==M.size)return!0;for(let e of k)if(!M.has(e))return!0;return!1},[k,M]);let eC=({item:n,onClick:i,children:a,side:l="left"})=>{let[d,c]=(0,s.useState)(!1),[h,x]=(0,s.useState)(null),[m,u]=(0,s.useState)(!1),[p,f]=(0,s.useState)(!1),[g,b]=(0,s.useState)({definition:null,hook:null,loading:!1}),j=(0,s.useRef)(null);(0,s.useEffect)(()=>{u("ontouchstart"in window||navigator.maxTouchPoints>0)},[]);let w=async()=>{if(null===g.definition&&!g.loading){b(e=>({...e,loading:!0}));try{let[e,t]=await Promise.all([fetch(`/api/definition?word=${encodeURIComponent(n.word)}`).then(e=>e.ok?e.json():null).catch(()=>null),fetch(`/api/word-hook?word=${encodeURIComponent(n.word)}`).then(e=>e.ok?e.json():null).catch(()=>null)]),s=null;if(e?.meanings){let t=e.meanings.find(e=>"䏿"===e.partOfSpeech),r=e.meanings.find(e=>"English"===e.partOfSpeech);s=t?.definitions?.[0]?.definition||r?.definitions?.[0]?.definition||null}let r=null;t?.word_hook&&(r=t.word_hook.split("\n").filter(e=>e.trim()&&!e.startsWith("#")).slice(0,2).join(" ").replace(/\*\*/g,"").replace(/\*/g,"").substring(0,120)),b({definition:s,hook:r,loading:!1})}catch{b({definition:null,hook:null,loading:!1})}}};return(0,t.jsxs)("div",{ref:j,className:"relative group glass rounded-2xl p-4 sm:p-5 border flex flex-col gap-2 transition-colors duration-200 cursor-pointer border-white/5 hover:border-indigo-500/30 hover:bg-white/10 overflow-hidden",onMouseEnter:()=>{m||(j.current&&x(j.current.getBoundingClientRect()),c(!0))},onMouseLeave:()=>c(!1),onClick:e=>{e.preventDefault(),e.stopPropagation(),m?m&&(p||w(),f(e=>!e)):i()},children:[(0,t.jsx)("div",{className:"flex items-center justify-between gap-2",children:a}),m&&p&&(0,t.jsx)("div",{className:"pt-2 border-t border-white/10 space-y-2 animate-fade-in",children:g.loading?(0,t.jsxs)("div",{className:"flex items-center gap-2 text-zinc-500 text-xs",children:[(0,t.jsxs)("svg",{className:"w-3 h-3 animate-spin",viewBox:"0 0 24 24",children:[(0,t.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),(0,t.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),e("mobileExpand.loading")]}):(0,t.jsxs)(t.Fragment,{children:[g.definition&&(0,t.jsxs)("div",{className:"text-[11px] text-zinc-400 leading-relaxed",children:[(0,t.jsx)("span",{className:"text-sky-400 font-medium",children:"ð "}),g.definition]}),g.hook&&(0,t.jsxs)("div",{className:"text-[11px] text-zinc-500 leading-relaxed",children:[(0,t.jsx)("span",{className:"text-purple-400 font-medium",children:"ð§ "}),g.hook,"..."]}),!g.definition&&!g.hook&&(0,t.jsx)("div",{className:"text-[11px] text-zinc-600 italic",children:e("mobileExpand.noDefinitionAvailable")}),(0,t.jsx)(r.default,{href:`/word/${encodeURIComponent(n.word.toLowerCase())}`,onClick:e=>e.stopPropagation(),className:"inline-flex items-center gap-1 text-[11px] text-amber-400 font-medium",children:e("mobileExpand.viewFullDetails")})]})}),!m&&(0,t.jsx)(o.default,{word:n.word,visible:d,anchorRect:h})]})},eM=(0,s.useMemo)(()=>c.DEFAULT_NAV_ITEMS.map(e=>"/"===e.href?{...e,badge:k.size}:e),[k.size]);return(0,t.jsxs)("div",{className:"min-h-screen gradient-bg",children:[(0,t.jsx)(c.default,{title:e("appTitle"),titleIcon:"ð§ ",showBackButton:!0,navItems:eM}),(0,t.jsxs)("main",{className:"max-w-7xl mx-auto px-4 py-6",children:[(0,t.jsx)("div",{className:"mb-6",ref:D,children:(0,t.jsxs)("div",{className:"relative max-w-2xl mx-auto",children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("svg",{className:"absolute left-4 top-1/2 -translate-y-1/2 w-5 h-5 text-zinc-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),(0,t.jsx)("input",{type:"text",placeholder:e("globalSearchPlaceholder"),value:T,onChange:e=>{F(e.target.value),U(!0)},onFocus:()=>U(!0),className:"w-full pl-12 pr-4 py-3 rounded-2xl bg-zinc-800/50 border border-zinc-700 text-zinc-100 placeholder-zinc-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500/50 transition-all text-lg"}),H&&(0,t.jsx)("div",{className:"absolute right-4 top-1/2 -translate-y-1/2",children:(0,t.jsxs)("svg",{className:"animate-spin h-5 w-5 text-indigo-400",viewBox:"0 0 24 24",children:[(0,t.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),(0,t.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})})]}),_&&T.length>=2&&(0,t.jsx)("div",{className:"absolute top-full left-0 right-0 mt-2 bg-zinc-900 border border-zinc-700 rounded-xl shadow-2xl overflow-hidden z-50",children:0===P.length?(0,t.jsx)("div",{className:"px-4 py-3 text-zinc-500 text-center",children:H?e("searchDropdown.searching"):e("searchDropdown.noResults")}):(0,t.jsx)("div",{className:"max-h-80 overflow-y-auto",children:P.map(s=>{let n=Math.floor(s.index/1e3);return(0,t.jsxs)("button",{onClick:()=>ef(s.index),className:"w-full px-4 py-3 flex items-center justify-between hover:bg-indigo-500/20 transition-colors text-left border-b border-zinc-800 last:border-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("span",{className:"font-medium text-zinc-100",children:s.word}),(0,t.jsx)(r.default,{href:`/word/${encodeURIComponent(s.word.toLowerCase())}`,onClick:e=>e.stopPropagation(),className:"text-amber-400 hover:text-amber-300 transition-colors",title:e("viewMemoryHook"),children:"ð§ "})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsxs)("span",{className:"text-zinc-500",children:["#",s.index+1]}),(0,t.jsxs)("span",{className:"px-2 py-0.5 bg-indigo-500/20 text-indigo-400 rounded-lg text-xs",children:[1e3*n,"-",(n+1)
1*1e3]})]})]},s.index)})})})]})}),(0,t.jsxs)("div",{className:"mb-6",children:[(0,t.jsx)("div",{className:"flex items-center justify-between mb-3",children:(0,t.jsx)("h2",{className:"text-sm font-medium text-zinc-400",children:e("selectWordRange")})}),(0,t.jsxs)("div",{className:"flex sm:hidden items-center gap-2",children:[(0,t.jsx)("button",{onClick:()=>eu(Math.max(0,L-1)),disabled:0===L,className:"p-2 rounded-lg bg-zinc-800 text-zinc-400 border border-zinc-700 hover:border-zinc-600 disabled:opacity-30 disabled:cursor-not-allowed",children:(0,t.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}),(0,t.jsx)("div",{className:"flex gap-1 overflow-x-auto flex-1 justify-center",children:eg.filter((e,t)=>2>=Math.abs(t-L)).map(e=>(0,t.jsx)("button",{onClick:()=>eu(e.value),className:`range-btn text-sm px-2 py-1 ${L===e.value?"active":""}`,children:e.label},e.value))}),(0,t.jsx)("button",{onClick:()=>eu(Math.min(eg.length-1,L+1)),disabled:L>=eg.length-1,className:"p-2 rounded-lg bg-zinc-800 text-zinc-400 border border-zinc-700 hover:border-zinc-600 disabled:opacity-30 disabled:cursor-not-allowed",children:(0,t.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})})]}),(0,t.jsx)("div",{className:"hidden sm:flex flex-wrap gap-2",children:eg.map(e=>(0,t.jsx)("button",{onClick:()=>eu(e.value),className:`range-btn ${L===e.value?"active":""}`,children:e.label},e.value))})]}),(0,t.jsxs)("div",{className:"glass rounded-3xl overflow-hidden border border-white/5",children:[(0,t.jsxs)("div",{className:"p-6 border-b border-white/5 bg-white/5 flex flex-col md:flex-row gap-4 items-center justify-between",children:[(0,t.jsx)("div",{className:"flex items-center gap-4",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-xl font-bold text-zinc-100",children:e("wordsSection.title")}),(0,t.jsx)("p",{className:"text-sm text-zinc-500 mt-1 hidden sm:block",children:e("wordsSection.hintDesktop")}),(0,t.jsx)("p",{className:"text-sm text-zinc-500 mt-1 sm:hidden",children:e("wordsSection.hintMobile")})]})}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("input",{type:"text",placeholder:e("wordsSection.searchPlaceholder"),value:E,onChange:e=>R(e.target.value),className:"px-4 py-2 bg-zinc-800 border border-zinc-700 rounded-xl text-zinc-100 placeholder-zinc-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 transition-all text-sm w-48"}),(0,t.jsxs)("button",{type:"button",onClick:()=>(t=>{if(0===t.length)return void eb(e("toast.noWordsToCopy"),"error");let s=t.join("\n ");navigator.clipboard.writeText(s).then(()=>{eb(e("toast.copiedWords",{count:t.length}),"success")}).catch(t=>{console.error("Failed to copy:",t),eb(e("toast.failedCopy"),"error")})})(ej.map(e=>e.word)),className:"p-2 px-3 rounded-xl bg-zinc-800 text-zinc-400 border border-zinc-700 hover:border-zinc-600 transition-all text-sm flex items-center gap-2",title:e("wordsSection.copyVisibleWords"),children:[(0,t.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 5H6a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2v-1M8 5a2 2 0 002 2h2a2 2 0 002-2M8 5a2 2 0 012-2h2a2 2 0 012 2m0 0h2a2 2 0 012 2v3m2 4H10m0 0l3-3m-3 3l3 3"})}),e("wordsSection.copy")]}),(0,t.jsxs)("button",{onClick:ev,disabled:0===k.size,className:"flex items-center gap-2 px-3 py-2 rounded-xl text-sm font-medium transition-all bg-amber-500/20 text-amber-400 border border-amber-500/30 hover:bg-amber-500/30 disabled:opacity-50 disabled:cursor-not-allowed",title:e("wordsSection.studyWithFlashcards"),children:[(0,t.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"})}),(0,t.jsx)("span",{className:"hidden sm:inline",children:e("wordsSection.flashcards")})]}),(0,t.jsx)("span",{className:"text-sm text-zinc-500 bg-zinc-800 px-3 py-2 rounded-xl",children:e("wordsSection.wordCount",{count:ej.length})})]})]}),(0,t.jsx)("div",{className:"p-6",children:A?(0,t.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:[...Array(12)].map((e,s)=>(0,t.jsx)("div",{className:"h-24 rounded-2xl bg-white/5 animate-pulse"},s))}):0===ej.length?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-zinc-500",children:[(0,t.jsx)("svg",{className:"w-12 h-12 mb-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),(0,t.jsx)("p",{children:e("wordsSection.noWordsFound")})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:ej.slice(0,Y).map(s=>{let n=k.has(s.index);return(0,t.jsxs)(eC,{item:s,onClick:()=>{},children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-1 min-w-0 flex-wrap",children:[(0,t.jsx)("span",{className:"font-bold text-zinc-100 truncate",children:s.word}),(0,t.jsx)(r.default,{href:`/word/${encodeURIComponent(s.word.toLowerCase())}`,onClick:e=>e.stopPropagation(),className:"opacity-0 group-hover:opacity-100 p-1 rounded hover:bg-amber-500/20 transition-all text-sm shrink-0",title:e("viewMemoryHook"),children:"ð§ "})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,t.jsxs)("span",{className:"text-[10px] font-mono text-zinc-600 hidden sm:inline",children:["#",s.index+1]}),n?(0,t.jsxs)("span",{className:"flex items-center justify-center gap-1 w-16 py-1 rounded-lg bg-zinc-500/20 text-zinc-400 border border-zinc-500/30 text-xs font-medium",children:[(0,t.jsx)("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),e("wordsSection.added")]}):(0,t.jsxs)("button",{type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation(),ez(s)},className:"flex items-center justify-center gap-1 w-16 py-1 rounded-lg bg-emerald-500/20 text-emerald-400 border border-emerald-500/30 hover:bg-emerald-500/30 text-xs font-medium",title:e("wordsSection.addToMyWords"),children:[(0,t.jsx)("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),e("wordsSection.add")]})]})]},s.index)})}),Y<ej.length&&(0,t.jsx)("div",{className:"mt-8 flex justify-center",children:(0,t.jsx)("button",{onClick:()=>Q(e=>e+100),className:"px-6 py-3 rounded-xl bg-zinc-800 text-zinc-300 border border-zinc-700 hover:bg-zinc-700 hover:text-zinc-100 transition-all font-medium",children:e("wordsSection.viewMore",{count:ej.length-Y})})})]})})]}),(0,t.jsxs)("div",{className:"mt-8 glass rounded-xl p-6",children:[(0,t.jsx)("h3",{className:"text-lg font-semibold text-zinc-100 mb-4",children:e("helpSection.title")}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 text-sm text-zinc-400",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"w-8 h-8 rounded-lg bg-indigo-500/20 flex items-center justify-center flex-shrink-0",children:(0,t.jsx)("span",{className:"text-indigo-400 font-bold",children:"1"})}),(0,t.jsx)("p",{children:e("helpSection.step1")})]}),(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"w-8 h-8 rounded-lg bg-indigo-500/20 flex items-center justify-center flex-shrink-0",children:(0,t.jsx)("span",{className:"text-indigo-400 font-bold",children:"2"})}),(0,t.jsx)("p",{children:e("helpSection.step2")})]}),(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"w-8 h-8 rounded-lg bg-emerald-500/20 flex items-center justify-center flex-shrink-0",children:(0,t.jsx)("span",{className:"text-emerald-400 font-bold",children:"3"})}),(0,t.jsx)("p",{children:e("helpSection.step3")})]})]})]})]}),(0,t.jsx)("div",{className:`toast ${J?"show":""} ${J?.type==="error"?"error":""}`,children:J?.message}),Z&&(0,t.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80 backdrop-blur-sm",children:(0,t.jsxs)("div",{className:"relative w-full max-w-2xl mx-2 sm:mx-4",children:[(0,t.jsx)("button",{onClick:()=>X(!1),className:"absolute -top-12 right-0 text-zinc-400 hover:text-white transition-colors",children:(0,t.jsx)("svg",{className:"w-8 h-8",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),(0,t.jsxs)("div",{className:"mb-4 flex items-center justify-between text-sm text-zinc-400",children:[(0,t.jsx)("span",{children:e("flashcardModal.cardProgress",{current:ee+1,total:el.length})}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsxs)("select",{value:ec,onChange:e=>{let t,s=e.target.value;eh(s);let r=[];
1k.forEach(e=>{let t=z.get(e);t&&r.push(t)}),ed(t="random"===s?[...r].sort(()=>Math.random()-.5):"chronological"===s?[...r].sort((e,t)=>e.index-t.index):[...r].sort((e,t)=>t.index-e.index)),et(0),er(!1),ew(t[0])},className:"appearance-none bg-zinc-800 text-zinc-300 border border-zinc-700 hover:border-zinc-600 rounded-lg px-2 py-1 pr-6 text-xs font-medium cursor-pointer focus:outline-none focus:ring-2 focus:ring-amber-500/50 transition-all",children:[(0,t.jsx)("option",{value:"random",children:e("flashcardModal.sortRandom")}),(0,t.jsx)("option",{value:"chronological",children:e("flashcardModal.sortByIndex")}),(0,t.jsx)("option",{value:"reverse",children:e("flashcardModal.sortReverse")})]}),(0,t.jsx)("svg",{className:"w-3 h-3 text-zinc-500 absolute right-1.5 top-1/2 -translate-y-1/2 pointer-events-none",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),(0,t.jsx)("div",{className:"w-24 h-2 bg-zinc-800 rounded-full overflow-hidden",children:(0,t.jsx)("div",{className:"h-full bg-gradient-to-r from-amber-500 to-orange-500 transition-all",style:{width:`${(ee+1)/el.length*100}%`}})}),(0,t.jsxs)("span",{children:[Math.round((ee+1)/el.length*100),"%"]})]})]}),(0,t.jsx)("div",{onClick:ey,className:"relative h-80 cursor-pointer perspective-1000",children:(0,t.jsxs)("div",{className:`absolute inset-0 transition-transform duration-500 transform-style-3d ${es?"rotate-y-180":""}`,children:[(0,t.jsx)("div",{className:`absolute inset-0 backface-hidden rounded-3xl bg-gradient-to-br from-zinc-800 to-zinc-900 border border-zinc-700 shadow-2xl flex flex-col items-center justify-center p-8 ${es?"invisible":""}`,children:ea?(0,t.jsx)("div",{className:"w-12 h-12 border-4 border-amber-500/30 border-t-amber-500 rounded-full animate-spin"}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-5xl font-black text-transparent bg-clip-text bg-gradient-to-r from-amber-200 via-amber-400 to-orange-400",children:en?.word.word}),ex&&(0,t.jsx)("button",{onClick:e=>{e.stopPropagation(),new Audio(ex).play()},className:"mt-6 w-12 h-12 flex items-center justify-center rounded-full bg-amber-500/10 text-amber-400 hover:bg-amber-500/20 transition-all border border-amber-500/30 group/audio",title:e("flashcardModal.listen"),children:(0,t.jsx)("svg",{className:"w-6 h-6 transform transition-transform group-hover/audio:scale-110",fill:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M14 5.23l-5 5H4v4h5l5 5V5.23zM16.5 12c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z"})})}),(0,t.jsx)("p",{className:"mt-6 text-zinc-500 text-sm",children:e("flashcardModal.clickToReveal")})]})}),(0,t.jsx)("div",{className:`absolute inset-0 backface-hidden rounded-3xl bg-gradient-to-br from-zinc-800 to-zinc-900 border border-zinc-700 shadow-2xl p-6 overflow-y-auto rotate-y-180 ${!es?"invisible":""}`,children:ea?(0,t.jsx)("div",{className:"h-full flex items-center justify-center",children:(0,t.jsx)("div",{className:"w-12 h-12 border-4 border-amber-500/30 border-t-amber-500 rounded-full animate-spin"})}):(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("h3",{className:"text-2xl font-bold text-amber-400",children:en?.word.word}),(0,t.jsxs)(r.default,{href:`/word/${encodeURIComponent(en?.word.word||"")}`,className:"flex items-center gap-1 px-3 py-1.5 rounded-lg bg-purple-500/20 text-purple-400 border border-purple-500/30 hover:bg-purple-500/30 text-xs font-medium transition-all",onClick:e=>e.stopPropagation(),children:[(0,t.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})}),e("flashcardModal.fullPage")]})]}),en?.definition&&(0,t.jsxs)("div",{className:"space-y-2",children:[en.definition.phonetic&&(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("p",{className:"text-red-400 font-mono text-sm",children:en.definition.phonetic}),ex&&(0,t.jsx)("button",{onClick:e=>{e.stopPropagation(),new Audio(ex).play()},className:"w-6 h-6 flex items-center justify-center rounded-full bg-amber-500/10 text-amber-400 hover:bg-amber-500/20 transition-all border border-amber-500/20",title:e("flashcardModal.listen"),children:(0,t.jsx)("svg",{className:"w-3.5 h-3.5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M14 5.23l-5 5H4v4h5l5 5V5.23zM16.5 12c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z"})})})]}),en.definition.meanings.map((e,s)=>(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:`text-xs font-bold uppercase ${"English"===e.partOfSpeech?"text-sky-400":"text-amber-400"}`,children:e.partOfSpeech}),(0,t.jsx)("ul",{className:"mt-1 space-y-1",children:e.definitions.slice(0,2).map((e,s)=>(0,t.jsx)("li",{className:"text-zinc-300 text-sm",children:e.definition},s))})]},s))]}),en?.hook&&(0,t.jsxs)("div",{className:"pt-3 border-t border-zinc-700",children:[(0,t.jsxs)("p",{className:"text-xs text-purple-400 font-medium mb-1",children:["ð§ ",e("flashcardModal.memoryHook")]}),(0,t.jsx)("p",{className:"text-zinc-400 text-sm whitespace-pre-line",children:en.hook})]}),!en?.definition&&!en?.hook&&(0,t.jsx)("p",{className:"text-zinc-500 italic",children:e("flashcardModal.noDefinitionOrHook")})]})})]})}),(0,t.jsxs)("div",{className:"mt-6 flex items-center justify-between",children:[(0,t.jsxs)("button",{onClick:ek,disabled:0===ee,className:"flex items-center gap-1 sm:gap-2 px-3 sm:px-6 py-2 sm:py-3 rounded-xl bg-zinc-800 text-zinc-300 border border-zinc-700 hover:bg-zinc-700 disabled:opacity-50 disabled:cursor-not-allowed transition-all text-sm",children:[(0,t.jsx)("svg",{className:"w-4 h-4 sm:w-5 sm:h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})}),(0,t.jsx)("span",{className:"hidden sm:inline",children:e("flashcardModal.previous")})]}),(0,t.jsxs)("div",{className:"hidden sm:flex items-center gap-2 text-zinc-500 text-sm",children:[(0,t.jsxs)("span",{children:["ââ ",e("flashcardModal.navigate")]}),(0,t.jsx)("span",{children:"â¢"}),(0,t.jsx)("span",{children:e("flashcardModal.spaceToFlip")})]}),(0,t.jsx)("div",{className:"sm:hidden text-zinc-500 text-xs",children:e("flashcardModal.tapToFlip")}),(0,t.jsxs)("button",{onClick:eN,disabled:ee===el.length-1,className:"flex items-center gap-1 sm:gap-2 px-3 sm:px-6 py-2 sm:py-3 rounded-xl bg-zinc-800 text-zinc-300 border border-zinc-700 hover:bg-zinc-700 disabled:opacity-50 disabled:cursor-not-allowed transition-all text-sm",children:[(0,t.jsx)("span",{className:"hidden sm:inline",children:e("flashcardModal.next")}),(0,t.jsx)("svg",{className:"w-4 h-4 sm:w-5 sm:h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})]})]})})]})}e.s(["default",()=>x])}]);
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.