nielsr HF Staff commited on
Commit
5f99376
·
verified ·
1 Parent(s): 322179a

Sync paperswithcode.co frontend

Browse files
Files changed (34) hide show
  1. assets/BenchmarkDetailView-BFX5j8r9.js +2 -0
  2. assets/BenchmarkDetailView-QhpW5Yev.js +0 -1
  3. assets/{CronDashboard-B5jhO0Hx.js → CronDashboard-BJLOLf49.js} +1 -1
  4. assets/{FeedView-TyQhH5TM.js → FeedView-VglAKTTo.js} +1 -1
  5. assets/{LatexTitle-fGDJSovl.js → LatexTitle-CbOP0isa.js} +1 -1
  6. assets/{MethodDetailView-Fbq_29GX.js → MethodDetailView-BXXICNAd.js} +0 -0
  7. assets/{MethodsIndexView-DdfaLJ-H.js → MethodsIndexView-CF_jCe6d.js} +1 -1
  8. assets/{NotFound-CWF4noj9.js → NotFound-CMGYqDmr.js} +1 -1
  9. assets/PaperDetailView-CRsXQgzN.js +0 -46
  10. assets/PaperDetailView-De0mLZCp.js +46 -0
  11. assets/{PapersListView-DaGKJdn2.js → PapersListView-CIlHl_0S.js} +1 -1
  12. assets/{SavedPapersView-Dn3yVoa-.js → SavedPapersView-Vf8zOvxz.js} +1 -1
  13. assets/SearchOverlay-CGeqDGTE.js +1 -0
  14. assets/SearchOverlay-ML-XIg7G.js +0 -1
  15. assets/{SubmitView-C-2pf8nE.js → SubmitView-BTOuC0rd.js} +1 -1
  16. assets/{TagBrowseView-DmWUoQiW.js → TagBrowseView-wiX11K6Q.js} +1 -1
  17. assets/{TagsIndexView-Dw7WBt8G.js → TagsIndexView-1TeE1k6L.js} +1 -1
  18. assets/{alert-Bm-7arBk.js → alert-B6WjabOu.js} +1 -1
  19. assets/{api-DxZAbqc3.js → api-5i4Mf2ca.js} +1 -1
  20. assets/{badge-kHfqSFB-.js → badge-CAs_Xk6U.js} +1 -1
  21. assets/{components-CewLBhcc.js → components-vAXr5Yrz.js} +1 -1
  22. assets/{index-khuRhj0-.js → index-RvrzVxyQ.js} +0 -0
  23. assets/{index-D4WvUqkN.css → index-btXf_hHY.css} +0 -0
  24. assets/{input-CONfoWHZ.js → input-DBg77x-j.js} +1 -1
  25. assets/{skeleton-DAoGkyKK.js → skeleton-vJLXL7dU.js} +1 -1
  26. assets/{transform-Bqq4PHFq.js → transform-C19D-_iA.js} +1 -1
  27. assets/{useDebounce-ECOTH_xV.js → useDebounce-UZQdQpzf.js} +1 -1
  28. assets/{useInfiniteQuery-DRYtGZQa.js → useInfiniteQuery-D6kOn4ET.js} +1 -1
  29. assets/{useIntersectionObserver-DbPRy1RB.js → useIntersectionObserver-b_ghxvrt.js} +1 -1
  30. assets/{useMutation-VlZbYGe6.js → useMutation-BChaaj62.js} +1 -1
  31. assets/{usePapers-BGzr0Zy3.js → usePapers-Dilp1UjP.js} +1 -1
  32. assets/{usePeriodFilter-BdoqZixi.js → usePeriodFilter-vtzRDJbK.js} +1 -1
  33. assets/{useQuery-Caj49BNs.js → useQuery-DBPiiCZh.js} +1 -1
  34. index.html +17 -2
