nielsr HF Staff commited on
Commit
c3d79d4
·
verified ·
1 Parent(s): f429892

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. apple-touch-icon.png +0 -0
  2. assets/BenchmarkDetailView-CbLq_FMP.js +1 -0
  3. assets/BenchmarkDetailView-Y9H61k6e.js +0 -1
  4. assets/{CronDashboard-BIltSfhQ.js → CronDashboard-_5HLppM_.js} +2 -2
  5. assets/FeedView-C2lfpfbU.js +0 -1
  6. assets/FeedView-CHsx2V3f.js +1 -0
  7. assets/{LatexTitle-_7AiBIQK.js → LatexTitle-Ckdd_TrR.js} +1 -1
  8. assets/{MethodDetailView-DGJrZEj-.js → MethodDetailView-Jl6Bitak.js} +0 -0
  9. assets/MethodsIndexView-B-6AP7xD.js +1 -0
  10. assets/MethodsIndexView-BwswCUOL.js +0 -1
  11. assets/NotFound-BCiOqWnt.js +1 -0
  12. assets/NotFound-CXZKYjs9.js +0 -1
  13. assets/PaperDetailView-B-8wMNrf.js +46 -0
  14. assets/PaperDetailView-DVL_utdK.js +0 -41
  15. assets/PapersListView-EJ-j4htE.js +1 -0
  16. assets/PapersListView-tXfHD3Ds.js +0 -1
  17. assets/SavedPapersView-DcFUahmj.js +0 -1
  18. assets/SavedPapersView-Dw2Tv8xO.js +1 -0
  19. assets/SearchOverlay-BoQEnfv1.js +1 -0
  20. assets/SearchOverlay-CvsxBwHB.js +0 -1
  21. assets/SubmitView-BWQDAbjX.js +1 -0
  22. assets/TagBrowseView-BP39xnV3.js +0 -1
  23. assets/TagBrowseView-CpYLrrd8.js +1 -0
  24. assets/TagsIndexView-Brq1T4Wz.js +1 -0
  25. assets/TagsIndexView-CWaR8sEU.js +0 -1
  26. assets/adminAuth-CijC1LpP.js +0 -1
  27. assets/adminAuth-PI_XkM8E.js +1 -0
  28. assets/alert-BfBSxmdQ.js +0 -1
  29. assets/alert-DUe5ZsgM.js +1 -0
  30. assets/api-BFeNcidM.js +1 -0
  31. assets/api-DVAIDRP9.js +0 -1
  32. assets/badge-Buw8W5Kz.js +0 -11
  33. assets/badge-Ds2a6Q8t.js +11 -0
  34. assets/{components-MYNA0qNJ.js → components-BT6ZBgQl.js} +1 -1
  35. assets/{index-BcdJ5r4Y.js → index-BWQiUBNk.js} +0 -0
  36. assets/{index-C6fPppD9.css → index-D4WvUqkN.css} +0 -0
  37. assets/input-DZmGAzFu.js +1 -0
  38. assets/skeleton-BuXiEBoy.js +1 -0
  39. assets/transform-Dasg-XFy.js +0 -1
  40. assets/transform-DgWj1AQy.js +1 -0
  41. assets/{useDebounce-B7XgVPQp.js → useDebounce-DUtosrff.js} +1 -1
  42. assets/useInfiniteQuery-CpEFc3Gg.js +1 -0
  43. assets/useInfiniteQuery-jK6uM4vU.js +0 -1
  44. assets/{useIntersectionObserver-DfztqSja.js → useIntersectionObserver-U7v6rTcQ.js} +1 -1
  45. assets/useMutation-CypKj-4k.js +1 -0
  46. assets/usePapers-CnRnmSk-.js +1 -0
  47. assets/usePapers-Swv3hMJI.js +0 -1
  48. assets/{usePeriodFilter-B4RSLVJ3.js → usePeriodFilter-NqcUWmWg.js} +1 -1
  49. assets/useQuery-B941khzD.js +1 -0
  50. favicon-192.png +0 -0
apple-touch-icon.png ADDED
assets/BenchmarkDetailView-CbLq_FMP.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{x as ie,u as ce,r as w,j as e,L as C,H,y as oe}from"./index-BWQiUBNk.js";import{u as q}from"./useQuery-B941khzD.js";import{a as z}from"./api-BFeNcidM.js";import{S as U}from"./skeleton-BuXiEBoy.js";import{A as de,a as me}from"./alert-DUe5ZsgM.js";import{L as O}from"./LatexTitle-Ckdd_TrR.js";import"./adminAuth-PI_XkM8E.js";const he=({points:c,metric:k})=>{const b=oe(),[g,L]=w.useState(null),j=880,R=320,i=60,m=30,o=24,s=50,v=c.map(a=>a.value),_=Math.min(...v),Q=Math.max(...v)-_||1,I=j-i-m,T=R-o-s,V=I/Math.max(1,c.length-1),y=c.map((a,t)=>{const u=i+t*V,p=(a.value-_)/Q,N=o+T*(1-p);return{x:u,y:N,data:a}});let B=`M${y[0].x},${y[0].y}`;for(let a=1;a<y.length;a++){const t=y[a-1],u=y[a],p=(t.x+u.x)/2;B+=` C${p},${t.y} ${p},${u.y} ${u.x},${u.y}`}const d=5,A=a=>L(t=>t===a?null:t),W=a=>{a&&b(`/paper/${a}`)};return e.jsxs("svg",{width:"100%",viewBox:`0 0 ${j} ${R}`,style:{display:"block"},children:[e.jsx("text",{x:i-38,y:o+T/2,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"middle",transform:`rotate(-90 ${i-38} ${o+T/2})`,children:k}),Array.from({length:d}).map((a,t)=>{const u=t/(d-1),p=o+T*(1-u),N=_+Q*u;return e.jsxs("g",{children:[e.jsx("line",{x1:i,y1:p,x2:j-m,y2:p,stroke:"var(--hairline)",strokeWidth:"1"}),e.jsx("text",{x:i-10,y:p+4,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"end",children:H(N)})]},t)}),y.map((a,t)=>e.jsx("text",{x:a.x,y:R-s+18,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:"middle",children:a.data.dateLabel},t)),e.jsx("path",{d:B,stroke:"var(--accent)",strokeWidth:"2",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),y.map((a,t)=>{const u=g===t,N=`${a.data.modelName||a.data.paperTitle||"Unknown model"}: ${H(a.data.value)} on ${a.data.dateLabel}`,x=!!a.data.paperRouteId;return e.jsxs("g",{children:[e.jsx("circle",{cx:a.x,cy:a.y,r:u?6:4.5,fill:u?"var(--accent)":"var(--bg-elevated)",stroke:"var(--accent)",strokeWidth:"2",style:{transition:"r 0.12s ease, fill 0.12s ease"}}),e.jsx("circle",{cx:a.x,cy:a.y,r:"14",fill:"transparent",style:{cursor:x?"pointer":"default",outline:"none"},tabIndex:0,role:x?"link":"img","aria-label":N,onMouseEnter:()=>L(t),onMouseLeave:()=>A(t),onFocus:()=>L(t),onBlur:()=>A(t),onClick:()=>W(a.data.paperRouteId),onKeyDown:f=>{x&&(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),W(a.data.paperRouteId))},children:e.jsx("title",{children:N})})]},t)}),g!==null&&(()=>{const a=y[g],t=a.data.modelName||a.data.paperTitle||"Unknown model",u=t.length>40?t.slice(0,39)+"…":t,p=`${H(a.data.value)} · ${a.data.dateLabel}`,x=Math.max(140,Math.min(320,Math.max(u.length,p.length)*6.6+24)),f=46;let $=a.x-x/2;$<i&&($=i),$+x>j-m&&($=j-m-x);const E=a.y-f-14>=o?a.y-f-12:a.y+12;return e.jsxs("g",{pointerEvents:"none",children:[e.jsx("rect",{x:$,y:E,width:x,height:f,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))"}}),e.jsx("text",{x:$+12,y:E+19,fontSize:"12",fontFamily:"var(--sans)",fill:"var(--ink)",fontWeight:500,children:u}),e.jsx("text",{x:$+12,y:E+36,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",children:p})]})})()]})};function D(c){if(c==null)return null;if(typeof c=="number")return Number.isFinite(c)?c:null;const k=c.includes("±")?c.split("±")[0].trim():c.trim(),b=parseFloat(k);return Number.isFinite(b)?b:null}function ue(c,k,b){if(c.length===0)return{points:[],sota:0,sotaModel:""};const g=c.map(s=>{var h;const v=D((h=s.metrics)==null?void 0:h[k]),_=s.paper_published_date||"";return{eval:s,value:v,date:_}}).filter(s=>s.value!==null&&!!s.date).sort((s,v)=>s.date.localeCompare(v.date)),L=[];let j=null;for(const s of g)(j==null?!0:b==="↓"?s.value<j:s.value>j)&&(j=s.value,L.push({value:s.value,dateLabel:s.date.slice(0,7),modelName:s.eval.model_name||"",paperTitle:s.eval.paper_title||"",paperRouteId:s.eval.paper_arxiv_id||s.eval.paper_id||null}));const i=c.map(s=>{var v;return{eval:s,value:D((v=s.metrics)==null?void 0:v[k])}}).filter(s=>s.value!==null).sort((s,v)=>b==="↓"?s.value-v.value:v.value-s.value)[0],m=(i==null?void 0:i.value)??0,o=(i==null?void 0:i.eval.model_name)||(i==null?void 0:i.eval.paper_title)||"";return{points:L,sota:m,sotaModel:o}}const ye=()=>{var K,E,P,Y,G,J,Z,ee,ae;const{datasetSlug:c}=ie(),[k]=ce(),b=k.get("task")||void 0,g=k.get("eval")||void 0,[L,j]=w.useState(void 0),R=w.useRef(null),i=w.useRef(!1),m=q({queryKey:["dataset",c,"with-paper"],queryFn:()=>z.getDatasetBySlug(c,{include_paper:!0}),enabled:!!c,staleTime:10*60*1e3}),o=q({queryKey:["dataset-evals",(K=m.data)==null?void 0:K.id],queryFn:()=>z.getEvaluationsByDataset(m.data.id),enabled:!!((E=m.data)!=null&&E.id),staleTime:5*60*1e3}),s=q({queryKey:["dataset-tasks",(P=m.data)==null?void 0:P.id],queryFn:()=>z.getDatasetTasks(m.data.id),enabled:!!((Y=m.data)!=null&&Y.id),staleTime:10*60*1e3}),v=q({queryKey:["metric-directions"],queryFn:()=>z.getMetricDirections(),staleTime:60*60*1e3}),_=w.useMemo(()=>{const r=new Set;return(o.data||[]).forEach(n=>{n.best_metric&&r.add(n.best_metric),Object.keys(n.metrics||{}).forEach(l=>r.add(l))}),Array.from(r)},[o.data]),h=L||((J=(G=o.data)==null?void 0:G[0])==null?void 0:J.best_metric)||_[0]||"",I=(((ee=(Z=v.data)==null?void 0:Z.directions)==null?void 0:ee[h])||"higher_is_better")==="lower_is_better"?"↓":"↑",{points:T,sota:V,sotaModel:y}=w.useMemo(()=>ue(o.data||[],h,I),[o.data,h,I]);w.useEffect(()=>{if(i.current||!g||!o.data||o.data.length===0)return;const r=R.current;r&&(i.current=!0,r.scrollIntoView({behavior:"smooth",block:"start"}))},[g,o.data]);const B=w.useMemo(()=>{const r=s.data||[];if(r.length===0)return null;if(b){const n=r.find(l=>l.slug===b);if(n)return n}return r[0]},[s.data,b]);if(m.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(U,{className:"h-12 w-1/2 mb-6"}),e.jsx(U,{className:"h-64 w-full"})]});if(m.error||!m.data)return e.jsx("div",{className:"page",children:e.jsx(de,{variant:"destructive",children:e.jsx(me,{children:"Benchmark not found."})})});const d=m.data,A=(o.data||[]).slice().sort((r,n)=>{var S,F;const l=D((S=r.metrics)==null?void 0:S[h]),M=D((F=n.metrics)==null?void 0:F[h]);return l!==null&&M!==null?I==="↓"?l-M:M-l:l!==null?-1:M!==null?1:(r.best_rank??9999)-(n.best_rank??9999)}),W=!!d.supports_harness,a=g&&A.find(r=>r.id===g)||null,t=d.introducing_paper??void 0,u=(()=>{if(!d.paper_url)return null;const r=d.paper_url.match(/arxiv\.org\/(?:abs|pdf)\/([\w.-]+)/i);if(r&&r[1])return r[1].replace(/\.pdf$/i,"");const n=d.paper_url.match(/\/(?:paper|abs|pdf)\/([\w.-]+)/i);return n&&n[1]?n[1].replace(/\.pdf$/i,""):null})(),p=(t==null?void 0:t.arxiv_id)||u,N=p,x=(t==null?void 0:t.title)||d.introducing_paper_title||null,f=((ae=t==null?void 0:t.published)==null?void 0:ae.slice(0,4))||d.introduced_year||null,$=!!p||!!d.paper_url||!!x;return e.jsx("div",{className:"page",children:e.jsxs("div",{className:"bm-page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(C,{to:"/tasks",children:"Tasks"}),B&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(C,{to:`/tasks/${B.slug||B.id}`,children:B.name})]}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--accent-text)"},children:d.name})]}),e.jsx("h1",{className:"bm-title",children:d.name}),e.jsxs("div",{className:"bm-subtitle",children:[h&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"metric-tag",children:h}),e.jsx("span",{style:{color:"var(--hairline-strong)",margin:"0 8px"},children:"·"})]}),y?e.jsxs("span",{children:["Best: ",e.jsx("span",{className:"best-name",children:H(V)})," by ",e.jsx("span",{className:"best-name",style:{fontStyle:"normal"},children:y})]}):e.jsxs("span",{children:[A.length," evaluations"]})]}),d.description&&e.jsx("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",maxWidth:760,marginBottom:16},children:d.description}),$&&e.jsxs("div",{className:"method-source",style:{marginTop:0,marginBottom:18},children:[e.jsx("span",{className:"method-source-label",children:"Source"}),N?e.jsxs(C,{to:`/paper/${N}`,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[e.jsx("span",{className:"method-source-title",children:x?e.jsx(O,{title:x}):`arXiv:${N}`}),f&&e.jsx("span",{className:"method-source-meta",children:f})]}):d.paper_url?e.jsxs("a",{href:d.paper_url,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[e.jsx("span",{className:"method-source-title",children:x?e.jsx(O,{title:x}):p?`arXiv:${p}`:d.paper_url}),f&&e.jsx("span",{className:"method-source-meta",children:f})]}):e.jsxs("div",{className:"method-source-link is-static",children:[e.jsx("span",{className:"method-source-title",children:x?e.jsx(O,{title:x}):null}),f&&e.jsx("span",{className:"method-source-meta",children:f})]})]}),_.length>1&&e.jsxs("div",{className:"bm-actions",children:[e.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginRight:8},children:"METRIC"}),_.map(r=>e.jsx("button",{className:`bm-action-btn ${r===h?"is-active":""}`,onClick:()=>j(r),children:r},r))]}),T.length>=2&&e.jsxs("div",{className:"bm-card",children:[e.jsx("div",{className:"bm-card-head",children:e.jsx("div",{className:"bm-card-title",children:"SOTA progression"})}),e.jsx("div",{className:"bm-chart-wrap",children:e.jsx(he,{points:T,metric:h})}),e.jsxs("div",{className:"bm-chart-foot",children:[e.jsx("span",{className:"legend-dot"}),"Best result over time · hover a point to see the model · click to open the paper"]})]}),a&&(()=>{var S,F;const r=a.paper_arxiv_id||a.paper_id,n=a.paper_title||(a.paper_arxiv_id?`arXiv:${a.paper_arxiv_id}`:null),l=a.best_metric&&((S=a.metrics)==null?void 0:S[a.best_metric])!==void 0?a.best_metric:h,M=(F=a.metrics)==null?void 0:F[l];return e.jsxs("div",{className:"bm-highlight-banner",role:"status",children:[e.jsx("span",{className:"bm-highlight-dot","aria-hidden":"true"}),e.jsxs("div",{className:"bm-highlight-text",children:[e.jsx("span",{className:"bm-highlight-label",children:"Comparing result"}),e.jsxs("span",{className:"bm-highlight-paper",children:[a.model_name||n||"—",a.harness?` · ${a.harness}`:""]}),e.jsxs("span",{className:"bm-highlight-meta",children:[M!==void 0&&l?e.jsxs(e.Fragment,{children:[l,": ",H(M),n?" · ":""]}):null,n&&r?e.jsx(C,{to:`/paper/${r}`,children:n}):n||null]})]})]})})(),e.jsxs("div",{className:"bm-card",children:[e.jsx("div",{className:"bm-card-head",children:e.jsx("div",{className:"bm-card-title",children:"Leaderboard"})}),o.isLoading?e.jsx("div",{style:{padding:16},children:Array.from({length:5}).map((r,n)=>e.jsx(U,{className:"h-10 w-full mb-2"},n))}):A.length===0?e.jsx("div",{className:"no-results",children:"No evaluations submitted yet."}):e.jsxs("table",{className:"bm-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:"col-rank",children:"Rank"}),e.jsx("th",{className:"col-model",children:"Model"}),W&&e.jsx("th",{className:"col-harness",children:"Harness"}),e.jsxs("th",{className:"col-value",children:[h," ",I]}),e.jsx("th",{className:"col-paper",children:"Paper"}),e.jsx("th",{className:"col-year",children:"Year"})]})}),e.jsx("tbody",{children:(()=>{let r=null,n=0;return A.map((l,M)=>{var re,le,ne;const S=D((re=l.metrics)==null?void 0:re[h]);let F=null;S!==null&&((r===null||S!==r)&&(n=M+1,r=S),F=n);const te=l.paper_arxiv_id||l.paper_id,se=l.paper_title||(l.paper_arxiv_id?`arXiv:${l.paper_arxiv_id}`:null),X=g===l.id;return e.jsxs("tr",{ref:X?R:void 0,className:X?"is-highlighted":void 0,children:[e.jsx("td",{className:"col-rank",children:F??"—"}),e.jsxs("td",{className:"col-model",children:[X&&e.jsx("span",{className:"bm-row-marker","aria-hidden":"true"}),l.model_name||"—"]}),W&&e.jsx("td",{className:"col-harness",children:l.harness||"—"}),e.jsx("td",{className:`col-value ${F===1?"is-best":""}`,children:H((le=l.metrics)==null?void 0:le[h])}),e.jsx("td",{className:"col-paper",children:te?e.jsx(C,{to:`/paper/${te}`,children:se||"—"}):se||"—"}),e.jsx("td",{className:"col-year",children:((ne=l.paper_published_date)==null?void 0:ne.slice(0,4))||"—"})]},l.id)})})()})]})]})]})})};export{ye as default};
assets/BenchmarkDetailView-Y9H61k6e.js DELETED
@@ -1 +0,0 @@
1
- import{G as ie,u as ce,r as w,j as e,L as C,I as H,H as oe}from"./index-BcdJ5r4Y.js";import{u as q}from"./adminAuth-CijC1LpP.js";import{a as z}from"./api-DVAIDRP9.js";import{S as U,A as de,a as me}from"./alert-BfBSxmdQ.js";import{L as O}from"./LatexTitle-_7AiBIQK.js";const he=({points:c,metric:k})=>{const b=oe(),[g,L]=w.useState(null),j=880,R=320,i=60,m=30,o=24,s=50,v=c.map(a=>a.value),_=Math.min(...v),Q=Math.max(...v)-_||1,A=j-i-m,T=R-o-s,V=A/Math.max(1,c.length-1),y=c.map((a,t)=>{const u=i+t*V,p=(a.value-_)/Q,N=o+T*(1-p);return{x:u,y:N,data:a}});let B=`M${y[0].x},${y[0].y}`;for(let a=1;a<y.length;a++){const t=y[a-1],u=y[a],p=(t.x+u.x)/2;B+=` C${p},${t.y} ${p},${u.y} ${u.x},${u.y}`}const d=5,I=a=>L(t=>t===a?null:t),W=a=>{a&&b(`/paper/${a}`)};return e.jsxs("svg",{width:"100%",viewBox:`0 0 ${j} ${R}`,style:{display:"block"},children:[e.jsx("text",{x:i-38,y:o+T/2,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"middle",transform:`rotate(-90 ${i-38} ${o+T/2})`,children:k}),Array.from({length:d}).map((a,t)=>{const u=t/(d-1),p=o+T*(1-u),N=_+Q*u;return e.jsxs("g",{children:[e.jsx("line",{x1:i,y1:p,x2:j-m,y2:p,stroke:"var(--hairline)",strokeWidth:"1"}),e.jsx("text",{x:i-10,y:p+4,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"end",children:H(N)})]},t)}),y.map((a,t)=>e.jsx("text",{x:a.x,y:R-s+18,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:"middle",children:a.data.dateLabel},t)),e.jsx("path",{d:B,stroke:"var(--accent)",strokeWidth:"2",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),y.map((a,t)=>{const u=g===t,N=`${a.data.modelName||a.data.paperTitle||"Unknown model"}: ${H(a.data.value)} on ${a.data.dateLabel}`,x=!!a.data.paperRouteId;return e.jsxs("g",{children:[e.jsx("circle",{cx:a.x,cy:a.y,r:u?6:4.5,fill:u?"var(--accent)":"var(--bg-elevated)",stroke:"var(--accent)",strokeWidth:"2",style:{transition:"r 0.12s ease, fill 0.12s ease"}}),e.jsx("circle",{cx:a.x,cy:a.y,r:"14",fill:"transparent",style:{cursor:x?"pointer":"default",outline:"none"},tabIndex:0,role:x?"link":"img","aria-label":N,onMouseEnter:()=>L(t),onMouseLeave:()=>I(t),onFocus:()=>L(t),onBlur:()=>I(t),onClick:()=>W(a.data.paperRouteId),onKeyDown:f=>{x&&(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),W(a.data.paperRouteId))},children:e.jsx("title",{children:N})})]},t)}),g!==null&&(()=>{const a=y[g],t=a.data.modelName||a.data.paperTitle||"Unknown model",u=t.length>40?t.slice(0,39)+"…":t,p=`${H(a.data.value)} · ${a.data.dateLabel}`,x=Math.max(140,Math.min(320,Math.max(u.length,p.length)*6.6+24)),f=46;let $=a.x-x/2;$<i&&($=i),$+x>j-m&&($=j-m-x);const E=a.y-f-14>=o?a.y-f-12:a.y+12;return e.jsxs("g",{pointerEvents:"none",children:[e.jsx("rect",{x:$,y:E,width:x,height:f,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))"}}),e.jsx("text",{x:$+12,y:E+19,fontSize:"12",fontFamily:"var(--sans)",fill:"var(--ink)",fontWeight:500,children:u}),e.jsx("text",{x:$+12,y:E+36,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",children:p})]})})()]})};function D(c){if(c==null)return null;if(typeof c=="number")return Number.isFinite(c)?c:null;const k=c.includes("±")?c.split("±")[0].trim():c.trim(),b=parseFloat(k);return Number.isFinite(b)?b:null}function ue(c,k,b){if(c.length===0)return{points:[],sota:0,sotaModel:""};const g=c.map(s=>{var h;const v=D((h=s.metrics)==null?void 0:h[k]),_=s.paper_published_date||"";return{eval:s,value:v,date:_}}).filter(s=>s.value!==null&&!!s.date).sort((s,v)=>s.date.localeCompare(v.date)),L=[];let j=null;for(const s of g)(j==null?!0:b==="↓"?s.value<j:s.value>j)&&(j=s.value,L.push({value:s.value,dateLabel:s.date.slice(0,7),modelName:s.eval.model_name||"",paperTitle:s.eval.paper_title||"",paperRouteId:s.eval.paper_arxiv_id||s.eval.paper_id||null}));const i=c.map(s=>{var v;return{eval:s,value:D((v=s.metrics)==null?void 0:v[k])}}).filter(s=>s.value!==null).sort((s,v)=>b==="↓"?s.value-v.value:v.value-s.value)[0],m=(i==null?void 0:i.value)??0,o=(i==null?void 0:i.eval.model_name)||(i==null?void 0:i.eval.paper_title)||"";return{points:L,sota:m,sotaModel:o}}const be=()=>{var K,E,P,Y,G,J,Z,ee,ae;const{datasetSlug:c}=ie(),[k]=ce(),b=k.get("task")||void 0,g=k.get("eval")||void 0,[L,j]=w.useState(void 0),R=w.useRef(null),i=w.useRef(!1),m=q({queryKey:["dataset",c,"with-paper"],queryFn:()=>z.getDatasetBySlug(c,{include_paper:!0}),enabled:!!c,staleTime:10*60*1e3}),o=q({queryKey:["dataset-evals",(K=m.data)==null?void 0:K.id],queryFn:()=>z.getEvaluationsByDataset(m.data.id),enabled:!!((E=m.data)!=null&&E.id),staleTime:5*60*1e3}),s=q({queryKey:["dataset-tasks",(P=m.data)==null?void 0:P.id],queryFn:()=>z.getDatasetTasks(m.data.id),enabled:!!((Y=m.data)!=null&&Y.id),staleTime:10*60*1e3}),v=q({queryKey:["metric-directions"],queryFn:()=>z.getMetricDirections(),staleTime:60*60*1e3}),_=w.useMemo(()=>{const r=new Set;return(o.data||[]).forEach(n=>{n.best_metric&&r.add(n.best_metric),Object.keys(n.metrics||{}).forEach(l=>r.add(l))}),Array.from(r)},[o.data]),h=L||((J=(G=o.data)==null?void 0:G[0])==null?void 0:J.best_metric)||_[0]||"",A=(((ee=(Z=v.data)==null?void 0:Z.directions)==null?void 0:ee[h])||"higher_is_better")==="lower_is_better"?"↓":"↑",{points:T,sota:V,sotaModel:y}=w.useMemo(()=>ue(o.data||[],h,A),[o.data,h,A]);w.useEffect(()=>{if(i.current||!g||!o.data||o.data.length===0)return;const r=R.current;r&&(i.current=!0,r.scrollIntoView({behavior:"smooth",block:"start"}))},[g,o.data]);const B=w.useMemo(()=>{const r=s.data||[];if(r.length===0)return null;if(b){const n=r.find(l=>l.slug===b);if(n)return n}return r[0]},[s.data,b]);if(m.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(U,{className:"h-12 w-1/2 mb-6"}),e.jsx(U,{className:"h-64 w-full"})]});if(m.error||!m.data)return e.jsx("div",{className:"page",children:e.jsx(de,{variant:"destructive",children:e.jsx(me,{children:"Benchmark not found."})})});const d=m.data,I=(o.data||[]).slice().sort((r,n)=>{var S,F;const l=D((S=r.metrics)==null?void 0:S[h]),M=D((F=n.metrics)==null?void 0:F[h]);return l!==null&&M!==null?A==="↓"?l-M:M-l:l!==null?-1:M!==null?1:(r.best_rank??9999)-(n.best_rank??9999)}),W=!!d.supports_harness,a=g&&I.find(r=>r.id===g)||null,t=d.introducing_paper??void 0,u=(()=>{if(!d.paper_url)return null;const r=d.paper_url.match(/arxiv\.org\/(?:abs|pdf)\/([\w.-]+)/i);if(r&&r[1])return r[1].replace(/\.pdf$/i,"");const n=d.paper_url.match(/\/(?:paper|abs|pdf)\/([\w.-]+)/i);return n&&n[1]?n[1].replace(/\.pdf$/i,""):null})(),p=(t==null?void 0:t.arxiv_id)||u,N=p,x=(t==null?void 0:t.title)||d.introducing_paper_title||null,f=((ae=t==null?void 0:t.published)==null?void 0:ae.slice(0,4))||d.introduced_year||null,$=!!p||!!d.paper_url||!!x;return e.jsx("div",{className:"page",children:e.jsxs("div",{className:"bm-page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(C,{to:"/tasks",children:"Tasks"}),B&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(C,{to:`/tasks/${B.slug||B.id}`,children:B.name})]}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--accent-text)"},children:d.name})]}),e.jsx("h1",{className:"bm-title",children:d.name}),e.jsxs("div",{className:"bm-subtitle",children:[h&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"metric-tag",children:h}),e.jsx("span",{style:{color:"var(--hairline-strong)",margin:"0 8px"},children:"·"})]}),y?e.jsxs("span",{children:["Best: ",e.jsx("span",{className:"best-name",children:H(V)})," by ",e.jsx("span",{className:"best-name",style:{fontStyle:"normal"},children:y})]}):e.jsxs("span",{children:[I.length," evaluations"]})]}),d.description&&e.jsx("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",maxWidth:760,marginBottom:16},children:d.description}),$&&e.jsxs("div",{className:"method-source",style:{marginTop:0,marginBottom:18},children:[e.jsx("span",{className:"method-source-label",children:"Source"}),N?e.jsxs(C,{to:`/paper/${N}`,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[e.jsx("span",{className:"method-source-title",children:x?e.jsx(O,{title:x}):`arXiv:${N}`}),f&&e.jsx("span",{className:"method-source-meta",children:f})]}):d.paper_url?e.jsxs("a",{href:d.paper_url,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[e.jsx("span",{className:"method-source-title",children:x?e.jsx(O,{title:x}):p?`arXiv:${p}`:d.paper_url}),f&&e.jsx("span",{className:"method-source-meta",children:f})]}):e.jsxs("div",{className:"method-source-link is-static",children:[e.jsx("span",{className:"method-source-title",children:x?e.jsx(O,{title:x}):null}),f&&e.jsx("span",{className:"method-source-meta",children:f})]})]}),_.length>1&&e.jsxs("div",{className:"bm-actions",children:[e.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginRight:8},children:"METRIC"}),_.map(r=>e.jsx("button",{className:`bm-action-btn ${r===h?"is-active":""}`,onClick:()=>j(r),children:r},r))]}),T.length>=2&&e.jsxs("div",{className:"bm-card",children:[e.jsx("div",{className:"bm-card-head",children:e.jsx("div",{className:"bm-card-title",children:"SOTA progression"})}),e.jsx("div",{className:"bm-chart-wrap",children:e.jsx(he,{points:T,metric:h})}),e.jsxs("div",{className:"bm-chart-foot",children:[e.jsx("span",{className:"legend-dot"}),"Best result over time · hover a point to see the model · click to open the paper"]})]}),a&&(()=>{var S,F;const r=a.paper_arxiv_id||a.paper_id,n=a.paper_title||(a.paper_arxiv_id?`arXiv:${a.paper_arxiv_id}`:null),l=a.best_metric&&((S=a.metrics)==null?void 0:S[a.best_metric])!==void 0?a.best_metric:h,M=(F=a.metrics)==null?void 0:F[l];return e.jsxs("div",{className:"bm-highlight-banner",role:"status",children:[e.jsx("span",{className:"bm-highlight-dot","aria-hidden":"true"}),e.jsxs("div",{className:"bm-highlight-text",children:[e.jsx("span",{className:"bm-highlight-label",children:"Comparing result"}),e.jsxs("span",{className:"bm-highlight-paper",children:[a.model_name||n||"—",a.harness?` · ${a.harness}`:""]}),e.jsxs("span",{className:"bm-highlight-meta",children:[M!==void 0&&l?e.jsxs(e.Fragment,{children:[l,": ",H(M),n?" · ":""]}):null,n&&r?e.jsx(C,{to:`/paper/${r}`,children:n}):n||null]})]})]})})(),e.jsxs("div",{className:"bm-card",children:[e.jsx("div",{className:"bm-card-head",children:e.jsx("div",{className:"bm-card-title",children:"Leaderboard"})}),o.isLoading?e.jsx("div",{style:{padding:16},children:Array.from({length:5}).map((r,n)=>e.jsx(U,{className:"h-10 w-full mb-2"},n))}):I.length===0?e.jsx("div",{className:"no-results",children:"No evaluations submitted yet."}):e.jsxs("table",{className:"bm-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:"col-rank",children:"Rank"}),e.jsx("th",{className:"col-model",children:"Model"}),W&&e.jsx("th",{className:"col-harness",children:"Harness"}),e.jsxs("th",{className:"col-value",children:[h," ",A]}),e.jsx("th",{className:"col-paper",children:"Paper"}),e.jsx("th",{className:"col-year",children:"Year"})]})}),e.jsx("tbody",{children:(()=>{let r=null,n=0;return I.map((l,M)=>{var re,le,ne;const S=D((re=l.metrics)==null?void 0:re[h]);let F=null;S!==null&&((r===null||S!==r)&&(n=M+1,r=S),F=n);const te=l.paper_arxiv_id||l.paper_id,se=l.paper_title||(l.paper_arxiv_id?`arXiv:${l.paper_arxiv_id}`:null),X=g===l.id;return e.jsxs("tr",{ref:X?R:void 0,className:X?"is-highlighted":void 0,children:[e.jsx("td",{className:"col-rank",children:F??"—"}),e.jsxs("td",{className:"col-model",children:[X&&e.jsx("span",{className:"bm-row-marker","aria-hidden":"true"}),l.model_name||"—"]}),W&&e.jsx("td",{className:"col-harness",children:l.harness||"—"}),e.jsx("td",{className:`col-value ${F===1?"is-best":""}`,children:H((le=l.metrics)==null?void 0:le[h])}),e.jsx("td",{className:"col-paper",children:te?e.jsx(C,{to:`/paper/${te}`,children:se||"—"}):se||"—"}),e.jsx("td",{className:"col-year",children:((ne=l.paper_published_date)==null?void 0:ne.slice(0,4))||"—"})]},l.id)})})()})]})]})]})})};export{be as default};
 
 
assets/{CronDashboard-BIltSfhQ.js → CronDashboard-_5HLppM_.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{d as m,r as i,j as e,o as w,z as Y,E as Z}from"./index-BcdJ5r4Y.js";import{i as G,u as ee,j as se}from"./adminAuth-CijC1LpP.js";import{B as b,I as te,L as R,a as N,D as ae}from"./badge-Buw8W5Kz.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
@@ -53,4 +53,4 @@ import{d as m,r as i,j as e,o as w,z as Y,E as Z}from"./index-BcdJ5r4Y.js";impor
53
  *
54
  * This source code is licensed under the ISC license.
55
  * See the LICENSE file in the root directory of this source tree.
56
- */const de=m("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]),d=i.forwardRef(({className:s,...a},n)=>e.jsx("div",{ref:n,className:w("rounded-lg border bg-card text-card-foreground shadow-sm",s),...a}));d.displayName="Card";const y=i.forwardRef(({className:s,...a},n)=>e.jsx("div",{ref:n,className:w("flex flex-col space-y-1.5 p-6",s),...a}));y.displayName="CardHeader";const j=i.forwardRef(({className:s,...a},n)=>e.jsx("h3",{ref:n,className:w("text-2xl font-semibold leading-none tracking-tight",s),...a}));j.displayName="CardTitle";const X=i.forwardRef(({className:s,...a},n)=>e.jsx("p",{ref:n,className:w("text-sm text-muted-foreground",s),...a}));X.displayName="CardDescription";const o=i.forwardRef(({className:s,...a},n)=>e.jsx("div",{ref:n,className:w("p-6 pt-0",s),...a}));o.displayName="CardContent";const oe=i.forwardRef(({className:s,...a},n)=>e.jsx("div",{ref:n,className:w("flex items-center p-6 pt-0",s),...a}));oe.displayName="CardFooter";const me=async s=>{const a=s?{"X-Admin-Token":s}:{},n=await fetch(Z("/api/v1/cron/status"),{headers:a,credentials:"include"});if(n.status===401)throw new Error("Unauthorized. Sign in with Hugging Face or paste a valid admin token.");if(!n.ok)throw new Error("Failed to fetch cron status");return n.json()},J=()=>se(),xe=({status:s,isRunning:a})=>{if(a)return e.jsx(R,{className:"h-5 w-5 text-blue-500 animate-spin"});switch(s){case"success":return e.jsx(L,{className:"h-5 w-5 text-green-500"});case"success_no_work":return e.jsx(L,{className:"h-5 w-5 text-yellow-500"});case"failed":return e.jsx(B,{className:"h-5 w-5 text-red-500"});case"running":return e.jsx(R,{className:"h-5 w-5 text-blue-500 animate-spin"});default:return e.jsx(ie,{className:"h-5 w-5 text-gray-400"})}},he=({status:s,isRunning:a})=>{if(a)return e.jsx(N,{variant:"outline",className:"bg-blue-50 text-blue-700 border-blue-300",children:"Running"});switch(s){case"success":return e.jsx(N,{variant:"outline",className:"bg-green-50 text-green-700 border-green-300",children:"Success"});case"success_no_work":return e.jsx(N,{variant:"outline",className:"bg-yellow-50 text-yellow-700 border-yellow-300",children:"Success (No Work)"});case"failed":return e.jsx(N,{variant:"outline",className:"bg-red-50 text-red-700 border-red-300",children:"Failed"});default:return e.jsx(N,{variant:"outline",className:"bg-gray-50 text-gray-700 border-gray-300",children:"Unknown"})}},ue=s=>s.replace(/_/g," ").split(" ").map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" "),I=s=>{if(!s)return"Never";try{const a=new Date(s),x=new Date().getTime()-a.getTime(),l=Math.floor(x/6e4),f=Math.floor(x/36e5),u=Math.floor(x/864e5);return l<1?"Just now":l<60?`${l}m ago`:f<24?`${f}h ago`:u<7?`${u}d ago`:a.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return s}},pe=s=>{if(!s)return"Not scheduled";try{const a=new Date(s),n=new Date,x=a.getTime()-n.getTime(),l=Math.floor(x/6e4),f=Math.floor(x/36e5),u=Math.floor(x/864e5);return x<0?"Overdue":l<1?"Just now":l<60?`in ${l}m`:f<24?`in ${f}h`:u<7?`in ${u}d`:a.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return s}},ge=s=>s?s<60?`${s.toFixed(1)}s`:s<3600?`${(s/60).toFixed(1)}m`:`${(s/3600).toFixed(1)}h`:"N/A",fe={hourly:"bg-blue-100 text-blue-800 border-blue-200",daily:"bg-purple-100 text-purple-800 border-purple-200",weekly:"bg-orange-100 text-orange-800 border-orange-200",monthly:"bg-pink-100 text-pink-800 border-pink-200"},we=()=>{const[s,a]=i.useState(!0),[n,x]=i.useState(new Set),[l,f]=i.useState(()=>J()),[u,A]=i.useState(()=>J()),[_,D]=i.useState(!1),{user:p}=Y(),M=!!(p!=null&&p.is_admin);i.useEffect(()=>{G(l)},[l]),i.useEffect(()=>{if(!_)return;const r=window.setTimeout(()=>D(!1),2e3);return()=>window.clearTimeout(r)},[_]);const P=()=>{f(u.trim()),D(!0)},H=()=>{A(""),f("")},g=M||l.trim().length>0,{data:c,isLoading:W,isFetching:z,error:S,refetch:K}=ee({queryKey:["cronStatus",M?`hf:${p==null?void 0:p.username}`:l],queryFn:()=>me(l.trim()),enabled:g,refetchInterval:g&&s?3e4:!1,retry:!1}),v=S instanceof Error?S.message:void 0,E=r=>{x(t=>{const h=new Set(t);return h.has(r)?h.delete(r):h.add(r),h})},k=(c==null?void 0:c.jobs.reduce((r,t)=>(r[t.category]||(r[t.category]=[]),r[t.category].push(t),r),{}))||{},$=Object.keys(k).sort((r,t)=>{const h=["hourly","daily","weekly","monthly"];return h.indexOf(r)-h.indexOf(t)}),Q=r=>r>=80?"text-green-600":r>=60?"text-yellow-600":"text-red-600";return e.jsx("div",{className:"min-h-screen bg-gradient-to-b from-gray-50 to-white","data-shadcn":!0,children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[e.jsx("div",{className:"mb-8",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-3xl font-bold text-gray-900 flex items-center gap-3",children:[e.jsx(F,{className:"h-8 w-8 text-blue-600"}),"CRON Job Dashboard"]}),e.jsx("p",{className:"mt-2 text-gray-600",children:"Monitor and manage automated tasks"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>a(!s),disabled:!g,className:`${s?"border-blue-500 text-blue-600":""} ${g?"":"opacity-60 cursor-not-allowed"}`,children:[e.jsx(q,{className:`h-4 w-4 mr-2 ${s&&g?"animate-spin":""}`}),"Auto-refresh ",s?"ON":"OFF"]}),e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>K(),disabled:!g||z,children:[e.jsx(q,{className:`h-4 w-4 mr-2 ${z?"animate-spin":""}`}),"Refresh"]})]})]})}),M?e.jsx(d,{className:"mb-6",children:e.jsx(o,{className:"pt-6",children:e.jsxs("p",{className:"text-sm text-gray-700",children:["Signed in as ",e.jsxs("span",{className:"font-semibold",children:["@",p==null?void 0:p.username]}),". Your admin permissions are derived from the ",e.jsx("code",{className:"font-mono",children:"PWC_ADMIN_HF_USERNAMES"})," ","allowlist; CRON metrics will refresh automatically."]})})}):e.jsx(d,{className:"mb-6",children:e.jsxs(o,{className:"pt-6 space-y-3",children:[e.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-gray-800",children:"Admin token"}),e.jsxs("p",{className:"text-sm text-gray-600",children:["Sign in with Hugging Face from the header for the easiest path. Otherwise, paste your admin token here. The token is stored locally in this browser and sent with requests as the ",e.jsx("code",{className:"font-mono",children:"X-Admin-Token"})," header."]})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2 w-full md:w-auto",children:[e.jsx(te,{type:"password",placeholder:"Enter admin token",value:u,onChange:r=>A(r.target.value),className:"sm:w-64"}),e.jsx(b,{size:"sm",onClick:P,disabled:!u.trim(),children:"Apply token"}),l&&e.jsx(b,{variant:"ghost",size:"sm",onClick:H,children:"Clear"})]})]}),_&&e.jsx("p",{className:"text-xs text-green-600",children:"Token saved. Future requests will automatically include it."}),e.jsx("p",{className:`text-xs ${g?"text-gray-500":"text-blue-700"}`,children:g?"Token stored locally in this browser. Clear it when you are finished on shared devices.":"Enter your admin token above (or sign in with Hugging Face) to enable CRON job monitoring."})]})}),W&&g&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(R,{className:"h-8 w-8 animate-spin text-blue-500"}),e.jsx("span",{className:"ml-3 text-gray-600",children:"Loading CRON jobs status..."})]}),S&&e.jsx(d,{className:"border-red-200 bg-red-50",children:e.jsx(o,{className:"pt-6",children:e.jsxs("div",{className:"flex flex-col gap-3 text-red-800",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(B,{className:"h-5 w-5"}),e.jsx("p",{children:v??"Failed to load CRON jobs status. Please try again."})]}),(v==null?void 0:v.toLowerCase().includes("unauthorized"))&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(b,{variant:"outline",size:"sm",onClick:H,children:"Clear saved token"}),e.jsx("span",{className:"text-sm text-red-700",children:"Re-enter your admin token to continue."})]})]})})}),c&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-5 gap-4 mb-8",children:[e.jsxs(d,{children:[e.jsx(y,{className:"pb-3",children:e.jsx(j,{className:"text-sm font-medium text-gray-600",children:"Total Jobs"})}),e.jsx(o,{children:e.jsx("div",{className:"text-2xl font-bold",children:c.summary.total_jobs})})]}),e.jsxs(d,{children:[e.jsx(y,{className:"pb-3",children:e.jsx(j,{className:"text-sm font-medium text-gray-600",children:"Successful"})}),e.jsx(o,{children:e.jsx("div",{className:"text-2xl font-bold text-green-600",children:c.summary.success})})]}),e.jsxs(d,{children:[e.jsx(y,{className:"pb-3",children:e.jsx(j,{className:"text-sm font-medium text-gray-600",children:"Failed"})}),e.jsx(o,{children:e.jsx("div",{className:"text-2xl font-bold text-red-600",children:c.summary.failed})})]}),e.jsxs(d,{children:[e.jsx(y,{className:"pb-3",children:e.jsx(j,{className:"text-sm font-medium text-gray-600",children:"Running"})}),e.jsx(o,{children:e.jsx("div",{className:"text-2xl font-bold text-blue-600",children:c.summary.running})})]}),e.jsxs(d,{children:[e.jsx(y,{className:"pb-3",children:e.jsx(j,{className:"text-sm font-medium text-gray-600",children:"Health Score"})}),e.jsx(o,{children:e.jsxs("div",{className:`text-2xl font-bold ${Q(c.summary.health_score)}`,children:[c.summary.health_score.toFixed(0),"%"]})})]})]}),e.jsxs("div",{className:"mb-6 text-sm text-gray-500 flex items-center gap-2",children:[e.jsx(U,{className:"h-4 w-4"}),"Last updated: ",I(c.timestamp)]}),e.jsx("div",{className:"space-y-6",children:$.map(r=>e.jsxs(d,{children:[e.jsx(y,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(j,{className:"text-xl capitalize flex items-center gap-2",children:[e.jsx(N,{className:fe[r],children:r}),e.jsxs("span",{className:"text-gray-700",children:[r," Jobs"]})]}),e.jsxs(X,{children:[k[r].length," job",k[r].length!==1?"s":""]})]})}),e.jsx(o,{children:e.jsx("div",{className:"space-y-4",children:k[r].map(t=>{const h=n.has(t.job_name),O=t.work_metrics&&Object.keys(t.work_metrics).length>0;return e.jsxs("div",{className:"border rounded-lg overflow-hidden transition-all",children:[e.jsx("div",{className:"p-4 hover:bg-gray-50 transition-colors cursor-pointer",onClick:()=>E(t.job_name),children:e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex items-start gap-3 flex-1",children:[e.jsx(xe,{status:t.status,isRunning:t.is_running}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("h3",{className:"font-semibold text-gray-900",children:ue(t.job_name)}),O&&e.jsx("button",{className:"text-gray-400 hover:text-gray-600 transition-colors",onClick:C=>{C.stopPropagation(),E(t.job_name)},children:h?e.jsx(le,{className:"h-4 w-4"}):e.jsx(ne,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-2 text-sm text-gray-600",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(U,{className:"h-4 w-4"}),e.jsxs("span",{children:["Last: ",I(t.last_run)]})]}),t.duration!==null&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(de,{className:"h-4 w-4"}),e.jsxs("span",{children:["Duration: ",ge(t.duration)]})]}),t.schedule&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(re,{className:"h-4 w-4"}),e.jsx("span",{className:"font-mono text-xs",children:t.schedule})]}),t.next_run&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(F,{className:"h-4 w-4"}),e.jsxs("span",{children:["Next: ",pe(t.next_run)]})]})]}),t.work_summary&&e.jsxs("div",{className:"mt-2 text-sm text-gray-600 bg-gray-100 rounded px-2 py-1 flex items-center gap-1",children:[e.jsx(ce,{className:"h-3 w-3"}),e.jsx("span",{children:t.work_summary})]}),t.error&&e.jsxs("div",{className:"mt-2 text-sm text-red-600 bg-red-50 rounded px-2 py-1",children:[e.jsx("span",{className:"font-semibold",children:"Error: "}),t.error]})]})]}),e.jsx(he,{status:t.status,isRunning:t.is_running})]})}),h&&O&&e.jsxs("div",{className:"border-t bg-gray-50 p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(ae,{className:"h-4 w-4 text-gray-600"}),e.jsx("h4",{className:"font-semibold text-gray-700",children:"Work Metrics"})]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-3",children:Object.entries(t.work_metrics).map(([C,T])=>e.jsxs("div",{className:"bg-white rounded border border-gray-200 p-3",children:[e.jsx("div",{className:"text-xs text-gray-500 mb-1",children:C.replace(/_/g," ").replace(/\b\w/g,V=>V.toUpperCase())}),e.jsx("div",{className:"text-lg font-semibold text-gray-900",children:typeof T=="number"?T.toLocaleString():T})]},C))})]})]},t.job_name)})})})]},r))}),$.length===0&&e.jsx(d,{children:e.jsx(o,{className:"pt-6",children:e.jsxs("div",{className:"text-center text-gray-500 py-12",children:[e.jsx(F,{className:"h-12 w-12 mx-auto mb-4 text-gray-400"}),e.jsx("p",{children:"No CRON jobs found"})]})})})]})]})})};export{we as default};
 
1
+ import{c as m,r as i,j as e,h as w,s as Y,w as Z}from"./index-BWQiUBNk.js";import{u as G}from"./useQuery-B941khzD.js";import{L as R,B as N,D as ee}from"./badge-Ds2a6Q8t.js";import{B as b,I as se}from"./input-DZmGAzFu.js";import{s as te,g as ae}from"./adminAuth-PI_XkM8E.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
53
  *
54
  * This source code is licensed under the ISC license.
55
  * See the LICENSE file in the root directory of this source tree.
56
+ */const de=m("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]),d=i.forwardRef(({className:s,...a},n)=>e.jsx("div",{ref:n,className:w("rounded-lg border bg-card text-card-foreground shadow-sm",s),...a}));d.displayName="Card";const y=i.forwardRef(({className:s,...a},n)=>e.jsx("div",{ref:n,className:w("flex flex-col space-y-1.5 p-6",s),...a}));y.displayName="CardHeader";const j=i.forwardRef(({className:s,...a},n)=>e.jsx("h3",{ref:n,className:w("text-2xl font-semibold leading-none tracking-tight",s),...a}));j.displayName="CardTitle";const X=i.forwardRef(({className:s,...a},n)=>e.jsx("p",{ref:n,className:w("text-sm text-muted-foreground",s),...a}));X.displayName="CardDescription";const o=i.forwardRef(({className:s,...a},n)=>e.jsx("div",{ref:n,className:w("p-6 pt-0",s),...a}));o.displayName="CardContent";const oe=i.forwardRef(({className:s,...a},n)=>e.jsx("div",{ref:n,className:w("flex items-center p-6 pt-0",s),...a}));oe.displayName="CardFooter";const me=async s=>{const a=s?{"X-Admin-Token":s}:{},n=await fetch(Z("/api/v1/cron/status"),{headers:a,credentials:"include"});if(n.status===401)throw new Error("Unauthorized. Sign in with Hugging Face or paste a valid admin token.");if(!n.ok)throw new Error("Failed to fetch cron status");return n.json()},J=()=>ae(),xe=({status:s,isRunning:a})=>{if(a)return e.jsx(R,{className:"h-5 w-5 text-blue-500 animate-spin"});switch(s){case"success":return e.jsx(L,{className:"h-5 w-5 text-green-500"});case"success_no_work":return e.jsx(L,{className:"h-5 w-5 text-yellow-500"});case"failed":return e.jsx(B,{className:"h-5 w-5 text-red-500"});case"running":return e.jsx(R,{className:"h-5 w-5 text-blue-500 animate-spin"});default:return e.jsx(ie,{className:"h-5 w-5 text-gray-400"})}},he=({status:s,isRunning:a})=>{if(a)return e.jsx(N,{variant:"outline",className:"bg-blue-50 text-blue-700 border-blue-300",children:"Running"});switch(s){case"success":return e.jsx(N,{variant:"outline",className:"bg-green-50 text-green-700 border-green-300",children:"Success"});case"success_no_work":return e.jsx(N,{variant:"outline",className:"bg-yellow-50 text-yellow-700 border-yellow-300",children:"Success (No Work)"});case"failed":return e.jsx(N,{variant:"outline",className:"bg-red-50 text-red-700 border-red-300",children:"Failed"});default:return e.jsx(N,{variant:"outline",className:"bg-gray-50 text-gray-700 border-gray-300",children:"Unknown"})}},ue=s=>s.replace(/_/g," ").split(" ").map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" "),I=s=>{if(!s)return"Never";try{const a=new Date(s),x=new Date().getTime()-a.getTime(),l=Math.floor(x/6e4),f=Math.floor(x/36e5),u=Math.floor(x/864e5);return l<1?"Just now":l<60?`${l}m ago`:f<24?`${f}h ago`:u<7?`${u}d ago`:a.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return s}},pe=s=>{if(!s)return"Not scheduled";try{const a=new Date(s),n=new Date,x=a.getTime()-n.getTime(),l=Math.floor(x/6e4),f=Math.floor(x/36e5),u=Math.floor(x/864e5);return x<0?"Overdue":l<1?"Just now":l<60?`in ${l}m`:f<24?`in ${f}h`:u<7?`in ${u}d`:a.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return s}},ge=s=>s?s<60?`${s.toFixed(1)}s`:s<3600?`${(s/60).toFixed(1)}m`:`${(s/3600).toFixed(1)}h`:"N/A",fe={hourly:"bg-blue-100 text-blue-800 border-blue-200",daily:"bg-purple-100 text-purple-800 border-purple-200",weekly:"bg-orange-100 text-orange-800 border-orange-200",monthly:"bg-pink-100 text-pink-800 border-pink-200"},ve=()=>{const[s,a]=i.useState(!0),[n,x]=i.useState(new Set),[l,f]=i.useState(()=>J()),[u,A]=i.useState(()=>J()),[_,D]=i.useState(!1),{user:p}=Y(),M=!!(p!=null&&p.is_admin);i.useEffect(()=>{te(l)},[l]),i.useEffect(()=>{if(!_)return;const r=window.setTimeout(()=>D(!1),2e3);return()=>window.clearTimeout(r)},[_]);const P=()=>{f(u.trim()),D(!0)},H=()=>{A(""),f("")},g=M||l.trim().length>0,{data:c,isLoading:W,isFetching:$,error:S,refetch:K}=G({queryKey:["cronStatus",M?`hf:${p==null?void 0:p.username}`:l],queryFn:()=>me(l.trim()),enabled:g,refetchInterval:g&&s?3e4:!1,retry:!1}),v=S instanceof Error?S.message:void 0,z=r=>{x(t=>{const h=new Set(t);return h.has(r)?h.delete(r):h.add(r),h})},k=(c==null?void 0:c.jobs.reduce((r,t)=>(r[t.category]||(r[t.category]=[]),r[t.category].push(t),r),{}))||{},E=Object.keys(k).sort((r,t)=>{const h=["hourly","daily","weekly","monthly"];return h.indexOf(r)-h.indexOf(t)}),Q=r=>r>=80?"text-green-600":r>=60?"text-yellow-600":"text-red-600";return e.jsx("div",{className:"min-h-screen bg-gradient-to-b from-gray-50 to-white","data-shadcn":!0,children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[e.jsx("div",{className:"mb-8",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-3xl font-bold text-gray-900 flex items-center gap-3",children:[e.jsx(F,{className:"h-8 w-8 text-blue-600"}),"CRON Job Dashboard"]}),e.jsx("p",{className:"mt-2 text-gray-600",children:"Monitor and manage automated tasks"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>a(!s),disabled:!g,className:`${s?"border-blue-500 text-blue-600":""} ${g?"":"opacity-60 cursor-not-allowed"}`,children:[e.jsx(q,{className:`h-4 w-4 mr-2 ${s&&g?"animate-spin":""}`}),"Auto-refresh ",s?"ON":"OFF"]}),e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>K(),disabled:!g||$,children:[e.jsx(q,{className:`h-4 w-4 mr-2 ${$?"animate-spin":""}`}),"Refresh"]})]})]})}),M?e.jsx(d,{className:"mb-6",children:e.jsx(o,{className:"pt-6",children:e.jsxs("p",{className:"text-sm text-gray-700",children:["Signed in as ",e.jsxs("span",{className:"font-semibold",children:["@",p==null?void 0:p.username]}),". Your admin permissions are derived from the ",e.jsx("code",{className:"font-mono",children:"PWC_ADMIN_HF_USERNAMES"})," ","allowlist; CRON metrics will refresh automatically."]})})}):e.jsx(d,{className:"mb-6",children:e.jsxs(o,{className:"pt-6 space-y-3",children:[e.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-gray-800",children:"Admin token"}),e.jsxs("p",{className:"text-sm text-gray-600",children:["Sign in with Hugging Face from the header for the easiest path. Otherwise, paste your admin token here. The token is stored locally in this browser and sent with requests as the ",e.jsx("code",{className:"font-mono",children:"X-Admin-Token"})," header."]})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2 w-full md:w-auto",children:[e.jsx(se,{type:"password",placeholder:"Enter admin token",value:u,onChange:r=>A(r.target.value),className:"sm:w-64"}),e.jsx(b,{size:"sm",onClick:P,disabled:!u.trim(),children:"Apply token"}),l&&e.jsx(b,{variant:"ghost",size:"sm",onClick:H,children:"Clear"})]})]}),_&&e.jsx("p",{className:"text-xs text-green-600",children:"Token saved. Future requests will automatically include it."}),e.jsx("p",{className:`text-xs ${g?"text-gray-500":"text-blue-700"}`,children:g?"Token stored locally in this browser. Clear it when you are finished on shared devices.":"Enter your admin token above (or sign in with Hugging Face) to enable CRON job monitoring."})]})}),W&&g&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(R,{className:"h-8 w-8 animate-spin text-blue-500"}),e.jsx("span",{className:"ml-3 text-gray-600",children:"Loading CRON jobs status..."})]}),S&&e.jsx(d,{className:"border-red-200 bg-red-50",children:e.jsx(o,{className:"pt-6",children:e.jsxs("div",{className:"flex flex-col gap-3 text-red-800",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(B,{className:"h-5 w-5"}),e.jsx("p",{children:v??"Failed to load CRON jobs status. Please try again."})]}),(v==null?void 0:v.toLowerCase().includes("unauthorized"))&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(b,{variant:"outline",size:"sm",onClick:H,children:"Clear saved token"}),e.jsx("span",{className:"text-sm text-red-700",children:"Re-enter your admin token to continue."})]})]})})}),c&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-5 gap-4 mb-8",children:[e.jsxs(d,{children:[e.jsx(y,{className:"pb-3",children:e.jsx(j,{className:"text-sm font-medium text-gray-600",children:"Total Jobs"})}),e.jsx(o,{children:e.jsx("div",{className:"text-2xl font-bold",children:c.summary.total_jobs})})]}),e.jsxs(d,{children:[e.jsx(y,{className:"pb-3",children:e.jsx(j,{className:"text-sm font-medium text-gray-600",children:"Successful"})}),e.jsx(o,{children:e.jsx("div",{className:"text-2xl font-bold text-green-600",children:c.summary.success})})]}),e.jsxs(d,{children:[e.jsx(y,{className:"pb-3",children:e.jsx(j,{className:"text-sm font-medium text-gray-600",children:"Failed"})}),e.jsx(o,{children:e.jsx("div",{className:"text-2xl font-bold text-red-600",children:c.summary.failed})})]}),e.jsxs(d,{children:[e.jsx(y,{className:"pb-3",children:e.jsx(j,{className:"text-sm font-medium text-gray-600",children:"Running"})}),e.jsx(o,{children:e.jsx("div",{className:"text-2xl font-bold text-blue-600",children:c.summary.running})})]}),e.jsxs(d,{children:[e.jsx(y,{className:"pb-3",children:e.jsx(j,{className:"text-sm font-medium text-gray-600",children:"Health Score"})}),e.jsx(o,{children:e.jsxs("div",{className:`text-2xl font-bold ${Q(c.summary.health_score)}`,children:[c.summary.health_score.toFixed(0),"%"]})})]})]}),e.jsxs("div",{className:"mb-6 text-sm text-gray-500 flex items-center gap-2",children:[e.jsx(U,{className:"h-4 w-4"}),"Last updated: ",I(c.timestamp)]}),e.jsx("div",{className:"space-y-6",children:E.map(r=>e.jsxs(d,{children:[e.jsx(y,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(j,{className:"text-xl capitalize flex items-center gap-2",children:[e.jsx(N,{className:fe[r],children:r}),e.jsxs("span",{className:"text-gray-700",children:[r," Jobs"]})]}),e.jsxs(X,{children:[k[r].length," job",k[r].length!==1?"s":""]})]})}),e.jsx(o,{children:e.jsx("div",{className:"space-y-4",children:k[r].map(t=>{const h=n.has(t.job_name),O=t.work_metrics&&Object.keys(t.work_metrics).length>0;return e.jsxs("div",{className:"border rounded-lg overflow-hidden transition-all",children:[e.jsx("div",{className:"p-4 hover:bg-gray-50 transition-colors cursor-pointer",onClick:()=>z(t.job_name),children:e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex items-start gap-3 flex-1",children:[e.jsx(xe,{status:t.status,isRunning:t.is_running}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("h3",{className:"font-semibold text-gray-900",children:ue(t.job_name)}),O&&e.jsx("button",{className:"text-gray-400 hover:text-gray-600 transition-colors",onClick:C=>{C.stopPropagation(),z(t.job_name)},children:h?e.jsx(le,{className:"h-4 w-4"}):e.jsx(ne,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-2 text-sm text-gray-600",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(U,{className:"h-4 w-4"}),e.jsxs("span",{children:["Last: ",I(t.last_run)]})]}),t.duration!==null&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(de,{className:"h-4 w-4"}),e.jsxs("span",{children:["Duration: ",ge(t.duration)]})]}),t.schedule&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(re,{className:"h-4 w-4"}),e.jsx("span",{className:"font-mono text-xs",children:t.schedule})]}),t.next_run&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(F,{className:"h-4 w-4"}),e.jsxs("span",{children:["Next: ",pe(t.next_run)]})]})]}),t.work_summary&&e.jsxs("div",{className:"mt-2 text-sm text-gray-600 bg-gray-100 rounded px-2 py-1 flex items-center gap-1",children:[e.jsx(ce,{className:"h-3 w-3"}),e.jsx("span",{children:t.work_summary})]}),t.error&&e.jsxs("div",{className:"mt-2 text-sm text-red-600 bg-red-50 rounded px-2 py-1",children:[e.jsx("span",{className:"font-semibold",children:"Error: "}),t.error]})]})]}),e.jsx(he,{status:t.status,isRunning:t.is_running})]})}),h&&O&&e.jsxs("div",{className:"border-t bg-gray-50 p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(ee,{className:"h-4 w-4 text-gray-600"}),e.jsx("h4",{className:"font-semibold text-gray-700",children:"Work Metrics"})]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-3",children:Object.entries(t.work_metrics).map(([C,T])=>e.jsxs("div",{className:"bg-white rounded border border-gray-200 p-3",children:[e.jsx("div",{className:"text-xs text-gray-500 mb-1",children:C.replace(/_/g," ").replace(/\b\w/g,V=>V.toUpperCase())}),e.jsx("div",{className:"text-lg font-semibold text-gray-900",children:typeof T=="number"?T.toLocaleString():T})]},C))})]})]},t.job_name)})})})]},r))}),E.length===0&&e.jsx(d,{children:e.jsx(o,{className:"pt-6",children:e.jsxs("div",{className:"text-center text-gray-500 py-12",children:[e.jsx(F,{className:"h-12 w-12 mx-auto mb-4 text-gray-400"}),e.jsx("p",{children:"No CRON jobs found"})]})})})]})]})})};export{ve as default};
assets/FeedView-C2lfpfbU.js DELETED
@@ -1 +0,0 @@
1
- import{u as S,r as y,j as e,L as m}from"./index-BcdJ5r4Y.js";import{P as I}from"./components-MYNA0qNJ.js";import{a as T}from"./api-DVAIDRP9.js";import{t as L,a as E,d as _}from"./transform-Dasg-XFy.js";import{u as R,a as D}from"./usePapers-Swv3hMJI.js";import{u as M}from"./useIntersectionObserver-DfztqSja.js";import{P as C}from"./usePeriodFilter-B4RSLVJ3.js";import{S as n,A as W,a as q}from"./alert-BfBSxmdQ.js";import{u as b}from"./adminAuth-CijC1LpP.js";import"./LatexTitle-_7AiBIQK.js";import"./useInfiniteQuery-jK6uM4vU.js";const $=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],B={Today:"today","This Week":"week","This Month":"month","All Time":"all_time"},z={today:"Today",week:"This Week",month:"This Month",all_time:"All Time"},K={today:1,week:7,month:30,all_time:365},U=i=>i==="trending"||i==="date_published"||i==="citation_count"?i:"trending",X=i=>i==="today"||i==="week"||i==="month"||i==="all_time"?i:"all_time",re=()=>{var x,u,j,f,N;const[i,h]=S(),r=U(i.get("order_by")),o=X(i.get("time")),v=z[o],P=s=>{const a=new URLSearchParams(i);a.set("order_by",s),h(a)},w=s=>{const a=new URLSearchParams(i);a.set("time",B[s]),h(a)},p=b({queryKey:["top-tasks-sidebar"],queryFn:()=>T.getTopTasks({limit:8}),staleTime:10*60*1e3}),l=b({queryKey:["trending-tasks-sidebar"],queryFn:()=>T.getTrendingTasks({limit:8}),staleTime:10*60*1e3}),t=R({page_size:30,order_by:r,order_dir:"desc",time:o,include_resources:!0,enabled:r!=="trending"}),d=D({limit:30,max_age_days:K[o],enabled:r==="trending"}),c=y.useMemo(()=>{var a;return r==="trending"?(d.data||[]).map(L):(((a=t.data)==null?void 0:a.pages.flatMap(O=>O.results))||[]).map(E)},[r,t.data,d.data]),{targetRef:k,isIntersecting:g}=M({rootMargin:"400px"});y.useEffect(()=>{r!=="trending"&&g&&t.hasNextPage&&!t.isFetchingNextPage&&t.fetchNextPage()},[r,g,t.hasNextPage,t.isFetchingNextPage]);const F=r==="trending"?d.isLoading:t.isLoading,A=r==="trending"?d.error:t.error;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Trending ",e.jsx("em",{children:"Research"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated daily from arXiv and Hugging Face"})]}),e.jsx("div",{style:{display:"flex",gap:16,alignItems:"center",flexWrap:"wrap"},children:e.jsx("div",{className:"period-switch",children:C.map(s=>e.jsx("button",{className:`period-btn ${v===s?"active":""}`,onClick:()=>w(s),children:s},s))})})]}),e.jsxs("div",{className:"layout-with-sidebar",children:[e.jsxs("aside",{className:"sidebar",children:[e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),p.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,a)=>e.jsx(n,{className:"h-5 w-full"},a))}),(x=p.data)==null?void 0:x.map(s=>e.jsxs(m,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[_(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",children:[e.jsx("div",{className:"sidebar-label",children:"Trending Domains"}),l.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,a)=>e.jsx(n,{className:"h-5 w-full"},a))}),((j=(u=l.data)==null?void 0:u.results)==null?void 0:j.length)===0&&!l.isLoading&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"No domains gaining momentum right now."}),(N=(f=l.data)==null?void 0:f.results)==null?void 0:N.map(s=>e.jsxs(m,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[_(s.name,s.slug),e.jsxs("span",{className:"count",children:[s.share_lift.toFixed(1),"x"]})]},s.id))]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"sort-bar",children:[e.jsx("div",{className:"sort-options",children:$.map(([s,a])=>e.jsx("button",{className:`sort-btn ${r===s?"active":""}`,onClick:()=>P(s),children:a},s))}),e.jsxs("div",{className:"results-count",children:[c.length," papers"]})]}),A&&e.jsx(W,{variant:"destructive",className:"mb-4",children:e.jsx(q,{children:"Failed to load papers. Please try again."})}),F?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,a)=>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"})]})]},a))}):c.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:c.map((s,a)=>e.jsx(I,{paper:s,rank:a+1},s.id))}),r!=="trending"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:k,style:{height:1}}),t.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})]})};export{re as default};
 
 
assets/FeedView-CHsx2V3f.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{u as S,r as y,j as e,L as m}from"./index-BWQiUBNk.js";import{P as I}from"./components-BT6ZBgQl.js";import{a as T}from"./api-BFeNcidM.js";import{t as L,a as E,d as _}from"./transform-DgWj1AQy.js";import{u as R,a as D}from"./usePapers-CnRnmSk-.js";import{u as M}from"./useIntersectionObserver-U7v6rTcQ.js";import{P as C}from"./usePeriodFilter-NqcUWmWg.js";import{S as n}from"./skeleton-BuXiEBoy.js";import{A as W,a as q}from"./alert-DUe5ZsgM.js";import{u as b}from"./useQuery-B941khzD.js";import"./LatexTitle-Ckdd_TrR.js";import"./adminAuth-PI_XkM8E.js";import"./useInfiniteQuery-CpEFc3Gg.js";const $=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],B={Today:"today","This Week":"week","This Month":"month","All Time":"all_time"},z={today:"Today",week:"This Week",month:"This Month",all_time:"All Time"},K={today:1,week:7,month:30,all_time:365},U=i=>i==="trending"||i==="date_published"||i==="citation_count"?i:"trending",X=i=>i==="today"||i==="week"||i==="month"||i==="all_time"?i:"all_time",ne=()=>{var x,u,j,f,N;const[i,p]=S(),r=U(i.get("order_by")),o=X(i.get("time")),v=z[o],P=s=>{const a=new URLSearchParams(i);a.set("order_by",s),p(a)},w=s=>{const a=new URLSearchParams(i);a.set("time",B[s]),p(a)},h=b({queryKey:["top-tasks-sidebar"],queryFn:()=>T.getTopTasks({limit:8}),staleTime:10*60*1e3}),l=b({queryKey:["trending-tasks-sidebar"],queryFn:()=>T.getTrendingTasks({limit:8}),staleTime:10*60*1e3}),t=R({page_size:30,order_by:r,order_dir:"desc",time:o,include_resources:!0,enabled:r!=="trending"}),d=D({limit:30,max_age_days:K[o],enabled:r==="trending"}),c=y.useMemo(()=>{var a;return r==="trending"?(d.data||[]).map(L):(((a=t.data)==null?void 0:a.pages.flatMap(O=>O.results))||[]).map(E)},[r,t.data,d.data]),{targetRef:k,isIntersecting:g}=M({rootMargin:"400px"});y.useEffect(()=>{r!=="trending"&&g&&t.hasNextPage&&!t.isFetchingNextPage&&t.fetchNextPage()},[r,g,t.hasNextPage,t.isFetchingNextPage]);const F=r==="trending"?d.isLoading:t.isLoading,A=r==="trending"?d.error:t.error;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Trending ",e.jsx("em",{children:"Research"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated daily from arXiv and Hugging Face"})]}),e.jsx("div",{style:{display:"flex",gap:16,alignItems:"center",flexWrap:"wrap"},children:e.jsx("div",{className:"period-switch",children:C.map(s=>e.jsx("button",{className:`period-btn ${v===s?"active":""}`,onClick:()=>w(s),children:s},s))})})]}),e.jsxs("div",{className:"layout-with-sidebar",children:[e.jsxs("aside",{className:"sidebar",children:[e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),h.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,a)=>e.jsx(n,{className:"h-5 w-full"},a))}),(x=h.data)==null?void 0:x.map(s=>e.jsxs(m,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[_(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",children:[e.jsx("div",{className:"sidebar-label",children:"Trending Domains"}),l.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,a)=>e.jsx(n,{className:"h-5 w-full"},a))}),((j=(u=l.data)==null?void 0:u.results)==null?void 0:j.length)===0&&!l.isLoading&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"No domains gaining momentum right now."}),(N=(f=l.data)==null?void 0:f.results)==null?void 0:N.map(s=>e.jsxs(m,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[_(s.name,s.slug),e.jsxs("span",{className:"count",children:[s.share_lift.toFixed(1),"x"]})]},s.id))]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"sort-bar",children:[e.jsx("div",{className:"sort-options",children:$.map(([s,a])=>e.jsx("button",{className:`sort-btn ${r===s?"active":""}`,onClick:()=>P(s),children:a},s))}),e.jsxs("div",{className:"results-count",children:[c.length," papers"]})]}),A&&e.jsx(W,{variant:"destructive",className:"mb-4",children:e.jsx(q,{children:"Failed to load papers. Please try again."})}),F?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,a)=>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"})]})]},a))}):c.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:c.map((s,a)=>e.jsx(I,{paper:s,rank:a+1},s.id))}),r!=="trending"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:k,style:{height:1}}),t.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})]})};export{ne as default};
assets/{LatexTitle-_7AiBIQK.js → LatexTitle-Ckdd_TrR.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{j as Er,r as Qt}from"./index-BcdJ5r4Y.js";class S extends Error{constructor(e,t){var a="KaTeX parse error: "+e,n,l,u=t&&t.loc;if(u&&u.start<=u.end){var h=u.lexer.input;n=u.start,l=u.end,n===h.length?a+=" at end of input: ":a+=" at position "+(n+1)+": ";var c=h.slice(n,l).replace(/[^]/g,"$&̲"),p;n>15?p="…"+h.slice(n-15,n):p=h.slice(0,n);var g;l+15<h.length?g=h.slice(l,l+15)+"…":g=h.slice(l),a+=p+c+g}super(a),this.name="ParseError",Object.setPrototypeOf(this,S.prototype),this.position=n,n!=null&&l!=null&&(this.length=l-n),this.rawMessage=e}}var H1=/([A-Z])/g,Tt=r=>r.replace(H1,"-$1").toLowerCase(),F1={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},L1=/[&><"']/g,n0=r=>String(r).replace(L1,e=>F1[e]),De=r=>r.type==="ordgroup"||r.type==="color"?r.body.length===1?De(r.body[0]):r:r.type==="font"?De(r.body):r,P1=new Set(["mathord","textord","atom"]),C0=r=>P1.has(De(r).type),G1=r=>{var e=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(r);return e?e[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e[1])?null:e[1].toLowerCase():"_relative"},dt={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:r=>"#"+r},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(r,e)=>(e.push(r),e)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:r=>Math.max(0,r),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:r=>Math.max(0,r),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:r=>Math.max(0,r),cli:"-e, --max-expand <n>",cliProcessor:r=>r==="Infinity"?1/0:parseInt(r)},globalGroup:{type:"boolean",cli:!1}};function U1(r){if("default"in r)return r.default;var e=r.type,t=Array.isArray(e)?e[0]:e;if(typeof t!="string")return t.enum[0];switch(t){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class Bt{constructor(e){e===void 0&&(e={}),e=e||{};for(var t of Object.keys(dt)){var a=dt[t],n=e[t];this[t]=n!==void 0?a.processor?a.processor(n):n:U1(a)}}reportNonstrict(e,t,a){var n=this.strict;if(typeof n=="function"&&(n=n(e,t,a)),!(!n||n==="ignore")){if(n===!0||n==="error")throw new S("LaTeX-incompatible input and strict mode is set to 'error': "+(t+" ["+e+"]"),a);n==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+e+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+n+"': "+t+" ["+e+"]"))}}useStrictBehavior(e,t,a){var n=this.strict;if(typeof n=="function")try{n=n(e,t,a)}catch{n="error"}return!n||n==="ignore"?!1:n===!0||n==="error"?!0:n==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+e+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+n+"': "+t+" ["+e+"]")),!1)}isTrusted(e){if("url"in e&&e.url&&!e.protocol){var t=G1(e.url);if(t==null)return!1;e.protocol=t}var a=typeof this.trust=="function"?this.trust(e):this.trust;return!!a}}class O0{constructor(e,t,a){this.id=e,this.size=t,this.cramped=a}sup(){return w0[$1[this.id]]}sub(){return w0[V1[this.id]]}fracNum(){return w0[X1[this.id]]}fracDen(){return w0[Y1[this.id]]}cramp(){return w0[W1[this.id]]}text(){return w0[j1[this.id]]}isTight(){return this.size>=2}}var Dt=0,qe=1,_0=2,B0=3,he=4,g0=5,ee=6,u0=7,w0=[new O0(Dt,0,!1),new O0(qe,0,!0),new O0(_0,1,!1),new O0(B0,1,!0),new O0(he,2,!1),new O0(g0,2,!0),new O0(ee,3,!1),new O0(u0,3,!0)],$1=[he,g0,he,g0,ee,u0,ee,u0],V1=[g0,g0,g0,g0,u0,u0,u0,u0],X1=[_0,B0,he,g0,ee,u0,ee,u0],Y1=[B0,B0,g0,g0,u0,u0,u0,u0],W1=[qe,qe,B0,B0,g0,g0,u0,u0],j1=[Dt,qe,_0,B0,_0,B0,_0,B0],N={DISPLAY:w0[Dt],TEXT:w0[_0],SCRIPT:w0[he],SCRIPTSCRIPT:w0[ee]},ft=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function Z1(r){for(var e=0;e<ft.length;e++)for(var t=ft[e],a=0;a<t.blocks.length;a++){var n=t.blocks[a];if(r>=n[0]&&r<=n[1])return t.name}return null}var Ce=[];ft.forEach(r=>r.blocks.forEach(e=>Ce.push(...e)));function Rr(r){for(var e=0;e<Ce.length;e+=2)if(r>=Ce[e]&&r<=Ce[e+1])return!0;return!1}var r0=r=>r+" "+r,Q0=80,K1=function(e,t){return"M95,"+(622+e+t)+`
2
  c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
3
  c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
4
  c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
 
1
+ import{j as Er,r as Qt}from"./index-BWQiUBNk.js";class S extends Error{constructor(e,t){var a="KaTeX parse error: "+e,n,l,u=t&&t.loc;if(u&&u.start<=u.end){var h=u.lexer.input;n=u.start,l=u.end,n===h.length?a+=" at end of input: ":a+=" at position "+(n+1)+": ";var c=h.slice(n,l).replace(/[^]/g,"$&̲"),p;n>15?p="…"+h.slice(n-15,n):p=h.slice(0,n);var g;l+15<h.length?g=h.slice(l,l+15)+"…":g=h.slice(l),a+=p+c+g}super(a),this.name="ParseError",Object.setPrototypeOf(this,S.prototype),this.position=n,n!=null&&l!=null&&(this.length=l-n),this.rawMessage=e}}var H1=/([A-Z])/g,Tt=r=>r.replace(H1,"-$1").toLowerCase(),F1={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},L1=/[&><"']/g,n0=r=>String(r).replace(L1,e=>F1[e]),De=r=>r.type==="ordgroup"||r.type==="color"?r.body.length===1?De(r.body[0]):r:r.type==="font"?De(r.body):r,P1=new Set(["mathord","textord","atom"]),C0=r=>P1.has(De(r).type),G1=r=>{var e=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(r);return e?e[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e[1])?null:e[1].toLowerCase():"_relative"},dt={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:r=>"#"+r},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(r,e)=>(e.push(r),e)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:r=>Math.max(0,r),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:r=>Math.max(0,r),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:r=>Math.max(0,r),cli:"-e, --max-expand <n>",cliProcessor:r=>r==="Infinity"?1/0:parseInt(r)},globalGroup:{type:"boolean",cli:!1}};function U1(r){if("default"in r)return r.default;var e=r.type,t=Array.isArray(e)?e[0]:e;if(typeof t!="string")return t.enum[0];switch(t){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class Bt{constructor(e){e===void 0&&(e={}),e=e||{};for(var t of Object.keys(dt)){var a=dt[t],n=e[t];this[t]=n!==void 0?a.processor?a.processor(n):n:U1(a)}}reportNonstrict(e,t,a){var n=this.strict;if(typeof n=="function"&&(n=n(e,t,a)),!(!n||n==="ignore")){if(n===!0||n==="error")throw new S("LaTeX-incompatible input and strict mode is set to 'error': "+(t+" ["+e+"]"),a);n==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+e+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+n+"': "+t+" ["+e+"]"))}}useStrictBehavior(e,t,a){var n=this.strict;if(typeof n=="function")try{n=n(e,t,a)}catch{n="error"}return!n||n==="ignore"?!1:n===!0||n==="error"?!0:n==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+e+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+n+"': "+t+" ["+e+"]")),!1)}isTrusted(e){if("url"in e&&e.url&&!e.protocol){var t=G1(e.url);if(t==null)return!1;e.protocol=t}var a=typeof this.trust=="function"?this.trust(e):this.trust;return!!a}}class O0{constructor(e,t,a){this.id=e,this.size=t,this.cramped=a}sup(){return w0[$1[this.id]]}sub(){return w0[V1[this.id]]}fracNum(){return w0[X1[this.id]]}fracDen(){return w0[Y1[this.id]]}cramp(){return w0[W1[this.id]]}text(){return w0[j1[this.id]]}isTight(){return this.size>=2}}var Dt=0,qe=1,_0=2,B0=3,he=4,g0=5,ee=6,u0=7,w0=[new O0(Dt,0,!1),new O0(qe,0,!0),new O0(_0,1,!1),new O0(B0,1,!0),new O0(he,2,!1),new O0(g0,2,!0),new O0(ee,3,!1),new O0(u0,3,!0)],$1=[he,g0,he,g0,ee,u0,ee,u0],V1=[g0,g0,g0,g0,u0,u0,u0,u0],X1=[_0,B0,he,g0,ee,u0,ee,u0],Y1=[B0,B0,g0,g0,u0,u0,u0,u0],W1=[qe,qe,B0,B0,g0,g0,u0,u0],j1=[Dt,qe,_0,B0,_0,B0,_0,B0],N={DISPLAY:w0[Dt],TEXT:w0[_0],SCRIPT:w0[he],SCRIPTSCRIPT:w0[ee]},ft=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function Z1(r){for(var e=0;e<ft.length;e++)for(var t=ft[e],a=0;a<t.blocks.length;a++){var n=t.blocks[a];if(r>=n[0]&&r<=n[1])return t.name}return null}var Ce=[];ft.forEach(r=>r.blocks.forEach(e=>Ce.push(...e)));function Rr(r){for(var e=0;e<Ce.length;e+=2)if(r>=Ce[e]&&r<=Ce[e+1])return!0;return!1}var r0=r=>r+" "+r,Q0=80,K1=function(e,t){return"M95,"+(622+e+t)+`
2
  c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
3
  c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
4
  c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
assets/{MethodDetailView-DGJrZEj-.js → MethodDetailView-Jl6Bitak.js} RENAMED
The diff for this file is too large to render. See raw diff
 
assets/MethodsIndexView-B-6AP7xD.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{r as u,j as e,L as x}from"./index-BWQiUBNk.js";import{u as c}from"./useQuery-B941khzD.js";import{a as m}from"./api-BFeNcidM.js";import{S as h}from"./skeleton-BuXiEBoy.js";import{A as g,a as j}from"./alert-DUe5ZsgM.js";import"./adminAuth-PI_XkM8E.js";const w=()=>{var o,d;const i=c({queryKey:["areas-all"],queryFn:()=>m.getAreas({page_size:50,ordering:"name"}),staleTime:6e5}),n=c({queryKey:["methods-all"],queryFn:async()=>(await m.getMethods({page:1,page_size:500,ordering:"-paper_count"})).results,staleTime:10*60*1e3}),l=u.useMemo(()=>{if(!n.data||!i.data)return null;const a={};return n.data.forEach(r=>{const t=r.area_id??"_unassigned";(a[t]||(a[t]=[])).push(r)}),Object.values(a).forEach(r=>r.sort((t,s)=>(s.paper_count||0)-(t.paper_count||0))),a},[n.data,i.data]);return i.error||n.error?e.jsx("div",{className:"page",children:e.jsx(g,{variant:"destructive",children:e.jsx(j,{children:"Failed to load methods."})})}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Methods ",e.jsx("em",{children:"library"})]}),e.jsx("div",{className:"feed-subtitle",children:"Common techniques used across AI research, with the papers that use them."})]})}),i.isLoading||n.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((a,r)=>e.jsxs("div",{children:[e.jsx(h,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:8}).map((t,s)=>e.jsx(h,{className:"h-20"},s))})]},r))}):(d=(o=i.data)==null?void 0:o.results)==null?void 0:d.map(a=>{const r=(l==null?void 0:l[a.id])||[];if(r.length===0)return null;const t=r.reduce((s,p)=>s+(p.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.jsx("div",{children:e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:a.name})}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[r.length," methods · ",t.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:r.map(s=>e.jsxs(x,{to:`/methods/${s.slug||s.id}`,className:"tag-cell",children:[e.jsx("div",{className:"name",style:{fontFamily:"var(--mono)",fontSize:15},children:s.name}),e.jsxs("div",{className:"meta",children:[e.jsxs("span",{children:[(s.paper_count??0).toLocaleString()," papers"]}),s.introduced_year!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:s.introduced_year})]})]})]},s.id))})]},a.id)})]})};export{w as default};
assets/MethodsIndexView-BwswCUOL.js DELETED
@@ -1 +0,0 @@
1
- import{r as u,j as e,L as x}from"./index-BcdJ5r4Y.js";import{u as c}from"./adminAuth-CijC1LpP.js";import{a as h}from"./api-DVAIDRP9.js";import{A as g,a as j,S as m}from"./alert-BfBSxmdQ.js";const N=()=>{var o,d;const i=c({queryKey:["areas-all"],queryFn:()=>h.getAreas({page_size:50,ordering:"name"}),staleTime:6e5}),n=c({queryKey:["methods-all"],queryFn:async()=>(await h.getMethods({page:1,page_size:500,ordering:"-paper_count"})).results,staleTime:10*60*1e3}),l=u.useMemo(()=>{if(!n.data||!i.data)return null;const a={};return n.data.forEach(r=>{const t=r.area_id??"_unassigned";(a[t]||(a[t]=[])).push(r)}),Object.values(a).forEach(r=>r.sort((t,s)=>(s.paper_count||0)-(t.paper_count||0))),a},[n.data,i.data]);return i.error||n.error?e.jsx("div",{className:"page",children:e.jsx(g,{variant:"destructive",children:e.jsx(j,{children:"Failed to load methods."})})}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Methods ",e.jsx("em",{children:"library"})]}),e.jsx("div",{className:"feed-subtitle",children:"Common techniques used across AI research, with the papers that use them."})]})}),i.isLoading||n.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((a,r)=>e.jsxs("div",{children:[e.jsx(m,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:8}).map((t,s)=>e.jsx(m,{className:"h-20"},s))})]},r))}):(d=(o=i.data)==null?void 0:o.results)==null?void 0:d.map(a=>{const r=(l==null?void 0:l[a.id])||[];if(r.length===0)return null;const t=r.reduce((s,p)=>s+(p.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.jsx("div",{children:e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:a.name})}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[r.length," methods · ",t.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:r.map(s=>e.jsxs(x,{to:`/methods/${s.slug||s.id}`,className:"tag-cell",children:[e.jsx("div",{className:"name",style:{fontFamily:"var(--mono)",fontSize:15},children:s.name}),e.jsxs("div",{className:"meta",children:[e.jsxs("span",{children:[(s.paper_count??0).toLocaleString()," papers"]}),s.introduced_year!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:s.introduced_year})]})]})]},s.id))})]},a.id)})]})};export{N as default};
 
 
assets/NotFound-BCiOqWnt.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{a0 as o,r as a,j as t,L as s}from"./index-BWQiUBNk.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/NotFound-CXZKYjs9.js DELETED
@@ -1 +0,0 @@
1
- import{W as o,r as s,j as t,L as a}from"./index-BcdJ5r4Y.js";const r=()=>{const e=o();return s.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(a,{to:"/",className:"action-btn",children:"Return home"})]})};export{r as default};
 
 
assets/PaperDetailView-B-8wMNrf.js ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import{c as ee,r as u,j as e,P as Ne,a as U,b as bt,d as ue,e as W,f as ls,g as yt,C as te,h as K,i as cs,k as Pe,l as ds,m as us,R as ms,n as hs,F as fs,D as ps,o as xs,X as Me,p as se,q as Te,s as ke,t as Ae,v as Nt,w as kt,x as gs,y as js,L as Z,z as vs,A as bs,B as ys,E as ht,G as Ns,H as ks}from"./index-BWQiUBNk.js";import{u as O}from"./useQuery-B941khzD.js";import{I as L,T as _s,M as ws}from"./components-BT6ZBgQl.js";import{L as ft,a as Cs}from"./LatexTitle-Ckdd_TrR.js";import{g as Es,u as Ss,b as _t,c as Ps,d as Rs,e as Ds,f as Is,h as Ms,i as Ts,j as As,k as pt,a as ve,l as Fs}from"./api-BFeNcidM.js";import{e as $s}from"./transform-DgWj1AQy.js";import{b as Ls}from"./usePapers-CnRnmSk-.js";import{S as de}from"./skeleton-BuXiEBoy.js";import{A as Os,a as qs}from"./alert-DUe5ZsgM.js";import{I as H,B as M}from"./input-DZmGAzFu.js";import{u as ae}from"./useMutation-CypKj-4k.js";import{L as G,B as wt,D as Bs}from"./badge-Ds2a6Q8t.js";import"./adminAuth-PI_XkM8E.js";import"./useInfiniteQuery-CpEFc3Gg.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 xt=ee("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/**
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 gt=ee("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
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 Fe=ee("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
17
+ * @license lucide-react v0.462.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */const be=ee("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
22
+ * @license lucide-react v0.462.0 - ISC
23
+ *
24
+ * This source code is licensed under the ISC license.
25
+ * See the LICENSE file in the root directory of this source tree.
26
+ */const Ct=ee("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/**
27
+ * @license lucide-react v0.462.0 - ISC
28
+ *
29
+ * This source code is licensed under the ISC license.
30
+ * See the LICENSE file in the root directory of this source tree.
31
+ */const $e=ee("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);function zs(s,a=!0){return O({queryKey:["evaluations","paper",s],queryFn:()=>{if(!s)throw new Error("Paper ID is required");return Es(s)},enabled:a&&!!s,staleTime:5*60*1e3})}const Re=async(s,a)=>{try{const n=await fetch(`https://huggingface.co/api/arxiv/${a}/repos`);if(!n.ok)return console.warn(`Failed to fetch repos for arXiv:${a}, status: ${n.status}`),{count:0,isLimited:!1};const r=((await n.json())[s]||[]).length;return console.log(`${s} count for arXiv:${a}: ${r}`),r<100?{count:r,isLimited:!1}:{count:r,isLimited:!0}}catch(n){return console.warn(`Failed to fetch ${s} count for arXiv:${a}:`,n),{count:0,isLimited:!1}}},Hs=async s=>{const[a,n,d]=await Promise.all([Re("models",s),Re("datasets",s),Re("spaces",s)]);return{models:a.count,datasets:n.count,spaces:d.count,isLimited:a.isLimited||n.isLimited||d.isLimited}},Qs=s=>O({queryKey:["huggingface-repos",s],queryFn:()=>Hs(s),enabled:!!s,staleTime:10*60*1e3,retry:1});function Ks(){const[s,a]=u.useState(!1),[n,d]=u.useState(!1),[r,t]=u.useState(!1),[o,m]=u.useState(!1),[j,h]=u.useState(!1);return{isEditingTasks:s,openTasksDialog:()=>a(!0),closeTasksDialog:()=>a(!1),setIsEditingTasks:a,isEditingMethods:n,openMethodsDialog:()=>d(!0),closeMethodsDialog:()=>d(!1),setIsEditingMethods:d,isEditingRepositories:r,openRepositoriesDialog:()=>t(!0),closeRepositoriesDialog:()=>t(!1),setIsEditingRepositories:t,isEditingProjectPages:o,openProjectPagesDialog:()=>m(!0),closeProjectPagesDialog:()=>m(!1),setIsEditingProjectPages:m,isEditingEvaluations:j,openEvaluationsDialog:()=>h(!0),closeEvaluationsDialog:()=>h(!1),setIsEditingEvaluations:h}}function Us(s){const a=u.useRef({value:s,previous:s});return u.useMemo(()=>(a.current.value!==s&&(a.current.previous=a.current.value,a.current.value=s),a.current.previous),[s])}var _e="Checkbox",[Ws]=yt(_e),[Gs,Le]=Ws(_e);function Vs(s){const{__scopeCheckbox:a,checked:n,children:d,defaultChecked:r,disabled:t,form:o,name:m,onCheckedChange:j,required:h,value:k="on",internal_do_not_use_render:f}=s,[C,P]=bt({prop:n,defaultProp:r??!1,onChange:j,caller:_e}),[R,E]=u.useState(null),[D,S]=u.useState(null),c=u.useRef(!1),_=R?!!o||!!R.closest("form"):!0,T={checked:C,disabled:t,setChecked:P,control:R,setControl:E,name:m,form:o,value:k,hasConsumerStoppedPropagationRef:c,required:h,defaultChecked:Q(r)?!1:r,isFormControl:_,bubbleInput:D,setBubbleInput:S};return e.jsx(Gs,{scope:a,...T,children:Xs(f)?f(T):d})}var Et="CheckboxTrigger",St=u.forwardRef(({__scopeCheckbox:s,onKeyDown:a,onClick:n,...d},r)=>{const{control:t,value:o,disabled:m,checked:j,required:h,setControl:k,setChecked:f,hasConsumerStoppedPropagationRef:C,isFormControl:P,bubbleInput:R}=Le(Et,s),E=ue(r,k),D=u.useRef(j);return u.useEffect(()=>{const S=t==null?void 0:t.form;if(S){const c=()=>f(D.current);return S.addEventListener("reset",c),()=>S.removeEventListener("reset",c)}},[t,f]),e.jsx(U.button,{type:"button",role:"checkbox","aria-checked":Q(j)?"mixed":j,"aria-required":h,"data-state":Mt(j),"data-disabled":m?"":void 0,disabled:m,value:o,...d,ref:E,onKeyDown:W(a,S=>{S.key==="Enter"&&S.preventDefault()}),onClick:W(n,S=>{f(c=>Q(c)?!0:!c),R&&P&&(C.current=S.isPropagationStopped(),C.current||S.stopPropagation())})})});St.displayName=Et;var Oe=u.forwardRef((s,a)=>{const{__scopeCheckbox:n,name:d,checked:r,defaultChecked:t,required:o,disabled:m,value:j,onCheckedChange:h,form:k,...f}=s;return e.jsx(Vs,{__scopeCheckbox:n,checked:r,defaultChecked:t,disabled:m,required:o,onCheckedChange:h,name:d,form:k,value:j,internal_do_not_use_render:({isFormControl:C})=>e.jsxs(e.Fragment,{children:[e.jsx(St,{...f,ref:a,__scopeCheckbox:n}),C&&e.jsx(It,{__scopeCheckbox:n})]})})});Oe.displayName=_e;var Pt="CheckboxIndicator",Rt=u.forwardRef((s,a)=>{const{__scopeCheckbox:n,forceMount:d,...r}=s,t=Le(Pt,n);return e.jsx(Ne,{present:d||Q(t.checked)||t.checked===!0,children:e.jsx(U.span,{"data-state":Mt(t.checked),"data-disabled":t.disabled?"":void 0,...r,ref:a,style:{pointerEvents:"none",...s.style}})})});Rt.displayName=Pt;var Dt="CheckboxBubbleInput",It=u.forwardRef(({__scopeCheckbox:s,...a},n)=>{const{control:d,hasConsumerStoppedPropagationRef:r,checked:t,defaultChecked:o,required:m,disabled:j,name:h,value:k,form:f,bubbleInput:C,setBubbleInput:P}=Le(Dt,s),R=ue(n,P),E=Us(t),D=ls(d);u.useEffect(()=>{const c=C;if(!c)return;const _=window.HTMLInputElement.prototype,A=Object.getOwnPropertyDescriptor(_,"checked").set,b=!r.current;if(E!==t&&A){const w=new Event("click",{bubbles:b});c.indeterminate=Q(t),A.call(c,Q(t)?!1:t),c.dispatchEvent(w)}},[C,E,t,r]);const S=u.useRef(Q(t)?!1:t);return e.jsx(U.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??S.current,required:m,disabled:j,name:h,value:k,form:f,...a,tabIndex:-1,ref:R,style:{...a.style,...D,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});It.displayName=Dt;function Xs(s){return typeof s=="function"}function Q(s){return s==="indeterminate"}function Mt(s){return Q(s)?"indeterminate":s?"checked":"unchecked"}const qe=u.forwardRef(({className:s,style:a,...n},d)=>e.jsx(Oe,{ref:d,className:K("peer h-4 w-4 shrink-0 rounded-sm ring-offset-background data-[state=checked]:!bg-black data-[state=checked]:!text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",s),style:{border:"1px solid #000",...a},...n,children:e.jsx(Rt,{className:K("flex items-center justify-center text-current"),children:e.jsx(te,{className:"h-4 w-4"})})}));qe.displayName=Oe.displayName;function Ys(s){const a=Zs(s),n=u.forwardRef((d,r)=>{const{children:t,...o}=d,m=u.Children.toArray(t),j=m.find(ea);if(j){const h=j.props.children,k=m.map(f=>f===j?u.Children.count(h)>1?u.Children.only(null):u.isValidElement(h)?h.props.children:null:f);return e.jsx(a,{...o,ref:r,children:u.isValidElement(h)?u.cloneElement(h,void 0,k):null})}return e.jsx(a,{...o,ref:r,children:t})});return n.displayName=`${s}.Slot`,n}function Zs(s){const a=u.forwardRef((n,d)=>{const{children:r,...t}=n;if(u.isValidElement(r)){const o=sa(r),m=ta(t,r.props);return r.type!==u.Fragment&&(m.ref=d?cs(d,o):o),u.cloneElement(r,m)}return u.Children.count(r)>1?u.Children.only(null):null});return a.displayName=`${s}.SlotClone`,a}var Js=Symbol("radix.slottable");function ea(s){return u.isValidElement(s)&&typeof s.type=="function"&&"__radixId"in s.type&&s.type.__radixId===Js}function ta(s,a){const n={...a};for(const d in a){const r=s[d],t=a[d];/^on[A-Z]/.test(d)?r&&t?n[d]=(...m)=>{const j=t(...m);return r(...m),j}:r&&(n[d]=r):d==="style"?n[d]={...r,...t}:d==="className"&&(n[d]=[r,t].filter(Boolean).join(" "))}return{...s,...n}}function sa(s){var d,r;let a=(d=Object.getOwnPropertyDescriptor(s.props,"ref"))==null?void 0:d.get,n=a&&"isReactWarning"in a&&a.isReactWarning;return n?s.ref:(a=(r=Object.getOwnPropertyDescriptor(s,"ref"))==null?void 0:r.get,n=a&&"isReactWarning"in a&&a.isReactWarning,n?s.props.ref:s.props.ref||s.ref)}var we="Dialog",[Tt]=yt(we),[aa,$]=Tt(we),At=s=>{const{__scopeDialog:a,children:n,open:d,defaultOpen:r,onOpenChange:t,modal:o=!0}=s,m=u.useRef(null),j=u.useRef(null),[h,k]=bt({prop:d,defaultProp:r??!1,onChange:t,caller:we});return e.jsx(aa,{scope:a,triggerRef:m,contentRef:j,contentId:Pe(),titleId:Pe(),descriptionId:Pe(),open:h,onOpenChange:k,onOpenToggle:u.useCallback(()=>k(f=>!f),[k]),modal:o,children:n})};At.displayName=we;var Ft="DialogTrigger",ra=u.forwardRef((s,a)=>{const{__scopeDialog:n,...d}=s,r=$(Ft,n),t=ue(a,r.triggerRef);return e.jsx(U.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":He(r.open),...d,ref:t,onClick:W(s.onClick,r.onOpenToggle)})});ra.displayName=Ft;var Be="DialogPortal",[na,$t]=Tt(Be,{forceMount:void 0}),Lt=s=>{const{__scopeDialog:a,forceMount:n,children:d,container:r}=s,t=$(Be,a);return e.jsx(na,{scope:a,forceMount:n,children:u.Children.map(d,o=>e.jsx(Ne,{present:n||t.open,children:e.jsx(ds,{asChild:!0,container:r,children:o})}))})};Lt.displayName=Be;var ye="DialogOverlay",Ot=u.forwardRef((s,a)=>{const n=$t(ye,s.__scopeDialog),{forceMount:d=n.forceMount,...r}=s,t=$(ye,s.__scopeDialog);return t.modal?e.jsx(Ne,{present:d||t.open,children:e.jsx(oa,{...r,ref:a})}):null});Ot.displayName=ye;var ia=Ys("DialogOverlay.RemoveScroll"),oa=u.forwardRef((s,a)=>{const{__scopeDialog:n,...d}=s,r=$(ye,n);return e.jsx(ms,{as:ia,allowPinchZoom:!0,shards:[r.contentRef],children:e.jsx(U.div,{"data-state":He(r.open),...d,ref:a,style:{pointerEvents:"auto",...d.style}})})}),V="DialogContent",qt=u.forwardRef((s,a)=>{const n=$t(V,s.__scopeDialog),{forceMount:d=n.forceMount,...r}=s,t=$(V,s.__scopeDialog);return e.jsx(Ne,{present:d||t.open,children:t.modal?e.jsx(la,{...r,ref:a}):e.jsx(ca,{...r,ref:a})})});qt.displayName=V;var la=u.forwardRef((s,a)=>{const n=$(V,s.__scopeDialog),d=u.useRef(null),r=ue(a,n.contentRef,d);return u.useEffect(()=>{const t=d.current;if(t)return us(t)},[]),e.jsx(Bt,{...s,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:W(s.onCloseAutoFocus,t=>{var o;t.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:W(s.onPointerDownOutside,t=>{const o=t.detail.originalEvent,m=o.button===0&&o.ctrlKey===!0;(o.button===2||m)&&t.preventDefault()}),onFocusOutside:W(s.onFocusOutside,t=>t.preventDefault())})}),ca=u.forwardRef((s,a)=>{const n=$(V,s.__scopeDialog),d=u.useRef(!1),r=u.useRef(!1);return e.jsx(Bt,{...s,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{var o,m;(o=s.onCloseAutoFocus)==null||o.call(s,t),t.defaultPrevented||(d.current||(m=n.triggerRef.current)==null||m.focus(),t.preventDefault()),d.current=!1,r.current=!1},onInteractOutside:t=>{var j,h;(j=s.onInteractOutside)==null||j.call(s,t),t.defaultPrevented||(d.current=!0,t.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const o=t.target;((h=n.triggerRef.current)==null?void 0:h.contains(o))&&t.preventDefault(),t.detail.originalEvent.type==="focusin"&&r.current&&t.preventDefault()}})}),Bt=u.forwardRef((s,a)=>{const{__scopeDialog:n,trapFocus:d,onOpenAutoFocus:r,onCloseAutoFocus:t,...o}=s,m=$(V,n),j=u.useRef(null),h=ue(a,j);return hs(),e.jsxs(e.Fragment,{children:[e.jsx(fs,{asChild:!0,loop:!0,trapped:d,onMountAutoFocus:r,onUnmountAutoFocus:t,children:e.jsx(ps,{role:"dialog",id:m.contentId,"aria-describedby":m.descriptionId,"aria-labelledby":m.titleId,"data-state":He(m.open),...o,ref:h,onDismiss:()=>m.onOpenChange(!1)})}),e.jsxs(e.Fragment,{children:[e.jsx(da,{titleId:m.titleId}),e.jsx(ma,{contentRef:j,descriptionId:m.descriptionId})]})]})}),ze="DialogTitle",zt=u.forwardRef((s,a)=>{const{__scopeDialog:n,...d}=s,r=$(ze,n);return e.jsx(U.h2,{id:r.titleId,...d,ref:a})});zt.displayName=ze;var Ht="DialogDescription",Qt=u.forwardRef((s,a)=>{const{__scopeDialog:n,...d}=s,r=$(Ht,n);return e.jsx(U.p,{id:r.descriptionId,...d,ref:a})});Qt.displayName=Ht;var Kt="DialogClose",Ut=u.forwardRef((s,a)=>{const{__scopeDialog:n,...d}=s,r=$(Kt,n);return e.jsx(U.button,{type:"button",...d,ref:a,onClick:W(s.onClick,()=>r.onOpenChange(!1))})});Ut.displayName=Kt;function He(s){return s?"open":"closed"}var Wt="DialogTitleWarning",[Wa,Gt]=xs(Wt,{contentName:V,titleName:ze,docsSlug:"dialog"}),da=({titleId:s})=>{const a=Gt(Wt),n=`\`${a.contentName}\` requires a \`${a.titleName}\` for the component to be accessible for screen reader users.
32
+
33
+ If you want to hide the \`${a.titleName}\`, you can wrap it with our VisuallyHidden component.
34
+
35
+ For more information, see https://radix-ui.com/primitives/docs/components/${a.docsSlug}`;return u.useEffect(()=>{s&&(document.getElementById(s)||console.error(n))},[n,s]),null},ua="DialogDescriptionWarning",ma=({contentRef:s,descriptionId:a})=>{const d=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Gt(ua).contentName}}.`;return u.useEffect(()=>{var t;const r=(t=s.current)==null?void 0:t.getAttribute("aria-describedby");a&&r&&(document.getElementById(a)||console.warn(d))},[d,s,a]),null},ha=At,fa=Lt,Vt=Ot,Xt=qt,Yt=zt,Zt=Qt,pa=Ut;const me=ha,xa=fa,Jt=u.forwardRef(({className:s,...a},n)=>e.jsx(Vt,{ref:n,className:K("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",s),...a}));Jt.displayName=Vt.displayName;const re=u.forwardRef(({className:s,children:a,...n},d)=>e.jsxs(xa,{children:[e.jsx(Jt,{}),e.jsxs(Xt,{ref:d,className:K("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",s),...n,children:[a,e.jsxs(pa,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[e.jsx(Me,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));re.displayName=Xt.displayName;const ne=({className:s,...a})=>e.jsx("div",{className:K("flex flex-col space-y-1.5 text-center sm:text-left",s),...a});ne.displayName="DialogHeader";const ie=({className:s,...a})=>e.jsx("div",{className:K("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",s),...a});ie.displayName="DialogFooter";const oe=u.forwardRef(({className:s,...a},n)=>e.jsx(Yt,{ref:n,className:K("text-lg font-semibold leading-none tracking-tight",s),...a}));oe.displayName=Yt.displayName;const le=u.forwardRef(({className:s,...a},n)=>e.jsx(Zt,{ref:n,className:K("text-sm text-muted-foreground",s),...a}));le.displayName=Zt.displayName;function ga(s,a,n){if(!s)return s;const d=r=>r.paper_id!==a||r.paper_title===n?r:{...r,paper_title:n};if(Array.isArray(s)){const r=s.map(d);return r.some((o,m)=>o!==s[m])?r:s}if(Array.isArray(s.results)){const r=s.results.map(d);return r.some((o,m)=>o!==s.results[m])?{...s,results:r}:s}return s}function Ce(s,a,n){new Set([...n,a.id,a.arxiv_id].filter(o=>!!o)).forEach(o=>{s.setQueryData(["paper",o],a),s.setQueryData(["paper-arxiv",o],a)}),s.invalidateQueries({queryKey:["papers"],refetchType:"none"}),s.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),s.invalidateQueries({queryKey:["task-papers-infinite"],refetchType:"none"});const r=String(a.id),t=o=>ga(o,r,a.title);s.setQueriesData({queryKey:["evaluations"]},t),s.setQueriesData({queryKey:["dataset-evals"]},t),s.invalidateQueries({queryKey:["evaluations"],refetchType:"none"}),s.invalidateQueries({queryKey:["dataset-evals"],refetchType:"none"})}const ja=250,va=100;function ba({open:s,onOpenChange:a,paperId:n,arxivId:d,initialTaskIds:r,initialTasks:t,onSuccess:o}){const[m,j]=u.useState(r),[h,k]=u.useState(""),[f,C]=u.useState(""),[P,R]=u.useState(new Map),E=se(),{toast:D}=Te(),S=u.useRef(!1);u.useEffect(()=>{if(!s){S.current=!1;return}if(S.current)return;S.current=!0,j(r),k(""),C("");const i=new Map;(t||[]).forEach(v=>{const x=parseInt(v.id);Number.isNaN(x)||i.set(x,v)}),R(i)},[s,r,t]),u.useEffect(()=>{const i=window.setTimeout(()=>{C(h.trim())},ja);return()=>window.clearTimeout(i)},[h]);const{data:c,isFetching:_}=O({queryKey:["tasks-search",f],queryFn:()=>_t({page_size:va,visible_only:!0,...f?{q:f}:{}}),enabled:s});u.useEffect(()=>{var i;(i=c==null?void 0:c.results)!=null&&i.length&&R(v=>{const x=new Map(v);return c.results.forEach(N=>{const g=parseInt(N.id);Number.isNaN(g)||x.set(g,N)}),x})},[c]);const T=u.useMemo(()=>{const i=(c==null?void 0:c.results)||[],v=new Set,x=[];return m.forEach(N=>{if(v.has(N))return;const g=P.get(N);g&&(x.push(g),v.add(N))}),i.forEach(N=>{const g=parseInt(N.id);Number.isNaN(g)||v.has(g)||(x.push(N),v.add(g))}),x},[c,m,P]),A=ae({mutationFn:({paperId:i,taskIds:v})=>Ss(i,v),onMutate:async({taskIds:i})=>{const v=i.map(g=>P.get(g)).filter(g=>!!g).map(g=>({id:g.id,name:g.name,slug:g.slug})).sort((g,q)=>g.name.localeCompare(q.name)),x=Array.from(new Set([n,d].filter(g=>!!g)));await Promise.all(x.flatMap(g=>[E.cancelQueries({queryKey:["paper",g]}),E.cancelQueries({queryKey:["paper-arxiv",g]})]));const N=[];return x.forEach(g=>{["paper","paper-arxiv"].forEach(q=>{const B=[q,g],I=E.getQueryData(B);N.push({key:B,data:I}),I&&E.setQueryData(B,{...I,tasks:v})})}),D({title:"Tasks updated",description:`Saved ${i.length} task${i.length===1?"":"s"} for this paper.`}),o==null||o(),a(!1),{snapshots:N}},onSuccess:i=>{Ce(E,i,[n,d])},onError:(i,v,x)=>{var q,B;(q=x==null?void 0:x.snapshots)==null||q.forEach(({key:I,data:Ee})=>{E.setQueryData(I,Ee)});const N=i;let g=N.message||"Failed to update paper tasks.";if(N.response)try{const I=JSON.parse(N.response);typeof(I==null?void 0:I.detail)=="string"?g=I.detail:Array.isArray(I==null?void 0:I.detail)&&((B=I.detail[0])!=null&&B.msg)&&(g=I.detail[0].msg)}catch{g=N.response}D({title:"Could not save tasks",description:g,variant:"destructive"})}}),b=()=>{A.mutate({paperId:n,taskIds:m})},w=(i,v)=>{j(x=>v?x.includes(i)?x:[...x,i]:x.filter(N=>N!==i))},p=()=>k("");return e.jsx(me,{open:s,onOpenChange:a,children:e.jsxs(re,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ne,{children:[e.jsx(oe,{children:"Edit Paper Tasks"}),e.jsx(le,{children:"Select the tasks that this paper addresses. You can select multiple tasks."})]}),e.jsxs("div",{className:"relative mb-4",children:[e.jsx(be,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(H,{type:"text",placeholder:"Search tasks...",value:h,onChange:i=>k(i.target.value),className:"pl-9 pr-9"}),h&&e.jsx("button",{type:"button",onClick:p,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground","aria-label":"Clear search",children:e.jsx(Me,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[400px]",children:T.length>0?e.jsx("div",{className:"space-y-2",children:T.map(i=>{const v=parseInt(i.id),x=m.includes(v);return e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted/50 rounded-md",children:[e.jsx(qe,{id:`task-${i.id}`,checked:x,onCheckedChange:N=>w(v,N===!0),className:"!border !border-black data-[state=checked]:!bg-black data-[state=checked]:!text-white"}),e.jsxs("label",{htmlFor:`task-${i.id}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[i.name,i.description&&e.jsxs("span",{className:"block text-xs text-muted-foreground font-normal mt-1",children:[i.description.substring(0,100),i.description.length>100?"...":""]})]})]},i.id)})}):_?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(G,{className:"w-8 h-8 mx-auto mb-2 animate-spin"}),e.jsx("p",{children:"Loading tasks..."})]}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(be,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:f?`No tasks found matching "${f}"`:"No tasks available"})]})}),e.jsxs(ie,{children:[e.jsx(M,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(M,{onClick:b,disabled:A.isPending,children:A.isPending?e.jsxs(e.Fragment,{children:[e.jsx(G,{className:"w-4 h-4 mr-2 animate-spin"}),"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(te,{className:"w-4 h-4 mr-2"}),"Save Changes"]})})]})]})})}const ya=250,Na=100;function ka({open:s,onOpenChange:a,paperId:n,arxivId:d,initialMethodIds:r,initialMethods:t,onSuccess:o}){const[m,j]=u.useState(r),[h,k]=u.useState(""),[f,C]=u.useState(""),[P,R]=u.useState(new Map),E=se(),{toast:D}=Te(),S=u.useRef(!1);u.useEffect(()=>{if(!s){S.current=!1;return}if(S.current)return;S.current=!0,j(r),k(""),C("");const i=new Map;(t||[]).forEach(v=>{const x=parseInt(v.id);Number.isNaN(x)||i.set(x,v)}),R(i)},[s,r,t]),u.useEffect(()=>{const i=window.setTimeout(()=>{C(h.trim())},ya);return()=>window.clearTimeout(i)},[h]);const{data:c,isFetching:_}=O({queryKey:["methods-search",f],queryFn:()=>Rs({page_size:Na,...f?{q:f}:{}}),enabled:s});u.useEffect(()=>{var i;(i=c==null?void 0:c.results)!=null&&i.length&&R(v=>{const x=new Map(v);return c.results.forEach(N=>{const g=parseInt(N.id);Number.isNaN(g)||x.set(g,N)}),x})},[c]);const T=u.useMemo(()=>{const i=(c==null?void 0:c.results)||[],v=new Set,x=[];return m.forEach(N=>{if(v.has(N))return;const g=P.get(N);g&&(x.push(g),v.add(N))}),i.forEach(N=>{const g=parseInt(N.id);Number.isNaN(g)||v.has(g)||(x.push(N),v.add(g))}),x},[c,m,P]),A=ae({mutationFn:({paperId:i,methodIds:v})=>Ps(i,v),onSuccess:i=>{Ce(E,i,[n,d]),D({title:"Methods updated",description:`Saved ${m.length} method${m.length===1?"":"s"} for this paper.`}),o==null||o(),a(!1)},onError:i=>{var N;const v=i;let x=v.message||"Failed to update paper methods.";if(v.response)try{const g=JSON.parse(v.response);typeof(g==null?void 0:g.detail)=="string"?x=g.detail:Array.isArray(g==null?void 0:g.detail)&&((N=g.detail[0])!=null&&N.msg)&&(x=g.detail[0].msg)}catch{x=v.response}D({title:"Could not save methods",description:x,variant:"destructive"})}}),b=()=>{A.mutate({paperId:n,methodIds:m})},w=(i,v)=>{j(x=>v?x.includes(i)?x:[...x,i]:x.filter(N=>N!==i))},p=()=>k("");return e.jsx(me,{open:s,onOpenChange:a,children:e.jsxs(re,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ne,{children:[e.jsx(oe,{children:"Edit Paper Methods"}),e.jsx(le,{children:"Select the methods and techniques used in this paper. You can select multiple methods."})]}),e.jsxs("div",{className:"relative mb-4",children:[e.jsx(be,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(H,{type:"text",placeholder:"Search methods...",value:h,onChange:i=>k(i.target.value),className:"pl-9 pr-9"}),h&&e.jsx("button",{type:"button",onClick:p,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground","aria-label":"Clear search",children:e.jsx(Me,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[400px]",children:T.length>0?e.jsx("div",{className:"space-y-2",children:T.map(i=>{const v=parseInt(i.id),x=m.includes(v);return e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted/50 rounded-md",children:[e.jsx(qe,{id:`method-${i.id}`,checked:x,onCheckedChange:N=>w(v,N===!0),className:"!border !border-black data-[state=checked]:!bg-black data-[state=checked]:!text-white"}),e.jsxs("label",{htmlFor:`method-${i.id}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[i.name,i.full_name&&i.full_name!==i.name&&e.jsx("span",{className:"block text-xs text-muted-foreground font-normal",children:i.full_name}),i.description&&e.jsxs("span",{className:"block text-xs text-muted-foreground font-normal mt-1",children:[i.description.substring(0,100),i.description.length>100?"...":""]})]})]},i.id)})}):_?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(G,{className:"w-8 h-8 mx-auto mb-2 animate-spin"}),e.jsx("p",{children:"Loading methods..."})]}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(be,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:f?`No methods found matching "${f}"`:"No methods available"})]})}),e.jsxs(ie,{children:[e.jsx(M,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(M,{onClick:b,disabled:A.isPending,children:A.isPending?e.jsxs(e.Fragment,{children:[e.jsx(G,{className:"w-4 h-4 mr-2 animate-spin"}),"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(te,{className:"w-4 h-4 mr-2"}),"Save Changes"]})})]})]})})}function _a({open:s,onOpenChange:a,paperId:n,arxivId:d,initialRepositories:r,onSuccess:t}){const[o,m]=u.useState(r),[j,h]=u.useState(""),k=se(),f=u.useRef(!1);u.useEffect(()=>{if(!s){f.current=!1;return}f.current||(f.current=!0,m(r),h(""))},[s,r]);const C=ae({mutationFn:({paperId:c,repositories:_})=>Ds(c,_),onSuccess:c=>{Ce(k,c,[n,d]),t==null||t(),a(!1),h("")}}),P=()=>{const c=j.trim();return c?o.some(_=>_.url===c)?(alert("This repository URL is already added"),null):[...o,{url:c,is_official:!1}]:o},R=()=>{const c=P();c!==null&&c.length!==o.length&&(m(c),h(""))},E=c=>{m(o.filter(_=>_.url!==c))},D=c=>{m(o.map(_=>_.url===c?{..._,is_official:!_.is_official}:_))},S=()=>{const c=P();c!==null&&C.mutate({paperId:n,repositories:c})};return e.jsx(me,{open:s,onOpenChange:a,children:e.jsxs(re,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ne,{children:[e.jsx(oe,{children:"Edit Paper Repositories"}),e.jsx(le,{children:"Add or remove GitHub repository URLs associated with this paper. Mark repositories as official if they are created by the paper authors."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Add Repository URL"}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(H,{type:"url",placeholder:"https://github.com/owner/repo",value:j,onChange:c=>h(c.target.value),onKeyPress:c=>{c.key==="Enter"&&(c.preventDefault(),R())},className:"flex-1"}),e.jsxs(M,{onClick:R,size:"sm",disabled:!j.trim(),children:[e.jsx(Fe,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:o.length>0?e.jsx("div",{className:"space-y-2",children:o.map((c,_)=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsx(xt,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-sm font-medium text-paper-blue truncate",children:c.url}),c.is_official&&e.jsx(wt,{variant:"secondary",className:"text-xs",children:"Official"})]})}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxs(M,{variant:c.is_official?"default":"outline",size:"sm",onClick:()=>D(c.url),className:"h-8 px-2 text-xs",title:c.is_official?"Click to unmark as official (created by paper authors)":"Click to mark as official (created by paper authors)",children:[e.jsx(Ct,{className:`w-3.5 h-3.5 mr-1 ${c.is_official?"fill-current":""}`}),c.is_official?"Official":"Mark official"]}),e.jsx(M,{variant:"ghost",size:"sm",onClick:()=>E(c.url),className:"h-8 px-2 text-destructive hover:text-destructive",title:"Remove repository",children:e.jsx($e,{className:"w-4 h-4"})})]})]},_))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(xt,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"No repositories added yet"}),e.jsx("p",{className:"text-xs mt-1",children:"Add a repository URL above to get started"})]})}),e.jsxs(ie,{children:[e.jsx(M,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(M,{onClick:S,disabled:C.isPending,children:C.isPending?e.jsxs(e.Fragment,{children:[e.jsx(G,{className:"w-4 h-4 mr-2 animate-spin"}),"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(te,{className:"w-4 h-4 mr-2"}),"Save Changes"]})})]})]})})}function wa({open:s,onOpenChange:a,paperId:n,arxivId:d,initialProjectPages:r,onSuccess:t}){const[o,m]=u.useState(r),[j,h]=u.useState(""),k=se(),f=u.useRef(!1);u.useEffect(()=>{if(!s){f.current=!1;return}f.current||(f.current=!0,m(r),h(""))},[s,r]);const C=ae({mutationFn:({paperId:c,projectPages:_})=>Is(c,_),onSuccess:c=>{Ce(k,c,[n,d]),t==null||t(),a(!1),h("")}}),P=()=>{const c=j.trim();return c?o.some(_=>_.url===c)?(alert("This project page URL is already added"),null):[...o,{url:c,is_official:!1}]:o},R=()=>{const c=P();c!==null&&c.length!==o.length&&(m(c),h(""))},E=c=>{m(o.filter(_=>_.url!==c))},D=c=>{m(o.map(_=>_.url===c?{..._,is_official:!_.is_official}:_))},S=()=>{const c=P();c!==null&&C.mutate({paperId:n,projectPages:c})};return e.jsx(me,{open:s,onOpenChange:a,children:e.jsxs(re,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ne,{children:[e.jsx(oe,{children:"Edit Paper Project Pages"}),e.jsx(le,{children:"Add or remove project page URLs (e.g. authors' demo or landing pages) associated with this paper. Mark pages as official if they are created by the paper authors."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Add Project Page URL"}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(H,{type:"url",placeholder:"https://example.com/project",value:j,onChange:c=>h(c.target.value),onKeyPress:c=>{c.key==="Enter"&&(c.preventDefault(),R())},className:"flex-1"}),e.jsxs(M,{onClick:R,size:"sm",disabled:!j.trim(),children:[e.jsx(Fe,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:o.length>0?e.jsx("div",{className:"space-y-2",children:o.map((c,_)=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsx(gt,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-sm font-medium text-paper-blue truncate",children:c.url}),c.is_official&&e.jsx(wt,{variant:"secondary",className:"text-xs",children:"Official"})]})}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxs(M,{variant:c.is_official?"default":"outline",size:"sm",onClick:()=>D(c.url),className:"h-8 px-2 text-xs",title:c.is_official?"Click to unmark as official (created by paper authors)":"Click to mark as official (created by paper authors)",children:[e.jsx(Ct,{className:`w-3.5 h-3.5 mr-1 ${c.is_official?"fill-current":""}`}),c.is_official?"Official":"Mark official"]}),e.jsx(M,{variant:"ghost",size:"sm",onClick:()=>E(c.url),className:"h-8 px-2 text-destructive hover:text-destructive",title:"Remove project page",children:e.jsx($e,{className:"w-4 h-4"})})]})]},_))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(gt,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"No project pages added yet"}),e.jsx("p",{className:"text-xs mt-1",children:"Add a project page URL above to get started"})]})}),e.jsxs(ie,{children:[e.jsx(M,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(M,{onClick:S,disabled:C.isPending,children:C.isPending?e.jsxs(e.Fragment,{children:[e.jsx(G,{className:"w-4 h-4 mr-2 animate-spin"}),"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(te,{className:"w-4 h-4 mr-2"}),"Save Changes"]})})]})]})})}function Ca(s){return s.map(a=>{const n=a.best_metric||Object.keys(a.metrics)[0],d=a.metrics[n];return{id:a.id,task_id:a.task_id,dataset_id:a.dataset_id,model_name:a.model_name||"",harness:a.harness||"",metric_name:n||"",metric_value:String(d||""),best_rank:a.best_rank?String(a.best_rank):"",operation:"unchanged"}})}function Ea({open:s,onOpenChange:a,paperId:n,arxivId:d,initialEvaluations:r,onSuccess:t}){const[o,m]=u.useState([]),j=se(),h=u.useRef(!1),k=u.useRef(!1);u.useEffect(()=>{if(!s){h.current=!1,k.current=!1;return}h.current||k.current||r.length!==0&&(h.current=!0,m(Ca(r)))},[s,r]);const{data:f}=O({queryKey:["tasks-for-eval-edit"],queryFn:()=>_t({page_size:100}),enabled:s}),{data:C}=O({queryKey:["datasets-for-eval-edit"],queryFn:()=>pt({page_size:100}),enabled:s}),P=u.useMemo(()=>Array.from(new Set(o.map(b=>b.task_id).filter(b=>b&&b!==""))),[o]),R=O({queryKey:["datasets-by-tasks",P,s],queryFn:async()=>{if(!s)return{};const b={};return await Promise.all(P.map(async w=>{if(w)try{const p=await pt({task_id:parseInt(w),page_size:100});b[w]=p.results}catch(p){console.error(`Error fetching datasets for task ${w}:`,p),b[w]=[]}})),b},enabled:s&&P.length>0}),E=b=>b?R.data&&R.data[b]?R.data[b]:(C==null?void 0:C.results)||[]:(C==null?void 0:C.results)||[],D=(b,w)=>{if(!b||!w)return!1;const p=E(b).find(i=>i.id===w);return!!(p!=null&&p.supports_harness)},S=ae({mutationFn:async({paperId:b,evaluations:w})=>{for(const p of w)if(p.operation==="delete"&&p.id)try{await Ms(p.id)}catch(i){if((typeof i=="object"&&i!==null&&"status"in i?i.status:void 0)!==404)throw i;console.log(`Evaluation ${p.id} already deleted or not found`)}else if(p.operation==="create"){const i=D(p.task_id,p.dataset_id);await Ts({paper_id:parseInt(b),task_id:parseInt(p.task_id),dataset_id:parseInt(p.dataset_id),model_name:p.model_name||void 0,harness:i&&p.harness||void 0,metrics:{[p.metric_name]:p.metric_value},best_metric:p.metric_name,best_rank:p.best_rank?parseInt(p.best_rank):void 0})}else if(p.operation==="update"&&p.id){const i=D(p.task_id,p.dataset_id);await As(p.id,{task_id:parseInt(p.task_id),dataset_id:parseInt(p.dataset_id),model_name:p.model_name||void 0,harness:i&&p.harness||null,metrics:{[p.metric_name]:p.metric_value},best_metric:p.metric_name,best_rank:p.best_rank?parseInt(p.best_rank):void 0})}},onSuccess:()=>{j.invalidateQueries({queryKey:["paper-arxiv",d]}),j.invalidateQueries({queryKey:["evaluations","paper",n]}),t==null||t(),a(!1)}}),c=()=>{k.current=!0,m([...o,{task_id:"",dataset_id:"",model_name:"",harness:"",metric_name:"",metric_value:"",best_rank:"",operation:"create"}])},_=b=>{k.current=!0,o[b].id?m(o.map((p,i)=>i===b?{...p,operation:"delete"}:p)):m(o.filter((p,i)=>i!==b))},T=(b,w,p)=>{k.current=!0,m(o.map((i,v)=>{if(v!==b)return i;const x={...i,[w]:p};return w==="task_id"&&(x.dataset_id="",x.harness=""),w==="dataset_id"&&p&&!D(x.task_id,p)&&(x.harness=""),i.operation==="unchanged"&&(x.operation="update"),x}))},A=()=>{const b=o.filter(w=>w.operation!=="delete"||w.id);S.mutate({paperId:n,evaluations:b})};return e.jsx(me,{open:s,onOpenChange:a,children:e.jsxs(re,{className:"max-w-6xl max-h-[800px]",children:[e.jsxs(ne,{children:[e.jsx(oe,{children:"Edit Evaluation Results"}),e.jsx(le,{children:"Add, edit, or remove evaluation results for this paper. Each row represents a benchmark result."})]}),e.jsxs("div",{className:"py-4 overflow-y-auto max-h-[600px]",children:[o.filter(b=>b.operation!=="delete").length>0?e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Task"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Dataset"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Model"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Harness"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Metric"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Value"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm w-16",children:"Action"})]})}),e.jsx("tbody",{children:o.map((b,w)=>{var p;return b.operation==="delete"?null:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("td",{className:"py-2 px-2",children:e.jsxs("select",{className:"w-full px-2 py-1 text-sm border border-border rounded-md bg-background",value:b.task_id,onChange:i=>T(w,"task_id",i.target.value),children:[e.jsx("option",{value:"",children:"Select Task"}),(p=f==null?void 0:f.results)==null?void 0:p.map(i=>e.jsx("option",{value:i.id,children:i.name},i.id))]})}),e.jsx("td",{className:"py-2 px-2",children:e.jsxs("select",{className:"w-full px-2 py-1 text-sm border border-border rounded-md bg-background",value:b.dataset_id,onChange:i=>T(w,"dataset_id",i.target.value),children:[e.jsx("option",{value:"",children:"Select Dataset"}),E(b.task_id).map(i=>e.jsx("option",{value:i.id,children:i.name},i.id))]})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(H,{type:"text",className:"w-full text-sm",placeholder:"Model name",value:b.model_name,onChange:i=>T(w,"model_name",i.target.value)})}),e.jsx("td",{className:"py-2 px-2",children:D(b.task_id,b.dataset_id)?e.jsx(H,{type:"text",className:"w-full text-sm",placeholder:"Claude Code, Terminus, ...",value:b.harness,onChange:i=>T(w,"harness",i.target.value)}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"Not supported"})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(H,{type:"text",className:"w-full text-sm",placeholder:"AP, mAP, etc.",value:b.metric_name,onChange:i=>T(w,"metric_name",i.target.value)})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(H,{type:"text",className:"w-full text-sm",placeholder:"44.9",value:b.metric_value,onChange:i=>T(w,"metric_value",i.target.value)})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(M,{variant:"ghost",size:"sm",onClick:()=>_(w),className:"h-8 w-8 p-0 text-destructive hover:text-destructive",title:"Delete row",children:e.jsx($e,{className:"w-4 h-4"})})})]},w)})})]})}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Bs,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),e.jsx("p",{children:"No evaluation results yet"}),e.jsx("p",{className:"text-sm mt-2",children:'Click "Add Row" below to add a new evaluation'})]}),e.jsx("div",{className:"mt-4",children:e.jsxs(M,{variant:"outline",size:"sm",onClick:c,className:"flex items-center space-x-2",children:[e.jsx(Fe,{className:"w-4 h-4"}),e.jsx("span",{children:"Add Row"})]})})]}),e.jsxs(ie,{children:[e.jsx(M,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(M,{onClick:A,disabled:S.isPending,children:S.isPending?e.jsxs(e.Fragment,{children:[e.jsx(G,{className:"w-4 h-4 mr-2 animate-spin"}),"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(te,{className:"w-4 h-4 mr-2"}),"Save Changes"]})})]})]})})}const J=["my-bookmark-ids"];function Sa(){var d,r;const{user:s}=ke(),a=O({queryKey:J,queryFn:()=>ve.getMyBookmarkIds(),enabled:!!s,staleTime:60*1e3,refetchOnWindowFocus:!1}),n=Ae.useMemo(()=>{var t;return new Set(((t=a.data)==null?void 0:t.paper_ids)??[])},[(d=a.data)==null?void 0:d.paper_ids]);return{ids:((r=a.data)==null?void 0:r.paper_ids)??[],idSet:n,isLoading:a.isLoading,isError:a.isError}}function Pa(){const{user:s}=ke(),a=se(),n=ae({mutationFn:async({paperId:r,isBookmarked:t})=>{t?await ve.removeBookmark(r):await ve.addBookmark(r)},onMutate:async({paperId:r,isBookmarked:t})=>{await a.cancelQueries({queryKey:J});const o=a.getQueryData(J),m=typeof r=="string"?Number(r):r,j=(o==null?void 0:o.paper_ids)??[],h=t?j.filter(k=>k!==m):[m,...j.filter(k=>k!==m)];return a.setQueryData(J,{paper_ids:h}),{previous:o}},onError:(r,t,o)=>{o!=null&&o.previous&&a.setQueryData(J,o.previous)},onSettled:()=>{a.invalidateQueries({queryKey:J}),a.invalidateQueries({queryKey:["my-bookmarks"]})}});return{toggle:Ae.useCallback((r,t)=>{if(!s){if(Nt())return;const o=typeof window<"u"?window.location.pathname+window.location.search:"/";window.location.href=kt(`/api/v1/auth/hf/login?return_to=${encodeURIComponent(o)}`);return}n.mutate({paperId:r,isBookmarked:t})},[n,s]),isPending:n.isPending}}const Ra=({paperId:s})=>{const{user:a}=ke(),{idSet:n}=Sa(),{toggle:d,isPending:r}=Pa();if(Nt())return null;const t=Number(s),o=!!a&&n.has(t),m=()=>{Number.isFinite(t)&&d(t,o)},j=a&&o?"Saved":"Save",h=a?o?"Remove from saved papers":"Save this paper":"Sign in with Hugging Face to save this paper";return e.jsxs("button",{type:"button",className:`action-btn${o?" is-saved":""}`,onClick:m,disabled:r,"aria-pressed":o,"aria-label":h,title:h,children:[e.jsx(L,{name:"bookmark",size:12}),j]})},ge=360,De=3;function jt(s){if(!s)return"—";try{return new Date(s).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"—"}}function vt(s){return s>=1e3?`${(s/1e3).toFixed(1)}k`:String(s)}function je(s,a){try{const n=new URL(s),r=n.pathname.replace(/\/$/,"").split("/").filter(Boolean).at(-1);return r?r.replace(/[-_]+/g," "):n.hostname.replace(/^www\./,"")}catch{return a}}const Ga=()=>{var tt,st,at,rt,nt,it,ot,lt,ct,dt,ut,mt;const{arxivId:s}=gs(),a=js(),{toast:n}=Te(),{user:d}=ke(),r=(d==null?void 0:d.is_admin)??!1,{data:t,isLoading:o,error:m,refetch:j}=Ls(s||"",!!s),[h,k]=u.useState(!1);u.useEffect(()=>{if(k(!1),!(t!=null&&t.id))return;const l=window.setTimeout(()=>k(!0),0);return()=>window.clearTimeout(l)},[t==null?void 0:t.id]);const{data:f,isLoading:C}=Qs(h?t==null?void 0:t.arxiv_id:void 0),{data:P,isLoading:R}=zs(t==null?void 0:t.id,h&&!!(t!=null&&t.id)),E=u.useMemo(()=>({models:(t==null?void 0:t.hf_models)??[],datasets:(t==null?void 0:t.hf_datasets)??[],spaces:(t==null?void 0:t.hf_spaces)??[]}),[t==null?void 0:t.hf_models,t==null?void 0:t.hf_datasets,t==null?void 0:t.hf_spaces]),D=u.useMemo(()=>{if(!P)return[];const l=new Map;for(const y of P){const F=y.task_id,ce=l.get(F);ce?ce.rows.push(y):l.set(F,{taskId:F,taskName:y.task_name||"—",taskSlug:y.task_slug,rows:[y]})}return Array.from(l.values())},[P]),S=O({queryKey:["paper-versions",t==null?void 0:t.arxiv_id],queryFn:async()=>{const l=t.arxiv_id.replace(/v\d+$/,""),y=await fetch(kt(`/api/v1/papers/arxiv/${l}/versions`));return y.ok?await y.json():[]},enabled:h&&!!(t!=null&&t.arxiv_id),staleTime:10*60*1e3}),c=O({queryKey:["related-papers",(st=(tt=t==null?void 0:t.tasks)==null?void 0:tt[0])==null?void 0:st.id],queryFn:()=>ve.getTaskPapers(t.tasks[0].id,{page:1,page_size:5,order_by:"citation_count",order_dir:"desc",include_resources:!1}),enabled:h&&!!((rt=(at=t==null?void 0:t.tasks)==null?void 0:at[0])!=null&&rt.id),staleTime:10*60*1e3,select:l=>l.results.filter(y=>y.id!==(t==null?void 0:t.id)).slice(0,4)}),[_,T]=u.useState(!1),[A,b]=u.useState(!1),[w,p]=u.useState(!1),{isEditingTasks:i,setIsEditingTasks:v,isEditingMethods:x,setIsEditingMethods:N,isEditingRepositories:g,setIsEditingRepositories:q,isEditingProjectPages:B,setIsEditingProjectPages:I,isEditingEvaluations:Ee,setIsEditingEvaluations:Qe}=Ks(),[Ke,Se]=u.useState("idle"),[Ue,We]=u.useState(null),[Ge,Ve]=u.useState(null),es=async()=>{if(s){Se("indexing"),We(null),Ve(null);try{await Fs(s),n({title:"Indexed",description:"Paper added to database."}),setTimeout(()=>j(),1200),Se("idle")}catch(l){const y=l;let F=y.message||"Failed to index paper";if(y.response)try{F=JSON.parse(y.response).detail||F}catch{F=y.response}We(F),(y.status===429||y.status===503)&&Ve("Try again later after arXiv has lifted the temporary limit."),Se("idle")}}};if(o)return e.jsxs("div",{className:"page",children:[e.jsx(de,{className:"h-12 w-3/4 mb-4"}),e.jsx(de,{className:"h-6 w-1/3 mb-8"}),e.jsx(de,{className:"h-64 w-full"})]});if(m||!t)return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(Z,{to:"/papers",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsxs("span",{style:{color:"var(--ink)"},children:["arXiv:",s]})]}),e.jsx("h1",{className:"detail-title",children:"Paper not indexed yet"}),e.jsxs("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:16,maxWidth:640},children:["We don't have ",e.jsxs("span",{style:{fontFamily:"var(--mono)"},children:["arXiv:",s]})," in the database. You can index it from arXiv right now."]}),Ue&&e.jsx(Os,{variant:"destructive",className:"mt-4 max-w-xl",children:e.jsxs(qs,{children:[e.jsx("div",{children:Ue}),Ge&&e.jsx("div",{className:"mt-2",children:Ge})]})}),e.jsxs("div",{className:"action-row",children:[r&&e.jsxs("button",{className:"action-btn",onClick:es,disabled:Ke==="indexing",children:[e.jsx(L,{name:"sparkle",size:12}),Ke==="indexing"?"Indexing…":"Index from arXiv"]}),e.jsx(M,{variant:"outline",onClick:()=>a("/papers"),children:"Browse Papers"})]})]});const Xe=S.data||[],he=$s(t.repositories),z=[...t.repositories??[]].sort((l,y)=>{const F=l.is_official?1:0,ce=y.is_official?1:0;return F!==ce?ce-F:(y.num_stars||0)-(l.num_stars||0)}),ts=w?z:z.slice(0,De),ss=t.arxiv_id?{isLoading:C,paperHref:`https://huggingface.co/papers/${t.arxiv_id.replace(/v\d+$/,"")}`,rows:[{label:"Models",href:`https://huggingface.co/models?other=arxiv:${t.arxiv_id}`,count:f==null?void 0:f.models,isLimited:f==null?void 0:f.isLimited},{label:"Datasets",href:`https://huggingface.co/datasets?other=arxiv:${t.arxiv_id}`,count:f==null?void 0:f.datasets,isLimited:f==null?void 0:f.isLimited},{label:"Spaces",href:`https://huggingface.co/spaces?other=arxiv:${t.arxiv_id}`,count:f==null?void 0:f.spaces,isLimited:f==null?void 0:f.isLimited}],footer:`Cite arxiv.org/abs/${t.arxiv_id} in a HF README to link it here.`}:{isLoading:!1,paperHref:null,rows:[{label:"Models",href:Ie(E.models),count:E.models.length,links:E.models.map(l=>({href:l,label:je(l,"Model")}))},{label:"Datasets",href:Ie(E.datasets),count:E.datasets.length,links:E.datasets.map(l=>({href:l,label:je(l,"Dataset")}))},{label:"Spaces",href:Ie(E.spaces),count:E.spaces.length,links:E.spaces.map(l=>({href:l,label:je(l,"Space")}))}],footer:null},Ye=t.tldr||null,Ze=t.num_pages||null,X=t.abstract||"",as=X.length>ge?X.slice(0,ge)+"…":X,rs=_||X.length<=ge?X:as,fe=(t.methods||[]).filter(l=>l.source_paper_id===t.id),pe=t.introduced_benchmarks||[],ns=fe.length>0||pe.length>0,Je=t.arxiv_id?`arXiv:${t.arxiv_id}`:"External resource",is=t.source==="external"?"Source page":"arXiv page",Y=((nt=t.project_pages)==null?void 0:nt.filter(l=>l.url))??[],os=(()=>{const l=[];return fe.length>0&&l.push(fe.length===1?"this method":"these methods"),pe.length>0&&l.push(pe.length===1?"this benchmark":"these benchmarks"),l.length===0?"":l.length===1?l[0]:l.join(" and ")})(),xe=12,et=A||t.authors.length<=xe?t.authors:t.authors.slice(0,xe);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(Z,{to:"/",children:"Trending"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{children:Je})]}),e.jsxs("div",{className:"detail-grid",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"detail-title",children:e.jsx(ft,{title:t.title})}),e.jsxs("div",{className:"detail-meta",children:[e.jsx("span",{children:Je}),e.jsx("span",{children:"·"}),e.jsxs("span",{children:["Submitted ",jt(t.published)]}),Ze&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[Ze," pages"]})]}),t.citation_count!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[t.citation_count.toLocaleString()," citations"]})]}),t.proceeding&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:t.proceeding.replace(/\s+\d{1,2}$/,"")})]}),Xe.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("select",{className:"version-select",value:t.version,onChange:l=>{const y=l.target.value;t.arxiv_id&&a(`/paper/${t.arxiv_id.replace(/v\d+$/,"")}${y?`?version=${y}`:""}`)},children:Xe.map(l=>e.jsxs("option",{value:l.version,children:[l.version," — ",jt(l.published)]},l.version))})]})]}),e.jsxs("div",{className:"detail-authors",children:[et.map((l,y)=>e.jsxs(Ae.Fragment,{children:[e.jsx("a",{children:l}),y<et.length-1?", ":""]},y)),t.authors.length>xe&&e.jsx("button",{className:"show-more-authors",onClick:()=>b(l=>!l),style:{marginLeft:8,background:"none",border:"none",cursor:"pointer",color:"var(--accent-text)",fontFamily:"var(--mono)",fontSize:12},children:A?"show fewer":`+${t.authors.length-xe} more`})]}),e.jsxs("div",{className:"action-row",children:[t.url_pdf&&e.jsxs("a",{className:"action-btn",href:t.url_pdf,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(L,{name:"pdf",size:12})," View PDF"]}),t.url_abs&&e.jsxs("a",{className:"action-btn",href:t.url_abs,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(L,{name:"external",size:12})," ",is]}),he.githubUrl&&e.jsxs("a",{className:"action-btn",href:he.githubUrl,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(L,{name:"github",size:12})," Code",he.github!=null&&e.jsxs("span",{style:{opacity:.7,marginLeft:4},children:["· ",vt(he.github)," ★"]})]}),Y.length===1&&!r?e.jsxs("a",{className:"action-btn",href:Y[0].url,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(L,{name:"globe",size:12})," Project page"]}):null,Y.length>0&&(Y.length>1||r)?e.jsxs(vs,{children:[e.jsx(bs,{asChild:!0,children:e.jsxs("button",{type:"button",className:"action-btn",children:[e.jsx(L,{name:"globe",size:12})," Project page"]})}),e.jsxs(ys,{align:"start",className:"project-page-menu",children:[Y.map((l,y)=>e.jsx(ht,{asChild:!0,children:e.jsx("a",{href:l.url,target:"_blank",rel:"noopener noreferrer",children:je(l.url,`Project page ${y+1}`)})},l.url)),r&&e.jsxs(e.Fragment,{children:[e.jsx(Ns,{}),e.jsx(ht,{onSelect:()=>I(!0),children:"Add or edit project pages"})]})]})]}):null,r&&Y.length===0?e.jsxs("button",{type:"button",className:"action-btn",onClick:()=>I(!0),title:"Add project page",children:[e.jsx(L,{name:"globe",size:12})," Add project page"]}):null,t.conference_url_abs&&e.jsxs("a",{className:"action-btn",href:t.conference_url_abs,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(L,{name:"external",size:12})," Conference"]}),e.jsx(Ra,{paperId:t.id})]}),ns&&e.jsxs("div",{className:"introduced-banner",children:[e.jsx("span",{className:"introduced-label",children:"Introduced"}),e.jsxs("div",{className:"introduced-methods",children:[fe.map(l=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>a(`/methods/${l.slug||l.id}`),children:[l.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`method-${l.id}`)),pe.map(l=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>a(`/benchmark/${l.slug||l.id}`),children:[l.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`benchmark-${l.id}`))]}),e.jsxs("span",{className:"introduced-note",children:["This paper is the canonical source for ",os,"."]})]}),Ye&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"section-rule",children:e.jsx("span",{children:"TL;DR · AI-generated"})}),e.jsx("div",{className:"tldr-box",children:Ye})]}),e.jsx("div",{className:"section-rule",children:e.jsx("span",{children:"Abstract"})}),e.jsx("p",{className:"abstract-text",style:{marginBottom:8},children:e.jsx(Cs,{text:rs})}),X.length>ge&&e.jsx("div",{className:"read-full",onClick:()=>T(l=>!l),children:_?"− collapse abstract":"+ read full abstract"}),e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:"Tasks"}),e.jsxs("span",{className:"accent",children:[((it=t.tasks)==null?void 0:it.length)||0," tagged",r&&e.jsx("button",{onClick:()=>v(!0),className:"edit-link",style:{marginLeft:8,background:"none",border:"none",cursor:"pointer",color:"var(--accent-text)",textDecoration:"underline",fontFamily:"var(--mono)",fontSize:11},children:"edit"})]})]}),e.jsx("div",{className:"paper-tags",style:{marginBottom:8},children:(t.tasks||[]).map(l=>e.jsx(_s,{slug:l.slug||"",label:l.name},l.id))}),e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:"Methods"}),e.jsxs("span",{className:"accent",children:[((ot=t.methods)==null?void 0:ot.length)||0," used",r&&e.jsx("button",{onClick:()=>N(!0),className:"edit-link",style:{marginLeft:8,background:"none",border:"none",cursor:"pointer",color:"var(--accent-text)",textDecoration:"underline",fontFamily:"var(--mono)",fontSize:11},children:"edit"})]})]}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:8},children:(t.methods||[]).map(l=>e.jsx(ws,{method:l},l.id))}),e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:"Results"}),e.jsxs("span",{className:"accent",children:[(P==null?void 0:P.length)||0," benchmarks",r&&e.jsx("button",{onClick:()=>Qe(!0),className:"edit-link",style:{marginLeft:8,background:"none",border:"none",cursor:"pointer",color:"var(--accent-text)",textDecoration:"underline",fontFamily:"var(--mono)",fontSize:11},children:"edit"})]})]}),R?e.jsx(de,{className:"h-32 w-full"}):D.length>0?D.map(l=>e.jsxs("div",{children:[e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:l.taskSlug?e.jsx(Z,{to:`/tasks/${l.taskSlug}`,children:l.taskName}):l.taskName}),e.jsxs("span",{className:"accent",children:[l.rows.length," ",l.rows.length===1?"result":"results"]})]}),e.jsxs("table",{className:"results-table",children:[e.jsxs("colgroup",{children:[e.jsx("col",{style:{width:"30%"}}),e.jsx("col",{style:{width:"30%"}}),e.jsx("col",{style:{width:"15%"}}),e.jsx("col",{style:{width:"15%"}}),e.jsx("col",{style:{width:"10%"}})]}),e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Benchmark"}),e.jsx("th",{children:"Model"}),e.jsx("th",{children:"Metric"}),e.jsx("th",{children:"Value"}),e.jsx("th",{})]})}),e.jsx("tbody",{children:l.rows.map(y=>{var F;return e.jsxs("tr",{children:[e.jsx("td",{className:"benchmark",children:y.dataset_slug?e.jsx(Z,{to:`/benchmark/${y.dataset_slug}`,children:y.dataset_name||"—"}):y.dataset_name||"—"}),e.jsx("td",{className:"model",title:y.model_name||void 0,children:y.model_name||"—"}),e.jsx("td",{className:"metric",children:y.best_metric}),e.jsx("td",{className:"value",children:ks((F=y.metrics)==null?void 0:F[y.best_metric||""])}),e.jsx("td",{className:"compare",children:y.dataset_slug&&e.jsx(Z,{to:`/benchmark/${y.dataset_slug}?eval=${encodeURIComponent(y.id)}`,children:"Compare →"})})]},y.id)})})]})]},l.taskId)):e.jsx("p",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-faint)"},children:"No benchmark results recorded yet."})]}),e.jsxs("aside",{className:"detail-sidebar",children:[(z.length>0||r)&&e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[e.jsx("span",{children:"GitHub"}),e.jsxs("span",{className:"badge",children:[z.length," repo",z.length===1?"":"s",r&&e.jsx("button",{onClick:()=>q(!0),className:"edit-link",style:{marginLeft:8,background:"none",border:"none",cursor:"pointer",color:"var(--accent-text)",textDecoration:"underline",fontFamily:"var(--mono)",fontSize:11},children:"edit"})]})]}),ts.map(l=>e.jsxs("a",{href:l.url,target:"_blank",rel:"noopener noreferrer",className:"code-line",style:{textDecoration:"none"},children:[e.jsxs("span",{className:"code-line-repo",children:[e.jsx(L,{name:"github",size:12}),e.jsxs("span",{className:"code-line-repo-name",children:[l.owner,"/",l.name]}),l.is_official&&e.jsx("span",{className:"code-line-official",children:"· Official"})]}),e.jsxs("span",{className:"code-line-stars",children:["★ ",vt(l.num_stars)]})]},l.id)),z.length===0&&r&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",padding:"6px 0"},children:"No GitHub repositories linked yet."}),z.length>De&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>p(l=>!l),children:w?"− show top 3":`+ show ${z.length-De} more repos`})]}),e.jsx(Da,{viewer:ss}),e.jsxs("div",{className:"sidebar-card",children:[e.jsx("div",{className:"sidebar-card-title",children:"Citation"}),e.jsx("pre",{style:{fontFamily:"var(--mono)",fontSize:10.5,lineHeight:1.5,color:"var(--ink-soft)",whiteSpace:"pre-wrap",wordBreak:"break-word",margin:0},children:t.arxiv_id?`@article{${t.arxiv_id.replace(".","")},
36
+ title={{${t.title.slice(0,60)}${t.title.length>60?"…":""}}},
37
+ author={{${t.authors[0]||""}${t.authors.length>1?" et al.":""}}},
38
+ year={{${(t.published||"").slice(0,4)||"—"}}},
39
+ eprint={{${t.arxiv_id}}},
40
+ archivePrefix={{arXiv}}
41
+ }`:`@misc{paper${t.id},
42
+ title={{${t.title.slice(0,60)}${t.title.length>60?"…":""}}},
43
+ author={{${t.authors[0]||""}${t.authors.length>1?" et al.":""}}},
44
+ year={{${(t.published||"").slice(0,4)||"—"}}},
45
+ url={{${t.source_url||t.url_abs||""}}}
46
+ }`})]}),(((lt=c.data)==null?void 0:lt.length)??0)>0&&e.jsxs("div",{className:"sidebar-card",children:[e.jsx("div",{className:"sidebar-card-title",children:"Related papers"}),c.data.map(l=>e.jsxs(Z,{to:`/paper/${l.arxiv_id||l.id}`,target:"_blank",rel:"noopener noreferrer",className:"related-paper",style:{textDecoration:"none",color:"inherit"},children:[e.jsx("div",{className:"related-title",children:e.jsx(ft,{title:l.title})}),e.jsxs("div",{className:"related-meta",children:[e.jsx("span",{children:l.arxiv_id?`arXiv:${l.arxiv_id}`:"External resource"}),l.citation_count!=null&&e.jsxs("span",{children:[l.citation_count.toLocaleString()," cites"]})]})]},l.id))]})]})]}),e.jsx(ba,{open:i,onOpenChange:v,paperId:t.id,arxivId:s,initialTaskIds:((ct=t.tasks)==null?void 0:ct.map(l=>parseInt(l.id)))||[],initialTasks:t.tasks||[]}),e.jsx(ka,{open:x,onOpenChange:N,paperId:t.id,arxivId:s,initialMethodIds:((dt=t.methods)==null?void 0:dt.map(l=>parseInt(l.id)))||[],initialMethods:t.methods||[]}),e.jsx(_a,{open:g,onOpenChange:q,paperId:t.id,arxivId:s,initialRepositories:((ut=t.repositories)==null?void 0:ut.map(l=>({url:l.url,is_official:l.is_official||!1})))||[]}),e.jsx(wa,{open:B,onOpenChange:I,paperId:t.id,arxivId:s,initialProjectPages:((mt=t.project_pages)==null?void 0:mt.map(l=>({url:l.url,is_official:l.is_official||!1})))||[]}),e.jsx(Ea,{open:Ee,onOpenChange:Qe,paperId:t.id,arxivId:s,initialEvaluations:P||[]})]})},Da=({viewer:s})=>e.jsxs("div",{className:"sidebar-card",children:[e.jsx("div",{className:"sidebar-card-title",children:s.paperHref?e.jsx("a",{href:s.paperHref,target:"_blank",rel:"noopener noreferrer",style:{color:"inherit",textDecoration:"none"},children:"🤗 Hugging Face"}):e.jsx("span",{children:"🤗 Hugging Face"})}),s.isLoading?e.jsx(de,{className:"h-16 w-full"}):e.jsxs(e.Fragment,{children:[s.rows.map(a=>e.jsx(Ia,{...a},a.label)),s.footer&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:10,color:"var(--ink-faint)",marginTop:12},children:s.footer})]})]}),Ia=({label:s,href:a,count:n,isLimited:d,links:r})=>{const t=((r==null?void 0:r.length)??0)>0,o=e.jsxs("div",{className:"hf-artifact-row-header",children:[e.jsx("span",{children:s}),e.jsx("span",{style:{fontWeight:600,color:n?"var(--ink)":"var(--ink-faint)"},children:n!=null?`${n}${d?"+":""}`:"—"})]});return t?e.jsxs("div",{className:"hf-artifact-row",children:[o,e.jsx("div",{className:"hf-artifact-links",children:r.map(m=>e.jsx("a",{href:m.href,target:"_blank",rel:"noopener noreferrer",children:m.label},m.href))})]}):e.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"hf-artifact-row",children:o})};function Ie(s){return s[0]??"https://huggingface.co"}export{Ga as default};
assets/PaperDetailView-DVL_utdK.js DELETED
@@ -1,41 +0,0 @@
1
- var Nt=s=>{throw TypeError(s)};var Le=(s,a,r)=>a.has(s)||Nt("Cannot "+r);var M=(s,a,r)=>(Le(s,a,"read from private field"),r?r.call(s):a.get(s)),ne=(s,a,r)=>a.has(s)?Nt("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(s):a.set(s,r),ie=(s,a,r,i)=>(Le(s,a,"write to private field"),i?i.call(s,r):a.set(s,r),r),oe=(s,a,r)=>(Le(s,a,"access private method"),r);import{S as vs,s as bs,h as kt,g as ys,n as Dt,a as ae,r as l,b as Ns,c as ks,d as je,j as e,P as Re,e as J,f as Mt,i as ve,k as ee,l as _s,m as It,C as Y,o as Z,p as ws,q as Oe,t as Cs,v as Es,R as Ss,w as Ps,F as Rs,D as Ds,x as Ms,X as Qe,y as He,z as De,A as Ue,B as Tt,E as At,G as Is,H as Ts,L as le,I as As}from"./index-BcdJ5r4Y.js";import{u as q}from"./adminAuth-CijC1LpP.js";import{I as z,T as Fs,M as $s}from"./components-MYNA0qNJ.js";import{L as _t,a as Ls}from"./LatexTitle-_7AiBIQK.js";import{g as Os,u as qs,b as Ft,c as Bs,d as zs,e as Ks,f as Qs,h as Hs,i as Us,j as Ws,k as wt,a as Ee,l as Gs}from"./api-DVAIDRP9.js";import{e as Vs}from"./transform-Dasg-XFy.js";import{b as Xs}from"./usePapers-Swv3hMJI.js";import{S as ge,A as Ys,a as Zs}from"./alert-BfBSxmdQ.js";import{I as V,L as te,B as A,a as $t,D as Js}from"./badge-Buw8W5Kz.js";import"./useInfiniteQuery-jK6uM4vU.js";var K,G,$,Q,H,Ce,Ke,Rt,ea=(Rt=class extends vs{constructor(a,r){super();ne(this,H);ne(this,K);ne(this,G);ne(this,$);ne(this,Q);ie(this,K,a),this.setOptions(r),this.bindMethods(),oe(this,H,Ce).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(a){var i;const r=this.options;this.options=M(this,K).defaultMutationOptions(a),bs(this.options,r)||M(this,K).getMutationCache().notify({type:"observerOptionsUpdated",mutation:M(this,$),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&kt(r.mutationKey)!==kt(this.options.mutationKey)?this.reset():((i=M(this,$))==null?void 0:i.state.status)==="pending"&&M(this,$).setOptions(this.options)}onUnsubscribe(){var a;this.hasListeners()||(a=M(this,$))==null||a.removeObserver(this)}onMutationUpdate(a){oe(this,H,Ce).call(this),oe(this,H,Ke).call(this,a)}getCurrentResult(){return M(this,G)}reset(){var a;(a=M(this,$))==null||a.removeObserver(this),ie(this,$,void 0),oe(this,H,Ce).call(this),oe(this,H,Ke).call(this)}mutate(a,r){var i;return ie(this,Q,r),(i=M(this,$))==null||i.removeObserver(this),ie(this,$,M(this,K).getMutationCache().build(M(this,K),this.options)),M(this,$).addObserver(this),M(this,$).execute(a)}},K=new WeakMap,G=new WeakMap,$=new WeakMap,Q=new WeakMap,H=new WeakSet,Ce=function(){var r;const a=((r=M(this,$))==null?void 0:r.state)??ys();ie(this,G,{...a,isPending:a.status==="pending",isSuccess:a.status==="success",isError:a.status==="error",isIdle:a.status==="idle",mutate:this.mutate,reset:this.reset})},Ke=function(a){Dt.batch(()=>{var r,i,n,t,o,u,g,f;if(M(this,Q)&&this.hasListeners()){const N=M(this,G).variables,p=M(this,G).context,S={client:M(this,K),meta:this.options.meta,mutationKey:this.options.mutationKey};if((a==null?void 0:a.type)==="success"){try{(i=(r=M(this,Q)).onSuccess)==null||i.call(r,a.data,N,p,S)}catch(C){Promise.reject(C)}try{(t=(n=M(this,Q)).onSettled)==null||t.call(n,a.data,null,N,p,S)}catch(C){Promise.reject(C)}}else if((a==null?void 0:a.type)==="error"){try{(u=(o=M(this,Q)).onError)==null||u.call(o,a.error,N,p,S)}catch(C){Promise.reject(C)}try{(f=(g=M(this,Q)).onSettled)==null||f.call(g,void 0,a.error,N,p,S)}catch(C){Promise.reject(C)}}}this.listeners.forEach(N=>{N(M(this,G))})})},Rt);function de(s,a){const r=ae(),[i]=l.useState(()=>new ea(r,s));l.useEffect(()=>{i.setOptions(s)},[i,s]);const n=l.useSyncExternalStore(l.useCallback(o=>i.subscribe(Dt.batchCalls(o)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),t=l.useCallback((o,u)=>{i.mutate(o,u).catch(Ns)},[i]);if(n.error&&ks(i.options.throwOnError,[n.error]))throw n.error;return{...n,mutate:t,mutateAsync:n.mutate}}/**
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 Ct=je("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/**
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 Et=je("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
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 We=je("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
17
- * @license lucide-react v0.462.0 - ISC
18
- *
19
- * This source code is licensed under the ISC license.
20
- * See the LICENSE file in the root directory of this source tree.
21
- */const Se=je("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
22
- * @license lucide-react v0.462.0 - ISC
23
- *
24
- * This source code is licensed under the ISC license.
25
- * See the LICENSE file in the root directory of this source tree.
26
- */const Ge=je("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);function ta(s,a=!0){return q({queryKey:["evaluations","paper",s],queryFn:()=>{if(!s)throw new Error("Paper ID is required");return Os(s)},enabled:a&&!!s,staleTime:5*60*1e3})}const qe=async(s,a)=>{try{const r=await fetch(`https://huggingface.co/api/arxiv/${a}/repos`);if(!r.ok)return console.warn(`Failed to fetch repos for arXiv:${a}, status: ${r.status}`),{count:0,isLimited:!1};const n=((await r.json())[s]||[]).length;return console.log(`${s} count for arXiv:${a}: ${n}`),n<100?{count:n,isLimited:!1}:{count:n,isLimited:!0}}catch(r){return console.warn(`Failed to fetch ${s} count for arXiv:${a}:`,r),{count:0,isLimited:!1}}},sa=async s=>{const[a,r,i]=await Promise.all([qe("models",s),qe("datasets",s),qe("spaces",s)]);return{models:a.count,datasets:r.count,spaces:i.count,isLimited:a.isLimited||r.isLimited||i.isLimited}},aa=s=>q({queryKey:["huggingface-repos",s],queryFn:()=>sa(s),enabled:!!s,staleTime:10*60*1e3,retry:1});function ra(){const[s,a]=l.useState(!1),[r,i]=l.useState(!1),[n,t]=l.useState(!1),[o,u]=l.useState(!1),[g,f]=l.useState(!1);return{isEditingTasks:s,openTasksDialog:()=>a(!0),closeTasksDialog:()=>a(!1),setIsEditingTasks:a,isEditingMethods:r,openMethodsDialog:()=>i(!0),closeMethodsDialog:()=>i(!1),setIsEditingMethods:i,isEditingRepositories:n,openRepositoriesDialog:()=>t(!0),closeRepositoriesDialog:()=>t(!1),setIsEditingRepositories:t,isEditingProjectPages:o,openProjectPagesDialog:()=>u(!0),closeProjectPagesDialog:()=>u(!1),setIsEditingProjectPages:u,isEditingEvaluations:g,openEvaluationsDialog:()=>f(!0),closeEvaluationsDialog:()=>f(!1),setIsEditingEvaluations:f}}function na(s){const a=l.useRef({value:s,previous:s});return l.useMemo(()=>(a.current.value!==s&&(a.current.previous=a.current.value,a.current.value=s),a.current.previous),[s])}var Me="Checkbox",[ia]=It(Me),[oa,Ve]=ia(Me);function la(s){const{__scopeCheckbox:a,checked:r,children:i,defaultChecked:n,disabled:t,form:o,name:u,onCheckedChange:g,required:f,value:N="on",internal_do_not_use_render:p}=s,[S,C]=Mt({prop:r,defaultProp:n??!1,onChange:g,caller:Me}),[D,P]=l.useState(null),[I,R]=l.useState(null),c=l.useRef(!1),k=D?!!o||!!D.closest("form"):!0,L={checked:S,disabled:t,setChecked:C,control:D,setControl:P,name:u,form:o,value:N,hasConsumerStoppedPropagationRef:c,required:f,defaultChecked:X(n)?!1:n,isFormControl:k,bubbleInput:I,setBubbleInput:R};return e.jsx(oa,{scope:a,...L,children:ca(p)?p(L):i})}var Lt="CheckboxTrigger",Ot=l.forwardRef(({__scopeCheckbox:s,onKeyDown:a,onClick:r,...i},n)=>{const{control:t,value:o,disabled:u,checked:g,required:f,setControl:N,setChecked:p,hasConsumerStoppedPropagationRef:S,isFormControl:C,bubbleInput:D}=Ve(Lt,s),P=ve(n,N),I=l.useRef(g);return l.useEffect(()=>{const R=t==null?void 0:t.form;if(R){const c=()=>p(I.current);return R.addEventListener("reset",c),()=>R.removeEventListener("reset",c)}},[t,p]),e.jsx(J.button,{type:"button",role:"checkbox","aria-checked":X(g)?"mixed":g,"aria-required":f,"data-state":Qt(g),"data-disabled":u?"":void 0,disabled:u,value:o,...i,ref:P,onKeyDown:ee(a,R=>{R.key==="Enter"&&R.preventDefault()}),onClick:ee(r,R=>{p(c=>X(c)?!0:!c),D&&C&&(S.current=R.isPropagationStopped(),S.current||R.stopPropagation())})})});Ot.displayName=Lt;var Xe=l.forwardRef((s,a)=>{const{__scopeCheckbox:r,name:i,checked:n,defaultChecked:t,required:o,disabled:u,value:g,onCheckedChange:f,form:N,...p}=s;return e.jsx(la,{__scopeCheckbox:r,checked:n,defaultChecked:t,disabled:u,required:o,onCheckedChange:f,name:i,form:N,value:g,internal_do_not_use_render:({isFormControl:S})=>e.jsxs(e.Fragment,{children:[e.jsx(Ot,{...p,ref:a,__scopeCheckbox:r}),S&&e.jsx(Kt,{__scopeCheckbox:r})]})})});Xe.displayName=Me;var qt="CheckboxIndicator",Bt=l.forwardRef((s,a)=>{const{__scopeCheckbox:r,forceMount:i,...n}=s,t=Ve(qt,r);return e.jsx(Re,{present:i||X(t.checked)||t.checked===!0,children:e.jsx(J.span,{"data-state":Qt(t.checked),"data-disabled":t.disabled?"":void 0,...n,ref:a,style:{pointerEvents:"none",...s.style}})})});Bt.displayName=qt;var zt="CheckboxBubbleInput",Kt=l.forwardRef(({__scopeCheckbox:s,...a},r)=>{const{control:i,hasConsumerStoppedPropagationRef:n,checked:t,defaultChecked:o,required:u,disabled:g,name:f,value:N,form:p,bubbleInput:S,setBubbleInput:C}=Ve(zt,s),D=ve(r,C),P=na(t),I=_s(i);l.useEffect(()=>{const c=S;if(!c)return;const k=window.HTMLInputElement.prototype,x=Object.getOwnPropertyDescriptor(k,"checked").set,E=!n.current;if(P!==t&&x){const m=new Event("click",{bubbles:E});c.indeterminate=X(t),x.call(c,X(t)?!1:t),c.dispatchEvent(m)}},[S,P,t,n]);const R=l.useRef(X(t)?!1:t);return e.jsx(J.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??R.current,required:u,disabled:g,name:f,value:N,form:p,...a,tabIndex:-1,ref:D,style:{...a.style,...I,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Kt.displayName=zt;function ca(s){return typeof s=="function"}function X(s){return s==="indeterminate"}function Qt(s){return X(s)?"indeterminate":s?"checked":"unchecked"}const Ye=l.forwardRef(({className:s,style:a,...r},i)=>e.jsx(Xe,{ref:i,className:Z("peer h-4 w-4 shrink-0 rounded-sm ring-offset-background data-[state=checked]:!bg-black data-[state=checked]:!text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",s),style:{border:"1px solid #000",...a},...r,children:e.jsx(Bt,{className:Z("flex items-center justify-center text-current"),children:e.jsx(Y,{className:"h-4 w-4"})})}));Ye.displayName=Xe.displayName;function da(s){const a=ua(s),r=l.forwardRef((i,n)=>{const{children:t,...o}=i,u=l.Children.toArray(t),g=u.find(ma);if(g){const f=g.props.children,N=u.map(p=>p===g?l.Children.count(f)>1?l.Children.only(null):l.isValidElement(f)?f.props.children:null:p);return e.jsx(a,{...o,ref:n,children:l.isValidElement(f)?l.cloneElement(f,void 0,N):null})}return e.jsx(a,{...o,ref:n,children:t})});return r.displayName=`${s}.Slot`,r}function ua(s){const a=l.forwardRef((r,i)=>{const{children:n,...t}=r;if(l.isValidElement(n)){const o=fa(n),u=pa(t,n.props);return n.type!==l.Fragment&&(u.ref=i?ws(i,o):o),l.cloneElement(n,u)}return l.Children.count(n)>1?l.Children.only(null):null});return a.displayName=`${s}.SlotClone`,a}var ha=Symbol("radix.slottable");function ma(s){return l.isValidElement(s)&&typeof s.type=="function"&&"__radixId"in s.type&&s.type.__radixId===ha}function pa(s,a){const r={...a};for(const i in a){const n=s[i],t=a[i];/^on[A-Z]/.test(i)?n&&t?r[i]=(...u)=>{const g=t(...u);return n(...u),g}:n&&(r[i]=n):i==="style"?r[i]={...n,...t}:i==="className"&&(r[i]=[n,t].filter(Boolean).join(" "))}return{...s,...r}}function fa(s){var i,n;let a=(i=Object.getOwnPropertyDescriptor(s.props,"ref"))==null?void 0:i.get,r=a&&"isReactWarning"in a&&a.isReactWarning;return r?s.ref:(a=(n=Object.getOwnPropertyDescriptor(s,"ref"))==null?void 0:n.get,r=a&&"isReactWarning"in a&&a.isReactWarning,r?s.props.ref:s.props.ref||s.ref)}var Ie="Dialog",[Ht]=It(Ie),[xa,O]=Ht(Ie),Ut=s=>{const{__scopeDialog:a,children:r,open:i,defaultOpen:n,onOpenChange:t,modal:o=!0}=s,u=l.useRef(null),g=l.useRef(null),[f,N]=Mt({prop:i,defaultProp:n??!1,onChange:t,caller:Ie});return e.jsx(xa,{scope:a,triggerRef:u,contentRef:g,contentId:Oe(),titleId:Oe(),descriptionId:Oe(),open:f,onOpenChange:N,onOpenToggle:l.useCallback(()=>N(p=>!p),[N]),modal:o,children:r})};Ut.displayName=Ie;var Wt="DialogTrigger",ga=l.forwardRef((s,a)=>{const{__scopeDialog:r,...i}=s,n=O(Wt,r),t=ve(a,n.triggerRef);return e.jsx(J.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":et(n.open),...i,ref:t,onClick:ee(s.onClick,n.onOpenToggle)})});ga.displayName=Wt;var Ze="DialogPortal",[ja,Gt]=Ht(Ze,{forceMount:void 0}),Vt=s=>{const{__scopeDialog:a,forceMount:r,children:i,container:n}=s,t=O(Ze,a);return e.jsx(ja,{scope:a,forceMount:r,children:l.Children.map(i,o=>e.jsx(Re,{present:r||t.open,children:e.jsx(Cs,{asChild:!0,container:n,children:o})}))})};Vt.displayName=Ze;var Pe="DialogOverlay",Xt=l.forwardRef((s,a)=>{const r=Gt(Pe,s.__scopeDialog),{forceMount:i=r.forceMount,...n}=s,t=O(Pe,s.__scopeDialog);return t.modal?e.jsx(Re,{present:i||t.open,children:e.jsx(ba,{...n,ref:a})}):null});Xt.displayName=Pe;var va=da("DialogOverlay.RemoveScroll"),ba=l.forwardRef((s,a)=>{const{__scopeDialog:r,...i}=s,n=O(Pe,r);return e.jsx(Ss,{as:va,allowPinchZoom:!0,shards:[n.contentRef],children:e.jsx(J.div,{"data-state":et(n.open),...i,ref:a,style:{pointerEvents:"auto",...i.style}})})}),se="DialogContent",Yt=l.forwardRef((s,a)=>{const r=Gt(se,s.__scopeDialog),{forceMount:i=r.forceMount,...n}=s,t=O(se,s.__scopeDialog);return e.jsx(Re,{present:i||t.open,children:t.modal?e.jsx(ya,{...n,ref:a}):e.jsx(Na,{...n,ref:a})})});Yt.displayName=se;var ya=l.forwardRef((s,a)=>{const r=O(se,s.__scopeDialog),i=l.useRef(null),n=ve(a,r.contentRef,i);return l.useEffect(()=>{const t=i.current;if(t)return Es(t)},[]),e.jsx(Zt,{...s,ref:n,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ee(s.onCloseAutoFocus,t=>{var o;t.preventDefault(),(o=r.triggerRef.current)==null||o.focus()}),onPointerDownOutside:ee(s.onPointerDownOutside,t=>{const o=t.detail.originalEvent,u=o.button===0&&o.ctrlKey===!0;(o.button===2||u)&&t.preventDefault()}),onFocusOutside:ee(s.onFocusOutside,t=>t.preventDefault())})}),Na=l.forwardRef((s,a)=>{const r=O(se,s.__scopeDialog),i=l.useRef(!1),n=l.useRef(!1);return e.jsx(Zt,{...s,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{var o,u;(o=s.onCloseAutoFocus)==null||o.call(s,t),t.defaultPrevented||(i.current||(u=r.triggerRef.current)==null||u.focus(),t.preventDefault()),i.current=!1,n.current=!1},onInteractOutside:t=>{var g,f;(g=s.onInteractOutside)==null||g.call(s,t),t.defaultPrevented||(i.current=!0,t.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const o=t.target;((f=r.triggerRef.current)==null?void 0:f.contains(o))&&t.preventDefault(),t.detail.originalEvent.type==="focusin"&&n.current&&t.preventDefault()}})}),Zt=l.forwardRef((s,a)=>{const{__scopeDialog:r,trapFocus:i,onOpenAutoFocus:n,onCloseAutoFocus:t,...o}=s,u=O(se,r),g=l.useRef(null),f=ve(a,g);return Ps(),e.jsxs(e.Fragment,{children:[e.jsx(Rs,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:n,onUnmountAutoFocus:t,children:e.jsx(Ds,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":et(u.open),...o,ref:f,onDismiss:()=>u.onOpenChange(!1)})}),e.jsxs(e.Fragment,{children:[e.jsx(ka,{titleId:u.titleId}),e.jsx(wa,{contentRef:g,descriptionId:u.descriptionId})]})]})}),Je="DialogTitle",Jt=l.forwardRef((s,a)=>{const{__scopeDialog:r,...i}=s,n=O(Je,r);return e.jsx(J.h2,{id:n.titleId,...i,ref:a})});Jt.displayName=Je;var es="DialogDescription",ts=l.forwardRef((s,a)=>{const{__scopeDialog:r,...i}=s,n=O(es,r);return e.jsx(J.p,{id:n.descriptionId,...i,ref:a})});ts.displayName=es;var ss="DialogClose",as=l.forwardRef((s,a)=>{const{__scopeDialog:r,...i}=s,n=O(ss,r);return e.jsx(J.button,{type:"button",...i,ref:a,onClick:ee(s.onClick,()=>n.onOpenChange(!1))})});as.displayName=ss;function et(s){return s?"open":"closed"}var rs="DialogTitleWarning",[ar,ns]=Ms(rs,{contentName:se,titleName:Je,docsSlug:"dialog"}),ka=({titleId:s})=>{const a=ns(rs),r=`\`${a.contentName}\` requires a \`${a.titleName}\` for the component to be accessible for screen reader users.
27
-
28
- If you want to hide the \`${a.titleName}\`, you can wrap it with our VisuallyHidden component.
29
-
30
- For more information, see https://radix-ui.com/primitives/docs/components/${a.docsSlug}`;return l.useEffect(()=>{s&&(document.getElementById(s)||console.error(r))},[r,s]),null},_a="DialogDescriptionWarning",wa=({contentRef:s,descriptionId:a})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ns(_a).contentName}}.`;return l.useEffect(()=>{var t;const n=(t=s.current)==null?void 0:t.getAttribute("aria-describedby");a&&n&&(document.getElementById(a)||console.warn(i))},[i,s,a]),null},Ca=Ut,Ea=Vt,is=Xt,os=Yt,ls=Jt,cs=ts,Sa=as;const be=Ca,Pa=Ea,ds=l.forwardRef(({className:s,...a},r)=>e.jsx(is,{ref:r,className:Z("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",s),...a}));ds.displayName=is.displayName;const ue=l.forwardRef(({className:s,children:a,...r},i)=>e.jsxs(Pa,{children:[e.jsx(ds,{}),e.jsxs(os,{ref:i,className:Z("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",s),...r,children:[a,e.jsxs(Sa,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[e.jsx(Qe,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));ue.displayName=os.displayName;const he=({className:s,...a})=>e.jsx("div",{className:Z("flex flex-col space-y-1.5 text-center sm:text-left",s),...a});he.displayName="DialogHeader";const me=({className:s,...a})=>e.jsx("div",{className:Z("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",s),...a});me.displayName="DialogFooter";const pe=l.forwardRef(({className:s,...a},r)=>e.jsx(ls,{ref:r,className:Z("text-lg font-semibold leading-none tracking-tight",s),...a}));pe.displayName=ls.displayName;const fe=l.forwardRef(({className:s,...a},r)=>e.jsx(cs,{ref:r,className:Z("text-sm text-muted-foreground",s),...a}));fe.displayName=cs.displayName;function Ra(s,a,r){if(!s)return s;const i=n=>n.paper_id!==a||n.paper_title===r?n:{...n,paper_title:r};if(Array.isArray(s)){const n=s.map(i);return n.some((o,u)=>o!==s[u])?n:s}if(Array.isArray(s.results)){const n=s.results.map(i);return n.some((o,u)=>o!==s.results[u])?{...s,results:n}:s}return s}function Te(s,a,r){new Set([...r,a.id,a.arxiv_id].filter(o=>!!o)).forEach(o=>{s.setQueryData(["paper",o],a),s.setQueryData(["paper-arxiv",o],a)}),s.invalidateQueries({queryKey:["papers"],refetchType:"none"}),s.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),s.invalidateQueries({queryKey:["task-papers-infinite"],refetchType:"none"});const n=String(a.id),t=o=>Ra(o,n,a.title);s.setQueriesData({queryKey:["evaluations"]},t),s.setQueriesData({queryKey:["dataset-evals"]},t),s.invalidateQueries({queryKey:["evaluations"],refetchType:"none"}),s.invalidateQueries({queryKey:["dataset-evals"],refetchType:"none"})}const Da=250,Ma=100;function Ia({open:s,onOpenChange:a,paperId:r,arxivId:i,initialTaskIds:n,initialTasks:t,onSuccess:o}){const[u,g]=l.useState(n),[f,N]=l.useState(""),[p,S]=l.useState(""),[C,D]=l.useState(new Map),P=ae(),{toast:I}=He(),R=l.useRef(!1);l.useEffect(()=>{if(!s){R.current=!1;return}if(R.current)return;R.current=!0,g(n),N(""),S("");const h=new Map;(t||[]).forEach(v=>{const y=parseInt(v.id);Number.isNaN(y)||h.set(y,v)}),D(h)},[s,n,t]),l.useEffect(()=>{const h=window.setTimeout(()=>{S(f.trim())},Da);return()=>window.clearTimeout(h)},[f]);const{data:c,isFetching:k}=q({queryKey:["tasks-search",p],queryFn:()=>Ft({page_size:Ma,...p?{q:p}:{}}),enabled:s});l.useEffect(()=>{var h;(h=c==null?void 0:c.results)!=null&&h.length&&D(v=>{const y=new Map(v);return c.results.forEach(_=>{const j=parseInt(_.id);Number.isNaN(j)||y.set(j,_)}),y})},[c]);const L=l.useMemo(()=>{const h=(c==null?void 0:c.results)||[],v=new Set,y=[];return u.forEach(_=>{if(v.has(_))return;const j=C.get(_);j&&(y.push(j),v.add(_))}),h.forEach(_=>{const j=parseInt(_.id);Number.isNaN(j)||v.has(j)||(y.push(_),v.add(j))}),y},[c,u,C]),x=de({mutationFn:({paperId:h,taskIds:v})=>qs(h,v),onMutate:async({taskIds:h})=>{const v=h.map(j=>C.get(j)).filter(j=>!!j).map(j=>({id:j.id,name:j.name,slug:j.slug})).sort((j,B)=>j.name.localeCompare(B.name)),y=Array.from(new Set([r,i].filter(j=>!!j)));await Promise.all(y.flatMap(j=>[P.cancelQueries({queryKey:["paper",j]}),P.cancelQueries({queryKey:["paper-arxiv",j]})]));const _=[];return y.forEach(j=>{["paper","paper-arxiv"].forEach(B=>{const U=[B,j],T=P.getQueryData(U);_.push({key:U,data:T}),T&&P.setQueryData(U,{...T,tasks:v})})}),I({title:"Tasks updated",description:`Saved ${h.length} task${h.length===1?"":"s"} for this paper.`}),o==null||o(),a(!1),{snapshots:_}},onSuccess:h=>{Te(P,h,[r,i])},onError:(h,v,y)=>{var B,U;(B=y==null?void 0:y.snapshots)==null||B.forEach(({key:T,data:Ae})=>{P.setQueryData(T,Ae)});const _=h;let j=_.message||"Failed to update paper tasks.";if(_.response)try{const T=JSON.parse(_.response);typeof(T==null?void 0:T.detail)=="string"?j=T.detail:Array.isArray(T==null?void 0:T.detail)&&((U=T.detail[0])!=null&&U.msg)&&(j=T.detail[0].msg)}catch{j=_.response}I({title:"Could not save tasks",description:j,variant:"destructive"})}}),E=()=>{x.mutate({paperId:r,taskIds:u})},m=(h,v)=>{g(y=>v?y.includes(h)?y:[...y,h]:y.filter(_=>_!==h))},b=()=>N("");return e.jsx(be,{open:s,onOpenChange:a,children:e.jsxs(ue,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(he,{children:[e.jsx(pe,{children:"Edit Paper Tasks"}),e.jsx(fe,{children:"Select the tasks that this paper addresses. You can select multiple tasks."})]}),e.jsxs("div",{className:"relative mb-4",children:[e.jsx(Se,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(V,{type:"text",placeholder:"Search tasks...",value:f,onChange:h=>N(h.target.value),className:"pl-9 pr-9"}),f&&e.jsx("button",{type:"button",onClick:b,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground","aria-label":"Clear search",children:e.jsx(Qe,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[400px]",children:L.length>0?e.jsx("div",{className:"space-y-2",children:L.map(h=>{const v=parseInt(h.id),y=u.includes(v);return e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted/50 rounded-md",children:[e.jsx(Ye,{id:`task-${h.id}`,checked:y,onCheckedChange:_=>m(v,_===!0),className:"!border !border-black data-[state=checked]:!bg-black data-[state=checked]:!text-white"}),e.jsxs("label",{htmlFor:`task-${h.id}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[h.name,h.description&&e.jsxs("span",{className:"block text-xs text-muted-foreground font-normal mt-1",children:[h.description.substring(0,100),h.description.length>100?"...":""]})]})]},h.id)})}):k?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(te,{className:"w-8 h-8 mx-auto mb-2 animate-spin"}),e.jsx("p",{children:"Loading tasks..."})]}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Se,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:p?`No tasks found matching "${p}"`:"No tasks available"})]})}),e.jsxs(me,{children:[e.jsx(A,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(A,{onClick:E,disabled:x.isPending,children:x.isPending?e.jsxs(e.Fragment,{children:[e.jsx(te,{className:"w-4 h-4 mr-2 animate-spin"}),"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Y,{className:"w-4 h-4 mr-2"}),"Save Changes"]})})]})]})})}const Ta=250,Aa=100;function Fa({open:s,onOpenChange:a,paperId:r,arxivId:i,initialMethodIds:n,initialMethods:t,onSuccess:o}){const[u,g]=l.useState(n),[f,N]=l.useState(""),[p,S]=l.useState(""),[C,D]=l.useState(new Map),P=ae(),{toast:I}=He(),R=l.useRef(!1);l.useEffect(()=>{if(!s){R.current=!1;return}if(R.current)return;R.current=!0,g(n),N(""),S("");const h=new Map;(t||[]).forEach(v=>{const y=parseInt(v.id);Number.isNaN(y)||h.set(y,v)}),D(h)},[s,n,t]),l.useEffect(()=>{const h=window.setTimeout(()=>{S(f.trim())},Ta);return()=>window.clearTimeout(h)},[f]);const{data:c,isFetching:k}=q({queryKey:["methods-search",p],queryFn:()=>zs({page_size:Aa,...p?{q:p}:{}}),enabled:s});l.useEffect(()=>{var h;(h=c==null?void 0:c.results)!=null&&h.length&&D(v=>{const y=new Map(v);return c.results.forEach(_=>{const j=parseInt(_.id);Number.isNaN(j)||y.set(j,_)}),y})},[c]);const L=l.useMemo(()=>{const h=(c==null?void 0:c.results)||[],v=new Set,y=[];return u.forEach(_=>{if(v.has(_))return;const j=C.get(_);j&&(y.push(j),v.add(_))}),h.forEach(_=>{const j=parseInt(_.id);Number.isNaN(j)||v.has(j)||(y.push(_),v.add(j))}),y},[c,u,C]),x=de({mutationFn:({paperId:h,methodIds:v})=>Bs(h,v),onSuccess:h=>{Te(P,h,[r,i]),I({title:"Methods updated",description:`Saved ${u.length} method${u.length===1?"":"s"} for this paper.`}),o==null||o(),a(!1)},onError:h=>{var _;const v=h;let y=v.message||"Failed to update paper methods.";if(v.response)try{const j=JSON.parse(v.response);typeof(j==null?void 0:j.detail)=="string"?y=j.detail:Array.isArray(j==null?void 0:j.detail)&&((_=j.detail[0])!=null&&_.msg)&&(y=j.detail[0].msg)}catch{y=v.response}I({title:"Could not save methods",description:y,variant:"destructive"})}}),E=()=>{x.mutate({paperId:r,methodIds:u})},m=(h,v)=>{g(y=>v?y.includes(h)?y:[...y,h]:y.filter(_=>_!==h))},b=()=>N("");return e.jsx(be,{open:s,onOpenChange:a,children:e.jsxs(ue,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(he,{children:[e.jsx(pe,{children:"Edit Paper Methods"}),e.jsx(fe,{children:"Select the methods and techniques used in this paper. You can select multiple methods."})]}),e.jsxs("div",{className:"relative mb-4",children:[e.jsx(Se,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(V,{type:"text",placeholder:"Search methods...",value:f,onChange:h=>N(h.target.value),className:"pl-9 pr-9"}),f&&e.jsx("button",{type:"button",onClick:b,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground","aria-label":"Clear search",children:e.jsx(Qe,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[400px]",children:L.length>0?e.jsx("div",{className:"space-y-2",children:L.map(h=>{const v=parseInt(h.id),y=u.includes(v);return e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted/50 rounded-md",children:[e.jsx(Ye,{id:`method-${h.id}`,checked:y,onCheckedChange:_=>m(v,_===!0),className:"!border !border-black data-[state=checked]:!bg-black data-[state=checked]:!text-white"}),e.jsxs("label",{htmlFor:`method-${h.id}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[h.name,h.full_name&&h.full_name!==h.name&&e.jsx("span",{className:"block text-xs text-muted-foreground font-normal",children:h.full_name}),h.description&&e.jsxs("span",{className:"block text-xs text-muted-foreground font-normal mt-1",children:[h.description.substring(0,100),h.description.length>100?"...":""]})]})]},h.id)})}):k?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(te,{className:"w-8 h-8 mx-auto mb-2 animate-spin"}),e.jsx("p",{children:"Loading methods..."})]}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Se,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:p?`No methods found matching "${p}"`:"No methods available"})]})}),e.jsxs(me,{children:[e.jsx(A,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(A,{onClick:E,disabled:x.isPending,children:x.isPending?e.jsxs(e.Fragment,{children:[e.jsx(te,{className:"w-4 h-4 mr-2 animate-spin"}),"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Y,{className:"w-4 h-4 mr-2"}),"Save Changes"]})})]})]})})}function $a({open:s,onOpenChange:a,paperId:r,arxivId:i,initialRepositories:n,onSuccess:t}){const[o,u]=l.useState(n),[g,f]=l.useState(""),N=ae(),p=l.useRef(!1);l.useEffect(()=>{if(!s){p.current=!1;return}p.current||(p.current=!0,u(n),f(""))},[s,n]);const S=de({mutationFn:({paperId:c,repositories:k})=>Ks(c,k),onSuccess:c=>{Te(N,c,[r,i]),t==null||t(),a(!1),f("")}}),C=()=>{const c=g.trim();return c?o.some(k=>k.url===c)?(alert("This repository URL is already added"),null):[...o,{url:c,is_official:!1}]:o},D=()=>{const c=C();c!==null&&c.length!==o.length&&(u(c),f(""))},P=c=>{u(o.filter(k=>k.url!==c))},I=c=>{u(o.map(k=>k.url===c?{...k,is_official:!k.is_official}:k))},R=()=>{const c=C();c!==null&&S.mutate({paperId:r,repositories:c})};return e.jsx(be,{open:s,onOpenChange:a,children:e.jsxs(ue,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(he,{children:[e.jsx(pe,{children:"Edit Paper Repositories"}),e.jsx(fe,{children:"Add or remove GitHub repository URLs associated with this paper. Mark repositories as official if they are created by the paper authors."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Add Repository URL"}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(V,{type:"url",placeholder:"https://github.com/owner/repo",value:g,onChange:c=>f(c.target.value),onKeyPress:c=>{c.key==="Enter"&&(c.preventDefault(),D())},className:"flex-1"}),e.jsxs(A,{onClick:D,size:"sm",disabled:!g.trim(),children:[e.jsx(We,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:o.length>0?e.jsx("div",{className:"space-y-2",children:o.map((c,k)=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsx(Ct,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-sm font-medium text-paper-blue truncate",children:c.url}),c.is_official&&e.jsx($t,{variant:"secondary",className:"text-xs",children:"Official"})]})}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsx(A,{variant:"ghost",size:"sm",onClick:()=>I(c.url),className:"h-8 px-2",title:c.is_official?"Mark as unofficial":"Mark as official",children:e.jsx(Y,{className:`w-4 h-4 ${c.is_official?"text-green-600":"text-muted-foreground"}`})}),e.jsx(A,{variant:"ghost",size:"sm",onClick:()=>P(c.url),className:"h-8 px-2 text-destructive hover:text-destructive",title:"Remove repository",children:e.jsx(Ge,{className:"w-4 h-4"})})]})]},k))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Ct,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"No repositories added yet"}),e.jsx("p",{className:"text-xs mt-1",children:"Add a repository URL above to get started"})]})}),e.jsxs(me,{children:[e.jsx(A,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(A,{onClick:R,disabled:S.isPending,children:S.isPending?e.jsxs(e.Fragment,{children:[e.jsx(te,{className:"w-4 h-4 mr-2 animate-spin"}),"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Y,{className:"w-4 h-4 mr-2"}),"Save Changes"]})})]})]})})}function La({open:s,onOpenChange:a,paperId:r,arxivId:i,initialProjectPages:n,onSuccess:t}){const[o,u]=l.useState(n),[g,f]=l.useState(""),N=ae(),p=l.useRef(!1);l.useEffect(()=>{if(!s){p.current=!1;return}p.current||(p.current=!0,u(n),f(""))},[s,n]);const S=de({mutationFn:({paperId:c,projectPages:k})=>Qs(c,k),onSuccess:c=>{Te(N,c,[r,i]),t==null||t(),a(!1),f("")}}),C=()=>{const c=g.trim();return c?o.some(k=>k.url===c)?(alert("This project page URL is already added"),null):[...o,{url:c,is_official:!1}]:o},D=()=>{const c=C();c!==null&&c.length!==o.length&&(u(c),f(""))},P=c=>{u(o.filter(k=>k.url!==c))},I=c=>{u(o.map(k=>k.url===c?{...k,is_official:!k.is_official}:k))},R=()=>{const c=C();c!==null&&S.mutate({paperId:r,projectPages:c})};return e.jsx(be,{open:s,onOpenChange:a,children:e.jsxs(ue,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(he,{children:[e.jsx(pe,{children:"Edit Paper Project Pages"}),e.jsx(fe,{children:"Add or remove project page URLs (e.g. authors' demo or landing pages) associated with this paper. Mark pages as official if they are created by the paper authors."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Add Project Page URL"}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(V,{type:"url",placeholder:"https://example.com/project",value:g,onChange:c=>f(c.target.value),onKeyPress:c=>{c.key==="Enter"&&(c.preventDefault(),D())},className:"flex-1"}),e.jsxs(A,{onClick:D,size:"sm",disabled:!g.trim(),children:[e.jsx(We,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:o.length>0?e.jsx("div",{className:"space-y-2",children:o.map((c,k)=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsx(Et,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-sm font-medium text-paper-blue truncate",children:c.url}),c.is_official&&e.jsx($t,{variant:"secondary",className:"text-xs",children:"Official"})]})}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsx(A,{variant:"ghost",size:"sm",onClick:()=>I(c.url),className:"h-8 px-2",title:c.is_official?"Mark as unofficial":"Mark as official",children:e.jsx(Y,{className:`w-4 h-4 ${c.is_official?"text-green-600":"text-muted-foreground"}`})}),e.jsx(A,{variant:"ghost",size:"sm",onClick:()=>P(c.url),className:"h-8 px-2 text-destructive hover:text-destructive",title:"Remove project page",children:e.jsx(Ge,{className:"w-4 h-4"})})]})]},k))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Et,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"No project pages added yet"}),e.jsx("p",{className:"text-xs mt-1",children:"Add a project page URL above to get started"})]})}),e.jsxs(me,{children:[e.jsx(A,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(A,{onClick:R,disabled:S.isPending,children:S.isPending?e.jsxs(e.Fragment,{children:[e.jsx(te,{className:"w-4 h-4 mr-2 animate-spin"}),"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Y,{className:"w-4 h-4 mr-2"}),"Save Changes"]})})]})]})})}function Oa({open:s,onOpenChange:a,paperId:r,arxivId:i,initialEvaluations:n,onSuccess:t}){const[o,u]=l.useState([]),g=ae(),f=x=>{if(x)if(n&&n.length>0){const E=n.map(m=>{const b=m.best_metric||Object.keys(m.metrics)[0],h=m.metrics[b];return{id:m.id,task_id:m.task_id,dataset_id:m.dataset_id,model_name:m.model_name||"",harness:m.harness||"",metric_name:b||"",metric_value:String(h||""),best_rank:m.best_rank?String(m.best_rank):"",operation:"unchanged"}});u(E)}else u([]);a(x)},{data:N}=q({queryKey:["tasks-for-eval-edit"],queryFn:()=>Ft({page_size:100}),enabled:s}),{data:p}=q({queryKey:["datasets-for-eval-edit"],queryFn:()=>wt({page_size:100}),enabled:s}),S=l.useMemo(()=>Array.from(new Set(o.map(x=>x.task_id).filter(x=>x&&x!==""))),[o]),C=q({queryKey:["datasets-by-tasks",S,s],queryFn:async()=>{if(!s)return{};const x={};return await Promise.all(S.map(async E=>{if(E)try{const m=await wt({task_id:parseInt(E),page_size:100});x[E]=m.results}catch(m){console.error(`Error fetching datasets for task ${E}:`,m),x[E]=[]}})),x},enabled:s&&S.length>0}),D=x=>x?C.data&&C.data[x]?C.data[x]:(p==null?void 0:p.results)||[]:(p==null?void 0:p.results)||[],P=(x,E)=>{if(!x||!E)return!1;const m=D(x).find(b=>b.id===E);return!!(m!=null&&m.supports_harness)},I=de({mutationFn:async({paperId:x,evaluations:E})=>{for(const m of E)if(m.operation==="delete"&&m.id)try{await Hs(m.id)}catch(b){if((typeof b=="object"&&b!==null&&"status"in b?b.status:void 0)!==404)throw b;console.log(`Evaluation ${m.id} already deleted or not found`)}else if(m.operation==="create"){const b=P(m.task_id,m.dataset_id);await Us({paper_id:parseInt(x),task_id:parseInt(m.task_id),dataset_id:parseInt(m.dataset_id),model_name:m.model_name||void 0,harness:b&&m.harness||void 0,metrics:{[m.metric_name]:m.metric_value},best_metric:m.metric_name,best_rank:m.best_rank?parseInt(m.best_rank):void 0})}else if(m.operation==="update"&&m.id){const b=P(m.task_id,m.dataset_id);await Ws(m.id,{task_id:parseInt(m.task_id),dataset_id:parseInt(m.dataset_id),model_name:m.model_name||void 0,harness:b&&m.harness||null,metrics:{[m.metric_name]:m.metric_value},best_metric:m.metric_name,best_rank:m.best_rank?parseInt(m.best_rank):void 0})}},onSuccess:()=>{g.invalidateQueries({queryKey:["paper-arxiv",i]}),g.invalidateQueries({queryKey:["evaluations","paper",r]}),t==null||t(),a(!1)}}),R=()=>{u([...o,{task_id:"",dataset_id:"",model_name:"",harness:"",metric_name:"",metric_value:"",best_rank:"",operation:"create"}])},c=x=>{o[x].id?u(o.map((m,b)=>b===x?{...m,operation:"delete"}:m)):u(o.filter((m,b)=>b!==x))},k=(x,E,m)=>{u(o.map((b,h)=>{if(h!==x)return b;const v={...b,[E]:m};return E==="task_id"&&(v.dataset_id="",v.harness=""),E==="dataset_id"&&m&&!P(v.task_id,m)&&(v.harness=""),b.operation==="unchanged"&&(v.operation="update"),v}))},L=()=>{const x=o.filter(E=>E.operation!=="delete"||E.id);I.mutate({paperId:r,evaluations:x})};return e.jsx(be,{open:s,onOpenChange:f,children:e.jsxs(ue,{className:"max-w-6xl max-h-[800px]",children:[e.jsxs(he,{children:[e.jsx(pe,{children:"Edit Evaluation Results"}),e.jsx(fe,{children:"Add, edit, or remove evaluation results for this paper. Each row represents a benchmark result."})]}),e.jsxs("div",{className:"py-4 overflow-y-auto max-h-[600px]",children:[o.filter(x=>x.operation!=="delete").length>0?e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Task"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Dataset"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Model"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Harness"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Metric"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Value"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm w-16",children:"Action"})]})}),e.jsx("tbody",{children:o.map((x,E)=>{var m;return x.operation==="delete"?null:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("td",{className:"py-2 px-2",children:e.jsxs("select",{className:"w-full px-2 py-1 text-sm border border-border rounded-md bg-background",value:x.task_id,onChange:b=>k(E,"task_id",b.target.value),children:[e.jsx("option",{value:"",children:"Select Task"}),(m=N==null?void 0:N.results)==null?void 0:m.map(b=>e.jsx("option",{value:b.id,children:b.name},b.id))]})}),e.jsx("td",{className:"py-2 px-2",children:e.jsxs("select",{className:"w-full px-2 py-1 text-sm border border-border rounded-md bg-background",value:x.dataset_id,onChange:b=>k(E,"dataset_id",b.target.value),children:[e.jsx("option",{value:"",children:"Select Dataset"}),D(x.task_id).map(b=>e.jsx("option",{value:b.id,children:b.name},b.id))]})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(V,{type:"text",className:"w-full text-sm",placeholder:"Model name",value:x.model_name,onChange:b=>k(E,"model_name",b.target.value)})}),e.jsx("td",{className:"py-2 px-2",children:P(x.task_id,x.dataset_id)?e.jsx(V,{type:"text",className:"w-full text-sm",placeholder:"Claude Code, Terminus, ...",value:x.harness,onChange:b=>k(E,"harness",b.target.value)}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"Not supported"})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(V,{type:"text",className:"w-full text-sm",placeholder:"AP, mAP, etc.",value:x.metric_name,onChange:b=>k(E,"metric_name",b.target.value)})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(V,{type:"text",className:"w-full text-sm",placeholder:"44.9",value:x.metric_value,onChange:b=>k(E,"metric_value",b.target.value)})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(A,{variant:"ghost",size:"sm",onClick:()=>c(E),className:"h-8 w-8 p-0 text-destructive hover:text-destructive",title:"Delete row",children:e.jsx(Ge,{className:"w-4 h-4"})})})]},E)})})]})}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Js,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),e.jsx("p",{children:"No evaluation results yet"}),e.jsx("p",{className:"text-sm mt-2",children:'Click "Add Row" below to add a new evaluation'})]}),e.jsx("div",{className:"mt-4",children:e.jsxs(A,{variant:"outline",size:"sm",onClick:R,className:"flex items-center space-x-2",children:[e.jsx(We,{className:"w-4 h-4"}),e.jsx("span",{children:"Add Row"})]})})]}),e.jsxs(me,{children:[e.jsx(A,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(A,{onClick:L,disabled:I.isPending,children:I.isPending?e.jsxs(e.Fragment,{children:[e.jsx(te,{className:"w-4 h-4 mr-2 animate-spin"}),"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Y,{className:"w-4 h-4 mr-2"}),"Save Changes"]})})]})]})})}const ce=["my-bookmark-ids"];function qa(){var i,n;const{user:s}=De(),a=q({queryKey:ce,queryFn:()=>Ee.getMyBookmarkIds(),enabled:!!s,staleTime:60*1e3,refetchOnWindowFocus:!1}),r=Ue.useMemo(()=>{var t;return new Set(((t=a.data)==null?void 0:t.paper_ids)??[])},[(i=a.data)==null?void 0:i.paper_ids]);return{ids:((n=a.data)==null?void 0:n.paper_ids)??[],idSet:r,isLoading:a.isLoading,isError:a.isError}}function Ba(){const{user:s}=De(),a=ae(),r=de({mutationFn:async({paperId:n,isBookmarked:t})=>{t?await Ee.removeBookmark(n):await Ee.addBookmark(n)},onMutate:async({paperId:n,isBookmarked:t})=>{await a.cancelQueries({queryKey:ce});const o=a.getQueryData(ce),u=typeof n=="string"?Number(n):n,g=(o==null?void 0:o.paper_ids)??[],f=t?g.filter(N=>N!==u):[u,...g.filter(N=>N!==u)];return a.setQueryData(ce,{paper_ids:f}),{previous:o}},onError:(n,t,o)=>{o!=null&&o.previous&&a.setQueryData(ce,o.previous)},onSettled:()=>{a.invalidateQueries({queryKey:ce}),a.invalidateQueries({queryKey:["my-bookmarks"]})}});return{toggle:Ue.useCallback((n,t)=>{if(!s){if(Tt())return;const o=typeof window<"u"?window.location.pathname+window.location.search:"/";window.location.href=At(`/api/v1/auth/hf/login?return_to=${encodeURIComponent(o)}`);return}r.mutate({paperId:n,isBookmarked:t})},[r,s]),isPending:r.isPending}}const za=({paperId:s})=>{const{user:a}=De(),{idSet:r}=qa(),{toggle:i,isPending:n}=Ba();if(Tt())return null;const t=Number(s),o=!!a&&r.has(t),u=()=>{Number.isFinite(t)&&i(t,o)},g=a&&o?"Saved":"Save",f=a?o?"Remove from saved papers":"Save this paper":"Sign in with Hugging Face to save this paper";return e.jsxs("button",{type:"button",className:`action-btn${o?" is-saved":""}`,onClick:u,disabled:n,"aria-pressed":o,"aria-label":f,title:f,children:[e.jsx(z,{name:"bookmark",size:12}),g]})},we=360,Be=3;function St(s){if(!s)return"—";try{return new Date(s).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"—"}}function Pt(s){return s>=1e3?`${(s/1e3).toFixed(1)}k`:String(s)}function Ka(s,a,r){if(a===1)return"Project page";try{const i=new URL(s),n=i.pathname.replace(/\/$/,"").split("/").filter(Boolean).pop();return n?`Project: ${n.replace(/[-_]+/g," ")}`:`Project: ${i.hostname.replace(/^www\./,"")}`}catch{return`Project page ${r+1}`}}const rr=()=>{var dt,ut,ht,mt,pt,ft,xt,gt,jt,vt,bt,yt;const{arxivId:s}=Is(),a=Ts(),{toast:r}=He(),{user:i}=De(),n=(i==null?void 0:i.is_admin)??!1,{data:t,isLoading:o,error:u,refetch:g}=Xs(s||"",!!s),[f,N]=l.useState(!1);l.useEffect(()=>{if(N(!1),!(t!=null&&t.id))return;const d=window.setTimeout(()=>N(!0),0);return()=>window.clearTimeout(d)},[t==null?void 0:t.id]);const{data:p,isLoading:S}=aa(f?t==null?void 0:t.arxiv_id:void 0),{data:C,isLoading:D}=ta(t==null?void 0:t.id,f&&!!(t!=null&&t.id)),P=l.useMemo(()=>({models:(t==null?void 0:t.hf_models)??[],datasets:(t==null?void 0:t.hf_datasets)??[],spaces:(t==null?void 0:t.hf_spaces)??[]}),[t==null?void 0:t.hf_models,t==null?void 0:t.hf_datasets,t==null?void 0:t.hf_spaces]),I=l.useMemo(()=>{if(!C)return[];const d=new Map;for(const w of C){const F=w.task_id,xe=d.get(F);xe?xe.rows.push(w):d.set(F,{taskId:F,taskName:w.task_name||"—",taskSlug:w.task_slug,rows:[w]})}return Array.from(d.values())},[C]),R=q({queryKey:["paper-versions",t==null?void 0:t.arxiv_id],queryFn:async()=>{const d=t.arxiv_id.replace(/v\d+$/,""),w=await fetch(At(`/api/v1/papers/arxiv/${d}/versions`));return w.ok?await w.json():[]},enabled:f&&!!(t!=null&&t.arxiv_id),staleTime:10*60*1e3}),c=q({queryKey:["related-papers",(ut=(dt=t==null?void 0:t.tasks)==null?void 0:dt[0])==null?void 0:ut.id],queryFn:()=>Ee.getTaskPapers(t.tasks[0].id,{page:1,page_size:5,order_by:"citation_count",order_dir:"desc",include_resources:!1}),enabled:f&&!!((mt=(ht=t==null?void 0:t.tasks)==null?void 0:ht[0])!=null&&mt.id),staleTime:10*60*1e3,select:d=>d.results.filter(w=>w.id!==(t==null?void 0:t.id)).slice(0,4)}),[k,L]=l.useState(!1),[x,E]=l.useState(!1),[m,b]=l.useState(!1),{isEditingTasks:h,setIsEditingTasks:v,isEditingMethods:y,setIsEditingMethods:_,isEditingRepositories:j,setIsEditingRepositories:B,isEditingProjectPages:U,setIsEditingProjectPages:T,isEditingEvaluations:Ae,setIsEditingEvaluations:tt}=ra(),[st,Fe]=l.useState("idle"),[at,rt]=l.useState(null),us=async()=>{if(s){Fe("indexing"),rt(null);try{await Gs(s),r({title:"Indexed",description:"Paper added to database."}),setTimeout(()=>g(),1200),Fe("idle")}catch(d){const w=d;let F=w.message||"Failed to index paper";if(w.response)try{F=JSON.parse(w.response).detail||F}catch{F=w.response}rt(F),Fe("error")}}};if(o)return e.jsxs("div",{className:"page",children:[e.jsx(ge,{className:"h-12 w-3/4 mb-4"}),e.jsx(ge,{className:"h-6 w-1/3 mb-8"}),e.jsx(ge,{className:"h-64 w-full"})]});if(u||!t)return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(le,{to:"/papers",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsxs("span",{style:{color:"var(--ink)"},children:["arXiv:",s]})]}),e.jsx("h1",{className:"detail-title",children:"Paper not indexed yet"}),e.jsxs("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:16,maxWidth:640},children:["We don't have ",e.jsxs("span",{style:{fontFamily:"var(--mono)"},children:["arXiv:",s]})," in the database. You can index it from arXiv right now."]}),at&&e.jsx(Ys,{variant:"destructive",className:"mt-4 max-w-xl",children:e.jsx(Zs,{children:at})}),e.jsxs("div",{className:"action-row",children:[n&&e.jsxs("button",{className:"action-btn",onClick:us,disabled:st==="indexing",children:[e.jsx(z,{name:"sparkle",size:12}),st==="indexing"?"Indexing…":"Index from arXiv"]}),e.jsx(A,{variant:"outline",onClick:()=>a("/papers"),children:"Browse Papers"})]})]});const nt=R.data||[],ye=Vs(t.repositories),W=[...t.repositories??[]].sort((d,w)=>{const F=d.is_official?1:0,xe=w.is_official?1:0;return F!==xe?xe-F:(w.num_stars||0)-(d.num_stars||0)}),hs=m?W:W.slice(0,Be),ms=t.arxiv_id?{isLoading:S,paperHref:`https://huggingface.co/papers/${t.arxiv_id.replace(/v\d+$/,"")}`,rows:[{label:"Models",href:`https://huggingface.co/models?other=arxiv:${t.arxiv_id}`,count:p==null?void 0:p.models,isLimited:p==null?void 0:p.isLimited},{label:"Datasets",href:`https://huggingface.co/datasets?other=arxiv:${t.arxiv_id}`,count:p==null?void 0:p.datasets,isLimited:p==null?void 0:p.isLimited},{label:"Spaces",href:`https://huggingface.co/spaces?other=arxiv:${t.arxiv_id}`,count:p==null?void 0:p.spaces,isLimited:p==null?void 0:p.isLimited}],footer:`Cite arxiv.org/abs/${t.arxiv_id} in a HF README to link it here.`}:{isLoading:!1,paperHref:null,rows:[{label:"Models",href:ze(P.models),count:P.models.length},{label:"Datasets",href:ze(P.datasets),count:P.datasets.length},{label:"Spaces",href:ze(P.spaces),count:P.spaces.length}],footer:null},it=t.tldr||null,ot=t.num_pages||null,re=t.abstract||"",ps=re.length>we?re.slice(0,we)+"…":re,fs=k||re.length<=we?re:ps,Ne=(t.methods||[]).filter(d=>d.source_paper_id===t.id),ke=t.introduced_benchmarks||[],xs=Ne.length>0||ke.length>0,lt=t.arxiv_id?`arXiv:${t.arxiv_id}`:"External resource",gs=t.source==="external"?"Source page":"arXiv page",$e=((pt=t.project_pages)==null?void 0:pt.filter(d=>d.url))??[],js=(()=>{const d=[];return Ne.length>0&&d.push(Ne.length===1?"this method":"these methods"),ke.length>0&&d.push(ke.length===1?"this benchmark":"these benchmarks"),d.length===0?"":d.length===1?d[0]:d.join(" and ")})(),_e=12,ct=x||t.authors.length<=_e?t.authors:t.authors.slice(0,_e);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(le,{to:"/",children:"Trending"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{children:lt})]}),e.jsxs("div",{className:"detail-grid",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"detail-title",children:e.jsx(_t,{title:t.title})}),e.jsxs("div",{className:"detail-meta",children:[e.jsx("span",{children:lt}),e.jsx("span",{children:"·"}),e.jsxs("span",{children:["Submitted ",St(t.published)]}),ot&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[ot," pages"]})]}),t.citation_count!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[t.citation_count.toLocaleString()," citations"]})]}),t.proceeding&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:t.proceeding.replace(/\s+\d{1,2}$/,"")})]}),nt.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("select",{className:"version-select",value:t.version,onChange:d=>{const w=d.target.value;t.arxiv_id&&a(`/paper/${t.arxiv_id.replace(/v\d+$/,"")}${w?`?version=${w}`:""}`)},children:nt.map(d=>e.jsxs("option",{value:d.version,children:[d.version," — ",St(d.published)]},d.version))})]})]}),e.jsxs("div",{className:"detail-authors",children:[ct.map((d,w)=>e.jsxs(Ue.Fragment,{children:[e.jsx("a",{children:d}),w<ct.length-1?", ":""]},w)),t.authors.length>_e&&e.jsx("button",{className:"show-more-authors",onClick:()=>E(d=>!d),style:{marginLeft:8,background:"none",border:"none",cursor:"pointer",color:"var(--accent-text)",fontFamily:"var(--mono)",fontSize:12},children:x?"show fewer":`+${t.authors.length-_e} more`})]}),e.jsxs("div",{className:"action-row",children:[t.url_pdf&&e.jsxs("a",{className:"action-btn",href:t.url_pdf,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(z,{name:"pdf",size:12})," View PDF"]}),t.url_abs&&e.jsxs("a",{className:"action-btn",href:t.url_abs,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(z,{name:"external",size:12})," ",gs]}),ye.githubUrl&&e.jsxs("a",{className:"action-btn",href:ye.githubUrl,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(z,{name:"github",size:12})," Code",ye.github!=null&&e.jsxs("span",{style:{opacity:.7,marginLeft:4},children:["· ",Pt(ye.github)," ★"]})]}),$e.map((d,w)=>e.jsxs("span",{className:"project-page-action",children:[e.jsxs("a",{className:"action-btn project-page-link",href:d.url,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(z,{name:"globe",size:12})," ",Ka(d.url,$e.length,w)]}),n&&e.jsx("button",{type:"button",className:"action-btn project-page-edit",onClick:()=>T(!0),title:"Edit project pages","aria-label":"Edit project pages",children:"edit"})]},d.url)),n&&$e.length===0?e.jsxs("button",{type:"button",className:"action-btn",onClick:()=>T(!0),title:"Add project page",children:[e.jsx(z,{name:"globe",size:12})," Add project page"]}):null,t.conference_url_abs&&e.jsxs("a",{className:"action-btn",href:t.conference_url_abs,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(z,{name:"external",size:12})," Conference"]}),e.jsx(za,{paperId:t.id})]}),xs&&e.jsxs("div",{className:"introduced-banner",children:[e.jsx("span",{className:"introduced-label",children:"Introduced"}),e.jsxs("div",{className:"introduced-methods",children:[Ne.map(d=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>a(`/methods/${d.slug||d.id}`),children:[d.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`method-${d.id}`)),ke.map(d=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>a(`/benchmark/${d.slug||d.id}`),children:[d.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`benchmark-${d.id}`))]}),e.jsxs("span",{className:"introduced-note",children:["This paper is the canonical source for ",js,"."]})]}),it&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"section-rule",children:e.jsx("span",{children:"TL;DR · AI-generated"})}),e.jsx("div",{className:"tldr-box",children:it})]}),e.jsx("div",{className:"section-rule",children:e.jsx("span",{children:"Abstract"})}),e.jsx("p",{className:"abstract-text",style:{marginBottom:8},children:e.jsx(Ls,{text:fs})}),re.length>we&&e.jsx("div",{className:"read-full",onClick:()=>L(d=>!d),children:k?"− collapse abstract":"+ read full abstract"}),e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:"Tasks"}),e.jsxs("span",{className:"accent",children:[((ft=t.tasks)==null?void 0:ft.length)||0," tagged",n&&e.jsx("button",{onClick:()=>v(!0),className:"edit-link",style:{marginLeft:8,background:"none",border:"none",cursor:"pointer",color:"var(--accent-text)",textDecoration:"underline",fontFamily:"var(--mono)",fontSize:11},children:"edit"})]})]}),e.jsx("div",{className:"paper-tags",style:{marginBottom:8},children:(t.tasks||[]).map(d=>e.jsx(Fs,{slug:d.slug||"",label:d.name},d.id))}),e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:"Methods"}),e.jsxs("span",{className:"accent",children:[((xt=t.methods)==null?void 0:xt.length)||0," used",n&&e.jsx("button",{onClick:()=>_(!0),className:"edit-link",style:{marginLeft:8,background:"none",border:"none",cursor:"pointer",color:"var(--accent-text)",textDecoration:"underline",fontFamily:"var(--mono)",fontSize:11},children:"edit"})]})]}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:8},children:(t.methods||[]).map(d=>e.jsx($s,{method:d},d.id))}),e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:"Results"}),e.jsxs("span",{className:"accent",children:[(C==null?void 0:C.length)||0," benchmarks",n&&e.jsx("button",{onClick:()=>tt(!0),className:"edit-link",style:{marginLeft:8,background:"none",border:"none",cursor:"pointer",color:"var(--accent-text)",textDecoration:"underline",fontFamily:"var(--mono)",fontSize:11},children:"edit"})]})]}),D?e.jsx(ge,{className:"h-32 w-full"}):I.length>0?I.map(d=>e.jsxs("div",{children:[e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:d.taskSlug?e.jsx(le,{to:`/tasks/${d.taskSlug}`,children:d.taskName}):d.taskName}),e.jsxs("span",{className:"accent",children:[d.rows.length," ",d.rows.length===1?"result":"results"]})]}),e.jsxs("table",{className:"results-table",children:[e.jsxs("colgroup",{children:[e.jsx("col",{style:{width:"30%"}}),e.jsx("col",{style:{width:"30%"}}),e.jsx("col",{style:{width:"15%"}}),e.jsx("col",{style:{width:"15%"}}),e.jsx("col",{style:{width:"10%"}})]}),e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Benchmark"}),e.jsx("th",{children:"Model"}),e.jsx("th",{children:"Metric"}),e.jsx("th",{children:"Value"}),e.jsx("th",{})]})}),e.jsx("tbody",{children:d.rows.map(w=>{var F;return e.jsxs("tr",{children:[e.jsx("td",{className:"benchmark",children:w.dataset_slug?e.jsx(le,{to:`/benchmark/${w.dataset_slug}`,children:w.dataset_name||"—"}):w.dataset_name||"—"}),e.jsx("td",{className:"model",title:w.model_name||void 0,children:w.model_name||"—"}),e.jsx("td",{className:"metric",children:w.best_metric}),e.jsx("td",{className:"value",children:As((F=w.metrics)==null?void 0:F[w.best_metric||""])}),e.jsx("td",{className:"compare",children:w.dataset_slug&&e.jsx(le,{to:`/benchmark/${w.dataset_slug}?eval=${encodeURIComponent(w.id)}`,children:"Compare →"})})]},w.id)})})]})]},d.taskId)):e.jsx("p",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-faint)"},children:"No benchmark results recorded yet."})]}),e.jsxs("aside",{className:"detail-sidebar",children:[(W.length>0||n)&&e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[e.jsx("span",{children:"GitHub"}),e.jsxs("span",{className:"badge",children:[W.length," repo",W.length===1?"":"s",n&&e.jsx("button",{onClick:()=>B(!0),className:"edit-link",style:{marginLeft:8,background:"none",border:"none",cursor:"pointer",color:"var(--accent-text)",textDecoration:"underline",fontFamily:"var(--mono)",fontSize:11},children:"edit"})]})]}),hs.map(d=>e.jsxs("a",{href:d.url,target:"_blank",rel:"noopener noreferrer",className:"code-line",style:{textDecoration:"none"},children:[e.jsxs("span",{className:"code-line-repo",children:[e.jsx(z,{name:"github",size:12}),e.jsxs("span",{className:"code-line-repo-name",children:[d.owner,"/",d.name]}),d.is_official&&e.jsx("span",{className:"code-line-official",children:"· Official"})]}),e.jsxs("span",{className:"code-line-stars",children:["★ ",Pt(d.num_stars)]})]},d.id)),W.length===0&&n&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",padding:"6px 0"},children:"No GitHub repositories linked yet."}),W.length>Be&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>b(d=>!d),children:m?"− show top 3":`+ show ${W.length-Be} more repos`})]}),e.jsx(Qa,{viewer:ms}),e.jsxs("div",{className:"sidebar-card",children:[e.jsx("div",{className:"sidebar-card-title",children:"Citation"}),e.jsx("pre",{style:{fontFamily:"var(--mono)",fontSize:10.5,lineHeight:1.5,color:"var(--ink-soft)",whiteSpace:"pre-wrap",wordBreak:"break-word",margin:0},children:t.arxiv_id?`@article{${t.arxiv_id.replace(".","")},
31
- title={{${t.title.slice(0,60)}${t.title.length>60?"…":""}}},
32
- author={{${t.authors[0]||""}${t.authors.length>1?" et al.":""}}},
33
- year={{${(t.published||"").slice(0,4)||"—"}}},
34
- eprint={{${t.arxiv_id}}},
35
- archivePrefix={{arXiv}}
36
- }`:`@misc{paper${t.id},
37
- title={{${t.title.slice(0,60)}${t.title.length>60?"…":""}}},
38
- author={{${t.authors[0]||""}${t.authors.length>1?" et al.":""}}},
39
- year={{${(t.published||"").slice(0,4)||"—"}}},
40
- url={{${t.source_url||t.url_abs||""}}}
41
- }`})]}),(((gt=c.data)==null?void 0:gt.length)??0)>0&&e.jsxs("div",{className:"sidebar-card",children:[e.jsx("div",{className:"sidebar-card-title",children:"Related papers"}),c.data.map(d=>e.jsxs(le,{to:`/paper/${d.arxiv_id||d.id}`,target:"_blank",rel:"noopener noreferrer",className:"related-paper",style:{textDecoration:"none",color:"inherit"},children:[e.jsx("div",{className:"related-title",children:e.jsx(_t,{title:d.title})}),e.jsxs("div",{className:"related-meta",children:[e.jsx("span",{children:d.arxiv_id?`arXiv:${d.arxiv_id}`:"External resource"}),d.citation_count!=null&&e.jsxs("span",{children:[d.citation_count.toLocaleString()," cites"]})]})]},d.id))]})]})]}),e.jsx(Ia,{open:h,onOpenChange:v,paperId:t.id,arxivId:s,initialTaskIds:((jt=t.tasks)==null?void 0:jt.map(d=>parseInt(d.id)))||[],initialTasks:t.tasks||[]}),e.jsx(Fa,{open:y,onOpenChange:_,paperId:t.id,arxivId:s,initialMethodIds:((vt=t.methods)==null?void 0:vt.map(d=>parseInt(d.id)))||[],initialMethods:t.methods||[]}),e.jsx($a,{open:j,onOpenChange:B,paperId:t.id,arxivId:s,initialRepositories:((bt=t.repositories)==null?void 0:bt.map(d=>({url:d.url,is_official:d.is_official||!1})))||[]}),e.jsx(La,{open:U,onOpenChange:T,paperId:t.id,arxivId:s,initialProjectPages:((yt=t.project_pages)==null?void 0:yt.map(d=>({url:d.url,is_official:d.is_official||!1})))||[]}),e.jsx(Oa,{open:Ae,onOpenChange:tt,paperId:t.id,arxivId:s,initialEvaluations:C||[]})]})},Qa=({viewer:s})=>e.jsxs("div",{className:"sidebar-card",children:[e.jsx("div",{className:"sidebar-card-title",children:s.paperHref?e.jsx("a",{href:s.paperHref,target:"_blank",rel:"noopener noreferrer",style:{color:"inherit",textDecoration:"none"},children:"🤗 Hugging Face"}):e.jsx("span",{children:"🤗 Hugging Face"})}),s.isLoading?e.jsx(ge,{className:"h-16 w-full"}):e.jsxs(e.Fragment,{children:[s.rows.map(a=>e.jsx(Ha,{...a},a.label)),s.footer&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:10,color:"var(--ink-faint)",marginTop:12},children:s.footer})]})]}),Ha=({label:s,href:a,count:r,isLimited:i})=>e.jsxs("a",{href:a,target:"_blank",rel:"noopener noreferrer",style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"6px 0",borderBottom:"1px dashed var(--hairline)",fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-soft)",textDecoration:"none"},children:[e.jsx("span",{children:s}),e.jsx("span",{style:{fontWeight:600,color:r?"var(--ink)":"var(--ink-faint)"},children:r!=null?`${r}${i?"+":""}`:"—"})]});function ze(s){return s[0]??"https://huggingface.co"}export{rr as default};
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/PapersListView-EJ-j4htE.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{u as I,r as i,j as e,L as F}from"./index-BWQiUBNk.js";import{I as L,P as T}from"./components-BT6ZBgQl.js";import{a as C}from"./api-BFeNcidM.js";import{a as R,d as k}from"./transform-DgWj1AQy.js";import{u as D}from"./usePapers-CnRnmSk-.js";import{u as E}from"./useDebounce-DUtosrff.js";import{u as O,P as B}from"./usePeriodFilter-NqcUWmWg.js";import{u as $}from"./useIntersectionObserver-U7v6rTcQ.js";import{S as c}from"./skeleton-BuXiEBoy.js";import{A as z,a as M}from"./alert-DUe5ZsgM.js";import{u as q}from"./useQuery-B941khzD.js";import"./LatexTitle-Ckdd_TrR.js";import"./adminAuth-PI_XkM8E.js";import"./useInfiniteQuery-CpEFc3Gg.js";const K=[["trending","trending"],["new","newest"],["cited","most cited"]],ie=()=>{var x,g,j,f,N;const[d,v]=I(),o=d.get("search")||"",[p,b]=i.useState(o),t=E(p,300);i.useEffect(()=>{if(t===o)return;const s=new URLSearchParams(d);t?s.set("search",t):s.delete("search"),v(s,{replace:!0})},[t]);const[n,P]=i.useState("new"),{period:y,setPeriod:S,publishedAfter:w}=O("All Time"),a=D({page_size:20,order_by:n==="trending"?"trending":n==="cited"?"citation_count":"date_published",order_dir:"desc",search:t||void 0,published_after:w,include_resources:!0}),m=q({queryKey:["top-tasks-sidebar"],queryFn:()=>C.getTasks({ordering:"-paper_count",page_size:8}),staleTime:10*60*1e3}),l=i.useMemo(()=>{var r;return(((r=a.data)==null?void 0:r.pages.flatMap(A=>A.results))||[]).map(R)},[a.data]),{targetRef:_,isIntersecting:h}=$({rootMargin:"200px"});i.useEffect(()=>{h&&a.hasNextPage&&!a.isFetchingNextPage&&a.fetchNextPage()},[h,a.hasNextPage,a.isFetchingNextPage]);const u=((j=(g=(x=a.data)==null?void 0:x.pages)==null?void 0:g[0])==null?void 0:j.count)??0;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Papers"})]}),e.jsxs("div",{className:"feed-subtitle",children:["Search the full corpus. ",u>0&&`${u.toLocaleString()} papers indexed.`]})]}),e.jsx("div",{className:"period-switch",children:B.map(s=>e.jsx("button",{className:`period-btn ${y===s?"active":""}`,onClick:()=>S(s),children:s},s))})]}),e.jsx("div",{className:"papers-search-row",children:e.jsxs("div",{className:"papers-search-input-wrap",children:[e.jsx(L,{name:"search",size:14}),e.jsx("input",{className:"papers-search-input",placeholder:"Search title or abstract…",value:p,onChange:s=>b(s.target.value)})]})}),e.jsxs("div",{className:"layout-with-sidebar",children:[e.jsx("aside",{className:"sidebar",children:e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),m.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,r)=>e.jsx(c,{className:"h-5 w-full"},r))}),(N=(f=m.data)==null?void 0:f.results)==null?void 0:N.map(s=>e.jsxs(F,{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.jsx("div",{className:"sort-options",children:K.map(([s,r])=>e.jsx("button",{className:`sort-btn ${n===s?"active":""}`,onClick:()=>P(s),children:r},s))}),e.jsxs("div",{className:"results-count",children:[l.length," loaded"]})]}),a.error&&e.jsx(z,{variant:"destructive",className:"mb-4",children:e.jsx(M,{children:"Failed to load papers. Please try again."})}),a.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,r)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(c,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(c,{className:"h-6 w-3/4"}),e.jsx(c,{className:"h-4 w-1/2"}),e.jsx(c,{className:"h-12 w-full"})]})]},r))}):l.length===0?e.jsx("div",{className:"no-results",children:"No matching papers."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:l.map((s,r)=>e.jsx(T,{paper:s,rank:r+1},s.id))}),e.jsx("div",{ref:_,style:{height:1}}),a.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})};export{ie as default};
assets/PapersListView-tXfHD3Ds.js DELETED
@@ -1 +0,0 @@
1
- import{u as I,r as i,j as e,L as F}from"./index-BcdJ5r4Y.js";import{I as L,P as T}from"./components-MYNA0qNJ.js";import{a as C}from"./api-DVAIDRP9.js";import{a as R,d as k}from"./transform-Dasg-XFy.js";import{u as D}from"./usePapers-Swv3hMJI.js";import{u as E}from"./useDebounce-B7XgVPQp.js";import{u as O,P as B}from"./usePeriodFilter-B4RSLVJ3.js";import{u as $}from"./useIntersectionObserver-DfztqSja.js";import{S as c,A as z,a as M}from"./alert-BfBSxmdQ.js";import{u as q}from"./adminAuth-CijC1LpP.js";import"./LatexTitle-_7AiBIQK.js";import"./useInfiniteQuery-jK6uM4vU.js";const K=[["trending","trending"],["new","newest"],["cited","most cited"]],re=()=>{var x,g,j,f,N;const[d,v]=I(),o=d.get("search")||"",[p,b]=i.useState(o),t=E(p,300);i.useEffect(()=>{if(t===o)return;const s=new URLSearchParams(d);t?s.set("search",t):s.delete("search"),v(s,{replace:!0})},[t]);const[n,P]=i.useState("new"),{period:y,setPeriod:S,publishedAfter:w}=O("All Time"),a=D({page_size:20,order_by:n==="trending"?"trending":n==="cited"?"citation_count":"date_published",order_dir:"desc",search:t||void 0,published_after:w,include_resources:!0}),m=q({queryKey:["top-tasks-sidebar"],queryFn:()=>C.getTasks({ordering:"-paper_count",page_size:8}),staleTime:10*60*1e3}),l=i.useMemo(()=>{var r;return(((r=a.data)==null?void 0:r.pages.flatMap(A=>A.results))||[]).map(R)},[a.data]),{targetRef:_,isIntersecting:h}=$({rootMargin:"200px"});i.useEffect(()=>{h&&a.hasNextPage&&!a.isFetchingNextPage&&a.fetchNextPage()},[h,a.hasNextPage,a.isFetchingNextPage]);const u=((j=(g=(x=a.data)==null?void 0:x.pages)==null?void 0:g[0])==null?void 0:j.count)??0;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Papers"})]}),e.jsxs("div",{className:"feed-subtitle",children:["Search the full corpus. ",u>0&&`${u.toLocaleString()} papers indexed.`]})]}),e.jsx("div",{className:"period-switch",children:B.map(s=>e.jsx("button",{className:`period-btn ${y===s?"active":""}`,onClick:()=>S(s),children:s},s))})]}),e.jsx("div",{className:"papers-search-row",children:e.jsxs("div",{className:"papers-search-input-wrap",children:[e.jsx(L,{name:"search",size:14}),e.jsx("input",{className:"papers-search-input",placeholder:"Search title or abstract…",value:p,onChange:s=>b(s.target.value)})]})}),e.jsxs("div",{className:"layout-with-sidebar",children:[e.jsx("aside",{className:"sidebar",children:e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),m.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,r)=>e.jsx(c,{className:"h-5 w-full"},r))}),(N=(f=m.data)==null?void 0:f.results)==null?void 0:N.map(s=>e.jsxs(F,{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.jsx("div",{className:"sort-options",children:K.map(([s,r])=>e.jsx("button",{className:`sort-btn ${n===s?"active":""}`,onClick:()=>P(s),children:r},s))}),e.jsxs("div",{className:"results-count",children:[l.length," loaded"]})]}),a.error&&e.jsx(z,{variant:"destructive",className:"mb-4",children:e.jsx(M,{children:"Failed to load papers. Please try again."})}),a.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,r)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(c,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(c,{className:"h-6 w-3/4"}),e.jsx(c,{className:"h-4 w-1/2"}),e.jsx(c,{className:"h-12 w-full"})]})]},r))}):l.length===0?e.jsx("div",{className:"no-results",children:"No matching papers."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:l.map((s,r)=>e.jsx(T,{paper:s,rank:r+1},s.id))}),e.jsx("div",{ref:_,style:{height:1}}),a.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})};export{re as default};
 
 
assets/SavedPapersView-DcFUahmj.js DELETED
@@ -1 +0,0 @@
1
- import{z as o,j as s,T as m,L as p}from"./index-BcdJ5r4Y.js";import{u as h}from"./adminAuth-CijC1LpP.js";import{T as x,P as u}from"./components-MYNA0qNJ.js";import{S as r,A as j,a as v}from"./alert-BfBSxmdQ.js";import{a as N}from"./api-DVAIDRP9.js";import{a as g}from"./transform-Dasg-XFy.js";import"./LatexTitle-_7AiBIQK.js";const A=()=>{var l;const{user:d,isLoading:t}=o(),a=h({queryKey:["my-bookmarks"],queryFn:()=>N.getMyBookmarks(),enabled:!!d,staleTime:30*1e3,refetchOnWindowFocus:!1});return t?s.jsxs("div",{className:"page",children:[s.jsx(r,{className:"h-10 w-1/3 mb-4"}),s.jsx(r,{className:"h-6 w-1/2 mb-8"})]}):d?s.jsxs("div",{className:"page",children:[s.jsx("div",{className:"feed-header",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"feed-title",children:["Saved ",s.jsx("em",{children:"Papers"})]}),s.jsx("div",{className:"feed-subtitle",children:(l=a.data)!=null&&l.count?`${a.data.count.toLocaleString()} saved · grouped by domain`:"Your bookmarked papers, grouped by domain."})]})}),a.error&&s.jsx(j,{variant:"destructive",className:"mb-4",children:s.jsx(v,{children:"Failed to load your saved papers. Please try again."})}),a.isLoading?s.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((i,e)=>s.jsxs("div",{className:"paper-card",children:[s.jsx(r,{className:"h-[220px] w-[160px]"}),s.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[s.jsx(r,{className:"h-6 w-3/4"}),s.jsx(r,{className:"h-4 w-1/2"}),s.jsx(r,{className:"h-12 w-full"})]})]},e))}):!a.data||a.data.count===0?s.jsxs("div",{className:"no-results",children:["No saved papers yet."," ",s.jsx(p,{to:"/papers",className:"sidebar-link",style:{display:"inline"},children:"Browse papers →"})]}):a.data.areas.map(i=>s.jsxs("section",{className:"saved-area-section",children:[s.jsx("h2",{className:"saved-area-heading",children:i.name}),i.tasks.map(e=>{const n=e.papers.length;return s.jsxs("div",{className:"saved-task-block",children:[s.jsxs("div",{className:"saved-task-row",children:[e.slug?s.jsx(x,{slug:e.slug,label:e.name}):s.jsx("span",{className:"tag-chip",style:{background:"var(--surface)"},children:e.name}),s.jsxs("span",{className:"saved-task-count",children:[n," ",n===1?"paper":"papers"]})]}),s.jsx("div",{className:"paper-list",children:e.papers.map(c=>s.jsx(u,{paper:g(c),rank:1},c.id))})]},`task-${i.id??"other"}-${e.id??"untagged"}`)})]},`area-${i.id??"other"}`))]}):s.jsxs("div",{className:"page",children:[s.jsx("div",{className:"feed-header",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"feed-title",children:["Saved ",s.jsx("em",{children:"Papers"})]}),s.jsx("div",{className:"feed-subtitle",children:"Sign in with Hugging Face to save papers and revisit them later."})]})}),s.jsx("div",{className:"saved-signin-panel",children:s.jsx(m,{returnTo:"/saved"})})]})};export{A as default};
 
 
assets/SavedPapersView-Dw2Tv8xO.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{s as o,j as s,V as m,L as p}from"./index-BWQiUBNk.js";import{u as h}from"./useQuery-B941khzD.js";import{T as x,P as u}from"./components-BT6ZBgQl.js";import{S as r}from"./skeleton-BuXiEBoy.js";import{A as j,a as v}from"./alert-DUe5ZsgM.js";import{a as N}from"./api-BFeNcidM.js";import{a as g}from"./transform-DgWj1AQy.js";import"./LatexTitle-Ckdd_TrR.js";import"./adminAuth-PI_XkM8E.js";const C=()=>{var l;const{user:d,isLoading:c}=o(),a=h({queryKey:["my-bookmarks"],queryFn:()=>N.getMyBookmarks(),enabled:!!d,staleTime:30*1e3,refetchOnWindowFocus:!1});return c?s.jsxs("div",{className:"page",children:[s.jsx(r,{className:"h-10 w-1/3 mb-4"}),s.jsx(r,{className:"h-6 w-1/2 mb-8"})]}):d?s.jsxs("div",{className:"page",children:[s.jsx("div",{className:"feed-header",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"feed-title",children:["Saved ",s.jsx("em",{children:"Papers"})]}),s.jsx("div",{className:"feed-subtitle",children:(l=a.data)!=null&&l.count?`${a.data.count.toLocaleString()} saved · grouped by domain`:"Your bookmarked papers, grouped by domain."})]})}),a.error&&s.jsx(j,{variant:"destructive",className:"mb-4",children:s.jsx(v,{children:"Failed to load your saved papers. Please try again."})}),a.isLoading?s.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((i,e)=>s.jsxs("div",{className:"paper-card",children:[s.jsx(r,{className:"h-[220px] w-[160px]"}),s.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[s.jsx(r,{className:"h-6 w-3/4"}),s.jsx(r,{className:"h-4 w-1/2"}),s.jsx(r,{className:"h-12 w-full"})]})]},e))}):!a.data||a.data.count===0?s.jsxs("div",{className:"no-results",children:["No saved papers yet."," ",s.jsx(p,{to:"/papers",className:"sidebar-link",style:{display:"inline"},children:"Browse papers →"})]}):a.data.areas.map(i=>s.jsxs("section",{className:"saved-area-section",children:[s.jsx("h2",{className:"saved-area-heading",children:i.name}),i.tasks.map(e=>{const n=e.papers.length;return s.jsxs("div",{className:"saved-task-block",children:[s.jsxs("div",{className:"saved-task-row",children:[e.slug?s.jsx(x,{slug:e.slug,label:e.name}):s.jsx("span",{className:"tag-chip",style:{background:"var(--surface)"},children:e.name}),s.jsxs("span",{className:"saved-task-count",children:[n," ",n===1?"paper":"papers"]})]}),s.jsx("div",{className:"paper-list",children:e.papers.map(t=>s.jsx(u,{paper:g(t),rank:1},t.id))})]},`task-${i.id??"other"}-${e.id??"untagged"}`)})]},`area-${i.id??"other"}`))]}):s.jsxs("div",{className:"page",children:[s.jsx("div",{className:"feed-header",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"feed-title",children:["Saved ",s.jsx("em",{children:"Papers"})]}),s.jsx("div",{className:"feed-subtitle",children:"Sign in with Hugging Face to save papers and revisit them later."})]})}),s.jsx("div",{className:"saved-signin-panel",children:s.jsx(m,{returnTo:"/saved"})})]})};export{C as default};
assets/SearchOverlay-BoQEnfv1.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{r as y,y as _,t as q,j as s}from"./index-BWQiUBNk.js";import{u as h}from"./useQuery-B941khzD.js";import{L as T}from"./LatexTitle-Ckdd_TrR.js";import{a as u}from"./api-BFeNcidM.js";import{u as w}from"./useDebounce-DUtosrff.js";import{f as E,h as L,d as Q}from"./transform-DgWj1AQy.js";import"./adminAuth-PI_XkM8E.js";const z=({open:r,onClose:n})=>{var j,v;const m=y.useRef(null),f=_(),[o,N]=q.useState(""),a=w(o,200);y.useEffect(()=>{var t;if(!r)return;(t=m.current)==null||t.focus();const e=b=>{b.key==="Escape"&&n()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[r,n]);const p=h({queryKey:["search-papers",a],queryFn:()=>u.searchPapers(a,6),enabled:r&&a.length>=2,staleTime:6e4}),g=h({queryKey:["search-tasks",a],queryFn:()=>u.getTasks({q:a,page_size:6}),enabled:r&&a.length>=2,staleTime:6e4}),x=h({queryKey:["search-methods",a],queryFn:()=>u.getMethods({q:a,page_size:6}),enabled:r&&a.length>=2,staleTime:6e4});if(!r)return null;const c=((j=g.data)==null?void 0:j.results)||[],l=((v=x.data)==null?void 0:v.results)||[],i=p.data||[],k=p.isFetching||g.isFetching||x.isFetching,F=c.length||i.length||l.length,d=e=>{n(),f(e)};return s.jsx("div",{className:"search-overlay",onClick:n,children:s.jsxs("div",{className:"search-modal",onClick:e=>e.stopPropagation(),children:[s.jsx("input",{ref:m,className:"search-modal-input",placeholder:"Search papers, tasks, or methods…",value:o,onChange:e=>N(e.target.value)}),s.jsxs("div",{className:"search-results",children:[!a&&s.jsx("div",{className:"search-empty",children:"Try “diffusion”, “object detection”, or an arXiv id."}),a&&!k&&!F&&s.jsxs("div",{className:"search-empty",children:['No matches for "',o,'"']}),c.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Tasks · ",c.length]}),c.map(e=>{const t=E(L(e.slug||""));return s.jsxs("div",{className:"search-result-tag",onClick:()=>d(`/tasks/${e.slug}`),children:[s.jsx("span",{className:"dot",style:{width:6,height:6,borderRadius:"50%",background:t.dot}}),s.jsx("span",{className:"name",children:Q(e.name,e.slug)}),e.paper_count!=null&&s.jsxs("span",{className:"count",children:[e.paper_count," papers"]})]},e.id)})]}),l.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Methods · ",l.length]}),l.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>d(`/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))]}),i.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Papers · ",i.length]}),i.map(e=>{var t;return s.jsxs("div",{className:"search-result",onClick:()=>d(`/paper/${e.arxiv_id||e.id}`),children:[s.jsx("div",{className:"search-result-title",children:s.jsx(T,{title:e.title})}),s.jsxs("div",{className:"search-result-meta",children:[s.jsx("span",{children:e.arxiv_id?`arXiv:${e.arxiv_id}`:"External resource"}),((t=e.authors)==null?void 0:t[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)})]})]})]})})};export{z as default};
assets/SearchOverlay-CvsxBwHB.js DELETED
@@ -1 +0,0 @@
1
- import{r as y,H as _,A as q,j as s}from"./index-BcdJ5r4Y.js";import{u as h}from"./adminAuth-CijC1LpP.js";import{L as T}from"./LatexTitle-_7AiBIQK.js";import{a as u}from"./api-DVAIDRP9.js";import{u as w}from"./useDebounce-B7XgVPQp.js";import{f as E,h as L,d as Q}from"./transform-Dasg-XFy.js";const M=({open:r,onClose:n})=>{var j,v;const m=y.useRef(null),f=_(),[d,N]=q.useState(""),a=w(d,200);y.useEffect(()=>{var t;if(!r)return;(t=m.current)==null||t.focus();const e=b=>{b.key==="Escape"&&n()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[r,n]);const p=h({queryKey:["search-papers",a],queryFn:()=>u.searchPapers(a,6),enabled:r&&a.length>=2,staleTime:6e4}),g=h({queryKey:["search-tasks",a],queryFn:()=>u.getTasks({q:a,page_size:6}),enabled:r&&a.length>=2,staleTime:6e4}),x=h({queryKey:["search-methods",a],queryFn:()=>u.getMethods({q:a,page_size:6}),enabled:r&&a.length>=2,staleTime:6e4});if(!r)return null;const c=((j=g.data)==null?void 0:j.results)||[],l=((v=x.data)==null?void 0:v.results)||[],i=p.data||[],k=p.isFetching||g.isFetching||x.isFetching,F=c.length||i.length||l.length,o=e=>{n(),f(e)};return s.jsx("div",{className:"search-overlay",onClick:n,children:s.jsxs("div",{className:"search-modal",onClick:e=>e.stopPropagation(),children:[s.jsx("input",{ref:m,className:"search-modal-input",placeholder:"Search papers, tasks, or methods…",value:d,onChange:e=>N(e.target.value)}),s.jsxs("div",{className:"search-results",children:[!a&&s.jsx("div",{className:"search-empty",children:"Try “diffusion”, “object detection”, or an arXiv id."}),a&&!k&&!F&&s.jsxs("div",{className:"search-empty",children:['No matches for "',d,'"']}),c.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Tasks · ",c.length]}),c.map(e=>{const t=E(L(e.slug||""));return s.jsxs("div",{className:"search-result-tag",onClick:()=>o(`/tasks/${e.slug}`),children:[s.jsx("span",{className:"dot",style:{width:6,height:6,borderRadius:"50%",background:t.dot}}),s.jsx("span",{className:"name",children:Q(e.name,e.slug)}),e.paper_count!=null&&s.jsxs("span",{className:"count",children:[e.paper_count," papers"]})]},e.id)})]}),l.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Methods · ",l.length]}),l.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>o(`/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))]}),i.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Papers · ",i.length]}),i.map(e=>{var t;return s.jsxs("div",{className:"search-result",onClick:()=>o(`/paper/${e.arxiv_id||e.id}`),children:[s.jsx("div",{className:"search-result-title",children:s.jsx(T,{title:e.title})}),s.jsxs("div",{className:"search-result-meta",children:[s.jsx("span",{children:e.arxiv_id?`arXiv:${e.arxiv_id}`:"External resource"}),((t=e.authors)==null?void 0:t[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)})]})]})]})})};export{M as default};
 
 
assets/SubmitView-BWQDAbjX.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{r as P,j as e,h as T,y as w,p as D,q as _,t as n}from"./index-BWQiUBNk.js";import{u as C}from"./useMutation-CypKj-4k.js";import{A as E,a as z}from"./alert-DUe5ZsgM.js";import{I as m,B as v}from"./input-DZmGAzFu.js";import{s as F}from"./api-BFeNcidM.js";import"./adminAuth-PI_XkM8E.js";const j=P.forwardRef(({className:r,...t},i)=>e.jsx("textarea",{className:T("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",r),ref:i,...t}));j.displayName="Textarea";const X=/^\d{4}\.\d{4,5}(v\d+)?$/i,L=/^[a-z-]+(\.[A-Z]{2})?\/\d{7}$/,q=/^https?:\/\/(?:www\.)?arxiv\.org\//i;function S(r){const t=r.trim();return t?X.test(t)||L.test(t)||q.test(t)?"arxiv":/^https?:\/\//i.test(t)?"external":"arxiv":"empty"}function N(r,t){const i=r.trim();if(S(i)==="arxiv")return/^https?:\/\//i.test(i)?{source_url:i}:{arxiv_id:i};const s={source_url:i},l=t.title.trim();l&&(s.title=l);const u=t.abstract.trim();u&&(s.abstract=u);const o=t.authors.split(/[,\n]/).map(h=>h.trim()).filter(Boolean);return o.length>0&&(s.authors=o),t.datePublished&&(s.date_published=t.datePublished),s}function U(r){const t=r;if(!t)return"Submission failed";if(t.response)try{const i=JSON.parse(t.response);if(typeof i.detail=="string")return i.detail}catch{return t.response}return t.message||"Submission failed"}const K=()=>{const r=w(),t=D(),{toast:i}=_(),[d,s]=n.useState(""),[l,u]=n.useState(""),[o,h]=n.useState(""),[f,I]=n.useState(""),[g,A]=n.useState(""),[b,x]=n.useState(null),p=S(d),y=p==="external",c=C({mutationFn:a=>F(a),onSuccess:a=>{t.invalidateQueries({queryKey:["papers"],refetchType:"none"}),t.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),t.invalidateQueries({queryKey:["trending-papers"],refetchType:"none"}),i({title:a.created?"Paper submitted":"Paper already indexed",description:a.created?"Opening the paper page…":"Opening the existing paper page…"}),r(`/paper/${a.route_identifier}`)},onError:a=>{x(U(a))}}),R=a=>{if(a.preventDefault(),x(null),p==="empty"){x("Enter an arXiv ID or a paper URL to submit.");return}const k=N(d,{title:l,abstract:o,authors:f,datePublished:g});c.mutate(k)};return e.jsxs("div",{className:"page",style:{maxWidth:720},children:[e.jsx("h1",{className:"detail-title",children:"Submit a paper"}),e.jsx("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:12,lineHeight:1.55},children:"Index an arXiv paper or add a non-arXiv paper (blog post, technical report, model release page). Submissions are public and appear in the feed immediately."}),e.jsxs("form",{onSubmit:R,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(m,{id:"submit-input",value:d,onChange:a=>s(a.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:p==="arxiv"?"Detected: arXiv paper — metadata will be fetched automatically.":p==="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."})]}),y&&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(m,{id:"submit-title",value:l,onChange:a=>u(a.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(j,{id:"submit-abstract",value:o,onChange:a=>h(a.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(m,{id:"submit-authors",value:f,onChange:a=>I(a.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(m,{id:"submit-date",type:"date",value:g,onChange:a=>A(a.target.value),style:{maxWidth:220}}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)"},children:"Required only if we cannot infer a date from the page."})]})]}),b&&e.jsx(E,{variant:"destructive",children:e.jsx(z,{children:b})}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[e.jsx(v,{type:"submit",disabled:c.isPending,children:c.isPending?y?"Fetching & indexing…":"Indexing…":"Submit paper"}),e.jsx(v,{type:"button",variant:"outline",onClick:()=>r(-1),disabled:c.isPending,children:"Cancel"})]})]})]})};export{K as default};
assets/TagBrowseView-BP39xnV3.js DELETED
@@ -1 +0,0 @@
1
- var ws=n=>{throw TypeError(n)};var Z=(n,t,r)=>t.has(n)||ws("Cannot "+r);var l=(n,t,r)=>(Z(n,t,"read from private field"),r?r.call(n):t.get(n)),y=(n,t,r)=>t.has(n)?ws("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,r),x=(n,t,r,a)=>(Z(n,t,"write to private field"),a?a.call(n,r):t.set(n,r),r),S=(n,t,r)=>(Z(n,t,"access private method"),r);import{S as Ms,n as es,s as Ls,J as As,a as Fs,r as E,b as Ds,G as Hs,H as Is,u as Ks,j as s,L as I,A as $s}from"./index-BcdJ5r4Y.js";import{Q as Os,a as zs,b as Us,e as Vs,c as Gs,d as Js,s as Es,f as Ws,g as Xs,u as K}from"./adminAuth-CijC1LpP.js";import{P as Ys,M as Zs}from"./components-MYNA0qNJ.js";import{a as L}from"./api-DVAIDRP9.js";import{a as se,d as G}from"./transform-Dasg-XFy.js";import{c as ee}from"./usePapers-Swv3hMJI.js";import{u as te}from"./useIntersectionObserver-DfztqSja.js";import{S as J,A as ae,a as re}from"./alert-BfBSxmdQ.js";import"./LatexTitle-_7AiBIQK.js";import"./useInfiniteQuery-jK6uM4vU.js";function _s(n,t){const r=new Set(t);return n.filter(a=>!r.has(a))}function ne(n,t,r){const a=n.slice(0);return a[t]=r,a}var A,k,F,B,N,P,$,z,U,V,p,ts,as,Rs,rs,ns,is,Cs,ie=(Cs=class extends Ms{constructor(t,r,a){super();y(this,p);y(this,A);y(this,k);y(this,F);y(this,B);y(this,N);y(this,P);y(this,$);y(this,z);y(this,U);y(this,V,[]);x(this,A,t),x(this,B,a),x(this,F,[]),x(this,N,[]),x(this,k,[]),this.setQueries(r)}onSubscribe(){this.listeners.size===1&&l(this,N).forEach(t=>{t.subscribe(r=>{S(this,p,ns).call(this,t,r)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,l(this,N).forEach(t=>{t.destroy()})}setQueries(t,r){x(this,F,t),x(this,B,r),es.batch(()=>{const a=l(this,N),i=S(this,p,rs).call(this,l(this,F));i.forEach(m=>m.observer.setOptions(m.defaultedQueryOptions));const o=i.map(m=>m.observer),c=o.map(m=>m.getCurrentResult()),b=a.length!==o.length,_=o.some((m,R)=>m!==a[R]),O=b||_,h=O?!0:c.some((m,R)=>{const Q=l(this,k)[R];return!Q||!Ls(m,Q)});!O&&!h||(O&&(x(this,V,i),x(this,N,o)),x(this,k,c),this.hasListeners()&&(O&&(_s(a,o).forEach(m=>{m.destroy()}),_s(o,a).forEach(m=>{m.subscribe(R=>{S(this,p,ns).call(this,m,R)})})),S(this,p,is).call(this)))})}getCurrentResult(){return l(this,k)}getQueries(){return l(this,N).map(t=>t.getCurrentQuery())}getObservers(){return l(this,N)}getOptimisticResult(t,r){const a=S(this,p,rs).call(this,t),i=a.map(c=>c.observer.getOptimisticResult(c.defaultedQueryOptions)),o=a.map(c=>c.defaultedQueryOptions.queryHash);return[i,c=>S(this,p,as).call(this,c??i,r,o),()=>S(this,p,ts).call(this,i,a)]}},A=new WeakMap,k=new WeakMap,F=new WeakMap,B=new WeakMap,N=new WeakMap,P=new WeakMap,$=new WeakMap,z=new WeakMap,U=new WeakMap,V=new WeakMap,p=new WeakSet,ts=function(t,r){return r.map((a,i)=>{const o=t[i];return a.defaultedQueryOptions.notifyOnChangeProps?o:a.observer.trackResult(o,c=>{r.forEach(b=>{b.observer.trackProp(c)})})})},as=function(t,r,a){if(r){const i=l(this,U),o=a!==void 0&&i!==void 0&&(i.length!==a.length||a.some((c,b)=>c!==i[b]));return(!l(this,P)||l(this,k)!==l(this,z)||o||r!==l(this,$))&&(x(this,$,r),x(this,z,l(this,k)),a!==void 0&&x(this,U,a),x(this,P,As(l(this,P),r(t)))),l(this,P)}return t},Rs=function(){var t;return((t=l(this,B))==null?void 0:t.combine)!==void 0&&l(this,N).some((r,a)=>{var i;return r.options.suspense&&((i=l(this,k)[a])==null?void 0:i.data)===void 0})},rs=function(t){const r=new Map;l(this,N).forEach(i=>{const o=i.options.queryHash;if(!o)return;const c=r.get(o);c?c.push(i):r.set(o,[i])});const a=[];return t.forEach(i=>{var _;const o=l(this,A).defaultQueryOptions(i),b=((_=r.get(o.queryHash))==null?void 0:_.shift())??new Os(l(this,A),o);a.push({defaultedQueryOptions:o,observer:b})}),a},ns=function(t,r){const a=l(this,N).indexOf(t);a!==-1&&(x(this,k,ne(l(this,k),a,r)),S(this,p,is).call(this))},is=function(){var t;if(this.hasListeners()){const r=S(this,p,ts).call(this,l(this,k),l(this,V)),a=S(this,p,Rs).call(this),i=l(this,P),o=a?i:S(this,p,as).call(this,r,(t=l(this,B))==null?void 0:t.combine);(a||i!==o)&&es.batch(()=>{this.listeners.forEach(c=>{c(l(this,k))})})}},Cs);function ce({queries:n,...t},r){const a=Fs(),i=zs(),o=Us(),c=E.useMemo(()=>n.map(f=>{const v=a.defaultQueryOptions(f);return v._optimisticResults=i?"isRestoring":"optimistic",v}),[n,a,i]);c.forEach(f=>{Vs(f);const v=a.getQueryCache().get(f.queryHash);Gs(f,o,v)}),Js(o);const[b]=E.useState(()=>new ie(a,c,t)),[_,O,h]=b.getOptimisticResult(c,t.combine),m=!i&&t.subscribed!==!1;E.useSyncExternalStore(E.useCallback(f=>m?b.subscribe(es.batchCalls(f)):Ds,[b,m]),()=>b.getCurrentResult(),()=>b.getCurrentResult()),E.useEffect(()=>{b.setQueries(c,t)},[c,t,b]);const Q=_.some((f,v)=>Es(c[v],f))?_.flatMap((f,v)=>{const u=c[v];if(u&&Es(u,f)){const D=new Os(a,u);return Ws(u,D,o)}return[]}):[];if(Q.length>0)throw Promise.all(Q);const C=_.find((f,v)=>{const u=c[v];return u&&Xs({result:f,errorResetBoundary:o,throwOnError:u.throwOnError,query:a.getQueryCache().get(u.queryHash),suspense:u.suspense})});if(C!=null&&C.error)throw C.error;return O(h())}const oe=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],le=n=>n==="trending"||n==="date_published"||n==="citation_count"?n:"trending",de=new Set(["classic-language-modeling","coding","safety-and-grounding"]),ss=3,W=2,Ne=()=>{var hs,us,ms,ps,gs,bs,xs,fs,js,vs,ks,Ns,ys;const{taskSlug:n}=Hs(),t=Is(),[r,a]=Ks(),i=le(r.get("order_by")),o=e=>{const d=new URLSearchParams(r);d.set("order_by",e),a(d)},[c,b]=E.useState(!1),[_,O]=E.useState(()=>new Set),h=K({queryKey:["task",n],queryFn:()=>L.getTask(n),enabled:!!n,staleTime:10*60*1e3}),m=K({queryKey:["task-parents",(hs=h.data)==null?void 0:hs.id],queryFn:()=>L.getTaskParents(h.data.id),enabled:!!((us=h.data)!=null&&us.id),staleTime:10*60*1e3}),R=K({queryKey:["task-sisters",(ms=h.data)==null?void 0:ms.area_id,(ps=h.data)==null?void 0:ps.id],queryFn:()=>L.getTasks({area_id:Number(h.data.area_id),page_size:50}),enabled:!!((gs=h.data)!=null&&gs.area_id),staleTime:10*60*1e3}),Q=K({queryKey:["task-children",(bs=h.data)==null?void 0:bs.id],queryFn:()=>L.getTaskChildren(h.data.id,{page_size:50}),enabled:!!((xs=h.data)!=null&&xs.id),staleTime:10*60*1e3}),C=E.useMemo(()=>{var e;return(((e=Q.data)==null?void 0:e.results)||[]).filter(d=>!de.has(d.slug))},[Q.data]),f=K({queryKey:["task-datasets",(fs=h.data)==null?void 0:fs.id,!1,W],queryFn:()=>L.getDatasets({task_id:Number(h.data.id),page_size:100,ordering:"-paper_count",min_eval_count:W}),enabled:!!((js=h.data)!=null&&js.id),staleTime:10*60*1e3}),v=ce({queries:C.map(e=>({queryKey:["task-datasets",e.id,!1,W],queryFn:()=>L.getDatasets({task_id:Number(e.id),page_size:20,ordering:"-paper_count",min_eval_count:W}),staleTime:10*60*1e3}))}),u=ee({taskId:((vs=h.data)==null?void 0:vs.id)||"",page_size:12,order_by:i,order_dir:"desc",include_resources:!0,enabled:!!((ks=h.data)!=null&&ks.id)}),D=E.useMemo(()=>{var d;return(((d=u.data)==null?void 0:d.pages.flatMap(g=>g.results))||[]).map(se)},[u.data]),X=E.useMemo(()=>{var d;const e={};return(d=u.data)==null||d.pages.forEach(g=>g.results.forEach(j=>(j.methods||[]).forEach(w=>{const H=w.slug||w.id;e[H]||(e[H]={id:w.id,name:w.name,slug:w.slug||"",count:0}),e[H].count++}))),Object.values(e).sort((g,j)=>j.count-g.count).slice(0,8)},[u.data]),{targetRef:Qs,isIntersecting:cs}=te({rootMargin:"200px"});if(E.useEffect(()=>{cs&&u.hasNextPage&&!u.isFetchingNextPage&&u.fetchNextPage()},[cs,u.hasNextPage,u.isFetchingNextPage]),h.isLoading)return s.jsxs("div",{className:"page",children:[s.jsx(J,{className:"h-12 w-1/2 mb-4"}),s.jsx(J,{className:"h-6 w-1/3 mb-8"}),s.jsx(J,{className:"h-64 w-full"})]});if(h.error||!h.data)return s.jsx("div",{className:"page",children:s.jsx(ae,{variant:"destructive",children:s.jsx(re,{children:"Task not found."})})});const T=h.data,os=G(T.name,T.slug),ls=(((Ns=R.data)==null?void 0:Ns.results)||[]).filter(e=>e.id!==T.id),q=((ys=f.data)==null?void 0:ys.results)||[],Ts=C.some((e,d)=>{var j,w;return(((w=(j=v[d])==null?void 0:j.data)==null?void 0:w.results)||[]).length>0}),ds=q.length>0,Ps=(()=>{const e=new Set;return q.forEach(d=>e.add(d.id)),v.forEach(d=>{var g;return(((g=d.data)==null?void 0:g.results)||[]).forEach(j=>e.add(j.id))}),e.size})(),qs=e=>{O(d=>{const g=new Set(d);return g.has(e)?g.delete(e):g.add(e),g})};return s.jsxs("div",{className:"page",children:[s.jsxs("div",{className:"breadcrumb",children:[s.jsx(I,{to:"/",children:"Papers"}),s.jsx("span",{className:"sep",children:"/"}),s.jsx(I,{to:"/tasks",children:"Tasks"}),[...m.data||[]].reverse().map(e=>s.jsxs($s.Fragment,{children:[s.jsx("span",{className:"sep",children:"/"}),s.jsx(I,{to:`/tasks/${e.slug||e.id}`,children:G(e.name,e.slug)})]},e.id)),s.jsx("span",{className:"sep",children:"/"}),s.jsx("span",{style:{color:"var(--accent-text)"},children:T.name.toUpperCase()})]}),s.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:"TASK"}),s.jsx("h1",{className:"domain-mega-title",children:os}),T.description&&s.jsx("p",{className:"task-explainer",children:T.description}),s.jsxs("div",{className:"task-quickstats",children:[s.jsxs("span",{children:[s.jsx("span",{className:"num",children:(T.paper_count??0).toLocaleString()}),"PAPERS"]}),s.jsxs("span",{children:[s.jsx("span",{className:"num",children:Ps}),"BENCHMARKS"]}),s.jsxs("span",{children:[s.jsxs("span",{className:"num",children:[X.length,"+"]}),"METHODS USED"]})]}),s.jsxs("div",{className:"task-page-grid",style:{marginTop:28},children:[s.jsxs("div",{children:[ds&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"task-section-head",children:[s.jsx("div",{className:"task-section-eyebrow",children:"Leaderboards · click any"}),s.jsxs("div",{className:"task-section-title",children:["Benchmarks ",s.jsxs("span",{className:"meta",children:["[",q.length,"]"]})]})]}),(c?q:q.slice(0,5)).map((e,d)=>s.jsxs("div",{className:"bench-row",onClick:()=>t(`/benchmark/${e.slug||e.id}`),children:[s.jsx("div",{className:"bench-row-num",children:String(d+1).padStart(2,"0")}),s.jsxs("div",{className:"bench-row-main",children:[s.jsx("div",{className:"bench-row-name",children:e.name}),s.jsx("div",{className:"bench-row-sub",children:e.paper_count!=null&&s.jsxs("span",{children:[s.jsx("strong",{children:e.paper_count})," ENTRIES"]})})]}),s.jsx("div",{className:"bench-row-arrow",children:"→"})]},e.id)),q.length>5&&s.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>b(e=>!e),children:c?"− show top 5":`+ show ${q.length-5} more benchmarks`})]}),Ts&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"task-section-head",style:ds?{marginTop:36}:void 0,children:[s.jsx("div",{className:"task-section-eyebrow",children:"Benchmarks by capability"}),s.jsxs("div",{className:"task-section-title",children:["Subtasks ",s.jsxs("span",{className:"meta",children:["[",C.length,"]"]})]})]}),s.jsx("div",{className:"subtask-grid",children:C.map((e,d)=>{var Ss;const g=v[d],j=((Ss=g==null?void 0:g.data)==null?void 0:Ss.results)||[];if(j.length===0)return null;const w=_.has(e.id),H=w?j:j.slice(0,ss),Y=j.length-ss;return s.jsxs("div",{className:"subtask-section",children:[s.jsxs("div",{className:"subtask-head",children:[s.jsx(I,{to:`/tasks/${e.slug||e.id}`,className:"subtask-head-name",children:G(e.name,e.slug)}),s.jsxs("span",{className:"subtask-head-meta",children:["[",j.length," benchmark",j.length===1?"":"s","]"]})]}),H.map((M,Bs)=>s.jsxs("div",{className:"bench-row",onClick:()=>t(`/benchmark/${M.slug||M.id}`),children:[s.jsx("div",{className:"bench-row-num",children:String(Bs+1).padStart(2,"0")}),s.jsxs("div",{className:"bench-row-main",children:[s.jsx("div",{className:"bench-row-name",children:M.name}),s.jsx("div",{className:"bench-row-sub",children:M.paper_count!=null&&s.jsxs("span",{children:[s.jsx("strong",{children:M.paper_count})," ENTRIES"]})})]}),s.jsx("div",{className:"bench-row-arrow",children:"→"})]},M.id)),Y>0&&s.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>qs(e.id),children:w?`− show top ${ss}`:`+ show ${Y} more benchmark${Y===1?"":"s"}`})]},e.id)})})]}),s.jsxs("div",{className:"task-section-head",style:{marginTop:36},children:[s.jsx("div",{className:"task-section-eyebrow",children:"Top trending · sort below"}),s.jsxs("div",{className:"task-section-title",children:["Papers ",s.jsxs("span",{className:"meta",children:["[",(T.paper_count??0).toLocaleString(),"]"]})]})]}),s.jsxs("div",{className:"sort-bar",children:[s.jsx("div",{className:"sort-options",children:oe.map(([e,d])=>s.jsx("button",{className:`sort-btn ${i===e?"active":""}`,onClick:()=>o(e),children:d},e))}),s.jsxs("div",{className:"results-count",children:[D.length," loaded in ",s.jsx("span",{children:os})]})]}),u.isLoading?s.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((e,d)=>s.jsx(J,{className:"h-40 w-full"},d))}):D.length===0?s.jsx("div",{className:"no-results",children:"No papers in this task yet."}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"paper-list",children:D.map((e,d)=>s.jsx(Ys,{paper:e,rank:d+1},e.id))}),s.jsx("div",{ref:Qs,style:{height:1}}),u.isFetchingNextPage&&s.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]}),s.jsxs("aside",{className:"task-side",children:[ls.length>0&&s.jsxs("div",{className:"side-block",children:[s.jsx("div",{className:"side-block-num",children:"01/"}),s.jsx("div",{className:"side-block-label",children:"Sister Tasks"}),ls.slice(0,8).map(e=>s.jsxs(I,{to:`/tasks/${e.slug}`,className:"side-link-row",children:[s.jsx("span",{children:G(e.name,e.slug)}),e.paper_count!=null&&s.jsx("span",{className:"count",children:e.paper_count.toLocaleString()})]},e.id))]}),X.length>0&&s.jsxs("div",{className:"side-block",children:[s.jsx("div",{className:"side-block-num",children:"02/"}),s.jsx("div",{className:"side-block-label",children:"Common Methods"}),X.map(e=>s.jsxs("div",{className:"side-method-row",children:[s.jsx(Zs,{method:{slug:e.slug,name:e.name}}),s.jsxs("span",{className:"num",children:["·",e.count]})]},e.id))]})]})]})]})};export{Ne as default};
 
 
assets/TagBrowseView-CpYLrrd8.js ADDED
@@ -0,0 +1 @@
 
 
1
+ var ws=n=>{throw TypeError(n)};var Z=(n,t,r)=>t.has(n)||ws("Cannot "+r);var l=(n,t,r)=>(Z(n,t,"read from private field"),r?r.call(n):t.get(n)),y=(n,t,r)=>t.has(n)?ws("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,r),x=(n,t,r,a)=>(Z(n,t,"write to private field"),a?a.call(n,r):t.set(n,r),r),S=(n,t,r)=>(Z(n,t,"access private method"),r);import{S as Bs,I as es,J as Ls,K as Fs,p as As,r as E,M as Ds,x as Hs,y as Is,u as Ks,j as s,L as I,t as $s}from"./index-BWQiUBNk.js";import{Q as Os,a as zs,b as Us,e as Vs,c as Js,d as Gs,s as Es,f as Ws,g as Xs,u as K}from"./useQuery-B941khzD.js";import{P as Ys,M as Zs}from"./components-BT6ZBgQl.js";import{a as L}from"./api-BFeNcidM.js";import{a as se,d as J}from"./transform-DgWj1AQy.js";import{c as ee}from"./usePapers-CnRnmSk-.js";import{u as te}from"./useIntersectionObserver-U7v6rTcQ.js";import{S as G}from"./skeleton-BuXiEBoy.js";import{A as ae,a as re}from"./alert-DUe5ZsgM.js";import"./LatexTitle-Ckdd_TrR.js";import"./adminAuth-PI_XkM8E.js";import"./useInfiniteQuery-CpEFc3Gg.js";function _s(n,t){const r=new Set(t);return n.filter(a=>!r.has(a))}function ne(n,t,r){const a=n.slice(0);return a[t]=r,a}var F,k,A,M,N,P,$,z,U,V,p,ts,as,Rs,rs,ns,is,Cs,ie=(Cs=class extends Bs{constructor(t,r,a){super();y(this,p);y(this,F);y(this,k);y(this,A);y(this,M);y(this,N);y(this,P);y(this,$);y(this,z);y(this,U);y(this,V,[]);x(this,F,t),x(this,M,a),x(this,A,[]),x(this,N,[]),x(this,k,[]),this.setQueries(r)}onSubscribe(){this.listeners.size===1&&l(this,N).forEach(t=>{t.subscribe(r=>{S(this,p,ns).call(this,t,r)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,l(this,N).forEach(t=>{t.destroy()})}setQueries(t,r){x(this,A,t),x(this,M,r),es.batch(()=>{const a=l(this,N),i=S(this,p,rs).call(this,l(this,A));i.forEach(m=>m.observer.setOptions(m.defaultedQueryOptions));const o=i.map(m=>m.observer),c=o.map(m=>m.getCurrentResult()),b=a.length!==o.length,_=o.some((m,R)=>m!==a[R]),O=b||_,h=O?!0:c.some((m,R)=>{const Q=l(this,k)[R];return!Q||!Ls(m,Q)});!O&&!h||(O&&(x(this,V,i),x(this,N,o)),x(this,k,c),this.hasListeners()&&(O&&(_s(a,o).forEach(m=>{m.destroy()}),_s(o,a).forEach(m=>{m.subscribe(R=>{S(this,p,ns).call(this,m,R)})})),S(this,p,is).call(this)))})}getCurrentResult(){return l(this,k)}getQueries(){return l(this,N).map(t=>t.getCurrentQuery())}getObservers(){return l(this,N)}getOptimisticResult(t,r){const a=S(this,p,rs).call(this,t),i=a.map(c=>c.observer.getOptimisticResult(c.defaultedQueryOptions)),o=a.map(c=>c.defaultedQueryOptions.queryHash);return[i,c=>S(this,p,as).call(this,c??i,r,o),()=>S(this,p,ts).call(this,i,a)]}},F=new WeakMap,k=new WeakMap,A=new WeakMap,M=new WeakMap,N=new WeakMap,P=new WeakMap,$=new WeakMap,z=new WeakMap,U=new WeakMap,V=new WeakMap,p=new WeakSet,ts=function(t,r){return r.map((a,i)=>{const o=t[i];return a.defaultedQueryOptions.notifyOnChangeProps?o:a.observer.trackResult(o,c=>{r.forEach(b=>{b.observer.trackProp(c)})})})},as=function(t,r,a){if(r){const i=l(this,U),o=a!==void 0&&i!==void 0&&(i.length!==a.length||a.some((c,b)=>c!==i[b]));return(!l(this,P)||l(this,k)!==l(this,z)||o||r!==l(this,$))&&(x(this,$,r),x(this,z,l(this,k)),a!==void 0&&x(this,U,a),x(this,P,Fs(l(this,P),r(t)))),l(this,P)}return t},Rs=function(){var t;return((t=l(this,M))==null?void 0:t.combine)!==void 0&&l(this,N).some((r,a)=>{var i;return r.options.suspense&&((i=l(this,k)[a])==null?void 0:i.data)===void 0})},rs=function(t){const r=new Map;l(this,N).forEach(i=>{const o=i.options.queryHash;if(!o)return;const c=r.get(o);c?c.push(i):r.set(o,[i])});const a=[];return t.forEach(i=>{var _;const o=l(this,F).defaultQueryOptions(i),b=((_=r.get(o.queryHash))==null?void 0:_.shift())??new Os(l(this,F),o);a.push({defaultedQueryOptions:o,observer:b})}),a},ns=function(t,r){const a=l(this,N).indexOf(t);a!==-1&&(x(this,k,ne(l(this,k),a,r)),S(this,p,is).call(this))},is=function(){var t;if(this.hasListeners()){const r=S(this,p,ts).call(this,l(this,k),l(this,V)),a=S(this,p,Rs).call(this),i=l(this,P),o=a?i:S(this,p,as).call(this,r,(t=l(this,M))==null?void 0:t.combine);(a||i!==o)&&es.batch(()=>{this.listeners.forEach(c=>{c(l(this,k))})})}},Cs);function ce({queries:n,...t},r){const a=As(),i=zs(),o=Us(),c=E.useMemo(()=>n.map(f=>{const v=a.defaultQueryOptions(f);return v._optimisticResults=i?"isRestoring":"optimistic",v}),[n,a,i]);c.forEach(f=>{Vs(f);const v=a.getQueryCache().get(f.queryHash);Js(f,o,v)}),Gs(o);const[b]=E.useState(()=>new ie(a,c,t)),[_,O,h]=b.getOptimisticResult(c,t.combine),m=!i&&t.subscribed!==!1;E.useSyncExternalStore(E.useCallback(f=>m?b.subscribe(es.batchCalls(f)):Ds,[b,m]),()=>b.getCurrentResult(),()=>b.getCurrentResult()),E.useEffect(()=>{b.setQueries(c,t)},[c,t,b]);const Q=_.some((f,v)=>Es(c[v],f))?_.flatMap((f,v)=>{const u=c[v];if(u&&Es(u,f)){const D=new Os(a,u);return Ws(u,D,o)}return[]}):[];if(Q.length>0)throw Promise.all(Q);const C=_.find((f,v)=>{const u=c[v];return u&&Xs({result:f,errorResetBoundary:o,throwOnError:u.throwOnError,query:a.getQueryCache().get(u.queryHash),suspense:u.suspense})});if(C!=null&&C.error)throw C.error;return O(h())}const oe=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],le=n=>n==="trending"||n==="date_published"||n==="citation_count"?n:"trending",ss=3,W=2,ye=()=>{var hs,us,ms,ps,gs,bs,xs,fs,js,vs,ks,Ns,ys;const{taskSlug:n}=Hs(),t=Is(),[r,a]=Ks(),i=le(r.get("order_by")),o=e=>{const d=new URLSearchParams(r);d.set("order_by",e),a(d)},[c,b]=E.useState(!1),[_,O]=E.useState(()=>new Set),h=K({queryKey:["task",n],queryFn:()=>L.getTask(n),enabled:!!n,staleTime:10*60*1e3}),m=K({queryKey:["task-parents",(hs=h.data)==null?void 0:hs.id],queryFn:()=>L.getTaskParents(h.data.id),enabled:!!((us=h.data)!=null&&us.id),staleTime:10*60*1e3}),R=K({queryKey:["task-sisters",(ms=h.data)==null?void 0:ms.area_id,(ps=h.data)==null?void 0:ps.id],queryFn:()=>L.getTasks({area_id:Number(h.data.area_id),page_size:50,visible_only:!0}),enabled:!!((gs=h.data)!=null&&gs.area_id),staleTime:10*60*1e3}),Q=K({queryKey:["task-children",(bs=h.data)==null?void 0:bs.id],queryFn:()=>L.getTaskChildren(h.data.id,{page_size:50,visible_only:!0}),enabled:!!((xs=h.data)!=null&&xs.id),staleTime:10*60*1e3}),C=E.useMemo(()=>{var e;return((e=Q.data)==null?void 0:e.results)||[]},[Q.data]),f=K({queryKey:["task-datasets",(fs=h.data)==null?void 0:fs.id,!1,W],queryFn:()=>L.getDatasets({task_id:Number(h.data.id),page_size:100,ordering:"-paper_count",min_eval_count:W}),enabled:!!((js=h.data)!=null&&js.id),staleTime:10*60*1e3}),v=ce({queries:C.map(e=>({queryKey:["task-datasets",e.id,!1,W],queryFn:()=>L.getDatasets({task_id:Number(e.id),page_size:20,ordering:"-paper_count",min_eval_count:W}),staleTime:10*60*1e3}))}),u=ee({taskId:((vs=h.data)==null?void 0:vs.id)||"",page_size:12,order_by:i,order_dir:"desc",include_resources:!0,enabled:!!((ks=h.data)!=null&&ks.id)}),D=E.useMemo(()=>{var d;return(((d=u.data)==null?void 0:d.pages.flatMap(g=>g.results))||[]).map(se)},[u.data]),X=E.useMemo(()=>{var d;const e={};return(d=u.data)==null||d.pages.forEach(g=>g.results.forEach(j=>(j.methods||[]).forEach(w=>{const H=w.slug||w.id;e[H]||(e[H]={id:w.id,name:w.name,slug:w.slug||"",count:0}),e[H].count++}))),Object.values(e).sort((g,j)=>j.count-g.count).slice(0,8)},[u.data]),{targetRef:Qs,isIntersecting:cs}=te({rootMargin:"200px"});if(E.useEffect(()=>{cs&&u.hasNextPage&&!u.isFetchingNextPage&&u.fetchNextPage()},[cs,u.hasNextPage,u.isFetchingNextPage]),h.isLoading)return s.jsxs("div",{className:"page",children:[s.jsx(G,{className:"h-12 w-1/2 mb-4"}),s.jsx(G,{className:"h-6 w-1/3 mb-8"}),s.jsx(G,{className:"h-64 w-full"})]});if(h.error||!h.data)return s.jsx("div",{className:"page",children:s.jsx(ae,{variant:"destructive",children:s.jsx(re,{children:"Task not found."})})});const T=h.data,os=J(T.name,T.slug),ls=(((Ns=R.data)==null?void 0:Ns.results)||[]).filter(e=>e.id!==T.id),q=((ys=f.data)==null?void 0:ys.results)||[],Ts=C.some((e,d)=>{var j,w;return(((w=(j=v[d])==null?void 0:j.data)==null?void 0:w.results)||[]).length>0}),ds=q.length>0,Ps=(()=>{const e=new Set;return q.forEach(d=>e.add(d.id)),v.forEach(d=>{var g;return(((g=d.data)==null?void 0:g.results)||[]).forEach(j=>e.add(j.id))}),e.size})(),qs=e=>{O(d=>{const g=new Set(d);return g.has(e)?g.delete(e):g.add(e),g})};return s.jsxs("div",{className:"page",children:[s.jsxs("div",{className:"breadcrumb",children:[s.jsx(I,{to:"/",children:"Papers"}),s.jsx("span",{className:"sep",children:"/"}),s.jsx(I,{to:"/tasks",children:"Tasks"}),[...m.data||[]].reverse().map(e=>s.jsxs($s.Fragment,{children:[s.jsx("span",{className:"sep",children:"/"}),s.jsx(I,{to:`/tasks/${e.slug||e.id}`,children:J(e.name,e.slug)})]},e.id)),s.jsx("span",{className:"sep",children:"/"}),s.jsx("span",{style:{color:"var(--accent-text)"},children:T.name.toUpperCase()})]}),s.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:"TASK"}),s.jsx("h1",{className:"domain-mega-title",children:os}),T.description&&s.jsx("p",{className:"task-explainer",children:T.description}),s.jsxs("div",{className:"task-quickstats",children:[s.jsxs("span",{children:[s.jsx("span",{className:"num",children:(T.paper_count??0).toLocaleString()}),"PAPERS"]}),s.jsxs("span",{children:[s.jsx("span",{className:"num",children:Ps}),"BENCHMARKS"]}),s.jsxs("span",{children:[s.jsxs("span",{className:"num",children:[X.length,"+"]}),"METHODS USED"]})]}),s.jsxs("div",{className:"task-page-grid",style:{marginTop:28},children:[s.jsxs("div",{children:[ds&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"task-section-head",children:[s.jsx("div",{className:"task-section-eyebrow",children:"Leaderboards · click any"}),s.jsxs("div",{className:"task-section-title",children:["Benchmarks ",s.jsxs("span",{className:"meta",children:["[",q.length,"]"]})]})]}),(c?q:q.slice(0,5)).map((e,d)=>s.jsxs("div",{className:"bench-row",onClick:()=>t(`/benchmark/${e.slug||e.id}`),children:[s.jsx("div",{className:"bench-row-num",children:String(d+1).padStart(2,"0")}),s.jsxs("div",{className:"bench-row-main",children:[s.jsx("div",{className:"bench-row-name",children:e.name}),s.jsx("div",{className:"bench-row-sub",children:e.paper_count!=null&&s.jsxs("span",{children:[s.jsx("strong",{children:e.paper_count})," ENTRIES"]})})]}),s.jsx("div",{className:"bench-row-arrow",children:"→"})]},e.id)),q.length>5&&s.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>b(e=>!e),children:c?"− show top 5":`+ show ${q.length-5} more benchmarks`})]}),Ts&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"task-section-head",style:ds?{marginTop:36}:void 0,children:[s.jsx("div",{className:"task-section-eyebrow",children:"Benchmarks by capability"}),s.jsxs("div",{className:"task-section-title",children:["Subtasks ",s.jsxs("span",{className:"meta",children:["[",C.length,"]"]})]})]}),s.jsx("div",{className:"subtask-grid",children:C.map((e,d)=>{var Ss;const g=v[d],j=((Ss=g==null?void 0:g.data)==null?void 0:Ss.results)||[];if(j.length===0)return null;const w=_.has(e.id),H=w?j:j.slice(0,ss),Y=j.length-ss;return s.jsxs("div",{className:"subtask-section",children:[s.jsxs("div",{className:"subtask-head",children:[s.jsx(I,{to:`/tasks/${e.slug||e.id}`,className:"subtask-head-name",children:J(e.name,e.slug)}),s.jsxs("span",{className:"subtask-head-meta",children:["[",j.length," benchmark",j.length===1?"":"s","]"]})]}),H.map((B,Ms)=>s.jsxs("div",{className:"bench-row",onClick:()=>t(`/benchmark/${B.slug||B.id}`),children:[s.jsx("div",{className:"bench-row-num",children:String(Ms+1).padStart(2,"0")}),s.jsxs("div",{className:"bench-row-main",children:[s.jsx("div",{className:"bench-row-name",children:B.name}),s.jsx("div",{className:"bench-row-sub",children:B.paper_count!=null&&s.jsxs("span",{children:[s.jsx("strong",{children:B.paper_count})," ENTRIES"]})})]}),s.jsx("div",{className:"bench-row-arrow",children:"→"})]},B.id)),Y>0&&s.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>qs(e.id),children:w?`− show top ${ss}`:`+ show ${Y} more benchmark${Y===1?"":"s"}`})]},e.id)})})]}),s.jsxs("div",{className:"task-section-head",style:{marginTop:36},children:[s.jsx("div",{className:"task-section-eyebrow",children:"Top trending · sort below"}),s.jsxs("div",{className:"task-section-title",children:["Papers ",s.jsxs("span",{className:"meta",children:["[",(T.paper_count??0).toLocaleString(),"]"]})]})]}),s.jsxs("div",{className:"sort-bar",children:[s.jsx("div",{className:"sort-options",children:oe.map(([e,d])=>s.jsx("button",{className:`sort-btn ${i===e?"active":""}`,onClick:()=>o(e),children:d},e))}),s.jsxs("div",{className:"results-count",children:[D.length," loaded in ",s.jsx("span",{children:os})]})]}),u.isLoading?s.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((e,d)=>s.jsx(G,{className:"h-40 w-full"},d))}):D.length===0?s.jsx("div",{className:"no-results",children:"No papers in this task yet."}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"paper-list",children:D.map((e,d)=>s.jsx(Ys,{paper:e,rank:d+1},e.id))}),s.jsx("div",{ref:Qs,style:{height:1}}),u.isFetchingNextPage&&s.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]}),s.jsxs("aside",{className:"task-side",children:[ls.length>0&&s.jsxs("div",{className:"side-block",children:[s.jsx("div",{className:"side-block-num",children:"01/"}),s.jsx("div",{className:"side-block-label",children:"Sister Tasks"}),ls.slice(0,8).map(e=>s.jsxs(I,{to:`/tasks/${e.slug}`,className:"side-link-row",children:[s.jsx("span",{children:J(e.name,e.slug)}),e.paper_count!=null&&s.jsx("span",{className:"count",children:e.paper_count.toLocaleString()})]},e.id))]}),X.length>0&&s.jsxs("div",{className:"side-block",children:[s.jsx("div",{className:"side-block-num",children:"02/"}),s.jsx("div",{className:"side-block-label",children:"Common Methods"}),X.map(e=>s.jsxs("div",{className:"side-method-row",children:[s.jsx(Zs,{method:{slug:e.slug,name:e.name}}),s.jsxs("span",{className:"num",children:["·",e.count]})]},e.id))]})]})]})]})};export{ye as default};
assets/TagsIndexView-Brq1T4Wz.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{r as d,j as e,L as h}from"./index-BWQiUBNk.js";import{u as p}from"./useQuery-B941khzD.js";import{a as g}from"./api-BFeNcidM.js";import{f as x,h as f,d as u}from"./transform-DgWj1AQy.js";import{S as m}from"./skeleton-BuXiEBoy.js";import{A as j,a as y}from"./alert-DUe5ZsgM.js";import"./adminAuth-PI_XkM8E.js";const v=r=>(r==null?void 0:r.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",_=()=>{const r=p({queryKey:["areas-with-tasks"],queryFn:()=>g.getAreasWithTasks(),staleTime:6e5}),o=d.useMemo(()=>{if(!r.data)return[];const s={general:0,vision:1,video:2,language:3,audio:4,other:5},a=n=>s[v(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=d.useMemo(()=>o.reduce((s,a)=>s+a.tasks.length,0),[o]);return r.error?e.jsx("div",{className:"page",children:e.jsx(j,{variant:"destructive",children:e.jsx(y,{children:"Failed to load taxonomy. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Domains"})]}),e.jsx("div",{className:"feed-subtitle",children:"Browse research by area. Click any task to see trending work."})]})}),r.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((s,a)=>e.jsxs("div",{children:[e.jsx(m,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((n,t)=>e.jsx(m,{className:"h-24"},t))})]},a))}):o.map(s=>{const a=s.tasks;if(a.length===0)return null;const n=a.reduce((t,i)=>t+(i.paper_count||0),0);return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:s.name}),s.description&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:s.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[a.length," ",a.length===1?"task":"tasks"," · ",n.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:a.map(t=>{const i=t.slug||"",l=x(f(i));return e.jsxs(h,{to:`/tasks/${i}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:l.dot}}),u(t.name,i)]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(t.paper_count??0).toLocaleString()," papers"]})})]},t.id)})})]},s.id)}),c>0&&e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[c," tasks across ",o.filter(s=>s.tasks.length>0).length," areas."]})]})};export{_ as default};
assets/TagsIndexView-CWaR8sEU.js DELETED
@@ -1 +0,0 @@
1
- import{r as m,j as e,L as g}from"./index-BcdJ5r4Y.js";import{u as f}from"./adminAuth-CijC1LpP.js";import{a as x}from"./api-DVAIDRP9.js";import{f as u,h as j,d as y}from"./transform-Dasg-XFy.js";import{A as v,a as k,S as h}from"./alert-BfBSxmdQ.js";const p=new Set(["few-shot-image-classification","object-counting","open-vocabulary-object-detection","other"]),c=a=>(a==null?void 0:a.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",N=a=>p.has(c(a.name))||p.has(c(a.slug)),T=()=>{const a=f({queryKey:["areas-with-tasks"],queryFn:()=>x.getAreasWithTasks(),staleTime:6e5}),o=m.useMemo(()=>{if(!a.data)return[];const t={general:0,vision:1,video:2,language:3,audio:4,"time-series":5},r=i=>t[c(i)]??999;return a.data.results.map(i=>({...i,tasks:i.tasks.filter(s=>!N(s))})).sort((i,s)=>{const n=r(i.name),l=r(s.name);return n!==l?n-l:i.name.localeCompare(s.name)})},[a.data]),d=m.useMemo(()=>o.reduce((t,r)=>t+r.tasks.length,0),[o]);return a.error?e.jsx("div",{className:"page",children:e.jsx(v,{variant:"destructive",children:e.jsx(k,{children:"Failed to load taxonomy. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Domains"})]}),e.jsx("div",{className:"feed-subtitle",children:"Browse research by area. Click any task to see trending work."})]})}),a.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((t,r)=>e.jsxs("div",{children:[e.jsx(h,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((i,s)=>e.jsx(h,{className:"h-24"},s))})]},r))}):o.map(t=>{const r=t.tasks;if(r.length===0)return null;const i=r.reduce((s,n)=>s+(n.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:t.name}),t.description&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:t.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[r.length," ",r.length===1?"task":"tasks"," · ",i.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:r.map(s=>{const n=s.slug||"",l=u(j(n));return e.jsxs(g,{to:`/tasks/${n}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:l.dot}}),y(s.name,n)]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(s.paper_count??0).toLocaleString()," papers"]})})]},s.id)})})]},t.id)}),d>0&&e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[d," tasks across ",o.filter(t=>t.tasks.length>0).length," areas."]})]})};export{T as default};
 
 
assets/adminAuth-CijC1LpP.js DELETED
@@ -1 +0,0 @@
1
- var mt=e=>{throw TypeError(e)};var Z=(e,t,s)=>t.has(e)||mt("Cannot "+s);var i=(e,t,s)=>(Z(e,t,"read from private field"),s?s.call(e):t.get(e)),p=(e,t,s)=>t.has(e)?mt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),u=(e,t,s,r)=>(Z(e,t,"write to private field"),r?r.call(e,s):t.set(e,s),s),l=(e,t,s)=>(Z(e,t,"access private method"),s);import{S as _t,_ as gt,$ as S,s as q,a0 as j,b as tt,a1 as et,a2 as vt,a3 as Mt,a4 as Y,a5 as Qt,a6 as xt,a7 as Rt,n as wt,r as w,c as It,a as Dt}from"./index-BcdJ5r4Y.js";var g,n,H,m,Q,U,C,O,W,P,N,x,D,T,k,a,B,st,it,rt,nt,at,ot,ht,Ot,Ct,Ft=(Ct=class extends _t{constructor(t,s){super();p(this,a);p(this,g);p(this,n);p(this,H);p(this,m);p(this,Q);p(this,U);p(this,C);p(this,O);p(this,W);p(this,P);p(this,N);p(this,x);p(this,D);p(this,T);p(this,k,new Set);this.options=s,u(this,g,t),u(this,O,null),u(this,C,gt()),this.bindMethods(),this.setOptions(s)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(i(this,n).addObserver(this),St(i(this,n),this.options)?l(this,a,B).call(this):this.updateResult(),l(this,a,nt).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ct(i(this,n),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ct(i(this,n),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,l(this,a,at).call(this),l(this,a,ot).call(this),i(this,n).removeObserver(this)}setOptions(t){const s=this.options,r=i(this,n);if(this.options=i(this,g).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof S(this.options.enabled,i(this,n))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");l(this,a,ht).call(this),i(this,n).setOptions(this.options),s._defaulted&&!q(this.options,s)&&i(this,g).getQueryCache().notify({type:"observerOptionsUpdated",query:i(this,n),observer:this});const o=this.hasListeners();o&&yt(i(this,n),r,this.options,s)&&l(this,a,B).call(this),this.updateResult(),o&&(i(this,n)!==r||S(this.options.enabled,i(this,n))!==S(s.enabled,i(this,n))||j(this.options.staleTime,i(this,n))!==j(s.staleTime,i(this,n)))&&l(this,a,st).call(this);const h=l(this,a,it).call(this);o&&(i(this,n)!==r||S(this.options.enabled,i(this,n))!==S(s.enabled,i(this,n))||h!==i(this,T))&&l(this,a,rt).call(this,h)}getOptimisticResult(t){const s=i(this,g).getQueryCache().build(i(this,g),t),r=this.createResult(s,t);return Pt(this,r)&&(u(this,m,r),u(this,U,this.options),u(this,Q,i(this,n).state)),r}getCurrentResult(){return i(this,m)}trackResult(t,s){return new Proxy(t,{get:(r,o)=>(this.trackProp(o),s==null||s(o),o==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&i(this,C).status==="pending"&&i(this,C).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,o))})}trackProp(t){i(this,k).add(t)}getCurrentQuery(){return i(this,n)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const s=i(this,g).defaultQueryOptions(t),r=i(this,g).getQueryCache().build(i(this,g),s);return r.fetch().then(()=>this.createResult(r,s))}fetch(t){return l(this,a,B).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),i(this,m)))}createResult(t,s){var pt;const r=i(this,n),o=this.options,h=i(this,m),c=i(this,Q),y=i(this,U),b=t!==r?t.state:i(this,H),{state:E}=t;let d={...E},_=!1,f;if(s._optimisticResults){const R=this.hasListeners(),L=!R&&St(t,s),K=R&&yt(t,r,s,o);(L||K)&&(d={...d,...xt(E.data,t.options)}),s._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:M,errorUpdatedAt:A,status:v}=d;f=d.data;let z=!1;if(s.placeholderData!==void 0&&f===void 0&&v==="pending"){let R;h!=null&&h.isPlaceholderData&&s.placeholderData===(y==null?void 0:y.placeholderData)?(R=h.data,z=!0):R=typeof s.placeholderData=="function"?s.placeholderData((pt=i(this,N))==null?void 0:pt.state.data,i(this,N)):s.placeholderData,R!==void 0&&(v="success",f=Rt(h==null?void 0:h.data,R,s),_=!0)}if(s.select&&f!==void 0&&!z)if(h&&f===(c==null?void 0:c.data)&&s.select===i(this,W))f=i(this,P);else try{u(this,W,s.select),f=s.select(f),f=Rt(h==null?void 0:h.data,f,s),u(this,P,f),u(this,O,null)}catch(R){u(this,O,R)}i(this,O)&&(M=i(this,O),f=i(this,P),A=Date.now(),v="error");const $=d.fetchStatus==="fetching",J=v==="pending",X=v==="error",dt=J&&$,ft=f!==void 0,I={status:v,fetchStatus:d.fetchStatus,isPending:J,isSuccess:v==="success",isError:X,isInitialLoading:dt,isLoading:dt,data:f,dataUpdatedAt:d.dataUpdatedAt,error:M,errorUpdatedAt:A,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:d.dataUpdateCount>b.dataUpdateCount||d.errorUpdateCount>b.errorUpdateCount,isFetching:$,isRefetching:$&&!J,isLoadingError:X&&!ft,isPaused:d.fetchStatus==="paused",isPlaceholderData:_,isRefetchError:X&&ft,isStale:lt(t,s),refetch:this.refetch,promise:i(this,C),isEnabled:S(s.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const R=I.data!==void 0,L=I.status==="error"&&!R,K=G=>{L?G.reject(I.error):R&&G.resolve(I.data)},bt=()=>{const G=u(this,C,I.promise=gt());K(G)},V=i(this,C);switch(V.status){case"pending":t.queryHash===r.queryHash&&K(V);break;case"fulfilled":(L||I.data!==V.value)&&bt();break;case"rejected":(!L||I.error!==V.reason)&&bt();break}}return I}updateResult(){const t=i(this,m),s=this.createResult(i(this,n),this.options);if(u(this,Q,i(this,n).state),u(this,U,this.options),i(this,Q).data!==void 0&&u(this,N,i(this,n)),q(s,t))return;u(this,m,s);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,h=typeof o=="function"?o():o;if(h==="all"||!h&&!i(this,k).size)return!0;const c=new Set(h??i(this,k));return this.options.throwOnError&&c.add("error"),Object.keys(i(this,m)).some(y=>{const F=y;return i(this,m)[F]!==t[F]&&c.has(F)})};l(this,a,Ot).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&l(this,a,nt).call(this)}},g=new WeakMap,n=new WeakMap,H=new WeakMap,m=new WeakMap,Q=new WeakMap,U=new WeakMap,C=new WeakMap,O=new WeakMap,W=new WeakMap,P=new WeakMap,N=new WeakMap,x=new WeakMap,D=new WeakMap,T=new WeakMap,k=new WeakMap,a=new WeakSet,B=function(t){l(this,a,ht).call(this);let s=i(this,n).fetch(this.options,t);return t!=null&&t.throwOnError||(s=s.catch(tt)),s},st=function(){l(this,a,at).call(this);const t=j(this.options.staleTime,i(this,n));if(et.isServer()||i(this,m).isStale||!vt(t))return;const r=Mt(i(this,m).dataUpdatedAt,t)+1;u(this,x,Y.setTimeout(()=>{i(this,m).isStale||this.updateResult()},r))},it=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(i(this,n)):this.options.refetchInterval)??!1},rt=function(t){l(this,a,ot).call(this),u(this,T,t),!(et.isServer()||S(this.options.enabled,i(this,n))===!1||!vt(i(this,T))||i(this,T)===0)&&u(this,D,Y.setInterval(()=>{(this.options.refetchIntervalInBackground||Qt.isFocused())&&l(this,a,B).call(this)},i(this,T)))},nt=function(){l(this,a,st).call(this),l(this,a,rt).call(this,l(this,a,it).call(this))},at=function(){i(this,x)!==void 0&&(Y.clearTimeout(i(this,x)),u(this,x,void 0))},ot=function(){i(this,D)!==void 0&&(Y.clearInterval(i(this,D)),u(this,D,void 0))},ht=function(){const t=i(this,g).getQueryCache().build(i(this,g),this.options);if(t===i(this,n))return;const s=i(this,n);u(this,n,t),u(this,H,t.state),this.hasListeners()&&(s==null||s.removeObserver(this),t.addObserver(this))},Ot=function(t){wt.batch(()=>{t.listeners&&this.listeners.forEach(s=>{s(i(this,m))}),i(this,g).getQueryCache().notify({query:i(this,n),type:"observerResultsUpdated"})})},Ct);function Ut(e,t){return S(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&S(t.retryOnMount,e)===!1)}function St(e,t){return Ut(e,t)||e.state.data!==void 0&&ct(e,t,t.refetchOnMount)}function ct(e,t,s){if(S(t.enabled,e)!==!1&&j(t.staleTime,e)!=="static"){const r=typeof s=="function"?s(e):s;return r==="always"||r!==!1&&lt(e,t)}return!1}function yt(e,t,s,r){return(e!==t||S(r.enabled,e)===!1)&&(!s.suspense||e.state.status!=="error")&&lt(e,s)}function lt(e,t){return S(t.enabled,e)!==!1&&e.isStaleByTime(j(t.staleTime,e))}function Pt(e,t){return!q(e.getCurrentResult(),t)}var Tt=w.createContext(!1),Nt=()=>w.useContext(Tt);Tt.Provider;function kt(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var At=w.createContext(kt()),Lt=()=>w.useContext(At),Bt=(e,t,s)=>{const r=s!=null&&s.state.error&&typeof e.throwOnError=="function"?It(e.throwOnError,[s.state.error,s]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},jt=e=>{w.useEffect(()=>{e.clearReset()},[e])},Ht=({result:e,errorResetBoundary:t,throwOnError:s,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||It(s,[e.error,r])),Wt=e=>{if(e.suspense){const s=o=>o==="static"?o:Math.max(o??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...o)=>s(r(...o)):s(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},zt=(e,t)=>e.isLoading&&e.isFetching&&!t,Kt=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Et=(e,t,s)=>t.fetchOptimistic(e).catch(()=>{s.clearReset()});function Vt(e,t,s){var _,f,M,A;const r=Nt(),o=Lt(),h=Dt(),c=h.defaultQueryOptions(e);(f=(_=h.getDefaultOptions().queries)==null?void 0:_._experimental_beforeQuery)==null||f.call(_,c);const y=h.getQueryCache().get(c.queryHash);c._optimisticResults=r?"isRestoring":"optimistic",Wt(c),Bt(c,o,y),jt(o);const F=!h.getQueryCache().get(c.queryHash),[b]=w.useState(()=>new t(h,c)),E=b.getOptimisticResult(c),d=!r&&e.subscribed!==!1;if(w.useSyncExternalStore(w.useCallback(v=>{const z=d?b.subscribe(wt.batchCalls(v)):tt;return b.updateResult(),z},[b,d]),()=>b.getCurrentResult(),()=>b.getCurrentResult()),w.useEffect(()=>{b.setOptions(c)},[c,b]),Kt(c,E))throw Et(c,b,o);if(Ht({result:E,errorResetBoundary:o,throwOnError:c.throwOnError,query:y,suspense:c.suspense}))throw E.error;if((A=(M=h.getDefaultOptions().queries)==null?void 0:M._experimental_afterQuery)==null||A.call(M,c,E),c.experimental_prefetchInRender&&!et.isServer()&&zt(E,r)){const v=F?Et(c,b,o):y==null?void 0:y.promise;v==null||v.catch(tt).finally(()=>{b.updateResult()})}return c.notifyOnChangeProps?E:b.trackResult(E)}function Jt(e,t){return Vt(e,Ft)}const ut="cronAdminToken";function Xt(){var e;return typeof window>"u"?"":((e=window.localStorage.getItem(ut))==null?void 0:e.trim())??""}function Zt(e){if(typeof window>"u")return;const t=e.trim();t?window.localStorage.setItem(ut,t):window.localStorage.removeItem(ut)}export{Ft as Q,Nt as a,Lt as b,Bt as c,jt as d,Wt as e,Et as f,Ht as g,Vt as h,Zt as i,Xt as j,Kt as s,Jt as u};
 
 
assets/adminAuth-PI_XkM8E.js ADDED
@@ -0,0 +1 @@
 
 
1
+ const n="cronAdminToken";function t(){var e;return typeof window>"u"?"":((e=window.localStorage.getItem(n))==null?void 0:e.trim())??""}function i(e){if(typeof window>"u")return;const o=e.trim();o?window.localStorage.setItem(n,o):window.localStorage.removeItem(n)}export{t as g,i as s};
assets/alert-BfBSxmdQ.js DELETED
@@ -1 +0,0 @@
1
- import{j as r,o as s,r as d,U as i}from"./index-BcdJ5r4Y.js";function g({className:e,...t}){return r.jsx("div",{className:s("animate-pulse rounded-md bg-muted",e),...t})}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=d.forwardRef(({className:e,variant:t,...a},l)=>r.jsx("div",{ref:l,role:"alert",className:s(o({variant:t}),e),...a}));n.displayName="Alert";const c=d.forwardRef(({className:e,...t},a)=>r.jsx("h5",{ref:a,className:s("mb-1 font-medium leading-none tracking-tight",e),...t}));c.displayName="AlertTitle";const u=d.forwardRef(({className:e,...t},a)=>r.jsx("div",{ref:a,className:s("text-sm [&_p]:leading-relaxed",e),...t}));u.displayName="AlertDescription";export{n as A,g as S,u as a};
 
 
assets/alert-DUe5ZsgM.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{r as a,j as s,h as l,_ as i}from"./index-BWQiUBNk.js";const o=i("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),n=a.forwardRef(({className:e,variant:t,...r},d)=>s.jsx("div",{ref:d,role:"alert",className:l(o({variant:t}),e),...r}));n.displayName="Alert";const v=a.forwardRef(({className:e,...t},r)=>s.jsx("h5",{ref:r,className:l("mb-1 font-medium leading-none tracking-tight",e),...t}));v.displayName="AlertTitle";const c=a.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:l("text-sm [&_p]:leading-relaxed",e),...t}));c.displayName="AlertDescription";export{n as A,c as a};
assets/api-BFeNcidM.js ADDED
@@ -0,0 +1 @@
 
 
1
+ var y=Object.defineProperty;var b=(g,e,t)=>e in g?y(g,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):g[e]=t;var s=(g,e,t)=>b(g,typeof e!="symbol"?e+"":e,t);import{g as P}from"./adminAuth-PI_XkM8E.js";import{w as l,a2 as k}from"./index-BWQiUBNk.js";const $=`${k()}/api/v1`,f=!1;class q{constructor(e=$){s(this,"baseUrl");this.baseUrl=e}async request(e,t){const i=`${this.baseUrl}${e}`;try{const{headers:o,...d}=t??{},u=P(),S=(d.method??"GET").toUpperCase()==="GET"?"default":"no-store",c=await fetch(i,{...d,cache:d.cache??S,credentials:d.credentials??"include",headers:{"Content-Type":"application/json",...u?{"X-Admin-Token":u}:{},...o}});if(!c.ok){const h=await c.text();console.error("[API] Error response:",h),c.status===401&&typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:auth-stale"));const _=new Error(`API request failed: ${c.status} ${c.statusText}`);throw _.status=c.status,_.statusText=c.statusText,_.response=h,_}return c.status===204?void 0:await c.json()}catch(o){throw console.error(`[API] Request to ${i} failed:`,o),o}}async getPapers(e){const t=new URLSearchParams;e!=null&&e.page&&t.append("page",e.page.toString()),e!=null&&e.page_size&&t.append("page_size",e.page_size.toString()),e!=null&&e.search&&t.append("search",e.search),e!=null&&e.order_by&&t.append("order_by",e.order_by),e!=null&&e.order_dir&&t.append("order_dir",e.order_dir),e!=null&&e.time&&t.append("time",e.time),e!=null&&e.published_after&&t.append("published_after",e.published_after),e!=null&&e.published_before&&t.append("published_before",e.published_before),e!=null&&e.conference&&t.append("conference",e.conference),(e==null?void 0:e.latest_only)!==void 0&&t.append("latest_only",e.latest_only.toString()),(e==null?void 0:e.include_resources)!==void 0&&t.append("include_resources",e.include_resources.toString());const i=`/papers/${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}async searchPapers(e,t=10){const i=new URLSearchParams;return i.append("q",e),i.append("limit",t.toString()),this.request(`/papers/search?${i.toString()}`)}async getPaper(e,t=!0){const i=`/papers/${e}${t?"?include_resources=true":""}`;return this.request(i)}async getPaperByArxivId(e,t=!0){const i=`/papers/arxiv/${e}${t?"?include_resources=true":""}`;return this.request(i)}async indexPaperFromArxiv(e){const t=`/papers/index/${e}`;return this.request(t,{method:"POST"})}async submitPaper(e){return this.request("/papers/submit",{method:"POST",body:JSON.stringify(e)})}async updatePaperTasks(e,t){const i=new URLSearchParams;t.forEach(d=>i.append("task_ids",d.toString()));const o=`/papers/${e}/tasks?${i.toString()}`;return this.request(o,{method:"PUT"})}async updatePaperMethods(e,t){const i=new URLSearchParams;t.forEach(d=>i.append("method_ids",d.toString()));const o=`/papers/${e}/methods?${i.toString()}`;return this.request(o,{method:"PUT"})}async updatePaperRepositories(e,t){const i=`/papers/${e}/repositories`;return this.request(i,{method:"PUT",body:JSON.stringify({repositories:t})})}async updatePaperProjectPages(e,t){const i=`/papers/${e}/project-pages`;return this.request(i,{method:"PUT",body:JSON.stringify({project_pages:t})})}async getTrendingPapers(e){const t=new URLSearchParams;e!=null&&e.limit&&t.append("limit",e.limit.toString()),e!=null&&e.max_age_days&&t.append("max_age_days",e.max_age_days.toString()),(e==null?void 0:e.min_velocity)!==void 0&&t.append("min_velocity",e.min_velocity.toString());const i=`/papers/trending${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}async getRepositoriesForPaper(e){return this.request(`/papers/${e}/repositories`)}async getRepositories(e){const t=new URLSearchParams;e!=null&&e.page&&t.append("page",e.page.toString()),e!=null&&e.page_size&&t.append("page_size",e.page_size.toString()),e!=null&&e.owner&&t.append("owner",e.owner),e!=null&&e.official_only&&t.append("official_only",e.official_only.toString()),e!=null&&e.min_stars&&t.append("min_stars",e.min_stars.toString()),e!=null&&e.source&&t.append("source",e.source),e!=null&&e.order_by&&t.append("order_by",e.order_by),e!=null&&e.order_dir&&t.append("order_dir",e.order_dir);const i=`/repositories/${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}async getProjectPagesForPaper(e){return this.request(`/papers/${e}/project-pages`)}async getProjectPages(e){const t=new URLSearchParams;e!=null&&e.page&&t.append("page",e.page.toString()),e!=null&&e.page_size&&t.append("page_size",e.page_size.toString()),e!=null&&e.official_only&&t.append("official_only",e.official_only.toString()),e!=null&&e.source&&t.append("source",e.source),e!=null&&e.order_by&&t.append("order_by",e.order_by),e!=null&&e.order_dir&&t.append("order_dir",e.order_dir);const i=`/project-pages/${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}async getAuthors(e){const t=new URLSearchParams;e!=null&&e.limit&&t.append("limit",e.limit.toString()),e!=null&&e.offset&&t.append("offset",e.offset.toString()),e!=null&&e.search&&t.append("search",e.search),e!=null&&e.sort_by&&t.append("sort_by",e.sort_by),e!=null&&e.sort_order&&t.append("sort_order",e.sort_order);const i=`/authors${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}async getAuthor(e){return this.request(`/authors/${e}`)}async getAreas(e){const t=new URLSearchParams;e!=null&&e.page&&t.append("page",e.page.toString()),e!=null&&e.page_size&&t.append("page_size",e.page_size.toString()),e!=null&&e.q&&t.append("q",e.q),e!=null&&e.name&&t.append("name",e.name),e!=null&&e.ordering&&t.append("ordering",e.ordering);const i=`/areas/${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}async getArea(e){return this.request(`/areas/${e}`)}async getAreasWithTasks(){return this.request("/areas/with-tasks/")}async getAreaTasks(e,t){const i=new URLSearchParams;t!=null&&t.page&&i.append("page",t.page.toString()),t!=null&&t.page_size&&i.append("page_size",t.page_size.toString());const o=`/areas/${e}/tasks${i.toString()?`?${i.toString()}`:""}`;return this.request(o)}async getTasks(e){const t=new URLSearchParams;e!=null&&e.page&&t.append("page",e.page.toString()),e!=null&&e.page_size&&t.append("page_size",e.page_size.toString()),e!=null&&e.q&&t.append("q",e.q),e!=null&&e.name&&t.append("name",e.name),e!=null&&e.area_id&&t.append("area_id",e.area_id.toString()),e!=null&&e.parent_id&&t.append("parent_id",e.parent_id.toString()),(e==null?void 0:e.level)!==void 0&&t.append("level",e.level.toString()),e!=null&&e.visible_only&&t.append("visible_only","true"),e!=null&&e.ordering&&t.append("ordering",e.ordering);const i=`/tasks/${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}async getTask(e){return this.request(`/tasks/${e}`)}async getTopTasks(e){const t=new URLSearchParams;e!=null&&e.limit&&t.append("limit",e.limit.toString());const i=t.toString(),o=i?`/tasks/top?${i}`:"/tasks/top";return this.request(o)}async getTrendingTasks(e){const t=new URLSearchParams;e!=null&&e.limit&&t.append("limit",e.limit.toString()),e!=null&&e.recent_days&&t.append("recent_days",e.recent_days.toString()),e!=null&&e.baseline_days&&t.append("baseline_days",e.baseline_days.toString()),(e==null?void 0:e.level)!==void 0&&t.append("level",e.level.toString()),(e==null?void 0:e.min_recent_papers)!==void 0&&t.append("min_recent_papers",e.min_recent_papers.toString()),(e==null?void 0:e.min_baseline_papers)!==void 0&&t.append("min_baseline_papers",e.min_baseline_papers.toString()),(e==null?void 0:e.min_share_lift)!==void 0&&t.append("min_share_lift",e.min_share_lift.toString());const i=t.toString(),o=i?`/tasks/trending?${i}`:"/tasks/trending";return this.request(o)}async getTaskChildren(e,t){const i=new URLSearchParams;t!=null&&t.page&&i.append("page",t.page.toString()),t!=null&&t.page_size&&i.append("page_size",t.page_size.toString()),t!=null&&t.visible_only&&i.append("visible_only","true");const o=`/tasks/${e}/children${i.toString()?`?${i.toString()}`:""}`;return this.request(o)}async getTaskParents(e){return this.request(`/tasks/${e}/parents`)}async getTaskPapers(e,t){const i=new URLSearchParams;t!=null&&t.page&&i.append("page",t.page.toString()),t!=null&&t.page_size&&i.append("page_size",t.page_size.toString()),t!=null&&t.order_by&&i.append("order_by",t.order_by),t!=null&&t.order_dir&&i.append("order_dir",t.order_dir),(t==null?void 0:t.latest_only)!==void 0&&i.append("latest_only",t.latest_only.toString()),(t==null?void 0:t.include_resources)!==void 0&&i.append("include_resources",t.include_resources.toString());const o=i.toString(),d=o?`/tasks/${e}/papers?${o}`:`/tasks/${e}/papers`;return this.request(d)}async getMethods(e){const t=new URLSearchParams;e!=null&&e.page&&t.append("page",e.page.toString()),e!=null&&e.page_size&&t.append("page_size",e.page_size.toString()),e!=null&&e.q&&t.append("q",e.q),e!=null&&e.name&&t.append("name",e.name),e!=null&&e.full_name&&t.append("full_name",e.full_name),e!=null&&e.introduced_year&&t.append("introduced_year",e.introduced_year.toString()),(e==null?void 0:e.area_id)!==void 0&&t.append("area_id",e.area_id.toString()),(e==null?void 0:e.exclude_id)!==void 0&&t.append("exclude_id",e.exclude_id.toString()),e!=null&&e.ordering&&t.append("ordering",e.ordering);const i=`/methods/${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}async getMethod(e){return this.request(`/methods/${encodeURIComponent(e)}`)}async getMethodPapers(e,t){const i=new URLSearchParams;t!=null&&t.page&&i.append("page",t.page.toString()),t!=null&&t.page_size&&i.append("page_size",t.page_size.toString()),t!=null&&t.order_by&&i.append("order_by",t.order_by),t!=null&&t.order_dir&&i.append("order_dir",t.order_dir),(t==null?void 0:t.latest_only)!==void 0&&i.append("latest_only",t.latest_only.toString()),(t==null?void 0:t.include_resources)!==void 0&&i.append("include_resources",t.include_resources.toString());const o=i.toString(),d=o?`/methods/${encodeURIComponent(e)}/papers?${o}`:`/methods/${encodeURIComponent(e)}/papers`;return this.request(d)}async getDatasets(e){const t=new URLSearchParams;e!=null&&e.page&&t.append("page",e.page.toString()),e!=null&&e.page_size&&t.append("page_size",e.page_size.toString()),e!=null&&e.q&&t.append("q",e.q),e!=null&&e.name&&t.append("name",e.name),e!=null&&e.full_name&&t.append("full_name",e.full_name),e!=null&&e.task&&t.append("task",e.task),e!=null&&e.task_id&&t.append("task",e.task_id.toString()),e!=null&&e.include_descendants&&t.append("include_descendants","true"),(e==null?void 0:e.min_eval_count)!==void 0&&t.append("min_eval_count",e.min_eval_count.toString()),e!=null&&e.ordering&&t.append("ordering",e.ordering);const i=`/datasets/${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}async getDataset(e){return this.request(`/datasets/${e}`)}async getDatasetBySlug(e,t){const i=t!=null&&t.include_paper?"?include_paper=true":"";return this.request(`/datasets/${e}${i}`)}async getDatasetTasks(e){return(await this.request(`/datasets/${e}/tasks/`)).results}async getEvaluations(e){const t=new URLSearchParams;e!=null&&e.page&&t.append("page",e.page.toString()),e!=null&&e.page_size&&t.append("page_size",e.page_size.toString()),e!=null&&e.q&&t.append("q",e.q),e!=null&&e.paper_id&&t.append("paper_id",e.paper_id.toString()),e!=null&&e.task_id&&t.append("task_id",e.task_id.toString()),e!=null&&e.include_descendants&&t.append("include_descendants","true"),e!=null&&e.dataset_id&&t.append("dataset_id",e.dataset_id.toString()),e!=null&&e.best_metric&&t.append("best_metric",e.best_metric),e!=null&&e.ordering&&t.append("ordering",e.ordering);const i=`/evaluations/${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}async getEvaluation(e){return this.request(`/evaluations/${e}`)}async getEvaluationsByPaper(e){const i=parseInt(e),o=await this.getEvaluations({paper_id:i,page_size:100,ordering:"-benchmark_popularity"}),d=[...o.results];let u=o.next_page;for(;u;){const r=await this.getEvaluations({paper_id:i,page:u,page_size:100,ordering:"-benchmark_popularity"});d.push(...r.results),u=r.next_page}return d}async getEvaluationsByDataset(e,t){return(await this.getEvaluations({dataset_id:parseInt(e),best_metric:t,page_size:100,ordering:"best_rank"})).results}async createEvaluation(e){return this.request("/evaluations/",{method:"POST",body:JSON.stringify(e)})}async updateEvaluation(e,t){const i=`/evaluations/${e}`;return this.request(i,{method:"PUT",body:JSON.stringify(t)})}async deleteEvaluation(e){const t=`/evaluations/${e}`;return this.request(t,{method:"DELETE"})}async generateThumbnail(e){const t=l(`/api/thumbnails/generate/${e}`),i=await fetch(t,{method:"POST"});if(!i.ok)throw new Error(`Thumbnail generation failed: ${i.status}`);return await i.json()}async getThumbnailStatus(e){const t=l(`/api/thumbnails/status/${e}`),i=await fetch(t);if(!i.ok)throw new Error(`Thumbnail status check failed: ${i.status}`);return await i.json()}async healthCheck(){const e=l("/health"),t=await fetch(e);if(!t.ok)throw new Error(`Health check failed: ${t.status}`);return await t.json()}async getMetrics(e){const t=new URLSearchParams;e!=null&&e.page&&t.append("page",e.page.toString()),e!=null&&e.page_size&&t.append("page_size",e.page_size.toString()),e!=null&&e.q&&t.append("q",e.q),e!=null&&e.direction&&t.append("direction",e.direction),e!=null&&e.ordering&&t.append("ordering",e.ordering);const i=`/metrics/${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}async getMetric(e){return this.request(`/metrics/${e}`)}async getMetricDirections(){return this.request("/metrics/directions")}async getMyBookmarkIds(){return this.request("/me/bookmarks/ids")}async getMyBookmarks(){return this.request("/me/bookmarks")}async addBookmark(e){await this.request(`/me/bookmarks/${e}`,{method:"POST"})}async removeBookmark(e){await this.request(`/me/bookmarks/${e}`,{method:"DELETE"})}}const n=new q;n.getPapers.bind(n);n.getPaper.bind(n);n.getPaperByArxivId.bind(n);const E=n.indexPaperFromArxiv.bind(n),U=n.submitPaper.bind(n),R=n.updatePaperTasks.bind(n),A=n.updatePaperMethods.bind(n),x=n.updatePaperRepositories.bind(n),L=n.updatePaperProjectPages.bind(n);n.getTrendingPapers.bind(n);n.getRepositoriesForPaper.bind(n);n.getRepositories.bind(n);n.getProjectPagesForPaper.bind(n);n.getProjectPages.bind(n);n.getAuthors.bind(n);n.getAuthor.bind(n);n.getAreas.bind(n);n.getArea.bind(n);n.getAreasWithTasks.bind(n);n.getAreaTasks.bind(n);const M=n.getTasks.bind(n);n.getTask.bind(n);n.getTopTasks.bind(n);n.getTrendingTasks.bind(n);n.getTaskChildren.bind(n);n.getTaskParents.bind(n);n.getTaskPapers.bind(n);const B=n.getMethods.bind(n);n.getMethod.bind(n);n.getMethodPapers.bind(n);const j=n.getDatasets.bind(n);n.getDataset.bind(n);n.getDatasetBySlug.bind(n);n.getDatasetTasks.bind(n);n.getEvaluations.bind(n);n.getEvaluation.bind(n);const D=n.getEvaluationsByPaper.bind(n);n.getEvaluationsByDataset.bind(n);const C=n.createEvaluation.bind(n),O=n.updateEvaluation.bind(n),I=n.deleteEvaluation.bind(n);n.generateThumbnail.bind(n);n.getThumbnailStatus.bind(n);n.getMetrics.bind(n);n.getMetric.bind(n);n.getMetricDirections.bind(n);n.healthCheck.bind(n);n.getMyBookmarkIds.bind(n);n.getMyBookmarks.bind(n);n.addBookmark.bind(n);n.removeBookmark.bind(n);export{n as a,M as b,A as c,B as d,x as e,L as f,D as g,I as h,C as i,O as j,j as k,E as l,U as s,R as u};
assets/api-DVAIDRP9.js DELETED
@@ -1 +0,0 @@
1
- var y=Object.defineProperty;var b=(g,e,t)=>e in g?y(g,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):g[e]=t;var s=(g,e,t)=>b(g,typeof e!="symbol"?e+"":e,t);import{j as P}from"./adminAuth-CijC1LpP.js";import{E as h,Z as k}from"./index-BcdJ5r4Y.js";const $=`${k()}/api/v1`,f=!1;class q{constructor(e=$){s(this,"baseUrl");this.baseUrl=e}async request(e,t){const i=`${this.baseUrl}${e}`;try{const{headers:o,...d}=t??{},u=P(),S=(d.method??"GET").toUpperCase()==="GET"?"default":"no-store",c=await fetch(i,{...d,cache:d.cache??S,credentials:d.credentials??"include",headers:{"Content-Type":"application/json",...u?{"X-Admin-Token":u}:{},...o}});if(!c.ok){const l=await c.text();console.error("[API] Error response:",l),c.status===401&&typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:auth-stale"));const _=new Error(`API request failed: ${c.status} ${c.statusText}`);throw _.status=c.status,_.statusText=c.statusText,_.response=l,_}return c.status===204?void 0:await c.json()}catch(o){throw console.error(`[API] Request to ${i} failed:`,o),o}}async getPapers(e){const t=new URLSearchParams;e!=null&&e.page&&t.append("page",e.page.toString()),e!=null&&e.page_size&&t.append("page_size",e.page_size.toString()),e!=null&&e.search&&t.append("search",e.search),e!=null&&e.order_by&&t.append("order_by",e.order_by),e!=null&&e.order_dir&&t.append("order_dir",e.order_dir),e!=null&&e.time&&t.append("time",e.time),e!=null&&e.published_after&&t.append("published_after",e.published_after),e!=null&&e.published_before&&t.append("published_before",e.published_before),e!=null&&e.conference&&t.append("conference",e.conference),(e==null?void 0:e.latest_only)!==void 0&&t.append("latest_only",e.latest_only.toString()),(e==null?void 0:e.include_resources)!==void 0&&t.append("include_resources",e.include_resources.toString());const i=`/papers/${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}async searchPapers(e,t=10){const i=new URLSearchParams;return i.append("q",e),i.append("limit",t.toString()),this.request(`/papers/search?${i.toString()}`)}async getPaper(e,t=!0){const i=`/papers/${e}${t?"?include_resources=true":""}`;return this.request(i)}async getPaperByArxivId(e,t=!0){const i=`/papers/arxiv/${e}${t?"?include_resources=true":""}`;return this.request(i)}async indexPaperFromArxiv(e){const t=`/papers/index/${e}`;return this.request(t,{method:"POST"})}async updatePaperTasks(e,t){const i=new URLSearchParams;t.forEach(d=>i.append("task_ids",d.toString()));const o=`/papers/${e}/tasks?${i.toString()}`;return this.request(o,{method:"PUT"})}async updatePaperMethods(e,t){const i=new URLSearchParams;t.forEach(d=>i.append("method_ids",d.toString()));const o=`/papers/${e}/methods?${i.toString()}`;return this.request(o,{method:"PUT"})}async updatePaperRepositories(e,t){const i=`/papers/${e}/repositories`;return this.request(i,{method:"PUT",body:JSON.stringify({repositories:t})})}async updatePaperProjectPages(e,t){const i=`/papers/${e}/project-pages`;return this.request(i,{method:"PUT",body:JSON.stringify({project_pages:t})})}async getTrendingPapers(e){const t=new URLSearchParams;e!=null&&e.limit&&t.append("limit",e.limit.toString()),e!=null&&e.max_age_days&&t.append("max_age_days",e.max_age_days.toString()),(e==null?void 0:e.min_velocity)!==void 0&&t.append("min_velocity",e.min_velocity.toString());const i=`/papers/trending${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}async getRepositoriesForPaper(e){return this.request(`/papers/${e}/repositories`)}async getRepositories(e){const t=new URLSearchParams;e!=null&&e.page&&t.append("page",e.page.toString()),e!=null&&e.page_size&&t.append("page_size",e.page_size.toString()),e!=null&&e.owner&&t.append("owner",e.owner),e!=null&&e.official_only&&t.append("official_only",e.official_only.toString()),e!=null&&e.min_stars&&t.append("min_stars",e.min_stars.toString()),e!=null&&e.source&&t.append("source",e.source),e!=null&&e.order_by&&t.append("order_by",e.order_by),e!=null&&e.order_dir&&t.append("order_dir",e.order_dir);const i=`/repositories/${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}async getProjectPagesForPaper(e){return this.request(`/papers/${e}/project-pages`)}async getProjectPages(e){const t=new URLSearchParams;e!=null&&e.page&&t.append("page",e.page.toString()),e!=null&&e.page_size&&t.append("page_size",e.page_size.toString()),e!=null&&e.official_only&&t.append("official_only",e.official_only.toString()),e!=null&&e.source&&t.append("source",e.source),e!=null&&e.order_by&&t.append("order_by",e.order_by),e!=null&&e.order_dir&&t.append("order_dir",e.order_dir);const i=`/project-pages/${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}async getAuthors(e){const t=new URLSearchParams;e!=null&&e.limit&&t.append("limit",e.limit.toString()),e!=null&&e.offset&&t.append("offset",e.offset.toString()),e!=null&&e.search&&t.append("search",e.search),e!=null&&e.sort_by&&t.append("sort_by",e.sort_by),e!=null&&e.sort_order&&t.append("sort_order",e.sort_order);const i=`/authors${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}async getAuthor(e){return this.request(`/authors/${e}`)}async getAreas(e){const t=new URLSearchParams;e!=null&&e.page&&t.append("page",e.page.toString()),e!=null&&e.page_size&&t.append("page_size",e.page_size.toString()),e!=null&&e.q&&t.append("q",e.q),e!=null&&e.name&&t.append("name",e.name),e!=null&&e.ordering&&t.append("ordering",e.ordering);const i=`/areas/${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}async getArea(e){return this.request(`/areas/${e}`)}async getAreasWithTasks(){return this.request("/areas/with-tasks/")}async getAreaTasks(e,t){const i=new URLSearchParams;t!=null&&t.page&&i.append("page",t.page.toString()),t!=null&&t.page_size&&i.append("page_size",t.page_size.toString());const o=`/areas/${e}/tasks${i.toString()?`?${i.toString()}`:""}`;return this.request(o)}async getTasks(e){const t=new URLSearchParams;e!=null&&e.page&&t.append("page",e.page.toString()),e!=null&&e.page_size&&t.append("page_size",e.page_size.toString()),e!=null&&e.q&&t.append("q",e.q),e!=null&&e.name&&t.append("name",e.name),e!=null&&e.area_id&&t.append("area_id",e.area_id.toString()),e!=null&&e.parent_id&&t.append("parent_id",e.parent_id.toString()),(e==null?void 0:e.level)!==void 0&&t.append("level",e.level.toString()),e!=null&&e.ordering&&t.append("ordering",e.ordering);const i=`/tasks/${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}async getTask(e){return this.request(`/tasks/${e}`)}async getTopTasks(e){const t=new URLSearchParams;e!=null&&e.limit&&t.append("limit",e.limit.toString());const i=t.toString(),o=i?`/tasks/top?${i}`:"/tasks/top";return this.request(o)}async getTrendingTasks(e){const t=new URLSearchParams;e!=null&&e.limit&&t.append("limit",e.limit.toString()),e!=null&&e.recent_days&&t.append("recent_days",e.recent_days.toString()),e!=null&&e.baseline_days&&t.append("baseline_days",e.baseline_days.toString()),(e==null?void 0:e.level)!==void 0&&t.append("level",e.level.toString()),(e==null?void 0:e.min_recent_papers)!==void 0&&t.append("min_recent_papers",e.min_recent_papers.toString()),(e==null?void 0:e.min_baseline_papers)!==void 0&&t.append("min_baseline_papers",e.min_baseline_papers.toString()),(e==null?void 0:e.min_share_lift)!==void 0&&t.append("min_share_lift",e.min_share_lift.toString());const i=t.toString(),o=i?`/tasks/trending?${i}`:"/tasks/trending";return this.request(o)}async getTaskChildren(e,t){const i=new URLSearchParams;t!=null&&t.page&&i.append("page",t.page.toString()),t!=null&&t.page_size&&i.append("page_size",t.page_size.toString());const o=`/tasks/${e}/children${i.toString()?`?${i.toString()}`:""}`;return this.request(o)}async getTaskParents(e){return this.request(`/tasks/${e}/parents`)}async getTaskPapers(e,t){const i=new URLSearchParams;t!=null&&t.page&&i.append("page",t.page.toString()),t!=null&&t.page_size&&i.append("page_size",t.page_size.toString()),t!=null&&t.order_by&&i.append("order_by",t.order_by),t!=null&&t.order_dir&&i.append("order_dir",t.order_dir),(t==null?void 0:t.latest_only)!==void 0&&i.append("latest_only",t.latest_only.toString()),(t==null?void 0:t.include_resources)!==void 0&&i.append("include_resources",t.include_resources.toString());const o=i.toString(),d=o?`/tasks/${e}/papers?${o}`:`/tasks/${e}/papers`;return this.request(d)}async getMethods(e){const t=new URLSearchParams;e!=null&&e.page&&t.append("page",e.page.toString()),e!=null&&e.page_size&&t.append("page_size",e.page_size.toString()),e!=null&&e.q&&t.append("q",e.q),e!=null&&e.name&&t.append("name",e.name),e!=null&&e.full_name&&t.append("full_name",e.full_name),e!=null&&e.introduced_year&&t.append("introduced_year",e.introduced_year.toString()),(e==null?void 0:e.area_id)!==void 0&&t.append("area_id",e.area_id.toString()),(e==null?void 0:e.exclude_id)!==void 0&&t.append("exclude_id",e.exclude_id.toString()),e!=null&&e.ordering&&t.append("ordering",e.ordering);const i=`/methods/${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}async getMethod(e){return this.request(`/methods/${encodeURIComponent(e)}`)}async getMethodPapers(e,t){const i=new URLSearchParams;t!=null&&t.page&&i.append("page",t.page.toString()),t!=null&&t.page_size&&i.append("page_size",t.page_size.toString()),t!=null&&t.order_by&&i.append("order_by",t.order_by),t!=null&&t.order_dir&&i.append("order_dir",t.order_dir),(t==null?void 0:t.latest_only)!==void 0&&i.append("latest_only",t.latest_only.toString()),(t==null?void 0:t.include_resources)!==void 0&&i.append("include_resources",t.include_resources.toString());const o=i.toString(),d=o?`/methods/${encodeURIComponent(e)}/papers?${o}`:`/methods/${encodeURIComponent(e)}/papers`;return this.request(d)}async getDatasets(e){const t=new URLSearchParams;e!=null&&e.page&&t.append("page",e.page.toString()),e!=null&&e.page_size&&t.append("page_size",e.page_size.toString()),e!=null&&e.q&&t.append("q",e.q),e!=null&&e.name&&t.append("name",e.name),e!=null&&e.full_name&&t.append("full_name",e.full_name),e!=null&&e.task&&t.append("task",e.task),e!=null&&e.task_id&&t.append("task",e.task_id.toString()),e!=null&&e.include_descendants&&t.append("include_descendants","true"),(e==null?void 0:e.min_eval_count)!==void 0&&t.append("min_eval_count",e.min_eval_count.toString()),e!=null&&e.ordering&&t.append("ordering",e.ordering);const i=`/datasets/${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}async getDataset(e){return this.request(`/datasets/${e}`)}async getDatasetBySlug(e,t){const i=t!=null&&t.include_paper?"?include_paper=true":"";return this.request(`/datasets/${e}${i}`)}async getDatasetTasks(e){return(await this.request(`/datasets/${e}/tasks/`)).results}async getEvaluations(e){const t=new URLSearchParams;e!=null&&e.page&&t.append("page",e.page.toString()),e!=null&&e.page_size&&t.append("page_size",e.page_size.toString()),e!=null&&e.q&&t.append("q",e.q),e!=null&&e.paper_id&&t.append("paper_id",e.paper_id.toString()),e!=null&&e.task_id&&t.append("task_id",e.task_id.toString()),e!=null&&e.include_descendants&&t.append("include_descendants","true"),e!=null&&e.dataset_id&&t.append("dataset_id",e.dataset_id.toString()),e!=null&&e.best_metric&&t.append("best_metric",e.best_metric),e!=null&&e.ordering&&t.append("ordering",e.ordering);const i=`/evaluations/${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}async getEvaluation(e){return this.request(`/evaluations/${e}`)}async getEvaluationsByPaper(e){const i=parseInt(e),o=await this.getEvaluations({paper_id:i,page_size:100,ordering:"-benchmark_popularity"}),d=[...o.results];let u=o.next_page;for(;u;){const r=await this.getEvaluations({paper_id:i,page:u,page_size:100,ordering:"-benchmark_popularity"});d.push(...r.results),u=r.next_page}return d}async getEvaluationsByDataset(e,t){return(await this.getEvaluations({dataset_id:parseInt(e),best_metric:t,page_size:100,ordering:"best_rank"})).results}async createEvaluation(e){return this.request("/evaluations/",{method:"POST",body:JSON.stringify(e)})}async updateEvaluation(e,t){const i=`/evaluations/${e}`;return this.request(i,{method:"PUT",body:JSON.stringify(t)})}async deleteEvaluation(e){const t=`/evaluations/${e}`;return this.request(t,{method:"DELETE"})}async generateThumbnail(e){const t=h(`/api/thumbnails/generate/${e}`),i=await fetch(t,{method:"POST"});if(!i.ok)throw new Error(`Thumbnail generation failed: ${i.status}`);return await i.json()}async getThumbnailStatus(e){const t=h(`/api/thumbnails/status/${e}`),i=await fetch(t);if(!i.ok)throw new Error(`Thumbnail status check failed: ${i.status}`);return await i.json()}async healthCheck(){const e=h("/health"),t=await fetch(e);if(!t.ok)throw new Error(`Health check failed: ${t.status}`);return await t.json()}async getMetrics(e){const t=new URLSearchParams;e!=null&&e.page&&t.append("page",e.page.toString()),e!=null&&e.page_size&&t.append("page_size",e.page_size.toString()),e!=null&&e.q&&t.append("q",e.q),e!=null&&e.direction&&t.append("direction",e.direction),e!=null&&e.ordering&&t.append("ordering",e.ordering);const i=`/metrics/${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}async getMetric(e){return this.request(`/metrics/${e}`)}async getMetricDirections(){return this.request("/metrics/directions")}async getMyBookmarkIds(){return this.request("/me/bookmarks/ids")}async getMyBookmarks(){return this.request("/me/bookmarks")}async addBookmark(e){await this.request(`/me/bookmarks/${e}`,{method:"POST"})}async removeBookmark(e){await this.request(`/me/bookmarks/${e}`,{method:"DELETE"})}}const n=new q;n.getPapers.bind(n);n.getPaper.bind(n);n.getPaperByArxivId.bind(n);const E=n.indexPaperFromArxiv.bind(n),U=n.updatePaperTasks.bind(n),R=n.updatePaperMethods.bind(n),A=n.updatePaperRepositories.bind(n),x=n.updatePaperProjectPages.bind(n);n.getTrendingPapers.bind(n);n.getRepositoriesForPaper.bind(n);n.getRepositories.bind(n);n.getProjectPagesForPaper.bind(n);n.getProjectPages.bind(n);n.getAuthors.bind(n);n.getAuthor.bind(n);n.getAreas.bind(n);n.getArea.bind(n);n.getAreasWithTasks.bind(n);n.getAreaTasks.bind(n);const L=n.getTasks.bind(n);n.getTask.bind(n);n.getTopTasks.bind(n);n.getTrendingTasks.bind(n);n.getTaskChildren.bind(n);n.getTaskParents.bind(n);n.getTaskPapers.bind(n);const M=n.getMethods.bind(n);n.getMethod.bind(n);n.getMethodPapers.bind(n);const j=n.getDatasets.bind(n);n.getDataset.bind(n);n.getDatasetBySlug.bind(n);n.getDatasetTasks.bind(n);n.getEvaluations.bind(n);n.getEvaluation.bind(n);const B=n.getEvaluationsByPaper.bind(n);n.getEvaluationsByDataset.bind(n);const D=n.createEvaluation.bind(n),C=n.updateEvaluation.bind(n),I=n.deleteEvaluation.bind(n);n.generateThumbnail.bind(n);n.getThumbnailStatus.bind(n);n.getMetrics.bind(n);n.getMetric.bind(n);n.getMetricDirections.bind(n);n.healthCheck.bind(n);n.getMyBookmarkIds.bind(n);n.getMyBookmarks.bind(n);n.addBookmark.bind(n);n.removeBookmark.bind(n);export{n as a,L as b,R as c,M as d,A as e,x as f,B as g,I as h,D as i,C as j,j as k,E as l,U as u};
 
 
assets/badge-Buw8W5Kz.js DELETED
@@ -1,11 +0,0 @@
1
- import{d as a,r as i,j as n,V as f,o as s,U as d}from"./index-BcdJ5r4Y.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 x=a("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
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 y=a("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),g=d("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),b=i.forwardRef(({className:e,variant:r,size:t,asChild:o=!1,...u},c)=>{const l=o?f:"button";return n.jsx(l,{className:s(g({variant:r,size:t,className:e})),ref:c,...u})});b.displayName="Button";const p=i.forwardRef(({className:e,type:r,...t},o)=>n.jsx("input",{type:r,className:s("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:o,...t}));p.displayName="Input";const v=d("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function h({className:e,variant:r,...t}){return n.jsx("div",{className:s(v({variant:r}),e),...t})}export{b as B,x as D,p as I,y as L,h as a};
 
 
 
 
 
 
 
 
 
 
 
 
assets/badge-Ds2a6Q8t.js ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import{c as e,j as o,h as s,_ as n}from"./index-BWQiUBNk.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 c=e("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
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 u=e("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),d=n("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function l({className:r,variant:t,...a}){return o.jsx("div",{className:s(d({variant:t}),r),...a})}export{l as B,c as D,u as L};
assets/{components-MYNA0qNJ.js → components-BT6ZBgQl.js} RENAMED
@@ -1 +1 @@
1
- import{a as z,A as y,j as t,L as C,H as w}from"./index-BcdJ5r4Y.js";import{L as S}from"./LatexTitle-_7AiBIQK.js";import{h as H,d as P,g as R,f as T}from"./transform-Dasg-XFy.js";import{a as A}from"./api-DVAIDRP9.js";const E=({slug:e,label:s,onClick:r})=>{const o=w(),d=H(e),n=T(d),u=x=>{if(x.stopPropagation(),r){r(e);return}o(`/tasks/${e}`)};return t.jsxs("span",{className:"tag-chip",style:{background:n.bg,color:n.text},onClick:u,children:[t.jsx("span",{className:"dot",style:{background:n.dot}}),P(s||R(e),e)]})},G=({method:e,onClick:s})=>{const r=w(),o=e.slug||e.id||"";if(!o)return null;const d=n=>{if(n.stopPropagation(),s){s(o);return}r(`/methods/${o}`)};return t.jsx("span",{className:"method-chip",onClick:d,children:e.name})},I=({name:e,size:s=14})=>{const r={search:t.jsx("path",{d:"M11 11l3 3M7 12.5a5.5 5.5 0 110-11 5.5 5.5 0 010 11z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),arrowUp:t.jsx("path",{d:"M8 3l5 6H3l5-6z",fill:"currentColor"}),arrowLeft:t.jsx("path",{d:"M9 3l-4 5 4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),arrowRight:t.jsx("path",{d:"M7 3l4 5-4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),external:t.jsx("path",{d:"M5 3h-2v8h8v-2M9 3h3v3M7 9l5-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),github:t.jsx("path",{d:"M8 1a7 7 0 00-2.21 13.64c.35.06.48-.15.48-.34v-1.2c-1.95.42-2.36-.94-2.36-.94-.32-.81-.78-1.03-.78-1.03-.64-.43.05-.43.05-.43.7.05 1.07.72 1.07.72.62 1.07 1.64.76 2.04.58.06-.45.24-.76.44-.94-1.55-.18-3.18-.78-3.18-3.46 0-.76.27-1.39.72-1.88-.07-.18-.31-.89.07-1.86 0 0 .59-.19 1.92.72.56-.15 1.16-.23 1.75-.24.59 0 1.19.08 1.75.24 1.33-.9 1.92-.72 1.92-.72.38.97.14 1.68.07 1.86.45.49.72 1.12.72 1.88 0 2.69-1.64 3.28-3.19 3.45.25.22.48.65.48 1.32v1.95c0 .19.13.41.49.34A7 7 0 008 1z",fill:"currentColor"}),citation:t.jsx("path",{d:"M3 4h3v3H3zM4 7v1.5a1.5 1.5 0 01-1.5 1.5M9 4h3v3H9zM10 7v1.5a1.5 1.5 0 01-1.5 1.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none"}),bookmark:t.jsx("path",{d:"M4 2h8v12l-4-3-4 3V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),chart:t.jsx("path",{d:"M2 13h12M3 11l3-4 3 2 4-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),chat:t.jsx("path",{d:"M3 3h10v7H7l-3 3v-3H3V3z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),pdf:t.jsx("path",{d:"M5 2h5l3 3v9H5V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),copy:t.jsx("path",{d:"M5 5h7v8H5V5zM3 3h7v2M3 3v8h2",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinejoin:"round"}),sparkle:t.jsx("path",{d:"M8 2l1.2 3.8L13 7l-3.8 1.2L8 12l-1.2-3.8L3 7l3.8-1.2L8 2z",fill:"currentColor"}),user:t.jsx("path",{d:"M8 8a3 3 0 100-6 3 3 0 000 6zM2 14c0-3 2.5-5 6-5s6 2 6 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),globe:t.jsx("path",{d:"M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM1.5 8h13M8 1.5c1.7 1.9 2.6 4.2 2.6 6.5s-.9 4.6-2.6 6.5M8 1.5C6.3 3.4 5.4 5.7 5.4 8s.9 4.6 2.6 6.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinecap:"round"}),menu:t.jsx("path",{d:"M2 4h12M2 8h12M2 12h12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),close:t.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})};return t.jsx("svg",{className:s===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:s,height:s,children:r[e]})},B=e=>{let s=2166136261;for(let r=0;r<e.length;r++)s=Math.imul(s^e.charCodeAt(r),16777619);return()=>(s=Math.imul(s^s>>>15,2246822507),s=Math.imul(s^s>>>13,3266489909),s^=s>>>16,(s>>>0)%1e4/1e4)},U=({paperId:e})=>{const s=B(e),r=160,o=220,d=[.85+s()*.1,.55+s()*.25],n=.45+s()*.3,u=[],x=9+Math.floor(s()*3);for(let c=0;c<x;c++)u.push(.55+s()*.4);const h=s()>.3,g=Math.floor(s()*3),k=[],M=6+Math.floor(s()*3);for(let c=0;c<M;c++)k.push(.5+s()*.45);const v="#9A9588",m="#3A352D",i=5,j=(r-i*2-2)/2,N=i,a=i+j+2;let f=i+2;const $=f;f+=6;const W=f+1;f+=5;const F=f;f+=3;const l=f+1;return t.jsx("div",{style:{width:r,height:o,background:"#FDFCF9",border:"1px solid var(--hairline-strong)",borderRadius:2,boxShadow:"0 1px 0 rgba(0,0,0,0.04), 0 4px 8px -4px rgba(0,0,0,0.08)",flexShrink:0,overflow:"hidden",position:"relative"},children:t.jsxs("svg",{width:r,height:o,viewBox:`0 0 ${r} ${o}`,style:{display:"block"},children:[d.map((c,p)=>t.jsx("rect",{x:i+(r-i*2)*(1-c)/2,y:$+p*2.4,width:(r-i*2)*c,height:1.4,fill:m,rx:.3},`t${p}`)),t.jsx("rect",{x:i+(r-i*2)*(1-n)/2,y:W,width:(r-i*2)*n,height:.9,fill:v,opacity:.7,rx:.2}),t.jsx("rect",{x:i,y:F,width:6,height:1,fill:m,opacity:.6}),u.map((c,p)=>{const b=l+p*2.1;return b>o-i-1?null:t.jsx("rect",{x:N,y:b,width:j*c,height:.8,fill:v,opacity:.55,rx:.2},`l${p}`)}),h&&t.jsxs("g",{children:[t.jsx("rect",{x:a,y:l,width:j,height:14,fill:"#F0EBE0",stroke:v,strokeWidth:.3,opacity:.9}),g===0&&t.jsx("g",{stroke:m,strokeWidth:.4,fill:"none",opacity:.6,children:t.jsx("polyline",{points:`${a+2},${l+11} ${a+6},${l+8} ${a+10},${l+9} ${a+14},${l+5} ${a+18},${l+6} ${a+22},${l+3}`})}),g===1&&t.jsxs("g",{opacity:.55,children:[t.jsx("circle",{cx:a+j/2,cy:l+7,r:3.5,fill:m}),t.jsx("rect",{x:a+2,y:l+11,width:j-4,height:1.5,fill:v})]}),g===2&&t.jsxs("g",{opacity:.55,children:[t.jsx("rect",{x:a+3,y:l+5,width:j-6,height:1,fill:m}),t.jsx("rect",{x:a+6,y:l+8,width:j-12,height:.8,fill:m})]})]}),k.map((c,p)=>{const b=l+(h?16:0)+p*2.1;return b>o-i-1?null:t.jsx("rect",{x:a,y:b,width:j*c,height:.8,fill:v,opacity:.55,rx:.2},`r${p}`)})]})})},V=({paperId:e,title:s,thumbnailUrl:r,priority:o=!1})=>{const[d,n]=y.useState(!1),[u,x]=y.useState(o),h=y.useRef(null);return y.useEffect(()=>{if(o||u)return;const g=h.current;if(!g)return;const k=new IntersectionObserver(([M])=>{M.isIntersecting&&(x(!0),k.disconnect())},{rootMargin:"250px"});return k.observe(g),()=>k.disconnect()},[o,u]),r&&!d?t.jsx("div",{ref:h,style:{width:160,height:220,background:"#FDFCF9",border:"1px solid var(--hairline-strong)",borderRadius:2,boxShadow:"0 1px 0 rgba(0,0,0,0.04), 0 4px 8px -4px rgba(0,0,0,0.08)",flexShrink:0,overflow:"hidden",position:"relative"},children:u&&t.jsx("img",{src:r,alt:`Thumbnail for ${s}`,loading:o?"eager":"lazy",decoding:"async",fetchPriority:o?"high":"auto",style:{width:"100%",height:"100%",objectFit:"contain",display:"block"},onError:()=>n(!0)})}):t.jsx(U,{paperId:e})},K=({paper:e,rank:s,onClickTag:r})=>{const o=z(),d=`/paper/${e.id}`,n=y.useCallback(()=>{o.prefetchQuery({queryKey:["paper-arxiv",e.id],queryFn:()=>A.getPaperByArxivId(e.id,!0),staleTime:10*60*1e3})},[e.id,o]),u=e.authors.slice(0,3).join(", "),x=e.authors.length;return t.jsxs("article",{className:"paper-card",children:[s!=null&&t.jsx(C,{to:d,className:"paper-thumb-wrap",onFocus:n,onMouseEnter:n,children:t.jsx(V,{paperId:e.id,title:e.title,thumbnailUrl:e.thumbnailUrl,priority:s<=3})}),t.jsxs("div",{className:"paper-body",children:[t.jsxs("div",{className:"paper-body-main",children:[t.jsx("h3",{className:"paper-title",children:t.jsx(C,{to:d,onFocus:n,onMouseEnter:n,children:t.jsx(S,{title:e.title})})}),t.jsxs("div",{className:"paper-authors",children:[u,x>3&&t.jsxs("span",{children:[", ","+",x-3," authors"]}),e.date&&t.jsxs(t.Fragment,{children:[x>0?" · ":"",t.jsx("span",{children:e.date})]}),e.citations>0&&t.jsxs(t.Fragment,{children:[x>0||e.date?" · ":"",t.jsxs("span",{children:[e.citations.toLocaleString()," citations"]})]})]}),e.abstract&&t.jsx("p",{className:"paper-abstract",children:e.abstract}),e.tags.length>0&&t.jsx("div",{className:"paper-tags",children:e.tags.map(h=>t.jsx(E,{slug:h,onClick:r},h))})]}),e.github!=null&&(()=>{const h=t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"gh-stat-block",children:[t.jsxs("div",{className:"gh-value-row",children:[t.jsx(I,{name:"github",size:12}),t.jsx("span",{className:"gh-stars",children:L(e.github)})]}),t.jsx("div",{className:"gh-stars-label",children:"stars"})]}),e.velocity24h!=null&&e.velocity24h>0&&t.jsxs("div",{className:"gh-stat-block",children:[t.jsxs("div",{className:"gh-value-row",children:[t.jsx("span",{className:"gh-rate-arrow",children:"↑"}),t.jsx("span",{className:"gh-rate",children:q(e.velocity24h)})]}),t.jsx("div",{className:"gh-stars-label",children:"stars / hr"})]})]});return e.githubUrl?t.jsx("a",{className:"paper-github-stats is-link",href:e.githubUrl,target:"_blank",rel:"noopener noreferrer","aria-label":`Open GitHub repository (${L(e.github)} stars)`,onClick:g=>g.stopPropagation(),children:h}):t.jsx("aside",{className:"paper-github-stats",children:h})})()]})]})};function L(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function q(e){return e.toFixed(1)}export{I,G as M,K as P,E as T};
 
1
+ import{p as z,t as y,j as t,L as C,y as w}from"./index-BWQiUBNk.js";import{L as S}from"./LatexTitle-Ckdd_TrR.js";import{h as P,d as H,g as R,f as T}from"./transform-DgWj1AQy.js";import{a as E}from"./api-BFeNcidM.js";const A=({slug:e,label:s,onClick:r})=>{const o=w(),d=P(e),n=T(d),u=x=>{if(x.stopPropagation(),r){r(e);return}o(`/tasks/${e}`)};return t.jsxs("span",{className:"tag-chip",style:{background:n.bg,color:n.text},onClick:u,children:[t.jsx("span",{className:"dot",style:{background:n.dot}}),H(s||R(e),e)]})},G=({method:e,onClick:s})=>{const r=w(),o=e.slug||e.id||"";if(!o)return null;const d=n=>{if(n.stopPropagation(),s){s(o);return}r(`/methods/${o}`)};return t.jsx("span",{className:"method-chip",onClick:d,children:e.name})},I=({name:e,size:s=14})=>{const r={search:t.jsx("path",{d:"M11 11l3 3M7 12.5a5.5 5.5 0 110-11 5.5 5.5 0 010 11z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),arrowUp:t.jsx("path",{d:"M8 3l5 6H3l5-6z",fill:"currentColor"}),arrowLeft:t.jsx("path",{d:"M9 3l-4 5 4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),arrowRight:t.jsx("path",{d:"M7 3l4 5-4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),external:t.jsx("path",{d:"M5 3h-2v8h8v-2M9 3h3v3M7 9l5-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),github:t.jsx("path",{d:"M8 1a7 7 0 00-2.21 13.64c.35.06.48-.15.48-.34v-1.2c-1.95.42-2.36-.94-2.36-.94-.32-.81-.78-1.03-.78-1.03-.64-.43.05-.43.05-.43.7.05 1.07.72 1.07.72.62 1.07 1.64.76 2.04.58.06-.45.24-.76.44-.94-1.55-.18-3.18-.78-3.18-3.46 0-.76.27-1.39.72-1.88-.07-.18-.31-.89.07-1.86 0 0 .59-.19 1.92.72.56-.15 1.16-.23 1.75-.24.59 0 1.19.08 1.75.24 1.33-.9 1.92-.72 1.92-.72.38.97.14 1.68.07 1.86.45.49.72 1.12.72 1.88 0 2.69-1.64 3.28-3.19 3.45.25.22.48.65.48 1.32v1.95c0 .19.13.41.49.34A7 7 0 008 1z",fill:"currentColor"}),citation:t.jsx("path",{d:"M3 4h3v3H3zM4 7v1.5a1.5 1.5 0 01-1.5 1.5M9 4h3v3H9zM10 7v1.5a1.5 1.5 0 01-1.5 1.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none"}),bookmark:t.jsx("path",{d:"M4 2h8v12l-4-3-4 3V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),chart:t.jsx("path",{d:"M2 13h12M3 11l3-4 3 2 4-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),chat:t.jsx("path",{d:"M3 3h10v7H7l-3 3v-3H3V3z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),pdf:t.jsx("path",{d:"M5 2h5l3 3v9H5V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),copy:t.jsx("path",{d:"M5 5h7v8H5V5zM3 3h7v2M3 3v8h2",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinejoin:"round"}),sparkle:t.jsx("path",{d:"M8 2l1.2 3.8L13 7l-3.8 1.2L8 12l-1.2-3.8L3 7l3.8-1.2L8 2z",fill:"currentColor"}),user:t.jsx("path",{d:"M8 8a3 3 0 100-6 3 3 0 000 6zM2 14c0-3 2.5-5 6-5s6 2 6 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),globe:t.jsx("path",{d:"M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM1.5 8h13M8 1.5c1.7 1.9 2.6 4.2 2.6 6.5s-.9 4.6-2.6 6.5M8 1.5C6.3 3.4 5.4 5.7 5.4 8s.9 4.6 2.6 6.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinecap:"round"}),menu:t.jsx("path",{d:"M2 4h12M2 8h12M2 12h12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),close:t.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})};return t.jsx("svg",{className:s===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:s,height:s,children:r[e]})},B=e=>{let s=2166136261;for(let r=0;r<e.length;r++)s=Math.imul(s^e.charCodeAt(r),16777619);return()=>(s=Math.imul(s^s>>>15,2246822507),s=Math.imul(s^s>>>13,3266489909),s^=s>>>16,(s>>>0)%1e4/1e4)},U=({paperId:e})=>{const s=B(e),r=160,o=220,d=[.85+s()*.1,.55+s()*.25],n=.45+s()*.3,u=[],x=9+Math.floor(s()*3);for(let c=0;c<x;c++)u.push(.55+s()*.4);const h=s()>.3,g=Math.floor(s()*3),k=[],M=6+Math.floor(s()*3);for(let c=0;c<M;c++)k.push(.5+s()*.45);const v="#9A9588",m="#3A352D",i=5,j=(r-i*2-2)/2,N=i,a=i+j+2;let f=i+2;const $=f;f+=6;const W=f+1;f+=5;const F=f;f+=3;const l=f+1;return t.jsx("div",{style:{width:r,height:o,background:"#FDFCF9",border:"1px solid var(--hairline-strong)",borderRadius:2,boxShadow:"0 1px 0 rgba(0,0,0,0.04), 0 4px 8px -4px rgba(0,0,0,0.08)",flexShrink:0,overflow:"hidden",position:"relative"},children:t.jsxs("svg",{width:r,height:o,viewBox:`0 0 ${r} ${o}`,style:{display:"block"},children:[d.map((c,p)=>t.jsx("rect",{x:i+(r-i*2)*(1-c)/2,y:$+p*2.4,width:(r-i*2)*c,height:1.4,fill:m,rx:.3},`t${p}`)),t.jsx("rect",{x:i+(r-i*2)*(1-n)/2,y:W,width:(r-i*2)*n,height:.9,fill:v,opacity:.7,rx:.2}),t.jsx("rect",{x:i,y:F,width:6,height:1,fill:m,opacity:.6}),u.map((c,p)=>{const b=l+p*2.1;return b>o-i-1?null:t.jsx("rect",{x:N,y:b,width:j*c,height:.8,fill:v,opacity:.55,rx:.2},`l${p}`)}),h&&t.jsxs("g",{children:[t.jsx("rect",{x:a,y:l,width:j,height:14,fill:"#F0EBE0",stroke:v,strokeWidth:.3,opacity:.9}),g===0&&t.jsx("g",{stroke:m,strokeWidth:.4,fill:"none",opacity:.6,children:t.jsx("polyline",{points:`${a+2},${l+11} ${a+6},${l+8} ${a+10},${l+9} ${a+14},${l+5} ${a+18},${l+6} ${a+22},${l+3}`})}),g===1&&t.jsxs("g",{opacity:.55,children:[t.jsx("circle",{cx:a+j/2,cy:l+7,r:3.5,fill:m}),t.jsx("rect",{x:a+2,y:l+11,width:j-4,height:1.5,fill:v})]}),g===2&&t.jsxs("g",{opacity:.55,children:[t.jsx("rect",{x:a+3,y:l+5,width:j-6,height:1,fill:m}),t.jsx("rect",{x:a+6,y:l+8,width:j-12,height:.8,fill:m})]})]}),k.map((c,p)=>{const b=l+(h?16:0)+p*2.1;return b>o-i-1?null:t.jsx("rect",{x:a,y:b,width:j*c,height:.8,fill:v,opacity:.55,rx:.2},`r${p}`)})]})})},V=({paperId:e,title:s,thumbnailUrl:r,priority:o=!1})=>{const[d,n]=y.useState(!1),[u,x]=y.useState(o),h=y.useRef(null);return y.useEffect(()=>{if(o||u)return;const g=h.current;if(!g)return;const k=new IntersectionObserver(([M])=>{M.isIntersecting&&(x(!0),k.disconnect())},{rootMargin:"250px"});return k.observe(g),()=>k.disconnect()},[o,u]),r&&!d?t.jsx("div",{ref:h,style:{width:160,height:220,background:"#FDFCF9",border:"1px solid var(--hairline-strong)",borderRadius:2,boxShadow:"0 1px 0 rgba(0,0,0,0.04), 0 4px 8px -4px rgba(0,0,0,0.08)",flexShrink:0,overflow:"hidden",position:"relative"},children:u&&t.jsx("img",{src:r,alt:`Thumbnail for ${s}`,loading:o?"eager":"lazy",decoding:"async",fetchPriority:o?"high":"auto",style:{width:"100%",height:"100%",objectFit:"contain",display:"block"},onError:()=>n(!0)})}):t.jsx(U,{paperId:e})},K=({paper:e,rank:s,onClickTag:r})=>{const o=z(),d=`/paper/${e.id}`,n=y.useCallback(()=>{o.prefetchQuery({queryKey:["paper-arxiv",e.id],queryFn:()=>E.getPaperByArxivId(e.id,!0),staleTime:10*60*1e3})},[e.id,o]),u=e.authors.slice(0,3).join(", "),x=e.authors.length;return t.jsxs("article",{className:"paper-card",children:[s!=null&&t.jsx(C,{to:d,className:"paper-thumb-wrap",onFocus:n,onMouseEnter:n,children:t.jsx(V,{paperId:e.id,title:e.title,thumbnailUrl:e.thumbnailUrl,priority:s<=3})}),t.jsxs("div",{className:"paper-body",children:[t.jsxs("div",{className:"paper-body-main",children:[t.jsx("h3",{className:"paper-title",children:t.jsx(C,{to:d,onFocus:n,onMouseEnter:n,children:t.jsx(S,{title:e.title})})}),t.jsxs("div",{className:"paper-authors",children:[u,x>3&&t.jsxs("span",{children:[", ","+",x-3," authors"]}),e.date&&t.jsxs(t.Fragment,{children:[x>0?" · ":"",t.jsx("span",{children:e.date})]}),e.citations>0&&t.jsxs(t.Fragment,{children:[x>0||e.date?" · ":"",t.jsxs("span",{children:[e.citations.toLocaleString()," citations"]})]})]}),e.abstract&&t.jsx("p",{className:"paper-abstract",children:e.abstract}),e.tags.length>0&&t.jsx("div",{className:"paper-tags",children:e.tags.map(h=>t.jsx(A,{slug:h,onClick:r},h))})]}),e.github!=null&&(()=>{const h=t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"gh-stat-block",children:[t.jsxs("div",{className:"gh-value-row",children:[t.jsx(I,{name:"github",size:12}),t.jsx("span",{className:"gh-stars",children:L(e.github)})]}),t.jsx("div",{className:"gh-stars-label",children:"stars"})]}),e.velocity24h!=null&&e.velocity24h>0&&t.jsxs("div",{className:"gh-stat-block",children:[t.jsxs("div",{className:"gh-value-row",children:[t.jsx("span",{className:"gh-rate-arrow",children:"↑"}),t.jsx("span",{className:"gh-rate",children:q(e.velocity24h)})]}),t.jsx("div",{className:"gh-stars-label",children:"stars / hr"})]})]});return e.githubUrl?t.jsx("a",{className:"paper-github-stats is-link",href:e.githubUrl,target:"_blank",rel:"noopener noreferrer","aria-label":`Open GitHub repository (${L(e.github)} stars)`,onClick:g=>g.stopPropagation(),children:h}):t.jsx("aside",{className:"paper-github-stats",children:h})})()]})]})};function L(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function q(e){return e.toFixed(1)}export{I,G as M,K as P,A as T};
assets/{index-BcdJ5r4Y.js → index-BWQiUBNk.js} RENAMED
The diff for this file is too large to render. See raw diff
 
assets/{index-C6fPppD9.css → index-D4WvUqkN.css} RENAMED
The diff for this file is too large to render. See raw diff
 
assets/input-DZmGAzFu.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{r as n,j as s,$ as f,h as i,_ as c}from"./index-BWQiUBNk.js";const l=c("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),g=n.forwardRef(({className:e,variant:r,size:t,asChild:o=!1,...a},d)=>{const u=o?f:"button";return s.jsx(u,{className:i(l({variant:r,size:t,className:e})),ref:d,...a})});g.displayName="Button";const b=n.forwardRef(({className:e,type:r,...t},o)=>s.jsx("input",{type:r,className:i("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:o,...t}));b.displayName="Input";export{g as B,b as I};
assets/skeleton-BuXiEBoy.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{j as t,h as n}from"./index-BWQiUBNk.js";function m({className:e,...s}){return t.jsx("div",{className:n("animate-pulse rounded-md bg-muted",e),...s})}export{m as S};
assets/transform-Dasg-XFy.js DELETED
@@ -1 +0,0 @@
1
- import{Y as H}from"./index-BcdJ5r4Y.js";function Oe(t){let e=2166136261;const n=t||"";for(let r=0;r<n.length;r++)e=Math.imul(e^n.charCodeAt(r),16777619);return Math.abs(e)%360}function Pe(t){return{bg:`oklch(0.94 0.04 ${t})`,text:`oklch(0.35 0.10 ${t})`,dot:`oklch(0.55 0.12 ${t})`}}function m(t){const e=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&e==="[object Date]"?new t.constructor(+t):typeof t=="number"||e==="[object Number]"||typeof t=="string"||e==="[object String]"?new Date(t):new Date(NaN)}function b(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}const I=6048e5,J=864e5,R=6e4,j=36e5;let Z={};function W(){return Z}function k(t,e){var s,u,d,f;const n=W(),r=(e==null?void 0:e.weekStartsOn)??((u=(s=e==null?void 0:e.locale)==null?void 0:s.options)==null?void 0:u.weekStartsOn)??n.weekStartsOn??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.weekStartsOn)??0,a=m(t),i=a.getDay(),o=(i<r?7:0)+i-r;return a.setDate(a.getDate()-o),a.setHours(0,0,0,0),a}function T(t){return k(t,{weekStartsOn:1})}function A(t){const e=m(t),n=e.getFullYear(),r=b(t,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const a=T(r),i=b(t,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const o=T(i);return e.getTime()>=a.getTime()?n+1:e.getTime()>=o.getTime()?n:n-1}function F(t){const e=m(t);return e.setHours(0,0,0,0),e}function _(t){const e=m(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function K(t,e){const n=F(t),r=F(e),a=+n-_(n),i=+r-_(r);return Math.round((a-i)/J)}function tt(t){const e=A(t),n=b(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),T(n)}function et(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function nt(t){if(!et(t)&&typeof t!="number")return!1;const e=m(t);return!isNaN(Number(e))}function rt(t){const e=m(t),n=b(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}const at={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},it=(t,e,n)=>{let r;const a=at[t];return typeof a=="string"?r=a:e===1?r=a.one:r=a.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Y(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const ot={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},st={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ut={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ct={date:Y({formats:ot,defaultWidth:"full"}),time:Y({formats:st,defaultWidth:"full"}),dateTime:Y({formats:ut,defaultWidth:"full"})},dt={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},lt=(t,e,n,r)=>dt[t];function O(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let a;if(r==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,s=n!=null&&n.width?String(n.width):o;a=t.formattingValues[s]||t.formattingValues[o]}else{const o=t.defaultWidth,s=n!=null&&n.width?String(n.width):t.defaultWidth;a=t.values[s]||t.values[o]}const i=t.argumentCallback?t.argumentCallback(e):e;return a[i]}}const ft={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},ht={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},mt={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},gt={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},wt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},yt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},bt=(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},Dt={ordinalNumber:bt,era:O({values:ft,defaultWidth:"wide"}),quarter:O({values:ht,defaultWidth:"wide",argumentCallback:t=>t-1}),month:O({values:mt,defaultWidth:"wide"}),day:O({values:gt,defaultWidth:"wide"}),dayPeriod:O({values:wt,defaultWidth:"wide",formattingValues:yt,defaultFormattingWidth:"wide"})};function P(t){return(e,n={})=>{const r=n.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],i=e.match(a);if(!i)return null;const o=i[0],s=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(s)?Mt(s,g=>g.test(o)):pt(s,g=>g.test(o));let d;d=t.valueCallback?t.valueCallback(u):u,d=n.valueCallback?n.valueCallback(d):d;const f=e.slice(o.length);return{value:d,rest:f}}}function pt(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function Mt(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function Ot(t){return(e,n={})=>{const r=e.match(t.matchPattern);if(!r)return null;const a=r[0],i=e.match(t.parsePattern);if(!i)return null;let o=t.valueCallback?t.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const s=e.slice(a.length);return{value:o,rest:s}}}const Pt=/^(\d+)(th|st|nd|rd)?/i,vt=/\d+/i,kt={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},xt={any:[/^b/i,/^(a|c)/i]},Tt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Wt={any:[/1/i,/2/i,/3/i,/4/i]},St={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Yt={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Nt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Ct={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Ft={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},_t={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Et={ordinalNumber:Ot({matchPattern:Pt,parsePattern:vt,valueCallback:t=>parseInt(t,10)}),era:P({matchPatterns:kt,defaultMatchWidth:"wide",parsePatterns:xt,defaultParseWidth:"any"}),quarter:P({matchPatterns:Tt,defaultMatchWidth:"wide",parsePatterns:Wt,defaultParseWidth:"any",valueCallback:t=>t+1}),month:P({matchPatterns:St,defaultMatchWidth:"wide",parsePatterns:Yt,defaultParseWidth:"any"}),day:P({matchPatterns:Nt,defaultMatchWidth:"wide",parsePatterns:Ct,defaultParseWidth:"any"}),dayPeriod:P({matchPatterns:Ft,defaultMatchWidth:"any",parsePatterns:_t,defaultParseWidth:"any"})},qt={code:"en-US",formatDistance:it,formatLong:ct,formatRelative:lt,localize:Dt,match:Et,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Lt(t){const e=m(t);return K(e,rt(e))+1}function Ut(t){const e=m(t),n=+T(e)-+tt(e);return Math.round(n/I)+1}function Q(t,e){var f,g,p,M;const n=m(t),r=n.getFullYear(),a=W(),i=(e==null?void 0:e.firstWeekContainsDate)??((g=(f=e==null?void 0:e.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??a.firstWeekContainsDate??((M=(p=a.locale)==null?void 0:p.options)==null?void 0:M.firstWeekContainsDate)??1,o=b(t,0);o.setFullYear(r+1,0,i),o.setHours(0,0,0,0);const s=k(o,e),u=b(t,0);u.setFullYear(r,0,i),u.setHours(0,0,0,0);const d=k(u,e);return n.getTime()>=s.getTime()?r+1:n.getTime()>=d.getTime()?r:r-1}function Ht(t,e){var s,u,d,f;const n=W(),r=(e==null?void 0:e.firstWeekContainsDate)??((u=(s=e==null?void 0:e.locale)==null?void 0:s.options)==null?void 0:u.firstWeekContainsDate)??n.firstWeekContainsDate??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??1,a=Q(t,e),i=b(t,0);return i.setFullYear(a,0,r),i.setHours(0,0,0,0),k(i,e)}function It(t,e){const n=m(t),r=+k(n,e)-+Ht(n,e);return Math.round(r/I)+1}function c(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const w={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return c(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):c(n+1,2)},d(t,e){return c(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,e){return c(t.getHours()%12||12,e.length)},H(t,e){return c(t.getHours(),e.length)},m(t,e){return c(t.getMinutes(),e.length)},s(t,e){return c(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return c(a,e.length)}},D={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},E={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const r=t.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return w.y(t,e)},Y:function(t,e,n,r){const a=Q(t,r),i=a>0?a:1-a;if(e==="YY"){const o=i%100;return c(o,2)}return e==="Yo"?n.ordinalNumber(i,{unit:"year"}):c(i,e.length)},R:function(t,e){const n=A(t);return c(n,e.length)},u:function(t,e){const n=t.getFullYear();return c(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return c(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return c(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return w.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return c(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const a=It(t,r);return e==="wo"?n.ordinalNumber(a,{unit:"week"}):c(a,e.length)},I:function(t,e,n){const r=Ut(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):c(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):w.d(t,e)},D:function(t,e,n){const r=Lt(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):c(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const a=t.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return c(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const a=t.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return c(i,e.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),a=r===0?7:r;switch(e){case"i":return String(a);case"ii":return c(a,e.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const a=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let a;switch(r===12?a=D.noon:r===0?a=D.midnight:a=r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let a;switch(r>=17?a=D.evening:r>=12?a=D.afternoon:r>=4?a=D.morning:a=D.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return w.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):w.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):c(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):c(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):w.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):w.s(t,e)},S:function(t,e){return w.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return L(r);case"XXXX":case"XX":return y(r);case"XXXXX":case"XXX":default:return y(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return L(r);case"xxxx":case"xx":return y(r);case"xxxxx":case"xxx":default:return y(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+q(r,":");case"OOOO":default:return"GMT"+y(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+q(r,":");case"zzzz":default:return"GMT"+y(r,":")}},t:function(t,e,n){const r=Math.trunc(t.getTime()/1e3);return c(r,e.length)},T:function(t,e,n){const r=t.getTime();return c(r,e.length)}};function q(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=Math.trunc(r/60),i=r%60;return i===0?n+String(a):n+String(a)+e+c(i,2)}function L(t,e){return t%60===0?(t>0?"-":"+")+c(Math.abs(t)/60,2):y(t,e)}function y(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=c(Math.trunc(r/60),2),i=c(r%60,2);return n+a+e+i}const U=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},X=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},Rt=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return U(t,e);let i;switch(r){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",U(r,e)).replace("{{time}}",X(a,e))},jt={p:X,P:Rt},At=/^D+$/,Qt=/^Y+$/,Xt=["D","DD","YY","YYYY"];function Bt(t){return At.test(t)}function Gt(t){return Qt.test(t)}function $t(t,e,n){const r=Vt(t,e,n);if(console.warn(r),Xt.includes(t))throw new RangeError(r)}function Vt(t,e,n){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const zt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Jt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Zt=/^'([^]*?)'?$/,Kt=/''/g,te=/[a-zA-Z]/;function ee(t,e,n){var f,g,p,M;const r=W(),a=r.locale??qt,i=r.firstWeekContainsDate??((g=(f=r.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??1,o=r.weekStartsOn??((M=(p=r.locale)==null?void 0:p.options)==null?void 0:M.weekStartsOn)??0,s=m(t);if(!nt(s))throw new RangeError("Invalid time value");let u=e.match(Jt).map(h=>{const l=h[0];if(l==="p"||l==="P"){const S=jt[l];return S(h,a.formatLong)}return h}).join("").match(zt).map(h=>{if(h==="''")return{isToken:!1,value:"'"};const l=h[0];if(l==="'")return{isToken:!1,value:ne(h)};if(E[l])return{isToken:!0,value:h};if(l.match(te))throw new RangeError("Format string contains an unescaped latin alphabet character `"+l+"`");return{isToken:!1,value:h}});a.localize.preprocessor&&(u=a.localize.preprocessor(s,u));const d={firstWeekContainsDate:i,weekStartsOn:o,locale:a};return u.map(h=>{if(!h.isToken)return h.value;const l=h.value;(Gt(l)||Bt(l))&&$t(l,e,String(t));const S=E[l[0]];return S(s,l,a.localize,d)}).join("")}function ne(t){const e=t.match(Zt);return e?e[1].replace(Kt,"'"):t}function B(t,e){const r=oe(t);let a;if(r.date){const u=se(r.date,2);a=ue(u.restDateString,u.year)}if(!a||isNaN(a.getTime()))return new Date(NaN);const i=a.getTime();let o=0,s;if(r.time&&(o=ce(r.time),isNaN(o)))return new Date(NaN);if(r.timezone){if(s=de(r.timezone),isNaN(s))return new Date(NaN)}else{const u=new Date(i+o),d=new Date(0);return d.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),d.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),d}return new Date(i+o+s)}const x={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},re=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,ae=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,ie=/^([+-])(\d{2})(?::?(\d{2}))?$/;function oe(t){const e={},n=t.split(x.dateTimeDelimiter);let r;if(n.length>2)return e;if(/:/.test(n[0])?r=n[0]:(e.date=n[0],r=n[1],x.timeZoneDelimiter.test(e.date)&&(e.date=t.split(x.timeZoneDelimiter)[0],r=t.substr(e.date.length,t.length))),r){const a=x.timezone.exec(r);a?(e.time=r.replace(a[1],""),e.timezone=a[1]):e.time=r}return e}function se(t,e){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=t.match(n);if(!r)return{year:NaN,restDateString:""};const a=r[1]?parseInt(r[1]):null,i=r[2]?parseInt(r[2]):null;return{year:i===null?a:i*100,restDateString:t.slice((r[1]||r[2]).length)}}function ue(t,e){if(e===null)return new Date(NaN);const n=t.match(re);if(!n)return new Date(NaN);const r=!!n[4],a=v(n[1]),i=v(n[2])-1,o=v(n[3]),s=v(n[4]),u=v(n[5])-1;if(r)return ge(e,s,u)?le(e,s,u):new Date(NaN);{const d=new Date(0);return!he(e,i,o)||!me(e,a)?new Date(NaN):(d.setUTCFullYear(e,i,Math.max(a,o)),d)}}function v(t){return t?parseInt(t):1}function ce(t){const e=t.match(ae);if(!e)return NaN;const n=N(e[1]),r=N(e[2]),a=N(e[3]);return we(n,r,a)?n*j+r*R+a*1e3:NaN}function N(t){return t&&parseFloat(t.replace(",","."))||0}function de(t){if(t==="Z")return 0;const e=t.match(ie);if(!e)return 0;const n=e[1]==="+"?-1:1,r=parseInt(e[2]),a=e[3]&&parseInt(e[3])||0;return ye(r,a)?n*(r*j+a*R):NaN}function le(t,e,n){const r=new Date(0);r.setUTCFullYear(t,0,4);const a=r.getUTCDay()||7,i=(e-1)*7+n+1-a;return r.setUTCDate(r.getUTCDate()+i),r}const fe=[31,null,31,30,31,30,31,31,30,31,30,31];function G(t){return t%400===0||t%4===0&&t%100!==0}function he(t,e,n){return e>=0&&e<=11&&n>=1&&n<=(fe[e]||(G(t)?29:28))}function me(t,e){return e>=1&&e<=(G(t)?366:365)}function ge(t,e,n){return e>=1&&e<=53&&n>=0&&n<=6}function we(t,e,n){return t===24?e===0&&n===0:n>=0&&n<60&&e>=0&&e<60&&t>=0&&t<25}function ye(t,e){return e>=0&&e<=59}function be(t){if(!t||t.length===0)return{github:null,githubUrl:null,velocity24h:null};const e=t.filter(a=>a.is_official),r=[...e.length>0?e:t].sort((a,i)=>(i.num_stars||0)-(a.num_stars||0))[0];return{github:r&&r.num_stars>0?r.num_stars:null,githubUrl:(r==null?void 0:r.url)||null,velocity24h:(r==null?void 0:r.trending_score)??null}}function $(t){if(!t)return null;try{const e=typeof t=="string"?B(t):t;return ee(e,"MMM d, yyyy")}catch{return null}}function V(t){if(!t)return null;try{return B(t).getFullYear()}catch{return null}}function ve(t){var i,o;const{github:e,githubUrl:n,velocity24h:r}=be(t.repositories),a=(t.tasks||[]).map(s=>s.slug||"").filter(Boolean);return{id:t.arxiv_id||t.id,dbId:t.id,title:t.title,abstract:t.abstract||"",authors:t.authors||[],tags:a,citations:t.citation_count||0,github:e,githubUrl:n,project:((o=(i=t.project_pages)==null?void 0:i[0])==null?void 0:o.url)||null,date:$(t.published),publishedIso:t.published||null,year:V(t.published),thumbnailUrl:H(t.thumbnail_url)||null,tldr:t.tldr||null,version:t.version||"v1",velocity24h:r}}function ke(t){var e,n,r;return{id:t.arxiv_id||t.paper_id,dbId:t.paper_id,title:t.title,abstract:t.abstract||"",authors:t.authors||[],tags:(t.tasks||[]).map(a=>a.slug).filter(Boolean),citations:0,github:((e=t.repository)==null?void 0:e.num_stars)??null,githubUrl:((n=t.repository)==null?void 0:n.url)??null,project:null,date:$(t.date_published),publishedIso:t.date_published,year:V(t.date_published),thumbnailUrl:H(t.thumbnail_url)||null,tldr:null,version:"v1",velocity24h:((r=t.trending)==null?void 0:r.velocity_24h)??null}}function De(t){const e=z.get(t.toLowerCase());if(e)return e;const n=t.toUpperCase();return C.has(n)?n:t.replace(/[-_]+/g," ").replace(/\b\w/g,r=>r.toUpperCase())}const C=new Set(["OCR"]),z=new Map([["3d-generation","3D generation"],["3d-understanding","3D understanding"]]);function xe(t,e){const n=t||De(e||""),r=z.get((e==null?void 0:e.toLowerCase())||pe(n));if(r)return r;const a=e==null?void 0:e.toUpperCase(),i=n.toUpperCase();return/^[A-Z0-9][A-Z0-9-]{1,}$/.test(n)||a&&C.has(a)||C.has(i)?i:n.toLowerCase().replace(/\b\w/g,s=>s.toUpperCase())}function pe(t){return t.trim().toLowerCase().replace(/[\s_]+/g,"-")}export{ve as a,m as b,k as c,xe as d,be as e,Pe as f,De as g,Oe as h,F as s,ke as t};
 
 
assets/transform-DgWj1AQy.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{a1 as H}from"./index-BWQiUBNk.js";function Oe(t){let e=2166136261;const n=t||"";for(let r=0;r<n.length;r++)e=Math.imul(e^n.charCodeAt(r),16777619);return Math.abs(e)%360}function Pe(t){return{bg:`oklch(0.94 0.04 ${t})`,text:`oklch(0.35 0.10 ${t})`,dot:`oklch(0.55 0.12 ${t})`}}function m(t){const e=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&e==="[object Date]"?new t.constructor(+t):typeof t=="number"||e==="[object Number]"||typeof t=="string"||e==="[object String]"?new Date(t):new Date(NaN)}function b(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}const I=6048e5,J=864e5,R=6e4,j=36e5;let Z={};function W(){return Z}function k(t,e){var s,u,d,f;const n=W(),r=(e==null?void 0:e.weekStartsOn)??((u=(s=e==null?void 0:e.locale)==null?void 0:s.options)==null?void 0:u.weekStartsOn)??n.weekStartsOn??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.weekStartsOn)??0,a=m(t),i=a.getDay(),o=(i<r?7:0)+i-r;return a.setDate(a.getDate()-o),a.setHours(0,0,0,0),a}function T(t){return k(t,{weekStartsOn:1})}function A(t){const e=m(t),n=e.getFullYear(),r=b(t,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const a=T(r),i=b(t,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const o=T(i);return e.getTime()>=a.getTime()?n+1:e.getTime()>=o.getTime()?n:n-1}function F(t){const e=m(t);return e.setHours(0,0,0,0),e}function _(t){const e=m(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function K(t,e){const n=F(t),r=F(e),a=+n-_(n),i=+r-_(r);return Math.round((a-i)/J)}function tt(t){const e=A(t),n=b(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),T(n)}function et(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function nt(t){if(!et(t)&&typeof t!="number")return!1;const e=m(t);return!isNaN(Number(e))}function rt(t){const e=m(t),n=b(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}const at={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},it=(t,e,n)=>{let r;const a=at[t];return typeof a=="string"?r=a:e===1?r=a.one:r=a.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Y(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const ot={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},st={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ut={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ct={date:Y({formats:ot,defaultWidth:"full"}),time:Y({formats:st,defaultWidth:"full"}),dateTime:Y({formats:ut,defaultWidth:"full"})},dt={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},lt=(t,e,n,r)=>dt[t];function O(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let a;if(r==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,s=n!=null&&n.width?String(n.width):o;a=t.formattingValues[s]||t.formattingValues[o]}else{const o=t.defaultWidth,s=n!=null&&n.width?String(n.width):t.defaultWidth;a=t.values[s]||t.values[o]}const i=t.argumentCallback?t.argumentCallback(e):e;return a[i]}}const ft={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},ht={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},mt={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},gt={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},wt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},yt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},bt=(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},Dt={ordinalNumber:bt,era:O({values:ft,defaultWidth:"wide"}),quarter:O({values:ht,defaultWidth:"wide",argumentCallback:t=>t-1}),month:O({values:mt,defaultWidth:"wide"}),day:O({values:gt,defaultWidth:"wide"}),dayPeriod:O({values:wt,defaultWidth:"wide",formattingValues:yt,defaultFormattingWidth:"wide"})};function P(t){return(e,n={})=>{const r=n.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],i=e.match(a);if(!i)return null;const o=i[0],s=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(s)?Mt(s,g=>g.test(o)):pt(s,g=>g.test(o));let d;d=t.valueCallback?t.valueCallback(u):u,d=n.valueCallback?n.valueCallback(d):d;const f=e.slice(o.length);return{value:d,rest:f}}}function pt(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function Mt(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function Ot(t){return(e,n={})=>{const r=e.match(t.matchPattern);if(!r)return null;const a=r[0],i=e.match(t.parsePattern);if(!i)return null;let o=t.valueCallback?t.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const s=e.slice(a.length);return{value:o,rest:s}}}const Pt=/^(\d+)(th|st|nd|rd)?/i,vt=/\d+/i,kt={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},xt={any:[/^b/i,/^(a|c)/i]},Tt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Wt={any:[/1/i,/2/i,/3/i,/4/i]},St={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Yt={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Nt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Ct={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Ft={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},_t={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Et={ordinalNumber:Ot({matchPattern:Pt,parsePattern:vt,valueCallback:t=>parseInt(t,10)}),era:P({matchPatterns:kt,defaultMatchWidth:"wide",parsePatterns:xt,defaultParseWidth:"any"}),quarter:P({matchPatterns:Tt,defaultMatchWidth:"wide",parsePatterns:Wt,defaultParseWidth:"any",valueCallback:t=>t+1}),month:P({matchPatterns:St,defaultMatchWidth:"wide",parsePatterns:Yt,defaultParseWidth:"any"}),day:P({matchPatterns:Nt,defaultMatchWidth:"wide",parsePatterns:Ct,defaultParseWidth:"any"}),dayPeriod:P({matchPatterns:Ft,defaultMatchWidth:"any",parsePatterns:_t,defaultParseWidth:"any"})},qt={code:"en-US",formatDistance:it,formatLong:ct,formatRelative:lt,localize:Dt,match:Et,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Lt(t){const e=m(t);return K(e,rt(e))+1}function Ut(t){const e=m(t),n=+T(e)-+tt(e);return Math.round(n/I)+1}function Q(t,e){var f,g,p,M;const n=m(t),r=n.getFullYear(),a=W(),i=(e==null?void 0:e.firstWeekContainsDate)??((g=(f=e==null?void 0:e.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??a.firstWeekContainsDate??((M=(p=a.locale)==null?void 0:p.options)==null?void 0:M.firstWeekContainsDate)??1,o=b(t,0);o.setFullYear(r+1,0,i),o.setHours(0,0,0,0);const s=k(o,e),u=b(t,0);u.setFullYear(r,0,i),u.setHours(0,0,0,0);const d=k(u,e);return n.getTime()>=s.getTime()?r+1:n.getTime()>=d.getTime()?r:r-1}function Ht(t,e){var s,u,d,f;const n=W(),r=(e==null?void 0:e.firstWeekContainsDate)??((u=(s=e==null?void 0:e.locale)==null?void 0:s.options)==null?void 0:u.firstWeekContainsDate)??n.firstWeekContainsDate??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??1,a=Q(t,e),i=b(t,0);return i.setFullYear(a,0,r),i.setHours(0,0,0,0),k(i,e)}function It(t,e){const n=m(t),r=+k(n,e)-+Ht(n,e);return Math.round(r/I)+1}function c(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const w={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return c(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):c(n+1,2)},d(t,e){return c(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,e){return c(t.getHours()%12||12,e.length)},H(t,e){return c(t.getHours(),e.length)},m(t,e){return c(t.getMinutes(),e.length)},s(t,e){return c(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return c(a,e.length)}},D={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},E={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const r=t.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return w.y(t,e)},Y:function(t,e,n,r){const a=Q(t,r),i=a>0?a:1-a;if(e==="YY"){const o=i%100;return c(o,2)}return e==="Yo"?n.ordinalNumber(i,{unit:"year"}):c(i,e.length)},R:function(t,e){const n=A(t);return c(n,e.length)},u:function(t,e){const n=t.getFullYear();return c(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return c(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return c(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return w.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return c(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const a=It(t,r);return e==="wo"?n.ordinalNumber(a,{unit:"week"}):c(a,e.length)},I:function(t,e,n){const r=Ut(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):c(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):w.d(t,e)},D:function(t,e,n){const r=Lt(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):c(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const a=t.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return c(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const a=t.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return c(i,e.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),a=r===0?7:r;switch(e){case"i":return String(a);case"ii":return c(a,e.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const a=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let a;switch(r===12?a=D.noon:r===0?a=D.midnight:a=r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let a;switch(r>=17?a=D.evening:r>=12?a=D.afternoon:r>=4?a=D.morning:a=D.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return w.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):w.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):c(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):c(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):w.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):w.s(t,e)},S:function(t,e){return w.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return L(r);case"XXXX":case"XX":return y(r);case"XXXXX":case"XXX":default:return y(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return L(r);case"xxxx":case"xx":return y(r);case"xxxxx":case"xxx":default:return y(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+q(r,":");case"OOOO":default:return"GMT"+y(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+q(r,":");case"zzzz":default:return"GMT"+y(r,":")}},t:function(t,e,n){const r=Math.trunc(t.getTime()/1e3);return c(r,e.length)},T:function(t,e,n){const r=t.getTime();return c(r,e.length)}};function q(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=Math.trunc(r/60),i=r%60;return i===0?n+String(a):n+String(a)+e+c(i,2)}function L(t,e){return t%60===0?(t>0?"-":"+")+c(Math.abs(t)/60,2):y(t,e)}function y(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=c(Math.trunc(r/60),2),i=c(r%60,2);return n+a+e+i}const U=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},X=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},Rt=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return U(t,e);let i;switch(r){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",U(r,e)).replace("{{time}}",X(a,e))},jt={p:X,P:Rt},At=/^D+$/,Qt=/^Y+$/,Xt=["D","DD","YY","YYYY"];function Bt(t){return At.test(t)}function Gt(t){return Qt.test(t)}function $t(t,e,n){const r=Vt(t,e,n);if(console.warn(r),Xt.includes(t))throw new RangeError(r)}function Vt(t,e,n){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const zt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Jt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Zt=/^'([^]*?)'?$/,Kt=/''/g,te=/[a-zA-Z]/;function ee(t,e,n){var f,g,p,M;const r=W(),a=r.locale??qt,i=r.firstWeekContainsDate??((g=(f=r.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??1,o=r.weekStartsOn??((M=(p=r.locale)==null?void 0:p.options)==null?void 0:M.weekStartsOn)??0,s=m(t);if(!nt(s))throw new RangeError("Invalid time value");let u=e.match(Jt).map(h=>{const l=h[0];if(l==="p"||l==="P"){const S=jt[l];return S(h,a.formatLong)}return h}).join("").match(zt).map(h=>{if(h==="''")return{isToken:!1,value:"'"};const l=h[0];if(l==="'")return{isToken:!1,value:ne(h)};if(E[l])return{isToken:!0,value:h};if(l.match(te))throw new RangeError("Format string contains an unescaped latin alphabet character `"+l+"`");return{isToken:!1,value:h}});a.localize.preprocessor&&(u=a.localize.preprocessor(s,u));const d={firstWeekContainsDate:i,weekStartsOn:o,locale:a};return u.map(h=>{if(!h.isToken)return h.value;const l=h.value;(Gt(l)||Bt(l))&&$t(l,e,String(t));const S=E[l[0]];return S(s,l,a.localize,d)}).join("")}function ne(t){const e=t.match(Zt);return e?e[1].replace(Kt,"'"):t}function B(t,e){const r=oe(t);let a;if(r.date){const u=se(r.date,2);a=ue(u.restDateString,u.year)}if(!a||isNaN(a.getTime()))return new Date(NaN);const i=a.getTime();let o=0,s;if(r.time&&(o=ce(r.time),isNaN(o)))return new Date(NaN);if(r.timezone){if(s=de(r.timezone),isNaN(s))return new Date(NaN)}else{const u=new Date(i+o),d=new Date(0);return d.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),d.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),d}return new Date(i+o+s)}const x={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},re=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,ae=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,ie=/^([+-])(\d{2})(?::?(\d{2}))?$/;function oe(t){const e={},n=t.split(x.dateTimeDelimiter);let r;if(n.length>2)return e;if(/:/.test(n[0])?r=n[0]:(e.date=n[0],r=n[1],x.timeZoneDelimiter.test(e.date)&&(e.date=t.split(x.timeZoneDelimiter)[0],r=t.substr(e.date.length,t.length))),r){const a=x.timezone.exec(r);a?(e.time=r.replace(a[1],""),e.timezone=a[1]):e.time=r}return e}function se(t,e){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=t.match(n);if(!r)return{year:NaN,restDateString:""};const a=r[1]?parseInt(r[1]):null,i=r[2]?parseInt(r[2]):null;return{year:i===null?a:i*100,restDateString:t.slice((r[1]||r[2]).length)}}function ue(t,e){if(e===null)return new Date(NaN);const n=t.match(re);if(!n)return new Date(NaN);const r=!!n[4],a=v(n[1]),i=v(n[2])-1,o=v(n[3]),s=v(n[4]),u=v(n[5])-1;if(r)return ge(e,s,u)?le(e,s,u):new Date(NaN);{const d=new Date(0);return!he(e,i,o)||!me(e,a)?new Date(NaN):(d.setUTCFullYear(e,i,Math.max(a,o)),d)}}function v(t){return t?parseInt(t):1}function ce(t){const e=t.match(ae);if(!e)return NaN;const n=N(e[1]),r=N(e[2]),a=N(e[3]);return we(n,r,a)?n*j+r*R+a*1e3:NaN}function N(t){return t&&parseFloat(t.replace(",","."))||0}function de(t){if(t==="Z")return 0;const e=t.match(ie);if(!e)return 0;const n=e[1]==="+"?-1:1,r=parseInt(e[2]),a=e[3]&&parseInt(e[3])||0;return ye(r,a)?n*(r*j+a*R):NaN}function le(t,e,n){const r=new Date(0);r.setUTCFullYear(t,0,4);const a=r.getUTCDay()||7,i=(e-1)*7+n+1-a;return r.setUTCDate(r.getUTCDate()+i),r}const fe=[31,null,31,30,31,30,31,31,30,31,30,31];function G(t){return t%400===0||t%4===0&&t%100!==0}function he(t,e,n){return e>=0&&e<=11&&n>=1&&n<=(fe[e]||(G(t)?29:28))}function me(t,e){return e>=1&&e<=(G(t)?366:365)}function ge(t,e,n){return e>=1&&e<=53&&n>=0&&n<=6}function we(t,e,n){return t===24?e===0&&n===0:n>=0&&n<60&&e>=0&&e<60&&t>=0&&t<25}function ye(t,e){return e>=0&&e<=59}function be(t){if(!t||t.length===0)return{github:null,githubUrl:null,velocity24h:null};const e=t.filter(a=>a.is_official),r=[...e.length>0?e:t].sort((a,i)=>(i.num_stars||0)-(a.num_stars||0))[0];return{github:r&&r.num_stars>0?r.num_stars:null,githubUrl:(r==null?void 0:r.url)||null,velocity24h:(r==null?void 0:r.trending_score)??null}}function $(t){if(!t)return null;try{const e=typeof t=="string"?B(t):t;return ee(e,"MMM d, yyyy")}catch{return null}}function V(t){if(!t)return null;try{return B(t).getFullYear()}catch{return null}}function ve(t){var i,o;const{github:e,githubUrl:n,velocity24h:r}=be(t.repositories),a=(t.tasks||[]).map(s=>s.slug||"").filter(Boolean);return{id:t.arxiv_id||t.id,dbId:t.id,title:t.title,abstract:t.abstract||"",authors:t.authors||[],tags:a,citations:t.citation_count||0,github:e,githubUrl:n,project:((o=(i=t.project_pages)==null?void 0:i[0])==null?void 0:o.url)||null,date:$(t.published),publishedIso:t.published||null,year:V(t.published),thumbnailUrl:H(t.thumbnail_url)||null,tldr:t.tldr||null,version:t.version||"v1",velocity24h:r}}function ke(t){var e,n,r;return{id:t.arxiv_id||t.paper_id,dbId:t.paper_id,title:t.title,abstract:t.abstract||"",authors:t.authors||[],tags:(t.tasks||[]).map(a=>a.slug).filter(Boolean),citations:0,github:((e=t.repository)==null?void 0:e.num_stars)??null,githubUrl:((n=t.repository)==null?void 0:n.url)??null,project:null,date:$(t.date_published),publishedIso:t.date_published,year:V(t.date_published),thumbnailUrl:H(t.thumbnail_url)||null,tldr:null,version:"v1",velocity24h:((r=t.trending)==null?void 0:r.velocity_24h)??null}}function De(t){const e=z.get(t.toLowerCase());if(e)return e;const n=t.toUpperCase();return C.has(n)?n:t.replace(/[-_]+/g," ").replace(/\b\w/g,r=>r.toUpperCase())}const C=new Set(["OCR"]),z=new Map([["3d-generation","3D generation"],["3d-understanding","3D understanding"]]);function xe(t,e){const n=t||De(e||""),r=z.get((e==null?void 0:e.toLowerCase())||pe(n));if(r)return r;const a=e==null?void 0:e.toUpperCase(),i=n.toUpperCase();return/^[A-Z0-9][A-Z0-9-]{1,}$/.test(n)||a&&C.has(a)||C.has(i)?i:n.toLowerCase().replace(/\b\w/g,s=>s.toUpperCase())}function pe(t){return t.trim().toLowerCase().replace(/[\s_]+/g,"-")}export{ve as a,m as b,k as c,xe as d,be as e,Pe as f,De as g,Oe as h,F as s,ke as t};
assets/{useDebounce-B7XgVPQp.js → useDebounce-DUtosrff.js} RENAMED
@@ -1 +1 @@
1
- import{r as o}from"./index-BcdJ5r4Y.js";function s(e,t=300){const[r,u]=o.useState(e);return o.useEffect(()=>{const c=setTimeout(()=>u(e),t);return()=>clearTimeout(c)},[e,t]),r}export{s as u};
 
1
+ import{r as o}from"./index-BWQiUBNk.js";function s(e,t=300){const[r,u]=o.useState(e);return o.useEffect(()=>{const c=setTimeout(()=>u(e),t);return()=>clearTimeout(c)},[e,t]),r}export{s as u};
assets/useInfiniteQuery-CpEFc3Gg.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{Q as v,h as p}from"./useQuery-B941khzD.js";import{T as x,U as b}from"./index-BWQiUBNk.js";var l=class extends v{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){var f,P;const{state:s}=e,i=super.createResult(e,t),{isFetching:a,isRefetching:g,isError:c,isRefetchError:d}=i,r=(P=(f=s.fetchMeta)==null?void 0:f.fetchMore)==null?void 0:P.direction,h=c&&r==="forward",n=a&&r==="forward",o=c&&r==="backward",u=a&&r==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:b(t,s.data),hasPreviousPage:x(t,s.data),isFetchNextPageError:h,isFetchingNextPage:n,isFetchPreviousPageError:o,isFetchingPreviousPage:u,isRefetchError:d&&!h&&!o,isRefetching:g&&!n&&!u}}};function w(e,t){return p(e,l)}export{w as u};
assets/useInfiniteQuery-jK6uM4vU.js DELETED
@@ -1 +0,0 @@
1
- import{Q as v,h as p}from"./adminAuth-CijC1LpP.js";import{O as x,Q as b}from"./index-BcdJ5r4Y.js";var l=class extends v{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){var f,P;const{state:s}=e,i=super.createResult(e,t),{isFetching:a,isRefetching:g,isError:c,isRefetchError:d}=i,r=(P=(f=s.fetchMeta)==null?void 0:f.fetchMore)==null?void 0:P.direction,h=c&&r==="forward",n=a&&r==="forward",o=c&&r==="backward",u=a&&r==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:b(t,s.data),hasPreviousPage:x(t,s.data),isFetchNextPageError:h,isFetchingNextPage:n,isFetchPreviousPageError:o,isFetchingPreviousPage:u,isRefetchError:d&&!h&&!o,isRefetching:g&&!n&&!u}}};function O(e,t){return p(e,l)}export{O as u};
 
 
assets/{useIntersectionObserver-DfztqSja.js → useIntersectionObserver-U7v6rTcQ.js} RENAMED
@@ -1 +1 @@
1
- import{r}from"./index-BcdJ5r4Y.js";function b(u={}){const{threshold:t=0,rootMargin:n="0px"}=u,[i,s]=r.useState(!1),e=r.useRef(null),f=r.useCallback(c=>{if(e.current&&(e.current.disconnect(),e.current=null),!c){s(!1);return}const o=new IntersectionObserver(([l])=>s(l.isIntersecting),{threshold:t,rootMargin:n});o.observe(c),e.current=o},[t,n]);return r.useEffect(()=>()=>{e.current&&(e.current.disconnect(),e.current=null)},[]),{targetRef:f,isIntersecting:i}}export{b as u};
 
1
+ import{r}from"./index-BWQiUBNk.js";function b(u={}){const{threshold:t=0,rootMargin:n="0px"}=u,[i,s]=r.useState(!1),e=r.useRef(null),f=r.useCallback(c=>{if(e.current&&(e.current.disconnect(),e.current=null),!c){s(!1);return}const o=new IntersectionObserver(([l])=>s(l.isIntersecting),{threshold:t,rootMargin:n});o.observe(c),e.current=o},[t,n]);return r.useEffect(()=>()=>{e.current&&(e.current.disconnect(),e.current=null)},[]),{targetRef:f,isIntersecting:i}}export{b as u};
assets/useMutation-CypKj-4k.js ADDED
@@ -0,0 +1 @@
 
 
1
+ var R=i=>{throw TypeError(i)};var S=(i,t,s)=>t.has(i)||R("Cannot "+s);var e=(i,t,s)=>(S(i,t,"read from private field"),s?s.call(i):t.get(i)),b=(i,t,s)=>t.has(i)?R("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,s),p=(i,t,s,r)=>(S(i,t,"write to private field"),r?r.call(i,s):t.set(i,s),s),y=(i,t,s)=>(S(i,t,"access private method"),s);import{S as U,J as k,W as j,Y as q,I as P,p as I,r as v,M as L,Z as A}from"./index-BWQiUBNk.js";var h,c,o,a,n,C,E,w,D=(w=class extends U{constructor(t,s){super();b(this,n);b(this,h);b(this,c);b(this,o);b(this,a);p(this,h,t),this.setOptions(s),this.bindMethods(),y(this,n,C).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var r;const s=this.options;this.options=e(this,h).defaultMutationOptions(t),k(this.options,s)||e(this,h).getMutationCache().notify({type:"observerOptionsUpdated",mutation:e(this,o),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&j(s.mutationKey)!==j(this.options.mutationKey)?this.reset():((r=e(this,o))==null?void 0:r.state.status)==="pending"&&e(this,o).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=e(this,o))==null||t.removeObserver(this)}onMutationUpdate(t){y(this,n,C).call(this),y(this,n,E).call(this,t)}getCurrentResult(){return e(this,c)}reset(){var t;(t=e(this,o))==null||t.removeObserver(this),p(this,o,void 0),y(this,n,C).call(this),y(this,n,E).call(this)}mutate(t,s){var r;return p(this,a,s),(r=e(this,o))==null||r.removeObserver(this),p(this,o,e(this,h).getMutationCache().build(e(this,h),this.options)),e(this,o).addObserver(this),e(this,o).execute(t)}},h=new WeakMap,c=new WeakMap,o=new WeakMap,a=new WeakMap,n=new WeakSet,C=function(){var s;const t=((s=e(this,o))==null?void 0:s.state)??q();p(this,c,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},E=function(t){P.batch(()=>{var s,r,u,f,d,O,x,K;if(e(this,a)&&this.hasListeners()){const m=e(this,c).variables,M=e(this,c).context,g={client:e(this,h),meta:this.options.meta,mutationKey:this.options.mutationKey};if((t==null?void 0:t.type)==="success"){try{(r=(s=e(this,a)).onSuccess)==null||r.call(s,t.data,m,M,g)}catch(l){Promise.reject(l)}try{(f=(u=e(this,a)).onSettled)==null||f.call(u,t.data,null,m,M,g)}catch(l){Promise.reject(l)}}else if((t==null?void 0:t.type)==="error"){try{(O=(d=e(this,a)).onError)==null||O.call(d,t.error,m,M,g)}catch(l){Promise.reject(l)}try{(K=(x=e(this,a)).onSettled)==null||K.call(x,void 0,t.error,m,M,g)}catch(l){Promise.reject(l)}}}this.listeners.forEach(m=>{m(e(this,c))})})},w);function T(i,t){const s=I(),[r]=v.useState(()=>new D(s,i));v.useEffect(()=>{r.setOptions(i)},[r,i]);const u=v.useSyncExternalStore(v.useCallback(d=>r.subscribe(P.batchCalls(d)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),f=v.useCallback((d,O)=>{r.mutate(d,O).catch(L)},[r]);if(u.error&&A(r.options.throwOnError,[u.error]))throw u.error;return{...u,mutate:f,mutateAsync:u.mutate}}export{T as u};
assets/usePapers-CnRnmSk-.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{N as f}from"./index-BWQiUBNk.js";import{u as g}from"./useQuery-B941khzD.js";import{u as m}from"./useInfiniteQuery-CpEFc3Gg.js";import{a as p}from"./api-BFeNcidM.js";function q(a,e=!0){return g({queryKey:["paper",a],queryFn:()=>p.getPaper(a),enabled:e&&!!a,staleTime:10*60*1e3,refetchOnWindowFocus:!1})}function F(a={}){const{page_size:e=20,search:r,order_by:t="date_published",order_dir:n="desc",time:i,published_after:u,published_before:o,conference:s,latest_only:d=!0,include_resources:c=!1,enabled:y=!0}=a;return m({queryKey:["papers-infinite",{page_size:e,search:r,order_by:t,order_dir:n,time:i,published_after:u,published_before:o,conference:s,latest_only:d,include_resources:c}],queryFn:({pageParam:l=1})=>p.getPapers({page:l,page_size:e,search:r,order_by:t,order_dir:n,time:i,published_after:u,published_before:o,conference:s,latest_only:d,include_resources:c}),getNextPageParam:l=>l.next_page,initialPageParam:1,enabled:y,staleTime:5*60*1e3,placeholderData:f,refetchOnWindowFocus:!1})}function T(a){const{taskId:e,page_size:r=20,order_by:t="date_published",order_dir:n="desc",latest_only:i=!0,include_resources:u=!0,enabled:o=!0}=a;return m({queryKey:["task-papers-infinite",e,{page_size:r,order_by:t,order_dir:n,latest_only:i,include_resources:u}],queryFn:({pageParam:s=1})=>p.getTaskPapers(e,{page:s,page_size:r,order_by:t,order_dir:n,latest_only:i,include_resources:u}),getNextPageParam:s=>s.next_page,initialPageParam:1,enabled:o&&!!e,staleTime:5*60*1e3,placeholderData:f,refetchOnWindowFocus:!1})}function x(a={}){const{limit:e=20,max_age_days:r=180,min_velocity:t,enabled:n=!0}=a;return g({queryKey:["trending-papers",{limit:e,max_age_days:r,min_velocity:t}],queryFn:()=>p.getTrendingPapers({limit:e,max_age_days:r,min_velocity:t}),enabled:n,staleTime:2*60*1e3,refetchOnWindowFocus:!1})}export{x as a,q as b,T as c,F as u};
assets/usePapers-Swv3hMJI.js DELETED
@@ -1 +0,0 @@
1
- import{K as f}from"./index-BcdJ5r4Y.js";import{u as g}from"./adminAuth-CijC1LpP.js";import{u as m}from"./useInfiniteQuery-jK6uM4vU.js";import{a as p}from"./api-DVAIDRP9.js";function q(a,e=!0){return g({queryKey:["paper",a],queryFn:()=>p.getPaper(a),enabled:e&&!!a,staleTime:10*60*1e3,refetchOnWindowFocus:!1})}function F(a={}){const{page_size:e=20,search:r,order_by:t="date_published",order_dir:n="desc",time:i,published_after:u,published_before:o,conference:s,latest_only:d=!0,include_resources:c=!1,enabled:y=!0}=a;return m({queryKey:["papers-infinite",{page_size:e,search:r,order_by:t,order_dir:n,time:i,published_after:u,published_before:o,conference:s,latest_only:d,include_resources:c}],queryFn:({pageParam:l=1})=>p.getPapers({page:l,page_size:e,search:r,order_by:t,order_dir:n,time:i,published_after:u,published_before:o,conference:s,latest_only:d,include_resources:c}),getNextPageParam:l=>l.next_page,initialPageParam:1,enabled:y,staleTime:5*60*1e3,placeholderData:f,refetchOnWindowFocus:!1})}function T(a){const{taskId:e,page_size:r=20,order_by:t="date_published",order_dir:n="desc",latest_only:i=!0,include_resources:u=!0,enabled:o=!0}=a;return m({queryKey:["task-papers-infinite",e,{page_size:r,order_by:t,order_dir:n,latest_only:i,include_resources:u}],queryFn:({pageParam:s=1})=>p.getTaskPapers(e,{page:s,page_size:r,order_by:t,order_dir:n,latest_only:i,include_resources:u}),getNextPageParam:s=>s.next_page,initialPageParam:1,enabled:o&&!!e,staleTime:5*60*1e3,placeholderData:f,refetchOnWindowFocus:!1})}function x(a={}){const{limit:e=20,max_age_days:r=180,min_velocity:t,enabled:n=!0}=a;return g({queryKey:["trending-papers",{limit:e,max_age_days:r,min_velocity:t}],queryFn:()=>p.getTrendingPapers({limit:e,max_age_days:r,min_velocity:t}),enabled:n,staleTime:2*60*1e3,refetchOnWindowFocus:!1})}export{x as a,q as b,T as c,F as u};
 
 
assets/{usePeriodFilter-B4RSLVJ3.js → usePeriodFilter-NqcUWmWg.js} RENAMED
@@ -1 +1 @@
1
- import{r}from"./index-BcdJ5r4Y.js";import{b as a,s as f,c as u}from"./transform-Dasg-XFy.js";function l(s){const t=a(s);return t.setDate(1),t.setHours(0,0,0,0),t}const h=["Today","This Week","This Month","All Time"];function T(s="All Time"){const[t,i]=r.useState(s),n=r.useMemo(()=>{const o=new Date;let e=null;return t==="Today"?e=f(o):t==="This Week"?e=u(o,{weekStartsOn:1}):t==="This Month"&&(e=l(o)),e?e.toISOString():void 0},[t]);return{period:t,setPeriod:i,publishedAfter:n}}export{h as P,T as u};
 
1
+ import{r}from"./index-BWQiUBNk.js";import{b as a,s as f,c as u}from"./transform-DgWj1AQy.js";function l(s){const t=a(s);return t.setDate(1),t.setHours(0,0,0,0),t}const h=["Today","This Week","This Month","All Time"];function T(s="All Time"){const[t,i]=r.useState(s),n=r.useMemo(()=>{const o=new Date;let e=null;return t==="Today"?e=f(o):t==="This Week"?e=u(o,{weekStartsOn:1}):t==="This Month"&&(e=l(o)),e?e.toISOString():void 0},[t]);return{period:t,setPeriod:i,publishedAfter:n}}export{h as P,T as u};
assets/useQuery-B941khzD.js ADDED
@@ -0,0 +1 @@
 
 
1
+ var bt=s=>{throw TypeError(s)};var $=(s,t,e)=>t.has(s)||bt("Cannot "+e);var i=(s,t,e)=>($(s,t,"read from private field"),e?e.call(s):t.get(s)),p=(s,t,e)=>t.has(s)?bt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,e),u=(s,t,e,r)=>($(s,t,"write to private field"),r?r.call(s,e):t.set(s,e),e),l=(s,t,e)=>($(s,t,"access private method"),e);import{S as Mt,a3 as gt,a4 as S,J as q,a5 as j,M as tt,a6 as et,a7 as vt,a8 as Tt,a9 as Z,aa as Qt,ab as xt,ac as mt,I as Ct,r as O,Z as Ot,p as _t}from"./index-BWQiUBNk.js";var v,a,H,g,x,D,C,w,W,P,L,_,F,M,N,n,A,st,it,rt,at,nt,ht,ot,It,Et,Ft=(Et=class extends Mt{constructor(t,e){super();p(this,n);p(this,v);p(this,a);p(this,H);p(this,g);p(this,x);p(this,D);p(this,C);p(this,w);p(this,W);p(this,P);p(this,L);p(this,_);p(this,F);p(this,M);p(this,N,new Set);this.options=e,u(this,v,t),u(this,w,null),u(this,C,gt()),this.bindMethods(),this.setOptions(e)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(i(this,a).addObserver(this),Rt(i(this,a),this.options)?l(this,n,A).call(this):this.updateResult(),l(this,n,at).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ct(i(this,a),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ct(i(this,a),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,l(this,n,nt).call(this),l(this,n,ht).call(this),i(this,a).removeObserver(this)}setOptions(t){const e=this.options,r=i(this,a);if(this.options=i(this,v).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof S(this.options.enabled,i(this,a))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");l(this,n,ot).call(this),i(this,a).setOptions(this.options),e._defaulted&&!q(this.options,e)&&i(this,v).getQueryCache().notify({type:"observerOptionsUpdated",query:i(this,a),observer:this});const h=this.hasListeners();h&&St(i(this,a),r,this.options,e)&&l(this,n,A).call(this),this.updateResult(),h&&(i(this,a)!==r||S(this.options.enabled,i(this,a))!==S(e.enabled,i(this,a))||j(this.options.staleTime,i(this,a))!==j(e.staleTime,i(this,a)))&&l(this,n,st).call(this);const o=l(this,n,it).call(this);h&&(i(this,a)!==r||S(this.options.enabled,i(this,a))!==S(e.enabled,i(this,a))||o!==i(this,M))&&l(this,n,rt).call(this,o)}getOptimisticResult(t){const e=i(this,v).getQueryCache().build(i(this,v),t),r=this.createResult(e,t);return Dt(this,r)&&(u(this,g,r),u(this,D,this.options),u(this,x,i(this,a).state)),r}getCurrentResult(){return i(this,g)}trackResult(t,e){return new Proxy(t,{get:(r,h)=>(this.trackProp(h),e==null||e(h),h==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&i(this,C).status==="pending"&&i(this,C).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,h))})}trackProp(t){i(this,N).add(t)}getCurrentQuery(){return i(this,a)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=i(this,v).defaultQueryOptions(t),r=i(this,v).getQueryCache().build(i(this,v),e);return r.fetch().then(()=>this.createResult(r,e))}fetch(t){return l(this,n,A).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),i(this,g)))}createResult(t,e){var ft;const r=i(this,a),h=this.options,o=i(this,g),c=i(this,x),y=i(this,D),b=t!==r?t.state:i(this,H),{state:E}=t;let d={...E},T=!1,f;if(e._optimisticResults){const R=this.hasListeners(),k=!R&&Rt(t,e),V=R&&St(t,r,e,h);(k||V)&&(d={...d,...xt(E.data,t.options)}),e._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:Q,errorUpdatedAt:B,status:m}=d;f=d.data;let z=!1;if(e.placeholderData!==void 0&&f===void 0&&m==="pending"){let R;o!=null&&o.isPlaceholderData&&e.placeholderData===(y==null?void 0:y.placeholderData)?(R=o.data,z=!0):R=typeof e.placeholderData=="function"?e.placeholderData((ft=i(this,L))==null?void 0:ft.state.data,i(this,L)):e.placeholderData,R!==void 0&&(m="success",f=mt(o==null?void 0:o.data,R,e),T=!0)}if(e.select&&f!==void 0&&!z)if(o&&f===(c==null?void 0:c.data)&&e.select===i(this,W))f=i(this,P);else try{u(this,W,e.select),f=e.select(f),f=mt(o==null?void 0:o.data,f,e),u(this,P,f),u(this,w,null)}catch(R){u(this,w,R)}i(this,w)&&(Q=i(this,w),f=i(this,P),B=Date.now(),m="error");const G=d.fetchStatus==="fetching",X=m==="pending",Y=m==="error",lt=X&&G,dt=f!==void 0,I={status:m,fetchStatus:d.fetchStatus,isPending:X,isSuccess:m==="success",isError:Y,isInitialLoading:lt,isLoading:lt,data:f,dataUpdatedAt:d.dataUpdatedAt,error:Q,errorUpdatedAt:B,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:d.dataUpdateCount>b.dataUpdateCount||d.errorUpdateCount>b.errorUpdateCount,isFetching:G,isRefetching:G&&!X,isLoadingError:Y&&!dt,isPaused:d.fetchStatus==="paused",isPlaceholderData:T,isRefetchError:Y&&dt,isStale:ut(t,e),refetch:this.refetch,promise:i(this,C),isEnabled:S(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const R=I.data!==void 0,k=I.status==="error"&&!R,V=K=>{k?K.reject(I.error):R&&K.resolve(I.data)},pt=()=>{const K=u(this,C,I.promise=gt());V(K)},J=i(this,C);switch(J.status){case"pending":t.queryHash===r.queryHash&&V(J);break;case"fulfilled":(k||I.data!==J.value)&&pt();break;case"rejected":(!k||I.error!==J.reason)&&pt();break}}return I}updateResult(){const t=i(this,g),e=this.createResult(i(this,a),this.options);if(u(this,x,i(this,a).state),u(this,D,this.options),i(this,x).data!==void 0&&u(this,L,i(this,a)),q(e,t))return;u(this,g,e);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:h}=this.options,o=typeof h=="function"?h():h;if(o==="all"||!o&&!i(this,N).size)return!0;const c=new Set(o??i(this,N));return this.options.throwOnError&&c.add("error"),Object.keys(i(this,g)).some(y=>{const U=y;return i(this,g)[U]!==t[U]&&c.has(U)})};l(this,n,It).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&l(this,n,at).call(this)}},v=new WeakMap,a=new WeakMap,H=new WeakMap,g=new WeakMap,x=new WeakMap,D=new WeakMap,C=new WeakMap,w=new WeakMap,W=new WeakMap,P=new WeakMap,L=new WeakMap,_=new WeakMap,F=new WeakMap,M=new WeakMap,N=new WeakMap,n=new WeakSet,A=function(t){l(this,n,ot).call(this);let e=i(this,a).fetch(this.options,t);return t!=null&&t.throwOnError||(e=e.catch(tt)),e},st=function(){l(this,n,nt).call(this);const t=j(this.options.staleTime,i(this,a));if(et.isServer()||i(this,g).isStale||!vt(t))return;const r=Tt(i(this,g).dataUpdatedAt,t)+1;u(this,_,Z.setTimeout(()=>{i(this,g).isStale||this.updateResult()},r))},it=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(i(this,a)):this.options.refetchInterval)??!1},rt=function(t){l(this,n,ht).call(this),u(this,M,t),!(et.isServer()||S(this.options.enabled,i(this,a))===!1||!vt(i(this,M))||i(this,M)===0)&&u(this,F,Z.setInterval(()=>{(this.options.refetchIntervalInBackground||Qt.isFocused())&&l(this,n,A).call(this)},i(this,M)))},at=function(){l(this,n,st).call(this),l(this,n,rt).call(this,l(this,n,it).call(this))},nt=function(){i(this,_)!==void 0&&(Z.clearTimeout(i(this,_)),u(this,_,void 0))},ht=function(){i(this,F)!==void 0&&(Z.clearInterval(i(this,F)),u(this,F,void 0))},ot=function(){const t=i(this,v).getQueryCache().build(i(this,v),this.options);if(t===i(this,a))return;const e=i(this,a);u(this,a,t),u(this,H,t.state),this.hasListeners()&&(e==null||e.removeObserver(this),t.addObserver(this))},It=function(t){Ct.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(i(this,g))}),i(this,v).getQueryCache().notify({query:i(this,a),type:"observerResultsUpdated"})})},Et);function Ut(s,t){return S(t.enabled,s)!==!1&&s.state.data===void 0&&!(s.state.status==="error"&&S(t.retryOnMount,s)===!1)}function Rt(s,t){return Ut(s,t)||s.state.data!==void 0&&ct(s,t,t.refetchOnMount)}function ct(s,t,e){if(S(t.enabled,s)!==!1&&j(t.staleTime,s)!=="static"){const r=typeof e=="function"?e(s):e;return r==="always"||r!==!1&&ut(s,t)}return!1}function St(s,t,e,r){return(s!==t||S(r.enabled,s)===!1)&&(!e.suspense||s.state.status!=="error")&&ut(s,e)}function ut(s,t){return S(t.enabled,s)!==!1&&s.isStaleByTime(j(t.staleTime,s))}function Dt(s,t){return!q(s.getCurrentResult(),t)}var wt=O.createContext(!1),Pt=()=>O.useContext(wt);wt.Provider;function Lt(){let s=!1;return{clearReset:()=>{s=!1},reset:()=>{s=!0},isReset:()=>s}}var Nt=O.createContext(Lt()),Bt=()=>O.useContext(Nt),kt=(s,t,e)=>{const r=e!=null&&e.state.error&&typeof s.throwOnError=="function"?Ot(s.throwOnError,[e.state.error,e]):s.throwOnError;(s.suspense||s.experimental_prefetchInRender||r)&&(t.isReset()||(s.retryOnMount=!1))},At=s=>{O.useEffect(()=>{s.clearReset()},[s])},jt=({result:s,errorResetBoundary:t,throwOnError:e,query:r,suspense:h})=>s.isError&&!t.isReset()&&!s.isFetching&&r&&(h&&s.data===void 0||Ot(e,[s.error,r])),Ht=s=>{if(s.suspense){const e=h=>h==="static"?h:Math.max(h??1e3,1e3),r=s.staleTime;s.staleTime=typeof r=="function"?(...h)=>e(r(...h)):e(r),typeof s.gcTime=="number"&&(s.gcTime=Math.max(s.gcTime,1e3))}},Wt=(s,t)=>s.isLoading&&s.isFetching&&!t,zt=(s,t)=>(s==null?void 0:s.suspense)&&t.isPending,yt=(s,t,e)=>t.fetchOptimistic(s).catch(()=>{e.clearReset()});function Vt(s,t,e){var T,f,Q,B;const r=Pt(),h=Bt(),o=_t(),c=o.defaultQueryOptions(s);(f=(T=o.getDefaultOptions().queries)==null?void 0:T._experimental_beforeQuery)==null||f.call(T,c);const y=o.getQueryCache().get(c.queryHash);c._optimisticResults=r?"isRestoring":"optimistic",Ht(c),kt(c,h,y),At(h);const U=!o.getQueryCache().get(c.queryHash),[b]=O.useState(()=>new t(o,c)),E=b.getOptimisticResult(c),d=!r&&s.subscribed!==!1;if(O.useSyncExternalStore(O.useCallback(m=>{const z=d?b.subscribe(Ct.batchCalls(m)):tt;return b.updateResult(),z},[b,d]),()=>b.getCurrentResult(),()=>b.getCurrentResult()),O.useEffect(()=>{b.setOptions(c)},[c,b]),zt(c,E))throw yt(c,b,h);if(jt({result:E,errorResetBoundary:h,throwOnError:c.throwOnError,query:y,suspense:c.suspense}))throw E.error;if((B=(Q=o.getDefaultOptions().queries)==null?void 0:Q._experimental_afterQuery)==null||B.call(Q,c,E),c.experimental_prefetchInRender&&!et.isServer()&&Wt(E,r)){const m=U?yt(c,b,h):y==null?void 0:y.promise;m==null||m.catch(tt).finally(()=>{b.updateResult()})}return c.notifyOnChangeProps?E:b.trackResult(E)}function Gt(s,t){return Vt(s,Ft)}export{Ft as Q,Pt as a,Bt as b,kt as c,At as d,Ht as e,yt as f,jt as g,Vt as h,zt as s,Gt as u};
favicon-192.png ADDED