nielsr HF Staff commited on
Commit
9786f9b
·
verified ·
1 Parent(s): bb05bc5

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-BtS-eenx.js → AiDeadlinesView-B8lfI6lB.js} +1 -1
  2. assets/ArtifactWorkspace-B2_NF1H2.js +0 -0
  3. assets/ArtifactWorkspace-CTFG-tNc.js +0 -0
  4. assets/{AuthorDetailView-BYp1ulia.js → AuthorDetailView-B2PSyG8x.js} +1 -1
  5. assets/{BenchmarkDetailView-D5CM3bRL.js → BenchmarkDetailView-CS7Yz65e.js} +1 -1
  6. assets/{BenchmarkTrendSparkline-DmwnJgng.js → BenchmarkTrendSparkline-iEoRSHN4.js} +1 -1
  7. assets/ChatView-CG4tP3Rs.js +0 -16
  8. assets/ChatView-DVr-RWnO.js +16 -0
  9. assets/{ConferenceDetailView-j3TmqjV4.js → ConferenceDetailView-4y66r_zR.js} +1 -1
  10. assets/{ConferenceTaskView-CLcoonXP.js → ConferenceTaskView-EpnQ4uWR.js} +1 -1
  11. assets/{ConferencesIndexView-CeEX2aRl.js → ConferencesIndexView-CxO00TlM.js} +1 -1
  12. assets/{CronDashboard-DKXU8hrn.js → CronDashboard-U8gVQqxH.js} +1 -1
  13. assets/{ExternalSourceEvalBadge-7U9mCirI.js → ExternalSourceEvalBadge-BL5qKVgu.js} +1 -1
  14. assets/FeedView-BJRolksy.js +1 -0
  15. assets/FeedView-ClVIjjeq.js +0 -1
  16. assets/{FrameworksIndexView-BIBXDNUN.js → FrameworksIndexView-DuHG9IaJ.js} +1 -1
  17. assets/{LatexTitle-j9Bx8wiP.js → LatexTitle-BQ-aqYJn.js} +1 -1
  18. assets/{MarkdownText-fqFB7jpa.js → MarkdownText-BGyyXIsO.js} +1 -1
  19. assets/{MethodDetailView-BaNaq4Ov.js → MethodDetailView-DfzyRt-9.js} +1 -1
  20. assets/{MethodsIndexView-0GFbWqq-.js → MethodsIndexView-B6Ol3X40.js} +1 -1
  21. assets/{NotFound-C4Ku0WP3.js → NotFound-BqqYiveq.js} +1 -1
  22. assets/{OrganizationContributionGraph-rCVWThLe.js → OrganizationContributionGraph-D2Q82lUu.js} +1 -1
  23. assets/OrganizationDetailView-BAjEuyHS.js +1 -0
  24. assets/OrganizationDetailView-C_iDFbtK.js +0 -1
  25. assets/{OrganizationPaperFeed-D8JytOGR.js → OrganizationPaperFeed-Btj_88cl.js} +1 -1
  26. assets/OrganizationTaskView-D1JOqGPE.js +0 -1
  27. assets/OrganizationTaskView-qJaHP435.js +1 -0
  28. assets/{OrganizationsIndexView-BHHCI1Mo.js → OrganizationsIndexView-Bq3jofOO.js} +1 -1
  29. assets/{PaperDetailView-nbbwll6_.js → PaperDetailView-CmpN99i3.js} +1 -1
  30. assets/{PaperPreviewLink-Da7TZ3ij.js → PaperPreviewLink-Br9pyKgi.js} +1 -1
  31. assets/{PaperReaderView-Cxoim2AQ.js → PaperReaderView-D0kJa2gb.js} +0 -0
  32. assets/{PapersListView-_ixIrLut.js → PapersListView-CznAYqEu.js} +1 -1
  33. assets/{PrivacyView-BfVZL4ZS.js → PrivacyView-BtJ_lMF8.js} +1 -1
  34. assets/{RateLimitsView-DUYDvfR7.js → RateLimitsView-iQNMV_O1.js} +1 -1
  35. assets/{SavedPapersView-CC3_m-hY.js → SavedPapersView-Bnr3_eZb.js} +1 -1
  36. assets/{SearchOverlay-B_f7fcn_.js → SearchOverlay-C8qVK6Ty.js} +1 -1
  37. assets/SettingsView-B6NBFGTS.js +0 -16
  38. assets/SettingsView-BlQLj0GR.js +16 -0
  39. assets/SharedChatView-DBR6M8tZ.js +0 -1
  40. assets/SharedChatView-Vy1twM5R.js +1 -0
  41. assets/{SignInToEditDialog-_xlmZxOT.js → SignInToEditDialog-C_4kkM3M.js} +1 -1
  42. assets/{StagingAccessRequestView-JX-LFM7Z.js → StagingAccessRequestView-5OEGxopb.js} +1 -1
  43. assets/{SubmissionsDashboard-DMXG-tvg.js → SubmissionsDashboard-CRG-ldyo.js} +1 -1
  44. assets/{SubmitView-BCARVk42.js → SubmitView-BGHHENZV.js} +1 -1
  45. assets/{TagBrowseView-DOBpjBaE.js → TagBrowseView-D7Z1HJMF.js} +1 -1
  46. assets/{TagsIndexView-BgMU3odX.js → TagsIndexView-Cie4wZfi.js} +1 -1
  47. assets/{TaxonomySuggestionTile-B4j9rE3C.js → TaxonomySuggestionTile-DlEFIt6g.js} +1 -1
  48. assets/{TrendsView-Ssp5t5Ky.js → TrendsView-gEmWJwrM.js} +1 -1
  49. assets/{UserProfileView-BBq2VznJ.js → UserProfileView-DGFE_uoS.js} +1 -1
  50. assets/{alert-C5eNYVhH.js → alert-C4A_tmFK.js} +1 -1
assets/{AiDeadlinesView-BtS-eenx.js → AiDeadlinesView-B8lfI6lB.js} RENAMED
@@ -1,3 +1,3 @@
1
- import{r as x,j as t}from"./index-DpqMFKEJ.js";import{u as A}from"./useQuery-BRJ3D8WJ.js";import{c as B}from"./catalog-CNSpmU4d.js";import{S as U}from"./switch-m9rpNcU7.js";import{S as W}from"./skeleton-BmlKdebV.js";import{A as O,a as V}from"./alert-C5eNYVhH.js";import{s as z}from"./safeExternalHref-CkBrsh84.js";import{D as P,a as G,b as Y,c as H,d as K}from"./dialog-DW3Uw8Zv.js";import"./index-CkejuWVZ.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"]),Q=e=>e.trim().toLowerCase().replace(/\s+/g,"-"),D=e=>Array.from(new Set((e.tags??[]).map(Q).filter(a=>q.has(a)))),F=e=>new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),I=(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}`},M=e=>[...e.deadlines??[]].sort((a,n)=>new Date(a.deadline_at).getTime()-new Date(n.deadline_at).getTime()),T=(e,a)=>M(e).find(n=>new Date(n.deadline_at).getTime()>a)??null,L=e=>{const a=M(e);return a.length?a[a.length-1]:null},J=(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`},X=(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)"},Z=(e,a)=>{const n=Math.ceil((e-a)/b);return n<=0?"passed":`${n} ${n===1?"day":"days"}`},R=(e,a)=>{const n=I(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}/,""),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=`https://calendar.google.com/calendar/render?action=TEMPLATE&text=${encodeURIComponent(o)}&dates=${C(n)}/${C(r)}&details=${encodeURIComponent(R(e,a))}&location=${encodeURIComponent(i)}`,m=z(s);m&&window.open(m,"_blank","noopener,noreferrer")},te=(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
  `),m=new Blob([s],{type:"text/calendar;charset=utf-8"}),c=document.createElement("a");c.href=URL.createObjectURL(m),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)},ne=({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?M(e):[],[e]),s=x.useMemo(()=>e?T(e,r):null,[e,r]),m=e?I(e.start_date,e.end_date):null,c=e?e.venue||[e.city,e.country].filter(Boolean).join(", ")||e.location:null,u=s?new Date(s.deadline_at).getTime():null;return t.jsx(P,{open:a,onOpenChange:n,children:t.jsx(G,{className:"max-w-xl",style:{background:"var(--bg-elevated)",maxHeight:"85vh",overflowY:"auto"},children:e&&t.jsxs(t.Fragment,{children:[t.jsxs(Y,{children:[t.jsx(H,{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:[m&&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:m})]}),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})]})]}),u!=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:_(u,r)},children:X(u,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,p)=>{const y=new Date(d.deadline_at).getTime(),l=s!=null&&d.deadline_at===s.deadline_at&&d.type===s.type,h=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:h&&!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:_(h?null:y,r)},children:Z(y,r)})]},`${d.type??"deadline"}-${p}`)})]}),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:z(e.url)??void 0,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:()=>ee(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Google Calendar"}),t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>te(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Apple / .ics"})]})]})]})]})})})},E=({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(U,{id:e,checked:n,onCheckedChange:r}),t.jsx("label",{htmlFor:e,style:{cursor:"pointer"},children:a})]}),ae=({conf:e,now:a,selectedDomains:n,onToggleDomain:r,onOpen:o})=>{const i=T(e,a),s=i??L(e),m=s?new Date(s.deadline_at).getTime():null,c=_(i?m:null,a),u=I(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:p=>{(p.key==="Enter"||p.key===" ")&&(p.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:z(e.url)??void 0,target:"_blank",rel:"noopener noreferrer",onClick:p=>p.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:m!=null?J(m,a):"TBD"})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)"},children:[u&&t.jsx("span",{children:u}),d&&t.jsx("span",{children:d})]}),D(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:D(e).map(p=>{const y=n.has(p);return t.jsx("button",{className:"tag-chip",onClick:l=>{l.stopPropagation(),r(p)},style:{background:y?"var(--ink)":"var(--bg-subtle)",color:y?"var(--bg)":"var(--ink-soft)"},children:k(p)},p)})})]})},ue=()=>{const[e,a]=x.useState(!0),[n,r]=x.useState(!1),[o,i]=x.useState(new Set),[s,m]=x.useState(null),c=x.useMemo(()=>Date.now(),[]),u=A({queryKey:["conference-deadlines"],queryFn:()=>B.conferenceDeadlines(),staleTime:10*60*1e3}),d=l=>{i(h=>{const g=new Set(h);return g.has(l)?g.delete(l):g.add(l),g})},p=x.useMemo(()=>{var h;const l=new Map;return(h=u.data)==null||h.results.forEach(g=>{D(g).forEach(j=>l.set(j,(l.get(j)??0)+1))}),Array.from(l.entries()).sort((g,j)=>j[1]-g[1]).map(([g])=>g)},[u.data]),y=x.useMemo(()=>{var j;const h=(((j=u.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))),g=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[...h].sort((f,w)=>{const v=g(f),N=g(w);return v.group!==N.group?v.group-N.group:v.time-N.time})},[u.data,e,n,o,c]);return u.error?t.jsx("div",{className:"page",children:t.jsx(O,{variant:"destructive",children:t.jsx(V,{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(E,{id:"top-tier-only",label:"Top tier only",checked:e,onChange:a}),t.jsx(E,{id:"show-past",label:"Show past conferences",checked:n,onChange:r})]}),p.length>0&&t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:24},children:[p.map(l=>{const h=o.has(l);return t.jsx("button",{className:"tag-chip",onClick:()=>d(l),style:{background:h?"var(--ink)":"var(--bg-subtle)",color:h?"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:u.isLoading?"…":`${y.length} conferences`})}),u.isLoading?t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:Array.from({length:6}).map((l,h)=>t.jsx(W,{className:"h-44"},h))}):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(ae,{conf:l,now:c,selectedDomains:o,onToggleDomain:d,onOpen:m},l.id))}),t.jsx(ne,{conf:s,open:s!==null,onOpenChange:l=>{l||m(null)}})]})};export{ue as default};
 
1
+ import{r as x,j as t}from"./index-B5X8-Bq7.js";import{u as A}from"./useQuery-D05r-Fqo.js";import{c as B}from"./catalog-Cpdj6dI_.js";import{S as U}from"./switch-_WgpuwTB.js";import{S as W}from"./skeleton-Ck9ioJnz.js";import{A as O,a as V}from"./alert-C4A_tmFK.js";import{s as z}from"./safeExternalHref-CkBrsh84.js";import{D as P,a as G,b as Y,c as H,d as K}from"./dialog-DQCWceSF.js";import"./index-DxIJV7Rp.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"]),Q=e=>e.trim().toLowerCase().replace(/\s+/g,"-"),D=e=>Array.from(new Set((e.tags??[]).map(Q).filter(a=>q.has(a)))),F=e=>new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),I=(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}`},M=e=>[...e.deadlines??[]].sort((a,n)=>new Date(a.deadline_at).getTime()-new Date(n.deadline_at).getTime()),T=(e,a)=>M(e).find(n=>new Date(n.deadline_at).getTime()>a)??null,L=e=>{const a=M(e);return a.length?a[a.length-1]:null},J=(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`},X=(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)"},Z=(e,a)=>{const n=Math.ceil((e-a)/b);return n<=0?"passed":`${n} ${n===1?"day":"days"}`},R=(e,a)=>{const n=I(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}/,""),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=`https://calendar.google.com/calendar/render?action=TEMPLATE&text=${encodeURIComponent(o)}&dates=${C(n)}/${C(r)}&details=${encodeURIComponent(R(e,a))}&location=${encodeURIComponent(i)}`,m=z(s);m&&window.open(m,"_blank","noopener,noreferrer")},te=(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
  `),m=new Blob([s],{type:"text/calendar;charset=utf-8"}),c=document.createElement("a");c.href=URL.createObjectURL(m),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)},ne=({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?M(e):[],[e]),s=x.useMemo(()=>e?T(e,r):null,[e,r]),m=e?I(e.start_date,e.end_date):null,c=e?e.venue||[e.city,e.country].filter(Boolean).join(", ")||e.location:null,u=s?new Date(s.deadline_at).getTime():null;return t.jsx(P,{open:a,onOpenChange:n,children:t.jsx(G,{className:"max-w-xl",style:{background:"var(--bg-elevated)",maxHeight:"85vh",overflowY:"auto"},children:e&&t.jsxs(t.Fragment,{children:[t.jsxs(Y,{children:[t.jsx(H,{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:[m&&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:m})]}),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})]})]}),u!=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:_(u,r)},children:X(u,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,p)=>{const y=new Date(d.deadline_at).getTime(),l=s!=null&&d.deadline_at===s.deadline_at&&d.type===s.type,h=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:h&&!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:_(h?null:y,r)},children:Z(y,r)})]},`${d.type??"deadline"}-${p}`)})]}),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:z(e.url)??void 0,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:()=>ee(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Google Calendar"}),t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>te(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Apple / .ics"})]})]})]})]})})})},E=({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(U,{id:e,checked:n,onCheckedChange:r}),t.jsx("label",{htmlFor:e,style:{cursor:"pointer"},children:a})]}),ae=({conf:e,now:a,selectedDomains:n,onToggleDomain:r,onOpen:o})=>{const i=T(e,a),s=i??L(e),m=s?new Date(s.deadline_at).getTime():null,c=_(i?m:null,a),u=I(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:p=>{(p.key==="Enter"||p.key===" ")&&(p.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:z(e.url)??void 0,target:"_blank",rel:"noopener noreferrer",onClick:p=>p.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:m!=null?J(m,a):"TBD"})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)"},children:[u&&t.jsx("span",{children:u}),d&&t.jsx("span",{children:d})]}),D(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:D(e).map(p=>{const y=n.has(p);return t.jsx("button",{className:"tag-chip",onClick:l=>{l.stopPropagation(),r(p)},style:{background:y?"var(--ink)":"var(--bg-subtle)",color:y?"var(--bg)":"var(--ink-soft)"},children:k(p)},p)})})]})},ue=()=>{const[e,a]=x.useState(!0),[n,r]=x.useState(!1),[o,i]=x.useState(new Set),[s,m]=x.useState(null),c=x.useMemo(()=>Date.now(),[]),u=A({queryKey:["conference-deadlines"],queryFn:()=>B.conferenceDeadlines(),staleTime:10*60*1e3}),d=l=>{i(h=>{const g=new Set(h);return g.has(l)?g.delete(l):g.add(l),g})},p=x.useMemo(()=>{var h;const l=new Map;return(h=u.data)==null||h.results.forEach(g=>{D(g).forEach(j=>l.set(j,(l.get(j)??0)+1))}),Array.from(l.entries()).sort((g,j)=>j[1]-g[1]).map(([g])=>g)},[u.data]),y=x.useMemo(()=>{var j;const h=(((j=u.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))),g=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[...h].sort((f,w)=>{const v=g(f),N=g(w);return v.group!==N.group?v.group-N.group:v.time-N.time})},[u.data,e,n,o,c]);return u.error?t.jsx("div",{className:"page",children:t.jsx(O,{variant:"destructive",children:t.jsx(V,{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(E,{id:"top-tier-only",label:"Top tier only",checked:e,onChange:a}),t.jsx(E,{id:"show-past",label:"Show past conferences",checked:n,onChange:r})]}),p.length>0&&t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:24},children:[p.map(l=>{const h=o.has(l);return t.jsx("button",{className:"tag-chip",onClick:()=>d(l),style:{background:h?"var(--ink)":"var(--bg-subtle)",color:h?"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:u.isLoading?"…":`${y.length} conferences`})}),u.isLoading?t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:Array.from({length:6}).map((l,h)=>t.jsx(W,{className:"h-44"},h))}):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(ae,{conf:l,now:c,selectedDomains:o,onToggleDomain:d,onOpen:m},l.id))}),t.jsx(ne,{conf:s,open:s!==null,onOpenChange:l=>{l||m(null)}})]})};export{ue as default};
assets/ArtifactWorkspace-B2_NF1H2.js DELETED
The diff for this file is too large to render. See raw diff
 
assets/ArtifactWorkspace-CTFG-tNc.js ADDED
The diff for this file is too large to render. See raw diff
 
assets/{AuthorDetailView-BYp1ulia.js → AuthorDetailView-B2PSyG8x.js} RENAMED
@@ -1 +1 @@
1
- import{c as m,j as e,L as x}from"./index-DpqMFKEJ.js";import{u as h}from"./useQuery-BRJ3D8WJ.js";import{p as d}from"./papers-inj3gJs3.js";import{S as c}from"./skeleton-BmlKdebV.js";import g from"./NotFound-C4Ku0WP3.js";const _=()=>{var i,l,n,o,u;const{authorId:a}=m(),r=h({queryKey:["author",a],queryFn:()=>d.getAuthor(a),enabled:!!a}),t=h({queryKey:["author-papers",a],queryFn:()=>d.authorPapers(a,{page:1,page_size:20}),enabled:!!a});return((i=r.error)==null?void 0:i.status)===404?e.jsx(g,{}):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(x,{to:`/paper/${p}`,children:s.title})},s.id)})})]})]})};export{_ as default};
 
1
+ import{c as m,j as e,L as x}from"./index-B5X8-Bq7.js";import{u as h}from"./useQuery-D05r-Fqo.js";import{p as d}from"./papers-D7y8njf2.js";import{S as c}from"./skeleton-Ck9ioJnz.js";import g from"./NotFound-BqqYiveq.js";const _=()=>{var i,l,n,o,u;const{authorId:a}=m(),r=h({queryKey:["author",a],queryFn:()=>d.getAuthor(a),enabled:!!a}),t=h({queryKey:["author-papers",a],queryFn:()=>d.authorPapers(a,{page:1,page_size:20}),enabled:!!a});return((i=r.error)==null?void 0:i.status)===404?e.jsx(g,{}):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(x,{to:`/paper/${p}`,children:s.title})},s.id)})})]})]})};export{_ as default};
assets/{BenchmarkDetailView-D5CM3bRL.js → BenchmarkDetailView-CS7Yz65e.js} RENAMED
@@ -1,2 +1,2 @@
1
- import{u as jt,r as w,j as n,s as ie,e as _t,c as kt,a as St,f as Ct,L as te}from"./index-DpqMFKEJ.js";import{u as Y}from"./useQuery-BRJ3D8WJ.js";import{c as re}from"./catalog-CNSpmU4d.js";import{C as Et,E as Nt,e as Rt}from"./ExternalSourceEvalBadge-7U9mCirI.js";import{S as be}from"./skeleton-BmlKdebV.js";import{S as Ze}from"./switch-m9rpNcU7.js";import{A as $t,a as Tt}from"./alert-C5eNYVhH.js";import{L as we}from"./LatexTitle-j9Bx8wiP.js";import{B as Ft}from"./BenchmarkTrendSparkline-DmwnJgng.js";import{I as Mt}from"./components-D8W6Owmv.js";import{s as Lt}from"./safeExternalHref-CkBrsh84.js";import{s as It}from"./slug-BpH-Nkvz.js";import"./papers-inj3gJs3.js";import"./hover-card-K79gJfh7.js";import"./index-CkejuWVZ.js";import"./katex.min-BSBacQyE.js";import"./transform-BG6M6eP3.js";function At(e,t,r){const s=t?(e??[]).filter(l=>l.task_id===t):e??[],a=s.filter(l=>l.is_open===!1),i=a.reduce((l,c)=>l?(c.best_rank??Number.POSITIVE_INFINITY)<(l.best_rank??Number.POSITIVE_INFINITY)?c:l:c,null);return{visible:r?s.filter(l=>l.is_open!==!1):s,hiddenClosed:a,topHiddenClosed:i}}function et(e){const t=e.length===7?`${e}-01`:e,r=new Date(t).getTime();return Number.isFinite(r)?r:0}const Ee=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ne(e){const t=new Date(e);return{year:t.getFullYear(),month:t.getMonth()}}function Pt(e,t){if(e===t){const{year:u,month:p}=Ne(e);return[{timestamp:new Date(u,p,1).getTime(),key:`${u}-${p}`,label:`${Ee[p]} ${u}`}]}const r=Ne(e),s=Ne(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?`${Ee[x]} ${r.year}`:Ee[x]});return y}const a=s.year-r.year+1;let i=1;const l=12;a>l&&(i=Math.ceil(a/l));const c=[];for(let u=r.year;u<=s.year;u+=i)c.push({timestamp:new Date(u,0,1).getTime(),key:String(u),label:String(u)});return c}const Dt=({points:e,metric:t})=>{const r=jt(),[s,a]=w.useState(null),i=880,l=320,c=60,u=30,p=40,f=50,y=e.map(o=>o.value),x=Math.min(...y),U=Math.max(...y)-x||1,le=i-c-u,I=l-p-f,T=e.map(o=>et(o.date)),K=Math.min(...T),A=Math.max(...T),ce=A-K||1,J=o=>K===A?c+le/2:c+(o-K)/ce*le,G=e.map((o,m)=>{const k=J(et(o.date)),v=(o.value-x)/U,F=p+I*(1-v);return{x:k,y:F,data:o,idx:m}}),R=G.filter(o=>o.data.isSota);let q="";if(R.length>=2){q=`M${R[0].x},${R[0].y}`;for(let o=1;o<R.length;o++){const m=R[o-1],k=R[o],v=(m.x+k.x)/2;q+=` C${v},${m.y} ${v},${k.y} ${k.x},${k.y}`}}const V=5.4,he=8,Z=9,B=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*V;let F=o.x-v/2,E=o.x+v/2,O="middle";return F<c?(F=c,E=c+v,O="start"):E>i-u&&(E=i-u,F=E-v,O="end"),{x:O==="start"?c:O==="end"?i-u:o.x,y:o.y-Z,text:k,anchor:O,left:F,right:E}},oe=[],b=R.length>0?B(R[R.length-1]):null;let ke=-1/0;for(let o=0;o<R.length-1;o++){const m=B(R[o]);m&&(m.left<ke+he||b&&m.right>b.left-he||(ke=m.right,oe.push({x:m.x,y:m.y,text:m.text,anchor:m.anchor})))}b&&oe.push({x:b.x,y:b.y,text:b.text,anchor:b.anchor});const Q=Pt(K,A),W=5,de=o=>a(m=>m===o?null:m),ue=o=>{o&&r(`/paper/${o}`)},fe=(o,m)=>{const v=`${o.data.modelName||o.data.paperTitle||"Unknown model"}: ${ie(o.data.value)} on ${o.data.dateLabel}`,F=!!o.data.paperRouteId;return n.jsxs("g",{children:[m,n.jsx("circle",{cx:o.x,cy:o.y,r:"10",fill:"transparent",style:{cursor:F?"pointer":"default",outline:"none"},tabIndex:0,role:F?"link":"img","aria-label":v,onMouseEnter:()=>a(o.idx),onMouseLeave:()=>de(o.idx),onFocus:()=>a(o.idx),onBlur:()=>de(o.idx),onClick:()=>ue(o.data.paperRouteId),onKeyDown:E=>{F&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),ue(o.data.paperRouteId))},children:n.jsx("title",{children:v})})]},o.idx)};return n.jsxs("svg",{width:"100%",viewBox:`0 0 ${i} ${l}`,style:{display:"block"},children:[n.jsx("text",{x:c-38,y:p+I/2,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"middle",transform:`rotate(-90 ${c-38} ${p+I/2})`,children:t}),Array.from({length:W}).map((o,m)=>{const k=m/(W-1),v=p+I*(1-k),F=x+U*k;return n.jsxs("g",{children:[n.jsx("line",{x1:c,y1:v,x2:i-u,y2:v,stroke:"var(--hairline)",strokeWidth:"1"}),n.jsx("text",{x:c-10,y:v+4,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"end",children:ie(F)})]},m)}),Q.map(o=>{const m=J(o.timestamp);return n.jsx("text",{x:m,y:l-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 fe(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"}}))}),q&&n.jsx("path",{d:q,stroke:"var(--accent)",strokeWidth:"2",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),R.map(o=>{const m=s===o.idx;return fe(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"}}))}),oe.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}: ${ie(o.data.value)}`,E=Math.max(120,Math.min(340,v.length*6.6+24)),O=30;let S=o.x-E/2;S<c&&(S=c),S+E>i-u&&(S=i-u-E);const j=o.y-O-14>=p?o.y-O-12:o.y+12;return n.jsxs("g",{pointerEvents:"none",children:[n.jsx("rect",{x:S,y:j,width:E,height:O,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:S+12,y:j+19,fontSize:"12",fontFamily:"var(--sans)",fill:"var(--ink)",fontWeight:500,children:v})]})})()]})};function Bt(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 Ht=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function z(e){const t=[];for(let r=0,s=e.length;r<s;r++)t.push(e[r]);return t}let se=null;function ut(e={}){return se||(e.includeStyleProperties?(se=e.includeStyleProperties,se):(se=z(window.getComputedStyle(document.documentElement)),se))}function ve(e,t){const s=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return s?parseFloat(s.replace("px","")):0}function Vt(e){const t=ve(e,"border-left-width"),r=ve(e,"border-right-width");return e.clientWidth+t+r}function Ot(e){const t=ve(e,"border-top-width"),r=ve(e,"border-bottom-width");return e.clientHeight+t+r}function mt(e,t={}){const r=t.width||Vt(e),s=t.height||Ot(e);return{width:r,height:s}}function qt(){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 H=16384;function Ut(e){(e.width>H||e.height>H)&&(e.width>H&&e.height>H?e.width>e.height?(e.height*=H/e.width,e.width=H):(e.width*=H/e.height,e.height=H):e.width>H?(e.height*=H/e.width,e.width=H):(e.width*=H/e.height,e.height=H))}function Wt(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 l=0;l<a;l+=1)i[l]=s.charCodeAt(l);r(new Blob([i],{type:t.type?t.type:"image/png"}))})}function je(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 zt(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Kt(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),zt(a)}const D=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||D(r,t)};function Gt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Qt(e,t){return ut(t).map(r=>{const s=e.getPropertyValue(r),a=e.getPropertyPriority(r);return`${r}: ${s}${a?" !important":""};`}).join(" ")}function Xt(e,t,r,s){const a=`.${e}:${t}`,i=r.cssText?Gt(r):Qt(r,s);return document.createTextNode(`${a}{${i}}`)}function tt(e,t,r,s){const a=window.getComputedStyle(e,r),i=a.getPropertyValue("content");if(i===""||i==="none")return;const l=Ht();try{t.className=`${t.className} ${l}`}catch{return}const c=document.createElement("style");c.appendChild(Xt(l,r,a,s)),t.appendChild(c)}function Yt(e,t,r){tt(e,t,":before",r),tt(e,t,":after",r)}const rt="application/font-woff",st="image/jpeg",Jt={woff:rt,woff2:rt,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:st,jpeg:st,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Zt(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function Fe(e){const t=Zt(e).toLowerCase();return Jt[t]||""}function er(e){return e.split(/,/)[1]}function $e(e){return e.search(/^(data:)/)!==-1}function tr(e,t){return`data:${t};base64,${e}`}async function ht(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,l)=>{const c=new FileReader;c.onerror=l,c.onloadend=()=>{try{i(r({res:s,result:c.result}))}catch(u){l(u)}},c.readAsDataURL(a)})}const Re={};function rr(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=rr(e,t,r.includeQueryParams);if(Re[s]!=null)return Re[s];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let a;try{const i=await ht(e,r.fetchRequestInit,({res:l,result:c})=>(t||(t=l.headers.get("Content-Type")||""),er(c)));a=tr(i,t)}catch(i){a=r.imagePlaceholder||"";let l=`Failed to fetch resource: ${e}`;i&&(l=typeof i=="string"?i:i.message),l&&console.warn(l)}return Re[s]=a,a}async function sr(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):je(t)}async function nr(e,t){if(e.currentSrc){const i=document.createElement("canvas"),l=i.getContext("2d");i.width=e.clientWidth,i.height=e.clientHeight,l==null||l.drawImage(e,0,0,i.width,i.height);const c=i.toDataURL();return je(c)}const r=e.poster,s=Fe(r),a=await Me(r,s,t);return je(a)}async function ar(e,t){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await _e(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function ir(e,t){return D(e,HTMLCanvasElement)?sr(e):D(e,HTMLVideoElement)?nr(e,t):D(e,HTMLIFrameElement)?ar(e,t):e.cloneNode(ft(e))}const lr=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",ft=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function cr(e,t,r){var s,a;if(ft(t))return t;let i=[];return lr(e)&&e.assignedNodes?i=z(e.assignedNodes()):D(e,HTMLIFrameElement)&&(!((s=e.contentDocument)===null||s===void 0)&&s.body)?i=z(e.contentDocument.body.childNodes):i=z(((a=e.shadowRoot)!==null&&a!==void 0?a:e).childNodes),i.length===0||D(e,HTMLVideoElement)||await i.reduce((l,c)=>l.then(()=>_e(c,r)).then(u=>{u&&t.appendChild(u)}),Promise.resolve()),t}function or(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):ut(r).forEach(i=>{let l=a.getPropertyValue(i);i==="font-size"&&l.endsWith("px")&&(l=`${Math.floor(parseFloat(l.substring(0,l.length-2)))-.1}px`),D(e,HTMLIFrameElement)&&i==="display"&&l==="inline"&&(l="block"),i==="d"&&t.getAttribute("d")&&(l=`path(${t.getAttribute("d")})`),s.setProperty(i,l,a.getPropertyPriority(i))})}function dr(e,t){D(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),D(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function ur(e,t){if(D(e,HTMLSelectElement)){const r=t,s=Array.from(r.children).find(a=>e.value===a.getAttribute("value"));s&&s.setAttribute("selected","")}}function mr(e,t,r){return D(t,Element)&&(or(e,t,r),Yt(e,t,r),dr(e,t),ur(e,t)),t}async function hr(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 c=r[i].getAttribute("xlink:href");if(c){const u=e.querySelector(c),p=document.querySelector(c);!u&&p&&!s[c]&&(s[c]=await _e(p,t,!0))}}const a=Object.values(s);if(a.length){const i="http://www.w3.org/1999/xhtml",l=document.createElementNS(i,"svg");l.setAttribute("xmlns",i),l.style.position="absolute",l.style.width="0",l.style.height="0",l.style.overflow="hidden",l.style.display="none";const c=document.createElementNS(i,"defs");l.appendChild(c);for(let u=0;u<a.length;u++)c.appendChild(a[u]);e.appendChild(l)}return e}async function _e(e,t,r){return!r&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(s=>ir(s,t)).then(s=>cr(e,s,t)).then(s=>mr(e,s,t)).then(s=>hr(s,t))}const pt=/url\((['"]?)([^'"]+?)\1\)/g,fr=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,pr=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function gr(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function xr(e){const t=[];return e.replace(pt,(r,s,a)=>(t.push(a),r)),t.filter(r=>!$e(r))}async function br(e,t,r,s,a){try{const i=r?Bt(t,r):t,l=Fe(t);let c;return a||(c=await Me(i,l,s)),e.replace(gr(t),`$1${c}$3`)}catch{}return e}function yr(e,{preferredFontFormat:t}){return t?e.replace(pr,r=>{for(;;){const[s,,a]=fr.exec(r)||[];if(!a)return"";if(a===t)return`src: ${s};`}}):e}function gt(e){return e.search(pt)!==-1}async function xt(e,t,r){if(!gt(e))return e;const s=yr(e,r);return xr(s).reduce((i,l)=>i.then(c=>br(c,l,t,r)),Promise.resolve(s))}async function ne(e,t,r){var s;const a=(s=t.style)===null||s===void 0?void 0:s.getPropertyValue(e);if(a){const i=await xt(a,null,r);return t.style.setProperty(e,i,t.style.getPropertyPriority(e)),!0}return!1}async function wr(e,t){await ne("background",e,t)||await ne("background-image",e,t),await ne("mask",e,t)||await ne("-webkit-mask",e,t)||await ne("mask-image",e,t)||await ne("-webkit-mask-image",e,t)}async function vr(e,t){const r=D(e,HTMLImageElement);if(!(r&&!$e(e.src))&&!(D(e,SVGImageElement)&&!$e(e.href.baseVal)))return;const s=r?e.src:e.href.baseVal,a=await Me(s,Fe(s),t);await new Promise((i,l)=>{e.onload=i,e.onerror=t.onImageErrorHandler?(...u)=>{try{i(t.onImageErrorHandler(...u))}catch(p){l(p)}}:l;const c=e;c.decode&&(c.decode=i),c.loading==="lazy"&&(c.loading="eager"),r?(e.srcset="",e.src=a):e.href.baseVal=a})}async function jr(e,t){const s=z(e.childNodes).map(a=>bt(a,t));await Promise.all(s).then(()=>e)}async function bt(e,t){D(e,Element)&&(await wr(e,t),await vr(e,t),await jr(e,t))}function _r(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 nt={};async function at(e){let t=nt[e];if(t!=null)return t;const s=await(await fetch(e)).text();return t={url:e,cssText:s},nt[e]=t,t}async function it(e,t){let r=e.cssText;const s=/url\(["']?([^"')]+)["']?\)/g,i=(r.match(/url\([^)]+\)/g)||[]).map(async l=>{let c=l.replace(s,"$1");return c.startsWith("https://")||(c=new URL(c,e.url).href),ht(c,t.fetchRequestInit,({result:u})=>(r=r.replace(l,`url(${u})`),[l,u]))});return Promise.all(i).then(()=>r)}function lt(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,l="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",c=new RegExp(l,"gi");for(;;){let u=i.exec(s);if(u===null){if(u=c.exec(s),u===null)break;i.lastIndex=c.lastIndex}else c.lastIndex=i.lastIndex;t.push(u[0])}return t}async function kr(e,t){const r=[],s=[];return e.forEach(a=>{if("cssRules"in a)try{z(a.cssRules||[]).forEach((i,l)=>{if(i.type===CSSRule.IMPORT_RULE){let c=l+1;const u=i.href,p=at(u).then(f=>it(f,t)).then(f=>lt(f).forEach(y=>{try{a.insertRule(y,y.startsWith("@import")?c+=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 l=e.find(c=>c.href==null)||document.styleSheets[0];a.href!=null&&s.push(at(a.href).then(c=>it(c,t)).then(c=>lt(c).forEach(u=>{l.insertRule(u,l.cssRules.length)})).catch(c=>{console.error("Error loading remote stylesheet",c)})),console.error("Error inlining remote css file",i)}}),Promise.all(s).then(()=>(e.forEach(a=>{if("cssRules"in a)try{z(a.cssRules||[]).forEach(i=>{r.push(i)})}catch(i){console.error(`Error while reading CSS rules from ${a.href}`,i)}}),r))}function Sr(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>gt(t.style.getPropertyValue("src")))}async function Cr(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=z(e.ownerDocument.styleSheets),s=await kr(r,t);return Sr(s)}function yt(e){return e.trim().replace(/["']/g,"")}function Er(e){const t=new Set;function r(s){(s.style.fontFamily||getComputedStyle(s).fontFamily).split(",").forEach(i=>{t.add(yt(i))}),Array.from(s.children).forEach(i=>{i instanceof HTMLElement&&r(i)})}return r(e),t}async function Nr(e,t){const r=await Cr(e,t),s=Er(e);return(await Promise.all(r.filter(i=>s.has(yt(i.style.fontFamily))).map(i=>{const l=i.parentStyleSheet?i.parentStyleSheet.href:null;return xt(i.cssText,l,t)}))).join(`
2
  `)}async function Rr(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Nr(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 $r(e,t={}){const{width:r,height:s}=mt(e,t),a=await _e(e,t,!0);return await Rr(a,t),await bt(a,t),_r(a,t),await Kt(a,r,s)}async function Tr(e,t={}){const{width:r,height:s}=mt(e,t),a=await $r(e,t),i=await je(a),l=document.createElement("canvas"),c=l.getContext("2d"),u=t.pixelRatio||qt(),p=t.canvasWidth||r,f=t.canvasHeight||s;return l.width=p*u,l.height=f*u,t.skipAutoScale||Ut(l),l.style.width=`${p}`,l.style.height=`${f}`,t.backgroundColor&&(c.fillStyle=t.backgroundColor,c.fillRect(0,0,l.width,l.height)),c.drawImage(i,0,0,l.width,l.height),l}async function Fr(e,t={}){const r=await Tr(e,t);return await Wt(r)}const Te="#ffffff";function Mr(){return typeof window>"u"?Te:window.getComputedStyle(document.documentElement).getPropertyValue("--bg-elevated").trim()||Te}function Lr(e){if(typeof window>"u")return Te;const t=window.getComputedStyle(e).backgroundColor;return!t||t==="rgba(0, 0, 0, 0)"||t==="transparent"?Mr():t}async function Ir(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 Fr(e,{pixelRatio:2,cacheBust:!0,backgroundColor:Lr(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}=_t(),[s,a]=w.useState("idle"),i=w.useRef(null);w.useEffect(()=>()=>{i.current!==null&&window.clearTimeout(i.current)},[]);const l=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 Ir(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]),c=s==="copied"?"Copied":s==="copying"?"Copying…":"Copy image";return n.jsxs("button",{type:"button",className:"bm-copy-btn",onClick:l,disabled:s==="copying","aria-label":`Copy ${t} screenshot to clipboard`,title:`Copy ${t} screenshot to clipboard`,children:[n.jsx(Mt,{name:"copy",size:11}),c]})};function ae(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 Ar(e){return[e.paper_id,e.task_id,e.dataset_id,e.model_name,e.harness??""].join("|")}function Pr(e){const t=new Map;for(const r of e){const s=Ar(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 ot(e,t){return t?e.id===t||e.sourceEvaluationIds.includes(t):!1}function dt(e,t){return e.ranksByMetric[t]??e.best_rank??9999}function Dr(e,t,r){if(e.length===0)return{points:[],sota:0,sotaModel:""};const s=e.map(f=>{var N;const y=ae((N=f.metrics)==null?void 0:N[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 c=e.map(f=>{var y;return{eval:f,value:ae((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=(c==null?void 0:c.value)??0,p=(c==null?void 0:c.eval.model_name)||(c==null?void 0:c.eval.paper_title)||"";return{points:a,sota:u,sotaModel:p}}const Br=5;function Hr(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 ye(e,t){return e?n.jsx(we,{title:e}):t||"—"}const ns=()=>{var Ie,Ae,Pe,De,Be,He,Ve,Oe,qe,Ue,We,ze,Ke;const{datasetSlug:e}=kt(),[t]=St(),r=t.get("task")||void 0,s=t.get("eval")||void 0,{preferences:a,setHideClosedSourceEvals:i}=Ct(),[l,c]=w.useState(void 0),u=w.useRef(null),p=w.useRef(!1),f=w.useRef(null),y=w.useRef(null),x=Y({queryKey:["dataset",e,"with-paper",r,a.hide_closed_source_evals?"open":"all"],queryFn:()=>re.getDatasetBySlug(e,{include_paper:!0,task:r,is_open:a.hide_closed_source_evals?!0:void 0}),enabled:!!e,staleTime:10*60*1e3}),N=Y({queryKey:["dataset-evals",(Ie=x.data)==null?void 0:Ie.id],queryFn:()=>Rt.byDataset(x.data.id),enabled:!!((Ae=x.data)!=null&&Ae.id),staleTime:5*60*1e3}),U=Y({queryKey:["dataset-tasks",(Pe=x.data)==null?void 0:Pe.id],queryFn:()=>re.datasetTasks(x.data.id),enabled:!!((De=x.data)!=null&&De.id),staleTime:10*60*1e3}),le=Y({queryKey:["metric-directions"],queryFn:()=>re.metricDirections(),staleTime:60*60*1e3}),I=w.useMemo(()=>{var d;return!s||!((d=N.data)!=null&&d.length)?null:N.data.find(g=>g.id===s)||null},[s,N.data]),T=w.useMemo(()=>{const d=U.data||[];if(d.length===0)return null;if(I!=null&&I.task_id&&d.some(h=>h.id===I.task_id))return I.task_id;if(r){const h=d.find(C=>C.slug===r);if(h)return h.id}if(d.length===1)return d[0].id;const g=N.data||[];if(g.length>0){const h=new Map;for(const _ of g)h.set(_.task_id,(h.get(_.task_id)||0)+1);let C=null,L=-1;for(const _ of d){const P=h.get(_.id)||0;P>L&&(L=P,C=_.id)}if(C)return C}return d[0].id},[U.data,N.data,r,I]),K=Y({queryKey:["task-benchmark-trends",T,a.hide_closed_source_evals?!0:void 0],queryFn:()=>re.trendingBenchmarks(T,{limit:100,min_recent_papers:0,is_open:a.hide_closed_source_evals?!0:void 0}),enabled:!!T&&!!((Be=x.data)!=null&&Be.id),staleTime:10*60*1e3}),A=w.useMemo(()=>{var d;return(((d=K.data)==null?void 0:d.results)||[]).find(g=>{var h;return g.id===((h=x.data)==null?void 0:h.id)})||null},[K.data,(He=x.data)==null?void 0:He.id]),ce=Y({queryKey:["leaderboard-metrics",(Ve=x.data)==null?void 0:Ve.id,T],queryFn:()=>re.leaderboardMetrics(x.data.id,T),enabled:!!((Oe=x.data)!=null&&Oe.id)&&!!T,staleTime:10*60*1e3}),J=w.useMemo(()=>At(N.data,T,a.hide_closed_source_evals),[N.data,T,a.hide_closed_source_evals]),G=J.visible,R=J.hiddenClosed,q=J.topHiddenClosed,V=w.useMemo(()=>Pr(G),[G]),he=w.useMemo(()=>{const d=new Set;return V.forEach(g=>{g.best_metric&&d.add(g.best_metric),Object.keys(g.metrics||{}).forEach(h=>d.add(h))}),Array.from(d)},[V]),Z=w.useMemo(()=>(ce.data||[]).map(d=>d.metric_name),[ce.data]),B=Z.length?Z:he,oe=w.useMemo(()=>{var C,L;if(V.length===0)return B[0]||"";const d=new Map;for(const _ of V){const P=_.best_metric;!P||ae((C=_.metrics)==null?void 0:C[P])===null||Z.length&&!B.includes(P)||d.set(P,(d.get(P)||0)+1)}let g=null,h=0;for(const[_,P]of d)P>h&&(h=P,g=_);return g||B[0]||((L=V[0])==null?void 0:L.best_metric)||""},[V,B,Z]),b=l||(I==null?void 0:I.best_metric)||oe,Q=(((Ue=(qe=le.data)==null?void 0:qe.directions)==null?void 0:Ue[b])||"higher_is_better")==="lower_is_better"?"↓":"↑",W=w.useMemo(()=>!b||!B.includes(b)?B:[b,...B.filter(d=>d!==b)],[B,b]),de=w.useMemo(()=>W.length===0?b?[b]:[]:W.slice(0,Br),[W,b]),{points:ue,sota:fe,sotaModel:o}=w.useMemo(()=>Dr(V,b,Q),[V,b,Q]),m=(We=x.data)==null?void 0:We.leaderboard_summary,k=N.isSuccess&&U.isSuccess&&le.isSuccess&&(!T||ce.isSuccess),v=k?b:m==null?void 0:m.metric,F=k?fe:m==null?void 0:m.value,E=k?o:m==null?void 0:m.model_name,O=!k&&!m;w.useEffect(()=>{if(p.current||!s||!N.data||N.data.length===0)return;const d=u.current;d&&(p.current=!0,d.scrollIntoView({behavior:"smooth",block:"start"}))},[s,N.data]);const S=w.useMemo(()=>{const d=U.data||[];return T?d.find(g=>g.id===T)||d[0]||null:d[0]||null},[U.data,T]),pe=Y({queryKey:["area",S==null?void 0:S.area_id],queryFn:()=>re.getArea(S.area_id),enabled:!!(S!=null&&S.area_id),staleTime:10*60*1e3});if(x.isLoading)return n.jsxs("div",{className:"page",children:[n.jsx(be,{className:"h-12 w-1/2 mb-6"}),n.jsx(be,{className:"h-64 w-full"})]});if(x.error||!x.data)return n.jsx("div",{className:"page",children:n.jsx($t,{variant:"destructive",children:n.jsx(Tt,{children:"Benchmark not found."})})});const j=x.data,ge=V.slice().sort((d,g)=>{var L,_;const h=ae((L=d.metrics)==null?void 0:L[b]),C=ae((_=g.metrics)==null?void 0:_[b]);return h!==null&&C!==null?Q==="↓"?h-C:C-h:h!==null?-1:C!==null?1:dt(d,b)-dt(g,b)}),Le=!!j.supports_harness,$=s&&ge.find(d=>ot(d,s))||null,M=j.introducing_paper??void 0,me=(M==null?void 0:M.arxiv_id)||(M==null?void 0:M.id)||Hr(j.paper_url),X=(M==null?void 0:M.title)||j.introducing_paper_title||null,ee=((ze=M==null?void 0:M.published)==null?void 0:ze.slice(0,4))||j.introduced_year||null,wt=!!me||!!j.paper_url||!!X,vt=M!=null&&M.arxiv_id||(Ke=j.paper_url)!=null&&Ke.match(/^https?:\/\/(?:www\.)?arxiv\.org\//i)?`arXiv:${me}`:`Paper ${me}`;return n.jsx("div",{className:"page",children:n.jsxs("div",{className:"bm-page",children:[n.jsxs("div",{className:"breadcrumb",children:[n.jsx(te,{to:"/tasks",children:"Tasks"}),pe.data&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"sep",children:"/"}),n.jsx(te,{to:`/tasks#area-${It(pe.data.name)}`,children:pe.data.name})]}),S&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"sep",children:"/"}),n.jsx(te,{to:`/tasks/${S.slug||S.id}`,children:S.name})]}),n.jsx("span",{className:"sep",children:"/"}),n.jsx("span",{style:{color:"var(--accent-text)"},children:j.name})]}),n.jsxs("div",{className:"bm-title-row",children:[n.jsx("h1",{className:"bm-title",children:j.name}),A&&n.jsxs("div",{className:"bm-title-trend","aria-label":`${j.name} reporting trend`,children:[n.jsx(Ft,{history:A.history,benchmarkName:A.name}),n.jsxs("span",{className:"bm-title-trend-summary",children:[n.jsx("strong",{children:A.recent_paper_count})," ",A.recent_paper_count===1?"paper":"papers",A.rate_change==null?A.recent_paper_count>0&&n.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):n.jsxs("span",{className:`benchmark-trend-change ${A.rate_change>=1?"is-up":"is-down"}`,children:[A.rate_change>=1?"↑":"↓"," ",A.rate_change.toFixed(1),"×"]})]})]})]}),n.jsxs("div",{className:"bm-subtitle",children:[O?n.jsx(be,{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:"·"})]}),E?n.jsxs("span",{children:["Best: ",n.jsx("span",{className:"best-name",children:ie(F)})," by ",n.jsx("span",{className:"best-name",style:{fontStyle:"normal"},children:E})]}):n.jsxs("span",{children:[ge.length," evaluations"]})]}),j.hf_url&&n.jsxs("a",{className:"bm-action-btn",href:j.hf_url,target:"_blank",rel:"noopener noreferrer",children:[n.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),j.description&&n.jsx("p",{className:"bm-description",children:j.description}),a.hide_closed_source_evals&&R.length>0&&n.jsxs("div",{className:"bm-hidden-closed-notice",children:[n.jsxs("span",{children:[R.length," closed-source ",R.length===1?"row is":"rows are"," hidden",q!=null&&q.model_name?n.jsxs(n.Fragment,{children:[", including ",n.jsx("strong",{children:q.model_name})]}):null,"."]}),n.jsx("button",{type:"button",className:"bm-hidden-closed-action",onClick:()=>{i(!1)},children:"Show closed-source"})]}),wt&&n.jsxs("div",{className:"method-source",style:{marginTop:0,marginBottom:18},children:[n.jsx("span",{className:"method-source-label",children:"Source"}),me?n.jsxs(te,{to:`/paper/${me}`,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(we,{title:X}):vt}),ee&&n.jsx("span",{className:"method-source-meta",children:ee})]}):j.paper_url?n.jsxs("a",{href:Lt(j.paper_url)??void 0,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(we,{title:X}):j.paper_url}),ee&&n.jsx("span",{className:"method-source-meta",children:ee})]}):n.jsxs("div",{className:"method-source-link is-static",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(we,{title:X}):null}),ee&&n.jsx("span",{className:"method-source-meta",children:ee})]})]}),ue.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:j.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:[B.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=>c(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(Ze,{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(Dt,{points:ue,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"]})]}),$&&(()=>{var L,_;const d=$.paper_arxiv_id||$.paper_id,g=$.paper_title||($.paper_arxiv_id?`arXiv:${$.paper_arxiv_id}`:null),h=$.best_metric&&((L=$.metrics)==null?void 0:L[$.best_metric])!==void 0?$.best_metric:b,C=(_=$.metrics)==null?void 0:_[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:[$.model_name||g||"—",$.harness?` · ${$.harness}`:""]}),n.jsxs("span",{className:"bm-highlight-meta",children:[C!==void 0&&h?n.jsxs(n.Fragment,{children:[h,": ",ie(C),g?" · ":""]}):null,d?n.jsx(te,{to:`/paper/${d}`,children:ye($.paper_title,g)}):ye($.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:j.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:[B.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=>c(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(Ze,{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"})]})]}),N.isLoading?n.jsx("div",{style:{padding:16},children:Array.from({length:5}).map((d,g)=>n.jsx(be,{className:"h-10 w-full mb-2"},g))}):ge.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"}),Le&&n.jsx("th",{className:"col-harness",children:"Harness"}),de.map(d=>{const g=d===b;return n.jsx("th",{className:`col-value ${g?"is-active":""}`,"aria-sort":g?Q==="↓"?"ascending":"descending":"none",children:n.jsxs("button",{type:"button",className:"bm-metric-header",onClick:()=>c(d),"aria-pressed":g,title:`Sort by ${d}`,children:[d,g?` ${Q}`:""]})},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 ge.map((h,C)=>{var Qe,Xe;const L=ae((Qe=h.metrics)==null?void 0:Qe[b]);let _=null;L!==null&&((d===null||L!==d)&&(g=C+1,d=L),_=g);const P=h.paper_arxiv_id||h.paper_id,Ge=h.paper_title||(h.paper_arxiv_id?`arXiv:${h.paper_arxiv_id}`:null),Se=ot(h,s);return n.jsxs("tr",{ref:Se?u:void 0,className:Se?"is-highlighted":void 0,children:[n.jsx("td",{className:"col-rank",children:_??"—"}),n.jsxs("td",{className:"col-model",children:[Se&&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(Et,{}),(h.external??h.is_external)&&n.jsx(Nt,{sourceUrl:h.source_url||h.external_source_url||h.result_url})]}),Le&&n.jsx("td",{className:"col-harness",children:h.harness||"—"}),de.map(Ce=>{var Je;const Ye=Ce===b,xe=(Je=h.metrics)==null?void 0:Je[Ce];return n.jsx("td",{className:`col-value${Ye?" is-active":""}${Ye&&_===1?" is-best":""}`,children:xe!=null&&xe!==""?ie(xe):"—"},Ce)}),n.jsx("td",{className:"col-paper",children:P?n.jsx(te,{to:`/paper/${P}`,children:ye(h.paper_title,Ge)}):ye(h.paper_title,Ge)}),n.jsx("td",{className:"col-year",children:((Xe=h.paper_published_date)==null?void 0:Xe.slice(0,4))||"—"})]},h.id)})})()})]})})]})]})})};export{ns as default};
 
1
+ import{u as jt,r as w,j as n,s as ie,e as _t,c as kt,a as St,f as Ct,L as te}from"./index-B5X8-Bq7.js";import{u as Y}from"./useQuery-D05r-Fqo.js";import{c as re}from"./catalog-Cpdj6dI_.js";import{C as Et,E as Nt,e as Rt}from"./ExternalSourceEvalBadge-BL5qKVgu.js";import{S as be}from"./skeleton-Ck9ioJnz.js";import{S as Ze}from"./switch-_WgpuwTB.js";import{A as $t,a as Tt}from"./alert-C4A_tmFK.js";import{L as we}from"./LatexTitle-BQ-aqYJn.js";import{B as Ft}from"./BenchmarkTrendSparkline-iEoRSHN4.js";import{I as Mt}from"./components-BYijBjrn.js";import{s as Lt}from"./safeExternalHref-CkBrsh84.js";import{s as It}from"./slug-BpH-Nkvz.js";import"./papers-D7y8njf2.js";import"./hover-card-ClPcsbgj.js";import"./index-DxIJV7Rp.js";import"./katex.min-BSBacQyE.js";import"./transform-Ce1Ycrlu.js";function At(e,t,r){const s=t?(e??[]).filter(l=>l.task_id===t):e??[],a=s.filter(l=>l.is_open===!1),i=a.reduce((l,c)=>l?(c.best_rank??Number.POSITIVE_INFINITY)<(l.best_rank??Number.POSITIVE_INFINITY)?c:l:c,null);return{visible:r?s.filter(l=>l.is_open!==!1):s,hiddenClosed:a,topHiddenClosed:i}}function et(e){const t=e.length===7?`${e}-01`:e,r=new Date(t).getTime();return Number.isFinite(r)?r:0}const Ee=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ne(e){const t=new Date(e);return{year:t.getFullYear(),month:t.getMonth()}}function Pt(e,t){if(e===t){const{year:u,month:p}=Ne(e);return[{timestamp:new Date(u,p,1).getTime(),key:`${u}-${p}`,label:`${Ee[p]} ${u}`}]}const r=Ne(e),s=Ne(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?`${Ee[x]} ${r.year}`:Ee[x]});return y}const a=s.year-r.year+1;let i=1;const l=12;a>l&&(i=Math.ceil(a/l));const c=[];for(let u=r.year;u<=s.year;u+=i)c.push({timestamp:new Date(u,0,1).getTime(),key:String(u),label:String(u)});return c}const Dt=({points:e,metric:t})=>{const r=jt(),[s,a]=w.useState(null),i=880,l=320,c=60,u=30,p=40,f=50,y=e.map(o=>o.value),x=Math.min(...y),U=Math.max(...y)-x||1,le=i-c-u,I=l-p-f,T=e.map(o=>et(o.date)),K=Math.min(...T),A=Math.max(...T),ce=A-K||1,J=o=>K===A?c+le/2:c+(o-K)/ce*le,G=e.map((o,m)=>{const k=J(et(o.date)),v=(o.value-x)/U,F=p+I*(1-v);return{x:k,y:F,data:o,idx:m}}),R=G.filter(o=>o.data.isSota);let q="";if(R.length>=2){q=`M${R[0].x},${R[0].y}`;for(let o=1;o<R.length;o++){const m=R[o-1],k=R[o],v=(m.x+k.x)/2;q+=` C${v},${m.y} ${v},${k.y} ${k.x},${k.y}`}}const V=5.4,he=8,Z=9,B=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*V;let F=o.x-v/2,E=o.x+v/2,O="middle";return F<c?(F=c,E=c+v,O="start"):E>i-u&&(E=i-u,F=E-v,O="end"),{x:O==="start"?c:O==="end"?i-u:o.x,y:o.y-Z,text:k,anchor:O,left:F,right:E}},oe=[],b=R.length>0?B(R[R.length-1]):null;let ke=-1/0;for(let o=0;o<R.length-1;o++){const m=B(R[o]);m&&(m.left<ke+he||b&&m.right>b.left-he||(ke=m.right,oe.push({x:m.x,y:m.y,text:m.text,anchor:m.anchor})))}b&&oe.push({x:b.x,y:b.y,text:b.text,anchor:b.anchor});const Q=Pt(K,A),W=5,de=o=>a(m=>m===o?null:m),ue=o=>{o&&r(`/paper/${o}`)},fe=(o,m)=>{const v=`${o.data.modelName||o.data.paperTitle||"Unknown model"}: ${ie(o.data.value)} on ${o.data.dateLabel}`,F=!!o.data.paperRouteId;return n.jsxs("g",{children:[m,n.jsx("circle",{cx:o.x,cy:o.y,r:"10",fill:"transparent",style:{cursor:F?"pointer":"default",outline:"none"},tabIndex:0,role:F?"link":"img","aria-label":v,onMouseEnter:()=>a(o.idx),onMouseLeave:()=>de(o.idx),onFocus:()=>a(o.idx),onBlur:()=>de(o.idx),onClick:()=>ue(o.data.paperRouteId),onKeyDown:E=>{F&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),ue(o.data.paperRouteId))},children:n.jsx("title",{children:v})})]},o.idx)};return n.jsxs("svg",{width:"100%",viewBox:`0 0 ${i} ${l}`,style:{display:"block"},children:[n.jsx("text",{x:c-38,y:p+I/2,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"middle",transform:`rotate(-90 ${c-38} ${p+I/2})`,children:t}),Array.from({length:W}).map((o,m)=>{const k=m/(W-1),v=p+I*(1-k),F=x+U*k;return n.jsxs("g",{children:[n.jsx("line",{x1:c,y1:v,x2:i-u,y2:v,stroke:"var(--hairline)",strokeWidth:"1"}),n.jsx("text",{x:c-10,y:v+4,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"end",children:ie(F)})]},m)}),Q.map(o=>{const m=J(o.timestamp);return n.jsx("text",{x:m,y:l-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 fe(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"}}))}),q&&n.jsx("path",{d:q,stroke:"var(--accent)",strokeWidth:"2",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),R.map(o=>{const m=s===o.idx;return fe(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"}}))}),oe.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}: ${ie(o.data.value)}`,E=Math.max(120,Math.min(340,v.length*6.6+24)),O=30;let S=o.x-E/2;S<c&&(S=c),S+E>i-u&&(S=i-u-E);const j=o.y-O-14>=p?o.y-O-12:o.y+12;return n.jsxs("g",{pointerEvents:"none",children:[n.jsx("rect",{x:S,y:j,width:E,height:O,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:S+12,y:j+19,fontSize:"12",fontFamily:"var(--sans)",fill:"var(--ink)",fontWeight:500,children:v})]})})()]})};function Bt(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 Ht=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function z(e){const t=[];for(let r=0,s=e.length;r<s;r++)t.push(e[r]);return t}let se=null;function ut(e={}){return se||(e.includeStyleProperties?(se=e.includeStyleProperties,se):(se=z(window.getComputedStyle(document.documentElement)),se))}function ve(e,t){const s=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return s?parseFloat(s.replace("px","")):0}function Vt(e){const t=ve(e,"border-left-width"),r=ve(e,"border-right-width");return e.clientWidth+t+r}function Ot(e){const t=ve(e,"border-top-width"),r=ve(e,"border-bottom-width");return e.clientHeight+t+r}function mt(e,t={}){const r=t.width||Vt(e),s=t.height||Ot(e);return{width:r,height:s}}function qt(){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 H=16384;function Ut(e){(e.width>H||e.height>H)&&(e.width>H&&e.height>H?e.width>e.height?(e.height*=H/e.width,e.width=H):(e.width*=H/e.height,e.height=H):e.width>H?(e.height*=H/e.width,e.width=H):(e.width*=H/e.height,e.height=H))}function Wt(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 l=0;l<a;l+=1)i[l]=s.charCodeAt(l);r(new Blob([i],{type:t.type?t.type:"image/png"}))})}function je(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 zt(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Kt(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),zt(a)}const D=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||D(r,t)};function Gt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Qt(e,t){return ut(t).map(r=>{const s=e.getPropertyValue(r),a=e.getPropertyPriority(r);return`${r}: ${s}${a?" !important":""};`}).join(" ")}function Xt(e,t,r,s){const a=`.${e}:${t}`,i=r.cssText?Gt(r):Qt(r,s);return document.createTextNode(`${a}{${i}}`)}function tt(e,t,r,s){const a=window.getComputedStyle(e,r),i=a.getPropertyValue("content");if(i===""||i==="none")return;const l=Ht();try{t.className=`${t.className} ${l}`}catch{return}const c=document.createElement("style");c.appendChild(Xt(l,r,a,s)),t.appendChild(c)}function Yt(e,t,r){tt(e,t,":before",r),tt(e,t,":after",r)}const rt="application/font-woff",st="image/jpeg",Jt={woff:rt,woff2:rt,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:st,jpeg:st,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Zt(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function Fe(e){const t=Zt(e).toLowerCase();return Jt[t]||""}function er(e){return e.split(/,/)[1]}function $e(e){return e.search(/^(data:)/)!==-1}function tr(e,t){return`data:${t};base64,${e}`}async function ht(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,l)=>{const c=new FileReader;c.onerror=l,c.onloadend=()=>{try{i(r({res:s,result:c.result}))}catch(u){l(u)}},c.readAsDataURL(a)})}const Re={};function rr(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=rr(e,t,r.includeQueryParams);if(Re[s]!=null)return Re[s];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let a;try{const i=await ht(e,r.fetchRequestInit,({res:l,result:c})=>(t||(t=l.headers.get("Content-Type")||""),er(c)));a=tr(i,t)}catch(i){a=r.imagePlaceholder||"";let l=`Failed to fetch resource: ${e}`;i&&(l=typeof i=="string"?i:i.message),l&&console.warn(l)}return Re[s]=a,a}async function sr(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):je(t)}async function nr(e,t){if(e.currentSrc){const i=document.createElement("canvas"),l=i.getContext("2d");i.width=e.clientWidth,i.height=e.clientHeight,l==null||l.drawImage(e,0,0,i.width,i.height);const c=i.toDataURL();return je(c)}const r=e.poster,s=Fe(r),a=await Me(r,s,t);return je(a)}async function ar(e,t){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await _e(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function ir(e,t){return D(e,HTMLCanvasElement)?sr(e):D(e,HTMLVideoElement)?nr(e,t):D(e,HTMLIFrameElement)?ar(e,t):e.cloneNode(ft(e))}const lr=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",ft=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function cr(e,t,r){var s,a;if(ft(t))return t;let i=[];return lr(e)&&e.assignedNodes?i=z(e.assignedNodes()):D(e,HTMLIFrameElement)&&(!((s=e.contentDocument)===null||s===void 0)&&s.body)?i=z(e.contentDocument.body.childNodes):i=z(((a=e.shadowRoot)!==null&&a!==void 0?a:e).childNodes),i.length===0||D(e,HTMLVideoElement)||await i.reduce((l,c)=>l.then(()=>_e(c,r)).then(u=>{u&&t.appendChild(u)}),Promise.resolve()),t}function or(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):ut(r).forEach(i=>{let l=a.getPropertyValue(i);i==="font-size"&&l.endsWith("px")&&(l=`${Math.floor(parseFloat(l.substring(0,l.length-2)))-.1}px`),D(e,HTMLIFrameElement)&&i==="display"&&l==="inline"&&(l="block"),i==="d"&&t.getAttribute("d")&&(l=`path(${t.getAttribute("d")})`),s.setProperty(i,l,a.getPropertyPriority(i))})}function dr(e,t){D(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),D(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function ur(e,t){if(D(e,HTMLSelectElement)){const r=t,s=Array.from(r.children).find(a=>e.value===a.getAttribute("value"));s&&s.setAttribute("selected","")}}function mr(e,t,r){return D(t,Element)&&(or(e,t,r),Yt(e,t,r),dr(e,t),ur(e,t)),t}async function hr(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 c=r[i].getAttribute("xlink:href");if(c){const u=e.querySelector(c),p=document.querySelector(c);!u&&p&&!s[c]&&(s[c]=await _e(p,t,!0))}}const a=Object.values(s);if(a.length){const i="http://www.w3.org/1999/xhtml",l=document.createElementNS(i,"svg");l.setAttribute("xmlns",i),l.style.position="absolute",l.style.width="0",l.style.height="0",l.style.overflow="hidden",l.style.display="none";const c=document.createElementNS(i,"defs");l.appendChild(c);for(let u=0;u<a.length;u++)c.appendChild(a[u]);e.appendChild(l)}return e}async function _e(e,t,r){return!r&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(s=>ir(s,t)).then(s=>cr(e,s,t)).then(s=>mr(e,s,t)).then(s=>hr(s,t))}const pt=/url\((['"]?)([^'"]+?)\1\)/g,fr=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,pr=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function gr(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function xr(e){const t=[];return e.replace(pt,(r,s,a)=>(t.push(a),r)),t.filter(r=>!$e(r))}async function br(e,t,r,s,a){try{const i=r?Bt(t,r):t,l=Fe(t);let c;return a||(c=await Me(i,l,s)),e.replace(gr(t),`$1${c}$3`)}catch{}return e}function yr(e,{preferredFontFormat:t}){return t?e.replace(pr,r=>{for(;;){const[s,,a]=fr.exec(r)||[];if(!a)return"";if(a===t)return`src: ${s};`}}):e}function gt(e){return e.search(pt)!==-1}async function xt(e,t,r){if(!gt(e))return e;const s=yr(e,r);return xr(s).reduce((i,l)=>i.then(c=>br(c,l,t,r)),Promise.resolve(s))}async function ne(e,t,r){var s;const a=(s=t.style)===null||s===void 0?void 0:s.getPropertyValue(e);if(a){const i=await xt(a,null,r);return t.style.setProperty(e,i,t.style.getPropertyPriority(e)),!0}return!1}async function wr(e,t){await ne("background",e,t)||await ne("background-image",e,t),await ne("mask",e,t)||await ne("-webkit-mask",e,t)||await ne("mask-image",e,t)||await ne("-webkit-mask-image",e,t)}async function vr(e,t){const r=D(e,HTMLImageElement);if(!(r&&!$e(e.src))&&!(D(e,SVGImageElement)&&!$e(e.href.baseVal)))return;const s=r?e.src:e.href.baseVal,a=await Me(s,Fe(s),t);await new Promise((i,l)=>{e.onload=i,e.onerror=t.onImageErrorHandler?(...u)=>{try{i(t.onImageErrorHandler(...u))}catch(p){l(p)}}:l;const c=e;c.decode&&(c.decode=i),c.loading==="lazy"&&(c.loading="eager"),r?(e.srcset="",e.src=a):e.href.baseVal=a})}async function jr(e,t){const s=z(e.childNodes).map(a=>bt(a,t));await Promise.all(s).then(()=>e)}async function bt(e,t){D(e,Element)&&(await wr(e,t),await vr(e,t),await jr(e,t))}function _r(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 nt={};async function at(e){let t=nt[e];if(t!=null)return t;const s=await(await fetch(e)).text();return t={url:e,cssText:s},nt[e]=t,t}async function it(e,t){let r=e.cssText;const s=/url\(["']?([^"')]+)["']?\)/g,i=(r.match(/url\([^)]+\)/g)||[]).map(async l=>{let c=l.replace(s,"$1");return c.startsWith("https://")||(c=new URL(c,e.url).href),ht(c,t.fetchRequestInit,({result:u})=>(r=r.replace(l,`url(${u})`),[l,u]))});return Promise.all(i).then(()=>r)}function lt(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,l="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",c=new RegExp(l,"gi");for(;;){let u=i.exec(s);if(u===null){if(u=c.exec(s),u===null)break;i.lastIndex=c.lastIndex}else c.lastIndex=i.lastIndex;t.push(u[0])}return t}async function kr(e,t){const r=[],s=[];return e.forEach(a=>{if("cssRules"in a)try{z(a.cssRules||[]).forEach((i,l)=>{if(i.type===CSSRule.IMPORT_RULE){let c=l+1;const u=i.href,p=at(u).then(f=>it(f,t)).then(f=>lt(f).forEach(y=>{try{a.insertRule(y,y.startsWith("@import")?c+=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 l=e.find(c=>c.href==null)||document.styleSheets[0];a.href!=null&&s.push(at(a.href).then(c=>it(c,t)).then(c=>lt(c).forEach(u=>{l.insertRule(u,l.cssRules.length)})).catch(c=>{console.error("Error loading remote stylesheet",c)})),console.error("Error inlining remote css file",i)}}),Promise.all(s).then(()=>(e.forEach(a=>{if("cssRules"in a)try{z(a.cssRules||[]).forEach(i=>{r.push(i)})}catch(i){console.error(`Error while reading CSS rules from ${a.href}`,i)}}),r))}function Sr(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>gt(t.style.getPropertyValue("src")))}async function Cr(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=z(e.ownerDocument.styleSheets),s=await kr(r,t);return Sr(s)}function yt(e){return e.trim().replace(/["']/g,"")}function Er(e){const t=new Set;function r(s){(s.style.fontFamily||getComputedStyle(s).fontFamily).split(",").forEach(i=>{t.add(yt(i))}),Array.from(s.children).forEach(i=>{i instanceof HTMLElement&&r(i)})}return r(e),t}async function Nr(e,t){const r=await Cr(e,t),s=Er(e);return(await Promise.all(r.filter(i=>s.has(yt(i.style.fontFamily))).map(i=>{const l=i.parentStyleSheet?i.parentStyleSheet.href:null;return xt(i.cssText,l,t)}))).join(`
2
  `)}async function Rr(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Nr(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 $r(e,t={}){const{width:r,height:s}=mt(e,t),a=await _e(e,t,!0);return await Rr(a,t),await bt(a,t),_r(a,t),await Kt(a,r,s)}async function Tr(e,t={}){const{width:r,height:s}=mt(e,t),a=await $r(e,t),i=await je(a),l=document.createElement("canvas"),c=l.getContext("2d"),u=t.pixelRatio||qt(),p=t.canvasWidth||r,f=t.canvasHeight||s;return l.width=p*u,l.height=f*u,t.skipAutoScale||Ut(l),l.style.width=`${p}`,l.style.height=`${f}`,t.backgroundColor&&(c.fillStyle=t.backgroundColor,c.fillRect(0,0,l.width,l.height)),c.drawImage(i,0,0,l.width,l.height),l}async function Fr(e,t={}){const r=await Tr(e,t);return await Wt(r)}const Te="#ffffff";function Mr(){return typeof window>"u"?Te:window.getComputedStyle(document.documentElement).getPropertyValue("--bg-elevated").trim()||Te}function Lr(e){if(typeof window>"u")return Te;const t=window.getComputedStyle(e).backgroundColor;return!t||t==="rgba(0, 0, 0, 0)"||t==="transparent"?Mr():t}async function Ir(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 Fr(e,{pixelRatio:2,cacheBust:!0,backgroundColor:Lr(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}=_t(),[s,a]=w.useState("idle"),i=w.useRef(null);w.useEffect(()=>()=>{i.current!==null&&window.clearTimeout(i.current)},[]);const l=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 Ir(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]),c=s==="copied"?"Copied":s==="copying"?"Copying…":"Copy image";return n.jsxs("button",{type:"button",className:"bm-copy-btn",onClick:l,disabled:s==="copying","aria-label":`Copy ${t} screenshot to clipboard`,title:`Copy ${t} screenshot to clipboard`,children:[n.jsx(Mt,{name:"copy",size:11}),c]})};function ae(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 Ar(e){return[e.paper_id,e.task_id,e.dataset_id,e.model_name,e.harness??""].join("|")}function Pr(e){const t=new Map;for(const r of e){const s=Ar(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 ot(e,t){return t?e.id===t||e.sourceEvaluationIds.includes(t):!1}function dt(e,t){return e.ranksByMetric[t]??e.best_rank??9999}function Dr(e,t,r){if(e.length===0)return{points:[],sota:0,sotaModel:""};const s=e.map(f=>{var N;const y=ae((N=f.metrics)==null?void 0:N[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 c=e.map(f=>{var y;return{eval:f,value:ae((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=(c==null?void 0:c.value)??0,p=(c==null?void 0:c.eval.model_name)||(c==null?void 0:c.eval.paper_title)||"";return{points:a,sota:u,sotaModel:p}}const Br=5;function Hr(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 ye(e,t){return e?n.jsx(we,{title:e}):t||"—"}const ns=()=>{var Ie,Ae,Pe,De,Be,He,Ve,Oe,qe,Ue,We,ze,Ke;const{datasetSlug:e}=kt(),[t]=St(),r=t.get("task")||void 0,s=t.get("eval")||void 0,{preferences:a,setHideClosedSourceEvals:i}=Ct(),[l,c]=w.useState(void 0),u=w.useRef(null),p=w.useRef(!1),f=w.useRef(null),y=w.useRef(null),x=Y({queryKey:["dataset",e,"with-paper",r,a.hide_closed_source_evals?"open":"all"],queryFn:()=>re.getDatasetBySlug(e,{include_paper:!0,task:r,is_open:a.hide_closed_source_evals?!0:void 0}),enabled:!!e,staleTime:10*60*1e3}),N=Y({queryKey:["dataset-evals",(Ie=x.data)==null?void 0:Ie.id],queryFn:()=>Rt.byDataset(x.data.id),enabled:!!((Ae=x.data)!=null&&Ae.id),staleTime:5*60*1e3}),U=Y({queryKey:["dataset-tasks",(Pe=x.data)==null?void 0:Pe.id],queryFn:()=>re.datasetTasks(x.data.id),enabled:!!((De=x.data)!=null&&De.id),staleTime:10*60*1e3}),le=Y({queryKey:["metric-directions"],queryFn:()=>re.metricDirections(),staleTime:60*60*1e3}),I=w.useMemo(()=>{var d;return!s||!((d=N.data)!=null&&d.length)?null:N.data.find(g=>g.id===s)||null},[s,N.data]),T=w.useMemo(()=>{const d=U.data||[];if(d.length===0)return null;if(I!=null&&I.task_id&&d.some(h=>h.id===I.task_id))return I.task_id;if(r){const h=d.find(C=>C.slug===r);if(h)return h.id}if(d.length===1)return d[0].id;const g=N.data||[];if(g.length>0){const h=new Map;for(const _ of g)h.set(_.task_id,(h.get(_.task_id)||0)+1);let C=null,L=-1;for(const _ of d){const P=h.get(_.id)||0;P>L&&(L=P,C=_.id)}if(C)return C}return d[0].id},[U.data,N.data,r,I]),K=Y({queryKey:["task-benchmark-trends",T,a.hide_closed_source_evals?!0:void 0],queryFn:()=>re.trendingBenchmarks(T,{limit:100,min_recent_papers:0,is_open:a.hide_closed_source_evals?!0:void 0}),enabled:!!T&&!!((Be=x.data)!=null&&Be.id),staleTime:10*60*1e3}),A=w.useMemo(()=>{var d;return(((d=K.data)==null?void 0:d.results)||[]).find(g=>{var h;return g.id===((h=x.data)==null?void 0:h.id)})||null},[K.data,(He=x.data)==null?void 0:He.id]),ce=Y({queryKey:["leaderboard-metrics",(Ve=x.data)==null?void 0:Ve.id,T],queryFn:()=>re.leaderboardMetrics(x.data.id,T),enabled:!!((Oe=x.data)!=null&&Oe.id)&&!!T,staleTime:10*60*1e3}),J=w.useMemo(()=>At(N.data,T,a.hide_closed_source_evals),[N.data,T,a.hide_closed_source_evals]),G=J.visible,R=J.hiddenClosed,q=J.topHiddenClosed,V=w.useMemo(()=>Pr(G),[G]),he=w.useMemo(()=>{const d=new Set;return V.forEach(g=>{g.best_metric&&d.add(g.best_metric),Object.keys(g.metrics||{}).forEach(h=>d.add(h))}),Array.from(d)},[V]),Z=w.useMemo(()=>(ce.data||[]).map(d=>d.metric_name),[ce.data]),B=Z.length?Z:he,oe=w.useMemo(()=>{var C,L;if(V.length===0)return B[0]||"";const d=new Map;for(const _ of V){const P=_.best_metric;!P||ae((C=_.metrics)==null?void 0:C[P])===null||Z.length&&!B.includes(P)||d.set(P,(d.get(P)||0)+1)}let g=null,h=0;for(const[_,P]of d)P>h&&(h=P,g=_);return g||B[0]||((L=V[0])==null?void 0:L.best_metric)||""},[V,B,Z]),b=l||(I==null?void 0:I.best_metric)||oe,Q=(((Ue=(qe=le.data)==null?void 0:qe.directions)==null?void 0:Ue[b])||"higher_is_better")==="lower_is_better"?"↓":"↑",W=w.useMemo(()=>!b||!B.includes(b)?B:[b,...B.filter(d=>d!==b)],[B,b]),de=w.useMemo(()=>W.length===0?b?[b]:[]:W.slice(0,Br),[W,b]),{points:ue,sota:fe,sotaModel:o}=w.useMemo(()=>Dr(V,b,Q),[V,b,Q]),m=(We=x.data)==null?void 0:We.leaderboard_summary,k=N.isSuccess&&U.isSuccess&&le.isSuccess&&(!T||ce.isSuccess),v=k?b:m==null?void 0:m.metric,F=k?fe:m==null?void 0:m.value,E=k?o:m==null?void 0:m.model_name,O=!k&&!m;w.useEffect(()=>{if(p.current||!s||!N.data||N.data.length===0)return;const d=u.current;d&&(p.current=!0,d.scrollIntoView({behavior:"smooth",block:"start"}))},[s,N.data]);const S=w.useMemo(()=>{const d=U.data||[];return T?d.find(g=>g.id===T)||d[0]||null:d[0]||null},[U.data,T]),pe=Y({queryKey:["area",S==null?void 0:S.area_id],queryFn:()=>re.getArea(S.area_id),enabled:!!(S!=null&&S.area_id),staleTime:10*60*1e3});if(x.isLoading)return n.jsxs("div",{className:"page",children:[n.jsx(be,{className:"h-12 w-1/2 mb-6"}),n.jsx(be,{className:"h-64 w-full"})]});if(x.error||!x.data)return n.jsx("div",{className:"page",children:n.jsx($t,{variant:"destructive",children:n.jsx(Tt,{children:"Benchmark not found."})})});const j=x.data,ge=V.slice().sort((d,g)=>{var L,_;const h=ae((L=d.metrics)==null?void 0:L[b]),C=ae((_=g.metrics)==null?void 0:_[b]);return h!==null&&C!==null?Q==="↓"?h-C:C-h:h!==null?-1:C!==null?1:dt(d,b)-dt(g,b)}),Le=!!j.supports_harness,$=s&&ge.find(d=>ot(d,s))||null,M=j.introducing_paper??void 0,me=(M==null?void 0:M.arxiv_id)||(M==null?void 0:M.id)||Hr(j.paper_url),X=(M==null?void 0:M.title)||j.introducing_paper_title||null,ee=((ze=M==null?void 0:M.published)==null?void 0:ze.slice(0,4))||j.introduced_year||null,wt=!!me||!!j.paper_url||!!X,vt=M!=null&&M.arxiv_id||(Ke=j.paper_url)!=null&&Ke.match(/^https?:\/\/(?:www\.)?arxiv\.org\//i)?`arXiv:${me}`:`Paper ${me}`;return n.jsx("div",{className:"page",children:n.jsxs("div",{className:"bm-page",children:[n.jsxs("div",{className:"breadcrumb",children:[n.jsx(te,{to:"/tasks",children:"Tasks"}),pe.data&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"sep",children:"/"}),n.jsx(te,{to:`/tasks#area-${It(pe.data.name)}`,children:pe.data.name})]}),S&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"sep",children:"/"}),n.jsx(te,{to:`/tasks/${S.slug||S.id}`,children:S.name})]}),n.jsx("span",{className:"sep",children:"/"}),n.jsx("span",{style:{color:"var(--accent-text)"},children:j.name})]}),n.jsxs("div",{className:"bm-title-row",children:[n.jsx("h1",{className:"bm-title",children:j.name}),A&&n.jsxs("div",{className:"bm-title-trend","aria-label":`${j.name} reporting trend`,children:[n.jsx(Ft,{history:A.history,benchmarkName:A.name}),n.jsxs("span",{className:"bm-title-trend-summary",children:[n.jsx("strong",{children:A.recent_paper_count})," ",A.recent_paper_count===1?"paper":"papers",A.rate_change==null?A.recent_paper_count>0&&n.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):n.jsxs("span",{className:`benchmark-trend-change ${A.rate_change>=1?"is-up":"is-down"}`,children:[A.rate_change>=1?"↑":"↓"," ",A.rate_change.toFixed(1),"×"]})]})]})]}),n.jsxs("div",{className:"bm-subtitle",children:[O?n.jsx(be,{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:"·"})]}),E?n.jsxs("span",{children:["Best: ",n.jsx("span",{className:"best-name",children:ie(F)})," by ",n.jsx("span",{className:"best-name",style:{fontStyle:"normal"},children:E})]}):n.jsxs("span",{children:[ge.length," evaluations"]})]}),j.hf_url&&n.jsxs("a",{className:"bm-action-btn",href:j.hf_url,target:"_blank",rel:"noopener noreferrer",children:[n.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),j.description&&n.jsx("p",{className:"bm-description",children:j.description}),a.hide_closed_source_evals&&R.length>0&&n.jsxs("div",{className:"bm-hidden-closed-notice",children:[n.jsxs("span",{children:[R.length," closed-source ",R.length===1?"row is":"rows are"," hidden",q!=null&&q.model_name?n.jsxs(n.Fragment,{children:[", including ",n.jsx("strong",{children:q.model_name})]}):null,"."]}),n.jsx("button",{type:"button",className:"bm-hidden-closed-action",onClick:()=>{i(!1)},children:"Show closed-source"})]}),wt&&n.jsxs("div",{className:"method-source",style:{marginTop:0,marginBottom:18},children:[n.jsx("span",{className:"method-source-label",children:"Source"}),me?n.jsxs(te,{to:`/paper/${me}`,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(we,{title:X}):vt}),ee&&n.jsx("span",{className:"method-source-meta",children:ee})]}):j.paper_url?n.jsxs("a",{href:Lt(j.paper_url)??void 0,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(we,{title:X}):j.paper_url}),ee&&n.jsx("span",{className:"method-source-meta",children:ee})]}):n.jsxs("div",{className:"method-source-link is-static",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(we,{title:X}):null}),ee&&n.jsx("span",{className:"method-source-meta",children:ee})]})]}),ue.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:j.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:[B.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=>c(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(Ze,{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(Dt,{points:ue,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"]})]}),$&&(()=>{var L,_;const d=$.paper_arxiv_id||$.paper_id,g=$.paper_title||($.paper_arxiv_id?`arXiv:${$.paper_arxiv_id}`:null),h=$.best_metric&&((L=$.metrics)==null?void 0:L[$.best_metric])!==void 0?$.best_metric:b,C=(_=$.metrics)==null?void 0:_[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:[$.model_name||g||"—",$.harness?` · ${$.harness}`:""]}),n.jsxs("span",{className:"bm-highlight-meta",children:[C!==void 0&&h?n.jsxs(n.Fragment,{children:[h,": ",ie(C),g?" · ":""]}):null,d?n.jsx(te,{to:`/paper/${d}`,children:ye($.paper_title,g)}):ye($.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:j.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:[B.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=>c(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(Ze,{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"})]})]}),N.isLoading?n.jsx("div",{style:{padding:16},children:Array.from({length:5}).map((d,g)=>n.jsx(be,{className:"h-10 w-full mb-2"},g))}):ge.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"}),Le&&n.jsx("th",{className:"col-harness",children:"Harness"}),de.map(d=>{const g=d===b;return n.jsx("th",{className:`col-value ${g?"is-active":""}`,"aria-sort":g?Q==="↓"?"ascending":"descending":"none",children:n.jsxs("button",{type:"button",className:"bm-metric-header",onClick:()=>c(d),"aria-pressed":g,title:`Sort by ${d}`,children:[d,g?` ${Q}`:""]})},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 ge.map((h,C)=>{var Qe,Xe;const L=ae((Qe=h.metrics)==null?void 0:Qe[b]);let _=null;L!==null&&((d===null||L!==d)&&(g=C+1,d=L),_=g);const P=h.paper_arxiv_id||h.paper_id,Ge=h.paper_title||(h.paper_arxiv_id?`arXiv:${h.paper_arxiv_id}`:null),Se=ot(h,s);return n.jsxs("tr",{ref:Se?u:void 0,className:Se?"is-highlighted":void 0,children:[n.jsx("td",{className:"col-rank",children:_??"—"}),n.jsxs("td",{className:"col-model",children:[Se&&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(Et,{}),(h.external??h.is_external)&&n.jsx(Nt,{sourceUrl:h.source_url||h.external_source_url||h.result_url})]}),Le&&n.jsx("td",{className:"col-harness",children:h.harness||"—"}),de.map(Ce=>{var Je;const Ye=Ce===b,xe=(Je=h.metrics)==null?void 0:Je[Ce];return n.jsx("td",{className:`col-value${Ye?" is-active":""}${Ye&&_===1?" is-best":""}`,children:xe!=null&&xe!==""?ie(xe):"—"},Ce)}),n.jsx("td",{className:"col-paper",children:P?n.jsx(te,{to:`/paper/${P}`,children:ye(h.paper_title,Ge)}):ye(h.paper_title,Ge)}),n.jsx("td",{className:"col-year",children:((Xe=h.paper_published_date)==null?void 0:Xe.slice(0,4))||"—"})]},h.id)})})()})]})})]})]})})};export{ns as default};
assets/{BenchmarkTrendSparkline-DmwnJgng.js → BenchmarkTrendSparkline-iEoRSHN4.js} RENAMED
@@ -1 +1 @@
1
- import{r as C,j as t}from"./index-DpqMFKEJ.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-B5X8-Bq7.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/ChatView-CG4tP3Rs.js DELETED
@@ -1,16 +0,0 @@
1
- var Ft=Object.defineProperty;var Yt=(t,e,r)=>e in t?Ft(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var ke=(t,e,r)=>Yt(t,typeof e!="symbol"?e+"":e,r);import{d as Pt,A as qt,S as Bt,r as i,j as n,X as Ut,e as kt,c as Ht,u as Wt,a as Vt,y as Gt,g as $t,U as Kt,L as mt,b as zt}from"./index-DpqMFKEJ.js";import{u as Qt}from"./useQuery-BRJ3D8WJ.js";import{C as Jt,U as gt,b as Xt,A as Zt,a as er}from"./ArtifactWorkspace-B2_NF1H2.js";import{c as Ve}from"./chat-BrAdjM-f.js";import{h as tr,i as Tt,j as rr,T as nr,d as Ot,k as sr,l as ar,m as ir,n as tt,o as or,t as yt,r as st,s as It,v as cr,S as lr,P as ur,D as dr,w as fr,x as rt,y as Xe,z as pr,B as Ze,E as et,F as hr,G as mr,H as gr,I as nt,J as yr}from"./chatSessions-VGVoLTuT.js";import{S as _r}from"./chatPrompts-CDY3UGU1.js";import{u as br,O as wr}from"./openrouter-BXQN2vDT.js";import"./katex.min-BSBacQyE.js";import"./hover-card-K79gJfh7.js";import"./github-BRCZ4EHw.js";import"./github-DWbj5_NN.js";import"./PaperPreviewLink-Da7TZ3ij.js";import"./index-DYz3ynl3.js";import"./papers-inj3gJs3.js";import"./file-text-Ce3hOAur.js";import"./external-link-CU5Ded46.js";import"./chevron-down-CAjIY4ok.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 vr=Pt("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"}]]),ce=(t,e)=>new Promise(r=>{const s=setTimeout(o,t);function o(){e==null||e.removeEventListener("abort",o),clearTimeout(s),r()}e==null||e.addEventListener("abort",o)}),ve=t=>({arxiv_id:null,source:"arxiv",source_url:null,thumbnail_url:null,authors:[],published:null,conference:null,citation_count:null,tasks:[],methods:[],repositories:[],project_pages:[],...t}),xe={name:"Object Detection",slug:"object-detection"},Te={name:"Real-Time Object Detection",slug:"real-time-object-detection"},xr={"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:ve({arxiv_id:"2502.12524",authors:[{name:"Y. Tian"},{name:"Q. Ye"},{name:"D. Doermann"}],published:"2025-02-18",citation_count:412,tasks:[xe,Te],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:ve({arxiv_id:"2407.17140",authors:[{name:"W. Lv"},{name:"Y. Zhao"},{name:"J. Chang"}],published:"2024-07-24",citation_count:268,tasks:[xe,Te],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:ve({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:[xe,Te],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:ve({arxiv_id:"2406.03459",authors:[{name:"Q. Chen"},{name:"X. Su"},{name:"X. Zhang"}],published:"2024-06-05",citation_count:94,tasks:[xe,Te],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:ve({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:[xe,Te],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:ve({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:[xe,Te],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:ve({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"},xe],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:ve({source:"external",source_url:"https://docs.ultralytics.com/models/",authors:[{name:"Ultralytics"}],published:"2025-01-02",tasks:[xe,Te],repositories:[{url:"https://github.com/ultralytics/ultralytics",stars:46e3}],project_pages:[{url:"https://docs.ultralytics.com"}]})}},At=t=>t.map(e=>xr[e]),_t=At(["2502.12524","2407.17140","2410.13842","2406.03459","2304.08069","2405.14458","2401.17270","158342"]),bt=At(["2410.13842","2502.12524","2407.17140","2405.14458","2304.08069"]),wt="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.",vt="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.",xt=`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.`,Rr=["How do these compare on edge devices like Jetson?","Show me open-vocabulary detectors","What about small-object detection?"];async function*Sr(t,e){const r=()=>(e==null?void 0:e.aborted)===!0,s=t.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 ce(350,e),!r()){yield{type:"reasoning_start"};for(let o=0;o<wt.length;o+=6){if(await ce(14,e),r())return;yield{type:"reasoning_delta",text:wt.slice(o,o+6)}}if(await ce(400,e),!r()&&(yield{type:"reasoning_end"},await ce(300,e),!r()&&(yield{type:"tool_call",id:"call_1",name:"search_papers",args:{query:s,top_k:8}},await ce(1100,e),!r()&&(yield{type:"tool_result",id:"call_1",hits:_t.length,took_ms:214,results:_t},await ce(350,e),!r())))){yield{type:"reasoning_start"};for(let o=0;o<vt.length;o+=6){if(await ce(14,e),r())return;yield{type:"reasoning_delta",text:vt.slice(o,o+6)}}if(await ce(350,e),!r()&&(yield{type:"reasoning_end"},await ce(300,e),!r()&&(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 ce(900,e),!r()&&(yield{type:"tool_result",id:"call_2",hits:bt.length,took_ms:176,results:bt},await ce(400,e),!r())))){for(let o=0;o<xt.length;o+=4){if(await ce(11,e),r())return;yield{type:"answer_delta",text:xt.slice(o,o+4)}}yield{type:"done",followups:Rr,finish_reason:"success"}}}}}const Ne=()=>{const e=String("0").trim().toLowerCase();return e==="1"||e==="true"||e==="yes"},Er=()=>!0;class Me extends Error{constructor(e,r,s,o){super(e),this.code=r,this.status=s,this.retryAfterSeconds=o,this.name="ChatStreamError"}}function kr(t,e){if(Ne())try{Ve.reportLatency(t,e).catch(()=>{})}catch{}}function Tr(t,e={}){return Ne()?Ir(t,e.signal):Sr(t.message,e.signal)}function Or(t,e={}){return Ar(t,e.signal)}async function*Ir(t,e){const r=await Ve.stream(t,e);yield*Ct(r)}async function*Ar(t,e){const r=await Ve.resumeStream(t,e);yield*Ct(r)}async function*Ct(t){if(!t.ok||!t.body){const o=t.ok?null:new qt(t,await t.text());o&&Bt(o);const c=o==null?void 0:o.detail,f=typeof c=="object"&&c!==null?c:null,m=t.status===403&&!c,y=Number(t.headers.get("Retry-After")),I=Number.isFinite(y)&&y>=0?Math.min(300,Math.ceil(y)):void 0;throw new Me(m?"Chat on staging is limited to approved Hugging Face users. Sign in with an approved account and try again.":(o==null?void 0:o.message)||`Chat stream failed (${t.status})`,f&&"code"in f&&typeof f.code=="string"?f.code:m?"staging_access_required":void 0,t.status,I)}const e=t.body.getReader(),r=new TextDecoder;let s="";try{for(;;){const{done:o,value:c}=await e.read();if(o)break;s+=r.decode(c,{stream:!0});let f;for(;(f=s.indexOf(`
13
-
14
- `))!==-1;){const m=s.slice(0,f);s=s.slice(f+2);const y=m.split(`
15
- `).filter(I=>I.startsWith("data:")).map(I=>I.slice(5).trimStart()).join(`
16
- `);!y||y==="[DONE]"||(yield JSON.parse(y))}}}finally{e.releaseLock()}}const Cr="https://huggingface.co/settings/inference-providers",Rt="pwc.chat.billing-notice-dismissed.v1";function jr({provider:t}){const[e,r]=i.useState(()=>localStorage.getItem(Rt)==="1");return!Ne()||e||t!=="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:Cr,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(Rt,"1"),r(!0)},children:n.jsx(Ut,{size:15,"aria-hidden":"true"})})]})]})}function St({variant:t,composerProps:e,provider:r,paused:s,suggestions:o=[]}){var f;const c=n.jsxs(n.Fragment,{children:[n.jsx(jr,{provider:r}),s&&n.jsx("div",{id:"chat-paused-description",className:"chat-paused-banner",role:"status",children:"Chat is temporarily disabled. You can keep browsing and editing your conversations. New research runs will return when chat is restored."}),n.jsx(Jt,{...e,...t==="empty"?{autoFocus:!0}:{placeholder:(f=e.draft)!=null&&f.text?"Edit and send again…":"Ask a follow-up…"}}),t==="empty"&&n.jsx("div",{className:"chat-examples",children:o.map(m=>n.jsx("button",{type:"button",className:"chat-example",disabled:s,onClick:()=>{var y;return e.onSend({text:m,paperMentions:[],...(y=e.draft)!=null&&y.paperSelection?{paperSelection:e.draft.paperSelection}:{}})},children:m},m))})]});return t==="empty"?c:n.jsx("div",{className:"chat-composer-wrap",children:n.jsxs("div",{className:"chat-composer-inner",children:[c,n.jsx("div",{className:"chat-composer-foot",children:Ne()?n.jsxs(n.Fragment,{children:[r==="huggingface"&&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"}),"."]}),r==="openai"&&n.jsx("span",{className:"chat-provider-attribution",children:"Powered by OpenAI."}),n.jsx("span",{children:"The AI assistant can make mistakes. Double-check responses."})]}):n.jsx(n.Fragment,{children:"Assistant preview — responses are simulated."})})]})})}function Lr({messages:t,papers:e,busy:r,queuedDraft:s,paperMentionsEnabled:o,archivePending:c,openRouterFallbackEnabled:f,onToggleBlock:m,onEditAndResend:y,onArchiveOld:I,onArchiveOldest:_}){var M,p;const[b,T]=i.useState(null),B=i.useRef(null),v=i.useRef(null),L=i.useRef(null);i.useEffect(()=>{r?T(null):L.current=null},[r]),i.useLayoutEffect(()=>{const u=B.current;if(u){if(v.current!==null){u.scrollTop=v.current,v.current=null;return}if(L.current){const A=Array.from(u.querySelectorAll("[data-message-id]")).find(N=>N.dataset.messageId===L.current);if(A){const N=u.getBoundingClientRect(),H=A.getBoundingClientRect();u.scrollTop+=H.top-N.top-24;return}}u.scrollTop=u.scrollHeight}},[t]);const q=t.filter(u=>u.role==="user"),V=(M=q[0])==null?void 0:M.id,G=(p=q.at(-1))==null?void 0:p.id,j=(u,A)=>{var N;v.current=((N=B.current)==null?void 0:N.scrollTop)??null,m(u,A)};return n.jsx("div",{className:"chat-conversation",ref:B,children:n.jsxs("div",{className:"chat-conversation-inner",children:[t.length===0&&(s==null?void 0:s.text)&&n.jsx(gt,{id:"queued-launch-preview",text:s.text,paperMentions:s.paperMentions,paperSelection:s.paperSelection,isInitial:!0}),t.map(u=>u.role==="user"?n.jsx(gt,{id:u.id,text:u.text??"",paperMentions:u.paperMentions??[],paperSelection:u.paperSelection,paperMentionsEnabled:o,isInitial:u.id===V,editingAllowed:!r&&!!u.revision,editing:b===u.id,editNotice:u.id===V?"Sending will replace this conversation.":u.id===G?"Sending will replace the response.":"Sending will replace the response and all messages after it.",onEdit:()=>T(u.id),onCancel:()=>T(null),onResendDraft:A=>{u.id!==V&&(L.current=u.id);const N=y(u.id,A);return N?T(null):L.current=null,N}},u.id):n.jsx(Xt,{msg:u,papers:e,onToggleBlock:j,onArchiveOldChats:I,onArchiveOldestChats:_,archivePending:c,hfBilling:null,openRouterFallbackEnabled:f,feedbackEnabled:!0},u.id))]})})}function Mr({retryAt:t,onRetry:e,onCancel:r}){const[s,o]=i.useState(()=>Math.max(0,Math.ceil((t-Date.now())/1e3))),c=i.useRef(null);return i.useEffect(()=>{var I;const f=document.activeElement instanceof HTMLElement?document.activeElement:null;(I=c.current)==null||I.focus();const m=()=>o(Math.max(0,Math.ceil((t-Date.now())/1e3)));m();const y=window.setInterval(m,250);return()=>{window.clearInterval(y),f==null||f.focus()}},[t]),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:f=>{f.key==="Escape"&&(f.preventDefault(),r())},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:c,onClick:r,children:"Cancel"}),n.jsx("button",{type:"button",className:"chat-capacity-retry",disabled:s>0,onClick:e,children:"Try again"})]})]})})}function Nr({onClose:t}){const e=i.useRef(null);return i.useEffect(()=>{var s;const r=document.activeElement instanceof HTMLElement?document.activeElement:null;return(s=e.current)==null||s.focus(),()=>r==null?void 0:r.focus()},[]),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-disabled-title","aria-describedby":"chat-disabled-description",onKeyDown:r=>{r.key==="Escape"&&(r.preventDefault(),t())},children:[n.jsx("h2",{id:"chat-disabled-title",children:"Chat is temporarily disabled"}),n.jsx("p",{id:"chat-disabled-description",children:"We've temporarily paused new research runs. Your message wasn't sent, and your draft is still here. Please try again later."}),n.jsx("div",{className:"chat-capacity-dialog-actions",children:n.jsx("button",{ref:e,type:"button",className:"chat-capacity-cancel",onClick:t,children:"Keep editing"})})]})})}function Dr({url:t,onClose:e}){return t?n.jsx("div",{className:"chat-share-dialog-backdrop",role:"presentation",onMouseDown:e,children:n.jsxs("div",{className:"chat-share-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-share-dialog-title",onMouseDown:r=>r.stopPropagation(),children:[n.jsx("h2",{id:"chat-share-dialog-title",children:"Public link created"}),n.jsx("p",{children:"Anyone with this link can see this conversation. It could not be copied automatically, so copy it manually:"}),n.jsx("input",{readOnly:!0,value:t,"aria-label":"Public conversation link",autoFocus:!0,onFocus:r=>r.currentTarget.select()}),n.jsx("button",{type:"button",onClick:e,children:"Close"})]})}):null}function Fr({sessions:t,activeSessionId:e,loading:r,error:s,open:o,onClose:c,onNew:f,onNavigate:m,onRename:y,onDelete:I}){const[_,b]=i.useState(null),[T,B]=i.useState(""),[v,L]=i.useState(null);i.useEffect(()=>{if(!v)return;const j=()=>L(null),M=p=>{p.key==="Escape"&&j()};return window.addEventListener("click",j),window.addEventListener("keydown",M),()=>{window.removeEventListener("click",j),window.removeEventListener("keydown",M)}},[v]);const q=j=>{b(j.id),B(j.title)},V=async j=>{const M=T.trim();M&&await y(j,M)&&b(null)},G=(j,M,p)=>L({id:j,x:M,y:p});return n.jsxs("aside",{className:`chat-sidebar${o?"":" chat-sidebar-closed"}`,children:[n.jsxs("div",{className:"chat-sidebar-top",children:[n.jsxs("button",{type:"button",className:"chat-new-chat",onClick:f,children:[n.jsx(tr,{})," New chat"]}),n.jsx("button",{type:"button",className:"icon-btn",onClick:c,title:"Collapse sidebar",children:n.jsx(Tt,{})})]}),n.jsxs("nav",{className:"chat-sessions","aria-label":"Chat history",children:[r&&n.jsx("div",{className:"chat-sessions-empty",children:"Loading chats…"}),!r&&s&&n.jsx("div",{className:"chat-sessions-empty",children:s}),!r&&!s&&t.length===0&&n.jsx("div",{className:"chat-sessions-empty",children:"Conversations you start will show up here."}),rr(t).map(j=>n.jsxs("div",{className:"chat-session-group",children:[n.jsx("div",{className:"chat-session-group-label",children:j.label}),j.items.map(M=>n.jsxs("div",{className:`chat-session${M.id===e?" chat-session-active":""}`,role:"button",tabIndex:0,onClick:()=>m(M.id),onKeyDown:p=>{if(p.key==="Enter"&&m(M.id),p.key==="F2"&&q(M),p.key==="ContextMenu"||p.shiftKey&&p.key==="F10"){p.preventDefault();const u=p.currentTarget.getBoundingClientRect();G(M.id,u.right-150,u.bottom)}},onContextMenu:p=>{p.preventDefault(),G(M.id,p.clientX,p.clientY)},children:[_===M.id?n.jsx("input",{className:"chat-session-title-input",value:T,autoFocus:!0,maxLength:80,onClick:p=>p.stopPropagation(),onChange:p=>B(p.target.value),onBlur:()=>void V(M.id),onKeyDown:p=>{p.stopPropagation(),p.key==="Enter"&&V(M.id),p.key==="Escape"&&b(null)}}):n.jsx("span",{className:"chat-session-title",children:M.title}),n.jsx("button",{type:"button",className:"chat-session-menu","aria-label":"Chat actions","aria-haspopup":"menu",title:"Chat actions",onClick:p=>{p.stopPropagation();const u=p.currentTarget.getBoundingClientRect();G(M.id,u.right-150,u.bottom)},children:"⋯"}),n.jsx("button",{type:"button",className:"chat-session-delete","aria-label":"Delete conversation",onClick:p=>{p.stopPropagation(),I(M.id)},children:n.jsx(nr,{})})]},M.id))]},j.label))]}),v&&n.jsx("div",{className:"chat-session-context-menu",role:"menu",style:{left:v.x,top:v.y},onClick:j=>j.stopPropagation(),children:n.jsx("button",{type:"button",role:"menuitem",autoFocus:!0,onClick:()=>{const j=t.find(M=>M.id===v.id);j&&q(j),L(null)},children:"Rename chat"})})]})}function Yr({sessionId:t,busy:e,loading:r,hasPaperSelection:s=!1,onError:o}){const{toast:c}=kt(),[f,m]=i.useState(!1),[y,I]=i.useState(""),_=async()=>{var b;if(!(e||f)&&!(s&&!window.confirm("This public link will include the selected paper passage. Anyone with the link can read that passage. Continue?"))){m(!0);try{const T=await sr(t),B=new URL(T.public_path,window.location.origin).toString();try{if(!((b=navigator.clipboard)!=null&&b.writeText))throw new Error("Clipboard unavailable");await navigator.clipboard.writeText(B),c({className:"chat-share-toast",duration:5e3,title:"Public link copied to your clipboard",description:"Anyone with this link can see this conversation."})}catch{I(B)}}catch(T){const B=T instanceof Error?T.message:"Could not share this conversation";o(B),c({variant:"destructive",title:"Share failed",description:B})}finally{m(!1)}}};return n.jsxs(n.Fragment,{children:[n.jsxs("button",{type:"button",className:"chat-share-button",onClick:()=>void _(),disabled:e||f||r,"aria-label":"Share conversation",children:[f?n.jsx(Ot,{}):n.jsx(vr,{"aria-hidden":"true"}),n.jsx("span",{children:"Share"})]}),n.jsx(Dr,{url:y,onClose:()=>I("")})]})}function Pr({messages:t,refreshSessions:e,resetChat:r,restoreDraft:s,clearTitle:o}){const{toast:c}=kt(),[f,m]=i.useState(null),y=()=>{const b=[...t].reverse().find(T=>T.role==="user");r(),s({text:(b==null?void 0:b.text)??"",paperMentions:(b==null?void 0:b.paperMentions)??[],...b!=null&&b.paperSelection?{paperSelection:b.paperSelection}:{}}),o()};return{pending:f,archiveOld:async()=>{if(f===null){m("old");try{const b=await ir();if(await e(),b.archived_count===0){c({title:"No chats were archived",description:"There are no inactive chats older than 30 days."});return}y(),c({title:`${b.archived_count} ${b.archived_count===1?"chat":"chats"} archived`,description:"Your question is ready to send again."})}catch(b){c({variant:"destructive",title:"Could not archive old chats",description:b instanceof Error?b.message:"Try again."})}finally{m(null)}}},archiveOldest:async()=>{if(f===null){m("oldest");try{const b=await ar();await e(),y(),c({title:`${b.archived_count} ${b.archived_count===1?"chat":"chats"} archived`,description:"Your question is ready to send again."})}catch(b){c({variant:"destructive",title:"Could not archive chats",description:b instanceof Error?b.message:"Try again."})}finally{m(null)}}}}}class qr{constructor(e,r=kr){ke(this,"requestId");ke(this,"firstVisibleAt");ke(this,"streamStartReported",!1);ke(this,"firstVisibleReported",!1);ke(this,"terminalReported",!1);ke(this,"semanticReported",new Set);this.submittedAt=e,this.report=r}recordStreamStart(e,r){this.requestId=e,this.streamStartReported||(this.streamStartReported=!0,this.send({submission_to_stream_start_ms:Math.max(0,r-this.submittedAt)})),this.reportFirstVisible()}recordFirstVisible(e){this.firstVisibleAt===void 0&&(this.firstVisibleAt=e,this.reportFirstVisible())}recordSemantic(e,r){if(this.semanticReported.has(e))return;this.semanticReported.add(e);const s=Math.max(0,r-this.submittedAt);this.send(e==="reasoning"?{submission_to_first_reasoning_delta_ms:s}:e==="tool"?{submission_to_first_tool_call_ms:s}:{submission_to_first_answer_delta_ms:s})}recordTerminal(e){this.terminalReported||(this.terminalReported=!0,this.send({terminal_classification:e}))}reportFirstVisible(){!this.requestId||this.firstVisibleAt===void 0||this.firstVisibleReported||(this.firstVisibleReported=!0,this.send({submission_to_first_visible_delta_ms:Math.max(0,this.firstVisibleAt-this.submittedAt)}))}send(e){this.requestId&&this.report(this.requestId,e)}}const jt="Preparing research workspace…",Lt={preparing_workspace:"Preparing secure workspace…",starting_agent:"Starting research agent…",connecting_model:"Connecting to model…"},Mt=()=>({messages:[],sessionId:null,title:"",phase:"idle"});function Et(t,e){for(let r=t.length-1;r>=0;r-=1)if(e(t[r]))return r;return-1}function Oe(t){if(t.status!==jt&&!Object.values(Lt).includes(t.status))return t;const{status:e,...r}=t;return r}function re(t,e){if(!t.length)return t;const r=t.slice();return r[r.length-1]=e(r[r.length-1]),r}function Ue(t,e,r){return re(t,s=>{const o=Oe(s),c=o.blocks??[];return{...o,blocks:c.map((f,m)=>e(f,m,c)?r(f):f)}})}function Br(t,e){switch(e.type){case"stream_start":return e.session_id?{...t,sessionId:e.session_id}:t;case"sandbox_start":case"sandbox_ready":case"workspace_ready":return t;case"lifecycle":return{...t,messages:re(t.messages,r=>{var s;return r.role==="assistant"&&r.streaming&&(((s=r.blocks)==null?void 0:s.length)??0)===0?{...r,status:Lt[e.phase]}:r})};case"session_title_start":return{...t,title:""};case"session_title_delta":return{...t,title:`${t.title}${e.text}`.replace(/\s+/g," ").slice(0,80)};case"session_title_done":return{...t,title:e.title};case"reasoning_start":return{...t,messages:re(t.messages,r=>{const s=Oe(r);return{...s,blocks:[...(s.blocks??[]).map(o=>o.kind==="reasoning"&&o.active?{...o,active:!1,open:!1}:o),{kind:"reasoning",text:"",active:!0,open:!0}]}})};case"reasoning_delta":return{...t,messages:Ue(t.messages,(r,s,o)=>r.kind==="reasoning"&&Et(o,c=>c.kind==="reasoning")===s,r=>r.kind==="reasoning"?{...r,text:r.text+e.text}:r)};case"reasoning_end":return{...t,messages:re(t.messages,r=>{const s=r.blocks??[],o=Et(s,m=>m.kind==="reasoning"&&m.active);if(o<0)return r;const c=s[o];if(c.kind!=="reasoning")return r;const f=s[o-1];return(f==null?void 0:f.kind)==="reasoning"&&f.text===c.text?{...r,blocks:s.filter((m,y)=>y!==o)}:{...r,blocks:s.map((m,y)=>y===o?{...c,active:!1,open:!1}:m)}})};case"tool_call":return{...t,messages:re(t.messages,r=>{const s=Oe(r);return{...s,blocks:[...s.blocks??[],{kind:"tool",id:e.id,name:e.name,args:e.args,status:"running",open:!1}]}})};case"app_start":return{...t,messages:re(t.messages,r=>{const s=Oe(r);return{...s,blocks:[...s.blocks??[],{kind:"app",schema_version:1,instance_id:e.instance_id,provider:e.provider,server:e.server,tool:e.tool,resource_uri:e.resource_uri,status:"loading",input:e.input,result:{content:[],structuredContent:{},isError:!1},csp:{},permissions:{clipboardWrite:!0},height:525}]}})};case"app_result":return{...t,messages:Ue(t.messages,r=>r.kind==="app"&&r.instance_id===e.id,r=>r.kind==="app"?{...r,status:e.status,result:e.result}:r)};case"tool_result":return{...t,messages:Ue(t.messages,r=>r.kind==="tool"&&r.id===e.id,r=>r.kind!=="tool"?r:e.status?{...r,schema_version:2,status:e.status,took_ms:e.took_ms,content:e.content,metadata:e.metadata,open:e.status!=="success"}:{...r,status:"done",hits:e.hits,took_ms:e.took_ms,results:e.results})};case"artifact_start":return{...t,messages:re(t.messages,r=>{const s=Oe(r);return{...s,blocks:[...s.blocks??[],{kind:"artifact",schema_version:1,scope:"owner",publication_id:e.publication_id,identifier:e.identifier,artifact_kind:"posterly",title:e.title,status:"generating",phase:"publishing_poster"}]}})};case"artifact_ready":return{...t,messages:Ue(t.messages,r=>r.kind==="artifact"&&r.publication_id===e.publication_id,r=>r.kind==="artifact"?{...r,artifact_id:e.artifact_id,version_id:e.version_id,identifier:e.identifier,version:e.version,title:e.title,status:"ready",preview_mime:e.preview_mime,source_language:e.source_language,gate_status:e.gate_status,total_bytes:e.total_bytes,phase:void 0}:r)};case"artifact_error":return{...t,messages:Ue(t.messages,r=>r.kind==="artifact"&&r.publication_id===e.publication_id,r=>r.kind==="artifact"?{...r,status:"error",phase:void 0,error_code:e.code,error_message:e.message}:r)};case"answer_delta":return{...t,messages:re(t.messages,r=>{const s=Oe(r),o=s.blocks??[],c=o.at(-1);return(c==null?void 0:c.kind)==="answer"&&!c.done?{...s,blocks:[...o.slice(0,-1),{...c,text:c.text+e.text}]}:{...s,blocks:[...o,{kind:"answer",text:e.text,done:!1}]}})};case"done":return{...t,phase:"complete",messages:re(t.messages,r=>({...r,streaming:!1,followups:e.followups,finishReason:e.finish_reason,citations:e.citations,blocks:(r.blocks??[]).map(s=>s.kind==="answer"?{...s,done:!0}:s.kind==="reasoning"&&s.active?{...s,active:!1,open:!1}:s)}))};case"error":return{...t,phase:"failed",messages:re(t.messages,r=>({...r,streaming:!1,error:e.message,errorCode:e.code,blocks:(r.blocks??[]).map(s=>s.kind==="reasoning"&&s.active?{...s,active:!1,open:!1}:s)}))};default:return t}}function Ur(t){return re(t,e=>{if(e.role!=="assistant")return e;const r=(e.blocks??[]).flatMap(s=>s.kind==="tool"&&s.status==="running"?[]:s.kind==="reasoning"&&s.active?s.text?[{...s,active:!1,open:!1}]:[]:s.kind==="answer"?[{...s,done:!0}]:[s]);return{...e,blocks:r,streaming:!1,finishReason:"stopped"}})}function He(t,e){switch(e.type){case"start":return{messages:e.messages,sessionId:e.sessionId,title:"",phase:"streaming"};case"event":return Br(t,e.event);case"load":return{messages:e.messages,sessionId:e.sessionId,title:t.title,phase:"idle"};case"workspace_status":return{...t,messages:re(t.messages,r=>{var s;return r.role==="assistant"&&r.streaming&&(((s=r.blocks)==null?void 0:s.length)??0)===0&&!r.error?{...r,status:jt}:r})};case"clear_workspace_status":return{...t,messages:re(t.messages,Oe)};case"settle":return{...t,phase:"idle",messages:re(t.messages,r=>r.streaming?{...r,streaming:!1}:r)};case"stop":return{...t,messages:Ur(t.messages),phase:"stopped"};case"reset":return Mt()}}const Re={minDelayMs:5,maxDelayMs:80,minRateCharsPerMs:.3,maxBufferedMs:400,arrivalRateTauMs:1e3,arrivalRateHeadroom:1.1,maxPendingChars:64},Hr={now:()=>performance.now(),sleep:(t,e)=>new Promise(r=>{if(e!=null&&e.aborted||t<=0){r();return}const s=window.setTimeout(o,t);function o(){e==null||e.removeEventListener("abort",o),window.clearTimeout(s),r()}e==null||e.addEventListener("abort",o,{once:!0})})};function Wr(t){return!["stream_start","sandbox_start","sandbox_ready","workspace_ready","session_title_start","session_title_delta","session_title_done"].includes(t.type)}function Vr(t,e=!1,r=Re.maxPendingChars){var o;if(!t)return{pieces:[],pending:""};if(e)return{pieces:[t],pending:""};const s=Intl.Segmenter;if(s){const f=[...new s(void 0,{granularity:"word"}).segment(t)].filter(y=>y.isWordLike);let m=0;if(f.length>1&&(m=f.at(-1).index),f.length&&/\s$/u.test(t)&&(m=t.length),m>0){const y=t.slice(0,m),I=[],b=[...new s(void 0,{granularity:"word"}).segment(y)].filter(T=>T.isWordLike);for(let T=0;T<b.length;T+=1){const B=T===0?0:b[T].index,v=((o=b[T+1])==null?void 0:o.index)??y.length;v>B&&I.push(y.slice(B,v))}return b.length||I.push(y),{pieces:I,pending:t.slice(m)}}}else{const c=[...t.matchAll(/\s+/gu)];if(c.length){const f=[];let m=0;for(const y of c){const I=y.index+y[0].length;f.push(t.slice(m,I)),m=I}return{pieces:f,pending:t.slice(m)}}}return t.length>=r?{pieces:[t.slice(0,r)],pending:t.slice(r)}:{pieces:[],pending:t}}function Gr(t,e={}){const r={minDelayMs:e.minDelayMs??Re.minDelayMs,maxDelayMs:e.maxDelayMs??Re.maxDelayMs,minRateCharsPerMs:e.minRateCharsPerMs??Re.minRateCharsPerMs,maxBufferedMs:e.maxBufferedMs??Re.maxBufferedMs,arrivalRateTauMs:e.arrivalRateTauMs??Re.arrivalRateTauMs,arrivalRateHeadroom:e.arrivalRateHeadroom??Re.arrivalRateHeadroom,maxPendingChars:e.maxPendingChars??Re.maxPendingChars},s=e.clock??Hr,o=[];let c="",f=null,m=0,y=!0,I=!1,_=null,b=0,T=s.now(),B=!1;const v=()=>{_==null||_(),_=null},L=(p,u)=>{const A=p.type==="reasoning_delta"||p.type==="answer_delta"?p.text.length:0;o.push({kind:"event",event:p,arrivedAt:u,chars:A}),v()},q=p=>{if(!f||!c)return;const u=Vr(c,p,r.maxPendingChars);for(const A of u.pieces)A&&L({type:f,text:A},m),m=s.now();c=u.pending,c||(f=null)},V=p=>{if(!y)return;const u=s.now();if(p.type==="reasoning_delta"||p.type==="answer_delta"){const A=p.type;if(!p.text)return;if(!B){B=!0,b+=p.text.length,T=u;const H=Array.from(p.text)[0];L({type:A,text:H},u);const O=p.text.slice(H.length);if(O)for(f=A,c=O,m=u,q(!1);c.length>=r.maxPendingChars;)q(!1);return}f&&f!==A&&q(!0),f||(f=A,m=u),c+=p.text;const N=Math.max(0,u-T);for(b*=Math.exp(-N/r.arrivalRateTauMs),b+=p.text.length,T=u,q(!1);c.length>=r.maxPendingChars;)q(!1);return}Wr(p)&&q(!0),L(p,u)},G=(async()=>{var p;try{for await(const u of t)V(u);y&&q(!0)}catch(u){y&&!((p=e.signal)!=null&&p.aborted)&&(q(!0),o.push({kind:"error",error:u,arrivedAt:s.now(),chars:0}))}finally{I=!0,v()}})(),j=()=>o.length||I?Promise.resolve():new Promise(p=>{_=p});return{events:async function*(){var u,A,N,H;let p=Number.NEGATIVE_INFINITY;try{for(;;){if(await j(),!o.length){if(I||!y)return;continue}const O=o[0];if(O.kind==="error")throw o.shift(),O.error;if(O.chars&&!((u=e.isHidden)!=null&&u.call(e))){const k=s.now(),Ie=o.reduce((fe,pe)=>fe+pe.chars,0),De=((A=o.find(fe=>fe.chars))==null?void 0:A.arrivedAt)??k,P=Math.max(0,r.maxBufferedMs-(k-De)),z=b*Math.exp(-Math.max(0,k-T)/r.arrivalRateTauMs)/r.arrivalRateTauMs,Se=P>0?Ie/P:Number.POSITIVE_INFINITY,Fe=Math.max(r.minRateCharsPerMs,z*r.arrivalRateHeadroom,Se),J=Math.min(r.maxDelayMs,Math.max(r.minDelayMs,O.chars/Fe)),X=Math.max(0,O.arrivedAt+r.maxBufferedMs-k),Z=Math.max(O.arrivedAt,p+Math.min(J,X));if(await s.sleep(Math.max(0,Z-s.now()),e.signal),!y||(N=e.signal)!=null&&N.aborted)return}o.shift(),p=s.now(),yield O.event}}finally{y&&(y=!1,v(),await((H=t.return)==null?void 0:H.call(t,void 0))),await G}}(),takeAcceptedForStop(){var u;if(!y)return[];y=!1,f&&c&&(L({type:f,text:c},m),c="",f=null);const p=o.flatMap(A=>A.kind==="event"&&A.event.type!=="done"&&A.event.type!=="error"?[A.event]:[]);return o.length=0,v(),(u=t.return)==null||u.call(t,void 0),p}}}const $r=750;function Kr(t,e){for(let r=t.length-1;r>=0;r-=1)if(e(t[r]))return r;return-1}function We(t){const e=i.useRef(t);return i.useLayoutEffect(()=>{e.current=t}),i.useCallback((...r)=>e.current(...r),[])}function zr(t){const[e,r]=i.useState([]),[s,o]=i.useState(!1),[c,f]=i.useState(""),m=i.useRef(!1),y=i.useRef(null),I=i.useRef(null),_=i.useRef(null),b=i.useRef(null),T=i.useRef(!1),B=i.useRef(null),v=i.useRef(null),L=i.useRef("cleared"),q=i.useRef(null),V=i.useRef(null),[G,j]=i.useState(null),[M,p]=i.useState(null),u=i.useRef([]),A=i.useRef(Mt()),N=i.useRef(null),H=i.useRef(null),O=i.useRef(!1),k=i.useRef(t),Ie=i.useRef(tt()),De=i.useRef(0),P=i.useRef(0),z=i.useRef(t.sessionId),Se=i.useRef(t.sessionId);Se.current!==t.sessionId&&(Se.current=t.sessionId,z.current!==t.sessionId&&(P.current+=1,q.current=null)),k.current=t,u.current=e,i.useEffect(()=>()=>{var l;v.current!==null&&window.clearTimeout(v.current),(l=y.current)==null||l.abort(),I.current=null,_.current!==null&&cancelAnimationFrame(_.current),b.current!==null&&window.clearTimeout(b.current),V.current=null},[]),i.useEffect(()=>{m.current||(z.current=t.sessionId)},[t.sessionId]),i.useEffect(()=>{const l=m.current&&t.sessionId===z.current?N.current:null;O.current=l!==null,l&&(r(l),u.current=l)},[t.sessionId]);const Fe=i.useMemo(()=>{const l={};for(const w of e)for(const R of w.blocks??[])if(R.kind==="tool")for(const g of R.results??[])l[g.route_id]=g;return l},[e]),J=()=>`m${++De.current}_${Date.now().toString(36)}`,X=(l,w=!0)=>{const R={...A.current,messages:N.current??u.current,sessionId:z.current},g=He(R,l);A.current=g,N.current&&(N.current=g.messages);const h=l.type==="event"&&l.event.type==="stream_start"?l.event.session_id:null;return h?(z.current=h,k.current.onSessionId(h)):g.sessionId&&g.sessionId!==R.sessionId&&(z.current=g.sessionId,k.current.onSessionId(g.sessionId)),g.title!==R.title&&k.current.onTitle(g.title),w&&(u.current=g.messages,r(g.messages)),g},Z=()=>H.current===P.current||O.current,fe=()=>{_.current!==null&&(cancelAnimationFrame(_.current),_.current=null),b.current!==null&&(window.clearTimeout(b.current),b.current=null)},pe=()=>{fe(),document.visibilityState!=="hidden"&&(!O.current||!N.current||(T.current=!1,u.current=N.current,r(N.current)))},Ge=()=>{if(!O.current||document.visibilityState==="hidden"||_.current!==null||b.current!==null)return;const l=()=>{_.current=null,b.current=null,pe()};typeof requestAnimationFrame=="function"?_.current=requestAnimationFrame(l):b.current=window.setTimeout(l,0)};i.useEffect(()=>{const l=()=>{document.visibilityState==="visible"&&T.current&&Ge()};return document.addEventListener("visibilitychange",l),()=>document.removeEventListener("visibilitychange",l)});const ie=l=>{if(y.current!==l||(v.current!==null&&(window.clearTimeout(v.current),v.current=null),L.current==="cleared"))return;const w=L.current==="shown";L.current="cleared",w&&X({type:"clear_workspace_status"},Z())},$e=(l,w)=>{v.current!==null&&window.clearTimeout(v.current),L.current="armed",v.current=window.setTimeout(()=>{v.current=null,!(L.current!=="armed"||y.current!==l||l.signal.aborted||P.current!==w)&&(L.current="shown",X({type:"workspace_status"},Z()))},$r)},Ye=(l,w)=>{const R=q.current;!R||R.controller!==l||R.tracker.recordStreamStart(w,performance.now())},ue=(l,w)=>{const R=q.current;!R||R.controller!==l||R.tracker.recordTerminal(w)};i.useLayoutEffect(()=>{const l=q.current;if(!l)return;const w=e.at(-1);if((w==null?void 0:w.role)!=="assistant"||!(w.blocks??[]).some(h=>h.kind==="tool"||h.kind==="reasoning"&&!!h.text.trim()||h.kind==="answer"&&!!h.text.trim()))return;const g=performance.now();l.tracker.recordFirstVisible(g);for(const h of w.blocks??[])h.kind==="reasoning"&&h.text.trim()?l.tracker.recordSemantic("reasoning",g):h.kind==="tool"?l.tracker.recordSemantic("tool",g):h.kind==="answer"&&h.text.trim()&&l.tracker.recordSemantic("answer",g)},[e]);const K=(l,w=!0)=>{X({type:"event",event:l},w)},ge=async(l,w)=>{var h;const R=await st(l);let g=It(R);return((h=B.current)==null?void 0:h.sessionId)===l&&(g=B.current.messages,B.current=null),P.current!==w&&!(H.current===w&&O.current&&k.current.sessionId===l)?null:(r(g),u.current=g,N.current=g,A.current=He(A.current,{type:"load",messages:g,sessionId:l}),g)},he=(l,w,R,g,h,D)=>{const F=++P.current;H.current=F,O.current=!0,m.current=!0;const C=new AbortController;y.current=C;const Q=l.text;return Ie.current=l,z.current=w.session_id,f(""),r(R),N.current=R,A.current=He(A.current,{type:"start",messages:R,sessionId:w.session_id}),o(!0),q.current=D?null:{controller:C,tracker:new qr(performance.now())},L.current="cleared",(async()=>{var _e,be,je,Qe;let E=!1,le=!1,ne=!1,ee=!1,$=!1,se=!1;try{const W=D?Or(D,{signal:C.signal}):Tr(w,{signal:C.signal}),te=!D&&Ne()&&Er(),oe=te?Gr(W,{signal:C.signal,isHidden:()=>document.visibilityState==="hidden"}):null;oe&&(I.current={controller:C,stream:oe});for await(const S of(oe==null?void 0:oe.events)??W){S.type==="stream_start"&&(E=!0,le=S.provider_execution!==!1,Ye(C,S.request_id)),S.type==="sandbox_start"&&$e(C,F),(S.type==="sandbox_ready"||S.type==="workspace_ready"||S.type==="lifecycle")&&ie(C),(S.type==="reasoning_start"||S.type==="reasoning_delta"||S.type==="tool_call"||S.type==="app_start"||S.type==="app_result"||S.type==="artifact_start"||S.type==="artifact_ready"||S.type==="artifact_error"||S.type==="answer_delta"||S.type==="done"||S.type==="error")&&ie(C),(S.type==="done"||S.type==="error")&&(ee=!0,$=S.type==="error",ue(C,S.type==="error"?"error":"complete"),S.type==="error"&&["openrouter_monthly_budget_exhausted","openrouter_unavailable","openrouter_byok_credential_invalid","openrouter_byok_billing_error","openrouter_byok_rate_limit","hf_inference_billing_exhausted"].includes(S.code??"")&&(ne=!0,k.current.onInterrupted(l)));const we=Z(),Le=we&&!(te&&document.visibilityState==="hidden"),qe=S.type==="reasoning_delta"||S.type==="answer_delta",Je=!["stream_start","sandbox_start","sandbox_ready","workspace_ready","session_title_start","session_title_delta","session_title_done","reasoning_delta","answer_delta"].includes(S.type);te&&Je&&pe(),!C.signal.aborted&&(we||S.type==="stream_start"||S.type==="session_title_start"||S.type==="session_title_delta"||S.type==="session_title_done")?te&&qe?(K(S,!1),T.current=T.current||we,Ge()):(K(S,Le),te&&we&&!Le&&(T.current=!0)):C.signal.aborted||K(S,!1)}}catch(W){if($=!0,!C.signal.aborted){if(ie(C),W instanceof Me&&W.code==="chat_temporarily_disabled")se=!0,p({question:Q,draft:l}),P.current===F&&(r(g),u.current=g,f(""));else if(W instanceof Me&&W.code==="chat_capacity"){se=!0;const te=W.retryAfterSeconds??5,oe={question:Q,draft:l,request:w,optimistic:R,original:g,edit:h,retryAfterSeconds:te,retryAt:Date.now()+te*1e3};V.current=oe,j({question:Q,draft:l,retryAt:oe.retryAt,retryAfterSeconds:te}),P.current===F&&(r(g),u.current=g,f(""))}else ue(C,"network_error"),W instanceof Me&&["paper_context_unavailable","paper_mention_unavailable","paper_mentions_disabled","paper_selection_disabled","paper_selection_requires_reader","paper_selection_paper_mismatch","paper_selection_version_mismatch","paper_selection_page_invalid","paper_selection_too_large","chat_storage_quota_exceeded"].includes(W.code??"")&&(se=!0,k.current.onInterrupted(l),P.current===F&&(r(g),u.current=g,f(W.message))),W instanceof Me&&["openrouter_monthly_budget_exhausted","openrouter_unavailable","openrouter_byok_credential_invalid","openrouter_byok_billing_error","openrouter_byok_rate_limit","hf_inference_billing_exhausted"].includes(W.code??"")&&(ne=!0,k.current.onInterrupted(l));!se&&P.current===F&&K({type:"error",message:W instanceof Error?W.message:"The assistant stream failed.",code:W instanceof Me?W.code:void 0})}}finally{if(y.current===C){if(((_e=I.current)==null?void 0:_e.controller)===C&&(pe(),I.current=null),ie(C),!ee&&!C.signal.aborted&&ue(C,"network_error"),m.current=!1,o(!1),se)k.current.onSettled(w.session_id);else if(!C.signal.aborted){(E&&le||ne)&&((je=(be=k.current).onProviderTerminal)==null||je.call(be));const W=z.current;if(h&&!E)P.current===F&&(r(h.snapshot),u.current=h.snapshot,f("Couldn’t resend this message. Your original conversation was restored."));else if(W){P.current===F&&h&&($||!ee)&&(r(h.snapshot),u.current=h.snapshot);try{const te=await ge(W,F);te&&h&&te.some(oe=>oe.id===h.targetId)&&f("Couldn’t resend this message. Your original conversation was restored.")}catch{P.current===F&&X({type:"settle"})}}else P.current===F&&X({type:"settle"});k.current.onSettled(W)}((Qe=q.current)==null?void 0:Qe.controller)===C&&(q.current=null)}}})(),!0},ye=We(l=>{var ne,ee;const w=typeof l=="string"?tt(l.trim()):l,R=w.text;if(!R||R.length>8e3||m.current||V.current)return!1;const g=u.current,h=[...g].reverse().find($=>$.role==="user"),D=h!=null&&h.status&&h.status!=="complete"&&h.revision?{replace_message_id:h.id,prior_revision:h.revision}:null,F={id:J(),role:"user",text:R,paperMentions:w.paperMentions,paperSelection:w.paperSelection},C={id:J(),role:"assistant",streaming:!0,blocks:[]},Q=D&&h?Kr(g,$=>$.id===h.id):-1,E=Q<0?[...g,F,C]:[...g.slice(0,Q),F,C],le=(ee=(ne=k.current).viewerContext)==null?void 0:ee.call(ne);return he(w,{message:R,paper_mentions:w.paperMentions.map(({route_id:$,title:se,start:_e,end:be})=>({route_id:$,title:se,start:_e,end:be})),session_id:k.current.sessionId,client_message_id:crypto.randomUUID(),web_search_enabled:!!k.current.webSearchEnabled,reasoning_effort:k.current.reasoningEffort??"low",...k.current.primaryPaperRouteId?{primary_paper_route_id:k.current.primaryPaperRouteId}:{},...le?{viewer_context:le}:{},...w.paperSelection?{paper_selection:yt(w.paperSelection)}:{},...!k.current.sessionId&&k.current.initialModel?{initial_model:k.current.initialModel}:{},...D??{}},E,g)}),Ee=We((l,w)=>{var ne,ee;const R=typeof w=="string"?tt(w.trim()):w,g=R.text;if(!g||g.length>8e3||m.current||V.current)return!1;const h=u.current.slice(),D=h.findIndex($=>$.id===l&&$.role==="user");if(D<0)return!1;const F=h[D];if(!k.current.sessionId||!F.revision)return!1;const C={id:F.id,role:"user",text:g,paperMentions:R.paperMentions,paperSelection:R.paperSelection,revision:F.revision+1,status:"generating"},Q={id:J(),role:"assistant",streaming:!0,blocks:[]},E=[...h.slice(0,D),C,Q],le=(ee=(ne=k.current).viewerContext)==null?void 0:ee.call(ne);return he(R,{message:g,paper_mentions:R.paperMentions.map(({route_id:$,title:se,start:_e,end:be})=>({route_id:$,title:se,start:_e,end:be})),session_id:k.current.sessionId,client_message_id:crypto.randomUUID(),web_search_enabled:!!k.current.webSearchEnabled,reasoning_effort:k.current.reasoningEffort??"low",...k.current.primaryPaperRouteId?{primary_paper_route_id:k.current.primaryPaperRouteId}:{},...le?{viewer_context:le}:{},...R.paperSelection?{paper_selection:yt(R.paperSelection)}:{},replace_message_id:F.id,prior_revision:F.revision},E,h,{targetId:F.id,snapshot:h})}),Ke=i.useCallback(()=>{V.current=null,j(null)},[]),me=We(()=>{const l=V.current;return!l||Date.now()<l.retryAt||m.current?!1:(V.current=null,j(null),he(l.draft,l.request,l.optimistic,l.original,l.edit))}),Ae=We(()=>{var D,F;if(!y.current)return;const l=y.current;ie(l),ue(l,"stopped"),l.abort();const w=((D=I.current)==null?void 0:D.controller)===l?I.current.stream.takeAcceptedForStop():[];I.current=null;for(const C of w)K(C,!1);pe(),y.current=null,((F=q.current)==null?void 0:F.controller)===l&&(q.current=null),m.current=!1,o(!1);const R=X({type:"stop"},!1).messages;N.current=R,u.current=R,r(R),k.current.onInterrupted(Ie.current);const g=z.current;g&&(B.current={sessionId:g,messages:R}),g&&or(g).catch(()=>{});const h=++P.current;window.setTimeout(()=>{g&&P.current===h?ge(g,h).catch(()=>{}).finally(()=>k.current.onSettled(g)):g||k.current.onSettled(null)},450)}),Ce=i.useCallback((l,w)=>r(R=>R.map(g=>{var h;return g.id!==l?g:{...g,blocks:(h=g.blocks)==null?void 0:h.map((D,F)=>F===w&&(D.kind==="reasoning"||D.kind==="tool")?{...D,open:!D.open}:D)}})),[]),ze=i.useCallback(()=>{var l;P.current+=1,v.current!==null&&(window.clearTimeout(v.current),v.current=null),L.current="cleared",(l=y.current)==null||l.abort(),y.current=null,I.current=null,fe(),T.current=!1,B.current=null,q.current=null,V.current=null,j(null),m.current=!1,z.current=null,N.current=null,A.current=He(A.current,{type:"reset"}),H.current=null,O.current=!1,r([]),o(!1),f("")},[]),Pe=We((l,w,R=!1)=>{var g;if(P.current+=1,v.current!==null&&(window.clearTimeout(v.current),v.current=null),L.current="cleared",fe(),T.current=!1,q.current=null,V.current=null,j(null),m.current&&w!==void 0&&w===z.current&&N.current){O.current=!0,r(N.current),u.current=N.current,f("");return}if(O.current=!1,m.current||((g=y.current)==null||g.abort(),y.current=null,N.current=null,H.current=null,O.current=!1),R&&w){const h=[...l].reverse().find(D=>D.role==="user");if(h){const D={text:h.text??"",paperMentions:h.paperMentions??[],...h.paperSelection?{paperSelection:h.paperSelection}:{}},F=[...l,{id:`${h.id}-active`,role:"assistant",streaming:!0,blocks:[]}];he(D,{message:D.text,session_id:w,client_message_id:"reconnect",web_search_enabled:!!k.current.webSearchEnabled,reasoning_effort:k.current.reasoningEffort??"low"},F,l,void 0,w);return}}r(l),u.current=l,A.current=He(A.current,{type:"load",messages:l,sessionId:w??k.current.sessionId}),m.current||o(!1),f("")});return{messages:e,busy:s,papers:Fe,sessionError:c,capacityRequest:G,disabledRequest:M,send:ye,editAndResend:Ee,retryCapacity:me,cancelCapacity:Ke,dismissDisabled:()=>p(null),stop:Ae,toggleBlock:Ce,reset:ze,load:Pe}}const de=tt,Qr=["Summarize the main contributions","Explain in simple terms","Identify the main limitations"],Jr=()=>{const t=sessionStorage.getItem(rt);if(!t)return null;try{return gr(JSON.parse(t),t)}catch{}return de(t)},Xr=({enabled:t,workspaceKey:e,children:r})=>t?n.jsx(Zt,{workspaceKey:e,children:r}):n.jsx(n.Fragment,{children:r}),Zr=({enabled:t,children:e})=>t?n.jsx(er,{variant:"chat",children:e}):n.jsx(n.Fragment,{children:e}),en=({mode:t="general",routeSessionId:e,primaryPaper:r,currentPage:s,paperSelection:o,onPaperSelectionChange:c,onSessionId:f,onReaderSubmit:m,onReaderNewChat:y})=>{var it,ot,ct,lt,ut,dt,ft,pt,ht;const{sessionId:I}=Ht(),_=e??(t==="general"?I:void 0),b=Wt(),[T,B]=Vt(),{user:v,isLoading:L}=Gt(),q=$t(),V=zt(),G=Qt({queryKey:["chatAvailability"],queryFn:()=>Ve.getAvailability(),refetchInterval:3e4,retry:!1,enabled:Ne()&&!!v}),j=((it=G.data)==null?void 0:it.status)==="paused"||t==="paper"&&((ot=G.data)==null?void 0:ot.paper_reader_chat_enabled)===!1,[M,p]=i.useState([]),[u,A]=i.useState(!1),[N,H]=i.useState(""),[O,k]=i.useState(()=>_?{id:_,status:"loading"}:null),[Ie,De]=i.useState(0),P=i.useRef(cr()),z=i.useRef(T.get("model")||((ct=P.current)==null?void 0:ct.model)),[Se,Fe]=i.useState(V?lr:ur),[J,X]=i.useState(z.current||dr),Z=((lt=Se.find(a=>a.id===J))==null?void 0:lt.provider)??"huggingface",fe=br(!!(v&&Z==="openrouter")),pe=i.useRef(Z);pe.current=Z;const[Ge,ie]=i.useState(""),[$e,Ye]=i.useState(null),[ue,K]=i.useState(()=>de()),[ge,he]=i.useState(()=>{var a;return((a=P.current)==null?void 0:a.webSearchEnabled)??!1}),[ye,Ee]=i.useState(()=>{var a;return((a=P.current)==null?void 0:a.reasoningEffort)??"low"}),Ke=!!((ut=G.data)!=null&&ut.web_search_available),[me,Ae]=i.useState(()=>{var d,x;const a=(d=T.get("q"))==null?void 0:d.trim();return a?de(a):((x=P.current)==null?void 0:x.draft)??de()}),Ce=i.useRef(!1),ze=i.useRef(!1),Pe=i.useRef(!1),[l,w]=i.useState(()=>typeof window>"u"||window.innerWidth>900),R=i.useRef(new Set),g=i.useRef(!1),h=i.useRef(_),D=i.useRef(null),F=i.useRef(null),C=i.useRef(null);h.current=_;const Q=i.useCallback(async()=>{if(!v)return;const a=!g.current;a&&A(!0);try{const d=await fr();p(x=>{const Y=D.current,U=Y?x.find(Be=>Be.id===Y):void 0;if(!U)return d;const ae=d.find(Be=>Be.id===Y);return[ae?{...ae,title:U.title,is_busy:!0}:U,...d.filter(Be=>Be.id!==Y)]}),g.current=!0,H("")}catch(d){H(d instanceof Error?d.message:"Could not load chats")}finally{a&&A(!1)}},[v]),E=zr({sessionId:_??null,initialModel:J,webSearchEnabled:Ke&&ge,reasoningEffort:ye,primaryPaperRouteId:t==="paper"?r==null?void 0:r.routeId:void 0,viewerContext:t==="paper"&&s?()=>({page:Math.max(1,Math.min(1e4,s()))}):void 0,onSessionId:a=>{D.current=a;const d=a!==h.current,x=(h.current??null)===F.current,Y=new Date().toISOString();p(U=>U.some(ae=>ae.id===a)?U.map(ae=>ae.id===a?{...ae,is_busy:!0}:ae):[{id:a,title:"New chat",selected_model:J,created_at:Y,updated_at:Y,message_count:1,is_busy:!0,web_search_enabled:ge,reasoning_effort:ye},...U]),d&&x&&ie("New chat"),x&&(C.current=a,k({id:a,status:"loaded"}),d&&(t==="paper"?f==null||f(a):b(`/chat/${a}`,{replace:!0})))},onTitle:a=>{const d=D.current??h.current;d&&!R.current.has(d)&&(d===h.current&&ie(a),p(x=>x.map(Y=>Y.id===d?{...Y,title:a}:Y)))},onSettled:a=>{a&&p(d=>d.map(x=>x.id===a?{...x,is_busy:!1}:x)),D.current=null,F.current=null,Q()},onProviderTerminal:()=>{pe.current==="openrouter"&&q.invalidateQueries({queryKey:wr})},onInterrupted:a=>{K(a),c==null||c(a.paperSelection)}}),le=E.send;i.useEffect(()=>{E.capacityRequest&&(K(E.capacityRequest.draft),c==null||c(E.capacityRequest.draft.paperSelection))},[E.capacityRequest,c]);const ne=i.useCallback(a=>{sessionStorage.setItem(rt,JSON.stringify(a)),sessionStorage.setItem(Xe,J),sessionStorage.setItem(pr,ye),sessionStorage.setItem(Ze,"1"),sessionStorage.setItem(et,"1");const d=t==="paper"&&r?`/pdf/${r.routeId}`:h.current?`/chat/${h.current}`:"/chat";window.location.href=Kt(d,Z==="huggingface")},[t,r,ye,J,Z]),ee=i.useCallback((a,d)=>{sessionStorage.setItem(rt,JSON.stringify(a)),sessionStorage.setItem(Xe,J),sessionStorage.removeItem(Ze),sessionStorage.removeItem(et),Ae(de()),K(a),c==null||c(a.paperSelection),H(d)},[c,J]),$=i.useCallback(async a=>{const d=c?o?{...a,paperSelection:o}:{text:a.text,paperMentions:a.paperMentions}:a;if(!v){ne(d);return}if(Z==="huggingface"&&!ze.current){if(Pe.current)return;Pe.current=!0;try{if(!(await Ve.getInferenceBilling()).connected){if(sessionStorage.getItem(et)==="1"){ee(d,"Hugging Face inference authorization was not completed. Your prompt is ready to retry.");return}ne(d);return}ze.current=!0}catch(Y){ee(d,Y instanceof Error?Y.message:"Could not check Hugging Face authorization.");return}finally{Pe.current=!1}}const x=h.current??null;if(sessionStorage.removeItem(Ze),!le(d)){ee(d,"Your prompt was not sent. It is ready to retry.");return}F.current=x,D.current=x,sessionStorage.removeItem(rt),sessionStorage.removeItem(Xe),sessionStorage.removeItem(et),hr(),K(de()),c==null||c(void 0),t==="paper"&&(m==null||m())},[ne,t,c,m,o,ee,Z,le,v]);i.useEffect(()=>{if(L||!v)return;const a=sessionStorage.getItem(Xe);a&&X(a),Q(),mr().then(Y=>{if(Fe(Y.items),!h.current){const U=z.current||a;X(U&&Y.items.some(ae=>ae.id===U)?U:Y.default_model)}});const d=Jr(),x=sessionStorage.getItem(Ze)==="1";d&&(c==null||c(d.paperSelection),x?Ae(d):K(d))},[L,c,Q,v]),i.useEffect(()=>{if(!_){C.current!==null&&!E.busy&&(C.current=null,E.reset(),he(!1),Ee("low")),k(null),Ye(null);return}if(C.current===_||(Ye(null),k(d=>(d==null?void 0:d.id)===_&&d.status==="loading"?d:{id:_,status:"loading"}),L||!v))return;let a=!1;return H(""),st(_).then(d=>{var Y,U;if(a)return;E.load(It(d),_,d.is_busy),X(d.selected_model),he(P.current&&d.messages.length===0?P.current.webSearchEnabled:d.web_search_enabled),Ee(P.current&&d.messages.length===0?P.current.reasoningEffort:d.reasoning_effort??"high"),ie(d.title);const x=(U=(Y=[...d.messages].reverse().find(ae=>ae.role==="user"&&ae.viewer_context))==null?void 0:Y.viewer_context)==null?void 0:U.page;Ye(x??null),C.current=_,k({id:_,status:"loaded"})}).catch(d=>{if(a)return;const x=d instanceof Error?d.message:"Chat not found";E.reset(),H(x),k({id:_,status:"error",error:x})}),()=>{a=!0}},[L,_,v,E.busy,Ie]),i.useEffect(()=>{var Y;const a=(Y=T.get("q"))==null?void 0:Y.trim();if(!a)return;Ce.current=!1;const d=T.get("model");d&&X(d),Ae(de(a));const x=new URLSearchParams(T);x.delete("q"),x.delete("model"),B(x,{replace:!0})},[T,B]),i.useEffect(()=>{if(L||E.busy||!me.text||Ce.current||v&&ge&&G.isFetching||_&&(O==null?void 0:O.status)!=="loaded")return;const a=window.setTimeout(()=>{if(Ce.current)return;Ce.current=!0,$(me).finally(()=>Ae(de()))},0);return()=>window.clearTimeout(a)},[L,G.isFetching,E.busy,me,_,O==null?void 0:O.status,$,v,ge]),i.useEffect(()=>{const a=()=>{!v||E.busy||Q()};return window.addEventListener("focus",a),()=>window.removeEventListener("focus",a)},[E.busy,Q,v]);const se=()=>{D.current=null,E.reset(),K(de()),c==null||c(void 0),he(!1),Ee("low"),ie(""),t==="paper"?y==null||y():b("/chat")},_e=async(a,d)=>{try{const x=await nt(a,{title:d});return R.current.add(a),a===_&&ie(x.title),p(Y=>Y.map(U=>U.id===a?x:U)),!0}catch(x){return H(x instanceof Error?x.message:"Rename failed"),!1}},be=async a=>{const d=a===_&&E.busy;if(window.confirm(d?"Stop and delete this chat? This cannot be undone.":"Delete this chat? This cannot be undone.")){d&&E.stop();try{if(d){const x=Date.now()+3e3;for(;(await st(a)).is_busy;){if(Date.now()>=x)throw new Error("Generation is still stopping. The chat was not deleted.");await new Promise(U=>window.setTimeout(U,150))}}await yr(a),a===_&&se(),await Q()}catch(x){H(x instanceof Error?x.message:"Delete failed")}}},je=Pr({messages:E.messages,refreshSessions:Q,resetChat:E.reset,restoreDraft:K,clearTitle:()=>ie("")}),Qe=async a=>{const d=J;if(X(a),!!_)try{const x=await nt(_,{selected_model:a});p(Y=>Y.map(U=>U.id===_?{...U,selected_model:x.selected_model}:U)),H("")}catch(x){X(d),H(x instanceof Error?x.message:"Model change failed")}},W=async a=>{const d=ye;if(Ee(a),!!_)try{const x=await nt(_,{reasoning_effort:a});p(Y=>Y.map(U=>U.id===_?x:U))}catch(x){Ee(d),H(x instanceof Error?x.message:"Effort change failed")}},[te,oe]=i.useState(60);i.useLayoutEffect(()=>{const a=document.querySelector(".app-header");if(!a)return;const d=()=>oe(a.offsetHeight);d();const x=new ResizeObserver(d);return x.observe(a),()=>x.disconnect()},[]);const S=M.find(a=>a.id===_),we=E.messages.length===0,Le=(O==null?void 0:O.id)===_,qe=!!(_&&(L||v&&(!Le||(O==null?void 0:O.status)==="loading"))),Je=Le&&(O==null?void 0:O.status)==="error"?O.error:void 0,Nt=!!((dt=fe.data)!=null&&dt.fallback_enabled),Dt=c?o?{...ue,paperSelection:o}:{text:ue.text,paperMentions:ue.paperMentions}:ue,at={onSend:$,busy:E.busy,onStop:E.stop,draft:Dt,onDraftChange:a=>{c?(K({text:a.text,paperMentions:a.paperMentions}),a.paperSelection!==o&&c(a.paperSelection)):K(a)},models:Se,selectedModel:J,onModelChange:a=>void Qe(a),disabled:j||L,describedBy:j?"chat-paused-description":void 0,paperMentionsEnabled:!!((ft=G.data)!=null&&ft.paper_mentions_enabled),paperSelectionEnabled:((pt=G.data)==null?void 0:pt.paper_reader_selection_enabled)===!0,webSearchAvailable:Ke,webSearchEnabled:ge,onWebSearchChange:he,reasoningEffort:ye,onReasoningEffortChange:a=>void W(a)};return n.jsx(Xr,{enabled:t==="general",workspaceKey:_??"new-chat",children:n.jsxs("div",{className:`chat-page${t==="paper"?" chat-page--reader":""}`,style:{height:t==="paper"?"100%":`calc(100dvh - ${te}px)`},children:[t==="general"&&n.jsx(Fr,{sessions:M,activeSessionId:_,loading:u,error:N,open:l,onClose:()=>w(!1),onNew:se,onNavigate:a=>b(`/chat/${a}`),onRename:_e,onDelete:a=>void be(a)}),n.jsx(Zr,{enabled:t==="general",children:n.jsxs("section",{className:"chat-main","data-testid":"active-chat-pane",children:[n.jsxs("div",{className:"chat-topbar",children:[t==="general"&&!l&&n.jsx("button",{type:"button",className:"icon-btn",onClick:()=>w(!0),title:"Open sidebar",children:n.jsx(Tt,{})}),t==="paper"&&n.jsx("button",{type:"button",className:"chat-reader-action",onClick:se,children:"New chat"}),n.jsx("span",{className:"chat-topbar-title",children:qe?(S==null?void 0:S.title)||"":Ge||(S==null?void 0:S.title)||(we?"":"New chat")}),V&&n.jsx("span",{className:"chat-staging-badge",children:"Staging"}),t==="paper"&&n.jsx(mt,{className:"chat-reader-action",to:"/chat",children:"All chats"}),t==="general"&&(S==null?void 0:S.primary_paper)&&n.jsx(mt,{className:"chat-reader-action",to:`/pdf/${S.primary_paper.route_id}`,onClick:()=>{const a=S.primary_paper.route_id;sessionStorage.setItem(`pwc:reader:session:${a}`,S.id),$e&&sessionStorage.setItem(`pwc:reader:page:${a}`,String($e))},children:"Open reader"}),_&&Le&&(O==null?void 0:O.status)==="loaded"&&!we&&n.jsx(Yr,{sessionId:_,busy:E.busy,loading:qe,hasPaperSelection:E.messages.some(a=>!!a.paperSelection),onError:H})]}),qe&&!me.text?n.jsxs("div",{className:"chat-session-loading",role:"status","aria-live":"polite",children:[n.jsx(Ot,{}),n.jsx("span",{children:"Loading conversation…"})]}):Je?n.jsxs("div",{className:"chat-session-load-error",role:"alert",children:[n.jsx("p",{children:Je}),n.jsx("button",{type:"button",onClick:()=>{k({id:_,status:"loading"}),De(a=>a+1)},children:"Try again"})]}):we&&!me.text?n.jsx("div",{className:"chat-empty",children:n.jsxs("div",{className:"chat-empty-inner",children:[n.jsx("div",{className:"chat-empty-eyebrow",children:t==="paper"?"Paper chat":"Research chat"}),n.jsx("h1",{className:"chat-empty-title",children:t==="paper"?"Ask about this paper":n.jsxs(n.Fragment,{children:["Ask ",n.jsx("em",{children:"Papers With Code"})]})}),n.jsx("p",{className:"chat-empty-sub",children:t==="paper"?"Questions are grounded in the open paper. Add up to three other papers with @.":"Answers are grounded in a live hybrid search over papers, tasks, and benchmarks — with citations you can follow."}),V&&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(St,{variant:"empty",composerProps:at,provider:Z,paused:j,suggestions:t==="paper"?Qr:_r})]})}):n.jsxs(n.Fragment,{children:[E.sessionError&&n.jsx("div",{className:"chat-session-error",role:"alert",children:E.sessionError}),n.jsx(Lr,{messages:E.messages,papers:E.papers,busy:E.busy,queuedDraft:me.text?me:void 0,paperMentionsEnabled:!!((ht=G.data)!=null&&ht.paper_mentions_enabled),archivePending:je.pending,openRouterFallbackEnabled:Nt,onToggleBlock:E.toggleBlock,onEditAndResend:E.editAndResend,onArchiveOld:()=>void je.archiveOld(),onArchiveOldest:()=>void je.archiveOldest()}),n.jsx(St,{variant:"followup",composerProps:at,provider:Z,paused:j})]})]})}),E.capacityRequest&&n.jsx(Mr,{retryAt:E.capacityRequest.retryAt,onCancel:E.cancelCapacity,onRetry:()=>{E.retryCapacity()&&(K(de()),c==null||c(void 0))}}),E.disabledRequest&&n.jsx(Nr,{onClose:()=>{var d;const a=((d=E.disabledRequest)==null?void 0:d.draft)??ue;K(a),c==null||c(a.paperSelection),E.dismissDisabled(),G.refetch()}})]})})},vn=()=>n.jsx(en,{});export{Mr as ChatCapacityDialog,en as ChatExperience,vn as default};
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/ChatView-DVr-RWnO.js ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var Dt=Object.defineProperty;var Ft=(r,t,e)=>t in r?Dt(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var ke=(r,t,e)=>Ft(r,typeof t!="symbol"?t+"":t,e);import{d as Yt,A as Pt,S as qt,r as i,j as n,X as Bt,e as Et,c as Ut,u as Ht,a as Wt,y as Vt,g as $t,U as Gt,L as ht,b as Kt}from"./index-B5X8-Bq7.js";import{u as zt}from"./useQuery-D05r-Fqo.js";import{C as Qt,U as mt,b as Jt,A as Xt,a as Zt}from"./ArtifactWorkspace-CTFG-tNc.js";import{c as Ve}from"./chat-C6rpOyOn.js";import{h as er,i as Tt,j as tr,T as rr,d as kt,k as nr,l as sr,m as ar,n as tt,o as ir,t as gt,r as st,s as Ot,v as or,S as cr,P as lr,D as ur,w as dr,x as fr,y as rt,z as Xe,B as pr,E as Ze,F as et,G as hr,H as mr,I as gr,J as nt,K as yr}from"./chatLaunch-BYshi3Oy.js";import{S as _r}from"./chatPrompts-CDY3UGU1.js";import{u as br,O as wr}from"./openrouter-Ckakows2.js";import"./katex.min-BSBacQyE.js";import"./hover-card-ClPcsbgj.js";import"./github-BF4mMFfY.js";import"./github-GWy166ov.js";import"./PaperPreviewLink-Br9pyKgi.js";import"./index-LVXoOqbx.js";import"./papers-D7y8njf2.js";import"./file-text-DMqoegbt.js";import"./external-link-C6re1H68.js";import"./chevron-down-RoGVatuo.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 vr=Yt("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"}]]),ce=(r,t)=>new Promise(e=>{const s=setTimeout(o,r);function o(){t==null||t.removeEventListener("abort",o),clearTimeout(s),e()}t==null||t.addEventListener("abort",o)}),ve=r=>({arxiv_id:null,source:"arxiv",source_url:null,thumbnail_url:null,authors:[],published:null,conference:null,citation_count:null,tasks:[],methods:[],repositories:[],project_pages:[],...r}),xe={name:"Object Detection",slug:"object-detection"},Oe={name:"Real-Time Object Detection",slug:"real-time-object-detection"},xr={"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:ve({arxiv_id:"2502.12524",authors:[{name:"Y. Tian"},{name:"Q. Ye"},{name:"D. Doermann"}],published:"2025-02-18",citation_count:412,tasks:[xe,Oe],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:ve({arxiv_id:"2407.17140",authors:[{name:"W. Lv"},{name:"Y. Zhao"},{name:"J. Chang"}],published:"2024-07-24",citation_count:268,tasks:[xe,Oe],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:ve({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:[xe,Oe],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:ve({arxiv_id:"2406.03459",authors:[{name:"Q. Chen"},{name:"X. Su"},{name:"X. Zhang"}],published:"2024-06-05",citation_count:94,tasks:[xe,Oe],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:ve({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:[xe,Oe],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:ve({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:[xe,Oe],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:ve({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"},xe],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:ve({source:"external",source_url:"https://docs.ultralytics.com/models/",authors:[{name:"Ultralytics"}],published:"2025-01-02",tasks:[xe,Oe],repositories:[{url:"https://github.com/ultralytics/ultralytics",stars:46e3}],project_pages:[{url:"https://docs.ultralytics.com"}]})}},It=r=>r.map(t=>xr[t]),yt=It(["2502.12524","2407.17140","2410.13842","2406.03459","2304.08069","2405.14458","2401.17270","158342"]),_t=It(["2410.13842","2502.12524","2407.17140","2405.14458","2304.08069"]),bt="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.",wt="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.",vt=`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.`,Rr=["How do these compare on edge devices like Jetson?","Show me open-vocabulary detectors","What about small-object detection?"];async function*Sr(r,t){const e=()=>(t==null?void 0:t.aborted)===!0,s=r.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 ce(350,t),!e()){yield{type:"reasoning_start"};for(let o=0;o<bt.length;o+=6){if(await ce(14,t),e())return;yield{type:"reasoning_delta",text:bt.slice(o,o+6)}}if(await ce(400,t),!e()&&(yield{type:"reasoning_end"},await ce(300,t),!e()&&(yield{type:"tool_call",id:"call_1",name:"search_papers",args:{query:s,top_k:8}},await ce(1100,t),!e()&&(yield{type:"tool_result",id:"call_1",hits:yt.length,took_ms:214,results:yt},await ce(350,t),!e())))){yield{type:"reasoning_start"};for(let o=0;o<wt.length;o+=6){if(await ce(14,t),e())return;yield{type:"reasoning_delta",text:wt.slice(o,o+6)}}if(await ce(350,t),!e()&&(yield{type:"reasoning_end"},await ce(300,t),!e()&&(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 ce(900,t),!e()&&(yield{type:"tool_result",id:"call_2",hits:_t.length,took_ms:176,results:_t},await ce(400,t),!e())))){for(let o=0;o<vt.length;o+=4){if(await ce(11,t),e())return;yield{type:"answer_delta",text:vt.slice(o,o+4)}}yield{type:"done",followups:Rr,finish_reason:"success"}}}}}const De=()=>{const t=String("0").trim().toLowerCase();return t==="1"||t==="true"||t==="yes"},Er=()=>!0;class Ne extends Error{constructor(t,e,s,o){super(t),this.code=e,this.status=s,this.retryAfterSeconds=o,this.name="ChatStreamError"}}function Tr(r,t){if(De())try{Ve.reportLatency(r,t).catch(()=>{})}catch{}}function kr(r,t={}){return De()?Ir(r,t.signal):Sr(r.message,t.signal)}function Or(r,t={}){return Ar(r,t.signal)}async function*Ir(r,t){const e=await Ve.stream(r,t);yield*At(e)}async function*Ar(r,t){const e=await Ve.resumeStream(r,t);yield*At(e)}async function*At(r){if(!r.ok||!r.body){const o=r.ok?null:new Pt(r,await r.text());o&&qt(o);const c=o==null?void 0:o.detail,f=typeof c=="object"&&c!==null?c:null,m=r.status===403&&!c,y=Number(r.headers.get("Retry-After")),I=Number.isFinite(y)&&y>=0?Math.min(300,Math.ceil(y)):void 0;throw new Ne(m?"Chat on staging is limited to approved Hugging Face users. Sign in with an approved account and try again.":(o==null?void 0:o.message)||`Chat stream failed (${r.status})`,f&&"code"in f&&typeof f.code=="string"?f.code:m?"staging_access_required":void 0,r.status,I)}const t=r.body.getReader(),e=new TextDecoder;let s="";try{for(;;){const{done:o,value:c}=await t.read();if(o)break;s+=e.decode(c,{stream:!0});let f;for(;(f=s.indexOf(`
13
+
14
+ `))!==-1;){const m=s.slice(0,f);s=s.slice(f+2);const y=m.split(`
15
+ `).filter(I=>I.startsWith("data:")).map(I=>I.slice(5).trimStart()).join(`
16
+ `);!y||y==="[DONE]"||(yield JSON.parse(y))}}}finally{t.releaseLock()}}const Cr="https://huggingface.co/settings/inference-providers",xt="pwc.chat.billing-notice-dismissed.v1";function jr({provider:r}){const[t,e]=i.useState(()=>localStorage.getItem(xt)==="1");return!De()||t||r!=="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:Cr,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(xt,"1"),e(!0)},children:n.jsx(Bt,{size:15,"aria-hidden":"true"})})]})]})}function Rt({variant:r,composerProps:t,provider:e,paused:s,suggestions:o=[]}){var f;const c=n.jsxs(n.Fragment,{children:[n.jsx(jr,{provider:e}),s&&n.jsx("div",{id:"chat-paused-description",className:"chat-paused-banner",role:"status",children:"Chat is temporarily disabled. You can keep browsing and editing your conversations. New research runs will return when chat is restored."}),n.jsx(Qt,{...t,...r==="empty"?{autoFocus:!0}:{placeholder:(f=t.draft)!=null&&f.text?"Edit and send again…":"Ask a follow-up…"}}),r==="empty"&&n.jsx("div",{className:"chat-examples",children:o.map(m=>n.jsx("button",{type:"button",className:"chat-example",disabled:s,onClick:()=>{var y;return t.onSend({text:m,paperMentions:[],...(y=t.draft)!=null&&y.paperSelection?{paperSelection:t.draft.paperSelection}:{}})},children:m},m))})]});return r==="empty"?c:n.jsx("div",{className:"chat-composer-wrap",children:n.jsxs("div",{className:"chat-composer-inner",children:[c,n.jsx("div",{className:"chat-composer-foot",children:De()?n.jsxs(n.Fragment,{children:[e==="huggingface"&&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"}),"."]}),e==="openrouter"&&n.jsxs("span",{className:"chat-provider-attribution",children:["Powered by ",n.jsx("a",{href:"https://openrouter.ai",target:"_blank",rel:"noreferrer",children:"OpenRouter"}),"."]}),e==="openai"&&n.jsx("span",{className:"chat-provider-attribution",children:"Powered by OpenAI."}),n.jsx("span",{children:"The AI assistant can make mistakes. Double-check responses."})]}):n.jsx(n.Fragment,{children:"Assistant preview — responses are simulated."})})]})})}function Lr({messages:r,papers:t,busy:e,queuedDraft:s,paperMentionsEnabled:o,archivePending:c,openRouterFallbackEnabled:f,onToggleBlock:m,onEditAndResend:y,onArchiveOld:I,onArchiveOldest:_}){var M,p;const[b,k]=i.useState(null),B=i.useRef(null),v=i.useRef(null),L=i.useRef(null);i.useEffect(()=>{e?k(null):L.current=null},[e]),i.useLayoutEffect(()=>{const u=B.current;if(u){if(v.current!==null){u.scrollTop=v.current,v.current=null;return}if(L.current){const A=Array.from(u.querySelectorAll("[data-message-id]")).find(N=>N.dataset.messageId===L.current);if(A){const N=u.getBoundingClientRect(),H=A.getBoundingClientRect();u.scrollTop+=H.top-N.top-24;return}}u.scrollTop=u.scrollHeight}},[r]);const q=r.filter(u=>u.role==="user"),V=(M=q[0])==null?void 0:M.id,$=(p=q.at(-1))==null?void 0:p.id,j=(u,A)=>{var N;v.current=((N=B.current)==null?void 0:N.scrollTop)??null,m(u,A)};return n.jsx("div",{className:"chat-conversation",ref:B,children:n.jsxs("div",{className:"chat-conversation-inner",children:[r.length===0&&(s==null?void 0:s.text)&&n.jsx(mt,{id:"queued-launch-preview",text:s.text,paperMentions:s.paperMentions,paperSelection:s.paperSelection,isInitial:!0}),r.map(u=>u.role==="user"?n.jsx(mt,{id:u.id,text:u.text??"",paperMentions:u.paperMentions??[],paperSelection:u.paperSelection,paperMentionsEnabled:o,isInitial:u.id===V,editingAllowed:!e&&!!u.revision,editing:b===u.id,editNotice:u.id===V?"Sending will replace this conversation.":u.id===$?"Sending will replace the response.":"Sending will replace the response and all messages after it.",onEdit:()=>k(u.id),onCancel:()=>k(null),onResendDraft:A=>{u.id!==V&&(L.current=u.id);const N=y(u.id,A);return N?k(null):L.current=null,N}},u.id):n.jsx(Jt,{msg:u,papers:t,onToggleBlock:j,onArchiveOldChats:I,onArchiveOldestChats:_,archivePending:c,hfBilling:null,openRouterFallbackEnabled:f,feedbackEnabled:!0},u.id))]})})}function Mr({retryAt:r,onRetry:t,onCancel:e}){const[s,o]=i.useState(()=>Math.max(0,Math.ceil((r-Date.now())/1e3))),c=i.useRef(null);return i.useEffect(()=>{var I;const f=document.activeElement instanceof HTMLElement?document.activeElement:null;(I=c.current)==null||I.focus();const m=()=>o(Math.max(0,Math.ceil((r-Date.now())/1e3)));m();const y=window.setInterval(m,250);return()=>{window.clearInterval(y),f==null||f.focus()}},[r]),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:f=>{f.key==="Escape"&&(f.preventDefault(),e())},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:c,onClick:e,children:"Cancel"}),n.jsx("button",{type:"button",className:"chat-capacity-retry",disabled:s>0,onClick:t,children:"Try again"})]})]})})}function Nr({onClose:r}){const t=i.useRef(null);return i.useEffect(()=>{var s;const e=document.activeElement instanceof HTMLElement?document.activeElement:null;return(s=t.current)==null||s.focus(),()=>e==null?void 0:e.focus()},[]),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-disabled-title","aria-describedby":"chat-disabled-description",onKeyDown:e=>{e.key==="Escape"&&(e.preventDefault(),r())},children:[n.jsx("h2",{id:"chat-disabled-title",children:"Chat is temporarily disabled"}),n.jsx("p",{id:"chat-disabled-description",children:"We've temporarily paused new research runs. Your message wasn't sent, and your draft is still here. Please try again later."}),n.jsx("div",{className:"chat-capacity-dialog-actions",children:n.jsx("button",{ref:t,type:"button",className:"chat-capacity-cancel",onClick:r,children:"Keep editing"})})]})})}function Dr({url:r,onClose:t}){return r?n.jsx("div",{className:"chat-share-dialog-backdrop",role:"presentation",onMouseDown:t,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:"Anyone with this link can see this conversation. It could not be copied automatically, so copy it manually:"}),n.jsx("input",{readOnly:!0,value:r,"aria-label":"Public conversation link",autoFocus:!0,onFocus:e=>e.currentTarget.select()}),n.jsx("button",{type:"button",onClick:t,children:"Close"})]})}):null}function Fr({sessions:r,activeSessionId:t,loading:e,error:s,open:o,onClose:c,onNew:f,onNavigate:m,onRename:y,onDelete:I}){const[_,b]=i.useState(null),[k,B]=i.useState(""),[v,L]=i.useState(null);i.useEffect(()=>{if(!v)return;const j=()=>L(null),M=p=>{p.key==="Escape"&&j()};return window.addEventListener("click",j),window.addEventListener("keydown",M),()=>{window.removeEventListener("click",j),window.removeEventListener("keydown",M)}},[v]);const q=j=>{b(j.id),B(j.title)},V=async j=>{const M=k.trim();M&&await y(j,M)&&b(null)},$=(j,M,p)=>L({id:j,x:M,y:p});return n.jsxs("aside",{className:`chat-sidebar${o?"":" chat-sidebar-closed"}`,children:[n.jsxs("div",{className:"chat-sidebar-top",children:[n.jsxs("button",{type:"button",className:"chat-new-chat",onClick:f,children:[n.jsx(er,{})," New chat"]}),n.jsx("button",{type:"button",className:"icon-btn",onClick:c,title:"Collapse sidebar",children:n.jsx(Tt,{})})]}),n.jsxs("nav",{className:"chat-sessions","aria-label":"Chat history",children:[e&&n.jsx("div",{className:"chat-sessions-empty",children:"Loading chats…"}),!e&&s&&n.jsx("div",{className:"chat-sessions-empty",children:s}),!e&&!s&&r.length===0&&n.jsx("div",{className:"chat-sessions-empty",children:"Conversations you start will show up here."}),tr(r).map(j=>n.jsxs("div",{className:"chat-session-group",children:[n.jsx("div",{className:"chat-session-group-label",children:j.label}),j.items.map(M=>n.jsxs("div",{className:`chat-session${M.id===t?" chat-session-active":""}`,role:"button",tabIndex:0,onClick:()=>m(M.id),onKeyDown:p=>{if(p.key==="Enter"&&m(M.id),p.key==="F2"&&q(M),p.key==="ContextMenu"||p.shiftKey&&p.key==="F10"){p.preventDefault();const u=p.currentTarget.getBoundingClientRect();$(M.id,u.right-150,u.bottom)}},onContextMenu:p=>{p.preventDefault(),$(M.id,p.clientX,p.clientY)},children:[_===M.id?n.jsx("input",{className:"chat-session-title-input",value:k,autoFocus:!0,maxLength:80,onClick:p=>p.stopPropagation(),onChange:p=>B(p.target.value),onBlur:()=>void V(M.id),onKeyDown:p=>{p.stopPropagation(),p.key==="Enter"&&V(M.id),p.key==="Escape"&&b(null)}}):n.jsx("span",{className:"chat-session-title",children:M.title}),n.jsx("button",{type:"button",className:"chat-session-menu","aria-label":"Chat actions","aria-haspopup":"menu",title:"Chat actions",onClick:p=>{p.stopPropagation();const u=p.currentTarget.getBoundingClientRect();$(M.id,u.right-150,u.bottom)},children:"⋯"}),n.jsx("button",{type:"button",className:"chat-session-delete","aria-label":"Delete conversation",onClick:p=>{p.stopPropagation(),I(M.id)},children:n.jsx(rr,{})})]},M.id))]},j.label))]}),v&&n.jsx("div",{className:"chat-session-context-menu",role:"menu",style:{left:v.x,top:v.y},onClick:j=>j.stopPropagation(),children:n.jsx("button",{type:"button",role:"menuitem",autoFocus:!0,onClick:()=>{const j=r.find(M=>M.id===v.id);j&&q(j),L(null)},children:"Rename chat"})})]})}function Yr({sessionId:r,busy:t,loading:e,hasPaperSelection:s=!1,onError:o}){const{toast:c}=Et(),[f,m]=i.useState(!1),[y,I]=i.useState(""),_=async()=>{var b;if(!(t||f)&&!(s&&!window.confirm("This public link will include the selected paper passage. Anyone with the link can read that passage. Continue?"))){m(!0);try{const k=await nr(r),B=new URL(k.public_path,window.location.origin).toString();try{if(!((b=navigator.clipboard)!=null&&b.writeText))throw new Error("Clipboard unavailable");await navigator.clipboard.writeText(B),c({className:"chat-share-toast",duration:5e3,title:"Public link copied to your clipboard",description:"Anyone with this link can see this conversation."})}catch{I(B)}}catch(k){const B=k instanceof Error?k.message:"Could not share this conversation";o(B),c({variant:"destructive",title:"Share failed",description:B})}finally{m(!1)}}};return n.jsxs(n.Fragment,{children:[n.jsxs("button",{type:"button",className:"chat-share-button",onClick:()=>void _(),disabled:t||f||e,"aria-label":"Share conversation",children:[f?n.jsx(kt,{}):n.jsx(vr,{"aria-hidden":"true"}),n.jsx("span",{children:"Share"})]}),n.jsx(Dr,{url:y,onClose:()=>I("")})]})}function Pr({messages:r,refreshSessions:t,resetChat:e,restoreDraft:s,clearTitle:o}){const{toast:c}=Et(),[f,m]=i.useState(null),y=()=>{const b=[...r].reverse().find(k=>k.role==="user");e(),s({text:(b==null?void 0:b.text)??"",paperMentions:(b==null?void 0:b.paperMentions)??[],...b!=null&&b.paperSelection?{paperSelection:b.paperSelection}:{}}),o()};return{pending:f,archiveOld:async()=>{if(f===null){m("old");try{const b=await ar();if(await t(),b.archived_count===0){c({title:"No chats were archived",description:"There are no inactive chats older than 30 days."});return}y(),c({title:`${b.archived_count} ${b.archived_count===1?"chat":"chats"} archived`,description:"Your question is ready to send again."})}catch(b){c({variant:"destructive",title:"Could not archive old chats",description:b instanceof Error?b.message:"Try again."})}finally{m(null)}}},archiveOldest:async()=>{if(f===null){m("oldest");try{const b=await sr();await t(),y(),c({title:`${b.archived_count} ${b.archived_count===1?"chat":"chats"} archived`,description:"Your question is ready to send again."})}catch(b){c({variant:"destructive",title:"Could not archive chats",description:b instanceof Error?b.message:"Try again."})}finally{m(null)}}}}}class qr{constructor(t,e=Tr){ke(this,"requestId");ke(this,"firstVisibleAt");ke(this,"streamStartReported",!1);ke(this,"firstVisibleReported",!1);ke(this,"terminalReported",!1);ke(this,"semanticReported",new Set);this.submittedAt=t,this.report=e}recordStreamStart(t,e){this.requestId=t,this.streamStartReported||(this.streamStartReported=!0,this.send({submission_to_stream_start_ms:Math.max(0,e-this.submittedAt)})),this.reportFirstVisible()}recordFirstVisible(t){this.firstVisibleAt===void 0&&(this.firstVisibleAt=t,this.reportFirstVisible())}recordSemantic(t,e){if(this.semanticReported.has(t))return;this.semanticReported.add(t);const s=Math.max(0,e-this.submittedAt);this.send(t==="reasoning"?{submission_to_first_reasoning_delta_ms:s}:t==="tool"?{submission_to_first_tool_call_ms:s}:{submission_to_first_answer_delta_ms:s})}recordTerminal(t){this.terminalReported||(this.terminalReported=!0,this.send({terminal_classification:t}))}reportFirstVisible(){!this.requestId||this.firstVisibleAt===void 0||this.firstVisibleReported||(this.firstVisibleReported=!0,this.send({submission_to_first_visible_delta_ms:Math.max(0,this.firstVisibleAt-this.submittedAt)}))}send(t){this.requestId&&this.report(this.requestId,t)}}const Ct="Preparing research workspace…",jt={preparing_workspace:"Preparing secure workspace…",starting_agent:"Starting research agent…",connecting_model:"Connecting to model…"},Lt=()=>({messages:[],sessionId:null,title:"",phase:"idle"});function St(r,t){for(let e=r.length-1;e>=0;e-=1)if(t(r[e]))return e;return-1}function Se(r){if(r.status!==Ct&&!Object.values(jt).includes(r.status))return r;const{status:t,...e}=r;return e}function ee(r,t){if(!r.length)return r;const e=r.slice();return e[e.length-1]=t(e[e.length-1]),e}function Ie(r,t,e){return ee(r,s=>{const o=Se(s),c=o.blocks??[];return{...o,blocks:c.map((f,m)=>t(f,m,c)?e(f):f)}})}function Br(r,t){switch(t.type){case"stream_start":return t.session_id?{...r,sessionId:t.session_id}:r;case"sandbox_start":case"sandbox_ready":case"workspace_ready":return r;case"lifecycle":return{...r,messages:ee(r.messages,e=>{var s;return e.role==="assistant"&&e.streaming&&(((s=e.blocks)==null?void 0:s.length)??0)===0?{...e,status:jt[t.phase]}:e})};case"session_title_start":return{...r,title:""};case"session_title_delta":return{...r,title:`${r.title}${t.text}`.replace(/\s+/g," ").slice(0,80)};case"session_title_done":return{...r,title:t.title};case"reasoning_start":return{...r,messages:ee(r.messages,e=>{const s=Se(e);return{...s,blocks:[...(s.blocks??[]).map(o=>o.kind==="reasoning"&&o.active?{...o,active:!1,open:!1}:o),{kind:"reasoning",text:"",active:!0,open:!0}]}})};case"reasoning_delta":return{...r,messages:Ie(r.messages,(e,s,o)=>e.kind==="reasoning"&&St(o,c=>c.kind==="reasoning")===s,e=>e.kind==="reasoning"?{...e,text:e.text+t.text}:e)};case"reasoning_end":return{...r,messages:ee(r.messages,e=>{const s=e.blocks??[],o=St(s,m=>m.kind==="reasoning"&&m.active);if(o<0)return e;const c=s[o];if(c.kind!=="reasoning")return e;const f=s[o-1];return(f==null?void 0:f.kind)==="reasoning"&&f.text===c.text?{...e,blocks:s.filter((m,y)=>y!==o)}:{...e,blocks:s.map((m,y)=>y===o?{...c,active:!1,open:!1}:m)}})};case"tool_call":return{...r,messages:ee(r.messages,e=>{const s=Se(e);return{...s,blocks:[...s.blocks??[],{kind:"tool",id:t.id,name:t.name,args:t.args,status:"running",open:!1}]}})};case"tool_call_start":return{...r,messages:ee(r.messages,e=>{const s=Se(e);return{...s,blocks:[...s.blocks??[],{kind:"tool",schema_version:2,id:t.id,name:t.name,args:{},argumentText:"",argumentState:"streaming",arguments_redacted:t.redacted,status:"running",open:!1}]}})};case"tool_call_arguments_delta":return{...r,messages:Ie(r.messages,e=>e.kind==="tool"&&e.id===t.id,e=>e.kind==="tool"?{...e,args:t.partial_args,argumentText:t.snapshot?t.delta:`${e.argumentText??""}${t.delta}`,arguments_redacted:e.arguments_redacted||t.redacted}:e)};case"tool_call_arguments_done":return{...r,messages:Ie(r.messages,e=>e.kind==="tool"&&e.id===t.id,e=>e.kind==="tool"?{...e,args:t.args,argumentText:JSON.stringify(t.args),argumentState:"done",arguments_redacted:e.arguments_redacted||t.redacted}:e)};case"app_start":return{...r,messages:ee(r.messages,e=>{const s=Se(e);return{...s,blocks:[...s.blocks??[],{kind:"app",schema_version:1,instance_id:t.instance_id,provider:t.provider,server:t.server,tool:t.tool,resource_uri:t.resource_uri,status:"loading",input:t.input,result:{content:[],structuredContent:{},isError:!1},csp:{},permissions:{clipboardWrite:!0},height:525}]}})};case"app_result":return{...r,messages:Ie(r.messages,e=>e.kind==="app"&&e.instance_id===t.id,e=>e.kind==="app"?{...e,status:t.status,result:t.result}:e)};case"tool_result":return{...r,messages:Ie(r.messages,e=>e.kind==="tool"&&e.id===t.id,e=>e.kind!=="tool"?e:t.status?{...e,schema_version:2,status:t.status,took_ms:t.took_ms,content:t.content,metadata:t.metadata,open:t.status!=="success"}:{...e,status:"done",hits:t.hits,took_ms:t.took_ms,results:t.results})};case"artifact_start":return{...r,messages:ee(r.messages,e=>{const s=Se(e);return{...s,blocks:[...s.blocks??[],{kind:"artifact",schema_version:1,scope:"owner",publication_id:t.publication_id,identifier:t.identifier,artifact_kind:"posterly",title:t.title,status:"generating",phase:"publishing_poster"}]}})};case"artifact_ready":return{...r,messages:Ie(r.messages,e=>e.kind==="artifact"&&e.publication_id===t.publication_id,e=>e.kind==="artifact"?{...e,artifact_id:t.artifact_id,version_id:t.version_id,identifier:t.identifier,version:t.version,title:t.title,status:"ready",preview_mime:t.preview_mime,source_language:t.source_language,gate_status:t.gate_status,total_bytes:t.total_bytes,phase:void 0}:e)};case"artifact_error":return{...r,messages:Ie(r.messages,e=>e.kind==="artifact"&&e.publication_id===t.publication_id,e=>e.kind==="artifact"?{...e,status:"error",phase:void 0,error_code:t.code,error_message:t.message}:e)};case"answer_delta":return{...r,messages:ee(r.messages,e=>{const s=Se(e),o=s.blocks??[],c=o.at(-1);return(c==null?void 0:c.kind)==="answer"&&!c.done?{...s,blocks:[...o.slice(0,-1),{...c,text:c.text+t.text}]}:{...s,blocks:[...o,{kind:"answer",text:t.text,done:!1}]}})};case"done":return{...r,phase:"complete",messages:ee(r.messages,e=>({...e,streaming:!1,followups:t.followups,finishReason:t.finish_reason,citations:t.citations,blocks:(e.blocks??[]).map(s=>s.kind==="answer"?{...s,done:!0}:s.kind==="reasoning"&&s.active?{...s,active:!1,open:!1}:s)}))};case"error":return{...r,phase:"failed",messages:ee(r.messages,e=>({...e,streaming:!1,error:t.message,errorCode:t.code,blocks:(e.blocks??[]).map(s=>s.kind==="reasoning"&&s.active?{...s,active:!1,open:!1}:s.kind==="tool"&&s.status==="running"?{...s,status:"error",open:!0}:s)}))};default:return r}}function Ur(r){return ee(r,t=>{if(t.role!=="assistant")return t;const e=(t.blocks??[]).flatMap(s=>s.kind==="tool"&&s.status==="running"?[{...s,status:"error",open:!0}]:s.kind==="reasoning"&&s.active?s.text?[{...s,active:!1,open:!1}]:[]:s.kind==="answer"?[{...s,done:!0}]:[s]);return{...t,blocks:e,streaming:!1,finishReason:"stopped"}})}function He(r,t){switch(t.type){case"start":return{messages:t.messages,sessionId:t.sessionId,title:"",phase:"streaming"};case"event":return Br(r,t.event);case"load":return{messages:t.messages,sessionId:t.sessionId,title:r.title,phase:"idle"};case"workspace_status":return{...r,messages:ee(r.messages,e=>{var s;return e.role==="assistant"&&e.streaming&&(((s=e.blocks)==null?void 0:s.length)??0)===0&&!e.error?{...e,status:Ct}:e})};case"clear_workspace_status":return{...r,messages:ee(r.messages,Se)};case"settle":return{...r,phase:"idle",messages:ee(r.messages,e=>e.streaming?{...e,streaming:!1}:e)};case"stop":return{...r,messages:Ur(r.messages),phase:"stopped"};case"reset":return Lt()}}const Re={minDelayMs:5,maxDelayMs:80,minRateCharsPerMs:.3,maxBufferedMs:400,arrivalRateTauMs:1e3,arrivalRateHeadroom:1.1,maxPendingChars:64},Hr={now:()=>performance.now(),sleep:(r,t)=>new Promise(e=>{if(t!=null&&t.aborted||r<=0){e();return}const s=window.setTimeout(o,r);function o(){t==null||t.removeEventListener("abort",o),window.clearTimeout(s),e()}t==null||t.addEventListener("abort",o,{once:!0})})};function Wr(r){return!["stream_start","sandbox_start","sandbox_ready","workspace_ready","session_title_start","session_title_delta","session_title_done"].includes(r.type)}function Vr(r,t=!1,e=Re.maxPendingChars){var o;if(!r)return{pieces:[],pending:""};if(t)return{pieces:[r],pending:""};const s=Intl.Segmenter;if(s){const f=[...new s(void 0,{granularity:"word"}).segment(r)].filter(y=>y.isWordLike);let m=0;if(f.length>1&&(m=f.at(-1).index),f.length&&/\s$/u.test(r)&&(m=r.length),m>0){const y=r.slice(0,m),I=[],b=[...new s(void 0,{granularity:"word"}).segment(y)].filter(k=>k.isWordLike);for(let k=0;k<b.length;k+=1){const B=k===0?0:b[k].index,v=((o=b[k+1])==null?void 0:o.index)??y.length;v>B&&I.push(y.slice(B,v))}return b.length||I.push(y),{pieces:I,pending:r.slice(m)}}}else{const c=[...r.matchAll(/\s+/gu)];if(c.length){const f=[];let m=0;for(const y of c){const I=y.index+y[0].length;f.push(r.slice(m,I)),m=I}return{pieces:f,pending:r.slice(m)}}}return r.length>=e?{pieces:[r.slice(0,e)],pending:r.slice(e)}:{pieces:[],pending:r}}function $r(r,t={}){const e={minDelayMs:t.minDelayMs??Re.minDelayMs,maxDelayMs:t.maxDelayMs??Re.maxDelayMs,minRateCharsPerMs:t.minRateCharsPerMs??Re.minRateCharsPerMs,maxBufferedMs:t.maxBufferedMs??Re.maxBufferedMs,arrivalRateTauMs:t.arrivalRateTauMs??Re.arrivalRateTauMs,arrivalRateHeadroom:t.arrivalRateHeadroom??Re.arrivalRateHeadroom,maxPendingChars:t.maxPendingChars??Re.maxPendingChars},s=t.clock??Hr,o=[];let c="",f=null,m=0,y=!0,I=!1,_=null,b=0,k=s.now(),B=!1;const v=()=>{_==null||_(),_=null},L=(p,u)=>{const A=p.type==="reasoning_delta"||p.type==="answer_delta"?p.text.length:0;o.push({kind:"event",event:p,arrivedAt:u,chars:A}),v()},q=p=>{if(!f||!c)return;const u=Vr(c,p,e.maxPendingChars);for(const A of u.pieces)A&&L({type:f,text:A},m),m=s.now();c=u.pending,c||(f=null)},V=p=>{if(!y)return;const u=s.now();if(p.type==="reasoning_delta"||p.type==="answer_delta"){const A=p.type;if(!p.text)return;if(!B){B=!0,b+=p.text.length,k=u;const H=Array.from(p.text)[0];L({type:A,text:H},u);const O=p.text.slice(H.length);if(O)for(f=A,c=O,m=u,q(!1);c.length>=e.maxPendingChars;)q(!1);return}f&&f!==A&&q(!0),f||(f=A,m=u),c+=p.text;const N=Math.max(0,u-k);for(b*=Math.exp(-N/e.arrivalRateTauMs),b+=p.text.length,k=u,q(!1);c.length>=e.maxPendingChars;)q(!1);return}Wr(p)&&q(!0),L(p,u)},$=(async()=>{var p;try{for await(const u of r)V(u);y&&q(!0)}catch(u){y&&!((p=t.signal)!=null&&p.aborted)&&(q(!0),o.push({kind:"error",error:u,arrivedAt:s.now(),chars:0}))}finally{I=!0,v()}})(),j=()=>o.length||I?Promise.resolve():new Promise(p=>{_=p});return{events:async function*(){var u,A,N,H;let p=Number.NEGATIVE_INFINITY;try{for(;;){if(await j(),!o.length){if(I||!y)return;continue}const O=o[0];if(O.kind==="error")throw o.shift(),O.error;if(O.chars&&!((u=t.isHidden)!=null&&u.call(t))){const T=s.now(),Ae=o.reduce((fe,pe)=>fe+pe.chars,0),Fe=((A=o.find(fe=>fe.chars))==null?void 0:A.arrivedAt)??T,P=Math.max(0,e.maxBufferedMs-(T-Fe)),z=b*Math.exp(-Math.max(0,T-k)/e.arrivalRateTauMs)/e.arrivalRateTauMs,Ee=P>0?Ae/P:Number.POSITIVE_INFINITY,Ye=Math.max(e.minRateCharsPerMs,z*e.arrivalRateHeadroom,Ee),J=Math.min(e.maxDelayMs,Math.max(e.minDelayMs,O.chars/Ye)),X=Math.max(0,O.arrivedAt+e.maxBufferedMs-T),Z=Math.max(O.arrivedAt,p+Math.min(J,X));if(await s.sleep(Math.max(0,Z-s.now()),t.signal),!y||(N=t.signal)!=null&&N.aborted)return}o.shift(),p=s.now(),yield O.event}}finally{y&&(y=!1,v(),await((H=r.return)==null?void 0:H.call(r,void 0))),await $}}(),takeAcceptedForStop(){var u;if(!y)return[];y=!1,f&&c&&(L({type:f,text:c},m),c="",f=null);const p=o.flatMap(A=>A.kind==="event"&&A.event.type!=="done"&&A.event.type!=="error"?[A.event]:[]);return o.length=0,v(),(u=r.return)==null||u.call(r,void 0),p}}}const Gr=750;function Kr(r,t){for(let e=r.length-1;e>=0;e-=1)if(t(r[e]))return e;return-1}function We(r){const t=i.useRef(r);return i.useLayoutEffect(()=>{t.current=r}),i.useCallback((...e)=>t.current(...e),[])}function zr(r){const[t,e]=i.useState([]),[s,o]=i.useState(!1),[c,f]=i.useState(""),m=i.useRef(!1),y=i.useRef(null),I=i.useRef(null),_=i.useRef(null),b=i.useRef(null),k=i.useRef(!1),B=i.useRef(null),v=i.useRef(null),L=i.useRef("cleared"),q=i.useRef(null),V=i.useRef(null),[$,j]=i.useState(null),[M,p]=i.useState(null),u=i.useRef([]),A=i.useRef(Lt()),N=i.useRef(null),H=i.useRef(null),O=i.useRef(!1),T=i.useRef(r),Ae=i.useRef(tt()),Fe=i.useRef(0),P=i.useRef(0),z=i.useRef(r.sessionId),Ee=i.useRef(r.sessionId);Ee.current!==r.sessionId&&(Ee.current=r.sessionId,z.current!==r.sessionId&&(P.current+=1,q.current=null)),T.current=r,u.current=t,i.useEffect(()=>()=>{var l;v.current!==null&&window.clearTimeout(v.current),(l=y.current)==null||l.abort(),I.current=null,_.current!==null&&cancelAnimationFrame(_.current),b.current!==null&&window.clearTimeout(b.current),V.current=null},[]),i.useEffect(()=>{m.current||(z.current=r.sessionId)},[r.sessionId]),i.useEffect(()=>{const l=m.current&&r.sessionId===z.current?N.current:null;O.current=l!==null,l&&(e(l),u.current=l)},[r.sessionId]);const Ye=i.useMemo(()=>{const l={};for(const w of t)for(const S of w.blocks??[])if(S.kind==="tool")for(const g of S.results??[])l[g.route_id]=g;return l},[t]),J=()=>`m${++Fe.current}_${Date.now().toString(36)}`,X=(l,w=!0)=>{const S={...A.current,messages:N.current??u.current,sessionId:z.current},g=He(S,l);A.current=g,N.current&&(N.current=g.messages);const h=l.type==="event"&&l.event.type==="stream_start"?l.event.session_id:null;return h?(z.current=h,T.current.onSessionId(h)):g.sessionId&&g.sessionId!==S.sessionId&&(z.current=g.sessionId,T.current.onSessionId(g.sessionId)),g.title!==S.title&&T.current.onTitle(g.title),w&&(u.current=g.messages,e(g.messages)),g},Z=()=>H.current===P.current||O.current,fe=()=>{_.current!==null&&(cancelAnimationFrame(_.current),_.current=null),b.current!==null&&(window.clearTimeout(b.current),b.current=null)},pe=()=>{fe(),document.visibilityState!=="hidden"&&(!O.current||!N.current||(k.current=!1,u.current=N.current,e(N.current)))},$e=()=>{if(!O.current||document.visibilityState==="hidden"||_.current!==null||b.current!==null)return;const l=()=>{_.current=null,b.current=null,pe()};typeof requestAnimationFrame=="function"?_.current=requestAnimationFrame(l):b.current=window.setTimeout(l,0)};i.useEffect(()=>{const l=()=>{document.visibilityState==="visible"&&k.current&&$e()};return document.addEventListener("visibilitychange",l),()=>document.removeEventListener("visibilitychange",l)});const ie=l=>{if(y.current!==l||(v.current!==null&&(window.clearTimeout(v.current),v.current=null),L.current==="cleared"))return;const w=L.current==="shown";L.current="cleared",w&&X({type:"clear_workspace_status"},Z())},Ge=(l,w)=>{v.current!==null&&window.clearTimeout(v.current),L.current="armed",v.current=window.setTimeout(()=>{v.current=null,!(L.current!=="armed"||y.current!==l||l.signal.aborted||P.current!==w)&&(L.current="shown",X({type:"workspace_status"},Z()))},Gr)},Pe=(l,w)=>{const S=q.current;!S||S.controller!==l||S.tracker.recordStreamStart(w,performance.now())},ue=(l,w)=>{const S=q.current;!S||S.controller!==l||S.tracker.recordTerminal(w)};i.useLayoutEffect(()=>{const l=q.current;if(!l)return;const w=t.at(-1);if((w==null?void 0:w.role)!=="assistant"||!(w.blocks??[]).some(h=>h.kind==="tool"||h.kind==="reasoning"&&!!h.text.trim()||h.kind==="answer"&&!!h.text.trim()))return;const g=performance.now();l.tracker.recordFirstVisible(g);for(const h of w.blocks??[])h.kind==="reasoning"&&h.text.trim()?l.tracker.recordSemantic("reasoning",g):h.kind==="tool"?l.tracker.recordSemantic("tool",g):h.kind==="answer"&&h.text.trim()&&l.tracker.recordSemantic("answer",g)},[t]);const K=(l,w=!0)=>{X({type:"event",event:l},w)},ge=async(l,w)=>{var h;const S=await st(l);let g=Ot(S);return((h=B.current)==null?void 0:h.sessionId)===l&&(g=B.current.messages,B.current=null),P.current!==w&&!(H.current===w&&O.current&&T.current.sessionId===l)?null:(e(g),u.current=g,N.current=g,A.current=He(A.current,{type:"load",messages:g,sessionId:l}),g)},he=(l,w,S,g,h,D)=>{const F=++P.current;H.current=F,O.current=!0,m.current=!0;const C=new AbortController;y.current=C;const Q=l.text;return Ae.current=l,z.current=w.session_id,f(""),e(S),N.current=S,A.current=He(A.current,{type:"start",messages:S,sessionId:w.session_id}),o(!0),q.current=D?null:{controller:C,tracker:new qr(performance.now())},L.current="cleared",(async()=>{var _e,be,Le,Qe;let E=!1,le=!1,ne=!1,te=!1,G=!1,se=!1;try{const W=D?Or(D,{signal:C.signal}):kr(w,{signal:C.signal}),re=!D&&De()&&Er(),oe=re?$r(W,{signal:C.signal,isHidden:()=>document.visibilityState==="hidden"}):null;oe&&(I.current={controller:C,stream:oe});for await(const x of(oe==null?void 0:oe.events)??W){x.type==="stream_start"&&(E=!0,le=x.provider_execution!==!1,Pe(C,x.request_id)),x.type==="sandbox_start"&&Ge(C,F),(x.type==="sandbox_ready"||x.type==="workspace_ready"||x.type==="lifecycle")&&ie(C),(x.type==="reasoning_start"||x.type==="reasoning_delta"||x.type==="tool_call"||x.type==="tool_call_start"||x.type==="tool_call_arguments_delta"||x.type==="tool_call_arguments_done"||x.type==="app_start"||x.type==="app_result"||x.type==="artifact_start"||x.type==="artifact_ready"||x.type==="artifact_error"||x.type==="answer_delta"||x.type==="done"||x.type==="error")&&ie(C),(x.type==="done"||x.type==="error")&&(te=!0,G=x.type==="error",ue(C,x.type==="error"?"error":"complete"),x.type==="error"&&["openrouter_monthly_budget_exhausted","openrouter_unavailable","openrouter_byok_credential_invalid","openrouter_byok_billing_error","openrouter_byok_rate_limit","hf_inference_billing_exhausted"].includes(x.code??"")&&(ne=!0,T.current.onInterrupted(l)));const we=Z(),Me=we&&!(re&&document.visibilityState==="hidden"),Be=x.type==="reasoning_delta"||x.type==="answer_delta"||x.type==="tool_call_arguments_delta",Je=!["stream_start","sandbox_start","sandbox_ready","workspace_ready","session_title_start","session_title_delta","session_title_done","reasoning_delta","answer_delta","tool_call_arguments_delta"].includes(x.type);re&&Je&&pe(),!C.signal.aborted&&(we||x.type==="stream_start"||x.type==="session_title_start"||x.type==="session_title_delta"||x.type==="session_title_done")?re&&Be?(K(x,!1),k.current=k.current||we,$e()):(K(x,Me),re&&we&&!Me&&(k.current=!0)):C.signal.aborted||K(x,!1)}}catch(W){if(G=!0,!C.signal.aborted){if(ie(C),W instanceof Ne&&W.code==="chat_temporarily_disabled")se=!0,p({question:Q,draft:l}),P.current===F&&(e(g),u.current=g,f(""));else if(W instanceof Ne&&W.code==="chat_capacity"){se=!0;const re=W.retryAfterSeconds??5,oe={question:Q,draft:l,request:w,optimistic:S,original:g,edit:h,retryAfterSeconds:re,retryAt:Date.now()+re*1e3};V.current=oe,j({question:Q,draft:l,retryAt:oe.retryAt,retryAfterSeconds:re}),P.current===F&&(e(g),u.current=g,f(""))}else ue(C,"network_error"),W instanceof Ne&&["paper_context_unavailable","paper_mention_unavailable","paper_mentions_disabled","paper_selection_disabled","paper_selection_requires_reader","paper_selection_paper_mismatch","paper_selection_version_mismatch","paper_selection_page_invalid","paper_selection_too_large","chat_storage_quota_exceeded"].includes(W.code??"")&&(se=!0,T.current.onInterrupted(l),P.current===F&&(e(g),u.current=g,f(W.message))),W instanceof Ne&&["openrouter_monthly_budget_exhausted","openrouter_unavailable","openrouter_byok_credential_invalid","openrouter_byok_billing_error","openrouter_byok_rate_limit","hf_inference_billing_exhausted"].includes(W.code??"")&&(ne=!0,T.current.onInterrupted(l));!se&&P.current===F&&K({type:"error",message:W instanceof Error?W.message:"The assistant stream failed.",code:W instanceof Ne?W.code:void 0})}}finally{if(y.current===C){if(((_e=I.current)==null?void 0:_e.controller)===C&&(pe(),I.current=null),ie(C),!te&&!C.signal.aborted&&ue(C,"network_error"),m.current=!1,o(!1),se)T.current.onSettled(w.session_id);else if(!C.signal.aborted){(E&&le||ne)&&((Le=(be=T.current).onProviderTerminal)==null||Le.call(be));const W=z.current;if(h&&!E)P.current===F&&(e(h.snapshot),u.current=h.snapshot,f("Couldn’t resend this message. Your original conversation was restored."));else if(W){P.current===F&&h&&(G||!te)&&(e(h.snapshot),u.current=h.snapshot);try{const re=await ge(W,F);re&&h&&re.some(oe=>oe.id===h.targetId)&&f("Couldn’t resend this message. Your original conversation was restored.")}catch{P.current===F&&X({type:"settle"})}}else P.current===F&&X({type:"settle"});T.current.onSettled(W)}((Qe=q.current)==null?void 0:Qe.controller)===C&&(q.current=null)}}})(),!0},ye=We(l=>{var ne,te;const w=typeof l=="string"?tt(l.trim()):l,S=w.text;if(!S||S.length>8e3||m.current||V.current)return!1;const g=u.current,h=[...g].reverse().find(G=>G.role==="user"),D=h!=null&&h.status&&h.status!=="complete"&&h.revision?{replace_message_id:h.id,prior_revision:h.revision}:null,F={id:J(),role:"user",text:S,paperMentions:w.paperMentions,paperSelection:w.paperSelection},C={id:J(),role:"assistant",streaming:!0,blocks:[]},Q=D&&h?Kr(g,G=>G.id===h.id):-1,E=Q<0?[...g,F,C]:[...g.slice(0,Q),F,C],le=(te=(ne=T.current).viewerContext)==null?void 0:te.call(ne);return he(w,{message:S,paper_mentions:w.paperMentions.map(({route_id:G,title:se,start:_e,end:be})=>({route_id:G,title:se,start:_e,end:be})),session_id:T.current.sessionId,client_message_id:crypto.randomUUID(),web_search_enabled:!!T.current.webSearchEnabled,reasoning_effort:T.current.reasoningEffort??"low",...T.current.primaryPaperRouteId?{primary_paper_route_id:T.current.primaryPaperRouteId}:{},...le?{viewer_context:le}:{},...w.paperSelection?{paper_selection:gt(w.paperSelection)}:{},...!T.current.sessionId&&T.current.initialModel?{initial_model:T.current.initialModel}:{},...D??{}},E,g)}),Te=We((l,w)=>{var ne,te;const S=typeof w=="string"?tt(w.trim()):w,g=S.text;if(!g||g.length>8e3||m.current||V.current)return!1;const h=u.current.slice(),D=h.findIndex(G=>G.id===l&&G.role==="user");if(D<0)return!1;const F=h[D];if(!T.current.sessionId||!F.revision)return!1;const C={id:F.id,role:"user",text:g,paperMentions:S.paperMentions,paperSelection:S.paperSelection,revision:F.revision+1,status:"generating"},Q={id:J(),role:"assistant",streaming:!0,blocks:[]},E=[...h.slice(0,D),C,Q],le=(te=(ne=T.current).viewerContext)==null?void 0:te.call(ne);return he(S,{message:g,paper_mentions:S.paperMentions.map(({route_id:G,title:se,start:_e,end:be})=>({route_id:G,title:se,start:_e,end:be})),session_id:T.current.sessionId,client_message_id:crypto.randomUUID(),web_search_enabled:!!T.current.webSearchEnabled,reasoning_effort:T.current.reasoningEffort??"low",...T.current.primaryPaperRouteId?{primary_paper_route_id:T.current.primaryPaperRouteId}:{},...le?{viewer_context:le}:{},...S.paperSelection?{paper_selection:gt(S.paperSelection)}:{},replace_message_id:F.id,prior_revision:F.revision},E,h,{targetId:F.id,snapshot:h})}),Ke=i.useCallback(()=>{V.current=null,j(null)},[]),me=We(()=>{const l=V.current;return!l||Date.now()<l.retryAt||m.current?!1:(V.current=null,j(null),he(l.draft,l.request,l.optimistic,l.original,l.edit))}),Ce=We(()=>{var D,F;if(!y.current)return;const l=y.current;ie(l),ue(l,"stopped"),l.abort();const w=((D=I.current)==null?void 0:D.controller)===l?I.current.stream.takeAcceptedForStop():[];I.current=null;for(const C of w)K(C,!1);pe(),y.current=null,((F=q.current)==null?void 0:F.controller)===l&&(q.current=null),m.current=!1,o(!1);const S=X({type:"stop"},!1).messages;N.current=S,u.current=S,e(S),T.current.onInterrupted(Ae.current);const g=z.current;g&&(B.current={sessionId:g,messages:S}),g&&ir(g).catch(()=>{});const h=++P.current;window.setTimeout(()=>{g&&P.current===h?ge(g,h).catch(()=>{}).finally(()=>T.current.onSettled(g)):g||T.current.onSettled(null)},450)}),je=i.useCallback((l,w)=>e(S=>S.map(g=>{var h;return g.id!==l?g:{...g,blocks:(h=g.blocks)==null?void 0:h.map((D,F)=>F===w&&(D.kind==="reasoning"||D.kind==="tool")?{...D,open:!D.open}:D)}})),[]),ze=i.useCallback(()=>{var l;P.current+=1,v.current!==null&&(window.clearTimeout(v.current),v.current=null),L.current="cleared",(l=y.current)==null||l.abort(),y.current=null,I.current=null,fe(),k.current=!1,B.current=null,q.current=null,V.current=null,j(null),m.current=!1,z.current=null,N.current=null,A.current=He(A.current,{type:"reset"}),H.current=null,O.current=!1,e([]),o(!1),f("")},[]),qe=We((l,w,S=!1)=>{var g;if(P.current+=1,v.current!==null&&(window.clearTimeout(v.current),v.current=null),L.current="cleared",fe(),k.current=!1,q.current=null,V.current=null,j(null),m.current&&w!==void 0&&w===z.current&&N.current){O.current=!0,e(N.current),u.current=N.current,f("");return}if(O.current=!1,m.current||((g=y.current)==null||g.abort(),y.current=null,N.current=null,H.current=null,O.current=!1),S&&w){const h=[...l].reverse().find(D=>D.role==="user");if(h){const D={text:h.text??"",paperMentions:h.paperMentions??[],...h.paperSelection?{paperSelection:h.paperSelection}:{}},F=[...l,{id:`${h.id}-active`,role:"assistant",streaming:!0,blocks:[]}];he(D,{message:D.text,session_id:w,client_message_id:"reconnect",web_search_enabled:!!T.current.webSearchEnabled,reasoning_effort:T.current.reasoningEffort??"low"},F,l,void 0,w);return}}e(l),u.current=l,A.current=He(A.current,{type:"load",messages:l,sessionId:w??T.current.sessionId}),m.current||o(!1),f("")});return{messages:t,busy:s,papers:Ye,sessionError:c,capacityRequest:$,disabledRequest:M,send:ye,editAndResend:Te,retryCapacity:me,cancelCapacity:Ke,dismissDisabled:()=>p(null),stop:Ce,toggleBlock:je,reset:ze,load:qe}}const de=tt,Qr=["Summarize the main contributions","Explain in simple terms","Identify the main limitations"],Jr=()=>{const r=sessionStorage.getItem(rt);if(!r)return null;try{return gr(JSON.parse(r),r)}catch{}return de(r)},Xr=({enabled:r,workspaceKey:t,children:e})=>r?n.jsx(Xt,{workspaceKey:t,children:e}):n.jsx(n.Fragment,{children:e}),Zr=({enabled:r,children:t})=>r?n.jsx(Zt,{variant:"chat",children:t}):n.jsx(n.Fragment,{children:t}),en=({mode:r="general",routeSessionId:t,primaryPaper:e,currentPage:s,paperSelection:o,onPaperSelectionChange:c,onSessionId:f,onReaderSubmit:m,onReaderNewChat:y})=>{var it,ot,ct,lt,ut,dt,ft,pt;const{sessionId:I}=Ut(),_=t??(r==="general"?I:void 0),b=Ht(),[k,B]=Wt(),{user:v,isLoading:L}=Vt(),q=$t(),V=Kt(),$=zt({queryKey:["chatAvailability"],queryFn:()=>Ve.getAvailability(),refetchInterval:3e4,retry:!1,enabled:De()&&!!v}),j=((it=$.data)==null?void 0:it.status)==="paused"||r==="paper"&&((ot=$.data)==null?void 0:ot.paper_reader_chat_enabled)===!1,[M,p]=i.useState([]),[u,A]=i.useState(!1),[N,H]=i.useState(""),[O,T]=i.useState(()=>_?{id:_,status:"loading"}:null),[Ae,Fe]=i.useState(0),P=i.useRef(or()),z=i.useRef(k.get("model")||((ct=P.current)==null?void 0:ct.model)),[Ee,Ye]=i.useState(V?cr:lr),[J,X]=i.useState(z.current||ur),Z=dr(Ee,J),fe=br(!!(v&&Z==="openrouter")),pe=i.useRef(Z);pe.current=Z;const[$e,ie]=i.useState(""),[Ge,Pe]=i.useState(null),[ue,K]=i.useState(()=>de()),[ge,he]=i.useState(()=>{var a;return((a=P.current)==null?void 0:a.webSearchEnabled)??!1}),[ye,Te]=i.useState(()=>{var a;return((a=P.current)==null?void 0:a.reasoningEffort)??"low"}),Ke=!!((lt=$.data)!=null&&lt.web_search_available),[me,Ce]=i.useState(()=>{var d,R;const a=(d=k.get("q"))==null?void 0:d.trim();return a?de(a):((R=P.current)==null?void 0:R.draft)??de()}),je=i.useRef(!1),ze=i.useRef(!1),qe=i.useRef(!1),[l,w]=i.useState(()=>typeof window>"u"||window.innerWidth>900),S=i.useRef(new Set),g=i.useRef(!1),h=i.useRef(_),D=i.useRef(null),F=i.useRef(null),C=i.useRef(null);h.current=_;const Q=i.useCallback(async()=>{if(!v)return;const a=!g.current;a&&A(!0);try{const d=await fr();p(R=>{const Y=D.current,U=Y?R.find(Ue=>Ue.id===Y):void 0;if(!U)return d;const ae=d.find(Ue=>Ue.id===Y);return[ae?{...ae,title:U.title,is_busy:!0}:U,...d.filter(Ue=>Ue.id!==Y)]}),g.current=!0,H("")}catch(d){H(d instanceof Error?d.message:"Could not load chats")}finally{a&&A(!1)}},[v]),E=zr({sessionId:_??null,initialModel:J,webSearchEnabled:Ke&&ge,reasoningEffort:ye,primaryPaperRouteId:r==="paper"?e==null?void 0:e.routeId:void 0,viewerContext:r==="paper"&&s?()=>({page:Math.max(1,Math.min(1e4,s()))}):void 0,onSessionId:a=>{D.current=a;const d=a!==h.current,R=(h.current??null)===F.current,Y=new Date().toISOString();p(U=>U.some(ae=>ae.id===a)?U.map(ae=>ae.id===a?{...ae,is_busy:!0}:ae):[{id:a,title:"New chat",selected_model:J,created_at:Y,updated_at:Y,message_count:1,is_busy:!0,web_search_enabled:ge,reasoning_effort:ye},...U]),d&&R&&ie("New chat"),R&&(C.current=a,T({id:a,status:"loaded"}),d&&(r==="paper"?f==null||f(a):b(`/chat/${a}`,{replace:!0})))},onTitle:a=>{const d=D.current??h.current;d&&!S.current.has(d)&&(d===h.current&&ie(a),p(R=>R.map(Y=>Y.id===d?{...Y,title:a}:Y)))},onSettled:a=>{a&&p(d=>d.map(R=>R.id===a?{...R,is_busy:!1}:R)),D.current=null,F.current=null,Q()},onProviderTerminal:()=>{pe.current==="openrouter"&&q.invalidateQueries({queryKey:wr})},onInterrupted:a=>{K(a),c==null||c(a.paperSelection)}}),le=E.send;i.useEffect(()=>{E.capacityRequest&&(K(E.capacityRequest.draft),c==null||c(E.capacityRequest.draft.paperSelection))},[E.capacityRequest,c]);const ne=i.useCallback(a=>{sessionStorage.setItem(rt,JSON.stringify(a)),sessionStorage.setItem(Xe,J),sessionStorage.setItem(pr,ye),sessionStorage.setItem(Ze,"1"),sessionStorage.setItem(et,"1");const d=r==="paper"&&e?`/pdf/${e.routeId}`:h.current?`/chat/${h.current}`:"/chat";window.location.href=Gt(d,Z==="huggingface")},[r,e,ye,J,Z]),te=i.useCallback((a,d)=>{sessionStorage.setItem(rt,JSON.stringify(a)),sessionStorage.setItem(Xe,J),sessionStorage.removeItem(Ze),sessionStorage.removeItem(et),Ce(de()),K(a),c==null||c(a.paperSelection),H(d)},[c,J]),G=i.useCallback(async a=>{const d=c?o?{...a,paperSelection:o}:{text:a.text,paperMentions:a.paperMentions}:a;if(!v){ne(d);return}if(Z==="huggingface"&&!ze.current){if(qe.current)return;qe.current=!0;try{if(!(await Ve.getInferenceBilling()).connected){if(sessionStorage.getItem(et)==="1"){te(d,"Hugging Face inference authorization was not completed. Your prompt is ready to retry.");return}ne(d);return}ze.current=!0}catch(Y){te(d,Y instanceof Error?Y.message:"Could not check Hugging Face authorization.");return}finally{qe.current=!1}}const R=h.current??null;if(sessionStorage.removeItem(Ze),!le(d)){te(d,"Your prompt was not sent. It is ready to retry.");return}F.current=R,D.current=R,sessionStorage.removeItem(rt),sessionStorage.removeItem(Xe),sessionStorage.removeItem(et),hr(),K(de()),c==null||c(void 0),r==="paper"&&(m==null||m())},[ne,r,c,m,o,te,Z,le,v]);i.useEffect(()=>{if(L||!v)return;const a=sessionStorage.getItem(Xe);a&&X(a),Q(),mr().then(Y=>{if(Ye(Y.items),!h.current){const U=z.current||a;X(U&&Y.items.some(ae=>ae.id===U)?U:Y.default_model)}});const d=Jr(),R=sessionStorage.getItem(Ze)==="1";d&&(c==null||c(d.paperSelection),R?Ce(d):K(d))},[L,c,Q,v]),i.useEffect(()=>{if(!_){C.current!==null&&!E.busy&&(C.current=null,E.reset(),he(!1),Te("low")),T(null),Pe(null);return}if(C.current===_||(Pe(null),T(d=>(d==null?void 0:d.id)===_&&d.status==="loading"?d:{id:_,status:"loading"}),L||!v))return;let a=!1;return H(""),st(_).then(d=>{var Y,U;if(a)return;E.load(Ot(d),_,d.is_busy),X(d.selected_model),he(P.current&&d.messages.length===0?P.current.webSearchEnabled:d.web_search_enabled),Te(P.current&&d.messages.length===0?P.current.reasoningEffort:d.reasoning_effort??"high"),ie(d.title);const R=(U=(Y=[...d.messages].reverse().find(ae=>ae.role==="user"&&ae.viewer_context))==null?void 0:Y.viewer_context)==null?void 0:U.page;Pe(R??null),C.current=_,T({id:_,status:"loaded"})}).catch(d=>{if(a)return;const R=d instanceof Error?d.message:"Chat not found";E.reset(),H(R),T({id:_,status:"error",error:R})}),()=>{a=!0}},[L,_,v,E.busy,Ae]),i.useEffect(()=>{var Y;const a=(Y=k.get("q"))==null?void 0:Y.trim();if(!a)return;je.current=!1;const d=k.get("model");d&&X(d),Ce(de(a));const R=new URLSearchParams(k);R.delete("q"),R.delete("model"),B(R,{replace:!0})},[k,B]),i.useEffect(()=>{if(L||E.busy||!me.text||je.current||v&&ge&&$.isFetching||_&&(O==null?void 0:O.status)!=="loaded")return;const a=window.setTimeout(()=>{if(je.current)return;je.current=!0,G(me).finally(()=>Ce(de()))},0);return()=>window.clearTimeout(a)},[L,$.isFetching,E.busy,me,_,O==null?void 0:O.status,G,v,ge]),i.useEffect(()=>{const a=()=>{!v||E.busy||Q()};return window.addEventListener("focus",a),()=>window.removeEventListener("focus",a)},[E.busy,Q,v]);const se=()=>{D.current=null,E.reset(),K(de()),c==null||c(void 0),he(!1),Te("low"),ie(""),r==="paper"?y==null||y():b("/chat")},_e=async(a,d)=>{try{const R=await nt(a,{title:d});return S.current.add(a),a===_&&ie(R.title),p(Y=>Y.map(U=>U.id===a?R:U)),!0}catch(R){return H(R instanceof Error?R.message:"Rename failed"),!1}},be=async a=>{const d=a===_&&E.busy;if(window.confirm(d?"Stop and delete this chat? This cannot be undone.":"Delete this chat? This cannot be undone.")){d&&E.stop();try{if(d){const R=Date.now()+3e3;for(;(await st(a)).is_busy;){if(Date.now()>=R)throw new Error("Generation is still stopping. The chat was not deleted.");await new Promise(U=>window.setTimeout(U,150))}}await yr(a),a===_&&se(),await Q()}catch(R){H(R instanceof Error?R.message:"Delete failed")}}},Le=Pr({messages:E.messages,refreshSessions:Q,resetChat:E.reset,restoreDraft:K,clearTitle:()=>ie("")}),Qe=async a=>{const d=J;if(X(a),!!_)try{const R=await nt(_,{selected_model:a});p(Y=>Y.map(U=>U.id===_?{...U,selected_model:R.selected_model}:U)),H("")}catch(R){X(d),H(R instanceof Error?R.message:"Model change failed")}},W=async a=>{const d=ye;if(Te(a),!!_)try{const R=await nt(_,{reasoning_effort:a});p(Y=>Y.map(U=>U.id===_?R:U))}catch(R){Te(d),H(R instanceof Error?R.message:"Effort change failed")}},[re,oe]=i.useState(60);i.useLayoutEffect(()=>{const a=document.querySelector(".app-header");if(!a)return;const d=()=>oe(a.offsetHeight);d();const R=new ResizeObserver(d);return R.observe(a),()=>R.disconnect()},[]);const x=M.find(a=>a.id===_),we=E.messages.length===0,Me=(O==null?void 0:O.id)===_,Be=!!(_&&(L||v&&(!Me||(O==null?void 0:O.status)==="loading"))),Je=Me&&(O==null?void 0:O.status)==="error"?O.error:void 0,Mt=!!((ut=fe.data)!=null&&ut.fallback_enabled),Nt=c?o?{...ue,paperSelection:o}:{text:ue.text,paperMentions:ue.paperMentions}:ue,at={onSend:G,busy:E.busy,onStop:E.stop,draft:Nt,onDraftChange:a=>{c?(K({text:a.text,paperMentions:a.paperMentions}),a.paperSelection!==o&&c(a.paperSelection)):K(a)},models:Ee,selectedModel:J,onModelChange:a=>void Qe(a),disabled:j||L,describedBy:j?"chat-paused-description":void 0,paperMentionsEnabled:!!((dt=$.data)!=null&&dt.paper_mentions_enabled),paperSelectionEnabled:((ft=$.data)==null?void 0:ft.paper_reader_selection_enabled)===!0,webSearchAvailable:Ke,webSearchEnabled:ge,onWebSearchChange:he,reasoningEffort:ye,onReasoningEffortChange:a=>void W(a)};return n.jsx(Xr,{enabled:r==="general",workspaceKey:_??"new-chat",children:n.jsxs("div",{className:`chat-page${r==="paper"?" chat-page--reader":""}`,style:{height:r==="paper"?"100%":`calc(100dvh - ${re}px)`},children:[r==="general"&&n.jsx(Fr,{sessions:M,activeSessionId:_,loading:u,error:N,open:l,onClose:()=>w(!1),onNew:se,onNavigate:a=>b(`/chat/${a}`),onRename:_e,onDelete:a=>void be(a)}),n.jsx(Zr,{enabled:r==="general",children:n.jsxs("section",{className:"chat-main","data-testid":"active-chat-pane",children:[n.jsxs("div",{className:"chat-topbar",children:[r==="general"&&!l&&n.jsx("button",{type:"button",className:"icon-btn",onClick:()=>w(!0),title:"Open sidebar",children:n.jsx(Tt,{})}),r==="paper"&&n.jsx("button",{type:"button",className:"chat-reader-action",onClick:se,children:"New chat"}),n.jsx("span",{className:"chat-topbar-title",children:Be?(x==null?void 0:x.title)||"":$e||(x==null?void 0:x.title)||(we?"":"New chat")}),V&&n.jsx("span",{className:"chat-staging-badge",children:"Staging"}),r==="paper"&&n.jsx(ht,{className:"chat-reader-action",to:"/chat",children:"All chats"}),r==="general"&&(x==null?void 0:x.primary_paper)&&n.jsx(ht,{className:"chat-reader-action",to:`/pdf/${x.primary_paper.route_id}`,onClick:()=>{const a=x.primary_paper.route_id;sessionStorage.setItem(`pwc:reader:session:${a}`,x.id),Ge&&sessionStorage.setItem(`pwc:reader:page:${a}`,String(Ge))},children:"Open reader"}),_&&Me&&(O==null?void 0:O.status)==="loaded"&&!we&&n.jsx(Yr,{sessionId:_,busy:E.busy,loading:Be,hasPaperSelection:E.messages.some(a=>!!a.paperSelection),onError:H})]}),Be&&!me.text?n.jsxs("div",{className:"chat-session-loading",role:"status","aria-live":"polite",children:[n.jsx(kt,{}),n.jsx("span",{children:"Loading conversation…"})]}):Je?n.jsxs("div",{className:"chat-session-load-error",role:"alert",children:[n.jsx("p",{children:Je}),n.jsx("button",{type:"button",onClick:()=>{T({id:_,status:"loading"}),Fe(a=>a+1)},children:"Try again"})]}):we&&!me.text?n.jsx("div",{className:"chat-empty",children:n.jsxs("div",{className:"chat-empty-inner",children:[n.jsx("div",{className:"chat-empty-eyebrow",children:r==="paper"?"Paper chat":"Research chat"}),n.jsx("h1",{className:"chat-empty-title",children:r==="paper"?"Ask about this paper":n.jsxs(n.Fragment,{children:["Ask ",n.jsx("em",{children:"Papers With Code"})]})}),n.jsx("p",{className:"chat-empty-sub",children:r==="paper"?"Questions are grounded in the open paper. Add up to three other papers with @.":"Answers are grounded in a live hybrid search over papers, tasks, and benchmarks — with citations you can follow."}),V&&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(Rt,{variant:"empty",composerProps:at,provider:Z,paused:j,suggestions:r==="paper"?Qr:_r})]})}):n.jsxs(n.Fragment,{children:[E.sessionError&&n.jsx("div",{className:"chat-session-error",role:"alert",children:E.sessionError}),n.jsx(Lr,{messages:E.messages,papers:E.papers,busy:E.busy,queuedDraft:me.text?me:void 0,paperMentionsEnabled:!!((pt=$.data)!=null&&pt.paper_mentions_enabled),archivePending:Le.pending,openRouterFallbackEnabled:Mt,onToggleBlock:E.toggleBlock,onEditAndResend:E.editAndResend,onArchiveOld:()=>void Le.archiveOld(),onArchiveOldest:()=>void Le.archiveOldest()}),n.jsx(Rt,{variant:"followup",composerProps:at,provider:Z,paused:j})]})]})}),E.capacityRequest&&n.jsx(Mr,{retryAt:E.capacityRequest.retryAt,onCancel:E.cancelCapacity,onRetry:()=>{E.retryCapacity()&&(K(de()),c==null||c(void 0))}}),E.disabledRequest&&n.jsx(Nr,{onClose:()=>{var d;const a=((d=E.disabledRequest)==null?void 0:d.draft)??ue;K(a),c==null||c(a.paperSelection),E.dismissDisabled(),$.refetch()}})]})})},vn=()=>n.jsx(en,{});export{Mr as ChatCapacityDialog,en as ChatExperience,vn as default};
assets/{ConferenceDetailView-j3TmqjV4.js → ConferenceDetailView-4y66r_zR.js} RENAMED
@@ -1 +1 @@
1
- import{c as L,r as D,j as e,L as p}from"./index-DpqMFKEJ.js";import{u as T}from"./useQuery-BRJ3D8WJ.js";import{M as F}from"./MarkdownText-fqFB7jpa.js";import{c as A}from"./catalog-CNSpmU4d.js";import{c as B,h as C,d as E}from"./transform-BG6M6eP3.js";import{S as f}from"./skeleton-BmlKdebV.js";import{A as P,a as z}from"./alert-C5eNYVhH.js";import{s as M}from"./safeExternalHref-CkBrsh84.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-Da7TZ3ij.js";import"./index-DYz3ynl3.js";import"./hover-card-K79gJfh7.js";import"./papers-inj3gJs3.js";const R=a=>(a==null?void 0:a.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",O=(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}`},ee=()=>{var k,S,b,_,$,w;const{confSlug:a}=L(),t=T({queryKey:["conference-areas-with-tasks",a],queryFn:()=>A.conferenceAreasWithTasks(a),enabled:!!a,staleTime:10*60*1e3}),i=D.useMemo(()=>{if(!t.data)return[];const n={general:0,vision:1,video:2,language:3,audio:4,other:5},r=o=>n[R(o)]??999;return[...t.data.results].sort((o,l)=>{const d=r(o.name),x=r(l.name);return d!==x?d-x:o.name.localeCompare(l.name)})},[t.data]),s=(k=t.data)==null?void 0:k.conference,c=((S=t.data)==null?void 0:S.total_paper_count)??0,m=((b=t.data)==null?void 0:b.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((n,r)=>n+r.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?O(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:M(s.url)??void 0,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:n=>{var r,o;(o=(r=n.currentTarget.parentElement)==null?void 0:r.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((n,r)=>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))})]},r))}):i.map(n=>{const r=n.tasks;if(r.length===0)return null;const o=r.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:n.name}),n.description&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:n.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[r.length," ",r.length===1?"task":"tasks"," · ",o.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:r.map(l=>{const d=l.slug||"",x=B(C(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)})})]},n.id)}),v>0&&e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[v," tasks across ",i.filter(n=>n.tasks.length>0).length," areas."]})]})};export{ee as default};
 
1
+ import{c as L,r as D,j as e,L as p}from"./index-B5X8-Bq7.js";import{u as T}from"./useQuery-D05r-Fqo.js";import{M as F}from"./MarkdownText-BGyyXIsO.js";import{c as A}from"./catalog-Cpdj6dI_.js";import{c as B,h as C,d as E}from"./transform-Ce1Ycrlu.js";import{S as f}from"./skeleton-Ck9ioJnz.js";import{A as P,a as z}from"./alert-C4A_tmFK.js";import{s as M}from"./safeExternalHref-CkBrsh84.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-Br9pyKgi.js";import"./index-LVXoOqbx.js";import"./hover-card-ClPcsbgj.js";import"./papers-D7y8njf2.js";const R=a=>(a==null?void 0:a.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",O=(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}`},ee=()=>{var k,S,b,_,$,w;const{confSlug:a}=L(),t=T({queryKey:["conference-areas-with-tasks",a],queryFn:()=>A.conferenceAreasWithTasks(a),enabled:!!a,staleTime:10*60*1e3}),i=D.useMemo(()=>{if(!t.data)return[];const n={general:0,vision:1,video:2,language:3,audio:4,other:5},r=o=>n[R(o)]??999;return[...t.data.results].sort((o,l)=>{const d=r(o.name),x=r(l.name);return d!==x?d-x:o.name.localeCompare(l.name)})},[t.data]),s=(k=t.data)==null?void 0:k.conference,c=((S=t.data)==null?void 0:S.total_paper_count)??0,m=((b=t.data)==null?void 0:b.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((n,r)=>n+r.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?O(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:M(s.url)??void 0,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:n=>{var r,o;(o=(r=n.currentTarget.parentElement)==null?void 0:r.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((n,r)=>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))})]},r))}):i.map(n=>{const r=n.tasks;if(r.length===0)return null;const o=r.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:n.name}),n.description&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:n.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[r.length," ",r.length===1?"task":"tasks"," · ",o.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:r.map(l=>{const d=l.slug||"",x=B(C(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)})})]},n.id)}),v>0&&e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[v," tasks across ",i.filter(n=>n.tasks.length>0).length," areas."]})]})};export{ee as default};
assets/{ConferenceTaskView-CLcoonXP.js → ConferenceTaskView-EpnQ4uWR.js} RENAMED
@@ -1 +1 @@
1
- import{c as $,a as D,r as f,j as e,L as b,z as W}from"./index-DpqMFKEJ.js";import{u as M}from"./useQuery-BRJ3D8WJ.js";import{P as G}from"./components-D8W6Owmv.js";import{u as J,P as X}from"./useIntersectionObserver-CXj-qZiT.js";import{M as h}from"./MarkdownText-fqFB7jpa.js";import{c as z}from"./catalog-CNSpmU4d.js";import{t as Y,d as Z}from"./transform-BG6M6eP3.js";import{c as ee}from"./usePapers-BLL7LMPj.js";import{S as se}from"./skeleton-BmlKdebV.js";import{A as ae,a as te}from"./alert-C5eNYVhH.js";import"./LatexTitle-j9Bx8wiP.js";import"./katex.min-BSBacQyE.js";import"./papers-inj3gJs3.js";import"./safeExternalHref-CkBrsh84.js";import"./PaperPreviewLink-Da7TZ3ij.js";import"./index-DYz3ynl3.js";import"./hover-card-K79gJfh7.js";import"./useInfiniteQuery-ud8-aqIx.js";const re=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ne=a=>a==="trending"||a==="date_published"||a==="citation_count"?a:"trending",ye=()=>{var A,F,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=M({queryKey:["conference",a],queryFn:()=>z.getConference(a),enabled:!!a,staleTime:10*60*1e3}),x=M({queryKey:["task",n],queryFn:()=>z.getTask(n),enabled:!!n&&!p,staleTime:10*60*1e3}),i=ee({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}=J({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(Y),[_]),g=k?"All papers":P?"Oral papers":N?"Spotlight papers":l?"Outstanding papers":d?"Best paper finalists":Z(((A=x.data)==null?void 0:A.name)||n||"",((F=x.data)==null?void 0:F.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(X,{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{ye as default};
 
1
+ import{c as $,a as D,r as f,j as e,L as b,z as W}from"./index-B5X8-Bq7.js";import{u as M}from"./useQuery-D05r-Fqo.js";import{P as G}from"./components-BYijBjrn.js";import{u as J,P as X}from"./useIntersectionObserver-II0SG2xo.js";import{M as h}from"./MarkdownText-BGyyXIsO.js";import{c as z}from"./catalog-Cpdj6dI_.js";import{t as Y,d as Z}from"./transform-Ce1Ycrlu.js";import{c as ee}from"./usePapers-CCbDROh4.js";import{S as se}from"./skeleton-Ck9ioJnz.js";import{A as ae,a as te}from"./alert-C4A_tmFK.js";import"./LatexTitle-BQ-aqYJn.js";import"./katex.min-BSBacQyE.js";import"./papers-D7y8njf2.js";import"./safeExternalHref-CkBrsh84.js";import"./PaperPreviewLink-Br9pyKgi.js";import"./index-LVXoOqbx.js";import"./hover-card-ClPcsbgj.js";import"./useInfiniteQuery-SpeFiDye.js";const re=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ne=a=>a==="trending"||a==="date_published"||a==="citation_count"?a:"trending",ye=()=>{var A,F,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=M({queryKey:["conference",a],queryFn:()=>z.getConference(a),enabled:!!a,staleTime:10*60*1e3}),x=M({queryKey:["task",n],queryFn:()=>z.getTask(n),enabled:!!n&&!p,staleTime:10*60*1e3}),i=ee({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}=J({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(Y),[_]),g=k?"All papers":P?"Oral papers":N?"Spotlight papers":l?"Outstanding papers":d?"Best paper finalists":Z(((A=x.data)==null?void 0:A.name)||n||"",((F=x.data)==null?void 0:F.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(X,{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{ye as default};
assets/{ConferencesIndexView-CeEX2aRl.js → ConferencesIndexView-CxO00TlM.js} RENAMED
@@ -1 +1 @@
1
- import{r as u,j as e,L as d}from"./index-DpqMFKEJ.js";import{u as p}from"./useQuery-BRJ3D8WJ.js";import{c as f}from"./catalog-CNSpmU4d.js";import{S as m}from"./skeleton-BmlKdebV.js";import{A as h,a as g}from"./alert-C5eNYVhH.js";import{T as x}from"./TaxonomySuggestionTile-B4j9rE3C.js";import"./SignInToEditDialog-_xlmZxOT.js";import"./button-CpZL29fe.js";import"./textarea-BA4c3aP6.js";import"./dialog-DW3Uw8Zv.js";import"./useMutation-BFwg1MYO.js";import"./submissions-B8Kj7oPp.js";import"./loader-circle-CEEZZR71.js";const j=(r,a)=>{if(!r)return null;const t=new Date(`${r}T00:00:00`),s=a?new Date(`${a}T00:00:00`):null,n=o=>o.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=t.getFullYear();return s&&s.getTime()!==t.getTime()?t.getMonth()===s.getMonth()?`${n(t).replace(/\d+$/,"").trim()} ${t.getDate()}–${s.getDate()}, ${i}`:`${n(t)} – ${n(s)}, ${i}`:`${n(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 a=(t=r.slug.match(/-(\d{4})$/))==null?void 0:t[1];return a?Number(a):0},y=(r,a)=>{if(r.start_date&&a.start_date){const t=r.start_date.localeCompare(a.start_date);if(t!==0)return t}else{if(r.start_date)return-1;if(a.start_date)return 1}return r.name.localeCompare(a.name)},N={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},M=()=>{const r=p({queryKey:["conferences"],queryFn:()=>f.conferences(),staleTime:6e5}),a=u.useMemo(()=>{var s;if(!((s=r.data)!=null&&s.results))return null;const t={};return r.data.results.forEach(n=>{const i=v(n);(t[i]||(t[i]=[])).push(n)}),Object.values(t).forEach(n=>n.sort(y)),Object.keys(t).map(Number).sort((n,i)=>i-n).map(n=>({year:n,conferences:t[n]}))},[r.data]);return r.error?e.jsx("div",{className:"page",children:e.jsx(h,{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"}),". Conference information is based on"," ",e.jsx("a",{href:"https://huggingface.co/ai-conferences",target:"_blank",rel:"noreferrer",className:"underline underline-offset-2 hover:text-foreground",children:"Hugging Face AI Conferences"}),"."]})]})}),r.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:2}).map((t,s)=>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((n,i)=>e.jsx(m,{className:"h-32"},i))})]},s))}):a==null?void 0:a.map(({year:t,conferences:s})=>{const n=s.reduce((o,l)=>o+(l.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:[s.length," ",s.length===1?"conference":"conferences"," ·"," ",n.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[s.map(o=>{const l=j(o.start_date,o.end_date),c=[o.venue,o.location].filter(Boolean).join(", ");return e.jsxs(d,{to:`/conferences/${o.slug}`,className:"tag-cell",children:[e.jsx("div",{className:"name",children:o.name}),e.jsxs("div",{className:"meta",style:{display:"flex",flexDirection:"column",gap:4},children:[l&&e.jsx("span",{children:l}),c&&e.jsx("span",{children:c}),e.jsxs("span",{children:[(o.paper_count??0).toLocaleString()," papers"]})]})]},o.id)}),e.jsx(x,{kind:"conference"})]})]},t)})]})};export{M as default};
 
1
+ import{r as u,j as e,L as d}from"./index-B5X8-Bq7.js";import{u as p}from"./useQuery-D05r-Fqo.js";import{c as f}from"./catalog-Cpdj6dI_.js";import{S as m}from"./skeleton-Ck9ioJnz.js";import{A as h,a as g}from"./alert-C4A_tmFK.js";import{T as x}from"./TaxonomySuggestionTile-DlEFIt6g.js";import"./SignInToEditDialog-C_4kkM3M.js";import"./button-cqkU__aM.js";import"./textarea-Bw7gV3w2.js";import"./dialog-DQCWceSF.js";import"./useMutation-jhc4sxTL.js";import"./submissions-CUbxi_j0.js";import"./loader-circle-QH8Jsx5e.js";const j=(r,a)=>{if(!r)return null;const t=new Date(`${r}T00:00:00`),s=a?new Date(`${a}T00:00:00`):null,n=o=>o.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=t.getFullYear();return s&&s.getTime()!==t.getTime()?t.getMonth()===s.getMonth()?`${n(t).replace(/\d+$/,"").trim()} ${t.getDate()}–${s.getDate()}, ${i}`:`${n(t)} – ${n(s)}, ${i}`:`${n(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 a=(t=r.slug.match(/-(\d{4})$/))==null?void 0:t[1];return a?Number(a):0},y=(r,a)=>{if(r.start_date&&a.start_date){const t=r.start_date.localeCompare(a.start_date);if(t!==0)return t}else{if(r.start_date)return-1;if(a.start_date)return 1}return r.name.localeCompare(a.name)},N={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},M=()=>{const r=p({queryKey:["conferences"],queryFn:()=>f.conferences(),staleTime:6e5}),a=u.useMemo(()=>{var s;if(!((s=r.data)!=null&&s.results))return null;const t={};return r.data.results.forEach(n=>{const i=v(n);(t[i]||(t[i]=[])).push(n)}),Object.values(t).forEach(n=>n.sort(y)),Object.keys(t).map(Number).sort((n,i)=>i-n).map(n=>({year:n,conferences:t[n]}))},[r.data]);return r.error?e.jsx("div",{className:"page",children:e.jsx(h,{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"}),". Conference information is based on"," ",e.jsx("a",{href:"https://huggingface.co/ai-conferences",target:"_blank",rel:"noreferrer",className:"underline underline-offset-2 hover:text-foreground",children:"Hugging Face AI Conferences"}),"."]})]})}),r.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:2}).map((t,s)=>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((n,i)=>e.jsx(m,{className:"h-32"},i))})]},s))}):a==null?void 0:a.map(({year:t,conferences:s})=>{const n=s.reduce((o,l)=>o+(l.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:[s.length," ",s.length===1?"conference":"conferences"," ·"," ",n.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[s.map(o=>{const l=j(o.start_date,o.end_date),c=[o.venue,o.location].filter(Boolean).join(", ");return e.jsxs(d,{to:`/conferences/${o.slug}`,className:"tag-cell",children:[e.jsx("div",{className:"name",children:o.name}),e.jsxs("div",{className:"meta",style:{display:"flex",flexDirection:"column",gap:4},children:[l&&e.jsx("span",{children:l}),c&&e.jsx("span",{children:c}),e.jsxs("span",{children:[(o.paper_count??0).toLocaleString()," papers"]})]})]},o.id)}),e.jsx(x,{kind:"conference"})]})]},t)})]})};export{M as default};
assets/{CronDashboard-DKXU8hrn.js → CronDashboard-U8gVQqxH.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{d as T,r as u,j as e,q as k,t as Qe,k as Xe,h as re,V as Ze,R as Ye,I as es,m as ie,P as ss,p as as,v as Ce,g as Se,L as rs,Z as ns,y as ts,b as is}from"./index-DpqMFKEJ.js";import{u as K}from"./useQuery-BRJ3D8WJ.js";import{B as C,D as he,r as cs,f as ls,h as os,j as ds,p as ms,k as us}from"./codexAddEvals-nWlYUpJo.js";import{B as P}from"./button-CpZL29fe.js";import{C as xs}from"./chevron-down-CAjIY4ok.js";import{F as pe}from"./file-text-Ce3hOAur.js";import{C as Q,R as je,S as hs}from"./shield-alert-CZXx3Eq7.js";import{L as F}from"./loader-circle-CEEZZR71.js";import{C as de}from"./circle-check-CNWaDe-t.js";import{E as le}from"./external-link-CU5Ded46.js";import{u as O}from"./useMutation-BFwg1MYO.js";import{u as ps}from"./useInfiniteQuery-ud8-aqIx.js";import{c as ce}from"./catalog-CNSpmU4d.js";import{c as ge}from"./chat-BrAdjM-f.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{d as T,r as u,j as e,q as k,t as Qe,k as Xe,h as re,V as Ze,R as Ye,I as es,m as ie,P as ss,p as as,v as Ce,g as Se,L as rs,Z as ns,y as ts,b as is}from"./index-B5X8-Bq7.js";import{u as K}from"./useQuery-D05r-Fqo.js";import{B as C,D as he,r as cs,f as ls,h as os,j as ds,p as ms,k as us}from"./codexAddEvals-BmFseKZD.js";import{B as P}from"./button-cqkU__aM.js";import{C as xs}from"./chevron-down-RoGVatuo.js";import{F as pe}from"./file-text-DMqoegbt.js";import{C as Q,R as je,S as hs}from"./shield-alert-DgHxtlyZ.js";import{L as F}from"./loader-circle-QH8Jsx5e.js";import{C as de}from"./circle-check-B1NcY31m.js";import{E as le}from"./external-link-C6re1H68.js";import{u as O}from"./useMutation-jhc4sxTL.js";import{u as ps}from"./useInfiniteQuery-SpeFiDye.js";import{c as ce}from"./catalog-Cpdj6dI_.js";import{c as ge}from"./chat-C6rpOyOn.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{ExternalSourceEvalBadge-7U9mCirI.js → ExternalSourceEvalBadge-BL5qKVgu.js} RENAMED
@@ -1 +1 @@
1
- import{a as l}from"./papers-inj3gJs3.js";import{Z as h,j as a,L as u}from"./index-DpqMFKEJ.js";import{H as c,a as d,b as p}from"./hover-card-K79gJfh7.js";import{s as g}from"./safeExternalHref-CkBrsh84.js";class m{constructor(e){this.request=e}list(e={}){const t=new URLSearchParams(Object.entries(e).filter(s=>s[1]!==void 0).map(([s,n])=>[s,String(n)])).toString();return this.request(`/evaluations/${t?`?${t}`:""}`,{cache:"no-store"})}get(e){return this.request(`/evaluations/${e}`)}async byPaper(e){return this.allPages({paper_id:Number(e),ordering:"-benchmark_popularity"})}async byDataset(e,t){return this.allPages({dataset_id:Number(e),best_metric:t,ordering:"best_rank"})}create(e){return this.request("/evaluations/",{method:"POST",body:JSON.stringify(e)})}update(e,t){return this.request(`/evaluations/${e}`,{method:"PUT",body:JSON.stringify(t)})}delete(e){return this.request(`/evaluations/${e}`,{method:"DELETE"})}primeCurationState(e,t=!1){return l.primeEvaluations(e,t)}batch(e,t){return l.mutateEvaluations(e,t,"/evaluations/batch",{method:"POST",body:JSON.stringify({paper_id:e,operations:t})})}async allPages(e){const s=await this.list({...e,page_size:100}),n=[...s.results];let i=s.next_page;for(;i;){const o=await this.list({...e,page:i,page_size:100});n.push(...o.results),i=o.next_page}return n}}const w=new m(h),S=()=>a.jsxs(c,{openDelay:120,closeDelay:120,children:[a.jsx(d,{asChild:!0,children:a.jsx("button",{type:"button",className:"bm-closed-source-tag","aria-label":"Closed-source model",children:"closed"})}),a.jsxs(p,{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"," ",a.jsx(u,{to:"/settings",className:"closed-eval-tooltip-link",children:"settings"}),"."]})]});function x(r){if(!r)return"Evaluation sourced outside this paper";const e=r.toLowerCase();if(e.includes("open-asr-leaderboard"))return"Open ASR Leaderboard";if(e.includes("arcprize.org"))return"ARC Prize Leaderboard";if(e.includes("frontierswe.com"))return"FrontierSWE";if(e.includes("deepswe.datacurve.ai"))return"DeepSWE";try{const t=new URL(r,"https://paperswithcode.co");return t.pathname.startsWith("/paper/")?"Source paper":t.hostname.replace(/^www\./,"")}catch{return r}}const j=({sourceUrl:r})=>{const e=g(r),t=typeof r=="string"&&r.startsWith("/paper/")?r:null,s=x(r);return a.jsxs(c,{openDelay:120,closeDelay:120,children:[a.jsx(d,{asChild:!0,children:a.jsx("button",{type:"button",className:"bm-external-source-tag","aria-label":`Externally sourced evaluation: ${s}`,children:"External"})}),a.jsxs(p,{side:"top",align:"start",className:"w-auto max-w-[280px] p-3 text-sm leading-snug",children:["This score was sourced outside this paper.",t?a.jsxs(a.Fragment,{children:[" ",a.jsx(u,{to:t,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:s}),"."]}):e?a.jsxs(a.Fragment,{children:[" ",a.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:s}),"."]}):a.jsxs(a.Fragment,{children:[" ",s,"."]})]})]})};export{S as C,j as E,w as e};
 
1
+ import{a as l}from"./papers-D7y8njf2.js";import{Z as h,j as a,L as u}from"./index-B5X8-Bq7.js";import{H as c,a as d,b as p}from"./hover-card-ClPcsbgj.js";import{s as g}from"./safeExternalHref-CkBrsh84.js";class m{constructor(e){this.request=e}list(e={}){const t=new URLSearchParams(Object.entries(e).filter(s=>s[1]!==void 0).map(([s,n])=>[s,String(n)])).toString();return this.request(`/evaluations/${t?`?${t}`:""}`,{cache:"no-store"})}get(e){return this.request(`/evaluations/${e}`)}async byPaper(e){return this.allPages({paper_id:Number(e),ordering:"-benchmark_popularity"})}async byDataset(e,t){return this.allPages({dataset_id:Number(e),best_metric:t,ordering:"best_rank"})}create(e){return this.request("/evaluations/",{method:"POST",body:JSON.stringify(e)})}update(e,t){return this.request(`/evaluations/${e}`,{method:"PUT",body:JSON.stringify(t)})}delete(e){return this.request(`/evaluations/${e}`,{method:"DELETE"})}primeCurationState(e,t=!1){return l.primeEvaluations(e,t)}batch(e,t){return l.mutateEvaluations(e,t,"/evaluations/batch",{method:"POST",body:JSON.stringify({paper_id:e,operations:t})})}async allPages(e){const s=await this.list({...e,page_size:100}),n=[...s.results];let i=s.next_page;for(;i;){const o=await this.list({...e,page:i,page_size:100});n.push(...o.results),i=o.next_page}return n}}const w=new m(h),S=()=>a.jsxs(c,{openDelay:120,closeDelay:120,children:[a.jsx(d,{asChild:!0,children:a.jsx("button",{type:"button",className:"bm-closed-source-tag","aria-label":"Closed-source model",children:"closed"})}),a.jsxs(p,{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"," ",a.jsx(u,{to:"/settings",className:"closed-eval-tooltip-link",children:"settings"}),"."]})]});function x(r){if(!r)return"Evaluation sourced outside this paper";const e=r.toLowerCase();if(e.includes("open-asr-leaderboard"))return"Open ASR Leaderboard";if(e.includes("arcprize.org"))return"ARC Prize Leaderboard";if(e.includes("frontierswe.com"))return"FrontierSWE";if(e.includes("deepswe.datacurve.ai"))return"DeepSWE";try{const t=new URL(r,"https://paperswithcode.co");return t.pathname.startsWith("/paper/")?"Source paper":t.hostname.replace(/^www\./,"")}catch{return r}}const j=({sourceUrl:r})=>{const e=g(r),t=typeof r=="string"&&r.startsWith("/paper/")?r:null,s=x(r);return a.jsxs(c,{openDelay:120,closeDelay:120,children:[a.jsx(d,{asChild:!0,children:a.jsx("button",{type:"button",className:"bm-external-source-tag","aria-label":`Externally sourced evaluation: ${s}`,children:"External"})}),a.jsxs(p,{side:"top",align:"start",className:"w-auto max-w-[280px] p-3 text-sm leading-snug",children:["This score was sourced outside this paper.",t?a.jsxs(a.Fragment,{children:[" ",a.jsx(u,{to:t,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:s}),"."]}):e?a.jsxs(a.Fragment,{children:[" ",a.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:s}),"."]}):a.jsxs(a.Fragment,{children:[" ",s,"."]})]})]})};export{S as C,j as E,w as e};
assets/FeedView-BJRolksy.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{u as U,r as d,i as R,j as e,a as B,L as M,b as K}from"./index-B5X8-Bq7.js";import{P as W}from"./components-BYijBjrn.js";import{u as z,P as G}from"./useIntersectionObserver-II0SG2xo.js";import{D as V,S as Q,P as X,u as Y,a as J,M as Z,R as ee,W as se,A as ae,b as te,q as re,c as ie}from"./chatLaunch-BYshi3Oy.js";import{c as ne}from"./chat-C6rpOyOn.js";import{c as D}from"./catalog-Cpdj6dI_.js";import{S as w}from"./chatPrompts-CDY3UGU1.js";import{t as oe,d as O}from"./transform-Ce1Ycrlu.js";import{u as le}from"./usePapers-CCbDROh4.js";import{P as ce}from"./usePeriodFilter-BOGR6X98.js";import{S as N}from"./skeleton-Ck9ioJnz.js";import{A as de,a as me}from"./alert-C4A_tmFK.js";import{u as I}from"./useQuery-D05r-Fqo.js";import"./LatexTitle-BQ-aqYJn.js";import"./katex.min-BSBacQyE.js";import"./papers-D7y8njf2.js";import"./safeExternalHref-CkBrsh84.js";import"./chevron-down-RoGVatuo.js";import"./useInfiniteQuery-SpeFiDye.js";const he=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],pe={Today:"today","This Week":"week","This Month":"month","All Time":"all_time"},ue={today:"Today",week:"This Week",month:"This Month",all_time:"All Time"},H=45,fe=1800,ge=25,xe=350,be=i=>{const[h,o]=d.useState(w[0].slice(0,1));return d.useEffect(()=>{var _,j;if(!i)return;if((j=(_=window.matchMedia)==null?void 0:_.call(window,"(prefers-reduced-motion: reduce)"))!=null&&j.matches){o(w[0]);return}let u=0,n=1,f=!1,m;o(w[0].slice(0,n));const l=()=>{const g=w[u];if(!f){if(n+=1,o(g.slice(0,n)),n===g.length){f=!0,m=window.setTimeout(l,fe);return}m=window.setTimeout(l,H);return}if(n-=1,o(g.slice(0,n)),n===0){f=!1,u=(u+1)%w.length,m=window.setTimeout(l,xe);return}m=window.setTimeout(l,ge)};return m=window.setTimeout(l,H),()=>window.clearTimeout(m)},[i]),h},je=i=>i==="trending"||i==="date_published"||i==="citation_count"?i:"trending",ve=i=>i==="today"||i==="week"||i==="month"||i==="all_time"?i:"all_time",_e=()=>{var A,s,t;const i=U(),h=K()?Q:X,[o,u]=d.useState({text:"",paperMentions:[]}),n=o.text,[f,m]=d.useState(0),[l,_]=d.useState(V),j=(A=h.find(a=>a.id===l))==null?void 0:A.provider,[g,k]=d.useState(!1),[x,c]=d.useState("low"),[b,C]=d.useState(!1),E=be(!n),T=d.useRef(null),L=I({queryKey:["chatAvailability"],queryFn:()=>ne.getAvailability(),retry:!1,enabled:R()}),P=!!((s=L.data)!=null&&s.web_search_available),v=R()&&((t=L.data)==null?void 0:t.paper_mentions_enabled)!==!1,r=Y({draft:o,onChange:u,enabled:v,textareaRef:T});d.useLayoutEffect(()=>{const a=T.current;if(!a)return;const p=()=>{if(a.style.height="auto",n){a.style.height=`${Math.min(a.scrollHeight,160)}px`;return}const y=a.placeholder,F=w.reduce((q,$)=>(a.placeholder=$,Math.max(q,a.scrollHeight)),0);a.placeholder=y,a.style.height=`${Math.min(F,160)}px`};return p(),window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[n]);const S=async(a=o)=>{if(!(!a.text.trim()||b)){C(!0),re(a,l,{webSearchEnabled:P&&g,reasoningEffort:x});try{const y=await ie(l,x);i(`/chat/${y.id}`)}catch{i("/chat")}}};return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"ask-home-new",children:"Hint: type @ to bring papers into context"}),e.jsxs("div",{className:"ask-home",children:[e.jsxs("div",{className:"ask-home-textarea-wrap",children:[e.jsx(J,{text:o.text,mentions:o.paperMentions,scrollTop:f,variant:"home"}),e.jsx("textarea",{ref:T,rows:1,value:n,placeholder:E,"aria-label":"Ask the assistant",disabled:b,onChange:a=>r.updateText(a.target.value,a.target.selectionStart),onSelect:a=>r.refresh(a.currentTarget.selectionStart),onClick:a=>r.refresh(a.currentTarget.selectionStart),onScroll:a=>m(a.currentTarget.scrollTop),onBlur:a=>{var p,y;(y=(p=a.relatedTarget)==null?void 0:p.closest)!=null&&y.call(p,".chat-paper-picker")||window.setTimeout(r.close,0)},onKeyDown:a=>{r.keyDown(a)||a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),S())},role:v?"combobox":void 0,"aria-expanded":v?r.open:void 0,"aria-controls":r.open?r.pickerId:void 0,"aria-activedescendant":r.open&&r.results.length?`${r.optionIdPrefix}-${r.activeIndex}`:void 0,"aria-autocomplete":v?"list":void 0,"aria-describedby":r.message?"ask-home-paper-mention-message":void 0})]}),r.message&&e.jsx("div",{id:"ask-home-paper-mention-message",className:"chat-paper-mention-message",role:"alert",children:r.message}),e.jsxs("div",{className:"ask-home-foot",children:[e.jsxs("div",{className:"ask-home-provider-tools",children:[e.jsx(Z,{models:h,selectedModel:l,onModelChange:_}),e.jsx(ee,{value:x,onChange:c,disabled:b}),P&&e.jsx(se,{enabled:g,onChange:k,disabled:b}),j==="huggingface"&&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"})]}),j==="openai"&&e.jsx("span",{className:"ask-home-hint",children:"Via OpenAI"})]}),e.jsx("button",{type:"button",className:`chat-send${n.trim()?" chat-send-on":""}`,onClick:()=>void S(),disabled:!n.trim()||b,"aria-label":"Ask the assistant",children:e.jsx(ae,{})})]}),e.jsx(te,{open:r.open,query:r.query,results:r.results,activeIndex:r.activeIndex,loading:r.loading,error:r.error,onSelect:r.select,id:r.pickerId,optionIdPrefix:r.optionIdPrefix})]})]})},$e=()=>{var P,v,r,S,A;const[i,h]=B(),o=je(i.get("order_by")),u=ve(i.get("time")),n=i.get("has_code")==="true",f=i.get("has_hf_artifacts")==="true",m=ue[u],l=s=>{const t=new URLSearchParams(i);t.set("order_by",s),h(t)},_=s=>{const t=new URLSearchParams(i);t.set("time",pe[s]),h(t)},j=s=>{const t=new URLSearchParams(i);s?t.set("has_code","true"):t.delete("has_code"),h(t)},g=s=>{const t=new URLSearchParams(i);s?t.set("has_hf_artifacts","true"):t.delete("has_hf_artifacts"),h(t)},k=I({queryKey:["top-tasks-sidebar"],queryFn:()=>D.topTasks(8),staleTime:10*60*1e3}),x=I({queryKey:["trending-tasks-sidebar"],queryFn:()=>D.trendingTasks({limit:8,level:0}),staleTime:10*60*1e3}),c=le({page_size:30,order_by:o,order_dir:"desc",time:u,include_resources:!0,has_code:n,has_hf_artifacts:f}),b=d.useMemo(()=>{var t;return(((t=c.data)==null?void 0:t.pages.flatMap(a=>a.results))||[]).map(oe)},[c.data]),{targetRef:C,isIntersecting:E}=z({rootMargin:"400px"});d.useEffect(()=>{E&&c.hasNextPage&&!c.isFetchingNextPage&&c.fetchNextPage()},[E,c.hasNextPage,c.isFetchingNextPage]);const T=c.isLoading,L=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 sidebar-section-top-domains",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),k.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,t)=>e.jsx(N,{className:"h-5 w-full"},t))}),(P=k.data)==null?void 0:P.map(s=>e.jsxs(M,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[O(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id)),e.jsx(M,{to:"/tasks",className:"sidebar-link",style:{marginTop:8,fontStyle:"italic"},children:"all domains →"})]}),e.jsxs("div",{className:"sidebar-section sidebar-section-trending-domains",children:[e.jsx("div",{className:"sidebar-label",children:"Trending Domains"}),x.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,t)=>e.jsx(N,{className:"h-5 w-full"},t))}),((r=(v=x.data)==null?void 0:v.results)==null?void 0:r.length)===0&&!x.isLoading&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"No domains gaining momentum right now."}),(A=(S=x.data)==null?void 0:S.results)==null?void 0:A.map(s=>e.jsxs(M,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[O(s.name,s.slug),e.jsxs("span",{className:"count",children:[s.share_lift.toFixed(1),"x"]})]},s.id))]})]}),e.jsxs("div",{className:"feed-main",children:[R()&&e.jsx("div",{className:"feed-chat",children:e.jsx(_e,{})}),e.jsxs("div",{className:"feed-content",children:[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:he.map(([s,t])=>e.jsx("button",{className:`sort-btn ${o===s?"active":""}`,onClick:()=>l(s),children:t},s))}),e.jsx(G,{hasCode:n,hasHfArtifacts:f,onHasCodeChange:j,onHasHfArtifactsChange:g})]}),e.jsx("div",{className:"sort-options sort-options-time",children:ce.map(s=>e.jsx("button",{className:`sort-btn sort-btn-time ${m===s?"active":""}`,onClick:()=>_(s),children:s},s))})]}),L&&e.jsx(de,{variant:"destructive",className:"mb-4",children:e.jsx(me,{children:"Failed to load papers. Please try again."})}),T?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(N,{className:"paper-thumb-skeleton"})}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(N,{className:"h-6 w-3/4"}),e.jsx(N,{className:"h-4 w-1/2"}),e.jsx(N,{className:"h-12 w-full"})]})]},t))}):b.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:b.map((s,t)=>e.jsx(W,{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{_e as AskAssistant,$e as default};
assets/FeedView-ClVIjjeq.js DELETED
@@ -1 +0,0 @@
1
- import{u as U,r as d,i as R,j as e,a as B,L as M,b as K}from"./index-DpqMFKEJ.js";import{P as W}from"./components-D8W6Owmv.js";import{u as z,P as G}from"./useIntersectionObserver-CXj-qZiT.js";import{D as V,S as Q,P as X,u as Y,a as J,M as Z,R as ee,W as se,A as ae,b as te,q as re,c as ie}from"./chatSessions-VGVoLTuT.js";import{c as ne}from"./chat-BrAdjM-f.js";import{c as D}from"./catalog-CNSpmU4d.js";import{S as w}from"./chatPrompts-CDY3UGU1.js";import{t as oe,d as O}from"./transform-BG6M6eP3.js";import{u as le}from"./usePapers-BLL7LMPj.js";import{P as ce}from"./usePeriodFilter-ByjPMisl.js";import{S as N}from"./skeleton-BmlKdebV.js";import{A as de,a as me}from"./alert-C5eNYVhH.js";import{u as I}from"./useQuery-BRJ3D8WJ.js";import"./LatexTitle-j9Bx8wiP.js";import"./katex.min-BSBacQyE.js";import"./papers-inj3gJs3.js";import"./safeExternalHref-CkBrsh84.js";import"./chevron-down-CAjIY4ok.js";import"./useInfiniteQuery-ud8-aqIx.js";const he=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],pe={Today:"today","This Week":"week","This Month":"month","All Time":"all_time"},ue={today:"Today",week:"This Week",month:"This Month",all_time:"All Time"},H=45,fe=1800,ge=25,xe=350,be=i=>{const[h,o]=d.useState(w[0].slice(0,1));return d.useEffect(()=>{var _,j;if(!i)return;if((j=(_=window.matchMedia)==null?void 0:_.call(window,"(prefers-reduced-motion: reduce)"))!=null&&j.matches){o(w[0]);return}let u=0,n=1,f=!1,m;o(w[0].slice(0,n));const l=()=>{const g=w[u];if(!f){if(n+=1,o(g.slice(0,n)),n===g.length){f=!0,m=window.setTimeout(l,fe);return}m=window.setTimeout(l,H);return}if(n-=1,o(g.slice(0,n)),n===0){f=!1,u=(u+1)%w.length,m=window.setTimeout(l,xe);return}m=window.setTimeout(l,ge)};return m=window.setTimeout(l,H),()=>window.clearTimeout(m)},[i]),h},je=i=>i==="trending"||i==="date_published"||i==="citation_count"?i:"trending",ve=i=>i==="today"||i==="week"||i==="month"||i==="all_time"?i:"all_time",_e=()=>{var A,s,t;const i=U(),h=K()?Q:X,[o,u]=d.useState({text:"",paperMentions:[]}),n=o.text,[f,m]=d.useState(0),[l,_]=d.useState(V),j=(A=h.find(a=>a.id===l))==null?void 0:A.provider,[g,k]=d.useState(!1),[x,c]=d.useState("low"),[b,C]=d.useState(!1),E=be(!n),T=d.useRef(null),L=I({queryKey:["chatAvailability"],queryFn:()=>ne.getAvailability(),retry:!1,enabled:R()}),P=!!((s=L.data)!=null&&s.web_search_available),v=R()&&((t=L.data)==null?void 0:t.paper_mentions_enabled)!==!1,r=Y({draft:o,onChange:u,enabled:v,textareaRef:T});d.useLayoutEffect(()=>{const a=T.current;if(!a)return;const p=()=>{if(a.style.height="auto",n){a.style.height=`${Math.min(a.scrollHeight,160)}px`;return}const y=a.placeholder,F=w.reduce((q,$)=>(a.placeholder=$,Math.max(q,a.scrollHeight)),0);a.placeholder=y,a.style.height=`${Math.min(F,160)}px`};return p(),window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[n]);const S=async(a=o)=>{if(!(!a.text.trim()||b)){C(!0),re(a,l,{webSearchEnabled:P&&g,reasoningEffort:x});try{const y=await ie(l,x);i(`/chat/${y.id}`)}catch{i("/chat")}}};return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"ask-home-new",children:"Hint: type @ to bring papers into context"}),e.jsxs("div",{className:"ask-home",children:[e.jsxs("div",{className:"ask-home-textarea-wrap",children:[e.jsx(J,{text:o.text,mentions:o.paperMentions,scrollTop:f,variant:"home"}),e.jsx("textarea",{ref:T,rows:1,value:n,placeholder:E,"aria-label":"Ask the assistant",disabled:b,onChange:a=>r.updateText(a.target.value,a.target.selectionStart),onSelect:a=>r.refresh(a.currentTarget.selectionStart),onClick:a=>r.refresh(a.currentTarget.selectionStart),onScroll:a=>m(a.currentTarget.scrollTop),onBlur:a=>{var p,y;(y=(p=a.relatedTarget)==null?void 0:p.closest)!=null&&y.call(p,".chat-paper-picker")||window.setTimeout(r.close,0)},onKeyDown:a=>{r.keyDown(a)||a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),S())},role:v?"combobox":void 0,"aria-expanded":v?r.open:void 0,"aria-controls":r.open?r.pickerId:void 0,"aria-activedescendant":r.open&&r.results.length?`${r.optionIdPrefix}-${r.activeIndex}`:void 0,"aria-autocomplete":v?"list":void 0,"aria-describedby":r.message?"ask-home-paper-mention-message":void 0})]}),r.message&&e.jsx("div",{id:"ask-home-paper-mention-message",className:"chat-paper-mention-message",role:"alert",children:r.message}),e.jsxs("div",{className:"ask-home-foot",children:[e.jsxs("div",{className:"ask-home-provider-tools",children:[e.jsx(Z,{models:h,selectedModel:l,onModelChange:_}),e.jsx(ee,{value:x,onChange:c,disabled:b}),P&&e.jsx(se,{enabled:g,onChange:k,disabled:b}),j==="huggingface"&&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"})]}),j==="openai"&&e.jsx("span",{className:"ask-home-hint",children:"Via OpenAI"})]}),e.jsx("button",{type:"button",className:`chat-send${n.trim()?" chat-send-on":""}`,onClick:()=>void S(),disabled:!n.trim()||b,"aria-label":"Ask the assistant",children:e.jsx(ae,{})})]}),e.jsx(te,{open:r.open,query:r.query,results:r.results,activeIndex:r.activeIndex,loading:r.loading,error:r.error,onSelect:r.select,id:r.pickerId,optionIdPrefix:r.optionIdPrefix})]})]})},$e=()=>{var P,v,r,S,A;const[i,h]=B(),o=je(i.get("order_by")),u=ve(i.get("time")),n=i.get("has_code")==="true",f=i.get("has_hf_artifacts")==="true",m=ue[u],l=s=>{const t=new URLSearchParams(i);t.set("order_by",s),h(t)},_=s=>{const t=new URLSearchParams(i);t.set("time",pe[s]),h(t)},j=s=>{const t=new URLSearchParams(i);s?t.set("has_code","true"):t.delete("has_code"),h(t)},g=s=>{const t=new URLSearchParams(i);s?t.set("has_hf_artifacts","true"):t.delete("has_hf_artifacts"),h(t)},k=I({queryKey:["top-tasks-sidebar"],queryFn:()=>D.topTasks(8),staleTime:10*60*1e3}),x=I({queryKey:["trending-tasks-sidebar"],queryFn:()=>D.trendingTasks({limit:8,level:0}),staleTime:10*60*1e3}),c=le({page_size:30,order_by:o,order_dir:"desc",time:u,include_resources:!0,has_code:n,has_hf_artifacts:f}),b=d.useMemo(()=>{var t;return(((t=c.data)==null?void 0:t.pages.flatMap(a=>a.results))||[]).map(oe)},[c.data]),{targetRef:C,isIntersecting:E}=z({rootMargin:"400px"});d.useEffect(()=>{E&&c.hasNextPage&&!c.isFetchingNextPage&&c.fetchNextPage()},[E,c.hasNextPage,c.isFetchingNextPage]);const T=c.isLoading,L=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 sidebar-section-top-domains",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),k.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,t)=>e.jsx(N,{className:"h-5 w-full"},t))}),(P=k.data)==null?void 0:P.map(s=>e.jsxs(M,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[O(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id)),e.jsx(M,{to:"/tasks",className:"sidebar-link",style:{marginTop:8,fontStyle:"italic"},children:"all domains →"})]}),e.jsxs("div",{className:"sidebar-section sidebar-section-trending-domains",children:[e.jsx("div",{className:"sidebar-label",children:"Trending Domains"}),x.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,t)=>e.jsx(N,{className:"h-5 w-full"},t))}),((r=(v=x.data)==null?void 0:v.results)==null?void 0:r.length)===0&&!x.isLoading&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"No domains gaining momentum right now."}),(A=(S=x.data)==null?void 0:S.results)==null?void 0:A.map(s=>e.jsxs(M,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[O(s.name,s.slug),e.jsxs("span",{className:"count",children:[s.share_lift.toFixed(1),"x"]})]},s.id))]})]}),e.jsxs("div",{className:"feed-main",children:[R()&&e.jsx("div",{className:"feed-chat",children:e.jsx(_e,{})}),e.jsxs("div",{className:"feed-content",children:[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:he.map(([s,t])=>e.jsx("button",{className:`sort-btn ${o===s?"active":""}`,onClick:()=>l(s),children:t},s))}),e.jsx(G,{hasCode:n,hasHfArtifacts:f,onHasCodeChange:j,onHasHfArtifactsChange:g})]}),e.jsx("div",{className:"sort-options sort-options-time",children:ce.map(s=>e.jsx("button",{className:`sort-btn sort-btn-time ${m===s?"active":""}`,onClick:()=>_(s),children:s},s))})]}),L&&e.jsx(de,{variant:"destructive",className:"mb-4",children:e.jsx(me,{children:"Failed to load papers. Please try again."})}),T?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(N,{className:"paper-thumb-skeleton"})}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(N,{className:"h-6 w-3/4"}),e.jsx(N,{className:"h-4 w-1/2"}),e.jsx(N,{className:"h-12 w-full"})]})]},t))}):b.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:b.map((s,t)=>e.jsx(W,{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{_e as AskAssistant,$e as default};
 
 
assets/{FrameworksIndexView-BIBXDNUN.js → FrameworksIndexView-DuHG9IaJ.js} RENAMED
@@ -1 +1 @@
1
- import{u as d,j as e,L as o,z as m}from"./index-DpqMFKEJ.js";import{u as p}from"./useQuery-BRJ3D8WJ.js";import{I as h}from"./components-D8W6Owmv.js";import{c as u}from"./catalog-CNSpmU4d.js";import{c as g,h as f}from"./transform-BG6M6eP3.js";import"./LatexTitle-j9Bx8wiP.js";import"./katex.min-BSBacQyE.js";import"./papers-inj3gJs3.js";import"./safeExternalHref-CkBrsh84.js";const x={gpu:"GPU",cpu:"CPU",apple:"Apple silicon"},j={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},k={fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},_={fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},v={fontFamily:"var(--mono)",fontSize:13,fontWeight:600,letterSpacing:"0.04em",textTransform:"uppercase",color:"var(--ink)",marginBottom:6},b=({platform:r})=>{const n=g(f(r));return e.jsx("span",{className:"framework-platform-chip",style:{background:n.bg,color:n.text},children:x[r]})},w=({framework:r})=>{const n=d(),l=`/papers?framework=${encodeURIComponent(r.slug)}`;return e.jsxs("article",{id:`framework-${r.slug}`,className:"framework-card framework-card-clickable",role:"link",tabIndex:0,"aria-label":`View papers implemented by ${r.name}`,onClick:a=>{a.target.closest("a, button")||n(l)},onKeyDown:a=>{a.target===a.currentTarget&&(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),n(l))},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(a=>e.jsx(b,{platform:a},a))})]}),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(o,{to:`/paper/${r.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"}),r.github_url&&r.paper_count>0&&e.jsxs(o,{to:l,className:"framework-link",children:["Implements ",r.paper_count," ",r.paper_count===1?"paper":"papers"]}),r.github_url&&r.paper_count===0&&e.jsx("span",{className:"framework-link framework-link-disabled","aria-disabled":"true",children:"Implements 0 papers"}),r.github_url&&e.jsxs("a",{href:r.github_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:[e.jsx(h,{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"})]})]})},E=()=>{var a;const r=p({queryKey:["framework-catalog"],queryFn:()=>u.frameworkCatalog()}),n=((a=r.data)==null?void 0:a.domains)??[],l=n.reduce((i,s)=>i+s.categories.reduce((t,c)=>t+c.frameworks.length,0),0);return m.useEffect(()=>{var s;const i=window.location.hash.slice(1);i&&((s=document.getElementById(i))==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."}),n.map(i=>e.jsxs("section",{style:{marginBottom:56},children:[e.jsxs("div",{style:j,children:[e.jsxs("div",{children:[e.jsx("h2",{style:k,children:i.name}),e.jsx("div",{style:_,children:i.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[i.categories.length," ",i.categories.length===1?"category":"categories"," ·"," ",i.categories.reduce((s,t)=>s+t.frameworks.length,0)," frameworks"]})]}),i.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:v,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(t=>e.jsx(w,{framework:t},t.slug))})]},s.slug))]},i.slug)),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:8},children:[l," frameworks across ",n.length," ",n.length===1?"domain":"domains",". More areas coming soon."]})]})};export{w as FrameworkCard,E as default};
 
1
+ import{u as d,j as e,L as o,z as m}from"./index-B5X8-Bq7.js";import{u as p}from"./useQuery-D05r-Fqo.js";import{I as h}from"./components-BYijBjrn.js";import{c as u}from"./catalog-Cpdj6dI_.js";import{c as g,h as f}from"./transform-Ce1Ycrlu.js";import"./LatexTitle-BQ-aqYJn.js";import"./katex.min-BSBacQyE.js";import"./papers-D7y8njf2.js";import"./safeExternalHref-CkBrsh84.js";const x={gpu:"GPU",cpu:"CPU",apple:"Apple silicon"},j={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},k={fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},_={fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},v={fontFamily:"var(--mono)",fontSize:13,fontWeight:600,letterSpacing:"0.04em",textTransform:"uppercase",color:"var(--ink)",marginBottom:6},b=({platform:r})=>{const n=g(f(r));return e.jsx("span",{className:"framework-platform-chip",style:{background:n.bg,color:n.text},children:x[r]})},w=({framework:r})=>{const n=d(),l=`/papers?framework=${encodeURIComponent(r.slug)}`;return e.jsxs("article",{id:`framework-${r.slug}`,className:"framework-card framework-card-clickable",role:"link",tabIndex:0,"aria-label":`View papers implemented by ${r.name}`,onClick:a=>{a.target.closest("a, button")||n(l)},onKeyDown:a=>{a.target===a.currentTarget&&(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),n(l))},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(a=>e.jsx(b,{platform:a},a))})]}),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(o,{to:`/paper/${r.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"}),r.github_url&&r.paper_count>0&&e.jsxs(o,{to:l,className:"framework-link",children:["Implements ",r.paper_count," ",r.paper_count===1?"paper":"papers"]}),r.github_url&&r.paper_count===0&&e.jsx("span",{className:"framework-link framework-link-disabled","aria-disabled":"true",children:"Implements 0 papers"}),r.github_url&&e.jsxs("a",{href:r.github_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:[e.jsx(h,{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"})]})]})},E=()=>{var a;const r=p({queryKey:["framework-catalog"],queryFn:()=>u.frameworkCatalog()}),n=((a=r.data)==null?void 0:a.domains)??[],l=n.reduce((i,s)=>i+s.categories.reduce((t,c)=>t+c.frameworks.length,0),0);return m.useEffect(()=>{var s;const i=window.location.hash.slice(1);i&&((s=document.getElementById(i))==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."}),n.map(i=>e.jsxs("section",{style:{marginBottom:56},children:[e.jsxs("div",{style:j,children:[e.jsxs("div",{children:[e.jsx("h2",{style:k,children:i.name}),e.jsx("div",{style:_,children:i.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[i.categories.length," ",i.categories.length===1?"category":"categories"," ·"," ",i.categories.reduce((s,t)=>s+t.frameworks.length,0)," frameworks"]})]}),i.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:v,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(t=>e.jsx(w,{framework:t},t.slug))})]},s.slug))]},i.slug)),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:8},children:[l," frameworks across ",n.length," ",n.length===1?"domain":"domains",". More areas coming soon."]})]})};export{w as FrameworkCard,E as default};
assets/{LatexTitle-j9Bx8wiP.js → LatexTitle-BQ-aqYJn.js} RENAMED
@@ -1 +1 @@
1
- import{j as o,r as g}from"./index-DpqMFKEJ.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-B5X8-Bq7.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-fqFB7jpa.js → MarkdownText-BGyyXIsO.js} RENAMED
@@ -1 +1 @@
1
- import{n as l,j as s,L as u}from"./index-DpqMFKEJ.js";import"./katex.min-BSBacQyE.js";import{r as p,a as m,P as h}from"./PaperPreviewLink-Da7TZ3ij.js";import{M as d,r as w}from"./index-DYz3ynl3.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,f as r};
 
1
+ import{n as l,j as s,L as u}from"./index-B5X8-Bq7.js";import"./katex.min-BSBacQyE.js";import{r as p,a as m,P as h}from"./PaperPreviewLink-Br9pyKgi.js";import{M as d,r as w}from"./index-LVXoOqbx.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,f as r};
assets/{MethodDetailView-BaNaq4Ov.js → MethodDetailView-DfzyRt-9.js} RENAMED
@@ -1 +1 @@
1
- import{j as e,r as L,c as W,a as Z,L as C,af as V}from"./index-DpqMFKEJ.js";import{u as M}from"./useQuery-BRJ3D8WJ.js";import{u as X}from"./useInfiniteQuery-ud8-aqIx.js";import{M as Y,P as J}from"./components-D8W6Owmv.js";import{u as ee,P as te}from"./useIntersectionObserver-CXj-qZiT.js";import{r as se,M as O}from"./MarkdownText-fqFB7jpa.js";import{c as b}from"./catalog-CNSpmU4d.js";import{p as ae}from"./papers-inj3gJs3.js";import{s as re}from"./slug-BpH-Nkvz.js";import{t as ne}from"./transform-BG6M6eP3.js";import{S as A}from"./skeleton-BmlKdebV.js";import{A as ie,a as le}from"./alert-C5eNYVhH.js";import{s as oe}from"./safeExternalHref-CkBrsh84.js";import"./LatexTitle-j9Bx8wiP.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-Da7TZ3ij.js";import"./index-DYz3ynl3.js";import"./hover-card-K79gJfh7.js";const s={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"},j=({x:t,y:n,w:o,h:l,fill:f,stroke:g,label:u,fontSize:c=10,multiline:_})=>e.jsxs("g",{children:[e.jsx("rect",{x:t,y:n,width:o,height:l,rx:"3",ry:"3",fill:f,stroke:g,strokeWidth:"1"}),_?e.jsxs(e.Fragment,{children:[e.jsx("text",{x:t+o/2,y:n+l/2-2,fontSize:c,fontFamily:"var(--sans)",fill:s.ink,textAnchor:"middle",dominantBaseline:"middle",children:_[0]}),e.jsx("text",{x:t+o/2,y:n+l/2+c-1,fontSize:c,fontFamily:"var(--sans)",fill:s.ink,textAnchor:"middle",dominantBaseline:"middle",children:_[1]})]}):e.jsx("text",{x:t+o/2,y:n+l/2,fontSize:c,fontFamily:"var(--sans)",fill:s.ink,textAnchor:"middle",dominantBaseline:"middle",children:u})]}),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:s.faint,textAnchor:"middle",children:"Scaled Dot-Product Attention"}),e.jsx(j,{x:140,y:40,w:80,h:26,fill:s.yellow,stroke:s.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M180 66 L180 80",stroke:s.ink}),e.jsx(j,{x:140,y:80,w:80,h:26,fill:s.green,stroke:s.greenS,label:"SoftMax",fontSize:11}),e.jsx("path",{d:"M180 106 L180 120",stroke:s.ink}),e.jsx(j,{x:140,y:120,w:80,h:26,fill:s.purple,stroke:s.purpleS,label:"Mask (opt.)",fontSize:11}),e.jsx("path",{d:"M180 146 L180 160",stroke:s.ink}),e.jsx(j,{x:140,y:160,w:80,h:26,fill:s.blue,stroke:s.blueS,label:"Scale ÷√dₖ",fontSize:11}),e.jsx("path",{d:"M180 186 L180 200",stroke:s.ink}),e.jsx(j,{x:140,y:200,w:80,h:26,fill:s.yellow,stroke:s.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M156 226 L120 270",stroke:s.ink}),e.jsx("path",{d:"M180 226 L180 270",stroke:s.ink}),e.jsx("path",{d:"M204 226 L240 270",stroke:s.ink}),e.jsx(j,{x:100,y:270,w:40,h:24,fill:s.pink,stroke:s.pinkS,label:"Q",fontSize:13}),e.jsx(j,{x:160,y:270,w:40,h:24,fill:s.pink,stroke:s.pinkS,label:"K",fontSize:13}),e.jsx(j,{x:220,y:270,w:40,h:24,fill:s.pink,stroke:s.pinkS,label:"V",fontSize:13}),e.jsxs("text",{x:"180",y:"330",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:s.ink,textAnchor:"middle",children:["softmax(QK",e.jsx("tspan",{fontSize:"9",baselineShift:"super",children:"⊤"})," / √d) V"]})]}),de=[["my-skill/",""],["├── SKILL.md","# Required: metadata + instructions"],["├── scripts/","# Optional: executable code"],["├── references/","# Optional: documentation"],["├── assets/","# Optional: templates, resources"],["└── ...","# Any additional files or directories"]],me=()=>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:s.faint,textAnchor:"middle",children:"Skill package layout"}),e.jsx("rect",{x:"28",y:"48",width:"304",height:"318",rx:"8",fill:"#FFFDF8",stroke:s.faint,strokeWidth:"1"}),de.map(([t,n],o)=>{const l=92+o*44;return e.jsxs("g",{children:[e.jsx("text",{x:"44",y:l,fontSize:"11",fontFamily:"var(--mono)",fill:s.ink,dominantBaseline:"middle",children:t}),n?e.jsx("text",{x:"138",y:l,fontSize:"8.5",fontFamily:"var(--mono)",fill:s.faint,dominantBaseline:"middle",children:n}):null]},t)})]}),he={attention:ce,"agent-skills":me},pe=({method:t})=>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:s.faint,textAnchor:"middle",children:t.name||"method"}),e.jsx(j,{x:80,y:70,w:200,h:50,fill:s.blue,stroke:s.blueS,label:"Input",fontSize:12}),e.jsx("path",{d:"M180 120 L180 150",stroke:s.ink}),e.jsx(j,{x:80,y:150,w:200,h:70,fill:s.orange,stroke:s.orangeS,label:t.name||"transform",fontSize:13}),e.jsx("path",{d:"M180 220 L180 250",stroke:s.ink}),e.jsx(j,{x:80,y:250,w:200,h:50,fill:s.purple,stroke:s.purpleS,label:"Output",fontSize:12})]}),ue=({method:t})=>{const n=(t.slug||"").toLowerCase(),o=he[n];if(o)return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(o,{})});if(t.image_url){const l=n==="transformer"||n==="gpt-4"||n==="gpt-4o"||n==="multi-head-attention"?" method-figure-svg--compact":n==="rpn"?" method-figure-svg--scaled-80":"";return e.jsx("div",{className:`method-figure-svg method-figure-svg--image${l}`,children:e.jsx("img",{className:"method-figure-img",src:t.image_url,alt:`${t.name} figure`})})}return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(pe,{method:t})})},D=720,B=138,x={top:8,right:10,bottom:25,left:36},K=56,xe=new Intl.DateTimeFormat("en",{month:"short",year:"2-digit",timeZone:"UTC"}),ge=new Intl.DateTimeFormat("en",{year:"numeric",timeZone:"UTC"}),E=t=>xe.format(new Date(`${t}T00:00:00Z`)),fe=(t,n)=>{if(t===0)return new Set;const o=t>48?12:t>36?6:t>18?3:2,l=Math.max(1,Math.ceil(K/n)),f=Math.max(o,l),g=t-1,u=new Set([0,g]);for(let c=f;c<g;c+=f)(g-c)*n>=K&&u.add(c);return u},Q=t=>{if(t.coverage_status===void 0||["complete","not_applicable"].includes(t.coverage_status))return null;const n=t.processed_paper_count!==void 0&&t.eligible_paper_count!==void 0?`; ${t.processed_paper_count.toLocaleString()} of ${t.eligible_paper_count.toLocaleString()} eligible papers processed`:"";return`Historical tagging ${t.coverage_status==="failed"?"needs retry":"in progress"}${n}`},je=({history:t,methodName:n})=>{const[o,l]=L.useState(null),f=Math.max(1,...t.map(i=>i.paper_count)),g=D-x.left-x.right,u=B-x.top-x.bottom,c=t.length?g/t.length:g,_=Math.max(2,c*.68),h=fe(t.length,c),P=Array.from(new Set([0,Math.ceil(f/2),f])),m=o==null?null:t[o],y=m?Q(m):null;return e.jsxs("div",{className:"method-usage-chart-wrap",children:[e.jsxs("svg",{className:"method-usage-chart",viewBox:`0 0 ${D} ${B}`,role:"group","aria-label":`${n}: papers mentioning this method by publication month`,children:[e.jsxs("title",{children:[n,": papers mentioning this method by publication month"]}),P.map(i=>{const p=x.top+u-i/f*u;return e.jsxs("g",{children:[e.jsx("line",{className:"method-usage-gridline",x1:x.left,x2:D-x.right,y1:p,y2:p}),e.jsx("text",{className:"method-usage-y-label",x:x.left-8,y:p+3,textAnchor:"end",children:i})]},i)}),t.map((i,p)=>{const v=i.paper_count/f*u,w=i.paper_count>0?Math.max(1,v):0,F=x.left+c*p+(c-_)/2,a=x.top+u-w,N=o===p,S=p===t.length-1,k=Q(i);return e.jsxs("g",{className:`method-usage-bar${N?" is-active":""}${S?" is-current":""}`,tabIndex:0,role:"img","aria-label":`${E(i.start_date)}: ${i.paper_count} ${i.paper_count===1?"paper":"papers"}${k?`. ${k}`:""}`,onMouseEnter:()=>l(p),onMouseLeave:()=>l(null),onFocus:()=>l(p),onBlur:()=>l(null),children:[e.jsx("rect",{className:"method-usage-bar-hit",x:x.left+c*p,y:x.top,width:c,height:u}),e.jsx("rect",{className:"method-usage-bar-mark",x:F,y:a,width:_,height:w,rx:"1.5"})]},i.start_date)}),t.map((i,p)=>h.has(p)?e.jsx("text",{className:"method-usage-x-label",x:x.left+c*(p+.5),y:B-11,textAnchor:"middle",children:t.length>48?ge.format(new Date(`${i.start_date}T00:00:00Z`)):E(i.start_date)},i.start_date):null)]}),m&&e.jsxs("div",{className:"method-usage-tooltip",role:"status",children:[e.jsx("strong",{children:E(m.start_date)}),e.jsxs("span",{children:[m.paper_count," ",m.paper_count===1?"paper":"papers",o===t.length-1?" · month to date":""]}),e.jsxs("span",{children:[(m.catalog_share??0).toFixed(2),"% of"," ",(m.catalog_paper_count??0).toLocaleString()," catalog papers"]}),y&&e.jsx("span",{children:y})]})]})},_e=[["trending","trending"],["new","newest"],["cited","most cited"]],U={"on-policy-distillation":["fine-tuning","post-training","rlvr","rlhf","direct-preference-optimization-dpo"],mcp:["agent-skills"],"agent-skills":["mcp"]},ze=()=>{var I,T,z,$,H,R;const{methodSlug:t}=W(),[n,o]=Z(),[l,f]=L.useState("trending"),g=n.get("has_code")==="true",u=n.get("has_hf_artifacts")==="true",c=r=>{const d=new URLSearchParams(n);r?d.set("has_code","true"):d.delete("has_code"),o(d)},_=r=>{const d=new URLSearchParams(n);r?d.set("has_hf_artifacts","true"):d.delete("has_hf_artifacts"),o(d)},h=M({queryKey:["method",t],queryFn:()=>b.getMethod(t),enabled:!!t,staleTime:10*60*1e3}),P=M({queryKey:["areas-all"],queryFn:()=>b.listAreas({page_size:50,ordering:"name"}),enabled:!!((I=h.data)!=null&&I.area_id),staleTime:10*60*1e3}),m=M({queryKey:["method-trend",t],queryFn:()=>b.methodTrend(t),enabled:!!t&&!!h.data,staleTime:10*60*1e3}),y=l==="trending"?"trending":l==="cited"?"citation_count":"date_published",i=X({queryKey:["method-papers-infinite",t,y,g,u],queryFn:({pageParam:r=1})=>ae.forMethod(t,{page:r,page_size:20,order_by:y,order_dir:"desc",include_resources:!0,has_code:g,has_hf_artifacts:u}),getNextPageParam:r=>r.next_page,initialPageParam:1,enabled:!!t,staleTime:5*60*1e3,placeholderData:V}),p=M({queryKey:["related-methods",(T=h.data)==null?void 0:T.slug,(z=h.data)==null?void 0:z.area_id,($=h.data)==null?void 0:$.id],queryFn:async()=>{const r=h.data;if(!r)return[];const d=r.slug?U[r.slug]:void 0;return d?Promise.all(d.map(G=>b.getMethod(G))):r.area_id?(await b.listMethods({area_id:r.area_id,exclude_id:r.id,ordering:"-paper_count",page_size:8})).results:[]},enabled:!!(h.data&&(h.data.slug&&U[h.data.slug]||h.data.area_id)),staleTime:10*60*1e3}),v=L.useMemo(()=>{var d;return(((d=i.data)==null?void 0:d.pages.flatMap(q=>q.results))||[]).map(ne)},[i.data]),{targetRef:w,isIntersecting:F}=ee({rootMargin:"200px"});if(L.useEffect(()=>{F&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[F,i.hasNextPage,i.isFetchingNextPage]),h.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(A,{className:"h-12 w-1/2 mb-4"}),e.jsx(A,{className:"h-64 w-full"})]});if(h.error||!h.data)return e.jsx("div",{className:"page",children:e.jsx(ie,{variant:"destructive",children:e.jsx(le,{children:"Method not found."})})});const a=h.data,N=(H=P.data)==null?void 0:H.results.find(r=>r.id===a.area_id),S=se(a.source_url),k=S?null:oe(a.source_url);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(C,{to:"/methods",children:"Methods"}),N&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(C,{to:`/methods#area-${re(N.name)}`,children:N.name})]}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:a.name})]}),e.jsxs("div",{className:`tag-hero method-hero-grid${a.slug==="grokking"||a.slug==="latent-reasoning"||a.slug==="world-action-models"?" 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:a.name}),a.full_name&&a.full_name!==a.name&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontSize:16,fontStyle:"italic",color:"var(--ink-soft)",marginTop:8},children:a.full_name}),a.description&&e.jsx(O,{className:"method-description",text:a.description}),a.source_url&&a.source_title&&e.jsxs("div",{className:"method-source",children:[e.jsx("span",{className:"method-source-label",children:"Source"}),S?e.jsxs(C,{className:"method-source-link",to:S,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]}):k?e.jsxs("a",{className:"method-source-link",href:k,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]}):e.jsxs("div",{className:"method-source-link is-static",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.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:(a.paper_count??0).toLocaleString()})]}),m.data&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Recent mentions"}),e.jsx("span",{className:"value",children:m.data.comparison_complete?e.jsxs(e.Fragment,{children:[m.data.trend_score.toFixed(1),e.jsx("small",{children:"/mo"})]}):"Pending"})]}),a.introduced_year!=null&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Introduced"}),e.jsx("span",{className:"value",children:a.introduced_year})]})]}),m.isLoading?e.jsx(A,{className:"h-36 w-full method-trend-skeleton"}):m.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:m.data.recent_paper_count}),e.jsxs("span",{children:["papers / ",m.data.recent_days,"d"]})]})]}),e.jsx(je,{history:m.data.history,methodName:a.name})]}):null]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(ue,{method:a}),a.image_credit&&e.jsx("figcaption",{children:e.jsx(O,{className:"method-image-credit",text:a.image_credit})})]})]}),(((R=p.data)==null?void 0:R.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),p.data.map(r=>e.jsx(Y,{method:{slug:r.slug,name:r.name}},r.id))]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:_e.map(([r,d])=>e.jsx("button",{className:`sort-btn ${l===r?"active":""}`,onClick:()=>f(r),children:d},r))}),e.jsx(te,{hasCode:g,hasHfArtifacts:u,onHasCodeChange:c,onHasHfArtifactsChange:_})]}),e.jsxs("div",{className:"results-count",children:[v.length," papers mentioning ",a.name]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((r,d)=>e.jsx(A,{className:"h-40 w-full"},d))}):v.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:v.map((r,d)=>e.jsx(J,{paper:r,rank:d+1},r.id))}),e.jsx("div",{ref:w,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{ze as default};
 
1
+ import{j as e,r as L,c as W,a as Z,L as C,af as V}from"./index-B5X8-Bq7.js";import{u as M}from"./useQuery-D05r-Fqo.js";import{u as X}from"./useInfiniteQuery-SpeFiDye.js";import{M as Y,P as J}from"./components-BYijBjrn.js";import{u as ee,P as te}from"./useIntersectionObserver-II0SG2xo.js";import{r as se,M as O}from"./MarkdownText-BGyyXIsO.js";import{c as b}from"./catalog-Cpdj6dI_.js";import{p as ae}from"./papers-D7y8njf2.js";import{s as re}from"./slug-BpH-Nkvz.js";import{t as ne}from"./transform-Ce1Ycrlu.js";import{S as A}from"./skeleton-Ck9ioJnz.js";import{A as ie,a as le}from"./alert-C4A_tmFK.js";import{s as oe}from"./safeExternalHref-CkBrsh84.js";import"./LatexTitle-BQ-aqYJn.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-Br9pyKgi.js";import"./index-LVXoOqbx.js";import"./hover-card-ClPcsbgj.js";const s={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"},j=({x:t,y:n,w:o,h:l,fill:f,stroke:g,label:u,fontSize:c=10,multiline:_})=>e.jsxs("g",{children:[e.jsx("rect",{x:t,y:n,width:o,height:l,rx:"3",ry:"3",fill:f,stroke:g,strokeWidth:"1"}),_?e.jsxs(e.Fragment,{children:[e.jsx("text",{x:t+o/2,y:n+l/2-2,fontSize:c,fontFamily:"var(--sans)",fill:s.ink,textAnchor:"middle",dominantBaseline:"middle",children:_[0]}),e.jsx("text",{x:t+o/2,y:n+l/2+c-1,fontSize:c,fontFamily:"var(--sans)",fill:s.ink,textAnchor:"middle",dominantBaseline:"middle",children:_[1]})]}):e.jsx("text",{x:t+o/2,y:n+l/2,fontSize:c,fontFamily:"var(--sans)",fill:s.ink,textAnchor:"middle",dominantBaseline:"middle",children:u})]}),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:s.faint,textAnchor:"middle",children:"Scaled Dot-Product Attention"}),e.jsx(j,{x:140,y:40,w:80,h:26,fill:s.yellow,stroke:s.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M180 66 L180 80",stroke:s.ink}),e.jsx(j,{x:140,y:80,w:80,h:26,fill:s.green,stroke:s.greenS,label:"SoftMax",fontSize:11}),e.jsx("path",{d:"M180 106 L180 120",stroke:s.ink}),e.jsx(j,{x:140,y:120,w:80,h:26,fill:s.purple,stroke:s.purpleS,label:"Mask (opt.)",fontSize:11}),e.jsx("path",{d:"M180 146 L180 160",stroke:s.ink}),e.jsx(j,{x:140,y:160,w:80,h:26,fill:s.blue,stroke:s.blueS,label:"Scale ÷√dₖ",fontSize:11}),e.jsx("path",{d:"M180 186 L180 200",stroke:s.ink}),e.jsx(j,{x:140,y:200,w:80,h:26,fill:s.yellow,stroke:s.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M156 226 L120 270",stroke:s.ink}),e.jsx("path",{d:"M180 226 L180 270",stroke:s.ink}),e.jsx("path",{d:"M204 226 L240 270",stroke:s.ink}),e.jsx(j,{x:100,y:270,w:40,h:24,fill:s.pink,stroke:s.pinkS,label:"Q",fontSize:13}),e.jsx(j,{x:160,y:270,w:40,h:24,fill:s.pink,stroke:s.pinkS,label:"K",fontSize:13}),e.jsx(j,{x:220,y:270,w:40,h:24,fill:s.pink,stroke:s.pinkS,label:"V",fontSize:13}),e.jsxs("text",{x:"180",y:"330",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:s.ink,textAnchor:"middle",children:["softmax(QK",e.jsx("tspan",{fontSize:"9",baselineShift:"super",children:"⊤"})," / √d) V"]})]}),de=[["my-skill/",""],["├── SKILL.md","# Required: metadata + instructions"],["├── scripts/","# Optional: executable code"],["├── references/","# Optional: documentation"],["├── assets/","# Optional: templates, resources"],["└── ...","# Any additional files or directories"]],me=()=>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:s.faint,textAnchor:"middle",children:"Skill package layout"}),e.jsx("rect",{x:"28",y:"48",width:"304",height:"318",rx:"8",fill:"#FFFDF8",stroke:s.faint,strokeWidth:"1"}),de.map(([t,n],o)=>{const l=92+o*44;return e.jsxs("g",{children:[e.jsx("text",{x:"44",y:l,fontSize:"11",fontFamily:"var(--mono)",fill:s.ink,dominantBaseline:"middle",children:t}),n?e.jsx("text",{x:"138",y:l,fontSize:"8.5",fontFamily:"var(--mono)",fill:s.faint,dominantBaseline:"middle",children:n}):null]},t)})]}),he={attention:ce,"agent-skills":me},pe=({method:t})=>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:s.faint,textAnchor:"middle",children:t.name||"method"}),e.jsx(j,{x:80,y:70,w:200,h:50,fill:s.blue,stroke:s.blueS,label:"Input",fontSize:12}),e.jsx("path",{d:"M180 120 L180 150",stroke:s.ink}),e.jsx(j,{x:80,y:150,w:200,h:70,fill:s.orange,stroke:s.orangeS,label:t.name||"transform",fontSize:13}),e.jsx("path",{d:"M180 220 L180 250",stroke:s.ink}),e.jsx(j,{x:80,y:250,w:200,h:50,fill:s.purple,stroke:s.purpleS,label:"Output",fontSize:12})]}),ue=({method:t})=>{const n=(t.slug||"").toLowerCase(),o=he[n];if(o)return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(o,{})});if(t.image_url){const l=n==="transformer"||n==="gpt-4"||n==="gpt-4o"||n==="multi-head-attention"?" method-figure-svg--compact":n==="rpn"?" method-figure-svg--scaled-80":"";return e.jsx("div",{className:`method-figure-svg method-figure-svg--image${l}`,children:e.jsx("img",{className:"method-figure-img",src:t.image_url,alt:`${t.name} figure`})})}return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(pe,{method:t})})},D=720,B=138,x={top:8,right:10,bottom:25,left:36},K=56,xe=new Intl.DateTimeFormat("en",{month:"short",year:"2-digit",timeZone:"UTC"}),ge=new Intl.DateTimeFormat("en",{year:"numeric",timeZone:"UTC"}),E=t=>xe.format(new Date(`${t}T00:00:00Z`)),fe=(t,n)=>{if(t===0)return new Set;const o=t>48?12:t>36?6:t>18?3:2,l=Math.max(1,Math.ceil(K/n)),f=Math.max(o,l),g=t-1,u=new Set([0,g]);for(let c=f;c<g;c+=f)(g-c)*n>=K&&u.add(c);return u},Q=t=>{if(t.coverage_status===void 0||["complete","not_applicable"].includes(t.coverage_status))return null;const n=t.processed_paper_count!==void 0&&t.eligible_paper_count!==void 0?`; ${t.processed_paper_count.toLocaleString()} of ${t.eligible_paper_count.toLocaleString()} eligible papers processed`:"";return`Historical tagging ${t.coverage_status==="failed"?"needs retry":"in progress"}${n}`},je=({history:t,methodName:n})=>{const[o,l]=L.useState(null),f=Math.max(1,...t.map(i=>i.paper_count)),g=D-x.left-x.right,u=B-x.top-x.bottom,c=t.length?g/t.length:g,_=Math.max(2,c*.68),h=fe(t.length,c),P=Array.from(new Set([0,Math.ceil(f/2),f])),m=o==null?null:t[o],y=m?Q(m):null;return e.jsxs("div",{className:"method-usage-chart-wrap",children:[e.jsxs("svg",{className:"method-usage-chart",viewBox:`0 0 ${D} ${B}`,role:"group","aria-label":`${n}: papers mentioning this method by publication month`,children:[e.jsxs("title",{children:[n,": papers mentioning this method by publication month"]}),P.map(i=>{const p=x.top+u-i/f*u;return e.jsxs("g",{children:[e.jsx("line",{className:"method-usage-gridline",x1:x.left,x2:D-x.right,y1:p,y2:p}),e.jsx("text",{className:"method-usage-y-label",x:x.left-8,y:p+3,textAnchor:"end",children:i})]},i)}),t.map((i,p)=>{const v=i.paper_count/f*u,w=i.paper_count>0?Math.max(1,v):0,F=x.left+c*p+(c-_)/2,a=x.top+u-w,N=o===p,S=p===t.length-1,k=Q(i);return e.jsxs("g",{className:`method-usage-bar${N?" is-active":""}${S?" is-current":""}`,tabIndex:0,role:"img","aria-label":`${E(i.start_date)}: ${i.paper_count} ${i.paper_count===1?"paper":"papers"}${k?`. ${k}`:""}`,onMouseEnter:()=>l(p),onMouseLeave:()=>l(null),onFocus:()=>l(p),onBlur:()=>l(null),children:[e.jsx("rect",{className:"method-usage-bar-hit",x:x.left+c*p,y:x.top,width:c,height:u}),e.jsx("rect",{className:"method-usage-bar-mark",x:F,y:a,width:_,height:w,rx:"1.5"})]},i.start_date)}),t.map((i,p)=>h.has(p)?e.jsx("text",{className:"method-usage-x-label",x:x.left+c*(p+.5),y:B-11,textAnchor:"middle",children:t.length>48?ge.format(new Date(`${i.start_date}T00:00:00Z`)):E(i.start_date)},i.start_date):null)]}),m&&e.jsxs("div",{className:"method-usage-tooltip",role:"status",children:[e.jsx("strong",{children:E(m.start_date)}),e.jsxs("span",{children:[m.paper_count," ",m.paper_count===1?"paper":"papers",o===t.length-1?" · month to date":""]}),e.jsxs("span",{children:[(m.catalog_share??0).toFixed(2),"% of"," ",(m.catalog_paper_count??0).toLocaleString()," catalog papers"]}),y&&e.jsx("span",{children:y})]})]})},_e=[["trending","trending"],["new","newest"],["cited","most cited"]],U={"on-policy-distillation":["fine-tuning","post-training","rlvr","rlhf","direct-preference-optimization-dpo"],mcp:["agent-skills"],"agent-skills":["mcp"]},ze=()=>{var I,T,z,$,H,R;const{methodSlug:t}=W(),[n,o]=Z(),[l,f]=L.useState("trending"),g=n.get("has_code")==="true",u=n.get("has_hf_artifacts")==="true",c=r=>{const d=new URLSearchParams(n);r?d.set("has_code","true"):d.delete("has_code"),o(d)},_=r=>{const d=new URLSearchParams(n);r?d.set("has_hf_artifacts","true"):d.delete("has_hf_artifacts"),o(d)},h=M({queryKey:["method",t],queryFn:()=>b.getMethod(t),enabled:!!t,staleTime:10*60*1e3}),P=M({queryKey:["areas-all"],queryFn:()=>b.listAreas({page_size:50,ordering:"name"}),enabled:!!((I=h.data)!=null&&I.area_id),staleTime:10*60*1e3}),m=M({queryKey:["method-trend",t],queryFn:()=>b.methodTrend(t),enabled:!!t&&!!h.data,staleTime:10*60*1e3}),y=l==="trending"?"trending":l==="cited"?"citation_count":"date_published",i=X({queryKey:["method-papers-infinite",t,y,g,u],queryFn:({pageParam:r=1})=>ae.forMethod(t,{page:r,page_size:20,order_by:y,order_dir:"desc",include_resources:!0,has_code:g,has_hf_artifacts:u}),getNextPageParam:r=>r.next_page,initialPageParam:1,enabled:!!t,staleTime:5*60*1e3,placeholderData:V}),p=M({queryKey:["related-methods",(T=h.data)==null?void 0:T.slug,(z=h.data)==null?void 0:z.area_id,($=h.data)==null?void 0:$.id],queryFn:async()=>{const r=h.data;if(!r)return[];const d=r.slug?U[r.slug]:void 0;return d?Promise.all(d.map(G=>b.getMethod(G))):r.area_id?(await b.listMethods({area_id:r.area_id,exclude_id:r.id,ordering:"-paper_count",page_size:8})).results:[]},enabled:!!(h.data&&(h.data.slug&&U[h.data.slug]||h.data.area_id)),staleTime:10*60*1e3}),v=L.useMemo(()=>{var d;return(((d=i.data)==null?void 0:d.pages.flatMap(q=>q.results))||[]).map(ne)},[i.data]),{targetRef:w,isIntersecting:F}=ee({rootMargin:"200px"});if(L.useEffect(()=>{F&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[F,i.hasNextPage,i.isFetchingNextPage]),h.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(A,{className:"h-12 w-1/2 mb-4"}),e.jsx(A,{className:"h-64 w-full"})]});if(h.error||!h.data)return e.jsx("div",{className:"page",children:e.jsx(ie,{variant:"destructive",children:e.jsx(le,{children:"Method not found."})})});const a=h.data,N=(H=P.data)==null?void 0:H.results.find(r=>r.id===a.area_id),S=se(a.source_url),k=S?null:oe(a.source_url);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(C,{to:"/methods",children:"Methods"}),N&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(C,{to:`/methods#area-${re(N.name)}`,children:N.name})]}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:a.name})]}),e.jsxs("div",{className:`tag-hero method-hero-grid${a.slug==="grokking"||a.slug==="latent-reasoning"||a.slug==="world-action-models"?" 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:a.name}),a.full_name&&a.full_name!==a.name&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontSize:16,fontStyle:"italic",color:"var(--ink-soft)",marginTop:8},children:a.full_name}),a.description&&e.jsx(O,{className:"method-description",text:a.description}),a.source_url&&a.source_title&&e.jsxs("div",{className:"method-source",children:[e.jsx("span",{className:"method-source-label",children:"Source"}),S?e.jsxs(C,{className:"method-source-link",to:S,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]}):k?e.jsxs("a",{className:"method-source-link",href:k,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]}):e.jsxs("div",{className:"method-source-link is-static",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.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:(a.paper_count??0).toLocaleString()})]}),m.data&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Recent mentions"}),e.jsx("span",{className:"value",children:m.data.comparison_complete?e.jsxs(e.Fragment,{children:[m.data.trend_score.toFixed(1),e.jsx("small",{children:"/mo"})]}):"Pending"})]}),a.introduced_year!=null&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Introduced"}),e.jsx("span",{className:"value",children:a.introduced_year})]})]}),m.isLoading?e.jsx(A,{className:"h-36 w-full method-trend-skeleton"}):m.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:m.data.recent_paper_count}),e.jsxs("span",{children:["papers / ",m.data.recent_days,"d"]})]})]}),e.jsx(je,{history:m.data.history,methodName:a.name})]}):null]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(ue,{method:a}),a.image_credit&&e.jsx("figcaption",{children:e.jsx(O,{className:"method-image-credit",text:a.image_credit})})]})]}),(((R=p.data)==null?void 0:R.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),p.data.map(r=>e.jsx(Y,{method:{slug:r.slug,name:r.name}},r.id))]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:_e.map(([r,d])=>e.jsx("button",{className:`sort-btn ${l===r?"active":""}`,onClick:()=>f(r),children:d},r))}),e.jsx(te,{hasCode:g,hasHfArtifacts:u,onHasCodeChange:c,onHasHfArtifactsChange:_})]}),e.jsxs("div",{className:"results-count",children:[v.length," papers mentioning ",a.name]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((r,d)=>e.jsx(A,{className:"h-40 w-full"},d))}):v.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:v.map((r,d)=>e.jsx(J,{paper:r,rank:d+1},r.id))}),e.jsx("div",{ref:w,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{ze as default};
assets/{MethodsIndexView-0GFbWqq-.js → MethodsIndexView-B6Ol3X40.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{d as g,r as d,j as e,L as f}from"./index-DpqMFKEJ.js";import{u as m}from"./useQuery-BRJ3D8WJ.js";import{c as h}from"./catalog-CNSpmU4d.js";import{s as j}from"./slug-BpH-Nkvz.js";import{S as p}from"./skeleton-BmlKdebV.js";import{A as y,a as v}from"./alert-C5eNYVhH.js";import{T as _}from"./TaxonomySuggestionTile-B4j9rE3C.js";import"./SignInToEditDialog-_xlmZxOT.js";import"./button-CpZL29fe.js";import"./textarea-BA4c3aP6.js";import"./dialog-DW3Uw8Zv.js";import"./useMutation-BFwg1MYO.js";import"./submissions-B8Kj7oPp.js";import"./loader-circle-CEEZZR71.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{d as g,r as d,j as e,L as f}from"./index-B5X8-Bq7.js";import{u as m}from"./useQuery-D05r-Fqo.js";import{c as h}from"./catalog-Cpdj6dI_.js";import{s as j}from"./slug-BpH-Nkvz.js";import{S as p}from"./skeleton-Ck9ioJnz.js";import{A as y,a as v}from"./alert-C4A_tmFK.js";import{T as _}from"./TaxonomySuggestionTile-DlEFIt6g.js";import"./SignInToEditDialog-C_4kkM3M.js";import"./button-cqkU__aM.js";import"./textarea-Bw7gV3w2.js";import"./dialog-DQCWceSF.js";import"./useMutation-jhc4sxTL.js";import"./submissions-CUbxi_j0.js";import"./loader-circle-QH8Jsx5e.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{NotFound-C4Ku0WP3.js → NotFound-BqqYiveq.js} RENAMED
@@ -1 +1 @@
1
- import{ay as o,r as a,j as t,L as s}from"./index-DpqMFKEJ.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{ay as o,r as a,j as t,L as s}from"./index-B5X8-Bq7.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/{OrganizationContributionGraph-rCVWThLe.js → OrganizationContributionGraph-D2Q82lUu.js} RENAMED
@@ -1 +1 @@
1
- import{r as b,j as o}from"./index-DpqMFKEJ.js";import{u as z}from"./useQuery-BRJ3D8WJ.js";import{S as T}from"./skeleton-BmlKdebV.js";import{c as w}from"./catalog-CNSpmU4d.js";const x=24*60*60*1e3,f=12,y=3,v=new Map([[1,"Mon"],[3,"Wed"],[5,"Fri"]]),$=n=>new Date(`${n}T00:00:00Z`),N=n=>n.toISOString().slice(0,10),_=(n,r)=>{if(n===0)return 0;const i=r.findIndex(s=>n<=s);return i===-1?4:i+1},D=n=>{const r=$(n.start_date),i=$(n.end_date),s=new Date(r.getTime()-r.getUTCDay()*x),h=new Date(i.getTime()+(6-i.getUTCDay())*x),p=new Map(n.results.map(e=>[e.date,e.paper_count])),u=n.results.map(e=>e.paper_count).sort((e,m)=>e-m),c=[.25,.5,.75].map(e=>u[Math.min(u.length-1,Math.floor(u.length*e))]??1),l=[];for(let e=s.getTime();e<=h.getTime();e+=x){const m=new Date(e),d=N(m),g=e>=r.getTime()&&e<=i.getTime(),C=g?p.get(d)??0:0;l.push({key:d,date:m,count:C,inRange:g,level:_(C,c)})}const t=l.length/7,a=[];let j=-1;for(let e=0;e<t;e+=1){const d=l.slice(e*7,e*7+7).find(g=>g.inRange&&(e===0||g.date.getUTCDate()<=7));d&&d.date.getUTCMonth()!==j&&(j=d.date.getUTCMonth(),a.length>0&&e-a[a.length-1].column<3&&a.pop(),a.push({label:d.date.toLocaleString("en",{month:"short",timeZone:"UTC"}),column:e}))}return{days:l,months:a,weekCount:t}},L=({data:n,organizationName:r,title:i="Paper contributions",noun:s="paper"})=>{const h=b.useRef(null),{days:p,months:u,weekCount:c}=b.useMemo(()=>D(n),[n]),l=c*f+(c-1)*y;return b.useEffect(()=>{const t=h.current;t&&(t.scrollLeft=t.scrollWidth)},[c]),o.jsxs("section",{className:"organization-contributions","aria-labelledby":"organization-contributions-title",children:[o.jsxs("div",{className:"organization-contributions-header",children:[o.jsx("h2",{id:"organization-contributions-title",className:"organization-contributions-title",children:i}),o.jsxs("p",{className:"organization-contributions-summary",children:[n.total_count.toLocaleString()," ",n.total_count===1?s:`${s}s`," recorded in the last year"]})]}),o.jsx("div",{className:"organization-contributions-scroll",ref:h,children:o.jsxs("div",{className:"organization-contributions-plot",style:{width:l+34},role:"img","aria-label":`${r} recorded ${n.total_count} ${n.total_count===1?s:`${s}s`} in the last year`,children:[o.jsx("div",{className:"organization-contributions-weekdays","aria-hidden":"true",children:Array.from({length:7}).map((t,a)=>o.jsx("span",{children:v.get(a)??""},a))}),o.jsxs("div",{children:[o.jsx("div",{className:"organization-contributions-months",style:{width:l,gridTemplateColumns:`repeat(${c}, ${f}px)`},"aria-hidden":"true",children:u.map(t=>o.jsx("span",{style:{gridColumnStart:t.column+1},children:t.label},`${t.label}-${t.column}`))}),o.jsx("div",{className:"organization-contributions-grid",style:{width:l,gridTemplateColumns:`repeat(${c}, ${f}px)`},"aria-hidden":"true",children:p.map(t=>o.jsx("span",{className:`organization-contribution-cell ${t.inRange?`level-${t.level}`:"is-outside"}`,title:t.inRange?`${t.count} ${t.count===1?s:`${s}s`} on ${t.date.toLocaleDateString("en",{dateStyle:"long",timeZone:"UTC"})}`:void 0},t.key))})]})]})}),o.jsxs("div",{className:"organization-contributions-legend","aria-hidden":"true",children:[o.jsx("span",{children:"Fewer"}),[0,1,2,3,4].map(t=>o.jsx("span",{className:`organization-contribution-cell level-${t}`},t)),o.jsx("span",{children:"More"})]})]})},A=({organizationSlug:n,organizationName:r})=>{const i=z({queryKey:["organization-contributions",n],queryFn:()=>w.organizationContributions(n),staleTime:6e5});return i.isLoading?o.jsx(T,{className:"organization-contributions-skeleton"}):i.data?o.jsx(L,{data:i.data,organizationName:r}):null};export{L as C,A as O};
 
1
+ import{r as b,j as o}from"./index-B5X8-Bq7.js";import{u as z}from"./useQuery-D05r-Fqo.js";import{S as T}from"./skeleton-Ck9ioJnz.js";import{c as w}from"./catalog-Cpdj6dI_.js";const x=24*60*60*1e3,f=12,y=3,v=new Map([[1,"Mon"],[3,"Wed"],[5,"Fri"]]),$=n=>new Date(`${n}T00:00:00Z`),N=n=>n.toISOString().slice(0,10),_=(n,r)=>{if(n===0)return 0;const i=r.findIndex(s=>n<=s);return i===-1?4:i+1},D=n=>{const r=$(n.start_date),i=$(n.end_date),s=new Date(r.getTime()-r.getUTCDay()*x),h=new Date(i.getTime()+(6-i.getUTCDay())*x),p=new Map(n.results.map(e=>[e.date,e.paper_count])),u=n.results.map(e=>e.paper_count).sort((e,m)=>e-m),c=[.25,.5,.75].map(e=>u[Math.min(u.length-1,Math.floor(u.length*e))]??1),l=[];for(let e=s.getTime();e<=h.getTime();e+=x){const m=new Date(e),d=N(m),g=e>=r.getTime()&&e<=i.getTime(),C=g?p.get(d)??0:0;l.push({key:d,date:m,count:C,inRange:g,level:_(C,c)})}const t=l.length/7,a=[];let j=-1;for(let e=0;e<t;e+=1){const d=l.slice(e*7,e*7+7).find(g=>g.inRange&&(e===0||g.date.getUTCDate()<=7));d&&d.date.getUTCMonth()!==j&&(j=d.date.getUTCMonth(),a.length>0&&e-a[a.length-1].column<3&&a.pop(),a.push({label:d.date.toLocaleString("en",{month:"short",timeZone:"UTC"}),column:e}))}return{days:l,months:a,weekCount:t}},L=({data:n,organizationName:r,title:i="Paper contributions",noun:s="paper"})=>{const h=b.useRef(null),{days:p,months:u,weekCount:c}=b.useMemo(()=>D(n),[n]),l=c*f+(c-1)*y;return b.useEffect(()=>{const t=h.current;t&&(t.scrollLeft=t.scrollWidth)},[c]),o.jsxs("section",{className:"organization-contributions","aria-labelledby":"organization-contributions-title",children:[o.jsxs("div",{className:"organization-contributions-header",children:[o.jsx("h2",{id:"organization-contributions-title",className:"organization-contributions-title",children:i}),o.jsxs("p",{className:"organization-contributions-summary",children:[n.total_count.toLocaleString()," ",n.total_count===1?s:`${s}s`," recorded in the last year"]})]}),o.jsx("div",{className:"organization-contributions-scroll",ref:h,children:o.jsxs("div",{className:"organization-contributions-plot",style:{width:l+34},role:"img","aria-label":`${r} recorded ${n.total_count} ${n.total_count===1?s:`${s}s`} in the last year`,children:[o.jsx("div",{className:"organization-contributions-weekdays","aria-hidden":"true",children:Array.from({length:7}).map((t,a)=>o.jsx("span",{children:v.get(a)??""},a))}),o.jsxs("div",{children:[o.jsx("div",{className:"organization-contributions-months",style:{width:l,gridTemplateColumns:`repeat(${c}, ${f}px)`},"aria-hidden":"true",children:u.map(t=>o.jsx("span",{style:{gridColumnStart:t.column+1},children:t.label},`${t.label}-${t.column}`))}),o.jsx("div",{className:"organization-contributions-grid",style:{width:l,gridTemplateColumns:`repeat(${c}, ${f}px)`},"aria-hidden":"true",children:p.map(t=>o.jsx("span",{className:`organization-contribution-cell ${t.inRange?`level-${t.level}`:"is-outside"}`,title:t.inRange?`${t.count} ${t.count===1?s:`${s}s`} on ${t.date.toLocaleDateString("en",{dateStyle:"long",timeZone:"UTC"})}`:void 0},t.key))})]})]})}),o.jsxs("div",{className:"organization-contributions-legend","aria-hidden":"true",children:[o.jsx("span",{children:"Fewer"}),[0,1,2,3,4].map(t=>o.jsx("span",{className:`organization-contribution-cell level-${t}`},t)),o.jsx("span",{children:"More"})]})]})},A=({organizationSlug:n,organizationName:r})=>{const i=z({queryKey:["organization-contributions",n],queryFn:()=>w.organizationContributions(n),staleTime:6e5});return i.isLoading?o.jsx(T,{className:"organization-contributions-skeleton"}):i.data?o.jsx(L,{data:i.data,organizationName:r}):null};export{L as C,A as O};
assets/OrganizationDetailView-BAjEuyHS.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{c as t,j as r}from"./index-B5X8-Bq7.js";import{O as i}from"./OrganizationPaperFeed-Btj_88cl.js";import m from"./NotFound-BqqYiveq.js";import"./useQuery-D05r-Fqo.js";import"./components-BYijBjrn.js";import"./LatexTitle-BQ-aqYJn.js";import"./katex.min-BSBacQyE.js";import"./transform-Ce1Ycrlu.js";import"./papers-D7y8njf2.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-BGyyXIsO.js";import"./PaperPreviewLink-Br9pyKgi.js";import"./index-LVXoOqbx.js";import"./hover-card-ClPcsbgj.js";import"./OrganizationContributionGraph-D2Q82lUu.js";import"./skeleton-Ck9ioJnz.js";import"./catalog-Cpdj6dI_.js";import"./useIntersectionObserver-II0SG2xo.js";import"./alert-C4A_tmFK.js";import"./searchable-select-DM_tXLIJ.js";import"./button-cqkU__aM.js";import"./dialog-DQCWceSF.js";import"./loader-circle-QH8Jsx5e.js";import"./usePapers-CCbDROh4.js";import"./useInfiniteQuery-SpeFiDye.js";const h=()=>{const{orgSlug:o}=t();return o?r.jsx(i,{organizationSlug:o}):r.jsx(m,{})};export{h as default};
assets/OrganizationDetailView-C_iDFbtK.js DELETED
@@ -1 +0,0 @@
1
- import{c as t,j as r}from"./index-DpqMFKEJ.js";import{O as i}from"./OrganizationPaperFeed-D8JytOGR.js";import m from"./NotFound-C4Ku0WP3.js";import"./useQuery-BRJ3D8WJ.js";import"./components-D8W6Owmv.js";import"./LatexTitle-j9Bx8wiP.js";import"./katex.min-BSBacQyE.js";import"./transform-BG6M6eP3.js";import"./papers-inj3gJs3.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-fqFB7jpa.js";import"./PaperPreviewLink-Da7TZ3ij.js";import"./index-DYz3ynl3.js";import"./hover-card-K79gJfh7.js";import"./OrganizationContributionGraph-rCVWThLe.js";import"./skeleton-BmlKdebV.js";import"./catalog-CNSpmU4d.js";import"./useIntersectionObserver-CXj-qZiT.js";import"./alert-C5eNYVhH.js";import"./searchable-select-BXitSfpv.js";import"./button-CpZL29fe.js";import"./dialog-DW3Uw8Zv.js";import"./loader-circle-CEEZZR71.js";import"./usePapers-BLL7LMPj.js";import"./useInfiniteQuery-ud8-aqIx.js";const h=()=>{const{orgSlug:o}=t();return o?r.jsx(i,{organizationSlug:o}):r.jsx(m,{})};export{h as default};
 
 
assets/{OrganizationPaperFeed-D8JytOGR.js → OrganizationPaperFeed-Btj_88cl.js} RENAMED
@@ -1 +1 @@
1
- import{u as E,a as Q,r as d,j as e,L as w}from"./index-DpqMFKEJ.js";import{u as A}from"./useQuery-BRJ3D8WJ.js";import{P as U}from"./components-D8W6Owmv.js";import{M as B}from"./MarkdownText-fqFB7jpa.js";import{O as G}from"./OrganizationContributionGraph-rCVWThLe.js";import{u as K,P as W}from"./useIntersectionObserver-CXj-qZiT.js";import{A as D,a as Z}from"./alert-C5eNYVhH.js";import{S as z}from"./searchable-select-BXitSfpv.js";import{S as C}from"./skeleton-BmlKdebV.js";import{d as J}from"./usePapers-BLL7LMPj.js";import{c as $}from"./catalog-CNSpmU4d.js";import{d as T,t as V}from"./transform-BG6M6eP3.js";import X from"./NotFound-C4Ku0WP3.js";const Y=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ee=n=>n==="date_published"||n==="citation_count"?n:"trending",ue=({organizationSlug:n,taskSlug:p})=>{var N,y,v,P,L,F,k,O;const I=E(),[l,h]=Q(),[M,m]=d.useState(!1),u=ee(l.get("order_by")),g=l.get("has_code")==="true",f=l.get("has_hf_artifacts")==="true",_=A({queryKey:["organization",n],queryFn:()=>$.getOrganization(n),staleTime:10*60*1e3}),c=A({queryKey:["organization-areas-with-tasks",n],queryFn:()=>$.organizationAreasWithTasks(n),staleTime:10*60*1e3}),i=J({organizationSlug:n,taskSlug:p,page_size:12,order_by:u,order_dir:"desc",include_resources:!0,has_code:g,has_hf_artifacts:f,enabled:!!n}),{targetRef:H,isIntersecting:x}=K({rootMargin:"200px"});d.useEffect(()=>{x&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[x,i.hasNextPage,i.isFetchingNextPage]),d.useEffect(()=>{m(!1)},[n,p]);const j=d.useMemo(()=>{var a;return(((a=c.data)==null?void 0:a.results)??[]).flatMap(r=>r.tasks.filter(t=>!!t.slug).map(t=>({...t,slug:t.slug,label:T(t.name,t.slug)})))},[c.data]),o=j.find(a=>a.slug===p),b=d.useMemo(()=>{var a;return(((a=i.data)==null?void 0:a.pages)??[]).flatMap(r=>r.results.map(V))},[i.data]),s=_.data??((N=c.data)==null?void 0:N.organization),R=((v=(y=i.data)==null?void 0:y.pages[0])==null?void 0:v.count)??0;if(((P=_.error)==null?void 0:P.status)===404||((L=c.error)==null?void 0:L.status)===404||((F=i.error)==null?void 0:F.status)===404)return e.jsx(X,{});if(c.error||i.error)return e.jsx("div",{className:"page",children:e.jsx(D,{variant:"destructive",children:e.jsx(Z,{children:"Failed to load organization papers. Please try again."})})});const S=a=>{const r=a.trim().toLocaleLowerCase();return j.filter(t=>`${t.label} ${t.slug}`.toLocaleLowerCase().includes(r)).map(t=>({value:t.slug,label:t.label,description:`${t.paper_count.toLocaleString()} ${t.paper_count===1?"paper":"papers"}`}))},q=a=>{const r=a==="__all__"?`/orgs/${n}`:`/orgs/${n}/${a}`,t=l.toString();I({pathname:r,search:t?`?${t}`:""})};return e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(w,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(w,{to:"/organizations",children:"Organizations"}),e.jsx("span",{children:" / "}),e.jsx("span",{children:(s==null?void 0:s.name)??n}),o&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:" / "}),e.jsx("span",{children:T(o.name,o.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:[s!=null&&s.logo_url&&!M?e.jsx("img",{src:s.logo_url,alt:"",width:58,height:58,onError:()=>m(!0)}):s?e.jsx("span",{className:"organization-logo organization-logo--fallback","aria-hidden":"true",children:s.name.slice(0,1).toUpperCase()}):null,(s==null?void 0:s.name)??e.jsx(C,{className:"h-12 w-64"})]}),s&&e.jsxs("div",{className:"feed-subtitle",children:[((k=s.paper_count)==null?void 0:k.toLocaleString())??0," papers",(s.organization_trending_score??0)>0&&s.trending_rank&&e.jsxs(e.Fragment,{children:[" · #",s.trending_rank," trending this month"]})]}),(s==null?void 0:s.description)&&e.jsx(B,{className:"method-description",text:s.description}),s&&e.jsxs("div",{className:"organization-hero-links",children:[s.website_url&&e.jsx("a",{href:s.website_url,target:"_blank",rel:"noreferrer",children:"Website ↗"}),s.hf_url&&e.jsx("a",{href:s.hf_url,target:"_blank",rel:"noreferrer",children:"Hugging Face ↗"}),s.github_url&&e.jsx("a",{href:s.github_url,target:"_blank",rel:"noreferrer",children:"GitHub ↗"})]})]}),s&&e.jsx(G,{organizationSlug:n,organizationName:s.name})]}),e.jsxs("div",{className:"sort-bar",style:{alignItems:"center",gap:16},children:[e.jsx("div",{style:{minWidth:260},children:e.jsx(z,{value:p??"__all__",onChange:q,placeholder:"All tasks",searchPlaceholder:"Search organization tasks...",emptyMessage:"No matching tasks.",ariaLabel:"Filter papers by task",selectedOption:o?{value:o.slug,label:o.label,description:`${o.paper_count.toLocaleString()} ${o.paper_count===1?"paper":"papers"}`}:{value:"__all__",label:"All tasks",description:`${((O=s==null?void 0:s.paper_count)==null?void 0:O.toLocaleString())??0} papers`},queryKey:["organization-task-options",n],queryFn:async a=>{var r;return[{value:"__all__",label:"All tasks",description:`${((r=s==null?void 0:s.paper_count)==null?void 0:r.toLocaleString())??0} papers`},...S(a)]},enabled:!c.isLoading,className:"h-[38px]"})}),e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:Y.map(([a,r])=>e.jsx("button",{type:"button",className:`sort-btn ${u===a?"active":""}`,onClick:()=>{const t=new URLSearchParams(l);a==="trending"?t.delete("order_by"):t.set("order_by",a),h(t)},children:r},a))}),e.jsx(W,{hasCode:g,hasHfArtifacts:f,onHasCodeChange:a=>{const r=new URLSearchParams(l);a?r.set("has_code","true"):r.delete("has_code"),h(r)},onHasHfArtifactsChange:a=>{const r=new URLSearchParams(l);a?r.set("has_hf_artifacts","true"):r.delete("has_hf_artifacts"),h(r)}})]}),e.jsxs("div",{className:"results-count",children:[R.toLocaleString()," papers"]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((a,r)=>e.jsx(C,{className:"h-40 w-full"},r))}):b.length===0?e.jsx("div",{className:"no-results",children:(s==null?void 0:s.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:b.map((a,r)=>e.jsx(U,{paper:a,rank:r+1,showInstitution:!1},a.id))}),e.jsx("div",{ref:H,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center"},children:"Loading more…"})]})]})};export{ue as O};
 
1
+ import{u as E,a as Q,r as d,j as e,L as w}from"./index-B5X8-Bq7.js";import{u as A}from"./useQuery-D05r-Fqo.js";import{P as U}from"./components-BYijBjrn.js";import{M as B}from"./MarkdownText-BGyyXIsO.js";import{O as G}from"./OrganizationContributionGraph-D2Q82lUu.js";import{u as K,P as W}from"./useIntersectionObserver-II0SG2xo.js";import{A as D,a as Z}from"./alert-C4A_tmFK.js";import{S as z}from"./searchable-select-DM_tXLIJ.js";import{S as C}from"./skeleton-Ck9ioJnz.js";import{d as J}from"./usePapers-CCbDROh4.js";import{c as $}from"./catalog-Cpdj6dI_.js";import{d as T,t as V}from"./transform-Ce1Ycrlu.js";import X from"./NotFound-BqqYiveq.js";const Y=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ee=n=>n==="date_published"||n==="citation_count"?n:"trending",ue=({organizationSlug:n,taskSlug:p})=>{var N,y,v,P,L,F,k,O;const I=E(),[l,h]=Q(),[M,m]=d.useState(!1),u=ee(l.get("order_by")),g=l.get("has_code")==="true",f=l.get("has_hf_artifacts")==="true",_=A({queryKey:["organization",n],queryFn:()=>$.getOrganization(n),staleTime:10*60*1e3}),c=A({queryKey:["organization-areas-with-tasks",n],queryFn:()=>$.organizationAreasWithTasks(n),staleTime:10*60*1e3}),i=J({organizationSlug:n,taskSlug:p,page_size:12,order_by:u,order_dir:"desc",include_resources:!0,has_code:g,has_hf_artifacts:f,enabled:!!n}),{targetRef:H,isIntersecting:x}=K({rootMargin:"200px"});d.useEffect(()=>{x&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[x,i.hasNextPage,i.isFetchingNextPage]),d.useEffect(()=>{m(!1)},[n,p]);const j=d.useMemo(()=>{var a;return(((a=c.data)==null?void 0:a.results)??[]).flatMap(r=>r.tasks.filter(t=>!!t.slug).map(t=>({...t,slug:t.slug,label:T(t.name,t.slug)})))},[c.data]),o=j.find(a=>a.slug===p),b=d.useMemo(()=>{var a;return(((a=i.data)==null?void 0:a.pages)??[]).flatMap(r=>r.results.map(V))},[i.data]),s=_.data??((N=c.data)==null?void 0:N.organization),R=((v=(y=i.data)==null?void 0:y.pages[0])==null?void 0:v.count)??0;if(((P=_.error)==null?void 0:P.status)===404||((L=c.error)==null?void 0:L.status)===404||((F=i.error)==null?void 0:F.status)===404)return e.jsx(X,{});if(c.error||i.error)return e.jsx("div",{className:"page",children:e.jsx(D,{variant:"destructive",children:e.jsx(Z,{children:"Failed to load organization papers. Please try again."})})});const S=a=>{const r=a.trim().toLocaleLowerCase();return j.filter(t=>`${t.label} ${t.slug}`.toLocaleLowerCase().includes(r)).map(t=>({value:t.slug,label:t.label,description:`${t.paper_count.toLocaleString()} ${t.paper_count===1?"paper":"papers"}`}))},q=a=>{const r=a==="__all__"?`/orgs/${n}`:`/orgs/${n}/${a}`,t=l.toString();I({pathname:r,search:t?`?${t}`:""})};return e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(w,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(w,{to:"/organizations",children:"Organizations"}),e.jsx("span",{children:" / "}),e.jsx("span",{children:(s==null?void 0:s.name)??n}),o&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:" / "}),e.jsx("span",{children:T(o.name,o.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:[s!=null&&s.logo_url&&!M?e.jsx("img",{src:s.logo_url,alt:"",width:58,height:58,onError:()=>m(!0)}):s?e.jsx("span",{className:"organization-logo organization-logo--fallback","aria-hidden":"true",children:s.name.slice(0,1).toUpperCase()}):null,(s==null?void 0:s.name)??e.jsx(C,{className:"h-12 w-64"})]}),s&&e.jsxs("div",{className:"feed-subtitle",children:[((k=s.paper_count)==null?void 0:k.toLocaleString())??0," papers",(s.organization_trending_score??0)>0&&s.trending_rank&&e.jsxs(e.Fragment,{children:[" · #",s.trending_rank," trending this month"]})]}),(s==null?void 0:s.description)&&e.jsx(B,{className:"method-description",text:s.description}),s&&e.jsxs("div",{className:"organization-hero-links",children:[s.website_url&&e.jsx("a",{href:s.website_url,target:"_blank",rel:"noreferrer",children:"Website ↗"}),s.hf_url&&e.jsx("a",{href:s.hf_url,target:"_blank",rel:"noreferrer",children:"Hugging Face ↗"}),s.github_url&&e.jsx("a",{href:s.github_url,target:"_blank",rel:"noreferrer",children:"GitHub ↗"})]})]}),s&&e.jsx(G,{organizationSlug:n,organizationName:s.name})]}),e.jsxs("div",{className:"sort-bar",style:{alignItems:"center",gap:16},children:[e.jsx("div",{style:{minWidth:260},children:e.jsx(z,{value:p??"__all__",onChange:q,placeholder:"All tasks",searchPlaceholder:"Search organization tasks...",emptyMessage:"No matching tasks.",ariaLabel:"Filter papers by task",selectedOption:o?{value:o.slug,label:o.label,description:`${o.paper_count.toLocaleString()} ${o.paper_count===1?"paper":"papers"}`}:{value:"__all__",label:"All tasks",description:`${((O=s==null?void 0:s.paper_count)==null?void 0:O.toLocaleString())??0} papers`},queryKey:["organization-task-options",n],queryFn:async a=>{var r;return[{value:"__all__",label:"All tasks",description:`${((r=s==null?void 0:s.paper_count)==null?void 0:r.toLocaleString())??0} papers`},...S(a)]},enabled:!c.isLoading,className:"h-[38px]"})}),e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:Y.map(([a,r])=>e.jsx("button",{type:"button",className:`sort-btn ${u===a?"active":""}`,onClick:()=>{const t=new URLSearchParams(l);a==="trending"?t.delete("order_by"):t.set("order_by",a),h(t)},children:r},a))}),e.jsx(W,{hasCode:g,hasHfArtifacts:f,onHasCodeChange:a=>{const r=new URLSearchParams(l);a?r.set("has_code","true"):r.delete("has_code"),h(r)},onHasHfArtifactsChange:a=>{const r=new URLSearchParams(l);a?r.set("has_hf_artifacts","true"):r.delete("has_hf_artifacts"),h(r)}})]}),e.jsxs("div",{className:"results-count",children:[R.toLocaleString()," papers"]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((a,r)=>e.jsx(C,{className:"h-40 w-full"},r))}):b.length===0?e.jsx("div",{className:"no-results",children:(s==null?void 0:s.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:b.map((a,r)=>e.jsx(U,{paper:a,rank:r+1,showInstitution:!1},a.id))}),e.jsx("div",{ref:H,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center"},children:"Loading more…"})]})]})};export{ue as O};
assets/OrganizationTaskView-D1JOqGPE.js DELETED
@@ -1 +0,0 @@
1
- import{c as i,j as t}from"./index-DpqMFKEJ.js";import{O as m}from"./OrganizationPaperFeed-D8JytOGR.js";import p from"./NotFound-C4Ku0WP3.js";import"./useQuery-BRJ3D8WJ.js";import"./components-D8W6Owmv.js";import"./LatexTitle-j9Bx8wiP.js";import"./katex.min-BSBacQyE.js";import"./transform-BG6M6eP3.js";import"./papers-inj3gJs3.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-fqFB7jpa.js";import"./PaperPreviewLink-Da7TZ3ij.js";import"./index-DYz3ynl3.js";import"./hover-card-K79gJfh7.js";import"./OrganizationContributionGraph-rCVWThLe.js";import"./skeleton-BmlKdebV.js";import"./catalog-CNSpmU4d.js";import"./useIntersectionObserver-CXj-qZiT.js";import"./alert-C5eNYVhH.js";import"./searchable-select-BXitSfpv.js";import"./button-CpZL29fe.js";import"./dialog-DW3Uw8Zv.js";import"./loader-circle-CEEZZR71.js";import"./usePapers-BLL7LMPj.js";import"./useInfiniteQuery-ud8-aqIx.js";const h=()=>{const{orgSlug:o,taskSlug:r}=i();return o&&r?t.jsx(m,{organizationSlug:o,taskSlug:r}):t.jsx(p,{})};export{h as default};
 
 
assets/OrganizationTaskView-qJaHP435.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{c as i,j as t}from"./index-B5X8-Bq7.js";import{O as m}from"./OrganizationPaperFeed-Btj_88cl.js";import p from"./NotFound-BqqYiveq.js";import"./useQuery-D05r-Fqo.js";import"./components-BYijBjrn.js";import"./LatexTitle-BQ-aqYJn.js";import"./katex.min-BSBacQyE.js";import"./transform-Ce1Ycrlu.js";import"./papers-D7y8njf2.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-BGyyXIsO.js";import"./PaperPreviewLink-Br9pyKgi.js";import"./index-LVXoOqbx.js";import"./hover-card-ClPcsbgj.js";import"./OrganizationContributionGraph-D2Q82lUu.js";import"./skeleton-Ck9ioJnz.js";import"./catalog-Cpdj6dI_.js";import"./useIntersectionObserver-II0SG2xo.js";import"./alert-C4A_tmFK.js";import"./searchable-select-DM_tXLIJ.js";import"./button-cqkU__aM.js";import"./dialog-DQCWceSF.js";import"./loader-circle-QH8Jsx5e.js";import"./usePapers-CCbDROh4.js";import"./useInfiniteQuery-SpeFiDye.js";const h=()=>{const{orgSlug:o,taskSlug:r}=i();return o&&r?t.jsx(m,{organizationSlug:o,taskSlug:r}):t.jsx(p,{})};export{h as default};
assets/{OrganizationsIndexView-BHHCI1Mo.js → OrganizationsIndexView-Bq3jofOO.js} RENAMED
@@ -1 +1 @@
1
- import{a as u,r as g,j as e,L as x}from"./index-DpqMFKEJ.js";import{u as j}from"./useQuery-BRJ3D8WJ.js";import{A as y,a as f}from"./alert-C5eNYVhH.js";import{S as _}from"./skeleton-BmlKdebV.js";import{c as N}from"./catalog-CNSpmU4d.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)})})},A=()=>{var h;const[n,d]=u(),t=v(n.get("sort")),c=n.get("q")??"",o=j({queryKey:["organizations","featured"],queryFn:()=>N.organizations(!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(_,{className:"organization-card-skeleton"},a))}):o.error?e.jsx(y,{variant:"destructive",children:e.jsxs(f,{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{A as default};
 
1
+ import{a as u,r as g,j as e,L as x}from"./index-B5X8-Bq7.js";import{u as j}from"./useQuery-D05r-Fqo.js";import{A as y,a as f}from"./alert-C4A_tmFK.js";import{S as _}from"./skeleton-Ck9ioJnz.js";import{c as N}from"./catalog-Cpdj6dI_.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)})})},A=()=>{var h;const[n,d]=u(),t=v(n.get("sort")),c=n.get("q")??"",o=j({queryKey:["organizations","featured"],queryFn:()=>N.organizations(!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(_,{className:"organization-card-skeleton"},a))}):o.error?e.jsx(y,{variant:"destructive",children:e.jsxs(f,{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{A as default};
assets/{PaperDetailView-nbbwll6_.js → PaperDetailView-CmpN99i3.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{d as ht,n as Es,u as Dt,e as te,f as Ss,r as p,j as e,g as ce,C as me,P as Ht,h as ge,k as Mt,l as Se,m as Ce,o as zt,p as pt,q as Re,X as ft,L as le,s as Ps,t as Is,R as $s,I as As,v as qt,w as Rs,x as Fs,T as Ls,A as it,y as Le,z as Fe,B as ot,D as Kt,E as Ts,c as Us,F as Bs,b as Ds,G as Hs,H as Ms,J as zs,K as qs,M as Ks}from"./index-DpqMFKEJ.js";import{I as G,T as Os,M as Qs,S as Gs,a as Vs}from"./components-D8W6Owmv.js";import{L as Ae,a as Js}from"./LatexTitle-j9Bx8wiP.js";import{e as Te,C as Xs,E as Ws}from"./ExternalSourceEvalBadge-7U9mCirI.js";import{p as V}from"./papers-inj3gJs3.js";import{u as Z}from"./useQuery-BRJ3D8WJ.js";import{a as Ys}from"./usePapers-BLL7LMPj.js";import{f as Zs,D as ea}from"./latexPlainText-DI8YEXVe.js";import{s as be}from"./safeExternalHref-CkBrsh84.js";import{s as ta}from"./transform-BG6M6eP3.js";import{S as Ne}from"./skeleton-BmlKdebV.js";import{A as sa,a as aa}from"./alert-C5eNYVhH.js";import{B as D}from"./button-CpZL29fe.js";import{I as W}from"./textarea-BA4c3aP6.js";import{D as se,a as ae,b as re,c as ne,d as ie,e as oe}from"./dialog-DW3Uw8Zv.js";import{S as Et,a as Ee}from"./searchable-select-BXitSfpv.js";import{u as de}from"./useMutation-BFwg1MYO.js";import{c as fe}from"./catalog-CNSpmU4d.js";import{s as he}from"./submissions-B8Kj7oPp.js";import{P as Ue,S as gt,L as Y,a as ra}from"./SignInToEditDialog-_xlmZxOT.js";import{L as ee}from"./loader-circle-CEEZZR71.js";import{D as na,B as Ot,c as ia,g as oa,s as la,a as ca,b as da,d as ua,i as ma,e as ha}from"./codexAddEvals-nWlYUpJo.js";import{u as Qt}from"./index-CkejuWVZ.js";import{n as Ge,g as St}from"./github-BRCZ4EHw.js";import{G as Pt}from"./github-DWbj5_NN.js";import{M as pa,r as fa}from"./index-DYz3ynl3.js";import{S as It,s as ga}from"./savedPapersAuth-CtDarHw2.js";import"./katex.min-BSBacQyE.js";import"./hover-card-K79gJfh7.js";import"./useInfiniteQuery-ud8-aqIx.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{d as ht,n as Es,u as Dt,e as te,f as Ss,r as p,j as e,g as ce,C as me,P as Ht,h as ge,k as Mt,l as Se,m as Ce,o as zt,p as pt,q as Re,X as ft,L as le,s as Ps,t as Is,R as $s,I as As,v as qt,w as Rs,x as Fs,T as Ls,A as it,y as Le,z as Fe,B as ot,D as Kt,E as Ts,c as Us,F as Bs,b as Ds,G as Hs,H as Ms,J as zs,K as qs,M as Ks}from"./index-B5X8-Bq7.js";import{I as G,T as Os,M as Qs,S as Gs,a as Vs}from"./components-BYijBjrn.js";import{L as Ae,a as Js}from"./LatexTitle-BQ-aqYJn.js";import{e as Te,C as Xs,E as Ws}from"./ExternalSourceEvalBadge-BL5qKVgu.js";import{p as V}from"./papers-D7y8njf2.js";import{u as Z}from"./useQuery-D05r-Fqo.js";import{a as Ys}from"./usePapers-CCbDROh4.js";import{f as Zs,D as ea}from"./latexPlainText-DI8YEXVe.js";import{s as be}from"./safeExternalHref-CkBrsh84.js";import{s as ta}from"./transform-Ce1Ycrlu.js";import{S as Ne}from"./skeleton-Ck9ioJnz.js";import{A as sa,a as aa}from"./alert-C4A_tmFK.js";import{B as D}from"./button-cqkU__aM.js";import{I as W}from"./textarea-Bw7gV3w2.js";import{D as se,a as ae,b as re,c as ne,d as ie,e as oe}from"./dialog-DQCWceSF.js";import{S as Et,a as Ee}from"./searchable-select-DM_tXLIJ.js";import{u as de}from"./useMutation-jhc4sxTL.js";import{c as fe}from"./catalog-Cpdj6dI_.js";import{s as he}from"./submissions-CUbxi_j0.js";import{P as Ue,S as gt,L as Y,a as ra}from"./SignInToEditDialog-C_4kkM3M.js";import{L as ee}from"./loader-circle-QH8Jsx5e.js";import{D as na,B as Ot,c as ia,g as oa,s as la,a as ca,b as da,d as ua,i as ma,e as ha}from"./codexAddEvals-BmFseKZD.js";import{u as Qt}from"./index-DxIJV7Rp.js";import{n as Ge,g as St}from"./github-BF4mMFfY.js";import{G as Pt}from"./github-GWy166ov.js";import{M as pa,r as fa}from"./index-LVXoOqbx.js";import{S as It,s as ga}from"./savedPapersAuth-DkRwQdlI.js";import"./katex.min-BSBacQyE.js";import"./hover-card-ClPcsbgj.js";import"./useInfiniteQuery-SpeFiDye.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{PaperPreviewLink-Da7TZ3ij.js → PaperPreviewLink-Br9pyKgi.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 z,h as ie,s as ae,c as oe,v as se,S as le}from"./index-DYz3ynl3.js";import{k as L}from"./katex.min-BSBacQyE.js";import{j as f,z as T,M as ce,n as ue,L as he}from"./index-DpqMFKEJ.js";import{u as pe}from"./useQuery-BRJ3D8WJ.js";import{H as me,a as fe,b as de}from"./hover-card-K79gJfh7.js";import{p as ge}from"./papers-inj3gJs3.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 z,h as ie,s as ae,c as oe,v as se,S as le}from"./index-LVXoOqbx.js";import{k as L}from"./katex.min-BSBacQyE.js";import{j as f,z as T,M as ce,n as ue,L as he}from"./index-B5X8-Bq7.js";import{u as pe}from"./useQuery-D05r-Fqo.js";import{H as me,a as fe,b as de}from"./hover-card-ClPcsbgj.js";import{p as ge}from"./papers-D7y8njf2.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/{PaperReaderView-Cxoim2AQ.js → PaperReaderView-D0kJa2gb.js} RENAMED
The diff for this file is too large to render. See raw diff
 
assets/{PapersListView-_ixIrLut.js → PapersListView-CznAYqEu.js} RENAMED
@@ -1 +1 @@
1
- import{a as q,r as m,A as z,j as e,L as x}from"./index-DpqMFKEJ.js";import{I as E,T as G,P as Q}from"./components-D8W6Owmv.js";import{c as U}from"./catalog-CNSpmU4d.js";import{t as W,d as K}from"./transform-BG6M6eP3.js";import{u as V}from"./usePapers-BLL7LMPj.js";import{u as J}from"./useDebounce-CyEi2B13.js";import{P as X}from"./usePeriodFilter-ByjPMisl.js";import{u as Y,P as Z}from"./useIntersectionObserver-CXj-qZiT.js";import{S as p}from"./skeleton-BmlKdebV.js";import{A as ee,a as se}from"./alert-C5eNYVhH.js";import{u as ae}from"./useQuery-BRJ3D8WJ.js";import"./LatexTitle-j9Bx8wiP.js";import"./katex.min-BSBacQyE.js";import"./papers-inj3gJs3.js";import"./safeExternalHref-CkBrsh84.js";import"./useInfiniteQuery-ud8-aqIx.js";const re=[["trending","trending"],["new","newest"],["cited","most cited"]],te=r=>new Intl.NumberFormat("en",{notation:r>=1e3?"compact":"standard",maximumFractionDigits:1}).format(r),be=()=>{var T,A,C,I,L,R,H;const[r,v]=q(),h=r.get("framework")||void 0,g=r.get("repository")||void 0,n=!!(h||g),u=r.get("search")||"",[_,b]=m.useState(u),d=J(_,300);m.useEffect(()=>b(u),[u]),m.useEffect(()=>{if(d===u)return;const s=new URLSearchParams(r);d?s.set("search",d):s.delete("search"),v(s,{replace:!0})},[d]);const k=r.get("order_by"),j=k==="citation_count"?"cited":k==="date_published"?"new":"trending",o=r.get("time"),$=o==="today"?"Today":o==="week"?"This Week":o==="month"?"This Month":"All Time",y=r.get("has_hf_artifacts")==="true",w=!n&&r.get("has_code")==="true",f=(s,i)=>{const l=new URLSearchParams(r);i?l.set(s,i):l.delete(s),v(l)},B=s=>{f("time",s==="Today"?"today":s==="This Week"?"week":s==="This Month"?"month":void 0)},D=s=>{f("order_by",s==="cited"?"citation_count":s==="new"?"date_published":"trending")},t=V({page_size:20,order_by:j==="trending"?"trending":j==="cited"?"citation_count":"date_published",order_dir:"desc",search:d||void 0,time:o==="today"||o==="week"||o==="month"?o:"all_time",include_resources:!0,published_after:r.get("published_after")||void 0,published_before:r.get("published_before")||void 0,conference:r.get("conference")||void 0,latest_only:r.get("latest_only")!=="false",has_code:w,has_hf_artifacts:y,framework:h,repository:g}),P=ae({queryKey:["top-tasks-sidebar"],queryFn:()=>U.topTasks(8),enabled:!n,staleTime:10*60*1e3}),N=m.useMemo(()=>{var i;return(((i=t.data)==null?void 0:i.pages.flatMap(l=>l.results))||[]).map(W)},[t.data]),{targetRef:O,isIntersecting:F}=Y({rootMargin:"200px"});m.useEffect(()=>{F&&t.hasNextPage&&!t.isFetchingNextPage&&t.fetchNextPage()},[F,t.hasNextPage,t.isFetchingNextPage]);const c=((C=(A=(T=t.data)==null?void 0:T.pages)==null?void 0:A[0])==null?void 0:C.count)??0,a=(R=(L=(I=t.data)==null?void 0:I.pages)==null?void 0:L[0])==null?void 0:R.scope,S=h&&t.error instanceof z&&t.error.status===404,M=(a==null?void 0:a.kind)==="framework"?a.framework_name:a==null?void 0:a.repository;return e.jsxs("div",{className:"page",children:[(a==null?void 0:a.kind)==="framework"&&e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(x,{to:"/",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx(x,{to:"/frameworks",children:"Frameworks"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:a.framework_name})]}),e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"feed-title",children:n?e.jsxs(e.Fragment,{children:["Papers implemented by ",e.jsx("em",{children:M||h||g})]}):e.jsxs(e.Fragment,{children:["All ",e.jsx("em",{children:"Papers"})]})}),e.jsx("div",{className:"feed-subtitle",children:n?(a==null?void 0:a.kind)==="framework"?c>0&&`${c.toLocaleString()} papers.`:a!=null&&a.repository?e.jsxs(e.Fragment,{children:["GitHub repository ",e.jsx("strong",{children:a.repository}),". ",c>0&&`${c.toLocaleString()} papers.`]}):"Repository-scoped paper feed.":e.jsxs(e.Fragment,{children:["Search the full corpus. ",c>0&&`${c.toLocaleString()} papers indexed.`]})}),n&&a&&e.jsxs("div",{className:"paper-feed-scope-links",children:[e.jsxs("div",{className:"paper-feed-primary-links",children:[a.github_url&&e.jsxs("a",{href:a.github_url,target:"_blank",rel:"noopener noreferrer",className:a.kind==="framework"?"task-framework-link":"framework-link",children:[e.jsx(E,{name:"github",size:13}),a.kind==="framework"?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:a.repository||"GitHub"}),a.num_stars!=null&&e.jsxs("span",{className:"task-framework-link-stars",children:["★ ",te(a.num_stars)]})]}):"GitHub"]}),a.kind==="framework"&&a.introducing_paper_arxiv_id&&e.jsx(x,{to:`/paper/${a.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"})]}),a.kind==="framework"&&a.recommended_tasks&&a.recommended_tasks.length>0&&e.jsx("div",{className:"paper-feed-task-tags",children:a.recommended_tasks.map(s=>s.slug?e.jsx(G,{slug:s.slug,label:s.name},s.id):null)})]})]}),e.jsx("div",{className:"period-switch",children:X.map(s=>e.jsx("button",{className:`period-btn ${$===s?"active":""}`,onClick:()=>B(s),children:s},s))})]}),e.jsx("div",{className:"papers-search-row",children:e.jsxs("div",{className:"papers-search-input-wrap",children:[e.jsx(E,{name:"search",size:14}),e.jsx("input",{className:"papers-search-input",placeholder:"Search title or abstract…",value:_,onChange:s=>b(s.target.value)})]})}),e.jsxs("div",{className:n?"papers-feed-layout-scoped":"layout-with-sidebar",children:[!n&&e.jsx("aside",{className:"sidebar",children:e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),P.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,i)=>e.jsx(p,{className:"h-5 w-full"},i))}),(H=P.data)==null?void 0:H.map(s=>e.jsxs(x,{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.jsxs("div",{children:[e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:re.map(([s,i])=>e.jsx("button",{className:`sort-btn ${j===s?"active":""}`,onClick:()=>D(s),children:i},s))}),e.jsx(Z,{hasCode:w,hasHfArtifacts:y,onHasCodeChange:s=>f("has_code",s?"true":void 0),onHasHfArtifactsChange:s=>f("has_hf_artifacts",s?"true":void 0),showHasCode:!n})]}),e.jsxs("div",{className:"results-count",children:[N.length," loaded"]})]}),S?e.jsx("div",{className:"no-results",children:"Framework not found."}):t.error&&e.jsx(ee,{variant:"destructive",className:"mb-4",children:e.jsx(se,{children:"Failed to load papers. Please try again."})}),!S&&(t.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,i)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(p,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(p,{className:"h-6 w-3/4"}),e.jsx(p,{className:"h-4 w-1/2"}),e.jsx(p,{className:"h-12 w-full"})]})]},i))}):N.length===0?e.jsx("div",{className:"no-results",children:"No matching papers."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:N.map((s,i)=>e.jsx(Q,{paper:s,rank:i+1},s.id))}),e.jsx("div",{ref:O,style:{height:1}}),t.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]}))]})]})]})};export{be as default};
 
1
+ import{a as q,r as m,A as z,j as e,L as x}from"./index-B5X8-Bq7.js";import{I as E,T as G,P as Q}from"./components-BYijBjrn.js";import{c as U}from"./catalog-Cpdj6dI_.js";import{t as W,d as K}from"./transform-Ce1Ycrlu.js";import{u as V}from"./usePapers-CCbDROh4.js";import{u as J}from"./useDebounce-E0bP1IWy.js";import{P as X}from"./usePeriodFilter-BOGR6X98.js";import{u as Y,P as Z}from"./useIntersectionObserver-II0SG2xo.js";import{S as p}from"./skeleton-Ck9ioJnz.js";import{A as ee,a as se}from"./alert-C4A_tmFK.js";import{u as ae}from"./useQuery-D05r-Fqo.js";import"./LatexTitle-BQ-aqYJn.js";import"./katex.min-BSBacQyE.js";import"./papers-D7y8njf2.js";import"./safeExternalHref-CkBrsh84.js";import"./useInfiniteQuery-SpeFiDye.js";const re=[["trending","trending"],["new","newest"],["cited","most cited"]],te=r=>new Intl.NumberFormat("en",{notation:r>=1e3?"compact":"standard",maximumFractionDigits:1}).format(r),be=()=>{var T,A,C,I,L,R,H;const[r,v]=q(),h=r.get("framework")||void 0,g=r.get("repository")||void 0,n=!!(h||g),u=r.get("search")||"",[_,b]=m.useState(u),d=J(_,300);m.useEffect(()=>b(u),[u]),m.useEffect(()=>{if(d===u)return;const s=new URLSearchParams(r);d?s.set("search",d):s.delete("search"),v(s,{replace:!0})},[d]);const k=r.get("order_by"),j=k==="citation_count"?"cited":k==="date_published"?"new":"trending",o=r.get("time"),$=o==="today"?"Today":o==="week"?"This Week":o==="month"?"This Month":"All Time",y=r.get("has_hf_artifacts")==="true",w=!n&&r.get("has_code")==="true",f=(s,i)=>{const l=new URLSearchParams(r);i?l.set(s,i):l.delete(s),v(l)},B=s=>{f("time",s==="Today"?"today":s==="This Week"?"week":s==="This Month"?"month":void 0)},D=s=>{f("order_by",s==="cited"?"citation_count":s==="new"?"date_published":"trending")},t=V({page_size:20,order_by:j==="trending"?"trending":j==="cited"?"citation_count":"date_published",order_dir:"desc",search:d||void 0,time:o==="today"||o==="week"||o==="month"?o:"all_time",include_resources:!0,published_after:r.get("published_after")||void 0,published_before:r.get("published_before")||void 0,conference:r.get("conference")||void 0,latest_only:r.get("latest_only")!=="false",has_code:w,has_hf_artifacts:y,framework:h,repository:g}),P=ae({queryKey:["top-tasks-sidebar"],queryFn:()=>U.topTasks(8),enabled:!n,staleTime:10*60*1e3}),N=m.useMemo(()=>{var i;return(((i=t.data)==null?void 0:i.pages.flatMap(l=>l.results))||[]).map(W)},[t.data]),{targetRef:O,isIntersecting:F}=Y({rootMargin:"200px"});m.useEffect(()=>{F&&t.hasNextPage&&!t.isFetchingNextPage&&t.fetchNextPage()},[F,t.hasNextPage,t.isFetchingNextPage]);const c=((C=(A=(T=t.data)==null?void 0:T.pages)==null?void 0:A[0])==null?void 0:C.count)??0,a=(R=(L=(I=t.data)==null?void 0:I.pages)==null?void 0:L[0])==null?void 0:R.scope,S=h&&t.error instanceof z&&t.error.status===404,M=(a==null?void 0:a.kind)==="framework"?a.framework_name:a==null?void 0:a.repository;return e.jsxs("div",{className:"page",children:[(a==null?void 0:a.kind)==="framework"&&e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(x,{to:"/",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx(x,{to:"/frameworks",children:"Frameworks"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:a.framework_name})]}),e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"feed-title",children:n?e.jsxs(e.Fragment,{children:["Papers implemented by ",e.jsx("em",{children:M||h||g})]}):e.jsxs(e.Fragment,{children:["All ",e.jsx("em",{children:"Papers"})]})}),e.jsx("div",{className:"feed-subtitle",children:n?(a==null?void 0:a.kind)==="framework"?c>0&&`${c.toLocaleString()} papers.`:a!=null&&a.repository?e.jsxs(e.Fragment,{children:["GitHub repository ",e.jsx("strong",{children:a.repository}),". ",c>0&&`${c.toLocaleString()} papers.`]}):"Repository-scoped paper feed.":e.jsxs(e.Fragment,{children:["Search the full corpus. ",c>0&&`${c.toLocaleString()} papers indexed.`]})}),n&&a&&e.jsxs("div",{className:"paper-feed-scope-links",children:[e.jsxs("div",{className:"paper-feed-primary-links",children:[a.github_url&&e.jsxs("a",{href:a.github_url,target:"_blank",rel:"noopener noreferrer",className:a.kind==="framework"?"task-framework-link":"framework-link",children:[e.jsx(E,{name:"github",size:13}),a.kind==="framework"?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:a.repository||"GitHub"}),a.num_stars!=null&&e.jsxs("span",{className:"task-framework-link-stars",children:["★ ",te(a.num_stars)]})]}):"GitHub"]}),a.kind==="framework"&&a.introducing_paper_arxiv_id&&e.jsx(x,{to:`/paper/${a.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"})]}),a.kind==="framework"&&a.recommended_tasks&&a.recommended_tasks.length>0&&e.jsx("div",{className:"paper-feed-task-tags",children:a.recommended_tasks.map(s=>s.slug?e.jsx(G,{slug:s.slug,label:s.name},s.id):null)})]})]}),e.jsx("div",{className:"period-switch",children:X.map(s=>e.jsx("button",{className:`period-btn ${$===s?"active":""}`,onClick:()=>B(s),children:s},s))})]}),e.jsx("div",{className:"papers-search-row",children:e.jsxs("div",{className:"papers-search-input-wrap",children:[e.jsx(E,{name:"search",size:14}),e.jsx("input",{className:"papers-search-input",placeholder:"Search title or abstract…",value:_,onChange:s=>b(s.target.value)})]})}),e.jsxs("div",{className:n?"papers-feed-layout-scoped":"layout-with-sidebar",children:[!n&&e.jsx("aside",{className:"sidebar",children:e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),P.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,i)=>e.jsx(p,{className:"h-5 w-full"},i))}),(H=P.data)==null?void 0:H.map(s=>e.jsxs(x,{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.jsxs("div",{children:[e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:re.map(([s,i])=>e.jsx("button",{className:`sort-btn ${j===s?"active":""}`,onClick:()=>D(s),children:i},s))}),e.jsx(Z,{hasCode:w,hasHfArtifacts:y,onHasCodeChange:s=>f("has_code",s?"true":void 0),onHasHfArtifactsChange:s=>f("has_hf_artifacts",s?"true":void 0),showHasCode:!n})]}),e.jsxs("div",{className:"results-count",children:[N.length," loaded"]})]}),S?e.jsx("div",{className:"no-results",children:"Framework not found."}):t.error&&e.jsx(ee,{variant:"destructive",className:"mb-4",children:e.jsx(se,{children:"Failed to load papers. Please try again."})}),!S&&(t.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,i)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(p,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(p,{className:"h-6 w-3/4"}),e.jsx(p,{className:"h-4 w-1/2"}),e.jsx(p,{className:"h-12 w-full"})]})]},i))}):N.length===0?e.jsx("div",{className:"no-results",children:"No matching papers."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:N.map((s,i)=>e.jsx(Q,{paper:s,rank:i+1},s.id))}),e.jsx("div",{ref:O,style:{height:1}}),t.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]}))]})]})]})};export{be as default};
assets/{PrivacyView-BfVZL4ZS.js → PrivacyView-BtJ_lMF8.js} RENAMED
@@ -1 +1 @@
1
- import{z as s,j as e}from"./index-DpqMFKEJ.js";import{f as i,D as r}from"./latexPlainText-DI8YEXVe.js";const n=()=>(s.useEffect(()=>(document.title=i("Privacy Policy"),()=>{document.title=r}),[]),e.jsxs("article",{className:"page legal-page",children:[e.jsxs("header",{className:"legal-header",children:[e.jsx("p",{className:"legal-kicker",children:"Legal"}),e.jsx("h1",{children:"Privacy Policy"}),e.jsx("p",{className:"legal-effective-date",children:"Effective August 11, 2026"})]}),e.jsx("p",{children:"This Privacy Policy explains how Hugging Face, Inc. (“Hugging Face,” “we,” or “us”) collects, uses, and shares information when you use Papers With Code, including its website, research assistant, APIs, and related services (the “Service”)."}),e.jsxs("section",{children:[e.jsx("h2",{children:"1. Information we collect"}),e.jsx("h3",{children:"Information you provide"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Account information."})," If you sign in with Hugging Face, we receive account identifiers and profile details needed to authenticate you, such as your user ID, username, and avatar. If you request contributor access, we also receive and retain the verified email address associated with your Hugging Face account so we can review and communicate about your request."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Contributions and preferences."})," We collect information you submit or save, such as paper submissions and edits, bookmarks, display preferences, feedback, and communications with us. Material you submit to a public research page may be publicly visible."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Research assistant content."})," We collect your questions, conversation history, generated answers, citations, tool calls and results, and feedback about answers. Chats are private to your account unless you choose to create a share link; anyone with that link may be able to view the shared chat."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Provider and billing information."})," If you enable a model provider, we process the authorization or API credentials needed to make requests on your behalf. Hugging Face or another provider processes its own billing information under its terms. Papers With Code does not collect your payment-card details."]})]}),e.jsx("h3",{children:"Information collected automatically"}),e.jsx("p",{children:"We collect technical and usage information such as IP address, browser and device type, operating system, pages or features used, dates and times, referring pages, request identifiers, cookies, logs, and diagnostic data. For research-assistant requests, this may include the selected model, token and cost details, latency, errors, and other operational metadata."}),e.jsx("h3",{children:"Research assistant tracing"}),e.jsxs("p",{children:["To evaluate, debug, secure, and improve the research assistant, we use Langfuse to record traces. A trace may contain the complete text of your question and the assistant's answer, as well as tool inputs, tool outputs, retrieved research material, model details, usage data, and related operational metadata.",e.jsx("strong",{children:" This trace content is not redacted before it is sent to Langfuse."})]}),e.jsx("p",{children:"Papers With Code is designed for questions about research literature. Do not put passwords, API keys, confidential information, health or financial data, or other sensitive personal information in research-assistant prompts."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"2. How we use information"}),e.jsx("p",{children:"We use information to:"}),e.jsxs("ul",{children:[e.jsx("li",{children:"provide, personalize, maintain, and operate the Service;"}),e.jsx("li",{children:"authenticate users and keep accounts and the Service secure;"}),e.jsx("li",{children:"run research-assistant requests and preserve conversation history;"}),e.jsx("li",{children:"measure performance, troubleshoot failures, and improve quality;"}),e.jsx("li",{children:"review contributions, prevent abuse, and enforce applicable terms;"}),e.jsx("li",{children:"communicate with you and respond to requests; and"}),e.jsx("li",{children:"comply with law and protect users, Hugging Face, and the public."})]})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"3. How we share information"}),e.jsx("p",{children:"We may share information in these circumstances:"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Service providers."})," Vendors process information for hosting, authentication, analytics, observability, security, and support. These include Hugging Face services, Langfuse for research-assistant tracing, Plausible for website analytics, and infrastructure providers."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Model providers."})," Research-assistant content is sent to the model provider you use, such as Hugging Face Inference Providers or OpenRouter, so it can generate a response. That provider's privacy terms also apply to its processing."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Public and shared content."})," Contributions intended for public pages are public. A chat is disclosed through the Service when you create and distribute a share link."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Legal, safety, and corporate events."})," We may disclose information when reasonably necessary to comply with law, protect rights and safety, investigate abuse, or complete a merger, acquisition, financing, or transfer of assets."]})]}),e.jsx("p",{children:"We do not sell your personal information."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"4. Cookies and analytics"}),e.jsx("p",{children:"We use cookies and similar storage when needed for sign-in, security, preferences, and operation of the Service. We also use Plausible to understand aggregate website usage. You can control cookies through your browser, but disabling necessary cookies may prevent account features from working."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"5. Legal bases"}),e.jsx("p",{children:"Where applicable law requires a legal basis, we process information as needed to perform our agreement with you, with your consent, to comply with legal obligations, and for legitimate interests such as operating, securing, and improving the Service. You may withdraw consent where consent is the basis for processing, without affecting earlier processing."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"6. Retention and deletion"}),e.jsx("p",{children:"Private chats are retained until you delete them, subject to limits of 100 active chats and 100 MB of chat data per user. Archiving hides a chat and frees active-chat quota but does not delete it. You may deliberately share an unlisted snapshot; deleting its private chat removes the durable transcript, workspace reference, and share link after deletion is verified. No dedicated private-chat export format is currently offered."}),e.jsx("p",{children:"We keep information for as long as reasonably needed for the purposes described here, including providing the Service, maintaining security and audit records, resolving disputes, and meeting legal obligations. Retention periods vary by data type and service provider. You can delete individual chats in the Service. Deletion may not immediately remove information from backups, security logs, or third-party systems where limited retention is required."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"7. Security and international transfers"}),e.jsx("p",{children:"We use reasonable administrative, technical, and organizational safeguards, but no internet service can guarantee absolute security. We and our service providers may process information in the United States and other countries, which may have different data-protection laws from your country. Where required, we use appropriate safeguards for international transfers."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"8. Your privacy rights"}),e.jsx("p",{children:"Depending on where you live, you may have rights to access, correct, delete, or receive a copy of your personal information; object to or restrict processing; withdraw consent; or appeal a decision about a request. You may also have the right to complain to a data-protection authority. We may need to verify your identity before fulfilling a request."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"9. Children"}),e.jsx("p",{children:"The Service is not directed to children under 13, and we do not knowingly collect personal information from children under 13. If you believe a child has provided personal information, please contact us."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"10. Changes to this policy"}),e.jsx("p",{children:"We may update this policy as the Service changes. We will post the revised policy here and update its effective date. If a change is material, we will provide additional notice when appropriate."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"11. Contact us"}),e.jsxs("p",{children:["For questions or privacy requests, contact"," ",e.jsx("a",{href:"mailto:privacy@huggingface.co",children:"privacy@huggingface.co"}),". Please do not include passwords, API keys, or other sensitive credentials in your message."]})]})]}));export{n as default};
 
1
+ import{z as s,j as e}from"./index-B5X8-Bq7.js";import{f as i,D as r}from"./latexPlainText-DI8YEXVe.js";const n=()=>(s.useEffect(()=>(document.title=i("Privacy Policy"),()=>{document.title=r}),[]),e.jsxs("article",{className:"page legal-page",children:[e.jsxs("header",{className:"legal-header",children:[e.jsx("p",{className:"legal-kicker",children:"Legal"}),e.jsx("h1",{children:"Privacy Policy"}),e.jsx("p",{className:"legal-effective-date",children:"Effective August 11, 2026"})]}),e.jsx("p",{children:"This Privacy Policy explains how Hugging Face, Inc. (“Hugging Face,” “we,” or “us”) collects, uses, and shares information when you use Papers With Code, including its website, research assistant, APIs, and related services (the “Service”)."}),e.jsxs("section",{children:[e.jsx("h2",{children:"1. Information we collect"}),e.jsx("h3",{children:"Information you provide"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Account information."})," If you sign in with Hugging Face, we receive account identifiers and profile details needed to authenticate you, such as your user ID, username, and avatar. If you request contributor access, we also receive and retain the verified email address associated with your Hugging Face account so we can review and communicate about your request."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Contributions and preferences."})," We collect information you submit or save, such as paper submissions and edits, bookmarks, display preferences, feedback, and communications with us. Material you submit to a public research page may be publicly visible."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Research assistant content."})," We collect your questions, conversation history, generated answers, citations, tool calls and results, and feedback about answers. Chats are private to your account unless you choose to create a share link; anyone with that link may be able to view the shared chat."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Provider and billing information."})," If you enable a model provider, we process the authorization or API credentials needed to make requests on your behalf. Hugging Face or another provider processes its own billing information under its terms. Papers With Code does not collect your payment-card details."]})]}),e.jsx("h3",{children:"Information collected automatically"}),e.jsx("p",{children:"We collect technical and usage information such as IP address, browser and device type, operating system, pages or features used, dates and times, referring pages, request identifiers, cookies, logs, and diagnostic data. For research-assistant requests, this may include the selected model, token and cost details, latency, errors, and other operational metadata."}),e.jsx("h3",{children:"Research assistant tracing"}),e.jsxs("p",{children:["To evaluate, debug, secure, and improve the research assistant, we use Langfuse to record traces. A trace may contain the complete text of your question and the assistant's answer, as well as tool inputs, tool outputs, retrieved research material, model details, usage data, and related operational metadata.",e.jsx("strong",{children:" This trace content is not redacted before it is sent to Langfuse."})]}),e.jsx("p",{children:"Papers With Code is designed for questions about research literature. Do not put passwords, API keys, confidential information, health or financial data, or other sensitive personal information in research-assistant prompts."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"2. How we use information"}),e.jsx("p",{children:"We use information to:"}),e.jsxs("ul",{children:[e.jsx("li",{children:"provide, personalize, maintain, and operate the Service;"}),e.jsx("li",{children:"authenticate users and keep accounts and the Service secure;"}),e.jsx("li",{children:"run research-assistant requests and preserve conversation history;"}),e.jsx("li",{children:"measure performance, troubleshoot failures, and improve quality;"}),e.jsx("li",{children:"review contributions, prevent abuse, and enforce applicable terms;"}),e.jsx("li",{children:"communicate with you and respond to requests; and"}),e.jsx("li",{children:"comply with law and protect users, Hugging Face, and the public."})]})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"3. How we share information"}),e.jsx("p",{children:"We may share information in these circumstances:"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Service providers."})," Vendors process information for hosting, authentication, analytics, observability, security, and support. These include Hugging Face services, Langfuse for research-assistant tracing, Plausible for website analytics, and infrastructure providers."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Model providers."})," Research-assistant content is sent to the model provider you use, such as Hugging Face Inference Providers or OpenRouter, so it can generate a response. That provider's privacy terms also apply to its processing."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Public and shared content."})," Contributions intended for public pages are public. A chat is disclosed through the Service when you create and distribute a share link."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Legal, safety, and corporate events."})," We may disclose information when reasonably necessary to comply with law, protect rights and safety, investigate abuse, or complete a merger, acquisition, financing, or transfer of assets."]})]}),e.jsx("p",{children:"We do not sell your personal information."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"4. Cookies and analytics"}),e.jsx("p",{children:"We use cookies and similar storage when needed for sign-in, security, preferences, and operation of the Service. We also use Plausible to understand aggregate website usage. You can control cookies through your browser, but disabling necessary cookies may prevent account features from working."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"5. Legal bases"}),e.jsx("p",{children:"Where applicable law requires a legal basis, we process information as needed to perform our agreement with you, with your consent, to comply with legal obligations, and for legitimate interests such as operating, securing, and improving the Service. You may withdraw consent where consent is the basis for processing, without affecting earlier processing."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"6. Retention and deletion"}),e.jsx("p",{children:"Private chats are retained until you delete them, subject to limits of 100 active chats and 100 MB of chat data per user. Archiving hides a chat and frees active-chat quota but does not delete it. You may deliberately share an unlisted snapshot; deleting its private chat removes the durable transcript, workspace reference, and share link after deletion is verified. No dedicated private-chat export format is currently offered."}),e.jsx("p",{children:"We keep information for as long as reasonably needed for the purposes described here, including providing the Service, maintaining security and audit records, resolving disputes, and meeting legal obligations. Retention periods vary by data type and service provider. You can delete individual chats in the Service. Deletion may not immediately remove information from backups, security logs, or third-party systems where limited retention is required."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"7. Security and international transfers"}),e.jsx("p",{children:"We use reasonable administrative, technical, and organizational safeguards, but no internet service can guarantee absolute security. We and our service providers may process information in the United States and other countries, which may have different data-protection laws from your country. Where required, we use appropriate safeguards for international transfers."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"8. Your privacy rights"}),e.jsx("p",{children:"Depending on where you live, you may have rights to access, correct, delete, or receive a copy of your personal information; object to or restrict processing; withdraw consent; or appeal a decision about a request. You may also have the right to complain to a data-protection authority. We may need to verify your identity before fulfilling a request."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"9. Children"}),e.jsx("p",{children:"The Service is not directed to children under 13, and we do not knowingly collect personal information from children under 13. If you believe a child has provided personal information, please contact us."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"10. Changes to this policy"}),e.jsx("p",{children:"We may update this policy as the Service changes. We will post the revised policy here and update its effective date. If a change is material, we will provide additional notice when appropriate."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"11. Contact us"}),e.jsxs("p",{children:["For questions or privacy requests, contact"," ",e.jsx("a",{href:"mailto:privacy@huggingface.co",children:"privacy@huggingface.co"}),". Please do not include passwords, API keys, or other sensitive credentials in your message."]})]})]}));export{n as default};
assets/{RateLimitsView-DUYDvfR7.js → RateLimitsView-iQNMV_O1.js} RENAMED
@@ -1 +1 @@
1
- import{j as e,B as t}from"./index-DpqMFKEJ.js";import{u as s}from"./useQuery-BRJ3D8WJ.js";const n=()=>{const i=s({queryKey:["submission-rate-limit-policy"],queryFn:()=>t.getRateLimitPolicy()}).data;return e.jsxs("div",{className:"page",style:{maxWidth:760},children:[e.jsx("h1",{children:"Submission and rate-limit policy"}),i?e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:["Each account may have up to ",i.active_pending," active submissions."]}),e.jsxs("p",{children:["New submissions are limited to ",i.subject_per_hour," per account and ",i.ip_per_hour," per source network in a rolling hour."]})]}):e.jsx("p",{children:"Loading current limits…"}),e.jsx("p",{children:"Duplicate, no-op, and idempotently replayed requests do not consume creation quota."}),e.jsx("p",{children:"Rate-limited responses use HTTP 429 with Retry-After, RateLimit, and RateLimit-Policy headers."}),e.jsx("p",{children:"Good-faith contributors who are blocked should contact the Papers with Code maintainers with their Hugging Face username."})]})};export{n as default};
 
1
+ import{j as e,B as t}from"./index-B5X8-Bq7.js";import{u as s}from"./useQuery-D05r-Fqo.js";const n=()=>{const i=s({queryKey:["submission-rate-limit-policy"],queryFn:()=>t.getRateLimitPolicy()}).data;return e.jsxs("div",{className:"page",style:{maxWidth:760},children:[e.jsx("h1",{children:"Submission and rate-limit policy"}),i?e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:["Each account may have up to ",i.active_pending," active submissions."]}),e.jsxs("p",{children:["New submissions are limited to ",i.subject_per_hour," per account and ",i.ip_per_hour," per source network in a rolling hour."]})]}):e.jsx("p",{children:"Loading current limits…"}),e.jsx("p",{children:"Duplicate, no-op, and idempotently replayed requests do not consume creation quota."}),e.jsx("p",{children:"Rate-limited responses use HTTP 429 with Retry-After, RateLimit, and RateLimit-Policy headers."}),e.jsx("p",{children:"Good-faith contributors who are blocked should contact the Papers with Code maintainers with their Hugging Face username."})]})};export{n as default};
assets/{SavedPapersView-CC3_m-hY.js → SavedPapersView-Bnr3_eZb.js} RENAMED
@@ -1 +1 @@
1
- import{y as h,A as g,j as e,a1 as v,L as x,B as j}from"./index-DpqMFKEJ.js";import{u as N}from"./useQuery-BRJ3D8WJ.js";import{T as b,P as f}from"./components-D8W6Owmv.js";import{S as r}from"./skeleton-BmlKdebV.js";import{A as k,a as y}from"./alert-C5eNYVhH.js";import{t as w}from"./transform-BG6M6eP3.js";import{s as A}from"./savedPapersAuth-CtDarHw2.js";import"./LatexTitle-j9Bx8wiP.js";import"./katex.min-BSBacQyE.js";import"./papers-inj3gJs3.js";import"./safeExternalHref-CkBrsh84.js";const z=()=>{var d,o;const{user:t,isLoading:u}=h(),a=N({queryKey:["my-bookmarks"],queryFn:()=>j.getBookmarks(),enabled:!!t,staleTime:30*1e3,refetchOnWindowFocus:!1}),n=a.error instanceof g&&a.error.code==="saved_papers_bucket_authorization_required",m=!!a.data&&!a.data.bucket_connected,c=()=>{window.location.assign(A())};return u?e.jsxs("div",{className:"page",children:[e.jsx(r,{className:"h-10 w-1/3 mb-4"}),e.jsx(r,{className:"h-6 w-1/2 mb-8"})]}):t?e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Saved ",e.jsx("em",{children:"Papers"})]}),e.jsxs("div",{className:"feed-subtitle",children:[(d=a.data)!=null&&d.count?`${a.data.count.toLocaleString()} saved · grouped by domain`:"Your bookmarked papers, grouped by domain.",(o=a.data)!=null&&o.bucket_connected?e.jsxs(e.Fragment,{children:[" · ",e.jsx("a",{href:`https://huggingface.co/buckets/${t.username}/pwc-saved-papers`,target:"_blank",rel:"noopener noreferrer",children:"Open your Hugging Face Bucket"})]}):null]})]})}),n?e.jsxs("div",{className:"saved-bucket-migration",children:[e.jsx("p",{children:"Your saved papers are still safe in Papers With Code. Approve Bucket access to copy them into a private Hugging Face Bucket that belongs to you."}),e.jsx("button",{type:"button",className:"hf-signin-btn",onClick:c,children:"Approve and migrate saved papers"})]}):a.error?e.jsx(k,{variant:"destructive",className:"mb-4",children:e.jsx(y,{children:"Failed to load your saved papers. Please try again."})}):null,m?e.jsxs("div",{className:"saved-bucket-migration",children:[e.jsxs("p",{children:[a.data.count?`Your ${a.data.count.toLocaleString()} saved ${a.data.count===1?"paper is":"papers are"} still available below. `:"When you save your first paper, ","Approve Bucket access to copy saved papers into a private Hugging Face Bucket that belongs to you. The existing data is kept until the copy is verified."]}),e.jsx("button",{type:"button",className:"hf-signin-btn",onClick:c,children:a.data.count?"Approve and migrate saved papers":"Use a Hugging Face Bucket"})]}):null,n||a.error?null:a.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((i,s)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(r,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(r,{className:"h-6 w-3/4"}),e.jsx(r,{className:"h-4 w-1/2"}),e.jsx(r,{className:"h-12 w-full"})]})]},s))}):!a.data||a.data.count===0?e.jsxs("div",{className:"no-results",children:["No saved papers yet."," ",e.jsx(x,{to:"/papers",className:"sidebar-link",style:{display:"inline"},children:"Browse papers →"})]}):a.data.areas.map(i=>e.jsxs("section",{className:"saved-area-section",children:[e.jsx("h2",{className:"saved-area-heading",children:i.name}),i.tasks.map(s=>{const l=s.papers.length;return e.jsxs("div",{className:"saved-task-block",children:[e.jsxs("div",{className:"saved-task-row",children:[s.slug?e.jsx(b,{slug:s.slug,label:s.name}):e.jsx("span",{className:"tag-chip",style:{background:"var(--surface)"},children:s.name}),e.jsxs("span",{className:"saved-task-count",children:[l," ",l===1?"paper":"papers"]})]}),e.jsx("div",{className:"paper-list",children:s.papers.map(p=>e.jsx(f,{paper:w(p),rank:1},p.id))})]},`task-${i.id??"other"}-${s.id??"untagged"}`)})]},`area-${i.id??"other"}`))]}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Saved ",e.jsx("em",{children:"Papers"})]}),e.jsx("div",{className:"feed-subtitle",children:"Sign in with Hugging Face to save papers and revisit them later."})]})}),e.jsx("div",{className:"saved-signin-panel",children:e.jsx(v,{returnTo:"/saved"})})]})};export{z as default};
 
1
+ import{y as h,A as g,j as e,a1 as v,L as x,B as j}from"./index-B5X8-Bq7.js";import{u as N}from"./useQuery-D05r-Fqo.js";import{T as b,P as f}from"./components-BYijBjrn.js";import{S as r}from"./skeleton-Ck9ioJnz.js";import{A as k,a as y}from"./alert-C4A_tmFK.js";import{t as w}from"./transform-Ce1Ycrlu.js";import{s as A}from"./savedPapersAuth-DkRwQdlI.js";import"./LatexTitle-BQ-aqYJn.js";import"./katex.min-BSBacQyE.js";import"./papers-D7y8njf2.js";import"./safeExternalHref-CkBrsh84.js";const z=()=>{var d,o;const{user:t,isLoading:u}=h(),a=N({queryKey:["my-bookmarks"],queryFn:()=>j.getBookmarks(),enabled:!!t,staleTime:30*1e3,refetchOnWindowFocus:!1}),n=a.error instanceof g&&a.error.code==="saved_papers_bucket_authorization_required",m=!!a.data&&!a.data.bucket_connected,c=()=>{window.location.assign(A())};return u?e.jsxs("div",{className:"page",children:[e.jsx(r,{className:"h-10 w-1/3 mb-4"}),e.jsx(r,{className:"h-6 w-1/2 mb-8"})]}):t?e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Saved ",e.jsx("em",{children:"Papers"})]}),e.jsxs("div",{className:"feed-subtitle",children:[(d=a.data)!=null&&d.count?`${a.data.count.toLocaleString()} saved · grouped by domain`:"Your bookmarked papers, grouped by domain.",(o=a.data)!=null&&o.bucket_connected?e.jsxs(e.Fragment,{children:[" · ",e.jsx("a",{href:`https://huggingface.co/buckets/${t.username}/pwc-saved-papers`,target:"_blank",rel:"noopener noreferrer",children:"Open your Hugging Face Bucket"})]}):null]})]})}),n?e.jsxs("div",{className:"saved-bucket-migration",children:[e.jsx("p",{children:"Your saved papers are still safe in Papers With Code. Approve Bucket access to copy them into a private Hugging Face Bucket that belongs to you."}),e.jsx("button",{type:"button",className:"hf-signin-btn",onClick:c,children:"Approve and migrate saved papers"})]}):a.error?e.jsx(k,{variant:"destructive",className:"mb-4",children:e.jsx(y,{children:"Failed to load your saved papers. Please try again."})}):null,m?e.jsxs("div",{className:"saved-bucket-migration",children:[e.jsxs("p",{children:[a.data.count?`Your ${a.data.count.toLocaleString()} saved ${a.data.count===1?"paper is":"papers are"} still available below. `:"When you save your first paper, ","Approve Bucket access to copy saved papers into a private Hugging Face Bucket that belongs to you. The existing data is kept until the copy is verified."]}),e.jsx("button",{type:"button",className:"hf-signin-btn",onClick:c,children:a.data.count?"Approve and migrate saved papers":"Use a Hugging Face Bucket"})]}):null,n||a.error?null:a.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((i,s)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(r,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(r,{className:"h-6 w-3/4"}),e.jsx(r,{className:"h-4 w-1/2"}),e.jsx(r,{className:"h-12 w-full"})]})]},s))}):!a.data||a.data.count===0?e.jsxs("div",{className:"no-results",children:["No saved papers yet."," ",e.jsx(x,{to:"/papers",className:"sidebar-link",style:{display:"inline"},children:"Browse papers →"})]}):a.data.areas.map(i=>e.jsxs("section",{className:"saved-area-section",children:[e.jsx("h2",{className:"saved-area-heading",children:i.name}),i.tasks.map(s=>{const l=s.papers.length;return e.jsxs("div",{className:"saved-task-block",children:[e.jsxs("div",{className:"saved-task-row",children:[s.slug?e.jsx(b,{slug:s.slug,label:s.name}):e.jsx("span",{className:"tag-chip",style:{background:"var(--surface)"},children:s.name}),e.jsxs("span",{className:"saved-task-count",children:[l," ",l===1?"paper":"papers"]})]}),e.jsx("div",{className:"paper-list",children:s.papers.map(p=>e.jsx(f,{paper:w(p),rank:1},p.id))})]},`task-${i.id??"other"}-${s.id??"untagged"}`)})]},`area-${i.id??"other"}`))]}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Saved ",e.jsx("em",{children:"Papers"})]}),e.jsx("div",{className:"feed-subtitle",children:"Sign in with Hugging Face to save papers and revisit them later."})]})}),e.jsx("div",{className:"saved-signin-panel",children:e.jsx(v,{returnTo:"/saved"})})]})};export{z as default};
assets/{SearchOverlay-B_f7fcn_.js → SearchOverlay-C8qVK6Ty.js} RENAMED
@@ -1 +1 @@
1
- import{r as C,u as K,z as T,i as L,j as s}from"./index-DpqMFKEJ.js";import{u as m}from"./useQuery-BRJ3D8WJ.js";import{L as $}from"./LatexTitle-j9Bx8wiP.js";import{c as j}from"./catalog-CNSpmU4d.js";import{p as z}from"./papers-inj3gJs3.js";import{u as D}from"./useDebounce-CyEi2B13.js";import{c as M,h as B,d as I}from"./transform-BG6M6eP3.js";import"./katex.min-BSBacQyE.js";const X=10,Y=({open:n,onClose:l})=>{var f,_,F,q,E,P;const v=C.useRef(null),w=K(),[c,R]=T.useState(""),[h,p]=T.useState(1),a=D(c,200),g=L();C.useEffect(()=>{var r;if(!n)return;(r=v.current)==null||r.focus();const e=A=>{A.key==="Escape"&&l()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[n,l]);const t=m({queryKey:["search-papers",a,h],queryFn:()=>z.search(a,h,X),enabled:n&&a.length>=2,staleTime:6e4}),k=m({queryKey:["search-tasks",a],queryFn:()=>j.listTasks({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4}),y=m({queryKey:["search-methods",a],queryFn:()=>j.listMethods({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4}),N=m({queryKey:["search-benchmarks",a],queryFn:()=>j.listDatasets({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)||[],x=((q=t.data)==null?void 0:q.results)||[],Q=t.isFetching||k.isFetching||y.isFetching||N.isFetching,S=o.length||x.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),p(1)},onKeyDown:e=>{g&&e.key==="Enter"&&(e.preventDefault(),b())}}),s.jsxs("div",{className:"search-results",children:[g&&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.",g&&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=M(B(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:I(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))]}),x.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Papers · page ",h]}),x.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($,{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 p(((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&&p(t.data.next_page)},children:"Next"})]})]})]})]})})};export{Y as default};
 
1
+ import{r as C,u as K,z as T,i as L,j as s}from"./index-B5X8-Bq7.js";import{u as m}from"./useQuery-D05r-Fqo.js";import{L as $}from"./LatexTitle-BQ-aqYJn.js";import{c as j}from"./catalog-Cpdj6dI_.js";import{p as z}from"./papers-D7y8njf2.js";import{u as D}from"./useDebounce-E0bP1IWy.js";import{c as M,h as B,d as I}from"./transform-Ce1Ycrlu.js";import"./katex.min-BSBacQyE.js";const X=10,Y=({open:n,onClose:l})=>{var f,_,F,q,E,P;const v=C.useRef(null),w=K(),[c,R]=T.useState(""),[h,p]=T.useState(1),a=D(c,200),g=L();C.useEffect(()=>{var r;if(!n)return;(r=v.current)==null||r.focus();const e=A=>{A.key==="Escape"&&l()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[n,l]);const t=m({queryKey:["search-papers",a,h],queryFn:()=>z.search(a,h,X),enabled:n&&a.length>=2,staleTime:6e4}),k=m({queryKey:["search-tasks",a],queryFn:()=>j.listTasks({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4}),y=m({queryKey:["search-methods",a],queryFn:()=>j.listMethods({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4}),N=m({queryKey:["search-benchmarks",a],queryFn:()=>j.listDatasets({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)||[],x=((q=t.data)==null?void 0:q.results)||[],Q=t.isFetching||k.isFetching||y.isFetching||N.isFetching,S=o.length||x.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),p(1)},onKeyDown:e=>{g&&e.key==="Enter"&&(e.preventDefault(),b())}}),s.jsxs("div",{className:"search-results",children:[g&&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.",g&&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=M(B(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:I(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))]}),x.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Papers · page ",h]}),x.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($,{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 p(((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&&p(t.data.next_page)},children:"Next"})]})]})]})]})})};export{Y as default};
assets/SettingsView-B6NBFGTS.js DELETED
@@ -1,16 +0,0 @@
1
- import{d as _,y as J,f as ee,ah as se,i as ne,z as c,g as te,j as e,a1 as v,A as Q}from"./index-DpqMFKEJ.js";import{u as L}from"./useQuery-BRJ3D8WJ.js";import{u as y}from"./useMutation-BFwg1MYO.js";import{S as B}from"./switch-m9rpNcU7.js";import{c as o}from"./chat-BrAdjM-f.js";import{f as ae,D as ie}from"./latexPlainText-DI8YEXVe.js";import{a as le,u as re,r as oe,O as E}from"./openrouter-BXQN2vDT.js";import{E as Y}from"./external-link-CU5Ded46.js";import"./index-CkejuWVZ.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 ce=_("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 de=_("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 ue=_("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"}]]),ge="https://openrouter.ai/settings/keys";function he(n,d){if(n instanceof Q){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:d}const ke=()=>{var D;const{user:n,isLoading:d}=J(),{preferences:U,setHideClosedSourceEvals:$,canPersist:z,isLoading:K}=ee(),{theme:C,setTheme:W}=se(),V=C??"system",r=ne(),[O,j]=c.useState(""),[S,u]=c.useState(""),[F,g]=c.useState(""),[h,P]=c.useState(""),m=te(),p=L({queryKey:["chat","models","settings"],enabled:r&&!!n,queryFn:()=>o.getModels()}),I=new Set((((D=p.data)==null?void 0:D.items)??[]).map(s=>s.provider)),f=I.has("huggingface"),b=I.has("openrouter"),x=L({queryKey:["inference-billing",n==null?void 0:n.hf_subject],enabled:r&&!!n&&f,queryFn:()=>o.getInferenceBilling()}),i=x.data??null,N=le(r&&!!n&&b),M=re(r&&!!n&&b),t=N.data,l=M.data,a=t?oe(t.resets_at):null,G=r&&!!n&&(p.isLoading||!p.isError&&(f&&x.isLoading||b&&(N.isLoading||M.isLoading))),X=d||K||C===void 0||G,A=y({mutationFn:s=>o.selectInferenceBillingAccount(s),onSuccess:s=>{m.setQueryData(["inference-billing",n==null?void 0:n.hf_subject],s),j("")},onError:s=>{j(s instanceof Error?s.message:"Could not change the billing account.")}}),Z=x.isLoading||A.isPending,k=(s,R)=>{u(he(s,R)),g(s instanceof Q?s.code??"":"")},w=y({mutationFn:s=>o.connectOpenRouterCredential(s),onSuccess:s=>{m.setQueryData(E,s),P(""),u(""),g("")},onError:s=>k(s,"Could not connect the OpenRouter key.")}),q=y({mutationFn:s=>o.setOpenRouterFallback(s),onSuccess:s=>{m.setQueryData(E,s),u(""),g("")},onError:s=>k(s,"Could not change paid fallback.")}),T=y({mutationFn:()=>o.disconnectOpenRouterCredential(),onSuccess:()=>{m.setQueryData(E,{connected:!1,verified_at:null,fallback_enabled:!1}),u(""),g("")},onError:s=>k(s,"Could not disconnect the OpenRouter key.")});return c.useEffect(()=>(document.title=ae("Settings"),()=>{document.title=ie}),[]),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."})]})}),X?e.jsx("div",{className:"settings-page-loading",role:"status","aria-live":"polite",children:e.jsx("span",{className:"sr-only",children:"Loading settings…"})}):e.jsxs("div",{className:"settings-page-content",children:[n&&e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Catalog access"}),e.jsx("div",{className:"settings-note settings-note-flush",children:e.jsxs("span",{children:["Role: ",e.jsx("strong",{children:n.role??"community member"}),"."," ",n.can_directly_edit_catalog?"You can apply catalog edits directly. Destructive changes require a recent sign-in.":"Your catalog suggestions are sent to the submissions queue for review.",n.is_admin?" You can also review submissions and use administrative maintenance tools.":" Submission review and maintenance tools remain admin-only."]})})]}),r&&e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Chat usage & billing"}),n?p.isError?e.jsx("div",{className:"settings-billing-loading",role:"alert",children:"Could not load the enabled chat providers."}):e.jsxs("div",{className:"settings-provider-grid",children:[f&&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"})]}),(i==null?void 0:i.connected)&&e.jsx("span",{className:"settings-connected-badge",children:"Connected"})]}),x.isError?e.jsx("div",{className:"settings-billing-loading",role:"alert",children:"Hugging Face billing is currently unavailable."}):i!=null&&i.connected?e.jsxs("div",{className:"settings-billing",children:[e.jsx("div",{className:"settings-row-label",children:i.bill_to?`Organization · ${i.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. Included Hugging Face usage is applied first; pay-as-you-go billing follows 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:i.bill_to??"",onChange:s=>{j(""),A.mutate(s.target.value||null)},disabled:Z,children:[e.jsxs("option",{value:"",children:["Personal account (@",n.username,")"]}),i.organizations.map(s=>e.jsxs("option",{value:s.name,children:[s.display_name," (",s.name,")"]},s.name))]}),O&&e.jsx("div",{className:"settings-token-error",children:O}),e.jsx("div",{className:"settings-billing-actions",children:e.jsxs("a",{className:"button button-primary",href:i.usage_url,target:"_blank",rel:"noreferrer",children:["View Hugging Face usage & billing ",e.jsx(Y,{"aria-hidden":"true"})]})})]}):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(v,{returnTo:"/settings",label:"Re-sign in with Hugging Face",authorizeInference:!0})})]})]}),b&&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."}),t?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 ",a==null?void 0:a.local," ",e.jsxs("span",{"aria-label":"UTC reset time",children:["(",a==null?void 0:a.utc,")"]})]})]}),e.jsx("strong",{children:t.available?`${t.remaining_percent}% left`:"Unavailable"})]}),e.jsx("div",{className:"settings-usage-track",role:"progressbar","aria-label":`${t.remaining_percent}% remaining; resets ${a==null?void 0:a.local}; ${a==null?void 0:a.utc}`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":t.remaining_percent,children:e.jsx("span",{style:{width:`${t.remaining_percent}%`}})}),!t.available&&e.jsxs("p",{className:"settings-limit-note",children:[t.unavailable_reason==="personal_allowance_exhausted"?"Your free monthly allowance is depleted.":`The shared OpenRouter credits are currently unavailable. ${t.remaining_percent}% of your personal allowance remains.`," DeepSeek V4 Flash is temporarily unavailable unless you enable your own key below."]})]}):e.jsx("div",{className:"settings-billing-loading",children:N.isError||t?"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(B,{checked:l.fallback_enabled,disabled:q.isPending,onCheckedChange:s=>q.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:T.isPending,onClick:()=>T.mutate(),children:"Disconnect"}),e.jsxs("a",{className:"button",href:ge,target:"_blank",rel:"noreferrer",children:["Revoke or rotate at OpenRouter ",e.jsx(Y,{"aria-hidden":"true"})]})]})]}):e.jsxs("form",{onSubmit:s=>{s.preventDefault(),h.trim()&&w.mutate(h.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:h,onChange:s=>P(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:!h.trim()||w.isPending,children:w.isPending?"Verifying…":"Connect key"})})]}),S&&e.jsxs("div",{className:"settings-token-error",children:[e.jsx("p",{children:F==="fresh_auth_required"?"Your account is signed in, but adding or enabling an API key requires a Hugging Face sign-in from the last 15 minutes.":S}),F==="fresh_auth_required"&&e.jsx("div",{className:"settings-billing-actions",children:e.jsx(v,{returnTo:"/settings#openrouter-byok",label:"Re-authenticate with Hugging Face"})})]})]})]})]}):e.jsxs("div",{className:"settings-note settings-note-flush",children:[e.jsx("span",{children:"Sign in to manage billing and credentials for the enabled chat providers."}),e.jsx("div",{className:"settings-note-action",children:e.jsx(v,{returnTo:"/settings",authorizeInference:!0})})]})]}),r&&e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Chat privacy & retention"}),e.jsx("div",{className:"settings-note settings-note-flush",children:e.jsx("span",{children:"Chats are private and retained until you delete them. You can keep up to 100 active chats and 100 MB of chat data. Archiving removes chats from the active list and frees active-chat quota, but does not delete them. Deleting a chat permanently removes its durable transcript, workspace reference, and any public share link after deletion is verified. You can deliberately share an unlisted snapshot, but no dedicated private-chat export format is currently offered."})})]}),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:ce},{value:"light",label:"Light",description:"Always use light mode",icon:ue},{value:"dark",label:"Dark",description:"Always use dark mode",icon:de}].map(s=>{const R=s.icon,H=V===s.value;return e.jsxs("button",{type:"button",className:`theme-option ${H?"is-selected":""}`,"aria-pressed":H,onClick:()=>W(s.value),children:[e.jsx(R,{"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(B,{id:"hide-closed-source-evals",checked:U.hide_closed_source_evals,onCheckedChange:s=>{$(!!s)}})]}),!d&&!z&&!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(v,{returnTo:"/settings"})})]})]})]})]})};export{ke as default};
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/SettingsView-BlQLj0GR.js ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import{d as _,y as ee,f as se,ah as ne,i as te,z as c,g as ae,j as e,a1 as v,A as Q}from"./index-B5X8-Bq7.js";import{u as L}from"./useQuery-D05r-Fqo.js";import{u as y}from"./useMutation-jhc4sxTL.js";import{S as B}from"./switch-_WgpuwTB.js";import{c as r}from"./chat-C6rpOyOn.js";import{f as ie,D as le}from"./latexPlainText-DI8YEXVe.js";import{a as oe,u as re,r as ce,O as C}from"./openrouter-Ckakows2.js";import{E as Y}from"./external-link-C6re1H68.js";import"./index-DxIJV7Rp.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 de=_("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 ue=_("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 ge=_("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"}]]),he="https://openrouter.ai/settings/keys";function me(n,d){if(n instanceof Q){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:d}const we=()=>{var T;const{user:n,isLoading:d}=ee(),{preferences:U,setHideClosedSourceEvals:$,canPersist:W,isLoading:z}=se(),{theme:O,setTheme:K}=ne(),V=O??"system",o=te(),[S,j]=c.useState(""),[P,u]=c.useState(""),[F,g]=c.useState(""),[h,I]=c.useState(""),m=ae(),p=L({queryKey:["chat","models","settings"],enabled:o&&!!n,queryFn:()=>r.getModels()}),f=new Set((((T=p.data)==null?void 0:T.items)??[]).map(s=>s.provider)),N=f.has("huggingface"),b=f.has("openrouter"),G=f.has("openai"),x=L({queryKey:["inference-billing",n==null?void 0:n.hf_subject],enabled:o&&!!n&&N,queryFn:()=>r.getInferenceBilling()}),i=x.data??null,k=oe(o&&!!n&&b),A=re(o&&!!n&&b),t=k.data,l=A.data,a=t?ce(t.resets_at):null,X=o&&!!n&&(p.isLoading||!p.isError&&(N&&x.isLoading||b&&(k.isLoading||A.isLoading))),Z=d||z||O===void 0||X,M=y({mutationFn:s=>r.selectInferenceBillingAccount(s),onSuccess:s=>{m.setQueryData(["inference-billing",n==null?void 0:n.hf_subject],s),j("")},onError:s=>{j(s instanceof Error?s.message:"Could not change the billing account.")}}),J=x.isLoading||M.isPending,w=(s,E)=>{u(me(s,E)),g(s instanceof Q?s.code??"":"")},R=y({mutationFn:s=>r.connectOpenRouterCredential(s),onSuccess:s=>{m.setQueryData(C,s),I(""),u(""),g("")},onError:s=>w(s,"Could not connect the OpenRouter key.")}),q=y({mutationFn:s=>r.setOpenRouterFallback(s),onSuccess:s=>{m.setQueryData(C,s),u(""),g("")},onError:s=>w(s,"Could not change paid fallback.")}),D=y({mutationFn:()=>r.disconnectOpenRouterCredential(),onSuccess:()=>{m.setQueryData(C,{connected:!1,verified_at:null,fallback_enabled:!1}),u(""),g("")},onError:s=>w(s,"Could not disconnect the OpenRouter key.")});return c.useEffect(()=>(document.title=ie("Settings"),()=>{document.title=le}),[]),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."})]})}),Z?e.jsx("div",{className:"settings-page-loading",role:"status","aria-live":"polite",children:e.jsx("span",{className:"sr-only",children:"Loading settings…"})}):e.jsxs("div",{className:"settings-page-content",children:[n&&e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Catalog access"}),e.jsx("div",{className:"settings-note settings-note-flush",children:e.jsxs("span",{children:["Role: ",e.jsx("strong",{children:n.role??"community member"}),"."," ",n.can_directly_edit_catalog?"You can apply catalog edits directly. Destructive changes require a recent sign-in.":"Your catalog suggestions are sent to the submissions queue for review.",n.is_admin?" You can also review submissions and use administrative maintenance tools.":" Submission review and maintenance tools remain admin-only."]})})]}),o&&e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Chat usage & billing"}),n?p.isError?e.jsx("div",{className:"settings-billing-loading",role:"alert",children:"Could not load the enabled chat providers."}):e.jsxs("div",{className:"settings-provider-grid",children:[N&&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"})]}),(i==null?void 0:i.connected)&&e.jsx("span",{className:"settings-connected-badge",children:"Connected"})]}),x.isError?e.jsx("div",{className:"settings-billing-loading",role:"alert",children:"Hugging Face billing is currently unavailable."}):i!=null&&i.connected?e.jsxs("div",{className:"settings-billing",children:[e.jsx("div",{className:"settings-row-label",children:i.bill_to?`Organization · ${i.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. Included Hugging Face usage is applied first; pay-as-you-go billing follows 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:i.bill_to??"",onChange:s=>{j(""),M.mutate(s.target.value||null)},disabled:J,children:[e.jsxs("option",{value:"",children:["Personal account (@",n.username,")"]}),i.organizations.map(s=>e.jsxs("option",{value:s.name,children:[s.display_name," (",s.name,")"]},s.name))]}),S&&e.jsx("div",{className:"settings-token-error",children:S}),e.jsx("div",{className:"settings-billing-actions",children:e.jsxs("a",{className:"button button-primary",href:i.usage_url,target:"_blank",rel:"noreferrer",children:["View Hugging Face usage & billing ",e.jsx(Y,{"aria-hidden":"true"})]})})]}):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(v,{returnTo:"/settings",label:"Re-sign in with Hugging Face",authorizeInference:!0})})]})]}),b&&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."}),t?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 ",a==null?void 0:a.local," ",e.jsxs("span",{"aria-label":"UTC reset time",children:["(",a==null?void 0:a.utc,")"]})]})]}),e.jsx("strong",{children:t.available?`${t.remaining_percent}% left`:"Unavailable"})]}),e.jsx("div",{className:"settings-usage-track",role:"progressbar","aria-label":`${t.remaining_percent}% remaining; resets ${a==null?void 0:a.local}; ${a==null?void 0:a.utc}`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":t.remaining_percent,children:e.jsx("span",{style:{width:`${t.remaining_percent}%`}})}),!t.available&&e.jsxs("p",{className:"settings-limit-note",children:[t.unavailable_reason==="personal_allowance_exhausted"?"Your free monthly allowance is depleted.":`The shared OpenRouter credits are currently unavailable. ${t.remaining_percent}% of your personal allowance remains.`," DeepSeek V4 Flash is temporarily unavailable unless you enable your own key below."]})]}):e.jsx("div",{className:"settings-billing-loading",children:k.isError||t?"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(B,{checked:l.fallback_enabled,disabled:q.isPending,onCheckedChange:s=>q.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:D.isPending,onClick:()=>D.mutate(),children:"Disconnect"}),e.jsxs("a",{className:"button",href:he,target:"_blank",rel:"noreferrer",children:["Revoke or rotate at OpenRouter ",e.jsx(Y,{"aria-hidden":"true"})]})]})]}):e.jsxs("form",{onSubmit:s=>{s.preventDefault(),h.trim()&&R.mutate(h.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:h,onChange:s=>I(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:!h.trim()||R.isPending,children:R.isPending?"Verifying…":"Connect key"})})]}),P&&e.jsxs("div",{className:"settings-token-error",children:[e.jsx("p",{children:F==="fresh_auth_required"?"Your account is signed in, but adding or enabling an API key requires a Hugging Face sign-in from the last 15 minutes.":P}),F==="fresh_auth_required"&&e.jsx("div",{className:"settings-billing-actions",children:e.jsx(v,{returnTo:"/settings#openrouter-byok",label:"Re-authenticate with Hugging Face"})})]})]})]}),G&&e.jsx("div",{className:"settings-note settings-note-flush",role:"note",children:"Direct OpenAI usage is provided by Papers With Code. No OpenAI API key or billing account is required from you."})]}):e.jsxs("div",{className:"settings-note settings-note-flush",children:[e.jsx("span",{children:"Sign in to manage billing and credentials for the enabled chat providers."}),e.jsx("div",{className:"settings-note-action",children:e.jsx(v,{returnTo:"/settings",authorizeInference:!0})})]})]}),o&&e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Chat privacy & retention"}),e.jsx("div",{className:"settings-note settings-note-flush",children:e.jsx("span",{children:"Chats are private and retained until you delete them. You can keep up to 100 active chats and 100 MB of chat data. Archiving removes chats from the active list and frees active-chat quota, but does not delete them. Deleting a chat permanently removes its durable transcript, workspace reference, and any public share link after deletion is verified. You can deliberately share an unlisted snapshot, but no dedicated private-chat export format is currently offered."})})]}),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:de},{value:"light",label:"Light",description:"Always use light mode",icon:ge},{value:"dark",label:"Dark",description:"Always use dark mode",icon:ue}].map(s=>{const E=s.icon,H=V===s.value;return e.jsxs("button",{type:"button",className:`theme-option ${H?"is-selected":""}`,"aria-pressed":H,onClick:()=>K(s.value),children:[e.jsx(E,{"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(B,{id:"hide-closed-source-evals",checked:U.hide_closed_source_evals,onCheckedChange:s=>{$(!!s)}})]}),!d&&!W&&!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(v,{returnTo:"/settings"})})]})]})]})]})};export{we as default};
assets/SharedChatView-DBR6M8tZ.js DELETED
@@ -1 +0,0 @@
1
- import{c as f,u as x,r as h,j as e,b as g}from"./index-DpqMFKEJ.js";import{u as v}from"./useQuery-BRJ3D8WJ.js";import{A as j,a as b,C as y,U as S,b as k}from"./ArtifactWorkspace-B2_NF1H2.js";import{C as m,d as w,p as N,q as C,g as q}from"./chatSessions-VGVoLTuT.js";import"./katex.min-BSBacQyE.js";import"./hover-card-K79gJfh7.js";import"./github-BRCZ4EHw.js";import"./github-DWbj5_NN.js";import"./PaperPreviewLink-Da7TZ3ij.js";import"./index-DYz3ynl3.js";import"./papers-inj3gJs3.js";import"./chat-BrAdjM-f.js";import"./file-text-Ce3hOAur.js";import"./external-link-CU5Ded46.js";import"./chevron-down-CAjIY4ok.js";const E=({detail:i})=>{const[c,l]=h.useState(()=>N(i)),p=h.useMemo(()=>{const t={};for(const d of c)for(const n of d.blocks??[])if(n.kind==="tool")for(const a of n.results??[])t[a.route_id]=a;return t},[c]),u=(t,d)=>{l(n=>n.map(a=>{var s;return a.id!==t?a:{...a,blocks:(s=a.blocks)==null?void 0:s.map((r,o)=>o===d&&(r.kind==="reasoning"||r.kind==="tool")?{...r,open:!r.open}:r)}}))};return e.jsx("div",{className:"shared-chat-transcript",children:c.map(t=>t.role==="user"?e.jsx(S,{id:t.id,text:t.text??"",paperMentions:t.paperMentions??[],paperSelection:t.paperSelection},t.id):e.jsx(k,{msg:t,papers:p,onToggleBlock:u},t.id))})},z=()=>{const{shareId:i=""}=f(),c=x(),l=g(),[p,u]=h.useState(60),t=v({queryKey:["shared-chat",i],queryFn:()=>q(i),retry:(a,s)=>!(s instanceof m&&s.status===404)&&a<1});h.useEffect(()=>{const a=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=a,s?s.content=r??"":o.remove()}},[]),h.useLayoutEffect(()=>{const a=document.querySelector(".app-header");if(!a)return;const s=()=>u(a.offsetHeight);s();const r=new ResizeObserver(s);return r.observe(a),()=>r.disconnect()},[]);const d=a=>{C(a,void 0,{autoSend:!1}),c("/chat")},n=t.error instanceof m&&t.error.status===404;return t.isLoading?e.jsxs("div",{className:"shared-chat-state",role:"status",children:[e.jsx(w,{})," Loading shared conversation…"]}):n?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."})]}):t.isError||!t.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 t.refetch(),children:"Try again"})]}):e.jsx(j,{workspaceKey:`share:${i}:${t.data.updated_at}`,autoOpenOnMount:!0,children:e.jsxs("div",{className:"shared-chat-page",style:{height:`calc(100dvh - ${p}px)`},children:[e.jsxs("div",{className:"shared-chat-heading",children:[e.jsx("h1",{children:"Shared conversation"}),l&&e.jsx("span",{className:"chat-staging-badge",children:"Staging"})]}),e.jsx(b,{variant:"shared",children:e.jsxs("div",{className:"shared-chat-content","data-testid":"shared-conversation-pane",children:[e.jsx(E,{detail:t.data},t.data.updated_at),t.data.model_label&&e.jsxs("div",{className:"shared-chat-attribution",children:[e.jsxs("span",{children:["Generated with ",t.data.model_label]}),t.data.model_provider==="huggingface"&&e.jsxs("span",{children:["Powered by ",e.jsx("span",{"aria-hidden":"true",children:"🤗"})," ",e.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"})]}),t.data.model_provider==="openai"&&e.jsx("span",{children:"Powered by OpenAI"})]}),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."}),l&&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."]}),e.jsx(y,{onSend:a=>d(a.text),placeholder:"Ask a new research question…"})]})]})})]})})};export{z as default};
 
 
assets/SharedChatView-Vy1twM5R.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{c as f,u as x,r as h,j as e,b as g}from"./index-B5X8-Bq7.js";import{u as v}from"./useQuery-D05r-Fqo.js";import{A as j,a as b,C as y,U as S,b as k}from"./ArtifactWorkspace-CTFG-tNc.js";import{C as m,d as w,p as N,q as C,g as q}from"./chatLaunch-BYshi3Oy.js";import"./katex.min-BSBacQyE.js";import"./hover-card-ClPcsbgj.js";import"./github-BF4mMFfY.js";import"./github-GWy166ov.js";import"./PaperPreviewLink-Br9pyKgi.js";import"./index-LVXoOqbx.js";import"./papers-D7y8njf2.js";import"./chat-C6rpOyOn.js";import"./file-text-DMqoegbt.js";import"./external-link-C6re1H68.js";import"./chevron-down-RoGVatuo.js";const _=({detail:i})=>{const[d,l]=h.useState(()=>N(i)),p=h.useMemo(()=>{const t={};for(const c of d)for(const n of c.blocks??[])if(n.kind==="tool")for(const r of n.results??[])t[r.route_id]=r;return t},[d]),u=(t,c)=>{l(n=>n.map(r=>{var a;return r.id!==t?r:{...r,blocks:(a=r.blocks)==null?void 0:a.map((s,o)=>o===c&&(s.kind==="reasoning"||s.kind==="tool")?{...s,open:!s.open}:s)}}))};return e.jsx("div",{className:"shared-chat-transcript",children:d.map(t=>t.role==="user"?e.jsx(S,{id:t.id,text:t.text??"",paperMentions:t.paperMentions??[],paperSelection:t.paperSelection},t.id):e.jsx(k,{msg:t,papers:p,onToggleBlock:u},t.id))})},z=()=>{const{shareId:i=""}=f(),d=x(),l=g(),[p,u]=h.useState(60),t=v({queryKey:["shared-chat",i],queryFn:()=>q(i),retry:(r,a)=>!(a instanceof m&&a.status===404)&&r<1});h.useEffect(()=>{const r=document.title,a=document.head.querySelector('meta[name="robots"]'),s=a==null?void 0:a.content,o=a??document.createElement("meta");return o.name="robots",o.content="noindex,nofollow",a||document.head.appendChild(o),document.title="Shared conversation",()=>{document.title=r,a?a.content=s??"":o.remove()}},[]),h.useLayoutEffect(()=>{const r=document.querySelector(".app-header");if(!r)return;const a=()=>u(r.offsetHeight);a();const s=new ResizeObserver(a);return s.observe(r),()=>s.disconnect()},[]);const c=r=>{C(r,void 0,{autoSend:!1}),d("/chat")},n=t.error instanceof m&&t.error.status===404;return t.isLoading?e.jsxs("div",{className:"shared-chat-state",role:"status",children:[e.jsx(w,{})," Loading shared conversation…"]}):n?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."})]}):t.isError||!t.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 t.refetch(),children:"Try again"})]}):e.jsx(j,{workspaceKey:`share:${i}:${t.data.updated_at}`,autoOpenOnMount:!0,children:e.jsxs("div",{className:"shared-chat-page",style:{height:`calc(100dvh - ${p}px)`},children:[e.jsxs("div",{className:"shared-chat-heading",children:[e.jsx("h1",{children:"Shared conversation"}),l&&e.jsx("span",{className:"chat-staging-badge",children:"Staging"})]}),e.jsx(b,{variant:"shared",children:e.jsxs("div",{className:"shared-chat-content","data-testid":"shared-conversation-pane",children:[e.jsx(_,{detail:t.data},t.data.updated_at),t.data.model_label&&e.jsxs("div",{className:"shared-chat-attribution",children:[e.jsxs("span",{children:["Generated with ",t.data.model_label]}),t.data.model_provider==="huggingface"&&e.jsxs("span",{children:["Powered by ",e.jsx("span",{"aria-hidden":"true",children:"🤗"})," ",e.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"})]}),t.data.model_provider==="openrouter"&&e.jsxs("span",{children:["Powered by ",e.jsx("a",{href:"https://openrouter.ai",target:"_blank",rel:"noreferrer",children:"OpenRouter"})]}),t.data.model_provider==="openai"&&e.jsx("span",{children:"Powered by OpenAI"})]}),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."}),l&&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."]}),e.jsx(y,{onSend:r=>c(r.text),placeholder:"Ask a new research question…"})]})]})})]})})};export{z as default};
assets/{SignInToEditDialog-_xlmZxOT.js → SignInToEditDialog-C_4kkM3M.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{d as ne,r as a,j as e,$ as ve,q as be,a0 as fe,e as je,X as ye,C as Ne,a1 as we}from"./index-DpqMFKEJ.js";import{B as L}from"./button-CpZL29fe.js";import{I as d,T as Ie}from"./textarea-BA4c3aP6.js";import{D as oe,a as le,b as ce,c as de,d as me,e as Se}from"./dialog-DW3Uw8Zv.js";import{u as _e}from"./useMutation-BFwg1MYO.js";import{s as v,p as b}from"./submissions-B8Kj7oPp.js";import{L as De}from"./loader-circle-CEEZZR71.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{d as ne,r as a,j as e,$ as ve,q as be,a0 as fe,e as je,X as ye,C as Ne,a1 as we}from"./index-B5X8-Bq7.js";import{B as L}from"./button-cqkU__aM.js";import{I as d,T as Ie}from"./textarea-Bw7gV3w2.js";import{D as oe,a as le,b as ce,c as de,d as me,e as Se}from"./dialog-DQCWceSF.js";import{u as _e}from"./useMutation-jhc4sxTL.js";import{s as v,p as b}from"./submissions-CUbxi_j0.js";import{L as De}from"./loader-circle-QH8Jsx5e.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{StagingAccessRequestView-JX-LFM7Z.js → StagingAccessRequestView-5OEGxopb.js} RENAMED
@@ -1 +1 @@
1
- import{y as m,z as a,j as e,a1 as g,aJ as p}from"./index-DpqMFKEJ.js";import{C as j}from"./circle-check-CNWaDe-t.js";const f=()=>{const{user:s,isLoading:u}=m(),[l,d]=a.useState(!1),[r,t]=a.useState(!1),[c,i]=a.useState(null),o=async h=>{h.preventDefault(),t(!0),i(null);try{await p.requestStagingAccess(),d(!0)}catch(n){i(n instanceof Error?n.message:"Could not submit your request.")}finally{t(!1)}};return e.jsx("main",{className:"access-request-page",children:e.jsxs("section",{className:"access-request-card","aria-labelledby":"access-request-title",children:[e.jsxs("a",{className:"access-request-brand",href:"https://paperswithcode.co",children:[e.jsx("span",{className:"brand-mark","aria-hidden":"true"}),e.jsxs("span",{className:"brand-name",children:["Papers ",e.jsx("em",{children:"with"})," Code"]})]}),l?e.jsxs("div",{className:"access-request-success",role:"status",children:[e.jsx(j,{size:34,strokeWidth:1.6,"aria-hidden":"true"}),e.jsx("h1",{id:"access-request-title",children:"Request received"}),e.jsxs("p",{children:["Thanks, @",s==null?void 0:s.username,". We’ll review your contributor access request."]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"access-request-heading",children:[e.jsx("p",{className:"access-request-eyebrow",children:"Staging preview"}),e.jsx("h1",{id:"access-request-title",children:"Request access"}),e.jsx("p",{children:"This preview is limited to project contributors. Send us your verified Hugging Face username and email address to request access."})]}),u?e.jsx("p",{className:"access-request-status",role:"status",children:"Checking your Hugging Face account…"}):s?e.jsxs("form",{className:"access-request-form",onSubmit:o,children:[e.jsx("label",{htmlFor:"hf-username",children:"Hugging Face username"}),e.jsxs("div",{className:"access-request-input-wrap",children:[e.jsx("span",{"aria-hidden":"true",children:"@"}),e.jsx("input",{id:"hf-username",name:"hf_username",value:s.username,readOnly:!0,autoComplete:"username"})]}),e.jsxs("p",{className:"access-request-verified",children:["Username and email verified through Hugging Face sign-in. See our"," ",e.jsx("a",{href:"https://paperswithcode.co/privacy",children:"Privacy Policy"}),"."]}),c&&e.jsx("p",{className:"access-request-error",role:"alert",children:c}),e.jsx("button",{className:"access-request-submit",type:"submit",disabled:r,children:r?"Sending…":"Request access"})]}):e.jsxs("div",{className:"access-request-signin",children:[e.jsx("p",{children:"Sign in first so we can verify the account you’re requesting access for."}),e.jsx(g,{returnTo:"/request-access",label:"Sign in with Hugging Face",collectEmail:!0})]})]})]})})};export{f as default};
 
1
+ import{y as m,z as a,j as e,a1 as g,aJ as p}from"./index-B5X8-Bq7.js";import{C as j}from"./circle-check-B1NcY31m.js";const f=()=>{const{user:s,isLoading:u}=m(),[l,d]=a.useState(!1),[r,t]=a.useState(!1),[c,i]=a.useState(null),o=async h=>{h.preventDefault(),t(!0),i(null);try{await p.requestStagingAccess(),d(!0)}catch(n){i(n instanceof Error?n.message:"Could not submit your request.")}finally{t(!1)}};return e.jsx("main",{className:"access-request-page",children:e.jsxs("section",{className:"access-request-card","aria-labelledby":"access-request-title",children:[e.jsxs("a",{className:"access-request-brand",href:"https://paperswithcode.co",children:[e.jsx("span",{className:"brand-mark","aria-hidden":"true"}),e.jsxs("span",{className:"brand-name",children:["Papers ",e.jsx("em",{children:"with"})," Code"]})]}),l?e.jsxs("div",{className:"access-request-success",role:"status",children:[e.jsx(j,{size:34,strokeWidth:1.6,"aria-hidden":"true"}),e.jsx("h1",{id:"access-request-title",children:"Request received"}),e.jsxs("p",{children:["Thanks, @",s==null?void 0:s.username,". We’ll review your contributor access request."]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"access-request-heading",children:[e.jsx("p",{className:"access-request-eyebrow",children:"Staging preview"}),e.jsx("h1",{id:"access-request-title",children:"Request access"}),e.jsx("p",{children:"This preview is limited to project contributors. Send us your verified Hugging Face username and email address to request access."})]}),u?e.jsx("p",{className:"access-request-status",role:"status",children:"Checking your Hugging Face account…"}):s?e.jsxs("form",{className:"access-request-form",onSubmit:o,children:[e.jsx("label",{htmlFor:"hf-username",children:"Hugging Face username"}),e.jsxs("div",{className:"access-request-input-wrap",children:[e.jsx("span",{"aria-hidden":"true",children:"@"}),e.jsx("input",{id:"hf-username",name:"hf_username",value:s.username,readOnly:!0,autoComplete:"username"})]}),e.jsxs("p",{className:"access-request-verified",children:["Username and email verified through Hugging Face sign-in. See our"," ",e.jsx("a",{href:"https://paperswithcode.co/privacy",children:"Privacy Policy"}),"."]}),c&&e.jsx("p",{className:"access-request-error",role:"alert",children:c}),e.jsx("button",{className:"access-request-submit",type:"submit",disabled:r,children:r?"Sending…":"Request access"})]}):e.jsxs("div",{className:"access-request-signin",children:[e.jsx("p",{children:"Sign in first so we can verify the account you’re requesting access for."}),e.jsx(g,{returnTo:"/request-access",label:"Sign in with Hugging Face",collectEmail:!0})]})]})]})})};export{f as default};
assets/{SubmissionsDashboard-DMXG-tvg.js → SubmissionsDashboard-CRG-ldyo.js} RENAMED
@@ -1,4 +1,4 @@
1
- var be=s=>{throw TypeError(s)};var ee=(s,t,i)=>t.has(s)||be("Cannot "+i);var f=(s,t,i)=>(ee(s,t,"read from private field"),i?i.call(s):t.get(s)),R=(s,t,i)=>t.has(s)?be("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,i),k=(s,t,i,n)=>(ee(s,t,"write to private field"),n?n.call(s,i):t.set(s,i),i),O=(s,t,i)=>(ee(s,t,"access private method"),i);import{am as Ce,an as te,ao as Re,ap as Oe,g as Ne,r as z,aq as Me,d as qe,j as e,M as Ae,z as w,q as I,y as Te,e as ke,ar as Fe,as as Ie,at as Qe}from"./index-DpqMFKEJ.js";import{Q as we,b as Le,c as Ue,e as De,d as $e,f as ze,s as ge,g as Be,h as He,u as ie}from"./useQuery-BRJ3D8WJ.js";import{u as xe}from"./useMutation-BFwg1MYO.js";import{c as Q}from"./catalog-CNSpmU4d.js";import{s as $}from"./safeExternalHref-CkBrsh84.js";import{p as Ke}from"./papers-inj3gJs3.js";import{s as H}from"./submissions-B8Kj7oPp.js";import{R as Pe,S as Je,C as Ge}from"./shield-alert-CZXx3Eq7.js";import{L as K}from"./loader-circle-CEEZZR71.js";import{C as Ve}from"./circle-check-CNWaDe-t.js";function je(s,t){const i=new Set(t);return s.filter(n=>!i.has(n))}function We(s,t,i){const n=s.slice(0);return n[t]=i,n}var U,E,D,L,C,F,P,J,G,V,N,ne,re,Se,ae,oe,le,_e,Ye=(_e=class extends Ce{constructor(t,i,n){super();R(this,N);R(this,U);R(this,E);R(this,D);R(this,L);R(this,C);R(this,F);R(this,P);R(this,J);R(this,G);R(this,V,[]);k(this,U,t),k(this,L,n),k(this,D,[]),k(this,C,[]),k(this,E,[]),this.setQueries(i)}onSubscribe(){this.listeners.size===1&&f(this,C).forEach(t=>{t.subscribe(i=>{O(this,N,oe).call(this,t,i)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,f(this,C).forEach(t=>{t.destroy()})}setQueries(t,i){k(this,D,t),k(this,L,i),te.batch(()=>{const n=f(this,C),a=O(this,N,ae).call(this,f(this,D));a.forEach(r=>r.observer.setOptions(r.defaultedQueryOptions));const l=a.map(r=>r.observer),o=l.map(r=>r.getCurrentResult()),d=n.length!==l.length,p=l.some((r,m)=>r!==n[m]),b=d||p,x=b?!0:o.some((r,m)=>{const c=f(this,E)[m];return!c||!Re(r,c)});!b&&!x||(b&&(k(this,V,a),k(this,C,l)),k(this,E,o),this.hasListeners()&&(b&&(je(n,l).forEach(r=>{r.destroy()}),je(l,n).forEach(r=>{r.subscribe(m=>{O(this,N,oe).call(this,r,m)})})),O(this,N,le).call(this)))})}getCurrentResult(){return f(this,E)}getQueries(){return f(this,C).map(t=>t.getCurrentQuery())}getObservers(){return f(this,C)}getOptimisticResult(t,i){const n=O(this,N,ae).call(this,t),a=n.map(o=>o.observer.getOptimisticResult(o.defaultedQueryOptions)),l=n.map(o=>o.defaultedQueryOptions.queryHash);return[a,o=>O(this,N,re).call(this,o??a,i,l),()=>O(this,N,ne).call(this,a,n)]}},U=new WeakMap,E=new WeakMap,D=new WeakMap,L=new WeakMap,C=new WeakMap,F=new WeakMap,P=new WeakMap,J=new WeakMap,G=new WeakMap,V=new WeakMap,N=new WeakSet,ne=function(t,i){return i.map((n,a)=>{const l=t[a];return n.defaultedQueryOptions.notifyOnChangeProps?l:n.observer.trackResult(l,o=>{i.forEach(d=>{d.observer.trackProp(o)})})})},re=function(t,i,n){if(i){const a=f(this,G),l=n!==void 0&&a!==void 0&&(a.length!==n.length||n.some((o,d)=>o!==a[d]));return(!f(this,F)||f(this,E)!==f(this,J)||l||i!==f(this,P))&&(k(this,P,i),k(this,J,f(this,E)),n!==void 0&&k(this,G,n),k(this,F,Oe(f(this,F),i(t)))),f(this,F)}return t},Se=function(){var t;return((t=f(this,L))==null?void 0:t.combine)!==void 0&&f(this,C).some((i,n)=>{var a;return i.options.suspense&&((a=f(this,E)[n])==null?void 0:a.data)===void 0})},ae=function(t){const i=new Map;f(this,C).forEach(a=>{const l=a.options.queryHash;if(!l)return;const o=i.get(l);o?o.push(a):i.set(l,[a])});const n=[];return t.forEach(a=>{var p;const l=f(this,U).defaultQueryOptions(a),d=((p=i.get(l.queryHash))==null?void 0:p.shift())??new we(f(this,U),l);n.push({defaultedQueryOptions:l,observer:d})}),n},oe=function(t,i){const n=f(this,C).indexOf(t);n!==-1&&(k(this,E,We(f(this,E),n,i)),O(this,N,le).call(this))},le=function(){var t;if(this.hasListeners()){const i=O(this,N,ne).call(this,f(this,E),f(this,V)),n=O(this,N,Se).call(this),a=f(this,F),l=n?a:O(this,N,re).call(this,i,(t=f(this,L))==null?void 0:t.combine);(n||a!==l)&&te.batch(()=>{this.listeners.forEach(o=>{o(f(this,E))})})}},_e);function X({queries:s,...t},i){const n=Ne(),a=Le(),l=Ue(),o=z.useMemo(()=>s.map(u=>{const j=n.defaultQueryOptions(u);return j._optimisticResults=a?"isRestoring":"optimistic",j}),[s,n,a]);o.forEach(u=>{De(u);const j=n.getQueryCache().get(u.queryHash);$e(u,l,j)}),ze(l);const[d]=z.useState(()=>new Ye(n,o,t)),[p,b,x]=d.getOptimisticResult(o,t.combine),r=!a&&t.subscribed!==!1;z.useSyncExternalStore(z.useCallback(u=>r?d.subscribe(te.batchCalls(u)):Me,[d,r]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),z.useEffect(()=>{d.setQueries(o,t)},[o,t,d]);const c=p.some((u,j)=>ge(o[j],u))?p.flatMap((u,j)=>{const S=o[j];if(S&&ge(S,u)){const M=new we(n,S);return Be(S,M,l)}return[]}):[];if(c.length>0)throw Promise.all(c);const h=p.find((u,j)=>{const S=o[j];return S&&He({result:u,errorResetBoundary:l,throwOnError:S.throwOnError,query:n.getQueryCache().get(S.queryHash),suspense:S.suspense})});if(h!=null&&h.error)throw h.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 be=s=>{throw TypeError(s)};var ee=(s,t,i)=>t.has(s)||be("Cannot "+i);var f=(s,t,i)=>(ee(s,t,"read from private field"),i?i.call(s):t.get(s)),R=(s,t,i)=>t.has(s)?be("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,i),k=(s,t,i,n)=>(ee(s,t,"write to private field"),n?n.call(s,i):t.set(s,i),i),O=(s,t,i)=>(ee(s,t,"access private method"),i);import{am as Ce,an as te,ao as Re,ap as Oe,g as Ne,r as z,aq as Me,d as qe,j as e,M as Ae,z as w,q as I,y as Te,e as ke,ar as Fe,as as Ie,at as Qe}from"./index-B5X8-Bq7.js";import{Q as we,b as Le,c as Ue,e as De,d as $e,f as ze,s as ge,g as Be,h as He,u as ie}from"./useQuery-D05r-Fqo.js";import{u as xe}from"./useMutation-jhc4sxTL.js";import{c as Q}from"./catalog-Cpdj6dI_.js";import{s as $}from"./safeExternalHref-CkBrsh84.js";import{p as Ke}from"./papers-D7y8njf2.js";import{s as H}from"./submissions-CUbxi_j0.js";import{R as Pe,S as Je,C as Ge}from"./shield-alert-DgHxtlyZ.js";import{L as K}from"./loader-circle-QH8Jsx5e.js";import{C as Ve}from"./circle-check-B1NcY31m.js";function je(s,t){const i=new Set(t);return s.filter(n=>!i.has(n))}function We(s,t,i){const n=s.slice(0);return n[t]=i,n}var U,E,D,L,C,F,P,J,G,V,N,ne,re,Se,ae,oe,le,_e,Ye=(_e=class extends Ce{constructor(t,i,n){super();R(this,N);R(this,U);R(this,E);R(this,D);R(this,L);R(this,C);R(this,F);R(this,P);R(this,J);R(this,G);R(this,V,[]);k(this,U,t),k(this,L,n),k(this,D,[]),k(this,C,[]),k(this,E,[]),this.setQueries(i)}onSubscribe(){this.listeners.size===1&&f(this,C).forEach(t=>{t.subscribe(i=>{O(this,N,oe).call(this,t,i)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,f(this,C).forEach(t=>{t.destroy()})}setQueries(t,i){k(this,D,t),k(this,L,i),te.batch(()=>{const n=f(this,C),a=O(this,N,ae).call(this,f(this,D));a.forEach(r=>r.observer.setOptions(r.defaultedQueryOptions));const l=a.map(r=>r.observer),o=l.map(r=>r.getCurrentResult()),d=n.length!==l.length,p=l.some((r,m)=>r!==n[m]),b=d||p,x=b?!0:o.some((r,m)=>{const c=f(this,E)[m];return!c||!Re(r,c)});!b&&!x||(b&&(k(this,V,a),k(this,C,l)),k(this,E,o),this.hasListeners()&&(b&&(je(n,l).forEach(r=>{r.destroy()}),je(l,n).forEach(r=>{r.subscribe(m=>{O(this,N,oe).call(this,r,m)})})),O(this,N,le).call(this)))})}getCurrentResult(){return f(this,E)}getQueries(){return f(this,C).map(t=>t.getCurrentQuery())}getObservers(){return f(this,C)}getOptimisticResult(t,i){const n=O(this,N,ae).call(this,t),a=n.map(o=>o.observer.getOptimisticResult(o.defaultedQueryOptions)),l=n.map(o=>o.defaultedQueryOptions.queryHash);return[a,o=>O(this,N,re).call(this,o??a,i,l),()=>O(this,N,ne).call(this,a,n)]}},U=new WeakMap,E=new WeakMap,D=new WeakMap,L=new WeakMap,C=new WeakMap,F=new WeakMap,P=new WeakMap,J=new WeakMap,G=new WeakMap,V=new WeakMap,N=new WeakSet,ne=function(t,i){return i.map((n,a)=>{const l=t[a];return n.defaultedQueryOptions.notifyOnChangeProps?l:n.observer.trackResult(l,o=>{i.forEach(d=>{d.observer.trackProp(o)})})})},re=function(t,i,n){if(i){const a=f(this,G),l=n!==void 0&&a!==void 0&&(a.length!==n.length||n.some((o,d)=>o!==a[d]));return(!f(this,F)||f(this,E)!==f(this,J)||l||i!==f(this,P))&&(k(this,P,i),k(this,J,f(this,E)),n!==void 0&&k(this,G,n),k(this,F,Oe(f(this,F),i(t)))),f(this,F)}return t},Se=function(){var t;return((t=f(this,L))==null?void 0:t.combine)!==void 0&&f(this,C).some((i,n)=>{var a;return i.options.suspense&&((a=f(this,E)[n])==null?void 0:a.data)===void 0})},ae=function(t){const i=new Map;f(this,C).forEach(a=>{const l=a.options.queryHash;if(!l)return;const o=i.get(l);o?o.push(a):i.set(l,[a])});const n=[];return t.forEach(a=>{var p;const l=f(this,U).defaultQueryOptions(a),d=((p=i.get(l.queryHash))==null?void 0:p.shift())??new we(f(this,U),l);n.push({defaultedQueryOptions:l,observer:d})}),n},oe=function(t,i){const n=f(this,C).indexOf(t);n!==-1&&(k(this,E,We(f(this,E),n,i)),O(this,N,le).call(this))},le=function(){var t;if(this.hasListeners()){const i=O(this,N,ne).call(this,f(this,E),f(this,V)),n=O(this,N,Se).call(this),a=f(this,F),l=n?a:O(this,N,re).call(this,i,(t=f(this,L))==null?void 0:t.combine);(n||a!==l)&&te.batch(()=>{this.listeners.forEach(o=>{o(f(this,E))})})}},_e);function X({queries:s,...t},i){const n=Ne(),a=Le(),l=Ue(),o=z.useMemo(()=>s.map(u=>{const j=n.defaultQueryOptions(u);return j._optimisticResults=a?"isRestoring":"optimistic",j}),[s,n,a]);o.forEach(u=>{De(u);const j=n.getQueryCache().get(u.queryHash);$e(u,l,j)}),ze(l);const[d]=z.useState(()=>new Ye(n,o,t)),[p,b,x]=d.getOptimisticResult(o,t.combine),r=!a&&t.subscribed!==!1;z.useSyncExternalStore(z.useCallback(u=>r?d.subscribe(te.batchCalls(u)):Me,[d,r]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),z.useEffect(()=>{d.setQueries(o,t)},[o,t,d]);const c=p.some((u,j)=>ge(o[j],u))?p.flatMap((u,j)=>{const S=o[j];if(S&&ge(S,u)){const M=new we(n,S);return Be(S,M,l)}return[]}):[];if(c.length>0)throw Promise.all(c);const h=p.find((u,j)=>{const S=o[j];return S&&He({result:u,errorResetBoundary:l,throwOnError:S.throwOnError,query:n.getQueryCache().get(S.queryHash),suspense:S.suspense})});if(h!=null&&h.error)throw h.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-BCARVk42.js → SubmitView-BGHHENZV.js} RENAMED
@@ -1 +1 @@
1
- import{u as D,g as k,e as C,y as E,z as d,j as e,x as z}from"./index-DpqMFKEJ.js";import{u as L}from"./useMutation-BFwg1MYO.js";import{A as F,a as X}from"./alert-C5eNYVhH.js";import{B as _}from"./button-CpZL29fe.js";import{I as g,T as q}from"./textarea-BA4c3aP6.js";import{p as N}from"./papers-inj3gJs3.js";const v="pwc:paper-submit-draft",U=/^\d{4}\.\d{4,5}(v\d+)?$/i,$=/^[a-z-]+(\.[A-Z]{2})?\/\d{7}$/,O=/^https?:\/\/(?:www\.)?arxiv\.org\//i;function A(n){const i=n.trim();return i?U.test(i)||$.test(i)||O.test(i)?"arxiv":/^https?:\/\//i.test(i)?"external":"arxiv":"empty"}function B(n,i){const a=n.trim();if(A(a)==="arxiv")return/^https?:\/\//i.test(a)?{source_url:a}:{arxiv_id:a};const o={source_url:a},l=i.title.trim();l&&(o.title=l);const p=i.abstract.trim();p&&(o.abstract=p);const u=i.authors.split(/[,\n]/).map(m=>m.trim()).filter(Boolean);return u.length>0&&(o.authors=u),i.datePublished&&(o.date_published=i.datePublished),o}function J(n){var a;const i=n;if(!i)return"Submission failed";if(i.response)try{const s=JSON.parse(i.response);if(typeof s.detail=="string")return s.detail;if((a=s.detail)!=null&&a.message)return`${s.detail.message} See ${s.detail.help||"/rate-limits"} for help.`}catch{return i.response}return i.message||"Submission failed"}const Y=()=>{const n=D(),i=k(),{toast:a}=C(),{user:s,isLoading:o}=E(),[l,p]=d.useState(""),[u,m]=d.useState(""),[f,S]=d.useState(""),[x,j]=d.useState(""),[y,w]=d.useState(""),[I,b]=d.useState(null);d.useEffect(()=>{const t=sessionStorage.getItem(v);if(t){sessionStorage.removeItem(v);try{const r=JSON.parse(t);p(r.input??""),m(r.title??""),S(r.abstract??""),j(r.authors??""),w(r.datePublished??"")}catch{}}},[]);const h=A(l),R=h==="external",c=L({mutationFn:t=>N.submit(t),onSuccess:t=>{if(t.pending_review){a({title:"Submission queued for review",description:"No source page was fetched and no catalog row was changed."}),c.reset();return}i.invalidateQueries({queryKey:["papers"],refetchType:"none"}),i.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),i.invalidateQueries({queryKey:["trending-papers"],refetchType:"none"});const r=t.refreshed&&t.created&&t.latest_version;a({title:r?`Paper updated to ${t.latest_version}`:t.created?"Paper submitted":"Paper already indexed",description:r?"Opening the updated paper page…":t.created?"Opening the paper page…":"Opening the existing paper page…"}),t.route_identifier&&n(`/paper/${t.route_identifier}`)},onError:t=>{b(J(t))}}),T=t=>{if(t.preventDefault(),b(null),h==="empty"){b("Enter an arXiv ID or a paper URL to submit.");return}if(!s){sessionStorage.setItem(v,JSON.stringify({input:l,title:u,abstract:f,authors:x,datePublished:y}));const P=z("/api/v1/auth/hf/login");window.location.assign(`${P}?return_to=${encodeURIComponent(window.location.href)}`);return}const r=B(l,{title:u,abstract:f,authors:x,datePublished:y});c.mutate(r)};return e.jsxs("div",{className:"page",style:{maxWidth:720},children:[e.jsx("h1",{className:"detail-title",children:"Submit a paper"}),e.jsxs("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:12,lineHeight:1.55},children:["Index an arXiv paper or propose a non-arXiv paper (blog post, technical report, model release page). External papers enter the submission queue and appear only after review."," ",e.jsx("a",{href:"/rate-limits",children:"Read the submission and rate-limit policy."})]}),e.jsxs("form",{onSubmit:T,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(g,{id:"submit-input",value:l,onChange:t=>p(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:h==="arxiv"?"Detected: arXiv paper — metadata will be fetched automatically.":h==="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."})]}),R&&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(g,{id:"submit-title",value:u,onChange:t=>m(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(q,{id:"submit-abstract",value:f,onChange:t=>S(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(g,{id:"submit-authors",value:x,onChange:t=>j(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(g,{id:"submit-date",type:"date",value:y,onChange:t=>w(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."})]})]}),I&&e.jsx(F,{variant:"destructive",children:e.jsx(X,{children:I})}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[e.jsx(_,{type:"submit",disabled:c.isPending||o,children:o?"Checking sign-in…":c.isPending?"Submitting…":s?"Submit paper":"Sign in to submit"}),e.jsx(_,{type:"button",variant:"outline",onClick:()=>n(-1),disabled:c.isPending,children:"Cancel"})]})]})]})};export{Y as default};
 
1
+ import{u as D,g as k,e as C,y as E,z as d,j as e,x as z}from"./index-B5X8-Bq7.js";import{u as L}from"./useMutation-jhc4sxTL.js";import{A as F,a as X}from"./alert-C4A_tmFK.js";import{B as _}from"./button-cqkU__aM.js";import{I as g,T as q}from"./textarea-Bw7gV3w2.js";import{p as N}from"./papers-D7y8njf2.js";const v="pwc:paper-submit-draft",U=/^\d{4}\.\d{4,5}(v\d+)?$/i,$=/^[a-z-]+(\.[A-Z]{2})?\/\d{7}$/,O=/^https?:\/\/(?:www\.)?arxiv\.org\//i;function A(n){const i=n.trim();return i?U.test(i)||$.test(i)||O.test(i)?"arxiv":/^https?:\/\//i.test(i)?"external":"arxiv":"empty"}function B(n,i){const a=n.trim();if(A(a)==="arxiv")return/^https?:\/\//i.test(a)?{source_url:a}:{arxiv_id:a};const o={source_url:a},l=i.title.trim();l&&(o.title=l);const p=i.abstract.trim();p&&(o.abstract=p);const u=i.authors.split(/[,\n]/).map(m=>m.trim()).filter(Boolean);return u.length>0&&(o.authors=u),i.datePublished&&(o.date_published=i.datePublished),o}function J(n){var a;const i=n;if(!i)return"Submission failed";if(i.response)try{const s=JSON.parse(i.response);if(typeof s.detail=="string")return s.detail;if((a=s.detail)!=null&&a.message)return`${s.detail.message} See ${s.detail.help||"/rate-limits"} for help.`}catch{return i.response}return i.message||"Submission failed"}const Y=()=>{const n=D(),i=k(),{toast:a}=C(),{user:s,isLoading:o}=E(),[l,p]=d.useState(""),[u,m]=d.useState(""),[f,S]=d.useState(""),[x,j]=d.useState(""),[y,w]=d.useState(""),[I,b]=d.useState(null);d.useEffect(()=>{const t=sessionStorage.getItem(v);if(t){sessionStorage.removeItem(v);try{const r=JSON.parse(t);p(r.input??""),m(r.title??""),S(r.abstract??""),j(r.authors??""),w(r.datePublished??"")}catch{}}},[]);const h=A(l),R=h==="external",c=L({mutationFn:t=>N.submit(t),onSuccess:t=>{if(t.pending_review){a({title:"Submission queued for review",description:"No source page was fetched and no catalog row was changed."}),c.reset();return}i.invalidateQueries({queryKey:["papers"],refetchType:"none"}),i.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),i.invalidateQueries({queryKey:["trending-papers"],refetchType:"none"});const r=t.refreshed&&t.created&&t.latest_version;a({title:r?`Paper updated to ${t.latest_version}`:t.created?"Paper submitted":"Paper already indexed",description:r?"Opening the updated paper page…":t.created?"Opening the paper page…":"Opening the existing paper page…"}),t.route_identifier&&n(`/paper/${t.route_identifier}`)},onError:t=>{b(J(t))}}),T=t=>{if(t.preventDefault(),b(null),h==="empty"){b("Enter an arXiv ID or a paper URL to submit.");return}if(!s){sessionStorage.setItem(v,JSON.stringify({input:l,title:u,abstract:f,authors:x,datePublished:y}));const P=z("/api/v1/auth/hf/login");window.location.assign(`${P}?return_to=${encodeURIComponent(window.location.href)}`);return}const r=B(l,{title:u,abstract:f,authors:x,datePublished:y});c.mutate(r)};return e.jsxs("div",{className:"page",style:{maxWidth:720},children:[e.jsx("h1",{className:"detail-title",children:"Submit a paper"}),e.jsxs("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:12,lineHeight:1.55},children:["Index an arXiv paper or propose a non-arXiv paper (blog post, technical report, model release page). External papers enter the submission queue and appear only after review."," ",e.jsx("a",{href:"/rate-limits",children:"Read the submission and rate-limit policy."})]}),e.jsxs("form",{onSubmit:T,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(g,{id:"submit-input",value:l,onChange:t=>p(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:h==="arxiv"?"Detected: arXiv paper — metadata will be fetched automatically.":h==="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."})]}),R&&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(g,{id:"submit-title",value:u,onChange:t=>m(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(q,{id:"submit-abstract",value:f,onChange:t=>S(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(g,{id:"submit-authors",value:x,onChange:t=>j(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(g,{id:"submit-date",type:"date",value:y,onChange:t=>w(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."})]})]}),I&&e.jsx(F,{variant:"destructive",children:e.jsx(X,{children:I})}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[e.jsx(_,{type:"submit",disabled:c.isPending||o,children:o?"Checking sign-in…":c.isPending?"Submitting…":s?"Submit paper":"Sign in to submit"}),e.jsx(_,{type:"button",variant:"outline",onClick:()=>n(-1),disabled:c.isPending,children:"Cancel"})]})]})]})};export{Y as default};
assets/{TagBrowseView-DOBpjBaE.js → TagBrowseView-D7Z1HJMF.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{d as be,r as h,k as Z,j as e,h as F,V as je,m as _e,P as Xe,p as ve,l as Ne,W as es,z as _,Y as ss,t as as,q as J,L as A,c as ts,u as ns,a as rs,f as os,M as cs}from"./index-DpqMFKEJ.js";import{u as ge}from"./useQuery-BRJ3D8WJ.js";import{P as is,M as ls}from"./components-D8W6Owmv.js";import{B as ds}from"./BenchmarkTrendSparkline-DmwnJgng.js";import{u as ms,P as ps}from"./useIntersectionObserver-CXj-qZiT.js";import{M as W}from"./MarkdownText-fqFB7jpa.js";import{c as fe}from"./catalog-CNSpmU4d.js";import{s as hs}from"./slug-BpH-Nkvz.js";import{d as D,t as us}from"./transform-BG6M6eP3.js";import{b as xs}from"./usePapers-BLL7LMPj.js";import{S as q}from"./skeleton-BmlKdebV.js";import{A as gs,a as fs}from"./alert-C5eNYVhH.js";import{C as bs}from"./chevron-down-CAjIY4ok.js";import{G as js}from"./github-DWbj5_NN.js";import"./LatexTitle-j9Bx8wiP.js";import"./katex.min-BSBacQyE.js";import"./papers-inj3gJs3.js";import"./safeExternalHref-CkBrsh84.js";import"./PaperPreviewLink-Da7TZ3ij.js";import"./index-DYz3ynl3.js";import"./hover-card-K79gJfh7.js";import"./useInfiniteQuery-ud8-aqIx.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{d as be,r as h,k as Z,j as e,h as F,V as je,m as _e,P as Xe,p as ve,l as Ne,W as es,z as _,Y as ss,t as as,q as J,L as A,c as ts,u as ns,a as rs,f as os,M as cs}from"./index-B5X8-Bq7.js";import{u as ge}from"./useQuery-D05r-Fqo.js";import{P as is,M as ls}from"./components-BYijBjrn.js";import{B as ds}from"./BenchmarkTrendSparkline-iEoRSHN4.js";import{u as ms,P as ps}from"./useIntersectionObserver-II0SG2xo.js";import{M as W}from"./MarkdownText-BGyyXIsO.js";import{c as fe}from"./catalog-Cpdj6dI_.js";import{s as hs}from"./slug-BpH-Nkvz.js";import{d as D,t as us}from"./transform-Ce1Ycrlu.js";import{b as xs}from"./usePapers-CCbDROh4.js";import{S as q}from"./skeleton-Ck9ioJnz.js";import{A as gs,a as fs}from"./alert-C4A_tmFK.js";import{C as bs}from"./chevron-down-RoGVatuo.js";import{G as js}from"./github-GWy166ov.js";import"./LatexTitle-BQ-aqYJn.js";import"./katex.min-BSBacQyE.js";import"./papers-D7y8njf2.js";import"./safeExternalHref-CkBrsh84.js";import"./PaperPreviewLink-Br9pyKgi.js";import"./index-LVXoOqbx.js";import"./hover-card-ClPcsbgj.js";import"./useInfiniteQuery-SpeFiDye.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{TagsIndexView-BgMU3odX.js → TagsIndexView-Cie4wZfi.js} RENAMED
@@ -1 +1 @@
1
- import{r as m,j as s,L as p}from"./index-DpqMFKEJ.js";import{u as h}from"./useQuery-BRJ3D8WJ.js";import{c as g}from"./catalog-CNSpmU4d.js";import{c as x,h as f,d as u}from"./transform-BG6M6eP3.js";import{s as j}from"./slug-BpH-Nkvz.js";import{S as d}from"./skeleton-BmlKdebV.js";import{A as y,a as k}from"./alert-C5eNYVhH.js";import{T as v}from"./TaxonomySuggestionTile-B4j9rE3C.js";import"./SignInToEditDialog-_xlmZxOT.js";import"./button-CpZL29fe.js";import"./textarea-BA4c3aP6.js";import"./dialog-DW3Uw8Zv.js";import"./useMutation-BFwg1MYO.js";import"./submissions-B8Kj7oPp.js";import"./loader-circle-CEEZZR71.js";const N=r=>(r==null?void 0:r.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",I=()=>{const r=h({queryKey:["areas-with-tasks"],queryFn:()=>g.areasWithTasks(),staleTime:6e5}),o=m.useMemo(()=>{if(!r.data)return[];const e={general:0,vision:1,video:2,language:3,audio:4,other:5},a=n=>e[N(n)]??999;return[...r.data.results].sort((n,t)=>{const i=a(n.name),l=a(t.name);return i!==l?i-l:n.name.localeCompare(t.name)})},[r.data]),c=m.useMemo(()=>o.reduce((e,a)=>e+a.tasks.length,0),[o]);return r.error?s.jsx("div",{className:"page",children:s.jsx(y,{variant:"destructive",children:s.jsx(k,{children:"Failed to load taxonomy. Please try again."})})}):s.jsxs("div",{className:"page",children:[s.jsx("div",{className:"feed-header",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"feed-title",children:["All ",s.jsx("em",{children:"Domains"})]}),s.jsx("div",{className:"feed-subtitle",children:"Browse research by area. Click any task to see trending work."})]})}),r.isLoading?s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((e,a)=>s.jsxs("div",{children:[s.jsx(d,{className:"h-8 w-1/3 mb-4"}),s.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((n,t)=>s.jsx(d,{className:"h-24"},t))})]},a))}):o.map(e=>{const a=e.tasks;if(a.length===0)return null;const n=a.reduce((t,i)=>t+(i.paper_count||0),0);return s.jsxs("section",{id:`area-${j(e.name)}`,style:{marginBottom:48},children:[s.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[s.jsxs("div",{children:[s.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:e.name}),e.description&&s.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:e.description})]}),s.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[a.length," ",a.length===1?"task":"tasks"," · ",n.toLocaleString()," papers"]})]}),s.jsxs("div",{className:"tag-grid",children:[a.map(t=>{const i=t.slug||"",l=x(f(i));return s.jsxs(p,{to:`/tasks/${i}`,className:"tag-cell",children:[s.jsxs("div",{className:"name",children:[s.jsx("span",{className:"dot",style:{background:l.dot}}),u(t.name,i)]}),s.jsx("div",{className:"meta",children:s.jsxs("span",{children:[(t.paper_count??0).toLocaleString()," papers"]})})]},t.id)}),s.jsx(v,{kind:"task"})]})]},e.id)}),c>0&&s.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[c," tasks across ",o.filter(e=>e.tasks.length>0).length," areas."]})]})};export{I as default};
 
1
+ import{r as m,j as s,L as p}from"./index-B5X8-Bq7.js";import{u as h}from"./useQuery-D05r-Fqo.js";import{c as g}from"./catalog-Cpdj6dI_.js";import{c as x,h as f,d as u}from"./transform-Ce1Ycrlu.js";import{s as j}from"./slug-BpH-Nkvz.js";import{S as d}from"./skeleton-Ck9ioJnz.js";import{A as y,a as k}from"./alert-C4A_tmFK.js";import{T as v}from"./TaxonomySuggestionTile-DlEFIt6g.js";import"./SignInToEditDialog-C_4kkM3M.js";import"./button-cqkU__aM.js";import"./textarea-Bw7gV3w2.js";import"./dialog-DQCWceSF.js";import"./useMutation-jhc4sxTL.js";import"./submissions-CUbxi_j0.js";import"./loader-circle-QH8Jsx5e.js";const N=r=>(r==null?void 0:r.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",I=()=>{const r=h({queryKey:["areas-with-tasks"],queryFn:()=>g.areasWithTasks(),staleTime:6e5}),o=m.useMemo(()=>{if(!r.data)return[];const e={general:0,vision:1,video:2,language:3,audio:4,other:5},a=n=>e[N(n)]??999;return[...r.data.results].sort((n,t)=>{const i=a(n.name),l=a(t.name);return i!==l?i-l:n.name.localeCompare(t.name)})},[r.data]),c=m.useMemo(()=>o.reduce((e,a)=>e+a.tasks.length,0),[o]);return r.error?s.jsx("div",{className:"page",children:s.jsx(y,{variant:"destructive",children:s.jsx(k,{children:"Failed to load taxonomy. Please try again."})})}):s.jsxs("div",{className:"page",children:[s.jsx("div",{className:"feed-header",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"feed-title",children:["All ",s.jsx("em",{children:"Domains"})]}),s.jsx("div",{className:"feed-subtitle",children:"Browse research by area. Click any task to see trending work."})]})}),r.isLoading?s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((e,a)=>s.jsxs("div",{children:[s.jsx(d,{className:"h-8 w-1/3 mb-4"}),s.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((n,t)=>s.jsx(d,{className:"h-24"},t))})]},a))}):o.map(e=>{const a=e.tasks;if(a.length===0)return null;const n=a.reduce((t,i)=>t+(i.paper_count||0),0);return s.jsxs("section",{id:`area-${j(e.name)}`,style:{marginBottom:48},children:[s.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[s.jsxs("div",{children:[s.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:e.name}),e.description&&s.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:e.description})]}),s.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[a.length," ",a.length===1?"task":"tasks"," · ",n.toLocaleString()," papers"]})]}),s.jsxs("div",{className:"tag-grid",children:[a.map(t=>{const i=t.slug||"",l=x(f(i));return s.jsxs(p,{to:`/tasks/${i}`,className:"tag-cell",children:[s.jsxs("div",{className:"name",children:[s.jsx("span",{className:"dot",style:{background:l.dot}}),u(t.name,i)]}),s.jsx("div",{className:"meta",children:s.jsxs("span",{children:[(t.paper_count??0).toLocaleString()," papers"]})})]},t.id)}),s.jsx(v,{kind:"task"})]})]},e.id)}),c>0&&s.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[c," tasks across ",o.filter(e=>e.tasks.length>0).length," areas."]})]})};export{I as default};
assets/{TaxonomySuggestionTile-B4j9rE3C.js → TaxonomySuggestionTile-DlEFIt6g.js} RENAMED
@@ -1 +1 @@
1
- import{y as u,r as o,j as e}from"./index-DpqMFKEJ.js";import{P as c,S as m,a as p}from"./SignInToEditDialog-_xlmZxOT.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{y as u,r as o,j as e}from"./index-B5X8-Bq7.js";import{P as c,S as m,a as p}from"./SignInToEditDialog-C_4kkM3M.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-Ssp5t5Ky.js → TrendsView-gEmWJwrM.js} RENAMED
@@ -1 +1 @@
1
- import{Z as I,z as X,j as e}from"./index-DpqMFKEJ.js";import{u as G}from"./useQuery-BRJ3D8WJ.js";import{A as J,a as E}from"./alert-C5eNYVhH.js";import{S as P}from"./skeleton-BmlKdebV.js";class Q{constructor(r){this.request=r}trends(){return this.request("/stats/trends")}}const V=new Q(I),m=t=>{const r=/^(\d{4})-(0[1-9]|1[0-2])$/.exec(t);if(!r)return t;const[,s,l]=r;return`${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][Number(l)-1]} '${s.slice(2)}`},Y=()=>V.trends(),f=980,j=400,x=62,B=26,g=30,Z=58,u=f-x-B,A=j-g-Z,v=g+A,K=t=>{if(t.length<3)return t.map((s,l)=>`${l?"L":"M"}${s[0]} ${s[1]}`).join(" ");let r=`M${t[0][0]} ${t[0][1]}`;for(let s=0;s<t.length-1;s+=1){const l=t[s-1]??t[s],c=t[s],o=t[s+1],a=t[s+2]??o,y=c[0]+(o[0]-l[0])/6,i=c[1]+(o[1]-l[1])/6,b=o[0]-(a[0]-c[0])/6,d=o[1]-(a[1]-c[1])/6;r+=` C ${y} ${i} ${b} ${d} ${o[0]} ${o[1]}`}return r},z={fontFamily:"var(--mono)",fontSize:12,fill:"var(--ink-faint)"},W={fontFamily:"var(--mono)",fontSize:11,fontWeight:600,letterSpacing:"0.14em",fill:"var(--ink-faint)",textTransform:"uppercase"},L=({id:t,data:r,color:s,yTicks:l,yLabel:c,xLabel:o})=>{const[a,y]=X.useState(null),i=r.length,b=l[l.length-1],d=n=>x+u*(i===1?0:n/(i-1)),p=n=>g+A*(1-n/b);if(i===0)return null;const R=r.map((n,h)=>[d(h),p(n.percent)]),F=K(R),_=`${F} L ${d(i-1)} ${v} L ${x} ${v} Z`,w=i<=12?1:Math.ceil(i/8),O=n=>{const h=n.currentTarget.getBoundingClientRect(),S=(n.clientX-h.left)/h.width*f,k=i>1?u/(i-1):u,q=Math.max(0,Math.min(i-1,Math.round((S-x)/k)));y(q)},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(r[0].month)} (${r[0].percent}%) to ${m(r[i-1].month)} (${r[i-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:s,stopOpacity:.26}}),e.jsx("stop",{offset:"100%",style:{stopColor:s,stopOpacity:.02}})]})}),l.map(n=>e.jsxs("g",{children:[e.jsx("line",{x1:x,x2:f-B,y1:p(n),y2:p(n),stroke:"var(--hairline)",strokeWidth:1}),e.jsxs("text",{x:x-14,y:p(n)+4,textAnchor:"end",style:z,children:[n,"%"]})]},n)),e.jsx("path",{d:_,fill:`url(#${H})`}),e.jsx("path",{d:F,fill:"none",stroke:s,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round"}),r.map((n,h)=>{const S=h===i-1,k=h%w===0&&i-1-h>=w/2;return!S&&!k?null:e.jsx("text",{x:d(h),y:v+24,textAnchor:"middle",style:z,children:m(n.month)},n.month)}),e.jsx("text",{x:x+u/2,y:j-4,textAnchor:"middle",style:W,children:o}),e.jsx("text",{transform:`translate(16 ${g+A/2}) rotate(-90)`,textAnchor:"middle",style:W,children:c}),a!=null&&e.jsxs(e.Fragment,{children:[e.jsx("line",{x1:d(a),x2:d(a),y1:g,y2:v,stroke:s,strokeWidth:1,strokeDasharray:"3 4",opacity:.5}),e.jsx("circle",{cx:d(a),cy:p(r[a].percent),r:5,fill:"var(--bg)",stroke:s,strokeWidth:2})]})]}),a!=null&&e.jsxs("div",{style:{position:"absolute",left:`${d(a)/f*100}%`,top:`${p(r[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(r[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:s,display:"inline-block"}}),r[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:r.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)"},M={fontFamily:"var(--serif)",fontSize:18,lineHeight:1.55,color:"var(--ink-soft)",maxWidth:620,margin:"0 0 8px"},C={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},re=()=>{const t=G({queryKey:["research-trends"],queryFn:Y,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(J,{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:M,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(L,{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:M,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(L,{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:C,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:C,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{re as default};
 
1
+ import{Z as I,z as X,j as e}from"./index-B5X8-Bq7.js";import{u as G}from"./useQuery-D05r-Fqo.js";import{A as J,a as E}from"./alert-C4A_tmFK.js";import{S as P}from"./skeleton-Ck9ioJnz.js";class Q{constructor(r){this.request=r}trends(){return this.request("/stats/trends")}}const V=new Q(I),m=t=>{const r=/^(\d{4})-(0[1-9]|1[0-2])$/.exec(t);if(!r)return t;const[,s,l]=r;return`${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][Number(l)-1]} '${s.slice(2)}`},Y=()=>V.trends(),f=980,j=400,x=62,B=26,g=30,Z=58,u=f-x-B,A=j-g-Z,v=g+A,K=t=>{if(t.length<3)return t.map((s,l)=>`${l?"L":"M"}${s[0]} ${s[1]}`).join(" ");let r=`M${t[0][0]} ${t[0][1]}`;for(let s=0;s<t.length-1;s+=1){const l=t[s-1]??t[s],c=t[s],o=t[s+1],a=t[s+2]??o,y=c[0]+(o[0]-l[0])/6,i=c[1]+(o[1]-l[1])/6,b=o[0]-(a[0]-c[0])/6,d=o[1]-(a[1]-c[1])/6;r+=` C ${y} ${i} ${b} ${d} ${o[0]} ${o[1]}`}return r},z={fontFamily:"var(--mono)",fontSize:12,fill:"var(--ink-faint)"},W={fontFamily:"var(--mono)",fontSize:11,fontWeight:600,letterSpacing:"0.14em",fill:"var(--ink-faint)",textTransform:"uppercase"},L=({id:t,data:r,color:s,yTicks:l,yLabel:c,xLabel:o})=>{const[a,y]=X.useState(null),i=r.length,b=l[l.length-1],d=n=>x+u*(i===1?0:n/(i-1)),p=n=>g+A*(1-n/b);if(i===0)return null;const R=r.map((n,h)=>[d(h),p(n.percent)]),F=K(R),_=`${F} L ${d(i-1)} ${v} L ${x} ${v} Z`,w=i<=12?1:Math.ceil(i/8),O=n=>{const h=n.currentTarget.getBoundingClientRect(),S=(n.clientX-h.left)/h.width*f,k=i>1?u/(i-1):u,q=Math.max(0,Math.min(i-1,Math.round((S-x)/k)));y(q)},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(r[0].month)} (${r[0].percent}%) to ${m(r[i-1].month)} (${r[i-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:s,stopOpacity:.26}}),e.jsx("stop",{offset:"100%",style:{stopColor:s,stopOpacity:.02}})]})}),l.map(n=>e.jsxs("g",{children:[e.jsx("line",{x1:x,x2:f-B,y1:p(n),y2:p(n),stroke:"var(--hairline)",strokeWidth:1}),e.jsxs("text",{x:x-14,y:p(n)+4,textAnchor:"end",style:z,children:[n,"%"]})]},n)),e.jsx("path",{d:_,fill:`url(#${H})`}),e.jsx("path",{d:F,fill:"none",stroke:s,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round"}),r.map((n,h)=>{const S=h===i-1,k=h%w===0&&i-1-h>=w/2;return!S&&!k?null:e.jsx("text",{x:d(h),y:v+24,textAnchor:"middle",style:z,children:m(n.month)},n.month)}),e.jsx("text",{x:x+u/2,y:j-4,textAnchor:"middle",style:W,children:o}),e.jsx("text",{transform:`translate(16 ${g+A/2}) rotate(-90)`,textAnchor:"middle",style:W,children:c}),a!=null&&e.jsxs(e.Fragment,{children:[e.jsx("line",{x1:d(a),x2:d(a),y1:g,y2:v,stroke:s,strokeWidth:1,strokeDasharray:"3 4",opacity:.5}),e.jsx("circle",{cx:d(a),cy:p(r[a].percent),r:5,fill:"var(--bg)",stroke:s,strokeWidth:2})]})]}),a!=null&&e.jsxs("div",{style:{position:"absolute",left:`${d(a)/f*100}%`,top:`${p(r[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(r[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:s,display:"inline-block"}}),r[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:r.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)"},M={fontFamily:"var(--serif)",fontSize:18,lineHeight:1.55,color:"var(--ink-soft)",maxWidth:620,margin:"0 0 8px"},C={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},re=()=>{const t=G({queryKey:["research-trends"],queryFn:Y,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(J,{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:M,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(L,{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:M,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(L,{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:C,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:C,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{re as default};
assets/{UserProfileView-BBq2VznJ.js → UserProfileView-DGFE_uoS.js} RENAMED
@@ -1 +1 @@
1
- import{ak as i,A as n,c as o,j as e,ax as d}from"./index-DpqMFKEJ.js";import{u as l}from"./useQuery-BRJ3D8WJ.js";import{C as c}from"./OrganizationContributionGraph-rCVWThLe.js";import"./skeleton-BmlKdebV.js";import"./catalog-CNSpmU4d.js";const p={async get(t){const a=await i(`/profiles/${encodeURIComponent(t)}`);if(!a.ok)throw new n(a,await a.text());const r=await a.json();if(!a.redirected)return r;const s=decodeURIComponent(new URL(a.url).pathname.split("/").pop()||r.username);return{...r,username:s,redirected_from_alias:!0}}},f=()=>{const{username:t=""}=o(),a=l({queryKey:["user-profile",t.toLowerCase()],queryFn:()=>p.get(t)});return a.isLoading?e.jsx("div",{className:"page",children:"Loading profile…"}):a.data?a.data.redirected_from_alias?e.jsx(d,{to:`/${a.data.username}`,replace:!0}):e.jsxs("div",{className:"page",style:{maxWidth:960},children:[e.jsxs("h1",{children:["@",a.data.username]}),e.jsx("p",{children:"Canonical Papers with Code contributions"}),e.jsx(c,{data:a.data.calendar,organizationName:`@${a.data.username}`,title:"Canonical contributions",noun:"contribution"}),a.data.is_owner&&e.jsxs("section",{className:"mt-10",children:[e.jsx("h2",{children:"Your submissions"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Limits and duplicate behavior are documented on ",e.jsx("a",{href:"/rate-limits",children:"the policy page"}),"."]}),e.jsx("div",{className:"mt-4 space-y-3",children:a.data.submissions.map(r=>e.jsxs("article",{className:"rounded-md border p-4",children:[e.jsx("strong",{children:r.edit_type})," · ",r.status,e.jsxs("details",{className:"mt-2 text-xs",children:[e.jsx("summary",{children:"Original and applied payload"}),e.jsx("pre",{children:JSON.stringify({proposed:r.proposed_payload,applied:r.applied_payload},null,2)})]}),r.review_reason&&e.jsx("p",{children:r.review_reason})]},r.id))})]})]}):e.jsx("div",{className:"page",children:e.jsx("h1",{children:"Profile not found"})})};export{f as default};
 
1
+ import{ak as i,A as n,c as o,j as e,ax as d}from"./index-B5X8-Bq7.js";import{u as l}from"./useQuery-D05r-Fqo.js";import{C as c}from"./OrganizationContributionGraph-D2Q82lUu.js";import"./skeleton-Ck9ioJnz.js";import"./catalog-Cpdj6dI_.js";const p={async get(t){const a=await i(`/profiles/${encodeURIComponent(t)}`);if(!a.ok)throw new n(a,await a.text());const r=await a.json();if(!a.redirected)return r;const s=decodeURIComponent(new URL(a.url).pathname.split("/").pop()||r.username);return{...r,username:s,redirected_from_alias:!0}}},f=()=>{const{username:t=""}=o(),a=l({queryKey:["user-profile",t.toLowerCase()],queryFn:()=>p.get(t)});return a.isLoading?e.jsx("div",{className:"page",children:"Loading profile…"}):a.data?a.data.redirected_from_alias?e.jsx(d,{to:`/${a.data.username}`,replace:!0}):e.jsxs("div",{className:"page",style:{maxWidth:960},children:[e.jsxs("h1",{children:["@",a.data.username]}),e.jsx("p",{children:"Canonical Papers with Code contributions"}),e.jsx(c,{data:a.data.calendar,organizationName:`@${a.data.username}`,title:"Canonical contributions",noun:"contribution"}),a.data.is_owner&&e.jsxs("section",{className:"mt-10",children:[e.jsx("h2",{children:"Your submissions"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Limits and duplicate behavior are documented on ",e.jsx("a",{href:"/rate-limits",children:"the policy page"}),"."]}),e.jsx("div",{className:"mt-4 space-y-3",children:a.data.submissions.map(r=>e.jsxs("article",{className:"rounded-md border p-4",children:[e.jsx("strong",{children:r.edit_type})," · ",r.status,e.jsxs("details",{className:"mt-2 text-xs",children:[e.jsx("summary",{children:"Original and applied payload"}),e.jsx("pre",{children:JSON.stringify({proposed:r.proposed_payload,applied:r.applied_payload},null,2)})]}),r.review_reason&&e.jsx("p",{children:r.review_reason})]},r.id))})]})]}):e.jsx("div",{className:"page",children:e.jsx("h1",{children:"Profile not found"})})};export{f as default};
assets/{alert-C5eNYVhH.js → alert-C4A_tmFK.js} RENAMED
@@ -1 +1 @@
1
- import{r as a,j as s,q as l,a0 as i}from"./index-DpqMFKEJ.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};
 
1
+ import{r as a,j as s,q as l,a0 as i}from"./index-B5X8-Bq7.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};