assets/BenchmarkDetailView-BFX5j8r9.js ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ import{x as Xe,u as Ye,r as k,j as s,L as G,H as W,q as Je,y as Ze}from"./index-RvrzVxyQ.js";import{u as K}from"./useQuery-DBPiiCZh.js";import{a as Q}from"./api-5i4Mf2ca.js";import{S as ce}from"./skeleton-vJLXL7dU.js";import{A as et,a as tt}from"./alert-B6WjabOu.js";import{L as oe}from"./LatexTitle-CbOP0isa.js";import{I as rt}from"./components-vAXr5Yrz.js";import"./adminAuth-PI_XkM8E.js";import"./transform-C19D-_iA.js";function nt(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const r=document.implementation.createHTMLDocument(),n=r.createElement("base"),i=r.createElement("a");return r.head.appendChild(n),r.body.appendChild(i),t&&(n.href=t),i.href=e,i.href}const st=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function B(e){const t=[];for(let r=0,n=e.length;r<n;r++)t.push(e[r]);return t}let U=null;function Be(e={}){return U||(e.includeStyleProperties?(U=e.includeStyleProperties,U):(U=B(window.getComputedStyle(document.documentElement)),U))}function ee(e,t){const n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace("px","")):0}function at(e){const t=ee(e,"border-left-width"),r=ee(e,"border-right-width");return e.clientWidth+t+r}function it(e){const t=ee(e,"border-top-width"),r=ee(e,"border-bottom-width");return e.clientHeight+t+r}function He(e,t={}){const r=t.width||at(e),n=t.height||it(e);return{width:r,height:n}}function lt(){let e,t;try{t=process}catch{}const r=t&&t.env?t.env.devicePixelRatio:null;return r&&(e=parseInt(r,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const N=16384;function ct(e){(e.width>N||e.height>N)&&(e.width>N&&e.height>N?e.width>e.height?(e.height*=N/e.width,e.width=N):(e.width*=N/e.height,e.height=N):e.width>N?(e.height*=N/e.width,e.width=N):(e.width*=N/e.height,e.height=N))}function ot(e,t={}){return e.toBlob?new Promise(r=>{e.toBlob(r,t.type?t.type:"image/png",t.quality?t.quality:1)}):new Promise(r=>{const n=window.atob(e.toDataURL(t.type?t.type:void 0,t.quality?t.quality:void 0).split(",")[1]),i=n.length,a=new Uint8Array(i);for(let l=0;l<i;l+=1)a[l]=n.charCodeAt(l);r(new Blob([a],{type:t.type?t.type:"image/png"}))})}function te(e){return new Promise((t,r)=>{const n=new Image;n.onload=()=>{n.decode().then(()=>{requestAnimationFrame(()=>t(n))})},n.onerror=r,n.crossOrigin="anonymous",n.decoding="async",n.src=e})}async function ut(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function dt(e,t,r){const n="http://www.w3.org/2000/svg",i=document.createElementNS(n,"svg"),a=document.createElementNS(n,"foreignObject");return i.setAttribute("width",`${t}`),i.setAttribute("height",`${r}`),i.setAttribute("viewBox",`0 0 ${t} ${r}`),a.setAttribute("width","100%"),a.setAttribute("height","100%"),a.setAttribute("x","0"),a.setAttribute("y","0"),a.setAttribute("externalResourcesRequired","true"),i.appendChild(a),a.appendChild(e),ut(i)}const T=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||T(r,t)};function ht(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function mt(e,t){return Be(t).map(r=>{const n=e.getPropertyValue(r),i=e.getPropertyPriority(r);return`${r}: ${n}${i?" !important":""};`}).join(" ")}function ft(e,t,r,n){const i=`.${e}:${t}`,a=r.cssText?ht(r):mt(r,n);return document.createTextNode(`${i}{${a}}`)}function Te(e,t,r,n){const i=window.getComputedStyle(e,r),a=i.getPropertyValue("content");if(a===""||a==="none")return;const l=st();try{t.className=`${t.className} ${l}`}catch{return}const c=document.createElement("style");c.appendChild(ft(l,r,i,n)),t.appendChild(c)}function pt(e,t,r){Te(e,t,":before",r),Te(e,t,":after",r)}const Le="application/font-woff",Fe="image/jpeg",gt={woff:Le,woff2:Le,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Fe,jpeg:Fe,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function yt(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function me(e){const t=yt(e).toLowerCase();return gt[t]||""}function xt(e){return e.split(/,/)[1]}function he(e){return e.search(/^(data:)/)!==-1}function bt(e,t){return`data:${t};base64,${e}`}async function Ve(e,t,r){const n=await fetch(e,t);if(n.status===404)throw new Error(`Resource "${n.url}" not found`);const i=await n.blob();return new Promise((a,l)=>{const c=new FileReader;c.onerror=l,c.onloadend=()=>{try{a(r({res:n,result:c.result}))}catch(d){l(d)}},c.readAsDataURL(i)})}const ue={};function wt(e,t,r){let n=e.replace(/\?.*/,"");return r&&(n=e),/ttf|otf|eot|woff2?/i.test(n)&&(n=n.replace(/.*\//,"")),t?`[${t}]${n}`:n}async function fe(e,t,r){const n=wt(e,t,r.includeQueryParams);if(ue[n]!=null)return ue[n];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{const a=await Ve(e,r.fetchRequestInit,({res:l,result:c})=>(t||(t=l.headers.get("Content-Type")||""),xt(c)));i=bt(a,t)}catch(a){i=r.imagePlaceholder||"";let l=`Failed to fetch resource: ${e}`;a&&(l=typeof a=="string"?a:a.message),l&&console.warn(l)}return ue[n]=i,i}async function vt(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):te(t)}async function jt(e,t){if(e.currentSrc){const a=document.createElement("canvas"),l=a.getContext("2d");a.width=e.clientWidth,a.height=e.clientHeight,l==null||l.drawImage(e,0,0,a.width,a.height);const c=a.toDataURL();return te(c)}const r=e.poster,n=me(r),i=await fe(r,n,t);return te(i)}async function St(e,t){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await re(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function kt(e,t){return T(e,HTMLCanvasElement)?vt(e):T(e,HTMLVideoElement)?jt(e,t):T(e,HTMLIFrameElement)?St(e,t):e.cloneNode(Ue(e))}const Ct=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",Ue=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function Et(e,t,r){var n,i;if(Ue(t))return t;let a=[];return Ct(e)&&e.assignedNodes?a=B(e.assignedNodes()):T(e,HTMLIFrameElement)&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?a=B(e.contentDocument.body.childNodes):a=B(((i=e.shadowRoot)!==null&&i!==void 0?i:e).childNodes),a.length===0||T(e,HTMLVideoElement)||await a.reduce((l,c)=>l.then(()=>re(c,r)).then(d=>{d&&t.appendChild(d)}),Promise.resolve()),t}function Rt(e,t,r){const n=t.style;if(!n)return;const i=window.getComputedStyle(e);i.cssText?(n.cssText=i.cssText,n.transformOrigin=i.transformOrigin):Be(r).forEach(a=>{let l=i.getPropertyValue(a);a==="font-size"&&l.endsWith("px")&&(l=`${Math.floor(parseFloat(l.substring(0,l.length-2)))-.1}px`),T(e,HTMLIFrameElement)&&a==="display"&&l==="inline"&&(l="block"),a==="d"&&t.getAttribute("d")&&(l=`path(${t.getAttribute("d")})`),n.setProperty(a,l,i.getPropertyPriority(a))})}function _t(e,t){T(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),T(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function $t(e,t){if(T(e,HTMLSelectElement)){const r=t,n=Array.from(r.children).find(i=>e.value===i.getAttribute("value"));n&&n.setAttribute("selected","")}}function Tt(e,t,r){return T(t,Element)&&(Rt(e,t,r),pt(e,t,r),_t(e,t),$t(e,t)),t}async function Lt(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const n={};for(let a=0;a<r.length;a++){const c=r[a].getAttribute("xlink:href");if(c){const d=e.querySelector(c),p=document.querySelector(c);!d&&p&&!n[c]&&(n[c]=await re(p,t,!0))}}const i=Object.values(n);if(i.length){const a="http://www.w3.org/1999/xhtml",l=document.createElementNS(a,"svg");l.setAttribute("xmlns",a),l.style.position="absolute",l.style.width="0",l.style.height="0",l.style.overflow="hidden",l.style.display="none";const c=document.createElementNS(a,"defs");l.appendChild(c);for(let d=0;d<i.length;d++)c.appendChild(i[d]);e.appendChild(l)}return e}async function re(e,t,r){return!r&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(n=>kt(n,t)).then(n=>Et(e,n,t)).then(n=>Tt(e,n,t)).then(n=>Lt(n,t))}const qe=/url\((['"]?)([^'"]+?)\1\)/g,Ft=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Nt=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function Mt(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function It(e){const t=[];return e.replace(qe,(r,n,i)=>(t.push(i),r)),t.filter(r=>!he(r))}async function At(e,t,r,n,i){try{const a=r?nt(t,r):t,l=me(t);let c;return i||(c=await fe(a,l,n)),e.replace(Mt(t),`$1${c}$3`)}catch{}return e}function Pt(e,{preferredFontFormat:t}){return t?e.replace(Nt,r=>{for(;;){const[n,,i]=Ft.exec(r)||[];if(!i)return"";if(i===t)return`src: ${n};`}}):e}function We(e){return e.search(qe)!==-1}async function Oe(e,t,r){if(!We(e))return e;const n=Pt(e,r);return It(n).reduce((a,l)=>a.then(c=>At(c,l,t,r)),Promise.resolve(n))}async function q(e,t,r){var n;const i=(n=t.style)===null||n===void 0?void 0:n.getPropertyValue(e);if(i){const a=await Oe(i,null,r);return t.style.setProperty(e,a,t.style.getPropertyPriority(e)),!0}return!1}async function Dt(e,t){await q("background",e,t)||await q("background-image",e,t),await q("mask",e,t)||await q("-webkit-mask",e,t)||await q("mask-image",e,t)||await q("-webkit-mask-image",e,t)}async function Bt(e,t){const r=T(e,HTMLImageElement);if(!(r&&!he(e.src))&&!(T(e,SVGImageElement)&&!he(e.href.baseVal)))return;const n=r?e.src:e.href.baseVal,i=await fe(n,me(n),t);await new Promise((a,l)=>{e.onload=a,e.onerror=t.onImageErrorHandler?(...d)=>{try{a(t.onImageErrorHandler(...d))}catch(p){l(p)}}:l;const c=e;c.decode&&(c.decode=a),c.loading==="lazy"&&(c.loading="eager"),r?(e.srcset="",e.src=i):e.href.baseVal=i})}async function Ht(e,t){const n=B(e.childNodes).map(i=>ze(i,t));await Promise.all(n).then(()=>e)}async function ze(e,t){T(e,Element)&&(await Dt(e,t),await Bt(e,t),await Ht(e,t))}function Vt(e,t){const{style:r}=e;t.backgroundColor&&(r.backgroundColor=t.backgroundColor),t.width&&(r.width=`${t.width}px`),t.height&&(r.height=`${t.height}px`);const n=t.style;return n!=null&&Object.keys(n).forEach(i=>{r[i]=n[i]}),e}const Ne={};async function Me(e){let t=Ne[e];if(t!=null)return t;const n=await(await fetch(e)).text();return t={url:e,cssText:n},Ne[e]=t,t}async function Ie(e,t){let r=e.cssText;const n=/url\(["']?([^"')]+)["']?\)/g,a=(r.match(/url\([^)]+\)/g)||[]).map(async l=>{let c=l.replace(n,"$1");return c.startsWith("https://")||(c=new URL(c,e.url).href),Ve(c,t.fetchRequestInit,({result:d})=>(r=r.replace(l,`url(${d})`),[l,d]))});return Promise.all(a).then(()=>r)}function Ae(e){if(e==null)return[];const t=[],r=/(\/\*[\s\S]*?\*\/)/gi;let n=e.replace(r,"");const i=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const d=i.exec(n);if(d===null)break;t.push(d[0])}n=n.replace(i,"");const a=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,l="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",c=new RegExp(l,"gi");for(;;){let d=a.exec(n);if(d===null){if(d=c.exec(n),d===null)break;a.lastIndex=c.lastIndex}else c.lastIndex=a.lastIndex;t.push(d[0])}return t}async function Ut(e,t){const r=[],n=[];return e.forEach(i=>{if("cssRules"in i)try{B(i.cssRules||[]).forEach((a,l)=>{if(a.type===CSSRule.IMPORT_RULE){let c=l+1;const d=a.href,p=Me(d).then(u=>Ie(u,t)).then(u=>Ae(u).forEach(g=>{try{i.insertRule(g,g.startsWith("@import")?c+=1:i.cssRules.length)}catch(M){console.error("Error inserting rule from remote css",{rule:g,error:M})}})).catch(u=>{console.error("Error loading remote css",u.toString())});n.push(p)}})}catch(a){const l=e.find(c=>c.href==null)||document.styleSheets[0];i.href!=null&&n.push(Me(i.href).then(c=>Ie(c,t)).then(c=>Ae(c).forEach(d=>{l.insertRule(d,l.cssRules.length)})).catch(c=>{console.error("Error loading remote stylesheet",c)})),console.error("Error inlining remote css file",a)}}),Promise.all(n).then(()=>(e.forEach(i=>{if("cssRules"in i)try{B(i.cssRules||[]).forEach(a=>{r.push(a)})}catch(a){console.error(`Error while reading CSS rules from ${i.href}`,a)}}),r))}function qt(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>We(t.style.getPropertyValue("src")))}async function Wt(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=B(e.ownerDocument.styleSheets),n=await Ut(r,t);return qt(n)}function Ge(e){return e.trim().replace(/["']/g,"")}function Ot(e){const t=new Set;function r(n){(n.style.fontFamily||getComputedStyle(n).fontFamily).split(",").forEach(a=>{t.add(Ge(a))}),Array.from(n.children).forEach(a=>{a instanceof HTMLElement&&r(a)})}return r(e),t}async function zt(e,t){const r=await Wt(e,t),n=Ot(e);return(await Promise.all(r.filter(a=>n.has(Ge(a.style.fontFamily))).map(a=>{const l=a.parentStyleSheet?a.parentStyleSheet.href:null;return Oe(a.cssText,l,t)}))).join(`
2
+ `)}async function Gt(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await zt(e,t);if(r){const n=document.createElement("style"),i=document.createTextNode(r);n.appendChild(i),e.firstChild?e.insertBefore(n,e.firstChild):e.appendChild(n)}}async function Kt(e,t={}){const{width:r,height:n}=He(e,t),i=await re(e,t,!0);return await Gt(i,t),await ze(i,t),Vt(i,t),await dt(i,r,n)}async function Qt(e,t={}){const{width:r,height:n}=He(e,t),i=await Kt(e,t),a=await te(i),l=document.createElement("canvas"),c=l.getContext("2d"),d=t.pixelRatio||lt(),p=t.canvasWidth||r,u=t.canvasHeight||n;return l.width=p*d,l.height=u*d,t.skipAutoScale||ct(l),l.style.width=`${p}`,l.style.height=`${u}`,t.backgroundColor&&(c.fillStyle=t.backgroundColor,c.fillRect(0,0,l.width,l.height)),c.drawImage(a,0,0,l.width,l.height),l}async function Xt(e,t={}){const r=await Qt(e,t);return await ot(r)}const Pe="#ffffff";function Yt(e){if(typeof window>"u")return Pe;const t=window.getComputedStyle(e).backgroundColor;return!t||t==="rgba(0, 0, 0, 0)"||t==="transparent"?Pe:t}async function Jt(e){var r,n;if(typeof window>"u"||!((n=(r=window.navigator)==null?void 0:r.clipboard)!=null&&n.write))throw new Error("Clipboard image copy is not supported in this browser.");if(typeof window.ClipboardItem>"u")throw new Error("Clipboard image copy is not supported in this browser.");const t=await Xt(e,{pixelRatio:2,cacheBust:!0,backgroundColor:Yt(e)});if(!t)throw new Error("Failed to render screenshot.");await window.navigator.clipboard.write([new window.ClipboardItem({"image/png":t})])}const de=5;function Zt(e){if(!e)return null;const t=e.trim(),r=t.match(/^https?:\/\/(?:www\.)?arxiv\.org\/(?:abs|pdf)\/([^/?#]+)/i);if(r!=null&&r[1])return r[1].replace(/\.pdf$/i,"");const n=t.match(/^(?:https?:\/\/(?:www\.)?paperswithcode\.co)?\/paper\/([^/?#]+)/i);return(n==null?void 0:n[1])??null}const er=({points:e,metric:t})=>{const r=Ze(),[n,i]=k.useState(null),a=880,l=320,c=60,d=30,p=24,u=50,g=e.map(h=>h.value),M=Math.min(...g),I=Math.max(...g)-M||1,Y=a-c-d,_=l-p-u,ne=Y/Math.max(1,e.length-1),L=e.map((h,y)=>{const C=c+y*ne,$=(h.value-M)/I,P=p+_*(1-$);return{x:C,y:P,data:h}});let S=`M${L[0].x},${L[0].y}`;for(let h=1;h<L.length;h++){const y=L[h-1],C=L[h],$=(y.x+C.x)/2;S+=` C${$},${y.y} ${$},${C.y} ${C.x},${C.y}`}const J=5,x=h=>i(y=>y===h?null:y),se=h=>{h&&r(`/paper/${h}`)};return s.jsxs("svg",{width:"100%",viewBox:`0 0 ${a} ${l}`,style:{display:"block"},children:[s.jsx("text",{x:c-38,y:p+_/2,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"middle",transform:`rotate(-90 ${c-38} ${p+_/2})`,children:t}),Array.from({length:J}).map((h,y)=>{const C=y/(J-1),$=p+_*(1-C),P=M+I*C;return s.jsxs("g",{children:[s.jsx("line",{x1:c,y1:$,x2:a-d,y2:$,stroke:"var(--hairline)",strokeWidth:"1"}),s.jsx("text",{x:c-10,y:$+4,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"end",children:W(P)})]},y)}),L.map((h,y)=>s.jsx("text",{x:h.x,y:l-u+18,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:"middle",children:h.data.dateLabel},y)),s.jsx("path",{d:S,stroke:"var(--accent)",strokeWidth:"2",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),L.map((h,y)=>{const C=n===y,P=`${h.data.modelName||h.data.paperTitle||"Unknown model"}: ${W(h.data.value)} on ${h.data.dateLabel}`,F=!!h.data.paperRouteId;return s.jsxs("g",{children:[s.jsx("circle",{cx:h.x,cy:h.y,r:C?6:4.5,fill:C?"var(--accent)":"var(--bg-elevated)",stroke:"var(--accent)",strokeWidth:"2",style:{transition:"r 0.12s ease, fill 0.12s ease"}}),s.jsx("circle",{cx:h.x,cy:h.y,r:"14",fill:"transparent",style:{cursor:F?"pointer":"default",outline:"none"},tabIndex:0,role:F?"link":"img","aria-label":P,onMouseEnter:()=>i(y),onMouseLeave:()=>x(y),onFocus:()=>i(y),onBlur:()=>x(y),onClick:()=>se(h.data.paperRouteId),onKeyDown:b=>{F&&(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),se(h.data.paperRouteId))},children:s.jsx("title",{children:P})})]},y)}),n!==null&&(()=>{const h=L[n],y=h.data.modelName||h.data.paperTitle||"Unknown model",C=y.length>40?y.slice(0,39)+"…":y,$=`${W(h.data.value)} · ${h.data.dateLabel}`,F=Math.max(140,Math.min(320,Math.max(C.length,$.length)*6.6+24)),b=46;let A=h.x-F/2;A<c&&(A=c),A+F>a-d&&(A=a-d-F);const E=h.y-b-14>=p?h.y-b-12:h.y+12;return s.jsxs("g",{pointerEvents:"none",children:[s.jsx("rect",{x:A,y:E,width:F,height:b,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))"}}),s.jsx("text",{x:A+12,y:E+19,fontSize:"12",fontFamily:"var(--sans)",fill:"var(--ink)",fontWeight:500,children:C}),s.jsx("text",{x:A+12,y:E+36,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",children:$})]})})()]})};function X(e){if(e==null)return null;if(typeof e=="number")return Number.isFinite(e)?e:null;const t=e.includes("±")?e.split("±")[0].trim():e.trim(),r=parseFloat(t);return Number.isFinite(r)?r:null}function tr(e,t,r){if(e.length===0)return{points:[],sota:0,sotaModel:""};const n=e.map(u=>{var O;const g=X((O=u.metrics)==null?void 0:O[t]),M=u.paper_published_date||"";return{eval:u,value:g,date:M}}).filter(u=>u.value!==null&&!!u.date).sort((u,g)=>u.date.localeCompare(g.date)),i=[];let a=null;for(const u of n)(a==null?!0:r==="↓"?u.value<a:u.value>a)&&(a=u.value,i.push({value:u.value,dateLabel:u.date.slice(0,7),modelName:u.eval.model_name||"",paperTitle:u.eval.paper_title||"",paperRouteId:u.eval.paper_arxiv_id||u.eval.paper_id||null}));const c=e.map(u=>{var g;return{eval:u,value:X((g=u.metrics)==null?void 0:g[t])}}).filter(u=>u.value!==null).sort((u,g)=>r==="↓"?u.value-g.value:g.value-u.value)[0],d=(c==null?void 0:c.value)??0,p=(c==null?void 0:c.eval.model_name)||(c==null?void 0:c.eval.paper_title)||"";return{points:i,sota:d,sotaModel:p}}const De=({targetRef:e,label:t})=>{const{toast:r}=Je(),[n,i]=k.useState("idle"),a=k.useRef(null);k.useEffect(()=>()=>{a.current!==null&&window.clearTimeout(a.current)},[]);const l=k.useCallback(async()=>{const d=e.current;if(d){i("copying"),d.classList.add("is-capturing"),d.offsetHeight,await new Promise(p=>window.requestAnimationFrame(()=>p()));try{await Jt(d),i("copied"),r({title:"Screenshot copied",description:`Image of the ${t} copied to your clipboard.`}),a.current!==null&&window.clearTimeout(a.current),a.current=window.setTimeout(()=>i("idle"),1500)}catch(p){i("idle"),r({title:"Copy failed",description:p instanceof Error&&p.message?p.message:"Could not copy the screenshot to your clipboard.",variant:"destructive"})}finally{d.classList.remove("is-capturing")}}},[e,t,r]),c=n==="copied"?"Copied":n==="copying"?"Copying…":"Copy image";return s.jsxs("button",{type:"button",className:"bm-copy-btn",onClick:l,disabled:n==="copying","aria-label":`Copy ${t} screenshot to clipboard`,title:`Copy ${t} screenshot to clipboard`,children:[s.jsx(rt,{name:"copy",size:11}),c]})},dr=()=>{var pe,ge,ye,xe,be,we,ve,je,Se,ke;const{datasetSlug:e}=Xe(),[t]=Ye(),r=t.get("task")||void 0,n=t.get("eval")||void 0,[i,a]=k.useState(void 0),l=k.useRef(null),c=k.useRef(!1),d=k.useRef(null),p=k.useRef(null),u=K({queryKey:["dataset",e,"with-paper"],queryFn:()=>Q.getDatasetBySlug(e,{include_paper:!0}),enabled:!!e,staleTime:10*60*1e3}),g=K({queryKey:["dataset-evals",(pe=u.data)==null?void 0:pe.id],queryFn:()=>Q.getEvaluationsByDataset(u.data.id),enabled:!!((ge=u.data)!=null&&ge.id),staleTime:5*60*1e3}),M=K({queryKey:["dataset-tasks",(ye=u.data)==null?void 0:ye.id],queryFn:()=>Q.getDatasetTasks(u.data.id),enabled:!!((xe=u.data)!=null&&xe.id),staleTime:10*60*1e3}),O=K({queryKey:["metric-directions"],queryFn:()=>Q.getMetricDirections(),staleTime:60*60*1e3}),I=k.useMemo(()=>{const o=M.data||[];if(o.length===0)return null;if(r){const f=o.find(v=>v.slug===r);if(f)return f.id}if(o.length===1)return o[0].id;const m=g.data||[];if(m.length>0){const f=new Map;for(const j of m)f.set(j.task_id,(f.get(j.task_id)||0)+1);let v=null,w=-1;for(const j of o){const D=f.get(j.id)||0;D>w&&(w=D,v=j.id)}if(v)return v}return o[0].id},[M.data,g.data,r]),Y=K({queryKey:["leaderboard-metrics",(be=u.data)==null?void 0:be.id,I],queryFn:()=>Q.getLeaderboardMetrics(u.data.id,I),enabled:!!((we=u.data)!=null&&we.id)&&!!I,staleTime:10*60*1e3}),_=k.useMemo(()=>{const o=g.data||[];return I?o.filter(m=>m.task_id===I):o},[g.data,I]),ne=k.useMemo(()=>{const o=new Set;return _.forEach(m=>{m.best_metric&&o.add(m.best_metric),Object.keys(m.metrics||{}).forEach(f=>o.add(f))}),Array.from(o)},[_]),L=k.useMemo(()=>(Y.data||[]).map(o=>o.metric_name),[Y.data]),S=L.length?L:ne,J=k.useMemo(()=>{var v;if(_.length===0)return S[0]||"";const o=new Map;for(const w of _)w.best_metric&&(L.length&&!S.includes(w.best_metric)||o.set(w.best_metric,(o.get(w.best_metric)||0)+1));let m=null,f=0;for(const[w,j]of o)j>f&&(f=j,m=w);return m||S[0]||((v=_[0])==null?void 0:v.best_metric)||""},[_,S,L]),x=i||J,h=(((je=(ve=O.data)==null?void 0:ve.directions)==null?void 0:je[x])||"higher_is_better")==="lower_is_better"?"↓":"↑",y=k.useMemo(()=>{if(S.length===0)return x?[x]:[];if(S.length<=de)return S;const o=[],m=x&&S.includes(x),f=m?de-1:de;let v=0;for(const w of S)w!==x&&(v>=f||(o.push(w),v++));if(m){const w=S.findIndex(D=>D===x),j=S.slice(0,w).filter(D=>o.includes(D)).length;o.splice(j,0,x)}return o},[S,x]),{points:C,sota:$,sotaModel:P}=k.useMemo(()=>tr(_,x,h),[_,x,h]);k.useEffect(()=>{if(c.current||!n||!g.data||g.data.length===0)return;const o=l.current;o&&(c.current=!0,o.scrollIntoView({behavior:"smooth",block:"start"}))},[n,g.data]);const F=k.useMemo(()=>{const o=M.data||[];return I?o.find(m=>m.id===I)||o[0]||null:o[0]||null},[M.data,I]);if(u.isLoading)return s.jsxs("div",{className:"page",children:[s.jsx(ce,{className:"h-12 w-1/2 mb-6"}),s.jsx(ce,{className:"h-64 w-full"})]});if(u.error||!u.data)return s.jsx("div",{className:"page",children:s.jsx(et,{variant:"destructive",children:s.jsx(tt,{children:"Benchmark not found."})})});const b=u.data,A=_.slice().sort((o,m)=>{var w,j;const f=X((w=o.metrics)==null?void 0:w[x]),v=X((j=m.metrics)==null?void 0:j[x]);return f!==null&&v!==null?h==="↓"?f-v:v-f:f!==null?-1:v!==null?1:(o.best_rank??9999)-(m.best_rank??9999)}),ae=!!b.supports_harness,E=n&&A.find(o=>o.id===n)||null,R=b.introducing_paper??void 0,z=(R==null?void 0:R.arxiv_id)||(R==null?void 0:R.id)||Zt(b.paper_url),H=(R==null?void 0:R.title)||b.introducing_paper_title||null,V=((Se=R==null?void 0:R.published)==null?void 0:Se.slice(0,4))||b.introduced_year||null,Ke=!!z||!!b.paper_url||!!H,Qe=R!=null&&R.arxiv_id||(ke=b.paper_url)!=null&&ke.match(/^https?:\/\/(?:www\.)?arxiv\.org\//i)?`arXiv:${z}`:`Paper ${z}`;return s.jsx("div",{className:"page",children:s.jsxs("div",{className:"bm-page",children:[s.jsxs("div",{className:"breadcrumb",children:[s.jsx(G,{to:"/tasks",children:"Tasks"}),F&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"sep",children:"/"}),s.jsx(G,{to:`/tasks/${F.slug||F.id}`,children:F.name})]}),s.jsx("span",{className:"sep",children:"/"}),s.jsx("span",{style:{color:"var(--accent-text)"},children:b.name})]}),s.jsx("h1",{className:"bm-title",children:b.name}),s.jsxs("div",{className:"bm-subtitle",children:[x&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"metric-tag",children:x}),s.jsx("span",{style:{color:"var(--hairline-strong)",margin:"0 8px"},children:"·"})]}),P?s.jsxs("span",{children:["Best: ",s.jsx("span",{className:"best-name",children:W($)})," by ",s.jsx("span",{className:"best-name",style:{fontStyle:"normal"},children:P})]}):s.jsxs("span",{children:[A.length," evaluations"]})]}),b.description&&s.jsx("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",maxWidth:760,marginBottom:16},children:b.description}),Ke&&s.jsxs("div",{className:"method-source",style:{marginTop:0,marginBottom:18},children:[s.jsx("span",{className:"method-source-label",children:"Source"}),z?s.jsxs(G,{to:`/paper/${z}`,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[s.jsx("span",{className:"method-source-title",children:H?s.jsx(oe,{title:H}):Qe}),V&&s.jsx("span",{className:"method-source-meta",children:V})]}):b.paper_url?s.jsxs("a",{href:b.paper_url,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[s.jsx("span",{className:"method-source-title",children:H?s.jsx(oe,{title:H}):b.paper_url}),V&&s.jsx("span",{className:"method-source-meta",children:V})]}):s.jsxs("div",{className:"method-source-link is-static",children:[s.jsx("span",{className:"method-source-title",children:H?s.jsx(oe,{title:H}):null}),V&&s.jsx("span",{className:"method-source-meta",children:V})]})]}),C.length>=2&&s.jsxs("div",{className:"bm-card",ref:d,children:[s.jsxs("div",{className:"bm-card-screenshot-title","aria-hidden":"true",children:[s.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),s.jsx("span",{className:"bm-card-screenshot-name",children:b.name})]}),s.jsxs("div",{className:"bm-card-head",children:[s.jsx("div",{className:"bm-card-title",children:"SOTA progression"}),s.jsxs("div",{className:"bm-card-actions",children:[S.length>1&&s.jsxs("label",{className:"bm-view-select",children:[s.jsx("span",{className:"bm-view-select-label",children:"View"}),s.jsx("select",{value:x,onChange:o=>a(o.target.value),children:S.map(o=>s.jsx("option",{value:o,children:o},o))})]}),s.jsx(De,{targetRef:d,label:"SOTA chart"})]})]}),s.jsx("div",{className:"bm-chart-wrap",children:s.jsx(er,{points:C,metric:x})}),s.jsxs("div",{className:"bm-chart-foot",children:[s.jsx("span",{className:"legend-dot"}),"Best result over time · hover a point to see the model · click to open the paper"]})]}),E&&(()=>{var w,j;const o=E.paper_arxiv_id||E.paper_id,m=E.paper_title||(E.paper_arxiv_id?`arXiv:${E.paper_arxiv_id}`:null),f=E.best_metric&&((w=E.metrics)==null?void 0:w[E.best_metric])!==void 0?E.best_metric:x,v=(j=E.metrics)==null?void 0:j[f];return s.jsxs("div",{className:"bm-highlight-banner",role:"status",children:[s.jsx("span",{className:"bm-highlight-dot","aria-hidden":"true"}),s.jsxs("div",{className:"bm-highlight-text",children:[s.jsx("span",{className:"bm-highlight-label",children:"Comparing result"}),s.jsxs("span",{className:"bm-highlight-paper",children:[E.model_name||m||"—",E.harness?` · ${E.harness}`:""]}),s.jsxs("span",{className:"bm-highlight-meta",children:[v!==void 0&&f?s.jsxs(s.Fragment,{children:[f,": ",W(v),m?" · ":""]}):null,m&&o?s.jsx(G,{to:`/paper/${o}`,children:m}):m||null]})]})]})})(),s.jsxs("div",{className:"bm-card",ref:p,children:[s.jsxs("div",{className:"bm-card-screenshot-title","aria-hidden":"true",children:[s.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),s.jsx("span",{className:"bm-card-screenshot-name",children:b.name})]}),s.jsxs("div",{className:"bm-card-head",children:[s.jsx("div",{className:"bm-card-title",children:"Leaderboard"}),s.jsxs("div",{className:"bm-card-actions",children:[S.length>1&&s.jsxs("label",{className:"bm-view-select",children:[s.jsx("span",{className:"bm-view-select-label",children:"View"}),s.jsx("select",{value:x,onChange:o=>a(o.target.value),children:S.map(o=>s.jsx("option",{value:o,children:o},o))})]}),s.jsx(De,{targetRef:p,label:"leaderboard"})]})]}),g.isLoading?s.jsx("div",{style:{padding:16},children:Array.from({length:5}).map((o,m)=>s.jsx(ce,{className:"h-10 w-full mb-2"},m))}):A.length===0?s.jsx("div",{className:"no-results",children:"No evaluations submitted yet."}):s.jsxs("table",{className:"bm-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{className:"col-rank",children:"Rank"}),s.jsx("th",{className:"col-model",children:"Model"}),ae&&s.jsx("th",{className:"col-harness",children:"Harness"}),y.map(o=>{const m=o===x;return s.jsx("th",{className:`col-value ${m?"is-active":""}`,"aria-sort":m?h==="↓"?"ascending":"descending":"none",children:s.jsxs("button",{type:"button",className:"bm-metric-header",onClick:()=>a(o),"aria-pressed":m,title:`Sort by ${o}`,children:[o,m?` ${h}`:""]})},o)}),s.jsx("th",{className:"col-paper",children:"Paper"}),s.jsx("th",{className:"col-year",children:"Year"})]})}),s.jsx("tbody",{children:(()=>{let o=null,m=0;return A.map((f,v)=>{var Ee,Re;const w=X((Ee=f.metrics)==null?void 0:Ee[x]);let j=null;w!==null&&((o===null||w!==o)&&(m=v+1,o=w),j=m);const D=f.paper_arxiv_id||f.paper_id,Ce=f.paper_title||(f.paper_arxiv_id?`arXiv:${f.paper_arxiv_id}`:null),ie=n===f.id;return s.jsxs("tr",{ref:ie?l:void 0,className:ie?"is-highlighted":void 0,children:[s.jsx("td",{className:"col-rank",children:j??"—"}),s.jsxs("td",{className:"col-model",children:[ie&&s.jsx("span",{className:"bm-row-marker","aria-hidden":"true"}),f.model_name||"—"]}),ae&&s.jsx("td",{className:"col-harness",children:f.harness||"—"}),y.map(le=>{var $e;const _e=le===x,Z=($e=f.metrics)==null?void 0:$e[le];return s.jsx("td",{className:`col-value${_e?" is-active":""}${_e&&j===1?" is-best":""}`,children:Z!=null&&Z!==""?W(Z):"—"},le)}),s.jsx("td",{className:"col-paper",children:D?s.jsx(G,{to:`/paper/${D}`,children:Ce||"—"}):Ce||"—"}),s.jsx("td",{className:"col-year",children:((Re=f.paper_published_date)==null?void 0:Re.slice(0,4))||"—"})]},f.id)})})()})]})]})]})})};export{dr as default};
assets/BenchmarkDetailView-QhpW5Yev.js DELETED
@@ -1 +0,0 @@
1
- import{x as ie,u as ce,r as w,j as e,L as C,H,y as oe}from"./index-khuRhj0-.js";import{u as q}from"./useQuery-Caj49BNs.js";import{a as z}from"./api-DxZAbqc3.js";import{S as U}from"./skeleton-DAoGkyKK.js";import{A as de,a as me}from"./alert-Bm-7arBk.js";import{L as O}from"./LatexTitle-fGDJSovl.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/{CronDashboard-B5jhO0Hx.js → CronDashboard-BJLOLf49.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{c as m,r as i,j as e,h as w,s as Y,w as Z}from"./index-khuRhj0-.js";import{u as G}from"./useQuery-Caj49BNs.js";import{L as R,B as N,D as ee}from"./badge-kHfqSFB-.js";import{B as b,I as se}from"./input-CONfoWHZ.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.
 
1
+ import{c as m,r as i,j as e,h as w,s as Y,w as Z}from"./index-RvrzVxyQ.js";import{u as G}from"./useQuery-DBPiiCZh.js";import{L as R,B as N,D as ee}from"./badge-CAs_Xk6U.js";import{B as b,I as se}from"./input-DBg77x-j.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.
assets/{FeedView-TyQhH5TM.js → FeedView-VglAKTTo.js} RENAMED
@@ -1 +1 @@
1
- import{u as S,r as y,j as e,L as m}from"./index-khuRhj0-.js";import{P as I}from"./components-CewLBhcc.js";import{a as T}from"./api-DxZAbqc3.js";import{t as L,a as E,d as _}from"./transform-Bqq4PHFq.js";import{u as R,a as D}from"./usePapers-BGzr0Zy3.js";import{u as M}from"./useIntersectionObserver-DbPRy1RB.js";import{P as C}from"./usePeriodFilter-BdoqZixi.js";import{S as n}from"./skeleton-DAoGkyKK.js";import{A as W,a as q}from"./alert-Bm-7arBk.js";import{u as b}from"./useQuery-Caj49BNs.js";import"./LatexTitle-fGDJSovl.js";import"./adminAuth-PI_XkM8E.js";import"./useInfiniteQuery-DRYtGZQa.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};
 
1
+ import{u as S,r as y,j as e,L as m}from"./index-RvrzVxyQ.js";import{P as I}from"./components-vAXr5Yrz.js";import{a as T}from"./api-5i4Mf2ca.js";import{t as L,a as E,d as _}from"./transform-C19D-_iA.js";import{u as R,a as D}from"./usePapers-Dilp1UjP.js";import{u as M}from"./useIntersectionObserver-b_ghxvrt.js";import{P as C}from"./usePeriodFilter-vtzRDJbK.js";import{S as n}from"./skeleton-vJLXL7dU.js";import{A as W,a as q}from"./alert-B6WjabOu.js";import{u as b}from"./useQuery-DBPiiCZh.js";import"./LatexTitle-CbOP0isa.js";import"./adminAuth-PI_XkM8E.js";import"./useInfiniteQuery-D6kOn4ET.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-fGDJSovl.js → LatexTitle-CbOP0isa.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{j as Er,r as Qt}from"./index-khuRhj0-.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-RvrzVxyQ.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-Fbq_29GX.js → MethodDetailView-BXXICNAd.js} RENAMED
The diff for this file is too large to render. See raw diff
 
assets/{MethodsIndexView-DdfaLJ-H.js → MethodsIndexView-CF_jCe6d.js} RENAMED
@@ -1 +1 @@
1
- import{r as u,j as e,L as x}from"./index-khuRhj0-.js";import{u as c}from"./useQuery-Caj49BNs.js";import{a as m}from"./api-DxZAbqc3.js";import{S as h}from"./skeleton-DAoGkyKK.js";import{A as g,a as j}from"./alert-Bm-7arBk.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};
 
1
+ import{r as u,j as e,L as x}from"./index-RvrzVxyQ.js";import{u as c}from"./useQuery-DBPiiCZh.js";import{a as m}from"./api-5i4Mf2ca.js";import{S as h}from"./skeleton-vJLXL7dU.js";import{A as g,a as j}from"./alert-B6WjabOu.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/{NotFound-CWF4noj9.js → NotFound-CMGYqDmr.js} RENAMED
@@ -1 +1 @@
1
- import{a0 as o,r as a,j as t,L as s}from"./index-khuRhj0-.js";const r=()=>{const e=o();return a.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),t.jsxs("div",{className:"page",style:{textAlign:"center",paddingTop:96},children:[t.jsx("h1",{className:"detail-title",style:{fontSize:96,marginBottom:8},children:"404"}),t.jsx("p",{style:{fontFamily:"var(--serif)",fontStyle:"italic",color:"var(--ink-soft)",marginBottom:24},children:"That route isn't on the map."}),t.jsx(s,{to:"/",className:"action-btn",children:"Return home"})]})};export{r as default};
 
1
+ import{a0 as o,r as a,j as t,L as s}from"./index-RvrzVxyQ.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/PaperDetailView-CRsXQgzN.js DELETED
@@ -1,46 +0,0 @@
1
- import{c as te,r as u,j as e,P as Ne,a as W,b as yt,d as ue,e as G,f as cs,g as Nt,C as se,h as U,i as ds,k as Re,l as us,m as ms,R as hs,n as fs,F as ps,D as xs,o as gs,X as Te,p as ae,q as Ae,s as ke,t as Fe,v as kt,w as _t,x as js,y as vs,L as J,z as bs,A as ys,B as Ns,E as ft,G as ks,H as _s}from"./index-khuRhj0-.js";import{u as O}from"./useQuery-Caj49BNs.js";import{I as L,T as ws,M as Cs}from"./components-CewLBhcc.js";import{L as pt,a as Es}from"./LatexTitle-fGDJSovl.js";import{g as Ss,u as Ps,b as wt,c as Rs,d as Ds,e as Is,f as Ms,h as Ts,i as As,j as Fs,k as xt,a as ve,l as $s}from"./api-DxZAbqc3.js";import{e as Ls}from"./transform-Bqq4PHFq.js";import{b as Os}from"./usePapers-BGzr0Zy3.js";import{S as de}from"./skeleton-DAoGkyKK.js";import{A as qs,a as Bs}from"./alert-Bm-7arBk.js";import{I as Q,B as M}from"./input-CONfoWHZ.js";import{u as re}from"./useMutation-VlZbYGe6.js";import{L as V,B as Ct,D as zs}from"./badge-kHfqSFB-.js";import"./adminAuth-PI_XkM8E.js";import"./useInfiniteQuery-DRYtGZQa.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 gt=te("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 jt=te("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 $e=te("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=te("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 Et=te("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 Le=te("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 Hs(s,a=!0){return O({queryKey:["evaluations","paper",s],queryFn:()=>{if(!s)throw new Error("Paper ID is required");return Ss(s)},enabled:a&&!!s,staleTime:5*60*1e3})}const De=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}}},Qs=async s=>{const[a,n,d]=await Promise.all([De("models",s),De("datasets",s),De("spaces",s)]);return{models:a.count,datasets:n.count,spaces:d.count,isLimited:a.isLimited||n.isLimited||d.isLimited}},Ks=s=>O({queryKey:["huggingface-repos",s],queryFn:()=>Qs(s),enabled:!!s,staleTime:10*60*1e3,retry:1});function Us(){const[s,a]=u.useState(!1),[n,d]=u.useState(!1),[r,t]=u.useState(!1),[l,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:l,openProjectPagesDialog:()=>m(!0),closeProjectPagesDialog:()=>m(!1),setIsEditingProjectPages:m,isEditingEvaluations:j,openEvaluationsDialog:()=>h(!0),closeEvaluationsDialog:()=>h(!1),setIsEditingEvaluations:h}}function Ws(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",[Gs]=Nt(_e),[Vs,Oe]=Gs(_e);function Xs(s){const{__scopeCheckbox:a,checked:n,children:d,defaultChecked:r,disabled:t,form:l,name:m,onCheckedChange:j,required:h,value:k="on",internal_do_not_use_render:f}=s,[C,P]=yt({prop:n,defaultProp:r??!1,onChange:j,caller:_e}),[R,E]=u.useState(null),[D,S]=u.useState(null),c=u.useRef(!1),_=R?!!l||!!R.closest("form"):!0,T={checked:C,disabled:t,setChecked:P,control:R,setControl:E,name:m,form:l,value:k,hasConsumerStoppedPropagationRef:c,required:h,defaultChecked:K(r)?!1:r,isFormControl:_,bubbleInput:D,setBubbleInput:S};return e.jsx(Vs,{scope:a,...T,children:Ys(f)?f(T):d})}var St="CheckboxTrigger",Pt=u.forwardRef(({__scopeCheckbox:s,onKeyDown:a,onClick:n,...d},r)=>{const{control:t,value:l,disabled:m,checked:j,required:h,setControl:k,setChecked:f,hasConsumerStoppedPropagationRef:C,isFormControl:P,bubbleInput:R}=Oe(St,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(W.button,{type:"button",role:"checkbox","aria-checked":K(j)?"mixed":j,"aria-required":h,"data-state":Tt(j),"data-disabled":m?"":void 0,disabled:m,value:l,...d,ref:E,onKeyDown:G(a,S=>{S.key==="Enter"&&S.preventDefault()}),onClick:G(n,S=>{f(c=>K(c)?!0:!c),R&&P&&(C.current=S.isPropagationStopped(),C.current||S.stopPropagation())})})});Pt.displayName=St;var qe=u.forwardRef((s,a)=>{const{__scopeCheckbox:n,name:d,checked:r,defaultChecked:t,required:l,disabled:m,value:j,onCheckedChange:h,form:k,...f}=s;return e.jsx(Xs,{__scopeCheckbox:n,checked:r,defaultChecked:t,disabled:m,required:l,onCheckedChange:h,name:d,form:k,value:j,internal_do_not_use_render:({isFormControl:C})=>e.jsxs(e.Fragment,{children:[e.jsx(Pt,{...f,ref:a,__scopeCheckbox:n}),C&&e.jsx(Mt,{__scopeCheckbox:n})]})})});qe.displayName=_e;var Rt="CheckboxIndicator",Dt=u.forwardRef((s,a)=>{const{__scopeCheckbox:n,forceMount:d,...r}=s,t=Oe(Rt,n);return e.jsx(Ne,{present:d||K(t.checked)||t.checked===!0,children:e.jsx(W.span,{"data-state":Tt(t.checked),"data-disabled":t.disabled?"":void 0,...r,ref:a,style:{pointerEvents:"none",...s.style}})})});Dt.displayName=Rt;var It="CheckboxBubbleInput",Mt=u.forwardRef(({__scopeCheckbox:s,...a},n)=>{const{control:d,hasConsumerStoppedPropagationRef:r,checked:t,defaultChecked:l,required:m,disabled:j,name:h,value:k,form:f,bubbleInput:C,setBubbleInput:P}=Oe(It,s),R=ue(n,P),E=Ws(t),D=cs(d);u.useEffect(()=>{const c=C;if(!c)return;const _=window.HTMLInputElement.prototype,F=Object.getOwnPropertyDescriptor(_,"checked").set,b=!r.current;if(E!==t&&F){const w=new Event("click",{bubbles:b});c.indeterminate=K(t),F.call(c,K(t)?!1:t),c.dispatchEvent(w)}},[C,E,t,r]);const S=u.useRef(K(t)?!1:t);return e.jsx(W.input,{type:"checkbox","aria-hidden":!0,defaultChecked:l??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%)"}})});Mt.displayName=It;function Ys(s){return typeof s=="function"}function K(s){return s==="indeterminate"}function Tt(s){return K(s)?"indeterminate":s?"checked":"unchecked"}const Be=u.forwardRef(({className:s,style:a,...n},d)=>e.jsx(qe,{ref:d,className:U("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(Dt,{className:U("flex items-center justify-center text-current"),children:e.jsx(se,{className:"h-4 w-4"})})}));Be.displayName=qe.displayName;function Zs(s){const a=Js(s),n=u.forwardRef((d,r)=>{const{children:t,...l}=d,m=u.Children.toArray(t),j=m.find(ta);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,{...l,ref:r,children:u.isValidElement(h)?u.cloneElement(h,void 0,k):null})}return e.jsx(a,{...l,ref:r,children:t})});return n.displayName=`${s}.Slot`,n}function Js(s){const a=u.forwardRef((n,d)=>{const{children:r,...t}=n;if(u.isValidElement(r)){const l=aa(r),m=sa(t,r.props);return r.type!==u.Fragment&&(m.ref=d?ds(d,l):l),u.cloneElement(r,m)}return u.Children.count(r)>1?u.Children.only(null):null});return a.displayName=`${s}.SlotClone`,a}var ea=Symbol("radix.slottable");function ta(s){return u.isValidElement(s)&&typeof s.type=="function"&&"__radixId"in s.type&&s.type.__radixId===ea}function sa(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 aa(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",[At]=Nt(we),[ra,$]=At(we),Ft=s=>{const{__scopeDialog:a,children:n,open:d,defaultOpen:r,onOpenChange:t,modal:l=!0}=s,m=u.useRef(null),j=u.useRef(null),[h,k]=yt({prop:d,defaultProp:r??!1,onChange:t,caller:we});return e.jsx(ra,{scope:a,triggerRef:m,contentRef:j,contentId:Re(),titleId:Re(),descriptionId:Re(),open:h,onOpenChange:k,onOpenToggle:u.useCallback(()=>k(f=>!f),[k]),modal:l,children:n})};Ft.displayName=we;var $t="DialogTrigger",na=u.forwardRef((s,a)=>{const{__scopeDialog:n,...d}=s,r=$($t,n),t=ue(a,r.triggerRef);return e.jsx(W.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":Qe(r.open),...d,ref:t,onClick:G(s.onClick,r.onOpenToggle)})});na.displayName=$t;var ze="DialogPortal",[ia,Lt]=At(ze,{forceMount:void 0}),Ot=s=>{const{__scopeDialog:a,forceMount:n,children:d,container:r}=s,t=$(ze,a);return e.jsx(ia,{scope:a,forceMount:n,children:u.Children.map(d,l=>e.jsx(Ne,{present:n||t.open,children:e.jsx(us,{asChild:!0,container:r,children:l})}))})};Ot.displayName=ze;var ye="DialogOverlay",qt=u.forwardRef((s,a)=>{const n=Lt(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(la,{...r,ref:a})}):null});qt.displayName=ye;var oa=Zs("DialogOverlay.RemoveScroll"),la=u.forwardRef((s,a)=>{const{__scopeDialog:n,...d}=s,r=$(ye,n);return e.jsx(hs,{as:oa,allowPinchZoom:!0,shards:[r.contentRef],children:e.jsx(W.div,{"data-state":Qe(r.open),...d,ref:a,style:{pointerEvents:"auto",...d.style}})})}),X="DialogContent",Bt=u.forwardRef((s,a)=>{const n=Lt(X,s.__scopeDialog),{forceMount:d=n.forceMount,...r}=s,t=$(X,s.__scopeDialog);return e.jsx(Ne,{present:d||t.open,children:t.modal?e.jsx(ca,{...r,ref:a}):e.jsx(da,{...r,ref:a})})});Bt.displayName=X;var ca=u.forwardRef((s,a)=>{const n=$(X,s.__scopeDialog),d=u.useRef(null),r=ue(a,n.contentRef,d);return u.useEffect(()=>{const t=d.current;if(t)return ms(t)},[]),e.jsx(zt,{...s,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:G(s.onCloseAutoFocus,t=>{var l;t.preventDefault(),(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:G(s.onPointerDownOutside,t=>{const l=t.detail.originalEvent,m=l.button===0&&l.ctrlKey===!0;(l.button===2||m)&&t.preventDefault()}),onFocusOutside:G(s.onFocusOutside,t=>t.preventDefault())})}),da=u.forwardRef((s,a)=>{const n=$(X,s.__scopeDialog),d=u.useRef(!1),r=u.useRef(!1);return e.jsx(zt,{...s,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{var l,m;(l=s.onCloseAutoFocus)==null||l.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 l=t.target;((h=n.triggerRef.current)==null?void 0:h.contains(l))&&t.preventDefault(),t.detail.originalEvent.type==="focusin"&&r.current&&t.preventDefault()}})}),zt=u.forwardRef((s,a)=>{const{__scopeDialog:n,trapFocus:d,onOpenAutoFocus:r,onCloseAutoFocus:t,...l}=s,m=$(X,n),j=u.useRef(null),h=ue(a,j);return fs(),e.jsxs(e.Fragment,{children:[e.jsx(ps,{asChild:!0,loop:!0,trapped:d,onMountAutoFocus:r,onUnmountAutoFocus:t,children:e.jsx(xs,{role:"dialog",id:m.contentId,"aria-describedby":m.descriptionId,"aria-labelledby":m.titleId,"data-state":Qe(m.open),...l,ref:h,onDismiss:()=>m.onOpenChange(!1)})}),e.jsxs(e.Fragment,{children:[e.jsx(ua,{titleId:m.titleId}),e.jsx(ha,{contentRef:j,descriptionId:m.descriptionId})]})]})}),He="DialogTitle",Ht=u.forwardRef((s,a)=>{const{__scopeDialog:n,...d}=s,r=$(He,n);return e.jsx(W.h2,{id:r.titleId,...d,ref:a})});Ht.displayName=He;var Qt="DialogDescription",Kt=u.forwardRef((s,a)=>{const{__scopeDialog:n,...d}=s,r=$(Qt,n);return e.jsx(W.p,{id:r.descriptionId,...d,ref:a})});Kt.displayName=Qt;var Ut="DialogClose",Wt=u.forwardRef((s,a)=>{const{__scopeDialog:n,...d}=s,r=$(Ut,n);return e.jsx(W.button,{type:"button",...d,ref:a,onClick:G(s.onClick,()=>r.onOpenChange(!1))})});Wt.displayName=Ut;function Qe(s){return s?"open":"closed"}var Gt="DialogTitleWarning",[Ga,Vt]=gs(Gt,{contentName:X,titleName:He,docsSlug:"dialog"}),ua=({titleId:s})=>{const a=Vt(Gt),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},ma="DialogDescriptionWarning",ha=({contentRef:s,descriptionId:a})=>{const d=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Vt(ma).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},fa=Ft,pa=Ot,Xt=qt,Yt=Bt,Zt=Ht,Jt=Kt,xa=Wt;const me=fa,ga=pa,es=u.forwardRef(({className:s,...a},n)=>e.jsx(Xt,{ref:n,className:U("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}));es.displayName=Xt.displayName;const ne=u.forwardRef(({className:s,children:a,...n},d)=>e.jsxs(ga,{children:[e.jsx(es,{}),e.jsxs(Yt,{ref:d,className:U("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(xa,{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(Te,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));ne.displayName=Yt.displayName;const ie=({className:s,...a})=>e.jsx("div",{className:U("flex flex-col space-y-1.5 text-center sm:text-left",s),...a});ie.displayName="DialogHeader";const oe=({className:s,...a})=>e.jsx("div",{className:U("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",s),...a});oe.displayName="DialogFooter";const le=u.forwardRef(({className:s,...a},n)=>e.jsx(Zt,{ref:n,className:U("text-lg font-semibold leading-none tracking-tight",s),...a}));le.displayName=Zt.displayName;const ce=u.forwardRef(({className:s,...a},n)=>e.jsx(Jt,{ref:n,className:U("text-sm text-muted-foreground",s),...a}));ce.displayName=Jt.displayName;function ja(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((l,m)=>l!==s[m])?r:s}if(Array.isArray(s.results)){const r=s.results.map(d);return r.some((l,m)=>l!==s.results[m])?{...s,results:r}:s}return s}function Ce(s,a,n){new Set([...n,a.id,a.arxiv_id].filter(l=>!!l)).forEach(l=>{s.setQueryData(["paper",l],a),s.setQueryData(["paper-arxiv",l],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=l=>ja(l,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 va=250,ba=100;function ya({open:s,onOpenChange:a,paperId:n,arxivId:d,initialTaskIds:r,initialTasks:t,onSuccess:l}){const[m,j]=u.useState(r),[h,k]=u.useState(""),[f,C]=u.useState(""),[P,R]=u.useState(new Map),E=ae(),{toast:D}=Ae(),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())},va);return()=>window.clearTimeout(i)},[h]);const{data:c,isFetching:_}=O({queryKey:["tasks-search",f],queryFn:()=>wt({page_size:ba,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]),F=re({mutationFn:({paperId:i,taskIds:v})=>Ps(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.`}),l==null||l(),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=()=>{F.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(ne,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ie,{children:[e.jsx(le,{children:"Edit Paper Tasks"}),e.jsx(ce,{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(Q,{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(Te,{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(Be,{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(V,{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(oe,{children:[e.jsx(M,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(M,{onClick:b,disabled:F.isPending,children:F.isPending?e.jsxs(e.Fragment,{children:[e.jsx(V,{className:"w-4 h-4 mr-2 animate-spin"}),"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(se,{className:"w-4 h-4 mr-2"}),"Save Changes"]})})]})]})})}const Na=250,ka=100;function _a({open:s,onOpenChange:a,paperId:n,arxivId:d,initialMethodIds:r,initialMethods:t,onSuccess:l}){const[m,j]=u.useState(r),[h,k]=u.useState(""),[f,C]=u.useState(""),[P,R]=u.useState(new Map),E=ae(),{toast:D}=Ae(),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())},Na);return()=>window.clearTimeout(i)},[h]);const{data:c,isFetching:_}=O({queryKey:["methods-search",f],queryFn:()=>Ds({page_size:ka,...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]),F=re({mutationFn:({paperId:i,methodIds:v})=>Rs(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.`}),l==null||l(),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=()=>{F.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(ne,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ie,{children:[e.jsx(le,{children:"Edit Paper Methods"}),e.jsx(ce,{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(Q,{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(Te,{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(Be,{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(V,{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(oe,{children:[e.jsx(M,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(M,{onClick:b,disabled:F.isPending,children:F.isPending?e.jsxs(e.Fragment,{children:[e.jsx(V,{className:"w-4 h-4 mr-2 animate-spin"}),"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(se,{className:"w-4 h-4 mr-2"}),"Save Changes"]})})]})]})})}function wa({open:s,onOpenChange:a,paperId:n,arxivId:d,initialRepositories:r,onSuccess:t}){const[l,m]=u.useState(r),[j,h]=u.useState(""),k=ae(),f=u.useRef(!1);u.useEffect(()=>{if(!s){f.current=!1;return}f.current||(f.current=!0,m(r),h(""))},[s,r]);const C=re({mutationFn:({paperId:c,repositories:_})=>Is(c,_),onSuccess:c=>{Ce(k,c,[n,d]),t==null||t(),a(!1),h("")}}),P=()=>{const c=j.trim();return c?l.some(_=>_.url===c)?(alert("This repository URL is already added"),null):[...l,{url:c,is_official:!1}]:l},R=()=>{const c=P();c!==null&&c.length!==l.length&&(m(c),h(""))},E=c=>{m(l.filter(_=>_.url!==c))},D=c=>{m(l.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(ne,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ie,{children:[e.jsx(le,{children:"Edit Paper Repositories"}),e.jsx(ce,{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(Q,{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($e,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:l.length>0?e.jsx("div",{className:"space-y-2",children:l.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(Ct,{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(Et,{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(Le,{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 repositories added yet"}),e.jsx("p",{className:"text-xs mt-1",children:"Add a repository URL above to get started"})]})}),e.jsxs(oe,{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(V,{className:"w-4 h-4 mr-2 animate-spin"}),"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(se,{className:"w-4 h-4 mr-2"}),"Save Changes"]})})]})]})})}function Ca({open:s,onOpenChange:a,paperId:n,arxivId:d,initialProjectPages:r,onSuccess:t}){const[l,m]=u.useState(r),[j,h]=u.useState(""),k=ae(),f=u.useRef(!1);u.useEffect(()=>{if(!s){f.current=!1;return}f.current||(f.current=!0,m(r),h(""))},[s,r]);const C=re({mutationFn:({paperId:c,projectPages:_})=>Ms(c,_),onSuccess:c=>{Ce(k,c,[n,d]),t==null||t(),a(!1),h("")}}),P=()=>{const c=j.trim();return c?l.some(_=>_.url===c)?(alert("This project page URL is already added"),null):[...l,{url:c,is_official:!1}]:l},R=()=>{const c=P();c!==null&&c.length!==l.length&&(m(c),h(""))},E=c=>{m(l.filter(_=>_.url!==c))},D=c=>{m(l.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(ne,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ie,{children:[e.jsx(le,{children:"Edit Paper Project Pages"}),e.jsx(ce,{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(Q,{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($e,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:l.length>0?e.jsx("div",{className:"space-y-2",children:l.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(jt,{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(Ct,{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(Et,{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(Le,{className:"w-4 h-4"})})]})]},_))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(jt,{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(oe,{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(V,{className:"w-4 h-4 mr-2 animate-spin"}),"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(se,{className:"w-4 h-4 mr-2"}),"Save Changes"]})})]})]})})}function Ea(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 Sa({open:s,onOpenChange:a,paperId:n,arxivId:d,initialEvaluations:r,onSuccess:t}){const[l,m]=u.useState([]),j=ae(),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(Ea(r)))},[s,r]);const{data:f}=O({queryKey:["tasks-for-eval-edit"],queryFn:()=>wt({page_size:100}),enabled:s}),{data:C}=O({queryKey:["datasets-for-eval-edit"],queryFn:()=>xt({page_size:100}),enabled:s}),P=u.useMemo(()=>Array.from(new Set(l.map(b=>b.task_id).filter(b=>b&&b!==""))),[l]),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 xt({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=re({mutationFn:async({paperId:b,evaluations:w})=>{for(const p of w)if(p.operation==="delete"&&p.id)try{await Ts(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 As({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 Fs(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([...l,{task_id:"",dataset_id:"",model_name:"",harness:"",metric_name:"",metric_value:"",best_rank:"",operation:"create"}])},_=b=>{k.current=!0,l[b].id?m(l.map((p,i)=>i===b?{...p,operation:"delete"}:p)):m(l.filter((p,i)=>i!==b))},T=(b,w,p)=>{k.current=!0,m(l.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}))},F=()=>{const b=l.filter(w=>w.operation!=="delete"||w.id);S.mutate({paperId:n,evaluations:b})};return e.jsx(me,{open:s,onOpenChange:a,children:e.jsxs(ne,{className:"max-w-6xl max-h-[800px]",children:[e.jsxs(ie,{children:[e.jsx(le,{children:"Edit Evaluation Results"}),e.jsx(ce,{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:[l.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:l.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(Q,{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(Q,{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(Q,{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(Q,{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(Le,{className:"w-4 h-4"})})})]},w)})})]})}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(zs,{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($e,{className:"w-4 h-4"}),e.jsx("span",{children:"Add Row"})]})})]}),e.jsxs(oe,{children:[e.jsx(M,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(M,{onClick:F,disabled:S.isPending,children:S.isPending?e.jsxs(e.Fragment,{children:[e.jsx(V,{className:"w-4 h-4 mr-2 animate-spin"}),"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(se,{className:"w-4 h-4 mr-2"}),"Save Changes"]})})]})]})})}const ee=["my-bookmark-ids"];function Pa(){var d,r;const{user:s}=ke(),a=O({queryKey:ee,queryFn:()=>ve.getMyBookmarkIds(),enabled:!!s,staleTime:60*1e3,refetchOnWindowFocus:!1}),n=Fe.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 Ra(){const{user:s}=ke(),a=ae(),n=re({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:ee});const l=a.getQueryData(ee),m=typeof r=="string"?Number(r):r,j=(l==null?void 0:l.paper_ids)??[],h=t?j.filter(k=>k!==m):[m,...j.filter(k=>k!==m)];return a.setQueryData(ee,{paper_ids:h}),{previous:l}},onError:(r,t,l)=>{l!=null&&l.previous&&a.setQueryData(ee,l.previous)},onSettled:()=>{a.invalidateQueries({queryKey:ee}),a.invalidateQueries({queryKey:["my-bookmarks"]})}});return{toggle:Fe.useCallback((r,t)=>{if(!s){if(kt())return;const l=typeof window<"u"?window.location.pathname+window.location.search:"/";window.location.href=_t(`/api/v1/auth/hf/login?return_to=${encodeURIComponent(l)}`);return}n.mutate({paperId:r,isBookmarked:t})},[n,s]),isPending:n.isPending}}const Da=({paperId:s})=>{const{user:a}=ke(),{idSet:n}=Pa(),{toggle:d,isPending:r}=Ra();if(kt())return null;const t=Number(s),l=!!a&&n.has(t),m=()=>{Number.isFinite(t)&&d(t,l)},j=a&&l?"Saved":"Save",h=a?l?"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${l?" is-saved":""}`,onClick:m,disabled:r,"aria-pressed":l,"aria-label":h,title:h,children:[e.jsx(L,{name:"bookmark",size:12}),j]})},ge=360,Ie=3;function vt(s){if(!s)return"—";try{return new Date(s).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"—"}}function bt(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 Va=()=>{var st,at,rt,nt,it,ot,lt,ct,dt,ut,mt,ht;const{arxivId:s}=js(),a=vs(),{toast:n}=Ae(),{user:d}=ke(),r=(d==null?void 0:d.is_admin)??!1,{data:t,isLoading:l,error:m,refetch:j}=Os(s||"",!!s),[h,k]=u.useState(!1);u.useEffect(()=>{if(k(!1),!(t!=null&&t.id))return;const o=window.setTimeout(()=>k(!0),0);return()=>window.clearTimeout(o)},[t==null?void 0:t.id]);const{data:f,isLoading:C}=Ks(h?t==null?void 0:t.arxiv_id:void 0),{data:P,isLoading:R}=Hs(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 o=new Map;for(const y of P){const A=y.task_id,H=o.get(A);H?H.rows.push(y):o.set(A,{taskId:A,taskName:y.task_name||"—",taskSlug:y.task_slug,rows:[y]})}return Array.from(o.values())},[P]),S=O({queryKey:["paper-versions",t==null?void 0:t.arxiv_id],queryFn:async()=>{const o=t.arxiv_id.replace(/v\d+$/,""),y=await fetch(_t(`/api/v1/papers/arxiv/${o}/versions`));return y.ok?await y.json():[]},enabled:h&&!!(t!=null&&t.arxiv_id),staleTime:10*60*1e3}),c=O({queryKey:["related-papers",(at=(st=t==null?void 0:t.tasks)==null?void 0:st[0])==null?void 0:at.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&&!!((nt=(rt=t==null?void 0:t.tasks)==null?void 0:rt[0])!=null&&nt.id),staleTime:10*60*1e3,select:o=>o.results.filter(y=>y.id!==(t==null?void 0:t.id)).slice(0,4)}),[_,T]=u.useState(!1),[F,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:Ke}=Us(),[Ue,Se]=u.useState("idle"),[We,Ge]=u.useState(null),[Ve,Xe]=u.useState(null),ts=async()=>{if(s){Se("indexing"),Ge(null),Xe(null);try{await $s(s),n({title:"Indexed",description:"Paper added to database."}),setTimeout(()=>j(),1200),Se("idle")}catch(o){const y=o;let A=y.message||"Failed to index paper";if(y.response)try{A=JSON.parse(y.response).detail||A}catch{A=y.response}Ge(A),(y.status===429||y.status===503)&&Xe("Try again later after arXiv has lifted the temporary limit."),Se("idle")}}};if(l)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(J,{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."]}),We&&e.jsx(qs,{variant:"destructive",className:"mt-4 max-w-xl",children:e.jsxs(Bs,{children:[e.jsx("div",{children:We}),Ve&&e.jsx("div",{className:"mt-2",children:Ve})]})}),e.jsxs("div",{className:"action-row",children:[r&&e.jsxs("button",{className:"action-btn",onClick:ts,disabled:Ue==="indexing",children:[e.jsx(L,{name:"sparkle",size:12}),Ue==="indexing"?"Indexing…":"Index from arXiv"]}),e.jsx(M,{variant:"outline",onClick:()=>a("/papers"),children:"Browse Papers"})]})]});const Ye=S.data||[],he=Ls(t.repositories),z=[...t.repositories??[]].sort((o,y)=>{const A=o.is_official?1:0,H=y.is_official?1:0;return A!==H?H-A:(y.num_stars||0)-(o.num_stars||0)}),ss=w?z:z.slice(0,Ie),as=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:Me(E.models),count:E.models.length,links:E.models.map(o=>({href:o,label:je(o,"Model")}))},{label:"Datasets",href:Me(E.datasets),count:E.datasets.length,links:E.datasets.map(o=>({href:o,label:je(o,"Dataset")}))},{label:"Spaces",href:Me(E.spaces),count:E.spaces.length,links:E.spaces.map(o=>({href:o,label:je(o,"Space")}))}],footer:null},Ze=t.tldr||null,Je=t.num_pages||null,Y=t.abstract||"",rs=Y.length>ge?Y.slice(0,ge)+"…":Y,ns=_||Y.length<=ge?Y:rs,fe=(t.methods||[]).filter(o=>o.source_paper_id===t.id),pe=t.introduced_benchmarks||[],is=fe.length>0||pe.length>0,et=t.arxiv_id?`arXiv:${t.arxiv_id}`:"External resource",os=t.source==="external"?"Source page":"arXiv page",Z=((it=t.project_pages)==null?void 0:it.filter(o=>o.url))??[],ls=(()=>{const o=[];return fe.length>0&&o.push(fe.length===1?"this method":"these methods"),pe.length>0&&o.push(pe.length===1?"this benchmark":"these benchmarks"),o.length===0?"":o.length===1?o[0]:o.join(" and ")})(),xe=12,Pe=t.authors.map((o,y)=>{var A,H;return{name:o,hf_username:((H=(A=t.author_links)==null?void 0:A[y])==null?void 0:H.hf_username)??null}}),tt=F||Pe.length<=xe?Pe:Pe.slice(0,xe);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(J,{to:"/",children:"Trending"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{children:et})]}),e.jsxs("div",{className:"detail-grid",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"detail-title",children:e.jsx(pt,{title:t.title})}),e.jsxs("div",{className:"detail-meta",children:[e.jsx("span",{children:et}),e.jsx("span",{children:"·"}),e.jsxs("span",{children:["Submitted ",vt(t.published)]}),Je&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[Je," 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}$/,"")})]}),Ye.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("select",{className:"version-select",value:t.version,onChange:o=>{const y=o.target.value;t.arxiv_id&&a(`/paper/${t.arxiv_id.replace(/v\d+$/,"")}${y?`?version=${y}`:""}`)},children:Ye.map(o=>e.jsxs("option",{value:o.version,children:[o.version," — ",vt(o.published)]},o.version))})]})]}),e.jsxs("div",{className:"detail-authors",children:[tt.map((o,y)=>e.jsxs(Fe.Fragment,{children:[o.hf_username?e.jsx("a",{href:`https://huggingface.co/${o.hf_username}`,target:"_blank",rel:"noopener noreferrer",title:`@${o.hf_username} on Hugging Face`,children:o.name}):e.jsx("a",{children:o.name}),y<tt.length-1?", ":""]},y)),t.authors.length>xe&&e.jsx("button",{className:"show-more-authors",onClick:()=>b(o=>!o),style:{marginLeft:8,background:"none",border:"none",cursor:"pointer",color:"var(--accent-text)",fontFamily:"var(--mono)",fontSize:12},children:F?"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})," ",os]}),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:["· ",bt(he.github)," ★"]})]}),Z.length===1&&!r?e.jsxs("a",{className:"action-btn",href:Z[0].url,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(L,{name:"globe",size:12})," Project page"]}):null,Z.length>0&&(Z.length>1||r)?e.jsxs(bs,{children:[e.jsx(ys,{asChild:!0,children:e.jsxs("button",{type:"button",className:"action-btn",children:[e.jsx(L,{name:"globe",size:12})," Project page"]})}),e.jsxs(Ns,{align:"start",className:"project-page-menu",children:[Z.map((o,y)=>e.jsx(ft,{asChild:!0,children:e.jsx("a",{href:o.url,target:"_blank",rel:"noopener noreferrer",children:je(o.url,`Project page ${y+1}`)})},o.url)),r&&e.jsxs(e.Fragment,{children:[e.jsx(ks,{}),e.jsx(ft,{onSelect:()=>I(!0),children:"Add or edit project pages"})]})]})]}):null,r&&Z.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(Da,{paperId:t.id})]}),is&&e.jsxs("div",{className:"introduced-banner",children:[e.jsx("span",{className:"introduced-label",children:"Introduced"}),e.jsxs("div",{className:"introduced-methods",children:[fe.map(o=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>a(`/methods/${o.slug||o.id}`),children:[o.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`method-${o.id}`)),pe.map(o=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>a(`/benchmark/${o.slug||o.id}`),children:[o.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`benchmark-${o.id}`))]}),e.jsxs("span",{className:"introduced-note",children:["This paper is the canonical source for ",ls,"."]})]}),Ze&&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:Ze})]}),e.jsx("div",{className:"section-rule",children:e.jsx("span",{children:"Abstract"})}),e.jsx("p",{className:"abstract-text",style:{marginBottom:8},children:e.jsx(Es,{text:ns})}),Y.length>ge&&e.jsx("div",{className:"read-full",onClick:()=>T(o=>!o),children:_?"− collapse abstract":"+ read full abstract"}),e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:"Tasks"}),e.jsxs("span",{className:"accent",children:[((ot=t.tasks)==null?void 0:ot.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(o=>e.jsx(ws,{slug:o.slug||"",label:o.name},o.id))}),e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:"Methods"}),e.jsxs("span",{className:"accent",children:[((lt=t.methods)==null?void 0:lt.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(o=>e.jsx(Cs,{method:o},o.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:()=>Ke(!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(o=>e.jsxs("div",{children:[e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:o.taskSlug?e.jsx(J,{to:`/tasks/${o.taskSlug}`,children:o.taskName}):o.taskName}),e.jsxs("span",{className:"accent",children:[o.rows.length," ",o.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:o.rows.map(y=>{var A;return e.jsxs("tr",{children:[e.jsx("td",{className:"benchmark",children:y.dataset_slug?e.jsx(J,{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:_s((A=y.metrics)==null?void 0:A[y.best_metric||""])}),e.jsx("td",{className:"compare",children:y.dataset_slug&&e.jsx(J,{to:`/benchmark/${y.dataset_slug}?eval=${encodeURIComponent(y.id)}`,children:"Compare →"})})]},y.id)})})]})]},o.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"})]})]}),ss.map(o=>e.jsxs("a",{href:o.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:[o.owner,"/",o.name]}),o.is_official&&e.jsx("span",{className:"code-line-official",children:"· Official"})]}),e.jsxs("span",{className:"code-line-stars",children:["★ ",bt(o.num_stars)]})]},o.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>Ie&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>p(o=>!o),children:w?"− show top 3":`+ show ${z.length-Ie} more repos`})]}),e.jsx(Ia,{viewer:as}),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
- }`})]}),(((ct=c.data)==null?void 0:ct.length)??0)>0&&e.jsxs("div",{className:"sidebar-card",children:[e.jsx("div",{className:"sidebar-card-title",children:"Related papers"}),c.data.map(o=>e.jsxs(J,{to:`/paper/${o.arxiv_id||o.id}`,target:"_blank",rel:"noopener noreferrer",className:"related-paper",style:{textDecoration:"none",color:"inherit"},children:[e.jsx("div",{className:"related-title",children:e.jsx(pt,{title:o.title})}),e.jsxs("div",{className:"related-meta",children:[e.jsx("span",{children:o.arxiv_id?`arXiv:${o.arxiv_id}`:"External resource"}),o.citation_count!=null&&e.jsxs("span",{children:[o.citation_count.toLocaleString()," cites"]})]})]},o.id))]})]})]}),e.jsx(ya,{open:i,onOpenChange:v,paperId:t.id,arxivId:s,initialTaskIds:((dt=t.tasks)==null?void 0:dt.map(o=>parseInt(o.id)))||[],initialTasks:t.tasks||[]}),e.jsx(_a,{open:x,onOpenChange:N,paperId:t.id,arxivId:s,initialMethodIds:((ut=t.methods)==null?void 0:ut.map(o=>parseInt(o.id)))||[],initialMethods:t.methods||[]}),e.jsx(wa,{open:g,onOpenChange:q,paperId:t.id,arxivId:s,initialRepositories:((mt=t.repositories)==null?void 0:mt.map(o=>({url:o.url,is_official:o.is_official||!1})))||[]}),e.jsx(Ca,{open:B,onOpenChange:I,paperId:t.id,arxivId:s,initialProjectPages:((ht=t.project_pages)==null?void 0:ht.map(o=>({url:o.url,is_official:o.is_official||!1})))||[]}),e.jsx(Sa,{open:Ee,onOpenChange:Ke,paperId:t.id,arxivId:s,initialEvaluations:P||[]})]})},Ia=({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(Ma,{...a},a.label)),s.footer&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:10,color:"var(--ink-faint)",marginTop:12},children:s.footer})]})]}),Ma=({label:s,href:a,count:n,isLimited:d,links:r})=>{const t=((r==null?void 0:r.length)??0)>0,l=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:[l,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:l})};function Me(s){return s[0]??"https://huggingface.co"}export{Va as default};
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/PaperDetailView-De0mLZCp.js ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import{c as te,r as u,j as e,P as _e,a as W,b as Pt,d as ue,e as G,f as ys,g as Rt,C as se,h as U,i as Ns,k as Ie,l as ks,m as _s,R as ws,n as Cs,F as Es,D as Ss,o as Ps,X as Fe,p as ae,q as $e,s as we,t as Le,v as Dt,w as It,x as Rs,y as Ds,L as J,z as Is,A as Ms,B as Ts,E as yt,G as As,H as Fs}from"./index-RvrzVxyQ.js";import{u as q}from"./useQuery-DBPiiCZh.js";import{I as L,T as $s,M as Ls}from"./components-vAXr5Yrz.js";import{L as Nt,a as Os}from"./LatexTitle-CbOP0isa.js";import{g as qs,u as Bs,b as Mt,c as zs,d as Hs,e as Qs,f as Ks,h as Us,i as Ws,j as Gs,k as kt,a as ye,l as Vs}from"./api-5i4Mf2ca.js";import{e as Xs}from"./transform-C19D-_iA.js";import{b as Ys}from"./usePapers-Dilp1UjP.js";import{S as de}from"./skeleton-vJLXL7dU.js";import{A as Zs,a as Js}from"./alert-B6WjabOu.js";import{I as z,B as A}from"./input-DBg77x-j.js";import{u as re}from"./useMutation-BChaaj62.js";import{L as V,B as Tt,D as ea}from"./badge-CAs_Xk6U.js";import"./adminAuth-PI_XkM8E.js";import"./useInfiniteQuery-D6kOn4ET.js";/**
2
+ * @license lucide-react v0.462.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const _t=te("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 wt=te("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 Oe=te("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 Ne=te("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 At=te("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 qe=te("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 qs(s)},enabled:a&&!!s,staleTime:5*60*1e3})}const Me=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}}},sa=async s=>{const[a,n,d]=await Promise.all([Me("models",s),Me("datasets",s),Me("spaces",s)]);return{models:a.count,datasets:n.count,spaces:d.count,isLimited:a.isLimited||n.isLimited||d.isLimited}},aa=s=>q({queryKey:["huggingface-repos",s],queryFn:()=>sa(s),enabled:!!s,staleTime:10*60*1e3,retry:1});function ra(){const[s,a]=u.useState(!1),[n,d]=u.useState(!1),[r,t]=u.useState(!1),[l,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:l,openProjectPagesDialog:()=>m(!0),closeProjectPagesDialog:()=>m(!1),setIsEditingProjectPages:m,isEditingEvaluations:j,openEvaluationsDialog:()=>h(!0),closeEvaluationsDialog:()=>h(!1),setIsEditingEvaluations:h}}function na(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 Ce="Checkbox",[ia]=Rt(Ce),[oa,Be]=ia(Ce);function la(s){const{__scopeCheckbox:a,checked:n,children:d,defaultChecked:r,disabled:t,form:l,name:m,onCheckedChange:j,required:h,value:k="on",internal_do_not_use_render:p}=s,[C,P]=Pt({prop:n,defaultProp:r??!1,onChange:j,caller:Ce}),[R,E]=u.useState(null),[D,S]=u.useState(null),c=u.useRef(!1),_=R?!!l||!!R.closest("form"):!0,I={checked:C,disabled:t,setChecked:P,control:R,setControl:E,name:m,form:l,value:k,hasConsumerStoppedPropagationRef:c,required:h,defaultChecked:K(r)?!1:r,isFormControl:_,bubbleInput:D,setBubbleInput:S};return e.jsx(oa,{scope:a,...I,children:ca(p)?p(I):d})}var Ft="CheckboxTrigger",$t=u.forwardRef(({__scopeCheckbox:s,onKeyDown:a,onClick:n,...d},r)=>{const{control:t,value:l,disabled:m,checked:j,required:h,setControl:k,setChecked:p,hasConsumerStoppedPropagationRef:C,isFormControl:P,bubbleInput:R}=Be(Ft,s),E=ue(r,k),D=u.useRef(j);return u.useEffect(()=>{const S=t==null?void 0:t.form;if(S){const c=()=>p(D.current);return S.addEventListener("reset",c),()=>S.removeEventListener("reset",c)}},[t,p]),e.jsx(W.button,{type:"button",role:"checkbox","aria-checked":K(j)?"mixed":j,"aria-required":h,"data-state":zt(j),"data-disabled":m?"":void 0,disabled:m,value:l,...d,ref:E,onKeyDown:G(a,S=>{S.key==="Enter"&&S.preventDefault()}),onClick:G(n,S=>{p(c=>K(c)?!0:!c),R&&P&&(C.current=S.isPropagationStopped(),C.current||S.stopPropagation())})})});$t.displayName=Ft;var ze=u.forwardRef((s,a)=>{const{__scopeCheckbox:n,name:d,checked:r,defaultChecked:t,required:l,disabled:m,value:j,onCheckedChange:h,form:k,...p}=s;return e.jsx(la,{__scopeCheckbox:n,checked:r,defaultChecked:t,disabled:m,required:l,onCheckedChange:h,name:d,form:k,value:j,internal_do_not_use_render:({isFormControl:C})=>e.jsxs(e.Fragment,{children:[e.jsx($t,{...p,ref:a,__scopeCheckbox:n}),C&&e.jsx(Bt,{__scopeCheckbox:n})]})})});ze.displayName=Ce;var Lt="CheckboxIndicator",Ot=u.forwardRef((s,a)=>{const{__scopeCheckbox:n,forceMount:d,...r}=s,t=Be(Lt,n);return e.jsx(_e,{present:d||K(t.checked)||t.checked===!0,children:e.jsx(W.span,{"data-state":zt(t.checked),"data-disabled":t.disabled?"":void 0,...r,ref:a,style:{pointerEvents:"none",...s.style}})})});Ot.displayName=Lt;var qt="CheckboxBubbleInput",Bt=u.forwardRef(({__scopeCheckbox:s,...a},n)=>{const{control:d,hasConsumerStoppedPropagationRef:r,checked:t,defaultChecked:l,required:m,disabled:j,name:h,value:k,form:p,bubbleInput:C,setBubbleInput:P}=Be(qt,s),R=ue(n,P),E=na(t),D=ys(d);u.useEffect(()=>{const c=C;if(!c)return;const _=window.HTMLInputElement.prototype,F=Object.getOwnPropertyDescriptor(_,"checked").set,b=!r.current;if(E!==t&&F){const w=new Event("click",{bubbles:b});c.indeterminate=K(t),F.call(c,K(t)?!1:t),c.dispatchEvent(w)}},[C,E,t,r]);const S=u.useRef(K(t)?!1:t);return e.jsx(W.input,{type:"checkbox","aria-hidden":!0,defaultChecked:l??S.current,required:m,disabled:j,name:h,value:k,form:p,...a,tabIndex:-1,ref:R,style:{...a.style,...D,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Bt.displayName=qt;function ca(s){return typeof s=="function"}function K(s){return s==="indeterminate"}function zt(s){return K(s)?"indeterminate":s?"checked":"unchecked"}const He=u.forwardRef(({className:s,style:a,...n},d)=>e.jsx(ze,{ref:d,className:U("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(Ot,{className:U("flex items-center justify-center text-current"),children:e.jsx(se,{className:"h-4 w-4"})})}));He.displayName=ze.displayName;function da(s){const a=ua(s),n=u.forwardRef((d,r)=>{const{children:t,...l}=d,m=u.Children.toArray(t),j=m.find(ha);if(j){const h=j.props.children,k=m.map(p=>p===j?u.Children.count(h)>1?u.Children.only(null):u.isValidElement(h)?h.props.children:null:p);return e.jsx(a,{...l,ref:r,children:u.isValidElement(h)?u.cloneElement(h,void 0,k):null})}return e.jsx(a,{...l,ref:r,children:t})});return n.displayName=`${s}.Slot`,n}function ua(s){const a=u.forwardRef((n,d)=>{const{children:r,...t}=n;if(u.isValidElement(r)){const l=fa(r),m=pa(t,r.props);return r.type!==u.Fragment&&(m.ref=d?Ns(d,l):l),u.cloneElement(r,m)}return u.Children.count(r)>1?u.Children.only(null):null});return a.displayName=`${s}.SlotClone`,a}var ma=Symbol("radix.slottable");function ha(s){return u.isValidElement(s)&&typeof s.type=="function"&&"__radixId"in s.type&&s.type.__radixId===ma}function pa(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 fa(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 Ee="Dialog",[Ht]=Rt(Ee),[xa,O]=Ht(Ee),Qt=s=>{const{__scopeDialog:a,children:n,open:d,defaultOpen:r,onOpenChange:t,modal:l=!0}=s,m=u.useRef(null),j=u.useRef(null),[h,k]=Pt({prop:d,defaultProp:r??!1,onChange:t,caller:Ee});return e.jsx(xa,{scope:a,triggerRef:m,contentRef:j,contentId:Ie(),titleId:Ie(),descriptionId:Ie(),open:h,onOpenChange:k,onOpenToggle:u.useCallback(()=>k(p=>!p),[k]),modal:l,children:n})};Qt.displayName=Ee;var Kt="DialogTrigger",ga=u.forwardRef((s,a)=>{const{__scopeDialog:n,...d}=s,r=O(Kt,n),t=ue(a,r.triggerRef);return e.jsx(W.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":Ue(r.open),...d,ref:t,onClick:G(s.onClick,r.onOpenToggle)})});ga.displayName=Kt;var Qe="DialogPortal",[ja,Ut]=Ht(Qe,{forceMount:void 0}),Wt=s=>{const{__scopeDialog:a,forceMount:n,children:d,container:r}=s,t=O(Qe,a);return e.jsx(ja,{scope:a,forceMount:n,children:u.Children.map(d,l=>e.jsx(_e,{present:n||t.open,children:e.jsx(ks,{asChild:!0,container:r,children:l})}))})};Wt.displayName=Qe;var ke="DialogOverlay",Gt=u.forwardRef((s,a)=>{const n=Ut(ke,s.__scopeDialog),{forceMount:d=n.forceMount,...r}=s,t=O(ke,s.__scopeDialog);return t.modal?e.jsx(_e,{present:d||t.open,children:e.jsx(ba,{...r,ref:a})}):null});Gt.displayName=ke;var va=da("DialogOverlay.RemoveScroll"),ba=u.forwardRef((s,a)=>{const{__scopeDialog:n,...d}=s,r=O(ke,n);return e.jsx(ws,{as:va,allowPinchZoom:!0,shards:[r.contentRef],children:e.jsx(W.div,{"data-state":Ue(r.open),...d,ref:a,style:{pointerEvents:"auto",...d.style}})})}),X="DialogContent",Vt=u.forwardRef((s,a)=>{const n=Ut(X,s.__scopeDialog),{forceMount:d=n.forceMount,...r}=s,t=O(X,s.__scopeDialog);return e.jsx(_e,{present:d||t.open,children:t.modal?e.jsx(ya,{...r,ref:a}):e.jsx(Na,{...r,ref:a})})});Vt.displayName=X;var ya=u.forwardRef((s,a)=>{const n=O(X,s.__scopeDialog),d=u.useRef(null),r=ue(a,n.contentRef,d);return u.useEffect(()=>{const t=d.current;if(t)return _s(t)},[]),e.jsx(Xt,{...s,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:G(s.onCloseAutoFocus,t=>{var l;t.preventDefault(),(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:G(s.onPointerDownOutside,t=>{const l=t.detail.originalEvent,m=l.button===0&&l.ctrlKey===!0;(l.button===2||m)&&t.preventDefault()}),onFocusOutside:G(s.onFocusOutside,t=>t.preventDefault())})}),Na=u.forwardRef((s,a)=>{const n=O(X,s.__scopeDialog),d=u.useRef(!1),r=u.useRef(!1);return e.jsx(Xt,{...s,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{var l,m;(l=s.onCloseAutoFocus)==null||l.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 l=t.target;((h=n.triggerRef.current)==null?void 0:h.contains(l))&&t.preventDefault(),t.detail.originalEvent.type==="focusin"&&r.current&&t.preventDefault()}})}),Xt=u.forwardRef((s,a)=>{const{__scopeDialog:n,trapFocus:d,onOpenAutoFocus:r,onCloseAutoFocus:t,...l}=s,m=O(X,n),j=u.useRef(null),h=ue(a,j);return Cs(),e.jsxs(e.Fragment,{children:[e.jsx(Es,{asChild:!0,loop:!0,trapped:d,onMountAutoFocus:r,onUnmountAutoFocus:t,children:e.jsx(Ss,{role:"dialog",id:m.contentId,"aria-describedby":m.descriptionId,"aria-labelledby":m.titleId,"data-state":Ue(m.open),...l,ref:h,onDismiss:()=>m.onOpenChange(!1)})}),e.jsxs(e.Fragment,{children:[e.jsx(ka,{titleId:m.titleId}),e.jsx(wa,{contentRef:j,descriptionId:m.descriptionId})]})]})}),Ke="DialogTitle",Yt=u.forwardRef((s,a)=>{const{__scopeDialog:n,...d}=s,r=O(Ke,n);return e.jsx(W.h2,{id:r.titleId,...d,ref:a})});Yt.displayName=Ke;var Zt="DialogDescription",Jt=u.forwardRef((s,a)=>{const{__scopeDialog:n,...d}=s,r=O(Zt,n);return e.jsx(W.p,{id:r.descriptionId,...d,ref:a})});Jt.displayName=Zt;var es="DialogClose",ts=u.forwardRef((s,a)=>{const{__scopeDialog:n,...d}=s,r=O(es,n);return e.jsx(W.button,{type:"button",...d,ref:a,onClick:G(s.onClick,()=>r.onOpenChange(!1))})});ts.displayName=es;function Ue(s){return s?"open":"closed"}var ss="DialogTitleWarning",[ir,as]=Ps(ss,{contentName:X,titleName:Ke,docsSlug:"dialog"}),ka=({titleId:s})=>{const a=as(ss),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},_a="DialogDescriptionWarning",wa=({contentRef:s,descriptionId:a})=>{const d=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${as(_a).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},Ca=Qt,Ea=Wt,rs=Gt,ns=Vt,is=Yt,os=Jt,Sa=ts;const me=Ca,Pa=Ea,ls=u.forwardRef(({className:s,...a},n)=>e.jsx(rs,{ref:n,className:U("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}));ls.displayName=rs.displayName;const ne=u.forwardRef(({className:s,children:a,...n},d)=>e.jsxs(Pa,{children:[e.jsx(ls,{}),e.jsxs(ns,{ref:d,className:U("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(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(Fe,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));ne.displayName=ns.displayName;const ie=({className:s,...a})=>e.jsx("div",{className:U("flex flex-col space-y-1.5 text-center sm:text-left",s),...a});ie.displayName="DialogHeader";const oe=({className:s,...a})=>e.jsx("div",{className:U("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",s),...a});oe.displayName="DialogFooter";const le=u.forwardRef(({className:s,...a},n)=>e.jsx(is,{ref:n,className:U("text-lg font-semibold leading-none tracking-tight",s),...a}));le.displayName=is.displayName;const ce=u.forwardRef(({className:s,...a},n)=>e.jsx(os,{ref:n,className:U("text-sm text-muted-foreground",s),...a}));ce.displayName=os.displayName;function Ra(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((l,m)=>l!==s[m])?r:s}if(Array.isArray(s.results)){const r=s.results.map(d);return r.some((l,m)=>l!==s.results[m])?{...s,results:r}:s}return s}function Se(s,a,n){new Set([...n,a.id,a.arxiv_id].filter(l=>!!l)).forEach(l=>{s.setQueryData(["paper",l],a),s.setQueryData(["paper-arxiv",l],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=l=>Ra(l,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 Da=250,Ia=100;function Ma({open:s,onOpenChange:a,paperId:n,arxivId:d,initialTaskIds:r,initialTasks:t,onSuccess:l}){const[m,j]=u.useState(r),[h,k]=u.useState(""),[p,C]=u.useState(""),[P,R]=u.useState(new Map),E=ae(),{toast:D}=$e(),S=u.useRef(!1);u.useEffect(()=>{if(!s){S.current=!1;return}if(S.current)return;S.current=!0,j(r),k(""),C("");const o=new Map;(t||[]).forEach(v=>{const x=parseInt(v.id);Number.isNaN(x)||o.set(x,v)}),R(o)},[s,r,t]),u.useEffect(()=>{const o=window.setTimeout(()=>{C(h.trim())},Da);return()=>window.clearTimeout(o)},[h]);const{data:c,isFetching:_}=q({queryKey:["tasks-search",p],queryFn:()=>Mt({page_size:Ia,visible_only:!0,...p?{q:p}:{}}),enabled:s});u.useEffect(()=>{var o;(o=c==null?void 0:c.results)!=null&&o.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 I=u.useMemo(()=>{const o=(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))}),o.forEach(N=>{const g=parseInt(N.id);Number.isNaN(g)||v.has(g)||(x.push(N),v.add(g))}),x},[c,m,P]),F=re({mutationFn:({paperId:o,taskIds:v})=>Bs(o,v),onMutate:async({taskIds:o})=>{const v=o.map(g=>P.get(g)).filter(g=>!!g).map(g=>({id:g.id,name:g.name,slug:g.slug})).sort((g,B)=>g.name.localeCompare(B.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(B=>{const H=[B,g],M=E.getQueryData(H);N.push({key:H,data:M}),M&&E.setQueryData(H,{...M,tasks:v})})}),D({title:"Tasks updated",description:`Saved ${o.length} task${o.length===1?"":"s"} for this paper.`}),l==null||l(),a(!1),{snapshots:N}},onSuccess:o=>{Se(E,o,[n,d])},onError:(o,v,x)=>{var B,H;(B=x==null?void 0:x.snapshots)==null||B.forEach(({key:M,data:Pe})=>{E.setQueryData(M,Pe)});const N=o;let g=N.message||"Failed to update paper tasks.";if(N.response)try{const M=JSON.parse(N.response);typeof(M==null?void 0:M.detail)=="string"?g=M.detail:Array.isArray(M==null?void 0:M.detail)&&((H=M.detail[0])!=null&&H.msg)&&(g=M.detail[0].msg)}catch{g=N.response}D({title:"Could not save tasks",description:g,variant:"destructive"})}}),b=()=>{F.mutate({paperId:n,taskIds:m})},w=(o,v)=>{j(x=>v?x.includes(o)?x:[...x,o]:x.filter(N=>N!==o))},f=()=>k("");return e.jsx(me,{open:s,onOpenChange:a,children:e.jsxs(ne,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ie,{children:[e.jsx(le,{children:"Edit Paper Tasks"}),e.jsx(ce,{children:"Select the tasks that this paper addresses. You can select multiple tasks."})]}),e.jsxs("div",{className:"relative mb-4",children:[e.jsx(Ne,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(z,{type:"text",placeholder:"Search tasks...",value:h,onChange:o=>k(o.target.value),className:"pl-9 pr-9"}),h&&e.jsx("button",{type:"button",onClick:f,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(Fe,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[400px]",children:I.length>0?e.jsx("div",{className:"space-y-2",children:I.map(o=>{const v=parseInt(o.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(He,{id:`task-${o.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-${o.id}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[o.name,o.description&&e.jsxs("span",{className:"block text-xs text-muted-foreground font-normal mt-1",children:[o.description.substring(0,100),o.description.length>100?"...":""]})]})]},o.id)})}):_?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(V,{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(Ne,{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(oe,{children:[e.jsx(A,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(A,{onClick:b,disabled:F.isPending,children:F.isPending?e.jsxs(e.Fragment,{children:[e.jsx(V,{className:"w-4 h-4 mr-2 animate-spin"}),"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(se,{className:"w-4 h-4 mr-2"}),"Save Changes"]})})]})]})})}const Ta=250,Aa=100;function Fa({open:s,onOpenChange:a,paperId:n,arxivId:d,initialMethodIds:r,initialMethods:t,onSuccess:l}){const[m,j]=u.useState(r),[h,k]=u.useState(""),[p,C]=u.useState(""),[P,R]=u.useState(new Map),E=ae(),{toast:D}=$e(),S=u.useRef(!1);u.useEffect(()=>{if(!s){S.current=!1;return}if(S.current)return;S.current=!0,j(r),k(""),C("");const o=new Map;(t||[]).forEach(v=>{const x=parseInt(v.id);Number.isNaN(x)||o.set(x,v)}),R(o)},[s,r,t]),u.useEffect(()=>{const o=window.setTimeout(()=>{C(h.trim())},Ta);return()=>window.clearTimeout(o)},[h]);const{data:c,isFetching:_}=q({queryKey:["methods-search",p],queryFn:()=>Hs({page_size:Aa,...p?{q:p}:{}}),enabled:s});u.useEffect(()=>{var o;(o=c==null?void 0:c.results)!=null&&o.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 I=u.useMemo(()=>{const o=(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))}),o.forEach(N=>{const g=parseInt(N.id);Number.isNaN(g)||v.has(g)||(x.push(N),v.add(g))}),x},[c,m,P]),F=re({mutationFn:({paperId:o,methodIds:v})=>zs(o,v),onSuccess:o=>{Se(E,o,[n,d]),D({title:"Methods updated",description:`Saved ${m.length} method${m.length===1?"":"s"} for this paper.`}),l==null||l(),a(!1)},onError:o=>{var N;const v=o;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=()=>{F.mutate({paperId:n,methodIds:m})},w=(o,v)=>{j(x=>v?x.includes(o)?x:[...x,o]:x.filter(N=>N!==o))},f=()=>k("");return e.jsx(me,{open:s,onOpenChange:a,children:e.jsxs(ne,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ie,{children:[e.jsx(le,{children:"Edit Paper Methods"}),e.jsx(ce,{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(Ne,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(z,{type:"text",placeholder:"Search methods...",value:h,onChange:o=>k(o.target.value),className:"pl-9 pr-9"}),h&&e.jsx("button",{type:"button",onClick:f,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(Fe,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[400px]",children:I.length>0?e.jsx("div",{className:"space-y-2",children:I.map(o=>{const v=parseInt(o.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(He,{id:`method-${o.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-${o.id}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[o.name,o.full_name&&o.full_name!==o.name&&e.jsx("span",{className:"block text-xs text-muted-foreground font-normal",children:o.full_name}),o.description&&e.jsxs("span",{className:"block text-xs text-muted-foreground font-normal mt-1",children:[o.description.substring(0,100),o.description.length>100?"...":""]})]})]},o.id)})}):_?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(V,{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(Ne,{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(oe,{children:[e.jsx(A,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(A,{onClick:b,disabled:F.isPending,children:F.isPending?e.jsxs(e.Fragment,{children:[e.jsx(V,{className:"w-4 h-4 mr-2 animate-spin"}),"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(se,{className:"w-4 h-4 mr-2"}),"Save Changes"]})})]})]})})}function $a({open:s,onOpenChange:a,paperId:n,arxivId:d,initialRepositories:r,onSuccess:t}){const[l,m]=u.useState(r),[j,h]=u.useState(""),k=ae(),p=u.useRef(!1);u.useEffect(()=>{if(!s){p.current=!1;return}p.current||(p.current=!0,m(r),h(""))},[s,r]);const C=re({mutationFn:({paperId:c,repositories:_})=>Qs(c,_),onSuccess:c=>{Se(k,c,[n,d]),t==null||t(),a(!1),h("")}}),P=()=>{const c=j.trim();return c?l.some(_=>_.url===c)?(alert("This repository URL is already added"),null):[...l,{url:c,is_official:!1}]:l},R=()=>{const c=P();c!==null&&c.length!==l.length&&(m(c),h(""))},E=c=>{m(l.filter(_=>_.url!==c))},D=c=>{m(l.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(ne,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ie,{children:[e.jsx(le,{children:"Edit Paper Repositories"}),e.jsx(ce,{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(z,{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(A,{onClick:R,size:"sm",disabled:!j.trim(),children:[e.jsx(Oe,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:l.length>0?e.jsx("div",{className:"space-y-2",children:l.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(_t,{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(Tt,{variant:"secondary",className:"text-xs",children:"Official"})]})}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxs(A,{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(At,{className:`w-3.5 h-3.5 mr-1 ${c.is_official?"fill-current":""}`}),c.is_official?"Official":"Mark official"]}),e.jsx(A,{variant:"ghost",size:"sm",onClick:()=>E(c.url),className:"h-8 px-2 text-destructive hover:text-destructive",title:"Remove repository",children:e.jsx(qe,{className:"w-4 h-4"})})]})]},_))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(_t,{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(oe,{children:[e.jsx(A,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(A,{onClick:S,disabled:C.isPending,children:C.isPending?e.jsxs(e.Fragment,{children:[e.jsx(V,{className:"w-4 h-4 mr-2 animate-spin"}),"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(se,{className:"w-4 h-4 mr-2"}),"Save Changes"]})})]})]})})}function La({open:s,onOpenChange:a,paperId:n,arxivId:d,initialProjectPages:r,onSuccess:t}){const[l,m]=u.useState(r),[j,h]=u.useState(""),k=ae(),p=u.useRef(!1);u.useEffect(()=>{if(!s){p.current=!1;return}p.current||(p.current=!0,m(r),h(""))},[s,r]);const C=re({mutationFn:({paperId:c,projectPages:_})=>Ks(c,_),onSuccess:c=>{Se(k,c,[n,d]),t==null||t(),a(!1),h("")}}),P=()=>{const c=j.trim();return c?l.some(_=>_.url===c)?(alert("This project page URL is already added"),null):[...l,{url:c,is_official:!1}]:l},R=()=>{const c=P();c!==null&&c.length!==l.length&&(m(c),h(""))},E=c=>{m(l.filter(_=>_.url!==c))},D=c=>{m(l.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(ne,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ie,{children:[e.jsx(le,{children:"Edit Paper Project Pages"}),e.jsx(ce,{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(z,{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(A,{onClick:R,size:"sm",disabled:!j.trim(),children:[e.jsx(Oe,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:l.length>0?e.jsx("div",{className:"space-y-2",children:l.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(wt,{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(Tt,{variant:"secondary",className:"text-xs",children:"Official"})]})}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxs(A,{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(At,{className:`w-3.5 h-3.5 mr-1 ${c.is_official?"fill-current":""}`}),c.is_official?"Official":"Mark official"]}),e.jsx(A,{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(qe,{className:"w-4 h-4"})})]})]},_))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(wt,{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(oe,{children:[e.jsx(A,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(A,{onClick:S,disabled:C.isPending,children:C.isPending?e.jsxs(e.Fragment,{children:[e.jsx(V,{className:"w-4 h-4 mr-2 animate-spin"}),"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(se,{className:"w-4 h-4 mr-2"}),"Save Changes"]})})]})]})})}function Oa(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):"",num_parameters:a.num_parameters!=null?String(a.num_parameters):"",operation:"unchanged"}})}function Ct(s){const a=s.trim();if(a==="")return null;const n=Number(a);return!Number.isFinite(n)||n<0?null:Math.trunc(n)}function qa({open:s,onOpenChange:a,paperId:n,arxivId:d,initialEvaluations:r,onSuccess:t}){const[l,m]=u.useState([]),j=ae(),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(Oa(r)))},[s,r]);const{data:p}=q({queryKey:["tasks-for-eval-edit"],queryFn:()=>Mt({page_size:100}),enabled:s}),{data:C}=q({queryKey:["datasets-for-eval-edit"],queryFn:()=>kt({page_size:100}),enabled:s}),P=u.useMemo(()=>Array.from(new Set(l.map(b=>b.task_id).filter(b=>b&&b!==""))),[l]),R=q({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 f=await kt({task_id:parseInt(w),page_size:100});b[w]=f.results}catch(f){console.error(`Error fetching datasets for task ${w}:`,f),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 f=E(b).find(o=>o.id===w);return!!(f!=null&&f.supports_harness)},S=re({mutationFn:async({paperId:b,evaluations:w})=>{for(const f of w)if(f.operation==="delete"&&f.id)try{await Us(f.id)}catch(o){if((typeof o=="object"&&o!==null&&"status"in o?o.status:void 0)!==404)throw o;console.log(`Evaluation ${f.id} already deleted or not found`)}else if(f.operation==="create"){const o=D(f.task_id,f.dataset_id),v=Ct(f.num_parameters);await Ws({paper_id:parseInt(b),task_id:parseInt(f.task_id),dataset_id:parseInt(f.dataset_id),model_name:f.model_name||void 0,harness:o&&f.harness||void 0,metrics:{[f.metric_name]:f.metric_value},best_metric:f.metric_name,best_rank:f.best_rank?parseInt(f.best_rank):void 0,num_parameters:v??void 0})}else if(f.operation==="update"&&f.id){const o=D(f.task_id,f.dataset_id);await Gs(f.id,{task_id:parseInt(f.task_id),dataset_id:parseInt(f.dataset_id),model_name:f.model_name||void 0,harness:o&&f.harness||null,metrics:{[f.metric_name]:f.metric_value},best_metric:f.metric_name,best_rank:f.best_rank?parseInt(f.best_rank):void 0,num_parameters:Ct(f.num_parameters)})}},onSuccess:()=>{j.invalidateQueries({queryKey:["paper-arxiv",d]}),j.invalidateQueries({queryKey:["evaluations","paper",n]}),t==null||t(),a(!1)}}),c=()=>{k.current=!0,m([...l,{task_id:"",dataset_id:"",model_name:"",harness:"",metric_name:"",metric_value:"",best_rank:"",num_parameters:"",operation:"create"}])},_=b=>{k.current=!0,l[b].id?m(l.map((f,o)=>o===b?{...f,operation:"delete"}:f)):m(l.filter((f,o)=>o!==b))},I=(b,w,f)=>{k.current=!0,m(l.map((o,v)=>{if(v!==b)return o;const x={...o,[w]:f};return w==="task_id"&&(x.dataset_id="",x.harness=""),w==="dataset_id"&&f&&!D(x.task_id,f)&&(x.harness=""),o.operation==="unchanged"&&(x.operation="update"),x}))},F=()=>{const b=l.filter(w=>w.operation!=="delete"||w.id);S.mutate({paperId:n,evaluations:b})};return e.jsx(me,{open:s,onOpenChange:a,children:e.jsxs(ne,{className:"max-w-6xl max-h-[800px]",children:[e.jsxs(ie,{children:[e.jsx(le,{children:"Edit Evaluation Results"}),e.jsx(ce,{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:[l.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",children:"Parameters"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm w-16",children:"Action"})]})}),e.jsx("tbody",{children:l.map((b,w)=>{var f;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:o=>I(w,"task_id",o.target.value),children:[e.jsx("option",{value:"",children:"Select Task"}),(f=p==null?void 0:p.results)==null?void 0:f.map(o=>e.jsx("option",{value:o.id,children:o.name},o.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:o=>I(w,"dataset_id",o.target.value),children:[e.jsx("option",{value:"",children:"Select Dataset"}),E(b.task_id).map(o=>e.jsx("option",{value:o.id,children:o.name},o.id))]})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(z,{type:"text",className:"w-full text-sm",placeholder:"Model name",value:b.model_name,onChange:o=>I(w,"model_name",o.target.value)})}),e.jsx("td",{className:"py-2 px-2",children:D(b.task_id,b.dataset_id)?e.jsx(z,{type:"text",className:"w-full text-sm",placeholder:"Claude Code, Terminus, ...",value:b.harness,onChange:o=>I(w,"harness",o.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(z,{type:"text",className:"w-full text-sm",placeholder:"AP, mAP, etc.",value:b.metric_name,onChange:o=>I(w,"metric_name",o.target.value)})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(z,{type:"text",className:"w-full text-sm",placeholder:"44.9",value:b.metric_value,onChange:o=>I(w,"metric_value",o.target.value)})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(z,{type:"number",min:0,step:1,className:"w-full text-sm",placeholder:"e.g. 7000000000",value:b.num_parameters,onChange:o=>I(w,"num_parameters",o.target.value),title:"Raw model parameter count (e.g. 7000000000 for a 7B model). Leave blank if unknown."})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(A,{variant:"ghost",size:"sm",onClick:()=>_(w),className:"h-8 w-8 p-0 text-destructive hover:text-destructive",title:"Delete row",children:e.jsx(qe,{className:"w-4 h-4"})})})]},w)})})]})}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(ea,{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:c,className:"flex items-center space-x-2",children:[e.jsx(Oe,{className:"w-4 h-4"}),e.jsx("span",{children:"Add Row"})]})})]}),e.jsxs(oe,{children:[e.jsx(A,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(A,{onClick:F,disabled:S.isPending,children:S.isPending?e.jsxs(e.Fragment,{children:[e.jsx(V,{className:"w-4 h-4 mr-2 animate-spin"}),"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(se,{className:"w-4 h-4 mr-2"}),"Save Changes"]})})]})]})})}const ee=["my-bookmark-ids"];function Ba(){var d,r;const{user:s}=we(),a=q({queryKey:ee,queryFn:()=>ye.getMyBookmarkIds(),enabled:!!s,staleTime:60*1e3,refetchOnWindowFocus:!1}),n=Le.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 za(){const{user:s}=we(),a=ae(),n=re({mutationFn:async({paperId:r,isBookmarked:t})=>{t?await ye.removeBookmark(r):await ye.addBookmark(r)},onMutate:async({paperId:r,isBookmarked:t})=>{await a.cancelQueries({queryKey:ee});const l=a.getQueryData(ee),m=typeof r=="string"?Number(r):r,j=(l==null?void 0:l.paper_ids)??[],h=t?j.filter(k=>k!==m):[m,...j.filter(k=>k!==m)];return a.setQueryData(ee,{paper_ids:h}),{previous:l}},onError:(r,t,l)=>{l!=null&&l.previous&&a.setQueryData(ee,l.previous)},onSettled:()=>{a.invalidateQueries({queryKey:ee}),a.invalidateQueries({queryKey:["my-bookmarks"]})}});return{toggle:Le.useCallback((r,t)=>{if(!s){if(Dt())return;const l=typeof window<"u"?window.location.pathname+window.location.search:"/";window.location.href=It(`/api/v1/auth/hf/login?return_to=${encodeURIComponent(l)}`);return}n.mutate({paperId:r,isBookmarked:t})},[n,s]),isPending:n.isPending}}const Ha=({paperId:s})=>{const{user:a}=we(),{idSet:n}=Ba(),{toggle:d,isPending:r}=za();if(Dt())return null;const t=Number(s),l=!!a&&n.has(t),m=()=>{Number.isFinite(t)&&d(t,l)},j=a&&l?"Saved":"Save",h=a?l?"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${l?" is-saved":""}`,onClick:m,disabled:r,"aria-pressed":l,"aria-label":h,title:h,children:[e.jsx(L,{name:"bookmark",size:12}),j]})},ve=360,Te=3;function Et(s){if(!s)return"—";try{return new Date(s).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"—"}}function St(s){return s>=1e3?`${(s/1e3).toFixed(1)}k`:String(s)}function be(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 or=()=>{var it,ot,lt,ct,dt,ut,mt,ht,pt,ft,xt,gt;const{arxivId:s}=Rs(),a=Ds(),{toast:n}=$e(),{user:d}=we(),r=(d==null?void 0:d.is_admin)??!1,{data:t,isLoading:l,error:m,refetch:j}=Ys(s||"",!!s),[h,k]=u.useState(!1);u.useEffect(()=>{if(k(!1),!(t!=null&&t.id))return;const i=window.setTimeout(()=>k(!0),0);return()=>window.clearTimeout(i)},[t==null?void 0:t.id]);const{data:p,isLoading:C}=aa(h?t==null?void 0:t.arxiv_id:void 0),{data:P,isLoading:R}=ta(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 i=new Map;for(const y of P){const T=y.task_id,$=i.get(T);$?$.rows.push(y):i.set(T,{taskId:T,taskName:y.task_name||"—",taskSlug:y.task_slug,rows:[y]})}return Array.from(i.values())},[P]),S=q({queryKey:["paper-versions",t==null?void 0:t.arxiv_id],queryFn:async()=>{const i=t.arxiv_id.replace(/v\d+$/,""),y=await fetch(It(`/api/v1/papers/arxiv/${i}/versions`));return y.ok?await y.json():[]},enabled:h&&!!(t!=null&&t.arxiv_id),staleTime:10*60*1e3}),c=q({queryKey:["related-papers",(ot=(it=t==null?void 0:t.tasks)==null?void 0:it[0])==null?void 0:ot.id],queryFn:()=>ye.getTaskPapers(t.tasks[0].id,{page:1,page_size:5,order_by:"citation_count",order_dir:"desc",include_resources:!1}),enabled:h&&!!((ct=(lt=t==null?void 0:t.tasks)==null?void 0:lt[0])!=null&&ct.id),staleTime:10*60*1e3,select:i=>i.results.filter(y=>y.id!==(t==null?void 0:t.id)).slice(0,4)}),[_,I]=u.useState(!1),[F,b]=u.useState(!1),[w,f]=u.useState(!1),{isEditingTasks:o,setIsEditingTasks:v,isEditingMethods:x,setIsEditingMethods:N,isEditingRepositories:g,setIsEditingRepositories:B,isEditingProjectPages:H,setIsEditingProjectPages:M,isEditingEvaluations:Pe,setIsEditingEvaluations:We}=ra(),[Ge,Re]=u.useState("idle"),[Ve,Xe]=u.useState(null),[Ye,Ze]=u.useState(null),cs=async()=>{if(s){Re("indexing"),Xe(null),Ze(null);try{await Vs(s),n({title:"Indexed",description:"Paper added to database."}),setTimeout(()=>j(),1200),Re("idle")}catch(i){const y=i;let T=y.message||"Failed to index paper";if(y.response)try{T=JSON.parse(y.response).detail||T}catch{T=y.response}Xe(T),(y.status===429||y.status===503)&&Ze("Try again later after arXiv has lifted the temporary limit."),Re("idle")}}},{citationDisplay:ds,citationCopy:Je}=u.useMemo(()=>{if(!t)return{citationDisplay:"",citationCopy:""};const i=`${t.title.slice(0,60)}${t.title.length>60?"…":""}`,y=`${t.authors[0]||""}${t.authors.length>1?" et al.":""}`,T=t.authors.join(" and "),$=(t.published||"").slice(0,4)||"—",jt=(vt,bt)=>t.arxiv_id?`@article{${t.arxiv_id.replace(".","")},
36
+ title={{${vt}}},
37
+ author=${bt},
38
+ year={{${$}}},
39
+ eprint={{${t.arxiv_id}}},
40
+ archivePrefix={{arXiv}}
41
+ }`:`@misc{paper${t.id},
42
+ title={{${vt}}},
43
+ author=${bt},
44
+ year={{${$}}},
45
+ url={{${t.source_url||t.url_abs||""}}}
46
+ }`;return{citationDisplay:jt(i,`{{${y}}}`),citationCopy:jt(t.title,`{${T}}`)}},[t]),[us,et]=u.useState(!1),ms=async()=>{if(Je)try{await navigator.clipboard.writeText(Je),et(!0),n({title:"Citation copied",description:"BibTeX entry copied to clipboard."}),window.setTimeout(()=>et(!1),1500)}catch{n({title:"Copy failed",description:"Could not access the clipboard. Please copy manually.",variant:"destructive"})}};if(l)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(J,{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."]}),Ve&&e.jsx(Zs,{variant:"destructive",className:"mt-4 max-w-xl",children:e.jsxs(Js,{children:[e.jsx("div",{children:Ve}),Ye&&e.jsx("div",{className:"mt-2",children:Ye})]})}),e.jsxs("div",{className:"action-row",children:[r&&e.jsxs("button",{className:"action-btn",onClick:cs,disabled:Ge==="indexing",children:[e.jsx(L,{name:"sparkle",size:12}),Ge==="indexing"?"Indexing…":"Index from arXiv"]}),e.jsx(A,{variant:"outline",onClick:()=>a("/papers"),children:"Browse Papers"})]})]});const tt=S.data||[],he=Xs(t.repositories),Q=[...t.repositories??[]].sort((i,y)=>{const T=i.is_official?1:0,$=y.is_official?1:0;return T!==$?$-T:(y.num_stars||0)-(i.num_stars||0)}),hs=w?Q:Q.slice(0,Te),ps=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: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:Ae(E.models),count:E.models.length,links:E.models.map(i=>({href:i,label:be(i,"Model")}))},{label:"Datasets",href:Ae(E.datasets),count:E.datasets.length,links:E.datasets.map(i=>({href:i,label:be(i,"Dataset")}))},{label:"Spaces",href:Ae(E.spaces),count:E.spaces.length,links:E.spaces.map(i=>({href:i,label:be(i,"Space")}))}],footer:null},st=t.tldr||null,at=t.num_pages||null,Y=t.abstract||"",fs=Y.length>ve?Y.slice(0,ve)+"…":Y,xs=_||Y.length<=ve?Y:fs,pe=(t.methods||[]).filter(i=>i.source_paper_id===t.id),fe=t.introduced_benchmarks||[],gs=pe.length>0||fe.length>0,rt=t.arxiv_id?`arXiv:${t.arxiv_id}`:"External resource",js=t.source==="external"?"Source page":"arXiv page",Z=((dt=t.project_pages)==null?void 0:dt.filter(i=>i.url))??[],vs=(()=>{const i=[];return pe.length>0&&i.push(pe.length===1?"this method":"these methods"),fe.length>0&&i.push(fe.length===1?"this benchmark":"these benchmarks"),i.length===0?"":i.length===1?i[0]:i.join(" and ")})(),xe=t.predecessor_papers||[],ge=t.successor_papers||[],bs=xe.length>0||ge.length>0,je=12,De=t.authors.map((i,y)=>{var T,$;return{name:i,hf_username:(($=(T=t.author_links)==null?void 0:T[y])==null?void 0:$.hf_username)??null}}),nt=F||De.length<=je?De:De.slice(0,je);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(J,{to:"/",children:"Trending"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{children:rt})]}),e.jsxs("div",{className:"detail-grid",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"detail-title",children:e.jsx(Nt,{title:t.title})}),e.jsxs("div",{className:"detail-meta",children:[e.jsx("span",{children:rt}),e.jsx("span",{children:"·"}),e.jsxs("span",{children:["Submitted ",Et(t.published)]}),at&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[at," 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}$/,"")})]}),tt.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("select",{className:"version-select",value:t.version,onChange:i=>{const y=i.target.value;t.arxiv_id&&a(`/paper/${t.arxiv_id.replace(/v\d+$/,"")}${y?`?version=${y}`:""}`)},children:tt.map(i=>e.jsxs("option",{value:i.version,children:[i.version," — ",Et(i.published)]},i.version))})]})]}),e.jsxs("div",{className:"detail-authors",children:[nt.map((i,y)=>e.jsxs(Le.Fragment,{children:[i.hf_username?e.jsx("a",{href:`https://huggingface.co/${i.hf_username}`,target:"_blank",rel:"noopener noreferrer",title:`@${i.hf_username} on Hugging Face`,children:i.name}):e.jsx("a",{children:i.name}),y<nt.length-1?", ":""]},y)),t.authors.length>je&&e.jsx("button",{className:"show-more-authors",onClick:()=>b(i=>!i),style:{marginLeft:8,background:"none",border:"none",cursor:"pointer",color:"var(--accent-text)",fontFamily:"var(--mono)",fontSize:12},children:F?"show fewer":`+${t.authors.length-je} 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})," ",js]}),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:["· ",St(he.github)," ★"]})]}),Z.length===1&&!r?e.jsxs("a",{className:"action-btn",href:Z[0].url,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(L,{name:"globe",size:12})," Project page"]}):null,Z.length>0&&(Z.length>1||r)?e.jsxs(Is,{children:[e.jsx(Ms,{asChild:!0,children:e.jsxs("button",{type:"button",className:"action-btn",children:[e.jsx(L,{name:"globe",size:12})," Project page"]})}),e.jsxs(Ts,{align:"start",className:"project-page-menu",children:[Z.map((i,y)=>e.jsx(yt,{asChild:!0,children:e.jsx("a",{href:i.url,target:"_blank",rel:"noopener noreferrer",children:be(i.url,`Project page ${y+1}`)})},i.url)),r&&e.jsxs(e.Fragment,{children:[e.jsx(As,{}),e.jsx(yt,{onSelect:()=>M(!0),children:"Add or edit project pages"})]})]})]}):null,r&&Z.length===0?e.jsxs("button",{type:"button",className:"action-btn",onClick:()=>M(!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(Ha,{paperId:t.id})]}),gs&&e.jsxs("div",{className:"introduced-banner",children:[e.jsx("span",{className:"introduced-label",children:"Introduced"}),e.jsxs("div",{className:"introduced-methods",children:[pe.map(i=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>a(`/methods/${i.slug||i.id}`),children:[i.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`method-${i.id}`)),fe.map(i=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>a(`/benchmark/${i.slug||i.id}`),children:[i.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`benchmark-${i.id}`))]}),e.jsxs("span",{className:"introduced-note",children:["This paper is the canonical source for ",vs,"."]})]}),bs&&e.jsxs("div",{className:"introduced-banner lineage-banner",children:[ge.length>0&&e.jsxs("div",{className:"lineage-row",children:[e.jsx("span",{className:"introduced-label lineage-label",children:ge.length===1?"Follow-up paper":"Follow-up papers"}),e.jsx("div",{className:"introduced-methods",children:ge.map(i=>e.jsxs("button",{type:"button",className:"introduced-pill lineage-pill",onClick:()=>a(`/paper/${i.route_identifier}`),children:[i.title,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`successor-${i.id}`))})]}),xe.length>0&&e.jsxs("div",{className:"lineage-row",children:[e.jsx("span",{className:"introduced-label lineage-label",children:xe.length===1?"Predecessor paper":"Predecessor papers"}),e.jsx("div",{className:"introduced-methods",children:xe.map(i=>e.jsxs("button",{type:"button",className:"introduced-pill lineage-pill",onClick:()=>a(`/paper/${i.route_identifier}`),children:[e.jsx("span",{className:"introduced-arrow lineage-arrow-back",children:"←"}),i.title]},`predecessor-${i.id}`))})]})]}),st&&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:st})]}),e.jsx("div",{className:"section-rule",children:e.jsx("span",{children:"Abstract"})}),e.jsx("p",{className:"abstract-text",style:{marginBottom:8},children:e.jsx(Os,{text:xs})}),Y.length>ve&&e.jsx("div",{className:"read-full",onClick:()=>I(i=>!i),children:_?"− collapse abstract":"+ read full abstract"}),e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:"Tasks"}),e.jsxs("span",{className:"accent",children:[((ut=t.tasks)==null?void 0:ut.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(i=>e.jsx($s,{slug:i.slug||"",label:i.name},i.id))}),e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:"Methods"}),e.jsxs("span",{className:"accent",children:[((mt=t.methods)==null?void 0:mt.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(i=>e.jsx(Ls,{method:i},i.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:()=>We(!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(i=>e.jsxs("div",{children:[e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:i.taskSlug?e.jsx(J,{to:`/tasks/${i.taskSlug}`,children:i.taskName}):i.taskName}),e.jsxs("span",{className:"accent",children:[i.rows.length," ",i.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:i.rows.map(y=>{var T;return e.jsxs("tr",{children:[e.jsx("td",{className:"benchmark",children:y.dataset_slug?e.jsx(J,{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:Fs((T=y.metrics)==null?void 0:T[y.best_metric||""])}),e.jsx("td",{className:"compare",children:y.dataset_slug&&e.jsx(J,{to:`/benchmark/${y.dataset_slug}?eval=${encodeURIComponent(y.id)}`,children:"Compare →"})})]},y.id)})})]})]},i.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:[(Q.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:[Q.length," repo",Q.length===1?"":"s",r&&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(i=>e.jsxs("a",{href:i.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:[i.owner,"/",i.name]}),i.is_official&&e.jsx("span",{className:"code-line-official",children:"· Official"})]}),e.jsxs("span",{className:"code-line-stars",children:["★ ",St(i.num_stars)]})]},i.id)),Q.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."}),Q.length>Te&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>f(i=>!i),children:w?"− show top 3":`+ show ${Q.length-Te} more repos`})]}),e.jsx(Qa,{viewer:ps}),e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[e.jsx("span",{children:"Citation"}),e.jsxs("button",{type:"button",className:"citation-copy-btn",onClick:ms,"aria-label":"Copy citation to clipboard",title:"Copy citation to clipboard",children:[e.jsx(L,{name:"copy",size:11}),us?"Copied":"Copy"]})]}),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:ds})]}),(((ht=c.data)==null?void 0:ht.length)??0)>0&&e.jsxs("div",{className:"sidebar-card",children:[e.jsx("div",{className:"sidebar-card-title",children:"Related papers"}),c.data.map(i=>e.jsxs(J,{to:`/paper/${i.arxiv_id||i.id}`,target:"_blank",rel:"noopener noreferrer",className:"related-paper",style:{textDecoration:"none",color:"inherit"},children:[e.jsx("div",{className:"related-title",children:e.jsx(Nt,{title:i.title})}),e.jsxs("div",{className:"related-meta",children:[e.jsx("span",{children:i.arxiv_id?`arXiv:${i.arxiv_id}`:"External resource"}),i.citation_count!=null&&e.jsxs("span",{children:[i.citation_count.toLocaleString()," cites"]})]})]},i.id))]})]})]}),e.jsx(Ma,{open:o,onOpenChange:v,paperId:t.id,arxivId:s,initialTaskIds:((pt=t.tasks)==null?void 0:pt.map(i=>parseInt(i.id)))||[],initialTasks:t.tasks||[]}),e.jsx(Fa,{open:x,onOpenChange:N,paperId:t.id,arxivId:s,initialMethodIds:((ft=t.methods)==null?void 0:ft.map(i=>parseInt(i.id)))||[],initialMethods:t.methods||[]}),e.jsx($a,{open:g,onOpenChange:B,paperId:t.id,arxivId:s,initialRepositories:((xt=t.repositories)==null?void 0:xt.map(i=>({url:i.url,is_official:i.is_official||!1})))||[]}),e.jsx(La,{open:H,onOpenChange:M,paperId:t.id,arxivId:s,initialProjectPages:((gt=t.project_pages)==null?void 0:gt.map(i=>({url:i.url,is_official:i.is_official||!1})))||[]}),e.jsx(qa,{open:Pe,onOpenChange:We,paperId:t.id,arxivId:s,initialEvaluations:P||[]})]})},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(de,{className:"h-16 w-full"}):e.jsxs(e.Fragment,{children:[s.rows.map(a=>e.jsx(Ka,{...a},a.label)),s.footer&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:10,color:"var(--ink-faint)",marginTop:12},children:s.footer})]})]}),Ka=({label:s,href:a,count:n,isLimited:d,links:r})=>{const t=((r==null?void 0:r.length)??0)>0,l=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:[l,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:l})};function Ae(s){return s[0]??"https://huggingface.co"}export{or as default};
assets/{PapersListView-DaGKJdn2.js → PapersListView-CIlHl_0S.js} RENAMED
@@ -1 +1 @@
1
- import{u as I,r as i,j as e,L as F}from"./index-khuRhj0-.js";import{I as L,P as T}from"./components-CewLBhcc.js";import{a as C}from"./api-DxZAbqc3.js";import{a as R,d as k}from"./transform-Bqq4PHFq.js";import{u as D}from"./usePapers-BGzr0Zy3.js";import{u as E}from"./useDebounce-ECOTH_xV.js";import{u as O,P as B}from"./usePeriodFilter-BdoqZixi.js";import{u as $}from"./useIntersectionObserver-DbPRy1RB.js";import{S as c}from"./skeleton-DAoGkyKK.js";import{A as z,a as M}from"./alert-Bm-7arBk.js";import{u as q}from"./useQuery-Caj49BNs.js";import"./LatexTitle-fGDJSovl.js";import"./adminAuth-PI_XkM8E.js";import"./useInfiniteQuery-DRYtGZQa.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};
 
1
+ import{u as I,r as i,j as e,L as F}from"./index-RvrzVxyQ.js";import{I as L,P as T}from"./components-vAXr5Yrz.js";import{a as C}from"./api-5i4Mf2ca.js";import{a as R,d as k}from"./transform-C19D-_iA.js";import{u as D}from"./usePapers-Dilp1UjP.js";import{u as E}from"./useDebounce-UZQdQpzf.js";import{u as O,P as B}from"./usePeriodFilter-vtzRDJbK.js";import{u as $}from"./useIntersectionObserver-b_ghxvrt.js";import{S as c}from"./skeleton-vJLXL7dU.js";import{A as z,a as M}from"./alert-B6WjabOu.js";import{u as q}from"./useQuery-DBPiiCZh.js";import"./LatexTitle-CbOP0isa.js";import"./adminAuth-PI_XkM8E.js";import"./useInfiniteQuery-D6kOn4ET.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/{SavedPapersView-Dn3yVoa-.js → SavedPapersView-Vf8zOvxz.js} RENAMED
@@ -1 +1 @@
1
- import{s as o,j as s,V as m,L as p}from"./index-khuRhj0-.js";import{u as h}from"./useQuery-Caj49BNs.js";import{T as x,P as u}from"./components-CewLBhcc.js";import{S as r}from"./skeleton-DAoGkyKK.js";import{A as j,a as v}from"./alert-Bm-7arBk.js";import{a as N}from"./api-DxZAbqc3.js";import{a as g}from"./transform-Bqq4PHFq.js";import"./LatexTitle-fGDJSovl.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};
 
1
+ import{s as o,j as s,V as m,L as p}from"./index-RvrzVxyQ.js";import{u as h}from"./useQuery-DBPiiCZh.js";import{T as x,P as u}from"./components-vAXr5Yrz.js";import{S as r}from"./skeleton-vJLXL7dU.js";import{A as j,a as v}from"./alert-B6WjabOu.js";import{a as N}from"./api-5i4Mf2ca.js";import{a as g}from"./transform-C19D-_iA.js";import"./LatexTitle-CbOP0isa.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-CGeqDGTE.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{r as f,y as w,t as E,j as s}from"./index-RvrzVxyQ.js";import{u as d}from"./useQuery-DBPiiCZh.js";import{L as Q}from"./LatexTitle-CbOP0isa.js";import{a as u}from"./api-5i4Mf2ca.js";import{u as C}from"./useDebounce-UZQdQpzf.js";import{f as L,h as R,d as K}from"./transform-C19D-_iA.js";import"./adminAuth-PI_XkM8E.js";const X=({open:t,onClose:n})=>{var y,N,k;const p=f.useRef(null),b=w(),[m,F]=E.useState(""),a=C(m,200);f.useEffect(()=>{var r;if(!t)return;(r=p.current)==null||r.focus();const e=T=>{T.key==="Escape"&&n()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t,n]);const g=d({queryKey:["search-papers",a],queryFn:()=>u.searchPapers(a,6),enabled:t&&a.length>=2,staleTime:6e4}),x=d({queryKey:["search-tasks",a],queryFn:()=>u.getTasks({q:a,page_size:6}),enabled:t&&a.length>=2,staleTime:6e4}),j=d({queryKey:["search-methods",a],queryFn:()=>u.getMethods({q:a,page_size:6}),enabled:t&&a.length>=2,staleTime:6e4}),v=d({queryKey:["search-benchmarks",a],queryFn:()=>u.getDatasets({q:a,page_size:6,ordering:"-paper_count"}),enabled:t&&a.length>=2,staleTime:6e4});if(!t)return null;const c=((y=x.data)==null?void 0:y.results)||[],l=((N=j.data)==null?void 0:N.results)||[],i=((k=v.data)==null?void 0:k.results)||[],h=g.data||[],_=g.isFetching||x.isFetching||j.isFetching||v.isFetching,q=c.length||h.length||l.length||i.length,o=e=>{n(),b(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:p,className:"search-modal-input",placeholder:"Search papers, tasks, methods, or benchmarks…",value:m,onChange:e=>F(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&&!_&&!q&&s.jsxs("div",{className:"search-empty",children:['No matches for "',m,'"']}),c.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Tasks · ",c.length]}),c.map(e=>{const r=L(R(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:r.dot}}),s.jsx("span",{className:"name",children:K(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:["Benchmarks · ",i.length]}),i.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>o(`/benchmark/${e.slug||e.id}`),children:[s.jsx("span",{className:"name",children:e.name}),e.paper_count!=null&&e.paper_count>0&&s.jsxs("span",{className:"count",children:[e.paper_count," entries"]})]},e.id))]}),h.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Papers · ",h.length]}),h.map(e=>{var r;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(Q,{title:e.title})}),s.jsxs("div",{className:"search-result-meta",children:[s.jsx("span",{children:e.arxiv_id?`arXiv:${e.arxiv_id}`:"External resource"}),((r=e.authors)==null?void 0:r[0])&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"·"}),s.jsxs("span",{children:[e.authors[0],e.authors.length>1?" et al.":""]})]}),e.citation_count!=null&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"·"}),s.jsxs("span",{children:["↑ ",e.citation_count.toLocaleString()]})]})]})]},e.id)})]})]})]})})};export{X as default};
assets/SearchOverlay-ML-XIg7G.js DELETED
@@ -1 +0,0 @@
1
- import{r as y,y as _,t as q,j as s}from"./index-khuRhj0-.js";import{u as h}from"./useQuery-Caj49BNs.js";import{L as T}from"./LatexTitle-fGDJSovl.js";import{a as u}from"./api-DxZAbqc3.js";import{u as w}from"./useDebounce-ECOTH_xV.js";import{f as E,h as L,d as Q}from"./transform-Bqq4PHFq.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/{SubmitView-C-2pf8nE.js → SubmitView-BTOuC0rd.js} RENAMED
@@ -1 +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-khuRhj0-.js";import{u as C}from"./useMutation-VlZbYGe6.js";import{A as E,a as z}from"./alert-Bm-7arBk.js";import{I as m,B as v}from"./input-CONfoWHZ.js";import{s as F}from"./api-DxZAbqc3.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};
 
1
+ import{r as P,j as e,h as T,y as w,p as D,q as _,t as n}from"./index-RvrzVxyQ.js";import{u as C}from"./useMutation-BChaaj62.js";import{A as E,a as z}from"./alert-B6WjabOu.js";import{I as m,B as v}from"./input-DBg77x-j.js";import{s as F}from"./api-5i4Mf2ca.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-DmWUoQiW.js → TagBrowseView-wiX11K6Q.js} RENAMED
@@ -1 +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-khuRhj0-.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-Caj49BNs.js";import{P as Ys,M as Zs}from"./components-CewLBhcc.js";import{a as L}from"./api-DxZAbqc3.js";import{a as se,d as J}from"./transform-Bqq4PHFq.js";import{c as ee}from"./usePapers-BGzr0Zy3.js";import{u as te}from"./useIntersectionObserver-DbPRy1RB.js";import{S as G}from"./skeleton-DAoGkyKK.js";import{A as ae,a as re}from"./alert-Bm-7arBk.js";import"./LatexTitle-fGDJSovl.js";import"./adminAuth-PI_XkM8E.js";import"./useInfiniteQuery-DRYtGZQa.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};
 
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-RvrzVxyQ.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-DBPiiCZh.js";import{P as Ys,M as Zs}from"./components-vAXr5Yrz.js";import{a as L}from"./api-5i4Mf2ca.js";import{a as se,d as J}from"./transform-C19D-_iA.js";import{c as ee}from"./usePapers-Dilp1UjP.js";import{u as te}from"./useIntersectionObserver-b_ghxvrt.js";import{S as G}from"./skeleton-vJLXL7dU.js";import{A as ae,a as re}from"./alert-B6WjabOu.js";import"./LatexTitle-CbOP0isa.js";import"./adminAuth-PI_XkM8E.js";import"./useInfiniteQuery-D6kOn4ET.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-Dw7WBt8G.js → TagsIndexView-1TeE1k6L.js} RENAMED
@@ -1 +1 @@
1
- import{r as d,j as e,L as h}from"./index-khuRhj0-.js";import{u as p}from"./useQuery-Caj49BNs.js";import{a as g}from"./api-DxZAbqc3.js";import{f as x,h as f,d as u}from"./transform-Bqq4PHFq.js";import{S as m}from"./skeleton-DAoGkyKK.js";import{A as j,a as y}from"./alert-Bm-7arBk.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};
 
1
+ import{r as d,j as e,L as h}from"./index-RvrzVxyQ.js";import{u as p}from"./useQuery-DBPiiCZh.js";import{a as g}from"./api-5i4Mf2ca.js";import{f as x,h as f,d as u}from"./transform-C19D-_iA.js";import{S as m}from"./skeleton-vJLXL7dU.js";import{A as j,a as y}from"./alert-B6WjabOu.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/{alert-Bm-7arBk.js → alert-B6WjabOu.js} RENAMED
@@ -1 +1 @@
1
- import{r as a,j as s,h as l,_ as i}from"./index-khuRhj0-.js";const o=i("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),n=a.forwardRef(({className:e,variant:t,...r},d)=>s.jsx("div",{ref:d,role:"alert",className:l(o({variant:t}),e),...r}));n.displayName="Alert";const v=a.forwardRef(({className:e,...t},r)=>s.jsx("h5",{ref:r,className:l("mb-1 font-medium leading-none tracking-tight",e),...t}));v.displayName="AlertTitle";const c=a.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:l("text-sm [&_p]:leading-relaxed",e),...t}));c.displayName="AlertDescription";export{n as A,c as a};
 
1
+ import{r as a,j as s,h as l,_ as i}from"./index-RvrzVxyQ.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-DxZAbqc3.js → api-5i4Mf2ca.js} RENAMED
@@ -1 +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-khuRhj0-.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};
 
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-RvrzVxyQ.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 r=new Error(`API request failed: ${c.status} ${c.statusText}`);throw r.status=c.status,r.statusText=c.statusText,r.response=h,r}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 getLeaderboardMetrics(e,t){return(await this.request(`/datasets/${e}/tasks/${t}/metrics`)).metrics}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 _=await this.getEvaluations({paper_id:i,page:u,page_size:100,ordering:"-benchmark_popularity"});d.push(..._.results),u=_.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),L=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 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.getLeaderboardMetrics.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,L as e,x 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/{badge-kHfqSFB-.js → badge-CAs_Xk6U.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{c as e,j as o,h as s,_ as n}from"./index-khuRhj0-.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{c as e,j as o,h as s,_ as n}from"./index-RvrzVxyQ.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{components-CewLBhcc.js → components-vAXr5Yrz.js} RENAMED
@@ -1 +1 @@
1
- import{p as z,t as y,j as t,L as C,y as w}from"./index-khuRhj0-.js";import{L as S}from"./LatexTitle-fGDJSovl.js";import{h as P,d as H,g as R,f as T}from"./transform-Bqq4PHFq.js";import{a as E}from"./api-DxZAbqc3.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};
 
1
+ import{p as z,t as y,j as t,L as C,y as w}from"./index-RvrzVxyQ.js";import{L as S}from"./LatexTitle-CbOP0isa.js";import{h as P,d as H,g as R,f as T}from"./transform-C19D-_iA.js";import{a as E}from"./api-5i4Mf2ca.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-khuRhj0-.js → index-RvrzVxyQ.js} RENAMED
The diff for this file is too large to render. See raw diff
 
assets/{index-D4WvUqkN.css → index-btXf_hHY.css} RENAMED
The diff for this file is too large to render. See raw diff
 
assets/{input-CONfoWHZ.js → input-DBg77x-j.js} RENAMED
@@ -1 +1 @@
1
- import{r as n,j as s,$ as f,h as i,_ as c}from"./index-khuRhj0-.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};
 
1
+ import{r as n,j as s,$ as f,h as i,_ as c}from"./index-RvrzVxyQ.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-DAoGkyKK.js → skeleton-vJLXL7dU.js} RENAMED
@@ -1 +1 @@
1
- import{j as t,h as n}from"./index-khuRhj0-.js";function m({className:e,...s}){return t.jsx("div",{className:n("animate-pulse rounded-md bg-muted",e),...s})}export{m as S};
 
1
+ import{j as t,h as n}from"./index-RvrzVxyQ.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-Bqq4PHFq.js → transform-C19D-_iA.js} RENAMED
@@ -1 +1 @@
1
- import{a1 as H}from"./index-khuRhj0-.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};
 
1
+ import{a1 as H}from"./index-RvrzVxyQ.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-ECOTH_xV.js → useDebounce-UZQdQpzf.js} RENAMED
@@ -1 +1 @@
1
- import{r as o}from"./index-khuRhj0-.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-RvrzVxyQ.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-DRYtGZQa.js → useInfiniteQuery-D6kOn4ET.js} RENAMED
@@ -1 +1 @@
1
- import{Q as v,h as p}from"./useQuery-Caj49BNs.js";import{T as x,U as b}from"./index-khuRhj0-.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};
 
1
+ import{Q as v,h as p}from"./useQuery-DBPiiCZh.js";import{T as x,U as b}from"./index-RvrzVxyQ.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/{useIntersectionObserver-DbPRy1RB.js → useIntersectionObserver-b_ghxvrt.js} RENAMED
@@ -1 +1 @@
1
- import{r}from"./index-khuRhj0-.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-RvrzVxyQ.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-VlZbYGe6.js → useMutation-BChaaj62.js} RENAMED
@@ -1 +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-khuRhj0-.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};
 
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-RvrzVxyQ.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-BGzr0Zy3.js → usePapers-Dilp1UjP.js} RENAMED
@@ -1 +1 @@
1
- import{N as f}from"./index-khuRhj0-.js";import{u as g}from"./useQuery-Caj49BNs.js";import{u as m}from"./useInfiniteQuery-DRYtGZQa.js";import{a as p}from"./api-DxZAbqc3.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};
 
1
+ import{N as f}from"./index-RvrzVxyQ.js";import{u as g}from"./useQuery-DBPiiCZh.js";import{u as m}from"./useInfiniteQuery-D6kOn4ET.js";import{a as p}from"./api-5i4Mf2ca.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-BdoqZixi.js → usePeriodFilter-vtzRDJbK.js} RENAMED
@@ -1 +1 @@
1
- import{r}from"./index-khuRhj0-.js";import{b as a,s as f,c as u}from"./transform-Bqq4PHFq.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-RvrzVxyQ.js";import{b as a,s as f,c as u}from"./transform-C19D-_iA.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-Caj49BNs.js → useQuery-DBPiiCZh.js} RENAMED
@@ -1 +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-khuRhj0-.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};
 
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-RvrzVxyQ.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};
index.html CHANGED
@@ -26,8 +26,23 @@
26
  <link rel="icon" type="image/png" sizes="192x192" href="/favicon-192.png?v=2" />
27
  <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png?v=2" />
28
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.css" integrity="sha384-n8MVd4RsNIU0tAv4ct0nTaAbDJwPJzDEaqSD1odI+WdtXRGWt2kTvGFasHpSy3SV" crossorigin="anonymous" />
29
- <script type="module" crossorigin src="/assets/index-khuRhj0-.js"></script>
30
- <link rel="stylesheet" crossorigin href="/assets/index-D4WvUqkN.css">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  </head>
32
  <body>
33
  <div id="root"></div>
 
26
  <link rel="icon" type="image/png" sizes="192x192" href="/favicon-192.png?v=2" />
27
  <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png?v=2" />
28
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.css" integrity="sha384-n8MVd4RsNIU0tAv4ct0nTaAbDJwPJzDEaqSD1odI+WdtXRGWt2kTvGFasHpSy3SV" crossorigin="anonymous" />
29
+
30
+ <script>
31
+ // Only load Plausible on the production domain so local dev, staging IPs,
32
+ // and the Hugging Face Space mirror don't pollute the analytics dashboard.
33
+ (function () {
34
+ var host = window.location.hostname;
35
+ if (host === "paperswithcode.co" || host === "www.paperswithcode.co") {
36
+ var s = document.createElement("script");
37
+ s.defer = true;
38
+ s.setAttribute("data-domain", "paperswithcode.co");
39
+ s.src = "https://plausible.io/js/script.js";
40
+ document.head.appendChild(s);
41
+ }
42
+ })();
43
+ </script>
44
+ <script type="module" crossorigin src="/assets/index-RvrzVxyQ.js"></script>
45
+ <link rel="stylesheet" crossorigin href="/assets/index-btXf_hHY.css">
46
  </head>
47
  <body>
48
  <div id="root"></div>