nielsr HF Staff commited on
Commit
e941fe5
·
verified ·
1 Parent(s): 4632b84

Sync paperswithcode.co frontend

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. assets/{AiDeadlinesView-uL3tAaSX.js → AiDeadlinesView-LniV_dKO.js} +1 -1
  2. assets/{AuthorDetailView-02MKmAjH.js → AuthorDetailView-De9sKETG.js} +1 -1
  3. assets/{BenchmarkDetailView-CyC0P7AS.js → BenchmarkDetailView-BSa9e3w8.js} +1 -1
  4. assets/{BenchmarkTrendSparkline-c88osrLQ.js → BenchmarkTrendSparkline-BCbEDZUr.js} +1 -1
  5. assets/{ChatMessage-B-YI3CrH.js → ChatMessage-DAiy1xqv.js} +2 -2
  6. assets/ChatView-BW8ZEOff.js +0 -16
  7. assets/ChatView-BiviZbfg.js +16 -0
  8. assets/{ConferenceDetailView-DmzUAFNN.js → ConferenceDetailView-CY-7Wl7R.js} +1 -1
  9. assets/{ConferenceTaskView-CdiQqMLj.js → ConferenceTaskView--e571ntQ.js} +1 -1
  10. assets/{ConferencesIndexView-ClvDxxNA.js → ConferencesIndexView-DE7AvizF.js} +1 -1
  11. assets/{ContributionsPage-BBrIDkQ0.js → ContributionsPage-DoaZMKUY.js} +1 -1
  12. assets/{CronDashboard-Cw5jCU5-.js → CronDashboard-CKulhmWw.js} +4 -4
  13. assets/{ExternalSourceEvalBadge-B5FVP6Hj.js → ExternalSourceEvalBadge-BYtEDxNm.js} +1 -1
  14. assets/{FeedView-NfaOn3zx.js → FeedView-Dv1LDUAN.js} +1 -1
  15. assets/{FrameworksIndexView-D-I30wVq.js → FrameworksIndexView-DaHgLjlV.js} +1 -1
  16. assets/{LatexTitle-BmUg2c3G.js → LatexTitle-qoY4vrTZ.js} +1 -1
  17. assets/{MarkdownText-DgCJo7yQ.js → MarkdownText-VH1HEGnz.js} +1 -1
  18. assets/{MethodDetailView-BJcjt5Vn.js → MethodDetailView-M4qvY74O.js} +1 -1
  19. assets/{MethodsIndexView-Cb6Hwc7C.js → MethodsIndexView-CKAKF4Rt.js} +1 -1
  20. assets/{NotFound-CpcrlF99.js → NotFound-CN-zdP49.js} +1 -1
  21. assets/OrganizationDetailView-CVziNQLK.js +1 -0
  22. assets/OrganizationDetailView-DkCiyavY.js +0 -1
  23. assets/{OrganizationPaperFeed-CdsqFQ1J.js → OrganizationPaperFeed-BAdi7G6c.js} +1 -1
  24. assets/OrganizationTaskView-DRLz5DdM.js +1 -0
  25. assets/OrganizationTaskView-DwdEDcfd.js +0 -1
  26. assets/{OrganizationsIndexView-BZD0q5rr.js → OrganizationsIndexView-BFEZ8aLZ.js} +1 -1
  27. assets/{PaperDetailView-DLxK2pqr.js → PaperDetailView-DAPjYsXV.js} +1 -1
  28. assets/{PaperFeedFilters-CNYrJoVb.js → PaperFeedFilters-D2TbUu0j.js} +1 -1
  29. assets/{PaperPreviewLink-C7g07Bf-.js → PaperPreviewLink-DTmodbgi.js} +1 -1
  30. assets/{PapersListView-DihOwzEz.js → PapersListView-CiElqeZj.js} +1 -1
  31. assets/{SavedPapersView-AReFg8Pv.js → SavedPapersView-Oa-A9M7k.js} +1 -1
  32. assets/{SearchOverlay-DIr_b7TU.js → SearchOverlay-zJH1AgbF.js} +1 -1
  33. assets/SettingsView-2Aab7oZR.js +16 -0
  34. assets/SettingsView-rK87O-qc.js +0 -16
  35. assets/SharedChatView-Bzq7-peM.js +0 -1
  36. assets/SharedChatView-DvAcanFw.js +1 -0
  37. assets/{SignInToEditDialog-BJmkw1tr.js → SignInToEditDialog-DW_1sVXp.js} +1 -1
  38. assets/{SubmissionsDashboard-CbZH2smc.js → SubmissionsDashboard-D7fHw9fZ.js} +1 -1
  39. assets/{SubmitView-tSFlJsaJ.js → SubmitView-CRMmJZk-.js} +1 -1
  40. assets/{TagBrowseView-CKLRJyfT.js → TagBrowseView-BItfp6De.js} +2 -2
  41. assets/{TagsIndexView-EZ-gEon4.js → TagsIndexView-CFL5RaeB.js} +1 -1
  42. assets/{TaxonomySuggestionTile-B7IEL_hW.js → TaxonomySuggestionTile-T8WIATj3.js} +1 -1
  43. assets/{TrendsView-Dp3ULs1-.js → TrendsView-Ch21Eqgg.js} +1 -1
  44. assets/{alert-axJAQJuC.js → alert-_EYQlDHA.js} +1 -1
  45. assets/{button-5O6wnTvY.js → button-D8mDpZUh.js} +1 -1
  46. assets/chatSessions-BnXlq2-W.js +0 -1
  47. assets/chatSessions-Dz4Iu-O1.js +1 -0
  48. assets/{chevron-down-BLGtaYwg.js → chevron-down-BeEEYUNO.js} +1 -1
  49. assets/{codexAddEvals-DqxQQWJl.js → codexAddEvals-NAKdH-Ge.js} +2 -2
  50. assets/{components-BkZsumbI.js → components-BbXgE2lV.js} +1 -1
assets/{AiDeadlinesView-uL3tAaSX.js → AiDeadlinesView-LniV_dKO.js} RENAMED
@@ -1,3 +1,3 @@
1
- import{r as x,j as t,b as E}from"./index-CIXevVP9.js";import{u as A}from"./useQuery-BHSsBDmJ.js";import{S as B}from"./switch-toPN9xmN.js";import{S as U}from"./skeleton-BQDYAJTf.js";import{A as W,a as O}from"./alert-axJAQJuC.js";import{D as V,a as P,b as G,c as Y,d as K}from"./dialog-CA9NpDaA.js";import"./useBaseQuery-BL30DOiU.js";import"./index-xYsFHVgN.js";const b=1e3*60*60*24,S={urgent:"#c0392b",soon:"#b9770e",normal:"#3f7d3f",passed:"var(--ink-faint)"},k=e=>e.split("-").map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" "),q=new Set(["machine-learning","computer-vision","natural-language-processing","data-mining","robotics","computer-graphics","human-computer-interaction","web-search","signal-processing","representation-learning","reinforcement-learning","optimization-methods","large-language-models","information-retrieval","speech","mathematics"]),H=e=>e.trim().toLowerCase().replace(/\s+/g,"-"),D=e=>Array.from(new Set((e.tags??[]).map(H).filter(a=>q.has(a)))),F=e=>new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),z=(e,a)=>{if(!e)return null;const n=new Date(`${e}T00:00:00`),r=a?new Date(`${a}T00:00:00`):null,o=s=>s.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=n.getFullYear();return r&&r.getTime()!==n.getTime()?n.getMonth()===r.getMonth()?`${o(n).replace(/\d+$/,"").trim()} ${n.getDate()}–${r.getDate()}, ${i}`:`${o(n)} – ${o(r)}, ${i}`:`${o(n)}, ${i}`},I=e=>[...e.deadlines??[]].sort((a,n)=>new Date(a.deadline_at).getTime()-new Date(n.deadline_at).getTime()),T=(e,a)=>I(e).find(n=>new Date(n.deadline_at).getTime()>a)??null,L=e=>{const a=I(e);return a.length?a[a.length-1]:null},Q=(e,a)=>{const n=e-a;if(n<=0)return"Deadline passed";const r=Math.floor(n/b);if(r>=1){const s=Math.floor((n-r*b)/36e5);return`in ${r}d ${s}h`}const o=Math.floor(n/(1e3*60*60));return o>=1?`in ${o}h`:`in ${Math.max(1,Math.floor(n/(1e3*60)))}m`},J=(e,a)=>{const n=e-a;if(n<=0)return"Deadline passed";const r=Math.floor(n/b),o=Math.floor(n%b/(1e3*60*60)),i=Math.floor(n%(1e3*60*60)/(1e3*60)),s=Math.floor(n%(1e3*60)/1e3);return`${r}d ${o}h ${i}m ${s}s`},_=(e,a)=>{if(e==null)return S.passed;const n=(e-a)/b;return n<=0?S.passed:n<=7?S.urgent:n<=30?S.soon:S.normal},$={fontFamily:"var(--mono)",fontSize:10,letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--ink-faint)"},X=(e,a)=>{const n=Math.ceil((e-a)/b);return n<=0?"passed":`${n} ${n===1?"day":"days"}`},R=(e,a)=>{const n=z(e.start_date,e.end_date),r=e.venue||[e.city,e.country].filter(Boolean).join(", ");return[`${a.label||a.type||"Deadline"} for ${e.name}`,n?`Dates: ${n}`:null,r?`Location: ${r}`:null,e.url?`Website: ${e.url}`:null].filter(Boolean).join(`
2
  `)},C=e=>e.toISOString().replace(/[-:]/g,"").replace(/\.\d{3}/,""),Z=(e,a)=>{const n=new Date(a.deadline_at),r=new Date(n.getTime()+60*60*1e3),o=`${e.short_name||e.name} ${a.label||a.type||"deadline"}`,i=e.venue||[e.city,e.country].filter(Boolean).join(", "),s=`https://calendar.google.com/calendar/render?action=TEMPLATE&text=${encodeURIComponent(o)}&dates=${C(n)}/${C(r)}&details=${encodeURIComponent(R(e,a))}&location=${encodeURIComponent(i)}`;window.open(s,"_blank","noopener,noreferrer")},ee=(e,a)=>{const n=new Date(a.deadline_at),r=new Date(n.getTime()+60*60*1e3),o=`${e.short_name||e.name} ${a.label||a.type||"deadline"}`,i=e.venue||[e.city,e.country].filter(Boolean).join(", "),s=["BEGIN:VCALENDAR","VERSION:2.0","BEGIN:VEVENT",e.url?`URL:${e.url}`:null,`DTSTART:${C(n)}`,`DTEND:${C(r)}`,`SUMMARY:${o}`,`DESCRIPTION:${R(e,a).replace(/\n/g,"\\n")}`,i?`LOCATION:${i}`:null,"END:VEVENT","END:VCALENDAR"].filter(Boolean).join(`
3
  `),g=new Blob([s],{type:"text/calendar;charset=utf-8"}),c=document.createElement("a");c.href=URL.createObjectURL(g),c.download=`${(e.short_name||e.name).toLowerCase().replace(/\s+/g,"-")}-deadline.ics`,document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(c.href)},te=({conf:e,open:a,onOpenChange:n})=>{const[r,o]=x.useState(()=>Date.now());x.useEffect(()=>{if(!a)return;o(Date.now());const d=setInterval(()=>o(Date.now()),1e3);return()=>clearInterval(d)},[a]);const i=x.useMemo(()=>e?I(e):[],[e]),s=x.useMemo(()=>e?T(e,r):null,[e,r]),g=e?z(e.start_date,e.end_date):null,c=e?e.venue||[e.city,e.country].filter(Boolean).join(", ")||e.location:null,p=s?new Date(s.deadline_at).getTime():null;return t.jsx(V,{open:a,onOpenChange:n,children:t.jsx(P,{className:"max-w-xl",style:{background:"var(--bg-elevated)",maxHeight:"85vh",overflowY:"auto"},children:e&&t.jsxs(t.Fragment,{children:[t.jsxs(G,{children:[t.jsx(Y,{asChild:!0,children:t.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.01em",margin:0},children:e.short_name?`${e.short_name} ${e.year??""}`.trim():e.name})}),e.short_name&&e.name||e.description?t.jsx(K,{asChild:!0,children:t.jsx("span",{style:{fontFamily:"var(--serif)",fontSize:14,color:"var(--ink-soft)"},children:e.short_name?e.name:e.description})}):null]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:20,marginTop:4},children:[t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:24},children:[g&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsx("span",{style:$,children:"Dates"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-soft)"},children:g})]}),c&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsx("span",{style:$,children:"Venue"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-soft)"},children:c})]})]}),p!=null&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,padding:"12px 14px",borderRadius:8,background:"var(--bg-subtle)",border:"1px solid var(--hairline)"},children:[t.jsx("span",{style:$,children:"Next deadline in"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:22,fontWeight:600,color:_(p,r)},children:J(p,r)})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[t.jsx("span",{style:$,children:"Important deadlines"}),i.length===0?t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-faint)"},children:"No deadlines listed"}):i.map((d,m)=>{const y=new Date(d.deadline_at).getTime(),l=s!=null&&d.deadline_at===s.deadline_at&&d.type===s.type,u=y<=r;return t.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,padding:"8px 12px",borderRadius:6,background:l?"var(--accent-soft)":"transparent",border:l?"1px solid var(--hairline-strong)":"1px solid var(--hairline)",opacity:u&&!l?.55:1},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[t.jsxs("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink)",fontWeight:l?600:400},children:[d.label||k(d.type||"deadline"),l&&t.jsx("span",{style:{...$,marginLeft:8},children:"Next"})]}),t.jsxs("span",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-faint)"},children:[F(d.deadline_at),d.timezone?` · ${d.timezone}`:""]})]}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:12,fontWeight:600,whiteSpace:"nowrap",color:_(u?null:y,r)},children:X(y,r)})]},`${d.type??"deadline"}-${m}`)})]}),D(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:D(e).map(d=>t.jsx("span",{className:"tag-chip",style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:k(d)},d))}),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:16,paddingTop:12,borderTop:"1px solid var(--hairline)"},children:[e.url&&t.jsx("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--accent-text)"},children:"Visit website ↗"}),s&&t.jsxs("div",{style:{display:"flex",gap:12,marginLeft:"auto"},children:[t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>Z(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Google Calendar"}),t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>ee(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Apple / .ics"})]})]})]})]})})})},M=({id:e,label:a,checked:n,onChange:r})=>t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:[t.jsx(B,{id:e,checked:n,onCheckedChange:r}),t.jsx("label",{htmlFor:e,style:{cursor:"pointer"},children:a})]}),ne=({conf:e,now:a,selectedDomains:n,onToggleDomain:r,onOpen:o})=>{const i=T(e,a),s=i??L(e),g=s?new Date(s.deadline_at).getTime():null,c=_(i?g:null,a),p=z(e.start_date,e.end_date),d=[e.city??null,e.country??null].filter(Boolean).join(", ");return t.jsxs("div",{role:"button",tabIndex:0,onClick:()=>o(e),onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),o(e))},style:{border:"1px solid var(--hairline)",borderRadius:8,padding:20,background:"var(--bg-elevated)",display:"flex",flexDirection:"column",gap:12,cursor:"pointer"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:12},children:[t.jsx("h3",{style:{fontFamily:"var(--serif)",fontSize:20,fontWeight:500,letterSpacing:"-0.01em",margin:0},children:e.short_name?`${e.short_name} ${e.year??""}`.trim():e.name}),e.url&&t.jsx("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",onClick:m=>m.stopPropagation(),style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",whiteSpace:"nowrap"},children:"website ↗"})]}),t.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,paddingBottom:12,borderBottom:"1px solid var(--hairline)"},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)"},children:(s==null?void 0:s.label)||(s==null?void 0:s.type)||"Deadline"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:s?`${F(s.deadline_at)}${s.timezone?` · ${s.timezone}`:""}`:"TBD"})]}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:14,fontWeight:600,color:c,whiteSpace:"nowrap"},children:g!=null?Q(g,a):"TBD"})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)"},children:[p&&t.jsx("span",{children:p}),d&&t.jsx("span",{children:d})]}),D(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:D(e).map(m=>{const y=n.has(m);return t.jsx("button",{className:"tag-chip",onClick:l=>{l.stopPropagation(),r(m)},style:{background:y?"var(--ink)":"var(--bg-subtle)",color:y?"var(--bg)":"var(--ink-soft)"},children:k(m)},m)})})]})},me=()=>{const[e,a]=x.useState(!0),[n,r]=x.useState(!1),[o,i]=x.useState(new Set),[s,g]=x.useState(null),c=x.useMemo(()=>Date.now(),[]),p=A({queryKey:["conference-deadlines"],queryFn:()=>E.getConferenceDeadlines(),staleTime:10*60*1e3}),d=l=>{i(u=>{const h=new Set(u);return h.has(l)?h.delete(l):h.add(l),h})},m=x.useMemo(()=>{var u;const l=new Map;return(u=p.data)==null||u.results.forEach(h=>{D(h).forEach(j=>l.set(j,(l.get(j)??0)+1))}),Array.from(l.entries()).sort((h,j)=>j[1]-h[1]).map(([h])=>h)},[p.data]),y=x.useMemo(()=>{var j;const u=(((j=p.data)==null?void 0:j.results)??[]).filter(f=>!(e&&f.tier!=="a"||o.size>0&&!D(f).some(v=>o.has(v))||!n&&!T(f,c))),h=f=>{const w=T(f,c);if(w)return{group:0,time:new Date(w.deadline_at).getTime()};const v=L(f);return{group:1,time:-(v?new Date(v.deadline_at).getTime():0)}};return[...u].sort((f,w)=>{const v=h(f),N=h(w);return v.group!==N.group?v.group-N.group:v.time-N.time})},[p.data,e,n,o,c]);return p.error?t.jsx("div",{className:"page",children:t.jsx(W,{variant:"destructive",children:t.jsx(O,{children:"Failed to load conference deadlines. Please try again."})})}):t.jsxs("div",{className:"page",children:[t.jsx("div",{className:"feed-header",children:t.jsxs("div",{children:[t.jsxs("h1",{className:"feed-title",children:["AI Conference ",t.jsx("em",{children:"Deadlines"})]}),t.jsx("div",{className:"feed-subtitle",children:"Upcoming submission deadlines for major AI conferences, counting down."})]})}),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:20,padding:"16px 0",borderBottom:"1px solid var(--hairline)",marginBottom:24},children:[t.jsx(M,{id:"top-tier-only",label:"Top tier only",checked:e,onChange:a}),t.jsx(M,{id:"show-past",label:"Show past conferences",checked:n,onChange:r})]}),m.length>0&&t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:24},children:[m.map(l=>{const u=o.has(l);return t.jsx("button",{className:"tag-chip",onClick:()=>d(l),style:{background:u?"var(--ink)":"var(--bg-subtle)",color:u?"var(--bg)":"var(--ink-soft)"},children:k(l)},l)}),o.size>0&&t.jsx("button",{className:"tag-chip",onClick:()=>i(new Set),style:{background:"transparent",color:"var(--ink-faint)"},children:"Clear ✕"})]}),t.jsx("div",{className:"sort-bar",children:t.jsx("div",{className:"results-count",children:p.isLoading?"…":`${y.length} conferences`})}),p.isLoading?t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:Array.from({length:6}).map((l,u)=>t.jsx(U,{className:"h-44"},u))}):y.length===0?t.jsxs("div",{className:"no-results",children:["No conferences match these filters",n?".":" — try enabling “Show past conferences”."]}):t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:y.map(l=>t.jsx(ne,{conf:l,now:c,selectedDomains:o,onToggleDomain:d,onOpen:g},l.id))}),t.jsx(te,{conf:s,open:s!==null,onOpenChange:l=>{l||g(null)}})]})};export{me as default};
 
1
+ import{r as x,j as t,b as E}from"./index-Bo5_2OqZ.js";import{u as A}from"./useQuery-Bh9FZQpL.js";import{S as B}from"./switch-DGcXQvGy.js";import{S as U}from"./skeleton-CB-heJjl.js";import{A as W,a as O}from"./alert-_EYQlDHA.js";import{D as V,a as P,b as G,c as Y,d as K}from"./dialog-BAxsIFdN.js";import"./useBaseQuery-B8T7kRNC.js";import"./index-DWt5uuhX.js";const b=1e3*60*60*24,S={urgent:"#c0392b",soon:"#b9770e",normal:"#3f7d3f",passed:"var(--ink-faint)"},k=e=>e.split("-").map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" "),q=new Set(["machine-learning","computer-vision","natural-language-processing","data-mining","robotics","computer-graphics","human-computer-interaction","web-search","signal-processing","representation-learning","reinforcement-learning","optimization-methods","large-language-models","information-retrieval","speech","mathematics"]),H=e=>e.trim().toLowerCase().replace(/\s+/g,"-"),D=e=>Array.from(new Set((e.tags??[]).map(H).filter(a=>q.has(a)))),F=e=>new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),z=(e,a)=>{if(!e)return null;const n=new Date(`${e}T00:00:00`),r=a?new Date(`${a}T00:00:00`):null,o=s=>s.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=n.getFullYear();return r&&r.getTime()!==n.getTime()?n.getMonth()===r.getMonth()?`${o(n).replace(/\d+$/,"").trim()} ${n.getDate()}–${r.getDate()}, ${i}`:`${o(n)} – ${o(r)}, ${i}`:`${o(n)}, ${i}`},I=e=>[...e.deadlines??[]].sort((a,n)=>new Date(a.deadline_at).getTime()-new Date(n.deadline_at).getTime()),T=(e,a)=>I(e).find(n=>new Date(n.deadline_at).getTime()>a)??null,L=e=>{const a=I(e);return a.length?a[a.length-1]:null},Q=(e,a)=>{const n=e-a;if(n<=0)return"Deadline passed";const r=Math.floor(n/b);if(r>=1){const s=Math.floor((n-r*b)/36e5);return`in ${r}d ${s}h`}const o=Math.floor(n/(1e3*60*60));return o>=1?`in ${o}h`:`in ${Math.max(1,Math.floor(n/(1e3*60)))}m`},J=(e,a)=>{const n=e-a;if(n<=0)return"Deadline passed";const r=Math.floor(n/b),o=Math.floor(n%b/(1e3*60*60)),i=Math.floor(n%(1e3*60*60)/(1e3*60)),s=Math.floor(n%(1e3*60)/1e3);return`${r}d ${o}h ${i}m ${s}s`},_=(e,a)=>{if(e==null)return S.passed;const n=(e-a)/b;return n<=0?S.passed:n<=7?S.urgent:n<=30?S.soon:S.normal},$={fontFamily:"var(--mono)",fontSize:10,letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--ink-faint)"},X=(e,a)=>{const n=Math.ceil((e-a)/b);return n<=0?"passed":`${n} ${n===1?"day":"days"}`},R=(e,a)=>{const n=z(e.start_date,e.end_date),r=e.venue||[e.city,e.country].filter(Boolean).join(", ");return[`${a.label||a.type||"Deadline"} for ${e.name}`,n?`Dates: ${n}`:null,r?`Location: ${r}`:null,e.url?`Website: ${e.url}`:null].filter(Boolean).join(`
2
  `)},C=e=>e.toISOString().replace(/[-:]/g,"").replace(/\.\d{3}/,""),Z=(e,a)=>{const n=new Date(a.deadline_at),r=new Date(n.getTime()+60*60*1e3),o=`${e.short_name||e.name} ${a.label||a.type||"deadline"}`,i=e.venue||[e.city,e.country].filter(Boolean).join(", "),s=`https://calendar.google.com/calendar/render?action=TEMPLATE&text=${encodeURIComponent(o)}&dates=${C(n)}/${C(r)}&details=${encodeURIComponent(R(e,a))}&location=${encodeURIComponent(i)}`;window.open(s,"_blank","noopener,noreferrer")},ee=(e,a)=>{const n=new Date(a.deadline_at),r=new Date(n.getTime()+60*60*1e3),o=`${e.short_name||e.name} ${a.label||a.type||"deadline"}`,i=e.venue||[e.city,e.country].filter(Boolean).join(", "),s=["BEGIN:VCALENDAR","VERSION:2.0","BEGIN:VEVENT",e.url?`URL:${e.url}`:null,`DTSTART:${C(n)}`,`DTEND:${C(r)}`,`SUMMARY:${o}`,`DESCRIPTION:${R(e,a).replace(/\n/g,"\\n")}`,i?`LOCATION:${i}`:null,"END:VEVENT","END:VCALENDAR"].filter(Boolean).join(`
3
  `),g=new Blob([s],{type:"text/calendar;charset=utf-8"}),c=document.createElement("a");c.href=URL.createObjectURL(g),c.download=`${(e.short_name||e.name).toLowerCase().replace(/\s+/g,"-")}-deadline.ics`,document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(c.href)},te=({conf:e,open:a,onOpenChange:n})=>{const[r,o]=x.useState(()=>Date.now());x.useEffect(()=>{if(!a)return;o(Date.now());const d=setInterval(()=>o(Date.now()),1e3);return()=>clearInterval(d)},[a]);const i=x.useMemo(()=>e?I(e):[],[e]),s=x.useMemo(()=>e?T(e,r):null,[e,r]),g=e?z(e.start_date,e.end_date):null,c=e?e.venue||[e.city,e.country].filter(Boolean).join(", ")||e.location:null,p=s?new Date(s.deadline_at).getTime():null;return t.jsx(V,{open:a,onOpenChange:n,children:t.jsx(P,{className:"max-w-xl",style:{background:"var(--bg-elevated)",maxHeight:"85vh",overflowY:"auto"},children:e&&t.jsxs(t.Fragment,{children:[t.jsxs(G,{children:[t.jsx(Y,{asChild:!0,children:t.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.01em",margin:0},children:e.short_name?`${e.short_name} ${e.year??""}`.trim():e.name})}),e.short_name&&e.name||e.description?t.jsx(K,{asChild:!0,children:t.jsx("span",{style:{fontFamily:"var(--serif)",fontSize:14,color:"var(--ink-soft)"},children:e.short_name?e.name:e.description})}):null]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:20,marginTop:4},children:[t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:24},children:[g&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsx("span",{style:$,children:"Dates"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-soft)"},children:g})]}),c&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsx("span",{style:$,children:"Venue"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-soft)"},children:c})]})]}),p!=null&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,padding:"12px 14px",borderRadius:8,background:"var(--bg-subtle)",border:"1px solid var(--hairline)"},children:[t.jsx("span",{style:$,children:"Next deadline in"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:22,fontWeight:600,color:_(p,r)},children:J(p,r)})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[t.jsx("span",{style:$,children:"Important deadlines"}),i.length===0?t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-faint)"},children:"No deadlines listed"}):i.map((d,m)=>{const y=new Date(d.deadline_at).getTime(),l=s!=null&&d.deadline_at===s.deadline_at&&d.type===s.type,u=y<=r;return t.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,padding:"8px 12px",borderRadius:6,background:l?"var(--accent-soft)":"transparent",border:l?"1px solid var(--hairline-strong)":"1px solid var(--hairline)",opacity:u&&!l?.55:1},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[t.jsxs("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink)",fontWeight:l?600:400},children:[d.label||k(d.type||"deadline"),l&&t.jsx("span",{style:{...$,marginLeft:8},children:"Next"})]}),t.jsxs("span",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-faint)"},children:[F(d.deadline_at),d.timezone?` · ${d.timezone}`:""]})]}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:12,fontWeight:600,whiteSpace:"nowrap",color:_(u?null:y,r)},children:X(y,r)})]},`${d.type??"deadline"}-${m}`)})]}),D(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:D(e).map(d=>t.jsx("span",{className:"tag-chip",style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:k(d)},d))}),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:16,paddingTop:12,borderTop:"1px solid var(--hairline)"},children:[e.url&&t.jsx("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--accent-text)"},children:"Visit website ↗"}),s&&t.jsxs("div",{style:{display:"flex",gap:12,marginLeft:"auto"},children:[t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>Z(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Google Calendar"}),t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>ee(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Apple / .ics"})]})]})]})]})})})},M=({id:e,label:a,checked:n,onChange:r})=>t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:[t.jsx(B,{id:e,checked:n,onCheckedChange:r}),t.jsx("label",{htmlFor:e,style:{cursor:"pointer"},children:a})]}),ne=({conf:e,now:a,selectedDomains:n,onToggleDomain:r,onOpen:o})=>{const i=T(e,a),s=i??L(e),g=s?new Date(s.deadline_at).getTime():null,c=_(i?g:null,a),p=z(e.start_date,e.end_date),d=[e.city??null,e.country??null].filter(Boolean).join(", ");return t.jsxs("div",{role:"button",tabIndex:0,onClick:()=>o(e),onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),o(e))},style:{border:"1px solid var(--hairline)",borderRadius:8,padding:20,background:"var(--bg-elevated)",display:"flex",flexDirection:"column",gap:12,cursor:"pointer"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:12},children:[t.jsx("h3",{style:{fontFamily:"var(--serif)",fontSize:20,fontWeight:500,letterSpacing:"-0.01em",margin:0},children:e.short_name?`${e.short_name} ${e.year??""}`.trim():e.name}),e.url&&t.jsx("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",onClick:m=>m.stopPropagation(),style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",whiteSpace:"nowrap"},children:"website ↗"})]}),t.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,paddingBottom:12,borderBottom:"1px solid var(--hairline)"},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)"},children:(s==null?void 0:s.label)||(s==null?void 0:s.type)||"Deadline"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:s?`${F(s.deadline_at)}${s.timezone?` · ${s.timezone}`:""}`:"TBD"})]}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:14,fontWeight:600,color:c,whiteSpace:"nowrap"},children:g!=null?Q(g,a):"TBD"})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)"},children:[p&&t.jsx("span",{children:p}),d&&t.jsx("span",{children:d})]}),D(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:D(e).map(m=>{const y=n.has(m);return t.jsx("button",{className:"tag-chip",onClick:l=>{l.stopPropagation(),r(m)},style:{background:y?"var(--ink)":"var(--bg-subtle)",color:y?"var(--bg)":"var(--ink-soft)"},children:k(m)},m)})})]})},me=()=>{const[e,a]=x.useState(!0),[n,r]=x.useState(!1),[o,i]=x.useState(new Set),[s,g]=x.useState(null),c=x.useMemo(()=>Date.now(),[]),p=A({queryKey:["conference-deadlines"],queryFn:()=>E.getConferenceDeadlines(),staleTime:10*60*1e3}),d=l=>{i(u=>{const h=new Set(u);return h.has(l)?h.delete(l):h.add(l),h})},m=x.useMemo(()=>{var u;const l=new Map;return(u=p.data)==null||u.results.forEach(h=>{D(h).forEach(j=>l.set(j,(l.get(j)??0)+1))}),Array.from(l.entries()).sort((h,j)=>j[1]-h[1]).map(([h])=>h)},[p.data]),y=x.useMemo(()=>{var j;const u=(((j=p.data)==null?void 0:j.results)??[]).filter(f=>!(e&&f.tier!=="a"||o.size>0&&!D(f).some(v=>o.has(v))||!n&&!T(f,c))),h=f=>{const w=T(f,c);if(w)return{group:0,time:new Date(w.deadline_at).getTime()};const v=L(f);return{group:1,time:-(v?new Date(v.deadline_at).getTime():0)}};return[...u].sort((f,w)=>{const v=h(f),N=h(w);return v.group!==N.group?v.group-N.group:v.time-N.time})},[p.data,e,n,o,c]);return p.error?t.jsx("div",{className:"page",children:t.jsx(W,{variant:"destructive",children:t.jsx(O,{children:"Failed to load conference deadlines. Please try again."})})}):t.jsxs("div",{className:"page",children:[t.jsx("div",{className:"feed-header",children:t.jsxs("div",{children:[t.jsxs("h1",{className:"feed-title",children:["AI Conference ",t.jsx("em",{children:"Deadlines"})]}),t.jsx("div",{className:"feed-subtitle",children:"Upcoming submission deadlines for major AI conferences, counting down."})]})}),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:20,padding:"16px 0",borderBottom:"1px solid var(--hairline)",marginBottom:24},children:[t.jsx(M,{id:"top-tier-only",label:"Top tier only",checked:e,onChange:a}),t.jsx(M,{id:"show-past",label:"Show past conferences",checked:n,onChange:r})]}),m.length>0&&t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:24},children:[m.map(l=>{const u=o.has(l);return t.jsx("button",{className:"tag-chip",onClick:()=>d(l),style:{background:u?"var(--ink)":"var(--bg-subtle)",color:u?"var(--bg)":"var(--ink-soft)"},children:k(l)},l)}),o.size>0&&t.jsx("button",{className:"tag-chip",onClick:()=>i(new Set),style:{background:"transparent",color:"var(--ink-faint)"},children:"Clear ✕"})]}),t.jsx("div",{className:"sort-bar",children:t.jsx("div",{className:"results-count",children:p.isLoading?"…":`${y.length} conferences`})}),p.isLoading?t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:Array.from({length:6}).map((l,u)=>t.jsx(U,{className:"h-44"},u))}):y.length===0?t.jsxs("div",{className:"no-results",children:["No conferences match these filters",n?".":" — try enabling “Show past conferences”."]}):t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:y.map(l=>t.jsx(ne,{conf:l,now:c,selectedDomains:o,onToggleDomain:d,onOpen:g},l.id))}),t.jsx(te,{conf:s,open:s!==null,onOpenChange:l=>{l||g(null)}})]})};export{me as default};
assets/{AuthorDetailView-02MKmAjH.js → AuthorDetailView-De9sKETG.js} RENAMED
@@ -1 +1 @@
1
- import{e as m,j as e,L as g,b as h}from"./index-CIXevVP9.js";import{u as d}from"./useQuery-BHSsBDmJ.js";import{S as c}from"./skeleton-BQDYAJTf.js";import x from"./NotFound-CpcrlF99.js";import"./useBaseQuery-BL30DOiU.js";const _=()=>{var i,l,n,o,u;const{authorId:a}=m(),r=d({queryKey:["author",a],queryFn:()=>h.getAuthor(a),enabled:!!a}),t=d({queryKey:["author-papers",a],queryFn:()=>h.getAuthorPapers(a,{page:1,page_size:20}),enabled:!!a});return((i=r.error)==null?void 0:i.status)===404?e.jsx(x,{}):e.jsxs("div",{className:"page",children:[e.jsx("p",{className:"sidebar-label",children:"Author"}),e.jsx("h1",{className:"feed-title",children:((l=r.data)==null?void 0:l.full_name)??e.jsx(c,{className:"h-10 w-64 inline-block"})}),((n=r.data)==null?void 0:n.hf_username)&&e.jsxs("a",{href:`https://huggingface.co/${r.data.hf_username}`,target:"_blank",rel:"noopener noreferrer",children:["@",r.data.hf_username," on Hugging Face"]}),e.jsxs("section",{style:{marginTop:40},"aria-labelledby":"author-papers-heading",children:[e.jsx("h2",{id:"author-papers-heading",children:"Research papers"}),t.isLoading&&e.jsx(c,{className:"h-24 w-full mt-4"}),((o=t.data)==null?void 0:o.results.length)===0&&e.jsx("p",{children:"No public papers are available."}),e.jsx("ol",{className:"paper-list",children:(u=t.data)==null?void 0:u.results.map(s=>{const p=s.source==="external"?String(s.id):s.arxiv_id;return e.jsx("li",{children:e.jsx(g,{to:`/paper/${p}`,children:s.title})},s.id)})})]})]})};export{_ as default};
 
1
+ import{e as m,j as e,L as g,b as h}from"./index-Bo5_2OqZ.js";import{u as d}from"./useQuery-Bh9FZQpL.js";import{S as c}from"./skeleton-CB-heJjl.js";import x from"./NotFound-CN-zdP49.js";import"./useBaseQuery-B8T7kRNC.js";const _=()=>{var i,l,n,o,u;const{authorId:a}=m(),r=d({queryKey:["author",a],queryFn:()=>h.getAuthor(a),enabled:!!a}),t=d({queryKey:["author-papers",a],queryFn:()=>h.getAuthorPapers(a,{page:1,page_size:20}),enabled:!!a});return((i=r.error)==null?void 0:i.status)===404?e.jsx(x,{}):e.jsxs("div",{className:"page",children:[e.jsx("p",{className:"sidebar-label",children:"Author"}),e.jsx("h1",{className:"feed-title",children:((l=r.data)==null?void 0:l.full_name)??e.jsx(c,{className:"h-10 w-64 inline-block"})}),((n=r.data)==null?void 0:n.hf_username)&&e.jsxs("a",{href:`https://huggingface.co/${r.data.hf_username}`,target:"_blank",rel:"noopener noreferrer",children:["@",r.data.hf_username," on Hugging Face"]}),e.jsxs("section",{style:{marginTop:40},"aria-labelledby":"author-papers-heading",children:[e.jsx("h2",{id:"author-papers-heading",children:"Research papers"}),t.isLoading&&e.jsx(c,{className:"h-24 w-full mt-4"}),((o=t.data)==null?void 0:o.results.length)===0&&e.jsx("p",{children:"No public papers are available."}),e.jsx("ol",{className:"paper-list",children:(u=t.data)==null?void 0:u.results.map(s=>{const p=s.source==="external"?String(s.id):s.arxiv_id;return e.jsx("li",{children:e.jsx(g,{to:`/paper/${p}`,children:s.title})},s.id)})})]})]})};export{_ as default};
assets/{BenchmarkDetailView-CyC0P7AS.js → BenchmarkDetailView-BSa9e3w8.js} RENAMED
@@ -1,2 +1,2 @@
1
- import{u as vt,r as w,j as n,a0 as ne,g as jt,e as _t,a as kt,V as St,L as me,b as ee}from"./index-CIXevVP9.js";import{u as te}from"./useQuery-BHSsBDmJ.js";import{S as xe}from"./skeleton-BQDYAJTf.js";import{S as Je}from"./switch-toPN9xmN.js";import{A as Ct,a as Et}from"./alert-axJAQJuC.js";import{L as ye}from"./LatexTitle-BmUg2c3G.js";import{C as Nt,E as Rt}from"./ExternalSourceEvalBadge-B5FVP6Hj.js";import{B as Tt}from"./BenchmarkTrendSparkline-c88osrLQ.js";import{I as $t}from"./components-BkZsumbI.js";import"./useBaseQuery-BL30DOiU.js";import"./index-xYsFHVgN.js";import"./katex.min-BSBacQyE.js";import"./hover-card-B7gdr0Iw.js";import"./transform-CNyzjv1G.js";function Mt(e,t,r){const s=t?(e??[]).filter(c=>c.task_id===t):e??[],a=s.filter(c=>c.is_open===!1),i=a.reduce((c,l)=>c?(l.best_rank??Number.POSITIVE_INFINITY)<(c.best_rank??Number.POSITIVE_INFINITY)?l:c:l,null);return{visible:r?s.filter(c=>c.is_open!==!1):s,hiddenClosed:a,topHiddenClosed:i}}function Ze(e){const t=e.length===7?`${e}-01`:e,r=new Date(t).getTime();return Number.isFinite(r)?r:0}const Ce=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ee(e){const t=new Date(e);return{year:t.getFullYear(),month:t.getMonth()}}function Ft(e,t){if(e===t){const{year:u,month:p}=Ee(e);return[{timestamp:new Date(u,p,1).getTime(),key:`${u}-${p}`,label:`${Ce[p]} ${u}`}]}const r=Ee(e),s=Ee(t);if(r.year===s.year){const u=s.month-r.month+1;let p=1;const f=12;u>f&&(p=Math.ceil(u/f));const y=[];for(let x=r.month;x<=s.month;x+=p)y.push({timestamp:new Date(r.year,x,1).getTime(),key:`${r.year}-${x}`,label:u<=3?`${Ce[x]} ${r.year}`:Ce[x]});return y}const a=s.year-r.year+1;let i=1;const c=12;a>c&&(i=Math.ceil(a/c));const l=[];for(let u=r.year;u<=s.year;u+=i)l.push({timestamp:new Date(u,0,1).getTime(),key:String(u),label:String(u)});return l}const Lt=({points:e,metric:t})=>{const r=vt(),[s,a]=w.useState(null),i=880,c=320,l=60,u=30,p=40,f=50,y=e.map(o=>o.value),x=Math.min(...y),U=Math.max(...y)-x||1,ae=i-l-u,L=c-p-f,$=e.map(o=>Ze(o.date)),z=Math.min(...$),I=Math.max(...$),ie=I-z||1,Y=o=>z===I?l+ae/2:l+(o-z)/ie*ae,G=e.map((o,m)=>{const k=Y(Ze(o.date)),v=(o.value-x)/U,M=p+L*(1-v);return{x:k,y:M,data:o,idx:m}}),N=G.filter(o=>o.data.isSota);let O="";if(N.length>=2){O=`M${N[0].x},${N[0].y}`;for(let o=1;o<N.length;o++){const m=N[o-1],k=N[o],v=(m.x+k.x)/2;O+=` C${v},${m.y} ${v},${k.y} ${k.x},${k.y}`}}const H=5.4,fe=8,J=9,A=o=>{const m=o.data.modelName||o.data.paperTitle||"";if(!m)return null;const k=m.length>22?m.slice(0,21)+"…":m,v=k.length*H;let M=o.x-v/2,C=o.x+v/2,V="middle";return M<l?(M=l,C=l+v,V="start"):C>i-u&&(C=i-u,M=C-v,V="end"),{x:V==="start"?l:V==="end"?i-u:o.x,y:o.y-J,text:k,anchor:V,left:M,right:C}},ce=[],b=N.length>0?A(N[N.length-1]):null;let _e=-1/0;for(let o=0;o<N.length-1;o++){const m=A(N[o]);m&&(m.left<_e+fe||b&&m.right>b.left-fe||(_e=m.right,ce.push({x:m.x,y:m.y,text:m.text,anchor:m.anchor})))}b&&ce.push({x:b.x,y:b.y,text:b.text,anchor:b.anchor});const K=Ft(z,I),W=5,le=o=>a(m=>m===o?null:m),oe=o=>{o&&r(`/paper/${o}`)},pe=(o,m)=>{const v=`${o.data.modelName||o.data.paperTitle||"Unknown model"}: ${ne(o.data.value)} on ${o.data.dateLabel}`,M=!!o.data.paperRouteId;return n.jsxs("g",{children:[m,n.jsx("circle",{cx:o.x,cy:o.y,r:"10",fill:"transparent",style:{cursor:M?"pointer":"default",outline:"none"},tabIndex:0,role:M?"link":"img","aria-label":v,onMouseEnter:()=>a(o.idx),onMouseLeave:()=>le(o.idx),onFocus:()=>a(o.idx),onBlur:()=>le(o.idx),onClick:()=>oe(o.data.paperRouteId),onKeyDown:C=>{M&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),oe(o.data.paperRouteId))},children:n.jsx("title",{children:v})})]},o.idx)};return n.jsxs("svg",{width:"100%",viewBox:`0 0 ${i} ${c}`,style:{display:"block"},children:[n.jsx("text",{x:l-38,y:p+L/2,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"middle",transform:`rotate(-90 ${l-38} ${p+L/2})`,children:t}),Array.from({length:W}).map((o,m)=>{const k=m/(W-1),v=p+L*(1-k),M=x+U*k;return n.jsxs("g",{children:[n.jsx("line",{x1:l,y1:v,x2:i-u,y2:v,stroke:"var(--hairline)",strokeWidth:"1"}),n.jsx("text",{x:l-10,y:v+4,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"end",children:ne(M)})]},m)}),K.map(o=>{const m=Y(o.timestamp);return n.jsx("text",{x:m,y:c-f+18,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:"middle",children:o.label},o.key)}),G.filter(o=>!o.data.isSota).map(o=>{const m=s===o.idx;return pe(o,n.jsx("circle",{cx:o.x,cy:o.y,r:m?3:2,fill:"var(--ink-faint)",opacity:m?1:.45,style:{transition:"r 0.12s ease, opacity 0.12s ease"}}))}),O&&n.jsx("path",{d:O,stroke:"var(--accent)",strokeWidth:"2",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),N.map(o=>{const m=s===o.idx;return pe(o,n.jsx("circle",{cx:o.x,cy:o.y,r:m?4.5:3,fill:m?"var(--accent)":"var(--bg-elevated)",stroke:"var(--accent)",strokeWidth:"1.5",style:{transition:"r 0.12s ease, fill 0.12s ease"}}))}),ce.map((o,m)=>n.jsx("text",{x:o.x,y:o.y,fontSize:"9.5",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:o.anchor,pointerEvents:"none",style:{paintOrder:"stroke",stroke:"var(--bg-elevated)",strokeWidth:3,strokeLinejoin:"round"},children:o.text},`label-${m}`)),s!==null&&G[s]&&(()=>{const o=G[s],m=o.data.modelName||o.data.paperTitle||"Unknown model",v=`${m.length>40?m.slice(0,39)+"…":m}: ${ne(o.data.value)}`,C=Math.max(120,Math.min(340,v.length*6.6+24)),V=30;let B=o.x-C/2;B<l&&(B=l),B+C>i-u&&(B=i-u-C);const Q=o.y-V-14>=p?o.y-V-12:o.y+12;return n.jsxs("g",{pointerEvents:"none",children:[n.jsx("rect",{x:B,y:Q,width:C,height:V,rx:"6",ry:"6",fill:"var(--bg-elevated)",stroke:"var(--hairline-strong)",strokeWidth:"1",style:{filter:"drop-shadow(0 2px 6px rgba(0,0,0,0.08))"}}),n.jsx("text",{x:B+12,y:Q+19,fontSize:"12",fontFamily:"var(--sans)",fill:"var(--ink)",fontWeight:500,children:v})]})})()]})};function It(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const r=document.implementation.createHTMLDocument(),s=r.createElement("base"),a=r.createElement("a");return r.head.appendChild(s),r.body.appendChild(a),t&&(s.href=t),a.href=e,a.href}const Pt=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function q(e){const t=[];for(let r=0,s=e.length;r<s;r++)t.push(e[r]);return t}let re=null;function dt(e={}){return re||(e.includeStyleProperties?(re=e.includeStyleProperties,re):(re=q(window.getComputedStyle(document.documentElement)),re))}function we(e,t){const s=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return s?parseFloat(s.replace("px","")):0}function At(e){const t=we(e,"border-left-width"),r=we(e,"border-right-width");return e.clientWidth+t+r}function Dt(e){const t=we(e,"border-top-width"),r=we(e,"border-bottom-width");return e.clientHeight+t+r}function ut(e,t={}){const r=t.width||At(e),s=t.height||Dt(e);return{width:r,height:s}}function Bt(){let e,t;try{t=process}catch{}const r=t&&t.env?t.env.devicePixelRatio:null;return r&&(e=parseInt(r,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const D=16384;function Ht(e){(e.width>D||e.height>D)&&(e.width>D&&e.height>D?e.width>e.height?(e.height*=D/e.width,e.width=D):(e.width*=D/e.height,e.height=D):e.width>D?(e.height*=D/e.width,e.width=D):(e.width*=D/e.height,e.height=D))}function Vt(e,t={}){return e.toBlob?new Promise(r=>{e.toBlob(r,t.type?t.type:"image/png",t.quality?t.quality:1)}):new Promise(r=>{const s=window.atob(e.toDataURL(t.type?t.type:void 0,t.quality?t.quality:void 0).split(",")[1]),a=s.length,i=new Uint8Array(a);for(let c=0;c<a;c+=1)i[c]=s.charCodeAt(c);r(new Blob([i],{type:t.type?t.type:"image/png"}))})}function ve(e){return new Promise((t,r)=>{const s=new Image;s.onload=()=>{s.decode().then(()=>{requestAnimationFrame(()=>t(s))})},s.onerror=r,s.crossOrigin="anonymous",s.decoding="async",s.src=e})}async function Ot(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Ut(e,t,r){const s="http://www.w3.org/2000/svg",a=document.createElementNS(s,"svg"),i=document.createElementNS(s,"foreignObject");return a.setAttribute("width",`${t}`),a.setAttribute("height",`${r}`),a.setAttribute("viewBox",`0 0 ${t} ${r}`),i.setAttribute("width","100%"),i.setAttribute("height","100%"),i.setAttribute("x","0"),i.setAttribute("y","0"),i.setAttribute("externalResourcesRequired","true"),a.appendChild(i),i.appendChild(e),Ot(a)}const P=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||P(r,t)};function Wt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function qt(e,t){return dt(t).map(r=>{const s=e.getPropertyValue(r),a=e.getPropertyPriority(r);return`${r}: ${s}${a?" !important":""};`}).join(" ")}function zt(e,t,r,s){const a=`.${e}:${t}`,i=r.cssText?Wt(r):qt(r,s);return document.createTextNode(`${a}{${i}}`)}function et(e,t,r,s){const a=window.getComputedStyle(e,r),i=a.getPropertyValue("content");if(i===""||i==="none")return;const c=Pt();try{t.className=`${t.className} ${c}`}catch{return}const l=document.createElement("style");l.appendChild(zt(c,r,a,s)),t.appendChild(l)}function Gt(e,t,r){et(e,t,":before",r),et(e,t,":after",r)}const tt="application/font-woff",rt="image/jpeg",Kt={woff:tt,woff2:tt,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:rt,jpeg:rt,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Qt(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function $e(e){const t=Qt(e).toLowerCase();return Kt[t]||""}function Xt(e){return e.split(/,/)[1]}function Re(e){return e.search(/^(data:)/)!==-1}function Yt(e,t){return`data:${t};base64,${e}`}async function mt(e,t,r){const s=await fetch(e,t);if(s.status===404)throw new Error(`Resource "${s.url}" not found`);const a=await s.blob();return new Promise((i,c)=>{const l=new FileReader;l.onerror=c,l.onloadend=()=>{try{i(r({res:s,result:l.result}))}catch(u){c(u)}},l.readAsDataURL(a)})}const Ne={};function Jt(e,t,r){let s=e.replace(/\?.*/,"");return r&&(s=e),/ttf|otf|eot|woff2?/i.test(s)&&(s=s.replace(/.*\//,"")),t?`[${t}]${s}`:s}async function Me(e,t,r){const s=Jt(e,t,r.includeQueryParams);if(Ne[s]!=null)return Ne[s];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let a;try{const i=await mt(e,r.fetchRequestInit,({res:c,result:l})=>(t||(t=c.headers.get("Content-Type")||""),Xt(l)));a=Yt(i,t)}catch(i){a=r.imagePlaceholder||"";let c=`Failed to fetch resource: ${e}`;i&&(c=typeof i=="string"?i:i.message),c&&console.warn(c)}return Ne[s]=a,a}async function Zt(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):ve(t)}async function er(e,t){if(e.currentSrc){const i=document.createElement("canvas"),c=i.getContext("2d");i.width=e.clientWidth,i.height=e.clientHeight,c==null||c.drawImage(e,0,0,i.width,i.height);const l=i.toDataURL();return ve(l)}const r=e.poster,s=$e(r),a=await Me(r,s,t);return ve(a)}async function tr(e,t){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await je(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function rr(e,t){return P(e,HTMLCanvasElement)?Zt(e):P(e,HTMLVideoElement)?er(e,t):P(e,HTMLIFrameElement)?tr(e,t):e.cloneNode(ht(e))}const sr=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",ht=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function nr(e,t,r){var s,a;if(ht(t))return t;let i=[];return sr(e)&&e.assignedNodes?i=q(e.assignedNodes()):P(e,HTMLIFrameElement)&&(!((s=e.contentDocument)===null||s===void 0)&&s.body)?i=q(e.contentDocument.body.childNodes):i=q(((a=e.shadowRoot)!==null&&a!==void 0?a:e).childNodes),i.length===0||P(e,HTMLVideoElement)||await i.reduce((c,l)=>c.then(()=>je(l,r)).then(u=>{u&&t.appendChild(u)}),Promise.resolve()),t}function ar(e,t,r){const s=t.style;if(!s)return;const a=window.getComputedStyle(e);a.cssText?(s.cssText=a.cssText,s.transformOrigin=a.transformOrigin):dt(r).forEach(i=>{let c=a.getPropertyValue(i);i==="font-size"&&c.endsWith("px")&&(c=`${Math.floor(parseFloat(c.substring(0,c.length-2)))-.1}px`),P(e,HTMLIFrameElement)&&i==="display"&&c==="inline"&&(c="block"),i==="d"&&t.getAttribute("d")&&(c=`path(${t.getAttribute("d")})`),s.setProperty(i,c,a.getPropertyPriority(i))})}function ir(e,t){P(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),P(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function cr(e,t){if(P(e,HTMLSelectElement)){const r=t,s=Array.from(r.children).find(a=>e.value===a.getAttribute("value"));s&&s.setAttribute("selected","")}}function lr(e,t,r){return P(t,Element)&&(ar(e,t,r),Gt(e,t,r),ir(e,t),cr(e,t)),t}async function or(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const s={};for(let i=0;i<r.length;i++){const l=r[i].getAttribute("xlink:href");if(l){const u=e.querySelector(l),p=document.querySelector(l);!u&&p&&!s[l]&&(s[l]=await je(p,t,!0))}}const a=Object.values(s);if(a.length){const i="http://www.w3.org/1999/xhtml",c=document.createElementNS(i,"svg");c.setAttribute("xmlns",i),c.style.position="absolute",c.style.width="0",c.style.height="0",c.style.overflow="hidden",c.style.display="none";const l=document.createElementNS(i,"defs");c.appendChild(l);for(let u=0;u<a.length;u++)l.appendChild(a[u]);e.appendChild(c)}return e}async function je(e,t,r){return!r&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(s=>rr(s,t)).then(s=>nr(e,s,t)).then(s=>lr(e,s,t)).then(s=>or(s,t))}const ft=/url\((['"]?)([^'"]+?)\1\)/g,dr=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,ur=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function mr(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function hr(e){const t=[];return e.replace(ft,(r,s,a)=>(t.push(a),r)),t.filter(r=>!Re(r))}async function fr(e,t,r,s,a){try{const i=r?It(t,r):t,c=$e(t);let l;return a||(l=await Me(i,c,s)),e.replace(mr(t),`$1${l}$3`)}catch{}return e}function pr(e,{preferredFontFormat:t}){return t?e.replace(ur,r=>{for(;;){const[s,,a]=dr.exec(r)||[];if(!a)return"";if(a===t)return`src: ${s};`}}):e}function pt(e){return e.search(ft)!==-1}async function gt(e,t,r){if(!pt(e))return e;const s=pr(e,r);return hr(s).reduce((i,c)=>i.then(l=>fr(l,c,t,r)),Promise.resolve(s))}async function se(e,t,r){var s;const a=(s=t.style)===null||s===void 0?void 0:s.getPropertyValue(e);if(a){const i=await gt(a,null,r);return t.style.setProperty(e,i,t.style.getPropertyPriority(e)),!0}return!1}async function gr(e,t){await se("background",e,t)||await se("background-image",e,t),await se("mask",e,t)||await se("-webkit-mask",e,t)||await se("mask-image",e,t)||await se("-webkit-mask-image",e,t)}async function xr(e,t){const r=P(e,HTMLImageElement);if(!(r&&!Re(e.src))&&!(P(e,SVGImageElement)&&!Re(e.href.baseVal)))return;const s=r?e.src:e.href.baseVal,a=await Me(s,$e(s),t);await new Promise((i,c)=>{e.onload=i,e.onerror=t.onImageErrorHandler?(...u)=>{try{i(t.onImageErrorHandler(...u))}catch(p){c(p)}}:c;const l=e;l.decode&&(l.decode=i),l.loading==="lazy"&&(l.loading="eager"),r?(e.srcset="",e.src=a):e.href.baseVal=a})}async function br(e,t){const s=q(e.childNodes).map(a=>xt(a,t));await Promise.all(s).then(()=>e)}async function xt(e,t){P(e,Element)&&(await gr(e,t),await xr(e,t),await br(e,t))}function yr(e,t){const{style:r}=e;t.backgroundColor&&(r.backgroundColor=t.backgroundColor),t.width&&(r.width=`${t.width}px`),t.height&&(r.height=`${t.height}px`);const s=t.style;return s!=null&&Object.keys(s).forEach(a=>{r[a]=s[a]}),e}const st={};async function nt(e){let t=st[e];if(t!=null)return t;const s=await(await fetch(e)).text();return t={url:e,cssText:s},st[e]=t,t}async function at(e,t){let r=e.cssText;const s=/url\(["']?([^"')]+)["']?\)/g,i=(r.match(/url\([^)]+\)/g)||[]).map(async c=>{let l=c.replace(s,"$1");return l.startsWith("https://")||(l=new URL(l,e.url).href),mt(l,t.fetchRequestInit,({result:u})=>(r=r.replace(c,`url(${u})`),[c,u]))});return Promise.all(i).then(()=>r)}function it(e){if(e==null)return[];const t=[],r=/(\/\*[\s\S]*?\*\/)/gi;let s=e.replace(r,"");const a=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const u=a.exec(s);if(u===null)break;t.push(u[0])}s=s.replace(a,"");const i=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,c="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",l=new RegExp(c,"gi");for(;;){let u=i.exec(s);if(u===null){if(u=l.exec(s),u===null)break;i.lastIndex=l.lastIndex}else l.lastIndex=i.lastIndex;t.push(u[0])}return t}async function wr(e,t){const r=[],s=[];return e.forEach(a=>{if("cssRules"in a)try{q(a.cssRules||[]).forEach((i,c)=>{if(i.type===CSSRule.IMPORT_RULE){let l=c+1;const u=i.href,p=nt(u).then(f=>at(f,t)).then(f=>it(f).forEach(y=>{try{a.insertRule(y,y.startsWith("@import")?l+=1:a.cssRules.length)}catch(x){console.error("Error inserting rule from remote css",{rule:y,error:x})}})).catch(f=>{console.error("Error loading remote css",f.toString())});s.push(p)}})}catch(i){const c=e.find(l=>l.href==null)||document.styleSheets[0];a.href!=null&&s.push(nt(a.href).then(l=>at(l,t)).then(l=>it(l).forEach(u=>{c.insertRule(u,c.cssRules.length)})).catch(l=>{console.error("Error loading remote stylesheet",l)})),console.error("Error inlining remote css file",i)}}),Promise.all(s).then(()=>(e.forEach(a=>{if("cssRules"in a)try{q(a.cssRules||[]).forEach(i=>{r.push(i)})}catch(i){console.error(`Error while reading CSS rules from ${a.href}`,i)}}),r))}function vr(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>pt(t.style.getPropertyValue("src")))}async function jr(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=q(e.ownerDocument.styleSheets),s=await wr(r,t);return vr(s)}function bt(e){return e.trim().replace(/["']/g,"")}function _r(e){const t=new Set;function r(s){(s.style.fontFamily||getComputedStyle(s).fontFamily).split(",").forEach(i=>{t.add(bt(i))}),Array.from(s.children).forEach(i=>{i instanceof HTMLElement&&r(i)})}return r(e),t}async function kr(e,t){const r=await jr(e,t),s=_r(e);return(await Promise.all(r.filter(i=>s.has(bt(i.style.fontFamily))).map(i=>{const c=i.parentStyleSheet?i.parentStyleSheet.href:null;return gt(i.cssText,c,t)}))).join(`
2
  `)}async function Sr(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await kr(e,t);if(r){const s=document.createElement("style"),a=document.createTextNode(r);s.appendChild(a),e.firstChild?e.insertBefore(s,e.firstChild):e.appendChild(s)}}async function Cr(e,t={}){const{width:r,height:s}=ut(e,t),a=await je(e,t,!0);return await Sr(a,t),await xt(a,t),yr(a,t),await Ut(a,r,s)}async function Er(e,t={}){const{width:r,height:s}=ut(e,t),a=await Cr(e,t),i=await ve(a),c=document.createElement("canvas"),l=c.getContext("2d"),u=t.pixelRatio||Bt(),p=t.canvasWidth||r,f=t.canvasHeight||s;return c.width=p*u,c.height=f*u,t.skipAutoScale||Ht(c),c.style.width=`${p}`,c.style.height=`${f}`,t.backgroundColor&&(l.fillStyle=t.backgroundColor,l.fillRect(0,0,c.width,c.height)),l.drawImage(i,0,0,c.width,c.height),c}async function Nr(e,t={}){const r=await Er(e,t);return await Vt(r)}const Te="#ffffff";function Rr(){return typeof window>"u"?Te:window.getComputedStyle(document.documentElement).getPropertyValue("--bg-elevated").trim()||Te}function Tr(e){if(typeof window>"u")return Te;const t=window.getComputedStyle(e).backgroundColor;return!t||t==="rgba(0, 0, 0, 0)"||t==="transparent"?Rr():t}async function $r(e){var r,s;if(typeof window>"u"||!((s=(r=window.navigator)==null?void 0:r.clipboard)!=null&&s.write))throw new Error("Clipboard image copy is not supported in this browser.");if(typeof window.ClipboardItem>"u")throw new Error("Clipboard image copy is not supported in this browser.");const t=await Nr(e,{pixelRatio:2,cacheBust:!0,backgroundColor:Tr(e)});if(!t)throw new Error("Failed to render screenshot.");await window.navigator.clipboard.write([new window.ClipboardItem({"image/png":t})])}const ct=({targetRef:e,label:t})=>{const{toast:r}=jt(),[s,a]=w.useState("idle"),i=w.useRef(null);w.useEffect(()=>()=>{i.current!==null&&window.clearTimeout(i.current)},[]);const c=w.useCallback(async()=>{const u=e.current;if(u){a("copying"),u.classList.add("is-capturing"),u.offsetHeight,await new Promise(p=>window.requestAnimationFrame(()=>p()));try{await $r(u),a("copied"),r({title:"Screenshot copied",description:`Image of the ${t} copied to your clipboard.`}),i.current!==null&&window.clearTimeout(i.current),i.current=window.setTimeout(()=>a("idle"),1500)}catch(p){a("idle"),r({title:"Copy failed",description:p instanceof Error&&p.message?p.message:"Could not copy the screenshot to your clipboard.",variant:"destructive"})}finally{u.classList.remove("is-capturing")}}},[e,t,r]),l=s==="copied"?"Copied":s==="copying"?"Copying…":"Copy image";return n.jsxs("button",{type:"button",className:"bm-copy-btn",onClick:c,disabled:s==="copying","aria-label":`Copy ${t} screenshot to clipboard`,title:`Copy ${t} screenshot to clipboard`,children:[n.jsx($t,{name:"copy",size:11}),l]})};function he(e){if(e==null)return null;if(typeof e=="number")return Number.isFinite(e)?e:null;const t=e.includes("±")?e.split("±")[0].trim():e.trim(),r=parseFloat(t);return Number.isFinite(r)?r:null}function Mr(e){return[e.paper_id,e.task_id,e.dataset_id,e.model_name,e.harness??""].join("|")}function Fr(e){const t=new Map;for(const r of e){const s=Mr(r),a=t.get(s);if(!a){t.set(s,{...r,metrics:{...r.metrics||{}},sourceEvaluationIds:[r.id],ranksByMetric:r.best_metric&&r.best_rank!=null?{[r.best_metric]:r.best_rank}:{}});continue}a.metrics={...a.metrics,...r.metrics||{}},a.sourceEvaluationIds.push(r.id),r.best_metric&&r.best_rank!=null&&(a.ranksByMetric[r.best_metric]=r.best_rank)}return Array.from(t.values())}function lt(e,t){return t?e.id===t||e.sourceEvaluationIds.includes(t):!1}function ot(e,t){return e.ranksByMetric[t]??e.best_rank??9999}function Lr(e,t,r){if(e.length===0)return{points:[],sota:0,sotaModel:""};const s=e.map(f=>{var E;const y=he((E=f.metrics)==null?void 0:E[t]),x=f.paper_published_date||"";return{eval:f,value:y,date:x}}).filter(f=>f.value!==null&&!!f.date).sort((f,y)=>f.date.localeCompare(y.date)),a=[];let i=null;for(const f of s){const y=i==null?!0:r==="↓"?f.value<i:f.value>i;y&&(i=f.value),a.push({value:f.value,date:f.date,dateLabel:f.date.slice(0,7),modelName:f.eval.model_name||"",paperTitle:f.eval.paper_title||"",paperRouteId:f.eval.paper_arxiv_id||f.eval.paper_id||null,isSota:y})}const l=e.map(f=>{var y;return{eval:f,value:he((y=f.metrics)==null?void 0:y[t])}}).filter(f=>f.value!==null).sort((f,y)=>r==="↓"?f.value-y.value:y.value-f.value)[0],u=(l==null?void 0:l.value)??0,p=(l==null?void 0:l.eval.model_name)||(l==null?void 0:l.eval.paper_title)||"";return{points:a,sota:u,sotaModel:p}}const Ir=5;function Pr(e){if(!e)return null;const t=e.trim(),r=t.match(/^https?:\/\/(?:www\.)?arxiv\.org\/(?:abs|pdf)\/([^/?#]+)/i);if(r!=null&&r[1])return r[1].replace(/\.pdf$/i,"");const s=t.match(/^(?:https?:\/\/(?:www\.)?paperswithcode\.co)?\/paper\/([^/?#]+)/i);return(s==null?void 0:s[1])??null}function be(e,t){return e?n.jsx(ye,{title:e}):t||"—"}const Yr=()=>{var Le,Ie,Pe,Ae,De,Be,He,Ve,Oe,Ue,We,qe,ze;const{datasetSlug:e}=_t(),[t]=kt(),r=t.get("task")||void 0,s=t.get("eval")||void 0,{preferences:a,setHideClosedSourceEvals:i}=St(),[c,l]=w.useState(void 0),u=w.useRef(null),p=w.useRef(!1),f=w.useRef(null),y=w.useRef(null),x=te({queryKey:["dataset",e,"with-paper",r,a.hide_closed_source_evals?"open":"all"],queryFn:()=>ee.getDatasetBySlug(e,{include_paper:!0,task:r,is_open:a.hide_closed_source_evals?!0:void 0}),enabled:!!e,staleTime:10*60*1e3}),E=te({queryKey:["dataset-evals",(Le=x.data)==null?void 0:Le.id],queryFn:()=>ee.getEvaluationsByDataset(x.data.id),enabled:!!((Ie=x.data)!=null&&Ie.id),staleTime:5*60*1e3}),U=te({queryKey:["dataset-tasks",(Pe=x.data)==null?void 0:Pe.id],queryFn:()=>ee.getDatasetTasks(x.data.id),enabled:!!((Ae=x.data)!=null&&Ae.id),staleTime:10*60*1e3}),ae=te({queryKey:["metric-directions"],queryFn:()=>ee.getMetricDirections(),staleTime:60*60*1e3}),L=w.useMemo(()=>{var d;return!s||!((d=E.data)!=null&&d.length)?null:E.data.find(g=>g.id===s)||null},[s,E.data]),$=w.useMemo(()=>{const d=U.data||[];if(d.length===0)return null;if(L!=null&&L.task_id&&d.some(h=>h.id===L.task_id))return L.task_id;if(r){const h=d.find(S=>S.slug===r);if(h)return h.id}if(d.length===1)return d[0].id;const g=E.data||[];if(g.length>0){const h=new Map;for(const j of g)h.set(j.task_id,(h.get(j.task_id)||0)+1);let S=null,T=-1;for(const j of d){const ue=h.get(j.id)||0;ue>T&&(T=ue,S=j.id)}if(S)return S}return d[0].id},[U.data,E.data,r,L]),z=te({queryKey:["task-benchmark-trends",$,a.hide_closed_source_evals?!0:void 0],queryFn:()=>ee.getTrendingBenchmarks($,{limit:100,min_recent_papers:0,is_open:a.hide_closed_source_evals?!0:void 0}),enabled:!!$&&!!((De=x.data)!=null&&De.id),staleTime:10*60*1e3}),I=w.useMemo(()=>{var d;return(((d=z.data)==null?void 0:d.results)||[]).find(g=>{var h;return g.id===((h=x.data)==null?void 0:h.id)})||null},[z.data,(Be=x.data)==null?void 0:Be.id]),ie=te({queryKey:["leaderboard-metrics",(He=x.data)==null?void 0:He.id,$],queryFn:()=>ee.getLeaderboardMetrics(x.data.id,$),enabled:!!((Ve=x.data)!=null&&Ve.id)&&!!$,staleTime:10*60*1e3}),Y=w.useMemo(()=>Mt(E.data,$,a.hide_closed_source_evals),[E.data,$,a.hide_closed_source_evals]),G=Y.visible,N=Y.hiddenClosed,O=Y.topHiddenClosed,H=w.useMemo(()=>Fr(G),[G]),fe=w.useMemo(()=>{const d=new Set;return H.forEach(g=>{g.best_metric&&d.add(g.best_metric),Object.keys(g.metrics||{}).forEach(h=>d.add(h))}),Array.from(d)},[H]),J=w.useMemo(()=>(ie.data||[]).map(d=>d.metric_name),[ie.data]),A=J.length?J:fe,ce=w.useMemo(()=>{var S;if(H.length===0)return A[0]||"";const d=new Map;for(const T of H)for(const j of Object.keys(T.metrics||{}))J.length&&!A.includes(j)||d.set(j,(d.get(j)||0)+1);let g=null,h=0;for(const[T,j]of d)j>h&&(h=j,g=T);return g||A[0]||((S=H[0])==null?void 0:S.best_metric)||""},[H,A,J]),b=c||(L==null?void 0:L.best_metric)||ce,K=(((Ue=(Oe=ae.data)==null?void 0:Oe.directions)==null?void 0:Ue[b])||"higher_is_better")==="lower_is_better"?"↓":"↑",W=w.useMemo(()=>!b||!A.includes(b)?A:[b,...A.filter(d=>d!==b)],[A,b]),le=w.useMemo(()=>W.length===0?b?[b]:[]:W.slice(0,Ir),[W,b]),{points:oe,sota:pe,sotaModel:o}=w.useMemo(()=>Lr(H,b,K),[H,b,K]),m=(We=x.data)==null?void 0:We.leaderboard_summary,k=E.isSuccess&&U.isSuccess&&ae.isSuccess&&(!$||ie.isSuccess),v=k?b:m==null?void 0:m.metric,M=k?pe:m==null?void 0:m.value,C=k?o:m==null?void 0:m.model_name,V=!k&&!m;w.useEffect(()=>{if(p.current||!s||!E.data||E.data.length===0)return;const d=u.current;d&&(p.current=!0,d.scrollIntoView({behavior:"smooth",block:"start"}))},[s,E.data]);const B=w.useMemo(()=>{const d=U.data||[];return $?d.find(g=>g.id===$)||d[0]||null:d[0]||null},[U.data,$]);if(x.isLoading)return n.jsxs("div",{className:"page",children:[n.jsx(xe,{className:"h-12 w-1/2 mb-6"}),n.jsx(xe,{className:"h-64 w-full"})]});if(x.error||!x.data)return n.jsx("div",{className:"page",children:n.jsx(Ct,{variant:"destructive",children:n.jsx(Et,{children:"Benchmark not found."})})});const _=x.data,Q=H.slice().sort((d,g)=>{var T,j;const h=he((T=d.metrics)==null?void 0:T[b]),S=he((j=g.metrics)==null?void 0:j[b]);return h!==null&&S!==null?K==="↓"?h-S:S-h:h!==null?-1:S!==null?1:ot(d,b)-ot(g,b)}),Fe=!!_.supports_harness,R=s&&Q.find(d=>lt(d,s))||null,F=_.introducing_paper??void 0,de=(F==null?void 0:F.arxiv_id)||(F==null?void 0:F.id)||Pr(_.paper_url),X=(F==null?void 0:F.title)||_.introducing_paper_title||null,Z=((qe=F==null?void 0:F.published)==null?void 0:qe.slice(0,4))||_.introduced_year||null,yt=!!de||!!_.paper_url||!!X,wt=F!=null&&F.arxiv_id||(ze=_.paper_url)!=null&&ze.match(/^https?:\/\/(?:www\.)?arxiv\.org\//i)?`arXiv:${de}`:`Paper ${de}`;return n.jsx("div",{className:"page",children:n.jsxs("div",{className:"bm-page",children:[n.jsxs("div",{className:"breadcrumb",children:[n.jsx(me,{to:"/tasks",children:"Tasks"}),B&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"sep",children:"/"}),n.jsx(me,{to:`/tasks/${B.slug||B.id}`,children:B.name})]}),n.jsx("span",{className:"sep",children:"/"}),n.jsx("span",{style:{color:"var(--accent-text)"},children:_.name})]}),n.jsxs("div",{className:"bm-title-row",children:[n.jsx("h1",{className:"bm-title",children:_.name}),I&&n.jsxs("div",{className:"bm-title-trend","aria-label":`${_.name} reporting trend`,children:[n.jsx(Tt,{history:I.history,benchmarkName:I.name}),n.jsxs("span",{className:"bm-title-trend-summary",children:[n.jsx("strong",{children:I.recent_paper_count})," ",I.recent_paper_count===1?"paper":"papers",I.rate_change==null?I.recent_paper_count>0&&n.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):n.jsxs("span",{className:`benchmark-trend-change ${I.rate_change>=1?"is-up":"is-down"}`,children:[I.rate_change>=1?"↑":"↓"," ",I.rate_change.toFixed(1),"×"]})]})]})]}),n.jsxs("div",{className:"bm-subtitle",children:[V?n.jsx(xe,{className:"h-5 w-64 bm-summary-skeleton","aria-label":"Loading benchmark summary"}):n.jsxs("span",{children:[v&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"metric-tag",children:v}),n.jsx("span",{style:{color:"var(--hairline-strong)",margin:"0 8px"},children:"·"})]}),C?n.jsxs("span",{children:["Best: ",n.jsx("span",{className:"best-name",children:ne(M)})," by ",n.jsx("span",{className:"best-name",style:{fontStyle:"normal"},children:C})]}):n.jsxs("span",{children:[Q.length," evaluations"]})]}),_.hf_url&&n.jsxs("a",{className:"bm-action-btn",href:_.hf_url,target:"_blank",rel:"noopener noreferrer",children:[n.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),_.description&&n.jsx("p",{className:"bm-description",children:_.description}),a.hide_closed_source_evals&&N.length>0&&n.jsxs("div",{className:"bm-hidden-closed-notice",children:[n.jsxs("span",{children:[N.length," closed-source ",N.length===1?"row is":"rows are"," hidden",O!=null&&O.model_name?n.jsxs(n.Fragment,{children:[", including ",n.jsx("strong",{children:O.model_name})]}):null,"."]}),n.jsx("button",{type:"button",className:"bm-hidden-closed-action",onClick:()=>{i(!1)},children:"Show closed-source"})]}),yt&&n.jsxs("div",{className:"method-source",style:{marginTop:0,marginBottom:18},children:[n.jsx("span",{className:"method-source-label",children:"Source"}),de?n.jsxs(me,{to:`/paper/${de}`,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(ye,{title:X}):wt}),Z&&n.jsx("span",{className:"method-source-meta",children:Z})]}):_.paper_url?n.jsxs("a",{href:_.paper_url,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(ye,{title:X}):_.paper_url}),Z&&n.jsx("span",{className:"method-source-meta",children:Z})]}):n.jsxs("div",{className:"method-source-link is-static",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(ye,{title:X}):null}),Z&&n.jsx("span",{className:"method-source-meta",children:Z})]})]}),oe.filter(d=>d.isSota).length>=2&&n.jsxs("div",{className:"bm-card",ref:f,children:[n.jsxs("div",{className:"bm-card-screenshot-header","aria-hidden":"true",children:[n.jsxs("div",{className:"bm-card-screenshot-title",children:[n.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),n.jsx("span",{className:"bm-card-screenshot-name",children:_.name})]}),n.jsxs("div",{className:"bm-card-screenshot-brand",children:[n.jsxs("span",{className:"brand",children:[n.jsx("span",{className:"brand-mark"}),n.jsxs("span",{className:"brand-name",children:["Papers ",n.jsx("em",{children:"With Code"})]})]}),n.jsx("span",{className:"bm-card-screenshot-url",children:"paperswithcode.co"})]})]}),n.jsxs("div",{className:"bm-card-head",children:[n.jsx("div",{className:"bm-card-title",children:"SOTA progression"}),n.jsxs("div",{className:"bm-card-actions",children:[A.length>1&&n.jsxs("label",{className:"bm-view-select",children:[n.jsx("span",{className:"bm-view-select-label",children:"View"}),n.jsx("select",{value:b,onChange:d=>l(d.target.value),children:W.map(d=>n.jsx("option",{value:d,children:d},d))})]}),n.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[n.jsx(Je,{className:"bm-closed-toggle-switch",checked:!a.hide_closed_source_evals,onCheckedChange:d=>{i(!d)},"aria-label":"Show closed-source models"}),n.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),n.jsx(ct,{targetRef:f,label:"SOTA chart"})]})]}),n.jsx("div",{className:"bm-chart-wrap",children:n.jsx(Lt,{points:oe,metric:b})}),n.jsxs("div",{className:"bm-chart-foot",children:[n.jsx("span",{className:"legend-dot"}),"All models over time · highlighted dots track the running best · hover for the model · click to open the paper"]})]}),R&&(()=>{var T,j;const d=R.paper_arxiv_id||R.paper_id,g=R.paper_title||(R.paper_arxiv_id?`arXiv:${R.paper_arxiv_id}`:null),h=R.best_metric&&((T=R.metrics)==null?void 0:T[R.best_metric])!==void 0?R.best_metric:b,S=(j=R.metrics)==null?void 0:j[h];return n.jsxs("div",{className:"bm-highlight-banner",role:"status",children:[n.jsx("span",{className:"bm-highlight-dot","aria-hidden":"true"}),n.jsxs("div",{className:"bm-highlight-text",children:[n.jsx("span",{className:"bm-highlight-label",children:"Comparing result"}),n.jsxs("span",{className:"bm-highlight-paper",children:[R.model_name||g||"—",R.harness?` · ${R.harness}`:""]}),n.jsxs("span",{className:"bm-highlight-meta",children:[S!==void 0&&h?n.jsxs(n.Fragment,{children:[h,": ",ne(S),g?" · ":""]}):null,d?n.jsx(me,{to:`/paper/${d}`,children:be(R.paper_title,g)}):be(R.paper_title,g)]})]})]})})(),n.jsxs("div",{className:"bm-card",ref:y,children:[n.jsxs("div",{className:"bm-card-screenshot-header","aria-hidden":"true",children:[n.jsxs("div",{className:"bm-card-screenshot-title",children:[n.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),n.jsx("span",{className:"bm-card-screenshot-name",children:_.name})]}),n.jsxs("div",{className:"bm-card-screenshot-brand",children:[n.jsxs("span",{className:"brand",children:[n.jsx("span",{className:"brand-mark"}),n.jsxs("span",{className:"brand-name",children:["Papers ",n.jsx("em",{children:"With Code"})]})]}),n.jsx("span",{className:"bm-card-screenshot-url",children:"paperswithcode.co"})]})]}),n.jsxs("div",{className:"bm-card-head",children:[n.jsx("div",{className:"bm-card-title",children:"Leaderboard"}),n.jsxs("div",{className:"bm-card-actions",children:[A.length>1&&n.jsxs("label",{className:"bm-view-select",children:[n.jsx("span",{className:"bm-view-select-label",children:"View"}),n.jsx("select",{value:b,onChange:d=>l(d.target.value),children:W.map(d=>n.jsx("option",{value:d,children:d},d))})]}),n.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[n.jsx(Je,{className:"bm-closed-toggle-switch",checked:!a.hide_closed_source_evals,onCheckedChange:d=>{i(!d)},"aria-label":"Show closed-source models"}),n.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),n.jsx(ct,{targetRef:y,label:"leaderboard"})]})]}),E.isLoading?n.jsx("div",{style:{padding:16},children:Array.from({length:5}).map((d,g)=>n.jsx(xe,{className:"h-10 w-full mb-2"},g))}):Q.length===0?n.jsx("div",{className:"no-results",children:"No evaluations submitted yet."}):n.jsx("div",{className:"bm-table-scroll",children:n.jsxs("table",{className:"bm-table",children:[n.jsx("thead",{children:n.jsxs("tr",{children:[n.jsx("th",{className:"col-rank",children:"Rank"}),n.jsx("th",{className:"col-model",children:"Model"}),Fe&&n.jsx("th",{className:"col-harness",children:"Harness"}),le.map(d=>{const g=d===b;return n.jsx("th",{className:`col-value ${g?"is-active":""}`,"aria-sort":g?K==="↓"?"ascending":"descending":"none",children:n.jsxs("button",{type:"button",className:"bm-metric-header",onClick:()=>l(d),"aria-pressed":g,title:`Sort by ${d}`,children:[d,g?` ${K}`:""]})},d)}),n.jsx("th",{className:"col-paper",children:"Paper"}),n.jsx("th",{className:"col-year",children:"Year"})]})}),n.jsx("tbody",{children:(()=>{let d=null,g=0;return Q.map((h,S)=>{var Ke,Qe;const T=he((Ke=h.metrics)==null?void 0:Ke[b]);let j=null;T!==null&&((d===null||T!==d)&&(g=S+1,d=T),j=g);const ue=h.paper_arxiv_id||h.paper_id,Ge=h.paper_title||(h.paper_arxiv_id?`arXiv:${h.paper_arxiv_id}`:null),ke=lt(h,s);return n.jsxs("tr",{ref:ke?u:void 0,className:ke?"is-highlighted":void 0,children:[n.jsx("td",{className:"col-rank",children:j??"—"}),n.jsxs("td",{className:"col-model",children:[ke&&n.jsx("span",{className:"bm-row-marker","aria-hidden":"true"}),h.hf_model_url?n.jsx("a",{href:h.hf_model_url,target:"_blank",rel:"noopener noreferrer",className:"bm-model-link",title:`Open ${h.model_name||"model"} on Hugging Face`,children:h.model_name||"—"}):h.model_name||"—",h.is_open===!1&&n.jsx(Nt,{}),(h.external??h.is_external)&&n.jsx(Rt,{sourceUrl:h.source_url||h.external_source_url||h.result_url})]}),Fe&&n.jsx("td",{className:"col-harness",children:h.harness||"—"}),le.map(Se=>{var Ye;const Xe=Se===b,ge=(Ye=h.metrics)==null?void 0:Ye[Se];return n.jsx("td",{className:`col-value${Xe?" is-active":""}${Xe&&j===1?" is-best":""}`,children:ge!=null&&ge!==""?ne(ge):"—"},Se)}),n.jsx("td",{className:"col-paper",children:ue?n.jsx(me,{to:`/paper/${ue}`,children:be(h.paper_title,Ge)}):be(h.paper_title,Ge)}),n.jsx("td",{className:"col-year",children:((Qe=h.paper_published_date)==null?void 0:Qe.slice(0,4))||"—"})]},h.id)})})()})]})})]})]})})};export{Yr as default};
 
1
+ import{u as vt,r as w,j as n,a0 as ne,g as jt,e as _t,a as kt,V as St,L as me,b as ee}from"./index-Bo5_2OqZ.js";import{u as te}from"./useQuery-Bh9FZQpL.js";import{S as xe}from"./skeleton-CB-heJjl.js";import{S as Je}from"./switch-DGcXQvGy.js";import{A as Ct,a as Et}from"./alert-_EYQlDHA.js";import{L as ye}from"./LatexTitle-qoY4vrTZ.js";import{C as Nt,E as Rt}from"./ExternalSourceEvalBadge-BYtEDxNm.js";import{B as Tt}from"./BenchmarkTrendSparkline-BCbEDZUr.js";import{I as $t}from"./components-BbXgE2lV.js";import"./useBaseQuery-B8T7kRNC.js";import"./index-DWt5uuhX.js";import"./katex.min-BSBacQyE.js";import"./hover-card-DrtqDSb0.js";import"./transform-2Gnjg1jt.js";function Mt(e,t,r){const s=t?(e??[]).filter(c=>c.task_id===t):e??[],a=s.filter(c=>c.is_open===!1),i=a.reduce((c,l)=>c?(l.best_rank??Number.POSITIVE_INFINITY)<(c.best_rank??Number.POSITIVE_INFINITY)?l:c:l,null);return{visible:r?s.filter(c=>c.is_open!==!1):s,hiddenClosed:a,topHiddenClosed:i}}function Ze(e){const t=e.length===7?`${e}-01`:e,r=new Date(t).getTime();return Number.isFinite(r)?r:0}const Ce=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ee(e){const t=new Date(e);return{year:t.getFullYear(),month:t.getMonth()}}function Ft(e,t){if(e===t){const{year:u,month:p}=Ee(e);return[{timestamp:new Date(u,p,1).getTime(),key:`${u}-${p}`,label:`${Ce[p]} ${u}`}]}const r=Ee(e),s=Ee(t);if(r.year===s.year){const u=s.month-r.month+1;let p=1;const f=12;u>f&&(p=Math.ceil(u/f));const y=[];for(let x=r.month;x<=s.month;x+=p)y.push({timestamp:new Date(r.year,x,1).getTime(),key:`${r.year}-${x}`,label:u<=3?`${Ce[x]} ${r.year}`:Ce[x]});return y}const a=s.year-r.year+1;let i=1;const c=12;a>c&&(i=Math.ceil(a/c));const l=[];for(let u=r.year;u<=s.year;u+=i)l.push({timestamp:new Date(u,0,1).getTime(),key:String(u),label:String(u)});return l}const Lt=({points:e,metric:t})=>{const r=vt(),[s,a]=w.useState(null),i=880,c=320,l=60,u=30,p=40,f=50,y=e.map(o=>o.value),x=Math.min(...y),U=Math.max(...y)-x||1,ae=i-l-u,L=c-p-f,$=e.map(o=>Ze(o.date)),z=Math.min(...$),I=Math.max(...$),ie=I-z||1,Y=o=>z===I?l+ae/2:l+(o-z)/ie*ae,G=e.map((o,m)=>{const k=Y(Ze(o.date)),v=(o.value-x)/U,M=p+L*(1-v);return{x:k,y:M,data:o,idx:m}}),N=G.filter(o=>o.data.isSota);let O="";if(N.length>=2){O=`M${N[0].x},${N[0].y}`;for(let o=1;o<N.length;o++){const m=N[o-1],k=N[o],v=(m.x+k.x)/2;O+=` C${v},${m.y} ${v},${k.y} ${k.x},${k.y}`}}const H=5.4,fe=8,J=9,A=o=>{const m=o.data.modelName||o.data.paperTitle||"";if(!m)return null;const k=m.length>22?m.slice(0,21)+"…":m,v=k.length*H;let M=o.x-v/2,C=o.x+v/2,V="middle";return M<l?(M=l,C=l+v,V="start"):C>i-u&&(C=i-u,M=C-v,V="end"),{x:V==="start"?l:V==="end"?i-u:o.x,y:o.y-J,text:k,anchor:V,left:M,right:C}},ce=[],b=N.length>0?A(N[N.length-1]):null;let _e=-1/0;for(let o=0;o<N.length-1;o++){const m=A(N[o]);m&&(m.left<_e+fe||b&&m.right>b.left-fe||(_e=m.right,ce.push({x:m.x,y:m.y,text:m.text,anchor:m.anchor})))}b&&ce.push({x:b.x,y:b.y,text:b.text,anchor:b.anchor});const K=Ft(z,I),W=5,le=o=>a(m=>m===o?null:m),oe=o=>{o&&r(`/paper/${o}`)},pe=(o,m)=>{const v=`${o.data.modelName||o.data.paperTitle||"Unknown model"}: ${ne(o.data.value)} on ${o.data.dateLabel}`,M=!!o.data.paperRouteId;return n.jsxs("g",{children:[m,n.jsx("circle",{cx:o.x,cy:o.y,r:"10",fill:"transparent",style:{cursor:M?"pointer":"default",outline:"none"},tabIndex:0,role:M?"link":"img","aria-label":v,onMouseEnter:()=>a(o.idx),onMouseLeave:()=>le(o.idx),onFocus:()=>a(o.idx),onBlur:()=>le(o.idx),onClick:()=>oe(o.data.paperRouteId),onKeyDown:C=>{M&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),oe(o.data.paperRouteId))},children:n.jsx("title",{children:v})})]},o.idx)};return n.jsxs("svg",{width:"100%",viewBox:`0 0 ${i} ${c}`,style:{display:"block"},children:[n.jsx("text",{x:l-38,y:p+L/2,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"middle",transform:`rotate(-90 ${l-38} ${p+L/2})`,children:t}),Array.from({length:W}).map((o,m)=>{const k=m/(W-1),v=p+L*(1-k),M=x+U*k;return n.jsxs("g",{children:[n.jsx("line",{x1:l,y1:v,x2:i-u,y2:v,stroke:"var(--hairline)",strokeWidth:"1"}),n.jsx("text",{x:l-10,y:v+4,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"end",children:ne(M)})]},m)}),K.map(o=>{const m=Y(o.timestamp);return n.jsx("text",{x:m,y:c-f+18,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:"middle",children:o.label},o.key)}),G.filter(o=>!o.data.isSota).map(o=>{const m=s===o.idx;return pe(o,n.jsx("circle",{cx:o.x,cy:o.y,r:m?3:2,fill:"var(--ink-faint)",opacity:m?1:.45,style:{transition:"r 0.12s ease, opacity 0.12s ease"}}))}),O&&n.jsx("path",{d:O,stroke:"var(--accent)",strokeWidth:"2",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),N.map(o=>{const m=s===o.idx;return pe(o,n.jsx("circle",{cx:o.x,cy:o.y,r:m?4.5:3,fill:m?"var(--accent)":"var(--bg-elevated)",stroke:"var(--accent)",strokeWidth:"1.5",style:{transition:"r 0.12s ease, fill 0.12s ease"}}))}),ce.map((o,m)=>n.jsx("text",{x:o.x,y:o.y,fontSize:"9.5",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:o.anchor,pointerEvents:"none",style:{paintOrder:"stroke",stroke:"var(--bg-elevated)",strokeWidth:3,strokeLinejoin:"round"},children:o.text},`label-${m}`)),s!==null&&G[s]&&(()=>{const o=G[s],m=o.data.modelName||o.data.paperTitle||"Unknown model",v=`${m.length>40?m.slice(0,39)+"…":m}: ${ne(o.data.value)}`,C=Math.max(120,Math.min(340,v.length*6.6+24)),V=30;let B=o.x-C/2;B<l&&(B=l),B+C>i-u&&(B=i-u-C);const Q=o.y-V-14>=p?o.y-V-12:o.y+12;return n.jsxs("g",{pointerEvents:"none",children:[n.jsx("rect",{x:B,y:Q,width:C,height:V,rx:"6",ry:"6",fill:"var(--bg-elevated)",stroke:"var(--hairline-strong)",strokeWidth:"1",style:{filter:"drop-shadow(0 2px 6px rgba(0,0,0,0.08))"}}),n.jsx("text",{x:B+12,y:Q+19,fontSize:"12",fontFamily:"var(--sans)",fill:"var(--ink)",fontWeight:500,children:v})]})})()]})};function It(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const r=document.implementation.createHTMLDocument(),s=r.createElement("base"),a=r.createElement("a");return r.head.appendChild(s),r.body.appendChild(a),t&&(s.href=t),a.href=e,a.href}const Pt=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function q(e){const t=[];for(let r=0,s=e.length;r<s;r++)t.push(e[r]);return t}let re=null;function dt(e={}){return re||(e.includeStyleProperties?(re=e.includeStyleProperties,re):(re=q(window.getComputedStyle(document.documentElement)),re))}function we(e,t){const s=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return s?parseFloat(s.replace("px","")):0}function At(e){const t=we(e,"border-left-width"),r=we(e,"border-right-width");return e.clientWidth+t+r}function Dt(e){const t=we(e,"border-top-width"),r=we(e,"border-bottom-width");return e.clientHeight+t+r}function ut(e,t={}){const r=t.width||At(e),s=t.height||Dt(e);return{width:r,height:s}}function Bt(){let e,t;try{t=process}catch{}const r=t&&t.env?t.env.devicePixelRatio:null;return r&&(e=parseInt(r,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const D=16384;function Ht(e){(e.width>D||e.height>D)&&(e.width>D&&e.height>D?e.width>e.height?(e.height*=D/e.width,e.width=D):(e.width*=D/e.height,e.height=D):e.width>D?(e.height*=D/e.width,e.width=D):(e.width*=D/e.height,e.height=D))}function Vt(e,t={}){return e.toBlob?new Promise(r=>{e.toBlob(r,t.type?t.type:"image/png",t.quality?t.quality:1)}):new Promise(r=>{const s=window.atob(e.toDataURL(t.type?t.type:void 0,t.quality?t.quality:void 0).split(",")[1]),a=s.length,i=new Uint8Array(a);for(let c=0;c<a;c+=1)i[c]=s.charCodeAt(c);r(new Blob([i],{type:t.type?t.type:"image/png"}))})}function ve(e){return new Promise((t,r)=>{const s=new Image;s.onload=()=>{s.decode().then(()=>{requestAnimationFrame(()=>t(s))})},s.onerror=r,s.crossOrigin="anonymous",s.decoding="async",s.src=e})}async function Ot(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Ut(e,t,r){const s="http://www.w3.org/2000/svg",a=document.createElementNS(s,"svg"),i=document.createElementNS(s,"foreignObject");return a.setAttribute("width",`${t}`),a.setAttribute("height",`${r}`),a.setAttribute("viewBox",`0 0 ${t} ${r}`),i.setAttribute("width","100%"),i.setAttribute("height","100%"),i.setAttribute("x","0"),i.setAttribute("y","0"),i.setAttribute("externalResourcesRequired","true"),a.appendChild(i),i.appendChild(e),Ot(a)}const P=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||P(r,t)};function Wt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function qt(e,t){return dt(t).map(r=>{const s=e.getPropertyValue(r),a=e.getPropertyPriority(r);return`${r}: ${s}${a?" !important":""};`}).join(" ")}function zt(e,t,r,s){const a=`.${e}:${t}`,i=r.cssText?Wt(r):qt(r,s);return document.createTextNode(`${a}{${i}}`)}function et(e,t,r,s){const a=window.getComputedStyle(e,r),i=a.getPropertyValue("content");if(i===""||i==="none")return;const c=Pt();try{t.className=`${t.className} ${c}`}catch{return}const l=document.createElement("style");l.appendChild(zt(c,r,a,s)),t.appendChild(l)}function Gt(e,t,r){et(e,t,":before",r),et(e,t,":after",r)}const tt="application/font-woff",rt="image/jpeg",Kt={woff:tt,woff2:tt,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:rt,jpeg:rt,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Qt(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function $e(e){const t=Qt(e).toLowerCase();return Kt[t]||""}function Xt(e){return e.split(/,/)[1]}function Re(e){return e.search(/^(data:)/)!==-1}function Yt(e,t){return`data:${t};base64,${e}`}async function mt(e,t,r){const s=await fetch(e,t);if(s.status===404)throw new Error(`Resource "${s.url}" not found`);const a=await s.blob();return new Promise((i,c)=>{const l=new FileReader;l.onerror=c,l.onloadend=()=>{try{i(r({res:s,result:l.result}))}catch(u){c(u)}},l.readAsDataURL(a)})}const Ne={};function Jt(e,t,r){let s=e.replace(/\?.*/,"");return r&&(s=e),/ttf|otf|eot|woff2?/i.test(s)&&(s=s.replace(/.*\//,"")),t?`[${t}]${s}`:s}async function Me(e,t,r){const s=Jt(e,t,r.includeQueryParams);if(Ne[s]!=null)return Ne[s];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let a;try{const i=await mt(e,r.fetchRequestInit,({res:c,result:l})=>(t||(t=c.headers.get("Content-Type")||""),Xt(l)));a=Yt(i,t)}catch(i){a=r.imagePlaceholder||"";let c=`Failed to fetch resource: ${e}`;i&&(c=typeof i=="string"?i:i.message),c&&console.warn(c)}return Ne[s]=a,a}async function Zt(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):ve(t)}async function er(e,t){if(e.currentSrc){const i=document.createElement("canvas"),c=i.getContext("2d");i.width=e.clientWidth,i.height=e.clientHeight,c==null||c.drawImage(e,0,0,i.width,i.height);const l=i.toDataURL();return ve(l)}const r=e.poster,s=$e(r),a=await Me(r,s,t);return ve(a)}async function tr(e,t){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await je(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function rr(e,t){return P(e,HTMLCanvasElement)?Zt(e):P(e,HTMLVideoElement)?er(e,t):P(e,HTMLIFrameElement)?tr(e,t):e.cloneNode(ht(e))}const sr=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",ht=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function nr(e,t,r){var s,a;if(ht(t))return t;let i=[];return sr(e)&&e.assignedNodes?i=q(e.assignedNodes()):P(e,HTMLIFrameElement)&&(!((s=e.contentDocument)===null||s===void 0)&&s.body)?i=q(e.contentDocument.body.childNodes):i=q(((a=e.shadowRoot)!==null&&a!==void 0?a:e).childNodes),i.length===0||P(e,HTMLVideoElement)||await i.reduce((c,l)=>c.then(()=>je(l,r)).then(u=>{u&&t.appendChild(u)}),Promise.resolve()),t}function ar(e,t,r){const s=t.style;if(!s)return;const a=window.getComputedStyle(e);a.cssText?(s.cssText=a.cssText,s.transformOrigin=a.transformOrigin):dt(r).forEach(i=>{let c=a.getPropertyValue(i);i==="font-size"&&c.endsWith("px")&&(c=`${Math.floor(parseFloat(c.substring(0,c.length-2)))-.1}px`),P(e,HTMLIFrameElement)&&i==="display"&&c==="inline"&&(c="block"),i==="d"&&t.getAttribute("d")&&(c=`path(${t.getAttribute("d")})`),s.setProperty(i,c,a.getPropertyPriority(i))})}function ir(e,t){P(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),P(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function cr(e,t){if(P(e,HTMLSelectElement)){const r=t,s=Array.from(r.children).find(a=>e.value===a.getAttribute("value"));s&&s.setAttribute("selected","")}}function lr(e,t,r){return P(t,Element)&&(ar(e,t,r),Gt(e,t,r),ir(e,t),cr(e,t)),t}async function or(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const s={};for(let i=0;i<r.length;i++){const l=r[i].getAttribute("xlink:href");if(l){const u=e.querySelector(l),p=document.querySelector(l);!u&&p&&!s[l]&&(s[l]=await je(p,t,!0))}}const a=Object.values(s);if(a.length){const i="http://www.w3.org/1999/xhtml",c=document.createElementNS(i,"svg");c.setAttribute("xmlns",i),c.style.position="absolute",c.style.width="0",c.style.height="0",c.style.overflow="hidden",c.style.display="none";const l=document.createElementNS(i,"defs");c.appendChild(l);for(let u=0;u<a.length;u++)l.appendChild(a[u]);e.appendChild(c)}return e}async function je(e,t,r){return!r&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(s=>rr(s,t)).then(s=>nr(e,s,t)).then(s=>lr(e,s,t)).then(s=>or(s,t))}const ft=/url\((['"]?)([^'"]+?)\1\)/g,dr=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,ur=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function mr(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function hr(e){const t=[];return e.replace(ft,(r,s,a)=>(t.push(a),r)),t.filter(r=>!Re(r))}async function fr(e,t,r,s,a){try{const i=r?It(t,r):t,c=$e(t);let l;return a||(l=await Me(i,c,s)),e.replace(mr(t),`$1${l}$3`)}catch{}return e}function pr(e,{preferredFontFormat:t}){return t?e.replace(ur,r=>{for(;;){const[s,,a]=dr.exec(r)||[];if(!a)return"";if(a===t)return`src: ${s};`}}):e}function pt(e){return e.search(ft)!==-1}async function gt(e,t,r){if(!pt(e))return e;const s=pr(e,r);return hr(s).reduce((i,c)=>i.then(l=>fr(l,c,t,r)),Promise.resolve(s))}async function se(e,t,r){var s;const a=(s=t.style)===null||s===void 0?void 0:s.getPropertyValue(e);if(a){const i=await gt(a,null,r);return t.style.setProperty(e,i,t.style.getPropertyPriority(e)),!0}return!1}async function gr(e,t){await se("background",e,t)||await se("background-image",e,t),await se("mask",e,t)||await se("-webkit-mask",e,t)||await se("mask-image",e,t)||await se("-webkit-mask-image",e,t)}async function xr(e,t){const r=P(e,HTMLImageElement);if(!(r&&!Re(e.src))&&!(P(e,SVGImageElement)&&!Re(e.href.baseVal)))return;const s=r?e.src:e.href.baseVal,a=await Me(s,$e(s),t);await new Promise((i,c)=>{e.onload=i,e.onerror=t.onImageErrorHandler?(...u)=>{try{i(t.onImageErrorHandler(...u))}catch(p){c(p)}}:c;const l=e;l.decode&&(l.decode=i),l.loading==="lazy"&&(l.loading="eager"),r?(e.srcset="",e.src=a):e.href.baseVal=a})}async function br(e,t){const s=q(e.childNodes).map(a=>xt(a,t));await Promise.all(s).then(()=>e)}async function xt(e,t){P(e,Element)&&(await gr(e,t),await xr(e,t),await br(e,t))}function yr(e,t){const{style:r}=e;t.backgroundColor&&(r.backgroundColor=t.backgroundColor),t.width&&(r.width=`${t.width}px`),t.height&&(r.height=`${t.height}px`);const s=t.style;return s!=null&&Object.keys(s).forEach(a=>{r[a]=s[a]}),e}const st={};async function nt(e){let t=st[e];if(t!=null)return t;const s=await(await fetch(e)).text();return t={url:e,cssText:s},st[e]=t,t}async function at(e,t){let r=e.cssText;const s=/url\(["']?([^"')]+)["']?\)/g,i=(r.match(/url\([^)]+\)/g)||[]).map(async c=>{let l=c.replace(s,"$1");return l.startsWith("https://")||(l=new URL(l,e.url).href),mt(l,t.fetchRequestInit,({result:u})=>(r=r.replace(c,`url(${u})`),[c,u]))});return Promise.all(i).then(()=>r)}function it(e){if(e==null)return[];const t=[],r=/(\/\*[\s\S]*?\*\/)/gi;let s=e.replace(r,"");const a=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const u=a.exec(s);if(u===null)break;t.push(u[0])}s=s.replace(a,"");const i=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,c="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",l=new RegExp(c,"gi");for(;;){let u=i.exec(s);if(u===null){if(u=l.exec(s),u===null)break;i.lastIndex=l.lastIndex}else l.lastIndex=i.lastIndex;t.push(u[0])}return t}async function wr(e,t){const r=[],s=[];return e.forEach(a=>{if("cssRules"in a)try{q(a.cssRules||[]).forEach((i,c)=>{if(i.type===CSSRule.IMPORT_RULE){let l=c+1;const u=i.href,p=nt(u).then(f=>at(f,t)).then(f=>it(f).forEach(y=>{try{a.insertRule(y,y.startsWith("@import")?l+=1:a.cssRules.length)}catch(x){console.error("Error inserting rule from remote css",{rule:y,error:x})}})).catch(f=>{console.error("Error loading remote css",f.toString())});s.push(p)}})}catch(i){const c=e.find(l=>l.href==null)||document.styleSheets[0];a.href!=null&&s.push(nt(a.href).then(l=>at(l,t)).then(l=>it(l).forEach(u=>{c.insertRule(u,c.cssRules.length)})).catch(l=>{console.error("Error loading remote stylesheet",l)})),console.error("Error inlining remote css file",i)}}),Promise.all(s).then(()=>(e.forEach(a=>{if("cssRules"in a)try{q(a.cssRules||[]).forEach(i=>{r.push(i)})}catch(i){console.error(`Error while reading CSS rules from ${a.href}`,i)}}),r))}function vr(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>pt(t.style.getPropertyValue("src")))}async function jr(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=q(e.ownerDocument.styleSheets),s=await wr(r,t);return vr(s)}function bt(e){return e.trim().replace(/["']/g,"")}function _r(e){const t=new Set;function r(s){(s.style.fontFamily||getComputedStyle(s).fontFamily).split(",").forEach(i=>{t.add(bt(i))}),Array.from(s.children).forEach(i=>{i instanceof HTMLElement&&r(i)})}return r(e),t}async function kr(e,t){const r=await jr(e,t),s=_r(e);return(await Promise.all(r.filter(i=>s.has(bt(i.style.fontFamily))).map(i=>{const c=i.parentStyleSheet?i.parentStyleSheet.href:null;return gt(i.cssText,c,t)}))).join(`
2
  `)}async function Sr(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await kr(e,t);if(r){const s=document.createElement("style"),a=document.createTextNode(r);s.appendChild(a),e.firstChild?e.insertBefore(s,e.firstChild):e.appendChild(s)}}async function Cr(e,t={}){const{width:r,height:s}=ut(e,t),a=await je(e,t,!0);return await Sr(a,t),await xt(a,t),yr(a,t),await Ut(a,r,s)}async function Er(e,t={}){const{width:r,height:s}=ut(e,t),a=await Cr(e,t),i=await ve(a),c=document.createElement("canvas"),l=c.getContext("2d"),u=t.pixelRatio||Bt(),p=t.canvasWidth||r,f=t.canvasHeight||s;return c.width=p*u,c.height=f*u,t.skipAutoScale||Ht(c),c.style.width=`${p}`,c.style.height=`${f}`,t.backgroundColor&&(l.fillStyle=t.backgroundColor,l.fillRect(0,0,c.width,c.height)),l.drawImage(i,0,0,c.width,c.height),c}async function Nr(e,t={}){const r=await Er(e,t);return await Vt(r)}const Te="#ffffff";function Rr(){return typeof window>"u"?Te:window.getComputedStyle(document.documentElement).getPropertyValue("--bg-elevated").trim()||Te}function Tr(e){if(typeof window>"u")return Te;const t=window.getComputedStyle(e).backgroundColor;return!t||t==="rgba(0, 0, 0, 0)"||t==="transparent"?Rr():t}async function $r(e){var r,s;if(typeof window>"u"||!((s=(r=window.navigator)==null?void 0:r.clipboard)!=null&&s.write))throw new Error("Clipboard image copy is not supported in this browser.");if(typeof window.ClipboardItem>"u")throw new Error("Clipboard image copy is not supported in this browser.");const t=await Nr(e,{pixelRatio:2,cacheBust:!0,backgroundColor:Tr(e)});if(!t)throw new Error("Failed to render screenshot.");await window.navigator.clipboard.write([new window.ClipboardItem({"image/png":t})])}const ct=({targetRef:e,label:t})=>{const{toast:r}=jt(),[s,a]=w.useState("idle"),i=w.useRef(null);w.useEffect(()=>()=>{i.current!==null&&window.clearTimeout(i.current)},[]);const c=w.useCallback(async()=>{const u=e.current;if(u){a("copying"),u.classList.add("is-capturing"),u.offsetHeight,await new Promise(p=>window.requestAnimationFrame(()=>p()));try{await $r(u),a("copied"),r({title:"Screenshot copied",description:`Image of the ${t} copied to your clipboard.`}),i.current!==null&&window.clearTimeout(i.current),i.current=window.setTimeout(()=>a("idle"),1500)}catch(p){a("idle"),r({title:"Copy failed",description:p instanceof Error&&p.message?p.message:"Could not copy the screenshot to your clipboard.",variant:"destructive"})}finally{u.classList.remove("is-capturing")}}},[e,t,r]),l=s==="copied"?"Copied":s==="copying"?"Copying…":"Copy image";return n.jsxs("button",{type:"button",className:"bm-copy-btn",onClick:c,disabled:s==="copying","aria-label":`Copy ${t} screenshot to clipboard`,title:`Copy ${t} screenshot to clipboard`,children:[n.jsx($t,{name:"copy",size:11}),l]})};function he(e){if(e==null)return null;if(typeof e=="number")return Number.isFinite(e)?e:null;const t=e.includes("±")?e.split("±")[0].trim():e.trim(),r=parseFloat(t);return Number.isFinite(r)?r:null}function Mr(e){return[e.paper_id,e.task_id,e.dataset_id,e.model_name,e.harness??""].join("|")}function Fr(e){const t=new Map;for(const r of e){const s=Mr(r),a=t.get(s);if(!a){t.set(s,{...r,metrics:{...r.metrics||{}},sourceEvaluationIds:[r.id],ranksByMetric:r.best_metric&&r.best_rank!=null?{[r.best_metric]:r.best_rank}:{}});continue}a.metrics={...a.metrics,...r.metrics||{}},a.sourceEvaluationIds.push(r.id),r.best_metric&&r.best_rank!=null&&(a.ranksByMetric[r.best_metric]=r.best_rank)}return Array.from(t.values())}function lt(e,t){return t?e.id===t||e.sourceEvaluationIds.includes(t):!1}function ot(e,t){return e.ranksByMetric[t]??e.best_rank??9999}function Lr(e,t,r){if(e.length===0)return{points:[],sota:0,sotaModel:""};const s=e.map(f=>{var E;const y=he((E=f.metrics)==null?void 0:E[t]),x=f.paper_published_date||"";return{eval:f,value:y,date:x}}).filter(f=>f.value!==null&&!!f.date).sort((f,y)=>f.date.localeCompare(y.date)),a=[];let i=null;for(const f of s){const y=i==null?!0:r==="↓"?f.value<i:f.value>i;y&&(i=f.value),a.push({value:f.value,date:f.date,dateLabel:f.date.slice(0,7),modelName:f.eval.model_name||"",paperTitle:f.eval.paper_title||"",paperRouteId:f.eval.paper_arxiv_id||f.eval.paper_id||null,isSota:y})}const l=e.map(f=>{var y;return{eval:f,value:he((y=f.metrics)==null?void 0:y[t])}}).filter(f=>f.value!==null).sort((f,y)=>r==="↓"?f.value-y.value:y.value-f.value)[0],u=(l==null?void 0:l.value)??0,p=(l==null?void 0:l.eval.model_name)||(l==null?void 0:l.eval.paper_title)||"";return{points:a,sota:u,sotaModel:p}}const Ir=5;function Pr(e){if(!e)return null;const t=e.trim(),r=t.match(/^https?:\/\/(?:www\.)?arxiv\.org\/(?:abs|pdf)\/([^/?#]+)/i);if(r!=null&&r[1])return r[1].replace(/\.pdf$/i,"");const s=t.match(/^(?:https?:\/\/(?:www\.)?paperswithcode\.co)?\/paper\/([^/?#]+)/i);return(s==null?void 0:s[1])??null}function be(e,t){return e?n.jsx(ye,{title:e}):t||"—"}const Yr=()=>{var Le,Ie,Pe,Ae,De,Be,He,Ve,Oe,Ue,We,qe,ze;const{datasetSlug:e}=_t(),[t]=kt(),r=t.get("task")||void 0,s=t.get("eval")||void 0,{preferences:a,setHideClosedSourceEvals:i}=St(),[c,l]=w.useState(void 0),u=w.useRef(null),p=w.useRef(!1),f=w.useRef(null),y=w.useRef(null),x=te({queryKey:["dataset",e,"with-paper",r,a.hide_closed_source_evals?"open":"all"],queryFn:()=>ee.getDatasetBySlug(e,{include_paper:!0,task:r,is_open:a.hide_closed_source_evals?!0:void 0}),enabled:!!e,staleTime:10*60*1e3}),E=te({queryKey:["dataset-evals",(Le=x.data)==null?void 0:Le.id],queryFn:()=>ee.getEvaluationsByDataset(x.data.id),enabled:!!((Ie=x.data)!=null&&Ie.id),staleTime:5*60*1e3}),U=te({queryKey:["dataset-tasks",(Pe=x.data)==null?void 0:Pe.id],queryFn:()=>ee.getDatasetTasks(x.data.id),enabled:!!((Ae=x.data)!=null&&Ae.id),staleTime:10*60*1e3}),ae=te({queryKey:["metric-directions"],queryFn:()=>ee.getMetricDirections(),staleTime:60*60*1e3}),L=w.useMemo(()=>{var d;return!s||!((d=E.data)!=null&&d.length)?null:E.data.find(g=>g.id===s)||null},[s,E.data]),$=w.useMemo(()=>{const d=U.data||[];if(d.length===0)return null;if(L!=null&&L.task_id&&d.some(h=>h.id===L.task_id))return L.task_id;if(r){const h=d.find(S=>S.slug===r);if(h)return h.id}if(d.length===1)return d[0].id;const g=E.data||[];if(g.length>0){const h=new Map;for(const j of g)h.set(j.task_id,(h.get(j.task_id)||0)+1);let S=null,T=-1;for(const j of d){const ue=h.get(j.id)||0;ue>T&&(T=ue,S=j.id)}if(S)return S}return d[0].id},[U.data,E.data,r,L]),z=te({queryKey:["task-benchmark-trends",$,a.hide_closed_source_evals?!0:void 0],queryFn:()=>ee.getTrendingBenchmarks($,{limit:100,min_recent_papers:0,is_open:a.hide_closed_source_evals?!0:void 0}),enabled:!!$&&!!((De=x.data)!=null&&De.id),staleTime:10*60*1e3}),I=w.useMemo(()=>{var d;return(((d=z.data)==null?void 0:d.results)||[]).find(g=>{var h;return g.id===((h=x.data)==null?void 0:h.id)})||null},[z.data,(Be=x.data)==null?void 0:Be.id]),ie=te({queryKey:["leaderboard-metrics",(He=x.data)==null?void 0:He.id,$],queryFn:()=>ee.getLeaderboardMetrics(x.data.id,$),enabled:!!((Ve=x.data)!=null&&Ve.id)&&!!$,staleTime:10*60*1e3}),Y=w.useMemo(()=>Mt(E.data,$,a.hide_closed_source_evals),[E.data,$,a.hide_closed_source_evals]),G=Y.visible,N=Y.hiddenClosed,O=Y.topHiddenClosed,H=w.useMemo(()=>Fr(G),[G]),fe=w.useMemo(()=>{const d=new Set;return H.forEach(g=>{g.best_metric&&d.add(g.best_metric),Object.keys(g.metrics||{}).forEach(h=>d.add(h))}),Array.from(d)},[H]),J=w.useMemo(()=>(ie.data||[]).map(d=>d.metric_name),[ie.data]),A=J.length?J:fe,ce=w.useMemo(()=>{var S;if(H.length===0)return A[0]||"";const d=new Map;for(const T of H)for(const j of Object.keys(T.metrics||{}))J.length&&!A.includes(j)||d.set(j,(d.get(j)||0)+1);let g=null,h=0;for(const[T,j]of d)j>h&&(h=j,g=T);return g||A[0]||((S=H[0])==null?void 0:S.best_metric)||""},[H,A,J]),b=c||(L==null?void 0:L.best_metric)||ce,K=(((Ue=(Oe=ae.data)==null?void 0:Oe.directions)==null?void 0:Ue[b])||"higher_is_better")==="lower_is_better"?"↓":"↑",W=w.useMemo(()=>!b||!A.includes(b)?A:[b,...A.filter(d=>d!==b)],[A,b]),le=w.useMemo(()=>W.length===0?b?[b]:[]:W.slice(0,Ir),[W,b]),{points:oe,sota:pe,sotaModel:o}=w.useMemo(()=>Lr(H,b,K),[H,b,K]),m=(We=x.data)==null?void 0:We.leaderboard_summary,k=E.isSuccess&&U.isSuccess&&ae.isSuccess&&(!$||ie.isSuccess),v=k?b:m==null?void 0:m.metric,M=k?pe:m==null?void 0:m.value,C=k?o:m==null?void 0:m.model_name,V=!k&&!m;w.useEffect(()=>{if(p.current||!s||!E.data||E.data.length===0)return;const d=u.current;d&&(p.current=!0,d.scrollIntoView({behavior:"smooth",block:"start"}))},[s,E.data]);const B=w.useMemo(()=>{const d=U.data||[];return $?d.find(g=>g.id===$)||d[0]||null:d[0]||null},[U.data,$]);if(x.isLoading)return n.jsxs("div",{className:"page",children:[n.jsx(xe,{className:"h-12 w-1/2 mb-6"}),n.jsx(xe,{className:"h-64 w-full"})]});if(x.error||!x.data)return n.jsx("div",{className:"page",children:n.jsx(Ct,{variant:"destructive",children:n.jsx(Et,{children:"Benchmark not found."})})});const _=x.data,Q=H.slice().sort((d,g)=>{var T,j;const h=he((T=d.metrics)==null?void 0:T[b]),S=he((j=g.metrics)==null?void 0:j[b]);return h!==null&&S!==null?K==="↓"?h-S:S-h:h!==null?-1:S!==null?1:ot(d,b)-ot(g,b)}),Fe=!!_.supports_harness,R=s&&Q.find(d=>lt(d,s))||null,F=_.introducing_paper??void 0,de=(F==null?void 0:F.arxiv_id)||(F==null?void 0:F.id)||Pr(_.paper_url),X=(F==null?void 0:F.title)||_.introducing_paper_title||null,Z=((qe=F==null?void 0:F.published)==null?void 0:qe.slice(0,4))||_.introduced_year||null,yt=!!de||!!_.paper_url||!!X,wt=F!=null&&F.arxiv_id||(ze=_.paper_url)!=null&&ze.match(/^https?:\/\/(?:www\.)?arxiv\.org\//i)?`arXiv:${de}`:`Paper ${de}`;return n.jsx("div",{className:"page",children:n.jsxs("div",{className:"bm-page",children:[n.jsxs("div",{className:"breadcrumb",children:[n.jsx(me,{to:"/tasks",children:"Tasks"}),B&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"sep",children:"/"}),n.jsx(me,{to:`/tasks/${B.slug||B.id}`,children:B.name})]}),n.jsx("span",{className:"sep",children:"/"}),n.jsx("span",{style:{color:"var(--accent-text)"},children:_.name})]}),n.jsxs("div",{className:"bm-title-row",children:[n.jsx("h1",{className:"bm-title",children:_.name}),I&&n.jsxs("div",{className:"bm-title-trend","aria-label":`${_.name} reporting trend`,children:[n.jsx(Tt,{history:I.history,benchmarkName:I.name}),n.jsxs("span",{className:"bm-title-trend-summary",children:[n.jsx("strong",{children:I.recent_paper_count})," ",I.recent_paper_count===1?"paper":"papers",I.rate_change==null?I.recent_paper_count>0&&n.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):n.jsxs("span",{className:`benchmark-trend-change ${I.rate_change>=1?"is-up":"is-down"}`,children:[I.rate_change>=1?"↑":"↓"," ",I.rate_change.toFixed(1),"×"]})]})]})]}),n.jsxs("div",{className:"bm-subtitle",children:[V?n.jsx(xe,{className:"h-5 w-64 bm-summary-skeleton","aria-label":"Loading benchmark summary"}):n.jsxs("span",{children:[v&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"metric-tag",children:v}),n.jsx("span",{style:{color:"var(--hairline-strong)",margin:"0 8px"},children:"·"})]}),C?n.jsxs("span",{children:["Best: ",n.jsx("span",{className:"best-name",children:ne(M)})," by ",n.jsx("span",{className:"best-name",style:{fontStyle:"normal"},children:C})]}):n.jsxs("span",{children:[Q.length," evaluations"]})]}),_.hf_url&&n.jsxs("a",{className:"bm-action-btn",href:_.hf_url,target:"_blank",rel:"noopener noreferrer",children:[n.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),_.description&&n.jsx("p",{className:"bm-description",children:_.description}),a.hide_closed_source_evals&&N.length>0&&n.jsxs("div",{className:"bm-hidden-closed-notice",children:[n.jsxs("span",{children:[N.length," closed-source ",N.length===1?"row is":"rows are"," hidden",O!=null&&O.model_name?n.jsxs(n.Fragment,{children:[", including ",n.jsx("strong",{children:O.model_name})]}):null,"."]}),n.jsx("button",{type:"button",className:"bm-hidden-closed-action",onClick:()=>{i(!1)},children:"Show closed-source"})]}),yt&&n.jsxs("div",{className:"method-source",style:{marginTop:0,marginBottom:18},children:[n.jsx("span",{className:"method-source-label",children:"Source"}),de?n.jsxs(me,{to:`/paper/${de}`,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(ye,{title:X}):wt}),Z&&n.jsx("span",{className:"method-source-meta",children:Z})]}):_.paper_url?n.jsxs("a",{href:_.paper_url,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(ye,{title:X}):_.paper_url}),Z&&n.jsx("span",{className:"method-source-meta",children:Z})]}):n.jsxs("div",{className:"method-source-link is-static",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(ye,{title:X}):null}),Z&&n.jsx("span",{className:"method-source-meta",children:Z})]})]}),oe.filter(d=>d.isSota).length>=2&&n.jsxs("div",{className:"bm-card",ref:f,children:[n.jsxs("div",{className:"bm-card-screenshot-header","aria-hidden":"true",children:[n.jsxs("div",{className:"bm-card-screenshot-title",children:[n.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),n.jsx("span",{className:"bm-card-screenshot-name",children:_.name})]}),n.jsxs("div",{className:"bm-card-screenshot-brand",children:[n.jsxs("span",{className:"brand",children:[n.jsx("span",{className:"brand-mark"}),n.jsxs("span",{className:"brand-name",children:["Papers ",n.jsx("em",{children:"With Code"})]})]}),n.jsx("span",{className:"bm-card-screenshot-url",children:"paperswithcode.co"})]})]}),n.jsxs("div",{className:"bm-card-head",children:[n.jsx("div",{className:"bm-card-title",children:"SOTA progression"}),n.jsxs("div",{className:"bm-card-actions",children:[A.length>1&&n.jsxs("label",{className:"bm-view-select",children:[n.jsx("span",{className:"bm-view-select-label",children:"View"}),n.jsx("select",{value:b,onChange:d=>l(d.target.value),children:W.map(d=>n.jsx("option",{value:d,children:d},d))})]}),n.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[n.jsx(Je,{className:"bm-closed-toggle-switch",checked:!a.hide_closed_source_evals,onCheckedChange:d=>{i(!d)},"aria-label":"Show closed-source models"}),n.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),n.jsx(ct,{targetRef:f,label:"SOTA chart"})]})]}),n.jsx("div",{className:"bm-chart-wrap",children:n.jsx(Lt,{points:oe,metric:b})}),n.jsxs("div",{className:"bm-chart-foot",children:[n.jsx("span",{className:"legend-dot"}),"All models over time · highlighted dots track the running best · hover for the model · click to open the paper"]})]}),R&&(()=>{var T,j;const d=R.paper_arxiv_id||R.paper_id,g=R.paper_title||(R.paper_arxiv_id?`arXiv:${R.paper_arxiv_id}`:null),h=R.best_metric&&((T=R.metrics)==null?void 0:T[R.best_metric])!==void 0?R.best_metric:b,S=(j=R.metrics)==null?void 0:j[h];return n.jsxs("div",{className:"bm-highlight-banner",role:"status",children:[n.jsx("span",{className:"bm-highlight-dot","aria-hidden":"true"}),n.jsxs("div",{className:"bm-highlight-text",children:[n.jsx("span",{className:"bm-highlight-label",children:"Comparing result"}),n.jsxs("span",{className:"bm-highlight-paper",children:[R.model_name||g||"—",R.harness?` · ${R.harness}`:""]}),n.jsxs("span",{className:"bm-highlight-meta",children:[S!==void 0&&h?n.jsxs(n.Fragment,{children:[h,": ",ne(S),g?" · ":""]}):null,d?n.jsx(me,{to:`/paper/${d}`,children:be(R.paper_title,g)}):be(R.paper_title,g)]})]})]})})(),n.jsxs("div",{className:"bm-card",ref:y,children:[n.jsxs("div",{className:"bm-card-screenshot-header","aria-hidden":"true",children:[n.jsxs("div",{className:"bm-card-screenshot-title",children:[n.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),n.jsx("span",{className:"bm-card-screenshot-name",children:_.name})]}),n.jsxs("div",{className:"bm-card-screenshot-brand",children:[n.jsxs("span",{className:"brand",children:[n.jsx("span",{className:"brand-mark"}),n.jsxs("span",{className:"brand-name",children:["Papers ",n.jsx("em",{children:"With Code"})]})]}),n.jsx("span",{className:"bm-card-screenshot-url",children:"paperswithcode.co"})]})]}),n.jsxs("div",{className:"bm-card-head",children:[n.jsx("div",{className:"bm-card-title",children:"Leaderboard"}),n.jsxs("div",{className:"bm-card-actions",children:[A.length>1&&n.jsxs("label",{className:"bm-view-select",children:[n.jsx("span",{className:"bm-view-select-label",children:"View"}),n.jsx("select",{value:b,onChange:d=>l(d.target.value),children:W.map(d=>n.jsx("option",{value:d,children:d},d))})]}),n.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[n.jsx(Je,{className:"bm-closed-toggle-switch",checked:!a.hide_closed_source_evals,onCheckedChange:d=>{i(!d)},"aria-label":"Show closed-source models"}),n.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),n.jsx(ct,{targetRef:y,label:"leaderboard"})]})]}),E.isLoading?n.jsx("div",{style:{padding:16},children:Array.from({length:5}).map((d,g)=>n.jsx(xe,{className:"h-10 w-full mb-2"},g))}):Q.length===0?n.jsx("div",{className:"no-results",children:"No evaluations submitted yet."}):n.jsx("div",{className:"bm-table-scroll",children:n.jsxs("table",{className:"bm-table",children:[n.jsx("thead",{children:n.jsxs("tr",{children:[n.jsx("th",{className:"col-rank",children:"Rank"}),n.jsx("th",{className:"col-model",children:"Model"}),Fe&&n.jsx("th",{className:"col-harness",children:"Harness"}),le.map(d=>{const g=d===b;return n.jsx("th",{className:`col-value ${g?"is-active":""}`,"aria-sort":g?K==="↓"?"ascending":"descending":"none",children:n.jsxs("button",{type:"button",className:"bm-metric-header",onClick:()=>l(d),"aria-pressed":g,title:`Sort by ${d}`,children:[d,g?` ${K}`:""]})},d)}),n.jsx("th",{className:"col-paper",children:"Paper"}),n.jsx("th",{className:"col-year",children:"Year"})]})}),n.jsx("tbody",{children:(()=>{let d=null,g=0;return Q.map((h,S)=>{var Ke,Qe;const T=he((Ke=h.metrics)==null?void 0:Ke[b]);let j=null;T!==null&&((d===null||T!==d)&&(g=S+1,d=T),j=g);const ue=h.paper_arxiv_id||h.paper_id,Ge=h.paper_title||(h.paper_arxiv_id?`arXiv:${h.paper_arxiv_id}`:null),ke=lt(h,s);return n.jsxs("tr",{ref:ke?u:void 0,className:ke?"is-highlighted":void 0,children:[n.jsx("td",{className:"col-rank",children:j??"—"}),n.jsxs("td",{className:"col-model",children:[ke&&n.jsx("span",{className:"bm-row-marker","aria-hidden":"true"}),h.hf_model_url?n.jsx("a",{href:h.hf_model_url,target:"_blank",rel:"noopener noreferrer",className:"bm-model-link",title:`Open ${h.model_name||"model"} on Hugging Face`,children:h.model_name||"—"}):h.model_name||"—",h.is_open===!1&&n.jsx(Nt,{}),(h.external??h.is_external)&&n.jsx(Rt,{sourceUrl:h.source_url||h.external_source_url||h.result_url})]}),Fe&&n.jsx("td",{className:"col-harness",children:h.harness||"—"}),le.map(Se=>{var Ye;const Xe=Se===b,ge=(Ye=h.metrics)==null?void 0:Ye[Se];return n.jsx("td",{className:`col-value${Xe?" is-active":""}${Xe&&j===1?" is-best":""}`,children:ge!=null&&ge!==""?ne(ge):"—"},Se)}),n.jsx("td",{className:"col-paper",children:ue?n.jsx(me,{to:`/paper/${ue}`,children:be(h.paper_title,Ge)}):be(h.paper_title,Ge)}),n.jsx("td",{className:"col-year",children:((Qe=h.paper_published_date)==null?void 0:Qe.slice(0,4))||"—"})]},h.id)})})()})]})})]})]})})};export{Yr as default};
assets/{BenchmarkTrendSparkline-c88osrLQ.js → BenchmarkTrendSparkline-BCbEDZUr.js} RENAMED
@@ -1 +1 @@
1
- import{r as C,j as t}from"./index-CIXevVP9.js";const g=112,p=42,o=5,m=5,b=new Intl.DateTimeFormat("en",{month:"short",timeZone:"UTC"}),y=(e,d)=>{const r=new Date(`${e}T00:00:00Z`),n=new Date(`${d}T00:00:00Z`);return r.getUTCMonth()===n.getUTCMonth()?`${b.format(r)} ${r.getUTCDate()}–${n.getUTCDate()}`:`${b.format(r)} ${r.getUTCDate()}–${b.format(n)} ${n.getUTCDate()}`},I=({history:e,benchmarkName:d,interactive:r=!1})=>{const[n,x]=C.useState(null),h=e.map(s=>s.paper_count),M=Math.max(1,...h),f=g-o*2,T=p-m*2,v=h.length>1?f/(h.length-1):0,a=h.map((s,c)=>({x:o+v*c,y:m+T-s/M*T})),$=a.map(({x:s,y:c})=>`${s},${c}`).join(" "),_=a.length?`${o},${p-m} ${$} ${a[a.length-1].x},${p-m}`:"",D=h.reduce((s,c)=>s+c,0),u=49,N=14,i=n==null?null:a[n],j=i?Math.min(g-o-u,Math.max(o,i.x-u/2)):0,k=i?i.y>p/2?i.y-N-3:i.y+3:0;return t.jsxs("svg",{className:`benchmark-trend-sparkline${r?" is-interactive":""}`,viewBox:`0 0 ${g} ${p}`,role:r?"group":"img","aria-label":`${d}: ${D} reporting papers across the displayed trend history`,children:[t.jsxs("title",{children:[d,": ",D," reporting papers across the displayed trend history"]}),t.jsx("line",{className:"benchmark-trend-axis",x1:o,y1:p-m,x2:g-o,y2:p-m}),t.jsx("line",{className:"benchmark-trend-axis",x1:o,y1:m,x2:o,y2:p-m}),_&&t.jsx("polygon",{className:"benchmark-trend-area",points:_}),$&&t.jsx("polyline",{className:"benchmark-trend-line",points:$}),r?a.map(({x:s,y:c},l)=>t.jsxs("g",{className:"benchmark-trend-point",tabIndex:0,role:"img","aria-label":`${y(e[l].start_date,e[l].end_date)}: ${e[l].paper_count} ${e[l].paper_count===1?"paper":"papers"}`,onMouseEnter:()=>x(l),onMouseLeave:()=>x(null),onFocus:()=>x(l),onBlur:()=>x(null),children:[t.jsx("circle",{className:"benchmark-trend-point-hit",cx:s,cy:c,r:"5"}),t.jsx("circle",{className:"benchmark-trend-point-mark",cx:s,cy:c,r:"1.8"})]},`${e[l].start_date}-${e[l].end_date}`)):a.length>0&&t.jsx("circle",{className:"benchmark-trend-dot",cx:a[a.length-1].x,cy:a[a.length-1].y,r:"2.6"}),i&&n!=null&&t.jsxs("g",{className:"benchmark-trend-tooltip",pointerEvents:"none",children:[t.jsx("rect",{x:j,y:k,width:u,height:N,rx:"2"}),t.jsx("text",{x:j+3,y:k+5.4,children:y(e[n].start_date,e[n].end_date)}),t.jsxs("text",{className:"benchmark-trend-tooltip-value",x:j+3,y:k+11,children:[e[n].paper_count," ",e[n].paper_count===1?"paper":"papers"]})]})]})};export{I as B};
 
1
+ import{r as C,j as t}from"./index-Bo5_2OqZ.js";const g=112,p=42,o=5,m=5,b=new Intl.DateTimeFormat("en",{month:"short",timeZone:"UTC"}),y=(e,d)=>{const r=new Date(`${e}T00:00:00Z`),n=new Date(`${d}T00:00:00Z`);return r.getUTCMonth()===n.getUTCMonth()?`${b.format(r)} ${r.getUTCDate()}–${n.getUTCDate()}`:`${b.format(r)} ${r.getUTCDate()}–${b.format(n)} ${n.getUTCDate()}`},I=({history:e,benchmarkName:d,interactive:r=!1})=>{const[n,x]=C.useState(null),h=e.map(s=>s.paper_count),M=Math.max(1,...h),f=g-o*2,T=p-m*2,v=h.length>1?f/(h.length-1):0,a=h.map((s,c)=>({x:o+v*c,y:m+T-s/M*T})),$=a.map(({x:s,y:c})=>`${s},${c}`).join(" "),_=a.length?`${o},${p-m} ${$} ${a[a.length-1].x},${p-m}`:"",D=h.reduce((s,c)=>s+c,0),u=49,N=14,i=n==null?null:a[n],j=i?Math.min(g-o-u,Math.max(o,i.x-u/2)):0,k=i?i.y>p/2?i.y-N-3:i.y+3:0;return t.jsxs("svg",{className:`benchmark-trend-sparkline${r?" is-interactive":""}`,viewBox:`0 0 ${g} ${p}`,role:r?"group":"img","aria-label":`${d}: ${D} reporting papers across the displayed trend history`,children:[t.jsxs("title",{children:[d,": ",D," reporting papers across the displayed trend history"]}),t.jsx("line",{className:"benchmark-trend-axis",x1:o,y1:p-m,x2:g-o,y2:p-m}),t.jsx("line",{className:"benchmark-trend-axis",x1:o,y1:m,x2:o,y2:p-m}),_&&t.jsx("polygon",{className:"benchmark-trend-area",points:_}),$&&t.jsx("polyline",{className:"benchmark-trend-line",points:$}),r?a.map(({x:s,y:c},l)=>t.jsxs("g",{className:"benchmark-trend-point",tabIndex:0,role:"img","aria-label":`${y(e[l].start_date,e[l].end_date)}: ${e[l].paper_count} ${e[l].paper_count===1?"paper":"papers"}`,onMouseEnter:()=>x(l),onMouseLeave:()=>x(null),onFocus:()=>x(l),onBlur:()=>x(null),children:[t.jsx("circle",{className:"benchmark-trend-point-hit",cx:s,cy:c,r:"5"}),t.jsx("circle",{className:"benchmark-trend-point-mark",cx:s,cy:c,r:"1.8"})]},`${e[l].start_date}-${e[l].end_date}`)):a.length>0&&t.jsx("circle",{className:"benchmark-trend-dot",cx:a[a.length-1].x,cy:a[a.length-1].y,r:"2.6"}),i&&n!=null&&t.jsxs("g",{className:"benchmark-trend-tooltip",pointerEvents:"none",children:[t.jsx("rect",{x:j,y:k,width:u,height:N,rx:"2"}),t.jsx("text",{x:j+3,y:k+5.4,children:y(e[n].start_date,e[n].end_date)}),t.jsxs("text",{className:"benchmark-trend-tooltip-value",x:j+3,y:k+11,children:[e[n].paper_count," ",e[n].paper_count===1?"paper":"papers"]})]})]})};export{I as B};
assets/{ChatMessage-B-YI3CrH.js → ChatMessage-DAiy1xqv.js} RENAMED
@@ -1,6 +1,6 @@
1
- import{c as E,r as j,j as t,R as g}from"./index-CIXevVP9.js";import{M as R,S as w,A as S,o as P,s as b,v as $}from"./chatSessions-BnXlq2-W.js";import"./katex.min-BSBacQyE.js";import{H as T,a as H,b as I}from"./hover-card-B7gdr0Iw.js";import{r as M,a as U,P as F}from"./PaperPreviewLink-C7g07Bf-.js";import{M as L,r as A,d as B}from"./index-CDHG1Gvn.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const O=E("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]),ue=({onSend:e,busy:s,placeholder:a,autoFocus:n,draft:r,onDraftChange:c,onStop:o,models:l=[],selectedModel:d,onModelChange:h})=>{const[u,f]=j.useState(""),p=j.useRef(null);j.useEffect(()=>{const i=p.current;i&&(i.style.height="auto",i.style.height=`${Math.min(i.scrollHeight,200)}px`)},[u]),j.useEffect(()=>{var i;n&&((i=p.current)==null||i.focus())},[n]),j.useEffect(()=>{r!==void 0&&f(r)},[r]);const x=()=>{const i=u.trim();!i||s||(f(""),c==null||c(""),e(i))};return t.jsxs("div",{className:"chat-composer",children:[t.jsx("textarea",{ref:p,rows:1,value:u,placeholder:a||"Ask anything about research…",onChange:i=>{f(i.target.value),c==null||c(i.target.value)},onKeyDown:i=>{i.key==="Enter"&&!i.shiftKey&&(i.preventDefault(),x())}}),t.jsxs("div",{className:"chat-composer-row",children:[t.jsxs("div",{className:"chat-composer-tools",children:[l.length>0&&d&&h&&t.jsx(R,{models:l,selectedModel:d,onModelChange:h,disabled:s}),t.jsx("span",{className:"chat-composer-hint",children:"Enter to send · Shift+Enter for newline"})]}),t.jsx("button",{type:"button",className:`chat-send${s||u.trim()?" chat-send-on":""}`,onClick:s?o:x,disabled:s?!o:!u.trim(),"aria-label":s?"Stop generating":"Send message",children:s?o?t.jsx("span",{"aria-hidden":"true",children:"■"}):t.jsx(w,{light:!0}):t.jsx(S,{})})]})]})},v=new Map,q=e=>{if(!e)return Promise.resolve();const s=v.get(e);if(s)return s;const a=new Promise(n=>{const r=new Image;r.onload=()=>{n()},r.onerror=()=>{v.delete(e),n()},r.src=e});return v.set(e,a),a},V=new Set(["huggingface.co","www.huggingface.co"]),z=new Set(["api","blog","chat","collections","docs","enterprise","join","login","models","new","organizations","papers","posts","pricing","search","settings","spaces","tasks"]);function K(e){let s;try{s=new URL(e)}catch{return null}if(s.protocol!=="https:"||!V.has(s.hostname))return null;const a=s.pathname.split("/").filter(Boolean),n=a[0]==="datasets"?"dataset":"model",r=n==="dataset"?a.slice(1):a;if(r.length!==2||n==="model"&&z.has(r[0])||r.some(h=>!h||h==="."||h===".."))return null;const c=r.join("/"),o=r.map(encodeURIComponent).join("/"),l=n==="dataset"?`datasets/${o}`:o,d=n==="dataset"?"datasets":"models";return{type:n,repoId:c,url:`https://huggingface.co/${l}`,thumbnailUrl:`https://cdn-thumbnails.huggingface.co/social-thumbnails/${d}/${o}.png`}}const D=()=>typeof window.matchMedia=="function"&&window.matchMedia("(hover: none), (pointer: coarse)").matches,W=({repo:e})=>{const[s,a]=g.useState(!1);return t.jsxs("div",{className:"hf-preview-card",children:[s?t.jsx("div",{className:"hf-preview-fallback","aria-hidden":"true",children:"🤗"}):t.jsx("img",{className:"hf-preview-image","data-testid":"hf-preview-image",src:e.thumbnailUrl,alt:"",loading:"eager",decoding:"async",onError:()=>a(!0)}),t.jsxs("div",{className:"hf-preview-meta",children:[t.jsxs("span",{className:"hf-preview-kind",children:["Hugging Face ",e.type]}),t.jsx("strong",{children:e.repoId}),t.jsx("span",{children:"huggingface.co"})]})]})},X=({repo:e,children:s})=>{const[a,n]=g.useState(!1),r=g.useRef(null),c=g.useCallback(()=>{q(e.thumbnailUrl)},[e.thumbnailUrl]);return g.useEffect(()=>{const o=r.current;if(!o||typeof IntersectionObserver>"u")return;const l=new IntersectionObserver(([d])=>{d.isIntersecting&&(c(),l.disconnect())},{rootMargin:"200px"});return l.observe(o),()=>l.disconnect()},[c]),t.jsxs(T,{open:a,onOpenChange:o=>{(!o||!D())&&n(o)},openDelay:150,closeDelay:100,children:[t.jsx(H,{asChild:!0,children:t.jsx("a",{ref:r,className:"chat-paper-link chat-hf-link",href:e.url,target:"_blank",rel:"noopener noreferrer",onPointerEnter:c,onFocus:c,children:s})}),t.jsx(I,{className:"hf-preview-pop",side:"bottom",align:"start",collisionPadding:12,children:t.jsx(W,{repo:e})})]})};function Y(e,s,a){if(s)return{routeId:e,title:s.title,arxivId:s.metadata.arxiv_id,source:s.metadata.source,sourceUrl:s.metadata.source_url,thumbnailUrl:s.metadata.thumbnail_url,authors:s.metadata.authors.map(n=>n.name),published:s.metadata.published,conference:s.metadata.conference,citationCount:s.metadata.citation_count,tasks:s.metadata.tasks};if(a)return{routeId:e,title:a.title,arxivId:a.arxiv_id??null,source:a.arxiv_id?"arxiv":"external",sourceUrl:a.source_url,thumbnailUrl:a.thumbnail_url??null,authors:a.authors??[],published:a.published??null,conference:a.conference??null,citationCount:a.citation_count??null,tasks:[]}}const k=({routeId:e,paper:s,citation:a,className:n="chat-paper-link",children:r})=>t.jsx(F,{routeId:e,initialData:Y(e,s,a),className:n,target:"_blank",children:r});function G(e){const s=e.lastIndexOf("[");if(s===-1)return e;const a=e.slice(s);return/^\[[^\]]*(\]\(?[^)\s]*)?$/.test(a)?e.slice(0,s):e}const J=e=>e.startsWith("paper:")?e:B(e),N=({text:e,streaming:s,papers:a,citations:n})=>{const r=s?G(e):e;return t.jsx(L,{remarkPlugins:[A,U],rehypePlugins:[M],urlTransform:J,components:{a:({href:c,children:o})=>{if(c!=null&&c.startsWith("paper:")){const d=c.slice(6);return!a[d]&&!(n!=null&&n[d])?t.jsx("span",{className:"chat-invalid-citation",children:o}):t.jsx(k,{routeId:d,paper:a[d],citation:n==null?void 0:n[d],children:o})}const l=c?K(c):null;return l?t.jsx(X,{repo:l,children:o}):t.jsx("span",{children:o})}},children:r})};function Q(e){if(!e.authors.length)return"";const s=e.authors.slice(0,3).map(a=>a.name).join(", ");return e.authors.length>3?`${s}, et al.`:s}function Z(e){var a;if(e.conference)return e.conference;const s=(a=e.published)==null?void 0:a.slice(0,4);if(e.arxiv_id)return s?`arXiv ${s}`:"arXiv";if(e.source_url)try{return new URL(e.source_url).hostname.replace(/^www\./,"")}catch{}return s??"external"}function ee(e,s=240){const a=e.content.trim();return a.length<=s?a:`${a.slice(0,s).trimEnd()}…`}const C=()=>t.jsx("span",{className:"chat-caret"}),te=e=>{var a;if(!e.streaming)return!1;const s=(a=e.blocks)==null?void 0:a.at(-1);return s?s.kind==="reasoning"?!s.active:s.kind==="tool"?s.status!=="running":!1:!0},se=e=>{var x,i;if(e.button!==0||e.detail!==2)return;e.preventDefault();const s=e.currentTarget,a=s.ownerDocument,n=(x=a.caretPositionFromPoint)==null?void 0:x.call(a,e.clientX,e.clientY),r=n?null:(i=a.caretRangeFromPoint)==null?void 0:i.call(a,e.clientX,e.clientY),c=(n==null?void 0:n.offsetNode)??(r==null?void 0:r.startContainer),o=(n==null?void 0:n.offset)??(r==null?void 0:r.startOffset);if(!(c instanceof Text)||o===void 0||!s.contains(c))return;const l=c.data,d=/[\p{L}\p{M}\p{N}_'-]/u;let h=Math.min(o,l.length),u=h;for(;h>0&&d.test(l[h-1]);)h-=1;for(;u<l.length&&d.test(l[u]);)u+=1;if(h===u)return;const f=a.getSelection();if(!f)return;const p=a.createRange();p.setStart(c,h),p.setEnd(c,u),f.removeAllRanges(),f.addRange(p)},ae=({block:e,papers:s,citations:a,onToggle:n})=>e.active?t.jsxs("div",{className:"chat-reason-live",children:[t.jsxs("div",{className:"chat-reason-live-head",children:[t.jsx(w,{})," ",t.jsx("span",{children:"Thinking…"})]}),t.jsxs("div",{className:"chat-reason-live-body chat-answer chat-reason-markdown",children:[t.jsx(N,{text:e.text,streaming:!0,papers:s,citations:a}),t.jsx(C,{})]})]}):t.jsxs("div",{className:"chat-reason-done",children:[t.jsxs("button",{type:"button",className:"chat-reason-done-head",onClick:n,"aria-expanded":e.open,children:[t.jsx(P,{}),t.jsx("span",{children:"Thought for a few seconds"}),t.jsx(b,{open:e.open})]}),e.open&&t.jsx("div",{className:"chat-reason-done-body chat-answer chat-reason-markdown",children:t.jsx(N,{text:e.text,papers:s,citations:a})})]}),ne=({block:e,papers:s,onToggle:a})=>{var u,f,p,x;const n=e.status==="running",r=e.schema_version===2||!!e.content,c=e.status==="error"||e.status==="denied",o=typeof e.args.query=="string"?e.args.query:"",l=typeof e.args.command=="string"?e.args.command:typeof e.args.file_path=="string"?e.args.file_path:o,d=((u=e.content)==null?void 0:u.map(i=>i.text).join(""))??"",h=n?"running…":r?`${e.status} · ${e.took_ms??0} ms`:`${e.hits} results · ${e.took_ms} ms`;return t.jsxs("div",{className:`chat-tool${n?" chat-tool-running":""}${c?" chat-tool-failed":""}`,children:[t.jsxs("button",{type:"button",className:"chat-tool-head",onClick:a,disabled:n,"aria-expanded":n?void 0:e.open,children:[t.jsxs("span",{className:"chat-tool-head-left",children:[n?t.jsx(w,{}):t.jsx($,{}),t.jsx("code",{className:"chat-tool-name",children:e.name}),t.jsx("span",{className:"chat-tool-query",children:r?l:`("${o}")`})]}),t.jsxs("span",{className:"chat-tool-head-right",children:[t.jsx("span",{className:"chat-tool-status",children:h}),!n&&t.jsx(b,{open:e.open})]})]}),!n&&e.open&&t.jsxs("div",{className:"chat-tool-body",children:[t.jsxs("div",{className:"chat-tool-args",children:[t.jsx("span",{className:"chat-tool-label",children:"arguments"}),t.jsx("pre",{children:JSON.stringify(e.args,null,2)})]}),r?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"chat-tool-output-head",children:[t.jsx("span",{className:"chat-tool-label",children:"result"}),t.jsx("button",{type:"button",className:"chat-tool-copy",onClick:()=>void navigator.clipboard.writeText(d),children:"Copy"})]}),t.jsx("pre",{className:"chat-tool-output",children:t.jsx("code",{children:d})}),((f=e.metadata)==null?void 0:f.output_truncated)&&t.jsx("div",{className:"chat-tool-truncated",children:"Output was truncated."})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"chat-tool-label chat-tool-results-label",children:["returned ",((p=e.results)==null?void 0:p.length)??0," papers"]}),t.jsx("ol",{className:"chat-tool-results",children:(x=e.results)==null?void 0:x.map(i=>t.jsxs("li",{className:"chat-hit",children:[t.jsx("div",{className:"chat-hit-top",children:t.jsx(k,{routeId:i.route_id,paper:s[i.route_id],className:"chat-hit-title",children:i.title})}),t.jsx("div",{className:"chat-hit-meta",children:[Q(i.metadata),Z(i.metadata)].filter(Boolean).join(" · ")}),t.jsxs("div",{className:"chat-hit-snippet",children:[ee(i),i.content_truncated&&t.jsx("span",{className:"chat-hit-truncated",children:" (truncated)"})]})]},i.route_id))})]})]})]})},re=({block:e,papers:s,citations:a,streaming:n})=>t.jsxs("div",{className:"chat-answer",children:[t.jsx(N,{text:e.text,streaming:n,papers:s,citations:a}),n&&!!e.text.trim()&&t.jsx(C,{})]}),me=({id:e,text:s,editingAllowed:a=!1,editing:n=!1,editNotice:r,onEdit:c,onCancel:o,onResend:l})=>{const[d,h]=g.useState(s),[u,f]=g.useState(!1),p=g.useRef(null),x=g.useCallback(()=>{const m=p.current;if(!m)return;m.style.height="auto";const y=Math.max(120,window.innerHeight*.4);m.style.height=`${Math.min(m.scrollHeight,y)}px`,m.style.overflowY=m.scrollHeight>y?"auto":"hidden"},[]);g.useLayoutEffect(()=>{if(!n)return;h(s),f(!1);const m=p.current;m&&(m.focus(),m.setSelectionRange(s.length,s.length),x())},[n,x,s]),g.useLayoutEffect(x,[x,d]);const i=!!d.trim()&&d.length<=8e3,_=()=>{!i||u||(f(!0),l!=null&&l(d)||f(!1))};return n?t.jsx("div",{className:"chat-msg chat-msg-user chat-msg-user-editing","data-message-id":e,children:t.jsxs("div",{className:"chat-inline-editor",children:[t.jsx("textarea",{ref:p,className:"chat-inline-editor-textarea","aria-label":"Edit message",value:d,maxLength:8e3,onChange:m=>h(m.target.value),onKeyDown:m=>{m.key==="Escape"?(m.preventDefault(),o==null||o()):m.key==="Enter"&&!m.shiftKey&&!m.nativeEvent.isComposing&&(m.preventDefault(),_())}}),r&&t.jsx("div",{className:"chat-inline-editor-notice",children:r}),t.jsxs("div",{className:"chat-inline-editor-actions",children:[t.jsx("button",{type:"button",onClick:o,children:"Cancel"}),t.jsx("button",{type:"button",className:"chat-inline-editor-send",disabled:!i||u,onClick:_,children:"Send"})]})]})}):t.jsx("div",{className:"chat-msg chat-msg-user","data-message-id":e,children:t.jsxs("div",{className:"chat-user-message-wrap",children:[t.jsx("div",{className:"chat-bubble",children:t.jsx("span",{className:"chat-bubble-text",onMouseDown:se,children:s})}),a&&t.jsx("div",{className:"chat-user-actions",children:t.jsx("button",{type:"button",className:"chat-user-edit","aria-label":"Edit message",title:"Edit",onClick:c,children:t.jsx(O,{"aria-hidden":"true"})})})]})})},fe=({msg:e,papers:s,onToggleBlock:a,onArchiveOldChats:n,archivePending:r=!1})=>{var c,o;return t.jsx("div",{className:"chat-msg chat-msg-assistant",children:t.jsxs("div",{className:"chat-msg-blocks",children:[(c=e.blocks)==null?void 0:c.map((l,d)=>{var p;const h=`${e.id}-${d}`,u="citations"in l&&l.citations!==void 0?l.citations:e.citations??[],f=Object.fromEntries(u.map(x=>[x.route_id,x]));return l.kind==="reasoning"?t.jsx(ae,{block:l,papers:s,citations:f,onToggle:()=>a(e.id,d)},h):l.kind==="tool"?t.jsx(ne,{block:l,papers:s,onToggle:()=>a(e.id,d)},h):t.jsx(re,{block:l,papers:s,citations:f,streaming:!!(e.streaming&&d===(((p=e.blocks)==null?void 0:p.length)??0)-1)},h)}),te(e)&&t.jsx("div",{className:"chat-waiting",role:"status","aria-live":"polite",children:t.jsx("span",{className:"chat-thinking",children:(((o=e.blocks)==null?void 0:o.length)??0)===0?e.status??"Thinking…":"Thinking…"})}),e.error&&t.jsxs("div",{className:"chat-error",children:[t.jsx("span",{children:e.errorCode==="chat_session_quota_exceeded"?e.error:`The assistant hit an error: ${e.error}`}),["hf_inference_billing_required","hf_inference_billing_exhausted","hf_inference_credential_expired"].includes(e.errorCode??"")&&t.jsx("a",{href:"/settings",children:e.errorCode==="hf_inference_billing_required"?"Authorize HF in Settings":e.errorCode==="hf_inference_credential_expired"?"Reconnect Hugging Face":"Review billing settings"}),e.errorCode==="chat_session_quota_exceeded"&&n&&t.jsx("button",{type:"button",disabled:r,onClick:n,children:r?"Archiving…":"Archive chats older than 30 days"})]}),!e.streaming&&e.finishReason&&e.finishReason!=="success"&&t.jsx("div",{className:"chat-finish-note",children:["tool_limit","max_turns"].includes(e.finishReason)?"The assistant stopped at the execution limit.":`The assistant stopped early (${e.finishReason.replace(/_/g," ")}).`})]})})};export{fe as A,ue as C,me as U};
 
1
+ import{c as E,r as j,j as t,R as g}from"./index-Bo5_2OqZ.js";import{M as R,S as _,A as S,o as P,s as b,v as $}from"./chatSessions-Dz4Iu-O1.js";import"./katex.min-BSBacQyE.js";import{H as T,a as F,b as H}from"./hover-card-DrtqDSb0.js";import{r as I,a as M,P as U}from"./PaperPreviewLink-DTmodbgi.js";import{M as O,r as L,d as B}from"./index-C-0CcYmz.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
5
  * See the LICENSE file in the root directory of this source tree.
6
+ */const A=E("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]),ue=({onSend:e,busy:s,placeholder:a,autoFocus:n,draft:r,onDraftChange:o,onStop:c,models:l=[],selectedModel:d,onModelChange:h})=>{const[u,p]=j.useState(""),f=j.useRef(null);j.useEffect(()=>{const i=f.current;i&&(i.style.height="auto",i.style.height=`${Math.min(i.scrollHeight,200)}px`)},[u]),j.useEffect(()=>{var i;n&&((i=f.current)==null||i.focus())},[n]),j.useEffect(()=>{r!==void 0&&p(r)},[r]);const x=()=>{const i=u.trim();!i||s||(p(""),o==null||o(""),e(i))};return t.jsxs("div",{className:"chat-composer",children:[t.jsx("textarea",{ref:f,rows:1,value:u,placeholder:a||"Ask anything about research…",onChange:i=>{p(i.target.value),o==null||o(i.target.value)},onKeyDown:i=>{i.key==="Enter"&&!i.shiftKey&&(i.preventDefault(),x())}}),t.jsxs("div",{className:"chat-composer-row",children:[t.jsxs("div",{className:"chat-composer-tools",children:[l.length>0&&d&&h&&t.jsx(R,{models:l,selectedModel:d,onModelChange:h,disabled:s}),t.jsx("span",{className:"chat-composer-hint",children:"Enter to send · Shift+Enter for newline"})]}),t.jsx("button",{type:"button",className:`chat-send${s||u.trim()?" chat-send-on":""}`,onClick:s?c:x,disabled:s?!c:!u.trim(),"aria-label":s?"Stop generating":"Send message",children:s?c?t.jsx("span",{"aria-hidden":"true",children:"■"}):t.jsx(_,{light:!0}):t.jsx(S,{})})]})]})},v=new Map,q=e=>{if(!e)return Promise.resolve();const s=v.get(e);if(s)return s;const a=new Promise(n=>{const r=new Image;r.onload=()=>{n()},r.onerror=()=>{v.delete(e),n()},r.src=e});return v.set(e,a),a},V=new Set(["huggingface.co","www.huggingface.co"]),z=new Set(["api","blog","chat","collections","docs","enterprise","join","login","models","new","organizations","papers","posts","pricing","search","settings","spaces","tasks"]);function K(e){let s;try{s=new URL(e)}catch{return null}if(s.protocol!=="https:"||!V.has(s.hostname))return null;const a=s.pathname.split("/").filter(Boolean),n=a[0]==="datasets"?"dataset":"model",r=n==="dataset"?a.slice(1):a;if(r.length!==2||n==="model"&&z.has(r[0])||r.some(h=>!h||h==="."||h===".."))return null;const o=r.join("/"),c=r.map(encodeURIComponent).join("/"),l=n==="dataset"?`datasets/${c}`:c,d=n==="dataset"?"datasets":"models";return{type:n,repoId:o,url:`https://huggingface.co/${l}`,thumbnailUrl:`https://cdn-thumbnails.huggingface.co/social-thumbnails/${d}/${c}.png`}}const D=()=>typeof window.matchMedia=="function"&&window.matchMedia("(hover: none), (pointer: coarse)").matches,W=({repo:e})=>{const[s,a]=g.useState(!1);return t.jsxs("div",{className:"hf-preview-card",children:[s?t.jsx("div",{className:"hf-preview-fallback","aria-hidden":"true",children:"🤗"}):t.jsx("img",{className:"hf-preview-image","data-testid":"hf-preview-image",src:e.thumbnailUrl,alt:"",loading:"eager",decoding:"async",onError:()=>a(!0)}),t.jsxs("div",{className:"hf-preview-meta",children:[t.jsxs("span",{className:"hf-preview-kind",children:["Hugging Face ",e.type]}),t.jsx("strong",{children:e.repoId}),t.jsx("span",{children:"huggingface.co"})]})]})},X=({repo:e,children:s})=>{const[a,n]=g.useState(!1),r=g.useRef(null),o=g.useCallback(()=>{q(e.thumbnailUrl)},[e.thumbnailUrl]);return g.useEffect(()=>{const c=r.current;if(!c||typeof IntersectionObserver>"u")return;const l=new IntersectionObserver(([d])=>{d.isIntersecting&&(o(),l.disconnect())},{rootMargin:"200px"});return l.observe(c),()=>l.disconnect()},[o]),t.jsxs(T,{open:a,onOpenChange:c=>{(!c||!D())&&n(c)},openDelay:150,closeDelay:100,children:[t.jsx(F,{asChild:!0,children:t.jsx("a",{ref:r,className:"chat-paper-link chat-hf-link",href:e.url,target:"_blank",rel:"noopener noreferrer",onPointerEnter:o,onFocus:o,children:s})}),t.jsx(H,{className:"hf-preview-pop",side:"bottom",align:"start",collisionPadding:12,children:t.jsx(W,{repo:e})})]})};function Y(e,s,a){if(s)return{routeId:e,title:s.title,arxivId:s.metadata.arxiv_id,source:s.metadata.source,sourceUrl:s.metadata.source_url,thumbnailUrl:s.metadata.thumbnail_url,authors:s.metadata.authors.map(n=>n.name),published:s.metadata.published,conference:s.metadata.conference,citationCount:s.metadata.citation_count,tasks:s.metadata.tasks};if(a)return{routeId:e,title:a.title,arxivId:a.arxiv_id??null,source:a.arxiv_id?"arxiv":"external",sourceUrl:a.source_url,thumbnailUrl:a.thumbnail_url??null,authors:a.authors??[],published:a.published??null,conference:a.conference??null,citationCount:a.citation_count??null,tasks:[]}}const k=({routeId:e,paper:s,citation:a,className:n="chat-paper-link",children:r})=>t.jsx(U,{routeId:e,initialData:Y(e,s,a),className:n,target:"_blank",children:r});function G(e){const s=e.lastIndexOf("[");if(s===-1)return e;const a=e.slice(s);return/^\[[^\]]*(\]\(?[^)\s]*)?$/.test(a)?e.slice(0,s):e}const J=e=>e.startsWith("paper:")?e:B(e),w=({text:e,streaming:s,papers:a,citations:n})=>{const r=s?G(e):e;return t.jsx(O,{remarkPlugins:[L,M],rehypePlugins:[I],urlTransform:J,components:{a:({href:o,children:c})=>{if(o!=null&&o.startsWith("paper:")){const d=o.slice(6);return!a[d]&&!(n!=null&&n[d])?t.jsx("span",{className:"chat-invalid-citation",children:c}):t.jsx(k,{routeId:d,paper:a[d],citation:n==null?void 0:n[d],children:c})}const l=o?K(o):null;return l?t.jsx(X,{repo:l,children:c}):t.jsx("span",{children:c})}},children:r})};function Q(e){if(!e.authors.length)return"";const s=e.authors.slice(0,3).map(a=>a.name).join(", ");return e.authors.length>3?`${s}, et al.`:s}function Z(e){var a;if(e.conference)return e.conference;const s=(a=e.published)==null?void 0:a.slice(0,4);if(e.arxiv_id)return s?`arXiv ${s}`:"arXiv";if(e.source_url)try{return new URL(e.source_url).hostname.replace(/^www\./,"")}catch{}return s??"external"}function ee(e,s=240){const a=e.content.trim();return a.length<=s?a:`${a.slice(0,s).trimEnd()}…`}const C=()=>t.jsx("span",{className:"chat-caret"}),te=e=>{var a;if(!e.streaming)return!1;const s=(a=e.blocks)==null?void 0:a.at(-1);return s?s.kind==="reasoning"?!s.active:s.kind==="tool"?s.status!=="running":!1:!0},se=e=>{var x,i;if(e.button!==0||e.detail!==2)return;e.preventDefault();const s=e.currentTarget,a=s.ownerDocument,n=(x=a.caretPositionFromPoint)==null?void 0:x.call(a,e.clientX,e.clientY),r=n?null:(i=a.caretRangeFromPoint)==null?void 0:i.call(a,e.clientX,e.clientY),o=(n==null?void 0:n.offsetNode)??(r==null?void 0:r.startContainer),c=(n==null?void 0:n.offset)??(r==null?void 0:r.startOffset);if(!(o instanceof Text)||c===void 0||!s.contains(o))return;const l=o.data,d=/[\p{L}\p{M}\p{N}_'-]/u;let h=Math.min(c,l.length),u=h;for(;h>0&&d.test(l[h-1]);)h-=1;for(;u<l.length&&d.test(l[u]);)u+=1;if(h===u)return;const p=a.getSelection();if(!p)return;const f=a.createRange();f.setStart(o,h),f.setEnd(o,u),p.removeAllRanges(),p.addRange(f)},ae=({block:e,papers:s,citations:a,onToggle:n})=>e.active?t.jsxs("div",{className:"chat-reason-live",children:[t.jsxs("div",{className:"chat-reason-live-head",children:[t.jsx(_,{})," ",t.jsx("span",{children:"Thinking…"})]}),t.jsxs("div",{className:"chat-reason-live-body chat-answer chat-reason-markdown",children:[t.jsx(w,{text:e.text,streaming:!0,papers:s,citations:a}),t.jsx(C,{})]})]}):t.jsxs("div",{className:"chat-reason-done",children:[t.jsxs("button",{type:"button",className:"chat-reason-done-head",onClick:n,"aria-expanded":e.open,children:[t.jsx(P,{}),t.jsx("span",{children:"Thought for a few seconds"}),t.jsx(b,{open:e.open})]}),e.open&&t.jsx("div",{className:"chat-reason-done-body chat-answer chat-reason-markdown",children:t.jsx(w,{text:e.text,papers:s,citations:a})})]}),ne=({block:e,papers:s,onToggle:a})=>{var u,p,f,x;const n=e.status==="running",r=e.schema_version===2||!!e.content,o=e.status==="error"||e.status==="denied",c=typeof e.args.query=="string"?e.args.query:"",l=typeof e.args.command=="string"?e.args.command:typeof e.args.file_path=="string"?e.args.file_path:c,d=((u=e.content)==null?void 0:u.map(i=>i.text).join(""))??"",h=n?"running…":r?`${e.status} · ${e.took_ms??0} ms`:`${e.hits} results · ${e.took_ms} ms`;return t.jsxs("div",{className:`chat-tool${n?" chat-tool-running":""}${o?" chat-tool-failed":""}`,children:[t.jsxs("button",{type:"button",className:"chat-tool-head",onClick:a,disabled:n,"aria-expanded":n?void 0:e.open,children:[t.jsxs("span",{className:"chat-tool-head-left",children:[n?t.jsx(_,{}):t.jsx($,{}),t.jsx("code",{className:"chat-tool-name",children:e.name}),t.jsx("span",{className:"chat-tool-query",children:r?l:`("${c}")`})]}),t.jsxs("span",{className:"chat-tool-head-right",children:[t.jsx("span",{className:"chat-tool-status",children:h}),!n&&t.jsx(b,{open:e.open})]})]}),!n&&e.open&&t.jsxs("div",{className:"chat-tool-body",children:[t.jsxs("div",{className:"chat-tool-args",children:[t.jsx("span",{className:"chat-tool-label",children:"arguments"}),t.jsx("pre",{children:JSON.stringify(e.args,null,2)})]}),r?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"chat-tool-output-head",children:[t.jsx("span",{className:"chat-tool-label",children:"result"}),t.jsx("button",{type:"button",className:"chat-tool-copy",onClick:()=>void navigator.clipboard.writeText(d),children:"Copy"})]}),t.jsx("pre",{className:"chat-tool-output",children:t.jsx("code",{children:d})}),((p=e.metadata)==null?void 0:p.output_truncated)&&t.jsx("div",{className:"chat-tool-truncated",children:"Output was truncated."})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"chat-tool-label chat-tool-results-label",children:["returned ",((f=e.results)==null?void 0:f.length)??0," papers"]}),t.jsx("ol",{className:"chat-tool-results",children:(x=e.results)==null?void 0:x.map(i=>t.jsxs("li",{className:"chat-hit",children:[t.jsx("div",{className:"chat-hit-top",children:t.jsx(k,{routeId:i.route_id,paper:s[i.route_id],className:"chat-hit-title",children:i.title})}),t.jsx("div",{className:"chat-hit-meta",children:[Q(i.metadata),Z(i.metadata)].filter(Boolean).join(" · ")}),t.jsxs("div",{className:"chat-hit-snippet",children:[ee(i),i.content_truncated&&t.jsx("span",{className:"chat-hit-truncated",children:" (truncated)"})]})]},i.route_id))})]})]})]})},re=({block:e,papers:s,citations:a,streaming:n})=>t.jsxs("div",{className:"chat-answer",children:[t.jsx(w,{text:e.text,streaming:n,papers:s,citations:a}),n&&!!e.text.trim()&&t.jsx(C,{})]}),me=({id:e,text:s,editingAllowed:a=!1,editing:n=!1,editNotice:r,onEdit:o,onCancel:c,onResend:l})=>{const[d,h]=g.useState(s),[u,p]=g.useState(!1),f=g.useRef(null),x=g.useCallback(()=>{const m=f.current;if(!m)return;m.style.height="auto";const y=Math.max(120,window.innerHeight*.4);m.style.height=`${Math.min(m.scrollHeight,y)}px`,m.style.overflowY=m.scrollHeight>y?"auto":"hidden"},[]);g.useLayoutEffect(()=>{if(!n)return;h(s),p(!1);const m=f.current;m&&(m.focus(),m.setSelectionRange(s.length,s.length),x())},[n,x,s]),g.useLayoutEffect(x,[x,d]);const i=!!d.trim()&&d.length<=8e3,N=()=>{!i||u||(p(!0),l!=null&&l(d)||p(!1))};return n?t.jsx("div",{className:"chat-msg chat-msg-user chat-msg-user-editing","data-message-id":e,children:t.jsxs("div",{className:"chat-inline-editor",children:[t.jsx("textarea",{ref:f,className:"chat-inline-editor-textarea","aria-label":"Edit message",value:d,maxLength:8e3,onChange:m=>h(m.target.value),onKeyDown:m=>{m.key==="Escape"?(m.preventDefault(),c==null||c()):m.key==="Enter"&&!m.shiftKey&&!m.nativeEvent.isComposing&&(m.preventDefault(),N())}}),r&&t.jsx("div",{className:"chat-inline-editor-notice",children:r}),t.jsxs("div",{className:"chat-inline-editor-actions",children:[t.jsx("button",{type:"button",onClick:c,children:"Cancel"}),t.jsx("button",{type:"button",className:"chat-inline-editor-send",disabled:!i||u,onClick:N,children:"Send"})]})]})}):t.jsx("div",{className:"chat-msg chat-msg-user","data-message-id":e,children:t.jsxs("div",{className:"chat-user-message-wrap",children:[t.jsx("div",{className:"chat-bubble",children:t.jsx("span",{className:"chat-bubble-text",onMouseDown:se,children:s})}),a&&t.jsx("div",{className:"chat-user-actions",children:t.jsx("button",{type:"button",className:"chat-user-edit","aria-label":"Edit message",title:"Edit",onClick:o,children:t.jsx(A,{"aria-hidden":"true"})})})]})})},pe=({msg:e,papers:s,onToggleBlock:a,onArchiveOldChats:n,archivePending:r=!1})=>{var o,c;return t.jsx("div",{className:"chat-msg chat-msg-assistant",children:t.jsxs("div",{className:"chat-msg-blocks",children:[(o=e.blocks)==null?void 0:o.map((l,d)=>{var f;const h=`${e.id}-${d}`,u="citations"in l&&l.citations!==void 0?l.citations:e.citations??[],p=Object.fromEntries(u.map(x=>[x.route_id,x]));return l.kind==="reasoning"?t.jsx(ae,{block:l,papers:s,citations:p,onToggle:()=>a(e.id,d)},h):l.kind==="tool"?t.jsx(ne,{block:l,papers:s,onToggle:()=>a(e.id,d)},h):t.jsx(re,{block:l,papers:s,citations:p,streaming:!!(e.streaming&&d===(((f=e.blocks)==null?void 0:f.length)??0)-1)},h)}),te(e)&&t.jsx("div",{className:"chat-waiting",role:"status","aria-live":"polite",children:t.jsx("span",{className:"chat-thinking",children:(((c=e.blocks)==null?void 0:c.length)??0)===0?e.status??"Thinking…":"Thinking…"})}),e.error&&t.jsxs("div",{className:"chat-error",children:[t.jsx("span",{children:e.errorCode==="chat_session_quota_exceeded"?e.error:`The assistant hit an error: ${e.error}`}),["hf_inference_billing_required","hf_inference_billing_exhausted","hf_inference_credential_expired"].includes(e.errorCode??"")&&t.jsx("a",{href:"/settings",children:e.errorCode==="hf_inference_billing_required"?"Authorize HF in Settings":e.errorCode==="hf_inference_credential_expired"?"Reconnect Hugging Face":"Review billing settings"}),e.errorCode==="openrouter_monthly_budget_exhausted"&&t.jsxs(t.Fragment,{children:[t.jsx("a",{href:"/settings#openrouter-byok",children:"Use your own OpenRouter key"}),t.jsx("span",{children:"Or select a Hugging Face-backed model and explicitly retry."})]}),e.errorCode==="openrouter_unavailable"&&t.jsxs(t.Fragment,{children:[t.jsx("a",{href:"/settings#openrouter-byok",children:"Bring your own key in Settings"}),t.jsx("a",{href:"https://github.com/huggingface/paperswithcode-feedback",target:"_blank",rel:"noreferrer",children:"File an issue"})]}),["openrouter_byok_credential_invalid","openrouter_byok_billing_error","openrouter_byok_rate_limit"].includes(e.errorCode??"")&&t.jsx("a",{href:"/settings#openrouter-byok",children:"Review OpenRouter settings"}),e.errorCode==="chat_session_quota_exceeded"&&n&&t.jsx("button",{type:"button",disabled:r,onClick:n,children:r?"Archiving…":"Archive chats older than 30 days"})]}),!e.streaming&&e.finishReason&&e.finishReason!=="success"&&t.jsx("div",{className:"chat-finish-note",children:["tool_limit","max_turns"].includes(e.finishReason)?"The assistant stopped at the execution limit.":`The assistant stopped early (${e.finishReason.replace(/_/g," ")}).`})]})})};export{pe as A,ue as C,me as U};
assets/ChatView-BW8ZEOff.js DELETED
@@ -1,16 +0,0 @@
1
- import{c as ft,d as Ne,r as o,j as r,e as mt,u as pt,a as gt,f as yt,g as bt,h as wt,k as vt,X as _t}from"./index-CIXevVP9.js";import{C as He,U as Rt,A as xt}from"./ChatMessage-B-YI3CrH.js";import{c as St,g as Le,t as rt,r as kt,F as Tt,D as Ct,l as Ot,C as We,a as Ve,b as Ge,d as Et,e as jt,P as Lt,f as Ke,h as It,T as Nt,S as $e,u as ze,i as At,j as Dt,k as Pt}from"./chatSessions-BnXlq2-W.js";import{S as Mt}from"./chatPrompts-CDY3UGU1.js";import"./katex.min-BSBacQyE.js";import"./hover-card-B7gdr0Iw.js";import"./PaperPreviewLink-C7g07Bf-.js";import"./index-CDHG1Gvn.js";import"./useQuery-BHSsBDmJ.js";import"./useBaseQuery-BL30DOiU.js";/**
2
- * @license lucide-react v0.462.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const Yt=ft("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]),U=(c,u)=>new Promise(h=>{const E=setTimeout(m,c);function m(){u==null||u.removeEventListener("abort",m),clearTimeout(E),h()}u==null||u.addEventListener("abort",m)}),J=c=>({arxiv_id:null,source:"arxiv",source_url:null,thumbnail_url:null,authors:[],published:null,conference:null,citation_count:null,tasks:[],methods:[],repositories:[],project_pages:[],...c}),X={name:"Object Detection",slug:"object-detection"},re={name:"Real-Time Object Detection",slug:"real-time-object-detection"},Ft={"2502.12524":{route_id:"2502.12524",title:"YOLOv12: Attention-Centric Real-Time Object Detectors",content:"Enhancing the network architecture of the YOLO framework has been crucial for a long time. This work introduces an attention-centric YOLO framework, namely YOLOv12, built around area attention and residual efficient layer aggregation networks (R-ELAN). YOLOv12-N reaches 40.6 mAP at 1.64 ms on a T4 GPU, closing the gap to attention-based detectors without the usual latency penalty and surpassing YOLOv10/YOLOv11 by +1.2–1.6 mAP at matched latency.",content_truncated:!1,metadata:J({arxiv_id:"2502.12524",authors:[{name:"Y. Tian"},{name:"Q. Ye"},{name:"D. Doermann"}],published:"2025-02-18",citation_count:412,tasks:[X,re],methods:[{name:"Area Attention",slug:"area-attention"}],repositories:[{url:"https://github.com/sunsmarterjie/yolov12",stars:18700}]})},"2407.17140":{route_id:"2407.17140",title:"RT-DETRv2: Improved Baseline with Bag-of-Freebies for Real-Time Detection",content:"RT-DETRv2 improves the real-time DETR baseline with selective multi-scale feature extraction, a discrete sampling operator to ease deployment, and training-only 'bag-of-freebies' that add no inference cost. RT-DETRv2-R18/R50/R101 reach 47.9 / 53.4 / 54.3 mAP on COCO at 217 / 108 / 74 FPS on T4 TensorRT FP16, remaining NMS-free end to end.",content_truncated:!1,metadata:J({arxiv_id:"2407.17140",authors:[{name:"W. Lv"},{name:"Y. Zhao"},{name:"J. Chang"}],published:"2024-07-24",citation_count:268,tasks:[X,re],methods:[{name:"DETR",slug:"detr"}],repositories:[{url:"https://github.com/lyuwenyu/RT-DETR",stars:9400}]})},"2410.13842":{route_id:"2410.13842",title:"D-FINE: Redefining Regression as Fine-grained Distribution Refinement",content:"D-FINE reformulates bounding-box regression in DETR-style detectors as iterative refinement of probability distributions (FDR) and adds a localization self-distillation scheme (GO-LSD). D-FINE-L reaches 54.0 mAP at ~9 ms and D-FINE-X 55.8 mAP on COCO while staying real-time on modern GPUs, dominating RT-DETRv2 and YOLOv10 on the accuracy–latency Pareto front.",content_truncated:!1,metadata:J({arxiv_id:"2410.13842",authors:[{name:"Y. Peng"},{name:"H. Li"},{name:"P. Wu"}],published:"2024-10-17",conference:"ICLR 2025",citation_count:187,tasks:[X,re],methods:[{name:"Knowledge Distillation",slug:"knowledge-distillation"}],repositories:[{url:"https://github.com/Peterande/D-FINE",stars:12100}]})},"2406.03459":{route_id:"2406.03459",title:"LW-DETR: A Transformer Replacement to YOLO for Real-Time Detection",content:"LW-DETR pairs a plain ViT encoder with a lightweight DETR decoder and shows the combination outperforms YOLOv8 and YOLO-NAS at comparable latency, arguing transformer detectors are viable even at the fast end of the accuracy–latency curve. Uses multi-level feature aggregation, window-attention interleaving, and IoU-aware classification.",content_truncated:!1,metadata:J({arxiv_id:"2406.03459",authors:[{name:"Q. Chen"},{name:"X. Su"},{name:"X. Zhang"}],published:"2024-06-05",citation_count:94,tasks:[X,re],methods:[{name:"Vision Transformer",slug:"vision-transformer"}],repositories:[{url:"https://github.com/Atten4Vis/LW-DETR",stars:5200}]})},"2304.08069":{route_id:"2304.08069",title:"DETRs Beat YOLOs on Real-time Object Detection",content:"RT-DETR is the first real-time end-to-end object detector, built on an efficient hybrid encoder that decouples intra-scale interaction and cross-scale fusion, plus IoU-aware query selection. RT-DETR-R50 achieves 53.1 mAP at 108 FPS on COCO, beating comparably sized YOLO detectors in both speed and accuracy while eliminating NMS entirely; its Figure 1 accuracy–latency plot became the reference for later real-time detectors.",content_truncated:!1,metadata:J({arxiv_id:"2304.08069",authors:[{name:"Y. Zhao"},{name:"W. Lv"},{name:"S. Xu"}],published:"2023-04-17",conference:"CVPR 2024",citation_count:2310,tasks:[X,re],methods:[{name:"DETR",slug:"detr"}],repositories:[{url:"https://github.com/lyuwenyu/RT-DETR",stars:9400}]})},"2405.14458":{route_id:"2405.14458",title:"YOLOv10: Real-Time End-to-End Object Detection",content:"YOLOv10 removes NMS from the YOLO pipeline via consistent dual assignments during training and applies a holistic efficiency–accuracy driven design across the architecture. YOLOv10-S is 1.8x faster than RT-DETR-R18 at similar COCO accuracy; the family spans 46.3–54.4 mAP with substantially lower end-to-end latency than prior YOLOs because post-processing disappears.",content_truncated:!1,metadata:J({arxiv_id:"2405.14458",authors:[{name:"A. Wang"},{name:"H. Chen"},{name:"L. Liu"}],published:"2024-05-23",conference:"NeurIPS 2024",citation_count:1650,tasks:[X,re],methods:[{name:"NMS-free Training",slug:"nms-free-training"}],repositories:[{url:"https://github.com/THU-MIG/yolov10",stars:44200}]})},"2401.17270":{route_id:"2401.17270",title:"YOLO-World: Real-Time Open-Vocabulary Object Detection",content:"YOLO-World extends the YOLO paradigm to open-vocabulary detection through vision-language modeling with a re-parameterizable vision-language path aggregation network (RepVL-PAN) and region-text contrastive pretraining. It detects categories never seen at training time while running at 35+ FPS, and its prompt-then-detect deployment re-parameterizes text embeddings for zero runtime text-encoder cost.",content_truncated:!1,metadata:J({arxiv_id:"2401.17270",authors:[{name:"T. Cheng"},{name:"L. Song"},{name:"Y. Ge"}],published:"2024-01-30",conference:"CVPR 2024",citation_count:890,tasks:[{name:"Open-Vocabulary Object Detection",slug:"open-vocabulary-object-detection"},X],methods:[{name:"Contrastive Learning",slug:"contrastive-learning"}],repositories:[{url:"https://github.com/AILab-CVC/YOLO-World",stars:16800}]})},158342:{route_id:"158342",title:"Ultralytics YOLO: real-time detection framework and model zoo",content:"Official Ultralytics framework release covering YOLO11 and YOLOv12 deployment: pretrained COCO checkpoints from nano to x-large, TensorRT/ONNX/CoreML export paths, and reproducible latency benchmarks on T4, Jetson Orin, and CPU targets. Widely used as the practical baseline for real-time detection deployments.",content_truncated:!1,metadata:J({source:"external",source_url:"https://docs.ultralytics.com/models/",authors:[{name:"Ultralytics"}],published:"2025-01-02",tasks:[X,re],repositories:[{url:"https://github.com/ultralytics/ultralytics",stars:46e3}],project_pages:[{url:"https://docs.ultralytics.com"}]})}},st=c=>c.map(u=>Ft[u]),Je=st(["2502.12524","2407.17140","2410.13842","2406.03459","2304.08069","2405.14458","2401.17270","158342"]),Xe=st(["2410.13842","2502.12524","2407.17140","2405.14458","2304.08069"]),Qe="The user wants the current state-of-the-art for real-time object detection. That's a moving target split across two lineages — the YOLO family (fast CNN one-stage detectors) and the DETR family (transformer, end-to-end, NMS-free). I should ground the answer in recent papers benchmarked on COCO with reported latency or FPS, not just accuracy. Let me start with a broad hybrid search, see which papers surface, then run a second, narrower query to pin down the head-to-head COCO mAP vs latency trade-offs before I write anything.",Ze="Good — both lineages are well represented. YOLOv12, YOLOv10 and RT-DETRv2 / D-FINE keep coming up. To actually rank them I need the accuracy-vs-latency numbers side by side on the same COCO val2017 protocol, so let me narrow the query to the benchmark comparison specifically.",et=`There isn't a single winner — real-time object detection in 2026 is a two-horse race between the [YOLO family](paper:2502.12524) (fast one-stage CNNs) and the end-to-end [DETR family](paper:2304.08069) (NMS-free transformers). Which one is “SOTA” depends entirely on where you sit on the accuracy-vs-latency curve.
7
-
8
- **At the fast / edge end**, [YOLOv12](paper:2502.12524) is the current leader. Its area-attention design pushes attention into the YOLO backbone without the usual latency hit — YOLOv12-N reaches 40.6 mAP at ~1.6 ms on a T4, roughly +1.5 mAP over [YOLOv10](paper:2405.14458) at matched speed. [YOLOv10](paper:2405.14458) is still very relevant because it made the YOLO head NMS-free, cutting real end-to-end latency.
9
-
10
- **At the high-accuracy end**, the transformer detectors win. [D-FINE](paper:2410.13842) currently holds the accuracy-latency Pareto front, reporting 55.8 mAP by reformulating box regression as fine-grained distribution refinement with self-distillation. It builds on [RT-DETRv2](paper:2407.17140), which hardened the [original RT-DETR](paper:2304.08069) recipe (the paper that first showed DETRs beating YOLOs in real time) with training-only “bag-of-freebies” that add no inference cost.
11
-
12
- **My recommendation:** for edge or high-FPS deployment, start with [YOLOv12](paper:2502.12524) — the [Ultralytics framework](paper:158342) has ready-made checkpoints and export paths. If you have GPU headroom and want maximum accuracy while staying real-time, use [D-FINE](paper:2410.13842) or [RT-DETRv2](paper:2407.17140). And if you need open-vocabulary detection rather than fixed COCO classes, [YOLO-World](paper:2401.17270) is the one to look at.`,Ut=["How do these compare on edge devices like Jetson?","Show me open-vocabulary detectors","What about small-object detection?"];async function*qt(c,u){const h=()=>(u==null?void 0:u.aborted)===!0,E=c.trim().slice(0,90)||"state-of-the-art real-time object detection";if(yield{type:"stream_start",request_id:"req_mock",session_id:null},await U(350,u),!h()){yield{type:"reasoning_start"};for(let m=0;m<Qe.length;m+=6){if(await U(14,u),h())return;yield{type:"reasoning_delta",text:Qe.slice(m,m+6)}}if(await U(400,u),!h()&&(yield{type:"reasoning_end"},await U(300,u),!h()&&(yield{type:"tool_call",id:"call_1",name:"search_papers",args:{query:E,top_k:8}},await U(1100,u),!h()&&(yield{type:"tool_result",id:"call_1",hits:Je.length,took_ms:214,results:Je},await U(350,u),!h())))){yield{type:"reasoning_start"};for(let m=0;m<Ze.length;m+=6){if(await U(14,u),h())return;yield{type:"reasoning_delta",text:Ze.slice(m,m+6)}}if(await U(350,u),!h()&&(yield{type:"reasoning_end"},await U(300,u),!h()&&(yield{type:"tool_call",id:"call_2",name:"search_papers",args:{query:"RT-DETR vs YOLOv12 COCO mAP latency FPS T4 TensorRT comparison",top_k:5}},await U(900,u),!h()&&(yield{type:"tool_result",id:"call_2",hits:Xe.length,took_ms:176,results:Xe},await U(400,u),!h())))){for(let m=0;m<et.length;m+=4){if(await U(11,u),h())return;yield{type:"answer_delta",text:et.slice(m,m+4)}}yield{type:"done",followups:Ut,finish_reason:"success"}}}}}const Re=()=>{const u=String("0").trim().toLowerCase();return u==="1"||u==="true"||u==="yes"};class Ie extends Error{constructor(u,h,E,m){super(u),this.code=h,this.status=E,this.retryAfterSeconds=m,this.name="ChatStreamError"}}function Bt(c,u){if(Re())try{fetch(Ne(`/api/v1/chat/latency/${encodeURIComponent(c)}`),{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",keepalive:!0,body:JSON.stringify(u)}).catch(()=>{})}catch{}}function Ht(c,u={}){return Re()?Wt(c,u.signal):qt(c.message,u.signal)}async function*Wt(c,u){const h=await fetch(Ne("/api/v1/chat/stream"),{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream"},credentials:"include",body:JSON.stringify(c),signal:u});if(!h.ok||!h.body){const x=await h.json().catch(()=>null),v=x==null?void 0:x.detail,_=h.status===403&&!v,R=Number(h.headers.get("Retry-After")),L=Number.isFinite(R)&&R>=0?Math.min(300,Math.ceil(R)):void 0;throw new Ie(_?"Chat on staging is limited to approved Hugging Face users. Sign in with an approved account and try again.":(v==null?void 0:v.message)||v||`Chat stream failed (${h.status})`,(v==null?void 0:v.code)||(_?"staging_access_required":void 0),h.status,L)}const E=h.body.getReader(),m=new TextDecoder;let j="";try{for(;;){const{done:x,value:v}=await E.read();if(x)break;j+=m.decode(v,{stream:!0});let _;for(;(_=j.indexOf(`
13
-
14
- `))!==-1;){const R=j.slice(0,_);j=j.slice(_+2);const L=R.split(`
15
- `).filter(T=>T.startsWith("data:")).map(T=>T.slice(5).trimStart()).join(`
16
- `);!L||L==="[DONE]"||(yield JSON.parse(L))}}}finally{E.releaseLock()}}const at="Preparing research workspace…",Vt=750;function ge(c){if(c.status!==at)return c;const{status:u,...h}=c;return h}function je(c,u){for(let h=c.length-1;h>=0;h-=1)if(u(c[h]))return h;return-1}function Gt(c){const[u,h]=o.useState([]),[E,m]=o.useState(!1),[j,x]=o.useState(""),v=o.useRef(!1),_=o.useRef(null),R=o.useRef(null),L=o.useRef("cleared"),T=o.useRef(null),S=o.useRef(null),[D,Y]=o.useState(null),B=o.useRef([]),C=o.useRef(c),de=o.useRef(""),Q=o.useRef(""),ue=o.useRef(0),I=o.useRef(0),A=o.useRef(c.sessionId),H=o.useRef(c.sessionId);H.current!==c.sessionId&&(H.current=c.sessionId,A.current!==c.sessionId&&(I.current+=1,T.current=null)),C.current=c,B.current=u,o.useEffect(()=>()=>{var t;R.current!==null&&window.clearTimeout(R.current),(t=_.current)==null||t.abort(),S.current=null},[]),o.useEffect(()=>{v.current||(A.current=c.sessionId)},[c.sessionId]);const Z=o.useMemo(()=>{const t={};for(const i of u)for(const a of i.blocks??[])if(a.kind==="tool")for(const l of a.results??[])t[l.route_id]=l;return t},[u]),se=()=>`m${++ue.current}_${Date.now().toString(36)}`,P=t=>h(i=>{if(!i.length)return i;const a=i.slice();return a[a.length-1]=t(a[a.length-1]),a}),V=t=>P(i=>{const a=ge(i);return{...a,blocks:[...a.blocks??[],t]}}),ae=(t,i)=>P(a=>{const l=ge(a);return{...l,blocks:(l.blocks??[]).map((f,p,g)=>t(f,p,g)?i(f):f)}}),F=t=>(i,a,l)=>i.kind===t&&je(l,f=>f.kind===t)===a,G=t=>{if(_.current!==t||(R.current!==null&&(window.clearTimeout(R.current),R.current=null),L.current==="cleared"))return;const i=L.current==="shown";L.current="cleared",i&&P(ge)},K=(t,i)=>{t.requestId&&Bt(t.requestId,i)},ie=(t,i)=>{const a=T.current;!a||a.controller!==t||(a.requestId=i,a.streamStartReported||(a.streamStartReported=!0,K(a,{submission_to_stream_start_ms:Math.max(0,performance.now()-a.submittedAt)})),a.firstVisibleAt!==void 0&&!a.firstVisibleReported&&(a.firstVisibleReported=!0,K(a,{submission_to_first_visible_delta_ms:Math.max(0,a.firstVisibleAt-a.submittedAt)})))},ee=(t,i)=>{const a=T.current;!a||a.controller!==t||a.terminalReported||(a.terminalReported=!0,K(a,{terminal_classification:i}))};o.useLayoutEffect(()=>{const t=T.current;if(!t||t.firstVisibleAt!==void 0)return;const i=u.at(-1);(i==null?void 0:i.role)!=="assistant"||!(i.blocks??[]).some(l=>l.kind==="tool"||l.kind==="reasoning"&&!!l.text.trim()||l.kind==="answer"&&!!l.text.trim())||(t.firstVisibleAt=performance.now(),t.requestId&&!t.firstVisibleReported&&(t.firstVisibleReported=!0,K(t,{submission_to_first_visible_delta_ms:Math.max(0,t.firstVisibleAt-t.submittedAt)})))},[u]);const oe=t=>{switch(t.type){case"stream_start":t.session_id&&(A.current=t.session_id,C.current.onSessionId(t.session_id));break;case"sandbox_start":case"sandbox_ready":case"workspace_ready":break;case"session_title_start":Q.current="";break;case"session_title_delta":Q.current+=t.text,C.current.onTitle(Q.current.replace(/\s+/g," ").slice(0,80));break;case"session_title_done":Q.current=t.title,C.current.onTitle(t.title);break;case"reasoning_start":P(i=>{const a=ge(i);return{...a,blocks:[...(a.blocks??[]).map(l=>l.kind==="reasoning"&&l.active?{...l,active:!1,open:!1}:l),{kind:"reasoning",text:"",active:!0,open:!0}]}});break;case"reasoning_delta":ae(F("reasoning"),i=>i.kind==="reasoning"?{...i,text:i.text+t.text}:i);break;case"reasoning_end":P(i=>{const a=i.blocks??[],l=je(a,g=>g.kind==="reasoning"&&g.active);if(l<0)return i;const f=a[l];if(f.kind!=="reasoning")return i;const p=a[l-1];return(p==null?void 0:p.kind)==="reasoning"&&p.text===f.text?{...i,blocks:a.filter((g,b)=>b!==l)}:{...i,blocks:a.map((g,b)=>b===l?{...f,active:!1,open:!1}:g)}});break;case"tool_call":V({kind:"tool",id:t.id,name:t.name,args:t.args,status:"running",open:!1});break;case"tool_result":ae(i=>i.kind==="tool"&&i.id===t.id,i=>i.kind==="tool"?t.status?{...i,schema_version:2,status:t.status,took_ms:t.took_ms,content:t.content,metadata:t.metadata,open:t.status!=="success"}:{...i,status:"done",hits:t.hits,took_ms:t.took_ms,results:t.results}:i);break;case"answer_delta":P(i=>{const a=ge(i),l=a.blocks??[],f=l.at(-1);return(f==null?void 0:f.kind)==="answer"&&!f.done?{...a,blocks:[...l.slice(0,-1),{...f,text:f.text+t.text}]}:{...a,blocks:[...l,{kind:"answer",text:t.text,done:!1}]}});break;case"done":P(i=>({...i,streaming:!1,followups:t.followups,finishReason:t.finish_reason,citations:t.citations,blocks:(i.blocks??[]).map(a=>a.kind==="answer"?{...a,done:!0}:a.kind==="reasoning"&&a.active?{...a,active:!1,open:!1}:a)}));break;case"error":P(i=>({...i,streaming:!1,error:t.message,errorCode:t.code,blocks:(i.blocks??[]).map(a=>a.kind==="reasoning"&&a.active?{...a,active:!1,open:!1}:a)}));break}},ye=async(t,i)=>{const a=await Le(t),l=rt(a);return I.current!==i?null:(h(l),B.current=l,l)},$=(t,i,a,l,f)=>{const p=++I.current;v.current=!0;const g=new AbortController;return _.current=g,de.current=t,A.current=i.session_id,x(""),h(a),m(!0),T.current={controller:g,submittedAt:performance.now(),streamStartReported:!1,firstVisibleReported:!1,terminalReported:!1},R.current!==null&&window.clearTimeout(R.current),L.current="armed",R.current=window.setTimeout(()=>{R.current=null,!(L.current!=="armed"||_.current!==g||g.signal.aborted||I.current!==p)&&(L.current="shown",P(b=>{var O;return b.role==="assistant"&&b.streaming&&(((O=b.blocks)==null?void 0:O.length)??0)===0&&!b.error?{...b,status:at}:b}))},Vt),(async()=>{var M;let b=!1,O=!1,N=!1,W=!1;try{for await(const y of Ht(i,{signal:g.signal})){y.type==="stream_start"&&(b=!0,ie(g,y.request_id)),(y.type==="workspace_ready"||y.type==="reasoning_start"||y.type==="reasoning_delta"||y.type==="tool_call"||y.type==="answer_delta"||y.type==="done"||y.type==="error")&&G(g),(y.type==="done"||y.type==="error")&&(O=!0,N=y.type==="error",ee(g,y.type==="error"?"error":"complete"));const d=I.current===p;!g.signal.aborted&&(d||y.type==="stream_start"||y.type==="session_title_start"||y.type==="session_title_delta"||y.type==="session_title_done")&&oe(y)}}catch(y){if(N=!0,!g.signal.aborted){if(G(g),y instanceof Ie&&y.code==="chat_capacity"){W=!0;const d=y.retryAfterSeconds??5,ne={question:t,request:i,optimistic:a,original:l,edit:f,retryAfterSeconds:d,retryAt:Date.now()+d*1e3};S.current=ne,Y({question:t,retryAt:ne.retryAt,retryAfterSeconds:d}),I.current===p&&(h(l),B.current=l,x(""))}else ee(g,"network_error");!W&&I.current===p&&oe({type:"error",message:y instanceof Error?y.message:"The assistant stream failed.",code:y instanceof Ie?y.code:void 0})}}finally{if(_.current===g){if(G(g),!O&&!g.signal.aborted&&ee(g,"network_error"),v.current=!1,m(!1),W)C.current.onSettled(i.session_id);else if(!g.signal.aborted){const y=A.current;if(f&&!b)I.current===p&&(h(f.snapshot),B.current=f.snapshot,x("Couldn’t resend this message. Your original conversation was restored."));else if(y){I.current===p&&f&&!f.first&&(N||!O)&&(h(f.snapshot),B.current=f.snapshot);try{const d=await ye(y,p);d&&f&&!f.first&&d.some(ne=>ne.id===f.targetId)&&x("Couldn’t resend this message. Your original conversation was restored.")}catch{I.current===p&&P(d=>d.streaming?{...d,streaming:!1}:d)}}else I.current===p&&P(d=>d.streaming?{...d,streaming:!1}:d);C.current.onSettled(y)}((M=T.current)==null?void 0:M.controller)===g&&(T.current=null)}}})(),!0},xe=o.useCallback(t=>{const i=t.trim();if(!i||i.length>8e3||v.current||S.current)return!1;const a=B.current,l=[...a].reverse().find(N=>N.role==="user"),f=l!=null&&l.status&&l.status!=="complete"&&l.revision?{replace_message_id:l.id,prior_revision:l.revision}:null,p={id:se(),role:"user",text:i},g={id:se(),role:"assistant",streaming:!0,blocks:[]},b=f&&l?je(a,N=>N.id===l.id):-1,O=b<0?[...a,p,g]:[...a.slice(0,b),p,g];return $(i,{message:i,session_id:C.current.sessionId,client_message_id:crypto.randomUUID(),...!C.current.sessionId&&C.current.initialModel?{initial_model:C.current.initialModel}:{},...f??{}},O,a)},[]),ce=o.useCallback((t,i)=>{const a=i.trim();if(!a||a.length>8e3||v.current||S.current)return!1;const l=B.current.slice(),f=l.findIndex(M=>M.id===t&&M.role==="user");if(f<0)return!1;const p=l[f],g=l.findIndex(M=>M.role==="user"),b=f===g;if(!b&&(!C.current.sessionId||!p.revision))return!1;const O={id:p.id,role:"user",text:a,revision:b?void 0:p.revision+1,status:"generating"},N={id:se(),role:"assistant",streaming:!0,blocks:[]},W=b?[O,N]:[...l.slice(0,f),O,N];return $(a,{message:a,session_id:b?null:C.current.sessionId,client_message_id:crypto.randomUUID(),...b&&C.current.initialModel?{initial_model:C.current.initialModel}:{},...b?{}:{replace_message_id:p.id,prior_revision:p.revision}},W,l,{targetId:p.id,snapshot:l,first:b})},[]),be=o.useCallback(()=>{S.current=null,Y(null)},[]),he=o.useCallback(()=>{const t=S.current;return!t||Date.now()<t.retryAt||v.current?!1:(S.current=null,Y(null),$(t.question,t.request,t.optimistic,t.original,t.edit))},[]),z=o.useCallback(()=>{var l;if(!_.current)return;const t=_.current;G(t),ee(t,"stopped"),t.abort(),_.current=null,((l=T.current)==null?void 0:l.controller)===t&&(T.current=null),v.current=!1,m(!1),h(f=>{const p=f.at(-1);if((p==null?void 0:p.role)!=="assistant")return f;const g=(p.blocks??[]).flatMap(b=>b.kind==="tool"&&b.status==="running"?[]:b.kind==="reasoning"&&b.active?[]:b.kind==="answer"?[{...b,done:!0}]:[b]);return[...f.slice(0,-1),{...p,blocks:g,streaming:!1,finishReason:"stopped"}]}),C.current.onInterrupted(de.current);const i=A.current;i&&St(i).catch(()=>{});const a=++I.current;window.setTimeout(()=>{i&&I.current===a?ye(i,a).catch(()=>{}).finally(()=>C.current.onSettled(i)):i||C.current.onSettled(null)},450)},[]),te=o.useCallback((t,i)=>h(a=>a.map(l=>{var f;return l.id!==t?l:{...l,blocks:(f=l.blocks)==null?void 0:f.map((p,g)=>g===i&&(p.kind==="reasoning"||p.kind==="tool")?{...p,open:!p.open}:p)}})),[]),we=o.useCallback(()=>{var t;I.current+=1,R.current!==null&&(window.clearTimeout(R.current),R.current=null),L.current="cleared",(t=_.current)==null||t.abort(),_.current=null,T.current=null,S.current=null,Y(null),v.current=!1,A.current=null,h([]),m(!1),x("")},[]),ve=o.useCallback(t=>{var i;I.current+=1,R.current!==null&&(window.clearTimeout(R.current),R.current=null),L.current="cleared",T.current=null,S.current=null,Y(null),v.current||((i=_.current)==null||i.abort(),_.current=null),h(t),v.current||m(!1),x("")},[]);return{messages:u,busy:E,papers:Z,sessionError:j,capacityRequest:D,send:xe,editAndResend:ce,retryCapacity:he,cancelCapacity:be,stop:z,toggleBlock:te,reset:we,load:ve}}const Kt="https://huggingface.co/settings/inference-providers",tt="pwc.chat.billing-notice-dismissed.v1",nt=({provider:c})=>{const[u,h]=o.useState(()=>localStorage.getItem(tt)==="1");return!Re()||u||c!=="huggingface"?null:r.jsxs("div",{className:"chat-billing-notice",role:"note",children:[r.jsx("span",{children:"Hugging Face models use the inference permission granted when you start chatting. Included monthly credits are used first, then extra usage requires purchased credits. You can choose organization billing in Settings."}),r.jsxs("div",{className:"chat-billing-notice-actions",children:[r.jsx("a",{href:"/settings",children:"Review billing"}),r.jsx("a",{href:Kt,target:"_blank",rel:"noreferrer",children:"Review usage"}),r.jsx("button",{type:"button",className:"chat-billing-notice-dismiss","aria-label":"Dismiss billing notice",title:"Dismiss",onClick:()=>{localStorage.setItem(tt,"1"),h(!0)},children:r.jsx(_t,{size:15,"aria-hidden":"true"})})]})]})},$t=({retryAt:c,onRetry:u,onCancel:h})=>{const[E,m]=o.useState(()=>Math.max(0,Math.ceil((c-Date.now())/1e3))),j=o.useRef(null);return o.useEffect(()=>{var R;const x=document.activeElement instanceof HTMLElement?document.activeElement:null;(R=j.current)==null||R.focus();const v=()=>m(Math.max(0,Math.ceil((c-Date.now())/1e3)));v();const _=window.setInterval(v,250);return()=>{window.clearInterval(_),x==null||x.focus()}},[c]),r.jsx("div",{className:"chat-capacity-dialog-backdrop",role:"presentation",children:r.jsxs("div",{className:"chat-capacity-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-capacity-dialog-title","aria-describedby":"chat-capacity-dialog-description",onKeyDown:x=>{x.key==="Escape"&&(x.preventDefault(),h())},children:[r.jsx("h2",{id:"chat-capacity-dialog-title",children:"All research slots are currently in use"}),r.jsx("p",{id:"chat-capacity-dialog-description",children:"Your message was not sent or billed. Try again in a few seconds."}),r.jsx("p",{className:"chat-capacity-countdown","aria-live":"polite",children:E>0?`Try again available in ${E} second${E===1?"":"s"}.`:"You can try again now."}),r.jsxs("div",{className:"chat-capacity-dialog-actions",children:[r.jsx("button",{type:"button",className:"chat-capacity-cancel",ref:j,onClick:h,children:"Cancel"}),r.jsx("button",{type:"button",className:"chat-capacity-retry",disabled:E>0,onClick:u,children:"Try again"})]})]})})},on=()=>{var Fe,Ue,qe,Be;const{sessionId:c}=mt(),u=pt(),[h,E]=gt(),{user:m,isLoading:j}=yt(),{toast:x}=bt(),[v,_]=o.useState([]),[R,L]=o.useState(!1),[T,S]=o.useState(""),[D,Y]=o.useState(()=>c?{id:c,status:"loading"}:null),[B,C]=o.useState(0),de=o.useRef(kt()),Q=o.useRef(h.get("model")||((Fe=de.current)==null?void 0:Fe.model)),[ue,I]=o.useState(Tt),[A,H]=o.useState(Q.current||Ct),Z=((Ue=ue.find(e=>e.id===A))==null?void 0:Ue.provider)??"huggingface",se=vt(),[P,V]=o.useState(""),[ae,F]=o.useState(""),[G,K]=o.useState(()=>{var e,n;return((e=h.get("q"))==null?void 0:e.trim())||((n=de.current)==null?void 0:n.prompt)||""}),ie=o.useRef(!1),ee=o.useRef(!1),oe=o.useRef(!1),[ye,$]=o.useState(null),[xe,ce]=o.useState(null),[be,he]=o.useState(""),[z,te]=o.useState(null),[we,ve]=o.useState(()=>typeof window>"u"||window.innerWidth>900),[t,i]=o.useState(!1),[a,l]=o.useState(!1),[f,p]=o.useState(""),g=o.useRef(new Set),b=o.useRef(!1),O=o.useRef(c),N=o.useRef(null),W=o.useRef(null),M=o.useRef(null);O.current=c;const y=o.useCallback(async()=>{if(!m)return;const e=!b.current;e&&L(!0);try{const n=await Ot();_(s=>{const w=N.current,k=w?s.find(pe=>pe.id===w):void 0;if(!k)return n;const q=n.find(pe=>pe.id===w);return[q?{...q,title:k.title,is_busy:!0}:k,...n.filter(pe=>pe.id!==w)]}),b.current=!0,S("")}catch(n){S(n instanceof Error?n.message:"Could not load chats")}finally{e&&L(!1)}},[m]),d=Gt({sessionId:c??null,initialModel:A,onSessionId:e=>{N.current=e;const n=e!==O.current,s=O.current===W.current,w=new Date().toISOString();_(k=>k.some(q=>q.id===e)?k.map(q=>q.id===e?{...q,is_busy:!0}:q):[{id:e,title:"New chat",selected_model:A,created_at:w,updated_at:w,message_count:1,is_busy:!0},...k]),n&&s&&V("New chat"),s&&(M.current=e,Y({id:e,status:"loaded"}),n&&u(`/chat/${e}`,{replace:!0}))},onTitle:e=>{const n=N.current??O.current;n&&!g.current.has(n)&&(n===O.current&&V(e),_(s=>s.map(w=>w.id===n?{...w,title:e}:w)))},onSettled:e=>{e&&_(n=>n.map(s=>s.id===e?{...s,is_busy:!1}:s)),N.current=null,W.current=null,y()},onInterrupted:e=>{F(e)}});d.load;const ne=d.send;o.useEffect(()=>{d.capacityRequest&&F(d.capacityRequest.question)},[d.capacityRequest]),o.useEffect(()=>{d.busy&&$(null)},[d.busy]);const Se=o.useCallback(e=>{sessionStorage.setItem(We,e),sessionStorage.setItem(Ve,A),sessionStorage.setItem(Ge,"1"),window.location.href=wt("/chat",!0)},[A]),fe=o.useCallback(async e=>{if(!m){Se(e);return}if(Z==="huggingface"&&!ee.current){if(oe.current)return;oe.current=!0;try{const s=await fetch(Ne("/api/v1/me/inference-billing"),{credentials:"include",cache:"no-store"});if(!s.ok)throw new Error("Could not check Hugging Face authorization.");if(!(await s.json()).connected){Se(e);return}ee.current=!0}catch(s){F(e),S(s instanceof Error?s.message:"Could not check Hugging Face authorization.");return}finally{oe.current=!1}}const n=O.current??null;ne(e)&&(W.current=n,N.current=n,Et(),F(""))},[Se,Z,ne,m]);o.useEffect(()=>{if(j||!m)return;const e=sessionStorage.getItem(Ve);e&&H(e),y(),jt().then(w=>{if(I(w.items),!O.current){const k=Q.current||e;H(k&&w.items.some(q=>q.id===k)?k:w.default_model)}});const n=sessionStorage.getItem(We),s=sessionStorage.getItem(Ge)==="1";n&&(s?K(n):F(n))},[j,y,m]),o.useEffect(()=>{if(!c){M.current!==null&&(M.current=null,d.reset()),Y(null);return}if(M.current===c||(Y(n=>(n==null?void 0:n.id)===c&&n.status==="loading"?n:{id:c,status:"loading"}),j||!m))return;let e=!1;return S(""),Le(c).then(n=>{e||(d.load(rt(n)),H(n.selected_model),V(n.title),M.current=c,Y({id:c,status:"loaded"}))}).catch(n=>{if(e)return;const s=n instanceof Error?n.message:"Chat not found";d.reset(),S(s),Y({id:c,status:"error",error:s})}),()=>{e=!0}},[j,c,m,d.busy,B]),o.useEffect(()=>{var w;const e=(w=h.get("q"))==null?void 0:w.trim();if(!e)return;ie.current=!1;const n=h.get("model");n&&H(n),K(e);const s=new URLSearchParams(h);s.delete("q"),s.delete("model"),E(s,{replace:!0})},[h,E]),o.useEffect(()=>{if(j||d.busy||!G||ie.current)return;const e=window.setTimeout(()=>{if(ie.current)return;ie.current=!0;const n=G;K(""),fe(n)},0);return()=>window.clearTimeout(e)},[j,d.busy,G,fe]),o.useEffect(()=>{const e=()=>{!m||d.busy||y()};return window.addEventListener("focus",e),()=>window.removeEventListener("focus",e)},[d.busy,y,m]),o.useEffect(()=>{if(!z)return;const e=()=>te(null),n=s=>{s.key==="Escape"&&e()};return window.addEventListener("click",e),window.addEventListener("keydown",n),()=>{window.removeEventListener("click",e),window.removeEventListener("keydown",n)}},[z]);const Ae=()=>{N.current=null,d.reset(),F(""),V(""),u("/chat")},De=async e=>{const n=be.trim();if(n)try{const s=await ze(e,{title:n});g.current.add(e),e===c&&V(s.title),_(w=>w.map(k=>k.id===e?s:k)),ce(null)}catch(s){S(s instanceof Error?s.message:"Rename failed")}},it=async e=>{const n=e===c&&d.busy;if(window.confirm(n?"Stop and delete this chat? This cannot be undone.":"Delete this chat? This cannot be undone.")){n&&d.stop();try{if(n){const s=Date.now()+3e3;for(;(await Le(e)).is_busy;){if(Date.now()>=s)throw new Error("Generation is still stopping. The chat was not deleted.");await new Promise(k=>window.setTimeout(k,150))}}await At(e),e===c&&Ae(),await y()}catch(s){S(s instanceof Error?s.message:"Delete failed")}}},ot=async()=>{var e;if(!a){l(!0);try{const n=await Pt();if(await y(),n.archived_count===0){x({title:"No chats were archived",description:"There are no inactive chats older than 30 days."});return}const s=((e=[...d.messages].reverse().find(w=>w.role==="user"))==null?void 0:e.text)??"";d.reset(),F(s),V(""),x({title:`${n.archived_count} ${n.archived_count===1?"chat":"chats"} archived`,description:"Your question is ready to send again."})}catch(n){x({variant:"destructive",title:"Could not archive old chats",description:n instanceof Error?n.message:"Try again."})}finally{l(!1)}}},Pe=async e=>{const n=A;if(H(e),!!c)try{const s=await ze(c,{selected_model:e});_(w=>w.map(k=>k.id===c?{...k,selected_model:s.selected_model}:k)),S("")}catch(s){H(n),S(s instanceof Error?s.message:"Model change failed")}},ct=async()=>{var e;if(!(!c||d.busy||t)){i(!0);try{const n=await Dt(c),s=new URL(n.public_path,window.location.origin).toString();try{if(!((e=navigator.clipboard)!=null&&e.writeText))throw new Error("Clipboard unavailable");await navigator.clipboard.writeText(s),x({className:"chat-share-toast",duration:5e3,title:"Public link copied to your clipboard",description:"Anyone with this link can see this conversation."})}catch{p(s)}}catch(n){const s=n instanceof Error?n.message:"Could not share this conversation";S(s),x({variant:"destructive",title:"Share failed",description:s})}finally{i(!1)}}},[lt,dt]=o.useState(60);o.useLayoutEffect(()=>{const e=document.querySelector(".app-header");if(!e)return;const n=()=>dt(e.offsetHeight);n();const s=new ResizeObserver(n);return s.observe(e),()=>s.disconnect()},[]);const ke=o.useRef(null),_e=o.useRef(null),me=o.useRef(null);o.useEffect(()=>{d.busy||(me.current=null)},[d.busy]);const ut=(e,n)=>{var s;_e.current=((s=ke.current)==null?void 0:s.scrollTop)??null,d.toggleBlock(e,n)};o.useLayoutEffect(()=>{const e=ke.current;if(e){if(_e.current!==null){e.scrollTop=_e.current,_e.current=null;return}if(me.current){const n=Array.from(e.querySelectorAll("[data-message-id]")).find(s=>s.dataset.messageId===me.current);if(n){const s=e.getBoundingClientRect(),w=n.getBoundingClientRect();e.scrollTop+=w.top-s.top-24;return}}e.scrollTop=e.scrollHeight}},[d.messages]);const le=v.find(e=>e.id===c),Me=d.messages.filter(e=>e.role==="user"),Te=(qe=Me[0])==null?void 0:qe.id,ht=(Be=Me.at(-1))==null?void 0:Be.id,Ce=d.messages.length===0,Oe=(D==null?void 0:D.id)===c,Ee=!!(c&&(j||m&&(!Oe||(D==null?void 0:D.status)==="loading"))),Ye=Oe&&(D==null?void 0:D.status)==="error"?D.error:void 0;return r.jsxs("div",{className:"chat-page",style:{height:`calc(100dvh - ${lt}px)`},children:[r.jsxs("aside",{className:`chat-sidebar${we?"":" chat-sidebar-closed"}`,children:[r.jsxs("div",{className:"chat-sidebar-top",children:[r.jsxs("button",{type:"button",className:"chat-new-chat",onClick:Ae,children:[r.jsx(Lt,{})," New chat"]}),r.jsx("button",{type:"button",className:"icon-btn",onClick:()=>ve(!1),title:"Collapse sidebar",children:r.jsx(Ke,{})})]}),r.jsxs("nav",{className:"chat-sessions","aria-label":"Chat history",children:[R&&r.jsx("div",{className:"chat-sessions-empty",children:"Loading chats…"}),!R&&T&&r.jsx("div",{className:"chat-sessions-empty",children:T}),!R&&!T&&v.length===0&&r.jsx("div",{className:"chat-sessions-empty",children:"Conversations you start will show up here."}),It(v).map(e=>r.jsxs("div",{className:"chat-session-group",children:[r.jsx("div",{className:"chat-session-group-label",children:e.label}),e.items.map(n=>r.jsxs("div",{className:`chat-session${n.id===c?" chat-session-active":""}`,role:"button",tabIndex:0,onClick:()=>u(`/chat/${n.id}`),onKeyDown:s=>{if(s.key==="Enter"&&u(`/chat/${n.id}`),s.key==="F2"&&(ce(n.id),he(n.title)),s.key==="ContextMenu"||s.shiftKey&&s.key==="F10"){s.preventDefault();const w=s.currentTarget.getBoundingClientRect();te({id:n.id,x:w.right-150,y:w.bottom})}},onContextMenu:s=>{s.preventDefault(),te({id:n.id,x:s.clientX,y:s.clientY})},children:[xe===n.id?r.jsx("input",{className:"chat-session-title-input",value:be,autoFocus:!0,maxLength:80,onClick:s=>s.stopPropagation(),onChange:s=>he(s.target.value),onBlur:()=>void De(n.id),onKeyDown:s=>{s.stopPropagation(),s.key==="Enter"&&De(n.id),s.key==="Escape"&&ce(null)}}):r.jsx("span",{className:"chat-session-title",children:n.title}),r.jsx("button",{type:"button",className:"chat-session-menu","aria-label":"Chat actions","aria-haspopup":"menu",title:"Chat actions",onClick:s=>{s.stopPropagation();const w=s.currentTarget.getBoundingClientRect();te({id:n.id,x:w.right-150,y:w.bottom})},children:"⋯"}),r.jsx("button",{type:"button",className:"chat-session-delete","aria-label":"Delete conversation",onClick:s=>{s.stopPropagation(),it(n.id)},children:r.jsx(Nt,{})})]},n.id))]},e.label))]}),z&&r.jsx("div",{className:"chat-session-context-menu",role:"menu",style:{left:z.x,top:z.y},onClick:e=>e.stopPropagation(),children:r.jsx("button",{type:"button",role:"menuitem",autoFocus:!0,onClick:()=>{const e=v.find(n=>n.id===z.id);e&&(ce(e.id),he(e.title)),te(null)},children:"Rename chat"})})]}),r.jsxs("section",{className:"chat-main",children:[r.jsxs("div",{className:"chat-topbar",children:[!we&&r.jsx("button",{type:"button",className:"icon-btn",onClick:()=>ve(!0),title:"Open sidebar",children:r.jsx(Ke,{})}),r.jsx("span",{className:"chat-topbar-title",children:Ee?(le==null?void 0:le.title)||"":P||(le==null?void 0:le.title)||(Ce?"":"New chat")}),se&&r.jsx("span",{className:"chat-staging-badge",children:"Staging"}),c&&Oe&&(D==null?void 0:D.status)==="loaded"&&!Ce&&r.jsxs("button",{type:"button",className:"chat-share-button",onClick:()=>void ct(),disabled:d.busy||t||Ee,"aria-label":"Share conversation",children:[t?r.jsx($e,{}):r.jsx(Yt,{"aria-hidden":"true"}),r.jsx("span",{children:"Share"})]})]}),Ee?r.jsxs("div",{className:"chat-session-loading",role:"status","aria-live":"polite",children:[r.jsx($e,{}),r.jsx("span",{children:"Loading conversation…"})]}):Ye?r.jsxs("div",{className:"chat-session-load-error",role:"alert",children:[r.jsx("p",{children:Ye}),r.jsx("button",{type:"button",onClick:()=>{Y({id:c,status:"loading"}),C(e=>e+1)},children:"Try again"})]}):Ce?r.jsx("div",{className:"chat-empty",children:r.jsxs("div",{className:"chat-empty-inner",children:[r.jsx("div",{className:"chat-empty-eyebrow",children:"AI research assistant · Staging preview"}),r.jsxs("h1",{className:"chat-empty-title",children:["Ask ",r.jsx("em",{children:"Papers With Code"})]}),r.jsx("p",{className:"chat-empty-sub",children:"Answers are grounded in a live hybrid search over papers, tasks, and benchmarks — with citations you can follow."}),se&&r.jsx("p",{className:"chat-staging-access-note",children:"This is a limited staging preview. Only approved Hugging Face users can start chats."}),r.jsx(nt,{provider:Z}),r.jsx(He,{onSend:fe,busy:d.busy,onStop:d.stop,autoFocus:!0,draft:ae,onDraftChange:F,models:ue,selectedModel:A,onModelChange:e=>void Pe(e)}),r.jsx("div",{className:"chat-examples",children:Mt.map(e=>r.jsx("button",{type:"button",className:"chat-example",onClick:()=>fe(e),children:e},e))})]})}):r.jsxs(r.Fragment,{children:[d.sessionError&&r.jsx("div",{className:"chat-session-error",role:"alert",children:d.sessionError}),r.jsx("div",{className:"chat-conversation",ref:ke,children:r.jsx("div",{className:"chat-conversation-inner",children:d.messages.map(e=>e.role==="user"?r.jsx(Rt,{id:e.id,text:e.text??"",isInitial:e.id===Te,editingAllowed:!d.busy&&!!e.revision,editing:ye===e.id,editNotice:e.id===Te?"Sending will start a new chat.":e.id===ht?"Sending will replace the response.":"Sending will replace the response and all messages after it.",onEdit:()=>$(e.id),onCancel:()=>$(null),onResend:n=>{e.id!==Te&&(me.current=e.id);const s=d.editAndResend(e.id,n);return s?$(null):me.current=null,s}},e.id):r.jsx(xt,{msg:e,papers:d.papers,onToggleBlock:ut,onArchiveOldChats:()=>void ot(),archivePending:a},e.id))})}),r.jsx("div",{className:"chat-composer-wrap",children:r.jsxs("div",{className:"chat-composer-inner",children:[r.jsx(nt,{provider:Z}),r.jsx(He,{onSend:fe,busy:d.busy,onStop:d.stop,placeholder:ae?"Edit and send again…":"Ask a follow-up…",draft:ae,onDraftChange:F,models:ue,selectedModel:A,onModelChange:e=>void Pe(e)}),r.jsx("div",{className:"chat-composer-foot",children:Re()?r.jsxs(r.Fragment,{children:[Z==="openrouter"?r.jsxs("span",{className:"chat-provider-attribution",children:["Powered by ",r.jsx("a",{href:"https://openrouter.ai",target:"_blank",rel:"noreferrer",children:"OpenRouter"}),"."]}):r.jsxs("span",{className:"chat-provider-attribution",children:["Powered by 🤗 ",r.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"}),"."]}),r.jsx("span",{children:"The AI assistant can make mistakes. Double-check responses."})]}):r.jsx(r.Fragment,{children:"Assistant preview — responses are simulated."})})]})})]})]}),f&&r.jsx("div",{className:"chat-share-dialog-backdrop",role:"presentation",onMouseDown:()=>p(""),children:r.jsxs("div",{className:"chat-share-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-share-dialog-title",onMouseDown:e=>e.stopPropagation(),children:[r.jsx("h2",{id:"chat-share-dialog-title",children:"Public link created"}),r.jsx("p",{children:"It could not be copied automatically. Copy this link manually:"}),r.jsx("input",{readOnly:!0,value:f,"aria-label":"Public conversation link",autoFocus:!0,onFocus:e=>e.currentTarget.select()}),r.jsx("button",{type:"button",onClick:()=>p(""),children:"Close"})]})}),d.capacityRequest&&r.jsx($t,{retryAt:d.capacityRequest.retryAt,onCancel:d.cancelCapacity,onRetry:()=>{d.retryCapacity()&&F("")}})]})};export{$t as ChatCapacityDialog,on as default};
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/ChatView-BiviZbfg.js ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import{c as Rt,d as Pe,r as o,j as n,e as xt,u as St,a as kt,f as Ot,g as Ct,h as Tt,k as Et,l as jt,X as Lt}from"./index-Bo5_2OqZ.js";import{C as Je,U as Nt,A as It}from"./ChatMessage-DAiy1xqv.js";import{c as At,g as De,t as ht,r as Dt,F as Pt,D as Mt,l as Yt,C as Xe,a as Ze,b as et,d as Ft,e as Ut,P as qt,f as tt,h as Bt,T as Ht,S as nt,u as rt,i as Wt,j as Vt,k as Gt}from"./chatSessions-Dz4Iu-O1.js";import{S as Kt}from"./chatPrompts-CDY3UGU1.js";import{u as $t,O as zt,a as Qt,b as Jt,r as Xt}from"./openrouter-C1zb8Waa.js";import"./katex.min-BSBacQyE.js";import"./hover-card-DrtqDSb0.js";import"./PaperPreviewLink-DTmodbgi.js";import"./index-C-0CcYmz.js";import"./useQuery-Bh9FZQpL.js";import"./useBaseQuery-B8T7kRNC.js";/**
2
+ * @license lucide-react v0.462.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const Zt=Rt("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]),q=(l,d)=>new Promise(h=>{const S=setTimeout(f,l);function f(){d==null||d.removeEventListener("abort",f),clearTimeout(S),h()}d==null||d.addEventListener("abort",f)}),te=l=>({arxiv_id:null,source:"arxiv",source_url:null,thumbnail_url:null,authors:[],published:null,conference:null,citation_count:null,tasks:[],methods:[],repositories:[],project_pages:[],...l}),ne={name:"Object Detection",slug:"object-detection"},ae={name:"Real-Time Object Detection",slug:"real-time-object-detection"},en={"2502.12524":{route_id:"2502.12524",title:"YOLOv12: Attention-Centric Real-Time Object Detectors",content:"Enhancing the network architecture of the YOLO framework has been crucial for a long time. This work introduces an attention-centric YOLO framework, namely YOLOv12, built around area attention and residual efficient layer aggregation networks (R-ELAN). YOLOv12-N reaches 40.6 mAP at 1.64 ms on a T4 GPU, closing the gap to attention-based detectors without the usual latency penalty and surpassing YOLOv10/YOLOv11 by +1.2–1.6 mAP at matched latency.",content_truncated:!1,metadata:te({arxiv_id:"2502.12524",authors:[{name:"Y. Tian"},{name:"Q. Ye"},{name:"D. Doermann"}],published:"2025-02-18",citation_count:412,tasks:[ne,ae],methods:[{name:"Area Attention",slug:"area-attention"}],repositories:[{url:"https://github.com/sunsmarterjie/yolov12",stars:18700}]})},"2407.17140":{route_id:"2407.17140",title:"RT-DETRv2: Improved Baseline with Bag-of-Freebies for Real-Time Detection",content:"RT-DETRv2 improves the real-time DETR baseline with selective multi-scale feature extraction, a discrete sampling operator to ease deployment, and training-only 'bag-of-freebies' that add no inference cost. RT-DETRv2-R18/R50/R101 reach 47.9 / 53.4 / 54.3 mAP on COCO at 217 / 108 / 74 FPS on T4 TensorRT FP16, remaining NMS-free end to end.",content_truncated:!1,metadata:te({arxiv_id:"2407.17140",authors:[{name:"W. Lv"},{name:"Y. Zhao"},{name:"J. Chang"}],published:"2024-07-24",citation_count:268,tasks:[ne,ae],methods:[{name:"DETR",slug:"detr"}],repositories:[{url:"https://github.com/lyuwenyu/RT-DETR",stars:9400}]})},"2410.13842":{route_id:"2410.13842",title:"D-FINE: Redefining Regression as Fine-grained Distribution Refinement",content:"D-FINE reformulates bounding-box regression in DETR-style detectors as iterative refinement of probability distributions (FDR) and adds a localization self-distillation scheme (GO-LSD). D-FINE-L reaches 54.0 mAP at ~9 ms and D-FINE-X 55.8 mAP on COCO while staying real-time on modern GPUs, dominating RT-DETRv2 and YOLOv10 on the accuracy–latency Pareto front.",content_truncated:!1,metadata:te({arxiv_id:"2410.13842",authors:[{name:"Y. Peng"},{name:"H. Li"},{name:"P. Wu"}],published:"2024-10-17",conference:"ICLR 2025",citation_count:187,tasks:[ne,ae],methods:[{name:"Knowledge Distillation",slug:"knowledge-distillation"}],repositories:[{url:"https://github.com/Peterande/D-FINE",stars:12100}]})},"2406.03459":{route_id:"2406.03459",title:"LW-DETR: A Transformer Replacement to YOLO for Real-Time Detection",content:"LW-DETR pairs a plain ViT encoder with a lightweight DETR decoder and shows the combination outperforms YOLOv8 and YOLO-NAS at comparable latency, arguing transformer detectors are viable even at the fast end of the accuracy–latency curve. Uses multi-level feature aggregation, window-attention interleaving, and IoU-aware classification.",content_truncated:!1,metadata:te({arxiv_id:"2406.03459",authors:[{name:"Q. Chen"},{name:"X. Su"},{name:"X. Zhang"}],published:"2024-06-05",citation_count:94,tasks:[ne,ae],methods:[{name:"Vision Transformer",slug:"vision-transformer"}],repositories:[{url:"https://github.com/Atten4Vis/LW-DETR",stars:5200}]})},"2304.08069":{route_id:"2304.08069",title:"DETRs Beat YOLOs on Real-time Object Detection",content:"RT-DETR is the first real-time end-to-end object detector, built on an efficient hybrid encoder that decouples intra-scale interaction and cross-scale fusion, plus IoU-aware query selection. RT-DETR-R50 achieves 53.1 mAP at 108 FPS on COCO, beating comparably sized YOLO detectors in both speed and accuracy while eliminating NMS entirely; its Figure 1 accuracy–latency plot became the reference for later real-time detectors.",content_truncated:!1,metadata:te({arxiv_id:"2304.08069",authors:[{name:"Y. Zhao"},{name:"W. Lv"},{name:"S. Xu"}],published:"2023-04-17",conference:"CVPR 2024",citation_count:2310,tasks:[ne,ae],methods:[{name:"DETR",slug:"detr"}],repositories:[{url:"https://github.com/lyuwenyu/RT-DETR",stars:9400}]})},"2405.14458":{route_id:"2405.14458",title:"YOLOv10: Real-Time End-to-End Object Detection",content:"YOLOv10 removes NMS from the YOLO pipeline via consistent dual assignments during training and applies a holistic efficiency–accuracy driven design across the architecture. YOLOv10-S is 1.8x faster than RT-DETR-R18 at similar COCO accuracy; the family spans 46.3–54.4 mAP with substantially lower end-to-end latency than prior YOLOs because post-processing disappears.",content_truncated:!1,metadata:te({arxiv_id:"2405.14458",authors:[{name:"A. Wang"},{name:"H. Chen"},{name:"L. Liu"}],published:"2024-05-23",conference:"NeurIPS 2024",citation_count:1650,tasks:[ne,ae],methods:[{name:"NMS-free Training",slug:"nms-free-training"}],repositories:[{url:"https://github.com/THU-MIG/yolov10",stars:44200}]})},"2401.17270":{route_id:"2401.17270",title:"YOLO-World: Real-Time Open-Vocabulary Object Detection",content:"YOLO-World extends the YOLO paradigm to open-vocabulary detection through vision-language modeling with a re-parameterizable vision-language path aggregation network (RepVL-PAN) and region-text contrastive pretraining. It detects categories never seen at training time while running at 35+ FPS, and its prompt-then-detect deployment re-parameterizes text embeddings for zero runtime text-encoder cost.",content_truncated:!1,metadata:te({arxiv_id:"2401.17270",authors:[{name:"T. Cheng"},{name:"L. Song"},{name:"Y. Ge"}],published:"2024-01-30",conference:"CVPR 2024",citation_count:890,tasks:[{name:"Open-Vocabulary Object Detection",slug:"open-vocabulary-object-detection"},ne],methods:[{name:"Contrastive Learning",slug:"contrastive-learning"}],repositories:[{url:"https://github.com/AILab-CVC/YOLO-World",stars:16800}]})},158342:{route_id:"158342",title:"Ultralytics YOLO: real-time detection framework and model zoo",content:"Official Ultralytics framework release covering YOLO11 and YOLOv12 deployment: pretrained COCO checkpoints from nano to x-large, TensorRT/ONNX/CoreML export paths, and reproducible latency benchmarks on T4, Jetson Orin, and CPU targets. Widely used as the practical baseline for real-time detection deployments.",content_truncated:!1,metadata:te({source:"external",source_url:"https://docs.ultralytics.com/models/",authors:[{name:"Ultralytics"}],published:"2025-01-02",tasks:[ne,ae],repositories:[{url:"https://github.com/ultralytics/ultralytics",stars:46e3}],project_pages:[{url:"https://docs.ultralytics.com"}]})}},ft=l=>l.map(d=>en[d]),st=ft(["2502.12524","2407.17140","2410.13842","2406.03459","2304.08069","2405.14458","2401.17270","158342"]),at=ft(["2410.13842","2502.12524","2407.17140","2405.14458","2304.08069"]),it="The user wants the current state-of-the-art for real-time object detection. That's a moving target split across two lineages — the YOLO family (fast CNN one-stage detectors) and the DETR family (transformer, end-to-end, NMS-free). I should ground the answer in recent papers benchmarked on COCO with reported latency or FPS, not just accuracy. Let me start with a broad hybrid search, see which papers surface, then run a second, narrower query to pin down the head-to-head COCO mAP vs latency trade-offs before I write anything.",ot="Good — both lineages are well represented. YOLOv12, YOLOv10 and RT-DETRv2 / D-FINE keep coming up. To actually rank them I need the accuracy-vs-latency numbers side by side on the same COCO val2017 protocol, so let me narrow the query to the benchmark comparison specifically.",ct=`There isn't a single winner — real-time object detection in 2026 is a two-horse race between the [YOLO family](paper:2502.12524) (fast one-stage CNNs) and the end-to-end [DETR family](paper:2304.08069) (NMS-free transformers). Which one is “SOTA” depends entirely on where you sit on the accuracy-vs-latency curve.
7
+
8
+ **At the fast / edge end**, [YOLOv12](paper:2502.12524) is the current leader. Its area-attention design pushes attention into the YOLO backbone without the usual latency hit — YOLOv12-N reaches 40.6 mAP at ~1.6 ms on a T4, roughly +1.5 mAP over [YOLOv10](paper:2405.14458) at matched speed. [YOLOv10](paper:2405.14458) is still very relevant because it made the YOLO head NMS-free, cutting real end-to-end latency.
9
+
10
+ **At the high-accuracy end**, the transformer detectors win. [D-FINE](paper:2410.13842) currently holds the accuracy-latency Pareto front, reporting 55.8 mAP by reformulating box regression as fine-grained distribution refinement with self-distillation. It builds on [RT-DETRv2](paper:2407.17140), which hardened the [original RT-DETR](paper:2304.08069) recipe (the paper that first showed DETRs beating YOLOs in real time) with training-only “bag-of-freebies” that add no inference cost.
11
+
12
+ **My recommendation:** for edge or high-FPS deployment, start with [YOLOv12](paper:2502.12524) — the [Ultralytics framework](paper:158342) has ready-made checkpoints and export paths. If you have GPU headroom and want maximum accuracy while staying real-time, use [D-FINE](paper:2410.13842) or [RT-DETRv2](paper:2407.17140). And if you need open-vocabulary detection rather than fixed COCO classes, [YOLO-World](paper:2401.17270) is the one to look at.`,tn=["How do these compare on edge devices like Jetson?","Show me open-vocabulary detectors","What about small-object detection?"];async function*nn(l,d){const h=()=>(d==null?void 0:d.aborted)===!0,S=l.trim().slice(0,90)||"state-of-the-art real-time object detection";if(yield{type:"stream_start",request_id:"req_mock",session_id:null},await q(350,d),!h()){yield{type:"reasoning_start"};for(let f=0;f<it.length;f+=6){if(await q(14,d),h())return;yield{type:"reasoning_delta",text:it.slice(f,f+6)}}if(await q(400,d),!h()&&(yield{type:"reasoning_end"},await q(300,d),!h()&&(yield{type:"tool_call",id:"call_1",name:"search_papers",args:{query:S,top_k:8}},await q(1100,d),!h()&&(yield{type:"tool_result",id:"call_1",hits:st.length,took_ms:214,results:st},await q(350,d),!h())))){yield{type:"reasoning_start"};for(let f=0;f<ot.length;f+=6){if(await q(14,d),h())return;yield{type:"reasoning_delta",text:ot.slice(f,f+6)}}if(await q(350,d),!h()&&(yield{type:"reasoning_end"},await q(300,d),!h()&&(yield{type:"tool_call",id:"call_2",name:"search_papers",args:{query:"RT-DETR vs YOLOv12 COCO mAP latency FPS T4 TensorRT comparison",top_k:5}},await q(900,d),!h()&&(yield{type:"tool_result",id:"call_2",hits:at.length,took_ms:176,results:at},await q(400,d),!h())))){for(let f=0;f<ct.length;f+=4){if(await q(11,d),h())return;yield{type:"answer_delta",text:ct.slice(f,f+4)}}yield{type:"done",followups:tn,finish_reason:"success"}}}}}const ke=()=>{const d=String("0").trim().toLowerCase();return d==="1"||d==="true"||d==="yes"};class Se extends Error{constructor(d,h,S,f){super(d),this.code=h,this.status=S,this.retryAfterSeconds=f,this.name="ChatStreamError"}}function rn(l,d){if(ke())try{fetch(Pe(`/api/v1/chat/latency/${encodeURIComponent(l)}`),{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",keepalive:!0,body:JSON.stringify(d)}).catch(()=>{})}catch{}}function sn(l,d={}){return ke()?an(l,d.signal):nn(l.message,d.signal)}async function*an(l,d){const h=await fetch(Pe("/api/v1/chat/stream"),{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream"},credentials:"include",body:JSON.stringify(l),signal:d});if(!h.ok||!h.body){const R=await h.json().catch(()=>null),v=R==null?void 0:R.detail,_=h.status===403&&!v,w=Number(h.headers.get("Retry-After")),j=Number.isFinite(w)&&w>=0?Math.min(300,Math.ceil(w)):void 0;throw new Se(_?"Chat on staging is limited to approved Hugging Face users. Sign in with an approved account and try again.":(v==null?void 0:v.message)||v||`Chat stream failed (${h.status})`,(v==null?void 0:v.code)||(_?"staging_access_required":void 0),h.status,j)}const S=h.body.getReader(),f=new TextDecoder;let k="";try{for(;;){const{done:R,value:v}=await S.read();if(R)break;k+=f.decode(v,{stream:!0});let _;for(;(_=k.indexOf(`
13
+
14
+ `))!==-1;){const w=k.slice(0,_);k=k.slice(_+2);const j=w.split(`
15
+ `).filter(L=>L.startsWith("data:")).map(L=>L.slice(5).trimStart()).join(`
16
+ `);!j||j==="[DONE]"||(yield JSON.parse(j))}}}finally{S.releaseLock()}}const mt="Preparing research workspace…",on=750;function be(l){if(l.status!==mt)return l;const{status:d,...h}=l;return h}function Ae(l,d){for(let h=l.length-1;h>=0;h-=1)if(d(l[h]))return h;return-1}function cn(l){const[d,h]=o.useState([]),[S,f]=o.useState(!1),[k,R]=o.useState(""),v=o.useRef(!1),_=o.useRef(null),w=o.useRef(null),j=o.useRef("cleared"),L=o.useRef(null),M=o.useRef(null),[F,C]=o.useState(null),I=o.useRef([]),x=o.useRef(l),we=o.useRef(""),re=o.useRef(""),ve=o.useRef(0),T=o.useRef(0),K=o.useRef(l.sessionId),B=o.useRef(l.sessionId);B.current!==l.sessionId&&(B.current=l.sessionId,K.current!==l.sessionId&&(T.current+=1,L.current=null)),x.current=l,I.current=d,o.useEffect(()=>()=>{var t;w.current!==null&&window.clearTimeout(w.current),(t=_.current)==null||t.abort(),M.current=null},[]),o.useEffect(()=>{v.current||(K.current=l.sessionId)},[l.sessionId]);const $=o.useMemo(()=>{const t={};for(const i of d)for(const a of i.blocks??[])if(a.kind==="tool")for(const u of a.results??[])t[u.route_id]=u;return t},[d]),A=()=>`m${++ve.current}_${Date.now().toString(36)}`,D=t=>h(i=>{if(!i.length)return i;const a=i.slice();return a[a.length-1]=t(a[a.length-1]),a}),_e=t=>D(i=>{const a=be(i);return{...a,blocks:[...a.blocks??[],t]}}),he=(t,i)=>D(a=>{const u=be(a);return{...u,blocks:(u.blocks??[]).map((m,p,g)=>t(m,p,g)?i(m):m)}}),Oe=t=>(i,a,u)=>i.kind===t&&Ae(u,m=>m.kind===t)===a,H=t=>{if(_.current!==t||(w.current!==null&&(window.clearTimeout(w.current),w.current=null),j.current==="cleared"))return;const i=j.current==="shown";j.current="cleared",i&&D(be)},z=(t,i)=>{t.requestId&&rn(t.requestId,i)},U=(t,i)=>{const a=L.current;!a||a.controller!==t||(a.requestId=i,a.streamStartReported||(a.streamStartReported=!0,z(a,{submission_to_stream_start_ms:Math.max(0,performance.now()-a.submittedAt)})),a.firstVisibleAt!==void 0&&!a.firstVisibleReported&&(a.firstVisibleReported=!0,z(a,{submission_to_first_visible_delta_ms:Math.max(0,a.firstVisibleAt-a.submittedAt)})))},Q=(t,i)=>{const a=L.current;!a||a.controller!==t||a.terminalReported||(a.terminalReported=!0,z(a,{terminal_classification:i}))};o.useLayoutEffect(()=>{const t=L.current;if(!t||t.firstVisibleAt!==void 0)return;const i=d.at(-1);(i==null?void 0:i.role)!=="assistant"||!(i.blocks??[]).some(u=>u.kind==="tool"||u.kind==="reasoning"&&!!u.text.trim()||u.kind==="answer"&&!!u.text.trim())||(t.firstVisibleAt=performance.now(),t.requestId&&!t.firstVisibleReported&&(t.firstVisibleReported=!0,z(t,{submission_to_first_visible_delta_ms:Math.max(0,t.firstVisibleAt-t.submittedAt)})))},[d]);const ie=t=>{switch(t.type){case"stream_start":t.session_id&&(K.current=t.session_id,x.current.onSessionId(t.session_id));break;case"sandbox_start":case"sandbox_ready":case"workspace_ready":break;case"session_title_start":re.current="";break;case"session_title_delta":re.current+=t.text,x.current.onTitle(re.current.replace(/\s+/g," ").slice(0,80));break;case"session_title_done":re.current=t.title,x.current.onTitle(t.title);break;case"reasoning_start":D(i=>{const a=be(i);return{...a,blocks:[...(a.blocks??[]).map(u=>u.kind==="reasoning"&&u.active?{...u,active:!1,open:!1}:u),{kind:"reasoning",text:"",active:!0,open:!0}]}});break;case"reasoning_delta":he(Oe("reasoning"),i=>i.kind==="reasoning"?{...i,text:i.text+t.text}:i);break;case"reasoning_end":D(i=>{const a=i.blocks??[],u=Ae(a,g=>g.kind==="reasoning"&&g.active);if(u<0)return i;const m=a[u];if(m.kind!=="reasoning")return i;const p=a[u-1];return(p==null?void 0:p.kind)==="reasoning"&&p.text===m.text?{...i,blocks:a.filter((g,y)=>y!==u)}:{...i,blocks:a.map((g,y)=>y===u?{...m,active:!1,open:!1}:g)}});break;case"tool_call":_e({kind:"tool",id:t.id,name:t.name,args:t.args,status:"running",open:!1});break;case"tool_result":he(i=>i.kind==="tool"&&i.id===t.id,i=>i.kind==="tool"?t.status?{...i,schema_version:2,status:t.status,took_ms:t.took_ms,content:t.content,metadata:t.metadata,open:t.status!=="success"}:{...i,status:"done",hits:t.hits,took_ms:t.took_ms,results:t.results}:i);break;case"answer_delta":D(i=>{const a=be(i),u=a.blocks??[],m=u.at(-1);return(m==null?void 0:m.kind)==="answer"&&!m.done?{...a,blocks:[...u.slice(0,-1),{...m,text:m.text+t.text}]}:{...a,blocks:[...u,{kind:"answer",text:t.text,done:!1}]}});break;case"done":D(i=>({...i,streaming:!1,followups:t.followups,finishReason:t.finish_reason,citations:t.citations,blocks:(i.blocks??[]).map(a=>a.kind==="answer"?{...a,done:!0}:a.kind==="reasoning"&&a.active?{...a,active:!1,open:!1}:a)}));break;case"error":D(i=>({...i,streaming:!1,error:t.message,errorCode:t.code,blocks:(i.blocks??[]).map(a=>a.kind==="reasoning"&&a.active?{...a,active:!1,open:!1}:a)}));break}},se=async(t,i)=>{const a=await De(t),u=ht(a);return T.current!==i?null:(h(u),I.current=u,u)},oe=(t,i,a,u,m)=>{const p=++T.current;v.current=!0;const g=new AbortController;return _.current=g,we.current=t,K.current=i.session_id,R(""),h(a),f(!0),L.current={controller:g,submittedAt:performance.now(),streamStartReported:!1,firstVisibleReported:!1,terminalReported:!1},w.current!==null&&window.clearTimeout(w.current),j.current="armed",w.current=window.setTimeout(()=>{w.current=null,!(j.current!=="armed"||_.current!==g||g.signal.aborted||T.current!==p)&&(j.current="shown",D(y=>{var P;return y.role==="assistant"&&y.streaming&&(((P=y.blocks)==null?void 0:P.length)??0)===0&&!y.error?{...y,status:mt}:y}))},on),(async()=>{var ue,Z,V;let y=!1,P=!1,Y=!1,X=!1,N=!1,W=!1;try{for await(const c of sn(i,{signal:g.signal})){c.type==="stream_start"&&(y=!0,P=c.provider_execution!==!1,U(g,c.request_id)),(c.type==="workspace_ready"||c.type==="reasoning_start"||c.type==="reasoning_delta"||c.type==="tool_call"||c.type==="answer_delta"||c.type==="done"||c.type==="error")&&H(g),(c.type==="done"||c.type==="error")&&(X=!0,N=c.type==="error",Q(g,c.type==="error"?"error":"complete"),c.type==="error"&&["openrouter_monthly_budget_exhausted","openrouter_unavailable","openrouter_byok_credential_invalid","openrouter_byok_billing_error","openrouter_byok_rate_limit"].includes(c.code??"")&&(Y=!0,x.current.onInterrupted(t)));const E=T.current===p;!g.signal.aborted&&(E||c.type==="stream_start"||c.type==="session_title_start"||c.type==="session_title_delta"||c.type==="session_title_done")&&ie(c)}}catch(c){if(N=!0,!g.signal.aborted){if(H(g),c instanceof Se&&c.code==="chat_capacity"){W=!0;const E=c.retryAfterSeconds??5,ee={question:t,request:i,optimistic:a,original:u,edit:m,retryAfterSeconds:E,retryAt:Date.now()+E*1e3};M.current=ee,C({question:t,retryAt:ee.retryAt,retryAfterSeconds:E}),T.current===p&&(h(u),I.current=u,R(""))}else Q(g,"network_error"),c instanceof Se&&["openrouter_monthly_budget_exhausted","openrouter_unavailable","openrouter_byok_credential_invalid","openrouter_byok_billing_error","openrouter_byok_rate_limit"].includes(c.code??"")&&(Y=!0,x.current.onInterrupted(t));!W&&T.current===p&&ie({type:"error",message:c instanceof Error?c.message:"The assistant stream failed.",code:c instanceof Se?c.code:void 0})}}finally{if(_.current===g){if(H(g),!X&&!g.signal.aborted&&Q(g,"network_error"),v.current=!1,f(!1),W)x.current.onSettled(i.session_id);else if(!g.signal.aborted){(y&&P||Y)&&((Z=(ue=x.current).onProviderTerminal)==null||Z.call(ue));const c=K.current;if(m&&!y)T.current===p&&(h(m.snapshot),I.current=m.snapshot,R("Couldn’t resend this message. Your original conversation was restored."));else if(c){T.current===p&&m&&!m.first&&(N||!X)&&(h(m.snapshot),I.current=m.snapshot);try{const E=await se(c,p);E&&m&&!m.first&&E.some(ee=>ee.id===m.targetId)&&R("Couldn’t resend this message. Your original conversation was restored.")}catch{T.current===p&&D(E=>E.streaming?{...E,streaming:!1}:E)}}else T.current===p&&D(E=>E.streaming?{...E,streaming:!1}:E);x.current.onSettled(c)}((V=L.current)==null?void 0:V.controller)===g&&(L.current=null)}}})(),!0},fe=o.useCallback(t=>{const i=t.trim();if(!i||i.length>8e3||v.current||M.current)return!1;const a=I.current,u=[...a].reverse().find(Y=>Y.role==="user"),m=u!=null&&u.status&&u.status!=="complete"&&u.revision?{replace_message_id:u.id,prior_revision:u.revision}:null,p={id:A(),role:"user",text:i},g={id:A(),role:"assistant",streaming:!0,blocks:[]},y=m&&u?Ae(a,Y=>Y.id===u.id):-1,P=y<0?[...a,p,g]:[...a.slice(0,y),p,g];return oe(i,{message:i,session_id:x.current.sessionId,client_message_id:crypto.randomUUID(),...!x.current.sessionId&&x.current.initialModel?{initial_model:x.current.initialModel}:{},...m??{}},P,a)},[]),Ce=o.useCallback((t,i)=>{const a=i.trim();if(!a||a.length>8e3||v.current||M.current)return!1;const u=I.current.slice(),m=u.findIndex(N=>N.id===t&&N.role==="user");if(m<0)return!1;const p=u[m],g=u.findIndex(N=>N.role==="user"),y=m===g;if(!y&&(!x.current.sessionId||!p.revision))return!1;const P={id:p.id,role:"user",text:a,revision:y?void 0:p.revision+1,status:"generating"},Y={id:A(),role:"assistant",streaming:!0,blocks:[]},X=y?[P,Y]:[...u.slice(0,m),P,Y];return oe(a,{message:a,session_id:y?null:x.current.sessionId,client_message_id:crypto.randomUUID(),...y&&x.current.initialModel?{initial_model:x.current.initialModel}:{},...y?{}:{replace_message_id:p.id,prior_revision:p.revision}},X,u,{targetId:p.id,snapshot:u,first:y})},[]),ce=o.useCallback(()=>{M.current=null,C(null)},[]),Te=o.useCallback(()=>{const t=M.current;return!t||Date.now()<t.retryAt||v.current?!1:(M.current=null,C(null),oe(t.question,t.request,t.optimistic,t.original,t.edit))},[]),le=o.useCallback(()=>{var u;if(!_.current)return;const t=_.current;H(t),Q(t,"stopped"),t.abort(),_.current=null,((u=L.current)==null?void 0:u.controller)===t&&(L.current=null),v.current=!1,f(!1),h(m=>{const p=m.at(-1);if((p==null?void 0:p.role)!=="assistant")return m;const g=(p.blocks??[]).flatMap(y=>y.kind==="tool"&&y.status==="running"?[]:y.kind==="reasoning"&&y.active?[]:y.kind==="answer"?[{...y,done:!0}]:[y]);return[...m.slice(0,-1),{...p,blocks:g,streaming:!1,finishReason:"stopped"}]}),x.current.onInterrupted(we.current);const i=K.current;i&&At(i).catch(()=>{});const a=++T.current;window.setTimeout(()=>{i&&T.current===a?se(i,a).catch(()=>{}).finally(()=>x.current.onSettled(i)):i||x.current.onSettled(null)},450)},[]),Re=o.useCallback((t,i)=>h(a=>a.map(u=>{var m;return u.id!==t?u:{...u,blocks:(m=u.blocks)==null?void 0:m.map((p,g)=>g===i&&(p.kind==="reasoning"||p.kind==="tool")?{...p,open:!p.open}:p)}})),[]),me=o.useCallback(()=>{var t;T.current+=1,w.current!==null&&(window.clearTimeout(w.current),w.current=null),j.current="cleared",(t=_.current)==null||t.abort(),_.current=null,L.current=null,M.current=null,C(null),v.current=!1,K.current=null,h([]),f(!1),R("")},[]),J=o.useCallback(t=>{var i;T.current+=1,w.current!==null&&(window.clearTimeout(w.current),w.current=null),j.current="cleared",L.current=null,M.current=null,C(null),v.current||((i=_.current)==null||i.abort(),_.current=null),h(t),v.current||f(!1),R("")},[]);return{messages:d,busy:S,papers:$,sessionError:k,capacityRequest:F,send:fe,editAndResend:Ce,retryCapacity:Te,cancelCapacity:ce,stop:le,toggleBlock:Re,reset:me,load:J}}const ln="https://huggingface.co/settings/inference-providers",lt="pwc.chat.billing-notice-dismissed.v1",ut=({provider:l})=>{const[d,h]=o.useState(()=>localStorage.getItem(lt)==="1");return!ke()||d||l!=="huggingface"?null:n.jsxs("div",{className:"chat-billing-notice",role:"note",children:[n.jsx("span",{children:"Hugging Face models use the inference permission granted when you start chatting. Included monthly credits are used first, then extra usage requires purchased credits. You can choose organization billing in Settings."}),n.jsxs("div",{className:"chat-billing-notice-actions",children:[n.jsx("a",{href:"/settings",children:"Review billing"}),n.jsx("a",{href:ln,target:"_blank",rel:"noreferrer",children:"Review usage"}),n.jsx("button",{type:"button",className:"chat-billing-notice-dismiss","aria-label":"Dismiss billing notice",title:"Dismiss",onClick:()=>{localStorage.setItem(lt,"1"),h(!0)},children:n.jsx(Lt,{size:15,"aria-hidden":"true"})})]})]})},dt=({enabled:l,fallbackEnabled:d,byokExpected:h})=>{const S=Jt(l);if(!l||!S.data)return null;const f=S.data,k=Xt(f.resets_at);return n.jsxs("div",{className:"chat-openrouter-usage",role:"status",children:[n.jsxs("span",{children:[n.jsxs("strong",{children:[f.remaining_percent,"% left"]})," this month · resets ",k.local]}),(f.remaining_percent===0||h)&&n.jsx("span",{children:d?"Your OpenRouter account will be billed on this explicit send.":n.jsxs(n.Fragment,{children:[n.jsx("a",{href:"/settings#openrouter-byok",children:"Connect your own key in Settings"})," to continue."]})})]})},un=({retryAt:l,onRetry:d,onCancel:h})=>{const[S,f]=o.useState(()=>Math.max(0,Math.ceil((l-Date.now())/1e3))),k=o.useRef(null);return o.useEffect(()=>{var w;const R=document.activeElement instanceof HTMLElement?document.activeElement:null;(w=k.current)==null||w.focus();const v=()=>f(Math.max(0,Math.ceil((l-Date.now())/1e3)));v();const _=window.setInterval(v,250);return()=>{window.clearInterval(_),R==null||R.focus()}},[l]),n.jsx("div",{className:"chat-capacity-dialog-backdrop",role:"presentation",children:n.jsxs("div",{className:"chat-capacity-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-capacity-dialog-title","aria-describedby":"chat-capacity-dialog-description",onKeyDown:R=>{R.key==="Escape"&&(R.preventDefault(),h())},children:[n.jsx("h2",{id:"chat-capacity-dialog-title",children:"All research slots are currently in use"}),n.jsx("p",{id:"chat-capacity-dialog-description",children:"Your message was not sent or billed. Try again in a few seconds."}),n.jsx("p",{className:"chat-capacity-countdown","aria-live":"polite",children:S>0?`Try again available in ${S} second${S===1?"":"s"}.`:"You can try again now."}),n.jsxs("div",{className:"chat-capacity-dialog-actions",children:[n.jsx("button",{type:"button",className:"chat-capacity-cancel",ref:k,onClick:h,children:"Cancel"}),n.jsx("button",{type:"button",className:"chat-capacity-retry",disabled:S>0,onClick:d,children:"Try again"})]})]})})},xn=()=>{var We,Ve,Ge,Ke,$e,ze,Qe;const{sessionId:l}=xt(),d=St(),[h,S]=kt(),{user:f,isLoading:k}=Ot(),{toast:R}=Ct(),v=Tt(),[_,w]=o.useState([]),[j,L]=o.useState(!1),[M,F]=o.useState(""),[C,I]=o.useState(()=>l?{id:l,status:"loading"}:null),[x,we]=o.useState(0),re=o.useRef(Dt()),ve=o.useRef(h.get("model")||((We=re.current)==null?void 0:We.model)),[T,K]=o.useState(Pt),[B,$]=o.useState(ve.current||Mt),A=((Ve=T.find(e=>e.id===B))==null?void 0:Ve.provider)??"huggingface",D=jt(),_e=$t(!!(f&&A==="openrouter")),he=o.useRef(A);he.current=A;const[Oe,H]=o.useState(""),[z,U]=o.useState(""),[Q,ie]=o.useState(()=>{var e,r;return((e=h.get("q"))==null?void 0:e.trim())||((r=re.current)==null?void 0:r.prompt)||""}),se=o.useRef(!1),oe=o.useRef(!1),fe=o.useRef(!1),[Ce,ce]=o.useState(null),[Te,le]=o.useState(null),[Re,me]=o.useState(""),[J,t]=o.useState(null),[i,a]=o.useState(()=>typeof window>"u"||window.innerWidth>900),[u,m]=o.useState(!1),[p,g]=o.useState(!1),[y,P]=o.useState(""),Y=o.useRef(new Set),X=o.useRef(!1),N=o.useRef(l),W=o.useRef(null),ue=o.useRef(null),Z=o.useRef(null);N.current=l;const V=o.useCallback(async()=>{if(!f)return;const e=!X.current;e&&L(!0);try{const r=await Yt();w(s=>{const b=W.current,O=b?s.find(ye=>ye.id===b):void 0;if(!O)return r;const G=r.find(ye=>ye.id===b);return[G?{...G,title:O.title,is_busy:!0}:O,...r.filter(ye=>ye.id!==b)]}),X.current=!0,F("")}catch(r){F(r instanceof Error?r.message:"Could not load chats")}finally{e&&L(!1)}},[f]),c=cn({sessionId:l??null,initialModel:B,onSessionId:e=>{W.current=e;const r=e!==N.current,s=N.current===ue.current,b=new Date().toISOString();w(O=>O.some(G=>G.id===e)?O.map(G=>G.id===e?{...G,is_busy:!0}:G):[{id:e,title:"New chat",selected_model:B,created_at:b,updated_at:b,message_count:1,is_busy:!0},...O]),r&&s&&H("New chat"),s&&(Z.current=e,I({id:e,status:"loaded"}),r&&d(`/chat/${e}`,{replace:!0}))},onTitle:e=>{const r=W.current??N.current;r&&!Y.current.has(r)&&(r===N.current&&H(e),w(s=>s.map(b=>b.id===r?{...b,title:e}:b)))},onSettled:e=>{e&&w(r=>r.map(s=>s.id===e?{...s,is_busy:!1}:s)),W.current=null,ue.current=null,V()},onProviderTerminal:()=>{he.current==="openrouter"&&(v.invalidateQueries({queryKey:zt}),v.invalidateQueries({queryKey:Qt}))},onInterrupted:e=>{U(e)}});c.load;const E=c.send;o.useEffect(()=>{c.capacityRequest&&U(c.capacityRequest.question)},[c.capacityRequest]),o.useEffect(()=>{c.busy&&ce(null)},[c.busy]);const ee=o.useCallback(e=>{sessionStorage.setItem(Xe,e),sessionStorage.setItem(Ze,B),sessionStorage.setItem(et,"1"),window.location.href=Et("/chat",!0)},[B]),pe=o.useCallback(async e=>{if(!f){ee(e);return}if(A==="huggingface"&&!oe.current){if(fe.current)return;fe.current=!0;try{const s=await fetch(Pe("/api/v1/me/inference-billing"),{credentials:"include",cache:"no-store"});if(!s.ok)throw new Error("Could not check Hugging Face authorization.");if(!(await s.json()).connected){ee(e);return}oe.current=!0}catch(s){U(e),F(s instanceof Error?s.message:"Could not check Hugging Face authorization.");return}finally{fe.current=!1}}const r=N.current??null;E(e)&&(ue.current=r,W.current=r,Ft(),U(""))},[ee,A,E,f]);o.useEffect(()=>{if(k||!f)return;const e=sessionStorage.getItem(Ze);e&&$(e),V(),Ut().then(b=>{if(K(b.items),!N.current){const O=ve.current||e;$(O&&b.items.some(G=>G.id===O)?O:b.default_model)}});const r=sessionStorage.getItem(Xe),s=sessionStorage.getItem(et)==="1";r&&(s?ie(r):U(r))},[k,V,f]),o.useEffect(()=>{if(!l){Z.current!==null&&(Z.current=null,c.reset()),I(null);return}if(Z.current===l||(I(r=>(r==null?void 0:r.id)===l&&r.status==="loading"?r:{id:l,status:"loading"}),k||!f))return;let e=!1;return F(""),De(l).then(r=>{e||(c.load(ht(r)),$(r.selected_model),H(r.title),Z.current=l,I({id:l,status:"loaded"}))}).catch(r=>{if(e)return;const s=r instanceof Error?r.message:"Chat not found";c.reset(),F(s),I({id:l,status:"error",error:s})}),()=>{e=!0}},[k,l,f,c.busy,x]),o.useEffect(()=>{var b;const e=(b=h.get("q"))==null?void 0:b.trim();if(!e)return;se.current=!1;const r=h.get("model");r&&$(r),ie(e);const s=new URLSearchParams(h);s.delete("q"),s.delete("model"),S(s,{replace:!0})},[h,S]),o.useEffect(()=>{if(k||c.busy||!Q||se.current)return;const e=window.setTimeout(()=>{if(se.current)return;se.current=!0;const r=Q;ie(""),pe(r)},0);return()=>window.clearTimeout(e)},[k,c.busy,Q,pe]),o.useEffect(()=>{const e=()=>{!f||c.busy||V()};return window.addEventListener("focus",e),()=>window.removeEventListener("focus",e)},[c.busy,V,f]),o.useEffect(()=>{if(!J)return;const e=()=>t(null),r=s=>{s.key==="Escape"&&e()};return window.addEventListener("click",e),window.addEventListener("keydown",r),()=>{window.removeEventListener("click",e),window.removeEventListener("keydown",r)}},[J]);const Me=()=>{W.current=null,c.reset(),U(""),H(""),d("/chat")},Ye=async e=>{const r=Re.trim();if(r)try{const s=await rt(e,{title:r});Y.current.add(e),e===l&&H(s.title),w(b=>b.map(O=>O.id===e?s:O)),le(null)}catch(s){F(s instanceof Error?s.message:"Rename failed")}},pt=async e=>{const r=e===l&&c.busy;if(window.confirm(r?"Stop and delete this chat? This cannot be undone.":"Delete this chat? This cannot be undone.")){r&&c.stop();try{if(r){const s=Date.now()+3e3;for(;(await De(e)).is_busy;){if(Date.now()>=s)throw new Error("Generation is still stopping. The chat was not deleted.");await new Promise(O=>window.setTimeout(O,150))}}await Wt(e),e===l&&Me(),await V()}catch(s){F(s instanceof Error?s.message:"Delete failed")}}},gt=async()=>{var e;if(!p){g(!0);try{const r=await Gt();if(await V(),r.archived_count===0){R({title:"No chats were archived",description:"There are no inactive chats older than 30 days."});return}const s=((e=[...c.messages].reverse().find(b=>b.role==="user"))==null?void 0:e.text)??"";c.reset(),U(s),H(""),R({title:`${r.archived_count} ${r.archived_count===1?"chat":"chats"} archived`,description:"Your question is ready to send again."})}catch(r){R({variant:"destructive",title:"Could not archive old chats",description:r instanceof Error?r.message:"Try again."})}finally{g(!1)}}},Fe=async e=>{const r=B;if($(e),!!l)try{const s=await rt(l,{selected_model:e});w(b=>b.map(O=>O.id===l?{...O,selected_model:s.selected_model}:O)),F("")}catch(s){$(r),F(s instanceof Error?s.message:"Model change failed")}},yt=async()=>{var e;if(!(!l||c.busy||u)){m(!0);try{const r=await Vt(l),s=new URL(r.public_path,window.location.origin).toString();try{if(!((e=navigator.clipboard)!=null&&e.writeText))throw new Error("Clipboard unavailable");await navigator.clipboard.writeText(s),R({className:"chat-share-toast",duration:5e3,title:"Public link copied to your clipboard",description:"Anyone with this link can see this conversation."})}catch{P(s)}}catch(r){const s=r instanceof Error?r.message:"Could not share this conversation";F(s),R({variant:"destructive",title:"Share failed",description:s})}finally{m(!1)}}},[bt,wt]=o.useState(60);o.useLayoutEffect(()=>{const e=document.querySelector(".app-header");if(!e)return;const r=()=>wt(e.offsetHeight);r();const s=new ResizeObserver(r);return s.observe(e),()=>s.disconnect()},[]);const Ee=o.useRef(null),xe=o.useRef(null),ge=o.useRef(null);o.useEffect(()=>{c.busy||(ge.current=null)},[c.busy]);const vt=(e,r)=>{var s;xe.current=((s=Ee.current)==null?void 0:s.scrollTop)??null,c.toggleBlock(e,r)};o.useLayoutEffect(()=>{const e=Ee.current;if(e){if(xe.current!==null){e.scrollTop=xe.current,xe.current=null;return}if(ge.current){const r=Array.from(e.querySelectorAll("[data-message-id]")).find(s=>s.dataset.messageId===ge.current);if(r){const s=e.getBoundingClientRect(),b=r.getBoundingClientRect();e.scrollTop+=b.top-s.top-24;return}}e.scrollTop=e.scrollHeight}},[c.messages]);const de=_.find(e=>e.id===l),Ue=c.messages.filter(e=>e.role==="user"),je=(Ge=Ue[0])==null?void 0:Ge.id,_t=(Ke=Ue.at(-1))==null?void 0:Ke.id,Le=c.messages.length===0,qe=($e=[...c.messages].reverse().find(e=>e.role==="assistant"&&e.errorCode))==null?void 0:$e.errorCode,Be=qe==="openrouter_unavailable"||qe==="openrouter_monthly_budget_exhausted",Ne=(C==null?void 0:C.id)===l,Ie=!!(l&&(k||f&&(!Ne||(C==null?void 0:C.status)==="loading"))),He=Ne&&(C==null?void 0:C.status)==="error"?C.error:void 0;return n.jsxs("div",{className:"chat-page",style:{height:`calc(100dvh - ${bt}px)`},children:[n.jsxs("aside",{className:`chat-sidebar${i?"":" chat-sidebar-closed"}`,children:[n.jsxs("div",{className:"chat-sidebar-top",children:[n.jsxs("button",{type:"button",className:"chat-new-chat",onClick:Me,children:[n.jsx(qt,{})," New chat"]}),n.jsx("button",{type:"button",className:"icon-btn",onClick:()=>a(!1),title:"Collapse sidebar",children:n.jsx(tt,{})})]}),n.jsxs("nav",{className:"chat-sessions","aria-label":"Chat history",children:[j&&n.jsx("div",{className:"chat-sessions-empty",children:"Loading chats…"}),!j&&M&&n.jsx("div",{className:"chat-sessions-empty",children:M}),!j&&!M&&_.length===0&&n.jsx("div",{className:"chat-sessions-empty",children:"Conversations you start will show up here."}),Bt(_).map(e=>n.jsxs("div",{className:"chat-session-group",children:[n.jsx("div",{className:"chat-session-group-label",children:e.label}),e.items.map(r=>n.jsxs("div",{className:`chat-session${r.id===l?" chat-session-active":""}`,role:"button",tabIndex:0,onClick:()=>d(`/chat/${r.id}`),onKeyDown:s=>{if(s.key==="Enter"&&d(`/chat/${r.id}`),s.key==="F2"&&(le(r.id),me(r.title)),s.key==="ContextMenu"||s.shiftKey&&s.key==="F10"){s.preventDefault();const b=s.currentTarget.getBoundingClientRect();t({id:r.id,x:b.right-150,y:b.bottom})}},onContextMenu:s=>{s.preventDefault(),t({id:r.id,x:s.clientX,y:s.clientY})},children:[Te===r.id?n.jsx("input",{className:"chat-session-title-input",value:Re,autoFocus:!0,maxLength:80,onClick:s=>s.stopPropagation(),onChange:s=>me(s.target.value),onBlur:()=>void Ye(r.id),onKeyDown:s=>{s.stopPropagation(),s.key==="Enter"&&Ye(r.id),s.key==="Escape"&&le(null)}}):n.jsx("span",{className:"chat-session-title",children:r.title}),n.jsx("button",{type:"button",className:"chat-session-menu","aria-label":"Chat actions","aria-haspopup":"menu",title:"Chat actions",onClick:s=>{s.stopPropagation();const b=s.currentTarget.getBoundingClientRect();t({id:r.id,x:b.right-150,y:b.bottom})},children:"⋯"}),n.jsx("button",{type:"button",className:"chat-session-delete","aria-label":"Delete conversation",onClick:s=>{s.stopPropagation(),pt(r.id)},children:n.jsx(Ht,{})})]},r.id))]},e.label))]}),J&&n.jsx("div",{className:"chat-session-context-menu",role:"menu",style:{left:J.x,top:J.y},onClick:e=>e.stopPropagation(),children:n.jsx("button",{type:"button",role:"menuitem",autoFocus:!0,onClick:()=>{const e=_.find(r=>r.id===J.id);e&&(le(e.id),me(e.title)),t(null)},children:"Rename chat"})})]}),n.jsxs("section",{className:"chat-main",children:[n.jsxs("div",{className:"chat-topbar",children:[!i&&n.jsx("button",{type:"button",className:"icon-btn",onClick:()=>a(!0),title:"Open sidebar",children:n.jsx(tt,{})}),n.jsx("span",{className:"chat-topbar-title",children:Ie?(de==null?void 0:de.title)||"":Oe||(de==null?void 0:de.title)||(Le?"":"New chat")}),D&&n.jsx("span",{className:"chat-staging-badge",children:"Staging"}),l&&Ne&&(C==null?void 0:C.status)==="loaded"&&!Le&&n.jsxs("button",{type:"button",className:"chat-share-button",onClick:()=>void yt(),disabled:c.busy||u||Ie,"aria-label":"Share conversation",children:[u?n.jsx(nt,{}):n.jsx(Zt,{"aria-hidden":"true"}),n.jsx("span",{children:"Share"})]})]}),Ie?n.jsxs("div",{className:"chat-session-loading",role:"status","aria-live":"polite",children:[n.jsx(nt,{}),n.jsx("span",{children:"Loading conversation…"})]}):He?n.jsxs("div",{className:"chat-session-load-error",role:"alert",children:[n.jsx("p",{children:He}),n.jsx("button",{type:"button",onClick:()=>{I({id:l,status:"loading"}),we(e=>e+1)},children:"Try again"})]}):Le?n.jsx("div",{className:"chat-empty",children:n.jsxs("div",{className:"chat-empty-inner",children:[n.jsx("div",{className:"chat-empty-eyebrow",children:"AI research assistant · Staging preview"}),n.jsxs("h1",{className:"chat-empty-title",children:["Ask ",n.jsx("em",{children:"Papers With Code"})]}),n.jsx("p",{className:"chat-empty-sub",children:"Answers are grounded in a live hybrid search over papers, tasks, and benchmarks — with citations you can follow."}),D&&n.jsx("p",{className:"chat-staging-access-note",children:"This is a limited staging preview. Only approved Hugging Face users can start chats."}),n.jsx(ut,{provider:A}),n.jsx(dt,{enabled:A==="openrouter",fallbackEnabled:!!((ze=_e.data)!=null&&ze.fallback_enabled),byokExpected:Be}),n.jsx(Je,{onSend:pe,busy:c.busy,onStop:c.stop,autoFocus:!0,draft:z,onDraftChange:U,models:T,selectedModel:B,onModelChange:e=>void Fe(e)}),n.jsx("div",{className:"chat-examples",children:Kt.map(e=>n.jsx("button",{type:"button",className:"chat-example",onClick:()=>pe(e),children:e},e))})]})}):n.jsxs(n.Fragment,{children:[c.sessionError&&n.jsx("div",{className:"chat-session-error",role:"alert",children:c.sessionError}),n.jsx("div",{className:"chat-conversation",ref:Ee,children:n.jsx("div",{className:"chat-conversation-inner",children:c.messages.map(e=>e.role==="user"?n.jsx(Nt,{id:e.id,text:e.text??"",isInitial:e.id===je,editingAllowed:!c.busy&&!!e.revision,editing:Ce===e.id,editNotice:e.id===je?"Sending will start a new chat.":e.id===_t?"Sending will replace the response.":"Sending will replace the response and all messages after it.",onEdit:()=>ce(e.id),onCancel:()=>ce(null),onResend:r=>{e.id!==je&&(ge.current=e.id);const s=c.editAndResend(e.id,r);return s?ce(null):ge.current=null,s}},e.id):n.jsx(It,{msg:e,papers:c.papers,onToggleBlock:vt,onArchiveOldChats:()=>void gt(),archivePending:p},e.id))})}),n.jsx("div",{className:"chat-composer-wrap",children:n.jsxs("div",{className:"chat-composer-inner",children:[n.jsx(ut,{provider:A}),n.jsx(dt,{enabled:A==="openrouter",fallbackEnabled:!!((Qe=_e.data)!=null&&Qe.fallback_enabled),byokExpected:Be}),n.jsx(Je,{onSend:pe,busy:c.busy,onStop:c.stop,placeholder:z?"Edit and send again…":"Ask a follow-up…",draft:z,onDraftChange:U,models:T,selectedModel:B,onModelChange:e=>void Fe(e)}),n.jsx("div",{className:"chat-composer-foot",children:ke()?n.jsxs(n.Fragment,{children:[A==="openrouter"?n.jsxs("span",{className:"chat-provider-attribution",children:["Powered by ",n.jsx("a",{href:"https://openrouter.ai",target:"_blank",rel:"noreferrer",children:"OpenRouter"}),"."]}):n.jsxs("span",{className:"chat-provider-attribution",children:["Powered by 🤗 ",n.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"}),"."]}),n.jsx("span",{children:"The AI assistant can make mistakes. Double-check responses."})]}):n.jsx(n.Fragment,{children:"Assistant preview — responses are simulated."})})]})})]})]}),y&&n.jsx("div",{className:"chat-share-dialog-backdrop",role:"presentation",onMouseDown:()=>P(""),children:n.jsxs("div",{className:"chat-share-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-share-dialog-title",onMouseDown:e=>e.stopPropagation(),children:[n.jsx("h2",{id:"chat-share-dialog-title",children:"Public link created"}),n.jsx("p",{children:"It could not be copied automatically. Copy this link manually:"}),n.jsx("input",{readOnly:!0,value:y,"aria-label":"Public conversation link",autoFocus:!0,onFocus:e=>e.currentTarget.select()}),n.jsx("button",{type:"button",onClick:()=>P(""),children:"Close"})]})}),c.capacityRequest&&n.jsx(un,{retryAt:c.capacityRequest.retryAt,onCancel:c.cancelCapacity,onRetry:()=>{c.retryCapacity()&&U("")}})]})};export{un as ChatCapacityDialog,xn as default};
assets/{ConferenceDetailView-DmzUAFNN.js → ConferenceDetailView-CY-7Wl7R.js} RENAMED
@@ -1 +1 @@
1
- import{e as L,r as D,j as e,L as p,b as C}from"./index-CIXevVP9.js";import{u as T}from"./useQuery-BHSsBDmJ.js";import{M as F}from"./MarkdownText-DgCJo7yQ.js";import{e as B,h as A,d as E}from"./transform-CNyzjv1G.js";import{S as f}from"./skeleton-BQDYAJTf.js";import{A as P,a as z}from"./alert-axJAQJuC.js";import"./useBaseQuery-BL30DOiU.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-C7g07Bf-.js";import"./index-CDHG1Gvn.js";import"./hover-card-B7gdr0Iw.js";const M=a=>(a==null?void 0:a.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",R=(a,t)=>{if(!a)return null;const i=new Date(`${a}T00:00:00`),s=t?new Date(`${t}T00:00:00`):null,c=g=>g.toLocaleDateString("en-US",{month:"long",day:"numeric"}),m=i.getFullYear();return s&&s.getTime()!==i.getTime()?i.getMonth()===s.getMonth()?`${c(i).replace(/\d+$/,"").trim()} ${i.getDate()}–${s.getDate()}, ${m}`:`${c(i)} – ${c(s)}, ${m}`:`${c(i)}, ${m}`},J=()=>{var k,b,S,_,$,w;const{confSlug:a}=L(),t=T({queryKey:["conference-areas-with-tasks",a],queryFn:()=>C.getConferenceAreasWithTasks(a),enabled:!!a,staleTime:10*60*1e3}),i=D.useMemo(()=>{if(!t.data)return[];const r={general:0,vision:1,video:2,language:3,audio:4,other:5},n=o=>r[M(o)]??999;return[...t.data.results].sort((o,l)=>{const d=n(o.name),x=n(l.name);return d!==x?d-x:o.name.localeCompare(l.name)})},[t.data]),s=(k=t.data)==null?void 0:k.conference,c=((b=t.data)==null?void 0:b.total_paper_count)??0,m=((S=t.data)==null?void 0:S.oral_paper_count)??0,g=((_=t.data)==null?void 0:_.spotlight_paper_count)??0,u=(($=t.data)==null?void 0:$.outstanding_paper_count)??0,j=((w=t.data)==null?void 0:w.best_paper_finalist_paper_count)??0,v=i.reduce((r,n)=>r+n.tasks.length,0);if(t.error)return e.jsx("div",{className:"page",children:e.jsx(P,{variant:"destructive",children:e.jsx(z,{children:"Failed to load conference. Please try again."})})});const y=s?R(s.start_date,s.end_date):null,N=s?[s.venue,s.location].filter(Boolean).join(", "):null,h=s==null?void 0:s.name;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:s!=null&&s.image_url?"task-hero-grid":void 0,children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:"CONFERENCE"}),e.jsx("h1",{className:"feed-title",children:h??e.jsx(f,{className:"h-10 w-64 inline-block"})}),e.jsxs("div",{className:"feed-subtitle",style:{display:"flex",flexDirection:"column",gap:4},children:[y&&e.jsx("span",{children:y}),N&&e.jsx("span",{children:N}),(s==null?void 0:s.url)&&e.jsx("a",{href:s.url,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-text)"},children:s.url.replace(/^https?:\/\//,"")}),(s==null?void 0:s.hf_url)&&e.jsxs("a",{className:"bm-action-btn",href:s.hf_url,target:"_blank",rel:"noopener noreferrer",style:{alignSelf:"flex-start",marginTop:4},children:[e.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),(s==null?void 0:s.description)&&e.jsx(F,{className:"method-description",text:s.description})]}),(s==null?void 0:s.image_url)&&e.jsxs("figure",{className:"task-figure-card",children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:s.image_url,alt:h?`${h} visual`:"Conference visual",onError:r=>{var n,o;(o=(n=r.currentTarget.parentElement)==null?void 0:n.parentElement)==null||o.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",h??"Conference",s.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(F,{className:"task-image-credit",text:s.image_credit})]})]})]})]}),!t.isLoading&&c>0&&e.jsxs("section",{style:{marginTop:48,marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:"Browse papers"}),e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:"All accepted papers, plus oral, spotlight, outstanding, and best paper finalists."})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[c.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[e.jsxs(p,{to:`/conferences/${a}/all`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"var(--accent)"}}),"All papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[c.toLocaleString()," papers"]})})]}),m>0&&e.jsxs(p,{to:`/conferences/${a}/oral`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#fdbb02"}}),"Oral papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[m.toLocaleString()," papers"]})})]}),g>0&&e.jsxs(p,{to:`/conferences/${a}/spotlight`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#fdbb02"}}),"Spotlight papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[g.toLocaleString()," papers"]})})]}),u>0&&e.jsxs(p,{to:`/conferences/${a}/outstanding`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#c45c26"}}),"Outstanding papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[u.toLocaleString()," papers"]})})]}),j>0&&e.jsxs(p,{to:`/conferences/${a}/best-paper-finalists`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#c9a227"}}),"Best paper finalists"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[j.toLocaleString()," papers"]})})]})]})]}),t.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((r,n)=>e.jsxs("div",{children:[e.jsx(f,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((o,l)=>e.jsx(f,{className:"h-24"},l))})]},n))}):i.map(r=>{const n=r.tasks;if(n.length===0)return null;const o=n.reduce((l,d)=>l+(d.paper_count||0),0);return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:r.name}),r.description&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:r.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[n.length," ",n.length===1?"task":"tasks"," · ",o.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:n.map(l=>{const d=l.slug||"",x=B(A(d));return e.jsxs(p,{to:`/conferences/${a}/${d}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:x.dot}}),E(l.name,d)]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(l.paper_count??0).toLocaleString()," papers"]})})]},l.id)})})]},r.id)}),v>0&&e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[v," tasks across ",i.filter(r=>r.tasks.length>0).length," areas."]})]})};export{J as default};
 
1
+ import{e as L,r as D,j as e,L as p,b as C}from"./index-Bo5_2OqZ.js";import{u as T}from"./useQuery-Bh9FZQpL.js";import{M as F}from"./MarkdownText-VH1HEGnz.js";import{e as B,h as A,d as E}from"./transform-2Gnjg1jt.js";import{S as f}from"./skeleton-CB-heJjl.js";import{A as P,a as z}from"./alert-_EYQlDHA.js";import"./useBaseQuery-B8T7kRNC.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-DTmodbgi.js";import"./index-C-0CcYmz.js";import"./hover-card-DrtqDSb0.js";const M=a=>(a==null?void 0:a.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",R=(a,t)=>{if(!a)return null;const i=new Date(`${a}T00:00:00`),s=t?new Date(`${t}T00:00:00`):null,c=g=>g.toLocaleDateString("en-US",{month:"long",day:"numeric"}),m=i.getFullYear();return s&&s.getTime()!==i.getTime()?i.getMonth()===s.getMonth()?`${c(i).replace(/\d+$/,"").trim()} ${i.getDate()}–${s.getDate()}, ${m}`:`${c(i)} – ${c(s)}, ${m}`:`${c(i)}, ${m}`},J=()=>{var k,b,S,_,$,w;const{confSlug:a}=L(),t=T({queryKey:["conference-areas-with-tasks",a],queryFn:()=>C.getConferenceAreasWithTasks(a),enabled:!!a,staleTime:10*60*1e3}),i=D.useMemo(()=>{if(!t.data)return[];const r={general:0,vision:1,video:2,language:3,audio:4,other:5},n=o=>r[M(o)]??999;return[...t.data.results].sort((o,l)=>{const d=n(o.name),x=n(l.name);return d!==x?d-x:o.name.localeCompare(l.name)})},[t.data]),s=(k=t.data)==null?void 0:k.conference,c=((b=t.data)==null?void 0:b.total_paper_count)??0,m=((S=t.data)==null?void 0:S.oral_paper_count)??0,g=((_=t.data)==null?void 0:_.spotlight_paper_count)??0,u=(($=t.data)==null?void 0:$.outstanding_paper_count)??0,j=((w=t.data)==null?void 0:w.best_paper_finalist_paper_count)??0,v=i.reduce((r,n)=>r+n.tasks.length,0);if(t.error)return e.jsx("div",{className:"page",children:e.jsx(P,{variant:"destructive",children:e.jsx(z,{children:"Failed to load conference. Please try again."})})});const y=s?R(s.start_date,s.end_date):null,N=s?[s.venue,s.location].filter(Boolean).join(", "):null,h=s==null?void 0:s.name;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:s!=null&&s.image_url?"task-hero-grid":void 0,children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:"CONFERENCE"}),e.jsx("h1",{className:"feed-title",children:h??e.jsx(f,{className:"h-10 w-64 inline-block"})}),e.jsxs("div",{className:"feed-subtitle",style:{display:"flex",flexDirection:"column",gap:4},children:[y&&e.jsx("span",{children:y}),N&&e.jsx("span",{children:N}),(s==null?void 0:s.url)&&e.jsx("a",{href:s.url,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-text)"},children:s.url.replace(/^https?:\/\//,"")}),(s==null?void 0:s.hf_url)&&e.jsxs("a",{className:"bm-action-btn",href:s.hf_url,target:"_blank",rel:"noopener noreferrer",style:{alignSelf:"flex-start",marginTop:4},children:[e.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),(s==null?void 0:s.description)&&e.jsx(F,{className:"method-description",text:s.description})]}),(s==null?void 0:s.image_url)&&e.jsxs("figure",{className:"task-figure-card",children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:s.image_url,alt:h?`${h} visual`:"Conference visual",onError:r=>{var n,o;(o=(n=r.currentTarget.parentElement)==null?void 0:n.parentElement)==null||o.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",h??"Conference",s.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(F,{className:"task-image-credit",text:s.image_credit})]})]})]})]}),!t.isLoading&&c>0&&e.jsxs("section",{style:{marginTop:48,marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:"Browse papers"}),e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:"All accepted papers, plus oral, spotlight, outstanding, and best paper finalists."})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[c.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[e.jsxs(p,{to:`/conferences/${a}/all`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"var(--accent)"}}),"All papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[c.toLocaleString()," papers"]})})]}),m>0&&e.jsxs(p,{to:`/conferences/${a}/oral`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#fdbb02"}}),"Oral papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[m.toLocaleString()," papers"]})})]}),g>0&&e.jsxs(p,{to:`/conferences/${a}/spotlight`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#fdbb02"}}),"Spotlight papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[g.toLocaleString()," papers"]})})]}),u>0&&e.jsxs(p,{to:`/conferences/${a}/outstanding`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#c45c26"}}),"Outstanding papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[u.toLocaleString()," papers"]})})]}),j>0&&e.jsxs(p,{to:`/conferences/${a}/best-paper-finalists`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#c9a227"}}),"Best paper finalists"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[j.toLocaleString()," papers"]})})]})]})]}),t.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((r,n)=>e.jsxs("div",{children:[e.jsx(f,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((o,l)=>e.jsx(f,{className:"h-24"},l))})]},n))}):i.map(r=>{const n=r.tasks;if(n.length===0)return null;const o=n.reduce((l,d)=>l+(d.paper_count||0),0);return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:r.name}),r.description&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:r.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[n.length," ",n.length===1?"task":"tasks"," · ",o.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:n.map(l=>{const d=l.slug||"",x=B(A(d));return e.jsxs(p,{to:`/conferences/${a}/${d}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:x.dot}}),E(l.name,d)]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(l.paper_count??0).toLocaleString()," papers"]})})]},l.id)})})]},r.id)}),v>0&&e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[v," tasks across ",i.filter(r=>r.tasks.length>0).length," areas."]})]})};export{J as default};
assets/{ConferenceTaskView-CdiQqMLj.js → ConferenceTaskView--e571ntQ.js} RENAMED
@@ -1 +1 @@
1
- import{e as $,a as D,r as f,j as e,L as b,R as W,b as M}from"./index-CIXevVP9.js";import{u as z}from"./useQuery-BHSsBDmJ.js";import{P as G}from"./components-BkZsumbI.js";import{P as J}from"./PaperFeedFilters-CNYrJoVb.js";import{M as h}from"./MarkdownText-DgCJo7yQ.js";import{t as X,d as Y}from"./transform-CNyzjv1G.js";import{c as Z}from"./usePapers-B99b4fBf.js";import{u as ee}from"./useIntersectionObserver-BMoidOlM.js";import{S as se}from"./skeleton-BQDYAJTf.js";import{A as ae,a as te}from"./alert-axJAQJuC.js";import"./useBaseQuery-BL30DOiU.js";import"./LatexTitle-BmUg2c3G.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-C7g07Bf-.js";import"./index-CDHG1Gvn.js";import"./hover-card-B7gdr0Iw.js";import"./useInfiniteQuery-DWMGlrsa.js";const re=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ne=a=>a==="trending"||a==="date_published"||a==="citation_count"?a:"trending",be=()=>{var F,A,L,O,T,B;const{confSlug:a,taskSlug:n}=$(),[c,j]=D(),y=ne(c.get("order_by")),S=c.get("has_code")==="true",w=c.get("has_hf_artifacts")==="true",I=t=>{const s=new URLSearchParams(c);s.set("order_by",t),j(s)},q=t=>{const s=new URLSearchParams(c);t?s.set("has_code","true"):s.delete("has_code"),j(s)},Q=t=>{const s=new URLSearchParams(c);t?s.set("has_hf_artifacts","true"):s.delete("has_hf_artifacts"),j(s)},k=n==="all",P=n==="oral",N=n==="spotlight",l=n==="outstanding",d=n==="best-paper-finalists",u=l||d,p=k||P||N||l||d,K=p?void 0:n,U=P?"oral":N?"spotlight":l?"outstanding":d?"best_paper_finalist":void 0,m=z({queryKey:["conference",a],queryFn:()=>M.getConference(a),enabled:!!a,staleTime:10*60*1e3}),x=z({queryKey:["task",n],queryFn:()=>M.getTask(n),enabled:!!n&&!p,staleTime:10*60*1e3}),i=Z({conferenceSlug:a||"",taskSlug:K,presentation:U,page_size:12,order_by:y,order_dir:"desc",include_resources:!0,has_code:S,has_hf_artifacts:w,enabled:!!a}),{targetRef:V,isIntersecting:C}=ee({rootMargin:"200px"});f.useEffect(()=>{C&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[C,i.hasNextPage,i.isFetchingNextPage]),f.useEffect(()=>{window.scrollTo(0,0)},[a,n]);const _=f.useMemo(()=>{var s;return(((s=i.data)==null?void 0:s.pages)??[]).flatMap(o=>o.results)},[i.data]),v=f.useMemo(()=>_.map(X),[_]),g=k?"All papers":P?"Oral papers":N?"Spotlight papers":l?"Outstanding papers":d?"Best paper finalists":Y(((F=x.data)==null?void 0:F.name)||n||"",((A=x.data)==null?void 0:A.slug)||n),R=((O=(L=i.data)==null?void 0:L.pages[0])==null?void 0:O.count)??((T=m.data)==null?void 0:T.paper_count)??0,r=x.data;return m.error||x.error||i.error?e.jsx("div",{className:"page",children:e.jsx(ae,{variant:"destructive",children:e.jsx(te,{children:"Failed to load conference papers. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(b,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(b,{to:"/conferences",children:"Conferences"}),e.jsx("span",{children:" / "}),e.jsx(b,{to:`/conferences/${a}`,children:((B=m.data)==null?void 0:B.name)??a}),e.jsx("span",{children:" / "}),e.jsx("span",{children:g})]}),e.jsxs("div",{className:!p&&(r!=null&&r.image_url)?"task-hero-grid":void 0,style:{marginTop:16,marginBottom:28},children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:p?"BROWSE PAPERS":"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:g}),l&&a==="iclr-2026"&&e.jsx(h,{className:"task-explainer",text:"ICLR 2026 recognized two Outstanding Papers and one Honorable Mention. [Read the announcement](https://blog.iclr.cc/2026/04/23/announcing-the-iclr-2026-outstanding-papers/)."}),l&&a==="icml-2026"&&e.jsx(h,{className:"task-explainer",text:"ICML 2026 recognized two Outstanding Papers and five Honorable Mentions. [Read the announcement](https://blog.icml.cc/2026/07/05/announcing-the-icml-2026-awards/)."}),d&&a==="cvpr-2026"&&e.jsx(h,{className:"task-explainer",text:"CVPR 2026 recognized fifteen Best Paper Award finalists, including the winners. [Read the announcement](https://x.com/CVPR/status/2062912519522717978)."}),!p&&(r==null?void 0:r.description)&&e.jsx(h,{className:"task-explainer",text:r.description}),m.data&&e.jsxs("div",{className:"task-quickstats",style:{marginTop:12},children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:R.toLocaleString()}),"PAPERS"]}),e.jsx("span",{children:m.data.name})]})]}),!p&&(r==null?void 0:r.image_url)&&e.jsxs("figure",{className:"task-figure-card",children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:r.image_url,alt:`${g} schematic`,onError:t=>{var s,o;(o=(s=t.currentTarget.parentElement)==null?void 0:s.parentElement)==null||o.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",g,r.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(h,{className:"task-image-credit",text:r.image_credit})]})]})]})]}),e.jsxs("div",{className:"task-section-head",children:[e.jsx("div",{className:"task-section-eyebrow",children:u?"Award papers":"Conference papers · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",R.toLocaleString(),"]"]})]})]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[!u&&e.jsx("div",{className:"sort-options",children:re.map(([t,s])=>e.jsx("button",{className:`sort-btn ${y===t?"active":""}`,onClick:()=>I(t),children:s},t))}),e.jsx(J,{hasCode:S,hasHfArtifacts:w,onHasCodeChange:q,onHasHfArtifactsChange:Q,showDivider:!u})]}),!u&&e.jsxs("div",{className:"results-count",children:[v.length," loaded in ",e.jsx("span",{children:g})]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((t,s)=>e.jsx(se,{className:"h-40 w-full"},s))}):v.length===0?e.jsx("div",{className:"no-results",children:"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:v.map((t,s)=>{var E;const o=(E=_[s])==null?void 0:E.conference_award,H=o==="outstanding"?"Outstanding Paper":o==="honorable_mention"?"Honorable Mention":o==="best_paper_finalist"&&!d?"Best Paper Finalist":null;return e.jsxs(W.Fragment,{children:[H&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.08em",marginBottom:8},children:H}),e.jsx(G,{paper:t,rank:s+1})]},t.id)})}),e.jsx("div",{ref:V,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{be as default};
 
1
+ import{e as $,a as D,r as f,j as e,L as b,R as W,b as M}from"./index-Bo5_2OqZ.js";import{u as z}from"./useQuery-Bh9FZQpL.js";import{P as G}from"./components-BbXgE2lV.js";import{P as J}from"./PaperFeedFilters-D2TbUu0j.js";import{M as h}from"./MarkdownText-VH1HEGnz.js";import{t as X,d as Y}from"./transform-2Gnjg1jt.js";import{c as Z}from"./usePapers-CdB1OuZ5.js";import{u as ee}from"./useIntersectionObserver-7HCpY83L.js";import{S as se}from"./skeleton-CB-heJjl.js";import{A as ae,a as te}from"./alert-_EYQlDHA.js";import"./useBaseQuery-B8T7kRNC.js";import"./LatexTitle-qoY4vrTZ.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-DTmodbgi.js";import"./index-C-0CcYmz.js";import"./hover-card-DrtqDSb0.js";import"./useInfiniteQuery-CzzYUeDW.js";const re=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ne=a=>a==="trending"||a==="date_published"||a==="citation_count"?a:"trending",be=()=>{var F,A,L,O,T,B;const{confSlug:a,taskSlug:n}=$(),[c,j]=D(),y=ne(c.get("order_by")),S=c.get("has_code")==="true",w=c.get("has_hf_artifacts")==="true",I=t=>{const s=new URLSearchParams(c);s.set("order_by",t),j(s)},q=t=>{const s=new URLSearchParams(c);t?s.set("has_code","true"):s.delete("has_code"),j(s)},Q=t=>{const s=new URLSearchParams(c);t?s.set("has_hf_artifacts","true"):s.delete("has_hf_artifacts"),j(s)},k=n==="all",P=n==="oral",N=n==="spotlight",l=n==="outstanding",d=n==="best-paper-finalists",u=l||d,p=k||P||N||l||d,K=p?void 0:n,U=P?"oral":N?"spotlight":l?"outstanding":d?"best_paper_finalist":void 0,m=z({queryKey:["conference",a],queryFn:()=>M.getConference(a),enabled:!!a,staleTime:10*60*1e3}),x=z({queryKey:["task",n],queryFn:()=>M.getTask(n),enabled:!!n&&!p,staleTime:10*60*1e3}),i=Z({conferenceSlug:a||"",taskSlug:K,presentation:U,page_size:12,order_by:y,order_dir:"desc",include_resources:!0,has_code:S,has_hf_artifacts:w,enabled:!!a}),{targetRef:V,isIntersecting:C}=ee({rootMargin:"200px"});f.useEffect(()=>{C&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[C,i.hasNextPage,i.isFetchingNextPage]),f.useEffect(()=>{window.scrollTo(0,0)},[a,n]);const _=f.useMemo(()=>{var s;return(((s=i.data)==null?void 0:s.pages)??[]).flatMap(o=>o.results)},[i.data]),v=f.useMemo(()=>_.map(X),[_]),g=k?"All papers":P?"Oral papers":N?"Spotlight papers":l?"Outstanding papers":d?"Best paper finalists":Y(((F=x.data)==null?void 0:F.name)||n||"",((A=x.data)==null?void 0:A.slug)||n),R=((O=(L=i.data)==null?void 0:L.pages[0])==null?void 0:O.count)??((T=m.data)==null?void 0:T.paper_count)??0,r=x.data;return m.error||x.error||i.error?e.jsx("div",{className:"page",children:e.jsx(ae,{variant:"destructive",children:e.jsx(te,{children:"Failed to load conference papers. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(b,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(b,{to:"/conferences",children:"Conferences"}),e.jsx("span",{children:" / "}),e.jsx(b,{to:`/conferences/${a}`,children:((B=m.data)==null?void 0:B.name)??a}),e.jsx("span",{children:" / "}),e.jsx("span",{children:g})]}),e.jsxs("div",{className:!p&&(r!=null&&r.image_url)?"task-hero-grid":void 0,style:{marginTop:16,marginBottom:28},children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:p?"BROWSE PAPERS":"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:g}),l&&a==="iclr-2026"&&e.jsx(h,{className:"task-explainer",text:"ICLR 2026 recognized two Outstanding Papers and one Honorable Mention. [Read the announcement](https://blog.iclr.cc/2026/04/23/announcing-the-iclr-2026-outstanding-papers/)."}),l&&a==="icml-2026"&&e.jsx(h,{className:"task-explainer",text:"ICML 2026 recognized two Outstanding Papers and five Honorable Mentions. [Read the announcement](https://blog.icml.cc/2026/07/05/announcing-the-icml-2026-awards/)."}),d&&a==="cvpr-2026"&&e.jsx(h,{className:"task-explainer",text:"CVPR 2026 recognized fifteen Best Paper Award finalists, including the winners. [Read the announcement](https://x.com/CVPR/status/2062912519522717978)."}),!p&&(r==null?void 0:r.description)&&e.jsx(h,{className:"task-explainer",text:r.description}),m.data&&e.jsxs("div",{className:"task-quickstats",style:{marginTop:12},children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:R.toLocaleString()}),"PAPERS"]}),e.jsx("span",{children:m.data.name})]})]}),!p&&(r==null?void 0:r.image_url)&&e.jsxs("figure",{className:"task-figure-card",children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:r.image_url,alt:`${g} schematic`,onError:t=>{var s,o;(o=(s=t.currentTarget.parentElement)==null?void 0:s.parentElement)==null||o.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",g,r.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(h,{className:"task-image-credit",text:r.image_credit})]})]})]})]}),e.jsxs("div",{className:"task-section-head",children:[e.jsx("div",{className:"task-section-eyebrow",children:u?"Award papers":"Conference papers · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",R.toLocaleString(),"]"]})]})]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[!u&&e.jsx("div",{className:"sort-options",children:re.map(([t,s])=>e.jsx("button",{className:`sort-btn ${y===t?"active":""}`,onClick:()=>I(t),children:s},t))}),e.jsx(J,{hasCode:S,hasHfArtifacts:w,onHasCodeChange:q,onHasHfArtifactsChange:Q,showDivider:!u})]}),!u&&e.jsxs("div",{className:"results-count",children:[v.length," loaded in ",e.jsx("span",{children:g})]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((t,s)=>e.jsx(se,{className:"h-40 w-full"},s))}):v.length===0?e.jsx("div",{className:"no-results",children:"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:v.map((t,s)=>{var E;const o=(E=_[s])==null?void 0:E.conference_award,H=o==="outstanding"?"Outstanding Paper":o==="honorable_mention"?"Honorable Mention":o==="best_paper_finalist"&&!d?"Best Paper Finalist":null;return e.jsxs(W.Fragment,{children:[H&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.08em",marginBottom:8},children:H}),e.jsx(G,{paper:t,rank:s+1})]},t.id)})}),e.jsx("div",{ref:V,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{be as default};
assets/{ConferencesIndexView-ClvDxxNA.js → ConferencesIndexView-DE7AvizF.js} RENAMED
@@ -1 +1 @@
1
- import{r as p,j as e,L as d,b as u}from"./index-CIXevVP9.js";import{u as h}from"./useQuery-BHSsBDmJ.js";import{S as m}from"./skeleton-BQDYAJTf.js";import{A as f,a as g}from"./alert-axJAQJuC.js";import{T as x}from"./TaxonomySuggestionTile-B7IEL_hW.js";import"./useBaseQuery-BL30DOiU.js";import"./SignInToEditDialog-BJmkw1tr.js";import"./button-5O6wnTvY.js";import"./textarea-CcQVD6R-.js";import"./dialog-CA9NpDaA.js";import"./useMutation-CDeysSx_.js";import"./loader-circle-k9WscwaT.js";const j=(r,n)=>{if(!r)return null;const t=new Date(`${r}T00:00:00`),a=n?new Date(`${n}T00:00:00`):null,s=l=>l.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=t.getFullYear();return a&&a.getTime()!==t.getTime()?t.getMonth()===a.getMonth()?`${s(t).replace(/\d+$/,"").trim()} ${t.getDate()}–${a.getDate()}, ${i}`:`${s(t)} – ${s(a)}, ${i}`:`${s(t)}, ${i}`},v=r=>{var t;if(r.year!=null)return r.year;if(r.start_date)return Number(r.start_date.slice(0,4));const n=(t=r.slug.match(/-(\d{4})$/))==null?void 0:t[1];return n?Number(n):0},y=(r,n)=>{if(r.start_date&&n.start_date){const t=r.start_date.localeCompare(n.start_date);if(t!==0)return t}else{if(r.start_date)return-1;if(n.start_date)return 1}return r.name.localeCompare(n.name)},N={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},F=()=>{const r=h({queryKey:["conferences"],queryFn:()=>u.getConferences(),staleTime:6e5}),n=p.useMemo(()=>{var a;if(!((a=r.data)!=null&&a.results))return null;const t={};return r.data.results.forEach(s=>{const i=v(s);(t[i]||(t[i]=[])).push(s)}),Object.values(t).forEach(s=>s.sort(y)),Object.keys(t).map(Number).sort((s,i)=>i-s).map(s=>({year:s,conferences:t[s]}))},[r.data]);return r.error?e.jsx("div",{className:"page",children:e.jsx(f,{variant:"destructive",children:e.jsx(g,{children:"Failed to load conferences. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Conferences"})]}),e.jsx("div",{className:"feed-subtitle",children:"Browse accepted papers from major AI conferences, grouped by research area and task."}),e.jsxs("div",{className:"conference-deadlines-link",children:["Find deadlines for upcoming conferences"," ",e.jsx(d,{to:"/ai-deadlines",className:"underline underline-offset-2 hover:text-foreground",children:"here"}),"."]})]})}),r.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:2}).map((t,a)=>e.jsxs("div",{children:[e.jsx(m,{className:"h-8 w-24 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:3}).map((s,i)=>e.jsx(m,{className:"h-32"},i))})]},a))}):n==null?void 0:n.map(({year:t,conferences:a})=>{const s=a.reduce((l,o)=>l+(o.paper_count??0),0),i=t>0?String(t):"Unknown year";return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:N,children:[e.jsx("div",{children:e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:i})}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[a.length," ",a.length===1?"conference":"conferences"," ·"," ",s.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[a.map(l=>{const o=j(l.start_date,l.end_date),c=[l.venue,l.location].filter(Boolean).join(", ");return e.jsxs(d,{to:`/conferences/${l.slug}`,className:"tag-cell",children:[e.jsx("div",{className:"name",children:l.name}),e.jsxs("div",{className:"meta",style:{display:"flex",flexDirection:"column",gap:4},children:[o&&e.jsx("span",{children:o}),c&&e.jsx("span",{children:c}),e.jsxs("span",{children:[(l.paper_count??0).toLocaleString()," papers"]})]})]},l.id)}),e.jsx(x,{kind:"conference"})]})]},t)})]})};export{F as default};
 
1
+ import{r as p,j as e,L as d,b as u}from"./index-Bo5_2OqZ.js";import{u as h}from"./useQuery-Bh9FZQpL.js";import{S as m}from"./skeleton-CB-heJjl.js";import{A as f,a as g}from"./alert-_EYQlDHA.js";import{T as x}from"./TaxonomySuggestionTile-T8WIATj3.js";import"./useBaseQuery-B8T7kRNC.js";import"./SignInToEditDialog-DW_1sVXp.js";import"./button-D8mDpZUh.js";import"./textarea-Cr9wwZtd.js";import"./dialog-BAxsIFdN.js";import"./useMutation-B8C_NgT5.js";import"./loader-circle-L2ccNPQf.js";const j=(r,n)=>{if(!r)return null;const t=new Date(`${r}T00:00:00`),a=n?new Date(`${n}T00:00:00`):null,s=l=>l.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=t.getFullYear();return a&&a.getTime()!==t.getTime()?t.getMonth()===a.getMonth()?`${s(t).replace(/\d+$/,"").trim()} ${t.getDate()}–${a.getDate()}, ${i}`:`${s(t)} – ${s(a)}, ${i}`:`${s(t)}, ${i}`},v=r=>{var t;if(r.year!=null)return r.year;if(r.start_date)return Number(r.start_date.slice(0,4));const n=(t=r.slug.match(/-(\d{4})$/))==null?void 0:t[1];return n?Number(n):0},y=(r,n)=>{if(r.start_date&&n.start_date){const t=r.start_date.localeCompare(n.start_date);if(t!==0)return t}else{if(r.start_date)return-1;if(n.start_date)return 1}return r.name.localeCompare(n.name)},N={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},F=()=>{const r=h({queryKey:["conferences"],queryFn:()=>u.getConferences(),staleTime:6e5}),n=p.useMemo(()=>{var a;if(!((a=r.data)!=null&&a.results))return null;const t={};return r.data.results.forEach(s=>{const i=v(s);(t[i]||(t[i]=[])).push(s)}),Object.values(t).forEach(s=>s.sort(y)),Object.keys(t).map(Number).sort((s,i)=>i-s).map(s=>({year:s,conferences:t[s]}))},[r.data]);return r.error?e.jsx("div",{className:"page",children:e.jsx(f,{variant:"destructive",children:e.jsx(g,{children:"Failed to load conferences. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Conferences"})]}),e.jsx("div",{className:"feed-subtitle",children:"Browse accepted papers from major AI conferences, grouped by research area and task."}),e.jsxs("div",{className:"conference-deadlines-link",children:["Find deadlines for upcoming conferences"," ",e.jsx(d,{to:"/ai-deadlines",className:"underline underline-offset-2 hover:text-foreground",children:"here"}),"."]})]})}),r.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:2}).map((t,a)=>e.jsxs("div",{children:[e.jsx(m,{className:"h-8 w-24 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:3}).map((s,i)=>e.jsx(m,{className:"h-32"},i))})]},a))}):n==null?void 0:n.map(({year:t,conferences:a})=>{const s=a.reduce((l,o)=>l+(o.paper_count??0),0),i=t>0?String(t):"Unknown year";return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:N,children:[e.jsx("div",{children:e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:i})}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[a.length," ",a.length===1?"conference":"conferences"," ·"," ",s.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[a.map(l=>{const o=j(l.start_date,l.end_date),c=[l.venue,l.location].filter(Boolean).join(", ");return e.jsxs(d,{to:`/conferences/${l.slug}`,className:"tag-cell",children:[e.jsx("div",{className:"name",children:l.name}),e.jsxs("div",{className:"meta",style:{display:"flex",flexDirection:"column",gap:4},children:[o&&e.jsx("span",{children:o}),c&&e.jsx("span",{children:c}),e.jsxs("span",{children:[(l.paper_count??0).toLocaleString()," papers"]})]})]},l.id)}),e.jsx(x,{kind:"conference"})]})]},t)})]})};export{F as default};
assets/{ContributionsPage-BBrIDkQ0.js → ContributionsPage-DoaZMKUY.js} RENAMED
@@ -1 +1 @@
1
- import{f as o,j as t,b as n}from"./index-CIXevVP9.js";import{u as c}from"./useInfiniteQuery-DWMGlrsa.js";import{B as d}from"./button-5O6wnTvY.js";import"./useBaseQuery-BL30DOiU.js";const h=()=>{var r;const{user:s}=o(),a=c({queryKey:["contributions",s==null?void 0:s.username],queryFn:({pageParam:e})=>n.getMyContributions(e),initialPageParam:void 0,getNextPageParam:e=>e.next_cursor??void 0,enabled:!!(s!=null&&s.can_contribute)}),i=((r=a.data)==null?void 0:r.pages.flatMap(e=>e.events))??[];return s!=null&&s.can_contribute?t.jsxs("div",{className:"page max-w-5xl mx-auto px-4 py-8",children:[t.jsx("h1",{className:"text-3xl font-bold",children:"My contributions"}),t.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Private history for catalog changes made through your contributor account."}),a.isLoading&&t.jsx("p",{className:"mt-8",children:"Loading contributions…"}),a.error&&t.jsx("p",{className:"mt-8 text-destructive",children:"Could not load contribution history."}),t.jsxs("div",{className:"mt-6 space-y-3",children:[i.map(e=>t.jsxs("article",{className:"rounded-md border p-4",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t.jsxs("strong",{children:[e.operation," ",e.entity_type]}),t.jsx("time",{className:"text-xs text-muted-foreground",children:new Date(e.created_at).toLocaleString()})]}),t.jsxs("p",{className:"mt-1 font-mono text-xs text-muted-foreground",children:[e.entity_id," · ",e.id]}),t.jsxs("details",{className:"mt-3 text-xs",children:[t.jsx("summary",{children:"Before / after"}),t.jsx("pre",{className:"mt-2 overflow-auto rounded bg-muted p-3",children:JSON.stringify({before:e.before,after:e.after},null,2)})]})]},e.id)),a.data&&i.length===0&&t.jsx("p",{className:"text-sm text-muted-foreground",children:"No direct edits yet."}),a.hasNextPage&&t.jsx(d,{variant:"outline",onClick:()=>a.fetchNextPage(),disabled:a.isFetchingNextPage,children:a.isFetchingNextPage?"Loading…":"Load older contributions"})]})]}):t.jsxs("div",{className:"page",children:[t.jsx("h1",{children:"Contributions"}),t.jsx("p",{children:"This history is available to project contributors and admins."})]})};export{h as default};
 
1
+ import{f as o,j as t,b as n}from"./index-Bo5_2OqZ.js";import{u as c}from"./useInfiniteQuery-CzzYUeDW.js";import{B as d}from"./button-D8mDpZUh.js";import"./useBaseQuery-B8T7kRNC.js";const h=()=>{var r;const{user:s}=o(),a=c({queryKey:["contributions",s==null?void 0:s.username],queryFn:({pageParam:e})=>n.getMyContributions(e),initialPageParam:void 0,getNextPageParam:e=>e.next_cursor??void 0,enabled:!!(s!=null&&s.can_contribute)}),i=((r=a.data)==null?void 0:r.pages.flatMap(e=>e.events))??[];return s!=null&&s.can_contribute?t.jsxs("div",{className:"page max-w-5xl mx-auto px-4 py-8",children:[t.jsx("h1",{className:"text-3xl font-bold",children:"My contributions"}),t.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Private history for catalog changes made through your contributor account."}),a.isLoading&&t.jsx("p",{className:"mt-8",children:"Loading contributions…"}),a.error&&t.jsx("p",{className:"mt-8 text-destructive",children:"Could not load contribution history."}),t.jsxs("div",{className:"mt-6 space-y-3",children:[i.map(e=>t.jsxs("article",{className:"rounded-md border p-4",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t.jsxs("strong",{children:[e.operation," ",e.entity_type]}),t.jsx("time",{className:"text-xs text-muted-foreground",children:new Date(e.created_at).toLocaleString()})]}),t.jsxs("p",{className:"mt-1 font-mono text-xs text-muted-foreground",children:[e.entity_id," · ",e.id]}),t.jsxs("details",{className:"mt-3 text-xs",children:[t.jsx("summary",{children:"Before / after"}),t.jsx("pre",{className:"mt-2 overflow-auto rounded bg-muted p-3",children:JSON.stringify({before:e.before,after:e.after},null,2)})]})]},e.id)),a.data&&i.length===0&&t.jsx("p",{className:"text-sm text-muted-foreground",children:"No direct edits yet."}),a.hasNextPage&&t.jsx(d,{variant:"outline",onClick:()=>a.fetchNextPage(),disabled:a.isFetchingNextPage,children:a.isFetchingNextPage?"Loading…":"Load older contributions"})]})]}):t.jsxs("div",{className:"page",children:[t.jsx("h1",{children:"Contributions"}),t.jsx("p",{children:"This history is available to project contributors and admins."})]})};export{h as default};
assets/{CronDashboard-Cw5jCU5-.js → CronDashboard-CKulhmWw.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{c as p,r as m,j as e,t as u,N as ke,n as Ce,m as J,a2 as Te,O as Re,Q as Se,p as $,P as Me,s as Fe,S as X,L as Le,v as Ae,b as S,f as Pe}from"./index-CIXevVP9.js";import{u as q}from"./useQuery-BHSsBDmJ.js";import{B as w,D as U,f as De}from"./codexAddEvals-DqxQQWJl.js";import{B as M}from"./button-5O6wnTvY.js";import{C as Ie}from"./chevron-down-BLGtaYwg.js";import{C as P,a as O,R as V,S as Je}from"./shield-alert-SQ1s-XC2.js";import{L as R}from"./loader-circle-k9WscwaT.js";import{E as Z}from"./external-link-DFoBMCzS.js";import{u as G}from"./useMutation-CDeysSx_.js";import{u as Ee}from"./useInfiniteQuery-DWMGlrsa.js";import"./useBaseQuery-BL30DOiU.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
@@ -8,12 +8,12 @@ import{c as p,r as m,j as e,t as u,N as ke,n as Ce,m as J,a2 as Te,O as Re,Q as
8
  *
9
  * This source code is licensed under the ISC license.
10
  * See the LICENSE file in the root directory of this source tree.
11
- */const $e=p("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
12
  * @license lucide-react v0.462.0 - ISC
13
  *
14
  * This source code is licensed under the ISC license.
15
  * See the LICENSE file in the root directory of this source tree.
16
- */const qe=p("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
17
  * @license lucide-react v0.462.0 - ISC
18
  *
19
  * This source code is licensed under the ISC license.
@@ -58,4 +58,4 @@ import{c as p,r as m,j as e,t as u,N as ke,n as Ce,m as J,a2 as Te,O as Re,Q as
58
  *
59
  * This source code is licensed under the ISC license.
60
  * See the LICENSE file in the root directory of this source tree.
61
- */const Ge=p("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),j=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:u("rounded-lg border bg-card text-card-foreground shadow-sm",s),...a}));j.displayName="Card";const b=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:u("flex flex-col space-y-1.5 p-6",s),...a}));b.displayName="CardHeader";const y=m.forwardRef(({className:s,...a},r)=>e.jsx("h3",{ref:r,className:u("text-2xl font-semibold leading-none tracking-tight",s),...a}));y.displayName="CardTitle";const I=m.forwardRef(({className:s,...a},r)=>e.jsx("p",{ref:r,className:u("text-sm text-muted-foreground",s),...a}));I.displayName="CardDescription";const N=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:u("p-6 pt-0",s),...a}));N.displayName="CardContent";const Ke=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:u("flex items-center p-6 pt-0",s),...a}));Ke.displayName="CardFooter";var E="Tabs",[Qe]=Fe(E,[X]),ee=X(),[We,z]=Qe(E),se=m.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,onValueChange:o,defaultValue:d,orientation:i="horizontal",dir:t,activationMode:c="automatic",...g}=s,x=ke(t),[h,f]=Ce({prop:n,onChange:o,defaultProp:d??"",caller:E});return e.jsx(We,{scope:r,baseId:Te(),value:h,onValueChange:f,orientation:i,dir:x,activationMode:c,children:e.jsx(J.div,{dir:x,"data-orientation":i,...g,ref:a})})});se.displayName=E;var ae="TabsList",re=m.forwardRef((s,a)=>{const{__scopeTabs:r,loop:n=!0,...o}=s,d=z(ae,r),i=ee(r);return e.jsx(Re,{asChild:!0,...i,orientation:d.orientation,dir:d.dir,loop:n,children:e.jsx(J.div,{role:"tablist","aria-orientation":d.orientation,...o,ref:a})})});re.displayName=ae;var te="TabsTrigger",ne=m.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,disabled:o=!1,...d}=s,i=z(te,r),t=ee(r),c=le(i.baseId,n),g=oe(i.baseId,n),x=n===i.value;return e.jsx(Se,{asChild:!0,...t,focusable:!o,active:x,children:e.jsx(J.button,{type:"button",role:"tab","aria-selected":x,"aria-controls":g,"data-state":x?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:c,...d,ref:a,onMouseDown:$(s.onMouseDown,h=>{!o&&h.button===0&&h.ctrlKey===!1?i.onValueChange(n):h.preventDefault()}),onKeyDown:$(s.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&i.onValueChange(n)}),onFocus:$(s.onFocus,()=>{const h=i.activationMode!=="manual";!x&&!o&&h&&i.onValueChange(n)})})})});ne.displayName=te;var ie="TabsContent",ce=m.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,forceMount:o,children:d,...i}=s,t=z(ie,r),c=le(t.baseId,n),g=oe(t.baseId,n),x=n===t.value,h=m.useRef(x);return m.useEffect(()=>{const f=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(f)},[]),e.jsx(Me,{present:o||x,children:({present:f})=>e.jsx(J.div,{"data-state":x?"active":"inactive","data-orientation":t.orientation,role:"tabpanel","aria-labelledby":c,hidden:!f,id:g,tabIndex:0,...i,ref:a,style:{...s.style,animationDuration:h.current?"0s":void 0},children:f&&d})})});ce.displayName=ie;function le(s,a){return`${s}-trigger-${a}`}function oe(s,a){return`${s}-content-${a}`}var Xe=se,de=re,me=ne,xe=ce;const Ze=Xe,ue=m.forwardRef(({className:s,...a},r)=>e.jsx(de,{ref:r,className:u("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",s),...a}));ue.displayName=de.displayName;const L=m.forwardRef(({className:s,...a},r)=>e.jsx(me,{ref:r,className:u("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",s),...a}));L.displayName=me.displayName;const A=m.forwardRef(({className:s,...a},r)=>e.jsx(xe,{ref:r,className:u("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...a}));A.displayName=xe.displayName;function _(s){if(!s)return"Never";const a=new Date(s);if(Number.isNaN(a.getTime()))return s;const r=Date.now()-a.getTime(),n=Math.floor(r/6e4),o=Math.floor(r/36e5),d=Math.floor(r/864e5);return n<1?"Just now":n<60?`${n}m ago`:o<24?`${o}h ago`:d<7?`${d}d ago`:a.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function he(s){return s==null?"N/A":s<60?`${s.toFixed(1)}s`:s<3600?`${(s/60).toFixed(1)}m`:`${(s/3600).toFixed(1)}h`}function pe(s){return s.available?s.status==="completed"?s.conclusion??"completed":s.status??"unknown":"Unavailable"}function ge(s){return s.replace(/_/g," ").replace(/\b\w/g,a=>a.toUpperCase())}const Ye={healthy:O,degraded:Ge,broken:P,running:R,stuck:P,unknown:He};function es({status:s,isRunning:a}){const r=a?"running":s,n=Ye[r];return e.jsx(n,{className:`cron-status-icon cron-status--${r}${r==="running"?" animate-spin":""}`})}function Q({icon:s,title:a,metrics:r}){return e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(s,{className:"h-4 w-4"}),e.jsx("h4",{children:a})]}),e.jsx("div",{className:"grid grid-cols-2 gap-3",children:Object.entries(r).map(([n,o])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:ge(n)}),e.jsx("div",{className:"text-lg font-semibold",children:typeof o=="number"?o.toLocaleString():o})]},n))})]})}function ss({workflow:s}){return e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(D,{className:"h-4 w-4"}),e.jsx("h4",{children:"GitHub Actions"})]}),e.jsxs("div",{className:"cron-metric-card space-y-2 text-sm",children:[[["Workflow",s.workflow_file],["Run",s.run_id??"N/A"],["Status",pe(s)],...s.updated_at?[["Updated",_(s.updated_at)]]:[]].map(([a,r])=>e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"cron-label",children:a}),e.jsx("span",{className:a==="Workflow"?"font-mono text-xs":void 0,children:r})]},a)),s.failed_jobs&&s.failed_jobs.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"cron-label mb-1",children:"Failed jobs"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:s.failed_jobs.map(a=>e.jsx(w,{variant:"outline",className:"cron-status--broken",children:a},a))})]}),s.job_conclusions&&Object.keys(s.job_conclusions).length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"cron-label mb-1",children:"Job conclusions"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:Object.entries(s.job_conclusions).map(([a,r])=>e.jsxs(w,{variant:"outline",children:[a,": ",r??"running"]},a))})]}),(s.error||s.view_error)&&e.jsx("div",{className:"cron-message cron-message--error",children:s.error??s.view_error})]})]})}function as(s){return s==="COMPLETED"?"cron-status--healthy":s==="ERROR"||s==="CANCELED"?"cron-status--broken":s==="RUNNING"?"cron-status--running":"cron-status--unknown"}function rs({job:s}){const a=s.progress,r=a!=null&&a.total_papers?Math.min(100,a.processed_papers/a.total_papers*100):0;return e.jsxs("div",{className:"cron-metric-card space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"font-semibold",children:[s.mode??"unknown"," · shard ",s.shard_id??"N/A"]}),e.jsx("div",{className:"font-mono text-xs cron-muted truncate",children:s.id})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(w,{variant:"outline",className:as(s.stage),children:s.stage.toLowerCase()}),s.url&&e.jsx("a",{href:s.url,target:"_blank",rel:"noreferrer","aria-label":`Open Hugging Face Job ${s.id}`,className:"cron-info-text",children:e.jsx(Z,{className:"h-4 w-4"})})]})]}),a?e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between gap-3 text-xs cron-muted mb-1",children:[e.jsxs("span",{children:[a.processed_papers.toLocaleString()," / ",a.total_papers.toLocaleString()," papers"]}),e.jsxs("span",{children:[r.toFixed(0),"%"]})]}),e.jsx("div",{className:"cron-progress-track",children:e.jsx("div",{className:"cron-progress-value",style:{width:`${r}%`}})})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 text-sm",children:[e.jsxs("span",{children:[e.jsx("strong",{children:a.succeeded_papers.toLocaleString()})," succeeded"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.failed_papers.toLocaleString()})," failed"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.already_existed_papers.toLocaleString()})," skipped"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.extracted_images.toLocaleString()})," images"]})]}),a.updated_at&&e.jsxs("div",{className:"text-xs cron-muted",children:["Progress updated ",_(a.updated_at)]}),(a.fatal_error||a.error_samples.length>0)&&e.jsxs("div",{className:"cron-message cron-message--error space-y-1",children:[a.fatal_error&&e.jsx("div",{children:a.fatal_error}),a.error_samples.map(n=>e.jsxs("div",{children:[e.jsx("span",{className:"font-mono",children:n.arxiv_id}),": ",n.error]},`${n.arxiv_id}:${n.error}`))]})]}):e.jsx("div",{className:"text-sm cron-muted",children:"Waiting for the shard progress checkpoint."}),e.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs cron-muted",children:[s.hardware&&e.jsx("span",{children:s.hardware}),s.created_at&&e.jsxs("span",{children:["Created ",_(s.created_at)]}),s.duration_seconds!=null&&e.jsxs("span",{children:["Duration ",he(s.duration_seconds)]})]}),s.stage_message&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.stage_message})]})}function ts({monitor:s,loading:a,error:r}){return e.jsxs("div",{className:"md:col-span-2",children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(Ue,{className:"h-4 w-4"}),e.jsx("h4",{children:"Hugging Face OCR shards"})]}),a&&e.jsxs("div",{className:"cron-metric-card flex items-center gap-2 text-sm cron-muted",children:[e.jsx(R,{className:"h-4 w-4 animate-spin"})," Loading remote Jobs…"]}),r&&e.jsx("div",{className:"cron-message cron-message--error",children:"Could not load Hugging Face Jobs."}),s&&!s.available&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.error??"Hugging Face monitoring is unavailable."}),(s==null?void 0:s.available)&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mb-3",children:Object.entries(s.summary).map(([n,o])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:ge(n)}),e.jsx("div",{className:"text-lg font-semibold",children:o.toLocaleString()})]},n))}),s.jobs.length===0?e.jsx("div",{className:"cron-metric-card text-sm cron-muted",children:"No OCR shards have been launched yet."}):e.jsx("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-3",children:s.jobs.map(n=>e.jsx(rs,{job:n},n.id))})]})]})}function ns({job:s,expanded:a,onToggle:r,paperMarkdownJobs:n,paperMarkdownJobsLoading:o=!1,paperMarkdownJobsError:d=null}){const i=!!(s.work_metrics&&Object.keys(s.work_metrics).length),t=!!(s.db_metrics&&Object.keys(s.db_metrics).length),c=s.job_name==="paper_markdown_backfill",g=i||t||!!s.workflow_status||c;return e.jsxs("div",{className:"cron-job-card",children:[e.jsx("button",{type:"button",className:"cron-job-summary",onClick:r,"aria-expanded":a,children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[e.jsx(es,{status:s.status,isRunning:s.is_running}),e.jsxs("div",{className:"flex-1 min-w-0 text-left",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[e.jsx("h3",{className:"font-semibold",children:s.display_name}),s.critical&&e.jsx(w,{variant:"outline",className:"text-[10px] uppercase tracking-wide",children:"Critical"}),s.lock_stale&&e.jsx(w,{variant:"outline",className:"cron-status--broken",children:"Stale lock"}),g&&(a?e.jsx(qe,{className:"h-4 w-4 cron-muted"}):e.jsx(Ie,{className:"h-4 w-4 cron-muted"}))]}),e.jsx("p",{className:"text-sm cron-muted mb-2",children:s.status_reason}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 gap-2 text-sm cron-muted",children:[e.jsxs("span",{className:"cron-fact",children:[e.jsx(Y,{}),"Log: ",_(s.last_run)]}),e.jsxs("span",{className:"cron-fact",children:[e.jsx(U,{}),"DB: ",_(s.last_db_write)]}),s.recent_write_count!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(Ve,{}),"Recent writes: ",s.recent_write_count.toLocaleString()]}),s.duration!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(D,{}),"Duration: ",he(s.duration)]}),s.schedule&&e.jsxs("span",{className:"cron-fact md:col-span-2",children:[e.jsx($e,{}),e.jsx("span",{className:"font-mono text-xs",children:s.schedule})]}),s.log_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(K,{}),"Log status: ",s.log_status]}),s.workflow_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(D,{}),"Actions: ",pe(s.workflow_status)]})]}),s.work_summary&&e.jsx("div",{className:"cron-message",children:s.work_summary}),s.error&&e.jsxs("div",{className:"cron-message cron-message--error",children:[e.jsx("strong",{children:"Error: "}),s.error]}),s.diagnostics&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.diagnostics})]})]}),e.jsx(w,{variant:"outline",className:`cron-status--${s.status}`,children:s.status})]})}),a&&g&&e.jsx("div",{className:"cron-job-details",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.work_metrics&&i&&e.jsx(Q,{icon:K,title:"Log Metrics",metrics:s.work_metrics}),s.db_metrics&&t&&e.jsx(Q,{icon:U,title:"Database Metrics",metrics:s.db_metrics}),s.workflow_status&&e.jsx(ss,{workflow:s.workflow_status}),c&&e.jsx(ts,{monitor:n,loading:o,error:d})]})})]})}const fe=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:r,className:u("w-full caption-bottom text-sm",s),...a})}));fe.displayName="Table";const je=m.forwardRef(({className:s,...a},r)=>e.jsx("thead",{ref:r,className:u("[&_tr]:border-b",s),...a}));je.displayName="TableHeader";const Ne=m.forwardRef(({className:s,...a},r)=>e.jsx("tbody",{ref:r,className:u("[&_tr:last-child]:border-0",s),...a}));Ne.displayName="TableBody";const is=m.forwardRef(({className:s,...a},r)=>e.jsx("tfoot",{ref:r,className:u("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",s),...a}));is.displayName="TableFooter";const H=m.forwardRef(({className:s,...a},r)=>e.jsx("tr",{ref:r,className:u("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",s),...a}));H.displayName="TableRow";const C=m.forwardRef(({className:s,...a},r)=>e.jsx("th",{ref:r,className:u("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",s),...a}));C.displayName="TableHead";const T=m.forwardRef(({className:s,...a},r)=>e.jsx("td",{ref:r,className:u("p-4 align-middle [&:has([role=checkbox])]:pr-0",s),...a}));T.displayName="TableCell";const cs=m.forwardRef(({className:s,...a},r)=>e.jsx("caption",{ref:r,className:u("mt-4 text-sm text-muted-foreground",s),...a}));cs.displayName="TableCaption";const ls={queued:"cron-status--unknown",dispatching:"cron-status--running",running:"cron-status--running",completed:"cron-status--healthy",failed:"cron-status--broken",canceled:"cron-status--unknown"},os={"add-evals":"Add evals","enrich-paper":"Enrich paper"},ds={queued:Be,dispatching:R,running:Oe,completed:O,failed:P,canceled:ze};function ms({status:s}){const a=ds[s];return e.jsxs(w,{variant:"outline",className:ls[s],children:[e.jsx(a,{className:`mr-1 h-3.5 w-3.5 ${s==="dispatching"?"animate-spin":""}`}),s]})}function xs(s){return s.error?s.error:s.report?s.report:s.status==="completed"&&s.applied_at?"Changes applied to the paper.":s.status==="completed"?"Completed without a recorded mutation.":null}function us({autoRefresh:s,refreshToken:a}){const{data:r,isLoading:n,isFetching:o,error:d}=q({queryKey:["codexPaperJobs",a],queryFn:()=>De(100),refetchInterval:s?1e4:!1,retry:!1}),i=d&&typeof d=="object"&&"status"in d?d.status:void 0;return e.jsxs(j,{className:"mb-8",children:[e.jsx(b,{children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(y,{className:"text-xl",children:"Codex paper jobs"}),e.jsx(I,{children:"Durable queue and execution history for admin-triggered Hugging Face Jobs"})]}),o&&!n&&e.jsxs("span",{className:"flex items-center gap-2 text-xs cron-muted",children:[e.jsx(R,{className:"h-3.5 w-3.5 animate-spin"})," Syncing with Hugging Face"]})]})}),e.jsxs(N,{children:[n&&e.jsxs("div",{className:"flex items-center justify-center py-10 cron-muted",children:[e.jsx(R,{className:"mr-2 h-5 w-5 animate-spin"})," Loading paper jobs…"]}),d&&i!==404&&e.jsx("div",{className:"cron-message cron-message--error mb-4",children:d instanceof Error?d.message:"Could not load Codex paper jobs."}),i===404&&e.jsx("p",{className:"py-4 text-sm cron-muted",children:"Codex paper jobs are not enabled in this environment."}),r&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-5 grid grid-cols-2 gap-3 sm:grid-cols-4 lg:grid-cols-7",children:[["queued","dispatching","running","completed","failed","canceled"].map(t=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label capitalize",children:t}),e.jsx("div",{className:"mt-1 text-xl font-semibold",children:r.summary[t]})]},t)),e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:"Total"}),e.jsx("div",{className:"mt-1 text-xl font-semibold",children:r.summary.total})]})]}),r.jobs.length===0?e.jsx("p",{className:"py-8 text-center text-sm cron-muted",children:"No paper curation jobs have been submitted yet."}):e.jsxs(fe,{children:[e.jsx(je,{children:e.jsxs(H,{children:[e.jsx(C,{children:"Status"}),e.jsx(C,{children:"Paper"}),e.jsx(C,{children:"Action"}),e.jsx(C,{children:"Requested"}),e.jsx(C,{children:"Execution"})]})}),e.jsx(Ne,{children:r.jobs.map(t=>{const c=xs(t);return e.jsxs(H,{children:[e.jsx(T,{className:"align-top",children:e.jsx(ms,{status:t.status})}),e.jsxs(T,{className:"min-w-[260px] align-top",children:[e.jsx(Le,{to:`/paper/${encodeURIComponent(t.paper_route)}`,className:"font-medium hover:underline",children:t.paper_title}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["Paper #",t.paper_id]})]}),e.jsxs(T,{className:"whitespace-nowrap align-top",children:[os[t.kind],t.applied_at&&e.jsxs("div",{className:"mt-1 flex items-center gap-1 text-xs cron-status--healthy",children:[e.jsx(O,{className:"h-3.5 w-3.5"})," Applied"]})]}),e.jsxs(T,{className:"whitespace-nowrap align-top",children:[e.jsx("div",{children:_(t.created_at)}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["@",t.requested_by]})]}),e.jsxs(T,{className:"max-w-[360px] align-top",children:[t.hf_job_url?e.jsxs("a",{href:t.hf_job_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 hover:underline",children:["Hugging Face Job ",e.jsx(Z,{className:"h-3.5 w-3.5"})]}):e.jsx("span",{className:"cron-muted",children:"Waiting to dispatch"}),c&&e.jsx("p",{className:`mt-2 line-clamp-3 text-xs ${t.error?"text-red-700":"cron-muted"}`,title:c,children:c})]})]},t.id)})})]}),e.jsxs("p",{className:"mt-4 text-xs cron-muted",children:["Showing the 100 most recent jobs · Queue totals include full history · Updated ",_(r.timestamp)]})]})]})]})}const hs=()=>{var d,i,t;const s=Ae(),a=Ee({queryKey:["catalog-audit"],queryFn:({pageParam:c})=>S.getCatalogAudit(c),initialPageParam:void 0,getNextPageParam:c=>c.next_cursor??void 0}),r=((d=a.data)==null?void 0:d.pages.flatMap(c=>c.events))??[],n=G({mutationFn:()=>S.acknowledgeCatalogAudit(),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})}),o=G({mutationFn:c=>S.rollbackCatalogEvent(c),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})});return e.jsx("div",{className:"space-y-4",children:e.jsxs(j,{children:[e.jsxs(b,{className:"flex-row items-center justify-between",children:[e.jsx(y,{children:"Catalog mutation audit"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm font-medium",children:[((t=(i=a.data)==null?void 0:i.pages[0])==null?void 0:t.unread_contributor_count)??0," unread contributor changes"]}),e.jsx(M,{variant:"outline",size:"sm",onClick:()=>n.mutate(),disabled:n.isPending,children:"Mark read"})]})]}),e.jsxs(N,{className:"space-y-3",children:[a.isLoading&&e.jsx("p",{children:"Loading audit history…"}),a.error&&e.jsx("p",{className:"text-destructive",children:"Audit history unavailable."}),r.map(c=>e.jsxs("article",{className:`rounded-md border p-3 ${c.operation==="delete"||c.rollback_eligible===!1?"border-red-500 bg-red-50/50":""}`,children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs("strong",{children:[c.operation," ",c.entity_type," ",c.entity_id]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["@",c.actor_username??c.actor_role," ·"," ",new Date(c.created_at).toLocaleString()]})]}),e.jsxs("details",{className:"mt-2 text-xs",children:[e.jsx("summary",{children:"Inspect snapshots"}),e.jsx("pre",{className:"mt-2 max-h-80 overflow-auto rounded bg-muted p-3",children:JSON.stringify({before:c.before,after:c.after},null,2)})]}),!c.rollback_of_event_id&&e.jsx(M,{className:"mt-3",variant:"outline",size:"sm",onClick:()=>o.mutate(c.id),disabled:o.isPending||c.rollback_eligible===!1,children:c.rollback_eligible===!1?"Rollback conflict":"Roll back if unchanged"})]},c.id)),a.hasNextPage&&e.jsx(M,{variant:"outline",onClick:()=>a.fetchNextPage(),disabled:a.isFetchingNextPage,children:a.isFetchingNextPage?"Loading…":"Load older events"})]})]})})},W={hourly:"cron-status--running",daily:"cron-status--healthy",weekly:"cron-status--degraded"},Rs=()=>{const[s,a]=m.useState(!0),[r,n]=m.useState(0),[o,d]=m.useState(new Set),{user:i}=Pe(),{data:t,isLoading:c,isFetching:g,error:x,refetch:h}=q({queryKey:["cronStatus",i==null?void 0:i.username],queryFn:()=>S.getCronStatus(),enabled:!!(i!=null&&i.is_admin),refetchInterval:s?3e4:!1,retry:!1}),f=q({queryKey:["paperMarkdownJobs",i==null?void 0:i.username],queryFn:()=>S.getPaperMarkdownJobs(),enabled:!!(i!=null&&i.is_admin),refetchInterval:s?3e4:!1,retry:!1}),ve=(x&&typeof x=="object"&&"status"in x?x.status:void 0)===401?"Unauthorized. Sign in with an allowlisted Hugging Face admin account.":x instanceof Error?x.message:void 0,be=l=>{d(v=>{const k=new Set(v);return k.has(l)?k.delete(l):k.add(l),k})},ye=(t==null?void 0:t.jobs.filter(l=>l.critical))??[],F=((t==null?void 0:t.jobs.filter(l=>!l.critical))??[]).reduce((l,v)=>(l[v.category]||(l[v.category]=[]),l[v.category].push(v),l),{}),we=Object.keys(F).sort((l,v)=>{const k=["hourly","daily","weekly"];return k.indexOf(l)-k.indexOf(v)}),B=l=>e.jsx(ns,{job:l,expanded:o.has(l.job_name),onToggle:()=>be(l.job_name),paperMarkdownJobs:l.job_name==="paper_markdown_backfill"?f.data:void 0,paperMarkdownJobsLoading:l.job_name==="paper_markdown_backfill"?f.isLoading:!1,paperMarkdownJobsError:l.job_name==="paper_markdown_backfill"?f.error:null},l.job_name),_e=()=>{n(l=>l+1),h(),f.refetch()};return e.jsx("div",{className:"cron-dashboard","data-shadcn":!0,children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[e.jsx("div",{className:"mb-8",children:e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-3xl font-bold flex items-center gap-3",children:[e.jsx(D,{className:"h-8 w-8 cron-info-text"}),"Admin Dashboard"]}),e.jsx("p",{className:"mt-2 cron-muted",children:"Paper curation queue and operational health for scheduled jobs"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(M,{variant:"outline",size:"sm",onClick:()=>a(!s),className:s?"cron-status--running":"",children:[e.jsx(V,{className:`h-4 w-4 mr-2 ${s?"animate-spin":""}`}),"Auto-refresh ",s?"ON":"OFF"]}),e.jsxs(M,{variant:"outline",size:"sm",onClick:_e,disabled:g,children:[e.jsx(V,{className:`h-4 w-4 mr-2 ${g?"animate-spin":""}`}),"Refresh"]})]})]})}),e.jsx(j,{className:"mb-6",children:e.jsx(N,{className:"pt-6",children:e.jsxs("p",{className:"text-sm cron-muted",children:["Signed in as ",e.jsxs("span",{className:"font-semibold",children:["@",i==null?void 0:i.username]}),". Health checks prefer database freshness over log completion so silent no-work failures surface as degraded or broken."]})})}),e.jsxs(Ze,{defaultValue:"critical-jobs",children:[e.jsxs(ue,{className:"grid w-full grid-cols-3 sm:w-auto",children:[e.jsx(L,{value:"critical-jobs",children:"Critical Jobs"}),e.jsx(L,{value:"codex-paper-jobs",children:"Codex Paper Jobs"}),e.jsx(L,{value:"catalog-audit",children:"Catalog Audit"})]}),e.jsxs(A,{value:"critical-jobs",className:"mt-6",children:[c&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(R,{className:"h-8 w-8 animate-spin cron-info-text"}),e.jsx("span",{className:"ml-3 cron-muted",children:"Loading CRON jobs status..."})]}),x&&e.jsx(j,{className:"cron-status--broken",children:e.jsx(N,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(P,{className:"h-5 w-5"}),e.jsx("p",{children:ve??"Failed to load CRON jobs status. Please try again."})]})})}),t&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4 mb-6",children:["healthy","degraded","broken","running","stuck","unknown"].map(l=>e.jsxs(j,{children:[e.jsx(b,{className:"pb-2",children:e.jsx(y,{className:"text-sm font-medium cron-muted capitalize",children:l})}),e.jsx(N,{children:e.jsx("div",{className:"text-2xl font-bold",children:t.summary[l]})})]},l))}),t.summary.critical_issues.length>0&&e.jsxs(j,{className:"mb-6 cron-status--broken",children:[e.jsx(b,{children:e.jsxs(y,{className:"flex items-center gap-2",children:[e.jsx(Je,{className:"h-5 w-5"}),"Critical job issues"]})}),e.jsx(N,{children:e.jsx("ul",{className:"list-disc pl-5 space-y-1 text-sm",children:t.summary.critical_issues.map(l=>e.jsx("li",{children:l},l))})})]}),e.jsxs(j,{className:"mb-8",children:[e.jsx(b,{children:e.jsx(y,{className:"text-base",children:"What to check next"})}),e.jsxs(N,{children:[e.jsx("p",{className:"text-sm cron-muted",children:t.summary.what_to_check_next}),e.jsxs("p",{className:"mt-2 text-xs cron-muted flex items-center gap-2",children:[e.jsx(Y,{className:"h-4 w-4"}),"Last updated: ",_(t.timestamp)," · Health score:"," ",t.summary.health_score.toFixed(0),"%"]})]})]}),e.jsxs(j,{className:"mb-8",children:[e.jsxs(b,{children:[e.jsx(y,{className:"text-xl",children:"Critical jobs"}),e.jsx(I,{children:"Writers whose stale output breaks the live site"})]}),e.jsx(N,{className:"space-y-4",children:ye.map(B)})]}),e.jsx("div",{className:"space-y-6",children:we.map(l=>e.jsxs(j,{children:[e.jsx(b,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(y,{className:"text-xl capitalize flex items-center gap-2",children:[e.jsx(w,{className:W[l]??W.hourly,children:l}),e.jsx("span",{children:"Supporting jobs"})]}),e.jsxs(I,{children:[F[l].length," job",F[l].length!==1?"s":""]})]})}),e.jsx(N,{className:"space-y-4",children:F[l].map(B)})]},l))})]})]}),e.jsx(A,{value:"codex-paper-jobs",className:"mt-6",children:e.jsx(us,{autoRefresh:s,refreshToken:r})}),e.jsx(A,{value:"catalog-audit",className:"mt-6",children:e.jsx(hs,{})})]})]})})};export{Rs as default};
 
1
+ import{c as p,r as m,j as e,v as u,N as ke,o as Ce,n as J,a2 as Te,O as Re,Q as Se,q as E,P as Me,t as Fe,S as X,L as Le,h as Ae,b as S,f as Pe}from"./index-Bo5_2OqZ.js";import{u as $}from"./useQuery-Bh9FZQpL.js";import{B as w,D as U,f as De}from"./codexAddEvals-NAKdH-Ge.js";import{B as M}from"./button-D8mDpZUh.js";import{C as Ie}from"./chevron-down-BeEEYUNO.js";import{C as P,a as O,R as V,S as Je}from"./shield-alert-C2VCWA2k.js";import{L as R}from"./loader-circle-L2ccNPQf.js";import{E as Z}from"./external-link-BjWlCUOk.js";import{u as G}from"./useMutation-B8C_NgT5.js";import{u as qe}from"./useInfiniteQuery-CzzYUeDW.js";import"./useBaseQuery-B8T7kRNC.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
8
  *
9
  * This source code is licensed under the ISC license.
10
  * See the LICENSE file in the root directory of this source tree.
11
+ */const Ee=p("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
12
  * @license lucide-react v0.462.0 - ISC
13
  *
14
  * This source code is licensed under the ISC license.
15
  * See the LICENSE file in the root directory of this source tree.
16
+ */const $e=p("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
17
  * @license lucide-react v0.462.0 - ISC
18
  *
19
  * This source code is licensed under the ISC license.
 
58
  *
59
  * This source code is licensed under the ISC license.
60
  * See the LICENSE file in the root directory of this source tree.
61
+ */const Ge=p("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),j=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:u("rounded-lg border bg-card text-card-foreground shadow-sm",s),...a}));j.displayName="Card";const b=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:u("flex flex-col space-y-1.5 p-6",s),...a}));b.displayName="CardHeader";const y=m.forwardRef(({className:s,...a},r)=>e.jsx("h3",{ref:r,className:u("text-2xl font-semibold leading-none tracking-tight",s),...a}));y.displayName="CardTitle";const I=m.forwardRef(({className:s,...a},r)=>e.jsx("p",{ref:r,className:u("text-sm text-muted-foreground",s),...a}));I.displayName="CardDescription";const N=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:u("p-6 pt-0",s),...a}));N.displayName="CardContent";const Ke=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:u("flex items-center p-6 pt-0",s),...a}));Ke.displayName="CardFooter";var q="Tabs",[Qe]=Fe(q,[X]),ee=X(),[We,z]=Qe(q),se=m.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,onValueChange:o,defaultValue:d,orientation:i="horizontal",dir:t,activationMode:c="automatic",...g}=s,x=ke(t),[h,f]=Ce({prop:n,onChange:o,defaultProp:d??"",caller:q});return e.jsx(We,{scope:r,baseId:Te(),value:h,onValueChange:f,orientation:i,dir:x,activationMode:c,children:e.jsx(J.div,{dir:x,"data-orientation":i,...g,ref:a})})});se.displayName=q;var ae="TabsList",re=m.forwardRef((s,a)=>{const{__scopeTabs:r,loop:n=!0,...o}=s,d=z(ae,r),i=ee(r);return e.jsx(Re,{asChild:!0,...i,orientation:d.orientation,dir:d.dir,loop:n,children:e.jsx(J.div,{role:"tablist","aria-orientation":d.orientation,...o,ref:a})})});re.displayName=ae;var te="TabsTrigger",ne=m.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,disabled:o=!1,...d}=s,i=z(te,r),t=ee(r),c=le(i.baseId,n),g=oe(i.baseId,n),x=n===i.value;return e.jsx(Se,{asChild:!0,...t,focusable:!o,active:x,children:e.jsx(J.button,{type:"button",role:"tab","aria-selected":x,"aria-controls":g,"data-state":x?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:c,...d,ref:a,onMouseDown:E(s.onMouseDown,h=>{!o&&h.button===0&&h.ctrlKey===!1?i.onValueChange(n):h.preventDefault()}),onKeyDown:E(s.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&i.onValueChange(n)}),onFocus:E(s.onFocus,()=>{const h=i.activationMode!=="manual";!x&&!o&&h&&i.onValueChange(n)})})})});ne.displayName=te;var ie="TabsContent",ce=m.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,forceMount:o,children:d,...i}=s,t=z(ie,r),c=le(t.baseId,n),g=oe(t.baseId,n),x=n===t.value,h=m.useRef(x);return m.useEffect(()=>{const f=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(f)},[]),e.jsx(Me,{present:o||x,children:({present:f})=>e.jsx(J.div,{"data-state":x?"active":"inactive","data-orientation":t.orientation,role:"tabpanel","aria-labelledby":c,hidden:!f,id:g,tabIndex:0,...i,ref:a,style:{...s.style,animationDuration:h.current?"0s":void 0},children:f&&d})})});ce.displayName=ie;function le(s,a){return`${s}-trigger-${a}`}function oe(s,a){return`${s}-content-${a}`}var Xe=se,de=re,me=ne,xe=ce;const Ze=Xe,ue=m.forwardRef(({className:s,...a},r)=>e.jsx(de,{ref:r,className:u("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",s),...a}));ue.displayName=de.displayName;const L=m.forwardRef(({className:s,...a},r)=>e.jsx(me,{ref:r,className:u("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",s),...a}));L.displayName=me.displayName;const A=m.forwardRef(({className:s,...a},r)=>e.jsx(xe,{ref:r,className:u("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...a}));A.displayName=xe.displayName;function _(s){if(!s)return"Never";const a=new Date(s);if(Number.isNaN(a.getTime()))return s;const r=Date.now()-a.getTime(),n=Math.floor(r/6e4),o=Math.floor(r/36e5),d=Math.floor(r/864e5);return n<1?"Just now":n<60?`${n}m ago`:o<24?`${o}h ago`:d<7?`${d}d ago`:a.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function he(s){return s==null?"N/A":s<60?`${s.toFixed(1)}s`:s<3600?`${(s/60).toFixed(1)}m`:`${(s/3600).toFixed(1)}h`}function pe(s){return s.available?s.status==="completed"?s.conclusion??"completed":s.status??"unknown":"Unavailable"}function ge(s){return s.replace(/_/g," ").replace(/\b\w/g,a=>a.toUpperCase())}const Ye={healthy:O,degraded:Ge,broken:P,running:R,stuck:P,unknown:He};function es({status:s,isRunning:a}){const r=a?"running":s,n=Ye[r];return e.jsx(n,{className:`cron-status-icon cron-status--${r}${r==="running"?" animate-spin":""}`})}function Q({icon:s,title:a,metrics:r}){return e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(s,{className:"h-4 w-4"}),e.jsx("h4",{children:a})]}),e.jsx("div",{className:"grid grid-cols-2 gap-3",children:Object.entries(r).map(([n,o])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:ge(n)}),e.jsx("div",{className:"text-lg font-semibold",children:typeof o=="number"?o.toLocaleString():o})]},n))})]})}function ss({workflow:s}){return e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(D,{className:"h-4 w-4"}),e.jsx("h4",{children:"GitHub Actions"})]}),e.jsxs("div",{className:"cron-metric-card space-y-2 text-sm",children:[[["Workflow",s.workflow_file],["Run",s.run_id??"N/A"],["Status",pe(s)],...s.updated_at?[["Updated",_(s.updated_at)]]:[]].map(([a,r])=>e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"cron-label",children:a}),e.jsx("span",{className:a==="Workflow"?"font-mono text-xs":void 0,children:r})]},a)),s.failed_jobs&&s.failed_jobs.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"cron-label mb-1",children:"Failed jobs"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:s.failed_jobs.map(a=>e.jsx(w,{variant:"outline",className:"cron-status--broken",children:a},a))})]}),s.job_conclusions&&Object.keys(s.job_conclusions).length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"cron-label mb-1",children:"Job conclusions"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:Object.entries(s.job_conclusions).map(([a,r])=>e.jsxs(w,{variant:"outline",children:[a,": ",r??"running"]},a))})]}),(s.error||s.view_error)&&e.jsx("div",{className:"cron-message cron-message--error",children:s.error??s.view_error})]})]})}function as(s){return s==="COMPLETED"?"cron-status--healthy":s==="ERROR"||s==="CANCELED"?"cron-status--broken":s==="RUNNING"?"cron-status--running":"cron-status--unknown"}function rs({job:s}){const a=s.progress,r=a!=null&&a.total_papers?Math.min(100,a.processed_papers/a.total_papers*100):0;return e.jsxs("div",{className:"cron-metric-card space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"font-semibold",children:[s.mode??"unknown"," · shard ",s.shard_id??"N/A"]}),e.jsx("div",{className:"font-mono text-xs cron-muted truncate",children:s.id})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(w,{variant:"outline",className:as(s.stage),children:s.stage.toLowerCase()}),s.url&&e.jsx("a",{href:s.url,target:"_blank",rel:"noreferrer","aria-label":`Open Hugging Face Job ${s.id}`,className:"cron-info-text",children:e.jsx(Z,{className:"h-4 w-4"})})]})]}),a?e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between gap-3 text-xs cron-muted mb-1",children:[e.jsxs("span",{children:[a.processed_papers.toLocaleString()," / ",a.total_papers.toLocaleString()," papers"]}),e.jsxs("span",{children:[r.toFixed(0),"%"]})]}),e.jsx("div",{className:"cron-progress-track",children:e.jsx("div",{className:"cron-progress-value",style:{width:`${r}%`}})})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 text-sm",children:[e.jsxs("span",{children:[e.jsx("strong",{children:a.succeeded_papers.toLocaleString()})," succeeded"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.failed_papers.toLocaleString()})," failed"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.already_existed_papers.toLocaleString()})," skipped"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.extracted_images.toLocaleString()})," images"]})]}),a.updated_at&&e.jsxs("div",{className:"text-xs cron-muted",children:["Progress updated ",_(a.updated_at)]}),(a.fatal_error||a.error_samples.length>0)&&e.jsxs("div",{className:"cron-message cron-message--error space-y-1",children:[a.fatal_error&&e.jsx("div",{children:a.fatal_error}),a.error_samples.map(n=>e.jsxs("div",{children:[e.jsx("span",{className:"font-mono",children:n.arxiv_id}),": ",n.error]},`${n.arxiv_id}:${n.error}`))]})]}):e.jsx("div",{className:"text-sm cron-muted",children:"Waiting for the shard progress checkpoint."}),e.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs cron-muted",children:[s.hardware&&e.jsx("span",{children:s.hardware}),s.created_at&&e.jsxs("span",{children:["Created ",_(s.created_at)]}),s.duration_seconds!=null&&e.jsxs("span",{children:["Duration ",he(s.duration_seconds)]})]}),s.stage_message&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.stage_message})]})}function ts({monitor:s,loading:a,error:r}){return e.jsxs("div",{className:"md:col-span-2",children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(Ue,{className:"h-4 w-4"}),e.jsx("h4",{children:"Hugging Face OCR shards"})]}),a&&e.jsxs("div",{className:"cron-metric-card flex items-center gap-2 text-sm cron-muted",children:[e.jsx(R,{className:"h-4 w-4 animate-spin"})," Loading remote Jobs…"]}),r&&e.jsx("div",{className:"cron-message cron-message--error",children:"Could not load Hugging Face Jobs."}),s&&!s.available&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.error??"Hugging Face monitoring is unavailable."}),(s==null?void 0:s.available)&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mb-3",children:Object.entries(s.summary).map(([n,o])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:ge(n)}),e.jsx("div",{className:"text-lg font-semibold",children:o.toLocaleString()})]},n))}),s.jobs.length===0?e.jsx("div",{className:"cron-metric-card text-sm cron-muted",children:"No OCR shards have been launched yet."}):e.jsx("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-3",children:s.jobs.map(n=>e.jsx(rs,{job:n},n.id))})]})]})}function ns({job:s,expanded:a,onToggle:r,paperMarkdownJobs:n,paperMarkdownJobsLoading:o=!1,paperMarkdownJobsError:d=null}){const i=!!(s.work_metrics&&Object.keys(s.work_metrics).length),t=!!(s.db_metrics&&Object.keys(s.db_metrics).length),c=s.job_name==="paper_markdown_backfill",g=i||t||!!s.workflow_status||c;return e.jsxs("div",{className:"cron-job-card",children:[e.jsx("button",{type:"button",className:"cron-job-summary",onClick:r,"aria-expanded":a,children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[e.jsx(es,{status:s.status,isRunning:s.is_running}),e.jsxs("div",{className:"flex-1 min-w-0 text-left",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[e.jsx("h3",{className:"font-semibold",children:s.display_name}),s.critical&&e.jsx(w,{variant:"outline",className:"text-[10px] uppercase tracking-wide",children:"Critical"}),s.lock_stale&&e.jsx(w,{variant:"outline",className:"cron-status--broken",children:"Stale lock"}),g&&(a?e.jsx($e,{className:"h-4 w-4 cron-muted"}):e.jsx(Ie,{className:"h-4 w-4 cron-muted"}))]}),e.jsx("p",{className:"text-sm cron-muted mb-2",children:s.status_reason}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 gap-2 text-sm cron-muted",children:[e.jsxs("span",{className:"cron-fact",children:[e.jsx(Y,{}),"Log: ",_(s.last_run)]}),e.jsxs("span",{className:"cron-fact",children:[e.jsx(U,{}),"DB: ",_(s.last_db_write)]}),s.recent_write_count!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(Ve,{}),"Recent writes: ",s.recent_write_count.toLocaleString()]}),s.duration!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(D,{}),"Duration: ",he(s.duration)]}),s.schedule&&e.jsxs("span",{className:"cron-fact md:col-span-2",children:[e.jsx(Ee,{}),e.jsx("span",{className:"font-mono text-xs",children:s.schedule})]}),s.log_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(K,{}),"Log status: ",s.log_status]}),s.workflow_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(D,{}),"Actions: ",pe(s.workflow_status)]})]}),s.work_summary&&e.jsx("div",{className:"cron-message",children:s.work_summary}),s.error&&e.jsxs("div",{className:"cron-message cron-message--error",children:[e.jsx("strong",{children:"Error: "}),s.error]}),s.diagnostics&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.diagnostics})]})]}),e.jsx(w,{variant:"outline",className:`cron-status--${s.status}`,children:s.status})]})}),a&&g&&e.jsx("div",{className:"cron-job-details",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.work_metrics&&i&&e.jsx(Q,{icon:K,title:"Log Metrics",metrics:s.work_metrics}),s.db_metrics&&t&&e.jsx(Q,{icon:U,title:"Database Metrics",metrics:s.db_metrics}),s.workflow_status&&e.jsx(ss,{workflow:s.workflow_status}),c&&e.jsx(ts,{monitor:n,loading:o,error:d})]})})]})}const fe=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:r,className:u("w-full caption-bottom text-sm",s),...a})}));fe.displayName="Table";const je=m.forwardRef(({className:s,...a},r)=>e.jsx("thead",{ref:r,className:u("[&_tr]:border-b",s),...a}));je.displayName="TableHeader";const Ne=m.forwardRef(({className:s,...a},r)=>e.jsx("tbody",{ref:r,className:u("[&_tr:last-child]:border-0",s),...a}));Ne.displayName="TableBody";const is=m.forwardRef(({className:s,...a},r)=>e.jsx("tfoot",{ref:r,className:u("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",s),...a}));is.displayName="TableFooter";const H=m.forwardRef(({className:s,...a},r)=>e.jsx("tr",{ref:r,className:u("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",s),...a}));H.displayName="TableRow";const C=m.forwardRef(({className:s,...a},r)=>e.jsx("th",{ref:r,className:u("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",s),...a}));C.displayName="TableHead";const T=m.forwardRef(({className:s,...a},r)=>e.jsx("td",{ref:r,className:u("p-4 align-middle [&:has([role=checkbox])]:pr-0",s),...a}));T.displayName="TableCell";const cs=m.forwardRef(({className:s,...a},r)=>e.jsx("caption",{ref:r,className:u("mt-4 text-sm text-muted-foreground",s),...a}));cs.displayName="TableCaption";const ls={queued:"cron-status--unknown",dispatching:"cron-status--running",running:"cron-status--running",completed:"cron-status--healthy",failed:"cron-status--broken",canceled:"cron-status--unknown"},os={"add-evals":"Add evals","enrich-paper":"Enrich paper"},ds={queued:Be,dispatching:R,running:Oe,completed:O,failed:P,canceled:ze};function ms({status:s}){const a=ds[s];return e.jsxs(w,{variant:"outline",className:ls[s],children:[e.jsx(a,{className:`mr-1 h-3.5 w-3.5 ${s==="dispatching"?"animate-spin":""}`}),s]})}function xs(s){return s.error?s.error:s.report?s.report:s.status==="completed"&&s.applied_at?"Changes applied to the paper.":s.status==="completed"?"Completed without a recorded mutation.":null}function us({autoRefresh:s,refreshToken:a}){const{data:r,isLoading:n,isFetching:o,error:d}=$({queryKey:["codexPaperJobs",a],queryFn:()=>De(100),refetchInterval:s?1e4:!1,retry:!1}),i=d&&typeof d=="object"&&"status"in d?d.status:void 0;return e.jsxs(j,{className:"mb-8",children:[e.jsx(b,{children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(y,{className:"text-xl",children:"Codex paper jobs"}),e.jsx(I,{children:"Durable queue and execution history for admin-triggered Hugging Face Jobs"})]}),o&&!n&&e.jsxs("span",{className:"flex items-center gap-2 text-xs cron-muted",children:[e.jsx(R,{className:"h-3.5 w-3.5 animate-spin"})," Syncing with Hugging Face"]})]})}),e.jsxs(N,{children:[n&&e.jsxs("div",{className:"flex items-center justify-center py-10 cron-muted",children:[e.jsx(R,{className:"mr-2 h-5 w-5 animate-spin"})," Loading paper jobs…"]}),d&&i!==404&&e.jsx("div",{className:"cron-message cron-message--error mb-4",children:d instanceof Error?d.message:"Could not load Codex paper jobs."}),i===404&&e.jsx("p",{className:"py-4 text-sm cron-muted",children:"Codex paper jobs are not enabled in this environment."}),r&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-5 grid grid-cols-2 gap-3 sm:grid-cols-4 lg:grid-cols-7",children:[["queued","dispatching","running","completed","failed","canceled"].map(t=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label capitalize",children:t}),e.jsx("div",{className:"mt-1 text-xl font-semibold",children:r.summary[t]})]},t)),e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:"Total"}),e.jsx("div",{className:"mt-1 text-xl font-semibold",children:r.summary.total})]})]}),r.jobs.length===0?e.jsx("p",{className:"py-8 text-center text-sm cron-muted",children:"No paper curation jobs have been submitted yet."}):e.jsxs(fe,{children:[e.jsx(je,{children:e.jsxs(H,{children:[e.jsx(C,{children:"Status"}),e.jsx(C,{children:"Paper"}),e.jsx(C,{children:"Action"}),e.jsx(C,{children:"Requested"}),e.jsx(C,{children:"Execution"})]})}),e.jsx(Ne,{children:r.jobs.map(t=>{const c=xs(t);return e.jsxs(H,{children:[e.jsx(T,{className:"align-top",children:e.jsx(ms,{status:t.status})}),e.jsxs(T,{className:"min-w-[260px] align-top",children:[e.jsx(Le,{to:`/paper/${encodeURIComponent(t.paper_route)}`,className:"font-medium hover:underline",children:t.paper_title}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["Paper #",t.paper_id]})]}),e.jsxs(T,{className:"whitespace-nowrap align-top",children:[os[t.kind],t.applied_at&&e.jsxs("div",{className:"mt-1 flex items-center gap-1 text-xs cron-status--healthy",children:[e.jsx(O,{className:"h-3.5 w-3.5"})," Applied"]})]}),e.jsxs(T,{className:"whitespace-nowrap align-top",children:[e.jsx("div",{children:_(t.created_at)}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["@",t.requested_by]})]}),e.jsxs(T,{className:"max-w-[360px] align-top",children:[t.hf_job_url?e.jsxs("a",{href:t.hf_job_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 hover:underline",children:["Hugging Face Job ",e.jsx(Z,{className:"h-3.5 w-3.5"})]}):e.jsx("span",{className:"cron-muted",children:"Waiting to dispatch"}),c&&e.jsx("p",{className:`mt-2 line-clamp-3 text-xs ${t.error?"text-red-700":"cron-muted"}`,title:c,children:c})]})]},t.id)})})]}),e.jsxs("p",{className:"mt-4 text-xs cron-muted",children:["Showing the 100 most recent jobs · Queue totals include full history · Updated ",_(r.timestamp)]})]})]})]})}const hs=()=>{var d,i,t;const s=Ae(),a=qe({queryKey:["catalog-audit"],queryFn:({pageParam:c})=>S.getCatalogAudit(c),initialPageParam:void 0,getNextPageParam:c=>c.next_cursor??void 0}),r=((d=a.data)==null?void 0:d.pages.flatMap(c=>c.events))??[],n=G({mutationFn:()=>S.acknowledgeCatalogAudit(),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})}),o=G({mutationFn:c=>S.rollbackCatalogEvent(c),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})});return e.jsx("div",{className:"space-y-4",children:e.jsxs(j,{children:[e.jsxs(b,{className:"flex-row items-center justify-between",children:[e.jsx(y,{children:"Catalog mutation audit"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm font-medium",children:[((t=(i=a.data)==null?void 0:i.pages[0])==null?void 0:t.unread_contributor_count)??0," unread contributor changes"]}),e.jsx(M,{variant:"outline",size:"sm",onClick:()=>n.mutate(),disabled:n.isPending,children:"Mark read"})]})]}),e.jsxs(N,{className:"space-y-3",children:[a.isLoading&&e.jsx("p",{children:"Loading audit history…"}),a.error&&e.jsx("p",{className:"text-destructive",children:"Audit history unavailable."}),r.map(c=>e.jsxs("article",{className:`rounded-md border p-3 ${c.operation==="delete"||c.rollback_eligible===!1?"border-red-500 bg-red-50/50":""}`,children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs("strong",{children:[c.operation," ",c.entity_type," ",c.entity_id]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["@",c.actor_username??c.actor_role," ·"," ",new Date(c.created_at).toLocaleString()]})]}),e.jsxs("details",{className:"mt-2 text-xs",children:[e.jsx("summary",{children:"Inspect snapshots"}),e.jsx("pre",{className:"mt-2 max-h-80 overflow-auto rounded bg-muted p-3",children:JSON.stringify({before:c.before,after:c.after},null,2)})]}),!c.rollback_of_event_id&&e.jsx(M,{className:"mt-3",variant:"outline",size:"sm",onClick:()=>o.mutate(c.id),disabled:o.isPending||c.rollback_eligible===!1,children:c.rollback_eligible===!1?"Rollback conflict":"Roll back if unchanged"})]},c.id)),a.hasNextPage&&e.jsx(M,{variant:"outline",onClick:()=>a.fetchNextPage(),disabled:a.isFetchingNextPage,children:a.isFetchingNextPage?"Loading…":"Load older events"})]})]})})},W={hourly:"cron-status--running",daily:"cron-status--healthy",weekly:"cron-status--degraded"},Rs=()=>{const[s,a]=m.useState(!0),[r,n]=m.useState(0),[o,d]=m.useState(new Set),{user:i}=Pe(),{data:t,isLoading:c,isFetching:g,error:x,refetch:h}=$({queryKey:["cronStatus",i==null?void 0:i.username],queryFn:()=>S.getCronStatus(),enabled:!!(i!=null&&i.is_admin),refetchInterval:s?3e4:!1,retry:!1}),f=$({queryKey:["paperMarkdownJobs",i==null?void 0:i.username],queryFn:()=>S.getPaperMarkdownJobs(),enabled:!!(i!=null&&i.is_admin),refetchInterval:s?3e4:!1,retry:!1}),ve=(x&&typeof x=="object"&&"status"in x?x.status:void 0)===401?"Unauthorized. Sign in with an allowlisted Hugging Face admin account.":x instanceof Error?x.message:void 0,be=l=>{d(v=>{const k=new Set(v);return k.has(l)?k.delete(l):k.add(l),k})},ye=(t==null?void 0:t.jobs.filter(l=>l.critical))??[],F=((t==null?void 0:t.jobs.filter(l=>!l.critical))??[]).reduce((l,v)=>(l[v.category]||(l[v.category]=[]),l[v.category].push(v),l),{}),we=Object.keys(F).sort((l,v)=>{const k=["hourly","daily","weekly"];return k.indexOf(l)-k.indexOf(v)}),B=l=>e.jsx(ns,{job:l,expanded:o.has(l.job_name),onToggle:()=>be(l.job_name),paperMarkdownJobs:l.job_name==="paper_markdown_backfill"?f.data:void 0,paperMarkdownJobsLoading:l.job_name==="paper_markdown_backfill"?f.isLoading:!1,paperMarkdownJobsError:l.job_name==="paper_markdown_backfill"?f.error:null},l.job_name),_e=()=>{n(l=>l+1),h(),f.refetch()};return e.jsx("div",{className:"cron-dashboard","data-shadcn":!0,children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[e.jsx("div",{className:"mb-8",children:e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-3xl font-bold flex items-center gap-3",children:[e.jsx(D,{className:"h-8 w-8 cron-info-text"}),"Admin Dashboard"]}),e.jsx("p",{className:"mt-2 cron-muted",children:"Paper curation queue and operational health for scheduled jobs"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(M,{variant:"outline",size:"sm",onClick:()=>a(!s),className:s?"cron-status--running":"",children:[e.jsx(V,{className:`h-4 w-4 mr-2 ${s?"animate-spin":""}`}),"Auto-refresh ",s?"ON":"OFF"]}),e.jsxs(M,{variant:"outline",size:"sm",onClick:_e,disabled:g,children:[e.jsx(V,{className:`h-4 w-4 mr-2 ${g?"animate-spin":""}`}),"Refresh"]})]})]})}),e.jsx(j,{className:"mb-6",children:e.jsx(N,{className:"pt-6",children:e.jsxs("p",{className:"text-sm cron-muted",children:["Signed in as ",e.jsxs("span",{className:"font-semibold",children:["@",i==null?void 0:i.username]}),". Health checks prefer database freshness over log completion so silent no-work failures surface as degraded or broken."]})})}),e.jsxs(Ze,{defaultValue:"critical-jobs",children:[e.jsxs(ue,{className:"grid w-full grid-cols-3 sm:w-auto",children:[e.jsx(L,{value:"critical-jobs",children:"Critical Jobs"}),e.jsx(L,{value:"codex-paper-jobs",children:"Codex Paper Jobs"}),e.jsx(L,{value:"catalog-audit",children:"Catalog Audit"})]}),e.jsxs(A,{value:"critical-jobs",className:"mt-6",children:[c&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(R,{className:"h-8 w-8 animate-spin cron-info-text"}),e.jsx("span",{className:"ml-3 cron-muted",children:"Loading CRON jobs status..."})]}),x&&e.jsx(j,{className:"cron-status--broken",children:e.jsx(N,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(P,{className:"h-5 w-5"}),e.jsx("p",{children:ve??"Failed to load CRON jobs status. Please try again."})]})})}),t&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4 mb-6",children:["healthy","degraded","broken","running","stuck","unknown"].map(l=>e.jsxs(j,{children:[e.jsx(b,{className:"pb-2",children:e.jsx(y,{className:"text-sm font-medium cron-muted capitalize",children:l})}),e.jsx(N,{children:e.jsx("div",{className:"text-2xl font-bold",children:t.summary[l]})})]},l))}),t.summary.critical_issues.length>0&&e.jsxs(j,{className:"mb-6 cron-status--broken",children:[e.jsx(b,{children:e.jsxs(y,{className:"flex items-center gap-2",children:[e.jsx(Je,{className:"h-5 w-5"}),"Critical job issues"]})}),e.jsx(N,{children:e.jsx("ul",{className:"list-disc pl-5 space-y-1 text-sm",children:t.summary.critical_issues.map(l=>e.jsx("li",{children:l},l))})})]}),e.jsxs(j,{className:"mb-8",children:[e.jsx(b,{children:e.jsx(y,{className:"text-base",children:"What to check next"})}),e.jsxs(N,{children:[e.jsx("p",{className:"text-sm cron-muted",children:t.summary.what_to_check_next}),e.jsxs("p",{className:"mt-2 text-xs cron-muted flex items-center gap-2",children:[e.jsx(Y,{className:"h-4 w-4"}),"Last updated: ",_(t.timestamp)," · Health score:"," ",t.summary.health_score.toFixed(0),"%"]})]})]}),e.jsxs(j,{className:"mb-8",children:[e.jsxs(b,{children:[e.jsx(y,{className:"text-xl",children:"Critical jobs"}),e.jsx(I,{children:"Writers whose stale output breaks the live site"})]}),e.jsx(N,{className:"space-y-4",children:ye.map(B)})]}),e.jsx("div",{className:"space-y-6",children:we.map(l=>e.jsxs(j,{children:[e.jsx(b,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(y,{className:"text-xl capitalize flex items-center gap-2",children:[e.jsx(w,{className:W[l]??W.hourly,children:l}),e.jsx("span",{children:"Supporting jobs"})]}),e.jsxs(I,{children:[F[l].length," job",F[l].length!==1?"s":""]})]})}),e.jsx(N,{className:"space-y-4",children:F[l].map(B)})]},l))})]})]}),e.jsx(A,{value:"codex-paper-jobs",className:"mt-6",children:e.jsx(us,{autoRefresh:s,refreshToken:r})}),e.jsx(A,{value:"catalog-audit",className:"mt-6",children:e.jsx(hs,{})})]})]})})};export{Rs as default};
assets/{ExternalSourceEvalBadge-B5FVP6Hj.js → ExternalSourceEvalBadge-BYtEDxNm.js} RENAMED
@@ -1 +1 @@
1
- import{j as e,L as l}from"./index-CIXevVP9.js";import{H as t,a as n,b as o}from"./hover-card-B7gdr0Iw.js";const u=()=>e.jsxs(t,{openDelay:120,closeDelay:120,children:[e.jsx(n,{asChild:!0,children:e.jsx("button",{type:"button",className:"bm-closed-source-tag","aria-label":"Closed-source model",children:"closed"})}),e.jsxs(o,{side:"top",align:"start",className:"w-auto max-w-[260px] p-3 text-sm leading-snug",children:["This is an evaluation of a closed-source model. You can disable viewing these in your"," ",e.jsx(l,{to:"/settings",className:"closed-eval-tooltip-link",children:"settings"}),"."]})]});function i(a){if(!a)return"Evaluation sourced outside this paper";const r=a.toLowerCase();if(r.includes("open-asr-leaderboard"))return"Open ASR Leaderboard";if(r.includes("arcprize.org"))return"ARC Prize Leaderboard";if(r.includes("frontierswe.com"))return"FrontierSWE";if(r.includes("deepswe.datacurve.ai"))return"DeepSWE";try{const s=new URL(a,"https://paperswithcode.co");return s.pathname.startsWith("/paper/")?"Source paper":s.hostname.replace(/^www\./,"")}catch{return a}}const p=({sourceUrl:a})=>{const r=i(a);return e.jsxs(t,{openDelay:120,closeDelay:120,children:[e.jsx(n,{asChild:!0,children:e.jsx("button",{type:"button",className:"bm-external-source-tag","aria-label":`Externally sourced evaluation: ${r}`,children:"External"})}),e.jsxs(o,{side:"top",align:"start",className:"w-auto max-w-[280px] p-3 text-sm leading-snug",children:["This score was sourced outside this paper.",a?e.jsxs(e.Fragment,{children:[" ",e.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:r}),"."]}):e.jsxs(e.Fragment,{children:[" ",r,"."]})]})]})};export{u as C,p as E};
 
1
+ import{j as e,L as l}from"./index-Bo5_2OqZ.js";import{H as t,a as n,b as o}from"./hover-card-DrtqDSb0.js";const u=()=>e.jsxs(t,{openDelay:120,closeDelay:120,children:[e.jsx(n,{asChild:!0,children:e.jsx("button",{type:"button",className:"bm-closed-source-tag","aria-label":"Closed-source model",children:"closed"})}),e.jsxs(o,{side:"top",align:"start",className:"w-auto max-w-[260px] p-3 text-sm leading-snug",children:["This is an evaluation of a closed-source model. You can disable viewing these in your"," ",e.jsx(l,{to:"/settings",className:"closed-eval-tooltip-link",children:"settings"}),"."]})]});function i(a){if(!a)return"Evaluation sourced outside this paper";const r=a.toLowerCase();if(r.includes("open-asr-leaderboard"))return"Open ASR Leaderboard";if(r.includes("arcprize.org"))return"ARC Prize Leaderboard";if(r.includes("frontierswe.com"))return"FrontierSWE";if(r.includes("deepswe.datacurve.ai"))return"DeepSWE";try{const s=new URL(a,"https://paperswithcode.co");return s.pathname.startsWith("/paper/")?"Source paper":s.hostname.replace(/^www\./,"")}catch{return a}}const p=({sourceUrl:a})=>{const r=i(a);return e.jsxs(t,{openDelay:120,closeDelay:120,children:[e.jsx(n,{asChild:!0,children:e.jsx("button",{type:"button",className:"bm-external-source-tag","aria-label":`Externally sourced evaluation: ${r}`,children:"External"})}),e.jsxs(o,{side:"top",align:"start",className:"w-auto max-w-[280px] p-3 text-sm leading-snug",children:["This score was sourced outside this paper.",a?e.jsxs(e.Fragment,{children:[" ",e.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:r}),"."]}):e.jsxs(e.Fragment,{children:[" ",r,"."]})]})]})};export{u as C,p as E};
assets/{FeedView-NfaOn3zx.js → FeedView-Dv1LDUAN.js} RENAMED
@@ -1 +1 @@
1
- import{u as O,r as p,j as e,a as H,L as _,i as F,b as E}from"./index-CIXevVP9.js";import{P as I}from"./components-BkZsumbI.js";import{P as q}from"./PaperFeedFilters-CNYrJoVb.js";import{D as U,M as $,F as K,A as B,q as W}from"./chatSessions-BnXlq2-W.js";import{S as g}from"./chatPrompts-CDY3UGU1.js";import{t as G,d as k}from"./transform-CNyzjv1G.js";import{u as z}from"./usePapers-B99b4fBf.js";import{u as Q}from"./useIntersectionObserver-BMoidOlM.js";import{P as V}from"./usePeriodFilter-BDxPrc4_.js";import{S as f}from"./skeleton-BQDYAJTf.js";import{A as X,a as Y}from"./alert-axJAQJuC.js";import{u as L}from"./useQuery-BHSsBDmJ.js";import"./LatexTitle-BmUg2c3G.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-DWMGlrsa.js";import"./useBaseQuery-BL30DOiU.js";const J=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],Z={Today:"today","This Week":"week","This Month":"month","All Time":"all_time"},ee={today:"Today",week:"This Week",month:"This Month",all_time:"All Time"},S=45,se=1800,te=25,ae=350,re=a=>{const[i,d]=p.useState(g[0].slice(0,1));return p.useEffect(()=>{var r,u;if(!a)return;if((u=(r=window.matchMedia)==null?void 0:r.call(window,"(prefers-reduced-motion: reduce)"))!=null&&u.matches){d(g[0]);return}let m=0,n=1,h=!1,o;d(g[0].slice(0,n));const l=()=>{const x=g[m];if(!h){if(n+=1,d(x.slice(0,n)),n===x.length){h=!0,o=window.setTimeout(l,se);return}o=window.setTimeout(l,S);return}if(n-=1,d(x.slice(0,n)),n===0){h=!1,m=(m+1)%g.length,o=window.setTimeout(l,ae);return}o=window.setTimeout(l,te)};return o=window.setTimeout(l,S),()=>window.clearTimeout(o)},[a]),i},ie=a=>a==="trending"||a==="date_published"||a==="citation_count"?a:"trending",ne=a=>a==="today"||a==="week"||a==="month"||a==="all_time"?a:"all_time",oe=()=>{const a=O(),[i,d]=p.useState(""),[m,n]=p.useState(U),h=re(!i),o=p.useRef(null);p.useEffect(()=>{const r=o.current;r&&(r.style.height="auto",r.style.height=`${Math.min(r.scrollHeight,160)}px`)},[i]);const l=(r=i)=>{const u=r.trim();u&&(W(u,m),a("/chat"))};return e.jsxs("div",{className:"ask-home",children:[e.jsx("textarea",{ref:o,rows:1,value:i,placeholder:h,"aria-label":"Ask the assistant",onChange:r=>d(r.target.value),onKeyDown:r=>{r.key==="Enter"&&!r.shiftKey&&(r.preventDefault(),l())}}),e.jsxs("div",{className:"ask-home-foot",children:[e.jsxs("div",{className:"ask-home-provider-tools",children:[e.jsx($,{models:K,selectedModel:m,onModelChange:n}),e.jsxs("span",{className:"ask-home-hint",children:["Via 🤗"," ",e.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"})]})]}),e.jsx("button",{type:"button",className:`chat-send${i.trim()?" chat-send-on":""}`,onClick:()=>l(),disabled:!i.trim(),"aria-label":"Ask the assistant",children:e.jsx(B,{})})]})]})},we=()=>{var b,w,v,P,A;const[a,i]=H(),d=ie(a.get("order_by")),m=ne(a.get("time")),n=a.get("has_code")==="true",h=a.get("has_hf_artifacts")==="true",o=ee[m],l=s=>{const t=new URLSearchParams(a);t.set("order_by",s),i(t)},r=s=>{const t=new URLSearchParams(a);t.set("time",Z[s]),i(t)},u=s=>{const t=new URLSearchParams(a);s?t.set("has_code","true"):t.delete("has_code"),i(t)},x=s=>{const t=new URLSearchParams(a);s?t.set("has_hf_artifacts","true"):t.delete("has_hf_artifacts"),i(t)},N=L({queryKey:["top-tasks-sidebar"],queryFn:()=>E.getTopTasks({limit:8}),staleTime:10*60*1e3}),j=L({queryKey:["trending-tasks-sidebar"],queryFn:()=>E.getTrendingTasks({limit:8,level:0}),staleTime:10*60*1e3}),c=z({page_size:30,order_by:d,order_dir:"desc",time:m,include_resources:!0,has_code:n,has_hf_artifacts:h}),y=p.useMemo(()=>{var t;return(((t=c.data)==null?void 0:t.pages.flatMap(R=>R.results))||[]).map(G)},[c.data]),{targetRef:C,isIntersecting:T}=Q({rootMargin:"400px"});p.useEffect(()=>{T&&c.hasNextPage&&!c.isFetchingNextPage&&c.fetchNextPage()},[T,c.hasNextPage,c.isFetchingNextPage]);const M=c.isLoading,D=c.error;return e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Trending ",e.jsx("em",{children:"Research"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated daily from arXiv and Hugging Face"})]})}),e.jsxs("div",{className:"layout-with-sidebar",children:[e.jsxs("aside",{className:"sidebar",children:[e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),N.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,t)=>e.jsx(f,{className:"h-5 w-full"},t))}),(b=N.data)==null?void 0:b.map(s=>e.jsxs(_,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[k(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id)),e.jsx(_,{to:"/tasks",className:"sidebar-link",style:{marginTop:8,fontStyle:"italic"},children:"all domains →"})]}),e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Trending Domains"}),j.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,t)=>e.jsx(f,{className:"h-5 w-full"},t))}),((v=(w=j.data)==null?void 0:w.results)==null?void 0:v.length)===0&&!j.isLoading&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"No domains gaining momentum right now."}),(A=(P=j.data)==null?void 0:P.results)==null?void 0:A.map(s=>e.jsxs(_,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[k(s.name,s.slug),e.jsxs("span",{className:"count",children:[s.share_lift.toFixed(1),"x"]})]},s.id))]})]}),e.jsxs("div",{children:[F()&&e.jsx(oe,{}),e.jsxs("div",{className:"sort-bar home-feed-sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:J.map(([s,t])=>e.jsx("button",{className:`sort-btn ${d===s?"active":""}`,onClick:()=>l(s),children:t},s))}),e.jsx(q,{hasCode:n,hasHfArtifacts:h,onHasCodeChange:u,onHasHfArtifactsChange:x})]}),e.jsx("div",{className:"sort-options sort-options-time",children:V.map(s=>e.jsx("button",{className:`sort-btn sort-btn-time ${o===s?"active":""}`,onClick:()=>r(s),children:s},s))})]}),D&&e.jsx(X,{variant:"destructive",className:"mb-4",children:e.jsx(Y,{children:"Failed to load papers. Please try again."})}),M?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,t)=>e.jsxs("div",{className:"paper-card",children:[e.jsx("div",{className:"paper-thumb-wrap",children:e.jsx(f,{className:"paper-thumb-skeleton"})}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(f,{className:"h-6 w-3/4"}),e.jsx(f,{className:"h-4 w-1/2"}),e.jsx(f,{className:"h-12 w-full"})]})]},t))}):y.length===0?e.jsx("div",{className:"no-results",children:"No papers in this window."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:y.map((s,t)=>e.jsx(I,{paper:s,rank:t+1},s.id))}),e.jsx("div",{ref:C,style:{height:1}}),c.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})};export{oe as AskAssistant,we as default};
 
1
+ import{u as O,r as p,j as e,a as H,L as _,i as F,b as E}from"./index-Bo5_2OqZ.js";import{P as I}from"./components-BbXgE2lV.js";import{P as q}from"./PaperFeedFilters-D2TbUu0j.js";import{D as U,M as $,F as K,A as B,q as W}from"./chatSessions-Dz4Iu-O1.js";import{S as g}from"./chatPrompts-CDY3UGU1.js";import{t as G,d as k}from"./transform-2Gnjg1jt.js";import{u as z}from"./usePapers-CdB1OuZ5.js";import{u as Q}from"./useIntersectionObserver-7HCpY83L.js";import{P as V}from"./usePeriodFilter-DK_4NHrn.js";import{S as f}from"./skeleton-CB-heJjl.js";import{A as X,a as Y}from"./alert-_EYQlDHA.js";import{u as L}from"./useQuery-Bh9FZQpL.js";import"./LatexTitle-qoY4vrTZ.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-CzzYUeDW.js";import"./useBaseQuery-B8T7kRNC.js";const J=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],Z={Today:"today","This Week":"week","This Month":"month","All Time":"all_time"},ee={today:"Today",week:"This Week",month:"This Month",all_time:"All Time"},S=45,se=1800,te=25,ae=350,re=a=>{const[i,d]=p.useState(g[0].slice(0,1));return p.useEffect(()=>{var r,u;if(!a)return;if((u=(r=window.matchMedia)==null?void 0:r.call(window,"(prefers-reduced-motion: reduce)"))!=null&&u.matches){d(g[0]);return}let m=0,n=1,h=!1,o;d(g[0].slice(0,n));const l=()=>{const x=g[m];if(!h){if(n+=1,d(x.slice(0,n)),n===x.length){h=!0,o=window.setTimeout(l,se);return}o=window.setTimeout(l,S);return}if(n-=1,d(x.slice(0,n)),n===0){h=!1,m=(m+1)%g.length,o=window.setTimeout(l,ae);return}o=window.setTimeout(l,te)};return o=window.setTimeout(l,S),()=>window.clearTimeout(o)},[a]),i},ie=a=>a==="trending"||a==="date_published"||a==="citation_count"?a:"trending",ne=a=>a==="today"||a==="week"||a==="month"||a==="all_time"?a:"all_time",oe=()=>{const a=O(),[i,d]=p.useState(""),[m,n]=p.useState(U),h=re(!i),o=p.useRef(null);p.useEffect(()=>{const r=o.current;r&&(r.style.height="auto",r.style.height=`${Math.min(r.scrollHeight,160)}px`)},[i]);const l=(r=i)=>{const u=r.trim();u&&(W(u,m),a("/chat"))};return e.jsxs("div",{className:"ask-home",children:[e.jsx("textarea",{ref:o,rows:1,value:i,placeholder:h,"aria-label":"Ask the assistant",onChange:r=>d(r.target.value),onKeyDown:r=>{r.key==="Enter"&&!r.shiftKey&&(r.preventDefault(),l())}}),e.jsxs("div",{className:"ask-home-foot",children:[e.jsxs("div",{className:"ask-home-provider-tools",children:[e.jsx($,{models:K,selectedModel:m,onModelChange:n}),e.jsxs("span",{className:"ask-home-hint",children:["Via 🤗"," ",e.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"})]})]}),e.jsx("button",{type:"button",className:`chat-send${i.trim()?" chat-send-on":""}`,onClick:()=>l(),disabled:!i.trim(),"aria-label":"Ask the assistant",children:e.jsx(B,{})})]})]})},we=()=>{var b,w,v,P,A;const[a,i]=H(),d=ie(a.get("order_by")),m=ne(a.get("time")),n=a.get("has_code")==="true",h=a.get("has_hf_artifacts")==="true",o=ee[m],l=s=>{const t=new URLSearchParams(a);t.set("order_by",s),i(t)},r=s=>{const t=new URLSearchParams(a);t.set("time",Z[s]),i(t)},u=s=>{const t=new URLSearchParams(a);s?t.set("has_code","true"):t.delete("has_code"),i(t)},x=s=>{const t=new URLSearchParams(a);s?t.set("has_hf_artifacts","true"):t.delete("has_hf_artifacts"),i(t)},N=L({queryKey:["top-tasks-sidebar"],queryFn:()=>E.getTopTasks({limit:8}),staleTime:10*60*1e3}),j=L({queryKey:["trending-tasks-sidebar"],queryFn:()=>E.getTrendingTasks({limit:8,level:0}),staleTime:10*60*1e3}),c=z({page_size:30,order_by:d,order_dir:"desc",time:m,include_resources:!0,has_code:n,has_hf_artifacts:h}),y=p.useMemo(()=>{var t;return(((t=c.data)==null?void 0:t.pages.flatMap(R=>R.results))||[]).map(G)},[c.data]),{targetRef:C,isIntersecting:T}=Q({rootMargin:"400px"});p.useEffect(()=>{T&&c.hasNextPage&&!c.isFetchingNextPage&&c.fetchNextPage()},[T,c.hasNextPage,c.isFetchingNextPage]);const M=c.isLoading,D=c.error;return e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Trending ",e.jsx("em",{children:"Research"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated daily from arXiv and Hugging Face"})]})}),e.jsxs("div",{className:"layout-with-sidebar",children:[e.jsxs("aside",{className:"sidebar",children:[e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),N.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,t)=>e.jsx(f,{className:"h-5 w-full"},t))}),(b=N.data)==null?void 0:b.map(s=>e.jsxs(_,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[k(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id)),e.jsx(_,{to:"/tasks",className:"sidebar-link",style:{marginTop:8,fontStyle:"italic"},children:"all domains →"})]}),e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Trending Domains"}),j.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,t)=>e.jsx(f,{className:"h-5 w-full"},t))}),((v=(w=j.data)==null?void 0:w.results)==null?void 0:v.length)===0&&!j.isLoading&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"No domains gaining momentum right now."}),(A=(P=j.data)==null?void 0:P.results)==null?void 0:A.map(s=>e.jsxs(_,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[k(s.name,s.slug),e.jsxs("span",{className:"count",children:[s.share_lift.toFixed(1),"x"]})]},s.id))]})]}),e.jsxs("div",{children:[F()&&e.jsx(oe,{}),e.jsxs("div",{className:"sort-bar home-feed-sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:J.map(([s,t])=>e.jsx("button",{className:`sort-btn ${d===s?"active":""}`,onClick:()=>l(s),children:t},s))}),e.jsx(q,{hasCode:n,hasHfArtifacts:h,onHasCodeChange:u,onHasHfArtifactsChange:x})]}),e.jsx("div",{className:"sort-options sort-options-time",children:V.map(s=>e.jsx("button",{className:`sort-btn sort-btn-time ${o===s?"active":""}`,onClick:()=>r(s),children:s},s))})]}),D&&e.jsx(X,{variant:"destructive",className:"mb-4",children:e.jsx(Y,{children:"Failed to load papers. Please try again."})}),M?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,t)=>e.jsxs("div",{className:"paper-card",children:[e.jsx("div",{className:"paper-thumb-wrap",children:e.jsx(f,{className:"paper-thumb-skeleton"})}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(f,{className:"h-6 w-3/4"}),e.jsx(f,{className:"h-4 w-1/2"}),e.jsx(f,{className:"h-12 w-full"})]})]},t))}):y.length===0?e.jsx("div",{className:"no-results",children:"No papers in this window."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:y.map((s,t)=>e.jsx(I,{paper:s,rank:t+1},s.id))}),e.jsx("div",{ref:C,style:{height:1}}),c.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})};export{oe as AskAssistant,we as default};
assets/{FrameworksIndexView-D-I30wVq.js → FrameworksIndexView-DaHgLjlV.js} RENAMED
@@ -1 +1 @@
1
- import{R as c,j as e,L as d,b as m}from"./index-CIXevVP9.js";import{u as h}from"./useQuery-BHSsBDmJ.js";import{I as g}from"./components-BkZsumbI.js";import{e as p,h as u}from"./transform-CNyzjv1G.js";import"./useBaseQuery-BL30DOiU.js";import"./LatexTitle-BmUg2c3G.js";import"./katex.min-BSBacQyE.js";const f={gpu:"GPU",cpu:"CPU",apple:"Apple silicon"},x={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},j={fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},v={fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},k={fontFamily:"var(--mono)",fontSize:13,fontWeight:600,letterSpacing:"0.04em",textTransform:"uppercase",color:"var(--ink)",marginBottom:6},w=({platform:r})=>{const i=p(u(r));return e.jsx("span",{className:"framework-platform-chip",style:{background:i.bg,color:i.text},children:f[r]})},_=({framework:r})=>e.jsxs("article",{id:`framework-${r.slug}`,className:"framework-card",children:[e.jsxs("div",{className:"framework-card-head",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"framework-card-name",children:r.name}),r.organization_name&&e.jsx("div",{className:"framework-card-org",children:r.organization_name})]}),r.platforms&&r.platforms.length>0&&e.jsx("div",{className:"framework-platform-row",children:r.platforms.map(i=>e.jsx(w,{platform:i},i))})]}),e.jsx("p",{className:"framework-card-desc",children:r.description}),r.when_to_use&&e.jsxs("div",{className:"framework-card-when",children:[e.jsx("span",{className:"framework-card-when-label",children:"When to use"}),r.when_to_use]}),(r.github_url||r.docs_url||r.introducing_paper_arxiv_id)&&e.jsxs("div",{className:"framework-card-links",children:[r.introducing_paper_arxiv_id&&e.jsx(d,{to:`/paper/${r.introducing_paper_arxiv_id}`,className:"framework-link",children:"Paper"}),r.github_url&&e.jsxs("a",{href:r.github_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:[e.jsx(g,{name:"github",size:13}),"GitHub"]}),r.docs_url&&r.docs_url!==r.github_url&&e.jsx("a",{href:r.docs_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:"Docs"})]})]}),B=()=>{var l;const r=h({queryKey:["framework-catalog"],queryFn:()=>m.getFrameworkCatalog()}),i=((l=r.data)==null?void 0:l.domains)??[],o=i.reduce((a,s)=>a+s.categories.reduce((n,t)=>n+t.frameworks.length,0),0);return c.useEffect(()=>{var s;const a=window.location.hash.slice(1);a&&((s=document.getElementById(a))==null||s.scrollIntoView())},[r.data]),e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["AI ",e.jsx("em",{children:"Frameworks"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated libraries and tools to run, serve, and train models — pick the right stack for your hardware and workload."})]})}),r.isLoading&&e.jsx("div",{className:"empty",children:"Loading frameworks…"}),r.isError&&e.jsx("div",{className:"empty",children:"Could not load frameworks."}),i.map(a=>e.jsxs("section",{style:{marginBottom:56},children:[e.jsxs("div",{style:x,children:[e.jsxs("div",{children:[e.jsx("h2",{style:j,children:a.name}),e.jsx("div",{style:v,children:a.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[a.categories.length," ",a.categories.length===1?"category":"categories"," ·"," ",a.categories.reduce((s,n)=>s+n.frameworks.length,0)," frameworks"]})]}),a.categories.map(s=>e.jsxs("div",{className:"framework-category",children:[e.jsxs("div",{className:"framework-category-head",children:[e.jsxs("div",{children:[e.jsx("h3",{style:k,children:s.name}),s.description&&e.jsx("p",{className:"framework-category-blurb",children:s.description}),s.guide_url&&e.jsxs("a",{href:s.guide_url,target:"_blank",rel:"noopener noreferrer",className:"framework-guide-link",children:[s.guide_label??"Read guide"," →"]})]}),e.jsxs("div",{className:"framework-category-meta",children:[s.frameworks.length," ",s.frameworks.length===1?"framework":"frameworks"]})]}),e.jsx("div",{className:"framework-grid",children:s.frameworks.map(n=>e.jsx(_,{framework:n},n.slug))})]},s.slug))]},a.slug)),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:8},children:[o," frameworks across ",i.length," ",i.length===1?"domain":"domains",". More areas coming soon."]})]})};export{B as default};
 
1
+ import{R as c,j as e,L as d,b as m}from"./index-Bo5_2OqZ.js";import{u as h}from"./useQuery-Bh9FZQpL.js";import{I as g}from"./components-BbXgE2lV.js";import{e as p,h as u}from"./transform-2Gnjg1jt.js";import"./useBaseQuery-B8T7kRNC.js";import"./LatexTitle-qoY4vrTZ.js";import"./katex.min-BSBacQyE.js";const f={gpu:"GPU",cpu:"CPU",apple:"Apple silicon"},x={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},j={fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},v={fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},k={fontFamily:"var(--mono)",fontSize:13,fontWeight:600,letterSpacing:"0.04em",textTransform:"uppercase",color:"var(--ink)",marginBottom:6},w=({platform:r})=>{const i=p(u(r));return e.jsx("span",{className:"framework-platform-chip",style:{background:i.bg,color:i.text},children:f[r]})},_=({framework:r})=>e.jsxs("article",{id:`framework-${r.slug}`,className:"framework-card",children:[e.jsxs("div",{className:"framework-card-head",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"framework-card-name",children:r.name}),r.organization_name&&e.jsx("div",{className:"framework-card-org",children:r.organization_name})]}),r.platforms&&r.platforms.length>0&&e.jsx("div",{className:"framework-platform-row",children:r.platforms.map(i=>e.jsx(w,{platform:i},i))})]}),e.jsx("p",{className:"framework-card-desc",children:r.description}),r.when_to_use&&e.jsxs("div",{className:"framework-card-when",children:[e.jsx("span",{className:"framework-card-when-label",children:"When to use"}),r.when_to_use]}),(r.github_url||r.docs_url||r.introducing_paper_arxiv_id)&&e.jsxs("div",{className:"framework-card-links",children:[r.introducing_paper_arxiv_id&&e.jsx(d,{to:`/paper/${r.introducing_paper_arxiv_id}`,className:"framework-link",children:"Paper"}),r.github_url&&e.jsxs("a",{href:r.github_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:[e.jsx(g,{name:"github",size:13}),"GitHub"]}),r.docs_url&&r.docs_url!==r.github_url&&e.jsx("a",{href:r.docs_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:"Docs"})]})]}),B=()=>{var l;const r=h({queryKey:["framework-catalog"],queryFn:()=>m.getFrameworkCatalog()}),i=((l=r.data)==null?void 0:l.domains)??[],o=i.reduce((a,s)=>a+s.categories.reduce((n,t)=>n+t.frameworks.length,0),0);return c.useEffect(()=>{var s;const a=window.location.hash.slice(1);a&&((s=document.getElementById(a))==null||s.scrollIntoView())},[r.data]),e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["AI ",e.jsx("em",{children:"Frameworks"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated libraries and tools to run, serve, and train models — pick the right stack for your hardware and workload."})]})}),r.isLoading&&e.jsx("div",{className:"empty",children:"Loading frameworks…"}),r.isError&&e.jsx("div",{className:"empty",children:"Could not load frameworks."}),i.map(a=>e.jsxs("section",{style:{marginBottom:56},children:[e.jsxs("div",{style:x,children:[e.jsxs("div",{children:[e.jsx("h2",{style:j,children:a.name}),e.jsx("div",{style:v,children:a.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[a.categories.length," ",a.categories.length===1?"category":"categories"," ·"," ",a.categories.reduce((s,n)=>s+n.frameworks.length,0)," frameworks"]})]}),a.categories.map(s=>e.jsxs("div",{className:"framework-category",children:[e.jsxs("div",{className:"framework-category-head",children:[e.jsxs("div",{children:[e.jsx("h3",{style:k,children:s.name}),s.description&&e.jsx("p",{className:"framework-category-blurb",children:s.description}),s.guide_url&&e.jsxs("a",{href:s.guide_url,target:"_blank",rel:"noopener noreferrer",className:"framework-guide-link",children:[s.guide_label??"Read guide"," →"]})]}),e.jsxs("div",{className:"framework-category-meta",children:[s.frameworks.length," ",s.frameworks.length===1?"framework":"frameworks"]})]}),e.jsx("div",{className:"framework-grid",children:s.frameworks.map(n=>e.jsx(_,{framework:n},n.slug))})]},s.slug))]},a.slug)),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:8},children:[o," frameworks across ",i.length," ",i.length===1?"domain":"domains",". More areas coming soon."]})]})};export{B as default};
assets/{LatexTitle-BmUg2c3G.js → LatexTitle-qoY4vrTZ.js} RENAMED
@@ -1 +1 @@
1
- import{j as o,r as g}from"./index-CIXevVP9.js";import{k as T}from"./katex.min-BSBacQyE.js";const j=new Set([",",";",":","!"," ","quad","qquad","enspace","thinspace"]),C={a:"á",e:"é",i:"í",o:"ó",u:"ú",y:"ý",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú",Y:"Ý"},M={a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"},_={a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"},b={a:"ä",e:"ë",i:"ï",o:"ö",u:"ü",y:"ÿ",A:"Ä",E:"Ë",I:"Ï",O:"Ö",U:"Ü",Y:"Ÿ"},O={"'":C,"`":M,"^":_,'"':b,"~":{n:"ñ",N:"Ñ"}},E={ss:"ß",ae:"æ",AE:"Æ",oe:"œ",OE:"Œ",o:"ø",O:"Ø",l:"ł",L:"Ł"};function S(e,s){var n;return((n=O[e])==null?void 0:n[s])??null}function N(e){const s=[];let n=0,i="";const l=()=>{i&&(s.push({type:"text",content:i}),i="")};for(;n<e.length;){if(e[n]==="$"&&e[n+1]==="$"){l();const t=e.indexOf("$$",n+2);if(t===-1){i+=e.slice(n);break}s.push({type:"display",content:e.slice(n+2,t)}),n=t+2;continue}if(e[n]==="$"){l();const t=e.indexOf("$",n+1);if(t===-1){i+=e.slice(n);break}s.push({type:"inline",content:e.slice(n+1,t)}),n=t+1;continue}i+=e[n],n+=1}return l(),s}function d(e,s){if(e[s]!=="{")return null;let n=0;for(let i=s;i<e.length;i+=1)if(e[i]==="{")n+=1;else if(e[i]==="}"&&(n-=1,n===0))return{content:e.slice(s+1,i),end:i+1};return null}function $(e,s){let n=s+1;if(n>=e.length)return{name:"",end:n};if(!/[a-zA-Z]/.test(e[n]))return{name:e[n],end:n+1};const i=n;for(;n<e.length&&/[a-zA-Z]/.test(e[n]);)n+=1;return{name:e.slice(i,n),end:n}}function w(e,s){const n=e[s];if(n!=="^"&&n!=="_"||s+1>=e.length)return null;if(e[s+1]==="{"){const i=d(e,s+1);return i?{end:i.end}:null}return/[A-Za-z0-9+\-=.]/.test(e[s+1])?{end:s+2}:null}function y(e,s){let n=s;if(e[n]==="\\"){const{name:t,end:a}=$(e,n);if(!t)return null;if(n=a,e[n]==="{"){const f=d(e,n);f&&(n=f.end)}}else if(/[A-Za-z0-9]/.test(e[n])){let t=n+1;for(;t<e.length&&/[A-Za-z0-9]/.test(e[t]);)t+=1;if(e[t]!=="^"&&e[t]!=="_")return null;n=t}else return null;const i=s;let l=0;for(;n<e.length;){const t=w(e,n);if(!t)break;l+=1,n=t.end}return l===0?null:{latex:e.slice(i,n),end:n}}function p(e,s){const n=[];let i=0,l=0;const t=()=>`${s}-${l++}`,a=(f,u)=>f==="strong"?o.jsx("strong",{children:u},t()):o.jsx("em",{children:u},t());for(;i<e.length;){if(e[i]==="\\"){const{name:c,end:L}=$(e,i);if(i=L,E[c]){n.push(E[c]);continue}if(c.length===1&&i<e.length&&/[A-Za-z]/.test(e[i])){const r=S(c,e[i]);if(r){n.push(r),i+=1;continue}}if(c==="c"){const r=d(e,i);if((r==null?void 0:r.content.length)===1){const h={c:"ç",C:"Ç"}[r.content];if(h){n.push(h),i=r.end;continue}}}if(c==="textbf"||c==="mathbf"){const r=d(e,i);if(r){i=r.end,n.push(a("strong",p(r.content,t())));continue}}if(c==="emph"||c==="textit"||c==="textsl"||c==="texttt"){const r=d(e,i);if(r){i=r.end,n.push(a("em",p(r.content,t())));continue}}if(c==="color"||c==="textcolor"){const r=d(e,i);if(r){i=r.end;const h=d(e,i);h&&(i=h.end,n.push(...p(h.content,t())));continue}}if(j.has(c)){n.push(" ");continue}if(c==="~"){n.push(" ");continue}const m=d(e,i);if(m){i=m.end,n.push(...p(m.content,t()));continue}n.push(`\\${c}`);continue}if(e[i]==="~"){n.push(" "),i+=1;continue}const f=y(e,i);if(f){n.push(o.jsx(A,{latex:f.latex,display:!1},t())),i=f.end;continue}let u=i;for(;u<e.length&&e[u]!=="\\"&&e[u]!=="~"&&!y(e,u);)u+=1;u>i&&n.push(e.slice(i,u)),i=u}return n}function A({latex:e,display:s}){const n=g.useMemo(()=>{try{return T.renderToString(e.trim(),{displayMode:s,throwOnError:!1})}catch{return null}},[e,s]);return n?o.jsx("span",{className:s?"katex-display":void 0,dangerouslySetInnerHTML:{__html:n}}):o.jsx(o.Fragment,{children:s?`$$${e}$$`:`$${e}$`})}function k(e){const s=N(e),n=[];return s.forEach((i,l)=>{const t=`latex-${l}`;if(i.type==="text"){const a=p(i.content,t);a.length===1?n.push(a[0]):a.length>1&&n.push(o.jsx(g.Fragment,{children:a},t));return}if(i.type==="display"){n.push(o.jsx(A,{latex:i.content,display:!0},t));return}n.push(o.jsx(A,{latex:i.content,display:!1},t))}),n.length===1?n[0]:o.jsx(o.Fragment,{children:n})}const U=({text:e,className:s=""})=>{const n=g.useMemo(()=>k(e),[e]);return o.jsx("span",{className:s,children:n})},X=({title:e,className:s=""})=>o.jsx(U,{text:e,className:s});export{X as L,U as a};
 
1
+ import{j as o,r as g}from"./index-Bo5_2OqZ.js";import{k as T}from"./katex.min-BSBacQyE.js";const j=new Set([",",";",":","!"," ","quad","qquad","enspace","thinspace"]),C={a:"á",e:"é",i:"í",o:"ó",u:"ú",y:"ý",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú",Y:"Ý"},M={a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"},_={a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"},b={a:"ä",e:"ë",i:"ï",o:"ö",u:"ü",y:"ÿ",A:"Ä",E:"Ë",I:"Ï",O:"Ö",U:"Ü",Y:"Ÿ"},O={"'":C,"`":M,"^":_,'"':b,"~":{n:"ñ",N:"Ñ"}},E={ss:"ß",ae:"æ",AE:"Æ",oe:"œ",OE:"Œ",o:"ø",O:"Ø",l:"ł",L:"Ł"};function S(e,s){var n;return((n=O[e])==null?void 0:n[s])??null}function N(e){const s=[];let n=0,i="";const l=()=>{i&&(s.push({type:"text",content:i}),i="")};for(;n<e.length;){if(e[n]==="$"&&e[n+1]==="$"){l();const t=e.indexOf("$$",n+2);if(t===-1){i+=e.slice(n);break}s.push({type:"display",content:e.slice(n+2,t)}),n=t+2;continue}if(e[n]==="$"){l();const t=e.indexOf("$",n+1);if(t===-1){i+=e.slice(n);break}s.push({type:"inline",content:e.slice(n+1,t)}),n=t+1;continue}i+=e[n],n+=1}return l(),s}function d(e,s){if(e[s]!=="{")return null;let n=0;for(let i=s;i<e.length;i+=1)if(e[i]==="{")n+=1;else if(e[i]==="}"&&(n-=1,n===0))return{content:e.slice(s+1,i),end:i+1};return null}function $(e,s){let n=s+1;if(n>=e.length)return{name:"",end:n};if(!/[a-zA-Z]/.test(e[n]))return{name:e[n],end:n+1};const i=n;for(;n<e.length&&/[a-zA-Z]/.test(e[n]);)n+=1;return{name:e.slice(i,n),end:n}}function w(e,s){const n=e[s];if(n!=="^"&&n!=="_"||s+1>=e.length)return null;if(e[s+1]==="{"){const i=d(e,s+1);return i?{end:i.end}:null}return/[A-Za-z0-9+\-=.]/.test(e[s+1])?{end:s+2}:null}function y(e,s){let n=s;if(e[n]==="\\"){const{name:t,end:a}=$(e,n);if(!t)return null;if(n=a,e[n]==="{"){const f=d(e,n);f&&(n=f.end)}}else if(/[A-Za-z0-9]/.test(e[n])){let t=n+1;for(;t<e.length&&/[A-Za-z0-9]/.test(e[t]);)t+=1;if(e[t]!=="^"&&e[t]!=="_")return null;n=t}else return null;const i=s;let l=0;for(;n<e.length;){const t=w(e,n);if(!t)break;l+=1,n=t.end}return l===0?null:{latex:e.slice(i,n),end:n}}function p(e,s){const n=[];let i=0,l=0;const t=()=>`${s}-${l++}`,a=(f,u)=>f==="strong"?o.jsx("strong",{children:u},t()):o.jsx("em",{children:u},t());for(;i<e.length;){if(e[i]==="\\"){const{name:c,end:L}=$(e,i);if(i=L,E[c]){n.push(E[c]);continue}if(c.length===1&&i<e.length&&/[A-Za-z]/.test(e[i])){const r=S(c,e[i]);if(r){n.push(r),i+=1;continue}}if(c==="c"){const r=d(e,i);if((r==null?void 0:r.content.length)===1){const h={c:"ç",C:"Ç"}[r.content];if(h){n.push(h),i=r.end;continue}}}if(c==="textbf"||c==="mathbf"){const r=d(e,i);if(r){i=r.end,n.push(a("strong",p(r.content,t())));continue}}if(c==="emph"||c==="textit"||c==="textsl"||c==="texttt"){const r=d(e,i);if(r){i=r.end,n.push(a("em",p(r.content,t())));continue}}if(c==="color"||c==="textcolor"){const r=d(e,i);if(r){i=r.end;const h=d(e,i);h&&(i=h.end,n.push(...p(h.content,t())));continue}}if(j.has(c)){n.push(" ");continue}if(c==="~"){n.push(" ");continue}const m=d(e,i);if(m){i=m.end,n.push(...p(m.content,t()));continue}n.push(`\\${c}`);continue}if(e[i]==="~"){n.push(" "),i+=1;continue}const f=y(e,i);if(f){n.push(o.jsx(A,{latex:f.latex,display:!1},t())),i=f.end;continue}let u=i;for(;u<e.length&&e[u]!=="\\"&&e[u]!=="~"&&!y(e,u);)u+=1;u>i&&n.push(e.slice(i,u)),i=u}return n}function A({latex:e,display:s}){const n=g.useMemo(()=>{try{return T.renderToString(e.trim(),{displayMode:s,throwOnError:!1})}catch{return null}},[e,s]);return n?o.jsx("span",{className:s?"katex-display":void 0,dangerouslySetInnerHTML:{__html:n}}):o.jsx(o.Fragment,{children:s?`$$${e}$$`:`$${e}$`})}function k(e){const s=N(e),n=[];return s.forEach((i,l)=>{const t=`latex-${l}`;if(i.type==="text"){const a=p(i.content,t);a.length===1?n.push(a[0]):a.length>1&&n.push(o.jsx(g.Fragment,{children:a},t));return}if(i.type==="display"){n.push(o.jsx(A,{latex:i.content,display:!0},t));return}n.push(o.jsx(A,{latex:i.content,display:!1},t))}),n.length===1?n[0]:o.jsx(o.Fragment,{children:n})}const U=({text:e,className:s=""})=>{const n=g.useMemo(()=>k(e),[e]);return o.jsx("span",{className:s,children:n})},X=({title:e,className:s=""})=>o.jsx(U,{text:e,className:s});export{X as L,U as a};
assets/{MarkdownText-DgCJo7yQ.js → MarkdownText-VH1HEGnz.js} RENAMED
@@ -1 +1 @@
1
- import{U as l,j as s,L as u}from"./index-CIXevVP9.js";import"./katex.min-BSBacQyE.js";import{r as p,a as m,P as h}from"./PaperPreviewLink-C7g07Bf-.js";import{M as d,r as w}from"./index-CDHG1Gvn.js";const x=new Set(["paperswithcode.co","www.paperswithcode.co","localhost","127.0.0.1","167.235.148.241"]),P=["/methods","/paper","/papers","/tasks","/benchmark","/conferences"];function f(n,o=window.location.origin){if(!n)return null;let t;if(n.startsWith("/"))t=n;else try{const r=new URL(n,o);if(!x.has(r.hostname))return null;t=`${r.pathname}${r.search}${r.hash}`}catch{return null}const e=t.split(/[?#]/,1)[0];return P.some(r=>e===r||e.startsWith(`${r}/`))?t:null}function k(n){const t=n.split(/[?#]/,1)[0].match(/^\/papers?\/([^/]+)$/);if(!t||t[1].includes("%"))return null;const e=t[1],r=/^\d{4}[.-]\d{4,5}(?:v\d+)?$/.test(e),a=/^[1-9]\d*$/.test(e);return!r&&!a?null:l(e)}const E=({text:n,className:o=""})=>s.jsx("div",{className:o,children:s.jsx(d,{remarkPlugins:[w,m],rehypePlugins:[p],components:{a:({href:t,children:e,node:r,...a})=>{const i=f(t);if(i){const c=k(i);return c?s.jsx(h,{routeId:c,to:i,...a,children:e}):s.jsx(u,{to:i,...a,children:e})}return s.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",...a,children:e})}},children:n})});export{E as M};
 
1
+ import{U as l,j as s,L as u}from"./index-Bo5_2OqZ.js";import"./katex.min-BSBacQyE.js";import{r as p,a as m,P as h}from"./PaperPreviewLink-DTmodbgi.js";import{M as d,r as w}from"./index-C-0CcYmz.js";const x=new Set(["paperswithcode.co","www.paperswithcode.co","localhost","127.0.0.1","167.235.148.241"]),P=["/methods","/paper","/papers","/tasks","/benchmark","/conferences"];function f(n,o=window.location.origin){if(!n)return null;let t;if(n.startsWith("/"))t=n;else try{const r=new URL(n,o);if(!x.has(r.hostname))return null;t=`${r.pathname}${r.search}${r.hash}`}catch{return null}const e=t.split(/[?#]/,1)[0];return P.some(r=>e===r||e.startsWith(`${r}/`))?t:null}function k(n){const t=n.split(/[?#]/,1)[0].match(/^\/papers?\/([^/]+)$/);if(!t||t[1].includes("%"))return null;const e=t[1],r=/^\d{4}[.-]\d{4,5}(?:v\d+)?$/.test(e),a=/^[1-9]\d*$/.test(e);return!r&&!a?null:l(e)}const E=({text:n,className:o=""})=>s.jsx("div",{className:o,children:s.jsx(d,{remarkPlugins:[w,m],rehypePlugins:[p],components:{a:({href:t,children:e,node:r,...a})=>{const i=f(t);if(i){const c=k(i);return c?s.jsx(h,{routeId:c,to:i,...a,children:e}):s.jsx(u,{to:i,...a,children:e})}return s.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",...a,children:e})}},children:n})});export{E as M};
assets/{MethodDetailView-BJcjt5Vn.js → MethodDetailView-M4qvY74O.js} RENAMED
@@ -1 +1 @@
1
- import{j as e,r as E,e as W,a as V,L as R,b as v,al as Z}from"./index-CIXevVP9.js";import{u as A}from"./useQuery-BHSsBDmJ.js";import{u as X}from"./useInfiniteQuery-DWMGlrsa.js";import{M as Y,P as J}from"./components-BkZsumbI.js";import{P as ee}from"./PaperFeedFilters-CNYrJoVb.js";import{M as H}from"./MarkdownText-DgCJo7yQ.js";import{s as te}from"./slug-BpH-Nkvz.js";import{t as se}from"./transform-CNyzjv1G.js";import{u as ae}from"./useIntersectionObserver-BMoidOlM.js";import{S as M}from"./skeleton-BQDYAJTf.js";import{A as ie,a as re}from"./alert-axJAQJuC.js";import"./useBaseQuery-BL30DOiU.js";import"./LatexTitle-BmUg2c3G.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-C7g07Bf-.js";import"./index-CDHG1Gvn.js";import"./hover-card-B7gdr0Iw.js";const t={pink:"#F8D7D9",pinkS:"#D9B0B3",yellow:"#FBEFC2",yellowS:"#C9B97D",orange:"#F8D7B3",orangeS:"#C99466",blue:"#CDE2EE",blueS:"#7FA4BA",purple:"#D4D2EA",purpleS:"#8E8AC0",green:"#CCE2C5",greenS:"#7DA475",ink:"#1A1814",faint:"#8E8678"},p=({x:s,y:a,w:i,h:r,fill:f,stroke:j,label:g,fontSize:c=10,multiline:y})=>e.jsxs("g",{children:[e.jsx("rect",{x:s,y:a,width:i,height:r,rx:"3",ry:"3",fill:f,stroke:j,strokeWidth:"1"}),y?e.jsxs(e.Fragment,{children:[e.jsx("text",{x:s+i/2,y:a+r/2-2,fontSize:c,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:y[0]}),e.jsx("text",{x:s+i/2,y:a+r/2+c-1,fontSize:c,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:y[1]})]}):e.jsx("text",{x:s+i/2,y:a+r/2,fontSize:c,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:g})]}),G=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Scaled Dot-Product Attention"}),e.jsx(p,{x:140,y:40,w:80,h:26,fill:t.yellow,stroke:t.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M180 66 L180 80",stroke:t.ink}),e.jsx(p,{x:140,y:80,w:80,h:26,fill:t.green,stroke:t.greenS,label:"SoftMax",fontSize:11}),e.jsx("path",{d:"M180 106 L180 120",stroke:t.ink}),e.jsx(p,{x:140,y:120,w:80,h:26,fill:t.purple,stroke:t.purpleS,label:"Mask (opt.)",fontSize:11}),e.jsx("path",{d:"M180 146 L180 160",stroke:t.ink}),e.jsx(p,{x:140,y:160,w:80,h:26,fill:t.blue,stroke:t.blueS,label:"Scale ÷√dₖ",fontSize:11}),e.jsx("path",{d:"M180 186 L180 200",stroke:t.ink}),e.jsx(p,{x:140,y:200,w:80,h:26,fill:t.yellow,stroke:t.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M156 226 L120 270",stroke:t.ink}),e.jsx("path",{d:"M180 226 L180 270",stroke:t.ink}),e.jsx("path",{d:"M204 226 L240 270",stroke:t.ink}),e.jsx(p,{x:100,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"Q",fontSize:13}),e.jsx(p,{x:160,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"K",fontSize:13}),e.jsx(p,{x:220,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"V",fontSize:13}),e.jsxs("text",{x:"180",y:"330",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:["softmax(QK",e.jsx("tspan",{fontSize:"9",baselineShift:"super",children:"⊤"})," / √d) V"]})]}),ne=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2,3].map(s=>{const a=30+s*75,i=60-s*8,r=240-s*30;return e.jsx("g",{children:e.jsx("rect",{x:a,y:(420-r)/2,width:i,height:r,rx:"2",fill:[t.blue,t.green,t.orange,t.purple][s],stroke:[t.blueS,t.greenS,t.orangeS,t.purpleS][s],strokeWidth:"1"})},s)}),e.jsx("text",{x:"60",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"135",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"210",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"285",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"fc"})]}),q=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2,3].map(s=>{const i=60+s*80,r=100-s*12,f=50-s*6;return e.jsx("rect",{x:50,y:i,width:r,height:f,rx:"2",fill:t.blue,stroke:t.blueS,strokeWidth:"1"},`e${s}`)}),e.jsx("rect",{x:"155",y:"320",width:"50",height:"40",rx:"2",fill:t.purple,stroke:t.purpleS}),[0,1,2,3].map(s=>{const i=60+s*80,r=100-s*12,f=50-s*6;return e.jsx("rect",{x:210,y:i,width:r,height:f,rx:"2",fill:t.green,stroke:t.greenS,strokeWidth:"1"},`d${s}`)}),[0,1,2,3].map(s=>{const a=60+s*80+(50-s*6)/2,i=50+(100-s*12);return e.jsx("path",{d:`M${i} ${a} L210 ${a}`,stroke:t.faint,strokeDasharray:"4 3"},`s${s}`)}),e.jsx("text",{x:"100",y:"40",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"encoder"}),e.jsx("text",{x:"260",y:"40",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"decoder"}),e.jsx("text",{x:"180",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"skip connections preserve high-res features"})]}),le=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2].map(s=>[0,1,2].map(a=>e.jsx("rect",{x:20+a*40,y:40+s*40,width:"38",height:"38",fill:["#F8D7D9","#FBEFC2","#CDE2EE","#CCE2C5","#D4D2EA","#F8D7B3","#F8D7D9","#FBEFC2","#CDE2EE"][s*3+a],stroke:t.faint},`${s}-${a}`))),e.jsx("rect",{x:"40",y:"245",width:"280",height:"120",rx:"4",fill:"#EFEBE0",stroke:t.faint,strokeDasharray:"3 2"}),e.jsx(p,{x:70,y:258,w:220,h:20,fill:t.yellow,stroke:t.yellowS,label:"Norm"}),e.jsx(p,{x:70,y:282,w:220,h:28,fill:t.orange,stroke:t.orangeS,label:"Multi-Head Attention"}),e.jsx(p,{x:70,y:314,w:220,h:20,fill:t.yellow,stroke:t.yellowS,label:"Norm"}),e.jsx(p,{x:70,y:338,w:220,h:20,fill:t.blue,stroke:t.blueS,label:"MLP"}),e.jsx("text",{x:"180",y:"385",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"Transformer Encoder · L×"})]}),O=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"50",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Reverse process: pure noise → sample"}),[0,1,2,3,4,5].map(s=>{const a=25+s*56,i=(5-s)/5;return e.jsxs("g",{children:[e.jsx("rect",{x:a,y:90,width:50,height:50,rx:"3",fill:`oklch(${.85-i*.1} 0.04 250)`,stroke:t.faint}),i<.4&&e.jsx("circle",{cx:a+25,cy:115,r:12-i*16,fill:t.orange,opacity:1-i*1.5})]},s)}),e.jsx("rect",{x:"60",y:"240",width:"240",height:"120",rx:"4",fill:"#FFF9EE",stroke:t.faint}),e.jsx("text",{x:"180",y:"260",fontSize:"11",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"TRAINING OBJECTIVE"}),e.jsx("text",{x:"180",y:"295",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"L = E[‖ε − ε_θ(x_t, t)‖²]"})]}),oe=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Generator vs. Discriminator"}),e.jsx("circle",{cx:"50",cy:"120",r:"22",fill:t.purple,stroke:t.purpleS}),e.jsx("text",{x:"50",y:"125",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"z"}),e.jsx("rect",{x:"110",y:"92",width:"80",height:"56",rx:"3",fill:t.blue,stroke:t.blueS}),e.jsx("text",{x:"150",y:"124",fontSize:"14",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"G"}),e.jsx("rect",{x:"225",y:"100",width:"40",height:"40",rx:"3",fill:t.orange,stroke:t.orangeS}),e.jsx("rect",{x:"225",y:"195",width:"40",height:"40",rx:"3",fill:t.green,stroke:t.greenS}),e.jsx("rect",{x:"290",y:"140",width:"50",height:"50",rx:"3",fill:t.pink,stroke:t.pinkS}),e.jsx("text",{x:"315",y:"170",fontSize:"14",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"D"})]}),ce=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Variational Autoencoder"}),e.jsx("rect",{x:"30",y:"100",width:"40",height:"40",rx:"3",fill:t.green,stroke:t.greenS}),e.jsx("rect",{x:"100",y:"92",width:"60",height:"56",rx:"3",fill:t.blue,stroke:t.blueS}),e.jsx("text",{x:"130",y:"124",fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"Encoder"}),e.jsx("circle",{cx:"270",cy:"120",r:"14",fill:t.purple,stroke:t.purpleS}),e.jsx("text",{x:"270",y:"124",fontSize:"13",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"z"}),e.jsx("rect",{x:"100",y:"200",width:"60",height:"56",rx:"3",fill:t.orange,stroke:t.orangeS}),e.jsx("text",{x:"130",y:"232",fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"Decoder"}),e.jsx("rect",{x:"30",y:"210",width:"40",height:"40",rx:"3",fill:t.pink,stroke:t.pinkS})]}),de=[["my-skill/",""],["├── SKILL.md","# Required: metadata + instructions"],["├── scripts/","# Optional: executable code"],["├── references/","# Optional: documentation"],["├── assets/","# Optional: templates, resources"],["└── ...","# Any additional files or directories"]],he=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Skill package layout"}),e.jsx("rect",{x:"28",y:"48",width:"304",height:"318",rx:"8",fill:"#FFFDF8",stroke:t.faint,strokeWidth:"1"}),de.map(([s,a],i)=>{const r=92+i*44;return e.jsxs("g",{children:[e.jsx("text",{x:"44",y:r,fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,dominantBaseline:"middle",children:s}),a?e.jsx("text",{x:"138",y:r,fontSize:"8.5",fontFamily:"var(--mono)",fill:t.faint,dominantBaseline:"middle",children:a}):null]},s)})]}),xe={attention:G,"self-attention":G,cnn:ne,"u-net":q,unet:q,vit:le,diffusion:O,ddpm:O,gan:oe,vae:ce,"agent-skills":he},me=({method:s})=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:s.name||"method"}),e.jsx(p,{x:80,y:70,w:200,h:50,fill:t.blue,stroke:t.blueS,label:"Input",fontSize:12}),e.jsx("path",{d:"M180 120 L180 150",stroke:t.ink}),e.jsx(p,{x:80,y:150,w:200,h:70,fill:t.orange,stroke:t.orangeS,label:s.name||"transform",fontSize:13}),e.jsx("path",{d:"M180 220 L180 250",stroke:t.ink}),e.jsx(p,{x:80,y:250,w:200,h:50,fill:t.purple,stroke:t.purpleS,label:"Output",fontSize:12})]}),fe=({method:s})=>{const a=(s.slug||"").toLowerCase(),i=xe[a];if(i)return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(i,{})});if(s.image_url){const r=a==="transformer"||a==="gpt-4"||a==="gpt-4o"?" method-figure-svg--compact":a==="rpn"?" method-figure-svg--scaled-80":"";return e.jsx("div",{className:`method-figure-svg method-figure-svg--image${r}`,children:e.jsx("img",{className:"method-figure-img",src:s.image_url,alt:`${s.name} figure`})})}return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(me,{method:s})})},L=720,C=138,u={top:8,right:10,bottom:25,left:36},U=56,pe=new Intl.DateTimeFormat("en",{month:"short",year:"2-digit",timeZone:"UTC"}),ge=new Intl.DateTimeFormat("en",{year:"numeric",timeZone:"UTC"}),B=s=>pe.format(new Date(`${s}T00:00:00Z`)),ue=(s,a)=>{if(s===0)return new Set;const i=s>48?12:s>36?6:s>18?3:2,r=Math.max(1,Math.ceil(U/a)),f=Math.max(i,r),j=s-1,g=new Set([0,j]);for(let c=f;c<j;c+=f)(j-c)*a>=U&&g.add(c);return g},K=s=>{if(s.coverage_status===void 0||["complete","not_applicable"].includes(s.coverage_status))return null;const a=s.processed_paper_count!==void 0&&s.eligible_paper_count!==void 0?`; ${s.processed_paper_count.toLocaleString()} of ${s.eligible_paper_count.toLocaleString()} eligible papers processed`:"";return`Historical tagging ${s.coverage_status==="failed"?"needs retry":"in progress"}${a}`},je=({history:s,methodName:a})=>{const[i,r]=E.useState(null),f=Math.max(1,...s.map(n=>n.paper_count)),j=L-u.left-u.right,g=C-u.top-u.bottom,c=s.length?j/s.length:j,y=Math.max(2,c*.68),d=ue(s.length,c),z=Array.from(new Set([0,Math.ceil(f/2),f])),x=i==null?null:s[i],S=x?K(x):null;return e.jsxs("div",{className:"method-usage-chart-wrap",children:[e.jsxs("svg",{className:"method-usage-chart",viewBox:`0 0 ${L} ${C}`,role:"group","aria-label":`${a}: papers mentioning this method by publication month`,children:[e.jsxs("title",{children:[a,": papers mentioning this method by publication month"]}),z.map(n=>{const m=u.top+g-n/f*g;return e.jsxs("g",{children:[e.jsx("line",{className:"method-usage-gridline",x1:u.left,x2:L-u.right,y1:m,y2:m}),e.jsx("text",{className:"method-usage-y-label",x:u.left-8,y:m+3,textAnchor:"end",children:n})]},n)}),s.map((n,m)=>{const k=n.paper_count/f*g,b=n.paper_count>0?Math.max(1,k):0,F=u.left+c*m+(c-y)/2,l=u.top+g-b,_=i===m,N=m===s.length-1,w=K(n);return e.jsxs("g",{className:`method-usage-bar${_?" is-active":""}${N?" is-current":""}`,tabIndex:0,role:"img","aria-label":`${B(n.start_date)}: ${n.paper_count} ${n.paper_count===1?"paper":"papers"}${w?`. ${w}`:""}`,onMouseEnter:()=>r(m),onMouseLeave:()=>r(null),onFocus:()=>r(m),onBlur:()=>r(null),children:[e.jsx("rect",{className:"method-usage-bar-hit",x:u.left+c*m,y:u.top,width:c,height:g}),e.jsx("rect",{className:"method-usage-bar-mark",x:F,y:l,width:y,height:b,rx:"1.5"})]},n.start_date)}),s.map((n,m)=>d.has(m)?e.jsx("text",{className:"method-usage-x-label",x:u.left+c*(m+.5),y:C-11,textAnchor:"middle",children:s.length>48?ge.format(new Date(`${n.start_date}T00:00:00Z`)):B(n.start_date)},n.start_date):null)]}),x&&e.jsxs("div",{className:"method-usage-tooltip",role:"status",children:[e.jsx("strong",{children:B(x.start_date)}),e.jsxs("span",{children:[x.paper_count," ",x.paper_count===1?"paper":"papers",i===s.length-1?" · month to date":""]}),e.jsxs("span",{children:[(x.catalog_share??0).toFixed(2),"% of"," ",(x.catalog_paper_count??0).toLocaleString()," catalog papers"]}),S&&e.jsx("span",{children:S})]})]})},ye=[["trending","trending"],["new","newest"],["cited","most cited"]],Q={"on-policy-distillation":["fine-tuning","post-training","rlvr","rlhf","direct-preference-optimization-dpo"],mcp:["agent-skills"],"agent-skills":["mcp"]},Pe=()=>{var N,w,$,P,T,I;const{methodSlug:s}=W(),[a,i]=V(),[r,f]=E.useState("trending"),j=a.get("has_code")==="true",g=a.get("has_hf_artifacts")==="true",c=o=>{const h=new URLSearchParams(a);o?h.set("has_code","true"):h.delete("has_code"),i(h)},y=o=>{const h=new URLSearchParams(a);o?h.set("has_hf_artifacts","true"):h.delete("has_hf_artifacts"),i(h)},d=A({queryKey:["method",s],queryFn:()=>v.getMethod(s),enabled:!!s,staleTime:10*60*1e3}),z=A({queryKey:["areas-all"],queryFn:()=>v.getAreas({page_size:50,ordering:"name"}),enabled:!!((N=d.data)!=null&&N.area_id),staleTime:10*60*1e3}),x=A({queryKey:["method-trend",s],queryFn:()=>v.getMethodTrend(s),enabled:!!s&&!!d.data,staleTime:10*60*1e3}),S=r==="trending"?"trending":r==="cited"?"citation_count":"date_published",n=X({queryKey:["method-papers-infinite",s,S,j,g],queryFn:({pageParam:o=1})=>v.getMethodPapers(s,{page:o,page_size:20,order_by:S,order_dir:"desc",include_resources:!0,has_code:j,has_hf_artifacts:g}),getNextPageParam:o=>o.next_page,initialPageParam:1,enabled:!!s,staleTime:5*60*1e3,placeholderData:Z}),m=A({queryKey:["related-methods",(w=d.data)==null?void 0:w.slug,($=d.data)==null?void 0:$.area_id,(P=d.data)==null?void 0:P.id],queryFn:async()=>{const o=Q[d.data.slug];return o?Promise.all(o.map(D=>v.getMethod(D))):(await v.getMethods({area_id:d.data.area_id,exclude_id:d.data.id,ordering:"-paper_count",page_size:8})).results},enabled:!!d.data&&(!!Q[d.data.slug]||!!d.data.area_id),staleTime:10*60*1e3}),k=E.useMemo(()=>{var h;return(((h=n.data)==null?void 0:h.pages.flatMap(D=>D.results))||[]).map(se)},[n.data]),{targetRef:b,isIntersecting:F}=ae({rootMargin:"200px"});if(E.useEffect(()=>{F&&n.hasNextPage&&!n.isFetchingNextPage&&n.fetchNextPage()},[F,n.hasNextPage,n.isFetchingNextPage]),d.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(M,{className:"h-12 w-1/2 mb-4"}),e.jsx(M,{className:"h-64 w-full"})]});if(d.error||!d.data)return e.jsx("div",{className:"page",children:e.jsx(ie,{variant:"destructive",children:e.jsx(re,{children:"Method not found."})})});const l=d.data,_=(T=z.data)==null?void 0:T.results.find(o=>o.id===l.area_id);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(R,{to:"/methods",children:"Methods"}),_&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(R,{to:`/methods#area-${te(_.name)}`,children:_.name})]}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:l.name})]}),e.jsxs("div",{className:`tag-hero method-hero-grid${l.slug==="grokking"||l.slug==="latent-reasoning"?" method-hero-grid--wide-figure":""}`,children:[e.jsxs("div",{children:[e.jsx("div",{className:"tag-hero-eyebrow",children:"METHOD"}),e.jsx("h1",{className:"tag-hero-title method-hero-title",children:l.name}),l.full_name&&l.full_name!==l.name&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontSize:16,fontStyle:"italic",color:"var(--ink-soft)",marginTop:8},children:l.full_name}),l.description&&e.jsx(H,{className:"method-description",text:l.description}),l.source_url&&l.source_title&&e.jsxs("div",{className:"method-source",children:[e.jsx("span",{className:"method-source-label",children:"Source"}),e.jsxs("a",{className:"method-source-link",href:l.source_url,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:l.source_title}),l.introduced_year&&e.jsx("span",{className:"method-source-meta",children:l.introduced_year})]})]}),e.jsxs("div",{className:"tag-hero-meta",children:[e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Papers mentioning"}),e.jsx("span",{className:"value",children:(l.paper_count??0).toLocaleString()})]}),x.data&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Recent mentions"}),e.jsxs("span",{className:"value",children:[x.data.trend_score.toFixed(1),e.jsx("small",{children:"/mo"})]})]}),l.introduced_year!=null&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Introduced"}),e.jsx("span",{className:"value",children:l.introduced_year})]})]}),x.isLoading?e.jsx(M,{className:"h-36 w-full method-trend-skeleton"}):x.data?e.jsxs("section",{className:"method-trend-panel method-trend-panel--compact",children:[e.jsxs("div",{className:"method-trend-header",children:[e.jsx("div",{children:e.jsx("div",{className:"method-trend-eyebrow",children:"Usage trend"})}),e.jsxs("div",{className:"method-trend-summary",children:[e.jsx("strong",{children:x.data.recent_paper_count}),e.jsxs("span",{children:["papers / ",x.data.recent_days,"d"]})]})]}),e.jsx(je,{history:x.data.history,methodName:l.name})]}):null]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(fe,{method:l}),l.image_credit&&e.jsx("figcaption",{children:e.jsx(H,{className:"method-image-credit",text:l.image_credit})})]})]}),(((I=m.data)==null?void 0:I.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),m.data.map(o=>e.jsx(Y,{method:{slug:o.slug,name:o.name}},o.id))]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:ye.map(([o,h])=>e.jsx("button",{className:`sort-btn ${r===o?"active":""}`,onClick:()=>f(o),children:h},o))}),e.jsx(ee,{hasCode:j,hasHfArtifacts:g,onHasCodeChange:c,onHasHfArtifactsChange:y})]}),e.jsxs("div",{className:"results-count",children:[k.length," papers mentioning ",l.name]})]}),n.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((o,h)=>e.jsx(M,{className:"h-40 w-full"},h))}):k.length===0?e.jsx("div",{className:"no-results",children:"No papers tagged with this method yet."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:k.map((o,h)=>e.jsx(J,{paper:o,rank:h+1},o.id))}),e.jsx("div",{ref:b,style:{height:1}}),n.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{Pe as default};
 
1
+ import{j as e,r as E,e as W,a as V,L as R,b as v,al as Z}from"./index-Bo5_2OqZ.js";import{u as A}from"./useQuery-Bh9FZQpL.js";import{u as X}from"./useInfiniteQuery-CzzYUeDW.js";import{M as Y,P as J}from"./components-BbXgE2lV.js";import{P as ee}from"./PaperFeedFilters-D2TbUu0j.js";import{M as H}from"./MarkdownText-VH1HEGnz.js";import{s as te}from"./slug-BpH-Nkvz.js";import{t as se}from"./transform-2Gnjg1jt.js";import{u as ae}from"./useIntersectionObserver-7HCpY83L.js";import{S as M}from"./skeleton-CB-heJjl.js";import{A as ie,a as re}from"./alert-_EYQlDHA.js";import"./useBaseQuery-B8T7kRNC.js";import"./LatexTitle-qoY4vrTZ.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-DTmodbgi.js";import"./index-C-0CcYmz.js";import"./hover-card-DrtqDSb0.js";const t={pink:"#F8D7D9",pinkS:"#D9B0B3",yellow:"#FBEFC2",yellowS:"#C9B97D",orange:"#F8D7B3",orangeS:"#C99466",blue:"#CDE2EE",blueS:"#7FA4BA",purple:"#D4D2EA",purpleS:"#8E8AC0",green:"#CCE2C5",greenS:"#7DA475",ink:"#1A1814",faint:"#8E8678"},p=({x:s,y:a,w:i,h:r,fill:f,stroke:j,label:g,fontSize:c=10,multiline:y})=>e.jsxs("g",{children:[e.jsx("rect",{x:s,y:a,width:i,height:r,rx:"3",ry:"3",fill:f,stroke:j,strokeWidth:"1"}),y?e.jsxs(e.Fragment,{children:[e.jsx("text",{x:s+i/2,y:a+r/2-2,fontSize:c,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:y[0]}),e.jsx("text",{x:s+i/2,y:a+r/2+c-1,fontSize:c,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:y[1]})]}):e.jsx("text",{x:s+i/2,y:a+r/2,fontSize:c,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:g})]}),G=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Scaled Dot-Product Attention"}),e.jsx(p,{x:140,y:40,w:80,h:26,fill:t.yellow,stroke:t.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M180 66 L180 80",stroke:t.ink}),e.jsx(p,{x:140,y:80,w:80,h:26,fill:t.green,stroke:t.greenS,label:"SoftMax",fontSize:11}),e.jsx("path",{d:"M180 106 L180 120",stroke:t.ink}),e.jsx(p,{x:140,y:120,w:80,h:26,fill:t.purple,stroke:t.purpleS,label:"Mask (opt.)",fontSize:11}),e.jsx("path",{d:"M180 146 L180 160",stroke:t.ink}),e.jsx(p,{x:140,y:160,w:80,h:26,fill:t.blue,stroke:t.blueS,label:"Scale ÷√dₖ",fontSize:11}),e.jsx("path",{d:"M180 186 L180 200",stroke:t.ink}),e.jsx(p,{x:140,y:200,w:80,h:26,fill:t.yellow,stroke:t.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M156 226 L120 270",stroke:t.ink}),e.jsx("path",{d:"M180 226 L180 270",stroke:t.ink}),e.jsx("path",{d:"M204 226 L240 270",stroke:t.ink}),e.jsx(p,{x:100,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"Q",fontSize:13}),e.jsx(p,{x:160,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"K",fontSize:13}),e.jsx(p,{x:220,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"V",fontSize:13}),e.jsxs("text",{x:"180",y:"330",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:["softmax(QK",e.jsx("tspan",{fontSize:"9",baselineShift:"super",children:"⊤"})," / √d) V"]})]}),ne=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2,3].map(s=>{const a=30+s*75,i=60-s*8,r=240-s*30;return e.jsx("g",{children:e.jsx("rect",{x:a,y:(420-r)/2,width:i,height:r,rx:"2",fill:[t.blue,t.green,t.orange,t.purple][s],stroke:[t.blueS,t.greenS,t.orangeS,t.purpleS][s],strokeWidth:"1"})},s)}),e.jsx("text",{x:"60",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"135",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"210",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"285",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"fc"})]}),q=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2,3].map(s=>{const i=60+s*80,r=100-s*12,f=50-s*6;return e.jsx("rect",{x:50,y:i,width:r,height:f,rx:"2",fill:t.blue,stroke:t.blueS,strokeWidth:"1"},`e${s}`)}),e.jsx("rect",{x:"155",y:"320",width:"50",height:"40",rx:"2",fill:t.purple,stroke:t.purpleS}),[0,1,2,3].map(s=>{const i=60+s*80,r=100-s*12,f=50-s*6;return e.jsx("rect",{x:210,y:i,width:r,height:f,rx:"2",fill:t.green,stroke:t.greenS,strokeWidth:"1"},`d${s}`)}),[0,1,2,3].map(s=>{const a=60+s*80+(50-s*6)/2,i=50+(100-s*12);return e.jsx("path",{d:`M${i} ${a} L210 ${a}`,stroke:t.faint,strokeDasharray:"4 3"},`s${s}`)}),e.jsx("text",{x:"100",y:"40",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"encoder"}),e.jsx("text",{x:"260",y:"40",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"decoder"}),e.jsx("text",{x:"180",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"skip connections preserve high-res features"})]}),le=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2].map(s=>[0,1,2].map(a=>e.jsx("rect",{x:20+a*40,y:40+s*40,width:"38",height:"38",fill:["#F8D7D9","#FBEFC2","#CDE2EE","#CCE2C5","#D4D2EA","#F8D7B3","#F8D7D9","#FBEFC2","#CDE2EE"][s*3+a],stroke:t.faint},`${s}-${a}`))),e.jsx("rect",{x:"40",y:"245",width:"280",height:"120",rx:"4",fill:"#EFEBE0",stroke:t.faint,strokeDasharray:"3 2"}),e.jsx(p,{x:70,y:258,w:220,h:20,fill:t.yellow,stroke:t.yellowS,label:"Norm"}),e.jsx(p,{x:70,y:282,w:220,h:28,fill:t.orange,stroke:t.orangeS,label:"Multi-Head Attention"}),e.jsx(p,{x:70,y:314,w:220,h:20,fill:t.yellow,stroke:t.yellowS,label:"Norm"}),e.jsx(p,{x:70,y:338,w:220,h:20,fill:t.blue,stroke:t.blueS,label:"MLP"}),e.jsx("text",{x:"180",y:"385",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"Transformer Encoder · L×"})]}),O=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"50",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Reverse process: pure noise → sample"}),[0,1,2,3,4,5].map(s=>{const a=25+s*56,i=(5-s)/5;return e.jsxs("g",{children:[e.jsx("rect",{x:a,y:90,width:50,height:50,rx:"3",fill:`oklch(${.85-i*.1} 0.04 250)`,stroke:t.faint}),i<.4&&e.jsx("circle",{cx:a+25,cy:115,r:12-i*16,fill:t.orange,opacity:1-i*1.5})]},s)}),e.jsx("rect",{x:"60",y:"240",width:"240",height:"120",rx:"4",fill:"#FFF9EE",stroke:t.faint}),e.jsx("text",{x:"180",y:"260",fontSize:"11",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"TRAINING OBJECTIVE"}),e.jsx("text",{x:"180",y:"295",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"L = E[‖ε − ε_θ(x_t, t)‖²]"})]}),oe=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Generator vs. Discriminator"}),e.jsx("circle",{cx:"50",cy:"120",r:"22",fill:t.purple,stroke:t.purpleS}),e.jsx("text",{x:"50",y:"125",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"z"}),e.jsx("rect",{x:"110",y:"92",width:"80",height:"56",rx:"3",fill:t.blue,stroke:t.blueS}),e.jsx("text",{x:"150",y:"124",fontSize:"14",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"G"}),e.jsx("rect",{x:"225",y:"100",width:"40",height:"40",rx:"3",fill:t.orange,stroke:t.orangeS}),e.jsx("rect",{x:"225",y:"195",width:"40",height:"40",rx:"3",fill:t.green,stroke:t.greenS}),e.jsx("rect",{x:"290",y:"140",width:"50",height:"50",rx:"3",fill:t.pink,stroke:t.pinkS}),e.jsx("text",{x:"315",y:"170",fontSize:"14",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"D"})]}),ce=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Variational Autoencoder"}),e.jsx("rect",{x:"30",y:"100",width:"40",height:"40",rx:"3",fill:t.green,stroke:t.greenS}),e.jsx("rect",{x:"100",y:"92",width:"60",height:"56",rx:"3",fill:t.blue,stroke:t.blueS}),e.jsx("text",{x:"130",y:"124",fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"Encoder"}),e.jsx("circle",{cx:"270",cy:"120",r:"14",fill:t.purple,stroke:t.purpleS}),e.jsx("text",{x:"270",y:"124",fontSize:"13",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"z"}),e.jsx("rect",{x:"100",y:"200",width:"60",height:"56",rx:"3",fill:t.orange,stroke:t.orangeS}),e.jsx("text",{x:"130",y:"232",fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"Decoder"}),e.jsx("rect",{x:"30",y:"210",width:"40",height:"40",rx:"3",fill:t.pink,stroke:t.pinkS})]}),de=[["my-skill/",""],["├── SKILL.md","# Required: metadata + instructions"],["├── scripts/","# Optional: executable code"],["├── references/","# Optional: documentation"],["├── assets/","# Optional: templates, resources"],["└── ...","# Any additional files or directories"]],he=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Skill package layout"}),e.jsx("rect",{x:"28",y:"48",width:"304",height:"318",rx:"8",fill:"#FFFDF8",stroke:t.faint,strokeWidth:"1"}),de.map(([s,a],i)=>{const r=92+i*44;return e.jsxs("g",{children:[e.jsx("text",{x:"44",y:r,fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,dominantBaseline:"middle",children:s}),a?e.jsx("text",{x:"138",y:r,fontSize:"8.5",fontFamily:"var(--mono)",fill:t.faint,dominantBaseline:"middle",children:a}):null]},s)})]}),xe={attention:G,"self-attention":G,cnn:ne,"u-net":q,unet:q,vit:le,diffusion:O,ddpm:O,gan:oe,vae:ce,"agent-skills":he},me=({method:s})=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:s.name||"method"}),e.jsx(p,{x:80,y:70,w:200,h:50,fill:t.blue,stroke:t.blueS,label:"Input",fontSize:12}),e.jsx("path",{d:"M180 120 L180 150",stroke:t.ink}),e.jsx(p,{x:80,y:150,w:200,h:70,fill:t.orange,stroke:t.orangeS,label:s.name||"transform",fontSize:13}),e.jsx("path",{d:"M180 220 L180 250",stroke:t.ink}),e.jsx(p,{x:80,y:250,w:200,h:50,fill:t.purple,stroke:t.purpleS,label:"Output",fontSize:12})]}),fe=({method:s})=>{const a=(s.slug||"").toLowerCase(),i=xe[a];if(i)return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(i,{})});if(s.image_url){const r=a==="transformer"||a==="gpt-4"||a==="gpt-4o"?" method-figure-svg--compact":a==="rpn"?" method-figure-svg--scaled-80":"";return e.jsx("div",{className:`method-figure-svg method-figure-svg--image${r}`,children:e.jsx("img",{className:"method-figure-img",src:s.image_url,alt:`${s.name} figure`})})}return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(me,{method:s})})},L=720,C=138,u={top:8,right:10,bottom:25,left:36},U=56,pe=new Intl.DateTimeFormat("en",{month:"short",year:"2-digit",timeZone:"UTC"}),ge=new Intl.DateTimeFormat("en",{year:"numeric",timeZone:"UTC"}),B=s=>pe.format(new Date(`${s}T00:00:00Z`)),ue=(s,a)=>{if(s===0)return new Set;const i=s>48?12:s>36?6:s>18?3:2,r=Math.max(1,Math.ceil(U/a)),f=Math.max(i,r),j=s-1,g=new Set([0,j]);for(let c=f;c<j;c+=f)(j-c)*a>=U&&g.add(c);return g},K=s=>{if(s.coverage_status===void 0||["complete","not_applicable"].includes(s.coverage_status))return null;const a=s.processed_paper_count!==void 0&&s.eligible_paper_count!==void 0?`; ${s.processed_paper_count.toLocaleString()} of ${s.eligible_paper_count.toLocaleString()} eligible papers processed`:"";return`Historical tagging ${s.coverage_status==="failed"?"needs retry":"in progress"}${a}`},je=({history:s,methodName:a})=>{const[i,r]=E.useState(null),f=Math.max(1,...s.map(n=>n.paper_count)),j=L-u.left-u.right,g=C-u.top-u.bottom,c=s.length?j/s.length:j,y=Math.max(2,c*.68),d=ue(s.length,c),z=Array.from(new Set([0,Math.ceil(f/2),f])),x=i==null?null:s[i],S=x?K(x):null;return e.jsxs("div",{className:"method-usage-chart-wrap",children:[e.jsxs("svg",{className:"method-usage-chart",viewBox:`0 0 ${L} ${C}`,role:"group","aria-label":`${a}: papers mentioning this method by publication month`,children:[e.jsxs("title",{children:[a,": papers mentioning this method by publication month"]}),z.map(n=>{const m=u.top+g-n/f*g;return e.jsxs("g",{children:[e.jsx("line",{className:"method-usage-gridline",x1:u.left,x2:L-u.right,y1:m,y2:m}),e.jsx("text",{className:"method-usage-y-label",x:u.left-8,y:m+3,textAnchor:"end",children:n})]},n)}),s.map((n,m)=>{const k=n.paper_count/f*g,b=n.paper_count>0?Math.max(1,k):0,F=u.left+c*m+(c-y)/2,l=u.top+g-b,_=i===m,N=m===s.length-1,w=K(n);return e.jsxs("g",{className:`method-usage-bar${_?" is-active":""}${N?" is-current":""}`,tabIndex:0,role:"img","aria-label":`${B(n.start_date)}: ${n.paper_count} ${n.paper_count===1?"paper":"papers"}${w?`. ${w}`:""}`,onMouseEnter:()=>r(m),onMouseLeave:()=>r(null),onFocus:()=>r(m),onBlur:()=>r(null),children:[e.jsx("rect",{className:"method-usage-bar-hit",x:u.left+c*m,y:u.top,width:c,height:g}),e.jsx("rect",{className:"method-usage-bar-mark",x:F,y:l,width:y,height:b,rx:"1.5"})]},n.start_date)}),s.map((n,m)=>d.has(m)?e.jsx("text",{className:"method-usage-x-label",x:u.left+c*(m+.5),y:C-11,textAnchor:"middle",children:s.length>48?ge.format(new Date(`${n.start_date}T00:00:00Z`)):B(n.start_date)},n.start_date):null)]}),x&&e.jsxs("div",{className:"method-usage-tooltip",role:"status",children:[e.jsx("strong",{children:B(x.start_date)}),e.jsxs("span",{children:[x.paper_count," ",x.paper_count===1?"paper":"papers",i===s.length-1?" · month to date":""]}),e.jsxs("span",{children:[(x.catalog_share??0).toFixed(2),"% of"," ",(x.catalog_paper_count??0).toLocaleString()," catalog papers"]}),S&&e.jsx("span",{children:S})]})]})},ye=[["trending","trending"],["new","newest"],["cited","most cited"]],Q={"on-policy-distillation":["fine-tuning","post-training","rlvr","rlhf","direct-preference-optimization-dpo"],mcp:["agent-skills"],"agent-skills":["mcp"]},Pe=()=>{var N,w,$,P,T,I;const{methodSlug:s}=W(),[a,i]=V(),[r,f]=E.useState("trending"),j=a.get("has_code")==="true",g=a.get("has_hf_artifacts")==="true",c=o=>{const h=new URLSearchParams(a);o?h.set("has_code","true"):h.delete("has_code"),i(h)},y=o=>{const h=new URLSearchParams(a);o?h.set("has_hf_artifacts","true"):h.delete("has_hf_artifacts"),i(h)},d=A({queryKey:["method",s],queryFn:()=>v.getMethod(s),enabled:!!s,staleTime:10*60*1e3}),z=A({queryKey:["areas-all"],queryFn:()=>v.getAreas({page_size:50,ordering:"name"}),enabled:!!((N=d.data)!=null&&N.area_id),staleTime:10*60*1e3}),x=A({queryKey:["method-trend",s],queryFn:()=>v.getMethodTrend(s),enabled:!!s&&!!d.data,staleTime:10*60*1e3}),S=r==="trending"?"trending":r==="cited"?"citation_count":"date_published",n=X({queryKey:["method-papers-infinite",s,S,j,g],queryFn:({pageParam:o=1})=>v.getMethodPapers(s,{page:o,page_size:20,order_by:S,order_dir:"desc",include_resources:!0,has_code:j,has_hf_artifacts:g}),getNextPageParam:o=>o.next_page,initialPageParam:1,enabled:!!s,staleTime:5*60*1e3,placeholderData:Z}),m=A({queryKey:["related-methods",(w=d.data)==null?void 0:w.slug,($=d.data)==null?void 0:$.area_id,(P=d.data)==null?void 0:P.id],queryFn:async()=>{const o=Q[d.data.slug];return o?Promise.all(o.map(D=>v.getMethod(D))):(await v.getMethods({area_id:d.data.area_id,exclude_id:d.data.id,ordering:"-paper_count",page_size:8})).results},enabled:!!d.data&&(!!Q[d.data.slug]||!!d.data.area_id),staleTime:10*60*1e3}),k=E.useMemo(()=>{var h;return(((h=n.data)==null?void 0:h.pages.flatMap(D=>D.results))||[]).map(se)},[n.data]),{targetRef:b,isIntersecting:F}=ae({rootMargin:"200px"});if(E.useEffect(()=>{F&&n.hasNextPage&&!n.isFetchingNextPage&&n.fetchNextPage()},[F,n.hasNextPage,n.isFetchingNextPage]),d.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(M,{className:"h-12 w-1/2 mb-4"}),e.jsx(M,{className:"h-64 w-full"})]});if(d.error||!d.data)return e.jsx("div",{className:"page",children:e.jsx(ie,{variant:"destructive",children:e.jsx(re,{children:"Method not found."})})});const l=d.data,_=(T=z.data)==null?void 0:T.results.find(o=>o.id===l.area_id);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(R,{to:"/methods",children:"Methods"}),_&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(R,{to:`/methods#area-${te(_.name)}`,children:_.name})]}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:l.name})]}),e.jsxs("div",{className:`tag-hero method-hero-grid${l.slug==="grokking"||l.slug==="latent-reasoning"?" method-hero-grid--wide-figure":""}`,children:[e.jsxs("div",{children:[e.jsx("div",{className:"tag-hero-eyebrow",children:"METHOD"}),e.jsx("h1",{className:"tag-hero-title method-hero-title",children:l.name}),l.full_name&&l.full_name!==l.name&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontSize:16,fontStyle:"italic",color:"var(--ink-soft)",marginTop:8},children:l.full_name}),l.description&&e.jsx(H,{className:"method-description",text:l.description}),l.source_url&&l.source_title&&e.jsxs("div",{className:"method-source",children:[e.jsx("span",{className:"method-source-label",children:"Source"}),e.jsxs("a",{className:"method-source-link",href:l.source_url,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:l.source_title}),l.introduced_year&&e.jsx("span",{className:"method-source-meta",children:l.introduced_year})]})]}),e.jsxs("div",{className:"tag-hero-meta",children:[e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Papers mentioning"}),e.jsx("span",{className:"value",children:(l.paper_count??0).toLocaleString()})]}),x.data&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Recent mentions"}),e.jsxs("span",{className:"value",children:[x.data.trend_score.toFixed(1),e.jsx("small",{children:"/mo"})]})]}),l.introduced_year!=null&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Introduced"}),e.jsx("span",{className:"value",children:l.introduced_year})]})]}),x.isLoading?e.jsx(M,{className:"h-36 w-full method-trend-skeleton"}):x.data?e.jsxs("section",{className:"method-trend-panel method-trend-panel--compact",children:[e.jsxs("div",{className:"method-trend-header",children:[e.jsx("div",{children:e.jsx("div",{className:"method-trend-eyebrow",children:"Usage trend"})}),e.jsxs("div",{className:"method-trend-summary",children:[e.jsx("strong",{children:x.data.recent_paper_count}),e.jsxs("span",{children:["papers / ",x.data.recent_days,"d"]})]})]}),e.jsx(je,{history:x.data.history,methodName:l.name})]}):null]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(fe,{method:l}),l.image_credit&&e.jsx("figcaption",{children:e.jsx(H,{className:"method-image-credit",text:l.image_credit})})]})]}),(((I=m.data)==null?void 0:I.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),m.data.map(o=>e.jsx(Y,{method:{slug:o.slug,name:o.name}},o.id))]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:ye.map(([o,h])=>e.jsx("button",{className:`sort-btn ${r===o?"active":""}`,onClick:()=>f(o),children:h},o))}),e.jsx(ee,{hasCode:j,hasHfArtifacts:g,onHasCodeChange:c,onHasHfArtifactsChange:y})]}),e.jsxs("div",{className:"results-count",children:[k.length," papers mentioning ",l.name]})]}),n.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((o,h)=>e.jsx(M,{className:"h-40 w-full"},h))}):k.length===0?e.jsx("div",{className:"no-results",children:"No papers tagged with this method yet."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:k.map((o,h)=>e.jsx(J,{paper:o,rank:h+1},o.id))}),e.jsx("div",{ref:b,style:{height:1}}),n.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{Pe as default};
assets/{MethodsIndexView-Cb6Hwc7C.js → MethodsIndexView-CKAKF4Rt.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{c as g,r as d,j as e,L as j,b as m}from"./index-CIXevVP9.js";import{u as h}from"./useQuery-BHSsBDmJ.js";import{s as f}from"./slug-BpH-Nkvz.js";import{S as p}from"./skeleton-BQDYAJTf.js";import{A as y,a as v}from"./alert-axJAQJuC.js";import{T as _}from"./TaxonomySuggestionTile-B7IEL_hW.js";import"./useBaseQuery-BL30DOiU.js";import"./SignInToEditDialog-BJmkw1tr.js";import"./button-5O6wnTvY.js";import"./textarea-CcQVD6R-.js";import"./dialog-CA9NpDaA.js";import"./useMutation-CDeysSx_.js";import"./loader-circle-k9WscwaT.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{c as g,r as d,j as e,L as j,b as m}from"./index-Bo5_2OqZ.js";import{u as h}from"./useQuery-Bh9FZQpL.js";import{s as f}from"./slug-BpH-Nkvz.js";import{S as p}from"./skeleton-CB-heJjl.js";import{A as y,a as v}from"./alert-_EYQlDHA.js";import{T as _}from"./TaxonomySuggestionTile-T8WIATj3.js";import"./useBaseQuery-B8T7kRNC.js";import"./SignInToEditDialog-DW_1sVXp.js";import"./button-D8mDpZUh.js";import"./textarea-Cr9wwZtd.js";import"./dialog-BAxsIFdN.js";import"./useMutation-B8C_NgT5.js";import"./loader-circle-L2ccNPQf.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{NotFound-CpcrlF99.js → NotFound-CN-zdP49.js} RENAMED
@@ -1 +1 @@
1
- import{aL as o,r as a,j as t,L as s}from"./index-CIXevVP9.js";const r=()=>{const e=o();return a.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),t.jsxs("div",{className:"page",style:{textAlign:"center",paddingTop:96},children:[t.jsx("h1",{className:"detail-title",style:{fontSize:96,marginBottom:8},children:"404"}),t.jsx("p",{style:{fontFamily:"var(--serif)",fontStyle:"italic",color:"var(--ink-soft)",marginBottom:24},children:"That route isn't on the map."}),t.jsx(s,{to:"/",className:"action-btn",children:"Return home"})]})};export{r as default};
 
1
+ import{aM as o,r as a,j as t,L as s}from"./index-Bo5_2OqZ.js";const r=()=>{const e=o();return a.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),t.jsxs("div",{className:"page",style:{textAlign:"center",paddingTop:96},children:[t.jsx("h1",{className:"detail-title",style:{fontSize:96,marginBottom:8},children:"404"}),t.jsx("p",{style:{fontFamily:"var(--serif)",fontStyle:"italic",color:"var(--ink-soft)",marginBottom:24},children:"That route isn't on the map."}),t.jsx(s,{to:"/",className:"action-btn",children:"Return home"})]})};export{r as default};
assets/OrganizationDetailView-CVziNQLK.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{e as t,j as r}from"./index-Bo5_2OqZ.js";import{O as i}from"./OrganizationPaperFeed-BAdi7G6c.js";import m from"./NotFound-CN-zdP49.js";import"./useQuery-Bh9FZQpL.js";import"./useBaseQuery-B8T7kRNC.js";import"./components-BbXgE2lV.js";import"./LatexTitle-qoY4vrTZ.js";import"./katex.min-BSBacQyE.js";import"./transform-2Gnjg1jt.js";import"./MarkdownText-VH1HEGnz.js";import"./PaperPreviewLink-DTmodbgi.js";import"./index-C-0CcYmz.js";import"./hover-card-DrtqDSb0.js";import"./skeleton-CB-heJjl.js";import"./PaperFeedFilters-D2TbUu0j.js";import"./alert-_EYQlDHA.js";import"./searchable-select-DirckEhK.js";import"./button-D8mDpZUh.js";import"./dialog-BAxsIFdN.js";import"./loader-circle-L2ccNPQf.js";import"./useIntersectionObserver-7HCpY83L.js";import"./usePapers-CdB1OuZ5.js";import"./useInfiniteQuery-CzzYUeDW.js";const V=()=>{const{orgSlug:o}=t();return o?r.jsx(i,{organizationSlug:o}):r.jsx(m,{})};export{V as default};
assets/OrganizationDetailView-DkCiyavY.js DELETED
@@ -1 +0,0 @@
1
- import{e as t,j as r}from"./index-CIXevVP9.js";import{O as i}from"./OrganizationPaperFeed-CdsqFQ1J.js";import m from"./NotFound-CpcrlF99.js";import"./useQuery-BHSsBDmJ.js";import"./useBaseQuery-BL30DOiU.js";import"./components-BkZsumbI.js";import"./LatexTitle-BmUg2c3G.js";import"./katex.min-BSBacQyE.js";import"./transform-CNyzjv1G.js";import"./MarkdownText-DgCJo7yQ.js";import"./PaperPreviewLink-C7g07Bf-.js";import"./index-CDHG1Gvn.js";import"./hover-card-B7gdr0Iw.js";import"./skeleton-BQDYAJTf.js";import"./PaperFeedFilters-CNYrJoVb.js";import"./alert-axJAQJuC.js";import"./searchable-select-03VdOYwD.js";import"./button-5O6wnTvY.js";import"./dialog-CA9NpDaA.js";import"./loader-circle-k9WscwaT.js";import"./useIntersectionObserver-BMoidOlM.js";import"./usePapers-B99b4fBf.js";import"./useInfiniteQuery-DWMGlrsa.js";const V=()=>{const{orgSlug:o}=t();return o?r.jsx(i,{organizationSlug:o}):r.jsx(m,{})};export{V as default};
 
 
assets/{OrganizationPaperFeed-CdsqFQ1J.js → OrganizationPaperFeed-BAdi7G6c.js} RENAMED
@@ -1 +1 @@
1
- import{j as e,r as b,b as L,u as H,a as W,L as D}from"./index-CIXevVP9.js";import{u as w}from"./useQuery-BHSsBDmJ.js";import{P as G}from"./components-BkZsumbI.js";import{M as K}from"./MarkdownText-DgCJo7yQ.js";import{S as $}from"./skeleton-BQDYAJTf.js";import{P as Q}from"./PaperFeedFilters-CNYrJoVb.js";import{A as Z,a as B}from"./alert-axJAQJuC.js";import{a as Y}from"./searchable-select-03VdOYwD.js";import{u as J}from"./useIntersectionObserver-BMoidOlM.js";import{d as V}from"./usePapers-B99b4fBf.js";import{d as E,t as X}from"./transform-CNyzjv1G.js";import ee from"./NotFound-CpcrlF99.js";const v=24*60*60*1e3,C=12,te=3,se=new Map([[1,"Mon"],[3,"Wed"],[5,"Fri"]]),R=s=>new Date(`${s}T00:00:00Z`),ae=s=>s.toISOString().slice(0,10),re=(s,c)=>{if(s===0)return 0;const l=c.findIndex(d=>s<=d);return l===-1?4:l+1},ne=s=>{const c=R(s.start_date),l=R(s.end_date),d=new Date(c.getTime()-c.getUTCDay()*v),j=new Date(l.getTime()+(6-l.getUTCDay())*v),g=new Map(s.results.map(a=>[a.date,a.paper_count])),h=s.results.map(a=>a.paper_count).sort((a,N)=>a-N),n=[.25,.5,.75].map(a=>h[Math.min(h.length-1,Math.floor(h.length*a))]??1),u=[];for(let a=d.getTime();a<=j.getTime();a+=v){const N=new Date(a),m=ae(N),_=a>=c.getTime()&&a<=l.getTime(),p=_?g.get(m)??0:0;u.push({key:m,date:N,count:p,inRange:_,level:re(p,n)})}const y=u.length/7,x=[];let f=-1;for(let a=0;a<y;a+=1){const m=u.slice(a*7,a*7+7).find(_=>_.inRange&&(a===0||_.date.getUTCDate()<=7));m&&m.date.getUTCMonth()!==f&&(f=m.date.getUTCMonth(),x.length>0&&a-x[x.length-1].column<3&&x.pop(),x.push({label:m.date.toLocaleString("en",{month:"short",timeZone:"UTC"}),column:a}))}return{days:u,months:x,weekCount:y}},ie=({data:s,organizationName:c})=>{const l=b.useRef(null),{days:d,months:j,weekCount:g}=b.useMemo(()=>ne(s),[s]),h=g*C+(g-1)*te;return b.useEffect(()=>{const n=l.current;n&&(n.scrollLeft=n.scrollWidth)},[g]),e.jsxs("section",{className:"organization-contributions","aria-labelledby":"organization-contributions-title",children:[e.jsxs("div",{className:"organization-contributions-header",children:[e.jsx("h2",{id:"organization-contributions-title",className:"organization-contributions-title",children:"Paper contributions"}),e.jsxs("p",{className:"organization-contributions-summary",children:[s.total_count.toLocaleString()," ",s.total_count===1?"paper":"papers"," published in the last year"]})]}),e.jsx("div",{className:"organization-contributions-scroll",ref:l,children:e.jsxs("div",{className:"organization-contributions-plot",style:{width:h+34},role:"img","aria-label":`${c} published ${s.total_count} papers in the last year`,children:[e.jsx("div",{className:"organization-contributions-weekdays","aria-hidden":"true",children:Array.from({length:7}).map((n,u)=>e.jsx("span",{children:se.get(u)??""},u))}),e.jsxs("div",{children:[e.jsx("div",{className:"organization-contributions-months",style:{width:h,gridTemplateColumns:`repeat(${g}, ${C}px)`},"aria-hidden":"true",children:j.map(n=>e.jsx("span",{style:{gridColumnStart:n.column+1},children:n.label},`${n.label}-${n.column}`))}),e.jsx("div",{className:"organization-contributions-grid",style:{width:h,gridTemplateColumns:`repeat(${g}, ${C}px)`},"aria-hidden":"true",children:d.map(n=>e.jsx("span",{className:`organization-contribution-cell ${n.inRange?`level-${n.level}`:"is-outside"}`,title:n.inRange?`${n.count} ${n.count===1?"paper":"papers"} on ${n.date.toLocaleDateString("en",{dateStyle:"long",timeZone:"UTC"})}`:void 0},n.key))})]})]})}),e.jsxs("div",{className:"organization-contributions-legend","aria-hidden":"true",children:[e.jsx("span",{children:"Fewer"}),[0,1,2,3,4].map(n=>e.jsx("span",{className:`organization-contribution-cell level-${n}`},n)),e.jsx("span",{children:"More"})]})]})},oe=({organizationSlug:s,organizationName:c})=>{const l=w({queryKey:["organization-contributions",s],queryFn:()=>L.getOrganizationContributions(s),staleTime:6e5});return l.isLoading?e.jsx($,{className:"organization-contributions-skeleton"}):l.data?e.jsx(ie,{data:l.data,organizationName:c}):null},le=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ce=s=>s==="date_published"||s==="citation_count"?s:"trending",ye=({organizationSlug:s,taskSlug:c})=>{var k,P,F,M,A,O,z,S;const l=H(),[d,j]=W(),[g,h]=b.useState(!1),n=ce(d.get("order_by")),u=d.get("has_code")==="true",y=d.get("has_hf_artifacts")==="true",x=w({queryKey:["organization",s],queryFn:()=>L.getOrganization(s),staleTime:10*60*1e3}),f=w({queryKey:["organization-areas-with-tasks",s],queryFn:()=>L.getOrganizationAreasWithTasks(s),staleTime:10*60*1e3}),a=V({organizationSlug:s,taskSlug:c,page_size:12,order_by:n,order_dir:"desc",include_resources:!0,has_code:u,has_hf_artifacts:y,enabled:!!s}),{targetRef:N,isIntersecting:m}=J({rootMargin:"200px"});b.useEffect(()=>{m&&a.hasNextPage&&!a.isFetchingNextPage&&a.fetchNextPage()},[m,a.hasNextPage,a.isFetchingNextPage]),b.useEffect(()=>{h(!1)},[s,c]);const _=b.useMemo(()=>{var r;return(((r=f.data)==null?void 0:r.results)??[]).flatMap(i=>i.tasks.filter(o=>!!o.slug).map(o=>({...o,slug:o.slug,label:E(o.name,o.slug)})))},[f.data]),p=_.find(r=>r.slug===c),T=b.useMemo(()=>{var r;return(((r=a.data)==null?void 0:r.pages)??[]).flatMap(i=>i.results.map(X))},[a.data]),t=x.data??((k=f.data)==null?void 0:k.organization),I=((F=(P=a.data)==null?void 0:P.pages[0])==null?void 0:F.count)??0;if(((M=x.error)==null?void 0:M.status)===404||((A=f.error)==null?void 0:A.status)===404||((O=a.error)==null?void 0:O.status)===404)return e.jsx(ee,{});if(f.error||a.error)return e.jsx("div",{className:"page",children:e.jsx(Z,{variant:"destructive",children:e.jsx(B,{children:"Failed to load organization papers. Please try again."})})});const U=r=>{const i=r.trim().toLocaleLowerCase();return _.filter(o=>`${o.label} ${o.slug}`.toLocaleLowerCase().includes(i)).map(o=>({value:o.slug,label:o.label,description:`${o.paper_count.toLocaleString()} ${o.paper_count===1?"paper":"papers"}`}))},q=r=>{const i=r==="__all__"?`/orgs/${s}`:`/orgs/${s}/${r}`,o=d.toString();l({pathname:i,search:o?`?${o}`:""})};return e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(D,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(D,{to:"/organizations",children:"Organizations"}),e.jsx("span",{children:" / "}),e.jsx("span",{children:(t==null?void 0:t.name)??s}),p&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:" / "}),e.jsx("span",{children:E(p.name,p.slug)})]})]}),e.jsxs("header",{className:"organization-hero",children:[e.jsxs("div",{className:"organization-hero-profile",children:[e.jsx("div",{className:"organizations-eyebrow",children:"ORGANIZATION"}),e.jsxs("h1",{className:"feed-title organization-hero-title",children:[t!=null&&t.logo_url&&!g?e.jsx("img",{src:t.logo_url,alt:"",width:58,height:58,onError:()=>h(!0)}):t?e.jsx("span",{className:"organization-logo organization-logo--fallback","aria-hidden":"true",children:t.name.slice(0,1).toUpperCase()}):null,(t==null?void 0:t.name)??e.jsx($,{className:"h-12 w-64"})]}),t&&e.jsxs("div",{className:"feed-subtitle",children:[((z=t.paper_count)==null?void 0:z.toLocaleString())??0," papers",(t.organization_trending_score??0)>0&&t.trending_rank&&e.jsxs(e.Fragment,{children:[" · #",t.trending_rank," trending this month"]})]}),(t==null?void 0:t.description)&&e.jsx(K,{className:"method-description",text:t.description}),t&&e.jsxs("div",{className:"organization-hero-links",children:[t.website_url&&e.jsx("a",{href:t.website_url,target:"_blank",rel:"noreferrer",children:"Website ↗"}),t.hf_url&&e.jsx("a",{href:t.hf_url,target:"_blank",rel:"noreferrer",children:"Hugging Face ↗"}),t.github_url&&e.jsx("a",{href:t.github_url,target:"_blank",rel:"noreferrer",children:"GitHub ↗"})]})]}),t&&e.jsx(oe,{organizationSlug:s,organizationName:t.name})]}),e.jsxs("div",{className:"sort-bar",style:{alignItems:"center",gap:16},children:[e.jsx("div",{style:{minWidth:260},children:e.jsx(Y,{value:c??"__all__",onChange:q,placeholder:"All tasks",searchPlaceholder:"Search organization tasks...",emptyMessage:"No matching tasks.",ariaLabel:"Filter papers by task",selectedOption:p?{value:p.slug,label:p.label,description:`${p.paper_count.toLocaleString()} ${p.paper_count===1?"paper":"papers"}`}:{value:"__all__",label:"All tasks",description:`${((S=t==null?void 0:t.paper_count)==null?void 0:S.toLocaleString())??0} papers`},queryKey:["organization-task-options",s],queryFn:async r=>{var i;return[{value:"__all__",label:"All tasks",description:`${((i=t==null?void 0:t.paper_count)==null?void 0:i.toLocaleString())??0} papers`},...U(r)]},enabled:!f.isLoading,className:"h-[38px]"})}),e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:le.map(([r,i])=>e.jsx("button",{type:"button",className:`sort-btn ${n===r?"active":""}`,onClick:()=>{const o=new URLSearchParams(d);r==="trending"?o.delete("order_by"):o.set("order_by",r),j(o)},children:i},r))}),e.jsx(Q,{hasCode:u,hasHfArtifacts:y,onHasCodeChange:r=>{const i=new URLSearchParams(d);r?i.set("has_code","true"):i.delete("has_code"),j(i)},onHasHfArtifactsChange:r=>{const i=new URLSearchParams(d);r?i.set("has_hf_artifacts","true"):i.delete("has_hf_artifacts"),j(i)}})]}),e.jsxs("div",{className:"results-count",children:[I.toLocaleString()," papers"]})]}),a.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((r,i)=>e.jsx($,{className:"h-40 w-full"},i))}):T.length===0?e.jsx("div",{className:"no-results",children:(t==null?void 0:t.paper_count)===0?"No papers indexed yet":"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:T.map((r,i)=>e.jsx(G,{paper:r,rank:i+1},r.id))}),e.jsx("div",{ref:N,style:{height:1}}),a.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center"},children:"Loading more…"})]})]})};export{ye as O};
 
1
+ import{j as e,r as b,b as L,u as H,a as W,L as D}from"./index-Bo5_2OqZ.js";import{u as w}from"./useQuery-Bh9FZQpL.js";import{P as G}from"./components-BbXgE2lV.js";import{M as K}from"./MarkdownText-VH1HEGnz.js";import{S as $}from"./skeleton-CB-heJjl.js";import{P as Q}from"./PaperFeedFilters-D2TbUu0j.js";import{A as Z,a as B}from"./alert-_EYQlDHA.js";import{a as Y}from"./searchable-select-DirckEhK.js";import{u as J}from"./useIntersectionObserver-7HCpY83L.js";import{d as V}from"./usePapers-CdB1OuZ5.js";import{d as E,t as X}from"./transform-2Gnjg1jt.js";import ee from"./NotFound-CN-zdP49.js";const v=24*60*60*1e3,C=12,te=3,se=new Map([[1,"Mon"],[3,"Wed"],[5,"Fri"]]),R=s=>new Date(`${s}T00:00:00Z`),ae=s=>s.toISOString().slice(0,10),re=(s,c)=>{if(s===0)return 0;const l=c.findIndex(d=>s<=d);return l===-1?4:l+1},ne=s=>{const c=R(s.start_date),l=R(s.end_date),d=new Date(c.getTime()-c.getUTCDay()*v),j=new Date(l.getTime()+(6-l.getUTCDay())*v),g=new Map(s.results.map(a=>[a.date,a.paper_count])),h=s.results.map(a=>a.paper_count).sort((a,N)=>a-N),n=[.25,.5,.75].map(a=>h[Math.min(h.length-1,Math.floor(h.length*a))]??1),u=[];for(let a=d.getTime();a<=j.getTime();a+=v){const N=new Date(a),m=ae(N),_=a>=c.getTime()&&a<=l.getTime(),p=_?g.get(m)??0:0;u.push({key:m,date:N,count:p,inRange:_,level:re(p,n)})}const y=u.length/7,x=[];let f=-1;for(let a=0;a<y;a+=1){const m=u.slice(a*7,a*7+7).find(_=>_.inRange&&(a===0||_.date.getUTCDate()<=7));m&&m.date.getUTCMonth()!==f&&(f=m.date.getUTCMonth(),x.length>0&&a-x[x.length-1].column<3&&x.pop(),x.push({label:m.date.toLocaleString("en",{month:"short",timeZone:"UTC"}),column:a}))}return{days:u,months:x,weekCount:y}},ie=({data:s,organizationName:c})=>{const l=b.useRef(null),{days:d,months:j,weekCount:g}=b.useMemo(()=>ne(s),[s]),h=g*C+(g-1)*te;return b.useEffect(()=>{const n=l.current;n&&(n.scrollLeft=n.scrollWidth)},[g]),e.jsxs("section",{className:"organization-contributions","aria-labelledby":"organization-contributions-title",children:[e.jsxs("div",{className:"organization-contributions-header",children:[e.jsx("h2",{id:"organization-contributions-title",className:"organization-contributions-title",children:"Paper contributions"}),e.jsxs("p",{className:"organization-contributions-summary",children:[s.total_count.toLocaleString()," ",s.total_count===1?"paper":"papers"," published in the last year"]})]}),e.jsx("div",{className:"organization-contributions-scroll",ref:l,children:e.jsxs("div",{className:"organization-contributions-plot",style:{width:h+34},role:"img","aria-label":`${c} published ${s.total_count} papers in the last year`,children:[e.jsx("div",{className:"organization-contributions-weekdays","aria-hidden":"true",children:Array.from({length:7}).map((n,u)=>e.jsx("span",{children:se.get(u)??""},u))}),e.jsxs("div",{children:[e.jsx("div",{className:"organization-contributions-months",style:{width:h,gridTemplateColumns:`repeat(${g}, ${C}px)`},"aria-hidden":"true",children:j.map(n=>e.jsx("span",{style:{gridColumnStart:n.column+1},children:n.label},`${n.label}-${n.column}`))}),e.jsx("div",{className:"organization-contributions-grid",style:{width:h,gridTemplateColumns:`repeat(${g}, ${C}px)`},"aria-hidden":"true",children:d.map(n=>e.jsx("span",{className:`organization-contribution-cell ${n.inRange?`level-${n.level}`:"is-outside"}`,title:n.inRange?`${n.count} ${n.count===1?"paper":"papers"} on ${n.date.toLocaleDateString("en",{dateStyle:"long",timeZone:"UTC"})}`:void 0},n.key))})]})]})}),e.jsxs("div",{className:"organization-contributions-legend","aria-hidden":"true",children:[e.jsx("span",{children:"Fewer"}),[0,1,2,3,4].map(n=>e.jsx("span",{className:`organization-contribution-cell level-${n}`},n)),e.jsx("span",{children:"More"})]})]})},oe=({organizationSlug:s,organizationName:c})=>{const l=w({queryKey:["organization-contributions",s],queryFn:()=>L.getOrganizationContributions(s),staleTime:6e5});return l.isLoading?e.jsx($,{className:"organization-contributions-skeleton"}):l.data?e.jsx(ie,{data:l.data,organizationName:c}):null},le=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ce=s=>s==="date_published"||s==="citation_count"?s:"trending",ye=({organizationSlug:s,taskSlug:c})=>{var k,P,F,M,A,O,z,S;const l=H(),[d,j]=W(),[g,h]=b.useState(!1),n=ce(d.get("order_by")),u=d.get("has_code")==="true",y=d.get("has_hf_artifacts")==="true",x=w({queryKey:["organization",s],queryFn:()=>L.getOrganization(s),staleTime:10*60*1e3}),f=w({queryKey:["organization-areas-with-tasks",s],queryFn:()=>L.getOrganizationAreasWithTasks(s),staleTime:10*60*1e3}),a=V({organizationSlug:s,taskSlug:c,page_size:12,order_by:n,order_dir:"desc",include_resources:!0,has_code:u,has_hf_artifacts:y,enabled:!!s}),{targetRef:N,isIntersecting:m}=J({rootMargin:"200px"});b.useEffect(()=>{m&&a.hasNextPage&&!a.isFetchingNextPage&&a.fetchNextPage()},[m,a.hasNextPage,a.isFetchingNextPage]),b.useEffect(()=>{h(!1)},[s,c]);const _=b.useMemo(()=>{var r;return(((r=f.data)==null?void 0:r.results)??[]).flatMap(i=>i.tasks.filter(o=>!!o.slug).map(o=>({...o,slug:o.slug,label:E(o.name,o.slug)})))},[f.data]),p=_.find(r=>r.slug===c),T=b.useMemo(()=>{var r;return(((r=a.data)==null?void 0:r.pages)??[]).flatMap(i=>i.results.map(X))},[a.data]),t=x.data??((k=f.data)==null?void 0:k.organization),I=((F=(P=a.data)==null?void 0:P.pages[0])==null?void 0:F.count)??0;if(((M=x.error)==null?void 0:M.status)===404||((A=f.error)==null?void 0:A.status)===404||((O=a.error)==null?void 0:O.status)===404)return e.jsx(ee,{});if(f.error||a.error)return e.jsx("div",{className:"page",children:e.jsx(Z,{variant:"destructive",children:e.jsx(B,{children:"Failed to load organization papers. Please try again."})})});const U=r=>{const i=r.trim().toLocaleLowerCase();return _.filter(o=>`${o.label} ${o.slug}`.toLocaleLowerCase().includes(i)).map(o=>({value:o.slug,label:o.label,description:`${o.paper_count.toLocaleString()} ${o.paper_count===1?"paper":"papers"}`}))},q=r=>{const i=r==="__all__"?`/orgs/${s}`:`/orgs/${s}/${r}`,o=d.toString();l({pathname:i,search:o?`?${o}`:""})};return e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(D,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(D,{to:"/organizations",children:"Organizations"}),e.jsx("span",{children:" / "}),e.jsx("span",{children:(t==null?void 0:t.name)??s}),p&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:" / "}),e.jsx("span",{children:E(p.name,p.slug)})]})]}),e.jsxs("header",{className:"organization-hero",children:[e.jsxs("div",{className:"organization-hero-profile",children:[e.jsx("div",{className:"organizations-eyebrow",children:"ORGANIZATION"}),e.jsxs("h1",{className:"feed-title organization-hero-title",children:[t!=null&&t.logo_url&&!g?e.jsx("img",{src:t.logo_url,alt:"",width:58,height:58,onError:()=>h(!0)}):t?e.jsx("span",{className:"organization-logo organization-logo--fallback","aria-hidden":"true",children:t.name.slice(0,1).toUpperCase()}):null,(t==null?void 0:t.name)??e.jsx($,{className:"h-12 w-64"})]}),t&&e.jsxs("div",{className:"feed-subtitle",children:[((z=t.paper_count)==null?void 0:z.toLocaleString())??0," papers",(t.organization_trending_score??0)>0&&t.trending_rank&&e.jsxs(e.Fragment,{children:[" · #",t.trending_rank," trending this month"]})]}),(t==null?void 0:t.description)&&e.jsx(K,{className:"method-description",text:t.description}),t&&e.jsxs("div",{className:"organization-hero-links",children:[t.website_url&&e.jsx("a",{href:t.website_url,target:"_blank",rel:"noreferrer",children:"Website ↗"}),t.hf_url&&e.jsx("a",{href:t.hf_url,target:"_blank",rel:"noreferrer",children:"Hugging Face ↗"}),t.github_url&&e.jsx("a",{href:t.github_url,target:"_blank",rel:"noreferrer",children:"GitHub ↗"})]})]}),t&&e.jsx(oe,{organizationSlug:s,organizationName:t.name})]}),e.jsxs("div",{className:"sort-bar",style:{alignItems:"center",gap:16},children:[e.jsx("div",{style:{minWidth:260},children:e.jsx(Y,{value:c??"__all__",onChange:q,placeholder:"All tasks",searchPlaceholder:"Search organization tasks...",emptyMessage:"No matching tasks.",ariaLabel:"Filter papers by task",selectedOption:p?{value:p.slug,label:p.label,description:`${p.paper_count.toLocaleString()} ${p.paper_count===1?"paper":"papers"}`}:{value:"__all__",label:"All tasks",description:`${((S=t==null?void 0:t.paper_count)==null?void 0:S.toLocaleString())??0} papers`},queryKey:["organization-task-options",s],queryFn:async r=>{var i;return[{value:"__all__",label:"All tasks",description:`${((i=t==null?void 0:t.paper_count)==null?void 0:i.toLocaleString())??0} papers`},...U(r)]},enabled:!f.isLoading,className:"h-[38px]"})}),e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:le.map(([r,i])=>e.jsx("button",{type:"button",className:`sort-btn ${n===r?"active":""}`,onClick:()=>{const o=new URLSearchParams(d);r==="trending"?o.delete("order_by"):o.set("order_by",r),j(o)},children:i},r))}),e.jsx(Q,{hasCode:u,hasHfArtifacts:y,onHasCodeChange:r=>{const i=new URLSearchParams(d);r?i.set("has_code","true"):i.delete("has_code"),j(i)},onHasHfArtifactsChange:r=>{const i=new URLSearchParams(d);r?i.set("has_hf_artifacts","true"):i.delete("has_hf_artifacts"),j(i)}})]}),e.jsxs("div",{className:"results-count",children:[I.toLocaleString()," papers"]})]}),a.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((r,i)=>e.jsx($,{className:"h-40 w-full"},i))}):T.length===0?e.jsx("div",{className:"no-results",children:(t==null?void 0:t.paper_count)===0?"No papers indexed yet":"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:T.map((r,i)=>e.jsx(G,{paper:r,rank:i+1},r.id))}),e.jsx("div",{ref:N,style:{height:1}}),a.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center"},children:"Loading more…"})]})]})};export{ye as O};
assets/OrganizationTaskView-DRLz5DdM.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{e as i,j as t}from"./index-Bo5_2OqZ.js";import{O as m}from"./OrganizationPaperFeed-BAdi7G6c.js";import p from"./NotFound-CN-zdP49.js";import"./useQuery-Bh9FZQpL.js";import"./useBaseQuery-B8T7kRNC.js";import"./components-BbXgE2lV.js";import"./LatexTitle-qoY4vrTZ.js";import"./katex.min-BSBacQyE.js";import"./transform-2Gnjg1jt.js";import"./MarkdownText-VH1HEGnz.js";import"./PaperPreviewLink-DTmodbgi.js";import"./index-C-0CcYmz.js";import"./hover-card-DrtqDSb0.js";import"./skeleton-CB-heJjl.js";import"./PaperFeedFilters-D2TbUu0j.js";import"./alert-_EYQlDHA.js";import"./searchable-select-DirckEhK.js";import"./button-D8mDpZUh.js";import"./dialog-BAxsIFdN.js";import"./loader-circle-L2ccNPQf.js";import"./useIntersectionObserver-7HCpY83L.js";import"./usePapers-CdB1OuZ5.js";import"./useInfiniteQuery-CzzYUeDW.js";const V=()=>{const{orgSlug:o,taskSlug:r}=i();return o&&r?t.jsx(m,{organizationSlug:o,taskSlug:r}):t.jsx(p,{})};export{V as default};
assets/OrganizationTaskView-DwdEDcfd.js DELETED
@@ -1 +0,0 @@
1
- import{e as i,j as t}from"./index-CIXevVP9.js";import{O as m}from"./OrganizationPaperFeed-CdsqFQ1J.js";import p from"./NotFound-CpcrlF99.js";import"./useQuery-BHSsBDmJ.js";import"./useBaseQuery-BL30DOiU.js";import"./components-BkZsumbI.js";import"./LatexTitle-BmUg2c3G.js";import"./katex.min-BSBacQyE.js";import"./transform-CNyzjv1G.js";import"./MarkdownText-DgCJo7yQ.js";import"./PaperPreviewLink-C7g07Bf-.js";import"./index-CDHG1Gvn.js";import"./hover-card-B7gdr0Iw.js";import"./skeleton-BQDYAJTf.js";import"./PaperFeedFilters-CNYrJoVb.js";import"./alert-axJAQJuC.js";import"./searchable-select-03VdOYwD.js";import"./button-5O6wnTvY.js";import"./dialog-CA9NpDaA.js";import"./loader-circle-k9WscwaT.js";import"./useIntersectionObserver-BMoidOlM.js";import"./usePapers-B99b4fBf.js";import"./useInfiniteQuery-DWMGlrsa.js";const V=()=>{const{orgSlug:o,taskSlug:r}=i();return o&&r?t.jsx(m,{organizationSlug:o,taskSlug:r}):t.jsx(p,{})};export{V as default};
 
 
assets/{OrganizationsIndexView-BZD0q5rr.js → OrganizationsIndexView-BFEZ8aLZ.js} RENAMED
@@ -1 +1 @@
1
- import{a as u,r as g,j as e,L as x,b as j}from"./index-CIXevVP9.js";import{u as y}from"./useQuery-BHSsBDmJ.js";import{A as f,a as _}from"./alert-axJAQJuC.js";import{S as N}from"./skeleton-BQDYAJTf.js";import"./useBaseQuery-BL30DOiU.js";const v=n=>n==="papers"||n==="name"?n:"trending",S=({organization:n})=>{const[d,t]=g.useState(!1);return!n.logo_url||d?e.jsx("span",{className:"organization-logo organization-logo--fallback","aria-hidden":"true",children:n.name.slice(0,1).toUpperCase()}):e.jsx("span",{className:"organization-logo",children:e.jsx("img",{src:n.logo_url,alt:"",width:48,height:48,onError:()=>t(!0)})})},q=()=>{var h;const[n,d]=u(),t=v(n.get("sort")),c=n.get("q")??"",o=y({queryKey:["organizations","featured"],queryFn:()=>j.getOrganizations(!0),staleTime:10*60*1e3}),p=s=>{const a=new URLSearchParams(n),i=s.sort??t,r=s.query??c;i==="trending"?a.delete("sort"):a.set("sort",i),r.trim()?a.set("q",r):a.delete("q"),d(a)},m=g.useMemo(()=>{var i;const s=c.trim().toLocaleLowerCase(),a=(((i=o.data)==null?void 0:i.results)??[]).filter(r=>[r.name,r.slug,r.hf_slug??""].join(" ").toLocaleLowerCase().includes(s));return t==="papers"?[...a].sort((r,l)=>(l.paper_count??0)-(r.paper_count??0)||r.name.localeCompare(l.name)||r.slug.localeCompare(l.slug)):t==="name"?[...a].sort((r,l)=>r.name.localeCompare(l.name)||r.slug.localeCompare(l.slug)):a},[o.data,c,t]);return e.jsxs("div",{className:"page organizations-page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["AI ",e.jsx("em",{children:"Organizations"})]}),e.jsx("div",{className:"feed-subtitle",children:"Explore papers from 21 leading AI organizations, ranked by sustained community momentum over the past 30 days."})]})}),e.jsxs("section",{"aria-labelledby":"organizations-heading",children:[e.jsxs("div",{className:"organizations-section-heading",children:[e.jsxs("h2",{id:"organizations-heading",children:[((h=o.data)==null?void 0:h.count)??21," organizations"]}),e.jsx("span",{children:t==="trending"?"Ranked by 30-day momentum":t==="papers"?"Sorted by linked papers":"Sorted A–Z"})]}),e.jsxs("div",{className:"organizations-controls",children:[e.jsxs("label",{children:[e.jsx("span",{className:"sr-only",children:"Search organizations"}),e.jsx("input",{type:"search",value:c,onChange:s=>p({query:s.target.value}),placeholder:"Search organizations"})]}),e.jsx("div",{className:"organizations-sort","aria-label":"Sort organizations",children:[["trending","Trending"],["papers","Most papers"],["name","A–Z"]].map(([s,a])=>e.jsx("button",{type:"button",className:t===s?"active":"","aria-pressed":t===s,onClick:()=>p({sort:s}),children:a},s))})]}),o.isLoading?e.jsx("div",{className:"organizations-grid","aria-busy":"true",children:Array.from({length:6}).map((s,a)=>e.jsx(N,{className:"organization-card-skeleton"},a))}):o.error?e.jsx(f,{variant:"destructive",children:e.jsxs(_,{children:["Failed to load organizations."," ",e.jsx("button",{type:"button",onClick:()=>o.refetch(),children:"Try again"})]})}):m.length===0?e.jsxs("div",{className:"organizations-empty",children:["No organizations match “",c,"”."]}):e.jsx("div",{className:"organizations-grid",children:m.map(s=>{var r;const a=s.paper_count??0,i=s.first_paper_year&&s.latest_paper_year?s.first_paper_year===s.latest_paper_year?String(s.first_paper_year):`${s.first_paper_year}–${s.latest_paper_year}`:null;return e.jsxs(x,{to:`/orgs/${s.slug}`,className:"organization-card","aria-label":a?`Browse ${a.toLocaleString()} ${s.name} papers`:`Browse ${s.name} papers`,children:[e.jsxs("div",{className:"organization-card-header",children:[e.jsx(S,{organization:s}),e.jsxs("div",{children:[e.jsx("h3",{children:s.name}),e.jsxs("span",{children:["@",s.hf_slug??s.slug]})]})]}),e.jsxs("div",{className:"organization-card-metrics",children:[e.jsx("strong",{children:a.toLocaleString()}),e.jsx("span",{children:a===1?"paper":"papers"}),t==="trending"&&s.trending_rank&&e.jsxs("span",{className:"organization-rank",children:["#",s.trending_rank]})]}),e.jsxs("div",{className:"organization-highlight",children:[e.jsx("span",{children:"Trending paper"}),e.jsx("strong",{children:((r=s.top_trending_paper)==null?void 0:r.title)??"No papers indexed yet"})]}),e.jsxs("div",{className:"organization-card-footer",children:[i?`Publishing ${i}`:"Research archive ready",e.jsx("span",{"aria-hidden":"true",children:"↗"})]})]},s.id)})})]})]})};export{q as default};
 
1
+ import{a as u,r as g,j as e,L as x,b as j}from"./index-Bo5_2OqZ.js";import{u as y}from"./useQuery-Bh9FZQpL.js";import{A as f,a as _}from"./alert-_EYQlDHA.js";import{S as N}from"./skeleton-CB-heJjl.js";import"./useBaseQuery-B8T7kRNC.js";const v=n=>n==="papers"||n==="name"?n:"trending",S=({organization:n})=>{const[d,t]=g.useState(!1);return!n.logo_url||d?e.jsx("span",{className:"organization-logo organization-logo--fallback","aria-hidden":"true",children:n.name.slice(0,1).toUpperCase()}):e.jsx("span",{className:"organization-logo",children:e.jsx("img",{src:n.logo_url,alt:"",width:48,height:48,onError:()=>t(!0)})})},q=()=>{var h;const[n,d]=u(),t=v(n.get("sort")),c=n.get("q")??"",o=y({queryKey:["organizations","featured"],queryFn:()=>j.getOrganizations(!0),staleTime:10*60*1e3}),p=s=>{const a=new URLSearchParams(n),i=s.sort??t,r=s.query??c;i==="trending"?a.delete("sort"):a.set("sort",i),r.trim()?a.set("q",r):a.delete("q"),d(a)},m=g.useMemo(()=>{var i;const s=c.trim().toLocaleLowerCase(),a=(((i=o.data)==null?void 0:i.results)??[]).filter(r=>[r.name,r.slug,r.hf_slug??""].join(" ").toLocaleLowerCase().includes(s));return t==="papers"?[...a].sort((r,l)=>(l.paper_count??0)-(r.paper_count??0)||r.name.localeCompare(l.name)||r.slug.localeCompare(l.slug)):t==="name"?[...a].sort((r,l)=>r.name.localeCompare(l.name)||r.slug.localeCompare(l.slug)):a},[o.data,c,t]);return e.jsxs("div",{className:"page organizations-page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["AI ",e.jsx("em",{children:"Organizations"})]}),e.jsx("div",{className:"feed-subtitle",children:"Explore papers from 21 leading AI organizations, ranked by sustained community momentum over the past 30 days."})]})}),e.jsxs("section",{"aria-labelledby":"organizations-heading",children:[e.jsxs("div",{className:"organizations-section-heading",children:[e.jsxs("h2",{id:"organizations-heading",children:[((h=o.data)==null?void 0:h.count)??21," organizations"]}),e.jsx("span",{children:t==="trending"?"Ranked by 30-day momentum":t==="papers"?"Sorted by linked papers":"Sorted A–Z"})]}),e.jsxs("div",{className:"organizations-controls",children:[e.jsxs("label",{children:[e.jsx("span",{className:"sr-only",children:"Search organizations"}),e.jsx("input",{type:"search",value:c,onChange:s=>p({query:s.target.value}),placeholder:"Search organizations"})]}),e.jsx("div",{className:"organizations-sort","aria-label":"Sort organizations",children:[["trending","Trending"],["papers","Most papers"],["name","A–Z"]].map(([s,a])=>e.jsx("button",{type:"button",className:t===s?"active":"","aria-pressed":t===s,onClick:()=>p({sort:s}),children:a},s))})]}),o.isLoading?e.jsx("div",{className:"organizations-grid","aria-busy":"true",children:Array.from({length:6}).map((s,a)=>e.jsx(N,{className:"organization-card-skeleton"},a))}):o.error?e.jsx(f,{variant:"destructive",children:e.jsxs(_,{children:["Failed to load organizations."," ",e.jsx("button",{type:"button",onClick:()=>o.refetch(),children:"Try again"})]})}):m.length===0?e.jsxs("div",{className:"organizations-empty",children:["No organizations match “",c,"”."]}):e.jsx("div",{className:"organizations-grid",children:m.map(s=>{var r;const a=s.paper_count??0,i=s.first_paper_year&&s.latest_paper_year?s.first_paper_year===s.latest_paper_year?String(s.first_paper_year):`${s.first_paper_year}–${s.latest_paper_year}`:null;return e.jsxs(x,{to:`/orgs/${s.slug}`,className:"organization-card","aria-label":a?`Browse ${a.toLocaleString()} ${s.name} papers`:`Browse ${s.name} papers`,children:[e.jsxs("div",{className:"organization-card-header",children:[e.jsx(S,{organization:s}),e.jsxs("div",{children:[e.jsx("h3",{children:s.name}),e.jsxs("span",{children:["@",s.hf_slug??s.slug]})]})]}),e.jsxs("div",{className:"organization-card-metrics",children:[e.jsx("strong",{children:a.toLocaleString()}),e.jsx("span",{children:a===1?"paper":"papers"}),t==="trending"&&s.trending_rank&&e.jsxs("span",{className:"organization-rank",children:["#",s.trending_rank]})]}),e.jsxs("div",{className:"organization-highlight",children:[e.jsx("span",{children:"Trending paper"}),e.jsx("strong",{children:((r=s.top_trending_paper)==null?void 0:r.title)??"No papers indexed yet"})]}),e.jsxs("div",{className:"organization-card-footer",children:[i?`Publishing ${i}`:"Research archive ready",e.jsx("span",{"aria-hidden":"true",children:"↗"})]})]},s.id)})})]})]})};export{q as default};
assets/{PaperDetailView-DLxK2pqr.js → PaperDetailView-DAPjYsXV.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{c as bt,l as Ws,r as m,j as e,P as as,m as _e,n as rs,o as Te,p as Le,q as ns,s as jt,C as je,t as Qe,v as me,g as he,X as is,w as ve,x as Ys,y as os,z as Zs,A as ea,B as ta,D as sa,E as aa,F as Kt,G as ra,H as na,I as ia,J as oa,K as la,f as Je,R as vt,b as ge,M as ls,d as cs,N as ca,O as da,Q as ua,S as ds,T as ma,e as ha,U as pa,u as fa,V as xa,L as xe,W as ga,Y as ba,Z as ja,_ as va,$ as ya,a0 as _a,a1 as ka}from"./index-CIXevVP9.js";import{u as re}from"./useQuery-BHSsBDmJ.js";import{I as J,S as wa,a as Na,T as Ca,M as Ea}from"./components-BkZsumbI.js";import{C as Sa,E as Ra}from"./ExternalSourceEvalBadge-B5FVP6Hj.js";import{L as qe,a as Pa}from"./LatexTitle-BmUg2c3G.js";import{c as Aa}from"./transform-CNyzjv1G.js";import{f as $a,D as Ia}from"./latexPlainText-DI8YEXVe.js";import{a as Fa}from"./usePapers-B99b4fBf.js";import{S as $e}from"./skeleton-BQDYAJTf.js";import{A as La,a as Ta}from"./alert-axJAQJuC.js";import{B as H}from"./button-5O6wnTvY.js";import{u as us}from"./index-xYsFHVgN.js";import{I as Z}from"./textarea-CcQVD6R-.js";import{D as ie,a as oe,b as le,c as ce,d as de,e as ue}from"./dialog-CA9NpDaA.js";import{u as pe}from"./useMutation-CDeysSx_.js";import{S as yt,P as Xe,L as ae,a as Ua}from"./SignInToEditDialog-BJmkw1tr.js";import{S as Ve,a as Ot}from"./searchable-select-03VdOYwD.js";import{L as ne}from"./loader-circle-k9WscwaT.js";import{B as ms,D as Da,c as Ba,g as Ma,s as Ha,a as qa,b as za,d as Ka,i as Oa,e as Ga}from"./codexAddEvals-DqxQQWJl.js";import{G as Gt}from"./github-BxICrwzp.js";import{M as Qa,r as Va}from"./index-CDHG1Gvn.js";import"./useBaseQuery-BL30DOiU.js";import"./hover-card-B7gdr0Iw.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-DWMGlrsa.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{c as bt,m as Ws,r as m,j as e,P as as,n as _e,o as rs,p as Te,q as Le,s as ns,t as jt,C as je,v as Qe,h as me,g as he,X as is,w as ve,x as Ys,y as os,z as Zs,A as ea,B as ta,D as sa,E as aa,F as Kt,G as ra,H as na,I as ia,J as oa,K as la,f as Je,R as vt,b as ge,M as ls,d as cs,N as ca,O as da,Q as ua,S as ds,T as ma,e as ha,U as pa,u as fa,V as xa,L as xe,W as ga,Y as ba,Z as ja,_ as va,$ as ya,a0 as _a,a1 as ka}from"./index-Bo5_2OqZ.js";import{u as re}from"./useQuery-Bh9FZQpL.js";import{I as J,S as wa,a as Na,T as Ca,M as Ea}from"./components-BbXgE2lV.js";import{C as Sa,E as Ra}from"./ExternalSourceEvalBadge-BYtEDxNm.js";import{L as qe,a as Pa}from"./LatexTitle-qoY4vrTZ.js";import{c as Aa}from"./transform-2Gnjg1jt.js";import{f as $a,D as Ia}from"./latexPlainText-DI8YEXVe.js";import{a as Fa}from"./usePapers-CdB1OuZ5.js";import{S as $e}from"./skeleton-CB-heJjl.js";import{A as La,a as Ta}from"./alert-_EYQlDHA.js";import{B as H}from"./button-D8mDpZUh.js";import{u as us}from"./index-DWt5uuhX.js";import{I as Z}from"./textarea-Cr9wwZtd.js";import{D as ie,a as oe,b as le,c as ce,d as de,e as ue}from"./dialog-BAxsIFdN.js";import{u as pe}from"./useMutation-B8C_NgT5.js";import{S as yt,P as Xe,L as ae,a as Ua}from"./SignInToEditDialog-DW_1sVXp.js";import{S as Ve,a as Ot}from"./searchable-select-DirckEhK.js";import{L as ne}from"./loader-circle-L2ccNPQf.js";import{B as ms,D as Da,c as Ba,g as Ma,s as Ha,a as qa,b as za,d as Ka,i as Oa,e as Ga}from"./codexAddEvals-NAKdH-Ge.js";import{G as Gt}from"./github-D8cWDRad.js";import{M as Qa,r as Va}from"./index-C-0CcYmz.js";import"./useBaseQuery-B8T7kRNC.js";import"./hover-card-DrtqDSb0.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-CzzYUeDW.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{PaperFeedFilters-CNYrJoVb.js → PaperFeedFilters-D2TbUu0j.js} RENAMED
@@ -1 +1 @@
1
- import{j as e}from"./index-CIXevVP9.js";import{I as i}from"./components-BkZsumbI.js";const n=()=>e.jsxs("span",{className:"hf-resource-logo",children:[e.jsx("img",{className:"hf-resource-logo-black",src:"/hf-logo-monochrome-black.svg?v=20260729",alt:""}),e.jsx("img",{className:"hf-resource-logo-white",src:"/hf-logo-monochrome-white.svg?v=20260729",alt:""})]}),l=({checked:s,icon:a,label:r,onChange:o})=>e.jsxs("button",{type:"button",className:`paper-feed-filter ${s?"active":""}`,"aria-pressed":s,onClick:()=>o(!s),children:[e.jsxs("span",{className:"paper-feed-filter-content",children:[e.jsx("span",{className:"paper-feed-filter-icon","aria-hidden":"true",children:a}),r]}),s&&e.jsx("span",{className:"paper-feed-filter-check","aria-hidden":"true",children:"✓"})]}),d=({hasCode:s,hasHfArtifacts:a,onHasCodeChange:r,onHasHfArtifactsChange:o,showDivider:c=!0})=>e.jsxs("div",{className:"paper-feed-resource-controls",role:"group","aria-label":"Resource filters",children:[c&&e.jsx("span",{className:"paper-feed-resource-divider","aria-hidden":"true"}),e.jsxs("div",{className:"paper-feed-filter-options",children:[e.jsx(l,{checked:s,icon:e.jsx(i,{name:"github",size:14}),label:"Has code",onChange:r}),e.jsx(l,{checked:a,icon:e.jsx(n,{}),label:"Has artifacts",onChange:o})]})]});export{d as P};
 
1
+ import{j as e}from"./index-Bo5_2OqZ.js";import{I as i}from"./components-BbXgE2lV.js";const n=()=>e.jsxs("span",{className:"hf-resource-logo",children:[e.jsx("img",{className:"hf-resource-logo-black",src:"/hf-logo-monochrome-black.svg?v=20260729",alt:""}),e.jsx("img",{className:"hf-resource-logo-white",src:"/hf-logo-monochrome-white.svg?v=20260729",alt:""})]}),l=({checked:s,icon:a,label:r,onChange:o})=>e.jsxs("button",{type:"button",className:`paper-feed-filter ${s?"active":""}`,"aria-pressed":s,onClick:()=>o(!s),children:[e.jsxs("span",{className:"paper-feed-filter-content",children:[e.jsx("span",{className:"paper-feed-filter-icon","aria-hidden":"true",children:a}),r]}),s&&e.jsx("span",{className:"paper-feed-filter-check","aria-hidden":"true",children:"✓"})]}),d=({hasCode:s,hasHfArtifacts:a,onHasCodeChange:r,onHasHfArtifactsChange:o,showDivider:c=!0})=>e.jsxs("div",{className:"paper-feed-resource-controls",role:"group","aria-label":"Resource filters",children:[c&&e.jsx("span",{className:"paper-feed-resource-divider","aria-hidden":"true"}),e.jsxs("div",{className:"paper-feed-filter-options",children:[e.jsx(l,{checked:s,icon:e.jsx(i,{name:"github",size:14}),label:"Has code",onChange:r}),e.jsx(l,{checked:a,icon:e.jsx(n,{}),label:"Has artifacts",onChange:o})]})]});export{d as P};
assets/{PaperPreviewLink-C7g07Bf-.js → PaperPreviewLink-DTmodbgi.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{o as F,l as ne,f as v,m as b,a as re,p as I,b as $,n as L,h as ie,s as ae,c as oe,v as se,S as le}from"./index-CDHG1Gvn.js";import{k as z}from"./katex.min-BSBacQyE.js";import{j as f,R as T,$ as ce,U as ue,L as he,am as pe}from"./index-CIXevVP9.js";import{u as me}from"./useQuery-BHSsBDmJ.js";import{H as fe,a as de,b as ge}from"./hover-card-B7gdr0Iw.js";function xe(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:o},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:l,mathText:s,mathTextData:l}};function e(a){const u={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[u]}},a)}function t(){this.buffer()}function n(){const a=this.resume(),u=this.stack[this.stack.length-1];F(u.type==="math"),u.meta=a}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(a){const u=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),p=this.stack[this.stack.length-1];F(p.type==="math"),this.exit(a),p.value=u;const m=p.data.hChildren[0];F(m.type==="element"),F(m.tagName==="code"),m.children.push({type:"text",value:u}),this.data.mathFlowInside=void 0}function o(a){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},a),this.buffer()}function s(a){const u=this.resume(),p=this.stack[this.stack.length-1];F(p.type==="inlineMath"),this.exit(a),p.value=u,p.data.hChildren.push({type:"text",value:u})}function l(a){this.config.enter.data.call(this,a),this.config.exit.data.call(this,a)}}function ye(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),r.peek=i,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:`
2
  `,inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:n,inlineMath:r}};function n(o,s,l,a){const u=o.value||"",p=l.createTracker(a),m="$".repeat(Math.max(ne(u,"$")+1,2)),g=l.enter("mathFlow");let x=p.move(m);if(o.meta){const d=l.enter("mathFlowMeta");x+=p.move(l.safe(o.meta,{after:`
3
  `,before:x,encode:["$"],...p.current()})),d()}return x+=p.move(`
4
  `),u&&(x+=p.move(u+`
 
1
+ import{o as F,l as ne,f as v,m as b,a as re,p as I,b as $,n as L,h as ie,s as ae,c as oe,v as se,S as le}from"./index-C-0CcYmz.js";import{k as z}from"./katex.min-BSBacQyE.js";import{j as f,R as T,$ as ce,U as ue,L as he,am as pe}from"./index-Bo5_2OqZ.js";import{u as me}from"./useQuery-Bh9FZQpL.js";import{H as fe,a as de,b as ge}from"./hover-card-DrtqDSb0.js";function xe(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:o},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:l,mathText:s,mathTextData:l}};function e(a){const u={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[u]}},a)}function t(){this.buffer()}function n(){const a=this.resume(),u=this.stack[this.stack.length-1];F(u.type==="math"),u.meta=a}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(a){const u=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),p=this.stack[this.stack.length-1];F(p.type==="math"),this.exit(a),p.value=u;const m=p.data.hChildren[0];F(m.type==="element"),F(m.tagName==="code"),m.children.push({type:"text",value:u}),this.data.mathFlowInside=void 0}function o(a){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},a),this.buffer()}function s(a){const u=this.resume(),p=this.stack[this.stack.length-1];F(p.type==="inlineMath"),this.exit(a),p.value=u,p.data.hChildren.push({type:"text",value:u})}function l(a){this.config.enter.data.call(this,a),this.config.exit.data.call(this,a)}}function ye(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),r.peek=i,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:`
2
  `,inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:n,inlineMath:r}};function n(o,s,l,a){const u=o.value||"",p=l.createTracker(a),m="$".repeat(Math.max(ne(u,"$")+1,2)),g=l.enter("mathFlow");let x=p.move(m);if(o.meta){const d=l.enter("mathFlowMeta");x+=p.move(l.safe(o.meta,{after:`
3
  `,before:x,encode:["$"],...p.current()})),d()}return x+=p.move(`
4
  `),u&&(x+=p.move(u+`
assets/{PapersListView-DihOwzEz.js → PapersListView-CiElqeZj.js} RENAMED
@@ -1 +1 @@
1
- import{a as A,r as i,j as e,L as I,b as T}from"./index-CIXevVP9.js";import{I as F,P as L}from"./components-BkZsumbI.js";import{t as C,d as R}from"./transform-CNyzjv1G.js";import{u as k}from"./usePapers-B99b4fBf.js";import{u as D}from"./useDebounce-BIllS1Ow.js";import{u as E,P as O}from"./usePeriodFilter-BDxPrc4_.js";import{u as B}from"./useIntersectionObserver-BMoidOlM.js";import{S as c}from"./skeleton-BQDYAJTf.js";import{A as $,a as M}from"./alert-axJAQJuC.js";import{u as q}from"./useQuery-BHSsBDmJ.js";import"./LatexTitle-BmUg2c3G.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-DWMGlrsa.js";import"./useBaseQuery-BL30DOiU.js";const z=[["trending","trending"],["new","newest"],["cited","most cited"]],te=()=>{var x,g,j,f;const[d,N]=A(),o=d.get("search")||"",[p,v]=i.useState(o),t=D(p,300);i.useEffect(()=>{if(t===o)return;const s=new URLSearchParams(d);t?s.set("search",t):s.delete("search"),N(s,{replace:!0})},[t]);const[n,b]=i.useState("new"),{period:P,setPeriod:y,publishedAfter:S}=E("All Time"),a=k({page_size:20,order_by:n==="trending"?"trending":n==="cited"?"citation_count":"date_published",order_dir:"desc",search:t||void 0,published_after:S,include_resources:!0}),m=q({queryKey:["top-tasks-sidebar"],queryFn:()=>T.getTopTasks({limit:8}),staleTime:10*60*1e3}),l=i.useMemo(()=>{var r;return(((r=a.data)==null?void 0:r.pages.flatMap(_=>_.results))||[]).map(C)},[a.data]),{targetRef:w,isIntersecting:h}=B({rootMargin:"200px"});i.useEffect(()=>{h&&a.hasNextPage&&!a.isFetchingNextPage&&a.fetchNextPage()},[h,a.hasNextPage,a.isFetchingNextPage]);const u=((j=(g=(x=a.data)==null?void 0:x.pages)==null?void 0:g[0])==null?void 0:j.count)??0;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Papers"})]}),e.jsxs("div",{className:"feed-subtitle",children:["Search the full corpus. ",u>0&&`${u.toLocaleString()} papers indexed.`]})]}),e.jsx("div",{className:"period-switch",children:O.map(s=>e.jsx("button",{className:`period-btn ${P===s?"active":""}`,onClick:()=>y(s),children:s},s))})]}),e.jsx("div",{className:"papers-search-row",children:e.jsxs("div",{className:"papers-search-input-wrap",children:[e.jsx(F,{name:"search",size:14}),e.jsx("input",{className:"papers-search-input",placeholder:"Search title or abstract…",value:p,onChange:s=>v(s.target.value)})]})}),e.jsxs("div",{className:"layout-with-sidebar",children:[e.jsx("aside",{className:"sidebar",children:e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),m.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,r)=>e.jsx(c,{className:"h-5 w-full"},r))}),(f=m.data)==null?void 0:f.map(s=>e.jsxs(I,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[R(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id))]})}),e.jsxs("div",{children:[e.jsxs("div",{className:"sort-bar",children:[e.jsx("div",{className:"sort-options",children:z.map(([s,r])=>e.jsx("button",{className:`sort-btn ${n===s?"active":""}`,onClick:()=>b(s),children:r},s))}),e.jsxs("div",{className:"results-count",children:[l.length," loaded"]})]}),a.error&&e.jsx($,{variant:"destructive",className:"mb-4",children:e.jsx(M,{children:"Failed to load papers. Please try again."})}),a.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,r)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(c,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(c,{className:"h-6 w-3/4"}),e.jsx(c,{className:"h-4 w-1/2"}),e.jsx(c,{className:"h-12 w-full"})]})]},r))}):l.length===0?e.jsx("div",{className:"no-results",children:"No matching papers."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:l.map((s,r)=>e.jsx(L,{paper:s,rank:r+1},s.id))}),e.jsx("div",{ref:w,style:{height:1}}),a.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})};export{te as default};
 
1
+ import{a as A,r as i,j as e,L as I,b as T}from"./index-Bo5_2OqZ.js";import{I as F,P as L}from"./components-BbXgE2lV.js";import{t as C,d as R}from"./transform-2Gnjg1jt.js";import{u as k}from"./usePapers-CdB1OuZ5.js";import{u as D}from"./useDebounce-CIjDquLX.js";import{u as E,P as O}from"./usePeriodFilter-DK_4NHrn.js";import{u as B}from"./useIntersectionObserver-7HCpY83L.js";import{S as c}from"./skeleton-CB-heJjl.js";import{A as $,a as M}from"./alert-_EYQlDHA.js";import{u as q}from"./useQuery-Bh9FZQpL.js";import"./LatexTitle-qoY4vrTZ.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-CzzYUeDW.js";import"./useBaseQuery-B8T7kRNC.js";const z=[["trending","trending"],["new","newest"],["cited","most cited"]],te=()=>{var x,g,j,f;const[d,N]=A(),o=d.get("search")||"",[p,v]=i.useState(o),t=D(p,300);i.useEffect(()=>{if(t===o)return;const s=new URLSearchParams(d);t?s.set("search",t):s.delete("search"),N(s,{replace:!0})},[t]);const[n,b]=i.useState("new"),{period:P,setPeriod:y,publishedAfter:S}=E("All Time"),a=k({page_size:20,order_by:n==="trending"?"trending":n==="cited"?"citation_count":"date_published",order_dir:"desc",search:t||void 0,published_after:S,include_resources:!0}),m=q({queryKey:["top-tasks-sidebar"],queryFn:()=>T.getTopTasks({limit:8}),staleTime:10*60*1e3}),l=i.useMemo(()=>{var r;return(((r=a.data)==null?void 0:r.pages.flatMap(_=>_.results))||[]).map(C)},[a.data]),{targetRef:w,isIntersecting:h}=B({rootMargin:"200px"});i.useEffect(()=>{h&&a.hasNextPage&&!a.isFetchingNextPage&&a.fetchNextPage()},[h,a.hasNextPage,a.isFetchingNextPage]);const u=((j=(g=(x=a.data)==null?void 0:x.pages)==null?void 0:g[0])==null?void 0:j.count)??0;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Papers"})]}),e.jsxs("div",{className:"feed-subtitle",children:["Search the full corpus. ",u>0&&`${u.toLocaleString()} papers indexed.`]})]}),e.jsx("div",{className:"period-switch",children:O.map(s=>e.jsx("button",{className:`period-btn ${P===s?"active":""}`,onClick:()=>y(s),children:s},s))})]}),e.jsx("div",{className:"papers-search-row",children:e.jsxs("div",{className:"papers-search-input-wrap",children:[e.jsx(F,{name:"search",size:14}),e.jsx("input",{className:"papers-search-input",placeholder:"Search title or abstract…",value:p,onChange:s=>v(s.target.value)})]})}),e.jsxs("div",{className:"layout-with-sidebar",children:[e.jsx("aside",{className:"sidebar",children:e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),m.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,r)=>e.jsx(c,{className:"h-5 w-full"},r))}),(f=m.data)==null?void 0:f.map(s=>e.jsxs(I,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[R(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id))]})}),e.jsxs("div",{children:[e.jsxs("div",{className:"sort-bar",children:[e.jsx("div",{className:"sort-options",children:z.map(([s,r])=>e.jsx("button",{className:`sort-btn ${n===s?"active":""}`,onClick:()=>b(s),children:r},s))}),e.jsxs("div",{className:"results-count",children:[l.length," loaded"]})]}),a.error&&e.jsx($,{variant:"destructive",className:"mb-4",children:e.jsx(M,{children:"Failed to load papers. Please try again."})}),a.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,r)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(c,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(c,{className:"h-6 w-3/4"}),e.jsx(c,{className:"h-4 w-1/2"}),e.jsx(c,{className:"h-12 w-full"})]})]},r))}):l.length===0?e.jsx("div",{className:"no-results",children:"No matching papers."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:l.map((s,r)=>e.jsx(L,{paper:s,rank:r+1},s.id))}),e.jsx("div",{ref:w,style:{height:1}}),a.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})};export{te as default};
assets/{SavedPapersView-AReFg8Pv.js → SavedPapersView-Oa-A9M7k.js} RENAMED
@@ -1 +1 @@
1
- import{f as o,j as s,a7 as m,L as p,b as h}from"./index-CIXevVP9.js";import{u as x}from"./useQuery-BHSsBDmJ.js";import{T as u,P as j}from"./components-BkZsumbI.js";import{S as r}from"./skeleton-BQDYAJTf.js";import{A as v,a as N}from"./alert-axJAQJuC.js";import{t as g}from"./transform-CNyzjv1G.js";import"./useBaseQuery-BL30DOiU.js";import"./LatexTitle-BmUg2c3G.js";import"./katex.min-BSBacQyE.js";const C=()=>{var l;const{user:d,isLoading:c}=o(),a=x({queryKey:["my-bookmarks"],queryFn:()=>h.getMyBookmarks(),enabled:!!d,staleTime:30*1e3,refetchOnWindowFocus:!1});return c?s.jsxs("div",{className:"page",children:[s.jsx(r,{className:"h-10 w-1/3 mb-4"}),s.jsx(r,{className:"h-6 w-1/2 mb-8"})]}):d?s.jsxs("div",{className:"page",children:[s.jsx("div",{className:"feed-header",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"feed-title",children:["Saved ",s.jsx("em",{children:"Papers"})]}),s.jsx("div",{className:"feed-subtitle",children:(l=a.data)!=null&&l.count?`${a.data.count.toLocaleString()} saved · grouped by domain`:"Your bookmarked papers, grouped by domain."})]})}),a.error&&s.jsx(v,{variant:"destructive",className:"mb-4",children:s.jsx(N,{children:"Failed to load your saved papers. Please try again."})}),a.isLoading?s.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((i,e)=>s.jsxs("div",{className:"paper-card",children:[s.jsx(r,{className:"h-[220px] w-[160px]"}),s.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[s.jsx(r,{className:"h-6 w-3/4"}),s.jsx(r,{className:"h-4 w-1/2"}),s.jsx(r,{className:"h-12 w-full"})]})]},e))}):!a.data||a.data.count===0?s.jsxs("div",{className:"no-results",children:["No saved papers yet."," ",s.jsx(p,{to:"/papers",className:"sidebar-link",style:{display:"inline"},children:"Browse papers →"})]}):a.data.areas.map(i=>s.jsxs("section",{className:"saved-area-section",children:[s.jsx("h2",{className:"saved-area-heading",children:i.name}),i.tasks.map(e=>{const n=e.papers.length;return s.jsxs("div",{className:"saved-task-block",children:[s.jsxs("div",{className:"saved-task-row",children:[e.slug?s.jsx(u,{slug:e.slug,label:e.name}):s.jsx("span",{className:"tag-chip",style:{background:"var(--surface)"},children:e.name}),s.jsxs("span",{className:"saved-task-count",children:[n," ",n===1?"paper":"papers"]})]}),s.jsx("div",{className:"paper-list",children:e.papers.map(t=>s.jsx(j,{paper:g(t),rank:1},t.id))})]},`task-${i.id??"other"}-${e.id??"untagged"}`)})]},`area-${i.id??"other"}`))]}):s.jsxs("div",{className:"page",children:[s.jsx("div",{className:"feed-header",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"feed-title",children:["Saved ",s.jsx("em",{children:"Papers"})]}),s.jsx("div",{className:"feed-subtitle",children:"Sign in with Hugging Face to save papers and revisit them later."})]})}),s.jsx("div",{className:"saved-signin-panel",children:s.jsx(m,{returnTo:"/saved"})})]})};export{C as default};
 
1
+ import{f as o,j as s,a7 as m,L as p,b as h}from"./index-Bo5_2OqZ.js";import{u as x}from"./useQuery-Bh9FZQpL.js";import{T as u,P as j}from"./components-BbXgE2lV.js";import{S as r}from"./skeleton-CB-heJjl.js";import{A as v,a as N}from"./alert-_EYQlDHA.js";import{t as g}from"./transform-2Gnjg1jt.js";import"./useBaseQuery-B8T7kRNC.js";import"./LatexTitle-qoY4vrTZ.js";import"./katex.min-BSBacQyE.js";const C=()=>{var l;const{user:d,isLoading:c}=o(),a=x({queryKey:["my-bookmarks"],queryFn:()=>h.getMyBookmarks(),enabled:!!d,staleTime:30*1e3,refetchOnWindowFocus:!1});return c?s.jsxs("div",{className:"page",children:[s.jsx(r,{className:"h-10 w-1/3 mb-4"}),s.jsx(r,{className:"h-6 w-1/2 mb-8"})]}):d?s.jsxs("div",{className:"page",children:[s.jsx("div",{className:"feed-header",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"feed-title",children:["Saved ",s.jsx("em",{children:"Papers"})]}),s.jsx("div",{className:"feed-subtitle",children:(l=a.data)!=null&&l.count?`${a.data.count.toLocaleString()} saved · grouped by domain`:"Your bookmarked papers, grouped by domain."})]})}),a.error&&s.jsx(v,{variant:"destructive",className:"mb-4",children:s.jsx(N,{children:"Failed to load your saved papers. Please try again."})}),a.isLoading?s.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((i,e)=>s.jsxs("div",{className:"paper-card",children:[s.jsx(r,{className:"h-[220px] w-[160px]"}),s.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[s.jsx(r,{className:"h-6 w-3/4"}),s.jsx(r,{className:"h-4 w-1/2"}),s.jsx(r,{className:"h-12 w-full"})]})]},e))}):!a.data||a.data.count===0?s.jsxs("div",{className:"no-results",children:["No saved papers yet."," ",s.jsx(p,{to:"/papers",className:"sidebar-link",style:{display:"inline"},children:"Browse papers →"})]}):a.data.areas.map(i=>s.jsxs("section",{className:"saved-area-section",children:[s.jsx("h2",{className:"saved-area-heading",children:i.name}),i.tasks.map(e=>{const n=e.papers.length;return s.jsxs("div",{className:"saved-task-block",children:[s.jsxs("div",{className:"saved-task-row",children:[e.slug?s.jsx(u,{slug:e.slug,label:e.name}):s.jsx("span",{className:"tag-chip",style:{background:"var(--surface)"},children:e.name}),s.jsxs("span",{className:"saved-task-count",children:[n," ",n===1?"paper":"papers"]})]}),s.jsx("div",{className:"paper-list",children:e.papers.map(t=>s.jsx(j,{paper:g(t),rank:1},t.id))})]},`task-${i.id??"other"}-${e.id??"untagged"}`)})]},`area-${i.id??"other"}`))]}):s.jsxs("div",{className:"page",children:[s.jsx("div",{className:"feed-header",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"feed-title",children:["Saved ",s.jsx("em",{children:"Papers"})]}),s.jsx("div",{className:"feed-subtitle",children:"Sign in with Hugging Face to save papers and revisit them later."})]})}),s.jsx("div",{className:"saved-signin-panel",children:s.jsx(m,{returnTo:"/saved"})})]})};export{C as default};
assets/{SearchOverlay-DIr_b7TU.js → SearchOverlay-zJH1AgbF.js} RENAMED
@@ -1 +1 @@
1
- import{r as C,u as L,R as T,i as $,j as s,b as m}from"./index-CIXevVP9.js";import{u as p}from"./useQuery-BHSsBDmJ.js";import{L as A}from"./LatexTitle-BmUg2c3G.js";import{u as D}from"./useDebounce-BIllS1Ow.js";import{e as z,h as M,d as B}from"./transform-CNyzjv1G.js";import"./useBaseQuery-BL30DOiU.js";import"./katex.min-BSBacQyE.js";const I=10,J=({open:n,onClose:l})=>{var f,_,F,q,E,P;const v=C.useRef(null),w=L(),[c,R]=T.useState(""),[h,g]=T.useState(1),a=D(c,200),x=$();C.useEffect(()=>{var r;if(!n)return;(r=v.current)==null||r.focus();const e=K=>{K.key==="Escape"&&l()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[n,l]);const t=p({queryKey:["search-papers",a,h],queryFn:()=>m.searchPapers(a,h,I),enabled:n&&a.length>=2,staleTime:6e4}),k=p({queryKey:["search-tasks",a],queryFn:()=>m.getTasks({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4}),y=p({queryKey:["search-methods",a],queryFn:()=>m.getMethods({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4}),N=p({queryKey:["search-benchmarks",a],queryFn:()=>m.getDatasets({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4});if(!n)return null;const o=((f=k.data)==null?void 0:f.results)||[],d=((_=y.data)==null?void 0:_.results)||[],u=((F=N.data)==null?void 0:F.results)||[],j=((q=t.data)==null?void 0:q.results)||[],Q=t.isFetching||k.isFetching||y.isFetching||N.isFetching,S=o.length||j.length||d.length||u.length,i=e=>{l(),w(e)},b=()=>{const e=c.trim();e&&i(`/chat?q=${encodeURIComponent(e)}`)};return s.jsx("div",{className:"search-overlay",onClick:l,children:s.jsxs("div",{className:"search-modal",onClick:e=>e.stopPropagation(),children:[s.jsx("input",{ref:v,className:"search-modal-input",placeholder:"Search papers, tasks, methods, or benchmarks…",value:c,onChange:e=>{R(e.target.value),g(1)},onKeyDown:e=>{x&&e.key==="Enter"&&(e.preventDefault(),b())}}),s.jsxs("div",{className:"search-results",children:[x&&c.trim()&&s.jsxs("button",{type:"button",className:"search-ask-row",onClick:b,children:[s.jsx("span",{className:"search-ask-chip",children:"assistant"}),s.jsxs("span",{className:"search-ask-text",children:["Ask: “",c.trim(),"”"]}),s.jsx("kbd",{children:"↵"})]}),!a&&s.jsxs("div",{className:"search-empty",children:["Try “diffusion”, “object detection”, or an arXiv id.",x&&s.jsx("span",{className:"search-empty-sub",children:"Press Enter to ask the assistant"})]}),a&&!Q&&!S&&s.jsxs("div",{className:"search-empty",children:['No matches for "',c,'"']}),o.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Tasks · ",o.length]}),o.map(e=>{const r=z(M(e.slug||""));return s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/tasks/${e.slug}`),children:[s.jsx("span",{className:"dot",style:{width:6,height:6,borderRadius:"50%",background:r.dot}}),s.jsx("span",{className:"name",children:B(e.name,e.slug)}),e.paper_count!=null&&s.jsxs("span",{className:"count",children:[e.paper_count," papers"]})]},e.id)})]}),d.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Methods · ",d.length]}),d.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/methods/${e.slug||e.id}`),children:[s.jsx("span",{style:{fontFamily:"var(--mono)",fontWeight:600},children:e.name}),e.paper_count!=null&&s.jsxs("span",{className:"count",children:[e.paper_count," papers"]})]},e.id))]}),u.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Benchmarks · ",u.length]}),u.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/benchmark/${e.slug||e.id}`),children:[s.jsx("span",{className:"name",children:e.name}),e.paper_count!=null&&e.paper_count>0&&s.jsxs("span",{className:"count",children:[e.paper_count," entries"]})]},e.id))]}),j.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Papers · page ",h]}),j.map(e=>{var r;return s.jsxs("div",{className:"search-result",onClick:()=>i(`/paper/${e.arxiv_id||e.id}`),children:[s.jsx("div",{className:"search-result-title",children:s.jsx(A,{title:e.title})}),s.jsxs("div",{className:"search-result-meta",children:[s.jsx("span",{children:e.arxiv_id?`arXiv:${e.arxiv_id}`:"External resource"}),((r=e.authors)==null?void 0:r[0])&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"·"}),s.jsxs("span",{children:[e.authors[0],e.authors.length>1?" et al.":""]})]}),e.citation_count!=null&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"·"}),s.jsxs("span",{children:["↑ ",e.citation_count.toLocaleString()]})]})]})]},e.id)}),(((E=t.data)==null?void 0:E.previous_page)||((P=t.data)==null?void 0:P.next_page))&&s.jsxs("div",{className:"search-paper-pagination",children:[s.jsx("button",{type:"button",disabled:!t.data.previous_page||t.isFetching,onClick:()=>{var e;return g(((e=t.data)==null?void 0:e.previous_page)||1)},children:"Previous"}),s.jsxs("span",{children:["Page ",h]}),s.jsx("button",{type:"button",disabled:!t.data.next_page||t.isFetching,onClick:()=>{var e;(e=t.data)!=null&&e.next_page&&g(t.data.next_page)},children:"Next"})]})]})]})]})})};export{J as default};
 
1
+ import{r as C,u as L,R as T,i as $,j as s,b as m}from"./index-Bo5_2OqZ.js";import{u as p}from"./useQuery-Bh9FZQpL.js";import{L as A}from"./LatexTitle-qoY4vrTZ.js";import{u as D}from"./useDebounce-CIjDquLX.js";import{e as z,h as M,d as B}from"./transform-2Gnjg1jt.js";import"./useBaseQuery-B8T7kRNC.js";import"./katex.min-BSBacQyE.js";const I=10,J=({open:n,onClose:l})=>{var f,_,F,q,E,P;const v=C.useRef(null),w=L(),[c,R]=T.useState(""),[h,g]=T.useState(1),a=D(c,200),x=$();C.useEffect(()=>{var r;if(!n)return;(r=v.current)==null||r.focus();const e=K=>{K.key==="Escape"&&l()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[n,l]);const t=p({queryKey:["search-papers",a,h],queryFn:()=>m.searchPapers(a,h,I),enabled:n&&a.length>=2,staleTime:6e4}),k=p({queryKey:["search-tasks",a],queryFn:()=>m.getTasks({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4}),y=p({queryKey:["search-methods",a],queryFn:()=>m.getMethods({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4}),N=p({queryKey:["search-benchmarks",a],queryFn:()=>m.getDatasets({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4});if(!n)return null;const o=((f=k.data)==null?void 0:f.results)||[],d=((_=y.data)==null?void 0:_.results)||[],u=((F=N.data)==null?void 0:F.results)||[],j=((q=t.data)==null?void 0:q.results)||[],Q=t.isFetching||k.isFetching||y.isFetching||N.isFetching,S=o.length||j.length||d.length||u.length,i=e=>{l(),w(e)},b=()=>{const e=c.trim();e&&i(`/chat?q=${encodeURIComponent(e)}`)};return s.jsx("div",{className:"search-overlay",onClick:l,children:s.jsxs("div",{className:"search-modal",onClick:e=>e.stopPropagation(),children:[s.jsx("input",{ref:v,className:"search-modal-input",placeholder:"Search papers, tasks, methods, or benchmarks…",value:c,onChange:e=>{R(e.target.value),g(1)},onKeyDown:e=>{x&&e.key==="Enter"&&(e.preventDefault(),b())}}),s.jsxs("div",{className:"search-results",children:[x&&c.trim()&&s.jsxs("button",{type:"button",className:"search-ask-row",onClick:b,children:[s.jsx("span",{className:"search-ask-chip",children:"assistant"}),s.jsxs("span",{className:"search-ask-text",children:["Ask: “",c.trim(),"”"]}),s.jsx("kbd",{children:"↵"})]}),!a&&s.jsxs("div",{className:"search-empty",children:["Try “diffusion”, “object detection”, or an arXiv id.",x&&s.jsx("span",{className:"search-empty-sub",children:"Press Enter to ask the assistant"})]}),a&&!Q&&!S&&s.jsxs("div",{className:"search-empty",children:['No matches for "',c,'"']}),o.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Tasks · ",o.length]}),o.map(e=>{const r=z(M(e.slug||""));return s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/tasks/${e.slug}`),children:[s.jsx("span",{className:"dot",style:{width:6,height:6,borderRadius:"50%",background:r.dot}}),s.jsx("span",{className:"name",children:B(e.name,e.slug)}),e.paper_count!=null&&s.jsxs("span",{className:"count",children:[e.paper_count," papers"]})]},e.id)})]}),d.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Methods · ",d.length]}),d.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/methods/${e.slug||e.id}`),children:[s.jsx("span",{style:{fontFamily:"var(--mono)",fontWeight:600},children:e.name}),e.paper_count!=null&&s.jsxs("span",{className:"count",children:[e.paper_count," papers"]})]},e.id))]}),u.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Benchmarks · ",u.length]}),u.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/benchmark/${e.slug||e.id}`),children:[s.jsx("span",{className:"name",children:e.name}),e.paper_count!=null&&e.paper_count>0&&s.jsxs("span",{className:"count",children:[e.paper_count," entries"]})]},e.id))]}),j.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Papers · page ",h]}),j.map(e=>{var r;return s.jsxs("div",{className:"search-result",onClick:()=>i(`/paper/${e.arxiv_id||e.id}`),children:[s.jsx("div",{className:"search-result-title",children:s.jsx(A,{title:e.title})}),s.jsxs("div",{className:"search-result-meta",children:[s.jsx("span",{children:e.arxiv_id?`arXiv:${e.arxiv_id}`:"External resource"}),((r=e.authors)==null?void 0:r[0])&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"·"}),s.jsxs("span",{children:[e.authors[0],e.authors.length>1?" et al.":""]})]}),e.citation_count!=null&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"·"}),s.jsxs("span",{children:["↑ ",e.citation_count.toLocaleString()]})]})]})]},e.id)}),(((E=t.data)==null?void 0:E.previous_page)||((P=t.data)==null?void 0:P.next_page))&&s.jsxs("div",{className:"search-paper-pagination",children:[s.jsx("button",{type:"button",disabled:!t.data.previous_page||t.isFetching,onClick:()=>{var e;return g(((e=t.data)==null?void 0:e.previous_page)||1)},children:"Previous"}),s.jsxs("span",{children:["Page ",h]}),s.jsx("button",{type:"button",disabled:!t.data.next_page||t.isFetching,onClick:()=>{var e;(e=t.data)!=null&&e.next_page&&g(t.data.next_page)},children:"Next"})]})]})]})]})})};export{J as default};
assets/SettingsView-2Aab7oZR.js ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import{c as v,f as q,V as Q,ap as B,R as g,h as z,j as e,a7 as h,d as P,b as y,aq as W}from"./index-Bo5_2OqZ.js";import{u as Y}from"./useQuery-Bh9FZQpL.js";import{u as p}from"./useMutation-B8C_NgT5.js";import{S as F}from"./switch-DGcXQvGy.js";import{f as $,D as K}from"./latexPlainText-DI8YEXVe.js";import{b as V,u as L,r as G,a as j}from"./openrouter-C1zb8Waa.js";import{E as I}from"./external-link-BjWlCUOk.js";import"./useBaseQuery-B8T7kRNC.js";import"./index-DWt5uuhX.js";/**
2
+ * @license lucide-react v0.462.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const J=v("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
7
+ * @license lucide-react v0.462.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const X=v("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
12
+ * @license lucide-react v0.462.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const Z=v("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"}]]),ee="https://openrouter.ai/settings/keys";function f(n,m){if(n instanceof W){if(typeof n.detail=="string")return n.detail;if(typeof n.detail=="object"&&n.detail!==null&&"message"in n.detail&&typeof n.detail.message=="string")return n.detail.message}return n instanceof Error&&!n.message.startsWith("API request failed:")?n.message:m}const de=()=>{const{user:n}=q(),{preferences:m,setHideClosedSourceEvals:M,canPersist:T}=Q(),{theme:H,setTheme:A}=B(),D=H??"system",[N,b]=g.useState(""),[k,r]=g.useState(""),[c,w]=g.useState(""),d=z(),C=Y({queryKey:["inference-billing",n==null?void 0:n.hf_subject],enabled:!!n,queryFn:async()=>{const s=await fetch(P("/api/v1/me/inference-billing"),{credentials:"include",cache:"no-store"});if(!s.ok)throw new Error("Could not load billing status.");return await s.json()}}),t=C.data??null,R=V(!!n),U=L(!!n),a=R.data,l=U.data,i=a?G(a.resets_at):null,E=p({mutationFn:async s=>{const u=await fetch(P("/api/v1/me/inference-billing"),{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({bill_to:s})}),o=await u.json();if(!u.ok)throw new Error(typeof o.detail=="string"?o.detail:"Could not change the billing account.");return o},onSuccess:s=>{d.setQueryData(["inference-billing",n==null?void 0:n.hf_subject],s),b("")},onError:s=>{b(s instanceof Error?s.message:"Could not change the billing account.")}}),_=C.isLoading||E.isPending,x=p({mutationFn:s=>y.connectOpenRouterCredential(s),onSuccess:s=>{d.setQueryData(j,s),w(""),r("")},onError:s=>r(f(s,"Could not connect the OpenRouter key."))}),O=p({mutationFn:s=>y.setOpenRouterFallback(s),onSuccess:s=>{d.setQueryData(j,s),r("")},onError:s=>r(f(s,"Could not change paid fallback."))}),S=p({mutationFn:()=>y.disconnectOpenRouterCredential(),onSuccess:()=>{d.setQueryData(j,{connected:!1,verified_at:null,fallback_enabled:!1}),r("")},onError:s=>r(f(s,"Could not disconnect the OpenRouter key."))});return g.useEffect(()=>(document.title=$("Settings"),()=>{document.title=K}),[]),e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsx("h1",{className:"feed-title",children:e.jsx("em",{children:"Settings"})}),e.jsx("div",{className:"feed-subtitle",children:"Control how papers and benchmarks are displayed across the site."})]})}),e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Chat usage & billing"}),n?e.jsxs("div",{className:"settings-provider-grid",children:[e.jsxs("section",{className:"settings-provider-card","aria-labelledby":"inference-providers-heading",children:[e.jsxs("div",{className:"settings-provider-heading",children:[e.jsxs("div",{children:[e.jsx("h3",{id:"inference-providers-heading",children:"Inference Providers"}),e.jsx("p",{children:"Hugging Face-billed model usage"})]}),(t==null?void 0:t.connected)&&e.jsx("span",{className:"settings-connected-badge",children:"Connected"})]}),_&&!t?e.jsx("div",{className:"settings-billing-loading",children:"Checking Hugging Face billing…"}):t!=null&&t.connected?e.jsxs("div",{className:"settings-billing",children:[e.jsx("div",{className:"settings-row-label",children:t.bill_to?`Organization · ${t.bill_to}`:`Personal account · @${n.username}`}),e.jsx("p",{className:"settings-row-desc",children:"Usage for Hugging Face Inference Providers is billed by Hugging Face to your selected account. Your included Hugging Face usage is applied first; pay-as-you-go billing applies once it is depleted, according to your Hugging Face plan and billing settings. Papers With Code does not fund, meter, or reset these credits."}),e.jsx("label",{className:"settings-token-label",htmlFor:"hf-billing-account",children:"Bill chat usage to"}),e.jsxs("select",{id:"hf-billing-account",className:"settings-billing-select",value:t.bill_to??"",onChange:s=>{b(""),E.mutate(s.target.value||null)},disabled:_,children:[e.jsxs("option",{value:"",children:["Personal account (@",n.username,")"]}),t.organizations.map(s=>e.jsxs("option",{value:s.name,children:[s.display_name," (",s.name,")"]},s.name))]}),N&&e.jsx("div",{className:"settings-token-error",children:N}),e.jsxs("div",{className:"settings-billing-actions",children:[e.jsxs("a",{className:"button button-primary",href:t.usage_url,target:"_blank",rel:"noreferrer",children:["View Hugging Face usage & billing ",e.jsx(I,{"aria-hidden":"true"})]}),e.jsx(h,{returnTo:"/settings",label:"Refresh HF permissions",authorizeInference:!0})]})]}):e.jsxs("div",{className:"settings-billing-connect",children:[e.jsx("p",{className:"settings-row-desc",children:"Reconnect with Hugging Face to authorize Inference Providers. Hugging Face bills your personal account or the organization you select."}),e.jsx("div",{className:"settings-billing-actions",children:e.jsx(h,{returnTo:"/settings",label:"Authorize with Hugging Face",authorizeInference:!0})})]})]}),e.jsxs("section",{className:"settings-provider-card",id:"openrouter-byok","aria-labelledby":"openrouter-heading",children:[e.jsxs("div",{className:"settings-provider-heading",children:[e.jsxs("div",{children:[e.jsx("h3",{id:"openrouter-heading",children:"OpenRouter"}),e.jsx("p",{children:"Papers With Code-funded allowance and optional fallback"})]}),(l==null?void 0:l.connected)&&e.jsx("span",{className:"settings-connected-badge",children:"Key connected"})]}),e.jsx("p",{className:"settings-row-desc",children:"Papers With Code pays for these OpenRouter requests and provides free but limited monthly usage. Your own key is available as an optional fallback."}),a&&(a.available||a.remaining_percent===0)?e.jsxs("div",{className:"settings-usage-row",children:[e.jsxs("div",{className:"settings-usage-heading",children:[e.jsxs("div",{children:[e.jsx("div",{className:"settings-row-label",children:"Monthly OpenRouter usage"}),e.jsxs("div",{className:"settings-row-desc",children:["Resets ",i==null?void 0:i.local," ",e.jsxs("span",{"aria-label":"UTC reset time",children:["(",i==null?void 0:i.utc,")"]})]})]}),e.jsxs("strong",{children:[a.remaining_percent,"% left"]})]}),e.jsx("div",{className:"settings-usage-track",role:"progressbar","aria-label":`${a.remaining_percent}% remaining; resets ${i==null?void 0:i.local}; ${i==null?void 0:i.utc}`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":a.remaining_percent,children:e.jsx("span",{style:{width:`${a.remaining_percent}%`}})}),a.remaining_percent===0&&e.jsx("p",{className:"settings-limit-note",children:"Your free monthly allowance is depleted. DeepSeek V4 Flash is temporarily unavailable unless you enable your own key below."})]}):e.jsx("div",{className:"settings-billing-loading",children:R.isError||a?"OpenRouter usage is currently unavailable.":"Checking OpenRouter usage…"}),e.jsxs("div",{className:"settings-byok-controls",children:[e.jsx("div",{className:"settings-row-label",children:"Provide your own OpenRouter API key"}),l!=null&&l.connected?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"settings-row-desc",children:["Connected",l.verified_at?` · Last verified ${new Date(l.verified_at).toLocaleString()}`:"",". Your API key is stored securely using AES-256 encryption. It is never shown again."]}),e.jsxs("label",{className:"settings-fallback-control",children:[e.jsx(F,{checked:l.fallback_enabled,disabled:O.isPending,onCheckedChange:s=>O.mutate(!!s)}),e.jsxs("span",{children:[e.jsx("strong",{children:"Use my OpenRouter key when Papers With Code-funded OpenRouter access is unavailable"}),e.jsx("small",{children:"OpenRouter bills this usage to your own account. It is not covered by Papers With Code."})]})]}),e.jsx("p",{className:"settings-billing-help",children:"Disconnecting prevents new requests but cannot cancel a request already sent to OpenRouter."}),e.jsxs("div",{className:"settings-billing-actions",children:[e.jsx("button",{className:"button",type:"button",disabled:S.isPending,onClick:()=>S.mutate(),children:"Disconnect"}),e.jsxs("a",{className:"button",href:ee,target:"_blank",rel:"noreferrer",children:["Revoke or rotate at OpenRouter ",e.jsx(I,{"aria-hidden":"true"})]})]})]}):e.jsxs("form",{onSubmit:s=>{s.preventDefault(),c.trim()&&x.mutate(c.trim())},children:[e.jsx("label",{className:"settings-token-label",htmlFor:"openrouter-api-key",children:"OpenRouter API key"}),e.jsx("input",{id:"openrouter-api-key",type:"password",autoComplete:"off",value:c,onChange:s=>w(s.target.value),placeholder:"sk-or-…"}),e.jsx("p",{className:"settings-billing-help",children:"Connecting stores the key but does not authorize paid fallback. Enable billing separately after it is verified."}),e.jsx("div",{className:"settings-billing-actions",children:e.jsx("button",{className:"button button-primary",type:"submit",disabled:!c.trim()||x.isPending,children:x.isPending?"Verifying…":"Connect key"})})]}),k&&e.jsx("div",{className:"settings-token-error",children:k})]})]})]}):e.jsxs("div",{className:"settings-note settings-note-flush",children:[e.jsx("span",{children:"Sign in to connect your Hugging Face account for research chat. Model usage is billed by Hugging Face, not Papers With Code."}),e.jsx("div",{className:"settings-note-action",children:e.jsx(h,{returnTo:"/settings",authorizeInference:!0})})]})]}),e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Appearance"}),e.jsx("div",{className:"theme-options","aria-label":"Color theme",children:[{value:"system",label:"System",description:"Match your device",icon:J},{value:"light",label:"Light",description:"Always use light mode",icon:Z},{value:"dark",label:"Dark",description:"Always use dark mode",icon:X}].map(s=>{const u=s.icon,o=D===s.value;return e.jsxs("button",{type:"button",className:`theme-option ${o?"is-selected":""}`,"aria-pressed":o,onClick:()=>A(s.value),children:[e.jsx(u,{"aria-hidden":"true"}),e.jsxs("span",{className:"theme-option-copy",children:[e.jsx("span",{className:"theme-option-label",children:s.label}),e.jsx("span",{className:"theme-option-desc",children:s.description})]})]},s.value)})})]}),e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Evaluations"}),e.jsxs("div",{className:"settings-row",children:[e.jsxs("label",{className:"settings-row-text",htmlFor:"hide-closed-source-evals",children:[e.jsx("span",{className:"settings-row-label",children:"Hide closed-source models"}),e.jsx("span",{className:"settings-row-desc",children:"When enabled, evaluations of closed-source models (proprietary APIs and unreleased flagship models) are hidden from benchmark leaderboards and paper result tables."})]}),e.jsx(F,{id:"hide-closed-source-evals",checked:m.hide_closed_source_evals,onCheckedChange:s=>{M(!!s)}})]}),!T&&!n&&e.jsxs("div",{className:"settings-note",children:[e.jsx("span",{children:"You are browsing as a guest, so this choice only applies to the current session. Sign in to save it to your account."}),e.jsx("div",{className:"settings-note-action",children:e.jsx(h,{returnTo:"/settings"})})]})]})]})};export{de as default};
assets/SettingsView-rK87O-qc.js DELETED
@@ -1,16 +0,0 @@
1
- import{c as r,f as k,V as w,ap as C,R as m,v as F,j as e,a7 as c,d as p}from"./index-CIXevVP9.js";import{u as S}from"./useQuery-BHSsBDmJ.js";import{u as _}from"./useMutation-CDeysSx_.js";import{S as H}from"./switch-toPN9xmN.js";import{f as E,D as M}from"./latexPlainText-DI8YEXVe.js";import{E as A}from"./external-link-DFoBMCzS.js";import"./useBaseQuery-BL30DOiU.js";import"./index-xYsFHVgN.js";/**
2
- * @license lucide-react v0.462.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const T=r("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
7
- * @license lucide-react v0.462.0 - ISC
8
- *
9
- * This source code is licensed under the ISC license.
10
- * See the LICENSE file in the root directory of this source tree.
11
- */const z=r("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
12
- * @license lucide-react v0.462.0 - ISC
13
- *
14
- * This source code is licensed under the ISC license.
15
- * See the LICENSE file in the root directory of this source tree.
16
- */const I=r("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"}]]),O=()=>{var g;const{user:t}=k(),{preferences:b,setHideClosedSourceEvals:x,canPersist:j}=w(),{theme:y,setTheme:v}=C(),f=y??"system",[a,o]=m.useState(""),N=F(),d=S({queryKey:["inference-billing",t==null?void 0:t.hf_subject],enabled:!!t,queryFn:async()=>{const s=await fetch(p("/api/v1/me/inference-billing"),{credentials:"include",cache:"no-store"});if(!s.ok)throw new Error("Could not load billing status.");return await s.json()}}),n=d.data??null,h=_({mutationFn:async s=>{const l=await fetch(p("/api/v1/me/inference-billing"),{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({bill_to:s})}),i=await l.json();if(!l.ok)throw new Error(typeof i.detail=="string"?i.detail:"Could not change the billing account.");return i},onSuccess:s=>{N.setQueryData(["inference-billing",t==null?void 0:t.hf_subject],s),o("")},onError:s=>{o(s instanceof Error?s.message:"Could not change the billing account.")}}),u=d.isLoading||h.isPending;return m.useEffect(()=>(document.title=E("Settings"),()=>{document.title=M}),[]),e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsx("h1",{className:"feed-title",children:e.jsx("em",{children:"Settings"})}),e.jsx("div",{className:"feed-subtitle",children:"Control how papers and benchmarks are displayed across the site."})]})}),e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Chat usage & billing"}),t?u&&!n?e.jsx("div",{className:"settings-billing-loading",children:"Checking Hugging Face billing…"}):n!=null&&n.connected?e.jsxs("div",{className:"settings-billing",children:[e.jsxs("div",{className:"settings-plan-row",children:[e.jsxs("div",{children:[e.jsx("div",{className:"settings-row-label",children:n.bill_to?`Hugging Face organization · ${n.bill_to}`:`Hugging Face ${n.account_type}`}),e.jsx("div",{className:"settings-row-desc",children:n.bill_to?"Chat requests use this organization’s shared credits and billing.":`$${(g=n.monthly_credits_usd)==null?void 0:g.toFixed(2)} included each month, then pay as you go through your personal HF account when enabled.`})]}),e.jsx("span",{className:"settings-connected-badge",children:"Connected"})]}),e.jsx("label",{className:"settings-token-label",htmlFor:"hf-billing-account",children:"Bill chat usage to"}),e.jsxs("select",{id:"hf-billing-account",className:"settings-billing-select",value:n.bill_to??"",onChange:s=>{o(""),h.mutate(s.target.value||null)},disabled:u,children:[e.jsxs("option",{value:"",children:["Personal account (@",t.username,")"]}),n.organizations.map(s=>e.jsxs("option",{value:s.name,children:[s.display_name," (",s.name,")"]},s.name))]}),e.jsx("p",{className:"settings-billing-help",children:"Hugging Face maintains the authoritative usage, spend, credits, and provider limits. Additional usage is billed by Hugging Face when pay-as-you-go or purchased credits are enabled. Organization billing requires a Team or Enterprise plan and OAuth access for the selected organization."}),a&&e.jsx("div",{className:"settings-token-error",children:a}),e.jsxs("div",{className:"settings-billing-actions",children:[e.jsxs("a",{className:"button button-primary",href:n.usage_url,target:"_blank",rel:"noreferrer",children:["View Hugging Face usage & billing ",e.jsx(A,{"aria-hidden":"true"})]}),e.jsx(c,{returnTo:"/settings",label:"Refresh HF permissions",authorizeInference:!0})]})]}):e.jsxs("div",{className:"settings-billing-connect",children:[e.jsxs("p",{className:"settings-row-desc",children:["Authorize Papers With Code to call ",e.jsx("strong",{children:"Inference Providers"})," ","on your behalf. No manually created token is needed. Hugging Face bills your personal account by default; after authorizing, you can optionally select an eligible organization."]}),a&&e.jsx("div",{className:"settings-token-error",children:a}),e.jsx("div",{className:"settings-billing-actions",children:e.jsx(c,{returnTo:"/settings",label:"Authorize with Hugging Face",authorizeInference:!0})})]}):e.jsxs("div",{className:"settings-note settings-note-flush",children:[e.jsx("span",{children:"Sign in to connect your Hugging Face account for research chat. Model usage is billed by Hugging Face, not Papers With Code."}),e.jsx("div",{className:"settings-note-action",children:e.jsx(c,{returnTo:"/settings",authorizeInference:!0})})]})]}),e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Appearance"}),e.jsx("div",{className:"theme-options","aria-label":"Color theme",children:[{value:"system",label:"System",description:"Match your device",icon:T},{value:"light",label:"Light",description:"Always use light mode",icon:I},{value:"dark",label:"Dark",description:"Always use dark mode",icon:z}].map(s=>{const l=s.icon,i=f===s.value;return e.jsxs("button",{type:"button",className:`theme-option ${i?"is-selected":""}`,"aria-pressed":i,onClick:()=>v(s.value),children:[e.jsx(l,{"aria-hidden":"true"}),e.jsxs("span",{className:"theme-option-copy",children:[e.jsx("span",{className:"theme-option-label",children:s.label}),e.jsx("span",{className:"theme-option-desc",children:s.description})]})]},s.value)})})]}),e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Evaluations"}),e.jsxs("div",{className:"settings-row",children:[e.jsxs("label",{className:"settings-row-text",htmlFor:"hide-closed-source-evals",children:[e.jsx("span",{className:"settings-row-label",children:"Hide closed-source models"}),e.jsx("span",{className:"settings-row-desc",children:"When enabled, evaluations of closed-source models (proprietary APIs and unreleased flagship models) are hidden from benchmark leaderboards and paper result tables."})]}),e.jsx(H,{id:"hide-closed-source-evals",checked:b.hide_closed_source_evals,onCheckedChange:s=>{x(!!s)}})]}),!j&&!t&&e.jsxs("div",{className:"settings-note",children:[e.jsx("span",{children:"You are browsing as a guest, so this choice only applies to the current session. Sign in to save it to your account."}),e.jsx("div",{className:"settings-note-action",children:e.jsx(c,{returnTo:"/settings"})})]})]})]})};export{O as default};
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/SharedChatView-Bzq7-peM.js DELETED
@@ -1 +0,0 @@
1
- import{e as g,u as f,r as u,j as e,k as x}from"./index-CIXevVP9.js";import{u as v}from"./useQuery-BHSsBDmJ.js";import{C as j,U as S,A as y}from"./ChatMessage-B-YI3CrH.js";import{m as p,S as b,p as N,q as k,n as q}from"./chatSessions-BnXlq2-W.js";import"./useBaseQuery-BL30DOiU.js";import"./katex.min-BSBacQyE.js";import"./hover-card-B7gdr0Iw.js";import"./PaperPreviewLink-C7g07Bf-.js";import"./index-CDHG1Gvn.js";const C=({detail:d})=>{const[i,h]=u.useState(()=>N(d)),a=u.useMemo(()=>{const t={};for(const n of i)for(const s of n.blocks??[])if(s.kind==="tool")for(const r of s.results??[])t[r.route_id]=r;return t},[i]),l=(t,n)=>{h(s=>s.map(r=>{var o;return r.id!==t?r:{...r,blocks:(o=r.blocks)==null?void 0:o.map((c,m)=>m===n&&(c.kind==="reasoning"||c.kind==="tool")?{...c,open:!c.open}:c)}}))};return e.jsx("div",{className:"shared-chat-transcript",children:i.map(t=>t.role==="user"?e.jsx(S,{id:t.id,text:t.text??""},t.id):e.jsx(y,{msg:t,papers:a,onToggleBlock:l},t.id))})},B=()=>{const{shareId:d=""}=g(),i=f(),h=x(),a=v({queryKey:["shared-chat",d],queryFn:()=>q(d),retry:(n,s)=>!(s instanceof p&&s.status===404)&&n<1});u.useEffect(()=>{const n=document.title,s=document.head.querySelector('meta[name="robots"]'),r=s==null?void 0:s.content,o=s??document.createElement("meta");return o.name="robots",o.content="noindex,nofollow",s||document.head.appendChild(o),document.title="Shared conversation",()=>{document.title=n,s?s.content=r??"":o.remove()}},[]);const l=n=>{k(n,void 0,{autoSend:!1}),i("/chat")},t=a.error instanceof p&&a.error.status===404;return a.isLoading?e.jsxs("div",{className:"shared-chat-state",role:"status",children:[e.jsx(b,{})," Loading shared conversation…"]}):t?e.jsxs("div",{className:"shared-chat-state shared-chat-not-found",children:[e.jsx("h1",{children:"Shared conversation not found"}),e.jsx("p",{children:"This link is invalid or is no longer available."})]}):a.isError||!a.data?e.jsxs("div",{className:"shared-chat-state",role:"alert",children:[e.jsx("h1",{children:"Couldn’t load this conversation"}),e.jsx("p",{children:"Please check your connection and try again."}),e.jsx("button",{type:"button",onClick:()=>void a.refetch(),children:"Try again"})]}):e.jsxs("div",{className:"shared-chat-page",children:[e.jsxs("div",{className:"shared-chat-heading",children:[e.jsx("h1",{children:"Shared conversation"}),h&&e.jsx("span",{className:"chat-staging-badge",children:"Staging"})]}),e.jsxs("div",{className:"shared-chat-content",children:[e.jsx(C,{detail:a.data},a.data.updated_at),e.jsxs("section",{className:"shared-chat-fresh","aria-labelledby":"shared-chat-fresh-title",children:[e.jsx("h2",{id:"shared-chat-fresh-title",children:"Start a new conversation"}),e.jsx("p",{children:"Your new question starts with an empty context."}),h&&e.jsxs("div",{className:"shared-chat-access-note",role:"note",children:[e.jsx("strong",{children:"Limited staging preview."})," Starting a chat is available only to approved Hugging Face users. Hugging Face models also require the Inference Providers permission granted during sign-in; choose personal or organization billing in"," ",e.jsx("a",{href:"/settings",children:"Settings"}),"."]}),e.jsx(j,{onSend:l,placeholder:"Ask a new research question…"})]})]})]})};export{B as default};
 
 
assets/SharedChatView-DvAcanFw.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{e as g,u as f,r as u,j as e,l as x}from"./index-Bo5_2OqZ.js";import{u as v}from"./useQuery-Bh9FZQpL.js";import{C as j,U as S,A as y}from"./ChatMessage-DAiy1xqv.js";import{m as p,S as b,p as N,q,n as C}from"./chatSessions-Dz4Iu-O1.js";import"./useBaseQuery-B8T7kRNC.js";import"./katex.min-BSBacQyE.js";import"./hover-card-DrtqDSb0.js";import"./PaperPreviewLink-DTmodbgi.js";import"./index-C-0CcYmz.js";const k=({detail:d})=>{const[i,h]=u.useState(()=>N(d)),a=u.useMemo(()=>{const t={};for(const n of i)for(const s of n.blocks??[])if(s.kind==="tool")for(const r of s.results??[])t[r.route_id]=r;return t},[i]),l=(t,n)=>{h(s=>s.map(r=>{var o;return r.id!==t?r:{...r,blocks:(o=r.blocks)==null?void 0:o.map((c,m)=>m===n&&(c.kind==="reasoning"||c.kind==="tool")?{...c,open:!c.open}:c)}}))};return e.jsx("div",{className:"shared-chat-transcript",children:i.map(t=>t.role==="user"?e.jsx(S,{id:t.id,text:t.text??""},t.id):e.jsx(y,{msg:t,papers:a,onToggleBlock:l},t.id))})},B=()=>{const{shareId:d=""}=g(),i=f(),h=x(),a=v({queryKey:["shared-chat",d],queryFn:()=>C(d),retry:(n,s)=>!(s instanceof p&&s.status===404)&&n<1});u.useEffect(()=>{const n=document.title,s=document.head.querySelector('meta[name="robots"]'),r=s==null?void 0:s.content,o=s??document.createElement("meta");return o.name="robots",o.content="noindex,nofollow",s||document.head.appendChild(o),document.title="Shared conversation",()=>{document.title=n,s?s.content=r??"":o.remove()}},[]);const l=n=>{q(n,void 0,{autoSend:!1}),i("/chat")},t=a.error instanceof p&&a.error.status===404;return a.isLoading?e.jsxs("div",{className:"shared-chat-state",role:"status",children:[e.jsx(b,{})," Loading shared conversation…"]}):t?e.jsxs("div",{className:"shared-chat-state shared-chat-not-found",children:[e.jsx("h1",{children:"Shared conversation not found"}),e.jsx("p",{children:"This link is invalid or is no longer available."})]}):a.isError||!a.data?e.jsxs("div",{className:"shared-chat-state",role:"alert",children:[e.jsx("h1",{children:"Couldn’t load this conversation"}),e.jsx("p",{children:"Please check your connection and try again."}),e.jsx("button",{type:"button",onClick:()=>void a.refetch(),children:"Try again"})]}):e.jsxs("div",{className:"shared-chat-page",children:[e.jsxs("div",{className:"shared-chat-heading",children:[e.jsx("h1",{children:"Shared conversation"}),h&&e.jsx("span",{className:"chat-staging-badge",children:"Staging"})]}),e.jsxs("div",{className:"shared-chat-content",children:[e.jsx(k,{detail:a.data},a.data.updated_at),e.jsxs("section",{className:"shared-chat-fresh","aria-labelledby":"shared-chat-fresh-title",children:[e.jsx("h2",{id:"shared-chat-fresh-title",children:"Start a new conversation"}),e.jsx("p",{children:"Your new question starts with an empty context."}),h&&e.jsxs("div",{className:"shared-chat-access-note",role:"note",children:[e.jsx("strong",{children:"Limited staging preview."})," Starting a chat is available only to approved Hugging Face users. Hugging Face models also require the Inference Providers permission granted during sign-in; choose personal or organization billing in"," ",e.jsx("a",{href:"/settings",children:"Settings"}),"."]}),e.jsx(j,{onSend:l,placeholder:"Ask a new research question…"})]})]})]})};export{B as default};
assets/{SignInToEditDialog-BJmkw1tr.js → SignInToEditDialog-DW_1sVXp.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{c as X,r as i,j as e,a5 as W,t as q,a6 as Q,g as Z,w as ee,X as te,C as se,a7 as ae}from"./index-CIXevVP9.js";import{B as D}from"./button-5O6wnTvY.js";import{I as h,T as re}from"./textarea-CcQVD6R-.js";import{D as U,a as H,b as O,c as V,d as $,e as ne}from"./dialog-CA9NpDaA.js";import{u as oe}from"./useMutation-CDeysSx_.js";import{L as ie}from"./loader-circle-k9WscwaT.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{c as X,r as i,j as e,a5 as W,v as q,a6 as Q,g as Z,w as ee,X as te,C as se,a7 as ae}from"./index-Bo5_2OqZ.js";import{B as D}from"./button-D8mDpZUh.js";import{I as h,T as re}from"./textarea-Cr9wwZtd.js";import{D as U,a as H,b as O,c as V,d as $,e as ne}from"./dialog-BAxsIFdN.js";import{u as oe}from"./useMutation-B8C_NgT5.js";import{L as ie}from"./loader-circle-L2ccNPQf.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{SubmissionsDashboard-CbZH2smc.js → SubmissionsDashboard-D7fHw9fZ.js} RENAMED
@@ -1,4 +1,4 @@
1
- var fe=s=>{throw TypeError(s)};var X=(s,t,i)=>t.has(s)||fe("Cannot "+i);var p=(s,t,i)=>(X(s,t,"read from private field"),i?i.call(s):t.get(s)),E=(s,t,i)=>t.has(s)?fe("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,i),_=(s,t,i,n)=>(X(s,t,"write to private field"),n?n.call(s,i):t.set(s,i),i),C=(s,t,i)=>(X(s,t,"access private method"),i);import{ar as Ae,as as ee,at as Oe,au as Me,v as ke,r as $,av as Fe,c as Qe,j as e,aw as Se,ax as qe,R as N,t as q,ay as Ie,$ as Ue,f as De,g as we,am as Le,az as $e,aA as Te,aB as Be,aC as ze,aD as He,aE as se}from"./index-CIXevVP9.js";import{Q as Ee,u as Ke,a as Pe,e as Je,b as We,c as Ve,s as pe,f as Ye,g as Ge}from"./useBaseQuery-BL30DOiU.js";import{u as ge}from"./useQuery-BHSsBDmJ.js";import{u as be}from"./useMutation-CDeysSx_.js";import{R as Xe,S as Ze,C as es,a as ss}from"./shield-alert-SQ1s-XC2.js";import{L as B}from"./loader-circle-k9WscwaT.js";function je(s,t){const i=new Set(t);return s.filter(n=>!i.has(n))}function ts(s,t,i){const n=s.slice(0);return n[t]=i,n}var D,S,L,U,w,Q,z,H,K,P,v,te,ie,Ce,ne,re,ae,_e,is=(_e=class extends Ae{constructor(t,i,n){super();E(this,v);E(this,D);E(this,S);E(this,L);E(this,U);E(this,w);E(this,Q);E(this,z);E(this,H);E(this,K);E(this,P,[]);_(this,D,t),_(this,U,n),_(this,L,[]),_(this,w,[]),_(this,S,[]),this.setQueries(i)}onSubscribe(){this.listeners.size===1&&p(this,w).forEach(t=>{t.subscribe(i=>{C(this,v,re).call(this,t,i)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,p(this,w).forEach(t=>{t.destroy()})}setQueries(t,i){_(this,L,t),_(this,U,i),ee.batch(()=>{const n=p(this,w),r=C(this,v,ne).call(this,p(this,L));r.forEach(a=>a.observer.setOptions(a.defaultedQueryOptions));const c=r.map(a=>a.observer),l=c.map(a=>a.getCurrentResult()),d=n.length!==c.length,m=c.some((a,o)=>a!==n[o]),b=d||m,x=b?!0:l.some((a,o)=>{const u=p(this,S)[o];return!u||!Oe(a,u)});!b&&!x||(b&&(_(this,P,r),_(this,w,c)),_(this,S,l),this.hasListeners()&&(b&&(je(n,c).forEach(a=>{a.destroy()}),je(c,n).forEach(a=>{a.subscribe(o=>{C(this,v,re).call(this,a,o)})})),C(this,v,ae).call(this)))})}getCurrentResult(){return p(this,S)}getQueries(){return p(this,w).map(t=>t.getCurrentQuery())}getObservers(){return p(this,w)}getOptimisticResult(t,i){const n=C(this,v,ne).call(this,t),r=n.map(l=>l.observer.getOptimisticResult(l.defaultedQueryOptions)),c=n.map(l=>l.defaultedQueryOptions.queryHash);return[r,l=>C(this,v,ie).call(this,l??r,i,c),()=>C(this,v,te).call(this,r,n)]}},D=new WeakMap,S=new WeakMap,L=new WeakMap,U=new WeakMap,w=new WeakMap,Q=new WeakMap,z=new WeakMap,H=new WeakMap,K=new WeakMap,P=new WeakMap,v=new WeakSet,te=function(t,i){return i.map((n,r)=>{const c=t[r];return n.defaultedQueryOptions.notifyOnChangeProps?c:n.observer.trackResult(c,l=>{i.forEach(d=>{d.observer.trackProp(l)})})})},ie=function(t,i,n){if(i){const r=p(this,K),c=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((l,d)=>l!==r[d]));return(!p(this,Q)||p(this,S)!==p(this,H)||c||i!==p(this,z))&&(_(this,z,i),_(this,H,p(this,S)),n!==void 0&&_(this,K,n),_(this,Q,Me(p(this,Q),i(t)))),p(this,Q)}return t},Ce=function(){var t;return((t=p(this,U))==null?void 0:t.combine)!==void 0&&p(this,w).some((i,n)=>{var r;return i.options.suspense&&((r=p(this,S)[n])==null?void 0:r.data)===void 0})},ne=function(t){const i=new Map;p(this,w).forEach(r=>{const c=r.options.queryHash;if(!c)return;const l=i.get(c);l?l.push(r):i.set(c,[r])});const n=[];return t.forEach(r=>{var m;const c=p(this,D).defaultQueryOptions(r),d=((m=i.get(c.queryHash))==null?void 0:m.shift())??new Ee(p(this,D),c);n.push({defaultedQueryOptions:c,observer:d})}),n},re=function(t,i){const n=p(this,w).indexOf(t);n!==-1&&(_(this,S,ts(p(this,S),n,i)),C(this,v,ae).call(this))},ae=function(){var t;if(this.hasListeners()){const i=C(this,v,te).call(this,p(this,S),p(this,P)),n=C(this,v,Ce).call(this),r=p(this,Q),c=n?r:C(this,v,ie).call(this,i,(t=p(this,U))==null?void 0:t.combine);(n||r!==c)&&ee.batch(()=>{this.listeners.forEach(l=>{l(p(this,S))})})}},_e);function Y({queries:s,...t},i){const n=ke(),r=Ke(),c=Pe(),l=$.useMemo(()=>s.map(h=>{const y=n.defaultQueryOptions(h);return y._optimisticResults=r?"isRestoring":"optimistic",y}),[s,n,r]);l.forEach(h=>{Je(h);const y=n.getQueryCache().get(h.queryHash);We(h,c,y)}),Ve(c);const[d]=$.useState(()=>new is(n,l,t)),[m,b,x]=d.getOptimisticResult(l,t.combine),a=!r&&t.subscribed!==!1;$.useSyncExternalStore($.useCallback(h=>a?d.subscribe(ee.batchCalls(h)):Fe,[d,a]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),$.useEffect(()=>{d.setQueries(l,t)},[l,t,d]);const u=m.some((h,y)=>pe(l[y],h))?m.flatMap((h,y)=>{const f=l[y];if(f&&pe(f,h)){const I=new Ee(n,f);return Ye(f,I,c)}return[]}):[];if(u.length>0)throw Promise.all(u);const j=m.find((h,y)=>{const f=l[y];return f&&Ge({result:h,errorResetBoundary:c,throwOnError:f.throwOnError,query:n.getQueryCache().get(f.queryHash),suspense:f.suspense})});if(j!=null&&j.error)throw j.error;return b(x())}/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ var fe=s=>{throw TypeError(s)};var X=(s,t,i)=>t.has(s)||fe("Cannot "+i);var p=(s,t,i)=>(X(s,t,"read from private field"),i?i.call(s):t.get(s)),E=(s,t,i)=>t.has(s)?fe("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,i),_=(s,t,i,n)=>(X(s,t,"write to private field"),n?n.call(s,i):t.set(s,i),i),C=(s,t,i)=>(X(s,t,"access private method"),i);import{as as Ae,at as ee,au as Oe,av as Me,h as ke,r as $,aw as Fe,c as Qe,j as e,ax as Se,ay as qe,R as N,v as q,az as Ie,$ as Ue,f as De,g as we,am as Le,aA as $e,aB as Te,aC as Be,aD as ze,aE as He,aF as se}from"./index-Bo5_2OqZ.js";import{Q as Ee,u as Ke,a as Pe,e as Je,b as We,c as Ve,s as pe,f as Ye,g as Ge}from"./useBaseQuery-B8T7kRNC.js";import{u as ge}from"./useQuery-Bh9FZQpL.js";import{u as be}from"./useMutation-B8C_NgT5.js";import{R as Xe,S as Ze,C as es,a as ss}from"./shield-alert-C2VCWA2k.js";import{L as B}from"./loader-circle-L2ccNPQf.js";function je(s,t){const i=new Set(t);return s.filter(n=>!i.has(n))}function ts(s,t,i){const n=s.slice(0);return n[t]=i,n}var D,S,L,U,w,Q,z,H,K,P,v,te,ie,Ce,ne,re,ae,_e,is=(_e=class extends Ae{constructor(t,i,n){super();E(this,v);E(this,D);E(this,S);E(this,L);E(this,U);E(this,w);E(this,Q);E(this,z);E(this,H);E(this,K);E(this,P,[]);_(this,D,t),_(this,U,n),_(this,L,[]),_(this,w,[]),_(this,S,[]),this.setQueries(i)}onSubscribe(){this.listeners.size===1&&p(this,w).forEach(t=>{t.subscribe(i=>{C(this,v,re).call(this,t,i)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,p(this,w).forEach(t=>{t.destroy()})}setQueries(t,i){_(this,L,t),_(this,U,i),ee.batch(()=>{const n=p(this,w),r=C(this,v,ne).call(this,p(this,L));r.forEach(a=>a.observer.setOptions(a.defaultedQueryOptions));const c=r.map(a=>a.observer),l=c.map(a=>a.getCurrentResult()),d=n.length!==c.length,m=c.some((a,o)=>a!==n[o]),b=d||m,x=b?!0:l.some((a,o)=>{const u=p(this,S)[o];return!u||!Oe(a,u)});!b&&!x||(b&&(_(this,P,r),_(this,w,c)),_(this,S,l),this.hasListeners()&&(b&&(je(n,c).forEach(a=>{a.destroy()}),je(c,n).forEach(a=>{a.subscribe(o=>{C(this,v,re).call(this,a,o)})})),C(this,v,ae).call(this)))})}getCurrentResult(){return p(this,S)}getQueries(){return p(this,w).map(t=>t.getCurrentQuery())}getObservers(){return p(this,w)}getOptimisticResult(t,i){const n=C(this,v,ne).call(this,t),r=n.map(l=>l.observer.getOptimisticResult(l.defaultedQueryOptions)),c=n.map(l=>l.defaultedQueryOptions.queryHash);return[r,l=>C(this,v,ie).call(this,l??r,i,c),()=>C(this,v,te).call(this,r,n)]}},D=new WeakMap,S=new WeakMap,L=new WeakMap,U=new WeakMap,w=new WeakMap,Q=new WeakMap,z=new WeakMap,H=new WeakMap,K=new WeakMap,P=new WeakMap,v=new WeakSet,te=function(t,i){return i.map((n,r)=>{const c=t[r];return n.defaultedQueryOptions.notifyOnChangeProps?c:n.observer.trackResult(c,l=>{i.forEach(d=>{d.observer.trackProp(l)})})})},ie=function(t,i,n){if(i){const r=p(this,K),c=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((l,d)=>l!==r[d]));return(!p(this,Q)||p(this,S)!==p(this,H)||c||i!==p(this,z))&&(_(this,z,i),_(this,H,p(this,S)),n!==void 0&&_(this,K,n),_(this,Q,Me(p(this,Q),i(t)))),p(this,Q)}return t},Ce=function(){var t;return((t=p(this,U))==null?void 0:t.combine)!==void 0&&p(this,w).some((i,n)=>{var r;return i.options.suspense&&((r=p(this,S)[n])==null?void 0:r.data)===void 0})},ne=function(t){const i=new Map;p(this,w).forEach(r=>{const c=r.options.queryHash;if(!c)return;const l=i.get(c);l?l.push(r):i.set(c,[r])});const n=[];return t.forEach(r=>{var m;const c=p(this,D).defaultQueryOptions(r),d=((m=i.get(c.queryHash))==null?void 0:m.shift())??new Ee(p(this,D),c);n.push({defaultedQueryOptions:c,observer:d})}),n},re=function(t,i){const n=p(this,w).indexOf(t);n!==-1&&(_(this,S,ts(p(this,S),n,i)),C(this,v,ae).call(this))},ae=function(){var t;if(this.hasListeners()){const i=C(this,v,te).call(this,p(this,S),p(this,P)),n=C(this,v,Ce).call(this),r=p(this,Q),c=n?r:C(this,v,ie).call(this,i,(t=p(this,U))==null?void 0:t.combine);(n||r!==c)&&ee.batch(()=>{this.listeners.forEach(l=>{l(p(this,S))})})}},_e);function Y({queries:s,...t},i){const n=ke(),r=Ke(),c=Pe(),l=$.useMemo(()=>s.map(h=>{const y=n.defaultQueryOptions(h);return y._optimisticResults=r?"isRestoring":"optimistic",y}),[s,n,r]);l.forEach(h=>{Je(h);const y=n.getQueryCache().get(h.queryHash);We(h,c,y)}),Ve(c);const[d]=$.useState(()=>new is(n,l,t)),[m,b,x]=d.getOptimisticResult(l,t.combine),a=!r&&t.subscribed!==!1;$.useSyncExternalStore($.useCallback(h=>a?d.subscribe(ee.batchCalls(h)):Fe,[d,a]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),$.useEffect(()=>{d.setQueries(l,t)},[l,t,d]);const u=m.some((h,y)=>pe(l[y],h))?m.flatMap((h,y)=>{const f=l[y];if(f&&pe(f,h)){const I=new Ee(n,f);return Ye(f,I,c)}return[]}):[];if(u.length>0)throw Promise.all(u);const j=m.find((h,y)=>{const f=l[y];return f&&Ge({result:h,errorResetBoundary:c,throwOnError:f.throwOnError,query:n.getQueryCache().get(f.queryHash),suspense:f.suspense})});if(j!=null&&j.error)throw j.error;return b(x())}/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{SubmitView-tSFlJsaJ.js → SubmitView-CRMmJZk-.js} RENAMED
@@ -1 +1 @@
1
- import{u as R,v as T,g as _,R as n,j as e,aq as D}from"./index-CIXevVP9.js";import{u as k}from"./useMutation-CDeysSx_.js";import{A as w,a as C}from"./alert-axJAQJuC.js";import{B as j}from"./button-5O6wnTvY.js";import{I as h,T as z}from"./textarea-CcQVD6R-.js";const E=/^\d{4}\.\d{4,5}(v\d+)?$/i,F=/^[a-z-]+(\.[A-Z]{2})?\/\d{7}$/,X=/^https?:\/\/(?:www\.)?arxiv\.org\//i;function S(r){const a=r.trim();return a?E.test(a)||F.test(a)||X.test(a)?"arxiv":/^https?:\/\//i.test(a)?"external":"arxiv":"empty"}function L(r,a){const i=r.trim();if(S(i)==="arxiv")return/^https?:\/\//i.test(i)?{source_url:i}:{arxiv_id:i};const s={source_url:i},l=a.title.trim();l&&(s.title=l);const p=a.abstract.trim();p&&(s.abstract=p);const o=a.authors.split(/[,\n]/).map(g=>g.trim()).filter(Boolean);return o.length>0&&(s.authors=o),a.datePublished&&(s.date_published=a.datePublished),s}function q(r){const a=r;if(!a)return"Submission failed";if(a.response)try{const i=JSON.parse(a.response);if(typeof i.detail=="string")return i.detail}catch{return a.response}return a.message||"Submission failed"}const Q=()=>{const r=R(),a=T(),{toast:i}=_(),[d,s]=n.useState(""),[l,p]=n.useState(""),[o,g]=n.useState(""),[f,I]=n.useState(""),[y,A]=n.useState(""),[b,x]=n.useState(null),u=S(d),v=u==="external",c=k({mutationFn:t=>D(t),onSuccess:t=>{a.invalidateQueries({queryKey:["papers"],refetchType:"none"}),a.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),a.invalidateQueries({queryKey:["trending-papers"],refetchType:"none"});const m=t.refreshed&&t.created&&t.latest_version;i({title:m?`Paper updated to ${t.latest_version}`:t.created?"Paper submitted":"Paper already indexed",description:m?"Opening the updated paper page…":t.created?"Opening the paper page…":"Opening the existing paper page…"}),r(`/paper/${t.route_identifier}`)},onError:t=>{x(q(t))}}),P=t=>{if(t.preventDefault(),x(null),u==="empty"){x("Enter an arXiv ID or a paper URL to submit.");return}const m=L(d,{title:l,abstract:o,authors:f,datePublished:y});c.mutate(m)};return e.jsxs("div",{className:"page",style:{maxWidth:720},children:[e.jsx("h1",{className:"detail-title",children:"Submit a paper"}),e.jsx("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:12,lineHeight:1.55},children:"Index an arXiv paper or add a non-arXiv paper (blog post, technical report, model release page). Submissions are public and appear in the feed immediately."}),e.jsxs("form",{onSubmit:P,style:{marginTop:28,display:"grid",gap:20},children:[e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-input",style:{fontWeight:600,fontSize:14},children:"arXiv ID or paper URL"}),e.jsx(h,{id:"submit-input",value:d,onChange:t=>s(t.target.value),placeholder:"2501.12345 · https://arxiv.org/abs/2501.12345 · https://blog.example.com/release",autoFocus:!0,required:!0}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)",minHeight:18},children:u==="arxiv"?"Detected: arXiv paper — metadata will be fetched automatically.":u==="external"?"Detected: external URL — we'll extract metadata and you can override below.":"Paste an arXiv ID like 2501.12345 or any paper/blog URL."})]}),v&&e.jsxs("fieldset",{style:{border:"1px solid var(--rule)",borderRadius:8,padding:"16px 20px 20px",display:"grid",gap:16},children:[e.jsx("legend",{style:{padding:"0 8px",fontSize:12,color:"var(--ink-soft)",textTransform:"uppercase",letterSpacing:.5},children:"External paper details (optional)"}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-title",style:{fontSize:13},children:"Title"}),e.jsx(h,{id:"submit-title",value:l,onChange:t=>p(t.target.value),placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-abstract",style:{fontSize:13},children:"Abstract or summary"}),e.jsx(z,{id:"submit-abstract",value:o,onChange:t=>g(t.target.value),rows:4,placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-authors",style:{fontSize:13},children:"Authors (comma-separated)"}),e.jsx(h,{id:"submit-authors",value:f,onChange:t=>I(t.target.value),placeholder:"Jane Smith, John Doe"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-date",style:{fontSize:13},children:"Publication date"}),e.jsx(h,{id:"submit-date",type:"date",value:y,onChange:t=>A(t.target.value),style:{maxWidth:220}}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)"},children:"Required only if we cannot infer a date from the page."})]})]}),b&&e.jsx(w,{variant:"destructive",children:e.jsx(C,{children:b})}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[e.jsx(j,{type:"submit",disabled:c.isPending,children:c.isPending?v?"Fetching & indexing…":"Indexing…":"Submit paper"}),e.jsx(j,{type:"button",variant:"outline",onClick:()=>r(-1),disabled:c.isPending,children:"Cancel"})]})]})]})};export{Q as default};
 
1
+ import{u as R,h as T,g as _,R as n,j as e,ar as D}from"./index-Bo5_2OqZ.js";import{u as k}from"./useMutation-B8C_NgT5.js";import{A as w,a as C}from"./alert-_EYQlDHA.js";import{B as j}from"./button-D8mDpZUh.js";import{I as h,T as z}from"./textarea-Cr9wwZtd.js";const E=/^\d{4}\.\d{4,5}(v\d+)?$/i,F=/^[a-z-]+(\.[A-Z]{2})?\/\d{7}$/,X=/^https?:\/\/(?:www\.)?arxiv\.org\//i;function S(r){const a=r.trim();return a?E.test(a)||F.test(a)||X.test(a)?"arxiv":/^https?:\/\//i.test(a)?"external":"arxiv":"empty"}function L(r,a){const i=r.trim();if(S(i)==="arxiv")return/^https?:\/\//i.test(i)?{source_url:i}:{arxiv_id:i};const s={source_url:i},l=a.title.trim();l&&(s.title=l);const p=a.abstract.trim();p&&(s.abstract=p);const o=a.authors.split(/[,\n]/).map(g=>g.trim()).filter(Boolean);return o.length>0&&(s.authors=o),a.datePublished&&(s.date_published=a.datePublished),s}function q(r){const a=r;if(!a)return"Submission failed";if(a.response)try{const i=JSON.parse(a.response);if(typeof i.detail=="string")return i.detail}catch{return a.response}return a.message||"Submission failed"}const Q=()=>{const r=R(),a=T(),{toast:i}=_(),[d,s]=n.useState(""),[l,p]=n.useState(""),[o,g]=n.useState(""),[f,I]=n.useState(""),[y,A]=n.useState(""),[b,x]=n.useState(null),u=S(d),v=u==="external",c=k({mutationFn:t=>D(t),onSuccess:t=>{a.invalidateQueries({queryKey:["papers"],refetchType:"none"}),a.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),a.invalidateQueries({queryKey:["trending-papers"],refetchType:"none"});const m=t.refreshed&&t.created&&t.latest_version;i({title:m?`Paper updated to ${t.latest_version}`:t.created?"Paper submitted":"Paper already indexed",description:m?"Opening the updated paper page…":t.created?"Opening the paper page…":"Opening the existing paper page…"}),r(`/paper/${t.route_identifier}`)},onError:t=>{x(q(t))}}),P=t=>{if(t.preventDefault(),x(null),u==="empty"){x("Enter an arXiv ID or a paper URL to submit.");return}const m=L(d,{title:l,abstract:o,authors:f,datePublished:y});c.mutate(m)};return e.jsxs("div",{className:"page",style:{maxWidth:720},children:[e.jsx("h1",{className:"detail-title",children:"Submit a paper"}),e.jsx("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:12,lineHeight:1.55},children:"Index an arXiv paper or add a non-arXiv paper (blog post, technical report, model release page). Submissions are public and appear in the feed immediately."}),e.jsxs("form",{onSubmit:P,style:{marginTop:28,display:"grid",gap:20},children:[e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-input",style:{fontWeight:600,fontSize:14},children:"arXiv ID or paper URL"}),e.jsx(h,{id:"submit-input",value:d,onChange:t=>s(t.target.value),placeholder:"2501.12345 · https://arxiv.org/abs/2501.12345 · https://blog.example.com/release",autoFocus:!0,required:!0}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)",minHeight:18},children:u==="arxiv"?"Detected: arXiv paper — metadata will be fetched automatically.":u==="external"?"Detected: external URL — we'll extract metadata and you can override below.":"Paste an arXiv ID like 2501.12345 or any paper/blog URL."})]}),v&&e.jsxs("fieldset",{style:{border:"1px solid var(--rule)",borderRadius:8,padding:"16px 20px 20px",display:"grid",gap:16},children:[e.jsx("legend",{style:{padding:"0 8px",fontSize:12,color:"var(--ink-soft)",textTransform:"uppercase",letterSpacing:.5},children:"External paper details (optional)"}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-title",style:{fontSize:13},children:"Title"}),e.jsx(h,{id:"submit-title",value:l,onChange:t=>p(t.target.value),placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-abstract",style:{fontSize:13},children:"Abstract or summary"}),e.jsx(z,{id:"submit-abstract",value:o,onChange:t=>g(t.target.value),rows:4,placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-authors",style:{fontSize:13},children:"Authors (comma-separated)"}),e.jsx(h,{id:"submit-authors",value:f,onChange:t=>I(t.target.value),placeholder:"Jane Smith, John Doe"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-date",style:{fontSize:13},children:"Publication date"}),e.jsx(h,{id:"submit-date",type:"date",value:y,onChange:t=>A(t.target.value),style:{maxWidth:220}}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)"},children:"Required only if we cannot infer a date from the page."})]})]}),b&&e.jsx(w,{variant:"destructive",children:e.jsx(C,{children:b})}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[e.jsx(j,{type:"submit",disabled:c.isPending,children:c.isPending?v?"Fetching & indexing…":"Indexing…":"Submit paper"}),e.jsx(j,{type:"button",variant:"outline",onClick:()=>r(-1),disabled:c.isPending,children:"Cancel"})]})]})]})};export{Q as default};
assets/{TagBrowseView-CKLRJyfT.js → TagBrowseView-BItfp6De.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{c as je,r as h,n as Z,j as e,m as B,a2 as _e,p as ve,P as Xe,s as Ne,o as ke,a3 as es,R as _,a4 as ss,N as as,t as J,e as ts,u as ns,a as rs,V as os,L as P,$ as cs,b as ge}from"./index-CIXevVP9.js";import{u as be}from"./useQuery-BHSsBDmJ.js";import{P as is,M as ls}from"./components-BkZsumbI.js";import{B as ds}from"./BenchmarkTrendSparkline-c88osrLQ.js";import{P as ps}from"./PaperFeedFilters-CNYrJoVb.js";import{M as W}from"./MarkdownText-DgCJo7yQ.js";import{t as ms,d as V}from"./transform-CNyzjv1G.js";import{b as hs}from"./usePapers-B99b4fBf.js";import{u as us}from"./useIntersectionObserver-BMoidOlM.js";import{S as U}from"./skeleton-BQDYAJTf.js";import{A as xs,a as gs}from"./alert-axJAQJuC.js";import{C as bs}from"./chevron-down-BLGtaYwg.js";import{G as fe}from"./github-BxICrwzp.js";import"./useBaseQuery-BL30DOiU.js";import"./LatexTitle-BmUg2c3G.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-C7g07Bf-.js";import"./index-CDHG1Gvn.js";import"./hover-card-B7gdr0Iw.js";import"./useInfiniteQuery-DWMGlrsa.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
@@ -8,4 +8,4 @@ import{c as je,r as h,n as Z,j as e,m as B,a2 as _e,p as ve,P as Xe,s as Ne,o as
8
  *
9
  * This source code is licensed under the ISC license.
10
  * See the LICENSE file in the root directory of this source tree.
11
- */const js=je("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]);var K="Collapsible",[_s,Ce]=Ne(K),[vs,X]=_s(K),we=h.forwardRef((a,c)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:l,...u}=a,[g,b]=Z({prop:r,defaultProp:i??!1,onChange:l,caller:K});return e.jsx(vs,{scope:n,disabled:o,contentId:_e(),open:g,onOpenToggle:h.useCallback(()=>b(j=>!j),[b]),children:e.jsx(B.div,{"data-state":se(g),"data-disabled":o?"":void 0,...u,ref:c})})});we.displayName=K;var ye="CollapsibleTrigger",Ae=h.forwardRef((a,c)=>{const{__scopeCollapsible:n,...r}=a,i=X(ye,n);return e.jsx(B.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":se(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:c,onClick:ve(a.onClick,i.onOpenToggle)})});Ae.displayName=ye;var ee="CollapsibleContent",Se=h.forwardRef((a,c)=>{const{forceMount:n,...r}=a,i=X(ee,a.__scopeCollapsible);return e.jsx(Xe,{present:n||i.open,children:({present:o})=>e.jsx(Ns,{...r,ref:c,present:o})})});Se.displayName=ee;var Ns=h.forwardRef((a,c)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=a,l=X(ee,n),[u,g]=h.useState(r),b=h.useRef(null),j=ke(c,b),v=h.useRef(0),R=v.current,A=h.useRef(0),T=A.current,k=l.open||u,N=h.useRef(k),m=h.useRef(void 0);return h.useEffect(()=>{const p=requestAnimationFrame(()=>N.current=!1);return()=>cancelAnimationFrame(p)},[]),es(()=>{const p=b.current;if(p){m.current=m.current||{transitionDuration:p.style.transitionDuration,animationName:p.style.animationName},p.style.transitionDuration="0s",p.style.animationName="none";const C=p.getBoundingClientRect();v.current=C.height,A.current=C.width,N.current||(p.style.transitionDuration=m.current.transitionDuration,p.style.animationName=m.current.animationName),g(r)}},[l.open,r]),e.jsx(B.div,{"data-state":se(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!k,...o,ref:j,style:{"--radix-collapsible-content-height":R?`${R}px`:void 0,"--radix-collapsible-content-width":T?`${T}px`:void 0,...a.style},children:k&&i})});function se(a){return a?"open":"closed"}var ks=we,Cs=Ae,ws=Se,w="Accordion",ys=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[ae,As,Ss]=ss(w),[q]=Ne(w,[Ss,Ce]),te=Ce(),Pe=_.forwardRef((a,c)=>{const{type:n,...r}=a,i=r,o=r;return e.jsx(ae.Provider,{scope:a.__scopeAccordion,children:n==="multiple"?e.jsx(Es,{...o,ref:c}):e.jsx(Is,{...i,ref:c})})});Pe.displayName=w;var[Re,Ps]=q(w),[Ie,Rs]=q(w,{collapsible:!1}),Is=_.forwardRef((a,c)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},collapsible:o=!1,...l}=a,[u,g]=Z({prop:n,defaultProp:r??"",onChange:i,caller:w});return e.jsx(Re,{scope:a.__scopeAccordion,value:_.useMemo(()=>u?[u]:[],[u]),onItemOpen:g,onItemClose:_.useCallback(()=>o&&g(""),[o,g]),children:e.jsx(Ie,{scope:a.__scopeAccordion,collapsible:o,children:e.jsx(Ee,{...l,ref:c})})})}),Es=_.forwardRef((a,c)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...o}=a,[l,u]=Z({prop:n,defaultProp:r??[],onChange:i,caller:w}),g=_.useCallback(j=>u((v=[])=>[...v,j]),[u]),b=_.useCallback(j=>u((v=[])=>v.filter(R=>R!==j)),[u]);return e.jsx(Re,{scope:a.__scopeAccordion,value:l,onItemOpen:g,onItemClose:b,children:e.jsx(Ie,{scope:a.__scopeAccordion,collapsible:!0,children:e.jsx(Ee,{...o,ref:c})})})}),[Ts,G]=q(w),Ee=_.forwardRef((a,c)=>{const{__scopeAccordion:n,disabled:r,dir:i,orientation:o="vertical",...l}=a,u=_.useRef(null),g=ke(u,c),b=As(n),v=as(i)==="ltr",R=ve(a.onKeyDown,A=>{var F;if(!ys.includes(A.key))return;const T=A.target,k=b().filter(M=>{var x;return!((x=M.ref.current)!=null&&x.disabled)}),N=k.findIndex(M=>M.ref.current===T),m=k.length;if(N===-1)return;A.preventDefault();let p=N;const C=0,I=m-1,f=()=>{p=N+1,p>I&&(p=C)},E=()=>{p=N-1,p<C&&(p=I)};switch(A.key){case"Home":p=C;break;case"End":p=I;break;case"ArrowRight":o==="horizontal"&&(v?f():E());break;case"ArrowDown":o==="vertical"&&f();break;case"ArrowLeft":o==="horizontal"&&(v?E():f());break;case"ArrowUp":o==="vertical"&&E();break}const D=p%m;(F=k[D].ref.current)==null||F.focus()});return e.jsx(Ts,{scope:n,disabled:r,direction:i,orientation:o,children:e.jsx(ae.Slot,{scope:n,children:e.jsx(B.div,{...l,"data-orientation":o,ref:g,onKeyDown:r?void 0:R})})})}),z="AccordionItem",[Ms,ne]=q(z),Te=_.forwardRef((a,c)=>{const{__scopeAccordion:n,value:r,...i}=a,o=G(z,n),l=Ps(z,n),u=te(n),g=_e(),b=r&&l.value.includes(r)||!1,j=o.disabled||a.disabled;return e.jsx(Ms,{scope:n,open:b,disabled:j,triggerId:g,children:e.jsx(ks,{"data-orientation":o.orientation,"data-state":Fe(b),...u,...i,ref:c,disabled:j,open:b,onOpenChange:v=>{v?l.onItemOpen(r):l.onItemClose(r)}})})});Te.displayName=z;var Me="AccordionHeader",$e=_.forwardRef((a,c)=>{const{__scopeAccordion:n,...r}=a,i=G(w,n),o=ne(Me,n);return e.jsx(B.h3,{"data-orientation":i.orientation,"data-state":Fe(o.open),"data-disabled":o.disabled?"":void 0,...r,ref:c})});$e.displayName=Me;var Y="AccordionTrigger",Oe=_.forwardRef((a,c)=>{const{__scopeAccordion:n,...r}=a,i=G(w,n),o=ne(Y,n),l=Rs(Y,n),u=te(n);return e.jsx(ae.ItemSlot,{scope:n,children:e.jsx(Cs,{"aria-disabled":o.open&&!l.collapsible||void 0,"data-orientation":i.orientation,id:o.triggerId,...u,...r,ref:c})})});Oe.displayName=Y;var De="AccordionContent",Be=_.forwardRef((a,c)=>{const{__scopeAccordion:n,...r}=a,i=G(w,n),o=ne(De,n),l=te(n);return e.jsx(ws,{role:"region","aria-labelledby":o.triggerId,"data-orientation":i.orientation,...l,...r,ref:c,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...a.style}})});Be.displayName=De;function Fe(a){return a?"open":"closed"}var $s=Pe,Os=Te,Ds=$e,Le=Oe,He=Be;const Bs=$s,Ve=h.forwardRef(({className:a,...c},n)=>e.jsx(Os,{ref:n,className:J("border-b",a),...c}));Ve.displayName="AccordionItem";const Ue=h.forwardRef(({className:a,children:c,...n},r)=>e.jsx(Ds,{className:"flex",children:e.jsxs(Le,{ref:r,className:J("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",a),...n,children:[c,e.jsx(bs,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));Ue.displayName=Le.displayName;const ze=h.forwardRef(({className:a,children:c,...n},r)=>e.jsx(He,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:e.jsx("div",{className:J("pb-4 pt-0",a),children:c})}));ze.displayName=He.displayName;const Fs=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],Ls=a=>a==="trending"||a==="date_published"||a==="citation_count"?a:"trending",Q=3,Hs=a=>new Intl.NumberFormat("en",{notation:a>=1e3?"compact":"standard",maximumFractionDigits:1}).format(a),Vs=a=>[...a].sort((c,n)=>{const r=c.slug==="classic-language-modeling",i=n.slug==="classic-language-modeling";return r!==i?r?1:-1:0}),la=()=>{var de,pe,me,he,ue,xe;const{taskSlug:a}=ts(),c=ns(),[n,r]=rs(),i=Ls(n.get("order_by")),o=n.get("has_code")==="true",l=n.get("has_hf_artifacts")==="true",u=s=>{const t=new URLSearchParams(n);t.set("order_by",s),r(t)},g=s=>{const t=new URLSearchParams(n);s?t.set("has_code","true"):t.delete("has_code"),r(t)},b=s=>{const t=new URLSearchParams(n);s?t.set("has_hf_artifacts","true"):t.delete("has_hf_artifacts"),r(t)},[j,v]=h.useState(!1),[R,A]=h.useState(()=>new Set),{preferences:T}=os(),k=(s,t)=>{const d=s||"";return t?`/benchmark/${d}?task=${encodeURIComponent(t)}`:`/benchmark/${d}`},N=T.hide_closed_source_evals?!0:void 0,m=be({queryKey:["task-page",a,N],queryFn:()=>ge.getTaskPage(a,{is_open:N}),enabled:!!a,staleTime:10*60*1e3}),p=be({queryKey:["task-benchmark-trends",a,N],queryFn:()=>ge.getTrendingBenchmarks(a,{limit:100,min_recent_papers:0,is_open:N}),enabled:!!a,staleTime:10*60*1e3}),C=h.useMemo(()=>{var s;return Vs(((s=m.data)==null?void 0:s.children)||[])},[m.data]),I=h.useMemo(()=>{var t;const s=new Map;return(((t=m.data)==null?void 0:t.subtask_benchmarks)||[]).forEach(d=>{s.set(d.subtask_id,d.benchmarks||[])}),s},[m.data]),f=hs({taskId:((pe=(de=m.data)==null?void 0:de.task)==null?void 0:pe.id)||"",page_size:20,order_by:i,order_dir:"desc",include_resources:!0,has_code:o,has_hf_artifacts:l,enabled:!!((he=(me=m.data)==null?void 0:me.task)!=null&&he.id)}),E=h.useMemo(()=>{var t;return(((t=f.data)==null?void 0:t.pages.flatMap(d=>d.results))||[]).map(ms)},[f.data]),D=h.useMemo(()=>{var t;const s={};return(t=f.data)==null||t.pages.forEach(d=>d.results.forEach(O=>(O.methods||[]).forEach(S=>{const y=S.slug||S.id;s[y]||(s[y]={id:S.id,name:S.name,slug:S.slug||"",count:0}),s[y].count++}))),Object.values(s).sort((d,O)=>O.count-d.count).slice(0,8)},[f.data]),{targetRef:F,isIntersecting:M}=us({rootMargin:"200px"});if(h.useEffect(()=>{M&&f.hasNextPage&&!f.isFetchingNextPage&&f.fetchNextPage()},[M,f.hasNextPage,f.isFetchingNextPage]),m.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(U,{className:"h-12 w-1/2 mb-4"}),e.jsx(U,{className:"h-6 w-1/3 mb-8"}),e.jsx(U,{className:"h-64 w-full"})]});if(m.error||!m.data)return e.jsx("div",{className:"page",children:e.jsx(xs,{variant:"destructive",children:e.jsx(gs,{children:"Task not found."})})});const x=m.data.task,Ke=m.data.parents||[],L=V(x.name,x.slug),re=(m.data.sisters||[]).filter(s=>s.id!==x.id),oe=m.data.recommended_frameworks||[],H=m.data.benchmarks||[],qe=new Map(H.map(s=>[s.id,s])),Ge=new Set(H.map(s=>s.id)),ce=(((ue=p.data)==null?void 0:ue.results)||[]).filter(s=>Ge.has(s.id)).map(s=>{const t=qe.get(s.id);return{...s,best_model_name:(t==null?void 0:t.best_model_name)??s.best_model_name,best_paper_route:t==null?void 0:t.best_paper_route,best_paper_title:t==null?void 0:t.best_paper_title,best_code_url:t==null?void 0:t.best_code_url}}),$=ce.length?ce:H.map(s=>({id:s.id,name:s.name,slug:s.slug,full_name:s.full_name,recent_paper_count:0,baseline_paper_count:0,all_time_paper_count:s.paper_count||0,trend_score:0,rate_change:null,latest_reported_on:null,best_model_name:s.best_model_name,best_paper_route:s.best_paper_route,best_paper_title:s.best_paper_title,best_code_url:s.best_code_url,history:[]})),ie=((xe=p.data)==null?void 0:xe.recent_days)||90,We=C.some(s=>(I.get(s.id)||[]).length>0),Qe=C.length>0,le=$.length>0,Ye=(()=>{const s=new Set;return H.forEach(t=>s.add(t.id)),I.forEach(t=>t.forEach(d=>s.add(d.id))),s.size})(),Ze=s=>{A(t=>{const d=new Set(t);return d.has(s)?d.delete(s):d.add(s),d})};return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(P,{to:"/",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx(P,{to:"/tasks",children:"Tasks"}),[...Ke].reverse().map(s=>e.jsxs(_.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(P,{to:`/tasks/${s.slug||s.id}`,children:V(s.name,s.slug)})]},s.id)),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--accent-text)"},children:x.name.toUpperCase()})]}),e.jsxs("div",{className:x.image_url?"task-hero-grid":void 0,children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:L}),x.description&&e.jsx(W,{className:"task-explainer",text:x.description}),x.research_trends&&x.research_trends.length>0&&e.jsx(Bs,{className:"task-research-trends",type:"single",collapsible:!0,children:e.jsxs(Ve,{className:"task-research-trends-item",value:"key-trends",children:[e.jsx(Ue,{className:"task-research-trends-trigger",children:e.jsx("span",{className:"task-research-trends-title",children:"Key trends"})}),e.jsx(ze,{className:"task-research-trends-content",children:e.jsx("ul",{children:x.research_trends.map((s,t)=>e.jsx("li",{children:e.jsx(W,{text:s})},t))})})]})}),e.jsxs("div",{className:"task-quickstats",children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:(x.paper_count??0).toLocaleString()}),"PAPERS"]}),e.jsxs("span",{children:[e.jsx("span",{className:"num",children:Ye}),"BENCHMARKS"]}),e.jsxs("span",{children:[e.jsxs("span",{className:"num",children:[D.length,"+"]}),"METHODS USED"]})]}),oe.length>0&&e.jsxs("div",{className:"task-framework-links",children:[e.jsx("span",{className:"task-framework-links-label",children:"Recommended frameworks"}),oe.map(s=>{const t=s.owner&&s.name?`${s.owner}/${s.name}`:s.name||s.url.replace(/^https?:\/\/github\.com\//,"");return e.jsxs("a",{href:s.url,className:"task-framework-link",target:"_blank",rel:"noreferrer",children:[e.jsx(fe,{size:13,strokeWidth:1.8,"aria-hidden":"true"}),e.jsx("span",{children:t}),e.jsxs("span",{className:"task-framework-link-stars",children:["★ ",Hs(s.num_stars)]})]},s.id)})]})]}),x.image_url&&e.jsxs("figure",{className:`task-figure-card${x.slug==="omni-models"?" task-figure-card--compact":""}`,children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:cs(x.image_url)??void 0,alt:`${L} schematic`,onError:s=>{var t,d;(d=(t=s.currentTarget.parentElement)==null?void 0:t.parentElement)==null||d.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",L,x.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(W,{className:"task-image-credit",text:x.image_credit})]})]})]})]}),e.jsxs("div",{className:"task-page-grid",style:{marginTop:28},children:[e.jsxs("div",{children:[le&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"task-section-head",children:[e.jsxs("div",{className:"task-section-eyebrow",children:[ie,"-day reporting activity · select a benchmark"]}),e.jsxs("div",{className:"task-section-title",children:["Benchmarks ",e.jsxs("span",{className:"meta",children:["[",$.length,"]"]})]})]}),e.jsxs("div",{className:"benchmark-trend-table",role:"table","aria-label":"Trending benchmarks",children:[e.jsxs("div",{className:"benchmark-trend-head",role:"row",children:[e.jsx("span",{role:"columnheader",children:"Trend"}),e.jsx("span",{role:"columnheader",children:"Benchmark"}),e.jsx("span",{role:"columnheader",children:"Best model"}),e.jsx("span",{role:"columnheader",children:"Paper title"}),e.jsx("span",{role:"columnheader",children:"Code"}),e.jsx("span",{role:"columnheader",children:"Compare"})]}),(j?$:$.slice(0,5)).map(s=>e.jsxs("div",{className:"benchmark-trend-row",role:"row",children:[e.jsxs("div",{className:"benchmark-trend-cell",role:"cell",children:[e.jsx(ds,{history:s.history,benchmarkName:s.name}),e.jsxs("div",{className:"benchmark-trend-meta",children:[e.jsxs("span",{children:[e.jsx("strong",{children:s.recent_paper_count})," ",s.recent_paper_count===1?"paper":"papers"," /"," ",ie,"d"]}),s.rate_change==null?s.recent_paper_count>0&&e.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):e.jsxs("span",{className:`benchmark-trend-change ${s.rate_change>=1?"is-up":"is-down"}`,children:[s.rate_change>=1?"↑":"↓"," ",s.rate_change.toFixed(1),"×"]})]})]}),e.jsxs("div",{className:"benchmark-trend-benchmark",role:"cell",children:[e.jsx(P,{className:"bench-row-name",to:k(s.slug||s.id,a),children:s.name}),e.jsx("div",{className:"bench-row-sub",children:e.jsxs("span",{children:[e.jsx("strong",{children:s.all_time_paper_count})," reporting papers"]})})]}),e.jsx("div",{className:"bench-row-best",role:"cell",children:s.best_model_name?e.jsxs(e.Fragment,{children:[e.jsx(js,{size:13,className:"bench-row-best-icon"}),e.jsx("span",{className:"bench-row-best-name",children:s.best_model_name})]}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-paper",role:"cell",children:s.best_paper_route&&s.best_paper_title?e.jsx(P,{to:`/paper/${encodeURIComponent(s.best_paper_route)}`,children:s.best_paper_title}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-code",role:"cell",children:s.best_code_url?e.jsx("a",{href:s.best_code_url,target:"_blank",rel:"noopener noreferrer","aria-label":`Code for ${s.best_paper_title||s.best_model_name}`,children:e.jsx(fe,{size:18,strokeWidth:1.8,"aria-hidden":"true"})}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-compare",role:"cell",children:e.jsxs(P,{to:k(s.slug||s.id,a),"aria-label":`Compare ${s.best_model_name||"the best model"} with all results on ${s.name}`,children:[e.jsx("span",{children:"See all"}),e.jsx(fs,{size:11,strokeWidth:2,"aria-hidden":"true"})]})})]},s.id))]}),$.length>5&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>v(s=>!s),children:j?"− show top 5":`+ show ${$.length-5} more benchmarks`})]}),Qe&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"task-section-head",style:le?{marginTop:36}:void 0,children:[e.jsx("div",{className:"task-section-eyebrow",children:We?"Benchmarks by capability":"Task hierarchy"}),e.jsxs("div",{className:"task-section-title",children:["Subtasks ",e.jsxs("span",{className:"meta",children:["[",C.length,"]"]})]})]}),e.jsx("div",{className:"subtask-grid",children:C.map(s=>{const t=I.get(s.id)||[],d=R.has(s.id),O=d?t:t.slice(0,Q),S=t.length-Q;return e.jsxs("div",{className:"subtask-section",children:[e.jsxs("div",{className:"subtask-head",children:[e.jsx(P,{to:`/tasks/${s.slug||s.id}`,className:"subtask-head-name",children:V(s.name,s.slug)}),e.jsx("span",{className:"subtask-head-meta",children:t.length>0?`[${t.length} benchmark${t.length===1?"":"s"}]`:`[${(s.paper_count??0).toLocaleString()} papers]`})]}),O.length>0?O.map((y,Je)=>e.jsxs("div",{className:"bench-row",onClick:()=>c(k(y.slug||y.id,s.slug||s.id)),children:[e.jsx("div",{className:"bench-row-num",children:String(Je+1).padStart(2,"0")}),e.jsxs("div",{className:"bench-row-main",children:[e.jsx("div",{className:"bench-row-name",children:y.name}),e.jsx("div",{className:"bench-row-sub",children:y.paper_count!=null&&e.jsxs("span",{children:[e.jsx("strong",{children:y.paper_count})," ENTRIES"]})})]}),e.jsx("div",{className:"bench-row-arrow",children:"→"})]},y.id)):e.jsxs(P,{to:`/tasks/${s.slug||s.id}`,className:"subtask-summary",children:[e.jsxs("span",{children:[(s.paper_count??0).toLocaleString()," papers"]}),s.description&&e.jsx("span",{className:"subtask-summary-desc",children:s.description})]}),S>0&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>Ze(s.id),children:d?`− show top ${Q}`:`+ show ${S} more benchmark${S===1?"":"s"}`})]},s.id)})})]}),e.jsxs("div",{className:"task-section-head",style:{marginTop:36},children:[e.jsx("div",{className:"task-section-eyebrow",children:"Top trending · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",(x.paper_count??0).toLocaleString(),"]"]})]})]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:Fs.map(([s,t])=>e.jsx("button",{className:`sort-btn ${i===s?"active":""}`,onClick:()=>u(s),children:t},s))}),e.jsx(ps,{hasCode:o,hasHfArtifacts:l,onHasCodeChange:g,onHasHfArtifactsChange:b})]}),e.jsxs("div",{className:"results-count",children:[E.length," loaded in ",e.jsx("span",{children:L})]})]}),f.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((s,t)=>e.jsx(U,{className:"h-40 w-full"},t))}):E.length===0?e.jsx("div",{className:"no-results",children:"No papers in this task yet."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:E.map((s,t)=>e.jsx(is,{paper:s,rank:t+1},s.id))}),e.jsx("div",{ref:F,style:{height:1}}),f.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]}),e.jsxs("aside",{className:"task-side",children:[re.length>0&&e.jsxs("div",{className:"side-block",children:[e.jsx("div",{className:"side-block-num",children:"01/"}),e.jsx("div",{className:"side-block-label",children:"Sister Tasks"}),re.slice(0,8).map(s=>e.jsxs(P,{to:`/tasks/${s.slug||s.id}`,className:"side-link-row",children:[e.jsx("span",{children:V(s.name,s.slug)}),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count.toLocaleString()})]},s.id))]}),D.length>0&&e.jsxs("div",{className:"side-block",children:[e.jsx("div",{className:"side-block-num",children:"02/"}),e.jsx("div",{className:"side-block-label",children:"Common Methods"}),D.map(s=>e.jsxs("div",{className:"side-method-row",children:[e.jsx(ls,{method:{slug:s.slug,name:s.name}}),e.jsxs("span",{className:"num",children:["·",s.count]})]},s.id))]})]})]})]})};export{la as default};
 
1
+ import{c as je,r as h,o as Z,j as e,n as B,a2 as _e,q as ve,P as Xe,t as Ne,p as ke,a3 as es,R as _,a4 as ss,N as as,v as J,e as ts,u as ns,a as rs,V as os,L as P,$ as cs,b as ge}from"./index-Bo5_2OqZ.js";import{u as be}from"./useQuery-Bh9FZQpL.js";import{P as is,M as ls}from"./components-BbXgE2lV.js";import{B as ds}from"./BenchmarkTrendSparkline-BCbEDZUr.js";import{P as ps}from"./PaperFeedFilters-D2TbUu0j.js";import{M as W}from"./MarkdownText-VH1HEGnz.js";import{t as ms,d as V}from"./transform-2Gnjg1jt.js";import{b as hs}from"./usePapers-CdB1OuZ5.js";import{u as us}from"./useIntersectionObserver-7HCpY83L.js";import{S as U}from"./skeleton-CB-heJjl.js";import{A as xs,a as gs}from"./alert-_EYQlDHA.js";import{C as bs}from"./chevron-down-BeEEYUNO.js";import{G as fe}from"./github-D8cWDRad.js";import"./useBaseQuery-B8T7kRNC.js";import"./LatexTitle-qoY4vrTZ.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-DTmodbgi.js";import"./index-C-0CcYmz.js";import"./hover-card-DrtqDSb0.js";import"./useInfiniteQuery-CzzYUeDW.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
8
  *
9
  * This source code is licensed under the ISC license.
10
  * See the LICENSE file in the root directory of this source tree.
11
+ */const js=je("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]);var z="Collapsible",[_s,Ce]=Ne(z),[vs,X]=_s(z),we=h.forwardRef((a,c)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:l,...u}=a,[g,b]=Z({prop:r,defaultProp:i??!1,onChange:l,caller:z});return e.jsx(vs,{scope:n,disabled:o,contentId:_e(),open:g,onOpenToggle:h.useCallback(()=>b(j=>!j),[b]),children:e.jsx(B.div,{"data-state":se(g),"data-disabled":o?"":void 0,...u,ref:c})})});we.displayName=z;var ye="CollapsibleTrigger",Ae=h.forwardRef((a,c)=>{const{__scopeCollapsible:n,...r}=a,i=X(ye,n);return e.jsx(B.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":se(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:c,onClick:ve(a.onClick,i.onOpenToggle)})});Ae.displayName=ye;var ee="CollapsibleContent",Se=h.forwardRef((a,c)=>{const{forceMount:n,...r}=a,i=X(ee,a.__scopeCollapsible);return e.jsx(Xe,{present:n||i.open,children:({present:o})=>e.jsx(Ns,{...r,ref:c,present:o})})});Se.displayName=ee;var Ns=h.forwardRef((a,c)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=a,l=X(ee,n),[u,g]=h.useState(r),b=h.useRef(null),j=ke(c,b),v=h.useRef(0),R=v.current,A=h.useRef(0),T=A.current,k=l.open||u,N=h.useRef(k),m=h.useRef(void 0);return h.useEffect(()=>{const p=requestAnimationFrame(()=>N.current=!1);return()=>cancelAnimationFrame(p)},[]),es(()=>{const p=b.current;if(p){m.current=m.current||{transitionDuration:p.style.transitionDuration,animationName:p.style.animationName},p.style.transitionDuration="0s",p.style.animationName="none";const C=p.getBoundingClientRect();v.current=C.height,A.current=C.width,N.current||(p.style.transitionDuration=m.current.transitionDuration,p.style.animationName=m.current.animationName),g(r)}},[l.open,r]),e.jsx(B.div,{"data-state":se(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!k,...o,ref:j,style:{"--radix-collapsible-content-height":R?`${R}px`:void 0,"--radix-collapsible-content-width":T?`${T}px`:void 0,...a.style},children:k&&i})});function se(a){return a?"open":"closed"}var ks=we,Cs=Ae,ws=Se,w="Accordion",ys=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[ae,As,Ss]=ss(w),[K]=Ne(w,[Ss,Ce]),te=Ce(),Pe=_.forwardRef((a,c)=>{const{type:n,...r}=a,i=r,o=r;return e.jsx(ae.Provider,{scope:a.__scopeAccordion,children:n==="multiple"?e.jsx(Es,{...o,ref:c}):e.jsx(Is,{...i,ref:c})})});Pe.displayName=w;var[Re,Ps]=K(w),[Ie,Rs]=K(w,{collapsible:!1}),Is=_.forwardRef((a,c)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},collapsible:o=!1,...l}=a,[u,g]=Z({prop:n,defaultProp:r??"",onChange:i,caller:w});return e.jsx(Re,{scope:a.__scopeAccordion,value:_.useMemo(()=>u?[u]:[],[u]),onItemOpen:g,onItemClose:_.useCallback(()=>o&&g(""),[o,g]),children:e.jsx(Ie,{scope:a.__scopeAccordion,collapsible:o,children:e.jsx(Ee,{...l,ref:c})})})}),Es=_.forwardRef((a,c)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...o}=a,[l,u]=Z({prop:n,defaultProp:r??[],onChange:i,caller:w}),g=_.useCallback(j=>u((v=[])=>[...v,j]),[u]),b=_.useCallback(j=>u((v=[])=>v.filter(R=>R!==j)),[u]);return e.jsx(Re,{scope:a.__scopeAccordion,value:l,onItemOpen:g,onItemClose:b,children:e.jsx(Ie,{scope:a.__scopeAccordion,collapsible:!0,children:e.jsx(Ee,{...o,ref:c})})})}),[Ts,G]=K(w),Ee=_.forwardRef((a,c)=>{const{__scopeAccordion:n,disabled:r,dir:i,orientation:o="vertical",...l}=a,u=_.useRef(null),g=ke(u,c),b=As(n),v=as(i)==="ltr",R=ve(a.onKeyDown,A=>{var F;if(!ys.includes(A.key))return;const T=A.target,k=b().filter(M=>{var x;return!((x=M.ref.current)!=null&&x.disabled)}),N=k.findIndex(M=>M.ref.current===T),m=k.length;if(N===-1)return;A.preventDefault();let p=N;const C=0,I=m-1,f=()=>{p=N+1,p>I&&(p=C)},E=()=>{p=N-1,p<C&&(p=I)};switch(A.key){case"Home":p=C;break;case"End":p=I;break;case"ArrowRight":o==="horizontal"&&(v?f():E());break;case"ArrowDown":o==="vertical"&&f();break;case"ArrowLeft":o==="horizontal"&&(v?E():f());break;case"ArrowUp":o==="vertical"&&E();break}const D=p%m;(F=k[D].ref.current)==null||F.focus()});return e.jsx(Ts,{scope:n,disabled:r,direction:i,orientation:o,children:e.jsx(ae.Slot,{scope:n,children:e.jsx(B.div,{...l,"data-orientation":o,ref:g,onKeyDown:r?void 0:R})})})}),q="AccordionItem",[Ms,ne]=K(q),Te=_.forwardRef((a,c)=>{const{__scopeAccordion:n,value:r,...i}=a,o=G(q,n),l=Ps(q,n),u=te(n),g=_e(),b=r&&l.value.includes(r)||!1,j=o.disabled||a.disabled;return e.jsx(Ms,{scope:n,open:b,disabled:j,triggerId:g,children:e.jsx(ks,{"data-orientation":o.orientation,"data-state":Fe(b),...u,...i,ref:c,disabled:j,open:b,onOpenChange:v=>{v?l.onItemOpen(r):l.onItemClose(r)}})})});Te.displayName=q;var Me="AccordionHeader",$e=_.forwardRef((a,c)=>{const{__scopeAccordion:n,...r}=a,i=G(w,n),o=ne(Me,n);return e.jsx(B.h3,{"data-orientation":i.orientation,"data-state":Fe(o.open),"data-disabled":o.disabled?"":void 0,...r,ref:c})});$e.displayName=Me;var Y="AccordionTrigger",Oe=_.forwardRef((a,c)=>{const{__scopeAccordion:n,...r}=a,i=G(w,n),o=ne(Y,n),l=Rs(Y,n),u=te(n);return e.jsx(ae.ItemSlot,{scope:n,children:e.jsx(Cs,{"aria-disabled":o.open&&!l.collapsible||void 0,"data-orientation":i.orientation,id:o.triggerId,...u,...r,ref:c})})});Oe.displayName=Y;var De="AccordionContent",Be=_.forwardRef((a,c)=>{const{__scopeAccordion:n,...r}=a,i=G(w,n),o=ne(De,n),l=te(n);return e.jsx(ws,{role:"region","aria-labelledby":o.triggerId,"data-orientation":i.orientation,...l,...r,ref:c,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...a.style}})});Be.displayName=De;function Fe(a){return a?"open":"closed"}var $s=Pe,Os=Te,Ds=$e,Le=Oe,He=Be;const Bs=$s,Ve=h.forwardRef(({className:a,...c},n)=>e.jsx(Os,{ref:n,className:J("border-b",a),...c}));Ve.displayName="AccordionItem";const Ue=h.forwardRef(({className:a,children:c,...n},r)=>e.jsx(Ds,{className:"flex",children:e.jsxs(Le,{ref:r,className:J("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",a),...n,children:[c,e.jsx(bs,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));Ue.displayName=Le.displayName;const qe=h.forwardRef(({className:a,children:c,...n},r)=>e.jsx(He,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:e.jsx("div",{className:J("pb-4 pt-0",a),children:c})}));qe.displayName=He.displayName;const Fs=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],Ls=a=>a==="trending"||a==="date_published"||a==="citation_count"?a:"trending",Q=3,Hs=a=>new Intl.NumberFormat("en",{notation:a>=1e3?"compact":"standard",maximumFractionDigits:1}).format(a),Vs=a=>[...a].sort((c,n)=>{const r=c.slug==="classic-language-modeling",i=n.slug==="classic-language-modeling";return r!==i?r?1:-1:0}),la=()=>{var de,pe,me,he,ue,xe;const{taskSlug:a}=ts(),c=ns(),[n,r]=rs(),i=Ls(n.get("order_by")),o=n.get("has_code")==="true",l=n.get("has_hf_artifacts")==="true",u=s=>{const t=new URLSearchParams(n);t.set("order_by",s),r(t)},g=s=>{const t=new URLSearchParams(n);s?t.set("has_code","true"):t.delete("has_code"),r(t)},b=s=>{const t=new URLSearchParams(n);s?t.set("has_hf_artifacts","true"):t.delete("has_hf_artifacts"),r(t)},[j,v]=h.useState(!1),[R,A]=h.useState(()=>new Set),{preferences:T}=os(),k=(s,t)=>{const d=s||"";return t?`/benchmark/${d}?task=${encodeURIComponent(t)}`:`/benchmark/${d}`},N=T.hide_closed_source_evals?!0:void 0,m=be({queryKey:["task-page",a,N],queryFn:()=>ge.getTaskPage(a,{is_open:N}),enabled:!!a,staleTime:10*60*1e3}),p=be({queryKey:["task-benchmark-trends",a,N],queryFn:()=>ge.getTrendingBenchmarks(a,{limit:100,min_recent_papers:0,is_open:N}),enabled:!!a,staleTime:10*60*1e3}),C=h.useMemo(()=>{var s;return Vs(((s=m.data)==null?void 0:s.children)||[])},[m.data]),I=h.useMemo(()=>{var t;const s=new Map;return(((t=m.data)==null?void 0:t.subtask_benchmarks)||[]).forEach(d=>{s.set(d.subtask_id,d.benchmarks||[])}),s},[m.data]),f=hs({taskId:((pe=(de=m.data)==null?void 0:de.task)==null?void 0:pe.id)||"",page_size:20,order_by:i,order_dir:"desc",include_resources:!0,has_code:o,has_hf_artifacts:l,enabled:!!((he=(me=m.data)==null?void 0:me.task)!=null&&he.id)}),E=h.useMemo(()=>{var t;return(((t=f.data)==null?void 0:t.pages.flatMap(d=>d.results))||[]).map(ms)},[f.data]),D=h.useMemo(()=>{var t;const s={};return(t=f.data)==null||t.pages.forEach(d=>d.results.forEach(O=>(O.methods||[]).forEach(S=>{const y=S.slug||S.id;s[y]||(s[y]={id:S.id,name:S.name,slug:S.slug||"",count:0}),s[y].count++}))),Object.values(s).sort((d,O)=>O.count-d.count).slice(0,8)},[f.data]),{targetRef:F,isIntersecting:M}=us({rootMargin:"200px"});if(h.useEffect(()=>{M&&f.hasNextPage&&!f.isFetchingNextPage&&f.fetchNextPage()},[M,f.hasNextPage,f.isFetchingNextPage]),m.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(U,{className:"h-12 w-1/2 mb-4"}),e.jsx(U,{className:"h-6 w-1/3 mb-8"}),e.jsx(U,{className:"h-64 w-full"})]});if(m.error||!m.data)return e.jsx("div",{className:"page",children:e.jsx(xs,{variant:"destructive",children:e.jsx(gs,{children:"Task not found."})})});const x=m.data.task,ze=m.data.parents||[],L=V(x.name,x.slug),re=(m.data.sisters||[]).filter(s=>s.id!==x.id),oe=m.data.recommended_frameworks||[],H=m.data.benchmarks||[],Ke=new Map(H.map(s=>[s.id,s])),Ge=new Set(H.map(s=>s.id)),ce=(((ue=p.data)==null?void 0:ue.results)||[]).filter(s=>Ge.has(s.id)).map(s=>{const t=Ke.get(s.id);return{...s,best_model_name:(t==null?void 0:t.best_model_name)??s.best_model_name,best_paper_route:t==null?void 0:t.best_paper_route,best_paper_title:t==null?void 0:t.best_paper_title,best_code_url:t==null?void 0:t.best_code_url}}),$=ce.length?ce:H.map(s=>({id:s.id,name:s.name,slug:s.slug,full_name:s.full_name,recent_paper_count:0,baseline_paper_count:0,all_time_paper_count:s.paper_count||0,trend_score:0,rate_change:null,latest_reported_on:null,best_model_name:s.best_model_name,best_paper_route:s.best_paper_route,best_paper_title:s.best_paper_title,best_code_url:s.best_code_url,history:[]})),ie=((xe=p.data)==null?void 0:xe.recent_days)||90,We=C.some(s=>(I.get(s.id)||[]).length>0),Qe=C.length>0,le=$.length>0,Ye=(()=>{const s=new Set;return H.forEach(t=>s.add(t.id)),I.forEach(t=>t.forEach(d=>s.add(d.id))),s.size})(),Ze=s=>{A(t=>{const d=new Set(t);return d.has(s)?d.delete(s):d.add(s),d})};return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(P,{to:"/",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx(P,{to:"/tasks",children:"Tasks"}),[...ze].reverse().map(s=>e.jsxs(_.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(P,{to:`/tasks/${s.slug||s.id}`,children:V(s.name,s.slug)})]},s.id)),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--accent-text)"},children:x.name.toUpperCase()})]}),e.jsxs("div",{className:x.image_url?"task-hero-grid":void 0,children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:L}),x.description&&e.jsx(W,{className:"task-explainer",text:x.description}),x.research_trends&&x.research_trends.length>0&&e.jsx(Bs,{className:"task-research-trends",type:"single",collapsible:!0,children:e.jsxs(Ve,{className:"task-research-trends-item",value:"key-trends",children:[e.jsx(Ue,{className:"task-research-trends-trigger",children:e.jsx("span",{className:"task-research-trends-title",children:"Key trends"})}),e.jsx(qe,{className:"task-research-trends-content",children:e.jsx("ul",{children:x.research_trends.map((s,t)=>e.jsx("li",{children:e.jsx(W,{text:s})},t))})})]})}),e.jsxs("div",{className:"task-quickstats",children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:(x.paper_count??0).toLocaleString()}),"PAPERS"]}),e.jsxs("span",{children:[e.jsx("span",{className:"num",children:Ye}),"BENCHMARKS"]}),e.jsxs("span",{children:[e.jsxs("span",{className:"num",children:[D.length,"+"]}),"METHODS USED"]})]}),oe.length>0&&e.jsxs("div",{className:"task-framework-links",children:[e.jsx("span",{className:"task-framework-links-label",children:"Recommended frameworks"}),oe.map(s=>{const t=s.owner&&s.name?`${s.owner}/${s.name}`:s.name||s.url.replace(/^https?:\/\/github\.com\//,"");return e.jsxs("a",{href:s.url,className:"task-framework-link",target:"_blank",rel:"noreferrer",children:[e.jsx(fe,{size:13,strokeWidth:1.8,"aria-hidden":"true"}),e.jsx("span",{children:t}),e.jsxs("span",{className:"task-framework-link-stars",children:["★ ",Hs(s.num_stars)]})]},s.id)})]})]}),x.image_url&&e.jsxs("figure",{className:`task-figure-card${x.slug==="omni-models"?" task-figure-card--compact":""}`,children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:cs(x.image_url)??void 0,alt:`${L} schematic`,onError:s=>{var t,d;(d=(t=s.currentTarget.parentElement)==null?void 0:t.parentElement)==null||d.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",L,x.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(W,{className:"task-image-credit",text:x.image_credit})]})]})]})]}),e.jsxs("div",{className:"task-page-grid",style:{marginTop:28},children:[e.jsxs("div",{children:[le&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"task-section-head",children:[e.jsxs("div",{className:"task-section-eyebrow",children:[ie,"-day reporting activity · select a benchmark"]}),e.jsxs("div",{className:"task-section-title",children:["Benchmarks ",e.jsxs("span",{className:"meta",children:["[",$.length,"]"]})]})]}),e.jsxs("div",{className:"benchmark-trend-table",role:"table","aria-label":"Trending benchmarks",children:[e.jsxs("div",{className:"benchmark-trend-head",role:"row",children:[e.jsx("span",{role:"columnheader",children:"Trend"}),e.jsx("span",{role:"columnheader",children:"Benchmark"}),e.jsx("span",{role:"columnheader",children:"Best model"}),e.jsx("span",{role:"columnheader",children:"Paper title"}),e.jsx("span",{role:"columnheader",children:"Code"}),e.jsx("span",{role:"columnheader",children:"Compare"})]}),(j?$:$.slice(0,5)).map(s=>e.jsxs("div",{className:"benchmark-trend-row",role:"row",children:[e.jsxs("div",{className:"benchmark-trend-cell",role:"cell",children:[e.jsx(ds,{history:s.history,benchmarkName:s.name}),e.jsxs("div",{className:"benchmark-trend-meta",children:[e.jsxs("span",{children:[e.jsx("strong",{children:s.recent_paper_count})," ",s.recent_paper_count===1?"paper":"papers"," /"," ",ie,"d"]}),s.rate_change==null?s.recent_paper_count>0&&e.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):e.jsxs("span",{className:`benchmark-trend-change ${s.rate_change>=1?"is-up":"is-down"}`,children:[s.rate_change>=1?"↑":"↓"," ",s.rate_change.toFixed(1),"×"]})]})]}),e.jsxs("div",{className:"benchmark-trend-benchmark",role:"cell",children:[e.jsx(P,{className:"bench-row-name",to:k(s.slug||s.id,a),children:s.name}),e.jsx("div",{className:"bench-row-sub",children:e.jsxs("span",{children:[e.jsx("strong",{children:s.all_time_paper_count})," reporting papers"]})})]}),e.jsx("div",{className:"bench-row-best",role:"cell",children:s.best_model_name?e.jsxs(e.Fragment,{children:[e.jsx(js,{size:13,className:"bench-row-best-icon"}),e.jsx("span",{className:"bench-row-best-name",children:s.best_model_name})]}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-paper",role:"cell",children:s.best_paper_route&&s.best_paper_title?e.jsx(P,{to:`/paper/${encodeURIComponent(s.best_paper_route)}`,children:s.best_paper_title}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-code",role:"cell",children:s.best_code_url?e.jsx("a",{href:s.best_code_url,target:"_blank",rel:"noopener noreferrer","aria-label":`Code for ${s.best_paper_title||s.best_model_name}`,children:e.jsx(fe,{size:18,strokeWidth:1.8,"aria-hidden":"true"})}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-compare",role:"cell",children:e.jsxs(P,{to:k(s.slug||s.id,a),"aria-label":`Compare ${s.best_model_name||"the best model"} with all results on ${s.name}`,children:[e.jsx("span",{children:"See all"}),e.jsx(fs,{size:11,strokeWidth:2,"aria-hidden":"true"})]})})]},s.id))]}),$.length>5&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>v(s=>!s),children:j?"− show top 5":`+ show ${$.length-5} more benchmarks`})]}),Qe&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"task-section-head",style:le?{marginTop:36}:void 0,children:[e.jsx("div",{className:"task-section-eyebrow",children:We?"Benchmarks by capability":"Task hierarchy"}),e.jsxs("div",{className:"task-section-title",children:["Subtasks ",e.jsxs("span",{className:"meta",children:["[",C.length,"]"]})]})]}),e.jsx("div",{className:"subtask-grid",children:C.map(s=>{const t=I.get(s.id)||[],d=R.has(s.id),O=d?t:t.slice(0,Q),S=t.length-Q;return e.jsxs("div",{className:"subtask-section",children:[e.jsxs("div",{className:"subtask-head",children:[e.jsx(P,{to:`/tasks/${s.slug||s.id}`,className:"subtask-head-name",children:V(s.name,s.slug)}),e.jsx("span",{className:"subtask-head-meta",children:t.length>0?`[${t.length} benchmark${t.length===1?"":"s"}]`:`[${(s.paper_count??0).toLocaleString()} papers]`})]}),O.length>0?O.map((y,Je)=>e.jsxs("div",{className:"bench-row",onClick:()=>c(k(y.slug||y.id,s.slug||s.id)),children:[e.jsx("div",{className:"bench-row-num",children:String(Je+1).padStart(2,"0")}),e.jsxs("div",{className:"bench-row-main",children:[e.jsx("div",{className:"bench-row-name",children:y.name}),e.jsx("div",{className:"bench-row-sub",children:y.paper_count!=null&&e.jsxs("span",{children:[e.jsx("strong",{children:y.paper_count})," ENTRIES"]})})]}),e.jsx("div",{className:"bench-row-arrow",children:"→"})]},y.id)):e.jsxs(P,{to:`/tasks/${s.slug||s.id}`,className:"subtask-summary",children:[e.jsxs("span",{children:[(s.paper_count??0).toLocaleString()," papers"]}),s.description&&e.jsx("span",{className:"subtask-summary-desc",children:s.description})]}),S>0&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>Ze(s.id),children:d?`− show top ${Q}`:`+ show ${S} more benchmark${S===1?"":"s"}`})]},s.id)})})]}),e.jsxs("div",{className:"task-section-head",style:{marginTop:36},children:[e.jsx("div",{className:"task-section-eyebrow",children:"Top trending · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",(x.paper_count??0).toLocaleString(),"]"]})]})]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:Fs.map(([s,t])=>e.jsx("button",{className:`sort-btn ${i===s?"active":""}`,onClick:()=>u(s),children:t},s))}),e.jsx(ps,{hasCode:o,hasHfArtifacts:l,onHasCodeChange:g,onHasHfArtifactsChange:b})]}),e.jsxs("div",{className:"results-count",children:[E.length," loaded in ",e.jsx("span",{children:L})]})]}),f.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((s,t)=>e.jsx(U,{className:"h-40 w-full"},t))}):E.length===0?e.jsx("div",{className:"no-results",children:"No papers in this task yet."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:E.map((s,t)=>e.jsx(is,{paper:s,rank:t+1},s.id))}),e.jsx("div",{ref:F,style:{height:1}}),f.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]}),e.jsxs("aside",{className:"task-side",children:[re.length>0&&e.jsxs("div",{className:"side-block",children:[e.jsx("div",{className:"side-block-num",children:"01/"}),e.jsx("div",{className:"side-block-label",children:"Sister Tasks"}),re.slice(0,8).map(s=>e.jsxs(P,{to:`/tasks/${s.slug||s.id}`,className:"side-link-row",children:[e.jsx("span",{children:V(s.name,s.slug)}),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count.toLocaleString()})]},s.id))]}),D.length>0&&e.jsxs("div",{className:"side-block",children:[e.jsx("div",{className:"side-block-num",children:"02/"}),e.jsx("div",{className:"side-block-label",children:"Common Methods"}),D.map(s=>e.jsxs("div",{className:"side-method-row",children:[e.jsx(ls,{method:{slug:s.slug,name:s.name}}),e.jsxs("span",{className:"num",children:["·",s.count]})]},s.id))]})]})]})]})};export{la as default};
assets/{TagsIndexView-EZ-gEon4.js → TagsIndexView-CFL5RaeB.js} RENAMED
@@ -1 +1 @@
1
- import{r as d,j as e,L as p,b as h}from"./index-CIXevVP9.js";import{u as g}from"./useQuery-BHSsBDmJ.js";import{e as x,h as f,d as u}from"./transform-CNyzjv1G.js";import{S as m}from"./skeleton-BQDYAJTf.js";import{A as j,a as y}from"./alert-axJAQJuC.js";import{T as k}from"./TaxonomySuggestionTile-B7IEL_hW.js";import"./useBaseQuery-BL30DOiU.js";import"./SignInToEditDialog-BJmkw1tr.js";import"./button-5O6wnTvY.js";import"./textarea-CcQVD6R-.js";import"./dialog-CA9NpDaA.js";import"./useMutation-CDeysSx_.js";import"./loader-circle-k9WscwaT.js";const v=r=>(r==null?void 0:r.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",E=()=>{const r=g({queryKey:["areas-with-tasks"],queryFn:()=>h.getAreasWithTasks(),staleTime:6e5}),o=d.useMemo(()=>{if(!r.data)return[];const s={general:0,vision:1,video:2,language:3,audio:4,other:5},t=n=>s[v(n)]??999;return[...r.data.results].sort((n,a)=>{const i=t(n.name),l=t(a.name);return i!==l?i-l:n.name.localeCompare(a.name)})},[r.data]),c=d.useMemo(()=>o.reduce((s,t)=>s+t.tasks.length,0),[o]);return r.error?e.jsx("div",{className:"page",children:e.jsx(j,{variant:"destructive",children:e.jsx(y,{children:"Failed to load taxonomy. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Domains"})]}),e.jsx("div",{className:"feed-subtitle",children:"Browse research by area. Click any task to see trending work."})]})}),r.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((s,t)=>e.jsxs("div",{children:[e.jsx(m,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((n,a)=>e.jsx(m,{className:"h-24"},a))})]},t))}):o.map(s=>{const t=s.tasks;if(t.length===0)return null;const n=t.reduce((a,i)=>a+(i.paper_count||0),0);return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:s.name}),s.description&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:s.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[t.length," ",t.length===1?"task":"tasks"," · ",n.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[t.map(a=>{const i=a.slug||"",l=x(f(i));return e.jsxs(p,{to:`/tasks/${i}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:l.dot}}),u(a.name,i)]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(a.paper_count??0).toLocaleString()," papers"]})})]},a.id)}),e.jsx(k,{kind:"task"})]})]},s.id)}),c>0&&e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[c," tasks across ",o.filter(s=>s.tasks.length>0).length," areas."]})]})};export{E as default};
 
1
+ import{r as d,j as e,L as p,b as h}from"./index-Bo5_2OqZ.js";import{u as g}from"./useQuery-Bh9FZQpL.js";import{e as x,h as f,d as u}from"./transform-2Gnjg1jt.js";import{S as m}from"./skeleton-CB-heJjl.js";import{A as j,a as y}from"./alert-_EYQlDHA.js";import{T as k}from"./TaxonomySuggestionTile-T8WIATj3.js";import"./useBaseQuery-B8T7kRNC.js";import"./SignInToEditDialog-DW_1sVXp.js";import"./button-D8mDpZUh.js";import"./textarea-Cr9wwZtd.js";import"./dialog-BAxsIFdN.js";import"./useMutation-B8C_NgT5.js";import"./loader-circle-L2ccNPQf.js";const v=r=>(r==null?void 0:r.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",E=()=>{const r=g({queryKey:["areas-with-tasks"],queryFn:()=>h.getAreasWithTasks(),staleTime:6e5}),o=d.useMemo(()=>{if(!r.data)return[];const s={general:0,vision:1,video:2,language:3,audio:4,other:5},t=n=>s[v(n)]??999;return[...r.data.results].sort((n,a)=>{const i=t(n.name),l=t(a.name);return i!==l?i-l:n.name.localeCompare(a.name)})},[r.data]),c=d.useMemo(()=>o.reduce((s,t)=>s+t.tasks.length,0),[o]);return r.error?e.jsx("div",{className:"page",children:e.jsx(j,{variant:"destructive",children:e.jsx(y,{children:"Failed to load taxonomy. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Domains"})]}),e.jsx("div",{className:"feed-subtitle",children:"Browse research by area. Click any task to see trending work."})]})}),r.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((s,t)=>e.jsxs("div",{children:[e.jsx(m,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((n,a)=>e.jsx(m,{className:"h-24"},a))})]},t))}):o.map(s=>{const t=s.tasks;if(t.length===0)return null;const n=t.reduce((a,i)=>a+(i.paper_count||0),0);return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:s.name}),s.description&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:s.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[t.length," ",t.length===1?"task":"tasks"," · ",n.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[t.map(a=>{const i=a.slug||"",l=x(f(i));return e.jsxs(p,{to:`/tasks/${i}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:l.dot}}),u(a.name,i)]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(a.paper_count??0).toLocaleString()," papers"]})})]},a.id)}),e.jsx(k,{kind:"task"})]})]},s.id)}),c>0&&e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[c," tasks across ",o.filter(s=>s.tasks.length>0).length," areas."]})]})};export{E as default};
assets/{TaxonomySuggestionTile-B7IEL_hW.js → TaxonomySuggestionTile-T8WIATj3.js} RENAMED
@@ -1 +1 @@
1
- import{f as u,r as o,j as e}from"./index-CIXevVP9.js";import{P as c,S as m,a as p}from"./SignInToEditDialog-BJmkw1tr.js";function h({kind:s}){const{user:a}=u(),[i,n]=o.useState(!1),[l,t]=o.useState(!1),r=`Suggest a new ${s}...`,g=()=>{a?n(!0):t(!0)};return e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:"tag-cell taxonomy-suggestion-cell",onClick:g,children:[e.jsxs("div",{className:"name",children:[e.jsx(c,{className:"taxonomy-suggestion-icon","aria-hidden":"true"}),r]}),e.jsx("div",{className:"meta",children:e.jsx("span",{children:"Propose an addition"})})]}),e.jsx(m,{open:i,onOpenChange:n,kind:s}),e.jsx(p,{open:l,onOpenChange:t,sectionLabel:`${s}s`,returnTo:typeof window<"u"?window.location.pathname:`/${s}s`,taxonomySuggestion:!0})]})}export{h as T};
 
1
+ import{f as u,r as o,j as e}from"./index-Bo5_2OqZ.js";import{P as c,S as m,a as p}from"./SignInToEditDialog-DW_1sVXp.js";function h({kind:s}){const{user:a}=u(),[i,n]=o.useState(!1),[l,t]=o.useState(!1),r=`Suggest a new ${s}...`,g=()=>{a?n(!0):t(!0)};return e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:"tag-cell taxonomy-suggestion-cell",onClick:g,children:[e.jsxs("div",{className:"name",children:[e.jsx(c,{className:"taxonomy-suggestion-icon","aria-hidden":"true"}),r]}),e.jsx("div",{className:"meta",children:e.jsx("span",{children:"Propose an addition"})})]}),e.jsx(m,{open:i,onOpenChange:n,kind:s}),e.jsx(p,{open:l,onOpenChange:t,sectionLabel:`${s}s`,returnTo:typeof window<"u"?window.location.pathname:`/${s}s`,taxonomySuggestion:!0})]})}export{h as T};
assets/{TrendsView-Dp3ULs1-.js → TrendsView-Ch21Eqgg.js} RENAMED
@@ -1 +1 @@
1
- import{b as X,R as G,j as e}from"./index-CIXevVP9.js";import{u as J}from"./useQuery-BHSsBDmJ.js";import{A as q,a as E}from"./alert-axJAQJuC.js";import{S as P}from"./skeleton-BQDYAJTf.js";import"./useBaseQuery-BL30DOiU.js";const m=t=>{const i=/^(\d{4})-(0[1-9]|1[0-2])$/.exec(t);if(!i)return t;const[,r,l]=i;return`${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][Number(l)-1]} '${r.slice(2)}`},Q=()=>X.getResearchTrends(),f=980,j=400,x=62,R=26,g=30,V=58,u=f-x-R,F=j-g-V,v=g+F,Y=t=>{if(t.length<3)return t.map((r,l)=>`${l?"L":"M"}${r[0]} ${r[1]}`).join(" ");let i=`M${t[0][0]} ${t[0][1]}`;for(let r=0;r<t.length-1;r+=1){const l=t[r-1]??t[r],c=t[r],o=t[r+1],a=t[r+2]??o,y=c[0]+(o[0]-l[0])/6,s=c[1]+(o[1]-l[1])/6,b=o[0]-(a[0]-c[0])/6,d=o[1]-(a[1]-c[1])/6;i+=` C ${y} ${s} ${b} ${d} ${o[0]} ${o[1]}`}return i},W={fontFamily:"var(--mono)",fontSize:12,fill:"var(--ink-faint)"},z={fontFamily:"var(--mono)",fontSize:11,fontWeight:600,letterSpacing:"0.14em",fill:"var(--ink-faint)",textTransform:"uppercase"},C=({id:t,data:i,color:r,yTicks:l,yLabel:c,xLabel:o})=>{const[a,y]=G.useState(null),s=i.length,b=l[l.length-1],d=n=>x+u*(s===1?0:n/(s-1)),p=n=>g+F*(1-n/b);if(s===0)return null;const B=i.map((n,h)=>[d(h),p(n.percent)]),A=Y(B),_=`${A} L ${d(s-1)} ${v} L ${x} ${v} Z`,w=s<=12?1:Math.ceil(s/8),O=n=>{const h=n.currentTarget.getBoundingClientRect(),S=(n.clientX-h.left)/h.width*f,k=s>1?u/(s-1):u,I=Math.max(0,Math.min(s-1,Math.round((S-x)/k)));y(I)},H=`trend-gradient-${t}`;return e.jsxs("figure",{className:"trend-chart",children:[e.jsxs("div",{className:"trend-chart-visual",children:[e.jsxs("svg",{viewBox:`0 0 ${f} ${j}`,width:"100%",role:"img","aria-label":`${c} by ${o.toLowerCase()}, from ${m(i[0].month)} (${i[0].percent}%) to ${m(i[s-1].month)} (${i[s-1].percent}%)`,style:{display:"block",overflow:"visible",cursor:"crosshair"},onPointerMove:O,onPointerLeave:()=>y(null),children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:H,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",style:{stopColor:r,stopOpacity:.26}}),e.jsx("stop",{offset:"100%",style:{stopColor:r,stopOpacity:.02}})]})}),l.map(n=>e.jsxs("g",{children:[e.jsx("line",{x1:x,x2:f-R,y1:p(n),y2:p(n),stroke:"var(--hairline)",strokeWidth:1}),e.jsxs("text",{x:x-14,y:p(n)+4,textAnchor:"end",style:W,children:[n,"%"]})]},n)),e.jsx("path",{d:_,fill:`url(#${H})`}),e.jsx("path",{d:A,fill:"none",stroke:r,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round"}),i.map((n,h)=>{const S=h===s-1,k=h%w===0&&s-1-h>=w/2;return!S&&!k?null:e.jsx("text",{x:d(h),y:v+24,textAnchor:"middle",style:W,children:m(n.month)},n.month)}),e.jsx("text",{x:x+u/2,y:j-4,textAnchor:"middle",style:z,children:o}),e.jsx("text",{transform:`translate(16 ${g+F/2}) rotate(-90)`,textAnchor:"middle",style:z,children:c}),a!=null&&e.jsxs(e.Fragment,{children:[e.jsx("line",{x1:d(a),x2:d(a),y1:g,y2:v,stroke:r,strokeWidth:1,strokeDasharray:"3 4",opacity:.5}),e.jsx("circle",{cx:d(a),cy:p(i[a].percent),r:5,fill:"var(--bg)",stroke:r,strokeWidth:2})]})]}),a!=null&&e.jsxs("div",{style:{position:"absolute",left:`${d(a)/f*100}%`,top:`${p(i[a].percent)/j*100}%`,transform:"translate(-50%, calc(-100% - 14px))",background:"var(--bg-elevated)",border:"1px solid var(--hairline)",borderRadius:6,boxShadow:"0 8px 26px rgba(0,0,0,.13)",padding:"7px 12px",pointerEvents:"none",whiteSpace:"nowrap",zIndex:3},children:[e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",color:"var(--ink-faint)",fontSize:13,marginBottom:2},children:m(i[a].month)}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:7,fontFamily:"var(--mono)",fontWeight:600,fontSize:15,color:"var(--ink)"},children:[e.jsx("span",{style:{width:8,height:8,borderRadius:2,background:r,display:"inline-block"}}),i[a].percent,"%"]})]})]}),e.jsxs("details",{className:"trend-chart-table",children:[e.jsx("summary",{style:{fontFamily:"var(--mono)",fontSize:11,letterSpacing:"0.04em",color:"var(--ink-faint)",cursor:"pointer"},children:"View data table"}),e.jsxs("table",{style:{marginTop:8,borderCollapse:"collapse",fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{style:{textAlign:"left",padding:"3px 18px 3px 0"},children:o}),e.jsx("th",{style:{textAlign:"right",padding:"3px 0"},children:c})]})}),e.jsx("tbody",{children:i.map(n=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 18px 2px 0"},children:m(n.month)}),e.jsxs("td",{style:{textAlign:"right",padding:"2px 0"},children:[n.percent,"%"]})]},n.month))})]})]})]})},$={maxWidth:960,padding:"48px 0 8px",borderTop:"1px solid var(--hairline)",marginTop:48},T={fontFamily:"var(--serif)",fontSize:34,fontWeight:500,letterSpacing:"-0.02em",margin:"0 0 10px",color:"var(--ink)"},L={fontFamily:"var(--serif)",fontSize:18,lineHeight:1.55,color:"var(--ink-soft)",maxWidth:620,margin:"0 0 8px"},M={fontFamily:"var(--mono)",fontSize:12,fontWeight:600,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--ink-faint)",marginBottom:8},N={fontFamily:"var(--serif)",fontSize:17,lineHeight:1.6,color:"var(--ink-soft)",margin:0},D={height:320,marginTop:26},ne=()=>{const t=J({queryKey:["research-trends"],queryFn:Q,staleTime:36e5});return e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Research ",e.jsx("em",{children:"Trends"})]}),e.jsx("div",{className:"feed-subtitle",children:"How open science is changing across machine learning — tracked over time from arXiv and the Hugging Face Hub."})]})}),t.error&&e.jsx(q,{variant:"destructive",children:e.jsx(E,{children:"Failed to load research trends. Please try again."})}),e.jsxs("section",{style:$,children:[e.jsx("h2",{style:T,children:"Code Availability"}),e.jsx("p",{style:L,children:"The percentage of published papers that have at least one official code implementation on GitHub."}),e.jsx("div",{style:{marginTop:26},children:t.data?e.jsx(C,{id:"code",data:t.data.code_availability,color:"var(--trend-code)",yTicks:[0,20,40,60,80],yLabel:"Code Availability",xLabel:"Paper Publication Date"}):!t.error&&e.jsx(P,{style:D})})]}),e.jsxs("section",{style:$,children:[e.jsx("h2",{style:T,children:"Papers with Hugging Face artifacts"}),e.jsx("p",{style:L,children:"The percentage of published papers linked to at least one Hugging Face artifact — a model, dataset or Space — making the work directly runnable and reusable."}),e.jsx("div",{style:{marginTop:26},children:t.data?e.jsx(C,{id:"hf",data:t.data.hf_artifacts,color:"var(--trend-hf)",yTicks:[0,10,20,30,40,50],yLabel:"HF Artifact Coverage",xLabel:"Paper Publication Date"}):!t.error&&e.jsx(P,{style:D})})]}),e.jsxs("section",{style:{...$,paddingBottom:72},children:[e.jsx("h2",{style:{...T,fontSize:27},children:"How the data is collected"}),e.jsxs("div",{style:{display:"grid",gap:24,maxWidth:680},children:[e.jsxs("div",{children:[e.jsx("div",{style:M,children:"Code Availability"}),e.jsx("p",{style:N,children:"For every open-access machine learning paper, we check whether an official code implementation is linked on GitHub. The date axis is the paper's publication date."})]}),e.jsxs("div",{children:[e.jsx("div",{style:M,children:"Hugging Face artifacts"}),e.jsx("p",{style:N,children:"We resolve links between papers and the Hugging Face Hub, counting a paper as covered when it references at least one model, dataset or Space. The date axis is the paper's publication date."})]}),e.jsx("p",{style:{fontFamily:"var(--mono)",fontSize:12,lineHeight:1.6,color:"var(--ink-faint)",margin:"8px 0 0",letterSpacing:"0.02em"},children:"Figures use complete publication months. Historical Hugging Face coverage reflects artifacts currently linked in the catalog."})]})]})]})};export{ne as default};
 
1
+ import{b as X,R as G,j as e}from"./index-Bo5_2OqZ.js";import{u as J}from"./useQuery-Bh9FZQpL.js";import{A as q,a as E}from"./alert-_EYQlDHA.js";import{S as P}from"./skeleton-CB-heJjl.js";import"./useBaseQuery-B8T7kRNC.js";const m=t=>{const i=/^(\d{4})-(0[1-9]|1[0-2])$/.exec(t);if(!i)return t;const[,r,l]=i;return`${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][Number(l)-1]} '${r.slice(2)}`},Q=()=>X.getResearchTrends(),f=980,j=400,x=62,R=26,g=30,V=58,u=f-x-R,F=j-g-V,v=g+F,Y=t=>{if(t.length<3)return t.map((r,l)=>`${l?"L":"M"}${r[0]} ${r[1]}`).join(" ");let i=`M${t[0][0]} ${t[0][1]}`;for(let r=0;r<t.length-1;r+=1){const l=t[r-1]??t[r],c=t[r],o=t[r+1],a=t[r+2]??o,y=c[0]+(o[0]-l[0])/6,s=c[1]+(o[1]-l[1])/6,b=o[0]-(a[0]-c[0])/6,d=o[1]-(a[1]-c[1])/6;i+=` C ${y} ${s} ${b} ${d} ${o[0]} ${o[1]}`}return i},W={fontFamily:"var(--mono)",fontSize:12,fill:"var(--ink-faint)"},z={fontFamily:"var(--mono)",fontSize:11,fontWeight:600,letterSpacing:"0.14em",fill:"var(--ink-faint)",textTransform:"uppercase"},C=({id:t,data:i,color:r,yTicks:l,yLabel:c,xLabel:o})=>{const[a,y]=G.useState(null),s=i.length,b=l[l.length-1],d=n=>x+u*(s===1?0:n/(s-1)),p=n=>g+F*(1-n/b);if(s===0)return null;const B=i.map((n,h)=>[d(h),p(n.percent)]),A=Y(B),_=`${A} L ${d(s-1)} ${v} L ${x} ${v} Z`,w=s<=12?1:Math.ceil(s/8),O=n=>{const h=n.currentTarget.getBoundingClientRect(),S=(n.clientX-h.left)/h.width*f,k=s>1?u/(s-1):u,I=Math.max(0,Math.min(s-1,Math.round((S-x)/k)));y(I)},H=`trend-gradient-${t}`;return e.jsxs("figure",{className:"trend-chart",children:[e.jsxs("div",{className:"trend-chart-visual",children:[e.jsxs("svg",{viewBox:`0 0 ${f} ${j}`,width:"100%",role:"img","aria-label":`${c} by ${o.toLowerCase()}, from ${m(i[0].month)} (${i[0].percent}%) to ${m(i[s-1].month)} (${i[s-1].percent}%)`,style:{display:"block",overflow:"visible",cursor:"crosshair"},onPointerMove:O,onPointerLeave:()=>y(null),children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:H,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",style:{stopColor:r,stopOpacity:.26}}),e.jsx("stop",{offset:"100%",style:{stopColor:r,stopOpacity:.02}})]})}),l.map(n=>e.jsxs("g",{children:[e.jsx("line",{x1:x,x2:f-R,y1:p(n),y2:p(n),stroke:"var(--hairline)",strokeWidth:1}),e.jsxs("text",{x:x-14,y:p(n)+4,textAnchor:"end",style:W,children:[n,"%"]})]},n)),e.jsx("path",{d:_,fill:`url(#${H})`}),e.jsx("path",{d:A,fill:"none",stroke:r,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round"}),i.map((n,h)=>{const S=h===s-1,k=h%w===0&&s-1-h>=w/2;return!S&&!k?null:e.jsx("text",{x:d(h),y:v+24,textAnchor:"middle",style:W,children:m(n.month)},n.month)}),e.jsx("text",{x:x+u/2,y:j-4,textAnchor:"middle",style:z,children:o}),e.jsx("text",{transform:`translate(16 ${g+F/2}) rotate(-90)`,textAnchor:"middle",style:z,children:c}),a!=null&&e.jsxs(e.Fragment,{children:[e.jsx("line",{x1:d(a),x2:d(a),y1:g,y2:v,stroke:r,strokeWidth:1,strokeDasharray:"3 4",opacity:.5}),e.jsx("circle",{cx:d(a),cy:p(i[a].percent),r:5,fill:"var(--bg)",stroke:r,strokeWidth:2})]})]}),a!=null&&e.jsxs("div",{style:{position:"absolute",left:`${d(a)/f*100}%`,top:`${p(i[a].percent)/j*100}%`,transform:"translate(-50%, calc(-100% - 14px))",background:"var(--bg-elevated)",border:"1px solid var(--hairline)",borderRadius:6,boxShadow:"0 8px 26px rgba(0,0,0,.13)",padding:"7px 12px",pointerEvents:"none",whiteSpace:"nowrap",zIndex:3},children:[e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",color:"var(--ink-faint)",fontSize:13,marginBottom:2},children:m(i[a].month)}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:7,fontFamily:"var(--mono)",fontWeight:600,fontSize:15,color:"var(--ink)"},children:[e.jsx("span",{style:{width:8,height:8,borderRadius:2,background:r,display:"inline-block"}}),i[a].percent,"%"]})]})]}),e.jsxs("details",{className:"trend-chart-table",children:[e.jsx("summary",{style:{fontFamily:"var(--mono)",fontSize:11,letterSpacing:"0.04em",color:"var(--ink-faint)",cursor:"pointer"},children:"View data table"}),e.jsxs("table",{style:{marginTop:8,borderCollapse:"collapse",fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{style:{textAlign:"left",padding:"3px 18px 3px 0"},children:o}),e.jsx("th",{style:{textAlign:"right",padding:"3px 0"},children:c})]})}),e.jsx("tbody",{children:i.map(n=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 18px 2px 0"},children:m(n.month)}),e.jsxs("td",{style:{textAlign:"right",padding:"2px 0"},children:[n.percent,"%"]})]},n.month))})]})]})]})},$={maxWidth:960,padding:"48px 0 8px",borderTop:"1px solid var(--hairline)",marginTop:48},T={fontFamily:"var(--serif)",fontSize:34,fontWeight:500,letterSpacing:"-0.02em",margin:"0 0 10px",color:"var(--ink)"},L={fontFamily:"var(--serif)",fontSize:18,lineHeight:1.55,color:"var(--ink-soft)",maxWidth:620,margin:"0 0 8px"},M={fontFamily:"var(--mono)",fontSize:12,fontWeight:600,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--ink-faint)",marginBottom:8},N={fontFamily:"var(--serif)",fontSize:17,lineHeight:1.6,color:"var(--ink-soft)",margin:0},D={height:320,marginTop:26},ne=()=>{const t=J({queryKey:["research-trends"],queryFn:Q,staleTime:36e5});return e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Research ",e.jsx("em",{children:"Trends"})]}),e.jsx("div",{className:"feed-subtitle",children:"How open science is changing across machine learning — tracked over time from arXiv and the Hugging Face Hub."})]})}),t.error&&e.jsx(q,{variant:"destructive",children:e.jsx(E,{children:"Failed to load research trends. Please try again."})}),e.jsxs("section",{style:$,children:[e.jsx("h2",{style:T,children:"Code Availability"}),e.jsx("p",{style:L,children:"The percentage of published papers that have at least one official code implementation on GitHub."}),e.jsx("div",{style:{marginTop:26},children:t.data?e.jsx(C,{id:"code",data:t.data.code_availability,color:"var(--trend-code)",yTicks:[0,20,40,60,80],yLabel:"Code Availability",xLabel:"Paper Publication Date"}):!t.error&&e.jsx(P,{style:D})})]}),e.jsxs("section",{style:$,children:[e.jsx("h2",{style:T,children:"Papers with Hugging Face artifacts"}),e.jsx("p",{style:L,children:"The percentage of published papers linked to at least one Hugging Face artifact — a model, dataset or Space — making the work directly runnable and reusable."}),e.jsx("div",{style:{marginTop:26},children:t.data?e.jsx(C,{id:"hf",data:t.data.hf_artifacts,color:"var(--trend-hf)",yTicks:[0,10,20,30,40,50],yLabel:"HF Artifact Coverage",xLabel:"Paper Publication Date"}):!t.error&&e.jsx(P,{style:D})})]}),e.jsxs("section",{style:{...$,paddingBottom:72},children:[e.jsx("h2",{style:{...T,fontSize:27},children:"How the data is collected"}),e.jsxs("div",{style:{display:"grid",gap:24,maxWidth:680},children:[e.jsxs("div",{children:[e.jsx("div",{style:M,children:"Code Availability"}),e.jsx("p",{style:N,children:"For every open-access machine learning paper, we check whether an official code implementation is linked on GitHub. The date axis is the paper's publication date."})]}),e.jsxs("div",{children:[e.jsx("div",{style:M,children:"Hugging Face artifacts"}),e.jsx("p",{style:N,children:"We resolve links between papers and the Hugging Face Hub, counting a paper as covered when it references at least one model, dataset or Space. The date axis is the paper's publication date."})]}),e.jsx("p",{style:{fontFamily:"var(--mono)",fontSize:12,lineHeight:1.6,color:"var(--ink-faint)",margin:"8px 0 0",letterSpacing:"0.02em"},children:"Figures use complete publication months. Historical Hugging Face coverage reflects artifacts currently linked in the catalog."})]})]})]})};export{ne as default};
assets/{alert-axJAQJuC.js → alert-_EYQlDHA.js} RENAMED
@@ -1 +1 @@
1
- import{r as a,j as s,t as l,a6 as i}from"./index-CIXevVP9.js";const o=i("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),n=a.forwardRef(({className:t,variant:e,...r},d)=>s.jsx("div",{ref:d,role:"alert",className:l(o({variant:e}),t),...r}));n.displayName="Alert";const v=a.forwardRef(({className:t,...e},r)=>s.jsx("h5",{ref:r,className:l("mb-1 font-medium leading-none tracking-tight",t),...e}));v.displayName="AlertTitle";const c=a.forwardRef(({className:t,...e},r)=>s.jsx("div",{ref:r,className:l("text-sm [&_p]:leading-relaxed",t),...e}));c.displayName="AlertDescription";export{n as A,c as a};
 
1
+ import{r as a,j as s,v as l,a6 as i}from"./index-Bo5_2OqZ.js";const o=i("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),n=a.forwardRef(({className:e,variant:t,...r},d)=>s.jsx("div",{ref:d,role:"alert",className:l(o({variant:t}),e),...r}));n.displayName="Alert";const v=a.forwardRef(({className:e,...t},r)=>s.jsx("h5",{ref:r,className:l("mb-1 font-medium leading-none tracking-tight",e),...t}));v.displayName="AlertTitle";const c=a.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:l("text-sm [&_p]:leading-relaxed",e),...t}));c.displayName="AlertDescription";export{n as A,c as a};
assets/{button-5O6wnTvY.js → button-D8mDpZUh.js} RENAMED
@@ -1 +1 @@
1
- import{r as a,j as d,aK as u,t as c,a6 as f}from"./index-CIXevVP9.js";const g=f("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),v=a.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...o},s)=>{const i=n?u:"button";return d.jsx(i,{className:c(g({variant:t,size:r,className:e})),ref:s,...o})});v.displayName="Button";export{v as B};
 
1
+ import{r as a,j as d,aL as u,v as c,a6 as f}from"./index-Bo5_2OqZ.js";const g=f("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),v=a.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...o},s)=>{const i=n?u:"button";return d.jsx(i,{className:c(g({variant:t,size:r,className:e})),ref:s,...o})});v.displayName="Button";export{v as B};
assets/chatSessions-BnXlq2-W.js DELETED
@@ -1 +0,0 @@
1
- import{j as o,d as f}from"./index-CIXevVP9.js";const w=({light:s})=>o.jsx("span",{className:`chat-spinner${s?" chat-spinner-light":""}`}),S=({open:s})=>o.jsx("svg",{className:`chat-chev${s?" chat-chev-open":""}`,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{d:"m6 9 6 6 6-6"})}),_=()=>o.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[o.jsx("circle",{cx:"12",cy:"12",r:"9"}),o.jsx("path",{d:"m9 12 2 2 4-4"})]}),y=({size:s=14})=>o.jsxs("svg",{width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[o.jsx("circle",{cx:"11",cy:"11",r:"7"}),o.jsx("path",{d:"m21 21-4.3-4.3"})]}),j=()=>o.jsx("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",children:o.jsx("path",{d:"M12 19V5M5 12l7-7 7 7"})}),C=()=>o.jsx("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{d:"M12 5v14M5 12h14"})}),T=()=>o.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[o.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),o.jsx("path",{d:"M9 4v16"})]}),b=()=>o.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{d:"M3 6h18M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2M6 6l1 14a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-14"})}),k=({models:s,selectedModel:t,onModelChange:e,disabled:r})=>{var u;const n=((u=s.find(a=>a.id===t))==null?void 0:u.label)??`${t} (unavailable)`,i=Math.min(Math.max(n.length+5,12),32);return o.jsxs("select",{className:"chat-model-select",style:{width:`${i}ch`},value:t,disabled:r,onChange:a=>e(a.target.value),"aria-label":"Research model",children:[!s.some(a=>a.id===t)&&o.jsx("option",{value:t,disabled:!0,children:n}),s.map(a=>o.jsx("option",{value:a.id,children:a.label},a.id))]})},p="pwc:chat-oauth-draft",l="pwc:chat-oauth-model",h="pwc:chat-oauth-auto-send";function I(s,t,e={}){const r=s.trim();r&&(sessionStorage.setItem(p,r),e.autoSend===!1?sessionStorage.removeItem(h):sessionStorage.setItem(h,"1"),t?sessionStorage.setItem(l,t):sessionStorage.removeItem(l))}function M(){var t;if(typeof window>"u"||sessionStorage.getItem(h)!=="1")return null;const s=(t=sessionStorage.getItem(p))==null?void 0:t.trim();return s?{prompt:s,model:sessionStorage.getItem(l)}:null}function D(){sessionStorage.removeItem(p),sessionStorage.removeItem(l),sessionStorage.removeItem(h)}const v="google/gemma-4-31B-it",E=[{id:v,label:"Gemma 4 31B",provider:"huggingface"},{id:"zai-org/GLM-5.2",label:"GLM 5.2",provider:"huggingface"},{id:"moonshotai/Kimi-K3",label:"Kimi K3",provider:"huggingface"},{id:"deepseek-ai/DeepSeek-V4-Flash-0731",label:"DeepSeek V4 Flash 0731",provider:"openrouter"}];async function c(s,t){const e=await fetch(f(s),{credentials:"include",headers:{"Content-Type":"application/json",...t==null?void 0:t.headers},...t});if(!e.ok){const r=await e.json().catch(()=>null),n=r==null?void 0:r.detail;throw new Error((n==null?void 0:n.message)||n||`Chat request failed (${e.status})`)}return e.status===204?void 0:e.json()}class g extends Error{constructor(t,e){super(t),this.status=e}}async function m(s){const t=await fetch(f(s),{headers:{Accept:"application/json"}});if(!t.ok){const e=await t.json().catch(()=>null),r=e==null?void 0:e.detail;throw new g((r==null?void 0:r.message)||r||`Shared conversation request failed (${t.status})`,t.status)}return t.json()}async function $(){const s=[];let t=null;do{const e=new URLSearchParams({limit:"50"});t&&e.set("cursor",t);const r=await c(`/api/v1/chat/sessions?${e.toString()}`);s.push(...r.items),t=r.next_cursor}while(t&&s.length<100);return s}function A(s){return c(`/api/v1/chat/sessions/${s}`)}function L(s,t){return c(`/api/v1/chat/sessions/${s}`,{method:"PATCH",body:JSON.stringify(t)})}function q(s){return c(`/api/v1/chat/sessions/${s}`,{method:"DELETE"})}function O(){return c("/api/v1/chat/sessions/archive-old",{method:"POST"})}function P(s){return c(`/api/v1/chat/sessions/${s}/cancel`,{method:"POST"})}function R(s){return c(`/api/v1/chat/sessions/${s}/share`,{method:"POST"})}function B(s){return m(`/api/v1/chat/shares/${encodeURIComponent(s)}`)}async function H(){return c("/api/v1/chat/models")}function d(s,t){const e=s.map(r=>r.kind==="reasoning"?{...r,active:!1,open:!1}:r.kind==="tool"?{...r,status:r.status==="running"?"error":r.status,open:t&&(r.status==="error"||r.status==="denied"||r.status==="running")}:{...r,done:!0});return e.filter((r,n)=>{const i=e[n-1];return!(r.kind==="reasoning"&&(i==null?void 0:i.kind)==="reasoning"&&r.text===i.text)})}function F(s){const t=e=>e==="hf_inference_billing_exhausted"?"Hugging Face could not bill this request. Your included credits may be exhausted; enable or review pay-as-you-go billing in Settings.":e==="hf_inference_credential_expired"?"Your Hugging Face authorization expired. Reconnect in Settings.":e==="provider_rate_limit"?"The selected model is temporarily rate-limited. Try again shortly.":e==="provider_timeout"?"The model provider timed out. Try again shortly.":["provider_error","provider_unavailable"].includes(e??"")?"The model provider failed before completing the response. You can edit and retry your question.":e==="persistence_error"?"The response could not be saved. You can edit and retry your question.":e==="transcript_mirror_error"?"The conversation could not be saved. Please try again in a new chat.":"The response did not complete. You can edit and retry your question.";return s.messages.flatMap(e=>{if(e.role==="assistant")return[{id:e.id,role:"assistant",blocks:d(e.display_blocks,!0),followups:e.followups,citations:e.citations,finishReason:e.finish_reason??void 0,streaming:!1}];const r={id:e.id,role:"user",text:e.content,revision:e.revision,status:e.status,error:e.status==="complete"?void 0:e.error_code||e.status};if(!["error","interrupted"].includes(e.status))return[r];const n=e.status==="interrupted";return[r,{id:`${e.id}-${n?"interrupted":"error"}`,role:"assistant",blocks:d(e.display_blocks,!0),streaming:!1,finishReason:n?"stopped":void 0,error:n?void 0:t(e.error_code),errorCode:n?void 0:e.error_code??void 0}]})}function K(s){return s.messages.map(t=>t.role==="user"?{id:t.id,role:"user",text:t.content}:{id:t.id,role:"assistant",blocks:d(t.display_blocks,!1),citations:t.citations,finishReason:t.finish_reason??void 0,error:t.error??void 0,streaming:!1})}function U(s){const t=Date.now(),e=new Date().setHours(0,0,0,0),r=[{label:"Today",items:[]},{label:"Previous 7 Days",items:[]},{label:"Previous 30 Days",items:[]},{label:"Older",items:[]}];for(const n of[...s].sort((i,u)=>Date.parse(u.updated_at)-Date.parse(i.updated_at))){const i=Date.parse(n.updated_at),u=t-i;i>=e?r[0].items.push(n):u<7*864e5?r[1].items.push(n):u<30*864e5?r[2].items.push(n):r[3].items.push(n)}return r.filter(n=>n.items.length>0)}export{j as A,p as C,v as D,E as F,k as M,C as P,w as S,b as T,l as a,h as b,P as c,D as d,H as e,T as f,A as g,U as h,q as i,R as j,O as k,$ as l,g as m,B as n,_ as o,K as p,I as q,M as r,S as s,F as t,L as u,y as v};
 
 
assets/chatSessions-Dz4Iu-O1.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{j as o,d as f}from"./index-Bo5_2OqZ.js";const _=({light:r})=>o.jsx("span",{className:`chat-spinner${r?" chat-spinner-light":""}`}),w=({open:r})=>o.jsx("svg",{className:`chat-chev${r?" chat-chev-open":""}`,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{d:"m6 9 6 6 6-6"})}),x=()=>o.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[o.jsx("circle",{cx:"12",cy:"12",r:"9"}),o.jsx("path",{d:"m9 12 2 2 4-4"})]}),S=({size:r=14})=>o.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[o.jsx("circle",{cx:"11",cy:"11",r:"7"}),o.jsx("path",{d:"m21 21-4.3-4.3"})]}),b=()=>o.jsx("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",children:o.jsx("path",{d:"M12 19V5M5 12l7-7 7 7"})}),k=()=>o.jsx("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{d:"M12 5v14M5 12h14"})}),C=()=>o.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[o.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),o.jsx("path",{d:"M9 4v16"})]}),j=()=>o.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{d:"M3 6h18M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2M6 6l1 14a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-14"})}),T=({models:r,selectedModel:t,onModelChange:e,disabled:s})=>{var c;const n=((c=r.find(a=>a.id===t))==null?void 0:c.label)??`${t} (unavailable)`,i=Math.min(Math.max(n.length+5,12),32);return o.jsxs("select",{className:"chat-model-select",style:{width:`${i}ch`},value:t,disabled:s,onChange:a=>e(a.target.value),"aria-label":"Research model",children:[!r.some(a=>a.id===t)&&o.jsx("option",{value:t,disabled:!0,children:n}),r.map(a=>o.jsx("option",{value:a.id,children:a.label},a.id))]})},p="pwc:chat-oauth-draft",l="pwc:chat-oauth-model",h="pwc:chat-oauth-auto-send";function I(r,t,e={}){const s=r.trim();s&&(sessionStorage.setItem(p,s),e.autoSend===!1?sessionStorage.removeItem(h):sessionStorage.setItem(h,"1"),t?sessionStorage.setItem(l,t):sessionStorage.removeItem(l))}function R(){var t;if(typeof window>"u"||sessionStorage.getItem(h)!=="1")return null;const r=(t=sessionStorage.getItem(p))==null?void 0:t.trim();return r?{prompt:r,model:sessionStorage.getItem(l)}:null}function M(){sessionStorage.removeItem(p),sessionStorage.removeItem(l),sessionStorage.removeItem(h)}const v="google/gemma-4-31B-it",O=[{id:v,label:"Gemma 4 31B",provider:"huggingface"},{id:"zai-org/GLM-5.2",label:"GLM 5.2",provider:"huggingface"},{id:"moonshotai/Kimi-K3",label:"Kimi K3",provider:"huggingface"},{id:"deepseek-ai/DeepSeek-V4-Flash-0731",label:"DeepSeek V4 Flash 0731",provider:"openrouter"}];async function u(r,t){const e=await fetch(f(r),{credentials:"include",headers:{"Content-Type":"application/json",...t==null?void 0:t.headers},...t});if(!e.ok){const s=await e.json().catch(()=>null),n=s==null?void 0:s.detail;throw new Error((n==null?void 0:n.message)||n||`Chat request failed (${e.status})`)}return e.status===204?void 0:e.json()}class g extends Error{constructor(t,e){super(t),this.status=e}}async function m(r){const t=await fetch(f(r),{headers:{Accept:"application/json"}});if(!t.ok){const e=await t.json().catch(()=>null),s=e==null?void 0:e.detail;throw new g((s==null?void 0:s.message)||s||`Shared conversation request failed (${t.status})`,t.status)}return t.json()}async function A(){const r=[];let t=null;do{const e=new URLSearchParams({limit:"50"});t&&e.set("cursor",t);const s=await u(`/api/v1/chat/sessions?${e.toString()}`);r.push(...s.items),t=s.next_cursor}while(t&&r.length<100);return r}function D(r){return u(`/api/v1/chat/sessions/${r}`)}function P(r,t){return u(`/api/v1/chat/sessions/${r}`,{method:"PATCH",body:JSON.stringify(t)})}function E(r){return u(`/api/v1/chat/sessions/${r}`,{method:"DELETE"})}function $(){return u("/api/v1/chat/sessions/archive-old",{method:"POST"})}function L(r){return u(`/api/v1/chat/sessions/${r}/cancel`,{method:"POST"})}function q(r){return u(`/api/v1/chat/sessions/${r}/share`,{method:"POST"})}function B(r){return m(`/api/v1/chat/shares/${encodeURIComponent(r)}`)}async function Y(){return u("/api/v1/chat/models")}function d(r,t){const e=r.map(s=>s.kind==="reasoning"?{...s,active:!1,open:!1}:s.kind==="tool"?{...s,status:s.status==="running"?"error":s.status,open:t&&(s.status==="error"||s.status==="denied"||s.status==="running")}:{...s,done:!0});return e.filter((s,n)=>{const i=e[n-1];return!(s.kind==="reasoning"&&(i==null?void 0:i.kind)==="reasoning"&&s.text===i.text)})}function H(r){const t=e=>e==="hf_inference_billing_exhausted"?"Hugging Face could not bill this request. Your included credits may be exhausted; enable or review pay-as-you-go billing in Settings.":e==="hf_inference_credential_expired"?"Your Hugging Face authorization expired. Reconnect in Settings.":e==="provider_rate_limit"?"The selected model is temporarily rate-limited. Try again shortly.":e==="provider_timeout"?"The model provider timed out. Try again shortly.":e==="openrouter_monthly_budget_exhausted"?"You have used this month's Papers With Code OpenRouter allowance. Review the reset time or enable your own key in Settings.":e==="openrouter_unavailable"?"OpenRouter is currently unavailable. However, you can still bring your own key in Settings.":e==="openrouter_byok_credential_invalid"?"Your OpenRouter API key is no longer valid. Reconnect it in Settings, then try again.":e==="openrouter_byok_billing_error"?"OpenRouter could not bill your API key. Review your OpenRouter credits and spending limits.":e==="openrouter_byok_rate_limit"?"Your OpenRouter API key is temporarily rate-limited.":["provider_error","provider_unavailable"].includes(e??"")?"The model provider failed before completing the response. You can edit and retry your question.":e==="persistence_error"?"The response could not be saved. You can edit and retry your question.":e==="transcript_mirror_error"?"The conversation could not be saved. Please try again in a new chat.":"The response did not complete. You can edit and retry your question.";return r.messages.flatMap(e=>{if(e.role==="assistant")return[{id:e.id,role:"assistant",blocks:d(e.display_blocks,!0),followups:e.followups,citations:e.citations,finishReason:e.finish_reason??void 0,streaming:!1}];const s={id:e.id,role:"user",text:e.content,revision:e.revision,status:e.status,error:e.status==="complete"?void 0:e.error_code||e.status};if(!["error","interrupted"].includes(e.status))return[s];const n=e.status==="interrupted";return[s,{id:`${e.id}-${n?"interrupted":"error"}`,role:"assistant",blocks:d(e.display_blocks,!0),streaming:!1,finishReason:n?"stopped":void 0,error:n?void 0:t(e.error_code),errorCode:n?void 0:e.error_code??void 0}]})}function F(r){return r.messages.map(t=>t.role==="user"?{id:t.id,role:"user",text:t.content}:{id:t.id,role:"assistant",blocks:d(t.display_blocks,!1),citations:t.citations,finishReason:t.finish_reason??void 0,error:t.error??void 0,streaming:!1})}function K(r){const t=Date.now(),e=new Date().setHours(0,0,0,0),s=[{label:"Today",items:[]},{label:"Previous 7 Days",items:[]},{label:"Previous 30 Days",items:[]},{label:"Older",items:[]}];for(const n of[...r].sort((i,c)=>Date.parse(c.updated_at)-Date.parse(i.updated_at))){const i=Date.parse(n.updated_at),c=t-i;i>=e?s[0].items.push(n):c<7*864e5?s[1].items.push(n):c<30*864e5?s[2].items.push(n):s[3].items.push(n)}return s.filter(n=>n.items.length>0)}export{b as A,p as C,v as D,O as F,T as M,k as P,_ as S,j as T,l as a,h as b,L as c,M as d,Y as e,C as f,D as g,K as h,E as i,q as j,$ as k,A as l,g as m,B as n,x as o,F as p,I as q,R as r,w as s,H as t,P as u,S as v};
assets/{chevron-down-BLGtaYwg.js → chevron-down-BeEEYUNO.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{c as o}from"./index-CIXevVP9.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{c as o}from"./index-Bo5_2OqZ.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{codexAddEvals-DqxQQWJl.js → codexAddEvals-NAKdH-Ge.js} RENAMED
@@ -1,6 +1,6 @@
1
- import{c as o,j as i,t as c,a6 as d,d as n}from"./index-CIXevVP9.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const p=o("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]),u=d("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function f({className:e,variant:a,...t}){return i.jsx("div",{className:c(u({variant:a}),e),...t})}function x(){const e="0".toLowerCase();return e==="1"||e==="true"||e==="yes"}function b(){const e="0".toLowerCase();return e==="1"||e==="true"||e==="yes"}async function r(e){var s;if(e.ok)return await e.json();const a=await e.json().catch(()=>null),t=((s=a==null?void 0:a.detail)==null?void 0:s.message)??(a==null?void 0:a.detail);throw new Error(typeof t=="string"?t:"Could not run Codex.")}async function h(e){const a=await fetch(n("/api/v1/admin/codex-add-evals/jobs"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({paper_id:e})});return r(a)}async function v(e){const a=await fetch(n(`/api/v1/admin/codex-add-evals/jobs/${e}`),{credentials:"include"});return r(a)}async function g(e){return r(await fetch(n(`/api/v1/admin/codex-add-evals/jobs/${e}`),{method:"DELETE",credentials:"include"}))}async function y(e){const a=await fetch(n("/api/v1/admin/codex-enrich-paper/jobs"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({paper_id:e})});return r(a)}async function m(e){const a=await fetch(n(`/api/v1/admin/codex-enrich-paper/jobs/${e}`),{credentials:"include"});return r(a)}async function E(e){return r(await fetch(n(`/api/v1/admin/codex-enrich-paper/jobs/${e}`),{method:"DELETE",credentials:"include"}))}async function w(e=100){const a=await fetch(n(`/api/v1/admin/codex-curation/jobs?limit=${e}`),{credentials:"include",cache:"no-store"});if(a.ok)return await a.json();const t=new Error(`Could not load Codex jobs (${a.status}).`);throw Object.assign(t,{status:a.status}),t}export{f as B,p as D,g as a,v as b,E as c,h as d,x as e,w as f,m as g,b as i,y as s};
 
1
+ import{c as o,j as i,v as c,a6 as d,d as n}from"./index-Bo5_2OqZ.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
5
  * See the LICENSE file in the root directory of this source tree.
6
+ */const p=o("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]),u=d("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function f({className:e,variant:a,...t}){return i.jsx("div",{className:c(u({variant:a}),e),...t})}function x(){const e="0".toLowerCase();return e==="1"||e==="true"||e==="yes"}function b(){const e="0".toLowerCase();return e==="1"||e==="true"||e==="yes"}async function r(e){var s;if(e.ok)return await e.json();const a=await e.json().catch(()=>null),t=((s=a==null?void 0:a.detail)==null?void 0:s.message)??(a==null?void 0:a.detail);throw new Error(typeof t=="string"?t:"Could not run Codex.")}async function v(e){const a=await fetch(n("/api/v1/admin/codex-add-evals/jobs"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({paper_id:e})});return r(a)}async function h(e){const a=await fetch(n(`/api/v1/admin/codex-add-evals/jobs/${e}`),{credentials:"include"});return r(a)}async function g(e){return r(await fetch(n(`/api/v1/admin/codex-add-evals/jobs/${e}`),{method:"DELETE",credentials:"include"}))}async function y(e){const a=await fetch(n("/api/v1/admin/codex-enrich-paper/jobs"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({paper_id:e})});return r(a)}async function m(e){const a=await fetch(n(`/api/v1/admin/codex-enrich-paper/jobs/${e}`),{credentials:"include"});return r(a)}async function E(e){return r(await fetch(n(`/api/v1/admin/codex-enrich-paper/jobs/${e}`),{method:"DELETE",credentials:"include"}))}async function w(e=100){const a=await fetch(n(`/api/v1/admin/codex-curation/jobs?limit=${e}`),{credentials:"include",cache:"no-store"});if(a.ok)return await a.json();const t=new Error(`Could not load Codex jobs (${a.status}).`);throw Object.assign(t,{status:a.status}),t}export{f as B,p as D,g as a,h as b,E as c,v as d,x as e,w as f,m as g,b as i,y as s};
assets/{components-BkZsumbI.js → components-BbXgE2lV.js} RENAMED
@@ -1 +1 @@
1
- import{v as R,R as g,b as T,j as e,L,u as w}from"./index-CIXevVP9.js";import{L as E,a as z}from"./LatexTitle-BmUg2c3G.js";import{h as P,d as Z,f as B,e as H}from"./transform-CNyzjv1G.js";const D=({slug:t,label:s,onClick:r})=>{const l=w(),x=P(t),o=H(x),h=i=>{if(i.stopPropagation(),r){r(t);return}l(`/tasks/${t}`)};return e.jsxs("span",{className:"tag-chip",style:{background:o.bg,color:o.text},onClick:h,children:[e.jsx("span",{className:"dot",style:{background:o.dot}}),Z(s||B(t),t)]})},G=({method:t,onClick:s})=>{const r=w(),l=t.slug||t.id||"";if(!l)return null;const x=o=>{if(o.stopPropagation(),s){s(l);return}r(`/methods/${l}`)};return e.jsx("span",{className:"method-chip",onClick:x,children:t.name})},N={1:"SOTA 🏆",2:"#2",3:"#3"},F=({units:t,paperHref:s})=>{const r=g.useRef(null),l=g.useRef(null),[x,o]=g.useState(t.length);if(g.useLayoutEffect(()=>{const n=r.current,a=l.current;if(!n||!a||t.length===0)return;const m=f=>(a.textContent=f,a.scrollWidth),M=()=>{const f=n.clientWidth;if(f<=0)return;let c=0,d=0;for(const C of t){const p=m(C.measureText);if(c+p<=f)c+=p,d+=1;else break}if(d<t.length){for(;d>0&&c+m(` · +${t.length-d} more`)>f;)d-=1,c-=m(t[d].measureText);d===0&&(d=1)}o(d)};M();const u=new ResizeObserver(M);return u.observe(n),()=>u.disconnect()},[t]),t.length===0)return null;const h=t.slice(0,Math.max(1,Math.min(x,t.length))),i=t.length-h.length;return e.jsxs("div",{className:"paper-sota",ref:r,children:[e.jsx("span",{ref:l,className:"paper-sota-measure","aria-hidden":"true"}),h.map((n,a)=>e.jsxs(g.Fragment,{children:[n.isGroupStart?e.jsxs(e.Fragment,{children:[a>0&&e.jsx("span",{className:"paper-sota-sep",children:" · "}),e.jsx("span",{className:`paper-sota-label${n.rank===1?" paper-sota-label--sota":""}`,children:N[n.rank]}),e.jsx("span",{className:"paper-sota-on",children:" on "})]}):e.jsx("span",{className:"paper-sota-sep",children:", "}),n.slug?e.jsx(L,{to:`/benchmark/${n.slug}`,className:"paper-sota-name",onClick:m=>m.stopPropagation(),children:n.name}):e.jsx("span",{className:"paper-sota-name",children:n.name})]},`${n.slug||n.name}-${a}`)),i>0&&e.jsxs(L,{to:`${s}#results`,className:"paper-sota-more",onClick:n=>n.stopPropagation(),children:[" · +",i," more"]})]})},I=({ranks:t,paperHref:s,wrap:r=!1})=>{const l=g.useMemo(()=>{const o=[];let h=!0;for(const i of[1,2,3]){const n=t.filter(a=>a.rank===i);n.forEach((a,m)=>{const M=m===0,u=M?`${h?"":" · "}${N[i]} on `:", ";o.push({name:a.name,slug:a.slug,rank:i,isGroupStart:M,measureText:u+a.name})}),n.length>0&&(h=!1)}return o},[t]),x=g.useMemo(()=>[1,2,3].map(o=>t.filter(i=>i.rank===o).map((i,n)=>({name:i.name,slug:i.slug,rank:o,isGroupStart:n===0,measureText:(n===0?`${N[o]} on `:", ")+i.name}))).filter(o=>o.length>0),[t]);return r?x.length===0?null:e.jsx("div",{className:"paper-sota-stack",children:x.map(o=>e.jsx(F,{units:o,paperHref:s},o[0].rank))}):l.length===0?null:e.jsx(F,{units:l,paperHref:s})},O=({name:t,size:s=14})=>{const r={search:e.jsx("path",{d:"M11 11l3 3M7 12.5a5.5 5.5 0 110-11 5.5 5.5 0 010 11z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),arrowUp:e.jsx("path",{d:"M8 3l5 6H3l5-6z",fill:"currentColor"}),arrowLeft:e.jsx("path",{d:"M9 3l-4 5 4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),arrowRight:e.jsx("path",{d:"M7 3l4 5-4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),external:e.jsx("path",{d:"M5 3h-2v8h8v-2M9 3h3v3M7 9l5-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),github:e.jsx("path",{d:"M8 1a7 7 0 00-2.21 13.64c.35.06.48-.15.48-.34v-1.2c-1.95.42-2.36-.94-2.36-.94-.32-.81-.78-1.03-.78-1.03-.64-.43.05-.43.05-.43.7.05 1.07.72 1.07.72.62 1.07 1.64.76 2.04.58.06-.45.24-.76.44-.94-1.55-.18-3.18-.78-3.18-3.46 0-.76.27-1.39.72-1.88-.07-.18-.31-.89.07-1.86 0 0 .59-.19 1.92.72.56-.15 1.16-.23 1.75-.24.59 0 1.19.08 1.75.24 1.33-.9 1.92-.72 1.92-.72.38.97.14 1.68.07 1.86.45.49.72 1.12.72 1.88 0 2.69-1.64 3.28-3.19 3.45.25.22.48.65.48 1.32v1.95c0 .19.13.41.49.34A7 7 0 008 1z",fill:"currentColor"}),citation:e.jsx("path",{d:"M3 4h3v3H3zM4 7v1.5a1.5 1.5 0 01-1.5 1.5M9 4h3v3H9zM10 7v1.5a1.5 1.5 0 01-1.5 1.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none"}),bookmark:e.jsx("path",{d:"M4 2h8v12l-4-3-4 3V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),chart:e.jsx("path",{d:"M2 13h12M3 11l3-4 3 2 4-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),chat:e.jsx("path",{d:"M3 3h10v7H7l-3 3v-3H3V3z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),pdf:e.jsx("path",{d:"M5 2h5l3 3v9H5V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),copy:e.jsx("path",{d:"M5 5h7v8H5V5zM3 3h7v2M3 3v8h2",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinejoin:"round"}),sparkle:e.jsx("path",{d:"M8 2l1.2 3.8L13 7l-3.8 1.2L8 12l-1.2-3.8L3 7l3.8-1.2L8 2z",fill:"currentColor"}),user:e.jsx("path",{d:"M8 8a3 3 0 100-6 3 3 0 000 6zM2 14c0-3 2.5-5 6-5s6 2 6 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),globe:e.jsx("path",{d:"M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM1.5 8h13M8 1.5c1.7 1.9 2.6 4.2 2.6 6.5s-.9 4.6-2.6 6.5M8 1.5C6.3 3.4 5.4 5.7 5.4 8s.9 4.6 2.6 6.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinecap:"round"}),menu:e.jsx("path",{d:"M2 4h12M2 8h12M2 12h12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),close:e.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})};return e.jsx("svg",{className:s===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:s,height:s,children:r[t]})},U=({size:t=16})=>e.jsxs("svg",{className:"hf-logo",width:t,height:t,viewBox:"0 0 95 88",fill:"none","aria-hidden":"true",focusable:"false",children:[e.jsx("path",{fill:"#FFD21E",d:"M47.21 76.5a34.75 34.75 0 1 0 0-69.5 34.75 34.75 0 0 0 0 69.5Z"}),e.jsx("path",{fill:"#FF9D0B",d:"M81.96 41.75a34.75 34.75 0 1 0-69.5 0 34.75 34.75 0 0 0 69.5 0Zm-73.5 0a38.75 38.75 0 1 1 77.5 0 38.75 38.75 0 0 1-77.5 0Z"}),e.jsx("path",{fill:"#3A3B45",d:"M58.5 32.3c1.28.44 1.78 3.06 3.07 2.38a5 5 0 1 0-6.76-2.07c.61 1.15 2.55-.72 3.7-.32ZM34.95 32.3c-1.28.44-1.79 3.06-3.07 2.38a5 5 0 1 1 6.76-2.07c-.61 1.15-2.56-.72-3.7-.32Z"}),e.jsx("path",{fill:"#FF323D",d:"M46.96 56.29c9.83 0 13-8.76 13-13.26 0-2.34-1.57-1.6-4.09-.36-2.33 1.15-5.46 2.74-8.9 2.74-7.19 0-13-6.88-13-2.38s3.16 13.26 13 13.26Z"}),e.jsx("path",{fill:"#3A3B45",fillRule:"evenodd",clipRule:"evenodd",d:"M39.43 54a8.7 8.7 0 0 1 5.3-4.49c.4-.12.81.57 1.24 1.28.4.68.82 1.37 1.24 1.37.45 0 .9-.68 1.33-1.35.45-.7.89-1.38 1.32-1.25a8.61 8.61 0 0 1 5 4.17c3.73-2.94 5.1-7.74 5.1-10.7 0-2.34-1.57-1.6-4.09-.36l-.14.07c-2.31 1.15-5.39 2.67-8.77 2.67s-6.45-1.52-8.77-2.67c-2.6-1.29-4.23-2.1-4.23.29 0 3.05 1.46 8.06 5.47 10.97Z"}),e.jsx("path",{fill:"#FF9D0B",d:"M70.71 37a3.25 3.25 0 1 0 0-6.5 3.25 3.25 0 0 0 0 6.5ZM24.21 37a3.25 3.25 0 1 0 0-6.5 3.25 3.25 0 0 0 0 6.5ZM17.52 48c-1.62 0-3.06.66-4.07 1.87a5.97 5.97 0 0 0-1.33 3.76 7.1 7.1 0 0 0-1.94-.3c-1.55 0-2.95.59-3.94 1.66a5.8 5.8 0 0 0-.8 7 5.3 5.3 0 0 0-1.79 2.82c-.24.9-.48 2.8.8 4.74a5.22 5.22 0 0 0-.37 5.02c1.02 2.32 3.57 4.14 8.52 6.1 3.07 1.22 5.89 2 5.91 2.01a44.33 44.33 0 0 0 10.93 1.6c5.86 0 10.05-1.8 12.46-5.34 3.88-5.69 3.33-10.9-1.7-15.92-2.77-2.78-4.62-6.87-5-7.77-.78-2.66-2.84-5.62-6.25-5.62a5.7 5.7 0 0 0-4.6 2.46c-1-1.26-1.98-2.25-2.86-2.82A7.4 7.4 0 0 0 17.52 48Zm0 4c.51 0 1.14.22 1.82.65 2.14 1.36 6.25 8.43 7.76 11.18.5.92 1.37 1.31 2.14 1.31 1.55 0 2.75-1.53.15-3.48-3.92-2.93-2.55-7.72-.68-8.01.08-.02.17-.02.24-.02 1.7 0 2.45 2.93 2.45 2.93s2.2 5.52 5.98 9.3c3.77 3.77 3.97 6.8 1.22 10.83-1.88 2.75-5.47 3.58-9.16 3.58-3.81 0-7.73-.9-9.92-1.46-.11-.03-13.45-3.8-11.76-7 .28-.54.75-.76 1.34-.76 2.38 0 6.7 3.54 8.57 3.54.41 0 .7-.17.83-.6.79-2.85-12.06-4.05-10.98-8.17.2-.73.71-1.02 1.44-1.02 3.14 0 10.2 5.53 11.68 5.53.11 0 .2-.03.24-.1.74-1.2.33-2.04-4.9-5.2-5.21-3.16-8.88-5.06-6.8-7.33.24-.26.58-.38 1-.38 3.17 0 10.66 6.82 10.66 6.82s2.02 2.1 3.25 2.1c.28 0 .52-.1.68-.38.86-1.46-8.06-8.22-8.56-11.01-.34-1.9.24-2.85 1.31-2.85Z"}),e.jsx("path",{fill:"#FFD21E",d:"M38.6 76.69c2.75-4.04 2.55-7.07-1.22-10.84-3.78-3.77-5.98-9.3-5.98-9.3s-.82-3.2-2.69-2.9c-1.87.3-3.24 5.08.68 8.01 3.91 2.93-.78 4.92-2.29 2.17-1.5-2.75-5.62-9.82-7.76-11.18-2.13-1.35-3.63-.6-3.13 2.2.5 2.79 9.43 9.55 8.56 11-.87 1.47-3.93-1.71-3.93-1.71s-9.57-8.71-11.66-6.44c-2.08 2.27 1.59 4.17 6.8 7.33 5.23 3.16 5.64 4 4.9 5.2-.75 1.2-12.28-8.53-13.36-4.4-1.08 4.11 11.77 5.3 10.98 8.15-.8 2.85-9.06-5.38-10.74-2.18-1.7 3.21 11.65 6.98 11.76 7.01 4.3 1.12 15.25 3.49 19.08-2.12Z"}),e.jsx("path",{fill:"#FF9D0B",d:"M77.4 48c1.62 0 3.07.66 4.07 1.87a5.97 5.97 0 0 1 1.33 3.76 7.1 7.1 0 0 1 1.95-.3c1.55 0 2.95.59 3.94 1.66a5.8 5.8 0 0 1 .8 7 5.3 5.3 0 0 1 1.78 2.82c.24.9.48 2.8-.8 4.74a5.22 5.22 0 0 1 .37 5.02c-1.02 2.32-3.57 4.14-8.51 6.1-3.08 1.22-5.9 2-5.92 2.01a44.33 44.33 0 0 1-10.93 1.6c-5.86 0-10.05-1.8-12.46-5.34-3.88-5.69-3.33-10.9 1.7-15.92 2.78-2.78 4.63-6.87 5.01-7.77.78-2.66 2.83-5.62 6.24-5.62a5.7 5.7 0 0 1 4.6 2.46c1-1.26 1.98-2.25 2.87-2.82A7.4 7.4 0 0 1 77.4 48Zm0 4c-.51 0-1.13.22-1.82.65-2.13 1.36-6.25 8.43-7.76 11.18a2.43 2.43 0 0 1-2.14 1.31c-1.54 0-2.75-1.53-.14-3.48 3.91-2.93 2.54-7.72.67-8.01a1.54 1.54 0 0 0-.24-.02c-1.7 0-2.45 2.93-2.45 2.93s-2.2 5.52-5.97 9.3c-3.78 3.77-3.98 6.8-1.22 10.83 1.87 2.75 5.47 3.58 9.15 3.58 3.82 0 7.73-.9 9.93-1.46.1-.03 13.45-3.8 11.76-7-.29-.54-.75-.76-1.34-.76-2.38 0-6.71 3.54-8.57 3.54-.42 0-.71-.17-.83-.6-.8-2.85 12.05-4.05 10.97-8.17-.19-.73-.7-1.02-1.44-1.02-3.14 0-10.2 5.53-11.68 5.53-.1 0-.19-.03-.23-.1-.74-1.2-.34-2.04 4.88-5.2 5.23-3.16 8.9-5.06 6.8-7.33-.23-.26-.57-.38-.98-.38-3.18 0-10.67 6.82-10.67 6.82s-2.02 2.1-3.24 2.1a.74.74 0 0 1-.68-.38c-.87-1.46 8.05-8.22 8.55-11.01.34-1.9-.24-2.85-1.31-2.85Z"}),e.jsx("path",{fill:"#FFD21E",d:"M56.33 76.69c-2.75-4.04-2.56-7.07 1.22-10.84 3.77-3.77 5.97-9.3 5.97-9.3s.82-3.2 2.7-2.9c1.86.3 3.23 5.08-.68 8.01-3.92 2.93.78 4.92 2.28 2.17 1.51-2.75 5.63-9.82 7.76-11.18 2.13-1.35 3.64-.6 3.13 2.2-.5 2.79-9.42 9.55-8.55 11 .86 1.47 3.92-1.71 3.92-1.71s9.58-8.71 11.66-6.44c2.08 2.27-1.58 4.17-6.8 7.33-5.23 3.16-5.63 4-4.9 5.2.75 1.2 12.28-8.53 13.36-4.4 1.08 4.11-11.76 5.3-10.97 8.15.8 2.85 9.05-5.38 10.74-2.18 1.69 3.21-11.65 6.98-11.76 7.01-4.31 1.12-15.26 3.49-19.08-2.12Z"})]}),K=t=>{let s=2166136261;for(let r=0;r<t.length;r++)s=Math.imul(s^t.charCodeAt(r),16777619);return()=>(s=Math.imul(s^s>>>15,2246822507),s=Math.imul(s^s>>>13,3266489909),s^=s>>>16,(s>>>0)%1e4/1e4)},_=({paperId:t})=>{const s=K(t),r=160,l=220,x=[.85+s()*.1,.55+s()*.25],o=.45+s()*.3,h=[],i=9+Math.floor(s()*3);for(let k=0;k<i;k++)h.push(.55+s()*.4);const n=s()>.3,a=Math.floor(s()*3),m=[],M=6+Math.floor(s()*3);for(let k=0;k<M;k++)m.push(.5+s()*.45);const u="#9A9588",f="#3A352D",c=5,d=(r-c*2-2)/2,C=c,p=c+d+2;let b=c+2;const S=b;b+=6;const W=b+1;b+=5;const A=b;b+=3;const j=b+1;return e.jsx("div",{style:{width:r,height:l,background:"#FDFCF9",border:"1px solid var(--hairline-strong)",borderRadius:2,boxShadow:"0 1px 0 rgba(0,0,0,0.04), 0 4px 8px -4px rgba(0,0,0,0.08)",flexShrink:0,overflow:"hidden",position:"relative"},children:e.jsxs("svg",{width:r,height:l,viewBox:`0 0 ${r} ${l}`,style:{display:"block"},children:[x.map((k,v)=>e.jsx("rect",{x:c+(r-c*2)*(1-k)/2,y:S+v*2.4,width:(r-c*2)*k,height:1.4,fill:f,rx:.3},`t${v}`)),e.jsx("rect",{x:c+(r-c*2)*(1-o)/2,y:W,width:(r-c*2)*o,height:.9,fill:u,opacity:.7,rx:.2}),e.jsx("rect",{x:c,y:A,width:6,height:1,fill:f,opacity:.6}),h.map((k,v)=>{const y=j+v*2.1;return y>l-c-1?null:e.jsx("rect",{x:C,y,width:d*k,height:.8,fill:u,opacity:.55,rx:.2},`l${v}`)}),n&&e.jsxs("g",{children:[e.jsx("rect",{x:p,y:j,width:d,height:14,fill:"#F0EBE0",stroke:u,strokeWidth:.3,opacity:.9}),a===0&&e.jsx("g",{stroke:f,strokeWidth:.4,fill:"none",opacity:.6,children:e.jsx("polyline",{points:`${p+2},${j+11} ${p+6},${j+8} ${p+10},${j+9} ${p+14},${j+5} ${p+18},${j+6} ${p+22},${j+3}`})}),a===1&&e.jsxs("g",{opacity:.55,children:[e.jsx("circle",{cx:p+d/2,cy:j+7,r:3.5,fill:f}),e.jsx("rect",{x:p+2,y:j+11,width:d-4,height:1.5,fill:u})]}),a===2&&e.jsxs("g",{opacity:.55,children:[e.jsx("rect",{x:p+3,y:j+5,width:d-6,height:1,fill:f}),e.jsx("rect",{x:p+6,y:j+8,width:d-12,height:.8,fill:f})]})]}),m.map((k,v)=>{const y=j+(n?16:0)+v*2.1;return y>l-c-1?null:e.jsx("rect",{x:p,y,width:d*k,height:.8,fill:u,opacity:.55,rx:.2},`r${v}`)})]})})},V=({paperId:t,title:s,thumbnailUrl:r,priority:l=!1})=>{const[x,o]=g.useState(!1),[h,i]=g.useState(0),[n,a]=g.useState(l),m=g.useRef(null);g.useEffect(()=>{o(!1),i(0)},[r]);const M=g.useMemo(()=>{if(!r)return null;if(h===0)return r;const u=r.includes("?")?"&":"?";return`${r}${u}retry=${h}`},[r,h]);return g.useEffect(()=>{if(l||n)return;const u=m.current;if(!u)return;const f=new IntersectionObserver(([c])=>{c.isIntersecting&&(a(!0),f.disconnect())},{rootMargin:"250px"});return f.observe(u),()=>f.disconnect()},[l,n]),r&&!x?e.jsx("div",{ref:m,style:{width:160,height:220,background:"#FDFCF9",border:"1px solid var(--hairline-strong)",borderRadius:2,boxShadow:"0 1px 0 rgba(0,0,0,0.04), 0 4px 8px -4px rgba(0,0,0,0.08)",flexShrink:0,overflow:"hidden",position:"relative"},children:(l||n)&&M&&e.jsx("img",{src:M,alt:`Thumbnail for ${s}`,loading:l?"eager":"lazy",decoding:"async",fetchPriority:l?"high":"auto",style:{width:"100%",height:"100%",objectFit:"contain",display:"block"},onError:()=>{if(h<1){i(u=>u+1);return}o(!0)}},M)}):e.jsx(_,{paperId:t})},q="language-modeling";function $(t){return t?t.toLowerCase().replace(/\(.*?\)/g," ").replace(/[^a-z]+/g," ").replace(/\bllm\b/g," ").replace(/\s+/g," ").trim().replace(/s$/,""):""}function Y(t){return $(t.slug)==="large language model"||$(t.name)==="large language model"}function Q(t){return t.tags.includes(q)?t.methods.filter(s=>!Y(s)):t.methods}const se=({paper:t,rank:s,onClickTag:r})=>{const l=R(),x=`/paper/${t.id}`,o=g.useCallback(()=>{l.prefetchQuery({queryKey:["paper-arxiv",t.id],queryFn:()=>T.getPaperByArxivId(t.id,!0),staleTime:10*60*1e3})},[t.id,l]),h=t.authors.slice(0,3).join(", "),i=t.authors.length,n=Q(t);return e.jsxs("article",{className:"paper-card",children:[s!=null&&e.jsx(L,{to:x,className:"paper-thumb-wrap",onFocus:o,onMouseEnter:o,children:e.jsx(V,{paperId:t.id,title:t.title,thumbnailUrl:t.thumbnailUrl,priority:s<=3})}),e.jsxs("div",{className:"paper-body",children:[e.jsxs("div",{className:"paper-body-main",children:[e.jsx("h3",{className:"paper-title",children:e.jsx(L,{to:x,onFocus:o,onMouseEnter:o,children:e.jsx(E,{title:t.title})})}),e.jsxs("div",{className:"paper-authors",children:[h,i>3&&e.jsxs("span",{children:[", ","+",i-3," authors"]}),t.date&&e.jsxs(e.Fragment,{children:[i>0?" · ":"",e.jsx("span",{children:t.date})]}),t.citations>0&&e.jsxs(e.Fragment,{children:[i>0||t.date?" · ":"",e.jsxs("span",{children:[t.citations.toLocaleString()," citations"]})]})]}),t.abstract&&e.jsx("p",{className:"paper-abstract",children:e.jsx(z,{text:t.abstract})}),t.sotaRanks.length>0&&e.jsx(I,{ranks:t.sotaRanks,paperHref:x}),(t.tags.length>0||n.length>0)&&e.jsxs("div",{className:"paper-tags paper-tags--clamped",children:[t.tags.map(a=>e.jsx(D,{slug:a,onClick:r},a)),n.map(a=>e.jsx(G,{method:a},a.id||a.slug||a.name))]})]}),(t.githubUrl||t.hfUrl)&&e.jsxs("div",{className:"paper-resources",children:[t.githubUrl&&e.jsxs("a",{className:"paper-resource is-link",href:t.githubUrl,target:"_blank",rel:"noopener noreferrer","aria-label":"Open GitHub repository",onClick:a=>a.stopPropagation(),children:[e.jsx(O,{name:"github",size:20}),t.velocity24h!=null&&t.velocity24h>0&&e.jsxs("span",{className:"resource-stat",children:[e.jsxs("span",{className:"resource-value",children:[e.jsx("span",{className:"gh-rate-arrow",children:"↑"}),J(t.velocity24h)]}),e.jsx("span",{className:"resource-label",children:"stars / hr"})]})]}),t.hfUrl&&t.hfKind&&e.jsxs("a",{className:"paper-resource is-link",href:t.hfUrl,target:"_blank",rel:"noopener noreferrer","aria-label":`Open Hugging Face ${t.hfKind}`,onClick:a=>a.stopPropagation(),children:[e.jsx(U,{size:20}),e.jsxs("span",{className:"resource-stat",children:[e.jsx("span",{className:"resource-value",children:t.hfCount}),e.jsx("span",{className:"resource-label",children:t.hfKind})]})]})]})]})]})};function J(t){return t.toFixed(1)}export{O as I,G as M,se as P,I as S,D as T,V as a};
 
1
+ import{h as R,R as g,b as T,j as e,L,u as w}from"./index-Bo5_2OqZ.js";import{L as E,a as z}from"./LatexTitle-qoY4vrTZ.js";import{h as P,d as Z,f as B,e as H}from"./transform-2Gnjg1jt.js";const D=({slug:t,label:s,onClick:r})=>{const l=w(),x=P(t),o=H(x),h=i=>{if(i.stopPropagation(),r){r(t);return}l(`/tasks/${t}`)};return e.jsxs("span",{className:"tag-chip",style:{background:o.bg,color:o.text},onClick:h,children:[e.jsx("span",{className:"dot",style:{background:o.dot}}),Z(s||B(t),t)]})},G=({method:t,onClick:s})=>{const r=w(),l=t.slug||t.id||"";if(!l)return null;const x=o=>{if(o.stopPropagation(),s){s(l);return}r(`/methods/${l}`)};return e.jsx("span",{className:"method-chip",onClick:x,children:t.name})},N={1:"SOTA 🏆",2:"#2",3:"#3"},F=({units:t,paperHref:s})=>{const r=g.useRef(null),l=g.useRef(null),[x,o]=g.useState(t.length);if(g.useLayoutEffect(()=>{const n=r.current,a=l.current;if(!n||!a||t.length===0)return;const m=f=>(a.textContent=f,a.scrollWidth),M=()=>{const f=n.clientWidth;if(f<=0)return;let c=0,d=0;for(const C of t){const p=m(C.measureText);if(c+p<=f)c+=p,d+=1;else break}if(d<t.length){for(;d>0&&c+m(` · +${t.length-d} more`)>f;)d-=1,c-=m(t[d].measureText);d===0&&(d=1)}o(d)};M();const u=new ResizeObserver(M);return u.observe(n),()=>u.disconnect()},[t]),t.length===0)return null;const h=t.slice(0,Math.max(1,Math.min(x,t.length))),i=t.length-h.length;return e.jsxs("div",{className:"paper-sota",ref:r,children:[e.jsx("span",{ref:l,className:"paper-sota-measure","aria-hidden":"true"}),h.map((n,a)=>e.jsxs(g.Fragment,{children:[n.isGroupStart?e.jsxs(e.Fragment,{children:[a>0&&e.jsx("span",{className:"paper-sota-sep",children:" · "}),e.jsx("span",{className:`paper-sota-label${n.rank===1?" paper-sota-label--sota":""}`,children:N[n.rank]}),e.jsx("span",{className:"paper-sota-on",children:" on "})]}):e.jsx("span",{className:"paper-sota-sep",children:", "}),n.slug?e.jsx(L,{to:`/benchmark/${n.slug}`,className:"paper-sota-name",onClick:m=>m.stopPropagation(),children:n.name}):e.jsx("span",{className:"paper-sota-name",children:n.name})]},`${n.slug||n.name}-${a}`)),i>0&&e.jsxs(L,{to:`${s}#results`,className:"paper-sota-more",onClick:n=>n.stopPropagation(),children:[" · +",i," more"]})]})},I=({ranks:t,paperHref:s,wrap:r=!1})=>{const l=g.useMemo(()=>{const o=[];let h=!0;for(const i of[1,2,3]){const n=t.filter(a=>a.rank===i);n.forEach((a,m)=>{const M=m===0,u=M?`${h?"":" · "}${N[i]} on `:", ";o.push({name:a.name,slug:a.slug,rank:i,isGroupStart:M,measureText:u+a.name})}),n.length>0&&(h=!1)}return o},[t]),x=g.useMemo(()=>[1,2,3].map(o=>t.filter(i=>i.rank===o).map((i,n)=>({name:i.name,slug:i.slug,rank:o,isGroupStart:n===0,measureText:(n===0?`${N[o]} on `:", ")+i.name}))).filter(o=>o.length>0),[t]);return r?x.length===0?null:e.jsx("div",{className:"paper-sota-stack",children:x.map(o=>e.jsx(F,{units:o,paperHref:s},o[0].rank))}):l.length===0?null:e.jsx(F,{units:l,paperHref:s})},O=({name:t,size:s=14})=>{const r={search:e.jsx("path",{d:"M11 11l3 3M7 12.5a5.5 5.5 0 110-11 5.5 5.5 0 010 11z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),arrowUp:e.jsx("path",{d:"M8 3l5 6H3l5-6z",fill:"currentColor"}),arrowLeft:e.jsx("path",{d:"M9 3l-4 5 4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),arrowRight:e.jsx("path",{d:"M7 3l4 5-4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),external:e.jsx("path",{d:"M5 3h-2v8h8v-2M9 3h3v3M7 9l5-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),github:e.jsx("path",{d:"M8 1a7 7 0 00-2.21 13.64c.35.06.48-.15.48-.34v-1.2c-1.95.42-2.36-.94-2.36-.94-.32-.81-.78-1.03-.78-1.03-.64-.43.05-.43.05-.43.7.05 1.07.72 1.07.72.62 1.07 1.64.76 2.04.58.06-.45.24-.76.44-.94-1.55-.18-3.18-.78-3.18-3.46 0-.76.27-1.39.72-1.88-.07-.18-.31-.89.07-1.86 0 0 .59-.19 1.92.72.56-.15 1.16-.23 1.75-.24.59 0 1.19.08 1.75.24 1.33-.9 1.92-.72 1.92-.72.38.97.14 1.68.07 1.86.45.49.72 1.12.72 1.88 0 2.69-1.64 3.28-3.19 3.45.25.22.48.65.48 1.32v1.95c0 .19.13.41.49.34A7 7 0 008 1z",fill:"currentColor"}),citation:e.jsx("path",{d:"M3 4h3v3H3zM4 7v1.5a1.5 1.5 0 01-1.5 1.5M9 4h3v3H9zM10 7v1.5a1.5 1.5 0 01-1.5 1.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none"}),bookmark:e.jsx("path",{d:"M4 2h8v12l-4-3-4 3V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),chart:e.jsx("path",{d:"M2 13h12M3 11l3-4 3 2 4-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),chat:e.jsx("path",{d:"M3 3h10v7H7l-3 3v-3H3V3z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),pdf:e.jsx("path",{d:"M5 2h5l3 3v9H5V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),copy:e.jsx("path",{d:"M5 5h7v8H5V5zM3 3h7v2M3 3v8h2",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinejoin:"round"}),sparkle:e.jsx("path",{d:"M8 2l1.2 3.8L13 7l-3.8 1.2L8 12l-1.2-3.8L3 7l3.8-1.2L8 2z",fill:"currentColor"}),user:e.jsx("path",{d:"M8 8a3 3 0 100-6 3 3 0 000 6zM2 14c0-3 2.5-5 6-5s6 2 6 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),globe:e.jsx("path",{d:"M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM1.5 8h13M8 1.5c1.7 1.9 2.6 4.2 2.6 6.5s-.9 4.6-2.6 6.5M8 1.5C6.3 3.4 5.4 5.7 5.4 8s.9 4.6 2.6 6.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinecap:"round"}),menu:e.jsx("path",{d:"M2 4h12M2 8h12M2 12h12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),close:e.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})};return e.jsx("svg",{className:s===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:s,height:s,children:r[t]})},U=({size:t=16})=>e.jsxs("svg",{className:"hf-logo",width:t,height:t,viewBox:"0 0 95 88",fill:"none","aria-hidden":"true",focusable:"false",children:[e.jsx("path",{fill:"#FFD21E",d:"M47.21 76.5a34.75 34.75 0 1 0 0-69.5 34.75 34.75 0 0 0 0 69.5Z"}),e.jsx("path",{fill:"#FF9D0B",d:"M81.96 41.75a34.75 34.75 0 1 0-69.5 0 34.75 34.75 0 0 0 69.5 0Zm-73.5 0a38.75 38.75 0 1 1 77.5 0 38.75 38.75 0 0 1-77.5 0Z"}),e.jsx("path",{fill:"#3A3B45",d:"M58.5 32.3c1.28.44 1.78 3.06 3.07 2.38a5 5 0 1 0-6.76-2.07c.61 1.15 2.55-.72 3.7-.32ZM34.95 32.3c-1.28.44-1.79 3.06-3.07 2.38a5 5 0 1 1 6.76-2.07c-.61 1.15-2.56-.72-3.7-.32Z"}),e.jsx("path",{fill:"#FF323D",d:"M46.96 56.29c9.83 0 13-8.76 13-13.26 0-2.34-1.57-1.6-4.09-.36-2.33 1.15-5.46 2.74-8.9 2.74-7.19 0-13-6.88-13-2.38s3.16 13.26 13 13.26Z"}),e.jsx("path",{fill:"#3A3B45",fillRule:"evenodd",clipRule:"evenodd",d:"M39.43 54a8.7 8.7 0 0 1 5.3-4.49c.4-.12.81.57 1.24 1.28.4.68.82 1.37 1.24 1.37.45 0 .9-.68 1.33-1.35.45-.7.89-1.38 1.32-1.25a8.61 8.61 0 0 1 5 4.17c3.73-2.94 5.1-7.74 5.1-10.7 0-2.34-1.57-1.6-4.09-.36l-.14.07c-2.31 1.15-5.39 2.67-8.77 2.67s-6.45-1.52-8.77-2.67c-2.6-1.29-4.23-2.1-4.23.29 0 3.05 1.46 8.06 5.47 10.97Z"}),e.jsx("path",{fill:"#FF9D0B",d:"M70.71 37a3.25 3.25 0 1 0 0-6.5 3.25 3.25 0 0 0 0 6.5ZM24.21 37a3.25 3.25 0 1 0 0-6.5 3.25 3.25 0 0 0 0 6.5ZM17.52 48c-1.62 0-3.06.66-4.07 1.87a5.97 5.97 0 0 0-1.33 3.76 7.1 7.1 0 0 0-1.94-.3c-1.55 0-2.95.59-3.94 1.66a5.8 5.8 0 0 0-.8 7 5.3 5.3 0 0 0-1.79 2.82c-.24.9-.48 2.8.8 4.74a5.22 5.22 0 0 0-.37 5.02c1.02 2.32 3.57 4.14 8.52 6.1 3.07 1.22 5.89 2 5.91 2.01a44.33 44.33 0 0 0 10.93 1.6c5.86 0 10.05-1.8 12.46-5.34 3.88-5.69 3.33-10.9-1.7-15.92-2.77-2.78-4.62-6.87-5-7.77-.78-2.66-2.84-5.62-6.25-5.62a5.7 5.7 0 0 0-4.6 2.46c-1-1.26-1.98-2.25-2.86-2.82A7.4 7.4 0 0 0 17.52 48Zm0 4c.51 0 1.14.22 1.82.65 2.14 1.36 6.25 8.43 7.76 11.18.5.92 1.37 1.31 2.14 1.31 1.55 0 2.75-1.53.15-3.48-3.92-2.93-2.55-7.72-.68-8.01.08-.02.17-.02.24-.02 1.7 0 2.45 2.93 2.45 2.93s2.2 5.52 5.98 9.3c3.77 3.77 3.97 6.8 1.22 10.83-1.88 2.75-5.47 3.58-9.16 3.58-3.81 0-7.73-.9-9.92-1.46-.11-.03-13.45-3.8-11.76-7 .28-.54.75-.76 1.34-.76 2.38 0 6.7 3.54 8.57 3.54.41 0 .7-.17.83-.6.79-2.85-12.06-4.05-10.98-8.17.2-.73.71-1.02 1.44-1.02 3.14 0 10.2 5.53 11.68 5.53.11 0 .2-.03.24-.1.74-1.2.33-2.04-4.9-5.2-5.21-3.16-8.88-5.06-6.8-7.33.24-.26.58-.38 1-.38 3.17 0 10.66 6.82 10.66 6.82s2.02 2.1 3.25 2.1c.28 0 .52-.1.68-.38.86-1.46-8.06-8.22-8.56-11.01-.34-1.9.24-2.85 1.31-2.85Z"}),e.jsx("path",{fill:"#FFD21E",d:"M38.6 76.69c2.75-4.04 2.55-7.07-1.22-10.84-3.78-3.77-5.98-9.3-5.98-9.3s-.82-3.2-2.69-2.9c-1.87.3-3.24 5.08.68 8.01 3.91 2.93-.78 4.92-2.29 2.17-1.5-2.75-5.62-9.82-7.76-11.18-2.13-1.35-3.63-.6-3.13 2.2.5 2.79 9.43 9.55 8.56 11-.87 1.47-3.93-1.71-3.93-1.71s-9.57-8.71-11.66-6.44c-2.08 2.27 1.59 4.17 6.8 7.33 5.23 3.16 5.64 4 4.9 5.2-.75 1.2-12.28-8.53-13.36-4.4-1.08 4.11 11.77 5.3 10.98 8.15-.8 2.85-9.06-5.38-10.74-2.18-1.7 3.21 11.65 6.98 11.76 7.01 4.3 1.12 15.25 3.49 19.08-2.12Z"}),e.jsx("path",{fill:"#FF9D0B",d:"M77.4 48c1.62 0 3.07.66 4.07 1.87a5.97 5.97 0 0 1 1.33 3.76 7.1 7.1 0 0 1 1.95-.3c1.55 0 2.95.59 3.94 1.66a5.8 5.8 0 0 1 .8 7 5.3 5.3 0 0 1 1.78 2.82c.24.9.48 2.8-.8 4.74a5.22 5.22 0 0 1 .37 5.02c-1.02 2.32-3.57 4.14-8.51 6.1-3.08 1.22-5.9 2-5.92 2.01a44.33 44.33 0 0 1-10.93 1.6c-5.86 0-10.05-1.8-12.46-5.34-3.88-5.69-3.33-10.9 1.7-15.92 2.78-2.78 4.63-6.87 5.01-7.77.78-2.66 2.83-5.62 6.24-5.62a5.7 5.7 0 0 1 4.6 2.46c1-1.26 1.98-2.25 2.87-2.82A7.4 7.4 0 0 1 77.4 48Zm0 4c-.51 0-1.13.22-1.82.65-2.13 1.36-6.25 8.43-7.76 11.18a2.43 2.43 0 0 1-2.14 1.31c-1.54 0-2.75-1.53-.14-3.48 3.91-2.93 2.54-7.72.67-8.01a1.54 1.54 0 0 0-.24-.02c-1.7 0-2.45 2.93-2.45 2.93s-2.2 5.52-5.97 9.3c-3.78 3.77-3.98 6.8-1.22 10.83 1.87 2.75 5.47 3.58 9.15 3.58 3.82 0 7.73-.9 9.93-1.46.1-.03 13.45-3.8 11.76-7-.29-.54-.75-.76-1.34-.76-2.38 0-6.71 3.54-8.57 3.54-.42 0-.71-.17-.83-.6-.8-2.85 12.05-4.05 10.97-8.17-.19-.73-.7-1.02-1.44-1.02-3.14 0-10.2 5.53-11.68 5.53-.1 0-.19-.03-.23-.1-.74-1.2-.34-2.04 4.88-5.2 5.23-3.16 8.9-5.06 6.8-7.33-.23-.26-.57-.38-.98-.38-3.18 0-10.67 6.82-10.67 6.82s-2.02 2.1-3.24 2.1a.74.74 0 0 1-.68-.38c-.87-1.46 8.05-8.22 8.55-11.01.34-1.9-.24-2.85-1.31-2.85Z"}),e.jsx("path",{fill:"#FFD21E",d:"M56.33 76.69c-2.75-4.04-2.56-7.07 1.22-10.84 3.77-3.77 5.97-9.3 5.97-9.3s.82-3.2 2.7-2.9c1.86.3 3.23 5.08-.68 8.01-3.92 2.93.78 4.92 2.28 2.17 1.51-2.75 5.63-9.82 7.76-11.18 2.13-1.35 3.64-.6 3.13 2.2-.5 2.79-9.42 9.55-8.55 11 .86 1.47 3.92-1.71 3.92-1.71s9.58-8.71 11.66-6.44c2.08 2.27-1.58 4.17-6.8 7.33-5.23 3.16-5.63 4-4.9 5.2.75 1.2 12.28-8.53 13.36-4.4 1.08 4.11-11.76 5.3-10.97 8.15.8 2.85 9.05-5.38 10.74-2.18 1.69 3.21-11.65 6.98-11.76 7.01-4.31 1.12-15.26 3.49-19.08-2.12Z"})]}),K=t=>{let s=2166136261;for(let r=0;r<t.length;r++)s=Math.imul(s^t.charCodeAt(r),16777619);return()=>(s=Math.imul(s^s>>>15,2246822507),s=Math.imul(s^s>>>13,3266489909),s^=s>>>16,(s>>>0)%1e4/1e4)},_=({paperId:t})=>{const s=K(t),r=160,l=220,x=[.85+s()*.1,.55+s()*.25],o=.45+s()*.3,h=[],i=9+Math.floor(s()*3);for(let k=0;k<i;k++)h.push(.55+s()*.4);const n=s()>.3,a=Math.floor(s()*3),m=[],M=6+Math.floor(s()*3);for(let k=0;k<M;k++)m.push(.5+s()*.45);const u="#9A9588",f="#3A352D",c=5,d=(r-c*2-2)/2,C=c,p=c+d+2;let b=c+2;const S=b;b+=6;const W=b+1;b+=5;const A=b;b+=3;const j=b+1;return e.jsx("div",{style:{width:r,height:l,background:"#FDFCF9",border:"1px solid var(--hairline-strong)",borderRadius:2,boxShadow:"0 1px 0 rgba(0,0,0,0.04), 0 4px 8px -4px rgba(0,0,0,0.08)",flexShrink:0,overflow:"hidden",position:"relative"},children:e.jsxs("svg",{width:r,height:l,viewBox:`0 0 ${r} ${l}`,style:{display:"block"},children:[x.map((k,v)=>e.jsx("rect",{x:c+(r-c*2)*(1-k)/2,y:S+v*2.4,width:(r-c*2)*k,height:1.4,fill:f,rx:.3},`t${v}`)),e.jsx("rect",{x:c+(r-c*2)*(1-o)/2,y:W,width:(r-c*2)*o,height:.9,fill:u,opacity:.7,rx:.2}),e.jsx("rect",{x:c,y:A,width:6,height:1,fill:f,opacity:.6}),h.map((k,v)=>{const y=j+v*2.1;return y>l-c-1?null:e.jsx("rect",{x:C,y,width:d*k,height:.8,fill:u,opacity:.55,rx:.2},`l${v}`)}),n&&e.jsxs("g",{children:[e.jsx("rect",{x:p,y:j,width:d,height:14,fill:"#F0EBE0",stroke:u,strokeWidth:.3,opacity:.9}),a===0&&e.jsx("g",{stroke:f,strokeWidth:.4,fill:"none",opacity:.6,children:e.jsx("polyline",{points:`${p+2},${j+11} ${p+6},${j+8} ${p+10},${j+9} ${p+14},${j+5} ${p+18},${j+6} ${p+22},${j+3}`})}),a===1&&e.jsxs("g",{opacity:.55,children:[e.jsx("circle",{cx:p+d/2,cy:j+7,r:3.5,fill:f}),e.jsx("rect",{x:p+2,y:j+11,width:d-4,height:1.5,fill:u})]}),a===2&&e.jsxs("g",{opacity:.55,children:[e.jsx("rect",{x:p+3,y:j+5,width:d-6,height:1,fill:f}),e.jsx("rect",{x:p+6,y:j+8,width:d-12,height:.8,fill:f})]})]}),m.map((k,v)=>{const y=j+(n?16:0)+v*2.1;return y>l-c-1?null:e.jsx("rect",{x:p,y,width:d*k,height:.8,fill:u,opacity:.55,rx:.2},`r${v}`)})]})})},V=({paperId:t,title:s,thumbnailUrl:r,priority:l=!1})=>{const[x,o]=g.useState(!1),[h,i]=g.useState(0),[n,a]=g.useState(l),m=g.useRef(null);g.useEffect(()=>{o(!1),i(0)},[r]);const M=g.useMemo(()=>{if(!r)return null;if(h===0)return r;const u=r.includes("?")?"&":"?";return`${r}${u}retry=${h}`},[r,h]);return g.useEffect(()=>{if(l||n)return;const u=m.current;if(!u)return;const f=new IntersectionObserver(([c])=>{c.isIntersecting&&(a(!0),f.disconnect())},{rootMargin:"250px"});return f.observe(u),()=>f.disconnect()},[l,n]),r&&!x?e.jsx("div",{ref:m,style:{width:160,height:220,background:"#FDFCF9",border:"1px solid var(--hairline-strong)",borderRadius:2,boxShadow:"0 1px 0 rgba(0,0,0,0.04), 0 4px 8px -4px rgba(0,0,0,0.08)",flexShrink:0,overflow:"hidden",position:"relative"},children:(l||n)&&M&&e.jsx("img",{src:M,alt:`Thumbnail for ${s}`,loading:l?"eager":"lazy",decoding:"async",fetchPriority:l?"high":"auto",style:{width:"100%",height:"100%",objectFit:"contain",display:"block"},onError:()=>{if(h<1){i(u=>u+1);return}o(!0)}},M)}):e.jsx(_,{paperId:t})},q="language-modeling";function $(t){return t?t.toLowerCase().replace(/\(.*?\)/g," ").replace(/[^a-z]+/g," ").replace(/\bllm\b/g," ").replace(/\s+/g," ").trim().replace(/s$/,""):""}function Y(t){return $(t.slug)==="large language model"||$(t.name)==="large language model"}function Q(t){return t.tags.includes(q)?t.methods.filter(s=>!Y(s)):t.methods}const se=({paper:t,rank:s,onClickTag:r})=>{const l=R(),x=`/paper/${t.id}`,o=g.useCallback(()=>{l.prefetchQuery({queryKey:["paper-arxiv",t.id],queryFn:()=>T.getPaperByArxivId(t.id,!0),staleTime:10*60*1e3})},[t.id,l]),h=t.authors.slice(0,3).join(", "),i=t.authors.length,n=Q(t);return e.jsxs("article",{className:"paper-card",children:[s!=null&&e.jsx(L,{to:x,className:"paper-thumb-wrap",onFocus:o,onMouseEnter:o,children:e.jsx(V,{paperId:t.id,title:t.title,thumbnailUrl:t.thumbnailUrl,priority:s<=3})}),e.jsxs("div",{className:"paper-body",children:[e.jsxs("div",{className:"paper-body-main",children:[e.jsx("h3",{className:"paper-title",children:e.jsx(L,{to:x,onFocus:o,onMouseEnter:o,children:e.jsx(E,{title:t.title})})}),e.jsxs("div",{className:"paper-authors",children:[h,i>3&&e.jsxs("span",{children:[", ","+",i-3," authors"]}),t.date&&e.jsxs(e.Fragment,{children:[i>0?" · ":"",e.jsx("span",{children:t.date})]}),t.citations>0&&e.jsxs(e.Fragment,{children:[i>0||t.date?" · ":"",e.jsxs("span",{children:[t.citations.toLocaleString()," citations"]})]})]}),t.abstract&&e.jsx("p",{className:"paper-abstract",children:e.jsx(z,{text:t.abstract})}),t.sotaRanks.length>0&&e.jsx(I,{ranks:t.sotaRanks,paperHref:x}),(t.tags.length>0||n.length>0)&&e.jsxs("div",{className:"paper-tags paper-tags--clamped",children:[t.tags.map(a=>e.jsx(D,{slug:a,onClick:r},a)),n.map(a=>e.jsx(G,{method:a},a.id||a.slug||a.name))]})]}),(t.githubUrl||t.hfUrl)&&e.jsxs("div",{className:"paper-resources",children:[t.githubUrl&&e.jsxs("a",{className:"paper-resource is-link",href:t.githubUrl,target:"_blank",rel:"noopener noreferrer","aria-label":"Open GitHub repository",onClick:a=>a.stopPropagation(),children:[e.jsx(O,{name:"github",size:20}),t.velocity24h!=null&&t.velocity24h>0&&e.jsxs("span",{className:"resource-stat",children:[e.jsxs("span",{className:"resource-value",children:[e.jsx("span",{className:"gh-rate-arrow",children:"↑"}),J(t.velocity24h)]}),e.jsx("span",{className:"resource-label",children:"stars / hr"})]})]}),t.hfUrl&&t.hfKind&&e.jsxs("a",{className:"paper-resource is-link",href:t.hfUrl,target:"_blank",rel:"noopener noreferrer","aria-label":`Open Hugging Face ${t.hfKind}`,onClick:a=>a.stopPropagation(),children:[e.jsx(U,{size:20}),e.jsxs("span",{className:"resource-stat",children:[e.jsx("span",{className:"resource-value",children:t.hfCount}),e.jsx("span",{className:"resource-label",children:t.hfKind})]})]})]})]})]})};function J(t){return t.toFixed(1)}export{O as I,G as M,se as P,I as S,D as T,V as a};