Spaces:
Running
Running
feat: streamline journey practice mode and fix AI evaluation state reset
Browse files- algospaced-ui/dist/assets/{GitHubSyncWindow-SeMZnEj8.js → GitHubSyncWindow-DGw-FVNu.js} +1 -1
- algospaced-ui/dist/assets/{JourneyPath-C36BylWW.js → JourneyPath-Dg9Be99S.js} +1 -1
- algospaced-ui/dist/assets/{PrincessChamber-B9Z3_h5D.js → PrincessChamber-Cu4RP8Ry.js} +1 -1
- algospaced-ui/dist/assets/{PythonChallenge-p08fHf5w.js → PythonChallenge-Bfcp7_2V.js} +1 -1
- algospaced-ui/dist/assets/{ReviewQueue-BcOTw1g5.js → ReviewQueue-BCTxdw81.js} +0 -0
- algospaced-ui/dist/assets/{Settings-CaYD0IIx.js → Settings-Cz_GHQn5.js} +1 -1
- algospaced-ui/dist/assets/{confetti.module-DRqH0UE1.js → confetti.module-BEqdENp8.js} +1 -1
- algospaced-ui/dist/assets/{external-link-mE9fgxrX.js → external-link-yb1gedrc.js} +1 -1
- algospaced-ui/dist/assets/{eye-BTMBNbc7.js → eye-DeJ_5v51.js} +1 -1
- algospaced-ui/dist/assets/{githubSyncService-ComQdi-j.js → githubSyncService--4Z5jmjP.js} +1 -1
- algospaced-ui/dist/assets/{index-9s0-qmGa.css → index-Y3EVepB8.css} +0 -0
- algospaced-ui/dist/assets/{index-C7Gd5Mn4.js → index-g5jVBiGr.js} +0 -0
- algospaced-ui/dist/assets/{info-DKabFp4k.js → info-CU16dSEt.js} +1 -1
- algospaced-ui/dist/assets/{save-D2rY9s8j.js → save-CdpRk537.js} +1 -1
- algospaced-ui/dist/index.html +2 -2
- algospaced-ui/dist/sw.js +1 -1
- algospaced-ui/src/components/ReviewQueue.tsx +26 -9
- algospaced-ui/src/components/review/ReviewHeader.tsx +3 -14
- algospaced-ui/src/hooks/useReviewQueue.ts +17 -1
algospaced-ui/dist/assets/{GitHubSyncWindow-SeMZnEj8.js → GitHubSyncWindow-DGw-FVNu.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{a as e,c as t,t as n}from"./jsx-runtime-j9uSgrFF.js";import{n as r,r as i,t as a}from"./eye-BTMBNbc7.js";import{t as o}from"./external-link-mE9fgxrX.js";import{a as s,c,i as l,l as u,n as d,o as f,r as p,s as m,t as h,u as g}from"./githubSyncService-ComQdi-j.js";import{C as _,L as v,N as y,U as b,V as x}from"./index-C7Gd5Mn4.js";var S=b(`cloud-upload`,[[`path`,{d:`M12 13v8`,key:`1l5pq0`}],[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`m8 17 4-4 4 4`,key:`1quai1`}]]),C=b(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),w=b(`git-commit-horizontal`,[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`,key:`1dyftd`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`,key:`oup4p8`}]]),T=b(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),E=t(e(),1),D=n(),O=({onClose:e,currentProblem:t})=>{let[n,b]=(0,E.useState)(()=>p()),[O,k]=(0,E.useState)(()=>l()),[A,j]=(0,E.useState)(``),[M,N]=(0,E.useState)(!1),[P,F]=(0,E.useState)(!1),[I,L]=(0,E.useState)(!1),[R,z]=(0,E.useState)(!1),[B,V]=(0,E.useState)(!1),[H,U]=(0,E.useState)(!1),[W,G]=(0,E.useState)(!1),[K,q]=(0,E.useState)(null),J=!!(n.token&&(n.username||O?.login));(0,E.useEffect)(()=>{n.token&&!O&&u(n.token).then(e=>{e.valid&&e.user&&(k(e.user),m({username:e.user.login},e.user))})},[n.token,O]);let Y=async()=>{L(!0),q(null);try{let{token:e,user:t}=await d();k(t);let n=p();b(n);try{await s(e,n.repoName,n.isPrivate)}catch{}q({type:`success`,text:`Connected successfully to GitHub as @${t.login}!`,linkUrl:t.html_url})}catch(e){q({type:`error`,text:e.message||`GitHub OAuth authorization failed.`})}finally{L(!1)}},X=async()=>{let e=A.trim();if(!e){q({type:`error`,text:`Please enter a valid GitHub token.`});return}z(!0),q(null);try{let t=await u(e);if(t.valid&&t.user){k(t.user),m({token:e,username:t.user.login},t.user),b(p());try{await s(e,n.repoName,n.isPrivate)}catch{}j(``),N(!1),q({type:`success`,text:`Verified and connected as @${t.user.login}!`,linkUrl:t.user.html_url})}else q({type:`error`,text:t.error||`Token verification failed. Please check permissions.`})}catch(e){q({type:`error`,text:e.message||`Failed to connect with token.`})}finally{z(!1)}},Z=async()=>{if(n.token){V(!0),q(null);try{let e=await s(n.token,n.repoName,n.isPrivate);m({repoName:n.repoName}),q({type:`success`,text:e.created?`Created new repository ${e.full_name} on GitHub!`:`Connected to existing repository ${e.full_name}!`,linkUrl:e.html_url})}catch(e){q({type:`error`,text:e.message||`Failed to initialize repository.`})}finally{V(!1)}}},Q=async()=>{if(n.token&&n.repoName){U(!0),q(null);try{let e=await c(n.token,n.repoName,n.branch);q({type:`success`,text:e.message||`Synced ${e.synced_count} solutions to ${n.repoName}!`,linkUrl:e.repo_url})}catch(e){q({type:`error`,text:e.message||`Batch sync failed.`})}finally{U(!1)}}},$=async()=>{if(!t||!n.token)return;let e=t.code||t.reference_code;if(!e||!e.trim()){q({type:`error`,text:`Current problem has no code to push. Write or save code first!`});return}G(!0),q(null);try{let r={token:n.token,repo:n.repoName,branch:n.branch,problem_number:t.problem_number,problem_name:t.name||`Algorithm Problem`,difficulty:t.difficulty||`Medium`,pattern:t.pattern||`Algorithms`,optimal_time:t.optimal_time||`O(N)`,optimal_space:t.optimal_space||`O(1)`,description:t.description||``,code:e},i=await f(r);q({type:`success`,text:`Committed ${t.name} to GitHub!`,linkUrl:i.html_url})}catch(e){q({type:`error`,text:e.message||`Failed to push current solution.`})}finally{G(!1)}},ee=e=>{m({autoCommit:e}),b(t=>({...t,autoCommit:e})),q({type:`info`,text:e?`Auto-commit ENABLED: Solutions will sync automatically on submission.`:`Auto-commit DISABLED: You can still push manually any time.`})};return(0,D.jsxs)(`div`,{className:`w-full h-full bg-[#fdf8e1] p-4 sm:p-6 flex flex-col justify-between select-none font-sans text-ink-black overflow-y-auto custom-scrollbar`,children:[(0,D.jsxs)(`div`,{className:`space-y-4`,children:[(0,D.jsxs)(`div`,{className:`flex items-center justify-between border-b-[3px] border-ink-black pb-3`,children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,D.jsx)(`div`,{className:`w-9 h-9 bg-ink-black rounded border-2 border-ink-black flex items-center justify-center text-white shadow-[2px_2px_0px_0px_rgba(0,0,0,0.15)]`,children:(0,D.jsx)(`svg`,{className:`w-5 h-5 fill-white`,viewBox:`0 0 19 19`,children:(0,D.jsx)(`path`,{fillRule:`evenodd`,d:`M9.356 1.85C5.05 1.85 1.57 5.356 1.57 9.694a7.84 7.84 0 0 0 5.324 7.44c.387.079.528-.168.528-.376 0-.182-.013-.805-.013-1.454-2.165.467-2.616-.935-2.616-.935-.349-.91-.864-1.143-.864-1.143-.71-.48.051-.48.051-.48.787.051 1.2.805 1.2.805.695 1.194 1.817.857 2.268.649.064-.507.27-.857.49-1.052-1.728-.182-3.545-.857-3.545-3.87 0-.857.31-1.558.8-2.104-.078-.195-.349-1 .077-2.078 0 0 .657-.208 2.14.805a7.5 7.5 0 0 1 1.946-.26c.657 0 1.328.092 1.946.26 1.483-1.013 2.14-.805 2.14-.805.426 1.078.155 1.883.078 2.078.502.546.799 1.247.799 2.104 0 3.013-1.818 3.675-3.558 3.87.284.247.528.714.528 1.454 0 1.052-.012 1.896-.012 2.156 0 .208.142.455.528.377a7.84 7.84 0 0 0 5.324-7.441c.013-4.338-3.48-7.844-7.773-7.844`,clipRule:`evenodd`})})}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`h3`,{className:`font-headline-md font-bold text-sm uppercase m-0 flex items-center gap-2`,children:`GitHub Solutions Station`}),(0,D.jsx)(`p`,{className:`text-[11px] text-trash-gray font-semibold m-0`,children:`Sync algorithm solutions & auto-commit to your personal portfolio repository`})]})]}),(0,D.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,D.jsx)(`span`,{className:`px-2.5 py-1 text-[9px] font-bold font-arcade uppercase border-2 border-ink-black ${J?`bg-emerald-300 text-emerald-950`:`bg-amber-200 text-amber-950`}`,children:J?`CONNECTED`:`DISCONNECTED`})})]}),J?(0,D.jsxs)(`div`,{className:`space-y-4`,children:[(0,D.jsxs)(`div`,{className:`bg-white border-[3px] border-ink-black p-4 shadow-[4px_4px_0px_0px_rgba(30,41,59,1)] flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3`,children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-3`,children:[O?.avatar_url?(0,D.jsx)(`img`,{src:O.avatar_url,alt:O.login,className:`w-10 h-10 rounded-full border-2 border-ink-black shadow-[1px_1px_0px_0px_#1E293B]`}):(0,D.jsx)(`div`,{className:`w-10 h-10 bg-slate-200 rounded-full border-2 border-ink-black flex items-center justify-center font-bold`,children:`GH`}),(0,D.jsxs)(`div`,{children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,D.jsx)(`span`,{className:`font-bold text-xs text-ink-black`,children:O?.name||O?.login||n.username}),(0,D.jsxs)(`span`,{className:`text-[10px] text-trash-gray font-mono`,children:[`(@`,O?.login||n.username,`)`]})]}),(0,D.jsxs)(`div`,{className:`text-[11px] text-slate-600 font-medium flex items-center gap-1 mt-0.5`,children:[(0,D.jsx)(g,{className:`w-3.5 h-3.5 text-blue-600 shrink-0`}),(0,D.jsxs)(`span`,{className:`font-semibold text-ink-black`,children:[n.username||O?.login,`/`,n.repoName]}),(0,D.jsxs)(`span`,{className:`text-slate-400`,children:[`(`,n.branch,`)`]})]})]})]}),(0,D.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,D.jsxs)(`a`,{href:`https://github.com/${n.username||O?.login}/${n.repoName}`,target:`_blank`,rel:`noopener noreferrer`,className:`px-3 py-1.5 bg-slate-50 hover:bg-slate-100 border-2 border-ink-black text-xs font-bold text-ink-black flex items-center gap-1 shadow-[2px_2px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none no-underline cursor-pointer`,children:[(0,D.jsx)(o,{className:`w-3.5 h-3.5`}),(0,D.jsx)(`span`,{children:`View Repo`})]}),(0,D.jsxs)(`button`,{onClick:()=>{window.confirm(`Disconnect your GitHub account from AlgoSpaced?`)&&(h(),b(p()),k(null),q({type:`info`,text:`Disconnected from GitHub.`}))},className:`px-3 py-1.5 bg-white hover:bg-rose-50 border-2 border-rose-300 text-rose-700 text-xs font-bold flex items-center gap-1 cursor-pointer transition-all`,title:`Disconnect GitHub`,children:[(0,D.jsx)(T,{className:`w-3 h-3`}),(0,D.jsx)(`span`,{children:`Disconnect`})]})]})]}),(0,D.jsxs)(`div`,{className:`bg-white border-[3px] border-ink-black p-4 shadow-[4px_4px_0px_0px_rgba(30,41,59,1)] space-y-3`,children:[(0,D.jsxs)(`div`,{className:`flex items-center justify-between border-b pb-2 border-slate-200`,children:[(0,D.jsxs)(`span`,{className:`font-headline-md font-bold text-xs uppercase text-ink-black flex items-center gap-1.5`,children:[(0,D.jsx)(C,{className:`w-3.5 h-3.5 text-ink-black`}),`Target Repository & Branch`]}),(0,D.jsxs)(`button`,{onClick:Z,disabled:B,className:`px-2.5 py-1 bg-yellow-100 hover:bg-yellow-200 border border-ink-black text-[10px] font-bold text-ink-black flex items-center gap-1 cursor-pointer disabled:opacity-50 shadow-[1px_1px_0px_0px_#1E293B]`,children:[B?(0,D.jsx)(y,{className:`w-3 h-3 animate-spin`}):(0,D.jsx)(x,{className:`w-3 h-3 text-emerald-700`}),(0,D.jsx)(`span`,{children:`Verify / Init Repo`})]})]}),(0,D.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-3`,children:[(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`label`,{className:`block text-[10px] font-bold text-trash-gray uppercase mb-1`,children:`Repository Name`}),(0,D.jsx)(`input`,{type:`text`,value:n.repoName,onChange:e=>{let t=e.target.value;b(e=>({...e,repoName:t})),m({repoName:t})},placeholder:`algospaced-solutions`,className:`w-full bg-slate-50 border-2 border-ink-black rounded py-1.5 px-2.5 text-xs font-mono font-medium focus:outline-none focus:bg-white`})]}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`label`,{className:`block text-[10px] font-bold text-trash-gray uppercase mb-1`,children:`Branch Name`}),(0,D.jsx)(`input`,{type:`text`,value:n.branch,onChange:e=>{let t=e.target.value;b(e=>({...e,branch:t})),m({branch:t})},placeholder:`main`,className:`w-full bg-slate-50 border-2 border-ink-black rounded py-1.5 px-2.5 text-xs font-mono font-medium focus:outline-none focus:bg-white`})]})]}),(0,D.jsxs)(`div`,{className:`pt-2 border-t border-slate-100 flex items-center justify-between`,children:[(0,D.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,D.jsx)(_,{className:`w-4 h-4 text-amber-500 shrink-0 mt-0.5`}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`span`,{className:`text-xs font-bold text-ink-black block`,children:`Auto-commit on every submission`}),(0,D.jsx)(`span`,{className:`text-[10px] text-trash-gray font-medium`,children:`Automatically push code to your repo when grading a review card or saving a solution.`})]})]}),(0,D.jsxs)(`label`,{className:`relative inline-flex items-center cursor-pointer select-none`,children:[(0,D.jsx)(`input`,{type:`checkbox`,checked:n.autoCommit,onChange:e=>ee(e.target.checked),className:`sr-only peer`}),(0,D.jsx)(`div`,{className:`w-9 h-5 bg-slate-300 peer-focus:outline-none border-2 border-ink-black rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-2 after:border-ink-black after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-emerald-500`})]})]})]}),(0,D.jsxs)(`div`,{className:`bg-[#fffdf0] border-[3px] border-ink-black p-4 shadow-[4px_4px_0px_0px_rgba(30,41,59,1)] space-y-3`,children:[(0,D.jsxs)(`span`,{className:`font-headline-md font-bold text-xs uppercase text-ink-black flex items-center gap-1.5`,children:[(0,D.jsx)(S,{className:`w-3.5 h-3.5 text-ink-black`}),`Manual Push & Sync Operations`]}),(0,D.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-3`,children:[(0,D.jsxs)(`button`,{onClick:$,disabled:W||!t,className:`p-3 bg-white hover:bg-emerald-50 border-2 border-ink-black text-left flex flex-col justify-between gap-1 shadow-[2px_2px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none cursor-pointer transition-all disabled:opacity-50`,children:[(0,D.jsxs)(`div`,{className:`flex items-center justify-between w-full`,children:[(0,D.jsxs)(`span`,{className:`font-bold text-xs text-ink-black font-headline-md flex items-center gap-1.5`,children:[W?(0,D.jsx)(y,{className:`w-3.5 h-3.5 animate-spin text-emerald-600`}):(0,D.jsx)(w,{className:`w-3.5 h-3.5 text-emerald-600`}),`Push Active Problem`]}),t?.problem_number&&(0,D.jsxs)(`span`,{className:`text-[9px] font-mono px-1.5 py-0.5 bg-emerald-100 text-emerald-800 rounded font-bold`,children:[`#`,t.problem_number]})]}),(0,D.jsx)(`span`,{className:`text-[10px] text-slate-500 line-clamp-1`,children:t?.name||`No active problem open in review`})]}),(0,D.jsxs)(`button`,{onClick:Q,disabled:H,className:`p-3 bg-[#ffe24c] hover:bg-yellow-300 border-2 border-ink-black text-left flex flex-col justify-between gap-1 shadow-[2px_2px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none cursor-pointer transition-all disabled:opacity-50`,children:[(0,D.jsxs)(`div`,{className:`flex items-center justify-between w-full`,children:[(0,D.jsxs)(`span`,{className:`font-bold text-xs text-ink-black font-headline-md flex items-center gap-1.5`,children:[H?(0,D.jsx)(y,{className:`w-3.5 h-3.5 animate-spin text-ink-black`}):(0,D.jsx)(g,{className:`w-3.5 h-3.5 text-ink-black`}),`Sync Entire Library`]}),(0,D.jsx)(`span`,{className:`text-[8px] font-arcade uppercase font-bold bg-white px-1.5 py-0.5 border border-ink-black`,children:`BATCH`})]}),(0,D.jsx)(`span`,{className:`text-[10px] text-slate-700`,children:`Push all solved problems + generate root README index`})]})]})]})]}):(0,D.jsxs)(`div`,{className:`space-y-4`,children:[(0,D.jsxs)(`div`,{className:`bg-white border-[3px] border-ink-black p-5 sm:p-6 shadow-[4px_4px_0px_0px_rgba(30,41,59,1)] text-center space-y-4`,children:[(0,D.jsxs)(`div`,{className:`max-w-md mx-auto space-y-2`,children:[(0,D.jsx)(`h4`,{className:`font-headline-md font-bold text-sm uppercase text-ink-black m-0`,children:`Connect Your GitHub Account`}),(0,D.jsx)(`p`,{className:`text-xs text-trash-gray font-medium leading-relaxed m-0`,children:`Sync all your DSA solutions directly to your GitHub repository. Commit automatically on review completion or push anytime with 1-click.`})]}),(0,D.jsxs)(`div`,{className:`pt-2 flex flex-col items-center`,children:[(0,D.jsx)(`button`,{onClick:Y,disabled:I,className:`w-full sm:w-auto px-6 py-3 bg-[#24292e] hover:bg-black text-white font-bold text-xs uppercase font-headline-md border-[3px] border-ink-black shadow-[3px_3px_0px_0px_rgba(30,41,59,1)] active:translate-y-0.5 active:shadow-none flex items-center justify-center gap-2.5 transition-all cursor-pointer disabled:opacity-50`,children:I?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(y,{className:`w-4 h-4 animate-spin text-yellow-300`}),(0,D.jsx)(`span`,{children:`AUTHORIZING WITH GITHUB...`})]}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`svg`,{className:`w-4 h-4 fill-white`,viewBox:`0 0 19 19`,children:(0,D.jsx)(`path`,{fillRule:`evenodd`,d:`M9.356 1.85C5.05 1.85 1.57 5.356 1.57 9.694a7.84 7.84 0 0 0 5.324 7.44c.387.079.528-.168.528-.376 0-.182-.013-.805-.013-1.454-2.165.467-2.616-.935-2.616-.935-.349-.91-.864-1.143-.864-1.143-.71-.48.051-.48.051-.48.787.051 1.2.805 1.2.805.695 1.194 1.817.857 2.268.649.064-.507.27-.857.49-1.052-1.728-.182-3.545-.857-3.545-3.87 0-.857.31-1.558.8-2.104-.078-.195-.349-1 .077-2.078 0 0 .657-.208 2.14.805a7.5 7.5 0 0 1 1.946-.26c.657 0 1.328.092 1.946.26 1.483-1.013 2.14-.805 2.14-.805.426 1.078.155 1.883.078 2.078.502.546.799 1.247.799 2.104 0 3.013-1.818 3.675-3.558 3.87.284.247.528.714.528 1.454 0 1.052-.012 1.896-.012 2.156 0 .208.142.455.528.377a7.84 7.84 0 0 0 5.324-7.441c.013-4.338-3.48-7.844-7.773-7.844`,clipRule:`evenodd`})}),(0,D.jsx)(`span`,{children:`CONNECT WITH GITHUB (1-CLICK)`})]})}),(0,D.jsxs)(`span`,{className:`text-[10px] text-trash-gray mt-2`,children:[`Direct 1-click OAuth (works for guest and signed-in users). Requests `,(0,D.jsx)(`code`,{children:`repo`}),` access.`]})]})]}),(0,D.jsxs)(`div`,{className:`bg-white border-[3px] border-ink-black p-4 shadow-[4px_4px_0px_0px_rgba(30,41,59,1)]`,children:[(0,D.jsxs)(`button`,{type:`button`,onClick:()=>N(!M),className:`w-full flex items-center justify-between text-left text-xs font-bold text-ink-black font-headline-md uppercase cursor-pointer bg-transparent border-0 p-0`,children:[(0,D.jsx)(`span`,{children:`Or connect via Personal Access Token (PAT)`}),(0,D.jsx)(`span`,{className:`text-slate-500`,children:M?`▲ Hide`:`▼ Show`})]}),M&&(0,D.jsxs)(`div`,{className:`mt-3 pt-3 border-t border-slate-200 space-y-3`,children:[(0,D.jsxs)(`div`,{className:`flex items-center justify-between text-[11px]`,children:[(0,D.jsx)(`span`,{className:`font-semibold text-slate-700`,children:`Personal Access Token:`}),(0,D.jsxs)(`a`,{href:`https://github.com/settings/tokens/new?scopes=repo&description=AlgoSpaced%20Solutions%20Sync`,target:`_blank`,rel:`noopener noreferrer`,className:`text-blue-600 hover:text-blue-800 font-bold flex items-center gap-1 no-underline text-[10px]`,children:[(0,D.jsx)(`span`,{children:`Generate token with repo scope`}),(0,D.jsx)(o,{className:`w-3 h-3`})]})]}),(0,D.jsxs)(`div`,{className:`relative`,children:[(0,D.jsx)(`input`,{type:P?`text`:`password`,value:A,onChange:e=>j(e.target.value),placeholder:`ghp_... or github_pat_...`,className:`w-full bg-slate-50 border-2 border-ink-black rounded py-2 pl-3 pr-9 text-xs font-mono focus:outline-none focus:bg-white`}),(0,D.jsx)(`button`,{type:`button`,onClick:()=>F(!P),className:`absolute right-2.5 top-1/2 -translate-y-1/2 text-slate-400 hover:text-ink-black cursor-pointer bg-transparent border-0 p-1`,children:P?(0,D.jsx)(r,{className:`w-3.5 h-3.5`}):(0,D.jsx)(a,{className:`w-3.5 h-3.5`})})]}),(0,D.jsx)(`button`,{onClick:X,disabled:R||!A.trim(),className:`px-4 py-2 bg-[#ffe24c] hover:bg-yellow-300 text-ink-black font-bold text-xs uppercase border-2 border-ink-black shadow-[2px_2px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none cursor-pointer disabled:opacity-50 flex items-center gap-1.5`,children:R?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(y,{className:`w-3.5 h-3.5 animate-spin`}),(0,D.jsx)(`span`,{children:`VERIFYING TOKEN...`})]}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(x,{className:`w-3.5 h-3.5`}),(0,D.jsx)(`span`,{children:`SAVE & CONNECT TOKEN`})]})})]})]})]}),K&&(0,D.jsxs)(`div`,{className:`p-3 border-[2px] border-ink-black text-xs font-semibold rounded flex items-center justify-between gap-2 ${K.type===`success`?`bg-emerald-100 text-emerald-900 border-emerald-600`:K.type===`error`?`bg-rose-100 text-rose-900 border-rose-600`:`bg-sky-100 text-sky-900 border-sky-600`}`,children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-2`,children:[K.type===`success`?(0,D.jsx)(v,{className:`w-4 h-4 shrink-0`}):(0,D.jsx)(i,{className:`w-4 h-4 shrink-0`}),(0,D.jsx)(`span`,{children:K.text})]}),K.linkUrl&&(0,D.jsxs)(`a`,{href:K.linkUrl,target:`_blank`,rel:`noopener noreferrer`,className:`px-2 py-0.5 bg-white border border-ink-black text-[10px] font-bold text-ink-black hover:bg-slate-50 no-underline shrink-0 flex items-center gap-1`,children:[(0,D.jsx)(`span`,{children:`Open`}),(0,D.jsx)(o,{className:`w-3 h-3`})]})]})]}),(0,D.jsx)(`div`,{className:`pt-4 border-t border-slate-300 flex justify-end`,children:(0,D.jsx)(`button`,{onClick:e,className:`px-4 py-2 bg-white hover:bg-slate-100 border-[2px] border-ink-black text-xs font-bold text-ink-black shadow-[2px_2px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none cursor-pointer uppercase`,children:`CLOSE`})})]})};export{O as GitHubSyncWindow,O as default};
|
|
|
|
| 1 |
+
import{a as e,c as t,t as n}from"./jsx-runtime-j9uSgrFF.js";import{n as r,r as i,t as a}from"./eye-DeJ_5v51.js";import{t as o}from"./external-link-yb1gedrc.js";import{a as s,c,i as l,l as u,n as d,o as f,r as p,s as m,t as h,u as g}from"./githubSyncService--4Z5jmjP.js";import{C as _,L as v,N as y,U as b,V as x}from"./index-g5jVBiGr.js";var S=b(`cloud-upload`,[[`path`,{d:`M12 13v8`,key:`1l5pq0`}],[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`m8 17 4-4 4 4`,key:`1quai1`}]]),C=b(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),w=b(`git-commit-horizontal`,[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`,key:`1dyftd`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`,key:`oup4p8`}]]),T=b(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),E=t(e(),1),D=n(),O=({onClose:e,currentProblem:t})=>{let[n,b]=(0,E.useState)(()=>p()),[O,k]=(0,E.useState)(()=>l()),[A,j]=(0,E.useState)(``),[M,N]=(0,E.useState)(!1),[P,F]=(0,E.useState)(!1),[I,L]=(0,E.useState)(!1),[R,z]=(0,E.useState)(!1),[B,V]=(0,E.useState)(!1),[H,U]=(0,E.useState)(!1),[W,G]=(0,E.useState)(!1),[K,q]=(0,E.useState)(null),J=!!(n.token&&(n.username||O?.login));(0,E.useEffect)(()=>{n.token&&!O&&u(n.token).then(e=>{e.valid&&e.user&&(k(e.user),m({username:e.user.login},e.user))})},[n.token,O]);let Y=async()=>{L(!0),q(null);try{let{token:e,user:t}=await d();k(t);let n=p();b(n);try{await s(e,n.repoName,n.isPrivate)}catch{}q({type:`success`,text:`Connected successfully to GitHub as @${t.login}!`,linkUrl:t.html_url})}catch(e){q({type:`error`,text:e.message||`GitHub OAuth authorization failed.`})}finally{L(!1)}},X=async()=>{let e=A.trim();if(!e){q({type:`error`,text:`Please enter a valid GitHub token.`});return}z(!0),q(null);try{let t=await u(e);if(t.valid&&t.user){k(t.user),m({token:e,username:t.user.login},t.user),b(p());try{await s(e,n.repoName,n.isPrivate)}catch{}j(``),N(!1),q({type:`success`,text:`Verified and connected as @${t.user.login}!`,linkUrl:t.user.html_url})}else q({type:`error`,text:t.error||`Token verification failed. Please check permissions.`})}catch(e){q({type:`error`,text:e.message||`Failed to connect with token.`})}finally{z(!1)}},Z=async()=>{if(n.token){V(!0),q(null);try{let e=await s(n.token,n.repoName,n.isPrivate);m({repoName:n.repoName}),q({type:`success`,text:e.created?`Created new repository ${e.full_name} on GitHub!`:`Connected to existing repository ${e.full_name}!`,linkUrl:e.html_url})}catch(e){q({type:`error`,text:e.message||`Failed to initialize repository.`})}finally{V(!1)}}},Q=async()=>{if(n.token&&n.repoName){U(!0),q(null);try{let e=await c(n.token,n.repoName,n.branch);q({type:`success`,text:e.message||`Synced ${e.synced_count} solutions to ${n.repoName}!`,linkUrl:e.repo_url})}catch(e){q({type:`error`,text:e.message||`Batch sync failed.`})}finally{U(!1)}}},$=async()=>{if(!t||!n.token)return;let e=t.code||t.reference_code;if(!e||!e.trim()){q({type:`error`,text:`Current problem has no code to push. Write or save code first!`});return}G(!0),q(null);try{let r={token:n.token,repo:n.repoName,branch:n.branch,problem_number:t.problem_number,problem_name:t.name||`Algorithm Problem`,difficulty:t.difficulty||`Medium`,pattern:t.pattern||`Algorithms`,optimal_time:t.optimal_time||`O(N)`,optimal_space:t.optimal_space||`O(1)`,description:t.description||``,code:e},i=await f(r);q({type:`success`,text:`Committed ${t.name} to GitHub!`,linkUrl:i.html_url})}catch(e){q({type:`error`,text:e.message||`Failed to push current solution.`})}finally{G(!1)}},ee=e=>{m({autoCommit:e}),b(t=>({...t,autoCommit:e})),q({type:`info`,text:e?`Auto-commit ENABLED: Solutions will sync automatically on submission.`:`Auto-commit DISABLED: You can still push manually any time.`})};return(0,D.jsxs)(`div`,{className:`w-full h-full bg-[#fdf8e1] p-4 sm:p-6 flex flex-col justify-between select-none font-sans text-ink-black overflow-y-auto custom-scrollbar`,children:[(0,D.jsxs)(`div`,{className:`space-y-4`,children:[(0,D.jsxs)(`div`,{className:`flex items-center justify-between border-b-[3px] border-ink-black pb-3`,children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,D.jsx)(`div`,{className:`w-9 h-9 bg-ink-black rounded border-2 border-ink-black flex items-center justify-center text-white shadow-[2px_2px_0px_0px_rgba(0,0,0,0.15)]`,children:(0,D.jsx)(`svg`,{className:`w-5 h-5 fill-white`,viewBox:`0 0 19 19`,children:(0,D.jsx)(`path`,{fillRule:`evenodd`,d:`M9.356 1.85C5.05 1.85 1.57 5.356 1.57 9.694a7.84 7.84 0 0 0 5.324 7.44c.387.079.528-.168.528-.376 0-.182-.013-.805-.013-1.454-2.165.467-2.616-.935-2.616-.935-.349-.91-.864-1.143-.864-1.143-.71-.48.051-.48.051-.48.787.051 1.2.805 1.2.805.695 1.194 1.817.857 2.268.649.064-.507.27-.857.49-1.052-1.728-.182-3.545-.857-3.545-3.87 0-.857.31-1.558.8-2.104-.078-.195-.349-1 .077-2.078 0 0 .657-.208 2.14.805a7.5 7.5 0 0 1 1.946-.26c.657 0 1.328.092 1.946.26 1.483-1.013 2.14-.805 2.14-.805.426 1.078.155 1.883.078 2.078.502.546.799 1.247.799 2.104 0 3.013-1.818 3.675-3.558 3.87.284.247.528.714.528 1.454 0 1.052-.012 1.896-.012 2.156 0 .208.142.455.528.377a7.84 7.84 0 0 0 5.324-7.441c.013-4.338-3.48-7.844-7.773-7.844`,clipRule:`evenodd`})})}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`h3`,{className:`font-headline-md font-bold text-sm uppercase m-0 flex items-center gap-2`,children:`GitHub Solutions Station`}),(0,D.jsx)(`p`,{className:`text-[11px] text-trash-gray font-semibold m-0`,children:`Sync algorithm solutions & auto-commit to your personal portfolio repository`})]})]}),(0,D.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,D.jsx)(`span`,{className:`px-2.5 py-1 text-[9px] font-bold font-arcade uppercase border-2 border-ink-black ${J?`bg-emerald-300 text-emerald-950`:`bg-amber-200 text-amber-950`}`,children:J?`CONNECTED`:`DISCONNECTED`})})]}),J?(0,D.jsxs)(`div`,{className:`space-y-4`,children:[(0,D.jsxs)(`div`,{className:`bg-white border-[3px] border-ink-black p-4 shadow-[4px_4px_0px_0px_rgba(30,41,59,1)] flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3`,children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-3`,children:[O?.avatar_url?(0,D.jsx)(`img`,{src:O.avatar_url,alt:O.login,className:`w-10 h-10 rounded-full border-2 border-ink-black shadow-[1px_1px_0px_0px_#1E293B]`}):(0,D.jsx)(`div`,{className:`w-10 h-10 bg-slate-200 rounded-full border-2 border-ink-black flex items-center justify-center font-bold`,children:`GH`}),(0,D.jsxs)(`div`,{children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,D.jsx)(`span`,{className:`font-bold text-xs text-ink-black`,children:O?.name||O?.login||n.username}),(0,D.jsxs)(`span`,{className:`text-[10px] text-trash-gray font-mono`,children:[`(@`,O?.login||n.username,`)`]})]}),(0,D.jsxs)(`div`,{className:`text-[11px] text-slate-600 font-medium flex items-center gap-1 mt-0.5`,children:[(0,D.jsx)(g,{className:`w-3.5 h-3.5 text-blue-600 shrink-0`}),(0,D.jsxs)(`span`,{className:`font-semibold text-ink-black`,children:[n.username||O?.login,`/`,n.repoName]}),(0,D.jsxs)(`span`,{className:`text-slate-400`,children:[`(`,n.branch,`)`]})]})]})]}),(0,D.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,D.jsxs)(`a`,{href:`https://github.com/${n.username||O?.login}/${n.repoName}`,target:`_blank`,rel:`noopener noreferrer`,className:`px-3 py-1.5 bg-slate-50 hover:bg-slate-100 border-2 border-ink-black text-xs font-bold text-ink-black flex items-center gap-1 shadow-[2px_2px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none no-underline cursor-pointer`,children:[(0,D.jsx)(o,{className:`w-3.5 h-3.5`}),(0,D.jsx)(`span`,{children:`View Repo`})]}),(0,D.jsxs)(`button`,{onClick:()=>{window.confirm(`Disconnect your GitHub account from AlgoSpaced?`)&&(h(),b(p()),k(null),q({type:`info`,text:`Disconnected from GitHub.`}))},className:`px-3 py-1.5 bg-white hover:bg-rose-50 border-2 border-rose-300 text-rose-700 text-xs font-bold flex items-center gap-1 cursor-pointer transition-all`,title:`Disconnect GitHub`,children:[(0,D.jsx)(T,{className:`w-3 h-3`}),(0,D.jsx)(`span`,{children:`Disconnect`})]})]})]}),(0,D.jsxs)(`div`,{className:`bg-white border-[3px] border-ink-black p-4 shadow-[4px_4px_0px_0px_rgba(30,41,59,1)] space-y-3`,children:[(0,D.jsxs)(`div`,{className:`flex items-center justify-between border-b pb-2 border-slate-200`,children:[(0,D.jsxs)(`span`,{className:`font-headline-md font-bold text-xs uppercase text-ink-black flex items-center gap-1.5`,children:[(0,D.jsx)(C,{className:`w-3.5 h-3.5 text-ink-black`}),`Target Repository & Branch`]}),(0,D.jsxs)(`button`,{onClick:Z,disabled:B,className:`px-2.5 py-1 bg-yellow-100 hover:bg-yellow-200 border border-ink-black text-[10px] font-bold text-ink-black flex items-center gap-1 cursor-pointer disabled:opacity-50 shadow-[1px_1px_0px_0px_#1E293B]`,children:[B?(0,D.jsx)(y,{className:`w-3 h-3 animate-spin`}):(0,D.jsx)(x,{className:`w-3 h-3 text-emerald-700`}),(0,D.jsx)(`span`,{children:`Verify / Init Repo`})]})]}),(0,D.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-3`,children:[(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`label`,{className:`block text-[10px] font-bold text-trash-gray uppercase mb-1`,children:`Repository Name`}),(0,D.jsx)(`input`,{type:`text`,value:n.repoName,onChange:e=>{let t=e.target.value;b(e=>({...e,repoName:t})),m({repoName:t})},placeholder:`algospaced-solutions`,className:`w-full bg-slate-50 border-2 border-ink-black rounded py-1.5 px-2.5 text-xs font-mono font-medium focus:outline-none focus:bg-white`})]}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`label`,{className:`block text-[10px] font-bold text-trash-gray uppercase mb-1`,children:`Branch Name`}),(0,D.jsx)(`input`,{type:`text`,value:n.branch,onChange:e=>{let t=e.target.value;b(e=>({...e,branch:t})),m({branch:t})},placeholder:`main`,className:`w-full bg-slate-50 border-2 border-ink-black rounded py-1.5 px-2.5 text-xs font-mono font-medium focus:outline-none focus:bg-white`})]})]}),(0,D.jsxs)(`div`,{className:`pt-2 border-t border-slate-100 flex items-center justify-between`,children:[(0,D.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,D.jsx)(_,{className:`w-4 h-4 text-amber-500 shrink-0 mt-0.5`}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`span`,{className:`text-xs font-bold text-ink-black block`,children:`Auto-commit on every submission`}),(0,D.jsx)(`span`,{className:`text-[10px] text-trash-gray font-medium`,children:`Automatically push code to your repo when grading a review card or saving a solution.`})]})]}),(0,D.jsxs)(`label`,{className:`relative inline-flex items-center cursor-pointer select-none`,children:[(0,D.jsx)(`input`,{type:`checkbox`,checked:n.autoCommit,onChange:e=>ee(e.target.checked),className:`sr-only peer`}),(0,D.jsx)(`div`,{className:`w-9 h-5 bg-slate-300 peer-focus:outline-none border-2 border-ink-black rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-2 after:border-ink-black after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-emerald-500`})]})]})]}),(0,D.jsxs)(`div`,{className:`bg-[#fffdf0] border-[3px] border-ink-black p-4 shadow-[4px_4px_0px_0px_rgba(30,41,59,1)] space-y-3`,children:[(0,D.jsxs)(`span`,{className:`font-headline-md font-bold text-xs uppercase text-ink-black flex items-center gap-1.5`,children:[(0,D.jsx)(S,{className:`w-3.5 h-3.5 text-ink-black`}),`Manual Push & Sync Operations`]}),(0,D.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-3`,children:[(0,D.jsxs)(`button`,{onClick:$,disabled:W||!t,className:`p-3 bg-white hover:bg-emerald-50 border-2 border-ink-black text-left flex flex-col justify-between gap-1 shadow-[2px_2px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none cursor-pointer transition-all disabled:opacity-50`,children:[(0,D.jsxs)(`div`,{className:`flex items-center justify-between w-full`,children:[(0,D.jsxs)(`span`,{className:`font-bold text-xs text-ink-black font-headline-md flex items-center gap-1.5`,children:[W?(0,D.jsx)(y,{className:`w-3.5 h-3.5 animate-spin text-emerald-600`}):(0,D.jsx)(w,{className:`w-3.5 h-3.5 text-emerald-600`}),`Push Active Problem`]}),t?.problem_number&&(0,D.jsxs)(`span`,{className:`text-[9px] font-mono px-1.5 py-0.5 bg-emerald-100 text-emerald-800 rounded font-bold`,children:[`#`,t.problem_number]})]}),(0,D.jsx)(`span`,{className:`text-[10px] text-slate-500 line-clamp-1`,children:t?.name||`No active problem open in review`})]}),(0,D.jsxs)(`button`,{onClick:Q,disabled:H,className:`p-3 bg-[#ffe24c] hover:bg-yellow-300 border-2 border-ink-black text-left flex flex-col justify-between gap-1 shadow-[2px_2px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none cursor-pointer transition-all disabled:opacity-50`,children:[(0,D.jsxs)(`div`,{className:`flex items-center justify-between w-full`,children:[(0,D.jsxs)(`span`,{className:`font-bold text-xs text-ink-black font-headline-md flex items-center gap-1.5`,children:[H?(0,D.jsx)(y,{className:`w-3.5 h-3.5 animate-spin text-ink-black`}):(0,D.jsx)(g,{className:`w-3.5 h-3.5 text-ink-black`}),`Sync Entire Library`]}),(0,D.jsx)(`span`,{className:`text-[8px] font-arcade uppercase font-bold bg-white px-1.5 py-0.5 border border-ink-black`,children:`BATCH`})]}),(0,D.jsx)(`span`,{className:`text-[10px] text-slate-700`,children:`Push all solved problems + generate root README index`})]})]})]})]}):(0,D.jsxs)(`div`,{className:`space-y-4`,children:[(0,D.jsxs)(`div`,{className:`bg-white border-[3px] border-ink-black p-5 sm:p-6 shadow-[4px_4px_0px_0px_rgba(30,41,59,1)] text-center space-y-4`,children:[(0,D.jsxs)(`div`,{className:`max-w-md mx-auto space-y-2`,children:[(0,D.jsx)(`h4`,{className:`font-headline-md font-bold text-sm uppercase text-ink-black m-0`,children:`Connect Your GitHub Account`}),(0,D.jsx)(`p`,{className:`text-xs text-trash-gray font-medium leading-relaxed m-0`,children:`Sync all your DSA solutions directly to your GitHub repository. Commit automatically on review completion or push anytime with 1-click.`})]}),(0,D.jsxs)(`div`,{className:`pt-2 flex flex-col items-center`,children:[(0,D.jsx)(`button`,{onClick:Y,disabled:I,className:`w-full sm:w-auto px-6 py-3 bg-[#24292e] hover:bg-black text-white font-bold text-xs uppercase font-headline-md border-[3px] border-ink-black shadow-[3px_3px_0px_0px_rgba(30,41,59,1)] active:translate-y-0.5 active:shadow-none flex items-center justify-center gap-2.5 transition-all cursor-pointer disabled:opacity-50`,children:I?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(y,{className:`w-4 h-4 animate-spin text-yellow-300`}),(0,D.jsx)(`span`,{children:`AUTHORIZING WITH GITHUB...`})]}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`svg`,{className:`w-4 h-4 fill-white`,viewBox:`0 0 19 19`,children:(0,D.jsx)(`path`,{fillRule:`evenodd`,d:`M9.356 1.85C5.05 1.85 1.57 5.356 1.57 9.694a7.84 7.84 0 0 0 5.324 7.44c.387.079.528-.168.528-.376 0-.182-.013-.805-.013-1.454-2.165.467-2.616-.935-2.616-.935-.349-.91-.864-1.143-.864-1.143-.71-.48.051-.48.051-.48.787.051 1.2.805 1.2.805.695 1.194 1.817.857 2.268.649.064-.507.27-.857.49-1.052-1.728-.182-3.545-.857-3.545-3.87 0-.857.31-1.558.8-2.104-.078-.195-.349-1 .077-2.078 0 0 .657-.208 2.14.805a7.5 7.5 0 0 1 1.946-.26c.657 0 1.328.092 1.946.26 1.483-1.013 2.14-.805 2.14-.805.426 1.078.155 1.883.078 2.078.502.546.799 1.247.799 2.104 0 3.013-1.818 3.675-3.558 3.87.284.247.528.714.528 1.454 0 1.052-.012 1.896-.012 2.156 0 .208.142.455.528.377a7.84 7.84 0 0 0 5.324-7.441c.013-4.338-3.48-7.844-7.773-7.844`,clipRule:`evenodd`})}),(0,D.jsx)(`span`,{children:`CONNECT WITH GITHUB (1-CLICK)`})]})}),(0,D.jsxs)(`span`,{className:`text-[10px] text-trash-gray mt-2`,children:[`Direct 1-click OAuth (works for guest and signed-in users). Requests `,(0,D.jsx)(`code`,{children:`repo`}),` access.`]})]})]}),(0,D.jsxs)(`div`,{className:`bg-white border-[3px] border-ink-black p-4 shadow-[4px_4px_0px_0px_rgba(30,41,59,1)]`,children:[(0,D.jsxs)(`button`,{type:`button`,onClick:()=>N(!M),className:`w-full flex items-center justify-between text-left text-xs font-bold text-ink-black font-headline-md uppercase cursor-pointer bg-transparent border-0 p-0`,children:[(0,D.jsx)(`span`,{children:`Or connect via Personal Access Token (PAT)`}),(0,D.jsx)(`span`,{className:`text-slate-500`,children:M?`▲ Hide`:`▼ Show`})]}),M&&(0,D.jsxs)(`div`,{className:`mt-3 pt-3 border-t border-slate-200 space-y-3`,children:[(0,D.jsxs)(`div`,{className:`flex items-center justify-between text-[11px]`,children:[(0,D.jsx)(`span`,{className:`font-semibold text-slate-700`,children:`Personal Access Token:`}),(0,D.jsxs)(`a`,{href:`https://github.com/settings/tokens/new?scopes=repo&description=AlgoSpaced%20Solutions%20Sync`,target:`_blank`,rel:`noopener noreferrer`,className:`text-blue-600 hover:text-blue-800 font-bold flex items-center gap-1 no-underline text-[10px]`,children:[(0,D.jsx)(`span`,{children:`Generate token with repo scope`}),(0,D.jsx)(o,{className:`w-3 h-3`})]})]}),(0,D.jsxs)(`div`,{className:`relative`,children:[(0,D.jsx)(`input`,{type:P?`text`:`password`,value:A,onChange:e=>j(e.target.value),placeholder:`ghp_... or github_pat_...`,className:`w-full bg-slate-50 border-2 border-ink-black rounded py-2 pl-3 pr-9 text-xs font-mono focus:outline-none focus:bg-white`}),(0,D.jsx)(`button`,{type:`button`,onClick:()=>F(!P),className:`absolute right-2.5 top-1/2 -translate-y-1/2 text-slate-400 hover:text-ink-black cursor-pointer bg-transparent border-0 p-1`,children:P?(0,D.jsx)(r,{className:`w-3.5 h-3.5`}):(0,D.jsx)(a,{className:`w-3.5 h-3.5`})})]}),(0,D.jsx)(`button`,{onClick:X,disabled:R||!A.trim(),className:`px-4 py-2 bg-[#ffe24c] hover:bg-yellow-300 text-ink-black font-bold text-xs uppercase border-2 border-ink-black shadow-[2px_2px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none cursor-pointer disabled:opacity-50 flex items-center gap-1.5`,children:R?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(y,{className:`w-3.5 h-3.5 animate-spin`}),(0,D.jsx)(`span`,{children:`VERIFYING TOKEN...`})]}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(x,{className:`w-3.5 h-3.5`}),(0,D.jsx)(`span`,{children:`SAVE & CONNECT TOKEN`})]})})]})]})]}),K&&(0,D.jsxs)(`div`,{className:`p-3 border-[2px] border-ink-black text-xs font-semibold rounded flex items-center justify-between gap-2 ${K.type===`success`?`bg-emerald-100 text-emerald-900 border-emerald-600`:K.type===`error`?`bg-rose-100 text-rose-900 border-rose-600`:`bg-sky-100 text-sky-900 border-sky-600`}`,children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-2`,children:[K.type===`success`?(0,D.jsx)(v,{className:`w-4 h-4 shrink-0`}):(0,D.jsx)(i,{className:`w-4 h-4 shrink-0`}),(0,D.jsx)(`span`,{children:K.text})]}),K.linkUrl&&(0,D.jsxs)(`a`,{href:K.linkUrl,target:`_blank`,rel:`noopener noreferrer`,className:`px-2 py-0.5 bg-white border border-ink-black text-[10px] font-bold text-ink-black hover:bg-slate-50 no-underline shrink-0 flex items-center gap-1`,children:[(0,D.jsx)(`span`,{children:`Open`}),(0,D.jsx)(o,{className:`w-3 h-3`})]})]})]}),(0,D.jsx)(`div`,{className:`pt-4 border-t border-slate-300 flex justify-end`,children:(0,D.jsx)(`button`,{onClick:e,className:`px-4 py-2 bg-white hover:bg-slate-100 border-[2px] border-ink-black text-xs font-bold text-ink-black shadow-[2px_2px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none cursor-pointer uppercase`,children:`CLOSE`})})]})};export{O as GitHubSyncWindow,O as default};
|
algospaced-ui/dist/assets/{JourneyPath-C36BylWW.js → JourneyPath-Dg9Be99S.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{a as e,c as t,i as n,t as r}from"./jsx-runtime-j9uSgrFF.js";import{a as i,i as a,n as o,r as s,t as c}from"./confetti.module-DRqH0UE1.js";import{t as l}from"./external-link-mE9fgxrX.js";import{t as u}from"./info-DKabFp4k.js";import{B as d,C as f,E as p,F as m,L as h,M as g,N as _,R as v,T as y,U as b,V as x,c as S,j as C,k as w,n as T,o as E,w as D,z as O}from"./index-C7Gd5Mn4.js";var k=b(`arrow-up-down`,[[`path`,{d:`m21 16-4 4-4-4`,key:`f6ql7i`}],[`path`,{d:`M17 20V4`,key:`1ejh1v`}],[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}]]),A=b(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),j=b(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),ee=b(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),te=b(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),ne=b(`map-pin`,[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`,key:`1r0f0z`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}]]),re=b(`map`,[[`path`,{d:`M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z`,key:`169xi5`}],[`path`,{d:`M15 5.764v15`,key:`1pn4in`}],[`path`,{d:`M9 3.236v15`,key:`1uimfh`}]]),ie=b(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),ae=b(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),oe=b(`route`,[[`circle`,{cx:`6`,cy:`19`,r:`3`,key:`1kj8tv`}],[`path`,{d:`M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15`,key:`1d8sl`}],[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}]]),se=b(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),ce=b(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),M=b(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),N=b(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),le=b(`target`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`6`,key:`1vlfrh`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),P=b(`zoom-in`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`11`,x2:`11`,y1:`8`,y2:`14`,key:`1vmskp`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),F=b(`zoom-out`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),I=t(e(),1),L=2600,R=1500,z=[{tMax:.15,name:`The Whispering Coast & Lowlands`,biome:`coast`},{tMax:.32,name:`The Elderwood Deep Forest`,biome:`forest`},{tMax:.48,name:`River Elden & The Twin Fords`,biome:`river`},{tMax:.68,name:`The Dragon Tooth Mountains & Passes`,biome:`mountain`},{tMax:.83,name:`The Misty Glade & Highland Woods`,biome:`forest`},{tMax:.93,name:`The Roaring Gorge & Cataracts`,biome:`river`},{tMax:1,name:`The Sunstone Peaks & Ancient Citadel`,biome:`ancient_ruins`}],B=[`Pencil marks still visible from the cartographer’s first survey.`,`A calm breeze sweeps through the grass, carrying the scent of pine.`,`Wooden planks creak underfoot as the river roars below.`,`Craggy pencil hatchings reveal steep, unforgiving granite slopes.`,`Ancient roots break through the worn gravel pathway.`,`The sound of rushing water echoes across the canyon walls.`,`A solitary stone marker inscribed with early explorer symbols.`,`Golden light filters softly through the sketched canopy.`,`Distant mountain ridges frame the expanding horizon.`,`A tranquil haven where wanderers rest before the mountain climb.`];function ue(e=[],t={}){let n=[],r=e.length>0?e.length:150,i=[{t:0,x:220,y:1320,elev:10},{t:.08,x:380,y:1140,elev:45},{t:.16,x:580,y:980,elev:120},{t:.24,x:820,y:1120,elev:90},{t:.32,x:940,y:860,elev:180},{t:.4,x:720,y:640,elev:320},{t:.48,x:1050,y:520,elev:580},{t:.56,x:1320,y:720,elev:890},{t:.64,x:1540,y:480,elev:1250},{t:.72,x:1780,y:680,elev:920},{t:.8,x:1980,y:920,elev:460},{t:.88,x:2220,y:760,elev:750},{t:.94,x:2180,y:480,elev:1180},{t:1,x:2420,y:240,elev:1620}];for(let a=0;a<r;a++){let o=r>1?a/(r-1):0,s=0;for(;s<i.length-2&&i[s+1].t<o;)s++;let c=i[Math.max(0,s-1)],l=i[s],u=i[Math.min(i.length-1,s+1)],d=i[Math.min(i.length-1,s+2)],f=u.t-l.t||.001,p=(o-l.t)/f,m=p,h=m*m,g=h*m,_=-.5*g+h-.5*m,v=1.5*g-2.5*h+1,y=-1.5*g+2*h+.5*m,b=.5*g-.5*h,x=_*c.x+v*l.x+y*u.x+b*d.x,S=_*c.y+v*l.y+y*u.y+b*d.y,C=Math.sin(a*.45)*14+Math.cos(a*.9)*8,w=Math.cos(a*.4)*14+Math.sin(a*.85)*8;x=Math.round(x+C),S=Math.round(S+w);let T=Math.round(l.elev+p*(u.elev-l.elev)+Math.sin(a*.5)*15),E=z.find(e=>o<=e.tMax)||z[z.length-1],D=e.length>0?e[a]:a+1,O=t[D]||(D<0?`Custom Challenge ${a+1}`:`LeetCode #${D}`),k=B[a%B.length];n.push({id:D,sequenceIndex:a,x,y:S,name:O,biome:E.biome,regionName:E.name,elevation:Math.max(10,T),lore:k})}return n}var V=[{id:`wm-bg1`,x:380,y:310,size:70,height:85,ridgeShift:-4,hasSnow:!1,layer:0,elevation:840,rangeName:`Western Crags`},{id:`wm-bg2`,x:490,y:280,size:85,height:105,ridgeShift:6,hasSnow:!0,layer:0,elevation:1120,name:`Peak of the North Wind`,rangeName:`Western Crags`},{id:`wm-bg3`,x:620,y:300,size:75,height:95,ridgeShift:-3,hasSnow:!1,layer:0,elevation:960,rangeName:`Western Crags`},{id:`wm-bg4`,x:730,y:320,size:65,height:80,ridgeShift:4,hasSnow:!1,layer:0,elevation:780,rangeName:`Western Crags`},{id:`m1`,x:430,y:375,size:80,height:105,ridgeShift:5,hasSnow:!0,elevation:1240,name:`Crag of the Mist`,rangeName:`Western Crags`},{id:`m2`,x:530,y:345,size:95,height:125,ridgeShift:-7,hasSnow:!0,elevation:1480,name:`Peak of Solitude`,rangeName:`Western Crags`},{id:`m3`,x:630,y:365,size:85,height:110,ridgeShift:3,hasSnow:!0,elevation:1310,name:`Shadowhorn`,rangeName:`Western Crags`},{id:`m4`,x:720,y:385,size:70,height:90,ridgeShift:-4,hasSnow:!1,elevation:990,rangeName:`Western Crags`},{id:`m5`,x:370,y:430,size:55,height:65,ridgeShift:4,hasSnow:!1,layer:2,elevation:620,rangeName:`Western Crags`},{id:`m6`,x:470,y:425,size:68,height:80,ridgeShift:-3,hasSnow:!1,layer:2,elevation:760,name:`Gullwing Bluff`,rangeName:`Western Crags`},{id:`m6b`,x:575,y:420,size:72,height:88,ridgeShift:3,hasSnow:!1,layer:2,elevation:850,rangeName:`Western Crags`},{id:`m6c`,x:670,y:435,size:58,height:70,ridgeShift:-2,hasSnow:!1,layer:2,elevation:680,rangeName:`Western Crags`},{id:`dt-bg1`,x:1130,y:260,size:90,height:120,ridgeShift:-6,hasSnow:!0,layer:0,elevation:1850,rangeName:`Dragon's Tooth Range`},{id:`dt-bg2`,x:1250,y:225,size:115,height:150,ridgeShift:8,hasSnow:!0,layer:0,elevation:2180,name:`Crown of the North`,rangeName:`Dragon's Tooth Range`},{id:`dt-bg3`,x:1380,y:210,size:130,height:175,ridgeShift:-10,hasSnow:!0,layer:0,elevation:2450,name:`Apex of Clouds`,rangeName:`Dragon's Tooth Range`},{id:`dt-bg4`,x:1510,y:240,size:110,height:145,ridgeShift:7,hasSnow:!0,layer:0,elevation:2020,rangeName:`Dragon's Tooth Range`},{id:`dt-bg5`,x:1640,y:280,size:90,height:115,ridgeShift:-5,hasSnow:!0,layer:0,elevation:1690,rangeName:`Dragon's Tooth Range`},{id:`m7`,x:1190,y:325,size:105,height:140,ridgeShift:-8,hasSnow:!0,elevation:1980,name:`The Dragon's Crest`,rangeName:`Dragon's Tooth Range`},{id:`m8`,x:1310,y:295,size:125,height:165,ridgeShift:10,hasSnow:!0,elevation:2360,name:`Frostcrag Pinnacle`,rangeName:`Dragon's Tooth Range`},{id:`m9`,x:1435,y:320,size:115,height:150,ridgeShift:-6,hasSnow:!0,elevation:2120,name:`Thunderhorn Peak`,rangeName:`Dragon's Tooth Range`},{id:`m10`,x:1560,y:355,size:98,height:125,ridgeShift:7,hasSnow:!0,elevation:1780,name:`Screaming Ridge`,rangeName:`Dragon's Tooth Range`},{id:`m10b`,x:1680,y:375,size:85,height:105,ridgeShift:-4,hasSnow:!1,elevation:1420,rangeName:`Dragon's Tooth Range`},{id:`m11`,x:1260,y:415,size:90,height:115,ridgeShift:-5,hasSnow:!0,elevation:1560,name:`Ironhorn Needle`,rangeName:`Dragon's Tooth Range`},{id:`m12`,x:1375,y:405,size:100,height:130,ridgeShift:6,hasSnow:!0,elevation:1720,name:`Shadowcrevasse Crag`,rangeName:`Dragon's Tooth Range`},{id:`m13`,x:1490,y:440,size:88,height:110,ridgeShift:-4,hasSnow:!0,elevation:1490,rangeName:`Dragon's Tooth Range`},{id:`m14`,x:1610,y:435,size:82,height:100,ridgeShift:5,hasSnow:!1,elevation:1320,rangeName:`Dragon's Tooth Range`},{id:`m15`,x:1160,y:590,size:80,height:100,ridgeShift:5,hasSnow:!1,elevation:1180,name:`Wanderer's Bluff`,rangeName:`Mid-Pass Gorge`},{id:`m16`,x:1390,y:610,size:90,height:115,ridgeShift:-6,hasSnow:!0,elevation:1390,name:`Eagle Eye Ridge`,rangeName:`Mid-Pass Gorge`},{id:`m17`,x:1510,y:585,size:95,height:120,ridgeShift:5,hasSnow:!0,elevation:1520,name:`Razorback Spine`,rangeName:`Mid-Pass Gorge`},{id:`m18`,x:1630,y:565,size:85,height:105,ridgeShift:-4,hasSnow:!1,elevation:1280,rangeName:`Mid-Pass Gorge`},{id:`m18b`,x:1740,y:580,size:75,height:90,ridgeShift:3,hasSnow:!1,elevation:1050,rangeName:`Mid-Pass Gorge`},{id:`es-bg1`,x:1980,y:310,size:88,height:115,ridgeShift:-5,hasSnow:!0,layer:0,elevation:1650,rangeName:`Sunstone Highlands`},{id:`es-bg2`,x:2110,y:245,size:105,height:140,ridgeShift:6,hasSnow:!0,layer:0,elevation:1980,name:`Sun Pillar`,rangeName:`Sunstone Highlands`},{id:`es-bg3`,x:2260,y:160,size:135,height:180,ridgeShift:-8,hasSnow:!0,layer:0,elevation:2580,name:`Crown of the Heavens`,rangeName:`Sunstone Highlands`},{id:`es-bg4`,x:2410,y:210,size:115,height:150,ridgeShift:7,hasSnow:!0,layer:0,elevation:2240,rangeName:`Sunstone Highlands`},{id:`m19`,x:2040,y:375,size:98,height:128,ridgeShift:6,hasSnow:!0,elevation:1720,name:`Sunstone Spire`,rangeName:`Sunstone Highlands`},{id:`m20`,x:2170,y:315,size:115,height:150,ridgeShift:-7,hasSnow:!0,elevation:2080,name:`Sanctuary Peak`,rangeName:`Sunstone Highlands`},{id:`m21`,x:2310,y:220,size:130,height:170,ridgeShift:8,hasSnow:!0,elevation:2390,name:`Pinnacle of the Ancients`,rangeName:`Sunstone Highlands`},{id:`m22`,x:2440,y:360,size:90,height:115,ridgeShift:-5,hasSnow:!0,elevation:1610,name:`Falcon Perch`,rangeName:`Sunstone Highlands`},{id:`m23`,x:2260,y:405,size:82,height:98,ridgeShift:4,hasSnow:!1,elevation:1250,name:`Altar Crag`,rangeName:`Sunstone Highlands`},{id:`m24`,x:2380,y:420,size:76,height:88,ridgeShift:-3,hasSnow:!1,elevation:1120,rangeName:`Sunstone Highlands`},{id:`m25`,x:2140,y:450,size:70,height:80,ridgeShift:3,hasSnow:!1,elevation:980,rangeName:`Sunstone Highlands`}],H=[{id:`river-elden`,name:`River Elden`,d:`M 1340,290 C 1310,380 1260,460 1210,540 C 1140,640 1020,700 960,820 C 900,940 930,1060 880,1180 C 840,1280 760,1360 690,1480`,width:14,hasBridges:[{x:945,y:855,angle:-35},{x:890,y:1160,angle:25}]},{id:`river-silver`,name:`Silver Meander`,d:`M 580,410 C 650,490 730,550 780,660 C 830,760 910,810 960,820`,width:8,hasBridges:[{x:740,y:620,angle:45}]},{id:`river-cataract`,name:`Highland Torrent`,d:`M 2150,320 C 2100,450 2050,600 2020,760 C 1990,920 1920,1050 1840,1180 C 1760,1310 1710,1420 1660,1500`,width:11,hasBridges:[{x:2010,y:810,angle:-20}]}],U=[{id:`f1`,name:`The Whispering Pines`,cx:580,cy:1040,rx:230,ry:160,treeCount:42,trees:W(580,1040,210,140,42,`pines`)},{id:`f2`,name:`Elderwood Deep`,cx:820,cy:1140,rx:250,ry:180,treeCount:52,trees:W(820,1140,230,160,52,`oaks`)},{id:`f3`,name:`Mistwood Valley`,cx:860,cy:620,rx:190,ry:140,treeCount:36,trees:W(860,620,170,120,36,`willows`)},{id:`f4`,name:`Highland Spruces`,cx:1760,cy:740,rx:210,ry:155,treeCount:38,trees:W(1760,740,190,135,38,`highland_spruce`)},{id:`f5`,name:`Verdant Basin`,cx:1960,cy:980,rx:200,ry:150,treeCount:38,trees:W(1960,980,180,130,38,`mixed`)},{id:`f6`,name:`Shadowglen Copse`,cx:390,cy:690,rx:140,ry:100,treeCount:22,trees:W(390,690,120,80,22,`pines`)},{id:`f7`,name:`Sunstone Grove`,cx:2360,cy:580,rx:150,ry:110,treeCount:24,trees:W(2360,580,130,90,24,`mixed`)}];function W(e,t,n,r,i,a){let o=[];for(let s=0;s<i;s++){let c=s*2.399963+Math.sin(s*1.7)*.4,l=((s+.5)/i)**.65,u=Math.sin(s*4.3+e)*14,d=Math.cos(s*3.9+t)*12,f=Math.round(e+n*l*Math.cos(c)+u),p=Math.round(t+r*l*Math.sin(c)+d),m=.85+s%4*.1;s===0||s===5?m=1.35:s%7==0&&(m=.68);let h=`pine`;if(a===`pines`)h=s%6==0?`birch`:`pine`;else if(a===`oaks`)h=s===0||s===5?`ancient_oak`:s%5==0?`birch`:`oak`;else if(a===`willows`)h=s%3==0?`willow`:s%4==0?`birch`:`oak`;else if(a===`highland_spruce`)h=s%5==0?`pine`:`spruce`;else{let e=s%5;h=e===0?`ancient_oak`:e===1?`pine`:e===2?`oak`:e===3?`spruce`:`birch`}o.push({x:f,y:p,scale:m,type:h,seed:Math.round(e*7+t*11+s*31)})}return o}function G(e){if(e.length===0)return``;if(e.length===1)return`M ${e[0].x},${e[0].y}`;let t=`M ${e[0].x},${e[0].y}`;for(let n=0;n<e.length-1;n++){let r=e[n],i=e[n+1],a=(r.x+i.x)/2,o=(r.y+i.y)/2;if(n===0)t+=` Q ${r.x},${r.y} ${a},${o}`;else{let a=e[n-1],o=r.x+(i.x-a.x)*.18,s=r.y+(i.y-a.y)*.18;t+=` S ${o},${s} ${i.x},${i.y}`}}return t}function K(e,t){return t<=0||e.length===0?``:G(e.slice(0,t+1))}var de={parchment:{id:`parchment`,name:`Daylight Parchment`,bgClass:`parchment-bg`,textColor:`#2c221a`,pencilColor:`#382e25`,pencilShade:`#8c765c`,riverColor:`#96afbe`,glowColor:`#f59e0b`,glowSubtle:`#fbbf24`,nodeUnlit:`#f0e5ce`,nodeLit:`#fbbf24`,nodeLitStroke:`#ffffff`},dark_parchment:{id:`dark_parchment`,name:`Midnight Cartography`,bgClass:`parchment-dark-bg`,textColor:`#f3e9d2`,pencilColor:`#8a7761`,pencilShade:`#4a3f33`,riverColor:`#365163`,glowColor:`#fbbf24`,glowSubtle:`#f59e0b`,nodeUnlit:`#231e17`,nodeLit:`#f59e0b`,nodeLitStroke:`#fffbeb`}},q=new class{ctx=null;enabled=!0;initCtx(){if(!this.ctx&&typeof window<`u`){let e=window.AudioContext||window.webkitAudioContext;e&&(this.ctx=new e)}this.ctx&&this.ctx.state===`suspended`&&this.ctx.resume()}setEnabled(e){this.enabled=e,e&&this.initCtx()}isEnabled(){return this.enabled}playNodeLightUp(e,t=150){if(this.enabled&&(this.initCtx(),this.ctx))try{let n=this.ctx.currentTime,r=[261.63,293.66,329.63,392,440,523.25,587.33,659.25,783.99,880],i=Math.floor(e/Math.max(1,t)*20),a=1+Math.floor(i/r.length)*.5,o=r[i%r.length]*a,s=this.ctx.createOscillator(),c=this.ctx.createOscillator(),l=this.ctx.createGain();s.type=`sine`,s.frequency.setValueAtTime(o,n),c.type=`triangle`,c.frequency.setValueAtTime(o*2.01,n),l.gain.setValueAtTime(.001,n),l.gain.linearRampToValueAtTime(.12,n+.02),l.gain.exponentialRampToValueAtTime(1e-4,n+.55),s.connect(l),c.connect(l),l.connect(this.ctx.destination),s.start(n),c.start(n),s.stop(n+.6),c.stop(n+.6)}catch{}}playPencilScratch(){if(this.enabled&&(this.initCtx(),this.ctx))try{let e=this.ctx.currentTime,t=Math.floor(this.ctx.sampleRate*.06),n=this.ctx.createBuffer(1,t,this.ctx.sampleRate),r=n.getChannelData(0);for(let e=0;e<t;e++)r[e]=(Math.random()*2-1)*Math.exp(-e/(t*.4));let i=this.ctx.createBufferSource();i.buffer=n;let a=this.ctx.createBiquadFilter();a.type=`bandpass`,a.frequency.setValueAtTime(1400+Math.random()*800,e),a.Q.setValueAtTime(3.5,e);let o=this.ctx.createGain();o.gain.setValueAtTime(.04,e),o.gain.exponentialRampToValueAtTime(.001,e+.05),i.connect(a),a.connect(o),o.connect(this.ctx.destination),i.start(e)}catch{}}playVictoryChime(){this.enabled&&(this.initCtx(),this.ctx&&[523.25,659.25,783.99,1046.5].forEach((e,t)=>{setTimeout(()=>{if(!this.ctx)return;let t=this.ctx.currentTime,n=this.ctx.createOscillator(),r=this.ctx.createGain();n.type=`sine`,n.frequency.setValueAtTime(e,t),r.gain.setValueAtTime(.001,t),r.gain.linearRampToValueAtTime(.15,t+.05),r.gain.exponentialRampToValueAtTime(1e-4,t+1.2),n.connect(r),r.connect(this.ctx.destination),n.start(t),n.stop(t+1.3)},t*120)}))}},J=r();function Y(e){let t=Math.sin(e*12.9898+78.233)*43758.5453;return t-Math.floor(t)}var fe=({mountain:e,theme:t})=>{let n=t.id!==`parchment`,r=t.pencilColor,i=t.pencilShade,{id:a,x:o,y:s,size:c,height:l,ridgeShift:u=0,hasSnow:d=l>95}=e,f=(0,I.useMemo)(()=>{let e=0;for(let t=0;t<a.length;t++)e+=a.charCodeAt(t)*(t+1);e+=Math.round(o+s);let t=o+u,n=s-l,r=o-c,i=o+c,f=[{x:t,y:n}];for(let i=1;i<=6;i++){let a=i/6,o=t-(t-r)*a,s=n+l*a,u=(Y(e+i*17)-.48)*(c*.14)*Math.sin(a*Math.PI),d=Y(e+i*31)>.65?l*.04:0;f.push({x:Math.round(o+u),y:Math.round(s+d)})}let p=[];for(let r=1;r<=6;r++){let a=r/6,o=t+(i-t)*a,s=n+l*a,u=(Y(e+r*43)-.48)*(c*.14)*Math.sin(a*Math.PI),d=Y(e+r*59)>.65?l*.04:0;p.push({x:Math.round(o+u),y:Math.round(s+d)})}let m=[{x:t,y:n}];for(let r=1;r<=7;r++){let i=r/7,a=t+(o+u*.25+(Y(e+101)-.5)*(c*.15)-t)*i**1.2,s=n+l*i,d=Math.sin(i*Math.PI*2.2+Y(e+113))*(c*.1);m.push({x:Math.round(a+d),y:Math.round(s)})}let h=[],g=m[Math.min(m.length-1,2)];if(g){let t=o+c*.55+(Y(e+201)-.5)*15,n=s-l*.12,r=(g.x+t)/2+12,i=(g.y+n)/2-6;h.push({d:`M ${g.x},${g.y} Q ${r},${i} ${t},${n}`,side:`right`})}let _=m[Math.min(m.length-1,5)];if(_){let t=o+c*.85+(Y(e+209)-.5)*15,n=s,r=(_.x+t)/2+10,i=(_.y+n)/2-4;h.push({d:`M ${_.x},${_.y} Q ${r},${i} ${t},${n}`,side:`right`})}let v=m[Math.min(m.length-1,3)];if(v){let t=o-c*.6+(Y(e+301)-.5)*15,n=s-l*.15,r=(v.x+t)/2-10,i=(v.y+n)/2-5;h.push({d:`M ${v.x},${v.y} Q ${r},${i} ${t},${n}`,side:`left`})}let y=[],b=Math.max(14,Math.round(l/4.8));for(let r=1;r<=b;r++){let a=r/(b+1),o=m[Math.min(m.length-1,Math.max(0,Math.round(a*(m.length-1))))],s=n+l*a,c=p[Math.min(p.length-1,Math.max(0,Math.round(a*(p.length-1))))]||{x:t+(i-t)*a,y:s},u=o.x+(c.x-o.x)*.08,d=s+(Y(e+r*71)-.5)*3,f=r%3==0?.92:r%2==0?.75:.6,h=u+(c.x-u)*f,g=d+((s-n)*.22+(c.y-s)*.35)+(Y(e+r*83)-.5)*4;y.push({x1:Math.round(u),y1:Math.round(d),x2:Math.round(h),y2:Math.round(g),width:r<4?.9:1.25,opacity:r<3?.6:.85}),r>4&&r%2==0&&y.push({x1:Math.round(u+(h-u)*.3),y1:Math.round(d+(g-d)*.3),x2:Math.round(u+(h-u)*.75),y2:Math.round(d+(g-d)*.15),width:.75,opacity:.55})}let x=[],S=Math.max(4,Math.round(l/18));for(let i=1;i<=S;i++){let a=(i+.3)/(S+1),o=n+l*a,s=m[Math.min(m.length-1,Math.round(a*(m.length-1)))],c=f[Math.min(f.length-1,Math.round(a*(f.length-1)))]||{x:t-(t-r)*a,y:o},u=s.x-(s.x-c.x)*.25,d=o+2,p=s.x-(s.x-c.x)*(.6+Y(e+i*97)*.3),h=o+8+Y(e+i*103)*6,g=(u+p)/2-4,_=(d+h)/2+3;if(x.push({d:`M ${Math.round(u)},${Math.round(d)} Q ${Math.round(g)},${Math.round(_)} ${Math.round(p)},${Math.round(h)}`,width:.9}),i%2==1){let e=u-6,t=d+3;x.push({d:`M ${Math.round(e)},${Math.round(t)} L ${Math.round(e-8)},${Math.round(t+10)}`,width:.75})}}let C=``,w=``;if(d){let e=n+l*.32,a=t-(t-r)*.32,o=t+(i-t)*.32,s=m[Math.min(m.length-1,2)]||{x:t,y:e},c={x:t-(t-r)*.16,y:e-4},u={x:t-(t-r)*.26,y:e+6},d={x:t+(i-t)*.14,y:e+3},h={x:t+(i-t)*.24,y:e-2};C=`M ${t},${n}
|
| 2 |
L ${f[1].x},${f[1].y}
|
| 3 |
L ${a},${e}
|
| 4 |
Q ${u.x},${u.y} ${c.x},${c.y}
|
|
|
|
| 1 |
+
import{a as e,c as t,i as n,t as r}from"./jsx-runtime-j9uSgrFF.js";import{a as i,i as a,n as o,r as s,t as c}from"./confetti.module-BEqdENp8.js";import{t as l}from"./external-link-yb1gedrc.js";import{t as u}from"./info-CU16dSEt.js";import{B as d,C as f,E as p,F as m,L as h,M as g,N as _,R as v,T as y,U as b,V as x,c as S,j as C,k as w,n as T,o as E,w as D,z as O}from"./index-g5jVBiGr.js";var k=b(`arrow-up-down`,[[`path`,{d:`m21 16-4 4-4-4`,key:`f6ql7i`}],[`path`,{d:`M17 20V4`,key:`1ejh1v`}],[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}]]),A=b(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),j=b(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),ee=b(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),te=b(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),ne=b(`map-pin`,[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`,key:`1r0f0z`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}]]),re=b(`map`,[[`path`,{d:`M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z`,key:`169xi5`}],[`path`,{d:`M15 5.764v15`,key:`1pn4in`}],[`path`,{d:`M9 3.236v15`,key:`1uimfh`}]]),ie=b(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),ae=b(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),oe=b(`route`,[[`circle`,{cx:`6`,cy:`19`,r:`3`,key:`1kj8tv`}],[`path`,{d:`M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15`,key:`1d8sl`}],[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}]]),se=b(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),ce=b(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),M=b(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),N=b(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),le=b(`target`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`6`,key:`1vlfrh`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),P=b(`zoom-in`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`11`,x2:`11`,y1:`8`,y2:`14`,key:`1vmskp`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),F=b(`zoom-out`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),I=t(e(),1),L=2600,R=1500,z=[{tMax:.15,name:`The Whispering Coast & Lowlands`,biome:`coast`},{tMax:.32,name:`The Elderwood Deep Forest`,biome:`forest`},{tMax:.48,name:`River Elden & The Twin Fords`,biome:`river`},{tMax:.68,name:`The Dragon Tooth Mountains & Passes`,biome:`mountain`},{tMax:.83,name:`The Misty Glade & Highland Woods`,biome:`forest`},{tMax:.93,name:`The Roaring Gorge & Cataracts`,biome:`river`},{tMax:1,name:`The Sunstone Peaks & Ancient Citadel`,biome:`ancient_ruins`}],B=[`Pencil marks still visible from the cartographer’s first survey.`,`A calm breeze sweeps through the grass, carrying the scent of pine.`,`Wooden planks creak underfoot as the river roars below.`,`Craggy pencil hatchings reveal steep, unforgiving granite slopes.`,`Ancient roots break through the worn gravel pathway.`,`The sound of rushing water echoes across the canyon walls.`,`A solitary stone marker inscribed with early explorer symbols.`,`Golden light filters softly through the sketched canopy.`,`Distant mountain ridges frame the expanding horizon.`,`A tranquil haven where wanderers rest before the mountain climb.`];function ue(e=[],t={}){let n=[],r=e.length>0?e.length:150,i=[{t:0,x:220,y:1320,elev:10},{t:.08,x:380,y:1140,elev:45},{t:.16,x:580,y:980,elev:120},{t:.24,x:820,y:1120,elev:90},{t:.32,x:940,y:860,elev:180},{t:.4,x:720,y:640,elev:320},{t:.48,x:1050,y:520,elev:580},{t:.56,x:1320,y:720,elev:890},{t:.64,x:1540,y:480,elev:1250},{t:.72,x:1780,y:680,elev:920},{t:.8,x:1980,y:920,elev:460},{t:.88,x:2220,y:760,elev:750},{t:.94,x:2180,y:480,elev:1180},{t:1,x:2420,y:240,elev:1620}];for(let a=0;a<r;a++){let o=r>1?a/(r-1):0,s=0;for(;s<i.length-2&&i[s+1].t<o;)s++;let c=i[Math.max(0,s-1)],l=i[s],u=i[Math.min(i.length-1,s+1)],d=i[Math.min(i.length-1,s+2)],f=u.t-l.t||.001,p=(o-l.t)/f,m=p,h=m*m,g=h*m,_=-.5*g+h-.5*m,v=1.5*g-2.5*h+1,y=-1.5*g+2*h+.5*m,b=.5*g-.5*h,x=_*c.x+v*l.x+y*u.x+b*d.x,S=_*c.y+v*l.y+y*u.y+b*d.y,C=Math.sin(a*.45)*14+Math.cos(a*.9)*8,w=Math.cos(a*.4)*14+Math.sin(a*.85)*8;x=Math.round(x+C),S=Math.round(S+w);let T=Math.round(l.elev+p*(u.elev-l.elev)+Math.sin(a*.5)*15),E=z.find(e=>o<=e.tMax)||z[z.length-1],D=e.length>0?e[a]:a+1,O=t[D]||(D<0?`Custom Challenge ${a+1}`:`LeetCode #${D}`),k=B[a%B.length];n.push({id:D,sequenceIndex:a,x,y:S,name:O,biome:E.biome,regionName:E.name,elevation:Math.max(10,T),lore:k})}return n}var V=[{id:`wm-bg1`,x:380,y:310,size:70,height:85,ridgeShift:-4,hasSnow:!1,layer:0,elevation:840,rangeName:`Western Crags`},{id:`wm-bg2`,x:490,y:280,size:85,height:105,ridgeShift:6,hasSnow:!0,layer:0,elevation:1120,name:`Peak of the North Wind`,rangeName:`Western Crags`},{id:`wm-bg3`,x:620,y:300,size:75,height:95,ridgeShift:-3,hasSnow:!1,layer:0,elevation:960,rangeName:`Western Crags`},{id:`wm-bg4`,x:730,y:320,size:65,height:80,ridgeShift:4,hasSnow:!1,layer:0,elevation:780,rangeName:`Western Crags`},{id:`m1`,x:430,y:375,size:80,height:105,ridgeShift:5,hasSnow:!0,elevation:1240,name:`Crag of the Mist`,rangeName:`Western Crags`},{id:`m2`,x:530,y:345,size:95,height:125,ridgeShift:-7,hasSnow:!0,elevation:1480,name:`Peak of Solitude`,rangeName:`Western Crags`},{id:`m3`,x:630,y:365,size:85,height:110,ridgeShift:3,hasSnow:!0,elevation:1310,name:`Shadowhorn`,rangeName:`Western Crags`},{id:`m4`,x:720,y:385,size:70,height:90,ridgeShift:-4,hasSnow:!1,elevation:990,rangeName:`Western Crags`},{id:`m5`,x:370,y:430,size:55,height:65,ridgeShift:4,hasSnow:!1,layer:2,elevation:620,rangeName:`Western Crags`},{id:`m6`,x:470,y:425,size:68,height:80,ridgeShift:-3,hasSnow:!1,layer:2,elevation:760,name:`Gullwing Bluff`,rangeName:`Western Crags`},{id:`m6b`,x:575,y:420,size:72,height:88,ridgeShift:3,hasSnow:!1,layer:2,elevation:850,rangeName:`Western Crags`},{id:`m6c`,x:670,y:435,size:58,height:70,ridgeShift:-2,hasSnow:!1,layer:2,elevation:680,rangeName:`Western Crags`},{id:`dt-bg1`,x:1130,y:260,size:90,height:120,ridgeShift:-6,hasSnow:!0,layer:0,elevation:1850,rangeName:`Dragon's Tooth Range`},{id:`dt-bg2`,x:1250,y:225,size:115,height:150,ridgeShift:8,hasSnow:!0,layer:0,elevation:2180,name:`Crown of the North`,rangeName:`Dragon's Tooth Range`},{id:`dt-bg3`,x:1380,y:210,size:130,height:175,ridgeShift:-10,hasSnow:!0,layer:0,elevation:2450,name:`Apex of Clouds`,rangeName:`Dragon's Tooth Range`},{id:`dt-bg4`,x:1510,y:240,size:110,height:145,ridgeShift:7,hasSnow:!0,layer:0,elevation:2020,rangeName:`Dragon's Tooth Range`},{id:`dt-bg5`,x:1640,y:280,size:90,height:115,ridgeShift:-5,hasSnow:!0,layer:0,elevation:1690,rangeName:`Dragon's Tooth Range`},{id:`m7`,x:1190,y:325,size:105,height:140,ridgeShift:-8,hasSnow:!0,elevation:1980,name:`The Dragon's Crest`,rangeName:`Dragon's Tooth Range`},{id:`m8`,x:1310,y:295,size:125,height:165,ridgeShift:10,hasSnow:!0,elevation:2360,name:`Frostcrag Pinnacle`,rangeName:`Dragon's Tooth Range`},{id:`m9`,x:1435,y:320,size:115,height:150,ridgeShift:-6,hasSnow:!0,elevation:2120,name:`Thunderhorn Peak`,rangeName:`Dragon's Tooth Range`},{id:`m10`,x:1560,y:355,size:98,height:125,ridgeShift:7,hasSnow:!0,elevation:1780,name:`Screaming Ridge`,rangeName:`Dragon's Tooth Range`},{id:`m10b`,x:1680,y:375,size:85,height:105,ridgeShift:-4,hasSnow:!1,elevation:1420,rangeName:`Dragon's Tooth Range`},{id:`m11`,x:1260,y:415,size:90,height:115,ridgeShift:-5,hasSnow:!0,elevation:1560,name:`Ironhorn Needle`,rangeName:`Dragon's Tooth Range`},{id:`m12`,x:1375,y:405,size:100,height:130,ridgeShift:6,hasSnow:!0,elevation:1720,name:`Shadowcrevasse Crag`,rangeName:`Dragon's Tooth Range`},{id:`m13`,x:1490,y:440,size:88,height:110,ridgeShift:-4,hasSnow:!0,elevation:1490,rangeName:`Dragon's Tooth Range`},{id:`m14`,x:1610,y:435,size:82,height:100,ridgeShift:5,hasSnow:!1,elevation:1320,rangeName:`Dragon's Tooth Range`},{id:`m15`,x:1160,y:590,size:80,height:100,ridgeShift:5,hasSnow:!1,elevation:1180,name:`Wanderer's Bluff`,rangeName:`Mid-Pass Gorge`},{id:`m16`,x:1390,y:610,size:90,height:115,ridgeShift:-6,hasSnow:!0,elevation:1390,name:`Eagle Eye Ridge`,rangeName:`Mid-Pass Gorge`},{id:`m17`,x:1510,y:585,size:95,height:120,ridgeShift:5,hasSnow:!0,elevation:1520,name:`Razorback Spine`,rangeName:`Mid-Pass Gorge`},{id:`m18`,x:1630,y:565,size:85,height:105,ridgeShift:-4,hasSnow:!1,elevation:1280,rangeName:`Mid-Pass Gorge`},{id:`m18b`,x:1740,y:580,size:75,height:90,ridgeShift:3,hasSnow:!1,elevation:1050,rangeName:`Mid-Pass Gorge`},{id:`es-bg1`,x:1980,y:310,size:88,height:115,ridgeShift:-5,hasSnow:!0,layer:0,elevation:1650,rangeName:`Sunstone Highlands`},{id:`es-bg2`,x:2110,y:245,size:105,height:140,ridgeShift:6,hasSnow:!0,layer:0,elevation:1980,name:`Sun Pillar`,rangeName:`Sunstone Highlands`},{id:`es-bg3`,x:2260,y:160,size:135,height:180,ridgeShift:-8,hasSnow:!0,layer:0,elevation:2580,name:`Crown of the Heavens`,rangeName:`Sunstone Highlands`},{id:`es-bg4`,x:2410,y:210,size:115,height:150,ridgeShift:7,hasSnow:!0,layer:0,elevation:2240,rangeName:`Sunstone Highlands`},{id:`m19`,x:2040,y:375,size:98,height:128,ridgeShift:6,hasSnow:!0,elevation:1720,name:`Sunstone Spire`,rangeName:`Sunstone Highlands`},{id:`m20`,x:2170,y:315,size:115,height:150,ridgeShift:-7,hasSnow:!0,elevation:2080,name:`Sanctuary Peak`,rangeName:`Sunstone Highlands`},{id:`m21`,x:2310,y:220,size:130,height:170,ridgeShift:8,hasSnow:!0,elevation:2390,name:`Pinnacle of the Ancients`,rangeName:`Sunstone Highlands`},{id:`m22`,x:2440,y:360,size:90,height:115,ridgeShift:-5,hasSnow:!0,elevation:1610,name:`Falcon Perch`,rangeName:`Sunstone Highlands`},{id:`m23`,x:2260,y:405,size:82,height:98,ridgeShift:4,hasSnow:!1,elevation:1250,name:`Altar Crag`,rangeName:`Sunstone Highlands`},{id:`m24`,x:2380,y:420,size:76,height:88,ridgeShift:-3,hasSnow:!1,elevation:1120,rangeName:`Sunstone Highlands`},{id:`m25`,x:2140,y:450,size:70,height:80,ridgeShift:3,hasSnow:!1,elevation:980,rangeName:`Sunstone Highlands`}],H=[{id:`river-elden`,name:`River Elden`,d:`M 1340,290 C 1310,380 1260,460 1210,540 C 1140,640 1020,700 960,820 C 900,940 930,1060 880,1180 C 840,1280 760,1360 690,1480`,width:14,hasBridges:[{x:945,y:855,angle:-35},{x:890,y:1160,angle:25}]},{id:`river-silver`,name:`Silver Meander`,d:`M 580,410 C 650,490 730,550 780,660 C 830,760 910,810 960,820`,width:8,hasBridges:[{x:740,y:620,angle:45}]},{id:`river-cataract`,name:`Highland Torrent`,d:`M 2150,320 C 2100,450 2050,600 2020,760 C 1990,920 1920,1050 1840,1180 C 1760,1310 1710,1420 1660,1500`,width:11,hasBridges:[{x:2010,y:810,angle:-20}]}],U=[{id:`f1`,name:`The Whispering Pines`,cx:580,cy:1040,rx:230,ry:160,treeCount:42,trees:W(580,1040,210,140,42,`pines`)},{id:`f2`,name:`Elderwood Deep`,cx:820,cy:1140,rx:250,ry:180,treeCount:52,trees:W(820,1140,230,160,52,`oaks`)},{id:`f3`,name:`Mistwood Valley`,cx:860,cy:620,rx:190,ry:140,treeCount:36,trees:W(860,620,170,120,36,`willows`)},{id:`f4`,name:`Highland Spruces`,cx:1760,cy:740,rx:210,ry:155,treeCount:38,trees:W(1760,740,190,135,38,`highland_spruce`)},{id:`f5`,name:`Verdant Basin`,cx:1960,cy:980,rx:200,ry:150,treeCount:38,trees:W(1960,980,180,130,38,`mixed`)},{id:`f6`,name:`Shadowglen Copse`,cx:390,cy:690,rx:140,ry:100,treeCount:22,trees:W(390,690,120,80,22,`pines`)},{id:`f7`,name:`Sunstone Grove`,cx:2360,cy:580,rx:150,ry:110,treeCount:24,trees:W(2360,580,130,90,24,`mixed`)}];function W(e,t,n,r,i,a){let o=[];for(let s=0;s<i;s++){let c=s*2.399963+Math.sin(s*1.7)*.4,l=((s+.5)/i)**.65,u=Math.sin(s*4.3+e)*14,d=Math.cos(s*3.9+t)*12,f=Math.round(e+n*l*Math.cos(c)+u),p=Math.round(t+r*l*Math.sin(c)+d),m=.85+s%4*.1;s===0||s===5?m=1.35:s%7==0&&(m=.68);let h=`pine`;if(a===`pines`)h=s%6==0?`birch`:`pine`;else if(a===`oaks`)h=s===0||s===5?`ancient_oak`:s%5==0?`birch`:`oak`;else if(a===`willows`)h=s%3==0?`willow`:s%4==0?`birch`:`oak`;else if(a===`highland_spruce`)h=s%5==0?`pine`:`spruce`;else{let e=s%5;h=e===0?`ancient_oak`:e===1?`pine`:e===2?`oak`:e===3?`spruce`:`birch`}o.push({x:f,y:p,scale:m,type:h,seed:Math.round(e*7+t*11+s*31)})}return o}function G(e){if(e.length===0)return``;if(e.length===1)return`M ${e[0].x},${e[0].y}`;let t=`M ${e[0].x},${e[0].y}`;for(let n=0;n<e.length-1;n++){let r=e[n],i=e[n+1],a=(r.x+i.x)/2,o=(r.y+i.y)/2;if(n===0)t+=` Q ${r.x},${r.y} ${a},${o}`;else{let a=e[n-1],o=r.x+(i.x-a.x)*.18,s=r.y+(i.y-a.y)*.18;t+=` S ${o},${s} ${i.x},${i.y}`}}return t}function K(e,t){return t<=0||e.length===0?``:G(e.slice(0,t+1))}var de={parchment:{id:`parchment`,name:`Daylight Parchment`,bgClass:`parchment-bg`,textColor:`#2c221a`,pencilColor:`#382e25`,pencilShade:`#8c765c`,riverColor:`#96afbe`,glowColor:`#f59e0b`,glowSubtle:`#fbbf24`,nodeUnlit:`#f0e5ce`,nodeLit:`#fbbf24`,nodeLitStroke:`#ffffff`},dark_parchment:{id:`dark_parchment`,name:`Midnight Cartography`,bgClass:`parchment-dark-bg`,textColor:`#f3e9d2`,pencilColor:`#8a7761`,pencilShade:`#4a3f33`,riverColor:`#365163`,glowColor:`#fbbf24`,glowSubtle:`#f59e0b`,nodeUnlit:`#231e17`,nodeLit:`#f59e0b`,nodeLitStroke:`#fffbeb`}},q=new class{ctx=null;enabled=!0;initCtx(){if(!this.ctx&&typeof window<`u`){let e=window.AudioContext||window.webkitAudioContext;e&&(this.ctx=new e)}this.ctx&&this.ctx.state===`suspended`&&this.ctx.resume()}setEnabled(e){this.enabled=e,e&&this.initCtx()}isEnabled(){return this.enabled}playNodeLightUp(e,t=150){if(this.enabled&&(this.initCtx(),this.ctx))try{let n=this.ctx.currentTime,r=[261.63,293.66,329.63,392,440,523.25,587.33,659.25,783.99,880],i=Math.floor(e/Math.max(1,t)*20),a=1+Math.floor(i/r.length)*.5,o=r[i%r.length]*a,s=this.ctx.createOscillator(),c=this.ctx.createOscillator(),l=this.ctx.createGain();s.type=`sine`,s.frequency.setValueAtTime(o,n),c.type=`triangle`,c.frequency.setValueAtTime(o*2.01,n),l.gain.setValueAtTime(.001,n),l.gain.linearRampToValueAtTime(.12,n+.02),l.gain.exponentialRampToValueAtTime(1e-4,n+.55),s.connect(l),c.connect(l),l.connect(this.ctx.destination),s.start(n),c.start(n),s.stop(n+.6),c.stop(n+.6)}catch{}}playPencilScratch(){if(this.enabled&&(this.initCtx(),this.ctx))try{let e=this.ctx.currentTime,t=Math.floor(this.ctx.sampleRate*.06),n=this.ctx.createBuffer(1,t,this.ctx.sampleRate),r=n.getChannelData(0);for(let e=0;e<t;e++)r[e]=(Math.random()*2-1)*Math.exp(-e/(t*.4));let i=this.ctx.createBufferSource();i.buffer=n;let a=this.ctx.createBiquadFilter();a.type=`bandpass`,a.frequency.setValueAtTime(1400+Math.random()*800,e),a.Q.setValueAtTime(3.5,e);let o=this.ctx.createGain();o.gain.setValueAtTime(.04,e),o.gain.exponentialRampToValueAtTime(.001,e+.05),i.connect(a),a.connect(o),o.connect(this.ctx.destination),i.start(e)}catch{}}playVictoryChime(){this.enabled&&(this.initCtx(),this.ctx&&[523.25,659.25,783.99,1046.5].forEach((e,t)=>{setTimeout(()=>{if(!this.ctx)return;let t=this.ctx.currentTime,n=this.ctx.createOscillator(),r=this.ctx.createGain();n.type=`sine`,n.frequency.setValueAtTime(e,t),r.gain.setValueAtTime(.001,t),r.gain.linearRampToValueAtTime(.15,t+.05),r.gain.exponentialRampToValueAtTime(1e-4,t+1.2),n.connect(r),r.connect(this.ctx.destination),n.start(t),n.stop(t+1.3)},t*120)}))}},J=r();function Y(e){let t=Math.sin(e*12.9898+78.233)*43758.5453;return t-Math.floor(t)}var fe=({mountain:e,theme:t})=>{let n=t.id!==`parchment`,r=t.pencilColor,i=t.pencilShade,{id:a,x:o,y:s,size:c,height:l,ridgeShift:u=0,hasSnow:d=l>95}=e,f=(0,I.useMemo)(()=>{let e=0;for(let t=0;t<a.length;t++)e+=a.charCodeAt(t)*(t+1);e+=Math.round(o+s);let t=o+u,n=s-l,r=o-c,i=o+c,f=[{x:t,y:n}];for(let i=1;i<=6;i++){let a=i/6,o=t-(t-r)*a,s=n+l*a,u=(Y(e+i*17)-.48)*(c*.14)*Math.sin(a*Math.PI),d=Y(e+i*31)>.65?l*.04:0;f.push({x:Math.round(o+u),y:Math.round(s+d)})}let p=[];for(let r=1;r<=6;r++){let a=r/6,o=t+(i-t)*a,s=n+l*a,u=(Y(e+r*43)-.48)*(c*.14)*Math.sin(a*Math.PI),d=Y(e+r*59)>.65?l*.04:0;p.push({x:Math.round(o+u),y:Math.round(s+d)})}let m=[{x:t,y:n}];for(let r=1;r<=7;r++){let i=r/7,a=t+(o+u*.25+(Y(e+101)-.5)*(c*.15)-t)*i**1.2,s=n+l*i,d=Math.sin(i*Math.PI*2.2+Y(e+113))*(c*.1);m.push({x:Math.round(a+d),y:Math.round(s)})}let h=[],g=m[Math.min(m.length-1,2)];if(g){let t=o+c*.55+(Y(e+201)-.5)*15,n=s-l*.12,r=(g.x+t)/2+12,i=(g.y+n)/2-6;h.push({d:`M ${g.x},${g.y} Q ${r},${i} ${t},${n}`,side:`right`})}let _=m[Math.min(m.length-1,5)];if(_){let t=o+c*.85+(Y(e+209)-.5)*15,n=s,r=(_.x+t)/2+10,i=(_.y+n)/2-4;h.push({d:`M ${_.x},${_.y} Q ${r},${i} ${t},${n}`,side:`right`})}let v=m[Math.min(m.length-1,3)];if(v){let t=o-c*.6+(Y(e+301)-.5)*15,n=s-l*.15,r=(v.x+t)/2-10,i=(v.y+n)/2-5;h.push({d:`M ${v.x},${v.y} Q ${r},${i} ${t},${n}`,side:`left`})}let y=[],b=Math.max(14,Math.round(l/4.8));for(let r=1;r<=b;r++){let a=r/(b+1),o=m[Math.min(m.length-1,Math.max(0,Math.round(a*(m.length-1))))],s=n+l*a,c=p[Math.min(p.length-1,Math.max(0,Math.round(a*(p.length-1))))]||{x:t+(i-t)*a,y:s},u=o.x+(c.x-o.x)*.08,d=s+(Y(e+r*71)-.5)*3,f=r%3==0?.92:r%2==0?.75:.6,h=u+(c.x-u)*f,g=d+((s-n)*.22+(c.y-s)*.35)+(Y(e+r*83)-.5)*4;y.push({x1:Math.round(u),y1:Math.round(d),x2:Math.round(h),y2:Math.round(g),width:r<4?.9:1.25,opacity:r<3?.6:.85}),r>4&&r%2==0&&y.push({x1:Math.round(u+(h-u)*.3),y1:Math.round(d+(g-d)*.3),x2:Math.round(u+(h-u)*.75),y2:Math.round(d+(g-d)*.15),width:.75,opacity:.55})}let x=[],S=Math.max(4,Math.round(l/18));for(let i=1;i<=S;i++){let a=(i+.3)/(S+1),o=n+l*a,s=m[Math.min(m.length-1,Math.round(a*(m.length-1)))],c=f[Math.min(f.length-1,Math.round(a*(f.length-1)))]||{x:t-(t-r)*a,y:o},u=s.x-(s.x-c.x)*.25,d=o+2,p=s.x-(s.x-c.x)*(.6+Y(e+i*97)*.3),h=o+8+Y(e+i*103)*6,g=(u+p)/2-4,_=(d+h)/2+3;if(x.push({d:`M ${Math.round(u)},${Math.round(d)} Q ${Math.round(g)},${Math.round(_)} ${Math.round(p)},${Math.round(h)}`,width:.9}),i%2==1){let e=u-6,t=d+3;x.push({d:`M ${Math.round(e)},${Math.round(t)} L ${Math.round(e-8)},${Math.round(t+10)}`,width:.75})}}let C=``,w=``;if(d){let e=n+l*.32,a=t-(t-r)*.32,o=t+(i-t)*.32,s=m[Math.min(m.length-1,2)]||{x:t,y:e},c={x:t-(t-r)*.16,y:e-4},u={x:t-(t-r)*.26,y:e+6},d={x:t+(i-t)*.14,y:e+3},h={x:t+(i-t)*.24,y:e-2};C=`M ${t},${n}
|
| 2 |
L ${f[1].x},${f[1].y}
|
| 3 |
L ${a},${e}
|
| 4 |
Q ${u.x},${u.y} ${c.x},${c.y}
|
algospaced-ui/dist/assets/{PrincessChamber-B9Z3_h5D.js → PrincessChamber-Cu4RP8Ry.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{a as e,c as t,s as n,t as r}from"./jsx-runtime-j9uSgrFF.js";import{C as i,E as a,H as o,L as s,M as c,O as l,P as u,S as d,T as f,U as p,_ as m,b as h,g,h as _,k as v,v as y,w as b,x,y as S}from"./index-C7Gd5Mn4.js";var C=p(`castle`,[[`path`,{d:`M10 5V3`,key:`1y54qe`}],[`path`,{d:`M14 5V3`,key:`m6isi`}],[`path`,{d:`M15 21v-3a3 3 0 0 0-6 0v3`,key:`lbp5hj`}],[`path`,{d:`M18 3v8`,key:`2ollhf`}],[`path`,{d:`M18 5H6`,key:`98imr9`}],[`path`,{d:`M22 11H2`,key:`1lmjae`}],[`path`,{d:`M22 9v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9`,key:`1rly83`}],[`path`,{d:`M6 3v8`,key:`csox7g`}]]),w=p(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),T=p(`rotate-ccw-clock`,[[`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`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),E=p(`scroll`,[[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),D=p(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),O=p(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),k=t(e(),1),A={1:{particleType:`pollen`,particleCount:16,particleColors:[`#FDE047`,`#FEF08A`,`#86EFAC`],gradientBg:`from-[#FFFDF0] via-[#FFF9E6] to-[#FEF3C7]`,glowColor:`rgba(251, 191, 36, 0.3)`,badgeLabel:`🌾 Plains Breeze`},2:{particleType:`leaves`,particleCount:18,particleColors:[`#86EFAC`,`#4ADE80`,`#22C55E`,`#A7F3D0`],gradientBg:`from-[#F0FDF4] via-[#DCFCE7] to-[#FEF9C3]`,glowColor:`rgba(34, 197, 94, 0.3)`,badgeLabel:`🍃 Whispering Leaves`},3:{particleType:`spores`,particleCount:22,particleColors:[`#67E8F9`,`#38BDF8`,`#818CF8`,`#C084FC`],gradientBg:`from-[#F0F9FF] via-[#E0F2FE] to-[#EDE9FE]`,glowColor:`rgba(56, 189, 248, 0.35)`,badgeLabel:`✨ Crystal Spores`},4:{particleType:`snow`,particleCount:28,particleColors:[`#FFFFFF`,`#E0F2FE`,`#BAE6FD`],gradientBg:`from-[#F8FAFC] via-[#F1F5F9] to-[#E2E8F0]`,glowColor:`rgba(186, 230, 253, 0.4)`,badgeLabel:`❄️ Alpine Snowfall`},5:{particleType:`runes`,particleCount:20,particleColors:[`#E879F9`,`#C084FC`,`#A855F7`,`#F472B6`],gradientBg:`from-[#FAF5FF] via-[#F3E8FF] to-[#FCE7F3]`,glowColor:`rgba(192, 132, 252, 0.4)`,badgeLabel:`🔮 Arcane Runes`},6:{particleType:`stardust`,particleCount:35,particleColors:[`#FDE047`,`#F59E0B`,`#E11D48`,`#818CF8`],gradientBg:`from-[#FFFBEB] via-[#FEF3C7] to-[#FFE4E6]`,glowColor:`rgba(245, 158, 11, 0.5)`,badgeLabel:`👑 Spire Gates`}};function j(e){return e<=30?A[1]:e<=60?A[2]:e<=90?A[3]:e<=120?A[4]:e<150?A[5]:A[6]}var M=r();function N({emotion:e,floor:t,rhythm:n,activity:r,isLoading:i=!1}){let a=y[e]||y.smiling_warmly,o=(0,k.useMemo)(()=>j(t),[t]),s=(0,k.useMemo)(()=>{switch(n){case`dawn`:return`from-amber-400/40 via-yellow-300/30 to-rose-300/20`;case`dusk`:return`from-orange-400/40 via-purple-400/30 to-amber-300/20`;case`night`:return`from-indigo-600/40 via-blue-500/30 to-amber-500/20`;default:return`from-amber-400/30 via-yellow-300/40 to-indigo-400/30`}},[n]);return(0,M.jsxs)(`div`,{className:`relative flex flex-col items-center justify-center my-auto w-full max-w-xl`,children:[(0,M.jsx)(`div`,{className:`absolute -inset-10 overflow-hidden pointer-events-none z-0`,children:Array.from({length:Math.min(18,o.particleCount)}).map((e,t)=>{let n=o.particleColors[t%o.particleColors.length],r=`${t*19%100}%`,i=`${6+t%5*2}s`,a=`${t*.7%4}s`,s=o.particleType===`leaves`||o.particleType===`runes`?`w-2.5 h-2.5`:`w-1.5 h-1.5`;return(0,M.jsx)(`span`,{className:`absolute rounded-full opacity-65 animate-pulse ${s}`,style:{backgroundColor:n,left:r,top:`${t*23%90}%`,boxShadow:`0 0 8px ${n}`,animationDuration:i,animationDelay:a}},t)})}),(0,M.jsxs)(`div`,{className:`relative group z-10`,children:[(0,M.jsx)(`div`,{className:`absolute -inset-2 bg-gradient-to-r ${s} rounded-2xl blur-md opacity-80 group-hover:opacity-100 transition duration-500`}),(0,M.jsxs)(`div`,{className:`relative w-36 h-44 sm:w-44 sm:h-52 bg-gradient-to-b from-amber-100 to-amber-200 border-[3px] border-ink-black rounded-xl overflow-hidden shadow-[4px_4px_0px_0px_#1E293B] transition-transform duration-300 flex items-center justify-center`,children:[(0,M.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center text-amber-700/40 pointer-events-none select-none`,children:[(0,M.jsx)(v,{className:`w-8 h-8 animate-pulse`}),(0,M.jsx)(`span`,{className:`font-arcade text-[10px] mt-2`,children:`Princess Aurelia`})]}),(0,M.jsx)(`img`,{src:a.imagePath,alt:a.label,loading:`eager`,className:`w-full h-full object-cover object-top transition-all duration-300 relative z-10 ${i?`scale-105 filter saturate-125`:`scale-100`}`,onError:e=>{let t=e.currentTarget;t.src.endsWith(`/sprites/princess/neutral.png`)?t.style.display=`none`:t.src=`/sprites/princess/neutral.png`}}),(0,M.jsxs)(`div`,{className:`absolute bottom-0 inset-x-0 bg-ink-black/85 backdrop-blur-xs text-[10px] text-amber-300 py-1 px-2 font-bold uppercase tracking-wider text-center flex items-center justify-center gap-1.5`,children:[(0,M.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full ${i?`bg-amber-400 animate-ping`:`bg-emerald-400`}`}),(0,M.jsx)(`span`,{children:i?`Pondering...`:a.label})]})]}),(0,M.jsx)(`div`,{className:`absolute -top-2 -right-2 bg-[#FFE24C] border-[2px] border-ink-black rounded-full p-1 shadow-[2px_2px_0px_0px_#1E293B]`,children:(0,M.jsx)(v,{className:`w-3.5 h-3.5 text-amber-800`})})]}),r&&(0,M.jsx)(`div`,{className:`mt-2 text-center max-w-sm px-2`,children:(0,M.jsxs)(`span`,{className:`text-[10px] font-semibold text-slate-700 bg-white/85 px-2.5 py-0.5 rounded-full border border-ink-black/20 shadow-xs inline-flex items-center gap-1`,children:[(0,M.jsx)(`span`,{children:`🏰`}),(0,M.jsx)(`span`,{className:`truncate`,children:r})]})})]})}function P({text:e,characterName:t,emotion:n,isLoading:r=!1,isStreaming:i=!1,toolCalls:a,onTypingStatusChange:o}){let[s,c]=(0,k.useState)(e),[l,u]=(0,k.useState)(!1),d=(0,k.useRef)(null),f=(0,k.useRef)(e),p=(0,k.useRef)(0),m=(0,k.useRef)(o);(0,k.useEffect)(()=>{m.current=o},[o]);let h=y[n]||y.smiling_warmly,_=e=>{u(e),m.current?.(e)};return(0,k.useEffect)(()=>{if(i){d.current&&clearInterval(d.current),c(e),_(!0),e.length-p.current>=4&&(p.current=e.length,g(e.length)),f.current=e;return}if(e!==f.current&&!r){let t=f.current.length>0&&e.startsWith(f.current);if(f.current=e,d.current&&clearInterval(d.current),t)c(e),_(!1);else{c(``),_(!0);let t=0;d.current=setInterval(()=>{t<e.length?(t++,c(e.slice(0,t)),t%2==0&&e[t-1]!==` `&&g(t)):(d.current&&clearInterval(d.current),_(!1))},22)}}else!r&&e===f.current&&!i&&(c(e),l&&_(!1));return()=>{d.current&&clearInterval(d.current)}},[e,r,i]),(0,M.jsxs)(`div`,{onClick:()=>{l&&(d.current&&clearInterval(d.current),c(e),_(!1))},className:`w-full max-w-xl mt-3 sm:mt-4 relative bg-white border-[3px] border-ink-black rounded-xl p-3.5 sm:p-4 shadow-[4px_4px_0px_0px_#1E293B] transition-all cursor-pointer group select-text`,children:[(0,M.jsx)(`div`,{className:`absolute -top-3 left-1/2 -translate-x-1/2 w-0 h-0 border-x-8 border-x-transparent border-b-8 border-b-ink-black pointer-events-none`}),(0,M.jsx)(`div`,{className:`absolute -top-2 left-1/2 -translate-x-1/2 w-0 h-0 border-x-6 border-x-transparent border-b-6 border-b-white pointer-events-none`}),(0,M.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-amber-100 pb-1.5 mb-2 select-none`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,M.jsxs)(`span`,{className:`font-headline-md font-bold text-xs text-amber-900 flex items-center gap-1`,children:[`👑 `,t||`Princess Aurelia`]}),(0,M.jsx)(`span`,{className:`text-[9px] bg-amber-100 text-amber-800 font-bold px-1.5 py-0.2 rounded border border-amber-200`,children:h.label})]}),l&&(0,M.jsx)(`span`,{className:`text-[9px] text-trash-gray font-medium animate-pulse`,children:`Click bubble to skip`})]}),r?(0,M.jsxs)(`div`,{className:`flex items-center gap-2 py-2 text-xs font-medium text-trash-gray select-none`,children:[(0,M.jsx)(`span`,{className:`inline-block w-2 h-2 bg-amber-500 rounded-full animate-bounce`}),(0,M.jsx)(`span`,{className:`inline-block w-2 h-2 bg-amber-500 rounded-full animate-bounce [animation-delay:0.2s]`}),(0,M.jsx)(`span`,{className:`inline-block w-2 h-2 bg-amber-500 rounded-full animate-bounce [animation-delay:0.4s]`}),(0,M.jsxs)(`span`,{className:`ml-1 text-slate-600`,children:[t||`Princess Aurelia`,` is attuning the crystal relay...`]})]}):(0,M.jsxs)(`div`,{className:`text-xs sm:text-[13px] text-ink-black font-medium leading-relaxed whitespace-pre-wrap`,children:[(e=>e.split(/(\*[^*]+\*)/g).map((e,t)=>e.startsWith(`*`)&&e.endsWith(`*`)?(0,M.jsx)(`span`,{className:`text-amber-700 italic font-semibold mr-1 inline-block`,children:e},t):(0,M.jsx)(`span`,{children:e},t)))(s),l&&(0,M.jsx)(`span`,{className:`inline-block w-1.5 h-3.5 bg-amber-500 ml-1 animate-pulse align-middle`})]}),a&&a.length>0&&!r&&(0,M.jsx)(`div`,{className:`mt-2.5 pt-2 border-t border-amber-100/80 flex flex-wrap gap-1.5 select-none`,children:a.map((e,t)=>{let n=`✨ Enchantment: ${e.name}`;return e.name===`open_app_window`&&(n=`📜 Summoned: ${e.args?.window_id||`Grimoire`}`),e.name===`set_study_timer`&&(n=`⏳ Hourglass: ${e.args?.minutes||15}m rest`),e.name===`play_ambient_sound`&&(n=`🔥 Kindled: ${e.args?.soundscape||`Soundscape`}`),e.name===`write_spire_diary`&&(n=`📖 Chronicled in Spire Diary`),(0,M.jsx)(`span`,{className:`px-2 py-0.5 rounded-full bg-indigo-50 border border-indigo-200 text-[10px] font-bold text-indigo-800 flex items-center gap-1 shadow-xs`,children:(0,M.jsx)(`span`,{children:n})},t)})})]})}var F=[{label:`💪 Solved a Tough One`,prompt:`I just solved a really tough problem! Felt so good getting all test cases to pass.`},{label:`😩 Feeling Stuck`,prompt:`I feel really stuck and discouraged today. It feels like everyone else gets this except me.`},{label:`☕ Need a Breather`,prompt:`My brain is pretty fried from practicing today. Can we just take a short breather?`},{label:`🌙 Life Beyond the Tower`,prompt:`What’s the first thing you want to do once we break the seals and get you out of that tower?`}];function I({suggestions:e,isLoading:t=!1,onSendMessage:n,placeholder:r=`Speak with Princess Aurelia...`}){let[i,a]=(0,k.useState)(``),o=()=>{let e=i.trim();e&&!t&&(n(e),a(``))},s=e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),o())},c=Array.isArray(e)&&e.length>0;return(0,M.jsxs)(`div`,{className:`w-full flex flex-col items-center gap-2 select-none z-10`,children:[(0,M.jsx)(`div`,{className:`w-full max-w-xl flex items-center justify-center gap-1.5 flex-wrap py-1.5 px-2`,children:c?e.map((e,r)=>(0,M.jsxs)(`button`,{type:`button`,onClick:()=>n(e),disabled:t,className:`px-2.5 py-1 bg-white hover:bg-amber-100 disabled:opacity-50 border-[1.5px] border-ink-black rounded-full text-[10px] sm:text-[11px] font-bold text-slate-800 cursor-pointer shadow-[1px_1px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none transition-all flex items-center gap-1`,children:[(0,M.jsx)(v,{className:`w-3 h-3 text-amber-600 shrink-0`}),(0,M.jsx)(`span`,{className:`truncate max-w-[200px]`,children:e})]},r)):F.map((e,r)=>(0,M.jsx)(`button`,{type:`button`,onClick:()=>n(e.prompt),disabled:t,className:`px-2.5 py-1 bg-white hover:bg-amber-100 disabled:opacity-50 border-[1.5px] border-ink-black rounded-full text-[10px] sm:text-[11px] font-bold text-slate-800 cursor-pointer shadow-[1px_1px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none transition-all`,children:e.label},r))}),(0,M.jsxs)(`div`,{className:`w-full bg-white border-t-[3px] border-ink-black p-3 sm:px-4 flex items-center gap-2 shrink-0`,children:[(0,M.jsx)(`input`,{type:`text`,value:i,onChange:e=>a(e.target.value),onKeyDown:s,disabled:t,placeholder:r,className:`flex-1 bg-[#FFFDF0] border-[2px] border-ink-black rounded-lg px-3.5 py-2 text-xs sm:text-sm font-medium text-ink-black placeholder-slate-400 focus:outline-none focus:border-amber-500 shadow-inner disabled:opacity-50`}),(0,M.jsxs)(`button`,{type:`button`,onClick:o,disabled:t||!i.trim(),className:`px-4 sm:px-5 py-2 bg-[#FFE24C] hover:bg-yellow-300 disabled:opacity-50 border-[2px] border-ink-black rounded-lg font-bold text-xs sm:text-sm text-ink-black shadow-[2px_2px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none transition-all cursor-pointer flex items-center gap-1.5 shrink-0`,children:[(0,M.jsx)(D,{className:`w-3.5 h-3.5`}),(0,M.jsx)(`span`,{children:`Send`})]})]})]})}function L({currentFloor:e,onClose:t}){let n=d(e),r=Math.min(100,Math.round(e/150*100));return(0,M.jsx)(`div`,{className:`absolute inset-0 z-50 bg-ink-black/40 backdrop-blur-xs flex items-center justify-center p-3 sm:p-4 animate-in fade-in duration-200 select-none`,onClick:t,children:(0,M.jsxs)(`div`,{className:`bg-[#FFFDF0] border-[3px] border-ink-black rounded-xl p-4 sm:p-5 max-w-md w-full shadow-[6px_6px_0px_0px_#1E293B] flex flex-col gap-3.5`,onClick:e=>e.stopPropagation(),children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between border-b-[2px] border-ink-black pb-2`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,M.jsx)(C,{className:`w-5 h-5 text-indigo-600`}),(0,M.jsx)(`h4`,{className:`font-headline-md font-bold text-sm text-ink-black m-0`,children:`Journey to the Big-O Spire`})]}),(0,M.jsx)(`button`,{type:`button`,onClick:t,className:`p-1 hover:bg-slate-200 rounded text-slate-700 cursor-pointer`,title:`Close`,children:(0,M.jsx)(b,{className:`w-4 h-4`})})]}),(0,M.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between text-xs font-bold font-headline-md`,children:[(0,M.jsx)(`span`,{children:`Path Progress:`}),(0,M.jsxs)(`span`,{className:`font-arcade bg-indigo-100 text-indigo-900 px-2 py-0.5 rounded border border-indigo-300`,children:[e,` / 150 Leagues`]})]}),(0,M.jsx)(`div`,{className:`w-full bg-slate-200 h-4 border-[2px] border-ink-black rounded-full overflow-hidden p-0.5`,children:(0,M.jsx)(`div`,{className:`bg-gradient-to-r from-amber-400 via-yellow-400 to-emerald-400 h-full rounded-full transition-all duration-500`,style:{width:`${r}%`}})}),(0,M.jsxs)(`div`,{className:`flex items-center justify-between text-[11px] text-trash-gray font-medium`,children:[(0,M.jsxs)(`span`,{children:[`Progress: `,(0,M.jsxs)(`strong`,{children:[r,`%`]})]}),(0,M.jsxs)(`span`,{children:[`Distance to Tower: `,(0,M.jsxs)(`strong`,{children:[Math.max(0,150-e),` leagues`]})]})]})]}),(0,M.jsxs)(`div`,{className:`bg-white border-[2px] border-ink-black rounded-lg p-3 shadow-[2px_2px_0px_0px_#1E293B] flex flex-col gap-1`,children:[(0,M.jsx)(`div`,{className:`text-[10px] font-bold uppercase text-amber-700 tracking-wider`,children:`Current Realm:`}),(0,M.jsx)(`div`,{className:`font-bold text-xs text-ink-black`,children:n.title}),(0,M.jsx)(`p`,{className:`text-[11px] text-slate-600 m-0 leading-relaxed font-medium`,children:n.description}),(0,M.jsxs)(`div`,{className:`text-[10px] text-amber-900 bg-amber-50 p-1.5 rounded border border-amber-200 italic mt-1`,children:[`📜 `,n.bgLore]})]}),(0,M.jsx)(`div`,{className:`flex items-center justify-between gap-1 text-center`,children:[{floor:30,label:`Arrays`},{floor:60,label:`Pointers`},{floor:90,label:`Trees`},{floor:120,label:`Heaps`},{floor:150,label:`Spire`}].map(t=>{let n=e>=t.floor;return(0,M.jsxs)(`div`,{className:`flex-1 p-1.5 rounded border text-[10px] flex flex-col items-center ${n?`bg-emerald-100 border-emerald-600 text-emerald-900 font-bold`:`bg-slate-100 border-slate-300 text-slate-500`}`,children:[(0,M.jsx)(`span`,{children:n?`✓`:t.floor}),(0,M.jsx)(`span`,{className:`text-[9px] truncate w-full`,children:t.label})]},t.floor)})}),(0,M.jsx)(`div`,{className:`flex items-center justify-end border-t border-slate-200 pt-2 mt-1`,children:(0,M.jsx)(`button`,{type:`button`,onClick:t,className:`px-4 py-1.5 bg-white hover:bg-slate-100 border-[1.5px] border-ink-black rounded font-bold text-xs text-ink-black cursor-pointer shadow-xs active:translate-y-0.5`,children:`Done`})})]})})}function R({unlockedLetters:e,spireChronicles:t,currentFloor:n,heroCodex:r,episodicEvents:a,recentToolTelemetry:c,onRemoveCodexItem:d,onClose:f}){let[p,m]=(0,k.useState)(`letters`),[h,g]=(0,k.useState)(e[e.length-1]||null);return(0,M.jsx)(`div`,{className:`absolute inset-0 z-50 bg-ink-black/50 backdrop-blur-xs flex items-center justify-center p-3 sm:p-4 animate-in fade-in duration-200 select-none`,onClick:f,children:(0,M.jsxs)(`div`,{className:`bg-[#FFFDF0] border-[3px] border-ink-black rounded-xl max-w-lg w-full h-[85%] max-h-[560px] shadow-[6px_6px_0px_0px_#1E293B] flex flex-col overflow-hidden`,onClick:e=>e.stopPropagation(),children:[(0,M.jsxs)(`div`,{className:`bg-white border-b-[2px] border-ink-black px-4 py-2.5 flex items-center justify-between shrink-0`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,M.jsx)(E,{className:`w-5 h-5 text-amber-700`}),(0,M.jsx)(`h4`,{className:`font-headline-md font-bold text-sm text-ink-black m-0`,children:`The Royal Satchel`})]}),(0,M.jsx)(`button`,{type:`button`,onClick:f,className:`p-1 hover:bg-slate-200 rounded text-slate-700 cursor-pointer`,title:`Close`,children:(0,M.jsx)(b,{className:`w-4 h-4`})})]}),(0,M.jsxs)(`div`,{className:`flex border-b-2 border-ink-black bg-amber-100/70 shrink-0`,children:[(0,M.jsxs)(`button`,{type:`button`,onClick:()=>m(`letters`),className:`flex-1 py-2 text-xs font-bold font-headline-md flex items-center justify-center gap-1.5 transition-colors cursor-pointer border-r border-ink-black/20 ${p===`letters`?`bg-[#FFFDF0] text-amber-950 border-b-2 border-b-[#FFFDF0] -mb-[2px]`:`text-slate-600 hover:bg-amber-200/50`}`,children:[(0,M.jsx)(E,{className:`w-3.5 h-3.5`}),(0,M.jsxs)(`span`,{children:[`Missives (`,e.length,`/5)`]})]}),(0,M.jsxs)(`button`,{type:`button`,onClick:()=>m(`diary`),className:`flex-1 py-2 text-xs font-bold font-headline-md flex items-center justify-center gap-1.5 transition-colors cursor-pointer border-r border-ink-black/20 ${p===`diary`?`bg-[#FFFDF0] text-amber-950 border-b-2 border-b-[#FFFDF0] -mb-[2px]`:`text-slate-600 hover:bg-amber-200/50`}`,children:[(0,M.jsx)(o,{className:`w-3.5 h-3.5`}),(0,M.jsxs)(`span`,{children:[`Chronicles (`,t.length,`)`]})]}),(0,M.jsxs)(`button`,{type:`button`,onClick:()=>m(`codex`),className:`flex-1 py-2 text-xs font-bold font-headline-md flex items-center justify-center gap-1.5 transition-colors cursor-pointer ${p===`codex`?`bg-[#FFFDF0] text-amber-950 border-b-2 border-b-[#FFFDF0] -mb-[2px]`:`text-slate-600 hover:bg-amber-200/50`}`,children:[(0,M.jsx)(v,{className:`w-3.5 h-3.5 text-amber-700`}),(0,M.jsx)(`span`,{children:`Codex`})]})]}),(0,M.jsxs)(`div`,{className:`flex-1 p-3 sm:p-4 overflow-y-auto custom-scrollbar flex flex-col gap-3 min-h-0`,children:[p===`letters`&&(0,M.jsxs)(`div`,{className:`flex flex-col gap-3 flex-1`,children:[(0,M.jsx)(`div`,{className:`flex items-center gap-1.5 overflow-x-auto pb-1`,children:[30,60,90,120,150].map(e=>{let t=x[e],r=n>=e,i=h?.floor===e;return(0,M.jsxs)(`button`,{type:`button`,disabled:!r,onClick:()=>r&&g(t),className:`px-3 py-1 rounded-full text-[11px] font-bold border-[1.5px] border-ink-black flex items-center gap-1 shrink-0 transition-all cursor-pointer ${r?i?`bg-[#FFE24C] text-ink-black shadow-[1.5px_1.5px_0px_0px_#1E293B]`:`bg-white hover:bg-amber-100 text-slate-800`:`opacity-40 bg-slate-200 text-slate-500 cursor-not-allowed`}`,children:[r?(0,M.jsx)(`span`,{children:`📜`}):(0,M.jsx)(u,{className:`w-3 h-3`}),(0,M.jsxs)(`span`,{children:[`League `,e]})]},e)})}),h?(0,M.jsxs)(`div`,{className:`bg-[#FFF9E6] border-[2px] border-amber-900/40 rounded-lg p-4 shadow-sm flex-1 overflow-y-auto custom-scrollbar flex flex-col select-text`,children:[(0,M.jsxs)(`div`,{className:`border-b border-amber-800/20 pb-2 mb-3 flex items-center justify-between`,children:[(0,M.jsxs)(`div`,{children:[(0,M.jsxs)(`div`,{className:`text-[10px] font-bold text-amber-800 uppercase tracking-wider`,children:[h.chapterTitle,` • League `,h.floor]}),(0,M.jsx)(`h5`,{className:`font-headline-md font-bold text-sm text-amber-950 m-0`,children:h.title})]}),(0,M.jsx)(`span`,{className:`text-xl`,children:`🪶`})]}),(0,M.jsx)(`p`,{className:`text-xs sm:text-[13px] text-amber-950 font-serif leading-relaxed whitespace-pre-wrap flex-1 italic`,children:h.letterText})]}):(0,M.jsxs)(`div`,{className:`flex-1 flex flex-col items-center justify-center text-center p-6 text-slate-500`,children:[(0,M.jsx)(u,{className:`w-8 h-8 mb-2 text-slate-400`}),(0,M.jsx)(`p`,{className:`text-xs font-medium`,children:`Conquer 30 LeetCode problems along the path to receive your first Royal Missive from Aurelia.`})]})]}),p===`diary`&&(0,M.jsx)(`div`,{className:`flex flex-col gap-2.5 flex-1`,children:t.length>0?t.map(e=>(0,M.jsxs)(`div`,{className:`p-3 bg-white border-[1.5px] border-ink-black rounded-lg shadow-xs flex flex-col gap-1 select-text`,children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between text-[10px] text-amber-800 font-bold border-b border-slate-100 pb-1`,children:[(0,M.jsxs)(`span`,{children:[`League `,e.floor,` along the Path`]}),(0,M.jsx)(`span`,{children:new Date(e.timestamp).toLocaleDateString()})]}),(0,M.jsxs)(`p`,{className:`text-xs text-ink-black font-medium leading-relaxed m-0 italic font-serif`,children:[`“`,e.text,`”`]})]},e.id)):(0,M.jsxs)(`div`,{className:`flex-1 flex flex-col items-center justify-center text-center p-6 text-slate-500`,children:[(0,M.jsx)(o,{className:`w-8 h-8 mb-2 text-slate-400`}),(0,M.jsx)(`p`,{className:`text-xs font-medium`,children:`Aurelia records entries in her Spire Chronicles autonomously as you chat, rest, and cross chapter milestones.`})]})}),p===`codex`&&(0,M.jsxs)(`div`,{className:`flex flex-col gap-3 flex-1 select-text`,children:[(0,M.jsxs)(`div`,{className:`bg-white border-[1.5px] border-ink-black rounded-lg p-3 shadow-xs flex flex-col gap-2`,children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between border-b border-slate-100 pb-1.5`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,M.jsx)(v,{className:`w-4 h-4 text-amber-600`}),(0,M.jsx)(`h5`,{className:`font-headline-md font-bold text-xs text-ink-black m-0`,children:`Hero Codex (MemGPT & Mem0 Core Memory)`})]}),(0,M.jsx)(`span`,{className:`text-[10px] text-slate-400 font-mono`,children:`Cognitive Sync`})]}),(0,M.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-2 text-xs`,children:[(0,M.jsxs)(`div`,{className:`bg-[#FFFDF0] border border-amber-900/20 rounded p-2`,children:[(0,M.jsx)(`span`,{className:`text-[10px] font-bold text-slate-500 uppercase tracking-wider block`,children:`Hero Alias`}),(0,M.jsx)(`span`,{className:`font-bold text-ink-black text-xs`,children:r?.heroName||`Champion`})]}),(0,M.jsxs)(`div`,{className:`bg-[#FFFDF0] border border-amber-900/20 rounded p-2`,children:[(0,M.jsx)(`span`,{className:`text-[10px] font-bold text-slate-500 uppercase tracking-wider block`,children:`Target Goal`}),(0,M.jsx)(`span`,{className:`font-bold text-amber-900 text-xs`,children:r?.targetGoal||`None shared yet (mention to Aurelia!)`})]})]}),r?.preferredLanguage&&(0,M.jsxs)(`div`,{className:`bg-[#FFFDF0] border border-amber-900/20 rounded p-2 text-xs`,children:[(0,M.jsx)(`span`,{className:`text-[10px] font-bold text-slate-500 uppercase tracking-wider block`,children:`Weapon of Choice (Language)`}),(0,M.jsx)(`span`,{className:`font-bold text-ink-black`,children:r.preferredLanguage})]})]}),(0,M.jsxs)(`div`,{className:`bg-white border-[1.5px] border-ink-black rounded-lg p-3 shadow-xs flex flex-col gap-2`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-bold text-emerald-800`,children:[(0,M.jsx)(s,{className:`w-3.5 h-3.5`}),(0,M.jsxs)(`span`,{children:[`Mastered Patterns (`,r?.strengths?.length||0,`)`]})]}),r?.strengths&&r.strengths.length>0?(0,M.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:r.strengths.map(e=>(0,M.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2.5 py-0.5 rounded-full text-[11px] font-bold bg-emerald-50 text-emerald-800 border border-emerald-300`,children:[e,d&&(0,M.jsx)(`button`,{type:`button`,onClick:()=>d(`strengths`,e),className:`hover:text-red-600 ml-0.5 cursor-pointer`,title:`Forget strength`,children:(0,M.jsx)(b,{className:`w-3 h-3`})})]},e))}):(0,M.jsx)(`p`,{className:`text-[11px] text-slate-400 italic m-0`,children:`Aurelia will note topics you conquer during your practice.`})]}),(0,M.jsxs)(`div`,{className:`bg-white border-[1.5px] border-ink-black rounded-lg p-3 shadow-xs flex flex-col gap-2`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-bold text-rose-800`,children:[(0,M.jsx)(O,{className:`w-3.5 h-3.5`}),(0,M.jsxs)(`span`,{children:[`Nemesis Patterns (`,r?.nemesisPatterns?.length||0,`)`]})]}),r?.nemesisPatterns&&r.nemesisPatterns.length>0?(0,M.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:r.nemesisPatterns.map(e=>(0,M.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2.5 py-0.5 rounded-full text-[11px] font-bold bg-rose-50 text-rose-800 border border-rose-300`,children:[e,d&&(0,M.jsx)(`button`,{type:`button`,onClick:()=>d(`nemesisPatterns`,e),className:`hover:text-red-700 ml-0.5 cursor-pointer`,title:`Forget nemesis`,children:(0,M.jsx)(b,{className:`w-3 h-3`})})]},e))}):(0,M.jsx)(`p`,{className:`text-[11px] text-slate-400 italic m-0`,children:`Aurelia tracks patterns that give you trouble to help you prepare targeted drills.`})]}),(0,M.jsxs)(`div`,{className:`bg-white border-[1.5px] border-ink-black rounded-lg p-3 shadow-xs flex flex-col gap-2`,children:[(0,M.jsx)(`div`,{className:`text-xs font-bold text-slate-800`,children:(0,M.jsxs)(`span`,{children:[`Personal Notes & Shared Lore (`,r?.personalNotes?.length||0,`)`]})}),r?.personalNotes&&r.personalNotes.length>0?(0,M.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:r.personalNotes.map(e=>(0,M.jsxs)(`div`,{className:`flex items-start justify-between gap-2 p-2 bg-slate-50 border border-slate-200 rounded text-[11px] text-slate-700`,children:[(0,M.jsxs)(`span`,{children:[`• `,e]}),d&&(0,M.jsx)(`button`,{type:`button`,onClick:()=>d(`personalNotes`,e),className:`text-slate-400 hover:text-red-600 shrink-0 cursor-pointer p-0.5`,title:`Forget note`,children:(0,M.jsx)(l,{className:`w-3 h-3`})})]},e))}):(0,M.jsx)(`p`,{className:`text-[11px] text-slate-400 italic m-0`,children:`Share your background or routine with Aurelia and she will hold it in her memory.`})]}),a&&a.length>0&&(0,M.jsxs)(`div`,{className:`bg-white border-[1.5px] border-ink-black rounded-lg p-3 shadow-xs flex flex-col gap-2`,children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between border-b border-slate-100 pb-1`,children:[(0,M.jsx)(`span`,{className:`text-xs font-bold text-slate-800`,children:`Episodic Memory Chain (EM-LLM)`}),(0,M.jsxs)(`span`,{className:`text-[10px] text-slate-400 font-mono`,children:[a.length,` events`]})]}),(0,M.jsx)(`div`,{className:`flex flex-col gap-2 max-h-40 overflow-y-auto custom-scrollbar`,children:a.slice(0,8).map(e=>(0,M.jsxs)(`div`,{className:`text-[11px] p-2 bg-[#FFFDF0] border border-amber-900/15 rounded flex flex-col gap-0.5`,children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,M.jsx)(`span`,{className:`font-bold text-ink-black uppercase text-[9px] px-1.5 py-0.5 bg-amber-200/60 rounded`,children:e.eventType.replace(`_`,` `)}),(0,M.jsx)(`span`,{className:`text-[10px] text-slate-400`,children:new Date(e.timestamp).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})})]}),(0,M.jsx)(`div`,{className:`font-bold text-slate-800 mt-0.5`,children:e.title}),(0,M.jsx)(`div`,{className:`text-slate-600 text-[10px]`,children:e.description})]},e.id))})]}),(0,M.jsxs)(`div`,{className:`bg-white border-[1.5px] border-ink-black rounded-lg p-3 shadow-xs flex flex-col gap-2`,children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between border-b border-slate-100 pb-1`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-bold text-indigo-900`,children:[(0,M.jsx)(i,{className:`w-3.5 h-3.5 text-amber-500`}),(0,M.jsx)(`span`,{children:`Autonomous Enchantment Telemetry`})]}),(0,M.jsxs)(`span`,{className:`text-[10px] text-slate-400 font-mono`,children:[c?.length||0,` executed`]})]}),c&&c.length>0?(0,M.jsx)(`div`,{className:`flex flex-col gap-1.5 max-h-36 overflow-y-auto custom-scrollbar`,children:c.slice(0,10).map((e,t)=>(0,M.jsxs)(`div`,{className:`text-[11px] p-2 bg-indigo-50/50 border border-indigo-100 rounded flex items-center justify-between gap-2`,children:[(0,M.jsxs)(`div`,{className:`flex flex-col min-w-0`,children:[(0,M.jsxs)(`span`,{className:`font-bold text-indigo-950 font-mono text-[10px] truncate`,children:[e.tool_name,`()`]}),e.args&&Object.keys(e.args).length>0&&(0,M.jsx)(`span`,{className:`text-[9px] text-slate-500 truncate`,children:JSON.stringify(e.args).slice(0,50)})]}),(0,M.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[e.execution_time_ms!==void 0&&(0,M.jsxs)(`span`,{className:`text-[9px] text-slate-400 flex items-center gap-0.5 font-mono`,children:[(0,M.jsx)(w,{className:`w-2.5 h-2.5`}),e.execution_time_ms,`ms`]}),(0,M.jsx)(`span`,{className:`px-1.5 py-0.2 text-[9px] font-bold rounded ${e.success?`bg-emerald-100 text-emerald-800`:`bg-rose-100 text-rose-800`}`,children:e.success?`SUCCESS`:`ERR`})]})]},t))}):(0,M.jsx)(`p`,{className:`text-[11px] text-slate-400 italic m-0`,children:`No autonomous enchantments executed yet in this session.`})]})]})]}),(0,M.jsx)(`div`,{className:`bg-white border-t border-slate-200 px-4 py-2 flex items-center justify-end shrink-0`,children:(0,M.jsx)(`button`,{type:`button`,onClick:f,className:`px-4 py-1.5 bg-white hover:bg-slate-100 border-[1.5px] border-ink-black rounded font-bold text-xs text-ink-black cursor-pointer shadow-xs active:translate-y-0.5`,children:`Close`})})]})})}var z=n({default:()=>B});function B(){let e=h(),[t,n]=(0,k.useState)(_()),[r,i]=(0,k.useState)(!1),[o,s]=(0,k.useState)(!1),[l,u]=(0,k.useState)(!1);(0,k.useEffect)(()=>{S.syncWithBackend(),S.triggerProactiveGreeting()},[]);let d=()=>{let e=!t;n(e),m(e)},p=()=>{window.confirm(`Clear conversation transcript with Princess Aurelia?`)&&S.clearTranscript()},g=(0,k.useCallback)(e=>{S.setIsTyping(e)},[]),y=(0,k.useMemo)(()=>[...e.transcript].reverse().find(e=>e.sender===`princess`)||e.transcript[0],[e.transcript]);return(0,M.jsxs)(`div`,{className:`relative w-full h-full bg-gradient-to-b from-[#FFFDF0] via-[#FFF9E6] to-[#FFF3CD] flex flex-col select-none font-sans text-ink-black overflow-hidden`,children:[(0,M.jsxs)(`div`,{className:`h-12 bg-white/95 backdrop-blur-sm border-b-[3px] border-ink-black px-3 sm:px-4 flex items-center justify-between gap-2 shrink-0 shadow-sm z-20`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-1.5 min-w-0`,children:[(0,M.jsx)(v,{className:`w-4 h-4 text-amber-500 shrink-0`}),(0,M.jsx)(`h3`,{className:`font-headline-md font-bold text-xs sm:text-sm text-ink-black m-0 truncate`,children:e.companionSettings.name||`Princess Aurelia`})]}),(0,M.jsx)(`span`,{className:`hidden sm:inline-flex px-2 py-0.5 rounded-full bg-amber-100 border border-amber-300 text-[10px] font-bold text-amber-900 shadow-inner shrink-0`,children:e.bondTier}),(0,M.jsx)(`span`,{className:`hidden md:inline-flex px-2 py-0.5 rounded-full bg-indigo-50 border border-indigo-200 text-[10px] font-bold text-indigo-800 shrink-0`,children:e.currentRhythm.toUpperCase()})]}),(0,M.jsxs)(`div`,{className:`flex items-center gap-1.5 sm:gap-2 shrink-0`,children:[(0,M.jsxs)(`button`,{type:`button`,onClick:()=>i(!0),className:`px-2.5 py-1 bg-amber-100 hover:bg-amber-200 border-[2px] border-ink-black rounded font-bold text-[11px] text-ink-black cursor-pointer shadow-[1.5px_1.5px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none transition-all flex items-center gap-1.5`,title:`View Spire Journey Progress`,children:[(0,M.jsx)(C,{className:`w-3.5 h-3.5 text-indigo-700`}),(0,M.jsxs)(`span`,{className:`font-arcade text-[9px] text-indigo-950`,children:[e.currentFloor,`/150 LC`]})]}),(0,M.jsxs)(`button`,{type:`button`,onClick:()=>s(!0),className:`px-2.5 py-1 bg-white hover:bg-amber-50 border-[2px] border-ink-black rounded font-bold text-[11px] text-ink-black cursor-pointer shadow-[1.5px_1.5px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none transition-all flex items-center gap-1.5`,title:`Open Royal Satchel (Missives & Diary)`,children:[(0,M.jsx)(E,{className:`w-3.5 h-3.5 text-amber-700`}),(0,M.jsx)(`span`,{className:`hidden md:inline`,children:`Satchel`}),e.unlockedLetters.length>0&&(0,M.jsx)(`span`,{className:`w-4 h-4 rounded-full bg-amber-400 text-ink-black text-[9px] font-extrabold flex items-center justify-center border border-ink-black`,children:e.unlockedLetters.length})]}),(0,M.jsx)(`button`,{type:`button`,onClick:()=>u(!0),className:`p-1.5 bg-white hover:bg-slate-100 border-[2px] border-ink-black rounded text-ink-black cursor-pointer shadow-[1.5px_1.5px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none transition-all`,title:`View Transcript History`,children:(0,M.jsx)(T,{className:`w-3.5 h-3.5 text-slate-700`})}),(0,M.jsx)(`button`,{type:`button`,onClick:d,className:`p-1.5 border-[2px] border-ink-black rounded text-ink-black cursor-pointer shadow-[1.5px_1.5px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none transition-all ${t?`bg-slate-200 opacity-80`:`bg-[#FFE24C] hover:bg-yellow-300`}`,title:t?`Unmute Audio`:`Mute Audio`,children:t?(0,M.jsx)(f,{className:`w-3.5 h-3.5`}):(0,M.jsx)(a,{className:`w-3.5 h-3.5`})})]})]}),(0,M.jsxs)(`div`,{className:`flex-1 flex flex-col items-center justify-start gap-3 sm:gap-4 p-3 sm:p-5 overflow-y-auto custom-scrollbar min-h-0 relative`,children:[(0,M.jsx)(N,{emotion:e.activeEmotion,floor:e.currentFloor,rhythm:e.currentRhythm,activity:e.currentActivity,isLoading:e.isLoading}),(0,M.jsx)(P,{text:y?.text||`I believe in you, champion!`,characterName:e.companionSettings.name,emotion:e.activeEmotion,isLoading:e.isLoading,isStreaming:y?.isStreaming,toolCalls:y?.toolCalls,onTypingStatusChange:g})]}),(0,M.jsx)(I,{suggestions:y?.choiceSuggestions,isLoading:e.isLoading,onSendMessage:e=>S.sendMessage(e),placeholder:`Speak with ${e.companionSettings.name||`Princess Aurelia`}...`}),r&&(0,M.jsx)(L,{currentFloor:e.currentFloor,totalSolved:e.totalSolved,onClose:()=>i(!1)}),o&&(0,M.jsx)(R,{unlockedLetters:e.unlockedLetters,spireChronicles:e.spireChronicles,currentFloor:e.currentFloor,heroCodex:e.heroCodex,episodicEvents:e.episodicEvents,recentToolTelemetry:e.recentToolTelemetry,onRemoveCodexItem:S.removeCodexItem,onClose:()=>s(!1)}),l&&(0,M.jsx)(`div`,{className:`absolute inset-0 z-50 bg-ink-black/40 backdrop-blur-xs flex items-center justify-center p-3 sm:p-4 animate-in fade-in duration-200`,onClick:()=>u(!1),children:(0,M.jsxs)(`div`,{className:`bg-[#FFFDF0] border-[3px] border-ink-black rounded-xl max-w-lg w-full h-[80%] max-h-[520px] shadow-[6px_6px_0px_0px_#1E293B] flex flex-col overflow-hidden`,onClick:e=>e.stopPropagation(),children:[(0,M.jsxs)(`div`,{className:`bg-white border-b-[2px] border-ink-black px-4 py-2.5 flex items-center justify-between shrink-0`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,M.jsx)(T,{className:`w-4 h-4 text-ink-black`}),(0,M.jsxs)(`h4`,{className:`font-headline-md font-bold text-xs sm:text-sm text-ink-black m-0`,children:[`Dialogue Transcript (`,e.transcript.length,` turns)`]})]}),(0,M.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,M.jsxs)(`button`,{type:`button`,onClick:p,className:`p-1 hover:bg-rose-100 text-rose-700 rounded text-[11px] font-bold flex items-center gap-1 cursor-pointer mr-1`,title:`Clear Chat History`,children:[(0,M.jsx)(c,{className:`w-3.5 h-3.5`}),(0,M.jsx)(`span`,{children:`Clear`})]}),(0,M.jsx)(`button`,{type:`button`,onClick:()=>u(!1),className:`p-1 hover:bg-slate-200 rounded text-slate-700 cursor-pointer`,title:`Close`,children:(0,M.jsx)(b,{className:`w-4 h-4`})})]})]}),(0,M.jsx)(`div`,{className:`flex-1 p-3 sm:p-4 overflow-y-auto custom-scrollbar flex flex-col gap-2.5`,children:e.transcript.map((t,n)=>(0,M.jsxs)(`div`,{className:`p-2.5 rounded-lg border-[2px] border-ink-black shadow-[2px_2px_0px_0px_#1E293B] max-w-[90%] ${t.sender===`princess`?`bg-white text-ink-black self-start`:`bg-[#FFE24C] text-ink-black self-end`}`,children:[(0,M.jsx)(`div`,{className:`text-[10px] font-bold font-headline-md mb-1 text-slate-600`,children:t.sender===`princess`?e.companionSettings.name:`Hero`}),(0,M.jsx)(`p`,{className:`text-xs font-medium m-0 leading-relaxed whitespace-pre-wrap select-text`,children:t.text})]},t.id||n))})]})})]})}export{z as t};
|
|
|
|
| 1 |
+
import{a as e,c as t,s as n,t as r}from"./jsx-runtime-j9uSgrFF.js";import{C as i,E as a,H as o,L as s,M as c,O as l,P as u,S as d,T as f,U as p,_ as m,b as h,g,h as _,k as v,v as y,w as b,x,y as S}from"./index-g5jVBiGr.js";var C=p(`castle`,[[`path`,{d:`M10 5V3`,key:`1y54qe`}],[`path`,{d:`M14 5V3`,key:`m6isi`}],[`path`,{d:`M15 21v-3a3 3 0 0 0-6 0v3`,key:`lbp5hj`}],[`path`,{d:`M18 3v8`,key:`2ollhf`}],[`path`,{d:`M18 5H6`,key:`98imr9`}],[`path`,{d:`M22 11H2`,key:`1lmjae`}],[`path`,{d:`M22 9v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9`,key:`1rly83`}],[`path`,{d:`M6 3v8`,key:`csox7g`}]]),w=p(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),T=p(`rotate-ccw-clock`,[[`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`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),E=p(`scroll`,[[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),D=p(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),O=p(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),k=t(e(),1),A={1:{particleType:`pollen`,particleCount:16,particleColors:[`#FDE047`,`#FEF08A`,`#86EFAC`],gradientBg:`from-[#FFFDF0] via-[#FFF9E6] to-[#FEF3C7]`,glowColor:`rgba(251, 191, 36, 0.3)`,badgeLabel:`🌾 Plains Breeze`},2:{particleType:`leaves`,particleCount:18,particleColors:[`#86EFAC`,`#4ADE80`,`#22C55E`,`#A7F3D0`],gradientBg:`from-[#F0FDF4] via-[#DCFCE7] to-[#FEF9C3]`,glowColor:`rgba(34, 197, 94, 0.3)`,badgeLabel:`🍃 Whispering Leaves`},3:{particleType:`spores`,particleCount:22,particleColors:[`#67E8F9`,`#38BDF8`,`#818CF8`,`#C084FC`],gradientBg:`from-[#F0F9FF] via-[#E0F2FE] to-[#EDE9FE]`,glowColor:`rgba(56, 189, 248, 0.35)`,badgeLabel:`✨ Crystal Spores`},4:{particleType:`snow`,particleCount:28,particleColors:[`#FFFFFF`,`#E0F2FE`,`#BAE6FD`],gradientBg:`from-[#F8FAFC] via-[#F1F5F9] to-[#E2E8F0]`,glowColor:`rgba(186, 230, 253, 0.4)`,badgeLabel:`❄️ Alpine Snowfall`},5:{particleType:`runes`,particleCount:20,particleColors:[`#E879F9`,`#C084FC`,`#A855F7`,`#F472B6`],gradientBg:`from-[#FAF5FF] via-[#F3E8FF] to-[#FCE7F3]`,glowColor:`rgba(192, 132, 252, 0.4)`,badgeLabel:`🔮 Arcane Runes`},6:{particleType:`stardust`,particleCount:35,particleColors:[`#FDE047`,`#F59E0B`,`#E11D48`,`#818CF8`],gradientBg:`from-[#FFFBEB] via-[#FEF3C7] to-[#FFE4E6]`,glowColor:`rgba(245, 158, 11, 0.5)`,badgeLabel:`👑 Spire Gates`}};function j(e){return e<=30?A[1]:e<=60?A[2]:e<=90?A[3]:e<=120?A[4]:e<150?A[5]:A[6]}var M=r();function N({emotion:e,floor:t,rhythm:n,activity:r,isLoading:i=!1}){let a=y[e]||y.smiling_warmly,o=(0,k.useMemo)(()=>j(t),[t]),s=(0,k.useMemo)(()=>{switch(n){case`dawn`:return`from-amber-400/40 via-yellow-300/30 to-rose-300/20`;case`dusk`:return`from-orange-400/40 via-purple-400/30 to-amber-300/20`;case`night`:return`from-indigo-600/40 via-blue-500/30 to-amber-500/20`;default:return`from-amber-400/30 via-yellow-300/40 to-indigo-400/30`}},[n]);return(0,M.jsxs)(`div`,{className:`relative flex flex-col items-center justify-center my-auto w-full max-w-xl`,children:[(0,M.jsx)(`div`,{className:`absolute -inset-10 overflow-hidden pointer-events-none z-0`,children:Array.from({length:Math.min(18,o.particleCount)}).map((e,t)=>{let n=o.particleColors[t%o.particleColors.length],r=`${t*19%100}%`,i=`${6+t%5*2}s`,a=`${t*.7%4}s`,s=o.particleType===`leaves`||o.particleType===`runes`?`w-2.5 h-2.5`:`w-1.5 h-1.5`;return(0,M.jsx)(`span`,{className:`absolute rounded-full opacity-65 animate-pulse ${s}`,style:{backgroundColor:n,left:r,top:`${t*23%90}%`,boxShadow:`0 0 8px ${n}`,animationDuration:i,animationDelay:a}},t)})}),(0,M.jsxs)(`div`,{className:`relative group z-10`,children:[(0,M.jsx)(`div`,{className:`absolute -inset-2 bg-gradient-to-r ${s} rounded-2xl blur-md opacity-80 group-hover:opacity-100 transition duration-500`}),(0,M.jsxs)(`div`,{className:`relative w-36 h-44 sm:w-44 sm:h-52 bg-gradient-to-b from-amber-100 to-amber-200 border-[3px] border-ink-black rounded-xl overflow-hidden shadow-[4px_4px_0px_0px_#1E293B] transition-transform duration-300 flex items-center justify-center`,children:[(0,M.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center text-amber-700/40 pointer-events-none select-none`,children:[(0,M.jsx)(v,{className:`w-8 h-8 animate-pulse`}),(0,M.jsx)(`span`,{className:`font-arcade text-[10px] mt-2`,children:`Princess Aurelia`})]}),(0,M.jsx)(`img`,{src:a.imagePath,alt:a.label,loading:`eager`,className:`w-full h-full object-cover object-top transition-all duration-300 relative z-10 ${i?`scale-105 filter saturate-125`:`scale-100`}`,onError:e=>{let t=e.currentTarget;t.src.endsWith(`/sprites/princess/neutral.png`)?t.style.display=`none`:t.src=`/sprites/princess/neutral.png`}}),(0,M.jsxs)(`div`,{className:`absolute bottom-0 inset-x-0 bg-ink-black/85 backdrop-blur-xs text-[10px] text-amber-300 py-1 px-2 font-bold uppercase tracking-wider text-center flex items-center justify-center gap-1.5`,children:[(0,M.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full ${i?`bg-amber-400 animate-ping`:`bg-emerald-400`}`}),(0,M.jsx)(`span`,{children:i?`Pondering...`:a.label})]})]}),(0,M.jsx)(`div`,{className:`absolute -top-2 -right-2 bg-[#FFE24C] border-[2px] border-ink-black rounded-full p-1 shadow-[2px_2px_0px_0px_#1E293B]`,children:(0,M.jsx)(v,{className:`w-3.5 h-3.5 text-amber-800`})})]}),r&&(0,M.jsx)(`div`,{className:`mt-2 text-center max-w-sm px-2`,children:(0,M.jsxs)(`span`,{className:`text-[10px] font-semibold text-slate-700 bg-white/85 px-2.5 py-0.5 rounded-full border border-ink-black/20 shadow-xs inline-flex items-center gap-1`,children:[(0,M.jsx)(`span`,{children:`🏰`}),(0,M.jsx)(`span`,{className:`truncate`,children:r})]})})]})}function P({text:e,characterName:t,emotion:n,isLoading:r=!1,isStreaming:i=!1,toolCalls:a,onTypingStatusChange:o}){let[s,c]=(0,k.useState)(e),[l,u]=(0,k.useState)(!1),d=(0,k.useRef)(null),f=(0,k.useRef)(e),p=(0,k.useRef)(0),m=(0,k.useRef)(o);(0,k.useEffect)(()=>{m.current=o},[o]);let h=y[n]||y.smiling_warmly,_=e=>{u(e),m.current?.(e)};return(0,k.useEffect)(()=>{if(i){d.current&&clearInterval(d.current),c(e),_(!0),e.length-p.current>=4&&(p.current=e.length,g(e.length)),f.current=e;return}if(e!==f.current&&!r){let t=f.current.length>0&&e.startsWith(f.current);if(f.current=e,d.current&&clearInterval(d.current),t)c(e),_(!1);else{c(``),_(!0);let t=0;d.current=setInterval(()=>{t<e.length?(t++,c(e.slice(0,t)),t%2==0&&e[t-1]!==` `&&g(t)):(d.current&&clearInterval(d.current),_(!1))},22)}}else!r&&e===f.current&&!i&&(c(e),l&&_(!1));return()=>{d.current&&clearInterval(d.current)}},[e,r,i]),(0,M.jsxs)(`div`,{onClick:()=>{l&&(d.current&&clearInterval(d.current),c(e),_(!1))},className:`w-full max-w-xl mt-3 sm:mt-4 relative bg-white border-[3px] border-ink-black rounded-xl p-3.5 sm:p-4 shadow-[4px_4px_0px_0px_#1E293B] transition-all cursor-pointer group select-text`,children:[(0,M.jsx)(`div`,{className:`absolute -top-3 left-1/2 -translate-x-1/2 w-0 h-0 border-x-8 border-x-transparent border-b-8 border-b-ink-black pointer-events-none`}),(0,M.jsx)(`div`,{className:`absolute -top-2 left-1/2 -translate-x-1/2 w-0 h-0 border-x-6 border-x-transparent border-b-6 border-b-white pointer-events-none`}),(0,M.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-amber-100 pb-1.5 mb-2 select-none`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,M.jsxs)(`span`,{className:`font-headline-md font-bold text-xs text-amber-900 flex items-center gap-1`,children:[`👑 `,t||`Princess Aurelia`]}),(0,M.jsx)(`span`,{className:`text-[9px] bg-amber-100 text-amber-800 font-bold px-1.5 py-0.2 rounded border border-amber-200`,children:h.label})]}),l&&(0,M.jsx)(`span`,{className:`text-[9px] text-trash-gray font-medium animate-pulse`,children:`Click bubble to skip`})]}),r?(0,M.jsxs)(`div`,{className:`flex items-center gap-2 py-2 text-xs font-medium text-trash-gray select-none`,children:[(0,M.jsx)(`span`,{className:`inline-block w-2 h-2 bg-amber-500 rounded-full animate-bounce`}),(0,M.jsx)(`span`,{className:`inline-block w-2 h-2 bg-amber-500 rounded-full animate-bounce [animation-delay:0.2s]`}),(0,M.jsx)(`span`,{className:`inline-block w-2 h-2 bg-amber-500 rounded-full animate-bounce [animation-delay:0.4s]`}),(0,M.jsxs)(`span`,{className:`ml-1 text-slate-600`,children:[t||`Princess Aurelia`,` is attuning the crystal relay...`]})]}):(0,M.jsxs)(`div`,{className:`text-xs sm:text-[13px] text-ink-black font-medium leading-relaxed whitespace-pre-wrap`,children:[(e=>e.split(/(\*[^*]+\*)/g).map((e,t)=>e.startsWith(`*`)&&e.endsWith(`*`)?(0,M.jsx)(`span`,{className:`text-amber-700 italic font-semibold mr-1 inline-block`,children:e},t):(0,M.jsx)(`span`,{children:e},t)))(s),l&&(0,M.jsx)(`span`,{className:`inline-block w-1.5 h-3.5 bg-amber-500 ml-1 animate-pulse align-middle`})]}),a&&a.length>0&&!r&&(0,M.jsx)(`div`,{className:`mt-2.5 pt-2 border-t border-amber-100/80 flex flex-wrap gap-1.5 select-none`,children:a.map((e,t)=>{let n=`✨ Enchantment: ${e.name}`;return e.name===`open_app_window`&&(n=`📜 Summoned: ${e.args?.window_id||`Grimoire`}`),e.name===`set_study_timer`&&(n=`⏳ Hourglass: ${e.args?.minutes||15}m rest`),e.name===`play_ambient_sound`&&(n=`🔥 Kindled: ${e.args?.soundscape||`Soundscape`}`),e.name===`write_spire_diary`&&(n=`📖 Chronicled in Spire Diary`),(0,M.jsx)(`span`,{className:`px-2 py-0.5 rounded-full bg-indigo-50 border border-indigo-200 text-[10px] font-bold text-indigo-800 flex items-center gap-1 shadow-xs`,children:(0,M.jsx)(`span`,{children:n})},t)})})]})}var F=[{label:`💪 Solved a Tough One`,prompt:`I just solved a really tough problem! Felt so good getting all test cases to pass.`},{label:`😩 Feeling Stuck`,prompt:`I feel really stuck and discouraged today. It feels like everyone else gets this except me.`},{label:`☕ Need a Breather`,prompt:`My brain is pretty fried from practicing today. Can we just take a short breather?`},{label:`🌙 Life Beyond the Tower`,prompt:`What’s the first thing you want to do once we break the seals and get you out of that tower?`}];function I({suggestions:e,isLoading:t=!1,onSendMessage:n,placeholder:r=`Speak with Princess Aurelia...`}){let[i,a]=(0,k.useState)(``),o=()=>{let e=i.trim();e&&!t&&(n(e),a(``))},s=e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),o())},c=Array.isArray(e)&&e.length>0;return(0,M.jsxs)(`div`,{className:`w-full flex flex-col items-center gap-2 select-none z-10`,children:[(0,M.jsx)(`div`,{className:`w-full max-w-xl flex items-center justify-center gap-1.5 flex-wrap py-1.5 px-2`,children:c?e.map((e,r)=>(0,M.jsxs)(`button`,{type:`button`,onClick:()=>n(e),disabled:t,className:`px-2.5 py-1 bg-white hover:bg-amber-100 disabled:opacity-50 border-[1.5px] border-ink-black rounded-full text-[10px] sm:text-[11px] font-bold text-slate-800 cursor-pointer shadow-[1px_1px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none transition-all flex items-center gap-1`,children:[(0,M.jsx)(v,{className:`w-3 h-3 text-amber-600 shrink-0`}),(0,M.jsx)(`span`,{className:`truncate max-w-[200px]`,children:e})]},r)):F.map((e,r)=>(0,M.jsx)(`button`,{type:`button`,onClick:()=>n(e.prompt),disabled:t,className:`px-2.5 py-1 bg-white hover:bg-amber-100 disabled:opacity-50 border-[1.5px] border-ink-black rounded-full text-[10px] sm:text-[11px] font-bold text-slate-800 cursor-pointer shadow-[1px_1px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none transition-all`,children:e.label},r))}),(0,M.jsxs)(`div`,{className:`w-full bg-white border-t-[3px] border-ink-black p-3 sm:px-4 flex items-center gap-2 shrink-0`,children:[(0,M.jsx)(`input`,{type:`text`,value:i,onChange:e=>a(e.target.value),onKeyDown:s,disabled:t,placeholder:r,className:`flex-1 bg-[#FFFDF0] border-[2px] border-ink-black rounded-lg px-3.5 py-2 text-xs sm:text-sm font-medium text-ink-black placeholder-slate-400 focus:outline-none focus:border-amber-500 shadow-inner disabled:opacity-50`}),(0,M.jsxs)(`button`,{type:`button`,onClick:o,disabled:t||!i.trim(),className:`px-4 sm:px-5 py-2 bg-[#FFE24C] hover:bg-yellow-300 disabled:opacity-50 border-[2px] border-ink-black rounded-lg font-bold text-xs sm:text-sm text-ink-black shadow-[2px_2px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none transition-all cursor-pointer flex items-center gap-1.5 shrink-0`,children:[(0,M.jsx)(D,{className:`w-3.5 h-3.5`}),(0,M.jsx)(`span`,{children:`Send`})]})]})]})}function L({currentFloor:e,onClose:t}){let n=d(e),r=Math.min(100,Math.round(e/150*100));return(0,M.jsx)(`div`,{className:`absolute inset-0 z-50 bg-ink-black/40 backdrop-blur-xs flex items-center justify-center p-3 sm:p-4 animate-in fade-in duration-200 select-none`,onClick:t,children:(0,M.jsxs)(`div`,{className:`bg-[#FFFDF0] border-[3px] border-ink-black rounded-xl p-4 sm:p-5 max-w-md w-full shadow-[6px_6px_0px_0px_#1E293B] flex flex-col gap-3.5`,onClick:e=>e.stopPropagation(),children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between border-b-[2px] border-ink-black pb-2`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,M.jsx)(C,{className:`w-5 h-5 text-indigo-600`}),(0,M.jsx)(`h4`,{className:`font-headline-md font-bold text-sm text-ink-black m-0`,children:`Journey to the Big-O Spire`})]}),(0,M.jsx)(`button`,{type:`button`,onClick:t,className:`p-1 hover:bg-slate-200 rounded text-slate-700 cursor-pointer`,title:`Close`,children:(0,M.jsx)(b,{className:`w-4 h-4`})})]}),(0,M.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between text-xs font-bold font-headline-md`,children:[(0,M.jsx)(`span`,{children:`Path Progress:`}),(0,M.jsxs)(`span`,{className:`font-arcade bg-indigo-100 text-indigo-900 px-2 py-0.5 rounded border border-indigo-300`,children:[e,` / 150 Leagues`]})]}),(0,M.jsx)(`div`,{className:`w-full bg-slate-200 h-4 border-[2px] border-ink-black rounded-full overflow-hidden p-0.5`,children:(0,M.jsx)(`div`,{className:`bg-gradient-to-r from-amber-400 via-yellow-400 to-emerald-400 h-full rounded-full transition-all duration-500`,style:{width:`${r}%`}})}),(0,M.jsxs)(`div`,{className:`flex items-center justify-between text-[11px] text-trash-gray font-medium`,children:[(0,M.jsxs)(`span`,{children:[`Progress: `,(0,M.jsxs)(`strong`,{children:[r,`%`]})]}),(0,M.jsxs)(`span`,{children:[`Distance to Tower: `,(0,M.jsxs)(`strong`,{children:[Math.max(0,150-e),` leagues`]})]})]})]}),(0,M.jsxs)(`div`,{className:`bg-white border-[2px] border-ink-black rounded-lg p-3 shadow-[2px_2px_0px_0px_#1E293B] flex flex-col gap-1`,children:[(0,M.jsx)(`div`,{className:`text-[10px] font-bold uppercase text-amber-700 tracking-wider`,children:`Current Realm:`}),(0,M.jsx)(`div`,{className:`font-bold text-xs text-ink-black`,children:n.title}),(0,M.jsx)(`p`,{className:`text-[11px] text-slate-600 m-0 leading-relaxed font-medium`,children:n.description}),(0,M.jsxs)(`div`,{className:`text-[10px] text-amber-900 bg-amber-50 p-1.5 rounded border border-amber-200 italic mt-1`,children:[`📜 `,n.bgLore]})]}),(0,M.jsx)(`div`,{className:`flex items-center justify-between gap-1 text-center`,children:[{floor:30,label:`Arrays`},{floor:60,label:`Pointers`},{floor:90,label:`Trees`},{floor:120,label:`Heaps`},{floor:150,label:`Spire`}].map(t=>{let n=e>=t.floor;return(0,M.jsxs)(`div`,{className:`flex-1 p-1.5 rounded border text-[10px] flex flex-col items-center ${n?`bg-emerald-100 border-emerald-600 text-emerald-900 font-bold`:`bg-slate-100 border-slate-300 text-slate-500`}`,children:[(0,M.jsx)(`span`,{children:n?`✓`:t.floor}),(0,M.jsx)(`span`,{className:`text-[9px] truncate w-full`,children:t.label})]},t.floor)})}),(0,M.jsx)(`div`,{className:`flex items-center justify-end border-t border-slate-200 pt-2 mt-1`,children:(0,M.jsx)(`button`,{type:`button`,onClick:t,className:`px-4 py-1.5 bg-white hover:bg-slate-100 border-[1.5px] border-ink-black rounded font-bold text-xs text-ink-black cursor-pointer shadow-xs active:translate-y-0.5`,children:`Done`})})]})})}function R({unlockedLetters:e,spireChronicles:t,currentFloor:n,heroCodex:r,episodicEvents:a,recentToolTelemetry:c,onRemoveCodexItem:d,onClose:f}){let[p,m]=(0,k.useState)(`letters`),[h,g]=(0,k.useState)(e[e.length-1]||null);return(0,M.jsx)(`div`,{className:`absolute inset-0 z-50 bg-ink-black/50 backdrop-blur-xs flex items-center justify-center p-3 sm:p-4 animate-in fade-in duration-200 select-none`,onClick:f,children:(0,M.jsxs)(`div`,{className:`bg-[#FFFDF0] border-[3px] border-ink-black rounded-xl max-w-lg w-full h-[85%] max-h-[560px] shadow-[6px_6px_0px_0px_#1E293B] flex flex-col overflow-hidden`,onClick:e=>e.stopPropagation(),children:[(0,M.jsxs)(`div`,{className:`bg-white border-b-[2px] border-ink-black px-4 py-2.5 flex items-center justify-between shrink-0`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,M.jsx)(E,{className:`w-5 h-5 text-amber-700`}),(0,M.jsx)(`h4`,{className:`font-headline-md font-bold text-sm text-ink-black m-0`,children:`The Royal Satchel`})]}),(0,M.jsx)(`button`,{type:`button`,onClick:f,className:`p-1 hover:bg-slate-200 rounded text-slate-700 cursor-pointer`,title:`Close`,children:(0,M.jsx)(b,{className:`w-4 h-4`})})]}),(0,M.jsxs)(`div`,{className:`flex border-b-2 border-ink-black bg-amber-100/70 shrink-0`,children:[(0,M.jsxs)(`button`,{type:`button`,onClick:()=>m(`letters`),className:`flex-1 py-2 text-xs font-bold font-headline-md flex items-center justify-center gap-1.5 transition-colors cursor-pointer border-r border-ink-black/20 ${p===`letters`?`bg-[#FFFDF0] text-amber-950 border-b-2 border-b-[#FFFDF0] -mb-[2px]`:`text-slate-600 hover:bg-amber-200/50`}`,children:[(0,M.jsx)(E,{className:`w-3.5 h-3.5`}),(0,M.jsxs)(`span`,{children:[`Missives (`,e.length,`/5)`]})]}),(0,M.jsxs)(`button`,{type:`button`,onClick:()=>m(`diary`),className:`flex-1 py-2 text-xs font-bold font-headline-md flex items-center justify-center gap-1.5 transition-colors cursor-pointer border-r border-ink-black/20 ${p===`diary`?`bg-[#FFFDF0] text-amber-950 border-b-2 border-b-[#FFFDF0] -mb-[2px]`:`text-slate-600 hover:bg-amber-200/50`}`,children:[(0,M.jsx)(o,{className:`w-3.5 h-3.5`}),(0,M.jsxs)(`span`,{children:[`Chronicles (`,t.length,`)`]})]}),(0,M.jsxs)(`button`,{type:`button`,onClick:()=>m(`codex`),className:`flex-1 py-2 text-xs font-bold font-headline-md flex items-center justify-center gap-1.5 transition-colors cursor-pointer ${p===`codex`?`bg-[#FFFDF0] text-amber-950 border-b-2 border-b-[#FFFDF0] -mb-[2px]`:`text-slate-600 hover:bg-amber-200/50`}`,children:[(0,M.jsx)(v,{className:`w-3.5 h-3.5 text-amber-700`}),(0,M.jsx)(`span`,{children:`Codex`})]})]}),(0,M.jsxs)(`div`,{className:`flex-1 p-3 sm:p-4 overflow-y-auto custom-scrollbar flex flex-col gap-3 min-h-0`,children:[p===`letters`&&(0,M.jsxs)(`div`,{className:`flex flex-col gap-3 flex-1`,children:[(0,M.jsx)(`div`,{className:`flex items-center gap-1.5 overflow-x-auto pb-1`,children:[30,60,90,120,150].map(e=>{let t=x[e],r=n>=e,i=h?.floor===e;return(0,M.jsxs)(`button`,{type:`button`,disabled:!r,onClick:()=>r&&g(t),className:`px-3 py-1 rounded-full text-[11px] font-bold border-[1.5px] border-ink-black flex items-center gap-1 shrink-0 transition-all cursor-pointer ${r?i?`bg-[#FFE24C] text-ink-black shadow-[1.5px_1.5px_0px_0px_#1E293B]`:`bg-white hover:bg-amber-100 text-slate-800`:`opacity-40 bg-slate-200 text-slate-500 cursor-not-allowed`}`,children:[r?(0,M.jsx)(`span`,{children:`📜`}):(0,M.jsx)(u,{className:`w-3 h-3`}),(0,M.jsxs)(`span`,{children:[`League `,e]})]},e)})}),h?(0,M.jsxs)(`div`,{className:`bg-[#FFF9E6] border-[2px] border-amber-900/40 rounded-lg p-4 shadow-sm flex-1 overflow-y-auto custom-scrollbar flex flex-col select-text`,children:[(0,M.jsxs)(`div`,{className:`border-b border-amber-800/20 pb-2 mb-3 flex items-center justify-between`,children:[(0,M.jsxs)(`div`,{children:[(0,M.jsxs)(`div`,{className:`text-[10px] font-bold text-amber-800 uppercase tracking-wider`,children:[h.chapterTitle,` • League `,h.floor]}),(0,M.jsx)(`h5`,{className:`font-headline-md font-bold text-sm text-amber-950 m-0`,children:h.title})]}),(0,M.jsx)(`span`,{className:`text-xl`,children:`🪶`})]}),(0,M.jsx)(`p`,{className:`text-xs sm:text-[13px] text-amber-950 font-serif leading-relaxed whitespace-pre-wrap flex-1 italic`,children:h.letterText})]}):(0,M.jsxs)(`div`,{className:`flex-1 flex flex-col items-center justify-center text-center p-6 text-slate-500`,children:[(0,M.jsx)(u,{className:`w-8 h-8 mb-2 text-slate-400`}),(0,M.jsx)(`p`,{className:`text-xs font-medium`,children:`Conquer 30 LeetCode problems along the path to receive your first Royal Missive from Aurelia.`})]})]}),p===`diary`&&(0,M.jsx)(`div`,{className:`flex flex-col gap-2.5 flex-1`,children:t.length>0?t.map(e=>(0,M.jsxs)(`div`,{className:`p-3 bg-white border-[1.5px] border-ink-black rounded-lg shadow-xs flex flex-col gap-1 select-text`,children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between text-[10px] text-amber-800 font-bold border-b border-slate-100 pb-1`,children:[(0,M.jsxs)(`span`,{children:[`League `,e.floor,` along the Path`]}),(0,M.jsx)(`span`,{children:new Date(e.timestamp).toLocaleDateString()})]}),(0,M.jsxs)(`p`,{className:`text-xs text-ink-black font-medium leading-relaxed m-0 italic font-serif`,children:[`“`,e.text,`”`]})]},e.id)):(0,M.jsxs)(`div`,{className:`flex-1 flex flex-col items-center justify-center text-center p-6 text-slate-500`,children:[(0,M.jsx)(o,{className:`w-8 h-8 mb-2 text-slate-400`}),(0,M.jsx)(`p`,{className:`text-xs font-medium`,children:`Aurelia records entries in her Spire Chronicles autonomously as you chat, rest, and cross chapter milestones.`})]})}),p===`codex`&&(0,M.jsxs)(`div`,{className:`flex flex-col gap-3 flex-1 select-text`,children:[(0,M.jsxs)(`div`,{className:`bg-white border-[1.5px] border-ink-black rounded-lg p-3 shadow-xs flex flex-col gap-2`,children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between border-b border-slate-100 pb-1.5`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,M.jsx)(v,{className:`w-4 h-4 text-amber-600`}),(0,M.jsx)(`h5`,{className:`font-headline-md font-bold text-xs text-ink-black m-0`,children:`Hero Codex (MemGPT & Mem0 Core Memory)`})]}),(0,M.jsx)(`span`,{className:`text-[10px] text-slate-400 font-mono`,children:`Cognitive Sync`})]}),(0,M.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-2 text-xs`,children:[(0,M.jsxs)(`div`,{className:`bg-[#FFFDF0] border border-amber-900/20 rounded p-2`,children:[(0,M.jsx)(`span`,{className:`text-[10px] font-bold text-slate-500 uppercase tracking-wider block`,children:`Hero Alias`}),(0,M.jsx)(`span`,{className:`font-bold text-ink-black text-xs`,children:r?.heroName||`Champion`})]}),(0,M.jsxs)(`div`,{className:`bg-[#FFFDF0] border border-amber-900/20 rounded p-2`,children:[(0,M.jsx)(`span`,{className:`text-[10px] font-bold text-slate-500 uppercase tracking-wider block`,children:`Target Goal`}),(0,M.jsx)(`span`,{className:`font-bold text-amber-900 text-xs`,children:r?.targetGoal||`None shared yet (mention to Aurelia!)`})]})]}),r?.preferredLanguage&&(0,M.jsxs)(`div`,{className:`bg-[#FFFDF0] border border-amber-900/20 rounded p-2 text-xs`,children:[(0,M.jsx)(`span`,{className:`text-[10px] font-bold text-slate-500 uppercase tracking-wider block`,children:`Weapon of Choice (Language)`}),(0,M.jsx)(`span`,{className:`font-bold text-ink-black`,children:r.preferredLanguage})]})]}),(0,M.jsxs)(`div`,{className:`bg-white border-[1.5px] border-ink-black rounded-lg p-3 shadow-xs flex flex-col gap-2`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-bold text-emerald-800`,children:[(0,M.jsx)(s,{className:`w-3.5 h-3.5`}),(0,M.jsxs)(`span`,{children:[`Mastered Patterns (`,r?.strengths?.length||0,`)`]})]}),r?.strengths&&r.strengths.length>0?(0,M.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:r.strengths.map(e=>(0,M.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2.5 py-0.5 rounded-full text-[11px] font-bold bg-emerald-50 text-emerald-800 border border-emerald-300`,children:[e,d&&(0,M.jsx)(`button`,{type:`button`,onClick:()=>d(`strengths`,e),className:`hover:text-red-600 ml-0.5 cursor-pointer`,title:`Forget strength`,children:(0,M.jsx)(b,{className:`w-3 h-3`})})]},e))}):(0,M.jsx)(`p`,{className:`text-[11px] text-slate-400 italic m-0`,children:`Aurelia will note topics you conquer during your practice.`})]}),(0,M.jsxs)(`div`,{className:`bg-white border-[1.5px] border-ink-black rounded-lg p-3 shadow-xs flex flex-col gap-2`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-bold text-rose-800`,children:[(0,M.jsx)(O,{className:`w-3.5 h-3.5`}),(0,M.jsxs)(`span`,{children:[`Nemesis Patterns (`,r?.nemesisPatterns?.length||0,`)`]})]}),r?.nemesisPatterns&&r.nemesisPatterns.length>0?(0,M.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:r.nemesisPatterns.map(e=>(0,M.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2.5 py-0.5 rounded-full text-[11px] font-bold bg-rose-50 text-rose-800 border border-rose-300`,children:[e,d&&(0,M.jsx)(`button`,{type:`button`,onClick:()=>d(`nemesisPatterns`,e),className:`hover:text-red-700 ml-0.5 cursor-pointer`,title:`Forget nemesis`,children:(0,M.jsx)(b,{className:`w-3 h-3`})})]},e))}):(0,M.jsx)(`p`,{className:`text-[11px] text-slate-400 italic m-0`,children:`Aurelia tracks patterns that give you trouble to help you prepare targeted drills.`})]}),(0,M.jsxs)(`div`,{className:`bg-white border-[1.5px] border-ink-black rounded-lg p-3 shadow-xs flex flex-col gap-2`,children:[(0,M.jsx)(`div`,{className:`text-xs font-bold text-slate-800`,children:(0,M.jsxs)(`span`,{children:[`Personal Notes & Shared Lore (`,r?.personalNotes?.length||0,`)`]})}),r?.personalNotes&&r.personalNotes.length>0?(0,M.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:r.personalNotes.map(e=>(0,M.jsxs)(`div`,{className:`flex items-start justify-between gap-2 p-2 bg-slate-50 border border-slate-200 rounded text-[11px] text-slate-700`,children:[(0,M.jsxs)(`span`,{children:[`• `,e]}),d&&(0,M.jsx)(`button`,{type:`button`,onClick:()=>d(`personalNotes`,e),className:`text-slate-400 hover:text-red-600 shrink-0 cursor-pointer p-0.5`,title:`Forget note`,children:(0,M.jsx)(l,{className:`w-3 h-3`})})]},e))}):(0,M.jsx)(`p`,{className:`text-[11px] text-slate-400 italic m-0`,children:`Share your background or routine with Aurelia and she will hold it in her memory.`})]}),a&&a.length>0&&(0,M.jsxs)(`div`,{className:`bg-white border-[1.5px] border-ink-black rounded-lg p-3 shadow-xs flex flex-col gap-2`,children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between border-b border-slate-100 pb-1`,children:[(0,M.jsx)(`span`,{className:`text-xs font-bold text-slate-800`,children:`Episodic Memory Chain (EM-LLM)`}),(0,M.jsxs)(`span`,{className:`text-[10px] text-slate-400 font-mono`,children:[a.length,` events`]})]}),(0,M.jsx)(`div`,{className:`flex flex-col gap-2 max-h-40 overflow-y-auto custom-scrollbar`,children:a.slice(0,8).map(e=>(0,M.jsxs)(`div`,{className:`text-[11px] p-2 bg-[#FFFDF0] border border-amber-900/15 rounded flex flex-col gap-0.5`,children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,M.jsx)(`span`,{className:`font-bold text-ink-black uppercase text-[9px] px-1.5 py-0.5 bg-amber-200/60 rounded`,children:e.eventType.replace(`_`,` `)}),(0,M.jsx)(`span`,{className:`text-[10px] text-slate-400`,children:new Date(e.timestamp).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})})]}),(0,M.jsx)(`div`,{className:`font-bold text-slate-800 mt-0.5`,children:e.title}),(0,M.jsx)(`div`,{className:`text-slate-600 text-[10px]`,children:e.description})]},e.id))})]}),(0,M.jsxs)(`div`,{className:`bg-white border-[1.5px] border-ink-black rounded-lg p-3 shadow-xs flex flex-col gap-2`,children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between border-b border-slate-100 pb-1`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-bold text-indigo-900`,children:[(0,M.jsx)(i,{className:`w-3.5 h-3.5 text-amber-500`}),(0,M.jsx)(`span`,{children:`Autonomous Enchantment Telemetry`})]}),(0,M.jsxs)(`span`,{className:`text-[10px] text-slate-400 font-mono`,children:[c?.length||0,` executed`]})]}),c&&c.length>0?(0,M.jsx)(`div`,{className:`flex flex-col gap-1.5 max-h-36 overflow-y-auto custom-scrollbar`,children:c.slice(0,10).map((e,t)=>(0,M.jsxs)(`div`,{className:`text-[11px] p-2 bg-indigo-50/50 border border-indigo-100 rounded flex items-center justify-between gap-2`,children:[(0,M.jsxs)(`div`,{className:`flex flex-col min-w-0`,children:[(0,M.jsxs)(`span`,{className:`font-bold text-indigo-950 font-mono text-[10px] truncate`,children:[e.tool_name,`()`]}),e.args&&Object.keys(e.args).length>0&&(0,M.jsx)(`span`,{className:`text-[9px] text-slate-500 truncate`,children:JSON.stringify(e.args).slice(0,50)})]}),(0,M.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[e.execution_time_ms!==void 0&&(0,M.jsxs)(`span`,{className:`text-[9px] text-slate-400 flex items-center gap-0.5 font-mono`,children:[(0,M.jsx)(w,{className:`w-2.5 h-2.5`}),e.execution_time_ms,`ms`]}),(0,M.jsx)(`span`,{className:`px-1.5 py-0.2 text-[9px] font-bold rounded ${e.success?`bg-emerald-100 text-emerald-800`:`bg-rose-100 text-rose-800`}`,children:e.success?`SUCCESS`:`ERR`})]})]},t))}):(0,M.jsx)(`p`,{className:`text-[11px] text-slate-400 italic m-0`,children:`No autonomous enchantments executed yet in this session.`})]})]})]}),(0,M.jsx)(`div`,{className:`bg-white border-t border-slate-200 px-4 py-2 flex items-center justify-end shrink-0`,children:(0,M.jsx)(`button`,{type:`button`,onClick:f,className:`px-4 py-1.5 bg-white hover:bg-slate-100 border-[1.5px] border-ink-black rounded font-bold text-xs text-ink-black cursor-pointer shadow-xs active:translate-y-0.5`,children:`Close`})})]})})}var z=n({default:()=>B});function B(){let e=h(),[t,n]=(0,k.useState)(_()),[r,i]=(0,k.useState)(!1),[o,s]=(0,k.useState)(!1),[l,u]=(0,k.useState)(!1);(0,k.useEffect)(()=>{S.syncWithBackend(),S.triggerProactiveGreeting()},[]);let d=()=>{let e=!t;n(e),m(e)},p=()=>{window.confirm(`Clear conversation transcript with Princess Aurelia?`)&&S.clearTranscript()},g=(0,k.useCallback)(e=>{S.setIsTyping(e)},[]),y=(0,k.useMemo)(()=>[...e.transcript].reverse().find(e=>e.sender===`princess`)||e.transcript[0],[e.transcript]);return(0,M.jsxs)(`div`,{className:`relative w-full h-full bg-gradient-to-b from-[#FFFDF0] via-[#FFF9E6] to-[#FFF3CD] flex flex-col select-none font-sans text-ink-black overflow-hidden`,children:[(0,M.jsxs)(`div`,{className:`h-12 bg-white/95 backdrop-blur-sm border-b-[3px] border-ink-black px-3 sm:px-4 flex items-center justify-between gap-2 shrink-0 shadow-sm z-20`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-1.5 min-w-0`,children:[(0,M.jsx)(v,{className:`w-4 h-4 text-amber-500 shrink-0`}),(0,M.jsx)(`h3`,{className:`font-headline-md font-bold text-xs sm:text-sm text-ink-black m-0 truncate`,children:e.companionSettings.name||`Princess Aurelia`})]}),(0,M.jsx)(`span`,{className:`hidden sm:inline-flex px-2 py-0.5 rounded-full bg-amber-100 border border-amber-300 text-[10px] font-bold text-amber-900 shadow-inner shrink-0`,children:e.bondTier}),(0,M.jsx)(`span`,{className:`hidden md:inline-flex px-2 py-0.5 rounded-full bg-indigo-50 border border-indigo-200 text-[10px] font-bold text-indigo-800 shrink-0`,children:e.currentRhythm.toUpperCase()})]}),(0,M.jsxs)(`div`,{className:`flex items-center gap-1.5 sm:gap-2 shrink-0`,children:[(0,M.jsxs)(`button`,{type:`button`,onClick:()=>i(!0),className:`px-2.5 py-1 bg-amber-100 hover:bg-amber-200 border-[2px] border-ink-black rounded font-bold text-[11px] text-ink-black cursor-pointer shadow-[1.5px_1.5px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none transition-all flex items-center gap-1.5`,title:`View Spire Journey Progress`,children:[(0,M.jsx)(C,{className:`w-3.5 h-3.5 text-indigo-700`}),(0,M.jsxs)(`span`,{className:`font-arcade text-[9px] text-indigo-950`,children:[e.currentFloor,`/150 LC`]})]}),(0,M.jsxs)(`button`,{type:`button`,onClick:()=>s(!0),className:`px-2.5 py-1 bg-white hover:bg-amber-50 border-[2px] border-ink-black rounded font-bold text-[11px] text-ink-black cursor-pointer shadow-[1.5px_1.5px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none transition-all flex items-center gap-1.5`,title:`Open Royal Satchel (Missives & Diary)`,children:[(0,M.jsx)(E,{className:`w-3.5 h-3.5 text-amber-700`}),(0,M.jsx)(`span`,{className:`hidden md:inline`,children:`Satchel`}),e.unlockedLetters.length>0&&(0,M.jsx)(`span`,{className:`w-4 h-4 rounded-full bg-amber-400 text-ink-black text-[9px] font-extrabold flex items-center justify-center border border-ink-black`,children:e.unlockedLetters.length})]}),(0,M.jsx)(`button`,{type:`button`,onClick:()=>u(!0),className:`p-1.5 bg-white hover:bg-slate-100 border-[2px] border-ink-black rounded text-ink-black cursor-pointer shadow-[1.5px_1.5px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none transition-all`,title:`View Transcript History`,children:(0,M.jsx)(T,{className:`w-3.5 h-3.5 text-slate-700`})}),(0,M.jsx)(`button`,{type:`button`,onClick:d,className:`p-1.5 border-[2px] border-ink-black rounded text-ink-black cursor-pointer shadow-[1.5px_1.5px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none transition-all ${t?`bg-slate-200 opacity-80`:`bg-[#FFE24C] hover:bg-yellow-300`}`,title:t?`Unmute Audio`:`Mute Audio`,children:t?(0,M.jsx)(f,{className:`w-3.5 h-3.5`}):(0,M.jsx)(a,{className:`w-3.5 h-3.5`})})]})]}),(0,M.jsxs)(`div`,{className:`flex-1 flex flex-col items-center justify-start gap-3 sm:gap-4 p-3 sm:p-5 overflow-y-auto custom-scrollbar min-h-0 relative`,children:[(0,M.jsx)(N,{emotion:e.activeEmotion,floor:e.currentFloor,rhythm:e.currentRhythm,activity:e.currentActivity,isLoading:e.isLoading}),(0,M.jsx)(P,{text:y?.text||`I believe in you, champion!`,characterName:e.companionSettings.name,emotion:e.activeEmotion,isLoading:e.isLoading,isStreaming:y?.isStreaming,toolCalls:y?.toolCalls,onTypingStatusChange:g})]}),(0,M.jsx)(I,{suggestions:y?.choiceSuggestions,isLoading:e.isLoading,onSendMessage:e=>S.sendMessage(e),placeholder:`Speak with ${e.companionSettings.name||`Princess Aurelia`}...`}),r&&(0,M.jsx)(L,{currentFloor:e.currentFloor,totalSolved:e.totalSolved,onClose:()=>i(!1)}),o&&(0,M.jsx)(R,{unlockedLetters:e.unlockedLetters,spireChronicles:e.spireChronicles,currentFloor:e.currentFloor,heroCodex:e.heroCodex,episodicEvents:e.episodicEvents,recentToolTelemetry:e.recentToolTelemetry,onRemoveCodexItem:S.removeCodexItem,onClose:()=>s(!1)}),l&&(0,M.jsx)(`div`,{className:`absolute inset-0 z-50 bg-ink-black/40 backdrop-blur-xs flex items-center justify-center p-3 sm:p-4 animate-in fade-in duration-200`,onClick:()=>u(!1),children:(0,M.jsxs)(`div`,{className:`bg-[#FFFDF0] border-[3px] border-ink-black rounded-xl max-w-lg w-full h-[80%] max-h-[520px] shadow-[6px_6px_0px_0px_#1E293B] flex flex-col overflow-hidden`,onClick:e=>e.stopPropagation(),children:[(0,M.jsxs)(`div`,{className:`bg-white border-b-[2px] border-ink-black px-4 py-2.5 flex items-center justify-between shrink-0`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,M.jsx)(T,{className:`w-4 h-4 text-ink-black`}),(0,M.jsxs)(`h4`,{className:`font-headline-md font-bold text-xs sm:text-sm text-ink-black m-0`,children:[`Dialogue Transcript (`,e.transcript.length,` turns)`]})]}),(0,M.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,M.jsxs)(`button`,{type:`button`,onClick:p,className:`p-1 hover:bg-rose-100 text-rose-700 rounded text-[11px] font-bold flex items-center gap-1 cursor-pointer mr-1`,title:`Clear Chat History`,children:[(0,M.jsx)(c,{className:`w-3.5 h-3.5`}),(0,M.jsx)(`span`,{children:`Clear`})]}),(0,M.jsx)(`button`,{type:`button`,onClick:()=>u(!1),className:`p-1 hover:bg-slate-200 rounded text-slate-700 cursor-pointer`,title:`Close`,children:(0,M.jsx)(b,{className:`w-4 h-4`})})]})]}),(0,M.jsx)(`div`,{className:`flex-1 p-3 sm:p-4 overflow-y-auto custom-scrollbar flex flex-col gap-2.5`,children:e.transcript.map((t,n)=>(0,M.jsxs)(`div`,{className:`p-2.5 rounded-lg border-[2px] border-ink-black shadow-[2px_2px_0px_0px_#1E293B] max-w-[90%] ${t.sender===`princess`?`bg-white text-ink-black self-start`:`bg-[#FFE24C] text-ink-black self-end`}`,children:[(0,M.jsx)(`div`,{className:`text-[10px] font-bold font-headline-md mb-1 text-slate-600`,children:t.sender===`princess`?e.companionSettings.name:`Hero`}),(0,M.jsx)(`p`,{className:`text-xs font-medium m-0 leading-relaxed whitespace-pre-wrap select-text`,children:t.text})]},t.id||n))})]})})]})}export{z as t};
|
algospaced-ui/dist/assets/{PythonChallenge-p08fHf5w.js → PythonChallenge-Bfcp7_2V.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{a as e,c as t,i as n,t as r}from"./jsx-runtime-j9uSgrFF.js";import"./index-
|
| 2 |
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
|
| 3 |
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
|
| 4 |
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
|
|
|
|
| 1 |
+
import{a as e,c as t,i as n,t as r}from"./jsx-runtime-j9uSgrFF.js";import"./index-g5jVBiGr.js";var i=t(e(),1),a=class e extends Error{constructor(t,n){var r=`KaTeX parse error: `+t,i,a,o=n&&n.loc;if(o&&o.start<=o.end){var s=o.lexer.input;i=o.start,a=o.end,i===s.length?r+=` at end of input: `:r+=` at position `+(i+1)+`: `;var c=s.slice(i,a).replace(/[^]/g,`$&̲`),l=i>15?`…`+s.slice(i-15,i):s.slice(0,i),u=a+15<s.length?s.slice(a,a+15)+`…`:s.slice(a);r+=l+c+u}super(r),this.name=`ParseError`,this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,e.prototype),this.position=i,i!=null&&a!=null&&(this.length=a-i),this.rawMessage=t}},o=/([A-Z])/g,s=e=>e.replace(o,`-$1`).toLowerCase(),c={"&":`&`,">":`>`,"<":`<`,'"':`"`,"'":`'`},l=/[&><"']/g,u=e=>String(e).replace(l,e=>c[e]),d=e=>e.type===`ordgroup`||e.type===`color`?e.body.length===1?d(e.body[0]):e:e.type===`font`?d(e.body):e,f=new Set([`mathord`,`textord`,`atom`]),p=e=>f.has(d(e).type),m=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return t?t[2]!==`:`||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():`_relative`},h={displayMode:{type:`boolean`,description:`Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.`,cli:`-d, --display-mode`},output:{type:{enum:[`htmlAndMathml`,`html`,`mathml`]},description:`Determines the markup language of the output.`,cli:`-F, --format <type>`},leqno:{type:`boolean`,description:`Render display math in leqno style (left-justified tags).`},fleqn:{type:`boolean`,description:`Render display math flush left.`},throwOnError:{type:`boolean`,default:!0,cli:`-t, --no-throw-on-error`,cliDescription:`Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error.`},errorColor:{type:`string`,default:`#cc0000`,cli:`-c, --error-color <color>`,cliDescription:`A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.`,cliProcessor:e=>`#`+e},macros:{type:`object`,cli:`-m, --macro <def>`,cliDescription:`Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).`,cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:`number`,description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:`--min-rule-thickness <size>`,cliProcessor:parseFloat},colorIsTextColor:{type:`boolean`,description:`Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.`,cli:`-b, --color-is-text-color`},strict:{type:[{enum:[`warn`,`ignore`,`error`]},`boolean`,`function`],description:`Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.`,cli:`-S, --strict`,cliDefault:!1},trust:{type:[`boolean`,`function`],description:`Trust the input, enabling all HTML features such as \\url.`,cli:`-T, --trust`},maxSize:{type:`number`,default:1/0,description:`If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large`,processor:e=>Math.max(0,e),cli:`-s, --max-size <n>`,cliProcessor:parseInt},maxExpand:{type:`number`,default:1e3,description:`Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.`,processor:e=>Math.max(0,e),cli:`-e, --max-expand <n>`,cliProcessor:e=>e===`Infinity`?1/0:parseInt(e)},globalGroup:{type:`boolean`,cli:!1}};function g(e){if(typeof e!=`string`)return e.enum[0];switch(e){case`boolean`:return!1;case`string`:return``;case`number`:return 0;case`object`:return{};default:throw Error(`Unexpected schema type; settings must declare an explicit default.`)}}function _(e){return Object.prototype.hasOwnProperty.call(e,`default`)&&e.default!==void 0?e.default:g(Array.isArray(e.type)?e.type[0]:e.type)}function v(e,t,n,r){var i=Object.prototype.hasOwnProperty.call(n,t)?n[t]:void 0,a=Object.prototype.hasOwnProperty.call(r,`processor`)?r.processor:void 0;e[t]=i===void 0?_(r):a?a(i):i}var y=class{constructor(e){e===void 0&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e||={};for(var t of Object.keys(h)){var n=h[t];n&&v(this,t,e,n)}}reportNonstrict(e,t,n){var r=this.strict;if(typeof r==`function`&&(r=r(e,t,n)),r&&r!==`ignore`){if(r===!0||r===`error`)throw new a(`LaTeX-incompatible input and strict mode is set to 'error': `+(t+` [`+e+`]`),n);r===`warn`?typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)):typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`))}}useStrictBehavior(e,t,n){var r=this.strict;if(typeof r==`function`)try{r=r(e,t,n)}catch{r=`error`}return!r||r===`ignore`?!1:r===!0||r===`error`?!0:r===`warn`?(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)),!1):(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`)),!1)}isTrusted(e){if(`url`in e&&e.url&&!e.protocol){var t=m(e.url);if(t==null)return!1;e.protocol=t}return!!(typeof this.trust==`function`?this.trust(e):this.trust)}},b=class{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return ne[re[this.id]]}sub(){return ne[ie[this.id]]}fracNum(){return ne[ae[this.id]]}fracDen(){return ne[oe[this.id]]}cramp(){return ne[se[this.id]]}text(){return ne[ce[this.id]]}isTight(){return this.size>=2}},x=0,S=1,C=2,w=3,ee=4,T=5,te=6,E=7,ne=[new b(x,0,!1),new b(S,0,!0),new b(C,1,!1),new b(w,1,!0),new b(ee,2,!1),new b(T,2,!0),new b(te,3,!1),new b(E,3,!0)],re=[ee,T,ee,T,te,E,te,E],ie=[T,T,T,T,E,E,E,E],ae=[C,w,ee,T,te,E,te,E],oe=[w,w,T,T,E,E,E,E],se=[S,S,w,w,T,T,E,E],ce=[x,S,C,w,C,w,C,w],D={DISPLAY:ne[x],TEXT:ne[C],SCRIPT:ne[ee],SCRIPTSCRIPT:ne[te]},le=[{name:`latin`,blocks:[[256,591],[768,879]]},{name:`cyrillic`,blocks:[[1024,1279]]},{name:`armenian`,blocks:[[1328,1423]]},{name:`brahmic`,blocks:[[2304,4255]]},{name:`georgian`,blocks:[[4256,4351]]},{name:`cjk`,blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:`hangul`,blocks:[[44032,55215]]}];function ue(e){for(var t=0;t<le.length;t++)for(var n=le[t],r=0;r<n.blocks.length;r++){var i=n.blocks[r];if(e>=i[0]&&e<=i[1])return n.name}return null}var de=[];le.forEach(e=>e.blocks.forEach(e=>de.push(...e)));function fe(e){for(var t=0;t<de.length;t+=2)if(e>=de[t]&&e<=de[t+1])return!0;return!1}var pe=e=>e+` `+e,me=80,he=function(e,t){return`M95,`+(622+e+t)+`
|
| 2 |
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
|
| 3 |
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
|
| 4 |
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
|
algospaced-ui/dist/assets/{ReviewQueue-BcOTw1g5.js → ReviewQueue-BCTxdw81.js}
RENAMED
|
The diff for this file is too large to render.
See raw diff
|
|
|
algospaced-ui/dist/assets/{Settings-CaYD0IIx.js → Settings-Cz_GHQn5.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{a as e,c as t,t as n}from"./jsx-runtime-j9uSgrFF.js";import{n as r,r as i,t as ee}from"./eye-BTMBNbc7.js";import{t as a}from"./external-link-mE9fgxrX.js";import{a as o,i as s,n as te,r as c,s as l,t as u,u as d}from"./githubSyncService-ComQdi-j.js";import{t as f}from"./info-DKabFp4k.js";import{t as p}from"./save-D2rY9s8j.js";import{A as m,C as h,D as ne,I as g,L as _,M as v,N as y,U as b,_ as x,d as S,f as C,k as w,m as T,p as E,u as D}from"./index-C7Gd5Mn4.js";var O=b(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),k=b(`key`,[[`path`,{d:`m2 21 9.6-9.6`,key:`9l79m3`}],[`path`,{d:`m7.5 15.5 2.3 2.3a1 1 0 0 1 0 1.4l-2.1 2.1a1 1 0 0 1-1.4 0L4 19`,key:`fw8biw`}],[`circle`,{cx:`15.5`,cy:`7.5`,r:`5.5`,key:`4wxmhb`}]]),A=t(e(),1),j=n(),M=[{id:`default`,name:`Default`,desc:`Subject to Availability`},{id:`groq`,name:`Groq`,badge:`Fastest`,desc:`Llama 3.3 & Qwen`,keyPrefix:`gsk_...`,portalUrl:`https://console.groq.com/keys`},{id:`gemini`,name:`Google Gemini`,desc:`Gemini 2.5 / 3.5`,keyPrefix:`AIzaSy...`,portalUrl:`https://aistudio.google.com/app/apikey`},{id:`openrouter`,name:`OpenRouter`,desc:`Multi-Provider`,keyPrefix:`sk-or-v1-...`,portalUrl:`https://openrouter.ai/keys`}];function N(){let[e,t]=(0,A.useState)(()=>localStorage.getItem(`algospaced_custom_ai_provider`)||`default`),[n,b]=(0,A.useState)(()=>localStorage.getItem(`algospaced_custom_api_key`)||localStorage.getItem(`sandbox_gemini_api_key`)||``),[N,re]=(0,A.useState)(!1),[P,F]=(0,A.useState)(null),[I,L]=(0,A.useState)(()=>D()),[R,z]=(0,A.useState)(null),[B,V]=(0,A.useState)(()=>S().currentFloor),[H,U]=(0,A.useState)(()=>c()),[W,G]=(0,A.useState)(()=>s()),[K,q]=(0,A.useState)(!1),[J,Y]=(0,A.useState)(null),X=!!(H.token&&(H.username||W?.login)),Z=!!(n.trim()&&e!=="default"),Q=e!=="default"&&!n.trim(),$=M.find(t=>t.id===e),ie=e=>{t(e),localStorage.setItem(`algospaced_custom_ai_provider`,e),F(e==="default"?{type:`info`,text:`Switched to Server Default (Shared Pool).`}:{type:`info`,text:`Switched to ${e.toUpperCase()}.`}),setTimeout(()=>F(null),3e3)},ae=()=>{let t=n.trim();if(!t){F({type:`error`,text:`Please enter an API key for ${e.toUpperCase()}.`}),setTimeout(()=>F(null),3e3);return}localStorage.setItem(`algospaced_custom_api_key`,t),localStorage.setItem(`sandbox_gemini_api_key`,t),localStorage.setItem(`algospaced_custom_ai_provider`,e),F({type:`success`,text:`${e.toUpperCase()} API key saved successfully.`}),setTimeout(()=>F(null),3e3)},oe=()=>{localStorage.removeItem(`algospaced_custom_api_key`),localStorage.removeItem(`sandbox_gemini_api_key`),b(``),F({type:`info`,text:`Cleared custom API key.`}),setTimeout(()=>F(null),3e3)},se=()=>{localStorage.removeItem(`algospaced_custom_api_key`),localStorage.removeItem(`sandbox_gemini_api_key`),localStorage.setItem(`algospaced_custom_ai_provider`,`default`),b(``),t(`default`),F({type:`info`,text:`Reset to Server Default provider.`}),setTimeout(()=>F(null),3e3)},ce=()=>{E(I),z({type:`success`,text:`Princess Companion settings saved!`}),setTimeout(()=>z(null),3e3)},le=()=>{L(T),E(T),z({type:`info`,text:`Reset companion to default settings.`}),setTimeout(()=>z(null),3e3)},ue=()=>{if(window.confirm(`Are you sure you want to reset your Spire Journey progress back to 0 problems?`)){let e=C();V(e.currentFloor),z({type:`info`,text:`Spire journey progress reset to 0 problems.`}),setTimeout(()=>z(null),3e3)}},de=async()=>{q(!0),Y(null);try{let{token:e,user:t}=await te();G(t);let n=c();U(n);try{await o(e,n.repoName,n.isPrivate)}catch{}Y({type:`success`,text:`Connected to GitHub as @${t.login}!`}),setTimeout(()=>Y(null),4e3)}catch(e){Y({type:`error`,text:e.message||`GitHub connection failed.`}),setTimeout(()=>Y(null),5e3)}finally{q(!1)}},fe=()=>{u(),U(c()),G(null),Y({type:`info`,text:`Disconnected from GitHub.`}),setTimeout(()=>Y(null),3e3)},pe=e=>{l({autoCommit:e}),U(t=>({...t,autoCommit:e})),Y({type:`info`,text:e?`Auto-commit enabled for review submissions.`:`Auto-commit disabled.`}),setTimeout(()=>Y(null),3e3)};return(0,j.jsxs)(`div`,{className:`w-full h-full bg-[#fdf8e1] p-5 sm:p-6 flex flex-col gap-4 select-none font-sans text-ink-black overflow-y-auto custom-scrollbar`,children:[(0,j.jsxs)(`div`,{className:`flex flex-col gap-0.5 border-b-[3px] border-ink-black pb-2.5`,children:[(0,j.jsxs)(`h3`,{className:`font-headline-md font-bold text-sm m-0 flex items-center gap-2 tracking-wide`,children:[(0,j.jsx)(k,{className:`w-4 h-4 text-ink-black`}),`API & AI Configuration`]}),(0,j.jsx)(`p`,{className:`text-[11px] text-trash-gray font-medium m-0`,children:`Configure your AI model provider..`})]}),(0,j.jsx)(`div`,{className:`px-4 py-3 border-[3px] border-ink-black shadow-[3px_3px_0px_0px_rgba(30,41,59,1)] transition-all ${Z?`bg-emerald-50`:Q?`bg-rose-50`:`bg-amber-50/70`}`,children:(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[Z?(0,j.jsx)(h,{className:`w-4 h-4 text-emerald-600 shrink-0`}):Q?(0,j.jsx)(i,{className:`w-4 h-4 text-rose-600 shrink-0`}):(0,j.jsx)(O,{className:`w-4 h-4 text-amber-600 shrink-0`}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`div`,{className:`text-xs font-bold font-headline-md text-ink-black flex items-center gap-1.5`,children:(0,j.jsxs)(`span`,{children:[`Active:`,` `,Z?`${e.toUpperCase()} (Custom Key)`:Q?`${e.toUpperCase()} (Key Required)`:`Default`]})}),(0,j.jsx)(`div`,{className:`text-[10px] text-trash-gray font-medium`,children:Z?`Requests are routed directly through your personal API key.`:Q?`Enter your API key below to activate this provider.`:`Using basic, free built-in developer keys with auto-failover.`})]})]}),(0,j.jsx)(`span`,{className:`px-2 py-0.5 text-[9px] font-bold font-arcade uppercase border-2 border-ink-black shrink-0 ${Z?`bg-emerald-300 text-emerald-950`:Q?`bg-rose-300 text-rose-950`:`bg-amber-200 text-amber-950`}`,children:Z?`ACTIVE`:Q?`NEEDS KEY`:`LIMITED`})]})}),(0,j.jsxs)(`div`,{className:`bg-white border-[3px] border-ink-black p-4 sm:p-5 shadow-[4px_4px_0px_0px_rgba(30,41,59,1)] flex flex-col gap-4`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsxs)(`label`,{className:`block text-xs font-bold text-ink-black uppercase tracking-wider mb-2 font-headline-md flex items-center gap-1.5`,children:[(0,j.jsx)(O,{className:`w-3.5 h-3.5 text-ink-black`}),`Select Provider`]}),(0,j.jsx)(`div`,{className:`grid grid-cols-2 sm:grid-cols-4 gap-2`,children:M.map(t=>{let n=e===t.id;return(0,j.jsxs)(`button`,{type:`button`,onClick:()=>ie(t.id),className:`p-2.5 border-[2px] text-left transition-all cursor-pointer flex flex-col justify-between rounded ${n?`border-ink-black bg-[#ffe24c] shadow-[2px_2px_0px_0px_#1E293B] font-bold`:`border-slate-300 bg-slate-50 hover:bg-slate-100 text-slate-700`}`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between w-full`,children:[(0,j.jsx)(`span`,{className:`text-xs font-bold font-headline-md`,children:t.name}),t.badge&&(0,j.jsx)(`span`,{className:`text-[8px] font-bold uppercase px-1 py-0.2 bg-orange-100 text-orange-700 rounded border border-orange-300`,children:t.badge})]}),(0,j.jsx)(`span`,{className:`text-[9px] mt-1 text-slate-600 leading-tight block`,children:t.desc})]},t.id)})})]}),e==="default"?(0,j.jsxs)(`div`,{className:`p-3.5 bg-slate-50 border border-slate-200 rounded flex items-start gap-3`,children:[(0,j.jsx)(ne,{className:`w-4 h-4 text-amber-500 shrink-0 mt-0.5`}),(0,j.jsxs)(`div`,{className:`flex flex-col gap-1 text-xs text-slate-700`,children:[(0,j.jsxs)(`span`,{className:`font-bold text-ink-black`,children:[`Shared Quotas (`,(0,j.jsx)(`i`,{children:`limited`}),`)`]}),(0,j.jsx)(`p`,{className:`text-[11px] text-trash-gray m-0 leading-relaxed`,children:`Powered by shared, basic developer keys. Because limits are shared with everyone, requests may fail. Use your own provider keys above for stable performance.`})]})]}):(0,j.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,j.jsxs)(`label`,{className:`block text-xs font-bold text-ink-black uppercase tracking-wider font-headline-md flex items-center gap-1.5`,children:[(0,j.jsx)(k,{className:`w-3.5 h-3.5 text-ink-black`}),$?.name,` API Key`]}),$?.portalUrl&&(0,j.jsxs)(`a`,{href:$.portalUrl,target:`_blank`,rel:`noopener noreferrer`,className:`text-[10px] text-sky-600 hover:text-sky-800 font-medium flex items-center gap-1 no-underline`,children:[(0,j.jsx)(`span`,{children:`Get API Key`}),(0,j.jsx)(a,{className:`w-3 h-3`})]})]}),(0,j.jsxs)(`div`,{className:`relative`,children:[(0,j.jsx)(`input`,{type:N?`text`:`password`,value:n,onChange:e=>b(e.target.value),placeholder:`Enter ${$?.keyPrefix||`API Key`}`,className:`w-full bg-white border-[2px] border-ink-black rounded py-2 pl-3 pr-9 text-ink-black placeholder-slate-400 focus:outline-none focus:border-sky-600 text-xs font-code-mono`}),(0,j.jsx)(`button`,{type:`button`,onClick:()=>re(!N),className:`absolute right-2.5 top-1/2 -translate-y-1/2 text-trash-gray hover:text-ink-black cursor-pointer bg-transparent border-0 outline-none p-1`,title:N?`Hide API key`:`Show API key`,children:N?(0,j.jsx)(r,{className:`w-3.5 h-3.5`}):(0,j.jsx)(ee,{className:`w-3.5 h-3.5`})})]}),(0,j.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[10px] text-trash-gray font-medium`,children:[(0,j.jsx)(m,{className:`w-3.5 h-3.5 text-emerald-600 shrink-0`}),(0,j.jsx)(`span`,{children:`Stored locally in your browser. Sent directly via request headers.`})]}),(0,j.jsxs)(`div`,{className:`flex gap-2 pt-1`,children:[(0,j.jsxs)(`button`,{onClick:ae,className:`flex-1 flex items-center justify-center gap-1.5 py-2 border-[2px] border-ink-black bg-[#ffe24c] hover:bg-yellow-300 text-xs font-bold text-ink-black shadow-[2px_2px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none transition-all cursor-pointer rounded uppercase`,children:[(0,j.jsx)(p,{className:`w-3.5 h-3.5`}),`Save Key`]}),n&&(0,j.jsx)(`button`,{onClick:oe,className:`px-3 py-2 border-[2px] border-slate-300 bg-white hover:bg-slate-50 text-xs font-bold text-slate-700 hover:text-rose-600 shadow-[2px_2px_0px_0px_rgba(0,0,0,0.05)] active:translate-y-0.5 active:shadow-none transition-all cursor-pointer rounded uppercase`,children:`Clear Key`})]})]}),P&&(0,j.jsxs)(`div`,{className:`p-2.5 border-[2px] border-ink-black text-xs font-medium rounded flex items-center gap-2 ${P.type===`success`?`bg-emerald-100 border-emerald-600 text-emerald-900`:P.type===`error`?`bg-rose-100 border-rose-600 text-rose-900`:`bg-sky-100 border-sky-600 text-sky-900`}`,children:[P.type===`success`?(0,j.jsx)(_,{className:`w-3.5 h-3.5 shrink-0`}):P.type===`error`?(0,j.jsx)(i,{className:`w-3.5 h-3.5 shrink-0`}):(0,j.jsx)(f,{className:`w-3.5 h-3.5 shrink-0`}),P.text]}),e!=="default"&&(0,j.jsx)(`div`,{className:`pt-2 border-t border-slate-200 flex justify-end`,children:(0,j.jsxs)(`button`,{onClick:se,className:`flex items-center gap-1.5 py-1.5 px-3 border border-slate-300 bg-slate-50 hover:bg-slate-100 text-[11px] font-bold text-slate-600 hover:text-ink-black transition-all cursor-pointer rounded`,children:[(0,j.jsx)(v,{className:`w-3 h-3 text-slate-500`}),`Reset to Server Default`]})})]}),(0,j.jsxs)(`div`,{className:`bg-white border-[3px] border-ink-black p-4 sm:p-5 shadow-[4px_4px_0px_0px_rgba(30,41,59,1)] flex flex-col gap-4`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between border-b-[2px] border-ink-black pb-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,j.jsx)(`div`,{className:`w-8 h-8 rounded bg-[#24292e] border-[2px] border-ink-black flex items-center justify-center text-white shadow-[1px_1px_0px_0px_#1E293B]`,children:(0,j.jsx)(d,{className:`w-4 h-4 text-white`})}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h4`,{className:`font-headline-md font-bold text-xs uppercase text-ink-black m-0 flex items-center gap-2`,children:`GitHub Solutions Sync & Auto-Commit`}),(0,j.jsx)(`p`,{className:`text-[10px] text-trash-gray font-medium m-0`,children:`Sync solutions to personal GitHub repository and commit automatically on submission`})]})]}),(0,j.jsx)(`span`,{className:`px-2 py-0.5 text-[9px] font-bold font-arcade uppercase border-2 border-ink-black shrink-0 ${X?`bg-emerald-300 text-emerald-950`:`bg-slate-200 text-slate-800`}`,children:X?`CONNECTED`:`DISCONNECTED`})]}),X?(0,j.jsxs)(`div`,{className:`space-y-3`,children:[(0,j.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center justify-between gap-2 p-3 bg-slate-50 border border-slate-200 rounded`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[W?.avatar_url&&(0,j.jsx)(`img`,{src:W.avatar_url,alt:W.login,className:`w-7 h-7 rounded-full border border-ink-black`}),(0,j.jsxs)(`div`,{children:[(0,j.jsxs)(`span`,{className:`text-xs font-bold text-ink-black`,children:[`@`,W?.login||H.username]}),(0,j.jsxs)(`span`,{className:`text-[11px] text-slate-600 font-mono block`,children:[H.username,`/`,H.repoName,` (`,H.branch,`)`]})]})]}),(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsxs)(`a`,{href:`https://github.com/${H.username}/${H.repoName}`,target:`_blank`,rel:`noopener noreferrer`,className:`px-2.5 py-1 text-[11px] font-bold bg-white hover:bg-slate-100 text-ink-black border border-slate-300 rounded no-underline flex items-center gap-1 cursor-pointer`,children:[(0,j.jsx)(a,{className:`w-3 h-3`}),(0,j.jsx)(`span`,{children:`View Repo`})]}),(0,j.jsx)(`button`,{type:`button`,onClick:fe,className:`px-2.5 py-1 text-[11px] font-bold bg-white hover:bg-rose-50 text-rose-700 border border-rose-300 rounded cursor-pointer`,children:`Disconnect`})]})]}),(0,j.jsxs)(`label`,{className:`flex items-center gap-2.5 p-2.5 bg-emerald-50/50 border border-emerald-300 rounded cursor-pointer`,children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:H.autoCommit,onChange:e=>pe(e.target.checked),className:`w-4 h-4 accent-emerald-600 cursor-pointer`}),(0,j.jsxs)(`div`,{className:`text-xs`,children:[(0,j.jsx)(`span`,{className:`font-bold text-ink-black block`,children:`Auto-commit on every submission`}),(0,j.jsxs)(`span`,{className:`text-[10px] text-trash-gray`,children:[`Automatically pushes your code to `,H.repoName,` whenever you grade a review card.`]})]})]})]}):(0,j.jsxs)(`div`,{className:`flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 p-3.5 bg-slate-50 border border-slate-200 rounded`,children:[(0,j.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,j.jsx)(`span`,{className:`text-xs font-bold text-ink-black block`,children:`Connect your GitHub Account (1-Click OAuth)`}),(0,j.jsx)(`p`,{className:`text-[11px] text-trash-gray m-0`,children:`Grant repository access to automatically sync your DSA problem solutions as you study.`})]}),(0,j.jsx)(`button`,{type:`button`,onClick:de,disabled:K,className:`px-4 py-2 bg-[#24292e] hover:bg-black text-white text-xs font-bold uppercase rounded border-2 border-ink-black shadow-[2px_2px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none flex items-center gap-2 shrink-0 cursor-pointer disabled:opacity-50`,children:K?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(y,{className:`w-3.5 h-3.5 animate-spin`}),(0,j.jsx)(`span`,{children:`CONNECTING...`})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(d,{className:`w-3.5 h-3.5 text-yellow-300`}),(0,j.jsx)(`span`,{children:`CONNECT GITHUB`})]})})]}),J&&(0,j.jsxs)(`div`,{className:`p-2.5 border-[2px] border-ink-black text-xs font-medium rounded flex items-center gap-2 ${J.type===`success`?`bg-emerald-100 border-emerald-600 text-emerald-900`:J.type===`error`?`bg-rose-100 border-rose-600 text-rose-900`:`bg-sky-100 border-sky-600 text-sky-900`}`,children:[J.type===`success`?(0,j.jsx)(_,{className:`w-3.5 h-3.5 shrink-0`}):J.type===`error`?(0,j.jsx)(i,{className:`w-3.5 h-3.5 shrink-0`}):(0,j.jsx)(f,{className:`w-3.5 h-3.5 shrink-0`}),J.text]})]}),(0,j.jsxs)(`div`,{className:`bg-[#FFFDF0] border-[3px] border-ink-black p-4 sm:p-5 shadow-[4px_4px_0px_0px_rgba(30,41,59,1)] flex flex-col gap-4`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between border-b-[2px] border-ink-black pb-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(`div`,{className:`w-7 h-7 rounded bg-[#FFE24C] border-[2px] border-ink-black flex items-center justify-center shadow-[1px_1px_0px_0px_#1E293B]`,children:(0,j.jsx)(w,{className:`w-4 h-4 text-ink-black`})}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h4`,{className:`font-headline-md font-bold text-xs uppercase text-ink-black m-0`,children:`Princess AI Companion & RPG Settings`}),(0,j.jsx)(`p`,{className:`text-[10px] text-trash-gray font-medium m-0`,children:`Trapped Princess Persona, Study Break Timer & 8-bit RPG Audio`})]})]}),(0,j.jsxs)(`label`,{className:`flex items-center gap-2 cursor-pointer`,children:[(0,j.jsx)(`span`,{className:`text-[11px] font-bold text-ink-black font-headline-md uppercase`,children:I.enabled?`Enabled`:`Disabled`}),(0,j.jsx)(`input`,{type:`checkbox`,checked:I.enabled,onChange:e=>L(t=>({...t,enabled:e.target.checked})),className:`w-4 h-4 accent-amber-500 cursor-pointer`})]})]}),(0,j.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-4`,children:[(0,j.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,j.jsx)(`label`,{className:`block text-xs font-bold text-ink-black uppercase tracking-wider font-headline-md`,children:`Companion Name`}),(0,j.jsx)(`input`,{type:`text`,value:I.name,onChange:e=>L(t=>({...t,name:e.target.value})),placeholder:`e.g. Princess Aurelia`,className:`bg-white border-[2px] border-ink-black rounded py-2 px-3 text-ink-black text-xs font-sans font-medium focus:outline-none focus:border-amber-600`})]}),(0,j.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,j.jsxs)(`label`,{className:`block text-xs font-bold text-ink-black uppercase tracking-wider font-headline-md flex items-center gap-1`,children:[(0,j.jsx)(g,{className:`w-3.5 h-3.5 text-amber-700`}),`Study Break Reminder`]}),(0,j.jsxs)(`select`,{value:I.breakIntervalMinutes,onChange:e=>L(t=>({...t,breakIntervalMinutes:Number(e.target.value)})),className:`bg-white border-[2px] border-ink-black rounded py-2 px-3 text-ink-black text-xs font-sans font-medium focus:outline-none focus:border-amber-600 cursor-pointer`,children:[(0,j.jsx)(`option`,{value:25,children:`Every 25 Minutes (Classic Pomodoro)`}),(0,j.jsx)(`option`,{value:45,children:`Every 45 Minutes`}),(0,j.jsx)(`option`,{value:60,children:`Every 60 Minutes`}),(0,j.jsx)(`option`,{value:0,children:`Disabled (No automatic break popups)`})]})]})]}),(0,j.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,j.jsx)(`label`,{className:`block text-xs font-bold text-ink-black uppercase tracking-wider font-headline-md`,children:`Princess Backstory & Persona Prompt`}),(0,j.jsx)(`textarea`,{rows:2,value:I.backstory,onChange:e=>L(t=>({...t,backstory:e.target.value})),placeholder:`Describe her background, tone, and connection to your DSA studies...`,className:`bg-white border-[2px] border-ink-black rounded p-2.5 text-ink-black text-xs font-sans font-medium focus:outline-none focus:border-amber-600 resize-y`})]}),(0,j.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-3 pt-1`,children:[(0,j.jsxs)(`label`,{className:`flex items-center gap-2.5 p-2.5 bg-white border border-slate-300 rounded cursor-pointer hover:border-ink-black transition-all`,children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:I.soundEnabled,onChange:e=>{let t=e.target.checked;L(e=>({...e,soundEnabled:t})),x(!t)},className:`w-4 h-4 accent-amber-500 cursor-pointer`}),(0,j.jsxs)(`div`,{className:`text-xs`,children:[(0,j.jsx)(`span`,{className:`font-bold text-ink-black block`,children:`8-bit Sound Effects`}),(0,j.jsx)(`span`,{className:`text-[10px] text-trash-gray`,children:`Typewriter blips, chimes & fanfare`})]})]}),(0,j.jsxs)(`label`,{className:`flex items-center gap-2.5 p-2.5 bg-white border border-slate-300 rounded cursor-pointer hover:border-ink-black transition-all`,children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:I.autoPopupEnabled,onChange:e=>L(t=>({...t,autoPopupEnabled:e.target.checked})),className:`w-4 h-4 accent-amber-500 cursor-pointer`}),(0,j.jsxs)(`div`,{className:`text-xs`,children:[(0,j.jsx)(`span`,{className:`font-bold text-ink-black block`,children:`Spontaneous RPG Popups`}),(0,j.jsx)(`span`,{className:`text-[10px] text-trash-gray`,children:`Speech bubbles for breaks & milestones`})]})]})]}),(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 pt-2 border-t border-slate-200`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsxs)(`button`,{type:`button`,onClick:ce,className:`flex items-center gap-1.5 py-2 px-4 border-[2px] border-ink-black bg-[#ffe24c] hover:bg-yellow-300 text-xs font-bold text-ink-black shadow-[2px_2px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none transition-all cursor-pointer rounded uppercase`,children:[(0,j.jsx)(p,{className:`w-3.5 h-3.5`}),`Save Companion Settings`]}),(0,j.jsx)(`button`,{type:`button`,onClick:le,className:`py-2 px-3 border border-slate-300 bg-white hover:bg-slate-50 text-xs font-bold text-slate-700 transition-all cursor-pointer rounded`,children:`Default Persona`})]}),(0,j.jsxs)(`button`,{type:`button`,onClick:ue,className:`flex items-center gap-1 py-1.5 px-3 border border-rose-300 bg-rose-50 hover:bg-rose-100 text-rose-700 text-[11px] font-bold transition-all cursor-pointer rounded`,children:[(0,j.jsx)(v,{className:`w-3 h-3 text-rose-500`}),(0,j.jsxs)(`span`,{children:[`Reset Journey (`,B,`/150 LC)`]})]})]}),R&&(0,j.jsxs)(`div`,{className:`p-2.5 border-[2px] border-ink-black text-xs font-medium rounded flex items-center gap-2 ${R.type===`success`?`bg-emerald-100 border-emerald-600 text-emerald-900`:`bg-sky-100 border-sky-600 text-sky-900`}`,children:[(0,j.jsx)(_,{className:`w-3.5 h-3.5 shrink-0`}),R.text]})]}),(0,j.jsxs)(`div`,{className:`bg-white border-[3px] border-ink-black p-4 shadow-[4px_4px_0px_0px_rgba(30,41,59,1)] flex flex-col gap-2.5`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,j.jsx)(f,{className:`w-3.5 h-3.5 text-[#0ea5e9]`}),(0,j.jsx)(`h4`,{className:`text-xs font-bold uppercase font-headline-md m-0`,children:`Get Free API Keys`})]}),(0,j.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-3 gap-2 text-[10px]`,children:[(0,j.jsxs)(`a`,{href:`https://console.groq.com/keys`,target:`_blank`,rel:`noopener noreferrer`,className:`p-2.5 border border-slate-200 hover:border-ink-black hover:bg-slate-50 rounded flex flex-col justify-between gap-1 transition-all no-underline text-inherit cursor-pointer`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between font-bold text-ink-black`,children:[(0,j.jsx)(`span`,{children:`Groq Cloud`}),(0,j.jsx)(a,{className:`w-3 h-3 text-slate-400`})]}),(0,j.jsx)(`p`,{className:`m-0 text-trash-gray leading-normal`,children:`Fast inference with generous free rate limits.`})]}),(0,j.jsxs)(`a`,{href:`https://aistudio.google.com/app/apikey`,target:`_blank`,rel:`noopener noreferrer`,className:`p-2.5 border border-slate-200 hover:border-ink-black hover:bg-slate-50 rounded flex flex-col justify-between gap-1 transition-all no-underline text-inherit cursor-pointer`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between font-bold text-ink-black`,children:[(0,j.jsx)(`span`,{children:`Google AI Studio`}),(0,j.jsx)(a,{className:`w-3 h-3 text-slate-400`})]}),(0,j.jsx)(`p`,{className:`m-0 text-trash-gray leading-normal`,children:`Free Gemini Flash API quota.`})]}),(0,j.jsxs)(`a`,{href:`https://openrouter.ai/keys`,target:`_blank`,rel:`noopener noreferrer`,className:`p-2.5 border border-slate-200 hover:border-ink-black hover:bg-slate-50 rounded flex flex-col justify-between gap-1 transition-all no-underline text-inherit cursor-pointer`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between font-bold text-ink-black`,children:[(0,j.jsx)(`span`,{children:`OpenRouter`}),(0,j.jsx)(a,{className:`w-3 h-3 text-slate-400`})]}),(0,j.jsx)(`p`,{className:`m-0 text-trash-gray leading-normal`,children:`Unified API for open-weights models.`})]})]})]})]})}export{N as default};
|
|
|
|
| 1 |
+
import{a as e,c as t,t as n}from"./jsx-runtime-j9uSgrFF.js";import{n as r,r as i,t as ee}from"./eye-DeJ_5v51.js";import{t as a}from"./external-link-yb1gedrc.js";import{a as o,i as s,n as te,r as c,s as l,t as u,u as d}from"./githubSyncService--4Z5jmjP.js";import{t as f}from"./info-CU16dSEt.js";import{t as p}from"./save-CdpRk537.js";import{A as m,C as h,D as ne,I as g,L as _,M as v,N as y,U as b,_ as x,d as S,f as C,k as w,m as T,p as E,u as D}from"./index-g5jVBiGr.js";var O=b(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),k=b(`key`,[[`path`,{d:`m2 21 9.6-9.6`,key:`9l79m3`}],[`path`,{d:`m7.5 15.5 2.3 2.3a1 1 0 0 1 0 1.4l-2.1 2.1a1 1 0 0 1-1.4 0L4 19`,key:`fw8biw`}],[`circle`,{cx:`15.5`,cy:`7.5`,r:`5.5`,key:`4wxmhb`}]]),A=t(e(),1),j=n(),M=[{id:`default`,name:`Default`,desc:`Subject to Availability`},{id:`groq`,name:`Groq`,badge:`Fastest`,desc:`Llama 3.3 & Qwen`,keyPrefix:`gsk_...`,portalUrl:`https://console.groq.com/keys`},{id:`gemini`,name:`Google Gemini`,desc:`Gemini 2.5 / 3.5`,keyPrefix:`AIzaSy...`,portalUrl:`https://aistudio.google.com/app/apikey`},{id:`openrouter`,name:`OpenRouter`,desc:`Multi-Provider`,keyPrefix:`sk-or-v1-...`,portalUrl:`https://openrouter.ai/keys`}];function N(){let[e,t]=(0,A.useState)(()=>localStorage.getItem(`algospaced_custom_ai_provider`)||`default`),[n,b]=(0,A.useState)(()=>localStorage.getItem(`algospaced_custom_api_key`)||localStorage.getItem(`sandbox_gemini_api_key`)||``),[N,re]=(0,A.useState)(!1),[P,F]=(0,A.useState)(null),[I,L]=(0,A.useState)(()=>D()),[R,z]=(0,A.useState)(null),[B,V]=(0,A.useState)(()=>S().currentFloor),[H,U]=(0,A.useState)(()=>c()),[W,G]=(0,A.useState)(()=>s()),[K,q]=(0,A.useState)(!1),[J,Y]=(0,A.useState)(null),X=!!(H.token&&(H.username||W?.login)),Z=!!(n.trim()&&e!=="default"),Q=e!=="default"&&!n.trim(),$=M.find(t=>t.id===e),ie=e=>{t(e),localStorage.setItem(`algospaced_custom_ai_provider`,e),F(e==="default"?{type:`info`,text:`Switched to Server Default (Shared Pool).`}:{type:`info`,text:`Switched to ${e.toUpperCase()}.`}),setTimeout(()=>F(null),3e3)},ae=()=>{let t=n.trim();if(!t){F({type:`error`,text:`Please enter an API key for ${e.toUpperCase()}.`}),setTimeout(()=>F(null),3e3);return}localStorage.setItem(`algospaced_custom_api_key`,t),localStorage.setItem(`sandbox_gemini_api_key`,t),localStorage.setItem(`algospaced_custom_ai_provider`,e),F({type:`success`,text:`${e.toUpperCase()} API key saved successfully.`}),setTimeout(()=>F(null),3e3)},oe=()=>{localStorage.removeItem(`algospaced_custom_api_key`),localStorage.removeItem(`sandbox_gemini_api_key`),b(``),F({type:`info`,text:`Cleared custom API key.`}),setTimeout(()=>F(null),3e3)},se=()=>{localStorage.removeItem(`algospaced_custom_api_key`),localStorage.removeItem(`sandbox_gemini_api_key`),localStorage.setItem(`algospaced_custom_ai_provider`,`default`),b(``),t(`default`),F({type:`info`,text:`Reset to Server Default provider.`}),setTimeout(()=>F(null),3e3)},ce=()=>{E(I),z({type:`success`,text:`Princess Companion settings saved!`}),setTimeout(()=>z(null),3e3)},le=()=>{L(T),E(T),z({type:`info`,text:`Reset companion to default settings.`}),setTimeout(()=>z(null),3e3)},ue=()=>{if(window.confirm(`Are you sure you want to reset your Spire Journey progress back to 0 problems?`)){let e=C();V(e.currentFloor),z({type:`info`,text:`Spire journey progress reset to 0 problems.`}),setTimeout(()=>z(null),3e3)}},de=async()=>{q(!0),Y(null);try{let{token:e,user:t}=await te();G(t);let n=c();U(n);try{await o(e,n.repoName,n.isPrivate)}catch{}Y({type:`success`,text:`Connected to GitHub as @${t.login}!`}),setTimeout(()=>Y(null),4e3)}catch(e){Y({type:`error`,text:e.message||`GitHub connection failed.`}),setTimeout(()=>Y(null),5e3)}finally{q(!1)}},fe=()=>{u(),U(c()),G(null),Y({type:`info`,text:`Disconnected from GitHub.`}),setTimeout(()=>Y(null),3e3)},pe=e=>{l({autoCommit:e}),U(t=>({...t,autoCommit:e})),Y({type:`info`,text:e?`Auto-commit enabled for review submissions.`:`Auto-commit disabled.`}),setTimeout(()=>Y(null),3e3)};return(0,j.jsxs)(`div`,{className:`w-full h-full bg-[#fdf8e1] p-5 sm:p-6 flex flex-col gap-4 select-none font-sans text-ink-black overflow-y-auto custom-scrollbar`,children:[(0,j.jsxs)(`div`,{className:`flex flex-col gap-0.5 border-b-[3px] border-ink-black pb-2.5`,children:[(0,j.jsxs)(`h3`,{className:`font-headline-md font-bold text-sm m-0 flex items-center gap-2 tracking-wide`,children:[(0,j.jsx)(k,{className:`w-4 h-4 text-ink-black`}),`API & AI Configuration`]}),(0,j.jsx)(`p`,{className:`text-[11px] text-trash-gray font-medium m-0`,children:`Configure your AI model provider..`})]}),(0,j.jsx)(`div`,{className:`px-4 py-3 border-[3px] border-ink-black shadow-[3px_3px_0px_0px_rgba(30,41,59,1)] transition-all ${Z?`bg-emerald-50`:Q?`bg-rose-50`:`bg-amber-50/70`}`,children:(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[Z?(0,j.jsx)(h,{className:`w-4 h-4 text-emerald-600 shrink-0`}):Q?(0,j.jsx)(i,{className:`w-4 h-4 text-rose-600 shrink-0`}):(0,j.jsx)(O,{className:`w-4 h-4 text-amber-600 shrink-0`}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`div`,{className:`text-xs font-bold font-headline-md text-ink-black flex items-center gap-1.5`,children:(0,j.jsxs)(`span`,{children:[`Active:`,` `,Z?`${e.toUpperCase()} (Custom Key)`:Q?`${e.toUpperCase()} (Key Required)`:`Default`]})}),(0,j.jsx)(`div`,{className:`text-[10px] text-trash-gray font-medium`,children:Z?`Requests are routed directly through your personal API key.`:Q?`Enter your API key below to activate this provider.`:`Using basic, free built-in developer keys with auto-failover.`})]})]}),(0,j.jsx)(`span`,{className:`px-2 py-0.5 text-[9px] font-bold font-arcade uppercase border-2 border-ink-black shrink-0 ${Z?`bg-emerald-300 text-emerald-950`:Q?`bg-rose-300 text-rose-950`:`bg-amber-200 text-amber-950`}`,children:Z?`ACTIVE`:Q?`NEEDS KEY`:`LIMITED`})]})}),(0,j.jsxs)(`div`,{className:`bg-white border-[3px] border-ink-black p-4 sm:p-5 shadow-[4px_4px_0px_0px_rgba(30,41,59,1)] flex flex-col gap-4`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsxs)(`label`,{className:`block text-xs font-bold text-ink-black uppercase tracking-wider mb-2 font-headline-md flex items-center gap-1.5`,children:[(0,j.jsx)(O,{className:`w-3.5 h-3.5 text-ink-black`}),`Select Provider`]}),(0,j.jsx)(`div`,{className:`grid grid-cols-2 sm:grid-cols-4 gap-2`,children:M.map(t=>{let n=e===t.id;return(0,j.jsxs)(`button`,{type:`button`,onClick:()=>ie(t.id),className:`p-2.5 border-[2px] text-left transition-all cursor-pointer flex flex-col justify-between rounded ${n?`border-ink-black bg-[#ffe24c] shadow-[2px_2px_0px_0px_#1E293B] font-bold`:`border-slate-300 bg-slate-50 hover:bg-slate-100 text-slate-700`}`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between w-full`,children:[(0,j.jsx)(`span`,{className:`text-xs font-bold font-headline-md`,children:t.name}),t.badge&&(0,j.jsx)(`span`,{className:`text-[8px] font-bold uppercase px-1 py-0.2 bg-orange-100 text-orange-700 rounded border border-orange-300`,children:t.badge})]}),(0,j.jsx)(`span`,{className:`text-[9px] mt-1 text-slate-600 leading-tight block`,children:t.desc})]},t.id)})})]}),e==="default"?(0,j.jsxs)(`div`,{className:`p-3.5 bg-slate-50 border border-slate-200 rounded flex items-start gap-3`,children:[(0,j.jsx)(ne,{className:`w-4 h-4 text-amber-500 shrink-0 mt-0.5`}),(0,j.jsxs)(`div`,{className:`flex flex-col gap-1 text-xs text-slate-700`,children:[(0,j.jsxs)(`span`,{className:`font-bold text-ink-black`,children:[`Shared Quotas (`,(0,j.jsx)(`i`,{children:`limited`}),`)`]}),(0,j.jsx)(`p`,{className:`text-[11px] text-trash-gray m-0 leading-relaxed`,children:`Powered by shared, basic developer keys. Because limits are shared with everyone, requests may fail. Use your own provider keys above for stable performance.`})]})]}):(0,j.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,j.jsxs)(`label`,{className:`block text-xs font-bold text-ink-black uppercase tracking-wider font-headline-md flex items-center gap-1.5`,children:[(0,j.jsx)(k,{className:`w-3.5 h-3.5 text-ink-black`}),$?.name,` API Key`]}),$?.portalUrl&&(0,j.jsxs)(`a`,{href:$.portalUrl,target:`_blank`,rel:`noopener noreferrer`,className:`text-[10px] text-sky-600 hover:text-sky-800 font-medium flex items-center gap-1 no-underline`,children:[(0,j.jsx)(`span`,{children:`Get API Key`}),(0,j.jsx)(a,{className:`w-3 h-3`})]})]}),(0,j.jsxs)(`div`,{className:`relative`,children:[(0,j.jsx)(`input`,{type:N?`text`:`password`,value:n,onChange:e=>b(e.target.value),placeholder:`Enter ${$?.keyPrefix||`API Key`}`,className:`w-full bg-white border-[2px] border-ink-black rounded py-2 pl-3 pr-9 text-ink-black placeholder-slate-400 focus:outline-none focus:border-sky-600 text-xs font-code-mono`}),(0,j.jsx)(`button`,{type:`button`,onClick:()=>re(!N),className:`absolute right-2.5 top-1/2 -translate-y-1/2 text-trash-gray hover:text-ink-black cursor-pointer bg-transparent border-0 outline-none p-1`,title:N?`Hide API key`:`Show API key`,children:N?(0,j.jsx)(r,{className:`w-3.5 h-3.5`}):(0,j.jsx)(ee,{className:`w-3.5 h-3.5`})})]}),(0,j.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[10px] text-trash-gray font-medium`,children:[(0,j.jsx)(m,{className:`w-3.5 h-3.5 text-emerald-600 shrink-0`}),(0,j.jsx)(`span`,{children:`Stored locally in your browser. Sent directly via request headers.`})]}),(0,j.jsxs)(`div`,{className:`flex gap-2 pt-1`,children:[(0,j.jsxs)(`button`,{onClick:ae,className:`flex-1 flex items-center justify-center gap-1.5 py-2 border-[2px] border-ink-black bg-[#ffe24c] hover:bg-yellow-300 text-xs font-bold text-ink-black shadow-[2px_2px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none transition-all cursor-pointer rounded uppercase`,children:[(0,j.jsx)(p,{className:`w-3.5 h-3.5`}),`Save Key`]}),n&&(0,j.jsx)(`button`,{onClick:oe,className:`px-3 py-2 border-[2px] border-slate-300 bg-white hover:bg-slate-50 text-xs font-bold text-slate-700 hover:text-rose-600 shadow-[2px_2px_0px_0px_rgba(0,0,0,0.05)] active:translate-y-0.5 active:shadow-none transition-all cursor-pointer rounded uppercase`,children:`Clear Key`})]})]}),P&&(0,j.jsxs)(`div`,{className:`p-2.5 border-[2px] border-ink-black text-xs font-medium rounded flex items-center gap-2 ${P.type===`success`?`bg-emerald-100 border-emerald-600 text-emerald-900`:P.type===`error`?`bg-rose-100 border-rose-600 text-rose-900`:`bg-sky-100 border-sky-600 text-sky-900`}`,children:[P.type===`success`?(0,j.jsx)(_,{className:`w-3.5 h-3.5 shrink-0`}):P.type===`error`?(0,j.jsx)(i,{className:`w-3.5 h-3.5 shrink-0`}):(0,j.jsx)(f,{className:`w-3.5 h-3.5 shrink-0`}),P.text]}),e!=="default"&&(0,j.jsx)(`div`,{className:`pt-2 border-t border-slate-200 flex justify-end`,children:(0,j.jsxs)(`button`,{onClick:se,className:`flex items-center gap-1.5 py-1.5 px-3 border border-slate-300 bg-slate-50 hover:bg-slate-100 text-[11px] font-bold text-slate-600 hover:text-ink-black transition-all cursor-pointer rounded`,children:[(0,j.jsx)(v,{className:`w-3 h-3 text-slate-500`}),`Reset to Server Default`]})})]}),(0,j.jsxs)(`div`,{className:`bg-white border-[3px] border-ink-black p-4 sm:p-5 shadow-[4px_4px_0px_0px_rgba(30,41,59,1)] flex flex-col gap-4`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between border-b-[2px] border-ink-black pb-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,j.jsx)(`div`,{className:`w-8 h-8 rounded bg-[#24292e] border-[2px] border-ink-black flex items-center justify-center text-white shadow-[1px_1px_0px_0px_#1E293B]`,children:(0,j.jsx)(d,{className:`w-4 h-4 text-white`})}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h4`,{className:`font-headline-md font-bold text-xs uppercase text-ink-black m-0 flex items-center gap-2`,children:`GitHub Solutions Sync & Auto-Commit`}),(0,j.jsx)(`p`,{className:`text-[10px] text-trash-gray font-medium m-0`,children:`Sync solutions to personal GitHub repository and commit automatically on submission`})]})]}),(0,j.jsx)(`span`,{className:`px-2 py-0.5 text-[9px] font-bold font-arcade uppercase border-2 border-ink-black shrink-0 ${X?`bg-emerald-300 text-emerald-950`:`bg-slate-200 text-slate-800`}`,children:X?`CONNECTED`:`DISCONNECTED`})]}),X?(0,j.jsxs)(`div`,{className:`space-y-3`,children:[(0,j.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center justify-between gap-2 p-3 bg-slate-50 border border-slate-200 rounded`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[W?.avatar_url&&(0,j.jsx)(`img`,{src:W.avatar_url,alt:W.login,className:`w-7 h-7 rounded-full border border-ink-black`}),(0,j.jsxs)(`div`,{children:[(0,j.jsxs)(`span`,{className:`text-xs font-bold text-ink-black`,children:[`@`,W?.login||H.username]}),(0,j.jsxs)(`span`,{className:`text-[11px] text-slate-600 font-mono block`,children:[H.username,`/`,H.repoName,` (`,H.branch,`)`]})]})]}),(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsxs)(`a`,{href:`https://github.com/${H.username}/${H.repoName}`,target:`_blank`,rel:`noopener noreferrer`,className:`px-2.5 py-1 text-[11px] font-bold bg-white hover:bg-slate-100 text-ink-black border border-slate-300 rounded no-underline flex items-center gap-1 cursor-pointer`,children:[(0,j.jsx)(a,{className:`w-3 h-3`}),(0,j.jsx)(`span`,{children:`View Repo`})]}),(0,j.jsx)(`button`,{type:`button`,onClick:fe,className:`px-2.5 py-1 text-[11px] font-bold bg-white hover:bg-rose-50 text-rose-700 border border-rose-300 rounded cursor-pointer`,children:`Disconnect`})]})]}),(0,j.jsxs)(`label`,{className:`flex items-center gap-2.5 p-2.5 bg-emerald-50/50 border border-emerald-300 rounded cursor-pointer`,children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:H.autoCommit,onChange:e=>pe(e.target.checked),className:`w-4 h-4 accent-emerald-600 cursor-pointer`}),(0,j.jsxs)(`div`,{className:`text-xs`,children:[(0,j.jsx)(`span`,{className:`font-bold text-ink-black block`,children:`Auto-commit on every submission`}),(0,j.jsxs)(`span`,{className:`text-[10px] text-trash-gray`,children:[`Automatically pushes your code to `,H.repoName,` whenever you grade a review card.`]})]})]})]}):(0,j.jsxs)(`div`,{className:`flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 p-3.5 bg-slate-50 border border-slate-200 rounded`,children:[(0,j.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,j.jsx)(`span`,{className:`text-xs font-bold text-ink-black block`,children:`Connect your GitHub Account (1-Click OAuth)`}),(0,j.jsx)(`p`,{className:`text-[11px] text-trash-gray m-0`,children:`Grant repository access to automatically sync your DSA problem solutions as you study.`})]}),(0,j.jsx)(`button`,{type:`button`,onClick:de,disabled:K,className:`px-4 py-2 bg-[#24292e] hover:bg-black text-white text-xs font-bold uppercase rounded border-2 border-ink-black shadow-[2px_2px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none flex items-center gap-2 shrink-0 cursor-pointer disabled:opacity-50`,children:K?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(y,{className:`w-3.5 h-3.5 animate-spin`}),(0,j.jsx)(`span`,{children:`CONNECTING...`})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(d,{className:`w-3.5 h-3.5 text-yellow-300`}),(0,j.jsx)(`span`,{children:`CONNECT GITHUB`})]})})]}),J&&(0,j.jsxs)(`div`,{className:`p-2.5 border-[2px] border-ink-black text-xs font-medium rounded flex items-center gap-2 ${J.type===`success`?`bg-emerald-100 border-emerald-600 text-emerald-900`:J.type===`error`?`bg-rose-100 border-rose-600 text-rose-900`:`bg-sky-100 border-sky-600 text-sky-900`}`,children:[J.type===`success`?(0,j.jsx)(_,{className:`w-3.5 h-3.5 shrink-0`}):J.type===`error`?(0,j.jsx)(i,{className:`w-3.5 h-3.5 shrink-0`}):(0,j.jsx)(f,{className:`w-3.5 h-3.5 shrink-0`}),J.text]})]}),(0,j.jsxs)(`div`,{className:`bg-[#FFFDF0] border-[3px] border-ink-black p-4 sm:p-5 shadow-[4px_4px_0px_0px_rgba(30,41,59,1)] flex flex-col gap-4`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between border-b-[2px] border-ink-black pb-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(`div`,{className:`w-7 h-7 rounded bg-[#FFE24C] border-[2px] border-ink-black flex items-center justify-center shadow-[1px_1px_0px_0px_#1E293B]`,children:(0,j.jsx)(w,{className:`w-4 h-4 text-ink-black`})}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h4`,{className:`font-headline-md font-bold text-xs uppercase text-ink-black m-0`,children:`Princess AI Companion & RPG Settings`}),(0,j.jsx)(`p`,{className:`text-[10px] text-trash-gray font-medium m-0`,children:`Trapped Princess Persona, Study Break Timer & 8-bit RPG Audio`})]})]}),(0,j.jsxs)(`label`,{className:`flex items-center gap-2 cursor-pointer`,children:[(0,j.jsx)(`span`,{className:`text-[11px] font-bold text-ink-black font-headline-md uppercase`,children:I.enabled?`Enabled`:`Disabled`}),(0,j.jsx)(`input`,{type:`checkbox`,checked:I.enabled,onChange:e=>L(t=>({...t,enabled:e.target.checked})),className:`w-4 h-4 accent-amber-500 cursor-pointer`})]})]}),(0,j.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-4`,children:[(0,j.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,j.jsx)(`label`,{className:`block text-xs font-bold text-ink-black uppercase tracking-wider font-headline-md`,children:`Companion Name`}),(0,j.jsx)(`input`,{type:`text`,value:I.name,onChange:e=>L(t=>({...t,name:e.target.value})),placeholder:`e.g. Princess Aurelia`,className:`bg-white border-[2px] border-ink-black rounded py-2 px-3 text-ink-black text-xs font-sans font-medium focus:outline-none focus:border-amber-600`})]}),(0,j.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,j.jsxs)(`label`,{className:`block text-xs font-bold text-ink-black uppercase tracking-wider font-headline-md flex items-center gap-1`,children:[(0,j.jsx)(g,{className:`w-3.5 h-3.5 text-amber-700`}),`Study Break Reminder`]}),(0,j.jsxs)(`select`,{value:I.breakIntervalMinutes,onChange:e=>L(t=>({...t,breakIntervalMinutes:Number(e.target.value)})),className:`bg-white border-[2px] border-ink-black rounded py-2 px-3 text-ink-black text-xs font-sans font-medium focus:outline-none focus:border-amber-600 cursor-pointer`,children:[(0,j.jsx)(`option`,{value:25,children:`Every 25 Minutes (Classic Pomodoro)`}),(0,j.jsx)(`option`,{value:45,children:`Every 45 Minutes`}),(0,j.jsx)(`option`,{value:60,children:`Every 60 Minutes`}),(0,j.jsx)(`option`,{value:0,children:`Disabled (No automatic break popups)`})]})]})]}),(0,j.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,j.jsx)(`label`,{className:`block text-xs font-bold text-ink-black uppercase tracking-wider font-headline-md`,children:`Princess Backstory & Persona Prompt`}),(0,j.jsx)(`textarea`,{rows:2,value:I.backstory,onChange:e=>L(t=>({...t,backstory:e.target.value})),placeholder:`Describe her background, tone, and connection to your DSA studies...`,className:`bg-white border-[2px] border-ink-black rounded p-2.5 text-ink-black text-xs font-sans font-medium focus:outline-none focus:border-amber-600 resize-y`})]}),(0,j.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-3 pt-1`,children:[(0,j.jsxs)(`label`,{className:`flex items-center gap-2.5 p-2.5 bg-white border border-slate-300 rounded cursor-pointer hover:border-ink-black transition-all`,children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:I.soundEnabled,onChange:e=>{let t=e.target.checked;L(e=>({...e,soundEnabled:t})),x(!t)},className:`w-4 h-4 accent-amber-500 cursor-pointer`}),(0,j.jsxs)(`div`,{className:`text-xs`,children:[(0,j.jsx)(`span`,{className:`font-bold text-ink-black block`,children:`8-bit Sound Effects`}),(0,j.jsx)(`span`,{className:`text-[10px] text-trash-gray`,children:`Typewriter blips, chimes & fanfare`})]})]}),(0,j.jsxs)(`label`,{className:`flex items-center gap-2.5 p-2.5 bg-white border border-slate-300 rounded cursor-pointer hover:border-ink-black transition-all`,children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:I.autoPopupEnabled,onChange:e=>L(t=>({...t,autoPopupEnabled:e.target.checked})),className:`w-4 h-4 accent-amber-500 cursor-pointer`}),(0,j.jsxs)(`div`,{className:`text-xs`,children:[(0,j.jsx)(`span`,{className:`font-bold text-ink-black block`,children:`Spontaneous RPG Popups`}),(0,j.jsx)(`span`,{className:`text-[10px] text-trash-gray`,children:`Speech bubbles for breaks & milestones`})]})]})]}),(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 pt-2 border-t border-slate-200`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsxs)(`button`,{type:`button`,onClick:ce,className:`flex items-center gap-1.5 py-2 px-4 border-[2px] border-ink-black bg-[#ffe24c] hover:bg-yellow-300 text-xs font-bold text-ink-black shadow-[2px_2px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none transition-all cursor-pointer rounded uppercase`,children:[(0,j.jsx)(p,{className:`w-3.5 h-3.5`}),`Save Companion Settings`]}),(0,j.jsx)(`button`,{type:`button`,onClick:le,className:`py-2 px-3 border border-slate-300 bg-white hover:bg-slate-50 text-xs font-bold text-slate-700 transition-all cursor-pointer rounded`,children:`Default Persona`})]}),(0,j.jsxs)(`button`,{type:`button`,onClick:ue,className:`flex items-center gap-1 py-1.5 px-3 border border-rose-300 bg-rose-50 hover:bg-rose-100 text-rose-700 text-[11px] font-bold transition-all cursor-pointer rounded`,children:[(0,j.jsx)(v,{className:`w-3 h-3 text-rose-500`}),(0,j.jsxs)(`span`,{children:[`Reset Journey (`,B,`/150 LC)`]})]})]}),R&&(0,j.jsxs)(`div`,{className:`p-2.5 border-[2px] border-ink-black text-xs font-medium rounded flex items-center gap-2 ${R.type===`success`?`bg-emerald-100 border-emerald-600 text-emerald-900`:`bg-sky-100 border-sky-600 text-sky-900`}`,children:[(0,j.jsx)(_,{className:`w-3.5 h-3.5 shrink-0`}),R.text]})]}),(0,j.jsxs)(`div`,{className:`bg-white border-[3px] border-ink-black p-4 shadow-[4px_4px_0px_0px_rgba(30,41,59,1)] flex flex-col gap-2.5`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,j.jsx)(f,{className:`w-3.5 h-3.5 text-[#0ea5e9]`}),(0,j.jsx)(`h4`,{className:`text-xs font-bold uppercase font-headline-md m-0`,children:`Get Free API Keys`})]}),(0,j.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-3 gap-2 text-[10px]`,children:[(0,j.jsxs)(`a`,{href:`https://console.groq.com/keys`,target:`_blank`,rel:`noopener noreferrer`,className:`p-2.5 border border-slate-200 hover:border-ink-black hover:bg-slate-50 rounded flex flex-col justify-between gap-1 transition-all no-underline text-inherit cursor-pointer`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between font-bold text-ink-black`,children:[(0,j.jsx)(`span`,{children:`Groq Cloud`}),(0,j.jsx)(a,{className:`w-3 h-3 text-slate-400`})]}),(0,j.jsx)(`p`,{className:`m-0 text-trash-gray leading-normal`,children:`Fast inference with generous free rate limits.`})]}),(0,j.jsxs)(`a`,{href:`https://aistudio.google.com/app/apikey`,target:`_blank`,rel:`noopener noreferrer`,className:`p-2.5 border border-slate-200 hover:border-ink-black hover:bg-slate-50 rounded flex flex-col justify-between gap-1 transition-all no-underline text-inherit cursor-pointer`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between font-bold text-ink-black`,children:[(0,j.jsx)(`span`,{children:`Google AI Studio`}),(0,j.jsx)(a,{className:`w-3 h-3 text-slate-400`})]}),(0,j.jsx)(`p`,{className:`m-0 text-trash-gray leading-normal`,children:`Free Gemini Flash API quota.`})]}),(0,j.jsxs)(`a`,{href:`https://openrouter.ai/keys`,target:`_blank`,rel:`noopener noreferrer`,className:`p-2.5 border border-slate-200 hover:border-ink-black hover:bg-slate-50 rounded flex flex-col justify-between gap-1 transition-all no-underline text-inherit cursor-pointer`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between font-bold text-ink-black`,children:[(0,j.jsx)(`span`,{children:`OpenRouter`}),(0,j.jsx)(a,{className:`w-3 h-3 text-slate-400`})]}),(0,j.jsx)(`p`,{className:`m-0 text-trash-gray leading-normal`,children:`Unified API for open-weights models.`})]})]})]})]})}export{N as default};
|
algospaced-ui/dist/assets/{confetti.module-DRqH0UE1.js → confetti.module-BEqdENp8.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
| 1 |
-
import{U as e}from"./index-
|
| 2 |
`);try{t=new Worker(URL.createObjectURL(new Blob([n])))}catch(e){return typeof console<`u`&&typeof console.warn==`function`&&console.warn(`🎊 Could not load worker`,e),null}o(t)}return t}})(),p={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:[`square`,`circle`],zIndex:100,colors:[`#26ccff`,`#a25afd`,`#ff5e7e`,`#88ff5a`,`#fcff42`,`#ffa62d`,`#ff36ff`],disableForReducedMotion:!1,scalar:1};function m(e,t){return t?t(e):e}function h(e){return e!=null}function g(e,t,n){return m(e&&h(e[t])?e[t]:p[t],n)}function _(e){return e<0?0:Math.floor(e)}function v(e,t){return Math.floor(Math.random()*(t-e))+e}function y(e){return parseInt(e,16)}function b(e){return e.map(x)}function x(e){var t=String(e).replace(/[^0-9a-f]/gi,``);return t.length<6&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),{r:y(t.substring(0,2)),g:y(t.substring(2,4)),b:y(t.substring(4,6))}}function S(e){var t=g(e,`origin`,Object);return t.x=g(t,`x`,Number),t.y=g(t,`y`,Number),t}function C(e){e.width=document.documentElement.clientWidth,e.height=document.documentElement.clientHeight}function w(e){var t=e.getBoundingClientRect();e.width=t.width,e.height=t.height}function T(e){var t=document.createElement(`canvas`);return t.style.position=`fixed`,t.style.top=`0px`,t.style.left=`0px`,t.style.pointerEvents=`none`,t.style.zIndex=e,t}function E(e,t,n,r,i,a,o,s,c){e.save(),e.translate(t,n),e.rotate(a),e.scale(r,i),e.arc(0,0,1,o,s,c),e.restore()}function D(e){var t=e.angle*(Math.PI/180),n=e.spread*(Math.PI/180);return{x:e.x,y:e.y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:e.startVelocity*.5+Math.random()*e.startVelocity,angle2D:-t+(.5*n-Math.random()*n),tiltAngle:(Math.random()*.5+.25)*Math.PI,color:e.color,shape:e.shape,tick:0,totalTicks:e.ticks,decay:e.decay,drift:e.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:e.gravity*3,ovalScalar:.6,scalar:e.scalar,flat:e.flat}}function O(e,t){t.x+=Math.cos(t.angle2D)*t.velocity+t.drift,t.y+=Math.sin(t.angle2D)*t.velocity+t.gravity,t.velocity*=t.decay,t.flat?(t.wobble=0,t.wobbleX=t.x+10*t.scalar,t.wobbleY=t.y+10*t.scalar,t.tiltSin=0,t.tiltCos=0,t.random=1):(t.wobble+=t.wobbleSpeed,t.wobbleX=t.x+10*t.scalar*Math.cos(t.wobble),t.wobbleY=t.y+10*t.scalar*Math.sin(t.wobble),t.tiltAngle+=.1,t.tiltSin=Math.sin(t.tiltAngle),t.tiltCos=Math.cos(t.tiltAngle),t.random=Math.random()+2);var n=t.tick++/t.totalTicks,r=t.x+t.random*t.tiltCos,i=t.y+t.random*t.tiltSin,a=t.wobbleX+t.random*t.tiltCos,s=t.wobbleY+t.random*t.tiltSin;if(e.fillStyle=`rgba(`+t.color.r+`, `+t.color.g+`, `+t.color.b+`, `+(1-n)+`)`,e.beginPath(),o&&t.shape.type===`path`&&typeof t.shape.path==`string`&&Array.isArray(t.shape.matrix))e.fill(N(t.shape.path,t.shape.matrix,t.x,t.y,Math.abs(a-r)*.1,Math.abs(s-i)*.1,Math.PI/10*t.wobble));else if(t.shape.type===`bitmap`){var c=Math.PI/10*t.wobble,l=Math.abs(a-r)*.1,d=Math.abs(s-i)*.1,f=t.shape.bitmap.width*t.scalar,p=t.shape.bitmap.height*t.scalar,m=new DOMMatrix([Math.cos(c)*l,Math.sin(c)*l,-Math.sin(c)*d,Math.cos(c)*d,t.x,t.y]);m.multiplySelf(new DOMMatrix(t.shape.matrix));var h=e.createPattern(u.transform(t.shape.bitmap),`no-repeat`);h.setTransform(m),e.globalAlpha=1-n,e.fillStyle=h,e.fillRect(t.x-f/2,t.y-p/2,f,p),e.globalAlpha=1}else if(t.shape===`circle`)e.ellipse?e.ellipse(t.x,t.y,Math.abs(a-r)*t.ovalScalar,Math.abs(s-i)*t.ovalScalar,Math.PI/10*t.wobble,0,2*Math.PI):E(e,t.x,t.y,Math.abs(a-r)*t.ovalScalar,Math.abs(s-i)*t.ovalScalar,Math.PI/10*t.wobble,0,2*Math.PI);else if(t.shape===`star`)for(var g=Math.PI/2*3,_=4*t.scalar,v=8*t.scalar,y=t.x,b=t.y,x=5,S=Math.PI/x;x--;)y=t.x+Math.cos(g)*v,b=t.y+Math.sin(g)*v,e.lineTo(y,b),g+=S,y=t.x+Math.cos(g)*_,b=t.y+Math.sin(g)*_,e.lineTo(y,b),g+=S;else e.moveTo(Math.floor(t.x),Math.floor(t.y)),e.lineTo(Math.floor(t.wobbleX),Math.floor(i)),e.lineTo(Math.floor(a),Math.floor(s)),e.lineTo(Math.floor(r),Math.floor(t.wobbleY));return e.closePath(),e.fill(),t.tick<t.totalTicks}function k(e,t,n,a,o){var s=t.slice(),c=e.getContext(`2d`),f,p,m=l(function(t){function l(){f=p=null,c.clearRect(0,0,a.width,a.height),u.clear(),o(),t()}function m(){r&&(a.width!==i.width||a.height!==i.height)&&(a.width=e.width=i.width,a.height=e.height=i.height),!a.width&&!a.height&&(n(e),a.width=e.width,a.height=e.height),c.clearRect(0,0,a.width,a.height),s=s.filter(function(e){return O(c,e)}),s.length?f=d.frame(m):l()}f=d.frame(m),p=l});return{addFettis:function(e){return s=s.concat(e),m},canvas:e,promise:m,reset:function(){f&&d.cancel(f),p&&p()}}}function A(e,n){var r=!e,i=!!g(n||{},`resize`),o=!1,s=g(n,`disableForReducedMotion`,Boolean),c=a&&g(n||{},`useWorker`)?f():null,u=r?C:w,d=e&&c?!!e.__confetti_initialized:!1,p=typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion)`).matches,m;function h(t,n,r){for(var i=g(t,`particleCount`,_),a=g(t,`angle`,Number),o=g(t,`spread`,Number),s=g(t,`startVelocity`,Number),c=g(t,`decay`,Number),l=g(t,`gravity`,Number),d=g(t,`drift`,Number),f=g(t,`colors`,b),p=g(t,`ticks`,Number),h=g(t,`shapes`),y=g(t,`scalar`),x=!!g(t,`flat`),C=S(t),w=i,T=[],E=e.width*C.x,O=e.height*C.y;w--;)T.push(D({x:E,y:O,angle:a,spread:o,startVelocity:s,color:f[w%f.length],shape:h[v(0,h.length)],ticks:p,decay:c,gravity:l,drift:d,scalar:y,flat:x}));return m?m.addFettis(T):(m=k(e,T,u,n,r),m.promise)}function y(n){var a=s||g(n,`disableForReducedMotion`,Boolean),f=g(n,`zIndex`,Number);if(a&&p)return l(function(e){e()});r&&m?e=m.canvas:r&&!e&&(e=T(f),document.body.appendChild(e)),i&&!d&&u(e);var _={width:e.width,height:e.height};c&&!d&&c.init(e),d=!0,c&&(e.__confetti_initialized=!0);function v(){if(c){var t={getBoundingClientRect:function(){if(!r)return e.getBoundingClientRect()}};u(t),c.postMessage({resize:{width:t.width,height:t.height}});return}_.width=_.height=null}function y(){m=null,i&&(o=!1,t.removeEventListener(`resize`,v)),r&&e&&(document.body.contains(e)&&document.body.removeChild(e),e=null,d=!1)}return i&&!o&&(o=!0,t.addEventListener(`resize`,v,!1)),c?c.fire(n,_,y):h(n,_,y)}return y.reset=function(){c&&c.reset(),m&&m.reset()},y}var j;function M(){return j||=A(null,{useWorker:!0,resize:!0}),j}function N(e,t,n,r,i,a,o){var s=new Path2D(e),c=new Path2D;c.addPath(s,new DOMMatrix(t));var l=new Path2D;return l.addPath(c,new DOMMatrix([Math.cos(o)*i,Math.sin(o)*i,-Math.sin(o)*a,Math.cos(o)*a,n,r])),l}function P(e){if(!o)throw Error(`path confetti are not supported in this browser`);var t,n;typeof e==`string`?t=e:(t=e.path,n=e.matrix);var r=new Path2D(t),i=document.createElement(`canvas`).getContext(`2d`);if(!n){for(var a=1e3,s=a,c=a,l=0,u=0,d,f,p=0;p<a;p+=2)for(var m=0;m<a;m+=2)i.isPointInPath(r,p,m,`nonzero`)&&(s=Math.min(s,p),c=Math.min(c,m),l=Math.max(l,p),u=Math.max(u,m));d=l-s,f=u-c;var h=10,g=Math.min(h/d,h/f);n=[g,0,0,g,-Math.round(d/2+s)*g,-Math.round(f/2+c)*g]}return{type:`path`,path:t,matrix:n}}function F(e){var t,n=1,r=`#000000`,i=`"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif`;typeof e==`string`?t=e:(t=e.text,n=`scalar`in e?e.scalar:n,i=`fontFamily`in e?e.fontFamily:i,r=`color`in e?e.color:r);var a=10*n,o=``+a+`px `+i,s=new OffscreenCanvas(a,a),c=s.getContext(`2d`);c.font=o;var l=c.measureText(t),u=Math.ceil(l.actualBoundingBoxRight+l.actualBoundingBoxLeft),d=Math.ceil(l.actualBoundingBoxAscent+l.actualBoundingBoxDescent),f=2,p=l.actualBoundingBoxLeft+f,m=l.actualBoundingBoxAscent+f;u+=f+f,d+=f+f,s=new OffscreenCanvas(u,d),c=s.getContext(`2d`),c.font=o,c.fillStyle=r,c.fillText(t,p,m);var h=1/n;return{type:`bitmap`,bitmap:s.transferToImageBitmap(),matrix:[h,0,0,h,-u*h/2,-d*h/2]}}n.exports=function(){return M().apply(this,arguments)},n.exports.reset=function(){M().reset()},n.exports.create=A,n.exports.shapeFromPath=P,n.exports.shapeFromText=F})((function(){return typeof window<`u`?window:typeof self<`u`?self:this||{}})(),a,!1);var o=a.exports;a.exports.create;export{t as a,n as i,i as n,r,o as t};
|
|
|
|
| 1 |
+
import{U as e}from"./index-g5jVBiGr.js";var t=e(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),n=e(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),r=e(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),i=e(`trophy`,[[`path`,{d:`M10 14.66V17a1 1 0 0 1-1 1 2 2 0 0 0-2 2v2`,key:`pwuv1l`}],[`path`,{d:`M14 14.66V17a1 1 0 0 0 1 1 2 2 0 0 1 2 2v2`,key:`1y54w1`}],[`path`,{d:`M17.916 10H19.5A2.5 2.5 0 0 0 22 7.5V5a1 1 0 0 0-1-1h-3`,key:`e30mpu`}],[`path`,{d:`M4 22h16`,key:`57wxv0`}],[`path`,{d:`M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z`,key:`1mhfuq`}],[`path`,{d:`M6.084 10H4.5A2.5 2.5 0 0 1 2 7.5V5a1 1 0 0 1 1-1h3`,key:`i0yafy`}]]),a={};(function e(t,n,r,i){var a=!!(t.Worker&&t.Blob&&t.Promise&&t.OffscreenCanvas&&t.OffscreenCanvasRenderingContext2D&&t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype.transferControlToOffscreen&&t.URL&&t.URL.createObjectURL),o=typeof Path2D==`function`&&typeof DOMMatrix==`function`,s=(function(){if(!t.OffscreenCanvas)return!1;try{var e=new OffscreenCanvas(1,1),n=e.getContext(`2d`);n.fillRect(0,0,1,1);var r=e.transferToImageBitmap();n.createPattern(r,`no-repeat`)}catch{return!1}return!0})();function c(){}function l(e){var r=n.exports.Promise,i=r===void 0?t.Promise:r;return typeof i==`function`?new i(e):(e(c,c),null)}var u=(function(e,t){return{transform:function(n){if(e)return n;if(t.has(n))return t.get(n);var r=new OffscreenCanvas(n.width,n.height);return r.getContext(`2d`).drawImage(n,0,0),t.set(n,r),r},clear:function(){t.clear()}}})(s,new Map),d=function(){var e,t,n={},r=0;return typeof requestAnimationFrame==`function`&&typeof cancelAnimationFrame==`function`?(e=function(e){var t=Math.random();return n[t]=requestAnimationFrame(function i(a){r===a||r+16-1<a?(r=a,delete n[t],e()):n[t]=requestAnimationFrame(i)}),t},t=function(e){n[e]&&cancelAnimationFrame(n[e])}):(e=function(e){return setTimeout(e,16)},t=function(e){return clearTimeout(e)}),{frame:e,cancel:t}}(),f=(function(){var t,n,i={};function o(e){function t(t,n){e.postMessage({options:t||{},callback:n})}e.init=function(t){var n=t.transferControlToOffscreen();e.postMessage({canvas:n},[n])},e.fire=function(r,a,o){if(n)return t(r,null),n;var s=Math.random().toString(36).slice(2);return n=l(function(a){function c(t){t.data.callback===s&&(delete i[s],e.removeEventListener(`message`,c),n=null,u.clear(),o(),a())}e.addEventListener(`message`,c),t(r,s),i[s]=c.bind(null,{data:{callback:s}})}),n},e.reset=function(){for(var t in e.postMessage({reset:!0}),i)i[t](),delete i[t]}}return function(){if(t)return t;if(!r&&a){var n=[`var CONFETTI, SIZE = {}, module = {};`,`(`+e.toString()+`)(this, module, true, SIZE);`,`onmessage = function(msg) {`,` if (msg.data.options) {`,` CONFETTI(msg.data.options).then(function () {`,` if (msg.data.callback) {`,` postMessage({ callback: msg.data.callback });`,` }`,` });`,` } else if (msg.data.reset) {`,` CONFETTI && CONFETTI.reset();`,` } else if (msg.data.resize) {`,` SIZE.width = msg.data.resize.width;`,` SIZE.height = msg.data.resize.height;`,` } else if (msg.data.canvas) {`,` SIZE.width = msg.data.canvas.width;`,` SIZE.height = msg.data.canvas.height;`,` CONFETTI = module.exports.create(msg.data.canvas);`,` }`,`}`].join(`
|
| 2 |
`);try{t=new Worker(URL.createObjectURL(new Blob([n])))}catch(e){return typeof console<`u`&&typeof console.warn==`function`&&console.warn(`🎊 Could not load worker`,e),null}o(t)}return t}})(),p={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:[`square`,`circle`],zIndex:100,colors:[`#26ccff`,`#a25afd`,`#ff5e7e`,`#88ff5a`,`#fcff42`,`#ffa62d`,`#ff36ff`],disableForReducedMotion:!1,scalar:1};function m(e,t){return t?t(e):e}function h(e){return e!=null}function g(e,t,n){return m(e&&h(e[t])?e[t]:p[t],n)}function _(e){return e<0?0:Math.floor(e)}function v(e,t){return Math.floor(Math.random()*(t-e))+e}function y(e){return parseInt(e,16)}function b(e){return e.map(x)}function x(e){var t=String(e).replace(/[^0-9a-f]/gi,``);return t.length<6&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),{r:y(t.substring(0,2)),g:y(t.substring(2,4)),b:y(t.substring(4,6))}}function S(e){var t=g(e,`origin`,Object);return t.x=g(t,`x`,Number),t.y=g(t,`y`,Number),t}function C(e){e.width=document.documentElement.clientWidth,e.height=document.documentElement.clientHeight}function w(e){var t=e.getBoundingClientRect();e.width=t.width,e.height=t.height}function T(e){var t=document.createElement(`canvas`);return t.style.position=`fixed`,t.style.top=`0px`,t.style.left=`0px`,t.style.pointerEvents=`none`,t.style.zIndex=e,t}function E(e,t,n,r,i,a,o,s,c){e.save(),e.translate(t,n),e.rotate(a),e.scale(r,i),e.arc(0,0,1,o,s,c),e.restore()}function D(e){var t=e.angle*(Math.PI/180),n=e.spread*(Math.PI/180);return{x:e.x,y:e.y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:e.startVelocity*.5+Math.random()*e.startVelocity,angle2D:-t+(.5*n-Math.random()*n),tiltAngle:(Math.random()*.5+.25)*Math.PI,color:e.color,shape:e.shape,tick:0,totalTicks:e.ticks,decay:e.decay,drift:e.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:e.gravity*3,ovalScalar:.6,scalar:e.scalar,flat:e.flat}}function O(e,t){t.x+=Math.cos(t.angle2D)*t.velocity+t.drift,t.y+=Math.sin(t.angle2D)*t.velocity+t.gravity,t.velocity*=t.decay,t.flat?(t.wobble=0,t.wobbleX=t.x+10*t.scalar,t.wobbleY=t.y+10*t.scalar,t.tiltSin=0,t.tiltCos=0,t.random=1):(t.wobble+=t.wobbleSpeed,t.wobbleX=t.x+10*t.scalar*Math.cos(t.wobble),t.wobbleY=t.y+10*t.scalar*Math.sin(t.wobble),t.tiltAngle+=.1,t.tiltSin=Math.sin(t.tiltAngle),t.tiltCos=Math.cos(t.tiltAngle),t.random=Math.random()+2);var n=t.tick++/t.totalTicks,r=t.x+t.random*t.tiltCos,i=t.y+t.random*t.tiltSin,a=t.wobbleX+t.random*t.tiltCos,s=t.wobbleY+t.random*t.tiltSin;if(e.fillStyle=`rgba(`+t.color.r+`, `+t.color.g+`, `+t.color.b+`, `+(1-n)+`)`,e.beginPath(),o&&t.shape.type===`path`&&typeof t.shape.path==`string`&&Array.isArray(t.shape.matrix))e.fill(N(t.shape.path,t.shape.matrix,t.x,t.y,Math.abs(a-r)*.1,Math.abs(s-i)*.1,Math.PI/10*t.wobble));else if(t.shape.type===`bitmap`){var c=Math.PI/10*t.wobble,l=Math.abs(a-r)*.1,d=Math.abs(s-i)*.1,f=t.shape.bitmap.width*t.scalar,p=t.shape.bitmap.height*t.scalar,m=new DOMMatrix([Math.cos(c)*l,Math.sin(c)*l,-Math.sin(c)*d,Math.cos(c)*d,t.x,t.y]);m.multiplySelf(new DOMMatrix(t.shape.matrix));var h=e.createPattern(u.transform(t.shape.bitmap),`no-repeat`);h.setTransform(m),e.globalAlpha=1-n,e.fillStyle=h,e.fillRect(t.x-f/2,t.y-p/2,f,p),e.globalAlpha=1}else if(t.shape===`circle`)e.ellipse?e.ellipse(t.x,t.y,Math.abs(a-r)*t.ovalScalar,Math.abs(s-i)*t.ovalScalar,Math.PI/10*t.wobble,0,2*Math.PI):E(e,t.x,t.y,Math.abs(a-r)*t.ovalScalar,Math.abs(s-i)*t.ovalScalar,Math.PI/10*t.wobble,0,2*Math.PI);else if(t.shape===`star`)for(var g=Math.PI/2*3,_=4*t.scalar,v=8*t.scalar,y=t.x,b=t.y,x=5,S=Math.PI/x;x--;)y=t.x+Math.cos(g)*v,b=t.y+Math.sin(g)*v,e.lineTo(y,b),g+=S,y=t.x+Math.cos(g)*_,b=t.y+Math.sin(g)*_,e.lineTo(y,b),g+=S;else e.moveTo(Math.floor(t.x),Math.floor(t.y)),e.lineTo(Math.floor(t.wobbleX),Math.floor(i)),e.lineTo(Math.floor(a),Math.floor(s)),e.lineTo(Math.floor(r),Math.floor(t.wobbleY));return e.closePath(),e.fill(),t.tick<t.totalTicks}function k(e,t,n,a,o){var s=t.slice(),c=e.getContext(`2d`),f,p,m=l(function(t){function l(){f=p=null,c.clearRect(0,0,a.width,a.height),u.clear(),o(),t()}function m(){r&&(a.width!==i.width||a.height!==i.height)&&(a.width=e.width=i.width,a.height=e.height=i.height),!a.width&&!a.height&&(n(e),a.width=e.width,a.height=e.height),c.clearRect(0,0,a.width,a.height),s=s.filter(function(e){return O(c,e)}),s.length?f=d.frame(m):l()}f=d.frame(m),p=l});return{addFettis:function(e){return s=s.concat(e),m},canvas:e,promise:m,reset:function(){f&&d.cancel(f),p&&p()}}}function A(e,n){var r=!e,i=!!g(n||{},`resize`),o=!1,s=g(n,`disableForReducedMotion`,Boolean),c=a&&g(n||{},`useWorker`)?f():null,u=r?C:w,d=e&&c?!!e.__confetti_initialized:!1,p=typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion)`).matches,m;function h(t,n,r){for(var i=g(t,`particleCount`,_),a=g(t,`angle`,Number),o=g(t,`spread`,Number),s=g(t,`startVelocity`,Number),c=g(t,`decay`,Number),l=g(t,`gravity`,Number),d=g(t,`drift`,Number),f=g(t,`colors`,b),p=g(t,`ticks`,Number),h=g(t,`shapes`),y=g(t,`scalar`),x=!!g(t,`flat`),C=S(t),w=i,T=[],E=e.width*C.x,O=e.height*C.y;w--;)T.push(D({x:E,y:O,angle:a,spread:o,startVelocity:s,color:f[w%f.length],shape:h[v(0,h.length)],ticks:p,decay:c,gravity:l,drift:d,scalar:y,flat:x}));return m?m.addFettis(T):(m=k(e,T,u,n,r),m.promise)}function y(n){var a=s||g(n,`disableForReducedMotion`,Boolean),f=g(n,`zIndex`,Number);if(a&&p)return l(function(e){e()});r&&m?e=m.canvas:r&&!e&&(e=T(f),document.body.appendChild(e)),i&&!d&&u(e);var _={width:e.width,height:e.height};c&&!d&&c.init(e),d=!0,c&&(e.__confetti_initialized=!0);function v(){if(c){var t={getBoundingClientRect:function(){if(!r)return e.getBoundingClientRect()}};u(t),c.postMessage({resize:{width:t.width,height:t.height}});return}_.width=_.height=null}function y(){m=null,i&&(o=!1,t.removeEventListener(`resize`,v)),r&&e&&(document.body.contains(e)&&document.body.removeChild(e),e=null,d=!1)}return i&&!o&&(o=!0,t.addEventListener(`resize`,v,!1)),c?c.fire(n,_,y):h(n,_,y)}return y.reset=function(){c&&c.reset(),m&&m.reset()},y}var j;function M(){return j||=A(null,{useWorker:!0,resize:!0}),j}function N(e,t,n,r,i,a,o){var s=new Path2D(e),c=new Path2D;c.addPath(s,new DOMMatrix(t));var l=new Path2D;return l.addPath(c,new DOMMatrix([Math.cos(o)*i,Math.sin(o)*i,-Math.sin(o)*a,Math.cos(o)*a,n,r])),l}function P(e){if(!o)throw Error(`path confetti are not supported in this browser`);var t,n;typeof e==`string`?t=e:(t=e.path,n=e.matrix);var r=new Path2D(t),i=document.createElement(`canvas`).getContext(`2d`);if(!n){for(var a=1e3,s=a,c=a,l=0,u=0,d,f,p=0;p<a;p+=2)for(var m=0;m<a;m+=2)i.isPointInPath(r,p,m,`nonzero`)&&(s=Math.min(s,p),c=Math.min(c,m),l=Math.max(l,p),u=Math.max(u,m));d=l-s,f=u-c;var h=10,g=Math.min(h/d,h/f);n=[g,0,0,g,-Math.round(d/2+s)*g,-Math.round(f/2+c)*g]}return{type:`path`,path:t,matrix:n}}function F(e){var t,n=1,r=`#000000`,i=`"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif`;typeof e==`string`?t=e:(t=e.text,n=`scalar`in e?e.scalar:n,i=`fontFamily`in e?e.fontFamily:i,r=`color`in e?e.color:r);var a=10*n,o=``+a+`px `+i,s=new OffscreenCanvas(a,a),c=s.getContext(`2d`);c.font=o;var l=c.measureText(t),u=Math.ceil(l.actualBoundingBoxRight+l.actualBoundingBoxLeft),d=Math.ceil(l.actualBoundingBoxAscent+l.actualBoundingBoxDescent),f=2,p=l.actualBoundingBoxLeft+f,m=l.actualBoundingBoxAscent+f;u+=f+f,d+=f+f,s=new OffscreenCanvas(u,d),c=s.getContext(`2d`),c.font=o,c.fillStyle=r,c.fillText(t,p,m);var h=1/n;return{type:`bitmap`,bitmap:s.transferToImageBitmap(),matrix:[h,0,0,h,-u*h/2,-d*h/2]}}n.exports=function(){return M().apply(this,arguments)},n.exports.reset=function(){M().reset()},n.exports.create=A,n.exports.shapeFromPath=P,n.exports.shapeFromText=F})((function(){return typeof window<`u`?window:typeof self<`u`?self:this||{}})(),a,!1);var o=a.exports;a.exports.create;export{t as a,n as i,i as n,r,o as t};
|
algospaced-ui/dist/assets/{external-link-mE9fgxrX.js → external-link-yb1gedrc.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{U as e}from"./index-
|
|
|
|
| 1 |
+
import{U as e}from"./index-g5jVBiGr.js";var t=e(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]);export{t};
|
algospaced-ui/dist/assets/{eye-BTMBNbc7.js → eye-DeJ_5v51.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{U as e}from"./index-
|
|
|
|
| 1 |
+
import{U as e}from"./index-g5jVBiGr.js";var t=e(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),n=e(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),r=e(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]);export{n,t as r,r as t};
|
algospaced-ui/dist/assets/{githubSyncService-ComQdi-j.js → githubSyncService--4Z5jmjP.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{i as e}from"./jsx-runtime-j9uSgrFF.js";import{U as t}from"./index-
|
|
|
|
| 1 |
+
import{i as e}from"./jsx-runtime-j9uSgrFF.js";import{U as t}from"./index-g5jVBiGr.js";var n=t(`folder-git-2`,[[`path`,{d:`M18 19a5 5 0 0 1-5-5v8`,key:`sz5oeg`}],[`path`,{d:`M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5`,key:`1w6njk`}],[`circle`,{cx:`13`,cy:`12`,r:`2`,key:`1j92g6`}],[`circle`,{cx:`20`,cy:`19`,r:`2`,key:`1obnsp`}]]),r={TOKEN:`algospaced_github_token`,USERNAME:`algospaced_github_username`,REPO:`algospaced_github_repo`,BRANCH:`algospaced_github_branch`,AUTOCOMMIT:`algospaced_github_autocommit`,PRIVATE:`algospaced_github_private`,AVATAR:`algospaced_github_avatar`,NAME:`algospaced_github_name`};function i(){return{token:localStorage.getItem(r.TOKEN)||``,username:localStorage.getItem(r.USERNAME)||``,repoName:localStorage.getItem(r.REPO)||`algospaced-solutions`,branch:localStorage.getItem(r.BRANCH)||`main`,autoCommit:localStorage.getItem(r.AUTOCOMMIT)!==`false`,isPrivate:localStorage.getItem(r.PRIVATE)!==`false`}}function a(){let e=localStorage.getItem(r.USERNAME);return e?{login:e,name:localStorage.getItem(r.NAME)||e,avatar_url:localStorage.getItem(r.AVATAR)||``,html_url:`https://github.com/${e}`}:null}function o(e,t){e.token!==void 0&&localStorage.setItem(r.TOKEN,e.token.trim()),e.username!==void 0&&localStorage.setItem(r.USERNAME,e.username.trim()),e.repoName!==void 0&&localStorage.setItem(r.REPO,e.repoName.trim()),e.branch!==void 0&&localStorage.setItem(r.BRANCH,e.branch.trim()),e.autoCommit!==void 0&&localStorage.setItem(r.AUTOCOMMIT,String(e.autoCommit)),e.isPrivate!==void 0&&localStorage.setItem(r.PRIVATE,String(e.isPrivate)),t&&(t.login&&localStorage.setItem(r.USERNAME,t.login),t.name&&localStorage.setItem(r.NAME,t.name),t.avatar_url&&localStorage.setItem(r.AVATAR,t.avatar_url))}function s(){Object.values(r).forEach(e=>localStorage.removeItem(e))}async function c(){let e=window.open(`/api/github/oauth/login`,`algospaced_github_oauth`,`width=600,height=750,menubar=no,toolbar=no,status=no,location=no`);if(!e)throw Error(`Popup window was blocked by your browser. Please allow popups for AlgoSpaced and try again.`);let t=await new Promise((t,n)=>{let r=null,i=()=>{window.removeEventListener(`message`,a),r!==null&&(clearInterval(r),r=null)},a=e=>{if(!e.data||typeof e.data!=`object`)return;let r=e.data;r.type===`GITHUB_OAUTH_SUCCESS`?(i(),r.token&&typeof r.token==`string`?t(r.token.trim()):n(Error(`GitHub authorization succeeded but no access token was returned.`))):r.type===`GITHUB_OAUTH_ERROR`&&(i(),n(Error(r.error||`GitHub authorization was denied or encountered an error.`)))};window.addEventListener(`message`,a),r=setInterval(()=>{e.closed&&(i(),n(Error(`GitHub authorization window was closed before completing.`)))},1e3)}),n=await l(t);if(!n.valid||!n.user)throw Error(n.error||`Failed to retrieve profile with GitHub token.`);let r=n.user;return o({token:t,username:r.login,repoName:i().repoName||`algospaced-solutions`},r),{token:t,user:r}}async function l(e){let t=await fetch(`/api/github/verify`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({token:e.trim()})});return t.ok?await t.json():{valid:!1,error:(await t.json().catch(()=>({}))).detail||`Server returned error (${t.status})`}}async function u(e,t,n=!0){let r=await fetch(`/api/github/init-repo`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({token:e.trim(),repo_name:t.trim(),private:n})});if(!r.ok){let e=await r.json().catch(()=>({}));throw Error(e.detail||`Failed to initialize repository (${r.status})`)}return await r.json()}async function d(e){let t=await fetch(`/api/github/push-solution`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.detail||`Failed to commit solution (${t.status})`)}return await t.json()}async function f(t,n,r=`main`){let{data:{session:i}}=await e.auth.getSession(),a=i?`Bearer ${i.access_token}`:`Bearer sandbox`,o=await fetch(`/api/github/sync-all`,{method:`POST`,headers:{"Content-Type":`application/json`,Authorization:a},body:JSON.stringify({token:t.trim(),repo:n.trim(),branch:r.trim()})});if(!o.ok){let e=await o.json().catch(()=>({}));throw Error(e.detail||`Sync failed (${o.status})`)}return await o.json()}export{u as a,f as c,a as i,l,c as n,d as o,i as r,o as s,s as t,n as u};
|
algospaced-ui/dist/assets/{index-9s0-qmGa.css → index-Y3EVepB8.css}
RENAMED
|
The diff for this file is too large to render.
See raw diff
|
|
|
algospaced-ui/dist/assets/{index-C7Gd5Mn4.js → index-g5jVBiGr.js}
RENAMED
|
The diff for this file is too large to render.
See raw diff
|
|
|
algospaced-ui/dist/assets/{info-DKabFp4k.js → info-CU16dSEt.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{U as e}from"./index-
|
|
|
|
| 1 |
+
import{U as e}from"./index-g5jVBiGr.js";var t=e(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]);export{t};
|
algospaced-ui/dist/assets/{save-D2rY9s8j.js → save-CdpRk537.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{U as e}from"./index-
|
|
|
|
| 1 |
+
import{U as e}from"./index-g5jVBiGr.js";var t=e(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]);export{t};
|
algospaced-ui/dist/index.html
CHANGED
|
@@ -13,9 +13,9 @@
|
|
| 13 |
<link
|
| 14 |
href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,700;12..96,800&family=Be+Vietnam+Pro:wght@500;700&family=Courier+Prime:wght@400;700&family=Press+Start+2P&family=Cinzel:wght@500;700;900&family=Cinzel+Decorative:wght@700;900&family=EB+Garamond:ital,wght@0,400;0,600;1,400;1,600&family=Kalam:wght@400;700&display=swap"
|
| 15 |
rel="stylesheet" />
|
| 16 |
-
<script type="module" crossorigin src="/assets/index-
|
| 17 |
<link rel="modulepreload" crossorigin href="/assets/jsx-runtime-j9uSgrFF.js">
|
| 18 |
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
| 19 |
<link rel="manifest" href="/manifest.webmanifest"><script id="vite-plugin-pwa:register-sw" src="/registerSW.js"></script></head>
|
| 20 |
|
| 21 |
<body>
|
|
|
|
| 13 |
<link
|
| 14 |
href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,700;12..96,800&family=Be+Vietnam+Pro:wght@500;700&family=Courier+Prime:wght@400;700&family=Press+Start+2P&family=Cinzel:wght@500;700;900&family=Cinzel+Decorative:wght@700;900&family=EB+Garamond:ital,wght@0,400;0,600;1,400;1,600&family=Kalam:wght@400;700&display=swap"
|
| 15 |
rel="stylesheet" />
|
| 16 |
+
<script type="module" crossorigin src="/assets/index-g5jVBiGr.js"></script>
|
| 17 |
<link rel="modulepreload" crossorigin href="/assets/jsx-runtime-j9uSgrFF.js">
|
| 18 |
+
<link rel="stylesheet" crossorigin href="/assets/index-Y3EVepB8.css">
|
| 19 |
<link rel="manifest" href="/manifest.webmanifest"><script id="vite-plugin-pwa:register-sw" src="/registerSW.js"></script></head>
|
| 20 |
|
| 21 |
<body>
|
algospaced-ui/dist/sw.js
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
if(!self.define){let s,e={};const l=(l,
|
|
|
|
| 1 |
+
if(!self.define){let s,e={};const l=(l,i)=>(l=new URL(l+".js",i).href,e[l]||new Promise(e=>{if("document"in self){const s=document.createElement("script");s.src=l,s.onload=e,document.head.appendChild(s)}else s=l,importScripts(l),e()}).then(()=>{let s=e[l];if(!s)throw new Error(`Module ${l} didn’t register its module`);return s}));self.define=(i,n)=>{const r=s||("document"in self?document.currentScript.src:"")||location.href;if(e[r])return;let u={};const t=s=>l(s,r),o={module:{uri:r},exports:u,require:t};e[r]=Promise.all(i.map(s=>o[s]||t(s))).then(s=>(n(...s),u))}}define(["./workbox-9c191d2f"],function(s){"use strict";self.skipWaiting(),s.clientsClaim(),s.precacheAndRoute([{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"index.html",revision:"ee6abb5e1d45cec355052325429ccafa"},{url:"assets/TerminalEmulator-CI1oWIOR.js",revision:null},{url:"assets/Settings-Cz_GHQn5.js",revision:null},{url:"assets/save-CdpRk537.js",revision:null},{url:"assets/ReviewQueue-BCTxdw81.js",revision:null},{url:"assets/PythonChallenge-Bfcp7_2V.js",revision:null},{url:"assets/PrincessChamber-Cu4RP8Ry.js",revision:null},{url:"assets/MySQLPlayground-BdJWX3_8.js",revision:null},{url:"assets/jsx-runtime-j9uSgrFF.js",revision:null},{url:"assets/JourneyPath-Dg9Be99S.js",revision:null},{url:"assets/info-CU16dSEt.js",revision:null},{url:"assets/index-Y3EVepB8.css",revision:null},{url:"assets/index-g5jVBiGr.js",revision:null},{url:"assets/GitHubSyncWindow-DGw-FVNu.js",revision:null},{url:"assets/githubSyncService--4Z5jmjP.js",revision:null},{url:"assets/FileExplorer-CRW7B6yJ.js",revision:null},{url:"assets/eye-DeJ_5v51.js",revision:null},{url:"assets/external-link-yb1gedrc.js",revision:null},{url:"assets/CreateProblemForm-1KsGQ8w8.js",revision:null},{url:"assets/confetti.module-BEqdENp8.js",revision:null},{url:"manifest.webmanifest",revision:"7c8ff056d2e188c868d851bcb349e28e"}],{}),s.cleanupOutdatedCaches(),s.registerRoute(new s.NavigationRoute(s.createHandlerBoundToURL("index.html")))});
|
algospaced-ui/src/components/ReviewQueue.tsx
CHANGED
|
@@ -78,7 +78,8 @@ export default function ReviewQueue({
|
|
| 78 |
savedRefSuccess,
|
| 79 |
saveRefError,
|
| 80 |
handleRunSandbox,
|
| 81 |
-
handleSaveReference
|
|
|
|
| 82 |
} = useSandboxRunner();
|
| 83 |
|
| 84 |
const {
|
|
@@ -92,7 +93,8 @@ export default function ReviewQueue({
|
|
| 92 |
aiSolutionError,
|
| 93 |
handleAiEvaluation,
|
| 94 |
handleExplainCode,
|
| 95 |
-
handleFetchAiSolution
|
|
|
|
| 96 |
} = useAiReviewer();
|
| 97 |
|
| 98 |
// GitHub Manual Push State
|
|
@@ -147,6 +149,22 @@ export default function ReviewQueue({
|
|
| 147 |
}
|
| 148 |
}, [reviews, code, onOpenWindow]);
|
| 149 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 150 |
// Global Keyboard Shortcuts (1, 2, 3 for SRS grading)
|
| 151 |
useEffect(() => {
|
| 152 |
const handleKeyDown = (e: KeyboardEvent) => {
|
|
@@ -164,22 +182,22 @@ export default function ReviewQueue({
|
|
| 164 |
|
| 165 |
if (e.key === '1') {
|
| 166 |
e.preventDefault();
|
| 167 |
-
|
| 168 |
} else if (e.key === '2') {
|
| 169 |
e.preventDefault();
|
| 170 |
-
|
| 171 |
} else if (e.key === '3') {
|
| 172 |
e.preventDefault();
|
| 173 |
-
|
| 174 |
} else if (e.key === '4') {
|
| 175 |
e.preventDefault();
|
| 176 |
-
|
| 177 |
}
|
| 178 |
};
|
| 179 |
|
| 180 |
window.addEventListener('keydown', handleKeyDown);
|
| 181 |
return () => window.removeEventListener('keydown', handleKeyDown);
|
| 182 |
-
}, [
|
| 183 |
|
| 184 |
const handleCopyText = (text: string, id: string) => {
|
| 185 |
navigator.clipboard.writeText(text);
|
|
@@ -295,7 +313,6 @@ export default function ReviewQueue({
|
|
| 295 |
totalInQueue={reviews.length}
|
| 296 |
reviews={reviews}
|
| 297 |
overrideProblemId={overrideProblemId}
|
| 298 |
-
onClearOverride={onClearOverride}
|
| 299 |
onOpenCreateProblem={handleOpenCreateProblem}
|
| 300 |
onOpenEditProblem={() => {
|
| 301 |
if (onOpenEditProblem) onOpenEditProblem(effectiveProblem);
|
|
@@ -445,7 +462,7 @@ export default function ReviewQueue({
|
|
| 445 |
onDismissGradeError={() => setGradeError(null)}
|
| 446 |
submitting={submitting}
|
| 447 |
submittingRating={submittingRating}
|
| 448 |
-
onGrade={
|
| 449 |
/>
|
| 450 |
|
| 451 |
{!onOpenOnboarding && (
|
|
|
|
| 78 |
savedRefSuccess,
|
| 79 |
saveRefError,
|
| 80 |
handleRunSandbox,
|
| 81 |
+
handleSaveReference,
|
| 82 |
+
resetSandbox
|
| 83 |
} = useSandboxRunner();
|
| 84 |
|
| 85 |
const {
|
|
|
|
| 93 |
aiSolutionError,
|
| 94 |
handleAiEvaluation,
|
| 95 |
handleExplainCode,
|
| 96 |
+
handleFetchAiSolution,
|
| 97 |
+
resetAiState
|
| 98 |
} = useAiReviewer();
|
| 99 |
|
| 100 |
// GitHub Manual Push State
|
|
|
|
| 149 |
}
|
| 150 |
}, [reviews, code, onOpenWindow]);
|
| 151 |
|
| 152 |
+
// Reset ephemeral evaluation, explanation, and sandbox state when moving between review cards
|
| 153 |
+
const currentReviewId = reviews[0]?.id || reviews[0]?.problem_id;
|
| 154 |
+
useEffect(() => {
|
| 155 |
+
resetAiState();
|
| 156 |
+
resetSandbox();
|
| 157 |
+
}, [currentReviewId, resetAiState, resetSandbox]);
|
| 158 |
+
|
| 159 |
+
const handleGradeWithReset = useCallback(
|
| 160 |
+
(rating: number) => {
|
| 161 |
+
resetAiState();
|
| 162 |
+
resetSandbox();
|
| 163 |
+
handleGrade(rating);
|
| 164 |
+
},
|
| 165 |
+
[handleGrade, resetAiState, resetSandbox]
|
| 166 |
+
);
|
| 167 |
+
|
| 168 |
// Global Keyboard Shortcuts (1, 2, 3 for SRS grading)
|
| 169 |
useEffect(() => {
|
| 170 |
const handleKeyDown = (e: KeyboardEvent) => {
|
|
|
|
| 182 |
|
| 183 |
if (e.key === '1') {
|
| 184 |
e.preventDefault();
|
| 185 |
+
handleGradeWithReset(1);
|
| 186 |
} else if (e.key === '2') {
|
| 187 |
e.preventDefault();
|
| 188 |
+
handleGradeWithReset(2);
|
| 189 |
} else if (e.key === '3') {
|
| 190 |
e.preventDefault();
|
| 191 |
+
handleGradeWithReset(3);
|
| 192 |
} else if (e.key === '4') {
|
| 193 |
e.preventDefault();
|
| 194 |
+
handleGradeWithReset(4);
|
| 195 |
}
|
| 196 |
};
|
| 197 |
|
| 198 |
window.addEventListener('keydown', handleKeyDown);
|
| 199 |
return () => window.removeEventListener('keydown', handleKeyDown);
|
| 200 |
+
}, [handleGradeWithReset, reviews.length, submitting]);
|
| 201 |
|
| 202 |
const handleCopyText = (text: string, id: string) => {
|
| 203 |
navigator.clipboard.writeText(text);
|
|
|
|
| 313 |
totalInQueue={reviews.length}
|
| 314 |
reviews={reviews}
|
| 315 |
overrideProblemId={overrideProblemId}
|
|
|
|
| 316 |
onOpenCreateProblem={handleOpenCreateProblem}
|
| 317 |
onOpenEditProblem={() => {
|
| 318 |
if (onOpenEditProblem) onOpenEditProblem(effectiveProblem);
|
|
|
|
| 462 |
onDismissGradeError={() => setGradeError(null)}
|
| 463 |
submitting={submitting}
|
| 464 |
submittingRating={submittingRating}
|
| 465 |
+
onGrade={handleGradeWithReset}
|
| 466 |
/>
|
| 467 |
|
| 468 |
{!onOpenOnboarding && (
|
algospaced-ui/src/components/review/ReviewHeader.tsx
CHANGED
|
@@ -12,7 +12,6 @@ interface ReviewHeaderProps {
|
|
| 12 |
totalInQueue: number;
|
| 13 |
reviews?: ReviewItem[];
|
| 14 |
overrideProblemId?: string | null;
|
| 15 |
-
onClearOverride?: () => void;
|
| 16 |
onOpenCreateProblem: () => void;
|
| 17 |
onOpenEditProblem?: () => void;
|
| 18 |
}
|
|
@@ -22,7 +21,6 @@ export const ReviewHeader: React.FC<ReviewHeaderProps> = ({
|
|
| 22 |
totalInQueue,
|
| 23 |
reviews = [],
|
| 24 |
overrideProblemId,
|
| 25 |
-
onClearOverride,
|
| 26 |
onOpenCreateProblem,
|
| 27 |
onOpenEditProblem
|
| 28 |
}) => {
|
|
@@ -41,11 +39,11 @@ export const ReviewHeader: React.FC<ReviewHeaderProps> = ({
|
|
| 41 |
<button
|
| 42 |
onClick={() => setIsQueueListOpen((prev) => !prev)}
|
| 43 |
className="flex items-center gap-1.5 px-2.5 py-1 bg-amber-300 hover:bg-amber-200 border-2 border-ink-black shadow-[2px_2px_0px_0px_rgba(30,41,59,1)] active:translate-y-0.5 active:shadow-none transition-all cursor-pointer shrink-0"
|
| 44 |
-
title="Click to view all cards due in today's queue"
|
| 45 |
>
|
| 46 |
<span className="w-2 h-2 rounded-full bg-emerald-500 animate-ping shrink-0" />
|
| 47 |
<span className="font-arcade text-[9px] font-bold text-ink-black tracking-wide">
|
| 48 |
-
{overrideProblemId ? '
|
| 49 |
</span>
|
| 50 |
{totalInQueue > 1 && (
|
| 51 |
<ChevronDown className={`w-3 h-3 text-ink-black transition-transform ${isQueueListOpen ? 'rotate-180' : ''}`} />
|
|
@@ -56,7 +54,7 @@ export const ReviewHeader: React.FC<ReviewHeaderProps> = ({
|
|
| 56 |
{isQueueListOpen && reviews.length > 0 && (
|
| 57 |
<div className="absolute top-10 left-0 z-50 w-72 sm:w-80 bg-paper-white border-[3px] border-ink-black gadget-shadow p-3 space-y-2">
|
| 58 |
<div className="flex items-center justify-between border-b-2 border-ink-black pb-1.5 font-arcade text-[9px] font-bold text-ink-black">
|
| 59 |
-
<span>DAILY QUEUE ({reviews.length} CARDS)</span>
|
| 60 |
<button
|
| 61 |
onClick={() => setIsQueueListOpen(false)}
|
| 62 |
className="px-1 hover:text-rose-600 font-bold cursor-pointer"
|
|
@@ -175,15 +173,6 @@ export const ReviewHeader: React.FC<ReviewHeaderProps> = ({
|
|
| 175 |
<span>LC</span>
|
| 176 |
<ExternalLink className="w-2.5 h-2.5 text-amber-600" />
|
| 177 |
</a>
|
| 178 |
-
|
| 179 |
-
{overrideProblemId && onClearOverride && (
|
| 180 |
-
<button
|
| 181 |
-
onClick={onClearOverride}
|
| 182 |
-
className="px-2 py-1 bg-rose-100 hover:bg-rose-200 border-2 border-ink-black text-rose-800 text-[9px] font-arcade font-bold shadow-[2px_2px_0px_0px_rgba(30,41,59,1)] active:translate-y-0.5 active:shadow-none transition-all cursor-pointer"
|
| 183 |
-
>
|
| 184 |
-
EXIT OVERRIDE
|
| 185 |
-
</button>
|
| 186 |
-
)}
|
| 187 |
</div>
|
| 188 |
</div>
|
| 189 |
);
|
|
|
|
| 12 |
totalInQueue: number;
|
| 13 |
reviews?: ReviewItem[];
|
| 14 |
overrideProblemId?: string | null;
|
|
|
|
| 15 |
onOpenCreateProblem: () => void;
|
| 16 |
onOpenEditProblem?: () => void;
|
| 17 |
}
|
|
|
|
| 21 |
totalInQueue,
|
| 22 |
reviews = [],
|
| 23 |
overrideProblemId,
|
|
|
|
| 24 |
onOpenCreateProblem,
|
| 25 |
onOpenEditProblem
|
| 26 |
}) => {
|
|
|
|
| 39 |
<button
|
| 40 |
onClick={() => setIsQueueListOpen((prev) => !prev)}
|
| 41 |
className="flex items-center gap-1.5 px-2.5 py-1 bg-amber-300 hover:bg-amber-200 border-2 border-ink-black shadow-[2px_2px_0px_0px_rgba(30,41,59,1)] active:translate-y-0.5 active:shadow-none transition-all cursor-pointer shrink-0"
|
| 42 |
+
title={overrideProblemId ? 'Journey Practice Session' : "Click to view all cards due in today's queue"}
|
| 43 |
>
|
| 44 |
<span className="w-2 h-2 rounded-full bg-emerald-500 animate-ping shrink-0" />
|
| 45 |
<span className="font-arcade text-[9px] font-bold text-ink-black tracking-wide">
|
| 46 |
+
{overrideProblemId ? 'JOURNEY PRACTICE' : `CARD 1 OF ${totalInQueue}`}
|
| 47 |
</span>
|
| 48 |
{totalInQueue > 1 && (
|
| 49 |
<ChevronDown className={`w-3 h-3 text-ink-black transition-transform ${isQueueListOpen ? 'rotate-180' : ''}`} />
|
|
|
|
| 54 |
{isQueueListOpen && reviews.length > 0 && (
|
| 55 |
<div className="absolute top-10 left-0 z-50 w-72 sm:w-80 bg-paper-white border-[3px] border-ink-black gadget-shadow p-3 space-y-2">
|
| 56 |
<div className="flex items-center justify-between border-b-2 border-ink-black pb-1.5 font-arcade text-[9px] font-bold text-ink-black">
|
| 57 |
+
<span>{overrideProblemId ? 'JOURNEY PRACTICE (1 CARD)' : `DAILY QUEUE (${reviews.length} CARDS)`}</span>
|
| 58 |
<button
|
| 59 |
onClick={() => setIsQueueListOpen(false)}
|
| 60 |
className="px-1 hover:text-rose-600 font-bold cursor-pointer"
|
|
|
|
| 173 |
<span>LC</span>
|
| 174 |
<ExternalLink className="w-2.5 h-2.5 text-amber-600" />
|
| 175 |
</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 176 |
</div>
|
| 177 |
</div>
|
| 178 |
);
|
algospaced-ui/src/hooks/useReviewQueue.ts
CHANGED
|
@@ -258,7 +258,23 @@ export function useReviewQueue({
|
|
| 258 |
onClearOverrideRef.current();
|
| 259 |
} else {
|
| 260 |
// Optimistically remove the completed card for instant, snappy UI
|
| 261 |
-
setReviews((prev) =>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 262 |
void fetchQueue(false);
|
| 263 |
}
|
| 264 |
} else {
|
|
|
|
| 258 |
onClearOverrideRef.current();
|
| 259 |
} else {
|
| 260 |
// Optimistically remove the completed card for instant, snappy UI
|
| 261 |
+
setReviews((prev) => {
|
| 262 |
+
const nextReviews = prev.slice(1);
|
| 263 |
+
if (nextReviews.length > 0) {
|
| 264 |
+
const nextActive = nextReviews[0];
|
| 265 |
+
const rawProb = nextActive.problems;
|
| 266 |
+
const probNum = rawProb?.problem_number ??
|
| 267 |
+
(/^\d+$/.test(nextActive?.problem_id || '') ? parseInt(nextActive.problem_id, 10) : undefined);
|
| 268 |
+
const catalogProb = probNum !== undefined
|
| 269 |
+
? getCatalogProblemByNumber(probNum)
|
| 270 |
+
: (getCatalogProblemById(rawProb?.id) || getCatalogProblemById(nextActive?.problem_id));
|
| 271 |
+
const nextStarter = rawProb?.starter_code || catalogProb?.starter_code || '';
|
| 272 |
+
setCode(nextStarter);
|
| 273 |
+
} else {
|
| 274 |
+
setCode('');
|
| 275 |
+
}
|
| 276 |
+
return nextReviews;
|
| 277 |
+
});
|
| 278 |
void fetchQueue(false);
|
| 279 |
}
|
| 280 |
} else {
|